This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 434882 - creation of stage2 breaks relative links -> broken HAL -> no disks
creation of stage2 breaks relative links -> broken HAL -> no disks
Product: Fedora
Classification: Fedora
Component: anaconda (Show other bugs)
All Linux
low Severity high
: ---
: ---
Assigned To: Anaconda Maintenance Team
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-02-25 18:40 EST by Will Woods
Modified: 2008-03-10 18:10 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-03-10 18:10:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Will Woods 2008-02-25 18:40:17 EST
scripts/upd-instroot does the following:

    (cd $p/bin; find) | (cd $p/bin; /bin/cpio --quiet -pdmu $p/usr/bin)
    (cd $p/sbin; find) | (cd $p/sbin; /bin/cpio --quiet -pdmu $p/usr/sbin)

moving everything from /sbin to /usr/sbin will break any relative symlinks into
/bin or /sbin.. like /usr/bin/udevinfo (which is how HAL discovers devices):
    /usr/bin/udevinfo -> ../../sbin/udevadm
(this was changed 5 days ago for bug #432878)

A simple hack to work around this would be to do:
    ln -sf /sbin/udevadm $p/usr/bin/udevinfo
since we have udev in stage1 these days. On the other hand, here's a bash script
that should fix up the links:

    # Fix relative links like /usr/bin/udevinfo -> ../../sbin/udevadm
    for brokenlink in $(find $p/usr/{bin,sbin} -follow -lname '*'); do
        target="$(readlink $brokenlink)"
        for pathbit in bin sbin; do
            # if it starts with "../../sbin/", remove that
            # if we removed something, replace it with the proper path
            if [ "$newtarget" != "$target" ]; then
                # make it ../sbin/ instead
                ln -sf "../$pathbit/$newtarget" "$brokenlink"
Comment 1 Jeremy Katz 2008-02-25 21:13:08 EST
Ugh.  Added in git
Comment 2 Will Woods 2008-03-10 18:10:39 EDT
Fixed in current rawhide, AFAICT.

Note You need to log in before you can comment on or make changes to this bug.