aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xinitramfs-init.in22
1 files changed, 21 insertions, 1 deletions
diff --git a/initramfs-init.in b/initramfs-init.in
index 0e30137..7c477c7 100755
--- a/initramfs-init.in
+++ b/initramfs-init.in
@@ -255,6 +255,20 @@ relocate_alpine_mnt() {
fi
}
+# detect filesystem type on given device/UUID
+find_fs_type() {
+ local dev=$(findfs $1)
+ local i=
+ for i in $(blkid $dev); do
+ case $i in
+ TYPE=*) eval "$i"
+ echo $TYPE
+ return
+ ;;
+ esac
+ done
+}
+
# gotta start from somewhere :)
echo "Alpine Init $VERSION"
@@ -314,7 +328,7 @@ case "$ALPINE_DEV" in
UUID=*|LABEL=*) ;;
*) ALPINE_DEV=/dev/$ALPINE_DEV ;;
esac
-
+
# look for standard mountpoint locations
ALPINE_MNT=$(find_mnt $ALPINE_DEV /etc/fstab)
[ -z "$ALPINE_MNT" ] && ALPINE_MNT=/media/${ALPINE_DEV##*/}
@@ -398,6 +412,12 @@ start_lvm
# locate boot media and mount it
ebegin "Mounting boot media"
mkdir -p $ALPINE_MNT
+
+# try detect the filesystem
+if [ -z "$ALPINE_DEV_FS" ]; then
+ ALPINE_DEV_FS=$(find_fs_type $ALPINE_DEV)
+fi
+
if [ -n "$ALPINE_DEV_FS" ]; then
mount_opts="-t $ALPINE_DEV_FS"
fi