move hooks/setup00-merged-usr.sh -> hooks/merged-usr/setup00.sh, expand docs

This commit is contained in:
Johannes Schauer Marin Rodrigues 2021-09-03 12:04:40 +02:00
parent 6a8fbae9d8
commit 6851cd7cb4
Signed by: josch
GPG key ID: F2CBA5C78FBD83E1
2 changed files with 29 additions and 4 deletions

View file

@ -5,7 +5,13 @@
# #
# Using this hook script, you can emulate what debootstrap does to set up # Using this hook script, you can emulate what debootstrap does to set up
# merged /usr via directory symlinks, even using the exact same shell function # merged /usr via directory symlinks, even using the exact same shell function
# that debootstrap uses. # that debootstrap uses by running mmdebstrap with:
#
# --setup-hook=/usr/share/mmdebstrap/hooks/merged-usr/setup00.sh
#
# Alternatively, you can setup merged-/usr by installing the usrmerge package:
#
# --include=usrmerge
# #
# mmdebstrap will not include this functionality via a --merged-usr option # mmdebstrap will not include this functionality via a --merged-usr option
# because there are many reasons against implementing merged-/usr that way: # because there are many reasons against implementing merged-/usr that way:
@ -24,6 +30,10 @@
# The information whether a distribution uses this approach to merged-/usr or # The information whether a distribution uses this approach to merged-/usr or
# not is not anymore contained in its packages but in a tool from the outside. # not is not anymore contained in its packages but in a tool from the outside.
# #
# Example real world problem: I'm using debbisect to bisect Debian unstable
# between 2015 and today. For which snapshot.d.o timestamp should a merged-/usr
# chroot be created and for which ones not?
#
# The problem is not the idea of merged-/usr but the problem is the way how it # The problem is not the idea of merged-/usr but the problem is the way how it
# got implemented in debootstrap via directory symlinks. That way of rolling # got implemented in debootstrap via directory symlinks. That way of rolling
# out merged-/usr is bad from the dpkg point-of-view and completely opposite of # out merged-/usr is bad from the dpkg point-of-view and completely opposite of

View file

@ -6227,6 +6227,10 @@ package list is free of duplicates. So the following are equivalent:
--include=pkg1/stable,pkg2=1.0,pkg3- --include=pkg1/stable,pkg2=1.0,pkg3-
--incl=pkg1/stable --incl="pkg2=1.0 pkg3-" --incl=pkg2=1.0,pkg3- --incl=pkg1/stable --incl="pkg2=1.0 pkg3-" --incl=pkg2=1.0,pkg3-
Example: setting up merged-/usr via the usrmerge package
--include=usrmerge
=item B<--components>=I<comp1>[,I<comp2>,...] =item B<--components>=I<comp1>[,I<comp2>,...]
Comma or whitespace separated list of components like main, contrib and Comma or whitespace separated list of components like main, contrib and
@ -6273,13 +6277,19 @@ installed. At that point, the chroot directory does not contain any
executables and thus cannot be chroot-ed into. See section B<HOOKS> for more executables and thus cannot be chroot-ed into. See section B<HOOKS> for more
information. information.
Example: Setup merged-/usr via symlinks Example 1: Setup merged-/usr via symlinks, omitting the architecture specific
symlinks
--setup-hook='for d in bin sbin lib; do ln -s usr/$d "$1/$d"; --setup-hook='for d in bin sbin lib; do ln -s usr/$d "$1/$d";
mkdir -p "$1/usr/$d"; done' mkdir -p "$1/usr/$d"; done'
Example: Setup chroot for installing a sub-essential busybox-based chroot with Example 2: Setup merged-/usr using debootstrap-method which takes care of the
--variant=custom architecture specific symlinks
--setup-hook=/usr/share/mmdebstrap/hooks/merged-usr/setup00.sh
Example 3: Setup chroot for installing a sub-essential busybox-based chroot
with --variant=custom
--include=dpkg,busybox,libc-bin,base-files,base-passwd,debianutils --include=dpkg,busybox,libc-bin,base-files,base-passwd,debianutils
--setup-hook='mkdir -p "$1/bin"' --setup-hook='mkdir -p "$1/bin"'
@ -6371,6 +6381,11 @@ Example 2: Setup chroot for installing a sub-essential busybox-based chroot
--hook-dir=/usr/share/mmdebstrap/hooks/busybox --hook-dir=/usr/share/mmdebstrap/hooks/busybox
Example 3: Setup merged-/usr using debootstrap-method which takes care of the
architecture specific symlinks
--hook-dir=/usr/share/mmdebstrap/hooks/merged-usr
=item B<--skip>=I<stage>[,I<stage>,...] =item B<--skip>=I<stage>[,I<stage>,...]
B<mmdebstrap> tries hard to implement sensible defaults and will try to stop B<mmdebstrap> tries hard to implement sensible defaults and will try to stop