dracut-systemd/dracut-initqueue: only start service if really needed
[dracut.git] / modules.d / 98dracut-systemd / dracut-pre-pivot.sh
bloba07cf3e02db7b2bc0937d34cd70dcb094aa403b1
1 #!/bin/sh
3 export DRACUT_SYSTEMD=1
4 if [ -f /dracut-state.sh ]; then
5 . /dracut-state.sh 2>/dev/null
6 fi
7 type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
9 source_conf /etc/conf.d
11 make_trace_mem "hook pre-pivot" '1:shortmem' '2+:mem' '3+:slab'
12 # pre pivot scripts are sourced just before we doing cleanup and switch over
13 # to the new root.
14 getarg 'rd.break=pre-pivot' 'rdbreak=pre-pivot' && emergency_shell -n pre-pivot "Break pre-pivot"
15 source_hook pre-pivot
17 # pre pivot cleanup scripts are sourced just before we switch over to the new root.
18 getarg 'rd.break=cleanup' 'rdbreak=cleanup' && emergency_shell -n cleanup "Break cleanup"
19 source_hook cleanup
21 getarg rd.break -d rdbreak && emergency_shell -n switch_root "Break before switch_root"
23 # remove helper symlink
24 [ -h /dev/root ] && rm -f -- /dev/root
25 [ -h /dev/nfs ] && rm -f -- /dev/nfs
27 exit 0