Update debian/control
[live-initramfs-grml.git] / hooks / live
1 #!/bin/sh
2
3 # initramfs hook for live-initramfs (Debian Live)
4
5 set -e
6
7 # initramfs-tools header
8
9 PREREQ=""
10
11 prereqs()
12 {
13         echo "${PREREQ}"
14 }
15
16 case "${1}" in
17         prereqs)
18                 prereqs
19                 exit 0
20                 ;;
21 esac
22
23 . /usr/share/initramfs-tools/hook-functions
24
25 # live-initramfs hook
26
27 # Handling live-initramfs
28
29 # Configuration
30 if [ -r /etc/live.conf ]
31 then
32         . /etc/live.conf
33
34         mkdir -p "${DESTDIR}"/etc
35         cp /etc/live.conf "${DESTDIR}"/etc
36 fi
37
38 # Directories
39 mkdir -p "${DESTDIR}"/lib/live-initramfs
40
41 # Executables
42 copy_exec /usr/share/live-initramfs/live-reconfigure /bin
43 copy_exec /usr/share/live-initramfs/live-preseed /bin
44
45 # Scripts
46 cp /usr/share/initramfs-tools/scripts/live-functions "${DESTDIR}"/scripts
47 cp /usr/share/initramfs-tools/scripts/live-helpers "${DESTDIR}"/scripts
48
49 # klibc dependencies
50 for FILE in /lib/libacl* /lib/libblkid* /lib/libuuid* /lib/libdevmapper* /lib/libattr*
51 do
52         if [ ! -e "${DESTDIR}"/"${FILE}" ]
53         then
54                 cp -a "${FILE}" "${DESTDIR}"/"${FILE}"
55         fi
56 done
57
58 # Handling other stuff
59
60 # Configuration: keymap (usefull when using encryption)
61 if [ -x /bin/loadkeys ] && [ -r /etc/console/boottime.kmap.gz ]
62 then
63         copy_exec /bin/loadkeys /bin
64
65         mkdir -p "${DESTDIR}"/etc
66         cp /etc/console/boottime.kmap.gz "${DESTDIR}"/etc
67 fi
68
69 # Configuration: Unique ID
70 if [ -n "${LIVE_GENERATE_UUID}" ]
71 then
72         mkdir -p "${DESTDIR}"/conf
73         uuidgen -r > "${DESTDIR}"/conf/uuid.conf
74 fi
75
76 # Filesystem: cifs
77 if [ -x /sbin/mount.cifs ]
78 then
79         copy_exec /sbin/mount.cifs /sbin
80         manual_add_modules cifs
81 fi
82
83 # Filesystem: ext3
84 manual_add_modules ext3
85
86 # Filesystem: jffs2
87 manual_add_modules jffs2
88
89 # Filesystem: squashfs
90 copy_exec /sbin/losetup /sbin
91 manual_add_modules loop
92 manual_add_modules squashfs
93 manual_add_modules sqlzma
94 manual_add_modules unlzma
95
96 # Filesystem: aufs/unionfs
97 manual_add_modules aufs
98 manual_add_modules unionfs
99
100 # Filesystem: vfat
101 manual_add_modules nls_cp437
102 manual_add_modules nls_iso8859-1
103 manual_add_modules nls_utf8
104 manual_add_modules vfat
105
106 # Filesystem: ntfs
107 manual_add_modules ntfs
108
109 # Hardware: cdrom
110 manual_add_modules ide-cd
111 manual_add_modules ide-generic
112 manual_add_modules ohci1394
113 manual_add_modules sbp2
114 manual_add_modules sr_mod
115
116 # Hardware: usb
117 manual_add_modules sd_mod
118
119 # Hardware: network
120 auto_add_modules net
121
122 # Program: eject
123 if [ -x /usr/bin/eject ]
124 then
125         copy_exec /usr/bin/eject /bin
126 fi
127
128 # Program: md5sum
129 copy_exec /usr/bin/md5sum /bin
130
131 # Program: udev
132 if [ -x /sbin/udevadm ]
133 then
134         # lenny
135         copy_exec /sbin/udevadm /sbin
136 else
137         # etch
138         copy_exec /sbin/udevtrigger /sbin
139         copy_exec /sbin/udevsettle /sbin
140 fi
141 copy_exec /usr/bin/udevinfo /bin
142
143 # Program: wget
144 if [ -x /usr/bin/wget ]
145 then
146         copy_exec /usr/bin/wget /bin
147 fi
148
149 # FUSE kernel module
150 manual_add_modules fuse
151
152 # FUSE filesystem: httpfs2
153 if [ -x /usr/bin/httpfs2_ssl ]
154 then
155         copy_exec /usr/bin/httpfs2_ssl /bin/httpfs
156 elif [ -x /usr/bin/httpfs2 ]
157 then
158         copy_exec /usr/bin/httpfs2 /bin/httpfs
159 fi
160
161 # FUSE filesystem: curlftpfs
162 if [ -x /usr/bin/curlftpfs ]
163 then
164         copy_exec /usr/bin/curlftpfs /bin
165 fi