1 |
commit: fc98fa9d89319e7705a393a739b99f994e12420b |
2 |
Author: Richard Yao <ryao <AT> cs <DOT> stonybrook <DOT> edu> |
3 |
AuthorDate: Sat Jan 28 18:57:11 2012 +0000 |
4 |
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Feb 6 08:19:17 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=fc98fa9d |
7 |
|
8 |
Implement ZFS Support |
9 |
|
10 |
This provides ZFS support, to go with the sys-fs/zfs package. |
11 |
|
12 |
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> (cleanups) |
13 |
|
14 |
--- |
15 |
ChangeLog | 10 ++++++ |
16 |
arch/alpha/modules_load | 2 +- |
17 |
arch/arm/modules_load | 2 +- |
18 |
arch/ia64/modules_load | 2 +- |
19 |
arch/mips/modules_load | 2 +- |
20 |
arch/parisc/modules_load | 2 +- |
21 |
arch/parisc64/modules_load | 2 +- |
22 |
arch/ppc/modules_load | 2 +- |
23 |
arch/ppc64/modules_load | 2 +- |
24 |
arch/sparc/modules_load | 2 +- |
25 |
arch/sparc64/modules_load | 2 +- |
26 |
arch/um/modules_load | 2 +- |
27 |
arch/x86/modules_load | 2 +- |
28 |
arch/x86_64/modules_load | 2 +- |
29 |
defaults/busy-config | 2 +- |
30 |
defaults/initrd.scripts | 5 +++ |
31 |
defaults/linuxrc | 71 +++++++++++++++++++++++++++++++++++++++++-- |
32 |
defaults/modules_load | 2 +- |
33 |
doc/genkernel.8.txt | 8 +++++ |
34 |
gen_cmdline.sh | 6 ++++ |
35 |
gen_determineargs.sh | 1 + |
36 |
gen_initramfs.sh | 27 ++++++++++++++++ |
37 |
genkernel | 2 + |
38 |
23 files changed, 141 insertions(+), 19 deletions(-) |
39 |
|
40 |
diff --git a/ChangeLog b/ChangeLog |
41 |
index 6c2a7d7..d6e4dcf 100644 |
42 |
--- a/ChangeLog |
43 |
+++ b/ChangeLog |
44 |
@@ -5,6 +5,16 @@ |
45 |
# Distributed under the GPL v2 |
46 |
# $Id$ |
47 |
|
48 |
+ 06 Feb 2012: Richard Yao <ryao@×××××××××××××.edu> arch/alpha/modules_load, |
49 |
+ arch/arm/modules_load, arch/ia64/modules_load, arch/mips/modules_load, |
50 |
+ arch/parisc/modules_load, arch/parisc64/modules_load, arch/ppc/modules_load, |
51 |
+ arch/ppc64/modules_load, arch/sparc/modules_load, arch/sparc64/modules_load, |
52 |
+ arch/um/modules_load, arch/x86/modules_load, arch/x86_64/modules_load, |
53 |
+ defaults/busy-config, defaults/initrd.scripts, defaults/linuxrc, |
54 |
+ defaults/modules_load, doc/genkernel.8.txt, gen_cmdline.sh, |
55 |
+ gen_determineargs.sh, gen_initramfs.sh, genkernel: |
56 |
+ This provides ZFS support, to go with the sys-fs/zfs package. |
57 |
+ |
58 |
06 Feb 2012; Robin H. Johnson <robbat2@g.o> gen_initramfs.sh: |
59 |
Refactor copy_binaries and multipath slightly for ease of usage and readability. |
60 |
|
61 |
|
62 |
diff --git a/arch/alpha/modules_load b/arch/alpha/modules_load |
63 |
index 2aeb5c1..6d7dfbf 100644 |
64 |
--- a/arch/alpha/modules_load |
65 |
+++ b/arch/alpha/modules_load |
66 |
@@ -24,5 +24,5 @@ MODULES_PCMCIA="pcmcia pcmcia_core yenta_socket pd6729 i82092 i82365 tcic ds ide |
67 |
MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd usbhid sl811-hcd hid-a4tech hid-apple hid-belkin hid-cherry hid-chicony hid-cypress hid-dummy hid-ezkey hid-gyration hid-logitech hid-microsoft hid-monterey hid-petalynx hid-pl hid-samsung hid-sony hid-sunplus" |
68 |
|
69 |
# Filesystems |
70 |
-MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs fuse" |
71 |
+MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse" |
72 |
|
73 |
|
74 |
diff --git a/arch/arm/modules_load b/arch/arm/modules_load |
75 |
index a4c5f51..616caaf 100644 |
76 |
--- a/arch/arm/modules_load |
77 |
+++ b/arch/arm/modules_load |
78 |
@@ -21,5 +21,5 @@ MODULES_PCMCIA="pcmcia pcmcia_core yenta_socket pd6729 i82092 i82365 tcic ds ide |
79 |
MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd usbhid sl811-hcd hid-a4tech hid-apple hid-belkin hid-cherry hid-chicony hid-cypress hid-dummy hid-ezkey hid-gyration hid-logitech hid-microsoft hid-monterey hid-petalynx hid-pl hid-samsung hid-sony hid-sunplus" |
80 |
|
81 |
# Filesystems |
82 |
-MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs fuse" |
83 |
+MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse" |
84 |
|
85 |
|
86 |
diff --git a/arch/ia64/modules_load b/arch/ia64/modules_load |
87 |
index 971484c..aa9ae31 100644 |
88 |
--- a/arch/ia64/modules_load |
89 |
+++ b/arch/ia64/modules_load |
90 |
@@ -24,4 +24,4 @@ MODULES_PCMCIA="pcmcia pcmcia_core yenta_socket pd6729 i82092 i82365 tcic ds ide |
91 |
MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd usbhid sl811-hcd hid-a4tech hid-apple hid-belkin hid-cherry hid-chicony hid-cypress hid-dummy hid-ezkey hid-gyration hid-logitech hid-microsoft hid-monterey hid-petalynx hid-pl hid-samsung hid-sony hid-sunplus" |
92 |
|
93 |
# Filesystems |
94 |
-MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs fuse" |
95 |
+MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse" |
96 |
|
97 |
diff --git a/arch/mips/modules_load b/arch/mips/modules_load |
98 |
index 2aeb5c1..6d7dfbf 100644 |
99 |
--- a/arch/mips/modules_load |
100 |
+++ b/arch/mips/modules_load |
101 |
@@ -24,5 +24,5 @@ MODULES_PCMCIA="pcmcia pcmcia_core yenta_socket pd6729 i82092 i82365 tcic ds ide |
102 |
MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd usbhid sl811-hcd hid-a4tech hid-apple hid-belkin hid-cherry hid-chicony hid-cypress hid-dummy hid-ezkey hid-gyration hid-logitech hid-microsoft hid-monterey hid-petalynx hid-pl hid-samsung hid-sony hid-sunplus" |
103 |
|
104 |
# Filesystems |
105 |
-MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs fuse" |
106 |
+MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse" |
107 |
|
108 |
|
109 |
diff --git a/arch/parisc/modules_load b/arch/parisc/modules_load |
110 |
index 2aeb5c1..6d7dfbf 100644 |
111 |
--- a/arch/parisc/modules_load |
112 |
+++ b/arch/parisc/modules_load |
113 |
@@ -24,5 +24,5 @@ MODULES_PCMCIA="pcmcia pcmcia_core yenta_socket pd6729 i82092 i82365 tcic ds ide |
114 |
MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd usbhid sl811-hcd hid-a4tech hid-apple hid-belkin hid-cherry hid-chicony hid-cypress hid-dummy hid-ezkey hid-gyration hid-logitech hid-microsoft hid-monterey hid-petalynx hid-pl hid-samsung hid-sony hid-sunplus" |
115 |
|
116 |
# Filesystems |
117 |
-MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs fuse" |
118 |
+MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse" |
119 |
|
120 |
|
121 |
diff --git a/arch/parisc64/modules_load b/arch/parisc64/modules_load |
122 |
index 971484c..aa9ae31 100644 |
123 |
--- a/arch/parisc64/modules_load |
124 |
+++ b/arch/parisc64/modules_load |
125 |
@@ -24,4 +24,4 @@ MODULES_PCMCIA="pcmcia pcmcia_core yenta_socket pd6729 i82092 i82365 tcic ds ide |
126 |
MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd usbhid sl811-hcd hid-a4tech hid-apple hid-belkin hid-cherry hid-chicony hid-cypress hid-dummy hid-ezkey hid-gyration hid-logitech hid-microsoft hid-monterey hid-petalynx hid-pl hid-samsung hid-sony hid-sunplus" |
127 |
|
128 |
# Filesystems |
129 |
-MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs fuse" |
130 |
+MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse" |
131 |
|
132 |
diff --git a/arch/ppc/modules_load b/arch/ppc/modules_load |
133 |
index 2aeb5c1..6d7dfbf 100644 |
134 |
--- a/arch/ppc/modules_load |
135 |
+++ b/arch/ppc/modules_load |
136 |
@@ -24,5 +24,5 @@ MODULES_PCMCIA="pcmcia pcmcia_core yenta_socket pd6729 i82092 i82365 tcic ds ide |
137 |
MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd usbhid sl811-hcd hid-a4tech hid-apple hid-belkin hid-cherry hid-chicony hid-cypress hid-dummy hid-ezkey hid-gyration hid-logitech hid-microsoft hid-monterey hid-petalynx hid-pl hid-samsung hid-sony hid-sunplus" |
138 |
|
139 |
# Filesystems |
140 |
-MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs fuse" |
141 |
+MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse" |
142 |
|
143 |
|
144 |
diff --git a/arch/ppc64/modules_load b/arch/ppc64/modules_load |
145 |
index 971484c..aa9ae31 100644 |
146 |
--- a/arch/ppc64/modules_load |
147 |
+++ b/arch/ppc64/modules_load |
148 |
@@ -24,4 +24,4 @@ MODULES_PCMCIA="pcmcia pcmcia_core yenta_socket pd6729 i82092 i82365 tcic ds ide |
149 |
MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd usbhid sl811-hcd hid-a4tech hid-apple hid-belkin hid-cherry hid-chicony hid-cypress hid-dummy hid-ezkey hid-gyration hid-logitech hid-microsoft hid-monterey hid-petalynx hid-pl hid-samsung hid-sony hid-sunplus" |
150 |
|
151 |
# Filesystems |
152 |
-MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs fuse" |
153 |
+MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse" |
154 |
|
155 |
diff --git a/arch/sparc/modules_load b/arch/sparc/modules_load |
156 |
index 2aeb5c1..6d7dfbf 100644 |
157 |
--- a/arch/sparc/modules_load |
158 |
+++ b/arch/sparc/modules_load |
159 |
@@ -24,5 +24,5 @@ MODULES_PCMCIA="pcmcia pcmcia_core yenta_socket pd6729 i82092 i82365 tcic ds ide |
160 |
MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd usbhid sl811-hcd hid-a4tech hid-apple hid-belkin hid-cherry hid-chicony hid-cypress hid-dummy hid-ezkey hid-gyration hid-logitech hid-microsoft hid-monterey hid-petalynx hid-pl hid-samsung hid-sony hid-sunplus" |
161 |
|
162 |
# Filesystems |
163 |
-MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs fuse" |
164 |
+MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse" |
165 |
|
166 |
|
167 |
diff --git a/arch/sparc64/modules_load b/arch/sparc64/modules_load |
168 |
index 971484c..aa9ae31 100644 |
169 |
--- a/arch/sparc64/modules_load |
170 |
+++ b/arch/sparc64/modules_load |
171 |
@@ -24,4 +24,4 @@ MODULES_PCMCIA="pcmcia pcmcia_core yenta_socket pd6729 i82092 i82365 tcic ds ide |
172 |
MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd usbhid sl811-hcd hid-a4tech hid-apple hid-belkin hid-cherry hid-chicony hid-cypress hid-dummy hid-ezkey hid-gyration hid-logitech hid-microsoft hid-monterey hid-petalynx hid-pl hid-samsung hid-sony hid-sunplus" |
173 |
|
174 |
# Filesystems |
175 |
-MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs fuse" |
176 |
+MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse" |
177 |
|
178 |
diff --git a/arch/um/modules_load b/arch/um/modules_load |
179 |
index cf3b19f..d00e495 100644 |
180 |
--- a/arch/um/modules_load |
181 |
+++ b/arch/um/modules_load |
182 |
@@ -24,5 +24,5 @@ MODULES_PCMCIA="pcmcia pcmcia_core yenta_socket pd6729 i82092 i82365 tcic ds ide |
183 |
MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd usbhid sl811-hcd hid-a4tech hid-apple hid-belkin hid-cherry hid-chicony hid-cypress hid-dummy hid-ezkey hid-gyration hid-logitech hid-microsoft hid-monterey hid-petalynx hid-pl hid-samsung hid-sony hid-sunplus" |
184 |
|
185 |
# Filesystems |
186 |
-MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs fuse" |
187 |
+MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse" |
188 |
|
189 |
|
190 |
diff --git a/arch/x86/modules_load b/arch/x86/modules_load |
191 |
index a9383e5..c601927 100644 |
192 |
--- a/arch/x86/modules_load |
193 |
+++ b/arch/x86/modules_load |
194 |
@@ -25,5 +25,5 @@ MODULES_PCMCIA="pcmcia pcmcia_core yenta_socket pd6729 i82092 i82365 tcic ds ide |
195 |
MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd usbhid sl811-hcd hid-a4tech hid-apple hid-belkin hid-cherry hid-chicony hid-cypress hid-dummy hid-ezkey hid-gyration hid-logitech hid-microsoft hid-monterey hid-petalynx hid-pl hid-samsung hid-sony hid-sunplus" |
196 |
|
197 |
# Filesystems |
198 |
-MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs fuse" |
199 |
+MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse" |
200 |
|
201 |
|
202 |
diff --git a/arch/x86_64/modules_load b/arch/x86_64/modules_load |
203 |
index d12f57d..0da1ec3 100644 |
204 |
--- a/arch/x86_64/modules_load |
205 |
+++ b/arch/x86_64/modules_load |
206 |
@@ -24,4 +24,4 @@ MODULES_PCMCIA="pcmcia pcmcia_core yenta_socket pd6729 i82092 i82365 tcic ds ide |
207 |
MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd usbhid sl811-hcd hid-a4tech hid-apple hid-belkin hid-cherry hid-chicony hid-cypress hid-dummy hid-ezkey hid-gyration hid-logitech hid-microsoft hid-monterey hid-petalynx hid-pl hid-samsung hid-sony hid-sunplus" |
208 |
|
209 |
# Filesystems |
210 |
-MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs fuse" |
211 |
+MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse" |
212 |
|
213 |
diff --git a/defaults/busy-config b/defaults/busy-config |
214 |
index 8d69369..2b9a4c4 100644 |
215 |
--- a/defaults/busy-config |
216 |
+++ b/defaults/busy-config |
217 |
@@ -220,7 +220,7 @@ CONFIG_FALSE=y |
218 |
CONFIG_FSYNC=y |
219 |
CONFIG_HEAD=y |
220 |
# CONFIG_FEATURE_FANCY_HEAD is not set |
221 |
-# CONFIG_HOSTID is not set |
222 |
+CONFIG_HOSTID=y |
223 |
# CONFIG_INSTALL is not set |
224 |
# CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set |
225 |
CONFIG_LN=y |
226 |
|
227 |
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts |
228 |
index 609c52f..54e7b80 100755 |
229 |
--- a/defaults/initrd.scripts |
230 |
+++ b/defaults/initrd.scripts |
231 |
@@ -664,6 +664,11 @@ startVolumes() { |
232 |
bad_msg "vgscan or vgchange not found: skipping LVM volume group activation!" |
233 |
fi |
234 |
fi |
235 |
+ |
236 |
+ if [ "${USE_ZFS}" = '1' ] |
237 |
+ then |
238 |
+ /sbin/zpool import -N -a ${ZPOOL_FORCE} |
239 |
+ fi |
240 |
} |
241 |
|
242 |
startiscsi() { |
243 |
|
244 |
diff --git a/defaults/linuxrc b/defaults/linuxrc |
245 |
index 6bdaea1..0a69a6d 100755 |
246 |
--- a/defaults/linuxrc |
247 |
+++ b/defaults/linuxrc |
248 |
@@ -96,6 +96,19 @@ do |
249 |
DMRAID_OPTS=${x#*=} |
250 |
USE_DMRAID_NORMAL=1 |
251 |
;; |
252 |
+ dozfs*) |
253 |
+ if [ ! -x /sbin/zfs ]; then |
254 |
+ USE_ZFS=0 |
255 |
+ bad_msg 'zfs binary not found: aborting use of zfs!' |
256 |
+ else |
257 |
+ USE_ZFS=1 |
258 |
+ MY_HWOPTS="${MY_HWOPTS} zfs" |
259 |
+ if [ "${x#*=}" = 'force' ] |
260 |
+ then |
261 |
+ ZPOOL_FORCE=-f |
262 |
+ fi |
263 |
+ fi |
264 |
+ ;; |
265 |
# Debug Options |
266 |
debug) |
267 |
DEBUG='yes' |
268 |
@@ -444,6 +457,49 @@ do |
269 |
continue |
270 |
fi |
271 |
;; |
272 |
+ ZFS*) |
273 |
+ ROOT_DEV="${REAL_ROOT#*=}" |
274 |
+ if [ "${ROOT_DEV}" != 'ZFS' ] |
275 |
+ then |
276 |
+ zfs get type ${ROOT_DEV} > /dev/null |
277 |
+ |
278 |
+ if [ "$?" = '0' ] |
279 |
+ then |
280 |
+ got_good_root=1; |
281 |
+ REAL_ROOT=${ROOT_DEV} |
282 |
+ ROOTFSTYPE=zfs |
283 |
+ fi |
284 |
+ else |
285 |
+ BOOTFS=$(/sbin/zpool list -H -o bootfs) |
286 |
+ if [ "${BOOTFS}" != '-' ] |
287 |
+ then |
288 |
+ |
289 |
+ for i in ${BOOTFS} |
290 |
+ do |
291 |
+ |
292 |
+ zfs get type ${i} > /dev/null |
293 |
+ retval=$? |
294 |
+ |
295 |
+ if [ ${retval} -eq 0 ]; then |
296 |
+ got_good_root=1 |
297 |
+ REAL_ROOT=${i} |
298 |
+ ROOTFSTYPE=zfs |
299 |
+ break |
300 |
+ fi |
301 |
+ |
302 |
+ done; |
303 |
+ |
304 |
+ fi |
305 |
+ |
306 |
+ fi |
307 |
+ |
308 |
+ if [ ${got_good_root} -ne 1 ]; then |
309 |
+ prompt_user "REAL_ROOT" "root block device" |
310 |
+ got_good_root=0 |
311 |
+ fi |
312 |
+ |
313 |
+ continue |
314 |
+ ;; |
315 |
esac |
316 |
|
317 |
if [ "${REAL_ROOT}" = '' ] |
318 |
@@ -477,17 +533,24 @@ do |
319 |
else |
320 |
good_msg "Mounting root..." |
321 |
|
322 |
+ if [ "${ROOTFSTYPE}" = 'zfs' ] |
323 |
+ then |
324 |
+ MOUNT_STATE=rw |
325 |
+ else |
326 |
+ MOUNT_STATE=ro |
327 |
+ fi |
328 |
+ |
329 |
# Try to mount the device as ${NEW_ROOT} |
330 |
if [ "${REAL_ROOT}" = '/dev/nfs' ]; then |
331 |
findnfsmount |
332 |
else |
333 |
# mount ro so fsck doesn't barf later |
334 |
if [ "${REAL_ROOTFLAGS}" = '' ]; then |
335 |
- good_msg "Using mount -t ${ROOTFSTYPE} -o ro" |
336 |
- mount -t ${ROOTFSTYPE} -o ro ${REAL_ROOT} ${NEW_ROOT} |
337 |
+ good_msg "Using mount -t ${ROOTFSTYPE} -o ${MOUNT_STATE}" |
338 |
+ mount -t ${ROOTFSTYPE} -o ${MOUNT_STATE} ${REAL_ROOT} ${NEW_ROOT} |
339 |
else |
340 |
- good_msg "Using mount -t ${ROOTFSTYPE} -o ro,${REAL_ROOTFLAGS}" |
341 |
- mount -t ${ROOTFSTYPE} -o ro,${REAL_ROOTFLAGS} ${REAL_ROOT} ${NEW_ROOT} |
342 |
+ good_msg "Using mount -t ${ROOTFSTYPE} -o ${MOUNT_STATE},${REAL_ROOTFLAGS}" |
343 |
+ mount -t ${ROOTFSTYPE} -o ${MOUNT_STATE},${REAL_ROOTFLAGS} ${REAL_ROOT} ${NEW_ROOT} |
344 |
fi |
345 |
fi |
346 |
|
347 |
|
348 |
diff --git a/defaults/modules_load b/defaults/modules_load |
349 |
index 269a40c..d65f9f9 100644 |
350 |
--- a/defaults/modules_load |
351 |
+++ b/defaults/modules_load |
352 |
@@ -24,5 +24,5 @@ MODULES_PCMCIA="pcmcia pcmcia_core yenta_socket pd6729 i82092 i82365 tcic ds ide |
353 |
MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd usbhid sl811-hcd" |
354 |
|
355 |
# Filesystems |
356 |
-MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs fuse" |
357 |
+MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse" |
358 |
|
359 |
|
360 |
diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt |
361 |
index 1e02fb7..67edbd9 100644 |
362 |
--- a/doc/genkernel.8.txt |
363 |
+++ b/doc/genkernel.8.txt |
364 |
@@ -260,6 +260,9 @@ INITIALIZATION |
365 |
*--*[*no-*]*dmraid*:: |
366 |
Includes or excludes DMRAID support. |
367 |
|
368 |
+*--*[*no-*]*zfs*:: |
369 |
+ Includes or excludes ZFS support. |
370 |
+ |
371 |
*--*[*no-*]*multipath*:: |
372 |
Includes or excludes Multipath support |
373 |
|
374 |
@@ -439,6 +442,10 @@ which the ramdisk scripts would recognize. |
375 |
*domdadm*:: |
376 |
Scan for RAID arrays on bootup |
377 |
|
378 |
+*dozfs*[=force]:: |
379 |
+ Scan for bootable ZFS pools on bootup. Optionally force import if |
380 |
+ necessary. |
381 |
+ |
382 |
*doscsi*:: |
383 |
Activate SCSI devices on bootup, necessary when SCSI support is |
384 |
compiled as modules and you're using SCSI or SATA devices. |
385 |
@@ -586,6 +593,7 @@ AUTHORS |
386 |
- NFS Support by Thomas Seiler <thseiler@×××××.com> |
387 |
- GnuPG 1.x integration by dacook <schism@×××××××××.org> |
388 |
- MDADM integration by Matthias Dahl <ua_bugz_gentoo@×××××××××××.de> |
389 |
+- ZFS integration by Richard Yao <ryao@×××××××××××××.edu> |
390 |
|
391 |
|
392 |
SEE ALSO |
393 |
|
394 |
diff --git a/gen_cmdline.sh b/gen_cmdline.sh |
395 |
index 4c04f94..de56a25 100755 |
396 |
--- a/gen_cmdline.sh |
397 |
+++ b/gen_cmdline.sh |
398 |
@@ -90,6 +90,8 @@ longusage() { |
399 |
echo " --mdadm-config=<file> Use file as mdadm.conf in initramfs" |
400 |
echo " --dmraid Include DMRAID support" |
401 |
echo " --no-dmraid Exclude DMRAID support" |
402 |
+ echo " --zfs Include ZFS support" |
403 |
+ echo " --no-zfs Exclude ZFS support" |
404 |
echo " --multipath Include Multipath support" |
405 |
echo " --no-multipath Exclude Multipath support" |
406 |
echo " --iscsi Include iSCSI support" |
407 |
@@ -296,6 +298,10 @@ parse_cmdline() { |
408 |
fi |
409 |
print_info 2 "CMD_DMRAID: ${CMD_DMRAID}" |
410 |
;; |
411 |
+ --zfs|--no-zfs) |
412 |
+ CMD_ZFS=`parse_optbool "$*"` |
413 |
+ print_info 2 "CMD_ZFS: ${CMD_ZFS}" |
414 |
+ ;; |
415 |
--multipath|--no-multipath) |
416 |
CMD_MULTIPATH=`parse_optbool "$*"` |
417 |
if [ "$CMD_MULTIPATH" = "1" -a ! -e /usr/include/libdevmapper.h ] |
418 |
|
419 |
diff --git a/gen_determineargs.sh b/gen_determineargs.sh |
420 |
index b12efca..e6ed0a3 100755 |
421 |
--- a/gen_determineargs.sh |
422 |
+++ b/gen_determineargs.sh |
423 |
@@ -120,6 +120,7 @@ determine_real_args() { |
424 |
set_config_with_override BOOL GPG CMD_GPG |
425 |
set_config_with_override BOOL MDADM CMD_MDADM |
426 |
set_config_with_override STRING MDADM_CONFIG CMD_MDADM_CONFIG |
427 |
+ set_config_with_override BOOL ZFS CMD_ZFS |
428 |
set_config_with_override BOOL MULTIPATH CMD_MULTIPATH |
429 |
set_config_with_override BOOL FIRMWARE CMD_FIRMWARE |
430 |
set_config_with_override STRING FIRMWARE_DIR CMD_FIRMWARE_DIR "/lib/firmware" |
431 |
|
432 |
diff --git a/gen_initramfs.sh b/gen_initramfs.sh |
433 |
index 43fd77f..170361b 100755 |
434 |
--- a/gen_initramfs.sh |
435 |
+++ b/gen_initramfs.sh |
436 |
@@ -328,6 +328,31 @@ append_mdadm(){ |
437 |
rm -rf "${TEMP}/initramfs-mdadm-temp" > /dev/null |
438 |
} |
439 |
|
440 |
+append_zfs(){ |
441 |
+ if [ -d "${TEMP}/initramfs-zfs-temp" ] |
442 |
+ then |
443 |
+ rm -r "${TEMP}/initramfs-zfs-temp" |
444 |
+ fi |
445 |
+ |
446 |
+ mkdir -p "${TEMP}/initramfs-zfs-temp/etc/zfs/" |
447 |
+ |
448 |
+ # Copy files to /etc/zfs |
449 |
+ for i in /etc/zfs/{zdev.conf,zpool.cache} |
450 |
+ do |
451 |
+ cp -a "${i}" "${TEMP}/initramfs-zfs-temp/etc/zfs" \ |
452 |
+ || gen_die "Could not copy file ${i} for ZFS" |
453 |
+ done |
454 |
+ |
455 |
+ # Copy binaries |
456 |
+ copy_binaries "${TEMP}/initramfs-zfs-temp" /sbin/{mount.zfs,zfs,zpool} |
457 |
+ |
458 |
+ cd "${TEMP}/initramfs-zfs-temp/" |
459 |
+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ |
460 |
+ || gen_die "compressing zfs cpio" |
461 |
+ cd "${TEMP}" |
462 |
+ rm -rf "${TEMP}/initramfs-zfs-temp" > /dev/null |
463 |
+} |
464 |
+ |
465 |
append_splash(){ |
466 |
splash_geninitramfs=`which splash_geninitramfs 2>/dev/null` |
467 |
if [ -x "${splash_geninitramfs}" ] |
468 |
@@ -642,6 +667,8 @@ create_initramfs() { |
469 |
print_info 1 "initramfs: Not copying modules..." |
470 |
fi |
471 |
|
472 |
+ append_data 'zfs' "${ZFS}" |
473 |
+ |
474 |
append_data 'blkid' "${DISKLABEL}" |
475 |
|
476 |
append_data 'unionfs_fuse' "${UNIONFS}" |
477 |
|
478 |
diff --git a/genkernel b/genkernel |
479 |
index 19ef657..5883b5d 100755 |
480 |
--- a/genkernel |
481 |
+++ b/genkernel |
482 |
@@ -351,6 +351,8 @@ then |
483 |
[ "${DMRAID}" = '1' ] && print_warning 1 'add "dodmraid" for dmraid support' |
484 |
[ "${MDADM}" = '1' ] && print_warning 1 'add "domdadm" for RAID support' |
485 |
[ "${DMRAID}" = '1' ] && print_warning 1 ' or "dodmraid=<additional options>"' |
486 |
+ [ "${ZFS}" = '1' ] && print_warning 1 'add "dozfs" for ZFS support' |
487 |
+ [ "${ZFS}" = '1' ] && print_warning 1 ' and either "real_root=ZFS" to use bootfs autodetection or "real_root=ZFS=<dataset>" to force booting from a specific dataset' |
488 |
[ "${ISCSI}" = '1' ] && print_warning 1 'add at least "iscsi_initiatorname=<initiator name> iscsi_target=<target name> and iscsi_address=<target ip>" for iscsi support' |
489 |
if [ `grep 'CONFIG_EXT[0-9]_FS=' "${KERNEL_DIR}"/.config | wc -l` -ge 2 ]; then |
490 |
print_warning 1 'With support for several ext* filesystems around it may be needed to' |