# kernel.conf -- read by `lfs-kernel`. Edit before building. # VERSION: an exact version (7.2.5), or "latest" for the newest stable on # kernel.org. `lfs-kernel ` overrides it for one run, # `lfs-kernel list` shows what is on offer. VERSION=latest # ---- where the kernel is installed --------------------------------------- # # ESP + KERNEL_NAME are the pair that decides WHICH kernel this is. Point # them at your boot manager's directory and the file it loads: # # KERNEL_NAME=vmlinuz_new # a kernel to try, beside the working one # KERNEL_NAME=vmlinuz # the one rEFInd boots by default # # The previous file is always kept as ${KERNEL_NAME}_old, and a copy is left # as ${KERNEL_NAME}-${VERSION} so several versions can sit side by side. # `lfs-kernel detect-esp` prints the vfat mount that already holds a kernel; # `findmnt -t vfat` lists them all. ESP=/boot/efi/EFI/NimGnu KERNEL_NAME=vmlinuz_new # ---- the package --------------------------------------------------------- # # The kernel is a package like any other: PKG names the package user that # owns it, and its sources live in that account's home # (/usr/src/pkgusr/p_/src), like every other package's. There is no # separate source directory to configure. # # What it owns: /lib/modules/, /usr/include (the headers), # /usr/share/doc/linux-. The copies onto the EFI partition are # root's -- vfat has no ownership and the mount is root's. # # The tree of the last kernel known to boot is NEVER removed; its version is # recorded in /etc/pkgusr/kernel.last-good. PKG=linux # Leaving a core or two free keeps the machine usable during a build, and a # kernel link is memory-hungry. JOBS=-j14 # CONFIG_FROM: where the .config starts from. # running /proc/config.gz -- the kernel carrying the machine now. # If it cannot be read (no CONFIG_IKCONFIG_PROC), the saved # last-good config is used instead. # last-good the config of the last kernel that BOOTED # prev-good the one before it -- the way back from a bad answer # saved the newest config this tool built with, booted or not # file: any file # keep the tree's own .config, untouched # Every build's config is copied to /etc/pkgusr/kernel-configs, which is # outside the source tree and survives `packagemanager remove linux`: # lfs-kernel config list what is saved # lfs-kernel config diff prev-good -> last-good CONFIG_FROM=running # CONFIG_KEEP: how many per-build configs to keep in that directory. # last-good.config and prev-good.config are NOT counted and never pruned. CONFIG_KEEP=5 # CONFIG_REFRESH: a config from one kernel is never complete for another -- # every version adds symbols the old file has no answer for, and something # has to decide them: # olddefconfig take upstream's DEFAULT for each new symbol, silently. # Right for an unattended run; the defaults are not yours. # oldconfig ask about each new symbol. Needs someone at the # terminal, decides nothing behind your back. # menuconfig open the editor and decide everything at once. # none use the .config as it is and let `make` deal with it. # Either way the tool reports how many lines changed. CONFIG_REFRESH=olddefconfig # CONFIG_SET: options THIS MACHINE always wants, applied on top of whatever # CONFIG_FROM gave, after the refresh -- so `running` + a new kernel version # cannot quietly lose them. SYMBOL=VALUE, space separated, CONFIG_ optional: # y / m / n enable, module, disable # "text" a string option # 123 a number # Each is read back from the final .config; one the kernel refuses (a missing # dependency, a symbol this version does not have) is named and stops the build. # # Edit it here, or let the tool do it -- same file, with a backup: # lfs-kernel enable --list hardware by name # lfs-kernel enable ath9k-htc its symbols AND its firmware # lfs-kernel config search atheros which symbol that is # lfs-kernel config set NET_VENDOR_ATHEROS=y ALX=m # lfs-kernel config unset ALX # A NET_VENDOR_* / WLAN_VENDOR_* symbol only opens a submenu: name the # driver under it too, or nothing is built. # # LEGACY_TIOCSTI=n no program may type into a terminal it does not own. # With it allowed, shadow's su (4.20+) detaches the shell # of every `su - ` run by root -- "cannot set # terminal process group ... no job control" -- because # that user could otherwise inject commands into root's # terminal. Off, su keeps the terminal and job control. # EXFAT_FS=m the kernel side of exFAT: mkfs.exfat and fsck.exfat # (exfatprogs, services.stack) work on a filesystem # the kernel cannot mount without this. # FUSE_FS=m userspace filesystems: ntfs-3g (services.stack) # mounts through it. # BTRFS_FS=y btrfs root: BUILT IN, not a module -- nothing loads # modules before / is mounted (no initramfs). CONFIG_SET="LEGACY_TIOCSTI=n EXFAT_FS=m FUSE_FS=m BTRFS_FS=y" # ---- firmware ------------------------------------------------------------ # # Most drivers need firmware blobs: amdgpu will not bring up a display # without them, and a config that lists them in CONFIG_EXTRA_FIRMWARE cannot # even BUILD without them. They are installed as their own package # (p_linux-firmware), so they are tracked, verifiable and updatable on their # own. # # FIRMWARE_FROM: # git clone/pull kernel.org's linux-firmware (needs network) # copy: copy from a directory you already have, e.g. # copy:/lib/firmware on a host that is already running # none do not touch firmware at all FIRMWARE_FROM=git FIRMWARE_GIT=https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git # FIRMWARE_ONLY: what to install. linux-firmware is over 10 GB; listing # what your hardware needs keeps it to a few hundred megabytes. Empty means # everything. # # Entries are directories OR file patterns, because not all firmware lives in # a subdirectory -- Intel wireless blobs sit at the top level: # amdgpu Radeon / Renoir / Raven / Picasso graphics # amd-ucode AMD CPU microcode (a distribution config embeds it) # amd AMD SEV and other platform blobs # intel EVERYTHING Intel, in one directory: # intel/iwlwifi/ wireless (AX200 and the rest) # intel/ibt-* Bluetooth # Current linux-firmware nests iwlwifi under intel/; # older releases kept iwlwifi-*.ucode at the top level, # which is what a FILE pattern like iwlwifi-cc-* is for. # rtl_bt Realtek Bluetooth # iwlwifi-*.ucode THE INTEL WIRELESS BLOBS THEMSELVES. The driver asks # the loader for a FLAT path -- iwlwifi-cc-a0-77.ucode, # not intel/iwlwifi/... -- so `intel` above does not # satisfy it, and the AX200 comes up with # Direct firmware load for iwlwifi-cc-a0-77.ucode failed # no suitable firmware found! # and no wlan interface at all. Since 1.14.279 the # pattern matches at any depth, and the flat names are # made as links from linux-firmware's WHENCE -- so # `intel` alone gets them too; the pattern does no harm. # NOT here: regulatory.db. cfg80211 asks for it, but linux-firmware does # not carry it -- it is released on its own as wireless-regdb -- and naming # it here fails the whole firmware install. REGDB below fetches it. # Find what your machine asks for, once it is running, with: # lfs-kernel firmware --missing # and --fix to install them # dmesg | grep -i firmware # (quoted: the value has spaces and a wildcard, and the config is sourced by # the shell -- unquoted, `intel` was run as a command and the whole # assignment came out empty, which meant "install everything") FIRMWARE_ONLY="amdgpu amd-ucode amd intel iwlwifi-*.ucode" # REGDB: cfg80211's regulatory database, which is wireless-regdb rather than # part of linux-firmware. yes installs the newest release from kernel.org # into /lib/firmware, owned by the firmware package like everything else # there. Without it: "failed to load regulatory.db" at boot, and the most # conservative channels and transmit power the driver has. REGDB=yes # ---- headers ------------------------------------------------------------- # # /usr/include is owned by the headers package (p_linux-headers), installed # by the LFS step of the same name. Installing a newer kernel's headers is # an UPDATE of that package, so the copy runs as that account -- a second # package writing over its files could not work, and should not. # # HEADERS=no leaves /usr/include alone, which is what you want when the # running system's headers are deliberately older than the kernel you build. HEADERS=yes HEADERS_PKG=linux-headers # ---- extras -------------------------------------------------------------- # A 224-colour ppm boot logo, or empty for the stock one. BOOTLOGO=https://christianimmanuel.de/bootlogo.ppm # The out-of-tree v4l2loopback module. V4L2LOOPBACK=yes V4L2LOOPBACK_GIT=https://github.com/v4l2loopback/v4l2loopback.git