initrd.scripts: add get_device_fstype

This fuction prints the device file system type to standard output
and will be used in future for executing fstype specific tasks.
master
Fabio Erculiani 12 years ago
parent 8c839788ff
commit c27d3ac25d

@ -501,6 +501,17 @@ find_real_device() {
echo -n "${DEVICE}" echo -n "${DEVICE}"
} }
get_device_fstype() {
local device=$(find_real_device "${1}")
if [ -n "${device}" ]; then
blkid -o value -s TYPE "${device}"
return ${?} # readability
else
echo "Cannot resolve device: ${1}" >&2
return 1
fi
}
check_loop() { check_loop() {
if [ "${LOOP}" = '' -o ! -e "${CDROOT_PATH}/${LOOP}" ] if [ "${LOOP}" = '' -o ! -e "${CDROOT_PATH}/${LOOP}" ]
then then

Loading…
Cancel
Save