Compare commits

..

No commits in common. "7123808b6cf7e25ea30ec970fe02fd5555ee1ffb" and "9682e74385e85c44652664a79ec6288cec4e1558" have entirely different histories.

6 changed files with 6 additions and 68 deletions

View file

@ -330,5 +330,3 @@ Needs-QEMU: true
Test: error-if-stdout-is-tty Test: error-if-stdout-is-tty
Test: variant-custom-timeout Test: variant-custom-timeout
Test: include-deb-file

View file

@ -8,7 +8,6 @@ fi
rootdir="$1" rootdir="$1"
# process all configured apt repositories
env APT_CONFIG=$MMDEBSTRAP_APT_CONFIG apt-get indextargets --no-release-info --format '$(REPO_URI)' \ env APT_CONFIG=$MMDEBSTRAP_APT_CONFIG apt-get indextargets --no-release-info --format '$(REPO_URI)' \
| sed -ne 's/^file:\/\+//p' \ | sed -ne 's/^file:\/\+//p' \
| sort -u \ | sort -u \
@ -28,38 +27,3 @@ env APT_CONFIG=$MMDEBSTRAP_APT_CONFIG apt-get indextargets --no-release-info --f
esac esac
printf '/%s\0' "$path" >> "$rootdir/run/mmdebstrap/file-mirror-automount" printf '/%s\0' "$path" >> "$rootdir/run/mmdebstrap/file-mirror-automount"
done done
# process all files given via --include
set -f # turn off pathname expansion
IFS=',' # split by comma
for pkg in $MMDEBSTRAP_INCLUDE; do
set +f; unset IFS
case $pkg in
./*|../*|/*) : ;; # we are interested in this case
*) continue ;; # not a file
esac
# undo escaping
pkg="$(printf '%s' "$pkg" | sed 's/%2C/,/g; s/%25/%/g')"
# check for existance
if [ ! -f "$pkg" ]; then
echo "$pkg does not exist" >&2
continue
fi
# make path absolute
pkg="$(realpath "$pkg")"
mkdir -p "$rootdir/run/mmdebstrap"
mkdir -p "$rootdir/$(dirname "$pkg")"
case $MMDEBSTRAP_MODE in
root|unshare)
echo "bind-mounting $pkg into the chroot" >&2
touch "$rootdir/$pkg"
mount -o bind "$pkg" "$rootdir/$pkg"
;;
*)
echo "copying $pkg into the chroot" >&2
cp -av "$pkg" "$rootdir/$pkg"
;;
esac
printf '/%s\0' "$pkg" >> "$rootdir/run/mmdebstrap/file-mirror-automount"
done
set +f; unset IFS

View file

@ -3022,9 +3022,6 @@ sub run_cleanup() {
# skip the "." and ".." entries # skip the "." and ".." entries
next if $entry eq "."; next if $entry eq ".";
next if $entry eq ".."; next if $entry eq "..";
# skip deleting /run/lock as /var/lock is a symlink to it
# according to Debian policy §9.1.4
next if $entry eq "lock";
debug "deleting files in /run: $entry"; debug "deleting files in /run: $entry";
0 == system( 0 == system(
'rm', '--interactive=never', 'rm', '--interactive=never',
@ -4285,7 +4282,7 @@ sub main() {
} elsif ($opt_value =~ /^\.?\.?\//) { } elsif ($opt_value =~ /^\.?\.?\//) {
# Treat option as a single path name and don't split by comma # Treat option as a single path name and don't split by comma
# or whitespace -- append the normalized path. # or whitespace -- append the normalized path.
push @{ $options->{include} }, &{$sanitize_path}($opt_value); push @{ $options->{include} }, sanitize_path($opt_value);
} else { } else {
for my $pkg (split /[,\s]+/, $opt_value) { for my $pkg (split /[,\s]+/, $opt_value) {
# strip leading and trailing whitespace # strip leading and trailing whitespace
@ -4297,7 +4294,7 @@ sub main() {
# Make paths canonical absolute paths, resolve symlinks # Make paths canonical absolute paths, resolve symlinks
# and check if it's an existing file. # and check if it's an existing file.
if ($pkg =~ /^\.?\.?\//) { if ($pkg =~ /^\.?\.?\//) {
$pkg = &{$sanitize_path}($pkg); $pkg = sanitize_path($pkg);
} }
push @{ $options->{include} }, $pkg; push @{ $options->{include} }, $pkg;
} }

View file

@ -34,8 +34,8 @@ rm /tmp/debian-debootstrap/var/log/dpkg.log \
/tmp/debian-debootstrap/var/log/alternatives.log \ /tmp/debian-debootstrap/var/log/alternatives.log \
/tmp/debian-mm/var/log/bootstrap.log /tmp/debian-mm/var/log/bootstrap.log
# clear out /run except for /run/lock # clear out /run
find /tmp/debian-debootstrap/run/ -mindepth 1 -maxdepth 1 ! -name lock -print0 | xargs --no-run-if-empty -0 rm -r rm -r /tmp/debian-debootstrap/run/*
# debootstrap doesn't clean apt # debootstrap doesn't clean apt
rm /tmp/debian-debootstrap/var/lib/apt/lists/127.0.0.1_debian_dists_unstable_main_binary-{{ HOSTARCH }}_Packages \ rm /tmp/debian-debootstrap/var/lib/apt/lists/127.0.0.1_debian_dists_unstable_main_binary-{{ HOSTARCH }}_Packages \

View file

@ -95,8 +95,8 @@ fi
if [ -e /tmp/debian-{{ DIST }}-mm/etc/apt/apt.conf.d/01autoremove-kernels ]; then if [ -e /tmp/debian-{{ DIST }}-mm/etc/apt/apt.conf.d/01autoremove-kernels ]; then
rm /tmp/debian-{{ DIST }}-mm/etc/apt/apt.conf.d/01autoremove-kernels rm /tmp/debian-{{ DIST }}-mm/etc/apt/apt.conf.d/01autoremove-kernels
fi fi
# clear out /run except for /run/lock # clear out /run
find /tmp/debian-{{ DIST }}-debootstrap/run/ -mindepth 1 -maxdepth 1 ! -name lock -print0 | xargs --no-run-if-empty -0 rm -r rm -r /tmp/debian-{{ DIST }}-debootstrap/run/*
# debootstrap doesn't clean apt # debootstrap doesn't clean apt
rm /tmp/debian-{{ DIST }}-debootstrap/var/lib/apt/lists/127.0.0.1_debian_dists_{{ DIST }}_main_binary-{{ HOSTARCH }}_Packages \ rm /tmp/debian-{{ DIST }}-debootstrap/var/lib/apt/lists/127.0.0.1_debian_dists_{{ DIST }}_main_binary-{{ HOSTARCH }}_Packages \
/tmp/debian-{{ DIST }}-debootstrap/var/lib/apt/lists/127.0.0.1_debian_dists_{{ DIST }}_Release \ /tmp/debian-{{ DIST }}-debootstrap/var/lib/apt/lists/127.0.0.1_debian_dists_{{ DIST }}_Release \

View file

@ -1,21 +0,0 @@
#!/bin/sh
set -eu
export LC_ALL=C.UTF-8
{{ CMD }} --variant=apt \
--customize-hook='mkdir "$1"/tmp/apt' \
--customize-hook='chroot "$1" env --chdir=/tmp/apt apt-get download busybox' \
--customize-hook='copy-out /tmp/apt /tmp' \
{{ DIST }} /dev/null {{ MIRROR }}
pkg="$(find /tmp/apt -type f)"
# some sanity checks
[ -f "$pkg" ]
case $pkg in
/tmp/apt/busybox*_{{ HOSTARCH }}.deb) : ;;
*) exit 1;;
esac
# now try to install that package
{{ CMD }} --variant=apt --include="$pkg" \
--customize-hook='chroot "$1" dpkg-query -W -f="\${Status}\n" busybox | grep "^install ok installed$"' \
{{ DIST }} /dev/null {{ MIRROR }}