diff options
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/sysvinit/sysvinit-2.86/sysvinit-2.86.patch | 4880 | ||||
| -rw-r--r-- | packages/sysvinit/sysvinit_2.86.bb | 6 |
2 files changed, 3 insertions, 4883 deletions
diff --git a/packages/sysvinit/sysvinit-2.86/sysvinit-2.86.patch b/packages/sysvinit/sysvinit-2.86/sysvinit-2.86.patch deleted file mode 100644 index b83f525c3e..0000000000 --- a/packages/sysvinit/sysvinit-2.86/sysvinit-2.86.patch +++ /dev/null @@ -1,4880 +0,0 @@ -diff -urNd -urNd sysvinit-2.85/COPYRIGHT sysvinit-2.86/COPYRIGHT ---- sysvinit-2.85/COPYRIGHT 2003-04-15 03:45:44.000000000 -0500 -+++ sysvinit-2.86/COPYRIGHT 2004-07-30 07:12:12.000000000 -0500 -@@ -1,4 +1,4 @@ --Sysvinit is Copyright (C) 1991-2003 Miquel van Smoorenburg -+Sysvinit is Copyright (C) 1991-2004 Miquel van Smoorenburg - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by -diff -urNd -urNd sysvinit-2.85/doc/Changelog sysvinit-2.86/doc/Changelog ---- sysvinit-2.85/doc/Changelog 2003-04-15 09:37:58.000000000 -0500 -+++ sysvinit-2.86/doc/Changelog 2004-07-30 07:15:06.000000000 -0500 -@@ -1,3 +1,29 @@ -+sysvinit (2.86) cistron; urgency=low -+ -+ * Fixed up bootlogd to read /proc/cmdline. Also keep an internal -+ linebuffer to process \r, \t and ^H. It is becoming useable. -+ * Applied trivial OWL patches -+ * Block signals in syslog(), since syslog() is not re-entrant -+ (James Olin Oden <joden@malachi.lee.k12.nc.us>, redhat bug #97534) -+ * Minor adjustements so that sysvinit compiles on the Hurd -+ * killall5 now skips kernel threads -+ * Inittab entries with both 'S' and other runlevels were broken. -+ Fix by Bryan Kadzban <bryan@kadzban.is-a-geek.net> -+ * Changed initreq.h to be more flexible and forwards-compatible. -+ * You can now through /dev/initctl set environment variables in -+ init that will be inherited by its children. For now, only -+ variables prefixed with INIT_ can be set and the maximum is -+ 16 variables. There's also a length limit due to the size -+ of struct init_request, so it should be safe from abuse. -+ * Option -P and -H to shutdown set INIT_HALT=POWERDOWN and -+ INIT_HALT=HALT as environment variables as described above -+ * Add "mountpoint" utility. -+ * Slightly better algorithm in killall5.c:pidof() -+ * Added some patches from fedora-core (halt-usage, last -t, -+ sulogin-message, user-console) -+ -+ -- Miquel van Smoorenburg <miquels@cistron.nl> Fri, 30 Jul 2004 14:14:58 +0200 -+ - sysvinit (2.85) cistron; urgency=low - - * Add IPv6 support in last(1) -diff -urNd -urNd sysvinit-2.85/doc/Install sysvinit-2.86/doc/Install ---- sysvinit-2.85/doc/Install 2003-04-15 03:46:49.000000000 -0500 -+++ sysvinit-2.86/doc/Install 2004-07-30 07:15:40.000000000 -0500 -@@ -1,5 +1,5 @@ - -- README for the System V style init, version 2.85 -+ README for the System V style init, version 2.86 - - init, shutdown, halt, reboot, wall, last, mesg, runlevel, - killall5, pidof, sulogin. -diff -urNd -urNd sysvinit-2.85/doc/bootlogd.README sysvinit-2.86/doc/bootlogd.README ---- sysvinit-2.85/doc/bootlogd.README 2000-09-12 16:54:31.000000000 -0500 -+++ sysvinit-2.86/doc/bootlogd.README 2004-06-09 07:47:45.000000000 -0500 -@@ -1,10 +1,12 @@ - - bootlogd: a way to capture all console output during bootup -- in a logfile. ** PROOF OF CONCEPT IMPLEMENTATION ** -+ in a logfile. - --- bootlogd opens /dev/console --- finds out what the real console is with an ioctl() --- then opens the real console -+- bootlogd opens /dev/console and finds out what the real console is -+ with an ioctl() if TIOCCONS is available -+- otherwise bootlogd tries to parse /proc/cmdline for console= -+ kernel command line arguments -+- then opens the (most probable) real console - - allocates a pty pair - - redirects console I/O to the pty pair - - then goes in a loop reading from the pty, writing to the real -diff -urNd -urNd sysvinit-2.85/doc/sysvinit-2.85.lsm sysvinit-2.86/doc/sysvinit-2.85.lsm ---- sysvinit-2.85/doc/sysvinit-2.85.lsm 2003-04-18 16:04:12.000000000 -0500 -+++ sysvinit-2.86/doc/sysvinit-2.85.lsm 2004-06-09 07:47:45.000000000 -0500 -@@ -1,7 +1,7 @@ - Begin3 - Title: sysvinit and utilities - Version: 2.85 --Entered-Date: 18APR2003 -+Entered-Date: 15APR2003 - Description: This is the Linux System V init. - This version can be compiled with glibc 2.0.6 and up. - Author: miquels@cistron.nl (Miquel van Smoorenburg) -diff -urNd -urNd sysvinit-2.85/doc/sysvinit-2.86.lsm sysvinit-2.86/doc/sysvinit-2.86.lsm ---- sysvinit-2.85/doc/sysvinit-2.86.lsm 1969-12-31 18:00:00.000000000 -0600 -+++ sysvinit-2.86/doc/sysvinit-2.86.lsm 2004-07-31 08:35:28.000000000 -0500 -@@ -0,0 +1,14 @@ -+Begin3 -+Title: sysvinit and utilities -+Version: 2.86 -+Entered-Date: 30JUL2004 -+Description: This is the Linux System V init. -+ This version can be compiled with glibc 2.0.6 and up. -+Author: miquels@cistron.nl (Miquel van Smoorenburg) -+Primary-Site: ftp.cistron.nl /pub/people/miquels/software -+ 92K sysvinit-2.86.tar.gz -+Alternate-Site: sunsite.unc.edu /pub/Linux/system/daemons/init -+ 92K sysvinit-2.86.tar.gz -+Copying-Policy: GPL -+Keywords: init shutdown halt reboot -+End -diff -urNd -urNd sysvinit-2.85/man/bootlogd.8 sysvinit-2.86/man/bootlogd.8 ---- sysvinit-2.85/man/bootlogd.8 1969-12-31 18:00:00.000000000 -0600 -+++ sysvinit-2.86/man/bootlogd.8 2004-06-09 07:47:45.000000000 -0500 -@@ -0,0 +1,39 @@ -+.TH BOOTLOGD 8 "Jul 21, 2003" "" "Linux System Administrator's Manual" -+.SH NAME -+bootlogd \- record boot messages -+.SH SYNOPSIS -+.B /sbin/bootlogd -+.RB [ \-d ] -+.RB [ \-r ] -+.RB [ \-v ] -+.RB [ " -l logfile " ] -+.RB [ " -p pidfile " ] -+.SH DESCRIPTION -+\fBBootlogd\fP runs in the background and copies all strings sent to the -+\fI/dev/console\fP device to a logfile. If the logfile is not accessible, -+the messages will be buffered in-memory until it is. -+.SH OPTIONS -+.IP \fB\-d\fP -+Do not fork and run in the background. -+.IP \fB\-r\fP -+If there is an existing logfile called \fIlogfile\fP rename it to -+\fIlogfile~\fP unless \fIlogfile~\fP already exists. -+.IP \fB\-v\fP -+Show version. -+.IP \fB\-l logfile\fP -+Log to this logfile. The default is \fI/var/log/boot\fP. -+.IP \fB\-p pidfile\fP -+Put process-id in this file. The default is no pidfile. -+.SH BUGS -+Bootlogd works by redirecting the console output from the console -+device. It copies that output to the real console device and a -+logfile. There is no standard way to find out the real console device -+if you have a new-style \fI/dev/console\fP device (major 5, minor 1). -+\fBBootlogd\fP tries to parse the kernel command line, looking for -+console= lines and deducts the real console device from that. If that -+syntax is ever changed by the kernel, or a console-type is used -+bootlogd does not know about, bootlogd will not work. -+.SH AUTHOR -+Miquel van Smoorenburg, miquels@cistron.nl -+.SH "SEE ALSO" -+.BR dmesg (8) -diff -urNd -urNd sysvinit-2.85/man/init.8 sysvinit-2.86/man/init.8 ---- sysvinit-2.85/man/init.8 2003-04-18 16:05:03.000000000 -0500 -+++ sysvinit-2.86/man/init.8 2004-07-29 06:21:31.000000000 -0500 -@@ -1,6 +1,6 @@ - .\"{{{}}} - .\"{{{ Title --.TH INIT 8 "18 April 2003" "" "Linux System Administrator's Manual" -+.TH INIT 8 "29 Jul 2004" "" "Linux System Administrator's Manual" - .\"}}} - .\"{{{ Name - .SH NAME -@@ -160,7 +160,7 @@ - .SH ENVIRONMENT - \fBInit\fP sets the following environment variables for all its children: - .IP \fBPATH\fP --\fI/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin\fP -+\fI/bin:/usr/bin:/sbin:/usr/sbin\fP - .IP \fBINIT_VERSION\fP - As the name says. Useful to determine if a script runs directly from \fBinit\fP. - .IP \fBRUNLEVEL\fP -diff -urNd -urNd sysvinit-2.85/man/initscript.5 sysvinit-2.86/man/initscript.5 ---- sysvinit-2.85/man/initscript.5 1999-12-24 16:31:21.000000000 -0600 -+++ sysvinit-2.86/man/initscript.5 2004-06-09 07:47:45.000000000 -0500 -@@ -1,4 +1,4 @@ --.TH INITSCRIPT 5 "December 24, 1999" "" "Linux System Administrator's Manual" -+.TH INITSCRIPT 5 "July 10, 2003" "" "Linux System Administrator's Manual" - .SH NAME - initscript \- script that executes inittab commands. - .SH SYNOPSIS -@@ -40,6 +40,12 @@ - - .sp - .RE -+.SH NOTES -+This script is not meant as startup script for daemons or somesuch. -+It has nothing to do with a \fIrc.local\fP style script. It's just -+a handler for things executed from \fB/etc/inittab\fP. Experimenting -+with this can make your system un(re)bootable. -+.RE - .SH FILES - /etc/inittab, - /etc/initscript. -diff -urNd -urNd sysvinit-2.85/man/killall5.8 sysvinit-2.86/man/killall5.8 ---- sysvinit-2.85/man/killall5.8 1997-05-27 05:34:21.000000000 -0500 -+++ sysvinit-2.86/man/killall5.8 2004-06-09 07:47:45.000000000 -0500 -@@ -1,4 +1,4 @@ --.TH KILLALL5 8 "27 May 1997" "" "Linux System Administrator's Manual" -+.TH KILLALL5 8 "04 Nov 2003" "" "Linux System Administrator's Manual" - .SH NAME - killall5 -- send a signal to all processes. - .SH SYNOPSIS -@@ -7,9 +7,9 @@ - .SH DESCRIPTION - .B killall5 - is the SystemV killall command. It sends a signal to all processes except --the processes in its own session, so it won't kill the shell that is --running the script it was called from. Its primary (only) use is in the --\fBrc\fP scripts found in the /etc/init.d directory. -+kernel threads and the processes in its own session, so it won't kill -+the shell that is running the script it was called from. Its primary -+(only) use is in the \fBrc\fP scripts found in the /etc/init.d directory. - .SH SEE ALSO - .BR halt (8), - .BR reboot (8) -diff -urNd -urNd sysvinit-2.85/man/last.1 sysvinit-2.86/man/last.1 ---- sysvinit-2.85/man/last.1 1999-07-29 05:50:34.000000000 -0500 -+++ sysvinit-2.86/man/last.1 2004-07-30 06:39:18.000000000 -0500 -@@ -1,6 +1,6 @@ - .\"{{{}}} - .\"{{{ Title --.TH LAST,LASTB 1 "Jul 29, 1999" "" "Linux System Administrator's Manual" -+.TH LAST,LASTB 1 "Jul 31, 2004" "" "Linux System Administrator's Manual" - .\"}}} - .\"{{{ Name - .SH NAME -@@ -14,6 +14,7 @@ - .RB "[ \-\fBn\fP \fInum\fP ]" - .RB [ \-adiox ] - .RB "[ \-\fBf\fP \fIfile\fP ]" -+.RB "[ \-\fBt\fP \fIYYYYMMDDHHMMSS\fP ]" - .RI [ name... ] - .RI [ tty... ] - .br -@@ -54,6 +55,11 @@ - This is a count telling \fBlast\fP how many lines to show. - .IP "\fB\-n\fP \fInum\fP" - The same. -+.IP "\fB\-t\fP \fIYYYYMMDDHHMMSS\fP" -+Display the state of logins as of the specified time. This is -+useful, e.g., to determine easily who was logged in at a particular -+time -- specify that time with \fB\-t\fP and look for "still logged -+in". - .IP \fB\-R\fP - Suppresses the display of the hostname field. - .IP \fB\-a\fP -diff -urNd -urNd sysvinit-2.85/man/mesg.1 sysvinit-2.86/man/mesg.1 ---- sysvinit-2.85/man/mesg.1 2001-02-26 06:01:10.000000000 -0600 -+++ sysvinit-2.86/man/mesg.1 2004-06-09 07:47:45.000000000 -0500 -@@ -27,7 +27,7 @@ - If no option is given, \fBmesg\fP prints out the current access state of your - terminal. - .PP NOTES --\fBMesg\fP assumes that it's standard input is connected to your -+\fBMesg\fP assumes that its standard input is connected to your - terminal. That also means that if you are logged in multiple times, - you can get/set the mesg status of other sessions by using redirection. - For example "mesg n < /dev/pts/46". -diff -urNd -urNd sysvinit-2.85/man/mountpoint.1 sysvinit-2.86/man/mountpoint.1 ---- sysvinit-2.85/man/mountpoint.1 1969-12-31 18:00:00.000000000 -0600 -+++ sysvinit-2.86/man/mountpoint.1 2004-06-09 07:47:45.000000000 -0500 -@@ -0,0 +1,37 @@ -+.TH MOUNTPOINT 8 "Mar 15, 2004" "" "Linux System Administrator's Manual" -+.SH NAME -+mountpoint \- see if a directory is a mountpoint -+.SH SYNOPSIS -+.B /bin/mountpoint -+.RB [ \-q ] -+.RB [ \-d ] -+.I /path/to/directory -+.br -+.B /bin/mountpoint -+.RB \-x -+.I /dev/device -+.SH DESCRIPTION -+\fBMountpoint\fP checks if the directory is a mountpoint. -+ -+.SH OPTIONS -+.IP \fB\-q\fP -+Be quiet - don't print anything. -+.IP \fB\-d\fP -+Print major/minor device number of the filesystem on stdout. -+.IP \fB\-x\fP -+Print major/minor device number of the blockdevice on stdout. -+.SH EXIT STATUS -+Zero if the directory is a mountpoint, non-zero if not. -+.SH NOTES -+Symbolic links are not followed, except when the \fB-x\fP option is -+used. To force following symlinks, add a trailing slash to the -+path of the directory. -+.PP -+The name of the command is misleading when the -x option is used, -+but the option is useful for comparing if a directory and a device -+match up, and there is no other command that can print the info easily. -+.PP -+.SH AUTHOR -+Miquel van Smoorenburg, miquels@cistron.nl -+.SH "SEE ALSO" -+.BR stat (1) -diff -urNd -urNd sysvinit-2.85/man/shutdown.8 sysvinit-2.86/man/shutdown.8 ---- sysvinit-2.85/man/shutdown.8 2001-10-02 16:27:50.000000000 -0500 -+++ sysvinit-2.86/man/shutdown.8 2004-06-09 07:47:45.000000000 -0500 -@@ -1,6 +1,6 @@ - .\"{{{}}} - .\"{{{ Title --.TH SHUTDOWN 8 "Juli 31, 2001" "" "Linux System Administrator's Manual" -+.TH SHUTDOWN 8 "November 12, 2003" "" "Linux System Administrator's Manual" - .\"}}} - .\"{{{ Name - .SH NAME -@@ -11,7 +11,7 @@ - .B /sbin/shutdown - .RB [ \-t - .IR sec ] --.RB [ \-arkhncfF ] -+.RB [ \-arkhncfFHP ] - .I time - .RI [ warning-message ] - .\"}}} -@@ -54,7 +54,16 @@ - .\"}}} - .\"{{{ -h - .IP \fB\-h\fP --Halt after shutdown. -+Halt or poweroff after shutdown. -+.\"}}} -+.\"{{{ -H -+.IP \fB\-H\fP -+Halt action is to halt or drop into boot monitor on systems that -+support it. -+.\"}}} -+.\"{{{ -P -+.IP \fB\-P\fP -+Halt action is to turn off the power. - .\"}}} - .\"{{{ -n - .IP \fB\-n\fP -@@ -141,6 +150,14 @@ - .sp 1 - Note that if \fI/etc/shutdown.allow\fP is not present, the \fB-a\fP - argument is ignored. -+.SH HALT OR POWEROFF -+The \fB-H\fP option just sets the \fIinit\fP environment variable -+\fIINIT_HALT\fP to \fIHALT\fP, and the \fB-P\fP option just sets -+that variable to \fIPOWEROFF\fP. The shutdown script that calls -+\fBhalt\fP(8) as the last thing in the shutdown sequence should -+check these environment variables and call \fBhalt\fP(8) with -+the right options for these options to actually have any effect. -+Debian 3.1 (sarge) supports this. - .SH FILES - .nf - /fastboot -diff -urNd -urNd sysvinit-2.85/man/sulogin.8 sysvinit-2.86/man/sulogin.8 ---- sysvinit-2.85/man/sulogin.8 2000-09-11 07:19:25.000000000 -0500 -+++ sysvinit-2.86/man/sulogin.8 2004-06-09 07:47:45.000000000 -0500 -@@ -1,4 +1,4 @@ --.TH SULOGIN 8 "11 Sep 2000" "" "Linux System Administrator's Manual" -+.TH SULOGIN 8 "04 Nov 2003" "" "Linux System Administrator's Manual" - .SH NAME - sulogin -- Single-user login - .SH SYNOPSIS -@@ -20,7 +20,7 @@ - .br - (or type Control-D for normal startup): - .PP --\fIsulogin\fP will connected to the current terminal, or to the -+\fIsulogin\fP will be connected to the current terminal, or to the - optional device that can be specified on the command line - (typically \fB/dev/console\fP). - .PP -@@ -45,16 +45,18 @@ - .PP - boot: linux -b rw sushell=/sbin/sash - .SH FALLBACK METHODS --\fIsulogin\fP checks the root password using the standard methods first. --If the \fB-e\fP option was specified, --\fIsulogin\fP examines the next files to find the root password. If --they are damaged, or non-existant, it will use fallback methods that --even go so far as to provide you with a shell prompt without asking --for the root password if they are irrepairably damaged. -+\fIsulogin\fP checks the root password using the standard method (getpwnam) -+first. -+Then, if the \fB-e\fP option was specified, -+\fIsulogin\fP examines these files directly to find the root password: - .PP - /etc/passwd, - .br - /etc/shadow (if present) -+.PP -+If they are damaged or non-existant, sulogin will start a root shell -+without asking for a password. Only use the \fB-e\fP option if you -+are sure the console is physically protected against unauthorized access. - .SH AUTHOR - Miquel van Smoorenburg <miquels@cistron.nl> - .SH SEE ALSO -diff -urNd -urNd sysvinit-2.85/man/wall.1 sysvinit-2.86/man/wall.1 ---- sysvinit-2.85/man/wall.1 2003-04-16 04:17:38.000000000 -0500 -+++ sysvinit-2.86/man/wall.1 2004-06-09 07:47:45.000000000 -0500 -@@ -47,7 +47,7 @@ - .I Wall - ignores the - .B TZ --variable - the time printed in the banner is based on the systems -+variable - the time printed in the banner is based on the system's - local time. - - .SH SEE ALSO -diff -urNd -urNd sysvinit-2.85/src/Makefile sysvinit-2.86/src/Makefile ---- sysvinit-2.85/src/Makefile 2001-11-06 05:58:16.000000000 -0600 -+++ sysvinit-2.86/src/Makefile 2004-06-09 07:47:45.000000000 -0500 -@@ -5,34 +5,56 @@ - # clean cleans up object files - # clobber really cleans up - # --# Version: @(#)Makefile 2.83-3 06-Nov-2001 miquels@cistron.nl -+# Version: @(#)Makefile 2.85-13 23-Mar-2004 miquels@cistron.nl - # - --CC = cc --CFLAGS = -Wall -O2 -D_GNU_SOURCE -+CC = gcc -+CFLAGS = -Wall -O2 -fomit-frame-pointer -D_GNU_SOURCE - LDFLAGS = -s - STATIC = - --# For Debian we do not build all programs, otherwise we do. --ifeq ($(DEBIAN),) --PROGS = init halt shutdown killall5 runlevel sulogin utmpdump \ -- last mesg wall --else --PROGS = init halt shutdown killall5 runlevel sulogin last mesg -+# For some known distributions we do not build all programs, otherwise we do. -+BIN = -+SBIN = init halt shutdown runlevel killall5 -+USRBIN = last mesg -+ -+MAN1 = last.1 lastb.1 mesg.1 -+MAN5 = initscript.5 inittab.5 -+MAN8 = halt.8 init.8 killall5.8 pidof.8 poweroff.8 reboot.8 runlevel.8 -+MAN8 += shutdown.8 telinit.8 -+ -+ifeq ($(DISTRO),) -+BIN += mountpoint -+SBIN += sulogin bootlogd -+USRBIN += utmpdump wall -+MAN1 += mountpoint.1 wall.1 -+MAN8 += sulogin.8 bootlogd.8 -+endif -+ -+ifeq ($(DISTRO),Debian) -+BIN += mountpoint -+SBIN += sulogin bootlogd -+MAN1 += mountpoint.1 -+MAN8 += sulogin.8 bootlogd.8 -+endif -+ -+ifeq ($(DISTRO),Owl) -+USRBIN += wall -+MAN1 += wall.1 - endif - - BIN_OWNER = root - BIN_GROUP = root --BIN_COMBO = $(BIN_OWNER).$(BIN_GROUP) -+BIN_COMBO = $(BIN_OWNER):$(BIN_GROUP) - INSTALL = install -o $(BIN_OWNER) -g $(BIN_GROUP) - MANDIR = /usr/share/man - --# Additional libs for Gnu Libc -+# Additional libs for GNU libc. - ifneq ($(wildcard /usr/lib/libcrypt.a),) - LCRYPT = -lcrypt - endif - --all: $(PROGS) -+all: $(BIN) $(SBIN) $(USRBIN) - - init: init.o init_utmp.o - $(CC) $(LDFLAGS) $(STATIC) -o $@ init.o init_utmp.o -@@ -46,6 +68,9 @@ - mesg: mesg.o - $(CC) $(LDFLAGS) -o $@ mesg.o - -+mountpoint: mountpoint.o -+ $(CC) $(LDFLAGS) -o $@ mountpoint.o -+ - utmpdump: utmpdump.o - $(CC) $(LDFLAGS) -o $@ utmpdump.o - -@@ -62,9 +87,9 @@ - $(CC) $(LDFLAGS) -o $@ dowall.o shutdown.o utmp.o - - bootlogd: bootlogd.o -- $(CC) $(LDFLAGS) -o $@ bootlogd.o -+ $(CC) $(LDFLAGS) -o $@ bootlogd.o -lutil - --init.o: init.c init.h set.h reboot.h -+init.o: init.c init.h set.h reboot.h initreq.h - $(CC) -c $(CFLAGS) init.c - - utmp.o: utmp.c init.h -@@ -80,36 +105,44 @@ - @echo Type \"make clobber\" to really clean up. - - clobber: cleanobjs -- rm -f $(PROGS) -+ rm -f $(BIN) $(SBIN) $(USRBIN) - - distclean: clobber - - install: -- $(INSTALL) -m 755 halt init killall5 sulogin \ -- runlevel shutdown $(ROOT)/sbin -- # These are not installed by default --ifeq ($(DEBIAN),) -- $(INSTALL) -m 555 utmpdump wall $(ROOT)/usr/bin --endif -- # $(INSTALL) -m 755 etc/initscript.sample $(ROOT)/etc -- $(INSTALL) -m 755 mesg last $(ROOT)/usr/bin -- cd $(ROOT)/sbin; ln -sf halt reboot; chown $(BIN_COMBO) reboot -- cd $(ROOT)/sbin; ln -sf halt poweroff; chown $(BIN_COMBO) poweroff -- cd $(ROOT)/sbin; ln -sf init telinit; chown $(BIN_COMBO) telinit -- cd $(ROOT)/bin; ln -sf ../sbin/killall5 pidof; chown $(BIN_COMBO) pidof -- cd $(ROOT)/usr/bin; ln -sf last lastb; chown $(BIN_COMBO) lastb -- $(INSTALL) -m 644 initreq.h $(ROOT)/usr/include -- $(INSTALL) -m 644 ../man/*.8 $(ROOT)$(MANDIR)/man8 -- $(INSTALL) -m 644 ../man/*.5 $(ROOT)$(MANDIR)/man5 --ifeq ($(DEBIAN),) -- $(INSTALL) -m 644 ../man/wall.1 $(ROOT)$(MANDIR)/man1 --endif -- $(INSTALL) -m 644 ../man/last.1 ../man/lastb.1 ../man/mesg.1 \ -- $(ROOT)$(MANDIR)/man1 -+ for i in $(BIN); do \ -+ $(INSTALL) -m 755 $$i $(ROOT)/bin/; \ -+ done -+ for i in $(SBIN); do \ -+ $(INSTALL) -m 755 $$i $(ROOT)/sbin/; \ -+ done -+ for i in $(USRBIN); do \ -+ $(INSTALL) -m 755 $$i $(ROOT)/usr/bin/; \ -+ done -+ # $(INSTALL) -m 755 etc/initscript.sample $(ROOT)/etc/ -+ ln -sf halt $(ROOT)/sbin/reboot -+ ln -sf halt $(ROOT)/sbin/poweroff -+ ln -sf init $(ROOT)/sbin/telinit -+ ln -sf ../sbin/killall5 $(ROOT)/bin/pidof -+ if [ ! -f $(ROOT)/usr/bin/lastb ]; then \ -+ ln -sf last $(ROOT)/usr/bin/lastb; \ -+ fi -+ $(INSTALL) -m 644 initreq.h $(ROOT)/usr/include/ -+ for i in $(MAN1); do \ -+ $(INSTALL) -m 644 ../man/$$i $(ROOT)$(MANDIR)/man1/; \ -+ done -+ for i in $(MAN5); do \ -+ $(INSTALL) -m 644 ../man/$$i $(ROOT)$(MANDIR)/man5/; \ -+ done -+ for i in $(MAN8); do \ -+ $(INSTALL) -m 644 ../man/$$i $(ROOT)$(MANDIR)/man8/; \ -+ done -+ifeq ($(ROOT),) - # -- # This part is skipped on debian systems, the -+ # This part is skipped on Debian systems, the - # debian.preinst script takes care of it. - @if [ ! -p /dev/initctl ]; then \ - echo "Creating /dev/initctl"; \ - rm -f /dev/initctl; \ - mknod -m 600 /dev/initctl p; fi -+endif -Binary files sysvinit-2.85/src/bootlogd and sysvinit-2.86/src/bootlogd differ -diff -urNd -urNd sysvinit-2.85/src/bootlogd.c sysvinit-2.86/src/bootlogd.c ---- sysvinit-2.85/src/bootlogd.c 2001-12-09 08:01:28.000000000 -0600 -+++ sysvinit-2.86/src/bootlogd.c 2004-06-09 07:47:45.000000000 -0500 -@@ -3,12 +3,12 @@ - * The file is usually located on the /var partition, and - * gets written (and fsynced) as soon as possible. - * -- * Version: @(#)bootlogd 2.79 11-Sep-2000 miquels@cistron.nl -+ * Version: @(#)bootlogd 2.86pre 12-Jan-2004 miquels@cistron.nl - * - * Bugs: Uses openpty(), only available in glibc. Sorry. - * - * This file is part of the sysvinit suite, -- * Copyright 1991-2000 Miquel van Smoorenburg. -+ * Copyright 1991-2004 Miquel van Smoorenburg. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License -@@ -17,7 +17,9 @@ - * - * *NOTE* *NOTE* *NOTE* - * This is a PROOF OF CONCEPT IMPLEMENTATION -- * I do not recommend using this on production systems. -+ * -+ * I have bigger plans for Debian, but for now -+ * this has to do ;) - * - */ - -@@ -38,18 +40,14 @@ - #include <dirent.h> - #include <fcntl.h> - #include <pty.h> -- --char *Version = "@(#) bootlogd 2.79 11-Sep-2000 MvS"; -- --/* -- * Until the kernel knows about TIOCGDEV, use a really ugly -- * non-portable (not even between architectures) hack. -- */ --#ifndef TIOCGDEV --# define TIOCTTYGSTRUCT_HACK 1 -+#include <ctype.h> -+#ifdef __linux__ -+#include <sys/mount.h> - #endif - --#define LOGFILE "/var/log/boot.log" -+char *Version = "@(#) bootlogd 2.86 03-Jun-2004 miquels@cistron.nl"; -+ -+#define LOGFILE "/var/log/boot" - - char ringbuf[32768]; - char *endptr = ringbuf + sizeof(ringbuf); -@@ -59,29 +57,32 @@ - int got_signal = 0; - int didnl = 1; - -+struct line { -+ char buf[256]; -+ int pos; -+} line; - --#ifdef TIOCTTYGSTRUCT_HACK --struct tty_offsets { -- char *kver; -- int offset; --} tty_offsets[] = { --#if ((~0UL) == 0xffffffff) /* 32 bits */ -- { "2.0.", 236 }, -- { "2.1.", 268 }, -- { "2.2.", 272 }, -- { "2.3.", 272 }, -- { "2.4.", 272 }, -- { "2.5.", 272 }, --#else /* 64 bits */ -- { "2.2.", 480 }, -- { "2.3.", 480 }, -- { "2.4.", 480 }, -- { "2.5.", 480 }, --#endif -- { NULL, 0 }, -+/* -+ * Console devices as listed on the kernel command line and -+ * the mapping to actual devices in /dev -+ */ -+struct consdev { -+ char *cmdline; -+ char *dev1; -+ char *dev2; -+} consdev[] = { -+ { "ttySC", "/dev/ttySC%s", "/dev/ttsc/%s" }, -+ { "ttyS", "/dev/ttyS%s", "/dev/tts/%s" }, -+ { "tty", "/dev/tty%s", "/dev/vc/%s" }, -+ { "hvc", "/dev/hvc%s", "/dev/hvc/%s" }, -+ { NULL, NULL, NULL }, - }; --#endif - -+/* -+ * Devices to try as console if not found on kernel command line. -+ * Tried from left to right (as opposed to kernel cmdline). -+ */ -+char *defcons[] = { "tty0", "hvc0", "ttyS0", "ttySC0", NULL }; - - /* - * Catch signals. -@@ -95,6 +96,8 @@ - /* - * Scan /dev and find the device name. - * Side-effect: directory is changed to /dev -+ * -+ * FIXME: scan subdirectories for devfs support ? - */ - int findtty(char *res, int rlen, dev_t dev) - { -@@ -117,18 +120,88 @@ - } - } - if (ent == NULL) { -- fprintf(stderr, "bootlogd: cannot find console device\n"); -+ fprintf(stderr, "bootlogd: cannot find console device " -+ "%d:%d in /dev\n", major(dev), minor(dev)); - r = -1; -- } else if (strlen(ent->d_name) >= rlen) { -+ } else if (strlen(ent->d_name) + 5 >= rlen) { - fprintf(stderr, "bootlogd: console device name too long\n"); - r = -1; - } else -- strcpy(res, ent->d_name); -+ snprintf(res, rlen, "/dev/%s", ent->d_name); - closedir(dir); - - return r; - } - -+/* -+ * For some reason, openpty() in glibc sometimes doesn't -+ * work at boot-time. It must be a bug with old-style pty -+ * names, as new-style (/dev/pts) is not available at that -+ * point. So, we find a pty/tty pair ourself if openpty() -+ * fails for whatever reason. -+ */ -+int findpty(int *master, int *slave, char *name) -+{ -+ char pty[16]; -+ char tty[16]; -+ int i, j; -+ int found; -+ -+ if (openpty(master, slave, name, NULL, NULL) >= 0) -+ return 0; -+ -+ found = 0; -+ -+ for (i = 'p'; i <= 'z'; i++) { -+ for (j = '0'; j <= 'f'; j++) { -+ if (j == '9' + 1) j = 'a'; -+ sprintf(pty, "/dev/pty%c%c", i, j); -+ sprintf(tty, "/dev/tty%c%c", i, j); -+ if ((*master = open(pty, O_RDWR|O_NOCTTY)) >= 0) { -+ *slave = open(tty, O_RDWR|O_NOCTTY); -+ if (*slave >= 0) { -+ found = 1; -+ break; -+ } -+ } -+ } -+ if (found) break; -+ } -+ if (found < 0) return -1; -+ -+ if (name) strcpy(name, tty); -+ -+ return 0; -+} -+/* -+ * See if a console taken from the kernel command line maps -+ * to a character device we know about, and if we can open it. -+ */ -+int isconsole(char *s, char *res, int rlen) -+{ -+ struct consdev *c; -+ int l, sl, i, fd; -+ char *p, *q; -+ -+ sl = strlen(s); -+ -+ for (c = consdev; c->cmdline; c++) { -+ l = strlen(c->cmdline); -+ if (sl <= l) continue; -+ p = s + l; -+ if (strncmp(s, c->cmdline, l) != 0 || !isdigit(*p)) -+ continue; -+ for (i = 0; i < 2; i++) { -+ snprintf(res, rlen, i ? c->dev1 : c->dev2, p); -+ if ((q = strchr(res, ',')) != NULL) *q = 0; -+ if ((fd = open(res, O_RDONLY|O_NONBLOCK)) >= 0) { -+ close(fd); -+ return 1; -+ } -+ } -+ } -+ return 0; -+} - - /* - * Find out the _real_ console. Assume that stdin is connected to -@@ -136,21 +209,18 @@ - */ - int consolename(char *res, int rlen) - { -- struct stat st; --#if TIOCTTYGSTRUCT_HACK -- struct utsname uts; -- struct tty_offsets *tt; -- dev_t dev; -- unsigned short *kdev; -- char buf[4096]; -- int offset = -1; --#endif - #ifdef TIOCGDEV -- kdev_t kdev; -+ unsigned int kdev; - #endif -+ struct stat st, st2; -+ char buf[256]; -+ char *p; -+ int didmount = 0; -+ int n, r; -+ int fd; - - fstat(0, &st); -- if (st.st_rdev != 0x0501) { -+ if (major(st.st_rdev) != 5 || minor(st.st_rdev) != 1) { - /* - * Old kernel, can find real device easily. - */ -@@ -160,33 +230,78 @@ - #ifdef TIOCGDEV - if (ioctl(0, TIOCGDEV, &kdev) == 0) - return findtty(res, rlen, (dev_t)kdev); -- return -1; -+ if (errno != ENOIOCTLCMD) return -1; - #endif - -+#ifdef __linux__ - /* -- * New kernel and new console device - hard to find -- * out what device the real console is .. -+ * Read /proc/cmdline. - */ --#if TIOCTTYGSTRUCT_HACK -- if (ioctl(0, TIOCTTYGSTRUCT, buf) != 0) { -- perror("bootlogd: TIOCTTYGSTRUCT"); -+ stat("/", &st); -+ if (stat("/proc", &st2) < 0) { -+ perror("bootlogd: /proc"); - return -1; - } -- uname(&uts); -- for (tt = tty_offsets; tt->kver; tt++) -- if (!strncmp(uts.release, tt->kver, strlen(tt->kver))) { -- offset = tt->offset; -+ if (st.st_dev == st2.st_dev) { -+ if (mount("proc", "/proc", "proc", 0, NULL) < 0) { -+ perror("bootlogd: mount /proc"); -+ return -1; -+ } -+ didmount = 1; -+ } -+ -+ n = 0; -+ r = -1; -+ if ((fd = open("/proc/cmdline", O_RDONLY)) < 0) { -+ perror("bootlogd: /proc/cmdline"); -+ } else { -+ buf[0] = 0; -+ if ((n = read(fd, buf, sizeof(buf) - 1)) >= 0) -+ r = 0; -+ else -+ perror("bootlogd: /proc/cmdline"); -+ close(fd); -+ } -+ if (didmount) umount("/proc"); -+ -+ if (r < 0) return r; -+ -+ /* -+ * OK, so find console= in /proc/cmdline. -+ * Parse in reverse, opening as we go. -+ * -+ * Valid console devices: ttySC, ttyS, tty, hvc. -+ */ -+ p = buf + n; -+ *p-- = 0; -+ r = -1; -+ while (p >= buf) { -+ if (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n') { -+ *p-- = 0; -+ continue; -+ } -+ if (strncmp(p, "console=", 8) == 0 && -+ isconsole(p + 8, res, rlen)) { -+ r = 0; - break; - } -- if (offset < 0) { -- fprintf(stderr, "bootlogd: don't know offsetof" -- "(struct tty_struct, device) for kernel %s\n", uts.release); -- return -1; -+ p--; - } -- kdev = (unsigned short *)(&buf[offset]); -- dev = (dev_t)(*kdev); -- return findtty(res, rlen, dev); -+ -+ if (r == 0) return r; - #endif -+ -+ /* -+ * Okay, no console on the command line - -+ * guess the default console. -+ */ -+ for (n = 0; defcons[n]; n++) -+ if (isconsole(defcons[n], res, rlen)) -+ return 0; -+ -+ fprintf(stderr, "bootlogd: cannot deduce real console device\n"); -+ -+ return -1; - } - - -@@ -197,9 +312,13 @@ - { - time_t t; - char *s; -+ char tmp[8]; - int olen = len; -+ int dosync = 0; -+ int tlen; - - while (len > 0) { -+ tmp[0] = 0; - if (didnl) { - time(&t); - s = ctime(&t); -@@ -207,24 +326,51 @@ - didnl = 0; - } - switch (*ptr) { -+ case 27: /* ESC */ -+ strcpy(tmp, "^["); -+ break; - case '\r': -+ line.pos = 0; -+ break; -+ case 8: /* ^H */ -+ if (line.pos > 0) line.pos--; - break; - case '\n': - didnl = 1; -+ dosync = 1; -+ break; - case '\t': -+ line.pos += (line.pos / 8 + 1) * 8; -+ if (line.pos >= sizeof(line.buf)) -+ line.pos = sizeof(line.buf) - 1; -+ break; - case 32 ... 127: - case 161 ... 255: -- fputc(*ptr, fp); -+ tmp[0] = *ptr; -+ tmp[1] = 0; - break; - default: -- fprintf(fp, "\\%03o", *ptr); -+ sprintf(tmp, "\\%03o", *ptr); - break; - } - ptr++; - len--; -+ -+ tlen = strlen(tmp); -+ if (tlen && (line.pos + tlen < sizeof(line.buf))) { -+ memcpy(line.buf + line.pos, tmp, tlen); -+ line.pos += tlen; -+ } -+ if (didnl) { -+ fprintf(fp, "%s\n", line.buf); -+ memset(&line, 0, sizeof(line)); -+ } -+ } -+ -+ if (dosync) { -+ fflush(fp); -+ fdatasync(fileno(fp)); - } -- fflush(fp); -- fdatasync(fileno(fp)); - - outptr += olen; - if (outptr >= endptr) -@@ -242,6 +388,40 @@ - exit(1); - } - -+int open_nb(char *buf) -+{ -+ int fd, n; -+ -+ if ((fd = open(buf, O_WRONLY|O_NONBLOCK|O_NOCTTY)) < 0) -+ return -1; -+ n = fcntl(fd, F_GETFL); -+ n &= ~(O_NONBLOCK); -+ fcntl(fd, F_SETFL, n); -+ -+ return fd; -+} -+ -+/* -+ * We got a write error on the real console. If its an EIO, -+ * somebody hung up our filedescriptor, so try to re-open it. -+ */ -+int write_err(int pts, int realfd, char *realcons, int e) -+{ -+ int fd; -+ -+ if (e != EIO) { -+werr: -+ close(pts); -+ fprintf(stderr, "bootlogd: writing to console: %s\n", -+ strerror(e)); -+ return -1; -+ } -+ close(realfd); -+ if ((fd = open_nb(realcons)) < 0) -+ goto werr; -+ -+ return fd; -+} - - int main(int argc, char **argv) - { -@@ -249,6 +429,7 @@ - struct timeval tv; - fd_set fds; - char buf[1024]; -+ char realcons[1024]; - char *p; - char *logfile; - char *pidfile; -@@ -298,23 +479,32 @@ - /* - * Open console device directly. - */ -- if (consolename(buf, sizeof(buf)) < 0) -+ if (consolename(realcons, sizeof(realcons)) < 0) - return 1; -- if ((realfd = open(buf, O_WRONLY|O_NONBLOCK)) < 0) { -+ -+ if (strcmp(realcons, "/dev/tty0") == 0) -+ strcpy(realcons, "/dev/tty1"); -+ if (strcmp(realcons, "/dev/vc/0") == 0) -+ strcpy(realcons, "/dev/vc/1"); -+ -+ if ((realfd = open_nb(realcons)) < 0) { - fprintf(stderr, "bootlogd: %s: %s\n", buf, strerror(errno)); - return 1; - } -- n = fcntl(realfd, F_GETFL); -- n &= ~(O_NONBLOCK); -- fcntl(realfd, F_SETFL, n); - - /* - * Grab a pty, and redirect console messages to it. - */ -- if (openpty(&ptm, &pts, buf, NULL, NULL) < 0) { -- fprintf(stderr, "bootlogd: cannot allocate pseudo tty\n"); -+ ptm = -1; -+ pts = -1; -+ buf[0] = 0; -+ if (findpty(&ptm, &pts, buf) < 0) { -+ fprintf(stderr, -+ "bootlogd: cannot allocate pseudo tty: %s\n", -+ strerror(errno)); - return 1; - } -+ - (void)ioctl(0, TIOCCONS, NULL); - #if 1 - /* Work around bug in 2.1/2.2 kernels. Fixed in 2.2.13 and 2.3.18 */ -@@ -357,8 +547,8 @@ - * open the logfile. There might be buffered messages - * we want to write. - */ -- tv.tv_sec = fp ? 86400 : 5; -- tv.tv_usec = 0; -+ tv.tv_sec = 0; -+ tv.tv_usec = 500000; - FD_ZERO(&fds); - FD_SET(ptm, &fds); - if (select(ptm + 1, &fds, NULL, NULL, &tv) == 1) { -@@ -374,10 +564,22 @@ - p = inptr; - while (m > 0) { - i = write(realfd, p, m); -- if (i <= 0) break; -- m -= i; -- p += i; -+ if (i >= 0) { -+ m -= i; -+ p += i; -+ continue; -+ } -+ /* -+ * Handle EIO (somebody hung -+ * up our filedescriptor) -+ */ -+ realfd = write_err(pts, realfd, -+ realcons, errno); -+ if (realfd >= 0) continue; -+ got_signal = 1; /* Not really */ -+ break; - } -+ - /* - * Increment buffer position. Handle - * wraps, and also drag output pointer -@@ -410,8 +612,8 @@ - writelog(fp, outptr, todo); - } - -- if (fp && !didnl) { -- fputc('\n', fp); -+ if (fp) { -+ if (!didnl) fputc('\n', fp); - fclose(fp); - } - -Binary files sysvinit-2.85/src/bootlogd.o and sysvinit-2.86/src/bootlogd.o differ -diff -urNd -urNd sysvinit-2.85/src/dowall.c sysvinit-2.86/src/dowall.c ---- sysvinit-2.85/src/dowall.c 2003-04-17 06:32:01.000000000 -0500 -+++ sysvinit-2.86/src/dowall.c 2004-06-09 07:47:45.000000000 -0500 -@@ -3,7 +3,7 @@ - * - * Author: Miquel van Smoorenburg, miquels@cistron.nl - * -- * Version: @(#)dowall.c 2.85-1 15-Apr-2003 miquels@cistron.nl -+ * Version: @(#)dowall.c 2.85-5 02-Jul-2003 miquels@cistron.nl - * - * This file is part of the sysvinit suite, - * Copyright 1991-2003 Miquel van Smoorenburg. -@@ -135,6 +135,13 @@ - char *user, *tty; - int fd, flags; - |
