diff options
author | Nicolas Reynolds <fauno@kiwwwi.com.ar> | 2011-05-01 21:06:46 -0300 |
---|---|---|
committer | Nicolas Reynolds <fauno@kiwwwi.com.ar> | 2011-05-01 21:06:46 -0300 |
commit | 02380099f9ca13810767a2d25742c6862e255852 (patch) | |
tree | df57667ede730399a564a1f92a736de6eb638c32 /libre | |
parent | 155723b7ce3444f0aa0a28f05a02001372b9f768 (diff) |
kernel26-libre and gcc
Diffstat (limited to 'libre')
-rw-r--r-- | libre/kernel26-libre/Kbuild | 19 | ||||
-rw-r--r-- | libre/kernel26-libre/Kbuild.platforms | 6 | ||||
-rw-r--r-- | libre/kernel26-libre/PKGBUILD | 89 |
3 files changed, 93 insertions, 21 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 64375751f..31dca52b0 100644 --- a/libre/kernel26-libre/PKGBUILD +++ b/libre/kernel26-libre/PKGBUILD @@ -10,25 +10,51 @@ pkgver=${_basekernel}.4 pkgrel=1 makedepends=('xmlto' 'docbook-xsl') _patchname="patch-${pkgver}-${pkgrel}-LIBRE" -arch=(i686 x86_64 'mips64el') +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 - kernel26.install) + kernel26.install + Kbuild + Kbuild.platforms) +md5sums=('0f1a5d184d4029c9d9b38a4b9407c392' + 'bff27ebb220bd720d622047174511d94' + '8395aac2f31718b45afe57794c21ab81' + 'a6b673aead69b12f50b8ca53d1f14b14' + 'fa7d6abea1e2163b1ab2b1acfe117f51' + '25584700a0a679542929c4bed31433b6' + '2d68b4cf4caedd1f0188f4877eca1d43' + '2967cecc3af9f954ccc822fd63dca6ff' + '8267264d9a8966e57fdacd1fa1fc65c4') build() { cd ${srcdir}/linux-$pkgver # Add -LIBRE patches # See http://projects.parabolagnulinux.org/linux-libre-2.6-LIBRE.git/ - patch -Np1 -i ${srcdir}/${_patchname} || return 1 + patch -Np1 -i ${srcdir}/${_patchname} + sed -i "s|^EXTRAVERSION.*|EXTRAVERSION = .${pkgver##*.}-libre|" Makefile + + if [ "$CARCH" == "mips64el" ]; then + msg2 "Adding loongson-community patches" + patch -Np1 -i ${srcdir}/$pkgver-*-loongson-community.patch + patch -Np0 -i ${srcdir}/lxo-config.patch - cat $srcdir/config.$CARCH > ./.config # simpler +# ensure N32 + sed -i "s|CONFIG_MIPS32_O32=.*|# CONFIG_MIPS32_O32 is not set|g" ./.config + sed -i "s|CONFIG_MIPS32_N32=.*|CONFIG_MIPS32_N32=y|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; do sed -i "s|^${this_doesnt_build}=.*|# ${this_doesnt_build} is not set|g" ./.config @@ -58,7 +84,11 @@ build() { #################### yes "" | make config # build! - make ${MAKEFLAGS} bzImage modules + if [ "$CARCH" == "mips64el" ]; then + make ${MAKEFLAGS} vmlinuz modules + else + make ${MAKEFLAGS} bzImage modules + fi } package_kernel26-libre() { @@ -80,13 +110,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 +155,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 @@ -130,14 +170,18 @@ package_kernel26-libre-headers() { ${pkgdir}/usr/src/linux-${_kernver}/.config mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include - for i in acpi asm-generic config crypto drm generated linux math-emu \ - media net pcmcia scsi sound trace video xen; do + for i in acpi asm-generic config crypto drm generated linux math-emu media net pcmcia scsi sound trace video xen; do cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/ 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,8 +205,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 - mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/staging/usbvideo/ - cp -a drivers/staging/usbvideo/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/staging/usbvideo/ + 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 @@ -183,8 +229,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 @@ -224,7 +272,12 @@ 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() { @@ -241,9 +294,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=('0f1a5d184d4029c9d9b38a4b9407c392' - '8395aac2f31718b45afe57794c21ab81' - 'a6b673aead69b12f50b8ca53d1f14b14' - 'fa7d6abea1e2163b1ab2b1acfe117f51' - '25584700a0a679542929c4bed31433b6' - '2d68b4cf4caedd1f0188f4877eca1d43') |