### Base Distro Kernel Command Line Configuration Example Source: https://github.com/postmarketos/pmaports/blob/main/docs/kernel-cmdline.md Example of a base distro configuration file for kernel command line parameters. ```text quiet splash ``` -------------------------------- ### User Hardware Configuration for Kernel Command Line Example Source: https://github.com/postmarketos/pmaports/blob/main/docs/kernel-cmdline.md Example of a user configuration file to set hardware-specific kernel command line parameters, illustrating the final combined output. ```text hid_apple.swap_fn_leftctrl=1 ``` -------------------------------- ### Device Kernel Command Line Configuration Example Source: https://github.com/postmarketos/pmaports/blob/main/docs/kernel-cmdline.md Example of a device-specific configuration file for kernel command line parameters, showing the expected result when combined with base distro config. ```text console=ttyMSM0,115200 ``` -------------------------------- ### Virtual Provider Conflict Example Source: https://github.com/postmarketos/pmaports/blob/main/docs/packaging-guidelines.md Illustrates a common packaging pitfall where forks incorrectly use virtual providers. This example shows multiple alsa-ucm-conf variants providing the same virtual provider, leading to potential conflicts and unexpected installations. ```shell $ apk info -P alsa-ucm-conf alsa-ucm-conf-1.2.15.1-r0 provides: alsa-ucm-conf-qcom-sdm660-1.2.14_git20251011-r0 provides: alsa-ucm-conf alsa-ucm-conf-qcom-sdm670-1.2.9_git20250707-r0 provides: alsa-ucm-conf alsa-ucm-conf-qcom-sm7150-1.2.14_git20251026-r1 provides: alsa-ucm-conf alsa-ucm-conf-sdm845-1-r1 provides: alsa-ucm-conf alsa-ucm-conf-unisoc-ums9230-1.2.9_git20251211-r0 provides: alsa-ucm-conf soc-qcom-msm8916-ucm-25-r1 provides: alsa-ucm-conf soc-qcom-msm8953-ucm-18-r1 provides: alsa-ucm-conf soc-qcom-msm8996-ucm-2-r0 provides: alsa-ucm-conf soc-qcom-msm89x7-ucm-5-r0 provides: alsa-ucm-conf soc-qcom-sm7125-ucm-2-r1 provides: alsa-ucm-conf $ apk list --installed alsa-ucm-conf alsa-ucm-conf-1.2.15.3-r0 aarch64 {alsa-ucm-conf} (BSD-3-Clause) [installed] ``` -------------------------------- ### User Override for Kernel Command Line Debugging Example Source: https://github.com/postmarketos/pmaports/blob/main/docs/kernel-cmdline.md Example of a user override configuration file to enable debugging and adjust log levels, showing the resulting kernel command line. ```text -quiet debug loglevel=7 ``` -------------------------------- ### Add Kernel Configuration Option Source: https://github.com/postmarketos/pmaports/blob/main/docs/generic-kernels.md Example of how to add a new kernel configuration option to `kconfig-generic.toml`. This enables the `VIDEO_OV8856` driver for kernels newer than 6.12-rc1 on all architectures. ```toml ["category:video".">=6.12_rc1"."all"] VIDEO_OV8856 = "m" ``` -------------------------------- ### Systemd package change example Source: https://github.com/postmarketos/pmaports/blob/main/COMMITSTYLE.md When modifying the main systemd package, use 'systemd:' as the prefix. This indicates changes to the core systemd package. ```git systemd: add triggers for reloading/restarting services ``` -------------------------------- ### Versioned Provider Priority Example Source: https://github.com/postmarketos/pmaports/blob/main/docs/packaging-guidelines.md Demonstrates how a higher versioned provider (libcamera-99990.6.0-r1) is prioritized over a lower version (libcamera-0.7.0-r0) by apk. This is useful when a fork should always be used. ```shell $ apk info -P libcamera libcamera-0.7.0-r0 provides: cmd:libcamerify=0.7.0-r0 so:libcamera-base.so.0.7=0.7.0 so:libcamera.so.0.7=0.7.0 libcamera-99990.6.0-r1 provides: cmd:libcamerify=99990.6.0-r1 so:libcamera-base.so.0.6=0.6.0 so:libcamera.so.0.6=0.6.0 $ apk list --installed libcamera libcamera-99990.6.0-r1 x86_64 {libcamera} (LGPL-2.1-or-later AND GPL-2.0-or-later) [installed] ``` -------------------------------- ### Systemd sub-package change example Source: https://github.com/postmarketos/pmaports/blob/main/COMMITSTYLE.md For changes to other packages within the systemd directory, use the format 'systemd/$pkgname:'. This specifies changes to a particular package managed by systemd. ```git systemd/cups: restart on upgrade ``` -------------------------------- ### Enabling kconfigcheck in APKBUILD Source: https://github.com/postmarketos/pmaports/blob/main/docs/kconfigcheck.md This example shows how to opt a kernel package into strict kconfig checks by adding the 'pmb:kconfigcheck-community' option in its APKBUILD file. This ensures compliance with community-defined kernel configuration standards. ```bash options="pmb:kconfigcheck-community" ``` -------------------------------- ### Device-specific package change example Source: https://github.com/postmarketos/pmaports/blob/main/COMMITSTYLE.md When changing packages within the device directory, omit the directory prefix. This applies to device-specific configurations and functionality. ```git device-pine64-pinephone: description of change ``` -------------------------------- ### APKBUILD for Enabling Initramfs Tests Source: https://github.com/postmarketos/pmaports/blob/main/docs/hardware-ci.md This snippet shows how a device package's APKBUILD can enable specific initramfs tests by depending on corresponding subpackages from 'postmarketos-test' and ensuring 'postmarketos-mkinitfs-hook-ci' is installed. ```sh subpackages="$pkgname-pmtest" pmtest() { install_if="$pkgname=$pkgver-r$pkgrel postmarketos-mkinitfs-hook-ci" depends="postmarketos-test-suspend postmarketos-test-unl0kr" mkdir -p "$subpkgdir" } ``` -------------------------------- ### Verifying Generated Kernel Command Line Source: https://github.com/postmarketos/pmaports/blob/main/docs/kernel-cmdline.md Run `generate-kernel-cmdline` as an unprivileged user to see the combined kernel command line parameters from configuration files. Note that this does not include parameters injected by boot-deploy at install time. ```bash $ generate-kernel-cmdline quiet hid_apple.swap_fn_leftctrl=1 splash ``` -------------------------------- ### Moving devices between categories example Source: https://github.com/postmarketos/pmaports/blob/main/COMMITSTYLE.md When moving devices between categories, use the 'manufacturer-codename: move from category to category' format. This clearly indicates the relocation of a device package. ```git samsung-m0: move from testing to community ``` -------------------------------- ### Device Package Kernel Command Line Configuration Source: https://github.com/postmarketos/pmaports/blob/main/docs/kernel-cmdline.md Define device-specific kernel command line parameters by creating a `kernel-cmdline.conf` file in the device package directory. This file is automatically installed during package build. ```text console=ttyMSM0,115200 clk_ignore_unused pd_ignore_unused ``` -------------------------------- ### Manufacturer-codename device change example Source: https://github.com/postmarketos/pmaports/blob/main/COMMITSTYLE.md If a commit only makes device-specific changes, use the manufacturer-codename format. This is a shorthand for device-related commits. ```git manufacturer-codename: description of change ``` -------------------------------- ### Example kconfigcheck.toml Category Requirements Source: https://github.com/postmarketos/pmaports/blob/main/docs/kconfigcheck.md This TOML snippet defines kernel configuration requirements for a specific category ('virt'). It specifies that HW_RANDOM_VIRTIO should be enabled as a module ('m'), and KVM and VIRTUALIZATION should be built-in ('y'). These requirements apply to all kernel versions and architectures. ```toml ["category:virt".">=0.0.0"."all"] HW_RANDOM_VIRTIO = "m" KVM = "y" VIRTUALIZATION = "y" ``` -------------------------------- ### SoC-specific package change example Source: https://github.com/postmarketos/pmaports/blob/main/COMMITSTYLE.md When changing packages related to a specific System on Chip (SoC), omit the directory prefix. This is used for changes affecting a particular SoC's configuration. ```git soc-qcom-msm8996: description of change ``` -------------------------------- ### Example kconfigcheck.toml Alias Definition Source: https://github.com/postmarketos/pmaports/blob/main/docs/kconfigcheck.md This TOML snippet demonstrates how to define an alias in kconfigcheck.toml. The 'my-alias' is created to group requirements from 'category:one' and 'category:two', simplifying the management of related configuration options. ```toml [aliases] my-alias = ["category:one", "category:two"] ``` -------------------------------- ### View provides for busybox-binsh package Source: https://github.com/postmarketos/pmaports/blob/main/docs/packaging-guidelines.md Shows the provides for the busybox-binsh package, including its shell and command providers. ```sh $ apk info --provides busybox-binsh busybox-binsh-1.37.0-r31 provides: /bin/sh cmd:sh=1.37.0-r31 ``` -------------------------------- ### Edit or Create a Kernel Configuration Fragment Source: https://github.com/postmarketos/pmaports/blob/main/docs/kconfig-fragments.md Use `pmbootstrap kconfig edit` to create a new fragment file or edit an existing one. Changes are saved to the specified fragment file, overwriting it if it already exists. ```bash pmbootstrap kconfig edit --fragment foo.config ``` -------------------------------- ### Initialize GC9305 v2 Panel Commands Source: https://github.com/postmarketos/pmaports/blob/main/device/testing/device-nokia-argon/nokia,argon-gc9305-v2-panel.txt This snippet contains the sequence of commands to initialize the GC9305 v2 display panel. It includes settings for display format, tearing scan line, and power control. ```shell command 0x36 0x00 command 0x3a 0x55 # format: 65K 16bit command 0x35 0x00 # TE v-blanking command 0xb2 0x0c 0x0c 0x00 0x33 0x33 # porch setting command 0xb7 0x75 # gate control VGH VGL command 0xbb 0x34 # Vcoms setting 1.4v command 0xc0 0x2c # LCM control command 0xc2 0x01 # VDV VRH COMMAND ENABLE command 0xc3 0x0d # VRH SET command 0xc4 0x20 # VDV SET command 0xc6 0xef # frame rate command 0x44 0x00 0x00 # SET TEARING SCAN LINE command 0xd0 0xa4 0xa1 # power control 1 ``` -------------------------------- ### Generate Kernel Configuration Fragment Source: https://github.com/postmarketos/pmaports/blob/main/docs/kconfig-fragments.md Use `pmbootstrap kconfig generate` to automatically create the `pmos.config` fragment based on selected categories from `kconfigcheck.toml`. This command also generates and validates the full kernel configuration. ```bash pmbootstrap kconfig generate ``` -------------------------------- ### Migrating Deviceinfo Kernel Cmdline to kernel-cmdline.conf Source: https://github.com/postmarketos/pmaports/blob/main/docs/kernel-cmdline.md Convert existing `deviceinfo_kernel_cmdline` entries into a `kernel-cmdline.conf` file for device packages. This ensures compatibility with the new kernel command line management system. ```bash deviceinfo_kernel_cmdline="quiet loglevel=2 clk_ignore_unused" ``` ```text quiet loglevel=2 clk_ignore_unused ``` -------------------------------- ### Adding new device template Source: https://github.com/postmarketos/pmaports/blob/main/COMMITSTYLE.md Use this template when adding a new device package, potentially including device-specific kernel and firmware packages. Each commit should represent one new device. ```git htc-m8qlul: new device ``` -------------------------------- ### View provides for dash-binsh package Source: https://github.com/postmarketos/pmaports/blob/main/docs/packaging-guidelines.md Displays the provides for the dash-binsh package, similar to busybox-binsh, indicating it also provides /bin/sh and cmd:sh. ```sh $ apk info --provides dash-binsh dash-binsh-0.5.13.1-r2 provides: /bin/sh cmd:sh=0.5.13.1-r2 ``` -------------------------------- ### Creating a Custom Kernel Configuration Fragment Source: https://github.com/postmarketos/pmaports/blob/main/docs/kconfig-fragments.md Create a custom fragment file to list required kernel configuration options, especially for device-specific drivers when using a generic defconfig. Options can be enabled ('=y'), module ('=m'), or disabled ('is not set'). ```bash cat asahi.config CONFIG_PCIE_APPLE=m CONFIG_NVME_APPLE=m CONFIG_ARM64_ACTLR_STATE=y CONFIG_ARCH_APPLE=y CONFIG_DRM=y CONFIG_DRM_ASAHI=m # CONFIG_ARM64_4K_PAGES is not set CONFIG_ARM64_16K_PAGES=y ``` -------------------------------- ### View provides for musl-utils package Source: https://github.com/postmarketos/pmaports/blob/main/docs/packaging-guidelines.md Displays the provides for the musl-utils package, including its executable and utility providers. ```sh $ apk info --provides musl-utils musl-utils-1.2.5-r21 provides: libc-utils=1.2.5-r21 cmd:getconf=1.2.5-r21 cmd:getent=1.2.5-r21 cmd:iconv=1.2.5-r21 cmd:ldconfig=1.2.5-r21 cmd:ldd=1.2.5-r21 ``` -------------------------------- ### View dependencies for glib package Source: https://github.com/postmarketos/pmaports/blob/main/docs/packaging-guidelines.md Lists the dependencies for the glib package, demonstrating its reliance on shared libraries and the system shell. ```sh $ apk info --depends glib glib-2.86.3-r1 depends on: /bin/sh so:libc.musl-x86_64.so.1 so:libffi.so.8 so:libintl.so.8 so:libmount.so.1 so:libpcre2-8.so.0 so:libz.so.1 ``` -------------------------------- ### Device Package Template for Generic Kernels Source: https://github.com/postmarketos/pmaports/blob/main/docs/generic-kernels.md A template for setting up subpackages for different generic kernel versions (stable, lts, mainline) within a device package. ```shell subpackages=" $pkgname-kernel-stable:kernel_stable $pkgname-kernel-lts:kernel_lts $pkgname-kernel-mainline:kernel_mainline " ... kernel_stable() { pkgdesc="Stable kernel (recommended, best balance between stability and features)" depends="linux-postmarketos-stable" devicepkg_subpackage_kernel $startdir $pkgname $subpkgname } kernel_lts() { pkgdesc="Long-term maintenance kernel (most stability, not all security fixes & new features)" depends="linux-postmarketos-lts" devicepkg_subpackage_kernel $startdir $pkgname $subpkgname } kernel_mainline() { pkgdesc="Upstream development kernel (regular breakage, latest features)" depends="linux-postmarketos-mainline" devicepkg_subpackage_kernel $startdir $pkgname $subpkgname } ``` -------------------------------- ### APKBUILD Changes for Kernel Fragments Source: https://github.com/postmarketos/pmaports/blob/main/docs/kconfig-fragments.md Add custom .config fragment files to the sources array and define the defconfig to use in your APKBUILD. Ensure 'pmb:kconfigcheck-*' options are correctly set. ```bash _defconfig="defconfig" sources=( $pkgname.config misc.config ) ``` -------------------------------- ### View provides for musl package Source: https://github.com/postmarketos/pmaports/blob/main/docs/packaging-guidelines.md Shows the provides for the musl package, including its shared library provider. ```sh $ apk info --provides musl musl-1.2.5-r21 provides: so:libc.musl-x86_64.so.1=1 ``` -------------------------------- ### Nokia Weeknd GC9104 V2 Panel Initialization Sequence Source: https://github.com/postmarketos/pmaports/blob/main/device/testing/device-nokia-weeknd/nokia,weeknd-gc9104-v2-panel.txt This sequence configures the display panel for operation. It includes commands for rotation, setting pixel format, inverting colors, exiting sleep mode, and turning the display on. A delay is included before display activation. ```shell command 0x36 0xd8 # rotate command 0x3a 0x05 # 16-bit pixel format command 0x35 0x00 command 0x21 # invert command 0x11 # exit sleep mode delay 120 command 0x29 # display on ``` -------------------------------- ### GC9305 HLT-24 Panel Initialization Commands Source: https://github.com/postmarketos/pmaports/blob/main/device/testing/device-nokia-leo/nokia,leo-gc9305-hlt-24-panel.txt This snippet contains a series of commands to initialize and configure the GC9305 HLT-24 display panel. These commands set various display parameters and are essential for the panel's operation. ```text command 0xfe command 0xfe command 0xef command 0x35 0x00 command 0x36 0x48 command 0x3a 0x05 command 0x20 command 0x38 command 0x13 command 0xa4 0x44 0x44 command 0xa5 0x42 0x42 command 0xa6 0x2a 0x2a command 0xa7 0x2b 0x2b command 0xa8 0x18 0x18 command 0xa9 0x2a 0x2a command 0xaa 0x88 0x88 command 0xac 0x00 command 0xaf 0x55 command 0xe1 0x10 0x26 command 0xe3 0x01 0x10 command 0xe8 0x11 0x77 command 0xe0 0x0f command 0xe4 0x00 command 0xe5 0x00 command 0xe6 0x00 command 0xe7 0x00 0x00 command 0xea 0x51 0x95 0x00 0x00 0x00 0x00 0x00 command 0xeb 0x30 command 0xec 0x33 0x22 0x88 command 0xed 0x18 0x08 command 0xee 0x00 command 0xa0 0x00 command 0xa1 0x00 command 0xa2 0x00 command 0xa3 0x00 command 0xab 0x00 0x00 command 0xad 0x33 command 0xae 0x2b command 0xde 0x00 command 0xff 0x61 command 0xdf 0x08 command 0xb6 0x00 0x80 0x27 command 0xf0 0x02 0x01 0x00 0x00 0x03 0x07 command 0xf1 0x01 0x01 0x00 0x02 0x06 0x0e command 0xf2 0x08 0x06 0x32 0x03 0x04 0x46 command 0xf3 0x10 0x0c 0x3e 0x06 0x03 0x4f command 0xf4 0x0b 0x16 0x15 0x1d 0x1e 0x0f command 0xf5 0x08 0x15 0x15 0x1b 0x1c 0x0f command 0xfd 0x00 command 0x2a 0x00 0x00 0x00 0xef command 0x2b 0x00 0x00 0x01 0x3f command 0x44 0x00 0x40 ``` -------------------------------- ### Exit Sleep Mode and Display On Commands Source: https://github.com/postmarketos/pmaports/blob/main/device/testing/device-nokia-leo/nokia,leo-gc9305-hlt-24-panel.txt This snippet includes commands to exit sleep mode and turn the display on. A delay is specified after exiting sleep mode to allow the panel to stabilize before display activation. ```text command 0x11 # exit sleep mode delay 120 command 0x29 # display on ``` -------------------------------- ### U-Boot Boot Command Configuration Source: https://github.com/postmarketos/pmaports/blob/main/device/testing/u-boot-kobo-librah2o/u-boot-env.txt This `bootcmd` variable configures the boot process. It first tries to load 'boot.scr' from the first partition of the MMC device (0:1) into memory at address 0x80800000. If successful, it executes the script. If loading fails, it activates USB mass storage mode. ```uboot bootcmd=if load mmc 0:1 0x80800000 boot.scr ; then source 0x80800000 ; else ums 0 mmc 0 ; fi ``` -------------------------------- ### Nokia Weeknd ST7789VX2 Yihua Panel Initialization Commands Source: https://github.com/postmarketos/pmaports/blob/main/device/testing/device-nokia-weeknd/nokia,weeknd-st7789vx2-yihua-panel.txt This snippet contains a sequence of commands to initialize the ST7789VX2 Yihua panel. It includes commands for exiting sleep mode, setting display modes, and configuring display parameters. ```shell command 0x11 # exit sleep mode delay 120 command 0x36 0x00 command 0x3a 0x05 command 0x35 0x00 command 0xd0 0xa7 0xa1 command 0xd0 0xa4 0xa1 command 0x13 command 0x38 command 0x20 command 0x29 # display on ``` -------------------------------- ### Enable Display on GC9305 v2 Panel Source: https://github.com/postmarketos/pmaports/blob/main/device/testing/device-nokia-argon/nokia,argon-gc9305-v2-panel.txt This snippet contains the final commands to exit sleep mode and turn on the display for the GC9305 v2 panel. A delay is included after sleep out. ```shell command 0x11 # sleep out delay 120 command 0x29 # display on ``` -------------------------------- ### User Override for Kernel Command Line Debugging Source: https://github.com/postmarketos/pmaports/blob/main/docs/kernel-cmdline.md Override kernel command line parameters for debugging purposes by creating a `.conf` file in `/etc/kernel-cmdline.d/`. Prefix parameters with `-` to remove them. ```text -quiet debug ``` -------------------------------- ### Configure Gamma Settings for GC9305 v2 Panel Source: https://github.com/postmarketos/pmaports/blob/main/device/testing/device-nokia-argon/nokia,argon-gc9305-v2-panel.txt This snippet configures the gamma settings for the GC9305 v2 panel. It includes commands for both positive and negative gamma correction. ```shell command 0xe0 0xd0 0x02 0x09 0x0d 0x0e 0x19 0x30 0x51 0x43 0x09 0x14 0x13 0x18 0x21 command 0xe1 0xd0 0x02 0x09 0x0d 0x0d 0x18 0x32 0x46 0x42 0x09 0x13 0x13 0x17 0x21 ``` -------------------------------- ### Configure Git Hooks Source: https://github.com/postmarketos/pmaports/blob/main/README.md Sets the local git configuration to use the hooks located in the .githooks directory. This is useful for enforcing commit styles and other pre-commit checks. ```shell git config --local core.hooksPath .githooks ``` -------------------------------- ### Forking Alpine package template Source: https://github.com/postmarketos/pmaports/blob/main/COMMITSTYLE.md Use this template when forking a package from Alpine using 'pmbootstrap aportgen --fork-alpine package'. Each commit should represent one forked package. ```git temp/package-name: fork from Alpine ``` -------------------------------- ### Nokia Sparkler GC9307 HLT 28 Panel Initialization Sequence Source: https://github.com/postmarketos/pmaports/blob/main/device/testing/device-nokia-sparkler/nokia,sparkler-gc9307-hlt-28-panel.txt This sequence configures the GC9307 HLT 28 panel by sending specific commands and delays. It includes exiting sleep mode, setting various display parameters, and finally enabling the display. ```text command 0x11 # exit sleep mode delay 120 command 0xfe command 0xef command 0x13 command 0x38 command 0x20 command 0x36 0x00 command 0x3a 0x05 command 0x35 0x00 command 0x89 0x0b command 0xeb 0x02 command 0x29 # display on ``` -------------------------------- ### Specify Package Co-Maintainer Source: https://github.com/postmarketos/pmaports/blob/main/docs/packaging-guidelines.md Add co-maintainers to a package by using a '# Co-Maintainer:' comment in the APKBUILD file. This allows multiple individuals to be notified of changes. ```sh # Co-Maintainer: John Doe ``` -------------------------------- ### Cherry-pick a commit with -x flag Source: https://github.com/postmarketos/pmaports/blob/main/docs/releases/backporting.md Use this command to cherry-pick a specific commit from another branch. The '-x' flag automatically appends the original commit information to the new commit message, aiding in tracking. ```git git cherry-pick -x ffffffff ``` -------------------------------- ### Specify Package Maintainer Source: https://github.com/postmarketos/pmaports/blob/main/docs/packaging-guidelines.md Define the primary maintainer for a package using the 'maintainer' variable in the APKBUILD file. The email should correspond to a GitLab user for pinging. ```sh maintainer="Jane Doe " ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.