Skip to contentSkip to conversation

:lsb: Add initscripts to enhance init functions in an lsb image

PATCH Superseded [email protected] 2 participants 5 messages May 30, 2012

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover :lsb: Add initscripts to enhance init functions in an lsb image

From: Xiaofeng Yan <[email protected]>

This initscripts has more functions than the simple one. There could be some errors for the current version with simple functions when running some programs because of absent some functions provided by initscripts.

The following changes since commit f28209d9d3c67203a2c7a2b25cacfe31643d1bfa:
Kang Kai (1):
cooker.py: terminate the Parser processes

are available in the git repository at:

git://git.pokylinux.org/poky-contrib xiaofeng/2133
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=xiaofeng/2133

Xiaofeng Yan (3):
lsbinitscripts: Add initscripts to enhance init functions in an lsb
image
lsbinitscripts: Patch file functions for confirming to an lsb image
task-core-lsb: Add another initscripts to an lsb image

 .../lsb/lsbinitscripts/functions.patch             |   14 ++++++++
 meta/recipes-extended/lsb/lsbinitscripts_9.03.bb   |   36 ++++++++++++++++++++
 meta/recipes-extended/tasks/task-core-lsb.bb       |    3 +-
 3 files changed, 52 insertions(+), 1 deletions(-)
 create mode 100644 meta/recipes-extended/lsb/lsbinitscripts/functions.patch
 create mode 100644 meta/recipes-extended/lsb/lsbinitscripts_9.03.bb
#1 lore raw

PATCH 1/3 lsbinitscripts: Add initscripts to enhance init functions in an lsb image

From: Xiaofeng Yan <[email protected]>

The version of initscripts has more functions than the simple. \
There could be some errors for current initscripts when running \
some programe because of absent some functions provided by \
initscripts.

[YOCTO #2133]

---
 meta/recipes-extended/lsb/lsbinitscripts_9.03.bb |   36 ++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)
 create mode 100644 meta/recipes-extended/lsb/lsbinitscripts_9.03.bb
meta/recipes-extended/lsb/lsbinitscripts_9.03.bb new file +36 -0
new file mode 100644
index 0000000..5d2bca8
@@ -0,0 +1,36 @@
+DESCRIPTION = "SysV init scripts"
+SECTION = "base"
+LICENSE = "GPLv2"
+PR = "r0"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=ebf4e8b49780ab187d51bd26aaa022c6"
+
+S="${WORKDIR}/initscripts-${PV}"
+SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/initscripts/initscripts-${PV}.tar.bz2/668fa2762b57ef75436303857847bba3/initscripts-${PV}.tar.bz2 \
+           file://functions.patch \
+          " 
+
+SRC_URI[md5sum] = "668fa2762b57ef75436303857847bba3"
+SRC_URI[sha256sum] = "d56547a68ce223a7413b2676650b042125f047c8d6d139c5b970e118b3dc958a"
+
+do_configure[noexec] = "1" 
+
+do_install(){
+	install -d ${D}/etc/init.d/
+	install -m 0755 ${S}/rc.d/init.d/functions ${D}/etc/init.d/functions
+        if [ "${PN}" = "lsbinitscripts" ]; then
+		mv ${D}${sysconfdir}/init.d/functions ${D}${sysconfdir}/init.d/functions.${PN}
+	fi
+}
+
+pkg_postinst_${PN}(){
+        if [ "${PN}" = "lsbinitscripts" ]; then
+		update-alternatives --install  ${sysconfdir}/init.d/functions functions functions.${PN} 10
+	fi
+}
+
+pkg_prerm_${PN}(){
+        if [ "${PN}" = "lsbinitscripts" ]; then
+		update-alternatives --remove functions  ${sysconfdir}/init.d/functions.${PN}
+	fi
+}
Signature · 1 line
1.7.0.4
#2 lore raw

Re: [PATCH 1/3] lsbinitscripts: Add initscripts to enhance init functions in an lsb image

Quoted 21 lines · On Wed, 2012-05-30 at 09:47 +0800, [email protected] wrote:

From: Xiaofeng Yan <[email protected]>

The version of initscripts has more functions than the simple. \
There could be some errors for current initscripts when running \
some programe because of absent some functions provided by \
initscripts.

[YOCTO #2133]

---
 meta/recipes-extended/lsb/lsbinitscripts_9.03.bb |   36 ++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)
 create mode 100644 meta/recipes-extended/lsb/lsbinitscripts_9.03.bb
meta/recipes-extended/lsb/lsbinitscripts_9.03.bb new file +0 -0
new file mode 100644
index 0000000..5d2bca8

meta/recipes-extended/lsb/lsbinitscripts_9.03.bb line 1

