Want more features on Pastebin? Sign Up, it's FREE!
Guest

linux-lqx-3.1.3-1

By: a guest on Nov 30th, 2011  |  syntax: Bash  |  size: 11.49 KB  |  views: 64  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # Maintainer: <NONE> (Reason: orphaned)
  2. # Contributor: Michael Duell <mail@akurei.me> PGP-Key: 6EE23EBE
  3.  
  4. ###########################################################################################################
  5. #                                          Patch and Build Options
  6. ###########################################################################################################
  7. _menu="n"            # menuconfig option [m = make menuconfig; x = make xconfig; n = none]
  8. _config="pkg"    # "local":  make localmod config - compile ONLY probed modules - see notes below!
  9.                # "old":    make with old config (/proc/config.gz)
  10.                # "pkg":    use this package's config
  11. _compress_modules="y" #compress(gzip -9) modules to save about 100MB of space
  12. ###########################################################################################################
  13. ## LOCALMODCONFIG OPTION
  14.  # As of mainline 2.6.32, running with this option will only build the modules that you currently have
  15.  # probed in your system VASTLY reducing the number of modules build.
  16.  #
  17.  # WARNING - make CERTAIN that all modules are modprobed BEFORE you begin making the pkg!
  18.  # Read, https://bbs.archlinux.org/viewtopic.php?pid=830221#p830221
  19.  # To keep track of which modules are needed for your specific system/hardware, give graysky's module_db script
  20.  # a try: http://aur.archlinux.org/packages.php?ID=41689
  21.  #
  22.  # Note that if you use graysky's script, this PKGBUILD will auto run the reload_data base for you to probe
  23.  # all the modules you have logged!
  24.  #
  25.  
  26. _basekernel=3.1
  27. pkgver=${_basekernel}.3
  28. pkgrel=1
  29. _kernelname=-lqx
  30. pkgname=linux${_kernelname}
  31. _lqxpatchname="${pkgver}-1.patch"
  32. arch=('i686' 'x86_64')
  33. pkgdesc="Linux kernel and modules with Liquorix patches"
  34. license=('GPL2')
  35. groups=('base')
  36. url="http://liquorix.net/"
  37. backup=(etc/mkinitcpio.d/${pkgname}.preset)
  38. depends=('coreutils' 'linux-firmware' 'module-init-tools>=3.16' 'mkinitcpio>=0.8')
  39. optdepends=('crda: to set the correct wireless channels of your country')
  40. if [ "$_menu" = "x" ]; then
  41.    makedepends=('qt')
  42. fi
  43. options=(!strip)
  44. # pwc, ieee80211 and hostap-driver26 modules are included in linux now
  45. # nforce package support was abandoned by nvidia, kernel modules should cover everything now.
  46. # kernel24 support is dropped since glibc24
  47. replaces=('kernel24' 'kernel24-scsi' 'kernel26-scsi'
  48.           'alsa-driver' 'ieee80211' 'hostap-driver26'
  49.           'pwc' 'nforce' 'squashfs' 'unionfs' 'ivtv'
  50.           'zd1211' 'kvm-modules' 'iwlwifi' 'rt2x00-cvs'
  51.           'gspcav1' 'atl2' 'wlan-ng26' 'aufs' 'rt2500' 'kernel26-lqx')
  52. install='linux-lqx.install'
  53. source=(ftp://ftp.kernel.org/pub/linux/kernel/v3.x/linux-${_basekernel}.tar.bz2
  54. http://liquorix.net/sources/${_lqxpatchname}.gz
  55. http://liquorix.net/sources/${_basekernel}/config.i386
  56. http://liquorix.net/sources/${_basekernel}/config.amd64
  57. linux-lqx.preset)
  58.  
  59. provides=('linux-headers' "linux=$pkgver") # for when you have no other kernel
  60.  
  61. build() {
  62.   msg ""
  63.   msg "This package has been orphaned. Feel free to adopt."
  64.   msg ""
  65.   KARCH=x86
  66.   sed -i -e "s/+EXTRAVERSION = -lqx${_lqxrel}/+EXTRAVERSION =/" ${_lqxpatchname}
  67.   cd ${srcdir}/linux-${_basekernel}
  68.  
  69.   # Add Liquorix patches
  70.   patch -Np1 -i ${srcdir}/$_lqxpatchname
  71.    
  72.   # Trying oldcfg if possible and if selected
  73.   if [ "$_config" = "old" ]; then
  74.     if [ -e /proc/config.gz ]; then
  75.       zcat /proc/config.gz > ./.config
  76.     else
  77.       echo "WARNING: There's no /proc/config.gz... You cannot use the old config. Aborting..."
  78.       exit 1
  79.     fi        
  80.   else
  81.     if [ "$CARCH" = "x86_64" ]; then
  82.       cat ../config.amd64 >./.config
  83.     else
  84.       cat ../config.i386 >./.config
  85.     fi
  86.   fi
  87.  
  88.   if [ "${_kernelname}" != "" ]; then
  89.     sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
  90.   fi
  91.  
  92.   # get kernel version
  93.   make prepare
  94.   _kernver="$(make kernelrelease)"
  95.  
  96.   ### Optionally load needed modules for the make localmodconfig
  97.   # See http://aur.archlinux.org/packages.php?ID=41689
  98.   if [ $_config = "local" ]; then
  99.     msg "If you have modprobe_db installed, running reload_database now"
  100.     if [ -e /usr/bin/reload_database ]; then
  101.       /usr/bin/reload_database
  102.     fi
  103.     msg "Running Steven Rostedt's make localmodconfig now"
  104.     make localmodconfig
  105.   else
  106.     yes "" | make config
  107.   fi
  108.  
  109.   if [ $_menu = "m" -o $_menu = "y" ]; then
  110.     msg "Running make menuconfig"
  111.     make menuconfig
  112.   fi
  113.   if [ $_menu = "x" ]; then
  114.     msg "Running make xconfig"
  115.     make xconfig
  116.   fi
  117.  
  118.   # build!
  119.   make ${MAKEFLAGS} bzImage modules
  120.  
  121.   ### package_linux
  122.  
  123.   mkdir -p ${pkgdir}/{lib/modules,lib/firmware,boot}
  124.   make INSTALL_MOD_PATH=${pkgdir} modules_install
  125.  
  126.   cp System.map ${pkgdir}/boot/System.map26${_kernelname}
  127.   cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz-linux${_kernelname}
  128.  
  129.   # add vmlinux
  130.   #cp vmlinux ${pkgdir}/usr/src/linux-${_kernver}
  131.   install -m644 -D vmlinux ${pkgdir}/usr/src/linux-${_kernver}/vmlinux
  132.  
  133.   # install fallback mkinitcpio.conf file and preset file for kernel
  134.   install -m644 -D ${srcdir}/linux-lqx.preset ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset
  135.  
  136.   # set correct depmod command for install
  137.   sed \
  138.     -e  "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
  139.     -e  "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
  140.     -i ${startdir}/linux-lqx.install
  141.   sed \
  142.     -e "s|source .*|source /etc/mkinitcpio.d/linux${_kernelname}.kver|g" \
  143.     -e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgname}.img\"|g" \
  144.     -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgname}-fallback.img\"|g" \
  145.     -i ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset
  146.  
  147.   echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > ${pkgdir}/etc/mkinitcpio.d/${pkgname}.kver
  148.  
  149.   ### package_linux-headers
  150.  
  151.   install -D -m644 Makefile \
  152.     ${pkgdir}/usr/src/linux-${_kernver}/Makefile
  153.   install -D -m644 kernel/Makefile \
  154.     ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
  155.   install -D -m644 .config \
  156.     ${pkgdir}/usr/src/linux-${_kernver}/.config
  157.  
  158.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
  159.   for i in acpi asm-generic config generated linux math-emu media net pcmcia scsi sound trace video xen; do
  160.     cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
  161.   done
  162.  
  163.   # copy arch includes for external modules
  164.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
  165.   cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/
  166.  
  167.   # copy files necessary for later builds, like nvidia and vmware
  168.   cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
  169.   cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
  170.  
  171.   # fix permissions on scripts dir
  172.   chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
  173.  
  174.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
  175.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
  176.  
  177.   cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
  178.   if [ "$CARCH" = "i686" ]; then
  179.     cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
  180.   fi
  181.   cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
  182.  
  183.   # add headers for lirc package
  184.   # note: zc0301 removed due to compiling errors
  185.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
  186.   cp drivers/media/video/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
  187.   for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102; do
  188.     mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
  189.     cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
  190.   done
  191.  
  192.   # add docbook makefile
  193.   install -D -m644 Documentation/DocBook/Makefile \
  194.     ${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile
  195.  
  196.   # add dm headers
  197.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
  198.   cp drivers/md/*.h  ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
  199.  
  200.   # add inotify.h
  201.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
  202.   cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
  203.  
  204.   # add wireless headers
  205.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
  206.   cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
  207.  
  208.   # add dvb headers for external modules
  209.   # in reference to:
  210.   # http://bugs.archlinux.org/task/9912
  211.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
  212.   cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
  213.  
  214.   # add dvb headers for external modules
  215.   # in reference to:
  216.   # http://bugs.archlinux.org/task/11194
  217.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
  218.   [[ -e include/config/dvb/ ]] && cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
  219.  
  220.   # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
  221.   # in reference to:
  222.   # http://bugs.archlinux.org/task/13146
  223.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
  224.   cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
  225.   cp drivers/media/video/msp3400-driver.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
  226.  
  227.   # add xfs and shmem for aufs building
  228.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
  229.   mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
  230.   cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
  231.  
  232.   # add headers for virtualbox
  233.   # in reference to:
  234.   # http://bugs.archlinux.org/task/14568
  235.   cp -a include/drm ${pkgdir}/usr/src/linux-${_kernver}/include/
  236.  
  237.   # add headers for broadcom wl
  238.   # in reference to:
  239.   # http://bugs.archlinux.org/task/14568
  240.   cp -a include/trace ${pkgdir}/usr/src/linux-${_kernver}/include/
  241.  
  242.   # copy in Kconfig files
  243.   for i in `find . -name "Kconfig*"`; do
  244.     mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
  245.     cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
  246.   done
  247.  
  248.   chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
  249.   find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
  250.   cd ${pkgdir}/lib/modules/${_kernver} && \
  251.     (rm -f source build; ln -sf ../../../usr/src/linux-${_kernver} build)
  252.  
  253.   msg "Removing unneeded architectures..."
  254.   # remove unneeded architectures
  255.   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}
  256.   msg "Removing the firmware..."
  257.   # remove the firmware
  258.   rm -rf ${pkgdir}/lib/firmware
  259.   if [ $_compress_modules = "y" ]; then
  260.     # gzip -9 all modules to save 100MB of space
  261.     msg "Compressing modules..."
  262.     find "$pkgdir" -name '*.ko' -exec gzip -9 {} \;
  263.   fi
  264. }
  265.  
  266. # vim:ts=2:sw=2:expandtab
  267. # oh hai thar: checksums
  268. sha512sums=('131b814325d888bb11ba552bc5bdd91ee2d8e139b06ac7ba94e716bcbbcc99ba30867eeea4aab580907916203bc526ae0bccda688151b250ba7943e193e50252'
  269.             'b696746a2725508adaafd989c6a2207d093b8d7b23090fea1f107c8784cfa1e8ae9ee2e92387f7ebc61e891de123fc0732caa72925f9673e7bc6bd0bcc18c63f'
  270.             '2f05b66d425f44fa30f3a96a3228b7132d99c879367c850243d1b85662435a98fbc888d1751f1429c3e84f506ffab2e7b0c084ee77eb4501d4e691db17a70beb'
  271.             '3dec24fb9df639c0a6c58101587cafccc6f9e7075bb31057820a09fe6078ea644afa2573e2b3f0089647889971cf82b9bf82285bca967a1af05f216655e32db8'
  272.             '65fd484647b52ed8b75ab5d5f296ab1b79917ee83625bee9e74a8b3c1f9b155674001934c0a81e630997050816fdfd2b597eaf076838f250d61b51e4ec2aac16')
  273.  
  274.  
clone this paste RAW Paste Data