Skip to contentSkip to conversation

nss: fix postinst script for nativesdk build

PATCH In review Mikko Rapeli 2 participants 3 messages Aug 26, 2020 – Aug 31, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nss: fix postinst script for nativesdk build

It's better to refer to binaries in postinst script with full path which also works on SDK when /opt/nativesysroot/usr/bin is not in PATH.

Fixes install of nativesdk-nss:

Configuring nativesdk-nss. /var/lib/opkg/info/nativesdk-nss.postinst: line 14: signlibs.sh: not found

---
 meta-oe/recipes-support/nss/nss_3.54.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-oe/recipes-support/nss/nss_3.54.bb +2 -2
index 4923f6868..dc5cafbf1 100644
@@ -244,13 +244,13 @@ pkg_postinst_${PN} () {
             DN=`dirname $I`
             BN=`basename $I .chk`
             FN=$DN/$BN.so
-            shlibsign -i $FN
+            ${bindir}/shlibsign -i $FN
             if [ $? -ne 0 ]; then
                 exit 1
             fi
         done
     else
-        signlibs.sh
+        ${bindir}/signlibs.sh
     fi
 }
 
Signature · 1 line
2.20.1
#1 lore raw

This breaks running postinst in do_rootfs, it tries to run /usr/bin/shlibsign from host which fails when doesn't exist and then it complains about exit 1 called after that:

WARNING: nss.postinst returned 127, marking as unpacked only, configuration required on target.
ERROR: Postinstall scriptlets of ['nss'] have failed. If the intention is to defer them to first boot,
then please place them into pkg_postinst_ontarget_${PN} (). Deferring to first boot via 'exit 1' is no longer supported.

Quoted 40 lines · Mikko Rapeli

It's better to refer to binaries in postinst script with full path which also works on SDK when /opt/nativesysroot/usr/bin is not in PATH.

Fixes install of nativesdk-nss:

Configuring nativesdk-nss. /var/lib/opkg/info/nativesdk-nss.postinst: line 14: signlibs.sh: not found

---
 meta-oe/recipes-support/nss/nss_3.54.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-oe/recipes-support/nss/nss_3.54.bb +2 -3
index 4923f6868..dc5cafbf1 100644
@@ -244,13 +244,13 @@ pkg_postinst_${PN} () {
             DN=`dirname $I`
             BN=`basename $I .chk`
             FN=$DN/$BN.so
-            shlibsign -i $FN
+            ${bindir}/shlibsign -i $FN
             if [ $? -ne 0 ]; then
                 exit 1
             fi
         done
     else
-        signlibs.sh
+        ${bindir}/signlibs.sh
     fi
 }
 
--

2.20.1

#2 lore raw
Quoted 10 lines · Martin Jansa

This breaks running postinst in do_rootfs, it tries to run /usr/bin/shlibsign from host which fails when doesn't exist and then it complains about exit 1 called after that:

WARNING: nss.postinst returned 127, marking as unpacked only, configuration required on target.
ERROR: Postinstall scriptlets of ['nss'] have failed. If the intention is to defer them to first boot,
then please place them into pkg_postinst_ontarget_${PN} (). Deferring to first boot via 'exit 1' is no longer supported.

Sorry, checking the failure now.

-Mikko

Quoted 42 lines · Mikko Rapeli
Quoted 41 lines

It's better to refer to binaries in postinst script with full path which also works on SDK when /opt/nativesysroot/usr/bin is not in PATH.

Fixes install of nativesdk-nss:

Configuring nativesdk-nss. /var/lib/opkg/info/nativesdk-nss.postinst: line 14: signlibs.sh: not found

---
 meta-oe/recipes-support/nss/nss_3.54.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-oe/recipes-support/nss/nss_3.54.bb +2 -3
index 4923f6868..dc5cafbf1 100644
@@ -244,13 +244,13 @@ pkg_postinst_${PN} () {
             DN=`dirname $I`
             BN=`basename $I .chk`
             FN=$DN/$BN.so
-            shlibsign -i $FN
+            ${bindir}/shlibsign -i $FN
             if [ $? -ne 0 ]; then
                 exit 1
             fi
         done
     else
-        signlibs.sh
+        ${bindir}/signlibs.sh
     fi
 }
 
--

2.20.1