]> git.ipfire.org Git - thirdparty/dracut.git/blame - modules.d/91zipl/module-setup.sh
travis: reshuffle tests
[thirdparty/dracut.git] / modules.d / 91zipl / module-setup.sh
CommitLineData
ea7ffef1
HR
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# called by dracut
6check() {
7 local _arch=$(uname -m)
8 # Only for systems on s390 using indirect booting via userland grub
9 [ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1
10 # /boot/zipl contains a first stage kernel used to launch grub in initrd
11 [ -d /boot/zipl ] || return 1
12 return 0
13}
14
15# called by dracut
16depends() {
17 echo grub2
18 return 0
19}
20
21# called by dracut
22installkernel() {
403f2c3e
HR
23 local _boot_zipl
24
25 _boot_zipl=$(sed -n 's/\(.*\)\w*\/boot\/zipl.*/\1/p' /etc/fstab)
26 if [ -n "$_boot_zipl" ] ; then
27 eval $(blkid -s TYPE -o udev ${_boot_zipl})
28 if [ -n "$ID_FS_TYPE" ] ; then
29 case "$ID_FS_TYPE" in
30 ext?)
31 ID_FS_TYPE=ext4
32 ;;
33 esac
34 instmods ${ID_FS_TYPE}
35 fi
36 fi
ea7ffef1
HR
37}
38
39# called by dracut
40cmdline() {
41 local _boot_zipl
42
43 _boot_zipl=$(sed -n 's/\(.*\)\w*\/boot\/zipl.*/\1/p' /etc/fstab)
44 if [ -n "$_boot_zipl" ] ; then
45 echo "rd.zipl=${_boot_zipl}"
46 fi
47}
48
49# called by dracut
50install() {
51 inst_multiple mount umount
52
53 inst_hook cmdline 91 "$moddir/parse-zipl.sh"
d118e9d9 54 inst_script "${moddir}/install_zipl_cmdline.sh" /sbin/install_zipl_cmdline.sh
ea7ffef1
HR
55 if [[ $hostonly_cmdline == "yes" ]] ; then
56 local _zipl=$(cmdline)
57
73f89bba 58 [[ $_zipl ]] && printf "%s\n" "$_zipl" > "${initdir}/etc/cmdline.d/91zipl.conf"
ea7ffef1
HR
59 fi
60 dracut_need_initqueue
61}