Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 601768 - sys-apps/coreutils should install md5sum in /bin
Summary: sys-apps/coreutils should install md5sum in /bin
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2016-12-06 07:33 UTC by Sven Eden
Modified: 2017-06-02 11:58 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Add md5sum to the list of common scripts (coreutils-add-md5sum-to-common-scripts.patch,632 bytes, patch)
2016-12-06 07:33 UTC, Sven Eden
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Eden 2016-12-06 07:33:33 UTC
Created attachment 455190 [details, diff]
Add md5sum to the list of common scripts

Currently md5sum is installed to /usr/bin. This causes the following problem with split /usr partitions:

/lib/rc/sh/init.sh from sys-apps/openrc uses the following block to confirm that /proc is already mounted:

--------
     22 mountproc=true
     23 f=/proc/self/environ
     24 if [ -e $f ]; then
     25         if [ "$(VAR=a md5sum $f)" = "$(VAR=b md5sum $f)" ]; then
     26                 eerror "You have cruft in /proc that should be deleted"
     27         else
     28                 einfo "/proc is already mounted"
     29                 mountproc=false
     30         fi
     31 fi
     32 unset f
--------

At that time, a split /usr is not yet mounted and the check fails and states that the user has cruft in /proc that should be deleted.
This is a false positive. Line 25 simply compares the "command not found" error with itself.

$mountproc is then left at being 'true' and the attempt to mount /proc generates a second error message.

Please add md5sum to the list of common scripts like shown in the patch attached.

This fixes the false positive and $mountproc is set to false like it should.
Comment 1 nvinson234 2017-01-30 20:29:20 UTC
Does this happen if /usr is mounted using an initramfs?
Comment 2 Joshua Kinard gentoo-dev 2017-01-31 16:33:25 UTC
(In reply to nvinson234 from comment #1)
> Does this happen if /usr is mounted using an initramfs?

Odds are likely an initramfs would resolve this (I believe I saw it specifically mentioned in an error message when my dev box crashed and rebooted).  That said, an initramfs shouldn't be needed in certain, simple bootup situations that use a split /usr setup.  The proposed change doesn't look like it will be of any significant impact.  All of its needed libraries are already in /lib{32,64}, so the only change is just the location of the binary itself.
Comment 3 SpanKY gentoo-dev 2017-02-09 15:41:09 UTC
(In reply to Joshua Kinard from comment #2)

we already decided that if you want to do a split-/usr, you have to take care of mounting it ahead of time.  if that means you use an initramfs, then that's up to you.
Comment 4 Joshua Kinard gentoo-dev 2017-02-12 21:45:29 UTC
(In reply to SpanKY from comment #3)
> (In reply to Joshua Kinard from comment #2)
> 
> we already decided that if you want to do a split-/usr, you have to take
> care of mounting it ahead of time.  if that means you use an initramfs, then
> that's up to you.

It appears we're already hacking around the split-/usr issue by moving several "critical binaries" into /bin in the coreutils ebuild.  Adding one more script to that specific list doesn't seem like a major issue to me.  Unless we want to just drop this mechanism entirely and force the issue.
Comment 5 SpanKY gentoo-dev 2017-02-13 18:44:34 UTC
(In reply to Joshua Kinard from comment #4)

yes, we have a number of packages that have historically done this.  but we also have a number of bugs open to request more.  we've put a halt on this for now and haven't changed the status quo.

i should just refresh & push my USE=sep-usr patchset.
Comment 6 Joshua Kinard gentoo-dev 2017-02-14 07:45:07 UTC
(In reply to SpanKY from comment #5)
> (In reply to Joshua Kinard from comment #4)
> 
> yes, we have a number of packages that have historically done this.  but we
> also have a number of bugs open to request more.  we've put a halt on this
> for now and haven't changed the status quo.
> 
> i should just refresh & push my USE=sep-usr patchset.

Oddly enough, my sep-/usr setups all work fine without /ginit or other sep-usr bits in busybox.  This one binary is the only non-fatal message I see on any of the systems I have at home.
Comment 7 Sven Eden 2017-02-14 12:36:28 UTC
(In reply to nvinson234 from comment #1)
> Does this happen if /usr is mounted using an initramfs?

Sorry for the late reply.

Although an initramfs might resolve the issue, there is a specific use case, and I do not think that I am alone with it: zfs

However, there might be more an initramfs can not resolve, like a ro nfs share used for /usr.
Comment 8 SpanKY gentoo-dev 2017-02-14 18:19:27 UTC
(In reply to Joshua Kinard from comment #6)

then you got lucky.  that isn't a guarantee.

(In reply to Sven Eden from comment #7)

initramfs can do zfs
Comment 9 Sven Eden 2017-02-14 19:43:42 UTC
(In reply to SpanKY from comment #8)
> 
> initramfs can do zfs

Yes. My system is almost fully on zfs. But initramfs can not pre-mount /usr from another zfs drive.

Root / is gpool/ROOT/system
User /usr is gpool/ROOT/usr

Grub starts the kernel with 
   "root=ZFS=gpool/ROOT/system ro dozfs"
and uses an initramfs created using
   "genkernel --zfs --no-udev initramfs"

If there is an option to pre-mount other zfs drives,too, I'd appreciate a hint, but I daresay this is something to discuss in the forums. ;-)
Comment 10 nvinson234 2017-02-15 03:43:25 UTC
(In reply to Sven Eden from comment #9)
> (In reply to SpanKY from comment #8)
> > 
> > initramfs can do zfs
> 
> Yes. My system is almost fully on zfs. But initramfs can not pre-mount /usr
> from another zfs drive.

I have my doubts about that.  If anything, I'd be more inclined to believe an initramfs *can* mount /usr from another zfs drive.

> 
> Root / is gpool/ROOT/system
> User /usr is gpool/ROOT/usr
> 
> Grub starts the kernel with 
>    "root=ZFS=gpool/ROOT/system ro dozfs"
> and uses an initramfs created using
>    "genkernel --zfs --no-udev initramfs"
> 
> If there is an option to pre-mount other zfs drives,too, I'd appreciate a
> hint, but I daresay this is something to discuss in the forums. ;-)

That doesn't prove you can't do it with initramfs.  It does, however, suggest you cannot do it with genkernel.  It's quite possible you'd have to roll your own initramfs instead of using a tool like genkernel or dracut to generate it for you.
Comment 11 Sven Eden 2017-06-02 11:58:31 UTC
(In reply to nvinson234 from comment #10)
> (In reply to Sven Eden from comment #9)
> > (In reply to SpanKY from comment #8)
> > > 
> > > initramfs can do zfs
> > 
> > Yes. My system is almost fully on zfs. But initramfs can not pre-mount /usr
> > from another zfs drive.
> 
> I have my doubts about that.  If anything, I'd be more inclined to believe
> an initramfs *can* mount /usr from another zfs drive.

I am so sorry, I thought I had closed this already!

Of course you can do it with genkernel.

Just add /usr to /etc/initramfs.mounts and be happy.