Commit 4da0bc9a authored by Andrew Jones's avatar Andrew Jones Committed by Radim Krčmář
Browse files

arch-run: introduce initrd_create



Encapsulate the preparation of the optional initrd command line
option.
Signed-off-by: Andrew Jones's avatarAndrew Jones <drjones@redhat.com>
Reviewed-by: default avatarLaurent Vivier <lvivier@redhat.com>
Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
parent 2667b05e
......@@ -71,10 +71,11 @@ if $qemu $M -device '?' 2>&1 | grep pci-testdev > /dev/null; then
pci_testdev="-device pci-testdev"
fi
initrd_create
M+=",accel=$ACCEL"
command="$qemu -nodefaults $M -cpu $processor $chr_testdev $pci_testdev"
[ -f "$ENV" ] && command+=" -initrd $ENV"
command+=" -display none -serial stdio -kernel"
command+=" -display none -serial stdio $INITRD -kernel"
command="$(timeout_cmd) $command"
echo $command "$@"
......
......@@ -35,11 +35,12 @@ if ! $qemu -machine '?' 2>&1 | grep 'pseries' > /dev/null; then
exit 2
fi
initrd_create
M='-machine pseries'
M+=",accel=$ACCEL"
command="$qemu -nodefaults $M -bios $FIRMWARE"
[ -f "$ENV" ] && command+=" -initrd $ENV"
command+=" -display none -serial stdio -kernel"
command+=" -display none -serial stdio $INITRD -kernel"
command="$(migration_cmd) $(timeout_cmd) $command"
echo $command "$@"
......
......@@ -155,3 +155,9 @@ search_qemu_binary ()
command -v $qemu
export PATH=$save_path
}
initrd_create ()
{
unset INITRD
[ -f "$ENV" ] && INITRD="-initrd $ENV"
}
......@@ -26,9 +26,10 @@ else
pc_testdev="-device testdev,chardev=testlog -chardev file,id=testlog,path=msr.out"
fi
initrd_create
command="${qemu} -nodefaults -enable-kvm $pc_testdev -vnc none -serial stdio $pci_testdev $hyperv_testdev"
[ -f "$ENV" ] && command+=" -initrd $ENV"
command+=" -kernel"
command+=" $INITRD -kernel"
command="$(timeout_cmd) $command"
echo ${command} "$@"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment