coverage.sh: auto generate package list for aspcud instead of hardcoding it

This commit is contained in:
Johannes 'josch' Schauer 2019-03-27 11:44:45 +01:00
parent bc3d5153df
commit 19fdb4914d
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1
3 changed files with 56 additions and 4 deletions

View file

@ -52,7 +52,7 @@ if [ ! -e shared/mmdebstrap ] || [ mmdebstrap -nt shared/mmdebstrap ]; then
fi fi
starttime= starttime=
total=90 total=91
i=1 i=1
print_header() { print_header() {
@ -253,6 +253,7 @@ cat << END > shared/test.sh
set -eu set -eu
export LC_ALL=C.UTF-8 export LC_ALL=C.UTF-8
$CMD --mode=root --variant=apt $DEFAULT_DIST /tmp/debian-chroot $mirror $CMD --mode=root --variant=apt $DEFAULT_DIST /tmp/debian-chroot $mirror
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 rm -r /tmp/debian-chroot
END END
@ -496,7 +497,7 @@ cat << END > shared/test.sh
set -eu set -eu
export LC_ALL=C.UTF-8 export LC_ALL=C.UTF-8
$CMD --mode=$defaultmode --variant=custom \ $CMD --mode=$defaultmode --variant=custom \
--include apt,base-files,base-passwd,bash,bsdutils,coreutils,dash,debianutils,diffutils,dpkg,findutils,gpgv,grep,gzip,hostname,init-system-helpers,libc-bin,login,mawk,ncurses-base,ncurses-bin,perl-base,sed,sysvinit-utils,tar,util-linux \ --include \$(cat pkglist.txt | tr '\n' ',') \
--aptopt='APT::Solver "aspcud"' \ --aptopt='APT::Solver "aspcud"' \
$DEFAULT_DIST /tmp/debian-chroot.tar $mirror $DEFAULT_DIST /tmp/debian-chroot.tar $mirror
tar -tf /tmp/debian-chroot.tar | sort \ tar -tf /tmp/debian-chroot.tar | sort \
@ -1152,6 +1153,49 @@ else
./run_null.sh ./run_null.sh
fi fi
print_header "mode=root,variant=custom: install busybox-based sub-essential system"
cat << END > shared/test.sh
#!/bin/sh
set -eu
export LC_ALL=C.UTF-8
$CMD --mode=root --variant=custom \
--include=dpkg,busybox,libc-bin,base-files,base-passwd,debianutils \
--setup-hook='mkdir -p "\$1/bin"' \
--setup-hook='for p in awk cat chmod chown cp diff echo env grep less ln mkdir mount rm rmdir sed sh sleep sort touch uname; do ln -s busybox "\$1/bin/\$p"; done' \
--setup-hook='echo root:x:0:0:root:/root:/bin/sh > "\$1/etc/passwd"' \
--setup-hook='printf "root:x:0:\nmail:x:8:\nutmp:x:43:\n" > "\$1/etc/group"' \
$DEFAULT_DIST /tmp/debian-chroot $mirror
cat << FILE > expected
base-files
base-passwd
busybox
debianutils
dpkg
gcc-8-base:amd64
libacl1:amd64
libattr1:amd64
libbz2-1.0:amd64
libc-bin
libc6:amd64
libdebconfclient0:amd64
libgcc1:amd64
liblzma5:amd64
libpcre3:amd64
libselinux1:amd64
mawk
tar
zlib1g:amd64
FILE
chroot /tmp/debian-chroot dpkg-query -f '\${binary:Package}\n' -W | diff -u - expected
rm expected
rm -r /tmp/debian-chroot
END
if [ "$HAVE_QEMU" = "yes" ]; then
./run_qemu.sh
else
./run_null.sh SUDO
fi
# test foreign architecture with all modes # test foreign architecture with all modes
# create directory in sudo mode # create directory in sudo mode
@ -1233,4 +1277,4 @@ if [ -e shared/cover_db/runs ]; then
echo echo
fi fi
rm shared/tar1.txt shared/tar2.txt rm shared/tar1.txt shared/tar2.txt shared/pkglist.txt

View file

@ -160,7 +160,7 @@ END
--or --field=Priority important --or --field=Priority standard \ --or --field=Priority important --or --field=Priority standard \
--or --field=Package build-essential \) ) --or --field=Package build-essential \) )
pkgs="$(echo $pkgs) build-essential" pkgs="$(echo $pkgs) build-essential busybox"
APT_CONFIG="$rootdir/etc/apt/apt.conf" apt-get --yes install $pkgs APT_CONFIG="$rootdir/etc/apt/apt.conf" apt-get --yes install $pkgs

View file

@ -2609,6 +2609,14 @@ Example: Setup merged-/usr via symlinks
--setup-hook='for d in bin sbin lib; do ln -s usr/$d "$1/$d"; mkdir -p "$1/usr/$d"; done' --setup-hook='for d in bin sbin lib; do ln -s usr/$d "$1/$d"; mkdir -p "$1/usr/$d"; done'
Example: Setup chroot for installing a sub-essential busybox-based chroot with
--variant=custom --include=dpkg,busybox,libc-bin,base-files,base-passwd,debianutils
--setup-hook='mkdir -p "$1/bin"'
--setup-hook='for p in awk cat chmod chown cp diff echo env grep less ln mkdir mount rm rmdir sed sh sleep sort touch uname; do ln -s busybox "$1/bin/$p"; done'
--setup-hook='echo root:x:0:0:root:/root:/bin/sh > "$1/etc/passwd"'
--setup-hook='printf "root:x:0:\nmail:x:8:\nutmp:x:43:\n" > "$1/etc/group"'
=item B<--essential-hook>=I<command> =item B<--essential-hook>=I<command>
Execute arbitrary I<command>s after the Essential:yes packages have been Execute arbitrary I<command>s after the Essential:yes packages have been