Skip to contentSkip to conversation

fix WARNING: QA Issue on kmod/udev/nfs-utils (unsafe references [/ references to /usr/lib])

PATCH In review Hongxu Jia 4 participants 11 messages Nov 4, 2013 – Nov 9, 2013

lore
Share & tools
lore

Hongxu Jia

author
#0 lore raw

v2 cover fix WARNING: QA Issue on kmod/udev/nfs-utils (unsafe references [/ references to /usr/lib])

Change in V2: The fourth patch fixed the QA Issue on udev, it was missed on previous version.

//Hongxu

The following changes since commit f3541226b8b1187e79dec0f6f9f3c58cedf9ac9b:

bitbake: hob: do not display the "Package list may be incomplete!" dialog (2013-11-01 17:59:31 +0000)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib hongxu/fix-qa-issue
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/fix-qa-issue

Hongxu Jia (5):
insane.bbclass: support to skip unsafe references in binaries qa
check.
kmod: fix QA issue
udev: fix QA issue
udev: fix QA issue
nfs-utils: fix QA issue

 meta/classes/insane.bbclass                        |  4 ++++
 ...et-sbindir-can-be-overridden-at-config-ti.patch | 24 ++++++++++++++++++++++
 .../nfs-utils/nfs-utils_1.2.8.bb                   |  1 +
 meta/recipes-core/udev/udev.inc                    |  4 ++--
 meta/recipes-kernel/kmod/kmod_git.bb               |  1 +
 5 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/osd_login-let-sbindir-can-be-overridden-at-config-ti.patch
Signature · 1 line
1.8.1.2
author
#1 lore raw

PATCH v2 1/5 insane.bbclass: support to skip unsafe references in binaries qa check.

Add a variable to support skipping the unsafe references in binaries qa check.

