diff --git a/scripts_archlinux/00_prepare.sh b/scripts_archlinux/00_prepare.sh index 7d5f66b..03826d8 100755 --- a/scripts_archlinux/00_prepare.sh +++ b/scripts_archlinux/00_prepare.sh @@ -15,11 +15,11 @@ gpg --verify "$CACHEDIR/archlinux-$ISO_VERSION-dual.iso.sig" "$CACHEDIR/archlinu if [ "$CACHEDIR/archlinux-$ISO_VERSION-dual.iso" -nt $CACHEDIR/root-image.fs ]; then echo "Extracting squash filesystem from DVD..." mkdir mnt_archlinux_dvd - mount -o loop "$CACHEDIR/archlinux-$ISO_VERSION-dual.iso" mnt_archlinux_dvd - cp mnt_archlinux_dvd/arch/x86_64/root-image.fs.sfs $CACHEDIR/ + mount -o loop "$CACHEDIR/archlinux-$ISO_VERSION-dual.iso" mnt_archlinux_dvd || echo "!!Error mounting iso to mnt_archlinux_dvd" + cp mnt_archlinux_dvd/arch/x86_64/airootfs.sfs $CACHEDIR/ || echo "!!Error copying root sfs file to \$CACHEDIR" umount mnt_archlinux_dvd - mount -o loop $CACHEDIR/root-image.fs.sfs mnt_archlinux_dvd - cp mnt_archlinux_dvd/root-image.fs $CACHEDIR/ + mount -o loop $CACHEDIR/airootfs.sfs mnt_archlinux_dvd || echo "!!Error mounting root sfs" + cp mnt_archlinux_dvd/airootfs.img $CACHEDIR/ || echo "!!Error copying root fs file" umount mnt_archlinux_dvd - rm $CACHEDIR/root-image.fs.sfs + rm $CACHEDIR/airootfs.sfs fi diff --git a/scripts_archlinux/01_install_core.sh b/scripts_archlinux/01_install_core.sh index fd27cfe..cfe4a8e 100755 --- a/scripts_archlinux/01_install_core.sh +++ b/scripts_archlinux/01_install_core.sh @@ -4,7 +4,14 @@ set -e echo "Mounting archlinux install system into mnt_archlinux_dvd..." mkdir -p mnt_archlinux_dvd -mount $CACHEDIR/root-image.fs mnt_archlinux_dvd +mount $CACHEDIR/airootfs.img mnt_archlinux_dvd + +echo "Fix bug intruduced in arch-chroot causing arguments not to be passed" +sed "s/unshare --fork --pid//" -i mnt_archlinux_dvd/usr/bin/arch-chroot + +echo "Fix chroot cannot be umounted because of gpg-agent started by pacman" +sed "/chroot_umount() {/a pkill gpg-agent" -i mnt_archlinux_dvd/usr/bin/arch-chroot +cat mnt_archlinux_dvd/usr/bin/arch-chroot echo "Creating chroot bootstrap environment" @@ -12,6 +19,7 @@ mount --bind $INSTALLDIR mnt_archlinux_dvd/mnt cp /etc/resolv.conf mnt_archlinux_dvd/etc echo "-> Initializing pacman keychain" +# Note: pacman-key starts gpg-agent automatically, which locks /dev ./mnt_archlinux_dvd/usr/bin/arch-chroot mnt_archlinux_dvd/ pacman-key --init ./mnt_archlinux_dvd/usr/bin/arch-chroot mnt_archlinux_dvd/ pacman-key --populate @@ -22,6 +30,7 @@ echo "--> Removing non required linux kernel (can be added manually through a pa ./mnt_archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR pacman --noconfirm -Rsc linux echo "-> Cleaning up bootstrap environment" + umount mnt_archlinux_dvd/mnt umount mnt_archlinux_dvd diff --git a/scripts_archlinux/02_install_groups.sh b/scripts_archlinux/02_install_groups.sh index 140a8fd..5222d74 100755 --- a/scripts_archlinux/02_install_groups.sh +++ b/scripts_archlinux/02_install_groups.sh @@ -12,7 +12,10 @@ fi set -e echo "Mounting archlinux install system into mnt_archlinux_dvd..." -mount $CACHEDIR/root-image.fs mnt_archlinux_dvd +mount $CACHEDIR/airootfs.img mnt_archlinux_dvd + +echo "Fix bug intruduced in arch-chroot causing arguments not to be passed" +sed "s/unshare --fork --pid//" -i mnt_archlinux_dvd/usr/bin/arch-chroot PKGGROUPS=`cat $PKGLISTFILE` diff --git a/scripts_archlinux/04_install_qubes.sh b/scripts_archlinux/04_install_qubes.sh index 4379604..ae595c0 100755 --- a/scripts_archlinux/04_install_qubes.sh +++ b/scripts_archlinux/04_install_qubes.sh @@ -4,7 +4,10 @@ set -e echo "Mounting archlinux install system into mnt_archlinux_dvd..." mkdir -p mnt_archlinux_dvd -mount $CACHEDIR/root-image.fs mnt_archlinux_dvd +mount $CACHEDIR/airootfs.img mnt_archlinux_dvd + +echo "Fix bug intruduced in arch-chroot causing arguments not to be passed" +sed "s/unshare --fork --pid//" -i mnt_archlinux_dvd/usr/bin/arch-chroot # Note: Enable x86 repos su -c "echo '[multilib]' >> $INSTALLDIR/etc/pacman.conf" diff --git a/scripts_archlinux/09_cleanup.sh b/scripts_archlinux/09_cleanup.sh index e149330..f47d8c6 100755 --- a/scripts_archlinux/09_cleanup.sh +++ b/scripts_archlinux/09_cleanup.sh @@ -3,7 +3,10 @@ set -e echo "Mounting archlinux install system into mnt_archlinux_dvd..." -mount $CACHEDIR/root-image.fs mnt_archlinux_dvd +mount $CACHEDIR/airootfs.img mnt_archlinux_dvd + +echo "Fix bug intruduced in arch-chroot causing arguments not to be passed" +sed "s/unshare --fork --pid//" -i mnt_archlinux_dvd/usr/bin/arch-chroot echo "--> Starting cleanup actions" # Remove unused packages and their dependencies (make dependencies)