pfi: Adjust a bit better for devfs.
authorSascha Wildner <saw@online.de>
Sat, 12 Sep 2009 13:41:32 +0000 (15:41 +0200)
committerSascha Wildner <saw@online.de>
Sat, 12 Sep 2009 13:41:46 +0000 (15:41 +0200)
Only check for pfi.conf on devices which exist in /dev. This reduces some
error messages upon LiveCD boot.

nrelease/installer/etc/rc.d/pfi

index eaecac3..58b5092 100755 (executable)
@@ -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
 }