Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Sanitized set of kernel headers for the C library's use" |
| 2 | SECTION = "devel" |
| 3 | LICENSE = "GPLv2" |
| 4 | |
| 5 | ######################################################################### |
| 6 | #### PLEASE READ |
| 7 | ######################################################################### |
| 8 | # |
| 9 | # You're probably looking here thinking you need to create some new copy |
| 10 | # of linux-libc-headers since you have your own custom kernel. To put |
| 11 | # this simply, you DO NOT. |
| 12 | # |
| 13 | # Why? These headers are used to build the libc. If you customise the |
| 14 | # headers you are customising the libc and the libc becomes machine |
| 15 | # specific. Most people do not add custom libc extensions to the kernel |
| 16 | # and have a machine specific libc. |
| 17 | # |
| 18 | # But you have some kernel headers you need for some driver? That is fine |
| 19 | # but get them from STAGING_KERNEL_DIR where the kernel installs itself. |
| 20 | # This will make the package using them machine specific but this is much |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 21 | # better than having a machine specific C library. This does mean your |
| 22 | # recipe needs a |
| 23 | # do_configure[depends] += "virtual/kernel:do_shared_workdir" |
| 24 | # but again, that is fine and makes total sense. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 25 | # |
| 26 | # There can also be a case where your kernel extremely old and you want |
| 27 | # an older libc ABI for that old kernel. The headers installed by this |
| 28 | # recipe should still be a standard mainline kernel, not your own custom |
| 29 | # one. |
| 30 | # |
| 31 | # -- RP |
| 32 | |
| 33 | LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" |
| 34 | |
| 35 | python __anonymous () { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 36 | major = d.getVar("PV").split('.')[0] |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 37 | if major == "3": |
| 38 | d.setVar("HEADER_FETCH_VER", "3.0") |
| 39 | elif major == "4": |
| 40 | d.setVar("HEADER_FETCH_VER", "4.x") |
| 41 | else: |
| 42 | d.setVar("HEADER_FETCH_VER", "2.6") |
| 43 | } |
| 44 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 45 | inherit kernel-arch pkgconfig multilib_header |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 46 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 47 | KORG_ARCHIVE_COMPRESSION ?= "xz" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 48 | |
| 49 | SRC_URI = "${KERNELORG_MIRROR}/linux/kernel/v${HEADER_FETCH_VER}/linux-${PV}.tar.${KORG_ARCHIVE_COMPRESSION}" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 50 | UPSTREAM_CHECK_URI = "https://www.kernel.org/" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 51 | |
| 52 | S = "${WORKDIR}/linux-${PV}" |
| 53 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 54 | EXTRA_OEMAKE = " HOSTCC="${BUILD_CC}" HOSTCPP="${BUILD_CPP}"" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 55 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 56 | do_configure() { |
| 57 | oe_runmake allnoconfig |
| 58 | } |
| 59 | |
| 60 | do_compile () { |
| 61 | } |
| 62 | |
| 63 | do_install() { |
| 64 | oe_runmake headers_install INSTALL_HDR_PATH=${D}${exec_prefix} |
| 65 | # Kernel should not be exporting this header |
| 66 | rm -f ${D}${exec_prefix}/include/scsi/scsi.h |
| 67 | |
| 68 | # The ..install.cmd conflicts between various configure runs |
| 69 | find ${D}${includedir} -name ..install.cmd | xargs rm -f |
| 70 | } |
| 71 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 72 | do_install_append_aarch64 () { |
| 73 | do_install_armmultilib |
| 74 | } |
| 75 | |
| 76 | do_install_append_arm () { |
| 77 | do_install_armmultilib |
| 78 | } |
| 79 | |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 80 | do_install_append_armeb () { |
| 81 | do_install_armmultilib |
| 82 | } |
| 83 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 84 | do_install_armmultilib () { |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 85 | oe_multilib_header asm/auxvec.h asm/bitsperlong.h asm/byteorder.h asm/fcntl.h asm/hwcap.h asm/ioctls.h asm/kvm.h asm/kvm_para.h asm/mman.h asm/param.h asm/perf_regs.h asm/bpf_perf_event.h |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 86 | oe_multilib_header asm/posix_types.h asm/ptrace.h asm/setup.h asm/sigcontext.h asm/siginfo.h asm/signal.h asm/stat.h asm/statfs.h asm/swab.h asm/types.h asm/unistd.h |
| 87 | } |
| 88 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 89 | BBCLASSEXTEND = "nativesdk" |
| 90 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 91 | RDEPENDS_${PN}-dev = "" |
| 92 | RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})" |
| 93 | |
| 94 | INHIBIT_DEFAULT_DEPS = "1" |
| 95 | DEPENDS += "unifdef-native" |