split sbc into 3 profiles, gpt, mbr, and rpi

This commit is contained in:
Bryan Zuelly 2024-10-28 02:37:33 +00:00
parent c807a0fce6
commit 43dff877cf
13 changed files with 53 additions and 76 deletions

View File

@ -145,5 +145,6 @@ mock environment.
``` ```
% bash live-build.sh --live-image XFCE --output-dir /builddir/xfce % bash live-build.sh --live-image XFCE --output-dir /builddir/xfce
``` ```
#### SBC Images
Profiles choices include "GenericArm-GPT", "GenericArm-MBR", "RaspberryPi"

View File

@ -6,7 +6,7 @@
<user name="rocky" groups="rocky,wheel" password="thereisnopassword" home="/home/rocky" pwdformat="encrypted" /> <user name="rocky" groups="rocky,wheel" password="thereisnopassword" home="/home/rocky" pwdformat="encrypted" />
</users> --> </users> -->
<!-- Only for SBC --> <!-- Only for SBC -->
<users profiles="Core-Pi"> <users profiles="Core-Pi,CoreSBC">
<user password="$6$ggstAnji$tPNhSHa/OG4UrJ0P77ZHlCunu.pueMXtXgAER51mTJ7bpXl/onDplJXd0usMSlFP4gOn/A7BM7cGoVw/WcCKS." home="/home/rocky" name="rocky" groups="rocky,wheel"/> <user password="$6$ggstAnji$tPNhSHa/OG4UrJ0P77ZHlCunu.pueMXtXgAER51mTJ7bpXl/onDplJXd0usMSlFP4gOn/A7BM7cGoVw/WcCKS." home="/home/rocky" name="rocky" groups="rocky,wheel"/>
</users> </users>
</image> </image>

View File

@ -1 +1 @@
configs/rocky.xml configs/rocky-sbc-genericarm-gpt.xml

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<image schemaversion="7.4" name="Rocky"> <image schemaversion="7.5" name="Rocky-generic-gpt">
<description type="system"> <description type="system">
<author>Release Engineering (SIG/Core)</author> <author>Release Engineering (SIG/Core)</author>
<contact>releng@rockylinux.org</contact> <contact>releng@rockylinux.org</contact>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<image schemaversion="7.4" name="Rocky"> <image schemaversion="7.4" name="Rocky-generic-mbr">
<description type="system"> <description type="system">
<author>Release Engineering (SIG/Core)</author> <author>Release Engineering (SIG/Core)</author>
<contact>releng@rockylinux.org</contact> <contact>releng@rockylinux.org</contact>

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<image schemaversion="7.4" name="Rocky">
<description type="system">
<author>Release Engineering (SIG/Core)</author>
<contact>releng@rockylinux.org</contact>
<specification>Rocky Linux</specification>
</description>
<preferences>
<version>9</version>
<packagemanager>dnf</packagemanager>
<locale>en_US</locale>
<keytable>us</keytable>
<timezone>UTC</timezone>
<release-version>9</release-version>
</preferences>
<include from="this://./repositories/core.xml"/>
<include from="this://./repositories/altarch-common.xml"/>
<include from="this://./repositories/gnulab-tmp.xml"/>
<include from="this://./components/boot.xml"/>
<include from="this://./components/users.xml"/>
<include from="this://./sbc/pi.xml"/>
<packages type="bootstrap">
<package name="basesystem"/>
<package name="filesystem"/>
</packages>
</image>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<image schemaversion="7.4" name="Rocky"> <image schemaversion="7.4" name="Rocky-rpi">
<description type="system"> <description type="system">
<author>Release Engineering (SIG/Core)</author> <author>Release Engineering (SIG/Core)</author>
<contact>releng@rockylinux.org</contact> <contact>releng@rockylinux.org</contact>

View File

@ -6,4 +6,7 @@
<repository type="rpm-md" alias="gnulab_tmp_2" priority="1"> <repository type="rpm-md" alias="gnulab_tmp_2" priority="1">
<source path="https://rockyrepos.gnulab.org/rpir$releasever/"/> <source path="https://rockyrepos.gnulab.org/rpir$releasever/"/>
</repository> </repository>
<repository type="rpm-md" alias="codedude" priority="1">
<source path="https://sbccrazy.codedude.us/aarch64_el9/kernel-mainline-sbc/"/>
</repository>
</image> </image>

29
rootfs-expand Normal file
View File

