Bug 1260788 - Dracut --include not creating file (or creating empty directory)
Dracut --include not creating file (or creating empty directory)
Product: Fedora
Classification: Fedora
Component: dracut (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: dracut-maint-list
Fedora Extras Quality Assurance
Depends On:
Blocks: 1350879
  Show dependency treegraph
Reported: 2015-09-07 14:48 EDT by keith
Modified: 2016-07-19 13:48 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1350879 (view as bug list)
Last Closed: 2016-07-19 13:48:21 EDT
Type: Bug
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 keith 2015-09-07 14:48:35 EDT
Description of problem: I am trying to add a file to my initramfs but it is not gettting created.

Version-Release number of selected component (if applicable):


How reproducible:

I created a test file called test to include in the / directory of the initramfs but it does not get added.

Steps to Reproduce:
1.  Create a test file called test with test in the body
2.  Ran "dracut --force --include test /"
3.  No file is created.

Actual results:

lsinitrd|grep test
Arguments: --force --include 'test' '/'

Expected results:

lsinitrd|grep test
Arguments: --force --include 'test' '/'

Additional info:

I tried to define the destination completely (including the filename) and it only create an empty test directory with no file in it.

Here is the command I ran for that:

dracut --force --include test /test
Comment 1 Harald Hoyer 2015-09-08 04:36:30 EDT
# echo test > test
# ls -l test
-rwxrwxr-x 1 harald harald 5  8. Sep 10:34 test

# dracut -f --include $(pwd)/test /test test.img
# lsinitrd test.img /test

# lsinitrd test.img |fgrep test
Image: test.img: 12M
Arguments: -f --include '/home/harald/test' '/test'
-rwxrwxr-x   1 root     root            5 Sep  8 10:34 test

Works for me with the full path.
Comment 2 Mikhail Campos 2016-06-28 10:59:07 EDT
I can confirm the bug against fc23. It seems to work under the normal, user but only when full path is used.

Moreover, it's broken when running under the root (even with full path): 

1. su -
2. ls -la mycfg.conf 
-rw-r--r-- 1 root root 27 Jun 28 16:47 mycfg.conf
3. dracut --include $(pwd)/mycfg.cfg /etc/myconf.conf -f myinitrd.img
4. lsinitrd myinitrd.img | grep myconf
Arguments: -f --include '/tmp/mycfg.cfg' '/etc/myconf.conf'
drwxr-xr-x   2 root     root            0 Jun 28 17:33 etc/myconf.conf

It creates file of zero size, but the target one was not empty.

Moreover, we have misleading information about --include option using man:

"...--include can only be specified once."

and later in the man:

"--include <SOURCE> <TARGET>
           ... This parameter can be specified multiple times."

Moreover, consequent invocation of dracut --include deletes previous added information (not sure whether it's supposed to be or not).

Version-Release number of selected component (if applicable):
Comment 3 Fedora End Of Life 2016-07-19 13:48:21 EDT
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this

Thank you for reporting this bug and we are sorry it could not be fixed.

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