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:
Francis Lam 2017-07-13 00:33:49 -04:00
parent 2a9ca6fdba
commit 11aca354e9
No known key found for this signature in database
GPG Key ID: 0A59C698920806EB
2 changed files with 17 additions and 3 deletions

View File

@ -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:"

View File

@ -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