Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 641396 - sys-apps/systemd-236 usrmerge breaks install phase
Summary: sys-apps/systemd-236 usrmerge breaks install phase
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-16 19:13 UTC by Markus Rathgeb
Modified: 2017-12-18 14:30 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Rathgeb 2017-12-16 19:13:06 UTC
I tried to merge systemd with enabled usrmerge flag.

It fails with:
rm: cannot remove '/var/tmp/portage/sys-apps/systemd-236/image/lib/udev/hwdb.d': No such file or directory

The build contains this lines:
===
    rm -r "${ED%/}"/lib/udev/hwdb.d || die

    if ! use usrmerge; then
        # Avoid breaking boot/reboot
        dosym ../../../lib/systemd/systemd /usr/lib/systemd/systemd
        dosym ../../../lib/systemd/systemd-shutdown /usr/lib/systemd/systemd-shutdown
    fi
===

If usrmerge is set, the path of hwdb.d should be changed from 
"${ED%/}"/lib/udev/hwdb.d
to
"${ED%/}"/usr/lib/udev/hwdb.d


Here the output of the lookup for that file name:
# find /var/tmp/portage/sys-apps/systemd-236/ -name "hwdb.d"
/var/tmp/portage/sys-apps/systemd-236/image/usr/lib/udev/hwdb.d
/var/tmp/portage/sys-apps/systemd-236/image/etc/udev/hwdb.d
Comment 1 Markus Rathgeb 2017-12-16 19:32:12 UTC
It is not really part of this issue but as a side note (as it is realted to usrmerge USE flag):
This version of systemd introduced a static resolv.conf file for systemd-resolved and all the documentation states that the path of the file is 
/usr/lib/systemd/resolv.conf.
So, if usrmerge is not enabled, shouldn't we also add a symlink for that file?
e.g.
dosym ../../../lib/systemd/resolv.conf /usr/lib/systemd/resolv.conf
Comment 2 Larry the Git Cow gentoo-dev 2017-12-16 19:46:58 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=33ae78e82b42d4b6d9c203d88e8be8c4aaa68e72

commit 33ae78e82b42d4b6d9c203d88e8be8c4aaa68e72
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2017-12-16 19:46:10 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2017-12-16 19:46:53 +0000

    sys-apps/systemd: fix usrmerge install
    
    Closes: https://bugs.gentoo.org/641396
    Package-Manager: Portage-2.3.19_p1, Repoman-2.3.6_p35

 sys-apps/systemd/metadata.xml        | 2 +-
 sys-apps/systemd/systemd-236.ebuild  | 5 ++++-
 sys-apps/systemd/systemd-9999.ebuild | 5 ++++-
 3 files changed, 9 insertions(+), 3 deletions(-)
Comment 3 Mike Gilbert gentoo-dev 2017-12-16 19:48:15 UTC
Thanks for testing.

I added a note that this USE flag is experimental. You should only enable it if you have already taken steps to merge /bin, /sbin, and /lib into /usr/bin, /usr/sbin, and /usr/lib.
Comment 4 Markus Rathgeb 2017-12-16 20:18:42 UTC
Thanks for fixing.
Is there any semi-official documentation how the merge should be done the "right" way?
Comment 5 Duncan 2017-12-17 01:41:08 UTC
What about "reverse usrmerge", that is:

/usr -> .

... so everything from /usr ends up in / itself (shorter path)?

Should that work?  (I've not tried 236 yet to see if it does.)

Duncan
Comment 6 Duncan 2017-12-17 03:01:31 UTC
(In reply to Duncan from comment #5)
> What about "reverse usrmerge", that is:
> 
> /usr -> .

FWIW after merge with USE=usrmerge now...

It seems to "just work".

Thanks.  A bit simpler now. =:^)

Duncan
Comment 7 Markus Rathgeb 2017-12-17 18:18:41 UTC
What about the ones that do not use usrmerge and wants to use the symbolic link to /usr/lib/systemd/resolv.conf as stated in the official documentation?

Shouldn't there a line similar to
dosym ../../../lib/systemd/resolv.conf /usr/lib/systemd/resolv.conf
in the ebuild (if ! use usrmerge, similar to "avoid breaking boot/reboot)?

See also Comment 1
Comment 8 Markus Rathgeb 2017-12-18 14:30:01 UTC
https://github.com/gentoo/gentoo/pull/6579