summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAron Griffis <agriffis@gentoo.org>2004-06-29 19:32:50 +0000
committerAron Griffis <agriffis@gentoo.org>2004-06-29 19:32:50 +0000
commita7439ee76a80f1e71aee90332771d08418351556 (patch)
tree144a736d7975ee861ee054460ca97b7a0024a4ee /sys-apps
parentadd sed-4 dep (diff)
downloadhistorical-a7439ee76a80f1e71aee90332771d08418351556.tar.gz
historical-a7439ee76a80f1e71aee90332771d08418351556.tar.bz2
historical-a7439ee76a80f1e71aee90332771d08418351556.zip
Update to version used in baselayout-1.10.1 in preparation for baselayout/sysvinit split
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/sysvinit/ChangeLog10
-rw-r--r--sys-apps/sysvinit/Manifest7
-rw-r--r--sys-apps/sysvinit/files/digest-sysvinit-2.841
-rw-r--r--sys-apps/sysvinit/files/inittab49
-rw-r--r--sys-apps/sysvinit/files/sysvinit-2.84-selinux.patch122
-rw-r--r--sys-apps/sysvinit/files/sysvinit-2.84-selinux1.patch131
-rw-r--r--sys-apps/sysvinit/sysvinit-2.84.ebuild72
7 files changed, 390 insertions, 2 deletions
diff --git a/sys-apps/sysvinit/ChangeLog b/sys-apps/sysvinit/ChangeLog
index 8b19136c3c6a..896a31b47e6a 100644
--- a/sys-apps/sysvinit/ChangeLog
+++ b/sys-apps/sysvinit/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for sys-apps/sysvinit
# Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/sysvinit/ChangeLog,v 1.7 2004/06/24 22:28:45 agriffis Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/sysvinit/ChangeLog,v 1.8 2004/06/29 19:32:50 agriffis Exp $
+
+*sysvinit-2.84 (29 Jun 2004)
+
+ 29 Jun 2004; Aron Griffis <agriffis@gentoo.org> +files/inittab,
+ +files/sysvinit-2.84-selinux.patch, +files/sysvinit-2.84-selinux1.patch,
+ +sysvinit-2.84.ebuild:
+ Update to version used in baselayout-1.10.1 in preparation for
+ baselayout/sysvinit split
*sysvinit-2.83-r1 (09 Jul 2002)
diff --git a/sys-apps/sysvinit/Manifest b/sys-apps/sysvinit/Manifest
index 5f78dad6e941..726b585d1424 100644
--- a/sys-apps/sysvinit/Manifest
+++ b/sys-apps/sysvinit/Manifest
@@ -1,6 +1,11 @@
+MD5 b85047322ca0b027a6d34bf783c78d1e sysvinit-2.84.ebuild 1941
MD5 06b76d505d2cad00c21850c2a2055c4b sysvinit-2.83-r1.ebuild 1066
MD5 8aab49c43e445e776d2388b5379fab12 sysvinit-2.83.ebuild 1028
-MD5 76a86b25c4da4e582ed8951a932e8650 ChangeLog 651
+MD5 2c6455f6b74aef5d320385f86c5513f3 ChangeLog 941
MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164
MD5 f3cc010ab25be0d757030537126157a8 files/digest-sysvinit-2.83-r1 64
+MD5 d50ca91cbb58c7528a60ddf5bb172956 files/sysvinit-2.84-selinux.patch 3206
+MD5 adc667ea815b256d6f39259f4134f6df files/sysvinit-2.84-selinux1.patch 3556
MD5 f3cc010ab25be0d757030537126157a8 files/digest-sysvinit-2.83 64
+MD5 76a07c8f9b30bd607a50b2b3eba0ebd8 files/digest-sysvinit-2.84 64
+MD5 6e4627df68938fb6fd18afb1aea2bb8a files/inittab 1561
diff --git a/sys-apps/sysvinit/files/digest-sysvinit-2.84 b/sys-apps/sysvinit/files/digest-sysvinit-2.84
new file mode 100644
index 000000000000..369032eee571
--- /dev/null
+++ b/sys-apps/sysvinit/files/digest-sysvinit-2.84
@@ -0,0 +1 @@
+MD5 6ae4a8237a7e298097239e76eb7aff60 sysvinit-2.84.tar.gz 91488
diff --git a/sys-apps/sysvinit/files/inittab b/sys-apps/sysvinit/files/inittab
new file mode 100644
index 000000000000..95be8f10ca95
--- /dev/null
+++ b/sys-apps/sysvinit/files/inittab
@@ -0,0 +1,49 @@
+#
+# /etc/inittab: This file describes how the INIT process should set up
+# the system in a certain run-level.
+#
+# Author: Miquel van Smoorenburg, <miquels@cistron.nl>
+# Modified by: Patrick J. Volkerding, <volkerdi@ftp.cdrom.com>
+# Modified by: Daniel Robbins, <drobbins@gentoo.org>
+# Modified by: Martin Schlemmer, <azarah@gentoo.org>
+#
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/sysvinit/files/inittab,v 1.1 2004/06/29 19:32:50 agriffis Exp $
+
+#
+# Default runlevel.
+id:3:initdefault:
+
+# System initialization, mount local filesystems, etc.
+si::sysinit:/sbin/rc sysinit
+
+# Further system initialization, brings up the boot runlevel.
+rc::bootwait:/sbin/rc boot
+
+l0:0:wait:/sbin/rc shutdown
+l1:S1:wait:/sbin/rc single
+l2:2:wait:/sbin/rc nonetwork
+l3:3:wait:/sbin/rc default
+l4:4:wait:/sbin/rc default
+l5:5:wait:/sbin/rc default
+l6:6:wait:/sbin/rc reboot
+#z6:6:respawn:/sbin/sulogin
+
+# TERMINALS
+c1:12345:respawn:/sbin/agetty 38400 tty1 linux
+c2:12345:respawn:/sbin/agetty 38400 tty2 linux
+c3:12345:respawn:/sbin/agetty 38400 tty3 linux
+c4:12345:respawn:/sbin/agetty 38400 tty4 linux
+c5:12345:respawn:/sbin/agetty 38400 tty5 linux
+c6:12345:respawn:/sbin/agetty 38400 tty6 linux
+
+# What to do at the "Three Finger Salute".
+ca:12345:ctrlaltdel:/sbin/shutdown -r now
+
+# Used by /etc/init.d/xdm to control DM startup.
+# Read the comments in /etc/init.d/xdm for more
+# info. Do NOT remove, as this will start nothing
+# extra at boot if /etc/init.d/xdm is not added
+# to the "default" runlevel.
+x:a:once:/etc/X11/startDM.sh
+
+# End of /etc/inittab
diff --git a/sys-apps/sysvinit/files/sysvinit-2.84-selinux.patch b/sys-apps/sysvinit/files/sysvinit-2.84-selinux.patch
new file mode 100644
index 000000000000..e9862a7bee66
--- /dev/null
+++ b/sys-apps/sysvinit/files/sysvinit-2.84-selinux.patch
@@ -0,0 +1,122 @@
+--- sysvinit-2.85/src/init.c.selinux 2003-11-10 14:56:40.687719862 -0500
++++ sysvinit-2.85/src/init.c 2003-11-10 14:56:55.856964055 -0500
+@@ -78,6 +78,78 @@
+ sigemptyset(&sa.sa_mask); \
+ sigaction(sig, &sa, NULL); \
+ } while(0)
++#ifdef WITH_SELINUX
++#include <sys/mman.h>
++#include <selinux/selinux.h>
++#include <sys/mount.h>
++
++static int load_policy(int *enforce)
++{
++ int fd=-1,ret=-1;
++ int rc=0;
++ struct stat sb;
++ void *map;
++ char policy_file[PATH_MAX];
++ int policy_version=0;
++
++ log(L_VB, "Loading security policy\n");
++ if (mount("none", SELINUXMNT, "selinuxfs", 0, 0) < 0) {
++ if (errno == ENODEV) {
++ log(L_VB, "SELinux not supported by kernel: %s\n",SELINUXMNT,strerror(errno));
++ }
++ else {
++ log(L_VB, "Failed to mount %s: %s\n",SELINUXMNT,strerror(errno));
++ return ret;
++ }
++ return ret; /* Never gets here */
++ }
++
++ policy_version=security_policyvers();
++ if (policy_version < 0) {
++ log(L_VB, "Can't get policy version: %s\n", strerror(errno));
++ goto UMOUNT;
++ }
++
++ rc=security_getenforce();
++ if (rc < 0) {
++ log(L_VB, "Can't get SELinux enforcement flag: %s\n", strerror(errno));
++ goto UMOUNT;
++ }
++ *enforce=rc;
++
++ snprintf(policy_file,sizeof(policy_file),"%s.%d",SELINUXPOLICY,policy_version);
++ fd = open(policy_file, O_RDONLY);
++ if (fd < 0) {
++ log(L_VB, "Can't open '%s': %s\n",
++ policy_file, strerror(errno));
++ goto UMOUNT;
++ }
++
++ if (fstat(fd, &sb) < 0) {
++ log(L_VB, "Can't stat '%s': %s\n",
++ policy_file, strerror(errno));
++ goto UMOUNT;
++ }
++
++ map = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fd, 0);
++ if (map == MAP_FAILED) {
++ log(L_VB, "Can't map '%s': %s\n",
++ policy_file, strerror(errno));
++ goto UMOUNT;
++ }
++ ret=security_load_policy(map, sb.st_size);
++ if (ret < 0) {
++ log(L_VB, "security_load_policy failed\n");
++ }
++
++ UMOUNT:
++ umount(SELINUXMNT);
++ if ( fd >= 0) {
++ close(fd);
++ }
++ return(ret);
++}
++#endif
+
+ /* Version information */
+ char *Version = "@(#) init " VERSION " " DATE " miquels@cistron.nl";
+@@ -2576,6 +2648,20 @@
+ maxproclen += strlen(argv[f]) + 1;
+ }
+
++#ifdef WITH_SELINUX
++ if (getenv("SELINUX_INIT") == NULL) {
++ putenv("SELINUX_INIT=YES");
++ int enforce=0;
++ if (load_policy(&enforce) == 0 ) {
++ execv(myname, argv);
++ } else {
++ if (enforce)
++ /* SELinux in enforcing mode but load_policy failed */
++ exit(1);
++ }
++ }
++#endif
++
+ /* Start booting. */
+ argv0 = argv[0];
+ argv[1] = NULL;
+--- sysvinit-2.85/src/Makefile.selinux 2003-11-10 14:56:40.430749605 -0500
++++ sysvinit-2.85/src/Makefile 2003-11-10 14:56:40.725715464 -0500
+@@ -32,7 +32,7 @@
+ all: $(PROGS)
+
+ init: init.o init_utmp.o
+- $(CC) $(LDFLAGS) $(STATIC) -o $@ init.o init_utmp.o
++ $(CC) $(LDFLAGS) $(STATIC) -o $@ init.o init_utmp.o -lselinux
+
+ halt: halt.o ifdown.o hddown.o utmp.o reboot.h
+ $(CC) $(LDFLAGS) -o $@ halt.o ifdown.o hddown.o utmp.o
+@@ -62,7 +62,7 @@
+ $(CC) $(LDFLAGS) -o $@ bootlogd.o
+
+ init.o: init.c init.h set.h reboot.h
+- $(CC) -c $(CFLAGS) init.c
++ $(CC) -c $(CFLAGS) -DWITH_SELINUX init.c
+
+ utmp.o: utmp.c init.h
+ $(CC) -c $(CFLAGS) utmp.c
diff --git a/sys-apps/sysvinit/files/sysvinit-2.84-selinux1.patch b/sys-apps/sysvinit/files/sysvinit-2.84-selinux1.patch
new file mode 100644
index 000000000000..a82ddaa4ff57
--- /dev/null
+++ b/sys-apps/sysvinit/files/sysvinit-2.84-selinux1.patch
@@ -0,0 +1,131 @@
+--- sysvinit-2.85/src/init.c.selinux 2004-02-10 14:34:18.454593535 -0500
++++ sysvinit-2.85/src/init.c 2004-02-10 14:37:27.947014932 -0500
+@@ -78,6 +78,87 @@
+ sigemptyset(&sa.sa_mask); \
+ sigaction(sig, &sa, NULL); \
+ } while(0)
++#ifdef WITH_SELINUX
++#include <sys/mman.h>
++#include <selinux/selinux.h>
++#include <sys/mount.h>
++
++static int load_policy(int *enforce)
++{
++ int fd=-1,ret=-1;
++ int rc=0;
++ struct stat sb;
++ void *map;
++ char policy_file[PATH_MAX];
++ int policy_version=0;
++ extern char *selinux_mnt;
++
++ log(L_VB, "Loading security policy\n");
++ if (mount("none", SELINUXMNT, "selinuxfs", 0, 0) < 0) {
++ if (errno == ENODEV) {
++ log(L_VB, "SELinux not supported by kernel: %s\n",SELINUXMNT,strerror(errno));
++ }
++ else {
++ log(L_VB, "Failed to mount %s: %s\n",SELINUXMNT,strerror(errno));
++ return ret;
++ }
++ return ret; /* Never gets here */
++ }
++
++ selinux_mnt = SELINUXMNT; /* set manually since we mounted it */
++
++ policy_version=security_policyvers();
++ if (policy_version < 0) {
++ log(L_VB, "Can't get policy version: %s\n", strerror(errno));
++ goto UMOUNT;
++ }
++
++ rc=security_getenforce();
++ if (rc < 0) {
++ log(L_VB, "Can't get SELinux enforcement flag: %s\n", strerror(errno));
++ goto UMOUNT;
++ }
++ *enforce=rc;
++
++ snprintf(policy_file,sizeof(policy_file),"%s.%d",SELINUXPOLICY,policy_version);
++ fd = open(policy_file, O_RDONLY);
++ if (fd < 0) {
++ /* Check previous version to see if old policy is available
++ */
++ snprintf(policy_file,sizeof(policy_file),"%s.%d",SELINUXPOLICY,policy_version-1);
++ fd = open(policy_file, O_RDONLY);
++ if (fd < 0) {
++ log(L_VB, "Can't open '%s.%d': %s\n",
++ SELINUXPOLICY,policy_version,strerror(errno));
++ goto UMOUNT;
++ }
++ }
++
++ if (fstat(fd, &sb) < 0) {
++ log(L_VB, "Can't stat '%s': %s\n",
++ policy_file, strerror(errno));
++ goto UMOUNT;
++ }
++
++ map = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fd, 0);
++ if (map == MAP_FAILED) {
++ log(L_VB, "Can't map '%s': %s\n",
++ policy_file, strerror(errno));
++ goto UMOUNT;
++ }
++ ret=security_load_policy(map, sb.st_size);
++ if (ret < 0) {
++ log(L_VB, "security_load_policy failed\n");
++ }
++
++ UMOUNT:
++ /*umount(SELINUXMNT); */
++ if ( fd >= 0) {
++ close(fd);
++ }
++ return(ret);
++}
++#endif
+
+ /* Version information */
+ char *Version = "@(#) init " VERSION " " DATE " miquels@cistron.nl";
+@@ -2576,6 +2657,20 @@
+ maxproclen += strlen(argv[f]) + 1;
+ }
+
++#ifdef WITH_SELINUX
++ if (getenv("SELINUX_INIT") == NULL) {
++ putenv("SELINUX_INIT=YES");
++ int enforce=0;
++ if (load_policy(&enforce) == 0 ) {
++ execv(myname, argv);
++ } else {
++ if (enforce)
++ /* SELinux in enforcing mode but load_policy failed */
++ exit(1);
++ }
++ }
++#endif
++
+ /* Start booting. */
+ argv0 = argv[0];
+ argv[1] = NULL;
+--- sysvinit-2.85/src/Makefile.selinux 2004-02-10 14:34:18.413598203 -0500
++++ sysvinit-2.85/src/Makefile 2004-02-10 14:34:18.552582377 -0500
+@@ -32,7 +32,7 @@
+ all: $(PROGS)
+
+ init: init.o init_utmp.o
+- $(CC) $(LDFLAGS) $(STATIC) -o $@ init.o init_utmp.o
++ $(CC) $(LDFLAGS) $(STATIC) -o $@ init.o init_utmp.o -lselinux
+
+ halt: halt.o ifdown.o hddown.o utmp.o reboot.h
+ $(CC) $(LDFLAGS) -o $@ halt.o ifdown.o hddown.o utmp.o
+@@ -62,7 +62,7 @@
+ $(CC) $(LDFLAGS) -o $@ bootlogd.o
+
+ init.o: init.c init.h set.h reboot.h
+- $(CC) -c $(CFLAGS) init.c
++ $(CC) -c $(CFLAGS) -DWITH_SELINUX init.c
+
+ utmp.o: utmp.c init.h
+ $(CC) -c $(CFLAGS) utmp.c
diff --git a/sys-apps/sysvinit/sysvinit-2.84.ebuild b/sys-apps/sysvinit/sysvinit-2.84.ebuild
new file mode 100644
index 000000000000..9f0f6d7224f9
--- /dev/null
+++ b/sys-apps/sysvinit/sysvinit-2.84.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/sysvinit/sysvinit-2.84.ebuild,v 1.1 2004/06/29 19:32:50 agriffis Exp $
+
+DESCRIPTION="/sbin/init - parent of all processes"
+HOMEPAGE="http://freshmeat.net/projects/sysvinit/"
+SRC_URI="ftp://ftp.cistron.nl/pub/people/miquels/software/${P}.tar.gz
+ ftp://sunsite.unc.edu/pub/Linux/system/daemons/init/${P}.tar.gz"
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~x86 ~ppc ~sparc ~mips ~alpha ~arm ~hppa ~amd64 ~ia64 ~ppc64 ~s390"
+IUSE="selinux"
+
+DEPEND="virtual/os-headers
+ selinux? ( sys-libs/libselinux )"
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}/src || die
+
+ # Note that if sysvinit is ever built with USE=build, need to
+ # refrain from building sulogin as it needs libcrypt which is
+ # not in the build image:
+ # sed -i -e '/^PROGS/s/ sulogin//' Makefile || die
+
+ # Selinux patch
+ if use selinux; then
+ if has_version '>=sys-libs/libselinux-1.6'; then
+ epatch ${FILESDIR}/sysvinit-${SVIV}-selinux1.patch
+ else
+ epatch ${FILESDIR}/sysvinit-${SVIV}-selinux.patch
+ fi
+ fi
+}
+
+src_compile() {
+ cd ${S}/src
+ emake CC="${CC:-gcc}" LD="${CC:-gcc}" \
+ LDFLAGS="${LDFLAGS}" CFLAGS="${CFLAGS} -D_GNU_SOURCE" || die
+}
+
+src_install() {
+ cd ${S}/src
+ into /
+ dosbin init halt killall5 runlevel shutdown sulogin
+ dosym init /sbin/telinit
+ dobin last mesg utmpdump wall
+ dosym killall5 /sbin/pidof
+ dosym halt /sbin/reboot
+ dosym halt /sbin/poweroff
+ dosym last /bin/lastb
+ insinto /usr/include
+ doins initreq.h
+
+ # sysvinit docs
+ cd ${S}
+ doman man/*.[1-9]
+ dodoc COPYRIGHT README doc/*
+
+ # install our inittab
+ insinto /etc
+ doins ${FILESDIR}/inittab || die
+
+ # Add serial console for arches that typically have it
+ case ${ARCH} in
+ sparc|mips|hppa|alpha|ia64)
+ sed -i -e \
+ 's"# TERMINALS"# SERIAL CONSOLE\nc0:12345:respawn:/sbin/agetty 9600 ttyS0 vt100\n\n&"' \
+ ${D}/etc/inittab || die
+ ;;
+ esac
+}