diff --git a/conf/machine/include/seco-mx6.inc b/conf/machine/include/seco-mx6.inc index cf6c67520afcc9c5987f27446d2a3a917be29d34..637a5e695df682562a0dce9334fbd675081adcd3 100644 --- a/conf/machine/include/seco-mx6.inc +++ b/conf/machine/include/seco-mx6.inc @@ -23,3 +23,4 @@ PREFERRED_VERSION_gstreamer1.0 = "1.18.5.imx" PREFERRED_VERSION_gstreamer1.0-plugins-base = "1.18.5.imx" PREFERRED_VERSION_gstreamer1.0-plugins-good = "1.18.5.imx" PREFERRED_VERSION_gstreamer1.0-plugins-bad = "1.18.5.imx" + diff --git a/conf/machine/include/seco-mx8.inc b/conf/machine/include/seco-mx8.inc index 7c7f723124b70f2034f0bfee64663c1d53c92bf4..8c0d80f091f95217b58cc8d6d15ba947778865f9 100644 --- a/conf/machine/include/seco-mx8.inc +++ b/conf/machine/include/seco-mx8.inc @@ -80,3 +80,5 @@ IMAGE_BOOT_FILES:append = " \ IMAGE_BOOT_FILES:remove = " \ combine_kernel \ " + +MACHINE_INSTALL_SCRIPTS:append = " fng-install-uboot.sh " diff --git a/conf/machine/include/seconorth-machine.inc b/conf/machine/include/seconorth-machine.inc index 5ae10e6d8ab0adef3ea52e82b5adeee874bfca46..55e148bf04f4b86ebf18091d1c520cdac0649d90 100644 --- a/conf/machine/include/seconorth-machine.inc +++ b/conf/machine/include/seconorth-machine.inc @@ -24,6 +24,7 @@ MACHINE_ESSENTIAL_EXTRA_RDEPENDS:append = " \ kernel-devicetree \ kernel-image \ seco-sharedconf \ + ${MACHINE_INSTALL_SCRIPTS} \ " MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS:append = " \ @@ -48,6 +49,9 @@ MACHINE_FEATURES = " \ vfat \ " +MACHINE_INSTALL_SCRIPTS = "fng-install.sh" +MACHINE_INSTALL_SCRIPTS:fng = "fngsystem-self-update.sh fngsystem-self-init.sh" + IMAGE_BOOT_FILES:append = " \ ${@' '.join([ dtb.split('/')[-1] for dtb in d.getVar('KERNEL_DEVICETREE').split() ] )} \ combine_kernel \ diff --git a/conf/machine/seco-mx6.conf b/conf/machine/seco-mx6.conf index 52edaa87ee2b2173afd449d8279dec1d2063f8fb..fbf85a83c6b37f1bab9eb23b9851d54f6a6e4e17 100644 --- a/conf/machine/seco-mx6.conf +++ b/conf/machine/seco-mx6.conf @@ -48,3 +48,5 @@ RAM_START_ADDRESS = "0x10000000" # SECO North specific offset, that has historic reasons but # doesn't make sense KERNEL_EXTRA_ARGS += "LOADADDR=0x10010000" + +MACHINE_INSTALL_SCRIPTS:append = " fng-install-mx6-boot.sh " diff --git a/recipes-bsp/installation/yocto-install.bb b/recipes-bsp/installation/yocto-install.bb new file mode 100644 index 0000000000000000000000000000000000000000..60ed9ef6b75fc100b4d39ac997ca18091202ae02 --- /dev/null +++ b/recipes-bsp/installation/yocto-install.bb @@ -0,0 +1,138 @@ +SUMMARY = "SECO Northern Europe install and postinstallation scripts" +HOMEPAGE = "https://www.seco.com" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +inherit autotools +inherit deploy +# Create a <tag>-<number of commits since tag>-<hash> Version string +inherit gitpkgv +PKGV = "${GITPKGVTAG}" + +RDEPENDS:${PN} = " \ + kernel-image \ + kernel-devicetree \ +" + +SRCREV = "${AUTOREV}" +SRC_URI = " \ + git://git.seco.com/seco-ne/tools/yocto-install.git;protocol=https;branch=main;nobranch=1 \ +" +S="${WORKDIR}/git" + +#================================================================= +# Use the current MACHINE and DEFAULT_ROOTFS in the configure step +export MACHINE +export DEFAULT_ROOTFS = "seconorth-image-${MACHINE}.tar.gz" +#================================================================= + +# TODO should also go to the Makefile I guess +do_compile:append:fng() { + # Exchange the bootpartitions for Flash-N-Go System + sed -i ${S}/prepare-image/prepare-kernel.sh -e 's|^BOOTPARTITIONS=".*|BOOTPARTITIONS="/dev/disk/by-label/Flash-N-Go /dev/mmcblk0p1 /dev/mmcblk1p1"|' +} + +# Sort out some unneeded files. The yocto-install package contains +# all install scripts but we do not need all of them in one config + +# TODO this is a bit ugly, may be we should change the scripts +# to use them in all machines or leave this to the Makefile +# of the package +DELETE_FILES = " prepare-rtc.sh prepare-dt.sh prepare-xml2dto.sh " +DELETE_FILES:remove:mx6 = " prepare-dt.sh prepare-xml2dto.sh " +DELETE_FILES:remove:mx8mm = " prepare-rtc.sh " + +do_install:append() { + + echo ${MACHINE_INSTALL_SCRIPTS} + cd ${D}${datadir}/${PN}/ + + for script in *.sh; + do + # Check if script is in MACHINE_INSTALL_SCRIPTS + # Delete it otherwise + keep="false" + for needed_script in ${MACHINE_INSTALL_SCRIPTS}; + do + if [ "$script" = "$needed_script" ];then + keep="true" + break + fi + done + + if $keep;then + echo "Install script: $script" + else + echo "Delete $script" + rm "$script" + fi + done + + for file in ${DELETE_FILES}; + do + for found in $(find ${D} -name "*${file%.sh}*") + do + echo "Deleting $found" + rm $found + done + done +} + +do_deploy() { + for i in ${D}/${datadir}/${PN}/*.sh; + do + install -m 0755 $i ${DEPLOYDIR} + done +} +addtask do_deploy after do_install + +PACKAGES_MACHINE = "" +# use mx6q override as Nallino is currently not supported +PACKAGES_MACHINE:mx6q += " \ + ${PN}-mx6-boot \ + " + +PACKAGES_MACHINE:mx8m += " \ + ${PN}-u-boot \ + " + +PACKAGES += " \ + ${PN}-fngsystem \ + ${PN}-ontarget \ + ${PACKAGES_MACHINE} \ + " + +FILES:${PN} = "${datadir}/${PN}/fng-install.sh" +FILES:${PN}-fngsystem = "${datadir}/${PN}/fngsystem*.sh" +FILES:${PN}-u-boot = "${datadir}/${PN}/fng-install-uboot.sh" +FILES:${PN}-mx6-boot = "${datadir}/${PN}/fng-install-mx6-boot.sh" +FILES:${PN}-ontarget = "${sysconfdir}/** ${libexecdir}/** ${sbindir}/**" + +RPROVIDES:${PN} += " fng-install.sh " + +RPROVIDES:${PN}-fngsystem += " fngsystem-self-update.sh fngsystem-self-init.sh " +RPROVIDES:${PN}-mx6-boot:mx6q += " fng-install-mx6-boot.sh " +RPROVIDES:${PN}-u-boot:mx8m += " fng-install-uboot.sh " + +RDEPENDS:${PN} = "${PN}-ontarget kernel-image kernel-devicetree" +RDEPENDS:${PN}-fngsystem = "${PN}-ontarget" +RDEPENDS:${PN}-u-boot:mx8m = "${PN}-ontarget imx-boot" +RDEPENDS:${PN}-mx6-boot:mx6q = "${PN}-ontarget mx6-boot" + +DEPLOY_DEPENDS = "" +DEPLOY_DEPENDS:mx6q = "mx6-boot:do_deploy" +DEPLOY_DEPENDS:mx8m = "imx-boot:do_deploy" +do_deploy[depends] += " ${DEPLOY_DEPENDS} " + +# i2c-tools is for rtc detection +# phytool for ethernet phy detection +# libgpiod-tools for ethernet phy detection +# sharedconf for common functions +RDEPENDS:${PN}-ontarget = " \ + i2c-tools \ + libgpiod-tools \ + phytool \ + seco-sharedconf \ + seco-sharedconf-network \ +" diff --git a/recipes-bsp/mx6-boot/mx6-boot.bb b/recipes-bsp/mx6-boot/mx6-boot.bb index ed2584e4b55b1e8563196957a216f45534015536..5148a5da18f659afeb134f0c6f5e953ed83f2979 100644 --- a/recipes-bsp/mx6-boot/mx6-boot.bb +++ b/recipes-bsp/mx6-boot/mx6-boot.bb @@ -4,6 +4,8 @@ HOMEPAGE = "https://www.seco.com" LICENSE = "GPL-2.0-or-later" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" +COMPATIBLE_MACHINE = "(seco-mx6|seco-mx6-fsl)" + require recipes-bsp/fng-boot/fngboot-common.inc require mx6-boot.inc