Merge tag 'dey-4.0-r1.2' into dey-4.0/master

Digi Embedded Yocto 4.0-r1.2

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
Javier Viguera 2022-11-30 15:00:36 +01:00
commit 83a3aa22e4
37 changed files with 408 additions and 593 deletions

View File

@ -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)

View File

@ -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 \

View File

@ -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 \

View File

@ -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
# =========================================================================

View File

@ -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
# =========================================================================

View File

@ -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 ?= ""

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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-<platform>.<ext>-<type>
@ -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"

View File

@ -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"

View File

@ -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

View File

@ -126,12 +126,18 @@ 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
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
echo "Invalid DEK size: ${dek_size} bits. Valid sizes are 128, 192 and 256 bits"

View File

@ -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)"

View File

@ -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"

View File

@ -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)"

View File

@ -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"

View File

@ -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)"

View File

@ -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)"

View File

@ -1,3 +0,0 @@
SRCREV_opencv = "5423d53ae0d116ee5bbe52f8b5503f0cd8586998"
PACKAGECONFIG_OPENCL:mx8mnul-nxp-bsp = ""
PACKAGECONFIG_OPENCL:mx8mpul-nxp-bsp = ""

View File

@ -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; "

View File

@ -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 \

View File

@ -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

View File

@ -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.
*

View File

@ -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

View File

@ -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

View File

@ -42,6 +42,7 @@
"\n" \
"Usage: %s [options] [<SWU-package-path>]\n\n" \
" -u --update-firmware Perform firmware update\n" \
" -i <image> --image-set=<image> Use the specified image-set from sw-description (only together with -u).\n" \
" -e <partitions> --encrypt=<partitions> Encrypt the list of provided partitions.\n" \
" -d <partitions> --unencrypt=<partitions> Un-encrypt the list of provided partitions.\n" \
" -k [<key>] --encryption-key[=<key>] Set <key> as file system encryption key.\n" \
@ -61,6 +62,7 @@
"Version: %s\n" \
"\n" \
"Usage: %s [options] <SWU-package-path>\n\n" \
" -i <image> --image-set=<image> Use the specified image-set from sw-description.\n" \
" -k [<key>] --encryption-key[=<key>] Set <key> as file system encryption key.\n" \
" Empty to generate a random key.\n" \
" -T <N> --reboot-timeout=<N> Reboot after N seconds (default %d)\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 */
if (!swu_image_set) {
ret = update_firmware(swu_package);
if (ret) {
if (ret)
printf("Error: update_firmware\n");
goto out;
} 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++;
}

View File

@ -14,4 +14,4 @@ PYPI_PACKAGE = "digi-xbee"
inherit pypi setuptools3
RDEPENDS:${PN} = "python3-pyserial"
RDEPENDS:${PN} = "python3-asyncio python3-pyserial"

View File

@ -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"

View File

@ -1,4 +1,4 @@
# Copyright (C) 2019-2021 Digi International Inc.
# Copyright (C) 2019-2022 Digi International Inc.
SRCBRANCH = "master"
SRCREV = "${AUTOREV}"

View File

@ -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)
if [ "$(fw_printenv -n dualboot 2>/dev/null)" = "yes" ]; then
echo -n "Starting dualboot check: "
dualboot_init
echo "done."
fi
;;
stop)
;;

View File

@ -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\).*\<ubifs\>.*/\1/g;T;p" ${PARTTABLE} 2>/dev/null)"
NANDROOTFS="$(sed -ne "s/\(rootfs\).*\<ubifs\>.*/\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}"

View File

@ -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";
}
};
}

View File

@ -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";
}
);
}
};
}

View File

@ -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
# 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"
}

View File

@ -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
}