Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Development (http://www.linux-archive.org/archlinux-development/)
-   -   merge /bin, /sbin, /lib into /usr/bin and /usr/lib (http://www.linux-archive.org/archlinux-development/640113-merge-bin-sbin-lib-into-usr-bin-usr-lib.html)

Tom Gundersen 03-03-2012 12:53 AM

merge /bin, /sbin, /lib into /usr/bin and /usr/lib
 
Hi guys,


Some of us have been discussing the feasibility of merging /bin, /sbin
and /lib with their /usr counterparts. It seems that this is doable
and a few of us have been testing it locally. However, before doing
any more work on this I thought it would make sense to make an
official proposal to find out if this is something people would be
happy with, at least in principle. If so, we could get back to a more
concrete proposal once the details have been worked out.

I assume that most people are familiar with the general idea and why
we would want to do this, but just in case I'll outline my point of
view:

* Traditionally we have kept all our binaries and libraries in /usr.
The exception were the things needed during early boot before /usr was
mounted (assuming it was on a separate partition, if not there was
never any need for this at all).

* We now mount /usr from the initramfs, so there is no longer any
need to keep any binaries or libraries on the rootfs.

* Having four different locations for binaries ({/usr,}/{s,}bin}) and
two locations for libraries ({/usr,}/lib) is less KISS than having one
location for binaries /usr/bin and one for libraries /usr/lib.

* By symlinking the old directories to /usr/{bin,lib} we keep
backwards compatibility, and also improve our compatibility with
distros that chose to put their binaries in different locations.

* Several of the packages that have traditionally been outside of
/usr, are being maintained by people who develop on systems where
there is no longer a split. In the long term this means that more
maintenance will be shifted towards us as we have to check and fix any
assumptions that these devs might have made that don't apply to us
(unless we also do the merge).

* Two common objections: 1) why not move everything to /: that would
mean littering the rootfs with lots of new dirs, for no gain. Having
all of the static package files in one dir (/usr) seems much cleaner
to me. 2) we should distinguish between bin and sbin: whenever people
add features to a "superuser only tool" so that it becomes useful to a
regular user, it means it should be moved from sbin to bin. However,
in practice this does not happen due to the paths being hardcoded.
Instead we just put both sbin and bin in everyone's PATH and the
distinction is essentially meaningless.

Implementation:

/lib:

For the libraries this can be done package-by-package, some have
already been done. There are also other things in /lib, I propose that
we temporarily patch udev, kmod and the few other packages to support
both /usr/lib and /lib (similarly to how systemd already works) so
things like udev rules and modprobe files can be moved over one
package at a time. Once all of this has moved, the last package to be
updated would be glibc that would move the linker and symlink /lib to
/usr/lib to maintain compat. We could then remove any transition
patches from udev++. For e this is sort of a no-brainer, with no real
risks or downsides.

/bin, /sbin:

This is a bit more tricky, and would essentially require a rebuild of
the ~90 relevant packages to move their contents to /usr/bin and move
these packages together with a new filesystem package that symlinks
/sbin and /bin to /usr/bin. I'm just giving a rough overview here, I
don't think there is any need for getting bogged down in details until
we have made our decision.

/usr/sbin:

I think there is no point in keeping this directory, and it should
eventually also be merged with /usr/bin. However, there is no need to
do this at the same time, so let's get back to this once we have some
experience from the above moves.



TL;DR: If you don't package stuff needed by early boot, this should
not matter to you one bit (fingers crossed).



Thougts?

Tom

Dan McGee 03-03-2012 01:28 AM

merge /bin, /sbin, /lib into /usr/bin and /usr/lib
 
On Fri, Mar 2, 2012 at 7:53 PM, Tom Gundersen <teg@jklm.no> wrote:
> /lib:
>
> There are also other things in /lib, I propose that
> we temporarily patch udev, kmod and the few other packages to support
> both /usr/lib and /lib (similarly to how systemd already works) so
> things like udev rules and modprobe files can be moved over one
> package at a time. Once all of this has moved, the last package to be
> updated would be glibc that would move the linker and symlink /lib to
> /usr/lib to maintain compat. We could then remove any transition
> patches from udev++. For e this is sort of a no-brainer, with no real
> risks or downsides.
>
> Thougts?

bin/sbin/libraries, I agree with (besides perhaps shells that have
been hardcoded for eternity, but links/symlinks will solve that).

This bit I've quoted, I see absolutely no reason what so ever to screw
around with. Why on earth do the linker, kernel modules, etc. need to
be in /usr/lib/ at all, other than Poettering's raves and rants? Hell,
if this whole thing is supposed to "make things less confusing" and we
have to move them anyway, then:

