Compare commits
No commits in common. "8bdd04fce10950a30f32cf0a156e5a022af32a73" and "f3ab0a3d2d2a91b253145deeef00adc711e5ac67" have entirely different histories.
8bdd04fce1
...
f3ab0a3d2d
18 changed files with 8 additions and 100 deletions
|
@ -1,8 +1,3 @@
|
||||||
1.3.3 (2023-02-19)
|
|
||||||
------------------
|
|
||||||
|
|
||||||
- testsuite improvements
|
|
||||||
|
|
||||||
1.3.2 (2023-02-16)
|
1.3.2 (2023-02-16)
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@ from itertools import product
|
||||||
have_qemu = os.getenv("HAVE_QEMU", "yes") == "yes"
|
have_qemu = os.getenv("HAVE_QEMU", "yes") == "yes"
|
||||||
have_binfmt = os.getenv("HAVE_BINFMT", "yes") == "yes"
|
have_binfmt = os.getenv("HAVE_BINFMT", "yes") == "yes"
|
||||||
run_ma_same_tests = os.getenv("RUN_MA_SAME_TESTS", "yes") == "yes"
|
run_ma_same_tests = os.getenv("RUN_MA_SAME_TESTS", "yes") == "yes"
|
||||||
use_host_apt_config = os.getenv("USE_HOST_APT_CONFIG", "no") == "yes"
|
|
||||||
cmd = os.getenv("CMD", "./mmdebstrap")
|
cmd = os.getenv("CMD", "./mmdebstrap")
|
||||||
|
|
||||||
default_dist = os.getenv("DEFAULT_DIST", "unstable")
|
default_dist = os.getenv("DEFAULT_DIST", "unstable")
|
||||||
|
@ -94,7 +93,6 @@ def parse_config(confname):
|
||||||
"Skip-If",
|
"Skip-If",
|
||||||
"Needs-QEMU",
|
"Needs-QEMU",
|
||||||
"Needs-Root",
|
"Needs-Root",
|
||||||
"Needs-APT-Config",
|
|
||||||
]:
|
]:
|
||||||
print(f"Unknown field name {k} in test {name}")
|
print(f"Unknown field name {k} in test {name}")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
@ -268,10 +266,6 @@ def main():
|
||||||
skipreason = skip(test.get("Skip-If"), dist, mode, variant, fmt)
|
skipreason = skip(test.get("Skip-If"), dist, mode, variant, fmt)
|
||||||
if skipreason:
|
if skipreason:
|
||||||
tt = ("skip", skipreason)
|
tt = ("skip", skipreason)
|
||||||
elif (
|
|
||||||
test.get("Needs-APT-Config", "false") == "true" and use_host_apt_config
|
|
||||||
):
|
|
||||||
tt = ("skip", "test cannot use host apt config")
|
|
||||||
elif have_qemu:
|
elif have_qemu:
|
||||||
tt = "qemu"
|
tt = "qemu"
|
||||||
elif test.get("Needs-QEMU", "false") == "true":
|
elif test.get("Needs-QEMU", "false") == "true":
|
||||||
|
|
|
@ -92,4 +92,4 @@ END
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f shared/test.sh shared/tar1.txt shared/tar2.txt shared/pkglist.txt shared/doc-debian.tar.list shared/mmdebstrap shared/tarfilter shared/proxysolver
|
rm shared/test.sh shared/tar1.txt shared/tar2.txt shared/pkglist.txt shared/doc-debian.tar.list shared/mmdebstrap shared/tarfilter shared/proxysolver
|
||||||
|
|
27
coverage.txt
27
coverage.txt
|
@ -2,19 +2,16 @@ Test: debootstrap
|
||||||
Dists: any
|
Dists: any
|
||||||
Variants: minbase buildd -
|
Variants: minbase buildd -
|
||||||
Needs-Root: true
|
Needs-Root: true
|
||||||
Needs-APT-Config: true
|
|
||||||
|
|
||||||
Test: check-against-debootstrap-dist
|
Test: check-against-debootstrap-dist
|
||||||
Dists: any
|
Dists: any
|
||||||
Variants: minbase buildd -
|
Variants: minbase buildd -
|
||||||
Needs-Root: true
|
Needs-Root: true
|
||||||
Needs-APT-Config: true
|
|
||||||
|
|
||||||
Test: as-debootstrap-unshare-wrapper
|
Test: as-debootstrap-unshare-wrapper
|
||||||
Modes: unshare
|
Modes: unshare
|
||||||
Needs-Root: true
|
Needs-Root: true
|
||||||
Variants: minbase -
|
Variants: minbase -
|
||||||
Needs-APT-Config: true
|
|
||||||
|
|
||||||
Test: help
|
Test: help
|
||||||
|
|
||||||
|
@ -30,7 +27,6 @@ Needs-Root: true
|
||||||
|
|
||||||
Test: dist-using-codename
|
Test: dist-using-codename
|
||||||
Dists: any
|
Dists: any
|
||||||
Needs-APT-Config: true
|
|
||||||
|
|
||||||
Test: fail-without-etc-subuid
|
Test: fail-without-etc-subuid
|
||||||
Needs-QEMU: true
|
Needs-QEMU: true
|
||||||
|
@ -40,15 +36,12 @@ Needs-QEMU: true
|
||||||
|
|
||||||
Test: unshare-as-root-user-inside-chroot
|
Test: unshare-as-root-user-inside-chroot
|
||||||
Needs-Root: true
|
Needs-Root: true
|
||||||
Needs-APT-Config: true
|
|
||||||
|
|
||||||
Test: root-mode-inside-chroot
|
Test: root-mode-inside-chroot
|
||||||
Needs-Root: true
|
Needs-Root: true
|
||||||
Needs-APT-Config: true
|
|
||||||
|
|
||||||
Test: root-mode-inside-unshare-chroot
|
Test: root-mode-inside-unshare-chroot
|
||||||
Modes: unshare
|
Modes: unshare
|
||||||
Needs-APT-Config: true
|
|
||||||
|
|
||||||
Test: root-without-cap-sys-admin
|
Test: root-without-cap-sys-admin
|
||||||
Needs-Root: true
|
Needs-Root: true
|
||||||
|
@ -129,7 +122,6 @@ Test: read-from-stdin-write-to-stdout
|
||||||
Test: supply-components-manually
|
Test: supply-components-manually
|
||||||
Modes: root
|
Modes: root
|
||||||
Needs-Root: true
|
Needs-Root: true
|
||||||
Needs-APT-Config: true
|
|
||||||
|
|
||||||
Test: stable-default-mirror
|
Test: stable-default-mirror
|
||||||
Needs-QEMU: true
|
Needs-QEMU: true
|
||||||
|
@ -154,23 +146,19 @@ Needs-QEMU: true
|
||||||
Test: mirror-is-deb
|
Test: mirror-is-deb
|
||||||
|
|
||||||
Test: mirror-is-real-file
|
Test: mirror-is-real-file
|
||||||
Needs-APT-Config: true
|
|
||||||
|
|
||||||
Test: deb822-1-2
|
Test: deb822-1-2
|
||||||
Modes: root
|
Modes: root
|
||||||
Needs-Root: true
|
Needs-Root: true
|
||||||
Needs-APT-Config: true
|
|
||||||
|
|
||||||
Test: deb822-2-2
|
Test: deb822-2-2
|
||||||
Modes: root
|
Modes: root
|
||||||
Needs-Root: true
|
Needs-Root: true
|
||||||
Needs-APT-Config: true
|
|
||||||
|
|
||||||
Test: automatic-mirror-from-suite
|
Test: automatic-mirror-from-suite
|
||||||
Needs-QEMU: true
|
Needs-QEMU: true
|
||||||
|
|
||||||
Test: invalid-mirror
|
Test: invalid-mirror
|
||||||
Needs-APT-Config: true
|
|
||||||
|
|
||||||
Test: fail-installing-to-root
|
Test: fail-installing-to-root
|
||||||
Modes: root
|
Modes: root
|
||||||
|
@ -210,7 +198,6 @@ Needs-QEMU: true
|
||||||
|
|
||||||
Test: keyring-overwrites
|
Test: keyring-overwrites
|
||||||
Needs-Root: true
|
Needs-Root: true
|
||||||
Needs-APT-Config: true
|
|
||||||
|
|
||||||
Test: signed-by-without-host-keys
|
Test: signed-by-without-host-keys
|
||||||
Needs-QEMU: true
|
Needs-QEMU: true
|
||||||
|
@ -220,7 +207,6 @@ Needs-QEMU: true
|
||||||
|
|
||||||
Test: signed-by-with-host-keys
|
Test: signed-by-with-host-keys
|
||||||
Needs-Root: true
|
Needs-Root: true
|
||||||
Needs-APT-Config: true
|
|
||||||
|
|
||||||
Test: dpkgopt
|
Test: dpkgopt
|
||||||
Needs-Root: true
|
Needs-Root: true
|
||||||
|
@ -254,11 +240,9 @@ Needs-Root: true
|
||||||
|
|
||||||
Test: special-hooks-using-helpers
|
Test: special-hooks-using-helpers
|
||||||
Needs-Root: true
|
Needs-Root: true
|
||||||
Needs-APT-Config: true
|
|
||||||
|
|
||||||
Test: special-hooks-using-helpers-and-env-vars
|
Test: special-hooks-using-helpers-and-env-vars
|
||||||
Needs-Root: true
|
Needs-Root: true
|
||||||
Needs-APT-Config: true
|
|
||||||
|
|
||||||
Test: special-hooks-with-mode-mode
|
Test: special-hooks-with-mode-mode
|
||||||
Modes: root unshare fakechroot
|
Modes: root unshare fakechroot
|
||||||
|
@ -277,7 +261,6 @@ Needs-Root: true
|
||||||
|
|
||||||
Test: logfile
|
Test: logfile
|
||||||
Needs-Root: true
|
Needs-Root: true
|
||||||
Needs-APT-Config: true
|
|
||||||
|
|
||||||
Test: without-etc-resolv-conf-and-etc-hostname
|
Test: without-etc-resolv-conf-and-etc-hostname
|
||||||
Needs-QEMU: true
|
Needs-QEMU: true
|
||||||
|
@ -312,12 +295,10 @@ Modes: any
|
||||||
Test: unpack-doc-debian
|
Test: unpack-doc-debian
|
||||||
Modes: root fakechroot
|
Modes: root fakechroot
|
||||||
Variants: extract
|
Variants: extract
|
||||||
Needs-APT-Config: true
|
|
||||||
|
|
||||||
Test: install-doc-debian
|
Test: install-doc-debian
|
||||||
Modes: chrootless
|
Modes: chrootless
|
||||||
Variants: custom
|
Variants: custom
|
||||||
Needs-APT-Config: true
|
|
||||||
|
|
||||||
Test: chrootless
|
Test: chrootless
|
||||||
Variants: essential
|
Variants: essential
|
||||||
|
@ -331,7 +312,6 @@ Variants: essential
|
||||||
Modes: chrootless
|
Modes: chrootless
|
||||||
Skip-If:
|
Skip-If:
|
||||||
dist in ["oldstable", "stable"]
|
dist in ["oldstable", "stable"]
|
||||||
hostarch in ["i386", "armel", "armhf", "mipsel"] # #1023286
|
|
||||||
|
|
||||||
Test: chrootless-foreign
|
Test: chrootless-foreign
|
||||||
Variants: essential
|
Variants: essential
|
||||||
|
@ -345,12 +325,10 @@ Needs-QEMU: true
|
||||||
Test: install-doc-debian-and-output-tarball
|
Test: install-doc-debian-and-output-tarball
|
||||||
Variants: custom
|
Variants: custom
|
||||||
Modes: chrootless
|
Modes: chrootless
|
||||||
Needs-APT-Config: true
|
|
||||||
|
|
||||||
Test: install-doc-debian-and-test-hooks
|
Test: install-doc-debian-and-test-hooks
|
||||||
Variants: custom
|
Variants: custom
|
||||||
Modes: chrootless
|
Modes: chrootless
|
||||||
Needs-APT-Config: true
|
|
||||||
|
|
||||||
Test: install-libmagic-mgc-on-arm64
|
Test: install-libmagic-mgc-on-arm64
|
||||||
Variants: custom
|
Variants: custom
|
||||||
|
@ -380,20 +358,17 @@ Test: error-if-stdout-is-tty
|
||||||
Test: variant-custom-timeout
|
Test: variant-custom-timeout
|
||||||
|
|
||||||
Test: include-deb-file
|
Test: include-deb-file
|
||||||
Needs-APT-Config: true
|
|
||||||
|
|
||||||
Test: unshare-include-deb
|
Test: unshare-include-deb
|
||||||
Modes: unshare
|
Modes: unshare
|
||||||
|
|
||||||
Test: pivot_root
|
Test: pivot_root
|
||||||
Modes: root unshare
|
Modes: root unshare
|
||||||
Needs-APT-Config: true
|
|
||||||
|
|
||||||
Test: jessie-or-older
|
Test: jessie-or-older
|
||||||
Needs-Root: true
|
Needs-Root: true
|
||||||
Modes: root unshare fakechroot
|
Modes: root unshare fakechroot
|
||||||
Variants: essential apt minbase
|
Variants: essential apt minbase
|
||||||
Skip-If: mode == "fakechroot" and hostarch in ["i386", "armel", "armhf", "mipsel"] # #1023286
|
|
||||||
|
|
||||||
Test: apt-patterns
|
Test: apt-patterns
|
||||||
|
|
||||||
|
@ -403,8 +378,6 @@ Test: empty-sources.list
|
||||||
|
|
||||||
Test: merged-fakechroot-inside-unmerged-chroot
|
Test: merged-fakechroot-inside-unmerged-chroot
|
||||||
Needs-Root: true
|
Needs-Root: true
|
||||||
Needs-APT-Config: true
|
|
||||||
Skip-If: hostarch in ["i386", "armel", "armhf", "mipsel"] # #1023286
|
|
||||||
|
|
||||||
Test: auto-mode-as-normal-user
|
Test: auto-mode-as-normal-user
|
||||||
Modes: auto
|
Modes: auto
|
||||||
|
|
|
@ -176,8 +176,6 @@ cleanupapt() {
|
||||||
"$rootdir/var/lib/dpkg/lock-frontend" \
|
"$rootdir/var/lib/dpkg/lock-frontend" \
|
||||||
"$rootdir/var/lib/dpkg/lock" \
|
"$rootdir/var/lib/dpkg/lock" \
|
||||||
"$rootdir/etc/apt/apt.conf" \
|
"$rootdir/etc/apt/apt.conf" \
|
||||||
"$rootdir/etc/apt/sources.list.d/"* \
|
|
||||||
"$rootdir/etc/apt/preferences.d/"* \
|
|
||||||
"$rootdir/etc/apt/sources.list" \
|
"$rootdir/etc/apt/sources.list" \
|
||||||
"$rootdir/oldaptnames" \
|
"$rootdir/oldaptnames" \
|
||||||
"$rootdir/newaptnames" \
|
"$rootdir/newaptnames" \
|
||||||
|
@ -236,24 +234,6 @@ END
|
||||||
|
|
||||||
: > "$rootdir/var/lib/dpkg/status"
|
: > "$rootdir/var/lib/dpkg/status"
|
||||||
|
|
||||||
if [ "$dist" = "$DEFAULT_DIST" ] && [ "$nativearch" = "$HOSTARCH" ] && [ "$USE_HOST_APT_CONFIG" = "yes" ]; then
|
|
||||||
# we append sources and settings instead of overwriting after
|
|
||||||
# an empty line
|
|
||||||
for f in /etc/apt/sources.list /etc/apt/sources.list.d/*; do
|
|
||||||
[ -e "$f" ] || continue
|
|
||||||
[ -e "$rootdir/$f" ] && echo >> "$rootdir/$f"
|
|
||||||
# we do not add entries from deb.debian.org or
|
|
||||||
# otherwise tests will fail if mirror pushes happen
|
|
||||||
# while the script is running
|
|
||||||
grep -v deb.debian.org/debian "$f" >> "$rootdir/$f" || :
|
|
||||||
done
|
|
||||||
for f in /etc/apt/preferences.d/*; do
|
|
||||||
[ -e "$f" ] || continue
|
|
||||||
[ -e "$rootdir/$f" ] && echo >> "$rootdir/$f"
|
|
||||||
cat "$f" >> "$rootdir/$f"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
APT_CONFIG="$rootdir/etc/apt/apt.conf" apt-get update
|
APT_CONFIG="$rootdir/etc/apt/apt.conf" apt-get update
|
||||||
|
|
||||||
# before downloading packages and before replacing the old Packages
|
# before downloading packages and before replacing the old Packages
|
||||||
|
@ -417,13 +397,10 @@ security_mirror="http://security.debian.org/debian-security"
|
||||||
components=main
|
components=main
|
||||||
|
|
||||||
: "${DEFAULT_DIST:=unstable}"
|
: "${DEFAULT_DIST:=unstable}"
|
||||||
: "${ONLY_DEFAULT_DIST:=no}"
|
|
||||||
: "${ONLY_HOSTARCH:=no}"
|
|
||||||
: "${HAVE_QEMU:=yes}"
|
: "${HAVE_QEMU:=yes}"
|
||||||
: "${RUN_MA_SAME_TESTS:=yes}"
|
: "${RUN_MA_SAME_TESTS:=yes}"
|
||||||
# by default, use the mmdebstrap executable in the current directory
|
# by default, use the mmdebstrap executable in the current directory
|
||||||
: "${CMD:=./mmdebstrap}"
|
: "${CMD:=./mmdebstrap}"
|
||||||
: "${USE_HOST_APT_CONFIG:=no}"
|
|
||||||
|
|
||||||
if [ -e "$oldmirrordir/dists/$DEFAULT_DIST/Release" ]; then
|
if [ -e "$oldmirrordir/dists/$DEFAULT_DIST/Release" ]; then
|
||||||
http_code=$(curl --output /dev/null --silent --location --head --time-cond "$oldmirrordir/dists/$DEFAULT_DIST/Release" --write-out '%{http_code}' "$mirror/dists/$DEFAULT_DIST/Release")
|
http_code=$(curl --output /dev/null --silent --location --head --time-cond "$oldmirrordir/dists/$DEFAULT_DIST/Release" --write-out '%{http_code}' "$mirror/dists/$DEFAULT_DIST/Release")
|
||||||
|
@ -453,13 +430,6 @@ for nativearch in $arches; do
|
||||||
if [ "$nativearch" != "$HOSTARCH" ] && [ "$DEFAULT_DIST" != "$dist" ]; then
|
if [ "$nativearch" != "$HOSTARCH" ] && [ "$DEFAULT_DIST" != "$dist" ]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
# if ONLY_DEFAULT_DIST is set, only download DEFAULT_DIST
|
|
||||||
if [ "$ONLY_DEFAULT_DIST" = "yes" ] && [ "$DEFAULT_DIST" != "$dist" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
if [ "$ONLY_HOSTARCH" = "yes" ] && [ "$nativearch" != "$HOSTARCH" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
# we need a first pass without updates and security patches
|
# we need a first pass without updates and security patches
|
||||||
# because otherwise, old package versions needed by
|
# because otherwise, old package versions needed by
|
||||||
# debootstrap will not get included
|
# debootstrap will not get included
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
our $VERSION = '1.3.3';
|
our $VERSION = '1.3.2';
|
||||||
|
|
||||||
use English;
|
use English;
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
export LC_ALL=C.UTF-8
|
export LC_ALL=C.UTF-8
|
||||||
|
|
||||||
trap "rm -rf /tmp/debian-chroot" EXIT INT TERM
|
|
||||||
|
|
||||||
{{ CMD }} --mode=root --variant=apt {{ DIST }} /tmp/debian-chroot {{ MIRROR }}
|
{{ CMD }} --mode=root --variant=apt {{ DIST }} /tmp/debian-chroot {{ MIRROR }}
|
||||||
chroot /tmp/debian-chroot dpkg-query --showformat '${binary:Package}\n' --show > pkglist.txt
|
chroot /tmp/debian-chroot dpkg-query --showformat '${binary:Package}\n' --show > pkglist.txt
|
||||||
tar -C /tmp/debian-chroot --one-file-system -c . | tar -t | sort > tar1.txt
|
tar -C /tmp/debian-chroot --one-file-system -c . | tar -t | sort > tar1.txt
|
||||||
|
rm -r /tmp/debian-chroot
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
export LC_ALL=C.UTF-8
|
export LC_ALL=C.UTF-8
|
||||||
|
|
||||||
trap "rm -f /tmp/exists" EXIT INT TERM
|
|
||||||
|
|
||||||
touch /tmp/exists
|
touch /tmp/exists
|
||||||
ret=0
|
ret=0
|
||||||
{{ CMD }} --mode={{ MODE }} --variant=apt {{ DIST }} /tmp/exists {{ MIRROR }} || ret=$?
|
{{ CMD }} --mode={{ MODE }} --variant=apt {{ DIST }} /tmp/exists {{ MIRROR }} || ret=$?
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
export LC_ALL=C.UTF-8
|
export LC_ALL=C.UTF-8
|
||||||
|
|
||||||
trap 'rm -rf /tmp/quoted\"path' EXIT INT TERM
|
|
||||||
|
|
||||||
ret=0
|
ret=0
|
||||||
{{ CMD }} --mode={{ MODE }} --variant=apt {{ DIST }} /tmp/quoted\"path {{ MIRROR }} || ret=$?
|
{{ CMD }} --mode={{ MODE }} --variant=apt {{ DIST }} /tmp/quoted\"path {{ MIRROR }} || ret=$?
|
||||||
if [ "$ret" = 0 ]; then
|
if [ "$ret" = 0 ]; then
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
set -eu
|
set -eu
|
||||||
export LC_ALL=C.UTF-8
|
export LC_ALL=C.UTF-8
|
||||||
|
|
||||||
trap "rm -rf /tmp/dummypkg.deb /tmp/dummypkg" EXIT INT TERM
|
|
||||||
|
|
||||||
# instead of obtaining a .deb from our cache, we create a new package because
|
# instead of obtaining a .deb from our cache, we create a new package because
|
||||||
# otherwise apt might decide to download the package with the same name and
|
# otherwise apt might decide to download the package with the same name and
|
||||||
# version from the cache instead of using the local .deb
|
# version from the cache instead of using the local .deb
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
export LC_ALL=C.UTF-8
|
export LC_ALL=C.UTF-8
|
||||||
|
|
||||||
trap "rm -rf /tmp/debian-chroot" EXIT INT TERM
|
|
||||||
|
|
||||||
pkgs=base-files,base-passwd,busybox,debianutils,dpkg,libc-bin,mawk,tar
|
pkgs=base-files,base-passwd,busybox,debianutils,dpkg,libc-bin,mawk,tar
|
||||||
# busybox --install -s will install symbolic links into the rootfs, leaving
|
# busybox --install -s will install symbolic links into the rootfs, leaving
|
||||||
# existing files untouched. It has to run after extraction (otherwise there is
|
# existing files untouched. It has to run after extraction (otherwise there is
|
||||||
|
@ -34,3 +31,4 @@ chroot /tmp/debian-chroot echo foobar \
|
||||||
| chroot /tmp/debian-chroot tee /dev/null \
|
| chroot /tmp/debian-chroot tee /dev/null \
|
||||||
| chroot /tmp/debian-chroot sed 's/foobar/blubber/' \
|
| chroot /tmp/debian-chroot sed 's/foobar/blubber/' \
|
||||||
| chroot /tmp/debian-chroot grep blubber >/dev/null
|
| chroot /tmp/debian-chroot grep blubber >/dev/null
|
||||||
|
rm -r /tmp/debian-chroot
|
||||||
|
|
|
@ -5,8 +5,6 @@ export LC_ALL=C.UTF-8
|
||||||
[ {{ VARIANT }} = "custom" ]
|
[ {{ VARIANT }} = "custom" ]
|
||||||
[ {{ MODE }} = "chrootless" ]
|
[ {{ MODE }} = "chrootless" ]
|
||||||
|
|
||||||
trap "rm -rf /tmp/debian-chroot" EXIT INT TERM
|
|
||||||
|
|
||||||
prefix=
|
prefix=
|
||||||
if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then
|
if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then
|
||||||
if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then
|
if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then
|
||||||
|
|
|
@ -6,8 +6,6 @@ export SOURCE_DATE_EPOCH={{ SOURCE_DATE_EPOCH }}
|
||||||
[ {{ VARIANT }} = "custom" ]
|
[ {{ VARIANT }} = "custom" ]
|
||||||
[ {{ MODE }} = "chrootless" ]
|
[ {{ MODE }} = "chrootless" ]
|
||||||
|
|
||||||
trap "rm -rf /tmp/debian-chroot" EXIT INT TERM
|
|
||||||
|
|
||||||
prefix=
|
prefix=
|
||||||
if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then
|
if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then
|
||||||
if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then
|
if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
export LC_ALL=C.UTF-8
|
export LC_ALL=C.UTF-8
|
||||||
|
|
||||||
trap "rm -rf /tmp/debian-chroot /tmp/log /tmp/trimmed" EXIT INT TERM
|
|
||||||
|
|
||||||
# we check the full log to also prevent debug printfs to accidentally make it into a commit
|
# we check the full log to also prevent debug printfs to accidentally make it into a commit
|
||||||
{{ CMD }} --mode=root --variant=apt --logfile=/tmp/log {{ DIST }} /tmp/debian-chroot {{ MIRROR }}
|
{{ CMD }} --mode=root --variant=apt --logfile=/tmp/log {{ DIST }} /tmp/debian-chroot {{ MIRROR }}
|
||||||
# omit the last line which should contain the runtime
|
# omit the last line which should contain the runtime
|
||||||
|
@ -20,3 +17,5 @@ I: cleaning package lists and apt cache...
|
||||||
LOG
|
LOG
|
||||||
tail --lines=1 /tmp/log | grep '^I: success in .* seconds$'
|
tail --lines=1 /tmp/log | grep '^I: success in .* seconds$'
|
||||||
tar -C /tmp/debian-chroot --one-file-system -c . | tar -t | sort | diff -u tar1.txt -
|
tar -C /tmp/debian-chroot --one-file-system -c . | tar -t | sort | diff -u tar1.txt -
|
||||||
|
rm -r /tmp/debian-chroot
|
||||||
|
rm /tmp/log /tmp/trimmed
|
||||||
|
|
|
@ -8,7 +8,6 @@ rm -r /tmp/debian-chroot/usr/share/doc/debian
|
||||||
rm -r /tmp/debian-chroot/usr/share/doc/doc-debian
|
rm -r /tmp/debian-chroot/usr/share/doc/doc-debian
|
||||||
rm /tmp/debian-chroot/usr/share/lintian/overrides/tzdata
|
rm /tmp/debian-chroot/usr/share/lintian/overrides/tzdata
|
||||||
rm /tmp/debian-chroot/etc/localtime
|
rm /tmp/debian-chroot/etc/localtime
|
||||||
rm /tmp/debian-chroot/etc/timezone
|
|
||||||
rm -r /tmp/debian-chroot/usr/share/doc/tzdata
|
rm -r /tmp/debian-chroot/usr/share/doc/tzdata
|
||||||
rm -r /tmp/debian-chroot/usr/share/zoneinfo
|
rm -r /tmp/debian-chroot/usr/share/zoneinfo
|
||||||
rm /tmp/debian-chroot/var/lib/apt/extended_states
|
rm /tmp/debian-chroot/var/lib/apt/extended_states
|
||||||
|
|
|
@ -6,12 +6,9 @@
|
||||||
set -eu
|
set -eu
|
||||||
export LC_ALL=C.UTF-8
|
export LC_ALL=C.UTF-8
|
||||||
[ "$(whoami)" = "root" ]
|
[ "$(whoami)" = "root" ]
|
||||||
|
|
||||||
trap "rm -f /tmp/debian-chroot.tar script.sh" EXIT INT TERM
|
|
||||||
|
|
||||||
cat << 'SCRIPT' > script.sh
|
cat << 'SCRIPT' > script.sh
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -exu
|
set -eu
|
||||||
rootfs="$1"
|
rootfs="$1"
|
||||||
mkdir -p "$rootfs/mnt"
|
mkdir -p "$rootfs/mnt"
|
||||||
[ -e /usr/bin/mmdebstrap ] && cp -aT /usr/bin/mmdebstrap "$rootfs/usr/bin/mmdebstrap"
|
[ -e /usr/bin/mmdebstrap ] && cp -aT /usr/bin/mmdebstrap "$rootfs/usr/bin/mmdebstrap"
|
||||||
|
@ -26,3 +23,4 @@ chmod +x script.sh
|
||||||
--customize-hook="download /tmp/debian-chroot.tar /tmp/debian-chroot.tar" \
|
--customize-hook="download /tmp/debian-chroot.tar /tmp/debian-chroot.tar" \
|
||||||
{{ DIST }} /dev/null {{ MIRROR }}
|
{{ DIST }} /dev/null {{ MIRROR }}
|
||||||
tar -tf /tmp/debian-chroot.tar | sort | diff -u tar1.txt -
|
tar -tf /tmp/debian-chroot.tar | sort | diff -u tar1.txt -
|
||||||
|
rm /tmp/debian-chroot.tar script.sh
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
set -eu
|
set -eu
|
||||||
export LC_ALL=C.UTF-8
|
export LC_ALL=C.UTF-8
|
||||||
|
|
||||||
trap "rm -rf /tmp/debian-chroot" EXIT INT TERM
|
|
||||||
|
|
||||||
[ {{ VARIANT }} = extract ]
|
[ {{ VARIANT }} = extract ]
|
||||||
|
|
||||||
prefix=
|
prefix=
|
||||||
|
|
|
@ -5,8 +5,6 @@ export LC_ALL=C.UTF-8
|
||||||
|
|
||||||
[ "{{ MODE }}" = unshare ]
|
[ "{{ MODE }}" = unshare ]
|
||||||
|
|
||||||
trap "rm -rf /tmp/dummypkg.deb /tmp/dummypkg" EXIT INT TERM
|
|
||||||
|
|
||||||
prefix=
|
prefix=
|
||||||
if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then
|
if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then
|
||||||
if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then
|
if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then
|
||||||
|
|
Loading…
Reference in a new issue