[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debootstrap on GNU/Hurd Status



tags 43575 +patch
thanks

Hi,

On Thu, Apr 17, 2003 at 03:03:09PM +0200, Marcus Brinkmann wrote:
> On Thu, Apr 17, 2003 at 12:58:42AM +0200, Michael Banck wrote:
> > On Wed, Apr 16, 2003 at 07:44:08AM -0700, Jeff Bailey wrote:
> > > > Well, I had it running, so it is certainly possible.  How you go about
> > > > integrating such a port back into the Debian package is a mystery I
> > > > was never able to solve.
> > > 
> > > I asked the Debian *BSD folks last week if they were planning on using
> > > sysvinit, and I was told they had almost no problems getting the changes
> > > they needed integrated upstream.  Perhaps there's been a change.
> > 
> > Seems like the sysvinit-maintainer is listening to the needs of other
> > ports:
> > 
> > http://lists.debian.org/debian-devel/2003/debian-devel-200304/msg01144.html
> > 
> > --8<--
> > I have split up sysvinit into three packages:
> > 
> > - sysvinit
> > - initscripts
> > - sysv-rc
> > 
> > This is so that BSD and the Hurd can easier replace just the parts
> > they need, probably just initscripts and sysv-rc, and so that
> > alternative systems like file-rc can be dropped in easier.
> > --8<--
> > 
> > I did not look any further into the technical part of this split, though.
> 
> This sounds promising.  As the Hurd side is also ready for sysvinit
> integration, someone could now have a look at what is still needed.

I started at looking how to build sysvinit.

I forward-ported marcus' patch from #43575 to sysvinit-2.85, making sysvinit
build on hurd-i386. Because of the package split I just cared about sysvinit
proper, making the patch a lot smaller. The only additional thing is in
hddown.c which apparently was not yet created by the time of marcus' patch.

Could somebody please review the patch? I've put up 2.85-1.1 packages at
http://people.debian.org/~mbanck/hurd/


cheers,

Michael
--- sysvinit-2.85.orig/src/init.c
+++ sysvinit-2.85/src/init.c
@@ -32,7 +32,9 @@
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include <sys/wait.h>
+#ifdef __linux__
 #include <sys/kd.h>
+#endif
 #include <sys/resource.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -592,7 +594,7 @@
  *	If we have the info, print where it occured.
  *	Then sleep 30 seconds and try to continue.
  */
-#ifdef STACK_DEBUG
+#if (defined STACK_DEBUG) && (defined __linux__)
 void segv_handler(int sig, struct sigcontext ctx)
 {
 	char	*p = "";
@@ -647,7 +649,18 @@
 
 	(void) tcgetattr(fd, &tty);
 
-	tty.c_cflag &= CBAUD|CBAUDEX|CSIZE|CSTOPB|PARENB|PARODD;
+	tty.c_cflag &=
+/* Single Unix says:
+   The following names are commonly used as extensions,
+   therefore portable applications
+   must not use them. */
+#ifdef CBAUD
+                       CBAUD|
+#endif
+#ifdef CBAUDEX
+                       CBAUDEX|
+#endif
+                       CSIZE|CSTOPB|PARENB|PARODD;
 	tty.c_cflag |= HUPCL|CLOCAL|CREAD;
 
 	tty.c_cc[VINTR]  = 3;	/* ctrl('c') */
@@ -2278,6 +2291,7 @@
 	}
 #endif
 
+#ifdef __linux__
 	/*
 	 *	Tell the kernel to send us SIGINT when CTRL-ALT-DEL
 	 *	is pressed, and that we want to handle keyboard signals.
@@ -2288,6 +2302,7 @@
 		close(f);
 	} else
 		(void) ioctl(0, KDSIGACCEPT, SIGWINCH);
+#endif
 
 	/*
 	 *	Ignore all signals.
--- sysvinit-2.85.orig/src/initreq.h
+++ sysvinit-2.85/src/initreq.h
@@ -23,6 +23,10 @@
 #define INIT_CMD_POWERFAILNOW  3
 #define INIT_CMD_POWEROK       4
 
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 64
+#endif
+
 struct init_request {
   int magic;			/* Magic number                 */
   int cmd;			/* What kind of request         */
--- sysvinit-2.85.orig/src/sulogin.c
+++ sysvinit-2.85/src/sulogin.c
@@ -54,7 +54,11 @@
 	/*
 	 *	Set or adjust tty modes.
 	 */
-	tty.c_iflag &= ~(INLCR|IGNCR|IUCLC);
+	tty.c_iflag &= ~(INLCR|IGNCR
+#ifdef IUCLC
+			|IUCLC
+#endif
+			);
 	tty.c_iflag |= ICRNL;
 	tty.c_oflag &= ~(OCRNL|OLCUC|ONOCR|ONLRET|OFILL);
 	tty.c_oflag |= OPOST|ONLCR;
@@ -257,7 +261,11 @@
 
 	tcgetattr(0, &old);
 	tcgetattr(0, &tty);
-	tty.c_iflag &= ~(IUCLC|IXON|IXOFF|IXANY);
+	tty.c_iflag &= ~(
+#ifdef IUCLC
+			IUCLC|
+#endif
+			IXON|IXOFF|IXANY);
 	tty.c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHONL|TOSTOP);
 	tcsetattr(0, TCSANOW, &tty);
 
--- sysvinit-2.85.orig/src/hddown.c
+++ sysvinit-2.85/src/hddown.c
@@ -15,7 +15,9 @@
 
 #include <sys/ioctl.h>
 
+#ifdef __linux__
 #include <linux/hdreg.h>
+#endif
 
 #define MAX_DISKS	64
 #define PROC_IDE	"/proc/ide"
@@ -71,6 +73,7 @@
 #ifndef WIN_STANDBYNOW2
 #define WIN_STANDBYNOW2 0x94
 #endif
+#ifdef __linux__
 	unsigned char args1[4] = {WIN_STANDBYNOW1,0,0,0};
 	unsigned char args2[4] = {WIN_STANDBYNOW2,0,0,0};
 	int fd;
@@ -81,7 +84,7 @@
 	if (ioctl(fd, HDIO_DRIVE_CMD, &args1) &&
 	    ioctl(fd, HDIO_DRIVE_CMD, &args2))
 		return -1;
-
+#endif
 	return 0;
 }
 

Reply to: