3 # initramfs hook for live-boot (Debian Live)
7 # initramfs-tools header
23 .
/usr
/share
/initramfs-tools
/hook-functions
27 # Reading configuration file from filesystem
28 if [ -e /etc
/live
/boot.conf
]
33 if ls /etc
/live
/boot.d
/* > /dev
/null
2>&1
35 for _FILE
in /etc
/live
/boot.d
/*
44 if [ -e /usr
/share
/live-boot
/languagelist
]
46 mkdir
-p "${DESTDIR}"/usr
/share
/live-boot
47 cp /usr
/share
/live-boot
/languagelist
"${DESTDIR}"/usr
/share
/live-boot
51 mkdir
-p "${DESTDIR}"/lib
/live-boot
54 copy_exec
/usr
/share
/live-boot
/live-reconfigure
/bin
55 copy_exec
/usr
/share
/live-boot
/live-preseed
/bin
58 cp /usr
/share
/initramfs-tools
/scripts
/live-functions
"${DESTDIR}"/scripts
59 cp /usr
/share
/initramfs-tools
/scripts
/live-helpers
"${DESTDIR}"/scripts
62 for FILE
in /lib
/libacl
* /lib
/libblkid
* /lib
/libuuid
* /lib
/libdevmapper
* /lib
/libattr
*
64 if [ ! -e "${DESTDIR}"/"${FILE}" ] && ls ${FILE} > /dev/null 2>&1
66 cp -a "${FILE}" "${DESTDIR}"/"${FILE}"
70 # udev dependencies (squeeze and newer)
71 for FILE in /lib/udev/*_id
73 if [ ! -e "${DESTDIR}/${FILE}" ]
75 mkdir -p "${DESTDIR}/lib
/udev
"
76 copy_exec "${FILE}" /lib/udev
80 if [ -e /lib/udev/rules.d/60-cdrom_id.rules ]
82 mkdir -p ${DESTDIR}/lib/udev/rules.d
83 cp -p /lib/udev/rules.d/60-cdrom_id.rules ${DESTDIR}/lib/udev/rules.d
86 # Handling other stuff
88 # Configuration: keymap (usefull when using encryption)
89 if [ -x /bin/loadkeys ] && [ -r /etc/console/boottime.kmap.gz ]
91 copy_exec /bin/loadkeys /bin
93 mkdir -p "${DESTDIR}"/etc
94 cp /etc/console/boottime.kmap.gz "${DESTDIR}"/etc
97 # Configuration: Unique ID
98 if [ -n "${LIVE_GENERATE_UUID}" ]
100 mkdir -p "${DESTDIR}"/conf
101 uuidgen -r > "${DESTDIR}"/conf/uuid.conf
105 manual_add_modules btrfs
108 if [ -x /sbin/mount.cifs ]
110 copy_exec /sbin/mount.cifs /sbin
111 manual_add_modules cifs
114 # Filesystem: ext3/ext4
115 manual_add_modules ext3
116 manual_add_modules ext4
119 manual_add_modules jffs2
121 if [ -x /usr/bin/rsync ]
123 copy_exec /usr/bin/rsync /bin
126 # Filesystem: squashfs
127 copy_exec /sbin/losetup /sbin
128 manual_add_modules loop
129 manual_add_modules squashfs
130 manual_add_modules sqlzma
131 manual_add_modules unlzma
133 # Filesystem: aufs/unionfs
134 manual_add_modules aufs
135 manual_add_modules unionfs
137 # Filesystem: unionfs-fuse
138 if [ -x /usr/bin/unionfs-fuse ]
140 copy_exec /usr/bin/unionfs-fuse /bin
144 manual_add_modules nls_cp437
145 manual_add_modules nls_iso8859-1
146 manual_add_modules nls_utf8
147 manual_add_modules vfat
150 manual_add_modules ntfs
153 manual_add_modules ide-cd
154 manual_add_modules ide-generic
155 manual_add_modules ohci1394
156 manual_add_modules sbp2
157 manual_add_modules sr_mod
160 manual_add_modules sd_mod
166 if [ -x /usr/bin/eject ]
168 copy_exec /usr/bin/eject /bin
172 copy_exec /usr/bin/md5sum /bin
175 if [ -x /usr/bin/memdiskfind ]
177 copy_exec /usr/bin/memdiskfind
178 manual_add_modules phram mtdblock
182 # busybox and klibc lacks --no-absolute-filenames and --sparse, needed for snapshots
183 if [ -e "${DESTDIR}/bin
/cpio" ]
185 # Override already present cpio's, mostly klibc's
186 rm "${DESTDIR}/bin
/cpio"
188 copy_exec /bin/cpio /bin
191 if [ -x /sbin/udevadm ]
193 copy_exec /sbin/udevadm /sbin
195 if [ -x /usr/bin/udevinfo ]
197 copy_exec /usr/bin/udevinfo /bin
201 if [ -x /usr/bin/wget ]
203 copy_exec /usr/bin/wget /bin
207 if [ -x /sbin/blockdev ]
209 copy_exec /sbin/blockdev /sbin
213 manual_add_modules fuse
215 # FUSE filesystem: httpfs2
216 if [ -x /usr/bin/httpfs2_ssl ]
218 copy_exec /usr/bin/httpfs2_ssl /bin/httpfs
219 elif [ -x /usr/bin/httpfs2 ]
221 copy_exec /usr/bin/httpfs2 /bin/httpfs
224 # FUSE filesystem: curlftpfs
225 if [ -x /usr/bin/curlftpfs ]
227 copy_exec /usr/bin/curlftpfs /bin
231 if [ -x /usr/sbin/iscsistart ]
233 copy_exec /usr/sbin/iscsistart /bin
234 #manual_add_modules ib_iser
235 manual_add_modules iscsi_tcp
236 manual_add_modules crc32c
239 if [ "${LIVE_DNS}" = "true
" ]
241 #copy_exec /lib/libnss_files.so.* /lib # /etc/hosts and /etc/passwd
242 copy_exec /lib/libnss_dns.so.* /lib # DNS server
243 #copy_exec /lib/libnss_compat.so.* /lib # /etc/passwd
245 # Configuration file - may be needed if /etc/hosts is used.
246 #mkdir -p $DESTDIR/etc
247 #cp -p /etc/nsswitch.conf $DESTDIR/etc
250 if [ "${LIVE_UNIONMOUNT}" = "true
" ]
253 # only mount from patched util-linux can do this currently
254 copy_exec /bin/mount /bin/mount_full