diff options
author | Philip Tricca <flihp@twobit.us> | 2015-11-08 19:00:38 +0000 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2015-11-27 09:18:13 -0500 |
commit | 766bed8304ae123646232e0799c865d3af6db22c (patch) | |
tree | 8103496719ea74a277e9d423930b1c10e5bef607 | |
parent | fd41e8b70221ae385698a251212ca57073189d47 (diff) | |
download | meta-selinux-766bed8304ae123646232e0799c865d3af6db22c.tar.gz |
selinux-init: Move script logic into include.
This will be useful when we have other init scripts.
Signed-off-by: Philip Tricca <flihp@twobit.us>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
-rw-r--r-- | recipes-security/selinux/selinux-init_0.1.bb | 24 | ||||
-rw-r--r-- | recipes-security/selinux/selinux-initsh.inc | 25 |
2 files changed, 28 insertions, 21 deletions
diff --git a/recipes-security/selinux/selinux-init_0.1.bb b/recipes-security/selinux/selinux-init_0.1.bb index d8e4944..cde142d 100644 --- a/recipes-security/selinux/selinux-init_0.1.bb +++ b/recipes-security/selinux/selinux-init_0.1.bb | |||
@@ -3,7 +3,6 @@ DESCRIPTION = "\ | |||
3 | SELinux start up stuff for Yocto. \ | 3 | SELinux start up stuff for Yocto. \ |
4 | " | 4 | " |
5 | 5 | ||
6 | SECTION = "base" | ||
7 | LICENSE = "MIT" | 6 | LICENSE = "MIT" |
8 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | 7 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" |
9 | 8 | ||
@@ -14,24 +13,7 @@ ${PN}_RDEPENDS = " \ | |||
14 | policycoreutils-setfiles \ | 13 | policycoreutils-setfiles \ |
15 | " | 14 | " |
16 | 15 | ||
17 | S = "${WORKDIR}" | 16 | SRC_URI = "file://${BPN}.sh" |
17 | SELINUX_SCRIPT_DST = "0${BPN}" | ||
18 | 18 | ||
19 | SRC_URI = "file://selinux-init.sh" | 19 | require selinux-initsh.inc |
20 | |||
21 | inherit update-rc.d | ||
22 | |||
23 | INITSCRIPT_NAME = "0selinux-init" | ||
24 | INITSCRIPT_PARAMS = "start 00 S ." | ||
25 | |||
26 | CONFFILES_${PN} += "${sysconfdir}/init.d/0selinux-init" | ||
27 | |||
28 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
29 | |||
30 | do_install () { | ||
31 | install -d ${D}${sysconfdir}/init.d/ | ||
32 | install -m 0755 ${WORKDIR}/selinux-init.sh ${D}${sysconfdir}/init.d/0selinux-init | ||
33 | } | ||
34 | |||
35 | sysroot_stage_all_append () { | ||
36 | sysroot_stage_dir ${D}${sysconfdir} ${SYSROOT_DESTDIR}${sysconfdir} | ||
37 | } | ||
diff --git a/recipes-security/selinux/selinux-initsh.inc b/recipes-security/selinux/selinux-initsh.inc new file mode 100644 index 0000000..f7348bb --- /dev/null +++ b/recipes-security/selinux/selinux-initsh.inc | |||
@@ -0,0 +1,25 @@ | |||
1 | S ?= "${WORKDIR}" | ||
2 | SECTION ?= "base" | ||
3 | |||
4 | # Default is for script name to be the same as the recipe name. | ||
5 | # Script must have .sh suffix. | ||
6 | SELINUX_SCRIPT_SRC ?= "${BPN}" | ||
7 | SELINUX_SCRIPT_DST ?= "${SELINUX_SCRIPT_SRC}" | ||
8 | |||
9 | INITSCRIPT_NAME ?= "${SELINUX_SCRIPT_DST}" | ||
10 | INITSCRIPT_PARAMS ?= "start 00 S ." | ||
11 | |||
12 | CONFFILES_${PN} += "${sysconfdir}/init.d/${SELINUX_SCRIPT_DST}" | ||
13 | |||
14 | PACKAGE_ARCH ?= "${MACHINE_ARCH}" | ||
15 | |||
16 | inherit update-rc.d | ||
17 | |||
18 | do_install () { | ||
19 | install -d ${D}${sysconfdir}/init.d/ | ||
20 | install -m 0755 ${WORKDIR}/${SELINUX_SCRIPT_SRC}.sh ${D}${sysconfdir}/init.d/${SELINUX_SCRIPT_DST} | ||
21 | } | ||
22 | |||
23 | sysroot_stage_all_append () { | ||
24 | sysroot_stage_dir ${D}${sysconfdir} ${SYSROOT_DESTDIR}${sysconfdir} | ||
25 | } | ||