# Maintainer: Josip Ponjavic # Contributor: ### BUILD OPTIONS # Set these variables to ANYTHING that is not null to enable them # Tweak kernel options prior to a build via nconfig : "${_makenconfig:=""}" # Compile ONLY used modules to VASTLY reduce the number of modules built # and the build time. # # To keep track of which modules are needed for your specific system/hardware, # give module_db script a try: https://aur.archlinux.org/packages/modprobed-db # This PKGBUILD read the database kept if it exists # # More at this wiki page ---> https://wiki.archlinux.org/index.php/Modprobed-db : "${_localmodcfg:=""}" ### IMPORTANT: Do no edit below this line unless you know what you're doing _major=4.14 _minor=271 _srcname=linux-${_major} _clr=${_major}.270-196 pkgbase=linux-clear-lts2017 pkgver=${_major}.${_minor} pkgrel=1 pkgdesc='Clear Linux lts2017' arch=('x86_64') url="https://github.com/clearlinux-pkgs/linux-lts2017" license=('GPL2') makedepends=('bc' 'cpio' 'git' 'kmod' 'libelf' 'pahole' 'xmlto') options=('!strip') source=( "https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-${_major}.tar".{xz,sign} "https://cdn.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.xz" "${pkgbase}::git+https://github.com/clearlinux-pkgs/linux-lts2017.git#tag=${_clr}" ) export KBUILD_BUILD_HOST=archlinux export KBUILD_BUILD_USER=$pkgbase export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" prepare() { cd ${_srcname} ### Add upstream patches echo "Add upstream patches" patch -Np1 -i ../patch-${pkgver} ### Setting version echo "Setting version..." scripts/setlocalversion --save-scmversion echo "-$pkgrel" > localversion.10-pkgrel echo "${pkgbase#linux}" > localversion.20-pkgname ### Add Clearlinux patches for i in $(grep '^Patch' ${srcdir}/${pkgbase}/linux-lts2017.spec | grep -Ev '^Patch0127' | sed -n 's/.*: //p'); do echo "Applying patch ${i}..." patch -Np1 -i "$srcdir/${pkgbase}/${i}" done ### Setting config echo "Setting config..." cp -Tf $srcdir/${pkgbase}/config ./.config ### Enable extra stuff from arch kernel echo "Enable extra stuff from arch kernel..." # General setup scripts/config --set-str DEFAULT_HOSTNAME archlinux \ --enable IKCONFIG \ --enable IKCONFIG_PROC \ --undefine RT_GROUP_SCHED # Power management and ACPI options scripts/config --enable ACPI_REV_OVERRIDE_POSSIBLE \ --enable ACPI_TABLE_UPGRADE # General architecture-dependent options scripts/config --enable KPROBES # Enable loadable module support scripts/config --undefine MODULE_SIG_FORCE \ --enable MODULE_COMPRESS \ --enable-after MODULE_COMPRESS MODULE_COMPRESS_XZ # Networking support scripts/config --enable NETFILTER_INGRESS # Device Drivers scripts/config --module PATA_JMICRON \ --enable SOUND_OSS_CORE \ --enable SND_OSSEMUL \ --module-after SND_OSSEMUL SND_MIXER_OSS \ --module-after SND_MIXER_OSS SND_PCM_OSS \ --enable-after SND_PCM_OSS SND_PCM_OSS_PLUGINS # Kernel hacking -> Compile-time checks and compiler options -> Make section mismatch errors non-fatal scripts/config --enable SECTION_MISMATCH_WARN_ONLY # Security options scripts/config --enable SECURITY_SELINUX \ --enable-after SECURITY_SELINUX SECURITY_SELINUX_BOOTPARAM \ --set-val SECURITY_SELINUX_BOOTPARAM_VALUE 0 \ --enable SECURITY_SMACK \ --enable-after SECURITY_SMACK SECURITY_SMACK_BRINGUP \ --enable-after SECURITY_SMACK_BRINGUP SECURITY_SMACK_NETFILTER \ --enable-after SECURITY_SMACK_NETFILTER SECURITY_SMACK_APPEND_SIGNALS \ --enable SECURITY_TOMOYO \ --enable SECURITY_APPARMOR \ --set-val SECURITY_APPARMOR_BOOTPARAM_VALUE 0 \ --enable SECURITY_YAMA make olddefconfig diff -u $srcdir/$pkgbase/config .config || : ### Optionally use running kernel's config # code originally by nous; http://aur.archlinux.org/packages.php?ID=40191 if [ -n "$_use_current" ]; then if [[ -s /proc/config.gz ]]; then echo "Extracting config from /proc/config.gz..." # modprobe configs zcat /proc/config.gz > ./.config else warning "Your kernel was not compiled with IKCONFIG_PROC!" warning "You cannot read the current config!" warning "Aborting!" exit fi fi ### Optionally load needed modules for the make localmodconfig # See https://aur.archlinux.org/packages/modprobed-db if [ -n "$_localmodcfg" ]; then if [ -e $HOME/.config/modprobed.db ]; then echo "Running Steven Rostedt's make localmodconfig now" make LSMOD=$HOME/.config/modprobed.db localmodconfig else echo "No modprobed.db data found" exit fi fi make -s kernelrelease > version echo "Prepared $pkgbase version $(