Initial checkin
[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 # Handling other stuff
50
51 # Configuration: keymap (usefull when using encryption)
52 if [ -x /bin/loadkeys ] && [ -r /etc/console/boottime.kmap.gz ]
53 then
54         copy_exec /bin/loadkeys /bin
55
56         mkdir -p "${DESTDIR}"/etc
57         cp /etc/console/boottime.kmap.gz "${DESTDIR}"/etc
58 fi
59
60 # Configuration: Unique ID
61 if [ -n "${LIVE_GENERATE_UUID}" ]
62 then
63         mkdir -p "${DESTDIR}"/conf
64         uuidgen -r > "${DESTDIR}"/conf/uuid.conf
65 fi
66
67 # Filesystem: cifs
68 if [ -x /sbin/mount.cifs ]
69 then
70         copy_exec /sbin/mount.cifs /sbin
71         manual_add_modules cifs
72 fi
73
74 # Filesystem: ext3
75 manual_add_modules ext3
76
77 # Filesystem: squashfs
78 copy_exec /sbin/losetup /sbin
79 manual_add_modules loop
80 manual_add_modules squashfs
81
82 # Filesystem: unionfs/aufs
83 manual_add_modules unionfs
84 manual_add_modules aufs
85
86 # Filesystem: vfat
87 manual_add_modules nls_cp437
88 manual_add_modules nls_iso8859-1
89 manual_add_modules nls_utf8
90 manual_add_modules vfat
91
92 # Hardware: cdrom
93 manual_add_modules ide-cd
94 manual_add_modules ide-generic
95 manual_add_modules ohci1394
96 manual_add_modules sbp2
97 manual_add_modules sr_mod
98
99 # Hardware: network
100 auto_add_modules net
101
102 # Program: eject
103 if [ -x /usr/bin/eject ]
104 then
105         copy_exec /usr/bin/eject /bin
106 fi
107
108 # Program: md5sum
109 copy_exec /usr/bin/md5sum /bin
110
111 # Program: udev
112 copy_exec /sbin/udevtrigger /sbin
113 copy_exec /sbin/udevsettle /sbin
114 copy_exec /usr/bin/udevinfo /bin
115
116 # Program: wget
117 if [ -x /usr/bin/wget ]
118 then
119         copy_exec /usr/bin/wget /bin
120 fi