summaryrefslogtreecommitdiff
path: root/src/chroot-tools
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-04-14 19:46:39 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-04-14 19:52:55 -0400
commita68d0ebb827d3cf49a62694e5a62207900e6f3a4 (patch)
tree86518ccfc2a3e44afeae55116556e313c2ed6f4a /src/chroot-tools
parent94e6c6f983be950a57cb355334f2685e29a950e7 (diff)
librechroot: add -A flag to set the architecture.
Takes advantage of pacman 5.0.1-2.parabola4 shipping the default config files for all architectures.
Diffstat (limited to 'src/chroot-tools')
-rwxr-xr-xsrc/chroot-tools/librechroot12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot
index ee3ffb8..52a5e12 100755
--- a/src/chroot-tools/librechroot
+++ b/src/chroot-tools/librechroot
@@ -186,6 +186,10 @@ usage() {
by the by `CARCH` variable in the `/etc/makepkg.conf`
file inside of the chroot.'
echo
+ prose 'In line with this, The `-A CARCH` flag is simply an alias for'
+ printf ' -C "/usr/share/pacman/defaults/pacman.conf.$CARCH" \\\n'
+ printf ' -M "/usr/share/pacman/defaults/makepkg.conf.$CARCH"\n'
+ echo
prose 'Creating a copy, deleting a copy, or syncing a copy can be fairly
slow; but are very fast if $CHROOTDIR is on a btrfs partition.'
echo
@@ -195,6 +199,8 @@ usage() {
flag '-N' 'Disable networking in the chroot'
flag "-C <$(_ FILE)>" 'Copy this file to `$copydir/etc/pacman.conf`'
flag "-M <$(_ FILE)>" 'Copy this file to `$copydir/etc/makepkg.conf`'
+ flag "-A <$(_ CARCH)>" 'Set the architecture of the copy; simply an
+ alias for the `-C` and `-M` flags, see above.'
flag "-w <$(_ 'PATH[:PATH]')>" 'Bind mount a file or directory, read/write'
flag "-r <$(_ 'PATH[:PATH]')>" 'Bind mount a file or directory, read-only'
echo
@@ -230,12 +236,16 @@ main() {
[[ $COPY != root ]] || COPY=copy
local mode=enter
- while getopts 'n:l:NC:M:w:r:' opt; do
+ while getopts 'n:l:NC:M:A:w:r:' opt; do
case $opt in
n) CHROOT=$OPTARG;;
l) COPY=$OPTARG;;
N) sysd_nspawn_flags+=(--private-network);;
C|M) arch_nspawn_flags+=(-$opt "$OPTARG");;
+ A) arch_nspawn_flags+=(
+ -C "/usr/share/pacman/defaults/pacman.conf.$OPTARG"
+ -M "/usr/share/pacman/defaults/makepkg.conf.$OPTARG"
+ );;
w) sysd_nspawn_flags+=("--bind=$OPTARG");;
r) sysd_nspawn_flags+=("--bind-ro=$OPTARG");;
*) usage >&2; return 1;;