Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch-nspawn.in6
-rw-r--r--mkarchroot.in5
2 files changed, 9 insertions, 2 deletions
diff --git a/arch-nspawn.in b/arch-nspawn.in
index 19a1a89..ea6e5ea 100644
--- a/arch-nspawn.in
+++ b/arch-nspawn.in
@@ -27,18 +27,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
@@ -111,6 +113,8 @@ case "$CARCH" in
armv7h) CARCH=armv7l;;
esac
+[[ -z $nosetarch ]] || unset CARCH
+
exec ${CARCH:+setarch "$CARCH"} systemd-nspawn -q \
-D "$working_dir" \
--register=no \
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"} \