@@ -2,7 +2,7 @@
IMAGE_BASENAME ?= "${MACHINE_ID}-${PN}"
inherit image image_mdev image_inetd image_crontab image_makedevs image_inittab image_fstab
-RECIPE_FLAGS += "ramdisk_image \
+CLASS_FLAGS += "ramdisk_image \
ramdisk_image_name ramdisk_image_compression"
DEFAULT_USE_ramdisk_image = "0"
DEFAULT_USE_ramdisk_image_name = "${IMAGE_BASENAME}"
@@ -27,13 +27,13 @@ cpio_mkimage () {
case "${USE_ramdisk_image_compression}" in
none) cp ${B}/${IMAGE_BASENAME}.cpio ${B}/image.bin
;;
- bzip2) echo "TODO: ${USE_ramdisk_image_compression}"
+ bzip2) bzip2 ${B}/${IMAGE_BASENAME}.cpio -c > ${B}/image.bin
;;
gzip) gzip ${B}/${IMAGE_BASENAME}.cpio -c > ${B}/image.bin
;;
- lzma) echo "TODO: ${USE_ramdisk_image_compression}"
+ lzma) lzma ${B}/${IMAGE_BASENAME}.cpio -c > ${B}/image.bin
;;
- lzo) echo "TODO: ${USE_ramdisk_image_compression}"
+ lzo) lzop ${B}/${IMAGE_BASENAME}.cpio -c > ${B}/image.bin
;;
*) echo "ERROR: mkimage compression ${USE_ramdisk_image_compression} not supported"
;;
@@ -39,6 +39,9 @@ KERNEL_INITRAMFS ?= "${MACHINE_SYSROOT}${bootdir}/initramfs.cpio"
USE_KERNEL_INITRAMFS = "${USE_kernel_initramfs}"
USE_KERNEL_INITRAMFS[expand] = "3"
+CLASS_FLAGS += "ramdisk_image_compression"
+DEFAULT_USE_ramdisk_image_compression = "none"
+
do_configure_kernel () {
if [ "${DEFCONFIG}" = "file" ] ; then
cp ${DEFCONFIG_FILE} ${S}/.config
@@ -55,6 +58,13 @@ do_configure_kernel () {
echo 'CONFIG_INITRAMFS_SOURCE="${KERNEL_INITRAMFS}"' \
>> ${S}/.config
yes '' | oe_runmake oldconfig
+ case "${USE_cpio_image_compression}" in
+ lzma) echo 'CONFIG_RD_LZMA=y' >> ${S}/.config
+ echo 'CONFIG_INITRAMFS_COMPRESSION_LZMA=y' >> ${S}/.config
+ ;;
+ *)
+ ;;
+ esac
fi
}