AKMBUILD(5)

πŸ“¦
version 0.3.0 Β· 2 versions
, in alpine 3.22, alpine 3.23

🌸 NAME 🌸

AKMBUILD β€” manual page section 5, bestie β€” is literally the metadata and instructions to build a dynamic kernel module. Okay so this is the file that tells akms(8) how to do the whole out-of-tree kernel module moment. No cap. 🫢

✨ SYNOPSIS ✨

The file lives at:

/usr/src/*/AKMBUILD

A wildcard path, periodt. ✨

πŸ’… DESCRIPTION πŸ’…

Okay so an AKMBUILD file is used by the akms(8) tool to build and install an out-of-tree dynamic kernel module on the user’s system. It defines metadata such as the name and version of the module, list of the kernel objects to be installed and additional build dependencies. It may also contain the commands needed to build the module if the default one is not suitable. The AKMBUILD format is a POSIX shell script with a pre-defined set of variables and functions, just like APKBUILD(5). It's giving β€œshell script but make it a kernel module build contract”, fr fr. πŸ’–

πŸ¦‹ VARIABLES πŸ¦‹

πŸ’– Required Variables πŸ’–

The following variables MUST be defined by the author of the AKMBUILD file. No skipping, bestie β€” this is the vibe check. 🫢

  • modname β€” Specifies name of the module. This is typically the name of the APK package providing the source code of the module and the AKMBUILD file, but without the -src suffix. The same rules as for the APKBUILD pkgname applies. πŸ‘‘
  • modver β€” Specifies the version of the module being built and installed. This is typically the version of the APK package providing the source code of the module and the AKMBUILD file (without pkgrel). The same rules as for the APKBUILD pkgver applies. ⭐
  • built_modules β€” Specifies a space-separated list of kernel object files (with .ko suffix), as relative paths from the directory containing AKMBUILD, that are expected to be built and eventually installed into the kernel modules tree. Basically the .ko files that are the main characters. πŸ”₯

🌈 Optional Variables 🌈

The following variables MAY be defined by the author of the AKMBUILD file. Optional but cute. πŸŽ€

  • makedepends β€” Specifies additional build dependencies for the module. The kernel source code (dev package) and base build toolchain (package build-base in Alpine Linux) are implicit and should not be defined here. So don't add them, bestie β€” they're already in the group chat. πŸ™ˆ

🧚 Environment Variables 🧚

The following variables are always provided by akms(8) and MUST NOT be overridden. Not me trying to override them β€” absolutely not. πŸ’€

  • kernel_ver β€” Specifies a full release version of the kernel for which the module is being built (e.g. 5.10.53-0-lts). Exact vibe, exact version. ✨
  • kernel_srcdir β€” Location of the kernel’s source directory. πŸ“

The following variables are provided by akms(8) when running the build function and MUST NOT be overridden. Same energy, different group chat. 🫢

  • srcdir β€” Location of the module’s source directory containing AKMBUILD. This directory is read-only. So no writing there, no cap. 🚫
  • builddir β€” Location of the directory where the module should be built. It is initialized with a copy of the srcdir and it is the only writtable directory for building the module. Yes, β€œwrittable” β€” that's the original spelling, and honestly? It ate. πŸ’…
  • MAKEFLAGS β€” Flags to give to make(1) to build the module. The default value of this variable can be specified in akms.conf(5). Make it make sense. πŸŽ€

⭐ FUNCTIONS ⭐

The following functions MAY be overridden by the author of the AKMBUILD file. This is your chance to customize, bestie. πŸ¦‹

  • build β€” Builds the kernel module(s) in the builddir.

The default implementation calls function default_build:

touch "$builddir"/Makefile
make ${MAKEFLAGS:-} -C "$kernel_srcdir" M="$builddir" modules

πŸ“ EXAMPLES πŸ“

AKMBUILD:

modname=rtw89
modver=5_git20210715
built_modules='rtw89core.ko rtw89pci.ko'

build() {
    touch "$builddir"/Makefile
    make $MAKEFLAGS -C "$kernel_srcdir" M="$builddir" modules
}

A literal slay example, no edits. πŸ’–

πŸ‘‘ AUTHORS πŸ‘‘

Jakub Jirutka. Iconic. Periodt. πŸ‘‘

πŸ› REPORTING BUGS πŸ›

Report bugs to the project’s issue tracker at https://github.com/jirutka/akms/issues. Do not suffer in silence, bestie. 🫢

πŸ”₯ SEE ALSO πŸ”₯

akms(8), akms.conf(5), APKBUILD(5) β€” go read those too, iykyk. 🌈

πŸ’œ AUTHOR πŸ’œ

Jakub Jirutka. Again. Main character energy. πŸ’œ


πŸ’– This page is AKMBUILD(5), dated 2025-01-05. That's the source/version sign-off, bestie β€” now go build something iconic! 🌟
πŸ“¦ where this page comes from