summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2018-07-27 11:21:20 +0800
committerBen Hutchings <benh@debian.org>2020-09-06 23:23:20 +0100
commit4309c3bcd97acdb17e250c56811faa9cfb4091fd (patch)
tree199870dec2e79ccc70f2c7edfd830cdaf8a59522
parent9877542bcf34fe2fa8b97eb08d93db876717f5e5 (diff)
Add FSTYPE config parameter to allow overriding filesystem type detection
This is needed for testing, and should also be useful for building more generic initramfs images. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--conf/initramfs.conf9
-rwxr-xr-xhooks/fsck14
-rw-r--r--initramfs.conf.56
-rwxr-xr-xmkinitramfs1
4 files changed, 28 insertions, 2 deletions
diff --git a/conf/initramfs.conf b/conf/initramfs.conf
index 39874a8..5e30c0c 100644
--- a/conf/initramfs.conf
+++ b/conf/initramfs.conf
@@ -66,3 +66,12 @@ NFSROOT=auto
#
RUNSIZE=10%
+
+#
+# FSTYPE: ...
+#
+# The filesytem type(s) to support, or "auto" to use the current root
+# filesystem type
+#
+
+FSTYPE=auto
diff --git a/hooks/fsck b/hooks/fsck
index 5d2e94a..15127dd 100755
--- a/hooks/fsck
+++ b/hooks/fsck
@@ -64,8 +64,18 @@ get_fsck_type_fstab () {
}
get_fsck_types() {
- get_fsck_type_fstab / root
- get_fsck_type_fstab /usr /usr
+ if [ "${FSTYPE:-auto}" = auto ]; then
+ get_fsck_type_fstab / root
+ get_fsck_type_fstab /usr usr
+ else
+ local IFS=,
+ local fstype
+ set -f
+ for fstype in $FSTYPE; do
+ echo "$fstype"
+ done
+ set +f
+ fi
}
case $1 in
diff --git a/initramfs.conf.5 b/initramfs.conf.5
index e227151..4615892 100644
--- a/initramfs.conf.5
+++ b/initramfs.conf.5
@@ -93,6 +93,12 @@ or is set to \fIauto\fP,
will automatically select the largest available swap partition.
Set it to \fInone\fP to disable resume from disk.
+.TP
+\fB FSTYPE
+Specifies the filesystem type(s) to support, separated by commas. If
+this is not defined or is set to \fIauto\fP, \fBmkinitramfs\fP will
+automatically detect the current root and \fI/usr\fP filesystem types.
+
.SH VARIABLES FOR NFS BOOT
.TP
\fB DEVICE
diff --git a/mkinitramfs b/mkinitramfs
index 17d808e..3628990 100755
--- a/mkinitramfs
+++ b/mkinitramfs
@@ -247,6 +247,7 @@ export KEYMAP
export MODULES
export BUSYBOX
export RESUME
+export FSTYPE
# Private, used by 'catenate_cpiogz'.
export __TMPCPIOGZ