Updating package to standards version 3.9.0.
[debian-live-boot/hramrach.git] / hooks / live
blob16a2d0cd4c99c17a097fa5c5e2636e818e856c36
1 #!/bin/sh
3 # initramfs hook for live-boot (Debian Live)
5 set -e
7 # initramfs-tools header
9 PREREQ=""
11 prereqs()
13 echo "${PREREQ}"
16 case "${1}" in
17 prereqs)
18 prereqs
19 exit 0
21 esac
23 . /usr/share/initramfs-tools/hook-functions
25 # live-boot hook
27 # Handling live-boot
29 # Configuration
30 mkdir -p "${DESTDIR}"/usr/share/live-boot
31 cp /usr/share/live-boot/languagelist "${DESTDIR}"/usr/share/live-boot
33 # Directories
34 mkdir -p "${DESTDIR}"/lib/live-boot
36 # Executables
37 copy_exec /usr/share/live-boot/live-reconfigure /bin
38 copy_exec /usr/share/live-boot/live-preseed /bin
40 # Scripts
41 cp /usr/share/initramfs-tools/scripts/live-functions "${DESTDIR}"/scripts
42 cp /usr/share/initramfs-tools/scripts/live-helpers "${DESTDIR}"/scripts
44 # klibc dependencies
45 for FILE in /lib/libacl* /lib/libblkid* /lib/libuuid* /lib/libdevmapper* /lib/libattr*
47 if [ ! -e "${DESTDIR}"/"${FILE}" ]
48 then
49 cp -a "${FILE}" "${DESTDIR}"/"${FILE}"
51 done
53 # udev dependencies (squeeze and newer)
54 for FILE in /lib/udev/*_id
56 if [ ! -e "${DESTDIR}/${FILE}" ]
57 then
58 mkdir -p "${DESTDIR}/lib/udev"
59 copy_exec "${FILE}" /lib/udev
61 done
63 if [ -e /lib/udev/rules.d/60-cdrom_id.rules ]
64 then
65 mkdir -p ${DESTDIR}/lib/udev/rules.d
66 cp -p /lib/udev/rules.d/60-cdrom_id.rules ${DESTDIR}/lib/udev/rules.d
69 # Handling other stuff
71 # Configuration: keymap (usefull when using encryption)
72 if [ -x /bin/loadkeys ] && [ -r /etc/console/boottime.kmap.gz ]
73 then
74 copy_exec /bin/loadkeys /bin
76 mkdir -p "${DESTDIR}"/etc
77 cp /etc/console/boottime.kmap.gz "${DESTDIR}"/etc
80 # Configuration: Unique ID
81 if [ -n "${LIVE_GENERATE_UUID}" ]
82 then
83 mkdir -p "${DESTDIR}"/conf
84 uuidgen -r > "${DESTDIR}"/conf/uuid.conf
87 # Filesystem: btrfs
88 manual_add_modules btrfs
90 # Filesystem: cifs
91 if [ -x /sbin/mount.cifs ]
92 then
93 copy_exec /sbin/mount.cifs /sbin
94 manual_add_modules cifs
97 # Filesystem: ext3/ext4
98 manual_add_modules ext3
99 manual_add_modules ext4
101 # Filesystem: jffs2
102 manual_add_modules jffs2
104 if [ -x /usr/bin/rsync ]
105 then
106 copy_exec /usr/bin/rsync /bin
109 # Filesystem: squashfs
110 copy_exec /sbin/losetup /sbin
111 manual_add_modules loop
112 manual_add_modules squashfs
113 manual_add_modules sqlzma
114 manual_add_modules unlzma
116 # Filesystem: aufs/unionfs
117 manual_add_modules aufs
118 manual_add_modules unionfs
120 # Filesystem: unionfs-fuse
121 if [ -x /usr/bin/unionfs-fuse ]
122 then
123 copy_exec /usr/bin/unionfs-fuse /bin
126 # Filesystem: vfat
127 manual_add_modules nls_cp437
128 manual_add_modules nls_iso8859-1
129 manual_add_modules nls_utf8
130 manual_add_modules vfat
132 # Filesystem: ntfs
133 manual_add_modules ntfs
135 # Hardware: cdrom
136 manual_add_modules ide-cd
137 manual_add_modules ide-generic
138 manual_add_modules ohci1394
139 manual_add_modules sbp2
140 manual_add_modules sr_mod
142 # Hardware: usb
143 manual_add_modules sd_mod
145 # Hardware: network
146 auto_add_modules net
148 # Program: eject
149 if [ -x /usr/bin/eject ]
150 then
151 copy_exec /usr/bin/eject /bin
154 # Program: md5sum
155 copy_exec /usr/bin/md5sum /bin
157 # Program: memdisk
158 if [ -x /usr/bin/memdiskfind ]
159 then
160 copy_exec /usr/bin/memdiskfind
161 manual_add_modules phram mtdblock
164 # Program: cpio
165 # busybox and klibc lacks --no-absolute-filenames and --sparse, needed for snapshots
166 if [ -e "${DESTDIR}/bin/cpio" ]
167 then
168 # Override already present cpio's, mostly klibc's
169 rm "${DESTDIR}/bin/cpio"
171 copy_exec /bin/cpio /bin
173 # Program: udev
174 if [ -x /sbin/udevadm ]
175 then
176 # lenny
177 copy_exec /sbin/udevadm /sbin
178 else
179 # etch
180 copy_exec /sbin/udevtrigger /sbin
181 copy_exec /sbin/udevsettle /sbin
183 if [ -x /usr/bin/udevinfo ]
184 then
185 copy_exec /usr/bin/udevinfo /bin
188 # Program: wget
189 if [ -x /usr/bin/wget ]
190 then
191 copy_exec /usr/bin/wget /bin
194 # Program: blockdev
195 if [ -x /sbin/blockdev ]
196 then
197 copy_exec /sbin/blockdev /sbin
200 # FUSE kernel module
201 manual_add_modules fuse
203 # FUSE filesystem: httpfs2
204 if [ -x /usr/bin/httpfs2_ssl ]
205 then
206 copy_exec /usr/bin/httpfs2_ssl /bin/httpfs
207 elif [ -x /usr/bin/httpfs2 ]
208 then
209 copy_exec /usr/bin/httpfs2 /bin/httpfs
212 # FUSE filesystem: curlftpfs
213 if [ -x /usr/bin/curlftpfs ]
214 then
215 copy_exec /usr/bin/curlftpfs /bin
218 # iSCSI
219 if [ -x /usr/sbin/iscsistart ]
220 then
221 copy_exec /usr/sbin/iscsistart /bin
222 #manual_add_modules ib_iser
223 manual_add_modules iscsi_tcp
224 manual_add_modules crc32c