From 1a15f993dec11ac08b5191773ade677640047269 Mon Sep 17 00:00:00 2001 From: Skip Grube Date: Mon, 4 Jul 2022 20:42:47 +0000 Subject: [PATCH] Started R9 branch based (roughly) on R8 branch -Skip G. --- README.md | 6 ++--- Rocky8_Rpi.ks => Rocky9_Rpi.ks | 39 +++++++++++++++++++++----------- createRocky8_Image.sh | 41 ---------------------------------- createRocky9_Image.sh | 28 +++++++++++++++++++++++ readme.image.txt | 2 +- skips_todo | 14 ++++-------- 6 files changed, 62 insertions(+), 68 deletions(-) rename Rocky8_Rpi.ks => Rocky9_Rpi.ks (79%) delete mode 100755 createRocky8_Image.sh create mode 100755 createRocky9_Image.sh diff --git a/README.md b/README.md index db0d108..850188c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Scripts and kickstarts for building Rocky Linux for Raspberry Pi ## Purpose of this Repo -This repository contains kickstart scripts and commands for producing your own Rocky Linux 8 image for the Raspberry Pi. It's intended mostly for developers or other technical users. If you are simply interested in using Rocky on your Pi, it's much easier to grab the latest image from (currently): https://dl.rockylinux.org/pub/rocky/8/rockyrpi/aarch64/images/ +This repository contains kickstart scripts and commands for producing your own Rocky Linux 9 image for the Raspberry Pi. It's intended mostly for developers or other technical users. If you are simply interested in using Rocky on your Pi, it's much easier to grab the latest image from (currently): https://dl.rockylinux.org/pub/rocky/9/rockyrpi/aarch64/images/ The readme.image.txt file has information and instructions for those interested in downloading and using the ready-made image. @@ -25,7 +25,7 @@ The included script to create the image is quite simple. Simply run it (with su For example: -`sudo ./createRocky8_Image.sh /home/myhomefolder/Rocky8_image/` +`sudo ./createRocky9_Image.sh /home/myhomefolder/Rocky9_image/` The kickstart/image build process takes approximately 10 minutes on a Raspberry Pi 4 with a decently fast internet connection. Alternatively, you should be able to use any aarch64 hardware that meets the above requirements(Amazon EC2, etc) @@ -33,7 +33,7 @@ The kickstart/image build process takes approximately 10 minutes on a Raspberry ## Customizing the Kickstart -All the setup logic for the image is contained within the kickstart file (Rocky8_Rpi.ks). It is intended to be readable and well documented, and you can of course change it anyway you please to produce custom images yourself. +All the setup logic for the image is contained within the kickstart file (Rocky9_Rpi.ks). It is intended to be readable and well documented, and you can of course change it anyway you please to produce custom images yourself. # Contributing diff --git a/Rocky8_Rpi.ks b/Rocky9_Rpi.ks similarity index 79% rename from Rocky8_Rpi.ks rename to Rocky9_Rpi.ks index 2c0eb3f..ffdd992 100644 --- a/Rocky8_Rpi.ks +++ b/Rocky9_Rpi.ks @@ -13,12 +13,16 @@ part / --asprimary --fstype=ext4 --size=2800 --label=RPIROOT # Repos setup: -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="PowerTools" --baseurl=http://download.rockylinux.org/pub/rocky/8/BaseOS/aarch64/os/ --cost=300 --install +repo --name="BaseOS" --baseurl=http://download.rockylinux.org/stg/rocky/9/BaseOS/aarch64/os/ --cost=100 +repo --name="AppStream" --baseurl=http://download.rockylinux.org/stg/rocky/9/AppStream/aarch64/os/ --cost=200 --install +repo --name="PowerTools" --baseurl=http://download.rockylinux.org/stg/rocky/9/BaseOS/aarch64/os/ --cost=300 --install +repo --name="rockyrpi" --baseurl=https://bootstrap9.releng.rockylinux.org/RockyRpi_9_Test/rpi_repo/ --cost=100 --install +#--baseurl=https://download.rockylinux.org/pub/rocky/8/rockyrpi/aarch64/os/ --cost=100 --install + + # 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="rockyextras" --baseurl=https://download.rockylinux.org/pub/rocky/8/extras/aarch64/os/ --cost=20 +#repo --name="rockyrpi" --baseurl=https://download.rockylinux.org/pub/rocky/8/rockyrpi/aarch64/os/ --cost=20 +#repo --name="rockyextras" --baseurl=https://download.rockylinux.org/pub/rocky/8/extras/aarch64/os/ --cost=20 @@ -29,7 +33,7 @@ rootpw --lock # FIXME user creation here does not work ? # user --name="rocky" --password="rockylinux" --plaintext --gecos="Rocky default user" --groups=wheel --uid=1000 timezone --isUtc --nontp UTC -selinux --enforcing +selinux --disabled firewall --enabled --port=22:tcp network --bootproto=dhcp --device=link --activate --onboot=on services --enabled=sshd,NetworkManager,chronyd @@ -42,6 +46,10 @@ lang en_US.UTF-8 # Package selection: %packages @core +#-grub2-tools-minimal +#-grub2-tools +#-grubby +#-grub2-common chrony cloud-utils-growpart net-tools @@ -50,7 +58,9 @@ vim bash-completion nano -rocky-release-rpi + +# will enable rocky-release-rpi after full 9 release (and we have it in the -extras repo) +#rocky-release-rpi raspberrypi2-firmware raspberrypi2-kernel4 @@ -68,7 +78,7 @@ console=ttyAMA0,115200 console=tty1 root= rootfstype=ext4 elevator=deadline root EOF # 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? @@ -79,9 +89,9 @@ echo "rockylinux" | passwd --stdin rocky # First, the all-important README : cat >/home/rocky/README << EOF -== Rocky 8 Raspberry Pi Image == +== Rocky 9 Raspberry Pi Image == -This is a Rocky 8 install intended for Raspberry Pi 3b and 4 devices (architecture is aarch64). +This is a Rocky 9 install intended for Raspberry Pi 3b and 4 devices (architecture is aarch64). This image WILL NOT WORK on a Raspberry Pi 1 or 2 (1.1 or earlier), we are 64-bit only, and have no support for 32-bit ARM processors. Sorry :-/. @@ -92,8 +102,7 @@ The newer Pi Zero devices should be supported, as well as the Raspberry Pi 2 v. IMAGE NOTES / DIFFERENCES FROM STOCK ROCKY 8: - - Based on Rocky Linux 8.5, points to production Rocky 8 aarch64 repositories - - Has an additional repository that contains kernel packages for Raspberry Pi + - Based on Rocky Linux 9, points to production Rocky 9 aarch64 repositories - 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. - Initial User "rocky" (default password: "rockylinux"). Root password disabled, rocky user is a sudoer @@ -143,12 +152,16 @@ rm -f /etc/machine-id touch /etc/machine-id # Ensure no ssh keys are present -rm -f /etc/ssh/*_key* +rm -f "/etc/ssh/*_key*" # Clean yum cache yum clean all + +# Fix weird sssd bug, where it gets its folder owned by the unbound user: +chown -R sssd:sssd /var/lib/sss/{db,pipes,mc,pubconf,gpo_cache} + %end # Add the PARTUUID of the rootfs partition to the kernel command line diff --git a/createRocky8_Image.sh b/createRocky8_Image.sh deleted file mode 100755 index ef2b0ea..0000000 --- a/createRocky8_Image.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -# 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 -# -# Usage: ./Rocky8_Rpi4_mkimage.sh /path/to/outputfolder/ -# -# Needs to be run in the same directory as the rocky rpi kickstart, as it relies on it! -# -# Exit with error if we don't have an output directory: - -OUTDIR=$1 -LOGDIR="logs" -LOGFILE="/create_image`date +"%y%m%d"`.log" -LOGFILE2="create_image`date +"%y%m%d"`.log.2" - -if [[ -z "${OUTDIR}" ]]; then - echo "Need to run this script with a path to output directory. Like: ${0} /path/to/output/" - exit 1 -fi - -if [[ -d ${LOGDIR} ]]; then - echo "$LOGDIR exists..." -else - mkdir -p "${LOGDIR}" - touch $LOGDIR/$LOGFILE -fi - -if [[ -d ${OUTDIR} ]]; then - echo "$OUTDIR exists..." -else - mkdir -p "${OUTDIR}" -fi - -# 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!) -appliance-creator -v -c ./Rocky8_Rpi4.ks -n RockyRpi \ - --version=`date +"%Y%m%d"` --release=1 \ - -d --logfile $LOGDIR/LOGFILE \ - --vmem=2048 --vcpu=2 --no-compress -o "${OUTDIR}" -#chown -R $SUDO_USER. "${OUTDIR}" diff --git a/createRocky9_Image.sh b/createRocky9_Image.sh new file mode 100755 index 0000000..4015ca5 --- /dev/null +++ b/createRocky9_Image.sh @@ -0,0 +1,28 @@ +#!/bin/bash + + +# 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 +# +# Usage: ./Rocky9_Rpi4_mkimage.sh /path/to/outputfolder/ +# +# +# Needs to be run in the same directory as the rocky rpi kickstart, as it relies on it! +# + +# Exit with error if we don't have an output directory: +OUTDIR=$1 + +if [[ -z "$OUTDIR" ]]; then + echo "Need to run this script with a path to output directory. Like: ${0} /path/to/output/" + exit 1 +fi + +mkdir -p "${OUTDIR}" + + +# 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!) +appliance-creator -v -c ./Rocky9_Rpi.ks -n RockyRpi --version=`date +"%Y%m%d"` --release=1 --vmem=2048 --vcpu=2 --no-compress -o "${OUTDIR}" + +chown -R $SUDO_USER. "${OUTDIR}" diff --git a/readme.image.txt b/readme.image.txt index 6a30f4e..c92fc38 100644 --- a/readme.image.txt +++ b/readme.image.txt @@ -1,6 +1,6 @@ (This file comes from the kickstart/appliance-creator repo: https://git.resf.org/sig_altarch/RockyRpi ) -Rocky 8 Raspberry Pi Images +Rocky 9 Raspberry Pi Images They have been tested on Raspberry Pi 3 and 4. diff --git a/skips_todo b/skips_todo index 90a907e..b491445 100644 --- a/skips_todo +++ b/skips_todo @@ -1,13 +1,7 @@ -#- Disable root pw, disable root ssh, add rocky login w/ default pw +- Build fixes for wifi on 9 -- Detect PARTUUID and automatically swap /boot/cmdline.txt +- Finalize and release rpi Rocky 9 image -#- script to fix wifi txt file, in /root/, and also run it at the end +- re-sync kernel RPM from pgreco upstream -#- install extra packages: nano,vim,bash-completion - -#- Add rpi-kernel repo file - -- Add README , with notes and how-to's for writing sd card, fixing wifi, and expanding partition - -- Adjust swap/rootfs sizes(?) +- port builds and imports to Peridot