public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] /bin and /sbin to /usr
@ 2010-08-10 11:22 Eray Aslan
  2010-08-10 14:01 ` "Paweł Hajdan, Jr."
  2010-08-10 21:00 ` Mike Frysinger
  0 siblings, 2 replies; 5+ messages in thread
From: Eray Aslan @ 2010-08-10 11:22 UTC (permalink / raw
  To: gentoo-dev

[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
	linux-vdso.so.1 =>  (0x00007fffc77e8000)
	libip4tc.so.0 => /usr/lib/libip4tc.so.0 (0x00007f27e4781000)
	libxtables.so.4 => /usr/lib/libxtables.so.4 (0x00007f27e4579000)
	libm.so.6 => /lib/libm.so.6 (0x00007f27e42f8000)
	libc.so.6 => /lib/libc.so.6 (0x00007f27e3f9f000)
	libdl.so.2 => /lib/libdl.so.2 (0x00007f27e3d9b000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f27e4988000)
sys-apps/hal-0.5.14-r2 /sbin/umount.hal
	linux-vdso.so.1 =>  (0x00007fff6b5f3000)
	libhal.so.1 => /usr/lib/libhal.so.1 (0x00007fd52e637000)
	libhal-storage.so.1 => /usr/lib/libhal-storage.so.1 (0x00007fd52e42c000)
	libdbus-1.so.3 => /usr/lib/libdbus-1.so.3 (0x00007fd52e1ec000)
	libc.so.6 => /lib/libc.so.6 (0x00007fd52de93000)
	libpthread.so.0 => /lib/libpthread.so.0 (0x00007fd52dc77000)
	librt.so.1 => /lib/librt.so.1 (0x00007fd52da6e000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fd52e848000)

Questions:
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 ->
/usr/bin/igawk-3.1.6
lrwxrwxrwx 1 root root 14 Aug 10 13:29 /bin/mail -> /usr/bin/mailx
lrwxrwxrwx 1 root root 20 Oct 28  2008 /bin/pgawk ->
/usr/bin/pgawk-3.1.6

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

Thanks
-- 
Eray

[1]
/dev
/etc
/lib
/bin
/sbin
/proc (Linux)
/sys (Linux-2.6)
/libexec (*BSD)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-dev] /bin and /sbin to /usr
  2010-08-10 11:22 [gentoo-dev] /bin and /sbin to /usr Eray Aslan
@ 2010-08-10 14:01 ` "Paweł Hajdan, Jr."
  2010-08-10 21:06   ` Mike Frysinger
  2010-08-10 21:00 ` Mike Frysinger
  1 sibling, 1 reply; 5+ messages in thread
From: "Paweł Hajdan, Jr." @ 2010-08-10 14:01 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 854 bytes --]

On 8/10/10 4:22 AM, Eray Aslan wrote:
> 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)

I'd suggest a fix that is guaranteed to work: make portage refuse to
install anything in /bin that depends on /usr (based on say ldd check).

> 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 ->
> /usr/bin/igawk-3.1.6
> lrwxrwxrwx 1 root root 14 Aug 10 13:29 /bin/mail -> /usr/bin/mailx
> lrwxrwxrwx 1 root root 20 Oct 28  2008 /bin/pgawk ->
> /usr/bin/pgawk-3.1.6

I don't know the reason behind it. Both /usr/bin and /bin are in PATH...
maybe for compatibility reasons.

Paweł


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-dev] /bin and /sbin to /usr
  2010-08-10 11:22 [gentoo-dev] /bin and /sbin to /usr Eray Aslan
  2010-08-10 14:01 ` "Paweł Hajdan, Jr."
@ 2010-08-10 21:00 ` Mike Frysinger
  2010-08-11  6:02   ` Eray Aslan
  1 sibling, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2010-08-10 21:00 UTC (permalink / raw
  To: gentoo-dev

On Tue, Aug 10, 2010 at 7:22 AM, Eray Aslan wrote:
> net-firewall/iptables-1.4.6 /sbin/iptables-multi
>        linux-vdso.so.1 =>  (0x00007fffc77e8000)
>        libip4tc.so.0 => /usr/lib/libip4tc.so.0 (0x00007f27e4781000)
>        libxtables.so.4 => /usr/lib/libxtables.so.4 (0x00007f27e4579000)
>        libm.so.6 => /lib/libm.so.6 (0x00007f27e42f8000)
>        libc.so.6 => /lib/libc.so.6 (0x00007f27e3f9f000)
>        libdl.so.2 => /lib/libdl.so.2 (0x00007f27e3d9b000)
>        /lib64/ld-linux-x86-64.so.2 (0x00007f27e4988000)

file a bug.  probably an oversight on my part.

> sys-apps/hal-0.5.14-r2 /sbin/umount.hal
>        linux-vdso.so.1 =>  (0x00007fff6b5f3000)
>        libhal.so.1 => /usr/lib/libhal.so.1 (0x00007fd52e637000)
>        libhal-storage.so.1 => /usr/lib/libhal-storage.so.1 (0x00007fd52e42c000)
>        libdbus-1.so.3 => /usr/lib/libdbus-1.so.3 (0x00007fd52e1ec000)
>        libc.so.6 => /lib/libc.so.6 (0x00007fd52de93000)
>        libpthread.so.0 => /lib/libpthread.so.0 (0x00007fd52dc77000)
>        librt.so.1 => /lib/librt.so.1 (0x00007fd52da6e000)
>        /lib64/ld-linux-x86-64.so.2 (0x00007fd52e848000)

file a bug.  hal places its umount binary in / only because
historically, `mount` has been stupid and only searched that path, not
because it was needed "early".  since ive fixed util-linux though, the
hal mount helpers should be moved to /usr.

> 2. Is the below acceptable? (symlinking from /bin to /usr/bin)

it depends

> # ls -l $(find {/bin,/sbin}/ -type l)|grep /usr
> lrwxrwxrwx 1 root root 20 Oct 28  2008 /bin/igawk ->
> /usr/bin/igawk-3.1.6
> lrwxrwxrwx 1 root root 20 Oct 28  2008 /bin/pgawk ->
> /usr/bin/pgawk-3.1.6

file a bug so i can fix gawk

> lrwxrwxrwx 1 root root 14 Aug 10 13:29 /bin/mail -> /usr/bin/mailx

/bin/mail is kept for compatibility with random admin scripts (both
packaged and custom).  not a big deal as anyone who needs to send mail
isnt going to have /usr missing.  i'd forget about this and work on
something else.
-mike



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-dev] /bin and /sbin to /usr
  2010-08-10 14:01 ` "Paweł Hajdan, Jr."
@ 2010-08-10 21:06   ` Mike Frysinger
  0 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2010-08-10 21:06 UTC (permalink / raw
  To: gentoo-dev

On Tue, Aug 10, 2010 at 10:01 AM, "Paweł Hajdan, Jr." wrote:
> On 8/10/10 4:22 AM, Eray Aslan wrote:
>> 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)
>
> I'd suggest a fix that is guaranteed to work: make portage refuse to
> install anything in /bin that depends on /usr (based on say ldd check).

not a chance.  some of the reasons why this isnt realistic:
 - ldd is not portable
 - ldd *executes* things
 - ldd cannot easily/sanely handle a mix of installed system paths and
temporary paths ($D)
 - ldd will not work with cross-compiling
 - ldd shows the entire dependency tree, not just the program in
question ... so one broken library can easily cause other packages to
be flagged
 - even if ldd showed only direct dependencies, one broken library
package could break the packages that use it
 - prevents historical compat links that are otherwise irrelevant
 - the vast majority of the time, users dont give a sh*t, and this
doesnt affect them -- people who do a sep /usr mount from / are a
small fraction
-mike



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-dev] /bin and /sbin to /usr
  2010-08-10 21:00 ` Mike Frysinger
@ 2010-08-11  6:02   ` Eray Aslan
  0 siblings, 0 replies; 5+ messages in thread
From: Eray Aslan @ 2010-08-11  6:02 UTC (permalink / raw
  To: gentoo-dev

On 11.08.2010 00:00, Mike Frysinger wrote:
> file a bug.

Done.  Thanks for looking into it.

-- 
Eray



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-08-11  6:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-10 11:22 [gentoo-dev] /bin and /sbin to /usr Eray Aslan
2010-08-10 14:01 ` "Paweł Hajdan, Jr."
2010-08-10 21:06   ` Mike Frysinger
2010-08-10 21:00 ` Mike Frysinger
2010-08-11  6:02   ` Eray Aslan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox