Package: sysvinit
Version: 2.85
Author: Guillem Jover <guillem@debian.org>
Status: not-sent
Description:
 Port to GNU variants.
 Extract klog data.

diff -Naur sysvinit-2.85/debian/initscripts/etc/init.d/bootmisc.sh sysvinit-2.85+gnu/debian/initscripts/etc/init.d/bootmisc.sh
--- sysvinit-2.85/debian/initscripts/etc/init.d/bootmisc.sh	2004-05-17 06:32:36.000000000 +0200
+++ sysvinit-2.85+gnu/debian/initscripts/etc/init.d/bootmisc.sh	2004-05-17 05:31:41.000000000 +0200
@@ -55,7 +55,15 @@
 #
 #	Save kernel messages in /var/log/dmesg
 #
-dmesg -s 65536 > /var/log/dmesg
+if [ `uname -s` = GNU ]
+then
+	dd if=/dev/klog of=/var/log/dmesg
+	dmesg_pid=$!
+	sleep 1
+	kill $dmesg_pid
+else
+	dmesg -s 65536 > /var/log/dmesg
+fi
 
 #
 #	Remove ".clean" files.
diff -Naur sysvinit-2.85/debian/initscripts/etc/init.d/checkroot.sh sysvinit-2.85+gnu/debian/initscripts/etc/init.d/checkroot.sh
--- sysvinit-2.85/debian/initscripts/etc/init.d/checkroot.sh	2004-05-17 06:32:36.000000000 +0200
+++ sysvinit-2.85+gnu/debian/initscripts/etc/init.d/checkroot.sh	2004-05-17 05:31:41.000000000 +0200
@@ -33,7 +33,7 @@
 #	performed (the following fsck is a good example of such activity :).
 #	Only needed for kernels < 2.4.
 #
-if [ -x /sbin/update ]
+if [ -x /sbin/update ] && [ `uname -s` = Linux ]
 then
 	case `uname -r` in
 		0.*|1.*|2.[0123].*)
@@ -94,8 +94,8 @@
 #	before fsck, since fsck can be quite memory-hungry.
 #
 doswap=no
-case "`uname -r`" in
-	2.[0123].*)
+case "`uname -s`:`uname -r`" in
+	Linux:2.[0123].*)
 		if [ $swap_on_md = yes ] && grep -qs resync /proc/mdstat
 		then
 			[ "$VERBOSE" != no ] &&
@@ -209,7 +209,7 @@
 		dumb|network|unknown|"")
 			spinner="" ;;
 	esac
-	[ `uname -m` = s390 ] && spinner="" # This should go away
+	[ `uname -sm` = "Linux s390" ] && spinner="" # This should go away
 
 	echo "Checking root file system..."
 	fsck $spinner $force $fix -t $roottype $rootdev
diff -Naur sysvinit-2.85/debian/initscripts/etc/init.d/mountvirtfs sysvinit-2.85+gnu/debian/initscripts/etc/init.d/mountvirtfs
--- sysvinit-2.85/debian/initscripts/etc/init.d/mountvirtfs	2004-05-17 06:32:36.000000000 +0200
+++ sysvinit-2.85+gnu/debian/initscripts/etc/init.d/mountvirtfs	2004-05-17 05:31:41.000000000 +0200
@@ -32,7 +32,7 @@
 	TYPE=
 	if [ $1 = proc ]
 	then
-		TYPE=proc
+		TYPE=$procfs
 	elif egrep -qs "$1\$" /proc/filesystems
 	then
 		TYPE=$1
diff -Naur sysvinit-2.85/debian/initscripts/etc/init.d/rcArch sysvinit-2.85+gnu/debian/initscripts/etc/init.d/rcArch
--- sysvinit-2.85/debian/initscripts/etc/init.d/rcArch	1970-01-01 01:00:00.000000000 +0100
+++ sysvinit-2.85+gnu/debian/initscripts/etc/init.d/rcArch	2004-05-17 05:31:41.000000000 +0200
@@ -0,0 +1,15 @@
+#! /bin/sh
+#
+# rcArch	Setup arch specific options.
+#
+
+case `uname -s`
+in
+	Linux|GNU)
+		procfs="proc"
+		;;
+	*FreeBSD)
+		procfs="procfs"
+		;;
+esac
+
diff -Naur sysvinit-2.85/debian/initscripts/etc/init.d/single sysvinit-2.85+gnu/debian/initscripts/etc/init.d/single
--- sysvinit-2.85/debian/initscripts/etc/init.d/single	2004-05-17 06:32:35.000000000 +0200
+++ sysvinit-2.85+gnu/debian/initscripts/etc/init.d/single	2004-05-17 05:31:41.000000000 +0200
@@ -17,7 +17,7 @@
 echo "done."
 
 # We start update here, since we just killed it.
