Commit Graph

482 Commits (add9412a476697a7609555923d166e93d9795e6e)

Author SHA1 Message Date
Johannes Schauer Marin Rodrigues add9412a47
add --skip=chroot/mount and --skip=chroot/mount/dev, --skip=chroot/mount/proc, --skip=chroot/mount/sys 2 years ago
Johannes Schauer Marin Rodrigues e61e352f67
add --skip=chroot/start-stop-daemon and --skip=chroot/policy-rc.d 2 years ago
Johannes Schauer Marin Rodrigues 18c1e9bbc5
multiple skip options can be passed by separating them by comma or whitespace 2 years ago
Gioele Barabucci 7ce6db0ca7
mmdebstrap: Show APT's dependency trace when in debug mode
A dependency trace is a powerful tool to debug issues related to
APT's selection of packages, especially in custom mode.

Thus it makes sense to ask APT to output a dependency trace when
`mmdebstrap` is run with the `--debug` flag.
2 years ago
Johannes Schauer Marin Rodrigues 226f86fea9
fix mmdebstrap hanging if apt in download step failed (closes: #1017795) 2 years ago
Johannes Schauer Marin Rodrigues 34a9de929d
use standard character classes instead of bracketed character classes 2 years ago
Johannes Schauer Marin Rodrigues b385eb548a
only check first argument if we have one 2 years ago
Johannes Schauer Marin Rodrigues d82afec5de
error out if stdout is a tty 2 years ago
Johannes Schauer Marin Rodrigues 3fcb125e3c
release 1.1.0 2 years ago
Johannes Schauer Marin Rodrigues 35dc676394
relax apt version regex to allow devuan apt versions like 2.5.0devuan1 2 years ago
Johannes Schauer Marin Rodrigues 0ae0adde26
document mmdebstrap hanging forever instead of ENOSPC in qemu as a comment 2 years ago
Johannes Schauer Marin Rodrigues 5e22e0bfc8
adjust message about file-mirror-automount hook 2 years ago
Johannes Schauer Marin Rodrigues d91a18a350
Adjust merged-/usr as it's done by debootstrap
- implements the same as debootstrap in
   https://salsa.debian.org/installer-team/debootstrap/-/merge_requests/71
 - builds a temporary usr-is-merged package and upgrades to the real one
 - create merged-/usr chroots for unstable and testing (which will
   become Debian 12 Bookworm)
 - add a dedicated merged-/usr section to the manual page
2 years ago
Johannes Schauer Marin Rodrigues 009089ee8a
Mount a new instance of /dev/pts in the chroot
Before, we bind-mounted /dev/ptmx and /dev/pts from the host into the
chroot. This will make posix_openpt() fail with 'No such file or
directory'.  The ability to create pseudo terminals is important for apt
(which will throw a warning otherwise) or running script(1) or source
package testsuites like for src:util-linux. This functionality is
restored by mounting a new devpts instance to /dev/pts and making
/dev/ptmx a symlink to /dev/pts/ptmx. Mounting with ptmxmode=666 is
required such that also non-root users in unshare mode are able to
create pseudo terminals. See also:

https://www.kernel.org/doc/Documentation/filesystems/devpts.txt
https://salsa.debian.org/debian/schroot/-/merge_requests/2
https://bugs.debian.org/856877
https://bugs.debian.org/817236
2 years ago
Johannes Schauer Marin Rodrigues c37e5e6059
tests/custom-tmpdir: try running mmdebstrap in a TMPDIR with special shell characters in its path 2 years ago
Johannes Schauer Marin Rodrigues b46149b851
release 1.0.1 2 years ago
Johannes Schauer Marin Rodrigues e4ef326b59
Only set up FAKECHROOT_CMD_SUBST for paths in PATH containing the original binary
If FAKECHROOT_CMD_SUBST sets up wrong substitutions, then binaries
cannot be found. For example if /usr/bin/chroot is listed in
FAKECHROOT_CMD_SUBST but /usr/sbin (the actual location of the chroot
binary) is not in PATH, the command fails
2 years ago
Johannes Schauer Marin Rodrigues 158956e213
release 1.0.0 2 years ago
Johannes Schauer Marin Rodrigues e71676e15c
use warning() instead of warn() when unmounting /sys and /proc fails 2 years ago
Johannes Schauer Marin Rodrigues cffd47e087
drop /usr/sbin prefixes from executables 2 years ago
Johannes Schauer Marin Rodrigues c6c9c27969
use DPkg::Path as default value for PATH 2 years ago
Johannes Schauer Marin Rodrigues 27926c75f9
unify checking if tools exist by running them with --version 2 years ago
Johannes Schauer Marin Rodrigues 0f9c6543c4
improve qemu-user
- rephrase info message to be less misleading
 - do not require qemu-$arch-static binary
 - check if /proc/sys/fs/binfmt_misc/qemu-$arch exists before reading it
2 years ago
Johannes Schauer Marin Rodrigues b99f1d53d5
add file-mirror-automount hook-dir 2 years ago
David Kalnischkies cc3150ef04
Rework download stage to allow file:// mirrors
- factor out package downloading function
 - replace -oApt::Get::Download-Only=true by -oDebug::pkgDpkgPm=1
 - remove guessing of package names in /var/cache/apt/archives/
 - drop edsp parsing with proxysolver/mmdebstrap-dump-solution to obtain
   downloaded filenames in favour of -oDpkg::Pre-Install-Pkgs::=cat
 - /var/cache/apt/archives/ is now allowed to contain packages
 - drop --skip=download/empty
 - file:// mirrors are now supported if their path is available inside
   the chroot
2 years ago
Johannes Schauer Marin Rodrigues dc8b09ed50
fix pod formatting typo 2 years ago
Johannes Schauer Marin Rodrigues 21b23ebb9f
set MMDEBSTRAP_VERBOSITY in hooks 2 years ago
Johannes Schauer Marin Rodrigues 0664792cd5
manually push option arguments to array instead of using s@
By mixing s@ for --$foo-hook options and manual pushing in --hook-dir,
it can happen that options get lost. Consider the following test:

use Getopt::Long;
my $arr = [];
GetOptions(
    'A=s@' => \$arr,
    'B=s' => sub { push @{$arr}, $_[1]; }
);
foreach my $hook (@{$arr}) { print "hook: $hook\n"; }

This works fine:

    perl test.pl --A=a1 --B=b1 --A=a2 --B=b2
    hook: a1
    hook: b1
    hook: a2
    hook: b2

This misses b1:

    perl test.pl --B=b1 --A=a2 --B=b2
    hook: a2
    hook: b2
2 years ago
Johannes Schauer Marin Rodrigues 26af846d0a
fix that cached debs were not returned if there was nothing to download 2 years ago
Johannes Schauer Marin Rodrigues 5c5f7de898
more documentation for TMPDIR 2 years ago
Johannes Schauer Marin Rodrigues 29b23bbcbc
document how to build on top of an existing tarball 2 years ago
Johannes Schauer Marin Rodrigues d10f320f5d
document how to build an sbuild unshare chroot mode tarball 2 years ago
Johannes Schauer Marin Rodrigues ce23e702e2
fixup comparison with debootstrap 2 years ago
Johannes Schauer Marin Rodrigues 09f1dd2ee6
Improve documentation of reproducibility of /etc/resolv.conf and /etc/hostname
Closes: #26
2 years ago
Johannes Schauer Marin Rodrigues 57e0ecb20f
release 0.8.6 2 years ago
Johannes Schauer Marin Rodrigues 70b081d299
allow running root mode inside unshare mode 2 years ago
Johannes Schauer Marin Rodrigues 64ba5f8229
release 0.8.5 2 years ago
Johannes Schauer Marin Rodrigues 409ce1cfee
improve man page further 2 years ago
Johannes Schauer Marin Rodrigues 7044baf6b1
run busybox from an absolute path to allow running it even when /proc is not mounted as busybox uses /proc/self/exe to figure out its own path 2 years ago
Johannes Schauer Marin Rodrigues 489e51a2eb
Run File::Find::find with no_chdir=>1
Without no_chdir=>1 the unshared child process in unshare mode needs
read permissions for the directory from which mmdebstrap is executed.
With this change, the current working directory does not need to be
world-readable anymore.

Closes: #1005857
Reported-by: Trent W. Buck <trentbuck@gmail.com>
2 years ago
Gioele Barabucci 5fa2457fd5 mmdebstrap: Add mbr.bin installation to autopkgtest-build-qemu instructions
The generated image will not be bootable if `mbr.bin` is not installed
into the MBR.

These lines are copied from the "Debian desktop on USB stick" example.
2 years ago
Gioele Barabucci 8e6f183b3f mmdebstrap: Install mbr.bin in /boot and keep after installation 2 years ago
Gioele Barabucci 97e6981ddc mmdebstrap: Read extlinux's MBR from /usr/lib/EXTLINUX
`/usr/lib/SYSLINUX` is not available if only `extlinux` is installed.
2 years ago
Gioele Barabucci 22c0ba45a0 mmdebstrap: Use ext4 instead of ext2 in examples 2 years ago
Gioele Barabucci 829df60242 mmdebstrap: Align autopkgtest-build-qemu and USB stick examples
Write the same `guestfish` instructions in the same way in both the
`autopkgtest-build-qemu` and the "Debian desktopn on a USB stick" example.
2 years ago
Johannes Schauer Marin Rodrigues 070a9cecb7
release 0.8.4 2 years ago
Johannes Schauer Marin Rodrigues 38a81e75bb
remove information about kernel.unprivileged_userns_clone from the man page 2 years ago
Johannes Schauer Marin Rodrigues ce8a9f8764
also remove /var/lib/dbus/machine-id 2 years ago
Johannes Schauer Marin Rodrigues e865ce850f
document another advantage of running apt outside the chroot 2 years ago
Johannes Schauer Marin Rodrigues 2b60a932a9
don't install essential packages in run_install() 2 years ago