Bug 541259 - Bug in inst_simple() prevents various required components being installed
Summary: Bug in inst_simple() prevents various required components being installed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dracut
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-11-25 12:21 UTC by Greg Farrell
Modified: 2010-01-28 00:53 UTC (History)
1 user (show)

Fixed In Version: 004-4.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-01-28 00:53:46 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Greg Farrell 2009-11-25 12:21:53 UTC
Various shell script components of different dracut modules are not installed by dracut. This breaks any modules that require them - eg osr, osr-cluster and syslog .

inst_simple checks if the destination to be copied to (target) exists before copying to it, and if so, silenty aborts.
[[ -e ${initdir}$target ]] && return 0

various modules call code similar to:

for lib in boot-lib.sh defaults.sh repository-lib.sh rootfs-lib.sh shinit.sh std-lib.sh; do
  dinfo "Installing $lib"
  mkdir  -p ${initdir}/lib/osr
  inst_simple "$moddir/lib/$lib" /lib/osr
done

Because this copies to a target directory, the check above to see if target exists will always return true. So these files will never be copied into the initramfs.


This is in version 002-13.4.git8f397a9b.fc12.noarch - the latest f12 stable package.

How reproducible:
Always - use the osr module for example.


Steps to Reproduce:

1. Build with dracut -a "osr"
2. extract (gunzip, then cpio -i) the initramfs
3. Confirm that boot-lib.sh is not installed
  
Actual results:
File should be installed


Expected results:
boot-lib.sh and defaults.sh repository-lib.sh rootfs-lib.sh shinit.sh std-lib.sh are not installed


Additional info:
To fix:
Either remove '[[ -e ${initdir}$target ]] && return 0' line from /usr/share/dracut/dracut-functions or change ALL modules to use explicit targets and not directory destinations.
Removing '[[ -e ${initdir}$target ]] && return 0' seems better to me as you don't run the risk of a module developer accidently using a target directory. Also, I don't see the risk of over-writing a pre-existing file, apart from a slight increase in build time. If we have two conflicting files we're doomed anyway.
Either remove 
Either remove

Comment 1 Harald Hoyer 2009-11-26 09:56:41 UTC
-    [[ -e ${initdir}$target ]] && return 0
-    inst_dir "${target%/*}"
+    if ! [[ -d ${initdir}$target ]]; then
+        [[ -e ${initdir}$target ]] && return 0
+        inst_dir "${target%/*}"
+    fi

Better?

Comment 2 Greg Farrell 2009-11-26 10:49:54 UTC
That works. Thanks Harald.

Comment 3 Fedora Update System 2010-01-26 10:49:05 UTC
dracut-004-4.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/dracut-004-4.fc12

Comment 4 Fedora Update System 2010-01-27 01:06:13 UTC
dracut-004-4.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update dracut'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2010-1088

Comment 5 Fedora Update System 2010-01-28 00:51:33 UTC
dracut-004-4.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


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