scripts/qemustart: Allow specifying custom kernel for x86
authorPetr Štetiar <ynezz@true.cz>
Thu, 28 Mar 2019 20:51:34 +0000 (20:51 +0000)
committerPetr Štetiar <ynezz@true.cz>
Mon, 8 Apr 2019 16:37:05 +0000 (18:37 +0200)
Currently it's not possible to test boot squashfs root images, so this
patch now allows this use case as well.

Cc: Yousong Zhou <yszhou4tech@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
scripts/qemustart

index 3b479860e9c5e9ecbf9a30ee25f5198055191fca..2012d43a85287160c5a2adaaee89b613de18fd97 100755 (executable)
@@ -233,9 +233,10 @@ start_qemu_malta() {
 }
 
 start_qemu_x86() {
+       local qemu_exe
+       local kernel="$o_kernel"
        local rootfs="$o_rootfs"
        local mach="${o_mach:-pc}"
-       local qemu_exe
 
        [ -n "$rootfs" ] || {
                rootfs="$o_bindir/openwrt-$o_target-${o_subtarget%-*}-combined-ext4.img"
@@ -257,6 +258,13 @@ start_qemu_x86() {
                        ;;
        esac
 
+       [ -n "$kernel" ] && {
+           o_qemu_extra+=( \
+               "-kernel" "$kernel" \
+               "-append" "root=/dev/vda console=ttyS0 rootwait" \
+           )
+       }
+
        [ -n $o_nonetwork ] || {
                o_qemu_extra+=( \
                        "-netdev" "bridge,id=lan,br=$BR_LAN,helper=$HELPER" \