network: don't use "ifup -m"
[dracut.git] / modules.d / 98dracut-systemd / dracut-mount.sh
blob11ba7bcc682b4915c12bb4550c47eba264058d1d
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 mount" '1:shortmem' '2+:mem' '3+:slab'
12 getarg 'rd.break=mount' -d 'rdbreak=mount' && emergency_shell -n mount "Break mount"
13 # mount scripts actually try to mount the root filesystem, and may
14 # be sourced any number of times. As soon as one suceeds, no more are sourced.
15 i=0
16 while :; do
17 if ismounted "$NEWROOT"; then
18 usable_root "$NEWROOT" && break;
19 umount "$NEWROOT"
21 for f in $hookdir/mount/*.sh; do
22 [ -f "$f" ] && . "$f"
23 if ismounted "$NEWROOT"; then
24 usable_root "$NEWROOT" && break;
25 warn "$NEWROOT has no proper rootfs layout, ignoring and removing offending mount hook"
26 umount "$NEWROOT"
27 rm -f -- "$f"
29 done
31 i=$(($i+1))
32 [ $i -gt 20 ] && action_on_fail "Can't mount root filesystem" && break
33 done
35 export -p > /dracut-state.sh
37 exit 0