Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] kernel.bbclass: Fix empty modules directory QA issue
@ 2014-01-13  8:33 Nathan Rossi
  2014-01-13  8:45 ` Robert Yang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nathan Rossi @ 2014-01-13  8:33 UTC (permalink / raw)
  To: openembedded-core

If a kernel is built without any external modules (aka no CONFIG_*=m),
then during a modules_install of the kernel an empty directory is
created at /lib/modules/${KERNEL_VERIONS}/kernel. This is behaviour of
the kernel infrastructure, the directory would normally be populated
with the modules that were built.

However because of the expectations of kernel-modules-split, no packages
are created when there are no modules and an empty directory lingers.
This raises QA issues as warning or errors (depending on the distro).

The following patch changes the kernel_do_install task to check if the
directory is empty and if so removes it.

Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
---
 meta/classes/kernel.bbclass |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 5fef446..6b4e992 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -183,6 +183,10 @@ kernel_do_install() {
 		oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" modules_install
 		rm "${D}/lib/modules/${KERNEL_VERSION}/build"
 		rm "${D}/lib/modules/${KERNEL_VERSION}/source"
+		# If the kernel/ directory is empty remove it to prevent QA issues
+		if [ ! "$(ls -A "${D}/lib/modules/${KERNEL_VERSION}/kernel")" ]; then
+			rm -r "${D}/lib/modules/${KERNEL_VERSION}/kernel"
+		fi
 	else
 		bbnote "no modules to install"
 	fi
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] kernel.bbclass: Fix empty modules directory QA issue
  2014-01-13  8:33 [PATCH] kernel.bbclass: Fix empty modules directory QA issue Nathan Rossi
@ 2014-01-13  8:45 ` Robert Yang
  2014-01-14  1:21 ` [PATCH v2] " Nathan Rossi
       [not found] ` <1389662460-29515-1-git-send-email-nathan.rossi@xilinx.com>
  2 siblings, 0 replies; 4+ messages in thread
From: Robert Yang @ 2014-01-13  8:45 UTC (permalink / raw)
  To: Nathan Rossi, openembedded-core



On 01/13/2014 04:33 PM, Nathan Rossi wrote:
> If a kernel is built without any external modules (aka no CONFIG_*=m),
> then during a modules_install of the kernel an empty directory is
> created at /lib/modules/${KERNEL_VERIONS}/kernel. This is behaviour of
> the kernel infrastructure, the directory would normally be populated
> with the modules that were built.
>
> However because of the expectations of kernel-modules-split, no packages
> are created when there are no modules and an empty directory lingers.
> This raises QA issues as warning or errors (depending on the distro).
>
> The following patch changes the kernel_do_install task to check if the
> directory is empty and if so removes it.
>
> Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
> ---
>   meta/classes/kernel.bbclass |    4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index 5fef446..6b4e992 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -183,6 +183,10 @@ kernel_do_install() {
>   		oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" modules_install
>   		rm "${D}/lib/modules/${KERNEL_VERSION}/build"
>   		rm "${D}/lib/modules/${KERNEL_VERSION}/source"
> +		# If the kernel/ directory is empty remove it to prevent QA issues

How about:

rmdir --ignore-fail-on-non-empty ${D}/lib/modules/${KERNEL_VERSION}/kernel

// Robert

> +		if [ ! "$(ls -A "${D}/lib/modules/${KERNEL_VERSION}/kernel")" ]; then
> +			rm -r "${D}/lib/modules/${KERNEL_VERSION}/kernel"
> +		fi
>   	else
>   		bbnote "no modules to install"
>   	fi
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] kernel.bbclass: Fix empty modules directory QA issue
  2014-01-13  8:33 [PATCH] kernel.bbclass: Fix empty modules directory QA issue Nathan Rossi
  2014-01-13  8:45 ` Robert Yang
@ 2014-01-14  1:21 ` Nathan Rossi
       [not found] ` <1389662460-29515-1-git-send-email-nathan.rossi@xilinx.com>
  2 siblings, 0 replies; 4+ messages in thread
From: Nathan Rossi @ 2014-01-14  1:21 UTC (permalink / raw)
  To: openembedded-core

If a kernel is built without any external modules (aka no CONFIG_*=m),
then during a modules_install of the kernel an empty directory is
created at /lib/modules/${KERNEL_VERIONS}/kernel. This is behaviour of
the kernel infrastructure, the directory would normally be populated
with the modules that were built.

However because of the expectations of kernel-modules-split, no packages
are created when there are no modules and an empty directory lingers.
This raises QA issues as warning or errors (depending on the distro).

The following patch changes the kernel_do_install task to check if the
directory is empty and if so removes it.

Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
---
 meta/classes/kernel.bbclass |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 5fef446..f4dcba5 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -183,6 +183,8 @@ kernel_do_install() {
 		oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" modules_install
 		rm "${D}/lib/modules/${KERNEL_VERSION}/build"
 		rm "${D}/lib/modules/${KERNEL_VERSION}/source"
+		# If the kernel/ directory is empty remove it to prevent QA issues
+		rmdir --ignore-fail-on-non-empty "${D}/lib/modules/${KERNEL_VERSION}/kernel"
 	else
 		bbnote "no modules to install"
 	fi
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] kernel.bbclass: Fix empty modules directory QA issue
       [not found] ` <1389662460-29515-1-git-send-email-nathan.rossi@xilinx.com>
