commit 66197bde6006b52a669dd9d9f684a496392ee597 Author: Skip Grube Date: Tue Oct 15 15:38:29 2024 -0400 Initial commit kickstart, launcher script, and readme diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..4b56b77 --- /dev/null +++ b/readme.txt @@ -0,0 +1,60 @@ +Skip's Rocky 9 i686 experiment +############################### + +Background +########### +Simple project, simple goal: Get Rocky 9 latest booting and working on i686 (32 bit) hardware. Why? Because we can. And it's fun! + +Almost everything we need is already present in the distro. The Rocky project needs to build the vast majority of itself as i686 anyway, to satisfy multilib requirements. +Fortunately thanks to excellent publication and repo management, an almost-complete i686 distro is ready-published in the "devel" repository: https://dl.rockylinux.org/pub/rocky/9/devel/i686/ +It won't have everything (Lots of GUI programs like Firefox are missing), but certainly enough to make a functional system + + +Only one (big) piece is missing: the kernel. The RHEL/Rocky kernel build is unsuitable for this, having patches on top of patches with a tricky build process. +Fortunately, there is a much cleaner kernel RPM courtesy of ELRepo (elrepo.org). A set of i686 kernel RPMS was built from the kernel-lt 6.1.x base in short order, and they seem to work! +Combining these i686 kernel RPMs with the Rocky 9 devel/ i686 repository gives everything you need for a bootable system. Kickstart and livemedia-creator means a rudimentary image is currently prototyped and available. + + + +Where to Download +############## + +QCow2 image: https://skiprocky.linuxdn.org/Rocky9_i686/ + +DNF i686 kernel repo: https://skiprocky.linuxdn.org/Rocky9_i686/kernel_repo/ +Kickstart + scripts for image create: https://git.resf.org/skip/rocky-i686 +kernel sources (elrepo fork): https://git.resf.org/skip/kernel-lt +Rocky 9 i686 devel (userspace packages): https://dl.rockylinux.org/pub/rocky/9/devel/i686/ + + + +Image Info +########### + +Login: + root : Rockyi686Test + Recommend you change it. + + +Cloud-init: + Is available and setup by default. If you have means of triggering it, additional users/auth methods could be set up upon boot + + +Write disk to physical drive or USB: + qemu-img convert -f qcow2 -O raw rocky9_i686.qcow2 /dev/sdb + (IMPORTANT: make sure "/dev/sdb" is your target device! Don't overwrite your main system's drive!) + + +Expand disk to fill hard drive: + growpart /dev/sda 2 + resize2fs /dev/sda2 + + (This assumes "/dev/sda" is the drive in the installed system. It could be different - check with blkid) + + +Building the image: + Run ./rocky9_i686_build.sh with administrator privileges. You will need to update the script - point to a valid Rocky 9 boot iso (stock iso is fine). + You also need qemu-kvm and livemedia-creator (lorax) installed + + + diff --git a/rocky9_i686.ks b/rocky9_i686.ks new file mode 100644 index 0000000..7a8a287 --- /dev/null +++ b/rocky9_i686.ks @@ -0,0 +1,241 @@ +lang en_US.UTF-8 +keyboard us +timezone --utc UTC +# Disk +bootloader --append="no_timer_check net.ifnames=0" --location=mbr --timeout=5 +auth --enableshadow --passalgo=sha512 +selinux --permissive +firewall --enabled --service=ssh +firstboot --disable +# Network information +network --bootproto=dhcp --device=link --activate --onboot=on +# Root password +services --disabled="kdump,rhsmcertd" --enabled="NetworkManager,sshd,rsyslog,chronyd,cloud-init,cloud-init-local,cloud-config,cloud-final,rngd" + +# DEBUG :: set root password static for now +rootpw Rockyi686Test +shutdown + +## +## + +%pre +# Set up storage +( +# Clear the Master Boot Record +dd if=/dev/zero of=/dev/sda bs=512 count=1 +# Create a new GPT partition table +parted /dev/sda mklabel msdos + +# Create a partition for /boot +parted /dev/sda mkpart primary ext4 1MiB 1000MiB +parted /dev/sda set 1 boot on + +# Create for / +parted /dev/sda mkpart primary ext4 1000MiB 9000MiB +) &> /tmp/storage_setup.log +%end + +### +### + +part /boot --fstype="ext4" --label=boot --size=1000 --onpart="sda1" +part / --size=8000 --fstype="ext4" --onpart="sda2" + +### +### + +url --url=https://skiprocky.linuxdn.org/Rocky9_i686/kernel_repo/ +repo --name=Rocky9_Kernel_i686 --cost=20 --baseurl=https://skiprocky.linuxdn.org/Rocky9_i686/kernel_repo/ +repo --name=Rocky9_i686 --cost=200 --baseurl=http://dl.rockylinux.org/pub/rocky/9/devel/i686/os/ + +### +### + +%packages --nocore +# @Core group (no groupinfo in i686 devel, have to list it out here): +audit +basesystem +bash +coreutils +cronie +crypto-policies +crypto-policies-scripts +curl +dnf +e2fsprogs +filesystem +firewalld +glibc +grubby +hostname +iproute +iproute-tc +iputils +irqbalance +kbd +kexec-tools +less +logrotate +man-db +ncurses +openssh-clients +openssh-server +p11-kit +parted +passwd +policycoreutils +procps-ng +rootfiles +rpm +rpm-plugin-audit +rsyslog +selinux-policy-targeted +setup +shadow-utils +sssd-common +sssd-kcm +sudo +systemd +util-linux +vim-minimal +xfsprogs +yum +NetworkManager +NetworkManager-team +NetworkManager-tui +authselect +dnf-plugins-core +dracut-config-rescue +initscripts-rename-device +iwl100-firmware +iwl1000-firmware +iwl105-firmware +iwl135-firmware +iwl2000-firmware +iwl2030-firmware +iwl3160-firmware +iwl5000-firmware +iwl5150-firmware +iwl6000g2a-firmware +iwl6050-firmware +iwl7260-firmware +libsysfs +linux-firmware +lshw +lsscsi +microcode_ctl +#prefixdevname +python3-libselinux +sg3_utils +sg3_utils-libs + +# Other core packages needed: +rocky-release +dnf +yum +nfs-utils +dnf-utils +hostname + + +# Extra goodies from stock GenericCloud image: +cloud-init +cloud-utils-growpart +python3-jsonschema +dracut-config-generic +firewalld +tar +tcpdump +rsync +rng-tools +cockpit-ws +cockpit-system +#qemu-guest-agent +virt-what + +# i686 specific kernel and bootloaders: +kernel-lt +kernel-lt-core +kernel-lt-modules +kernel-lt-modules-extra +grub2-pc +grub2-pc-modules +grub2-tools +grub2-tools-extra + + +# Other +glibc-langpack-en +glibc-all-langpacks +tmux +bash-completion +wget +%end + +### +### + + +%post --erroronfail +# Ensure legacy BIOS is installed properly (this is i686, no UEFI here) +grub2-install --target=i386-pc /dev/sda +grubby --update-kernel=ALL --remove-args " crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M" --args="console=ttyS0,115200 forcepae" + +# setup systemd to boot to the right runlevel +rm -f /etc/systemd/system/default.target +ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target + +# generic localhost names +cat > /etc/hosts << EOF +127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 +::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 +EOF + + +echo "Fixing SELinux contexts." +touch /var/log/cron +touch /var/log/boot.log +mkdir -p /var/cache/yum +/usr/sbin/fixfiles -R -a restore + + +rm -f /var/lib/systemd/random-seed +cat /dev/null > /etc/machine-id + +%end + +### + +%post --erroronfail + +# Set up repos to only point to i686-kernel and i686 Rocky devel: +sed -i 's/enabled=1/# Disabling repo due to i686-only system\nenabled=0/' /etc/yum.repos.d/*.repo + +cat < /etc/yum.repos.d/Rocky9_i686.repo +# Skips i686 Rocky kernel (adapted from ELRepo) +[kernel-i686] +name=kernel-i686 +baseurl=https://skiprocky.linuxdn.org/Rocky9_i686/kernel_repo/ +priority=20 +gpgcheck=0 +enabled=1 + + +# Rocky 9 "devel" repo has all i686 packages needed in userspace +[Rocky9-i686] +name=Rocky9-i686 +baseurl=https://dl.rockylinux.org/pub/rocky/9/devel/i686/os/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 +enabled=1 +EOF + + +# Set up swapfile: +dd if=/dev/zero of=/var/swap.img bs=10M count=150 +mkswap /var/swap.img +chmod 0600 /var/swap.img +echo "/var/swap.img none swap defaults 0 0" >> /etc/fstab + +%end diff --git a/rocky9_i686_build.sh b/rocky9_i686_build.sh new file mode 100755 index 0000000..10d13a3 --- /dev/null +++ b/rocky9_i686_build.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Change ROCKYISO to a proper Rocky 9 boot iso path - it will launch and run Anaconda +# can connect via VNC to localhost:5931 to examine the system as it builds + +# This should be run as root/sudo. Log output goes in the current dir, image goes in ./rocky9_i686_image/ + +rm -rf $(pwd)/rocky9_i686_image +rm -f $(pwd)/*.log + +ROCKYISO=/root/Rocky-9-latest-x86_64-boot.iso + +livemedia-creator \ +--ks ./rocky9_i686.ks \ +--resultdir $(pwd)/rocky9_i686_image \ +--project "Rocky 9 i686" \ +--make-disk --qcow2 --image-type qcow2 \ +--iso ${ROCKYISO} \ +--vnc="vnc=127.0.0.1:31" --ram 4096 --vcpus 2 \ +--image-name "rocky9_i686.qcow2"