talimat 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. # Description: The latest stable kernel version
  2. # URL: http://www.kernel.org
  3. # Packagers: milisarge
  4. name=kernel-lts
  5. version=4.4.6
  6. release=1
  7. _version=${version%.*}
  8. source=(http://www.kernel.org/pub/linux/kernel/v4.x/linux-${_version}.tar.xz
  9. https://www.kernel.org/pub/linux/kernel/v4.x/patch-$version.xz
  10. $name.config $name.config_64 )
  11. build(){
  12. cd linux-${_version}
  13. if [ -f $SRC/patch-$version.xz ]; then
  14. xz -d -c $SRC/patch-$version.xz | patch -Np1
  15. fi
  16. make mrproper
  17. case `uname -m` in
  18. x86_64)
  19. cp $SRC/$name.config_64 ./.config;;
  20. i?86)
  21. cp $SRC/$name.config ./.config;
  22. esac
  23. # make menuconfig
  24. make || make -j1
  25. case `uname -m` in
  26. x86_64)
  27. cp .config $SRC/$name.config_64;;
  28. i?86)
  29. cp .config $SRC/$name.config;;
  30. esac
  31. # Install modules
  32. cd $SRC/linux-${_version}
  33. sed -i "/rm\ -rf\ \$(MODLIB)\/kernel/d" Makefile
  34. make INSTALL_MOD_PATH=$PKG modules_install || make -j1 INSTALL_MOD_PATH=$PKG modules_install
  35. mkdir -p $PKG/boot
  36. case `uname -m` in
  37. x86_64)
  38. cp System.map \
  39. $PKG/boot/System_64.map-$version
  40. cp .config \
  41. $PKG/boot/config_64-$version
  42. cp arch/x86_64/boot/bzImage \
  43. $PKG/boot/$name-$version ;;
  44. i?86)
  45. cp System.map \
  46. $PKG/boot/System.map-$version
  47. cp .config \
  48. $PKG/boot/config-$version
  49. cp arch/i386/boot/bzImage \
  50. $PKG/boot/$name-$version ;;
  51. esac
  52. cd $PKG/lib/modules/${version}*/
  53. mkdir -p $PKG/usr/src
  54. mv $SRC/linux-${_version} $PKG/usr/src/
  55. rm {build,source}
  56. ln -sv /usr/src/linux-${_version} build
  57. ln -sv /usr/src/linux-${_version} source
  58. mkdir $SRC/linux-${_version}
  59. mv $PKG/usr/src/linux-${_version}/Documentation \
  60. $SRC/linux-${_version}
  61. # Firmware are in linux-firmware
  62. rm -rf $PKG/lib/firmware
  63. # post-install autogen
  64. INITRD_VERSION="`basename $PKG/lib/modules/*`"
  65. echo "mkinitramfs $INITRD_VERSION" > $PKGMK_ROOT/$name.post-install
  66. echo "[ -f boot/initrd ] && rm boot/initrd" >> $PKGMK_ROOT/$name.post-install
  67. echo "ln -sf initrd-$INITRD_VERSION boot/initrd" >> $PKGMK_ROOT/$name.post-install
  68. echo "ln -sf $name-$version boot/kernel" >> $PKGMK_ROOT/$name.post-install
  69. #pre-install autogen
  70. cd $SRC
  71. if [ -f aaabasicfs-${AAABASICFS}.tar.xz ]; then
  72. bsdtar -p -o -C $SRC -xf aaabasicfs-${AAABASICFS}.tar.xz
  73. echo ". lib/lsb/init-functions" > $PKGMK_ROOT/$name.pre-install
  74. for FILE in `tar --list --file aaabasicfs-${AAABASICFS}.tar.xz|grep -v /$`
  75. do
  76. echo "log_info_msg \"update $FILE\"" >> $PKGMK_ROOT/$name.pre-install
  77. echo "cat > $FILE << \"END_OF_FILE\"" >> $PKGMK_ROOT/$name.pre-install
  78. cat $SRC/$FILE >> $PKGMK_ROOT/$name.pre-install
  79. echo "END_OF_FILE" >> $PKGMK_ROOT/$name.pre-install
  80. echo "evaluate_retval" >> $PKGMK_ROOT/$name.pre-install
  81. done
  82. fi
  83. }
  84. rm -r $PKG/usr/src/