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 <strit@manjaro.org>
This commit is contained in:
Dan Johansen 2019-12-30 20:30:24 +01:00
parent 22e175036b
commit a26f945494
1 changed files with 4 additions and 0 deletions

View File

@ -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/*