Bug 1260788 - Dracut --include not creating file (or creating empty directory)
Summary: Dracut --include not creating file (or creating empty directory)
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: dracut
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: dracut-maint-list
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1350879
TreeView+ depends on / blocked
 
Reported: 2015-09-07 18:48 UTC by keith
Modified: 2016-07-19 17:48 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
: 1350879 (view as bug list)
Environment:
Last Closed: 2016-07-19 17:48:21 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description keith 2015-09-07 18:48:35 UTC
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):

041-14.fc22

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' '/'
/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 08:36:30 UTC
# 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
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 14:59:07 UTC
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):
043-60.git20150811.fc23

Comment 3 Fedora End Of Life 2016-07-19 17:48:21 UTC
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
bug.

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.