rootfs-block/module-setup.sh: check root_devs in cmdline_rootfs()
In case of "--no-hostonly-default-device", we do not need the root device, thus add this check. Also fixed the stale "root_dev" export. Signed-off-by: Xunlei Pang <xlpang@redhat.com>master
parent
37f2fe55d1
commit
5634a31156
|
|
@ -1307,7 +1307,7 @@ export initdir dracutbasedir \
|
||||||
dracutmodules force_add_dracutmodules add_dracutmodules omit_dracutmodules \
|
dracutmodules force_add_dracutmodules add_dracutmodules omit_dracutmodules \
|
||||||
mods_to_load \
|
mods_to_load \
|
||||||
fw_dir drivers_dir debug no_kernel kernel_only \
|
fw_dir drivers_dir debug no_kernel kernel_only \
|
||||||
omit_drivers mdadmconf lvmconf root_dev \
|
omit_drivers mdadmconf lvmconf root_devs \
|
||||||
use_fstab fstab_lines libdirs fscks nofscks ro_mnt \
|
use_fstab fstab_lines libdirs fscks nofscks ro_mnt \
|
||||||
stdloglvl sysloglvl fileloglvl kmsgloglvl logfile \
|
stdloglvl sysloglvl fileloglvl kmsgloglvl logfile \
|
||||||
debug host_fs_types host_devs swap_devs sshkey add_fstab \
|
debug host_fs_types host_devs swap_devs sshkey add_fstab \
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,12 @@ cmdline_journal() {
|
||||||
cmdline_rootfs() {
|
cmdline_rootfs() {
|
||||||
local _dev=/dev/block/$(find_root_block_device)
|
local _dev=/dev/block/$(find_root_block_device)
|
||||||
local _fstype _flags _subvol
|
local _fstype _flags _subvol
|
||||||
|
|
||||||
|
# "--no-hostonly-default-device" can result in empty root_devs
|
||||||
|
if [ "${#root_devs[@]}" -eq 0 ]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -e $_dev ]; then
|
if [ -e $_dev ]; then
|
||||||
printf " root=%s" "$(shorten_persistent_dev "$(get_persistent_dev "$_dev")")"
|
printf " root=%s" "$(shorten_persistent_dev "$(get_persistent_dev "$_dev")")"
|
||||||
_fstype="$(find_mp_fstype /)"
|
_fstype="$(find_mp_fstype /)"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue