rootfs-block: search all host_devs for a journal device

master
Harald Hoyer 2013-08-15 10:56:31 +02:00
parent 97af51db9d
commit 8df0b654dc
2 changed files with 33 additions and 19 deletions

View File

@ -938,6 +938,22 @@ for dev in ${host_devs[@]}; do
check_block_and_slaves_all _get_fs_type "$(get_maj_min "$dev")"
done

for dev in "${!host_fs_types[@]}"; do
[[ ${host_fs_types[$dev]} = "reiserfs" ]] || [[ ${host_fs_types[$dev]} = "xfs" ]] || continue
rootopts=$(find_dev_fsopts "$dev")
if [[ ${host_fs_types[$dev]} = "reiserfs" ]]; then
journaldev=$(fs_get_option $rootopts "jdev")
elif [[ ${host_fs_types[$dev]} = "xfs" ]]; then
journaldev=$(fs_get_option $rootopts "logdev")
fi
if [[ $journaldev ]]; then
dev="$(readlink -f "$dev")"
push host_devs "$dev"
_get_fs_type "$dev"
check_block_and_slaves_all _get_fs_type "$(get_maj_min "$dev")"
fi
done

[[ -d $udevdir ]] \
|| udevdir="$(pkg-config udev --variable=udevdir 2>/dev/null)"
if ! [[ -d "$udevdir" ]]; then

View File

@ -3,25 +3,6 @@
# ex: ts=8 sw=4 sts=4 et filetype=sh

check() {
rootopts="defaults"
while read dev mp fs opts dump fsck; do
# skip comments
[ "${dev%%#*}" != "$dev" ] && continue

if [ "$mp" = "/" ]; then
# sanity - determine/fix fstype
rootfs=$(find_mp_fstype /)
rootfs=${rootfs:-$fs}
rootopts=$opts
break
fi
done < /etc/fstab

[ "$rootfs" = "reiserfs" ] && journaldev=$(fs_get_option $rootopts "jdev")
[ "$rootfs" = "xfs" ] && journaldev=$(fs_get_option $rootopts "logdev")
if [ -n "$journaldev" ]; then
echo "root.journaldev=$journaldev" >> "${initdir}/etc/cmdline.d/95root-jurnaldev.conf"
fi
return 0
}

@ -30,6 +11,23 @@ depends() {
}

install() {

if [[ $hostonly ]]; then
for dev in "${!host_fs_types[@]}"; do
[[ ${host_fs_types[$dev]} = "reiserfs" ]] || [[ ${host_fs_types[$dev]} = "xfs" ]] || continue
rootopts=$(find_dev_fsopts "$dev")
if [[ ${host_fs_types[$dev]} = "reiserfs" ]]; then
journaldev=$(fs_get_option $rootopts "jdev")
elif [[ ${host_fs_types[$dev]} = "xfs" ]]; then
journaldev=$(fs_get_option $rootopts "logdev")
fi

if [ -n "$journaldev" ]; then
echo "root.journaldev=$journaldev" >> "${initdir}/etc/cmdline.d/95root-journaldev.conf"
fi
done
fi

inst_multiple umount
inst_multiple tr
if ! dracut_module_included "systemd"; then