1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-21 07:15:49 +00:00

Reapply "pkgbase: Create a FreeBSD-dtb package"

This reverts commit 9bbe06b004.

Before that dtbs where included in each kernel packages which prevents
us to install multiple kernels.

Fix mtree-to-plist.awk to only generate a dtb.plist when we create
the kernel one (because dtb are installed during make installkernel).

Sponsored by:   Beckhoff Automation GmbH & Co. KG
This commit is contained in:
Emmanuel Vadot 2024-02-02 19:25:55 +01:00
parent 70f5c6e34f
commit b6e9a7a2e2
3 changed files with 57 additions and 7 deletions

View File

@ -2178,9 +2178,35 @@ _default_flavor= -default
. if ${MK_DEBUG_FILES} != "no"
_debug=-dbg
. endif
create-dtb-package:
@if [ -f ${KSTAGEDIR}/${DISTDIR}/dtb.plist ]; then \
sed -e "s/%VERSION%/${PKG_VERSION}/" \
-e "s/%PKGNAME%/dtb/" \
-e "s/%COMMENT%/FreeBSD Devicetree Blobs/" \
-e "s/%DESC%/FreeBSD Devicetree Blobs/" \
-e "s/ %VCS_REVISION%/${VCS_REVISION}/" \
-e "s/%PKG_NAME_PREFIX%/${PKG_NAME_PREFIX}/" \
-e "s/%PKG_MAINTAINER%/${PKG_MAINTAINER}/" \
-e "s|%PKG_WWW%|${PKG_WWW}|" \
${SRCDIR}/release/packages/dtb.ucl \
> ${KSTAGEDIR}/${DISTDIR}/dtb.ucl ; \
awk -F\" ' \
/name/ { printf("===> Creating %s-", $$2); next } \
/version/ {print $$2; next } ' \
${KSTAGEDIR}/${DISTDIR}/dtb.ucl ; \
${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \
-o OSVERSION="${SRCRELDATE}" \
create -f ${PKG_FORMAT} \
-M ${KSTAGEDIR}/${DISTDIR}/dtb.ucl \
-p ${KSTAGEDIR}/${DISTDIR}/dtb.plist \
-r ${KSTAGEDIR}/${DISTDIR} \
-o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR} ; \
fi
create-kernel-packages: .PHONY
. for flavor in "" ${_debug}
create-kernel-packages: create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}
create-kernel-packages: create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},} create-dtb-package
create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}: _pkgbootstrap .PHONY
@cd ${KSTAGEDIR}/${DISTDIR} ; \
${METALOG_SORT_CMD} ${KSTAGEDIR}/kernel.meta | \

16
release/packages/dtb.ucl Normal file
View File

@ -0,0 +1,16 @@
#
#
name = "%PKG_NAME_PREFIX%-%PKGNAME%"
origin = "base"
version = "%VERSION%"
comment = "%COMMENT%"
categories = [ base ]
maintainer = "%PKG_MAINTAINER%"
www = "%PKG_WWW%"
prefix = "/"
licenselogic = "single"
licenses = [ BSD2CLAUSE ]
desc = <<EOD
%DESC%
EOD

View File

@ -23,9 +23,13 @@
}
}
if (kernel != "") {
tags="package=kernel"
if (_kernconf != "") {
tags=tags""_kernconf
if ($1 ~ /^\/boot\/dtb\//) {
tags="package=dtb"
} else {
tags="package=kernel"
if (_kernconf != "") {
tags=tags""_kernconf
}
}
}
if (length(tags) == 0)
@ -36,8 +40,12 @@
for (i in a) {
if (a[i] ~ /^package=/) {
pkgname=a[i]
if ($1 ~ /^\/boot\//)
pkgname="bootloader"
if ($1 ~ /^\/boot\//) {
if (kernel != "" && $1 ~ /^\/boot\/dtb\//)
pkgname="dtb"
else
pkgname="bootloader"
}
gsub(/package=/, "", pkgname)
} else if (a[i] == "config") {
type="config"
@ -64,7 +72,7 @@
print "No packages specified in line: $0"
next
}
if (kernel != "") {
if (kernel != "" && pkgname != "dtb") {
output="kernel"
if (_kernconf != "") {
output=output"."_kernconf