pakur.sh 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. bsurum=5.1
  2. cd "${SRC}/linux-${bsurum}"
  3. KARCH=x86
  4. # get kernel version
  5. #_kernver="$(make kernelrelease)"
  6. #KERNEL_VERSION="${surum}-milis"
  7. _kernver="${surum}-milis"
  8. mkdir -p ${PKG}/usr/lib/modules
  9. mkdir -p ${PKG}/usr/lib/firmware
  10. mkdir -p ${PKG}/boot
  11. make INSTALL_MOD_PATH=${PKG}/usr modules_install
  12. cp arch/$KARCH/boot/bzImage "${PKG}/boot/kernel-${surum}"
  13. # vmlinux un source a eklenmesi,modül derlerken bu geçici silinecek
  14. #install -D -m644 vmlinux "${PKG}/usr/src/linux-${_kernver}/vmlinux"
  15. # derleme kalıntılarının temizlenmesi
  16. rm -f "${PKG}"/usr/lib/modules/${_kernver}/{source,build}
  17. # firmwarelerin temizlenmesi
  18. rm -rf "${PKG}/usr/lib/firmware"
  19. # modüllerin sıkıştırılarak ek yer kazanılması
  20. find "${PKG}" -name '*.ko' -exec gzip -9 {} \;
  21. #linux-headers / linux modülleri
  22. install -dm755 "${PKG}/usr/lib/modules/${_kernver}"
  23. cd "${PKG}/usr/lib/modules/${_kernver}"
  24. ln -sf /usr/src/linux-${_kernver} build
  25. cd "${SRC}/linux-${bsurum}"
  26. install -D -m644 Makefile \
  27. "${PKG}/usr/src/linux-${_kernver}/Makefile"
  28. install -D -m644 kernel/Makefile \
  29. "${PKG}/usr/src/linux-${_kernver}/kernel/Makefile"
  30. install -D -m644 .config \
  31. "${PKG}/usr/src/linux-${_kernver}/.config"
  32. ######################
  33. mkdir -p "${PKG}/usr/src/linux-${_kernver}/include"
  34. for i in acpi asm-generic config crypto drm generated linux math-emu \
  35. media net pcmcia scsi rdma soc sound trace uapi video xen; do
  36. cp -a include/${i} "${PKG}/usr/src/linux-${_kernver}/include/"
  37. done
  38. # copy arch includes for external modules
  39. mkdir -p "${PKG}/usr/src/linux-${_kernver}/arch/x86"
  40. cp -a arch/x86/include "${PKG}/usr/src/linux-${_kernver}/arch/x86/"
  41. # copy files necessary for later builds, like nvidia and vmware
  42. cp Module.symvers "${PKG}/usr/src/linux-${_kernver}"
  43. cp -a scripts "${PKG}/usr/src/linux-${_kernver}"
  44. # fix permissions on scripts dir
  45. chmod og-w -R "${PKG}/usr/src/linux-${_kernver}/scripts"
  46. mkdir -p "${PKG}/usr/src/linux-${_kernver}/.tmp_versions"
  47. mkdir -p "${PKG}/usr/src/linux-${_kernver}/arch/x86/kernel"
  48. cp arch/x86/Makefile "${PKG}/usr/src/linux-${_kernver}/arch/x86/"
  49. cp arch/x86/kernel/asm-offsets.s "${PKG}/usr/src/linux-${_kernver}/arch/x86/kernel/"
  50. # add headers for lirc package
  51. # pci
  52. for i in bt8xx cx88 saa7134; do
  53. mkdir -p "${PKG}/usr/src/linux-${_kernver}/drivers/media/pci/${i}"
  54. cp -a drivers/media/pci/${i}/*.h "${PKG}/usr/src/linux-${_kernver}/drivers/media/pci/${i}"
  55. done
  56. # usb
  57. for i in cpia2 em28xx pwc; do
  58. mkdir -p "${PKG}/usr/src/linux-${_kernver}/drivers/media/usb/${i}"
  59. cp -a drivers/media/usb/${i}/*.h "${PKG}/usr/src/linux-${_kernver}/drivers/media/usb/${i}"
  60. done
  61. # i2c
  62. mkdir -p "${PKG}/usr/src/linux-${_kernver}/drivers/media/i2c"
  63. cp drivers/media/i2c/*.h "${PKG}/usr/src/linux-${_kernver}/drivers/media/i2c/"
  64. for i in cx25840; do
  65. mkdir -p "${PKG}/usr/src/linux-${_kernver}/drivers/media/i2c/${i}"
  66. cp -a drivers/media/i2c/${i}/*.h "${PKG}/usr/src/linux-${_kernver}/drivers/media/i2c/${i}"
  67. done
  68. # add docbook makefile
  69. #install -D -m644 Documentation/DocBook/Makefile \
  70. # "${PKG}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile"
  71. # add dm headers
  72. mkdir -p "${PKG}/usr/src/linux-${_kernver}/drivers/md"
  73. cp drivers/md/*.h "${PKG}/usr/src/linux-${_kernver}/drivers/md"
  74. # add inotify.h
  75. mkdir -p "${PKG}/usr/src/linux-${_kernver}/include/linux"
  76. cp include/linux/inotify.h "${PKG}/usr/src/linux-${_kernver}/include/linux/"
  77. # add wireless headers
  78. mkdir -p "${PKG}/usr/src/linux-${_kernver}/net/mac80211/"
  79. cp net/mac80211/*.h "${PKG}/usr/src/linux-${_kernver}/net/mac80211/"
  80. # add dvb headers for external modules
  81. #mkdir -p "${PKG}/usr/src/linux-${_kernver}/drivers/media/dvb-core"
  82. #cp drivers/media/dvb-core/*.h "${PKG}/usr/src/linux-${_kernver}/drivers/media/dvb-core/"
  83. # and...
  84. mkdir -p "${PKG}/usr/src/linux-${_kernver}/include/config/dvb/"
  85. cp include/config/dvb/*.h "${PKG}/usr/src/linux-${_kernver}/include/config/dvb/"
  86. # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
  87. mkdir -p "${PKG}/usr/src/linux-${_kernver}/drivers/media/dvb-frontends/"
  88. cp drivers/media/dvb-frontends/lgdt330x.h "${PKG}/usr/src/linux-${_kernver}/drivers/media/dvb-frontends/"
  89. cp drivers/media/i2c/msp3400-driver.h "${PKG}/usr/src/linux-${_kernver}/drivers/media/i2c/"
  90. # add dvb headers
  91. mkdir -p "${PKG}/usr/src/linux-${_kernver}/drivers/media/usb/dvb-usb"
  92. cp drivers/media/usb/dvb-usb/*.h "${PKG}/usr/src/linux-${_kernver}/drivers/media/usb/dvb-usb/"
  93. mkdir -p "${PKG}/usr/src/linux-${_kernver}/drivers/media/dvb-frontends"
  94. cp drivers/media/dvb-frontends/*.h "${PKG}/usr/src/linux-${_kernver}/drivers/media/dvb-frontends/"
  95. mkdir -p "${PKG}/usr/src/linux-${_kernver}/drivers/media/tuners"
  96. cp drivers/media/tuners/*.h "${PKG}/usr/src/linux-${_kernver}/drivers/media/tuners/"
  97. # add xfs and shmem for aufs building
  98. mkdir -p "${PKG}/usr/src/linux-${_kernver}/fs/xfs/libxfs"
  99. mkdir -p "${PKG}/usr/src/linux-${_kernver}/mm"
  100. cp fs/xfs/libxfs/xfs_sb.h "${PKG}/usr/src/linux-${_kernver}/fs/xfs/libxfs/xfs_sb.h"
  101. #aufs4-util need
  102. sed -i "s:__user::g" "${PKG}/usr/src/linux-${_kernver}/include/uapi/linux/aufs_type.h"
  103. # copy in Kconfig files
  104. for i in `find . -name "Kconfig*"`; do
  105. mkdir -p "${PKG}"/usr/src/linux-${_kernver}/`echo ${i} | sed 's|/Kconfig.*||'`
  106. cp ${i} "${PKG}/usr/src/linux-${_kernver}/${i}"
  107. done
  108. chown -R root.root "${PKG}/usr/src/linux-${_kernver}"
  109. find "${PKG}/usr/src/linux-${_kernver}" -type d -exec chmod 755 {} \;
  110. # strip scripts directory
  111. find "${PKG}/usr/src/linux-${_kernver}/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
  112. case "$(file -bi "${binary}")" in
  113. *application/x-sharedlib*) # Libraries (.so)
  114. /usr/bin/strip ${STRIP_SHARED} "${binary}";;
  115. *application/x-archive*) # Libraries (.a)
  116. /usr/bin/strip ${STRIP_STATIC} "${binary}";;
  117. *application/x-executable*) # Binaries
  118. /usr/bin/strip ${STRIP_BINARIES} "${binary}";;
  119. esac
  120. done
  121. # add objtool, nvidia needed
  122. install -Dt "${PKG}/usr/src/linux-${_kernver}/tools/objtool" tools/objtool/objtool
  123. # remove unneeded architectures
  124. rm -rf "${PKG}"/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,arm64,avr32,blackfin,c6x,cris,frv,h8300,hexagon,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,openrisc,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,unicore32,um,v850,xtensa}