summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2013-08-15 10:56:31 +0200
committerHarald Hoyer <harald@redhat.com>2013-08-15 11:14:47 +0200
commit8df0b654dc761a6c9c84d25f9c6a458b52b0f82f (patch)
tree8a672d8689b1792b2a4f3368c416fb699941d281
parent97af51db9d167a3ab48fc24628dafb34ce2505aa (diff)
downloaddracut-8df0b654dc761a6c9c84d25f9c6a458b52b0f82f.tar.gz
dracut-8df0b654dc761a6c9c84d25f9c6a458b52b0f82f.tar.bz2
dracut-8df0b654dc761a6c9c84d25f9c6a458b52b0f82f.zip
rootfs-block: search all host_devs for a journal device
-rwxr-xr-xdracut.sh16
-rwxr-xr-xmodules.d/95rootfs-block/module-setup.sh36
2 files changed, 33 insertions, 19 deletions
diff --git a/dracut.sh b/dracut.sh
index 90605e1d..e690b4eb 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -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
diff --git a/modules.d/95rootfs-block/module-setup.sh b/modules.d/95rootfs-block/module-setup.sh
index d2e1019c..32eec4a4 100755
--- a/modules.d/95rootfs-block/module-setup.sh
+++ b/modules.d/95rootfs-block/module-setup.sh
@@ -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