Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCeleste Liu <CoelacanthusHex@gmail.com>2022-10-13 18:07:18 +0800
committerLevente Polyak <anthraxx@archlinux.org>2023-01-06 16:58:29 +0100
commit009c58f7c94b5f63aa41a0a82cd23ee7712f05a9 (patch)
tree02475d7536c7f7183c83ed29c6eb33e91044f8db /src
parent112026580d21c35b505de2378f21580d274e898f (diff)
archbuild: add architecture-specific mount config
config path: @pkgdatadir@/mount.d/${arch} config format: Each line will start with 'ro' and 'rw' will be used, other lines will be ignore, rest of line is out/path:in/path. e.g. ``` ro /some/path:/proc/cpuinfo rw /some/some/path:/var/cache/pacman/pkg ``` For example, in the RISC-V port, if we use qemu-user to build, we need to pass a parameter to makechrootpkg to map a correct /proc/cpuinfo, so that software that relies on /proc/cpuinfo to obtain information can be built normally. Signed-off-by: Celeste Liu <CoelacanthusHex@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/archbuild.in16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/archbuild.in b/src/archbuild.in
index e6cf19a..ba3ba94 100644
--- a/src/archbuild.in
+++ b/src/archbuild.in
@@ -23,6 +23,22 @@ if [[ -f "@pkgdatadir@/setarch-aliases.d/${arch}" ]]; then
else
set_arch="${arch}"
fi
+
+# Architecture-specific Mount
+arch_mounts=()
+if [[ -f "@pkgdatadir@/mount.d/${arch}" ]]; then
+ mapfile -t arch_mounts < "@pkgdatadir@/mount.d/${arch}"
+fi
+for arch_mount in "${arch_mounts[@]}"; do
+ if [[ $arch_mount = rw* ]]; then
+ arch_mount=${arch_mount#rw }
+ in_array "$arch_mount" "${makechrootpkg_args[@]}" || makechrootpkg_args+=("-d" "$arch_mount")
+ elif [[ $arch_mount = ro* ]]; then
+ arch_mount=${arch_mount#ro }
+ in_array "$arch_mount" "${makechrootpkg_args[@]}" || makechrootpkg_args+=("-D" "$arch_mount")
+ fi
+done
+
chroots='/var/lib/archbuild'
clean_first=false