Bug 4879

Summary: nss postinst cannot be configured offline
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Chen Qi <Qi.Chen>
Component: coreAssignee: Hongxu Jia <hongxu.jia>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: laurentiu.palcu, liezhi.yang, mark.hatle, meta.mr.watcher, meta.watcher, sgw, yi.zhao
Version: 1.4   
Target Milestone: 1.5 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

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