# Template file for 'linux-stable'
#
# One template, four outputs (driver subpackages):
#   linux-stable            meta, depends linux=<version>
#   linux-stable-headers    meta, depends linux-headers=<version>
#   linux            image + modules + maps (post-install: depmod)
#   linux-headers    sanitized headers_install (user API only -
#                             NOT a module-build tree; openbcm needs a
#                             follow-up, see mk/kernel.inc)
pkgname=linux-stable
version=7.2.5
revision=0
short_desc="UNOS kernel meta - stable line"
maintainer="finwo <finwo@pm.me>"
license="GPL-2.0-only"
homepage="https://www.kernel.org"
distfiles="https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-7.2.5.tar.xz"
checksum=55ddf0df8325d9dad96fcff7bd93977d22e3f50af06527572af59b77c7632b78
# the meta points at this line's kernel build (exact pin incl. revision -
# apk's `=` only matches the full pkgver, so a bare version never matches)
depends="linux=${version}-r${revision}"
hostmakedepends="bc flex bison"
subpackages="linux-stable-headers linux linux-headers"

short_desc_linux_stable_headers="UNOS kernel headers meta - stable line"
depends_linux_stable_headers="linux-headers=${version}-r${revision}"
short_desc_linux="Linux kernel image and modules"
depends_linux="busybox"
short_desc_linux_headers="Linux kernel sanitized headers"
depends_linux_headers=

# Notes: same recipe as linux-longterm (defconfig + deltas, mk/kernel.inc).
# Deltas re-verified per line - symbols move between releases, the asserts
# fail loud if this list rots.

# shellcheck disable=SC1091
. "${UNOS_MKDIR}/kernel.inc"

KDELTA_ENABLE="IKCONFIG IKCONFIG_PROC NET_L3_MASTER_DEV IPV6_MULTIPLE_TABLES BLK_DEV_NVME MMC MMC_BLOCK BRIDGE VLAN_8021Q"
KDELTA_MODULE="NET_VRF"
KDELTA_DISABLE=""
KASSERT_Y="IPV6 IP_MULTIPLE_TABLES IPV6_MULTIPLE_TABLES NET_L3_MASTER_DEV DEVTMPFS_MOUNT BLK_DEV_INITRD SERIAL_8250_CONSOLE MODULES IKCONFIG IKCONFIG_PROC EFI_STUB BLK_DEV_NVME MMC MMC_BLOCK NVME_CORE BRIDGE VLAN_8021Q"
KASSERT_M="NET_VRF"
KASSERT_N="MODULE_SIG"

do_configure() { kernel_configure; }
do_build() { kernel_build; }
do_install() { kernel_install; }

sub_linux_stable_headers() { :; }
sub_linux() {
  spick boot
  spick lib/modules
}
sub_linux_headers() {
  spick usr/include
}
