diff options
Diffstat (limited to 'meta/recipes-bsp')
77 files changed, 673 insertions, 2644 deletions
diff --git a/meta/recipes-bsp/acpid/acpid.inc b/meta/recipes-bsp/acpid/acpid.inc index 1e43e7a9db..7b2f1c71c5 100644 --- a/meta/recipes-bsp/acpid/acpid.inc +++ b/meta/recipes-bsp/acpid/acpid.inc @@ -8,12 +8,13 @@ admin." HOMEPAGE = "http://sourceforge.net/projects/acpid2" BUGTRACKER = "http://sourceforge.net/p/acpid2/tickets/?source=navbar" SECTION = "base" -LICENSE = "GPLv2+" +LICENSE = "GPL-2.0-or-later" SRC_URI = "${SOURCEFORGE_MIRROR}/acpid2/acpid-${PV}.tar.xz \ file://init \ file://acpid.service \ - " + file://0001-Replace-stat64-with-stat.patch \ + " CVE_PRODUCT = "acpid2" @@ -22,9 +23,9 @@ inherit autotools update-rc.d systemd INITSCRIPT_NAME = "acpid" INITSCRIPT_PARAMS = "defaults" -SYSTEMD_SERVICE_${PN} = "acpid.service" +SYSTEMD_SERVICE:${PN} = "acpid.service" -do_install_append () { +do_install:append () { install -d ${D}${sysconfdir}/init.d sed -e 's,/usr/sbin,${sbindir},g' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/acpid chmod 755 ${D}${sysconfdir}/init.d/acpid @@ -32,7 +33,7 @@ do_install_append () { install -d ${D}${sysconfdir}/acpi install -d ${D}${sysconfdir}/acpi/events - install -d ${D}${systemd_unitdir}/system - install -m 0644 ${WORKDIR}/acpid.service ${D}${systemd_unitdir}/system - sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/acpid.service + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/acpid.service ${D}${systemd_system_unitdir} + sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_system_unitdir}/acpid.service } diff --git a/meta/recipes-bsp/acpid/acpid/0001-Replace-stat64-with-stat.patch b/meta/recipes-bsp/acpid/acpid/0001-Replace-stat64-with-stat.patch new file mode 100644 index 0000000000..10abfc8388 --- /dev/null +++ b/meta/recipes-bsp/acpid/acpid/0001-Replace-stat64-with-stat.patch @@ -0,0 +1,31 @@ +From 4b729235a9e96f120feee7e3746818aad0f3b924 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 14 Dec 2022 15:04:30 -0800 +Subject: [PATCH] Replace stat64 with stat + +It already checks for largefile support in configure.ac via +AC_SYS_LARGEFILE macro, which will ensure that 64bit elements +are correctly setup for stat APIs on platforms needing large +file support. + +Upstream-Status: Submitted [https://sourceforge.net/p/acpid2/code/merge-requests/5/] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + sock.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sock.c b/sock.c +index 9e04501..3121fb7 100644 +--- a/sock.c ++++ b/sock.c +@@ -54,8 +54,8 @@ int non_root_clients; + static int + isfdtype(int fd, int fdtype) + { +- struct stat64 st; +- if (fstat64(fd, &st) != 0) ++ struct stat st; ++ if (fstat(fd, &st) != 0) + return -1; + return ((st.st_mode & S_IFMT) == (mode_t)fdtype); + } diff --git a/meta/recipes-bsp/acpid/acpid_2.0.32.bb b/meta/recipes-bsp/acpid/acpid_2.0.34.bb index 227e4a4675..1e0a6d5f24 100644 --- a/meta/recipes-bsp/acpid/acpid_2.0.32.bb +++ b/meta/recipes-bsp/acpid/acpid_2.0.34.bb @@ -3,5 +3,4 @@ require acpid.inc LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \ file://acpid.h;endline=24;md5=324a9cf225ae69ddaad1bf9d942115b5" -SRC_URI[md5sum] = "248995264b9d1cd8bdb923d5b190fd44" -SRC_URI[sha256sum] = "f2d2d30b3edc3234bd82f6f7186699a6aa3c85c8d20bc4e30e9b3c68a1ed157e" +SRC_URI[sha256sum] = "2d095c8cfcbc847caec746d62cdc8d0bff1ec1bc72ef7c674c721e04da6ab333" diff --git a/meta/recipes-bsp/alsa-state/alsa-state.bb b/meta/recipes-bsp/alsa-state/alsa-state.bb index cec2272c80..bd7f610f46 100644 --- a/meta/recipes-bsp/alsa-state/alsa-state.bb +++ b/meta/recipes-bsp/alsa-state/alsa-state.bb @@ -8,10 +8,12 @@ SUMMARY = "Alsa scenario files to enable alsa state restoration" HOMEPAGE = "http://www.alsa-project.org/" DESCRIPTION = "Alsa Scenario Files - an init script and state files to restore \ sound state at system boot and save it at system shut down." -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" +LICENSE = "MIT & GPL-2.0-or-later" +LIC_FILES_CHKSUM = " \ + file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420 \ + file://alsa-state-init;beginline=3;endline=4;md5=3ff7ecbf534d7d503941abe8e268ef50 \ +" PV = "0.2.0" -PR = "r5" SRC_URI = "\ file://asound.conf \ @@ -49,15 +51,15 @@ do_install() { PACKAGES += "alsa-states" -RRECOMMENDS_alsa-state = "alsa-states" +RRECOMMENDS:alsa-state = "alsa-states" -RDEPENDS_${PN} = "alsa-utils-alsactl" -FILES_${PN} = "${sysconfdir}/init.d ${sysconfdir}/asound.conf" -CONFFILES_${PN} = "${sysconfdir}/asound.conf" +RDEPENDS:${PN} = "alsa-utils-alsactl" +FILES:${PN} = "${sysconfdir}/init.d ${sysconfdir}/asound.conf" +CONFFILES:${PN} = "${sysconfdir}/asound.conf" -FILES_alsa-states = "${localstatedir}/lib/alsa/*.state" +FILES:alsa-states = "${localstatedir}/lib/alsa/*.state" -pkg_postinst_${PN}() { +pkg_postinst:${PN}() { if test -z "$D" then if test -x ${sbindir}/alsactl diff --git a/meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init b/meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init index eee59cb321..a04cc27004 100755 --- a/meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init +++ b/meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init @@ -1,10 +1,9 @@ #! /bin/sh # # Copyright Matthias Hentges <devel@hentges.net> (c) 2007 -# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license) +# SPDX-License-Identifier: GPL-2.0-or-later # # Filename: alsa-state -# Date: 20070308 (YMD) # source function library . /etc/init.d/functions diff --git a/meta/recipes-bsp/apmd/apmd/apmd.service b/meta/recipes-bsp/apmd/apmd/apmd.service deleted file mode 100644 index ffab82334f..0000000000 --- a/meta/recipes-bsp/apmd/apmd/apmd.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Advanced Power Management daemon -After=remote-fs.target - -[Service] -EnvironmentFile=-@SYSCONFDIR@/default/apmd -ExecStart=@SBINDIR@/apmd -P @SYSCONFDIR@/apm/apmd_proxy $APMD diff --git a/meta/recipes-bsp/apmd/apmd/apmd_proxy b/meta/recipes-bsp/apmd/apmd/apmd_proxy deleted file mode 100644 index c48ee4e5d5..0000000000 --- a/meta/recipes-bsp/apmd/apmd/apmd_proxy +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/sh -# -# apmd_proxy - program dispatcher for APM daemon -# -# Written by Craig Markwardt (craigm@lheamail.gsfc.nasa.gov) 21 May 1999 -# Modified for Debian by Avery Pennarun -# -# This shell script is called by the APM daemon (apmd) when a power -# management event occurs. Its first and second arguments describe the -# event. For example, apmd will call "apmd_proxy suspend system" just -# before the system is suspended. -# -# Here are the possible arguments: -# -# start - APM daemon has started -# stop - APM daemon is shutting down -# suspend critical - APM system indicates critical suspend (++) -# suspend system - APM system has requested suspend mode -# suspend user - User has requested suspend mode -# standby system - APM system has requested standby mode -# standby user - User has requested standby mode -# resume suspend - System has resumed from suspend mode -# resume standby - System has resumed from standby mode -# resume critical - System has resumed from critical suspend -# change battery - APM system reported low battery -# change power - APM system reported AC/battery change -# change time - APM system reported time change (*) -# change capability - APM system reported config. change (+) -# -# (*) - APM daemon may be configured to not call these sequences -# (+) - Available if APM kernel supports it. -# (++) - "suspend critical" is never passed to apmd from the kernel, -# so we will never see it here. Scripts that process "resume -# critical" events need to take this into account. -# -# It is the proxy script's responsibility to examine the APM status -# (via /proc/apm) or other status and to take appropriate actions. -# For example, the script might unmount network drives before the -# machine is suspended. -# -# In Debian, the usual way of adding functionality to the proxy is to -# add a script to /etc/apm/event.d. This script will be called by -# apmd_proxy (via run-parts) with the same arguments. -# -# If it is important that a certain set of script be run in a certain -# order on suspend and in a different order on resume, then put all -# the scripts in /etc/apm/scripts.d instead of /etc/apm/event.d and -# symlink to these from /etc/apm/suspend.d, /etc/apm/resume.d and -# /etc/apm/other.d using names whose lexicographical order is the same -# as the desired order of execution. -# -# If the kernel's APM driver supports it, apmd_proxy can return a non-zero -# exit status on suspend and standby events, indicating that the suspend -# or standby event should be rejected. -# -# ******************************************************************* - -set -e - -# The following doesn't yet work, because current kernels (up to at least -# 2.4.20) do not support rejection of APM events. Supporting this would -# require substantial modifications to the APM driver. We will re-enable -# this feature if the driver is ever modified. -- cph@debian.org -# -#SUSPEND_ON_AC=false -#[ -r /etc/apm/apmd_proxy.conf ] && . /etc/apm/apmd_proxy.conf -# -#if [ "${SUSPEND_ON_AC}" = "false" -a "${2}" = "system" ] \ -# && on_ac_power >/dev/null; then -# # Reject system suspends and standbys if we are on AC power -# exit 1 # Reject (NOTE kernel support must be enabled) -#fi - -if [ "${1}" = "suspend" -o "${1}" = "standby" ]; then - run-parts -a "${1}" -a "${2}" /etc/apm/event.d - if [ -d /etc/apm/suspend.d ]; then - run-parts -a "${1}" -a "${2}" /etc/apm/suspend.d - fi -elif [ "${1}" = "resume" ]; then - if [ -d /etc/apm/resume.d ]; then - run-parts -a "${1}" -a "${2}" /etc/apm/resume.d - fi - run-parts -a "${1}" -a "${2}" /etc/apm/event.d -else - run-parts -a "${1}" -a "${2}" /etc/apm/event.d - if [ -d /etc/apm/other.d ]; then - run-parts -a "${1}" -a "${2}" /etc/apm/other.d - fi -fi - -exit 0 diff --git a/meta/recipes-bsp/apmd/apmd/apmd_proxy.conf b/meta/recipes-bsp/apmd/apmd/apmd_proxy.conf deleted file mode 100644 index 751145c522..0000000000 --- a/meta/recipes-bsp/apmd/apmd/apmd_proxy.conf +++ /dev/null @@ -1,16 +0,0 @@ -# /etc/apm/apmd_proxy.conf: configuration file for apmd. -# -# This file is managed by debconf when installing or reconfiguring the -# package. It is generated by merging the answers gathered by debconf -# into the template file "/usr/share/apmd/apmd_proxy.conf". - -# The following doesn't yet work, because current kernels (up to at least -# 2.4.20) do not support rejection of APM events. Supporting this would -# require substantial modifications to the APM driver. We will re-enable -# this feature if the driver is ever modified. -- cph@debian.org -# -# Set the following to "false" if you want to reject system suspend or -# system standby requests when the computer is running on AC power. -# Otherwise set this to "true". Such requests are never rejected when -# the computer is running on battery power. -#SUSPEND_ON_AC=true diff --git a/meta/recipes-bsp/apmd/apmd/default b/meta/recipes-bsp/apmd/apmd/default deleted file mode 100644 index 4b7965abf8..0000000000 --- a/meta/recipes-bsp/apmd/apmd/default +++ /dev/null @@ -1,8 +0,0 @@ -# -# Default for /etc/init.d/apmd -# - -# As apmd can be called with arguments, we use the following variable -# to store them, e.g., APMD="-w 5 -p 2". -# See the manual page apmd(8) for details. -APMD="--proxy-timeout 30" diff --git a/meta/recipes-bsp/apmd/apmd/init b/meta/recipes-bsp/apmd/apmd/init deleted file mode 100755 index c0b41aa9d1..0000000000 --- a/meta/recipes-bsp/apmd/apmd/init +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: apmd -# Required-Start: $remote_fs -# Required-Stop: $remote_fs -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Advanced Power Management daemon -### END INIT INFO - -# Source function library. -. /etc/init.d/functions - -PATH=/bin:/usr/bin:/sbin:/usr/sbin - -[ -f /etc/default/rcS ] && . /etc/default/rcS -[ -f /etc/default/apmd ] && . /etc/default/apmd - -case "$1" in - start) - echo -n "Starting advanced power management daemon: " - start-stop-daemon -S -x /usr/sbin/apmd -- \ - -P /etc/apm/apmd_proxy $APMD - if [ $? = 0 ]; then - echo "apmd." - else - echo "(failed.)" - fi - ;; - stop) - echo -n "Stopping advanced power management daemon: " - start-stop-daemon -K \ - -x /usr/sbin/apmd - echo "apmd." - ;; - status) - status /usr/sbin/apmd; - exit $? - ;; - restart|force-reload) - $0 stop - $0 start - exit - ;; - *) - echo "Usage: /etc/init.d/apmd {start|stop|status|restart|force-reload}" - exit 1 - ;; -esac - -exit 0 diff --git a/meta/recipes-bsp/apmd/apmd/legacy.patch b/meta/recipes-bsp/apmd/apmd/legacy.patch deleted file mode 100644 index 8871311805..0000000000 --- a/meta/recipes-bsp/apmd/apmd/legacy.patch +++ /dev/null @@ -1,133 +0,0 @@ -From 3595933d221f0ba836917debc0776b8723972ec9 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Tue, 11 Aug 2015 17:40:50 +0300 -Subject: [PATCH 1/3] Patch with fixes provided by Debian. - -This patch is taken from -ftp://ftp.debian.org/debian/pool/main/a/apmd/apmd_3.2.2-15.debian.tar.xz - -Upstream-Status: Inappropriate [upstream is dead] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - ---- - Makefile | 2 +- - apm.c | 3 ++- - apm.h | 9 +++++++++ - apmd.c | 15 ++++++++------- - 4 files changed, 20 insertions(+), 9 deletions(-) - -diff --git a/Makefile b/Makefile -index bf346d9..92fc0fd 100644 ---- a/Makefile -+++ b/Makefile -@@ -43,7 +43,7 @@ DESTDIR= - - CC=gcc - CFLAGS=-O -g --XTRACFLAGS=-Wall -pipe -I. -I/usr/src/linux/include \ -+XTRACFLAGS=-Wall -pipe -I. -I/usr/src/linux/include -I/usr/X11R6/include \ - -I/usr/src/linux-2.2/include -I /usr/src/linux-2.0/include \ - -DVERSION=\"$(VERSION)\" \ - -DDEFAULT_PROXY_NAME=\"$(PROXY_DIR)/apmd_proxy\" -diff --git a/apm.c b/apm.c -index b21c057..0359b1c 100644 ---- a/apm.c -+++ b/apm.c -@@ -219,12 +219,13 @@ int main(int argc, char **argv) - } - } - -- -+#if 0 - if (!(i.apm_flags & APM_32_BIT_SUPPORT)) - { - fprintf(stderr, "32-bit APM interface not supported\n"); - exit(1); - } -+#endif - - if (verbose && (i.apm_flags & 0x10)) - printf("APM BIOS Power Management is currently disabled\n"); -diff --git a/apm.h b/apm.h -index fb24dfd..824cc06 100644 ---- a/apm.h -+++ b/apm.h -@@ -20,6 +20,13 @@ - * $Id: apm.h,v 1.7 1999/07/05 22:31:11 apenwarr Exp $ - * - */ -+#ifndef _APM_H -+#define _APM_H 1 -+ -+#ifndef __KERNEL_STRICT_NAMES -+#define __KERNEL_STRICT_NAMES -+#endif -+ - #include <linux/apm_bios.h> - #include <sys/types.h> - -@@ -93,3 +100,5 @@ extern int apm_reject(int fd); - #else - #define apm_reject(fd) (-EINVAL) - #endif -+ -+#endif -diff --git a/apmd.c b/apmd.c -index 49ed3a1..560f536 100644 ---- a/apmd.c -+++ b/apmd.c -@@ -343,7 +343,7 @@ static int call_proxy(apm_event_t event) - /* parent */ - int status, retval; - ssize_t len; -- time_t time_limit; -+ time_t countdown; - - if (pid < 0) { - /* Couldn't fork */ -@@ -356,8 +356,9 @@ static int call_proxy(apm_event_t event) - /* Capture the child's output, if any, but only until it terminates */ - close(fds[1]); - fcntl(fds[0], F_SETFL, O_RDONLY|O_NONBLOCK); -- time_limit = time(0) + proxy_timeout; -+ countdown = proxy_timeout; - do { -+ countdown -= 1; - while ((len = read(fds[0], line, sizeof(line)-1)) > 0) { - line[len] = 0; - APMD_SYSLOG(LOG_INFO, "+ %s", line); -@@ -372,16 +373,16 @@ static int call_proxy(apm_event_t event) - goto proxy_done; - } - -- sleep(1); -+ while (sleep(1) > 0) ; - } while ( -- (time(0) < time_limit) -+ (countdown >= 0) - || (proxy_timeout < 0) - ); - - APMD_SYSLOG(LOG_NOTICE, "Proxy has been running more than %d seconds; killing it", proxy_timeout); - - kill(pid, SIGTERM); -- time_limit = time(0) + 5; -+ countdown = 5; - do { - retval = waitpid(pid, &status, WNOHANG); - if (retval == pid) -@@ -392,9 +393,9 @@ static int call_proxy(apm_event_t event) - goto proxy_done; - } - -- sleep(1); -+ while (sleep(1) > 0) ; - -- } while (time(0) < time_limit); -+ } while (countdown >= 0); - - kill(pid, SIGKILL); - status = __W_EXITCODE(0, SIGKILL); --- -2.1.4 - diff --git a/meta/recipes-bsp/apmd/apmd/libtool.patch b/meta/recipes-bsp/apmd/apmd/libtool.patch deleted file mode 100644 index 834ee080a1..0000000000 --- a/meta/recipes-bsp/apmd/apmd/libtool.patch +++ /dev/null @@ -1,33 +0,0 @@ -Add by RP to address "unable to infer tagged configuration" error: - commit 35de05e61b88c0808a5e885bb0efdf420555d5ad - Author: Richard Purdie <rpurdie@rpsys.net> - Date: Sun Jun 1 16:13:38 2008 +0000 - - apmd: Use libtool --tag options to avoid problems with libtool 2.2.4 (from poky) - -However I didn't see same issue with current libtool-2.2.10. Also per my understanding, -the default tag, if not specified, falls back to CC. So disable it from patching, but -keep it here. If we encounter similar issue in the future, we could then push upstream - -Comment added by Kevin Tian <kevin.tian@intel.com>, 2010-07-16 - -Upstream-Status: Pending - -Signed-off-by: Scott Garman <scott.a.garman@intel.com> - -Index: apmd-3.2.2.orig/Makefile -=================================================================== ---- apmd-3.2.2.orig.orig/Makefile 2004-01-04 08:13:18.000000000 +0000 -+++ apmd-3.2.2.orig/Makefile 2008-04-21 17:10:03.000000000 +0100 -@@ -58,9 +57,8 @@ - #CFLAGS=-O3 -m486 -fomit-frame-pointer - #LDFLAGS=-s - --LIBTOOL=libtool --quiet --LT_COMPILE = $(LIBTOOL) --mode=compile $(CC) --LT_LINK = $(LIBTOOL) --mode=link $(CC) -+LT_COMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) -+LT_LINK = $(LIBTOOL) --tag=CC --mode=link $(CC) - LT_INSTALL = $(LIBTOOL) --mode=install install - LT_CLEAN = $(LIBTOOL) --mode=clean rm - diff --git a/meta/recipes-bsp/apmd/apmd/linkage.patch b/meta/recipes-bsp/apmd/apmd/linkage.patch deleted file mode 100644 index 3d32c49cd2..0000000000 --- a/meta/recipes-bsp/apmd/apmd/linkage.patch +++ /dev/null @@ -1,53 +0,0 @@ -When building use the libtool intermediate .lo files instead of explicitly using -the .o files. Under libtool foo.lo is the libtool intermediate wrapper, foo.o is -a static build, and .libs/foo.o is a shared build. - -If static libraries have been disabled globally then libtool won't generate them -and explicit references to foo.o won't be satisfied. - -Upstream-Status: Pending -Signed-off-by: Ross Burton <ross.burton@intel.com> - -diff --git a/Makefile b/Makefile -index bb695c6..5f60146 100644 ---- a/Makefile -+++ b/Makefile -@@ -28,7 +28,7 @@ endif - - .SUFFIXES: - --OBJS=apmlib.o -+OBJS=apmlib.lo - EXES=apm apmd xapm apmsleep - HEADERS=apm.h - -@@ -66,22 +66,22 @@ all: $(EXES) - - $(OBJS): $(HEADERS) - --%.o: %.c -+%.lo: %.c - $(LT_COMPILE) -c $(CPPFLAGS) $(CFLAGS) $(XTRACFLAGS) $< - --%: %.o $(LIBAPM) -+%: %.lo $(LIBAPM) - $(LT_LINK) -o $@ $< $(LDFLAGS) $(LIBAPM) - --xapm.o: xapm.c -+xapm.lo: xapm.c - $(LT_COMPILE) -c $(CPPFLAGS) $(CFLAGS) $(XTRACFLAGS) -DNARROWPROTO $< - --apmd: apmd.o -+apmd: apmd.lo - --apmsleep: apmsleep.o -+apmsleep: apmsleep.lo - --apmexists: apmexists.o -+apmexists: apmexists.lo - --xapm: xapm.o $(LIBAPM) -+xapm: xapm.lo $(LIBAPM) - $(LT_LINK) -o $@ $< $(LDFLAGS) $(LIBAPM) $(XLDFLAGS) $(XLIBS) - - $(LIBAPM): apmlib.lo diff --git a/meta/recipes-bsp/apmd/apmd/unlinux.patch b/meta/recipes-bsp/apmd/apmd/unlinux.patch deleted file mode 100644 index ec8206cf17..0000000000 --- a/meta/recipes-bsp/apmd/apmd/unlinux.patch +++ /dev/null @@ -1,25 +0,0 @@ -copy OE commit message here: - commit 9456cdc1cf43e3ba9e6d88c63560c1b6fdee4359 - Author: Michael Krelin <hacker@klever.net> - Date: Tue May 29 12:27:45 2007 +0000 - - apmd: prevent build from interferring with host kernel headers. Closes #1257 - -comment added by Kevin Tian <kevin.tian@intel.com>, 2010-07-13 - -Upstream-Status: Pending - -Signed-off-by: Scott Garman <scott.a.garman@intel.com> - ---- apmd-3.2.2.orig/Makefile -+++ apmd-3.2.2/Makefile -@@ -43,8 +43,7 @@ - - CC=gcc - CFLAGS=-O -g --XTRACFLAGS=-Wall -pipe -I. -I/usr/src/linux/include -I/usr/X11R6/include \ -- -I/usr/src/linux-2.2/include -I /usr/src/linux-2.0/include \ -+XTRACFLAGS=-Wall -pipe -I. \ - -DVERSION=\"$(VERSION)\" \ - -DDEFAULT_PROXY_NAME=\"$(PROXY_DIR)/apmd_proxy\" - LDFLAGS= diff --git a/meta/recipes-bsp/apmd/apmd/wexitcode.patch b/meta/recipes-bsp/apmd/apmd/wexitcode.patch deleted file mode 100644 index c5faa85fa7..0000000000 --- a/meta/recipes-bsp/apmd/apmd/wexitcode.patch +++ /dev/null @@ -1,26 +0,0 @@ -Define non-posix W* funcitons - -C libraries like musl dont define them - -Signed-off-by: Khem Raj <raj.khem@gmail.com> -Upstream-Status: Pending - -Index: apmd-3.2.2.orig/apmd.c -=================================================================== ---- apmd-3.2.2.orig.orig/apmd.c -+++ apmd-3.2.2.orig/apmd.c -@@ -55,6 +55,14 @@ - #define MINIMUM_RATE_CALC_TIME 120 - #endif - -+#ifndef _POSIX_SOURCE -+ -+#define __WCOREFLAG 0200 -+#define __WCOREDUMP(x) (_W_INT(x) & __WCOREFLAG) -+#define __W_EXITCODE(ret, sig) ((ret) << 8 | (sig)) -+ -+#endif -+ - /* - * For the verbosity level feature to be useful, - * we rely on the fact that syslog.h assigns adjacent diff --git a/meta/recipes-bsp/apmd/apmd_3.2.2-15.bb b/meta/recipes-bsp/apmd/apmd_3.2.2-15.bb deleted file mode 100644 index 82c2649340..0000000000 --- a/meta/recipes-bsp/apmd/apmd_3.2.2-15.bb +++ /dev/null @@ -1,85 +0,0 @@ -SUMMARY = "Utilities for Advanced Power Management" -DESCRIPTION = "The Advanced Power Management (APM) support provides \ -access to battery status information and a set of tools for managing \ -notebook power consumption." -HOMEPAGE = "http://apenwarr.ca/apmd/" -SECTION = "base" -LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ - file://apm.h;beginline=6;endline=18;md5=7d4acc1250910a89f84ce3cc6557c4c2" -DEPENDS = "libtool-cross" - -SRC_URI = "http://snapshot.debian.org/archive/debian/20160728T043443Z/pool/main/a/${BPN}/${BPN}_3.2.2.orig.tar.gz;name=tarball \ - file://legacy.patch \ - file://libtool.patch \ - file://unlinux.patch \ - file://wexitcode.patch \ - file://linkage.patch \ - file://init \ - file://default \ - file://apmd_proxy \ - file://apmd_proxy.conf \ - file://apmd.service" - -SRC_URI[tarball.md5sum] = "b1e6309e8331e0f4e6efd311c2d97fa8" -SRC_URI[tarball.sha256sum] = "7f7d9f60b7766b852881d40b8ff91d8e39fccb0d1d913102a5c75a2dbb52332d" - -# for this package we're mostly interested in tracking debian patches, -# and not in the upstream version where all development has effectively stopped -UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/apmd/" -UPSTREAM_CHECK_REGEX = "(?P<pver>((\d+\.*)+)-((\d+\.*)+))\.(diff|debian\.tar)\.(gz|xz)" - -S = "${WORKDIR}/apmd-3.2.2.orig" - -inherit update-rc.d systemd - -INITSCRIPT_NAME = "apmd" -INITSCRIPT_PARAMS = "defaults" - -SYSTEMD_SERVICE_${PN} = "apmd.service" -SYSTEMD_AUTO_ENABLE = "disable" - -EXTRA_OEMAKE = "-e MAKEFLAGS=" - -do_compile() { - # apmd doesn't use whole autotools. Just libtool for installation - oe_runmake "LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool" apm apmd -} - -do_install() { - install -d ${D}${sysconfdir} - install -d ${D}${sysconfdir}/apm - install -d ${D}${sysconfdir}/apm/event.d - install -d ${D}${sysconfdir}/apm/other.d - install -d ${D}${sysconfdir}/apm/suspend.d - install -d ${D}${sysconfdir}/apm/resume.d - install -d ${D}${sysconfdir}/apm/scripts.d - install -d ${D}${sysconfdir}/default - install -d ${D}${sysconfdir}/init.d - install -d ${D}${sbindir} - install -d ${D}${bindir} - install -d ${D}${libdir} - install -d ${D}${datadir}/apmd - install -d ${D}${includedir} - - install -m 4755 ${S}/.libs/apm ${D}${bindir}/apm - install -m 0755 ${S}/.libs/apmd ${D}${sbindir}/apmd - install -m 0755 ${WORKDIR}/apmd_proxy ${D}${sysconfdir}/apm/ - install -m 0644 ${WORKDIR}/apmd_proxy.conf ${D}${datadir}/apmd/ - install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/apmd - oe_libinstall -so libapm ${D}${libdir} - install -m 0644 apm.h ${D}${includedir} - - sed -e 's,/usr/sbin,${sbindir},g; s,/etc,${sysconfdir},g;' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/apmd - chmod 755 ${D}${sysconfdir}/init.d/apmd - - install -d ${D}${systemd_unitdir}/system - install -m 0644 ${WORKDIR}/apmd.service ${D}${systemd_unitdir}/system/ - sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \ - -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/apmd.service -} - -PACKAGES =+ "libapm apm" - -FILES_libapm = "${libdir}/libapm${SOLIBS}" -FILES_apm = "${bindir}/apm*" diff --git a/meta/recipes-bsp/efibootmgr/efibootmgr/0001-remove-extra-decl.patch b/meta/recipes-bsp/efibootmgr/efibootmgr/0001-remove-extra-decl.patch deleted file mode 100644 index 42f3a8182d..0000000000 --- a/meta/recipes-bsp/efibootmgr/efibootmgr/0001-remove-extra-decl.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 99b578501643377e0b1994b2a068b790d189d5ad Mon Sep 17 00:00:00 2001 -From: Peter Jones <pjones@redhat.com> -Date: Wed, 13 Jun 2018 09:41:01 -0400 -Subject: [PATCH] remove extra decl - -Signed-off-by: Peter Jones <pjones@redhat.com> - -Upstream-Status: Backport [git://github.com/rhinstaller/efibootmgr.git] -Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> - ---- - src/efibootmgr.c | 3 --- - 1 file changed, 3 deletions(-) - -diff --git a/src/efibootmgr.c b/src/efibootmgr.c -index de38f01..4e1a680 100644 ---- a/src/efibootmgr.c -+++ b/src/efibootmgr.c -@@ -1536,9 +1536,6 @@ parse_opts(int argc, char **argv) - "invalid numeric value %s\n", - optarg); - } -- /* XXX efivar-36 accidentally doesn't have a public -- * header for this */ -- extern int efi_set_verbose(int verbosity, FILE *errlog); - efi_set_verbose(opts.verbose - 2, stderr); - break; - case 'V': --- -2.7.4 - diff --git a/meta/recipes-bsp/efibootmgr/efibootmgr/97668ae0bce776a36ea2001dea63d376be8274ac.patch b/meta/recipes-bsp/efibootmgr/efibootmgr/97668ae0bce776a36ea2001dea63d376be8274ac.patch deleted file mode 100644 index 9525ed8c54..0000000000 --- a/meta/recipes-bsp/efibootmgr/efibootmgr/97668ae0bce776a36ea2001dea63d376be8274ac.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 97668ae0bce776a36ea2001dea63d376be8274ac Mon Sep 17 00:00:00 2001 -From: Peter Jones <pjones@redhat.com> -Date: Wed, 6 Mar 2019 13:08:33 -0500 -Subject: [PATCH] Make sure PKGS= is propogated into the submake for "make - deps" - -When we're doing make deps with "$(CC) -MF", gcc and clang have different -behavior, both broken in different ways, which we're hitting because of a -missing -I argument for libefivar's includes. On clang, when a header can't -be found, it emits a rule with the header as a prerequisite without a path, -such as efivar.h here: - -efibootmgr.o: efibootmgr.c fix_coverity.h efivar.h efiboot.h \ - /home/pjones/devel/github.com/efibootmgr/master/src/include/list.h \ - /home/pjones/devel/github.com/efibootmgr/master/src/include/efi.h \ - /home/pjones/devel/github.com/efibootmgr/master/src/include/unparse_path.h \ - /home/pjones/devel/github.com/efibootmgr/master/src/include/efibootmgr.h \ - error.h - -Then the build that utilizes that rule will fail to find the -prerequisite and tell you something like: - -make[1]: *** No rule to make target 'efivar.h', needed by 'efibootmgr.o'. Stop. -make[1]: Leaving directory '/home/pjones/devel/github.com/efibootmgr/master/src' - -With gcc, when a header can't be found, it emits a rule without that header -as a prerequisite, as such (again with efivar.h): - -efibootmgr.o: efibootmgr.c fix_coverity.h \ - /home/pjones/devel/github.com/efibootmgr/master/src/include/list.h \ - /home/pjones/devel/github.com/efibootmgr/master/src/include/efi.h \ - /home/pjones/devel/github.com/efibootmgr/master/src/include/unparse_path.h \ - /home/pjones/devel/github.com/efibootmgr/master/src/include/efi.h \ - /home/pjones/devel/github.com/efibootmgr/master/src/include/efibootmgr.h \ - error.h - -And then your build will fail if you haven't adjusted CFLAGS to tell it -where to find the header. - -Both of these would be better just erroring, but at least gcc's doesn't -insert a *wrong* dependency. - -This patch adds "PKGS=efivar efibootmgr popt" for all deps under src/. -Technically that's overkill, as efibootmgr itself doesn't need popt, but it -doesn't hurt anything to have the extra part there. The resulting -.efibootmgr.d file has the prerequisites expressed correctly: - -efibootmgr.o: efibootmgr.c fix_coverity.h /usr/include/efivar/efivar.h \ - /usr/include/efivar/efiboot.h \ - /home/pjones/devel/github.com/efibootmgr/master/src/include/list.h \ - /home/pjones/devel/github.com/efibootmgr/master/src/include/efi.h \ - /home/pjones/devel/github.com/efibootmgr/master/src/include/unparse_path.h \ - /home/pjones/devel/github.com/efibootmgr/master/src/include/efi.h \ - /home/pjones/devel/github.com/efibootmgr/master/src/include/efibootmgr.h \ - error.h - -This fixes the issue described in github PR #96 - -Signed-off-by: Peter Jones <pjones@redhat.com> -Upstream-Status: Backport [https://github.com/rhboot/efibootmgr/commit/97668ae0bce776a36ea2001dea63d376be8274ac] ---- - src/Makefile | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/src/Makefile b/src/Makefile -index 258bac1..32fa188 100644 ---- a/src/Makefile -+++ b/src/Makefile -@@ -31,8 +31,13 @@ efibootdump : PKGS=efivar efiboot popt - efibootnext : $(call objects-of,$(EFIBOOTNEXT_SOURCES)) - efibootnext : PKGS=efivar efiboot popt - -+deps : PKGS=efivar efiboot popt - deps : $(ALL_SOURCES) -- $(MAKE) -f $(TOPDIR)/Make.deps deps SOURCES="$(ALL_SOURCES)" SUBDIR_CFLAGS="$(SUBDIR_CFLAGS)" -+ $(MAKE) -f $(TOPDIR)/Make.deps \ -+ SOURCES="$(ALL_SOURCES)" \ -+ SUBDIR_CFLAGS="$(SUBDIR_CFLAGS)" \ -+ PKGS="$(PKGS)" \ -+ deps - - clean : - @rm -rfv *.o *.a *.so $(TARGETS) diff --git a/meta/recipes-bsp/efibootmgr/efibootmgr_17.bb b/meta/recipes-bsp/efibootmgr/efibootmgr_18.bb index 5d6f200a73..fbd2f5dbc8 100644 --- a/meta/recipes-bsp/efibootmgr/efibootmgr_17.bb +++ b/meta/recipes-bsp/efibootmgr/efibootmgr_18.bb @@ -3,18 +3,15 @@ SUMMARY = "EFI Boot Manager" HOMEPAGE = "https://github.com/rhboot/efibootmgr" SECTION = "base" -LICENSE = "GPLv2+" +LICENSE = "GPL-2.0-or-later" LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" DEPENDS = "efivar popt" COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux" -SRC_URI = "git://github.com/rhinstaller/efibootmgr.git;protocol=https \ - file://0001-remove-extra-decl.patch \ - file://97668ae0bce776a36ea2001dea63d376be8274ac.patch \ - " -SRCREV = "e067160ecef8208e1944002e5d50b275733211fb" +SRC_URI = "git://github.com/rhinstaller/efibootmgr.git;protocol=https;branch=main" +SRCREV = "c3f9f0534e32158f62c43564036878b93b9e0fd6" S = "${WORKDIR}/git" diff --git a/meta/recipes-bsp/efivar/efivar/0001-docs-do-not-build-efisecdb-manpage.patch b/meta/recipes-bsp/efivar/efivar/0001-docs-do-not-build-efisecdb-manpage.patch new file mode 100644 index 0000000000..cb30d3c430 --- /dev/null +++ b/meta/recipes-bsp/efivar/efivar/0001-docs-do-not-build-efisecdb-manpage.patch @@ -0,0 +1,26 @@ +From f39a1481a9e465387901d52b07ae56dedcc3838b Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex@linutronix.de> +Date: Sun, 16 Jan 2022 18:25:33 +0100 +Subject: [PATCH] docs: do not build efisecdb manpage + +It requires mandoc, which oe-core does not have. + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin <alex@linutronix.de> +--- + docs/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/docs/Makefile b/docs/Makefile +index c9bf585..91a6078 100644 +--- a/docs/Makefile ++++ b/docs/Makefile +@@ -5,7 +5,7 @@ include $(TOPDIR)/src/include/version.mk + include $(TOPDIR)/src/include/rules.mk + include $(TOPDIR)/src/include/defaults.mk + +-MAN1TARGETS = efisecdb.1 \ ++MAN1TARGETS = \ + efivar.1 + + MAN3TARGETS = efi_append_variable.3 \ diff --git a/meta/recipes-bsp/efivar/efivar/determinism.patch b/meta/recipes-bsp/efivar/efivar/determinism.patch deleted file mode 100644 index bdf6bfc4a8..0000000000 --- a/meta/recipes-bsp/efivar/efivar/determinism.patch +++ /dev/null @@ -1,18 +0,0 @@ -Fix reproducibility issue caused by unsorted wildcard expansion. - -Upstream-Status: Pending -RP 2021/3/1 - -Index: git/src/Makefile -=================================================================== ---- git.orig/src/Makefile -+++ git/src/Makefile -@@ -15,7 +15,7 @@ TARGETS=$(LIBTARGETS) $(BINTARGETS) $(PC - STATICTARGETS=$(STATICLIBTARGETS) $(STATICBINTARGETS) - - LIBEFIBOOT_SOURCES = crc32.c creator.c disk.c gpt.c loadopt.c path-helpers.c \ -- linux.c $(wildcard linux-*.c) -+ linux.c $(sort $(wildcard linux-*.c)) - LIBEFIBOOT_OBJECTS = $(patsubst %.c,%.o,$(LIBEFIBOOT_SOURCES)) - LIBEFIVAR_SOURCES = dp.c dp-acpi.c dp-hw.c dp-media.c dp-message.c \ - efivarfs.c error.c export.c guid.c guids.S guid-symbols.c \ diff --git a/meta/recipes-bsp/efivar/efivar/no-werror.patch b/meta/recipes-bsp/efivar/efivar/no-werror.patch deleted file mode 100644 index 50a0b1023a..0000000000 --- a/meta/recipes-bsp/efivar/efivar/no-werror.patch +++ /dev/null @@ -1,18 +0,0 @@ -Don't use -Werror because newer compilers introduce newer warnings. - -Upstream-Status: Inappropriate [https://github.com/rhboot/efivar/issues/131] -Signed-off-by: Ross Burton <ross.burton@intel.com> - -diff --git a/gcc.specs b/gcc.specs -index 45d43d1..1baf11a 100644 ---- a/gcc.specs -+++ b/gcc.specs -@@ -2,7 +2,7 @@ - + -D_GNU_SOURCE - - *efivar_cpp_options: -- -Werror -Wall -std=gnu11 -Wextra -+ -Wall -std=gnu11 -Wextra - - *cpp_options: - + %(efivar_cpp_options) diff --git a/meta/recipes-bsp/efivar/efivar_37.bb b/meta/recipes-bsp/efivar/efivar_37.bb deleted file mode 100644 index 5bf121ff6e..0000000000 --- a/meta/recipes-bsp/efivar/efivar_37.bb +++ /dev/null @@ -1,41 +0,0 @@ -SUMMARY = "Tools to manipulate UEFI variables" -DESCRIPTION = "efivar provides a simple command line interface to the UEFI variable facility" -HOMEPAGE = "https://github.com/rhboot/efivar" - -LICENSE = "LGPLv2.1+" -LIC_FILES_CHKSUM = "file://COPYING;md5=6626bb1e20189cfa95f2c508ba286393" - -COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux" - -SRC_URI = "git://github.com/rhinstaller/efivar.git \ - file://determinism.patch \ - file://no-werror.patch" -SRCREV = "c1d6b10e1ed4ba2be07f385eae5bceb694478a10" - -S = "${WORKDIR}/git" - -inherit pkgconfig - -export CCLD_FOR_BUILD = "${BUILD_CCLD}" - -# Upstream uses --add-needed in gcc.specs which gold doesn't support, so -# enforce BFD. -LDFLAGS += "-fuse-ld=bfd" - -do_compile_prepend() { - # Remove when https://github.com/rhboot/efivar/issues/130 is fixed - oe_runmake \ - CFLAGS="${BUILD_CFLAGS}" \ - LDFLAGS="${BUILD_LDFLAGS}" \ - -C src makeguids -} - -do_install() { - oe_runmake install DESTDIR=${D} -} - -BBCLASSEXTEND = "native" - -RRECOMMENDS_${PN}_class-target = "kernel-module-efivarfs" - -CLEANBROKEN = "1" diff --git a/meta/recipes-bsp/efivar/efivar_39.bb b/meta/recipes-bsp/efivar/efivar_39.bb new file mode 100644 index 0000000000..aab319be91 --- /dev/null +++ b/meta/recipes-bsp/efivar/efivar_39.bb @@ -0,0 +1,34 @@ +SUMMARY = "Tools to manipulate UEFI variables" +DESCRIPTION = "efivar provides a simple command line interface to the UEFI variable facility" +HOMEPAGE = "https://github.com/rhboot/efivar" + +LICENSE = "LGPL-2.1-or-later" +LIC_FILES_CHKSUM = "file://COPYING;md5=6626bb1e20189cfa95f2c508ba286393" + +COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux" + +SRC_URI = "git://github.com/rhinstaller/efivar.git;branch=main;protocol=https \ + file://0001-docs-do-not-build-efisecdb-manpage.patch \ + " +SRCREV = "c47820c37ac26286559ec004de07d48d05f3308c" +PV .= "+39+git" + +S = "${WORKDIR}/git" + +inherit pkgconfig + +export CCLD_FOR_BUILD = "${BUILD_CCLD}" + +do_compile() { + oe_runmake ERRORS= HOST_CFLAGS="${BUILD_CFLAGS}" HOST_LDFLAGS="${BUILD_LDFLAGS}" +} + +do_install() { + oe_runmake install DESTDIR=${D} +} + +BBCLASSEXTEND = "native" + +RRECOMMENDS:${PN}:class-target = "kernel-module-efivarfs" + +CLEANBROKEN = "1" diff --git a/meta/recipes-bsp/formfactor/formfactor_0.0.bb b/meta/recipes-bsp/formfactor/formfactor_0.0.bb index ea1fa4c754..1eaf30746b 100644 --- a/meta/recipes-bsp/formfactor/formfactor_0.0.bb +++ b/meta/recipes-bsp/formfactor/formfactor_0.0.bb @@ -5,7 +5,6 @@ build system cannot obtain from other sources such as the kernel." SECTION = "base" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" -PR = "r45" SRC_URI = "file://config file://machconfig" S = "${WORKDIR}" diff --git a/meta/recipes-bsp/gnu-efi/gnu-efi/0001-riscv64-adjust-type-definitions.patch b/meta/recipes-bsp/gnu-efi/gnu-efi/0001-riscv64-adjust-type-definitions.patch new file mode 100644 index 0000000000..3475606264 --- /dev/null +++ b/meta/recipes-bsp/gnu-efi/gnu-efi/0001-riscv64-adjust-type-definitions.patch @@ -0,0 +1,34 @@ +From 1de509497826faa0ad84b82f5e2c3d21ee613459 Mon Sep 17 00:00:00 2001 +From: Moody Liu <mooodyhunter@outlook.com> +Date: Sat, 13 May 2023 17:39:16 +0100 +Subject: [PATCH] riscv64: adjust type definitions + +CHAR8 needs to be defined while BOOLEAN should be removed +here to prevent typedef conflicts + +Upstream-Status: Backport [https://sourceforge.net/p/gnu-efi/code/ci/1de509497826faa0ad84b82f5e2c3d21ee613459/] +Signed-off-by: Moody Liu <mooodyhunter@outlook.com> +--- + inc/riscv64/efibind.h | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/inc/riscv64/efibind.h b/inc/riscv64/efibind.h +index 4fdf81d..d8b4f39 100644 +--- a/inc/riscv64/efibind.h ++++ b/inc/riscv64/efibind.h +@@ -32,11 +32,9 @@ typedef uint16_t UINT16; + typedef int16_t INT16; + typedef uint8_t UINT8; + typedef int8_t INT8; ++typedef char CHAR8; + typedef wchar_t CHAR16; + #define WCHAR CHAR16 +-#ifndef BOOLEAN +-typedef uint8_t BOOLEAN; +-#endif + #undef VOID + typedef void VOID; + typedef int64_t INTN; +-- +2.41.0 + diff --git a/meta/recipes-bsp/gnu-efi/gnu-efi/0001-riscv64-ignore-unknown-relocs.patch b/meta/recipes-bsp/gnu-efi/gnu-efi/0001-riscv64-ignore-unknown-relocs.patch new file mode 100644 index 0000000000..5b3c152c5e --- /dev/null +++ b/meta/recipes-bsp/gnu-efi/gnu-efi/0001-riscv64-ignore-unknown-relocs.patch @@ -0,0 +1,32 @@ +From 708f66acfec9a86f237726d45095cbd380fd83ca Mon Sep 17 00:00:00 2001 +From: Callum Farmer <gmbr3@opensuse.org> +Date: Wed, 21 Jun 2023 11:32:28 +0100 +Subject: [PATCH] riscv64: ignore unknown relocs + +Sometimes ld emits relocs such as R_RISCV_64 for unwind symbols +these don't need to be handled yet so just can be skipped otherwise +the binary will never load + +Upstream-Status: Backport [https://sourceforge.net/p/gnu-efi/code/ci/708f66acfec9a86f237726d45095cbd380fd83ca/] +Signed-off-by: Callum Farmer <gmbr3@opensuse.org> +--- + gnuefi/reloc_riscv64.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/gnuefi/reloc_riscv64.c b/gnuefi/reloc_riscv64.c +index 0b02d83..e429602 100644 +--- a/gnuefi/reloc_riscv64.c ++++ b/gnuefi/reloc_riscv64.c +@@ -81,8 +81,7 @@ EFI_STATUS EFIAPI _relocate(long ldbase, Elf_Dyn *dyn) + *addr = ldbase + rel->r_addend; + break; + default: +- /* Panic */ +- while (1) ; ++ break; + } + rel = (Elf_Rela *)((char *)rel + relent); + relsz -= relent; +-- +2.41.0 + diff --git a/meta/recipes-bsp/gnu-efi/gnu-efi/lib-Makefile-fix-parallel-issue.patch b/meta/recipes-bsp/gnu-efi/gnu-efi/lib-Makefile-fix-parallel-issue.patch deleted file mode 100644 index dc00b8fa4d..0000000000 --- a/meta/recipes-bsp/gnu-efi/gnu-efi/lib-Makefile-fix-parallel-issue.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 3ec8c2a70304eabd5760937a4ec3fbc4068a77ed Mon Sep 17 00:00:00 2001 -From: Robert Yang <liezhi.yang@windriver.com> -Date: Thu, 23 Apr 2015 01:49:31 -0700 -Subject: [PATCH 2/3] lib/Makefile: fix parallel issue - -Fixed: -Assembler messages: -Fatal error: can't create runtime/rtlock.o: No such file or directory -Assembler messages: -Fatal error: can't create runtime/rtdata.o: No such file or directory -Assembler messages: -Fatal error: can't create runtime/vm.o: No such file or directory -Assembler messages: -Fatal error: can't create runtime/efirtlib.o: No such file or directory - -Upstream-Status: Pending - -Signed-off-by: Robert Yang <liezhi.yang@windriver.com> ---- - lib/Makefile | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/lib/Makefile b/lib/Makefile -index 048751a..ed39bbb 100644 ---- a/lib/Makefile -+++ b/lib/Makefile -@@ -74,6 +74,8 @@ all: libsubdirs libefi.a - libsubdirs: - for sdir in $(SUBDIRS); do mkdir -p $$sdir; done - -+$(OBJS): libsubdirs -+ - libefi.a: $(OBJS) - $(AR) $(ARFLAGS) $@ $(OBJS) - --- -2.7.4 - diff --git a/meta/recipes-bsp/gnu-efi/gnu-efi/no-werror.patch b/meta/recipes-bsp/gnu-efi/gnu-efi/no-werror.patch new file mode 100644 index 0000000000..db2bcf70b7 --- /dev/null +++ b/meta/recipes-bsp/gnu-efi/gnu-efi/no-werror.patch @@ -0,0 +1,19 @@ +Do not treat warnings as errors + +There are additional warnings found with musl which are +treated as errors and fails the build, we have more combinations +then upstream supports to handle + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Upstream-Status: Inappropriate [OE specific] +--- a/Make.defaults ++++ b/Make.defaults +@@ -187,7 +187,7 @@ CFLAGS += $(ARCH3264) -g -O2 -Wall -Wex + -funsigned-char -fshort-wchar -fno-strict-aliasing \ + -ffreestanding -fno-stack-protector + else +-CFLAGS += $(ARCH3264) -g -O2 -Wall -Wextra -Wno-pointer-sign -Werror \ ++CFLAGS += $(ARCH3264) -g -O2 -Wall -Wextra -Wno-pointer-sign \ + -funsigned-char -fshort-wchar -fno-strict-aliasing \ + -ffreestanding -fno-stack-protector -fno-stack-check \ + -fno-stack-check \ diff --git a/meta/recipes-bsp/gnu-efi/gnu-efi/parallel-make-archives.patch b/meta/recipes-bsp/gnu-efi/gnu-efi/parallel-make-archives.patch index 8a0138bbe5..63d9b6fc31 100644 --- a/meta/recipes-bsp/gnu-efi/gnu-efi/parallel-make-archives.patch +++ b/meta/recipes-bsp/gnu-efi/gnu-efi/parallel-make-archives.patch @@ -1,7 +1,7 @@ -From 48b2cdbcd761105e8ebad412fcbf23db1ac4ef7c Mon Sep 17 00:00:00 2001 +From f56ddb00a656af2e84f839738fad19909ac65047 Mon Sep 17 00:00:00 2001 From: Saul Wold <sgw@linux.intel.com> Date: Sun, 9 Mar 2014 15:22:15 +0200 -Subject: [PATCH 1/3] Fix parallel make failure for archives +Subject: [PATCH] Fix parallel make failure for archives Upstream-Status: Pending @@ -20,12 +20,16 @@ Signed-off-by: California Sullivan <california.l.sullivan@intel.com> [Rebased for 3.0.8] Signed-off-by: Yi Zhao <yi.zhao@windriver.com> +--- + lib/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + diff --git a/lib/Makefile b/lib/Makefile -index 0e6410d..048751a 100644 +index 1fc6a47..54b0ca7 100644 --- a/lib/Makefile +++ b/lib/Makefile -@@ -75,7 +75,7 @@ libsubdirs: - for sdir in $(SUBDIRS); do mkdir -p $$sdir; done +@@ -77,7 +77,7 @@ libsubdirs: + $(OBJS): libsubdirs libefi.a: $(OBJS) - $(AR) $(ARFLAGS) $@ $^ @@ -33,6 +37,3 @@ index 0e6410d..048751a 100644 clean: rm -f libefi.a *~ $(OBJS) */*.o --- -2.7.4 - diff --git a/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.12.bb b/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.17.bb index d27126603f..43b7cc7529 100644 --- a/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.12.bb +++ b/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.17.bb @@ -2,11 +2,10 @@ SUMMARY = "Libraries for producing EFI binaries" HOMEPAGE = "http://sourceforge.net/projects/gnu-efi/" DESCRIPTION = "GNU-EFI aims to Develop EFI applications for ARM-64, ARM-32, x86_64, IA-64 (IPF), IA-32 (x86), and MIPS platforms using the GNU toolchain and the EFI development environment." SECTION = "devel" -LICENSE = "GPLv2+ | BSD-2-Clause" +LICENSE = "GPL-2.0-or-later | BSD-2-Clause" LIC_FILES_CHKSUM = "file://gnuefi/crt0-efi-arm.S;beginline=4;endline=16;md5=e582764a4776e60c95bf9ab617343d36 \ file://gnuefi/crt0-efi-aarch64.S;beginline=4;endline=16;md5=e582764a4776e60c95bf9ab617343d36 \ file://inc/efishellintf.h;beginline=13;endline=20;md5=202766b79d708eff3cc70fce15fb80c7 \ - file://inc/efishellparm.h;beginline=4;endline=11;md5=468b1231b05bbc84bae3a0d5774e3bb5 \ file://lib/arm/math.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \ file://lib/arm/initplat.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \ file://lib/aarch64/math.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \ @@ -15,17 +14,17 @@ LIC_FILES_CHKSUM = "file://gnuefi/crt0-efi-arm.S;beginline=4;endline=16;md5=e582 SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/files/${BP}.tar.bz2 \ file://parallel-make-archives.patch \ - file://lib-Makefile-fix-parallel-issue.patch \ file://gnu-efi-3.0.9-fix-clang-build.patch \ + file://0001-riscv64-adjust-type-definitions.patch \ + file://0001-riscv64-ignore-unknown-relocs.patch \ + file://no-werror.patch \ " +SRC_URI[sha256sum] = "7807e903349343a7a142ebb934703a2872235e89688cf586c032b0a1087bcaf4" -SRC_URI[md5sum] = "926763ff37bc9db3a9035cec41eb2f45" -SRC_URI[sha256sum] = "0196f2e1fd3c334b66e610a608a0e59233474c7a01bec7bc53989639aa327669" +COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*|riscv64.*)-linux" +COMPATIBLE_HOST:armv4 = 'null' -COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*)-linux" -COMPATIBLE_HOST_armv4 = 'null' - -do_configure_linux-gnux32_prepend() { +do_configure:linux-gnux32:prepend() { cp ${STAGING_INCDIR}/gnu/stubs-x32.h ${STAGING_INCDIR}/gnu/stubs-64.h cp ${STAGING_INCDIR}/bits/long-double-32.h ${STAGING_INCDIR}/bits/long-double-64.h } @@ -37,6 +36,10 @@ def gnu_efi_arch(d): return "ia32" return tarch +do_compile:prepend() { + unset LDFLAGS +} + EXTRA_OEMAKE = "'ARCH=${@gnu_efi_arch(d)}' 'CC=${CC}' 'AS=${AS}' 'LD=${LD}' 'AR=${AR}' \ 'RANLIB=${RANLIB}' 'OBJCOPY=${OBJCOPY}' 'PREFIX=${prefix}' 'LIBDIR=${libdir}' \ " @@ -49,18 +52,18 @@ do_install() { oe_runmake install INSTALLROOT="${D}" } -FILES_${PN} += "${libdir}/*.lds" +FILES:${PN} += "${libdir}/*.lds ${libdir}/gnuefi/apps" # 64-bit binaries are expected for EFI when targeting X32 -INSANE_SKIP_${PN}-dev_append_linux-gnux32 = " arch" -INSANE_SKIP_${PN}-dev_append_linux-muslx32 = " arch" +INSANE_SKIP:${PN}-dev:append:linux-gnux32 = " arch" +INSANE_SKIP:${PN}-dev:append:linux-muslx32 = " arch" BBCLASSEXTEND = "native" # It doesn't support sse, its make.defaults sets: # CFLAGS += -mno-mmx -mno-sse # So also remove -mfpmath=sse from TUNE_CCARGS -TUNE_CCARGS_remove = "-mfpmath=sse" +TUNE_CCARGS:remove = "-mfpmath=sse" python () { ccargs = d.getVar('TUNE_CCARGS').split() diff --git a/meta/recipes-bsp/grub/files/0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch b/meta/recipes-bsp/grub/files/0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch index 6b73878cc0..05a4697a73 100644 --- a/meta/recipes-bsp/grub/files/0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch +++ b/meta/recipes-bsp/grub/files/0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch @@ -1,4 +1,4 @@ -From 96d9aa55d29b24e2490d5647a9efc66940fc400f Mon Sep 17 00:00:00 2001 +From 006799e9c4babe8a8340a24501b253e759614a2d Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 13 Jan 2016 19:17:31 +0000 Subject: [PATCH] Disable -mfpmath=sse as well when SSE is disabled @@ -24,15 +24,16 @@ Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> Upstream-Status: Pending + --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac -index 7656f24..0868ea9 100644 +index cd667a2..8263876 100644 --- a/configure.ac +++ b/configure.ac -@@ -824,7 +824,7 @@ fi +@@ -846,7 +846,7 @@ fi if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$platform" != xemu; then # Some toolchains enable these features by default, but they need # registers that aren't set up properly in GRUB. @@ -40,4 +41,4 @@ index 7656f24..0868ea9 100644 + TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow -mfpmath=387" fi - # GRUB doesn't use float or doubles at all. Yet some toolchains may decide + if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ); then diff --git a/meta/recipes-bsp/grub/files/0001-RISC-V-Restore-the-typcast-to-long.patch b/meta/recipes-bsp/grub/files/0001-RISC-V-Restore-the-typcast-to-long.patch index 2f15a91f68..cafa711731 100644 --- a/meta/recipes-bsp/grub/files/0001-RISC-V-Restore-the-typcast-to-long.patch +++ b/meta/recipes-bsp/grub/files/0001-RISC-V-Restore-the-typcast-to-long.patch @@ -1,4 +1,4 @@ -From e4c41db74b8972285cbdfe614c95c1ffd97d70e1 Mon Sep 17 00:00:00 2001 +From b47029e8e582d17c6874d2622fe1a5b834377dbb Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Fri, 26 Mar 2021 11:59:43 -0700 Subject: [PATCH] RISC-V: Restore the typcast to 64bit type @@ -17,15 +17,16 @@ Cc: Daniel Kiper <daniel.kiper@oracle.com> Cc: Chester Lin <clin@suse.com> Cc: Nikita Ermakov <arei@altlinux.org> Cc: Alistair Francis <alistair.francis@wdc.com> + --- util/grub-mkimagexx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c -index 00f49ccaa..ac677d03d 100644 +index e50b295..2f09255 100644 --- a/util/grub-mkimagexx.c +++ b/util/grub-mkimagexx.c -@@ -1242,7 +1242,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct section_metadata *smd, +@@ -1310,7 +1310,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct section_metadata *smd, */ sym_addr += addend; @@ -34,6 +35,3 @@ index 00f49ccaa..ac677d03d 100644 switch (ELF_R_TYPE (info)) { --- -2.31.1 - diff --git a/meta/recipes-bsp/grub/files/0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch b/meta/recipes-bsp/grub/files/0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch index 69b04aa56f..69dec7695a 100644 --- a/meta/recipes-bsp/grub/files/0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch +++ b/meta/recipes-bsp/grub/files/0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch @@ -1,4 +1,4 @@ -From 8f47ed4aaefba087b6ca76e59c9f832b6a0702bc Mon Sep 17 00:00:00 2001 +From a80592e20f6c4b928a22862f52f268ab9d9908b2 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 13 Jan 2016 19:28:00 +0000 Subject: [PATCH] grub.d/10_linux.in: add oe's kernel name @@ -20,10 +20,10 @@ Upstream-Status: Inappropriate [OE specific] 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 4532266..cba2617 100644 +index cc393be..8545cb6 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -164,12 +164,12 @@ machine=`uname -m` +@@ -166,12 +166,12 @@ machine=`uname -m` case "x$machine" in xi?86 | xx86_64) list= @@ -40,10 +40,10 @@ index 4532266..cba2617 100644 done ;; esac diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in -index 96179ea..98d16ae 100644 +index 94dd8be..36cd554 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in -@@ -154,7 +154,7 @@ EOF +@@ -181,7 +181,7 @@ EOF } linux_list= diff --git a/meta/recipes-bsp/grub/files/autogen.sh-exclude-pc.patch b/meta/recipes-bsp/grub/files/autogen.sh-exclude-pc.patch index 1323a54a59..f8dfda90ab 100644 --- a/meta/recipes-bsp/grub/files/autogen.sh-exclude-pc.patch +++ b/meta/recipes-bsp/grub/files/autogen.sh-exclude-pc.patch @@ -1,4 +1,4 @@ -From 8790aa8bea736f52341a0430ff3e317d3be0f99b Mon Sep 17 00:00:00 2001 +From 14c1d0459fb3561e627d3a5f6e91a0d2f7b4aa45 Mon Sep 17 00:00:00 2001 From: Naveen Saini <naveen.kumar.saini@intel.com> Date: Mon, 15 Mar 2021 14:44:15 +0800 Subject: [PATCH] autogen.sh: exclude .pc from po/POTFILES.in @@ -14,15 +14,16 @@ Upstream-Status: Inappropriate [OE specific] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> + --- autogen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogen.sh b/autogen.sh -index 31b0ced7e..c63ae766c 100755 +index 195daa5..773b7b4 100755 --- a/autogen.sh +++ b/autogen.sh -@@ -13,7 +13,7 @@ fi +@@ -26,7 +26,7 @@ fi export LC_COLLATE=C unset LC_ALL @@ -31,6 +32,3 @@ index 31b0ced7e..c63ae766c 100755 find util -iname '*.in' ! -name Makefile.in |sort > po/POTFILES-shell.in echo "Importing unicode..." --- -2.17.1 - diff --git a/meta/recipes-bsp/grub/files/determinism.patch b/meta/recipes-bsp/grub/files/determinism.patch deleted file mode 100644 index 2828e80975..0000000000 --- a/meta/recipes-bsp/grub/files/determinism.patch +++ /dev/null @@ -1,68 +0,0 @@ -From b6f9b3f6fa782807c4a7ec16ee8ef868cdfbf468 Mon Sep 17 00:00:00 2001 -From: Naveen Saini <naveen.kumar.saini@intel.com> -Date: Mon, 15 Mar 2021 14:56:18 +0800 -Subject: [PATCH] The output in moddep.lst generated from syminfo.lst using - genmoddep.awk is not deterministic since the order of the dependencies on - each line can vary depending on how awk sorts the values in the array. - -Be deterministic in the output by sorting the dependencies on each line. - -Also, the output of the SOURCES lines in grub-core/Makefile.core.am, generated -from grub-core/Makefile.core.def with gentpl.py is not deterministic due to -missing sorting of the list used to generate it. Add such a sort. - -Also ensure the generated unidata.c file is deterministic by sorting the -keys of the dict. - -Upstream-Status: Pending -Richard Purdie <richard.purdie@linuxfoundation.org> -Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> ---- - gentpl.py | 1 + - grub-core/genmoddep.awk | 4 +++- - util/import_unicode.py | 2 +- - 3 files changed, 5 insertions(+), 2 deletions(-) - -diff --git a/gentpl.py b/gentpl.py -index c86550d4f..589285192 100644 ---- a/gentpl.py -+++ b/gentpl.py -@@ -568,6 +568,7 @@ def foreach_platform_value(defn, platform, suffix, closure): - for group in RMAP[platform]: - for value in defn.find_all(group + suffix): - r.append(closure(value)) -+ r.sort() - return ''.join(r) - - def platform_conditional(platform, closure): -diff --git a/grub-core/genmoddep.awk b/grub-core/genmoddep.awk -index 04c2863e5..247436392 100644 ---- a/grub-core/genmoddep.awk -+++ b/grub-core/genmoddep.awk -@@ -59,7 +59,9 @@ END { - } - modlist = "" - depcount[mod] = 0 -- for (depmod in uniqmods) { -+ n = asorti(uniqmods, w) -+ for (i = 1; i <= n; i++) { -+ depmod = w[i] - modlist = modlist " " depmod; - inverse_dependencies[depmod] = inverse_dependencies[depmod] " " mod - depcount[mod]++ -diff --git a/util/import_unicode.py b/util/import_unicode.py -index 08f80591e..1f434a069 100644 ---- a/util/import_unicode.py -+++ b/util/import_unicode.py -@@ -174,7 +174,7 @@ infile.close () - - outfile.write ("struct grub_unicode_arabic_shape grub_unicode_arabic_shapes[] = {\n ") - --for x in arabicsubst: -+for x in sorted(arabicsubst): - try: - if arabicsubst[x]['join'] == "DUAL": - outfile.write ("{0x%x, 0x%x, 0x%x, 0x%x, 0x%x},\n " % (arabicsubst[x][0], arabicsubst[x][1], arabicsubst[x][2], arabicsubst[x][3], arabicsubst[x][4])) --- -2.17.1 - diff --git a/meta/recipes-bsp/grub/files/grub-module-explicitly-keeps-symbole-.module_license.patch b/meta/recipes-bsp/grub/files/grub-module-explicitly-keeps-symbole-.module_license.patch index 26890261b7..d9012d1dd6 100644 --- a/meta/recipes-bsp/grub/files/grub-module-explicitly-keeps-symbole-.module_license.patch +++ b/meta/recipes-bsp/grub/files/grub-module-explicitly-keeps-symbole-.module_license.patch @@ -1,4 +1,4 @@ -From 917133acc701dbc4636165d3b08d15dc5829a06f Mon Sep 17 00:00:00 2001 +From b316ed326bd492106006d78f5bfcd767b49a4f2e Mon Sep 17 00:00:00 2001 From: Hongxu Jia <hongxu.jia@windriver.com> Date: Wed, 17 Aug 2016 04:06:34 -0400 Subject: [PATCH] grub module explicitly keeps symbole .module_license @@ -8,7 +8,7 @@ it stripped symbol table: --------------- root@localhost:~# objdump -t all_video.mod - + all_video.mod: file format elf64-x86-64 SYMBOL TABLE: @@ -40,12 +40,13 @@ SYMBOL TABLE: Upstream-Status: Pending Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + --- grub-core/genmod.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in -index 1250589..dd14308 100644 +index e57c4d9..42bb1ba 100644 --- a/grub-core/genmod.sh.in +++ b/grub-core/genmod.sh.in @@ -56,7 +56,7 @@ if test x@TARGET_APPLE_LINKER@ != x1; then diff --git a/meta/recipes-bsp/grub/grub-bootconf_1.00.bb b/meta/recipes-bsp/grub/grub-bootconf_1.00.bb index 572580313b..783e30bf38 100644 --- a/meta/recipes-bsp/grub/grub-bootconf_1.00.bb +++ b/meta/recipes-bsp/grub/grub-bootconf_1.00.bb @@ -5,7 +5,7 @@ DESCRIPTION = "Grub might require different configuration file for \ different machines." HOMEPAGE = "https://www.gnu.org/software/grub/manual/grub/grub.html#Configuration" -RPROVIDES_${PN} += "virtual/grub-bootconf" +RPROVIDES:${PN} += "virtual-grub-bootconf" inherit grub-efi-cfg @@ -29,4 +29,4 @@ do_install() { install grub-bootconf ${D}${EFI_FILES_PATH}/grub.cfg } -FILES_${PN} = "${EFI_FILES_PATH}/grub.cfg" +FILES:${PN} = "${EFI_FILES_PATH}/grub.cfg" diff --git a/meta/recipes-bsp/grub/grub-efi_git.bb b/meta/recipes-bsp/grub/grub-efi_2.12.bb index 240fde7dbf..9857e8e036 100644 --- a/meta/recipes-bsp/grub/grub-efi_git.bb +++ b/meta/recipes-bsp/grub/grub-efi_2.12.bb @@ -4,13 +4,15 @@ require conf/image-uefi.conf GRUBPLATFORM = "efi" -DEPENDS_append = " grub-native" -RDEPENDS_${PN} = "grub-common virtual/grub-bootconf" +DEPENDS:append = " grub-native" +RDEPENDS:${PN} = "grub-common virtual-grub-bootconf" SRC_URI += " \ file://cfg \ " +S = "${WORKDIR}/grub-${PV}" + # Determine the target arch for the grub modules python __anonymous () { import re @@ -44,11 +46,21 @@ EXTRA_OECONF += "--enable-efiemu=no" do_mkimage() { cd ${B} + + GRUB_MKIMAGE_MODULES="${GRUB_BUILDIN}" + + # If 'all' is included in GRUB_BUILDIN we will include all available grub2 modules + if [ "${@ bb.utils.contains('GRUB_BUILDIN', 'all', 'True', 'False', d)}" = "True" ]; then + bbdebug 1 "Including all available modules" + # Get the list of all .mod files in grub-core build directory + GRUB_MKIMAGE_MODULES=$(find ${B}/grub-core/ -type f -name "*.mod" -exec basename {} .mod \;) + fi + # Search for the grub.cfg on the local boot media by using the # built in cfg file provided via this recipe - grub-mkimage -c ../cfg -p ${EFIDIR} -d ./grub-core/ \ + grub-mkimage -v -c ../cfg -p ${EFIDIR} -d ./grub-core/ \ -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} \ - ${GRUB_BUILDIN} + ${GRUB_MKIMAGE_MODULES} } addtask mkimage before do_install after do_compile @@ -68,22 +80,26 @@ do_install() { install -m 644 ${B}/${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} ${D}${EFI_FILES_PATH}/${GRUB_IMAGE} } +# To include all available modules, add 'all' to GRUB_BUILDIN GRUB_BUILDIN ?= "boot linux ext2 fat serial part_msdos part_gpt normal \ efi_gop iso9660 configfile search loadenv test" +# 'xen_boot' is a module valid only for aarch64 +GRUB_BUILDIN:append:aarch64 = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' xen_boot', '', d)}" + do_deploy() { install -m 644 ${B}/${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} ${DEPLOYDIR} } addtask deploy after do_install before do_build -FILES_${PN} = "${libdir}/grub/${GRUB_TARGET}-efi \ +FILES:${PN} = "${libdir}/grub/${GRUB_TARGET}-efi \ ${datadir}/grub \ ${EFI_FILES_PATH}/${GRUB_IMAGE} \ " # 64-bit binaries are expected for the bootloader with an x32 userland -INSANE_SKIP_${PN}_append_linux-gnux32 = " arch" -INSANE_SKIP_${PN}-dbg_append_linux-gnux32 = " arch" -INSANE_SKIP_${PN}_append_linux-muslx32 = " arch" -INSANE_SKIP_${PN}-dbg_append_linux-muslx32 = " arch" +INSANE_SKIP:${PN}:append:linux-gnux32 = " arch" +INSANE_SKIP:${PN}-dbg:append:linux-gnux32 = " arch" +INSANE_SKIP:${PN}:append:linux-muslx32 = " arch" +INSANE_SKIP:${PN}-dbg:append:linux-muslx32 = " arch" diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc index 590deb8d92..bb9aacb478 100644 --- a/meta/recipes-bsp/grub/grub2.inc +++ b/meta/recipes-bsp/grub/grub2.inc @@ -8,47 +8,51 @@ standard, which allows for flexible loading of multiple boot images." HOMEPAGE = "http://www.gnu.org/software/grub/" SECTION = "bootloaders" -LICENSE = "GPLv3" +LICENSE = "GPL-3.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" CVE_PRODUCT = "grub2" -SRC_URI = "https://alpha.gnu.org/gnu/grub/grub-${REALPV}.tar.xz \ +SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \ file://0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch \ file://autogen.sh-exclude-pc.patch \ file://grub-module-explicitly-keeps-symbole-.module_license.patch \ file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \ - file://determinism.patch \ file://0001-RISC-V-Restore-the-typcast-to-long.patch \ " -SRC_URI[sha256sum] = "2c87f1f21e2ab50043e6cd9163c08f1b6c3a6171556bf23ff9ed65b074145484" +SRC_URI[sha256sum] = "b30919fa5be280417c17ac561bb1650f60cfb80cc6237fa1e2b6f56154cb9c91" -REALPV = "2.06~rc1" -PV = "2.04+${REALPV}" - -S = "${WORKDIR}/grub-${REALPV}" - -UPSTREAM_CHECK_URI = "${GNU_MIRROR}/grub" -UPSTREAM_CHECK_REGEX = "grub-(?P<pver>\d+(\.\d+)+)\.tar\.(gz|xz)" +CVE_STATUS[CVE-2019-14865] = "not-applicable-platform: applies only to RHEL" +CVE_STATUS[CVE-2021-46705] = "not-applicable-platform: Applies only to SUSE" +CVE_STATUS[CVE-2023-4001] = "not-applicable-platform: Applies only to RHEL/Fedora" +CVE_STATUS[CVE-2024-1048] = "not-applicable-platform: Applies only to RHEL/Fedora" +CVE_STATUS[CVE-2023-4692] = "cpe-incorrect: Fixed in version 2.12 already" +CVE_STATUS[CVE-2023-4693] = "cpe-incorrect: Fixed in version 2.12 already" DEPENDS = "flex-native bison-native gettext-native" -COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|riscv.*)-(linux.*|freebsd.*)' -COMPATIBLE_HOST_armv7a = 'null' -COMPATIBLE_HOST_armv7ve = 'null' +GRUB_COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|riscv.*)-(linux.*|freebsd.*)' +COMPATIBLE_HOST = "${GRUB_COMPATIBLE_HOST}" +# Grub doesn't support hard float toolchain and won't be able to forcefully +# disable it on some of the target CPUs. See 'configure.ac' for +# supported/unsupported CPUs in hardfp. +COMPATIBLE_HOST:armv7a = "${@'null' if bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', True, False, d) else d.getVar('GRUB_COMPATIBLE_HOST')}" +COMPATIBLE_HOST:armv7ve = "${@'null' if bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', True, False, d) else d.getVar('GRUB_COMPATIBLE_HOST')}" # configure.ac has code to set this automagically from the target tuple # but the OE freeform one (core2-foo-bar-linux) don't work with that. -GRUBPLATFORM_arm = "efi" -GRUBPLATFORM_aarch64 = "efi" -GRUBPLATFORM_riscv32 = "efi" -GRUBPLATFORM_riscv64 = "efi" +GRUBPLATFORM:arm = "efi" +GRUBPLATFORM:aarch64 = "efi" +GRUBPLATFORM:riscv32 = "efi" +GRUBPLATFORM:riscv64 = "efi" GRUBPLATFORM ??= "pc" inherit autotools gettext texinfo pkgconfig +CFLAGS:remove = "-O2" + EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} \ --disable-grub-mkfont \ --program-prefix="" \ @@ -73,8 +77,13 @@ BUILD_LDFLAGS = "" export PYTHON = "python3" -do_configure_prepend() { +do_configure:prepend() { cd ${S} + + # Remove in next version. + # See: https://git.savannah.gnu.org/cgit/grub.git/commit/?id=b835601c7639ed1890f2d3db91900a8506011a8e + echo "depends bli part_gpt" > ${S}/grub-core/extra_deps.lst + FROM_BOOTSTRAP=1 ${S}/autogen.sh cd ${B} } diff --git a/meta/recipes-bsp/grub/grub_git.bb b/meta/recipes-bsp/grub/grub_2.12.bb index d4e09faa40..05d462785c 100644 --- a/meta/recipes-bsp/grub/grub_git.bb +++ b/meta/recipes-bsp/grub/grub_2.12.bb @@ -1,24 +1,24 @@ require grub2.inc -RDEPENDS_${PN}-common += "${PN}-editenv" -RDEPENDS_${PN} += "${PN}-common" -RDEPENDS_${PN}_class-native = "" +RDEPENDS:${PN}-common += "${PN}-editenv" +RDEPENDS:${PN} += "${PN}-common" +RDEPENDS:${PN}:class-native = "" -RPROVIDES_${PN}-editenv += "${PN}-efi-editenv" +RPROVIDES:${PN}-editenv += "${PN}-efi-editenv" -PROVIDES_append_class-native = " grub-efi-native" +PROVIDES:append:class-native = " grub-efi-native" PACKAGES =+ "${PN}-editenv ${PN}-common" -FILES_${PN}-editenv = "${bindir}/grub-editenv" -FILES_${PN}-common = " \ +FILES:${PN}-editenv = "${bindir}/grub-editenv" +FILES:${PN}-common = " \ ${bindir} \ ${sysconfdir} \ ${sbindir} \ ${datadir}/grub \ " -ALLOW_EMPTY_${PN} = "1" +ALLOW_EMPTY:${PN} = "1" -do_install_append () { +do_install:append () { # Avoid conflicts with the EFI package for systems such as arm64 where we # need to build grub and grub-efi but only EFI is supported by removing EFI # from this package. @@ -35,7 +35,7 @@ do_install_append () { {} + } -INSANE_SKIP_${PN} = "arch" -INSANE_SKIP_${PN}-dbg = "arch" +INSANE_SKIP:${PN} = "arch" +INSANE_SKIP:${PN}-dbg = "arch" BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-bsp/keymaps/files/GPLv2.patch b/meta/recipes-bsp/keymaps/files/GPLv2.patch deleted file mode 100644 index 1ee8181f12..0000000000 --- a/meta/recipes-bsp/keymaps/files/GPLv2.patch +++ /dev/null @@ -1,347 +0,0 @@ -Upstream-Status: Inappropriate [licensing] - -diff --git a/COPYING b/COPYING -new file mode 100644 -index 0000000..d511905 ---- /dev/null -+++ b/COPYING -@@ -0,0 +1,339 @@ -+ GNU GENERAL PUBLIC LICENSE -+ Version 2, June 1991 -+ -+ Copyright (C) 1989, 1991 Free Software Foundation, Inc., -+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ Everyone is permitted to copy and distribute verbatim copies -+ of this license document, but changing it is not allowed. -+ -+ Preamble -+ -+ The licenses for most software are designed to take away your -+freedom to share and change it. By contrast, the GNU General Public -+License is intended to guarantee your freedom to share and change free -+software--to make sure the software is free for all its users. This -+General Public License applies to most of the Free Software -+Foundation's software and to any other program whose authors commit to -+using it. (Some other Free Software Foundation software is covered by -+the GNU Lesser General Public License instead.) You can apply it to -+your programs, too. -+ -+ When we speak of free software, we are referring to freedom, not -+price. Our General Public Licenses are designed to make sure that you -+have the freedom to distribute copies of free software (and charge for -+this service if you wish), that you receive source code or can get it -+if you want it, that you can change the software or use pieces of it -+in new free programs; and that you know you can do these things. -+ -+ To protect your rights, we need to make restrictions that forbid -+anyone to deny you these rights or to ask you to surrender the rights. -+These restrictions translate to certain responsibilities for you if you -+distribute copies of the software, or if you modify it. -+ -+ For example, if you distribute copies of such a program, whether -+gratis or for a fee, you must give the recipients all the rights that -+you have. You must make sure that they, too, receive or can get the -+source code. And you must show them these terms so they know their -+rights. -+ -+ We protect your rights with two steps: (1) copyright the software, and -+(2) offer you this license which gives you legal permission to copy, -+distribute and/or modify the software. -+ -+ Also, for each author's protection and ours, we want to make certain -+that everyone understands that there is no warranty for this free -+software. If the software is modified by someone else and passed on, we -+want its recipients to know that what they have is not the original, so -+that any problems introduced by others will not reflect on the original -+authors' reputations. -+ -+ Finally, any free program is threatened constantly by software -+patents. We wish to avoid the danger that redistributors of a free -+program will individually obtain patent licenses, in effect making the -+program proprietary. To prevent this, we have made it clear that any -+patent must be licensed for everyone's free use or not licensed at all. -+ -+ The precise terms and conditions for copying, distribution and -+modification follow. -+ -+ GNU GENERAL PUBLIC LICENSE -+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION -+ -+ 0. This License applies to any program or other work which contains -+a notice placed by the copyright holder saying it may be distributed -+under the terms of this General Public License. The "Program", below, -+refers to any such program or work, and a "work based on the Program" -+means either the Program or any derivative work under copyright law: -+that is to say, a work containing the Program or a portion of it, -+either verbatim or with modifications and/or translated into another -+language. (Hereinafter, translation is included without limitation in -+the term "modification".) Each licensee is addressed as "you". -+ -+Activities other than copying, distribution and modification are not -+covered by this License; they are outside its scope. The act of -+running the Program is not restricted, and the output from the Program -+is covered only if its contents constitute a work based on the -+Program (independent of having been made by running the Program). -+Whether that is true depends on what the Program does. -+ -+ 1. You may copy and distribute verbatim copies of the Program's -+source code as you receive it, in any medium, provided that you -+conspicuously and appropriately publish on each copy an appropriate -+copyright notice and disclaimer of warranty; keep intact all the -+notices that refer to this License and to the absence of any warranty; -+and give any other recipients of the Program a copy of this License -+along with the Program. -+ -+You may charge a fee for the physical act of transferring a copy, and -+you may at your option offer warranty protection in exchange for a fee. -+ -+ 2. You may modify your copy or copies of the Program or any portion -+of it, thus forming a work based on the Program, and copy and -+distribute such modifications or work under the terms of Section 1 -+above, provided that you also meet all of these conditions: -+ -+ a) You must cause the modified files to carry prominent notices -+ stating that you changed the files and the date of any change. -+ -+ b) You must cause any work that you distribute or publish, that in -+ whole or in part contains or is derived from the Program or any -+ part thereof, to be licensed as a whole at no charge to all third -+ parties under the terms of this License. -+ -+ c) If the modified program normally reads commands interactively -+ when run, you must cause it, when started running for such -+ interactive use in the most ordinary way, to print or display an -+ announcement including an appropriate copyright notice and a -+ notice that there is no warranty (or else, saying that you provide -+ a warranty) and that users may redistribute the program under -+ these conditions, and telling the user how to view a copy of this -+ License. (Exception: if the Program itself is interactive but -+ does not normally print such an announcement, your work based on -+ the Program is not required to print an announcement.) -+ -+These requirements apply to the modified work as a whole. If -+identifiable sections of that work are not derived from the Program, -+and can be reasonably considered independent and separate works in -+themselves, then this License, and its terms, do not apply to those -+sections when you distribute them as separate works. But when you -+distribute the same sections as part of a whole which is a work based -+on the Program, the distribution of the whole must be on the terms of -+this License, whose permissions for other licensees extend to the -+entire whole, and thus to each and every part regardless of who wrote it. -+ -+Thus, it is not the intent of this section to claim rights or contest -+your rights to work written entirely by you; rather, the intent is to -+exercise the right to control the distribution of derivative or -+collective works based on the Program. -+ -+In addition, mere aggregation of another work not based on the Program -+with the Program (or with a work based on the Program) on a volume of -+a storage or distribution medium does not bring the other work under -+the scope of this License. -+ -+ 3. You may copy and distribute the Program (or a work based on it, -+under Section 2) in object code or executable form under the terms of -+Sections 1 and 2 above provided that you also do one of the following: -+ -+ a) Accompany it with the complete corresponding machine-readable -+ source code, which must be distributed under the terms of Sections -+ 1 and 2 above on a medium customarily used for software interchange; or, -+ -+ b) Accompany it with a written offer, valid for at least three -+ years, to give any third party, for a charge no more than your -+ cost of physically performing source distribution, a complete -+ machine-readable copy of the corresponding source code, to be -+ distributed under the terms of Sections 1 and 2 above on a medium -+ customarily used for software interchange; or, -+ -+ c) Accompany it with the information you received as to the offer -+ to distribute corresponding source code. (This alternative is -+ allowed only for noncommercial distribution and only if you -+ received the program in object code or executable form with such -+ an offer, in accord with Subsection b above.) -+ -+The source code for a work means the preferred form of the work for -+making modifications to it. For an executable work, complete source -+code means all the source code for all modules it contains, plus any -+associated interface definition files, plus the scripts used to -+control compilation and installation of the executable. However, as a -+special exception, the source code distributed need not include -+anything that is normally distributed (in either source or binary -+form) with the major components (compiler, kernel, and so on) of the -+operating system on which the executable runs, unless that component -+itself accompanies the executable. -+ -+If distribution of executable or object code is made by offering -+access to copy from a designated place, then offering equivalent -+access to copy the source code from the same place counts as -+distribution of the source code, even though third parties are not -+compelled to copy the source along with the object code. -+ -+ 4. You may not copy, modify, sublicense, or distribute the Program -+except as expressly provided under this License. Any attempt -+otherwise to copy, modify, sublicense or distribute the Program is -+void, and will automatically terminate your rights under this License. -+However, parties who have received copies, or rights, from you under -+this License will not have their licenses terminated so long as such -+parties remain in full compliance. -+ -+ 5. You are not required to accept this License, since you have not -+signed it. However, nothing else grants you permission to modify or -+distribute the Program or its derivative works. These actions are -+prohibited by law if you do not accept this License. Therefore, by -+modifying or distributing the Program (or any work based on the -+Program), you indicate your acceptance of this License to do so, and -+all its terms and conditions for copying, distributing or modifying -+the Program or works based on it. -+ -+ 6. Each time you redistribute the Program (or any work based on the -+Program), the recipient automatically receives a license from the -+original licensor to copy, distribute or modify the Program subject to -+these terms and conditions. You may not impose any further -+restrictions on the recipients' exercise of the rights granted herein. -+You are not responsible for enforcing compliance by third parties to -+this License. -+ -+ 7. If, as a consequence of a court judgment or allegation of patent -+infringement or for any other reason (not limited to patent issues), -+conditions are imposed on you (whether by court order, agreement or -+otherwise) that contradict the conditions of this License, they do not -+excuse you from the conditions of this License. If you cannot -+distribute so as to satisfy simultaneously your obligations under this -+License and any other pertinent obligations, then as a consequence you -+may not distribute the Program at all. For example, if a patent -+license would not permit royalty-free redistribution of the Program by -+all those who receive copies directly or indirectly through you, then -+the only way you could satisfy both it and this License would be to -+refrain entirely from distribution of the Program. -+ -+If any portion of this section is held invalid or unenforceable under -+any particular circumstance, the balance of the section is intended to -+apply and the section as a whole is intended to apply in other -+circumstances. -+ -+It is not the purpose of this section to induce you to infringe any -+patents or other property right claims or to contest validity of any -+such claims; this section has the sole purpose of protecting the -+integrity of the free software distribution system, which is -+implemented by public license practices. Many people have made -+generous contributions to the wide range of software distributed -+through that system in reliance on consistent application of that -+system; it is up to the author/donor to decide if he or she is willing -+to distribute software through any other system and a licensee cannot -+impose that choice. -+ -+This section is intended to make thoroughly clear what is believed to -+be a consequence of the rest of this License. -+ -+ 8. If the distribution and/or use of the Program is restricted in -+certain countries either by patents or by copyrighted interfaces, the -+original copyright holder who places the Program under this License -+may add an explicit geographical distribution limitation excluding -+those countries, so that distribution is permitted only in or among -+countries not thus excluded. In such case, this License incorporates -+the limitation as if written in the body of this License. -+ -+ 9. The Free Software Foundation may publish revised and/or new versions -+of the General Public License from time to time. Such new versions will -+be similar in spirit to the present version, but may differ in detail to -+address new problems or concerns. -+ -+Each version is given a distinguishing version number. If the Program -+specifies a version number of this License which applies to it and "any -+later version", you have the option of following the terms and conditions -+either of that version or of any later version published by the Free -+Software Foundation. If the Program does not specify a version number of -+this License, you may choose any version ever published by the Free Software -+Foundation. -+ -+ 10. If you wish to incorporate parts of the Program into other free -+programs whose distribution conditions are different, write to the author -+to ask for permission. For software which is copyrighted by the Free -+Software Foundation, write to the Free Software Foundation; we sometimes -+make exceptions for this. Our decision will be guided by the two goals -+of preserving the free status of all derivatives of our free software and -+of promoting the sharing and reuse of software generally. -+ -+ NO WARRANTY -+ -+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -+REPAIR OR CORRECTION. -+ -+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -+POSSIBILITY OF SUCH DAMAGES. -+ -+ END OF TERMS AND CONDITIONS -+ -+ How to Apply These Terms to Your New Programs -+ -+ If you develop a new program, and you want it to be of the greatest -+possible use to the public, the best way to achieve this is to make it -+free software which everyone can redistribute and change under these terms. -+ -+ To do so, attach the following notices to the program. It is safest -+to attach them to the start of each source file to most effectively -+convey the exclusion of warranty; and each file should have at least -+the "copyright" line and a pointer to where the full notice is found. -+ -+ <one line to give the program's name and a brief idea of what it does.> -+ Copyright (C) <year> <name of author> -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License along -+ with this program; if not, write to the Free Software Foundation, Inc., -+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -+ -+Also add information on how to contact you by electronic and paper mail. -+ -+If the program is interactive, make it output a short notice like this -+when it starts in an interactive mode: -+ -+ Gnomovision version 69, Copyright (C) year name of author -+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. -+ This is free software, and you are welcome to redistribute it -+ under certain conditions; type `show c' for details. -+ -+The hypothetical commands `show w' and `show c' should show the appropriate -+parts of the General Public License. Of course, the commands you use may -+be called something other than `show w' and `show c'; they could even be -+mouse-clicks or menu items--whatever suits your program. -+ -+You should also get your employer (if you work as a programmer) or your -+school, if any, to sign a "copyright disclaimer" for the program, if -+necessary. Here is a sample; alter the names: -+ -+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program -+ `Gnomovision' (which makes passes at compilers) written by James Hacker. -+ -+ <signature of Ty Coon>, 1 April 1989 -+ Ty Coon, President of Vice -+ -+This General Public License does not permit incorporating your program into -+proprietary programs. If your program is a subroutine library, you may -+consider it more useful to permit linking proprietary applications with the -+library. If this is what you want to do, use the GNU Lesser General -+Public License instead of this License. diff --git a/meta/recipes-bsp/keymaps/files/keymap.sh b/meta/recipes-bsp/keymaps/files/keymap.sh index 6ebc634266..26bda60408 100755 --- a/meta/recipes-bsp/keymaps/files/keymap.sh +++ b/meta/recipes-bsp/keymaps/files/keymap.sh @@ -1,6 +1,9 @@ #!/bin/sh # # load keymap, if existing +# +# SPDX-License-Identifier: GPL-2.0-only +# KERNEL_MAJMIN=`uname -r | cut -d '.' -f 1,2` if [ -e /etc/keymap-$KERNEL_MAJMIN.map ]; then diff --git a/meta/recipes-bsp/keymaps/keymaps_1.0.bb b/meta/recipes-bsp/keymaps/keymaps_1.0.bb index 24b13f920f..3d5d127820 100644 --- a/meta/recipes-bsp/keymaps/keymaps_1.0.bb +++ b/meta/recipes-bsp/keymaps/keymaps_1.0.bb @@ -2,12 +2,11 @@ SUMMARY = "Keyboard maps" DESCRIPTION = "Keymaps and initscript to set the keymap on bootup." SECTION = "base" -RDEPENDS_${PN} = "kbd" +RDEPENDS:${PN} = "kbd" -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://keymap.sh;beginline=5;endline=5;md5=829e563511c9a1d6d41f17a7a4989d6a" PACKAGE_ARCH = "${MACHINE_ARCH}" -PR = "r31" INHIBIT_DEFAULT_DEPS = "1" @@ -20,8 +19,7 @@ python __anonymous() { inherit update-rc.d -SRC_URI = "file://keymap.sh \ - file://GPLv2.patch" +SRC_URI = "file://keymap.sh" INITSCRIPT_NAME = "keymap.sh" INITSCRIPT_PARAMS = "start 01 S ." @@ -37,8 +35,8 @@ do_install () { fi } -PACKAGE_WRITE_DEPS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','systemd-systemctl-native','',d)}" -pkg_postinst_${PN} () { +PACKAGE_WRITE_DEPS:append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','systemd-systemctl-native','',d)}" +pkg_postinst:${PN} () { if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then if [ -n "$D" ]; then OPTS="--root=$D" @@ -47,4 +45,4 @@ pkg_postinst_${PN} () { fi } -ALLOW_EMPTY_${PN} = "1" +ALLOW_EMPTY:${PN} = "1" diff --git a/meta/recipes-bsp/libacpi/libacpi_0.2.bb b/meta/recipes-bsp/libacpi/libacpi_0.2.bb index fa9e3d4894..6aae34b310 100644 --- a/meta/recipes-bsp/libacpi/libacpi_0.2.bb +++ b/meta/recipes-bsp/libacpi/libacpi_0.2.bb @@ -5,7 +5,6 @@ SECTION = "base" HOMEPAGE = "http://www.ngolde.de/libacpi.html" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://LICENSE;md5=fec17f82f16630adf2dfb7d2a46f21c5" -PR = "r6" SRC_URI = "http://www.ngolde.de/download/libacpi-${PV}.tar.gz \ file://makefile-fix.patch \ @@ -22,7 +21,7 @@ UPSTREAM_CHECK_URI = "http://www.ngolde.de/libacpi.html" inherit lib_package -COMPATIBLE_HOST = '(x86_64|i.86).*-(linux|freebsd.*)' +COMPATIBLE_HOST = '(x86_64|i.86|aarch64).*-(linux|freebsd.*)' CFLAGS += "-fPIC" EXTRA_OEMAKE = '-e MAKEFLAGS= STRIP="echo"' diff --git a/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/0001-Fix-cross-compilation-using-autoconf-detected-AR.patch b/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/0001-Fix-cross-compilation-using-autoconf-detected-AR.patch index 47c7ec4170..c8f0e2c4fe 100644 --- a/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/0001-Fix-cross-compilation-using-autoconf-detected-AR.patch +++ b/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/0001-Fix-cross-compilation-using-autoconf-detected-AR.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Fix cross compilation using autoconf detected AR currently its using 'ar' program from build host, which is not expected, we need to respect AR passed in environment -Upstream-Status: Pending +Upstream-Status: Inappropriate [upstream hasn't been active since 1998] Signed-off-by: Khem Raj <raj.khem@gmail.com> --- diff --git a/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/autotools-update.patch b/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/autotools-update.patch index 33af38b4a8..ebd4a88081 100644 --- a/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/autotools-update.patch +++ b/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/autotools-update.patch @@ -1,6 +1,6 @@ Update autotools infrastructure (including gettext) to modern versions. -Upstream-Status: Pending +Upstream-Status: Inappropriate [upstream hasn't been active since 1998] Signed-off-by: Phil Blundell <pb@pbcl.net> diff -uprN clean/lrzsz-0.12.20/configure.in lrzsz-0.12.20/configure.in diff --git a/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb b/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb index 54c431eeb3..63edcbd864 100644 --- a/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb +++ b/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb @@ -5,12 +5,11 @@ These programs use error correcting protocols ({z,x,y}modem) to send (sz, sx, sb receive (rz, rx, rb) files over a dial-in serial port from a variety of programs \ running under various operating systems. " HOMEPAGE = "http://www.ohse.de/uwe/software/lrzsz.html" -LICENSE = "GPLv2+" +LICENSE = "GPL-2.0-or-later" LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \ file://src/lrz.c;beginline=1;endline=10;md5=5276956373ff7d8758837f6399a1045f" SECTION = "console/network" DEPENDS = "" -PR = "r6" SRC_URI = "http://www.ohse.de/uwe/releases/lrzsz-${PV}.tar.gz \ file://autotools-update.patch \ @@ -38,7 +37,7 @@ inherit update-alternatives ALTERNATIVE_PRIORITY = "100" -ALTERNATIVE_${PN} = "rz rx rb sz sx sb" +ALTERNATIVE:${PN} = "rz rx rb sz sx sb" ALTERNATIVE_TARGET[rz] = "${bindir}/lrz" ALTERNATIVE_TARGET[rx] = "${bindir}/lrz" diff --git a/meta/recipes-bsp/opensbi/files/0001-Makefile-Don-t-specify-mabi-or-march.patch b/meta/recipes-bsp/opensbi/files/0001-Makefile-Don-t-specify-mabi-or-march.patch deleted file mode 100644 index d2a8048e87..0000000000 --- a/meta/recipes-bsp/opensbi/files/0001-Makefile-Don-t-specify-mabi-or-march.patch +++ /dev/null @@ -1,36 +0,0 @@ -From fe9860fd85e49a75bef545e5d9914070491e8002 Mon Sep 17 00:00:00 2001 -From: Alistair Francis <alistair.francis@wdc.com> -Date: Fri, 15 Feb 2019 14:57:41 -0800 -Subject: [PATCH] Makefile: Don't specify mabi or march - -To avoid - can't link double-float modules with soft-float modules -errors when building 32-bit openSBI don't specify mabi or march. - -Upstream-Status: Inappropriate [Fixes a 32-bit OE flow bug] -Signed-off-by: Alistair Francis <alistair.francis@wdc.com> - ---- - Makefile | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/Makefile b/Makefile -index ccf8ea3..69e5b38 100644 ---- a/Makefile -+++ b/Makefile -@@ -169,7 +169,6 @@ GENFLAGS += $(firmware-genflags-y) - CFLAGS = -g -Wall -Werror -ffreestanding -nostdlib -fno-strict-aliasing -O2 - CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls - CFLAGS += -mno-save-restore -mstrict-align --CFLAGS += -mabi=$(PLATFORM_RISCV_ABI) -march=$(PLATFORM_RISCV_ISA) - CFLAGS += -mcmodel=$(PLATFORM_RISCV_CODE_MODEL) - CFLAGS += $(GENFLAGS) - CFLAGS += $(platform-cflags-y) -@@ -183,7 +182,6 @@ CPPFLAGS += $(firmware-cppflags-y) - ASFLAGS = -g -Wall -nostdlib -D__ASSEMBLY__ - ASFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls - ASFLAGS += -mno-save-restore -mstrict-align --ASFLAGS += -mabi=$(PLATFORM_RISCV_ABI) -march=$(PLATFORM_RISCV_ISA) - ASFLAGS += -mcmodel=$(PLATFORM_RISCV_CODE_MODEL) - ASFLAGS += $(GENFLAGS) - ASFLAGS += $(platform-asflags-y) diff --git a/meta/recipes-bsp/opensbi/opensbi-payloads.inc b/meta/recipes-bsp/opensbi/opensbi-payloads.inc index 2e32943245..a55679632e 100644 --- a/meta/recipes-bsp/opensbi/opensbi-payloads.inc +++ b/meta/recipes-bsp/opensbi/opensbi-payloads.inc @@ -1,21 +1,38 @@ def riscv_get_extra_oemake_image(d): sbi_payload = d.getVar('RISCV_SBI_PAYLOAD') - deploy_dir = d.getVar('DEPLOY_DIR_IMAGE') - if sbi_payload is None: return "" + deploy_dir = d.getVar('DEPLOY_DIR_IMAGE') + return "FW_PAYLOAD_PATH=" + deploy_dir + "/" + sbi_payload -def riscv_get_do_compile_depends(d): - sbi_payload = d.getVar('RISCV_SBI_PAYLOAD') +def riscv_get_extra_oemake_fdt(d): + if d.getVar('RISCV_SBI_PAYLOAD') is None: + return "" + sbi_fdt = d.getVar('RISCV_SBI_FDT') + deploy_dir = d.getVar('DEPLOY_DIR_IMAGE') - if sbi_payload is None: + if sbi_fdt is None: + return "" + + return "FW_FDT_PATH=" + deploy_dir + "/" + sbi_fdt + +def riscv_get_do_compile_depends(d): + sbi_payload = d.getVar('RISCV_SBI_PAYLOAD') or "" + if sbi_payload == "": return "" + sbi_fdt = d.getVar('RISCV_SBI_FDT') or "" + + if sbi_fdt != "" and 'u-boot.bin' in sbi_payload: + return "virtual/kernel:do_deploy virtual/bootloader:do_deploy" + if 'linux' in sbi_payload or 'Image' in sbi_payload: return "virtual/kernel:do_deploy" if 'u-boot.bin' in sbi_payload: return "virtual/bootloader:do_deploy" + if sbi_fdt != "": + return "virtual/kernel:do_deploy" return "" diff --git a/meta/recipes-bsp/opensbi/opensbi_0.9.bb b/meta/recipes-bsp/opensbi/opensbi_1.4.bb index cb1c3f2ebf..cf37a41176 100644 --- a/meta/recipes-bsp/opensbi/opensbi_0.9.bb +++ b/meta/recipes-bsp/opensbi/opensbi_1.4.bb @@ -8,21 +8,22 @@ require opensbi-payloads.inc inherit autotools-brokensep deploy -SRCREV = "234ed8e427f4d92903123199f6590d144e0d9351" -SRC_URI = "git://github.com/riscv/opensbi.git;branch=master \ - file://0001-Makefile-Don-t-specify-mabi-or-march.patch \ - " +SRCREV = "a2b255b88918715173942f2c5e1f97ac9e90c877" +SRC_URI = "git://github.com/riscv/opensbi.git;branch=master;protocol=https" S = "${WORKDIR}/git" -EXTRA_OEMAKE += "PLATFORM=${RISCV_SBI_PLAT} I=${D}" +TARGET_CC_ARCH += "${LDFLAGS}" + +EXTRA_OEMAKE += "PLATFORM=${RISCV_SBI_PLAT} I=${D} FW_PIC=y CLANG_TARGET= " # If RISCV_SBI_PAYLOAD is set then include it as a payload -EXTRA_OEMAKE_append = " ${@riscv_get_extra_oemake_image(d)}" +EXTRA_OEMAKE:append = " ${@riscv_get_extra_oemake_image(d)}" +EXTRA_OEMAKE:append = " ${@riscv_get_extra_oemake_fdt(d)}" # Required if specifying a custom payload do_compile[depends] += "${@riscv_get_do_compile_depends(d)}" -do_install_append() { +do_install:append() { # In the future these might be required as a dependency for other packages. # At the moment just delete them to avoid warnings rm -r ${D}/include @@ -38,11 +39,9 @@ do_deploy () { addtask deploy before do_build after do_install -FILES_${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_jump.*" -FILES_${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_payload.*" -FILES_${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_dynamic.*" +FILES:${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_jump.*" +FILES:${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_payload.*" +FILES:${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_dynamic.*" COMPATIBLE_HOST = "(riscv64|riscv32).*" INHIBIT_PACKAGE_STRIP = "1" - -SECURITY_CFLAGS = "" diff --git a/meta/recipes-bsp/pciutils/pciutils/configure.patch b/meta/recipes-bsp/pciutils/pciutils/configure.patch index e444c13975..5015cf4884 100644 --- a/meta/recipes-bsp/pciutils/pciutils/configure.patch +++ b/meta/recipes-bsp/pciutils/pciutils/configure.patch @@ -1,9 +1,14 @@ +From 561216c8cbc280aaa9aecf30cb11835a4a0a78ed Mon Sep 17 00:00:00 2001 +From: Richard Purdie <rpurdie@linux.intel.com> +Date: Wed, 31 Dec 2008 17:20:38 +0000 +Subject: [PATCH] pciutils: Upgarde 2.2.4 -> 3.0.3 + This patch: * ensures we link correctly * allows us to optionally pass target information to configure rather than using uname * select linux as the platform in most cases we care about -This is a merge of various tweaks to allow us to build pciutils including +This is a merge of various tweaks to allow us to build pciutils including work from: 7/30/2010 - Qing He <qing.he@intel.com> @@ -12,24 +17,28 @@ Ionut Radu <ionutx.radu@intel.com> 2017/6/15 - RP - Cleanups and merging patches Upstream-Status: Inappropriate [embedded specific] +--- + Makefile | 2 +- + lib/configure | 14 ++++++++++---- + 2 files changed, 11 insertions(+), 5 deletions(-) -Index: pciutils-3.5.6/Makefile -=================================================================== ---- pciutils-3.5.6.orig/Makefile -+++ pciutils-3.5.6/Makefile -@@ -96,7 +96,7 @@ example: example.o lib/$(PCILIB) - example.o: example.c $(PCIINC) +diff --git a/Makefile b/Makefile +index aaec04e..9c1dab0 100644 +--- a/Makefile ++++ b/Makefile +@@ -123,7 +123,7 @@ pcilmr$(EXEEXT): pcilmr.o $(LMROBJS) $(COMMON) lib/$(PCIIMPLIB) + pcilmr.o: pcilmr.c $(LMRINC) - %: %.o + %$(EXEEXT): %.o - $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LDLIBS) -o $@ + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LIB_LDLIBS) $(LDLIBS) -o $@ - %.8 %.7 %.5: %.man - M=`echo $(DATE) | sed 's/-01-/-January-/;s/-02-/-February-/;s/-03-/-March-/;s/-04-/-April-/;s/-05-/-May-/;s/-06-/-June-/;s/-07-/-July-/;s/-08-/-August-/;s/-09-/-September-/;s/-10-/-October-/;s/-11-/-November-/;s/-12-/-December-/;s/\(.*\)-\(.*\)-\(.*\)/\3 \2 \1/'` ; sed <$< >$@ "s/@TODAY@/$$M/;s/@VERSION@/pciutils-$(VERSION)/;s#@IDSDIR@#$(IDSDIR)#" -Index: pciutils-3.5.6/lib/configure -=================================================================== ---- pciutils-3.5.6.orig/lib/configure -+++ pciutils-3.5.6/lib/configure + ifdef PCI_OS_WINDOWS + comma := , +diff --git a/lib/configure b/lib/configure +index 3df057a..c87e71c 100755 +--- a/lib/configure ++++ b/lib/configure @@ -9,6 +9,10 @@ echo_n() { printf '%s' "$*" } @@ -38,7 +47,7 @@ Index: pciutils-3.5.6/lib/configure +IDSDIR=$2 +DNS=yes + - if [ -z "$VERSION" -o -z "$IDSDIR" ] ; then + if [ -z "$VERSION" ] ; then echo >&2 "Please run the configure script from the top-level Makefile" exit 1 @@ -16,8 +20,8 @@ fi @@ -56,12 +65,12 @@ Index: pciutils-3.5.6/lib/configure proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1` cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'` else -- cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'` -+ cpu=${4:-`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'`} +- cpu=`uname -m | sed 's/^i.86-AT386/i386/;s/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'` ++ cpu=${4:-`uname -m | sed 's/^i.86-AT386/i386/;s/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'`} fi - if [ "$sys" = "GNU/kFreeBSD" -o "$sys" = "DragonFly" ] + if [ "$sys" = "DragonFly" ] then -@@ -35,7 +39,7 @@ if [ -z "$HOST" ] ; then +@@ -43,7 +47,7 @@ if [ -z "$HOST" ] ; then then sys=cygwin fi @@ -70,7 +79,7 @@ Index: pciutils-3.5.6/lib/configure fi [ -n "$RELEASE" ] && rel="${RELEASE}" # CAVEAT: tr on Solaris is a bit weird and the extra [] is otherwise harmless. -@@ -44,6 +48,8 @@ cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +@@ -52,6 +56,8 @@ cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo " $host $rel $cpu $sys" diff --git a/meta/recipes-bsp/pciutils/pciutils_3.7.0.bb b/meta/recipes-bsp/pciutils/pciutils_3.11.1.bb index 4f0edc01ed..044074ccc3 100644 --- a/meta/recipes-bsp/pciutils/pciutils_3.7.0.bb +++ b/meta/recipes-bsp/pciutils/pciutils_3.11.1.bb @@ -4,16 +4,19 @@ to PCI bus configuration space and several utilities based on this library.' HOMEPAGE = "http://atrey.karlin.mff.cuni.cz/~mj/pciutils.shtml" SECTION = "console/utils" -LICENSE = "GPLv2+" +LICENSE = "GPL-2.0-or-later" LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" -DEPENDS = "zlib kmod" +# Can drop make-native when all systems have make 4.3 +# https://git.savannah.gnu.org/cgit/make.git/commit/?id=b90fabc8d6f34fb37d428dc0fb1b8b1951a9fbed +# causes space issues in lib/libpci.pc +DEPENDS = "zlib kmod make-native" SRC_URI = "${KERNELORG_MIRROR}/software/utils/pciutils/pciutils-${PV}.tar.xz \ file://configure.patch" -SRC_URI[sha256sum] = "9d40b97be8b6a2cdf96aead5a61881d1f7e4e0da9544a9bac4fba1ae9dcd40eb" +SRC_URI[sha256sum] = "3f472ad864473de5ba17f765cc96ef5f33e1b730918d3adda6f945a2a9290df4" -inherit multilib_header pkgconfig +inherit multilib_header pkgconfig update-alternatives PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'hwdb', '', d)}" PACKAGECONFIG[hwdb] = "HWDB=yes,HWDB=no,udev" @@ -46,14 +49,16 @@ do_install () { oe_runmake DESTDIR=${D} install install-lib install -d ${D}${bindir} - ln -s ../sbin/lspci ${D}${bindir}/lspci oe_multilib_header pci/config.h } PACKAGES =+ "${PN}-ids libpci" -FILES_${PN}-ids = "${datadir}/pci.ids*" -FILES_libpci = "${libdir}/libpci.so.*" -SUMMARY_${PN}-ids = "PCI utilities - device ID database" -DESCRIPTION_${PN}-ids = "Package providing the PCI device ID database for pciutils." -RDEPENDS_${PN} += "${PN}-ids" +FILES:${PN}-ids = "${datadir}/pci.ids*" +FILES:libpci = "${libdir}/libpci.so.*" +SUMMARY:${PN}-ids = "PCI utilities - device ID database" +DESCRIPTION:${PN}-ids = "Package providing the PCI device ID database for pciutils." +RDEPENDS:${PN} += "${PN}-ids" + +ALTERNATIVE:${PN} = "lspci" +ALTERNATIVE_PRIORITY = "100" diff --git a/meta/recipes-bsp/pm-utils/pm-utils_1.4.1.bb b/meta/recipes-bsp/pm-utils/pm-utils_1.4.1.bb index cac09101c4..c7b95e57b0 100644 --- a/meta/recipes-bsp/pm-utils/pm-utils_1.4.1.bb +++ b/meta/recipes-bsp/pm-utils/pm-utils_1.4.1.bb @@ -2,11 +2,10 @@ SECTION = "base" SUMMARY = "Utilities and scripts for power management" DESCRIPTION = "Simple shell command line tools to suspend and hibernate." HOMEPAGE = "http://pm-utils.freedesktop.org/wiki/" -LICENSE = "GPLv2" +LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ file://src/pm-pmu.c;beginline=1;endline=22;md5=3c1ddbc54e735fb4a0386e14c78a3147" -PR = "r1" SRC_URI = "http://pm-utils.freedesktop.org/releases/pm-utils-${PV}.tar.gz" @@ -17,11 +16,14 @@ inherit pkgconfig autotools manpages PACKAGECONFIG[manpages] = "--enable-doc, --disable-doc, libxslt-native xmlto-native" -RDEPENDS_${PN} = "grep bash" +RDEPENDS:${PN} = "bash" -do_configure_prepend () { +EXTRA_OECONF = "--libdir=${nonarch_libdir}" + +do_configure:prepend () { ( cd ${S}; autoreconf -f -i -s ) } -FILES_${PN} += "${libdir}/${BPN}/*" -FILES_${PN}-dbg += "${datadir}/doc/pm-utils/README.debugging" +FILES:${PN} += "${nonarch_libdir}/${BPN}/*" +FILES:${PN}-dbg += "${datadir}/doc/pm-utils/README.debugging" +FILES:${PN}-dev += "${nonarch_libdir}/pkgconfig/pm-utils.pc" diff --git a/meta/recipes-bsp/setserial/setserial/0001-setserial.c-Add-needed-system-headers-for-ioctl-and-.patch b/meta/recipes-bsp/setserial/setserial/0001-setserial.c-Add-needed-system-headers-for-ioctl-and-.patch new file mode 100644 index 0000000000..10c6ae881b --- /dev/null +++ b/meta/recipes-bsp/setserial/setserial/0001-setserial.c-Add-needed-system-headers-for-ioctl-and-.patch @@ -0,0 +1,41 @@ +From 9bbb342f5d9ad5dc75486fd35ada8e287ba19299 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 15 Aug 2022 13:03:17 -0700 +Subject: [PATCH] setserial.c: Add needed system headers for ioctl() and + close() calls + +Add int return type for main() function + +Fixes +error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] +error: call to undeclared function 'close'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declarat +ion] + +Upstream-Status: Submitted [https://sourceforge.net/p/setserial/discussion/7060/thread/95d874c12c/] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + setserial.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/setserial.c b/setserial.c +index bfda8fd..6a95513 100644 +--- a/setserial.c ++++ b/setserial.c +@@ -16,6 +16,8 @@ + #include <termios.h> + #include <string.h> + #include <errno.h> ++#include <unistd.h> ++#include <sys/ioctl.h> + + #ifdef HAVE_ASM_IOCTLS_H + #include <asm/ioctls.h> +@@ -715,7 +717,7 @@ fprintf(stderr, "\t* port\t\tset the I/O port\n"); + exit(1); + } + +-main(int argc, char **argv) ++int main(int argc, char **argv) + { + int get_flag = 0, wild_intr_flag = 0; + int c; diff --git a/meta/recipes-bsp/setserial/setserial_2.17.bb b/meta/recipes-bsp/setserial/setserial_2.17.bb index 8dbddd7dc5..98ab45145f 100644 --- a/meta/recipes-bsp/setserial/setserial_2.17.bb +++ b/meta/recipes-bsp/setserial/setserial_2.17.bb @@ -1,12 +1,10 @@ SUMMARY = "Controls the configuration of serial ports" DESCRIPTION = "setserial is a program designed to set and/or report the configuration information associated with a serial port" HOMEPAGE = "http://setserial.sourceforge.net" -AUTHOR = "Theodore Ts'o <tytso@mit.edu>" SECTION = "console/utils" -LICENSE = "GPLv2.0" +LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://version.h;beginline=1;endline=6;md5=2e7c59cb9e57e356ae81f50f4e4dfd99" -PR = "r3" DEPENDS += "groff-native" @@ -15,7 +13,8 @@ inherit autotools-brokensep SRC_URI = "${SOURCEFORGE_MIRROR}/setserial/${BPN}-${PV}.tar.gz \ file://add_stdlib.patch \ file://ldflags.patch \ - " + file://0001-setserial.c-Add-needed-system-headers-for-ioctl-and-.patch \ + " SRC_URI[md5sum] = "c4867d72c41564318e0107745eb7a0f2" SRC_URI[sha256sum] = "7e4487d320ac31558563424189435d396ddf77953bb23111a17a3d1487b5794a" diff --git a/meta/recipes-bsp/u-boot/files/0001-add-valid-fdt-check.patch b/meta/recipes-bsp/u-boot/files/0001-add-valid-fdt-check.patch deleted file mode 100644 index d4ac9e2ed9..0000000000 --- a/meta/recipes-bsp/u-boot/files/0001-add-valid-fdt-check.patch +++ /dev/null @@ -1,36 +0,0 @@ -From ea1a9ec5f430359720d9a0621ed1acfbba6a142a Mon Sep 17 00:00:00 2001 -From: Heinrich Schuchardt <xypron.glpk@gmx.de> -Date: Wed, 13 Jan 2021 02:09:12 +0100 -Subject: [PATCH] image-fit: fit_check_format check for valid FDT - -fit_check_format() must check that the buffer contains a flattened device -tree before calling any device tree library functions. - -Failure to do may cause segmentation faults. - -Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> - -Upstream-Status: Backport[https://github.com/u-boot/u-boot/commit/ea1a9ec5f430359720d9a0621ed1acfbba6a142a] -Signed-off-by: Scott Murray <scott.murray@konsulko.com> - ---- - common/image-fit.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/common/image-fit.c b/common/image-fit.c -index 6a8787ca0a..21c44bdf69 100644 ---- a/common/image-fit.c -+++ b/common/image-fit.c -@@ -1553,6 +1553,12 @@ int fit_image_check_comp(const void *fit, int noffset, uint8_t comp) - */ - int fit_check_format(const void *fit) - { -+ /* A FIT image must be a valid FDT */ -+ if (fdt_check_header(fit)) { -+ debug("Wrong FIT format: not a flattened device tree\n"); -+ return 0; -+ } -+ - /* mandatory / node 'description' property */ - if (fdt_getprop(fit, 0, FIT_DESC_PROP, NULL) == NULL) { - debug("Wrong FIT format: no description\n"); diff --git a/meta/recipes-bsp/u-boot/files/0001-riscv32-Use-double-float-ABI-for-rv32.patch b/meta/recipes-bsp/u-boot/files/0001-riscv32-Use-double-float-ABI-for-rv32.patch deleted file mode 100644 index 0ed3de4914..0000000000 --- a/meta/recipes-bsp/u-boot/files/0001-riscv32-Use-double-float-ABI-for-rv32.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 66dfe0fa886f6289add06d1af8642ce2b5302852 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Tue, 9 Feb 2021 16:40:12 -0800 -Subject: [PATCH] riscv32: Use double-float ABI for rv32 - -So it can use libgcc built with OE toolchain -Fixes -error: "can't link hard-float modules with soft-float modules" - -Signed-off-by: Khem Raj <raj.khem@gmail.com> -Upstream-Status: Inappropriate [embedded specific] ---- - arch/riscv/Makefile | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile -index 0b80eb8d86..7324946f48 100644 ---- a/arch/riscv/Makefile -+++ b/arch/riscv/Makefile -@@ -9,7 +9,9 @@ ifeq ($(CONFIG_ARCH_RV64I),y) - endif - ifeq ($(CONFIG_ARCH_RV32I),y) - ARCH_BASE = rv32im -- ABI = ilp32 -+ ABI = ilp32d -+ ARCH_D = d -+ ARCH_F = f - endif - ifeq ($(CONFIG_RISCV_ISA_A),y) - ARCH_A = a -@@ -24,7 +26,7 @@ ifeq ($(CONFIG_CMODEL_MEDANY),y) - CMODEL = medany - endif - --ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_C) -mabi=$(ABI) \ -+ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_F)$(ARCH_D)$(ARCH_C) -mabi=$(ABI) \ - -mcmodel=$(CMODEL) - - PLATFORM_CPPFLAGS += $(ARCH_FLAGS) --- -2.30.0 - diff --git a/meta/recipes-bsp/u-boot/files/CVE-2021-27097-1.patch b/meta/recipes-bsp/u-boot/files/CVE-2021-27097-1.patch deleted file mode 100644 index 98ec2c709d..0000000000 --- a/meta/recipes-bsp/u-boot/files/CVE-2021-27097-1.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 8a7d4cf9820ea16fabd25a6379351b4dc291204b Mon Sep 17 00:00:00 2001 -From: Simon Glass <sjg@chromium.org> -Date: Mon, 15 Feb 2021 17:08:05 -0700 -Subject: [PATCH] fdt_region: Check for a single root node of the correct name - -At present fdt_find_regions() assumes that the FIT is a valid devicetree. -If the FIT has two root nodes this is currently not detected in this -function, nor does libfdt's fdt_check_full() notice. Also it is possible -for the root node to have a name even though it should not. - -Add checks for these and return -FDT_ERR_BADSTRUCTURE if a problem is -detected. - -CVE-2021-27097 - -Signed-off-by: Simon Glass <sjg@chromium.org> -Reported-by: Bruce Monroe <bruce.monroe@intel.com> -Reported-by: Arie Haenel <arie.haenel@intel.com> -Reported-by: Julien Lenoir <julien.lenoir@intel.com> - -CVE: CVE-2021-27097 -Upstream-Status: Backport[https://github.com/u-boot/u-boot/commit/8a7d4cf9820ea16fabd25a6379351b4dc291204b] -Signed-off-by: Scott Murray <scott.murray@konsulko.com> - ---- - common/fdt_region.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/common/fdt_region.c b/common/fdt_region.c -index ff12c518e9..e4ef0ca770 100644 ---- a/common/fdt_region.c -+++ b/common/fdt_region.c -@@ -43,6 +43,7 @@ int fdt_find_regions(const void *fdt, char * const inc[], int inc_count, - int depth = -1; - int want = 0; - int base = fdt_off_dt_struct(fdt); -+ bool expect_end = false; - - end = path; - *end = '\0'; -@@ -59,6 +60,10 @@ int fdt_find_regions(const void *fdt, char * const inc[], int inc_count, - tag = fdt_next_tag(fdt, offset, &nextoffset); - stop_at = nextoffset; - -+ /* If we see two root nodes, something is wrong */ -+ if (expect_end && tag != FDT_END) -+ return -FDT_ERR_BADLAYOUT; -+ - switch (tag) { - case FDT_PROP: - include = want >= 2; -@@ -81,6 +86,10 @@ int fdt_find_regions(const void *fdt, char * const inc[], int inc_count, - if (depth == FDT_MAX_DEPTH) - return -FDT_ERR_BADSTRUCTURE; - name = fdt_get_name(fdt, offset, &len); -+ -+ /* The root node must have an empty name */ -+ if (!depth && *name) -+ return -FDT_ERR_BADLAYOUT; - if (end - path + 2 + len >= path_len) - return -FDT_ERR_NOSPACE; - if (end != path + 1) -@@ -108,6 +117,8 @@ int fdt_find_regions(const void *fdt, char * const inc[], int inc_count, - while (end > path && *--end != '/') - ; - *end = '\0'; -+ if (depth == -1) -+ expect_end = true; - break; - - case FDT_END: diff --git a/meta/recipes-bsp/u-boot/files/CVE-2021-27097-2.patch b/meta/recipes-bsp/u-boot/files/CVE-2021-27097-2.patch deleted file mode 100644 index b13c44e787..0000000000 --- a/meta/recipes-bsp/u-boot/files/CVE-2021-27097-2.patch +++ /dev/null @@ -1,419 +0,0 @@ -From c5819701a3de61e2ba2ef7ad0b616565b32305e5 Mon Sep 17 00:00:00 2001 -From: Simon Glass <sjg@chromium.org> -Date: Mon, 15 Feb 2021 17:08:09 -0700 -Subject: [PATCH] image: Adjust the workings of fit_check_format() - -At present this function does not accept a size for the FIT. This means -that it must be read from the FIT itself, introducing potential security -risk. Update the function to include a size parameter, which can be -invalid, in which case fit_check_format() calculates it. - -For now no callers pass the size, but this can be updated later. - -Also adjust the return value to an error code so that all the different -types of problems can be distinguished by the user. - -Signed-off-by: Simon Glass <sjg@chromium.org> -Reported-by: Bruce Monroe <bruce.monroe@intel.com> -Reported-by: Arie Haenel <arie.haenel@intel.com> -Reported-by: Julien Lenoir <julien.lenoir@intel.com> - -CVE: CVE-2021-27097 CVE-2021-27138 -Upstream-Status: Backport[https://github.com/u-boot/u-boot/commit/c5819701a3de61e2ba2ef7ad0b616565b32305e5] -Signed-off-by: Scott Murray <scott.murray@konsulko.com> - ---- - arch/arm/cpu/armv8/sec_firmware.c | 2 +- - cmd/bootm.c | 6 ++--- - cmd/disk.c | 2 +- - cmd/fpga.c | 2 +- - cmd/nand.c | 2 +- - cmd/source.c | 2 +- - cmd/ximg.c | 2 +- - common/image-fdt.c | 2 +- - common/image-fit.c | 46 +++++++++++++++++--------------------- - common/splash_source.c | 6 ++--- - common/update.c | 4 ++-- - drivers/fpga/socfpga_arria10.c | 6 ++--- - drivers/net/fsl-mc/mc.c | 2 +- - drivers/net/pfe_eth/pfe_firmware.c | 2 +- - include/image.h | 21 ++++++++++++++++- - tools/fit_common.c | 3 ++- - tools/fit_image.c | 2 +- - tools/mkimage.h | 2 ++ - 18 files changed, 65 insertions(+), 49 deletions(-) - -diff --git a/arch/arm/cpu/armv8/sec_firmware.c b/arch/arm/cpu/armv8/sec_firmware.c -index bfc0fac3ef..0561f5efd1 100644 ---- a/arch/arm/cpu/armv8/sec_firmware.c -+++ b/arch/arm/cpu/armv8/sec_firmware.c -@@ -316,7 +316,7 @@ __weak bool sec_firmware_is_valid(const void *sec_firmware_img) - return false; - } - -- if (!fit_check_format(sec_firmware_img)) { -+ if (fit_check_format(sec_firmware_img, IMAGE_SIZE_INVAL)) { - printf("SEC Firmware: Bad firmware image (bad FIT header)\n"); - return false; - } -diff --git a/cmd/bootm.c b/cmd/bootm.c -index e6b0e04413..a0f823f968 100644 ---- a/cmd/bootm.c -+++ b/cmd/bootm.c -@@ -291,7 +291,7 @@ static int image_info(ulong addr) - case IMAGE_FORMAT_FIT: - puts(" FIT image found\n"); - -- if (!fit_check_format(hdr)) { -+ if (fit_check_format(hdr, IMAGE_SIZE_INVAL)) { - puts("Bad FIT image format!\n"); - unmap_sysmem(hdr); - return 1; -@@ -368,7 +368,7 @@ static int do_imls_nor(void) - #endif - #if defined(CONFIG_FIT) - case IMAGE_FORMAT_FIT: -- if (!fit_check_format(hdr)) -+ if (fit_check_format(hdr, IMAGE_SIZE_INVAL)) - goto next_sector; - - printf("FIT Image at %08lX:\n", (ulong)hdr); -@@ -448,7 +448,7 @@ static int nand_imls_fitimage(struct mtd_info *mtd, int nand_dev, loff_t off, - return ret; - } - -- if (!fit_check_format(imgdata)) { -+ if (fit_check_format(imgdata, IMAGE_SIZE_INVAL)) { - free(imgdata); - return 0; - } -diff --git a/cmd/disk.c b/cmd/disk.c -index 8060e753eb..3195db9127 100644 ---- a/cmd/disk.c -+++ b/cmd/disk.c -@@ -114,7 +114,7 @@ int common_diskboot(struct cmd_tbl *cmdtp, const char *intf, int argc, - /* This cannot be done earlier, - * we need complete FIT image in RAM first */ - if (genimg_get_format((void *) addr) == IMAGE_FORMAT_FIT) { -- if (!fit_check_format(fit_hdr)) { -+ if (fit_check_format(fit_hdr, IMAGE_SIZE_INVAL)) { - bootstage_error(BOOTSTAGE_ID_IDE_FIT_READ); - puts("** Bad FIT image format\n"); - return 1; -diff --git a/cmd/fpga.c b/cmd/fpga.c -index 8ae1c936fb..51410a8e42 100644 ---- a/cmd/fpga.c -+++ b/cmd/fpga.c -@@ -330,7 +330,7 @@ static int do_fpga_loadmk(struct cmd_tbl *cmdtp, int flag, int argc, - return CMD_RET_FAILURE; - } - -- if (!fit_check_format(fit_hdr)) { -+ if (fit_check_format(fit_hdr, IMAGE_SIZE_INVAL)) { - puts("Bad FIT image format\n"); - return CMD_RET_FAILURE; - } -diff --git a/cmd/nand.c b/cmd/nand.c -index 92d039af8f..97e117a979 100644 ---- a/cmd/nand.c -+++ b/cmd/nand.c -@@ -917,7 +917,7 @@ static int nand_load_image(struct cmd_tbl *cmdtp, struct mtd_info *mtd, - #if defined(CONFIG_FIT) - /* This cannot be done earlier, we need complete FIT image in RAM first */ - if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT) { -- if (!fit_check_format (fit_hdr)) { -+ if (fit_check_format(fit_hdr, IMAGE_SIZE_INVAL)) { - bootstage_error(BOOTSTAGE_ID_NAND_FIT_READ); - puts ("** Bad FIT image format\n"); - return 1; -diff --git a/cmd/source.c b/cmd/source.c -index b6c709a3d2..71f71528ad 100644 ---- a/cmd/source.c -+++ b/cmd/source.c -@@ -107,7 +107,7 @@ int image_source_script(ulong addr, const char *fit_uname) - #if defined(CONFIG_FIT) - case IMAGE_FORMAT_FIT: - fit_hdr = buf; -- if (!fit_check_format (fit_hdr)) { -+ if (fit_check_format(fit_hdr, IMAGE_SIZE_INVAL)) { - puts ("Bad FIT image format\n"); - return 1; - } -diff --git a/cmd/ximg.c b/cmd/ximg.c -index 159ba51648..ef738ebfa2 100644 ---- a/cmd/ximg.c -+++ b/cmd/ximg.c -@@ -136,7 +136,7 @@ do_imgextract(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) - "at %08lx ...\n", uname, addr); - - fit_hdr = (const void *)addr; -- if (!fit_check_format(fit_hdr)) { -+ if (fit_check_format(fit_hdr, IMAGE_SIZE_INVAL)) { - puts("Bad FIT image format\n"); - return 1; - } -diff --git a/common/image-fdt.c b/common/image-fdt.c -index 327a8c4c39..4105259212 100644 ---- a/common/image-fdt.c -+++ b/common/image-fdt.c -@@ -399,7 +399,7 @@ int boot_get_fdt(int flag, int argc, char *const argv[], uint8_t arch, - */ - #if CONFIG_IS_ENABLED(FIT) - /* check FDT blob vs FIT blob */ -- if (fit_check_format(buf)) { -+ if (!fit_check_format(buf, IMAGE_SIZE_INVAL)) { - ulong load, len; - - fdt_noffset = boot_get_fdt_fit(images, -diff --git a/common/image-fit.c b/common/image-fit.c -index 9637d747fb..402f08fc9d 100644 ---- a/common/image-fit.c -+++ b/common/image-fit.c -@@ -8,6 +8,8 @@ - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. - */ - -+#define LOG_CATEGORY LOGC_BOOT -+ - #ifdef USE_HOSTCC - #include "mkimage.h" - #include <time.h> -@@ -1550,49 +1552,41 @@ int fit_image_check_comp(const void *fit, int noffset, uint8_t comp) - return (comp == image_comp); - } - --/** -- * fit_check_format - sanity check FIT image format -- * @fit: pointer to the FIT format image header -- * -- * fit_check_format() runs a basic sanity FIT image verification. -- * Routine checks for mandatory properties, nodes, etc. -- * -- * returns: -- * 1, on success -- * 0, on failure -- */ --int fit_check_format(const void *fit) -+int fit_check_format(const void *fit, ulong size) - { -+ int ret; -+ - /* A FIT image must be a valid FDT */ -- if (fdt_check_header(fit)) { -- debug("Wrong FIT format: not a flattened device tree\n"); -- return 0; -+ ret = fdt_check_header(fit); -+ if (ret) { -+ log_debug("Wrong FIT format: not a flattened device tree (err=%d)\n", -+ ret); -+ return -ENOEXEC; - } - - /* mandatory / node 'description' property */ -- if (fdt_getprop(fit, 0, FIT_DESC_PROP, NULL) == NULL) { -- debug("Wrong FIT format: no description\n"); -- return 0; -+ if (!fdt_getprop(fit, 0, FIT_DESC_PROP, NULL)) { -+ log_debug("Wrong FIT format: no description\n"); -+ return -ENOMSG; - } - - if (IMAGE_ENABLE_TIMESTAMP) { - /* mandatory / node 'timestamp' property */ -- if (fdt_getprop(fit, 0, FIT_TIMESTAMP_PROP, NULL) == NULL) { -- debug("Wrong FIT format: no timestamp\n"); -- return 0; -+ if (!fdt_getprop(fit, 0, FIT_TIMESTAMP_PROP, NULL)) { -+ log_debug("Wrong FIT format: no timestamp\n"); -+ return -ENODATA; - } - } - - /* mandatory subimages parent '/images' node */ - if (fdt_path_offset(fit, FIT_IMAGES_PATH) < 0) { -- debug("Wrong FIT format: no images parent node\n"); -- return 0; -+ log_debug("Wrong FIT format: no images parent node\n"); -+ return -ENOENT; - } - -- return 1; -+ return 0; - } - -- - /** - * fit_conf_find_compat - * @fit: pointer to the FIT format image header -@@ -1929,7 +1923,7 @@ int fit_image_load(bootm_headers_t *images, ulong addr, - printf("## Loading %s from FIT Image at %08lx ...\n", prop_name, addr); - - bootstage_mark(bootstage_id + BOOTSTAGE_SUB_FORMAT); -- if (!fit_check_format(fit)) { -+ if (fit_check_format(fit, IMAGE_SIZE_INVAL)) { - printf("Bad FIT %s image format!\n", prop_name); - bootstage_error(bootstage_id + BOOTSTAGE_SUB_FORMAT); - return -ENOEXEC; -diff --git a/common/splash_source.c b/common/splash_source.c -index f51ca5ddf3..bad9a7790a 100644 ---- a/common/splash_source.c -+++ b/common/splash_source.c -@@ -336,10 +336,10 @@ static int splash_load_fit(struct splash_location *location, u32 bmp_load_addr) - if (res < 0) - return res; - -- res = fit_check_format(fit_header); -- if (!res) { -+ res = fit_check_format(fit_header, IMAGE_SIZE_INVAL); -+ if (res) { - debug("Could not find valid FIT image\n"); -- return -EINVAL; -+ return res; - } - - /* Get the splash image node */ -diff --git a/common/update.c b/common/update.c -index a5879cb52c..f0848954e5 100644 ---- a/common/update.c -+++ b/common/update.c -@@ -286,7 +286,7 @@ int update_tftp(ulong addr, char *interface, char *devstring) - got_update_file: - fit = map_sysmem(addr, 0); - -- if (!fit_check_format((void *)fit)) { -+ if (fit_check_format((void *)fit, IMAGE_SIZE_INVAL)) { - printf("Bad FIT format of the update file, aborting " - "auto-update\n"); - return 1; -@@ -363,7 +363,7 @@ int fit_update(const void *fit) - if (!fit) - return -EINVAL; - -- if (!fit_check_format((void *)fit)) { -+ if (fit_check_format((void *)fit, IMAGE_SIZE_INVAL)) { - printf("Bad FIT format of the update file, aborting auto-update\n"); - return -EINVAL; - } -diff --git a/drivers/fpga/socfpga_arria10.c b/drivers/fpga/socfpga_arria10.c -index 44e1ac54c3..18f99676d2 100644 ---- a/drivers/fpga/socfpga_arria10.c -+++ b/drivers/fpga/socfpga_arria10.c -@@ -565,10 +565,10 @@ static int first_loading_rbf_to_buffer(struct udevice *dev, - if (ret < 0) - return ret; - -- ret = fit_check_format(buffer_p); -- if (!ret) { -+ ret = fit_check_format(buffer_p, IMAGE_SIZE_INVAL); -+ if (ret) { - debug("FPGA: No valid FIT image was found.\n"); -- return -EBADF; -+ return ret; - } - - confs_noffset = fdt_path_offset(buffer_p, FIT_CONFS_PATH); -diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c -index 84db6be624..81265ee356 100644 ---- a/drivers/net/fsl-mc/mc.c -+++ b/drivers/net/fsl-mc/mc.c -@@ -141,7 +141,7 @@ int parse_mc_firmware_fit_image(u64 mc_fw_addr, - return -EINVAL; - } - -- if (!fit_check_format(fit_hdr)) { -+ if (fit_check_format(fit_hdr, IMAGE_SIZE_INVAL)) { - printf("fsl-mc: ERR: Bad firmware image (bad FIT header)\n"); - return -EINVAL; - } -diff --git a/drivers/net/pfe_eth/pfe_firmware.c b/drivers/net/pfe_eth/pfe_firmware.c -index 41999e176d..eee70a2e73 100644 ---- a/drivers/net/pfe_eth/pfe_firmware.c -+++ b/drivers/net/pfe_eth/pfe_firmware.c -@@ -160,7 +160,7 @@ static int pfe_fit_check(void) - return ret; - } - -- if (!fit_check_format(pfe_fit_addr)) { -+ if (fit_check_format(pfe_fit_addr, IMAGE_SIZE_INVAL)) { - printf("PFE Firmware: Bad firmware image (bad FIT header)\n"); - ret = -1; - return ret; -diff --git a/include/image.h b/include/image.h -index 41473dbb9c..8c152c5c5f 100644 ---- a/include/image.h -+++ b/include/image.h -@@ -134,6 +134,9 @@ extern ulong image_load_addr; /* Default Load Address */ - extern ulong image_save_addr; /* Default Save Address */ - extern ulong image_save_size; /* Default Save Size */ - -+/* An invalid size, meaning that the image size is not known */ -+#define IMAGE_SIZE_INVAL (-1UL) -+ - enum ih_category { - IH_ARCH, - IH_COMP, -@@ -1141,7 +1144,23 @@ int fit_image_check_os(const void *fit, int noffset, uint8_t os); - int fit_image_check_arch(const void *fit, int noffset, uint8_t arch); - int fit_image_check_type(const void *fit, int noffset, uint8_t type); - int fit_image_check_comp(const void *fit, int noffset, uint8_t comp); --int fit_check_format(const void *fit); -+ -+/** -+ * fit_check_format() - Check that the FIT is valid -+ * -+ * This performs various checks on the FIT to make sure it is suitable for -+ * use, looking for mandatory properties, nodes, etc. -+ * -+ * If FIT_FULL_CHECK is enabled, it also runs it through libfdt to make -+ * sure that there are no strange tags or broken nodes in the FIT. -+ * -+ * @fit: pointer to the FIT format image header -+ * @return 0 if OK, -ENOEXEC if not an FDT file, -EINVAL if the full FDT check -+ * failed (e.g. due to bad structure), -ENOMSG if the description is -+ * missing, -ENODATA if the timestamp is missing, -ENOENT if the /images -+ * path is missing -+ */ -+int fit_check_format(const void *fit, ulong size); - - int fit_conf_find_compat(const void *fit, const void *fdt); - -diff --git a/tools/fit_common.c b/tools/fit_common.c -index cdf987d3c1..52b63296f8 100644 ---- a/tools/fit_common.c -+++ b/tools/fit_common.c -@@ -26,7 +26,8 @@ - int fit_verify_header(unsigned char *ptr, int image_size, - struct image_tool_params *params) - { -- if (fdt_check_header(ptr) != EXIT_SUCCESS || !fit_check_format(ptr)) -+ if (fdt_check_header(ptr) != EXIT_SUCCESS || -+ fit_check_format(ptr, IMAGE_SIZE_INVAL)) - return EXIT_FAILURE; - - return EXIT_SUCCESS; -diff --git a/tools/fit_image.c b/tools/fit_image.c -index 06faeda7c2..d440d143c6 100644 ---- a/tools/fit_image.c -+++ b/tools/fit_image.c -@@ -883,7 +883,7 @@ static int fit_extract_contents(void *ptr, struct image_tool_params *params) - /* Indent string is defined in header image.h */ - p = IMAGE_INDENT_STRING; - -- if (!fit_check_format(fit)) { -+ if (fit_check_format(fit, IMAGE_SIZE_INVAL)) { - printf("Bad FIT image format\n"); - return -1; - } -diff --git a/tools/mkimage.h b/tools/mkimage.h -index 5b096a545b..0d3148444c 100644 ---- a/tools/mkimage.h -+++ b/tools/mkimage.h -@@ -29,6 +29,8 @@ - #define debug(fmt,args...) - #endif /* MKIMAGE_DEBUG */ - -+#define log_debug(fmt, args...) debug(fmt, ##args) -+ - static inline void *map_sysmem(ulong paddr, unsigned long len) - { - return (void *)(uintptr_t)paddr; diff --git a/meta/recipes-bsp/u-boot/files/CVE-2021-27097-3.patch b/meta/recipes-bsp/u-boot/files/CVE-2021-27097-3.patch deleted file mode 100644 index 86f7e8ce55..0000000000 --- a/meta/recipes-bsp/u-boot/files/CVE-2021-27097-3.patch +++ /dev/null @@ -1,105 +0,0 @@ -From 6f3c2d8aa5e6cbd80b5e869bbbddecb66c329d01 Mon Sep 17 00:00:00 2001 -From: Simon Glass <sjg@chromium.org> -Date: Mon, 15 Feb 2021 17:08:10 -0700 -Subject: [PATCH] image: Add an option to do a full check of the FIT - -Some strange modifications of the FIT can introduce security risks. Add an -option to check it thoroughly, using libfdt's fdt_check_full() function. - -Enable this by default if signature verification is enabled. - -CVE-2021-27097 - -Signed-off-by: Simon Glass <sjg@chromium.org> -Reported-by: Bruce Monroe <bruce.monroe@intel.com> -Reported-by: Arie Haenel <arie.haenel@intel.com> -Reported-by: Julien Lenoir <julien.lenoir@intel.com> - -CVE: CVE-2021-27097 -Upstream-Status: Backport[https://github.com/u-boot/u-boot/commit/6f3c2d8aa5e6cbd80b5e869bbbddecb66c329d01] -Signed-off-by: Scott Murray <scott.murray@konsulko.com> - ---- - common/Kconfig.boot | 20 ++++++++++++++++++++ - common/image-fit.c | 16 ++++++++++++++++ - 2 files changed, 36 insertions(+) - -diff --git a/common/Kconfig.boot b/common/Kconfig.boot -index 5eaabdfc27..7532e55edb 100644 ---- a/common/Kconfig.boot -+++ b/common/Kconfig.boot -@@ -63,6 +63,15 @@ config FIT_ENABLE_SHA512_SUPPORT - SHA512 checksum is a 512-bit (64-byte) hash value used to check that - the image contents have not been corrupted. - -+config FIT_FULL_CHECK -+ bool "Do a full check of the FIT before using it" -+ default y -+ help -+ Enable this do a full check of the FIT to make sure it is valid. This -+ helps to protect against carefully crafted FITs which take advantage -+ of bugs or omissions in the code. This includes a bad structure, -+ multiple root nodes and the like. -+ - config FIT_SIGNATURE - bool "Enable signature verification of FIT uImages" - depends on DM -@@ -70,6 +79,7 @@ config FIT_SIGNATURE - select RSA - select RSA_VERIFY - select IMAGE_SIGN_INFO -+ select FIT_FULL_CHECK - help - This option enables signature verification of FIT uImages, - using a hash signed and verified using RSA. If -@@ -159,6 +169,15 @@ config SPL_FIT_PRINT - help - Support printing the content of the fitImage in a verbose manner in SPL. - -+config SPL_FIT_FULL_CHECK -+ bool "Do a full check of the FIT before using it" -+ help -+ Enable this do a full check of the FIT to make sure it is valid. This -+ helps to protect against carefully crafted FITs which take advantage -+ of bugs or omissions in the code. This includes a bad structure, -+ multiple root nodes and the like. -+ -+ - config SPL_FIT_SIGNATURE - bool "Enable signature verification of FIT firmware within SPL" - depends on SPL_DM -@@ -168,6 +187,7 @@ config SPL_FIT_SIGNATURE - select SPL_RSA - select SPL_RSA_VERIFY - select SPL_IMAGE_SIGN_INFO -+ select SPL_FIT_FULL_CHECK - - config SPL_LOAD_FIT - bool "Enable SPL loading U-Boot as a FIT (basic fitImage features)" -diff --git a/common/image-fit.c b/common/image-fit.c -index f6c0428a96..bcf395f6a1 100644 ---- a/common/image-fit.c -+++ b/common/image-fit.c -@@ -1580,6 +1580,22 @@ int fit_check_format(const void *fit, ulong size) - return -ENOEXEC; - } - -+ if (CONFIG_IS_ENABLED(FIT_FULL_CHECK)) { -+ /* -+ * If we are not given the size, make do wtih calculating it. -+ * This is not as secure, so we should consider a flag to -+ * control this. -+ */ -+ if (size == IMAGE_SIZE_INVAL) -+ size = fdt_totalsize(fit); -+ ret = fdt_check_full(fit, size); -+ -+ if (ret) { -+ log_debug("FIT check error %d\n", ret); -+ return -EINVAL; -+ } -+ } -+ - /* mandatory / node 'description' property */ - if (!fdt_getprop(fit, 0, FIT_DESC_PROP, NULL)) { - log_debug("Wrong FIT format: no description\n"); diff --git a/meta/recipes-bsp/u-boot/files/CVE-2021-27097-4.patch b/meta/recipes-bsp/u-boot/files/CVE-2021-27097-4.patch deleted file mode 100644 index 060cac1cf6..0000000000 --- a/meta/recipes-bsp/u-boot/files/CVE-2021-27097-4.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 124c255731c76a2b09587378b2bcce561bcd3f2d Mon Sep 17 00:00:00 2001 -From: Simon Glass <sjg@chromium.org> -Date: Mon, 15 Feb 2021 17:08:11 -0700 -Subject: [PATCH] libfdt: Check for multiple/invalid root nodes - -It is possible to construct a devicetree blob with multiple root nodes. -Update fdt_check_full() to check for this, along with a root node with an -invalid name. - -CVE-2021-27097 - -Signed-off-by: Simon Glass <sjg@chromium.org> -Reported-by: Bruce Monroe <bruce.monroe@intel.com> -Reported-by: Arie Haenel <arie.haenel@intel.com> -Reported-by: Julien Lenoir <julien.lenoir@intel.com> - -CVE: CVE-2021-27097 -Upstream-Status: Backport[https://github.com/u-boot/u-boot/commit/124c255731c76a2b09587378b2bcce561bcd3f2d] -Signed-off-by: Scott Murray <scott.murray@konsulko.com> - ---- - scripts/dtc/libfdt/fdt_ro.c | 17 +++++++++++++++++ - test/py/tests/test_vboot.py | 3 ++- - 2 files changed, 19 insertions(+), 1 deletion(-) - -diff --git a/scripts/dtc/libfdt/fdt_ro.c b/scripts/dtc/libfdt/fdt_ro.c -index d984bab036..efe7efe921 100644 ---- a/scripts/dtc/libfdt/fdt_ro.c -+++ b/scripts/dtc/libfdt/fdt_ro.c -@@ -867,6 +867,7 @@ int fdt_check_full(const void *fdt, size_t bufsize) - unsigned depth = 0; - const void *prop; - const char *propname; -+ bool expect_end = false; - - if (bufsize < FDT_V1_SIZE) - return -FDT_ERR_TRUNCATED; -@@ -887,6 +888,10 @@ int fdt_check_full(const void *fdt, size_t bufsize) - if (nextoffset < 0) - return nextoffset; - -+ /* If we see two root nodes, something is wrong */ -+ if (expect_end && tag != FDT_END) -+ return -FDT_ERR_BADLAYOUT; -+ - switch (tag) { - case FDT_NOP: - break; -@@ -900,12 +905,24 @@ int fdt_check_full(const void *fdt, size_t bufsize) - depth++; - if (depth > INT_MAX) - return -FDT_ERR_BADSTRUCTURE; -+ -+ /* The root node must have an empty name */ -+ if (depth == 1) { -+ const char *name; -+ int len; -+ -+ name = fdt_get_name(fdt, offset, &len); -+ if (*name || len) -+ return -FDT_ERR_BADLAYOUT; -+ } - break; - - case FDT_END_NODE: - if (depth == 0) - return -FDT_ERR_BADSTRUCTURE; - depth--; -+ if (depth == 0) -+ expect_end = true; - break; - - case FDT_PROP: diff --git a/meta/recipes-bsp/u-boot/files/CVE-2021-27138-1.patch b/meta/recipes-bsp/u-boot/files/CVE-2021-27138-1.patch deleted file mode 100644 index 562f8151bb..0000000000 --- a/meta/recipes-bsp/u-boot/files/CVE-2021-27138-1.patch +++ /dev/null @@ -1,245 +0,0 @@ -From 79af75f7776fc20b0d7eb6afe1e27c00fdb4b9b4 Mon Sep 17 00:00:00 2001 -From: Simon Glass <sjg@chromium.org> -Date: Mon, 15 Feb 2021 17:08:06 -0700 -Subject: [PATCH] fit: Don't allow verification of images with @ nodes - -When searching for a node called 'fred', any unit address appended to the -name is ignored by libfdt, meaning that 'fred' can match 'fred@1'. This -means that we cannot be sure that the node originally intended is the one -that is used. - -Disallow use of nodes with unit addresses. - -Update the forge test also, since it uses @ addresses. - -CVE-2021-27138 - -Signed-off-by: Simon Glass <sjg@chromium.org> -Reported-by: Bruce Monroe <bruce.monroe@intel.com> -Reported-by: Arie Haenel <arie.haenel@intel.com> -Reported-by: Julien Lenoir <julien.lenoir@intel.com> - -CVE: CVE-2021-27138 -Upstream-Status: Backport[https://github.com/u-boot/u-boot/commit/79af75f7776fc20b0d7eb6afe1e27c00fdb4b9b4] -Signed-off-by: Scott Murray <scott.murray@konsulko.com> - ---- - common/image-fit-sig.c | 22 ++++++++++++++++++++-- - common/image-fit.c | 20 +++++++++++++++----- - test/py/tests/test_fit.py | 24 ++++++++++++------------ - test/py/tests/vboot_forge.py | 12 ++++++------ - 4 files changed, 53 insertions(+), 25 deletions(-) - -diff --git a/common/image-fit-sig.c b/common/image-fit-sig.c -index 897e04c7a3..34ebb8edfe 100644 ---- a/common/image-fit-sig.c -+++ b/common/image-fit-sig.c -@@ -149,6 +149,14 @@ static int fit_image_verify_sig(const void *fit, int image_noffset, - fdt_for_each_subnode(noffset, fit, image_noffset) { - const char *name = fit_get_name(fit, noffset, NULL); - -+ /* -+ * We don't support this since libfdt considers names with the -+ * name root but different @ suffix to be equal -+ */ -+ if (strchr(name, '@')) { -+ err_msg = "Node name contains @"; -+ goto error; -+ } - if (!strncmp(name, FIT_SIG_NODENAME, - strlen(FIT_SIG_NODENAME))) { - ret = fit_image_check_sig(fit, noffset, data, -@@ -398,9 +406,10 @@ error: - return -EPERM; - } - --int fit_config_verify_required_sigs(const void *fit, int conf_noffset, -- const void *sig_blob) -+static int fit_config_verify_required_sigs(const void *fit, int conf_noffset, -+ const void *sig_blob) - { -+ const char *name = fit_get_name(fit, conf_noffset, NULL); - int noffset; - int sig_node; - int verified = 0; -@@ -408,6 +417,15 @@ int fit_config_verify_required_sigs(const void *fit, int conf_noffset, - bool reqd_policy_all = true; - const char *reqd_mode; - -+ /* -+ * We don't support this since libfdt considers names with the -+ * name root but different @ suffix to be equal -+ */ -+ if (strchr(name, '@')) { -+ printf("Configuration node '%s' contains '@'\n", name); -+ return -EPERM; -+ } -+ - /* Work out what we need to verify */ - sig_node = fdt_subnode_offset(sig_blob, 0, FIT_SIG_NODENAME); - if (sig_node < 0) { -diff --git a/common/image-fit.c b/common/image-fit.c -index adc3e551de..c3dc814115 100644 ---- a/common/image-fit.c -+++ b/common/image-fit.c -@@ -1369,21 +1369,31 @@ error: - */ - int fit_image_verify(const void *fit, int image_noffset) - { -+ const char *name = fit_get_name(fit, image_noffset, NULL); - const void *data; - size_t size; -- int noffset = 0; - char *err_msg = ""; - -+ if (strchr(name, '@')) { -+ /* -+ * We don't support this since libfdt considers names with the -+ * name root but different @ suffix to be equal -+ */ -+ err_msg = "Node name contains @"; -+ goto err; -+ } - /* Get image data and data length */ - if (fit_image_get_data_and_size(fit, image_noffset, &data, &size)) { - err_msg = "Can't get image data/size"; -- printf("error!\n%s for '%s' hash node in '%s' image node\n", -- err_msg, fit_get_name(fit, noffset, NULL), -- fit_get_name(fit, image_noffset, NULL)); -- return 0; -+ goto err; - } - - return fit_image_verify_with_data(fit, image_noffset, data, size); -+ -+err: -+ printf("error!\n%s in '%s' image node\n", err_msg, -+ fit_get_name(fit, image_noffset, NULL)); -+ return 0; - } - - /** -diff --git a/test/py/tests/test_fit.py b/test/py/tests/test_fit.py -index 84b3f95850..6d5b43c3ba 100755 ---- a/test/py/tests/test_fit.py -+++ b/test/py/tests/test_fit.py -@@ -17,7 +17,7 @@ base_its = ''' - #address-cells = <1>; - - images { -- kernel@1 { -+ kernel-1 { - data = /incbin/("%(kernel)s"); - type = "kernel"; - arch = "sandbox"; -@@ -26,7 +26,7 @@ base_its = ''' - load = <0x40000>; - entry = <0x8>; - }; -- kernel@2 { -+ kernel-2 { - data = /incbin/("%(loadables1)s"); - type = "kernel"; - arch = "sandbox"; -@@ -35,19 +35,19 @@ base_its = ''' - %(loadables1_load)s - entry = <0x0>; - }; -- fdt@1 { -+ fdt-1 { - description = "snow"; - data = /incbin/("%(fdt)s"); - type = "flat_dt"; - arch = "sandbox"; - %(fdt_load)s - compression = "%(compression)s"; -- signature@1 { -+ signature-1 { - algo = "sha1,rsa2048"; - key-name-hint = "dev"; - }; - }; -- ramdisk@1 { -+ ramdisk-1 { - description = "snow"; - data = /incbin/("%(ramdisk)s"); - type = "ramdisk"; -@@ -56,7 +56,7 @@ base_its = ''' - %(ramdisk_load)s - compression = "%(compression)s"; - }; -- ramdisk@2 { -+ ramdisk-2 { - description = "snow"; - data = /incbin/("%(loadables2)s"); - type = "ramdisk"; -@@ -67,10 +67,10 @@ base_its = ''' - }; - }; - configurations { -- default = "conf@1"; -- conf@1 { -- kernel = "kernel@1"; -- fdt = "fdt@1"; -+ default = "conf-1"; -+ conf-1 { -+ kernel = "kernel-1"; -+ fdt = "fdt-1"; - %(ramdisk_config)s - %(loadables_config)s - }; -@@ -410,7 +410,7 @@ def test_fit(u_boot_console): - - # Try a ramdisk - with cons.log.section('Kernel + FDT + Ramdisk load'): -- params['ramdisk_config'] = 'ramdisk = "ramdisk@1";' -+ params['ramdisk_config'] = 'ramdisk = "ramdisk-1";' - params['ramdisk_load'] = 'load = <%#x>;' % params['ramdisk_addr'] - fit = make_fit(mkimage, params) - cons.restart_uboot() -@@ -419,7 +419,7 @@ def test_fit(u_boot_console): - - # Configuration with some Loadables - with cons.log.section('Kernel + FDT + Ramdisk load + Loadables'): -- params['loadables_config'] = 'loadables = "kernel@2", "ramdisk@2";' -+ params['loadables_config'] = 'loadables = "kernel-2", "ramdisk-2";' - params['loadables1_load'] = ('load = <%#x>;' % - params['loadables1_addr']) - params['loadables2_load'] = ('load = <%#x>;' % -diff --git a/test/py/tests/vboot_forge.py b/test/py/tests/vboot_forge.py -index 0fb7ef4024..b41105bd0e 100644 ---- a/test/py/tests/vboot_forge.py -+++ b/test/py/tests/vboot_forge.py -@@ -376,12 +376,12 @@ def manipulate(root, strblock): - """ - Maliciously manipulates the structure to create a crafted FIT file - """ -- # locate /images/kernel@1 (frankly, it just expects it to be the first one) -+ # locate /images/kernel-1 (frankly, it just expects it to be the first one) - kernel_node = root[0][0] - # clone it to save time filling all the properties - fake_kernel = kernel_node.clone() - # rename the node -- fake_kernel.name = b'kernel@2' -+ fake_kernel.name = b'kernel-2' - # get rid of signatures/hashes - fake_kernel.children = [] - # NOTE: this simply replaces the first prop... either description or data -@@ -391,13 +391,13 @@ def manipulate(root, strblock): - root[0].children.append(fake_kernel) - - # modify the default configuration -- root[1].props[0].value = b'conf@2\x00' -+ root[1].props[0].value = b'conf-2\x00' - # clone the first (only?) configuration - fake_conf = root[1][0].clone() - # rename and change kernel and fdt properties to select the crafted kernel -- fake_conf.name = b'conf@2' -- fake_conf.props[0].value = b'kernel@2\x00' -- fake_conf.props[1].value = b'fdt@1\x00' -+ fake_conf.name = b'conf-2' -+ fake_conf.props[0].value = b'kernel-2\x00' -+ fake_conf.props[1].value = b'fdt-1\x00' - # insert the new configuration under /configurations - root[1].children.append(fake_conf) - diff --git a/meta/recipes-bsp/u-boot/files/CVE-2021-27138-2.patch b/meta/recipes-bsp/u-boot/files/CVE-2021-27138-2.patch deleted file mode 100644 index 946196c378..0000000000 --- a/meta/recipes-bsp/u-boot/files/CVE-2021-27138-2.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 3f04db891a353f4b127ed57279279f851c6b4917 Mon Sep 17 00:00:00 2001 -From: Simon Glass <sjg@chromium.org> -Date: Mon, 15 Feb 2021 17:08:12 -0700 -Subject: [PATCH] image: Check for unit addresses in FITs - -Using unit addresses in a FIT is a security risk. Add a check for this -and disallow it. - -CVE-2021-27138 - -Signed-off-by: Simon Glass <sjg@chromium.org> -Reported-by: Bruce Monroe <bruce.monroe@intel.com> -Reported-by: Arie Haenel <arie.haenel@intel.com> -Reported-by: Julien Lenoir <julien.lenoir@intel.com> - -CVE: CVE-2021-27138 -Upstream-Status: Backport[https://github.com/u-boot/u-boot/commit/3f04db891a353f4b127ed57279279f851c6b4917] -Signed-off-by: Scott Murray <scott.murray@konsulko.com> - ---- - common/image-fit.c | 56 +++++++++++++++++++++++++++++++++++++++++---- - test/py/tests/test_vboot.py | 9 ++++---- - 2 files changed, 57 insertions(+), 8 deletions(-) - -diff --git a/common/image-fit.c b/common/image-fit.c -index bcf395f6a1..28b3d2b191 100644 ---- a/common/image-fit.c -+++ b/common/image-fit.c -@@ -1568,6 +1568,34 @@ int fit_image_check_comp(const void *fit, int noffset, uint8_t comp) - return (comp == image_comp); - } - -+/** -+ * fdt_check_no_at() - Check for nodes whose names contain '@' -+ * -+ * This checks the parent node and all subnodes recursively -+ * -+ * @fit: FIT to check -+ * @parent: Parent node to check -+ * @return 0 if OK, -EADDRNOTAVAIL is a node has a name containing '@' -+ */ -+static int fdt_check_no_at(const void *fit, int parent) -+{ -+ const char *name; -+ int node; -+ int ret; -+ -+ name = fdt_get_name(fit, parent, NULL); -+ if (!name || strchr(name, '@')) -+ return -EADDRNOTAVAIL; -+ -+ fdt_for_each_subnode(node, fit, parent) { -+ ret = fdt_check_no_at(fit, node); -+ if (ret) -+ return ret; -+ } -+ -+ return 0; -+} -+ - int fit_check_format(const void *fit, ulong size) - { - int ret; -@@ -1589,10 +1617,27 @@ int fit_check_format(const void *fit, ulong size) - if (size == IMAGE_SIZE_INVAL) - size = fdt_totalsize(fit); - ret = fdt_check_full(fit, size); -+ if (ret) -+ ret = -EINVAL; -+ -+ /* -+ * U-Boot stopped using unit addressed in 2017. Since libfdt -+ * can match nodes ignoring any unit address, signature -+ * verification can see the wrong node if one is inserted with -+ * the same name as a valid node but with a unit address -+ * attached. Protect against this by disallowing unit addresses. -+ */ -+ if (!ret && CONFIG_IS_ENABLED(FIT_SIGNATURE)) { -+ ret = fdt_check_no_at(fit, 0); - -+ if (ret) { -+ log_debug("FIT check error %d\n", ret); -+ return ret; -+ } -+ } - if (ret) { - log_debug("FIT check error %d\n", ret); -- return -EINVAL; -+ return ret; - } - } - -@@ -1955,10 +2000,13 @@ int fit_image_load(bootm_headers_t *images, ulong addr, - printf("## Loading %s from FIT Image at %08lx ...\n", prop_name, addr); - - bootstage_mark(bootstage_id + BOOTSTAGE_SUB_FORMAT); -- if (fit_check_format(fit, IMAGE_SIZE_INVAL)) { -- printf("Bad FIT %s image format!\n", prop_name); -+ ret = fit_check_format(fit, IMAGE_SIZE_INVAL); -+ if (ret) { -+ printf("Bad FIT %s image format! (err=%d)\n", prop_name, ret); -+ if (CONFIG_IS_ENABLED(FIT_SIGNATURE) && ret == -EADDRNOTAVAIL) -+ printf("Signature checking prevents use of unit addresses (@) in nodes\n"); - bootstage_error(bootstage_id + BOOTSTAGE_SUB_FORMAT); -- return -ENOEXEC; -+ return ret; - } - bootstage_mark(bootstage_id + BOOTSTAGE_SUB_FORMAT_OK); - if (fit_uname) { diff --git a/meta/recipes-bsp/u-boot/libubootenv_0.3.1.bb b/meta/recipes-bsp/u-boot/libubootenv_0.3.5.bb index 613e3161fb..b68bbb430a 100644 --- a/meta/recipes-bsp/u-boot/libubootenv_0.3.1.bb +++ b/meta/recipes-bsp/u-boot/libubootenv_0.3.5.bb @@ -6,25 +6,21 @@ It provides a hardware-independent replacement for fw_printenv/setenv utilities provided by U-Boot" HOMEPAGE = "https://github.com/sbabic/libubootenv" -LICENSE = "LGPL-2.1" -LIC_FILES_CHKSUM = "file://Licenses/lgpl-2.1.txt;md5=4fbd65380cdd255951079008b364516c" +LICENSE = "LGPL-2.1-or-later" +LIC_FILES_CHKSUM = "file://LICENSES/LGPL-2.1-or-later.txt;md5=4fbd65380cdd255951079008b364516c" SECTION = "libs" -SRC_URI = "git://github.com/sbabic/libubootenv;protocol=https" -SRCREV = "824551ac77bab1d0f7ae34d7a7c77b155240e754" +SRC_URI = "git://github.com/sbabic/libubootenv;protocol=https;branch=master" +SRCREV = "3f4d15e36ceb58085b08dd13f3f2788e9299877b" S = "${WORKDIR}/git" -inherit uboot-config cmake lib_package +inherit cmake lib_package EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release" -DEPENDS = "zlib" +DEPENDS = "zlib libyaml" PROVIDES += "u-boot-fw-utils" -RPROVIDES_${PN}-bin += "u-boot-fw-utils" - -PACKAGE_ARCH = "${MACHINE_ARCH}" - -RRECOMMENDS_${PN}-bin_append_class-target = " u-boot-default-env" +RPROVIDES:${PN}-bin += "u-boot-fw-utils" BBCLASSEXTEND = "native" diff --git a/meta/recipes-bsp/u-boot/u-boot-common.inc b/meta/recipes-bsp/u-boot/u-boot-common.inc index 993478a73b..ca5357392a 100644 --- a/meta/recipes-bsp/u-boot/u-boot-common.inc +++ b/meta/recipes-bsp/u-boot/u-boot-common.inc @@ -4,26 +4,21 @@ ARM, MIPS and several other processors, which can be installed in a boot \ ROM and used to initialize and test the hardware or to download and run \ application code." SECTION = "bootloaders" -DEPENDS += "flex-native bison-native" +DEPENDS += "flex-native bison-native python3-setuptools-native" -LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://Licenses/README;md5=5a7450c57ffe5ae63fd732446b988025" +LICENSE = "GPL-2.0-or-later" +LIC_FILES_CHKSUM = "file://Licenses/README;md5=2ca5f2c35c8cc335f0a19756634782f1" PE = "1" # We use the revision in order to avoid having to fetch it from the # repo during parse -SRCREV = "c4fddedc48f336eabc4ce3f74940e6aa372de18c" +SRCREV = "25049ad560826f7dc1c4740883b0016014a59789" -SRC_URI = "git://git.denx.de/u-boot.git \ - file://0001-add-valid-fdt-check.patch \ - file://CVE-2021-27097-1.patch \ - file://CVE-2021-27097-2.patch \ - file://CVE-2021-27097-3.patch \ - file://CVE-2021-27097-4.patch \ - file://CVE-2021-27138-1.patch \ - file://CVE-2021-27138-2.patch \ - " +SRC_URI = "git://source.denx.de/u-boot/u-boot.git;protocol=https;branch=master" S = "${WORKDIR}/git" B = "${WORKDIR}/build" + +inherit pkgconfig + do_configure[cleandirs] = "${B}" diff --git a/meta/recipes-bsp/u-boot/u-boot-configure.inc b/meta/recipes-bsp/u-boot/u-boot-configure.inc new file mode 100644 index 0000000000..378d675364 --- /dev/null +++ b/meta/recipes-bsp/u-boot/u-boot-configure.inc @@ -0,0 +1,40 @@ +# This provides the logic for creating the desired u-boot config, +# accounting for any *.cfg files added to SRC_URI. It's separated +# from u-boot.inc for use by recipes that need u-boot properly +# configured but aren't doing a full build of u-boot itself (such as +# its companion tools). + +inherit uboot-config cml1 + +DEPENDS += "kern-tools-native" + +CONFIGURE_FILES = "${@d.getVar('UBOOT_MACHINE') or '.config'}" + +do_configure () { + if [ -n "${UBOOT_CONFIG}" ]; then + unset i j + for config in ${UBOOT_MACHINE}; do + i=$(expr $i + 1); + for type in ${UBOOT_CONFIG}; do + j=$(expr $j + 1); + if [ $j -eq $i ]; then + oe_runmake -C ${S} O=${B}/${config} ${config} + if [ -n "${@' '.join(find_cfgs(d))}" ]; then + merge_config.sh -m -O ${B}/${config} ${B}/${config}/.config ${@" ".join(find_cfgs(d))} + oe_runmake -C ${S} O=${B}/${config} oldconfig + fi + fi + done + unset j + done + unset i + else + if [ -n "${UBOOT_MACHINE}" ]; then + oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE} + else + oe_runmake -C ${S} O=${B} oldconfig + fi + merge_config.sh -m .config ${@" ".join(find_cfgs(d))} + cml1_do_configure + fi +} diff --git a/meta/recipes-bsp/u-boot/u-boot-tools.inc b/meta/recipes-bsp/u-boot/u-boot-tools.inc index 4ed936a70d..f3010763c0 100644 --- a/meta/recipes-bsp/u-boot/u-boot-tools.inc +++ b/meta/recipes-bsp/u-boot/u-boot-tools.inc @@ -1,26 +1,30 @@ SUMMARY = "U-Boot bootloader tools" -DEPENDS += "openssl" +DEPENDS += "gnutls openssl util-linux swig-native" -PROVIDES = "${MLPREFIX}u-boot-mkimage ${MLPREFIX}u-boot-mkenvimage" -PROVIDES_class-native = "u-boot-mkimage-native u-boot-mkenvimage-native" +inherit python3native +export STAGING_INCDIR="${STAGING_INCDIR_NATIVE}" -PACKAGES += "${PN}-mkimage ${PN}-mkenvimage" +PROVIDES = "${MLPREFIX}u-boot-mkimage ${MLPREFIX}u-boot-mkenvimage ${MLPREFIX}u-boot-mkeficapsule" +PROVIDES:class-native = "u-boot-mkimage-native u-boot-mkenvimage-native u-boot-mkeficapsule-native" + +PACKAGES += "${PN}-mkimage ${PN}-mkenvimage ${PN}-mkeficapsule" # Required for backward compatibility with "u-boot-mkimage-xxx.bb" -RPROVIDES_${PN}-mkimage = "u-boot-mkimage" -RREPLACES_${PN}-mkimage = "u-boot-mkimage" -RCONFLICTS_${PN}-mkimage = "u-boot-mkimage" +RPROVIDES:${PN}-mkimage = "u-boot-mkimage" +RREPLACES:${PN}-mkimage = "u-boot-mkimage" +RCONFLICTS:${PN}-mkimage = "u-boot-mkimage" -EXTRA_OEMAKE_class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' -EXTRA_OEMAKE_class-native = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' -EXTRA_OEMAKE_class-nativesdk = 'CROSS_COMPILE="${HOST_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' +EXTRA_OEMAKE:class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' +EXTRA_OEMAKE:class-native = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' +EXTRA_OEMAKE:class-nativesdk = 'CROSS_COMPILE="${HOST_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' SED_CONFIG_EFI = '-e "s/CONFIG_EFI_LOADER=.*/# CONFIG_EFI_LOADER is not set/"' -SED_CONFIG_EFI_x86 = '' -SED_CONFIG_EFI_x86-64 = '' -SED_CONFIG_EFI_arm = '' -SED_CONFIG_EFI_armeb = '' -SED_CONFIG_EFI_aarch64 = '' +SED_CONFIG_EFI:x86 = '' +SED_CONFIG_EFI:x86-64 = '' +SED_CONFIG_EFI:arm = '' +SED_CONFIG_EFI:armeb = '' +SED_CONFIG_EFI:aarch64 = '' +SED_CONFIG_EFI:loongarch64 = '' do_compile () { # Yes, this is crazy. If you build on a system with git < 2.14 from scratch, the tree will @@ -38,7 +42,7 @@ do_compile () { # (i.e. creating a hardlink dirties the index) cd ${S}; git diff; cd ${B} - oe_runmake -C ${S} sandbox_defconfig O=${B} + oe_runmake -C ${S} tools-only_defconfig O=${B} # Disable CONFIG_CMD_LICENSE, license.h is not used by tools and # generating it requires bin2header tool, which for target build @@ -66,16 +70,21 @@ do_install () { # fit_check_sign install -m 0755 tools/fit_check_sign ${D}${bindir}/uboot-fit_check_sign ln -sf uboot-fit_check_sign ${D}${bindir}/fit_check_sign + + # mkeficapsule + install -m 0755 tools/mkeficapsule ${D}${bindir}/uboot-mkeficapsule + ln -sf uboot-mkeficapsule ${D}${bindir}/mkeficapsule } -ALLOW_EMPTY_${PN} = "1" -FILES_${PN} = "" -FILES_${PN}-mkimage = "${bindir}/uboot-mkimage ${bindir}/mkimage ${bindir}/uboot-dumpimage ${bindir}/dumpimage ${bindir}/uboot-fit_check_sign ${bindir}/fit_check_sign" -FILES_${PN}-mkenvimage = "${bindir}/uboot-mkenvimage ${bindir}/mkenvimage" +ALLOW_EMPTY:${PN} = "1" +FILES:${PN} = "" +FILES:${PN}-mkimage = "${bindir}/uboot-mkimage ${bindir}/mkimage ${bindir}/uboot-dumpimage ${bindir}/dumpimage ${bindir}/uboot-fit_check_sign ${bindir}/fit_check_sign" +FILES:${PN}-mkenvimage = "${bindir}/uboot-mkenvimage ${bindir}/mkenvimage" +FILES:${PN}-mkeficapsule = "${bindir}/uboot-mkeficapsule ${bindir}/mkeficapsule" -RDEPENDS_${PN}-mkimage += "dtc" -RDEPENDS_${PN} += "${PN}-mkimage ${PN}-mkenvimage" -RDEPENDS_${PN}_class-native = "" +RDEPENDS:${PN}-mkimage += "dtc" +RDEPENDS:${PN} += "${PN}-mkimage ${PN}-mkenvimage ${PN}-mkeficapsule" +RDEPENDS:${PN}:class-native = "" BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-bsp/u-boot/u-boot-tools_2021.01.bb b/meta/recipes-bsp/u-boot/u-boot-tools_2024.04.bb index ef386f76e6..7eaf721ca8 100644 --- a/meta/recipes-bsp/u-boot/u-boot-tools_2021.01.bb +++ b/meta/recipes-bsp/u-boot/u-boot-tools_2024.04.bb @@ -1,3 +1,2 @@ require u-boot-common.inc require u-boot-tools.inc - diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc index 5398c2e621..f5b43f6e36 100644 --- a/meta/recipes-bsp/u-boot/u-boot.inc +++ b/meta/recipes-bsp/u-boot/u-boot.inc @@ -3,13 +3,13 @@ PROVIDES = "virtual/bootloader" PACKAGE_ARCH = "${MACHINE_ARCH}" -DEPENDS += "kern-tools-native" +DEPENDS += "${@bb.utils.contains('UBOOT_ENV_SUFFIX', 'scr', 'u-boot-mkimage-native', '', d)}" -inherit uboot-config uboot-extlinux-config uboot-sign deploy cml1 python3native +inherit uboot-config uboot-extlinux-config uboot-sign deploy python3native kernel-arch DEPENDS += "swig-native" -EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}" V=1' +EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS} ${DEBUG_PREFIX_MAP}" V=1' EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"' EXTRA_OEMAKE += 'STAGING_INCDIR=${STAGING_INCDIR_NATIVE} STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}' @@ -24,36 +24,19 @@ PACKAGECONFIG[openssl] = ",,openssl-native" # file already exists it will not be overwritten. UBOOT_LOCALVERSION ?= "" -do_configure () { - if [ -n "${UBOOT_CONFIG}" ]; then - unset i j - for config in ${UBOOT_MACHINE}; do - i=$(expr $i + 1); - for type in ${UBOOT_CONFIG}; do - j=$(expr $j + 1); - if [ $j -eq $i ]; then - oe_runmake -C ${S} O=${B}/${config} ${config} - if [ -n "${@' '.join(find_cfgs(d))}" ]; then - merge_config.sh -m -O ${B}/${config} ${B}/${config}/.config ${@" ".join(find_cfgs(d))} - oe_runmake -C ${S} O=${B}/${config} oldconfig - fi - fi - done - unset j - done - unset i - DEVTOOL_DISABLE_MENUCONFIG=true - else - if [ -n "${UBOOT_MACHINE}" ]; then - oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE} - else - oe_runmake -C ${S} O=${B} oldconfig - fi - merge_config.sh -m .config ${@" ".join(find_cfgs(d))} - cml1_do_configure - fi -} +# Default name of u-boot initial env, but enable individual recipes to change +# this value. +UBOOT_INITIAL_ENV ?= "${PN}-initial-env" + +require u-boot-configure.inc +do_savedefconfig() { + bbplain "Saving defconfig to:\n${B}/defconfig" + oe_runmake -C ${B} savedefconfig +} +do_savedefconfig[nostamp] = "1" +addtask savedefconfig after do_configure +UBOOT_ARCH_DIR = "${@'arm' if d.getVar('UBOOT_ARCH').startswith('arm') else d.getVar('UBOOT_ARCH')}" do_compile () { if [ "${@bb.utils.filter('DISTRO_FEATURES', 'ld-is-gold', d)}" ]; then sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' ${S}/config.mk @@ -82,7 +65,7 @@ do_compile () { for binary in ${UBOOT_BINARIES}; do k=$(expr $k + 1); if [ $k -eq $i ]; then - cp ${B}/${config}/${binary} ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} + cp ${B}/${config}/${binary} ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} fi done @@ -106,6 +89,11 @@ do_compile () { oe_runmake -C ${S} O=${B} u-boot-initial-env fi fi + + if [ -n "${UBOOT_ENV}" ] && [ "${UBOOT_ENV_SUFFIX}" = "scr" ] + then + ${UBOOT_MKIMAGE} -C none -A ${UBOOT_ARCH} -T script -d ${WORKDIR}/${UBOOT_ENV_SRC} ${WORKDIR}/${UBOOT_ENV_BINARY} + fi } do_install () { @@ -117,9 +105,9 @@ do_install () { j=$(expr $j + 1); if [ $j -eq $i ] then - install -D -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} - ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type} - ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY} + install -D -m 644 ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} + ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type} + ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY} # Install the uboot-initial-env if [ -n "${UBOOT_INITIAL_ENV}" ]; then @@ -184,9 +172,9 @@ do_install () { j=$(expr $j + 1); if [ $j -eq $i ] then - install -m 644 ${B}/${config}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE}-${type}-${PV}-${PR} - ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${D}/boot/${SPL_BINARYNAME}-${type} - ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${D}/boot/${SPL_BINARYNAME} + install -m 644 ${B}/${config}/${SPL_BINARY} ${D}/boot/${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} + ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${D}/boot/${SPL_BINARYFILE}-${type} + ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${D}/boot/${SPL_BINARYFILE} fi done unset j @@ -194,7 +182,7 @@ do_install () { unset i else install -m 644 ${B}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE} - ln -sf ${SPL_IMAGE} ${D}/boot/${SPL_BINARYNAME} + ln -sf ${SPL_IMAGE} ${D}/boot/${SPL_BINARYFILE} fi fi @@ -210,17 +198,21 @@ do_install () { fi } -PACKAGE_BEFORE_PN += "${PN}-env" +PACKAGE_BEFORE_PN += "${PN}-env ${PN}-extlinux" -RPROVIDES_${PN}-env += "u-boot-default-env" -ALLOW_EMPTY_${PN}-env = "1" -FILES_${PN}-env = " \ +RPROVIDES:${PN}-env += "u-boot-default-env" +ALLOW_EMPTY:${PN}-env = "1" +FILES:${PN}-env = " \ ${@ '${sysconfdir}/${UBOOT_INITIAL_ENV}*' if d.getVar('UBOOT_INITIAL_ENV') else ''} \ ${sysconfdir}/fw_env.config \ " -FILES_${PN} = "/boot ${datadir}" -RDEPENDS_${PN} += "${PN}-env" +FILES:${PN}-extlinux = "${UBOOT_EXTLINUX_INSTALL_DIR}/${UBOOT_EXTLINUX_CONF_NAME}" +RDEPENDS:${PN} += "${@bb.utils.contains('UBOOT_EXTLINUX', '1', '${PN}-extlinux', '', d)}" + +SYSROOT_DIRS += "/boot" +FILES:${PN} = "/boot ${datadir}" +RDEPENDS:${PN} += "${PN}-env" do_deploy () { if [ -n "${UBOOT_CONFIG}" ] @@ -231,12 +223,12 @@ do_deploy () { j=$(expr $j + 1); if [ $j -eq $i ] then - install -D -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} + install -D -m 644 ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} cd ${DEPLOYDIR} - ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}-${type} - ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK} - ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}-${type} - ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY} + ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}-${type} + ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK} + ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}-${type} + ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY} # Deploy the uboot-initial-env if [ -n "${UBOOT_INITIAL_ENV}" ]; then @@ -312,12 +304,12 @@ do_deploy () { j=$(expr $j + 1); if [ $j -eq $i ] then - install -m 644 ${B}/${config}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE}-${type}-${PV}-${PR} - rm -f ${DEPLOYDIR}/${SPL_BINARYNAME} ${DEPLOYDIR}/${SPL_SYMLINK}-${type} - ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_BINARYNAME}-${type} - ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_BINARYNAME} - ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_SYMLINK}-${type} - ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_SYMLINK} + install -m 644 ${B}/${config}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} + rm -f ${DEPLOYDIR}/${SPL_BINARYFILE} ${DEPLOYDIR}/${SPL_SYMLINK} + ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_BINARYFILE}-${type} + ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_BINARYFILE} + ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_SYMLINK}-${type} + ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_SYMLINK} fi done unset j @@ -325,17 +317,14 @@ do_deploy () { unset i else install -m 644 ${B}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE} - rm -f ${DEPLOYDIR}/${SPL_BINARYNAME} ${DEPLOYDIR}/${SPL_SYMLINK} ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_BINARYNAME} ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_SYMLINK} fi fi - if [ -n "${UBOOT_ENV}" ] then install -m 644 ${WORKDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_IMAGE} - rm -f ${DEPLOYDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK} ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_BINARY} ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK} fi @@ -346,6 +335,11 @@ do_deploy () { ln -sf ${UBOOT_EXTLINUX_SYMLINK} ${DEPLOYDIR}/${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE} ln -sf ${UBOOT_EXTLINUX_SYMLINK} ${DEPLOYDIR}/${UBOOT_EXTLINUX_CONF_NAME} fi + + if [ -n "${UBOOT_DTB}" ] + then + install -m 644 ${B}/arch/${UBOOT_ARCH_DIR}/dts/${UBOOT_DTB_BINARY} ${DEPLOYDIR}/ + fi } addtask deploy before do_build after do_compile diff --git a/meta/recipes-bsp/u-boot/u-boot_2021.01.bb b/meta/recipes-bsp/u-boot/u-boot_2021.01.bb deleted file mode 100644 index bbbc99bf8d..0000000000 --- a/meta/recipes-bsp/u-boot/u-boot_2021.01.bb +++ /dev/null @@ -1,6 +0,0 @@ -require u-boot-common.inc -require u-boot.inc - -SRC_URI_append = " file://0001-riscv32-Use-double-float-ABI-for-rv32.patch" - -DEPENDS += "bc-native dtc-native python3-setuptools-native" diff --git a/meta/recipes-bsp/u-boot/u-boot_2024.04.bb b/meta/recipes-bsp/u-boot/u-boot_2024.04.bb new file mode 100644 index 0000000000..b15bcaa818 --- /dev/null +++ b/meta/recipes-bsp/u-boot/u-boot_2024.04.bb @@ -0,0 +1,5 @@ +require u-boot-common.inc +require u-boot.inc + +DEPENDS += "bc-native dtc-native python3-pyelftools-native" + diff --git a/meta/recipes-bsp/usbinit/usbinit.bb b/meta/recipes-bsp/usbinit/usbinit.bb index ef98f0bf62..3a50b835c2 100644 --- a/meta/recipes-bsp/usbinit/usbinit.bb +++ b/meta/recipes-bsp/usbinit/usbinit.bb @@ -4,10 +4,9 @@ all sorts of nifty things like SSH and NFS in one go plus charging over the \ same wire, at higher speeds than most Wifi connections." HOMEPAGE = "http://linux-sunxi.org/USB_Gadget/Ethernet" -LICENSE = "GPLv2" +LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYING.GPL;md5=751419260aa954499f7abaabaa882bbe" -PR = "r3" SRC_URI = "file://usb-gether \ file://COPYING.GPL" diff --git a/meta/recipes-bsp/usbutils/usbutils/0001-usbutils.pc.in-Fix-Cflags-entry.patch b/meta/recipes-bsp/usbutils/usbutils/0001-usbutils.pc.in-Fix-Cflags-entry.patch new file mode 100644 index 0000000000..039dd5cd72 --- /dev/null +++ b/meta/recipes-bsp/usbutils/usbutils/0001-usbutils.pc.in-Fix-Cflags-entry.patch @@ -0,0 +1,34 @@ +From f558919e858453a31313a3df35906de2e036940c Mon Sep 17 00:00:00 2001 +From: Fabio Estevam <festevam@denx.de> +Date: Thu, 4 Jan 2024 03:32:11 +0100 +Subject: [PATCH] usbutils.pc.in: Fix Cflags entry + +When updating the usbutils version in OpenEmbedded from 015 to 017, +the following QA error is seen: + +QA Issue: File /usr/lib/pkgconfig/usbutils.pc in package usbutils-dev contains reference to TMPDIR [buildpaths] + +As this causes reproducibility problem due to the host PC path being +leaked, it is treated as error. + +Fix it by using the standard Cflags entry. + +Upstream-Status: Submitted [https://github.com/gregkh/usbutils/pull/184/commits/3b3e5e1ebea7060bfa118d25a91b816dfa176b31] +Signed-off-by: Fabio Estevam <festevam@denx.de> +--- + usbutils.pc.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/usbutils.pc.in b/usbutils.pc.in +index e69778c3195c..0aa0005de951 100644 +--- a/usbutils.pc.in ++++ b/usbutils.pc.in +@@ -15,4 +15,4 @@ Requires: libusb-1.0 >= 1.0.14 libudev >= 196 + Conflicts: + Libs: -L${libdir} + Libs.private: @LIBUSB_LIBS@ @UDEV_LIBS@ +-Cflags: @CFLAGS@ @LIBUSB_CFLAGS@ @UDEV_CFLAGS@ ++Cflags: -I${includedir} +-- +2.34.1 + diff --git a/meta/recipes-bsp/usbutils/usbutils_013.bb b/meta/recipes-bsp/usbutils/usbutils_013.bb deleted file mode 100644 index 51f909b795..0000000000 --- a/meta/recipes-bsp/usbutils/usbutils_013.bb +++ /dev/null @@ -1,30 +0,0 @@ -SUMMARY = "Host side USB console utilities" -DESCRIPTION = "Contains the lsusb utility for inspecting the devices connected to the USB bus." -HOMEPAGE = "http://www.linux-usb.org" -SECTION = "base" - -LICENSE = "GPLv2+ & (GPLv2 | GPLv3)" -# License files went missing in 010, when 011 is released add LICENSES/* back -LIC_FILES_CHKSUM = "file://lsusb.c;endline=1;md5=7d4861d978ff5ba7cb2b319ed1d4afe3 \ - file://lsusb.py.in;beginline=2;endline=2;md5=194d6a0226bf90f4f683e8968878b6cd" - -DEPENDS = "libusb1 virtual/libiconv udev" - -SRC_URI = "${KERNELORG_MIRROR}/linux/utils/usb/usbutils/usbutils-${PV}.tar.gz \ - " -SRC_URI[sha256sum] = "efdfd5403dbdd7412de6bb897d5fbaae65ef3eb4332032c0e1f216216618e9a9" - -inherit autotools pkgconfig update-alternatives - -ALTERNATIVE_${PN} = "lsusb" -ALTERNATIVE_PRIORITY = "100" - -# The binaries are mostly GPLv2+ apart from lsusb.py which is GPLv2 or v3. -LICENSE_${PN} = "GPLv2+" -LICENSE_${PN}-python = "GPLv2 | GPLv3" - -RRECOMMENDS_${PN} = "udev-hwdb" - -PACKAGE_BEFORE_PN =+ "${PN}-python" -FILES_${PN}-python += "${bindir}/lsusb.py" -RDEPENDS_${PN}-python = "python3-core" diff --git a/meta/recipes-bsp/usbutils/usbutils_017.bb b/meta/recipes-bsp/usbutils/usbutils_017.bb new file mode 100644 index 0000000000..a2e340ea4f --- /dev/null +++ b/meta/recipes-bsp/usbutils/usbutils_017.bb @@ -0,0 +1,33 @@ +SUMMARY = "Host side USB console utilities" +DESCRIPTION = "Contains the lsusb utility for inspecting the devices connected to the USB bus." +HOMEPAGE = "http://www.linux-usb.org" +SECTION = "base" + +LICENSE = "GPL-2.0-or-later & (GPL-2.0-only | GPL-3.0-only)" +# License files went missing in 010, when 011 is released add LICENSES/* back +LIC_FILES_CHKSUM = "file://lsusb.c;endline=1;md5=7226e442a172bcf25807246d7ef1eba1 \ + file://lsusb.py.in;beginline=2;endline=2;md5=c443ada211d701156e42ea36d41625b3 \ + " + +DEPENDS = "libusb1 virtual/libiconv udev" + +SRC_URI = "${KERNELORG_MIRROR}/linux/utils/usb/usbutils/usbutils-${PV}.tar.gz \ + file://0001-usbutils.pc.in-Fix-Cflags-entry.patch \ + " +SRC_URI[sha256sum] = "f704c4cb78a060db88b43aac6ebfd3d93c2c5cf1d6dd0e42936faaf00814ab00" + +inherit autotools pkgconfig update-alternatives + +ALTERNATIVE:${PN} = "lsusb" +ALTERNATIVE_PRIORITY = "100" + +# The binaries are mostly GPL-2.0-or-later apart from lsusb.py which is +# GPL-2.0-only or GPL-3.0-only. +LICENSE:${PN} = "GPL-2.0-or-later" +LICENSE:${PN}-python = "GPL-2.0-only | GPL-3.0-only" + +RRECOMMENDS:${PN} = "udev-hwdb" + +PACKAGE_BEFORE_PN =+ "${PN}-python" +FILES:${PN}-python += "${bindir}/lsusb.py" +RDEPENDS:${PN}-python = "python3-core" diff --git a/meta/recipes-bsp/v86d/v86d_0.1.10.bb b/meta/recipes-bsp/v86d/v86d_0.1.10.bb index e614de0c48..6151f0a7e2 100644 --- a/meta/recipes-bsp/v86d/v86d_0.1.10.bb +++ b/meta/recipes-bsp/v86d/v86d_0.1.10.bb @@ -3,12 +3,10 @@ HOMEPAGE = "https://tracker.debian.org/pkg/v86d" DESCRIPTION = "v86d provides a backend for kernel drivers that need to execute x86 BIOS code. The code is executed in a controlled environment and the results are passed back to the kernel via the netlink interface." # the copyright info is at the bottom of README, expect break -LICENSE = "GPLv2" +LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://README;md5=94ac1971e4f2309dc322d598e7b1f7dd" -DEPENDS = "virtual/kernel" -RRECOMMENDS_${PN} = "kernel-module-uvesafb" -PR = "r2" +RRECOMMENDS:${PN} = "kernel-module-uvesafb" SRC_URI = "http://snapshot.debian.org/archive/debian/20110427T035506Z/pool/main/v/${BPN}/${BPN}_${PV}.orig.tar.gz \ file://Update-x86emu-from-X.org.patch \ |