mirror of
https://github.com/linuxboot/heads.git
synced 2025-01-18 10:46:44 +00:00
Fixed edge case in kernel argument injection
Debian 9 installer doesn't have kernel arguments so the iommu fix wasn't being applied properly.
This commit is contained in:
parent
2a9ca6fdba
commit
11aca354e9
@ -45,6 +45,7 @@ fix_file_path() {
|
||||
fi
|
||||
}
|
||||
|
||||
adjusted_cmd_line="n"
|
||||
adjust_cmd_line() {
|
||||
if [ -n "$cmdremove" ]; then
|
||||
for i in $cmdremove; do
|
||||
@ -55,6 +56,7 @@ adjust_cmd_line() {
|
||||
if [ -n "$cmdadd" ]; then
|
||||
cmdline="$cmdline $cmdadd"
|
||||
fi
|
||||
adjusted_cmd_line="y"
|
||||
}
|
||||
|
||||
module_number="1"
|
||||
@ -116,6 +118,14 @@ done << EOF
|
||||
$kexecparams
|
||||
EOF
|
||||
|
||||
if [ "$adjusted_cmd_line" = "n" ]; then
|
||||
if [ "$kexectype" = "elf" ]; then
|
||||
kexeccmd="$kexeccmd --append=\"$cmdadd\""
|
||||
else
|
||||
die "Failed to add required kernel commands: $cmdadd"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$dryrun" = "y" ]; then exit 0; fi
|
||||
|
||||
echo "Loading the new kernel:"
|
||||
|
@ -2,7 +2,10 @@
|
||||
set -e -o pipefail
|
||||
bootdir="$1"
|
||||
file="$2"
|
||||
filedir=`dirname $file`
|
||||
|
||||
if [ -z "$bootdir" -o -z "$file" ]; then
|
||||
die "Usage: $0 /boot/ /boot/grub/grub.cfg"
|
||||
fi
|
||||
|
||||
reset_entry() {
|
||||
name=""
|
||||
@ -13,6 +16,7 @@ reset_entry() {
|
||||
append=""
|
||||
}
|
||||
|
||||
filedir=`dirname $file`
|
||||
bootdir=${bootdir%%"/"}
|
||||
bootlen=${#bootdir}
|
||||
appenddir=${filedir:$bootlen}
|
||||
@ -111,7 +115,7 @@ syslinux_end() {
|
||||
*) newappend="$newappend $param" ;;
|
||||
esac
|
||||
done
|
||||
append="$newappend"
|
||||
append="${newappend##' '}"
|
||||
fi
|
||||
|
||||
echo_entry
|
||||
@ -196,7 +200,7 @@ do
|
||||
syslinux_entry
|
||||
;;
|
||||
esac
|
||||
done < $file
|
||||
done < "$file"
|
||||
|
||||
# handle EOF case
|
||||
if [ "$state" = "syslinux" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user