Browse Source

rootfs-block/module-setup.sh: add support for xfs / reiserfs separate journal device

xfs and reiserfs (among other) supports storing journal data to a
separate device. Unfortunately, XFS requires this information to boot
properly (reiserfs can embed the information in its metadata but you
might want to override it).

Frederic Crozat <fcrozat@suse.com>
master
Harald Hoyer 13 years ago
parent
commit
3cc4c8ba9b
  1. 41
      modules.d/95rootfs-block/module-setup.sh

41
modules.d/95rootfs-block/module-setup.sh

@ -2,6 +2,47 @@ @@ -2,6 +2,47 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh

search_option() {
rootopts=$1
option=$2
local OLDIFS="$IFS"
IFS=,
set -- $rootopts
IFS="$OLDIFS"
while [ $# -gt 0 ]; do
case $1 in
$option=*)
echo ${1#${option}=}
break
esac
shift
done
}

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 < "$NEWROOT/etc/fstab"

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

}

depends() {
echo fs-lib
}

Loading…
Cancel
Save