initrd.scripts: use get_device_fstype to execute fstype specific init code

This logic replaces the old and buggy setup_btrfsctl code
master
Fabio Erculiani 12 years ago
parent 43a4651da2
commit 1ac43bf8a6

@ -1383,11 +1383,6 @@ cdupdate() {
fi fi
} }
setup_btrfsctl() {
# start BTRFS volume detection, if available
[ -x /sbin/btrfs ] && /sbin/btrfs device scan
}
setup_md_device() { setup_md_device() {
local device local device
@ -1925,6 +1920,16 @@ ensure_initramfs_mounts() {
done done
} }
fstype_init() {
local fstype="${1}"
if [ "${fstype}" = "btrfs" ]; then
# start BTRFS volume detection, if available
[ -x /sbin/btrfs ] && /sbin/btrfs device scan
elif [ -z "${fstype}" ]; then
warn_msg "Unable to detect the filesystem type of ${REAL_ROOT}"
fi
}
rootdev_init() { rootdev_init() {
good_msg "Initializing root device..." good_msg "Initializing root device..."
@ -2027,7 +2032,11 @@ rootdev_init() {
break break
fi fi
good_msg "Mounting $REAL_ROOT as root..." local fstype=$(get_device_fstype "${REAL_ROOT}")
good_msg "Initializing ${REAL_ROOT} if needed, detected fstype: ${fstype}"
fstype_init "${fstype}"
good_msg "Mounting ${REAL_ROOT} as root..."
if [ "${ROOTFSTYPE}" = 'zfs' ] if [ "${ROOTFSTYPE}" = 'zfs' ]
then then

@ -267,9 +267,6 @@ cd /
start_iscsi start_iscsi
# Setup btrfs, see bug 303529
setup_btrfsctl
# Setup md device nodes if they dont exist # Setup md device nodes if they dont exist
is_mdev && setup_md_device is_mdev && setup_md_device

Loading…
Cancel
Save