Compare commits
No commits in common. "expand-rootfs-improvements" and "main" have entirely different histories.
expand-roo
...
main
@ -1,3 +1 @@
|
|||||||
# Kickstarts
|
This repo to hold the KS to generate generic aarch64 rocky images for SoC such as RPI, Rockchip and others...
|
||||||
|
|
||||||
KickStart repo based on https://github.com/psgreco/all-kickstarts/tree/wip-generic
|
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
%include includes/rockyrepos9.ksi
|
|
||||||
%include includes/gen-reposcommon9.ksi
|
|
||||||
%include includes/gen-rockycommon9.ksi
|
|
@ -1,20 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
KSFILE=$1
|
|
||||||
KSNAME=${KSFILE%.ks}
|
|
||||||
|
|
||||||
if [ ! -f "${KSFILE}" ]; then
|
|
||||||
echo
|
|
||||||
echo "SYNOPSIS"
|
|
||||||
echo " $0 <KICKSTARTFILE>"
|
|
||||||
echo
|
|
||||||
echo "EXAMPLE"
|
|
||||||
echo " $0 Rocky-Userland-9-aarch64-Generic-Minimal-4.ks"
|
|
||||||
echo
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
set -x
|
|
||||||
appliance-creator -c ${KSFILE} \
|
|
||||||
-d -v --logfile /var/tmp/${KSNAME}.log \
|
|
||||||
--cache /root/cache --no-compress \
|
|
||||||
-o /var/tmp/appoutput --format raw --name ${KSNAME} | tee /var/tmp/${KSNAME}.log.2
|
|
@ -1,9 +0,0 @@
|
|||||||
keyboard us --xlayouts=us --vckeymap=us
|
|
||||||
timezone --isUtc --nontp UTC
|
|
||||||
selinux --enforcing
|
|
||||||
firewall --enabled --port=22:tcp
|
|
||||||
network --bootproto=dhcp --device=link --activate --onboot=on
|
|
||||||
services --enabled=sshd,NetworkManager,chronyd
|
|
||||||
shutdown
|
|
||||||
bootloader --location=mbr --driveorder=sda
|
|
||||||
lang en_US.UTF-8
|
|
@ -1,16 +0,0 @@
|
|||||||
# Package setup
|
|
||||||
%packages
|
|
||||||
dracut-config-generic
|
|
||||||
kernel
|
|
||||||
kernel-core
|
|
||||||
grub2-common
|
|
||||||
grub2-efi-aa64
|
|
||||||
grub2-efi-aa64-modules
|
|
||||||
grubby
|
|
||||||
efibootmgr
|
|
||||||
shim-aa64
|
|
||||||
systemd-udev
|
|
||||||
uboot-tools
|
|
||||||
-dracut-config-rescue
|
|
||||||
|
|
||||||
%end
|
|
@ -1,6 +0,0 @@
|
|||||||
# Disk setup
|
|
||||||
clearpart --initlabel --all
|
|
||||||
part /boot/efi --asprimary --fstype=efi --size=512
|
|
||||||
part /boot --asprimary --fstype=ext4 --size=1024 --label=boot
|
|
||||||
part swap --asprimary --fstype=swap --size=512 --label=swap
|
|
||||||
part / --asprimary --fstype=ext4 --size=3072 --label=rootfs
|
|
@ -1,56 +0,0 @@
|
|||||||
%post
|
|
||||||
# Setting correct yum variable to use raspberrypi kernel repo
|
|
||||||
#echo "generic" > /etc/dnf/vars/kvariant
|
|
||||||
#
|
|
||||||
# Creating rocky user and add to wheel group
|
|
||||||
/sbin/useradd -c "Rocky Linux default user" -G wheel -m -U rocky
|
|
||||||
echo "rockylinux" | passwd --stdin rocky
|
|
||||||
# Generic efi filename for VMs
|
|
||||||
mkdir -p /boot/efi/EFI/BOOT
|
|
||||||
if [ -d /boot/efi/EFI/rocky/ ] && [ -f /boot/efi/EFI/rocky/grubaa64.efi ];then
|
|
||||||
for j in grub.cfg grubenv;do
|
|
||||||
mv -f /boot/grub2/${j} /boot/efi/EFI/rocky/
|
|
||||||
ln -s ../efi/EFI/rocky/${j} /boot/grub2/${j}
|
|
||||||
done
|
|
||||||
cp -f /boot/efi/EFI/rocky/grubaa64.efi /boot/efi/EFI/BOOT/BOOTAA64.EFI
|
|
||||||
fi
|
|
||||||
|
|
||||||
cp -f /usr/share/uboot/rpi_3/u-boot.bin /boot/efi/rpi3-u-boot.bin
|
|
||||||
cp -f /usr/share/uboot/rpi_4/u-boot.bin /boot/efi/rpi4-u-boot.bin
|
|
||||||
|
|
||||||
rpm -e dracut-config-generic
|
|
||||||
|
|
||||||
#setup dtb link by running "creating 10-devicetree.install"
|
|
||||||
if [ -x /lib/kernel/install.d/10-devicetree.install ];then
|
|
||||||
/lib/kernel/install.d/10-devicetree.install remove
|
|
||||||
fi
|
|
||||||
|
|
||||||
### Write /etc/sysconfig/kernel
|
|
||||||
cat << EOF > /etc/sysconfig/kernel
|
|
||||||
# Written by image installer
|
|
||||||
# UPDATEDEFAULT specifies if new-kernel-pkg should make new kernels the default
|
|
||||||
UPDATEDEFAULT=yes
|
|
||||||
|
|
||||||
# DEFAULTKERNEL specifies the default kernel package type
|
|
||||||
DEFAULTKERNEL=kernel-core
|
|
||||||
EOF
|
|
||||||
chmod 644 /etc/sysconfig/kernel
|
|
||||||
|
|
||||||
### Write grub defaults, turn off OS probing as it is always wrong for image creation
|
|
||||||
cat << EOF > /etc/default/grub
|
|
||||||
GRUB_TIMEOUT=5
|
|
||||||
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
|
|
||||||
GRUB_DEFAULT=saved
|
|
||||||
GRUB_DISABLE_SUBMENU=true
|
|
||||||
GRUB_TERMINAL_OUTPUT="console"
|
|
||||||
GRUB_CMDLINE_LINUX=""
|
|
||||||
GRUB_DISABLE_RECOVERY="true"
|
|
||||||
GRUB_DISABLE_OS_PROBER="true"
|
|
||||||
GRUB_ENABLE_BLSCFG="false"
|
|
||||||
EOF
|
|
||||||
chmod 644 /etc/default/grub
|
|
||||||
# fixing the rpmdb
|
|
||||||
rpm --rebuilddb
|
|
||||||
# remove /boot/dtb for some rpi to boot
|
|
||||||
rm -f /boot/dtb
|
|
||||||
%end
|
|
@ -1 +0,0 @@
|
|||||||
repo --name="instKern" --baseurl=https://rockyrepos.gnulab.org/gen_aarch64_el9/ --cost=100 --install
|
|
@ -1,9 +0,0 @@
|
|||||||
rootpw --lock
|
|
||||||
%include includes/basecommon9.ksi
|
|
||||||
%include includes/gen-partitions9.ksi
|
|
||||||
%include includes/packages9.ksi
|
|
||||||
%include includes/gen-packages9.ksi
|
|
||||||
%include includes/precommon9.ksi
|
|
||||||
%include includes/rockyreadme9.ksi
|
|
||||||
%include includes/gen-postcommon9.ksi
|
|
||||||
%include includes/postcommon9.ksi
|
|
@ -1,25 +0,0 @@
|
|||||||
# Package setup
|
|
||||||
%packages
|
|
||||||
@core
|
|
||||||
|
|
||||||
# other necessary packages
|
|
||||||
bash-completion
|
|
||||||
chrony
|
|
||||||
cloud-utils-growpart
|
|
||||||
e2fsprogs
|
|
||||||
glibc-langpack-en
|
|
||||||
nano
|
|
||||||
net-tools
|
|
||||||
NetworkManager-wifi
|
|
||||||
|
|
||||||
# uboot stuff
|
|
||||||
bcm2711-firmware
|
|
||||||
bcm2835-firmware
|
|
||||||
bcm283x-firmware
|
|
||||||
bcm283x-overlays
|
|
||||||
uboot-images-armv8
|
|
||||||
|
|
||||||
# remove this
|
|
||||||
-java-11-*
|
|
||||||
|
|
||||||
%end
|
|
@ -1,10 +0,0 @@
|
|||||||
%post
|
|
||||||
# Remove ifcfg-link on pre generated images
|
|
||||||
rm -f /etc/sysconfig/network-scripts/ifcfg-link
|
|
||||||
|
|
||||||
# Remove machine-id on pre generated images
|
|
||||||
rm -f /etc/machine-id
|
|
||||||
touch /etc/machine-id
|
|
||||||
|
|
||||||
%end
|
|
||||||
%include includes/rootfs-expand.ksi
|
|
@ -1,4 +0,0 @@
|
|||||||
%pre
|
|
||||||
|
|
||||||
#End of Pre script for partitions
|
|
||||||
%end
|
|
@ -1,11 +0,0 @@
|
|||||||
%post
|
|
||||||
# Mandatory README file
|
|
||||||
cat >/root/README << EOF
|
|
||||||
== Rocky Linux 9 ==
|
|
||||||
|
|
||||||
If you want to automatically resize your / partition, just type the following (as root user):
|
|
||||||
rootfs-expand
|
|
||||||
|
|
||||||
EOF
|
|
||||||
|
|
||||||
%end
|
|
@ -1,6 +0,0 @@
|
|||||||
# Basic setup information
|
|
||||||
url --url="https://download.rockylinux.org/pub/rocky/9/BaseOS/aarch64/os/"
|
|
||||||
# Repositories to use
|
|
||||||
repo --name="rocky9-baseos" --baseurl=https://download.rockylinux.org/pub/rocky/9/BaseOS/aarch64/os/
|
|
||||||
repo --name="rocky9-appstream" --baseurl=https://download.rockylinux.org/pub/rocky/9/AppStream/aarch64/os/
|
|
||||||
repo --name="rocky9-powertools" --baseurl=https://download.rockylinux.org/pub/rocky/9/CRB/aarch64/os/
|
|
@ -1,32 +0,0 @@
|
|||||||
%post
|
|
||||||
cat << EOF > /usr/local/bin/rootfs-expand
|
|
||||||
#!/usr/bin/env bash
|
|
||||||
set -euf -o pipefail
|
|
||||||
|
|
||||||
ROOT_PART=\$(mount | grep ' on / ' | awk '{print \$1}')
|
|
||||||
if [[ \${ROOT_PART} =~ "mmcblk" || \${ROOT_PART} =~ "nvme" ]]; then
|
|
||||||
DEV=\$(echo "\${ROOT_PART}" | rev | sed -r 's/^.{2}//' | rev)
|
|
||||||
INTERMEDIATE_DEV="\${DEV}p"
|
|
||||||
elif [[ \${ROOT_PART} =~ "vd" || \${ROOT_PART} =~ "sd" ]]; then
|
|
||||||
DEV=\$(echo "\${ROOT_PART}" | rev | sed -r 's/^.{1}//' | rev)
|
|
||||||
INTERMEDIATE_DEV="\${DEV}"
|
|
||||||
else
|
|
||||||
>&2 echo "\$0: device type unsupported"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
PART_NUM="\${ROOT_PART#"\$INTERMEDIATE_DEV"}"
|
|
||||||
|
|
||||||
echo "\${DEV} \${PART_NUM} \${ROOT_PART}"
|
|
||||||
|
|
||||||
echo "Extending partition \${PART_NUM} of \${DEV} to max size..."
|
|
||||||
growpart "\${DEV}" "\${PART_NUM}"
|
|
||||||
|
|
||||||
echo "Resising ext4 filesystem on \${ROOT_PART}..."
|
|
||||||
resize2fs "\${ROOT_PART}"
|
|
||||||
|
|
||||||
echo "Done."
|
|
||||||
df -kh | head -n 1 && df -kh | grep "\${DEV}" | sort
|
|
||||||
EOF
|
|
||||||
|
|
||||||
chmod +x /usr/local/bin/rootfs-expand
|
|
||||||
%end
|
|
Loading…
Reference in New Issue
Block a user