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>
This commit is contained in:
Ben Hutchings 2018-07-27 11:21:20 +08:00 committed by Ben Hutchings
parent 9877542bcf
commit 4309c3bcd9
4 changed files with 28 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -247,6 +247,7 @@ export KEYMAP
export MODULES
export BUSYBOX
export RESUME
export FSTYPE
# Private, used by 'catenate_cpiogz'.
export __TMPCPIOGZ