From a26f945494cccac9920226db67f5785b3b0806df Mon Sep 17 00:00:00 2001 From: Dan Johansen Date: Mon, 30 Dec 2019 20:30:24 +0100 Subject: [PATCH] Use pkg-cache on host system for packages We have used the pacman pkg cache on the SD card to always assure we get the newest packages. But as some have pointed out, this makes the installer redownload all the packages again when rerun after a failed installation attempt. This change makes us create a new pkg-cache on the host system, which we then mount into the SD card's filesystem, so it can be used by pacman. This would make the installer only download new and/or failed packages if rerun. Fixes #15. Signed-off-by: Dan Johansen --- manjaro-arm-installer | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manjaro-arm-installer b/manjaro-arm-installer index bbfae09..3e96da8 100755 --- a/manjaro-arm-installer +++ b/manjaro-arm-installer @@ -125,6 +125,9 @@ create_install() { $NSPAWN $TMPDIR/root pacman-key --populate archlinux archlinuxarm manjaro manjaro-arm 1> /dev/null 2>&1 info "Installing packages for $EDITION on $DEVICE..." + # Setup cache mount + mkdir -p $TMPDIR/pkg-cache + mount -o bind $TMPDIR/pkg-cache $TMPDIR/root/var/cache/pacman/pkg # Install device and editions specific packages $NSPAWN $TMPDIR/root pacman -Syyu base manjaro-system manjaro-release systemd systemd-libs $PKG_DEVICE $PKG_EDITION --noconfirm #if [[ "$DEVICE" = "???" ]]; then @@ -239,6 +242,7 @@ create_install() { fi info "Cleaning install for unwanted files..." + umount $TMPDIR/root/var/cache/pacman/pkg rm -rf $TMPDIR/root/usr/bin/qemu-aarch64-static rm -rf $TMPDIR/root/var/cache/pacman/pkg/* rm -rf $TMPDIR/root/var/log/*