AlmaLinux release for RPI

This commit is contained in:
eabdullin 2022-05-27 12:57:39 +03:00
commit dd1b26f074
3 changed files with 87 additions and 0 deletions

View File

@ -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

View File

@ -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 <alukoshko@almalinux.org> - 8-2
- Use mirrors for raspberrypi repo
* Tue Sep 28 2021 Andrew Lukoshko <alukoshko@almalinux.org> - 8-1
- Initial version

31
rootfs-expand Executable file
View File

@ -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