diff options
Diffstat (limited to 'src/chroot-tools')
-rw-r--r-- | src/chroot-tools/arch-nspawn.patch | 14 | ||||
-rwxr-xr-x | src/chroot-tools/librechroot | 2 | ||||
-rw-r--r-- | src/chroot-tools/makechrootpkg.sh.patch | 41 | ||||
-rw-r--r-- | src/chroot-tools/mkarchroot.patch | 10 |
4 files changed, 41 insertions, 26 deletions
diff --git a/src/chroot-tools/arch-nspawn.patch b/src/chroot-tools/arch-nspawn.patch index afdf51a..5e0f10b 100644 --- a/src/chroot-tools/arch-nspawn.patch +++ b/src/chroot-tools/arch-nspawn.patch @@ -1,5 +1,5 @@ ---- arch-nspawn.in 2014-03-21 13:59:31.812992892 -0400 -+++ arch-nspawn 2014-03-21 14:24:23.520619552 -0400 +--- arch-nspawn.in 2014-05-11 00:58:42.030932904 -0400 ++++ arch-nspawn.ugly 2014-05-11 22:33:47.186717386 -0400 @@ -1,4 +1,6 @@ #!/bin/bash +# License: GNU GPLv2 @@ -7,3 +7,13 @@ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. +@@ -103,7 +105,8 @@ + machine_name="${machine_name#-}" + fi + +-exec ${CARCH:+setarch "$CARCH"} systemd-nspawn -q \ ++CHROOTARCH="$(. $(librelib conf); get_var chroot CHROOTARCH "$CARCH")" ++exec ${CHROOTARCH:+setarch "$CHROOTARCH"} systemd-nspawn -q \ + -D "$working_dir" \ + --machine "$machine_name" \ + "${mount_args[@]}" \ diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index 6be9f09..4edcb2f 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -336,6 +336,8 @@ main() { printf '%q ' "${CHROOTEXTRAPKG[@]}" printf ')\n' fi + # TODO: only set CHROOTARCH if $CARCH != $(uname -m) + printf 'CHROOTARCH=%q\n' "$(uname -m)" } > "$copydir"/etc/libretools.d/chroot.conf if [[ $mode != delete ]]; then diff --git a/src/chroot-tools/makechrootpkg.sh.patch b/src/chroot-tools/makechrootpkg.sh.patch index 5cea39a..8180d89 100644 --- a/src/chroot-tools/makechrootpkg.sh.patch +++ b/src/chroot-tools/makechrootpkg.sh.patch @@ -1,5 +1,5 @@ ---- makechrootpkg.sh.in 2014-03-21 13:59:31.239683366 -0400 -+++ makechrootpkg.sh.ugly 2014-03-21 14:19:20.747789508 -0400 +--- makechrootpkg.sh.in 2014-05-10 22:03:27.956692573 -0400 ++++ makechrootpkg.sh.ugly 2014-05-10 22:09:15.376594518 -0400 @@ -1,4 +1,6 @@ #!/bin/bash +# License: GNU GPLv2 @@ -12,8 +12,8 @@ shopt -s nullglob +init_variables() { - _makepkg_args=(-s --noconfirm -L --holdver) - makepkg_args=("${_makepkg_args[@]}") + default_makepkg_args=(-s --noconfirm -L --holdver) + makepkg_args=("${default_makepkg_args[@]}") repack=false @@ -29,9 +32,10 @@ bindmounts_rw=() @@ -35,7 +35,7 @@ while getopts 'hcur:I:l:nTD:d:' arg; do case "$arg" in h) usage ;; -@@ -93,9 +98,6 @@ +@@ -91,9 +96,6 @@ [[ ! -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" @@ -45,7 +45,7 @@ if [[ ${copy:0:1} = / ]]; then copydir=$copy else -@@ -115,30 +117,48 @@ +@@ -113,30 +115,48 @@ esac done @@ -100,11 +100,14 @@ # Get a read lock on the root chroot to make # sure we don't clone a half-updated chroot slock 8 "$chrootdir/root.lock" "Locking clean chroot" -@@ -159,11 +179,16 @@ +@@ -157,14 +177,19 @@ # Drop the read lock again lock_close 8 - fi + + # Update mtime + touch "$copydir" } -clean_temporary() { @@ -120,7 +123,7 @@ if [[ "$chroottype" == btrfs ]] && ! mountpoint -q "$copydir"; then btrfs subvolume delete "$copydir" >/dev/null || die "Unable to delete subvolume %s" "$copydir" -@@ -178,9 +203,14 @@ +@@ -179,9 +204,14 @@ stat_done } @@ -135,7 +138,7 @@ for install_pkg in "${install_pkgs[@]}"; do pkgname="${install_pkg##*/}" cp "$install_pkg" "$copydir/$pkgname" -@@ -193,11 +223,19 @@ +@@ -194,11 +224,19 @@ rm "$copydir/$pkgname" done @@ -157,7 +160,7 @@ $repack || rm -rf "$copydir/build" mkdir -p "$copydir/build" -@@ -236,12 +274,12 @@ +@@ -237,12 +275,12 @@ chown -R nobody "$copydir"/{build,pkgdest,srcpkgdest,logdest,srcdest,startdir} @@ -172,7 +175,7 @@ sed -i '/^PACKAGER=/d' "$copydir/etc/makepkg.conf" echo "PACKAGER='${PACKAGER}'" >> "$copydir/etc/makepkg.conf" fi -@@ -254,20 +292,38 @@ +@@ -255,20 +293,38 @@ chmod 440 "$copydir/etc/sudoers.d/nobody-pacman" fi @@ -213,7 +216,7 @@ makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o else ( export SRCDEST BUILDDIR="$builddir" -@@ -277,10 +333,10 @@ +@@ -278,10 +334,10 @@ (( $? != 0 )) && die "Could not download sources." # Clean up garbage from verifysource @@ -226,7 +229,7 @@ # This function isn't run in makechrootpkg, # so no global variables local run_namcap="$1"; shift -@@ -291,6 +347,7 @@ +@@ -292,6 +348,7 @@ shopt -s nullglob # XXX: Workaround makepkg disliking read-only dirs @@ -234,7 +237,7 @@ ln -sft /srcdest /srcdest_host/* ln -sft /startdir /startdir_host/* -@@ -316,11 +373,29 @@ +@@ -317,11 +374,29 @@ # Safety check if [[ ! -w PKGBUILD ]]; then @@ -265,7 +268,7 @@ if $run_namcap; then pacman -S --needed --noconfirm namcap -@@ -333,12 +408,24 @@ +@@ -334,12 +409,24 @@ exit 0 } @@ -290,7 +293,7 @@ for l in "$copydir"/logdest/*; do [[ $l == */logpipe.* ]] && continue chown "$src_owner" "$l" -@@ -352,6 +439,10 @@ +@@ -353,6 +440,10 @@ } # }}} @@ -300,8 +303,8 @@ + umask 0022 - load_vars /etc/makepkg.conf -@@ -363,30 +454,45 @@ + load_vars "$USER_HOME/.makepkg.conf" +@@ -364,30 +455,45 @@ [[ -d $SRCPKGDEST ]] || SRCPKGDEST=$PWD [[ -d $LOGDEST ]] || LOGDEST=$PWD @@ -353,7 +356,7 @@ if (( ret != 0 )); then if $temp_chroot; then -@@ -397,3 +503,4 @@ +@@ -398,3 +504,4 @@ else true fi diff --git a/src/chroot-tools/mkarchroot.patch b/src/chroot-tools/mkarchroot.patch index 171b38a..9366d92 100644 --- a/src/chroot-tools/mkarchroot.patch +++ b/src/chroot-tools/mkarchroot.patch @@ -1,5 +1,5 @@ ---- mkarchroot.in 2014-03-21 13:59:31.593002027 -0400 -+++ mkarchroot.ugly 2014-03-21 14:23:12.027238102 -0400 +--- mkarchroot.in 2014-05-10 22:10:54.871326879 -0400 ++++ mkarchroot.ugly 2014-05-10 22:10:54.887993222 -0400 @@ -1,4 +1,6 @@ #!/bin/bash +# License: GNU GPLv2 @@ -7,19 +7,19 @@ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. -@@ -65,6 +67,11 @@ +@@ -66,6 +68,11 @@ chmod 0755 "$working_dir" fi +_env=() +while read -r varname; do + _env+=("$varname=${!varname}") -+done < { declare -x | sed -r 's/^declare -x ([^=]*)=.*/\1/' | grep -i '_proxy$'; } ++done < <(declare -x | sed -r 's/^declare -x ([^=]*)=.*/\1/' | grep -i '_proxy$') +env -i "${_env[@]}" \ pacstrap -GMcd ${pac_conf:+-C "$pac_conf"} "$working_dir" \ "${cache_dirs[@]/#/--cachedir=}" "$@" || die 'Failed to install all packages' -@@ -72,7 +79,7 @@ +@@ -73,7 +80,7 @@ echo 'LANG=C' > "$working_dir/etc/locale.conf" echo "$CHROOT_VERSION" > "$working_dir/.arch-chroot" |