Merge pull request 'r8' (#2) from codedude/RockyRpi:r8 into r8

Reviewed-on: #2
This commit is contained in:
Skip Grube 2022-07-04 20:21:34 +00:00
commit fc2f5eb41b
5 changed files with 32 additions and 17 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
output/*
logs/*

View File

@ -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://rocky.lowend.ninja/RockyRpi/RockyRpi_Images/
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/
The readme.image.txt file has information and instructions for those interested in downloading and using the ready-made image.
@ -13,7 +13,9 @@ 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**
* git
* Packages
* git
* EPEL repo enabled (extra packages for enterprise linux)
* The appliance-creator program from appliance-tools package ( ```sudo dnf install appliance-tools``` )
@ -23,17 +25,15 @@ The included script to create the image is quite simple. Simply run it (with su
For example:
`sudo ./Rocky8_Rpi4_mkimage.sh /home/myhomefolder/Rocky8_image/`
`sudo ./createRocky8_Image.sh /home/myhomefolder/Rocky8_image/`
The kickstart/image build process takes approximately 10 minutes on a Raspberry Pi 4 with a decently fast internet connection.
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)
## Customizing the Kickstart
All the setup logic for the image is contained within the kickstart file (Rocky8_Rpi4.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.
Additionally, the mkimage script is very simple, and you can certainly customize it (or just run your own command) if you need to change the appliance-creator settings.
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.
# Contributing

View File

@ -1,28 +1,41 @@
#!/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
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
mkdir -p "${OUTDIR}"
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 --vmem=2048 --vcpu=2 --no-compress -o "${OUTDIR}"
chown -R $SUDO_USER. "${OUTDIR}"
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}"

View File

@ -1,4 +1,4 @@
(This file comes from the kickstart/appliance-creator repo: https://git.rockylinux.org/skip/RockyRpi )
(This file comes from the kickstart/appliance-creator repo: https://git.resf.org/codedude/RockyRpi )
Rocky 8 Raspberry Pi Images