On macOS, Docker Desktop mounts all paths as private (rprivate) in its
Linux VM via VirtioFS, so rslave/rshared bind propagation is rejected.
Strip these propagation options from the generated docker create command
when running on Darwin.
Also fix a bug in distrobox-init where the socket path prefix stripping
used `sed 's|/run/host||g'` with the global flag, causing paths like
`/run/host/run/host-services/ssh-auth.sock` (a Docker Desktop socket)
to be mangled into `-services/ssh-auth.sock`. The leading `-` was then
parsed as a flag by `rm`, crashing the init script. Replace with shell
parameter expansion `${host_socket#/run/host}` which strips the prefix
exactly once.
distrobox-init detects "rootful" mode by checking if /run/host/etc/shadow
is accessible and owned by root. On macOS with Docker Desktop, all containers
run as root inside the Linux VM, so this check always succeeds even for
containers created without --root, causing a spurious first-shell password
prompt.
Fix this by having distrobox-create mount /dev/null:/run/.distrobox.rootless:ro
for every rootless container. distrobox-init now checks for this marker first
and skips the shadow heuristic when it is present.
This is backward-compatible: existing containers without the marker continue
to use the shadow-file heuristic as before.
Signed-off-by: Eric Curtin <eric.curtin@docker.com>
Intel has discontinued the distribution, so we remove it from the
compatibility list, and the `swupd` package manager support
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
* init: properly support Chimera Linux guests
https://chimera-linux.org
* init: add some basic doas(1) support
This is an alternative to sudo(1) originating from OpenBSD and also
ported to Linux; base configuration on Chimera Linux where this will be
used.
* init: also support FreeBSD-style stat(1) syntax for rootful check
These system utils are largely used on Chimera Linux (as chimerautils):
+ stat -c %u /run/host/etc/shadow
stat: unrecognized option: c
usage: stat [-FLnq] [-f format | -l | -r | -s | -x] [-t timefmt] [file|handle ...]
* docs: Chimera Linux compatability tested as host and guest
* init: massively speed up apt-get deps install
Similar to the previous apk optimization instead of checking each
package one by one instead grab the matching ones from "apt list" and
pass them directly over to "apt-get install".
This happens to start installing libvte-2.90-common on ubuntu:14.04
where libvte-2.9*-common doesn't match anything when given to apt*
commands directly.
On my end non-toolbox Ubuntu 22.04 and 14.04 images saw a setup time
reduction from ~68 and 80 seconds respectively to just ~44 seconds each!
* init: massively speed up pacman deps install
Also drop both the duplicate vte-common & redundant opengl-driver (mesa
is always picked as default provider) package entries, (once again)
avoid re-installing already up-to-date packages; on my end the setup
time for the non-toolbox arch image was reduced from ~19 seconds to ~13
seconds.
* init: massively speed up xbps deps install
On my end the setup time was reduced from ~25 seconds to ~19 seconds.
* fix(init): resolve issues with older apt versions
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
* docs: fix compatibility issue with debian buster backports
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
---------
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Co-authored-by: Luca Di Maio <luca.dimaio1@gmail.com>