- if [ "$(cat /sys/block/$device/removable)" = "1" ] ; then
- partitions=$(/bin/awk "\$4 ~ /${device}[0-9]*/ { print \$4 }" /proc/partitions)
- for partition in $partitions ; do
- echo $(date "+%H:%M:%S") "pl_sysinit: checking $partition for iso image"
- mkdir -p /tmp/$partition
- if /bin/mount -o ro -t msdos,ext2 /dev/$partition /tmp/$partition 2>&1 > /dev/null ; then
- # Look for the first ISO image
- for iso in /tmp/$partition/*.iso ; do
- if /sbin/losetup /dev/loop0 $iso ; then
- echo $(date "+%H:%M:%S") "pl_sysinit: using $(basename $iso) on $partition"
- device="loop0"
- break
- fi
- done
- if [ "$device" != "loop0" ] ; then
- /bin/umount /tmp/$partition 2>&1 > /dev/null
- fi
- fi
- done
- fi
-
- echo $(date "+%H:%M:%S") "pl_sysinit: checking $device for /usr contents"
- /bin/mount -o ro -t iso9660 /dev/$device /usr 2>&1 > /dev/null
- if [ $? -eq 0 ]; then
- # it mounted, but we should probably make sure its our boot cd
- # this can be done by making sure the /pl_version file (on initrd)
- # matches /usr/isolinux/pl_version
- initrd_version=$(/bin/cat /pl_version)
- cd_version=$(/bin/cat /usr/isolinux/pl_version)
-
- if [ "$initrd_version" != "$cd_version" ]; then
- # eh, wrong cd, keep trying
- /bin/umount /usr 2>&1 /dev/null
- else
- echo $(date "+%H:%M:%S") "pl_sysinit: found cd and mounted on /usr"
- _mounted=1
- break
- fi
- fi
+ if [ "$(cat /sys/block/$device/removable)" = "1" ] ; then
+ partitions=$(/bin/awk "\$4 ~ /${device}[0-9]*/ { print \$4 }" /proc/partitions)
+ for partition in $partitions ; do
+ echo $(date "+%H:%M:%S") "pl_sysinit: checking $partition for iso image"
+ mkdir -p /tmp/$partition
+ if /bin/mount -o ro -t msdos,ext2 /dev/$partition /tmp/$partition 2>&1 > /dev/null ; then
+ # Look for the first ISO image
+ for iso in /tmp/$partition/*.iso ; do
+ if /sbin/losetup /dev/loop0 $iso ; then
+ echo $(date "+%H:%M:%S") "pl_sysinit: using $(basename $iso) on $partition"
+ device="loop0"
+ break
+ fi
+ done
+ if [ "$device" != "loop0" ] ; then
+ /bin/umount /tmp/$partition 2>&1 > /dev/null
+ fi
+ fi
+ done
+ fi
+
+ verbose-message "pl_sysinit: checking $device for /usr contents"
+ /bin/mount -o ro -t iso9660 /dev/$device /usr 2>&1 > /dev/null
+ if [ $? -eq 0 ]; then
+ # it mounted, but we should probably make sure its our boot cd
+ # this can be done by making sure the /pl_version file (on initrd)
+ # matches /usr/isolinux/pl_version
+ initrd_version=$(/bin/cat /pl_version)
+ cd_version=$(/bin/cat /usr/isolinux/pl_version)
+
+ if [ "$initrd_version" != "$cd_version" ]; then
+ # eh, wrong cd, keep trying
+ /bin/umount /usr 2>&1 /dev/null
+ else
+ verbose-message "pl_sysinit: found CD and mounted on /usr"
+ _mounted=1
+ break
+ fi
+ fi