From 000ea6c7bbf6191bd284468dde4eb352757e84df Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Thu, 24 Aug 2017 17:03:32 +0200 Subject: arch-nspawn: Add --keep-unit to prevent scope conflicts --- arch-nspawn.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch-nspawn.in') diff --git a/arch-nspawn.in b/arch-nspawn.in index c21b2ce..0cdaf6b 100644 --- a/arch-nspawn.in +++ b/arch-nspawn.in @@ -113,6 +113,6 @@ eval "$(grep '^CARCH=' "$working_dir/etc/makepkg.conf")" exec ${CARCH:+setarch "$CARCH"} systemd-nspawn -q \ -D "$working_dir" \ - --register=no \ + --register=no --keep-unit \ "${mount_args[@]}" \ "$@" -- cgit v1.2.3-70-g09d2 From fecf107c37062323cf77e08be7d2192e05cb6255 Mon Sep 17 00:00:00 2001 From: Sébastien Luttringer Date: Wed, 6 Sep 2017 23:27:50 +0200 Subject: arch-nspawn: Force PATH to be the Arch default systemd-nspawn use a default environ PATH value of: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin Since filesystem 2017.08, this is no more overrided by /etc/profile to the Arch default: PATH=/usr/local/sbin:/usr/local/bin:/usr/bin --- arch-nspawn.in | 1 + 1 file changed, 1 insertion(+) (limited to 'arch-nspawn.in') diff --git a/arch-nspawn.in b/arch-nspawn.in index 0cdaf6b..5205bf4 100644 --- a/arch-nspawn.in +++ b/arch-nspawn.in @@ -113,6 +113,7 @@ eval "$(grep '^CARCH=' "$working_dir/etc/makepkg.conf")" exec ${CARCH:+setarch "$CARCH"} systemd-nspawn -q \ -D "$working_dir" \ + -E "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin" \ --register=no --keep-unit \ "${mount_args[@]}" \ "$@" -- cgit v1.2.3-70-g09d2 From 567cbc89da1f056d0cf77b3c967d649359666524 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 9 May 2016 18:37:02 -0400 Subject: arch-nspawn: Message style: two spaces after a period This affects both the usage() text, and the error message if the `/.arch-chroot` version doesn't match. The latter is the one that I really care about, and motivates this change. On Parabola, the `arch-nspawn` program isn't in PATH, it's somewhere under `/usr/lib/`, and gets called as a helper to user-facing programs; and the error message is displayed directly to the user. These programs consistently put two spaces after a period when printing a message to the terminal. --- arch-nspawn.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch-nspawn.in') diff --git a/arch-nspawn.in b/arch-nspawn.in index 5205bf4..bca969c 100644 --- a/arch-nspawn.in +++ b/arch-nspawn.in @@ -19,7 +19,7 @@ files=() usage() { echo "Usage: ${0##*/} [options] working-dir [systemd-nspawn arguments]" - echo "A wrapper around systemd-nspawn. Provides support for pacman." + echo "A wrapper around systemd-nspawn. Provides support for pacman." echo echo ' options:' echo ' -C Location of a pacman config file' @@ -101,7 +101,7 @@ umask 0022 if [[ ! -f "$working_dir/.arch-chroot" ]]; then die "'%s' does not appear to be an Arch chroot." "$working_dir" elif [[ $(cat "$working_dir/.arch-chroot") != "$CHROOT_VERSION" ]]; then - die "chroot '%s' is not at version %s. Please rebuild." "$working_dir" "$CHROOT_VERSION" + die "chroot '%s' is not at version %s. Please rebuild." "$working_dir" "$CHROOT_VERSION" fi build_mount_args -- cgit v1.2.3-70-g09d2 From a3fa0dbe24f362fe38b1016a9f44bf83c6a11071 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 10 May 2016 13:44:46 -0400 Subject: arch-nspawn: add a table of CARCH/setarch overrides The table is just armv7h->armv7l for now. --- arch-nspawn.in | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch-nspawn.in') diff --git a/arch-nspawn.in b/arch-nspawn.in index bca969c..92ca07c 100644 --- a/arch-nspawn.in +++ b/arch-nspawn.in @@ -108,6 +108,9 @@ build_mount_args copy_hostconf eval "$(grep '^CARCH=' "$working_dir/etc/makepkg.conf")" +case "$CARCH" in + armv7h) CARCH=armv7l;; +esac [[ -z $nosetarch ]] || unset CARCH -- cgit v1.2.3-70-g09d2 From 054f53ceb65c28adc75f84494e5204b78413d63a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 15 Feb 2017 14:40:06 -0500 Subject: makechrootpkg, arch-nspawn: Force-enable local '/repo/' repository. The change in arch-nspawn is subtle: This was the source of "infamous" "it fails every other time" bug that took me over a year to solve. By having a repository of local packages (rather than simply running `pacman -U`), we are inviting pacman to cache them in `/var/cache/pacman/pkg`. Besides being needless disk writes, this actually causes a real issue. If the package gets rebuilt, pacman will balk, as the file no longer matches the cached signature. So, how do we prevent pacman from caching these local packages? Simple: include the directory they are already in in the pacman.conf:CacheDir list. This will prevent pacman from copying the files to one of the other cache directories. --- arch-nspawn.in | 1 + makechrootpkg.in | 13 +++++++++++++ 2 files changed, 14 insertions(+) (limited to 'arch-nspawn.in') diff --git a/arch-nspawn.in b/arch-nspawn.in index 92ca07c..ebb9f4d 100644 --- a/arch-nspawn.in +++ b/arch-nspawn.in @@ -105,6 +105,7 @@ elif [[ $(cat "$working_dir/.arch-chroot") != "$CHROOT_VERSION" ]]; then fi build_mount_args +cache_dirs+=('/repo/') copy_hostconf eval "$(grep '^CARCH=' "$working_dir/etc/makepkg.conf")" diff --git a/makechrootpkg.in b/makechrootpkg.in index 57de79e..41c0c62 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -223,6 +223,19 @@ builduser ALL = NOPASSWD: /usr/bin/pacman EOF chmod 440 "$copydir/etc/sudoers.d/builduser-pacman" + if ! grep -q '^\[repo\]' "$copydir/etc/pacman.conf"; then + local line + line=$(grep -n '^\[' "$copydir/etc/pacman.conf" |grep -Fv ':[options]'|sed 's/:.*//;1q') + local ins='[repo] +SigLevel = Optional TrustAll +Server = file:///repo +' + sed -i "${line}i${ins//$'\n'/\\n}" "$copydir/etc/pacman.conf" + fi + # Avoid having to use `pacman -Sy` to update [repo], as + # networking might be disabled inside of the chroot. + cp "$copydir/repo/repo.db" "$copydir/var/lib/pacman/sync/repo.db" + # This is a little gross, but this way the script is recreated every time in the # working copy { -- cgit v1.2.3-70-g09d2 From 2277bec07b9f4aff10d918b3c054adf74a16005f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 5 Jul 2017 11:43:26 -0400 Subject: arch-nspawn: make sure that makepkg.conf is always parsed as text https://lists.parabola.nu/pipermail/dev/2017-June/005576.html --- arch-nspawn.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch-nspawn.in') diff --git a/arch-nspawn.in b/arch-nspawn.in index ebb9f4d..a225c1a 100644 --- a/arch-nspawn.in +++ b/arch-nspawn.in @@ -108,7 +108,7 @@ build_mount_args cache_dirs+=('/repo/') copy_hostconf -eval "$(grep '^CARCH=' "$working_dir/etc/makepkg.conf")" +eval "$(grep -a '^CARCH=' "$working_dir/etc/makepkg.conf")" case "$CARCH" in armv7h) CARCH=armv7l;; esac -- cgit v1.2.3-70-g09d2