diff options
author | Luke Shumaker <lukeshu@parabola.nu> | 2017-10-23 22:15:52 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@parabola.nu> | 2018-01-03 17:19:18 -0500 |
commit | ea000f5bfb019bc617a95a248d0a40da2e0ab33c (patch) | |
tree | 9e9a62c948f518d10ca417e0d84d432eb7d2912c | |
parent | 07cd357384e67c7b03a19cf3ec182907a00efef4 (diff) |
arch-nspawn: Set pacman.conf:Architecture to match makepkg.conf:CARCHlukeshu/set-pacman-arch
This is useful for both Parabola and Arch Linux 32.
This is based on the following commits from Arch Linux 32's devtools32:
c0b3464ef force correct architecture in pacman
0e8a08075 bugfixes concerning $CARCH, Architecture= and --cache
b951a9902 separate mirrorlist for i686 and x86_64
As well as these commits from Parabola's libretools:
54586bd5a librechroot: have the -A flag set Architecture in pacman.conf
-rw-r--r-- | arch-nspawn.in | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/arch-nspawn.in b/arch-nspawn.in index c448056..ab71f15 100644 --- a/arch-nspawn.in +++ b/arch-nspawn.in @@ -91,7 +91,10 @@ copy_hostconf () { cp -T "$file" "$working_dir$file" done - sed -r "s|^#?\\s*CacheDir.+|CacheDir = ${cache_dirs[*]}|g" -i "$working_dir/etc/pacman.conf" + sed -r \ + -e "s|^#?\\s*CacheDir.+|CacheDir = ${cache_dirs[*]}|g" \ + -e "s|^#?\\s*Architecture.+|Architecture = ${CARCH}|g" \ + -i "$working_dir/etc/pacman.conf" } # }}} @@ -104,15 +107,15 @@ elif [[ $(cat "$working_dir/.arch-chroot") != "$CHROOT_VERSION" ]]; then die "chroot '%s' is not at version %s. Please rebuild." "$working_dir" "$CHROOT_VERSION" fi +eval "$(grep -a '^CARCH=' "${makepkg_conf:-"$working_dir/etc/makepkg.conf"}")" + build_mount_args cache_dirs+=('/repo/') copy_hostconf -eval "$(grep -a '^CARCH=' "$working_dir/etc/makepkg.conf")" case "$CARCH" in armv7h) CARCH=armv7l;; esac - [[ -z $nosetarch ]] || unset CARCH exec ${CARCH:+setarch "$CARCH"} systemd-nspawn -q \ |