summaryrefslogtreecommitdiff
path: root/kernels/linux-libre-lts-knock/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'kernels/linux-libre-lts-knock/PKGBUILD')
-rw-r--r--kernels/linux-libre-lts-knock/PKGBUILD86
1 files changed, 45 insertions, 41 deletions
diff --git a/kernels/linux-libre-lts-knock/PKGBUILD b/kernels/linux-libre-lts-knock/PKGBUILD
index b0a2669c2..4868b72b0 100644
--- a/kernels/linux-libre-lts-knock/PKGBUILD
+++ b/kernels/linux-libre-lts-knock/PKGBUILD
@@ -1,3 +1,4 @@
+# $Id$
# Contributor (Arch): Tobias Powalowski <tpowa@archlinux.org>
# Contributor (Arch): Thomas Baechler <thomas@archlinux.org>
# Maintainer: André Silva <emulatorman@parabola.nu>
@@ -7,38 +8,41 @@
# Contributor: Márcio Silva <coadde@parabola.nu>
# Contributor: Luke Shumaker <lukeshu@sbcglobal.net>
-pkgbase=linux-libre-lts-knock # Build stock -libre-lts-knock kernel
-#pkgbase=linux-libre-custom # Build kernel with a different name
-_basekernel=3.10
-_sublevel=53
-_knockpatchver=${_basekernel}
-pkgver=${_basekernel}.${_sublevel}
+pkgbase=linux-libre-lts-knock # Build stock -lts-knock kernel
+_pkgbasever=3.10-gnu
+_pkgver=3.10.53-gnu
+_lxopkgver=3.10.53-gnu # nearly always the same as _pkgver
+_knockpatchver=3.10
+
+_replaces=('kernel26%' 'kernel26-libre%' 'linux%' 'linux-libre%-kmod-alx') # '%' gets replaced with _kernelname
+
+_srcname=linux-${_pkgbasever%-*}
+pkgver=${_pkgver//-/.}
pkgrel=1
-_lxopkgver=${_basekernel}.52 # nearly always the same as pkgver
arch=('i686' 'x86_64' 'mips64el')
url="https://gnunet.org/knock"
license=('GPL2')
makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc')
options=('!strip')
-source=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${_basekernel}-gnu/linux-libre-${_basekernel}-gnu.tar.xz"
- "http://linux-libre.fsfla.org/pub/linux-libre/releases/${pkgver}-gnu/patch-${_basekernel}-gnu-${pkgver}-gnu.xz"
+source=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${_pkgbasever}/linux-libre-${_pkgbasever}.tar.xz"
+ "http://linux-libre.fsfla.org/pub/linux-libre/releases/${_pkgver}/patch-${_pkgbasever}-${_pkgver}.xz"
"http://gnunet.org/sites/default/files/tcp_stealth_${_knockpatchver}.diff"
# the main kernel config files
'config.i686' 'config.x86_64'
# standard config files for mkinitcpio ramdisk
- "${pkgbase}.preset"
+ 'linux.preset'
'Kbuild'
'Kbuild.platforms'
'logo_linux_'{clut224.ppm,vga16.ppm,mono.pbm}
'change-default-console-loglevel.patch'
'criu-no-expert.patch'
- "http://www.linux-libre.fsfla.org/pub/linux-libre/lemote/gnewsense/pool/debuginfo/linux-patches-${_lxopkgver}-gnu_0loongsonlibre_mipsel.tar.xz")
+ "http://www.linux-libre.fsfla.org/pub/linux-libre/lemote/gnewsense/pool/debuginfo/linux-patches-${_lxopkgver}_0loongsonlibre_mipsel.tar.xz")
md5sums=('d562fd52580a3b6b18b6eeb5921d1d5c'
'4840f0db6af66cbce923b1043971c256'
'26380d6f05471ef8e065a77d87588009'
'25ad0606de251a5734f4535c61452a56'
'158cb922d9b43028f6c45c696e773915'
- '02023949955a138c44bb0c46227a6d18'
+ 'eb14dcfd80c00852ef81ded6e826826a'
'2967cecc3af9f954ccc822fd63dca6ff'
'8267264d9a8966e57fdacd1fa1fc65c4'
'071d4939e9ef4256e4c027ef3c864903'
@@ -54,13 +58,14 @@ if [ "$CARCH" != "mips64el" ]; then
fi
_kernelname=${pkgbase#linux-libre}
-_localversionname=-libre-lts-knock
+_replaces=("${_replaces[@]/\%/${_kernelname}}")
prepare() {
- cd "${srcdir}/linux-${_basekernel}"
+ cd "${srcdir}/${_srcname}"
- if [ "${_basekernel}" != "${pkgver}" ]; then
- patch -Np1 -i "${srcdir}/patch-${_basekernel}-gnu-${pkgver}-gnu"
+ # add upstream patch
+ if [ "${_pkgbasever}" != "${_pkgver}" ]; then
+ patch -p1 -i "${srcdir}/patch-${_pkgbasever}-${_pkgver}"
fi
# add knock patch
@@ -105,19 +110,19 @@ prepare() {
fi
if [ "${_kernelname}" != "" ]; then
- sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_localversionname}\"|g" ./.config
+ sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config
fi
- # set extraversion to pkgrel
- sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile
+ # append pkgrel to extraversion
+ sed -ri "s|^(EXTRAVERSION =.*\S).*|\1-${pkgrel}|" Makefile
# don't run depmod on 'make install'. We'll do this ourselves in packaging
sed -i '2iexit 0' scripts/depmod.sh
}
build() {
- cd "${srcdir}/linux-${_basekernel}"
+ cd "${srcdir}/${_srcname}"
# get kernel version
make prepare
@@ -160,15 +165,15 @@ build() {
}
_package() {
- pkgdesc="The ${pkgbase^} kernel and modules - stable longtime supported kernel package suitable for servers with support for stealth TCP sockets"
+ pkgdesc="The ${pkgbase/linux/Linux} kernel and modules"
[ "${pkgbase}" = "linux-libre" ] && groups=('base')
- depends=('coreutils' 'linux-libre-firmware' 'kmod')
+ depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7')
optdepends=('crda: to set the correct wireless channels of your country')
- provides=("kernel26${_kernelname}=${pkgver}" "linux${_kernelname}=${pkgver}" "linux${_kernelname/-lts/}")
- conflicts=("kernel26${_kernelname}" "kernel26-libre${_kernelname}" "linux${_kernelname}" "linux${_kernelname/-lts/}" "linux-libre${_kernelname/-lts/}")
- replaces=("kernel26${_kernelname}" "kernel26-libre${_kernelname}" "linux${_kernelname}" "linux${_kernelname/-lts/}" "linux-libre${_kernelname/-lts/}")
+ provides=( "${_replaces[@]/%/=${pkgver}}")
+ conflicts=("${_replaces[@]}")
+ replaces=( "${_replaces[@]}")
backup=("etc/mkinitcpio.d/${pkgbase}.preset")
- install=${pkgbase}.install
+ install=linux.install
if [ "$CARCH" = "mips64el" ]; then
optdepends+=('mkinitcpio: to make the initramfs (needs reinstall of this package)')
conflicts+=('mkinitcpio<0.7')
@@ -176,8 +181,7 @@ _package() {
depends+=('mkinitcpio>=0.7')
fi
- cd "${srcdir}/linux-${_basekernel}"
-
+ cd "${srcdir}/${_srcname}
KARCH=x86
[ $CARCH = "mips64el" ] && KARCH=mips
@@ -208,9 +212,9 @@ _package() {
-i "${startdir}/${install}"
# install mkinitcpio preset file for kernel
- install -D -m644 "${srcdir}/${pkgbase}.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
+ install -D -m644 "${srcdir}/linux.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
sed \
- -e "1s|'linux*.*'|'${pkgbase}'|" \
+ -e "1s|'linux.*'|'${pkgbase}'|" \
-e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgbase}\"|" \
-e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgbase}.img\"|" \
-e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgbase}-fallback.img\"|" \
@@ -229,10 +233,10 @@ _package() {
# gzip -9 all modules to save 100MB of space
find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \;
# make room for external modules
- ln -s "../extramodules-${_basekernel}${_localversionname:--libre-lts-knock}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
+ ln -s "../extramodules-${_basekernel}${_kernelname}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
# add real version for building modules and running depmod from post_install/upgrade
- mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_localversionname:--libre-lts-knock}"
- echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_localversionname:--libre-lts-knock}/version"
+ mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname}"
+ echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname}/version"
# Now we call depmod...
depmod -b "$pkgdir" -F System.map "$_kernver"
@@ -243,9 +247,9 @@ _package() {
_package-headers() {
pkgdesc="Header files and scripts for building modules for ${pkgbase^} kernel"
- provides=("kernel26${_kernelname}-headers=${pkgver}" "linux${_kernelname}-headers=${pkgver}" "linux${_kernelname/-lts/}-headers")
- conflicts=("kernel26${_kernelname}-headers" "kernel26-libre${_kernelname}-headers" "linux${_kernelname}-headers" "linux${_kernelname/-lts/}-headers" "linux-libre${_kernelname/-lts/}-headers")
- replaces=("kernel26${_kernelname}-headers" "kernel26-libre${_kernelname}-headers" "linux${_kernelname}-headers" "linux${_kernelname/-lts/}-headers" "linux-libre${_kernelname/-lts/}-headers")
+ provides=( "${_replaces[@]/%/-headers=${pkgver}}")
+ conflicts=("${_replaces[@]/%/-headers}")
+ replaces=( "${_replaces[@]/%/-headers}")
KARCH=x86
[ $CARCH = "mips64el" ] && KARCH=mips
@@ -261,7 +265,7 @@ _package-headers() {
cd "${pkgdir}/usr/lib/modules/${_kernver}"
ln -sf ../../../src/linux-${_kernver} build
- cd "${srcdir}/linux-${_basekernel}"
+ cd "${srcdir}/${_srcname}"
install -D -m644 Makefile \
"${pkgdir}/usr/src/linux-${_kernver}/Makefile"
install -D -m644 kernel/Makefile \
@@ -403,11 +407,11 @@ _package-headers() {
_package-docs() {
pkgdesc="Kernel hackers manual - HTML documentation that comes with the ${pkgbase^} kernel"
- provides=("kernel26${_kernelname}-docs=${pkgver}" "linux${_kernelname}-docs=${pkgver}" "linux${_kernelname/-lts/}-docs")
- conflicts=("kernel26${_kernelname}-docs" "kernel26-libre${_kernelname}-docs" "linux${_kernelname}-docs" "linux${_kernelname/-lts/}-docs" "linux-libre${_kernelname/-lts/}-docs")
- replaces=("kernel26${_kernelname}-docs" "kernel26-libre${_kernelname}-docs" "linux${_kernelname}-docs" "linux${_kernelname/-lts/}-docs" "linux-libre${_kernelname/-lts/}-docs")
+ provides=( "${_replaces[@]/%/-docs=${pkgver}}")
+ conflicts=("${_replaces[@]/%/-docs}")
+ replaces=( "${_replaces[@]/%/-docs}")
- cd "${srcdir}/linux-${_basekernel}"
+ cd "${srcdir}/${_srcname}"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}"
cp -al Documentation "${pkgdir}/usr/src/linux-${_kernver}"