init package

This commit is contained in:
yafen 2021-09-29 03:16:41 +08:00
parent ac76ce2f8a
commit ffdb8e5ca2
4 changed files with 102 additions and 0 deletions

23
python3_env.patch Normal file
View File

@ -0,0 +1,23 @@
From e28936a8fa34346727b229e7366960e508545cf0 Mon Sep 17 00:00:00 2001
From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Date: Fri, 22 Jan 2021 17:08:46 +0100
Subject: [PATCH] Avoid using env so rpm catches the python dependency
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
rpi-eeprom-config | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rpi-eeprom-config b/rpi-eeprom-config
index 0a6ce5e..943d0dd 100755
--- a/rpi-eeprom-config
+++ b/rpi-eeprom-config
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
"""
rpi-eeprom-config
--
2.30.0

68
raspberrypi-eeprom.spec Normal file
View File

@ -0,0 +1,68 @@
%global _firmware_path /lib/firmware
%global _systemd_path /lib/systemd/system
%define url_version 2021.04.29-138a1
%global debug_package %{nil}
Name: raspberrypi-eeprom
Version: 2021.04.29
Release: 1
Summary: Raspberry Pi 4 boot EEPROM firmware
License: BSD-3-Clause and custom
URL: https://github.com/raspberrypi/rpi-eeprom
Source0: https://github.com/raspberrypi/rpi-eeprom/archive/v%{url_version}/rpi-eeprom-%{version}.tar.gz
Source1: rpi-eeprom-update.service
Patch0000: python3_env.patch
AutoReq: no
AutoProv: yes
Provides: rpi-eeprom
Requires: raspberrypi-firmware libraspberrypi-bin python3 binutils pciutils
Provides: rpi-eeprom-config = %{version}
Obsoletes: rpi-eeprom-config < %{version}
ExclusiveArch: aarch64
ExclusiveOS: Linux
%description
Installation scripts and binaries for the closed sourced Raspberry Pi 4 EEPROMs.
%prep
%setup -q -n %{name}-%{version} -c
mv rpi-eeprom-%{url_version} %{name}-%{version}
cd %{name}-%{version}
%patch0000 -p1
%build
%install
mkdir -p %{buildroot}%{_systemd_path}
install -p -m 644 %{SOURCE1} %{buildroot}%{_systemd_path}/
cd %{name}-%{version}
mkdir -p %{buildroot}%{_bindir}
install -m 0755 rpi-eeprom-config %{buildroot}%{_bindir}
install -m 0755 rpi-eeprom-update %{buildroot}%{_bindir}
mkdir -p %{buildroot}/etc/default
install -m 644 rpi-eeprom-update-default %{buildroot}/etc/default/rpi-eeprom-update
mkdir -p %{buildroot}%{_firmware_path}/raspberrypi/bootloader
install -m 644 releases.md %{buildroot}%{_firmware_path}/raspberrypi/bootloader/
cp -a firmware/beta %{buildroot}%{_firmware_path}/raspberrypi/bootloader
cp -a firmware/critical %{buildroot}%{_firmware_path}/raspberrypi/bootloader
cp -a firmware/stable %{buildroot}%{_firmware_path}/raspberrypi/bootloader
cd %{buildroot}%{_firmware_path}/raspberrypi/bootloader
ln -s stable latest
ln -s critical default
cd -
%files
%license %{name}-%{version}/LICENSE
%{_bindir}/rpi-eeprom-config
%{_bindir}/rpi-eeprom-update
%config /etc/default/rpi-eeprom-update
%{_firmware_path}/raspberrypi
%{_systemd_path}/*.service
%changelog
* Sat Sep 25 2021 Yafen Fang <yafen@iscas.ac.cn> - 2021.04.29-1
- init package

Binary file not shown.

11
rpi-eeprom-update.service Normal file
View File

@ -0,0 +1,11 @@
[Unit]
Description=Check for Raspberry Pi EEPROM updates
After=boot.mount
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/usr/bin/rpi-eeprom-update -s -a
[Install]
WantedBy=multi-user.target