-
Notifications
You must be signed in to change notification settings - Fork 247
/
220_load_modules_from_initrd.sh
42 lines (38 loc) · 1.3 KB
/
220_load_modules_from_initrd.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Modules loaded in the initrd should be also loaded in the rescue system
# It is important to load them in the same order to ensure the correct order of SCSI controllers
#
# We keep here all different types of initrd module configurations in a single script because
# distros switch tooling (e.g. SUSE adopted dracut) and otherwise we would end up with several
# symlinks.
# Old SUSE style
if test -s /etc/sysconfig/kernel ; then
MODULES_LOAD+=(
$(
INITRD_MODULES=
source /etc/sysconfig/kernel
echo $INITRD_MODULES
)
)
fi
# Fedora, Red Hat & new SUSE uses dracut
if test -s /etc/dracut.conf ; then
MODULES_LOAD+=(
$(
add_drivers=
source /etc/dracut.conf
for s in /etc/dracut.conf.d/*.conf ; do
source $s
done
echo $add_drivers
)
)
fi
# Debian & Ubuntu use initramfs-tools and we include that as-is in 400_copy_modules.sh because we just
# append the initrd modules file to the general modules file. Nevertheless we must ensure that those
# modules are actually included in the rescue system
if test -s /etc/initramfs-tools/modules ; then
MODULES_LOAD+=(
$( sed -n -e 's/^\([A-Za-z0-9_-]\+\).*/\1/p' < /etc/initramfs-tools/modules )
)
fi
: # set 0 as return value