rootfs-block/module-setup.sh: find root btrfs subvolumes

If root is a btrfs subvolume, find it, if fstab is not used
master
Harald Hoyer 2015-03-19 12:34:20 +01:00
parent 481ee9e6fc
commit df1e8127da
1 changed files with 13 additions and 5 deletions

View File

@ -30,11 +30,19 @@ cmdline_journal() {
}

cmdline_rootfs() {
local dev=/dev/block/$(find_root_block_device)
if [ -e $dev ]; then
printf " root=%s" "$(shorten_persistent_dev "$(get_persistent_dev "$dev")")"
printf " rootflags=%s" "$(find_mp_fsopts /)"
printf " rootfstype=%s" "$(find_mp_fstype /)"
local _dev=/dev/block/$(find_root_block_device)
local _fstype _flags _subvol
if [ -e $_dev ]; then
printf " root=%s" "$(shorten_persistent_dev "$(get_persistent_dev "$_dev")")"
_fstype="$(find_mp_fstype /)"
_flags="$(find_mp_fsopts /)"
printf " rootfstype=%s" "$_fstype"
if [[ $use_fstab != yes ]] && [[ $_fstype = btrfs ]]; then
_subvol=$(findmnt -e -v -n -o FSROOT --target /) \
&& _subvol=${_subvol#/}
_flags="$_flags,${_subvol:+subvol=$_subvol}"
fi
printf " rootflags=%s" "${_flags#,}"
fi
}