diff mbox series

[OpenWrt-Devel,2/3] scripts/qemustart: Allow specifying custom kernel for x86

Message ID 1553814003-11339-3-git-send-email-ynezz@true.cz
State Accepted
Headers show
Series scripts/qemustart: Add few useful features | expand

Commit Message

Petr Štetiar March 28, 2019, 11 p.m. UTC
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 | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/scripts/qemustart b/scripts/qemustart
index 3b47986..2012d43 100755
--- a/scripts/qemustart
+++ b/scripts/qemustart
@@ -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" \