summaryrefslogtreecommitdiff
path: root/libre/kernel26-libre
diff options
context:
space:
mode:
Diffstat (limited to 'libre/kernel26-libre')
-rw-r--r--libre/kernel26-libre/Kbuild19
-rw-r--r--libre/kernel26-libre/Kbuild.platforms6
-rw-r--r--libre/kernel26-libre/PKGBUILD76
3 files changed, 86 insertions, 15 deletions
diff --git a/libre/kernel26-libre/Kbuild b/libre/kernel26-libre/Kbuild
new file mode 100644
index 000000000..8a9d7dceb
--- /dev/null
+++ b/libre/kernel26-libre/Kbuild
@@ -0,0 +1,19 @@
+# Fail on warnings - also for files referenced in subdirs
+# -Werror can be disabled for specific files using:
+# CFLAGS_<file.o> := -Wno-error
+subdir-ccflags-y := -Wno-error
+
+# platform specific definitions
+include arch/mips/Kbuild.platforms
+obj-y := $(platform-y)
+
+# make clean traverses $(obj-) without having included .config, so
+# everything ends up here
+obj- := $(platform-)
+
+# mips object files
+# The object files are linked as core-y files would be linked
+
+obj-y += kernel/
+obj-y += mm/
+obj-y += math-emu/
diff --git a/libre/kernel26-libre/Kbuild.platforms b/libre/kernel26-libre/Kbuild.platforms
new file mode 100644
index 000000000..90a226888
--- /dev/null
+++ b/libre/kernel26-libre/Kbuild.platforms
@@ -0,0 +1,6 @@
+# All platforms listed in alphabetic order
+
+platforms += loongson
+
+# include the platform specific files
+include $(patsubst %, $(srctree)/arch/mips/%/Platform, $(platforms))
diff --git a/libre/kernel26-libre/PKGBUILD b/libre/kernel26-libre/PKGBUILD
index bdff9b357..68433ed5c 100644
--- a/libre/kernel26-libre/PKGBUILD
+++ b/libre/kernel26-libre/PKGBUILD
@@ -10,16 +10,19 @@ pkgver=${_basekernel}.3
pkgrel=1
makedepends=('xmlto' 'docbook-xsl')
_patchname="patch-${pkgver}-${pkgrel}-LIBRE"
-arch=(i686 x86_64)
+arch=(i686 x86_64 mips64el)
license=('GPL2')
url="http://linux-libre.fsfla.org/"
options=(!strip)
source=(http://linux-libre.fsfla.org/pub/linux-libre/releases/${pkgver}-libre/linux-${pkgver}-libre.tar.bz2
+ http://linux-libre.fsfla.org/pub/linux-libre/lemote/gnewsense/pool/linux-patches-${pkgver}-libre-lemote_0lxo_mipsel.tar.bz2
http://repo.parabolagnulinux.org/other/kernel26/${_patchname}.bz2
# the main kernel config files
config.i686 config.x86_64
# standard config files for mkinitcpio ramdisk
kernel26.preset
+ Kbuild
+ Kbuild.platforms
kernel26.install)
build() {
@@ -28,7 +31,24 @@ build() {
# See http://projects.parabolagnulinux.org/linux-libre-2.6-LIBRE.git/
patch -Np1 -i ${srcdir}/${_patchname}
- cat $srcdir/config.$CARCH > ./.config # simpler
+ if [ "$CARCH" == "mips64el" ]; then
+# Fix for lxo-config.patch Makefile
+ sed -i "s|^EXTRAVERSION.*|EXTRAVERSION =.${pkgver##*.}-libre|" Makefile
+
+ msg2 "Adding loongson-community patches"
+ patch -Np1 -i ${srcdir}/$pkgver-*-loongson-community.patch
+# This is the config file
+ patch -Np0 -i ${srcdir}/lxo-config.patch
+
+ sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"-LIBRE\"|g" ./.config
+ sed -i "s|CONFIG_LOGO_LIBRE_CLUT224=.*|CONFIG_LOGO_LIBRE_CLUT224=y|g" ./.config
+ sed -i "s|CONFIG_LOGO_LINUX_CLUT224=.*|CONFIG_LOGO_LINUX_CLUT224=|g" ./.config
+
+# build with -Wno-error
+ cp --remove-destination ${srcdir}/Kbuild arch/mips/
+ else
+ cat $srcdir/config.$CARCH > ./.config # simpler
+ fi
for this_doesnt_build in CONFIG_WLAGS49_H2 CONFIG_WLAGS49_H25 CONFIG_VT6656; do
sed -i "s|^${this_doesnt_build}=.*|# ${this_doesnt_build} is not set|g" ./.config
@@ -58,7 +78,12 @@ build() {
####################
yes "" | make config
# build!
- make ${MAKEFLAGS} bzImage modules
+ #yes "" | make config
+ if [ "$CARCH" == "mips64el" ]; then
+ make ${MAKEFLAGS} vmlinuz modules
+ else
+ make ${MAKEFLAGS} bzImage modules
+ fi
}
package_kernel26-libre() {
@@ -80,13 +105,20 @@ package_kernel26-libre() {
optdepends=('crda: to set the correct wireless channels of your country')
KARCH=x86
+ [[ $CARCH = "mips64el" ]] && KARCH=mips
cd ${srcdir}/linux-$pkgver
# get kernel version
_kernver="$(make kernelrelease)"
mkdir -p ${pkgdir}/{lib/modules,lib/firmware,boot}
make INSTALL_MOD_PATH=${pkgdir} modules_install
cp System.map ${pkgdir}/boot/System.map26${_kernelname}
- cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname}
+
+ if [ "$CARCH" == "mips64el" ]; then
+ cp vmlinuz ${pkgdir}/boot/vmlinuz26${_kernelname}
+ else
+ cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname}
+ install -m644 -D vmlinux.32 ${pkgdir}/usr/src/linux-${_kernver}/vmlinux32
+ fi
# # add vmlinux
install -m644 -D vmlinux ${pkgdir}/usr/src/linux-${_kernver}/vmlinux
@@ -118,6 +150,9 @@ package_kernel26-libre-headers() {
replaces=('kernel26-headers')
conflicts=('kernel26-headers')
KARCH=x86
+ [[ $CARCH = "mips64el" ]] && KARCH=mips
+ cd ${srcdir}/linux-$pkgver
+ _kernver="$(make kernelrelease)"
mkdir -p ${pkgdir}/lib/modules/${_kernver}
cd ${pkgdir}/lib/modules/${_kernver}
ln -sf ../../../usr/src/linux-${_kernver} build
@@ -136,8 +171,13 @@ package_kernel26-libre-headers() {
done
# copy arch includes for external modules
- mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
- cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/
+ mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH
+ cp -a arch/$KARCH/include ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
+ if [ "$CARCH" = "mips64el" ]; then
+ cp -a arch/$KARCH/Kbuild ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
+ cp -a arch/$KARCH/loongson ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
+ cp -a $srcdir/Kbuild.platforms ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
+ fi
# copy files necessary for later builds, like nvidia and vmware
cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
@@ -161,6 +201,10 @@ package_kernel26-libre-headers() {
mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
done
+ if [ "$CARCH" != "mips64el" ]; then
+ mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/staging/usbvideo/
+ cp -a drivers/staging/usbvideo/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/staging/usbvideo/
+ fi
# add docbook makefile
install -D -m644 Documentation/DocBook/Makefile \
${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile
@@ -181,8 +225,10 @@ package_kernel26-libre-headers() {
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/11194
- mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
- cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
+ if [ "$CARCH" != "mips64el" ]; then
+ mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
+ cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
+ fi
# add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
# in reference to:
# http://bugs.archlinux.org/task/13146
@@ -222,7 +268,13 @@ package_kernel26-libre-headers() {
esac
done
# remove unneeded architectures
- rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
+ rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
+ if [ "$CARCH" = "mips64el" ]; then
+ rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
+ else
+ rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/mips
+ fi
+
}
package_kernel26-libre-docs() {
@@ -239,9 +291,3 @@ find $pkgdir -type d -exec chmod 755 {} \;
# remove a file already in kernel26 package
rm -f $pkgdir/usr/src/linux-$_kernver/Documentation/DocBook/Makefile
}
-md5sums=('ed628f2c07a63b8f06ff2a7dff573119'
- 'adb567a66bf34fd80c5339818a345f49'
- 'd5c6c675662d98011513f6cbc81d66db'
- '00e8553b44dac65fc093db60a1cde842'
- '25584700a0a679542929c4bed31433b6'
- 'fdfed5e8b46f289617ee6def01978090')