Silence cp error when optional ZFS files are unavailable

Users were seeing the following error message printed:

cp: cannot stat ‘/etc/zfs/zdev.conf’: No such file or directory

Both zdev.conf and zpool.cache are optional files. We print a warning
when they are absent, but cp printed its own error in addition to our
warning. We suppress that.

Signed-off-by: Richard Yao <ryao@gentoo.org>
master
Richard Yao 12 years ago committed by Fabio Erculiani
parent f3570c3957
commit 2f9f31a7c0

@ -341,7 +341,7 @@ append_zfs(){
# Copy files to /etc/zfs
for i in /etc/zfs/{zdev.conf,zpool.cache}
do
cp -a "${i}" "${TEMP}/initramfs-zfs-temp/etc/zfs" \
cp -a "${i}" "${TEMP}/initramfs-zfs-temp/etc/zfs" 2> /dev/null \
|| print_warning 1 "Could not copy file ${i} for ZFS"
done

Loading…
Cancel
Save