Bug 4879 - nss postinst cannot be configured offline
Summary: nss postinst cannot be configured offline
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.4
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.5 M4
Assignee: Hongxu Jia
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-07-22 02:09 UTC by Chen Qi
Modified: 2013-07-30 02:11 UTC (History)
7 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chen Qi 2013-07-22 02:09:10 UTC
Now the NSS recipe is added to OE-core, it has a postinst which cannot succeed at rootfs time.

pkg_postinst_${PN} () {
    if [ -n "$D" ]; then
        exit 1
    fi
    signlibs.sh
}

Please figure out a way to do this, or we should remove this postinst, as signlibs.sh is not a requirement for LSB.

//Chen Qi
Comment 1 Hongxu Jia 2013-07-22 05:46:11 UTC
Create checksum file at rootfs time to support read-only rootfs.

diff --git a/meta/recipes-support/nss/nss.inc b/meta/recipes-support/nss/nss.inc
index e2f3891..11f1b7f 100644
--- a/meta/recipes-support/nss/nss.inc
+++ b/meta/recipes-support/nss/nss.inc
@@ -163,7 +163,13 @@ do_install_append_class-target() {
 
 pkg_postinst_${PN} () {
     if [ -n "$D" ]; then
-        exit 1
+        for I in $D/${libdir}/lib*.chk; do
+            DN=`dirname $I`
+            BN=`basename $I .chk`
+            FN=$DN/$BN.so
+            shlibsign -i $FN
+        done
+        exit 0
     fi
     signlibs.sh
 }
Comment 2 Hongxu Jia 2013-07-22 05:58:57 UTC
Test Case:

*On host:
1) In local.conf
    IMAGE_INSTALL_append = " nss"
2) Build core-image-sato

*On target:
1) Search checksum file
root@qemuarm:~# find /usr/lib/ -name "*.chk"
/usr/lib/libfreebl3.chk
/usr/lib/libnssdbm3.chk
/usr/lib/libsoftokn3.chk

2) Test for valid checksum files.
root@qemuarm:~# chktest /usr/lib/libfreebl3.so
SUCCESS
root@qemuarm:~# chktest /usr/lib/libnssdbm3.so 
SUCCESS
root@qemuarm:~# chktest /usr/lib/libsoftokn3.so
SUCCESS