-if [ -x /sbin/update ]
+if [ -x /sbin/update ] && [ `uname -s` = Linux ]
 then
 	case `uname -r` in
 		0.*|1.*|2.[0123].*)
diff -Naur sysvinit-2.85/debian/initscripts/etc/init.d/umountfs sysvinit-2.85+gnu/debian/initscripts/etc/init.d/umountfs
--- sysvinit-2.85/debian/initscripts/etc/init.d/umountfs	2004-05-17 06:32:36.000000000 +0200
+++ sysvinit-2.85+gnu/debian/initscripts/etc/init.d/umountfs	2004-05-17 05:31:41.000000000 +0200
@@ -7,6 +7,8 @@
 
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
+. /etc/init.d/rcArch
+
 echo -n "Deactivating swap..."
 umount -ttmpfs -a -r
 swapoff -a
@@ -16,7 +18,7 @@
 #	Umount all filesystems except the virtual ones.
 #
 echo -n "Unmounting local filesystems..."
-umount -tnoproc,nodevfs,nosysfs,nousbfs,nousbdevfs,nodevpts -d -a -r
+umount -tno$procfs,nodevfs,nosysfs,nousbfs,nousbdevfs,nodevpts -d -a -r
 echo "done."
 
 # This is superfluous.
diff -Naur sysvinit-2.85/debian/initscripts/etc/init.d/umountnfs.sh sysvinit-2.85+gnu/debian/initscripts/etc/init.d/umountnfs.sh
--- sysvinit-2.85/debian/initscripts/etc/init.d/umountnfs.sh	2004-05-17 06:32:36.000000000 +0200
+++ sysvinit-2.85+gnu/debian/initscripts/etc/init.d/umountnfs.sh	2004-05-17 05:31:41.000000000 +0200
@@ -11,11 +11,13 @@
 
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
-case "`uname -r`" in
-	[01].*|2.[01].*)
+. /etc/init.d/rcArch
+
+case "`uname -s`:`uname -r`" in
+	Linux:[01].*|Linux:2.[01].*)
 		FLAGS=""
 		;;
-	2.[23].*|2.4.?|2.4.?-*|2.4.10|2.4.10-*)
+	Linux:2.[23].*|Linux:2.4.?|Linux:2.4.?-*|Linux:2.4.10|Linux:2.4.10-*)
 		FLAGS="-f"
 		;;
 	*)
@@ -48,7 +50,7 @@
 			nfs|nfs4|smbfs|ncpfs|coda)
 				DIRS="$DIR $DIRS"
 				;;
-			proc|devfs|devpts|usbfs|usbdevfs|sysfs)
+			$procfs|devfs|devpts|usbfs|usbdevfs|sysfs)
 				DIRS="$DIR $DIRS"
 				;;
 		esac
diff -Naur sysvinit-2.85/debian/mountdeps sysvinit-2.85+gnu/debian/mountdeps
--- sysvinit-2.85/debian/mountdeps	2004-05-17 06:32:34.000000000 +0200
+++ sysvinit-2.85+gnu/debian/mountdeps	2004-05-17 05:31:41.000000000 +0200
@@ -7,6 +7,9 @@
 	*FreeBSD)
 		echo 'mount:Depends=not+linux-gnu'
 		;;
+	GNU)
+		echo 'mount:Depends=hurd'
+		;;
 	*)
 		echo 'mount:Depends=mount (>= 2.11l-1)'
 		;;
