diff -urNh sysvinit-2.84/debian/control sysvinit-new/debian/control
--- sysvinit-2.84/debian/control	Sat Jun 29 14:38:53 2002
+++ sysvinit-new/debian/control	Fri Jun 14 10:25:56 2002
@@ -9,7 +9,7 @@
 Architecture: any
 Pre-depends: ${shlibs:Depends}
 Conflicts: last, file-rc (<= 0.5.7), kbd (<< 0.95-2), mdutils (<< 0.35-9)
-Depends: dpkg (>= 1.4.0.21), mount (>= 2.7i-1), util-linux (>= 2.9t-2), e2fsprogs (>= 1.15-1)
+Depends: dpkg (>= 1.4.0.21)
 Replaces: last, bsdutils (<=2.0-2), dpkg (<< 1.9.17)
 Description: System-V like init.
  Init is the first program to run after your system is booted, and
diff -urNh sysvinit-2.84/debian/etc/init.d/bootmisc.sh sysvinit-new/debian/etc/init.d/bootmisc.sh
--- sysvinit-2.84/debian/etc/init.d/bootmisc.sh	Sat Jun 29 14:38:53 2002
+++ sysvinit-new/debian/etc/init.d/bootmisc.sh	Fri Jun 14 10:25:56 2002
@@ -83,7 +83,7 @@
 #
 # Save kernel messages in /var/log/dmesg
 #
-dmesg -s 65536 > /var/log/dmesg
+dmesg > /var/log/dmesg
 
 : exit 0
 
diff -urNh sysvinit-2.84/debian/etc/init.d/checkfs.sh sysvinit-new/debian/etc/init.d/checkfs.sh
--- sysvinit-2.84/debian/etc/init.d/checkfs.sh	Sat Jun 29 14:38:53 2002
+++ sysvinit-new/debian/etc/init.d/checkfs.sh	Wed Jun 19 08:05:01 2002
@@ -29,7 +29,7 @@
     esac
     [ `uname -m` = s390 ] && spinner="" # This should go away
     echo "Checking all file systems..."
-    fsck $spinner -R -A $fix $force
+    fsck -p 
     if [ $? -gt 1 ]
     then
       echo
diff -urNh sysvinit-2.84/debian/etc/init.d/checkroot.sh sysvinit-new/debian/etc/init.d/checkroot.sh
--- sysvinit-2.84/debian/etc/init.d/checkroot.sh	Sat Jun 29 14:38:53 2002
+++ sysvinit-new/debian/etc/init.d/checkroot.sh	Fri Jun 14 10:25:56 2002
@@ -78,6 +78,7 @@
 # before fsck, since fsck can be quite memory-hungry.
 #
 doswap=no
+[ -d /proc/1 ] || mount /proc
 case "`uname -r`" in
 	2.[0123].*)
 		if [ $swap_on_md = yes ] && grep -qs resync /proc/mdstat
@@ -108,7 +109,7 @@
   #
   # Ensure that root is quiescent and read-only before fsck'ing.
   #
-  mount -n -o remount,ro /
+  mount -o update,ro /
   if [ $? = 0 ]
   then
     if [ -f /forcefsck ]
@@ -121,15 +122,15 @@
     then
 	fix="-y"
     else
-	fix="-a"
+	fix=""
     fi
-    spinner="-C"
+#    spinner="-C"
     case "$TERM" in
         dumb|network|unknown|"") spinner="" ;;
     esac
     [ `uname -m` = s390 ] && spinner="" # This should go away
-    echo "Checking root file system..."
-    fsck $spinner $force $fix /
+    echo "Checking file systems..."
+    fsck $spinner -p $force $fix /
     #
     # If there was a failure, drop into single-user mode.
     #
@@ -146,7 +147,7 @@
       echo "that the root file system is currently mounted read-only.  To"
       echo "remount it read-write:"
       echo
-      echo "   # mount -n -o remount,rw /"
+      echo "   # mount -uw /"
       echo
       echo "CONTROL-D will exit from this shell and REBOOT the system."
       echo
