sdcard_image-rpi.bbclass: drop KERNEL_INITRAMFS variable

* use INITRAMFS_SYMLINK_NAME from new kernel-artifact-names.bbclass
  instead of KERNEL_INITRAMFS
* the documentation says that KERNEL_INITRAMFS should be used to
  define extension of initramfs, but in linux-raspberrypi.inc it's
  defined only to 1 or empty based on INITRAMFS_IMAGE_BUNDLE variable
  and I don't see any code in meta-raspberry or oe-core which would
  use KERNEL_INITRAMFS to actualy name the initramfs artifact to create:
  ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin
  used in classes/sdcard_image-rpi.bbclass
* also fix the assumption that there is -${MACHINE} suffix in:
  ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin
  because that's defined as KERNEL_IMAGE_SYMLINK_NAME and some DISTROs
  might use different value
* this depends on oe-core changes which were merged today:
  http://git.openembedded.org/openembedded-core/commit/?id=7d0ef0eaa1bfe97015a774c26f5791622e7e8b12
* this is the last piece of previous pull-request:
  https://github.com/agherzan/meta-raspberrypi/pull/159

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
Martin Jansa 2017-11-20 19:35:47 +00:00 committed by Andrei Gherzan
parent efa848ca84
commit e8f9a4e8f8
3 changed files with 15 additions and 12 deletions

View File

@ -28,9 +28,6 @@ IMAGE_TYPEDEP_rpi-sdimg = "${SDIMG_ROOTFS_TYPE}"
# Set kernel and boot loader
IMAGE_BOOTLOADER ?= "bcm2835-bootfiles"
# Set initramfs extension
KERNEL_INITRAMFS ?= ""
# Kernel image name
SDIMG_KERNELIMAGE_raspberrypi ?= "kernel.img"
SDIMG_KERNELIMAGE_raspberrypi2 ?= "kernel7.img"
@ -49,6 +46,9 @@ IMAGE_ROOTFS_ALIGNMENT = "4096"
SDIMG_ROOTFS_TYPE ?= "ext3"
SDIMG_ROOTFS = "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${SDIMG_ROOTFS_TYPE}"
# For the names of kernel artifacts
inherit kernel-artifact-names
do_image_rpi_sdimg[depends] = " \
parted-native:do_populate_sysroot \
mtools-native:do_populate_sysroot \
@ -135,10 +135,18 @@ IMAGE_CMD_rpi-sdimg () {
fi
if [ "${RPI_USE_U_BOOT}" = "1" ]; then
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/u-boot.bin ::${SDIMG_KERNELIMAGE}
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin ::${KERNEL_IMAGETYPE}
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/boot.scr ::boot.scr
if [ ! -z "${INITRAMFS_IMAGE}" -a "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${INITRAMFS_SYMLINK_NAME}.bin ::${KERNEL_IMAGETYPE}
else
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} ::${KERNEL_IMAGETYPE}
fi
else
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin ::${SDIMG_KERNELIMAGE}
if [ ! -z "${INITRAMFS_IMAGE}" -a "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${INITRAMFS_SYMLINK_NAME}.bin ::${SDIMG_KERNELIMAGE}
else
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} ::${SDIMG_KERNELIMAGE}
fi
fi
if [ -n ${FATPAYLOAD} ] ; then

View File

@ -167,9 +167,6 @@ To build an initramfs image:
- `INITRAMFS_IMAGE = "<a name for your initramfs image>"`
- `INITRAMFS_IMAGE_BUNDLE = "1"`
* Set the meta-rasberrypi variable (in raspberrypi.conf for example)
- `KERNEL_INITRAMFS = "-initramfs"`
## Enable SPI bus
When using device tree kernels, set this variable to enable the SPI bus:

View File

@ -33,8 +33,6 @@ CMDLINE_append += ' ${@oe.utils.conditional("DISABLE_RPI_BOOT_LOGO", "1", "logo.
CMDLINE_DEBUG ?= ""
CMDLINE_append = " ${CMDLINE_DEBUG}"
KERNEL_INITRAMFS ?= '${@oe.utils.conditional("INITRAMFS_IMAGE_BUNDLE", "1", "1", "", d)}'
KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains("MACHINE_FEATURES", "pitft28r", "stmpe-ts", "", d)}"
# A LOADADDR is needed when building a uImage format kernel. This value is not
@ -99,7 +97,7 @@ do_configure_prepend() {
# Localversion
kernel_configure_variable LOCALVERSION "\"\""
if [ ! -z "${KERNEL_INITRAMFS}" ]; then
if [ "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then
kernel_configure_variable OVERLAY_FS y
kernel_configure_variable SQUASHFS y
kernel_configure_variable UBIFS_FS y
@ -107,7 +105,7 @@ do_configure_prepend() {
# Activate the configuration options for VC4
VC4GRAPHICS="${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "1", "0", d)}"
if [ ${VC4GRAPHICS} = "1" ]; then
if [ "${VC4GRAPHICS}" = "1" ]; then
kernel_configure_variable I2C_BCM2835 y
kernel_configure_variable DRM y
kernel_configure_variable DRM_FBDEV_EMULATION y