* [PATCH 0/5] V2: Redirect output of postinstall scripts
@ 2013-02-26 8:14 Kang Kai
2013-02-26 8:14 ` [PATCH 1/5] opkg: save output of postinst scripts when image first boot Kang Kai
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Kang Kai @ 2013-02-26 8:14 UTC (permalink / raw)
To: openembedded-core; +Cc: Zhenfeng.Zhao
When image feature "debug-tweaks" enabled, redirect output of postinstall scripts
to a log file when image first boot.
[YOCTO #3223]
The following changes since commit 2cc4fe4a0874c42421b1bf3fa100160a9e60a9da:
upstream_tracking.inc: Coonectivity and multimedia packages updates (2013-02-25 05:58:20 -0800)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib kangkai/debug-tweaks
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/debug-tweaks
Kang Kai (5):
opkg: save output of postinst scripts when image first boot
rootfs_deb: remove run-postinsts from ROOTFS_PKGMANAGE
dpkg: save output of postinstall scripts when image firstboot
rootfs_rpm: move run-postinsts scripts to rpm recipe
rpm: save output of postinstall scripts when image first boot
meta/classes/rootfs_deb.bbclass | 2 +-
meta/classes/rootfs_rpm.bbclass | 23 -----------------------
meta/recipes-devtools/dpkg/dpkg.inc | 8 +++++---
meta/recipes-devtools/opkg/opkg.inc | 5 ++++-
meta/recipes-devtools/rpm/rpm_5.4.9.bb | 27 +++++++++++++++++++++++++++
5 files changed, 37 insertions(+), 28 deletions(-)
--
1.7.5.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/5] opkg: save output of postinst scripts when image first boot
2013-02-26 8:14 [PATCH 0/5] V2: Redirect output of postinstall scripts Kang Kai
@ 2013-02-26 8:14 ` Kang Kai
2013-02-26 8:14 ` [PATCH 2/5] rootfs_deb: remove run-postinsts from ROOTFS_PKGMANAGE Kang Kai
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Kang Kai @ 2013-02-26 8:14 UTC (permalink / raw)
To: openembedded-core; +Cc: Zhenfeng.Zhao
When image feature "debug-tweaks" enabled, save output of postinstall
scripts to log file /var/log/postinstall.log when image first boot. And the
log file can be configured.
It also needs image feature "package-management" enabled. If not,
package run-postinsts will be installed and then all packages will be
configured by it. Command 'opkg configure' outputs nothing.
[YOCTO #3223]
Signed-off-by: Kang Kai <kai.kang@windriver.com>
---
meta/recipes-devtools/opkg/opkg.inc | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/meta/recipes-devtools/opkg/opkg.inc b/meta/recipes-devtools/opkg/opkg.inc
index 8d48006..f9c1202 100644
--- a/meta/recipes-devtools/opkg/opkg.inc
+++ b/meta/recipes-devtools/opkg/opkg.inc
@@ -57,13 +57,16 @@ do_install_append_class-native() {
fi
}
+POSTLOG ?= "/var/log/postinstall.log"
+REDIRECT_CMD = "${@base_contains('IMAGE_FEATURES', 'debug-tweaks', '>${POSTLOG} 2>&1', '', d)}"
+
pkg_postinst_${PN} () {
#!/bin/sh
if [ "x$D" != "x" ]; then
install -d $D${sysconfdir}/rcS.d
# this happens at S98 where our good 'ole packages script used to run
echo "#!/bin/sh
-opkg-cl configure
+opkg-cl configure ${REDIRECT_CMD}
rm -f /${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
" > $D${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
chmod 0755 $D${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
--
1.7.5.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/5] rootfs_deb: remove run-postinsts from ROOTFS_PKGMANAGE
2013-02-26 8:14 [PATCH 0/5] V2: Redirect output of postinstall scripts Kang Kai
2013-02-26 8:14 ` [PATCH 1/5] opkg: save output of postinst scripts when image first boot Kang Kai
@ 2013-02-26 8:14 ` Kang Kai
2013-02-26 8:14 ` [PATCH 3/5] dpkg: save output of postinstall scripts when image firstboot Kang Kai
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Kang Kai @ 2013-02-26 8:14 UTC (permalink / raw)
To: openembedded-core; +Cc: Zhenfeng.Zhao
Remove package run-postinsts from ROOTFS_PKGMANAGE. run-postinsts has
already added in ROOTFS_PKGMANAGE_BOOTSTRAP and then added to rootfs
conditionally by checking image feature "package-management".
Signed-off-by: Kang Kai <kai.kang@windriver.com>
---
meta/classes/rootfs_deb.bbclass | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
index 92a6579..a3c3767 100644
--- a/meta/classes/rootfs_deb.bbclass
+++ b/meta/classes/rootfs_deb.bbclass
@@ -2,7 +2,7 @@
# Copyright 2006-2007 Openedhand Ltd.
#
-ROOTFS_PKGMANAGE = "run-postinsts dpkg apt"
+ROOTFS_PKGMANAGE = "dpkg apt"
ROOTFS_PKGMANAGE_BOOTSTRAP = "run-postinsts"
do_rootfs[depends] += "dpkg-native:do_populate_sysroot apt-native:do_populate_sysroot"
--
1.7.5.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/5] dpkg: save output of postinstall scripts when image firstboot
2013-02-26 8:14 [PATCH 0/5] V2: Redirect output of postinstall scripts Kang Kai
2013-02-26 8:14 ` [PATCH 1/5] opkg: save output of postinst scripts when image first boot Kang Kai
2013-02-26 8:14 ` [PATCH 2/5] rootfs_deb: remove run-postinsts from ROOTFS_PKGMANAGE Kang Kai
@ 2013-02-26 8:14 ` Kang Kai
2013-02-26 8:14 ` [PATCH 4/5] rootfs_rpm: move run-postinsts scripts to rpm recipe Kang Kai
2013-02-26 8:14 ` [PATCH 5/5] rpm: save output of postinstall scripts when image first boot Kang Kai
4 siblings, 0 replies; 7+ messages in thread
From: Kang Kai @ 2013-02-26 8:14 UTC (permalink / raw)
To: openembedded-core; +Cc: Zhenfeng.Zhao
When image feature "debug-tweaks" enabled, save output of postinstall
scripts to log file /var/log/postinstall.log when image first boot. And
the log file can be configured.
It also needs image feature "package-management" enabled. If not,
package run-postinsts will be installed and then all packages will be
configured by it. Command 'dpkg --configure' outputs nothing.
[YOCTO #3223]
Signed-off-by: Kang Kai <kai.kang@windriver.com>
---
meta/recipes-devtools/dpkg/dpkg.inc | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
index fd26c8a..0bc1ae8 100644
--- a/meta/recipes-devtools/dpkg/dpkg.inc
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -2,7 +2,7 @@ DESCRIPTION = "Package maintenance system for Debian."
LICENSE = "GPLv2.0+"
SECTION = "base"
-INC_PR = "r18"
+INC_PR = "r19"
SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.xz \
file://ignore_extra_fields.patch"
@@ -35,13 +35,15 @@ do_configure () {
autotools_do_configure
}
+POSTLOG ?= "/var/log/postinstall.log"
+REDIRECT_CMD = "${@base_contains('IMAGE_FEATURES', 'debug-tweaks', '>${POSTLOG} 2>&1', '', d)}"
DPKG_INIT_POSITION ?= "98"
do_install_prepend () {
install -d ${D}/${sysconfdir}/rcS.d
# this happens at S98 where our good 'ole packages script used to run
- printf "#!/bin/sh
-dpkg --configure -a
+ echo "#!/bin/sh
+dpkg --configure -a ${REDIRECT_CMD}
rm -f ${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts
" > ${D}/${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts
chmod 0755 ${D}/${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts
--
1.7.5.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/5] rootfs_rpm: move run-postinsts scripts to rpm recipe
2013-02-26 8:14 [PATCH 0/5] V2: Redirect output of postinstall scripts Kang Kai
` (2 preceding siblings ...)
2013-02-26 8:14 ` [PATCH 3/5] dpkg: save output of postinstall scripts when image firstboot Kang Kai
@ 2013-02-26 8:14 ` Kang Kai
2013-02-26 8:14 ` [PATCH 5/5] rpm: save output of postinstall scripts when image first boot Kang Kai
4 siblings, 0 replies; 7+ messages in thread
From: Kang Kai @ 2013-02-26 8:14 UTC (permalink / raw)
To: openembedded-core; +Cc: Zhenfeng.Zhao
Move run-postinsts scripts from rootfs_rpm.bbclass to rpm recipe. That
is the same way for dpkg and opkg to deal the post install scripts.
Signed-off-by: Kang Kai <kai.kang@windriver.com>
---
meta/classes/rootfs_rpm.bbclass | 23 -----------------------
meta/recipes-devtools/rpm/rpm_5.4.9.bb | 23 +++++++++++++++++++++++
2 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index 9dc2bf9..3442d48 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -29,11 +29,6 @@ do_rootfs[vardepsexclude] += "BUILDNAME"
RPM_PREPROCESS_COMMANDS = "package_update_index_rpm; "
RPM_POSTPROCESS_COMMANDS = "rpm_setup_smart_target_config; "
-#
-# Allow distributions to alter when [postponed] package install scripts are run
-#
-POSTINSTALL_INITPOSITION ?= "98"
-
rpmlibdir = "/var/lib/rpm"
opkglibdir = "${localstatedir}/lib/opkg"
@@ -114,24 +109,6 @@ fakeroot rootfs_rpm_do_rootfs () {
fi
done
- install -d ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d
- # Stop $i getting expanded below...
- i=\$i
- cat > ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts << EOF
-#!/bin/sh
-for i in \`ls /etc/rpm-postinsts/\`; do
- i=/etc/rpm-postinsts/$i
- echo "Running postinst $i..."
- if [ -f $i ] && $i; then
- rm $i
- else
- echo "ERROR: postinst $i failed."
- fi
-done
-rm -f ${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
-EOF
- chmod 0755 ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
-
install -d ${IMAGE_ROOTFS}/${sysconfdir}
echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.9.bb b/meta/recipes-devtools/rpm/rpm_5.4.9.bb
index 39b0481..0b014b6 100644
--- a/meta/recipes-devtools/rpm/rpm_5.4.9.bb
+++ b/meta/recipes-devtools/rpm/rpm_5.4.9.bb
@@ -369,6 +369,11 @@ do_configure() {
oe_runconf
}
+#
+# Allow distributions to alter when [postponed] package install scripts are run
+#
+POSTINSTALL_INITPOSITION ?= "98"
+
do_install_append() {
sed -i -e 's,%__check_files,#%%__check_files,' ${D}/${libdir}/rpm/macros
sed -i -e 's,%__scriptlet_requires,#%%__scriptlet_requires,' ${D}/${libdir}/rpm/macros
@@ -445,6 +450,24 @@ do_install_append() {
rm -rf ${D}/var/lib/wdj ${D}/var/cache/wdj
rm -f ${D}/${libdir}/rpm/bin/api-sanity-checker.pl
+
+ install -d ${D}/${sysconfdir}/rcS.d
+ # Stop $i getting expanded below...
+ i=\$i
+ cat > ${D}${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts << EOF
+#!/bin/sh
+for i in \`ls /etc/rpm-postinsts/\`; do
+ i=/etc/rpm-postinsts/$i
+ echo "Running postinst $i..."
+ if [ -f $i ] && $i; then
+ rm $i
+ else
+ echo "ERROR: postinst $i failed."
+ fi
+done
+rm -f ${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
+EOF
+ chmod 0755 ${D}${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
}
do_install_append_class-native() {
--
1.7.5.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 5/5] rpm: save output of postinstall scripts when image first boot
2013-02-26 8:14 [PATCH 0/5] V2: Redirect output of postinstall scripts Kang Kai
` (3 preceding siblings ...)
2013-02-26 8:14 ` [PATCH 4/5] rootfs_rpm: move run-postinsts scripts to rpm recipe Kang Kai
@ 2013-02-26 8:14 ` Kang Kai
2013-03-06 1:52 ` Kang Kai
4 siblings, 1 reply; 7+ messages in thread
From: Kang Kai @ 2013-02-26 8:14 UTC (permalink / raw)
To: openembedded-core; +Cc: Zhenfeng.Zhao
When image feature "debug-tweaks" is enabled, save output of post
install script to log file which can be configured when image first
boot.
[YOCTO #3223]
Signed-off-by: Kang Kai <kai.kang@windriver.com>
---
meta/recipes-devtools/rpm/rpm_5.4.9.bb | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.9.bb b/meta/recipes-devtools/rpm/rpm_5.4.9.bb
index 0b014b6..cdfb5ff 100644
--- a/meta/recipes-devtools/rpm/rpm_5.4.9.bb
+++ b/meta/recipes-devtools/rpm/rpm_5.4.9.bb
@@ -223,6 +223,7 @@ FILES_${PN} = "${bindir}/rpm \
${libdir}/rpm/bin/wget \
/var/lib/rpm \
/var/cache/rpm \
+ ${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts \
"
FILES_${PN}-dbg += "${libdir}/rpm/.debug \
@@ -374,6 +375,9 @@ do_configure() {
#
POSTINSTALL_INITPOSITION ?= "98"
+POSTLOG ?= "/var/log/postinstall.log"
+REDIRECT_CMD = "${@base_contains('IMAGE_FEATURES', 'debug-tweaks', '>>${POSTLOG} 2>&1', '', d)}"
+
do_install_append() {
sed -i -e 's,%__check_files,#%%__check_files,' ${D}/${libdir}/rpm/macros
sed -i -e 's,%__scriptlet_requires,#%%__scriptlet_requires,' ${D}/${libdir}/rpm/macros
@@ -459,7 +463,7 @@ do_install_append() {
for i in \`ls /etc/rpm-postinsts/\`; do
i=/etc/rpm-postinsts/$i
echo "Running postinst $i..."
- if [ -f $i ] && $i; then
+ if [ -f $i ] && $i ${REDIRECT_CMD}; then
rm $i
else
echo "ERROR: postinst $i failed."
--
1.7.5.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 5/5] rpm: save output of postinstall scripts when image first boot
2013-02-26 8:14 ` [PATCH 5/5] rpm: save output of postinstall scripts when image first boot Kang Kai
@ 2013-03-06 1:52 ` Kang Kai
0 siblings, 0 replies; 7+ messages in thread
From: Kang Kai @ 2013-03-06 1:52 UTC (permalink / raw)
To: Kang Kai; +Cc: Zhenfeng.Zhao, openembedded-core
On 2013年02月26日 16:14, Kang Kai wrote:
> When image feature "debug-tweaks" is enabled, save output of post
> install script to log file which can be configured when image first
> boot.
>
> [YOCTO #3223]
>
> Signed-off-by: Kang Kai<kai.kang@windriver.com>
> ---
> meta/recipes-devtools/rpm/rpm_5.4.9.bb | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/meta/recipes-devtools/rpm/rpm_5.4.9.bb b/meta/recipes-devtools/rpm/rpm_5.4.9.bb
> index 0b014b6..cdfb5ff 100644
> --- a/meta/recipes-devtools/rpm/rpm_5.4.9.bb
> +++ b/meta/recipes-devtools/rpm/rpm_5.4.9.bb
> @@ -223,6 +223,7 @@ FILES_${PN} = "${bindir}/rpm \
> ${libdir}/rpm/bin/wget \
> /var/lib/rpm \
> /var/cache/rpm \
> + ${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts \
Previous(4/5) patch has been merged to master but this one not, the
bitbake complains:
WARNING: QA Issue: rpm: Files/directories were installed but not shipped
/etc
/etc/rcS.d
/etc/rcS.d/S98run-postinsts
This line should be split to the previous(4/5) patch. When this patch
merged, the warning will disappear.
Sorry for this trouble,
Kai
> "
>
> FILES_${PN}-dbg += "${libdir}/rpm/.debug \
> @@ -374,6 +375,9 @@ do_configure() {
> #
> POSTINSTALL_INITPOSITION ?= "98"
>
> +POSTLOG ?= "/var/log/postinstall.log"
> +REDIRECT_CMD = "${@base_contains('IMAGE_FEATURES', 'debug-tweaks', '>>${POSTLOG} 2>&1', '', d)}"
> +
> do_install_append() {
> sed -i -e 's,%__check_files,#%%__check_files,' ${D}/${libdir}/rpm/macros
> sed -i -e 's,%__scriptlet_requires,#%%__scriptlet_requires,' ${D}/${libdir}/rpm/macros
> @@ -459,7 +463,7 @@ do_install_append() {
> for i in \`ls /etc/rpm-postinsts/\`; do
> i=/etc/rpm-postinsts/$i
> echo "Running postinst $i..."
> - if [ -f $i ]&& $i; then
> + if [ -f $i ]&& $i ${REDIRECT_CMD}; then
> rm $i
> else
> echo "ERROR: postinst $i failed."
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-03-06 2:07 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-26 8:14 [PATCH 0/5] V2: Redirect output of postinstall scripts Kang Kai
2013-02-26 8:14 ` [PATCH 1/5] opkg: save output of postinst scripts when image first boot Kang Kai
2013-02-26 8:14 ` [PATCH 2/5] rootfs_deb: remove run-postinsts from ROOTFS_PKGMANAGE Kang Kai
2013-02-26 8:14 ` [PATCH 3/5] dpkg: save output of postinstall scripts when image firstboot Kang Kai
2013-02-26 8:14 ` [PATCH 4/5] rootfs_rpm: move run-postinsts scripts to rpm recipe Kang Kai
2013-02-26 8:14 ` [PATCH 5/5] rpm: save output of postinstall scripts when image first boot Kang Kai
2013-03-06 1:52 ` Kang Kai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox