disable merged usr

This commit is contained in:
Johannes 'josch' Schauer 2018-12-07 00:17:10 +01:00
parent c8dbe5bd15
commit 97d273aaf6
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1
3 changed files with 31 additions and 30 deletions

View file

@ -609,13 +609,13 @@ rm /tmp/debian-unstable/etc/fstab
rm /tmp/debian-unstable/etc/hostname
rm /tmp/debian-unstable/etc/resolv.conf
rm /tmp/debian-unstable/var/lib/dpkg/status
# delete symlinks
rm /tmp/debian-unstable/libx32
rm /tmp/debian-unstable/lib64
rm /tmp/debian-unstable/lib32
rm /tmp/debian-unstable/sbin
rm /tmp/debian-unstable/bin
rm /tmp/debian-unstable/lib
## delete merged usr symlinks
#rm /tmp/debian-unstable/libx32
#rm /tmp/debian-unstable/lib64
#rm /tmp/debian-unstable/lib32
#rm /tmp/debian-unstable/sbin
#rm /tmp/debian-unstable/bin
#rm /tmp/debian-unstable/lib
# delete ./dev (files might exist or not depending on the mode)
rm -f /tmp/debian-unstable/dev/console
rm -f /tmp/debian-unstable/dev/fd
@ -660,13 +660,13 @@ rm /tmp/debian-unstable/etc/fstab
rm /tmp/debian-unstable/etc/hostname
rm /tmp/debian-unstable/etc/resolv.conf
rm /tmp/debian-unstable/var/lib/dpkg/status
# delete symlinks
rm /tmp/debian-unstable/libx32
rm /tmp/debian-unstable/lib64
rm /tmp/debian-unstable/lib32
rm /tmp/debian-unstable/sbin
rm /tmp/debian-unstable/bin
rm /tmp/debian-unstable/lib
## delete merged usr symlinks
#rm /tmp/debian-unstable/libx32
#rm /tmp/debian-unstable/lib64
#rm /tmp/debian-unstable/lib32
#rm /tmp/debian-unstable/sbin
#rm /tmp/debian-unstable/bin
#rm /tmp/debian-unstable/lib
# in chrootless mode, there is more to remove
rm /tmp/debian-unstable/var/log/apt/eipp.log.xz
rm /tmp/debian-unstable/var/lib/dpkg/triggers/Lock
@ -736,9 +736,9 @@ prefix=
# artificially add some files
# in proot mode, some extra files are put there by proot
{ tar -tf /tmp/unstable-chroot.tar \
| grep -v '^\./usr/lib/ld-linux-armhf\.so\.3$' \
| grep -v '^\./usr/lib/arm-linux-gnueabihf/ld-linux\.so\.3$' \
| grep -v '^\./usr/lib/arm-linux-gnueabihf/ld-linux-armhf\.so\.3$' \
| grep -v '^\./lib/ld-linux-armhf\.so\.3$' \
| grep -v '^\./lib/arm-linux-gnueabihf/ld-linux\.so\.3$' \
| grep -v '^\./lib/arm-linux-gnueabihf/ld-linux-armhf\.so\.3$' \
| sed 's/arm-linux-gnueabihf/x86_64-linux-gnu/' \
| sed 's/armhf/amd64/';
[ "$mode" = "fakechroot" ] && printf "./etc/ld.so.cache\n./var/cache/ldconfig/\n";
@ -746,10 +746,11 @@ prefix=
{ cat tar1.txt \
| grep -v '^\./usr/bin/i386$' \
| grep -v '^\./usr/bin/x86_64$' \
| grep -v '^\./usr/lib64/ld-linux-x86-64\.so\.2$' \
| grep -v '^\./usr/lib/x86_64-linux-gnu/ld-linux-x86-64\.so\.2$' \
| grep -v '^\./usr/lib/x86_64-linux-gnu/libmvec-2\.[0-9]\+\.so$' \
| grep -v '^\./usr/lib/x86_64-linux-gnu/libmvec\.so\.1$' \
| grep -v '^\./lib64/$' \
| grep -v '^\./lib64/ld-linux-x86-64\.so\.2$' \
| grep -v '^\./lib/x86_64-linux-gnu/ld-linux-x86-64\.so\.2$' \
| grep -v '^\./lib/x86_64-linux-gnu/libmvec-2\.[0-9]\+\.so$' \
| grep -v '^\./lib/x86_64-linux-gnu/libmvec\.so\.1$' \
| grep -v '^\./usr/share/man/man8/i386\.8\.gz$' \
| grep -v '^\./usr/share/man/man8/x86_64\.8\.gz$';
[ "$mode" = "proot" ] && printf "./etc/ld.so.preload\n";

View file

@ -251,12 +251,12 @@ mirror="http://127.0.0.1/debian"
SOURCE_DATE_EPOCH=$(date --date="$(grep-dctrl -s Date -n '' "$mirrordir/dists/unstable/Release")" +%s)
for dist in stable testing unstable; do
for variant in minbase buildd -; do
echo running debootstrap --merged-usr --variant=$variant $dist /tmp/debian-$dist-debootstrap $mirror
echo running debootstrap --no-merged-usr --variant=$variant $dist /tmp/debian-$dist-debootstrap $mirror
cat << END > shared/test.sh
#!/bin/sh
set -eu
export LC_ALL=C
debootstrap --merged-usr --variant=$variant $dist /tmp/debian-$dist-debootstrap $mirror
debootstrap --no-merged-usr --variant=$variant $dist /tmp/debian-$dist-debootstrap $mirror
tar --sort=name --mtime=@$SOURCE_DATE_EPOCH --clamp-mtime --numeric-owner --one-file-system -C /tmp/debian-$dist-debootstrap -c . > "cache/debian-$dist-$variant.tar"
rm -r /tmp/debian-$dist-debootstrap
END

View file

@ -690,12 +690,12 @@ sub setup {
close $fh;
}
# setup merged usr
my @amd64_dirs = ('lib32', 'lib64', 'libx32'); # only amd64 for now
foreach my $dir ("bin", "sbin", "lib", @amd64_dirs) {
symlink "usr/$dir", "$options->{root}/$dir" or die "cannot create symlink: $!";
make_path("$options->{root}/usr/$dir") or die "cannot create /usr/$dir: $!";
}
## setup merged usr
#my @amd64_dirs = ('lib32', 'lib64', 'libx32'); # only amd64 for now
#foreach my $dir ("bin", "sbin", "lib", @amd64_dirs) {
# symlink "usr/$dir", "$options->{root}/$dir" or die "cannot create symlink: $!";
# make_path("$options->{root}/usr/$dir") or die "cannot create /usr/$dir: $!";
#}
{
open my $fh, '>', "$options->{root}/etc/fstab" or die "cannot open fstab: $!";
@ -996,7 +996,7 @@ sub setup {
'/bin/mount=/bin/true',
'/usr/bin/ldd=/usr/bin/ldd.fakechroot',
'/usr/bin/mkfifo=/bin/true',
'/usr/sbin/ldconfig=/bin/true',
'/sbin/ldconfig=/bin/true',
);
}