소스 검색

scripts/qemustart: Allow specifying custom kernel for x86

Currently it's not possible to test boot squashfs root images, so this
patch now allows this use case as well.

Cc: Yousong Zhou <[email protected]>
Signed-off-by: Petr Štetiar <[email protected]>
Petr Štetiar 6 년 전
부모
커밋
b0e5e32daa
1개의 변경된 파일9개의 추가작업 그리고 1개의 파일을 삭제
  1. 9 1
      scripts/qemustart

+ 9 - 1
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" \