X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lbuild-initvm.sh;h=6897c5d3977a248e5fc3bdc1e232113f0cd56449;hb=6cdd17193b49743e1d05804e8875f373a235f014;hp=b8615d753c495ad2c6792afaff0da382374d51c3;hpb=2a9bb47d902fa778cdf2607e7b36b85e192387d8;p=build.git diff --git a/lbuild-initvm.sh b/lbuild-initvm.sh index b8615d75..6897c5d3 100755 --- a/lbuild-initvm.sh +++ b/lbuild-initvm.sh @@ -82,7 +82,7 @@ function package_method () { case $fcdistro in f[0-9]*|centos[0-9]*|sl[0-9]*) echo dnf ;; - wheezy|jessie|trusty|xenial|bionic|focal) + wheezy|jessie|trusty|xenial|bionic|focal|jammy) echo debootstrap ;; *) echo "Unknown package_method for distro $fcdistro" ;; @@ -100,7 +100,7 @@ function network_method () { echo ifcfg ;; wheezy|jessie|trusty|xenial|bionic) echo interfaces ;; - focal) + focal|jammy) echo systemd ;; *) echo "Unknown network_method for distro $fcdistro" ;; @@ -396,7 +396,7 @@ function debian_mirror () { case $fcdistro in wheezy|jessie) echo http://ftp2.fr.debian.org/debian/ ;; - trusty|xenial|bionic|focal) + trusty|xenial|bionic|focal|jammy) echo http://www-ftp.lip6.fr/pub/linux/distributions/Ubuntu/archive/ ;; *) echo unknown distro $fcdistro; exit 1;; esac @@ -532,7 +532,14 @@ function setup_lxc() { ### set up resolv.conf from host # ubuntu precise and on, /etc/resolv.conf is a symlink to ../run/resolvconf/resolv.conf [ -h $lxc_root/etc/resolv.conf ] && rm -f $lxc_root/etc/resolv.conf - cp /etc/resolv.conf $lxc_root/etc/resolv.conf + ### since fedora36, our hosts use systemd-resolved, but the guests can't use that + # so the administrator has the option to create /etc/resolv.conf.containers + # and if that file exists it will be copied in the containers instead of /etc/resolv.conf + if [ -f /etc/resolv.conf.containers ]; then + cp /etc/resolv.conf.containers $lxc_root/etc/resolv.conf + else + cp /etc/resolv.conf $lxc_root/etc/resolv.conf + fi ### and /etc/hosts for at least localhost [ -f $lxc_root/etc/hosts ] || echo "127.0.0.1 localhost localhost.localdomain" > $lxc_root/etc/hosts