mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-18 20:47:55 +00:00
kexec-parse-boot: Trim device specifications from GRUB entries
Some configs specify kernel/initrd paths relative to a device (often found in a variable). Assume the device is the /boot partition and ignore the device specification. Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
This commit is contained in:
parent
e19aadf4cb
commit
2a8a7655d3
@ -94,11 +94,17 @@ grub_entry() {
|
||||
modules="$modules|module $path"
|
||||
;;
|
||||
linux*)
|
||||
kernel=`echo $trimcmd | cut -d\ -f2`
|
||||
# Some configs have a device specification in the kernel
|
||||
# or initrd path. Assume this would be /boot and remove
|
||||
# it. Keep the '/' following the device, since this
|
||||
# path is relative to the device root, not the config
|
||||
# location.
|
||||
kernel=`echo $trimcmd | sed "s/([^)]*)//g" | cut -d\ -f2`
|
||||
append=`echo $trimcmd | cut -d\ -f3-`
|
||||
;;
|
||||
initrd*)
|
||||
initrd="$val"
|
||||
# Trim off device specification as above
|
||||
initrd="$(echo "$val" | sed "s/([^)]*)//g")"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user