diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..28abd5b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +output/* +logs/* diff --git a/README.md b/README.md index 3593aab..db0d108 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://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 diff --git a/Rocky8_Rpi4.ks b/Rocky8_Rpi.ks similarity index 100% rename from Rocky8_Rpi4.ks rename to Rocky8_Rpi.ks diff --git a/Rocky8_Rpi4_mkimage.sh b/createRocky8_Image.sh similarity index 53% rename from Rocky8_Rpi4_mkimage.sh rename to createRocky8_Image.sh index b899dee..ef2b0ea 100755 --- a/Rocky8_Rpi4_mkimage.sh +++ b/createRocky8_Image.sh @@ -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}" diff --git a/readme.image.txt b/readme.image.txt index c69c449..68c462e 100644 --- a/readme.image.txt +++ b/readme.image.txt @@ -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