trisquel-automatic-netinstall-qemu: make mirror/http/proxy configurable.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
This commit is contained in:
Denis 'GNUtoo' Carikli 2024-08-25 03:17:25 +02:00
parent 3785148831
commit 858988e801
Signed by: GNUtoo
GPG Key ID: 5F5DFCC14177E263
4 changed files with 25 additions and 1 deletions

View File

@ -14,6 +14,7 @@
/grub/** /grub/**
/grub.iso /grub.iso
/Makefile /Makefile
/preseed.cfg
/preseed.img /preseed.img
/rootfs.img /rootfs.img
/rootfs.img.tmp /rootfs.img.tmp

View File

@ -54,6 +54,10 @@ grub/boot/grub/grub.cfg: Makefile grub.cfg
grub.iso: Makefile grub/boot/linux grub/boot/initrd.gz grub/boot/grub/grub.cfg grub.iso: Makefile grub/boot/linux grub/boot/initrd.gz grub/boot/grub/grub.cfg
grub-mkrescue -o $@ grub grub-mkrescue -o $@ grub
preseed.cfg: preseed.cfg.tmpl
sed 's#\@MIRROR_HTTP_PROXY\@#$(MIRROR_HTTP_PROXY)#g' \
preseed.cfg.tmpl > $@
preseed.img: Makefile preseed.cfg preseed.img: Makefile preseed.cfg
dd if=/dev/zero of=$@.tmp count=2048 dd if=/dev/zero of=$@.tmp count=2048
mkfs.vfat --mbr=y -n MEDIA $@.tmp mkfs.vfat --mbr=y -n MEDIA $@.tmp

View File

@ -22,6 +22,7 @@ AC_PROG_MKDIR_P
AM_INIT_AUTOMAKE([foreign]) AM_INIT_AUTOMAKE([foreign])
AC_SUBST([ENABLE_KVM], []) AC_SUBST([ENABLE_KVM], [])
AC_SUBST([MIRROR_HTTP_PROXY], [])
AC_SUBST([TRISQUEL_ROOTFS_SIZE], []) AC_SUBST([TRISQUEL_ROOTFS_SIZE], [])
AC_SUBST([TRISQUEL_NETINSTALL], []) AC_SUBST([TRISQUEL_NETINSTALL], [])
@ -33,6 +34,21 @@ AC_ARG_ENABLE(kvm,
AM_CONDITIONAL( [WANT_KVM], [test x"$kvm" = x"yes"]) AM_CONDITIONAL( [WANT_KVM], [test x"$kvm" = x"yes"])
AC_ARG_WITH(
[mirror-http-proxy],
[AS_HELP_STRING(
[--with-mirror-http-proxy=URL],
[URL to the mirror HTTP proxy (default: not set (no mirror)).
The proxy configuration is then used during both the netinstall
installation and after as well (it's added to /etc/apt/apt.conf).
The chosen URL should be reachable from QEMU. As an example, if
you use the apt-cacher-ng default configuration and make it
listen on localhost, you should use http://10.0.2.2:3142 because
localhost becomes 10.0.2.2 with the current QEMU configuration
and because the port 3142 is the default port for apt-cacher-ng.])],
[MIRROR_HTTP_PROXY=$withval],
[MIRROR_HTTP_PROXY=])
AC_ARG_WITH( AC_ARG_WITH(
[--with-trisquel-target-rootfs-size], [--with-trisquel-target-rootfs-size],
[AS_HELP_STRING( [AS_HELP_STRING(
@ -130,3 +146,6 @@ AS_IF([test x"$kvm" = x"yes"],
[echo "- Kvm: disabled"]) [echo "- Kvm: disabled"])
echo "- Trisquel netinstall path: $TRISQUEL_NETINSTALL" echo "- Trisquel netinstall path: $TRISQUEL_NETINSTALL"
echo "- Trisquel target rootfs size: $TRISQUEL_ROOTFS_SIZE" echo "- Trisquel target rootfs size: $TRISQUEL_ROOTFS_SIZE"
AS_IF([test x"$MIRROR_HTTP_PROXY" = x""],
[echo "- Trisquel mirror http proxy: disabled"],
[echo "- Trisquel mirror http proxy: $MIRROR_HTTP_PROXY"])

View File

@ -34,7 +34,7 @@ d-i netcfg/get_hostname string test
d-i mirror/country string manual d-i mirror/country string manual
d-i mirror/http/directory string /trisquel d-i mirror/http/directory string /trisquel
d-i mirror/http/hostname string mirror.fsf.org d-i mirror/http/hostname string mirror.fsf.org
d-i mirror/http/proxy string d-i mirror/http/proxy string @MIRROR_HTTP_PROXY@
popularity-contest popularity-contest/participate boolean false popularity-contest popularity-contest/participate boolean false
# Partitioning # Partitioning