]> code.ossystems Code Review - meta-freescale.git/commitdiff
linux-imx-headers: Refactor recipe
authorOtavio Salvador <otavio@ossystems.com.br>
Thu, 25 Oct 2018 12:36:50 +0000 (09:36 -0300)
committerOtavio Salvador <otavio@ossystems.com.br>
Fri, 26 Oct 2018 17:23:37 +0000 (14:23 -0300)
This builds on top of original recipe provided by Tom and do minor
style and simplicity rework.

- Add minor comments on the recipe for why it is doing each specific
  step
- Add ALLOW_EMPTY for PN so it can be installed with SDK
- Fix minor code style issues

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
recipes-kernel/linux/linux-imx-headers_4.9.123.bb

index 3a5e87e8281e9c7c99627898fcebeff6217a438c..7be9cf94eb203ecdcc4be016de653fb46c4edf65 100644 (file)
@@ -12,6 +12,7 @@ LOCALVERSION = "-${SRCBRANCH}"
 SRC_URI = "git://source.codeaurora.org/external/imx/linux-imx.git;protocol=https;branch=${SRCBRANCH} \
     file://0001-uapi-Install-custom-headers.patch"
 SRCREV = "6a71cbc089755afd6a86c005c22a1af6eab24a70"
+
 S = "${WORKDIR}/git"
 
 do_compile[noexec] = "1"
@@ -36,14 +37,21 @@ IMX_UAPI_HEADERS = " \
 "
 
 do_install() {
+    # We install all headers inside of B so we can copy only the
+    # whitelisted ones, and there is no risk of a new header to be
+    # installed by mistake.
     oe_runmake headers_install INSTALL_HDR_PATH=${B}${exec_prefix}
+
+    # FIXME: The ion.h is still on staging so "promote" it for now
     cp ${S}/drivers/staging/android/uapi/ion.h ${B}${includedir}/linux
-    src=${B}${includedir}/linux
-    dest=${D}${includedir}/imx/linux
-    install -d $dest
-    cd $src
-    install -m 0644 ${IMX_UAPI_HEADERS} $dest
-    cd -
+
+    # Install whitelisted headers only
+    for h in ${IMX_UAPI_HEADERS}; do
+        install -D -m 0644 ${B}${includedir}/linux/$h \
+                          ${D}${includedir}/imx/linux/$h
+    done
 }
 
+ALLOW_EMPTY_${PN} = "1"
+
 PACKAGE_ARCH = "${MACHINE_SOCARCH}"