]> git.ipfire.org Git - thirdparty/dracut.git/blame - modules.d/50plymouth/module-setup.sh
Renamed all shell scripts to *.sh
[thirdparty/dracut.git] / modules.d / 50plymouth / module-setup.sh
CommitLineData
95d2dabc
HH
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
5check() {
1b7fd0fa 6 [[ "$mount_needs" ]] && return 1
95d2dabc
HH
7 [[ -x /sbin/plymouthd && -x /bin/plymouth && -x /usr/sbin/plymouth-set-default-theme ]]
8}
9
10depends() {
11 return 0
12}
13
14installkernel() {
29b10e65 15 local _modname
95d2dabc 16 # Include KMS capable drm drivers
e38fcc86
JB
17 for _modname in $(find "$srcmods/kernel/drivers/gpu/drm" "$srcmods/extra" \( -name '*.ko' -o -name '*.ko.gz' -o -name '*.ko.xz' \) 2>/dev/null); do
18 case $_modname in
19 *.ko) grep -q drm_crtc_init $_modname ;;
20 *.ko.gz) zgrep -q drm_crtc_init $_modname ;;
21 *.ko.xz) xzgrep -q drm_crtc_init $_modname ;;
22 esac
23 if test $? -eq 0; then
5fae9d9a
AH
24 # if the hardware is present, include module even if it is not currently loaded,
25 # as we could e.g. be in the installer; nokmsboot boot parameter will disable
26 # loading of the driver if needed
27 if [[ $hostonly ]] && modinfo -F alias $_modname | sed -e 's,\?,\.,g' -e 's,\*,\.\*,g' \
28 | grep -qxf - /sys/bus/pci/devices/*/modalias; then
29 hostonly='' instmods $_modname
30 continue
31 fi
32 instmods $_modname
33 fi
95d2dabc
HH
34 done
35}
36
37install() {
38 if grep -q nash /usr/libexec/plymouth/plymouth-populate-initrd \
39 || ! grep -q PLYMOUTH_POPULATE_SOURCE_FUNCTIONS /usr/libexec/plymouth/plymouth-populate-initrd \
40 || [ ! -x /usr/libexec/plymouth/plymouth-populate-initrd ]; then
552ecca6 41 . "$moddir"/plymouth-populate-initrd.sh
95d2dabc
HH
42 else
43 PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="$dracutfunctions" \
44 /usr/libexec/plymouth/plymouth-populate-initrd -t $initdir
45 fi
46
47 inst_hook pre-pivot 90 "$moddir"/plymouth-newroot.sh
48 inst_hook pre-trigger 10 "$moddir"/plymouth-pretrigger.sh
49 inst_hook emergency 50 "$moddir"/plymouth-emergency.sh
50 inst readlink
51}
52