* /lib/modules -> /kernel/modules
* /lib/ld-2.15.so -> /linker/x86_64
* /lib/ld-linux.so.2 -> /linker/i386

Of course I'm (probably) joking here. But my point is, moving these
things to /usr is only going to be a pain in the ass, and I see
absolutely no gain whatsoever from the argument your presented for
doing this in the first place.

-Dan

Jan Steffens 03-03-2012 01:52 AM

merge /bin, /sbin, /lib into /usr/bin and /usr/lib
 
On Sat, Mar 3, 2012 at 3:28 AM, Dan McGee <dpmcgee@gmail.com> wrote:
> Why on earth do the linker, kernel modules, etc. need to
> be in /usr/lib/ at all, other than Poettering's raves and rants?

We need to empty /lib, otherwise we can't symlink it.

Dan McGee 03-03-2012 02:08 AM

merge /bin, /sbin, /lib into /usr/bin and /usr/lib
 
On Fri, Mar 2, 2012 at 8:52 PM, Jan Steffens <jan.steffens@gmail.com> wrote:
> On Sat, Mar 3, 2012 at 3:28 AM, Dan McGee <dpmcgee@gmail.com> wrote:
>> Why on earth do the linker, kernel modules, etc. need to
>> be in /usr/lib/ at all, other than Poettering's raves and rants?
>
> We need to empty /lib, otherwise we can't symlink it.

I never said it should be symlinked at any point, ever. bin/sbin were
a different story.

-Dan

Rémy Oudompheng 03-03-2012 08:53 AM

merge /bin, /sbin, /lib into /usr/bin and /usr/lib
 
Le 3 mars 2012 10:49, Pierre Schmitz <pierre@archlinux.de> a écrit :
> Am 03.03.2012 04:21, schrieb Allan McRae:
>> What convinced me of putting all this in /usr rather than on / is that I
>> can have a separate /usr partition that is mounted read only (unless I
>> want to do an update). *If everything from /usr gets moved to the root
>> (a.k.a hurd style) this would require many partitions. *(There is
>> apparently also benefits in allowing /usr to be shared across multiple
>> systems, but I do not care about such a setup and I am really not sure
>> this would work at all with Arch.)
>
> I agree that the /usr subtree we have atm and also the distinction of
> bin and sbin is not really useful and confuses more than it helps.
> Especially the sbin one doesn't make any sense. So it's nice to cleanup
> our filesystem and merge things together. While I don't think a
> read-only /usr is of any use or even advisable I see that having
> everything in /usr is more flexible; so I am fine with that.
>
> So in short: +1 from me.

Similar opinion. And as Dan said, please don't patch things, I'd
prefer that we cleanup things first, and see what is left.

Rémy.

Andrea Scarpino 03-03-2012 08:55 AM

merge /bin, /sbin, /lib into /usr/bin and /usr/lib
 
On Saturday 03 March 2012 10:49:43 Pierre Schmitz wrote:
> I agree that the /usr subtree we have atm and also the distinction of
> bin and sbin is not really useful and confuses more than it helps.
> Especially the sbin one doesn't make any sense. So it's nice to cleanup
> our filesystem and merge things together. While I don't think a
> read-only /usr is of any use or even advisable I see that having
> everything in /usr is more flexible; so I am fine with that.
>
> So in short: +1 from me.
Everything in /usr and to be able to mount it as read-only is nice IMHO. (and
if I understood correctly I could even mount a /usr with KDE-git and one with
KDE-from-extra).

Another +1 from me.

--
Andrea

Tom Gundersen 03-03-2012 09:09 AM

merge /bin, /sbin, /lib into /usr/bin and /usr/lib
 
On Sat, Mar 3, 2012 at 10:13 AM, Andreas Radke <andyrtr@archlinux.org> wrote:
> What about the FHS? Why should we do our own thing here again? The bad
> in end user Linux experience is the incompatibility brought by
> such non-standards.

I absolutely agree that "doing our own thing" would need a strong
justification. This change would not do that though, it would be in
line with what the other major distro's are doing, and it would not be
FHS incompatible.

> And has this idea anything to do with recent Fedora changes?

In the sense that I read all the Fedora proposals and discussions (as
well as the discussions of the other distros) and came to the
conclusion that this was a very good idea, yes. However, following
Fedora is not my motivation, and in fact I believe the way they
implemented the transition is completely wrong.

I should perhaps have linked to Fedora's plans to give proper credit
for the idea, but I'm afraid that would quickly have derailed the
discussion.

> IMHO we are now the next big community distro behind the commercial
> players and should raise our voice more often in projects that define
> future standards.

We certainly should be critical, and take part in discussions. From my
personal experience, going through committees are not the way to do it
(certainly not the FHS). However, discussing personally with the
people who push the changes and write the code is very productive
(which several of us are doing).

