From 2741bae03a4564d0755006fd53e08245d54bb332 Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Sun, 9 Jun 2013 03:56:57 -0400 Subject: [PATCH] Eliminate warnings about missing ZFS files zpool.cache and zdev.conf are optional files, so instead of warning when they are missing, we print a message when they are copied. Signed-off-by: Richard Yao --- gen_initramfs.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 1a9146d..a3e03d0 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -336,13 +336,17 @@ append_zfs(){ rm -r "${TEMP}/initramfs-zfs-temp" fi - mkdir -p "${TEMP}/initramfs-zfs-temp/etc/zfs/" + mkdir -p "${TEMP}/initramfs-zfs-temp/etc/zfs" # Copy files to /etc/zfs - for i in /etc/zfs/{zdev.conf,zpool.cache} + for i in zdev.conf zpool.cache do - cp -a "${i}" "${TEMP}/initramfs-zfs-temp/etc/zfs" 2> /dev/null \ - || print_warning 1 "Could not copy file ${i} for ZFS" + if [ -f /etc/zfs/${i} ] + then + print_info 1 " >> Including ${i}" + cp -a "/etc/zfs/${i}" "${TEMP}/initramfs-zfs-temp/etc/zfs" 2> /dev/null \ + || gen_die "Could not copy file ${i} for ZFS" + fi done # Copy binaries