Skip to content

Commit

Permalink
kexec-parse-boot/bls: Strip boot dir from front of grub entries (#804)
Browse files Browse the repository at this point in the history
Some grub configs/bls entries contain the full paths to the
kernel/initrd files, which the parsers currently fail to handle,
causing a failed boot without any useful error being presented to the user.

To fix this, strip the bootdir prefix from the menu entries when parsing,
should it exist.

Test: build/boot Librem 13v2 w/F32 and bls entries containing absolute paths.

Signed-off-by: Matt DeVillier <[email protected]>
  • Loading branch information
MrChromebox authored Aug 24, 2020
1 parent f23ced0 commit a075347
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions initrd/bin/kexec-parse-bls
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ bls_entry() {
name=$val
;;
linux*)
kernel=$val
kernel=${val#"$bootdir"}
;;
initrd*)
initrd=$val
initrd=${val#"$bootdir"}
;;
options)
# default is "options $kernelopts"
Expand Down
4 changes: 2 additions & 2 deletions initrd/bin/kexec-parse-boot
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ syslinux_entry() {
state="search"
;;
*)
kernel="$val"
kernel="${val#"$bootdir"}"
esac
;;
initrd* | INITRD* )
initrd="$val"
initrd="${val#"$bootdir"}"
;;
append* | APPEND* )
if [ "$kexectype" = "multiboot" -o "$kexectype" = "xen" ]; then
Expand Down

0 comments on commit a075347

Please sign in to comment.