@@ -166,12 +167,12 @@
 #	is on a ro fs until the remount succeeded. Then clean up old mtabs
 #	and finally write the new mtab.
 #
-mount -n -o remount,$rootmode /
+mount -o update,$rootmode /
 if [ "$rootmode" = rw ]
 then
 	rm -f /etc/mtab~ /etc/nologin
-	: > /etc/mtab
-	mount -f -o remount /
+#	: > /etc/mtab
+	mount -f -o update,$rootmode /
 	mount -f /proc
 	[ "$devfs" ] && grep -q '^devfs /dev' /proc/mounts && mount -f "$devfs"
 fi
diff -urNh sysvinit-2.84/debian/etc/init.d/halt sysvinit-new/debian/etc/init.d/halt
--- sysvinit-2.84/debian/etc/init.d/halt	Sat Jun 29 14:38:53 2002
+++ sysvinit-new/debian/etc/init.d/halt	Fri Jun 14 10:25:56 2002
@@ -20,6 +20,6 @@
 	hddown=""
 fi
 
-halt -d -f -i -p $hddown
+halt -d -f -p $hddown
 
 : exit 0
diff -urNh sysvinit-2.84/debian/etc/init.d/mountall.sh sysvinit-new/debian/etc/init.d/mountall.sh
--- sysvinit-2.84/debian/etc/init.d/mountall.sh	Sat Jun 29 14:38:53 2002
+++ sysvinit-new/debian/etc/init.d/mountall.sh	Fri Jun 14 10:25:56 2002
@@ -11,8 +11,8 @@
 # about this. So we mount "proc" filesystems without -v.
 #
 [ "$VERBOSE" != no ] && echo "Mounting local filesystems..."
-mount -avt nonfs,nosmbfs,noncpfs,noproc
-mount -at proc
+mount -avt nonfs,nosmbfs,noncpfs,noprocfs
+mount -at procfs
 
 #
 # We might have mounted something over /dev, see if /dev/initctl is there.
diff -urNh sysvinit-2.84/debian/etc/init.d/reboot sysvinit-new/debian/etc/init.d/reboot
--- sysvinit-2.84/debian/etc/init.d/reboot	Sat Jun 29 14:38:53 2002
+++ sysvinit-new/debian/etc/init.d/reboot	Fri Jun 14 10:25:56 2002
@@ -8,4 +8,4 @@
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
 echo -n "Rebooting... "
-reboot -d -f -i
+reboot -d -f 
diff -urNh sysvinit-2.84/debian/etc/init.d/umountfs sysvinit-new/debian/etc/init.d/umountfs
--- sysvinit-2.84/debian/etc/init.d/umountfs	Sat Jun 29 14:38:53 2002
+++ sysvinit-new/debian/etc/init.d/umountfs	Fri Jun 14 10:25:56 2002
@@ -12,7 +12,7 @@
   *)            FORCE="-f" ;;
 esac
 
-umount -ttmpfs $FORCE -a -r
+# umount -ttmpfs $FORCE -a -r
 
 echo -n "Deactivating swap... "
 swapoff -a
@@ -20,9 +20,9 @@
 
 # We leave /proc mounted.
 echo -n "Unmounting local filesystems... "
-umount -tnoproc $FORCE -a -r
+umount -tnoprocfs $FORCE -A 
 echo "done."
 
-mount -n -o remount,ro /
+mount -o update,ro /
 
 : exit 0
diff -urNh sysvinit-2.84/debian/etc/init.d/umountnfs.sh sysvinit-new/debian/etc/init.d/umountnfs.sh
--- sysvinit-2.84/debian/etc/init.d/umountnfs.sh	Sat Jun 29 14:38:53 2002
+++ sysvinit-new/debian/etc/init.d/umountnfs.sh	Fri Jun 14 10:25:56 2002
@@ -16,7 +16,7 @@
 halt -w
 
 echo -n "Unmounting remote filesystems... "
-umount -tnfs,smbfs,ncpfs $FORCE -a -r
+umount -tnfs,smbfs,ncpfs $FORCE -a
 echo "done."
 
 : exit 0
