Skip to contentSkip to conversation

run-postinsts fixes

PATCH In review [email protected] 2 participants 6 messages Jul 19, 2013 – Jul 23, 2013

lore
Share & tools
lore
#0 lore raw

cover run-postinsts fixes

From: Chen Qi <[email protected]>

The following changes since commit 31e6eee860b5f9f4ac9ef0889bcff5648de6e3f9:

poky-tiny.conf: blacklist core-image-weston option (2013-07-18 21:26:58 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib ChenQi/run-postinsts-fixes
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/run-postinsts-fixes

Chen Qi (3):
rpm: remove the obsolete rpm-postinsts.bb
run-postinsts: fix comment
run-postinsts: add more logging to the log file to make things
clearer

 meta/recipes-devtools/rpm/rpm-postinsts.bb         |   54 --------------------
 .../run-postinsts/run-postinsts/run-postinsts      |    6 ++-
 2 files changed, 4 insertions(+), 56 deletions(-)
 delete mode 100644 meta/recipes-devtools/rpm/rpm-postinsts.bb
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/3 rpm: remove the obsolete rpm-postinsts.bb

From: Chen Qi <[email protected]>

Now that the postinsts of rpm, deb and ipk are all handled in the one central place, run-postinsts.bb, the rpm-postinsts.bb recipe is actually obsolete now. Remove this recipe to avoid confusion.

---
 meta/recipes-devtools/rpm/rpm-postinsts.bb |   54 ----------------------------
 1 file changed, 54 deletions(-)
 delete mode 100644 meta/recipes-devtools/rpm/rpm-postinsts.bb
meta/recipes-devtools/rpm/rpm-postinsts.bb deleted +0 -54
deleted file mode 100644
index ba58cd4..0000000
@@ -1,54 +0,0 @@
-DESCRIPTION = "RPM postinstall script"
-SECTION = "core"
-LICENSE = "LGPLv2.1"
-LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/LGPL-2.1;md5=1a6d268fd218675ffea8be556788b780"
-
-inherit allarch
-#
-# Allow distributions to alter when [postponed] package install scripts are run
-#
-POSTINSTALL_INITPOSITION ?= "98"
-
-do_fetch() {
-	:
-}
-
-do_configure() {
-	:
-}
-
-do_compile() {
-	:
-}
-
-do_install() {
-	:
-}
-
-pkg_postinst_${PN} () {
-if [ "x$D" != "x" ] && [ -f $D/var/lib/rpm/Packages ]; then
-	install -d $D/${sysconfdir}/rcS.d
-	cat > $D${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts << "EOF"
-#!/bin/sh
-[ -e ${sysconfdir}/default/postinst ] && . ${sysconfdir}/default/postinst
-[ -d ${sysconfdir}/rpm-postinsts ] && for i in `ls ${sysconfdir}/rpm-postinsts/`; do
-	i=${sysconfdir}/rpm-postinsts/$i
-	echo "Running postinst $i..."
-	if [ -x $i ]; then
-		if [ "$POSTINST_LOGGING" = "1" ]; then
-			$i >>$LOGFILE 2>&1
-		else
-			$i
-		fi
-		rm $i
-	else
-		echo "ERROR: postinst $i failed."
-	fi
-done
-rm -f ${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts 2>/dev/null
-EOF
-	chmod 0755 $D${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
-fi
-}
-
-ALLOW_EMPTY_${PN} = "1"
Signature · 1 line
1.7.9.5
#2 lore raw

Re: [PATCH 1/3] rpm: remove the obsolete rpm-postinsts.bb

Quoted 6 lines · On 07/19/2013 02:39 AM, [email protected] wrote:

From: Chen Qi <[email protected]>

Now that the postinsts of rpm, deb and ipk are all handled in the one central place, run-postinsts.bb, the rpm-postinsts.bb recipe is actually obsolete now. Remove this recipe to avoid confusion.

There still seems to be references to rpm-postinsts in the rootfs_rpm, package_rpm and image.bb, while these seem unused, we should clean these all up at the same time.

Sau!

Quoted 67 lines
---
  meta/recipes-devtools/rpm/rpm-postinsts.bb |   54 ----------------------------
  1 file changed, 54 deletions(-)

delete mode 100644 meta/recipes-devtools/rpm/rpm-postinsts.bb

meta/recipes-devtools/rpm/rpm-postinsts.bb deleted +0 -54
deleted file mode 100644
index ba58cd4..0000000
@@ -1,54 +0,0 @@
-DESCRIPTION = "RPM postinstall script"
-SECTION = "core"
-LICENSE = "LGPLv2.1"
-LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/LGPL-2.1;md5=1a6d268fd218675ffea8be556788b780"
-
-inherit allarch
-#
-# Allow distributions to alter when [postponed] package install scripts are run
-#
-POSTINSTALL_INITPOSITION ?= "98"
-
-do_fetch() {
-	:
-}
-
-do_configure() {
-	:
-}
-
-do_compile() {
-	:
-}
-
-do_install() {
-	:
-}
-
-pkg_postinst_${PN} () {
-if [ "x$D" != "x" ] && [ -f $D/var/lib/rpm/Packages ]; then
-	install -d $D/${sysconfdir}/rcS.d
-	cat > $D${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts << "EOF"
-#!/bin/sh
-[ -e ${sysconfdir}/default/postinst ] && . ${sysconfdir}/default/postinst
-[ -d ${sysconfdir}/rpm-postinsts ] && for i in `ls ${sysconfdir}/rpm-postinsts/`; do
-	i=${sysconfdir}/rpm-postinsts/$i
-	echo "Running postinst $i..."
-	if [ -x $i ]; then
-		if [ "$POSTINST_LOGGING" = "1" ]; then
-			$i >>$LOGFILE 2>&1
-		else
-			$i
-		fi
-		rm $i
-	else
-		echo "ERROR: postinst $i failed."
-	fi
-done
-rm -f ${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts 2>/dev/null
-EOF
-	chmod 0755 $D${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
-fi
-}
-
-ALLOW_EMPTY_${PN} = "1"
author
#3 lore raw

Re: [PATCH 1/3] rpm: remove the obsolete rpm-postinsts.bb

Quoted 9 lines · Saul Wold
Quoted 6 lines · On 07/19/2013 02:39 AM, [email protected] wrote:

From: Chen Qi <[email protected]>

Now that the postinsts of rpm, deb and ipk are all handled in the one central place, run-postinsts.bb, the rpm-postinsts.bb recipe is actually obsolete now. Remove this recipe to avoid confusion.

There still seems to be references to rpm-postinsts in the rootfs_rpm, package_rpm and image.bb, while these seem unused, we should clean these all up at the same time.

Hi Saul,

I checked these classes, no reference to the rpm-postinsts recipe.

And we can see that the ROOTFS_PKGMANAGE_BOOTSTRAP has been changed to 'run-postinsts'. meta/classes/rootfs_rpm.bbclass:ROOTFS_PKGMANAGE_BOOTSTRAP = "run-postinsts"

There are references to the /etc/rpm-postinsts directory which is actually handled by run-postinsts.bb recipe now.

Best Regards,
Chen Qi

Quoted 80 lines

Sau!

Quoted 75 lines
---
  meta/recipes-devtools/rpm/rpm-postinsts.bb |   54 
----------------------------
  1 file changed, 54 deletions(-)

delete mode 100644 meta/recipes-devtools/rpm/rpm-postinsts.bb

meta/recipes-devtools/rpm/rpm-postinsts.bb deleted +0 -4
deleted file mode 100644
index ba58cd4..0000000
@@ -1,54 +0,0 @@
-DESCRIPTION = "RPM postinstall script"
-SECTION = "core"
-LICENSE = "LGPLv2.1"
-LIC_FILES_CHKSUM = 

"file://${COREBASE}/meta/files/common-licenses/LGPL-2.1;md5=1a6d268fd218675ffea8be556788b780"

meta/recipes-devtools/rpm/rpm-postinsts.bb deleted +0 -4
-
-inherit allarch
-#
-# Allow distributions to alter when [postponed] package install 

scripts are run

meta/recipes-devtools/rpm/rpm-postinsts.bb deleted +0 -23
-#
-POSTINSTALL_INITPOSITION ?= "98"
-
-do_fetch() {
-    :
-}
-
-do_configure() {
-    :
-}
-
-do_compile() {
-    :
-}
-
-do_install() {
-    :
-}
-
-pkg_postinst_${PN} () {
-if [ "x$D" != "x" ] && [ -f $D/var/lib/rpm/Packages ]; then
-    install -d $D/${sysconfdir}/rcS.d
-    cat > 

$D${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts << "EOF" -#!/bin/sh
-[ -e ${sysconfdir}/default/postinst ] && . ${sysconfdir}/default/postinst
-[ -d ${sysconfdir}/rpm-postinsts ] && for i in ls ${sysconfdir}/rpm-postinsts/; do

meta/recipes-devtools/rpm/rpm-postinsts.bb deleted +0 -14
-    i=${sysconfdir}/rpm-postinsts/$i
-    echo "Running postinst $i..."
-    if [ -x $i ]; then
-        if [ "$POSTINST_LOGGING" = "1" ]; then
-            $i >>$LOGFILE 2>&1
-        else
-            $i
-        fi
-        rm $i
-    else
-        echo "ERROR: postinst $i failed."
-    fi
-done
-rm -f ${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts 

2>/dev/null

meta/recipes-devtools/rpm/rpm-postinsts.bb deleted +0 -2
-EOF
-    chmod 0755 

$D${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts

meta/recipes-devtools/rpm/rpm-postinsts.bb deleted +0 -4
-fi
-}
-
-ALLOW_EMPTY_${PN} = "1"
#4 lore raw

PATCH 2/3 run-postinsts: fix comment

In reply to [email protected]

From: Chen Qi <[email protected]>

The run-postinsts script also handles the #SYSCONFDIR#/rpm-postinsts directory. Add it to the comment for clarity.

---
 .../run-postinsts/run-postinsts/run-postinsts      |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts +2 -2
index d1bf582..2a8d1d6 100755
@@ -5,8 +5,8 @@
 # Author: Richard Purdie <[email protected]>
 #
 
-# The following script will run all the scriptlets found in #SYSCONFDIR#/deb-postinsts or
-# #SYSCONFDIR#/ipk-postinsts
+# The following script will run all the scriptlets found in #SYSCONFDIR#/deb-postinsts,
+# #SYSCONFDIR#/ipk-postinsts or #SYSCONFDIR#/rpm-posinsts.
 
 pi_dir=""
 for pm in rpm deb ipk; do
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH 3/3 run-postinsts: add more logging to the log file to make things clearer

In reply to [email protected]

From: Chen Qi <[email protected]>

When all postinsts scripts succeed at system startup, it's very possible that the log file /var/log/postinstall.log is empty. This is kind of confusing, as that file is supposed to hold information about the postinsts.

Add more logging to the log file to make things clearer.

---
 .../run-postinsts/run-postinsts/run-postinsts      |    2 ++
 1 file changed, 2 insertions(+)
meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts +2 -0
index 2a8d1d6..c94c3e9 100755
@@ -24,6 +24,7 @@ remove_pi_dir=1
 for i in `ls $pi_dir`; do
 	i=$pi_dir/$i
 	echo "Running postinst $i..."
+	[ "$POSTINST_LOGGING" = "1" ] && echo "Running postinst $i..." >> $LOGFILE
 	if [ -x $i ]; then
 		if [ "$POSTINST_LOGGING" = "1" ]; then
 			sh -c $i >>$LOGFILE 2>&1
@@ -33,6 +34,7 @@ for i in `ls $pi_dir`; do
 		rm $i
 	else
 		echo "ERROR: postinst $i failed."
+		[ "$POSTINST_LOGGING" = "1" ] && echo "ERROR: postinst $i failed." >> $LOGFILE
 		remove_pi_dir=0
 	fi
 done
Signature · 1 line
1.7.9.5