Quoted 1 line
meta/recipes-extended/lsb/lsbinitscripts_9.03.bb new file +1 -0
@@ -0,0 +1,36 @@
+DESCRIPTION = "SysV init scripts"

Surely we can be a little more descriptive here and at least mention LSB?

Quoted 25 lines
meta/recipes-extended/lsb/lsbinitscripts_9.03.bb new file +25 -0
+SECTION = "base"
+LICENSE = "GPLv2"
+PR = "r0"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=ebf4e8b49780ab187d51bd26aaa022c6"
+
+S="${WORKDIR}/initscripts-${PV}"
+SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/initscripts/initscripts-${PV}.tar.bz2/668fa2762b57ef75436303857847bba3/initscripts-${PV}.tar.bz2 \
+           file://functions.patch \
+          " 
+
+SRC_URI[md5sum] = "668fa2762b57ef75436303857847bba3"
+SRC_URI[sha256sum] = "d56547a68ce223a7413b2676650b042125f047c8d6d139c5b970e118b3dc958a"
+
+do_configure[noexec] = "1" 
+
+do_install(){
+	install -d ${D}/etc/init.d/
+	install -m 0755 ${S}/rc.d/init.d/functions ${D}/etc/init.d/functions
+        if [ "${PN}" = "lsbinitscripts" ]; then
+		mv ${D}${sysconfdir}/init.d/functions ${D}${sysconfdir}/init.d/functions.${PN}
+	fi
+}
+
+pkg_postinst_${PN}(){

meta/recipes-extended/lsb/lsbinitscripts_9.03.bb line 36

Quoted 10 lines
meta/recipes-extended/lsb/lsbinitscripts_9.03.bb new file +10 -0
+        if [ "${PN}" = "lsbinitscripts" ]; then
+		update-alternatives --install  ${sysconfdir}/init.d/functions functions functions.${PN} 10
+	fi
+}
+
+pkg_prerm_${PN}(){
+        if [ "${PN}" = "lsbinitscripts" ]; then
+		update-alternatives --remove functions  ${sysconfdir}/init.d/functions.${PN}
+	fi
+}

Could you update this to use the recently added update-alternatives class please?

Cheers,

Richard

#3 lore raw

PATCH 2/3 lsbinitscripts: Patch file functions for confirming to an lsb image

In reply to [email protected]

From: Xiaofeng Yan <[email protected]>

Add the condition judgment to functions for avoiding to print error \
information when system start up at first.

[YOCTO #2133]

---
 .../lsb/lsbinitscripts/functions.patch             |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
 create mode 100644 meta/recipes-extended/lsb/lsbinitscripts/functions.patch
meta/recipes-extended/lsb/lsbinitscripts/functions.patch new file +14 -0
new file mode 100644
index 0000000..1906b27
@@ -0,0 +1,14 @@
+Upstream-Status: Inappropriate [embedded specific]
+Signed-off-by: Xiaofeng Yan <[email protected]>
+--- a/rc.d/init.d/functions	2009-12-10 05:24:11.000000000 +0800
++++ b/rc.d/init.d/functions.new	2012-05-29 14:48:53.900229435 +0800
+@@ -16,7 +16,8 @@
+ # Get a sane screen width
+ [ -z "${COLUMNS:-}" ] && COLUMNS=80
+ 
+-[ -z "${CONSOLETYPE:-}" ] && CONSOLETYPE="$(/sbin/consoletype)"
++
++[ -z "${CONSOLETYPE:-}" ] && [ -e /sbin/consoletype ] && CONSOLETYPE="$(/sbin/consoletype)"
+ 
+ if [ -f /etc/sysconfig/i18n -a -z "${NOLOCALE:-}" -a -z "${LANGSH_SOURCED:-}" ] ; then
+   . /etc/profile.d/lang.sh 2>/dev/null
Signature · 1 line
1.7.0.4
#4 lore raw

PATCH 3/3 task-core-lsb: Add another initscripts to an lsb image

In reply to [email protected]

From: Xiaofeng Yan <[email protected]>

Initscripts with stronger functions will replace the simple one, \
which will avoid error when some packages need functions which could \
be absent in the simple initscripts.

[YOCTO #2133]

---
 meta/recipes-extended/tasks/task-core-lsb.bb |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
meta/recipes-extended/tasks/task-core-lsb.bb +2 -1
index 99ca839..c8db300 100644
@@ -3,7 +3,7 @@
 #
 
 DESCRIPTION = "Create Small Image Tasks"
-PR = "r8"
+PR = "r9"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
                     file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
@@ -80,6 +80,7 @@ RDEPENDS_task-core-sys-extended = "\
     which \
     xinetd \
     zip \
+    lsbinitscripts\
     "
 
 RDEPENDS_task-core-db = "\
Signature · 1 line
1.7.0.4