Cheers,

Tom

Tom Gundersen 03-03-2012 09:15 AM

merge /bin, /sbin, /lib into /usr/bin and /usr/lib
 
On Sat, Mar 3, 2012 at 10:53 AM, Rémy Oudompheng
<remyoudompheng@gmail.com> wrote:
> Le 3 mars 2012 10:49, Pierre Schmitz <pierre@archlinux.de> a écrit :
>> Am 03.03.2012 04:21, schrieb Allan McRae:
>>> What convinced me of putting all this in /usr rather than on / is that I
>>> can have a separate /usr partition that is mounted read only (unless I
>>> want to do an update). *If everything from /usr gets moved to the root
>>> (a.k.a hurd style) this would require many partitions. *(There is
>>> apparently also benefits in allowing /usr to be shared across multiple
>>> systems, but I do not care about such a setup and I am really not sure
>>> this would work at all with Arch.)
>>
>> I agree that the /usr subtree we have atm and also the distinction of
>> bin and sbin is not really useful and confuses more than it helps.
>> Especially the sbin one doesn't make any sense. So it's nice to cleanup
>> our filesystem and merge things together. While I don't think a
>> read-only /usr is of any use or even advisable I see that having
>> everything in /usr is more flexible; so I am fine with that.
>>
>> So in short: +1 from me.
>
> Similar opinion. And as Dan said, please don't patch things, I'd
> prefer that we cleanup things first, and see what is left.

The patches I posted for namcap documents what would be left (the one
related to /lib at least). It will throw warnings for the things we
can move without patching (libraries and systemd unit files (assuming
Dave will flip a needed config switch)), but will not complain about
stuff that would require (one line!) patches (like the location of
udev rules).

The patching I mentioned would only be a transitional measure which
would be reverted once the symlink is in place, it is really an
implementation detail.

Cheers,

Tom

Tom Gundersen 03-03-2012 10:07 AM

merge /bin, /sbin, /lib into /usr/bin and /usr/lib
 
Not sure exactly where the serious stuff ended and the trolling began,
so I'll take all of it seriously.

On Sat, Mar 3, 2012 at 3:28 AM, Dan McGee <dpmcgee@gmail.com> wrote:
> bin/sbin/libraries, I agree with (besides perhaps shells that have
> been hardcoded for eternity, but links/symlinks will solve that).

Cool.

> Why on earth do the linker, kernel modules, etc. need to
> be in /usr/lib/ at all

See below.

> other than Poettering's raves and rants?

Seriously?

> Hell,
> if this whole thing is supposed to "make things less confusing" and we
> have to move them anyway, then:
>
> * /lib/modules -> /kernel/modules
> * /lib/ld-2.15.so -> /linker/x86_64
> * /lib/ld-linux.so.2 -> /linker/i386
>
> Of course I'm (probably) joking here.

Why not keep the linker with the other .so's? Why create new top-level
dirs? These three symlinks means that /lib must be a proper dir, why
stop it from being a symlink, and reduce compat with other distros
(once some, but not all, start moving udev rules and the like from
/lib to /usr/lib)?

Of course, you know all that, I should not fall for your trolling.

> But my point is, moving these
> things to /usr is only going to be a pain in the ass, and I see
> absolutely no gain whatsoever from the argument your presented for
> doing this in the first place.

Maybe I should have been clearer in the justification for moving
non-libs from /lib to /usr/lib.

The subdirs of /lib are (at least):

device-mapper
depmod.d
initcpio
modprobe.d
security
systemd
udev
firmware
modules

Littering / with non-standard dirs "just because" is obviously not
going to happen, so they either stay put, or move to /usr/lib. Based
on current practices, I think they all belong there. Do you have any
strong arguments to the contrary?

Lastly, as I mentioned before, I think having all of the static stuff
under /usr, is a lot cleaner than our current layout (and in the
future it might allow cool uses such as shared /usr among virtual
machines, hosts, chroots, whatever).

The firmware and modules dir might need some planning to get right,
but this was meant to be about the principle, rather than the
implementation, so I won't comment on that.

Cheers,

Tom

Tom Gundersen 03-03-2012 02:33 PM

merge /bin, /sbin, /lib into /usr/bin and /usr/lib
 
On Sat, Mar 3, 2012 at 4:21 AM, Allan McRae <allan@archlinux.org> wrote:
> So I am very much for this move as it is in the category of things that
> make sense to me. *I also agree with the plan of dealing with /lib first
> and then looking at /bin and /sbin.

Allan and I started a wiki page. Contributions welcome. Especially in
the form of rebuilds ;-)

<https://wiki.archlinux.org/index.php/DeveloperWiki:UsrMove>

Cheers,

Tom


All times are GMT. The time now is 07:35 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.