diff -urNh sysvinit-2.84/debian/etc/inittab sysvinit-new/debian/etc/inittab
--- sysvinit-2.84/debian/etc/inittab	Sat Jun 29 14:38:53 2002
+++ sysvinit-new/debian/etc/inittab	Fri Jun 14 10:25:56 2002
@@ -51,12 +51,12 @@
 # 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:/sbin/getty 38400 tty1
-2:23:respawn:/sbin/getty 38400 tty2
-3:23:respawn:/sbin/getty 38400 tty3
-4:23:respawn:/sbin/getty 38400 tty4
-5:23:respawn:/sbin/getty 38400 tty5
-6:23:respawn:/sbin/getty 38400 tty6
+1:2345:respawn:/sbin/getty 38400 console 
+2:23:respawn:/sbin/getty 38400 ttyE1
+3:23:respawn:/sbin/getty 38400 ttyE2
+4:23:respawn:/sbin/getty 38400 ttyE3
+5:23:respawn:/sbin/getty 38400 ttyE4
+6:23:respawn:/sbin/getty 38400 ttyE5
 
 # Example how to put a getty on a serial line (for a terminal)
 #
diff -urNh sysvinit-2.84/src/Makefile sysvinit-new/src/Makefile
--- sysvinit-2.84/src/Makefile	Tue Nov  6 11:58:16 2001
+++ sysvinit-new/src/Makefile	Fri Jun 14 10:25:56 2002
@@ -10,7 +10,7 @@
 
 CC	= cc
 CFLAGS	= -Wall -O2 -D_GNU_SOURCE
-LDFLAGS	= -s
+LDFLAGS	= -s -lshadow -lutmp
 STATIC	=
 
 # For Debian we do not build all programs, otherwise we do.
diff -urNh sysvinit-2.84/src/halt.c sysvinit-new/src/halt.c
--- sysvinit-2.84/src/halt.c	Tue Nov 27 12:12:03 2001
+++ sysvinit-new/src/halt.c	Fri Jun 14 10:25:56 2002
@@ -46,6 +46,7 @@
 #include <stdio.h>
 #include <getopt.h>
 #include "reboot.h"
+#include "init.h"
 
 char *Version = "@(#)halt  2.84  27-Nov-2001 miquels@cistron.nl";
 char *progname;
@@ -54,7 +55,9 @@
 #define RUNLVL_PICKY	0 /* Be picky about the runlevel */
 
 extern int ifdown(void);
+#if !defined (__FreeBSD__) && !defined (__NetBSD__)
 extern int hddown(void);
+#endif
 extern void write_wtmp(char *user, char *id, int pid, int type, char *line);
 
 /*
@@ -246,8 +249,10 @@
 	if (do_ifdown)
 		(void)ifdown();
 
+#if !defined (__FreeBSD__) && !defined (__NetBSD__)
 	if (do_hddown)
 		(void)hddown();
+#endif
 
 	if (do_reboot) {
 		init_reboot(BMAGIC_REBOOT);
@@ -255,7 +260,9 @@
 		/*
 		 *	Turn on hard reboot, CTRL-ALT-DEL will reboot now
 		 */
+#if !defined (__FreeBSD__) && !defined (__NetBSD__)
 		init_reboot(BMAGIC_HARD);
+#endif
 
 		/*
 		 *	Stop init; it is insensitive to the signals sent
@@ -277,7 +284,9 @@
 	/*
 	 *	If we return, we (c)ontinued from the kernel monitor.
 	 */
+#if !defined (__FreeBSD__) && !defined (__NetBSD__)
 	init_reboot(BMAGIC_SOFT);
+#endif
 	kill(1, SIGCONT);
 
 	exit(0);
diff -urNh sysvinit-2.84/src/hddown.c sysvinit-new/src/hddown.c
--- sysvinit-2.84/src/hddown.c	Wed Nov  7 15:11:21 2001
+++ sysvinit-new/src/hddown.c	Fri Jun 14 10:25:56 2002
@@ -15,6 +15,7 @@
 
 #include <sys/ioctl.h>
 
