]> git.ipfire.org Git - thirdparty/dracut.git/blob - modules.d/95rootfs-block/module-setup.sh
6792f1d325c963f105b7d62bd1cf5949ff9c62ca
[thirdparty/dracut.git] / modules.d / 95rootfs-block / module-setup.sh
1 #!/bin/bash
2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
4
5 check() {
6 return 0
7 }
8
9 depends() {
10 echo fs-lib
11 }
12
13 cmdline() {
14 local dev=/dev/block/$(find_root_block_device)
15 if [ -e $dev ]; then
16 printf " root=%s" $(get_persistent_dev "$dev")
17 printf " rootflags=%s" $(find_mp_fsopts /)
18 printf " rootfstype=%s" $(find_mp_fstype /)
19 fi
20 }
21
22 install() {
23
24 if [[ $hostonly ]]; then
25 for dev in "${!host_fs_types[@]}"; do
26 [[ ${host_fs_types[$dev]} = "reiserfs" ]] || [[ ${host_fs_types[$dev]} = "xfs" ]] || continue
27 rootopts=$(find_dev_fsopts "$dev")
28 if [[ ${host_fs_types[$dev]} = "reiserfs" ]]; then
29 journaldev=$(fs_get_option $rootopts "jdev")
30 elif [[ ${host_fs_types[$dev]} = "xfs" ]]; then
31 journaldev=$(fs_get_option $rootopts "logdev")
32 fi
33
34 if [ -n "$journaldev" ]; then
35 echo "root.journaldev=$journaldev" >> "${initdir}/etc/cmdline.d/95root-journaldev.conf"
36 fi
37 done
38 fi
39
40 inst_multiple umount
41 inst_multiple tr
42 if ! dracut_module_included "systemd"; then
43 inst_hook cmdline 95 "$moddir/parse-block.sh"
44 inst_hook pre-udev 30 "$moddir/block-genrules.sh"
45 inst_hook mount 99 "$moddir/mount-root.sh"
46 fi
47 }
48