diff options
author | Petr Štetiar <ynezz@true.cz> | 2019-03-28 21:13:26 +0000 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2019-04-08 18:37:05 +0200 |
commit | 4953b3891ad32bae9cbe3843fb42017a156c1a6f (patch) | |
tree | 2d2bb887a6579ce3f344c92c389db1a8e5816f30 /scripts | |
parent | b0e5e32daa283c2686f529d57360fda828c758bb (diff) | |
download | upstream-4953b3891ad32bae9cbe3843fb42017a156c1a6f.tar.gz upstream-4953b3891ad32bae9cbe3843fb42017a156c1a6f.tar.bz2 upstream-4953b3891ad32bae9cbe3843fb42017a156c1a6f.zip |
scripts/qemustart: Allow specifying custom rootfs for malta
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>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/qemustart | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/qemustart b/scripts/qemustart index 2012d43a85..951f225272 100755 --- a/scripts/qemustart +++ b/scripts/qemustart @@ -205,6 +205,7 @@ start_qemu_malta() { local is64 local isel local qemu_exe + local rootfs="$o_rootfs" local kernel="$o_kernel" local mach="${o_mach:-malta}" @@ -215,6 +216,16 @@ start_qemu_malta() { [ -n "$kernel" ] || kernel="$o_bindir/openwrt-malta-${o_subtarget%-*}-vmlinux-initramfs.elf" + [ -z "$rootfs" ] || { + if [ ! -f "$rootfs" -a -s "$rootfs.gz" ]; then + gunzip "$rootfs.gz" + fi + o_qemu_extra+=( \ + "-drive" "file=$rootfs,format=raw" \ + "-append" "root=/dev/sda rootwait" \ + ) + } + # NOTE: order of wan, lan -device arguments matters as it will affect which # one will be actually used as the wan, lan network interface inside the # guest machine |