Gentoo Archives: gentoo-genkernel

From: "Rick \\\"Zero_Chaos\\\" Farina" <zerochaos@g.o>
To: gentoo-genkernel@l.g.o
Subject: [gentoo-genkernel] RFC: aufs and modules support
Date: Sun, 05 Aug 2012 02:59:32
Message-Id: 501DE1DE.6020704@gentoo.org
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 It pains me to drop this patch in here, because it's like kicking a
5 child out of the house, but it's time to reintegrate into gentoo.
6
7 I've yet to test this exact version (takes a long time to build my
8 livecd). Please look over this code while I'm waiting to test, but I
9 know the aufs stuff works and I *believe* I fixed the modules support.
10
11 Let the abuse begin! :-)
12
13 Thanks!
14 Zero
15
16 diff --git a/defaults/initrd.defaults b/defaults/initrd.defaults
17 index 73fe4c9..aa265bc 100755
18 - --- a/defaults/initrd.defaults
19 +++ b/defaults/initrd.defaults
20 @@ -73,6 +73,7 @@ CDROOT_TYPE='auto'
21 NEW_ROOT='/newroot'
22 CDROOT_PATH='/mnt/cdrom'
23 CONSOLE='/dev/console'
24 +MODULESD="mnt/cdrom"
25
26 LOOPS='/livecd.loop /zisofs /livecd.squashfs /image.squashfs
27 /livecd.gcloop'
28
29 diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
30 index 082d44d..e0de42f 100755
31 - --- a/defaults/initrd.scripts
32 +++ b/defaults/initrd.scripts
33 @@ -207,6 +207,192 @@ mount_sysfs() {
34 [ ${ret} -eq 0 ] || bad_msg "Failed to mount /sys!"
35 }
36
37 +# Insert a directory tree $2 to an union specified by $1
38 +# Top-level read-write branch is specified by it's index 0
39 +# $1 = union absolute path (starting with /)
40 +# $2 = path to data directory
41 +#
42 +union_insert_dir() {
43 + # Always mount it over the precedent (add:1:)
44 + mount -n -o remount,add:1:$2=rr aufs $1
45 + if [ $? = '0' ]
46 + then
47 + good_msg "Addition of $2 to $1 successful"
48 + fi
49 +}
50 +
51 +# Insert all modules found in $1, usually mnt/cdrom
52 +# added to allow users to add their own apps.
53 +union_insert_modules() {
54 + for module in `ls ${NEW_ROOT}/$1/modules/*.mo 2>/dev/null| sort`
55 + do
56 + mkdir -p ${MEMORY}/modules/`basename ${module} .mo`
57 + union_insert_dir $UNION ${MEMORY}/modules/`basename ${module} .mo`
58 + done
59 + for module in `ls ${NEW_ROOT}/$1/modules/*.lzm 2>/dev/null| sort`
60 + do
61 + mkdir -p ${MEMORY}/modules/`basename ${module} .lzm`
62 + mount -o loop,ro ${module} ${MEMORY}/modules/`basename ${module} .lzm`
63 + union_insert_dir $UNION ${MEMORY}/modules/`basename ${module} .lzm`
64 + done
65 +}
66 +
67 +# Function to create an ext2 fs on $CHANGESDEV, $CHANGESMNT mountpoint
68 +create_changefs() {
69 + local size
70 + while [ 1 ]
71 + do
72 + read -p '<< Size of file (Enter for default 256 Mb): ' size
73 + if [ -z "$size" ]; then
74 + let size=256
75 + fi
76 + let size="$size"
77 + if [ $size -lt 16 ]
78 + then
79 + bad_msg "Please give a size of at least 16 Mb"
80 + else
81 + dd if=/dev/zero of=$CHANGESMNT/livecd.aufs bs=1M count=$size
82 + if [ $? = '0' ]
83 + then
84 + good_msg "Creation of livecd.aufs, $size Mb on $CHANGESDEV
85 successful, formatting it ext2"
86 + mke2fs -F $CHANGESMNT/livecd.aufs
87 + break
88 + else
89 + rm -f $CHANGESMNT/livecd.aufs
90 + bad_msg "Unable to create livecd.aufs on $CHANGESDEV of $size Mb"
91 + bad_msg "Please give a size of at least 16 Mb"
92 + bad_msg "Also check if your disk is full or read-only ?"
93 + read -p '<< Type "a" to abort, anything else to continue : ' doabort
94 + if [ "$doabort" = "a" ]; then
95 + return 1
96 + fi
97 + fi
98 + fi
99 + done
100 + return 0
101 +}
102 +
103 +setup_aufs() {
104 + if [ "${USE_AUFS_NORMAL}" -eq '1' ]
105 + then
106 + # Directory used for rw changes in union mount filesystem
107 + UNION=/union
108 + MEMORY=/memory
109 + # Mountpoint for the changesdev
110 + CHANGESMNT=$NEW_ROOT/mnt/changesdev
111 + if [ -z "$UID" ]
112 + then
113 + CHANGES=$MEMORY/aufs_changes/default
114 + else
115 + CHANGES=$MEMORY/aufs_changes/$UID
116 + fi
117 +
118 + mkdir -p ${MEMORY}
119 + mkdir -p ${UNION}
120 + mkdir -p ${CHANGESMNT}
121 + for i in dev mnt mnt/cdrom mnt/livecd mnt/key tmp tmp/.initrd
122 mnt/gentoo sys
123 + do
124 + mkdir -p "${NEW_ROOT}/${i}"
125 + chmod 755 "${NEW_ROOT}/${i}"
126 + done
127 + [ ! -e "${NEW_ROOT}/dev/null" ] && mknod "${NEW_ROOT}"/dev/null c 1 3
128 + [ ! -e "${NEW_ROOT}/dev/console" ] && mknod "${NEW_ROOT}"/dev/console
129 c 5 1
130 +
131 + bootstrapCD
132 + if [ -n "${AUFS}" ]
133 + then
134 + if [ "${AUFS}" = "detect" ]
135 + then
136 + CHANGESMNT="${NEW_ROOT}/mnt/cdrom"
137 + CHANGESDEV=${REAL_ROOT}
138 + else
139 + CHANGESDEV=${AUFS}
140 + good_msg "mounting $CHANGESDEV to $MEMORY for aufs support"
141 + # mount -t auto $CHANGESDEV $MEMORY
142 + mount -t auto $CHANGESDEV $CHANGESMNT
143 + ret=$?
144 + if [ "${ret}" -ne 0 ]
145 + then
146 + bad_msg "mount of $CHANGESDEV failed falling back to ramdisk based
147 aufs"
148 + unset AUFS
149 + fi
150 + fi
151 + # Check and attempt to create the changesfile
152 + if [ ! -e $CHANGESMNT/livecd.aufs ] && [ -n "${AUFS}" ]
153 + then
154 + create_changefs
155 + mount -t auto $CHANGESMNT/livecd.aufs $MEMORY
156 + elif [ -n "${AUFS}" ]
157 + then
158 + local nbpass=0
159 + while [ 1 ]
160 + do
161 + mount -t auto $CHANGESMNT/livecd.aufs $MEMORY
162 + ret=$?
163 + if [ "${ret}" -ne 0 ]
164 + then
165 + if [ $nbpass -eq 0 ]
166 + then
167 + bad_msg "mounting of changes file failed, Running e2fsck"
168 + e2fsck $CHANGESMNT/livecd.aufs
169 + nbpass=$(($nbpass + 1))
170 + else
171 + bad_msg "mount of $CHANGESDEV failed falling back to ramdisk
172 based aufs"
173 + bad_msg "your livecd.aufs might be messed up, and I couldn't fix it"
174 + bad_msg "moving livecd.aufs to livecd.aufs.bad"
175 + mv $CHANGESMNT/livecd.aufs $CHANGESMNT/livecd.aufs.bad
176 + bad_msg "try to fix it yourself with e2fsck later on, sorry for
177 disturbing"
178 + break
179 + fi
180 + else
181 + if [ $nbpass -eq 1 ]
182 + then
183 + good_msg "e2fsck seemed successful. Please check your files
184 after bootup"
185 + fi
186 + break
187 + fi
188 + done
189 + if [ -f ${MEMORY}/.doclean.sh ]
190 + then
191 + good_msg "finishing the permanent changes cleanup"
192 + . ${MEMORY}/.doclean.sh
193 + rm ${MEMORY}/.doclean.sh
194 + fi
195 + fi
196 + # mount tmpfs only in the case when changes= boot parameter was
197 + # empty or we were not able to mount the storage device
198 + if [ "${CDROOT}" -eq '1' -a ! -f ${CHANGESMNT}/livecd.aufs ]
199 + then
200 + umount $MEMORY
201 + bad_msg "failed to find livecd.aufs file on $CHANGESDEV"
202 + bad_msg "create an ext2 livecd.aufs file on this device if you wish
203 to use it for aufs"
204 + bad_msg "falling back to ramdisk based aufs for safety"
205 + mount -t tmpfs tmpfs $MEMORY
206 + XINO=$MEMORY
207 + else
208 + XINO=$MEMORY/xino
209 + mkdir -p $XINO
210 + mount -t tmpfs tmpfs $XINO
211 + fi
212 + else
213 + good_msg "Mounting ramdisk to $MEMORY for aufs support..."
214 + mount -t tmpfs tmpfs $MEMORY
215 + XINO=$MEMORY
216 + fi
217 +
218 + mkdir -p $CHANGES
219 + mount -t aufs -n -o
220 nowarn_perm,udba=none,xino=$XINO/.aufs.xino,br:$CHANGES=rw aufs ${UNION}
221 + ret=$?
222 + if [ "${ret}" -ne 0 ]
223 + then
224 + bad_msg "Can't setup union ${UNION} in directory!"
225 + USE_AUFS_NORMAL=0
226 + fi
227 + else
228 + USE_AUFS_NORMAL=0
229 + fi
230 +}
231 +
232 findnfsmount() {
233 if [ "${IP}" != '' ] || busybox udhcpc -n -T 15 -q
234 then
235 diff --git a/defaults/linuxrc b/defaults/linuxrc
236 index f434339..5e2d1b8 100755
237 - --- a/defaults/linuxrc
238 +++ b/defaults/linuxrc
239 @@ -229,6 +229,38 @@ do
240 aufs)
241 USE_AUFS_NORMAL=1
242 ;;
243 + aufs\=*)
244 + USE_AUFS_NORMAL=1
245 + CMD_AUFS=`parse_opt "${x}"`
246 + echo ${CMD_AUFS}|grep , >/dev/null 2>&1
247 + if [ "$?" -eq '0' ]
248 + then
249 + UID=`echo ${CMD_AUFS#*,}`
250 + AUFS=`echo ${CMD_AUFS%,*}`
251 + else
252 + AUFS=${CMD_AUFS}
253 + fi
254 + ;;
255 + changes\=*)
256 + USE_AUFS_NORMAL=1
257 + CMD_AUFS=`parse_opt "${x}"`
258 + echo ${CMD_AUFS}|grep , >/dev/null 2>&1
259 + if [ "$?" -eq '0' ]
260 + then
261 + UID=`echo ${CMD_AUFS#*,}`
262 + AUFS=`echo ${CMD_AUFS%,*}`
263 + else
264 + AUFS=${CMD_AUFS}
265 + fi
266 + ;;
267 + persistent)
268 + USE_AUFS_NORMAL=1
269 + AUFS="detect"
270 + ;;
271 + # Allow user to specify the modules location
272 + modules\=*)
273 + MODULESD=`parse_opt "${x}"`
274 + ;;
275 unionfs)
276 if [ ! -x /sbin/unionfs ]
277 then
278 @@ -406,17 +438,23 @@ rundebugshell
279
280 if [ "${CDROOT}" = '1' ]
281 then
282 - - good_msg "Making tmpfs for ${NEW_ROOT}"
283 - - mount -n -t tmpfs tmpfs "${NEW_ROOT}"
284 + setup_aufs
285 + if [ "${USE_AUFS_NORMAL}" -eq '1' ]
286 + then
287 + CHROOT=${UNION}
288 + else
289 + CHROOT=${NEW_ROOT}
290 + good_msg "Making tmpfs for ${NEW_ROOT}"
291 + mount -t tmpfs tmpfs ${NEW_ROOT}
292
293 - - for i in dev mnt mnt/livecd mnt/key tmp tmp/.initrd mnt/gentoo sys
294 - - do
295 - - mkdir -p "${NEW_ROOT}/${i}"
296 - - chmod 755 "${NEW_ROOT}/${i}"
297 - - done
298 - - [ ! -d "${CDROOT_PATH}" ] && mkdir -p "${CDROOT_PATH}"
299 - - [ ! -e "${NEW_ROOT}/dev/null" ] && mknod "${NEW_ROOT}"/dev/null c 1 3
300 - - [ ! -e "${NEW_ROOT}/dev/console" ] && mknod "${NEW_ROOT}"/dev/console
301 c 5 1
302 + for i in dev mnt mnt/cdrom mnt/livecd mnt/key tmp tmp/.initrd
303 mnt/gentoo sys
304 + do
305 + mkdir -p "${NEW_ROOT}/${i}"
306 + chmod 755 "${NEW_ROOT}/${i}"
307 + done
308 + [ ! -e "${NEW_ROOT}/dev/null" ] && mknod "${NEW_ROOT}"/dev/null c 1 3
309 + [ ! -e "${NEW_ROOT}/dev/console" ] && mknod "${NEW_ROOT}"/dev/console
310 c 5 1
311 + fi
312
313 # For SGI LiveCDs ...
314 if [ "${LOOPTYPE}" = "sgimips" ]
315 @@ -432,7 +470,7 @@ then
316 [ ! -e "${NEW_ROOT}/dev/tty1" ] && mknod "${NEW_ROOT}/dev/tty1" c 4 1
317 fi
318
319 - - if [ "${REAL_ROOT}" != "/dev/nfs" ] && [ "${LOOPTYPE}" != "sgimips" ]
320 + if [ "${REAL_ROOT}" != "/dev/nfs" ] && [ "${LOOPTYPE}" != "sgimips" ]
321 && [ "${USE_AUFS_NORMAL}" != '1' ]
322 then
323 bootstrapCD
324 fi
325 @@ -748,7 +786,23 @@ then
326 fi
327 fi
328
329 + if [ "${USE_AUFS_NORMAL}" -eq '1' ]
330 + then
331 + union_insert_dir ${UNION} ${NEW_ROOT}/${FS_LOCATION}
332
333 + # Make sure fstab notes livecd is mounted ro. Makes system skip
334 remount which fails on aufs dirs.
335 + sed -e 's|\(.*\s/\s*tmpfs\s*\)defaults\(.*\)|\1defaults,ro\2|'
336 /${UNION}/etc/fstab /${UNION}/etc/fstab.new
337 + mv /${UNION}/etc/fstab.new /${UNION}/etc/fstab
338 + warn_msg "Adding all modules in $MODULESD/modules/"
339 + if [ "${MODULESD}" = "mnt/cdrom" ]
340 + then
341 + union_insert_modules mnt/cdrom
342 + else
343 + mkdir ${NEW_ROOT}/mnt/modulesd
344 + mount "${MODULESD}" ${NEW_ROOT}/mnt/modulesd
345 + union_insert_modules ${NEW_ROOT}/mnt/modulesd
346 + fi
347 + fi
348
349 # Unpacking additional packages from NFS mount
350 # This is useful for adding kernel modules to /lib
351 @@ -771,57 +825,57 @@ then
352 then
353 setup_unionfs ${NEW_ROOT} /${FS_LOCATION}
354 CHROOT=/union
355 - - elif [ "${USE_AUFS_NORMAL}" != '1' ]; then
356 - -
357 - - good_msg "Copying read-write image contents to tmpfs"
358 - - # Copy over stuff that should be writable
359 - - (cd "${NEW_ROOT}/${FS_LOCATION}"; cp -a ${ROOT_TREES} "${NEW_ROOT}")
360 || {
361 - - bad_msg "Copying failed, dropping into a shell."
362 - - do_rundebugshell
363 - - }
364 - -
365 - - # Now we do the links.
366 - - for x in ${ROOT_LINKS}
367 - - do
368 - - if [ -L "${NEW_ROOT}/${FS_LOCATION}/${x}" ]
369 + else
370 + #XXX this hunk confuses me more than a little and needs to be
371 rewritten sanely at some point
372 + if [ ! "${USE_AUFS_NORMAL}" -eq '1' ]
373 then
374 - - ln -s "$(readlink ${NEW_ROOT}/${FS_LOCATION}/${x})" "${x}" 2>/dev/null
375 - - else
376 - - # List all subdirectories of x
377 - - find "${NEW_ROOT}/${FS_LOCATION}/${x}" -type d 2>/dev/null | while
378 read directory
379 - - do
380 - - # Strip the prefix of the FS_LOCATION
381 - - directory="${directory#${NEW_ROOT}/${FS_LOCATION}/}"
382 + good_msg "Copying read-write image contents to tmpfs"
383 + # Copy over stuff that should be writable
384 + (cd "${NEW_ROOT}/${FS_LOCATION}"; cp -a ${ROOT_TREES} "${NEW_ROOT}")
385
386 - - # Skip this directory if we already linked a parent directory
387 - - if [ "${current_parent}" != '' ]; then
388 - - var=$(echo "${directory}" | grep "^${current_parent}")
389 - - if [ "${var}" != '' ]; then
390 - - continue
391 - - fi
392 - - fi
393 - - # Test if the directory exists already
394 - - if [ -e "/${NEW_ROOT}/${directory}" ]
395 + # Now we do the links.
396 + for x in ${ROOT_LINKS}
397 + do
398 + if [ -L "${NEW_ROOT}/${FS_LOCATION}/${x}" ]
399 then
400 - - # It does exist, link all the individual files
401 - - for file in $(ls /${NEW_ROOT}/${FS_LOCATION}/${directory})
402 + ln -s "`readlink ${NEW_ROOT}/${FS_LOCATION}/${x}`" "${x}" 2>/dev/null
403 + else
404 + # List all subdirectories of x
405 + find "${NEW_ROOT}/${FS_LOCATION}/${x}" -type d 2>/dev/null | while
406 read directory
407 do
408 - - if [ ! -d "/${NEW_ROOT}/${FS_LOCATION}/${directory}/${file}" ] &&
409 [ ! -e "${NEW_ROOT}/${directory}/${file}" ]; then
410 - - ln -s "/${FS_LOCATION}/${directory}/${file}"
411 "${directory}/${file}" 2/dev/null
412 + # Strip the prefix of the FS_LOCATION
413 + directory="${directory#${NEW_ROOT}/${FS_LOCATION}/}"
414 +
415 + # Skip this directory if we already linked a parent directory
416 + if [ "${current_parent}" != '' ]; then
417 + var=`echo "${directory}" | grep "^${current_parent}"`
418 + if [ "${var}" != '' ]; then
419 + continue
420 + fi
421 + fi
422 + # Test if the directory exists already
423 + if [ -e "/${NEW_ROOT}/${directory}" ]
424 + then
425 + # It does exist, link all the individual files
426 + for file in `ls /${NEW_ROOT}/${FS_LOCATION}/${directory}`
427 + do
428 + if [ ! -d "/${NEW_ROOT}/${FS_LOCATION}/${directory}/${file}" ]
429 && [ ! -e "${NEW_ROOT}/${directory}/${file}" ]; then
430 + ln -s "/${FS_LOCATION}/${directory}/${file}"
431 "${directory}/${file}" 2/dev/null
432 + fi
433 + done
434 + else
435 + # It does not exist, make a link to the livecd
436 + ln -s "/${FS_LOCATION}/${directory}" "${directory}" 2>/dev/null
437 + current_parent="${directory}"
438 fi
439 done
440 - - else
441 - - # It does not exist, make a link to the livecd
442 - - ln -s "/${FS_LOCATION}/${directory}" "${directory}" 2>/dev/null
443 - - current_parent="${directory}"
444 fi
445 done
446 - - fi
447 - - done
448 - -
449 - - mkdir initramfs proc tmp sys run 2>/dev/null
450 - - chmod 1777 tmp
451 + mkdir initramfs proc tmp sys 2>/dev/null
452 + chmod 1777 tmp
453
454 + fi
455 + #XXX: end extremely confusing hunk
456 fi
457
458 #UML=$(cat /proc/cpuinfo|grep UML|sed -e 's|model name.*: ||')
459 @@ -842,13 +896,18 @@ else
460 setup_unionfs /union_changes ${NEW_ROOT}
461 mkdir -p ${UNION}/tmp/.initrd
462 fi
463 + if [ "${USE_AUFS_NORMAL}" -eq '1' ]
464 + then
465 + union_insert_dir ${UNION} ${NEW_ROOT}
466 + mkdir -p ${UNION}/tmp/.initrd
467 + fi
468 fi
469
470 # Mount the additional things as required by udev & systemd
471 if [ -f ${NEW_ROOT}/etc/initramfs.mounts ]; then
472 fslist=$(get_mounts_list)
473 else
474 - - fslist="/usr"
475 + fslist="/usr"
476 fi
477
478 for fs in $fslist; do
479 @@ -886,6 +945,35 @@ fi
480
481 verbose_kmsg
482
483 +if [ "${USE_AUFS_NORMAL}" -eq '1' ]
484 +then
485 + mkdir -p /${CHROOT}/.unions/memory 2>/dev/null
486 + mount -o move /memory /${CHROOT}/.unions/memory || echo '*: Failed to
487 move aufs /memory into the system root!'
488 + for i in tmp var/tmp mnt/gentoo mnt/livecd
489 + do
490 + mkdir -p ${CHROOT}/$i
491 + chmod 755 ${CHROOT}/$i
492 + done
493 + # This will prevent from putting junk on the CHANGESDEV
494 + mkdir -p ${CHROOT}/usr/portage/distfiles
495 + mount -t tmpfs tmpfs ${CHROOT}/var/tmp
496 + mount -t tmpfs tmpfs ${CHROOT}/tmp
497 + mount -t tmpfs tmpfs ${CHROOT}/usr/portage/distfiles
498 + warn_msg "/tmp /var/tmp /usr/portage/distfiles are mounted in ram"
499 + warn_msg "consider saving important files elsewhere..."
500 + read -t 3 UNUSEDVAL
501 + mount -o bind ${NEW_ROOT}/mnt/cdrom ${CHROOT}/mnt/cdrom
502 + mount -o bind ${NEW_ROOT}/mnt/livecd ${CHROOT}/mnt/livecd
503 + if [ -e $MEMORY/keyboard -a "${CDROOT}" -eq '1' ]
504 + then
505 + cp $MEMORY/keyboard ${CHROOT}/etc/sysconfig/keyboard
506 + elif [ -e /etc/sysconfig/keyboard -a "${CDROOT}" -eq '1' ]
507 + then
508 + mkdir -p ${NEW_ROOT}/etc/sysconfig/
509 + cp /etc/sysconfig/keyboard ${CHROOT}/etc/sysconfig/keyboard
510 + fi
511 +fi
512 +
513 echo -ne "${GOOD}>>${NORMAL}${BOLD} Booting (initramfs)${NORMAL}"
514
515 cd "${CHROOT}"
516 diff --git a/gen_compile.sh b/gen_compile.sh
517 index cbd3432..cdd4643 100755
518 - --- a/gen_compile.sh
519 +++ b/gen_compile.sh
520 @@ -565,6 +565,58 @@ compile_device_mapper() {
521 compile_lvm
522 }
523
524 +compile_e2fstools() {
525 + if [ -f "${E2FSPROGS_BINCACHE}" ]
526 + then
527 + print_info 1 "e2fstools: >Using cache"
528 + else
529 + [ ! -f "${E2FSPROGS_SRCTAR}" ] &&
530 + gen_die "Could not find e2fsprogs source tarball:
531 ${E2FSPROGS_SRCTAR}. Please place it there, or place another version,
532 changing /etc/genkernel.conf as necessary!"
533 + cd "${TEMP}"
534 + rm -rf "${E2FSPROGS_DIR}"
535 + tar -zxpf "${E2FSPROGS_SRCTAR}"
536 + [ ! -d "${E2FSPROGS_DIR}" ] &&
537 + gen_die "e2fsprogs directory ${E2FSPROGS_DIR} invalid"
538 + cd "${E2FSPROGS_DIR}"
539 + print_info 1 'e2fsprogs: >Configuring...'
540 + LDFLAGS="-static" ./configure >${LOGFILE} 2>&1 ||
541 + gen_die 'Configuring e2fsprogs failed!'
542 + print_info 1 'e2fsprogs: >Compiling libs...'
543 + #MAKE=${UTILS_MAKE} compile_generic "" ""
544 + make libs >${LOGFILE} 2>&1 ||
545 + gen_die 'Compiling e2fsprogs libs failed!'
546 + print_info 1 'e2fsprogs: >Compiling e2fsck...'
547 + cd "${TEMP}/${E2FSPROGS_DIR}/e2fsck"
548 + make e2fsck.static >${LOGFILE} 2>&1 ||
549 + gen_die 'Compiling static e2fsck failed!'
550 + cd "${TEMP}/${E2FSPROGS_DIR}/misc"
551 + print_info 1 'e2fsprogs: >Compiling mke2fs...'
552 + make mke2fs.static >${LOGFILE} 2>&1 ||
553 + gen_die 'Compiling static mke2fs failed!'
554 + cd "${TEMP}/${E2FSPROGS_DIR}"
555 + print_info 1 'e2fsprogs: >Copying to cache...'
556 + [ -f "${TEMP}/${E2FSPROGS_DIR}/misc/mke2fs.static" ] ||
557 + gen_die 'mke2fs executable does not exist!'
558 + [ -f "${TEMP}/${E2FSPROGS_DIR}/e2fsck/e2fsck.static" ] ||
559 + gen_die 'e2fsck executable does not exist!'
560 + strip "${TEMP}/${E2FSPROGS_DIR}/misc/mke2fs.static"
561 "${TEMP}/${E2FSPROGS_DIR}/e2fsck/e2fsck.static" ||
562 + gen_die 'Could not strip e2fs binaries!'
563 +
564 + mkdir "${TEMP}/e2fsprogs"
565 + mkdir "${TEMP}/e2fsprogs/sbin"
566 + install -m 0755 -s misc/mke2fs.static "${TEMP}/e2fsprogs/sbin/mke2fs"
567 + install -m 0755 -s e2fsck/e2fsck.static "${TEMP}/e2fsprogs/sbin/e2fsck"
568 + print_info 1 ' >Copying to bincache...'
569 + cd "${TEMP}/e2fsprogs"
570 + /bin/tar -cjf "${E2FSPROGS_BINCACHE}" sbin/ ||
571 + gen_die 'Could not create binary cache'
572 +
573 + cd "${TEMP}"
574 + rm -rf "${TEMP}/e2fsprogs" /dev/null
575 + rm -rf "${E2FSPROGS_DIR}" /dev/null
576 + fi
577 +}
578 +
579 compile_fuse() {
580 if [ ! -f "${FUSE_BINCACHE}" ]
581 then
582 diff --git a/gen_determineargs.sh b/gen_determineargs.sh
583 index 7f352f8..a0563fd 100755
584 - --- a/gen_determineargs.sh
585 +++ b/gen_determineargs.sh
586 @@ -144,6 +144,7 @@ determine_real_args() {
587 MDADM_BINCACHE=`cache_replace "${MDADM_BINCACHE}"`
588 DMRAID_BINCACHE=`cache_replace "${DMRAID_BINCACHE}"`
589 ISCSI_BINCACHE=`cache_replace "${ISCSI_BINCACHE}"`
590 + E2FSPROGS_BINCACHE=`cache_replace "${E2FSPROGS_BINCACHE}"`
591 BLKID_BINCACHE=`cache_replace "${BLKID_BINCACHE}"`
592 FUSE_BINCACHE=`cache_replace "${FUSE_BINCACHE}"`
593 UNIONFS_FUSE_BINCACHE=`cache_replace "${UNIONFS_FUSE_BINCACHE}"`
594 diff --git a/gen_initramfs.sh b/gen_initramfs.sh
595 index ac90830..75bb47f 100755
596 - --- a/gen_initramfs.sh
597 +++ b/gen_initramfs.sh
598 @@ -127,6 +127,26 @@ append_busybox() {
599 rm -rf "${TEMP}/initramfs-busybox-temp" /dev/null
600 }
601
602 +# Used to add e2fs file making inside initramfs for aufs changes saving
603 +append_e2fstools(){
604 + if [ -d "${TEMP}/initramfs-e2fsprogs-temp" ]
605 + then
606 + rm -r "${TEMP}/initramfs-e2fsprogs-temp/"
607 + fi
608 + #print_info 1 'E2FSTOOLS: Adding support (compiling binaries)...'
609 + # Using different name for blkid compatibility
610 + #compile_e2fstools
611 + cd ${TEMP}
612 + mkdir -p "${TEMP}/initramfs-e2fsprogs-temp/"
613 + #XXX: do we want to add an if statement here or just include it? I say
614 include it...
615 + copy_binaries "${TEMP}"/initramfs-e2fsprogs-temp/ /sbin/{e2fsck,mke2fs}
616 + #/bin/tar -jxpf "${E2FSPROGS_BINCACHE}" -C
617 "${TEMP}/initramfs-e2fsprogs-temp/" ||
618 + # gen_die "Could not extract e2fsprogs binary cache!"
619 + cd "${TEMP}/initramfs-e2fsprogs-temp/"
620 + find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
621 + rm -rf "${TEMP}/initramfs-e2fsprogs-temp" /dev/null
622 +}
623 +
624 append_blkid(){
625 if [ -d "${TEMP}/initramfs-blkid-temp" ]
626 then
627 @@ -741,6 +762,7 @@ create_initramfs() {
628 append_data 'base_layout'
629 append_data 'auxilary' "${BUSYBOX}"
630 append_data 'busybox' "${BUSYBOX}"
631 + append_data 'e2fstools'
632 append_data 'lvm' "${LVM}"
633 append_data 'dmraid' "${DMRAID}"
634 append_data 'iscsi' "${ISCSI}"
635 -----BEGIN PGP SIGNATURE-----
636 Version: GnuPG v2.0.19 (GNU/Linux)
637 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
638
639 iQIcBAEBAgAGBQJQHeHeAAoJEKXdFCfdEflKYwUP/isbgCcfiCqQwXX8ZgK+Vd6R
640 u52rQnoiYUukCo6E1D6OCCock/vH+LK6LLFbvk8nlpgBv+Dh5RYEquO4MW47pKy4
641 RXGjyRmVqjN9I39OIq+zcbSLoIz4J6Dhsqy8mdTGOOkucfhofy6TtNVnsl4nheRy
642 AAqFoRIEzMUhyEQvxtJsVotr7e6J2RSQBu1kL7DH6IK927a4zC1FbMrGmqGt2r7f
643 fn6N7wbYx2OBtqTN0dL5q/vUviXpWNpmj4hLeO6N1db4P91I1HmEqR79x3RLpvGV
644 oK7pdv+datdNm9MJDS+LrY3EI6jzlL+Y4DTj14t3OgUrLxsJjFBzfvfZM6eim6ar
645 U88GOa18m+ZLQLXngJSc7I7VvcPStI/rlyg33oL7tx4qadwXIJkEtY51GODZZ2+c
646 H6jh2EEQOhVRGFMZHUSnsdbDiyCRuMl0eQDR7eHysXkkDN8cxFW06aGNiRC2ks+K
647 lUawJFKXQ6Tn5ch1z5wggGLvOEGX1kI3bxf9YzutxnQYqLpg7wamW1By3rZMasSo
648 1cTHGB9JsQz2X5Mxzv20h8h/cGXFHmdrcgomaAtEUsnKx5rC1062f+tBPqGgkgti
649 78iLoh3ERkJnA+zRm9wVEY3hqULAIQAxMg10AjH3EWQr7dhB4QAojqmEu6VJx0ff
650 xcQi2n7sv8p3CwctJe2u
651 =IpDV
652 -----END PGP SIGNATURE-----

Replies

Subject Author
Re: [gentoo-genkernel] RFC: aufs and modules support "Rick \\\"Zero_Chaos\\\" Farina" <zerochaos@g.o>