Skip to content
Snippets Groups Projects
Commit fe129eee authored by Jonas Höppner's avatar Jonas Höppner
Browse files

fng-install: mv to machine, rename recipe to yocto-install

Add recipe to build the install scripts and the post installation steps
from the new repository.
Set MACHINE_INSTALL_SCRIPTS variable to include the install scripts
independently from the distro.
parent fd726bb4
No related branches found
No related tags found
1 merge request!422fng-install: mv to machine, rename recipe to yocto-install
Pipeline #73640 passed with stage
in 7 seconds
...@@ -23,3 +23,4 @@ PREFERRED_VERSION_gstreamer1.0 = "1.18.5.imx" ...@@ -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-base = "1.18.5.imx"
PREFERRED_VERSION_gstreamer1.0-plugins-good = "1.18.5.imx" PREFERRED_VERSION_gstreamer1.0-plugins-good = "1.18.5.imx"
PREFERRED_VERSION_gstreamer1.0-plugins-bad = "1.18.5.imx" PREFERRED_VERSION_gstreamer1.0-plugins-bad = "1.18.5.imx"
...@@ -80,3 +80,5 @@ IMAGE_BOOT_FILES:append = " \ ...@@ -80,3 +80,5 @@ IMAGE_BOOT_FILES:append = " \
IMAGE_BOOT_FILES:remove = " \ IMAGE_BOOT_FILES:remove = " \
combine_kernel \ combine_kernel \
" "
MACHINE_INSTALL_SCRIPTS:append = " fng-install-uboot.sh "
...@@ -24,6 +24,7 @@ MACHINE_ESSENTIAL_EXTRA_RDEPENDS:append = " \ ...@@ -24,6 +24,7 @@ MACHINE_ESSENTIAL_EXTRA_RDEPENDS:append = " \
kernel-devicetree \ kernel-devicetree \
kernel-image \ kernel-image \
seco-sharedconf \ seco-sharedconf \
${MACHINE_INSTALL_SCRIPTS} \
" "
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS:append = " \ MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS:append = " \
...@@ -48,6 +49,9 @@ MACHINE_FEATURES = " \ ...@@ -48,6 +49,9 @@ MACHINE_FEATURES = " \
vfat \ vfat \
" "
MACHINE_INSTALL_SCRIPTS = "fng-install.sh"
MACHINE_INSTALL_SCRIPTS:fng = "fngsystem-self-update.sh fngsystem-self-init.sh"
IMAGE_BOOT_FILES:append = " \ IMAGE_BOOT_FILES:append = " \
${@' '.join([ dtb.split('/')[-1] for dtb in d.getVar('KERNEL_DEVICETREE').split() ] )} \ ${@' '.join([ dtb.split('/')[-1] for dtb in d.getVar('KERNEL_DEVICETREE').split() ] )} \
combine_kernel \ combine_kernel \
......
...@@ -48,3 +48,5 @@ RAM_START_ADDRESS = "0x10000000" ...@@ -48,3 +48,5 @@ RAM_START_ADDRESS = "0x10000000"
# SECO North specific offset, that has historic reasons but # SECO North specific offset, that has historic reasons but
# doesn't make sense # doesn't make sense
KERNEL_EXTRA_ARGS += "LOADADDR=0x10010000" KERNEL_EXTRA_ARGS += "LOADADDR=0x10010000"
MACHINE_INSTALL_SCRIPTS:append = " fng-install-mx6-boot.sh "
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 \
"
...@@ -4,6 +4,8 @@ HOMEPAGE = "https://www.seco.com" ...@@ -4,6 +4,8 @@ HOMEPAGE = "https://www.seco.com"
LICENSE = "GPL-2.0-or-later" LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" 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 recipes-bsp/fng-boot/fngboot-common.inc
require mx6-boot.inc require mx6-boot.inc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment