recovery: add recovery image types for DEY images generation
- Added the new image type 'recovery.vfat' to the DEY images generation process. This new image is a clone of the 'boot.vfat' but including the recovery ramdisk and the recovery boot script. - Added the new image type 'recovery.ubifs' to the DEY images generation process. This new image is similar to the 'boot.ubifs' but including the recovery ramdisk and the recovery boot script. Signed-off-by: David Escalona <david.escalona@digi.com>
This commit is contained in:
parent
c68a9d255a
commit
047849b848
|
|
@ -124,6 +124,77 @@ IMAGE_CMD_boot.ubifs() {
|
|||
rm -rf ${TMP_BOOTDIR}
|
||||
}
|
||||
|
||||
IMAGE_DEPENDS_recovery.vfat = "${RECOVERY_INITRAMFS_IMAGE}:do_rootfs"
|
||||
|
||||
# The recovery vfat image requires the boot image to be built before
|
||||
IMAGE_TYPEDEP_recovery.vfat = "${SDIMG_BOOTFS_TYPE}"
|
||||
|
||||
IMAGE_CMD_recovery.vfat() {
|
||||
#
|
||||
# Image generation code for image type 'recovery.vfat'
|
||||
#
|
||||
# Copy the boot.vfat image
|
||||
cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.vfat ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.recovery.vfat
|
||||
|
||||
# Copy the recovery init script into the VFAT image
|
||||
mcopy -o -i ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.recovery.vfat -s ${DEPLOY_DIR_IMAGE}/recovery.scr ::/boot.scr
|
||||
|
||||
# Copy the recovery ramdisk into the VFAT image
|
||||
mcopy -i ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.recovery.vfat -s ${DEPLOY_DIR_IMAGE}/${RECOVERY_INITRAMFS_IMAGE}-${MACHINE}.cpio.gz.u-boot.tf ::/uramdisk-recovery.img
|
||||
|
||||
# Create the symlink
|
||||
if [ -n "${IMAGE_LINK_NAME}" ] && [ -e ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.recovery.vfat ]; then
|
||||
ln -s ${IMAGE_NAME}.recovery.vfat ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.recovery.vfat
|
||||
fi
|
||||
}
|
||||
|
||||
IMAGE_DEPENDS_recovery.ubifs = " \
|
||||
mtd-utils-native:do_populate_sysroot \
|
||||
u-boot:do_deploy \
|
||||
virtual/kernel:do_deploy \
|
||||
${RECOVERY_INITRAMFS_IMAGE}:do_rootfs \
|
||||
"
|
||||
|
||||
IMAGE_CMD_recovery.ubifs() {
|
||||
#
|
||||
# Image generation code for image type 'recovery.ubifs'
|
||||
#
|
||||
RECOVERYIMG_FILES_SYMLINK="${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin"
|
||||
if [ -n "${KERNEL_DEVICETREE}" ]; then
|
||||
for DTB in ${KERNEL_DEVICETREE}; do
|
||||
if [ -e "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB}" ]; then
|
||||
RECOVERYIMG_FILES_SYMLINK="${RECOVERYIMG_FILES_SYMLINK} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB}"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Create temporary folder
|
||||
TMP_RECOVERYDIR="$(mktemp -d ${DEPLOY_DIR_IMAGE}/recovery.XXXXXX)"
|
||||
|
||||
# Hard-link RECOVERYIMG_FILES into the temporary folder with the symlink filename
|
||||
for item in ${RECOVERYIMG_FILES_SYMLINK}; do
|
||||
orig="$(readlink -e ${item})"
|
||||
ln ${orig} ${TMP_RECOVERYDIR}/$(basename ${item})
|
||||
done
|
||||
|
||||
# Copy the recovery init script.
|
||||
cp ${DEPLOY_DIR_IMAGE}/recovery.scr ${TMP_RECOVERYDIR}/boot.scr
|
||||
|
||||
# Copy the recovery ramdisk image.
|
||||
cp ${DEPLOY_DIR_IMAGE}/${RECOVERY_INITRAMFS_IMAGE}-${MACHINE}.cpio.gz.u-boot.tf ${TMP_RECOVERYDIR}/uramdisk-recovery.img
|
||||
|
||||
# Build UBIFS boot image out of temp folder
|
||||
mkfs.ubifs -r ${TMP_RECOVERYDIR} -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.recovery.ubifs ${MKUBIFS_BOOT_ARGS}
|
||||
|
||||
# Create the symlink
|
||||
if [ -n "${IMAGE_LINK_NAME}" ] && [ -e ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.recovery.ubifs ]; then
|
||||
ln -s ${IMAGE_NAME}.recovery.ubifs ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.recovery.ubifs
|
||||
fi
|
||||
|
||||
# Remove the temporary folder
|
||||
rm -rf ${TMP_RECOVERYDIR}
|
||||
}
|
||||
|
||||
IMAGE_CMD_cpio.gz.u-boot.tf() {
|
||||
#
|
||||
# Image generation code for image type 'cpio.gz.u-boot.tf'
|
||||
|
|
|
|||
|
|
@ -36,4 +36,4 @@ BT_TTY ?= "ttymxc1"
|
|||
BOOT_SCRIPTS = "boot.scr:boot.scr"
|
||||
|
||||
# Flash image types
|
||||
IMAGE_FSTYPES ?= "boot.vfat ext4 sdcard tar.bz2"
|
||||
IMAGE_FSTYPES ?= "boot.vfat ext4 sdcard tar.bz2 recovery.vfat"
|
||||
|
|
|
|||
|
|
@ -27,4 +27,4 @@ BT_TTY ?= "ttymxc0"
|
|||
BOOT_SCRIPTS = "boot.scr:boot.scr"
|
||||
|
||||
# Flash image types
|
||||
IMAGE_FSTYPES ?= "tar.bz2 ubifs boot.ubifs"
|
||||
IMAGE_FSTYPES ?= "tar.bz2 ubifs boot.ubifs recovery.ubifs"
|
||||
|
|
|
|||
|
|
@ -25,4 +25,4 @@ BT_TTY ?= "ttymxc0"
|
|||
BOOT_SCRIPTS = "boot.scr:boot.scr"
|
||||
|
||||
# Flash image types
|
||||
IMAGE_FSTYPES ?= "tar.bz2 ubifs boot.ubifs"
|
||||
IMAGE_FSTYPES ?= "tar.bz2 ubifs boot.ubifs recovery.ubifs"
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@ POKY_DEFAULT_DISTRO_FEATURES_remove = "ptest wayland"
|
|||
|
||||
GRAPHICAL_BACKEND = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', 'fb', d)}"
|
||||
|
||||
# Recovery initramfs image name.
|
||||
RECOVERY_INITRAMFS_IMAGE ?= "dey-image-recovery-initramfs"
|
||||
|
||||
# DEY image features (alphabetical order)
|
||||
FEATURE_PACKAGES_dey-audio = "packagegroup-dey-audio"
|
||||
FEATURE_PACKAGES_dey-bluetooth = "packagegroup-dey-bluetooth"
|
||||
|
|
|
|||
Loading…
Reference in New Issue