aboutsummaryrefslogtreecommitdiffstats
path: root/main/mkinitfs/0001-init-try-detect-alpine_dev-filesystem-if-not-specifi.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/mkinitfs/0001-init-try-detect-alpine_dev-filesystem-if-not-specifi.patch')
-rw-r--r--main/mkinitfs/0001-init-try-detect-alpine_dev-filesystem-if-not-specifi.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/main/mkinitfs/0001-init-try-detect-alpine_dev-filesystem-if-not-specifi.patch b/main/mkinitfs/0001-init-try-detect-alpine_dev-filesystem-if-not-specifi.patch
new file mode 100644
index 0000000000..01cb2c2e3b
--- /dev/null
+++ b/main/mkinitfs/0001-init-try-detect-alpine_dev-filesystem-if-not-specifi.patch
@@ -0,0 +1,60 @@
+From 60821c8ba0118d231cd3b4fd008cd42868337439 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 27 Oct 2011 09:54:59 +0000
+Subject: [PATCH 1/2] init: try detect alpine_dev filesystem if not specified
+
+Note that ext4 will be detected as ext3
+---
+ initramfs-init.in | 22 +++++++++++++++++++++-
+ 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
+--
+1.7.7.1
+