From 732fde54f817f7ef247a606b016499691d627501 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Sat, 28 Nov 2020 14:30:50 +0100 Subject: [PATCH] documentation improvements, add OPERATION section --- mmdebstrap | 149 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 143 insertions(+), 6 deletions(-) diff --git a/mmdebstrap b/mmdebstrap index c6574d1..ccda779 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -5677,8 +5677,12 @@ The I may be a valid release code name (eg, sid, stretch, jessie) or a symbolic name (eg, unstable, testing, stable, oldstable). Any suite name that works with apt on the given mirror will work. If no I was specified, then a single I C<-> is added and thus the information of the desired -suite has to come from standard input as part of a valid apt sources.list -file. +suite has to come from standard input as part of a valid apt sources.list file. +If mmdebstrap is instructed to retrieve packages from multiple releases, then +the value of the I argument will be used to determine which apt index to +use for finding out the set of C packages and/or the set of +packages with the right priority for the selected variant. See the section +B for more information. All status output is printed to standard error unless B<--logfile> is used to redirect it to a file or B<--quiet> or B<--silent> is used to suppress any @@ -5978,7 +5982,8 @@ Example: Run mmdebstrap with eatmydata B tries hard to implement sensible defaults and will try to stop you before shooting yourself in the foot. This option is for when you are sure you know what you are doing and allows one to skip certain actions and safety -checks. +checks. See section B for a list of possible arguments and their +context. =item B<-q,--quiet>, B<-s,--silent> @@ -6099,7 +6104,9 @@ B because maintainer-scripts will be run without B. All package sets also include the direct and indirect hard dependencies (but not recommends) of the selected package sets. The variants B, B and B<->, resemble the package sets that debootstrap would install -with the same I<--variant> argument. +with the same I<--variant> argument. If multiple releases are passed as apt +sources to B, then the release with a name matching the I +argument will be used to determine the C and priority values. =over 8 @@ -6248,8 +6255,8 @@ chroot. =item B I [I ...] I -Recursively copies one or more files and directories out of the chroot into, -placing them into I outside of the chroot. +Recursively copies one or more files and directories recursively from +I inside the chroot to I outside of the chroot. =item B I [I ...] I @@ -6304,6 +6311,136 @@ inside can have a different name from the file on the outside. =back +=head1 OPERATION + +This section gives an overview of the different steps to create a chroot. + +=over 8 + +=item B + +Upon startup, several checks are carried out, like: + +=over 4 + +=item * whether required utilities (apt, dpkg, tar) are installed + +=item * which mode to use and whether prerequisites are met + +=item * whether the requested architecture can be executed (requires arch-test) using qemu binfmt_misc support. This requires arch-test and can be disabled using B<--skip=check/qemu> + +=item * how the apt sources can be assembled from I, I and B<--components> and/or from standard input as deb822 or one-line format and whether the required GPG keys exist. + +=item * which output format to pick depending on the B<--format> argument or name of I or its type. + +=item * whether the output directory is empty. This check can be disabled using B<--skip=check/empty> + +=back + +=item B + +The following tasks are carried out: + +=over 4 + +=item * create required directories + +=item * write out the temporary apt config file + +=item * populates F and F with config options from B<--aptopt> and B<--dpkgopt>, respectively + +=item * write out F + +=item * copy over F and F + +=item * populate F if mknod is possible + +=back + +=item B + +Run B<--setup-hook> options and all F scripts in B<--hook-dir>. + +=item B + +Runs C using the temporary apt configuration file created in +the B step. + +=item B + +Checks whether F is empty. This can be disabled with +B<--skip=download/empty>. In the B and B variants, C is used to download all the packages requested via the +B<--include> option. The B variant uses the fact that libapt treats the +C packages as implicitly essential to download only all C +packages plus apt using C. In the +remaining variants, all Packages files downloaded by the B step are +inspected to find the C package set as well as all packages of +the required priority. + +=item B + +Extract the downloaded packages into the rootfs. This step is not carried out +in chrootless mode if the variant is not B. + +=item B + +Run B<--extract-hook> options and all F scripts in B<--hook-dir>. + +=item B + +In B mode, environment variables C will be set up +correctly. If the chroot requires the qemu-user-static binary it will be copied +in. For foreign B environments, C and +C are set up accordingly. This step is not carried out in +>B mode and neither for the B variant. + +=item B + +Uses C to properly install all packages that have been +extracted before. Removes all packages downloaded in the B step, +except those which were present in F before (if any). +This can be disabled using B<--skip=essential/unlink>. This step is not carried +out in B mode. + +=item B + +Run B<--essential-hook> options and all F scripts in B<--hook-dir>. +This step is not carried out in B mode. + +=item B + +Install the apt package into the chroot, if necessary and then run apt from +inside the chroot to install all remaining packages. This step is not carried +out in B mode. + +=item B + +Run B<--customize-hook> options and all F scripts in B<--hook-dir>. +This step is not carried out in B mode. + +=item B + +Performs cleanup tasks like: + +=over 4 + +=item * Removes the package lists and apt cache. This can be disabled using B<--skip=cleanup/apt>. + +=item * Remove all files that were put into the chroot for setup purposes, like F, the temporary apt config and the qemu-user-static binary. This can be disabled using B<--skip=cleanup/mmdebstrap>. + +=item * Remove all files that make the result unreproducible, like apt and dpkg logs and caches or F. This can be disabled using B<--skip=cleanup/reproducible> + +=item * Remove everything in F inside the chroot. This can be disabled using B<--skip=cleanup/tmp>. + +=back + +For formats other than B, pack up the temporary chroot directory +into a tarball, ext2 image or squashfs image and delete the temporary chroot +directory. + +=back + =head1 EXAMPLES Use like debootstrap: