Tweaks to allow qubes install w/o custom script

usb-boot automatically uses internal xen binary / command line
when multiboot is detected.

also tweaked to evaluate/remove variable refs in kexec arguments
This commit is contained in:
Francis Lam 2017-07-02 14:27:02 -04:00
parent 1f8eaa696e
commit 76a20288a3
No known key found for this signature in database
GPG Key ID: 0A59C698920806EB
2 changed files with 18 additions and 8 deletions

View File

@ -33,6 +33,7 @@ adjust_cmd_line() {
fi
}
first_module=y
while read line
do
key=`echo $line | cut -d\ -f1`
@ -40,16 +41,23 @@ do
restval=`echo $line | cut -d\ -f3-`
if [ "$key" = "kernel" ]; then
fix_file_path
kexeccmd="$kexeccmd -l $filepath"
if [ "$kexectype" = "multiboot" ]; then
cmdline="$restval"
adjust_cmd_line
kexeccmd="$kexeccmd --command-line \"$cmdline\""
# always overload xen and with custom arguments
# TODO: control this replacement via flag
kexeccmd="$kexeccmd -l /bin/xen.gz"
kexeccmd="$kexeccmd --command-line \"no-real-mode reboot=no\""
else
kexeccmd="$kexeccmd -l $filepath"
fi
fi
if [ "$key" = "module" ]; then
fix_file_path
kexeccmd="$kexeccmd --module \"$filepath $restval\""
cmdline="$restval"
if [ -n $first_module ]; then
adjust_cmd_line
unset first_module
fi
kexeccmd="$kexeccmd --module \"$filepath $cmdline\""
fi
if [ "$key" = "initrd" ]; then
fix_file_path

View File

@ -15,14 +15,16 @@ echo_entry() {
if [ "$kexectype" = "elf" ]; then
if [ -z "$kernel" ]; then return; fi
entry="$name|$kexectype|kernel $kernel|initrd $initrd"
entry="$name|$kexectype|kernel $kernel"
if [ -n "$initrd" ]; then entry="$entry|initrd $initrd"; fi
if [ -n "$append" ]; then entry="$entry|append $append"; fi
echo "$entry"
echo $(eval "echo \"$entry\"")
fi
if [ "$kexectype" = "multiboot" ]; then
if [ -z "$kernel" ]; then return; fi
echo "$name|$kexectype|kernel $kernel$modules"
echo $(eval "echo \"$name|$kexectype|kernel $kernel$modules\"")
fi
}