Merging casper 1.216.
[live-boot-grml.git] / scripts / live-bottom / 24preseed
1 #!/bin/sh
2
3 #set -e
4
5 # initramfs-tools header
6
7 PREREQ=""
8
9 prereqs()
10 {
11         echo "${PREREQ}"
12 }
13
14 case "${1}" in
15         prereqs)
16                 prereqs
17                 exit 0
18                 ;;
19 esac
20
21 # live-initramfs header
22
23 if [ -n "${NOPRESEED}" ]
24 then
25         exit 0
26 fi
27
28 . /scripts/live-functions
29 load_confmodule
30
31 log_begin_msg "Loading preseed file"
32
33 # live-initramfs script
34
35 if [ -e /preseed.cfg ]
36 then
37         live-set-selections /preseed.cfg
38 fi
39
40 if [ -n "${LOCATIONS}" ]
41 then
42         for item in ${LOCATIONS}
43         do
44                 live-set-selections "/root$item"
45         done
46 fi
47
48 if [ -n "${PRESEEDS}" ]
49 then
50         for preseed in ${PRESEEDS}
51         do
52                 question="${preseed%%=*}"
53                 value="${preseed#*=}"
54
55                 live-preseed /root "${question}" "${value}"
56         done
57 fi
58
59 if db_get preseed/early_command && [ "$RET" ]
60 then
61         sh -c "$RET"
62 fi
63
64 # Clear out debconf database backup files to save memory.
65 rm -f /root/var/cache/debconf/*.dat-old
66
67 log_end_msg
68
69 exit 0