From b9abe6c2b31246fbed95109da774e99841144455 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Sat, 6 Jul 2024 03:04:46 +0200 Subject: [PATCH] trisquel-automatic-netinstall-qemu: Reduce storage usage. Signed-off-by: Denis 'GNUtoo' Carikli --- trisquel-automatic-netinstall-qemu/Makefile.am | 2 +- trisquel-automatic-netinstall-qemu/configure.ac | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/trisquel-automatic-netinstall-qemu/Makefile.am b/trisquel-automatic-netinstall-qemu/Makefile.am index 9ff46f3..fe4abee 100644 --- a/trisquel-automatic-netinstall-qemu/Makefile.am +++ b/trisquel-automatic-netinstall-qemu/Makefile.am @@ -61,7 +61,7 @@ preseed.img: Makefile preseed.cfg mv $@.tmp $@ rootfs.img.tmp: Makefile - qemu-img create -f qcow2 $@ 10G + qemu-img create -f qcow2 $@ $(TRISQUEL_ROOTFS_SIZE) # The 790M were found by trial and error. At 789M the netinstall # complains about "low memory". diff --git a/trisquel-automatic-netinstall-qemu/configure.ac b/trisquel-automatic-netinstall-qemu/configure.ac index dc64b95..f5d792a 100644 --- a/trisquel-automatic-netinstall-qemu/configure.ac +++ b/trisquel-automatic-netinstall-qemu/configure.ac @@ -22,6 +22,7 @@ AC_PROG_MKDIR_P AM_INIT_AUTOMAKE([foreign]) AC_SUBST([ENABLE_KVM], []) +AC_SUBST([TRISQUEL_ROOTFS_SIZE], []) AC_SUBST([TRISQUEL_NETINSTALL], []) AC_ARG_ENABLE(kvm, @@ -32,6 +33,16 @@ AC_ARG_ENABLE(kvm, AM_CONDITIONAL( [WANT_KVM], [test x"$kvm" = x"yes"]) +AC_ARG_WITH( + [--with-trisquel-target-rootfs-size], + [AS_HELP_STRING( + [--trisquel-target-rootfs-size=SIZE], + [Size of the target image (default=3.5G). The size will be passed + as-is to the 'qemu-img create' command. See 'man 1 qemu-img' for + more details.])], + [TRISQUEL_ROOTFS_SIZE=$withval], + [TRISQUEL_ROOTFS_SIZE=3.5G]) dnl 3.4G: Fail, 3.5G: OK + AC_ARG_WITH( [trisquel-netinstall], [AS_HELP_STRING( @@ -118,3 +129,4 @@ AS_IF([test x"$kvm" = x"yes"], [echo "- Kvm: enabled"], [echo "- Kvm: disabled"]) echo "- Trisquel netinstall path: $TRISQUEL_NETINSTALL" +echo "- Trisquel target rootfs size: $TRISQUEL_ROOTFS_SIZE"