X-Git-Url: https://iankelling.org/git/?p=automated-distro-installer;a=blobdiff_plain;f=fai%2Fconfig%2Fscripts%2FIANK%2F11-iank;fp=fai%2Fconfig%2Fscripts%2FIANK%2F11-iank;h=0b8d6c5576caba9763234f1de2bbca79f9a0e41a;hp=43fc13bcf5ff83db61307ac733f38278f6019573;hb=f856a11aa6b4aaa454a5c93c4f1d9672591ca2eb;hpb=6ba7f4d1207a9421d5a0a7495fb813d5e84fad21 diff --git a/fai/config/scripts/IANK/11-iank b/fai/config/scripts/IANK/11-iank index 43fc13b..0b8d6c5 100755 --- a/fai/config/scripts/IANK/11-iank +++ b/fai/config/scripts/IANK/11-iank @@ -19,7 +19,10 @@ if [[ -e /a/bin/fai/fai-wrapper ]]; then } fi - +if [[ $FAI_ROOT != / ]]; then + bprogs_pre=/srv + chroot="chroot $FAI_ROOT" +fi # -r = recursive # -i = ignore non-matching class warnings, always exit 0 @@ -53,13 +56,13 @@ $FAI/distro-install-common/end # I run this as a single post-fai script to update things that have changed. tmpfile1=$(mktemp) # this can fail if we need an apt update -chroot $FAI_ROOT /usr/bin/apt-cache policy >$tmpfile1 ||: +$chroot /usr/bin/apt-cache policy >$tmpfile1 ||: fcopy -riB /etc/apt tmpfile2=$(mktemp) -chroot $FAI_ROOT /usr/bin/apt-cache policy >$tmpfile2 +$chroot /usr/bin/apt-cache policy >$tmpfile2 if ! diff -q $tmpfile1 $tmpfile2; then - chroot $FAI_ROOT /usr/bin/apt update + $chroot /usr/bin/apt update fi # outside of fai, this seems to regularly lead to # E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable) @@ -109,7 +112,7 @@ TimeoutStartSec=20 WantedBy=dev-disk-by\x2did-ata\x2dSamsung_SSD_870_QVO_8TB_S5VUNG0N900656V.device EOF - chroot $FAI_ROOT bash <<'EOFOUTER' + $chroot bash <<'EOFOUTER' systemctl enable myncq.service /usr/bin/myncq no-upgrub EOFOUTER @@ -159,7 +162,7 @@ fi # use networkmanager if this host has wireless. if [[ $HOSTNAME == bo ]] || type -p iw &>/dev/null && [[ $(iw dev) ]]; then - chroot $FAI_ROOT bash <&1 | grep -Fx "Status: install ok installed" &>/dev/null; then + urls=( + ${pre}headers-${vb}_${vc}_all.deb + ${pre}{headers,image-unsigned,modules}-${vb}-generic_${vc}_amd64.deb + ) + wget "${urls[@]}" + $chroot bash <