Skip to content

Commit e507767

Browse files
authored
Merge pull request #83 from metalefty/a10
Add AlmaLinux 10
2 parents db8250b + 721568b commit e507767

File tree

5 files changed

+382
-8
lines changed

5 files changed

+382
-8
lines changed

.github/workflows/build-rpi-github-hosted.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ on:
3535
type: choice
3636
options:
3737
- 10-kitten
38+
- 10
3839
- 9
3940
- 8
4041

@@ -83,6 +84,9 @@ jobs:
8384
# 10-kitten has no MBR image
8485
- version_major: '10-kitten'
8586
partitioning: 'mbr'
87+
# 10 has no MBR image
88+
- version_major: '10'
89+
partitioning: 'mbr'
8690

8791
steps:
8892
- uses: actions/checkout@v4

.github/workflows/build-rpi.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ on:
3535
type: choice
3636
options:
3737
- 10-kitten
38+
- 10
3839
- 9
3940
- 8
4041

@@ -87,6 +88,9 @@ jobs:
8788
# 10-kitten has no MBR image
8889
- version_major: '10-kitten'
8990
partitioning: 'mbr'
91+
# 10 has no MBR image
92+
- version_major: '10'
93+
partitioning: 'mbr'
9094

9195
steps:
9296

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ Images made possible by the incredible work contributed by the immortal [Pablo G
1010

1111
### Tested hardware
1212

13-
|Model |8|9|Kitten 10|
14-
|-|-|-|-|
15-
|Pi 5||||
16-
|Pi 500|?|?|?|
17-
|Pi 4 Model B||||
18-
|Pi 400||||
19-
|Pi 3 Model B+||||
20-
|Pi 3 Model A+||||
13+
|Model |8|9|Kitten 10||
14+
|-|-|-|-|-|
15+
|Pi 5|||||
16+
|Pi 500|?|?|?|?|
17+
|Pi 4 Model B|||||
18+
|Pi 400|||||
19+
|Pi 3 Model B+|||||
20+
|Pi 3 Model A+|||||
2121

2222
- ✓: Tested
2323
- ?: Not Tested
@@ -30,6 +30,7 @@ Images made possible by the incredible work contributed by the immortal [Pablo G
3030
|8|||
3131
|9|||
3232
|Kitten 10|||
33+
|10|||
3334

3435
## AlmaLinux Raspberry Pi Quick Start
3536

@@ -48,6 +49,9 @@ Full guide for AlmaLinux on Raspberry Pi is available here: https://wiki.almalin
4849

4950
## Changelog
5051

52+
### 2025-05-28
53+
- Add AlmaLinux 10
54+
5155
### 2025-02-25
5256
- Run SELinux auto-relabel at first boot
5357

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# Basic setup information
2+
url --mirrorlist="https://mirrors.almalinux.org/mirrorlist/10/baseos"
3+
# root password is locked but can be reset by cloud-init later
4+
rootpw --plaintext --lock almalinux
5+
6+
# Repositories to use
7+
repo --name="baseos" --mirrorlist="https://mirrors.almalinux.org/mirrorlist/10/baseos"
8+
repo --name="appstream" --mirrorlist="https://mirrors.almalinux.org/mirrorlist/10/appstream"
9+
repo --name="raspberrypi" --mirrorlist="https://mirrors.almalinux.org/mirrorlist/10/raspberrypi"
10+
11+
# install
12+
keyboard us --xlayouts=us --vckeymap=us
13+
timezone --isUtc --nontp UTC
14+
selinux --enforcing
15+
firewall --enabled --port=22:tcp
16+
network --bootproto=dhcp --device=link --activate --onboot=on
17+
services --enabled=sshd,NetworkManager,chronyd,bluetooth,cpupower
18+
shutdown
19+
bootloader --location=none
20+
lang en_US.UTF-8
21+
22+
# Disk setup
23+
clearpart --initlabel --all --disklabel=gpt
24+
part /boot --fstype=vfat --size=500 --label=cidata --ondisk=sda
25+
part / --fstype=ext4 --size=2400 --label=rootfs --ondisk=sda
26+
27+
# Package setup
28+
%packages
29+
@core
30+
-caribou*
31+
-gnome-shell-browser-plugin
32+
-java-21-*
33+
-kernel-*
34+
-python*-caribou*
35+
NetworkManager-wifi
36+
almalinux-release-raspberrypi
37+
bluez
38+
chrony
39+
cloud-init
40+
cloud-utils-growpart
41+
e2fsprogs
42+
net-tools
43+
linux-firmware-raspberrypi
44+
raspberrypi-sys-mods
45+
raspberrypi-userland
46+
raspberrypi2-firmware
47+
raspberrypi2-kernel4
48+
raspberrypi2-kernel4-tools
49+
raspberrypi2-kernel4-modules
50+
raspberrypi2-kernel4-modules-core
51+
raspberrypi2-kernel4-modules-extra
52+
nano
53+
libgpiod-utils
54+
%end
55+
56+
%post
57+
# Mandatory README file
58+
cat >/boot/README.txt << EOF
59+
== AlmaLinux 10 ==
60+
61+
To login to Raspberry Pi via SSH, you need to register SSH public key *before*
62+
inserting SD card to Raspberry Pi. Edit user-data file and put SSH public key
63+
in the place.
64+
65+
Default SSH username is almalinux.
66+
67+
EOF
68+
69+
# Data sources for cloud-init
70+
touch /boot/meta-data /boot/user-data
71+
72+
cat >/boot/user-data << "EOF"
73+
#cloud-config
74+
#
75+
# This is default cloud-init config file for AlmaLinux Raspberry Pi image.
76+
#
77+
# If you want additional customization, refer to cloud-init documentation and
78+
# examples. Please note configurations written in this file will be usually
79+
# applied only once at very first boot.
80+
#
81+
# https://cloudinit.readthedocs.io/en/latest/reference/examples.html
82+
83+
hostname: almalinux.local
84+
ssh_pwauth: false
85+
86+
users:
87+
- name: almalinux
88+
groups: [ adm, systemd-journal ]
89+
sudo: [ "ALL=(ALL) NOPASSWD:ALL" ]
90+
lock_passwd: false
91+
passwd: $6$EJCqLU5JAiiP5iSS$wRmPHYdotZEXa8OjfcSsJ/f1pAYTk0/OFHV1CGvcszwmk6YwwlZ/Lwg8nqjRT0SSKJIMh/3VuW5ZBz2DqYZ4c1
92+
# Uncomment below to add your SSH public keys as YAML array
93+
#ssh_authorized_keys:
94+
#- ssh-ed25519 AAAAC3Nz...
95+
96+
EOF
97+
98+
cat > /boot/config.txt << EOF
99+
# This file is provided as a placeholder for user options
100+
# AlmaLinux - few default config options
101+
102+
[pi4]
103+
arm_boost=1
104+
105+
[all]
106+
# enable serial console
107+
enable_uart=1
108+
EOF
109+
110+
# Kernel command line string
111+
cat > /boot/cmdline.txt << EOF
112+
console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
113+
EOF
114+
115+
# Create and initialize swapfile
116+
(umask 077; dd if=/dev/zero of=/swapfile bs=1M count=100)
117+
/usr/sbin/mkswap -p 4096 -L "_swap" /swapfile
118+
cat >> /etc/fstab << EOF
119+
/swapfile none swap defaults 0 0
120+
EOF
121+
122+
# Remove ifcfg-link on pre generated images
123+
rm -f /etc/sysconfig/network-scripts/ifcfg-link
124+
125+
# rebuild dnf cache
126+
dnf clean all
127+
/bin/date +%Y%m%d_%H%M > /etc/BUILDTIME
128+
echo '%_install_langs C.utf8' > /etc/rpm/macros.image-language-conf
129+
echo 'LANG="C.utf8"' > /etc/locale.conf
130+
rpm --rebuilddb
131+
132+
# Remove machine-id on pre generated images
133+
rm -f /etc/machine-id
134+
touch /etc/machine-id
135+
136+
#auto relabel SELinux
137+
touch /.autorelabel
138+
139+
%end
140+
141+
%post --nochroot --erroronfail
142+
143+
LOOPPART=$(cat /proc/self/mounts |/usr/bin/grep '^\/dev\/mapper\/loop[0-9]p[0-9] '"$INSTALL_ROOT " | /usr/bin/sed 's/ .*//g')
144+
VFATPART=$(cat /proc/self/mounts |/usr/bin/grep '^\/dev\/mapper\/loop[0-9]p[0-9] '"$INSTALL_ROOT"/boot | /usr/bin/sed 's/ .*//g')
145+
echo "Found loop part for PARTUUID $LOOPPART"
146+
BOOTDEV=$(/usr/sbin/blkid $LOOPPART | egrep 'PARTUUID="([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})"' | sed 's/.*PARTUUID/PARTUUID/g;s/ .*//g;s/"//g')
147+
echo "no chroot selected bootdev=$BOOTDEV"
148+
if [ -n "$BOOTDEV" ];then
149+
cat $INSTALL_ROOT/boot/cmdline.txt
150+
echo sed -i "s|root=/dev/mmcblk0p2|root=${BOOTDEV}|g" $INSTALL_ROOT/boot/cmdline.txt
151+
sed -i "s|root=/dev/mmcblk0p2|root=${BOOTDEV}|g" $INSTALL_ROOT/boot/cmdline.txt
152+
fi
153+
154+
# cloud-init: NoCloud data source must have volume label "CIDATA"
155+
#
156+
# This didn't work for some reasons so using fatlabel instead.
157+
# part /boot --asprimary --fstype=vfat --mkfsoptions="-n CIDATA"
158+
/usr/sbin/fatlabel $VFATPART "CIDATA"
159+
# Kickstart sets the type of a VFAT partition with mountpoint /boot to EF00
160+
# if a GUID partition table is used, so reset the partition type to 0700.
161+
VFATPARTNUM=$(echo ${VFATPART} | sed -n 's/.*p\([0-9]\+\)$/\1/p')
162+
VFATPARTDEV=$(echo ${VFATPART//\/mapper/} | sed 's/p[0-9]*$//')
163+
if [ -b "${VFATPARTDEV}p${VFATPARTNUM}" -o -b "${VFATPARTDEV}${VFATPARTNUM}" ]; then
164+
echo /usr/sbin/sgdisk --typecode="${VFATPARTNUM}:0700" ${VFATPARTDEV}
165+
/usr/sbin/sgdisk --typecode="${VFATPARTNUM}:0700" ${VFATPARTDEV}
166+
fi
167+
168+
/usr/sbin/sgdisk -p ${VFATPARTDEV}
169+
170+
cat $INSTALL_ROOT/boot/cmdline.txt
171+
172+
%end

0 commit comments

Comments
 (0)