Sha256: 073eb1e529a40e334f4f5b1b52bfbfe8ec54b07867884ee127a09881e553ea4f

Contents?: true

Size: 797 Bytes

Versions: 7

Compression:

Stored size: 797 Bytes

Contents

#!/bin/sh -x

get_fstype() {
	# udev >=146-1 no longer provides vol_id:
	if [ -x /lib/udev/vol_id ]
	then
		/lib/udev/vol_id -t ${1} 2>/dev/null
	else
		eval $(blkid -o udev "${1}")
		if [ -n "$ID_FS_TYPE" ]
		then
			echo "${ID_FS_TYPE}"
		fi
	fi
}

list_devices() {
    # list partitions first
    (ls /dev/hd*[1-9] /dev/sd*[1-9] ; ls /dev/hd[a-z] /dev/sd[a-z]) 2> /dev/null
}

mkdir /boot

for device in `list_devices`; do
    fs_type=`get_fstype ${device}`
    echo "check if $device ($fs_type) is the boot image"

    case $fs_type in
        ext3|iso9660)
            mount -r -t $fs_type $device /boot
            if [ -f "/boot/config.pp" ]; then
                exit 0
            else
                umount /boot
            fi
            ;;
    esac
done

echo "no image found"
exit 1

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
system-builder-0.0.16 lib/system_builder/mount_boot.sh
system-builder-0.0.15 lib/system_builder/mount_boot.sh
system-builder-0.0.14 lib/system_builder/mount_boot.sh
system-builder-0.0.13 lib/system_builder/mount_boot.sh
system-builder-0.0.12 lib/system_builder/mount_boot.sh
system-builder-0.0.10 lib/system_builder/mount_boot.sh
system-builder-0.0.9 lib/system_builder/mount_boot.sh