diff --git a/README.adoc b/README.adoc index ceae3a5..3cfe855 100644 --- a/README.adoc +++ b/README.adoc @@ -95,6 +95,12 @@ If you change any package besides `kernel_module`, you must also request those p Those aren't turned on by default because they take quite a few seconds. +Linux and QEMU rebuilds are so common that we have dedicated shortcut flags for them: + +.... +./build -l -q +.... + ==== Filesystem persistency The root filesystem is persistent across: diff --git a/build b/build index 4fa83eb..557ff49 100755 --- a/build +++ b/build @@ -7,7 +7,7 @@ j="$(($(nproc) - 2))" post_script_args='' x11=false v=0 -while getopts 'a:j:p:St:v' OPT; do +while getopts 'a:j:lp:qSt:v' OPT; do case "$OPT" in a) arch="$OPTARG" @@ -15,9 +15,15 @@ while getopts 'a:j:p:St:v' OPT; do j) j="$OPTARG" ;; + l) + extra_targets="$extra_args linux-reconfigure" + ;; p) post_script_args="$OPTARG" ;; + q) + extra_targets="$extra_args host-qemu-reconfigure" + ;; S) qemu_sdl='' ;; diff --git a/buildroot_config_fragment b/buildroot_config_fragment index d4139fb..8cc8448 100644 --- a/buildroot_config_fragment +++ b/buildroot_config_fragment @@ -5,6 +5,7 @@ BR2_PACKAGE_OVERRIDE_FILE="../buildroot_override" BR2_PACKAGE_STRACE=y BR2_ROOTFS_OVERLAY="../rootfs_overlay" BR2_ROOTFS_POST_BUILD_SCRIPT="../rootfs_post_build_script" +BR2_ROOTFS_POST_IMAGE_SCRIPT="../rootfs_post_image_script" BR2_ROOTFS_USERS_TABLES="../user_table" # Host GDB diff --git a/rootfs_post_build_script b/rootfs_post_build_script index 51b16f7..3537bf8 100755 --- a/rootfs_post_build_script +++ b/rootfs_post_build_script @@ -10,7 +10,6 @@ net=true while getopts 'n' OPT; do case "$OPT" in n) - echo asdfqwer net=false ;; esac diff --git a/rootfs_post_image_script b/rootfs_post_image_script new file mode 100755 index 0000000..dc1572b --- /dev/null +++ b/rootfs_post_image_script @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +images_dir="$1" +cd "$images_dir" +"${HOST_DIR}/bin/qemu-img" convert -f raw -O qcow2 rootfs.ext2 rootfs.ext2.qcow2 diff --git a/run b/run index e84f389..88da178 100755 --- a/run +++ b/run @@ -65,7 +65,7 @@ case "$arch" in -append 'root=/dev/vda nopat $extra_append' \ -device edu \ -device virtio-net-pci,netdev=net0 \ --drive file=${images_dir}/rootfs.ext2,if=virtio,format=raw \ +-drive file=${images_dir}/rootfs.ext2.qcow2,if=virtio,format=qcow2 \ -kernel ${images_dir}/bzImage \ $extra_flags \ " @@ -78,7 +78,7 @@ $extra_flags \ -M versatilepb \ -append 'root=/dev/sda $extra_append' \ -device rtl8139,netdev=net0 \ --drive file=${images_dir}/rootfs.ext2,if=scsi,format=raw \ +-drive file=${images_dir}/rootfs.ext2.qcow2,if=scsi,format=qcow2 \ -dtb ${images_dir}/versatile-pb.dtb \ -kernel ${images_dir}/zImage \ -serial stdio \