Compare commits

...

5 Commits
r9 ... r8

Author SHA1 Message Date
b5e4d2b031 Merge pull request 'added rpm db rebuild in post section' (#6) from codedude/RockyRpi:r8 into r8
Reviewed-on: #6
2023-12-09 15:40:12 +00:00
bf41e7c325 added rpm db rebuild in post section 2023-11-21 23:12:57 -05:00
Skip Grube
8bfc816e12 Small fixes to readme
-Skip G.
2023-06-09 13:29:44 -04:00
Skip Grube
fd4980215e Fixed naming of .ks file
-Skip G.
2023-06-05 22:56:56 -04:00
Skip Grube
bd2bea3bfc
Updated kickstart for 8.7
-Skip G.
2022-11-27 21:55:23 -05:00
3 changed files with 37 additions and 32 deletions

View File

@ -1,8 +1,27 @@
# Kickstart to build Rocky 8 image for Raspberry Pi 4 hardware (aarch64) # Kickstart to build Rocky 8 image for Raspberry Pi 4 hardware (aarch64)
# #
# (many parts liberally grabbed from pgreco: https://github.com/psgreco/sig-core-AltArch/tree/master/image_build )
#
# (pull from pgreco: https://github.com/psgreco/sig-core-AltArch/tree/master/image_build # Here is how to build this kickstart Raspberry Pi image, inside a clean mock chroot environment with livemedia-creator:
# (it is very similar to how the other kickstarts are built, but aarch64 must be used, and the livemedia appliance option)
#
#
# Set up mock env, and get a shell inside the chroot:
#
# mock -r rocky-8-aarch64 --init
# mock -r rocky-8-aarch64 --install lorax-lmc-novirt vim pykickstart git
# sudo setenforce 0
# mock -r rocky-8-aarch64 --shell --isolation=simple --enable-network
#
# Inside the shell:
# git clone https://github.com/rocky-linux/kickstarts
# git checkout r8
# cd kickstarts/altarch
#
# Finally, run the image creation:
#
# livemedia-creator --ks rockyrpi.ks --image-only --image-name RockyRpi --make-disk --resultdir /rockyrpi_result --no-virt
# Disk setup # Disk setup
clearpart --initlabel --all clearpart --initlabel --all
@ -10,18 +29,15 @@ part /boot --asprimary --fstype=vfat --size=300 --label=boot
part swap --asprimary --fstype=swap --size=512 --label=swap part swap --asprimary --fstype=swap --size=512 --label=swap
part / --asprimary --fstype=ext4 --size=2800 --label=RPIROOT part / --asprimary --fstype=ext4 --size=2800 --label=RPIROOT
# Repos setup: # Repos setup:
url --url http://download.rockylinux.org/pub/rocky/8/BaseOS/aarch64/os/
repo --name="BaseOS" --baseurl=http://download.rockylinux.org/pub/rocky/8/BaseOS/aarch64/os/ --cost=100 repo --name="BaseOS" --baseurl=http://download.rockylinux.org/pub/rocky/8/BaseOS/aarch64/os/ --cost=100
repo --name="AppStream" --baseurl=http://download.rockylinux.org/pub/rocky/8/AppStream/aarch64/os/ --cost=200 --install repo --name="AppStream" --baseurl=http://download.rockylinux.org/pub/rocky/8/AppStream/aarch64/os/ --cost=200 --install
repo --name="PowerTools" --baseurl=http://download.rockylinux.org/pub/rocky/8/BaseOS/aarch64/os/ --cost=300 --install repo --name="PowerTools" --baseurl=http://download.rockylinux.org/pub/rocky/8/BaseOS/aarch64/os/ --cost=300 --install
# Rocky Rpi kernel repo, we need a more permanent place for this: # Rocky Rpi kernel repo, we need a more permanent place for this:
repo --name="rockyrpi" --baseurl=https://download.rockylinux.org/pub/rocky/8/rockyrpi/aarch64/os/ --cost=20 repo --name="rockyrpi" --baseurl=https://download.rockylinux.org/pub/sig/8/altarch/aarch64/altarch-rockyrpi/ --cost=20
repo --name="rockyextras" --baseurl=https://download.rockylinux.org/pub/rocky/8/extras/aarch64/os/ --cost=20 repo --name="rockyextras" --baseurl=https://download.rockylinux.org/pub/rocky/8/extras/aarch64/os/ --cost=20
# Install proces: # Install proces:
install install
keyboard us --xlayouts=us --vckeymap=us keyboard us --xlayouts=us --vckeymap=us
@ -32,13 +48,11 @@ timezone --isUtc --nontp UTC
selinux --enforcing selinux --enforcing
firewall --enabled --port=22:tcp firewall --enabled --port=22:tcp
network --bootproto=dhcp --device=link --activate --onboot=on network --bootproto=dhcp --device=link --activate --onboot=on
services --enabled=sshd,NetworkManager,chronyd services --enabled=sshd,NetworkManager,chronyd,tuned
shutdown shutdown
bootloader --location=none bootloader --location=none
lang en_US.UTF-8 lang en_US.UTF-8
# Package selection: # Package selection:
%packages %packages
@core @core
@ -49,19 +63,17 @@ NetworkManager-wifi
vim vim
bash-completion bash-completion
nano nano
tuned
rocky-release-rpi rocky-release-rpi
raspberrypi2-firmware raspberrypi2-firmware
raspberrypi2-kernel4 raspberrypi2-kernel4
%end %end
# Post install scripts: # Post install scripts:
%post %post
# Write initial boot line to cmdline.txt (we will update the root partuuid further down) # Write initial boot line to cmdline.txt (we will update the root partuuid further down)
cat > /boot/cmdline.txt << EOF cat > /boot/cmdline.txt << EOF
console=ttyAMA0,115200 console=tty1 root= rootfstype=ext4 elevator=deadline rootwait console=ttyAMA0,115200 console=tty1 root= rootfstype=ext4 elevator=deadline rootwait
@ -70,7 +82,6 @@ EOF
# Run this once to fix the wifi: # Run this once to fix the wifi:
sed -i 's/boardflags3=0x48200100/boardflags3=0x44200100/g' /lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt sed -i 's/boardflags3=0x48200100/boardflags3=0x44200100/g' /lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt
# Apparently kickstart user was not working, attempt to do it here? # Apparently kickstart user was not working, attempt to do it here?
/sbin/useradd -c "Rocky Linux default user" -G wheel -m -U rocky /sbin/useradd -c "Rocky Linux default user" -G wheel -m -U rocky
echo "rockylinux" | passwd --stdin rocky echo "rockylinux" | passwd --stdin rocky
@ -87,19 +98,15 @@ This image WILL NOT WORK on a Raspberry Pi 1 or 2 (1.1 or earlier), we are 64-bi
The newer Pi Zero devices should be supported, as well as the Raspberry Pi 2 v. 1.2 boards, which are 64-bit The newer Pi Zero devices should be supported, as well as the Raspberry Pi 2 v. 1.2 boards, which are 64-bit
IMAGE NOTES / DIFFERENCES FROM STOCK ROCKY 8: IMAGE NOTES / DIFFERENCES FROM STOCK ROCKY 8:
- Based on Rocky Linux 8.5, points to production Rocky 8 aarch64 repositories - Based on Rocky Linux 8, points to production Rocky 8 aarch64 repositories
- Has an additional repository that contains kernel packages for Raspberry Pi - Has an additional repository that contains kernel packages for Raspberry Pi
- Includes script that fixes the wifi. Simple edit of a txt firmware settings file. Will need to be run whenever linux-firmware gets upgraded - Includes script that fixes the wifi. Simple edit of a txt firmware settings file. Will need to be run whenever linux-firmware gets upgraded
- Includes @minimal-install , plus a few quality of life packages like vim, bash-completion, etc. - Includes @minimal-install , plus a few quality of life packages like vim, bash-completion, etc.
- Initial User "rocky" (default password: "rockylinux"). Root password disabled, rocky user is a sudoer - Initial User "rocky" (default password: "rockylinux"). Root password disabled, rocky user is a sudoer
- Partitions are 300 MB /boot , 512 MB swap, 2800 MB rootfs. Requires a 4 GB or larger storage device to serve as your disk - Partitions are 300 MB /boot , 512 MB swap, 2800 MB rootfs. Requires a 4 GB or larger storage device to serve as your disk
GROW YOUR PARTITION: GROW YOUR PARTITION:
If you want to automatically resize your root (/ ) partition, just type the following (as root user): If you want to automatically resize your root (/ ) partition, just type the following (as root user):
@ -107,15 +114,12 @@ sudo rootfs-expand
It should fill your main rootfs partition to the end of the disk. It should fill your main rootfs partition to the end of the disk.
Thanks for your interest on Rocky-on-Rpi, feel free to share your experience or contribute in our chat channel at: https://chat.rockylinux.org/rocky-linux/channels/altarch ! Thanks for your interest on Rocky-on-Rpi, feel free to share your experience or contribute in our chat channel at: https://chat.rockylinux.org/rocky-linux/channels/altarch !
-The Rocky Linux Team -The Rocky Linux Team
EOF EOF
# Next, script to fix the wifi firmware setting: # Next, script to fix the wifi firmware setting:
cat >/home/rocky/fix-wifi-rpi4.sh << 'EOF' cat >/home/rocky/fix-wifi-rpi4.sh << 'EOF'
#!/bin/bash #!/bin/bash
@ -129,10 +133,8 @@ echo "Patched /lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt .
EOF EOF
chmod 755 /home/rocky/fix-wifi-rpi4.sh chmod 755 /home/rocky/fix-wifi-rpi4.sh
chown -R rocky:rocky /home/rocky chown -R rocky:rocky /home/rocky
# Cleanup before shipping an image # Cleanup before shipping an image
# Remove ifcfg-link on pre generated images # Remove ifcfg-link on pre generated images
@ -143,12 +145,15 @@ rm -f /etc/machine-id
touch /etc/machine-id touch /etc/machine-id
# Ensure no ssh keys are present # Ensure no ssh keys are present
rm -f /etc/ssh/*_key* rm -f "/etc/ssh/*_key*"
# Setting tuned profile to powersave by default -> sets the CPU governor to "ondemand". This prevents overheating issues
echo "powersave" > /etc/tuned/active_profile
# Clean yum cache # Clean yum cache
yum clean all yum clean all
# rebuild rpm database
rpm --rebuilddb
%end %end
# Add the PARTUUID of the rootfs partition to the kernel command line # Add the PARTUUID of the rootfs partition to the kernel command line
@ -167,7 +172,6 @@ PART_UUID_ROOTFS="$(/sbin/blkid "$(/sbin/blkid --uuid $UUID_ROOTFS)" | \
echo "cmdline.txt looks like this, please review:" echo "cmdline.txt looks like this, please review:"
/bin/cat $INSTALL_ROOT/boot/cmdline.txt /bin/cat $INSTALL_ROOT/boot/cmdline.txt
# Extract UUID of swap partition: # Extract UUID of swap partition:
UUID_SWAP=$(/bin/grep 'swap' $INSTALL_ROOT/etc/fstab | awk '{print $1}' | awk -F '=' '{print $2}') UUID_SWAP=$(/bin/grep 'swap' $INSTALL_ROOT/etc/fstab | awk '{print $1}' | awk -F '=' '{print $2}')
@ -175,3 +179,4 @@ UUID_SWAP=$(/bin/grep 'swap' $INSTALL_ROOT/etc/fstab | awk '{print $1}' | awk
/usr/sbin/mkswap -L "_swap" -p 4096 -U "${UUID_SWAP}" /dev/disk/by-uuid/${UUID_SWAP} /usr/sbin/mkswap -L "_swap" -p 4096 -U "${UUID_SWAP}" /dev/disk/by-uuid/${UUID_SWAP}
%end %end

View File

@ -3,7 +3,7 @@
# Simple script that runs a Rocky Raspberry pi creation (via appliance-creator), then inserts a UUID to the kernel boot line of the image # Simple script that runs a Rocky Raspberry pi creation (via appliance-creator), then inserts a UUID to the kernel boot line of the image
# after-the-fact # after-the-fact
# #
# Usage: ./Rocky8_Rpi4_mkimage.sh /path/to/outputfolder/ # Usage: ./createRocky8_Image.sh /path/to/outputfolder/
# #
# Needs to be run in the same directory as the rocky rpi kickstart, as it relies on it! # Needs to be run in the same directory as the rocky rpi kickstart, as it relies on it!
# #
@ -34,7 +34,7 @@ fi
# Actually create the image. Our kickstart data should be in the same git repo as this script: # Actually create the image. Our kickstart data should be in the same git repo as this script:
# (This takes a while, especially building on an rpi. Patience!) # (This takes a while, especially building on an rpi. Patience!)
appliance-creator -v -c ./Rocky8_Rpi4.ks -n RockyRpi \ appliance-creator -v -c ./Rocky8_Rpi.ks -n RockyRpi \
--version=`date +"%Y%m%d"` --release=1 \ --version=`date +"%Y%m%d"` --release=1 \
-d --logfile $LOGDIR/LOGFILE \ -d --logfile $LOGDIR/LOGFILE \
--vmem=2048 --vcpu=2 --no-compress -o "${OUTDIR}" --vmem=2048 --vcpu=2 --no-compress -o "${OUTDIR}"

View File

@ -1,12 +1,12 @@
(This file comes from the kickstart/appliance-creator repo: https://git.resf.org/sig_altarch/RockyRpi ) (This file comes from the kickstart/appliance-creator repo: https://git.resf.org/sig_altarch/RockyRpi )
Rocky 8 Raspberry Pi Images Rocky 8 Raspberry Pi Image version 8.8
They have been tested on Raspberry Pi 3 and 4. They have been tested on Raspberry Pi 3 and 4.
Rocky Linux WILL NOT WORK on a Raspberry Pi 1 or 2. They are 32-bit only, and Rocky Linux only supports arm64 (aarch64). Rocky Linux WILL NOT WORK on a Raspberry Pi 1 or 2. They are 32-bit only, and Rocky Linux only supports arm64 (aarch64).
(edit: Raspberry Pi 2 version 1.2 boards are in fact 64-bit. There aren't too many of these, but they might work. Tell us if you have one!) (edit: Raspberry Pi 2 version 1.2 boards are in fact 64-bit. There aren't too many of these, but they might work. Tell us on chat.rockylinux.org if you have one!)
QUICK START: QUICK START:
@ -50,7 +50,7 @@ TECHNICAL DETAILS ABOUT THE IMAGES:
Thanks for your interest on Rocky-on-Rpi, feel free to share your experience or contribute in our chat channel at: https://chat.rockylinux.org/rocky-linux/channels/altarch ! Feel free to share your experience or contribute in our chat channel at: https://chat.rockylinux.org/rocky-linux/channels/altarch !
-The Rocky Linux Team -The Rocky Linux Team