diff --git a/README.md b/README.md index 850188c..6dbd315 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,13 @@ The readme.image.txt file has information and instructions for those interested Producing the Rpi Image requires: -* A Fedora or EL-based distribution (Rocky/CentOS/RHEL/etc.) **running on aarch64 hardware** +* Fedora 34 or higher, OR an EL9-based distribution **running on aarch64 hardware** +* NOTE: It MUST be EL9, or you will have RPMDB+SELinux issues! We do not support building this image on EL8 or lower * Packages * git + * epel-release (if using an EL distro) + * appliance-tools (contains the appliance-creator program that makes the image) -* EPEL repo enabled (extra packages for enterprise linux) -* The appliance-creator program from appliance-tools package ( ```sudo dnf install appliance-tools``` ) ## Making an Image diff --git a/Rocky9_Rpi.ks b/Rocky9_Rpi.ks index ffdd992..eb80b23 100644 --- a/Rocky9_Rpi.ks +++ b/Rocky9_Rpi.ks @@ -16,7 +16,7 @@ part / --asprimary --fstype=ext4 --size=2800 --label=RPIROOT 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 +repo --name="rockyrpi" --baseurl=https://bootstrap9.releng.rockylinux.org/RockyRpi_9_Test/rpi_repo/ --cost=50 --install #--baseurl=https://download.rockylinux.org/pub/rocky/8/rockyrpi/aarch64/os/ --cost=100 --install @@ -59,12 +59,19 @@ bash-completion nano +# Need these for setting default locale of en-US: +langpacks-en +glibc-all-langpacks + + # will enable rocky-release-rpi after full 9 release (and we have it in the -extras repo) -#rocky-release-rpi +rocky-release-rpi raspberrypi2-firmware raspberrypi2-kernel4 + + %end @@ -77,8 +84,6 @@ cat > /boot/cmdline.txt << EOF console=ttyAMA0,115200 console=tty1 root= rootfstype=ext4 elevator=deadline rootwait 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 # Apparently kickstart user was not working, attempt to do it here? @@ -125,21 +130,11 @@ Thanks for your interest on Rocky-on-Rpi, feel free to share your experience or EOF -# Next, script to fix the wifi firmware setting: -cat >/home/rocky/fix-wifi-rpi4.sh << 'EOF' -#!/bin/bash -# Simple hacky fix to correct wifi settings on the Rpi4 so it loads properly: +# Run the fix-wifi script (extracts the .xz firmware) - should be installed via the rocky-release-rpi package +fix-wifi-rpi.sh -sed -i 's/boardflags3=0x48200100/boardflags3=0x44200100/g' /lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt -echo "Patched /lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt . You can reboot and wifi should work, or do: rmmod brcmfmac; modprobe brcmfmac; " - -EOF - -chmod 755 /home/rocky/fix-wifi-rpi4.sh - -chown -R rocky:rocky /home/rocky # Cleanup before shipping an image @@ -155,6 +150,7 @@ touch /etc/machine-id rm -f "/etc/ssh/*_key*" + # Clean yum cache yum clean all @@ -162,9 +158,14 @@ 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 +# We must do this *outside* of the chroot, by grabbing the UUID of the loopmounted rootfs %post --nochroot # Extract the UUID of the rootfs partition from /etc/fstab diff --git a/createRocky9_Image.sh b/createRocky9_Image.sh index 4015ca5..a6e3259 100755 --- a/createRocky9_Image.sh +++ b/createRocky9_Image.sh @@ -4,7 +4,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 # after-the-fact # -# Usage: ./Rocky9_Rpi4_mkimage.sh /path/to/outputfolder/ +# Usage: ./createRocky9_Image.sh /path/to/outputfolder/ # # # Needs to be run in the same directory as the rocky rpi kickstart, as it relies on it! @@ -13,16 +13,41 @@ # Exit with error if we don't have an output directory: OUTDIR=$1 -if [[ -z "$OUTDIR" ]]; then +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 + + + 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}" +appliance-creator -v -c ./Rocky9_Rpi.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}" + +#chown -R $SUDO_USER. "${OUTDIR}"