pakur.sh 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. bsurum=5.16.14
  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 INSTALL_MOD_STRIP=1 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. #linux-headers / linux modülleri
  20. install -dm755 "${PKG}/usr/lib/modules/${_kernver}"
  21. cd "${PKG}/usr/lib/modules/${_kernver}"
  22. ln -sf /usr/src/linux-${_kernver} build
  23. cd "${SRC}/linux-${bsurum}"
  24. builddir=${PKG}/usr/src/linux-${_kernver}
  25. install -Dt "$builddir" -m644 .config Makefile Module.symvers System.map
  26. install -Dt "$builddir/kernel" -m644 kernel/Makefile
  27. install -Dt "$builddir/arch/x86" -m644 arch/x86/Makefile
  28. cp -t "$builddir" -a scripts
  29. # add objtool for external module building and enabled VALIDATION_STACK option
  30. install -Dt "$builddir/tools/objtool" tools/objtool/objtool
  31. # headers
  32. cp -t "$builddir" -a include
  33. cp -t "$builddir/arch/x86" -a arch/x86/include
  34. install -Dt "$builddir/arch/x86/kernel" -m644 arch/x86/kernel/asm-offsets.s
  35. # gerekli başlık dosyalar
  36. install -Dt "$builddir/drivers/md" -m644 drivers/md/*.h
  37. install -Dt "$builddir/net/mac80211" -m644 net/mac80211/*.h
  38. install -Dt "$builddir/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h
  39. install -Dt "$builddir/drivers/media/usb/dvb-usb" -m644 drivers/media/usb/dvb-usb/*.h
  40. install -Dt "$builddir/drivers/media/dvb-frontends" -m644 drivers/media/dvb-frontends/*.h
  41. install -Dt "$builddir/drivers/media/tuners" -m644 drivers/media/tuners/*.h
  42. install -Dt "$builddir/drivers/iio/common/hid-sensors" -m644 drivers/iio/common/hid-sensors/*.h
  43. # kconfig dosyaları
  44. find . -name 'Kconfig*' -exec install -Dm644 {} "$builddir/{}" \;
  45. # gereksiz mimariler
  46. for garch in "$builddir"/arch/*/; do
  47. [[ $garch = */x86/ ]] && continue
  48. echo "Removing $(basename "$garch")"
  49. rm -r "$garch"
  50. done
  51. # belge sil
  52. rm -r "$builddir/Documentation"
  53. # kırık linkler
  54. find -L "$builddir" -type l -printf 'Removing %P\n' -delete
  55. # bağıntısızların silinmesi
  56. find "$builddir" -type f -name '*.o' -printf 'Removing %P\n' -delete
  57. # strip scripts directory
  58. find "${PKG}/usr/src/linux-${_kernver}/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
  59. case "$(file -bi "${binary}")" in
  60. *application/x-sharedlib*) # Libraries (.so)
  61. strip -v ${STRIP_SHARED} "${binary}";;
  62. *application/x-archive*) # Libraries (.a)
  63. strip -v ${STRIP_STATIC} "${binary}";;
  64. *application/x-executable*) # Binaries
  65. strip -v ${STRIP_BINARIES} "${binary}";;
  66. *application/x-pie-executable*) # Relocatable binaries
  67. strip -v ${STRIP_SHARED} "${binary}";;
  68. esac
  69. done