+#if !defined (__FreeBSD__) && !defined (__NetBSD__)
 #include <linux/hdreg.h>
 
 #define MAX_DISKS	64
@@ -111,3 +112,4 @@
 }
 #endif
 
+#endif
diff -urNh sysvinit-2.84/src/init.c sysvinit-new/src/init.c
--- sysvinit-2.84/src/init.c	Sat Jun 29 14:38:53 2002
+++ sysvinit-new/src/init.c	Fri Jun 14 10:25:56 2002
@@ -32,7 +32,9 @@
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include <sys/wait.h>
+#if !defined (__FreeBSD__) && !defined (__NetBSD__)
 #include <sys/kd.h>
+#endif
 #include <sys/resource.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -43,6 +45,10 @@
 #include <string.h>
 #include <signal.h>
 #include <termios.h>
+#if defined (__FreeBSD__) || defined (__NetBSD__)
+#define CBAUD	0010017
+#define CBAUDEX	0010000
+#endif
 #include <utmp.h>
 #include <ctype.h>
 #include <stdarg.h>
@@ -418,7 +424,7 @@
 /*
  *	Set the process title.
  */
-int setproctitle(char *fmt, ...)
+int init_setproctitle(char *fmt, ...)
 {
 	va_list ap;
 	int len;
@@ -1820,7 +1826,7 @@
 /*
  *	Attempt to re-exec.
  */
-void re_exec(void)
+void reexec(void)
 {
 	sigset_t mask, oldset;
 	pid_t	pid;
@@ -1915,14 +1921,14 @@
 		runlevel = read_level(level);
 		if (runlevel == 'U') {
 			runlevel = oldlevel;
-			re_exec();
+			reexec();
 		} else {
 			if (oldlevel != 'S' && runlevel == 'S') set_term(0);
 			if (runlevel == '6' || runlevel == '0' ||
 			    runlevel == '1') set_term(0);
 			read_inittab();
 			fail_cancel();
-			setproctitle("init [%c]", runlevel);
+			init_setproctitle("init [%c]", runlevel);
 		}
 	}
 }
@@ -2110,7 +2116,7 @@
 			if (newlevel == 'S') {
 				runlevel = newlevel;
 				/* Not really 'S' but show anyway. */
-				setproctitle("init [S]");
+				init_setproctitle("init [S]");
 			} else
 				runlevel = '*';
 			break;
@@ -2163,7 +2169,7 @@
 		write_utmp_wtmp("runlevel", "~~", runlevel + 256 * oldlevel, RUN_LVL, "~");
 		thislevel = runlevel;
 		prevlevel = oldlevel;
-		setproctitle("init [%c]", runlevel);
+		init_setproctitle("init [%c]", runlevel);
 	}
   }
 }
@@ -2265,13 +2271,13 @@
 #endif
 		if (runlevel == 'U') {
 			runlevel = oldlevel;
-			re_exec();
+			reexec();
 		} else {
 			if (oldlevel != 'S' && runlevel == 'S') set_term(0);
 			if (runlevel == '6' || runlevel == '0' || runlevel == '1') set_term(0);
 			read_inittab();
 			fail_cancel();
-			setproctitle("init [%c]", runlevel);
+			init_setproctitle("init [%c]", runlevel);
 			DELSET(got_signals, SIGHUP);
 		}
 	}
@@ -2319,13 +2325,14 @@
 	 *	Tell the kernel to send us SIGINT when CTRL-ALT-DEL
 	 *	is pressed, and that we want to handle keyboard signals.
 	 */
+#if !defined (__FreeBSD__) && !defined (__NetBSD__)
 	init_reboot(BMAGIC_SOFT);
 	if ((f = open(VT_MASTER, O_RDWR | O_NOCTTY)) >= 0) {
 		(void) ioctl(f, KDSIGACCEPT, SIGWINCH);
 		close(f);
 	} else
 		(void) ioctl(0, KDSIGACCEPT, SIGWINCH);
-
+#endif
 	/*
 	 *	Ignore all signals.
 	 */
@@ -2561,7 +2568,7 @@
 			maxproclen += strlen(argv[f]) + 1;
 		reload = 1;
 		wrote_iosave = 1;
