APKBUILD 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. # Based on linux-lg-mako. Changes:
  2. # - add findutils makedepend (necessary for the initramfs)
  3. # - it builds an initramfs - do not use ramdisk.cpio and
  4. # ramdisk-recovery-device.cpio, in there, always use the
  5. # initramfs from the recovery partition ("isorec")
  6. # - directly boot to that initramfs, not only when the recovery
  7. # key combination was pressed.
  8. # - use Alpine's busybox-static instead of the pre-compiled
  9. # binary, that comes with the source
  10. #
  11. # Kernel config changes, based on: arch/arm/configs/i9100_defconfig
  12. # - enable devtmpfs (needed for udev -> touch support in weston)
  13. # - change compression from CONFIG_KERNEL_LZMA=y to
  14. # CONFIG_KERNEL_GZIP=y (so it works with busybox)
  15. # - disable ANDROID_PARANOID_NETWORK (removes network restrictions)
  16. _vendor=samsung
  17. _flavor=samsung-i9100
  18. _hash="349a3e91e76d17e67ef6213e1f6712e700695631"
  19. _config="config-${_flavor}.armhf"
  20. pkgname=linux-${_flavor}
  21. pkgver=3.0.101
  22. case $pkgver in
  23. *.*.*) _kernver=${pkgver%.*};;
  24. *.*) _kernver=$pkgver;;
  25. esac
  26. pkgrel=10
  27. arch="armhf"
  28. pkgdesc="Samsung Galaxy SII kernel from LineageOS"
  29. url="https://github.com/LineageOS/android_kernel_samsung_smdk4412"
  30. depends="postmarketos-mkinitfs"
  31. makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev
  32. findutils busybox-static-armhf"
  33. options="!strip !check !tracedeps"
  34. install=
  35. source="
  36. $pkgname-$_hash.tar.gz::https://github.com/LineageOS/android_kernel_samsung_smdk4412/archive/${_hash}.tar.gz
  37. $_config
  38. compiler-gcc6.h
  39. init
  40. "
  41. subpackages=""
  42. license="GPL2"
  43. _abi_release=${pkgver}
  44. _carch="arm"
  45. HOSTCC="${CC:-gcc}"
  46. HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
  47. ksrcdir="$srcdir/android_kernel_samsung_smdk4412-${_hash}"
  48. prepare() {
  49. local _patch_failed=
  50. cd "$ksrcdir"
  51. # first apply patches in specified order
  52. for i in $source; do
  53. case $i in
  54. *.patch)
  55. msg "Applying $i..."
  56. if ! patch -s -p1 -N -i "$srcdir"/$i; then
  57. echo $i >>failed
  58. _patch_failed=1
  59. fi
  60. ;;
  61. esac
  62. done
  63. if ! [ -z "$_patch_failed" ]; then
  64. error "The following patches failed:"
  65. cat failed
  66. return 1
  67. fi
  68. # Use Alpine's busybox.static instead of the pre-compiled busybox shipped
  69. # with the source
  70. cp -v /usr/$(arch_to_hostspec $arch)/bin/busybox.static \
  71. "$ksrcdir"/usr/galaxys2_initramfs_files/busybox
  72. # do not use ramdisk.cpio and ramdisk-recovery-device.cpio, always use
  73. # the initramfs from the recovery partition ("isorec"), so we can build
  74. # it later and independently from the kernel. also directly boot that
  75. # partition, not only when the recovery key combination was used.
  76. cd "$ksrcdir"/usr/
  77. mv galaxys2_initramfs.list galaxys2_initramfs.list_old
  78. grep -v "../../ramdisk" galaxys2_initramfs.list_old > galaxys2_initramfs.list
  79. cp -v "$srcdir"/init "$ksrcdir"/usr/galaxys2_initramfs_files/init
  80. # gcc6 support
  81. cp -v "$srcdir/compiler-gcc6.h" "$ksrcdir/include/linux/"
  82. mkdir -p "$srcdir"/build
  83. cp "$srcdir"/$_config "$srcdir"/build/.config
  84. make -C "$ksrcdir" O="$srcdir"/build ARCH="$_carch" HOSTCC="$HOSTCC" \
  85. silentoldconfig
  86. }
  87. # this is so we can do: 'abuild menuconfig' to reconfigure kernel
  88. menuconfig() {
  89. cd "$srcdir"/build
  90. make ARCH="$_carch" menuconfig
  91. cp .config "$startdir"/$_config
  92. }
  93. build() {
  94. cd "$srcdir"/build
  95. unset LDFLAGS
  96. make ARCH="$_carch" CC="${CC:-gcc}" \
  97. KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-Alpine"
  98. }
  99. package() {
  100. install -Dm644 "$srcdir/build/arch/arm/boot/zImage" \
  101. "$pkgdir/boot/vmlinuz-$_flavor"
  102. install -D "$srcdir/build/include/config/kernel.release" \
  103. "$pkgdir/usr/share/kernel/$_flavor/kernel.release"
  104. }
  105. sha512sums="285ffd2c82d0444b99da583573d19443b73de22d7382aae54413af229a28bebf4ea32ecbe248ae54ae64bbbc0af7d722b1ef86d5dd099e2990dcc6284fb195fa linux-samsung-i9100-349a3e91e76d17e67ef6213e1f6712e700695631.tar.gz
  106. 087372ce82f8eae44694d7c6288822e5565c6bbed3a07cb42a6b009fa25a84a16ec44d76fe5f504bcf945e28237e1d62cf3686d1a60126525e3fdea2613cbb3c config-samsung-i9100.armhf
  107. d80980e9474c82ba0ef1a6903b434d8bd1b092c40367ba543e72d2c119301c8b2d05265740e4104ca1ac5d15f6c4aa49e8776cb44264a9a28dc551e0d1850dcc compiler-gcc6.h
  108. dd4094d5f4ec281d32f12af88cb22a782e497c8e52f69cf60b73ac7d6171fc95f1f8040b3d0ad2ff3f016d22ac1d91c5b522e5d03203534a76742bc55a082af5 init"