Skip to contentSkip to conversation

runqemu: add OTA image

GIT PULL Anton Gerasimov 1 participant 2 messages Aug 16, 2016

lore
Share & tools
lore
#0 lore raw

Tipical use of OSTree deployment system relies on u-boot and specific boot filesysem organization. It would be useful to be able to emulate such system natively with qemu. On x86 machine u-boot can be run either as BIOS or with Coreboot BIOS, default SeaBIOS is not supported. Respective changes are made to runqemu.
Image type for otaimg is committed to meta-agl-extra/meta-sota at AGL and is copied to gerasimov/meta-sota branch at poky-contrib for convenience.

The following changes since commit 6b66e9317f4ec3a69f98f29836aafa35b52f3fc7:

Allow for simultaneous do_rootfs tasks with rpm (2016-08-12 15:25:22 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib gerasimov/qemuota
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=gerasimov/qemuota

Anton Gerasimov (1):
runqemu: add OTA image

 scripts/runqemu          | 27 +++++++++++++++++++++++++--
 scripts/runqemu-internal | 41 +++++++++++++++++++++++++++++++----------
 2 files changed, 56 insertions(+), 12 deletions(-)
Signature · 1 line
2.8.3
#1 lore raw

Add support for "otaimg" live image. This type of image also requires providing u-boot as bios.

---
 scripts/runqemu          | 27 +++++++++++++++++++++++++--
 scripts/runqemu-internal | 41 +++++++++++++++++++++++++++++++----------
 2 files changed, 56 insertions(+), 12 deletions(-)
scripts/runqemu +25 -2
index d52ea15..b6c9b54 100755
@@ -96,7 +96,7 @@ process_filename() {
 		    error "conflicting FSTYPE types [$FSTYPE] and [$EXT]"
 		fi
 		;;
-	/hddimg/|/hdddirect/|/vmdk/|/wic/|/qcow2/|/vdi/)
+	/hddimg/|/hdddirect/|/vmdk/|/wic/|/qcow2/|/vdi/|/otaimg/)
 		FSTYPE=$EXT
 		VM=$filename
 		ROOTFS=$filename
@@ -128,7 +128,7 @@ while true; do
         "ext"[234] | "jffs2" | "nfs" | "btrfs")
             check_fstype_conflicts $arg
             ;;
-        "hddimg" | "hdddirect" | "wic" | "vmdk" | "qcow2" | "vdi" | "iso")
+        "hddimg" | "hdddirect" | "wic" | "vmdk" | "qcow2" | "vdi" | "iso" | "otaimg")
             check_fstype_conflicts $arg
             IS_VM="true"
             ;;
@@ -447,6 +447,29 @@ findimage() {
     exit 1
 }
 
+# Bios is necessary when using otaimg, look for it
+if [ "$FSTYPE" = "otaimg" ]; then
+    setup_path_vars 1
+    bios_option=`expr "$SCRIPT_QEMU_OPT" : '.*\(-bios\)'`
+    echo "bios_option: $bios_option"
+    if [ -z $bios_option ]; then
+        echo "LOOK FOR BIOS at ${DEPLOY_DIR_IMAGE}"
+        # if -bios wasn't specified explicitly, try to look at the default location
+        if [ -e "${DEPLOY_DIR_IMAGE}/u-boot.rom" ]; then
+            SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -bios ${DEPLOY_DIR_IMAGE}/u-boot.rom"
+        else
+            error "OTA image requires specifying u-boot as BIOS"
+        fi
+    fi
+fi
+
+
+# Kernel command line is stored in compressed format as u-boot environment
+#   which breaks determining drive interface with grep in runqemu-internal
+if [ "$FSTYPE" = "otaimg" ]; then
+    FORCE_DRIVE_IF="ide"
+fi
+
 if [ -e "$ROOTFS" -a -z "$FSTYPE" ]; then
     # Extract the filename extension
     EXT=`echo $ROOTFS | awk -F . '{ print \$NF }'`
scripts/runqemu-internal +31 -10

47 lines not on this page · raw message

Signature · 1 line
2.8.3