@ 2014-01-28  1:19   ` Nathan Rossi
  0 siblings, 0 replies; 4+ messages in thread
From: Nathan Rossi @ 2014-01-28  1:19 UTC (permalink / raw)
  To: openembedded-core@lists.openembedded.org

> -----Original Message-----
> From: Nathan Rossi [mailto:nathan.rossi@xilinx.com]
> Sent: Tuesday, January 14, 2014 11:21 AM
> To: openembedded-core@lists.openembedded.org
> Cc: Nathan Rossi; Robert Yang
> Subject: [PATCH v2] kernel.bbclass: Fix empty modules directory QA issue
>
> If a kernel is built without any external modules (aka no CONFIG_*=m),
> then during a modules_install of the kernel an empty directory is
> created at /lib/modules/${KERNEL_VERIONS}/kernel. This is behaviour of
> the kernel infrastructure, the directory would normally be populated
> with the modules that were built.
>
> However because of the expectations of kernel-modules-split, no packages
> are created when there are no modules and an empty directory lingers.
> This raises QA issues as warning or errors (depending on the distro).
>
> The following patch changes the kernel_do_install task to check if the
> directory is empty and if so removes it.
>
> Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
> ---
>  meta/classes/kernel.bbclass |    2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index 5fef446..f4dcba5 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -183,6 +183,8 @@ kernel_do_install() {
>               oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" modules_install
>               rm "${D}/lib/modules/${KERNEL_VERSION}/build"
>               rm "${D}/lib/modules/${KERNEL_VERSION}/source"
> +             # If the kernel/ directory is empty remove it to prevent QA
> issues
> +             rmdir --ignore-fail-on-non-empty
> "${D}/lib/modules/${KERNEL_VERSION}/kernel"
>       else
>               bbnote "no modules to install"
>       fi
> --
> 1.7.9.5
>

Ping, any additional concerns with this patch?

Regards,
Nathan


This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-01-28  1:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-13  8:33 [PATCH] kernel.bbclass: Fix empty modules directory QA issue Nathan Rossi
2014-01-13  8:45 ` Robert Yang
2014-01-14  1:21 ` [PATCH v2] " Nathan Rossi
     [not found] ` <1389662460-29515-1-git-send-email-nathan.rossi@xilinx.com>
2014-01-28  1:19   ` Nathan Rossi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox