aboutsummaryrefslogtreecommitdiffstats
path: root/stage2
diff options
context:
space:
mode:
authorJacen <[email protected]>2017-09-07 23:47:35 +0200
committerXECDesign <[email protected]>2017-09-14 10:12:30 +0100
commit26fcf59f3f36973f7ad6163867c235291343aa64 (patch)
tree5564fa96fe016220111cbc5795cb35a2972f1088 /stage2
parent496e41575eeb9fa13f394ffb407b7bc1d00b21c2 (diff)
[adding] qemu emulation layout to test images with qemu
Diffstat (limited to 'stage2')
-rwxr-xr-xstage2/01-sys-tweaks/01-run.sh20
-rw-r--r--stage2/01-sys-tweaks/files/90-qemu.rules3
-rw-r--r--stage2/EXPORT_IMAGE3
3 files changed, 26 insertions, 0 deletions
diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh
index 4c72d85..b735f58 100755
--- a/stage2/01-sys-tweaks/01-run.sh
+++ b/stage2/01-sys-tweaks/01-run.sh
@@ -17,8 +17,28 @@ systemctl disable nfs-common
systemctl disable rpcbind
systemctl disable ssh
systemctl enable regenerate_ssh_host_keys
+EOF
+
+if [ "${USE_QEMU}" = "1" ]; then
+ echo "enter QEMU mode"
+ install -m 644 files/90-qemu.rules ${ROOTFS_DIR}/etc/udev/rules.d/
+ if [ -e ${ROOTFS_DIR}/etc/ld.so.preload.disabled ]; then
+ rm ${ROOTFS_DIR}/etc/ld.so.preload.disabled
+ touch ${ROOTFS_DIR}/etc/ld.so.preload.disabled
+ fi
+ if [ -e ${ROOTFS_DIR}/etc/ld.so.preload ]; then
+ rm ${ROOTFS_DIR}/etc/ld.so.preload
+ touch ${ROOTFS_DIR}/etc/ld.so.preload
+ fi
+ on_chroot << EOF
+systemctl disable resize2fs_once
+EOF
+ echo "leaving QEMU mode"
+else
+ on_chroot << EOF
systemctl enable resize2fs_once
EOF
+fi
on_chroot << \EOF
for GRP in input spi i2c gpio; do
diff --git a/stage2/01-sys-tweaks/files/90-qemu.rules b/stage2/01-sys-tweaks/files/90-qemu.rules
new file mode 100644
index 0000000..cfe8998
--- /dev/null
+++ b/stage2/01-sys-tweaks/files/90-qemu.rules
@@ -0,0 +1,3 @@
+KERNEL=="sda", SYMLINK+="mmcblk0"
+KERNEL=="sda?", SYMLINK+="mmcblk0p%n"
+KERNEL=="sda2", SYMLINK+="root"
diff --git a/stage2/EXPORT_IMAGE b/stage2/EXPORT_IMAGE
index 8ef6ebe..aa8f936 100644
--- a/stage2/EXPORT_IMAGE
+++ b/stage2/EXPORT_IMAGE
@@ -1 +1,4 @@
IMG_SUFFIX="-lite"
+if [ "${USE_QEMU}" = "1" ]; then
+ export IMG_SUFFIX="${IMG_SUFFIX}-qemu"
+fi