Skip to content

Commit c79cfa3

Browse files
committed
Add AlmaLinux Kitten 10
1 parent f091ec6 commit c79cfa3

File tree

4 files changed

+355
-1
lines changed

4 files changed

+355
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
cache8/*
22
cache9/*
3+
cache10/*
4+
cache10k/*
35
AlmaLinux-*-RaspberryPi-*.aarch64/*

build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ then
2525
fi
2626

2727
VARIANT=${1}
28-
VER=$(echo $VARIANT | sed -e 's|[^0-9]||g')
28+
VER=$(echo $VARIANT | sed -e 's|[^0-9k?]||g')
2929

3030
if [ ! -f ${SCRIPT_DIR}/kickstart/${VARIANT}.aarch64.ks ]
3131
then
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
# Basic setup information
2+
url --mirrorlist="https://kitten.mirrors.almalinux.org/mirrorlist/10-kitten/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://kitten.mirrors.almalinux.org/mirrorlist/10-kitten/baseos"
8+
repo --name="appstream" --mirrorlist="https://kitten.mirrors.almalinux.org/mirrorlist/10-kitten/appstream"
9+
repo --name="raspberrypi" --mirrorlist="https://kitten.mirrors.almalinux.org/mirrorlist/10-kitten/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=300 --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-1.6.0-*
33+
-java-1.7.0-*
34+
-java-11-*
35+
-kernel-*
36+
-python*-caribou*
37+
NetworkManager-wifi
38+
almalinux-release-raspberrypi
39+
bluez
40+
chrony
41+
cloud-init
42+
cloud-utils-growpart
43+
e2fsprogs
44+
net-tools
45+
linux-firmware-raspberrypi
46+
raspberrypi-sys-mods
47+
raspberrypi-userland
48+
raspberrypi2-firmware
49+
raspberrypi2-kernel4
50+
raspberrypi2-kernel4-tools
51+
nano
52+
libgpiod-utils
53+
%end
54+
55+
%post
56+
# Mandatory README file
57+
cat >/boot/README.txt << EOF
58+
== AlmaLinux 10 Kitten ==
59+
60+
To login to Raspberry Pi via SSH, you need to register SSH public key *before*
61+
inserting SD card to Raspberry Pi. Edit user-data file and put SSH public key
62+
in the place.
63+
64+
Default SSH username is almalinux.
65+
66+
EOF
67+
68+
# Data sources for cloud-init
69+
touch /boot/meta-data /boot/user-data
70+
71+
cat >/boot/user-data << "EOF"
72+
#cloud-config
73+
#
74+
# This is default cloud-init config file for AlmaLinux Raspberry Pi image.
75+
#
76+
# If you want additional customization, refer to cloud-init documentation and
77+
# examples. Please note configurations written in this file will be usually
78+
# applied only once at very first boot.
79+
#
80+
# https://cloudinit.readthedocs.io/en/latest/reference/examples.html
81+
82+
hostname: almalinux.local
83+
ssh_pwauth: false
84+
85+
users:
86+
- name: almalinux
87+
groups: [ adm, systemd-journal ]
88+
sudo: [ "ALL=(ALL) NOPASSWD:ALL" ]
89+
lock_passwd: false
90+
passwd: $6$EJCqLU5JAiiP5iSS$wRmPHYdotZEXa8OjfcSsJ/f1pAYTk0/OFHV1CGvcszwmk6YwwlZ/Lwg8nqjRT0SSKJIMh/3VuW5ZBz2DqYZ4c1
91+
# Uncomment below to add your SSH public keys as YAML array
92+
#ssh_authorized_keys:
93+
#- ssh-ed25519 AAAAC3Nz...
94+
95+
EOF
96+
97+
cat > /boot/config.txt << EOF
98+
# This file is provided as a placeholder for user options
99+
# AlmaLinux - few default config options
100+
101+
[pi4]
102+
arm_boost=1
103+
104+
[all]
105+
# enable serial console
106+
enable_uart=1
107+
EOF
108+
109+
# Kernel command line string
110+
cat > /boot/cmdline.txt << EOF
111+
console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
112+
EOF
113+
114+
# Create and initialize swapfile
115+
(umask 077; dd if=/dev/zero of=/swapfile bs=1M count=100)
116+
/usr/sbin/mkswap -p 4096 -L "_swap" /swapfile
117+
cat >> /etc/fstab << EOF
118+
/swapfile none swap defaults 0 0
119+
EOF
120+
121+
# Remove ifcfg-link on pre generated images
122+
rm -f /etc/sysconfig/network-scripts/ifcfg-link
123+
124+
# rebuild dnf cache
125+
dnf clean all
126+
/bin/date +%Y%m%d_%H%M > /etc/BUILDTIME
127+
echo '%_install_langs C.utf8' > /etc/rpm/macros.image-language-conf
128+
echo 'LANG="C.utf8"' > /etc/locale.conf
129+
rpm --rebuilddb
130+
131+
# Remove machine-id on pre generated images
132+
rm -f /etc/machine-id
133+
touch /etc/machine-id
134+
%end
135+
136+
%post --nochroot --erroronfail
137+
138+
LOOPPART=$(cat /proc/self/mounts |/usr/bin/grep '^\/dev\/mapper\/loop[0-9]p[0-9] '"$INSTALL_ROOT " | /usr/bin/sed 's/ .*//g')
139+
VFATPART=$(cat /proc/self/mounts |/usr/bin/grep '^\/dev\/mapper\/loop[0-9]p[0-9] '"$INSTALL_ROOT"/boot | /usr/bin/sed 's/ .*//g')
140+
echo "Found loop part for PARTUUID $LOOPPART"
141+
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')
142+
echo "no chroot selected bootdev=$BOOTDEV"
143+
if [ -n "$BOOTDEV" ];then
144+
cat $INSTALL_ROOT/boot/cmdline.txt
145+
echo sed -i "s|root=/dev/mmcblk0p2|root=${BOOTDEV}|g" $INSTALL_ROOT/boot/cmdline.txt
146+
sed -i "s|root=/dev/mmcblk0p2|root=${BOOTDEV}|g" $INSTALL_ROOT/boot/cmdline.txt
147+
fi
148+
149+
# cloud-init: NoCloud data source must have volume label "CIDATA"
150+
#
151+
# This didn't work for some reasons so using fatlabel instead.
152+
# part /boot --asprimary --fstype=vfat --mkfsoptions="-n CIDATA"
153+
/usr/sbin/fatlabel $VFATPART "CIDATA"
154+
# Kickstart sets the type of a VFAT partition with mountpoint /boot to EF00
155+
# if a GUID partition table is used, so reset the partition type to 0700.
156+
VFATPARTNUM=$(echo ${VFATPART} | sed -n 's/.*p\([0-9]\+\)$/\1/p')
157+
VFATPARTDEV=$(echo ${VFATPART//\/mapper/} | sed 's/p[0-9]*$//')
158+
if [ -b "${VFATPARTDEV}p${VFATPARTNUM}" -o -b "${VFATPARTDEV}${VFATPARTNUM}" ]; then
159+
echo /usr/sbin/sgdisk --typecode="${VFATPARTNUM}:0700" ${VFATPARTDEV}
160+
/usr/sbin/sgdisk --typecode="${VFATPARTNUM}:0700" ${VFATPARTDEV}
161+
fi
162+
163+
/usr/sbin/sgdisk -p ${VFATPARTDEV}
164+
165+
cat $INSTALL_ROOT/boot/cmdline.txt
166+
167+
%end
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
# Basic setup information
2+
url --mirrorlist="https://kitten.mirrors.almalinux.org/mirrorlist/10-kitten/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://kitten.mirrors.almalinux.org/mirrorlist/10-kitten/baseos"
8+
repo --name="appstream" --mirrorlist="https://kitten.mirrors.almalinux.org/mirrorlist/10-kitten/appstream"
9+
repo --name="raspberrypi" --mirrorlist="https://kitten.mirrors.almalinux.org/mirrorlist/10-kitten/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=4400 --label=rootfs --ondisk=sda
26+
27+
# Package setup
28+
%packages
29+
@core
30+
@gnome-desktop
31+
firefox
32+
dejavu-sans-fonts
33+
dejavu-sans-mono-fonts
34+
dejavu-serif-fonts
35+
#aajohan-comfortaa-fonts
36+
#abattis-cantarell-fonts
37+
-caribou*
38+
-gnome-shell-browser-plugin
39+
-java-1.6.0-*
40+
-java-1.7.0-*
41+
-java-11-*
42+
-kernel-*
43+
NetworkManager-wifi
44+
almalinux-release-raspberrypi
45+
bluez
46+
chrony
47+
cloud-init
48+
cloud-utils-growpart
49+
e2fsprogs
50+
net-tools
51+
linux-firmware-raspberrypi
52+
raspberrypi-sys-mods
53+
raspberrypi-userland
54+
raspberrypi2-firmware
55+
raspberrypi2-kernel4
56+
raspberrypi2-kernel4-tools
57+
nano
58+
libgpiod-utils
59+
%end
60+
61+
%post
62+
# Mandatory README file
63+
cat >/boot/README.txt << EOF
64+
== AlmaLinux 10 Kitten ==
65+
66+
To login to Raspberry Pi via SSH, you need to register SSH public key *before*
67+
inserting SD card to Raspberry Pi. Edit user-data file and put SSH public key
68+
in the place.
69+
70+
Default SSH username is almalinux.
71+
72+
EOF
73+
74+
# Data sources for cloud-init
75+
touch /boot/meta-data /boot/user-data
76+
77+
cat >/boot/user-data << "EOF"
78+
#cloud-config
79+
#
80+
# This is default cloud-init config file for AlmaLinux Raspberry Pi image.
81+
#
82+
# If you want additional customization, refer to cloud-init documentation and
83+
# examples. Please note configurations written in this file will be usually
84+
# applied only once at very first boot.
85+
#
86+
# https://cloudinit.readthedocs.io/en/latest/reference/examples.html
87+
88+
hostname: almalinux.local
89+
ssh_pwauth: false
90+
91+
users:
92+
- name: almalinux
93+
groups: [ adm, systemd-journal ]
94+
sudo: [ "ALL=(ALL) NOPASSWD:ALL" ]
95+
lock_passwd: false
96+
passwd: $6$EJCqLU5JAiiP5iSS$wRmPHYdotZEXa8OjfcSsJ/f1pAYTk0/OFHV1CGvcszwmk6YwwlZ/Lwg8nqjRT0SSKJIMh/3VuW5ZBz2DqYZ4c1
97+
# Uncomment below to add your SSH public keys as YAML array
98+
#ssh_authorized_keys:
99+
#- ssh-ed25519 AAAAC3Nz...
100+
101+
EOF
102+
103+
cat > /boot/config.txt << EOF
104+
# This file is provided as a placeholder for user options
105+
# AlmaLinux - few default config options for better graphics support
106+
[all]
107+
disable_overscan=1
108+
dtoverlay=vc4-kms-v3d
109+
camera_auto_detect=0
110+
gpu_mem=128
111+
# enable serial console
112+
enable_uart=1
113+
114+
## AlmaLinux - can enable this for Pi 4
115+
[pi4]
116+
#max_framebuffers=2
117+
arm_boost=1
118+
119+
[all]
120+
EOF
121+
122+
# Kernel command line string
123+
cat > /boot/cmdline.txt << EOF
124+
console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
125+
EOF
126+
127+
# Create and initialize swapfile
128+
(umask 077; dd if=/dev/zero of=/swapfile bs=1M count=100)
129+
/usr/sbin/mkswap -p 4096 -L "_swap" /swapfile
130+
cat >> /etc/fstab << EOF
131+
/swapfile none swap defaults 0 0
132+
EOF
133+
134+
# Remove ifcfg-link on pre generated images
135+
rm -f /etc/sysconfig/network-scripts/ifcfg-link
136+
137+
# rebuild dnf cache
138+
dnf clean all
139+
/bin/date +%Y%m%d_%H%M > /etc/BUILDTIME
140+
echo '%_install_langs C.utf8' > /etc/rpm/macros.image-language-conf
141+
echo 'LANG="C.utf8"' > /etc/locale.conf
142+
rpm --rebuilddb
143+
# activate gui
144+
systemctl set-default graphical.target
145+
146+
# Remove machine-id on pre generated images
147+
rm -f /etc/machine-id
148+
touch /etc/machine-id
149+
# print disk usage
150+
df
151+
#
152+
%end
153+
154+
%post --nochroot --erroronfail
155+
156+
LOOPPART=$(cat /proc/self/mounts |/usr/bin/grep '^\/dev\/mapper\/loop[0-9]p[0-9] '"$INSTALL_ROOT " | /usr/bin/sed 's/ .*//g')
157+
VFATPART=$(cat /proc/self/mounts |/usr/bin/grep '^\/dev\/mapper\/loop[0-9]p[0-9] '"$INSTALL_ROOT"/boot | /usr/bin/sed 's/ .*//g')
158+
echo "Found loop part for PARTUUID $LOOPPART"
159+
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')
160+
echo "no chroot selected bootdev=$BOOTDEV"
161+
if [ -n "$BOOTDEV" ];then
162+
cat $INSTALL_ROOT/boot/cmdline.txt
163+
echo sed -i "s|root=/dev/mmcblk0p2|root=${BOOTDEV}|g" $INSTALL_ROOT/boot/cmdline.txt
164+
sed -i "s|root=/dev/mmcblk0p2|root=${BOOTDEV}|g" $INSTALL_ROOT/boot/cmdline.txt
165+
fi
166+
167+
# cloud-init: NoCloud data source must have volume label "CIDATA"
168+
#
169+
# This didn't work for some reasons so using fatlabel instead.
170+
# part /boot --asprimary --fstype=vfat --mkfsoptions="-n CIDATA"
171+
/usr/sbin/fatlabel $VFATPART "CIDATA"
172+
# Kickstart sets the type of a VFAT partition with mountpoint /boot to EF00
173+
# if a GUID partition table is used, so reset the partition type to 0700.
174+
VFATPARTNUM=$(echo ${VFATPART} | sed -n 's/.*p\([0-9]\+\)$/\1/p')
175+
VFATPARTDEV=$(echo ${VFATPART//\/mapper/} | sed 's/p[0-9]*$//')
176+
if [ -b "${VFATPARTDEV}p${VFATPARTNUM}" -o -b "${VFATPARTDEV}${VFATPARTNUM}" ]; then
177+
echo /usr/sbin/sgdisk --typecode="${VFATPARTNUM}:0700" ${VFATPARTDEV}
178+
/usr/sbin/sgdisk --typecode="${VFATPARTNUM}:0700" ${VFATPARTDEV}
179+
fi
180+
181+
/usr/sbin/sgdisk -p ${VFATPARTDEV}
182+
183+
cat $INSTALL_ROOT/boot/cmdline.txt
184+
185+
%end

0 commit comments

Comments
 (0)