3 CPIO_ARGS="--quiet -o -H newc"
6 if [ -d "${TEMP}/initramfs-base-temp" ]
8 rm -rf "${TEMP}/initramfs-base-temp" > /dev/null
10 mkdir -p ${TEMP}/initramfs-base-temp/dev
11 mkdir -p ${TEMP}/initramfs-base-temp/bin
12 mkdir -p ${TEMP}/initramfs-base-temp/etc
13 mkdir -p ${TEMP}/initramfs-base-temp/usr
14 mkdir -p ${TEMP}/initramfs-base-temp/proc
15 mkdir -p ${TEMP}/initramfs-base-temp/temp
16 mkdir -p ${TEMP}/initramfs-base-temp/sys
17 mkdir -p ${TEMP}/initramfs-temp/.initrd
18 mkdir -p ${TEMP}/initramfs-base-temp/var/lock/dmraid
19 mkdir -p ${TEMP}/initramfs-base-temp/sbin
20 mkdir -p ${TEMP}/initramfs-base-temp/usr/bin
21 mkdir -p ${TEMP}/initramfs-base-temp/usr/sbin
22 ln -s lib ${TEMP}/initramfs-base-temp/lib64
24 echo "/dev/ram0 / ext2 defaults 0 0" > ${TEMP}/initramfs-base-temp/etc/fstab
25 echo "proc /proc proc defaults 0 0" >> ${TEMP}/initramfs-base-temp/etc/fstab
27 if [ "${DEVFS}" -eq '1' ]
29 echo "REGISTER .* MKOLDCOMPAT" > ${TEMP}/initramfs-base-temp/etc/devfsd.conf
30 echo "UNREGISTER .* RMOLDCOMPAT" >> ${TEMP}/initramfs-base-temp/etc/devfsd.conf
31 echo "REGISTER .* MKNEWCOMPAT" >> ${TEMP}/initramfs-base-temp/etc/devfsd.conf
32 echo "UNREGISTER .* RMNEWCOMPAT" >> ${TEMP}/initramfs-base-temp/etc/devfsd.conf
35 cd ${TEMP}/initramfs-base-temp/dev
36 mknod -m 660 console c 5 1
37 mknod -m 660 null c 1 3
38 mknod -m 600 tty1 c 4 1
39 cd "${TEMP}/initramfs-base-temp/"
40 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
41 rm -rf "${TEMP}/initramfs-base-temp" > /dev/null
45 if [ -d "${TEMP}/initramfs-busybox-temp" ]
47 rm -rf "${TEMP}/initramfs-busybox-temp" > /dev/null
49 mkdir -p "${TEMP}/initramfs-busybox-temp/bin/"
51 cp "${GK_SHARE}/generic/udhcpc.scripts" ${TEMP}/initramfs-busybox-temp/bin/
52 chmod +x "${TEMP}/initramfs-busybox-temp/bin/udhcpc.scripts"
53 cp "${BUSYBOX_BINCACHE}" "${TEMP}/initramfs-busybox-temp/bin/busybox.tar.bz2" ||
54 gen_die 'Could not copy busybox from bincache!'
55 tar -xjf "${TEMP}/initramfs-busybox-temp/bin/busybox.tar.bz2" -C "${TEMP}/initramfs-busybox-temp/bin" busybox ||
56 gen_die 'Could not extract busybox bincache!'
57 chmod +x "${TEMP}/initramfs-busybox-temp/bin/busybox"
59 # down devfsd we use with dietlibc
60 # cp "${DEVFSD_CONF_BINCACHE}" "${TEMP}/initramfs-temp/etc/devfsd.conf.bz2" ||
61 # gen_die "could not copy devfsd.conf from bincache"
62 # bunzip2 "${TEMP}/initramfs-temp/etc/devfsd.conf.bz2" ||
63 # gen_die "could not uncompress devfsd.conf"
64 for i in '[' ash sh mount uname echo cut; do
65 rm -f ${TEMP}/initramfs-busybox-temp/bin/$i > /dev/null
66 ln ${TEMP}/initramfs-busybox-temp/bin/busybox ${TEMP}/initramfs-busybox-temp/bin/$i ||
67 gen_die "Busybox error: could not link ${i}!"
70 cd "${TEMP}/initramfs-busybox-temp/"
71 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
72 rm -rf "${TEMP}/initramfs-busybox-temp" > /dev/null
76 if [ -d "${TEMP}/initramfs-insmod-temp" ]
78 rm -rf "${TEMP}/initramfs-insmod-temp" > /dev/null
80 mkdir -p "${TEMP}/initramfs-insmod-temp/bin/"
81 cp "${MODULE_INIT_TOOLS_BINCACHE}" "${TEMP}/initramfs-insmod-temp/bin/insmod.static.bz2" ||
82 gen_die 'Could not copy insmod.static from bincache!'
84 bunzip2 "${TEMP}/initramfs-insmod-temp/bin/insmod.static.bz2" ||
85 gen_die 'Could not uncompress insmod.static!'
86 mv "${TEMP}/initramfs-insmod-temp/bin/insmod.static" "${TEMP}/initramfs-insmod-temp/bin/insmod"
87 chmod +x "${TEMP}/initramfs-insmod-temp/bin/insmod"
89 cd "${TEMP}/initramfs-insmod-temp/"
90 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
91 rm -rf "${TEMP}/initramfs-insmod-temp" > /dev/null
95 if [ -d "${TEMP}/initramfs-udev-temp" ]
97 rm -r "${TEMP}/initramfs-udev-temp/"
100 mkdir -p "${TEMP}/initramfs-udev-temp/bin/"
101 [ "${UDEV}" -eq '1' ] && { /bin/tar -jxpf "${UDEV_BINCACHE}" -C "${TEMP}/initramfs-udev-temp" ||
102 gen_die "Could not extract udev binary cache!"; }
103 cd "${TEMP}/initramfs-udev-temp/"
104 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
105 rm -rf "${TEMP}/initramfs-udev-temp" > /dev/null
109 if [ -d "${TEMP}/initramfs-blkid-temp" ]
111 rm -r "${TEMP}/initramfs-blkid-temp/"
114 mkdir -p "${TEMP}/initramfs-blkid-temp/bin/"
115 [ "${DISKLABEL}" -eq '1' ] && { /bin/bzip2 -dc "${BLKID_BINCACHE}" > "${TEMP}/initramfs-blkid-temp/bin/blkid" ||
116 gen_die "Could not extract blkid binary cache!"; }
117 chmod a+x "${TEMP}/initramfs-blkid-temp/bin/blkid"
118 cd "${TEMP}/initramfs-blkid-temp/"
119 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
120 rm -rf "${TEMP}/initramfs-blkid-temp" > /dev/null
124 if [ -d "${TEMP}/initramfs-devfs-temp" ]
126 rm -r "${TEMP}/initramfs-devfs-temp/"
129 print_info 1 'DEVFS: Adding support (compiling binaries)...'
131 mkdir -p "${TEMP}/initramfs-devfs-temp/bin/"
132 cp "${DEVFSD_BINCACHE}" "${TEMP}/initramfs-devfs-temp/bin/devfsd.bz2" || gen_die "could not copy devfsd executable from bincache"
133 bunzip2 "${TEMP}/initramfs-devfs-temp/bin/devfsd.bz2" || gen_die "could not uncompress devfsd"
134 chmod +x "${TEMP}/initramfs-devfs-temp/bin/devfsd"
135 cd "${TEMP}/initramfs-devfs-temp/"
136 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
137 rm -rf "${TEMP}/initramfs-devfs-temp" > /dev/null
140 append_unionfs_modules(){
141 if [ -d "${TEMP}/initramfs-unionfs-modules-temp" ]
143 rm -r "${TEMP}/initramfs-unionfs-modules-temp/"
145 print_info 1 'UNIONFS MODULES: Adding support (compiling)...'
146 compile_unionfs_modules
147 mkdir -p "${TEMP}/initramfs-unionfs-modules-temp/"
148 /bin/tar -jxpf "${UNIONFS_MODULES_BINCACHE}" -C "${TEMP}/initramfs-unionfs-modules-temp" ||
149 gen_die "Could not extract unionfs modules binary cache!";
150 cd "${TEMP}/initramfs-unionfs-modules-temp/"
151 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
152 rm -r "${TEMP}/initramfs-unionfs-modules-temp/"
155 append_unionfs_tools(){
156 if [ -d "${TEMP}/initramfs-unionfs-tools-temp" ]
158 rm -r "${TEMP}/initramfs-unionfs-tools-temp/"
160 print_info 1 'UNIONFS TOOLS: Adding support (compiling)...'
161 compile_unionfs_utils
162 mkdir -p "${TEMP}/initramfs-unionfs-tools-temp/bin/"
163 /bin/tar -jxpf "${UNIONFS_BINCACHE}" -C "${TEMP}/initramfs-unionfs-tools-temp" ||
164 gen_die "Could not extract unionfs tools binary cache!";
165 cd "${TEMP}/initramfs-unionfs-tools-temp/"
166 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
167 rm -r "${TEMP}/initramfs-unionfs-tools-temp/"
171 if [ -d "${TEMP}/initramfs-suspend-temp" ];
173 rm -r "${TEMP}/initramfs-suspend-temp/"
175 print_info 1 'SUSPEND: Adding support (compiling binaries)...'
177 mkdir -p "${TEMP}/initramfs-suspend-temp/"
178 /bin/tar -jxpf "${SUSPEND_BINCACHE}" -C "${TEMP}/initramfs-suspend-temp" ||
179 gen_die "Could not extract suspend binary cache!"
180 mkdir -p "${TEMP}/initramfs-suspend-temp/etc"
181 cp -f /etc/suspend.conf "${TEMP}/initramfs-suspend-temp/etc" ||
182 gen_die 'Could not copy /etc/suspend.conf'
183 cd "${TEMP}/initramfs-suspend-temp/"
184 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
185 rm -r "${TEMP}/initramfs-suspend-temp/"
189 if [ -d "${TEMP}/initramfs-dmraid-temp" ]
191 rm -r "${TEMP}/initramfs-dmraid-temp/"
193 print_info 1 'DMRAID: Adding support (compiling binaries)...'
195 mkdir -p "${TEMP}/initramfs-dmraid-temp/"
196 /bin/tar -jxpf "${DMRAID_BINCACHE}" -C "${TEMP}/initramfs-dmraid-temp" ||
197 gen_die "Could not extract dmraid binary cache!";
198 cd "${TEMP}/initramfs-dmraid-temp/"
199 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
200 rm -r "${TEMP}/initramfs-dmraid-temp/"
204 if [ -d "${TEMP}/initramfs-lvm2-temp" ]
206 rm -r "${TEMP}/initramfs-lvm2-temp/"
209 mkdir -p "${TEMP}/initramfs-lvm2-temp/bin/"
210 mkdir -p "${TEMP}/initramfs-lvm2-temp/etc/lvm/"
211 if [ -e '/sbin/lvm' ] && LC_ALL="C" ldd /sbin/lvm|grep -q 'not a dynamic executable'
213 print_info 1 ' LVM2: Adding support (using local static binaries)...'
214 cp /sbin/lvm "${TEMP}/initramfs-lvm2-temp/bin/lvm" ||
215 gen_die 'Could not copy over lvm!'
217 print_info 1 ' LVM2: Adding support (compiling binaries)...'
219 /bin/tar -jxpf "${LVM2_BINCACHE}" -C "${TEMP}/initramfs-lvm2-temp" ||
220 gen_die "Could not extract lvm2 binary cache!";
221 mv ${TEMP}/initramfs-lvm2-temp/sbin/lvm.static ${TEMP}/initramfs-lvm2-temp/bin/lvm ||
222 gen_die 'LVM2 error: Could not move lvm.static to lvm!'
226 # lvm dumpconfig 2>&1 > /dev/null || gen_die 'Could not copy over lvm.conf!'
230 cp /etc/lvm/lvm.conf "${TEMP}/initramfs-lvm2-temp/etc/lvm/" ||
231 gen_die 'Could not copy over lvm.conf!'
233 # gen_die 'Could not copy over lvm.conf!'
236 cd "${TEMP}/initramfs-lvm2-temp/"
237 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
238 rm -r "${TEMP}/initramfs-lvm2-temp/"
242 if [ -d "${TEMP}/initramfs-evms2-temp" ]
244 rm -r "${TEMP}/initramfs-evms2-temp/"
246 mkdir -p "${TEMP}/initramfs-evms2-temp/lib/evms"
247 mkdir -p "${TEMP}/initramfs-evms2-temp/etc/"
248 mkdir -p "${TEMP}/initramfs-evms2-temp/bin/"
249 mkdir -p "${TEMP}/initramfs-evms2-temp/sbin/"
250 if [ "${EVMS2}" -eq '1' ]
252 print_info 1 ' EVMS2: Adding support...'
253 mkdir -p ${TEMP}/initramfs-evms2-temp/lib
254 cp -a /lib/ld-* "${TEMP}/initramfs-evms2-temp/lib" \
255 || gen_die 'Could not copy files for EVMS2!'
256 if [ -n "`ls /lib/libgcc_s*`" ]
258 cp -a /lib/libgcc_s* "${TEMP}/initramfs-evms2-temp/lib" \
259 || gen_die 'Could not copy files for EVMS2!'
261 cp -a /lib/libc-* /lib/libc.* "${TEMP}/initramfs-evms2-temp/lib" \
262 || gen_die 'Could not copy files for EVMS2!'
263 cp -a /lib/libdl-* /lib/libdl.* "${TEMP}/initramfs-evms2-temp/lib" \
264 || gen_die 'Could not copy files for EVMS2!'
265 cp -a /lib/libpthread* "${TEMP}/initramfs-evms2-temp/lib" \
266 || gen_die 'Could not copy files for EVMS2!'
267 cp -a /lib/libuuid*so* "${TEMP}/initramfs-evms2-temp/lib" \
268 || gen_die 'Could not copy files for EVMS2!'
269 cp -a /lib/libevms*so* "${TEMP}/initramfs-evms2-temp/lib" \
270 || gen_die 'Could not copy files for EVMS2!'
271 cp -a /lib/evms "${TEMP}/initramfs-evms2-temp/lib" \
272 || gen_die 'Could not copy files for EVMS2!'
273 cp -a /lib/evms/* "${TEMP}/initramfs-evms2-temp/lib/evms" \
274 || gen_die 'Could not copy files for EVMS2!'
275 cp -a /etc/evms.conf "${TEMP}/initramfs-evms2-temp/etc" \
276 || gen_die 'Could not copy files for EVMS2!'
277 cp /sbin/evms_activate "${TEMP}/initramfs-evms2-temp/sbin" \
278 || gen_die 'Could not copy over evms_activate!'
280 # Fix EVMS2 complaining that it can't find the swap utilities.
281 # These are not required in the initramfs
282 for swap_libs in "${TEMP}/initramfs-evms2-temp/lib/evms/*/swap*.so"
287 cd "${TEMP}/initramfs-evms2-temp/"
288 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
289 rm -r "${TEMP}/initramfs-evms2-temp/"
293 if [ -x /usr/bin/splash_geninitramfs ] || [ -x /sbin/splash_geninitramfs ]
295 [ -z "${GENSPLASH_THEME}" ] && [ -e /etc/conf.d/splash ] && source /etc/conf.d/splash
296 [ -z "${GENSPLASH_THEME}" ] && GENSPLASH_THEME=default
297 print_info 1 " >> Installing gensplash [ using the ${GENSPLASH_THEME} theme ]..."
298 if [ -d "${TEMP}/initramfs-gensplash-temp" ]
300 rm -r "${TEMP}/initramfs-gensplash-temp/"
302 mkdir -p "${TEMP}/initramfs-gensplash-temp"
305 [ -n "${GENSPLASH_RES}" ] && tmp="-r ${GENSPLASH_RES}"
306 splash_geninitramfs -c "${TEMP}/initramfs-gensplash-temp" ${tmp} ${GENSPLASH_THEME} || gen_die "Could not build splash cpio archive"
307 if [ -e "/usr/share/splashutils/initrd.splash" ]; then
308 mkdir -p "${TEMP}/initramfs-gensplash-temp/etc"
309 cp -f "/usr/share/splashutils/initrd.splash" "${TEMP}/initramfs-gensplash-temp/etc"
311 cd "${TEMP}/initramfs-gensplash-temp/"
312 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \
313 || gen_die "compressing splash cpio"
314 rm -r "${TEMP}/initramfs-gensplash-temp/"
316 print_warning 1 ' >> No splash detected; skipping!'
321 cd ${INITRAMFS_OVERLAY}
322 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
338 print_info 2 "initramfs: >> Searching for modules..."
339 if [ "${INSTALL_MOD_PATH}" != '' ]
341 cd ${INSTALL_MOD_PATH}
346 if [ -d "${TEMP}/initramfs-modules-${KV}-temp" ]
348 rm -r "${TEMP}/initramfs-modules-${KV}-temp/"
350 mkdir -p "${TEMP}/initramfs-modules-${KV}-temp/lib/modules/${KV}"
351 for i in `gen_dep_list`
353 mymod=`find ./lib/modules/${KV} -name "${i}${MOD_EXT}" 2>/dev/null| head -n 1 `
356 print_warning 2 "Warning :: ${i}${MOD_EXT} not found; skipping..."
360 print_info 2 "initramfs: >> Copying ${i}${MOD_EXT}..."
361 cp -ax --parents "${mymod}" "${TEMP}/initramfs-modules-${KV}-temp"
364 cp -ax --parents ./lib/modules/${KV}/modules* ${TEMP}/initramfs-modules-${KV}-temp 2>/dev/null
366 mkdir -p "${TEMP}/initramfs-modules-${KV}-temp/etc/modules"
367 for group_modules in ${!MODULES_*}; do
368 group="$(echo $group_modules | cut -d_ -f2 | tr "[:upper:]" "[:lower:]")"
369 print_list ${!group_modules} > "${TEMP}/initramfs-modules-${KV}-temp/etc/modules/${group}"
371 cd "${TEMP}/initramfs-modules-${KV}-temp/"
372 find . | cpio ${CPIO_ARGS} --append -F "${CPIO}"
373 rm -r "${TEMP}/initramfs-modules-${KV}-temp/"
376 # check for static linked file with objdump
378 LANG="C" LC_ALL="C" objdump -T $1 2>&1 | grep "not a dynamic object" > /dev/null
383 if [ -d "${TEMP}/initramfs-aux-temp" ]
385 rm -r "${TEMP}/initramfs-aux-temp/"
387 mkdir -p "${TEMP}/initramfs-aux-temp/etc"
388 mkdir -p "${TEMP}/initramfs-aux-temp/sbin"
389 if [ -f "${CMD_LINUXRC}" ]
391 cp "${CMD_LINUXRC}" "${TEMP}/initramfs-aux-temp/init"
392 print_info 2 " >> Copying user specified linuxrc: ${CMD_LINUXRC} to init"
394 if [ -f "${GK_SHARE}/${ARCH}/linuxrc" ]
396 cp "${GK_SHARE}/${ARCH}/linuxrc" "${TEMP}/initramfs-aux-temp/init"
398 cp "${GK_SHARE}/generic/linuxrc" "${TEMP}/initramfs-aux-temp/init"
402 # Make sure it's executable
403 chmod 0755 "${TEMP}/initramfs-aux-temp/init"
405 # Make a symlink to init .. incase we are bundled inside the kernel as one
407 cd ${TEMP}/initramfs-aux-temp
409 # ln ${TEMP}/initramfs-aux-temp/init ${TEMP}/initramfs-aux-temp/linuxrc
411 if [ -f "${GK_SHARE}/${ARCH}/initrd.scripts" ]
413 cp "${GK_SHARE}/${ARCH}/initrd.scripts" "${TEMP}/initramfs-aux-temp/etc/initrd.scripts"
415 cp "${GK_SHARE}/generic/initrd.scripts" "${TEMP}/initramfs-aux-temp/etc/initrd.scripts"
418 if [ -f "${GK_SHARE}/${ARCH}/initrd.defaults" ]
420 cp "${GK_SHARE}/${ARCH}/initrd.defaults" "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
422 cp "${GK_SHARE}/generic/initrd.defaults" "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
425 echo -n 'HWOPTS="$HWOPTS ' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
426 for group_modules in ${!MODULES_*}; do
427 group="$(echo $group_modules | cut -d_ -f2 | tr "[:upper:]" "[:lower:]")"
428 echo -n "${group} " >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
430 echo '"' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
432 if [ -f "${GK_SHARE}/${ARCH}/modprobe" ]
434 cp "${GK_SHARE}/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe"
436 cp "${GK_SHARE}/generic/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe"
438 if isTrue $CMD_DOKEYMAPAUTO
440 echo 'MY_HWOPTS="${MY_HWOPTS} keymap"' >> ${TEMP}/initramfs-aux-temp/etc/initrd.defaults
442 mkdir -p "${TEMP}/initramfs-aux-temp/lib/keymaps"
443 /bin/tar -C "${TEMP}/initramfs-aux-temp/lib/keymaps" -zxf "${GK_SHARE}/generic/keymaps.tar.gz"
444 if isTrue $CMD_SLOWUSB
446 echo 'MY_HWOPTS="${MY_HWOPTS} slowusb"' >> ${TEMP}/initramfs-aux-temp/etc/initrd.defaults
450 if is_static /bin/cryptsetup
452 print_info 1 "Including LUKS support"
453 rm -f ${TEMP}/initramfs-aux-temp/sbin/cryptsetup
454 cp /bin/cryptsetup ${TEMP}/initramfs-aux-temp/sbin/cryptsetup
455 chmod +x "${TEMP}/initramfs-aux-temp/sbin/cryptsetup"
457 print_info 1 "LUKS support requires static cryptsetup at /bin/cryptsetup"
458 print_info 1 "Not including LUKS support"
462 cd ${TEMP}/initramfs-aux-temp/sbin && ln -s ../init init
464 chmod +x "${TEMP}/initramfs-aux-temp/init"
465 chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts"
466 chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
467 chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe"
468 cd "${TEMP}/initramfs-aux-temp/"
469 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
470 rm -r "${TEMP}/initramfs-aux-temp/"
475 local func="append_${name}"
477 if [ $# -eq '1' ] || [ "${var}" -eq '1' ]
479 print_info 1 " >> Appending ${name} cpio data..."
485 print_info 1 "initramfs: >> Initializing..."
488 CPIO="${TMPDIR}/initramfs-${KV}"
489 echo | cpio ${CPIO_ARGS} -F "${CPIO}" 2>/dev/null \
490 || gen_die "Could not create empty cpio at ${CPIO}"
492 append_data 'base_layout'
493 append_data 'auxilary'
494 append_data 'busybox' "${BUSYBOX}"
495 append_data 'devfs' "${DEVFS}"
496 # append_data 'udev' "${UDEV}"
497 append_data 'unionfs_modules' "${UNIONFS}"
498 append_data 'unionfs_tools' "${UNIONFS}"
499 append_data 'suspend' "${SUSPEND}"
500 append_data 'lvm2' "${LVM2}"
501 append_data 'dmraid' "${DMRAID}"
502 append_data 'evms2' "${EVMS2}"
504 if [ "${NOINITRDMODULES}" = '' ]
507 append_data 'modules'
509 print_info 1 "initramfs: Not copying modules..."
512 append_data 'blkid' "${DISKLABEL}"
513 append_data 'gensplash' "${GENSPLASH}"
515 # This should always be appended last
516 if [ "${INITRAMFS_OVERLAY}" != '' ]
518 append_data 'overlay'
522 mv -f "${CPIO}.gz" "${CPIO}"
524 # Pegasos hack for merging the initramfs into the kernel at compile time
525 [ "${KERNEL_MAKE_DIRECTIVE}" == 'zImage.initrd' -a "${GENERATE_Z_IMAGE}" = '1' ] ||
526 [ "${KERNEL_MAKE_DIRECTIVE_2}" == 'zImage.initrd' -a "${GENERATE_Z_IMAGE}" = '1' ] &&
527 cp ${TMPDIR}/initramfs-${KV} ${KERNEL_DIR}/arch/powerpc/boot/ramdisk.image.gz &&
528 rm ${TMPDIR}/initramfs-${KV}
530 # Mips also mimics Pegasos to merge the initramfs into the kernel
531 if [ ${BUILD_INITRAMFS} -eq 1 ]; then
532 cp ${TMPDIR}/initramfs-${KV} ${KERNEL_DIR}/initramfs.cpio.gz
533 gunzip -f ${KERNEL_DIR}/initramfs.cpio.gz
536 if ! isTrue "${CMD_NOINSTALL}"
538 if [ "${GENERATE_Z_IMAGE}" != '1' ]
540 copy_image_with_preserve "initramfs" \
541 "${TMPDIR}/initramfs-${KV}" \
542 "initramfs-${KNAME}-${ARCH}-${KV}"