Zaktualizowałem swoja wersję linux-uksm do wersji 3.18.1
# Maintainer: Piotr Gorski <sir_lucjan@openlinux.pl>
# Contributor: Felix Yan <felixonmars@gmail.com>
# Contributor: Kelvin Ng (qpalz) <kelvin9302104 at gmail dot com>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Thomas Baechler <thomas@archlinux.org>
### BUILD OPTIONS
# Set these variables to ANYTHING that is not null to enable them
# NUMA is optimized for multi-socket motherboards.
# A single multi-core CPU actually runs slower with NUMA enabled.
# See, https://bugs.archlinux.org/task/31187
_NUMAdisable=y
# Compile ONLY probed modules
# As of mainline 2.6.32, running with this option will only build the modules
# that you currently have probed in your system VASTLY reducing the number of
# modules built and the build time to do it.
#
# WARNING - ALL modules must be probed BEFORE you begin making the pkg!
#
# 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 will call it directly to probe all the modules you have logged!
#
# More at this wiki page ---> https://wiki.archlinux.org/index.php/Modprobed_db
_localmodcfg=
# Use the current kernel's .config file
# Enabling this option will use the .config of the RUNNING kernel rather than
# the ARCH defaults. Useful when the package gets updated and you already went
# through the trouble of customizing your config options. NOT recommended when
# a new kernel is released, but again, convenient for package bumps.
_use_current=
# Alternative I/O scheduler by Paolo.
# Set this if you want it enabled globally i.e. for all devices in your system
# If you want it enabled on a device-by-device basis, leave this unset and see:
# https://wiki.archlinux.org/index.php/Linux-ck#How_to_Enable_the_BFQ_I.2FO_Scheduler
_BFQ_enable_=
### Do no edit below this line unless you know what you're doing
pkgbase=linux-uksm
pkgname=('linux-uksm' 'linux-uksm-headers' 'linux-uksm-docs')
_kernelname=-uksm
_srcname=linux-3.18
pkgver=3.18.1
pkgrel=1
arch=('i686' 'x86_64')
url="http://kerneldedup.org/"
license=('GPL2')
options=('!strip')
makedepends=('kmod' 'inetutils' 'bc')
_uksmvernel="0.1.2.3"
_uksmname="v3.18"
_bfqpath="http://algo.ing.unimo.it/people/paolo/disk_sched/patches/3.18.0-v7r6"
_bfqpath="https://pf.natalenko.name/mirrors/bfq/3.18.0-v7r6/"
_gcc_patch="enable_additional_cpu_optimizations_for_gcc_v4.9+_kernel_v3.15+.patch"
source=("http://www.kernel.org/pub/linux/kernel/v3.x/${_srcname}.tar.xz"
"http://www.kernel.org/pub/linux/kernel/v3.x/patch-${pkgver}.xz"
"http://kerneldedup.org/download/uksm/${_uksmvernel}/uksm-${_uksmvernel}-for-${_uksmname}.patch" # website often went down
#"uksm-${_uksmvernel}-for-${_uksmname}.test.patch"
"${_bfqpath}/0001-block-cgroups-kconfig-build-bits-for-BFQ-v7r6-3.18.patch"
"${_bfqpath}/0002-block-introduce-the-BFQ-v7r6-I-O-sched-for-3.18.patch"
"${_bfqpath}/0003-block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r6-for-3.18.0.patch"
"http://repo-ck.com/source/gcc_patch/${_gcc_patch}.gz"
'linux-uksm.preset'
'change-default-console-loglevel.patch'
'0001-drm-i915-Disallow-pin-ioctl-completely-for-kms-drive.patch'
'config' 'config.x86_64')
prepare() {
cd ${_srcname}
### add upstream patch
patch -Np1 -i "${srcdir}/patch-${pkgver}"
### set DEFAULT_CONSOLE_LOGLEVEL to 4 (same value as the 'quiet' kernel param)
# remove this when a Kconfig knob is made available by upstream
# (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227)
msg "Patching set DEFAULT_CONSOLE_LOGLEVEL to 4"
patch -p1 -i "${srcdir}/change-default-console-loglevel.patch"
# fix FS#43143
patch -p1 -i "${srcdir}/0001-drm-i915-Disallow-pin-ioctl-completely-for-kms-drive.patch"
msg "Patching source with BFQ patches"
for p in "${srcdir}"/000{1,2,3}-block*.patch; do
patch -Np1 -i "$p"
done
# Patch source to enable more gcc CPU optimizatons via the make nconfig
patch -Np1 -i "${srcdir}/${_gcc_patch}"
### Patch source with UKSM
msg "Patching with UKSM"
patch -Np1 -i "${srcdir}/uksm-${_uksmvernel}-for-${_uksmname}.patch"
### Clean tree and copy ARCH config over
msg "Running make mrproper to clean source tree"
make mrproper
if [ "${CARCH}" = "x86_64" ]; then
cat "${srcdir}/config.x86_64" > ./.config
else
cat "${srcdir}/config" > ./.config
fi
### 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
msg "Extracting config from /proc/config.gz..."
# modprobe configs
zcat /proc/config.gz > ./.config
else
warning "You kernel was not compiled with IKCONFIG_PROC!"
warning "You cannot read the current config!"
warning "Aborting!"
exit
fi
fi
if [ "${_kernelname}" != "" ]; then
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config
fi
### UKSM to be enabled
sed -i -e s'/CONFIG_KSM=y/CONFIG_KSM=y\nCONFIG_UKSM=y/' ./.config
### BFQ to be compiled in but not enabled
sed -i -e s'/CONFIG_CFQ_GROUP_IOSCHED=y/CONFIG_CFQ_GROUP_IOSCHED=y\nCONFIG_IOSCHED_BFQ=y\nCONFIG_CGROUP_BFQIO=y/' \
-i -e s'/CONFIG_DEFAULT_CFQ=y/CONFIG_DEFAULT_CFQ=y\n# CONFIG_DEFAULT_BFQ is not set/' ./.config
### Optionally enable BFQ as the default io scheduler
if [ -n "$_BFQ_enable_" ]; then
sed -i -e '/CONFIG_DEFAULT_IOSCHED/ s,cfq,bfq,' \
-i -e s'/CONFIG_DEFAULT_CFQ=y/# CONFIG_DEFAULT_CFQ is not set\nCONFIG_DEFAULT_BFQ=y/' ./.config
fi
### Optionally set tickrate to 1000 to avoid suspend issues as reported here:
# http://ck-hack.blogspot.com/2013/09/bfs-0441-311-ck1.html?showComment=1379234249615#c4156123736313039413
if [ -n "$_1k_HZ_ticks" ]; then
msg "Setting tick rate to 1k..."
sed -i -e 's/^CONFIG_HZ_300=y/# CONFIG_HZ_300 is not set/' \
-i -e 's/^# CONFIG_HZ_1000 is not set/CONFIG_HZ_1000=y/' \
-i -e 's/^CONFIG_HZ=300/CONFIG_HZ=1000/' .config
fi
# disable NUMA since 99.9% of users do not have multiple CPUs but do have multiple cores in one CPU
# see, https://bugs.archlinux.org/task/31187
if [ -n "$_NUMA_off" ]; then
if [ "${CARCH}" = "x86_64" ]; then
sed -i -e 's/CONFIG_NUMA=y/# CONFIG_NUMA is not set/' \
-i -e '/CONFIG_AMD_NUMA=y/d' \
-i -e '/CONFIG_X86_64_ACPI_NUMA=y/d' \
-i -e '/CONFIG_NODES_SPAN_OTHER_NODES=y/d' \
-i -e '/# CONFIG_NUMA_EMU is not set/d' \
-i -e '/CONFIG_NODES_SHIFT=6/d' \
-i -e '/CONFIG_NEED_MULTIPLE_NODES=y/d' \
-i -e '/CONFIG_USE_PERCPU_NUMA_NODE_ID=y/d' \
-i -e '/CONFIG_ACPI_NUMA=y/d' ./.config
fi
fi
# set extraversion to pkgrel
sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile
# don'