talimat 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. # Description: uzun donem kararli kernel surumu
  2. # URL: http://www.kernel.org
  3. # Packagers: milisarge
  4. name=kernel-lts
  5. version=4.4.27
  6. _srcname=linux-4.4
  7. release=3
  8. _version=${version:0:3}
  9. alias=(linux-lts)
  10. # Virtualbox
  11. vb_version=5.1.8
  12. [ "`uname -m`" == "i686" ] && _VBARCH=x86
  13. [ "`uname -m`" == "x86_64" ] && _VBARCH=amd64
  14. # Broadcom
  15. wl_version=6.30.223.271
  16. _wlarch=_64
  17. source=(\
  18. http://www.kernel.org/pub/linux/kernel/v4.x/linux-${_version}.tar.xz
  19. https://www.kernel.org/pub/linux/kernel/v4.x/patch-$version.xz
  20. https://sourceforge.net/projects/kaosx/files/sources/virtualbox-modules/vbox-kernel-module-src-${vb_version}.tar.xz
  21. http://www.broadcom.com/docs/linux_sta/hybrid-v35${_wlarch}-nodebug-pcoem-${wl_version//./_}.tar.gz
  22. broadcom-wl.modprobe.d broadcom-wl.license.patch wl_linux.c.patch
  23. aufs4-loopback.patch
  24. aufs4-base.patch
  25. aufs4-mmap.patch
  26. aufs4-standalone.patch
  27. aufs4-kbuild.patch
  28. aufs4.4-20160912.patch
  29. lockdep-debug.patch
  30. tmpfs-idr.patch
  31. vfs-ino.patch
  32. aufs_type.h
  33. $name.config_64
  34. virtualbox.conf
  35. virtualbox-modules-depmod.patch
  36. https://github.com/milisarge/aufs/archive/master.tar.gz)
  37. build(){
  38. cd linux-${_version}
  39. cp -r $SRC/aufs-master $SRC/fs/
  40. if [ -f $SRC/patch-$version.xz ]; then
  41. xz -d -c $SRC/patch-$version.xz | patch -Np1
  42. fi
  43. #aufs patches for Live:
  44. patch -p1 -i "${SRC}/aufs4.4-20160912.patch"
  45. patch -p1 -i "${SRC}/aufs4-base.patch"
  46. patch -p1 -i "${SRC}/aufs4-kbuild.patch"
  47. patch -p1 -i "${SRC}/aufs4-loopback.patch"
  48. patch -p1 -i "${SRC}/aufs4-mmap.patch"
  49. patch -p1 -i "${SRC}/aufs4-standalone.patch"
  50. patch -p1 -i "${SRC}/lockdep-debug.patch"
  51. patch -p1 -i "${SRC}/tmpfs-idr.patch"
  52. patch -p1 -i "${SRC}/vfs-ino.patch"
  53. make mrproper
  54. cp $SRC/kernel-lts.config_64 ./.config
  55. make
  56. cp .config $SRC/$name.config_64
  57. ## Modules
  58. #
  59. # Kernel modules
  60. cd $SRC/linux-${_version}
  61. make INSTALL_MOD_PATH=$PKG modules_install
  62. KERNEL_VERSION="${version}-milis-lts"
  63. # Module broadcom is broken on 32 bits machine
  64. if [ "$PKGMK_ARCH" == "x86_64" ]; then
  65. cd $SRC
  66. bsdtar xf $DERLEME_KAYNAKDIZIN/hybrid-v35${_wlarch}-nodebug-pcoem-${wl_version//./_}.tar.gz
  67. patch -p1 -i broadcom-wl.license.patch
  68. patch -p1 -i wl_linux.c.patch
  69. sed -e "/BRCM_WLAN_IFNAME/s:eth:wlan:" \
  70. -i src/wl/sys/wl_linux.c
  71. BUILD_NOPEDANTIC=1 make -C $SRC/linux-${_version} M=`pwd`
  72. install -m 0644 -D wl.ko $PKG/lib/modules/${KERNEL_VERSION}/kernel/drivers/zzzz/wl.ko
  73. install -Dm644 broadcom-wl.modprobe.d $PKG/etc/modprobe.d/broadcom-wl.conf
  74. fi
  75. for i in *.ko
  76. do
  77. install -D -m0644 $i $PKG/lib/modules/${KERNEL_VERSION}/kernel/drivers/zzzz/$i
  78. done
  79. # Module virtualbox
  80. cd vbox-kernel-module-src-5.1.8
  81. patch -p0 -i $SRC/virtualbox-modules-depmod.patch
  82. KERNELRELEASE=${version}
  83. KERN_DIR=$SRC/linux-${_version} make
  84. mkdir -p $PKG/etc/sysconfig/modules.d
  85. install -D -m644 $SRC/virtualbox.conf $PKG/etc/sysconfig/modules.d/virtualbox.conf
  86. for i in *.ko
  87. do
  88. install -D -m0644 $i $PKG/lib/modules/${KERNEL_VERSION}/kernel/drivers/zzzz/$i
  89. done
  90. # depmod needed
  91. depmod -b $PKG -a ${KERNEL_VERSION}
  92. install -D -m 644 $SRC/aufs_type.h "${PKG}/usr/include/linux/aufs_type.h"
  93. # Install config and kernel files
  94. cd $SRC/linux-${_version}
  95. mkdir -p $PKG/boot
  96. cp System.map $PKG/boot/System_64.map-$version
  97. cp .config $PKG/boot/config_64-$version
  98. cp arch/x86_64/boot/bzImage $PKG/boot/kernel-$version
  99. #kaynak basliklarin ayarlanmasi
  100. KARCH=x86
  101. cd "${SRC}/${_srcname}"
  102. install -D -m644 Makefile \
  103. "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/Makefile"
  104. install -D -m644 kernel/Makefile \
  105. "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/kernel/Makefile"
  106. install -D -m644 .config \
  107. "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/.config"
  108. mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/include"
  109. for i in acpi asm-generic config crypto drm generated keys linux math-emu \
  110. media net pcmcia scsi soc sound trace uapi video xen; do
  111. cp -a include/${i} "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/include/"
  112. done
  113. # copy arch includes for external modules
  114. mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/arch/x86"
  115. cp -a arch/x86/include "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/arch/x86/"
  116. # copy files necessary for later builds, like nvidia and vmware
  117. cp Module.symvers "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build"
  118. cp -a scripts "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build"
  119. # fix permissions on scripts dir
  120. chmod og-w -R "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/scripts"
  121. mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/.tmp_versions"
  122. mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/arch/${KARCH}/kernel"
  123. cp arch/${KARCH}/Makefile "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/arch/${KARCH}/"
  124. cp arch/${KARCH}/kernel/asm-offsets.s "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/arch/${KARCH}/kernel/"
  125. # add docbook makefile
  126. install -D -m644 Documentation/DocBook/Makefile \
  127. "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/Documentation/DocBook/Makefile"
  128. # add dm headers
  129. mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/md"
  130. cp drivers/md/*.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/md"
  131. # add inotify.h
  132. mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/include/linux"
  133. cp include/linux/inotify.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/include/linux/"
  134. # add wireless headers
  135. mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/net/mac80211/"
  136. cp net/mac80211/*.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/net/mac80211/"
  137. # add dvb headers for external modules
  138. # in reference to:
  139. # http://bugs.archlinux.org/task/9912
  140. mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/dvb-core"
  141. cp drivers/media/dvb-core/*.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/dvb-core/"
  142. # and...
  143. # http://bugs.archlinux.org/task/11194
  144. mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/include/config/dvb/"
  145. cp include/config/dvb/*.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/include/config/dvb/"
  146. # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
  147. # in reference to:
  148. # http://bugs.archlinux.org/task/13146
  149. mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/dvb-frontends/"
  150. cp drivers/media/dvb-frontends/lgdt330x.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/dvb-frontends/"
  151. mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/i2c/"
  152. cp drivers/media/i2c/msp3400-driver.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/i2c/"
  153. # add dvb headers
  154. # in reference to:
  155. # http://bugs.archlinux.org/task/20402
  156. mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/usb/dvb-usb"
  157. cp drivers/media/usb/dvb-usb/*.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/usb/dvb-usb/"
  158. mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/dvb-frontends"
  159. cp drivers/media/dvb-frontends/*.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/dvb-frontends/"
  160. mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/tuners"
  161. cp drivers/media/tuners/*.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/drivers/media/tuners/"
  162. # add xfs and shmem for aufs building
  163. mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/fs/xfs"
  164. mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/mm"
  165. # removed in 3.17 series
  166. # cp fs/xfs/xfs_sb.h "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/fs/xfs/xfs_sb.h"
  167. # copy in Kconfig files
  168. for i in $(find . -name "Kconfig*"); do
  169. mkdir -p "${PKG}"/usr/lib/modules/${KERNEL_VERSION}/build/`echo ${i} | sed 's|/Kconfig.*||'`
  170. cp ${i} "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/${i}"
  171. done
  172. # add objtool for external module building and enabled VALIDATION_STACK option
  173. if [ -f tools/objtool/objtool ]; then
  174. mkdir -p "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/tools/objtool"
  175. cp -a tools/objtool/objtool ${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/tools/objtool/
  176. fi
  177. chown -R root.root "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build"
  178. find "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build" -type d -exec chmod 755 {} \;
  179. # strip scripts directory
  180. find "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
  181. case "$(file -bi "${binary}")" in
  182. *application/x-sharedlib*) # Libraries (.so)
  183. /usr/bin/strip ${STRIP_SHARED} "${binary}";;
  184. *application/x-archive*) # Libraries (.a)
  185. /usr/bin/strip ${STRIP_STATIC} "${binary}";;
  186. *application/x-executable*) # Binaries
  187. /usr/bin/strip ${STRIP_BINARIES} "${binary}";;
  188. esac
  189. done
  190. # remove unneeded architectures
  191. rm -rf "${PKG}"/usr/lib/modules/${KERNEL_VERSION}/build/arch/{alpha,arc,arm,arm26,arm64,avr32,blackfin,c6x,cris,frv,h8300,hexagon,ia64,m32r,m68k,m68knommu,metag,mips,microblaze,mn10300,openrisc,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,unicore32,um,v850,xtensa}
  192. # remove a files already in linux-docs package
  193. rm -f "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/Documentation/kbuild/Kconfig.recursion-issue-01"
  194. rm -f "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/Documentation/kbuild/Kconfig.recursion-issue-02"
  195. rm -f "${PKG}/usr/lib/modules/${KERNEL_VERSION}/build/Documentation/kbuild/Kconfig.select-break"
  196. # Firmware are in linux-firmware
  197. rm -rf $PKG/lib/firmware
  198. }