talimat 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. # Description: The latest stable kernel version with ck.kolivas patch
  2. # URL: http://ck.kolivas.org/patches/4.0/
  3. # Packagers: pierre at nutyx dot org, tnut at nutyx dot org, berlius at nutyx dot com
  4. PKGMK_IGNORE_UNPACK="yes"
  5. PKGMK_NO_STRIP="yes"
  6. PKGMK_GROUPS=(devel doc)
  7. name=kernel-ck
  8. version=4.3
  9. release=1
  10. _version=${version%.*}
  11. source=(https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-$version.tar.xz
  12. http://ck.kolivas.org/patches/4.0/$version/$version-ck1/patch-$version-ck1.xz
  13. $name.config $name.config_64 )
  14. build(){
  15. bsdtar -p -o -C $SRC -xf linux-$version.tar.xz
  16. cd linux-$version
  17. if [ -f $SRC/patch-$version-ck1.xz ]; then
  18. xz -d -c $SRC/patch-$version-ck1.xz | patch -Np1
  19. fi
  20. make mrproper
  21. case `uname -m` in
  22. x86_64)
  23. cp -v $SRC/$name.config_64 ./.config;;
  24. i?86)
  25. cp -v $SRC/$name.config ./.config;
  26. esac
  27. #make xconfig
  28. #make nconfig
  29. make menuconfig
  30. make || make -j1
  31. case `uname -m` in
  32. x86_64)
  33. cp .config $SRC/$name.config_64;;
  34. i?86)
  35. cp .config $SRC/$name.config;;
  36. esac
  37. # Install modules
  38. cd $SRC/linux-$version
  39. sed -i "/rm\ -rf\ \$(MODLIB)\/kernel/d" Makefile
  40. make INSTALL_MOD_PATH=$PKG modules_install || make -j1 INSTALL_MOD_PATH=$PKG modules_install
  41. mkdir -p $PKG/boot
  42. case `uname -m` in
  43. x86_64)
  44. cp System.map \
  45. $PKG/boot/System_64.map-$version
  46. cp .config \
  47. $PKG/boot/config_64-$version
  48. cp arch/x86_64/boot/bzImage \
  49. $PKG/boot/$name-$version ;;
  50. i?86)
  51. cp System.map \
  52. $PKG/boot/System.map-$version
  53. cp .config \
  54. $PKG/boot/config-$version
  55. cp arch/i386/boot/bzImage \
  56. $PKG/boot/$name-$version ;;
  57. esac
  58. cd $PKG/lib/modules/${version}*/
  59. mkdir -p $PKG/usr/src
  60. mv $SRC/linux-$version $PKG/usr/src/
  61. rm {build,source}
  62. ln -sv /usr/src/linux-$version build
  63. ln -sv /usr/src/linux-$version source
  64. mkdir $SRC/linux-$version
  65. mv $PKG/usr/src/linux-$version/Documentation \
  66. $SRC/linux-$version
  67. # Firmware are in linux-firmware
  68. rm -rf $PKG/lib/firmware
  69. # post-install autogen
  70. INITRD_VERSION="`basename $PKG/lib/modules/*`"
  71. echo "mkinitramfs $INITRD_VERSION" > $PKGMK_ROOT/$name.post-install
  72. echo "[ -f boot/initrd ] && rm boot/initrd" >> $PKGMK_ROOT/$name.post-install
  73. echo "ln -sf initrd-$INITRD_VERSION boot/initrd" >> $PKGMK_ROOT/$name.post-install
  74. echo "ln -sf $name-$version boot/kernel" >> $PKGMK_ROOT/$name.post-install
  75. #pre-install autogen
  76. cd $SRC
  77. if [ -f aaabasicfs-${AAABASICFS}.tar.xz ]; then
  78. bsdtar -p -o -C $SRC -xf aaabasicfs-${AAABASICFS}.tar.xz
  79. echo ". lib/lsb/init-functions" > $PKGMK_ROOT/$name.pre-install
  80. for FILE in `tar --list --file aaabasicfs-${AAABASICFS}.tar.xz|grep -v /$`
  81. do
  82. echo "log_info_msg \"update $FILE\"" >> $PKGMK_ROOT/$name.pre-install
  83. echo "cat > $FILE << \"END_OF_FILE\"" >> $PKGMK_ROOT/$name.pre-install
  84. cat $SRC/$FILE >> $PKGMK_ROOT/$name.pre-install
  85. echo "END_OF_FILE" >> $PKGMK_ROOT/$name.pre-install
  86. echo "evaluate_retval" >> $PKGMK_ROOT/$name.pre-install
  87. done
  88. fi
  89. }
  90. devel() {
  91. cd $PKG
  92. rm -r usr/src/linux-$version/{tools,ipc,init,drivers,firmware,fs,mm,samples,security,sound,virt}
  93. for i in alpha arc arm arm26 arm64 avr32 blackfin c6x \
  94. cris frv h8300 hexagon ia64 m32r m68k m68knommu metag \
  95. mips microblaze mn10300 openrisc parisc powerpc ppc s390 \
  96. score sh sh64 sparc sparc64 tile unicore32 um v850 xtensa
  97. do rm -rf usr/src/linux-$version/arch/$i
  98. done
  99. bsdtar -cf \
  100. $PKGMK_PACKAGE_DIR/$name.devel#$version-any.mps \
  101. usr/src/linux-$version
  102. rm -r usr
  103. }
  104. doc() {
  105. cd $PKG
  106. mkdir -p usr/share/doc/linux-$version
  107. mv $SRC/linux-$version/Documentation \
  108. usr/share/doc/linux-$version
  109. bsdtar -cf \
  110. $PKGMK_PACKAGE_DIR/$name.doc#$version-any.mps \
  111. usr/share/doc/linux-$version
  112. rm -r usr
  113. }