[YOCTO #5142]

---
 meta/classes/insane.bbclass | 4 ++++
 1 file changed, 4 insertions(+)
meta/classes/insane.bbclass +4 -0
index eb440c2..20bbab0 100644
@@ -318,6 +318,10 @@ def package_qa_check_unsafe_references_in_binaries(path, name, d, elf, messages)
 	if elf:
 		import subprocess as sub
 		pn = d.getVar('PN', True)
+		# Skip for any packages with unsafe-ref-bin in INSANE_SKIP
+		if 'unsafe-ref-bin' in (d.getVar('INSANE_SKIP_' + pn, True) or "").split():
+			bb.note("Package %s skipping unsafe references in binaries QA test" % (pn))
+			return
 
 		exec_prefix = d.getVar('exec_prefix', True)
 		sysroot_path = d.getVar('STAGING_DIR_TARGET', True)
Signature · 1 line
1.8.1.2
author
#2 lore raw

PATCH v2 2/5 kmod: fix QA issue

In reply to Hongxu Jia

The commit 7163ebd92a799b8f000b2b6f303b20de468b5f90 Revert "kmod: Use base_libdir for installing libkmod"

It caused a QA Issue WARNING:
...
WARNING: QA Issue: kmod: /bin/kmod, installed in the base_prefix, requires a shared library under exec_prefix (/usr): libkmod.so.2 => /usr/lib64/libkmod.so.2 (0x00000000dead1000)
...

But we did this reasonably, we should skip the qa check explicitly.

[YOCTO #5142]

---
 meta/recipes-kernel/kmod/kmod_git.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-kernel/kmod/kmod_git.bb +1 -0
index f90b9aa..b370016 100644
@@ -15,6 +15,7 @@ RCONFLICTS_libkmod2 += "module-init-tools-insmod-static module-init-tools-depmod
 bindir = "${base_bindir}"
 sbindir = "${base_sbindir}"
 # libdir = "${base_libdir}"
+INSANE_SKIP_${PN} = "unsafe-ref-bin"
 
 do_install_append () {
         install -dm755 ${D}${base_bindir}
Signature · 1 line
1.8.1.2
author
#3 lore raw

PATCH v2 3/5 udev: fix QA issue

In reply to Hongxu Jia

...
WARNING: QA Issue: udev: /lib/libgudev-1.0.so.0.1.1, installed in the base_prefix, requires a shared library under exec_prefix (/usr): libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0xdead3000)
WARNING: QA Issue: udev: /lib/libgudev-1.0.so.0.1.1, installed in the base_prefix, requires a shared library under exec_prefix (/usr): libffi.so.6 => /usr/lib/libffi.so.6 (0xdead4000)
WARNING: QA Issue: udev: /lib/libgudev-1.0.so.0.1.1, installed in the base_prefix, requires a shared library under exec_prefix (/usr): libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xdead5000)
...

Install libgudev-1.0.so.0.1.1 in ${libdir} rather than ${base_libdir} fixed this issue.

[YOCTO #5142]

---
 meta/recipes-core/udev/udev.inc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
meta/recipes-core/udev/udev.inc +1 -2
index 2ff8f00..2f883a0 100644
@@ -32,14 +32,13 @@ inherit autotools pkgconfig update-rc.d
 
 libexecdir = "${base_libdir}"
 EXTRA_OECONF = "--disable-introspection \
-                --with-rootlibdir=${base_libdir} \
+                --with-rootlibdir=${libdir} \
                 --with-pci-ids-path=${datadir}/pci.ids \
                 ac_cv_file__usr_share_pci_ids=no \
                 ac_cv_file__usr_share_hwdata_pci_ids=no \
                 ac_cv_file__usr_share_misc_pci_ids=yes \
                 --sbindir=${base_sbindir} \
                 --libexecdir=${nonarch_base_libdir} \
-                --with-rootlibdir=${base_libdir} \
                 --with-rootprefix= \
                 --without-systemdsystemunitdir \
                "
Signature · 1 line
1.8.1.2
author
#4 lore raw

PATCH v2 4/5 udev: fix QA issue

In reply to Hongxu Jia

The commit 7163ebd92a799b8f000b2b6f303b20de468b5f90 Revert "kmod: Use base_libdir for installing libkmod"

It caused a QA Issue WARNING:
...
WARNING: QA Issue: udev: /lib/udev/udevd, installed in the base_prefix, requires a shared library under exec_prefix (/usr): libkmod.so.2 => /usr/lib/libkmod.so.2 (0xdead3000)
...

But we did this reasonably, we should skip the qa check explicitly.

[YOCTO #5142]

---
 meta/recipes-core/udev/udev.inc | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-core/udev/udev.inc +1 -0
index 2f883a0..92a11e0 100644
@@ -30,6 +30,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \
 
 inherit autotools pkgconfig update-rc.d
 
+INSANE_SKIP_${PN} = "unsafe-ref-bin"
 libexecdir = "${base_libdir}"
 EXTRA_OECONF = "--disable-introspection \
                 --with-rootlibdir=${libdir} \
Signature · 1 line
1.8.1.2
author
#5 lore raw

PATCH v2 5/5 nfs-utils: fix QA issue

In reply to Hongxu Jia

...
WARNING: QA Issue: nfs-utils: Found a reference to /usr/ in /home/jiahongxu/yocto/build-20131025-gcc5/bitbake_build/tmp/work/x86_64-wrs-linux/nfs-utils/1.2.8-r1/packages-split/nfs-utils/sbin/osd_login
WARNING: QA Issue: Shell scripts in base_bindir and base_sbindir should not reference anything in exec_prefix
...

Install osd_login in ${sbindir} rather than ${base_sbindir} fixed this issue

[YOCTO #5142]

---
 ...et-sbindir-can-be-overridden-at-config-ti.patch | 24 ++++++++++++++++++++++
 .../nfs-utils/nfs-utils_1.2.8.bb                   |  1 +
 2 files changed, 25 insertions(+)
 create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/osd_login-let-sbindir-can-be-overridden-at-config-ti.patch
meta/recipes-connectivity/nfs-utils/nfs-utils/osd_login-let-sbindir-can-be-overridden-at-config-ti.patch new file +24 -0
new file mode 100644
index 0000000..ffa5b2f
@@ -0,0 +1,24 @@
+osd_login: let sbindir can be overridden at config time
+
+Signed-off-by: Hongxu Jia <[email protected]>
+Upstream-Status: Pending
+---
+ utils/osd_login/Makefile.am | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/utils/osd_login/Makefile.am b/utils/osd_login/Makefile.am
+--- a/utils/osd_login/Makefile.am
++++ b/utils/osd_login/Makefile.am
+@@ -1,9 +1,5 @@
+ ## Process this file with automake to produce Makefile.in
+ 
+-# These binaries go in /sbin (not /usr/sbin), and that cannot be
+-# overridden at config time.
+-sbindir = /sbin
+-
+ sbin_SCRIPTS = osd_login
+ 
+ MAINTAINERCLEANFILES = Makefile.in
+-- 
+1.8.1.2
+
meta/recipes-connectivity/nfs-utils/nfs-utils_1.2.8.bb +1 -0
index e3e8136..84dd623 100644
@@ -15,6 +15,7 @@ RRECOMMENDS_${PN} = "kernel-module-nfsd"
 SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.bz2 \
            file://nfs-utils-1.0.6-uclibc.patch \
            file://nfs-utils-1.2.3-sm-notify-res_init.patch \
+           file://osd_login-let-sbindir-can-be-overridden-at-config-ti.patch \
            file://nfsserver \
            file://nfs-utils.conf \
            file://nfs-server.service \
Signature · 1 line
1.8.1.2
#6 lore raw
In reply to Hongxu Jia
Quoted 13 lines · Hongxu Jia

Change in V2: The fourth patch fixed the QA Issue on udev, it was missed on previous version.

//Hongxu

The following changes since commit f3541226b8b1187e79dec0f6f9f3c58cedf9ac9b:

bitbake: hob: do not display the "Package list may be incomplete!" dialog (2013-11-01 17:59:31 +0000)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib hongxu/fix-qa-issue
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/fix-qa-issue

Quoted 7 lines

Hongxu Jia (5):
insane.bbclass: support to skip unsafe references in binaries qa
check.
kmod: fix QA issue
udev: fix QA issue
udev: fix QA issue
nfs-utils: fix QA issue

Last time these warnings came up I asked for a clear plan about what needed to live in / and what needed to live in /usr and how we were going to fix things once and for all (or forget this idea).

Where is the plan? Why is it ok to just ignore these particular warnings?

Cheers,

Richard

#7 lore raw
Quoted 22 lines · Richard Purdie
Quoted 13 lines · Hongxu Jia

Change in V2: The fourth patch fixed the QA Issue on udev, it was missed on previous version.

//Hongxu

The following changes since commit f3541226b8b1187e79dec0f6f9f3c58cedf9ac9b:

bitbake: hob: do not display the "Package list may be incomplete!" dialog (2013-11-01 17:59:31 +0000)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib hongxu/fix-qa-issue
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/fix-qa-issue

Quoted 7 lines

Hongxu Jia (5):
insane.bbclass: support to skip unsafe references in binaries qa
check.
kmod: fix QA issue
udev: fix QA issue
udev: fix QA issue
nfs-utils: fix QA issue

Quoted 6 lines

Last time these warnings came up I asked for a clear plan about what needed to live in / and what needed to live in /usr and how we were going to fix things once and for all (or forget this idea).

Where is the plan? Why is it ok to just ignore these particular warnings?

I don't think supporting /bin and /sbin separated than /usr is worth the work.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
#8 lore raw
Quoted 24 lines · Otavio Salvador
Quoted 22 lines · Richard Purdie
Quoted 20 lines · Hongxu Jia

Change in V2: The fourth patch fixed the QA Issue on udev, it was missed on previous version.

//Hongxu

The following changes since commit f3541226b8b1187e79dec0f6f9f3c58cedf9ac9b:

bitbake: hob: do not display the "Package list may be incomplete!" dialog (2013-11-01 17:59:31 +0000)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib hongxu/fix-qa-issue
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/fix-qa-issue

Hongxu Jia (5):
insane.bbclass: support to skip unsafe references in binaries qa
check.
kmod: fix QA issue
udev: fix QA issue
udev: fix QA issue
nfs-utils: fix QA issue

Quoted 8 lines
Quoted 6 lines

Last time these warnings came up I asked for a clear plan about what needed to live in / and what needed to live in /usr and how we were going to fix things once and for all (or forget this idea).

Where is the plan? Why is it ok to just ignore these particular warnings?

I don't think supporting /bin and /sbin separated than /usr is worth the work.

I keep hearing that some people do need this. I'm not against it in principle, equally I do want to see a plan and/or complete patchset before we take more patches for it.

Cheers,

Richard

author
#9 lore raw
In reply to Richard Purdie
Quoted 21 lines · Richard Purdie
Quoted 13 lines · Hongxu Jia

Change in V2: The fourth patch fixed the QA Issue on udev, it was missed on previous version.

//Hongxu

The following changes since commit f3541226b8b1187e79dec0f6f9f3c58cedf9ac9b:

bitbake: hob: do not display the "Package list may be incomplete!" dialog (2013-11-01 17:59:31 +0000)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib hongxu/fix-qa-issue
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/fix-qa-issue

Quoted 7 lines

Hongxu Jia (5):
insane.bbclass: support to skip unsafe references in binaries qa
check.
kmod: fix QA issue
udev: fix QA issue
udev: fix QA issue
nfs-utils: fix QA issue

Quoted 6 lines

Last time these warnings came up I asked for a clear plan about what needed to live in / and what needed to live in /usr and how we were going to fix things once and for all (or forget this idea).

Where is the plan? Why is it ok to just ignore these particular warnings?

I am afraid there is no plan, let's drop this patch.

//Hongxu

Quoted 4 lines

Cheers,

Richard

#10 lore raw
In reply to Richard Purdie
Quoted 25 lines · Richard Purdie
Quoted 13 lines · Hongxu Jia

Change in V2: The fourth patch fixed the QA Issue on udev, it was missed on previous version.

//Hongxu

The following changes since commit f3541226b8b1187e79dec0f6f9f3c58cedf9ac9b:

bitbake: hob: do not display the "Package list may be incomplete!" dialog (2013-11-01 17:59:31 +0000)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib hongxu/fix-qa-issue
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/fix-qa-issue

Quoted 7 lines

Hongxu Jia (5):
insane.bbclass: support to skip unsafe references in binaries qa
check.
kmod: fix QA issue
udev: fix QA issue
udev: fix QA issue
nfs-utils: fix QA issue

Last time these warnings came up I asked for a clear plan about what needed to live in / and what needed to live in /usr and how we were going to fix things once and for all (or forget this idea).

Quoted 6 lines

Where is the plan? Why is it ok to just ignore these particular warnings?

Cheers,

Richard

Hi Richard,

I want to propose the following solution for this unsafe reference issue.

The solution is based on the following two principles.
1. With /usr on a seperate partition, system should boot up without any error.
2. Without /usr, system should be able to boot into single user mode without any error.

When a QA warning about unsafe references is encountered, the above two principles, together with FHS, are taken into consideration before making a decision.

For example, libkmod is moved to /lib because /lib/udevd requires it; libgudevd is moved to /usr/lib because it's a GObject wrapper for libudev and it's obviously not necessary for booting into single user mode.

The final goals of the solution:
1. Performing a world build doesn't report any warning about unsafe references.
2. System can boot into runlevel 5 without any error if /usr is on another partition.
3. System can boot into single user mode without any error even if /usr is missing.

Patches of this solution have been sent to this mailing list.

Best Regards,
Chen Qi

Quoted 6 lines

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core