diff -Naur sysvinit-2.85/debian/share/inittab.gnu sysvinit-2.85+gnu/debian/share/inittab.gnu
--- sysvinit-2.85/debian/share/inittab.gnu	1970-01-01 01:00:00.000000000 +0100
+++ sysvinit-2.85+gnu/debian/share/inittab.gnu	2004-05-17 05:31:41.000000000 +0200
@@ -0,0 +1,69 @@
+# /etc/inittab: init(8) configuration.
+# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $
+
+# The default runlevel.
+id:2:initdefault:
+
+# Boot-time system configuration/initialization script.
+# This is run first except when booting in emergency (-b) mode.
+si::sysinit:/etc/init.d/rcS
+
+# What to do in single-user mode.
+~~:S:wait:/sbin/sulogin
+
+# /etc/init.d executes the S and K scripts upon change
+# of runlevel.
+#
+# Runlevel 0 is halt.
+# Runlevel 1 is single-user.
+# Runlevels 2-5 are multi-user.
+# Runlevel 6 is reboot.
+
+l0:0:wait:/etc/init.d/rc 0
+l1:1:wait:/etc/init.d/rc 1
+l2:2:wait:/etc/init.d/rc 2
+l3:3:wait:/etc/init.d/rc 3
+l4:4:wait:/etc/init.d/rc 4
+l5:5:wait:/etc/init.d/rc 5
+l6:6:wait:/etc/init.d/rc 6
+# Normally not reached, but fallthrough in case of emergency.
+z6:6:respawn:/sbin/sulogin
+
+# What to do when CTRL-ALT-DEL is pressed.
+ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
+
+# Action on special keypress (ALT-UpArrow).
+#kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work."
+
+# What to do when the power fails/returns.
+pf::powerwait:/etc/init.d/powerfail start
+pn::powerfailnow:/etc/init.d/powerfail now
+po::powerokwait:/etc/init.d/powerfail stop
+
+# /libexec/getty invocations for the runlevels.
+#
+# The "id" field MUST be the same as the last
+# characters of the device (after "tty").
+#
+# Format:
+#  <id>:<runlevels>:<action>:<process>
+#
+# Note that on most Debian systems tty7 is used by the X Window System,
+# so if you want to add more getty's go ahead but skip tty7 if you run X.
+#
+1:2345:respawn:/libexec/getty 38400 tty1
+2:23:respawn:/libexec/getty 38400 tty2
+3:23:respawn:/libexec/getty 38400 tty3
+4:23:respawn:/libexec/getty 38400 tty4
+5:23:respawn:/libexec/getty 38400 tty5
+6:23:respawn:/libexec/getty 38400 tty6
+
+# Example how to put a getty on a serial line (for a terminal)
+#
+#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
+#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100
+
+# Example how to put a getty on a modem line.
+#
+#T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3
+
diff -Naur sysvinit-2.85/src/bootlogd.c sysvinit-2.85+gnu/src/bootlogd.c
--- sysvinit-2.85/src/bootlogd.c	2004-05-17 06:32:40.000000000 +0200
+++ sysvinit-2.85+gnu/src/bootlogd.c	2004-05-17 05:39:29.000000000 +0200
@@ -41,7 +41,9 @@
 #include <fcntl.h>
 #include <pty.h>
 #include <ctype.h>
+#ifdef __linux__
 #include <sys/mount.h>
+#endif
 
 char *Version = "@(#) bootlogd 2.86 12-Jan-2004 miquels@cistron.nl";
 
@@ -231,6 +233,7 @@
 	if (errno != ENOIOCTLCMD) return -1;
 #endif
 
+#ifdef __linux__
 	/*
 	 *	Read /proc/cmdline.
 	 */
@@ -286,6 +289,7 @@
 	}
 
 	if (r == 0) return r;
+#endif
 
 	/*
 	 *	Okay, no console on the command line -
diff -Naur sysvinit-2.85/src/reboot.h sysvinit-2.85+gnu/src/reboot.h
--- sysvinit-2.85/src/reboot.h	2004-05-17 06:32:40.000000000 +0200
+++ sysvinit-2.85+gnu/src/reboot.h	2004-05-17 05:32:46.000000000 +0200
@@ -22,14 +22,12 @@
 #  define BMAGIC_REBOOT  RB_AUTOBOOT
 #  define BMAGIC_HALT    RB_HALT
 #  define BMAGIC_POWEROFF RB_POWEROFF
-#elif defined(__NetBSD_kernel__)
+#else
 #  define BMAGIC_HARD    BMAGIC_REBOOT
 #  define BMAGIC_SOFT    BMAGIC_REBOOT
 #  define BMAGIC_REBOOT  RB_AUTOBOOT
 #  define BMAGIC_HALT    RB_HALT
 #  define BMAGIC_POWEROFF RB_HALT
-#else
-#  error Unsupported kernel
 #endif
 
 #if defined(__GLIBC__)
