Debian still having trouble with merged /usr
Debian still having trouble with merged /usr
Posted Apr 6, 2022 2:06 UTC (Wed) by josh (subscriber, #17465)In reply to: Debian still having trouble with merged /usr by KJ7RRV
Parent article: Debian still having trouble with merged /usr
First, technical challenges: HURD tried to move from /usr to / and had quite a bit more trouble with it, and that trouble warned against trying it on a larger scale. It's much easier to move from / to /usr than from /usr to / ; fewer things break.
Second, consolidation: moving *into* /usr gives us a single directory containing all files managed by the distro / package manager. This has quite a few advantages. It makes sharing /usr among several chroots or containers feasible (one /usr, different /etc and /var). It makes versioning and A/B upgrades (upgrade to new image, fall back to old image if new image doesn't boot) simpler and easier. It makes it easy to lock down /usr with something like fs-verity.
Posted Apr 6, 2022 15:33 UTC (Wed)
by juliank (guest, #45896)
[Link] (1 responses)
Posted Apr 6, 2022 16:00 UTC (Wed)
by bluca (subscriber, #118303)
[Link]
Posted Apr 7, 2022 5:51 UTC (Thu)
by smurf (subscriber, #17840)
[Link] (14 responses)
The easiest remedy for this is to move /var/lib/dpkg to /usr/state/ (or wherever), and bind-mount /var/lib/dpkg to that. No, a symlink isn't sufficient.
Posted Apr 7, 2022 6:10 UTC (Thu)
by josh (subscriber, #17465)
[Link] (13 responses)
Posted Apr 7, 2022 8:14 UTC (Thu)
by bluca (subscriber, #118303)
[Link] (12 responses)
Posted Apr 8, 2022 4:25 UTC (Fri)
by pabs (subscriber, #43278)
[Link] (11 responses)
Posted Apr 8, 2022 11:09 UTC (Fri)
by smurf (subscriber, #17840)
[Link] (10 responses)
Specifically you want a 3-way merge between the old /etc, the new one as updated by dpkg, and your current /etc contents. Surprise, there's etckeeper and git, so this is a solved problem.
Solution: teach dpkg to redirect any files in /etc to /usr/state/etc instead, use etckeeper to check those into git, pull that from your system's /etc, ask the user to fix any merge conflicts, done. Maybe do the manual merge in a scratch /run/etc directory so the system isn't in a broken state while you do this. Ditto for updating config file formats to newer versions, and other shenanigans some packages get into.
The chances of this actually happening while dpkg's current maintainer guards their fiefdom are somewhat less than zero, however. Otherwise I'd've started implementing this scheme years ago.
Posted Apr 8, 2022 11:36 UTC (Fri)
by farnz (subscriber, #17727)
[Link] (9 responses)
Ultimately, the deep bug is outside dpkg - programs should read and merge multiple config locations, so that you can have /usr/etc containing the packaged config, and /etc containing the user config.
Posted Apr 9, 2022 1:39 UTC (Sat)
by josh (subscriber, #17465)
[Link] (8 responses)
Posted Apr 9, 2022 2:22 UTC (Sat)
by pabs (subscriber, #43278)
[Link] (7 responses)
Posted Apr 9, 2022 9:37 UTC (Sat)
by bluca (subscriber, #118303)
[Link]
Posted Apr 9, 2022 9:39 UTC (Sat)
by Cyberax (✭ supporter ✭, #52523)
[Link]
Posted Apr 9, 2022 9:51 UTC (Sat)
by smurf (subscriber, #17840)
[Link] (4 responses)
OpenWRT tries to do something along these lines. Rather than hack the individual services they invented their own data structure (still text based, but a common format – though personally I'd use YAML instead of their scheme) and then generate the service-specific config files from that. Requires a generator script for each service supported that way, of course.
Posted Apr 12, 2022 0:03 UTC (Tue)
by pabs (subscriber, #43278)
[Link]
OTOH, the OpenWRT approach is *great* in the situation where there is a reasonably complete web app for the config in the Luci web interface. A discoverable graphical interface is often way easier to use than config file formats with a wide range of options, some of which might not be well documented.
Posted Apr 12, 2022 10:05 UTC (Tue)
by Cyberax (✭ supporter ✭, #52523)
[Link] (2 responses)
Posted Apr 12, 2022 11:04 UTC (Tue)
by rahulsundaram (subscriber, #21946)
[Link] (1 responses)
Posted Apr 12, 2022 19:56 UTC (Tue)
by Cyberax (✭ supporter ✭, #52523)
[Link]
Debian still having trouble with merged /usr
Debian still having trouble with merged /usr
Debian still having trouble with merged /usr
Debian still having trouble with merged /usr
Debian still having trouble with merged /usr
Debian still having trouble with merged /usr
Debian still having trouble with merged /usr
Debian still having trouble with merged /usr
Debian still having trouble with merged /usr
Debian still having trouble with merged /usr
Debian still having trouble with merged /usr
Debian still having trouble with merged /usr
Debian still having trouble with merged /usr
Debian still having trouble with merged /usr
Debian still having trouble with merged /usr
Debian still having trouble with merged /usr
Debian still having trouble with merged /usr
