network: don't use "ifup -m"
[dracut.git] / modules.d / 98dracut-systemd / dracut-pre-udev.sh
blobca130482c2ff88b822902d83d4434133f586ebed
1 #!/bin/sh
2 export DRACUT_SYSTEMD=1
3 if [ -f /dracut-state.sh ]; then
4 . /dracut-state.sh 2>/dev/null
5 fi
6 type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
8 source_conf /etc/conf.d
10 make_trace_mem "hook pre-udev" '1:shortmem' '2+:mem' '3+:slab'
11 # pre pivot scripts are sourced just before we doing cleanup and switch over
12 # to the new root.
13 getarg 'rd.break=pre-udev' 'rdbreak=pre-udev' && emergency_shell -n pre-udev "Break pre-udev"
14 source_hook pre-udev
16 _modprobe_d=/etc/modprobe.d
17 if [ -d /usr/lib/modprobe.d ] ; then
18 _modprobe_d=/usr/lib/modprobe.d
19 elif [ -d /lib/modprobe.d ] ; then
20 _modprobe_d=/lib/modprobe.d
21 elif [ ! -d $_modprobe_d ] ; then
22 mkdir -p $_modprobe_d
25 for i in $(getargs rd.driver.pre -d rdloaddriver=); do
27 IFS=,
28 for p in $i; do
29 modprobe $p 2>&1 | vinfo
30 done
32 done
35 [ -d /etc/modprobe.d ] || mkdir -p /etc/modprobe.d
37 for i in $(getargs rd.driver.blacklist -d rdblacklist=); do
39 IFS=,
40 for p in $i; do
41 echo "blacklist $p" >> $_modprobe_d/initramfsblacklist.conf
42 done
44 done
46 for p in $(getargs rd.driver.post -d rdinsmodpost=); do
47 echo "blacklist $p" >> $_modprobe_d/initramfsblacklist.conf
48 _do_insmodpost=1
49 done
51 [ -n "$_do_insmodpost" ] && initqueue --settled --unique --onetime insmodpost.sh
52 unset _do_insmodpost _modprobe_d
53 unset i
55 export -p > /dracut-state.sh
56 exit 0