hooks: include jffs2 kernel module on initramfs image
[live-boot-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: jffs2
78 manual_add_modules jffs2
79
80 # Filesystem: squashfs
81 copy_exec /sbin/losetup /sbin
82 manual_add_modules loop
83 manual_add_modules squashfs
84
85 # Filesystem: unionfs/aufs
86 manual_add_modules unionfs
87 manual_add_modules aufs
88
89 # Filesystem: vfat
90 manual_add_modules nls_cp437
91 manual_add_modules nls_iso8859-1
92 manual_add_modules nls_utf8
93 manual_add_modules vfat
94
95 # Hardware: cdrom
96 manual_add_modules ide-cd
97 manual_add_modules ide-generic
98 manual_add_modules ohci1394
99 manual_add_modules sbp2
100 manual_add_modules sr_mod
101
102 # Hardware: network
103 auto_add_modules net
104
105 # Program: eject
106 if [ -x /usr/bin/eject ]
107 then
108         copy_exec /usr/bin/eject /bin
109 fi
110
111 # Program: md5sum
112 copy_exec /usr/bin/md5sum /bin
113
114 # Program: udev
115 copy_exec /sbin/udevtrigger /sbin
116 copy_exec /sbin/udevsettle /sbin
117 copy_exec /usr/bin/udevinfo /bin
118
119 # Program: wget
120 if [ -x /usr/bin/wget ]
121 then
122         copy_exec /usr/bin/wget /bin
123 fi