#!/usr/bin/env bash cp --verbose --recursive "${HOME}"/lfs_archives_13_0 "${HOME}"/myfiles/ cat > "${HOME}"/myfiles/lfs-postinstall.sh <<"EOPF" #!/usr/bin/env bash if ! dpkg -l |grep local-apt-repository then echo "ERROR: execute local-apt-repository.sh first" fi if ! mount |grep cdrom then mount /dev/sr0 fi if ! mount |grep cdrom then echo "ERROR: insert cdrom" exit 1 fi cat > /etc/sudoers.d/lfs <<"EOF" lfs ALL = NOPASSWD: /usr/bin/chown * /mnt/lfs* lfs ALL = NOPASSWD: /usr/bin/mount * /mnt/lfs* lfs ALL = NOPASSWD: /usr/bin/install * /mnt/lfs* lfs ALL = NOPASSWD: /usr/sbin/chroot /mnt/lfs* EOF apt --yes install texinfo m4 bison gawk make patch python3 xz-utils gcc g++ build-essential mv --verbose /etc/bash.bashrc /etc/bash.bashrc.NOUSE cat > /home/lfs/.lfsbuild_config <<"EOCF" # build directory LFS=/mnt/lfs # location of local package sources LFS_PACKAGE_DIR=/media/cdrom0/lfs_archives_13_0 # Number of processors to use LFS_NPROC=1 # Bypass step by step validation until a breakpoint LFS_BREAKPOINT=110300 # strip binaries or not LFS_STRIP_BINARIES=true # bypass network config validation by taking network config from host LFS_NETWORKSAMEASHOST=true # bypass network configuration for full offline build LFS_NETWORKOFFLINE=true # bypass linux config validation by taking linux config from host LFS_LINUXCONFIGPROVIDED=true EOCF chown lfs:lfs /home/lfs/.lfsbuild_config find /home/lfs/lfs_archives_13_0/ -name "cclfs*.tar.gz" -exec tar --extract --gunzip --file={} --directory=/home/lfs/ \; EOPF