Bug 434882 - creation of stage2 breaks relative links -> broken HAL -> no disks
creation of stage2 breaks relative links -> broken HAL -> no disks
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: anaconda (Show other bugs)
rawhide
All Linux
low Severity high
: ---
: ---
Assigned To: Anaconda Maintenance Team
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  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:
Environment:
Last Closed: 2008-03-10 18:10:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
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
            newtarget="${target##../../$pathbit/}"
            # if we removed something, replace it with the proper path
            if [ "$newtarget" != "$target" ]; then
                # make it ../sbin/ instead
                ln -sf "../$pathbit/$newtarget" "$brokenlink"
            fi
        done
    done
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.