### Slackware Installer script ############################################################################# # Script......: /usr/share/hwm-configure/platform/aarch64/installer/helper.scr/999-rpi-kernel-fork-configure # Called from : /usr/lib/setup/armedslack-postinstall-scripts/001-hwm-os-configure # This is 'sourced' from that helper script, hence we use 'return' rather than 'exit' # statements. If necessary in the future, we can have it 'forked' by including the special # token. # Purpose.....: Operating System configuration helper for the Raspberry Pi. # This configures the OS in line with the requirements of the RPi Kernel fork, and is used # only when by the RPi Slackware Installer variant. # Author......: Stuart Winter # Date........: 08-Nov-2025 ### Slackware Installer script ############################################################################ # Note: There is some duplication between this script and one of those included in the original Installer # /usr/share/hwm-configure/platform/aarch64/installer/helper.scr/999-rpi-vendor-kernel-transition # This is because the official AiO Installers are capable of transitioning to the RPi Kernel fork directly # thus need to make the same adjustments. However, that script also upgradepkg's to the RPi Kernel fork # packages upon user request, where as with SAIR (this script) we're booting and bundling the RPi Kernel # fork packages are the primary Kernel. # Neither of these helper scripts interfers with the other, as the other script exits if it finds our # feature flag file. # Only launch if this feature flag file exists within the Installer: [ ! -f /.is-rpi-kernel-fork ] && return 0 # Determine the Hardware Model name: export HWM=$( slk-hwm-discover ) # Determine archtecture: ARCH=$( slk-hwm-discover --print-arch ) # Quit silently if we're not running on a Raspberry Pi. # At some point we might need to differentiate between RPi models, but for the moment # the settings apply to all variants. [[ "$HWM" != "Raspberry Pi"* ]] && return 0 # The newly installed OS' /etc/inittab: inittabfile=${T_PX}/etc/inittab # U-Boot Boot Loader configuration file: uboot_bootloaderconf=${T_PX}/boot/extlinux/extlinux.conf # slackpkg's blacklist: slackpkgblacklistfile=${T_PX}/etc/slackpkg/blacklist # Raspberry Pi Native BL config.txt: slk_rpi_bl_conf=${T_PX}/boot/platform/hwm_bw/slk_config.txt # Serial address for Raspberry Pi variants: case "$HWM" in "Raspberry Pi 5"*) SERIALDEV=ttyAMA0;; # All other variants: "Raspberry Pi"*) SERIALDEV=ttyS0;; esac # Display info so we can identify the changes are being made: dialog \ --backtitle "Hardware Model Variant Customizations" \ --sleep 4 \ --infobox "\nAdjusting configurations for Raspberry Pi Kernel fork ..." 6 50 # Update serial console settings to align with the RPi Kernel fork's configuration: # # U-Boot Boot Loader configuration: # We no longer use U-Boot on the RPi, so commented. # This was required for U-Boot, but with the native BL, it doesn't seem necessary.. # It is necessary - we need to switch console=ttyS0 - but this is now performed within # 002-rpi_bl-configure #[ -f ${uboot_bootloaderconf} ] && { # sed -iE '/^[[:blank:]]*APPEND[[:blank:]]/ s/$/ 8250.nr_uarts=1 console=ttyS0,115200 console=tty1/' ${uboot_bootloaderconf} ;} # For the Native BL: # Instruct it that we're not using the mainline 'upstream' Kernel: # Commented because we don't seem to need this - the Kernel fork works anyway... #sed -i 's/^upstream_kernel=1/#&/' ${slk_rpi_bl_conf} # Adjustments of the Linux Kernel cmdline ops are performed within # /usr/share/hwm-configure/platform/aarch64/installer/helper.scr/003-rpi_bl-configure # since we're already touching the RPi's 'cmdline.txt', and it's easier to do it there. # /etc/inittab: # ttyS1 is set by the 'a/sysvinit-scripts' package's doinst.sh - all RPi's are currently # configured to set it to ttyS1. [ -f ${inittabfile} ] && sed -iE '/^s0:12345:/ s/ttyS1/'"${SERIALDEV}"'/' ${inittabfile} # Black list the regular Slackware Kernel to avoid them replacing the RPi Kernel fork: if [ -f ${slackpkgblacklistfile} ]; then cat << EOF >> ${slackpkgblacklistfile} # Blacklist the official Linux Kernel Slackware packages so that the # Raspberry Pi Kernel fork packages can remain installed. kernel_armv8 kernel-source # The kernel-headers package should not be blacklisted. The official Slackware # package should remain - there's no need to install an RPi specific version. #kernel-headers EOF fi