aboutgitcodebugslistschat
path: root/test/prepare-distro-img.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/prepare-distro-img.sh')
-rwxr-xr-xtest/prepare-distro-img.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/prepare-distro-img.sh b/test/prepare-distro-img.sh
new file mode 100755
index 0000000..aeb97a0
--- /dev/null
+++ b/test/prepare-distro-img.sh
@@ -0,0 +1,18 @@
+#! /bin/sh -e
+
+IMG="$1"
+PASST_FILES="$(echo ../*.c ../*.h ../*.sh ../*.1 ../Makefile)"
+
+virt-edit -a $IMG /lib/systemd/system/serial-getty@.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --autologin root -8 --keep-baud 115200,38400,9600 %I $TERM/g'
+
+guestfish --rw -a $IMG -i <<EOF
+rm-f /usr/lib/systemd/system/cloud-config.service
+rm-f /usr/lib/systemd/system/cloud-init.service
+rm-f /usr/lib/systemd/system/cloud-init-local.service
+rm-f /usr/lib/systemd/system/cloud-final.service
+rm-f /etc/init.d/cloud-config
+rm-f /etc/init.d/cloud-final
+rm-f /etc/init.d/cloud-init
+rm-f /etc/init.d/cloud-init-local
+copy-in $PASST_FILES /root/
+EOF