mk-basefile fails on emtpy EXCLUDE_<DEBIANVERSION> variable
Martin Krämer
mk.maddin at gmail.com
Mon Jun 4 20:05:37 CEST 2018
Hi everyone,
I found that current version of mk-basefile ( 4.7 and older) fails if
variable
EXCLUDE_<DEBIANVERSION> is an empty value:
root at faiserver:~#
/usr/share/doc/fai-doc/examples/simple/basefiles/mk-basefile -J BUSTER64
E: unrecognized or invalid option --exclude=
chroot: failed to run command ‘apt-get’: No such file or directory
/usr/share/doc/fai-doc/examples/simple/basefiles/mk-basefile: line 111:
/tmp/basefiles.xMSHTqxy/etc/machine-id: No such file or directory
Below is a short patch for it:
@@ -174,6 +174,7 @@
dist=${DIST%%[0-9][0-9]}
local exc="EXCLUDE_$dist"
+ [ -n "${!exc}" ] && exc="--exclude=${!exc}" || unset exc
dist=${dist,,}
check
@@ -182,7 +183,7 @@
fi
if [ -n "$arch" ]; then
- qemu-debootstrap --arch $arch --exclude=${!exc} $inc $dist $xtmp $mirror
+ qemu-debootstrap --arch $arch ${exc} $inc $dist $xtmp $mirror
target="${target}_${arch^^}"
else
if [[ $DIST =~ 64 ]]; then
@@ -190,7 +191,7 @@
else
arch=i386
fi
- debootstrap --arch $arch --exclude=${!exc} $inc $dist $xtmp $mirror
+ debootstrap --arch $arch ${exc} $inc $dist $xtmp $mirror
fi
cleanup-deb
tarit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uni-koeln.de/pipermail/linux-fai/attachments/20180604/17e9b2c5/attachment-0001.html>
More information about the linux-fai
mailing list