-		setproctitle("init [%c]",runlevel);
+		init_setproctitle("init [%c]",runlevel);
 
 		init_main();
 	}
@@ -2589,7 +2596,7 @@
 	/* Start booting. */
 	argv0 = argv[0];
 	argv[1] = NULL;
-	setproctitle("init boot");
+	init_setproctitle("init boot");
 	init_main(dfl_level);
 
 	/*NOTREACHED*/
diff -urNh sysvinit-2.84/src/last.c sysvinit-new/src/last.c
--- sysvinit-2.84/src/last.c	Wed Jun 13 12:13:21 2001
+++ sysvinit-new/src/last.c	Fri Jun 14 10:25:56 2002
@@ -24,6 +24,9 @@
 #include <stdio.h>
 #include <ctype.h>
 #include <utmp.h>
+#if defined (__FreeBSD__) || defined (__NetBSD__)
+#include <sys/socket.h>
+#endif
 #include <errno.h>
 #include <malloc.h>
 #include <stdlib.h>
diff -urNh sysvinit-2.84/src/reboot.h sysvinit-new/src/reboot.h
--- sysvinit-2.84/src/reboot.h	Wed Sep 24 08:55:52 1997
+++ sysvinit-new/src/reboot.h	Fri Jun 14 10:25:56 2002
@@ -10,14 +10,26 @@
 #  include <sys/reboot.h>
 #endif
 
+#if defined (__FreeBSD__) || defined (__NetBSD__)
+#include <sys/reboot.h>
+#define BMAGIC_REBOOT	RB_AUTOBOOT
+#define BMAGIC_HALT	RB_HALT
+#ifdef __FreeBSD__
+#define BMAGIC_POWEROFF	RB_POWEROFF
+#define init_reboot(magic) reboot(magic)
+#else /* __NetBSD__ */
+#define BMAGIC_POWEROFF RB_POWERDOWN
+#define init_reboot(magic) reboot(magic,NULL)
+#endif /* __FreeBSD__ */
+#else
 #define BMAGIC_HARD	0x89ABCDEF
 #define BMAGIC_SOFT	0
 #define BMAGIC_REBOOT	0x01234567
 #define BMAGIC_HALT	0xCDEF0123
 #define BMAGIC_POWEROFF	0x4321FEDC
-
-#if defined(__GLIBC__)
-  #define init_reboot(magic) reboot(magic)
-#else
-  #define init_reboot(magic) reboot(0xfee1dead, 672274793, magic)
+# if defined(__GLIBC__)
+   #define init_reboot(magic) reboot(magic)
+# else
+   #define init_reboot(magic) reboot(0xfee1dead, 672274793, magic)
+# endif
 #endif
diff -urNh sysvinit-2.84/src/shutdown.c sysvinit-new/src/shutdown.c
--- sysvinit-2.84/src/shutdown.c	Wed Sep  5 10:46:30 2001
+++ sysvinit-new/src/shutdown.c	Fri Jun 14 10:25:56 2002
@@ -190,9 +190,8 @@
 	va_end(ap);
 
 	chdir("/");
-	environ = clean_env;
 
-	execvp(argv[0], argv);
+	execve(argv[0], argv, clean_env);
 	perror(argv[0]);
 	exit(1);
 
diff -urNh sysvinit-2.84/src/sulogin.c sysvinit-new/src/sulogin.c
--- sysvinit-2.84/src/sulogin.c	Tue Jul 31 14:22:07 2001
+++ sysvinit-new/src/sulogin.c	Fri Jun 14 10:25:56 2002
@@ -254,7 +254,11 @@
 
 	tcgetattr(0, &old);
 	tcgetattr(0, &tty);
+#if defined (__FreeBSD__) || defined (__NetBSD__)
+	tty.c_iflag &= ~(IXON|IXOFF|IXANY);
+#else
 	tty.c_iflag &= ~(IUCLC|IXON|IXOFF|IXANY);
+#endif
 	tty.c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHONL|TOSTOP);
 	tcsetattr(0, TCSANOW, &tty);
 
