diff options
author | Michael Lauer <mickey@vanille-media.de> | 2007-08-20 12:03:16 +0000 |
---|---|---|
committer | Michael Lauer <mickey@vanille-media.de> | 2007-08-20 12:03:16 +0000 |
commit | 8276d6ef3f035028322f1063c98b9717cd80db09 (patch) | |
tree | 70c1571a0dbb01a0022452d744ee80c533d36cee | |
parent | 71e917c19c83c7042eca136c30bb97eb5ac3f6b0 (diff) |
initscripts: add a functions script that is supposed to be sourced from individual init scripts providing some useful functions.
added cpuinfo_id() and killproc() for a start
-rw-r--r-- | packages/initscripts/initscripts-1.0/functions | 17 | ||||
-rw-r--r-- | packages/initscripts/initscripts_1.0.bb | 30 |
2 files changed, 33 insertions, 14 deletions
diff --git a/packages/initscripts/initscripts-1.0/functions b/packages/initscripts/initscripts-1.0/functions new file mode 100644 index 0000000000..358fc6edb3 --- /dev/null +++ b/packages/initscripts/initscripts-1.0/functions @@ -0,0 +1,17 @@ +# -*-Shell-script-*- +# +# functions This file contains functions to be used by most or all +# shell scripts in the /etc/init.d directory. +# + +cpuinfo_id() { # return the Hardware module ID + awk 'BEGIN { FS=": " } /Hardware/ { print $2 } ' </proc/cpuinfo +} + +killproc() { # kill the named process(es) + pid=`/bin/ps -e x | + /bin/grep $1 | + /bin/grep -v grep | + /bin/sed -e 's/^ *//' -e 's/ .*//'` + [ "$pid" != "" ] && kill $pid +} diff --git a/packages/initscripts/initscripts_1.0.bb b/packages/initscripts/initscripts_1.0.bb index aa30833895..ebddf17b61 100644 --- a/packages/initscripts/initscripts_1.0.bb +++ b/packages/initscripts/initscripts_1.0.bb @@ -4,9 +4,10 @@ PRIORITY = "required" DEPENDS = "makedevs" RDEPENDS = "makedevs" LICENSE = "GPL" -PR = "r97" +PR = "r98" -SRC_URI = "file://halt \ +SRC_URI = "file://functions \ + file://halt \ file://ramdisk \ file://umountfs \ file://devices \ @@ -32,7 +33,7 @@ SRC_URI = "file://halt \ file://volatiles \ file://save-rtc.sh" -SRC_URI_append_arm = " file://alignment.sh" +SRC_URI_append_arm = " file://alignment.sh" KERNEL_VERSION = "" @@ -40,18 +41,19 @@ do_install () { # # Create directories and install device independent scripts # - install -d ${D}${sysconfdir}/init.d \ - ${D}${sysconfdir}/rcS.d \ - ${D}${sysconfdir}/rc0.d \ - ${D}${sysconfdir}/rc1.d \ - ${D}${sysconfdir}/rc2.d \ - ${D}${sysconfdir}/rc3.d \ - ${D}${sysconfdir}/rc4.d \ - ${D}${sysconfdir}/rc5.d \ - ${D}${sysconfdir}/rc6.d \ - ${D}${sysconfdir}/default \ - ${D}${sysconfdir}/default/volatiles + install -d ${D}${sysconfdir}/init.d + install -d ${D}${sysconfdir}/rcS.d + install -d ${D}${sysconfdir}/rc0.d + install -d ${D}${sysconfdir}/rc1.d + install -d ${D}${sysconfdir}/rc2.d + install -d ${D}${sysconfdir}/rc3.d + install -d ${D}${sysconfdir}/rc4.d + install -d ${D}${sysconfdir}/rc5.d + install -d ${D}${sysconfdir}/rc6.d + install -d ${D}${sysconfdir}/default + install -d ${D}${sysconfdir}/default/volatiles + install -m 0755 ${WORKDIR}/functions ${D}${sysconfdir}/init.d install -m 0755 ${WORKDIR}/bootmisc.sh ${D}${sysconfdir}/init.d install -m 0755 ${WORKDIR}/checkroot.sh ${D}${sysconfdir}/init.d install -m 0755 ${WORKDIR}/finish ${D}${sysconfdir}/init.d |