[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#380004: [Patch] vol_id to try to identify FSTYPE when fstype fails



tags 380004 patch
thanks

Here is a patch to do 2 things:

1: export FSTYPE so that user scripts can hard code it in
/scripts/local-premount
2: is fstype reports an "unknown" file system type then use vol_id
(which is already on the initramfs) to try and detect the filesystem.
This should be backwards compatable and allow the detection of iso9660
filesystems.

Please note I have not yet tested this patch.
I shall try to find time tomorrow and report back!

Bye for now
Alex Owen
diff -uNr initramfs-tools-0.72.old/init initramfs-tools-0.72/init
--- initramfs-tools-0.72.old/init	2006-07-23 10:35:10.000000000 +0100
+++ initramfs-tools-0.72/init	2006-07-26 20:54:50.000000000 +0100
@@ -27,6 +27,7 @@
 
 # Export it for root hardcoding
 export ROOT=
+export FSTYPE=
 
 # Bring in the main config
 . /conf/initramfs.conf
diff -uNr initramfs-tools-0.72.old/scripts/local initramfs-tools-0.72/scripts/local
--- initramfs-tools-0.72.old/scripts/local	2006-07-16 19:06:10.000000000 +0100
+++ initramfs-tools-0.72/scripts/local	2006-07-26 19:55:16.000000000 +0100
@@ -38,6 +38,11 @@
 
 	# Get the root filesystem type
 	eval $(fstype < ${ROOT})
+	if [ "$FSTYPE" = "unknown" -a -x /lib/udev/vol_id ] ; then
+		FSTYPE="$(/lib/udev/vol_id -t ${ROOT} 2>/dev/null)"
+	    	[ -z "$FSTYPE" ] && FSTYPE="unknown"
+	fi
+
 
 	[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-premount"
 	run_scripts /scripts/local-premount

Reply to: