rootfs-block/module-setup.sh: find root btrfs subvolumes
If root is a btrfs subvolume, find it, if fstab is not usedmaster
parent
481ee9e6fc
commit
df1e8127da
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue