Commit Graph

591 Commits (main)

Author SHA1 Message Date
Johannes Schauer Marin Rodrigues 9ebb3d07ac
unify /proc mounting between root and unshare mode and fall back to rbind-mounting
This makes unshare mode work on salsaci and debci.
1 year ago
Johannes Schauer Marin Rodrigues b990a3aa09
run apt with -oDebug:: options for all calls and not only in run_download() 1 year ago
Johannes Schauer Marin Rodrigues a0133a6393
document maybe-merged-usr hook 1 year ago
Johannes Schauer Marin Rodrigues 7910ca79ac
redirect apt-helper drop-privs output to /dev/null as we are only interested in the exit status and want to avoid spurious error messages from apt 1 year ago
Johannes Schauer Marin Rodrigues f737cce3f1
Support creating a fakechroot with merged-/usr on an unmerged-/usr system
Thanks: Helmut Grohne for finding this issue and help interating this
1 year ago
Johannes Schauer Marin Rodrigues d554c0b469
de-duplicate FAKECHROOT_CMD_SUBST variable 1 year ago
Johannes Schauer Marin Rodrigues 9cc494f245
release 1.3.1 1 year ago
Johannes Schauer Marin Rodrigues 5ea299f3d2
document the apt variant better 1 year ago
Johannes Schauer Marin Rodrigues 736cb493ea
release 1.3.0 1 year ago
Johannes Schauer Marin Rodrigues c738e96752
allow empty sources.list entries 1 year ago
Johannes Schauer Marin Rodrigues 860a9048d5
make info message lowercase like the rest 1 year ago
Johannes Schauer Marin Rodrigues 327b75846f
add --skip=check/signed-by 1 year ago
Johannes Schauer Marin Rodrigues ec58228f71
add more docs that non-empty SUITE will be used to select Essential:yes set 1 year ago
Johannes Schauer Marin Rodrigues f27ed490d6
Do not split --include values again in run_download and run_install
Closes: #1028977
1 year ago
Johannes Schauer Marin Rodrigues 36f691f22b
document that positional arguments can be mixed with non-positional ones and that a double-dash has the expected effect 1 year ago
Johannes Schauer Marin Rodrigues b0a5c30fb1
to find signed-by value, run gpg on the individual keys to print better error messages in case it fails (gpg doesn't give an indication which file it was unable to read) and print progress bar 1 year ago
Johannes Schauer Marin Rodrigues ea2b57870b
warn if a hook is named like one but not executable and if a hook is executable but not named like one 1 year ago
Johannes Schauer Marin Rodrigues 0b7188ce32
be more verbose when 'apt-get update' failed 1 year ago
Johannes Schauer Marin Rodrigues 9945e65701
skip running apt-get update if we are very sure that it was already run 1 year ago
Johannes Schauer Marin Rodrigues 5fd96553f5
release 1.2.5 1 year ago
Johannes Schauer Marin Rodrigues b67d30cb86
mmdebstrap: bump copyright year 1 year ago
Johannes Schauer Marin Rodrigues d4eb268795
warn if hook directory contains no executable scripts 1 year ago
Johannes Schauer Marin Rodrigues 4595d3df44
release 1.2.4 1 year ago
Johannes Schauer Marin Rodrigues 2b832e0128
add jessie-or-older extract hook 1 year ago
Johannes Schauer Marin Rodrigues a7b7e16033
move extract hook execution after run_prepare so that fakechroot works in it 1 year ago
Johannes Schauer Marin Rodrigues eb98dfbaee
apt also needs /var/lib to exist 1 year ago
Johannes Schauer Marin Rodrigues 6c5210a94f
error out early if setup fails and thus the ext2 block reader returns EOF 1 year ago
Johannes Schauer Marin Rodrigues a6a31e60eb
make sure that the unshared user has read access to the included package files 1 year ago
Johannes Schauer Marin Rodrigues 0dfd9adf2b
make sure absolute package paths start with a slash and are readable files 1 year ago
Johannes Schauer Marin Rodrigues 2fd3d768e8
avoid division by zero in progress computation 1 year ago
Johannes Schauer Marin Rodrigues 830270840b
make sure genext2fs and genext2fs exist for the respective formats 1 year ago
Jochen Sprickerhof 374ae3dc99
use $username for subgid check
/etc/subgid contains a mapping of user names (not group names) to group
ids as defined in man subgid.
1 year ago
Johannes Schauer Marin Rodrigues 7a057e37dd
release 1.2.3 1 year ago
Johannes Schauer Marin Rodrigues 889c02419e
update for perltidy 20220613 1 year ago
Johannes Schauer Marin Rodrigues 420080648e
Revert "add another --dpkgopt example"
This reverts commit 40b6155967.

dpkg does not support the {foo,bar,baz} type of glob

Closes: #28
1 year ago
Johannes Schauer Marin Rodrigues ea146ad108
add undocumented --chrooted-*-hook calling pivot_root in unshare mode 1 year ago
Johannes Schauer Marin Rodrigues 449fb248e2
Instead of mounting and unmounting for each run_chroot() call, do it once before the extract hook and unmount after the customize hooks 1 year ago
Johannes Schauer Marin Rodrigues eb54f6a23a
Instead of re-execing mmdebstrap under /bin/sh, use Text::ParseWords::shellwords
- saves a few PIDs
 - saves a bit of time because useless exec and fork is avoided
 - allows to run in pivoted chroots without mmdebstrap
1 year ago
Johannes Schauer Marin Rodrigues bf33a614c3
add mini-mmdebstrap in shell to the man page 1 year ago
Johannes Schauer Marin Rodrigues d9ca7c21ff
make failure to remove /dev/ptmx a warning and not an error 2 years ago
Johannes Schauer Marin Rodrigues b454892ddd
release 1.2.2 2 years ago
Johannes Schauer Marin Rodrigues e887a329ab
more changes for merged-/usr which is now default in testing and unstable 2 years ago
Johannes Schauer Marin Rodrigues 4048293be5
only print progress bars on interactive terminals that are wide enough 2 years ago
Johannes Schauer Marin Rodrigues d4cb065639
Write an empty /etc/machine-id instead of writing 'uninitialized'.
Writing "uninitialized" instructs systemd to run units with
ConditionFirstBoot=yes which should only be done by tools that know how
to correctly set up such units.

Debian-Bug: #1021478
2 years ago
Jochen Sprickerhof adf62afcea
guestfish: move set-label after mkfs
Fixes:

libguestfs: error: set_label: don't know how to set the label for '' filesystems
2 years ago
Johannes Schauer Marin Rodrigues 3999212c48
always create /var/lib/dpkg/arch to make foreign architecture chrootless tarballs bit-by-bit identical 2 years ago
Johannes Schauer Marin Rodrigues 6c68ab2e5e
also provide the info() function to debootstrap 2 years ago
Johannes Schauer Marin Rodrigues 2f27eccad4
allow /etc/apt/trusted.gpg.d/ not to exist 2 years ago
Johannes Schauer Marin Rodrigues 045b56bb4e
release 1.2.1 2 years ago
Johannes Schauer Marin Rodrigues 7123808b6c
do not clean up /run/lock as /var/lock is a symlink to it according to Debian policy §9.1.4 2 years ago
Johannes Schauer Marin Rodrigues 410c5fcb24
fix --include option for files and add test case 2 years ago
Johannes Schauer Marin Rodrigues 9682e74385
release 1.2.0 2 years ago
Johannes Schauer Marin Rodrigues b0caeeef54
bump dates to 2022 2 years ago
Johannes Schauer Marin Rodrigues d209fb0c11
reformat with perltidy 2 years ago
Johannes Schauer Marin Rodrigues f4a3865c00
Remove support for proot.
The proot mode was broken from the start because in contrast to
fakechroot, no ownership information can be retained across multiple
invocations of proot. Since mmdebstrap started using apt from the
outside by setting DPkg::Chroot-Directory in mmdebstrap 0.8.0 proot mode
was finally completely broken because proot cannot wrap the chroot call
done by apt. Users of proot are recommended to run mmdebstrap in
fakechroot mode and then use proot with the resulting directory.
2 years ago
Johannes Schauer Marin Rodrigues 7e8931578b
Store --include option values in MMDEBSTRAP_INCLUDE for hooks 2 years ago
Johannes Schauer Marin Rodrigues e1f0b0fa40
ensure operator precedence using more parenthesis 2 years ago
Johannes Schauer Marin Rodrigues e875bca7fb
support apt patterns and paths with commas and whitespace for the --include option 2 years ago
Johannes Schauer Marin Rodrigues 0af22912f7
also delete everything in /run and add --skip=cleanup/run 2 years ago
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