Support live-{top,premount,bottom} hooks
[live-boot-grml.git] / backend / initramfs-tools / live.script
1 # Live system filesystem mounting                       -*- shell-script -*-
2
3 . /bin/live-boot
4
5 live_top()
6 {
7         if [ "${live_top_used}" != "yes" ]; then
8                 [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/live-top"
9                 run_scripts /scripts/live-top
10                 [ "$quiet" != "y" ] && log_end_msg
11         fi
12         live_top_used=yes
13 }
14
15 live_premount()
16 {
17         if [ "${live_premount_used}" != "yes" ]; then
18                 [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/live-premount"
19                 run_scripts /scripts/live-premount
20                 [ "$quiet" != "y" ] && log_end_msg
21         fi
22         live_premount_used=yes
23 }
24
25 live_bottom()
26 {
27         if [ "${live_premount_used}" = "yes" ] || [ "${live_top_used}" = "yes" ]; then
28                 [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/live-bottom"
29                 run_scripts /scripts/live-bottom
30                 [ "$quiet" != "y" ] && log_end_msg
31         fi
32         live_premount_used=no
33         live_top_used=no
34 }
35
36
37 mountroot()
38 {
39         # initramfs-tools entry point for live-boot is mountroot(); function
40         Live
41 }
42
43 mount_top()
44 {
45         # Note, also called directly in case it's overridden.
46         live_top
47 }
48
49 mount_premount()
50 {
51         # Note, also called directly in case it's overridden.
52         live_premount
53 }
54
55 mount_bottom()
56 {
57         # Note, also called directly in case it's overridden.
58         live_bottom
59 }