summaryrefslogtreecommitdiff
path: root/src/chroot-tools
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2021-07-19 17:06:58 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2021-07-26 19:20:09 -0400
commitf852d5876b8c0be70e3686efd4f0a005dbb53648 (patch)
treedc8bb4b038d041f09d166360ecd2517a88713c45 /src/chroot-tools
parentc64c8ddcdfcce76f41f7c37cccec8d4894ade2c1 (diff)
wip - multiple concernswip-2021-03
Diffstat (limited to 'src/chroot-tools')
-rw-r--r--src/chroot-tools/chcleanup.in30
-rwxr-xr-xsrc/chroot-tools/libremakepkg13
2 files changed, 34 insertions, 9 deletions
diff --git a/src/chroot-tools/chcleanup.in b/src/chroot-tools/chcleanup.in
index 89a25c4..65bfb15 100644
--- a/src/chroot-tools/chcleanup.in
+++ b/src/chroot-tools/chcleanup.in
@@ -66,9 +66,23 @@ fi
# This is intentionally hard-coded.
source /etc/libretools.d/chroot.conf # sets $CHROOTEXTRAPKG
-# NOTE: ARM chroots require 'fakeroot-tcp' (BR #2775)
+CHROOTPKG=( $( pacman -Sgq base-devel) )
+CHROOTPKG+=() # DEBUG: normally empty - mandatory core package-set
+WHITELIST_PKGS=() # DEBUG: normally empty - optional packages, possibly insane
+
+# FIXME: ARM chroots require 'fakeroot-tcp' (BR #2775)
+#CHROOTPKG+=( fakeroot-tcp ) # armv7h qemu
fakeroot_pkg=fakeroot$( [[ "$(uname -m)" == 'armv7l' ]] && echo '-tcp' )
-CHROOTPKG=( $( pacman -Sgq base-devel | sed "s|fakeroot|${fakeroot_pkg}|" ) )
+CHROOTPKG=( ${CHROOTPKG[*]/fakeroot/${fakeroot_pkg}/} )
+
+# FIXME: host<->chroot glibc mismatch
+WHITELIST_PKGS+=( glibc-linux4 ) # BR #3038
+# $ wget https://repo.archlinuxcn.org/x86_64/glibc-linux4-2.33-4-x86_64.pkg.tar.zst.sig
+# $ wget https://repo.archlinuxcn.org/x86_64/glibc-linux4-2.33-4-x86_64.pkg.tar.zst
+# $ pacman-key --verify glibc-linux4-2.33-4-x86_64.pkg.tar.zst.sig
+# $ sudo librechroot -n autobuilder install-file glibc-linux4-2.33-4-x86_64.pkg.tar.zst
+# $ sudo cp glibc-linux4-2.33-4-x86_64.pkg.tar.zst* /var/lib/archbuild/autobuilder/bill-auger/
+# $ sudo librechroot -n autobuilder enter
# If we're running makepkg
if [[ -f ./PKGBUILD ]]; then
@@ -132,10 +146,10 @@ done
# This is done by installing those into a temporary pacman DB;
# then querying the DB for it's complete package list.
msg2 "Collecting the minimal set of packages needed ..."
-"${pacman_cmd[@]}" -S --dbonly --noscriptlet --needed --noconfirm \
- -- ${CHROOTPKG[*]} ${CHROOTEXTRAPKG[*]} ${DEPENDS[*]} \
- <&- >& "$ERROR_PKGS_FILE"
-if (( $? != 0 )); then
+if ! "${pacman_cmd[@]}" -S --dbonly --noscriptlet --needed --noconfirm \
+ -- ${CHROOTPKG[*]} ${CHROOTEXTRAPKG[*]} ${DEPENDS[*]} \
+ <&- >& "$ERROR_PKGS_FILE"
+then
error "Could not create a full list of packages, exiting."
plain "This is likely caused by a dependency that could not be found."
sed 's/^/ > /' < "$ERROR_PKGS_FILE" >&2
@@ -159,9 +173,11 @@ fi
# (via the libremakepkg '-I' option), and to exit otherwise, warning the user to upgrade.
# If the '-I' option was detected (!SANE), the stale packages are added to the whitelist.
"${pacman_cmd[@]}" -Qq > "$WHITELIST_PKGS_FILE"
+# echo "${WHITELIST_PKGS[@]}" >> "$WHITELIST_PKGS_FILE"
+cat >> "$WHITELIST_PKGS_FILE" <<<${WHITELIST_PKGS[@]}
if (( ${#stale_pkgs[*]} > 0 )); then
insane_msg_1="Some (%d) essential packages are out-of-sync with the database."
- insane_msg_2="Consider upgrading the chroot system before building this package."
+ insane_msg_2="Consider upgrading the chroot system before building packages."
if ! $SANE; then
warning "$insane_msg_1" "${#stale_pkgs[*]}" ; plain "$insane_msg_2" ;
plain "(ignoring, per the '-I' option)" ;
diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg
index 3718166..945b8ae 100755
--- a/src/chroot-tools/libremakepkg
+++ b/src/chroot-tools/libremakepkg
@@ -110,6 +110,8 @@ chroot_cleanup() {
}
build() (
+DBG "libremakepkg::build() IN"
+
local copydir=$1
local srcpkg=$2
local repack=$3
@@ -134,11 +136,17 @@ build() (
fi
$NONET || run_nnet=("${run_ynet[@]}")
- prepare_chroot "$copydir" "$LIBREHOME" "$repack" false
+DBG "libremakepkg::build() prepare_chroot"
+
+ prepare_chroot "$copydir" "$LIBREHOME" "$repack" false # generates 'chrootbuild'
+
+DBG "libremakepkg::build() pre_build run_nnet=${run_nnet[*]}"
run_hook pre_build "$copydir"
trap "run_hook post_build ${copydir@Q}; rm -rf -- ${startdir@Q}" EXIT
- "${run_nnet[@]}" /chrootbuild "${makepkg_args[@]}" </dev/null |& indent
+ "${run_nnet[@]}" /chrootbuild "${makepkg_args[@]}" < /dev/null |& indent
+
+DBG "libremakepkg::build() OUT"
)
# The main program #############################################################
@@ -299,6 +307,7 @@ main() {
msg 'Initializing the chroot...'
librechroot "${librechroot_flags[@]}" make |& indent
fi
+DBG "libremakepkg::main() GUARD whoami=$(whoami) id=$(id)" ; return 1
# Set target CARCH
# note that we waited until after locking/creating the chroot to do this