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-udev-temp" ]
78 rm -r "${TEMP}/initramfs-udev-temp/"
81 mkdir -p "${TEMP}/initramfs-udev-temp/bin/"
82 [ "${UDEV}" -eq '1' ] && { /bin/tar -jxpf "${UDEV_BINCACHE}" -C "${TEMP}/initramfs-udev-temp" ||
83 gen_die "Could not extract udev binary cache!"; }
84 cd "${TEMP}/initramfs-udev-temp/"
85 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
86 rm -rf "${TEMP}/initramfs-udev-temp" > /dev/null
90 if [ -d "${TEMP}/initramfs-blkid-temp" ]
92 rm -r "${TEMP}/initramfs-blkid-temp/"
95 mkdir -p "${TEMP}/initramfs-blkid-temp/bin/"
96 [ "${DISKLABEL}" -eq '1' ] && { /bin/bzip2 -dc "${BLKID_BINCACHE}" > "${TEMP}/initramfs-blkid-temp/bin/blkid" ||
97 gen_die "Could not extract blkid binary cache!"; }
98 chmod a+x "${TEMP}/initramfs-blkid-temp/bin/blkid"
99 cd "${TEMP}/initramfs-blkid-temp/"
100 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
101 rm -rf "${TEMP}/initramfs-blkid-temp" > /dev/null
105 if [ -d "${TEMP}/initramfs-devfs-temp" ]
107 rm -r "${TEMP}/initramfs-devfs-temp/"
110 print_info 1 'DEVFS: Adding support (compiling binaries)...'
112 mkdir -p "${TEMP}/initramfs-devfs-temp/bin/"
113 cp "${DEVFSD_BINCACHE}" "${TEMP}/initramfs-devfs-temp/bin/devfsd.bz2" || gen_die "could not copy devfsd executable from bincache"
114 bunzip2 "${TEMP}/initramfs-devfs-temp/bin/devfsd.bz2" || gen_die "could not uncompress devfsd"
115 chmod +x "${TEMP}/initramfs-devfs-temp/bin/devfsd"
116 cd "${TEMP}/initramfs-devfs-temp/"
117 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
118 rm -rf "${TEMP}/initramfs-devfs-temp" > /dev/null
121 append_unionfs_modules(){
122 if [ -d "${TEMP}/initramfs-unionfs-modules-temp" ]
124 rm -r "${TEMP}/initramfs-unionfs-modules-temp/"
126 print_info 1 'UNIONFS MODULES: Adding support (compiling)...'
127 compile_unionfs_modules
128 mkdir -p "${TEMP}/initramfs-unionfs-modules-temp/"
129 /bin/tar -jxpf "${UNIONFS_MODULES_BINCACHE}" -C "${TEMP}/initramfs-unionfs-modules-temp" ||
130 gen_die "Could not extract unionfs modules binary cache!";
131 cd "${TEMP}/initramfs-unionfs-modules-temp/"
132 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
133 rm -r "${TEMP}/initramfs-unionfs-modules-temp/"
136 append_unionfs_tools(){
137 if [ -d "${TEMP}/initramfs-unionfs-tools-temp" ]
139 rm -r "${TEMP}/initramfs-unionfs-tools-temp/"
141 print_info 1 'UNIONFS TOOLS: Adding support (compiling)...'
142 compile_unionfs_utils
143 mkdir -p "${TEMP}/initramfs-unionfs-tools-temp/bin/"
144 /bin/tar -jxpf "${UNIONFS_BINCACHE}" -C "${TEMP}/initramfs-unionfs-tools-temp" ||
145 gen_die "Could not extract unionfs tools binary cache!";
146 cd "${TEMP}/initramfs-unionfs-tools-temp/"
147 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
148 rm -r "${TEMP}/initramfs-unionfs-tools-temp/"
152 if [ -d "${TEMP}/initramfs-suspend-temp" ];
154 rm -r "${TEMP}/initramfs-suspend-temp/"
156 print_info 1 'SUSPEND: Adding support (compiling binaries)...'
158 mkdir -p "${TEMP}/initramfs-suspend-temp/"
159 /bin/tar -jxpf "${SUSPEND_BINCACHE}" -C "${TEMP}/initramfs-suspend-temp" ||
160 gen_die "Could not extract suspend binary cache!"
161 mkdir -p "${TEMP}/initramfs-suspend-temp/etc"
162 cp -f /etc/suspend.conf "${TEMP}/initramfs-suspend-temp/etc" ||
163 gen_die 'Could not copy /etc/suspend.conf'
164 cd "${TEMP}/initramfs-suspend-temp/"
165 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
166 rm -r "${TEMP}/initramfs-suspend-temp/"
170 if [ -d "${TEMP}/initramfs-dmraid-temp" ]
172 rm -r "${TEMP}/initramfs-dmraid-temp/"
174 print_info 1 'DMRAID: Adding support (compiling binaries)...'
176 mkdir -p "${TEMP}/initramfs-dmraid-temp/"
177 /bin/tar -jxpf "${DMRAID_BINCACHE}" -C "${TEMP}/initramfs-dmraid-temp" ||
178 gen_die "Could not extract dmraid binary cache!";
179 cd "${TEMP}/initramfs-dmraid-temp/"
180 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
181 rm -r "${TEMP}/initramfs-dmraid-temp/"
185 if [ -d "${TEMP}/initramfs-lvm2-temp" ]
187 rm -r "${TEMP}/initramfs-lvm2-temp/"
190 mkdir -p "${TEMP}/initramfs-lvm2-temp/bin/"
191 mkdir -p "${TEMP}/initramfs-lvm2-temp/etc/lvm/"
192 if [ -e '/sbin/lvm' ] && LC_ALL="C" ldd /sbin/lvm|grep -q 'not a dynamic executable'
194 print_info 1 ' LVM2: Adding support (using local static binaries)...'
195 cp /sbin/lvm "${TEMP}/initramfs-lvm2-temp/bin/lvm" ||
196 gen_die 'Could not copy over lvm!'
198 print_info 1 ' LVM2: Adding support (compiling binaries)...'
200 /bin/tar -jxpf "${LVM2_BINCACHE}" -C "${TEMP}/initramfs-lvm2-temp" ||
201 gen_die "Could not extract lvm2 binary cache!";
202 mv ${TEMP}/initramfs-lvm2-temp/sbin/lvm.static ${TEMP}/initramfs-lvm2-temp/bin/lvm ||
203 gen_die 'LVM2 error: Could not move lvm.static to lvm!'
207 # lvm dumpconfig 2>&1 > /dev/null || gen_die 'Could not copy over lvm.conf!'
211 cp /etc/lvm/lvm.conf "${TEMP}/initramfs-lvm2-temp/etc/lvm/" ||
212 gen_die 'Could not copy over lvm.conf!'
214 # gen_die 'Could not copy over lvm.conf!'
217 cd "${TEMP}/initramfs-lvm2-temp/"
218 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
219 rm -r "${TEMP}/initramfs-lvm2-temp/"
223 if [ -d "${TEMP}/initramfs-evms2-temp" ]
225 rm -r "${TEMP}/initramfs-evms2-temp/"
227 mkdir -p "${TEMP}/initramfs-evms2-temp/lib/evms"
228 mkdir -p "${TEMP}/initramfs-evms2-temp/etc/"
229 mkdir -p "${TEMP}/initramfs-evms2-temp/bin/"
230 mkdir -p "${TEMP}/initramfs-evms2-temp/sbin/"
231 if [ "${EVMS2}" -eq '1' ]
233 print_info 1 ' EVMS2: Adding support...'
234 mkdir -p ${TEMP}/initramfs-evms2-temp/lib
235 cp -a /lib/ld-* "${TEMP}/initramfs-evms2-temp/lib" \
236 || gen_die 'Could not copy files for EVMS2!'
237 if [ -n "`ls /lib/libgcc_s*`" ]
239 cp -a /lib/libgcc_s* "${TEMP}/initramfs-evms2-temp/lib" \
240 || gen_die 'Could not copy files for EVMS2!'
242 cp -a /lib/libc-* /lib/libc.* "${TEMP}/initramfs-evms2-temp/lib" \
243 || gen_die 'Could not copy files for EVMS2!'
244 cp -a /lib/libdl-* /lib/libdl.* "${TEMP}/initramfs-evms2-temp/lib" \
245 || gen_die 'Could not copy files for EVMS2!'
246 cp -a /lib/libpthread* "${TEMP}/initramfs-evms2-temp/lib" \
247 || gen_die 'Could not copy files for EVMS2!'
248 cp -a /lib/libuuid*so* "${TEMP}/initramfs-evms2-temp/lib" \
249 || gen_die 'Could not copy files for EVMS2!'
250 cp -a /lib/libevms*so* "${TEMP}/initramfs-evms2-temp/lib" \
251 || gen_die 'Could not copy files for EVMS2!'
252 cp -a /lib/evms "${TEMP}/initramfs-evms2-temp/lib" \
253 || gen_die 'Could not copy files for EVMS2!'
254 cp -a /lib/evms/* "${TEMP}/initramfs-evms2-temp/lib/evms" \
255 || gen_die 'Could not copy files for EVMS2!'
256 cp -a /etc/evms.conf "${TEMP}/initramfs-evms2-temp/etc" \
257 || gen_die 'Could not copy files for EVMS2!'
258 cp /sbin/evms_activate "${TEMP}/initramfs-evms2-temp/sbin" \
259 || gen_die 'Could not copy over evms_activate!'
261 # Fix EVMS2 complaining that it can't find the swap utilities.
262 # These are not required in the initramfs
263 for swap_libs in "${TEMP}/initramfs-evms2-temp/lib/evms/*/swap*.so"
268 cd "${TEMP}/initramfs-evms2-temp/"
269 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
270 rm -r "${TEMP}/initramfs-evms2-temp/"
274 if [ -x /usr/bin/splash_geninitramfs ] || [ -x /sbin/splash_geninitramfs ]
276 [ -z "${GENSPLASH_THEME}" ] && [ -e /etc/conf.d/splash ] && source /etc/conf.d/splash
277 [ -z "${GENSPLASH_THEME}" ] && GENSPLASH_THEME=default
278 print_info 1 " >> Installing gensplash [ using the ${GENSPLASH_THEME} theme ]..."
279 if [ -d "${TEMP}/initramfs-gensplash-temp" ]
281 rm -r "${TEMP}/initramfs-gensplash-temp/"
283 mkdir -p "${TEMP}/initramfs-gensplash-temp"
286 [ -n "${GENSPLASH_RES}" ] && tmp="-r ${GENSPLASH_RES}"
287 splash_geninitramfs -c "${TEMP}/initramfs-gensplash-temp" ${tmp} ${GENSPLASH_THEME} || gen_die "Could not build splash cpio archive"
288 if [ -e "/usr/share/splashutils/initrd.splash" ]; then
289 mkdir -p "${TEMP}/initramfs-gensplash-temp/etc"
290 cp -f "/usr/share/splashutils/initrd.splash" "${TEMP}/initramfs-gensplash-temp/etc"
292 cd "${TEMP}/initramfs-gensplash-temp/"
293 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \
294 || gen_die "compressing splash cpio"
295 rm -r "${TEMP}/initramfs-gensplash-temp/"
297 print_warning 1 ' >> No splash detected; skipping!'
302 cd ${INITRAMFS_OVERLAY}
303 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
319 print_info 2 "initramfs: >> Searching for modules..."
320 if [ "${INSTALL_MOD_PATH}" != '' ]
322 cd ${INSTALL_MOD_PATH}
327 if [ -d "${TEMP}/initramfs-modules-${KV}-temp" ]
329 rm -r "${TEMP}/initramfs-modules-${KV}-temp/"
331 mkdir -p "${TEMP}/initramfs-modules-${KV}-temp/lib/modules/${KV}"
332 for i in `gen_dep_list`
334 mymod=`find ./lib/modules/${KV} -name "${i}${MOD_EXT}" 2>/dev/null| head -n 1 `
337 print_warning 2 "Warning :: ${i}${MOD_EXT} not found; skipping..."
341 print_info 2 "initramfs: >> Copying ${i}${MOD_EXT}..."
342 cp -ax --parents "${mymod}" "${TEMP}/initramfs-modules-${KV}-temp"
345 cp -ax --parents ./lib/modules/${KV}/modules* ${TEMP}/initramfs-modules-${KV}-temp 2>/dev/null
347 mkdir -p "${TEMP}/initramfs-modules-${KV}-temp/etc/modules"
348 for group_modules in ${!MODULES_*}; do
349 group="$(echo $group_modules | cut -d_ -f2 | tr "[:upper:]" "[:lower:]")"
350 print_list ${!group_modules} > "${TEMP}/initramfs-modules-${KV}-temp/etc/modules/${group}"
352 cd "${TEMP}/initramfs-modules-${KV}-temp/"
353 find . | cpio ${CPIO_ARGS} --append -F "${CPIO}"
354 rm -r "${TEMP}/initramfs-modules-${KV}-temp/"
357 # check for static linked file with objdump
359 LANG="C" LC_ALL="C" objdump -T $1 2>&1 | grep "not a dynamic object" > /dev/null
364 if [ -d "${TEMP}/initramfs-aux-temp" ]
366 rm -r "${TEMP}/initramfs-aux-temp/"
368 mkdir -p "${TEMP}/initramfs-aux-temp/etc"
369 mkdir -p "${TEMP}/initramfs-aux-temp/sbin"
370 if [ -f "${CMD_LINUXRC}" ]
372 cp "${CMD_LINUXRC}" "${TEMP}/initramfs-aux-temp/init"
373 print_info 2 " >> Copying user specified linuxrc: ${CMD_LINUXRC} to init"
375 if [ -f "${GK_SHARE}/${ARCH}/linuxrc" ]
377 cp "${GK_SHARE}/${ARCH}/linuxrc" "${TEMP}/initramfs-aux-temp/init"
379 cp "${GK_SHARE}/generic/linuxrc" "${TEMP}/initramfs-aux-temp/init"
383 # Make sure it's executable
384 chmod 0755 "${TEMP}/initramfs-aux-temp/init"
386 # Make a symlink to init .. incase we are bundled inside the kernel as one
388 cd ${TEMP}/initramfs-aux-temp
390 # ln ${TEMP}/initramfs-aux-temp/init ${TEMP}/initramfs-aux-temp/linuxrc
392 if [ -f "${GK_SHARE}/${ARCH}/initrd.scripts" ]
394 cp "${GK_SHARE}/${ARCH}/initrd.scripts" "${TEMP}/initramfs-aux-temp/etc/initrd.scripts"
396 cp "${GK_SHARE}/generic/initrd.scripts" "${TEMP}/initramfs-aux-temp/etc/initrd.scripts"
399 if [ -f "${GK_SHARE}/${ARCH}/initrd.defaults" ]
401 cp "${GK_SHARE}/${ARCH}/initrd.defaults" "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
403 cp "${GK_SHARE}/generic/initrd.defaults" "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
406 echo -n 'HWOPTS="$HWOPTS ' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
407 for group_modules in ${!MODULES_*}; do
408 group="$(echo $group_modules | cut -d_ -f2 | tr "[:upper:]" "[:lower:]")"
409 echo -n "${group} " >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
411 echo '"' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
413 if [ -f "${GK_SHARE}/${ARCH}/modprobe" ]
415 cp "${GK_SHARE}/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe"
417 cp "${GK_SHARE}/generic/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe"
419 if isTrue $CMD_DOKEYMAPAUTO
421 echo 'MY_HWOPTS="${MY_HWOPTS} keymap"' >> ${TEMP}/initramfs-aux-temp/etc/initrd.defaults
423 mkdir -p "${TEMP}/initramfs-aux-temp/lib/keymaps"
424 /bin/tar -C "${TEMP}/initramfs-aux-temp/lib/keymaps" -zxf "${GK_SHARE}/generic/keymaps.tar.gz"
425 if isTrue $CMD_SLOWUSB
427 echo 'MY_HWOPTS="${MY_HWOPTS} slowusb"' >> ${TEMP}/initramfs-aux-temp/etc/initrd.defaults
431 if is_static /bin/cryptsetup
433 print_info 1 "Including LUKS support"
434 rm -f ${TEMP}/initramfs-aux-temp/sbin/cryptsetup
435 cp /bin/cryptsetup ${TEMP}/initramfs-aux-temp/sbin/cryptsetup
436 chmod +x "${TEMP}/initramfs-aux-temp/sbin/cryptsetup"
438 print_info 1 "LUKS support requires static cryptsetup at /bin/cryptsetup"
439 print_info 1 "Not including LUKS support"
443 cd ${TEMP}/initramfs-aux-temp/sbin && ln -s ../init init
445 chmod +x "${TEMP}/initramfs-aux-temp/init"
446 chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts"
447 chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
448 chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe"
449 cd "${TEMP}/initramfs-aux-temp/"
450 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
451 rm -r "${TEMP}/initramfs-aux-temp/"
456 local func="append_${name}"
458 if [ $# -eq '1' ] || [ "${var}" -eq '1' ]
460 print_info 1 " >> Appending ${name} cpio data..."
466 print_info 1 "initramfs: >> Initializing..."
469 CPIO="${TMPDIR}/initramfs-${KV}"
470 echo | cpio ${CPIO_ARGS} -F "${CPIO}" 2>/dev/null \
471 || gen_die "Could not create empty cpio at ${CPIO}"
473 append_data 'base_layout'
474 append_data 'auxilary'
475 append_data 'busybox' "${BUSYBOX}"
476 append_data 'devfs' "${DEVFS}"
477 # append_data 'udev' "${UDEV}"
478 append_data 'unionfs_modules' "${UNIONFS}"
479 append_data 'unionfs_tools' "${UNIONFS}"
480 append_data 'suspend' "${SUSPEND}"
481 append_data 'lvm2' "${LVM2}"
482 append_data 'dmraid' "${DMRAID}"
483 append_data 'evms2' "${EVMS2}"
485 if [ "${NOINITRDMODULES}" = '' ]
487 append_data 'modules'
489 print_info 1 "initramfs: Not copying modules..."
492 append_data 'blkid' "${DISKLABEL}"
493 append_data 'gensplash' "${GENSPLASH}"
495 # This should always be appended last
496 if [ "${INITRAMFS_OVERLAY}" != '' ]
498 append_data 'overlay'
502 mv -f "${CPIO}.gz" "${CPIO}"
504 # Pegasos hack for merging the initramfs into the kernel at compile time
505 [ "${KERNEL_MAKE_DIRECTIVE}" == 'zImage.initrd' -a "${GENERATE_Z_IMAGE}" = '1' ] ||
506 [ "${KERNEL_MAKE_DIRECTIVE_2}" == 'zImage.initrd' -a "${GENERATE_Z_IMAGE}" = '1' ] &&
507 cp ${TMPDIR}/initramfs-${KV} ${KERNEL_DIR}/arch/powerpc/boot/ramdisk.image.gz &&
508 rm ${TMPDIR}/initramfs-${KV}
510 # Mips also mimics Pegasos to merge the initramfs into the kernel
511 if [ ${BUILD_INITRAMFS} -eq 1 ]; then
512 cp ${TMPDIR}/initramfs-${KV} ${KERNEL_DIR}/initramfs.cpio.gz
513 gunzip -f ${KERNEL_DIR}/initramfs.cpio.gz
516 if ! isTrue "${CMD_NOINSTALL}"
518 if [ "${GENERATE_Z_IMAGE}" != '1' ]
520 copy_image_with_preserve "initramfs" \
521 "${TMPDIR}/initramfs-${KV}" \
522 "initramfs-${KNAME}-${ARCH}-${KV}"