diff --git a/classes/flashlayout-stm32mp.bbclass b/classes/flashlayout-stm32mp.bbclass index d1749ee..95008be 100644 --- a/classes/flashlayout-stm32mp.bbclass +++ b/classes/flashlayout-stm32mp.bbclass @@ -168,7 +168,7 @@ python __anonymous () { # Init RAMFS image if any initramfs = d.getVar('INITRAMFS_IMAGE') or "" # Init INITRD image if any - initrd = d.getVar('INITRD_IMAGE') or "" + initrd = d.getVar('INITRD_IMAGE_ALL') or d.getVar('INITRD_IMAGE') or "" # Init partition list from PARTITIONS_CONFIG image_partitions = [] # Append image_partitions list with all configured partition images: @@ -193,7 +193,7 @@ python __anonymous () { break # We need to clearly identify ROOTFS build, not InitRAMFS/initRD one (if any), not partition one either - if current_image_name not in image_partitions and current_image_name != initramfs and current_image_name != initrd: + if current_image_name not in image_partitions and current_image_name != initramfs and current_image_name not in initrd: # We add the flashlayout file creation task just after the do_image_complete for ROOTFS build bb.build.addtask('do_create_flashlayout_config', 'do_build', 'do_image_complete', d) # We add also the function that feeds the FLASHLAYOUT_PARTITION_* vars from PARTITIONS_CONFIG diff --git a/classes/st-partitions-image.bbclass b/classes/st-partitions-image.bbclass index c9247a3..12f4b41 100644 --- a/classes/st-partitions-image.bbclass +++ b/classes/st-partitions-image.bbclass @@ -108,11 +108,11 @@ python __anonymous () { # Init RAMFS image if any initramfs = d.getVar('INITRAMFS_IMAGE') or "" # Init INITRD image if any - initrd = d.getVar('INITRD_IMAGE') or "" + initrd = d.getVar('INITRD_IMAGE_ALL') or d.getVar('INITRD_IMAGE') or "" # We need to append partition images generation only to image # that are not one of the defined partitions and not the InitRAMFS image. # Without this check we would create circular dependency - if current_image_name not in image_partitions and current_image_name != initramfs and current_image_name != initrd: + if current_image_name not in image_partitions and current_image_name != initramfs and current_image_name not in initrd: for partition in image_partitions: bb.debug(1, "Appending %s image build to 'do_image' depends tasks." % partition) # We need to make sure the manifest file is deployed as we need it for 'image_rootfs_image_clean_task' diff --git a/conf/machine/include/st-machine-common-stm32mp.inc b/conf/machine/include/st-machine-common-stm32mp.inc index 0f86bc0..529ed5a 100644 --- a/conf/machine/include/st-machine-common-stm32mp.inc +++ b/conf/machine/include/st-machine-common-stm32mp.inc @@ -38,9 +38,14 @@ MACHINE_FEATURES = "usbhost usbgadget alsa screen ext2" MACHINE_FEATURES_append = " ${@bb.utils.contains('BOOTSCHEME_LABELS', 'optee', 'optee', '', d)} " MACHINE_FEATURES_append = " tpm2 " -# Remove autoresize package from DISTRO_EXTRA_RRECOMMENDS to add it explicitly -# in our bootfs image instead of rootfs -DISTRO_EXTRA_RRECOMMENDS_remove = "${@bb.utils.contains('COMBINED_FEATURES', 'autoresize', '${AUTORESIZE}', '', d)}" +# Enable installation of INITRD image on bootfs side +MACHINE_FEATURES_append = " initrd " +# Remove InitRD package install from DISTRO_EXTRA_RRECOMMENDS to add it explicitly +# in our bootfs image (this avoid dependency loops as rootfs depends on bootfs...) +DISTRO_EXTRA_RRECOMMENDS_remove = " ${@bb.utils.contains('COMBINED_FEATURES', 'initrd', '${INITRD_PACKAGE}', '', d)} " + +# Configure autoresize for any of the 'ext4' storage devices (through InitRD image) +MACHINE_FEATURES_append = " ${@bb.utils.contains_any('BOOTDEVICE_LABELS', ['emmc', 'sdcard'], 'autoresize', '', d)} " # Use Little Kernel loader to program storage device MACHINE_FEATURES += "kloader" diff --git a/conf/machine/include/st-machine-extlinux-config-stm32mp.inc b/conf/machine/include/st-machine-extlinux-config-stm32mp.inc index bd40d08..910d313 100644 --- a/conf/machine/include/st-machine-extlinux-config-stm32mp.inc +++ b/conf/machine/include/st-machine-extlinux-config-stm32mp.inc @@ -9,8 +9,8 @@ UBOOT_EXTLINUX_FDTDIR = "/" # Define default boot config for all config UBOOT_EXTLINUX_DEFAULT_LABEL ?= "OpenSTLinux" # Define default INITRD for all configs -INITRD_SHORTNAME ??= "" -UBOOT_EXTLINUX_INITRD ?= "${@bb.utils.contains('COMBINED_FEATURES', 'autoresize', '/${INITRD_SHORTNAME}', '', d)}" +INITRD_IMAGE ??= "" +UBOOT_EXTLINUX_INITRD ?= "${@bb.utils.contains('COMBINED_FEATURES', 'initrd', '/${INITRD_IMAGE}', '', d)}" UBOOT_EXTLINUX_KERNEL_ARGS ?= "rootwait rw" UBOOT_EXTLINUX_KERNEL_ARGS_append += " ${@bb.utils.contains('ST_DEBUG_TRACE', '1', '', '${ST_CMD_LINE_DEBUG_TRACE}', d)} " diff --git a/conf/machine/stm32mp1.conf b/conf/machine/stm32mp1.conf index c4dcdae..825f098 100644 --- a/conf/machine/stm32mp1.conf +++ b/conf/machine/stm32mp1.conf @@ -55,8 +55,6 @@ BLUETOOTH_LIST += "linux-firmware-bluetooth-bcm4343" # Wifi WIFI_LIST += "linux-firmware-bcm43430" -MACHINE_FEATURES += " ${@bb.utils.contains_any('BOOTDEVICE_LABELS', ['emmc', 'sdcard'], 'autoresize', '', d)} " - # ========================================================================= # Kernel # ========================================================================= diff --git a/conf/machine/stm32mp15-disco.conf b/conf/machine/stm32mp15-disco.conf index 9770c36..f81025d 100644 --- a/conf/machine/stm32mp15-disco.conf +++ b/conf/machine/stm32mp15-disco.conf @@ -55,7 +55,6 @@ BLUETOOTH_LIST += "linux-firmware-bluetooth-bcm4343" # Wifi WIFI_LIST += "linux-firmware-bcm43430" -MACHINE_FEATURES += " ${@bb.utils.contains_any('BOOTDEVICE_LABELS', ['emmc', 'sdcard'], 'autoresize', '', d)} " # ========================================================================= # Kernel # ========================================================================= diff --git a/conf/machine/stm32mp15-eval.conf b/conf/machine/stm32mp15-eval.conf index 698e4b5..294972b 100644 --- a/conf/machine/stm32mp15-eval.conf +++ b/conf/machine/stm32mp15-eval.conf @@ -58,7 +58,6 @@ MACHINE_FEATURES_remove = "fip" # Wifi #WIFI_LIST += "linux-firmware-bcm43430" -MACHINE_FEATURES += " ${@bb.utils.contains_any('BOOTDEVICE_LABELS', ['emmc', 'sdcard'], 'autoresize', '', d)} " # ========================================================================= # Kernel # ========================================================================= diff --git a/recipes-st/images/st-image-bootfs.bb b/recipes-st/images/st-image-bootfs.bb index 1ca75fc..b8b8bc0 100644 --- a/recipes-st/images/st-image-bootfs.bb +++ b/recipes-st/images/st-image-bootfs.bb @@ -15,8 +15,8 @@ PACKAGE_INSTALL += " \ ${@bb.utils.contains('MACHINE_FEATURES', 'splashscreen', 'u-boot-stm32mp-splash', '', d)} \ " -# Add specific autoresize package to bootfs -AUTORESIZE ?= "" +# Add specific initrd package to bootfs +INITRD_PACKAGE ?= "" PACKAGE_INSTALL += " \ - ${@bb.utils.contains('COMBINED_FEATURES', 'autoresize', '${AUTORESIZE}', '', d)} \ + ${@bb.utils.contains('MACHINE_FEATURES', 'initrd', '${INITRD_PACKAGE}', '', d)} \ "