Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dracut.sh): handle '-i' option to include files beginning with '.'
While including a directory using '--include' option, the file and subdirectory names that begin with '.' are not included. Also, dracut throws a warning message when a subdirectory is empty or only has files or subdirectories that begin with '.'. For example, while trying to include /tmpdata directory with the below tree: # tree -a /tmpdata /tmpdata ├── .anothertestdir ├── testdir │ └── .testsubdir └── .testfile dracut throws the below warning message: # dracut --include /tmpdata /root cp: cannot stat '/tmpdata/testdir/*': No such file or directory # and this is how the included /tmpdata directory tree looks: # tree -a root root └── testdir No file or directory beginning with '.' is included & also, copying /tmpdata/testdir reported "No such file or directory" warning. Using '.' instead of '*' in the below command will fix the warning whether the directory being copied is empty or only has files or directories that begin with dot: $DRACUT_CP -t "$object_destdir" "$dracutsysrootdir$objectname"/* Also, enable 'dotglob' temporarily to include files and directories beginning with a `.' in the results of pathname expansion of source directory being included. Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
- Loading branch information