Gentoo Archives: gentoo-dev

From: Eray Aslan <eray.aslan@×××××××.tr>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] /bin and /sbin to /usr
Date: Tue, 10 Aug 2010 11:22:52
Message-Id: 20100810112230.GA12155@zptr-nb01.caf.local
[Following a similar discussion in another mailing list]

As you know, only a few directories can be assumed to be available after
boot[1].  Notably, /usr and /var are not among them.  Binaries in /bin
and /sbin should be enough to do basic maintanence/repair and to mount
other volumes.  Since we are using the binaries in /bin and /sbin to
potentially mount /usr, they should not depend on them.  Or can they?

On my laptop:
# for f in /bin/* /sbin/*; do if [ "$(file $f | grep ELF)" != "" ] ;
then if [ "$(ldd $f | grep /usr)" != "" ] ; then echo $(equery belongs
$f) $f; ldd $f; fi; fi; done
net-firewall/iptables-1.4.6 /sbin/iptables-multi =>  (0x00007fffc77e8000) => /usr/lib/ (0x00007f27e4781000) => /usr/lib/ (0x00007f27e4579000) => /lib/ (0x00007f27e42f8000) => /lib/ (0x00007f27e3f9f000) => /lib/ (0x00007f27e3d9b000)
	/lib64/ (0x00007f27e4988000)
sys-apps/hal-0.5.14-r2 /sbin/umount.hal =>  (0x00007fff6b5f3000) => /usr/lib/ (0x00007fd52e637000) => /usr/lib/ (0x00007fd52e42c000) => /usr/lib/ (0x00007fd52e1ec000) => /lib/ (0x00007fd52de93000) => /lib/ (0x00007fd52dc77000) => /lib/ (0x00007fd52da6e000)
	/lib64/ (0x00007fd52e848000)

1. Is this OK or should we file bugs against binaries in {/bin,/sbin} linking
against libraries in /usr/lib? Fix is relatively easy in general (give
--libdir=/lib against the config script)

2. Is the below acceptable? (symlinking from /bin to /usr/bin)
# ls -l $(find {/bin,/sbin}/ -type l)|grep /usr
lrwxrwxrwx 1 root root 20 Oct 28  2008 /bin/igawk ->
lrwxrwxrwx 1 root root 14 Aug 10 13:29 /bin/mail -> /usr/bin/mailx
lrwxrwxrwx 1 root root 20 Oct 28  2008 /bin/pgawk ->

Corollary to both:  If yes, tinderbox/buildbot against other packages
are probably in order as well.


/proc (Linux)
/sys (Linux-2.6)
/libexec (*BSD)


Subject Author
Re: [gentoo-dev] /bin and /sbin to /usr "Paweł Hajdan
Re: [gentoo-dev] /bin and /sbin to /usr Mike Frysinger <vapier@g.o>