From 52d6aa9f9f3bfca3b93026542231bde2ab91f875 Mon Sep 17 00:00:00 2001
From: Koichiro Iwao
Date: Fri, 14 Feb 2025 14:06:23 +0900
Subject: [PATCH] Separate the package into scripts and firmware binaries
---
SOURCES/LICENSE.rpi-eeprom-firmware | 28 +++++++++++++++++++++++++
SPECS/rpi-eeprom.spec | 32 +++++++++++++++++++++++++++--
2 files changed, 58 insertions(+), 2 deletions(-)
create mode 100644 SOURCES/LICENSE.rpi-eeprom-firmware
diff --git a/SOURCES/LICENSE.rpi-eeprom-firmware b/SOURCES/LICENSE.rpi-eeprom-firmware
new file mode 100644
index 0000000..2979d2c
--- /dev/null
+++ b/SOURCES/LICENSE.rpi-eeprom-firmware
@@ -0,0 +1,28 @@
+Copyright (c) 2019, Raspberry Pi (Trading) Ltd.
+All rights reserved.
+
+Redistribution. Redistribution and use in binary form, without
+modification, are permitted provided that the following conditions are
+met:
+
+* This software may only be used for the purposes of developing for,
+ running or using a Raspberry Pi device.
+* Redistributions must reproduce the above copyright notice and the
+ following disclaimer in the documentation and/or other materials
+ provided with the distribution.
+* Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
diff --git a/SPECS/rpi-eeprom.spec b/SPECS/rpi-eeprom.spec
index f8ecfca..149a7b2 100644
--- a/SPECS/rpi-eeprom.spec
+++ b/SPECS/rpi-eeprom.spec
@@ -3,14 +3,15 @@
Name: rpi-eeprom
Version: 2025.01.22
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Raspberry Pi 4/5 boot EEPROM updater (experimental)
BuildArch: noarch
ExclusiveArch: aarch64
-License: BSD-3-Clause AND MIT AND Custom
+License: BSD-3-Clause
URL: https://github.com/raspberrypi/rpi-eeprom
Source0: https://github.com/raspberrypi/rpi-eeprom/archive/refs/tags/%{gh_tag}.tar.gz
+Source1: LICENSE.rpi-eeprom-firmware
#Requires:
@@ -18,8 +19,24 @@ Source0: https://github.com/raspberrypi/rpi-eeprom/archive/refs/tags/%{gh
Raspberry Pi 4/5 boot EEPROM updater and configuration tool to edit the
bootloader configuration such as boot order and more.
+%package firmware
+Summary: Raspberry Pi 4/5 boot EEPROM firmware biaries
+#
+# NOTE: MIT-like but proprietary license with some restrictions.
+# See LICENSE.rpi-eeprom-firmware for full license text.
+#
+# - Redistribution without modification permitted.
+# - This software may only be used for the purposes of developing for,
+# running or using a Raspberry Pi device.
+#
+License: Proprietary
+
+%description firmware
+Raspberry Pi 4/5 boot EEPROM firmware binaries.
+
%prep
%setup -n %{srcdir}
+%{__cp} %{SOURCE1} .
%build
# nothing to build
@@ -34,10 +51,14 @@ rm -rf $RPM_BUILD_ROOT
#%{__install} -m 555 tools/rpi-bootloader-key-convert %{buildroot}%{_bindir}
#%{__install} -m 555 tools/rpi-otp-private-key %{buildroot}%{_bindir}
#%{__install} -m 555 tools/rpi-sign-bootcode %{buildroot}%{_bindir}
+
+# bootloader
%{__install} -d %{buildroot}%{_prefix}/lib/firmware/raspberrypi/bootloader-2711
%{__install} -d %{buildroot}%{_prefix}/lib/firmware/raspberrypi/bootloader-2711
%{__install} -d %{buildroot}%{_prefix}/lib/firmware/raspberrypi/bootloader-2711
%{__install} -d %{buildroot}%{_prefix}/lib/firmware/raspberrypi/bootloader-2712
+%{__install} -m 644 firmware-2711/release-notes.md %{buildroot}%{_prefix}/lib/firmware/raspberrypi/bootloader-2711
+%{__install} -m 644 firmware-2712/release-notes.md %{buildroot}%{_prefix}/lib/firmware/raspberrypi/bootloader-2712
%{__cp} -r firmware-2711/default %{buildroot}%{_prefix}/lib/firmware/raspberrypi/bootloader-2711/
%{__cp} -r firmware-2711/latest %{buildroot}%{_prefix}/lib/firmware/raspberrypi/bootloader-2711/
%{__cp} -r firmware-2712/default %{buildroot}%{_prefix}/lib/firmware/raspberrypi/bootloader-2712/
@@ -50,8 +71,15 @@ rm -rf $RPM_BUILD_ROOT
%{_bindir}/rpi-eeprom-config
%{_bindir}/rpi-eeprom-digest
%{_bindir}/rpi-eeprom-update
+
+%files firmware
+%license LICENSE.rpi-eeprom-firmware
%{_prefix}/lib/firmware/raspberrypi/*
%changelog
+* Fri Feb 14 2025 Koichiro Iwao - 2025.01.22-2
+- Separate the package into updater/config script and firmware binaries,
+ each licensed under different licenses
+
* Thu Feb 13 2025 Koichiro Iwao - 2025.01.22-1
- Initial creation