summaryrefslogtreecommitdiff
path: root/libre/linux-libre/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'libre/linux-libre/PKGBUILD')
-rw-r--r--libre/linux-libre/PKGBUILD66
1 files changed, 49 insertions, 17 deletions
diff --git a/libre/linux-libre/PKGBUILD b/libre/linux-libre/PKGBUILD
index e0220e8fd..5b8430f86 100644
--- a/libre/linux-libre/PKGBUILD
+++ b/libre/linux-libre/PKGBUILD
@@ -4,14 +4,17 @@
# Maintainer (Parabola): Nicolás Reynolds <fauno@kiwwwi.com.ar>
# Maintainer (Parabola): Sorin-Mihai Vârgolici <smv@yobicore.org>
# Maintainer (Parabola): André Silva <andre.paulista@adinet.com.uy>
+# Maintainer (Parabola): Michał Masłowski <mtjm@mtjm.eu>
pkgbase=linux-libre
pkgname=('linux-libre' 'linux-libre-headers' 'linux-libre-docs') # Build stock -LIBRE kernel
# pkgname=linux-custom # Build kernel with a different name
_kernelname=${pkgname#linux-libre}
_basekernel=3.2
-pkgver=${_basekernel}.7
-pkgrel=1
+_sublevel=9
+pkgver=${_basekernel}.${_sublevel}
+_lxopkgver=${_basekernel}.7 # nearly always the same as pkgver
+pkgrel=2
arch=('i686' 'x86_64' 'mips64el')
url="http://linux-libre.fsfla.org/"
license=('GPL2')
@@ -19,7 +22,6 @@ makedepends=('xmlto' 'docbook-xsl')
options=('!strip')
source=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${_basekernel}-libre/linux-${_basekernel}-libre.tar.xz"
"http://linux-libre.fsfla.org/pub/linux-libre/releases/${pkgver}-libre/patch-${_basekernel}-libre-${pkgver}-libre.xz"
- "http://www.linux-libre.fsfla.org/pub/linux-libre/lemote/gnewsense/pool/linux-patches-${pkgver}-libre-lemote_0lxo_mipsel.tar.bz2"
# the main kernel config files
'config.i686' 'config.x86_64'
# standard config files for mkinitcpio ramdisk
@@ -29,19 +31,27 @@ source=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${_basekernel}-li
'boot-logo.patch'
'change-default-console-loglevel.patch'
'i915-fix-ghost-tv-output.patch'
- 'i915-gpu-finish.patch')
+ 'i915-gpu-finish.patch'
+ 'ext4-options.patch'
+ "http://www.linux-libre.fsfla.org/pub/linux-libre/lemote/gnewsense/pool/linux-patches-${_lxopkgver}-libre-lemote_0lxo_mipsel.tar.bz2")
md5sums=('27c641c4f6785fc647cdd3e44963a55c'
- '37a0fdc7ad19c9489faf09925b4fae5b'
- '690e6201d219638544d2fba3996dc822'
- '79db8a444fd149e409f706830d8cee9a'
- 'e26dbcb367a2b48f5ed09560e2ae8fa0'
+ '8e601878ccdd37111cc84500ebd81387'
+ '921f108c7a4985f7f8b41d72ca9bf915'
+ 'f18ac3f790b0daa43f21dda04cceb90b'
'a8a3843046926eb7ab81312cd438c5c5'
'2967cecc3af9f954ccc822fd63dca6ff'
'8267264d9a8966e57fdacd1fa1fc65c4'
'04b21c79df0a952c22d681dd4f4562df'
'9d3c56a4b999c8bfbd4018089a62f662'
'263725f20c0b9eb9c353040792d644e5'
- '4cd79aa147825837dc8bc9f6b736c0a0')
+ '4cd79aa147825837dc8bc9f6b736c0a0'
+ 'f36222e7ce20c8e4dc27376f9be60f6c'
+ '690e6201d219638544d2fba3996dc822')
+if [ "$CARCH" != "mips64el" ]; then
+ # Don't use the Loongson-specific patches on non-mips64el arches.
+ unset source[${#source[@]}-1]
+ unset md5sums[${#md5sums[@]}-1]
+fi
build() {
cd "${srcdir}/linux-${_basekernel}"
@@ -71,18 +81,28 @@ build() {
# (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227)
patch -Np1 -i "${srcdir}/change-default-console-loglevel.patch"
+ # fix ext4 module to mount ext3/2 correct
+ # https://bugs.archlinux.org/task/28653
+ patch -Np1 -i "${srcdir}/ext4-options.patch"
+
if [ "$CARCH" == "mips64el" ]; then
sed -i "s|^EXTRAVERSION.*|EXTRAVERSION =-libre|" Makefile
+ sed -r "s|^( SUBLEVEL = ).*|\1$_sublevel|" \
+ < "${srcdir}/lxo-config.patch" > lxo-config.patch
msg2 "Adding loongson-community patches"
patch -Np1 -i ${srcdir}/${_basekernel}*-*-loongson-community.patch
- patch -Np0 -i "${srcdir}/lxo-config.patch"
+ patch -Np0 -i lxo-config.patch
-# ensure N32, add localversion and remove uevent helper as per
+# ensure N32, add localversion, remove uevent helper as per
# https://git.kernel.org/?p=linux/hotplug/udev.git;a=blob_plain;f=README
- sed -i -e "s|CONFIG_MIPS32_N32=.*|CONFIG_MIPS32_N32=y|g" \
+# and make USB storage support builtin (e.g. for booting from USB
+# disks without slowly loading an initramfs)
+ sed -ri -e "s|CONFIG_MIPS32_N32=.*|CONFIG_MIPS32_N32=y|g" \
-e "s|CONFIG_MIPS32_N32=.*|CONFIG_MIPS32_N32=y|g" \
-e "s|CONFIG_UEVENT_HELPER_PATH=.*|CONFIG_UEVENT_HELPER_PATH=\"\"|g" \
- -e "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"-LIBRE\"|g" ./.config
+ -e "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"-LIBRE\"|g" \
+ -e "s;(CONFIG_USB(_COMMON|_EHCI_HCD|_OHCI_HCD|_STORAGE.*|_UAS)?)=.*;\1=y;g" \
+ ./.config
else
cat "${srcdir}/config.${CARCH}" > ./.config # simpler
fi
@@ -116,7 +136,12 @@ build() {
# build!
if [ "$CARCH" == "mips64el" ]; then
- make ${MAKEFLAGS} vmlinuz modules
+ # The build system passes it directly to linker, disable to avoid
+ # having unknown -Wl,... options.
+ export LDFLAGS=""
+ # bzImage is arch-specific and not supported on mips; vmlinux is
+ # useful for oprofile.
+ make ${MAKEFLAGS} vmlinux vmlinuz modules
else
make ${MAKEFLAGS} bzImage modules
fi
@@ -125,13 +150,19 @@ build() {
package_linux-libre() {
pkgdesc="The Linux-libre Kernel and modules"
groups=('base')
- depends=('coreutils' 'module-init-tools>=3.16' 'mkinitcpio>=0.7')
+ depends=('coreutils' 'module-init-tools>=3.16')
optdepends=('crda: to set the correct wireless channels of your country')
provides=('kernel26' "linux=$pkgver")
conflicts=('kernel26' 'kernel26-libre' 'linux')
replaces=('kernel26' 'kernel26-libre' 'linux')
backup=("etc/mkinitcpio.d/${pkgname}.preset")
install=${pkgname}.install
+ if [ "$CARCH" = "mips64el" ]; then
+ optdepends+=('mkinitcpio: to make the initramfs (needs reinstall of this package)')
+ conflicts+=('mkinitcpio<0.7')
+ else
+ depends+=('mkinitcpio>=0.7')
+ fi
cd "${srcdir}/linux-${_basekernel}"
@@ -146,6 +177,7 @@ package_linux-libre() {
if [ "$CARCH" == "mips64el" ]; then
cp vmlinuz "${pkgdir}/boot/vmlinuz-${pkgname}"
+ cp vmlinux "${pkgdir}/boot/vmlinux-${pkgname}"
else
cp "arch/${KARCH}/boot/bzImage" "${pkgdir}/boot/vmlinuz-${pkgname}"
fi
@@ -197,7 +229,7 @@ package_linux-libre-headers() {
# In case of repackaging this is empty
if [ -z "${_kernver}" ]; then
- cd ${srcdir}/linux-$pkgver
+ cd "${srcdir}/linux-${_basekernel}"
_kernver="$(make kernelrelease)"
fi
@@ -231,7 +263,7 @@ package_linux-libre-headers() {
if [ "$CARCH" = "mips64el" ]; then
cp "arch/${KARCH}/Kbuild" "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/"
- cp "arch/${KARCH}/loongson" "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/"
+ cp -a "arch/${KARCH}/loongson" "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/"
cp "${srcdir}/Kbuild.platforms" "${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/"
fi