@ -0,0 +1,29 @@
#!/bin/bash
clear
part=$(mount |grep '^/dev.* / ' |awk '{print $1}')
if [ -z "\$part" ];then
echo "Error detecting rootfs"
exit -1
fi
dev=$(echo $part|sed 's/[0-9]*$//g')
devlen=${#dev}
num=${part:$devlen}
if [[ "$dev" =~ ^/dev/(mmcblk|nvme[0-9]+n)[0-9]*p$ ]];then
dev=${dev:0:-1}
fi
if [ ! -x /usr/bin/growpart ];then
echo "Please install cloud-utils-growpart (sudo yum install cloud-utils-growpart)"
exit -2
fi
if [ ! -x /usr/sbin/resize2fs ];then
echo "Please install e2fsprogs (sudo yum install e2fsprogs)"
exit -3
fi
echo $part $dev $num
echo "Extending partition $num to max size ...."
growpart $dev $num
echo "Resizing ext4 filesystem ..."
resize2fs $part
echo "Done."
df -h |grep $part

View File

@ -80,19 +80,27 @@ function switch_repo_to_peridot() {
} }
function main() { function main() {
/bin/rm config.xml if [[ -e config.xml ]]; then
/bin/rm config.xml
fi
if [ ! -f "configs/rocky-sbc-${SBC,,}.xml" ]; then if [ ! -f "configs/rocky-sbc-${SBC,,}.xml" ]; then
echo "${LIVE} was not found. Is it supported?" echo "${LIVE} was not found. Is it supported?"
exit 42 exit 42
fi fi
ln -sf "configs/rocky-sbc-${SBC,,}.xml" config.xml #ln -sf "configs/rocky-sbc-${SBC,,}.xml" config.xml
if [ -n "$PERIDOTID" ]; then if [ -n "$PERIDOTID" ]; then
switch_repo_to_peridot "${PERIDOTID}" switch_repo_to_peridot "${PERIDOTID}"
fi fi
if [[ $SBC == "GenericArm-GPT" ]]; then
ln -s configs/rocky-sbc-genericarm-gpt.xml config.xml
elif [[ $SBC == "GenericArm-MBR" ]]; then
ln -s configs/rocky-sbc-genericarm-mbr.xml config.xml
else
ln -s configs/rocky-sbc-raspberrypi.xml config.xml
fi
# shellcheck disable=SC2086 # shellcheck disable=SC2086
kiwi-ng $DEBUG --type="oem" --profile="SBC-$SBC" --color-output system build --description="$SCRDIR" --target-dir "$OUTPUTDIR" kiwi-ng $DEBUG --type="oem" --profile="SBC-$SBC" --color-output system build --description="$SCRDIR" --target-dir "$OUTPUTDIR"
} }
main main

View File

@ -6,9 +6,6 @@
<profile name="SBC-RaspberryPi" description="Raspberry Pi Image"> <profile name="SBC-RaspberryPi" description="Raspberry Pi Image">
<requires profile="Core-Pi"/> <requires profile="Core-Pi"/>
</profile> </profile>
<profile name="SBC-GenericArm" description="Generic ARM Image">
<requires profile="Core-Pi"/>
</profile>
</profiles> </profiles>
<!-- RPI --> <!-- RPI -->
<preferences profiles="SBC-RaspberryPi" arch="aarch64"> <preferences profiles="SBC-RaspberryPi" arch="aarch64">
@ -28,25 +25,6 @@
<bootloader name="grub2" console="serial"/> <bootloader name="grub2" console="serial"/>
</type> </type>
</preferences> </preferences>
<preferences profiles="SBC-GenericArm" arch="aarch64">
<type image="oem"
filesystem="ext4"
bootpartition="true" bootpartsize="1000" bootfilesystem="ext4" efipartsize="500" firmware="efi"
kernelcmdline="root=LABEL=rootfs rootfstype=ext4 elevator=deadline rootwait console=ttyS0"
devicepersistency="by-label"
editbootinstall="sbc/editbootinstall_genericarm.sh"
rootfs_label="rootfs">
<oemconfig>
<oem-resize>false</oem-resize>
<oem-skip-verify>true</oem-skip-verify>
<oem-swap>true</oem-swap>
<oem-swapsize>500</oem-swapsize>
</oemconfig>
<bootloader name="grub2" console="serial"/>
<size unit="G">3</size>
</type>
</preferences>
<packages type="image" patternType="plusRecommended" profiles="Core-Pi"> <packages type="image" patternType="plusRecommended" profiles="Core-Pi">
<namedCollection name="core"/> <namedCollection name="core"/>
<package name="rocky-release"/> <package name="rocky-release"/>
@ -62,25 +40,8 @@
<package name="NetworkManager-wifi"/> <package name="NetworkManager-wifi"/>
<package name="rng-tools"/> <package name="rng-tools"/>
<package name="vim"/> <package name="vim"/>
</packages>
<packages type="image" patternType="plusRecommended" profiles="SBC-RaspberryPi">
<package name="rocky-release-rpi"/> <package name="rocky-release-rpi"/>
<package name="raspberrypi2-firmware"/> <package name="raspberrypi2-firmware"/>
<package name="raspberrypi2-kernel4"/> <package name="raspberrypi2-kernel4"/>
</packages> </packages>
<packages type="image" patternType="plusRecommended" profiles="SBC-GenericArm">
<package name="bcm2711-firmware"/>
<package name="bcm2835-firmware"/>
<package name="bcm283x-firmware"/>
<package name="bcm283x-overlays"/>
<package name="dracut-config-generic"/>
<package name="efibootmgr"/>
<package name="kernel"/>
<package name="kernel-core"/>
<package name="systemd-udev"/>
<package name="uboot-images-armv8"/>
<package name="uboot-tools"/>
<ignore name="dracut-config-rescue"/>
<ignore name="java-11-*"/>
</packages>
</image> </image>

View File

@ -50,5 +50,6 @@
<package name="uboot-tools"/> <package name="uboot-tools"/>
<ignore name="dracut-config-rescue"/> <ignore name="dracut-config-rescue"/>
<ignore name="java-11-*"/> <ignore name="java-11-*"/>
<ignore name="kernel-core-6*"/>
</packages> </packages>
</image> </image>

View File

@ -51,5 +51,6 @@
<package name="uboot-tools"/> <package name="uboot-tools"/>
<ignore name="dracut-config-rescue"/> <ignore name="dracut-config-rescue"/>
<ignore name="java-11-*"/> <ignore name="java-11-*"/>
<ignore name="kernel-core-6*"/>
</packages> </packages>
</image> </image>