Adding upstream version 3.0~a5.
[debian-live-boot.git] / scripts / live-bottom / 24preseed
blob85c6494406ffd820838cce08b97e9e32a37aecfe
1 #!/bin/sh
3 #set -e
5 # initramfs-tools header
7 PREREQ=""
9 prereqs()
11 echo "${PREREQ}"
14 case "${1}" in
15 prereqs)
16 prereqs
17 exit 0
19 esac
21 # live-boot header
23 if [ -n "${NOPRESEED}" ]
24 then
25 exit 0
28 . /scripts/live-functions
30 log_begin_msg "Loading preseed file"
32 # live-boot script
34 if [ -e /preseed.cfg ]
35 then
36 chroot /root debconf-set-selections < /preseed.cfg
39 if [ -n "${LOCATIONS}" ]
40 then
41 for item in ${LOCATIONS}
43 chroot /root debconf-set-selections < "/root${item}"
44 done
47 if [ -n "${PRESEEDS}" ]
48 then
49 for preseed in ${PRESEEDS}
51 question="${preseed%%=*}"
52 value="${preseed#*=}"
54 live-preseed /root "${question}" "${value}"
55 done
58 reply="$(echo "GET preseed/early_command" | chroot /root debconf-communicate -fnoninteractive live-boot)"
60 if [ "${reply#0 }" != "${reply}" ]
61 then
62 reply="${reply#0 }"
63 sh -c "${reply}"
66 # Clear out debconf database backup files to save memory.
67 rm -f /root/var/cache/debconf/*.dat-old
69 log_end_msg
71 exit 0