Compare commits
4 commits
2f27eccad4
...
adf62afcea
Author | SHA1 | Date | |
---|---|---|---|
|
adf62afcea | ||
3999212c48 | |||
c6c2baee6a | |||
6c68ab2e5e |
2 changed files with 29 additions and 18 deletions
|
@ -8,8 +8,20 @@ fi
|
||||||
|
|
||||||
TARGET="$1"
|
TARGET="$1"
|
||||||
|
|
||||||
|
if [ "${MMDEBSTRAP_MODE:-}" = "chrootless" ]; then
|
||||||
|
APT_CONFIG=$MMDEBSTRAP_APT_CONFIG apt-get --yes install \
|
||||||
|
-oDPkg::Options::=--force-not-root \
|
||||||
|
-oDPkg::Options::=--force-script-chrootless \
|
||||||
|
-oDPkg::Options::=--root="$TARGET" \
|
||||||
|
-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
|
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 '${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$'
|
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)"
|
dpkg --compare-versions "1" "lt" "$(chroot "$TARGET" dpkg-query --showformat '${Version}\n' --show usr-is-merged)"
|
||||||
|
fi
|
||||||
|
|
25
mmdebstrap
25
mmdebstrap
|
@ -1858,18 +1858,14 @@ sub run_setup() {
|
||||||
close $fh;
|
close $fh;
|
||||||
}
|
}
|
||||||
|
|
||||||
# we create /var/lib/dpkg/arch inside the chroot either if there is more
|
# In theory, /var/lib/dpkg/arch is only useful if there are foreign
|
||||||
# than the native architecture in the chroot or if chrootless mode is
|
# architectures configured or if the architecture of a chrootless chroot
|
||||||
# used to create a chroot of a different architecture than the native
|
# is different from the native architecture outside the chroot.
|
||||||
# architecture outside the chroot.
|
# We nevertheless always add /var/lib/dpkg/arch to make a chroot built the
|
||||||
|
# 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 (
|
if ((!-e "$options->{root}/var/lib/dpkg/arch")) {
|
||||||
(!-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";
|
||||||
|
@ -4001,6 +3997,7 @@ 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;
|
||||||
|
@ -6949,8 +6946,9 @@ 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 : \
|
||||||
mkfs ext4 /dev/sda1 : mount /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 : \
|
||||||
|
@ -6964,8 +6962,9 @@ 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 : \
|
||||||
mkfs ext4 /dev/sda1 : mount /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 : \
|
||||||
|
|
Loading…
Reference in a new issue