#!/bin/sh MAKEDEPS="make bc" DEPS="sbase kmod" PKG_VER=5.16.12 SOURCE=https://cdn.kernel.org/pub/linux/kernel/v${PKG_VER%%.*}.x/linux-$PKG_VER.tar.xz ADDITIONAL=" config fix-sbase-coreutils.patch " prepare () { apply_patches mv config .config export GREP="ggrep" make olddefconfig make -s kernelrelease > version echo "Prepared linux version $(cat version)" } build () { make all } package () { local kernver="$(cat version)" local modulesdir="$PKG_DEST/usr/lib/modules/$PKG_VER" echo "Installing boot image..." mkdir -p $PKG_DEST/boot cp arch/x86/boot/bzImage $PKG_DEST/boot/vmlinuz-$PKG_VER cp System.map $PKG_DEST/boot/System.map-$PKG_VER cp .config $PKG_DEST/boot/config-$PKG_VER install -d $PKG_DEST/usr/share/doc/linux-$PKG_VER cp -r Documentation/* $PKG_DEST/usr/share/doc/linux-$PKG_VER install -m755 -d $PKG_DEST/etc/modprobe.d cat > $PKG_DEST/etc/modprobe.d/usb.conf << "EOF" # Begin /etc/modprobe.d/usb.conf install ohci_hcd /sbin/modprobe ehci_hcd ; /sbin/modprobe -i ohci_hcd ; true install uhci_hcd /sbin/modprobe ehci_hcd ; /sbin/modprobe -i uhci_hcd ; true # End /etc/modprobe.d/usb.conf EOF echo "Installing modules..." make INSTALL_MOD_PATH="$PKG_DEST/usr" INSTALL_MOD_STRIP=1 modules_install rm "$modulesdir"/source rm "$modulesdir"/build }