Commit graph

850 commits

Author SHA1 Message Date
d52eaa4814
instead of checking for defined-ness and then comparing with the empty string, we can just use 'length' which returns undef if its argument is undef 2021-03-08 07:54:04 +01:00
270fd09b43
update copyright information 2021-03-08 07:52:14 +01:00
d5c8a85ace
document problems with chrootless mode in man page 2021-02-23 12:50:18 +01:00
ecbc10794c
warn if --dpkgopt is used in chrootless mode because of #808203 2021-02-23 12:49:46 +01:00
49f464e7da
create /etc/dpkg/dpkg.cfg.d/ if --dpkgopt is used 2021-02-23 12:49:26 +01:00
bbf12c221d
tarfilter: fixup last commit by formatting with black 2021-02-22 13:45:55 +01:00
Benjamin Drung
043ab3bbf0
tarfilter: Compile prefix pattern only once
According to Debian bug #978742, mmtarfilter has a slow performance with
many path exclusions. The execution can be speed up if the regular
expression is only compiled once instead of every time in the hot loop.

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2021-02-22 13:15:16 +01:00
5fd1ca62d9
coverage.sh: don't attempt deleting non-existant directory 2021-02-19 14:40:20 +01:00
067daaf4c2
also run unshare with --propagation unchanged in root mode 2021-02-19 12:53:14 +01:00
Josh Triplett
f8fc7d9bbf
Fix typo in hook directory example 2021-02-06 18:58:30 +01:00
976cc9c1c4
release 0.7.5 2021-02-06 14:46:37 +01:00
276363c2a1
coverage.sh: remove chroot directories 2021-02-06 14:46:37 +01:00
0009e62b3e
coverage.sh: do not run cap_sys_admin test under lxc 2021-02-06 14:46:37 +01:00
73cd7cd2e8
run unshare --mount with --propagation unchanged to prevent 'cannot change root filesystem propagation' when running mmdebstrap from inside a chroot 2021-02-06 10:11:53 +01:00
Trent W. Buck
f976dabb51
add examples/twb 2021-02-06 10:10:17 +01:00
39167dbc30
expose hook name to hooks via MMDEBSTRAP_HOOK environment variable 2021-02-06 09:18:05 +01:00
8a4f4d90ab
remove example showing mmdebstrap as debootstrap replacement for sbuild-createchroot as it doesn't work in unshare mode 2021-02-04 17:47:40 +01:00
e1e0df7799
skip emulation check for extract variant 2021-02-04 17:47:10 +01:00
c740b01dc8
unset TMPDIR in hooks because there is no value that works inside as well as outside the chroot 2021-02-04 17:46:39 +01:00
0595c5c220
add new suite name trixie 2021-02-04 17:43:33 +01:00
7a43ff89dc
improve dpkg and apt version parsing 2021-02-04 17:42:40 +01:00
aaa7c14275
hooks/setup00-merged-usr.sh: add rationale 2021-02-04 17:40:35 +01:00
4e658549f0
coverage.sh: clean up some additional files 2021-02-04 17:39:50 +01:00
d9633d05fe
release 0.7.4 2021-01-16 00:33:40 +01:00
7bd733fb8b
In root mode, check whether it's possible to mount
- even if the user is root, they might not have permission to mount
 - check for CAP_SYS_ADMIN and unshare --mount before proceeding
 - allow one to disable the check with --skip=check/canmount
 - this is useful in container environments like docker
2021-01-13 18:40:29 +01:00
205f5c2692
document how to use mmdebstrap to create a docker chroot 2021-01-13 18:08:04 +01:00
4693034138
allow unshare as root user
- this is useful when you are already root and want the benefits of
   unsharing the mount namespace to prevent messing up your system
 - if the unshare mode is used as root, the user namespace is not unshared
   anymore and newuidmap, setuid and friends are not called anymore
 - if the unshare mode is used as non-root test if the user namespace can be
   unshared, otherwise test if the mount namespace can be unshared
2021-01-13 16:15:59 +01:00
0f6741d01a
coverage.sh: allow to run on stable 2021-01-11 13:28:18 +01:00
ea6bbc1d9c
#898446 got closed and the default of kernel.unprivileged_userns_clone changed to 1 2021-01-09 19:44:39 +01:00
62bcf3261e
do not run an additional env command inside the chroot 2021-01-09 19:44:00 +01:00
7ff3f53fb9
apt 2.1.16 fixed immediate configure 2021-01-09 19:43:15 +01:00
ac21074243
set MMDEBSTRAP_APT_CONFIG, MMDEBSTRAP_MODE and MMDEBSTRAP_HOOKSOCK for hook scripts 2021-01-09 19:41:59 +01:00
Josh Triplett
5a7dbc10c7
Optimize mmtarfilter to handle many path exclusions
mmtarfilter uses fnmatch to handle path exclusions and inclusions.
Python's fnmatch handles shell patterns by translating them to regular
expressions, with a 256-entry LRU cache. With more than 256 path
exclusions or inclusions, this LRU cache no longer works, and every
invocation of fnmatch on every file in every package will re-translate
and re-compile a regular expression, resulting in much worse
performance.

Translate all the shell patterns to regular expressions once. For an
mmdebstrap invocation with around 500 path filters, this speeds up
mmdebstrap by more than a minute.
2021-01-06 14:58:10 +01:00
9484107392
set PATH if it's unset or empty 2021-01-06 11:49:29 +01:00
8c42daad92
README.md: update benchmark numbers with new debootstrap 2021-01-06 11:49:14 +01:00
2d03a81997
coverage.sh: reenabling tests because bugs got fixed
- systemd didn't get fixed but somehow the order matches again (bug #963788)
 - python is installable again (bug #968217)
 - apt immediate configure was not fixed but src:glibc changed to not
   trigger the bug anymore (bugs #973305, #973325 and #972552)
2021-01-06 11:33:37 +01:00
0dc8321094
coverage.sh: the output of getcap differs depending on the version 2021-01-06 11:19:15 +01:00
e9e5f15f61
coverage.sh: remove tarball earlier to free some space 2021-01-06 11:18:46 +01:00
0b2a0c5a55
release 0.7.3 2020-12-02 06:15:54 +01:00
43ca8a5211
it is wrong to match the suite for the package set selection if more than one apt index is given (because the suite name might be equal) instead check whether there is more than zero matching and more than zero not-matching suites 2020-12-02 00:47:16 +01:00
2ccd025a25
coverage.sh: don't execute test modifying /etc/hosts without qemu 2020-12-02 00:44:57 +01:00
7c15185dfd
work around debootstrap merge_request/48 by setting link_dir 2020-12-02 00:43:45 +01:00
2c232e0661
don't ignore packages added via --include if multiple apt indices are used 2020-12-02 00:33:18 +01:00
3a2b3c142a
coverage.sh: remove stray 'exit 0' 2020-12-01 16:10:21 +01:00
9e56353661
coverage.sh: assemble ELF header according to bits and endian 2020-11-29 22:24:01 +01:00
077d8cdd9a
coverage.sh,make_mirror.sh: add i386 support 2020-11-29 21:39:08 +01:00
85328c5c7e
mmdebstrap: check for defined-ness before integer comparison 2020-11-29 20:54:50 +01:00
165cc82f97
preserve permissions of /etc/resolv.conf and /etc/hostname and resolve symlinks as debootstrap does it 2020-11-29 20:54:31 +01:00
a7c557644e
coverage.sh: check for unshare and proot 2020-11-29 15:13:59 +01:00
cf695c4a21
coverage.sh: fix total number ant print_header position 2020-11-29 11:41:36 +01:00