Commit e1d96009 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

only one run for initramfs image

parent b22026c6
...@@ -92,6 +92,25 @@ do_deploy_append(){ ...@@ -92,6 +92,25 @@ do_deploy_append(){
done done
} }
# Override do_bundle_initramfs (kernel.bbclass)
do_bundle_initramfs () {
if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then
echo "Creating a kernel image with a bundled initramfs..."
copy_initramfs
#if [ -e ${KERNEL_OUTPUT} ] ; then
# mv -f ${KERNEL_OUTPUT} ${KERNEL_OUTPUT}.bak
#fi
#use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE}-$#{MACHINE}.cpio
#kernel_do_compile
cp ${KERNEL_OUTPUT} ${KERNEL_OUTPUT}.initramfs
#mv -f ${KERNEL_OUTPUT}.bak ${KERNEL_OUTPUT}
# Update install area
echo "There is kernel image bundled with initramfs: ${B}/${KERNEL_OUTPUT}.initramfs"
install -m 0644 ${B}/${KERNEL_OUTPUT}.initramfs ${D}/boot/${KERNEL_IMAGETYPE}-initramfs-${MACHINE}.bin
echo "${B}/${KERNEL_OUTPUT}.initramfs"
fi
}
# Override kernel_do_compile used by do_bundle_initramfs in kernel.bbclass # Override kernel_do_compile used by do_bundle_initramfs in kernel.bbclass
# Added ${PARALLEL_MAKE} only # Added ${PARALLEL_MAKE} only
kernel_do_compile() { kernel_do_compile() {
...@@ -103,15 +122,15 @@ kernel_do_compile() { ...@@ -103,15 +122,15 @@ kernel_do_compile() {
# different initramfs image. The way to do that in the kernel # different initramfs image. The way to do that in the kernel
# is to specify: # is to specify:
# make ...args... CONFIG_INITRAMFS_SOURCE=some_other_initramfs.cpio # make ...args... CONFIG_INITRAMFS_SOURCE=some_other_initramfs.cpio
if [ "$use_alternate_initrd" = "" ] && [ "${INITRAMFS_TASK}" != "" ] ; then if [ "${INITRAMFS_IMAGE_BUNDLE}" = "1" ] ; then
echo "ONLY ONE RUN!"
# The old style way of copying an prebuilt image and building it # The old style way of copying an prebuilt image and building it
# is turned on via INTIRAMFS_TASK != "" # is turned on via INTIRAMFS_TASK != ""
copy_initramfs copy_initramfs
use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.cpio use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.cpio
fi fi
oe_runmake ${KERNEL_IMAGETYPE_FOR_MAKE} ${PARALLEL_MAKE} ${KERNEL_ALT_IMAGETYPE} CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} $use_alternate_initrd oe_runmake ${KERNEL_IMAGETYPE_FOR_MAKE} ${PARALLEL_MAKE} ${KERNEL_ALT_IMAGETYPE} CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} $use_alternate_initrd
if test "${KERNEL_IMAGETYPE_FOR_MAKE}.gz" = "${KERNEL_IMAGETYPE}"; then if test "${KERNEL_IMAGETYPE_FOR_MAKE}.gz" = "${KERNEL_IMAGETYPE}"; then
gzip -9c < "${KERNEL_IMAGETYPE_FOR_MAKE}" > "${KERNEL_OUTPUT}" gzip -9c < "${KERNEL_IMAGETYPE_FOR_MAKE}" > "${KERNEL_OUTPUT}"
fi fi
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment