Re: move to merged-usr-only?
On Fri, 2020-11-20 at 10:19 +0100, Adam Borowski wrote:
> On Fri, Nov 20, 2020 at 09:35:42AM +0100, Ansgar wrote:
> > I would like to propose to plan to move to support merged-usr-only over
> > the following releases. The motivation is bugs like [1] where upstream
> > developers just use `/usr/bin/rm` (or other binaries, or user scripts
> > using /usr/bin/bash, or ...) unconditionally; this was already a
> > motivation to adopt merged-/usr as a default for me.
> >
> > As far as I know nothing broke catastrophically over the last releases
> > with merged-/usr.
>
> Unless you look at dpkg or attempts at speeding up bootstrap.
>
> See https://salsa.debian.org/glibc-team/glibc/-/commit/49d137c4392cb1144f2313f78f31466aaa169b75
> for an example.
>
> As far as I know, dpkg maintainers consider usrmerge to be unsupported,
> and trying to make my own NIH deb installer I see why.
The good news here is that shipping bash as /usr/bin/bash (instead of
/bin/bash) solves that problems as dpkg will just install it under
/usr/bin/bash. No aliasing over symlinks involved.
You also don't need any special handling for anything in /bin, /sbin as
nothing would be installed there (all packages ship the files in /usr).
> > So a possible idea would be to:
> >
> > - For Debian 12 (bookworm): make it mandatory to migrate old systems to
> > merged-/usr on upgrade. Possibly by allowing the existing usrmerge
> > program to run from the initramfs.
>
> Counterproposal: replace debootstrap with mmdebstrap, which is many times
> faster -- and doesn't support usrmerge at all, or at least disable usrmerge
> in debootstrap in default.
That is unrelated. Also you don't need special usrmerge support once
all packages ship files under /usr.
If you care about speed: not calling sync() way too often would
probably make dpkg significantly faster and possibly reduce the total
time the system is in an incinsistent state (of half-updated packages),
reducing the chance of system crashes breaking stuff ;-)
If you see the aliasing problem as a large issue, we could also try to
ship files in /usr already for bookworm.
> > - For Debian 13 (trixie): packages should no longer install to /bin,
> > /sbin, /lib, but to the respective locations under /usr.
>
> Moving stuff with no mandated path is a good idea, yes. Alas, it's been
> massively complicated by usrmerge being a thing, and thus you can't just
> ship the file in a new location as you risk a path conflict.
You can just ship /usr/bin/bash instead of /bin/bash in an updated
package.
> So let's make it so a canonical path to a file never includes a directory
> symlink; if you insist on /usr/bin/rm then /bin/rm should be
> /bin/{rm->/usr/bin/rm} not /{bin->usr/bin}/rm
Why ship /bin/rm at all? Seems too complicated and just ends in the
half-migrated state that SuSE was in last I checked.
> > [1]: https://bugs.debian.org/973853
>
> That's a piece of software for which upstream is Red Hat. The number of
> people developing on RPM distros is rapidly falling, so this is less and
> less of an issue.
Well, other distributions like Debian, Ubuntu, ... also use merged-/usr
these days.
Ansgar
Reply to: