Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/mkarchroot.in
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2017-02-15 14:39:25 -0500
committerLuke Shumaker <lukeshu@parabola.nu>2017-02-19 14:21:29 -0500
commitfd5496ad28fe2bdd5ece90ce01e6e58a9fb0d615 (patch)
tree3b9ce28434a8fb76f647d72f3da5697b99a8a0d3 /mkarchroot.in
parentb62905e1e74648d51edcbfba7bc700aeda0e9808 (diff)
mkarchroot, arch-nspawn: Add an `-s` flag to inhibit `setarch`.
This allows us to run an ARM chroot on an x86 box; as the binfmt runner will set the architecture for us, and the x86 `/usr/bin/setarch` program won't know about the ARM architecture string.
Diffstat (limited to 'mkarchroot.in')
-rw-r--r--mkarchroot.in5
1 files changed, 4 insertions, 1 deletions
diff --git a/mkarchroot.in b/mkarchroot.in
index 8499ed1..4cf8e56 100644
--- a/mkarchroot.in
+++ b/mkarchroot.in
@@ -25,18 +25,20 @@ usage() {
echo ' -M <file> Location of a makepkg config file'
echo ' -c <dir> Set pacman cache'
echo ' -f <file> Copy file from the host to the chroot'
+ echo ' -s Do not run setarch'
echo ' -h This message'
exit 1
}
orig_argv=("$@")
-while getopts 'hC:M:c:f:' arg; do
+while getopts 'hC:M:c:f:s' arg; do
case "$arg" in
C) pac_conf="$OPTARG" ;;
M) makepkg_conf="$OPTARG" ;;
c) cache_dir="$OPTARG" ;;
f) files+=("$OPTARG") ;;
+ s) nosetarch=1 ;;
h|?) usage ;;
*) error "invalid argument '%s'" "$arg"; usage ;;
esac
@@ -89,6 +91,7 @@ echo "$CHROOT_VERSION" > "$working_dir/.arch-chroot"
systemd-machine-id-setup --root="$working_dir"
exec arch-nspawn \
+ ${nosetarch:+-s} \
${pac_conf:+-C "$pac_conf"} \
${makepkg_conf:+-M "$makepkg_conf"} \
${cache_dir:+-c "$cache_dir"} \