Compare commits

..

No commits in common. "adf62afcea372cbf095ef804d93e196b58a4e10a" and "2f27eccad4edc76bac04da3e4fdbdbf5ed3d0c9b" have entirely different histories.

2 changed files with 18 additions and 29 deletions

View file

@ -8,20 +8,8 @@ fi
TARGET="$1" TARGET="$1"
if [ "${MMDEBSTRAP_MODE:-}" = "chrootless" ]; then APT_CONFIG=$MMDEBSTRAP_APT_CONFIG apt-get --yes install -oDPkg::Chroot-Directory="$TARGET" usr-is-merged
APT_CONFIG=$MMDEBSTRAP_APT_CONFIG apt-get --yes install \
-oDPkg::Options::=--force-not-root \ chroot "$TARGET" dpkg-query --showformat '${db:Status-Status}\n' --show usr-is-merged | grep -q '^installed$'
-oDPkg::Options::=--force-script-chrootless \ chroot "$TARGET" dpkg-query --showformat '${Source}\n' --show usr-is-merged | grep -q '^usrmerge$'
-oDPkg::Options::=--root="$TARGET" \ dpkg --compare-versions "1" "lt" "$(chroot "$TARGET" dpkg-query --showformat '${Version}\n' --show usr-is-merged)"
-oDPkg::Options::=--log="$TARGET/var/log/dpkg.log" \
usr-is-merged
export DPKG_ROOT="$TARGET"
dpkg-query --showformat '${db:Status-Status}\n' --show usr-is-merged | grep -q '^installed$'
dpkg-query --showformat '${Source}\n' --show usr-is-merged | grep -q '^usrmerge$'
dpkg --compare-versions "1" "lt" "$(dpkg-query --showformat '${Version}\n' --show usr-is-merged)"
else
APT_CONFIG=$MMDEBSTRAP_APT_CONFIG apt-get --yes install -oDPkg::Chroot-Directory="$TARGET" usr-is-merged
chroot "$TARGET" dpkg-query --showformat '${db:Status-Status}\n' --show usr-is-merged | grep -q '^installed$'
chroot "$TARGET" dpkg-query --showformat '${Source}\n' --show usr-is-merged | grep -q '^usrmerge$'
dpkg --compare-versions "1" "lt" "$(chroot "$TARGET" dpkg-query --showformat '${Version}\n' --show usr-is-merged)"
fi

View file

@ -1858,14 +1858,18 @@ sub run_setup() {
close $fh; close $fh;
} }
# In theory, /var/lib/dpkg/arch is only useful if there are foreign # we create /var/lib/dpkg/arch inside the chroot either if there is more
# architectures configured or if the architecture of a chrootless chroot # than the native architecture in the chroot or if chrootless mode is
# is different from the native architecture outside the chroot. # used to create a chroot of a different architecture than the native
# We nevertheless always add /var/lib/dpkg/arch to make a chroot built the # architecture outside the chroot.
# normal way bit-by-bit identical to a foreign arch chroot built in
# chrootless mode.
chomp(my $hostarch = `dpkg --print-architecture`); chomp(my $hostarch = `dpkg --print-architecture`);
if ((!-e "$options->{root}/var/lib/dpkg/arch")) { if (
(!-e "$options->{root}/var/lib/dpkg/arch")
and (
scalar @{ $options->{foreignarchs} } > 0
or ( $options->{mode} eq 'chrootless'
and $hostarch ne $options->{nativearch}))
) {
open my $fh, '>', "$options->{root}/var/lib/dpkg/arch" open my $fh, '>', "$options->{root}/var/lib/dpkg/arch"
or error "cannot open /var/lib/dpkg/arch: $!"; or error "cannot open /var/lib/dpkg/arch: $!";
print $fh "$options->{nativearch}\n"; print $fh "$options->{nativearch}\n";
@ -3997,7 +4001,6 @@ sub get_sourceslist_by_suite {
variants() { :; }; variants() { :; };
keyring() { :; }; keyring() { :; };
doing_variant() { false; }; doing_variant() { false; };
info() { fmt="$2"; shift; shift; printf "I: $fmt\n" "$@" >&2; };
. /usr/share/debootstrap/scripts/gutsy;'; . /usr/share/debootstrap/scripts/gutsy;';
open my $fh, '-|', 'env', "ARCH=$arch", "SUITE=$suite", open my $fh, '-|', 'env', "ARCH=$arch", "SUITE=$suite",
'sh', '-c', $script // last; 'sh', '-c', $script // last;
@ -6946,9 +6949,8 @@ Create a bootable USB Stick that boots into a full Debian desktop:
$ guestfish -N debian-unstable.img=disk:8G -- \ $ guestfish -N debian-unstable.img=disk:8G -- \
part-disk /dev/sda mbr : \ part-disk /dev/sda mbr : \
part-set-bootable /dev/sda 1 true : \ part-set-bootable /dev/sda 1 true : \
mkfs ext4 /dev/sda1 : \
set-label /dev/sda1 rootfs : \ set-label /dev/sda1 rootfs : \
mount /dev/sda1 / : \ mkfs ext4 /dev/sda1 : mount /dev/sda1 / : \
tar-in debian-unstable.tar / xattrs:true : \ tar-in debian-unstable.tar / xattrs:true : \
upload /usr/lib/EXTLINUX/mbr.bin /boot/mbr.bin : \ upload /usr/lib/EXTLINUX/mbr.bin /boot/mbr.bin : \
copy-file-to-device /boot/mbr.bin /dev/sda size:440 : \ copy-file-to-device /boot/mbr.bin /dev/sda size:440 : \
@ -6962,9 +6964,8 @@ On architectures without extlinux you can also boot using grub2:
$ guestfish -N debian-unstable.img=disk:2G -- \ $ guestfish -N debian-unstable.img=disk:2G -- \
part-disk /dev/sda mbr : \ part-disk /dev/sda mbr : \
part-set-bootable /dev/sda 1 true : \ part-set-bootable /dev/sda 1 true : \
mkfs ext4 /dev/sda1 : \
set-label /dev/sda1 rootfs : \ set-label /dev/sda1 rootfs : \
mount /dev/sda1 / : \ mkfs ext4 /dev/sda1 : mount /dev/sda1 / : \
tar-in fs.tar / xattrs:true : \ tar-in fs.tar / xattrs:true : \
command "grub-install /dev/sda" : \ command "grub-install /dev/sda" : \
command update-grub : \ command update-grub : \