Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
When trying to include a directory in the initramfs using "--include <src> <tgt>", the initramfs gets created without including the files in the <src> top directory and following errors are printed for each file in <src> directory:
cp: failed to access '/var/tmp/initramfs.91CQHL///myfile': No such file or directory
Version-Release number of selected component (if applicable):
dracut-033-502.el7.x86_64 but also before, at least since dracut-033-240.el7.x86_64 (RHEL7.1)
How reproducible:
Always
Steps to Reproduce:
1. Create some source to include
mkdir mydir
touch mydir/myfile
mkdir mydir/mysubdir
touch mydir/mysubdir/myfile
2. Run dracut to include "mydir" and check content
dracut --include mydir / /tmp/myinitramfs -f
Actual results:
cp: failed to access '/var/tmp/initramfs.CRA4FA///myfile': No such file or directory
lsinitrd content:
drwxr-xr-x 2 root root 0 Sep 8 16:39 mysubdir
-rw-r--r-- 1 root root 0 Sep 8 16:39 mysubdir/myfile
Expected results:
no cp error + lsinitrd content:
-rw-r--r-- 1 root root 0 Sep 8 16:39 myfile
drwxr-xr-x 2 root root 0 Sep 8 16:39 mysubdir
-rw-r--r-- 1 root root 0 Sep 8 16:39 mysubdir/myfile
Suggested fix (/usr/sbin/dracut):
[...]
1442 chmod --reference="$i" "$s"
1443 fi
1444 cp --reflink=auto --sparse=auto -fa -t "$s" "$i"/*
1445 else
=> replace line 1446
1446 cp --reflink=auto --sparse=auto -fa -t "$s" "$i"
=> by
1446 cp --reflink=auto --sparse=auto -fa -t "${initdir}/${tgt}" "$i"
1447 fi
1448 done
[...]
If I am not mistaken --include does not work recursively. It can only copy one level of files. It is written in the man page, but the formulation is kinda clumsy. But this is still a valid RFE.
Here the issue is that the files in top dir "mydir/*" are not copied (in the above case mydir/myfile).
And btw subdirs are copied as someone would expect.
I have the same issue. Having looked into /usr/bin/dracut it appears that
the line:
cp --reflink=auto --sparse=auto -fa -t "$s" "$i"
in the else clause is the culprit. It is using $s where this is the destination file not the destination directory. As a test I used 'dirname $s' instead and this worked. So I suspect the value of $s needs to checked after being initialised to see if it is a file or a directory.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2018:0964
Description of problem: When trying to include a directory in the initramfs using "--include <src> <tgt>", the initramfs gets created without including the files in the <src> top directory and following errors are printed for each file in <src> directory: cp: failed to access '/var/tmp/initramfs.91CQHL///myfile': No such file or directory Version-Release number of selected component (if applicable): dracut-033-502.el7.x86_64 but also before, at least since dracut-033-240.el7.x86_64 (RHEL7.1) How reproducible: Always Steps to Reproduce: 1. Create some source to include mkdir mydir touch mydir/myfile mkdir mydir/mysubdir touch mydir/mysubdir/myfile 2. Run dracut to include "mydir" and check content dracut --include mydir / /tmp/myinitramfs -f Actual results: cp: failed to access '/var/tmp/initramfs.CRA4FA///myfile': No such file or directory lsinitrd content: drwxr-xr-x 2 root root 0 Sep 8 16:39 mysubdir -rw-r--r-- 1 root root 0 Sep 8 16:39 mysubdir/myfile Expected results: no cp error + lsinitrd content: -rw-r--r-- 1 root root 0 Sep 8 16:39 myfile drwxr-xr-x 2 root root 0 Sep 8 16:39 mysubdir -rw-r--r-- 1 root root 0 Sep 8 16:39 mysubdir/myfile Suggested fix (/usr/sbin/dracut): [...] 1442 chmod --reference="$i" "$s" 1443 fi 1444 cp --reflink=auto --sparse=auto -fa -t "$s" "$i"/* 1445 else => replace line 1446 1446 cp --reflink=auto --sparse=auto -fa -t "$s" "$i" => by 1446 cp --reflink=auto --sparse=auto -fa -t "${initdir}/${tgt}" "$i" 1447 fi 1448 done [...]