2019-06-09 21:08:25 +00:00
|
|
|
From c0ca6a67467d082996d1343dca2665d5eb3e585f Mon Sep 17 00:00:00 2001
|
2014-12-30 02:41:19 +00:00
|
|
|
From: Kevin Mihelich <kevin@archlinuxarm.org>
|
|
|
|
Date: Sun, 28 Dec 2014 22:25:58 -0700
|
2018-05-31 18:51:19 +00:00
|
|
|
Subject: [PATCH 1/7] makechrootpkg: cache dir
|
2014-12-30 02:41:19 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
makechrootpkg.in | 10 ++++++++--
|
|
|
|
1 file changed, 8 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/makechrootpkg.in b/makechrootpkg.in
|
2019-06-09 21:08:25 +00:00
|
|
|
index dc647b3..a73d494 100644
|
2014-12-30 02:41:19 +00:00
|
|
|
--- a/makechrootpkg.in
|
|
|
|
+++ b/makechrootpkg.in
|
2017-12-13 01:42:01 +00:00
|
|
|
@@ -38,6 +38,7 @@ usage() {
|
2013-05-31 18:39:05 +00:00
|
|
|
echo 'Flags:'
|
|
|
|
echo '-h This help'
|
|
|
|
echo '-c Clean the chroot before building'
|
2014-12-30 02:41:19 +00:00
|
|
|
+ echo '-C <dir> Set pacman cache to pass to arch-nspawn'
|
|
|
|
echo '-d <dir> Bind directory into build chroot as read-write'
|
|
|
|
echo '-D <dir> Bind directory into build chroot as read-only'
|
|
|
|
echo '-u Update the working copy of the chroot before building'
|
2019-06-09 21:08:25 +00:00
|
|
|
@@ -321,12 +322,13 @@ main() {
|
2017-12-13 01:42:01 +00:00
|
|
|
[[ -z "$copy" || $copy = root ]] && copy=copy
|
|
|
|
src_owner=${SUDO_USER:-$USER}
|
2014-12-30 02:41:19 +00:00
|
|
|
|
2017-12-13 01:42:01 +00:00
|
|
|
- while getopts 'hcur:I:l:nTD:d:U:' arg; do
|
|
|
|
+ while getopts 'hcuC:r:I:l:nTD:d:U:' arg; do
|
|
|
|
case "$arg" in
|
|
|
|
c) clean_first=true ;;
|
|
|
|
D) bindmounts_ro+=("--bind-ro=$OPTARG") ;;
|
|
|
|
d) bindmounts_rw+=("--bind=$OPTARG") ;;
|
|
|
|
u) update_first=true ;;
|
|
|
|
+ C) cache_dir="$OPTARG" ;;
|
|
|
|
r) passeddir="$OPTARG" ;;
|
|
|
|
I) install_pkgs+=("$OPTARG") ;;
|
|
|
|
l) copy="$OPTARG" ;;
|
2019-06-09 21:08:25 +00:00
|
|
|
@@ -348,6 +350,10 @@ main() {
|
2017-12-13 01:42:01 +00:00
|
|
|
[[ ! -d $chrootdir ]] && die "No chroot dir defined, or invalid path '%s'" "$passeddir"
|
|
|
|
[[ ! -d $chrootdir/root ]] && die "Missing chroot dir root directory. Try using: mkarchroot %s/root base-devel" "$chrootdir"
|
2013-05-31 18:39:05 +00:00
|
|
|
|
2017-12-13 01:42:01 +00:00
|
|
|
+ if [ -n "$cache_dir" ]; then
|
|
|
|
+ cache_dir="-c $cache_dir"
|
|
|
|
+ fi
|
2013-05-31 18:39:05 +00:00
|
|
|
+
|
2017-12-13 01:42:01 +00:00
|
|
|
if [[ ${copy:0:1} = / ]]; then
|
|
|
|
copydir=$copy
|
|
|
|
else
|
2019-06-09 21:08:25 +00:00
|
|
|
@@ -411,7 +417,7 @@ main() {
|
2013-06-27 17:15:42 +00:00
|
|
|
|
2018-05-31 18:51:19 +00:00
|
|
|
prepare_chroot "$copydir" "$USER_HOME" "$keepbuilddir" "$run_namcap"
|
2013-05-31 18:39:05 +00:00
|
|
|
|
2017-12-13 01:42:01 +00:00
|
|
|
- if arch-nspawn "$copydir" \
|
|
|
|
+ if arch-nspawn $cache_dir "$copydir" \
|
|
|
|
--bind="$PWD:/startdir" \
|
|
|
|
--bind="$SRCDEST:/srcdest" \
|
|
|
|
"${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
|
2014-12-30 02:41:19 +00:00
|
|
|
--
|
2019-06-09 21:08:25 +00:00
|
|
|
2.21.0
|
2014-12-30 02:41:19 +00:00
|
|
|
|