summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-bsp')
-rw-r--r--meta/recipes-bsp/acpid/acpid.inc12
-rw-r--r--meta/recipes-bsp/acpid/acpid/0001-Replace-stat64-with-stat.patch31
-rw-r--r--meta/recipes-bsp/acpid/acpid_2.0.34.bb (renamed from meta/recipes-bsp/acpid/acpid_2.0.33.bb)2
-rw-r--r--meta/recipes-bsp/alsa-state/alsa-state.bb11
-rw-r--r--meta/recipes-bsp/apmd/apmd/apmd.service7
-rw-r--r--meta/recipes-bsp/apmd/apmd/apmd_proxy91
-rw-r--r--meta/recipes-bsp/apmd/apmd/apmd_proxy.conf16
-rw-r--r--meta/recipes-bsp/apmd/apmd/default8
-rwxr-xr-xmeta/recipes-bsp/apmd/apmd/init51
-rw-r--r--meta/recipes-bsp/apmd/apmd/legacy.patch133
-rw-r--r--meta/recipes-bsp/apmd/apmd/libtool.patch41
-rw-r--r--meta/recipes-bsp/apmd/apmd/linkage.patch53
-rw-r--r--meta/recipes-bsp/apmd/apmd/unlinux.patch25
-rw-r--r--meta/recipes-bsp/apmd/apmd/wexitcode.patch26
-rw-r--r--meta/recipes-bsp/apmd/apmd_3.2.2-15.bb85
-rw-r--r--meta/recipes-bsp/barebox/barebox-common.inc8
-rw-r--r--meta/recipes-bsp/barebox/barebox-tools.bb55
-rw-r--r--meta/recipes-bsp/barebox/barebox.bb10
-rw-r--r--meta/recipes-bsp/efibootmgr/efibootmgr_18.bb5
-rw-r--r--meta/recipes-bsp/efivar/efivar/0001-Fix-glibc-2.36-build-mount.h-conflicts.patch60
-rw-r--r--meta/recipes-bsp/efivar/efivar/0001-Fix-invalid-free-in-main.patch30
-rw-r--r--meta/recipes-bsp/efivar/efivar/0001-src-Makefile-build-util.c-separately-for-makeguids.patch38
-rw-r--r--meta/recipes-bsp/efivar/efivar/efisecdb-fix-build-with-musl-libc.patch184
-rw-r--r--meta/recipes-bsp/efivar/efivar_39.bb (renamed from meta/recipes-bsp/efivar/efivar_38.bb)14
-rwxr-xr-xmeta/recipes-bsp/formfactor/files/qemuriscv32/machconfig10
-rwxr-xr-xmeta/recipes-bsp/formfactor/files/qemuriscv64/machconfig10
-rw-r--r--meta/recipes-bsp/formfactor/formfactor_0.0.bb4
-rw-r--r--meta/recipes-bsp/gnu-efi/gnu-efi/0001-Do-not-treat-warnings-as-errors.patch29
-rw-r--r--meta/recipes-bsp/gnu-efi/gnu-efi/gnu-efi-3.0.9-fix-clang-build.patch24
-rw-r--r--meta/recipes-bsp/gnu-efi/gnu-efi/parallel-make-archives.patch39
-rw-r--r--meta/recipes-bsp/gnu-efi/gnu-efi_4.0.1.bb (renamed from meta/recipes-bsp/gnu-efi/gnu-efi_3.0.15.bb)45
-rw-r--r--meta/recipes-bsp/grub/files/0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch43
-rw-r--r--meta/recipes-bsp/grub/files/0001-RISC-V-Restore-the-typcast-to-long.patch10
-rw-r--r--meta/recipes-bsp/grub/files/0001-configure-Remove-obsoleted-malign-jumps-loops-functi.patch48
-rw-r--r--meta/recipes-bsp/grub/files/0001-configure.ac-Use-_zicsr_zifencei-extentions-on-riscv.patch47
-rw-r--r--meta/recipes-bsp/grub/files/0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch10
-rw-r--r--meta/recipes-bsp/grub/files/0001-misc-Implement-grub_strlcpy.patch68
-rw-r--r--meta/recipes-bsp/grub/files/0002-configure-Check-for-falign-jumps-1-beside-falign-loo.patch59
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2021-3695-video-readers-png-Drop-greyscale-support-to-fix-heap.patch179
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2021-3696-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff.patch50
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2021-3697-video-readers-jpeg-Block-int-underflow-wild-pointer.patch84
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2021-3981-grub-mkconfig-Restore-umask-for-the-grub.cfg.patch49
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2022-28733-net-ip-Do-IP-fragment-maths-safely.patch63
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2022-28734-net-http-Error-out-on-headers-with-LF-without-CR.patch58
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2022-28734-net-http-Fix-OOB-write-for-split-http-headers.patch56
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2022-28735-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch111
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2024-45774.patch37
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2024-45775.patch38
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2024-45776.patch39
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2024-45777.patch57
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2024-45778_CVE-2024-45779.patch55
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2024-45780.patch93
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2024-45781.patch35
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2024-45782_CVE-2024-56737.patch36
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2024-45783.patch39
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2025-0622-01.patch35
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2025-0622-02.patch41
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2025-0622-03.patch38
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2025-0624.patch84
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2025-0677_CVE-2025-0684_CVE-2025-0685_CVE-2025-0686_CVE-2025-0689.patch377
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2025-0678_CVE-2025-1125.patch87
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2025-0690.patch73
-rw-r--r--meta/recipes-bsp/grub/files/CVE-2025-1118.patch37
-rw-r--r--meta/recipes-bsp/grub/files/autogen.sh-exclude-pc.patch10
-rw-r--r--meta/recipes-bsp/grub/files/determinism.patch68
-rw-r--r--meta/recipes-bsp/grub/files/grub-module-explicitly-keeps-symbole-.module_license.patch9
-rw-r--r--meta/recipes-bsp/grub/files/video-Remove-trailing-whitespaces.patch693
-rw-r--r--meta/recipes-bsp/grub/files/video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch264
-rw-r--r--meta/recipes-bsp/grub/files/video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch53
-rw-r--r--meta/recipes-bsp/grub/grub-bootconf_1.00.bb4
-rw-r--r--meta/recipes-bsp/grub/grub-efi_2.12.bb (renamed from meta/recipes-bsp/grub/grub-efi_2.06.bb)11
-rw-r--r--meta/recipes-bsp/grub/grub2.inc63
-rw-r--r--meta/recipes-bsp/grub/grub_2.12.bb (renamed from meta/recipes-bsp/grub/grub_2.06.bb)0
-rw-r--r--meta/recipes-bsp/keymaps/keymaps_1.0.bb5
-rw-r--r--meta/recipes-bsp/libacpi/files/0001-libacpi-Fix-build-witth-fno-commom.patch2
-rw-r--r--meta/recipes-bsp/libacpi/files/ldflags.patch3
-rw-r--r--meta/recipes-bsp/libacpi/files/libacpi_fix_for_x32.patch2
-rw-r--r--meta/recipes-bsp/libacpi/files/makefile-fix.patch2
-rw-r--r--meta/recipes-bsp/libacpi/files/use_correct_strip_in_cross_environment.patch2
-rw-r--r--meta/recipes-bsp/libacpi/libacpi_0.2.bb2
-rw-r--r--meta/recipes-bsp/lrzsz/lrzsz-0.12.20/0001-Fix-build-with-GCC-15.patch186
-rw-r--r--meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb16
-rw-r--r--meta/recipes-bsp/opensbi/opensbi-payloads.inc12
-rw-r--r--meta/recipes-bsp/opensbi/opensbi_1.7.bb (renamed from meta/recipes-bsp/opensbi/opensbi_1.1.bb)22
-rw-r--r--meta/recipes-bsp/pciutils/pciutils/configure.patch91
-rw-r--r--meta/recipes-bsp/pciutils/pciutils_3.14.0.bb (renamed from meta/recipes-bsp/pciutils/pciutils_3.8.0.bb)57
-rw-r--r--meta/recipes-bsp/pm-utils/pm-utils_1.4.1.bb10
-rw-r--r--meta/recipes-bsp/setserial/setserial_2.17.bb5
-rw-r--r--meta/recipes-bsp/u-boot/files/0001-riscv-fix-build-with-binutils-2.38.patch40
-rw-r--r--meta/recipes-bsp/u-boot/files/0001-riscv32-Use-double-float-ABI-for-rv32.patch44
-rw-r--r--meta/recipes-bsp/u-boot/files/disable-CONFIG_BLOBLIST.cfg1
-rw-r--r--meta/recipes-bsp/u-boot/files/disable_CONFIG_USB.cfg1
-rw-r--r--meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_a.cfg1
-rw-r--r--meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_c.cfg1
-rw-r--r--meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_clear.cfg6
-rw-r--r--meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_d.cfg1
-rw-r--r--meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_f.cfg1
-rw-r--r--meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_zbb.cfg1
-rw-r--r--meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_zicbom.cfg1
-rw-r--r--meta/recipes-bsp/u-boot/libubootenv/0001-Update-cmake_minimum_required-to-3.5.patch50
-rw-r--r--meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb (renamed from meta/recipes-bsp/u-boot/libubootenv_0.3.3.bb)10
-rw-r--r--meta/recipes-bsp/u-boot/u-boot-common.inc19
-rw-r--r--meta/recipes-bsp/u-boot/u-boot-configure.inc39
-rw-r--r--meta/recipes-bsp/u-boot/u-boot-tools.inc16
-rw-r--r--meta/recipes-bsp/u-boot/u-boot-tools_2025.04.bb (renamed from meta/recipes-bsp/u-boot/u-boot-tools_2022.07.bb)1
-rw-r--r--meta/recipes-bsp/u-boot/u-boot.inc323
-rw-r--r--meta/recipes-bsp/u-boot/u-boot_2022.07.bb9
-rw-r--r--meta/recipes-bsp/u-boot/u-boot_2025.04.bb8
-rw-r--r--meta/recipes-bsp/usbinit/usbinit.bb25
-rw-r--r--meta/recipes-bsp/usbinit/usbinit/COPYING.GPL339
-rwxr-xr-xmeta/recipes-bsp/usbinit/usbinit/usb-gether23
-rw-r--r--meta/recipes-bsp/usbutils/usbutils_018.bb (renamed from meta/recipes-bsp/usbutils/usbutils_014.bb)18
-rw-r--r--meta/recipes-bsp/v86d/v86d_0.1.10.bb3
113 files changed, 2133 insertions, 3733 deletions
diff --git a/meta/recipes-bsp/acpid/acpid.inc b/meta/recipes-bsp/acpid/acpid.inc
index 98910bab29..ba954563b6 100644
--- a/meta/recipes-bsp/acpid/acpid.inc
+++ b/meta/recipes-bsp/acpid/acpid.inc
@@ -10,14 +10,16 @@ BUGTRACKER = "http://sourceforge.net/p/acpid2/tickets/?source=navbar"
10SECTION = "base" 10SECTION = "base"
11LICENSE = "GPL-2.0-or-later" 11LICENSE = "GPL-2.0-or-later"
12 12
13SRC_URI = "${SOURCEFORGE_MIRROR}/acpid2/acpid-${PV}.tar.xz \ 13SOURCEFORGE_PROJECT = "acpid2"
14SRC_URI = "${SOURCEFORGE_MIRROR}/${SOURCEFORGE_PROJECT}/acpid-${PV}.tar.xz \
14 file://init \ 15 file://init \
15 file://acpid.service \ 16 file://acpid.service \
16 " 17 file://0001-Replace-stat64-with-stat.patch \
18 "
17 19
18CVE_PRODUCT = "acpid2" 20CVE_PRODUCT = "acpid2"
19 21
20inherit autotools update-rc.d systemd 22inherit autotools update-rc.d systemd sourceforge-releases
21 23
22INITSCRIPT_NAME = "acpid" 24INITSCRIPT_NAME = "acpid"
23INITSCRIPT_PARAMS = "defaults" 25INITSCRIPT_PARAMS = "defaults"
@@ -26,13 +28,13 @@ SYSTEMD_SERVICE:${PN} = "acpid.service"
26 28
27do_install:append () { 29do_install:append () {
28 install -d ${D}${sysconfdir}/init.d 30 install -d ${D}${sysconfdir}/init.d
29 sed -e 's,/usr/sbin,${sbindir},g' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/acpid 31 sed -e 's,/usr/sbin,${sbindir},g' ${UNPACKDIR}/init > ${D}${sysconfdir}/init.d/acpid
30 chmod 755 ${D}${sysconfdir}/init.d/acpid 32 chmod 755 ${D}${sysconfdir}/init.d/acpid
31 33
32 install -d ${D}${sysconfdir}/acpi 34 install -d ${D}${sysconfdir}/acpi
33 install -d ${D}${sysconfdir}/acpi/events 35 install -d ${D}${sysconfdir}/acpi/events
34 36
35 install -d ${D}${systemd_system_unitdir} 37 install -d ${D}${systemd_system_unitdir}
36 install -m 0644 ${WORKDIR}/acpid.service ${D}${systemd_system_unitdir} 38 install -m 0644 ${UNPACKDIR}/acpid.service ${D}${systemd_system_unitdir}
37 sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_system_unitdir}/acpid.service 39 sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_system_unitdir}/acpid.service
38} 40}
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 @@
1From 4b729235a9e96f120feee7e3746818aad0f3b924 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 14 Dec 2022 15:04:30 -0800
4Subject: [PATCH] Replace stat64 with stat
5
6It already checks for largefile support in configure.ac via
7AC_SYS_LARGEFILE macro, which will ensure that 64bit elements
8are correctly setup for stat APIs on platforms needing large
9file support.
10
11Upstream-Status: Submitted [https://sourceforge.net/p/acpid2/code/merge-requests/5/]
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 sock.c | 4 ++--
15 1 file changed, 2 insertions(+), 2 deletions(-)
16
17diff --git a/sock.c b/sock.c
18index 9e04501..3121fb7 100644
19--- a/sock.c
20+++ b/sock.c
21@@ -54,8 +54,8 @@ int non_root_clients;
22 static int
23 isfdtype(int fd, int fdtype)
24 {
25- struct stat64 st;
26- if (fstat64(fd, &st) != 0)
27+ struct stat st;
28+ if (fstat(fd, &st) != 0)
29 return -1;
30 return ((st.st_mode & S_IFMT) == (mode_t)fdtype);
31 }
diff --git a/meta/recipes-bsp/acpid/acpid_2.0.33.bb b/meta/recipes-bsp/acpid/acpid_2.0.34.bb
index 7094ba2662..1e0a6d5f24 100644
--- a/meta/recipes-bsp/acpid/acpid_2.0.33.bb
+++ b/meta/recipes-bsp/acpid/acpid_2.0.34.bb
@@ -3,4 +3,4 @@ require acpid.inc
3LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \ 3LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
4 file://acpid.h;endline=24;md5=324a9cf225ae69ddaad1bf9d942115b5" 4 file://acpid.h;endline=24;md5=324a9cf225ae69ddaad1bf9d942115b5"
5 5
6SRC_URI[sha256sum] = "0856f71b3eb34a1b663d0a8e6363dfcbc519e63d847330498898658e2972dbe8" 6SRC_URI[sha256sum] = "2d095c8cfcbc847caec746d62cdc8d0bff1ec1bc72ef7c674c721e04da6ab333"
diff --git a/meta/recipes-bsp/alsa-state/alsa-state.bb b/meta/recipes-bsp/alsa-state/alsa-state.bb
index 27b2eccbe4..9452a1a4ce 100644
--- a/meta/recipes-bsp/alsa-state/alsa-state.bb
+++ b/meta/recipes-bsp/alsa-state/alsa-state.bb
@@ -14,7 +14,6 @@ LIC_FILES_CHKSUM = " \
14 file://alsa-state-init;beginline=3;endline=4;md5=3ff7ecbf534d7d503941abe8e268ef50 \ 14 file://alsa-state-init;beginline=3;endline=4;md5=3ff7ecbf534d7d503941abe8e268ef50 \
15" 15"
16PV = "0.2.0" 16PV = "0.2.0"
17PR = "r5"
18 17
19SRC_URI = "\ 18SRC_URI = "\
20 file://asound.conf \ 19 file://asound.conf \
@@ -22,7 +21,7 @@ SRC_URI = "\
22 file://alsa-state-init \ 21 file://alsa-state-init \
23" 22"
24 23
25S = "${WORKDIR}" 24S = "${UNPACKDIR}"
26 25
27# As the recipe doesn't inherit systemd.bbclass, we need to set this variable 26# As the recipe doesn't inherit systemd.bbclass, we need to set this variable
28# manually to avoid unnecessary postinst/preinst generated. 27# manually to avoid unnecessary postinst/preinst generated.
@@ -39,15 +38,15 @@ INITSCRIPT_PARAMS = "start 39 S . stop 31 0 6 ."
39do_install() { 38do_install() {
40 # Only install the init script when 'sysvinit' is in DISTRO_FEATURES. 39 # Only install the init script when 'sysvinit' is in DISTRO_FEATURES.
41 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then 40 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
42 sed -i -e "s:#STATEDIR#:${localstatedir}/lib/alsa:g" ${WORKDIR}/alsa-state-init 41 sed -i -e "s:#STATEDIR#:${localstatedir}/lib/alsa:g" ${S}/alsa-state-init
43 install -d ${D}${sysconfdir}/init.d 42 install -d ${D}${sysconfdir}/init.d
44 install -m 0755 ${WORKDIR}/alsa-state-init ${D}${sysconfdir}/init.d/alsa-state 43 install -m 0755 ${S}/alsa-state-init ${D}${sysconfdir}/init.d/alsa-state
45 fi 44 fi
46 45
47 install -d ${D}/${localstatedir}/lib/alsa 46 install -d ${D}/${localstatedir}/lib/alsa
48 install -d ${D}${sysconfdir} 47 install -d ${D}${sysconfdir}
49 install -m 0644 ${WORKDIR}/asound.conf ${D}${sysconfdir} 48 install -m 0644 ${S}/asound.conf ${D}${sysconfdir}
50 install -m 0644 ${WORKDIR}/*.state ${D}${localstatedir}/lib/alsa 49 install -m 0644 ${S}/*.state ${D}${localstatedir}/lib/alsa
51} 50}
52 51
53PACKAGES += "alsa-states" 52PACKAGES += "alsa-states"
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 @@
1[Unit]
2Description=Advanced Power Management daemon
3After=remote-fs.target
4
5[Service]
6EnvironmentFile=-@SYSCONFDIR@/default/apmd
7ExecStart=@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 @@
1#!/bin/sh
2#
3# apmd_proxy - program dispatcher for APM daemon
4#
5# Written by Craig Markwardt (craigm@lheamail.gsfc.nasa.gov) 21 May 1999
6# Modified for Debian by Avery Pennarun
7#
8# This shell script is called by the APM daemon (apmd) when a power
9# management event occurs. Its first and second arguments describe the
10# event. For example, apmd will call "apmd_proxy suspend system" just
11# before the system is suspended.
12#
13# Here are the possible arguments:
14#
15# start - APM daemon has started
16# stop - APM daemon is shutting down
17# suspend critical - APM system indicates critical suspend (++)
18# suspend system - APM system has requested suspend mode
19# suspend user - User has requested suspend mode
20# standby system - APM system has requested standby mode
21# standby user - User has requested standby mode
22# resume suspend - System has resumed from suspend mode
23# resume standby - System has resumed from standby mode
24# resume critical - System has resumed from critical suspend
25# change battery - APM system reported low battery
26# change power - APM system reported AC/battery change
27# change time - APM system reported time change (*)
28# change capability - APM system reported config. change (+)
29#
30# (*) - APM daemon may be configured to not call these sequences
31# (+) - Available if APM kernel supports it.
32# (++) - "suspend critical" is never passed to apmd from the kernel,
33# so we will never see it here. Scripts that process "resume
34# critical" events need to take this into account.
35#
36# It is the proxy script's responsibility to examine the APM status
37# (via /proc/apm) or other status and to take appropriate actions.
38# For example, the script might unmount network drives before the
39# machine is suspended.
40#
41# In Debian, the usual way of adding functionality to the proxy is to
42# add a script to /etc/apm/event.d. This script will be called by
43# apmd_proxy (via run-parts) with the same arguments.
44#
45# If it is important that a certain set of script be run in a certain
46# order on suspend and in a different order on resume, then put all
47# the scripts in /etc/apm/scripts.d instead of /etc/apm/event.d and
48# symlink to these from /etc/apm/suspend.d, /etc/apm/resume.d and
49# /etc/apm/other.d using names whose lexicographical order is the same
50# as the desired order of execution.
51#
52# If the kernel's APM driver supports it, apmd_proxy can return a non-zero
53# exit status on suspend and standby events, indicating that the suspend
54# or standby event should be rejected.
55#
56# *******************************************************************
57
58set -e
59
60# The following doesn't yet work, because current kernels (up to at least
61# 2.4.20) do not support rejection of APM events. Supporting this would
62# require substantial modifications to the APM driver. We will re-enable
63# this feature if the driver is ever modified. -- cph@debian.org
64#
65#SUSPEND_ON_AC=false
66#[ -r /etc/apm/apmd_proxy.conf ] && . /etc/apm/apmd_proxy.conf
67#
68#if [ "${SUSPEND_ON_AC}" = "false" -a "${2}" = "system" ] \
69# && on_ac_power >/dev/null; then
70# # Reject system suspends and standbys if we are on AC power
71# exit 1 # Reject (NOTE kernel support must be enabled)
72#fi
73
74if [ "${1}" = "suspend" -o "${1}" = "standby" ]; then
75 run-parts -a "${1}" -a "${2}" /etc/apm/event.d
76 if [ -d /etc/apm/suspend.d ]; then
77 run-parts -a "${1}" -a "${2}" /etc/apm/suspend.d
78 fi
79elif [ "${1}" = "resume" ]; then
80 if [ -d /etc/apm/resume.d ]; then
81 run-parts -a "${1}" -a "${2}" /etc/apm/resume.d
82 fi
83 run-parts -a "${1}" -a "${2}" /etc/apm/event.d
84else
85 run-parts -a "${1}" -a "${2}" /etc/apm/event.d
86 if [ -d /etc/apm/other.d ]; then
87 run-parts -a "${1}" -a "${2}" /etc/apm/other.d
88 fi
89fi
90
91exit 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 @@
1# /etc/apm/apmd_proxy.conf: configuration file for apmd.
2#
3# This file is managed by debconf when installing or reconfiguring the
4# package. It is generated by merging the answers gathered by debconf
5# into the template file "/usr/share/apmd/apmd_proxy.conf".
6
7# The following doesn't yet work, because current kernels (up to at least
8# 2.4.20) do not support rejection of APM events. Supporting this would
9# require substantial modifications to the APM driver. We will re-enable
10# this feature if the driver is ever modified. -- cph@debian.org
11#
12# Set the following to "false" if you want to reject system suspend or
13# system standby requests when the computer is running on AC power.
14# Otherwise set this to "true". Such requests are never rejected when
15# the computer is running on battery power.
16#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 @@
1#
2# Default for /etc/init.d/apmd
3#
4
5# As apmd can be called with arguments, we use the following variable
6# to store them, e.g., APMD="-w 5 -p 2".
7# See the manual page apmd(8) for details.
8APMD="--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 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: apmd
4# Required-Start: $remote_fs
5# Required-Stop: $remote_fs
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: Advanced Power Management daemon
9### END INIT INFO
10
11# Source function library.
12. /etc/init.d/functions
13
14PATH=/bin:/usr/bin:/sbin:/usr/sbin
15
16[ -f /etc/default/rcS ] && . /etc/default/rcS
17[ -f /etc/default/apmd ] && . /etc/default/apmd
18
19case "$1" in
20 start)
21 echo -n "Starting advanced power management daemon: "
22 start-stop-daemon -S -x /usr/sbin/apmd -- \
23 -P /etc/apm/apmd_proxy $APMD
24 if [ $? = 0 ]; then
25 echo "apmd."
26 else
27 echo "(failed.)"
28 fi
29 ;;
30 stop)
31 echo -n "Stopping advanced power management daemon: "
32 start-stop-daemon -K \
33 -x /usr/sbin/apmd
34 echo "apmd."
35 ;;
36 status)
37 status /usr/sbin/apmd;
38 exit $?
39 ;;
40 restart|force-reload)
41 $0 stop
42 $0 start
43 exit
44 ;;
45 *)
46 echo "Usage: /etc/init.d/apmd {start|stop|status|restart|force-reload}"
47 exit 1
48 ;;
49esac
50
51exit 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 @@
1From 3595933d221f0ba836917debc0776b8723972ec9 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Tue, 11 Aug 2015 17:40:50 +0300
4Subject: [PATCH 1/3] Patch with fixes provided by Debian.
5
6This patch is taken from
7ftp://ftp.debian.org/debian/pool/main/a/apmd/apmd_3.2.2-15.debian.tar.xz
8
9Upstream-Status: Inappropriate [upstream is dead]
10Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
11
12---
13 Makefile | 2 +-
14 apm.c | 3 ++-
15 apm.h | 9 +++++++++
16 apmd.c | 15 ++++++++-------
17 4 files changed, 20 insertions(+), 9 deletions(-)
18
19diff --git a/Makefile b/Makefile
20index bf346d9..92fc0fd 100644
21--- a/Makefile
22+++ b/Makefile
23@@ -43,7 +43,7 @@ DESTDIR=
24
25 CC=gcc
26 CFLAGS=-O -g
27-XTRACFLAGS=-Wall -pipe -I. -I/usr/src/linux/include \
28+XTRACFLAGS=-Wall -pipe -I. -I/usr/src/linux/include -I/usr/X11R6/include \
29 -I/usr/src/linux-2.2/include -I /usr/src/linux-2.0/include \
30 -DVERSION=\"$(VERSION)\" \
31 -DDEFAULT_PROXY_NAME=\"$(PROXY_DIR)/apmd_proxy\"
32diff --git a/apm.c b/apm.c
33index b21c057..0359b1c 100644
34--- a/apm.c
35+++ b/apm.c
36@@ -219,12 +219,13 @@ int main(int argc, char **argv)
37 }
38 }
39
40-
41+#if 0
42 if (!(i.apm_flags & APM_32_BIT_SUPPORT))
43 {
44 fprintf(stderr, "32-bit APM interface not supported\n");
45 exit(1);
46 }
47+#endif
48
49 if (verbose && (i.apm_flags & 0x10))
50 printf("APM BIOS Power Management is currently disabled\n");
51diff --git a/apm.h b/apm.h
52index fb24dfd..824cc06 100644
53--- a/apm.h
54+++ b/apm.h
55@@ -20,6 +20,13 @@
56 * $Id: apm.h,v 1.7 1999/07/05 22:31:11 apenwarr Exp $
57 *
58 */
59+#ifndef _APM_H
60+#define _APM_H 1
61+
62+#ifndef __KERNEL_STRICT_NAMES
63+#define __KERNEL_STRICT_NAMES
64+#endif
65+
66 #include <linux/apm_bios.h>
67 #include <sys/types.h>
68
69@@ -93,3 +100,5 @@ extern int apm_reject(int fd);
70 #else
71 #define apm_reject(fd) (-EINVAL)
72 #endif
73+
74+#endif
75diff --git a/apmd.c b/apmd.c
76index 49ed3a1..560f536 100644
77--- a/apmd.c
78+++ b/apmd.c
79@@ -343,7 +343,7 @@ static int call_proxy(apm_event_t event)
80 /* parent */
81 int status, retval;
82 ssize_t len;
83- time_t time_limit;
84+ time_t countdown;
85
86 if (pid < 0) {
87 /* Couldn't fork */
88@@ -356,8 +356,9 @@ static int call_proxy(apm_event_t event)
89 /* Capture the child's output, if any, but only until it terminates */
90 close(fds[1]);
91 fcntl(fds[0], F_SETFL, O_RDONLY|O_NONBLOCK);
92- time_limit = time(0) + proxy_timeout;
93+ countdown = proxy_timeout;
94 do {
95+ countdown -= 1;
96 while ((len = read(fds[0], line, sizeof(line)-1)) > 0) {
97 line[len] = 0;
98 APMD_SYSLOG(LOG_INFO, "+ %s", line);
99@@ -372,16 +373,16 @@ static int call_proxy(apm_event_t event)
100 goto proxy_done;
101 }
102
103- sleep(1);
104+ while (sleep(1) > 0) ;
105 } while (
106- (time(0) < time_limit)
107+ (countdown >= 0)
108 || (proxy_timeout < 0)
109 );
110
111 APMD_SYSLOG(LOG_NOTICE, "Proxy has been running more than %d seconds; killing it", proxy_timeout);
112
113 kill(pid, SIGTERM);
114- time_limit = time(0) + 5;
115+ countdown = 5;
116 do {
117 retval = waitpid(pid, &status, WNOHANG);
118 if (retval == pid)
119@@ -392,9 +393,9 @@ static int call_proxy(apm_event_t event)
120 goto proxy_done;
121 }
122
123- sleep(1);
124+ while (sleep(1) > 0) ;
125
126- } while (time(0) < time_limit);
127+ } while (countdown >= 0);
128
129 kill(pid, SIGKILL);
130 status = __W_EXITCODE(0, SIGKILL);
131--
1322.1.4
133
diff --git a/meta/recipes-bsp/apmd/apmd/libtool.patch b/meta/recipes-bsp/apmd/apmd/libtool.patch
deleted file mode 100644
index fd0a952890..0000000000
--- a/meta/recipes-bsp/apmd/apmd/libtool.patch
+++ /dev/null
@@ -1,41 +0,0 @@
1From d5dde7ca91a5aed273d8fe269e1a5194e85c8c79 Mon Sep 17 00:00:00 2001
2From: Scott Garman <scott.a.garman@intel.com>
3Date: Tue, 13 Jul 2010 16:46:46 +0800
4Subject: [PATCH] apmd: upgrade to 3.2.2-14
5
6Add by RP to address "unable to infer tagged configuration" error:
7 commit 35de05e61b88c0808a5e885bb0efdf420555d5ad
8 Author: Richard Purdie <rpurdie@rpsys.net>
9 Date: Sun Jun 1 16:13:38 2008 +0000
10
11 apmd: Use libtool --tag options to avoid problems with libtool 2.2.4 (from poky)
12
13However I didn't see same issue with current libtool-2.2.10. Also per my understanding,
14the default tag, if not specified, falls back to CC. So disable it from patching, but
15keep it here. If we encounter similar issue in the future, we could then push upstream
16
17Comment added by Kevin Tian <kevin.tian@intel.com>, 2010-07-16
18
19Upstream-Status: Pending
20
21Signed-off-by: Scott Garman <scott.a.garman@intel.com>
22
23---
24 Makefile | 4 ++--
25 1 file changed, 2 insertions(+), 2 deletions(-)
26
27diff --git a/Makefile b/Makefile
28index 92fc0fd..8e283dc 100644
29--- a/Makefile
30+++ b/Makefile
31@@ -59,8 +59,8 @@ RANLIB=ranlib
32 #LDFLAGS=-s
33
34 LIBTOOL=libtool --quiet
35-LT_COMPILE = $(LIBTOOL) --mode=compile $(CC)
36-LT_LINK = $(LIBTOOL) --mode=link $(CC)
37+LT_COMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC)
38+LT_LINK = $(LIBTOOL) --tag=CC --mode=link $(CC)
39 LT_INSTALL = $(LIBTOOL) --mode=install install
40 LT_CLEAN = $(LIBTOOL) --mode=clean rm
41
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 @@
1When building use the libtool intermediate .lo files instead of explicitly using
2the .o files. Under libtool foo.lo is the libtool intermediate wrapper, foo.o is
3a static build, and .libs/foo.o is a shared build.
4
5If static libraries have been disabled globally then libtool won't generate them
6and explicit references to foo.o won't be satisfied.
7
8Upstream-Status: Pending
9Signed-off-by: Ross Burton <ross.burton@intel.com>
10
11diff --git a/Makefile b/Makefile
12index bb695c6..5f60146 100644
13--- a/Makefile
14+++ b/Makefile
15@@ -28,7 +28,7 @@ endif
16
17 .SUFFIXES:
18
19-OBJS=apmlib.o
20+OBJS=apmlib.lo
21 EXES=apm apmd xapm apmsleep
22 HEADERS=apm.h
23
24@@ -66,22 +66,22 @@ all: $(EXES)
25
26 $(OBJS): $(HEADERS)
27
28-%.o: %.c
29+%.lo: %.c
30 $(LT_COMPILE) -c $(CPPFLAGS) $(CFLAGS) $(XTRACFLAGS) $<
31
32-%: %.o $(LIBAPM)
33+%: %.lo $(LIBAPM)
34 $(LT_LINK) -o $@ $< $(LDFLAGS) $(LIBAPM)
35
36-xapm.o: xapm.c
37+xapm.lo: xapm.c
38 $(LT_COMPILE) -c $(CPPFLAGS) $(CFLAGS) $(XTRACFLAGS) -DNARROWPROTO $<
39
40-apmd: apmd.o
41+apmd: apmd.lo
42
43-apmsleep: apmsleep.o
44+apmsleep: apmsleep.lo
45
46-apmexists: apmexists.o
47+apmexists: apmexists.lo
48
49-xapm: xapm.o $(LIBAPM)
50+xapm: xapm.lo $(LIBAPM)
51 $(LT_LINK) -o $@ $< $(LDFLAGS) $(LIBAPM) $(XLDFLAGS) $(XLIBS)
52
53 $(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 @@
1copy OE commit message here:
2 commit 9456cdc1cf43e3ba9e6d88c63560c1b6fdee4359
3 Author: Michael Krelin <hacker@klever.net>
4 Date: Tue May 29 12:27:45 2007 +0000
5
6 apmd: prevent build from interferring with host kernel headers. Closes #1257
7
8comment added by Kevin Tian <kevin.tian@intel.com>, 2010-07-13
9
10Upstream-Status: Pending
11
12Signed-off-by: Scott Garman <scott.a.garman@intel.com>
13
14--- apmd-3.2.2.orig/Makefile
15+++ apmd-3.2.2/Makefile
16@@ -43,8 +43,7 @@
17
18 CC=gcc
19 CFLAGS=-O -g
20-XTRACFLAGS=-Wall -pipe -I. -I/usr/src/linux/include -I/usr/X11R6/include \
21- -I/usr/src/linux-2.2/include -I /usr/src/linux-2.0/include \
22+XTRACFLAGS=-Wall -pipe -I. \
23 -DVERSION=\"$(VERSION)\" \
24 -DDEFAULT_PROXY_NAME=\"$(PROXY_DIR)/apmd_proxy\"
25 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 @@
1Define non-posix W* funcitons
2
3C libraries like musl dont define them
4
5Signed-off-by: Khem Raj <raj.khem@gmail.com>
6Upstream-Status: Pending
7
8Index: apmd-3.2.2.orig/apmd.c
9===================================================================
10--- apmd-3.2.2.orig.orig/apmd.c
11+++ apmd-3.2.2.orig/apmd.c
12@@ -55,6 +55,14 @@
13 #define MINIMUM_RATE_CALC_TIME 120
14 #endif
15
16+#ifndef _POSIX_SOURCE
17+
18+#define __WCOREFLAG 0200
19+#define __WCOREDUMP(x) (_W_INT(x) & __WCOREFLAG)
20+#define __W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
21+
22+#endif
23+
24 /*
25 * For the verbosity level feature to be useful,
26 * 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 92c35c9896..0000000000
--- a/meta/recipes-bsp/apmd/apmd_3.2.2-15.bb
+++ /dev/null
@@ -1,85 +0,0 @@
1SUMMARY = "Utilities for Advanced Power Management"
2DESCRIPTION = "The Advanced Power Management (APM) support provides \
3access to battery status information and a set of tools for managing \
4notebook power consumption."
5HOMEPAGE = "http://apenwarr.ca/apmd/"
6SECTION = "base"
7LICENSE = "GPL-2.0-or-later"
8LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
9 file://apm.h;beginline=6;endline=18;md5=7d4acc1250910a89f84ce3cc6557c4c2"
10DEPENDS = "libtool-cross"
11
12SRC_URI = "http://snapshot.debian.org/archive/debian/20160728T043443Z/pool/main/a/${BPN}/${BPN}_3.2.2.orig.tar.gz;name=tarball \
13 file://legacy.patch \
14 file://libtool.patch \
15 file://unlinux.patch \
16 file://wexitcode.patch \
17 file://linkage.patch \
18 file://init \
19 file://default \
20 file://apmd_proxy \
21 file://apmd_proxy.conf \
22 file://apmd.service"
23
24SRC_URI[tarball.md5sum] = "b1e6309e8331e0f4e6efd311c2d97fa8"
25SRC_URI[tarball.sha256sum] = "7f7d9f60b7766b852881d40b8ff91d8e39fccb0d1d913102a5c75a2dbb52332d"
26
27# for this package we're mostly interested in tracking debian patches,
28# and not in the upstream version where all development has effectively stopped
29UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/apmd/"
30UPSTREAM_CHECK_REGEX = "(?P<pver>((\d+\.*)+)-((\d+\.*)+))\.(diff|debian\.tar)\.(gz|xz)"
31
32S = "${WORKDIR}/apmd-3.2.2.orig"
33
34inherit update-rc.d systemd
35
36INITSCRIPT_NAME = "apmd"
37INITSCRIPT_PARAMS = "defaults"
38
39SYSTEMD_SERVICE:${PN} = "apmd.service"
40SYSTEMD_AUTO_ENABLE = "disable"
41
42EXTRA_OEMAKE = "-e MAKEFLAGS="
43
44do_compile() {
45 # apmd doesn't use whole autotools. Just libtool for installation
46 oe_runmake apm apmd
47}
48
49do_install() {
50 install -d ${D}${sysconfdir}
51 install -d ${D}${sysconfdir}/apm
52 install -d ${D}${sysconfdir}/apm/event.d
53 install -d ${D}${sysconfdir}/apm/other.d
54 install -d ${D}${sysconfdir}/apm/suspend.d
55 install -d ${D}${sysconfdir}/apm/resume.d
56 install -d ${D}${sysconfdir}/apm/scripts.d
57 install -d ${D}${sysconfdir}/default
58 install -d ${D}${sysconfdir}/init.d
59 install -d ${D}${sbindir}
60 install -d ${D}${bindir}
61 install -d ${D}${libdir}
62 install -d ${D}${datadir}/apmd
63 install -d ${D}${includedir}
64
65 install -m 4755 ${S}/.libs/apm ${D}${bindir}/apm
66 install -m 0755 ${S}/.libs/apmd ${D}${sbindir}/apmd
67 install -m 0755 ${WORKDIR}/apmd_proxy ${D}${sysconfdir}/apm/
68 install -m 0644 ${WORKDIR}/apmd_proxy.conf ${D}${datadir}/apmd/
69 install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/apmd
70 oe_libinstall -so libapm ${D}${libdir}
71 install -m 0644 apm.h ${D}${includedir}
72
73 sed -e 's,/usr/sbin,${sbindir},g; s,/etc,${sysconfdir},g;' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/apmd
74 chmod 755 ${D}${sysconfdir}/init.d/apmd
75
76 install -d ${D}${systemd_system_unitdir}
77 install -m 0644 ${WORKDIR}/apmd.service ${D}${systemd_system_unitdir}/
78 sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \
79 -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_system_unitdir}/apmd.service
80}
81
82PACKAGES =+ "libapm apm"
83
84FILES:libapm = "${libdir}/libapm${SOLIBS}"
85FILES:apm = "${bindir}/apm*"
diff --git a/meta/recipes-bsp/barebox/barebox-common.inc b/meta/recipes-bsp/barebox/barebox-common.inc
new file mode 100644
index 0000000000..67bc964188
--- /dev/null
+++ b/meta/recipes-bsp/barebox/barebox-common.inc
@@ -0,0 +1,8 @@
1HOMEPAGE = "https://barebox.org/"
2SECTION = "bootloaders"
3
4LIC_FILES_CHKSUM = "file://COPYING;md5=f5125d13e000b9ca1f0d3364286c4192"
5
6PV = "2025.06.0"
7SRC_URI = "https://barebox.org/download/barebox-${PV}.tar.bz2"
8SRC_URI[sha256sum] = "d05bc1f85dc1d95b0b6b6a52cac0a469148fbb8f1edb0d352c3ca3b632426941"
diff --git a/meta/recipes-bsp/barebox/barebox-tools.bb b/meta/recipes-bsp/barebox/barebox-tools.bb
new file mode 100644
index 0000000000..e519796c1d
--- /dev/null
+++ b/meta/recipes-bsp/barebox/barebox-tools.bb
@@ -0,0 +1,55 @@
1SUMMARY = "barebox bootloader tools"
2
3require barebox-common.inc
4
5LICENSE = "GPL-2.0-only"
6
7DEPENDS = "bison-native flex-native libusb1"
8
9S = "${UNPACKDIR}/barebox-${PV}"
10B = "${WORKDIR}/build"
11
12inherit pkgconfig
13
14EXTRA_OEMAKE = " \
15 ARCH=sandbox \
16 CROSS_COMPILE=${TARGET_PREFIX} -C ${S} O=${B} \
17 CROSS_PKG_CONFIG=pkg-config \
18 CC='${CC}' \
19 LD='${LD}' \
20 "
21
22do_compile:class-target () {
23 export userccflags="${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
24 export userldflags="${TARGET_LDFLAGS}${TOOLCHAIN_OPTIONS}"
25 oe_runmake targettools_defconfig
26 oe_runmake scripts
27}
28
29do_compile:class-native () {
30 oe_runmake hosttools_defconfig
31 oe_runmake scripts
32}
33
34BAREBOX_TOOLS = " \
35 bareboxenv \
36 bareboxcrc32 \
37 kernel-install \
38 bareboximd \
39 omap3-usb-loader \
40 omap4_usbboot \
41 imx/imx-usb-loader \
42 "
43
44BAREBOX_TOOLS_SUFFIX = ""
45BAREBOX_TOOLS_SUFFIX:class-target = "-target"
46
47do_install () {
48 install -d ${D}${bindir}
49
50 for tool in ${BAREBOX_TOOLS}; do
51 install -m 0755 scripts/${tool}${BAREBOX_TOOLS_SUFFIX} ${D}${bindir}/${tool##*/}
52 done
53}
54
55BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-bsp/barebox/barebox.bb b/meta/recipes-bsp/barebox/barebox.bb
new file mode 100644
index 0000000000..a48d97941c
--- /dev/null
+++ b/meta/recipes-bsp/barebox/barebox.bb
@@ -0,0 +1,10 @@
1SUMMARY = "barebox is a bootloader designed for embedded systems. It runs on a variety of architectures including x86, ARM, MIPS, PowerPC and others."
2DESCRIPTION = "barebox aims to be a versatile and flexible bootloader not only for booting embedded Linux systems, \
3but also for initial hardware bringup and development. \
4Users should feel right at home with a shell with UNIX-like virtual file system access to hardware, \
5Linux kernel driver API for making driver porting easier, \
6and a subset of the POSIX C library for writing more command-line utilities."
7
8require barebox-common.inc
9inherit barebox
10
diff --git a/meta/recipes-bsp/efibootmgr/efibootmgr_18.bb b/meta/recipes-bsp/efibootmgr/efibootmgr_18.bb
index cbcaac1e97..6f4178216b 100644
--- a/meta/recipes-bsp/efibootmgr/efibootmgr_18.bb
+++ b/meta/recipes-bsp/efibootmgr/efibootmgr_18.bb
@@ -13,8 +13,6 @@ COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
13SRC_URI = "git://github.com/rhinstaller/efibootmgr.git;protocol=https;branch=main" 13SRC_URI = "git://github.com/rhinstaller/efibootmgr.git;protocol=https;branch=main"
14SRCREV = "c3f9f0534e32158f62c43564036878b93b9e0fd6" 14SRCREV = "c3f9f0534e32158f62c43564036878b93b9e0fd6"
15 15
16S = "${WORKDIR}/git"
17
18inherit pkgconfig 16inherit pkgconfig
19 17
20# The directory under the ESP that the default bootloader is found in. When 18# The directory under the ESP that the default bootloader is found in. When
@@ -30,6 +28,3 @@ do_install () {
30} 28}
31 29
32CLEANBROKEN = "1" 30CLEANBROKEN = "1"
33# https://github.com/rhboot/efivar/issues/202
34COMPATIBLE_HOST:libc-musl = 'null'
35
diff --git a/meta/recipes-bsp/efivar/efivar/0001-Fix-glibc-2.36-build-mount.h-conflicts.patch b/meta/recipes-bsp/efivar/efivar/0001-Fix-glibc-2.36-build-mount.h-conflicts.patch
deleted file mode 100644
index 28dadabe6b..0000000000
--- a/meta/recipes-bsp/efivar/efivar/0001-Fix-glibc-2.36-build-mount.h-conflicts.patch
+++ /dev/null
@@ -1,60 +0,0 @@
1From 7b0e7ba674321ec1ddd6b9cbb419e5fb44f88bb3 Mon Sep 17 00:00:00 2001
2From: Robbie Harwood <rharwood@redhat.com>
3Date: Thu, 28 Jul 2022 16:11:24 -0400
4Subject: [PATCH] Fix glibc 2.36 build (mount.h conflicts)
5
6glibc has decided that sys/mount.h and linux/mount.h are no longer
7usable at the same time. This broke the build, since linux/fs.h itself
8includes linux/mount.h. For now, fix the build by only including
9sys/mount.h where we need it.
10
11See-also: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
12Resolves: #227
13
14Upstream-Status: Backport [https://github.com/rhboot/efivar/commit/bc65d63ebf8fe6ac8a099ff15ca200986dba1565]
15Signed-off-by: Robbie Harwood <rharwood@redhat.com>
16---
17 src/gpt.c | 1 +
18 src/linux.c | 1 +
19 src/util.h | 1 -
20 3 files changed, 2 insertions(+), 1 deletion(-)
21
22diff --git a/src/gpt.c b/src/gpt.c
23index 1eda049..21413c3 100644
24--- a/src/gpt.c
25+++ b/src/gpt.c
26@@ -17,6 +17,7 @@
27 #include <stdio.h>
28 #include <stdlib.h>
29 #include <string.h>
30+#include <sys/mount.h>
31 #include <sys/param.h>
32 #include <sys/stat.h>
33 #include <sys/utsname.h>
34diff --git a/src/linux.c b/src/linux.c
35index 47e45ae..1780816 100644
36--- a/src/linux.c
37+++ b/src/linux.c
38@@ -20,6 +20,7 @@
39 #include <stdbool.h>
40 #include <stdio.h>
41 #include <sys/ioctl.h>
42+#include <sys/mount.h>
43 #include <sys/socket.h>
44 #include <sys/sysmacros.h>
45 #include <sys/types.h>
46diff --git a/src/util.h b/src/util.h
47index 3300666..1e67e44 100644
48--- a/src/util.h
49+++ b/src/util.h
50@@ -23,7 +23,6 @@
51 #include <stdio.h>
52 #include <string.h>
53 #include <sys/ioctl.h>
54-#include <sys/mount.h>
55 #include <sys/stat.h>
56 #include <sys/types.h>
57 #include <tgmath.h>
58--
592.37.1
60
diff --git a/meta/recipes-bsp/efivar/efivar/0001-Fix-invalid-free-in-main.patch b/meta/recipes-bsp/efivar/efivar/0001-Fix-invalid-free-in-main.patch
deleted file mode 100644
index 7e63df578e..0000000000
--- a/meta/recipes-bsp/efivar/efivar/0001-Fix-invalid-free-in-main.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1From 085f027e9e9f1478f68ddda705f83b244ee3bd88 Mon Sep 17 00:00:00 2001
2From: Robbie Harwood <rharwood@redhat.com>
3Date: Mon, 18 Apr 2022 13:08:18 -0400
4Subject: [PATCH] Fix invalid free in main()
5
6data is allocated by mmap() in prepare_data().
7
8Resolves: #173
9Signed-off-by: Robbie Harwood <rharwood@redhat.com>
10Upstream-Status: Backport
11Link: https://github.com/rhboot/efivar/commit/6be2cb1c0139ac177e754b0767abf1ca1533847f
12Signed-off-by: Grygorii Tertychnyi <grygorii.tertychnyi@leica-geosystems.com>
13
14---
15 src/efivar.c | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18diff --git a/src/efivar.c b/src/efivar.c
19index 5cd1eb2bc73c..09f85edd0a38 100644
20--- a/src/efivar.c
21+++ b/src/efivar.c
22@@ -633,7 +633,7 @@ int main(int argc, char *argv[])
23 if (sz < 0)
24 err(1, "Could not import data from \"%s\"", infile);
25
26- free(data);
27+ munmap(data, data_size);
28 data = NULL;
29 data_size = 0;
30
diff --git a/meta/recipes-bsp/efivar/efivar/0001-src-Makefile-build-util.c-separately-for-makeguids.patch b/meta/recipes-bsp/efivar/efivar/0001-src-Makefile-build-util.c-separately-for-makeguids.patch
deleted file mode 100644
index 02781eb67d..0000000000
--- a/meta/recipes-bsp/efivar/efivar/0001-src-Makefile-build-util.c-separately-for-makeguids.patch
+++ /dev/null
@@ -1,38 +0,0 @@
1From 80f11fcb46f6b52e13501cb323ca1a849c3f6e88 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex@linutronix.de>
3Date: Tue, 18 Jan 2022 11:53:41 +0100
4Subject: [PATCH] src/Makefile: build util.c separately for makeguids
5
6util.c needs to be built twice when cross-compiling:
7for the build machine to be able to link with
8makeguids which then runs during the same build,
9and then for the actual target.
10
11Upstream-Status: Submitted [https://github.com/rhboot/efivar/pull/203]
12Signed-off-by: Alexander Kanavin <alex@linutronix.de>
13---
14 src/Makefile | 5 ++++-
15 1 file changed, 4 insertions(+), 1 deletion(-)
16
17diff --git a/src/Makefile b/src/Makefile
18index 0e423c4..b10051b 100644
19--- a/src/Makefile
20+++ b/src/Makefile
21@@ -28,10 +28,13 @@ EFIVAR_OBJECTS = $(patsubst %.S,%.o,$(patsubst %.c,%.o,$(EFIVAR_SOURCES)))
22 EFISECDB_SOURCES = efisecdb.c guid-symbols.c secdb-dump.c util.c
23 EFISECDB_OBJECTS = $(patsubst %.S,%.o,$(patsubst %.c,%.o,$(EFISECDB_SOURCES)))
24 GENERATED_SOURCES = include/efivar/efivar-guids.h guid-symbols.c
25-MAKEGUIDS_SOURCES = makeguids.c util.c
26+MAKEGUIDS_SOURCES = makeguids.c util-makeguids.c
27 MAKEGUIDS_OBJECTS = $(patsubst %.S,%.o,$(patsubst %.c,%.o,$(MAKEGUIDS_SOURCES)))
28 MAKEGUIDS_OUTPUT = $(GENERATED_SOURCES) guids.lds
29
30+util-makeguids.c :
31+ cp util.c util-makeguids.c
32+
33 ALL_SOURCES=$(LIBEFISEC_SOURCES) $(LIBEFIBOOT_SOURCES) $(LIBEFIVAR_SOURCES) \
34 $(MAKEGUIDS_SOURCES) $(GENERATED_SOURCES) $(EFIVAR_SOURCES) \
35 $(sort $(wildcard include/efivar/*.h))
36--
372.20.1
38
diff --git a/meta/recipes-bsp/efivar/efivar/efisecdb-fix-build-with-musl-libc.patch b/meta/recipes-bsp/efivar/efivar/efisecdb-fix-build-with-musl-libc.patch
deleted file mode 100644
index ec5b285a06..0000000000
--- a/meta/recipes-bsp/efivar/efivar/efisecdb-fix-build-with-musl-libc.patch
+++ /dev/null
@@ -1,184 +0,0 @@
1From cece3ffd5be2f8641eb694513f2b73e5eb97ffd3 Mon Sep 17 00:00:00 2001
2From: Natanael Copa <ncopa@alpinelinux.org>
3Date: Fri, 28 Jan 2022 12:13:30 +0100
4Subject: [PATCH] efisecdb: fix build with musl libc
5
6Refactor code to use POSIX atexit(3) instead of the GNU specific
7on_exit(3).
8
9Resolves: #197
10Resolves: #202
11Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
12
13Upstream-Status: Backport
14https://github.com/rhboot/efivar/commit/cece3ffd5be2f8641eb694513f2b73e5eb97ffd3
15
16Signed-off-by: Davide Gardenal <davide.gardenal@huawei.com>
17---
18 src/compiler.h | 2 --
19 src/efisecdb.c | 68 +++++++++++++++++++-------------------------------
20 2 files changed, 26 insertions(+), 44 deletions(-)
21
22diff --git a/src/compiler.h b/src/compiler.h
23index e2f18f0b..d95fb014 100644
24--- a/src/compiler.h
25+++ b/src/compiler.h
26@@ -7,8 +7,6 @@
27 #ifndef COMPILER_H_
28 #define COMPILER_H_
29
30-#include <sys/cdefs.h>
31-
32 /* GCC version checking borrowed from glibc. */
33 #if defined(__GNUC__) && defined(__GNUC_MINOR__)
34 # define GNUC_PREREQ(maj,min) \
35diff --git a/src/efisecdb.c b/src/efisecdb.c
36index f8823737..6bd5ad90 100644
37--- a/src/efisecdb.c
38+++ b/src/efisecdb.c
39@@ -25,6 +25,10 @@
40 extern char *optarg;
41 extern int optind, opterr, optopt;
42
43+static efi_secdb_t *secdb = NULL;
44+static list_t infiles;
45+static list_t actions;
46+
47 struct hash_param {
48 char *name;
49 efi_secdb_type_t algorithm;
50@@ -187,12 +191,11 @@ add_action(list_t *list, action_type_t action_type, const efi_guid_t *owner,
51 }
52
53 static void
54-free_actions(int status UNUSED, void *actionsp)
55+free_actions(void)
56 {
57- list_t *actions = (list_t *)actionsp;
58 list_t *pos, *tmp;
59
60- for_each_action_safe(pos, tmp, actions) {
61+ for_each_action_safe(pos, tmp, &actions) {
62 action_t *action = list_entry(pos, action_t, list);
63
64 list_del(&action->list);
65@@ -202,12 +205,11 @@ free_actions(int status UNUSED, void *actionsp)
66 }
67
68 static void
69-free_infiles(int status UNUSED, void *infilesp)
70+free_infiles(void)
71 {
72- list_t *infiles = (list_t *)infilesp;
73 list_t *pos, *tmp;
74
75- for_each_ptr_safe(pos, tmp, infiles) {
76+ for_each_ptr_safe(pos, tmp, &infiles) {
77 ptrlist_t *entry = list_entry(pos, ptrlist_t, list);
78
79 list_del(&entry->list);
80@@ -216,27 +218,12 @@ free_infiles(int status UNUSED, void *infilesp)
81 }
82
83 static void
84-maybe_free_secdb(int status UNUSED, void *voidp)
85+maybe_free_secdb(void)
86 {
87- efi_secdb_t **secdbp = (efi_secdb_t **)voidp;
88-
89- if (secdbp == NULL || *secdbp == NULL)
90+ if (secdb == NULL)
91 return;
92
93- efi_secdb_free(*secdbp);
94-}
95-
96-static void
97-maybe_do_unlink(int status, void *filep)
98-{
99- char **file = (char **)filep;
100-
101- if (status == 0)
102- return;
103- if (file == NULL || *file == NULL)
104- return;
105-
106- unlink(*file);
107+ efi_secdb_free(secdb);
108 }
109
110 static void
111@@ -323,15 +310,6 @@ parse_input_files(list_t *infiles, char **outfile, efi_secdb_t **secdb,
112 return status;
113 }
114
115-/*
116- * These need to be static globals so that they're not on main's stack when
117- * on_exit() fires.
118- */
119-static efi_secdb_t *secdb = NULL;
120-static list_t infiles;
121-static list_t actions;
122-static char *outfile = NULL;
123-
124 int
125 main(int argc, char *argv[])
126 {
127@@ -351,6 +329,7 @@ main(int argc, char *argv[])
128 bool do_sort_data = false;
129 bool sort_descending = false;
130 int status = 0;
131+ char *outfile = NULL;
132
133 const char sopts[] = ":aAc:dfg:h:i:Lo:rs:t:v?";
134 const struct option lopts[] = {
135@@ -376,10 +355,9 @@ main(int argc, char *argv[])
136 INIT_LIST_HEAD(&infiles);
137 INIT_LIST_HEAD(&actions);
138
139- on_exit(free_actions, &actions);
140- on_exit(free_infiles, &infiles);
141- on_exit(maybe_free_secdb, &secdb);
142- on_exit(maybe_do_unlink, &outfile);
143+ atexit(free_actions);
144+ atexit(free_infiles);
145+ atexit(maybe_free_secdb);
146
147 /*
148 * parse the command line.
149@@ -587,24 +565,30 @@ main(int argc, char *argv[])
150 outfd = open(outfile, flags, 0600);
151 if (outfd < 0) {
152 char *tmpoutfile = outfile;
153- if (errno == EEXIST)
154- outfile = NULL;
155+ if (errno != EEXIST)
156+ unlink(outfile);
157 err(1, "could not open \"%s\"", tmpoutfile);
158 }
159
160 rc = ftruncate(outfd, 0);
161- if (rc < 0)
162+ if (rc < 0) {
163+ unlink(outfile);
164 err(1, "could not truncate output file \"%s\"", outfile);
165+ }
166
167 void *output;
168 size_t size = 0;
169 rc = efi_secdb_realize(secdb, &output, &size);
170- if (rc < 0)
171+ if (rc < 0) {
172+ unlink(outfile);
173 secdb_err(1, "could not realize signature list");
174+ }
175
176 rc = write(outfd, output, size);
177- if (rc < 0)
178+ if (rc < 0) {
179+ unlink(outfile);
180 err(1, "could not write signature list");
181+ }
182
183 close(outfd);
184 xfree(output);
diff --git a/meta/recipes-bsp/efivar/efivar_38.bb b/meta/recipes-bsp/efivar/efivar_39.bb
index 6a6918931b..fb6b6b3821 100644
--- a/meta/recipes-bsp/efivar/efivar_38.bb
+++ b/meta/recipes-bsp/efivar/efivar_39.bb
@@ -5,27 +5,17 @@ HOMEPAGE = "https://github.com/rhboot/efivar"
5LICENSE = "LGPL-2.1-or-later" 5LICENSE = "LGPL-2.1-or-later"
6LIC_FILES_CHKSUM = "file://COPYING;md5=6626bb1e20189cfa95f2c508ba286393" 6LIC_FILES_CHKSUM = "file://COPYING;md5=6626bb1e20189cfa95f2c508ba286393"
7 7
8COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux" 8COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64|riscv64).*-linux"
9 9
10SRC_URI = "git://github.com/rhinstaller/efivar.git;branch=main;protocol=https \ 10SRC_URI = "git://github.com/rhinstaller/efivar.git;branch=main;protocol=https \
11 file://0001-docs-do-not-build-efisecdb-manpage.patch \ 11 file://0001-docs-do-not-build-efisecdb-manpage.patch \
12 file://0001-src-Makefile-build-util.c-separately-for-makeguids.patch \
13 file://efisecdb-fix-build-with-musl-libc.patch \
14 file://0001-Fix-invalid-free-in-main.patch \
15 file://0001-Fix-glibc-2.36-build-mount.h-conflicts.patch \
16 " 12 "
17SRCREV = "1753149d4176ebfb2b135ac0aaf79340bf0e7a93" 13SRCREV = "c47820c37ac26286559ec004de07d48d05f3308c"
18
19S = "${WORKDIR}/git"
20 14
21inherit pkgconfig 15inherit pkgconfig
22 16
23export CCLD_FOR_BUILD = "${BUILD_CCLD}" 17export CCLD_FOR_BUILD = "${BUILD_CCLD}"
24 18
25# Upstream uses --add-needed in gcc.specs which gold doesn't support, so
26# enforce BFD.
27LDFLAGS += "-fuse-ld=bfd"
28
29do_compile() { 19do_compile() {
30 oe_runmake ERRORS= HOST_CFLAGS="${BUILD_CFLAGS}" HOST_LDFLAGS="${BUILD_LDFLAGS}" 20 oe_runmake ERRORS= HOST_CFLAGS="${BUILD_CFLAGS}" HOST_LDFLAGS="${BUILD_LDFLAGS}"
31} 21}
diff --git a/meta/recipes-bsp/formfactor/files/qemuriscv32/machconfig b/meta/recipes-bsp/formfactor/files/qemuriscv32/machconfig
new file mode 100755
index 0000000000..2789b5fc2a
--- /dev/null
+++ b/meta/recipes-bsp/formfactor/files/qemuriscv32/machconfig
@@ -0,0 +1,10 @@
1HAVE_TOUCHSCREEN=1
2HAVE_KEYBOARD=1
3
4DISPLAY_CAN_ROTATE=0
5DISPLAY_ORIENTATION=0
6DISPLAY_WIDTH_PIXELS=640
7DISPLAY_HEIGHT_PIXELS=480
8DISPLAY_BPP=16
9DISPLAY_DPI=150
10DISPLAY_SUBPIXEL_ORDER=vrgb
diff --git a/meta/recipes-bsp/formfactor/files/qemuriscv64/machconfig b/meta/recipes-bsp/formfactor/files/qemuriscv64/machconfig
new file mode 100755
index 0000000000..2789b5fc2a
--- /dev/null
+++ b/meta/recipes-bsp/formfactor/files/qemuriscv64/machconfig
@@ -0,0 +1,10 @@
1HAVE_TOUCHSCREEN=1
2HAVE_KEYBOARD=1
3
4DISPLAY_CAN_ROTATE=0
5DISPLAY_ORIENTATION=0
6DISPLAY_WIDTH_PIXELS=640
7DISPLAY_HEIGHT_PIXELS=480
8DISPLAY_BPP=16
9DISPLAY_DPI=150
10DISPLAY_SUBPIXEL_ORDER=vrgb
diff --git a/meta/recipes-bsp/formfactor/formfactor_0.0.bb b/meta/recipes-bsp/formfactor/formfactor_0.0.bb
index ea1fa4c754..f8d5613ffa 100644
--- a/meta/recipes-bsp/formfactor/formfactor_0.0.bb
+++ b/meta/recipes-bsp/formfactor/formfactor_0.0.bb
@@ -5,10 +5,10 @@ build system cannot obtain from other sources such as the kernel."
5SECTION = "base" 5SECTION = "base"
6LICENSE = "MIT" 6LICENSE = "MIT"
7LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" 7LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
8PR = "r45"
9 8
10SRC_URI = "file://config file://machconfig" 9SRC_URI = "file://config file://machconfig"
11S = "${WORKDIR}" 10
11S = "${UNPACKDIR}"
12 12
13PACKAGE_ARCH = "${MACHINE_ARCH}" 13PACKAGE_ARCH = "${MACHINE_ARCH}"
14INHIBIT_DEFAULT_DEPS = "1" 14INHIBIT_DEFAULT_DEPS = "1"
diff --git a/meta/recipes-bsp/gnu-efi/gnu-efi/0001-Do-not-treat-warnings-as-errors.patch b/meta/recipes-bsp/gnu-efi/gnu-efi/0001-Do-not-treat-warnings-as-errors.patch
new file mode 100644
index 0000000000..0c10e66a12
--- /dev/null
+++ b/meta/recipes-bsp/gnu-efi/gnu-efi/0001-Do-not-treat-warnings-as-errors.patch
@@ -0,0 +1,29 @@
1From 80e17bcdf45dcf40b8f356cf68389612407b9f7b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 16 May 2024 21:38:32 +0800
4Subject: [PATCH] Do not treat warnings as errors
5
6There are additional warnings found with musl which are
7treated as errors and fails the build, we have more combinations
8then upstream supports to handle
9
10Upstream-Status: Inappropriate [OE specific]
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 Make.defaults | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/Make.defaults b/Make.defaults
18index 6d3cf51..23b9383 100755
19--- a/Make.defaults
20+++ b/Make.defaults
21@@ -267,7 +267,7 @@ CFLAGS += $(ARCH3264) -g -O2 -Wall -Wextra -Werror \
22 -fno-strict-aliasing \
23 -ffreestanding -fno-stack-protector
24 else
25-CFLAGS += $(ARCH3264) -g -O2 -Wall -Wextra -Werror \
26+CFLAGS += $(ARCH3264) -g -O2 -Wall -Wextra \
27 -fno-strict-aliasing \
28 -ffreestanding -fno-stack-protector \
29 $(if $(findstring 0,$(USING_CLANG)),-fno-merge-all-constants,)
diff --git a/meta/recipes-bsp/gnu-efi/gnu-efi/gnu-efi-3.0.9-fix-clang-build.patch b/meta/recipes-bsp/gnu-efi/gnu-efi/gnu-efi-3.0.9-fix-clang-build.patch
deleted file mode 100644
index c6d660095e..0000000000
--- a/meta/recipes-bsp/gnu-efi/gnu-efi/gnu-efi-3.0.9-fix-clang-build.patch
+++ /dev/null
@@ -1,24 +0,0 @@
1Fix building with CLANG-9.0.0
2
3Fixes
4clang-9: error: unknown argument: '-maccumulate-outgoing-args'
5
6Upstream-Status: Submitted [https://sourceforge.net/p/gnu-efi/patches/70/]
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8
9--- a/Make.defaults
10+++ b/Make.defaults
11@@ -110,10 +110,10 @@
12 || ( [ $(GCCVERSION) -eq "4" ] \
13 && [ $(GCCMINOR) -ge "7" ] ) ) \
14 && echo 1)
15- ifeq ($(GCCNEWENOUGH),1)
16- CPPFLAGS += -DGNU_EFI_USE_MS_ABI -maccumulate-outgoing-args --std=c11
17- else ifeq ($(USING_CLANG),clang)
18+ ifeq ($(USING_CLANG),clang)
19 CPPFLAGS += -DGNU_EFI_USE_MS_ABI --std=c11
20+ else ifeq ($(GCCNEWENOUGH),1)
21+ CPPFLAGS += -DGNU_EFI_USE_MS_ABI -maccumulate-outgoing-args --std=c11
22 endif
23
24 CFLAGS += -mno-red-zone
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
deleted file mode 100644
index 63d9b6fc31..0000000000
--- a/meta/recipes-bsp/gnu-efi/gnu-efi/parallel-make-archives.patch
+++ /dev/null
@@ -1,39 +0,0 @@
1From f56ddb00a656af2e84f839738fad19909ac65047 Mon Sep 17 00:00:00 2001
2From: Saul Wold <sgw@linux.intel.com>
3Date: Sun, 9 Mar 2014 15:22:15 +0200
4Subject: [PATCH] Fix parallel make failure for archives
5
6Upstream-Status: Pending
7
8The lib and gnuefi makefiles were using the lib.a() form which compiles
9and ar's as a pair instead of compiling all and then ar'ing which can
10parallelize better. This was resulting in build failures on larger values
11of -j.
12
13See http://www.chemie.fu-berlin.de/chemnet/use/info/make/make_toc.html#TOC105
14for details.
15
16Signed-off-by: Saul Wold <sgw@linux.intel.com>
17Signed-off-by: Darren Hart <dvhart@linux.intel.com>
18[Rebased for 3.0.6]
19Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
20[Rebased for 3.0.8]
21Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
22
23---
24 lib/Makefile | 2 +-
25 1 file changed, 1 insertion(+), 1 deletion(-)
26
27diff --git a/lib/Makefile b/lib/Makefile
28index 1fc6a47..54b0ca7 100644
29--- a/lib/Makefile
30+++ b/lib/Makefile
31@@ -77,7 +77,7 @@ libsubdirs:
32 $(OBJS): libsubdirs
33
34 libefi.a: $(OBJS)
35- $(AR) $(ARFLAGS) $@ $^
36+ $(AR) $(ARFLAGS) $@ $(OBJS)
37
38 clean:
39 rm -f libefi.a *~ $(OBJS) */*.o
diff --git a/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.15.bb b/meta/recipes-bsp/gnu-efi/gnu-efi_4.0.1.bb
index 5ae6f391ae..10a4ab6800 100644
--- a/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.15.bb
+++ b/meta/recipes-bsp/gnu-efi/gnu-efi_4.0.1.bb
@@ -2,25 +2,29 @@ SUMMARY = "Libraries for producing EFI binaries"
2HOMEPAGE = "http://sourceforge.net/projects/gnu-efi/" 2HOMEPAGE = "http://sourceforge.net/projects/gnu-efi/"
3DESCRIPTION = "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." 3DESCRIPTION = "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."
4SECTION = "devel" 4SECTION = "devel"
5LICENSE = "GPL-2.0-or-later | BSD-2-Clause" 5LICENSE = "GPL-2.0-or-later & BSD-2-Clause"
6LIC_FILES_CHKSUM = "file://gnuefi/crt0-efi-arm.S;beginline=4;endline=16;md5=e582764a4776e60c95bf9ab617343d36 \ 6LIC_FILES_CHKSUM = "file://gnuefi/crt0-efi-arm.S;beginline=4;endline=16;md5=8b0a86085b86eda7a3c7e8a1eb7ec753 \
7 file://gnuefi/crt0-efi-aarch64.S;beginline=4;endline=16;md5=e582764a4776e60c95bf9ab617343d36 \ 7 file://gnuefi/crt0-efi-aarch64.S;beginline=4;endline=16;md5=8b0a86085b86eda7a3c7e8a1eb7ec753 \
8 file://inc/efishellintf.h;beginline=13;endline=20;md5=202766b79d708eff3cc70fce15fb80c7 \ 8 file://inc/efishellintf.h;beginline=13;endline=20;md5=ee14c1530c341a7050837adead6bc9a5 \
9 file://lib/arm/math.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \ 9 file://lib/arm/math.c;beginline=2;endline=15;md5=ccb5c6b51053d1ee7277539ec38513d7 \
10 file://lib/arm/initplat.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \ 10 file://lib/arm/initplat.c;beginline=2;endline=15;md5=ccb5c6b51053d1ee7277539ec38513d7 \
11 file://lib/aarch64/math.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \ 11 file://lib/aarch64/math.c;beginline=2;endline=15;md5=ccb5c6b51053d1ee7277539ec38513d7 \
12 file://lib/aarch64/initplat.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \ 12 file://lib/aarch64/initplat.c;beginline=2;endline=15;md5=ccb5c6b51053d1ee7277539ec38513d7 \
13 " 13 "
14 14
15SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/files/${BP}.tar.bz2 \ 15COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*|riscv64.*)-linux"
16 file://parallel-make-archives.patch \ 16COMPATIBLE_HOST:armv4 = 'null'
17 file://gnu-efi-3.0.9-fix-clang-build.patch \ 17
18SRC_URI = "git://github.com/ncroxon/gnu-efi;protocol=https;branch=master \
19 file://0001-Do-not-treat-warnings-as-errors.patch \
18 " 20 "
21SRCREV = "00cdfa66e923ab2f6683bb52cab0d0d1a9083b16"
19 22
20SRC_URI[sha256sum] = "931a257b9c5c1ba65ff519f18373c438a26825f2db7866b163e96d1b168f20ea" 23# llvm-objcopy fails
24# arm-poky-linux-gnueabi-llvm-objcopy: error: 't8.so': section '.dynstr' cannot be removed because it is referenced by the section '.dynamic'
25OBJCOPY:toolchain-clang = "${HOST_PREFIX}objcopy"
21 26
22COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*|riscv64.*)-linux" 27inherit github-releases
23COMPATIBLE_HOST:armv4 = 'null'
24 28
25do_configure:linux-gnux32:prepend() { 29do_configure:linux-gnux32:prepend() {
26 cp ${STAGING_INCDIR}/gnu/stubs-x32.h ${STAGING_INCDIR}/gnu/stubs-64.h 30 cp ${STAGING_INCDIR}/gnu/stubs-x32.h ${STAGING_INCDIR}/gnu/stubs-64.h
@@ -34,8 +38,15 @@ def gnu_efi_arch(d):
34 return "ia32" 38 return "ia32"
35 return tarch 39 return tarch
36 40
37EXTRA_OEMAKE = "'ARCH=${@gnu_efi_arch(d)}' 'CC=${CC}' 'AS=${AS}' 'LD=${LD}' 'AR=${AR}' \ 41do_compile:prepend() {
38 'RANLIB=${RANLIB}' 'OBJCOPY=${OBJCOPY}' 'PREFIX=${prefix}' 'LIBDIR=${libdir}' \ 42 unset LDFLAGS
43}
44
45EXTRA_OEMAKE = "'V=1' 'ARCH=${@gnu_efi_arch(d)}' \
46 'HOSTCC=${BUILD_CC}' 'CC=${CC}' \
47 'AS=${AS}' 'LD=${LD}' 'AR=${AR}' \
48 'RANLIB=${RANLIB}' 'OBJCOPY=${OBJCOPY}' \
49 'PREFIX=${prefix}' 'LIBDIR=${libdir}' 'INCLUDEDIR=${includedir}' \
39 " 50 "
40 51
41# gnu-efi's Makefile treats prefix as toolchain prefix, so don't 52# gnu-efi's Makefile treats prefix as toolchain prefix, so don't
@@ -46,7 +57,7 @@ do_install() {
46 oe_runmake install INSTALLROOT="${D}" 57 oe_runmake install INSTALLROOT="${D}"
47} 58}
48 59
49FILES:${PN} += "${libdir}/*.lds" 60FILES:${PN} += "${libdir}/*.lds ${libdir}/gnuefi/apps"
50 61
51# 64-bit binaries are expected for EFI when targeting X32 62# 64-bit binaries are expected for EFI when targeting X32
52INSANE_SKIP:${PN}-dev:append:linux-gnux32 = " arch" 63INSANE_SKIP:${PN}-dev:append:linux-gnux32 = " arch"
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
deleted file mode 100644
index 6b73878cc0..0000000000
--- a/meta/recipes-bsp/grub/files/0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch
+++ /dev/null
@@ -1,43 +0,0 @@
1From 96d9aa55d29b24e2490d5647a9efc66940fc400f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 13 Jan 2016 19:17:31 +0000
4Subject: [PATCH] Disable -mfpmath=sse as well when SSE is disabled
5
6Fixes
7
8configure:20574: i586-poky-linux-gcc -m32 -march=core2 -msse3
9-mtune=generic -mfpmath=sse
10--sysroot=/usr/local/dev/yocto/grubtest2/build/tmp/sysroots/emenlow -o
11conftest -O2 -pipe -g -feliminate-unused-debug-types -Wall -W -Wshadow
12-Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g
13-falign-jumps=1 -falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse
14-mno-sse2 -mno-3dnow -fno-dwarf2-cfi-asm -m32 -fno-stack-protector
15-mno-stack-arg-probe -Werror -nostdlib -Wl,--defsym,___main=0x8100
16-Wall -W -I$(top_srcdir)/include -I$(top_builddir)/include
17-DGRUB_MACHINE_PCBIOS=1 -DGRUB_MACHINE=I386_PC -Wl,-O1
18-Wl,--hash-style=gnu -Wl,--as-needed conftest.c >&5
19conftest.c:1:0: error: SSE instruction set disabled, using 387
20arithmetics [-Werror]
21cc1: all warnings being treated as errors
22
23Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
24Signed-off-by: Khem Raj <raj.khem@gmail.com>
25
26Upstream-Status: Pending
27---
28 configure.ac | 2 +-
29 1 file changed, 1 insertion(+), 1 deletion(-)
30
31diff --git a/configure.ac b/configure.ac
32index 7656f24..0868ea9 100644
33--- a/configure.ac
34+++ b/configure.ac
35@@ -824,7 +824,7 @@ fi
36 if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$platform" != xemu; then
37 # Some toolchains enable these features by default, but they need
38 # registers that aren't set up properly in GRUB.
39- TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow"
40+ TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow -mfpmath=387"
41 fi
42
43 # GRUB doesn't use float or doubles at all. Yet some toolchains may decide
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 @@
1From e4c41db74b8972285cbdfe614c95c1ffd97d70e1 Mon Sep 17 00:00:00 2001 1From b47029e8e582d17c6874d2622fe1a5b834377dbb Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 26 Mar 2021 11:59:43 -0700 3Date: Fri, 26 Mar 2021 11:59:43 -0700
4Subject: [PATCH] RISC-V: Restore the typcast to 64bit type 4Subject: [PATCH] RISC-V: Restore the typcast to 64bit type
@@ -17,15 +17,16 @@ Cc: Daniel Kiper <daniel.kiper@oracle.com>
17Cc: Chester Lin <clin@suse.com> 17Cc: Chester Lin <clin@suse.com>
18Cc: Nikita Ermakov <arei@altlinux.org> 18Cc: Nikita Ermakov <arei@altlinux.org>
19Cc: Alistair Francis <alistair.francis@wdc.com> 19Cc: Alistair Francis <alistair.francis@wdc.com>
20
20--- 21---
21 util/grub-mkimagexx.c | 2 +- 22 util/grub-mkimagexx.c | 2 +-
22 1 file changed, 1 insertion(+), 1 deletion(-) 23 1 file changed, 1 insertion(+), 1 deletion(-)
23 24
24diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c 25diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c
25index 00f49ccaa..ac677d03d 100644 26index e50b295..2f09255 100644
26--- a/util/grub-mkimagexx.c 27--- a/util/grub-mkimagexx.c
27+++ b/util/grub-mkimagexx.c 28+++ b/util/grub-mkimagexx.c
28@@ -1242,7 +1242,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct section_metadata *smd, 29@@ -1310,7 +1310,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct section_metadata *smd,
29 */ 30 */
30 31
31 sym_addr += addend; 32 sym_addr += addend;
@@ -34,6 +35,3 @@ index 00f49ccaa..ac677d03d 100644
34 35
35 switch (ELF_R_TYPE (info)) 36 switch (ELF_R_TYPE (info))
36 { 37 {
37--
382.31.1
39
diff --git a/meta/recipes-bsp/grub/files/0001-configure-Remove-obsoleted-malign-jumps-loops-functi.patch b/meta/recipes-bsp/grub/files/0001-configure-Remove-obsoleted-malign-jumps-loops-functi.patch
deleted file mode 100644
index 98142a7b60..0000000000
--- a/meta/recipes-bsp/grub/files/0001-configure-Remove-obsoleted-malign-jumps-loops-functi.patch
+++ /dev/null
@@ -1,48 +0,0 @@
1From eb486898dac8cbc29b2cc39f911b657c3417ae34 Mon Sep 17 00:00:00 2001
2From: Fangrui Song via Grub-devel <grub-devel@gnu.org>
3Date: Thu, 26 Aug 2021 09:02:31 -0700
4Subject: [PATCH 1/2] configure: Remove obsoleted -malign-{jumps, loops,
5 functions}
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10The GCC warns "cc1: warning: ‘-malign-loops’ is obsolete, use ‘-falign-loops’".
11The Clang silently ignores -malign-{jumps,loops,functions}.
12
13The preferred -falign-* forms have been supported since GCC 3.2. So, just
14remove -malign-{jumps,loops,functions}.
15
16Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=eb486898dac8cbc29b2cc39f911b657c3417ae34]
17Signed-off-by: Fangrui Song <maskray@google.com>
18Acked-by: Paul Menzel <pmenzel@molgen.mpg.de>
19Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
20---
21 configure.ac | 9 ---------
22 1 file changed, 9 deletions(-)
23
24diff --git a/configure.ac b/configure.ac
25index bee28dbeb..9a12151bd 100644
26--- a/configure.ac
27+++ b/configure.ac
28@@ -805,17 +805,8 @@ if test "x$target_cpu" = xi386; then
29 [grub_cv_cc_falign_loop=no])
30 ])
31
32- AC_CACHE_CHECK([whether -malign-loops works], [grub_cv_cc_malign_loop], [
33- CFLAGS="$TARGET_CFLAGS -malign-loops=1 -Werror"
34- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
35- [grub_cv_cc_malign_loop=yes],
36- [grub_cv_cc_malign_loop=no])
37- ])
38-
39 if test "x$grub_cv_cc_falign_loop" = xyes; then
40 TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
41- elif test "x$grub_cv_cc_malign_loop" = xyes; then
42- TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
43 fi
44 fi
45
46--
472.37.3
48
diff --git a/meta/recipes-bsp/grub/files/0001-configure.ac-Use-_zicsr_zifencei-extentions-on-riscv.patch b/meta/recipes-bsp/grub/files/0001-configure.ac-Use-_zicsr_zifencei-extentions-on-riscv.patch
deleted file mode 100644
index c575a31161..0000000000
--- a/meta/recipes-bsp/grub/files/0001-configure.ac-Use-_zicsr_zifencei-extentions-on-riscv.patch
+++ /dev/null
@@ -1,47 +0,0 @@
1From f1217c803cec90813eb834dde7829f4961b2a2e4 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 17 Feb 2022 15:07:02 -0800
4Subject: [PATCH] configure.ac: Use _zicsr_zifencei extentions on riscv
5
6From version 2.38, binutils defaults to ISA spec version 20191213. This
7means that the csr read/write (csrr*/csrw*) instructions and fence.i
8instruction has separated from the `I` extension, become two standalone
9extensions: Zicsr and Zifencei.
10
11The fix is to specify those extensions explicitely in -march. Since we
12are now using binutils 2.38+ in OE this is ok, a more upstreamable fix for
13grub will be to detect these extentions, however thats not easy to
14implement
15
16Upstream-Status: Inappropriate [OE specific]
17Signed-off-by: Khem Raj <raj.khem@gmail.com>
18---
19 configure.ac | 8 ++++----
20 1 file changed, 4 insertions(+), 4 deletions(-)
21
22diff --git a/configure.ac b/configure.ac
23index c7fc55a..072f2c9 100644
24--- a/configure.ac
25+++ b/configure.ac
26@@ -849,14 +849,14 @@ if test x"$platform" != xemu ; then
27 [grub_cv_target_cc_soft_float="-mgeneral-regs-only"], [])
28 fi
29 if test "x$target_cpu" = xriscv32; then
30- CFLAGS="$TARGET_CFLAGS -march=rv32imac -mabi=ilp32 -Werror"
31+ CFLAGS="$TARGET_CFLAGS -march=rv32imac_zicsr_zifencei -mabi=ilp32 -Werror"
32 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
33- [grub_cv_target_cc_soft_float="-march=rv32imac -mabi=ilp32"], [])
34+ [grub_cv_target_cc_soft_float="-march=rv32imac_zicsr_zifencei -mabi=ilp32"], [])
35 fi
36 if test "x$target_cpu" = xriscv64; then
37- CFLAGS="$TARGET_CFLAGS -march=rv64imac -mabi=lp64 -Werror"
38+ CFLAGS="$TARGET_CFLAGS -march=rv64imac_zicsr_zifencei -mabi=lp64 -Werror"
39 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
40- [grub_cv_target_cc_soft_float="-march=rv64imac -mabi=lp64"], [])
41+ [grub_cv_target_cc_soft_float="-march=rv64imac_zicsr_zifencei -mabi=lp64"], [])
42 fi
43 if test "x$target_cpu" = xia64; then
44 CFLAGS="$TARGET_CFLAGS -mno-inline-float-divide -mno-inline-sqrt -Werror"
45--
462.35.1
47
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 @@
1From 8f47ed4aaefba087b6ca76e59c9f832b6a0702bc Mon Sep 17 00:00:00 2001 1From a80592e20f6c4b928a22862f52f268ab9d9908b2 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 13 Jan 2016 19:28:00 +0000 3Date: Wed, 13 Jan 2016 19:28:00 +0000
4Subject: [PATCH] grub.d/10_linux.in: add oe's kernel name 4Subject: [PATCH] grub.d/10_linux.in: add oe's kernel name
@@ -20,10 +20,10 @@ Upstream-Status: Inappropriate [OE specific]
20 2 files changed, 4 insertions(+), 4 deletions(-) 20 2 files changed, 4 insertions(+), 4 deletions(-)
21 21
22diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in 22diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
23index 4532266..cba2617 100644 23index cc393be..8545cb6 100644
24--- a/util/grub.d/10_linux.in 24--- a/util/grub.d/10_linux.in
25+++ b/util/grub.d/10_linux.in 25+++ b/util/grub.d/10_linux.in
26@@ -164,12 +164,12 @@ machine=`uname -m` 26@@ -166,12 +166,12 @@ machine=`uname -m`
27 case "x$machine" in 27 case "x$machine" in
28 xi?86 | xx86_64) 28 xi?86 | xx86_64)
29 list= 29 list=
@@ -40,10 +40,10 @@ index 4532266..cba2617 100644
40 done ;; 40 done ;;
41 esac 41 esac
42diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in 42diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
43index 96179ea..98d16ae 100644 43index 94dd8be..36cd554 100644
44--- a/util/grub.d/20_linux_xen.in 44--- a/util/grub.d/20_linux_xen.in
45+++ b/util/grub.d/20_linux_xen.in 45+++ b/util/grub.d/20_linux_xen.in
46@@ -154,7 +154,7 @@ EOF 46@@ -181,7 +181,7 @@ EOF
47 } 47 }
48 48
49 linux_list= 49 linux_list=
diff --git a/meta/recipes-bsp/grub/files/0001-misc-Implement-grub_strlcpy.patch b/meta/recipes-bsp/grub/files/0001-misc-Implement-grub_strlcpy.patch
new file mode 100644
index 0000000000..0ff6dff33a
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/0001-misc-Implement-grub_strlcpy.patch
@@ -0,0 +1,68 @@
1From ea703528a8581a2ea7e0bad424a70fdf0aec7d8f Mon Sep 17 00:00:00 2001
2From: B Horn <b@horn.uk>
3Date: Sat, 15 Jun 2024 02:33:08 +0100
4Subject: [PATCH 1/2] misc: Implement grub_strlcpy()
5
6grub_strlcpy() acts the same way as strlcpy() does on most *NIX,
7returning the length of src and ensuring dest is always NUL
8terminated except when size is 0.
9
10Signed-off-by: B Horn <b@horn.uk>
11Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
12
13Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=ea703528a8581a2ea7e0bad424a70fdf0aec7d8f]
14Signed-off-by: Peter Marko <peter.marko@siemens.com>
15---
16 include/grub/misc.h | 39 +++++++++++++++++++++++++++++++++++++++
17 1 file changed, 39 insertions(+)
18
19diff --git a/include/grub/misc.h b/include/grub/misc.h
20index 1578f36c3..14d8f37ac 100644
21--- a/include/grub/misc.h
22+++ b/include/grub/misc.h
23@@ -64,6 +64,45 @@ grub_stpcpy (char *dest, const char *src)
24 return d - 1;
25 }
26
27+static inline grub_size_t
28+grub_strlcpy (char *dest, const char *src, grub_size_t size)
29+{
30+ char *d = dest;
31+ grub_size_t res = 0;
32+ /*
33+ * We do not subtract one from size here to avoid dealing with underflowing
34+ * the value, which is why to_copy is always checked to be greater than one
35+ * throughout this function.
36+ */
37+ grub_size_t to_copy = size;
38+
39+ /* Copy size - 1 bytes to dest. */
40+ if (to_copy > 1)
41+ while ((*d++ = *src++) != '\0' && ++res && --to_copy > 1)
42+ ;
43+
44+ /*
45+ * NUL terminate if size != 0. The previous step may have copied a NUL byte
46+ * if it reached the end of the string, but we know dest[size - 1] must always
47+ * be a NUL byte.
48+ */
49+ if (size != 0)
50+ dest[size - 1] = '\0';
51+
52+ /* If there is still space in dest, but are here, we reached the end of src. */
53+ if (to_copy > 1)
54+ return res;
55+
56+ /*
57+ * If we haven't reached the end of the string, iterate through to determine
58+ * the strings total length.
59+ */
60+ while (*src++ != '\0' && ++res)
61+ ;
62+
63+ return res;
64+}
65+
66 /* XXX: If grub_memmove is too slow, we must implement grub_memcpy. */
67 static inline void *
68 grub_memcpy (void *dest, const void *src, grub_size_t n)
diff --git a/meta/recipes-bsp/grub/files/0002-configure-Check-for-falign-jumps-1-beside-falign-loo.patch b/meta/recipes-bsp/grub/files/0002-configure-Check-for-falign-jumps-1-beside-falign-loo.patch
deleted file mode 100644
index 437e5b29b2..0000000000
--- a/meta/recipes-bsp/grub/files/0002-configure-Check-for-falign-jumps-1-beside-falign-loo.patch
+++ /dev/null
@@ -1,59 +0,0 @@
1From e372dcb0d4541ee9b9682cde088ec87a7b238ca2 Mon Sep 17 00:00:00 2001
2From: Fangrui Song via Grub-devel <grub-devel@gnu.org>
3Date: Thu, 26 Aug 2021 09:02:32 -0700
4Subject: [PATCH 2/2] configure: Check for -falign-jumps=1 beside
5 -falign-loops=1
6
7The Clang does not support -falign-jumps and only recently gained support
8for -falign-loops. The -falign-jumps=1 should be tested beside
9-fliang-loops=1 to avoid passing unrecognized options to the Clang:
10
11 clang-14: error: optimization flag '-falign-jumps=1' is not supported [-Werror,-Wignored-optimization-argument]
12
13The -falign-functions=1 is supported by GCC 5.1.0/Clang 3.8.0. So, just
14add the option unconditionally.
15
16Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=e372dcb0d4541ee9b9682cde088ec87a7b238ca2]
17Signed-off-by: Fangrui Song <maskray@google.com>
18Acked-by: Paul Menzel <pmenzel@molgen.mpg.de>
19Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
20---
21 configure.ac | 15 ++++++++++++++-
22 1 file changed, 14 insertions(+), 1 deletion(-)
23
24diff --git a/configure.ac b/configure.ac
25index 9a12151bd..eeb5d2211 100644
26--- a/configure.ac
27+++ b/configure.ac
28@@ -798,6 +798,8 @@ fi
29
30 # Force no alignment to save space on i386.
31 if test "x$target_cpu" = xi386; then
32+ TARGET_CFLAGS="$TARGET_CFLAGS -falign-functions=1"
33+
34 AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [
35 CFLAGS="$TARGET_CFLAGS -falign-loops=1 -Werror"
36 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
37@@ -806,7 +808,18 @@ if test "x$target_cpu" = xi386; then
38 ])
39
40 if test "x$grub_cv_cc_falign_loop" = xyes; then
41- TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
42+ TARGET_CFLAGS="$TARGET_CFLAGS -falign-loops=1"
43+ fi
44+
45+ AC_CACHE_CHECK([whether -falign-jumps works], [grub_cv_cc_falign_jumps], [
46+ CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -Werror"
47+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
48+ [grub_cv_cc_falign_jumps=yes],
49+ [grub_cv_cc_falign_jumps=no])
50+ ])
51+
52+ if test "x$grub_cv_cc_falign_jumps" = xyes; then
53+ TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1"
54 fi
55 fi
56
57--
582.37.3
59
diff --git a/meta/recipes-bsp/grub/files/CVE-2021-3695-video-readers-png-Drop-greyscale-support-to-fix-heap.patch b/meta/recipes-bsp/grub/files/CVE-2021-3695-video-readers-png-Drop-greyscale-support-to-fix-heap.patch
deleted file mode 100644
index 7f7bb1acfe..0000000000
--- a/meta/recipes-bsp/grub/files/CVE-2021-3695-video-readers-png-Drop-greyscale-support-to-fix-heap.patch
+++ /dev/null
@@ -1,179 +0,0 @@
1From e623866d9286410156e8b9d2c82d6253a1b22d08 Mon Sep 17 00:00:00 2001
2From: Daniel Axtens <dja@axtens.net>
3Date: Tue, 6 Jul 2021 18:51:35 +1000
4Subject: [PATCH] video/readers/png: Drop greyscale support to fix heap
5 out-of-bounds write
6
7A 16-bit greyscale PNG without alpha is processed in the following loop:
8
9 for (i = 0; i < (data->image_width * data->image_height);
10 i++, d1 += 4, d2 += 2)
11 {
12 d1[R3] = d2[1];
13 d1[G3] = d2[1];
14 d1[B3] = d2[1];
15 }
16
17The increment of d1 is wrong. d1 is incremented by 4 bytes per iteration,
18but there are only 3 bytes allocated for storage. This means that image
19data will overwrite somewhat-attacker-controlled parts of memory - 3 bytes
20out of every 4 following the end of the image.
21
22This has existed since greyscale support was added in 2013 in commit
233ccf16dff98f (grub-core/video/readers/png.c: Support grayscale).
24
25Saving starfield.png as a 16-bit greyscale image without alpha in the gimp
26and attempting to load it causes grub-emu to crash - I don't think this code
27has ever worked.
28
29Delete all PNG greyscale support.
30
31Fixes: CVE-2021-3695
32
33Signed-off-by: Daniel Axtens <dja@axtens.net>
34Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
35
36Upstream-Status: Backport
37CVE: CVE-2021-3695
38
39Reference to upstream patch:
40https://git.savannah.gnu.org/cgit/grub.git/commit/?id=e623866d9286410156e8b9d2c82d6253a1b22d08
41
42Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
43---
44 grub-core/video/readers/png.c | 87 +++--------------------------------
45 1 file changed, 7 insertions(+), 80 deletions(-)
46
47diff --git a/grub-core/video/readers/png.c b/grub-core/video/readers/png.c
48index 35ae553c8..a3161e25b 100644
49--- a/grub-core/video/readers/png.c
50+++ b/grub-core/video/readers/png.c
51@@ -100,7 +100,7 @@ struct grub_png_data
52
53 unsigned image_width, image_height;
54 int bpp, is_16bit;
55- int raw_bytes, is_gray, is_alpha, is_palette;
56+ int raw_bytes, is_alpha, is_palette;
57 int row_bytes, color_bits;
58 grub_uint8_t *image_data;
59
60@@ -296,13 +296,13 @@ grub_png_decode_image_header (struct grub_png_data *data)
61 data->bpp = 3;
62 else
63 {
64- data->is_gray = 1;
65- data->bpp = 1;
66+ return grub_error (GRUB_ERR_BAD_FILE_TYPE,
67+ "png: color type not supported");
68 }
69
70 if ((color_bits != 8) && (color_bits != 16)
71 && (color_bits != 4
72- || !(data->is_gray || data->is_palette)))
73+ || !data->is_palette))
74 return grub_error (GRUB_ERR_BAD_FILE_TYPE,
75 "png: bit depth must be 8 or 16");
76
77@@ -331,7 +331,7 @@ grub_png_decode_image_header (struct grub_png_data *data)
78 }
79
80 #ifndef GRUB_CPU_WORDS_BIGENDIAN
81- if (data->is_16bit || data->is_gray || data->is_palette)
82+ if (data->is_16bit || data->is_palette)
83 #endif
84 {
85 data->image_data = grub_calloc (data->image_height, data->row_bytes);
86@@ -899,27 +899,8 @@ grub_png_convert_image (struct grub_png_data *data)
87 int shift;
88 int mask = (1 << data->color_bits) - 1;
89 unsigned j;
90- if (data->is_gray)
91- {
92- /* Generic formula is
93- (0xff * i) / ((1U << data->color_bits) - 1)
94- but for allowed bit depth of 1, 2 and for it's
95- equivalent to
96- (0xff / ((1U << data->color_bits) - 1)) * i
97- Precompute the multipliers to avoid division.
98- */
99-
100- const grub_uint8_t multipliers[5] = { 0xff, 0xff, 0x55, 0x24, 0x11 };
101- for (i = 0; i < (1U << data->color_bits); i++)
102- {
103- grub_uint8_t col = multipliers[data->color_bits] * i;
104- palette[i][0] = col;
105- palette[i][1] = col;
106- palette[i][2] = col;
107- }
108- }
109- else
110- grub_memcpy (palette, data->palette, 3 << data->color_bits);
111+
112+ grub_memcpy (palette, data->palette, 3 << data->color_bits);
113 d1c = d1;
114 d2c = d2;
115 for (j = 0; j < data->image_height; j++, d1c += data->image_width * 3,
116@@ -957,60 +938,6 @@ grub_png_convert_image (struct grub_png_data *data)
117 return;
118 }
119
120- if (data->is_gray)
121- {
122- switch (data->bpp)
123- {
124- case 4:
125- /* 16-bit gray with alpha. */
126- for (i = 0; i < (data->image_width * data->image_height);
127- i++, d1 += 4, d2 += 4)
128- {
129- d1[R4] = d2[3];
130- d1[G4] = d2[3];
131- d1[B4] = d2[3];
132- d1[A4] = d2[1];
133- }
134- break;
135- case 2:
136- if (data->is_16bit)
137- /* 16-bit gray without alpha. */
138- {
139- for (i = 0; i < (data->image_width * data->image_height);
140- i++, d1 += 4, d2 += 2)
141- {
142- d1[R3] = d2[1];
143- d1[G3] = d2[1];
144- d1[B3] = d2[1];
145- }
146- }
147- else
148- /* 8-bit gray with alpha. */
149- {
150- for (i = 0; i < (data->image_width * data->image_height);
151- i++, d1 += 4, d2 += 2)
152- {
153- d1[R4] = d2[1];
154- d1[G4] = d2[1];
155- d1[B4] = d2[1];
156- d1[A4] = d2[0];
157- }
158- }
159- break;
160- /* 8-bit gray without alpha. */
161- case 1:
162- for (i = 0; i < (data->image_width * data->image_height);
163- i++, d1 += 3, d2++)
164- {
165- d1[R3] = d2[0];
166- d1[G3] = d2[0];
167- d1[B3] = d2[0];
168- }
169- break;
170- }
171- return;
172- }
173-
174 {
175 /* Only copy the upper 8 bit. */
176 #ifndef GRUB_CPU_WORDS_BIGENDIAN
177--
1782.34.1
179
diff --git a/meta/recipes-bsp/grub/files/CVE-2021-3696-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff.patch b/meta/recipes-bsp/grub/files/CVE-2021-3696-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff.patch
deleted file mode 100644
index f06514e665..0000000000
--- a/meta/recipes-bsp/grub/files/CVE-2021-3696-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff.patch
+++ /dev/null
@@ -1,50 +0,0 @@
1From 210245129c932dc9e1c2748d9d35524fb95b5042 Mon Sep 17 00:00:00 2001
2From: Daniel Axtens <dja@axtens.net>
3Date: Tue, 6 Jul 2021 23:25:07 +1000
4Subject: [PATCH] video/readers/png: Avoid heap OOB R/W inserting huff table
5 items
6
7In fuzzing we observed crashes where a code would attempt to be inserted
8into a huffman table before the start, leading to a set of heap OOB reads
9and writes as table entries with negative indices were shifted around and
10the new code written in.
11
12Catch the case where we would underflow the array and bail.
13
14Fixes: CVE-2021-3696
15
16Signed-off-by: Daniel Axtens <dja@axtens.net>
17Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
18
19Upstream-Status: Backport
20CVE: CVE-2021-3696
21
22Reference to upstream patch:
23https://git.savannah.gnu.org/cgit/grub.git/commit/?id=210245129c932dc9e1c2748d9d35524fb95b5042
24
25Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
26---
27 grub-core/video/readers/png.c | 7 +++++++
28 1 file changed, 7 insertions(+)
29
30diff --git a/grub-core/video/readers/png.c b/grub-core/video/readers/png.c
31index a3161e25b..d7ed5aa6c 100644
32--- a/grub-core/video/readers/png.c
33+++ b/grub-core/video/readers/png.c
34@@ -438,6 +438,13 @@ grub_png_insert_huff_item (struct huff_table *ht, int code, int len)
35 for (i = len; i < ht->max_length; i++)
36 n += ht->maxval[i];
37
38+ if (n > ht->num_values)
39+ {
40+ grub_error (GRUB_ERR_BAD_FILE_TYPE,
41+ "png: out of range inserting huffman table item");
42+ return;
43+ }
44+
45 for (i = 0; i < n; i++)
46 ht->values[ht->num_values - i] = ht->values[ht->num_values - i - 1];
47
48--
492.34.1
50
diff --git a/meta/recipes-bsp/grub/files/CVE-2021-3697-video-readers-jpeg-Block-int-underflow-wild-pointer.patch b/meta/recipes-bsp/grub/files/CVE-2021-3697-video-readers-jpeg-Block-int-underflow-wild-pointer.patch
deleted file mode 100644
index e9fc52df86..0000000000
--- a/meta/recipes-bsp/grub/files/CVE-2021-3697-video-readers-jpeg-Block-int-underflow-wild-pointer.patch
+++ /dev/null
@@ -1,84 +0,0 @@
1From 22a3f97d39f6a10b08ad7fd1cc47c4dcd10413f6 Mon Sep 17 00:00:00 2001
2From: Daniel Axtens <dja@axtens.net>
3Date: Wed, 7 Jul 2021 15:38:19 +1000
4Subject: [PATCH] video/readers/jpeg: Block int underflow -> wild pointer write
5
6Certain 1 px wide images caused a wild pointer write in
7grub_jpeg_ycrcb_to_rgb(). This was caused because in grub_jpeg_decode_data(),
8we have the following loop:
9
10for (; data->r1 < nr1 && (!data->dri || rst);
11 data->r1++, data->bitmap_ptr += (vb * data->image_width - hb * nc1) * 3)
12
13We did not check if vb * width >= hb * nc1.
14
15On a 64-bit platform, if that turns out to be negative, it will underflow,
16be interpreted as unsigned 64-bit, then be added to the 64-bit pointer, so
17we see data->bitmap_ptr jump, e.g.:
18
190x6180_0000_0480 to
200x6181_0000_0498
21 ^
22 ~--- carry has occurred and this pointer is now far away from
23 any object.
24
25On a 32-bit platform, it will decrement the pointer, creating a pointer
26that won't crash but will overwrite random data.
27
28Catch the underflow and error out.
29
30Fixes: CVE-2021-3697
31
32Signed-off-by: Daniel Axtens <dja@axtens.net>
33Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
34
35Upstream-Status: Backport
36CVE: CVE-2021-3697
37
38Reference to upstream patch:
39https://git.savannah.gnu.org/cgit/grub.git/commit/?id=22a3f97d39f6a10b08ad7fd1cc47c4dcd10413f6
40
41Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
42---
43 grub-core/video/readers/jpeg.c | 10 +++++++++-
44 1 file changed, 9 insertions(+), 1 deletion(-)
45
46diff --git a/grub-core/video/readers/jpeg.c b/grub-core/video/readers/jpeg.c
47index 579bbe8a4..09596fbf5 100644
48--- a/grub-core/video/readers/jpeg.c
49+++ b/grub-core/video/readers/jpeg.c
50@@ -23,6 +23,7 @@
51 #include <grub/mm.h>
52 #include <grub/misc.h>
53 #include <grub/bufio.h>
54+#include <grub/safemath.h>
55
56 GRUB_MOD_LICENSE ("GPLv3+");
57
58@@ -699,6 +700,7 @@ static grub_err_t
59 grub_jpeg_decode_data (struct grub_jpeg_data *data)
60 {
61 unsigned c1, vb, hb, nr1, nc1;
62+ unsigned stride_a, stride_b, stride;
63 int rst = data->dri;
64 grub_err_t err = GRUB_ERR_NONE;
65
66@@ -711,8 +713,14 @@ grub_jpeg_decode_data (struct grub_jpeg_data *data)
67 return grub_error (GRUB_ERR_BAD_FILE_TYPE,
68 "jpeg: attempted to decode data before start of stream");
69
70+ if (grub_mul(vb, data->image_width, &stride_a) ||
71+ grub_mul(hb, nc1, &stride_b) ||
72+ grub_sub(stride_a, stride_b, &stride))
73+ return grub_error (GRUB_ERR_BAD_FILE_TYPE,
74+ "jpeg: cannot decode image with these dimensions");
75+
76 for (; data->r1 < nr1 && (!data->dri || rst);
77- data->r1++, data->bitmap_ptr += (vb * data->image_width - hb * nc1) * 3)
78+ data->r1++, data->bitmap_ptr += stride * 3)
79 for (c1 = 0; c1 < nc1 && (!data->dri || rst);
80 c1++, rst--, data->bitmap_ptr += hb * 3)
81 {
82--
832.34.1
84
diff --git a/meta/recipes-bsp/grub/files/CVE-2021-3981-grub-mkconfig-Restore-umask-for-the-grub.cfg.patch b/meta/recipes-bsp/grub/files/CVE-2021-3981-grub-mkconfig-Restore-umask-for-the-grub.cfg.patch
deleted file mode 100644
index dae26fd8bb..0000000000
--- a/meta/recipes-bsp/grub/files/CVE-2021-3981-grub-mkconfig-Restore-umask-for-the-grub.cfg.patch
+++ /dev/null
@@ -1,49 +0,0 @@
1From 0adec29674561034771c13e446069b41ef41e4d4 Mon Sep 17 00:00:00 2001
2From: Michael Chang <mchang@suse.com>
3Date: Fri, 3 Dec 2021 16:13:28 +0800
4Subject: [PATCH] grub-mkconfig: Restore umask for the grub.cfg
5
6The commit ab2e53c8a (grub-mkconfig: Honor a symlink when generating
7configuration by grub-mkconfig) has inadvertently discarded umask for
8creating grub.cfg in the process of running grub-mkconfig. The resulting
9wrong permission (0644) would allow unprivileged users to read GRUB
10configuration file content. This presents a low confidentiality risk
11as grub.cfg may contain non-secured plain-text passwords.
12
13This patch restores the missing umask and sets the creation file mode
14to 0600 preventing unprivileged access.
15
16Fixes: CVE-2021-3981
17
18Signed-off-by: Michael Chang <mchang@suse.com>
19Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
20
21Upstream-Status: Backport
22CVE: CVE-2021-3981
23
24Reference to upstream patch:
25https://git.savannah.gnu.org/cgit/grub.git/commit/?id=0adec29674561034771c13e446069b41ef41e4d4
26
27Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
28---
29 util/grub-mkconfig.in | 3 +++
30 1 file changed, 3 insertions(+)
31
32diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
33index c3ea7612e..62335d027 100644
34--- a/util/grub-mkconfig.in
35+++ b/util/grub-mkconfig.in
36@@ -301,7 +301,10 @@ and /etc/grub.d/* files or please file a bug report with
37 exit 1
38 else
39 # none of the children aborted with error, install the new grub.cfg
40+ oldumask=$(umask)
41+ umask 077
42 cat ${grub_cfg}.new > ${grub_cfg}
43+ umask $oldumask
44 rm -f ${grub_cfg}.new
45 fi
46 fi
47--
482.31.1
49
diff --git a/meta/recipes-bsp/grub/files/CVE-2022-28733-net-ip-Do-IP-fragment-maths-safely.patch b/meta/recipes-bsp/grub/files/CVE-2022-28733-net-ip-Do-IP-fragment-maths-safely.patch
deleted file mode 100644
index 8bf9090f94..0000000000
--- a/meta/recipes-bsp/grub/files/CVE-2022-28733-net-ip-Do-IP-fragment-maths-safely.patch
+++ /dev/null
@@ -1,63 +0,0 @@
1From 3e4817538de828319ba6d59ced2fbb9b5ca13287 Mon Sep 17 00:00:00 2001
2From: Daniel Axtens <dja@axtens.net>
3Date: Mon, 20 Dec 2021 19:41:21 +1100
4Subject: [PATCH] net/ip: Do IP fragment maths safely
5
6We can receive packets with invalid IP fragmentation information. This
7can lead to rsm->total_len underflowing and becoming very large.
8
9Then, in grub_netbuff_alloc(), we add to this very large number, which can
10cause it to overflow and wrap back around to a small positive number.
11The allocation then succeeds, but the resulting buffer is too small and
12subsequent operations can write past the end of the buffer.
13
14Catch the underflow here.
15
16Fixes: CVE-2022-28733
17
18Signed-off-by: Daniel Axtens <dja@axtens.net>
19Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
20
21Upstream-Status: Backport
22CVE: CVE-2022-28733
23
24Reference to upstream patch:
25https://git.savannah.gnu.org/cgit/grub.git/commit/?id=3e4817538de828319ba6d59ced2fbb9b5ca13287
26
27Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
28
29---
30 grub-core/net/ip.c | 10 +++++++++-
31 1 file changed, 9 insertions(+), 1 deletion(-)
32
33diff --git a/grub-core/net/ip.c b/grub-core/net/ip.c
34index e3d62e97f..3c3d0be0e 100644
35--- a/grub-core/net/ip.c
36+++ b/grub-core/net/ip.c
37@@ -25,6 +25,7 @@
38 #include <grub/net/netbuff.h>
39 #include <grub/mm.h>
40 #include <grub/priority_queue.h>
41+#include <grub/safemath.h>
42 #include <grub/time.h>
43
44 struct iphdr {
45@@ -512,7 +513,14 @@ grub_net_recv_ip4_packets (struct grub_net_buff *nb,
46 {
47 rsm->total_len = (8 * (grub_be_to_cpu16 (iph->frags) & OFFSET_MASK)
48 + (nb->tail - nb->data));
49- rsm->total_len -= ((iph->verhdrlen & 0xf) * sizeof (grub_uint32_t));
50+
51+ if (grub_sub (rsm->total_len, (iph->verhdrlen & 0xf) * sizeof (grub_uint32_t),
52+ &rsm->total_len))
53+ {
54+ grub_dprintf ("net", "IP reassembly size underflow\n");
55+ return GRUB_ERR_NONE;
56+ }
57+
58 rsm->asm_netbuff = grub_netbuff_alloc (rsm->total_len);
59 if (!rsm->asm_netbuff)
60 {
61--
622.34.1
63
diff --git a/meta/recipes-bsp/grub/files/CVE-2022-28734-net-http-Error-out-on-headers-with-LF-without-CR.patch b/meta/recipes-bsp/grub/files/CVE-2022-28734-net-http-Error-out-on-headers-with-LF-without-CR.patch
deleted file mode 100644
index f31167d315..0000000000
--- a/meta/recipes-bsp/grub/files/CVE-2022-28734-net-http-Error-out-on-headers-with-LF-without-CR.patch
+++ /dev/null
@@ -1,58 +0,0 @@
1From b26b4c08e7119281ff30d0fb4a6169bd2afa8fe4 Mon Sep 17 00:00:00 2001
2From: Daniel Axtens <dja@axtens.net>
3Date: Tue, 8 Mar 2022 19:04:40 +1100
4Subject: [PATCH] net/http: Error out on headers with LF without CR
5
6In a similar vein to the previous patch, parse_line() would write
7a NUL byte past the end of the buffer if there was an HTTP header
8with a LF rather than a CRLF.
9
10RFC-2616 says:
11
12 Many HTTP/1.1 header field values consist of words separated by LWS
13 or special characters. These special characters MUST be in a quoted
14 string to be used within a parameter value (as defined in section 3.6).
15
16We don't support quoted sections or continuation lines, etc.
17
18If we see an LF that's not part of a CRLF, bail out.
19
20Fixes: CVE-2022-28734
21
22Signed-off-by: Daniel Axtens <dja@axtens.net>
23Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
24
25Upstream-Status: Backport
26CVE: CVE-2022-28734
27
28Reference to upstream patch:
29https://git.savannah.gnu.org/cgit/grub.git/commit/?id=b26b4c08e7119281ff30d0fb4a6169bd2afa8fe4
30
31Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
32---
33 grub-core/net/http.c | 8 ++++++++
34 1 file changed, 8 insertions(+)
35
36diff --git a/grub-core/net/http.c b/grub-core/net/http.c
37index 33a0a28c4..9291a13e2 100644
38--- a/grub-core/net/http.c
39+++ b/grub-core/net/http.c
40@@ -68,7 +68,15 @@ parse_line (grub_file_t file, http_data_t data, char *ptr, grub_size_t len)
41 char *end = ptr + len;
42 while (end > ptr && *(end - 1) == '\r')
43 end--;
44+
45+ /* LF without CR. */
46+ if (end == ptr + len)
47+ {
48+ data->errmsg = grub_strdup (_("invalid HTTP header - LF without CR"));
49+ return GRUB_ERR_NONE;
50+ }
51 *end = 0;
52+
53 /* Trailing CRLF. */
54 if (data->in_chunk_len == 1)
55 {
56--
572.34.1
58
diff --git a/meta/recipes-bsp/grub/files/CVE-2022-28734-net-http-Fix-OOB-write-for-split-http-headers.patch b/meta/recipes-bsp/grub/files/CVE-2022-28734-net-http-Fix-OOB-write-for-split-http-headers.patch
deleted file mode 100644
index e0ca1eec44..0000000000
--- a/meta/recipes-bsp/grub/files/CVE-2022-28734-net-http-Fix-OOB-write-for-split-http-headers.patch
+++ /dev/null
@@ -1,56 +0,0 @@
1From ec6bfd3237394c1c7dbf2fd73417173318d22f4b Mon Sep 17 00:00:00 2001
2From: Daniel Axtens <dja@axtens.net>
3Date: Tue, 8 Mar 2022 18:17:03 +1100
4Subject: [PATCH] net/http: Fix OOB write for split http headers
5
6GRUB has special code for handling an http header that is split
7across two packets.
8
9The code tracks the end of line by looking for a "\n" byte. The
10code for split headers has always advanced the pointer just past the
11end of the line, whereas the code that handles unsplit headers does
12not advance the pointer. This extra advance causes the length to be
13one greater, which breaks an assumption in parse_line(), leading to
14it writing a NUL byte one byte past the end of the buffer where we
15reconstruct the line from the two packets.
16
17It's conceivable that an attacker controlled set of packets could
18cause this to zero out the first byte of the "next" pointer of the
19grub_mm_region structure following the current_line buffer.
20
21Do not advance the pointer in the split header case.
22
23Fixes: CVE-2022-28734
24
25Signed-off-by: Daniel Axtens <dja@axtens.net>
26Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
27
28Upstream-Status: Backport
29CVE: CVE-2022-28734
30
31Reference to upstream patch:
32https://git.savannah.gnu.org/cgit/grub.git/commit/?id=ec6bfd3237394c1c7dbf2fd73417173318d22f4b
33
34Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
35---
36 grub-core/net/http.c | 4 +---
37 1 file changed, 1 insertion(+), 3 deletions(-)
38
39diff --git a/grub-core/net/http.c b/grub-core/net/http.c
40index f8d7bf0cd..33a0a28c4 100644
41--- a/grub-core/net/http.c
42+++ b/grub-core/net/http.c
43@@ -190,9 +190,7 @@ http_receive (grub_net_tcp_socket_t sock __attribute__ ((unused)),
44 int have_line = 1;
45 char *t;
46 ptr = grub_memchr (nb->data, '\n', nb->tail - nb->data);
47- if (ptr)
48- ptr++;
49- else
50+ if (ptr == NULL)
51 {
52 have_line = 0;
53 ptr = (char *) nb->tail;
54--
552.34.1
56
diff --git a/meta/recipes-bsp/grub/files/CVE-2022-28735-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch b/meta/recipes-bsp/grub/files/CVE-2022-28735-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch
deleted file mode 100644
index 7a59f10bfb..0000000000
--- a/meta/recipes-bsp/grub/files/CVE-2022-28735-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch
+++ /dev/null
@@ -1,111 +0,0 @@
1From 6fe755c5c07bb386fda58306bfd19e4a1c974c53 Mon Sep 17 00:00:00 2001
2From: Julian Andres Klode <julian.klode@canonical.com>
3Date: Thu, 2 Dec 2021 15:03:53 +0100
4Subject: [PATCH] kern/efi/sb: Reject non-kernel files in the shim_lock
5 verifier
6
7We must not allow other verifiers to pass things like the GRUB modules.
8Instead of maintaining a blocklist, maintain an allowlist of things
9that we do not care about.
10
11This allowlist really should be made reusable, and shared by the
12lockdown verifier, but this is the minimal patch addressing
13security concerns where the TPM verifier was able to mark modules
14as verified (or the OpenPGP verifier for that matter), when it
15should not do so on shim-powered secure boot systems.
16
17Fixes: CVE-2022-28735
18
19Signed-off-by: Julian Andres Klode <julian.klode@canonical.com>
20Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
21
22Upstream-Status: Backport
23CVE:CVE-2022-28735
24
25Reference to upstream patch:
26https://git.savannah.gnu.org/cgit/grub.git/commit/?id=6fe755c5c07bb386fda58306bfd19e4a1c974c53
27
28Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
29---
30 grub-core/kern/efi/sb.c | 39 ++++++++++++++++++++++++++++++++++++---
31 include/grub/verify.h | 1 +
32 2 files changed, 37 insertions(+), 3 deletions(-)
33
34diff --git a/grub-core/kern/efi/sb.c b/grub-core/kern/efi/sb.c
35index c52ec6226..89c4bb3fd 100644
36--- a/grub-core/kern/efi/sb.c
37+++ b/grub-core/kern/efi/sb.c
38@@ -119,10 +119,11 @@ shim_lock_verifier_init (grub_file_t io __attribute__ ((unused)),
39 void **context __attribute__ ((unused)),
40 enum grub_verify_flags *flags)
41 {
42- *flags = GRUB_VERIFY_FLAGS_SKIP_VERIFICATION;
43+ *flags = GRUB_VERIFY_FLAGS_NONE;
44
45 switch (type & GRUB_FILE_TYPE_MASK)
46 {
47+ /* Files we check. */
48 case GRUB_FILE_TYPE_LINUX_KERNEL:
49 case GRUB_FILE_TYPE_MULTIBOOT_KERNEL:
50 case GRUB_FILE_TYPE_BSD_KERNEL:
51@@ -130,11 +131,43 @@ shim_lock_verifier_init (grub_file_t io __attribute__ ((unused)),
52 case GRUB_FILE_TYPE_PLAN9_KERNEL:
53 case GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE:
54 *flags = GRUB_VERIFY_FLAGS_SINGLE_CHUNK;
55+ return GRUB_ERR_NONE;
56
57- /* Fall through. */
58+ /* Files that do not affect secureboot state. */
59+ case GRUB_FILE_TYPE_NONE:
60+ case GRUB_FILE_TYPE_LOOPBACK:
61+ case GRUB_FILE_TYPE_LINUX_INITRD:
62+ case GRUB_FILE_TYPE_OPENBSD_RAMDISK:
63+ case GRUB_FILE_TYPE_XNU_RAMDISK:
64+ case GRUB_FILE_TYPE_SIGNATURE:
65+ case GRUB_FILE_TYPE_PUBLIC_KEY:
66+ case GRUB_FILE_TYPE_PUBLIC_KEY_TRUST:
67+ case GRUB_FILE_TYPE_PRINT_BLOCKLIST:
68+ case GRUB_FILE_TYPE_TESTLOAD:
69+ case GRUB_FILE_TYPE_GET_SIZE:
70+ case GRUB_FILE_TYPE_FONT:
71+ case GRUB_FILE_TYPE_ZFS_ENCRYPTION_KEY:
72+ case GRUB_FILE_TYPE_CAT:
73+ case GRUB_FILE_TYPE_HEXCAT:
74+ case GRUB_FILE_TYPE_CMP:
75+ case GRUB_FILE_TYPE_HASHLIST:
76+ case GRUB_FILE_TYPE_TO_HASH:
77+ case GRUB_FILE_TYPE_KEYBOARD_LAYOUT:
78+ case GRUB_FILE_TYPE_PIXMAP:
79+ case GRUB_FILE_TYPE_GRUB_MODULE_LIST:
80+ case GRUB_FILE_TYPE_CONFIG:
81+ case GRUB_FILE_TYPE_THEME:
82+ case GRUB_FILE_TYPE_GETTEXT_CATALOG:
83+ case GRUB_FILE_TYPE_FS_SEARCH:
84+ case GRUB_FILE_TYPE_LOADENV:
85+ case GRUB_FILE_TYPE_SAVEENV:
86+ case GRUB_FILE_TYPE_VERIFY_SIGNATURE:
87+ *flags = GRUB_VERIFY_FLAGS_SKIP_VERIFICATION;
88+ return GRUB_ERR_NONE;
89
90+ /* Other files. */
91 default:
92- return GRUB_ERR_NONE;
93+ return grub_error (GRUB_ERR_ACCESS_DENIED, N_("prohibited by secure boot policy"));
94 }
95 }
96
97diff --git a/include/grub/verify.h b/include/grub/verify.h
98index cd129c398..672ae1692 100644
99--- a/include/grub/verify.h
100+++ b/include/grub/verify.h
101@@ -24,6 +24,7 @@
102
103 enum grub_verify_flags
104 {
105+ GRUB_VERIFY_FLAGS_NONE = 0,
106 GRUB_VERIFY_FLAGS_SKIP_VERIFICATION = 1,
107 GRUB_VERIFY_FLAGS_SINGLE_CHUNK = 2,
108 /* Defer verification to another authority. */
109--
1102.34.1
111
diff --git a/meta/recipes-bsp/grub/files/CVE-2024-45774.patch b/meta/recipes-bsp/grub/files/CVE-2024-45774.patch
new file mode 100644
index 0000000000..55aecc17d7
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/CVE-2024-45774.patch
@@ -0,0 +1,37 @@
1From 2c34af908ebf4856051ed29e46d88abd2b20387f Mon Sep 17 00:00:00 2001
2From: Daniel Axtens <dja@axtens.net>
3Date: Fri, 8 Mar 2024 22:47:20 +1100
4Subject: [PATCH] video/readers/jpeg: Do not permit duplicate SOF0 markers in
5 JPEG
6
7Otherwise a subsequent header could change the height and width
8allowing future OOB writes.
9
10Fixes: CVE-2024-45774
11
12Reported-by: Nils Langius <nils@langius.de>
13Signed-off-by: Daniel Axtens <dja@axtens.net>
14Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
15
16CVE: CVE-2024-45774
17Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=2c34af908ebf4856051ed29e46d88abd2b20387f]
18Signed-off-by: Peter Marko <peter.marko@siemens.com>
19---
20 grub-core/video/readers/jpeg.c | 4 ++++
21 1 file changed, 4 insertions(+)
22
23diff --git a/grub-core/video/readers/jpeg.c b/grub-core/video/readers/jpeg.c
24index ae634fd41..631a89356 100644
25--- a/grub-core/video/readers/jpeg.c
26+++ b/grub-core/video/readers/jpeg.c
27@@ -339,6 +339,10 @@ grub_jpeg_decode_sof (struct grub_jpeg_data *data)
28 if (grub_errno != GRUB_ERR_NONE)
29 return grub_errno;
30
31+ if (data->image_height != 0 || data->image_width != 0)
32+ return grub_error (GRUB_ERR_BAD_FILE_TYPE,
33+ "jpeg: cannot have duplicate SOF0 markers");
34+
35 if (grub_jpeg_get_byte (data) != 8)
36 return grub_error (GRUB_ERR_BAD_FILE_TYPE,
37 "jpeg: only 8-bit precision is supported");
diff --git a/meta/recipes-bsp/grub/files/CVE-2024-45775.patch b/meta/recipes-bsp/grub/files/CVE-2024-45775.patch
new file mode 100644
index 0000000000..70492b8c2e
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/CVE-2024-45775.patch
@@ -0,0 +1,38 @@
1From 05be856a8c3aae41f5df90cab7796ab7ee34b872 Mon Sep 17 00:00:00 2001
2From: Lidong Chen <lidong.chen@oracle.com>
3Date: Fri, 22 Nov 2024 06:27:55 +0000
4Subject: [PATCH] commands/extcmd: Missing check for failed allocation
5
6The grub_extcmd_dispatcher() calls grub_arg_list_alloc() to allocate
7a grub_arg_list struct but it does not verify the allocation was successful.
8In case of failed allocation the NULL state pointer can be accessed in
9parse_option() through grub_arg_parse() which may lead to a security issue.
10
11Fixes: CVE-2024-45775
12
13Reported-by: Nils Langius <nils@langius.de>
14Signed-off-by: Lidong Chen <lidong.chen@oracle.com>
15Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
16Reviewed-by: Alec Brown <alec.r.brown@oracle.com>
17
18CVE: CVE-2024-45775
19Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=05be856a8c3aae41f5df90cab7796ab7ee34b872]
20Signed-off-by: Peter Marko <peter.marko@siemens.com>
21---
22 grub-core/commands/extcmd.c | 3 +++
23 1 file changed, 3 insertions(+)
24
25diff --git a/grub-core/commands/extcmd.c b/grub-core/commands/extcmd.c
26index 90a5ca24a..c236be13a 100644
27--- a/grub-core/commands/extcmd.c
28+++ b/grub-core/commands/extcmd.c
29@@ -49,6 +49,9 @@ grub_extcmd_dispatcher (struct grub_command *cmd, int argc, char **args,
30 }
31
32 state = grub_arg_list_alloc (ext, argc, args);
33+ if (state == NULL)
34+ return grub_errno;
35+
36 if (grub_arg_parse (ext, argc, args, state, &new_args, &new_argc))
37 {
38 context.state = state;
diff --git a/meta/recipes-bsp/grub/files/CVE-2024-45776.patch b/meta/recipes-bsp/grub/files/CVE-2024-45776.patch
new file mode 100644
index 0000000000..8deea958b8
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/CVE-2024-45776.patch
@@ -0,0 +1,39 @@
1From 09bd6eb58b0f71ec273916070fa1e2de16897a91 Mon Sep 17 00:00:00 2001
2From: Lidong Chen <lidong.chen@oracle.com>
3Date: Fri, 22 Nov 2024 06:27:56 +0000
4Subject: [PATCH] gettext: Integer overflow leads to heap OOB write or read
5
6Calculation of ctx->grub_gettext_msg_list size in grub_mofile_open() may
7overflow leading to subsequent OOB write or read. This patch fixes the
8issue by replacing grub_zalloc() and explicit multiplication with
9grub_calloc() which does the same thing in safe manner.
10
11Fixes: CVE-2024-45776
12
13Reported-by: Nils Langius <nils@langius.de>
14Signed-off-by: Lidong Chen <lidong.chen@oracle.com>
15Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
16Reviewed-by: Alec Brown <alec.r.brown@oracle.com>
17
18CVE: CVE-2024-45776
19Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=09bd6eb58b0f71ec273916070fa1e2de16897a91]
20Signed-off-by: Peter Marko <peter.marko@siemens.com>
21---
22 grub-core/gettext/gettext.c | 4 ++--
23 1 file changed, 2 insertions(+), 2 deletions(-)
24
25diff --git a/grub-core/gettext/gettext.c b/grub-core/gettext/gettext.c
26index e4f4f8ee6..63bb1ab73 100644
27--- a/grub-core/gettext/gettext.c
28+++ b/grub-core/gettext/gettext.c
29@@ -323,8 +323,8 @@ grub_mofile_open (struct grub_gettext_context *ctx,
30 for (ctx->grub_gettext_max_log = 0; ctx->grub_gettext_max >> ctx->grub_gettext_max_log;
31 ctx->grub_gettext_max_log++);
32
33- ctx->grub_gettext_msg_list = grub_zalloc (ctx->grub_gettext_max
34- * sizeof (ctx->grub_gettext_msg_list[0]));
35+ ctx->grub_gettext_msg_list = grub_calloc (ctx->grub_gettext_max,
36+ sizeof (ctx->grub_gettext_msg_list[0]));
37 if (!ctx->grub_gettext_msg_list)
38 {
39 grub_file_close (fd);
diff --git a/meta/recipes-bsp/grub/files/CVE-2024-45777.patch b/meta/recipes-bsp/grub/files/CVE-2024-45777.patch
new file mode 100644
index 0000000000..0305a95fd5
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/CVE-2024-45777.patch
@@ -0,0 +1,57 @@
1From b970a5ed967816bbca8225994cd0ee2557bad515 Mon Sep 17 00:00:00 2001
2From: Lidong Chen <lidong.chen@oracle.com>
3Date: Fri, 22 Nov 2024 06:27:57 +0000
4Subject: [PATCH] gettext: Integer overflow leads to heap OOB write
5
6The size calculation of the translation buffer in
7grub_gettext_getstr_from_position() may overflow
8to 0 leading to heap OOB write. This patch fixes
9the issue by using grub_add() and checking for
10an overflow.
11
12Fixes: CVE-2024-45777
13
14Reported-by: Nils Langius <nils@langius.de>
15Signed-off-by: Lidong Chen <lidong.chen@oracle.com>
16Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
17Reviewed-by: Alec Brown <alec.r.brown@oracle.com>
18
19CVE: CVE-2024-45777
20Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=b970a5ed967816bbca8225994cd0ee2557bad515]
21Signed-off-by: Peter Marko <peter.marko@siemens.com>
22---
23 grub-core/gettext/gettext.c | 7 ++++++-
24 1 file changed, 6 insertions(+), 1 deletion(-)
25
26diff --git a/grub-core/gettext/gettext.c b/grub-core/gettext/gettext.c
27index 63bb1ab73..9ffc73428 100644
28--- a/grub-core/gettext/gettext.c
29+++ b/grub-core/gettext/gettext.c
30@@ -26,6 +26,7 @@
31 #include <grub/file.h>
32 #include <grub/kernel.h>
33 #include <grub/i18n.h>
34+#include <grub/safemath.h>
35
36 GRUB_MOD_LICENSE ("GPLv3+");
37
38@@ -99,6 +100,7 @@ grub_gettext_getstr_from_position (struct grub_gettext_context *ctx,
39 char *translation;
40 struct string_descriptor desc;
41 grub_err_t err;
42+ grub_size_t alloc_sz;
43
44 internal_position = (off + position * sizeof (desc));
45
46@@ -109,7 +111,10 @@ grub_gettext_getstr_from_position (struct grub_gettext_context *ctx,
47 length = grub_cpu_to_le32 (desc.length);
48 offset = grub_cpu_to_le32 (desc.offset);
49
50- translation = grub_malloc (length + 1);
51+ if (grub_add (length, 1, &alloc_sz))
52+ return NULL;
53+
54+ translation = grub_malloc (alloc_sz);
55 if (!translation)
56 return NULL;
57
diff --git a/meta/recipes-bsp/grub/files/CVE-2024-45778_CVE-2024-45779.patch b/meta/recipes-bsp/grub/files/CVE-2024-45778_CVE-2024-45779.patch
new file mode 100644
index 0000000000..eba013897f
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/CVE-2024-45778_CVE-2024-45779.patch
@@ -0,0 +1,55 @@
1From 26db6605036bd9e5b16d9068a8cc75be63b8b630 Mon Sep 17 00:00:00 2001
2From: Daniel Axtens <dja@axtens.net>
3Date: Sat, 23 Mar 2024 15:59:43 +1100
4Subject: [PATCH] fs/bfs: Disable under lockdown
5
6The BFS is not fuzz-clean. Don't allow it to be loaded under lockdown.
7This will also disable the AFS.
8
9Fixes: CVE-2024-45778
10Fixes: CVE-2024-45779
11
12Reported-by: Nils Langius <nils@langius.de>
13Signed-off-by: Daniel Axtens <dja@axtens.net>
14Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
15
16CVE: CVE-2024-45778
17CVE: CVE-2024-45779
18Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=]
19Signed-off-by: Peter Marko <peter.marko@siemens.com>
20---
21 grub-core/fs/bfs.c | 9 +++++++--
22 1 file changed, 7 insertions(+), 2 deletions(-)
23
24diff --git a/grub-core/fs/bfs.c b/grub-core/fs/bfs.c
25index 022f69fe2..78aeb051f 100644
26--- a/grub-core/fs/bfs.c
27+++ b/grub-core/fs/bfs.c
28@@ -30,6 +30,7 @@
29 #include <grub/types.h>
30 #include <grub/i18n.h>
31 #include <grub/fshelp.h>
32+#include <grub/lockdown.h>
33
34 GRUB_MOD_LICENSE ("GPLv3+");
35
36@@ -1106,7 +1107,10 @@ GRUB_MOD_INIT (bfs)
37 {
38 COMPILE_TIME_ASSERT (1 << LOG_EXTENT_SIZE ==
39 sizeof (struct grub_bfs_extent));
40- grub_fs_register (&grub_bfs_fs);
41+ if (!grub_is_lockdown ())
42+ {
43+ grub_fs_register (&grub_bfs_fs);
44+ }
45 }
46
47 #ifdef MODE_AFS
48@@ -1115,5 +1119,6 @@ GRUB_MOD_FINI (afs)
49 GRUB_MOD_FINI (bfs)
50 #endif
51 {
52- grub_fs_unregister (&grub_bfs_fs);
53+ if (!grub_is_lockdown ())
54+ grub_fs_unregister (&grub_bfs_fs);
55 }
diff --git a/meta/recipes-bsp/grub/files/CVE-2024-45780.patch b/meta/recipes-bsp/grub/files/CVE-2024-45780.patch
new file mode 100644
index 0000000000..1de0099f94
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/CVE-2024-45780.patch
@@ -0,0 +1,93 @@
1From 0087bc6902182fe5cedce2d034c75a79cf6dd4f3 Mon Sep 17 00:00:00 2001
2From: Lidong Chen <lidong.chen@oracle.com>
3Date: Fri, 22 Nov 2024 06:27:58 +0000
4Subject: [PATCH] fs/tar: Integer overflow leads to heap OOB write
5
6Both namesize and linksize are derived from hd.size, a 12-digit octal
7number parsed by read_number(). Later direct arithmetic calculation like
8"namesize + 1" and "linksize + 1" may exceed the maximum value of
9grub_size_t leading to heap OOB write. This patch fixes the issue by
10using grub_add() and checking for an overflow.
11
12Fixes: CVE-2024-45780
13
14Reported-by: Nils Langius <nils@langius.de>
15Signed-off-by: Lidong Chen <lidong.chen@oracle.com>
16Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
17Reviewed-by: Alec Brown <alec.r.brown@oracle.com>
18
19CVE: CVE-2024-45780
20Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=0087bc6902182fe5cedce2d034c75a79cf6dd4f3]
21Signed-off-by: Peter Marko <peter.marko@siemens.com>
22---
23 grub-core/fs/tar.c | 23 ++++++++++++++++++-----
24 1 file changed, 18 insertions(+), 5 deletions(-)
25
26diff --git a/grub-core/fs/tar.c b/grub-core/fs/tar.c
27index 646bce5eb..386c09022 100644
28--- a/grub-core/fs/tar.c
29+++ b/grub-core/fs/tar.c
30@@ -25,6 +25,7 @@
31 #include <grub/mm.h>
32 #include <grub/dl.h>
33 #include <grub/i18n.h>
34+#include <grub/safemath.h>
35
36 GRUB_MOD_LICENSE ("GPLv3+");
37
38@@ -76,6 +77,7 @@ grub_cpio_find_file (struct grub_archelp_data *data, char **name,
39 {
40 struct head hd;
41 int reread = 0, have_longname = 0, have_longlink = 0;
42+ grub_size_t sz;
43
44 data->hofs = data->next_hofs;
45
46@@ -97,7 +99,11 @@ grub_cpio_find_file (struct grub_archelp_data *data, char **name,
47 {
48 grub_err_t err;
49 grub_size_t namesize = read_number (hd.size, sizeof (hd.size));
50- *name = grub_malloc (namesize + 1);
51+
52+ if (grub_add (namesize, 1, &sz))
53+ return grub_error (GRUB_ERR_BAD_FS, N_("name size overflow"));
54+
55+ *name = grub_malloc (sz);
56 if (*name == NULL)
57 return grub_errno;
58 err = grub_disk_read (data->disk, 0,
59@@ -117,15 +123,19 @@ grub_cpio_find_file (struct grub_archelp_data *data, char **name,
60 {
61 grub_err_t err;
62 grub_size_t linksize = read_number (hd.size, sizeof (hd.size));
63- if (data->linkname_alloc < linksize + 1)
64+
65+ if (grub_add (linksize, 1, &sz))
66+ return grub_error (GRUB_ERR_BAD_FS, N_("link size overflow"));
67+
68+ if (data->linkname_alloc < sz)
69 {
70 char *n;
71- n = grub_calloc (2, linksize + 1);
72+ n = grub_calloc (2, sz);
73 if (!n)
74 return grub_errno;
75 grub_free (data->linkname);
76 data->linkname = n;
77- data->linkname_alloc = 2 * (linksize + 1);
78+ data->linkname_alloc = 2 * (sz);
79 }
80
81 err = grub_disk_read (data->disk, 0,
82@@ -148,7 +158,10 @@ grub_cpio_find_file (struct grub_archelp_data *data, char **name,
83 while (extra_size < sizeof (hd.prefix)
84 && hd.prefix[extra_size])
85 extra_size++;
86- *name = grub_malloc (sizeof (hd.name) + extra_size + 2);
87+
88+ if (grub_add (sizeof (hd.name) + 2, extra_size, &sz))
89+ return grub_error (GRUB_ERR_BAD_FS, N_("long name size overflow"));
90+ *name = grub_malloc (sz);
91 if (*name == NULL)
92 return grub_errno;
93 if (hd.prefix[0])
diff --git a/meta/recipes-bsp/grub/files/CVE-2024-45781.patch b/meta/recipes-bsp/grub/files/CVE-2024-45781.patch
new file mode 100644
index 0000000000..bd0b6aa04a
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/CVE-2024-45781.patch
@@ -0,0 +1,35 @@
1From c1a291b01f4f1dcd6a22b61f1c81a45a966d16ba Mon Sep 17 00:00:00 2001
2From: B Horn <b@horn.uk>
3Date: Sun, 12 May 2024 02:03:33 +0100
4Subject: [PATCH 2/2] fs/ufs: Fix a heap OOB write
5
6grub_strcpy() was used to copy a symlink name from the filesystem
7image to a heap allocated buffer. This led to a OOB write to adjacent
8heap allocations. Fix by using grub_strlcpy().
9
10Fixes: CVE-2024-45781
11
12Reported-by: B Horn <b@horn.uk>
13Signed-off-by: B Horn <b@horn.uk>
14Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
15
16CVE: CVE-2024-45781
17Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=c1a291b01f4f1dcd6a22b61f1c81a45a966d16ba]
18Signed-off-by: Peter Marko <peter.marko@siemens.com>
19---
20 grub-core/fs/ufs.c | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23diff --git a/grub-core/fs/ufs.c b/grub-core/fs/ufs.c
24index a354c92d9..01235101b 100644
25--- a/grub-core/fs/ufs.c
26+++ b/grub-core/fs/ufs.c
27@@ -463,7 +463,7 @@ grub_ufs_lookup_symlink (struct grub_ufs_data *data, int ino)
28 /* Check against zero is paylindromic, no need to swap. */
29 if (data->inode.nblocks == 0
30 && INODE_SIZE (data) <= sizeof (data->inode.symlink))
31- grub_strcpy (symlink, (char *) data->inode.symlink);
32+ grub_strlcpy (symlink, (char *) data->inode.symlink, sz);
33 else
34 {
35 if (grub_ufs_read_file (data, 0, 0, 0, sz, symlink) < 0)
diff --git a/meta/recipes-bsp/grub/files/CVE-2024-45782_CVE-2024-56737.patch b/meta/recipes-bsp/grub/files/CVE-2024-45782_CVE-2024-56737.patch
new file mode 100644
index 0000000000..41cc025b81
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/CVE-2024-45782_CVE-2024-56737.patch
@@ -0,0 +1,36 @@
1From 417547c10410b714e43f08f74137c24015f8f4c3 Mon Sep 17 00:00:00 2001
2From: B Horn <b@horn.uk>
3Date: Sun, 12 May 2024 02:48:33 +0100
4Subject: [PATCH] fs/hfs: Fix stack OOB write with grub_strcpy()
5
6Replaced with grub_strlcpy().
7
8Fixes: CVE-2024-45782
9Fixes: CVE-2024-56737
10Fixes: https://savannah.gnu.org/bugs/?66599
11
12Reported-by: B Horn <b@horn.uk>
13Signed-off-by: B Horn <b@horn.uk>
14Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
15
16CVE: CVE-2024-45782
17CVE: CVE-2024-56737
18Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=417547c10410b714e43f08f74137c24015f8f4c3]
19Signed-off-by: Peter Marko <peter.marko@siemens.com>
20---
21 grub-core/fs/hfs.c | 2 +-
22 1 file changed, 1 insertion(+), 1 deletion(-)
23
24diff --git a/grub-core/fs/hfs.c b/grub-core/fs/hfs.c
25index 91dc0e69c..920112b03 100644
26--- a/grub-core/fs/hfs.c
27+++ b/grub-core/fs/hfs.c
28@@ -379,7 +379,7 @@ grub_hfs_mount (grub_disk_t disk)
29 volume name. */
30 key.parent_dir = grub_cpu_to_be32_compile_time (1);
31 key.strlen = data->sblock.volname[0];
32- grub_strcpy ((char *) key.str, (char *) (data->sblock.volname + 1));
33+ grub_strlcpy ((char *) key.str, (char *) (data->sblock.volname + 1), sizeof (key.str));
34
35 if (grub_hfs_find_node (data, (char *) &key, data->cat_root,
36 0, (char *) &dir, sizeof (dir)) == 0)
diff --git a/meta/recipes-bsp/grub/files/CVE-2024-45783.patch b/meta/recipes-bsp/grub/files/CVE-2024-45783.patch
new file mode 100644
index 0000000000..99c769961b
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/CVE-2024-45783.patch
@@ -0,0 +1,39 @@
1From f7c070a2e28dfab7137db0739fb8db1dc02d8898 Mon Sep 17 00:00:00 2001
2From: B Horn <b@horn.uk>
3Date: Sun, 12 May 2024 06:22:51 +0100
4Subject: [PATCH] fs/hfsplus: Set a grub_errno if mount fails
5
6It was possible for mount to fail but not set grub_errno. This led to
7a possible double decrement of the module reference count if the NULL
8page was mapped.
9
10Fixing in general as a similar bug was fixed in commit 61b13c187
11(fs/hfsplus: Set grub_errno to prevent NULL pointer access) and there
12are likely more variants around.
13
14Fixes: CVE-2024-45783
15
16Reported-by: B Horn <b@horn.uk>
17Signed-off-by: B Horn <b@horn.uk>
18Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
19
20CVE: CVE-2024-45783
21Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=f7c070a2e28dfab7137db0739fb8db1dc02d8898]
22Signed-off-by: Peter Marko <peter.marko@siemens.com>
23---
24 grub-core/fs/hfsplus.c | 2 +-
25 1 file changed, 1 insertion(+), 1 deletion(-)
26
27diff --git a/grub-core/fs/hfsplus.c b/grub-core/fs/hfsplus.c
28index 295822f69..de71fd486 100644
29--- a/grub-core/fs/hfsplus.c
30+++ b/grub-core/fs/hfsplus.c
31@@ -405,7 +405,7 @@ grub_hfsplus_mount (grub_disk_t disk)
32
33 fail:
34
35- if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
36+ if (grub_errno == GRUB_ERR_OUT_OF_RANGE || grub_errno == GRUB_ERR_NONE)
37 grub_error (GRUB_ERR_BAD_FS, "not a HFS+ filesystem");
38
39 grub_free (data);
diff --git a/meta/recipes-bsp/grub/files/CVE-2025-0622-01.patch b/meta/recipes-bsp/grub/files/CVE-2025-0622-01.patch
new file mode 100644
index 0000000000..09dbfce5f8
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/CVE-2025-0622-01.patch
@@ -0,0 +1,35 @@
1From 2123c5bca7e21fbeb0263df4597ddd7054700726 Mon Sep 17 00:00:00 2001
2From: B Horn <b@horn.uk>
3Date: Fri, 1 Nov 2024 19:24:29 +0000
4Subject: [PATCH 1/3] commands/pgp: Unregister the "check_signatures" hooks on
5 module unload
6
7If the hooks are not removed they can be called after the module has
8been unloaded leading to an use-after-free.
9
10Fixes: CVE-2025-0622
11
12Reported-by: B Horn <b@horn.uk>
13Signed-off-by: B Horn <b@horn.uk>
14Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
15
16CVE: CVE-2025-0622
17Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=2123c5bca7e21fbeb0263df4597ddd7054700726]
18Signed-off-by: Peter Marko <peter.marko@siemens.com>
19---
20 grub-core/commands/pgp.c | 2 ++
21 1 file changed, 2 insertions(+)
22
23diff --git a/grub-core/commands/pgp.c b/grub-core/commands/pgp.c
24index c6766f044..5fadc33c4 100644
25--- a/grub-core/commands/pgp.c
26+++ b/grub-core/commands/pgp.c
27@@ -1010,6 +1010,8 @@ GRUB_MOD_INIT(pgp)
28
29 GRUB_MOD_FINI(pgp)
30 {
31+ grub_register_variable_hook ("check_signatures", NULL, NULL);
32+ grub_env_unset ("check_signatures");
33 grub_verifier_unregister (&grub_pubkey_verifier);
34 grub_unregister_extcmd (cmd);
35 grub_unregister_extcmd (cmd_trust);
diff --git a/meta/recipes-bsp/grub/files/CVE-2025-0622-02.patch b/meta/recipes-bsp/grub/files/CVE-2025-0622-02.patch
new file mode 100644
index 0000000000..be01da3355
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/CVE-2025-0622-02.patch
@@ -0,0 +1,41 @@
1From 9c16197734ada8d0838407eebe081117799bfe67 Mon Sep 17 00:00:00 2001
2From: B Horn <b@horn.uk>
3Date: Fri, 1 Nov 2024 23:46:55 +0000
4Subject: [PATCH 2/3] normal: Remove variables hooks on module unload
5
6The normal module does not entirely cleanup after itself in
7its GRUB_MOD_FINI() leaving a few variables hooks in place.
8It is not possible to unload normal module now but fix the
9issues for completeness.
10
11On the occasion replace 0s with NULLs for "pager" variable
12hooks unregister.
13
14Fixes: CVE-2025-0622
15
16Reported-by: B Horn <b@horn.uk>
17Signed-off-by: B Horn <b@horn.uk>
18Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
19
20CVE: CVE-2025-0622
21Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=9c16197734ada8d0838407eebe081117799bfe67]
22Signed-off-by: Peter Marko <peter.marko@siemens.com>
23---
24 grub-core/normal/main.c | 4 +++-
25 1 file changed, 3 insertions(+), 1 deletion(-)
26
27diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c
28index 838f57fa5..04d058f55 100644
29--- a/grub-core/normal/main.c
30+++ b/grub-core/normal/main.c
31@@ -582,7 +582,9 @@ GRUB_MOD_FINI(normal)
32 grub_xputs = grub_xputs_saved;
33
34 grub_set_history (0);
35- grub_register_variable_hook ("pager", 0, 0);
36+ grub_register_variable_hook ("pager", NULL, NULL);
37+ grub_register_variable_hook ("color_normal", NULL, NULL);
38+ grub_register_variable_hook ("color_highlight", NULL, NULL);
39 grub_fs_autoload_hook = 0;
40 grub_unregister_command (cmd_clear);
41 }
diff --git a/meta/recipes-bsp/grub/files/CVE-2025-0622-03.patch b/meta/recipes-bsp/grub/files/CVE-2025-0622-03.patch
new file mode 100644
index 0000000000..79078a4350
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/CVE-2025-0622-03.patch
@@ -0,0 +1,38 @@
1From 7580addfc8c94cedb0cdfd7a1fd65b539215e637 Mon Sep 17 00:00:00 2001
2From: B Horn <b@horn.uk>
3Date: Fri, 1 Nov 2024 23:52:06 +0000
4Subject: [PATCH 3/3] gettext: Remove variables hooks on module unload
5
6The gettext module does not entirely cleanup after itself in
7its GRUB_MOD_FINI() leaving a few variables hooks in place.
8It is not possible to unload gettext module because normal
9module depends on it. Though fix the issues for completeness.
10
11Fixes: CVE-2025-0622
12
13Reported-by: B Horn <b@horn.uk>
14Signed-off-by: B Horn <b@horn.uk>
15Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
16
17CVE: CVE-2025-0622
18Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=7580addfc8c94cedb0cdfd7a1fd65b539215e637]
19Signed-off-by: Peter Marko <peter.marko@siemens.com>
20---
21 grub-core/gettext/gettext.c | 4 ++++
22 1 file changed, 4 insertions(+)
23
24diff --git a/grub-core/gettext/gettext.c b/grub-core/gettext/gettext.c
25index 7a1c14e4f..e4f4f8ee6 100644
26--- a/grub-core/gettext/gettext.c
27+++ b/grub-core/gettext/gettext.c
28@@ -535,6 +535,10 @@ GRUB_MOD_INIT (gettext)
29
30 GRUB_MOD_FINI (gettext)
31 {
32+ grub_register_variable_hook ("locale_dir", NULL, NULL);
33+ grub_register_variable_hook ("secondary_locale_dir", NULL, NULL);
34+ grub_register_variable_hook ("lang", NULL, NULL);
35+
36 grub_gettext_delete_list (&main_context);
37 grub_gettext_delete_list (&secondary_context);
38
diff --git a/meta/recipes-bsp/grub/files/CVE-2025-0624.patch b/meta/recipes-bsp/grub/files/CVE-2025-0624.patch
new file mode 100644
index 0000000000..229fe6399e
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/CVE-2025-0624.patch
@@ -0,0 +1,84 @@
1From 5eef88152833062a3f7e017535372d64ac8ef7e1 Mon Sep 17 00:00:00 2001
2From: B Horn <b@horn.uk>
3Date: Fri, 15 Nov 2024 13:12:09 +0000
4Subject: [PATCH] net: Fix OOB write in grub_net_search_config_file()
5
6The function included a call to grub_strcpy() which copied data from an
7environment variable to a buffer allocated in grub_cmd_normal(). The
8grub_cmd_normal() didn't consider the length of the environment variable.
9So, the copy operation could exceed the allocation and lead to an OOB
10write. Fix the issue by replacing grub_strcpy() with grub_strlcpy() and
11pass the underlying buffers size to the grub_net_search_config_file().
12
13Fixes: CVE-2025-0624
14
15Reported-by: B Horn <b@horn.uk>
16Signed-off-by: B Horn <b@horn.uk>
17Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
18
19CVE: CVE-2025-0624
20Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=5eef88152833062a3f7e017535372d64ac8ef7e1]
21Signed-off-by: Peter Marko <peter.marko@siemens.com>
22---
23 grub-core/net/net.c | 7 ++++---
24 grub-core/normal/main.c | 2 +-
25 include/grub/net.h | 2 +-
26 3 files changed, 6 insertions(+), 5 deletions(-)
27
28diff --git a/grub-core/net/net.c b/grub-core/net/net.c
29index 0e41e21a5..9939ff601 100644
30--- a/grub-core/net/net.c
31+++ b/grub-core/net/net.c
32@@ -1909,14 +1909,15 @@ grub_config_search_through (char *config, char *suffix,
33 }
34
35 grub_err_t
36-grub_net_search_config_file (char *config)
37+grub_net_search_config_file (char *config, grub_size_t config_buf_len)
38 {
39- grub_size_t config_len;
40+ grub_size_t config_len, suffix_len;
41 char *suffix;
42
43 config_len = grub_strlen (config);
44 config[config_len] = '-';
45 suffix = config + config_len + 1;
46+ suffix_len = config_buf_len - (config_len + 1);
47
48 struct grub_net_network_level_interface *inf;
49 FOR_NET_NETWORK_LEVEL_INTERFACES (inf)
50@@ -1942,7 +1943,7 @@ grub_net_search_config_file (char *config)
51
52 if (client_uuid)
53 {
54- grub_strcpy (suffix, client_uuid);
55+ grub_strlcpy (suffix, client_uuid, suffix_len);
56 if (grub_config_search_through (config, suffix, 1, 0) == 0)
57 return GRUB_ERR_NONE;
58 }
59diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c
60index 90879dc21..838f57fa5 100644
61--- a/grub-core/normal/main.c
62+++ b/grub-core/normal/main.c
63@@ -344,7 +344,7 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)),
64
65 if (grub_strncmp (prefix + 1, "tftp", sizeof ("tftp") - 1) == 0 &&
66 !disable_net_search)
67- grub_net_search_config_file (config);
68+ grub_net_search_config_file (config, config_len);
69
70 grub_enter_normal_mode (config);
71 grub_free (config);
72diff --git a/include/grub/net.h b/include/grub/net.h
73index 228d04963..58a4f83fc 100644
74--- a/include/grub/net.h
75+++ b/include/grub/net.h
76@@ -579,7 +579,7 @@ void
77 grub_net_remove_dns_server (const struct grub_net_network_level_address *s);
78
79 grub_err_t
80-grub_net_search_config_file (char *config);
81+grub_net_search_config_file (char *config, grub_size_t config_buf_len);
82
83 extern char *grub_net_default_server;
84
diff --git a/meta/recipes-bsp/grub/files/CVE-2025-0677_CVE-2025-0684_CVE-2025-0685_CVE-2025-0686_CVE-2025-0689.patch b/meta/recipes-bsp/grub/files/CVE-2025-0677_CVE-2025-0684_CVE-2025-0685_CVE-2025-0686_CVE-2025-0689.patch
new file mode 100644
index 0000000000..d5563cecc4
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/CVE-2025-0677_CVE-2025-0684_CVE-2025-0685_CVE-2025-0686_CVE-2025-0689.patch
@@ -0,0 +1,377 @@
1From 47b2dfc7953f70f98ddf35dfdd6e7f4f20283b10 Mon Sep 17 00:00:00 2001
2From: Daniel Axtens <dja@axtens.net>
3Date: Sat, 23 Mar 2024 16:20:45 +1100
4Subject: [PATCH] fs: Disable many filesystems under lockdown
5
6The idea is to permit the following: btrfs, cpio, exfat, ext, f2fs, fat,
7hfsplus, iso9660, squash4, tar, xfs and zfs.
8
9The JFS, ReiserFS, romfs, UDF and UFS security vulnerabilities were
10reported by Jonathan Bar Or <jonathanbaror@gmail.com>.
11
12Fixes: CVE-2025-0677
13Fixes: CVE-2025-0684
14Fixes: CVE-2025-0685
15Fixes: CVE-2025-0686
16Fixes: CVE-2025-0689
17
18Suggested-by: Daniel Axtens <dja@axtens.net>
19Signed-off-by: Daniel Axtens <dja@axtens.net>
20Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
21
22CVE: CVE-2025-0677
23CVE: CVE-2025-0684
24CVE: CVE-2025-0685
25CVE: CVE-2025-0686
26CVE: CVE-2025-0689
27Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=47b2dfc7953f70f98ddf35dfdd6e7f4f20283b10]
28Signed-off-by: Peter Marko <peter.marko@siemens.com>
29---
30 grub-core/fs/affs.c | 9 +++++++--
31 grub-core/fs/cbfs.c | 9 +++++++--
32 grub-core/fs/jfs.c | 9 +++++++--
33 grub-core/fs/minix.c | 9 +++++++--
34 grub-core/fs/nilfs2.c | 9 +++++++--
35 grub-core/fs/ntfs.c | 9 +++++++--
36 grub-core/fs/reiserfs.c | 9 +++++++--
37 grub-core/fs/romfs.c | 9 +++++++--
38 grub-core/fs/sfs.c | 9 +++++++--
39 grub-core/fs/udf.c | 9 +++++++--
40 grub-core/fs/ufs.c | 9 +++++++--
41 11 files changed, 77 insertions(+), 22 deletions(-)
42
43diff --git a/grub-core/fs/affs.c b/grub-core/fs/affs.c
44index ed606b3f1..352f5d232 100644
45--- a/grub-core/fs/affs.c
46+++ b/grub-core/fs/affs.c
47@@ -26,6 +26,7 @@
48 #include <grub/types.h>
49 #include <grub/fshelp.h>
50 #include <grub/charset.h>
51+#include <grub/lockdown.h>
52
53 GRUB_MOD_LICENSE ("GPLv3+");
54
55@@ -703,11 +704,15 @@ static struct grub_fs grub_affs_fs =
56
57 GRUB_MOD_INIT(affs)
58 {
59- grub_fs_register (&grub_affs_fs);
60+ if (!grub_is_lockdown ())
61+ {
62+ grub_fs_register (&grub_affs_fs);
63+ }
64 my_mod = mod;
65 }
66
67 GRUB_MOD_FINI(affs)
68 {
69- grub_fs_unregister (&grub_affs_fs);
70+ if (!grub_is_lockdown ())
71+ grub_fs_unregister (&grub_affs_fs);
72 }
73diff --git a/grub-core/fs/cbfs.c b/grub-core/fs/cbfs.c
74index 8ab7106af..f6349df34 100644
75--- a/grub-core/fs/cbfs.c
76+++ b/grub-core/fs/cbfs.c
77@@ -26,6 +26,7 @@
78 #include <grub/dl.h>
79 #include <grub/i18n.h>
80 #include <grub/cbfs_core.h>
81+#include <grub/lockdown.h>
82
83 GRUB_MOD_LICENSE ("GPLv3+");
84
85@@ -390,12 +391,16 @@ GRUB_MOD_INIT (cbfs)
86 #if (defined (__i386__) || defined (__x86_64__)) && !defined (GRUB_UTIL) && !defined (GRUB_MACHINE_EMU) && !defined (GRUB_MACHINE_XEN)
87 init_cbfsdisk ();
88 #endif
89- grub_fs_register (&grub_cbfs_fs);
90+ if (!grub_is_lockdown ())
91+ {
92+ grub_fs_register (&grub_cbfs_fs);
93+ }
94 }
95
96 GRUB_MOD_FINI (cbfs)
97 {
98- grub_fs_unregister (&grub_cbfs_fs);
99+ if (!grub_is_lockdown ())
100+ grub_fs_unregister (&grub_cbfs_fs);
101 #if (defined (__i386__) || defined (__x86_64__)) && !defined (GRUB_UTIL) && !defined (GRUB_MACHINE_EMU) && !defined (GRUB_MACHINE_XEN)
102 fini_cbfsdisk ();
103 #endif
104diff --git a/grub-core/fs/jfs.c b/grub-core/fs/jfs.c
105index 6f7c43904..c0bbab8a9 100644
106--- a/grub-core/fs/jfs.c
107+++ b/grub-core/fs/jfs.c
108@@ -26,6 +26,7 @@
109 #include <grub/types.h>
110 #include <grub/charset.h>
111 #include <grub/i18n.h>
112+#include <grub/lockdown.h>
113
114 GRUB_MOD_LICENSE ("GPLv3+");
115
116@@ -963,11 +964,15 @@ static struct grub_fs grub_jfs_fs =
117
118 GRUB_MOD_INIT(jfs)
119 {
120- grub_fs_register (&grub_jfs_fs);
121+ if (!grub_is_lockdown ())
122+ {
123+ grub_fs_register (&grub_jfs_fs);
124+ }
125 my_mod = mod;
126 }
127
128 GRUB_MOD_FINI(jfs)
129 {
130- grub_fs_unregister (&grub_jfs_fs);
131+ if (!grub_is_lockdown ())
132+ grub_fs_unregister (&grub_jfs_fs);
133 }
134diff --git a/grub-core/fs/minix.c b/grub-core/fs/minix.c
135index 5354951d1..c267298b5 100644
136--- a/grub-core/fs/minix.c
137+++ b/grub-core/fs/minix.c
138@@ -25,6 +25,7 @@
139 #include <grub/dl.h>
140 #include <grub/types.h>
141 #include <grub/i18n.h>
142+#include <grub/lockdown.h>
143
144 GRUB_MOD_LICENSE ("GPLv3+");
145
146@@ -734,7 +735,10 @@ GRUB_MOD_INIT(minix)
147 #endif
148 #endif
149 {
150- grub_fs_register (&grub_minix_fs);
151+ if (!grub_is_lockdown ())
152+ {
153+ grub_fs_register (&grub_minix_fs);
154+ }
155 my_mod = mod;
156 }
157
158@@ -756,5 +760,6 @@ GRUB_MOD_FINI(minix)
159 #endif
160 #endif
161 {
162- grub_fs_unregister (&grub_minix_fs);
163+ if (!grub_is_lockdown ())
164+ grub_fs_unregister (&grub_minix_fs);
165 }
166diff --git a/grub-core/fs/nilfs2.c b/grub-core/fs/nilfs2.c
167index fc7374ead..08abf173f 100644
168--- a/grub-core/fs/nilfs2.c
169+++ b/grub-core/fs/nilfs2.c
170@@ -34,6 +34,7 @@
171 #include <grub/dl.h>
172 #include <grub/types.h>
173 #include <grub/fshelp.h>
174+#include <grub/lockdown.h>
175
176 GRUB_MOD_LICENSE ("GPLv3+");
177
178@@ -1231,11 +1232,15 @@ GRUB_MOD_INIT (nilfs2)
179 grub_nilfs2_dat_entry));
180 COMPILE_TIME_ASSERT (1 << LOG_INODE_SIZE
181 == sizeof (struct grub_nilfs2_inode));
182- grub_fs_register (&grub_nilfs2_fs);
183+ if (!grub_is_lockdown ())
184+ {
185+ grub_fs_register (&grub_nilfs2_fs);
186+ }
187 my_mod = mod;
188 }
189
190 GRUB_MOD_FINI (nilfs2)
191 {
192- grub_fs_unregister (&grub_nilfs2_fs);
193+ if (!grub_is_lockdown ())
194+ grub_fs_unregister (&grub_nilfs2_fs);
195 }
196diff --git a/grub-core/fs/ntfs.c b/grub-core/fs/ntfs.c
197index de435aa14..8cc2ba3d5 100644
198--- a/grub-core/fs/ntfs.c
199+++ b/grub-core/fs/ntfs.c
200@@ -27,6 +27,7 @@
201 #include <grub/fshelp.h>
202 #include <grub/ntfs.h>
203 #include <grub/charset.h>
204+#include <grub/lockdown.h>
205
206 GRUB_MOD_LICENSE ("GPLv3+");
207
208@@ -1320,11 +1321,15 @@ static struct grub_fs grub_ntfs_fs =
209
210 GRUB_MOD_INIT (ntfs)
211 {
212- grub_fs_register (&grub_ntfs_fs);
213+ if (!grub_is_lockdown ())
214+ {
215+ grub_fs_register (&grub_ntfs_fs);
216+ }
217 my_mod = mod;
218 }
219
220 GRUB_MOD_FINI (ntfs)
221 {
222- grub_fs_unregister (&grub_ntfs_fs);
223+ if (!grub_is_lockdown ())
224+ grub_fs_unregister (&grub_ntfs_fs);
225 }
226diff --git a/grub-core/fs/reiserfs.c b/grub-core/fs/reiserfs.c
227index 36b26ac98..cdef2eba0 100644
228--- a/grub-core/fs/reiserfs.c
229+++ b/grub-core/fs/reiserfs.c
230@@ -39,6 +39,7 @@
231 #include <grub/types.h>
232 #include <grub/fshelp.h>
233 #include <grub/i18n.h>
234+#include <grub/lockdown.h>
235
236 GRUB_MOD_LICENSE ("GPLv3+");
237
238@@ -1417,11 +1418,15 @@ static struct grub_fs grub_reiserfs_fs =
239
240 GRUB_MOD_INIT(reiserfs)
241 {
242- grub_fs_register (&grub_reiserfs_fs);
243+ if (!grub_is_lockdown ())
244+ {
245+ grub_fs_register (&grub_reiserfs_fs);
246+ }
247 my_mod = mod;
248 }
249
250 GRUB_MOD_FINI(reiserfs)
251 {
252- grub_fs_unregister (&grub_reiserfs_fs);
253+ if (!grub_is_lockdown ())
254+ grub_fs_unregister (&grub_reiserfs_fs);
255 }
256diff --git a/grub-core/fs/romfs.c b/grub-core/fs/romfs.c
257index 1f7dcfca1..acf8dd21e 100644
258--- a/grub-core/fs/romfs.c
259+++ b/grub-core/fs/romfs.c
260@@ -23,6 +23,7 @@
261 #include <grub/disk.h>
262 #include <grub/fs.h>
263 #include <grub/fshelp.h>
264+#include <grub/lockdown.h>
265
266 GRUB_MOD_LICENSE ("GPLv3+");
267
268@@ -475,10 +476,14 @@ static struct grub_fs grub_romfs_fs =
269
270 GRUB_MOD_INIT(romfs)
271 {
272- grub_fs_register (&grub_romfs_fs);
273+ if (!grub_is_lockdown ())
274+ {
275+ grub_fs_register (&grub_romfs_fs);
276+ }
277 }
278
279 GRUB_MOD_FINI(romfs)
280 {
281- grub_fs_unregister (&grub_romfs_fs);
282+ if (!grub_is_lockdown ())
283+ grub_fs_unregister (&grub_romfs_fs);
284 }
285diff --git a/grub-core/fs/sfs.c b/grub-core/fs/sfs.c
286index 983e88008..f64bdd2df 100644
287--- a/grub-core/fs/sfs.c
288+++ b/grub-core/fs/sfs.c
289@@ -26,6 +26,7 @@
290 #include <grub/types.h>
291 #include <grub/fshelp.h>
292 #include <grub/charset.h>
293+#include <grub/lockdown.h>
294 #include <grub/safemath.h>
295
296 GRUB_MOD_LICENSE ("GPLv3+");
297@@ -779,11 +780,15 @@ static struct grub_fs grub_sfs_fs =
298
299 GRUB_MOD_INIT(sfs)
300 {
301- grub_fs_register (&grub_sfs_fs);
302+ if (!grub_is_lockdown ())
303+ {
304+ grub_fs_register (&grub_sfs_fs);
305+ }
306 my_mod = mod;
307 }
308
309 GRUB_MOD_FINI(sfs)
310 {
311- grub_fs_unregister (&grub_sfs_fs);
312+ if (!grub_is_lockdown ())
313+ grub_fs_unregister (&grub_sfs_fs);
314 }
315diff --git a/grub-core/fs/udf.c b/grub-core/fs/udf.c
316index b836e6107..a60643be1 100644
317--- a/grub-core/fs/udf.c
318+++ b/grub-core/fs/udf.c
319@@ -27,6 +27,7 @@
320 #include <grub/fshelp.h>
321 #include <grub/charset.h>
322 #include <grub/datetime.h>
323+#include <grub/lockdown.h>
324 #include <grub/udf.h>
325 #include <grub/safemath.h>
326
327@@ -1455,11 +1456,15 @@ static struct grub_fs grub_udf_fs = {
328
329 GRUB_MOD_INIT (udf)
330 {
331- grub_fs_register (&grub_udf_fs);
332+ if (!grub_is_lockdown ())
333+ {
334+ grub_fs_register (&grub_udf_fs);
335+ }
336 my_mod = mod;
337 }
338
339 GRUB_MOD_FINI (udf)
340 {
341- grub_fs_unregister (&grub_udf_fs);
342+ if (!grub_is_lockdown ())
343+ grub_fs_unregister (&grub_udf_fs);
344 }
345diff --git a/grub-core/fs/ufs.c b/grub-core/fs/ufs.c
346index 01235101b..6b496e7b8 100644
347--- a/grub-core/fs/ufs.c
348+++ b/grub-core/fs/ufs.c
349@@ -25,6 +25,7 @@
350 #include <grub/dl.h>
351 #include <grub/types.h>
352 #include <grub/i18n.h>
353+#include <grub/lockdown.h>
354
355 GRUB_MOD_LICENSE ("GPLv3+");
356
357@@ -899,7 +900,10 @@ GRUB_MOD_INIT(ufs1)
358 #endif
359 #endif
360 {
361- grub_fs_register (&grub_ufs_fs);
362+ if (!grub_is_lockdown ())
363+ {
364+ grub_fs_register (&grub_ufs_fs);
365+ }
366 my_mod = mod;
367 }
368
369@@ -913,6 +917,7 @@ GRUB_MOD_FINI(ufs1)
370 #endif
371 #endif
372 {
373- grub_fs_unregister (&grub_ufs_fs);
374+ if (!grub_is_lockdown ())
375+ grub_fs_unregister (&grub_ufs_fs);
376 }
377
diff --git a/meta/recipes-bsp/grub/files/CVE-2025-0678_CVE-2025-1125.patch b/meta/recipes-bsp/grub/files/CVE-2025-0678_CVE-2025-1125.patch
new file mode 100644
index 0000000000..14e67cf35b
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/CVE-2025-0678_CVE-2025-1125.patch
@@ -0,0 +1,87 @@
1From 84bc0a9a68835952ae69165c11709811dae7634e Mon Sep 17 00:00:00 2001
2From: Lidong Chen <lidong.chen@oracle.com>
3Date: Tue, 21 Jan 2025 19:02:37 +0000
4Subject: [PATCH] fs: Prevent overflows when allocating memory for arrays
5
6Use grub_calloc() when allocating memory for arrays to ensure proper
7overflow checks are in place.
8
9The HFS+ and squash4 security vulnerabilities were reported by
10Jonathan Bar Or <jonathanbaror@gmail.com>.
11
12Fixes: CVE-2025-0678
13Fixes: CVE-2025-1125
14
15Signed-off-by: Lidong Chen <lidong.chen@oracle.com>
16Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
17
18CVE: CVE-2025-0678
19CVE: CVE-2025-1125
20Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=84bc0a9a68835952ae69165c11709811dae7634e]
21Signed-off-by: Peter Marko <peter.marko@siemens.com>
22---
23 grub-core/fs/btrfs.c | 4 ++--
24 grub-core/fs/hfspluscomp.c | 9 +++++++--
25 grub-core/fs/squash4.c | 8 ++++----
26 3 files changed, 13 insertions(+), 8 deletions(-)
27
28diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
29index 0625b1166..9c1e925c9 100644
30--- a/grub-core/fs/btrfs.c
31+++ b/grub-core/fs/btrfs.c
32@@ -1276,8 +1276,8 @@ grub_btrfs_mount (grub_device_t dev)
33 }
34
35 data->n_devices_allocated = 16;
36- data->devices_attached = grub_malloc (sizeof (data->devices_attached[0])
37- * data->n_devices_allocated);
38+ data->devices_attached = grub_calloc (data->n_devices_allocated,
39+ sizeof (data->devices_attached[0]));
40 if (!data->devices_attached)
41 {
42 grub_free (data);
43diff --git a/grub-core/fs/hfspluscomp.c b/grub-core/fs/hfspluscomp.c
44index 48ae438d8..a80954ee6 100644
45--- a/grub-core/fs/hfspluscomp.c
46+++ b/grub-core/fs/hfspluscomp.c
47@@ -244,14 +244,19 @@ hfsplus_open_compressed_real (struct grub_hfsplus_file *node)
48 return 0;
49 }
50 node->compress_index_size = grub_le_to_cpu32 (index_size);
51- node->compress_index = grub_malloc (node->compress_index_size
52- * sizeof (node->compress_index[0]));
53+ node->compress_index = grub_calloc (node->compress_index_size,
54+ sizeof (node->compress_index[0]));
55 if (!node->compress_index)
56 {
57 node->compressed = 0;
58 grub_free (attr_node);
59 return grub_errno;
60 }
61+
62+ /*
63+ * The node->compress_index_size * sizeof (node->compress_index[0]) is safe here
64+ * due to relevant checks done in grub_calloc() above.
65+ */
66 if (grub_hfsplus_read_file (node, 0, 0,
67 0x104 + sizeof (index_size),
68 node->compress_index_size
69diff --git a/grub-core/fs/squash4.c b/grub-core/fs/squash4.c
70index f91ff3bfa..cf2bca822 100644
71--- a/grub-core/fs/squash4.c
72+++ b/grub-core/fs/squash4.c
73@@ -816,10 +816,10 @@ direct_read (struct grub_squash_data *data,
74 break;
75 }
76 total_blocks = ((total_size + data->blksz - 1) >> data->log2_blksz);
77- ino->block_sizes = grub_malloc (total_blocks
78- * sizeof (ino->block_sizes[0]));
79- ino->cumulated_block_sizes = grub_malloc (total_blocks
80- * sizeof (ino->cumulated_block_sizes[0]));
81+ ino->block_sizes = grub_calloc (total_blocks,
82+ sizeof (ino->block_sizes[0]));
83+ ino->cumulated_block_sizes = grub_calloc (total_blocks,
84+ sizeof (ino->cumulated_block_sizes[0]));
85 if (!ino->block_sizes || !ino->cumulated_block_sizes)
86 {
87 grub_free (ino->block_sizes);
diff --git a/meta/recipes-bsp/grub/files/CVE-2025-0690.patch b/meta/recipes-bsp/grub/files/CVE-2025-0690.patch
new file mode 100644
index 0000000000..be585c96ad
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/CVE-2025-0690.patch
@@ -0,0 +1,73 @@
1From dad8f502974ed9ad0a70ae6820d17b4b142558fc Mon Sep 17 00:00:00 2001
2From: Jonathan Bar Or <jonathanbaror@gmail.com>
3Date: Thu, 23 Jan 2025 19:17:05 +0100
4Subject: [PATCH] commands/read: Fix an integer overflow when supplying more
5 than 2^31 characters
6
7The grub_getline() function currently has a signed integer variable "i"
8that can be overflown when user supplies more than 2^31 characters.
9It results in a memory corruption of the allocated line buffer as well
10as supplying large negative values to grub_realloc().
11
12Fixes: CVE-2025-0690
13
14Reported-by: Jonathan Bar Or <jonathanbaror@gmail.com>
15Signed-off-by: Jonathan Bar Or <jonathanbaror@gmail.com>
16Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
17
18CVE: CVE-2025-0690
19Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=dad8f502974ed9ad0a70ae6820d17b4b142558fc]
20Signed-off-by: Peter Marko <peter.marko@siemens.com>
21---
22 grub-core/commands/read.c | 19 +++++++++++++++----
23 1 file changed, 15 insertions(+), 4 deletions(-)
24
25diff --git a/grub-core/commands/read.c b/grub-core/commands/read.c
26index 597c90706..8d72e45c9 100644
27--- a/grub-core/commands/read.c
28+++ b/grub-core/commands/read.c
29@@ -25,6 +25,7 @@
30 #include <grub/types.h>
31 #include <grub/extcmd.h>
32 #include <grub/i18n.h>
33+#include <grub/safemath.h>
34
35 GRUB_MOD_LICENSE ("GPLv3+");
36
37@@ -37,13 +38,14 @@ static const struct grub_arg_option options[] =
38 static char *
39 grub_getline (int silent)
40 {
41- int i;
42+ grub_size_t i;
43 char *line;
44 char *tmp;
45 int c;
46+ grub_size_t alloc_size;
47
48 i = 0;
49- line = grub_malloc (1 + i + sizeof('\0'));
50+ line = grub_malloc (1 + sizeof('\0'));
51 if (! line)
52 return NULL;
53
54@@ -59,8 +61,17 @@ grub_getline (int silent)
55 line[i] = (char) c;
56 if (!silent)
57 grub_printf ("%c", c);
58- i++;
59- tmp = grub_realloc (line, 1 + i + sizeof('\0'));
60+ if (grub_add (i, 1, &i))
61+ {
62+ grub_error (GRUB_ERR_OUT_OF_RANGE, N_("overflow is detected"));
63+ return NULL;
64+ }
65+ if (grub_add (i, 1 + sizeof('\0'), &alloc_size))
66+ {
67+ grub_error (GRUB_ERR_OUT_OF_RANGE, N_("overflow is detected"));
68+ return NULL;
69+ }
70+ tmp = grub_realloc (line, alloc_size);
71 if (! tmp)
72 {
73 grub_free (line);
diff --git a/meta/recipes-bsp/grub/files/CVE-2025-1118.patch b/meta/recipes-bsp/grub/files/CVE-2025-1118.patch
new file mode 100644
index 0000000000..e6906d909c
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/CVE-2025-1118.patch
@@ -0,0 +1,37 @@
1From 34824806ac6302f91e8cabaa41308eaced25725f Mon Sep 17 00:00:00 2001
2From: B Horn <b@horn.uk>
3Date: Thu, 18 Apr 2024 20:29:39 +0100
4Subject: [PATCH] commands/minicmd: Block the dump command in lockdown mode
5
6The dump enables a user to read memory which should not be possible
7in lockdown mode.
8
9Fixes: CVE-2025-1118
10
11Reported-by: B Horn <b@horn.uk>
12Reported-by: Jonathan Bar Or <jonathanbaror@gmail.com>
13Signed-off-by: B Horn <b@horn.uk>
14Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
15
16CVE: CVE-2025-1118
17Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=34824806ac6302f91e8cabaa41308eaced25725f]
18Signed-off-by: Peter Marko <peter.marko@siemens.com>
19---
20 grub-core/commands/minicmd.c | 4 ++--
21 1 file changed, 2 insertions(+), 2 deletions(-)
22
23diff --git a/grub-core/commands/minicmd.c b/grub-core/commands/minicmd.c
24index 286290866..8c5ee3e60 100644
25--- a/grub-core/commands/minicmd.c
26+++ b/grub-core/commands/minicmd.c
27@@ -203,8 +203,8 @@ GRUB_MOD_INIT(minicmd)
28 grub_register_command ("help", grub_mini_cmd_help,
29 0, N_("Show this message."));
30 cmd_dump =
31- grub_register_command ("dump", grub_mini_cmd_dump,
32- N_("ADDR [SIZE]"), N_("Show memory contents."));
33+ grub_register_command_lockdown ("dump", grub_mini_cmd_dump,
34+ N_("ADDR [SIZE]"), N_("Show memory contents."));
35 cmd_rmmod =
36 grub_register_command ("rmmod", grub_mini_cmd_rmmod,
37 N_("MODULE"), N_("Remove a module."));
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 @@
1From 8790aa8bea736f52341a0430ff3e317d3be0f99b Mon Sep 17 00:00:00 2001 1From 14c1d0459fb3561e627d3a5f6e91a0d2f7b4aa45 Mon Sep 17 00:00:00 2001
2From: Naveen Saini <naveen.kumar.saini@intel.com> 2From: Naveen Saini <naveen.kumar.saini@intel.com>
3Date: Mon, 15 Mar 2021 14:44:15 +0800 3Date: Mon, 15 Mar 2021 14:44:15 +0800
4Subject: [PATCH] autogen.sh: exclude .pc from po/POTFILES.in 4Subject: [PATCH] autogen.sh: exclude .pc from po/POTFILES.in
@@ -14,15 +14,16 @@ Upstream-Status: Inappropriate [OE specific]
14Signed-off-by: Robert Yang <liezhi.yang@windriver.com> 14Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
15Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> 15Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
16Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> 16Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
17
17--- 18---
18 autogen.sh | 2 +- 19 autogen.sh | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-) 20 1 file changed, 1 insertion(+), 1 deletion(-)
20 21
21diff --git a/autogen.sh b/autogen.sh 22diff --git a/autogen.sh b/autogen.sh
22index 31b0ced7e..c63ae766c 100755 23index 195daa5..773b7b4 100755
23--- a/autogen.sh 24--- a/autogen.sh
24+++ b/autogen.sh 25+++ b/autogen.sh
25@@ -13,7 +13,7 @@ fi 26@@ -26,7 +26,7 @@ fi
26 export LC_COLLATE=C 27 export LC_COLLATE=C
27 unset LC_ALL 28 unset LC_ALL
28 29
@@ -31,6 +32,3 @@ index 31b0ced7e..c63ae766c 100755
31 find util -iname '*.in' ! -name Makefile.in |sort > po/POTFILES-shell.in 32 find util -iname '*.in' ! -name Makefile.in |sort > po/POTFILES-shell.in
32 33
33 echo "Importing unicode..." 34 echo "Importing unicode..."
34--
352.17.1
36
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 @@
1From b6f9b3f6fa782807c4a7ec16ee8ef868cdfbf468 Mon Sep 17 00:00:00 2001
2From: Naveen Saini <naveen.kumar.saini@intel.com>
3Date: Mon, 15 Mar 2021 14:56:18 +0800
4Subject: [PATCH] The output in moddep.lst generated from syminfo.lst using
5 genmoddep.awk is not deterministic since the order of the dependencies on
6 each line can vary depending on how awk sorts the values in the array.
7
8Be deterministic in the output by sorting the dependencies on each line.
9
10Also, the output of the SOURCES lines in grub-core/Makefile.core.am, generated
11from grub-core/Makefile.core.def with gentpl.py is not deterministic due to
12missing sorting of the list used to generate it. Add such a sort.
13
14Also ensure the generated unidata.c file is deterministic by sorting the
15keys of the dict.
16
17Upstream-Status: Pending
18Richard Purdie <richard.purdie@linuxfoundation.org>
19Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
20---
21 gentpl.py | 1 +
22 grub-core/genmoddep.awk | 4 +++-
23 util/import_unicode.py | 2 +-
24 3 files changed, 5 insertions(+), 2 deletions(-)
25
26diff --git a/gentpl.py b/gentpl.py
27index c86550d4f..589285192 100644
28--- a/gentpl.py
29+++ b/gentpl.py
30@@ -568,6 +568,7 @@ def foreach_platform_value(defn, platform, suffix, closure):
31 for group in RMAP[platform]:
32 for value in defn.find_all(group + suffix):
33 r.append(closure(value))
34+ r.sort()
35 return ''.join(r)
36
37 def platform_conditional(platform, closure):
38diff --git a/grub-core/genmoddep.awk b/grub-core/genmoddep.awk
39index 04c2863e5..247436392 100644
40--- a/grub-core/genmoddep.awk
41+++ b/grub-core/genmoddep.awk
42@@ -59,7 +59,9 @@ END {
43 }
44 modlist = ""
45 depcount[mod] = 0
46- for (depmod in uniqmods) {
47+ n = asorti(uniqmods, w)
48+ for (i = 1; i <= n; i++) {
49+ depmod = w[i]
50 modlist = modlist " " depmod;
51 inverse_dependencies[depmod] = inverse_dependencies[depmod] " " mod
52 depcount[mod]++
53diff --git a/util/import_unicode.py b/util/import_unicode.py
54index 08f80591e..1f434a069 100644
55--- a/util/import_unicode.py
56+++ b/util/import_unicode.py
57@@ -174,7 +174,7 @@ infile.close ()
58
59 outfile.write ("struct grub_unicode_arabic_shape grub_unicode_arabic_shapes[] = {\n ")
60
61-for x in arabicsubst:
62+for x in sorted(arabicsubst):
63 try:
64 if arabicsubst[x]['join'] == "DUAL":
65 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]))
66--
672.17.1
68
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..7c8770ce8b 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 @@
1From 917133acc701dbc4636165d3b08d15dc5829a06f Mon Sep 17 00:00:00 2001 1From b316ed326bd492106006d78f5bfcd767b49a4f2e Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com> 2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Wed, 17 Aug 2016 04:06:34 -0400 3Date: Wed, 17 Aug 2016 04:06:34 -0400
4Subject: [PATCH] grub module explicitly keeps symbole .module_license 4Subject: [PATCH] grub module explicitly keeps symbole .module_license
@@ -8,7 +8,7 @@ it stripped symbol table:
8 8
9--------------- 9---------------
10root@localhost:~# objdump -t all_video.mod 10root@localhost:~# objdump -t all_video.mod
11 11
12all_video.mod: file format elf64-x86-64 12all_video.mod: file format elf64-x86-64
13 13
14SYMBOL TABLE: 14SYMBOL TABLE:
@@ -37,15 +37,16 @@ SYMBOL TABLE:
370000000000000000 l d .modname 0000000000000000 .modname 370000000000000000 l d .modname 0000000000000000 .modname
38-------------- 38--------------
39 39
40Upstream-Status: Pending 40Upstream-Status: Inappropriate [workaround that needs investigation into @TARGET_STRIP@ behaviour in oe-core vs toolchain used by upstream]
41 41
42Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> 42Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
43
43--- 44---
44 grub-core/genmod.sh.in | 2 +- 45 grub-core/genmod.sh.in | 2 +-
45 1 file changed, 1 insertion(+), 1 deletion(-) 46 1 file changed, 1 insertion(+), 1 deletion(-)
46 47
47diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in 48diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in
48index 1250589..dd14308 100644 49index e57c4d9..42bb1ba 100644
49--- a/grub-core/genmod.sh.in 50--- a/grub-core/genmod.sh.in
50+++ b/grub-core/genmod.sh.in 51+++ b/grub-core/genmod.sh.in
51@@ -56,7 +56,7 @@ if test x@TARGET_APPLE_LINKER@ != x1; then 52@@ -56,7 +56,7 @@ if test x@TARGET_APPLE_LINKER@ != x1; then
diff --git a/meta/recipes-bsp/grub/files/video-Remove-trailing-whitespaces.patch b/meta/recipes-bsp/grub/files/video-Remove-trailing-whitespaces.patch
deleted file mode 100644
index 2db9bcbbc5..0000000000
--- a/meta/recipes-bsp/grub/files/video-Remove-trailing-whitespaces.patch
+++ /dev/null
@@ -1,693 +0,0 @@
1From 1f48917d8ddb490dcdc70176e0f58136b7f7811a Mon Sep 17 00:00:00 2001
2From: Elyes Haouas <ehaouas@noos.fr>
3Date: Fri, 4 Mar 2022 07:42:13 +0100
4Subject: [PATCH] video: Remove trailing whitespaces
5
6Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
7Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
8
9Upstream-Status: Backport
10
11Reference to upstream patch:
12https://git.savannah.gnu.org/cgit/grub.git/commit/?id=1f48917d8ddb490dcdc70176e0f58136b7f7811a
13
14Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
15---
16 grub-core/video/bochs.c | 2 +-
17 grub-core/video/capture.c | 2 +-
18 grub-core/video/cirrus.c | 4 ++--
19 grub-core/video/coreboot/cbfb.c | 2 +-
20 grub-core/video/efi_gop.c | 22 +++++++++----------
21 grub-core/video/fb/fbblit.c | 8 +++----
22 grub-core/video/fb/video_fb.c | 10 ++++-----
23 grub-core/video/i386/pc/vbe.c | 34 ++++++++++++++---------------
24 grub-core/video/i386/pc/vga.c | 6 ++---
25 grub-core/video/ieee1275.c | 4 ++--
26 grub-core/video/radeon_fuloong2e.c | 6 ++---
27 grub-core/video/radeon_yeeloong3a.c | 6 ++---
28 grub-core/video/readers/png.c | 2 +-
29 grub-core/video/readers/tga.c | 2 +-
30 grub-core/video/sis315_init.c | 2 +-
31 grub-core/video/sis315pro.c | 8 +++----
32 grub-core/video/sm712.c | 10 ++++-----
33 grub-core/video/video.c | 8 +++----
34 18 files changed, 69 insertions(+), 69 deletions(-)
35
36diff --git a/grub-core/video/bochs.c b/grub-core/video/bochs.c
37index 30ea1bd82..edc651697 100644
38--- a/grub-core/video/bochs.c
39+++ b/grub-core/video/bochs.c
40@@ -212,7 +212,7 @@ find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data)
41
42 if (((class >> 16) & 0xffff) != 0x0300 || pciid != 0x11111234)
43 return 0;
44-
45+
46 addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0);
47 framebuffer.base = grub_pci_read (addr) & GRUB_PCI_ADDR_MEM_MASK;
48 if (!framebuffer.base)
49diff --git a/grub-core/video/capture.c b/grub-core/video/capture.c
50index 4d3195e01..c653d89f9 100644
51--- a/grub-core/video/capture.c
52+++ b/grub-core/video/capture.c
53@@ -92,7 +92,7 @@ grub_video_capture_start (const struct grub_video_mode_info *mode_info,
54 framebuffer.ptr = grub_calloc (framebuffer.mode_info.height, framebuffer.mode_info.pitch);
55 if (!framebuffer.ptr)
56 return grub_errno;
57-
58+
59 err = grub_video_fb_create_render_target_from_pointer (&framebuffer.render_target,
60 &framebuffer.mode_info,
61 framebuffer.ptr);
62diff --git a/grub-core/video/cirrus.c b/grub-core/video/cirrus.c
63index e2149e8ce..f5542ccdc 100644
64--- a/grub-core/video/cirrus.c
65+++ b/grub-core/video/cirrus.c
66@@ -354,11 +354,11 @@ grub_video_cirrus_setup (unsigned int width, unsigned int height,
67 grub_uint8_t sr_ext = 0, hidden_dac = 0;
68
69 grub_vga_set_geometry (&config, grub_vga_cr_write);
70-
71+
72 grub_vga_gr_write (GRUB_VGA_GR_MODE_256_COLOR | GRUB_VGA_GR_MODE_READ_MODE1,
73 GRUB_VGA_GR_MODE);
74 grub_vga_gr_write (GRUB_VGA_GR_GR6_GRAPHICS_MODE, GRUB_VGA_GR_GR6);
75-
76+
77 grub_vga_sr_write (GRUB_VGA_SR_MEMORY_MODE_NORMAL, GRUB_VGA_SR_MEMORY_MODE);
78
79 grub_vga_cr_write ((config.pitch >> CIRRUS_CR_EXTENDED_DISPLAY_PITCH_SHIFT)
80diff --git a/grub-core/video/coreboot/cbfb.c b/grub-core/video/coreboot/cbfb.c
81index 9af81fa5b..986003c51 100644
82--- a/grub-core/video/coreboot/cbfb.c
83+++ b/grub-core/video/coreboot/cbfb.c
84@@ -106,7 +106,7 @@ grub_video_cbfb_setup (unsigned int width, unsigned int height,
85
86 grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS,
87 grub_video_fbstd_colors);
88-
89+
90 return err;
91 }
92
93diff --git a/grub-core/video/efi_gop.c b/grub-core/video/efi_gop.c
94index b7590dc6c..7a5054631 100644
95--- a/grub-core/video/efi_gop.c
96+++ b/grub-core/video/efi_gop.c
97@@ -273,7 +273,7 @@ grub_video_gop_iterate (int (*hook) (const struct grub_video_mode_info *info, vo
98 grub_efi_status_t status;
99 struct grub_efi_gop_mode_info *info = NULL;
100 struct grub_video_mode_info mode_info;
101-
102+
103 status = efi_call_4 (gop->query_mode, gop, mode, &size, &info);
104
105 if (status)
106@@ -390,7 +390,7 @@ grub_video_gop_setup (unsigned int width, unsigned int height,
107 found = 1;
108 }
109 }
110-
111+
112 if (!found)
113 {
114 unsigned mode;
115@@ -399,7 +399,7 @@ grub_video_gop_setup (unsigned int width, unsigned int height,
116 {
117 grub_efi_uintn_t size;
118 grub_efi_status_t status;
119-
120+
121 status = efi_call_4 (gop->query_mode, gop, mode, &size, &info);
122 if (status)
123 {
124@@ -472,11 +472,11 @@ grub_video_gop_setup (unsigned int width, unsigned int height,
125 framebuffer.ptr = (void *) (grub_addr_t) gop->mode->fb_base;
126 framebuffer.offscreen
127 = grub_malloc (framebuffer.mode_info.height
128- * framebuffer.mode_info.width
129+ * framebuffer.mode_info.width
130 * sizeof (struct grub_efi_gop_blt_pixel));
131
132 buffer = framebuffer.offscreen;
133-
134+
135 if (!buffer)
136 {
137 grub_dprintf ("video", "GOP: couldn't allocate shadow\n");
138@@ -485,11 +485,11 @@ grub_video_gop_setup (unsigned int width, unsigned int height,
139 &framebuffer.mode_info);
140 buffer = framebuffer.ptr;
141 }
142-
143+
144 grub_dprintf ("video", "GOP: initialising FB @ %p %dx%dx%d\n",
145 framebuffer.ptr, framebuffer.mode_info.width,
146 framebuffer.mode_info.height, framebuffer.mode_info.bpp);
147-
148+
149 err = grub_video_fb_create_render_target_from_pointer
150 (&framebuffer.render_target, &framebuffer.mode_info, buffer);
151
152@@ -498,15 +498,15 @@ grub_video_gop_setup (unsigned int width, unsigned int height,
153 grub_dprintf ("video", "GOP: Couldn't create FB target\n");
154 return err;
155 }
156-
157+
158 err = grub_video_fb_set_active_render_target (framebuffer.render_target);
159-
160+
161 if (err)
162 {
163 grub_dprintf ("video", "GOP: Couldn't set FB target\n");
164 return err;
165 }
166-
167+
168 err = grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS,
169 grub_video_fbstd_colors);
170
171@@ -514,7 +514,7 @@ grub_video_gop_setup (unsigned int width, unsigned int height,
172 grub_dprintf ("video", "GOP: Couldn't set palette\n");
173 else
174 grub_dprintf ("video", "GOP: Success\n");
175-
176+
177 return err;
178 }
179
180diff --git a/grub-core/video/fb/fbblit.c b/grub-core/video/fb/fbblit.c
181index d55924837..1010ef393 100644
182--- a/grub-core/video/fb/fbblit.c
183+++ b/grub-core/video/fb/fbblit.c
184@@ -466,7 +466,7 @@ grub_video_fbblit_replace_24bit_indexa (struct grub_video_fbblit_info *dst,
185 for (i = 0; i < width; i++)
186 {
187 register grub_uint32_t col;
188- if (*srcptr == 0xf0)
189+ if (*srcptr == 0xf0)
190 col = palette[16];
191 else
192 col = palette[*srcptr & 0xf];
193@@ -478,7 +478,7 @@ grub_video_fbblit_replace_24bit_indexa (struct grub_video_fbblit_info *dst,
194 *dstptr++ = col >> 0;
195 *dstptr++ = col >> 8;
196 *dstptr++ = col >> 16;
197-#endif
198+#endif
199 srcptr++;
200 }
201
202@@ -651,7 +651,7 @@ grub_video_fbblit_blend_24bit_indexa (struct grub_video_fbblit_info *dst,
203 for (i = 0; i < width; i++)
204 {
205 register grub_uint32_t col;
206- if (*srcptr != 0xf0)
207+ if (*srcptr != 0xf0)
208 {
209 col = palette[*srcptr & 0xf];
210 #ifdef GRUB_CPU_WORDS_BIGENDIAN
211@@ -662,7 +662,7 @@ grub_video_fbblit_blend_24bit_indexa (struct grub_video_fbblit_info *dst,
212 *dstptr++ = col >> 0;
213 *dstptr++ = col >> 8;
214 *dstptr++ = col >> 16;
215-#endif
216+#endif
217 }
218 else
219 dstptr += 3;
220diff --git a/grub-core/video/fb/video_fb.c b/grub-core/video/fb/video_fb.c
221index ae6b89f9a..fa4ebde26 100644
222--- a/grub-core/video/fb/video_fb.c
223+++ b/grub-core/video/fb/video_fb.c
224@@ -754,7 +754,7 @@ grub_video_fb_unmap_color_int (struct grub_video_fbblit_info * source,
225 *alpha = 0;
226 return;
227 }
228-
229+
230 /* If we have an out-of-bounds color, return transparent black. */
231 if (color > 255)
232 {
233@@ -1141,7 +1141,7 @@ grub_video_fb_scroll (grub_video_color_t color, int dx, int dy)
234 /* If everything is aligned on 32-bit use 32-bit copy. */
235 if ((grub_addr_t) grub_video_fb_get_video_ptr (&target, src_x, src_y)
236 % sizeof (grub_uint32_t) == 0
237- && (grub_addr_t) grub_video_fb_get_video_ptr (&target, dst_x, dst_y)
238+ && (grub_addr_t) grub_video_fb_get_video_ptr (&target, dst_x, dst_y)
239 % sizeof (grub_uint32_t) == 0
240 && linelen % sizeof (grub_uint32_t) == 0
241 && linedelta % sizeof (grub_uint32_t) == 0)
242@@ -1155,7 +1155,7 @@ grub_video_fb_scroll (grub_video_color_t color, int dx, int dy)
243 else if ((grub_addr_t) grub_video_fb_get_video_ptr (&target, src_x, src_y)
244 % sizeof (grub_uint16_t) == 0
245 && (grub_addr_t) grub_video_fb_get_video_ptr (&target,
246- dst_x, dst_y)
247+ dst_x, dst_y)
248 % sizeof (grub_uint16_t) == 0
249 && linelen % sizeof (grub_uint16_t) == 0
250 && linedelta % sizeof (grub_uint16_t) == 0)
251@@ -1170,7 +1170,7 @@ grub_video_fb_scroll (grub_video_color_t color, int dx, int dy)
252 {
253 grub_uint8_t *src, *dst;
254 DO_SCROLL
255- }
256+ }
257 }
258
259 /* 4. Fill empty space with specified color. In this implementation
260@@ -1615,7 +1615,7 @@ grub_video_fb_setup (unsigned int mode_type, unsigned int mode_mask,
261 framebuffer.render_target = framebuffer.back_target;
262 return GRUB_ERR_NONE;
263 }
264-
265+
266 mode_info->mode_type &= ~(GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED
267 | GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP);
268
269diff --git a/grub-core/video/i386/pc/vbe.c b/grub-core/video/i386/pc/vbe.c
270index b7f911926..0e65b5206 100644
271--- a/grub-core/video/i386/pc/vbe.c
272+++ b/grub-core/video/i386/pc/vbe.c
273@@ -219,7 +219,7 @@ grub_vbe_disable_mtrr (int mtrr)
274 }
275
276 /* Call VESA BIOS 0x4f09 to set palette data, return status. */
277-static grub_vbe_status_t
278+static grub_vbe_status_t
279 grub_vbe_bios_set_palette_data (grub_uint32_t color_count,
280 grub_uint32_t start_index,
281 struct grub_vbe_palette_data *palette_data)
282@@ -237,7 +237,7 @@ grub_vbe_bios_set_palette_data (grub_uint32_t color_count,
283 }
284
285 /* Call VESA BIOS 0x4f00 to get VBE Controller Information, return status. */
286-grub_vbe_status_t
287+grub_vbe_status_t
288 grub_vbe_bios_get_controller_info (struct grub_vbe_info_block *ci)
289 {
290 struct grub_bios_int_registers regs;
291@@ -251,7 +251,7 @@ grub_vbe_bios_get_controller_info (struct grub_vbe_info_block *ci)
292 }
293
294 /* Call VESA BIOS 0x4f01 to get VBE Mode Information, return status. */
295-grub_vbe_status_t
296+grub_vbe_status_t
297 grub_vbe_bios_get_mode_info (grub_uint32_t mode,
298 struct grub_vbe_mode_info_block *mode_info)
299 {
300@@ -285,7 +285,7 @@ grub_vbe_bios_set_mode (grub_uint32_t mode,
301 }
302
303 /* Call VESA BIOS 0x4f03 to return current VBE Mode, return status. */
304-grub_vbe_status_t
305+grub_vbe_status_t
306 grub_vbe_bios_get_mode (grub_uint32_t *mode)
307 {
308 struct grub_bios_int_registers regs;
309@@ -298,7 +298,7 @@ grub_vbe_bios_get_mode (grub_uint32_t *mode)
310 return regs.eax & 0xffff;
311 }
312
313-grub_vbe_status_t
314+grub_vbe_status_t
315 grub_vbe_bios_getset_dac_palette_width (int set, int *dac_mask_size)
316 {
317 struct grub_bios_int_registers regs;
318@@ -346,7 +346,7 @@ grub_vbe_bios_get_memory_window (grub_uint32_t window,
319 }
320
321 /* Call VESA BIOS 0x4f06 to set scanline length (in bytes), return status. */
322-grub_vbe_status_t
323+grub_vbe_status_t
324 grub_vbe_bios_set_scanline_length (grub_uint32_t length)
325 {
326 struct grub_bios_int_registers regs;
327@@ -354,14 +354,14 @@ grub_vbe_bios_set_scanline_length (grub_uint32_t length)
328 regs.ecx = length;
329 regs.eax = 0x4f06;
330 /* BL = 2, Set Scan Line in Bytes. */
331- regs.ebx = 0x0002;
332+ regs.ebx = 0x0002;
333 regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
334 grub_bios_interrupt (0x10, &regs);
335 return regs.eax & 0xffff;
336 }
337
338 /* Call VESA BIOS 0x4f06 to return scanline length (in bytes), return status. */
339-grub_vbe_status_t
340+grub_vbe_status_t
341 grub_vbe_bios_get_scanline_length (grub_uint32_t *length)
342 {
343 struct grub_bios_int_registers regs;
344@@ -377,7 +377,7 @@ grub_vbe_bios_get_scanline_length (grub_uint32_t *length)
345 }
346
347 /* Call VESA BIOS 0x4f07 to set display start, return status. */
348-static grub_vbe_status_t
349+static grub_vbe_status_t
350 grub_vbe_bios_set_display_start (grub_uint32_t x, grub_uint32_t y)
351 {
352 struct grub_bios_int_registers regs;
353@@ -390,7 +390,7 @@ grub_vbe_bios_set_display_start (grub_uint32_t x, grub_uint32_t y)
354 regs.edx = y;
355 regs.eax = 0x4f07;
356 /* BL = 80h, Set Display Start during Vertical Retrace. */
357- regs.ebx = 0x0080;
358+ regs.ebx = 0x0080;
359 regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
360 grub_bios_interrupt (0x10, &regs);
361
362@@ -401,7 +401,7 @@ grub_vbe_bios_set_display_start (grub_uint32_t x, grub_uint32_t y)
363 }
364
365 /* Call VESA BIOS 0x4f07 to get display start, return status. */
366-grub_vbe_status_t
367+grub_vbe_status_t
368 grub_vbe_bios_get_display_start (grub_uint32_t *x,
369 grub_uint32_t *y)
370 {
371@@ -419,7 +419,7 @@ grub_vbe_bios_get_display_start (grub_uint32_t *x,
372 }
373
374 /* Call VESA BIOS 0x4f0a. */
375-grub_vbe_status_t
376+grub_vbe_status_t
377 grub_vbe_bios_get_pm_interface (grub_uint16_t *segment, grub_uint16_t *offset,
378 grub_uint16_t *length)
379 {
380@@ -896,7 +896,7 @@ vbe2videoinfo (grub_uint32_t mode,
381 case GRUB_VBE_MEMORY_MODEL_YUV:
382 mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_YUV;
383 break;
384-
385+
386 case GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR:
387 mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_RGB;
388 break;
389@@ -923,10 +923,10 @@ vbe2videoinfo (grub_uint32_t mode,
390 break;
391 case 8:
392 mode_info->bytes_per_pixel = 1;
393- break;
394+ break;
395 case 4:
396 mode_info->bytes_per_pixel = 0;
397- break;
398+ break;
399 }
400
401 if (controller_info.version >= 0x300)
402@@ -976,7 +976,7 @@ grub_video_vbe_iterate (int (*hook) (const struct grub_video_mode_info *info, vo
403
404 static grub_err_t
405 grub_video_vbe_setup (unsigned int width, unsigned int height,
406- grub_video_mode_type_t mode_type,
407+ grub_video_mode_type_t mode_type,
408 grub_video_mode_type_t mode_mask)
409 {
410 grub_uint16_t *p;
411@@ -1193,7 +1193,7 @@ grub_video_vbe_print_adapter_specific_info (void)
412 controller_info.version & 0xFF,
413 controller_info.oem_software_rev >> 8,
414 controller_info.oem_software_rev & 0xFF);
415-
416+
417 /* The total_memory field is in 64 KiB units. */
418 grub_printf_ (N_(" total memory: %d KiB\n"),
419 (controller_info.total_memory << 6));
420diff --git a/grub-core/video/i386/pc/vga.c b/grub-core/video/i386/pc/vga.c
421index b2f776c99..50d0b5e02 100644
422--- a/grub-core/video/i386/pc/vga.c
423+++ b/grub-core/video/i386/pc/vga.c
424@@ -48,7 +48,7 @@ static struct
425 int back_page;
426 } framebuffer;
427
428-static unsigned char
429+static unsigned char
430 grub_vga_set_mode (unsigned char mode)
431 {
432 struct grub_bios_int_registers regs;
433@@ -182,10 +182,10 @@ grub_video_vga_setup (unsigned int width, unsigned int height,
434
435 is_target = 1;
436 err = grub_video_fb_set_active_render_target (framebuffer.render_target);
437-
438+
439 if (err)
440 return err;
441-
442+
443 err = grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS,
444 grub_video_fbstd_colors);
445
446diff --git a/grub-core/video/ieee1275.c b/grub-core/video/ieee1275.c
447index f437fb0df..ca3d3c3b2 100644
448--- a/grub-core/video/ieee1275.c
449+++ b/grub-core/video/ieee1275.c
450@@ -233,7 +233,7 @@ grub_video_ieee1275_setup (unsigned int width, unsigned int height,
451 /* TODO. */
452 return grub_error (GRUB_ERR_IO, "can't set mode %dx%d", width, height);
453 }
454-
455+
456 err = grub_video_ieee1275_fill_mode_info (dev, &framebuffer.mode_info);
457 if (err)
458 {
459@@ -260,7 +260,7 @@ grub_video_ieee1275_setup (unsigned int width, unsigned int height,
460
461 grub_video_ieee1275_set_palette (0, framebuffer.mode_info.number_of_colors,
462 grub_video_fbstd_colors);
463-
464+
465 return err;
466 }
467
468diff --git a/grub-core/video/radeon_fuloong2e.c b/grub-core/video/radeon_fuloong2e.c
469index b4da34b5e..40917acb7 100644
470--- a/grub-core/video/radeon_fuloong2e.c
471+++ b/grub-core/video/radeon_fuloong2e.c
472@@ -75,7 +75,7 @@ find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data)
473 if (((class >> 16) & 0xffff) != GRUB_PCI_CLASS_SUBCLASS_VGA
474 || pciid != 0x515a1002)
475 return 0;
476-
477+
478 *found = 1;
479
480 addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0);
481@@ -139,7 +139,7 @@ grub_video_radeon_fuloong2e_setup (unsigned int width, unsigned int height,
482 framebuffer.mapped = 1;
483
484 /* Prevent garbage from appearing on the screen. */
485- grub_memset (framebuffer.ptr, 0x55,
486+ grub_memset (framebuffer.ptr, 0x55,
487 framebuffer.mode_info.height * framebuffer.mode_info.pitch);
488
489 #ifndef TEST
490@@ -152,7 +152,7 @@ grub_video_radeon_fuloong2e_setup (unsigned int width, unsigned int height,
491 return err;
492
493 err = grub_video_fb_set_active_render_target (framebuffer.render_target);
494-
495+
496 if (err)
497 return err;
498
499diff --git a/grub-core/video/radeon_yeeloong3a.c b/grub-core/video/radeon_yeeloong3a.c
500index 52614feb6..48631c181 100644
501--- a/grub-core/video/radeon_yeeloong3a.c
502+++ b/grub-core/video/radeon_yeeloong3a.c
503@@ -74,7 +74,7 @@ find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data)
504 if (((class >> 16) & 0xffff) != GRUB_PCI_CLASS_SUBCLASS_VGA
505 || pciid != 0x96151002)
506 return 0;
507-
508+
509 *found = 1;
510
511 addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0);
512@@ -137,7 +137,7 @@ grub_video_radeon_yeeloong3a_setup (unsigned int width, unsigned int height,
513 #endif
514
515 /* Prevent garbage from appearing on the screen. */
516- grub_memset (framebuffer.ptr, 0,
517+ grub_memset (framebuffer.ptr, 0,
518 framebuffer.mode_info.height * framebuffer.mode_info.pitch);
519
520 #ifndef TEST
521@@ -150,7 +150,7 @@ grub_video_radeon_yeeloong3a_setup (unsigned int width, unsigned int height,
522 return err;
523
524 err = grub_video_fb_set_active_render_target (framebuffer.render_target);
525-
526+
527 if (err)
528 return err;
529
530diff --git a/grub-core/video/readers/png.c b/grub-core/video/readers/png.c
531index 0157ff742..54dfedf43 100644
532--- a/grub-core/video/readers/png.c
533+++ b/grub-core/video/readers/png.c
534@@ -916,7 +916,7 @@ grub_png_convert_image (struct grub_png_data *data)
535 }
536 return;
537 }
538-
539+
540 if (data->is_gray)
541 {
542 switch (data->bpp)
543diff --git a/grub-core/video/readers/tga.c b/grub-core/video/readers/tga.c
544index 7cb9d1d2a..a9ec3a1b6 100644
545--- a/grub-core/video/readers/tga.c
546+++ b/grub-core/video/readers/tga.c
547@@ -127,7 +127,7 @@ tga_load_palette (struct tga_data *data)
548
549 if (len > sizeof (data->palette))
550 len = sizeof (data->palette);
551-
552+
553 if (grub_file_read (data->file, &data->palette, len)
554 != (grub_ssize_t) len)
555 return grub_errno;
556diff --git a/grub-core/video/sis315_init.c b/grub-core/video/sis315_init.c
557index ae5c1419c..09c3c7bbe 100644
558--- a/grub-core/video/sis315_init.c
559+++ b/grub-core/video/sis315_init.c
560@@ -1,4 +1,4 @@
561-static const struct { grub_uint8_t reg; grub_uint8_t val; } sr_dump [] =
562+static const struct { grub_uint8_t reg; grub_uint8_t val; } sr_dump [] =
563 {
564 { 0x28, 0x81 },
565 { 0x2a, 0x00 },
566diff --git a/grub-core/video/sis315pro.c b/grub-core/video/sis315pro.c
567index 22a0c85a6..4d2f9999a 100644
568--- a/grub-core/video/sis315pro.c
569+++ b/grub-core/video/sis315pro.c
570@@ -103,7 +103,7 @@ find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data)
571 if (((class >> 16) & 0xffff) != GRUB_PCI_CLASS_SUBCLASS_VGA
572 || pciid != GRUB_SIS315PRO_PCIID)
573 return 0;
574-
575+
576 *found = 1;
577
578 addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0);
579@@ -218,7 +218,7 @@ grub_video_sis315pro_setup (unsigned int width, unsigned int height,
580
581 #ifndef TEST
582 /* Prevent garbage from appearing on the screen. */
583- grub_memset (framebuffer.ptr, 0,
584+ grub_memset (framebuffer.ptr, 0,
585 framebuffer.mode_info.height * framebuffer.mode_info.pitch);
586 grub_arch_sync_dma_caches (framebuffer.ptr,
587 framebuffer.mode_info.height
588@@ -231,7 +231,7 @@ grub_video_sis315pro_setup (unsigned int width, unsigned int height,
589 | GRUB_VGA_IO_MISC_EXTERNAL_CLOCK_0
590 | GRUB_VGA_IO_MISC_28MHZ
591 | GRUB_VGA_IO_MISC_ENABLE_VRAM_ACCESS
592- | GRUB_VGA_IO_MISC_COLOR,
593+ | GRUB_VGA_IO_MISC_COLOR,
594 GRUB_VGA_IO_MISC_WRITE + GRUB_MACHINE_PCI_IO_BASE);
595
596 grub_vga_sr_write (0x86, 5);
597@@ -335,7 +335,7 @@ grub_video_sis315pro_setup (unsigned int width, unsigned int height,
598 {
599 if (read_sis_cmd (0x5) != 0xa1)
600 write_sis_cmd (0x86, 0x5);
601-
602+
603 write_sis_cmd (read_sis_cmd (0x20) | 0xa1, 0x20);
604 write_sis_cmd (read_sis_cmd (0x1e) | 0xda, 0x1e);
605
606diff --git a/grub-core/video/sm712.c b/grub-core/video/sm712.c
607index 10c46eb65..65f59f84b 100644
608--- a/grub-core/video/sm712.c
609+++ b/grub-core/video/sm712.c
610@@ -167,7 +167,7 @@ enum
611 GRUB_SM712_CR_SHADOW_VGA_VBLANK_START = 0x46,
612 GRUB_SM712_CR_SHADOW_VGA_VBLANK_END = 0x47,
613 GRUB_SM712_CR_SHADOW_VGA_VRETRACE_START = 0x48,
614- GRUB_SM712_CR_SHADOW_VGA_VRETRACE_END = 0x49,
615+ GRUB_SM712_CR_SHADOW_VGA_VRETRACE_END = 0x49,
616 GRUB_SM712_CR_SHADOW_VGA_OVERFLOW = 0x4a,
617 GRUB_SM712_CR_SHADOW_VGA_CELL_HEIGHT = 0x4b,
618 GRUB_SM712_CR_SHADOW_VGA_HDISPLAY_END = 0x4c,
619@@ -375,7 +375,7 @@ find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data)
620 if (((class >> 16) & 0xffff) != GRUB_PCI_CLASS_SUBCLASS_VGA
621 || pciid != GRUB_SM712_PCIID)
622 return 0;
623-
624+
625 *found = 1;
626
627 addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0);
628@@ -471,7 +471,7 @@ grub_video_sm712_setup (unsigned int width, unsigned int height,
629
630 #if !defined (TEST) && !defined(GENINIT)
631 /* Prevent garbage from appearing on the screen. */
632- grub_memset ((void *) framebuffer.cached_ptr, 0,
633+ grub_memset ((void *) framebuffer.cached_ptr, 0,
634 framebuffer.mode_info.height * framebuffer.mode_info.pitch);
635 #endif
636
637@@ -482,7 +482,7 @@ grub_video_sm712_setup (unsigned int width, unsigned int height,
638 grub_sm712_sr_write (0x2, 0x6b);
639 grub_sm712_write_reg (0, GRUB_VGA_IO_PIXEL_MASK);
640 grub_sm712_sr_write (GRUB_VGA_SR_RESET_ASYNC, GRUB_VGA_SR_RESET);
641- grub_sm712_write_reg (GRUB_VGA_IO_MISC_NEGATIVE_VERT_POLARITY
642+ grub_sm712_write_reg (GRUB_VGA_IO_MISC_NEGATIVE_VERT_POLARITY
643 | GRUB_VGA_IO_MISC_NEGATIVE_HORIZ_POLARITY
644 | GRUB_VGA_IO_MISC_UPPER_64K
645 | GRUB_VGA_IO_MISC_EXTERNAL_CLOCK_0
646@@ -694,7 +694,7 @@ grub_video_sm712_setup (unsigned int width, unsigned int height,
647 for (i = 0; i < ARRAY_SIZE (dda_lookups); i++)
648 grub_sm712_write_dda_lookup (i, dda_lookups[i].compare, dda_lookups[i].dda,
649 dda_lookups[i].vcentering);
650-
651+
652 /* Undocumented */
653 grub_sm712_cr_write (0, 0x9c);
654 grub_sm712_cr_write (0, 0x9d);
655diff --git a/grub-core/video/video.c b/grub-core/video/video.c
656index 983424107..8937da745 100644
657--- a/grub-core/video/video.c
658+++ b/grub-core/video/video.c
659@@ -491,13 +491,13 @@ parse_modespec (const char *current_mode, int *width, int *height, int *depth)
660 current_mode);
661
662 param++;
663-
664+
665 *width = grub_strtoul (value, 0, 0);
666 if (grub_errno != GRUB_ERR_NONE)
667 return grub_error (GRUB_ERR_BAD_ARGUMENT,
668 N_("invalid video mode specification `%s'"),
669 current_mode);
670-
671+
672 /* Find height value. */
673 value = param;
674 param = grub_strchr(param, 'x');
675@@ -513,13 +513,13 @@ parse_modespec (const char *current_mode, int *width, int *height, int *depth)
676 {
677 /* We have optional color depth value. */
678 param++;
679-
680+
681 *height = grub_strtoul (value, 0, 0);
682 if (grub_errno != GRUB_ERR_NONE)
683 return grub_error (GRUB_ERR_BAD_ARGUMENT,
684 N_("invalid video mode specification `%s'"),
685 current_mode);
686-
687+
688 /* Convert color depth value. */
689 value = param;
690 *depth = grub_strtoul (value, 0, 0);
691--
6922.34.1
693
diff --git a/meta/recipes-bsp/grub/files/video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch b/meta/recipes-bsp/grub/files/video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch
deleted file mode 100644
index 0c7deae858..0000000000
--- a/meta/recipes-bsp/grub/files/video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch
+++ /dev/null
@@ -1,264 +0,0 @@
1From d5caac8ab79d068ad9a41030c772d03a4d4fbd7b Mon Sep 17 00:00:00 2001
2From: Daniel Axtens <dja@axtens.net>
3Date: Mon, 28 Jun 2021 14:16:14 +1000
4Subject: [PATCH] video/readers/jpeg: Abort sooner if a read operation fails
5
6Fuzzing revealed some inputs that were taking a long time, potentially
7forever, because they did not bail quickly upon encountering an I/O error.
8
9Try to catch I/O errors sooner and bail out.
10
11Signed-off-by: Daniel Axtens <dja@axtens.net>
12Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
13
14Upstream-Status: Backport
15
16Reference to upstream patch:
17https://git.savannah.gnu.org/cgit/grub.git/commit/?id=d5caac8ab79d068ad9a41030c772d03a4d4fbd7b
18
19Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
20---
21 grub-core/video/readers/jpeg.c | 86 +++++++++++++++++++++++++++-------
22 1 file changed, 70 insertions(+), 16 deletions(-)
23
24diff --git a/grub-core/video/readers/jpeg.c b/grub-core/video/readers/jpeg.c
25index c47ffd651..806c56c78 100644
26--- a/grub-core/video/readers/jpeg.c
27+++ b/grub-core/video/readers/jpeg.c
28@@ -109,9 +109,17 @@ static grub_uint8_t
29 grub_jpeg_get_byte (struct grub_jpeg_data *data)
30 {
31 grub_uint8_t r;
32+ grub_ssize_t bytes_read;
33
34 r = 0;
35- grub_file_read (data->file, &r, 1);
36+ bytes_read = grub_file_read (data->file, &r, 1);
37+
38+ if (bytes_read != 1)
39+ {
40+ grub_error (GRUB_ERR_BAD_FILE_TYPE,
41+ "jpeg: unexpected end of data");
42+ return 0;
43+ }
44
45 return r;
46 }
47@@ -120,9 +128,17 @@ static grub_uint16_t
48 grub_jpeg_get_word (struct grub_jpeg_data *data)
49 {
50 grub_uint16_t r;
51+ grub_ssize_t bytes_read;
52
53 r = 0;
54- grub_file_read (data->file, &r, sizeof (grub_uint16_t));
55+ bytes_read = grub_file_read (data->file, &r, sizeof (grub_uint16_t));
56+
57+ if (bytes_read != sizeof (grub_uint16_t))
58+ {
59+ grub_error (GRUB_ERR_BAD_FILE_TYPE,
60+ "jpeg: unexpected end of data");
61+ return 0;
62+ }
63
64 return grub_be_to_cpu16 (r);
65 }
66@@ -135,6 +151,11 @@ grub_jpeg_get_bit (struct grub_jpeg_data *data)
67 if (data->bit_mask == 0)
68 {
69 data->bit_save = grub_jpeg_get_byte (data);
70+ if (grub_errno != GRUB_ERR_NONE) {
71+ grub_error (GRUB_ERR_BAD_FILE_TYPE,
72+ "jpeg: file read error");
73+ return 0;
74+ }
75 if (data->bit_save == JPEG_ESC_CHAR)
76 {
77 if (grub_jpeg_get_byte (data) != 0)
78@@ -143,6 +164,11 @@ grub_jpeg_get_bit (struct grub_jpeg_data *data)
79 "jpeg: invalid 0xFF in data stream");
80 return 0;
81 }
82+ if (grub_errno != GRUB_ERR_NONE)
83+ {
84+ grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: file read error");
85+ return 0;
86+ }
87 }
88 data->bit_mask = 0x80;
89 }
90@@ -161,7 +187,7 @@ grub_jpeg_get_number (struct grub_jpeg_data *data, int num)
91 return 0;
92
93 msb = value = grub_jpeg_get_bit (data);
94- for (i = 1; i < num; i++)
95+ for (i = 1; i < num && grub_errno == GRUB_ERR_NONE; i++)
96 value = (value << 1) + (grub_jpeg_get_bit (data) != 0);
97 if (!msb)
98 value += 1 - (1 << num);
99@@ -208,6 +234,8 @@ grub_jpeg_decode_huff_table (struct grub_jpeg_data *data)
100 while (data->file->offset + sizeof (count) + 1 <= next_marker)
101 {
102 id = grub_jpeg_get_byte (data);
103+ if (grub_errno != GRUB_ERR_NONE)
104+ return grub_errno;
105 ac = (id >> 4) & 1;
106 id &= 0xF;
107 if (id > 1)
108@@ -258,6 +286,8 @@ grub_jpeg_decode_quan_table (struct grub_jpeg_data *data)
109
110 next_marker = data->file->offset;
111 next_marker += grub_jpeg_get_word (data);
112+ if (grub_errno != GRUB_ERR_NONE)
113+ return grub_errno;
114
115 if (next_marker > data->file->size)
116 {
117@@ -269,6 +299,8 @@ grub_jpeg_decode_quan_table (struct grub_jpeg_data *data)
118 <= next_marker)
119 {
120 id = grub_jpeg_get_byte (data);
121+ if (grub_errno != GRUB_ERR_NONE)
122+ return grub_errno;
123 if (id >= 0x10) /* Upper 4-bit is precision. */
124 return grub_error (GRUB_ERR_BAD_FILE_TYPE,
125 "jpeg: only 8-bit precision is supported");
126@@ -300,6 +332,9 @@ grub_jpeg_decode_sof (struct grub_jpeg_data *data)
127 next_marker = data->file->offset;
128 next_marker += grub_jpeg_get_word (data);
129
130+ if (grub_errno != GRUB_ERR_NONE)
131+ return grub_errno;
132+
133 if (grub_jpeg_get_byte (data) != 8)
134 return grub_error (GRUB_ERR_BAD_FILE_TYPE,
135 "jpeg: only 8-bit precision is supported");
136@@ -325,6 +360,8 @@ grub_jpeg_decode_sof (struct grub_jpeg_data *data)
137 return grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: invalid index");
138
139 ss = grub_jpeg_get_byte (data); /* Sampling factor. */
140+ if (grub_errno != GRUB_ERR_NONE)
141+ return grub_errno;
142 if (!id)
143 {
144 grub_uint8_t vs, hs;
145@@ -504,7 +541,7 @@ grub_jpeg_idct_transform (jpeg_data_unit_t du)
146 }
147 }
148
149-static void
150+static grub_err_t
151 grub_jpeg_decode_du (struct grub_jpeg_data *data, int id, jpeg_data_unit_t du)
152 {
153 int h1, h2, qt;
154@@ -519,6 +556,9 @@ grub_jpeg_decode_du (struct grub_jpeg_data *data, int id, jpeg_data_unit_t du)
155 data->dc_value[id] +=
156 grub_jpeg_get_number (data, grub_jpeg_get_huff_code (data, h1));
157
158+ if (grub_errno != GRUB_ERR_NONE)
159+ return grub_errno;
160+
161 du[0] = data->dc_value[id] * (int) data->quan_table[qt][0];
162 pos = 1;
163 while (pos < ARRAY_SIZE (data->quan_table[qt]))
164@@ -533,11 +573,13 @@ grub_jpeg_decode_du (struct grub_jpeg_data *data, int id, jpeg_data_unit_t du)
165 num >>= 4;
166 pos += num;
167
168+ if (grub_errno != GRUB_ERR_NONE)
169+ return grub_errno;
170+
171 if (pos >= ARRAY_SIZE (jpeg_zigzag_order))
172 {
173- grub_error (GRUB_ERR_BAD_FILE_TYPE,
174- "jpeg: invalid position in zigzag order!?");
175- return;
176+ return grub_error (GRUB_ERR_BAD_FILE_TYPE,
177+ "jpeg: invalid position in zigzag order!?");
178 }
179
180 du[jpeg_zigzag_order[pos]] = val * (int) data->quan_table[qt][pos];
181@@ -545,6 +587,7 @@ grub_jpeg_decode_du (struct grub_jpeg_data *data, int id, jpeg_data_unit_t du)
182 }
183
184 grub_jpeg_idct_transform (du);
185+ return GRUB_ERR_NONE;
186 }
187
188 static void
189@@ -603,7 +646,8 @@ grub_jpeg_decode_sos (struct grub_jpeg_data *data)
190 data_offset += grub_jpeg_get_word (data);
191
192 cc = grub_jpeg_get_byte (data);
193-
194+ if (grub_errno != GRUB_ERR_NONE)
195+ return grub_errno;
196 if (cc != 3 && cc != 1)
197 return grub_error (GRUB_ERR_BAD_FILE_TYPE,
198 "jpeg: component count must be 1 or 3");
199@@ -616,7 +660,8 @@ grub_jpeg_decode_sos (struct grub_jpeg_data *data)
200 id = grub_jpeg_get_byte (data) - 1;
201 if ((id < 0) || (id >= 3))
202 return grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: invalid index");
203-
204+ if (grub_errno != GRUB_ERR_NONE)
205+ return grub_errno;
206 ht = grub_jpeg_get_byte (data);
207 data->comp_index[id][1] = (ht >> 4);
208 data->comp_index[id][2] = (ht & 0xF) + 2;
209@@ -624,11 +669,14 @@ grub_jpeg_decode_sos (struct grub_jpeg_data *data)
210 if ((data->comp_index[id][1] < 0) || (data->comp_index[id][1] > 3) ||
211 (data->comp_index[id][2] < 0) || (data->comp_index[id][2] > 3))
212 return grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: invalid hufftable index");
213+ if (grub_errno != GRUB_ERR_NONE)
214+ return grub_errno;
215 }
216
217 grub_jpeg_get_byte (data); /* Skip 3 unused bytes. */
218 grub_jpeg_get_word (data);
219-
220+ if (grub_errno != GRUB_ERR_NONE)
221+ return grub_errno;
222 if (data->file->offset != data_offset)
223 return grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: extra byte in sos");
224
225@@ -646,6 +694,7 @@ grub_jpeg_decode_data (struct grub_jpeg_data *data)
226 {
227 unsigned c1, vb, hb, nr1, nc1;
228 int rst = data->dri;
229+ grub_err_t err = GRUB_ERR_NONE;
230
231 vb = 8 << data->log_vs;
232 hb = 8 << data->log_hs;
233@@ -666,17 +715,22 @@ grub_jpeg_decode_data (struct grub_jpeg_data *data)
234
235 for (r2 = 0; r2 < (1U << data->log_vs); r2++)
236 for (c2 = 0; c2 < (1U << data->log_hs); c2++)
237- grub_jpeg_decode_du (data, 0, data->ydu[r2 * 2 + c2]);
238+ {
239+ err = grub_jpeg_decode_du (data, 0, data->ydu[r2 * 2 + c2]);
240+ if (err != GRUB_ERR_NONE)
241+ return err;
242+ }
243
244 if (data->color_components >= 3)
245 {
246- grub_jpeg_decode_du (data, 1, data->cbdu);
247- grub_jpeg_decode_du (data, 2, data->crdu);
248+ err = grub_jpeg_decode_du (data, 1, data->cbdu);
249+ if (err != GRUB_ERR_NONE)
250+ return err;
251+ err = grub_jpeg_decode_du (data, 2, data->crdu);
252+ if (err != GRUB_ERR_NONE)
253+ return err;
254 }
255
256- if (grub_errno)
257- return grub_errno;
258-
259 nr2 = (data->r1 == nr1 - 1) ? (data->image_height - data->r1 * vb) : vb;
260 nc2 = (c1 == nc1 - 1) ? (data->image_width - c1 * hb) : hb;
261
262--
2632.34.1
264
diff --git a/meta/recipes-bsp/grub/files/video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch b/meta/recipes-bsp/grub/files/video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch
deleted file mode 100644
index 91ecaad98a..0000000000
--- a/meta/recipes-bsp/grub/files/video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch
+++ /dev/null
@@ -1,53 +0,0 @@
1From 166a4d61448f74745afe1dac2f2cfb85d04909bf Mon Sep 17 00:00:00 2001
2From: Daniel Axtens <dja@axtens.net>
3Date: Mon, 28 Jun 2021 14:25:17 +1000
4Subject: [PATCH] video/readers/jpeg: Refuse to handle multiple start of
5 streams
6
7An invalid file could contain multiple start of stream blocks, which
8would cause us to reallocate and leak our bitmap. Refuse to handle
9multiple start of streams.
10
11Additionally, fix a grub_error() call formatting.
12
13Signed-off-by: Daniel Axtens <dja@axtens.net>
14Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
15
16Upstream-Status: Backport
17
18Reference to upstream patch:
19https://git.savannah.gnu.org/cgit/grub.git/commit/?id=166a4d61448f74745afe1dac2f2cfb85d04909bf
20
21Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
22---
23 grub-core/video/readers/jpeg.c | 7 +++++--
24 1 file changed, 5 insertions(+), 2 deletions(-)
25
26diff --git a/grub-core/video/readers/jpeg.c b/grub-core/video/readers/jpeg.c
27index 2284a6c06..579bbe8a4 100644
28--- a/grub-core/video/readers/jpeg.c
29+++ b/grub-core/video/readers/jpeg.c
30@@ -683,6 +683,9 @@ grub_jpeg_decode_sos (struct grub_jpeg_data *data)
31 if (data->file->offset != data_offset)
32 return grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: extra byte in sos");
33
34+ if (*data->bitmap)
35+ return grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: too many start of scan blocks");
36+
37 if (grub_video_bitmap_create (data->bitmap, data->image_width,
38 data->image_height,
39 GRUB_VIDEO_BLIT_FORMAT_RGB_888))
40@@ -705,8 +708,8 @@ grub_jpeg_decode_data (struct grub_jpeg_data *data)
41 nc1 = (data->image_width + hb - 1) >> (3 + data->log_hs);
42
43 if (data->bitmap_ptr == NULL)
44- return grub_error(GRUB_ERR_BAD_FILE_TYPE,
45- "jpeg: attempted to decode data before start of stream");
46+ return grub_error (GRUB_ERR_BAD_FILE_TYPE,
47+ "jpeg: attempted to decode data before start of stream");
48
49 for (; data->r1 < nr1 && (!data->dri || rst);
50 data->r1++, data->bitmap_ptr += (vb * data->image_width - hb * nc1) * 3)
51--
522.34.1
53
diff --git a/meta/recipes-bsp/grub/grub-bootconf_1.00.bb b/meta/recipes-bsp/grub/grub-bootconf_1.00.bb
index 783e30bf38..0b4005e5bf 100644
--- a/meta/recipes-bsp/grub/grub-bootconf_1.00.bb
+++ b/meta/recipes-bsp/grub/grub-bootconf_1.00.bb
@@ -11,7 +11,7 @@ inherit grub-efi-cfg
11 11
12require conf/image-uefi.conf 12require conf/image-uefi.conf
13 13
14S = "${WORKDIR}" 14S = "${UNPACKDIR}"
15 15
16GRUB_CFG = "${S}/grub-bootconf" 16GRUB_CFG = "${S}/grub-bootconf"
17LABELS = "boot" 17LABELS = "boot"
@@ -22,7 +22,7 @@ python do_configure() {
22 bb.build.exec_func('build_efi_cfg', d) 22 bb.build.exec_func('build_efi_cfg', d)
23} 23}
24 24
25do_configure[vardeps] += "APPEND ROOT" 25do_configure[vardeps] += "APPEND ROOT GRUB_TITLE"
26 26
27do_install() { 27do_install() {
28 install -d ${D}${EFI_FILES_PATH} 28 install -d ${D}${EFI_FILES_PATH}
diff --git a/meta/recipes-bsp/grub/grub-efi_2.06.bb b/meta/recipes-bsp/grub/grub-efi_2.12.bb
index 9857e8e036..6354b43989 100644
--- a/meta/recipes-bsp/grub/grub-efi_2.06.bb
+++ b/meta/recipes-bsp/grub/grub-efi_2.12.bb
@@ -11,7 +11,7 @@ SRC_URI += " \
11 file://cfg \ 11 file://cfg \
12 " 12 "
13 13
14S = "${WORKDIR}/grub-${PV}" 14S = "${UNPACKDIR}/grub-${PV}"
15 15
16# Determine the target arch for the grub modules 16# Determine the target arch for the grub modules
17python __anonymous () { 17python __anonymous () {
@@ -30,6 +30,8 @@ python __anonymous () {
30 grubtarget = 'riscv64' 30 grubtarget = 'riscv64'
31 elif re.match('riscv32', target): 31 elif re.match('riscv32', target):
32 grubtarget = 'riscv32' 32 grubtarget = 'riscv32'
33 elif re.match('loongarch64', target):
34 grubtarget = 'loongarch64'
33 else: 35 else:
34 raise bb.parse.SkipRecipe("grub-efi is incompatible with target %s" % target) 36 raise bb.parse.SkipRecipe("grub-efi is incompatible with target %s" % target)
35 grubimage = prefix + d.getVar("EFI_BOOT_IMAGE") 37 grubimage = prefix + d.getVar("EFI_BOOT_IMAGE")
@@ -44,6 +46,9 @@ inherit deploy
44CACHED_CONFIGUREVARS += "ac_cv_path_HELP2MAN=" 46CACHED_CONFIGUREVARS += "ac_cv_path_HELP2MAN="
45EXTRA_OECONF += "--enable-efiemu=no" 47EXTRA_OECONF += "--enable-efiemu=no"
46 48
49# Define GRUB_MKIMAGE_OPTS variable for additional grub-mkimage options (e.g., disabling shim lock)
50GRUB_MKIMAGE_OPTS ?= ""
51
47do_mkimage() { 52do_mkimage() {
48 cd ${B} 53 cd ${B}
49 54
@@ -58,9 +63,9 @@ do_mkimage() {
58 63
59 # Search for the grub.cfg on the local boot media by using the 64 # Search for the grub.cfg on the local boot media by using the
60 # built in cfg file provided via this recipe 65 # built in cfg file provided via this recipe
61 grub-mkimage -v -c ../cfg -p ${EFIDIR} -d ./grub-core/ \ 66 grub-mkimage -v -c ${UNPACKDIR}/cfg -p ${EFIDIR} -d ./grub-core/ \
62 -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} \ 67 -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} \
63 ${GRUB_MKIMAGE_MODULES} 68 ${GRUB_MKIMAGE_OPTS} ${GRUB_MKIMAGE_MODULES}
64} 69}
65 70
66addtask mkimage before do_install after do_compile 71addtask mkimage before do_install after do_compile
diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc
index 2545b99b6a..ffa04e415d 100644
--- a/meta/recipes-bsp/grub/grub2.inc
+++ b/meta/recipes-bsp/grub/grub2.inc
@@ -14,50 +14,52 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
14CVE_PRODUCT = "grub2" 14CVE_PRODUCT = "grub2"
15 15
16SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \ 16SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \
17 file://0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch \
18 file://autogen.sh-exclude-pc.patch \ 17 file://autogen.sh-exclude-pc.patch \
19 file://grub-module-explicitly-keeps-symbole-.module_license.patch \ 18 file://grub-module-explicitly-keeps-symbole-.module_license.patch \
20 file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \ 19 file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \
21 file://determinism.patch \
22 file://0001-RISC-V-Restore-the-typcast-to-long.patch \ 20 file://0001-RISC-V-Restore-the-typcast-to-long.patch \
23 file://CVE-2021-3981-grub-mkconfig-Restore-umask-for-the-grub.cfg.patch \ 21 file://0001-misc-Implement-grub_strlcpy.patch \
24 file://0001-configure.ac-Use-_zicsr_zifencei-extentions-on-riscv.patch \ 22 file://CVE-2024-45781.patch \
25 file://video-Remove-trailing-whitespaces.patch \ 23 file://CVE-2024-45782_CVE-2024-56737.patch \
26 file://CVE-2021-3695-video-readers-png-Drop-greyscale-support-to-fix-heap.patch \ 24 file://CVE-2024-45780.patch \
27 file://CVE-2021-3696-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff.patch \ 25 file://CVE-2024-45783.patch \
28 file://video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch \ 26 file://CVE-2025-0624.patch \
29 file://video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch \ 27 file://CVE-2024-45774.patch \
30 file://CVE-2021-3697-video-readers-jpeg-Block-int-underflow-wild-pointer.patch \ 28 file://CVE-2024-45775.patch \
31 file://CVE-2022-28733-net-ip-Do-IP-fragment-maths-safely.patch \ 29 file://CVE-2025-0622-01.patch \
32 file://CVE-2022-28734-net-http-Fix-OOB-write-for-split-http-headers.patch \ 30 file://CVE-2025-0622-02.patch \
33 file://CVE-2022-28734-net-http-Error-out-on-headers-with-LF-without-CR.patch \ 31 file://CVE-2025-0622-03.patch \
34 file://CVE-2022-28735-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch \ 32 file://CVE-2024-45776.patch \
35 file://0001-configure-Remove-obsoleted-malign-jumps-loops-functi.patch \ 33 file://CVE-2024-45777.patch \
36 file://0002-configure-Check-for-falign-jumps-1-beside-falign-loo.patch \ 34 file://CVE-2025-0690.patch \
35 file://CVE-2025-1118.patch \
36 file://CVE-2024-45778_CVE-2024-45779.patch \
37 file://CVE-2025-0677_CVE-2025-0684_CVE-2025-0685_CVE-2025-0686_CVE-2025-0689.patch \
38 file://CVE-2025-0678_CVE-2025-1125.patch \
37" 39"
38 40
39SRC_URI[sha256sum] = "23b64b4c741569f9426ed2e3d0e6780796fca081bee4c99f62aa3f53ae803f5f" 41SRC_URI[sha256sum] = "b30919fa5be280417c17ac561bb1650f60cfb80cc6237fa1e2b6f56154cb9c91"
40 42
41# Applies only to RHEL 43CVE_STATUS[CVE-2019-14865] = "not-applicable-platform: applies only to RHEL"
42CVE_CHECK_IGNORE += "CVE-2019-14865" 44CVE_STATUS[CVE-2023-4001] = "not-applicable-platform: Applies only to RHEL/Fedora"
43# Applies only to SUSE 45CVE_STATUS[CVE-2024-1048] = "not-applicable-platform: Applies only to RHEL/Fedora"
44CVE_CHECK_IGNORE += "CVE-2021-46705"
45 46
46DEPENDS = "flex-native bison-native gettext-native" 47DEPENDS = "flex-native bison-native gettext-native"
47 48
48GRUB_COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|riscv.*)-(linux.*|freebsd.*)' 49GRUB_COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|loongarch64.*|riscv.*)-(linux.*|freebsd.*)'
49COMPATIBLE_HOST = "${GRUB_COMPATIBLE_HOST}" 50COMPATIBLE_HOST = "${GRUB_COMPATIBLE_HOST}"
50# Grub doesn't support hard float toolchain and won't be able to forcefully 51# Grub doesn't support hard float toolchain and won't be able to forcefully
51# disable it on some of the target CPUs. See 'configure.ac' for 52# disable it on some of the target CPUs. See 'configure.ac' for
52# supported/unsupported CPUs in hardfp. 53# supported/unsupported CPUs in hardfp.
53COMPATIBLE_HOST:armv7a = "${@'null' if d.getVar('TUNE_CCARGS_MFLOAT') == 'hardfp' else d.getVar('GRUB_COMPATIBLE_HOST')}" 54COMPATIBLE_HOST:armv7a = "${@'null' if bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', True, False, d) else d.getVar('GRUB_COMPATIBLE_HOST')}"
54COMPATIBLE_HOST:armv7ve = "${@'null' if d.getVar('TUNE_CCARGS_MFLOAT') == 'hardfp' else d.getVar('GRUB_COMPATIBLE_HOST')}" 55COMPATIBLE_HOST:armv7ve = "${@'null' if bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', True, False, d) else d.getVar('GRUB_COMPATIBLE_HOST')}"
55 56
56# configure.ac has code to set this automagically from the target tuple 57# configure.ac has code to set this automagically from the target tuple
57# but the OE freeform one (core2-foo-bar-linux) don't work with that. 58# but the OE freeform one (core2-foo-bar-linux) don't work with that.
58 59
59GRUBPLATFORM:arm = "efi" 60GRUBPLATFORM:arm = "efi"
60GRUBPLATFORM:aarch64 = "efi" 61GRUBPLATFORM:aarch64 = "efi"
62GRUBPLATFORM:loongarch64 = "efi"
61GRUBPLATFORM:riscv32 = "efi" 63GRUBPLATFORM:riscv32 = "efi"
62GRUBPLATFORM:riscv64 = "efi" 64GRUBPLATFORM:riscv64 = "efi"
63GRUBPLATFORM ??= "pc" 65GRUBPLATFORM ??= "pc"
@@ -65,6 +67,10 @@ GRUBPLATFORM ??= "pc"
65inherit autotools gettext texinfo pkgconfig 67inherit autotools gettext texinfo pkgconfig
66 68
67CFLAGS:remove = "-O2" 69CFLAGS:remove = "-O2"
70# It doesn't support sse, its make.defaults sets:
71# CFLAGS += -mno-mmx -mno-sse
72# So also remove -mfpmath=sse from TUNE_CCARGS
73TUNE_CCARGS:remove = "-mfpmath=sse"
68 74
69EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} \ 75EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} \
70 --disable-grub-mkfont \ 76 --disable-grub-mkfont \
@@ -92,6 +98,15 @@ export PYTHON = "python3"
92 98
93do_configure:prepend() { 99do_configure:prepend() {
94 cd ${S} 100 cd ${S}
101
102 # Remove in next version.
103 # See: https://git.savannah.gnu.org/cgit/grub.git/commit/?id=b835601c7639ed1890f2d3db91900a8506011a8e
104 echo "depends bli part_gpt" > ${S}/grub-core/extra_deps.lst
105
95 FROM_BOOTSTRAP=1 ${S}/autogen.sh 106 FROM_BOOTSTRAP=1 ${S}/autogen.sh
96 cd ${B} 107 cd ${B}
97} 108}
109
110# | aarch64-poky-linux-clang: error: invalid argument '-mcmodel=large' only allowed with '-fno-pic'
111# see - https://bugs.gentoo.org/942843
112TOOLCHAIN:aarch64 = "gcc"
diff --git a/meta/recipes-bsp/grub/grub_2.06.bb b/meta/recipes-bsp/grub/grub_2.12.bb
index 05d462785c..05d462785c 100644
--- a/meta/recipes-bsp/grub/grub_2.06.bb
+++ b/meta/recipes-bsp/grub/grub_2.12.bb
diff --git a/meta/recipes-bsp/keymaps/keymaps_1.0.bb b/meta/recipes-bsp/keymaps/keymaps_1.0.bb
index 84d09cb965..ab2d68d6a1 100644
--- a/meta/recipes-bsp/keymaps/keymaps_1.0.bb
+++ b/meta/recipes-bsp/keymaps/keymaps_1.0.bb
@@ -7,7 +7,6 @@ RDEPENDS:${PN} = "kbd"
7LICENSE = "GPL-2.0-only" 7LICENSE = "GPL-2.0-only"
8LIC_FILES_CHKSUM = "file://keymap.sh;beginline=5;endline=5;md5=829e563511c9a1d6d41f17a7a4989d6a" 8LIC_FILES_CHKSUM = "file://keymap.sh;beginline=5;endline=5;md5=829e563511c9a1d6d41f17a7a4989d6a"
9PACKAGE_ARCH = "${MACHINE_ARCH}" 9PACKAGE_ARCH = "${MACHINE_ARCH}"
10PR = "r31"
11 10
12INHIBIT_DEFAULT_DEPS = "1" 11INHIBIT_DEFAULT_DEPS = "1"
13 12
@@ -25,14 +24,14 @@ SRC_URI = "file://keymap.sh"
25INITSCRIPT_NAME = "keymap.sh" 24INITSCRIPT_NAME = "keymap.sh"
26INITSCRIPT_PARAMS = "start 01 S ." 25INITSCRIPT_PARAMS = "start 01 S ."
27 26
28S = "${WORKDIR}" 27S = "${UNPACKDIR}"
29 28
30do_install () { 29do_install () {
31 # Only install the script if 'sysvinit' is in DISTRO_FEATURES 30 # Only install the script if 'sysvinit' is in DISTRO_FEATURES
32 # THe ulitity this script provides could be achieved by systemd-vconsole-setup.service 31 # THe ulitity this script provides could be achieved by systemd-vconsole-setup.service
33 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then 32 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
34 install -d ${D}${sysconfdir}/init.d/ 33 install -d ${D}${sysconfdir}/init.d/
35 install -m 0755 ${WORKDIR}/keymap.sh ${D}${sysconfdir}/init.d/ 34 install -m 0755 ${S}/keymap.sh ${D}${sysconfdir}/init.d/
36 fi 35 fi
37} 36}
38 37
diff --git a/meta/recipes-bsp/libacpi/files/0001-libacpi-Fix-build-witth-fno-commom.patch b/meta/recipes-bsp/libacpi/files/0001-libacpi-Fix-build-witth-fno-commom.patch
index 32808fb92a..e8ff78082c 100644
--- a/meta/recipes-bsp/libacpi/files/0001-libacpi-Fix-build-witth-fno-commom.patch
+++ b/meta/recipes-bsp/libacpi/files/0001-libacpi-Fix-build-witth-fno-commom.patch
@@ -3,7 +3,7 @@ From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 5 Aug 2020 12:06:01 -0700 3Date: Wed, 5 Aug 2020 12:06:01 -0700
4Subject: [PATCH] libacpi: Fix build witth -fno-commom 4Subject: [PATCH] libacpi: Fix build witth -fno-commom
5 5
6Upstream-Status: Pending 6Upstream-Status: Inactive-Upstream [last release before 2008, no vcs]
7 7
8Signed-off-by: Khem Raj <raj.khem@gmail.com> 8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9--- 9---
diff --git a/meta/recipes-bsp/libacpi/files/ldflags.patch b/meta/recipes-bsp/libacpi/files/ldflags.patch
index a7424c39da..db0974104b 100644
--- a/meta/recipes-bsp/libacpi/files/ldflags.patch
+++ b/meta/recipes-bsp/libacpi/files/ldflags.patch
@@ -1,7 +1,6 @@
1libacpi: Remove QA warning: No GNU_HASH in the elf binary 1libacpi: Remove QA warning: No GNU_HASH in the elf binary
2 2
3Upstream-Status: Inappropriate [other] 3Upstream-Status: Inactive-Upstream [last release before 2008, no vcs]
4 Useful within bitbake environment only.
5 4
6Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com> 5Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
7 6
diff --git a/meta/recipes-bsp/libacpi/files/libacpi_fix_for_x32.patch b/meta/recipes-bsp/libacpi/files/libacpi_fix_for_x32.patch
index 06f20e5a78..955a175c96 100644
--- a/meta/recipes-bsp/libacpi/files/libacpi_fix_for_x32.patch
+++ b/meta/recipes-bsp/libacpi/files/libacpi_fix_for_x32.patch
@@ -1,4 +1,4 @@
1Upstream-Status: Pending 1Upstream-Status: Inactive-Upstream [last release before 2008, no vcs]
2 2
3Fix libacpi for x32 3Fix libacpi for x32
4 4
diff --git a/meta/recipes-bsp/libacpi/files/makefile-fix.patch b/meta/recipes-bsp/libacpi/files/makefile-fix.patch
index c34ef34e09..3b91bfaee1 100644
--- a/meta/recipes-bsp/libacpi/files/makefile-fix.patch
+++ b/meta/recipes-bsp/libacpi/files/makefile-fix.patch
@@ -1,4 +1,4 @@
1Upstream-Status: Pending 1Upstream-Status: Inactive-Upstream [last release before 2008, no vcs]
2 2
3--- 3---
4 Makefile | 6 +++--- 4 Makefile | 6 +++---
diff --git a/meta/recipes-bsp/libacpi/files/use_correct_strip_in_cross_environment.patch b/meta/recipes-bsp/libacpi/files/use_correct_strip_in_cross_environment.patch
index ef376aa316..901e5fa3b4 100644
--- a/meta/recipes-bsp/libacpi/files/use_correct_strip_in_cross_environment.patch
+++ b/meta/recipes-bsp/libacpi/files/use_correct_strip_in_cross_environment.patch
@@ -1,4 +1,4 @@
1Upstream-Status: Pending 1Upstream-Status: Inactive-Upstream [last release before 2008, no vcs]
2 2
3Used the cross strip instead of host strip to avoid this build error: 3Used the cross strip instead of host strip to avoid this build error:
4 4
diff --git a/meta/recipes-bsp/libacpi/libacpi_0.2.bb b/meta/recipes-bsp/libacpi/libacpi_0.2.bb
index 6d4be76bab..f939d11f4c 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"
5HOMEPAGE = "http://www.ngolde.de/libacpi.html" 5HOMEPAGE = "http://www.ngolde.de/libacpi.html"
6LICENSE = "MIT" 6LICENSE = "MIT"
7LIC_FILES_CHKSUM = "file://LICENSE;md5=fec17f82f16630adf2dfb7d2a46f21c5" 7LIC_FILES_CHKSUM = "file://LICENSE;md5=fec17f82f16630adf2dfb7d2a46f21c5"
8PR = "r6"
9 8
10SRC_URI = "http://www.ngolde.de/download/libacpi-${PV}.tar.gz \ 9SRC_URI = "http://www.ngolde.de/download/libacpi-${PV}.tar.gz \
11 file://makefile-fix.patch \ 10 file://makefile-fix.patch \
@@ -15,7 +14,6 @@ SRC_URI = "http://www.ngolde.de/download/libacpi-${PV}.tar.gz \
15 file://0001-libacpi-Fix-build-witth-fno-commom.patch \ 14 file://0001-libacpi-Fix-build-witth-fno-commom.patch \
16 " 15 "
17 16
18SRC_URI[md5sum] = "05b53dd7bead66dda35fec502b91066c"
19SRC_URI[sha256sum] = "13086e31d428b9c125954d48ac497b754bbbce2ef34ea29ecd903e82e25bad29" 17SRC_URI[sha256sum] = "13086e31d428b9c125954d48ac497b754bbbce2ef34ea29ecd903e82e25bad29"
20 18
21UPSTREAM_CHECK_URI = "http://www.ngolde.de/libacpi.html" 19UPSTREAM_CHECK_URI = "http://www.ngolde.de/libacpi.html"
diff --git a/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/0001-Fix-build-with-GCC-15.patch b/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/0001-Fix-build-with-GCC-15.patch
new file mode 100644
index 0000000000..e5e9125eea
--- /dev/null
+++ b/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/0001-Fix-build-with-GCC-15.patch
@@ -0,0 +1,186 @@
1From 3739faa41f60841d5277344b17ddc69e78ed8996 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 22 Mar 2025 22:58:33 -0700
4Subject: [PATCH] Fix build with GCC 15
5
6This is collection of changes needed to get compiling with gcc-15
7which switched to use C23 as default std.
8
9Upstream-Status: Submitted [https://github.com/UweOhse/lrzsz/pull/8]
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 lib/error.c | 2 +-
13 lib/getopt.h | 2 +-
14 lib/long-options.c | 4 ++--
15 lib/long-options.h | 2 +-
16 lib/xstrtol.c | 2 --
17 src/lrz.c | 8 +-------
18 src/lsz.c | 8 +-------
19 src/tcp.c | 2 +-
20 src/zglobal.h | 2 +-
21 src/zreadline.c | 2 +-
22 10 files changed, 10 insertions(+), 24 deletions(-)
23
24diff --git a/lib/error.c b/lib/error.c
25index 8f679c7..4632c9c 100644
26--- a/lib/error.c
27+++ b/lib/error.c
28@@ -73,7 +73,7 @@ extern char *program_name;
29
30 # if HAVE_STRERROR
31 # ifndef strerror /* On some systems, strerror is a macro */
32-char *strerror ();
33+char *strerror (int);
34 # endif
35 # else
36 static char *
37diff --git a/lib/getopt.h b/lib/getopt.h
38index 4ac33b7..46971cb 100644
39--- a/lib/getopt.h
40+++ b/lib/getopt.h
41@@ -101,7 +101,7 @@ struct option
42 errors, only prototype getopt for the GNU C library. */
43 extern int getopt (int argc, char *const *argv, const char *shortopts);
44 #else /* not __GNU_LIBRARY__ */
45-extern int getopt ();
46+extern int getopt (int, char * const [], const char *);
47 #endif /* __GNU_LIBRARY__ */
48 extern int getopt_long (int argc, char *const *argv, const char *shortopts,
49 const struct option *longopts, int *longind);
50diff --git a/lib/long-options.c b/lib/long-options.c
51index 9ee8f66..2c8d267 100644
52--- a/lib/long-options.c
53+++ b/lib/long-options.c
54@@ -40,7 +40,7 @@ parse_long_options (argc, argv,version, usage)
55 int argc;
56 char **argv;
57 void (*version)();
58- void (*usage)();
59+ void (*usage)(int);
60 {
61 int c;
62 int saved_opterr;
63@@ -61,7 +61,7 @@ parse_long_options (argc, argv,version, usage)
64 (*usage) (0);
65
66 case 'v':
67- (*version) (0);
68+ (*version) ();
69 /* printf ("%s (%s) %s\n", command_name, package, version_string); */
70 exit (0);
71
72diff --git a/lib/long-options.h b/lib/long-options.h
73index 14459cd..3fb8fa6 100644
74--- a/lib/long-options.h
75+++ b/lib/long-options.h
76@@ -6,5 +6,5 @@
77 #endif
78
79 void parse_long_options __P ((int _argc, char **_argv,
80- void (*_version) (void),
81+ void (*_version) (),
82 void (*_usage) (int)));
83diff --git a/lib/xstrtol.c b/lib/xstrtol.c
84index 8755cf4..0ab337d 100644
85--- a/lib/xstrtol.c
86+++ b/lib/xstrtol.c
87@@ -65,8 +65,6 @@ extern int errno;
88 } \
89 while (0)
90
91-__unsigned long int __strtol ();
92-
93 /* FIXME: comment. */
94
95 strtol_error
96diff --git a/src/lrz.c b/src/lrz.c
97index b3cf1d5..ae3c62d 100644
98--- a/src/lrz.c
99+++ b/src/lrz.c
100@@ -41,12 +41,6 @@
101 #include "xstrtoul.h"
102 #include "error.h"
103
104-#ifndef STRICT_PROTOTYPES
105-extern time_t time();
106-extern char *strerror();
107-extern char *strstr();
108-#endif
109-
110 #ifndef HAVE_ERRNO_DECLARATION
111 extern int errno;
112 #endif
113@@ -191,7 +185,7 @@ int enable_syslog=FALSE;
114
115
116 /* called by signal interrupt or terminate to clean things up */
117-RETSIGTYPE
118+void
119 bibi(int n)
120 {
121 if (zmodem_requested)
122diff --git a/src/lsz.c b/src/lsz.c
123index e9e4660..69f4fb8 100644
124--- a/src/lsz.c
125+++ b/src/lsz.c
126@@ -50,12 +50,6 @@ void *mm_addr=NULL;
127 #include "xstrtoul.h"
128 #include "error.h"
129
130-#ifndef STRICT_PROTOTYPES
131-extern time_t time();
132-extern char *strerror();
133-extern char *strstr();
134-#endif
135-
136 #ifndef HAVE_ERRNO_DECLARATION
137 extern int errno;
138 #endif
139@@ -218,7 +212,7 @@ static int zrqinits_sent=0;
140 static int play_with_sigint=0;
141
142 /* called by signal interrupt or terminate to clean things up */
143-RETSIGTYPE
144+void
145 bibi (int n)
146 {
147 canit(STDOUT_FILENO);
148diff --git a/src/tcp.c b/src/tcp.c
149index 137f94c..a885d5b 100644
150--- a/src/tcp.c
151+++ b/src/tcp.c
152@@ -38,7 +38,7 @@
153 #include <stdlib.h>
154 #include "error.h"
155
156-static RETSIGTYPE
157+static void
158 tcp_alarm_handler(int dummy LRZSZ_ATTRIB_UNUSED)
159 {
160 /* doesn't need to do anything */
161diff --git a/src/zglobal.h b/src/zglobal.h
162index 573b461..55bd58f 100644
163--- a/src/zglobal.h
164+++ b/src/zglobal.h
165@@ -357,7 +357,7 @@ extern int no_timeout;
166 extern int Zctlesc; /* Encode control characters */
167 extern int under_rsh;
168
169-RETSIGTYPE bibi __P ((int n));
170+void bibi __P ((int n));
171
172 #define sendline(c) putchar((c) & 0377)
173 #define xsendline(c) putchar(c)
174diff --git a/src/zreadline.c b/src/zreadline.c
175index aeda95c..c8f8263 100644
176--- a/src/zreadline.c
177+++ b/src/zreadline.c
178@@ -43,7 +43,7 @@ static char *readline_buffer;
179 int readline_left=0;
180 char *readline_ptr;
181
182-static RETSIGTYPE
183+static void
184 zreadline_alarm_handler(int dummy LRZSZ_ATTRIB_UNUSED)
185 {
186 /* doesn't need to do anything */
diff --git a/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb b/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb
index a34fb4eb03..777560bd22 100644
--- a/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb
+++ b/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb
@@ -10,19 +10,17 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
10 file://src/lrz.c;beginline=1;endline=10;md5=5276956373ff7d8758837f6399a1045f" 10 file://src/lrz.c;beginline=1;endline=10;md5=5276956373ff7d8758837f6399a1045f"
11SECTION = "console/network" 11SECTION = "console/network"
12DEPENDS = "" 12DEPENDS = ""
13PR = "r6"
14 13
15SRC_URI = "http://www.ohse.de/uwe/releases/lrzsz-${PV}.tar.gz \ 14SRC_URI = "https://www.ohse.de/uwe/releases/lrzsz-${PV}.tar.gz \
16 file://autotools-update.patch \ 15 file://autotools-update.patch \
17 file://autotools.patch \ 16 file://autotools.patch \
18 file://makefile.patch \ 17 file://makefile.patch \
19 file://lrzsz-check-locale.h.patch \ 18 file://lrzsz-check-locale.h.patch \
20 file://cve-2018-10195.patch \ 19 file://cve-2018-10195.patch \
21 file://include.patch \ 20 file://include.patch \
22 file://0001-Fix-cross-compilation-using-autoconf-detected-AR.patch \ 21 file://0001-Fix-cross-compilation-using-autoconf-detected-AR.patch \
22 file://0001-Fix-build-with-GCC-15.patch \
23 " 23 "
24
25SRC_URI[md5sum] = "b5ce6a74abc9b9eb2af94dffdfd372a4"
26SRC_URI[sha256sum] = "c28b36b14bddb014d9e9c97c52459852f97bd405f89113f30bee45ed92728ff1" 24SRC_URI[sha256sum] = "c28b36b14bddb014d9e9c97c52459852f97bd405f89113f30bee45ed92728ff1"
27 25
28UPSTREAM_CHECK_URI = "http://ohse.de/uwe/software/lrzsz.html" 26UPSTREAM_CHECK_URI = "http://ohse.de/uwe/software/lrzsz.html"
@@ -47,3 +45,9 @@ ALTERNATIVE_TARGET[rb] = "${bindir}/lrz"
47ALTERNATIVE_TARGET[sz] = "${bindir}/lsz" 45ALTERNATIVE_TARGET[sz] = "${bindir}/lsz"
48ALTERNATIVE_TARGET[sx] = "${bindir}/lsz" 46ALTERNATIVE_TARGET[sx] = "${bindir}/lsz"
49ALTERNATIVE_TARGET[sb] = "${bindir}/lsz" 47ALTERNATIVE_TARGET[sb] = "${bindir}/lsz"
48
49# http://errors.yoctoproject.org/Errors/Details/766929/
50# lrzsz-0.12.20/src/tcp.c:75:56: error: passing argument 3 of 'getsockname' from incompatible pointer type [-Wincompatible-pointer-types]
51# lrzsz-0.12.20/src/tcp.c:83:52: error: passing argument 3 of 'getsockname' from incompatible pointer type [-Wincompatible-pointer-types]
52# lrzsz-0.12.20/src/tcp.c:103:51: error: passing argument 3 of 'accept' from incompatible pointer type [-Wincompatible-pointer-types]
53CFLAGS += "-Wno-error=incompatible-pointer-types"
diff --git a/meta/recipes-bsp/opensbi/opensbi-payloads.inc b/meta/recipes-bsp/opensbi/opensbi-payloads.inc
index e590a27573..a55679632e 100644
--- a/meta/recipes-bsp/opensbi/opensbi-payloads.inc
+++ b/meta/recipes-bsp/opensbi/opensbi-payloads.inc
@@ -1,13 +1,15 @@
1def riscv_get_extra_oemake_image(d): 1def riscv_get_extra_oemake_image(d):
2 sbi_payload = d.getVar('RISCV_SBI_PAYLOAD') 2 sbi_payload = d.getVar('RISCV_SBI_PAYLOAD')
3 deploy_dir = d.getVar('DEPLOY_DIR_IMAGE')
4
5 if sbi_payload is None: 3 if sbi_payload is None:
6 return "" 4 return ""
7 5
6 deploy_dir = d.getVar('DEPLOY_DIR_IMAGE')
7
8 return "FW_PAYLOAD_PATH=" + deploy_dir + "/" + sbi_payload 8 return "FW_PAYLOAD_PATH=" + deploy_dir + "/" + sbi_payload
9 9
10def riscv_get_extra_oemake_fdt(d): 10def riscv_get_extra_oemake_fdt(d):
11 if d.getVar('RISCV_SBI_PAYLOAD') is None:
12 return ""
11 sbi_fdt = d.getVar('RISCV_SBI_FDT') 13 sbi_fdt = d.getVar('RISCV_SBI_FDT')
12 deploy_dir = d.getVar('DEPLOY_DIR_IMAGE') 14 deploy_dir = d.getVar('DEPLOY_DIR_IMAGE')
13 15
@@ -18,11 +20,11 @@ def riscv_get_extra_oemake_fdt(d):
18 20
19def riscv_get_do_compile_depends(d): 21def riscv_get_do_compile_depends(d):
20 sbi_payload = d.getVar('RISCV_SBI_PAYLOAD') or "" 22 sbi_payload = d.getVar('RISCV_SBI_PAYLOAD') or ""
21 sbi_fdt = d.getVar('RISCV_SBI_FDT') or "" 23 if sbi_payload == "":
22
23 if sbi_payload == "" and sbi_fdt == "":
24 return "" 24 return ""
25 25
26 sbi_fdt = d.getVar('RISCV_SBI_FDT') or ""
27
26 if sbi_fdt != "" and 'u-boot.bin' in sbi_payload: 28 if sbi_fdt != "" and 'u-boot.bin' in sbi_payload:
27 return "virtual/kernel:do_deploy virtual/bootloader:do_deploy" 29 return "virtual/kernel:do_deploy virtual/bootloader:do_deploy"
28 30
diff --git a/meta/recipes-bsp/opensbi/opensbi_1.1.bb b/meta/recipes-bsp/opensbi/opensbi_1.7.bb
index d3a6296533..a460062e93 100644
--- a/meta/recipes-bsp/opensbi/opensbi_1.1.bb
+++ b/meta/recipes-bsp/opensbi/opensbi_1.7.bb
@@ -6,14 +6,18 @@ LIC_FILES_CHKSUM = "file://COPYING.BSD;md5=42dd9555eb177f35150cf9aa240b61e5"
6 6
7require opensbi-payloads.inc 7require opensbi-payloads.inc
8 8
9inherit autotools-brokensep deploy 9inherit deploy
10 10
11SRCREV = "4489876e933d8ba0d8bc6c64bae71e295d45faac" 11SRCREV = "a32a91069119e7a5aa31e6bc51d5e00860be3d80"
12SRC_URI = "git://github.com/riscv/opensbi.git;branch=master;protocol=https" 12SRC_URI = "git://github.com/riscv/opensbi.git;branch=master;protocol=https"
13 13
14S = "${WORKDIR}/git" 14TARGET_DBGSRC_DIR = "/share/opensbi/*/generic/firmware/"
15 15
16EXTRA_OEMAKE += "PLATFORM=${RISCV_SBI_PLAT} I=${D} FW_PIC=n CLANG_TARGET= " 16TARGET_CC_ARCH += "${LDFLAGS}"
17
18RISCV_SBI_FW_TEXT_START ??= "0x80000000"
19EXTRA_OEMAKE += "REPRODUCIBLE=y CROSS_COMPILE=${HOST_PREFIX} ELFFLAGS="${LDFLAGS}" PLATFORM=${RISCV_SBI_PLAT} I=${D} FW_TEXT_START=${RISCV_SBI_FW_TEXT_START}"
20EXTRA_OEMAKE:append:toolchain-clang = " LLVM=y"
17# If RISCV_SBI_PAYLOAD is set then include it as a payload 21# If RISCV_SBI_PAYLOAD is set then include it as a payload
18EXTRA_OEMAKE:append = " ${@riscv_get_extra_oemake_image(d)}" 22EXTRA_OEMAKE:append = " ${@riscv_get_extra_oemake_image(d)}"
19EXTRA_OEMAKE:append = " ${@riscv_get_extra_oemake_fdt(d)}" 23EXTRA_OEMAKE:append = " ${@riscv_get_extra_oemake_fdt(d)}"
@@ -21,7 +25,12 @@ EXTRA_OEMAKE:append = " ${@riscv_get_extra_oemake_fdt(d)}"
21# Required if specifying a custom payload 25# Required if specifying a custom payload
22do_compile[depends] += "${@riscv_get_do_compile_depends(d)}" 26do_compile[depends] += "${@riscv_get_do_compile_depends(d)}"
23 27
24do_install:append() { 28do_compile() {
29 oe_runmake
30}
31
32do_install() {
33 oe_runmake DESTDIR=${D} install
25 # In the future these might be required as a dependency for other packages. 34 # In the future these might be required as a dependency for other packages.
26 # At the moment just delete them to avoid warnings 35 # At the moment just delete them to avoid warnings
27 rm -r ${D}/include 36 rm -r ${D}/include
@@ -42,6 +51,3 @@ FILES:${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_payload.*"
42FILES:${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_dynamic.*" 51FILES:${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_dynamic.*"
43 52
44COMPATIBLE_HOST = "(riscv64|riscv32).*" 53COMPATIBLE_HOST = "(riscv64|riscv32).*"
45INHIBIT_PACKAGE_STRIP = "1"
46
47SECURITY_CFLAGS = ""
diff --git a/meta/recipes-bsp/pciutils/pciutils/configure.patch b/meta/recipes-bsp/pciutils/pciutils/configure.patch
deleted file mode 100644
index cf55b94808..0000000000
--- a/meta/recipes-bsp/pciutils/pciutils/configure.patch
+++ /dev/null
@@ -1,91 +0,0 @@
1From 502c01e180d9085fcbeaf2fb46239999c4f335d2 Mon Sep 17 00:00:00 2001
2From: Richard Purdie <rpurdie@linux.intel.com>
3Date: Wed, 31 Dec 2008 17:20:38 +0000
4Subject: [PATCH] pciutils: Upgarde 2.2.4 -> 3.0.3
5
6This patch:
7* ensures we link correctly
8* allows us to optionally pass target information to configure rather than using uname
9* select linux as the platform in most cases we care about
10
11This is a merge of various tweaks to allow us to build pciutils including
12work from:
13
147/30/2010 - Qing He <qing.he@intel.com>
151/22/2012 - Shane Wang <shane.wang@intel.com>
16Ionut Radu <ionutx.radu@intel.com>
172017/6/15 - RP - Cleanups and merging patches
18
19Upstream-Status: Inappropriate [embedded specific]
20
21---
22 Makefile | 2 +-
23 lib/configure | 14 ++++++++++----
24 2 files changed, 11 insertions(+), 5 deletions(-)
25
26diff --git a/Makefile b/Makefile
27index 9319bb4..78a2d54 100644
28--- a/Makefile
29+++ b/Makefile
30@@ -108,7 +108,7 @@ example$(EXEEXT): example.o lib/$(PCILIB)
31 example.o: example.c $(PCIINC)
32
33 %$(EXEEXT): %.o
34- $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LDLIBS) -o $@
35+ $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LIB_LDLIBS) $(LDLIBS) -o $@
36
37 %.8 %.7 %.5: %.man
38 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)#;s#@PCI_IDS@#$(PCI_IDS)#"
39diff --git a/lib/configure b/lib/configure
40index 45a416a..1afdaa6 100755
41--- a/lib/configure
42+++ b/lib/configure
43@@ -9,6 +9,10 @@ echo_n() {
44 printf '%s' "$*"
45 }
46
47+VERSION=$1
48+IDSDIR=$2
49+DNS=yes
50+
51 if [ -z "$VERSION" ] ; then
52 echo >&2 "Please run the configure script from the top-level Makefile"
53 exit 1
54@@ -16,8 +20,8 @@ fi
55
56 echo_n "Configuring libpci for your system..."
57 if [ -z "$HOST" ] ; then
58- sys=`uname -s`
59- rel=`uname -r`
60+ sys=${3:-`uname -s`}
61+ rel=
62 realsys="$sys"
63 if [ "$sys" = "AIX" -a -x /usr/bin/oslevel -a -x /usr/sbin/lsattr ]
64 then
65@@ -25,7 +29,7 @@ if [ -z "$HOST" ] ; then
66 proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1`
67 cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'`
68 else
69- 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/'`
70+ 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/'`}
71 fi
72 if [ "$sys" = "DragonFly" ]
73 then
74@@ -43,7 +47,7 @@ if [ -z "$HOST" ] ; then
75 then
76 sys=cygwin
77 fi
78- HOST=${3:-$cpu-$sys}
79+ HOST=$cpu-$sys
80 fi
81 [ -n "$RELEASE" ] && rel="${RELEASE}"
82 # CAVEAT: tr on Solaris is a bit weird and the extra [] is otherwise harmless.
83@@ -52,6 +56,8 @@ cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
84 sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
85 echo " $host $rel $cpu $sys"
86
87+{ echo "$host" | grep linux; } && sys=linux
88+
89 c=config.h
90 m=config.mk
91 echo >$c '#define PCI_CONFIG_H'
diff --git a/meta/recipes-bsp/pciutils/pciutils_3.8.0.bb b/meta/recipes-bsp/pciutils/pciutils_3.14.0.bb
index 4f57342e1e..a267ea34b7 100644
--- a/meta/recipes-bsp/pciutils/pciutils_3.8.0.bb
+++ b/meta/recipes-bsp/pciutils/pciutils_3.14.0.bb
@@ -1,7 +1,7 @@
1SUMMARY = "PCI utilities" 1SUMMARY = "PCI utilities"
2DESCRIPTION = 'The PCI Utilities package contains a library for portable access \ 2DESCRIPTION = 'The PCI Utilities package contains a library for portable access \
3to PCI bus configuration space and several utilities based on this library.' 3to PCI bus configuration space and several utilities based on this library.'
4HOMEPAGE = "http://atrey.karlin.mff.cuni.cz/~mj/pciutils.shtml" 4HOMEPAGE = "https://mj.ucw.cz/sw/pciutils/"
5SECTION = "console/utils" 5SECTION = "console/utils"
6 6
7LICENSE = "GPL-2.0-or-later" 7LICENSE = "GPL-2.0-or-later"
@@ -9,44 +9,33 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
9# Can drop make-native when all systems have make 4.3 9# Can drop make-native when all systems have make 4.3
10# https://git.savannah.gnu.org/cgit/make.git/commit/?id=b90fabc8d6f34fb37d428dc0fb1b8b1951a9fbed 10# https://git.savannah.gnu.org/cgit/make.git/commit/?id=b90fabc8d6f34fb37d428dc0fb1b8b1951a9fbed
11# causes space issues in lib/libpci.pc 11# causes space issues in lib/libpci.pc
12DEPENDS = "zlib kmod make-native" 12DEPENDS = "make-native"
13 13
14SRC_URI = "${KERNELORG_MIRROR}/software/utils/pciutils/pciutils-${PV}.tar.xz \ 14SRC_URI = "${KERNELORG_MIRROR}/software/utils/pciutils/pciutils-${PV}.tar.xz"
15 file://configure.patch" 15SRC_URI[sha256sum] = "e7713409882813991d2269d125e40dad1f54a019a52b78b3962941c1d4a6f86f"
16
17SRC_URI[sha256sum] = "91edbd0429a84705c9ad156d4ff38ccc724d41ea54c4c5b88e38e996f8a34f05"
18 16
19inherit multilib_header pkgconfig update-alternatives 17inherit multilib_header pkgconfig update-alternatives
20 18
21PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'hwdb', '', d)}" 19PACKAGECONFIG ??= "hwdb kmod zlib"
22PACKAGECONFIG[hwdb] = "HWDB=yes,HWDB=no,udev" 20PACKAGECONFIG[hwdb] = "HWDB=yes,HWDB=no,udev"
23 21PACKAGECONFIG[kmod] = "LIBKMOD=yes,LIBKMOD=no,kmod"
24PCI_CONF_FLAG = "ZLIB=yes DNS=yes SHARED=yes STRIP= LIBDIR=${libdir}" 22PACKAGECONFIG[zlib] = "ZLIB=yes,ZLIB=no,zlib"
25 23
26# see configure.patch 24# Configuration options
27do_configure () { 25EXTRA_OEMAKE += "${PACKAGECONFIG_CONFARGS} DNS=yes SHARED=yes"
28 ( 26# Construct a HOST that matches what lib/configure expects
29 cd lib && \ 27EXTRA_OEMAKE += "HOST="${HOST_ARCH}-${HOST_OS}""
30 # PACKAGECONFIG_CONFARGS for this recipe could only possibly contain 'HWDB=yes/no', 28# Toolchain. We need to pass CFLAGS via CC as this is the only variable
31 # so we put it before ./configure 29# available to the caller without clobbering assignments (notably, -fPIC)
32 ${PCI_CONF_FLAG} ${PACKAGECONFIG_CONFARGS} ./configure ${PV} ${datadir} ${TARGET_OS} ${TARGET_ARCH} 30EXTRA_OEMAKE += "CC="${CC} ${CFLAGS}" AR="${AR}" STRIP= LDFLAGS="${LDFLAGS}""
33 ) 31# Paths
34} 32EXTRA_OEMAKE += "PREFIX=${prefix} LIBDIR=${libdir} SBINDIR=${sbindir} SHAREDIR=${datadir} MANDIR=${mandir}"
35
36export PREFIX = "${prefix}"
37export SBINDIR = "${sbindir}"
38export SHAREDIR = "${datadir}"
39export MANDIR = "${mandir}"
40
41EXTRA_OEMAKE = "-e MAKEFLAGS= ${PCI_CONF_FLAG}"
42
43ASNEEDED = ""
44
45# The configure script breaks if the HOST variable is set
46HOST[unexport] = "1"
47 33
48do_install () { 34do_install () {
49 oe_runmake DESTDIR=${D} install install-lib 35 # Do these in separate calls as they expose a race in pseudo when creating
36 # symlinks when ran in parallel.
37 oe_runmake DESTDIR=${D} install
38 oe_runmake DESTDIR=${D} install-lib
50 39
51 install -d ${D}${bindir} 40 install -d ${D}${bindir}
52 41
@@ -54,11 +43,13 @@ do_install () {
54} 43}
55 44
56PACKAGES =+ "${PN}-ids libpci" 45PACKAGES =+ "${PN}-ids libpci"
46
57FILES:${PN}-ids = "${datadir}/pci.ids*" 47FILES:${PN}-ids = "${datadir}/pci.ids*"
58FILES:libpci = "${libdir}/libpci.so.*"
59SUMMARY:${PN}-ids = "PCI utilities - device ID database" 48SUMMARY:${PN}-ids = "PCI utilities - device ID database"
60DESCRIPTION:${PN}-ids = "Package providing the PCI device ID database for pciutils." 49DESCRIPTION:${PN}-ids = "Package providing the PCI device ID database for pciutils."
61RDEPENDS:${PN} += "${PN}-ids" 50RDEPENDS:${PN} += "${PN}-ids"
62 51
52FILES:libpci = "${libdir}/libpci.so.*"
53
63ALTERNATIVE:${PN} = "lspci" 54ALTERNATIVE:${PN} = "lspci"
64ALTERNATIVE_PRIORITY = "100" 55ALTERNATIVE_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 c6a4bc4932..8756511c17 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
@@ -6,22 +6,22 @@ LICENSE = "GPL-2.0-only"
6LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ 6LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
7 file://src/pm-pmu.c;beginline=1;endline=22;md5=3c1ddbc54e735fb4a0386e14c78a3147" 7 file://src/pm-pmu.c;beginline=1;endline=22;md5=3c1ddbc54e735fb4a0386e14c78a3147"
8 8
9PR = "r1"
10
11SRC_URI = "http://pm-utils.freedesktop.org/releases/pm-utils-${PV}.tar.gz" 9SRC_URI = "http://pm-utils.freedesktop.org/releases/pm-utils-${PV}.tar.gz"
12 10
13SRC_URI[md5sum] = "1742a556089c36c3a89eb1b957da5a60"
14SRC_URI[sha256sum] = "8ed899032866d88b2933a1d34cc75e8ae42dcde20e1cc21836baaae3d4370c0b" 11SRC_URI[sha256sum] = "8ed899032866d88b2933a1d34cc75e8ae42dcde20e1cc21836baaae3d4370c0b"
15 12
16inherit pkgconfig autotools manpages 13inherit pkgconfig autotools manpages
17 14
18PACKAGECONFIG[manpages] = "--enable-doc, --disable-doc, libxslt-native xmlto-native" 15PACKAGECONFIG[manpages] = "--enable-doc, --disable-doc, libxslt-native xmlto-native"
19 16
20RDEPENDS:${PN} = "grep bash" 17RDEPENDS:${PN} = "bash"
18
19EXTRA_OECONF = "--libdir=${nonarch_libdir}"
21 20
22do_configure:prepend () { 21do_configure:prepend () {
23 ( cd ${S}; autoreconf -f -i -s ) 22 ( cd ${S}; autoreconf -f -i -s )
24} 23}
25 24
26FILES:${PN} += "${libdir}/${BPN}/*" 25FILES:${PN} += "${nonarch_libdir}/${BPN}/*"
27FILES:${PN}-dbg += "${datadir}/doc/pm-utils/README.debugging" 26FILES:${PN}-dbg += "${datadir}/doc/pm-utils/README.debugging"
27FILES:${PN}-dev += "${nonarch_libdir}/pkgconfig/pm-utils.pc"
diff --git a/meta/recipes-bsp/setserial/setserial_2.17.bb b/meta/recipes-bsp/setserial/setserial_2.17.bb
index e46aeb90cb..e1e80e31ae 100644
--- a/meta/recipes-bsp/setserial/setserial_2.17.bb
+++ b/meta/recipes-bsp/setserial/setserial_2.17.bb
@@ -1,16 +1,14 @@
1SUMMARY = "Controls the configuration of serial ports" 1SUMMARY = "Controls the configuration of serial ports"
2DESCRIPTION = "setserial is a program designed to set and/or report the configuration information associated with a serial port" 2DESCRIPTION = "setserial is a program designed to set and/or report the configuration information associated with a serial port"
3HOMEPAGE = "http://setserial.sourceforge.net" 3HOMEPAGE = "http://setserial.sourceforge.net"
4AUTHOR = "Theodore Ts'o <tytso@mit.edu>"
5SECTION = "console/utils" 4SECTION = "console/utils"
6 5
7LICENSE = "GPL-2.0-only" 6LICENSE = "GPL-2.0-only"
8LIC_FILES_CHKSUM = "file://version.h;beginline=1;endline=6;md5=2e7c59cb9e57e356ae81f50f4e4dfd99" 7LIC_FILES_CHKSUM = "file://version.h;beginline=1;endline=6;md5=2e7c59cb9e57e356ae81f50f4e4dfd99"
9PR = "r3"
10 8
11DEPENDS += "groff-native" 9DEPENDS += "groff-native"
12 10
13inherit autotools-brokensep 11inherit autotools-brokensep sourceforge-releases
14 12
15SRC_URI = "${SOURCEFORGE_MIRROR}/setserial/${BPN}-${PV}.tar.gz \ 13SRC_URI = "${SOURCEFORGE_MIRROR}/setserial/${BPN}-${PV}.tar.gz \
16 file://add_stdlib.patch \ 14 file://add_stdlib.patch \
@@ -18,7 +16,6 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/setserial/${BPN}-${PV}.tar.gz \
18 file://0001-setserial.c-Add-needed-system-headers-for-ioctl-and-.patch \ 16 file://0001-setserial.c-Add-needed-system-headers-for-ioctl-and-.patch \
19 " 17 "
20 18
21SRC_URI[md5sum] = "c4867d72c41564318e0107745eb7a0f2"
22SRC_URI[sha256sum] = "7e4487d320ac31558563424189435d396ddf77953bb23111a17a3d1487b5794a" 19SRC_URI[sha256sum] = "7e4487d320ac31558563424189435d396ddf77953bb23111a17a3d1487b5794a"
23 20
24do_install() { 21do_install() {
diff --git a/meta/recipes-bsp/u-boot/files/0001-riscv-fix-build-with-binutils-2.38.patch b/meta/recipes-bsp/u-boot/files/0001-riscv-fix-build-with-binutils-2.38.patch
deleted file mode 100644
index 3598329b99..0000000000
--- a/meta/recipes-bsp/u-boot/files/0001-riscv-fix-build-with-binutils-2.38.patch
+++ /dev/null
@@ -1,40 +0,0 @@
1From 26a7f6b1e4c5f715c03e59a623f0d620498b92cf Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 13 Feb 2022 21:11:31 -0800
4Subject: [PATCH] riscv: fix build with binutils 2.38
5
6From version 2.38, binutils default to ISA spec version 20191213. This
7means that the csr read/write (csrr*/csrw*) instructions and fence.i
8instruction has separated from the `I` extension, become two standalone
9extensions: Zicsr and Zifencei.
10
11The fix is to specify those extensions explicitely in -march. However as
12older binutils version do not support this, we first need to detect
13that.
14
15Fixes
16arch/riscv/lib/cache.c: Assembler messages:
17arch/riscv/lib/cache.c:12: Error: unrecognized opcode `fence.i'
18
19Upstream-Status: Submitted []
20Signed-off-by: Khem Raj <raj.khem@gmail.com>
21---
22 arch/riscv/Makefile | 7 ++++++-
23 1 file changed, 6 insertions(+), 1 deletion(-)
24
25--- a/arch/riscv/Makefile
26+++ b/arch/riscv/Makefile
27@@ -28,7 +28,12 @@ ifeq ($(CONFIG_CMODEL_MEDANY),y)
28 CMODEL = medany
29 endif
30
31-ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_F)$(ARCH_D)$(ARCH_C) -mabi=$(ABI) \
32+# Newer binutils versions default to ISA spec version 20191213 which moves some
33+# instructions from the I extension to the Zicsr and Zifencei extensions.
34+toolchain-need-zicsr-zifencei := $(call cc-option-yn, -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_F)$(ARCH_D)$(ARCH_C)_zicsr_zifencei)
35+zicsr_zifencei-$(toolchain-need-zicsr-zifencei) := _zicsr_zifencei
36+
37+ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_F)$(ARCH_D)$(ARCH_C)$(zicsr_zifencei-y) -mabi=$(ABI) \
38 -mcmodel=$(CMODEL)
39
40 PLATFORM_CPPFLAGS += $(ARCH_FLAGS)
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 0bf1bef2c9..0000000000
--- a/meta/recipes-bsp/u-boot/files/0001-riscv32-Use-double-float-ABI-for-rv32.patch
+++ /dev/null
@@ -1,44 +0,0 @@
1From 66dfe0fa886f6289add06d1af8642ce2b5302852 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 9 Feb 2021 16:40:12 -0800
4Subject: [PATCH] riscv32: Use double-float ABI for rv32
5
6So it can use libgcc built with OE toolchain
7Fixes
8error: "can't link hard-float modules with soft-float modules"
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11Upstream-Status: Inappropriate [embedded specific]
12---
13 arch/riscv/Makefile | 6 ++++--
14 1 file changed, 4 insertions(+), 2 deletions(-)
15
16--- a/arch/riscv/Makefile
17+++ b/arch/riscv/Makefile
18@@ -5,11 +5,15 @@
19
20 ifeq ($(CONFIG_ARCH_RV64I),y)
21 ARCH_BASE = rv64im
22- ABI = lp64
23+ ABI = lp64d
24+ ARCH_D = d
25+ ARCH_F = f
26 endif
27 ifeq ($(CONFIG_ARCH_RV32I),y)
28 ARCH_BASE = rv32im
29- ABI = ilp32
30+ ABI = ilp32d
31+ ARCH_D = d
32+ ARCH_F = f
33 endif
34 ifeq ($(CONFIG_RISCV_ISA_A),y)
35 ARCH_A = a
36@@ -24,7 +28,7 @@ ifeq ($(CONFIG_CMODEL_MEDANY),y)
37 CMODEL = medany
38 endif
39
40-ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_C) -mabi=$(ABI) \
41+ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_F)$(ARCH_D)$(ARCH_C) -mabi=$(ABI) \
42 -mcmodel=$(CMODEL)
43
44 PLATFORM_CPPFLAGS += $(ARCH_FLAGS)
diff --git a/meta/recipes-bsp/u-boot/files/disable-CONFIG_BLOBLIST.cfg b/meta/recipes-bsp/u-boot/files/disable-CONFIG_BLOBLIST.cfg
new file mode 100644
index 0000000000..d01d3d12d8
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/files/disable-CONFIG_BLOBLIST.cfg
@@ -0,0 +1 @@
# CONFIG_BLOBLIST is not set
diff --git a/meta/recipes-bsp/u-boot/files/disable_CONFIG_USB.cfg b/meta/recipes-bsp/u-boot/files/disable_CONFIG_USB.cfg
new file mode 100644
index 0000000000..1d2509982b
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/files/disable_CONFIG_USB.cfg
@@ -0,0 +1 @@
# CONFIG_USB is not set
diff --git a/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_a.cfg b/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_a.cfg
new file mode 100644
index 0000000000..fc45b64480
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_a.cfg
@@ -0,0 +1 @@
CONFIG_RISCV_ISA_A=y
diff --git a/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_c.cfg b/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_c.cfg
new file mode 100644
index 0000000000..1cb459f636
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_c.cfg
@@ -0,0 +1 @@
CONFIG_RISCV_ISA_C=y
diff --git a/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_clear.cfg b/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_clear.cfg
new file mode 100644
index 0000000000..ce90da23ce
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_clear.cfg
@@ -0,0 +1,6 @@
1# CONFIG_RISCV_ISA_C is not set
2# CONFIG_RISCV_ISA_F is not set
3# CONFIG_RISCV_ISA_D is not set
4# CONFIG_RISCV_ISA_ZBB is not set
5# CONFIG_RISCV_ISA_A is not set
6# CONFIG_RISCV_ISA_ZICBOM is not set
diff --git a/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_d.cfg b/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_d.cfg
new file mode 100644
index 0000000000..fd25fa4e89
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_d.cfg
@@ -0,0 +1 @@
CONFIG_RISCV_ISA_D=y
diff --git a/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_f.cfg b/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_f.cfg
new file mode 100644
index 0000000000..dfa9876f82
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_f.cfg
@@ -0,0 +1 @@
CONFIG_RISCV_ISA_F=y
diff --git a/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_zbb.cfg b/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_zbb.cfg
new file mode 100644
index 0000000000..2b71b016f8
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_zbb.cfg
@@ -0,0 +1 @@
CONFIG_RISCV_ISA_ZBB=y
diff --git a/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_zicbom.cfg b/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_zicbom.cfg
new file mode 100644
index 0000000000..96daf04b20
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_zicbom.cfg
@@ -0,0 +1 @@
CONFIG_RISCV_ISA_ZICBOM=y
diff --git a/meta/recipes-bsp/u-boot/libubootenv/0001-Update-cmake_minimum_required-to-3.5.patch b/meta/recipes-bsp/u-boot/libubootenv/0001-Update-cmake_minimum_required-to-3.5.patch
new file mode 100644
index 0000000000..ee174ca59e
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/libubootenv/0001-Update-cmake_minimum_required-to-3.5.patch
@@ -0,0 +1,50 @@
1From cd12d9dd2bea8e4580f458df77229477fc55ba70 Mon Sep 17 00:00:00 2001
2From: James Hilliard <james.hilliard1@gmail.com>
3Date: Wed, 14 May 2025 14:17:40 -0600
4Subject: [PATCH] Update cmake_minimum_required to 3.5
5
6This supports compilation with cmake-4.0.0.
7
8Fixes:
9CMake Error at CMakeLists.txt:5 (cmake_minimum_required):
10 Compatibility with CMake < 3.5 has been removed from CMake.
11
12 Update the VERSION argument <min> value. Or, use the <min>...<max> syntax
13 to tell CMake that the project requires at least <min> but has been updated
14 to work with policies introduced by <max> or earlier.
15
16 Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
17
18Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
19Upstream-Status: Backport [cd12d9dd2bea8e4580f458df77229477fc55ba70]
20---
21 CMakeLists.txt | 2 +-
22 src/CMakeLists.txt | 2 +-
23 2 files changed, 2 insertions(+), 2 deletions(-)
24
25diff --git a/CMakeLists.txt b/CMakeLists.txt
26index 796d7bc..0a11730 100644
27--- a/CMakeLists.txt
28+++ b/CMakeLists.txt
29@@ -2,7 +2,7 @@
30 #
31 # SPDX-License-Identifier: LGPL-2.1-or-later
32
33-cmake_minimum_required (VERSION 2.6)
34+cmake_minimum_required (VERSION 3.5)
35 project (libubootenv C)
36
37 # The version number.
38diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
39index c56d0c7..3370232 100644
40--- a/src/CMakeLists.txt
41+++ b/src/CMakeLists.txt
42@@ -1,7 +1,7 @@
43 # SPDX-FileCopyrightText: 2019-2021 Stefano Babic <stefano.babic@swupdate.org>
44 #
45 # SPDX-License-Identifier: LGPL-2.1-or-later
46-cmake_minimum_required (VERSION 2.6)
47+cmake_minimum_required (VERSION 3.5)
48 # Sources and private headers
49 SET(libubootenv_SOURCES
50 uboot_env.c
diff --git a/meta/recipes-bsp/u-boot/libubootenv_0.3.3.bb b/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb
index 55f91b6f05..b63b8ff87d 100644
--- a/meta/recipes-bsp/u-boot/libubootenv_0.3.3.bb
+++ b/meta/recipes-bsp/u-boot/libubootenv_0.3.6.bb
@@ -10,16 +10,16 @@ LICENSE = "LGPL-2.1-or-later"
10LIC_FILES_CHKSUM = "file://LICENSES/LGPL-2.1-or-later.txt;md5=4fbd65380cdd255951079008b364516c" 10LIC_FILES_CHKSUM = "file://LICENSES/LGPL-2.1-or-later.txt;md5=4fbd65380cdd255951079008b364516c"
11SECTION = "libs" 11SECTION = "libs"
12 12
13SRC_URI = "git://github.com/sbabic/libubootenv;protocol=https;branch=master" 13SRC_URI = "git://github.com/sbabic/libubootenv;protocol=https;branch=master \
14SRCREV = "108100622160bb0c7ef4b6186230fe1f26402791" 14 file://0001-Update-cmake_minimum_required-to-3.5.patch \
15 15 "
16S = "${WORKDIR}/git" 16SRCREV = "5507339628b5caf244e1ff9d58cb3fa534b16beb"
17 17
18inherit cmake lib_package 18inherit cmake lib_package
19 19
20EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release" 20EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release"
21 21
22DEPENDS = "zlib" 22DEPENDS = "zlib libyaml"
23PROVIDES += "u-boot-fw-utils" 23PROVIDES += "u-boot-fw-utils"
24RPROVIDES:${PN}-bin += "u-boot-fw-utils" 24RPROVIDES:${PN}-bin += "u-boot-fw-utils"
25 25
diff --git a/meta/recipes-bsp/u-boot/u-boot-common.inc b/meta/recipes-bsp/u-boot/u-boot-common.inc
index d7fd3c7227..8600d4bab6 100644
--- a/meta/recipes-bsp/u-boot/u-boot-common.inc
+++ b/meta/recipes-bsp/u-boot/u-boot-common.inc
@@ -4,7 +4,7 @@ ARM, MIPS and several other processors, which can be installed in a boot \
4ROM and used to initialize and test the hardware or to download and run \ 4ROM and used to initialize and test the hardware or to download and run \
5application code." 5application code."
6SECTION = "bootloaders" 6SECTION = "bootloaders"
7DEPENDS += "flex-native bison-native" 7DEPENDS += "flex-native bison-native python3-setuptools-native"
8 8
9LICENSE = "GPL-2.0-or-later" 9LICENSE = "GPL-2.0-or-later"
10LIC_FILES_CHKSUM = "file://Licenses/README;md5=2ca5f2c35c8cc335f0a19756634782f1" 10LIC_FILES_CHKSUM = "file://Licenses/README;md5=2ca5f2c35c8cc335f0a19756634782f1"
@@ -12,11 +12,22 @@ PE = "1"
12 12
13# We use the revision in order to avoid having to fetch it from the 13# We use the revision in order to avoid having to fetch it from the
14# repo during parse 14# repo during parse
15SRCREV = "e092e3250270a1016c877da7bdd9384f14b1321e" 15SRCREV = "34820924edbc4ec7803eb89d9852f4b870fa760a"
16 16
17SRC_URI = "git://source.denx.de/u-boot/u-boot.git;protocol=https;branch=master" 17SRC_URI = "git://source.denx.de/u-boot/u-boot.git;protocol=https;branch=master;tag=v${PV}"
18
19SRC_URI_RISCV = "\
20 file://u-boot-riscv-isa_clear.cfg \
21 ${@bb.utils.contains ("TUNE_FEATURES", "a", "file://u-boot-riscv-isa_a.cfg", "", d)} \
22 ${@bb.utils.contains ("TUNE_FEATURES", "f", "file://u-boot-riscv-isa_f.cfg", "", d)} \
23 ${@bb.utils.contains ("TUNE_FEATURES", "d", "file://u-boot-riscv-isa_d.cfg", "", d)} \
24 ${@bb.utils.contains_any("TUNE_FEATURES", "b zbb", "file://u-boot-riscv-isa_zbb.cfg", "", d)} \
25 ${@bb.utils.contains ("TUNE_FEATURES", "zicbom", "file://u-boot-riscv-isa_zicbom.cfg", "", d)} \
26 "
27
28SRC_URI:append:riscv32 = "${SRC_URI_RISCV}"
29SRC_URI:append:riscv64 = "${SRC_URI_RISCV}"
18 30
19S = "${WORKDIR}/git"
20B = "${WORKDIR}/build" 31B = "${WORKDIR}/build"
21 32
22inherit pkgconfig 33inherit pkgconfig
diff --git a/meta/recipes-bsp/u-boot/u-boot-configure.inc b/meta/recipes-bsp/u-boot/u-boot-configure.inc
index 04e0894752..a15511f8b2 100644
--- a/meta/recipes-bsp/u-boot/u-boot-configure.inc
+++ b/meta/recipes-bsp/u-boot/u-boot-configure.inc
@@ -8,6 +8,8 @@ inherit uboot-config cml1
8 8
9DEPENDS += "kern-tools-native" 9DEPENDS += "kern-tools-native"
10 10
11CONFIGURE_FILES = "${@d.getVar('UBOOT_MACHINE') or '.config'}"
12
11do_configure () { 13do_configure () {
12 if [ -n "${UBOOT_CONFIG}" ]; then 14 if [ -n "${UBOOT_CONFIG}" ]; then
13 unset i j 15 unset i j
@@ -16,24 +18,35 @@ do_configure () {
16 for type in ${UBOOT_CONFIG}; do 18 for type in ${UBOOT_CONFIG}; do
17 j=$(expr $j + 1); 19 j=$(expr $j + 1);
18 if [ $j -eq $i ]; then 20 if [ $j -eq $i ]; then
19 oe_runmake -C ${S} O=${B}/${config} ${config} 21 uboot_configure_config $config $type
20 if [ -n "${@' '.join(find_cfgs(d))}" ]; then
21 merge_config.sh -m -O ${B}/${config} ${B}/${config}/.config ${@" ".join(find_cfgs(d))}
22 oe_runmake -C ${S} O=${B}/${config} oldconfig
23 fi
24 fi 22 fi
25 done 23 done
26 unset j 24 unset j
27 done 25 done
28 unset i 26 unset i
29 DEVTOOL_DISABLE_MENUCONFIG=true
30 else 27 else
31 if [ -n "${UBOOT_MACHINE}" ]; then 28 uboot_configure
32 oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE} 29 fi
33 else 30}
34 oe_runmake -C ${S} O=${B} oldconfig 31
35 fi 32uboot_configure_config () {
36 merge_config.sh -m .config ${@" ".join(find_cfgs(d))} 33 config=$1
37 cml1_do_configure 34 type=$2
35
36 oe_runmake -C ${S} O=${B}/${config} ${config}
37 if [ -n "${@' '.join(find_cfgs(d))}" ]; then
38 merge_config.sh -m -O ${B}/${config} ${B}/${config}/.config ${@" ".join(find_cfgs(d))}
39 oe_runmake -C ${S} O=${B}/${config} oldconfig
40 fi
41}
42
43uboot_configure () {
44 if [ -n "${UBOOT_MACHINE}" ]; then
45 oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE}
46 else
47 oe_runmake -C ${S} O=${B} oldconfig
38 fi 48 fi
49 merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
50 cml1_do_configure
39} 51}
52
diff --git a/meta/recipes-bsp/u-boot/u-boot-tools.inc b/meta/recipes-bsp/u-boot/u-boot-tools.inc
index 0bdbce725a..4e4f7fa092 100644
--- a/meta/recipes-bsp/u-boot/u-boot-tools.inc
+++ b/meta/recipes-bsp/u-boot/u-boot-tools.inc
@@ -2,12 +2,12 @@ SUMMARY = "U-Boot bootloader tools"
2DEPENDS += "gnutls openssl util-linux swig-native" 2DEPENDS += "gnutls openssl util-linux swig-native"
3 3
4inherit python3native 4inherit python3native
5export STAGING_INCDIR="${STAGING_INCDIR_NATIVE}" 5export STAGING_INCDIR = "${STAGING_INCDIR_NATIVE}"
6 6
7PROVIDES = "${MLPREFIX}u-boot-mkimage ${MLPREFIX}u-boot-mkenvimage" 7PROVIDES = "${MLPREFIX}u-boot-mkimage ${MLPREFIX}u-boot-mkenvimage ${MLPREFIX}u-boot-mkeficapsule"
8PROVIDES:class-native = "u-boot-mkimage-native u-boot-mkenvimage-native" 8PROVIDES:class-native = "u-boot-mkimage-native u-boot-mkenvimage-native u-boot-mkeficapsule-native"
9 9
10PACKAGES += "${PN}-mkimage ${PN}-mkenvimage" 10PACKAGES += "${PN}-mkimage ${PN}-mkenvimage ${PN}-mkeficapsule"
11 11
12# Required for backward compatibility with "u-boot-mkimage-xxx.bb" 12# Required for backward compatibility with "u-boot-mkimage-xxx.bb"
13RPROVIDES:${PN}-mkimage = "u-boot-mkimage" 13RPROVIDES:${PN}-mkimage = "u-boot-mkimage"
@@ -24,6 +24,7 @@ SED_CONFIG_EFI:x86-64 = ''
24SED_CONFIG_EFI:arm = '' 24SED_CONFIG_EFI:arm = ''
25SED_CONFIG_EFI:armeb = '' 25SED_CONFIG_EFI:armeb = ''
26SED_CONFIG_EFI:aarch64 = '' 26SED_CONFIG_EFI:aarch64 = ''
27SED_CONFIG_EFI:loongarch64 = ''
27 28
28do_compile () { 29do_compile () {
29 # Yes, this is crazy. If you build on a system with git < 2.14 from scratch, the tree will 30 # Yes, this is crazy. If you build on a system with git < 2.14 from scratch, the tree will
@@ -69,15 +70,20 @@ do_install () {
69 # fit_check_sign 70 # fit_check_sign
70 install -m 0755 tools/fit_check_sign ${D}${bindir}/uboot-fit_check_sign 71 install -m 0755 tools/fit_check_sign ${D}${bindir}/uboot-fit_check_sign
71 ln -sf uboot-fit_check_sign ${D}${bindir}/fit_check_sign 72 ln -sf uboot-fit_check_sign ${D}${bindir}/fit_check_sign
73
74 # mkeficapsule
75 install -m 0755 tools/mkeficapsule ${D}${bindir}/uboot-mkeficapsule
76 ln -sf uboot-mkeficapsule ${D}${bindir}/mkeficapsule
72} 77}
73 78
74ALLOW_EMPTY:${PN} = "1" 79ALLOW_EMPTY:${PN} = "1"
75FILES:${PN} = "" 80FILES:${PN} = ""
76FILES:${PN}-mkimage = "${bindir}/uboot-mkimage ${bindir}/mkimage ${bindir}/uboot-dumpimage ${bindir}/dumpimage ${bindir}/uboot-fit_check_sign ${bindir}/fit_check_sign" 81FILES:${PN}-mkimage = "${bindir}/uboot-mkimage ${bindir}/mkimage ${bindir}/uboot-dumpimage ${bindir}/dumpimage ${bindir}/uboot-fit_check_sign ${bindir}/fit_check_sign"
77FILES:${PN}-mkenvimage = "${bindir}/uboot-mkenvimage ${bindir}/mkenvimage" 82FILES:${PN}-mkenvimage = "${bindir}/uboot-mkenvimage ${bindir}/mkenvimage"
83FILES:${PN}-mkeficapsule = "${bindir}/uboot-mkeficapsule ${bindir}/mkeficapsule"
78 84
79RDEPENDS:${PN}-mkimage += "dtc" 85RDEPENDS:${PN}-mkimage += "dtc"
80RDEPENDS:${PN} += "${PN}-mkimage ${PN}-mkenvimage" 86RDEPENDS:${PN} += "${PN}-mkimage ${PN}-mkenvimage ${PN}-mkeficapsule"
81RDEPENDS:${PN}:class-native = "" 87RDEPENDS:${PN}:class-native = ""
82 88
83BBCLASSEXTEND = "native nativesdk" 89BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-bsp/u-boot/u-boot-tools_2022.07.bb b/meta/recipes-bsp/u-boot/u-boot-tools_2025.04.bb
index ef386f76e6..7eaf721ca8 100644
--- a/meta/recipes-bsp/u-boot/u-boot-tools_2022.07.bb
+++ b/meta/recipes-bsp/u-boot/u-boot-tools_2025.04.bb
@@ -1,3 +1,2 @@
1require u-boot-common.inc 1require u-boot-common.inc
2require u-boot-tools.inc 2require u-boot-tools.inc
3
diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
index f022aed732..b7242de5de 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -5,11 +5,12 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
5 5
6DEPENDS += "${@bb.utils.contains('UBOOT_ENV_SUFFIX', 'scr', 'u-boot-mkimage-native', '', d)}" 6DEPENDS += "${@bb.utils.contains('UBOOT_ENV_SUFFIX', 'scr', 'u-boot-mkimage-native', '', d)}"
7 7
8inherit uboot-config uboot-extlinux-config uboot-sign deploy cml1 python3native kernel-arch 8inherit uboot-config uboot-extlinux-config uboot-sign deploy python3native kernel-arch
9 9
10DEPENDS += "swig-native" 10DEPENDS += "swig-native"
11 11
12EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}" V=1' 12EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} V=1'
13EXTRA_OEMAKE += 'CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS} ${DEBUG_PREFIX_MAP}"'
13EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"' 14EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'
14EXTRA_OEMAKE += 'STAGING_INCDIR=${STAGING_INCDIR_NATIVE} STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}' 15EXTRA_OEMAKE += 'STAGING_INCDIR=${STAGING_INCDIR_NATIVE} STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}'
15 16
@@ -19,18 +20,21 @@ PACKAGECONFIG ??= "openssl"
19# a host build dependency. 20# a host build dependency.
20PACKAGECONFIG[openssl] = ",,openssl-native" 21PACKAGECONFIG[openssl] = ",,openssl-native"
21 22
23CVE_PRODUCT = "denx:u-boot"
24
22# Allow setting an additional version string that will be picked up by the 25# Allow setting an additional version string that will be picked up by the
23# u-boot build system and appended to the u-boot version. If the .scmversion 26# u-boot build system and appended to the u-boot version. If the .scmversion
24# file already exists it will not be overwritten. 27# file already exists it will not be overwritten.
25UBOOT_LOCALVERSION ?= "" 28UBOOT_LOCALVERSION ?= ""
26 29
30# Default name of u-boot initial env, but enable individual recipes to change
31# this value.
32UBOOT_INITIAL_ENV ?= "${PN}-initial-env"
33
27require u-boot-configure.inc 34require u-boot-configure.inc
28 35
36UBOOT_ARCH_DIR = "${@'arm' if d.getVar('UBOOT_ARCH').startswith('arm') else d.getVar('UBOOT_ARCH')}"
29do_compile () { 37do_compile () {
30 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'ld-is-gold', d)}" ]; then
31 sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' ${S}/config.mk
32 fi
33
34 unset LDFLAGS 38 unset LDFLAGS
35 unset CFLAGS 39 unset CFLAGS
36 unset CPPFLAGS 40 unset CPPFLAGS
@@ -43,45 +47,66 @@ do_compile () {
43 47
44 if [ -n "${UBOOT_CONFIG}" -o -n "${UBOOT_DELTA_CONFIG}" ] 48 if [ -n "${UBOOT_CONFIG}" -o -n "${UBOOT_DELTA_CONFIG}" ]
45 then 49 then
46 unset i j k 50 unset i j
47 for config in ${UBOOT_MACHINE}; do 51 for config in ${UBOOT_MACHINE}; do
48 i=$(expr $i + 1); 52 i=$(expr $i + 1);
49 for type in ${UBOOT_CONFIG}; do 53 for type in ${UBOOT_CONFIG}; do
50 j=$(expr $j + 1); 54 j=$(expr $j + 1);
51 if [ $j -eq $i ] 55 if [ $j -eq $i ]
52 then 56 then
53 oe_runmake -C ${S} O=${B}/${config} ${UBOOT_MAKE_TARGET} 57 uboot_compile_config $i $config $type
54 for binary in ${UBOOT_BINARIES}; do
55 k=$(expr $k + 1);
56 if [ $k -eq $i ]; then
57 cp ${B}/${config}/${binary} ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX}
58 fi
59 done
60
61 # Generate the uboot-initial-env
62 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
63 oe_runmake -C ${S} O=${B}/${config} u-boot-initial-env
64 cp ${B}/${config}/u-boot-initial-env ${B}/${config}/u-boot-initial-env-${type}
65 fi
66
67 unset k
68 fi 58 fi
69 done 59 done
70 unset j 60 unset j
71 done 61 done
72 unset i 62 unset i
73 else 63 else
74 oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_TARGET} 64 uboot_compile
75
76 # Generate the uboot-initial-env
77 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
78 oe_runmake -C ${S} O=${B} u-boot-initial-env
79 fi
80 fi 65 fi
81 66
82 if [ -n "${UBOOT_ENV}" ] && [ "${UBOOT_ENV_SUFFIX}" = "scr" ] 67 if [ -n "${UBOOT_ENV}" ] && [ "${UBOOT_ENV_SUFFIX}" = "scr" ]
83 then 68 then
84 ${UBOOT_MKIMAGE} -C none -A ${UBOOT_ARCH} -T script -d ${WORKDIR}/${UBOOT_ENV_SRC} ${WORKDIR}/${UBOOT_ENV_BINARY} 69 ${UBOOT_MKIMAGE} -C none -A ${UBOOT_ARCH} -T script -d ${UNPACKDIR}/${UBOOT_ENV_SRC} ${B}/${UBOOT_ENV_BINARY}
70 fi
71}
72
73uboot_compile_config () {
74 i=$1
75 config=$2
76 type=$3
77
78 oe_runmake -C ${S} O=${B}/${config} ${UBOOT_MAKE_TARGET}
79
80 unset k
81 for binary in ${UBOOT_BINARIES}; do
82 k=$(expr $k + 1);
83 if [ $k -eq $i ]; then
84 uboot_compile_config_copy_binary $config $type $binary
85 fi
86 done
87 unset k
88
89 # Generate the uboot-initial-env
90 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
91 oe_runmake -C ${S} O=${B}/${config} u-boot-initial-env
92 cp ${B}/${config}/u-boot-initial-env ${B}/${config}/u-boot-initial-env-${type}
93 fi
94}
95
96uboot_compile_config_copy_binary () {
97 config=$1
98 type=$2
99 binary=$3
100
101 cp ${B}/${config}/${binary} ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX}
102}
103
104uboot_compile () {
105 oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_TARGET}
106
107 # Generate the uboot-initial-env
108 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
109 oe_runmake -C ${S} O=${B} u-boot-initial-env
85 fi 110 fi
86} 111}
87 112
@@ -94,32 +119,14 @@ do_install () {
94 j=$(expr $j + 1); 119 j=$(expr $j + 1);
95 if [ $j -eq $i ] 120 if [ $j -eq $i ]
96 then 121 then
97 install -D -m 644 ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} 122 uboot_install_config $config $type
98 ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type}
99 ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}
100
101 # Install the uboot-initial-env
102 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
103 install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR}
104 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}
105 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${type}
106 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}
107 fi
108 fi 123 fi
109 done 124 done
110 unset j 125 unset j
111 done 126 done
112 unset i 127 unset i
113 else 128 else
114 install -D -m 644 ${B}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE} 129 uboot_install
115 ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY}
116
117 # Install the uboot-initial-env
118 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
119 install -D -m 644 ${B}/u-boot-initial-env ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR}
120 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}
121 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}
122 fi
123 fi 130 fi
124 131
125 if [ -n "${UBOOT_ELF}" ] 132 if [ -n "${UBOOT_ELF}" ]
@@ -132,23 +139,20 @@ do_install () {
132 j=$(expr $j + 1); 139 j=$(expr $j + 1);
133 if [ $j -eq $i ] 140 if [ $j -eq $i ]
134 then 141 then
135 install -m 644 ${B}/${config}/${UBOOT_ELF} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} 142 uboot_install_elf_config $config $type
136 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type}
137 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}
138 fi 143 fi
139 done 144 done
140 unset j 145 unset j
141 done 146 done
142 unset i 147 unset i
143 else 148 else
144 install -m 644 ${B}/${UBOOT_ELF} ${D}/boot/${UBOOT_ELF_IMAGE} 149 uboot_install_elf
145 ln -sf ${UBOOT_ELF_IMAGE} ${D}/boot/${UBOOT_ELF_BINARY}
146 fi 150 fi
147 fi 151 fi
148 152
149 if [ -e ${WORKDIR}/fw_env.config ] ; then 153 if [ -e ${UNPACKDIR}/fw_env.config ] ; then
150 install -d ${D}${sysconfdir} 154 install -d ${D}${sysconfdir}
151 install -m 644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config 155 install -m 644 ${UNPACKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
152 fi 156 fi
153 157
154 if [ -n "${SPL_BINARY}" ] 158 if [ -n "${SPL_BINARY}" ]
@@ -161,23 +165,20 @@ do_install () {
161 j=$(expr $j + 1); 165 j=$(expr $j + 1);
162 if [ $j -eq $i ] 166 if [ $j -eq $i ]
163 then 167 then
164 install -m 644 ${B}/${config}/${SPL_BINARY} ${D}/boot/${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} 168 uboot_install_spl_config $config $type
165 ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${D}/boot/${SPL_BINARYFILE}-${type}
166 ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${D}/boot/${SPL_BINARYFILE}
167 fi 169 fi
168 done 170 done
169 unset j 171 unset j
170 done 172 done
171 unset i 173 unset i
172 else 174 else
173 install -m 644 ${B}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE} 175 uboot_install_spl
174 ln -sf ${SPL_IMAGE} ${D}/boot/${SPL_BINARYFILE}
175 fi 176 fi
176 fi 177 fi
177 178
178 if [ -n "${UBOOT_ENV}" ] 179 if [ -n "${UBOOT_ENV}" ]
179 then 180 then
180 install -m 644 ${WORKDIR}/${UBOOT_ENV_BINARY} ${D}/boot/${UBOOT_ENV_IMAGE} 181 install -m 644 ${B}/${UBOOT_ENV_BINARY} ${D}/boot/${UBOOT_ENV_IMAGE}
181 ln -sf ${UBOOT_ENV_IMAGE} ${D}/boot/${UBOOT_ENV_BINARY} 182 ln -sf ${UBOOT_ENV_IMAGE} ${D}/boot/${UBOOT_ENV_BINARY}
182 fi 183 fi
183 184
@@ -187,6 +188,63 @@ do_install () {
187 fi 188 fi
188} 189}
189 190
191uboot_install_config () {
192 config=$1
193 type=$2
194
195 install -D -m 644 ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARYNAME}-${type}-${UBOOT_VERSION}.${UBOOT_SUFFIX}
196 ln -sf ${UBOOT_BINARYNAME}-${type}-${UBOOT_VERSION}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type}
197 ln -sf ${UBOOT_BINARYNAME}-${type}-${UBOOT_VERSION}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}
198
199 # Install the uboot-initial-env
200 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
201 install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${UBOOT_VERSION}
202 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${UBOOT_VERSION} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}
203 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${UBOOT_VERSION} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${type}
204 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${UBOOT_VERSION} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}
205 fi
206}
207
208uboot_install () {
209 install -D -m 644 ${B}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
210 ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY}
211
212 # Install the uboot-initial-env
213 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
214 install -D -m 644 ${B}/u-boot-initial-env ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${UBOOT_VERSION}
215 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${UBOOT_VERSION} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}
216 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${UBOOT_VERSION} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}
217 fi
218}
219
220uboot_install_elf_config () {
221 config=$1
222 type=$2
223
224 install -m 644 ${B}/${config}/${UBOOT_ELF} ${D}/boot/u-boot-${type}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX}
225 ln -sf u-boot-${type}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type}
226 ln -sf u-boot-${type}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}
227}
228
229uboot_install_elf () {
230 install -m 644 ${B}/${UBOOT_ELF} ${D}/boot/${UBOOT_ELF_IMAGE}
231 ln -sf ${UBOOT_ELF_IMAGE} ${D}/boot/${UBOOT_ELF_BINARY}
232}
233
234uboot_install_spl_config () {
235 config=$1
236 type=$2
237
238 install -m 644 ${B}/${config}/${SPL_BINARY} ${D}/boot/${SPL_BINARYNAME}-${type}-${UBOOT_VERSION}${SPL_DELIMITER}${SPL_SUFFIX}
239 ln -sf ${SPL_BINARYNAME}-${type}-${UBOOT_VERSION}${SPL_DELIMITER}${SPL_SUFFIX} ${D}/boot/${SPL_BINARYFILE}-${type}
240 ln -sf ${SPL_BINARYNAME}-${type}-${UBOOT_VERSION}${SPL_DELIMITER}${SPL_SUFFIX} ${D}/boot/${SPL_BINARYFILE}
241}
242
243uboot_install_spl () {
244 install -m 644 ${B}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE}
245 ln -sf ${SPL_IMAGE} ${D}/boot/${SPL_BINARYFILE}
246}
247
190PACKAGE_BEFORE_PN += "${PN}-env ${PN}-extlinux" 248PACKAGE_BEFORE_PN += "${PN}-env ${PN}-extlinux"
191 249
192RPROVIDES:${PN}-env += "u-boot-default-env" 250RPROVIDES:${PN}-env += "u-boot-default-env"
@@ -199,59 +257,35 @@ FILES:${PN}-env = " \
199FILES:${PN}-extlinux = "${UBOOT_EXTLINUX_INSTALL_DIR}/${UBOOT_EXTLINUX_CONF_NAME}" 257FILES:${PN}-extlinux = "${UBOOT_EXTLINUX_INSTALL_DIR}/${UBOOT_EXTLINUX_CONF_NAME}"
200RDEPENDS:${PN} += "${@bb.utils.contains('UBOOT_EXTLINUX', '1', '${PN}-extlinux', '', d)}" 258RDEPENDS:${PN} += "${@bb.utils.contains('UBOOT_EXTLINUX', '1', '${PN}-extlinux', '', d)}"
201 259
260SYSROOT_DIRS += "/boot"
202FILES:${PN} = "/boot ${datadir}" 261FILES:${PN} = "/boot ${datadir}"
203RDEPENDS:${PN} += "${PN}-env" 262RDEPENDS:${PN} += "${PN}-env"
204 263
205do_deploy () { 264do_deploy () {
206 if [ -n "${UBOOT_CONFIG}" ] 265 if [ -n "${UBOOT_CONFIG}" ]
207 then 266 then
267 unset i j
208 for config in ${UBOOT_MACHINE}; do 268 for config in ${UBOOT_MACHINE}; do
209 i=$(expr $i + 1); 269 i=$(expr $i + 1);
210 for type in ${UBOOT_CONFIG}; do 270 for type in ${UBOOT_CONFIG}; do
211 j=$(expr $j + 1); 271 j=$(expr $j + 1);
212 if [ $j -eq $i ] 272 if [ $j -eq $i ]
213 then 273 then
214 install -D -m 644 ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} 274 uboot_deploy_config $config $type
215 cd ${DEPLOYDIR}
216 ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}-${type}
217 ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}
218 ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}-${type}
219 ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}
220
221 # Deploy the uboot-initial-env
222 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
223 install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR}
224 cd ${DEPLOYDIR}
225 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}
226 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${type}
227 fi
228 fi 275 fi
229 done 276 done
230 unset j 277 unset j
231 done 278 done
232 unset i 279 unset i
233 else 280 else
234 install -D -m 644 ${B}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE} 281 uboot_deploy
235
236 cd ${DEPLOYDIR}
237 rm -f ${UBOOT_BINARY} ${UBOOT_SYMLINK}
238 ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK}
239 ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY}
240
241 # Deploy the uboot-initial-env
242 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
243 install -D -m 644 ${B}/u-boot-initial-env ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR}
244 cd ${DEPLOYDIR}
245 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${UBOOT_INITIAL_ENV}-${MACHINE}
246 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${UBOOT_INITIAL_ENV}
247 fi
248 fi 282 fi
249 283
250 if [ -e ${WORKDIR}/fw_env.config ] ; then 284 if [ -e ${UNPACKDIR}/fw_env.config ] ; then
251 install -D -m 644 ${WORKDIR}/fw_env.config ${DEPLOYDIR}/fw_env.config-${MACHINE}-${PV}-${PR} 285 install -D -m 644 ${UNPACKDIR}/fw_env.config ${DEPLOYDIR}/fw_env.config-${MACHINE}-${UBOOT_VERSION}
252 cd ${DEPLOYDIR} 286 cd ${DEPLOYDIR}
253 ln -sf fw_env.config-${MACHINE}-${PV}-${PR} fw_env.config-${MACHINE} 287 ln -sf fw_env.config-${MACHINE}-${UBOOT_VERSION} fw_env.config-${MACHINE}
254 ln -sf fw_env.config-${MACHINE}-${PV}-${PR} fw_env.config 288 ln -sf fw_env.config-${MACHINE}-${UBOOT_VERSION} fw_env.config
255 fi 289 fi
256 290
257 if [ -n "${UBOOT_ELF}" ] 291 if [ -n "${UBOOT_ELF}" ]
@@ -264,24 +298,17 @@ do_deploy () {
264 j=$(expr $j + 1); 298 j=$(expr $j + 1);
265 if [ $j -eq $i ] 299 if [ $j -eq $i ]
266 then 300 then
267 install -m 644 ${B}/${config}/${UBOOT_ELF} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} 301 uboot_deploy_elf_config $config $type
268 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}-${type}
269 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}
270 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}-${type}
271 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}
272 fi 302 fi
273 done 303 done
274 unset j 304 unset j
275 done 305 done
276 unset i 306 unset i
277 else 307 else
278 install -m 644 ${B}/${UBOOT_ELF} ${DEPLOYDIR}/${UBOOT_ELF_IMAGE} 308 uboot_deploy_elf
279 ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}
280 ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}
281 fi 309 fi
282 fi 310 fi
283 311
284
285 if [ -n "${SPL_BINARY}" ] 312 if [ -n "${SPL_BINARY}" ]
286 then 313 then
287 if [ -n "${UBOOT_CONFIG}" ] 314 if [ -n "${UBOOT_CONFIG}" ]
@@ -292,30 +319,20 @@ do_deploy () {
292 j=$(expr $j + 1); 319 j=$(expr $j + 1);
293 if [ $j -eq $i ] 320 if [ $j -eq $i ]
294 then 321 then
295 install -m 644 ${B}/${config}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} 322 uboot_deploy_spl_config $config $type
296 rm -f ${DEPLOYDIR}/${SPL_BINARYFILE} ${DEPLOYDIR}/${SPL_SYMLINK}
297 ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_BINARYFILE}-${type}
298 ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_BINARYFILE}
299 ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_SYMLINK}-${type}
300 ln -sf ${SPL_BINARYNAME}-${type}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_SYMLINK}
301 fi 323 fi
302 done 324 done
303 unset j 325 unset j
304 done 326 done
305 unset i 327 unset i
306 else 328 else
307 install -m 644 ${B}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE} 329 uboot_deploy_spl
308 rm -f ${DEPLOYDIR}/${SPL_BINARYNAME} ${DEPLOYDIR}/${SPL_SYMLINK}
309 ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_BINARYNAME}
310 ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_SYMLINK}
311 fi 330 fi
312 fi 331 fi
313 332
314
315 if [ -n "${UBOOT_ENV}" ] 333 if [ -n "${UBOOT_ENV}" ]
316 then 334 then
317 install -m 644 ${WORKDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_IMAGE} 335 install -m 644 ${B}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_IMAGE}
318 rm -f ${DEPLOYDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK}
319 ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_BINARY} 336 ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_BINARY}
320 ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK} 337 ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK}
321 fi 338 fi
@@ -329,8 +346,80 @@ do_deploy () {
329 346
330 if [ -n "${UBOOT_DTB}" ] 347 if [ -n "${UBOOT_DTB}" ]
331 then 348 then
332 install -m 644 ${B}/arch/${UBOOT_ARCH}/dts/${UBOOT_DTB_BINARY} ${DEPLOYDIR}/ 349 install -m 644 ${B}/arch/${UBOOT_ARCH_DIR}/dts/${UBOOT_DTB_BINARY} ${DEPLOYDIR}/
333 fi 350 fi
334} 351}
335 352
353uboot_deploy_config () {
354 config=$1
355 type=$2
356
357 install -D -m 644 ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/${UBOOT_BINARYNAME}-${type}-${UBOOT_VERSION}.${UBOOT_SUFFIX}
358 cd ${DEPLOYDIR}
359 ln -sf ${UBOOT_BINARYNAME}-${type}-${UBOOT_VERSION}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}-${type}
360 ln -sf ${UBOOT_BINARYNAME}-${type}-${UBOOT_VERSION}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}
361 ln -sf ${UBOOT_BINARYNAME}-${type}-${UBOOT_VERSION}.${UBOOT_SUFFIX} ${UBOOT_BINARY}-${type}
362 ln -sf ${UBOOT_BINARYNAME}-${type}-${UBOOT_VERSION}.${UBOOT_SUFFIX} ${UBOOT_BINARY}
363
364 # Deploy the uboot-initial-env
365 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
366 install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${UBOOT_VERSION}
367 cd ${DEPLOYDIR}
368 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${UBOOT_VERSION} ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}
369 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${UBOOT_VERSION} ${UBOOT_INITIAL_ENV}-${type}
370 fi
371}
372
373uboot_deploy () {
374 install -D -m 644 ${B}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE}
375
376 cd ${DEPLOYDIR}
377 rm -f ${UBOOT_BINARY} ${UBOOT_SYMLINK}
378 ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK}
379 ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY}
380
381 # Deploy the uboot-initial-env
382 if [ -n "${UBOOT_INITIAL_ENV}" ]; then
383 install -D -m 644 ${B}/u-boot-initial-env ${DEPLOYDIR}/${UBOOT_INITIAL_ENV}-${MACHINE}-${UBOOT_VERSION}
384 cd ${DEPLOYDIR}
385 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${UBOOT_VERSION} ${UBOOT_INITIAL_ENV}-${MACHINE}
386 ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${UBOOT_VERSION} ${UBOOT_INITIAL_ENV}
387 fi
388}
389
390uboot_deploy_elf_config () {
391 config=$1
392 type=$2
393
394 install -m 644 ${B}/${config}/${UBOOT_ELF} ${DEPLOYDIR}/u-boot-${type}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX}
395 ln -sf u-boot-${type}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}-${type}
396 ln -sf u-boot-${type}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}
397 ln -sf u-boot-${type}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}-${type}
398 ln -sf u-boot-${type}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}
399}
400
401uboot_deploy_elf () {
402 install -m 644 ${B}/${UBOOT_ELF} ${DEPLOYDIR}/${UBOOT_ELF_IMAGE}
403 ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}
404 ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}
405}
406
407uboot_deploy_spl_config () {
408 config=$1
409 type=$2
410
411 install -m 644 ${B}/${config}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_BINARYNAME}-${type}-${UBOOT_VERSION}${SPL_DELIMITER}${SPL_SUFFIX}
412 rm -f ${DEPLOYDIR}/${SPL_BINARYFILE} ${DEPLOYDIR}/${SPL_SYMLINK}
413 ln -sf ${SPL_BINARYNAME}-${type}-${UBOOT_VERSION}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_BINARYFILE}-${type}
414 ln -sf ${SPL_BINARYNAME}-${type}-${UBOOT_VERSION}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_BINARYFILE}
415 ln -sf ${SPL_BINARYNAME}-${type}-${UBOOT_VERSION}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_SYMLINK}-${type}
416 ln -sf ${SPL_BINARYNAME}-${type}-${UBOOT_VERSION}${SPL_DELIMITER}${SPL_SUFFIX} ${DEPLOYDIR}/${SPL_SYMLINK}
417}
418
419uboot_deploy_spl () {
420 install -m 644 ${B}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE}
421 ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_BINARYNAME}
422 ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_SYMLINK}
423}
424
336addtask deploy before do_build after do_compile 425addtask deploy before do_build after do_compile
diff --git a/meta/recipes-bsp/u-boot/u-boot_2022.07.bb b/meta/recipes-bsp/u-boot/u-boot_2022.07.bb
deleted file mode 100644
index 1ae575790c..0000000000
--- a/meta/recipes-bsp/u-boot/u-boot_2022.07.bb
+++ /dev/null
@@ -1,9 +0,0 @@
1require u-boot-common.inc
2require u-boot.inc
3
4SRC_URI += " file://0001-riscv32-Use-double-float-ABI-for-rv32.patch \
5 file://0001-riscv-fix-build-with-binutils-2.38.patch \
6 "
7
8DEPENDS += "bc-native dtc-native python3-setuptools-native"
9
diff --git a/meta/recipes-bsp/u-boot/u-boot_2025.04.bb b/meta/recipes-bsp/u-boot/u-boot_2025.04.bb
new file mode 100644
index 0000000000..89e964f627
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/u-boot_2025.04.bb
@@ -0,0 +1,8 @@
1require u-boot-common.inc
2require u-boot.inc
3
4DEPENDS += "bc-native dtc-native gnutls-native python3-pyelftools-native"
5
6# workarounds for aarch64 kvm qemu boot regressions
7SRC_URI:append:qemuarm64 = " file://disable-CONFIG_BLOBLIST.cfg file://disable_CONFIG_USB.cfg"
8SRC_URI:append:genericarm64 = " file://disable-CONFIG_BLOBLIST.cfg file://disable_CONFIG_USB.cfg"
diff --git a/meta/recipes-bsp/usbinit/usbinit.bb b/meta/recipes-bsp/usbinit/usbinit.bb
deleted file mode 100644
index ffaca4b58d..0000000000
--- a/meta/recipes-bsp/usbinit/usbinit.bb
+++ /dev/null
@@ -1,25 +0,0 @@
1SUMMARY = "Initscript for enabling USB gadget Ethernet"
2DESCRIPTION = "This module allows ethernet emulation over USB, allowing for \
3all sorts of nifty things like SSH and NFS in one go plus charging over the \
4same wire, at higher speeds than most Wifi connections."
5HOMEPAGE = "http://linux-sunxi.org/USB_Gadget/Ethernet"
6
7LICENSE = "GPL-2.0-only"
8LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYING.GPL;md5=751419260aa954499f7abaabaa882bbe"
9
10PR = "r3"
11
12SRC_URI = "file://usb-gether \
13 file://COPYING.GPL"
14S = "${WORKDIR}"
15
16do_install() {
17 install -d ${D}${sysconfdir}
18 install -d ${D}${sysconfdir}/init.d
19 install usb-gether ${D}${sysconfdir}/init.d
20}
21
22inherit update-rc.d allarch
23
24INITSCRIPT_NAME = "usb-gether"
25INITSCRIPT_PARAMS = "start 99 5 2 . stop 20 0 1 6 ."
diff --git a/meta/recipes-bsp/usbinit/usbinit/COPYING.GPL b/meta/recipes-bsp/usbinit/usbinit/COPYING.GPL
deleted file mode 100644
index d511905c16..0000000000
--- a/meta/recipes-bsp/usbinit/usbinit/COPYING.GPL
+++ /dev/null
@@ -1,339 +0,0 @@
1 GNU GENERAL PUBLIC LICENSE
2 Version 2, June 1991
3
4 Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 Everyone is permitted to copy and distribute verbatim copies
7 of this license document, but changing it is not allowed.
8
9 Preamble
10
11 The licenses for most software are designed to take away your
12freedom to share and change it. By contrast, the GNU General Public
13License is intended to guarantee your freedom to share and change free
14software--to make sure the software is free for all its users. This
15General Public License applies to most of the Free Software
16Foundation's software and to any other program whose authors commit to
17using it. (Some other Free Software Foundation software is covered by
18the GNU Lesser General Public License instead.) You can apply it to
19your programs, too.
20
21 When we speak of free software, we are referring to freedom, not
22price. Our General Public Licenses are designed to make sure that you
23have the freedom to distribute copies of free software (and charge for
24this service if you wish), that you receive source code or can get it
25if you want it, that you can change the software or use pieces of it
26in new free programs; and that you know you can do these things.
27
28 To protect your rights, we need to make restrictions that forbid
29anyone to deny you these rights or to ask you to surrender the rights.
30These restrictions translate to certain responsibilities for you if you
31distribute copies of the software, or if you modify it.
32
33 For example, if you distribute copies of such a program, whether
34gratis or for a fee, you must give the recipients all the rights that
35you have. You must make sure that they, too, receive or can get the
36source code. And you must show them these terms so they know their
37rights.
38
39 We protect your rights with two steps: (1) copyright the software, and
40(2) offer you this license which gives you legal permission to copy,
41distribute and/or modify the software.
42
43 Also, for each author's protection and ours, we want to make certain
44that everyone understands that there is no warranty for this free
45software. If the software is modified by someone else and passed on, we
46want its recipients to know that what they have is not the original, so
47that any problems introduced by others will not reflect on the original
48authors' reputations.
49
50 Finally, any free program is threatened constantly by software
51patents. We wish to avoid the danger that redistributors of a free
52program will individually obtain patent licenses, in effect making the
53program proprietary. To prevent this, we have made it clear that any
54patent must be licensed for everyone's free use or not licensed at all.
55
56 The precise terms and conditions for copying, distribution and
57modification follow.
58
59 GNU GENERAL PUBLIC LICENSE
60 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
62 0. This License applies to any program or other work which contains
63a notice placed by the copyright holder saying it may be distributed
64under the terms of this General Public License. The "Program", below,
65refers to any such program or work, and a "work based on the Program"
66means either the Program or any derivative work under copyright law:
67that is to say, a work containing the Program or a portion of it,
68either verbatim or with modifications and/or translated into another
69language. (Hereinafter, translation is included without limitation in
70the term "modification".) Each licensee is addressed as "you".
71
72Activities other than copying, distribution and modification are not
73covered by this License; they are outside its scope. The act of
74running the Program is not restricted, and the output from the Program
75is covered only if its contents constitute a work based on the
76Program (independent of having been made by running the Program).
77Whether that is true depends on what the Program does.
78
79 1. You may copy and distribute verbatim copies of the Program's
80source code as you receive it, in any medium, provided that you
81conspicuously and appropriately publish on each copy an appropriate
82copyright notice and disclaimer of warranty; keep intact all the
83notices that refer to this License and to the absence of any warranty;
84and give any other recipients of the Program a copy of this License
85along with the Program.
86
87You may charge a fee for the physical act of transferring a copy, and
88you may at your option offer warranty protection in exchange for a fee.
89
90 2. You may modify your copy or copies of the Program or any portion
91of it, thus forming a work based on the Program, and copy and
92distribute such modifications or work under the terms of Section 1
93above, provided that you also meet all of these conditions:
94
95 a) You must cause the modified files to carry prominent notices
96 stating that you changed the files and the date of any change.
97
98 b) You must cause any work that you distribute or publish, that in
99 whole or in part contains or is derived from the Program or any
100 part thereof, to be licensed as a whole at no charge to all third
101 parties under the terms of this License.
102
103 c) If the modified program normally reads commands interactively
104 when run, you must cause it, when started running for such
105 interactive use in the most ordinary way, to print or display an
106 announcement including an appropriate copyright notice and a
107 notice that there is no warranty (or else, saying that you provide
108 a warranty) and that users may redistribute the program under
109 these conditions, and telling the user how to view a copy of this
110 License. (Exception: if the Program itself is interactive but
111 does not normally print such an announcement, your work based on
112 the Program is not required to print an announcement.)
113
114These requirements apply to the modified work as a whole. If
115identifiable sections of that work are not derived from the Program,
116and can be reasonably considered independent and separate works in
117themselves, then this License, and its terms, do not apply to those
118sections when you distribute them as separate works. But when you
119distribute the same sections as part of a whole which is a work based
120on the Program, the distribution of the whole must be on the terms of
121this License, whose permissions for other licensees extend to the
122entire whole, and thus to each and every part regardless of who wrote it.
123
124Thus, it is not the intent of this section to claim rights or contest
125your rights to work written entirely by you; rather, the intent is to
126exercise the right to control the distribution of derivative or
127collective works based on the Program.
128
129In addition, mere aggregation of another work not based on the Program
130with the Program (or with a work based on the Program) on a volume of
131a storage or distribution medium does not bring the other work under
132the scope of this License.
133
134 3. You may copy and distribute the Program (or a work based on it,
135under Section 2) in object code or executable form under the terms of
136Sections 1 and 2 above provided that you also do one of the following:
137
138 a) Accompany it with the complete corresponding machine-readable
139 source code, which must be distributed under the terms of Sections
140 1 and 2 above on a medium customarily used for software interchange; or,
141
142 b) Accompany it with a written offer, valid for at least three
143 years, to give any third party, for a charge no more than your
144 cost of physically performing source distribution, a complete
145 machine-readable copy of the corresponding source code, to be
146 distributed under the terms of Sections 1 and 2 above on a medium
147 customarily used for software interchange; or,
148
149 c) Accompany it with the information you received as to the offer
150 to distribute corresponding source code. (This alternative is
151 allowed only for noncommercial distribution and only if you
152 received the program in object code or executable form with such
153 an offer, in accord with Subsection b above.)
154
155The source code for a work means the preferred form of the work for
156making modifications to it. For an executable work, complete source
157code means all the source code for all modules it contains, plus any
158associated interface definition files, plus the scripts used to
159control compilation and installation of the executable. However, as a
160special exception, the source code distributed need not include
161anything that is normally distributed (in either source or binary
162form) with the major components (compiler, kernel, and so on) of the
163operating system on which the executable runs, unless that component
164itself accompanies the executable.
165
166If distribution of executable or object code is made by offering
167access to copy from a designated place, then offering equivalent
168access to copy the source code from the same place counts as
169distribution of the source code, even though third parties are not
170compelled to copy the source along with the object code.
171
172 4. You may not copy, modify, sublicense, or distribute the Program
173except as expressly provided under this License. Any attempt
174otherwise to copy, modify, sublicense or distribute the Program is
175void, and will automatically terminate your rights under this License.
176However, parties who have received copies, or rights, from you under
177this License will not have their licenses terminated so long as such
178parties remain in full compliance.
179
180 5. You are not required to accept this License, since you have not
181signed it. However, nothing else grants you permission to modify or
182distribute the Program or its derivative works. These actions are
183prohibited by law if you do not accept this License. Therefore, by
184modifying or distributing the Program (or any work based on the
185Program), you indicate your acceptance of this License to do so, and
186all its terms and conditions for copying, distributing or modifying
187the Program or works based on it.
188
189 6. Each time you redistribute the Program (or any work based on the
190Program), the recipient automatically receives a license from the
191original licensor to copy, distribute or modify the Program subject to
192these terms and conditions. You may not impose any further
193restrictions on the recipients' exercise of the rights granted herein.
194You are not responsible for enforcing compliance by third parties to
195this License.
196
197 7. If, as a consequence of a court judgment or allegation of patent
198infringement or for any other reason (not limited to patent issues),
199conditions are imposed on you (whether by court order, agreement or
200otherwise) that contradict the conditions of this License, they do not
201excuse you from the conditions of this License. If you cannot
202distribute so as to satisfy simultaneously your obligations under this
203License and any other pertinent obligations, then as a consequence you
204may not distribute the Program at all. For example, if a patent
205license would not permit royalty-free redistribution of the Program by
206all those who receive copies directly or indirectly through you, then
207the only way you could satisfy both it and this License would be to
208refrain entirely from distribution of the Program.
209
210If any portion of this section is held invalid or unenforceable under
211any particular circumstance, the balance of the section is intended to
212apply and the section as a whole is intended to apply in other
213circumstances.
214
215It is not the purpose of this section to induce you to infringe any
216patents or other property right claims or to contest validity of any
217such claims; this section has the sole purpose of protecting the
218integrity of the free software distribution system, which is
219implemented by public license practices. Many people have made
220generous contributions to the wide range of software distributed
221through that system in reliance on consistent application of that
222system; it is up to the author/donor to decide if he or she is willing
223to distribute software through any other system and a licensee cannot
224impose that choice.
225
226This section is intended to make thoroughly clear what is believed to
227be a consequence of the rest of this License.
228
229 8. If the distribution and/or use of the Program is restricted in
230certain countries either by patents or by copyrighted interfaces, the
231original copyright holder who places the Program under this License
232may add an explicit geographical distribution limitation excluding
233those countries, so that distribution is permitted only in or among
234countries not thus excluded. In such case, this License incorporates
235the limitation as if written in the body of this License.
236
237 9. The Free Software Foundation may publish revised and/or new versions
238of the General Public License from time to time. Such new versions will
239be similar in spirit to the present version, but may differ in detail to
240address new problems or concerns.
241
242Each version is given a distinguishing version number. If the Program
243specifies a version number of this License which applies to it and "any
244later version", you have the option of following the terms and conditions
245either of that version or of any later version published by the Free
246Software Foundation. If the Program does not specify a version number of
247this License, you may choose any version ever published by the Free Software
248Foundation.
249
250 10. If you wish to incorporate parts of the Program into other free
251programs whose distribution conditions are different, write to the author
252to ask for permission. For software which is copyrighted by the Free
253Software Foundation, write to the Free Software Foundation; we sometimes
254make exceptions for this. Our decision will be guided by the two goals
255of preserving the free status of all derivatives of our free software and
256of promoting the sharing and reuse of software generally.
257
258 NO WARRANTY
259
260 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268REPAIR OR CORRECTION.
269
270 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278POSSIBILITY OF SUCH DAMAGES.
279
280 END OF TERMS AND CONDITIONS
281
282 How to Apply These Terms to Your New Programs
283
284 If you develop a new program, and you want it to be of the greatest
285possible use to the public, the best way to achieve this is to make it
286free software which everyone can redistribute and change under these terms.
287
288 To do so, attach the following notices to the program. It is safest
289to attach them to the start of each source file to most effectively
290convey the exclusion of warranty; and each file should have at least
291the "copyright" line and a pointer to where the full notice is found.
292
293 <one line to give the program's name and a brief idea of what it does.>
294 Copyright (C) <year> <name of author>
295
296 This program is free software; you can redistribute it and/or modify
297 it under the terms of the GNU General Public License as published by
298 the Free Software Foundation; either version 2 of the License, or
299 (at your option) any later version.
300
301 This program is distributed in the hope that it will be useful,
302 but WITHOUT ANY WARRANTY; without even the implied warranty of
303 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 GNU General Public License for more details.
305
306 You should have received a copy of the GNU General Public License along
307 with this program; if not, write to the Free Software Foundation, Inc.,
308 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
310Also add information on how to contact you by electronic and paper mail.
311
312If the program is interactive, make it output a short notice like this
313when it starts in an interactive mode:
314
315 Gnomovision version 69, Copyright (C) year name of author
316 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 This is free software, and you are welcome to redistribute it
318 under certain conditions; type `show c' for details.
319
320The hypothetical commands `show w' and `show c' should show the appropriate
321parts of the General Public License. Of course, the commands you use may
322be called something other than `show w' and `show c'; they could even be
323mouse-clicks or menu items--whatever suits your program.
324
325You should also get your employer (if you work as a programmer) or your
326school, if any, to sign a "copyright disclaimer" for the program, if
327necessary. Here is a sample; alter the names:
328
329 Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
332 <signature of Ty Coon>, 1 April 1989
333 Ty Coon, President of Vice
334
335This General Public License does not permit incorporating your program into
336proprietary programs. If your program is a subroutine library, you may
337consider it more useful to permit linking proprietary applications with the
338library. If this is what you want to do, use the GNU Lesser General
339Public License instead of this License.
diff --git a/meta/recipes-bsp/usbinit/usbinit/usb-gether b/meta/recipes-bsp/usbinit/usbinit/usb-gether
deleted file mode 100755
index e80a0bb30e..0000000000
--- a/meta/recipes-bsp/usbinit/usbinit/usb-gether
+++ /dev/null
@@ -1,23 +0,0 @@
1#! /bin/sh
2#
3# usb-ether Start up the gadget usb ethernet interface.
4#
5
6case "$1" in
7 start|"")
8 test "$VERBOSE" != no && echo "Initializing g_ether gadget..."
9 modprobe g_ether
10 ifup usb0
11 ;;
12 stop)
13 test "$VERBOSE" != no && echo "Disabling g_ether..."
14 ifdown usb0
15 rmmod g_ether
16 ;;
17 *)
18 echo "Usage: usb-ether {start|stop}" >&2
19 exit 1
20 ;;
21esac
22
23exit 0
diff --git a/meta/recipes-bsp/usbutils/usbutils_014.bb b/meta/recipes-bsp/usbutils/usbutils_018.bb
index e728f1a190..b96a1b4f19 100644
--- a/meta/recipes-bsp/usbutils/usbutils_014.bb
+++ b/meta/recipes-bsp/usbutils/usbutils_018.bb
@@ -3,19 +3,21 @@ DESCRIPTION = "Contains the lsusb utility for inspecting the devices connected t
3HOMEPAGE = "http://www.linux-usb.org" 3HOMEPAGE = "http://www.linux-usb.org"
4SECTION = "base" 4SECTION = "base"
5 5
6LICENSE = "GPL-2.0-or-later & (GPL-2.0-only | GPL-3.0-only)" 6LICENSE = "GPL-2.0-or-later & (GPL-2.0-only | GPL-3.0-only) & CC0-1.0 & LGPL-2.1-or-later & MIT"
7# License files went missing in 010, when 011 is released add LICENSES/* back 7LIC_FILES_CHKSUM = "file://LICENSES/CC0-1.0.txt;md5=cf1af55fc6f5b9a23e12086005298dcd \
8LIC_FILES_CHKSUM = "file://lsusb.c;endline=1;md5=7226e442a172bcf25807246d7ef1eba1 \ 8 file://LICENSES/GPL-2.0-only.txt;md5=c89d4ad08368966d8df5a90ea96bebe4 \
9 file://lsusb.py.in;beginline=2;endline=2;md5=c443ada211d701156e42ea36d41625b3 \ 9 file://LICENSES/GPL-2.0-or-later.txt;md5=c89d4ad08368966d8df5a90ea96bebe4 \
10 " 10 file://LICENSES/GPL-3.0-only.txt;md5=050f496cfea7876fc13cdea643e041e0 \
11 11 file://LICENSES/LGPL-2.1-or-later.txt;md5=8c6e7513c570546f65ae570dae278c17 \
12 file://LICENSES/MIT.txt;md5=e8f57dd048e186199433be2c41bd3d6d \
13 "
12DEPENDS = "libusb1 virtual/libiconv udev" 14DEPENDS = "libusb1 virtual/libiconv udev"
13 15
14SRC_URI = "${KERNELORG_MIRROR}/linux/utils/usb/usbutils/usbutils-${PV}.tar.gz \ 16SRC_URI = "${KERNELORG_MIRROR}/linux/utils/usb/usbutils/usbutils-${PV}.tar.gz \
15 " 17 "
16SRC_URI[sha256sum] = "59398ab012888dfe0fd12e447b45f36801e9d7b71d9a865fc38e2f549afdb9d0" 18SRC_URI[sha256sum] = "0048d2d8518fb0cc7c0516e16e52af023e52b55ddb3b2068a77041b5ef285768"
17 19
18inherit autotools pkgconfig update-alternatives 20inherit meson pkgconfig update-alternatives
19 21
20ALTERNATIVE:${PN} = "lsusb" 22ALTERNATIVE:${PN} = "lsusb"
21ALTERNATIVE_PRIORITY = "100" 23ALTERNATIVE_PRIORITY = "100"
diff --git a/meta/recipes-bsp/v86d/v86d_0.1.10.bb b/meta/recipes-bsp/v86d/v86d_0.1.10.bb
index 5f342b1120..3bc9b24487 100644
--- a/meta/recipes-bsp/v86d/v86d_0.1.10.bb
+++ b/meta/recipes-bsp/v86d/v86d_0.1.10.bb
@@ -6,9 +6,7 @@ DESCRIPTION = "v86d provides a backend for kernel drivers that need to execute x
6LICENSE = "GPL-2.0-only" 6LICENSE = "GPL-2.0-only"
7LIC_FILES_CHKSUM = "file://README;md5=94ac1971e4f2309dc322d598e7b1f7dd" 7LIC_FILES_CHKSUM = "file://README;md5=94ac1971e4f2309dc322d598e7b1f7dd"
8 8
9DEPENDS = "virtual/kernel"
10RRECOMMENDS:${PN} = "kernel-module-uvesafb" 9RRECOMMENDS:${PN} = "kernel-module-uvesafb"
11PR = "r2"
12 10
13SRC_URI = "http://snapshot.debian.org/archive/debian/20110427T035506Z/pool/main/v/${BPN}/${BPN}_${PV}.orig.tar.gz \ 11SRC_URI = "http://snapshot.debian.org/archive/debian/20110427T035506Z/pool/main/v/${BPN}/${BPN}_${PV}.orig.tar.gz \
14 file://Update-x86emu-from-X.org.patch \ 12 file://Update-x86emu-from-X.org.patch \
@@ -16,7 +14,6 @@ SRC_URI = "http://snapshot.debian.org/archive/debian/20110427T035506Z/pool/main/
16 file://Support-for-cross-compilation.patch \ 14 file://Support-for-cross-compilation.patch \
17" 15"
18 16
19SRC_URI[md5sum] = "889686ec8424468fe0d205742e77a4c2"
20SRC_URI[sha256sum] = "93575c82e4307d8c4c370ec6b767f5cf87e527b2378146d652a6d8e25d5bdbc5" 17SRC_URI[sha256sum] = "93575c82e4307d8c4c370ec6b767f5cf87e527b2378146d652a6d8e25d5bdbc5"
21 18
22PACKAGE_ARCH = "${MACHINE_ARCH}" 19PACKAGE_ARCH = "${MACHINE_ARCH}"