[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
slackwarearm:development_refguide_di [2022/03/22 11:52 (UTC)] mozesslackwarearm:development_refguide_di [2024/01/21 12:28 (UTC)] (current) – [Brain Dump] Kernel module loader example mralk3
Line 1: Line 1:
-<note warning>March 2022 - work in progress. needs to cover all supported HWM's</note>+<note warning>March 2022 - work in progress. needs to cover all supported HWM's. Will be split into separate documents.</note> 
 + 
 + 
 + 
  
  
Line 7: Line 11:
 | Version          | 1.00, April 2022 | | Version          | 1.00, April 2022 |
 | Author           | Stuart Winter <mozes@slackware> | | Author           | Stuart Winter <mozes@slackware> |
 +
 +==== Brain Dump ====
 +
 +[[https://www.linuxquestions.org/questions/slackware-arm-108/direct-integration-rock5-4175724301/|Brain Dump onto LQ]] - needs sorting into individual pages
 +
 +[[https://www.linuxquestions.org/questions/slackware-arm-108/slackware-aarch64-raspberry-pi-400-hardware-support-4175733019/| Brain Dump on LQ 2.0]] - Kernel module loader example
  
  
Line 24: Line 34:
  
 This document is aimed at advanced Slackware and Linux users. This document is aimed at advanced Slackware and Linux users.
 +
 +====== Slackware ARM Development Kit ====== 
 +
 +Using any of the build system referenced here requires the [[http://ftp.arm.slackware.com/slackwarearm/slackwareaarch64-current/source/README_SOURCE.txt|Slackware ARM development kit]] to be installed and configured natively on an installation of Slackware ARM.
 +
 +The Slackware ARM Development Kit is contained within the 'd' package series and will be installed as part of a full Slackware installation.
  
 ======  Bootware ====== ======  Bootware ======
Line 29: Line 45:
 The boot loader employed on the RockPro64 and PineBook Pro is [[https://www.denx.de/wiki/U-Boot|U-Boot]]. The boot loader employed on the RockPro64 and PineBook Pro is [[https://www.denx.de/wiki/U-Boot|U-Boot]].
  
-====== Trusted Firmware-A (ARM Trusted Firmware) ======+==== Secure Boot ==== 
 + 
 +Presently none of the bootware assets supplied by Slackware ARM are signed.  However, the Slackware Linux project does have a suitable signing key that can be used when necessary for Directly Integrated Hardware Models (i.e. supported directly by Slackware ARM). 
 + 
 +If the Hardware Model you're interested mandates Secure Boot, you'll need to figure this out for yourself. 
 + 
 + 
 +==== Trusted Firmware-A (ARM Trusted Firmware) ====
  
 The ARM Trusted Firmware is embedded within the supplied U-Boot loader, and aren't used by the end-user directly. The ARM Trusted Firmware is embedded within the supplied U-Boot loader, and aren't used by the end-user directly.
Line 40: Line 63:
 | [[http://ftp.arm.slackware.com/slackwarearm/platform/aarch64/bootware/src/atf.build|Build script]] | Builds the Trusted Firmware for supported Hardware Models |  | [[http://ftp.arm.slackware.com/slackwarearm/platform/aarch64/bootware/src/atf.build|Build script]] | Builds the Trusted Firmware for supported Hardware Models | 
  
-====== U-Boot Boot Loader ======+==== U-Boot Boot Loader ====
  
-======= Recovery / Initialisation SD Card image =======+==== Recovery / Initialisation SD Card image ====
  
-* Needs script work to create one 
  
-======= U-Boot configured to boot from SPI Flash =======+==== U-Boot configured to boot from SPI Flash ====
  
-======= U-Boot configured to boot from SD Card =======+==== U-Boot configured to boot from SD Card ====
  
 Built and available but not used for either the Operating System Installation nor Operating System Proper. Built and available but not used for either the Operating System Installation nor Operating System Proper.
Line 58: Line 80:
  
  
-====== Slackware Operating System ======+====== Slackware Installer ======
  
 +Note: these scripts are not yet available within the Slackware ARM source tree.  They need to be extracted from the Installer image.
  
-===== Kernel =====+^ Script                                     ^ Called from  ^ Purpose ^ Hardware Models ^ 
 +| /etc/rc.d/rc.installerconfig               | init         | Hardware Model Installer Runtime Configuration Adjustments (CPU fan control, installer font size etc.) | All | 
 +| /usr/lib/setup/armedslack-clock-set        | /etc/rc.d/rc.S | If wrong time,set the clock with Slackware Installer build date. This indicates no RTC. | All | 
 +| /usr/lib/setup/armedslack-SeTpartitions    | /usr/lib/setup/SeTpartitions | Automatic Handling of the OS /boot Partition | All |
  
-<note>All Hardware Models are supported by a single generic Kernel.</note>+==== Slackware ARM Post Installation Setup Scripts ====
  
-^ Package Series ^ Package ^ Asset  ^ Src ^ 
-| k | kernel-source | configs/config-armv8 | [[http://ftp.arm.slackware.com/slackwarearm/slackwareaarch64-current/source/k/configs/config-armv8|Slackware AArch64 generic Kernel configuration]] | 
  
-^Change Management Process^ +The Slackware ARM post installation setup scripts are contained within '' /usr/lib/setup/armedslack-postinstall-scripts'' and are all called from ''/usr/lib/setup/armedslack-run-postinstall-scripts''
-| Email the new Kernel configuration to the Slackware ARM devel mailing list with a summary of what the changes were for. |+
  
-=== Kernel Package Build Helpers ===+''/usr/lib/setup/armedslack-run-postinstall-scripts'' is sourced/run from ''/usr/lib/setup/SeTconfig'' immediately prior to running the Slackware package setup scripts (named ''setup.*'') within the newly installed OS' ''/var/log/setup/'' directory.
  
-The Pinebook Pro (RK3399 SoC) requires a firmware blob to be installed within the OS InitRD (see further down) in order to light up one of the display ports. +These post installation setup scripts are to configure the Operating System, but the scripts are not part of any Slackware package (unlike the rest of the post installation scripts within Slackware).  This is simplify the work required to port Slackware to another architecture rather than editing numerous scripts within the Slackware Installer, we run one script which launches the others.
-To facilitate this, a helper script is executed from the kernel.SlackBuild script when the OS InitRD is constructed.  This helper extracts the relevant firmware blob from the Slackware a/kernel-firmware package.+
  
-Package Series Package Asset  ^ Src +Script                                     Purpose Hardware Models 
-kernel-source platform/aarch64/rk3399 [[http://ftp.arm.slackware.com/slackwarearm/slackwareaarch64-current/source/k/platform/aarch64/rk3399|rk3399 Kernel Package Build Helper]] |+bootloader-flash Installing the Boot Loader onto SPI Flash | Not Raspberry Pi | 
 +| setconsole       | Configure Linux cmdline 'console=' setting | All | 
 +| os-initrd-mgr Configures the OS InitRD (Operating System Initial RAM Disk) All | 
 +| removeinstaller | Removes the Slackware Installer from the /boot partition | All | 
 +| hwm-os-configure | Helper launch script for Hardware Model-specific configuration (see below) | - |
  
-=== Kernel Patches ===+== Operating System Configuration (per Hardware Model) ==
  
-<note important>Generally once a set of patches are available for a Hardware Model, they will continue to apply to the particular Linux Kernel release that they were developed against.  In this author's experience, unless the OS becomes unstable as a result of any of that patch set, that patch set can remain for many months without maintenance.  It is not expected that Hardware Model Custodians are continually providing patches for the same Kernel major release.  If it's an absolute requirement to continually update the patch set, then this Hardware Model is not a suitable candidate for Direct Integration support within Slackware ARM/AArch64 (although it certainly may become one at a later date once the support has matured).</note>+''hwm-os-configure''
  
-^ Change Management Process ^ +This runs helper scripts found within the Slackware Installer. 
-| Provide the origin of the patch set (one or more URLs - httpsgit, etc.) and they will be retrieved from there|+These scripts are named after the SoC they supporte.g. /usr/share/hwm-configure/platform/$ARCH/helper.scr/rk3399
  
-===== Operating System Initial RAM Disk ('OS Initrd') =====+Examples of usage include: 
 +  * Configuring suspend/hibernate options within /etc/elogind/logind.conf and within /boot/extlinux/extlinux.conf
  
-http://ftp.arm.slackware.com/slackwarearm/slackwareaarch64-current/source/a/mkinitrd/README.initrd.arm  +=== Operating System configuration assets ===
-needed?+
  
-== Firmware within the OS InitRD ==+Some static assets are installed to the Operating System to provide sane/useful defaults for particular Hardware Models.
  
-The RockPro64 requires a small blob of firmware for one of the display drivers. +/usr/share/hwm-configure/platform/$ARCH/assets/rk3399/snd/pinebookpro/asound.state
-This is included within /lib/firmware/rockchip+
  
-<note important>Only firmware that is 100% required at Kernel module load time is added to the OS InitRD in order to keep the size down and to reduce overlap between the Slackware a/kernel-firmware package.  Firmware for a display driver is a must.  Firmware for Bluetooth et al is not.</note>+An ALSA config also exists for the rockpro64: 
 +/usr/share/hwm-configure/platform/$ARCH/assets/rk3399/snd/rockpro64/asound.state
  
-====  Kernel Module Loader ==== 
-  
-<note>The Kernel Module Loader is a shared resource with the Slackware Installer.  The assets are stored within the Kernel source directory.</note> 
  
-The Kernel Module Loader is responsible for loading software drivers (in the form of Kernel Modules) for a variety of common hardware, plus hardware for specific Hardware Models. +==== Disabling Filesystem Checks ====
-The goal of the Kernel Module Loader is to load just enough drivers to access the storage upon which the Operating System resides, at which point the boot process can transition to loading the Operating System, which provides a far greater array of hardware support than is required within the early stages of booting Linux and the Slackware OS.+
  
-Each Hardware Model typically requires some specific software drivers to light up the hardware. +If the Hardware Model does not have a battery-backed RTC (Real Time Clock), the Hardware Model will boot with a date that passed many years ago (in some cases the year will be 1970, which is the Epoch of UNIX) The affect of this is such that the filesystem checks will run every single time the system boots, because the last mount time will be significantly different from present date (assuming that the system time was corrected (usually via an NTP time sync) at boot).
-The RockPro64's examples act as templates for all Hardware Models.+
  
-Asset Description +Hardware Model  Status 
-[[http://ftp.arm.slackware.com/slackwarearm/slackwareaarch64-current/source/k/SlkOS-initrd-overlay/load_kernel_modules.scr/platform/aarch64/rk3399|k/SlkOS-initrd-overlay/load_kernel_modules.scr/platform/aarch64/rk3399]]|Kernel Module Configuration script for RK3399 Hardware Models (including RockPro64, PineBook Pro) |+RockPro64 Not required |
  
-<note>For the settingsview the script directly (see the table above)</note>+Should the Hardware Model not have an RTCthere is a change to make within the Slackware Installer. 
 +/usr/lib/setup/armedslack-nofscheck
  
-^Change Management Process^ 
-| Email the new configuration to the Slackware ARM devel mailing list, or provide a URL from which it may be obtained. | 
  
-====== Hardware Model Firmware ====== 
  
-Package Series Package ^ Asset  ^ Src ^ +==== Firmware ==== 
-| a | kernel-firmware | platform/aarch64/rk3399/rk3399 | [[http://ftp.arm.slackware.com/slackwarearm/slackwareaarch64-current/source/a/kernel-firmware/platform/aarch64/rk3399/rk3399|Firmware packaging script helper]] | + 
-| | |  platform/aarch64/rk3399/get-firmware.sh | [[http://ftp.arm.slackware.com/slackwarearm/slackwareaarch64-current/source/a/kernel-firmware/platform/aarch64/rk3399/get-firmware.sh|Script to retrieve firmware assets]]| +RockPro64/Pinebook Pro: 
-| | |platform/aarch64/rk3399/assets/* | [[ftp://ftp.arm.slackware.com/slackwarearm/slackwareaarch64-current/source/a/kernel-firmware/platform/aarch64/rk3399/assets|Firmware assets]]|+/lib/firmware/rockchip 
 + 
 + 
 +====== Slackware Operating System ====== 
 + 
 +==== Packages ==== 
 + 
 +Slackware ARM needs to modify some packages and add new ones.  Below follows a list of the packages that have been added or modified. 
 + 
 +=== Package: a/kernel-firmware === 
 + 
 +Hardware Model | Rock Pro64 / Pinebook Pro | 
 +^ Asset  ^ Src ^ 
 +| platform/aarch64/rk3399/rk3399 | [[http://ftp.arm.slackware.com/slackwarearm/slackwareaarch64-current/source/a/kernel-firmware/platform/aarch64/rk3399/rk3399|Firmware packaging script helper]] | 
 +|  platform/aarch64/rk3399/get-firmware.sh | [[http://ftp.arm.slackware.com/slackwarearm/slackwareaarch64-current/source/a/kernel-firmware/platform/aarch64/rk3399/get-firmware.sh|Script to retrieve firmware assets]]| 
 +| platform/aarch64/rk3399/assets/* | [[ftp://ftp.arm.slackware.com/slackwarearm/slackwareaarch64-current/source/a/kernel-firmware/platform/aarch64/rk3399/assets|Firmware assets]]| 
 + 
 + 
 + 
 +^ Hardware Model | Raspberry Pi 4| 
 +^ Asset  ^ Src ^ 
 +| platform/aarch64/bcm2711/bcm2711/ | [[http://ftp.arm.slackware.com/slackwarearm/slackwareaarch64-current/source/a/kernel-firmware/platform/aarch64/bcm2711/bcm2711/|Firmware packaging script helper]] | 
 +|  platform/aarch64/bcm2711/get-firmware.sh | [[http://ftp.arm.slackware.com/slackwarearm/slackwareaarch64-current/source/a/kernel-firmware/platform/aarch64/bcm2711//get-firmware.sh|Script to retrieve firmware assets]]| 
 +| platform/aarch64/bcm2711/assets/* | [[ftp://ftp.arm.slackware.com/slackwarearm/slackwareaarch64-current/source/a/kernel-firmware/platform/aarch64/bcm2711/assets|Firmware assets]]| 
  
 ^ Change Management Process ^ ^ Change Management Process ^
Line 168: Line 211:
 Used on the RockPro64, Pinebook Pro. Used on the RockPro64, Pinebook Pro.
  
-====== Slackware Installer ======+===== Kernel =====
  
-Note: these scripts are not yet available within the Slackware ARM source tree.  They need to be extracted from the Installer image.+<note>All Hardware Models are supported by a single generic Kernel.</note>
  
-Script                                     Called from  Purpose ^ Hardware Models +Hardware Model ^ Package Series ^ Package Asset  Src 
-/usr/lib/setup/armedslack-SeTpartitions    Installer    Automatic Handling of the OS /boot Partition All | +|All kernel-source configs/config-armv8 [[http://ftp.arm.slackware.com/slackwarearm/slackwareaarch64-current/source/k/configs/config-armv8|Slackware AArch64 generic Kernel configuration]] |
-| /usr/lib/setup/armedslack-bootloader-flash | Installer    | Installing the Boot Loader onto SPI Flash | Not Raspberry Pi | +
-| /etc/rc.d/rc.installerconfig               | init         | Hardware Model Installer Runtime Configuration Adjustments (CPU fan control, installer font size etc.) | All | +
-/usr/lib/setup/armedslack-clock-set        | /etc/rc.d/rc.S | If wrong time,set the clock with Slackware Installer build date. This indicates no RTC. | All | +
-/usr/lib/setup/armedslack-setconsole       Installer    | Configure Linux cmdline 'console=' setting | All |+
  
 +^Change Management Process^
 +| Email the new Kernel configuration to the Slackware ARM devel mailing list with a summary of what the changes were for. |
  
-==== Operating System Configuration (per Hardware Model) ====+=== Kernel Package Build Helpers ===
  
-/usr/lib/setup/armedslack-hwm-os-configure +The Pinebook Pro (RK3399 SoC) requires a firmware blob to be installed within the OS InitRD (see further down) in order to light up one of the display ports. 
 +To facilitate this, a helper script is executed from the kernel.SlackBuild script when the OS InitRD is constructed.  This helper extracts the relevant firmware blob from the Slackware a/kernel-firmware package.
  
-This runs helper scripts found within the Slackware Installer. +^ Package Series ^ Package ^ Asset  ^ Src ^ 
-These scripts are named after the SoC they support, e.g. /usr/share/hwm-configure/platform/$ARCH/helper.scr/rk3399+| k | kernel-source | platform/aarch64/rk3399 | [[http://ftp.arm.slackware.com/slackwarearm/slackwareaarch64-current/source/k/platform/aarch64/rk3399|rk3399 Kernel Package Build Helper]] |
  
-Examples of usage include: +=== Kernel Patches ===
-  * Configuring suspend/hibernate options within /etc/elogind/logind.conf and within /boot/extlinux/extlinux.conf+
  
-=== Operating System configuration assets ===+<note important>Generally once a set of patches are available for a Hardware Model, they will continue to apply to the particular Linux Kernel release that they were developed against.  In this author's experience, unless the OS becomes unstable as a result of any of that patch set, that patch set can remain for many months without maintenance.  It is not expected that Hardware Model Custodians are continually providing patches for the same Kernel major release.  If it's an absolute requirement to continually update the patch set, then this Hardware Model is not a suitable candidate for Direct Integration support within Slackware ARM/AArch64 (although it certainly may become one at a later date once the support has matured).</note>
  
-Some static assets are installed to the Operating System to provide sane/useful defaults for particular Hardware Models.+^ Change Management Process ^ 
 +| Provide the origin of the patch set (one or more URLs - https, git, etc.) and they will be retrieved from there|
  
-/usr/share/hwm-configure/platform/$ARCH/assets/rk3399/snd/pinebookpro/asound.state+===== Operating System Initial RAM Disk ('OS Initrd') =====
  
-An ALSA config also exists for the rockpro64: +http://ftp.arm.slackware.com/slackwarearm/slackwareaarch64-current/source/a/mkinitrd/README.initrd.arm  
-/usr/share/hwm-configure/platform/$ARCH/assets/rk3399/snd/rockpro64/asound.state+needed?
  
 +== Firmware within the OS InitRD ==
  
-==== Disabling Filesystem Checks ====+The RockPro64 requires a small blob of firmware for one of the display drivers. 
 +This is included within /lib/firmware/rockchip
  
-If the Hardware Model does not have battery-backed RTC (Real Time Clock), the Hardware Model will boot with date that passed many years ago (in some cases the year will be 1970, which is the Epoch of UNIX).  The affect of this is such that the filesystem checks will run every single time the system boots, because the last mount time will be significantly different from present date (assuming that the system time was corrected (usually via an NTP time sync) at boot).+<note important>Only firmware that is 100% required at Kernel module load time is added to the OS InitRD in order to keep the size down and to reduce overlap between the Slackware a/kernel-firmware package.  Firmware for display driver is a must.  Firmware for Bluetooth et al is not.</note>
  
-^ Hardware Model  ^ Status ^ +====  Kernel Module Loader ==== 
-| RockPro64 | Not required |+  
 +<note>The Kernel Module Loader is a shared resource with the Slackware Installer.  The assets are stored within the Kernel source directory.</note>
  
-Should the Hardware Model not have an RTCthere is a change to make within the Slackware Installer. +The Kernel Module Loader is responsible for loading software drivers (in the form of Kernel Modules) for a variety of common hardwareplus hardware for specific Hardware Models. 
-/usr/lib/setup/armedslack-nofscheck+The goal of the Kernel Module Loader is to load just enough drivers to access the storage upon which the Operating System resides, at which point the boot process can transition to loading the Operating System, which provides a far greater array of hardware support than is required within the early stages of booting Linux and the Slackware OS.
  
 +Each Hardware Model typically requires some specific software drivers to light up the hardware.
 +The RockPro64's examples act as templates for all Hardware Models.
  
 +^ Asset ^ Description ^
 +| [[http://ftp.arm.slackware.com/slackwarearm/slackwareaarch64-current/source/k/SlkOS-initrd-overlay/load_kernel_modules.scr/platform/aarch64/rk3399|k/SlkOS-initrd-overlay/load_kernel_modules.scr/platform/aarch64/rk3399]]|Kernel Module Configuration script for RK3399 Hardware Models (including RockPro64, PineBook Pro) |
  
-==== Firmware ====+<note>For the settings, view the script directly (see the table above)</note>
  
-RockPro64/Pinebook Pro: +^Change Management Process^ 
-/lib/firmware/rockchip+| Email the new configuration to the Slackware ARM devel mailing list, or provide a URL from which it may be obtained. | 
 + 
 + 
 +* Note about modprobe.d within installer and os-initrd-mgr conditionally installing the correct version depending on the Hardware Model. 
 +SOC_NAME in the Kernel module loader plugins needs to match the file name. 
 + 
 +| source/k/SlkOS-initrd-overlay/usr/share/hwm-configure/platform/aarch64/modprobe.d | [[http://ftp.arm.slackware.com/slackwarearm/slackwareaarch64-current/source/k/SlkOS-initrd-overlay/usr/share/hwm-configure/platform/aarch64/modprobe.d|Hardware Model/SoC modprobe configurations]] | 
 + 
 +These are populated by /load_kernel_modules at run time, depending on which Hardware Model is detected by the Kernel Module loader plugin scripts. 
 + 
 +<note important>Presently the modprobe configuration for the Hardware Model is not copied or in sync with the OS' copy.  If this becomes an issue in the future, it will be syncronised by init within the OS InitRD.</note>
  
 ====== Hardware Management ====== ====== Hardware Management ======
 slackwarearm:development_refguide_di ()