From dd1b26f074db1a6bc07dc5904878e276d3c9750e Mon Sep 17 00:00:00 2001 From: eabdullin Date: Fri, 27 May 2022 12:57:39 +0300 Subject: [PATCH] AlmaLinux release for RPI --- almalinux-raspberrypi.repo | 27 ++++++++++++++++++++++++++ almalinux-release-raspberrypi.spec | 29 ++++++++++++++++++++++++++++ rootfs-expand | 31 ++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 almalinux-raspberrypi.repo create mode 100644 almalinux-release-raspberrypi.spec create mode 100755 rootfs-expand diff --git a/almalinux-raspberrypi.repo b/almalinux-raspberrypi.repo new file mode 100644 index 0000000..c3a4a7a --- /dev/null +++ b/almalinux-raspberrypi.repo @@ -0,0 +1,27 @@ +# Raspberry PI repo for AlmaLinux + +[raspberrypi] +name=AlmaLinux $releasever - Raspberry Pi +mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/raspberrypi +# baseurl=https://repo.almalinux.org/almalinux/$releasever/raspberrypi/$basearch/os/ +gpgcheck=1 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux + +## Sources +[raspberrypi-source] +name=AlmaLinux $releasever - Raspberry Pi Source +mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/raspberrypi-source +# baseurl=https://repo.almalinux.org/almalinux/$releasever/raspberrypi/Source/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux + +## Debug +[raspberrypi-debuginfo] +name=AlmaLinux $releasever - Raspberry Pi debuginfo +mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/raspberrypi-debuginfo +# baseurl=https://repo.almalinux.org/almalinux/$releasever/raspberrypi/debug/$basearch/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux diff --git a/almalinux-release-raspberrypi.spec b/almalinux-release-raspberrypi.spec new file mode 100644 index 0000000..d9338fd --- /dev/null +++ b/almalinux-release-raspberrypi.spec @@ -0,0 +1,29 @@ +Summary: Raspberry Pi support packages from the AlmaLinux Core SIG repository +Name: almalinux-release-raspberrypi +Version: 8 +Release: 2%{?dist} +License: GPLv2 +URL: https://wiki.almalinux.org/sigs/Core +Source0: almalinux-raspberrypi.repo +Source1: rootfs-expand + +Provides: almalinux-release-raspberrypi = 8 + +%description +yum configuration for Raspberry Pi support packages from the AlmaLinux Core SIG. + +%install +install -D -m 644 %{SOURCE0} %{buildroot}%{_sysconfdir}/yum.repos.d/almalinux-raspberrypi.repo +install -D -m 750 %{SOURCE1} %{buildroot}%{_bindir}/rootfs-expand + +%files +%defattr(-,root,root) +%{_bindir}/rootfs-expand +%config(noreplace) %{_sysconfdir}/yum.repos.d/almalinux-raspberrypi.repo + +%changelog +* Wed Oct 06 2021 Andrew Lukoshko - 8-2 +- Use mirrors for raspberrypi repo + +* Tue Sep 28 2021 Andrew Lukoshko - 8-1 +- Initial version diff --git a/rootfs-expand b/rootfs-expand new file mode 100755 index 0000000..baab79a --- /dev/null +++ b/rootfs-expand @@ -0,0 +1,31 @@ +#!/bin/bash + +clear +part=$(mount |grep '^/dev.* / ' |awk '{print $1}') +if [ -z "$part" ];then + echo "Error detecting rootfs" + exit -1 +fi +dev=$(echo $part|sed 's/[0-9]*$//g') +devlen=${#dev} +num=${part:$devlen} +if [[ "$dev" =~ ^/dev/mmcblk[0-9]*p$ ]];then + dev=${dev:0:-1} +fi +if [ ! -x /usr/bin/growpart ];then + echo "Please install cloud-utils-growpart (sudo yum install cloud-utils-growpart)" + exit -2 +fi +if [ ! -x /usr/sbin/resize2fs ];then + echo "Please install e2fsprogs (sudo yum install e2fsprogs)" + exit -3 +fi +echo $part $dev $num + +echo "Extending partition $num to max size ...." +growpart $dev $num +echo "Resizing ext4 filesystem ..." +resize2fs $part +echo "Done." +df -h |grep $part +