summaryrefslogtreecommitdiff
path: root/src/makechrootpkg.in
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2023-05-29 16:05:59 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2023-05-29 16:05:59 +0200
commitbe8ac63f28a402acbf7e21972ac5d3b45bed1f79 (patch)
tree6eb83c09f6549ae41988a25243a2b424a4f99a4e /src/makechrootpkg.in
parentbfc22eea7e4c6877fe8b9d89fa574cb0729466db (diff)
parenta07df0beeaeea1bf5665512bacc7a013eece4602 (diff)
downloaddevtools-be8ac63f28a402acbf7e21972ac5d3b45bed1f79.tar.xz
merged with devtools 1.0.1 upstream (git repo migration)
Diffstat (limited to 'src/makechrootpkg.in')
-rw-r--r--src/makechrootpkg.in13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/makechrootpkg.in b/src/makechrootpkg.in
index e56e912..aac7a0b 100644
--- a/src/makechrootpkg.in
+++ b/src/makechrootpkg.in
@@ -2,8 +2,13 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
-m4_include(lib/common.sh)
-m4_include(lib/archroot.sh)
+_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@}
+
+# shellcheck source=src/lib/common.sh
+source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh
+# shellcheck source=src/lib/archroot.sh
+source "${_DEVTOOLS_LIBRARY_DIR}"/lib/archroot.sh
+
source /usr/share/makepkg/util/config.sh
@@ -24,6 +29,7 @@ clean_first=0
run_namcap=0
run_checkpkg=0
temp_chroot=0
+tmp_opts="nosuid,nodev,size=50%,nr_inodes=2m"
bindmounts_ro=()
bindmounts_rw=()
@@ -304,7 +310,7 @@ done
[[ -n $makepkg_user && -z $(id -u "$makepkg_user") ]] && die 'Invalid makepkg user.'
makepkg_user=${makepkg_user:-${SUDO_USER:-$USER}}
-check_root SOURCE_DATE_EPOCH,BUILDTOOL,BUILDTOOLVER,GNUPGHOME,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,MAKEFLAGS,PACKAGER
+check_root SOURCE_DATE_EPOCH,BUILDTOOL,BUILDTOOLVER,GNUPGHOME,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,MAKEFLAGS,PACKAGER "${BASH_SOURCE[0]}" "$@"
# Canonicalize chrootdir, getting rid of trailing /
chrootdir=$(readlink -e "$passeddir")
@@ -375,6 +381,7 @@ prepare_chroot
if arch-nspawn "$copydir" \
--bind="${PWD//:/\\:}:/startdir" \
--bind="${SRCDEST//:/\\:}:/srcdest" \
+ --tmpfs="/tmp:${tmp_opts}" \
"${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
/chrootbuild "${makepkg_args[@]}"
then