diff --git a/README.md b/README.md index 10ea39501..c8a816512 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,19 @@ The current release has been verified and tested with the following OS versions: * Ubuntu 18.04 +* Ubuntu 22.04 # Supported Platforms Software for the following hardware platforms is in production support: +## ConnectCore MP15 +* ConnectCore MP15 System-on-Module (SOM) + * [CC-WST-DW69-NM](https://www.digi.com/products/models/cc-wst-dw69-nm) + * [CC-ST-DW69-ZM](https://www.digi.com/products/models/cc-st-dw69-zm) +* ConnectCore MP15 DVK + * [CC-WMP157-KIT](https://www.digi.com/products/models/cc-wmp157-kit) ([Get Started](https://www.digi.com/resources/documentation/digidocs/embedded/dey/4.0/ccmp15/yocto-gs_index)) + ## ConnectCore 6UL * ConnectCore 6UL System-on-Module (SOM) * [CC-WMX-JN58-NE](https://www.digi.com/products/models/cc-wmx-jn58-ne) @@ -56,7 +64,18 @@ Documentation is available online at https://www.digi.com/resources/documentatio ## 4.0-r1 -* Release based on [Yocto 4.0 (Kirkstone)](https://www.yoctoproject.org/software-overview/downloads) +* Release based on [Yocto 4.0 (Kirkstone)](https://www.yoctoproject.org/software-overview/downloads) including: + * New toolchain based on GLIBC-2.35 + * Updated bluez5 to v5.65 + * Updated busybox to v1.32.0 + * Updated NetworkManager to v1.36.2 + * Updated gstreamer1.0 to v1.20.3 + * Updated busybox to v1.35.0 + * Updated OpenSSL to v3.0.7 + * Package upgrades and security fixes +* Added support for ConnectCore MP15 platform +* Updated kernel version to v5.15.52 for i.MX6UL platforms + # Known Issues and Limitations @@ -83,6 +102,20 @@ updated list can be found on the online documentation. devices (ConnectCore 6UL, ConnectCore 6 Plus, and ConnectCore 8M Nano) fail to join autonomous groups. +## ConnectCore MP15 + +* ConnectCore MP15 System-on-Module (SOM) + * Power management: + * Audio interface does not work after suspend. + * UART: + * RS-485 mode is currently not supported. + * Wireless + * P2P on the ConnectCore MP15 doesn't currently work in concurrency with + other modes (station or SoftAP). + + * The following features are not yet supported: + * TrustFence + ## ConnectCore 6UL * ConnectCore 6UL System-on-Module (SOM) diff --git a/meta-digi-arm/conf/machine/ccimx6ulsbc.conf b/meta-digi-arm/conf/machine/ccimx6ulsbc.conf index 44b42f30e..862d0a3c8 100644 --- a/meta-digi-arm/conf/machine/ccimx6ulsbc.conf +++ b/meta-digi-arm/conf/machine/ccimx6ulsbc.conf @@ -12,16 +12,6 @@ UBOOT_CONFIG[ccimx6ulsbc1GB] = "ccimx6ulsbc1GB_defconfig,,u-boot-dtb.${UBOOT_SUF UBOOT_CONFIG[ccimx6ulsbc512MB] = "ccimx6ulsbc512MB_defconfig,,u-boot-dtb.${UBOOT_SUFFIX}" UBOOT_CONFIG[ccimx6ulsbc] = "ccimx6ulsbc_defconfig,,u-boot-dtb.${UBOOT_SUFFIX}" -# U-Boot environment size -UBOOT_ENV_SIZE ?= "0x20000" -# U-Boot environment offset (within partition) -UBOOT_ENV_OFFSET ?= "0x0" -UBOOT_ENV_REDUND_OFFSET ?= "${UBOOT_ENV_SIZE}" -# U-Boot environment range: size (in hex) in the environment partition that -# the U-Boot environment can take up (if undefined, it will take up all the -# available space in the environment partition) -UBOOT_ENV_RANGE ?= "" - KERNEL_DEVICETREE ?= " \ imx6ul-ccimx6ulsbc.dtb \ imx6ul-ccimx6ulsbc-wb.dtb \ diff --git a/meta-digi-arm/conf/machine/ccimx6ulstarter.conf b/meta-digi-arm/conf/machine/ccimx6ulstarter.conf index 178abaa60..92d506f75 100644 --- a/meta-digi-arm/conf/machine/ccimx6ulstarter.conf +++ b/meta-digi-arm/conf/machine/ccimx6ulstarter.conf @@ -12,16 +12,6 @@ UBOOT_CONFIG[ccimx6ulstarter1GB] = "ccimx6ulstarter1GB_defconfig,,u-boot-dtb.${U UBOOT_CONFIG[ccimx6ulstarter512MB] = "ccimx6ulstarter512MB_defconfig,,u-boot-dtb.${UBOOT_SUFFIX}" UBOOT_CONFIG[ccimx6ulstarter] = "ccimx6ulstarter_defconfig,,u-boot-dtb.${UBOOT_SUFFIX}" -# U-Boot environment size -UBOOT_ENV_SIZE ?= "0x20000" -# U-Boot environment offset (within partition) -UBOOT_ENV_OFFSET ?= "0x0" -UBOOT_ENV_REDUND_OFFSET ?= "${UBOOT_ENV_SIZE}" -# U-Boot environment range: size (in hex) in the environment partition that -# the U-Boot environment can take up (if undefined, it will take up all the -# available space in the environment partition) -UBOOT_ENV_RANGE ?= "" - KERNEL_DEVICETREE ?= " \ imx6ul-ccimx6ulstarter.dtb \ imx6ul-ccimx6ulstarter-wb.dtb \ diff --git a/meta-digi-arm/conf/machine/ccmp13-dvk.conf b/meta-digi-arm/conf/machine/ccmp13-dvk.conf index e87a1341a..a0454d185 100644 --- a/meta-digi-arm/conf/machine/ccmp13-dvk.conf +++ b/meta-digi-arm/conf/machine/ccmp13-dvk.conf @@ -10,7 +10,7 @@ include conf/machine/include/ccmp1.inc # Chip architecture # ========================================================================= DEFAULTTUNE = "cortexa7thf-neon-vfpv4" -MACHINEOVERRIDES = "arm:armv7ve:stcommon:stm32mpcommon:stm32mp1common:ccmp1:ccmp13:ccmp13-dvk" +MACHINEOVERRIDES = "arm:armv7ve:stcommon:stm32mpcommon:stm32mp1common:${DIGI_FAMILY}:ccmp13:ccmp13-dvk" # ========================================================================= # boot device @@ -122,15 +122,6 @@ ST_KERNEL_LOADADDR ?= "0xC0008000" # ========================================================================= IMAGE_CLASSES = "image_types_digi image_types-stubi" -# U-Boot environment offset (within partition) -UBOOT_ENV_OFFSET ?= "0x0" -# U-Boot environment size -UBOOT_ENV_SIZE ?= "0x20000" -# U-Boot environment range: size (in hex) in the environment partition that -# the U-Boot environment can take up (if undefined, it will take up all the -# available space in the environment partition) -UBOOT_ENV_RANGE ?= "" - # mkfs.ubifs parameters for boot partition (the one holding kernel and device tree files) # Max LEB count (-c 255) calculated for a partition of up to 32 MiB considering 128 KiB erase-block size. MKUBIFS_BOOT_ARGS ?= "-m 2048 -e 126976 -c 255" @@ -148,6 +139,10 @@ IS_HEADLESS = "true" # Remove additional bluetooth packages MACHINE_BLUETOOTH_EXTRA_INSTALL = "" +# XBee +XBEE_RESET_N_GPIO ?= "GPIOG@15" +XBEE_TTY ?= "ttySTM2" + # ========================================================================= # alsa # ========================================================================= diff --git a/meta-digi-arm/conf/machine/ccmp15-dvk.conf b/meta-digi-arm/conf/machine/ccmp15-dvk.conf index 659eb31b8..7f4c01b74 100644 --- a/meta-digi-arm/conf/machine/ccmp15-dvk.conf +++ b/meta-digi-arm/conf/machine/ccmp15-dvk.conf @@ -10,7 +10,7 @@ include conf/machine/include/ccmp1.inc # Chip architecture # ========================================================================= DEFAULTTUNE = "cortexa7thf-neon-vfpv4" -MACHINEOVERRIDES = "arm:armv7ve:stcommon:stm32mpcommon:stm32mp1common:ccmp1:ccmp15:ccmp15-dvk" +MACHINEOVERRIDES = "arm:armv7ve:stcommon:stm32mpcommon:stm32mp1common:${DIGI_FAMILY}:ccmp15:ccmp15-dvk" # ========================================================================= # boot device @@ -130,16 +130,6 @@ ST_KERNEL_LOADADDR ?= "0xC0008000" # ========================================================================= IMAGE_CLASSES = "image_types_digi image_types-stubi" -# U-Boot environment offset (within partition) -UBOOT_ENV_OFFSET ?= "0x0" -UBOOT_ENV_REDUND_OFFSET ?= "0x0" -# U-Boot environment size -UBOOT_ENV_SIZE ?= "0x20000" -# U-Boot environment range: size (in hex) in the environment partition that -# the U-Boot environment can take up (if undefined, it will take up all the -# available space in the environment partition) -UBOOT_ENV_RANGE ?= "" - # mkfs.ubifs parameters for boot partition (the one holding kernel and device tree files) # Max LEB count (-c 255) calculated for a partition of up to 32 MiB considering 128 KiB erase-block size. MKUBIFS_BOOT_ARGS ?= "-m 2048 -e 126976 -c 255" @@ -154,6 +144,10 @@ HAS_WIFI_VIRTWLANS = "true" # Remove additional bluetooth packages MACHINE_BLUETOOTH_EXTRA_INSTALL = "" +# XBee +XBEE_RESET_N_GPIO ?= "GPIOZ@2" +XBEE_TTY ?= "ttySTM2" + # ========================================================================= # alsa # ========================================================================= diff --git a/meta-digi-arm/conf/machine/include/ccimx6ul.inc b/meta-digi-arm/conf/machine/include/ccimx6ul.inc index 37bd47106..6b83e56ed 100644 --- a/meta-digi-arm/conf/machine/include/ccimx6ul.inc +++ b/meta-digi-arm/conf/machine/include/ccimx6ul.inc @@ -53,7 +53,7 @@ TRUSTFENCE_SIGN_MODE = "HAB" # SWUpdate sw-description configuration BOOTFS_EXT ?= ".boot.ubifs" -ROOTFS_EXT ?= ".ubifs" +ROOTFS_EXT ?= '${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", ".squashfs", ".ubifs", d)}' BOOT_DEV_NAME ?= "linux" ROOTFS_DEV_NAME ?= "rootfs" @@ -61,3 +61,12 @@ ROOTFS_ENC_DEV = "${ROOTFS_DEV_NAME}" ROOTFS_DEV_NAME_FINAL = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_ENCRYPT_ROOTFS', True) == '1', '${ROOTFS_ENC_DEV}', '${ROOTFS_DEV_NAME}')}" UBOOT_DEV_NAME ?= "/dev/mtd" +# U-Boot environment offset (within partition) +UBOOT_ENV_OFFSET ?= "0x0" +UBOOT_ENV_REDUND_OFFSET ?= "${UBOOT_ENV_SIZE}" +# U-Boot environment size +UBOOT_ENV_SIZE ?= "0x20000" +# U-Boot environment range: size (in hex) in the environment partition that +# the U-Boot environment can take up (if undefined, it will take up all the +# available space in the environment partition) +UBOOT_ENV_RANGE ?= "" diff --git a/meta-digi-arm/conf/machine/include/ccmp1.inc b/meta-digi-arm/conf/machine/include/ccmp1.inc index 3561b13e9..ed3ae6a2d 100644 --- a/meta-digi-arm/conf/machine/include/ccmp1.inc +++ b/meta-digi-arm/conf/machine/include/ccmp1.inc @@ -6,6 +6,8 @@ include conf/machine/include/st-machine-common-stm32mp.inc include conf/machine/include/arm/armv7a/tune-cortexa7.inc include conf/machine/include/digi-defaults.inc +DIGI_FAMILY = "ccmp1" + # Platform u-boot settings UBOOT_PREFIX = "u-boot" UBOOT_SUFFIX = "bin" @@ -17,7 +19,7 @@ DEY_BUILD_PLATFORM = "STM" # SWUpdate sw-description configuration BOOTFS_EXT ?= ".boot.ubifs" -ROOTFS_EXT ?= ".ubifs" +ROOTFS_EXT ?= '${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", ".squashfs", ".ubifs", d)}' BOOT_DEV_NAME ?= "linux" ROOTFS_DEV_NAME ?= "rootfs" @@ -25,9 +27,21 @@ ROOTFS_ENC_DEV = "${ROOTFS_DEV_NAME}" ROOTFS_DEV_NAME_FINAL = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_ENCRYPT_ROOTFS', True) == '1', '${ROOTFS_ENC_DEV}', '${ROOTFS_DEV_NAME}')}" UBOOT_DEV_NAME ?= "/dev/mtd" - -# Add dualboot support -DUALBOOT_ENABLED ?= "true" +# U-Boot environment offset (within partition) +UBOOT_ENV_OFFSET ?= "0x0" +UBOOT_ENV_REDUND_OFFSET ?= "0x0" +# U-Boot environment size +UBOOT_ENV_SIZE ?= "0x20000" +# U-Boot environment range: size (in hex) in the environment partition that +# the U-Boot environment can take up (if undefined, it will take up all the +# available space in the environment partition) +UBOOT_ENV_RANGE ?= "" # Extra udev rules MACHINE_EXTRA_RRECOMMENDS += "udev-extraconf" + +# Image FS types +IMAGE_FSTYPES:remove = "ext4 tar.xz" + +# List of supported boot devices +BOOTDEVICE_LABELS ?= "sdcard" diff --git a/meta-digi-arm/conf/machine/include/digi-defaults.inc b/meta-digi-arm/conf/machine/include/digi-defaults.inc index e0bcd1352..8f2f9bb2c 100644 --- a/meta-digi-arm/conf/machine/include/digi-defaults.inc +++ b/meta-digi-arm/conf/machine/include/digi-defaults.inc @@ -84,7 +84,7 @@ DEY_SELINUX_POLICY ?= "1" # U-Boot scripts to include in 'linux' partition # (use the '+=' operator, since other layers may append scripts to this list) -BOOT_SCRIPTS += "boot.scr:boot.scr ${@oe.utils.vartrue('DUALBOOT_ENABLED', 'altboot.scr:altboot.scr', '', d)}" +BOOT_SCRIPTS += "boot.scr:boot.scr altboot.scr:altboot.scr" # This can be used to enable U-Boot update through swupdate SWUPDATE_UBOOTIMG ?= "false" diff --git a/meta-digi-arm/conf/machine/include/imx-digi-base.inc b/meta-digi-arm/conf/machine/include/imx-digi-base.inc index 414a3f79c..84ae86a30 100644 --- a/meta-digi-arm/conf/machine/include/imx-digi-base.inc +++ b/meta-digi-arm/conf/machine/include/imx-digi-base.inc @@ -44,10 +44,10 @@ MACHINEOVERRIDES_EXTENDER:mx6q:use-nxp-bsp = "imx-generic-bsp:imx-nxp-bsp:imxf MACHINEOVERRIDES_EXTENDER:mx6dl:use-nxp-bsp = "imx-generic-bsp:imx-nxp-bsp:imxfbdev:imxpxp:imxipu:imxvpu:imxgpu:imxgpu2d:imxgpu3d:imxepdc:mx6-generic-bsp:mx6-nxp-bsp:mx6dl-generic-bsp:mx6dl-nxp-bsp" MACHINEOVERRIDES_EXTENDER:mx6ul:use-nxp-bsp = "imx-generic-bsp:imx-nxp-bsp:imxfbdev:imxpxp:mx6-generic-bsp:mx6-nxp-bsp:mx6ul-generic-bsp:mx6ul-nxp-bsp" MACHINEOVERRIDES_EXTENDER:mx8mm:use-nxp-bsp = "imx-generic-bsp:imx-nxp-bsp:imxdrm:imxvpu:imxgpu:imxgpu2d:imxgpu3d:mx8-generic-bsp:mx8-nxp-bsp:mx8m-generic-bsp:mx8m-nxp-bsp:mx8mm-generic-bsp:mx8mm-nxp-bsp" -MACHINEOVERRIDES_EXTENDER:mx8mn:use-nxp-bsp = "imx-generic-bsp:imx-nxp-bsp:imxdrm:imxgpu:imxgpu3d:mx8-generic-bsp:mx8-nxp-bsp:mx8m-generic-bsp:mx8m-nxp-bsp:mx8mn-generic-bsp:mx8mn-nxp-bsp" -MACHINEOVERRIDES_EXTENDER:mx8mp:use-nxp-bsp = "imx-generic-bsp:imx-nxp-bsp:imxdrm:imxvpu:imxgpu:imxgpu2d:imxgpu3d:mx8-generic-bsp:mx8-nxp-bsp:mx8m-generic-bsp:mx8m-nxp-bsp:mx8mp-generic-bsp:mx8mp-nxp-bsp" -MACHINEOVERRIDES_EXTENDER:mx8qxp:use-nxp-bsp = "imx-generic-bsp:imx-nxp-bsp:imxdrm:imxdpu:imxgpu:imxgpu2d:imxgpu3d:mx8-generic-bsp:mx8-nxp-bsp:mx8x-generic-bsp:mx8x-nxp-bsp:mx8qxp-generic-bsp:mx8qxp-nxp-bsp" -MACHINEOVERRIDES_EXTENDER:mx8dx:use-nxp-bsp = "imx-generic-bsp:imx-nxp-bsp:imxdrm:imxdpu:imxgpu:imxgpu2d:imxgpu3d:mx8-generic-bsp:mx8-nxp-bsp:mx8x-generic-bsp:mx8x-nxp-bsp:mx8dx-generic-bsp:mx8dx-nxp-bsp" +MACHINEOVERRIDES_EXTENDER:mx8mn:use-nxp-bsp = "imx-generic-bsp:imx-nxp-bsp:imxdrm:imxgpu:imxgpu3d:imxvulkan:mx8-generic-bsp:mx8-nxp-bsp:mx8m-generic-bsp:mx8m-nxp-bsp:mx8mn-generic-bsp:mx8mn-nxp-bsp" +MACHINEOVERRIDES_EXTENDER:mx8mp:use-nxp-bsp = "imx-generic-bsp:imx-nxp-bsp:imxdrm:imxvpu:imxgpu:imxgpu2d:imxgpu3d:imxvulkan:mx8-generic-bsp:mx8-nxp-bsp:mx8m-generic-bsp:mx8m-nxp-bsp:mx8mp-generic-bsp:mx8mp-nxp-bsp" +MACHINEOVERRIDES_EXTENDER:mx8qxp:use-nxp-bsp = "imx-generic-bsp:imx-nxp-bsp:imxdrm:imxdpu:imxgpu:imxgpu2d:imxgpu3d:imxvulkan:mx8-generic-bsp:mx8-nxp-bsp:mx8x-generic-bsp:mx8x-nxp-bsp:mx8qxp-generic-bsp:mx8qxp-nxp-bsp" +MACHINEOVERRIDES_EXTENDER:mx8dx:use-nxp-bsp = "imx-generic-bsp:imx-nxp-bsp:imxdrm:imxdpu:imxgpu:imxgpu2d:imxgpu3d:imxvulkan:mx8-generic-bsp:mx8-nxp-bsp:mx8x-generic-bsp:mx8x-nxp-bsp:mx8dx-generic-bsp:mx8dx-nxp-bsp" ####### ### Mainline BSP specific overrides @@ -76,6 +76,8 @@ MACHINEOVERRIDES_EXTENDER_FILTER_OUT = " \ mx7d \ mx7ulp \ \ + vf \ + \ mx8 \ mx8m \ mx8qm \ @@ -116,6 +118,11 @@ MACHINE_SOCARCH_FILTER:append:imxvpu = " \ libimxvpuapi \ virtual/imxvpu \ " +MACHINE_SOCARCH_FILTER:append:imxvulkan = " \ + vulkan-headers \ + vulkan-loader \ + vulkan-tools \ +" MACHINE_SOCARCH_FILTER:append:imxgpu = " \ virtual/egl \ virtual/mesa \ @@ -211,31 +218,37 @@ PREFERRED_PROVIDER_virtual/egl:imxgpu ?= "imx-gpu-viv" PREFERRED_PROVIDER_virtual/libgl:imxgpu3d ?= "imx-gpu-viv" PREFERRED_PROVIDER_virtual/libgles1:imxgpu3d ?= "imx-gpu-viv" PREFERRED_PROVIDER_virtual/libgles2:imxgpu3d ?= "imx-gpu-viv" +PREFERRED_PROVIDER_virtual/libgles3:imxgpu3d ?= "imx-gpu-viv" PREFERRED_PROVIDER_virtual/libg2d ?= "imx-gpu-g2d" PREFERRED_PROVIDER_virtual/libg2d:imxdpu ?= "imx-dpu-g2d" PREFERRED_PROVIDER_opencl-clhpp:imxgpu ?= "imx-gpu-viv" PREFERRED_PROVIDER_opencl-headers:imxgpu ?= "imx-gpu-viv" PREFERRED_PROVIDER_opencl-icd-loader:imxgpu ?= "imx-gpu-viv" +PREFERRED_PROVIDER_virtual/opencl-icd:imxgpu ?= "imx-gpu-viv" -PREFERRED_VERSION_weston:imx-nxp-bsp ??= "10.0.0.imx" +PREFERRED_VERSION_weston:imx-nxp-bsp ??= "10.0.1.imx" PREFERRED_VERSION_weston:imx-mainline-bsp = "" -PREFERRED_VERSION_wayland-protocols:mx6-nxp-bsp ?= "1.25.imx" -PREFERRED_VERSION_wayland-protocols:mx7-nxp-bsp ?= "1.25.imx" -PREFERRED_VERSION_wayland-protocols:mx8-nxp-bsp ?= "1.25.imx" +PREFERRED_VERSION_wayland-protocols:mx6-nxp-bsp ??= "1.25.imx" +PREFERRED_VERSION_wayland-protocols:mx7-nxp-bsp ??= "1.25.imx" +PREFERRED_VERSION_wayland-protocols:mx8-nxp-bsp ??= "1.25.imx" # Use i.MX libdrm Version -PREFERRED_VERSION_libdrm:mx6-nxp-bsp ?= "2.4.109.imx" -PREFERRED_VERSION_libdrm:mx7-nxp-bsp ?= "2.4.109.imx" -PREFERRED_VERSION_libdrm:mx8-nxp-bsp ?= "2.4.109.imx" +PREFERRED_VERSION_libdrm:mx6-nxp-bsp ??= "2.4.109.imx" +PREFERRED_VERSION_libdrm:mx7-nxp-bsp ??= "2.4.109.imx" +PREFERRED_VERSION_libdrm:mx8-nxp-bsp ??= "2.4.109.imx" + +PREFERRED_VERSION_vulkan-headers:imxvulkan ??= "1.2.182.0" +PREFERRED_VERSION_vulkan-loader:imxvulkan ??= "1.2.182.0" +PREFERRED_VERSION_vulkan-tools:imxvulkan ??= "1.2.182.0" # Use i.MX optee Version -PREFERRED_VERSION_optee-os:mx8-nxp-bsp ?= "3.15.0.imx" -PREFERRED_VERSION_optee-client:mx8-nxp-bsp ?= "3.15.0.imx" -PREFERRED_VERSION_optee-test:mx8-nxp-bsp ?= "3.15.0.imx" +PREFERRED_VERSION_optee-os:mx8-nxp-bsp ??= "3.17.0.imx" +PREFERRED_VERSION_optee-client:mx8-nxp-bsp ??= "3.17.0.imx" +PREFERRED_VERSION_optee-test:mx8-nxp-bsp ??= "3.17.0.imx" #Use i.MX opencv Version for mx8 -PREFERRED_VERSION_opencv:mx8-nxp-bsp ?= "4.5.2.imx" +PREFERRED_VERSION_opencv:mx8-nxp-bsp ??= "4.6.0.imx" EXTRA_IMAGEDEPENDS = "u-boot" diff --git a/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-graphics/wayland/weston-init.bbappend b/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-graphics/wayland/weston-init.bbappend index 62e42a610..845ee96e8 100644 --- a/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-graphics/wayland/weston-init.bbappend +++ b/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-graphics/wayland/weston-init.bbappend @@ -95,5 +95,5 @@ do_install:append:stm32mpcommon() { SYSTEMD_SERVICE:${PN}:remove = "weston.service weston.socket" SYSTEMD_SERVICE:${PN} += "weston-launch.service weston-checkgpu.service" #inherit useradd -USERADD_PARAM:${PN} = "--home /home/weston --shell /bin/sh --user-group -G video,input,tty,audio,weston-launch,dialout weston" +USERADD_PARAM:${PN} = "--home /home/weston --shell /bin/sh --user-group -G video,input,tty,audio,weston-launch,dialout,disk weston" GROUPADD_PARAM:${PN} = "-r weston-launch; -r wayland" diff --git a/meta-digi-arm/recipes-bsp/u-boot/digi-u-boot.inc b/meta-digi-arm/recipes-bsp/u-boot/digi-u-boot.inc index 748728579..b0bfe30c4 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/digi-u-boot.inc +++ b/meta-digi-arm/recipes-bsp/u-boot/digi-u-boot.inc @@ -21,13 +21,15 @@ UBOOT_GIT_URI ?= "${@oe.utils.conditional('DIGI_INTERNAL_GIT', '1' , '${UBOOT_UR SRC_URI = " \ ${UBOOT_GIT_URI};branch=${SRCBRANCH} \ + file://altboot.txt \ file://boot.txt \ file://install_linux_fw_sd.txt \ file://install_linux_fw_usb.txt \ ${@oe.utils.conditional('UBOOT_HAS_FASTBOOT', 'true', 'file://install_linux_fw_uuu.sh', '', d)} \ - ${@oe.utils.vartrue('DUALBOOT_ENABLED', 'file://altboot.txt', '', d)} \ " +BUILD_UBOOT_SCRIPTS ?= "true" + BOOTLOADER_IMAGE_RECIPE ?= "u-boot" LOCALVERSION ?= "" @@ -123,6 +125,51 @@ def tf_bootscript_sedfilter(d): tf_initramfs = d.getVar('TRUSTFENCE_INITRAMFS_IMAGE',True) or "" return "s,\(^[[:blank:]]*\)true.*,\\1setenv boot_initrd true\\n\\1setenv initrd_file %s-${MACHINE}.cpio.gz.u-boot.tf,g" % tf_initramfs if tf_initramfs else "" +build_uboot_scripts() { + # DEY firmware install scripts + sed -i -e 's,##GRAPHICAL_BACKEND##,${GRAPHICAL_BACKEND},g' ${WORKDIR}/install_linux_fw_sd.txt ${WORKDIR}/install_linux_fw_usb.txt + sed -i -e 's,##MACHINE##,${MACHINE},g' ${WORKDIR}/install_linux_fw_sd.txt ${WORKDIR}/install_linux_fw_usb.txt + sed -i -e 's,##GRAPHICAL_IMAGES##,${GRAPHICAL_IMAGES},g' ${WORKDIR}/install_linux_fw_sd.txt ${WORKDIR}/install_linux_fw_usb.txt + sed -i -e 's,##DEFAULT_IMAGE_NAME##,${DEFAULT_IMAGE_NAME},g' ${WORKDIR}/install_linux_fw_sd.txt ${WORKDIR}/install_linux_fw_usb.txt + mkimage -T script -n "DEY firmware install script" -C none -d ${WORKDIR}/install_linux_fw_sd.txt ${DEPLOYDIR}/install_linux_fw_sd.scr + mkimage -T script -n "DEY firmware install script" -C none -d ${WORKDIR}/install_linux_fw_usb.txt ${DEPLOYDIR}/install_linux_fw_usb.scr + + if [ "${@oe.utils.conditional('UBOOT_HAS_FASTBOOT', 'true', 'true', '', d)}" = "true" ]; then + # DEY firmware install uuu script + sed -i -e 's,##GRAPHICAL_BACKEND##,${GRAPHICAL_BACKEND},g' ${WORKDIR}/install_linux_fw_uuu.sh + sed -i -e 's,##MACHINE##,${MACHINE},g' ${WORKDIR}/install_linux_fw_uuu.sh + sed -i -e 's,##GRAPHICAL_IMAGES##,${GRAPHICAL_IMAGES},g' ${WORKDIR}/install_linux_fw_uuu.sh + sed -i -e 's,##DEFAULT_IMAGE_NAME##,${DEFAULT_IMAGE_NAME},g' ${WORKDIR}/install_linux_fw_uuu.sh + install -m 775 ${WORKDIR}/install_linux_fw_uuu.sh ${DEPLOYDIR}/ + fi + + # Boot script for DEY images (reconfigure on-the-fly if TRUSTFENCE is enabled) + TMP_BOOTSCR="$(mktemp ${WORKDIR}/bootscr.XXXXXX)" + sed -e "${TF_BOOTSCRIPT_SEDFILTER}" ${WORKDIR}/boot.txt > ${TMP_BOOTSCR} + mkimage -T script -n bootscript -C none -d ${TMP_BOOTSCR} ${DEPLOYDIR}/boot.scr + + # Alternate boot script for dualboot + mkimage -T script -n "Alternate bootscript" -C none -d ${WORKDIR}/altboot.txt ${DEPLOYDIR}/altboot.scr + + # Sign the scripts + if [ "${TRUSTFENCE_SIGN}" = "1" ]; then + export CONFIG_SIGN_KEYS_PATH="${TRUSTFENCE_SIGN_KEYS_PATH}" + [ -n "${TRUSTFENCE_KEY_INDEX}" ] && export CONFIG_KEY_INDEX="${TRUSTFENCE_KEY_INDEX}" + [ -n "${TRUSTFENCE_DEK_PATH}" ] && [ "${TRUSTFENCE_DEK_PATH}" != "0" ] && export CONFIG_DEK_PATH="${TRUSTFENCE_DEK_PATH}" + + # Sign boot script + TMP_SIGNED_BOOTSCR="$(mktemp ${WORKDIR}/bootscr-signed.XXXXXX)" + trustfence-sign-artifact.sh -p "${DIGI_FAMILY}" -b "${DEPLOYDIR}/boot.scr" "${TMP_SIGNED_BOOTSCR}" + mv "${TMP_SIGNED_BOOTSCR}" "${DEPLOYDIR}/boot.scr" + + # Sign altboot script + TMP_SIGNED_BOOTSCR="$(mktemp ${WORKDIR}/altboot-signed.XXXXXX)" + trustfence-sign-artifact.sh -p "${DIGI_FAMILY}" -b "${DEPLOYDIR}/altboot.scr" "${TMP_SIGNED_BOOTSCR}" + mv "${TMP_SIGNED_BOOTSCR}" "${DEPLOYDIR}/altboot.scr" + fi + rm -f ${TMP_BOOTSCR} +} + do_deploy:append() { # Remove canonical U-Boot symlinks for ${UBOOT_CONFIG} currently in the form: # u-boot-.- @@ -163,52 +210,9 @@ do_deploy:append() { unset i fi - # DEY firmware install scripts - sed -i -e 's,##GRAPHICAL_BACKEND##,${GRAPHICAL_BACKEND},g' ${WORKDIR}/install_linux_fw_sd.txt ${WORKDIR}/install_linux_fw_usb.txt - sed -i -e 's,##MACHINE##,${MACHINE},g' ${WORKDIR}/install_linux_fw_sd.txt ${WORKDIR}/install_linux_fw_usb.txt - sed -i -e 's,##GRAPHICAL_IMAGES##,${GRAPHICAL_IMAGES},g' ${WORKDIR}/install_linux_fw_sd.txt ${WORKDIR}/install_linux_fw_usb.txt - sed -i -e 's,##DEFAULT_IMAGE_NAME##,${DEFAULT_IMAGE_NAME},g' ${WORKDIR}/install_linux_fw_sd.txt ${WORKDIR}/install_linux_fw_usb.txt - mkimage -T script -n "DEY firmware install script" -C none -d ${WORKDIR}/install_linux_fw_sd.txt ${DEPLOYDIR}/install_linux_fw_sd.scr - mkimage -T script -n "DEY firmware install script" -C none -d ${WORKDIR}/install_linux_fw_usb.txt ${DEPLOYDIR}/install_linux_fw_usb.scr - - if [ "${@oe.utils.conditional('UBOOT_HAS_FASTBOOT', 'true', 'true', '', d)}" = "true" ]; then - # DEY firmware install uuu script - sed -i -e 's,##GRAPHICAL_BACKEND##,${GRAPHICAL_BACKEND},g' ${WORKDIR}/install_linux_fw_uuu.sh - sed -i -e 's,##MACHINE##,${MACHINE},g' ${WORKDIR}/install_linux_fw_uuu.sh - sed -i -e 's,##GRAPHICAL_IMAGES##,${GRAPHICAL_IMAGES},g' ${WORKDIR}/install_linux_fw_uuu.sh - sed -i -e 's,##DEFAULT_IMAGE_NAME##,${DEFAULT_IMAGE_NAME},g' ${WORKDIR}/install_linux_fw_uuu.sh - install -m 775 ${WORKDIR}/install_linux_fw_uuu.sh ${DEPLOYDIR}/ + if [ "${BUILD_UBOOT_SCRIPTS}" = "true" ]; then + build_uboot_scripts fi - - # Boot script for DEY images (reconfigure on-the-fly if TRUSTFENCE is enabled) - TMP_BOOTSCR="$(mktemp ${WORKDIR}/bootscr.XXXXXX)" - sed -e "${TF_BOOTSCRIPT_SEDFILTER}" ${WORKDIR}/boot.txt > ${TMP_BOOTSCR} - mkimage -T script -n bootscript -C none -d ${TMP_BOOTSCR} ${DEPLOYDIR}/boot.scr - - # Alternate boot script for dualboot - if [ "${DUALBOOT_ENABLED}" = "true" ]; then - mkimage -T script -n "Alternate bootscript" -C none -d ${WORKDIR}/altboot.txt ${DEPLOYDIR}/altboot.scr - fi - - # Sign the scripts - if [ "${TRUSTFENCE_SIGN}" = "1" ]; then - export CONFIG_SIGN_KEYS_PATH="${TRUSTFENCE_SIGN_KEYS_PATH}" - [ -n "${TRUSTFENCE_KEY_INDEX}" ] && export CONFIG_KEY_INDEX="${TRUSTFENCE_KEY_INDEX}" - [ -n "${TRUSTFENCE_DEK_PATH}" ] && [ "${TRUSTFENCE_DEK_PATH}" != "0" ] && export CONFIG_DEK_PATH="${TRUSTFENCE_DEK_PATH}" - - # Sign boot script - TMP_SIGNED_BOOTSCR="$(mktemp ${WORKDIR}/bootscr-signed.XXXXXX)" - trustfence-sign-artifact.sh -p "${DIGI_FAMILY}" -b "${DEPLOYDIR}/boot.scr" "${TMP_SIGNED_BOOTSCR}" - mv "${TMP_SIGNED_BOOTSCR}" "${DEPLOYDIR}/boot.scr" - - if [ "${DUALBOOT_ENABLED}" = "true" ]; then - # Sign boot script - TMP_SIGNED_BOOTSCR="$(mktemp ${WORKDIR}/altboot-signed.XXXXXX)" - trustfence-sign-artifact.sh -p "${DIGI_FAMILY}" -b "${DEPLOYDIR}/altboot.scr" "${TMP_SIGNED_BOOTSCR}" - mv "${TMP_SIGNED_BOOTSCR}" "${DEPLOYDIR}/altboot.scr" - fi - fi - rm -f ${TMP_BOOTSCR} } BOOT_TOOLS = "imx-boot-tools" diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2020.04.bb b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2020.04.bb index 2b3f9a8f7..600a521da 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2020.04.bb +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2020.04.bb @@ -1,4 +1,4 @@ -# Copyright (C) 2020-2021 Digi International +# Copyright (C) 2020-2022 Digi International require digi-u-boot.inc LIC_FILES_CHKSUM = "file://Licenses/README;md5=30503fd321432fc713238f582193b78e" diff --git a/meta-digi-arm/recipes-core/udev/udev-extraconf/mount.sh b/meta-digi-arm/recipes-core/udev/udev-extraconf/mount.sh deleted file mode 100644 index 89d06b66a..000000000 --- a/meta-digi-arm/recipes-core/udev/udev-extraconf/mount.sh +++ /dev/null @@ -1,157 +0,0 @@ -#!/bin/sh -# -# Called from udev -# -# Attempt to mount any added block devices and umount any removed devices - -BASE_INIT="`readlink -f "@base_sbindir@/init"`" -INIT_SYSTEMD="@systemd_unitdir@/systemd" - -if [ "x$BASE_INIT" = "x$INIT_SYSTEMD" ];then - # systemd as init uses systemd-mount to mount block devices - MOUNT="/usr/bin/systemd-mount" - UMOUNT="/usr/bin/systemd-umount" - - if [ -x $MOUNT ] && [ -x $UMOUNT ]; - then - logger "Using systemd-mount to finish mount" - else - logger "Linux init is using systemd, so please install systemd-mount to finish mount" - exit 1 - fi -else - MOUNT="/bin/mount" - UMOUNT="/bin/umount" -fi - -PMOUNT="/usr/bin/pmount" - -for line in `grep -h -v ^# /etc/udev/mount.blacklist /etc/udev/mount.blacklist.d/*` -do - if [ ` expr match "$DEVNAME" "$line" ` -gt 0 ]; - then - logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring" - exit 0 - fi -done - -automount_systemd() { - name="`basename "$DEVNAME"`" - - # Skip already mounted partitions - if [ -f /run/systemd/transient/run-media-$name.mount ]; then - logger "mount.sh/automount" "/run/media/$name already mounted" - return - fi - - # Skip the partition which are already in /etc/fstab - grep "^[[:space:]]*$DEVNAME" /etc/fstab && return - for n in LABEL PARTLABEL UUID PARTUUID; do - tmp="$(lsblk -o $n $DEVNAME | sed -e '1d')" - test -z "$tmp" && continue - tmp="$n=$tmp" - grep "^[[:space:]]*$tmp" /etc/fstab && return - done - - [ -d "/run/media/$name" ] || mkdir -p "/run/media/$name" - - MOUNT="$MOUNT -o silent" - - # If filesystemtype is vfat, change the ownership group to 'disk', and - # grant it with w/r/x permissions. - case $ID_FS_TYPE in - vfat|fat) - MOUNT="$MOUNT -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`" - ;; - # TODO - *) - ;; - esac - - if ! $MOUNT --no-block -t auto $DEVNAME "/run/media/$name" - then - #logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"/run/media/$name\" failed!" - rm_dir "/run/media/$name" - else - logger "mount.sh/automount" "Auto-mount of [/run/media/$name] successful" - touch "/tmp/.automount-$name" - fi -} - -automount() { - name="`basename "$DEVNAME"`" - - if [ -x "$PMOUNT" ]; then - $PMOUNT $DEVNAME 2> /dev/null - elif [ -x $MOUNT ]; then - $MOUNT $DEVNAME 2> /dev/null - fi - - # If the device isn't mounted at this point, it isn't - # configured in fstab - grep -q "^$DEVNAME " /proc/mounts && return - - ! test -d "/run/media/$name" && mkdir -p "/run/media/$name" - # Silent util-linux's version of mounting auto - if [ "x`readlink $MOUNT`" = "x/bin/mount.util-linux" ] ; - then - MOUNT="$MOUNT -o silent" - fi - - # If filesystem type is vfat, change the ownership group to 'disk', and - # grant it with w/r/x permissions. - case $ID_FS_TYPE in - vfat|fat) - MOUNT="$MOUNT -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`" - ;; - # TODO - *) - ;; - esac - - if ! $MOUNT -t auto $DEVNAME "/run/media/$name" - then - #logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"/run/media/$name\" failed!" - rm_dir "/run/media/$name" - else - logger "mount.sh/automount" "Auto-mount of [/run/media/$name] successful" - touch "/tmp/.automount-$name" - fi -} - -rm_dir() { - # We do not want to rm -r populated directories - if test "`find "$1" | wc -l | tr -d " "`" -lt 2 -a -d "$1" - then - ! test -z "$1" && rm -r "$1" - else - logger "mount.sh/automount" "Not removing non-empty directory [$1]" - fi -} - -# No ID_FS_TYPE for cdrom device, yet it should be mounted -name="`basename "$DEVNAME"`" -[ -e /sys/block/$name/device/media ] && media_type=`cat /sys/block/$name/device/media` - -if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ] && [ -n "$ID_FS_TYPE" -o "$media_type" = "cdrom" ]; then - # Note the root filesystem can show up as /dev/root in /proc/mounts, - # so check the device number too - if expr $MAJOR "*" 256 + $MINOR != `stat -c %d /`; then - if [ "`basename $MOUNT`" = "systemd-mount" ];then - automount_systemd - else - automount - fi - fi -fi - -if [ "$ACTION" = "remove" ] || [ "$ACTION" = "change" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then - for mnt in `cat /proc/mounts | grep "$DEVNAME" | cut -f 2 -d " " ` - do - $UMOUNT $mnt - done - - # Remove empty directories from auto-mounter - name="`basename "$DEVNAME"`" - test -e "/tmp/.automount-$name" && rm_dir "/run/media/$name" -fi diff --git a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools/trustfence-sign-artifact.sh b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools/trustfence-sign-artifact.sh index d8f0a1d0c..8c57ff03a 100755 --- a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools/trustfence-sign-artifact.sh +++ b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools/trustfence-sign-artifact.sh @@ -126,11 +126,17 @@ if [ -z "${CONFIG_RAM_START}" ]; then fi # Get DEK key -if [ -n "${CONFIG_DEK_PATH}" ] && [ "${PLATFORM}" != "ccimx8mn" ] && [ "${PLATFORM}" != "ccimx8mm" ]; then +if [ -n "${CONFIG_DEK_PATH}" ]; then if [ ! -f "${CONFIG_DEK_PATH}" ]; then - echo "DEK not found. Generating random 256 bit DEK." - [ -d $(dirname ${CONFIG_DEK_PATH}) ] || mkdir -p $(dirname ${CONFIG_DEK_PATH}) - dd if=/dev/urandom of="${CONFIG_DEK_PATH}" bs=32 count=1 >/dev/null 2>&1 + if [ "${PLATFORM}" = "ccimx8mn" ] || [ "${PLATFORM}" = "ccimx8mm" ]; then + echo "DEK not found. Generating random 128 bit DEK." + [ -d $(dirname ${CONFIG_DEK_PATH}) ] || mkdir -p $(dirname ${CONFIG_DEK_PATH}) + dd if=/dev/urandom of="${CONFIG_DEK_PATH}" bs=16 count=1 >/dev/null 2>&1 + else + echo "DEK not found. Generating random 256 bit DEK." + [ -d $(dirname ${CONFIG_DEK_PATH}) ] || mkdir -p $(dirname ${CONFIG_DEK_PATH}) + dd if=/dev/urandom of="${CONFIG_DEK_PATH}" bs=32 count=1 >/dev/null 2>&1 + fi fi dek_size="$((8 * $(stat -L -c %s ${CONFIG_DEK_PATH})))" if [ "${dek_size}" != "128" ] && [ "${dek_size}" != "192" ] && [ "${dek_size}" != "256" ]; then diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/imx-g2d/imx-dpu-g2d_1.9.4.bb b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/imx-g2d/imx-dpu-g2d_1.9.4.bb deleted file mode 100644 index 83a7df2bb..000000000 --- a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/imx-g2d/imx-dpu-g2d_1.9.4.bb +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (C) 2016 Freescale Semiconductor -# Copyright 2017-2021 NXP -# Released under the MIT license (see COPYING.MIT for the terms) - -DESCRIPTION = "GPU G2D library and apps for i.MX with 2D GPU and DPU" -LICENSE = "Proprietary" -LIC_FILES_CHKSUM = "file://COPYING;md5=e565271ec9a80ce47abbddc4bffe56fa" -PROVIDES += "virtual/libg2d" - -SRC_URI = "${FSL_MIRROR}/${BPN}-${PV}.bin;fsl-eula=true" -SRC_URI[md5sum] = "0b7fc529b3af3ecc3087a99cca0c627d" -SRC_URI[sha256sum] = "42d470373fd72b2e2aa8d8a226e133c61b0a88e4e5bddbfec9509f7d2764f206" - -inherit fsl-eula-unpack - -do_install () { - install -d ${D}${libdir} - install -d ${D}${includedir} - cp -r --no-preserve=ownership ${S}/g2d/usr/lib/*.so* ${D}${libdir} - cp -r --no-preserve=ownership ${S}/g2d/usr/include/* ${D}${includedir} - cp -r -d --no-preserve=ownership ${S}/gpu-demos/opt ${D} -} - -FILES:${PN} += "/opt" -INSANE_SKIP:${PN} += "ldflags" - -RDEPENDS:${PN} = "libgal-imx libdrm" - -# This is required to provide support for VPU Amphion HEVC tile format -# From NXP [MGS-5547] (commit e175d6b4f78deab24d319b852998bef55cdecc99): -# VPU Amphion HEVC tile support was added using OpenCL, so add a dependency on libopencl-imx. -RDEPENDS:${PN} += "libopencl-imx" - -COMPATIBLE_MACHINE = "(imxdpu)" diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/imx-g2d/imx-g2d-samples_1.0.0.bb b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/imx-g2d/imx-g2d-samples_1.0.0.bb deleted file mode 100644 index e62e43e37..000000000 --- a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/imx-g2d/imx-g2d-samples_1.0.0.bb +++ /dev/null @@ -1,21 +0,0 @@ -SUMMARY = "i.MX G2D Samples" -DESCRIPTION = "Set of sample applications for i.MX G2D" -LICENSE = "BSD-3-Clause" -LIC_FILES_CHKSUM = "file://COPYING;md5=0858ec9c7a80c4a2cf16e4f825a2cc91" - -DEPENDS = "virtual/libg2d" - -GPU_G2D_SAMPLES_SRC ?= "git://github.com/nxpmicro/g2d-samples.git;protocol=https" -SRCBRANCH ?= "imx_1.0" -SRC_URI = "${GPU_G2D_SAMPLES_SRC};branch=${SRCBRANCH}" -SRCREV = "daf64d010666ef2458566573c074e238993f228c" - -S = "${WORKDIR}/git" - -do_configure[noexec] = "1" - -do_install() { - oe_runmake install DESTDIR=${D} PREFIX=${exec_prefix} -} - -FILES:${PN} += "/opt" diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/imx-g2d/imx-gpu-g2d_6.4.3.p2.4.bb b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/imx-g2d/imx-gpu-g2d_6.4.3.p2.4.bb deleted file mode 100644 index 15283bdbe..000000000 --- a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/imx-g2d/imx-gpu-g2d_6.4.3.p2.4.bb +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (C) 2016 Freescale Semiconductor -# Copyright 2017-2021 NXP -# Copyright 2018 (C) O.S. Systems Software LTDA. -# Released under the MIT license (see COPYING.MIT for the terms) - -DESCRIPTION = "G2D library using i.MX GPU" -LICENSE = "Proprietary" -LIC_FILES_CHKSUM = "file://COPYING;md5=03bcadc8dc0a788f66ca9e2b89f56c6f" -DEPENDS = "libgal-imx" -PROVIDES = "virtual/libg2d" - -FSLBIN_NAME = "${PN}-${PV}-${TARGET_ARCH}" - -SRC_URI = "${FSL_MIRROR}/${FSLBIN_NAME}.bin;name=${TARGET_ARCH};fsl-eula=true" -SRC_URI[aarch64.md5sum] = "9d64a9c4a870419607d9e47e832eb997" -SRC_URI[aarch64.sha256sum] = "6065f545568e6cdc138f2d6e7cdcb525e477ce1d775c0ceabe2beb2eacf4eb5b" -SRC_URI[arm.md5sum] = "4d6cb47f09f268533cc6a9a90cc87555" -SRC_URI[arm.sha256sum] = "b298a38a16400e655ea46ab25b6261e602687e9970dd755594db343064a9ae53" - -S = "${WORKDIR}/${FSLBIN_NAME}" - -inherit fsl-eula-unpack - -do_install () { - cp -r -d --no-preserve=ownership ${S}/g2d/* ${D} -} - -INSANE_SKIP:${PN} += "ldflags" - -COMPATIBLE_MACHINE = "(imxgpu2d)" diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/imx-gpu-viv/imx-gpu-viv-6-overrides.inc b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/imx-gpu-viv/imx-gpu-viv-6-overrides.inc deleted file mode 100644 index 6c382e592..000000000 --- a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/imx-gpu-viv/imx-gpu-viv-6-overrides.inc +++ /dev/null @@ -1,49 +0,0 @@ -require recipes-graphics/imx-gpu-viv/imx-gpu-viv-6.inc - -PACKAGECONFIG ?= "valgrind" - -INHIBIT_SYSROOT_STRIP = "1" - -IMX_SOC = "IMX_SOC_NOT_SET" -IMX_SOC:mx8qm-nxp-bsp = "mx8qm" -IMX_SOC:mx8mp-nxp-bsp = "mx8mp" -IMX_SOC:mx8mq-nxp-bsp = "mx8mq" -IMX_SOC:mx8qxp-nxp-bsp = "mx8qxp" -IMX_SOC:mx8mn-nxp-bsp = "mx8mn" -IMX_SOC:mx8ulp-nxp-bsp = "mx8ulp" - -do_install:append() { - if [ -d ${S}/gpu-core/usr/lib/${IMX_SOC} ]; then - cp -r ${S}/gpu-core/usr/lib/${IMX_SOC}/* ${D}${libdir} - fi - # Undo removals - for header in ${GLES3_HEADER_REMOVALS}; do - cp ${S}/gpu-core/usr/include/GLES3/${header} ${D}${includedir}/GLES3 - done -} - -# dri and libVDK.so are removed, make a workaround so base install is not broken -do_install:prepend() { - mkdir -p ${S}/gpu-core/usr/lib/dri - mkdir -p ${S}/gpu-core/usr/lib/fb - touch ${S}/gpu-core/usr/lib/fb/libVDK.so.1.2.0 -} -do_install:append() { - rm -rf ${D}${libdir}/dri - rm -f ${D}${libdir}/libVDK-fb.so.1.2.0 -} - -RDEPENDS:libopenvg-imx += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-gpuconfig', '', d)}" - -FILES:libnn-imx:remove = "${libdir}/libnn*${SOLIBS} ${libdir}/libneuralnetworks${SOLIBS}" - -FILES:libvulkan-imx += "${libdir}/libvulkan_VSI${SOLIBS}" -INSANE_SKIP:libvulkan-imx += "dev-so" -FILES:libopenvx-imx += "${libdir}/libOpenVX${SOLIBS}" -INSANE_SKIP:libopenvx-imx += "dev-so dev-deps" -FILES:libopencl-imx += "${libdir}/libOpenCL${SOLIBS}" -INSANE_SKIP:libopencl-imx += "dev-so dev-deps" -FILES:libopenvg-imx += "${libdir}/libOpenVG*${SOLIBS}" -INSANE_SKIP:libopenvg-imx += "dev-so" -FILES:libvdk-imx += "${libdir}/libVDK*${SOLIBS}" -INSANE_SKIP:libvdk-imx += "dev-so" diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.3.p2.4-aarch32.bb b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.3.p2.4-aarch32.bb deleted file mode 100644 index 8b2f53a12..000000000 --- a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.3.p2.4-aarch32.bb +++ /dev/null @@ -1,8 +0,0 @@ -require imx-gpu-viv-6-overrides.inc - -LIC_FILES_CHKSUM = "file://COPYING;md5=03bcadc8dc0a788f66ca9e2b89f56c6f" - -SRC_URI[md5sum] = "d577c4e34df73855ebf1c3b3be206f40" -SRC_URI[sha256sum] = "a0266612e8c9ca64b417047274941c867de1058db6709170d0bb5c8b8a38eab1" - -COMPATIBLE_MACHINE = "(mx6q-nxp-bsp|mx6dl-nxp-bsp|mx6sx-nxp-bsp|mx6sl-nxp-bsp|mx7ulp-nxp-bsp)" diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.3.p2.4-aarch64.bb b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.3.p2.4-aarch64.bb deleted file mode 100644 index 970d636df..000000000 --- a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.3.p2.4-aarch64.bb +++ /dev/null @@ -1,8 +0,0 @@ -require imx-gpu-viv-6-overrides.inc - -LIC_FILES_CHKSUM = "file://COPYING;md5=03bcadc8dc0a788f66ca9e2b89f56c6f" - -SRC_URI[md5sum] = "d53371c1a9a504ff15f747e725164dcb" -SRC_URI[sha256sum] = "6106133afed40327b65d3eec0c197d214ff8f28f8ce3cad94653be4bffb9f9d4" - -COMPATIBLE_MACHINE = "(mx8-nxp-bsp)" diff --git a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-support/opencv/opencv_4.5.2.imx.bbappend b/meta-digi-dey/dynamic-layers/freescale-layer/recipes-support/opencv/opencv_4.5.2.imx.bbappend deleted file mode 100644 index 27a652b60..000000000 --- a/meta-digi-dey/dynamic-layers/freescale-layer/recipes-support/opencv/opencv_4.5.2.imx.bbappend +++ /dev/null @@ -1,3 +0,0 @@ -SRCREV_opencv = "5423d53ae0d116ee5bbe52f8b5503f0cd8586998" -PACKAGECONFIG_OPENCL:mx8mnul-nxp-bsp = "" -PACKAGECONFIG_OPENCL:mx8mpul-nxp-bsp = "" diff --git a/meta-digi-dey/recipes-core/images/dey-image-recovery-initramfs.bb b/meta-digi-dey/recipes-core/images/dey-image-recovery-initramfs.bb index 54a78c8d7..32d04995a 100644 --- a/meta-digi-dey/recipes-core/images/dey-image-recovery-initramfs.bb +++ b/meta-digi-dey/recipes-core/images/dey-image-recovery-initramfs.bb @@ -34,3 +34,9 @@ BAD_RECOMMENDATIONS += " \ " export IMAGE_BASENAME = "dey-image-recovery-initramfs" + +initramfs_cleanup() { + # Delete SWUPDATE postinst script + rm -f ${IMAGE_ROOTFS}${sysconfdir}/rpm-postinsts/*swupdate* +} +ROOTFS_POSTPROCESS_COMMAND += "initramfs_cleanup; " diff --git a/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb b/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb index 02d1bebc3..f556efb2e 100644 --- a/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb +++ b/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb @@ -36,7 +36,7 @@ RDEPENDS:${PN} = "\ connectcore-demo-example \ cloudconnector \ cryptodev-module \ - ${@oe.utils.vartrue('DUALBOOT_ENABLED', 'dualboot', 'recovery-utils', d)} \ + dualboot \ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'firmwared', '',d)} \ ${@bb.utils.contains("MACHINE_FEATURES", "keyboard", "${VIRTUAL-RUNTIME_keymaps}", "", d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', bb.utils.contains("MACHINE_FEATURES", "rtc", "${VIRTUAL-RUNTIME_base-utils-hwclock}", "", d), d)} \ @@ -52,6 +52,7 @@ RDEPENDS:${PN} = "\ networkmanager-nmcli \ os-release \ ${@bb.utils.contains('MACHINE_FEATURES', 'pci', 'pciutils', '',d)} \ + recovery-utils \ sysinfo \ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'system-monitor', '',d)} \ usbutils \ diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init index 210295be8..9c02e310c 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init @@ -506,7 +506,6 @@ mount -t tmpfs tmpfs /tmp echo > /dev/mdev.seq echo > /dev/mdev.log mdev -d -mdev -s # Give some time for the devices to settle down so mdev can mount all of them sleep 2 @@ -564,6 +563,9 @@ for arg in ${COMMAND}; do update_package=*) update_package_bool=true; eval "${arg}";; + swu_image_set=*) + update_image_set_bool=true; + eval "${arg}";; encrypt_partitions=*) eval "${arg}"; DEFAULT_ENC_PARTS="no"; @@ -596,9 +598,9 @@ done # Select update package image if [ "$(is_nand)" = "yes" ]; then - SWUPDATE_IMAGE_SET="mtd,platform" + SWUPDATE_IMAGE_SET="${swu_image_set:-mtd,single}" else - SWUPDATE_IMAGE_SET="mmc,platform" + SWUPDATE_IMAGE_SET="${swu_image_set:-mmc,single}" fi # On eMMC, if the 'update' partition is encrypted, we need to mount it manually diff --git a/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/include/recovery.h b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/include/recovery.h index e73a86951..768ce059c 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/include/recovery.h +++ b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/include/recovery.h @@ -30,6 +30,17 @@ */ int update_firmware(const char *swu_path); +/* + * Configure recovery commands to update the firmware of a swu image_set. + * + * Params: + * 'swu_path' (input) Path to the update package + * 'swu_image_set' (input) Name of the image set to update + * + * Return: 0 on sucess, -1 on failure + */ +int update_image_set_firmware(const char *swu_path, const char *swu_image_set); + /* * Reboot into recovery mode. * diff --git a/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/lib/recovery.c b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/lib/recovery.c index 69fb29667..5e9833e15 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/lib/recovery.c +++ b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/lib/recovery.c @@ -659,6 +659,41 @@ err: return ret ? -1 : 0; } +/* + * Function: update_image_set_firmware + * Description: configure recovery commands to update the firmware of a swu + * image set + */ +int update_image_set_firmware(const char *swu_path, const char *swu_image_set) +{ + char *cmd = NULL; + int ret = update_firmware(swu_path); + + if (ret) + return ret; + + /* Verify input parameter */ + if (!swu_image_set) { + fprintf(stderr, "Error: NULL 'swu_image_set'\n"); + goto err; + } + + cmd = calloc(1, strlen("swu_image_set=") + strlen(swu_image_set) + 1); + if (!cmd) { + fprintf(stderr, "Error: calloc 'swu_image_set'\n"); + goto err; + } + + sprintf(cmd, "swu_image_set=%s", swu_image_set); + + ret = append_recovery_command(cmd); + + free(cmd); + +err: + return ret ? -1 : 0; +} + /* * Function: reboot_recovery * Description: reboot into recovery mode diff --git a/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/recovery-reboot/Makefile b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/recovery-reboot/Makefile index b8b406071..f9251c34e 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/recovery-reboot/Makefile +++ b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/recovery-reboot/Makefile @@ -40,7 +40,7 @@ all: $(PROGRAM) install: $(PROGRAM) install -d $(DESTDIR)/usr/bin install -m 0755 $(PROGRAM) $(DESTDIR)/usr/bin/ - ln -sf $(PROGRAM) $(DESTDIR)/usr/bin/update-firmware + ln -sf $(PROGRAM) $(DESTDIR)/usr/bin/update-firmware.recovery ln -sf $(PROGRAM) $(DESTDIR)/usr/bin/encrypt-partitions .PHONY: clean diff --git a/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/recovery-reboot/recovery-reboot.c b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/recovery-reboot/recovery-reboot.c index 7e2a360d1..549aeb33f 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/recovery-reboot/recovery-reboot.c +++ b/meta-digi-dey/recipes-core/recovery/recovery-utils/recovery-utils/recovery-reboot/recovery-reboot.c @@ -42,6 +42,7 @@ "\n" \ "Usage: %s [options] []\n\n" \ " -u --update-firmware Perform firmware update\n" \ + " -i --image-set= Use the specified image-set from sw-description (only together with -u).\n" \ " -e --encrypt= Encrypt the list of provided partitions.\n" \ " -d --unencrypt= Un-encrypt the list of provided partitions.\n" \ " -k [] --encryption-key[=] Set as file system encryption key.\n" \ @@ -61,11 +62,12 @@ "Version: %s\n" \ "\n" \ "Usage: %s [options] \n\n" \ - " -k [] --encryption-key[=] Set as file system encryption key.\n" \ - " Empty to generate a random key.\n" \ - " -T --reboot-timeout= Reboot after N seconds (default %d)\n" \ - " -f --force Force (un)encryption and key change operations.\n" \ - " --help Print help and exit\n" \ + " -i --image-set= Use the specified image-set from sw-description.\n" \ + " -k [] --encryption-key[=] Set as file system encryption key.\n" \ + " Empty to generate a random key.\n" \ + " -T --reboot-timeout= Reboot after N seconds (default %d)\n" \ + " -f --force Force (un)encryption and key change operations.\n" \ + " --help Print help and exit\n" \ "\n" \ " Absolute path to the firmware update package\n" \ "\n" @@ -95,6 +97,7 @@ static char *cmd_name; /* Command line options */ static char *swu_package; +static char *swu_image_set = NULL; static char *key = NULL; static char *to_encrypt = NULL; static char *to_unencrypt = NULL; @@ -130,9 +133,10 @@ static void usage_and_exit(int exitval) static void parse_options(int argc, char *argv[]) { static int opt_index, opt; - static const char *short_options = "uk::wT:e:d:f"; + static const char *short_options = "ui:k::wT:e:d:f"; static const struct option long_options[] = { {"update-firmware", no_argument, NULL, 'u'}, + {"image_set", required_argument, NULL, 'i'}, {"encryption-key", optional_argument, NULL, 'k'}, {"wipe-update-partition", no_argument, NULL, 'w'}, {"reboot-timeout", required_argument, NULL, 'T'}, @@ -158,6 +162,9 @@ static void parse_options(int argc, char *argv[]) case 'u': update_fw = 1; break; + case 'i': + swu_image_set = optarg; + break; case 'w': wipe_update = 1; break; @@ -246,11 +253,18 @@ int main(int argc, char *argv[]) if (swu_package) { /* Configure recovery commands to update the firmware */ - ret = update_firmware(swu_package); - if (ret) { - printf("Error: update_firmware\n"); - goto out; + if (!swu_image_set) { + ret = update_firmware(swu_package); + if (ret) + printf("Error: update_firmware\n"); + } else { + ret = update_image_set_firmware(swu_package, + swu_image_set); + if (ret) + printf("Error: update_image_set_firmware\n"); } + if (ret) + goto out; need_reboot++; } diff --git a/meta-digi-dey/recipes-devtools/python3-xbee/python3-xbee_1.4.1.bb b/meta-digi-dey/recipes-devtools/python3-xbee/python3-xbee_1.4.1.bb index 3299ac92d..6baa3db83 100644 --- a/meta-digi-dey/recipes-devtools/python3-xbee/python3-xbee_1.4.1.bb +++ b/meta-digi-dey/recipes-devtools/python3-xbee/python3-xbee_1.4.1.bb @@ -14,4 +14,4 @@ PYPI_PACKAGE = "digi-xbee" inherit pypi setuptools3 -RDEPENDS:${PN} = "python3-pyserial" +RDEPENDS:${PN} = "python3-asyncio python3-pyserial" diff --git a/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb b/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb index 2cae1f0f6..e0b25e3ca 100644 --- a/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb +++ b/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb @@ -34,10 +34,6 @@ do_install() { install -m 0644 ${WORKDIR}/cloud-connector.service ${D}${systemd_unitdir}/system/ fi - if ${@oe.utils.vartrue('DUALBOOT_ENABLED', 'true', 'false', d)}; then - sed -i "/firmware_download_path = \/mnt\/update/c\firmware_download_path = \/home\/root" ${D}${sysconfdir}/cc.conf - fi - install -d ${D}${sysconfdir}/init.d/ install -m 755 ${WORKDIR}/cloud-connector-init ${D}${sysconfdir}/cloud-connector ln -sf /etc/cloud-connector ${D}${sysconfdir}/init.d/cloud-connector @@ -51,6 +47,13 @@ do_install:append:ccmp1() { sed -i "/client_cert_path = \"\/etc\/ssl\/certs\/drm_cert.pem\"/c\client_cert_path = \"\/mnt\/data\/drm_cert.pem\"" ${D}${sysconfdir}/cc.conf } +pkg_postinst_ontarget:${PN}() { + # If dualboot is enabled, change the CloudConnector download path on the first boot + if [ "$(fw_printenv -n dualboot 2>/dev/null)" = "yes" ]; then + sed -i "/firmware_download_path = \/mnt\/update/c\firmware_download_path = \/home\/root" /etc/cc.conf + fi +} + INITSCRIPT_NAME = "cloud-connector" SYSTEMD_SERVICE:${PN} = "cloud-connector.service" diff --git a/meta-digi-dey/recipes-digi/dey-examples/dey-examples-src.inc b/meta-digi-dey/recipes-digi/dey-examples/dey-examples-src.inc index 1117c0537..dab4aab41 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/dey-examples-src.inc +++ b/meta-digi-dey/recipes-digi/dey-examples/dey-examples-src.inc @@ -1,4 +1,4 @@ -# Copyright (C) 2019-2021 Digi International Inc. +# Copyright (C) 2019-2022 Digi International Inc. SRCBRANCH = "master" SRCREV = "${AUTOREV}" diff --git a/meta-digi-dey/recipes-digi/dualboot/dualboot/dualboot-init b/meta-digi-dey/recipes-digi/dualboot/dualboot/dualboot-init index d134b01e7..1e4337891 100644 --- a/meta-digi-dey/recipes-digi/dualboot/dualboot/dualboot-init +++ b/meta-digi-dey/recipes-digi/dualboot/dualboot/dualboot-init @@ -22,7 +22,7 @@ dualboot_init () { else BOOT_PART="$(fw_printenv -n mmcpart 2>/dev/null)" BOOT_DEV="$(fw_printenv -n mmcbootdev 2>/dev/null)" - CURRENT_PART="$(ls -l /dev/disk/by-partlabel/ | grep -i mmcblk${BOOT_DEV}p${BOOT_PART} | awk '{print $9}')" + CURRENT_PART="$(sed -ne 's,PARTNAME=,,g;T;p' /sys/class/block/mmcblk"${BOOT_DEV}"p"${BOOT_PART}"/uevent)" fw_setenv active_system "${CURRENT_PART}" fi fi @@ -40,9 +40,11 @@ dualboot_init () { case "$1" in start) - echo -n "Starting dualboot check: " - dualboot_init - echo "done." + if [ "$(fw_printenv -n dualboot 2>/dev/null)" = "yes" ]; then + echo -n "Starting dualboot check: " + dualboot_init + echo "done." + fi ;; stop) ;; diff --git a/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware b/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware index 0ca753613..f5019e468 100755 --- a/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware +++ b/meta-digi-dey/recipes-digi/dualboot/dualboot/update-firmware @@ -15,7 +15,12 @@ # #=============================================================================== -SCRIPTNAME="$(basename $(readlink -f ${0}))" + +if [ "$(fw_printenv -n dualboot 2>/dev/null)" != "yes" ]; then + exec update-firmware.recovery "$@" +fi + +SCRIPTNAME="$(basename "$(readlink -f "${0}")")" VERBOSE="" PUBLIC_KEY="/etc/ssl/certs/key.pub" ACTIVE_SYSTEM="$(fw_printenv -n active_system 2>/dev/null)" @@ -63,14 +68,9 @@ if [ -z "${UPDATE_FILE}" ]; then fi # Check if the rootfs is ubifs to determine if it is a nand or emmc device -PARTTABLE="/proc/mounts" -NANDROOTFS="$(sed -ne "s/\(rootfs\).*\.*/\1/g;T;p" ${PARTTABLE} 2>/dev/null)" +NANDROOTFS="$(sed -ne "s/\(rootfs\).*\.*/\1/g;T;p" /proc/mounts 2>/dev/null)" if [ -z "${NANDROOTFS}" ]; then - # Get Boot partition device and index. - BOOT_PART="$(fw_printenv -n mmcpart 2>/dev/null)" - BOOT_DEV="$(fw_printenv -n mmcbootdev 2>/dev/null)" - # Get current partition information so we can # determine where to flash the images. if [ "${ACTIVE_SYSTEM}" = "linux_a" ]; then @@ -85,12 +85,22 @@ if [ -z "${NANDROOTFS}" ]; then IMAGE_SET="mmc,primary" fi - # get boot partition index - MMC_PART="$(ls -l /dev/disk/by-partlabel/ | grep -i ${KERNELBOOT} | awk '{print $11}' | sed -e 's/[../mmcblkp]//g' -e 's/^.//')" + # get boot and rootfs partition index + MMC_PART="$(realpath /dev/disk/by-partlabel/${KERNELBOOT} | grep -o '[[:digit:]]\+$')" # search rootfs UUID - MMCROOT_PART="$(ls -l /dev/disk/by-partlabel/ | grep -i ${ROOTFS} | awk '{print $11}' | sed -e 's/[../mmcblkp]//g' -e 's/^.//')" - PART_UUID="$(ls -l /dev/disk/by-partuuid/ | grep -i mmcblk${BOOT_DEV}p${MMCROOT_PART} | awk '{print $9}')" + MMCROOT_DEV="$(realpath /dev/disk/by-partlabel/${ROOTFS})" + for uuid in /dev/disk/by-partuuid/*; do + if [ "$(realpath "${uuid}")" = "${MMCROOT_DEV}" ]; then + PART_UUID="$(basename "${uuid}")" + break + fi + done + + if [ -z "${MMC_PART}" ] || [ -z "${PART_UUID}" ]; then + echo "[ERROR] detecting partitions to update." + exit + fi echo "" echo "Updating '${IMAGE_SET}' image set from '${UPDATE_FILE}'..." @@ -99,8 +109,8 @@ if [ -z "${NANDROOTFS}" ]; then # Execute the update. swupdate ${VERBOSE} -i "${UPDATE_FILE}" -e "${IMAGE_SET}" if [ "$?" = "0" ]; then - fw_setenv mmcroot PARTUUID=${PART_UUID} - fw_setenv mmcpart ${MMC_PART} + fw_setenv mmcroot "PARTUUID=${PART_UUID}" + fw_setenv mmcpart "${MMC_PART}" fw_setenv active_system ${KERNELBOOT} fw_setenv bootcount 0 echo "Firmware update finished; Rebooting system." @@ -127,9 +137,6 @@ else echo "Updating '${IMAGE_SET}' image set from '${UPDATE_FILE}'..." echo "" - # Umount the partition before the update. - umount /mnt/${KERNELBOOT} - # Execute the update. if [ -f "${PUBLIC_KEY}" ]; then swupdate ${VERBOSE} -i "${UPDATE_FILE}" -e "${IMAGE_SET}" -k "${PUBLIC_KEY}" diff --git a/meta-digi-dey/recipes-digi/swu-images/files/sw-description b/meta-digi-dey/recipes-digi/swu-images/files/sw-description index d2ee699f1..ddd469d42 100644 --- a/meta-digi-dey/recipes-digi/swu-images/files/sw-description +++ b/meta-digi-dey/recipes-digi/swu-images/files/sw-description @@ -4,7 +4,57 @@ software = description = "##DESCRIPTION##"; mmc = { - platform: { + primary: { + images: ( + { + filename = "##BOOTIMG_NAME##"; + device = "##BOOT_DEV_A##"; + type = "raw"; + sha256 = "$swupdate_get_sha256(##BOOTIMG_NAME##)"; + installed-directly = true; + }, + { + filename = "##ROOTIMG_NAME##"; + device = "##ROOTFS_DEV_A##"; + type = "raw"; + sha256 = "$swupdate_get_sha256(##ROOTIMG_NAME##)"; + compressed = "zlib"; + installed-directly = true; + } + ); + uboot: ( + { + name = "upgrade_available"; + value = "1"; + } + ); + } + secondary: { + images: ( + { + filename = "##BOOTIMG_NAME##"; + device = "##BOOT_DEV_B##"; + type = "raw"; + sha256 = "$swupdate_get_sha256(##BOOTIMG_NAME##)"; + installed-directly = true; + }, + { + filename = "##ROOTIMG_NAME##"; + device = "##ROOTFS_DEV_B##"; + type = "raw"; + sha256 = "$swupdate_get_sha256(##ROOTIMG_NAME##)"; + compressed = "zlib"; + installed-directly = true; + } + ); + uboot: ( + { + name = "upgrade_available"; + value = "1"; + } + ); + } + single: { images: ( { filename = "##BOOTIMG_NAME##"; @@ -22,10 +72,61 @@ software = installed-directly = true; } ); - }; - }; + } + platform = { + ref = "#./single"; + } + } mtd = { - platform: { + primary: { + images: ( + { + filename = "##BOOTIMG_NAME##"; + volume = "##BOOT_DEV_A##"; + type = "ubivol"; + sha256 = "$swupdate_get_sha256(##BOOTIMG_NAME##)"; + installed-directly = true; + }, + { + filename = "##ROOTIMG_NAME##"; + volume = "##ROOTFS_DEV_A##"; + type = "ubivol"; + sha256 = "$swupdate_get_sha256(##ROOTIMG_NAME##)"; + installed-directly = true; + } + ); + uboot: ( + { + name = "upgrade_available"; + value = "1"; + } + ); + } + secondary: { + images: ( + { + filename = "##BOOTIMG_NAME##"; + volume = "##BOOT_DEV_B##"; + type = "ubivol"; + sha256 = "$swupdate_get_sha256(##BOOTIMG_NAME##)"; + installed-directly = true; + }, + { + filename = "##ROOTIMG_NAME##"; + volume = "##ROOTFS_DEV_B##"; + type = "ubivol"; + sha256 = "$swupdate_get_sha256(##ROOTIMG_NAME##)"; + installed-directly = true; + } + ); + uboot: ( + { + name = "upgrade_available"; + value = "1"; + } + ); + } + single: { images: ( { filename = "##BOOTIMG_NAME##"; @@ -42,6 +143,9 @@ software = installed-directly = true; } ); - }; + } + platform = { + ref = "#./single"; + } }; } diff --git a/meta-digi-dey/recipes-digi/swu-images/files/sw-description-dualboot b/meta-digi-dey/recipes-digi/swu-images/files/sw-description-dualboot deleted file mode 100644 index 52a93b25c..000000000 --- a/meta-digi-dey/recipes-digi/swu-images/files/sw-description-dualboot +++ /dev/null @@ -1,107 +0,0 @@ -software = -{ - version = "##SW_VERSION##"; - - mmc = { - primary: { - images: ( - { - filename = "##BOOTIMG_NAME##"; - device = "##BOOT_DEV_A##"; - type = "raw"; - sha256 = "$swupdate_get_sha256(##BOOTIMG_NAME##)"; - installed-directly = true; - }, - { - filename = "##ROOTIMG_NAME##"; - device = "##ROOTFS_DEV_A##"; - type = "raw"; - sha256 = "$swupdate_get_sha256(##ROOTIMG_NAME##)"; - compressed = "zlib"; - installed-directly = true; - } - ); - uboot: ( - { - name = "upgrade_available"; - value = "1"; - } - ); - } - secondary: { - images: ( - { - filename = "##BOOTIMG_NAME##"; - device = "##BOOT_DEV_B##"; - type = "raw"; - sha256 = "$swupdate_get_sha256(##BOOTIMG_NAME##)"; - installed-directly = true; - }, - { - filename = "##ROOTIMG_NAME##"; - device = "##ROOTFS_DEV_B##"; - type = "raw"; - sha256 = "$swupdate_get_sha256(##ROOTIMG_NAME##)"; - compressed = "zlib"; - installed-directly = true; - } - ); - uboot: ( - { - name = "upgrade_available"; - value = "1"; - } - ); - } - }; - mtd = { - primary: { - images: ( - { - filename = "##BOOTIMG_NAME##"; - volume = "##BOOT_DEV_A##"; - type = "ubivol"; - sha256 = "$swupdate_get_sha256(##BOOTIMG_NAME##)"; - installed-directly = true; - }, - { - filename = "##ROOTIMG_NAME##"; - volume = "##ROOTFS_DEV_A##"; - type = "ubivol"; - sha256 = "$swupdate_get_sha256(##ROOTIMG_NAME##)"; - installed-directly = true; - } - ); - uboot: ( - { - name = "upgrade_available"; - value = "1"; - } - ); - } - secondary: { - images: ( - { - filename = "##BOOTIMG_NAME##"; - volume = "##BOOT_DEV_B##"; - type = "ubivol"; - sha256 = "$swupdate_get_sha256(##BOOTIMG_NAME##)"; - installed-directly = true; - }, - { - filename = "##ROOTIMG_NAME##"; - volume = "##ROOTFS_DEV_B##"; - type = "ubivol"; - sha256 = "$swupdate_get_sha256(##ROOTIMG_NAME##)"; - installed-directly = true; - } - ); - uboot: ( - { - name = "upgrade_available"; - value = "1"; - } - ); - } - }; -} diff --git a/meta-digi-dey/recipes-digi/swu-images/swu.inc b/meta-digi-dey/recipes-digi/swu-images/swu.inc index 6d9282c8b..c9aa55d89 100644 --- a/meta-digi-dey/recipes-digi/swu-images/swu.inc +++ b/meta-digi-dey/recipes-digi/swu-images/swu.inc @@ -10,7 +10,6 @@ SRC_URI = " \ file://sw-description-uboot \ file://swupdate_uboot_nand.sh \ file://swupdate_uboot_mmc.sh \ - ${@oe.utils.vartrue('DUALBOOT_ENABLED', 'file://sw-description-dualboot', '', d)} \ " inherit swupdate @@ -52,8 +51,6 @@ def get_baseimg_pn(d): file_name = d.getVar('PN', True) return file_name[:file_name.find("-swu")] -# Call regular substitution or dualboot substitution -do_unpack[postfuncs] += "${@oe.utils.vartrue('DUALBOOT_ENABLED', 'fill_description_dualboot', 'fill_description', d)}" # Dual boot partition names for eMMC or MTD BOOT_DEV_NAME_A ?= "${@bb.utils.contains('STORAGE_MEDIA', 'mmc', '/dev/mmcblk0p1', 'linux_a', d)}" @@ -61,6 +58,8 @@ BOOT_DEV_NAME_B ?= "${@bb.utils.contains('STORAGE_MEDIA', 'mmc', '/dev/mmcblk0p2 ROOTFS_DEV_NAME_A ?= "${@bb.utils.contains('STORAGE_MEDIA', 'mmc', '/dev/mmcblk0p3', 'rootfs_a', d)}" ROOTFS_DEV_NAME_B ?= "${@bb.utils.contains('STORAGE_MEDIA', 'mmc', '/dev/mmcblk0p4', 'rootfs_b', d)}" +do_unpack[postfuncs] += "fill_description" + fill_description() { if [ "${SWUPDATE_UBOOTIMG}" = "true" ]; then cp ${WORKDIR}/sw-description-uboot ${WORKDIR}/sw-description @@ -79,16 +78,10 @@ fill_description() { sed -i -e "s,##ROOTFS_DEV##,${ROOTFS_DEV_NAME_FINAL},g" "${WORKDIR}/sw-description" sed -i -e "s,##SW_VERSION##,${SOFTWARE_VERSION},g" "${WORKDIR}/sw-description" sed -i -e "s,##DESCRIPTION##,${DESCRIPTION},g" "${WORKDIR}/sw-description" -} -fill_description_dualboot () { - sed -i -e "s,##BOOTIMG_NAME##,${IMG_NAME}-${MACHINE}${BOOTFS_EXT},g" "${WORKDIR}/sw-description-dualboot" - sed -i -e "s,##BOOT_DEV_A##,${BOOT_DEV_NAME_A},g" "${WORKDIR}/sw-description-dualboot" - sed -i -e "s,##BOOT_DEV_B##,${BOOT_DEV_NAME_B},g" "${WORKDIR}/sw-description-dualboot" - sed -i -e "s,##ROOTIMG_NAME##,${IMG_NAME}-${MACHINE}${ROOTFS_EXT},g" "${WORKDIR}/sw-description-dualboot" - sed -i -e "s,##ROOTFS_DEV_A##,${ROOTFS_DEV_NAME_A},g" "${WORKDIR}/sw-description-dualboot" - sed -i -e "s,##ROOTFS_DEV_B##,${ROOTFS_DEV_NAME_B},g" "${WORKDIR}/sw-description-dualboot" - sed -i -e "s,##SW_VERSION##,${SOFTWARE_VERSION},g" "${WORKDIR}/sw-description-dualboot" - # Overwrite the sw-description with the dualboot version - mv ${WORKDIR}/sw-description-dualboot ${WORKDIR}/sw-description -} \ No newline at end of file + # Dualboot description + sed -i -e "s,##BOOT_DEV_A##,${BOOT_DEV_NAME_A},g" "${WORKDIR}/sw-description" + sed -i -e "s,##BOOT_DEV_B##,${BOOT_DEV_NAME_B},g" "${WORKDIR}/sw-description" + sed -i -e "s,##ROOTFS_DEV_A##,${ROOTFS_DEV_NAME_A},g" "${WORKDIR}/sw-description" + sed -i -e "s,##ROOTFS_DEV_B##,${ROOTFS_DEV_NAME_B},g" "${WORKDIR}/sw-description" +} diff --git a/meta-digi-dey/recipes-support/swupdate/swupdate_2022.05.bbappend b/meta-digi-dey/recipes-support/swupdate/swupdate_2022.05.bbappend index 0635fb6f9..6c38638a2 100644 --- a/meta-digi-dey/recipes-support/swupdate/swupdate_2022.05.bbappend +++ b/meta-digi-dey/recipes-support/swupdate/swupdate_2022.05.bbappend @@ -28,3 +28,9 @@ do_install:append() { install -d ${D}${bindir}/ install -m 0755 tools/swupdate-progress ${D}${bindir}/progress } + +pkg_postinst_ontarget:${PN}() { + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','false','true',d)}; then + [ "$(fw_printenv -n dualboot 2>/dev/null)" = "no" ] && update-rc.d -f swupdate remove + fi +}