Skip to contentSkip to conversation

kernel-devsrc: add 'make scripts' postinstall

PATCH In review Ming Liu 2 participants 4 messages Nov 23, 2015 – Nov 24, 2015

lore
Share & tools
lore

Ming Liu

author
#0 lore raw

PATCH 1/1 kernel-devsrc: add 'make scripts' postinstall

From: Ming Liu <[email protected]>

Run 'make scripts' inside qemu in order to create script binaries that needed by external modules build on the target.

Add RDEPENDS on gcc, make, which are needed by the compilation.

[YOCTO #6630]

---
 meta/recipes-kernel/linux/kernel-devsrc.bb | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
meta/recipes-kernel/linux/kernel-devsrc.bb +12 -2
index 196c8c7..87826ad 100644
@@ -11,7 +11,7 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425
 inherit linux-kernel-base
 
 # Whilst not a module, this ensures we don't get multilib extended (which would make no sense)
-inherit module-base
+inherit module-base qemu
 
 # We need the kernel to be staged (unpacked, patched and configured) before
 # we can grab the source and make the source package. We also need the bits from
@@ -71,6 +71,16 @@ do_install() {
 # Ensure we don't race against "make scripts" during cpio
 do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
 
+pkg_postinst_${PN} () {
+	if [ -n "$D" ]; then
+		${@qemu_run_binary(d, '$D', '${bindir}/make')} \
+			-C $D${KERNEL_SRC_PATH} O=$D${KERNEL_SRC_PATH} scripts
+	else
+		make -C ${KERNEL_SRC_PATH} O=${KERNEL_SRC_PATH} scripts
+	fi
+}
+
 PACKAGES = "kernel-devsrc"
 FILES_${PN} = "${KERNEL_SRC_PATH}"
-RDEPENDS_${PN} = "bc"
+DEPENDS = "qemu-native"
+RDEPENDS_${PN} = "bc gcc make"
Signature · 1 line
1.9.1
#1 lore raw
Quoted 6 lines · Ming Liu

From: Ming Liu <[email protected]>

Run 'make scripts' inside qemu in order to create script binaries that needed by external modules build on the target.

Add RDEPENDS on gcc, make, which are needed by the compilation.

This version looks fine to me .. and by "fine", I mean that it probably is still less than ideal, but with our current packaging and separation it makes sense to make it work, with all dependencies being explicit.

As we (re)slim down the devsrc/headers split, we can revisit this as necessary.

One question below though ..

Quoted 13 lines

[YOCTO #6630]

---
  meta/recipes-kernel/linux/kernel-devsrc.bb | 14 ++++++++++++--
  1 file changed, 12 insertions(+), 2 deletions(-)
meta/recipes-kernel/linux/kernel-devsrc.bb +0 -0
index 196c8c7..87826ad 100644

meta/recipes-kernel/linux/kernel-devsrc.bb LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425 · line 14

Quoted 5 lines
meta/recipes-kernel/linux/kernel-devsrc.bb +1 -1
@@ -11,7 +11,7 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425
  inherit linux-kernel-base
 
  # Whilst not a module, this ensures we don't get multilib extended (which would make no sense)
-inherit module-base
+inherit module-base qemu

Shouldn't this be qemu-native ? Since it is running on the host ? Or maybe I'm completely misunderstanding something :)

Bruce

Quoted 22 lines
meta/recipes-kernel/linux/kernel-devsrc.bb +11 -1
  # We need the kernel to be staged (unpacked, patched and configured) before
  # we can grab the source and make the source package. We also need the bits from
@@ -71,6 +71,16 @@ do_install() {
  # Ensure we don't race against "make scripts" during cpio
  do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
 
+pkg_postinst_${PN} () {
+	if [ -n "$D" ]; then
+		${@qemu_run_binary(d, '$D', '${bindir}/make')} \
+			-C $D${KERNEL_SRC_PATH} O=$D${KERNEL_SRC_PATH} scripts
+	else
+		make -C ${KERNEL_SRC_PATH} O=${KERNEL_SRC_PATH} scripts
+	fi
+}
+
  PACKAGES = "kernel-devsrc"
  FILES_${PN} = "${KERNEL_SRC_PATH}"
-RDEPENDS_${PN} = "bc"
+DEPENDS = "qemu-native"
+RDEPENDS_${PN} = "bc gcc make"
author
#2 lore raw
Quoted 33 lines · Bruce Ashfield
Quoted 6 lines · Ming Liu

From: Ming Liu <[email protected]>

Run 'make scripts' inside qemu in order to create script binaries that needed by external modules build on the target.

Add RDEPENDS on gcc, make, which are needed by the compilation.

This version looks fine to me .. and by "fine", I mean that it probably is still less than ideal, but with our current packaging and separation it makes sense to make it work, with all dependencies being explicit.

As we (re)slim down the devsrc/headers split, we can revisit this as necessary.

One question below though ..

Quoted 16 lines

[YOCTO #6630]

---
  meta/recipes-kernel/linux/kernel-devsrc.bb | 14 ++++++++++++--
  1 file changed, 12 insertions(+), 2 deletions(-)
meta/recipes-kernel/linux/kernel-devsrc.bb +0 -0
index 196c8c7..87826ad 100644
@@ -11,7 +11,7 @@ LIC_FILES_CHKSUM = 

"file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425
inherit linux-kernel-base

Quoted 7 lines

meta/recipes-kernel/linux/kernel-devsrc.bb LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425 · line 14

Quoted 4 lines

# Whilst not a module, this ensures we don't get multilib extended
(which would make no sense)

meta/recipes-kernel/linux/kernel-devsrc.bb +1 -1
-inherit module-base
+inherit module-base qemu

Shouldn't this be qemu-native ? Since it is running on the host ? Or maybe I'm completely misunderstanding something :)

Indeed it is calling qemu-native when inheriting this class, to make a certain postinstall scriptlet run at do_rootfs time through a architecture dependent qemu. I am not sure if I had answered your question, maybe you mean the name is not proper? qemu-native.bbclass would make more sense?

//Ming Liu

Quoted 28 lines

Bruce

Quoted 24 lines

# We need the kernel to be staged (unpacked, patched and
configured) before

  # we can grab the source and make the source package. We also need 
the bits from
meta/recipes-kernel/linux/kernel-devsrc.bb +11 -1
@@ -71,6 +71,16 @@ do_install() {
  # Ensure we don't race against "make scripts" during cpio
  do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
 
+pkg_postinst_${PN} () {
+    if [ -n "$D" ]; then
+        ${@qemu_run_binary(d, '$D', '${bindir}/make')} \
+            -C $D${KERNEL_SRC_PATH} O=$D${KERNEL_SRC_PATH} scripts
+    else
+        make -C ${KERNEL_SRC_PATH} O=${KERNEL_SRC_PATH} scripts
+    fi
+}
+
  PACKAGES = "kernel-devsrc"
  FILES_${PN} = "${KERNEL_SRC_PATH}"
-RDEPENDS_${PN} = "bc"
+DEPENDS = "qemu-native"
+RDEPENDS_${PN} = "bc gcc make"
#3 lore raw
Quoted 37 lines · Ming Liu
Quoted 34 lines · Bruce Ashfield
Quoted 6 lines · Ming Liu

From: Ming Liu <[email protected]>

Run 'make scripts' inside qemu in order to create script binaries that needed by external modules build on the target.

Add RDEPENDS on gcc, make, which are needed by the compilation.

This version looks fine to me .. and by "fine", I mean that it probably is still less than ideal, but with our current packaging and separation it makes sense to make it work, with all dependencies being explicit.

As we (re)slim down the devsrc/headers split, we can revisit this as necessary.

One question below though ..

Quoted 17 lines

[YOCTO #6630]

---
  meta/recipes-kernel/linux/kernel-devsrc.bb | 14 ++++++++++++--
  1 file changed, 12 insertions(+), 2 deletions(-)
meta/recipes-kernel/linux/kernel-devsrc.bb +0 -0
index 196c8c7..87826ad 100644
@@ -11,7 +11,7 @@ LIC_FILES_CHKSUM =

"file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425
inherit linux-kernel-base

Quoted 8 lines
Quoted 7 lines

meta/recipes-kernel/linux/kernel-devsrc.bb LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425 · line 14

Quoted 4 lines

# Whilst not a module, this ensures we don't get multilib extended
(which would make no sense)

meta/recipes-kernel/linux/kernel-devsrc.bb +1 -1
-inherit module-base
+inherit module-base qemu

Shouldn't this be qemu-native ? Since it is running on the host ? Or maybe I'm completely misunderstanding something :)

Indeed it is calling qemu-native when inheriting this class, to make a

That is probably my misunderstanding .. I didn't go look at the inherit, and I read this more as a RDEPENDS, which would be qemu for the target.

Quoted 4 lines

certain postinstall scriptlet run at do_rootfs time through a architecture dependent qemu.
I am not sure if I had answered your question, maybe you mean the name is not proper? qemu-native.bbclass would make more sense?

I think you have. If the class is called qemu .. then that's what you should use.

Bruce

Quoted 31 lines

//Ming Liu

Quoted 28 lines

Bruce

Quoted 24 lines

# We need the kernel to be staged (unpacked, patched and
configured) before

  # we can grab the source and make the source package. We also need
the bits from
meta/recipes-kernel/linux/kernel-devsrc.bb +11 -1
@@ -71,6 +71,16 @@ do_install() {
  # Ensure we don't race against "make scripts" during cpio
  do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
 
+pkg_postinst_${PN} () {
+    if [ -n "$D" ]; then
+        ${@qemu_run_binary(d, '$D', '${bindir}/make')} \
+            -C $D${KERNEL_SRC_PATH} O=$D${KERNEL_SRC_PATH} scripts
+    else
+        make -C ${KERNEL_SRC_PATH} O=${KERNEL_SRC_PATH} scripts
+    fi
+}
+
  PACKAGES = "kernel-devsrc"
  FILES_${PN} = "${KERNEL_SRC_PATH}"
-RDEPENDS_${PN} = "bc"
+DEPENDS = "qemu-native"
+RDEPENDS_${PN} = "bc gcc make"