Hi everyone, I found that current version of mk-basefile ( 4.7 and older) fails if variable EXCLUDE_<DEBIANVERSION> is an empty value:
root@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