PKGBUILD 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # Maintainer: Donald Carr <sirspudd at gmail dot com>
  2. #set -x
  3. pkgname=linux-spudd
  4. provides=("linux-spudd")
  5. # The firmware the kernel produces blows: don't falsify this lightly
  6. # "linux-firmware=20170309.695f2d6-1"
  7. conflicts=("linux")
  8. pkgrel=1
  9. pkgver=4.16.rc7.r220.gd095ee200d45
  10. pkgdesc="Kernel build from head"
  11. arch=("x86_64" "aarch64")
  12. license=("GPL2.1")
  13. _kernel_src_dir=/opt/dev/src/OSS/linux
  14. if [ -z "${LOCAL_PI_VER}" ]; then
  15. install=spudd.install
  16. fi
  17. _make_cmd="make ${_xcompile_args}"
  18. pkgver() {
  19. cd $_kernel_src_dir
  20. git describe --tags | cut -c2- | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
  21. }
  22. build() {
  23. cd $_kernel_src_dir && git clean -xdf
  24. ${_make_cmd}
  25. }
  26. package() {
  27. boot_dir="${pkgdir}/boot"
  28. usr_dir="${pkgdir}/usr"
  29. firmware_dir="${usr_dir}/lib/firmware"
  30. preset_dir=${pkgdir}/etc/mkinitcpio.d
  31. cd $_kernel_src_dir
  32. INSTALL_MOD_PATH=${usr_dir} ${_make_cmd} modules_install
  33. mkdir -p ${boot_dir}
  34. if [ "${LOCAL_PI_VER}" = "3" ]; then
  35. cp arch/arm64/boot/Image ${boot_dir}
  36. else
  37. cp arch/x86/boot/bzImage ${boot_dir}/vmlinuz-spudd
  38. mkdir -p ${preset_dir}
  39. cp ${startdir}/spudd.preset ${preset_dir}
  40. fi
  41. rm -Rf ${startdir}/firmware
  42. if [[ -d ${firmware_dir} ]]; then
  43. mv ${firmware_dir} ${startdir}
  44. fi
  45. }
  46. if [ -n "${LOCAL_PI_VER}" ]; then
  47. case ${LOCAL_PI_VER} in
  48. 3)
  49. echo "Compiling for the RPi 3 aarch64"
  50. cp ${_kernel_src_dir}/configs/rpi3 ${_kernel_src_dir}/.config
  51. _xcompile_args="ARCH=arm64 CROSS_COMPILE=/opt/x-tools/aarch64-rpi3-linux-gnu/bin/aarch64-rpi3-linux-gnu-"
  52. ;;
  53. *)
  54. echo "Only supports the rpi3 at this point in time"
  55. exit 1
  56. ;;
  57. esac
  58. else
  59. echo "Compiling for desktop"
  60. cp ${_kernel_src_dir}/configs/desktop ${_kernel_src_dir}/.config
  61. fi
  62. _make_cmd="make ${_xcompile_args}"