summaryrefslogtreecommitdiff
path: root/arch-nspawn.in
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-04-09 21:27:11 +0200
committerErich Eckner <git@eckner.net>2020-06-29 10:43:33 +0200
commit307f8ddb2c0ddab33ceaa0900d324cc011114662 (patch)
treea372e65911a2b1ef7ce5815680f9d9b3241f3897 /arch-nspawn.in
parenta347c0358bb7c9962750602ebe0b7311ee66fb4e (diff)
downloaddevtools32-307f8ddb2c0ddab33ceaa0900d324cc011114662.tar.xz
allow to call setarch with a different value than $CARCH
Introduce setarch-aliases.d/ which gets installed inside /usr/share/devtools. This allows to assign aliases which map one CARCH to a different name which gets provided as argument for setarch. This is necessary on archlinuxarm ("armv6h" -> "armv6l", "armv7h" -> "armv7l") and allows for more fine-grained architectures (e.g. archlinux32 has "i686" and "pentium4", which differ in the required cpu capabilities).
Diffstat (limited to 'arch-nspawn.in')
-rw-r--r--arch-nspawn.in7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch-nspawn.in b/arch-nspawn.in
index cde1f60..eb4d52f 100644
--- a/arch-nspawn.in
+++ b/arch-nspawn.in
@@ -126,8 +126,13 @@ copy_hostconf
eval "$(grep -a '^CARCH=' "$working_dir/etc/makepkg.conf")"
[[ -z $nosetarch ]] || unset CARCH
+if [[ -f "@pkgdatadir@/setarch-aliases.d/${CARCH}" ]]; then
+ set_arch=$(cat "@pkgdatadir@/setarch-aliases.d/${CARCH}")
+else
+ set_arch="${CARCH}"
+fi
-exec ${CARCH:+setarch "$CARCH"} systemd-nspawn -q \
+exec ${CARCH:+setarch "$set_arch"} systemd-nspawn -q \
-D "$working_dir" \
-E "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin" \
--register=no --keep-unit --as-pid2 \