Hi Alexandre, * Alexandre Detiste <alexandre.deti...@gmail.com> [2024-06-03 10:04]:
The scripts in explain/ ought to be run inside the chroot.The systemd script for example was already adapted to work without a running init. This could be done with chroot() and a bind mount of /usr/libexec/cruft or alternatively modifying every script to support DPKG_ROOT. I think option 1 will require root while option 2 will work in the non-root mode too. I slightly prerer option 2 which allows more case-by-case handling.
Good point. You could actually use unshare to make it work without root but I would also prefer option 2. What do you think of a slow adoption as in explain.cc set's the DPKG_ROOT variable and all explain scripts get a test -z $DPKG_ROOT || exit 0 at the top. Then we can fix them individually as far as it makes sense.
I also had a quick look into them, for those just running find and echo it should be ease to adopt. For those running dpkg-query or update-alternatives and alike there is a --root option we could use. There are also some the only make sense on a running system like WSL2 where I would just keep the exit 0 at the top.
You can fork this on Salsa which is now the main repository.
Right, do you prefer a merge request there? Cheers Jochen
signature.asc
Description: PGP signature