3 CPIO_ARGS="--quiet -o -H newc"
6 if [ -d "${TEMP}/initramfs-base-temp" ]
8 rm -rf "${TEMP}/initramfs-base-temp" > /dev/null
11 mkdir -p ${TEMP}/initramfs-base-temp/dev
12 mkdir -p ${TEMP}/initramfs-base-temp/bin
13 mkdir -p ${TEMP}/initramfs-base-temp/etc
14 mkdir -p ${TEMP}/initramfs-base-temp/usr
15 mkdir -p ${TEMP}/initramfs-base-temp/proc
16 mkdir -p ${TEMP}/initramfs-base-temp/temp
17 mkdir -p ${TEMP}/initramfs-base-temp/sys
18 mkdir -p ${TEMP}/initramfs-temp/.initrd
19 mkdir -p ${TEMP}/initramfs-base-temp/var/lock/dmraid
20 mkdir -p ${TEMP}/initramfs-base-temp/sbin
21 mkdir -p ${TEMP}/initramfs-base-temp/usr/bin
22 mkdir -p ${TEMP}/initramfs-base-temp/usr/sbin
23 ln -s lib ${TEMP}/initramfs-base-temp/lib64
25 echo "/dev/ram0 / ext2 defaults 0 0" > ${TEMP}/initramfs-base-temp/etc/fstab
26 echo "proc /proc proc defaults 0 0" >> ${TEMP}/initramfs-base-temp/etc/fstab
28 cd ${TEMP}/initramfs-base-temp/dev
29 mknod -m 660 console c 5 1
30 mknod -m 660 null c 1 3
31 mknod -m 600 tty1 c 4 1
33 date '+%Y%m%d' > ${TEMP}/initramfs-base-temp/etc/build_date
35 cd "${TEMP}/initramfs-base-temp/"
36 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
37 rm -rf "${TEMP}/initramfs-base-temp" > /dev/null
41 if [ -d "${TEMP}/initramfs-busybox-temp" ]
43 rm -rf "${TEMP}/initramfs-busybox-temp" > /dev/null
46 mkdir -p "${TEMP}/initramfs-busybox-temp/bin/"
47 tar -xjf "${BUSYBOX_BINCACHE}" -C "${TEMP}/initramfs-busybox-temp/bin" busybox ||
48 gen_die 'Could not extract busybox bincache!'
49 chmod +x "${TEMP}/initramfs-busybox-temp/bin/busybox"
51 mkdir -p "${TEMP}/initramfs-busybox-temp/usr/share/udhcpc/"
52 cp "${GK_SHARE}/defaults/udhcpc.scripts" ${TEMP}/initramfs-busybox-temp/usr/share/udhcpc/default.script
53 chmod +x "${TEMP}/initramfs-busybox-temp/usr/share/udhcpc/default.script"
55 # Set up a few default symlinks
56 for i in '[' ash sh mount uname echo cut cat; do
57 rm -f ${TEMP}/initramfs-busybox-temp/bin/$i > /dev/null
58 ln ${TEMP}/initramfs-busybox-temp/bin/busybox ${TEMP}/initramfs-busybox-temp/bin/$i ||
59 gen_die "Busybox error: could not link ${i}!"
62 cd "${TEMP}/initramfs-busybox-temp/"
63 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
64 rm -rf "${TEMP}/initramfs-busybox-temp" > /dev/null
68 if [ -d "${TEMP}/initramfs-blkid-temp" ]
70 rm -r "${TEMP}/initramfs-blkid-temp/"
73 mkdir -p "${TEMP}/initramfs-blkid-temp/bin/"
74 [ "${DISKLABEL}" -eq '1' ] && { /bin/bzip2 -dc "${BLKID_BINCACHE}" > "${TEMP}/initramfs-blkid-temp/bin/blkid" ||
75 gen_die "Could not extract blkid binary cache!"; }
76 chmod a+x "${TEMP}/initramfs-blkid-temp/bin/blkid"
77 cd "${TEMP}/initramfs-blkid-temp/"
78 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
79 rm -rf "${TEMP}/initramfs-blkid-temp" > /dev/null
83 # if [ -d "${TEMP}/initramfs-fuse-temp" ]
85 # rm -r "${TEMP}/initramfs-fuse-temp"
88 # mkdir -p "${TEMP}/initramfs-fuse-temp/lib/"
89 # tar -C "${TEMP}/initramfs-fuse-temp/lib/" -xjf "${FUSE_BINCACHE}"
90 # cd "${TEMP}/initramfs-fuse-temp/"
91 # find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
92 # rm -rf "${TEMP}/initramfs-fuse-temp" > /dev/null
95 append_unionfs_fuse() {
96 if [ -d "${TEMP}/initramfs-unionfs-fuse-temp" ]
98 rm -r "${TEMP}/initramfs-unionfs-fuse-temp"
101 mkdir -p "${TEMP}/initramfs-unionfs-fuse-temp/sbin/"
102 bzip2 -dc "${UNIONFS_FUSE_BINCACHE}" > "${TEMP}/initramfs-unionfs-fuse-temp/sbin/unionfs" ||
103 gen_die 'Could not extract unionfs-fuse binary cache!'
104 chmod a+x "${TEMP}/initramfs-unionfs-fuse-temp/sbin/unionfs"
105 cd "${TEMP}/initramfs-unionfs-fuse-temp/"
106 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
107 rm -rf "${TEMP}/initramfs-unionfs-fuse-temp" > /dev/null
111 # if [ -d "${TEMP}/initramfs-suspend-temp" ];
113 # rm -r "${TEMP}/initramfs-suspend-temp/"
115 # print_info 1 'SUSPEND: Adding support (compiling binaries)...'
117 # mkdir -p "${TEMP}/initramfs-suspend-temp/"
118 # /bin/tar -jxpf "${SUSPEND_BINCACHE}" -C "${TEMP}/initramfs-suspend-temp" ||
119 # gen_die "Could not extract suspend binary cache!"
120 # mkdir -p "${TEMP}/initramfs-suspend-temp/etc"
121 # cp -f /etc/suspend.conf "${TEMP}/initramfs-suspend-temp/etc" ||
122 # gen_die 'Could not copy /etc/suspend.conf'
123 # cd "${TEMP}/initramfs-suspend-temp/"
124 # find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
125 # rm -r "${TEMP}/initramfs-suspend-temp/"
129 if [ -d "${TEMP}/initramfs-multipath-temp" ]
131 rm -r "${TEMP}/initramfs-multipath-temp"
133 print_info 1 ' Multipath support being added'
134 mkdir -p "${TEMP}/initramfs-multipath-temp/bin/"
135 mkdir -p "${TEMP}/initramfs-multipath-temp/etc/"
136 mkdir -p "${TEMP}/initramfs-multipath-temp/sbin/"
137 mkdir -p "${TEMP}/initramfs-multipath-temp/lib/"
138 cp -a /lib/ld-* "${TEMP}/initramfs-multipath-temp/lib" \
139 || gen_die 'Could not copy files for MULTIPATH!'
140 cp -a /lib/libc-* /lib/libc.* "${TEMP}/initramfs-multipath-temp/lib" \
141 cp -a /lib/libdl-* /lib/libdl.* "${TEMP}/initramfs-multipath-temp/lib" \
142 cp -a /lib/libsysfs*so* "${TEMP}/initramfs-multipath-temp/lib" \
143 cp -a /lib/libdevmapper*so* "${TEMP}/initramfs-multipath-temp/lib" \
144 cp -a /sbin/multipath "${TEMP}/initramfs-multipath-temp/sbin" \
145 cp -a /sbin/kpartx "${TEMP}/initramfs-multipath-temp/sbin" \
146 cp -a /sbin/mpath_prio_* "${TEMP}/initramfs-multipath-temp/sbin" \
147 cp -a /lib64/udev/scsi_id "${TEMP}/initramfs-multipath-temp/sbin" \
148 cp -a /sbin/devmap_name "${TEMP}/initramfs-multipath-temp/sbin" \
149 cp -a /sbin/dmsetup "${TEMP}/initramfs-multipath-temp/sbin" \
150 cp -a /sbin/dmsetup "${TEMP}/initramfs-multipath-temp/sbin" \
151 cp -a /bin/mountpoint "${TEMP}/initramfs-multipath-temp/bin" \
152 if [ -x /sbin/multipath ]
154 cp /etc/multipath.conf "${TEMP}/initramfs-multipath-temp/etc/" || gen_die 'could not copy /etc/multipath.conf please check this'
156 if [ -x /sbin/scsi_id ]
158 cp /etc/scsi_id.config "${TEMP}/initramfs-multipath-temp/etc/" || gen_die 'could not copy scsi_id.config'
160 cd "${TEMP/initramfs-multipath-temp/"
161 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
162 rm -r "${TEMP}/initramfs-multipath-temp/"
166 if [ -d "${TEMP}/initramfs-dmraid-temp" ]
168 rm -r "${TEMP}/initramfs-dmraid-temp/"
170 print_info 1 'DMRAID: Adding support (compiling binaries)...'
172 mkdir -p "${TEMP}/initramfs-dmraid-temp/"
173 /bin/tar -jxpf "${DMRAID_BINCACHE}" -C "${TEMP}/initramfs-dmraid-temp" ||
174 gen_die "Could not extract dmraid binary cache!";
175 cd "${TEMP}/initramfs-dmraid-temp/"
176 RAID456=`find . -type f -name raid456.ko`
177 if [ -n "${RAID456}" ]
179 cd "${RAID456/raid456.ko/}"
180 ln -sf raid456.kp raid45.ko
181 cd "${TEMP}/initramfs-dmraid-temp/"
183 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
184 rm -r "${TEMP}/initramfs-dmraid-temp/"
188 if [ -d "${TEMP}/initramfs-lvm-temp" ]
190 rm -r "${TEMP}/initramfs-lvm-temp/"
193 mkdir -p "${TEMP}/initramfs-lvm-temp/bin/"
194 mkdir -p "${TEMP}/initramfs-lvm-temp/etc/lvm/"
195 if [ -e '/sbin/lvm' ] && LC_ALL="C" ldd /sbin/lvm|grep -q 'not a dynamic executable'
197 print_info 1 ' LVM: Adding support (using local static binaries)...'
198 cp /sbin/lvm "${TEMP}/initramfs-lvm-temp/bin/lvm" ||
199 gen_die 'Could not copy over lvm!'
201 print_info 1 ' LVM: Adding support (compiling binaries)...'
203 /bin/tar -jxpf "${LVM_BINCACHE}" -C "${TEMP}/initramfs-lvm-temp" ||
204 gen_die "Could not extract lvm binary cache!";
205 mv ${TEMP}/initramfs-lvm-temp/sbin/lvm.static ${TEMP}/initramfs-lvm-temp/bin/lvm ||
206 gen_die 'LVM error: Could not move lvm.static to lvm!'
210 # lvm dumpconfig 2>&1 > /dev/null || gen_die 'Could not copy over lvm.conf!'
214 cp /etc/lvm/lvm.conf "${TEMP}/initramfs-lvm-temp/etc/lvm/" ||
215 gen_die 'Could not copy over lvm.conf!'
217 # gen_die 'Could not copy over lvm.conf!'
220 cd "${TEMP}/initramfs-lvm-temp/"
221 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
222 rm -r "${TEMP}/initramfs-lvm-temp/"
226 if [ -d "${TEMP}/initramfs-evms-temp" ]
228 rm -r "${TEMP}/initramfs-evms-temp/"
230 mkdir -p "${TEMP}/initramfs-evms-temp/lib/evms"
231 mkdir -p "${TEMP}/initramfs-evms-temp/etc/"
232 mkdir -p "${TEMP}/initramfs-evms-temp/bin/"
233 mkdir -p "${TEMP}/initramfs-evms-temp/sbin/"
234 if [ "${EVMS}" -eq '1' ]
236 print_info 1 ' EVMS: Adding support...'
237 mkdir -p ${TEMP}/initramfs-evms-temp/lib
238 cp -a /lib/ld-* "${TEMP}/initramfs-evms-temp/lib" \
239 || gen_die 'Could not copy files for EVMS!'
240 if [ -n "`ls /lib/libgcc_s*`" ]
242 cp -a /lib/libgcc_s* "${TEMP}/initramfs-evms-temp/lib" \
243 || gen_die 'Could not copy files for EVMS!'
245 cp -a /lib/libc-* /lib/libc.* "${TEMP}/initramfs-evms-temp/lib" \
246 || gen_die 'Could not copy files for EVMS!'
247 cp -a /lib/libdl-* /lib/libdl.* "${TEMP}/initramfs-evms-temp/lib" \
248 || gen_die 'Could not copy files for EVMS!'
249 cp -a /lib/libpthread* "${TEMP}/initramfs-evms-temp/lib" \
250 || gen_die 'Could not copy files for EVMS!'
251 cp -a /lib/libuuid*so* "${TEMP}/initramfs-evms-temp/lib" \
252 || gen_die 'Could not copy files for EVMS!'
253 cp -a /lib/libevms*so* "${TEMP}/initramfs-evms-temp/lib" \
254 || gen_die 'Could not copy files for EVMS!'
255 cp -a /lib/evms "${TEMP}/initramfs-evms-temp/lib" \
256 || gen_die 'Could not copy files for EVMS!'
257 cp -a /lib/evms/* "${TEMP}/initramfs-evms-temp/lib/evms" \
258 || gen_die 'Could not copy files for EVMS!'
259 cp -a /etc/evms.conf "${TEMP}/initramfs-evms-temp/etc" \
260 || gen_die 'Could not copy files for EVMS!'
261 cp /sbin/evms_activate "${TEMP}/initramfs-evms-temp/sbin" \
262 || gen_die 'Could not copy over evms_activate!'
264 # Fix EVMS complaining that it can't find the swap utilities.
265 # These are not required in the initramfs
266 for swap_libs in "${TEMP}/initramfs-evms-temp/lib/evms/*/swap*.so"
271 cd "${TEMP}/initramfs-evms-temp/"
272 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
273 rm -r "${TEMP}/initramfs-evms-temp/"
277 if [ -d "${TEMP}/initramfs-mdadm-temp" ]
279 rm -r "${TEMP}/initramfs-mdadm-temp/"
282 mkdir -p "${TEMP}/initramfs-mdadm-temp/etc/"
283 if [ "${MDADM}" -eq '1' ]
285 cp -a /etc/mdadm.conf "${TEMP}/initramfs-mdadm-temp/etc" \
286 || gen_die "Could not copy mdadm.conf!"
288 cd "${TEMP}/initramfs-mdadm-temp/"
289 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
290 rm -rf "${TEMP}/initramfs-mdadm-temp" > /dev/null
294 splash_geninitramfs=`which splash_geninitramfs 2>/dev/null`
295 if [ -x "${splash_geninitramfs}" ]
297 [ -z "${SPLASH_THEME}" ] && [ -e /etc/conf.d/splash ] && source /etc/conf.d/splash
298 [ -z "${SPLASH_THEME}" ] && SPLASH_THEME=default
299 print_info 1 " >> Installing splash [ using the ${SPLASH_THEME} theme ]..."
300 if [ -d "${TEMP}/initramfs-splash-temp" ]
302 rm -r "${TEMP}/initramfs-splash-temp/"
304 mkdir -p "${TEMP}/initramfs-splash-temp"
307 [ -n "${SPLASH_RES}" ] && tmp="-r ${SPLASH_RES}"
308 splash_geninitramfs -c "${TEMP}/initramfs-splash-temp" ${tmp} ${SPLASH_THEME} || gen_die "Could not build splash cpio archive"
309 if [ -e "/usr/share/splashutils/initrd.splash" ]; then
310 mkdir -p "${TEMP}/initramfs-splash-temp/etc"
311 cp -f "/usr/share/splashutils/initrd.splash" "${TEMP}/initramfs-splash-temp/etc"
313 cd "${TEMP}/initramfs-splash-temp/"
314 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \
315 || gen_die "compressing splash cpio"
316 rm -r "${TEMP}/initramfs-splash-temp/"
318 print_warning 1 ' >> No splash detected; skipping!'
323 cd ${INITRAMFS_OVERLAY}
324 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
328 if [ -d "${TEMP}/initramfs-luks-temp" ]
330 rm -r "${TEMP}/initramfs-luks-temp/"
333 mkdir -p "${TEMP}/initramfs-luks-temp/lib/luks/"
334 mkdir -p "${TEMP}/initramfs-luks-temp/sbin"
335 cd "${TEMP}/initramfs-luks-temp"
339 if is_static /bin/cryptsetup
341 print_info 1 "Including LUKS support"
342 cp /bin/cryptsetup ${TEMP}/initramfs-luks-temp/sbin/cryptsetup
343 chmod +x "${TEMP}/initramfs-luks-temp/sbin/cryptsetup"
344 elif is_static /sbin/cryptsetup
346 print_info 1 "Including LUKS support"
347 cp /sbin/cryptsetup ${TEMP}/initramfs-luks-temp/sbin/cryptsetup
348 chmod +x "${TEMP}/initramfs-luks-temp/sbin/cryptsetup"
350 print_info 1 "LUKS support requires static cryptsetup at /bin/cryptsetup or /sbin/cryptsetup"
351 print_info 1 "Not including LUKS support"
355 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \
356 || gen_die "appending cryptsetup to cpio"
359 rm -r "${TEMP}/initramfs-luks-temp/"
363 if [ -z "${FIRMWARE_FILES}" -a ! -d "${FIRMWARE_DIR}" ]
365 gen_die "specified firmware directory (${FIRMWARE_DIR}) does not exist"
367 if [ -d "${TEMP}/initramfs-firmware-temp" ]
369 rm -r "${TEMP}/initramfs-firmware-temp/"
371 mkdir -p "${TEMP}/initramfs-firmware-temp/lib/firmware"
372 cd "${TEMP}/initramfs-firmware-temp"
373 if [ -n "${FIRMWARE_FILES}" ]
377 for i in ${FIRMWARE_FILES}
379 cp -L "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/
383 cp -a "${FIRMWARE_DIR}"/* ${TEMP}/initramfs-firmware-temp/lib/firmware/
385 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \
386 || gen_die "appending firmware to cpio"
387 rm -r "${TEMP}/initramfs-firmware-temp/"
404 print_info 2 "initramfs: >> Searching for modules..."
405 if [ "${INSTALL_MOD_PATH}" != '' ]
407 cd ${INSTALL_MOD_PATH}
412 if [ -d "${TEMP}/initramfs-modules-${KV}-temp" ]
414 rm -r "${TEMP}/initramfs-modules-${KV}-temp/"
416 mkdir -p "${TEMP}/initramfs-modules-${KV}-temp/lib/modules/${KV}"
417 for i in `gen_dep_list`
419 mymod=`find ./lib/modules/${KV} -name "${i}${MOD_EXT}" 2>/dev/null| head -n 1 `
422 print_warning 2 "Warning :: ${i}${MOD_EXT} not found; skipping..."
426 print_info 2 "initramfs: >> Copying ${i}${MOD_EXT}..."
427 cp -ax --parents "${mymod}" "${TEMP}/initramfs-modules-${KV}-temp"
430 cp -ax --parents ./lib/modules/${KV}/modules* ${TEMP}/initramfs-modules-${KV}-temp 2>/dev/null
432 mkdir -p "${TEMP}/initramfs-modules-${KV}-temp/etc/modules"
433 for group_modules in ${!MODULES_*}; do
434 group="$(echo $group_modules | cut -d_ -f2 | tr "[:upper:]" "[:lower:]")"
435 print_list ${!group_modules} > "${TEMP}/initramfs-modules-${KV}-temp/etc/modules/${group}"
437 cd "${TEMP}/initramfs-modules-${KV}-temp/"
438 find . | cpio ${CPIO_ARGS} --append -F "${CPIO}"
440 rm -r "${TEMP}/initramfs-modules-${KV}-temp/"
443 # check for static linked file with objdump
445 LANG="C" LC_ALL="C" objdump -T $1 2>&1 | grep "not a dynamic object" > /dev/null
450 if [ -d "${TEMP}/initramfs-aux-temp" ]
452 rm -r "${TEMP}/initramfs-aux-temp/"
454 mkdir -p "${TEMP}/initramfs-aux-temp/etc"
455 mkdir -p "${TEMP}/initramfs-aux-temp/sbin"
456 if [ -f "${CMD_LINUXRC}" ]
458 cp "${CMD_LINUXRC}" "${TEMP}/initramfs-aux-temp/init"
459 print_info 2 " >> Copying user specified linuxrc: ${CMD_LINUXRC} to init"
463 cp "${GK_SHARE}/netboot/linuxrc.x" "${TEMP}/initramfs-aux-temp/init"
465 if [ -f "${GK_SHARE}/arch/${ARCH}/linuxrc" ]
467 cp "${GK_SHARE}/arch/${ARCH}/linuxrc" "${TEMP}/initramfs-aux-temp/init"
469 cp "${GK_SHARE}/defaults/linuxrc" "${TEMP}/initramfs-aux-temp/init"
474 # Make sure it's executable
475 chmod 0755 "${TEMP}/initramfs-aux-temp/init"
477 # Make a symlink to init .. incase we are bundled inside the kernel as one
479 cd ${TEMP}/initramfs-aux-temp
481 # ln ${TEMP}/initramfs-aux-temp/init ${TEMP}/initramfs-aux-temp/linuxrc
483 if [ -f "${GK_SHARE}/arch/${ARCH}/initrd.scripts" ]
485 cp "${GK_SHARE}/arch/${ARCH}/initrd.scripts" "${TEMP}/initramfs-aux-temp/etc/initrd.scripts"
487 cp "${GK_SHARE}/defaults/initrd.scripts" "${TEMP}/initramfs-aux-temp/etc/initrd.scripts"
490 if [ -f "${GK_SHARE}/arch/${ARCH}/initrd.defaults" ]
492 cp "${GK_SHARE}/arch/${ARCH}/initrd.defaults" "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
494 cp "${GK_SHARE}/defaults/initrd.defaults" "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
497 if [ -n "${REAL_ROOT}" ]
499 sed -i "s:^REAL_ROOT=.*$:REAL_ROOT='${REAL_ROOT}':" "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
502 echo -n 'HWOPTS="$HWOPTS ' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
503 for group_modules in ${!MODULES_*}; do
504 group="$(echo $group_modules | cut -d_ -f2 | tr "[:upper:]" "[:lower:]")"
505 echo -n "${group} " >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
507 echo '"' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
509 if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ]
511 cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe"
513 cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe"
515 if isTrue $CMD_DOKEYMAPAUTO
517 echo 'MY_HWOPTS="${MY_HWOPTS} keymap"' >> ${TEMP}/initramfs-aux-temp/etc/initrd.defaults
519 if isTrue $CMD_KEYMAP
521 mkdir -p "${TEMP}/initramfs-aux-temp/lib/keymaps"
522 /bin/tar -C "${TEMP}/initramfs-aux-temp/lib/keymaps" -zxf "${GK_SHARE}/defaults/keymaps.tar.gz"
524 if isTrue $CMD_SLOWUSB
526 echo 'MY_HWOPTS="${MY_HWOPTS} slowusb"' >> ${TEMP}/initramfs-aux-temp/etc/initrd.defaults
529 cd ${TEMP}/initramfs-aux-temp/sbin && ln -s ../init init
531 chmod +x "${TEMP}/initramfs-aux-temp/init"
532 chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts"
533 chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
534 chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe"
538 cd "${GK_SHARE}/netboot/misc"
539 cp -pPRf * "${TEMP}/initramfs-aux-temp/"
542 cd "${TEMP}/initramfs-aux-temp/"
543 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
545 rm -r "${TEMP}/initramfs-aux-temp/"
550 local func="append_${name}"
552 if [ $# -eq 1 ] || [ ${var} -eq 1 ]
554 print_info 1 " >> Appending ${name} cpio data..."
560 print_info 1 "initramfs: >> Initializing..."
563 CPIO="${TMPDIR}/initramfs-${KV}"
564 echo | cpio ${CPIO_ARGS} -F "${CPIO}" 2>/dev/null \
565 || gen_die "Could not create empty cpio at ${CPIO}"
567 append_data 'base_layout'
568 append_data 'auxilary' "${BUSYBOX}"
569 append_data 'busybox' "${BUSYBOX}"
570 append_data 'lvm' "${LVM}"
571 append_data 'dmraid' "${DMRAID}"
572 append_data 'evms' "${EVMS}"
573 append_data 'mdadm' "${MDADM}"
574 append_data 'luks' "${LUKS}"
576 if [ "${NORAMDISKMODULES}" -eq '0' ]
578 append_data 'modules'
580 print_info 1 "initramfs: Not copying modules..."
583 append_data 'blkid' "${DISKLABEL}"
585 append_data 'unionfs_fuse' "${UNIONFS}"
587 append_data 'splash' "${SPLASH}"
589 if isTrue "${FIRMWARE}" && [ -n "${FIRMWARE_DIR}" ]
591 append_data 'firmware'
594 # This should always be appended last
595 if [ "${INITRAMFS_OVERLAY}" != '' ]
597 append_data 'overlay'
601 mv -f "${CPIO}.gz" "${CPIO}"
603 if isTrue "${INTEGRATED_INITRAMFS}"
605 # cp ${TMPDIR}/initramfs-${KV} ${KERNEL_DIR}/usr/initramfs_data.cpio.gz
606 mv ${TMPDIR}/initramfs-${KV} ${TMPDIR}/initramfs-${KV}.cpio.gz
607 # sed -i "s|^.*CONFIG_INITRAMFS_SOURCE=.*$|CONFIG_INITRAMFS_SOURCE=\"${TMPDIR}/initramfs-${KV}.cpio.gz\"|" ${KERNEL_DIR}/.config
608 sed -i '/^.*CONFIG_INITRAMFS_SOURCE=.*$/d' ${KERNEL_DIR}/.config
609 echo -e "CONFIG_INITRAMFS_SOURCE=\"${TMPDIR}/initramfs-${KV}.cpio.gz\"\nCONFIG_INITRAMFS_ROOT_UID=0\nCONFIG_INITRAMFS_ROOT_GID=0" >> ${KERNEL_DIR}/.config
612 if ! isTrue "${CMD_NOINSTALL}"
614 if ! isTrue "${INTEGRATED_INITRAMFS}"
616 copy_image_with_preserve "initramfs" \
617 "${TMPDIR}/initramfs-${KV}" \
618 "initramfs-${KNAME}-${ARCH}-${KV}"