From: Sascha Wildner Date: Sat, 12 Sep 2009 13:41:32 +0000 (+0200) Subject: pfi: Adjust a bit better for devfs. X-Git-Tag: v2.4.0~26^2~11 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/8d96d4b2b2abec15be2c1bf8984928ebeb16f0e1 pfi: Adjust a bit better for devfs. Only check for pfi.conf on devices which exist in /dev. This reduces some error messages upon LiveCD boot. --- diff --git a/nrelease/installer/etc/rc.d/pfi b/nrelease/installer/etc/rc.d/pfi index eaecac3541..58b509252d 100755 --- a/nrelease/installer/etc/rc.d/pfi +++ b/nrelease/installer/etc/rc.d/pfi @@ -53,17 +53,19 @@ look_for_pfi_config_msdos() [ -r /etc/pfi.conf ] && return 0 for try_device in da0s1 da1s1 da8s1 fd0 fd1; do - echo -n "Looking for pfi.conf on /dev/${try_device}..." - if mount_msdos -o rdonly /dev/$try_device /mnt ; then - echo -n " /dev/$try_device ok..." - if get_pfi_config /mnt /dev/$try_device; then - get_authorized_hosts /mnt + if [ -c /dev/${try_device} ]; then + echo -n "Looking for pfi.conf on /dev/${try_device}..." + if mount_msdos -o rdonly /dev/$try_device /mnt ; then + echo -n " /dev/$try_device ok..." + if get_pfi_config /mnt /dev/$try_device; then + get_authorized_hosts /mnt + umount /mnt + return 0 + fi umount /mnt - return 0 fi - umount /mnt + echo " not found" fi - echo " not found" done return 1 } @@ -73,17 +75,19 @@ look_for_pfi_config_cd9660() [ -r /etc/pfi.conf ] && return 0 for try_device in acd0 cd0 acd1 cd1; do - echo -n "Looking for pfi.conf on /dev/${try_device}..." - if mount_cd9660 /dev/$try_device /mnt ; then - echo -n " /dev/$try_device ok..." - if get_pfi_config /mnt /dev/$try_device; then - get_authorized_hosts /mnt + if [ -c /dev/${try_device} ]; then + echo -n "Looking for pfi.conf on /dev/${try_device}..." + if mount_cd9660 /dev/$try_device /mnt ; then + echo -n " /dev/$try_device ok..." + if get_pfi_config /mnt /dev/$try_device; then + get_authorized_hosts /mnt + umount /mnt + return 0 + fi umount /mnt - return 0 fi - umount /mnt + echo " not found" fi - echo " not found" done return 1 }