Releasing debian version 2.0~a7-1.
[debian-live-boot/hramrach.git] / hooks / live
blobcba7120e9c201e73627590380c4b38721967c1a6
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: cifs
88 if [ -x /sbin/mount.cifs ]
89 then
90 copy_exec /sbin/mount.cifs /sbin
91 manual_add_modules cifs
94 # Filesystem: ext3/ext4
95 manual_add_modules ext3
96 manual_add_modules ext4
98 # Filesystem: jffs2
99 manual_add_modules jffs2
101 if [ -x /usr/bin/rsync ]
102 then
103 copy_exec /usr/bin/rsync /bin
106 # Filesystem: squashfs
107 copy_exec /sbin/losetup /sbin
108 manual_add_modules loop
109 manual_add_modules squashfs
110 manual_add_modules sqlzma
111 manual_add_modules unlzma
113 # Filesystem: aufs/unionfs
114 manual_add_modules aufs
115 manual_add_modules unionfs
117 # Filesystem: unionfs-fuse
118 if [ -x /usr/bin/unionfs-fuse ]
119 then
120 copy_exec /usr/bin/unionfs-fuse /bin
123 # Filesystem: vfat
124 manual_add_modules nls_cp437
125 manual_add_modules nls_iso8859-1
126 manual_add_modules nls_utf8
127 manual_add_modules vfat
129 # Filesystem: ntfs
130 manual_add_modules ntfs
132 # Hardware: cdrom
133 manual_add_modules ide-cd
134 manual_add_modules ide-generic
135 manual_add_modules ohci1394
136 manual_add_modules sbp2
137 manual_add_modules sr_mod
139 # Hardware: usb
140 manual_add_modules sd_mod
142 # Hardware: network
143 auto_add_modules net
145 # Program: eject
146 if [ -x /usr/bin/eject ]
147 then
148 copy_exec /usr/bin/eject /bin
151 # Program: md5sum
152 copy_exec /usr/bin/md5sum /bin
154 # Program: cpio
155 # busybox and klibc lacks --no-absolute-filenames and --sparse, needed for snapshots
156 if [ -e "${DESTDIR}/bin/cpio" ]
157 then
158 # Override already present cpio's, mostly klibc's
159 rm "${DESTDIR}/bin/cpio"
161 copy_exec /bin/cpio /bin
163 # Program: udev
164 if [ -x /sbin/udevadm ]
165 then
166 # lenny
167 copy_exec /sbin/udevadm /sbin
168 else
169 # etch
170 copy_exec /sbin/udevtrigger /sbin
171 copy_exec /sbin/udevsettle /sbin
173 if [ -x /usr/bin/udevinfo ]
174 then
175 copy_exec /usr/bin/udevinfo /bin
178 # Program: wget
179 if [ -x /usr/bin/wget ]
180 then
181 copy_exec /usr/bin/wget /bin
184 # Program: blockdev
185 if [ -x /sbin/blockdev ]
186 then
187 copy_exec /sbin/blockdev /sbin
190 # FUSE kernel module
191 manual_add_modules fuse
193 # FUSE filesystem: httpfs2
194 if [ -x /usr/bin/httpfs2_ssl ]
195 then
196 copy_exec /usr/bin/httpfs2_ssl /bin/httpfs
197 elif [ -x /usr/bin/httpfs2 ]
198 then
199 copy_exec /usr/bin/httpfs2 /bin/httpfs
202 # FUSE filesystem: curlftpfs
203 if [ -x /usr/bin/curlftpfs ]
204 then
205 copy_exec /usr/bin/curlftpfs /bin
208 # iSCSI
209 if [ -x /usr/sbin/iscsistart ]
210 then
211 copy_exec /usr/sbin/iscsistart /bin
212 #manual_add_modules ib_iser
213 manual_add_modules iscsi_tcp
214 manual_add_modules crc32c