1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-05-07 04:58:57 +00:00

arm-bsp/n1sdp-board-firmware: rewrite recipe

Any recipe that needs to use RM_WORK_EXCLUDE is either being very clever
or is breaking expectations.  This recipe is doing several things in
non-idiomatic ways that breaks other tools, for example the source
doesn't exist in do_unpack.

Rename from board-firmware-n1sdp to n1sdp-board-firmware to match the
repository name.

As this recipe simply ships some precompiled binary, set
INHIBIT_DEFAULT_DEPS to avoid depending on the toolchain to reduce how
often it needs to be rebuilt.

Unpack normally and promptly delete the large SOFTWARE/ directory that
we don't care about, instead of unpacking in do_install.

Ensure deploy is scheduled appropriately.

Remove LICENSE_FLAGS, this is for licenses which need to be opted-in.
Setting LICENSE_FLAGS and then enabling it by default makes no sense.

Change-Id: I1fe906634977d323086de6f6c67a9c45aeb7585e
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
Ross Burton
2020-11-09 09:35:27 +00:00
committed by Jon Mason
parent fc36f9d163
commit 598e1cc32c
4 changed files with 35 additions and 56 deletions
-2
View File
@@ -39,6 +39,4 @@ EFI_PROVIDER ?= "grub-efi"
MACHINE_FEATURES += "efi"
# SD-Card firmware
# Board firmware prebuilts are shared under custom license
LICENSE_FLAGS_WHITELIST += "stm-sla0044"
EXTRA_IMAGEDEPENDS += "sdcard-image-n1sdp"
@@ -1,53 +0,0 @@
DESCRIPTION = "Board Firmware binaries for N1SDP"
# Board-firmware-n1sdp custom license is whitelisted in n1sdp.conf file.
# Uncomment, or copy this line to your local.conf to build board firmware,
# if you are using custom n1sdp.conf file.
# Please make sure to check the applicable license beforehand!
#LICENSE_FLAGS_WHITELIST = "stm-sla0044"
LICENSE = "STM-SLA0044-Rev5"
LICENSE_FLAGS = "stm-sla0044"
LIC_FILES_CHKSUM = "file://${S}/LICENSES/STM.TXT;md5=4b8dab81d0bfc0a5f63c9a983402705b"
SECTION = "firmware"
inherit deploy
PACKAGE_ARCH = "${MACHINE_ARCH}"
COMPATIBLE_MACHINE = "n1sdp"
RM_WORK_EXCLUDE += "${PN}"
PV = "2020.07.27"
TAG = "N1SDP-${PV}"
FIRMWARE_TARBALL = "n1sdp-board-firmware-${TAG}"
UNPACK_DIR = "n1sdp-board-firmware_source"
S = "${WORKDIR}/${UNPACK_DIR}"
SRC_URI = "https://git.linaro.org/landing-teams/working/arm/n1sdp-board-firmware.git/snapshot/${FIRMWARE_TARBALL}.tar.gz;unpack=0"
SRC_URI[md5sum] = "8ba3807ff8f222201154861f11524b14"
SRC_URI[sha256sum] = "57feba404026f2d6d49c167d63e0e84653ad8b808b13e2244b81fea9e0d58d66"
do_configure[noexec] = "1"
do_compile[noexec] = "1"
do_install() {
cd ${WORKDIR}
tar -xvaf ${WORKDIR}/${FIRMWARE_TARBALL}.tar.gz --exclude=${FIRMWARE_TARBALL}/SOFTWARE/*
mv -v ${WORKDIR}/${FIRMWARE_TARBALL}/* ${S}
cp -R --no-dereference --preserve=mode,links -v ${S} ${D}
}
do_install[dirs] += "${S}"
do_install[cleandirs] += "${S}"
FILES_${PN} = "/${UNPACK_DIR}/*"
SYSROOT_DIRS += "/${UNPACK_DIR}"
addtask install after do_unpack before do_populate_lic
do_deploy() {
cp -av ${S} ${DEPLOYDIR}
}
addtask deploy after do_install
@@ -0,0 +1,34 @@
SUMMARY = "Board Firmware binaries for N1SDP"
SECTION = "firmware"
LICENSE = "STM-SLA0044-Rev5"
LIC_FILES_CHKSUM = "file://LICENSES/STM.TXT;md5=4b8dab81d0bfc0a5f63c9a983402705b"
inherit deploy
INHIBIT_DEFAULT_DEPS = "1"
PACKAGE_ARCH = "${MACHINE_ARCH}"
COMPATIBLE_MACHINE = "n1sdp"
SRC_URI = "https://git.linaro.org/landing-teams/working/arm/n1sdp-board-firmware.git/snapshot/${BPN}-N1SDP-${PV}.tar.gz"
SRC_URI[sha256sum] = "57feba404026f2d6d49c167d63e0e84653ad8b808b13e2244b81fea9e0d58d66"
S = "${WORKDIR}/${BPN}-N1SDP-${PV}"
INSTALL_DIR = "/n1sdp-board-firmware_source"
do_install() {
rm -rf ${S}/SOFTWARE
install -d ${D}${INSTALL_DIR}
cp -Rp --no-preserve=ownership ${S}/* ${D}${INSTALL_DIR}
}
FILES_${PN} = "${INSTALL_DIR}"
SYSROOT_DIRS += "${INSTALL_DIR}"
do_deploy() {
install -d ${DEPLOYDIR}${INSTALL_DIR}
cp -Rp --no-preserve=ownership ${S}/* ${DEPLOYDIR}${INSTALL_DIR}
}
addtask deploy after do_install before do_build
@@ -4,7 +4,7 @@ inherit deploy nopackages
DEPENDS = "virtual/uefi-firmware \
virtual/control-processor-firmware \
board-firmware-n1sdp"
n1sdp-board-firmware"
LICENSE = "MIT"
PACKAGE_ARCH = "${MACHINE_ARCH}"