init branch r9

This commit is contained in:
Pratham Patel 2023-07-27 19:53:23 +05:30
commit d076efa5cb
No known key found for this signature in database
8 changed files with 149 additions and 0 deletions

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# README
**Kickstart syntax reference**: https://docs.fedoraproject.org/en-US/fedora/f36/install-guide/appendixes/Kickstart_Syntax_Reference/

View File

@ -0,0 +1,5 @@
%includes includes/.rocky-9-repos.ksi
%includes includes/base-config.ksi
%includes includes/disk-layout.ksi
%includes includes/package-list.ksi
%includes includes/post-install.ksi

24
create-image.sh Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env bash
REAL_USER=$(who am i | awk '{print $1}')
APPLIANCE_NAME="Rocky-9-aarch64-minimal"
KICKSTARTER_FILENAME="${APPLIANCE_NAME}.ks"
if [[ ${EUID} -ne 0 ]]; then
>&2 echo "ERROR: Please run this script as root"
exit 1
fi
appliance-creator \
--config "${KICKSTARTER_FILENAME}" \
--name "${APPLIANCE_NAME}" \
--format raw \
--checksum \
--no-compress \
--outdir "${PWD}" \
--debug \
--verbose \
1> Rocky-9-aarch64-minimal.stdout.log \
2> Rocky-9-aarch64-minimal.stderr.log
chown "${REAL_USER}:${REAL_USER}" "${APPLIANCE_NAME}*"

View File

@ -0,0 +1,17 @@
# Specify where our (Rocky Linux's) "base" resides
url --url=https://download.rockylinux.org/pub/rocky/9/BaseOS/aarch64/os
# Mirrors for the default repositories
# the 'kernel-*' packages are disabled from these "default" repositories
# because we will use either the LTS kernel or the latest mainline kernel
# from the '<sig-kernel>' repo
repo --install --excludepkgs=kernel-* --name=AppStream --mirrorlist=https://mirrors.rockylinux.org/mirrorlist?repo=AppStream-9&arch=aarch64
repo --install --excludepkgs=kernel-* --name=BaseOS --mirrorlist=https://mirrors.rockylinux.org/mirrorlist?repo=BaseOS-9&arch=aarch64
repo --install --excludepkgs=kernel-* --name=CRB --mirrorlist=https://mirrors.rockylinux.org/mirrorlist?repo=CRB-9&arch=aarch64
# Enable two additional repositories
# <sig-altarch>: All SBC-specific stuff that is not "Enterprise Linux" (uboot, on-board WiFi/BT firmware and other tools)
# <sig-kernel>: Newer kernels than what RHEL ships ('kernel-ml' and 'kernel-lts-<x.yy>')
#repo --install --name=<sig-altarch> --mirrorlist=https://mirrors.rockylinux.org/mirrorlist?repo=<sig-altarch>-9&arch=aarch64
#repo --install --name=<sig-kernel> --mirrorlist=https://mirrors.rockylinux.org/mirrorlist?repo=<sig-kernel>-9&arch=aarch64
repo --name="instKern" --baseurl=https://rockyrepos.gnulab.org/gen_aarch64_el9/ --cost=100 --install

11
includes/base-config.ksi Normal file
View File

@ -0,0 +1,11 @@
keyboard us --vckeymap=us --xlayouts=us
lang en_US.UTF-8
services --enabled=chronyd,NetworkManager,sshd
#services --disabled=
skipx # disable X by default
timezone UTC
selinux --enforcing
firewall --enabled --service=sshd
network --bootproto=dhcp --onboot=on
bootloader --location=mbr --boot-drive=sda
shutdown # power-off after the installation completes

6
includes/disk-layout.ksi Normal file
View File

@ -0,0 +1,6 @@
# Remove all partitions
clearpart --drives=sda --disklabel=rocky-linux --all
# Create partitions
part /boot/efi --asprimary --ondisk=sda --size=1024 --label=boot --fstype=efi
part / --asprimary --ondisk=sda --size=4096 --label=root --fstype=ext4

45
includes/package-list.ksi Normal file
View File

@ -0,0 +1,45 @@
%packages
# Include all packages under '@core'
@core
# Extra packages to do 'uboot -> grub -> linux'
dracut-config-generic
efibootmgr
grub2-common
grub2-efi-aa64
grub2-efi-aa64-modules
grubby
kernel
kernel-core
shim-aa64
systemd-udev
uboot-tools
# Other packages
bash-completion
chrony
cloud-utils-growpart
glibc-langpack-en
nano
net-tools
NetworkManager-wifi
tmux
# SIG/AltArch stuff
uboot-images-armv8
# Raspberry Pi firmware
bcm2711-firmware
bcm2835-firmware
bcm283x-firmware
# Raspberry Pi overlays
bcm283x-overlays
# Remove some packages
-java-11-*
-dracut-config-rescue
%end

38
includes/post-install.ksi Normal file
View File

@ -0,0 +1,38 @@
%post
# User setup
DEFAULT_USERNAME='rocky'
DEFAULT_PASSWORD='rockylinux'
DEFAULT_GROUPS='wheel'
useradd --comment "Rocky Linux" \
--uid 1000 \
--create-home \
--user-group "${DEFAULT_USERNAME}" \
--groups "${DEFAULT_GROUPS}"
echo -e "${DEFAULT_PASSWORD}\n${DEFAULT_PASSWORD}" | passwd "${DEFAULT_USERNAME}"
passwd -e "${DEFAULT_USERNAME}"
# Lock the root account
passwd -l root
# GRUB setup
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
# Rebuild the RPM database
rpm --rebuilddb
%end