[Glibc-bsd-commits] r2010 - trunk/web/patches
ps-guest at alioth.debian.org
ps-guest at alioth.debian.org
Wed Oct 31 15:29:57 UTC 2007
Author: ps-guest
Date: 2007-10-31 15:29:57 +0000 (Wed, 31 Oct 2007)
New Revision: 2010
Added:
trunk/web/patches/util-linux_2.12.diff
trunk/web/patches/util-linux_2.13.diff
Removed:
trunk/web/patches/util-linux.diff
Log:
* update util-linux.diff
Deleted: trunk/web/patches/util-linux.diff
===================================================================
--- trunk/web/patches/util-linux.diff 2007-10-31 07:54:06 UTC (rev 2009)
+++ trunk/web/patches/util-linux.diff 2007-10-31 15:29:57 UTC (rev 2010)
@@ -1,492 +0,0 @@
-diff -ur util-linux-2.12r.old/debian/patches/00list util-linux-2.12r/debian/patches/00list
---- util-linux-2.12r.old/debian/patches/00list 2006-04-21 18:28:31.000000000 +0200
-+++ util-linux-2.12r/debian/patches/00list 2006-04-21 18:28:48.000000000 +0200
-@@ -1,4 +1,3 @@
--10agetty
- 10cal-widechar
- 10cfdisk
- 10cramfs-udebsize
-diff -ur util-linux-2.12r.old/debian/rules util-linux-2.12r/debian/rules
---- util-linux-2.12r.old/debian/rules 2006-04-21 18:28:31.000000000 +0200
-+++ util-linux-2.12r/debian/rules 2006-04-21 18:28:48.000000000 +0200
-@@ -25,7 +25,7 @@
- sparc = $(findstring $(arch),sparc sparc64)
- nohwclock = $(findstring $(arch),s390)
-
--SUBDIRS=po lib getopt disk-utils login-utils misc-utils mount sys-utils text-utils
-+SUBDIRS=po lib getopt disk-utils login-utils misc-utils sys-utils text-utils
- ifeq ($(arch),$(fdisk_arch))
- SUBDIRS += fdisk
- endif
-@@ -36,6 +36,7 @@
- ifneq ($(arch),$(nohwclock))
- SUBDIRS += hwclock
- endif
-+SUBDIRS += mount
- endif
-
- ifneq ($(DEB_HOST_GNU_SYSTEM),linux-gnu)
-@@ -68,9 +69,12 @@
-
- SUIDFILES = debian/tmp-mount/bin/{u,}mount
- BINFILES = sys-utils/arch text-utils/more
--UBINFILES = sys-utils/{ipcs,ipcrm,setsid} \
-- misc-utils/{namei,setterm,mcookie,whereis,ddate} \
-+UBINFILES = sys-utils/{ipcrm,setsid} \
-+ misc-utils/{namei,mcookie,whereis,ddate} \
- getopt/getopt text-utils/{rev,line,pg}
-+ifeq ($(DEB_HOST_GNU_SYSTEM),linux-gnu)
-+UBINFILES += sys-utils/ipcs misc-utils/setterm
-+endif
- SBINFILES = disk-utils/mkswap
-
- ifeq ($(DEB_HOST_GNU_SYSTEM),linux-gnu)
-@@ -79,11 +83,15 @@
- SBINFILES += hwclock/hwclock
- endif
- BINFILES += sys-utils/dmesg
--SBINFILES += disk-utils/{blockdev,raw} mount/pivot_root login-utils/agetty
-+SBINFILES += disk-utils/{blockdev,raw} mount/pivot_root
- UBINFILES += disk-utils/fdformat
- USBINFILES = sys-utils/readprofile disk-utils/elvtune # disk-utils/setfdprm
- endif
-
-+ifneq ($(DEB_HOST_GNU_SYSTEM),gnu)
-+SBINFILES += login-utils/agetty
-+endif
-+
- UBINFILES2= misc-utils/chkdupexe # debian/fdformat # don't strip these
-
- ifeq ($(DEB_HOST_GNU_SYSTEM),linux-gnu)
-@@ -111,11 +119,14 @@
- MAN8FILES += hwclock/hwclock.8
- endif
- MAN1FILES += sys-utils/readprofile.1
--MAN8FILES += login-utils/agetty.8 disk-utils/{blockdev.8,elvtune.8} \
-+MAN8FILES += disk-utils/{blockdev.8,elvtune.8} \
- sys-utils/dmesg.8 mount/pivot_root.8 \
- disk-utils/fdformat.8 disk-utils/raw.8 # disk-utils/setfdprm.8
- endif
-
-+ifneq ($(DEB_HOST_GNU_SYSTEM),gnu)
-+MAN8FILES += login-utils/agetty.8
-+endif
-
- EXAMPLES = fdisk/sfdisk.examples getopt/getopt-{test,parse}.{ba,tc}sh
- ifeq ($(DEB_HOST_GNU_SYSTEM),linux-gnu)
-@@ -123,8 +134,11 @@
- endif
-
- INFOFILES = sys-utils/ipc.info
--ifeq ($(DEB_HOST_GNU_SYSTEM),linux-gnu)
-+ifneq ($(DEB_HOST_GNU_SYSTEM),gnu)
- DOCFILES = login-utils/{README.getty,README.modems-with-agetty,README.poeigl}
-+endif
-+
-+ifeq ($(DEB_HOST_GNU_SYSTEM),linux-gnu)
- ifneq ($(arch),$(nohwclock))
- DOCFILES += debian/README.Debian.hwclock
- endif
-@@ -204,11 +218,11 @@
- mv -f debian/tmp/sbin/fdisk debian/tmp/sbin/ddisk
- mv -f debian/tmp/usr/share/man/man8/fdisk.8 debian/tmp/usr/share/man/man8/ddisk.8
- endif
--ifeq ($(DEB_HOST_GNU_SYSTEM),gnu)
-+ifneq ($(DEB_HOST_GNU_SYSTEM),linux-gnu)
- (cd debian/tmp/sbin ; mv mkswap mkswap.linux)
- (cd debian/tmp/usr/share/man/man8 ; mv mkswap.8 mkswap.linux.8)
- endif
--ifeq ($(DEB_HOST_GNU_SYSTEM),linux-gnu)
-+ifneq ($(DEB_HOST_GNU_SYSTEM),gnu)
- (cd debian/tmp/sbin ; mv agetty getty)
- (cd debian/tmp/usr/share/man/man8 ; mv agetty.8 getty.8)
- ifneq ($(arch), $(nohwclock))
-diff -ur util-linux-2.12r.old/disk-utils/Makefile util-linux-2.12r/disk-utils/Makefile
---- util-linux-2.12r.old/disk-utils/Makefile 2004-12-21 18:14:16.000000000 +0100
-+++ util-linux-2.12r/disk-utils/Makefile 2006-04-21 18:28:48.000000000 +0200
-@@ -16,16 +16,19 @@
-
- SBIN= mkfs mkswap blockdev elvtune fsck.minix mkfs.minix mkfs.bfs
-
--USRBIN= fdformat isosize
-+USRBIN= isosize
-
--ETC= fdprm
--
--MAYBE= setfdprm raw fsck.cramfs mkfs.cramfs
-+MAYBE= raw fsck.cramfs mkfs.cramfs
-
-+ifeq ($(shell uname -s), Linux)
-+USRBIN += fdformat
-+ETC= fdprm
-+MAYBE += setfdprm
- ifneq "$(HAVE_FDUTILS)" "yes"
- USRBIN:=$(USRBIN) setfdprm
- MAN8:=$(MAN8) setfdprm.8
- endif
-+endif
-
- ifeq "$(HAVE_RAW_H)" "yes"
- USRBIN:=$(USRBIN) raw
-diff -ur util-linux-2.12r.old/disk-utils/fsck.cramfs.c util-linux-2.12r/disk-utils/fsck.cramfs.c
---- util-linux-2.12r.old/disk-utils/fsck.cramfs.c 2004-12-11 15:53:16.000000000 +0100
-+++ util-linux-2.12r/disk-utils/fsck.cramfs.c 2006-04-21 18:28:48.000000000 +0200
-@@ -76,7 +76,7 @@
-
- #define PAD_SIZE 512
-
--#include <asm/page.h>
-+#include <sys/user.h> /* PAGE_SIZE */
- #ifdef PAGE_SIZE
- #define PAGE_CACHE_SIZE ((int) PAGE_SIZE)
- #elif defined __ia64__
-diff -ur util-linux-2.12r.old/login-utils/Makefile util-linux-2.12r/login-utils/Makefile
---- util-linux-2.12r.old/login-utils/Makefile 2004-11-23 17:06:57.000000000 +0100
-+++ util-linux-2.12r/login-utils/Makefile 2006-04-21 18:30:49.000000000 +0200
-@@ -101,6 +101,7 @@
- wall.o: ttymsg.h $(LIB)/carefulputc.h
-
- agetty: agetty.o $(LIB)/xstrncpy.o
-+ $(CC) $(LDFLAGS) -o $@ $^ -lutil
- chfn: chfn.o islocal.o setpwnam.o $(SELINUXOBJS) $(LIB)/env.o $(LIB)/xstrncpy.o
- $(CC) $(LDFLAGS) -o $@ $^ $(CRYPT) $(PAM) $(SELINUXLLIB)
- chsh: chsh.o islocal.o setpwnam.o $(SELINUXOBJS) $(LIB)/env.o
-diff -ur util-linux-2.12r.old/login-utils/agetty.c util-linux-2.12r/login-utils/agetty.c
---- util-linux-2.12r.old/login-utils/agetty.c 2002-07-29 09:36:42.000000000 +0200
-+++ util-linux-2.12r/login-utils/agetty.c 2006-04-21 18:28:48.000000000 +0200
-@@ -18,7 +18,8 @@
- #include <stdlib.h>
- #include <string.h>
- #include <sys/ioctl.h>
--#include <termio.h>
-+#include <termios.h>
-+#define termio termios
- #include <signal.h>
- #include <errno.h>
- #include <sys/types.h>
-@@ -33,11 +34,9 @@
- #include "xstrncpy.h"
- #include "nls.h"
-
--#ifdef __linux__
- #include "pathnames.h"
- #include <sys/param.h>
- #define USE_SYSLOG
--#endif
-
- /* If USE_SYSLOG is undefined all diagnostics go directly to /dev/console. */
-
-@@ -299,9 +298,7 @@
-
- parse_args(argc, argv, &options);
-
--#ifdef __linux__
- setsid();
--#endif
-
- /* Update the utmp file. */
-
-@@ -686,8 +683,13 @@
- * 5 seconds seems to be a good value.
- */
-
-- if (ioctl(0, TCGETA, tp) < 0)
-- error("%s: ioctl: %m", tty);
-+ if (tcgetattr(0, tp) < 0)
-+ error("%s: tcgetattr: %m", tty);
-+
-+ /*
-+ * login_tty: steal tty from other process group.
-+ */
-+ login_tty (0);
-
- /*
- * It seems to be a terminal. Set proper protections and ownership. Mode
-@@ -723,17 +725,18 @@
- * reads will be done in raw mode anyway. Errors will be dealt with
- * lateron.
- */
--#ifdef __linux__
- /* flush input and output queues, important for modems! */
-- (void) ioctl(0, TCFLSH, TCIOFLUSH);
--#endif
-+ tcflush(0, TCIOFLUSH);
-
- tp->c_cflag = CS8 | HUPCL | CREAD | speed;
- if (op->flags & F_LOCAL) {
- tp->c_cflag |= CLOCAL;
- }
-
-- tp->c_iflag = tp->c_lflag = tp->c_oflag = tp->c_line = 0;
-+ tp->c_iflag = tp->c_lflag = tp->c_oflag = 0;
-+#ifdef __linux__
-+ tp->c_line = 0;
-+#endif
- tp->c_cc[VMIN] = 1;
- tp->c_cc[VTIME] = 0;
-
-@@ -744,7 +747,7 @@
- tp->c_cflag |= CRTSCTS;
- #endif
-
-- (void) ioctl(0, TCSETA, tp);
-+ tcsetattr(0, TCSANOW, tp);
-
- /* go to blocking input even in local mode */
- fcntl(0, F_SETFL, fcntl(0, F_GETFL, 0) & ~O_NONBLOCK);
-@@ -788,7 +791,7 @@
- tp->c_iflag |= ISTRIP; /* enable 8th-bit stripping */
- vmin = tp->c_cc[VMIN];
- tp->c_cc[VMIN] = 0; /* don't block if queue empty */
-- (void) ioctl(0, TCSETA, tp);
-+ tcsetattr(0, TCSANOW, tp);
-
- /*
- * Wait for a while, then read everything the modem has said so far and
-@@ -801,8 +804,7 @@
- for (bp = buf; bp < buf + nread; bp++) {
- if (isascii(*bp) && isdigit(*bp)) {
- if ((speed = bcode(bp))) {
-- tp->c_cflag &= ~CBAUD;
-- tp->c_cflag |= speed;
-+ cfsetospeed(tp, speed);
- }
- break;
- }
-@@ -812,7 +814,7 @@
-
- tp->c_iflag = iflag;
- tp->c_cc[VMIN] = vmin;
-- (void) ioctl(0, TCSETA, tp);
-+ tcsetattr(0, TCSANOW, tp);
- }
-
- /* do_prompt - show login prompt, optionally preceded by /etc/issue contents */
-@@ -835,8 +837,7 @@
- if ((op->flags & F_ISSUE) && (fd = fopen(op->issue, "r"))) {
- oflag = tp->c_oflag; /* save current setting */
- tp->c_oflag |= (ONLCR | OPOST); /* map NL in output to CR-NL */
-- (void) ioctl(0, TCSETAW, tp);
--
-+ tcsetattr(0, TCSADRAIN, tp);
-
- while ((c = getc(fd)) != EOF)
- {
-@@ -915,7 +916,7 @@
- int i;
-
- for (i = 0; speedtab[i].speed; i++) {
-- if (speedtab[i].code == (tp->c_cflag & CBAUD)) {
-+ if (speedtab[i].code == cfgetospeed(tp)) {
- printf("%ld", speedtab[i].speed);
- break;
- }
-@@ -947,18 +948,18 @@
- fflush(stdout);
-
- tp->c_oflag = oflag; /* restore settings */
-- (void) ioctl(0, TCSETAW, tp); /* wait till output is gone */
-+ tcsetattr(0, TCSADRAIN, tp);
- (void) fclose(fd);
- }
- #endif
--#ifdef __linux__
-+#ifdef MAXHOSTNAMELEN
- {
- char hn[MAXHOSTNAMELEN+1];
-
- (void) gethostname(hn, MAXHOSTNAMELEN);
- write(1, hn, strlen(hn));
- }
--#endif
-+#endif
- (void) write(1, LOGIN, sizeof(LOGIN) - 1); /* always show login prompt */
- }
-
-@@ -971,9 +972,8 @@
- static int baud_index = FIRST_SPEED;/* current speed index */
-
- baud_index = (baud_index + 1) % op->numspeed;
-- tp->c_cflag &= ~CBAUD;
-- tp->c_cflag |= op->speeds[baud_index];
-- (void) ioctl(0, TCSETA, tp);
-+ cfsetospeed(tp, op->speeds[baud_index]);
-+ tcsetattr(0, TCSANOW, tp);
- }
-
- /* get_logname - get user name, establish parity, speed, erase, kill, eol */
-@@ -1003,7 +1003,7 @@
- /* Flush pending input (esp. after parsing or switching the baud rate). */
-
- (void) sleep(1);
-- (void) ioctl(0, TCFLSH, TCIFLUSH);
-+ tcflush(0, TCIFLUSH);
-
- /* Prompt for and read a login name. */
-
-@@ -1105,9 +1105,9 @@
- tp->c_cc[VQUIT] = DEF_QUIT; /* default quit */
- tp->c_cc[VEOF] = DEF_EOF; /* default EOF character */
- tp->c_cc[VEOL] = DEF_EOL;
--#ifdef __linux__
-+#if defined(VSWTC)
- tp->c_cc[VSWTC] = DEF_SWITCH; /* default switch character */
--#else
-+#elif defined(VSWTCH)
- tp->c_cc[VSWTCH] = DEF_SWITCH; /* default switch character */
- #endif
-
-@@ -1140,9 +1140,15 @@
- /* Account for upper case without lower case. */
-
- if (cp->capslock) {
-+#ifdef IUCLC
- tp->c_iflag |= IUCLC;
-+#endif
-+#ifdef XCASE
- tp->c_lflag |= XCASE;
-+#endif
-+#ifdef OLCUC
- tp->c_oflag |= OLCUC;
-+#endif
- }
- /* Optionally enable hardware flow control */
-
-@@ -1153,8 +1159,8 @@
-
- /* Finally, make the new settings effective */
-
-- if (ioctl(0, TCSETA, tp) < 0)
-- error("%s: ioctl: TCSETA: %m", op->tty);
-+ if (tcsetattr(0, TCSANOW, tp) < 0)
-+ error("%s: tcsetattr: %m", op->tty);
- }
-
- /* caps_lock - string contains upper case without lower case */
-diff -ur util-linux-2.12r.old/misc-utils/Makefile util-linux-2.12r/misc-utils/Makefile
---- util-linux-2.12r.old/misc-utils/Makefile 2004-12-05 20:09:12.000000000 +0100
-+++ util-linux-2.12r/misc-utils/Makefile 2006-04-21 18:28:48.000000000 +0200
-@@ -22,7 +22,11 @@
- USRBIN= cal chkdupexe ddate logger look mcookie \
- namei rename script whereis
-
--MAYBE= reset setterm
-+MAYBE= reset
-+
-+ifeq ($(shell uname -s), Linux)
-+MAYBE += setterm
-+endif
-
- ifeq "$(HAVE_RESET)" "no"
- USRBIN:=$(USRBIN) reset
-@@ -39,10 +43,12 @@
- MAN1:=$(MAN1) kill.1
- endif
-
-+ifeq ($(shell uname -s), Linux)
- ifeq "$(HAVE_NCURSES)" "yes"
- USRBIN:=$(USRBIN) setterm
- MAN1:=$(MAN1) setterm.1
- endif
-+endif
-
- # For script only
- LIBPTY=
-@@ -51,7 +57,9 @@
- endif
-
- # Programs requiring special compilation
-+ifeq ($(shell uname -s), Linux)
- NEEDS_CURSES= setterm
-+endif
- NEEDS_OPENPTY= script
-
- all: $(BIN) $(USRBIN) $(USRBIN.NONSHADOW)
-@@ -99,9 +107,11 @@
- write.o: $(LIB)/carefulputc.h
- write: write.o $(LIB)/carefulputc.o
-
-+ifeq ($(shell uname -s), Linux)
- ifeq "$(HAVE_NCURSES)" "yes"
- setterm: setterm.o
- endif
-+endif
-
- install: all
- $(INSTALLDIR) $(BINDIR) $(USRBINDIR)
-diff -ur util-linux-2.12r.old/misc-utils/mcookie.c util-linux-2.12r/misc-utils/mcookie.c
---- util-linux-2.12r.old/misc-utils/mcookie.c 2002-03-09 00:00:52.000000000 +0100
-+++ util-linux-2.12r/misc-utils/mcookie.c 2006-04-21 18:28:48.000000000 +0200
-@@ -20,7 +20,7 @@
- *
- */
-
--#ifdef __linux__
-+#if defined(__linux__) || defined(__GLIBC__)
- #define HAVE_GETTIMEOFDAY 1
- #endif
-
-diff -ur util-linux-2.12r.old/misc-utils/script.c util-linux-2.12r/misc-utils/script.c
---- util-linux-2.12r.old/misc-utils/script.c 2004-03-26 18:07:16.000000000 +0100
-+++ util-linux-2.12r/misc-utils/script.c 2006-04-21 18:28:48.000000000 +0200
-@@ -54,10 +54,8 @@
- #include <sys/signal.h>
- #include "nls.h"
-
--#ifdef __linux__
- #include <unistd.h>
- #include <string.h>
--#endif
-
- #include "../defines.h"
- #ifdef HAVE_openpty
-diff -ur util-linux-2.12r.old/sys-utils/Makefile util-linux-2.12r/sys-utils/Makefile
---- util-linux-2.12r.old/sys-utils/Makefile 2004-11-15 18:47:47.000000000 +0100
-+++ util-linux-2.12r/sys-utils/Makefile 2006-04-21 18:28:48.000000000 +0200
-@@ -17,9 +17,9 @@
- # Where to put binaries?
- # See the "install" rule for the links. . .
-
--BIN= arch dmesg
-+BIN= arch
-
--USRBIN= cytune flock ipcrm ipcs renice setsid
-+USRBIN= flock ipcrm renice setsid
-
- USRSBIN= readprofile tunelp
-
-@@ -27,6 +27,11 @@
-
- NOTMADE=
-
-+ifeq ($(shell uname -s), Linux)
-+BIN += dmesg
-+USRBIN += cytune ipcs
-+endif
-+
- CWFLAGS := $(subst -Wmissing-prototypes,,$(CFLAGS))
-
- ifeq "$(HAVE_SLN)" "no"
-diff -ur util-linux-2.12r.old/text-utils/more.c util-linux-2.12r/text-utils/more.c
---- util-linux-2.12r.old/text-utils/more.c 2004-12-22 11:46:25.000000000 +0100
-+++ util-linux-2.12r/text-utils/more.c 2006-04-21 18:28:48.000000000 +0200
-@@ -1560,10 +1560,6 @@
- }
- if (feof (file)) {
- if (!no_intty) {
--#ifndef __linux__
-- /* No longer in libc 4.5.8. . . */
-- file->_flags &= ~STDIO_S_EOF_SEEN; /* why doesn't fseek do this ??!!??! */
--#endif
- Currline = saveln;
- Fseek (file, startline);
- }
-@@ -1804,7 +1800,7 @@
- no_intty = tcgetattr(fileno(stdin), &otty);
- tcgetattr(fileno(stderr), &otty);
- savetty0 = otty;
-- slow_tty = (otty.c_cflag & CBAUD) < B1200;
-+ slow_tty = cfgetospeed(&otty) < B1200;
- hardtabs = (otty.c_oflag & TABDLY) != XTABS;
- if (!no_tty) {
- otty.c_lflag &= ~(ICANON|ECHO);
Copied: trunk/web/patches/util-linux_2.12.diff (from rev 2006, trunk/web/patches/util-linux.diff)
===================================================================
--- trunk/web/patches/util-linux_2.12.diff (rev 0)
+++ trunk/web/patches/util-linux_2.12.diff 2007-10-31 15:29:57 UTC (rev 2010)
@@ -0,0 +1,492 @@
+diff -ur util-linux-2.12r.old/debian/patches/00list util-linux-2.12r/debian/patches/00list
+--- util-linux-2.12r.old/debian/patches/00list 2006-04-21 18:28:31.000000000 +0200
++++ util-linux-2.12r/debian/patches/00list 2006-04-21 18:28:48.000000000 +0200
+@@ -1,4 +1,3 @@
+-10agetty
+ 10cal-widechar
+ 10cfdisk
+ 10cramfs-udebsize
+diff -ur util-linux-2.12r.old/debian/rules util-linux-2.12r/debian/rules
+--- util-linux-2.12r.old/debian/rules 2006-04-21 18:28:31.000000000 +0200
++++ util-linux-2.12r/debian/rules 2006-04-21 18:28:48.000000000 +0200
+@@ -25,7 +25,7 @@
+ sparc = $(findstring $(arch),sparc sparc64)
+ nohwclock = $(findstring $(arch),s390)
+
+-SUBDIRS=po lib getopt disk-utils login-utils misc-utils mount sys-utils text-utils
++SUBDIRS=po lib getopt disk-utils login-utils misc-utils sys-utils text-utils
+ ifeq ($(arch),$(fdisk_arch))
+ SUBDIRS += fdisk
+ endif
+@@ -36,6 +36,7 @@
+ ifneq ($(arch),$(nohwclock))
+ SUBDIRS += hwclock
+ endif
++SUBDIRS += mount
+ endif
+
+ ifneq ($(DEB_HOST_GNU_SYSTEM),linux-gnu)
+@@ -68,9 +69,12 @@
+
+ SUIDFILES = debian/tmp-mount/bin/{u,}mount
+ BINFILES = sys-utils/arch text-utils/more
+-UBINFILES = sys-utils/{ipcs,ipcrm,setsid} \
+- misc-utils/{namei,setterm,mcookie,whereis,ddate} \
++UBINFILES = sys-utils/{ipcrm,setsid} \
++ misc-utils/{namei,mcookie,whereis,ddate} \
+ getopt/getopt text-utils/{rev,line,pg}
++ifeq ($(DEB_HOST_GNU_SYSTEM),linux-gnu)
++UBINFILES += sys-utils/ipcs misc-utils/setterm
++endif
+ SBINFILES = disk-utils/mkswap
+
+ ifeq ($(DEB_HOST_GNU_SYSTEM),linux-gnu)
+@@ -79,11 +83,15 @@
+ SBINFILES += hwclock/hwclock
+ endif
+ BINFILES += sys-utils/dmesg
+-SBINFILES += disk-utils/{blockdev,raw} mount/pivot_root login-utils/agetty
++SBINFILES += disk-utils/{blockdev,raw} mount/pivot_root
+ UBINFILES += disk-utils/fdformat
+ USBINFILES = sys-utils/readprofile disk-utils/elvtune # disk-utils/setfdprm
+ endif
+
++ifneq ($(DEB_HOST_GNU_SYSTEM),gnu)
++SBINFILES += login-utils/agetty
++endif
++
+ UBINFILES2= misc-utils/chkdupexe # debian/fdformat # don't strip these
+
+ ifeq ($(DEB_HOST_GNU_SYSTEM),linux-gnu)
+@@ -111,11 +119,14 @@
+ MAN8FILES += hwclock/hwclock.8
+ endif
+ MAN1FILES += sys-utils/readprofile.1
+-MAN8FILES += login-utils/agetty.8 disk-utils/{blockdev.8,elvtune.8} \
++MAN8FILES += disk-utils/{blockdev.8,elvtune.8} \
+ sys-utils/dmesg.8 mount/pivot_root.8 \
+ disk-utils/fdformat.8 disk-utils/raw.8 # disk-utils/setfdprm.8
+ endif
+
++ifneq ($(DEB_HOST_GNU_SYSTEM),gnu)
++MAN8FILES += login-utils/agetty.8
++endif
+
+ EXAMPLES = fdisk/sfdisk.examples getopt/getopt-{test,parse}.{ba,tc}sh
+ ifeq ($(DEB_HOST_GNU_SYSTEM),linux-gnu)
+@@ -123,8 +134,11 @@
+ endif
+
+ INFOFILES = sys-utils/ipc.info
+-ifeq ($(DEB_HOST_GNU_SYSTEM),linux-gnu)
++ifneq ($(DEB_HOST_GNU_SYSTEM),gnu)
+ DOCFILES = login-utils/{README.getty,README.modems-with-agetty,README.poeigl}
++endif
++
++ifeq ($(DEB_HOST_GNU_SYSTEM),linux-gnu)
+ ifneq ($(arch),$(nohwclock))
+ DOCFILES += debian/README.Debian.hwclock
+ endif
+@@ -204,11 +218,11 @@
+ mv -f debian/tmp/sbin/fdisk debian/tmp/sbin/ddisk
+ mv -f debian/tmp/usr/share/man/man8/fdisk.8 debian/tmp/usr/share/man/man8/ddisk.8
+ endif
+-ifeq ($(DEB_HOST_GNU_SYSTEM),gnu)
++ifneq ($(DEB_HOST_GNU_SYSTEM),linux-gnu)
+ (cd debian/tmp/sbin ; mv mkswap mkswap.linux)
+ (cd debian/tmp/usr/share/man/man8 ; mv mkswap.8 mkswap.linux.8)
+ endif
+-ifeq ($(DEB_HOST_GNU_SYSTEM),linux-gnu)
++ifneq ($(DEB_HOST_GNU_SYSTEM),gnu)
+ (cd debian/tmp/sbin ; mv agetty getty)
+ (cd debian/tmp/usr/share/man/man8 ; mv agetty.8 getty.8)
+ ifneq ($(arch), $(nohwclock))
+diff -ur util-linux-2.12r.old/disk-utils/Makefile util-linux-2.12r/disk-utils/Makefile
+--- util-linux-2.12r.old/disk-utils/Makefile 2004-12-21 18:14:16.000000000 +0100
++++ util-linux-2.12r/disk-utils/Makefile 2006-04-21 18:28:48.000000000 +0200
+@@ -16,16 +16,19 @@
+
+ SBIN= mkfs mkswap blockdev elvtune fsck.minix mkfs.minix mkfs.bfs
+
+-USRBIN= fdformat isosize
++USRBIN= isosize
+
+-ETC= fdprm
+-
+-MAYBE= setfdprm raw fsck.cramfs mkfs.cramfs
++MAYBE= raw fsck.cramfs mkfs.cramfs
+
++ifeq ($(shell uname -s), Linux)
++USRBIN += fdformat
++ETC= fdprm
++MAYBE += setfdprm
+ ifneq "$(HAVE_FDUTILS)" "yes"
+ USRBIN:=$(USRBIN) setfdprm
+ MAN8:=$(MAN8) setfdprm.8
+ endif
++endif
+
+ ifeq "$(HAVE_RAW_H)" "yes"
+ USRBIN:=$(USRBIN) raw
+diff -ur util-linux-2.12r.old/disk-utils/fsck.cramfs.c util-linux-2.12r/disk-utils/fsck.cramfs.c
+--- util-linux-2.12r.old/disk-utils/fsck.cramfs.c 2004-12-11 15:53:16.000000000 +0100
++++ util-linux-2.12r/disk-utils/fsck.cramfs.c 2006-04-21 18:28:48.000000000 +0200
+@@ -76,7 +76,7 @@
+
+ #define PAD_SIZE 512
+
+-#include <asm/page.h>
++#include <sys/user.h> /* PAGE_SIZE */
+ #ifdef PAGE_SIZE
+ #define PAGE_CACHE_SIZE ((int) PAGE_SIZE)
+ #elif defined __ia64__
+diff -ur util-linux-2.12r.old/login-utils/Makefile util-linux-2.12r/login-utils/Makefile
+--- util-linux-2.12r.old/login-utils/Makefile 2004-11-23 17:06:57.000000000 +0100
++++ util-linux-2.12r/login-utils/Makefile 2006-04-21 18:30:49.000000000 +0200
+@@ -101,6 +101,7 @@
+ wall.o: ttymsg.h $(LIB)/carefulputc.h
+
+ agetty: agetty.o $(LIB)/xstrncpy.o
++ $(CC) $(LDFLAGS) -o $@ $^ -lutil
+ chfn: chfn.o islocal.o setpwnam.o $(SELINUXOBJS) $(LIB)/env.o $(LIB)/xstrncpy.o
+ $(CC) $(LDFLAGS) -o $@ $^ $(CRYPT) $(PAM) $(SELINUXLLIB)
+ chsh: chsh.o islocal.o setpwnam.o $(SELINUXOBJS) $(LIB)/env.o
+diff -ur util-linux-2.12r.old/login-utils/agetty.c util-linux-2.12r/login-utils/agetty.c
+--- util-linux-2.12r.old/login-utils/agetty.c 2002-07-29 09:36:42.000000000 +0200
++++ util-linux-2.12r/login-utils/agetty.c 2006-04-21 18:28:48.000000000 +0200
+@@ -18,7 +18,8 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+-#include <termio.h>
++#include <termios.h>
++#define termio termios
+ #include <signal.h>
+ #include <errno.h>
+ #include <sys/types.h>
+@@ -33,11 +34,9 @@
+ #include "xstrncpy.h"
+ #include "nls.h"
+
+-#ifdef __linux__
+ #include "pathnames.h"
+ #include <sys/param.h>
+ #define USE_SYSLOG
+-#endif
+
+ /* If USE_SYSLOG is undefined all diagnostics go directly to /dev/console. */
+
+@@ -299,9 +298,7 @@
+
+ parse_args(argc, argv, &options);
+
+-#ifdef __linux__
+ setsid();
+-#endif
+
+ /* Update the utmp file. */
+
+@@ -686,8 +683,13 @@
+ * 5 seconds seems to be a good value.
+ */
+
+- if (ioctl(0, TCGETA, tp) < 0)
+- error("%s: ioctl: %m", tty);
++ if (tcgetattr(0, tp) < 0)
++ error("%s: tcgetattr: %m", tty);
++
++ /*
++ * login_tty: steal tty from other process group.
++ */
++ login_tty (0);
+
+ /*
+ * It seems to be a terminal. Set proper protections and ownership. Mode
+@@ -723,17 +725,18 @@
+ * reads will be done in raw mode anyway. Errors will be dealt with
+ * lateron.
+ */
+-#ifdef __linux__
+ /* flush input and output queues, important for modems! */
+- (void) ioctl(0, TCFLSH, TCIOFLUSH);
+-#endif
++ tcflush(0, TCIOFLUSH);
+
+ tp->c_cflag = CS8 | HUPCL | CREAD | speed;
+ if (op->flags & F_LOCAL) {
+ tp->c_cflag |= CLOCAL;
+ }
+
+- tp->c_iflag = tp->c_lflag = tp->c_oflag = tp->c_line = 0;
++ tp->c_iflag = tp->c_lflag = tp->c_oflag = 0;
++#ifdef __linux__
++ tp->c_line = 0;
++#endif
+ tp->c_cc[VMIN] = 1;
+ tp->c_cc[VTIME] = 0;
+
+@@ -744,7 +747,7 @@
+ tp->c_cflag |= CRTSCTS;
+ #endif
+
+- (void) ioctl(0, TCSETA, tp);
++ tcsetattr(0, TCSANOW, tp);
+
+ /* go to blocking input even in local mode */
+ fcntl(0, F_SETFL, fcntl(0, F_GETFL, 0) & ~O_NONBLOCK);
+@@ -788,7 +791,7 @@
+ tp->c_iflag |= ISTRIP; /* enable 8th-bit stripping */
+ vmin = tp->c_cc[VMIN];
+ tp->c_cc[VMIN] = 0; /* don't block if queue empty */
+- (void) ioctl(0, TCSETA, tp);
++ tcsetattr(0, TCSANOW, tp);
+
+ /*
+ * Wait for a while, then read everything the modem has said so far and
+@@ -801,8 +804,7 @@
+ for (bp = buf; bp < buf + nread; bp++) {
+ if (isascii(*bp) && isdigit(*bp)) {
+ if ((speed = bcode(bp))) {
+- tp->c_cflag &= ~CBAUD;
+- tp->c_cflag |= speed;
++ cfsetospeed(tp, speed);
+ }
+ break;
+ }
+@@ -812,7 +814,7 @@
+
+ tp->c_iflag = iflag;
+ tp->c_cc[VMIN] = vmin;
+- (void) ioctl(0, TCSETA, tp);
++ tcsetattr(0, TCSANOW, tp);
+ }
+
+ /* do_prompt - show login prompt, optionally preceded by /etc/issue contents */
+@@ -835,8 +837,7 @@
+ if ((op->flags & F_ISSUE) && (fd = fopen(op->issue, "r"))) {
+ oflag = tp->c_oflag; /* save current setting */
+ tp->c_oflag |= (ONLCR | OPOST); /* map NL in output to CR-NL */
+- (void) ioctl(0, TCSETAW, tp);
+-
++ tcsetattr(0, TCSADRAIN, tp);
+
+ while ((c = getc(fd)) != EOF)
+ {
+@@ -915,7 +916,7 @@
+ int i;
+
+ for (i = 0; speedtab[i].speed; i++) {
+- if (speedtab[i].code == (tp->c_cflag & CBAUD)) {
++ if (speedtab[i].code == cfgetospeed(tp)) {
+ printf("%ld", speedtab[i].speed);
+ break;
+ }
+@@ -947,18 +948,18 @@
+ fflush(stdout);
+
+ tp->c_oflag = oflag; /* restore settings */
+- (void) ioctl(0, TCSETAW, tp); /* wait till output is gone */
++ tcsetattr(0, TCSADRAIN, tp);
+ (void) fclose(fd);
+ }
+ #endif
+-#ifdef __linux__
++#ifdef MAXHOSTNAMELEN
+ {
+ char hn[MAXHOSTNAMELEN+1];
+
+ (void) gethostname(hn, MAXHOSTNAMELEN);
+ write(1, hn, strlen(hn));
+ }
+-#endif
++#endif
+ (void) write(1, LOGIN, sizeof(LOGIN) - 1); /* always show login prompt */
+ }
+
+@@ -971,9 +972,8 @@
+ static int baud_index = FIRST_SPEED;/* current speed index */
+
+ baud_index = (baud_index + 1) % op->numspeed;
+- tp->c_cflag &= ~CBAUD;
+- tp->c_cflag |= op->speeds[baud_index];
+- (void) ioctl(0, TCSETA, tp);
++ cfsetospeed(tp, op->speeds[baud_index]);
++ tcsetattr(0, TCSANOW, tp);
+ }
+
+ /* get_logname - get user name, establish parity, speed, erase, kill, eol */
+@@ -1003,7 +1003,7 @@
+ /* Flush pending input (esp. after parsing or switching the baud rate). */
+
+ (void) sleep(1);
+- (void) ioctl(0, TCFLSH, TCIFLUSH);
++ tcflush(0, TCIFLUSH);
+
+ /* Prompt for and read a login name. */
+
+@@ -1105,9 +1105,9 @@
+ tp->c_cc[VQUIT] = DEF_QUIT; /* default quit */
+ tp->c_cc[VEOF] = DEF_EOF; /* default EOF character */
+ tp->c_cc[VEOL] = DEF_EOL;
+-#ifdef __linux__
++#if defined(VSWTC)
+ tp->c_cc[VSWTC] = DEF_SWITCH; /* default switch character */
+-#else
++#elif defined(VSWTCH)
+ tp->c_cc[VSWTCH] = DEF_SWITCH; /* default switch character */
+ #endif
+
+@@ -1140,9 +1140,15 @@
+ /* Account for upper case without lower case. */
+
+ if (cp->capslock) {
++#ifdef IUCLC
+ tp->c_iflag |= IUCLC;
++#endif
++#ifdef XCASE
+ tp->c_lflag |= XCASE;
++#endif
++#ifdef OLCUC
+ tp->c_oflag |= OLCUC;
++#endif
+ }
+ /* Optionally enable hardware flow control */
+
+@@ -1153,8 +1159,8 @@
+
+ /* Finally, make the new settings effective */
+
+- if (ioctl(0, TCSETA, tp) < 0)
+- error("%s: ioctl: TCSETA: %m", op->tty);
++ if (tcsetattr(0, TCSANOW, tp) < 0)
++ error("%s: tcsetattr: %m", op->tty);
+ }
+
+ /* caps_lock - string contains upper case without lower case */
+diff -ur util-linux-2.12r.old/misc-utils/Makefile util-linux-2.12r/misc-utils/Makefile
+--- util-linux-2.12r.old/misc-utils/Makefile 2004-12-05 20:09:12.000000000 +0100
++++ util-linux-2.12r/misc-utils/Makefile 2006-04-21 18:28:48.000000000 +0200
+@@ -22,7 +22,11 @@
+ USRBIN= cal chkdupexe ddate logger look mcookie \
+ namei rename script whereis
+
+-MAYBE= reset setterm
++MAYBE= reset
++
++ifeq ($(shell uname -s), Linux)
++MAYBE += setterm
++endif
+
+ ifeq "$(HAVE_RESET)" "no"
+ USRBIN:=$(USRBIN) reset
+@@ -39,10 +43,12 @@
+ MAN1:=$(MAN1) kill.1
+ endif
+
++ifeq ($(shell uname -s), Linux)
+ ifeq "$(HAVE_NCURSES)" "yes"
+ USRBIN:=$(USRBIN) setterm
+ MAN1:=$(MAN1) setterm.1
+ endif
++endif
+
+ # For script only
+ LIBPTY=
+@@ -51,7 +57,9 @@
+ endif
+
+ # Programs requiring special compilation
++ifeq ($(shell uname -s), Linux)
+ NEEDS_CURSES= setterm
++endif
+ NEEDS_OPENPTY= script
+
+ all: $(BIN) $(USRBIN) $(USRBIN.NONSHADOW)
+@@ -99,9 +107,11 @@
+ write.o: $(LIB)/carefulputc.h
+ write: write.o $(LIB)/carefulputc.o
+
++ifeq ($(shell uname -s), Linux)
+ ifeq "$(HAVE_NCURSES)" "yes"
+ setterm: setterm.o
+ endif
++endif
+
+ install: all
+ $(INSTALLDIR) $(BINDIR) $(USRBINDIR)
+diff -ur util-linux-2.12r.old/misc-utils/mcookie.c util-linux-2.12r/misc-utils/mcookie.c
+--- util-linux-2.12r.old/misc-utils/mcookie.c 2002-03-09 00:00:52.000000000 +0100
++++ util-linux-2.12r/misc-utils/mcookie.c 2006-04-21 18:28:48.000000000 +0200
+@@ -20,7 +20,7 @@
+ *
+ */
+
+-#ifdef __linux__
++#if defined(__linux__) || defined(__GLIBC__)
+ #define HAVE_GETTIMEOFDAY 1
+ #endif
+
+diff -ur util-linux-2.12r.old/misc-utils/script.c util-linux-2.12r/misc-utils/script.c
+--- util-linux-2.12r.old/misc-utils/script.c 2004-03-26 18:07:16.000000000 +0100
++++ util-linux-2.12r/misc-utils/script.c 2006-04-21 18:28:48.000000000 +0200
+@@ -54,10 +54,8 @@
+ #include <sys/signal.h>
+ #include "nls.h"
+
+-#ifdef __linux__
+ #include <unistd.h>
+ #include <string.h>
+-#endif
+
+ #include "../defines.h"
+ #ifdef HAVE_openpty
+diff -ur util-linux-2.12r.old/sys-utils/Makefile util-linux-2.12r/sys-utils/Makefile
+--- util-linux-2.12r.old/sys-utils/Makefile 2004-11-15 18:47:47.000000000 +0100
++++ util-linux-2.12r/sys-utils/Makefile 2006-04-21 18:28:48.000000000 +0200
+@@ -17,9 +17,9 @@
+ # Where to put binaries?
+ # See the "install" rule for the links. . .
+
+-BIN= arch dmesg
++BIN= arch
+
+-USRBIN= cytune flock ipcrm ipcs renice setsid
++USRBIN= flock ipcrm renice setsid
+
+ USRSBIN= readprofile tunelp
+
+@@ -27,6 +27,11 @@
+
+ NOTMADE=
+
++ifeq ($(shell uname -s), Linux)
++BIN += dmesg
++USRBIN += cytune ipcs
++endif
++
+ CWFLAGS := $(subst -Wmissing-prototypes,,$(CFLAGS))
+
+ ifeq "$(HAVE_SLN)" "no"
+diff -ur util-linux-2.12r.old/text-utils/more.c util-linux-2.12r/text-utils/more.c
+--- util-linux-2.12r.old/text-utils/more.c 2004-12-22 11:46:25.000000000 +0100
++++ util-linux-2.12r/text-utils/more.c 2006-04-21 18:28:48.000000000 +0200
+@@ -1560,10 +1560,6 @@
+ }
+ if (feof (file)) {
+ if (!no_intty) {
+-#ifndef __linux__
+- /* No longer in libc 4.5.8. . . */
+- file->_flags &= ~STDIO_S_EOF_SEEN; /* why doesn't fseek do this ??!!??! */
+-#endif
+ Currline = saveln;
+ Fseek (file, startline);
+ }
+@@ -1804,7 +1800,7 @@
+ no_intty = tcgetattr(fileno(stdin), &otty);
+ tcgetattr(fileno(stderr), &otty);
+ savetty0 = otty;
+- slow_tty = (otty.c_cflag & CBAUD) < B1200;
++ slow_tty = cfgetospeed(&otty) < B1200;
+ hardtabs = (otty.c_oflag & TABDLY) != XTABS;
+ if (!no_tty) {
+ otty.c_lflag &= ~(ICANON|ECHO);
Added: trunk/web/patches/util-linux_2.13.diff
===================================================================
--- trunk/web/patches/util-linux_2.13.diff (rev 0)
+++ trunk/web/patches/util-linux_2.13.diff 2007-10-31 15:29:57 UTC (rev 2010)
@@ -0,0 +1,1057 @@
+
+* hacked version, based on http://youpibouh.thefreecat.org/debian-hurd/util-linux/patch-util-linux
+
+* do not forget to rerun ./autogen.sh
+
+
+diff -u util-linux-2.13/debian/rules util-linux-2.13/debian/rules
+--- util-linux-2.13/debian/rules
++++ util-linux-2.13/debian/rules
+@@ -67,7 +67,7 @@
+ $(MAKE) install DESTDIR=`pwd`/debian/util-linux INSTALL_STRIP_FLAG=""
+ dh_installdocs -i -s
+ install -m 644 login-utils/README.modems-with-agetty debian/util-linux/usr/share/doc/util-linux/README.modems-with-getty
+-ifeq ($(DEB_HOST_ARCH_OS),linux)
++ifneq ($(DEB_HOST_ARCH_OS),hurd)
+ perl -pi.bak -e 's/agetty/getty/g' debian/util-linux/usr/share/man/man8/getty.8 \
+ debian/util-linux/usr/share/doc/util-linux/README.*
+ rm `find debian/util-linux/usr -name \*.bak`
+@@ -80,10 +80,12 @@
+ dh_movefiles --sourcedir=debian/util-linux -i -s
+ #
+ # XXX - push things to where debian has always(?) had them...
++ifeq ($(DEB_HOST_ARCH_OS),linux)
+ mv debian/util-linux/usr/sbin/*part* debian/util-linux/usr/bin
++ mv debian/util-linux/usr/bin/cytune debian/util-linux/usr/sbin
++endif
+ mv debian/util-linux/usr/bin/tailf debian/util-linux/bin
+ mv debian/util-linux/usr/bin/isosize debian/util-linux/sbin
+- mv debian/util-linux/usr/bin/cytune debian/util-linux/usr/sbin
+ mv debian/util-linux/usr/share/man/man8/linux32.8 debian/util-linux/usr/share/man/man1/linux32.1
+ mv debian/util-linux/usr/share/man/man8/linux64.8 debian/util-linux/usr/share/man/man1/linux64.1
+ # the version in bsdmainutils seems newer.
+@@ -126,11 +128,13 @@
+ else
+ cd debian/util-linux && if [ -f sbin/hwclock ] ; then ln -sf hwclock.8.gz usr/share/man/man8/clock.8.gz; fi
+ endif
++ install -m 644 debian/mount.fstab debian/mount/usr/share/doc/mount/examples/fstab
++endif
++ifneq ($(DEB_HOST_ARCH_OS),hurd)
+ cd debian/util-linux/sbin ; mv agetty getty
+ cd debian/util-linux/usr/share/man/man8 ; mv agetty.8 getty.8
+- install -m 644 debian/mount.fstab debian/mount/usr/share/doc/mount/examples/fstab
+ endif
+-ifeq ($(DEB_HOST_GNU_SYSTEM),gnu)
++ifneq ($(DEB_HOST_ARCH_OS),linux)
+ cd debian/util-linux/sbin ; mv mkswap mkswap.linux
+ cd debian/util-linux/usr/share/man/man8 ; mv mkswap.8 mkswap.linux.8
+ endif
+@@ -158,7 +162,7 @@
+ dh_makeshlibs -s
+ dh_installdeb -s
+ dh_shlibdeps -s
+-ifneq ($(DEB_HOST_ARCH_OS),linux)
++ifeq ($(DEB_HOST_ARCH_OS),hurd)
+ echo util-linux:Conflicts=getty >> debian/util-linux.substvars
+ endif
+ dh_gencontrol -s -Xbsdutils
+diff -u util-linux-2.13/login-utils/agetty.c util-linux-2.13/login-utils/agetty.c
+--- util-linux-2.13/login-utils/agetty.c
++++ util-linux-2.13/login-utils/agetty.c
+@@ -18,7 +18,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <sys/ioctl.h>
+-#include <termio.h>
++#include <termios.h>
+ #include <signal.h>
+ #include <errno.h>
+ #include <sys/types.h>
+@@ -36,10 +36,12 @@
+ #include "xstrncpy.h"
+ #include "nls.h"
+
+-#ifdef __linux__
++#if 1
+ #include "pathnames.h"
+ #include <sys/param.h>
+ #define USE_SYSLOG
++#elif defined(__GNU__)
++#define _PATH_LOGIN "/bin/login"
+ #endif
+
+ /* If USE_SYSLOG is undefined all diagnostics go directly to /dev/console. */
+@@ -116,6 +118,10 @@
+ #define TCSETAW TCSETSW
+ #endif
+
++#if defined(__GNU__) || defined(__FreeBSD_kernel__)
++#define termio termios
++#endif
++
+ /*
+ * This program tries to not use the standard-i/o library. This keeps the
+ * executable small on systems that do not have shared libraries (System V
+@@ -312,9 +318,7 @@
+
+ parse_args(argc, argv, &options);
+
+-#ifdef __linux__
+ setsid();
+-#endif
+
+ /* Update the utmp file. */
+
+@@ -789,7 +793,11 @@
+ * 5 seconds seems to be a good value.
+ */
+
++#if defined(__GNU__) || defined(__FreeBSD_kernel__)
++ if (tcgetattr(0, tp) < 0)
++#else
+ if (ioctl(0, TCGETA, tp) < 0)
++#endif
+ error("%s: ioctl: %m", tty);
+
+ /*
+@@ -826,17 +834,26 @@
+ * reads will be done in raw mode anyway. Errors will be dealt with
+ * lateron.
+ */
+-#ifdef __linux__
++#if defined(__linux__) || defined(__GNU__) || defined(__FreeBSD_kernel__)
+ /* flush input and output queues, important for modems! */
+- (void) ioctl(0, TCFLSH, TCIOFLUSH);
++ (void) tcflush(0, TCIOFLUSH);
+ #endif
+
++#if defined(__GNU__) || defined(__FreeBSD_kernel__)
++ tp->c_cflag = CS8 | HUPCL | CREAD;
++ cfsetispeed(tp, speed);
++ cfsetospeed(tp, speed);
++#else
+ tp->c_cflag = CS8 | HUPCL | CREAD | speed;
++#endif
+ if (op->flags & F_LOCAL) {
+ tp->c_cflag |= CLOCAL;
+ }
+
+- tp->c_iflag = tp->c_lflag = tp->c_oflag = tp->c_line = 0;
++ tp->c_iflag = tp->c_lflag = tp->c_oflag = 0;
++#if !defined(__GNU__) && !defined(__FreeBSD_kernel__)
++ tp->c_line = 0;
++#endif
+ tp->c_cc[VMIN] = 1;
+ tp->c_cc[VTIME] = 0;
+
+@@ -847,7 +864,11 @@
+ tp->c_cflag |= CRTSCTS;
+ #endif
+
++#if defined(__GNU__) || defined(__FreeBSD_kernel__)
++ (void) tcsetattr(0, TCSANOW, tp);
++#else
+ (void) ioctl(0, TCSETA, tp);
++#endif
+
+ /* go to blocking input even in local mode */
+ fcntl(0, F_SETFL, fcntl(0, F_GETFL, 0) & ~O_NONBLOCK);
+@@ -891,7 +912,11 @@
+ tp->c_iflag |= ISTRIP; /* enable 8th-bit stripping */
+ vmin = tp->c_cc[VMIN];
+ tp->c_cc[VMIN] = 0; /* don't block if queue empty */
++#if defined(__GNU__) || defined(__FreeBSD_kernel__)
++ (void) tcsetattr(0, TCSANOW, tp);
++#else
+ (void) ioctl(0, TCSETA, tp);
++#endif
+
+ /*
+ * Wait for a while, then read everything the modem has said so far and
+@@ -904,8 +929,13 @@
+ for (bp = buf; bp < buf + nread; bp++) {
+ if (isascii(*bp) && isdigit(*bp)) {
+ if ((speed = bcode(bp))) {
++#if defined(__GNU__) || defined(__FreeBSD_kernel__)
++ cfsetispeed(tp, speed);
++ cfsetospeed(tp, speed);
++#else
+ tp->c_cflag &= ~CBAUD;
+ tp->c_cflag |= speed;
++#endif
+ }
+ break;
+ }
+@@ -915,7 +945,11 @@
+
+ tp->c_iflag = iflag;
+ tp->c_cc[VMIN] = vmin;
++#if defined(__GNU__) || defined(__FreeBSD_kernel__)
++ (void) tcsetattr(0, TCSANOW, tp);
++#else
+ (void) ioctl(0, TCSETA, tp);
++#endif
+ }
+
+ /* do_prompt - show login prompt, optionally preceded by /etc/issue contents */
+@@ -938,7 +972,11 @@
+ if ((op->flags & F_ISSUE) && (fd = fopen(op->issue, "r"))) {
+ oflag = tp->c_oflag; /* save current setting */
+ tp->c_oflag |= (ONLCR | OPOST); /* map NL in output to CR-NL */
++#if defined(__GNU__) || defined(__FreeBSD_kernel__)
++ (void) tcsetattr(0, TCSADRAIN, tp);
++#else
+ (void) ioctl(0, TCSETAW, tp);
++#endif
+
+
+ while ((c = getc(fd)) != EOF)
+@@ -971,7 +1009,7 @@
+
+ case 'o':
+ {
+- char domainname[HOST_NAME_MAX+1];
++ char domainname[HOSTNAME_LENGTH+1];
+ #ifdef HAVE_GETDOMAINNAME
+ if (getdomainname(domainname, sizeof(domainname)))
+ #endif
+@@ -984,7 +1022,7 @@
+ case 'O':
+ {
+ char *dom = "unknown_domain";
+- char host[HOST_NAME_MAX + 1];
++ char host[HOSTNAME_LENGTH + 1];
+ struct addrinfo hints, *info = NULL;
+
+ memset(&hints, 0, sizeof(hints));
+@@ -1042,7 +1080,11 @@
+ int i;
+
+ for (i = 0; speedtab[i].speed; i++) {
++#if defined(__GNU__) || defined(__FreeBSD_kernel__)
++ if (speedtab[i].code == cfgetispeed(tp)) {
++#else
+ if (speedtab[i].code == (tp->c_cflag & CBAUD)) {
++#endif
+ printf("%ld", speedtab[i].speed);
+ break;
+ }
+@@ -1074,12 +1116,16 @@
+ fflush(stdout);
+
+ tp->c_oflag = oflag; /* restore settings */
++#if defined(__GNU__) || defined(__FreeBSD_kernel__)
++ (void) tcsetattr(0, TCSADRAIN, tp);
++#else
+ (void) ioctl(0, TCSETAW, tp); /* wait till output is gone */
++#endif
+ (void) fclose(fd);
+ }
+ #endif
+ {
+- char hn[HOST_NAME_MAX+1];
++ char hn[HOSTNAME_LENGTH+1];
+ if (gethostname(hn, sizeof(hn)) == 0)
+ write(1, hn, strlen(hn));
+ }
+@@ -1095,9 +1141,15 @@
+ static int baud_index = FIRST_SPEED;/* current speed index */
+
+ baud_index = (baud_index + 1) % op->numspeed;
++#if defined(__GNU__) || defined(__FreeBSD_kernel__)
++ cfsetispeed(tp, op->speeds[baud_index]);
++ cfsetospeed(tp, op->speeds[baud_index]);
++ (void) tcsetattr(0, TCSANOW, tp);
++#else
+ tp->c_cflag &= ~CBAUD;
+ tp->c_cflag |= op->speeds[baud_index];
+ (void) ioctl(0, TCSETA, tp);
++#endif
+ }
+
+ /* get_logname - get user name, establish parity, speed, erase, kill, eol */
+@@ -1127,7 +1179,7 @@
+ /* Flush pending input (esp. after parsing or switching the baud rate). */
+
+ (void) sleep(1);
+- (void) ioctl(0, TCFLSH, TCIFLUSH);
++ (void) tcflush(0, TCIFLUSH);
+
+ /* Prompt for and read a login name. */
+
+@@ -1232,7 +1284,7 @@
+ tp->c_cc[VEOL] = DEF_EOL;
+ #ifdef __linux__
+ tp->c_cc[VSWTC] = DEF_SWITCH; /* default switch character */
+-#else
++#elif defined(VSWTCH)
+ tp->c_cc[VSWTCH] = DEF_SWITCH; /* default switch character */
+ #endif
+
+@@ -1265,9 +1317,15 @@
+ /* Account for upper case without lower case. */
+
+ if (cp->capslock) {
++#ifdef IUCLC
+ tp->c_iflag |= IUCLC;
++#endif
++#ifdef XCASE
+ tp->c_lflag |= XCASE;
++#endif
++#ifdef OLCUC
+ tp->c_oflag |= OLCUC;
++#endif
+ }
+ /* Optionally enable hardware flow control */
+
+@@ -1278,7 +1336,11 @@
+
+ /* Finally, make the new settings effective */
+
++#if defined(__GNU__) || defined(__FreeBSD_kernel__)
++ if (tcsetattr(0, TCSANOW, tp) < 0)
++#else
+ if (ioctl(0, TCSETA, tp) < 0)
++#endif
+ error("%s: ioctl: TCSETA: %m", op->tty);
+ }
+
+--- util-linux-2.13/sys-utils/Makefile.am
++++ util-linux-2.13/sys-utils/Makefile.am
+@@ -1,14 +1,25 @@
+ include $(top_srcdir)/config/include-Makefile.am
+
+-bin_PROGRAMS = dmesg
++bin_PROGRAMS =
++if LINUX
++bin_PROGRAMS += dmesg
++endif
+
+-usrbinexec_PROGRAMS = cytune flock ipcrm ipcs renice setsid setarch
++usrbinexec_PROGRAMS = flock renice setsid
++if LINUX
++usrbinexec_PROGRAMS += cytune setarch ipcrm ipcs
++endif
+
+ cytune_SOURCES = cytune.c cyclades.h
+
++if LINUX
+ sbin_PROGRAMS = ctrlaltdel
++endif
+
+-usrsbinexec_PROGRAMS = readprofile tunelp rtcwake
++usrsbinexec_PROGRAMS = readprofile
++if LINUX
++usrsbinexec_PROGRAMS += tunelp rtcwake
++endif
+
+ tunelp_SOURCES = tunelp.c lp.h
+
+diff -u util-linux-2.13/fdisk/sfdisk.c util-linux-2.13/fdisk/sfdisk.c
+--- util-linux-2.13/fdisk/sfdisk.c
++++ util-linux-2.13/fdisk/sfdisk.c
+@@ -46,7 +46,6 @@
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
+ #include <sys/utsname.h>
+-#include <linux/unistd.h> /* _syscall */
+ #include "nls.h"
+ #include "common.h"
+
+diff -u util-linux-2.13/text-utils/more.c util-linux-2.13/text-utils/more.c
+--- util-linux-2.13/text-utils/more.c
++++ util-linux-2.13/text-utils/more.c
+@@ -1573,7 +1573,7 @@
+ }
+ if (feof (file)) {
+ if (!no_intty) {
+-#ifndef __linux__
++#if !defined(__linux__) && !defined(__GLIBC__)
+ /* No longer in libc 4.5.8. . . */
+ file->_flags &= ~STDIO_S_EOF_SEEN; /* why doesn't fseek do this ??!!??! */
+ #endif
+@@ -1817,8 +1817,16 @@
+ no_intty = tcgetattr(fileno(stdin), &otty);
+ tcgetattr(fileno(stderr), &otty);
+ savetty0 = otty;
++#if defined(__GNU__) || defined(__FreeBSD_kernel__)
++ slow_tty = cfgetispeed(&otty) < B1200;
++#else
+ slow_tty = (otty.c_cflag & CBAUD) < B1200;
++#endif
++#if defined(__FreeBSD_kernel__)
++ hardtabs = 1;
++#else
+ hardtabs = (otty.c_oflag & TABDLY) != XTABS;
++#endif
+ if (!no_tty) {
+ otty.c_lflag &= ~(ICANON|ECHO);
+ otty.c_cc[VMIN] = 1;
+diff -u util-linux-2.13/misc-utils/script.c util-linux-2.13/misc-utils/script.c
+--- util-linux-2.13/misc-utils/script.c
++++ util-linux-2.13/misc-utils/script.c
+@@ -53,12 +53,12 @@
+ #include <sys/file.h>
+ #include <sys/signal.h>
+ #include <errno.h>
++#include <getopt.h>
++#include <string.h>
+ #include "nls.h"
+
+-#ifdef __linux__
+ #include <unistd.h>
+ #include <string.h>
+-#endif
+
+ #ifdef HAVE_LIBUTIL
+ #include <pty.h>
+diff -u util-linux-2.13/configure.ac util-linux-2.13/configure.ac
+--- util-linux-2.13/configure.ac
++++ util-linux-2.13/configure.ac
+@@ -235,6 +235,14 @@
+ [AC_MSG_NOTICE([Your libc thinks that swapon has 1 arg only.])
+ ])
+
++case "${host_os}" in
++ linux*)
++ AM_CONDITIONAL(LINUX,true)
++ ;;
++ *)
++ AM_CONDITIONAL(LINUX,false)
++ ;;
++esac
+
+ dnl UTIL_SET_ARCH(ARCHNAME, PATTERN)
+ dnl ---------------------------------
+only in patch2:
+unchanged:
+--- util-linux-2.13.orig/fdisk/fdisksgilabel.c
++++ util-linux-2.13/fdisk/fdisksgilabel.c
+@@ -19,10 +19,10 @@
+ #include <sys/ioctl.h> /* ioctl */
+ #include <sys/stat.h> /* stat */
+ #include <assert.h> /* assert */
++#include <stdint.h> /* uint*_t */
+
+ #include <endian.h>
+ #include "nls.h"
+-#include <linux/major.h> /* FLOPPY_MAJOR */
+
+ #include "common.h"
+ #include "fdisk.h"
+@@ -100,11 +100,11 @@
+
+ static inline unsigned short
+ __swap16(unsigned short x) {
+- return (((__u16)(x) & 0xFF) << 8) | (((__u16)(x) & 0xFF00) >> 8);
++ return (((uint16_t)(x) & 0xFF) << 8) | (((uint16_t)(x) & 0xFF00) >> 8);
+ }
+
+-static inline __u32
+-__swap32(__u32 x) {
++static inline uint32_t
++__swap32(uint32_t x) {
+ return (((x & 0xFF) << 24) |
+ ((x & 0xFF00) << 8) |
+ ((x & 0xFF0000) >> 8) |
+@@ -222,8 +222,8 @@
+ w + 1, _("Device"));
+ for (i = 0 ; i < partitions; i++) {
+ if (sgi_get_num_sectors(i) || debug) {
+- __u32 start = sgi_get_start_sector(i);
+- __u32 len = sgi_get_num_sectors(i);
++ uint32_t start = sgi_get_start_sector(i);
++ uint32_t len = sgi_get_num_sectors(i);
+ kpi++; /* only count nonempty partitions */
+ printf(
+ "%2d: %s %4s %9ld %9ld %9ld %2x %s\n",
+@@ -244,8 +244,8 @@
+ sgilabel->boot_file);
+ for (i = 0 ; i < volumes; i++) {
+ if (sgilabel->directory[i].vol_file_size) {
+- __u32 start = SSWAP32(sgilabel->directory[i].vol_file_start);
+- __u32 len = SSWAP32(sgilabel->directory[i].vol_file_size);
++ uint32_t start = SSWAP32(sgilabel->directory[i].vol_file_start);
++ uint32_t len = SSWAP32(sgilabel->directory[i].vol_file_size);
+ unsigned char *name = sgilabel->directory[i].vol_file_name;
+ printf(_("%2d: %-10s sector%5u size%8u\n"),
+ i, name, (unsigned int) start,
+only in patch2:
+unchanged:
+--- util-linux-2.13.orig/fdisk/fdiskbsdlabel.c
++++ util-linux-2.13/fdisk/fdiskbsdlabel.c
+@@ -62,6 +62,10 @@
+ #define DKTYPENAMES
+ #include "fdiskbsdlabel.h"
+
++#ifndef MAXPATHLEN
++#define MAXPATHLEN 4096
++#endif
++
+ static void xbsd_delete_part (void);
+ static void xbsd_new_part (void);
+ static void xbsd_write_disklabel (void);
+only in patch2:
+unchanged:
+--- util-linux-2.13.orig/fdisk/fdisksgilabel.h
++++ util-linux-2.13/fdisk/fdisksgilabel.h
+@@ -1,7 +1,7 @@
+ #ifndef FDISK_SGI_LABEL_H
+ #define FDISK_SGI_LABEL_H
+
+-#include <linux/types.h> /* for __u32 etc */
++#include <stdint.h> /* for uint32_t etc */
+ /*
+ * Copyright (C) Andreas Neuper, Sep 1998.
+ * This file may be modified and redistributed under
+@@ -99,9 +99,9 @@
+ #define SGI_INFO_MAGIC 0x00072959
+ #define SGI_INFO_MAGIC_SWAPPED 0x59290700
+ #define SSWAP16(x) (other_endian ? __swap16(x) \
+- : (__u16)(x))
++ : (uint16_t)(x))
+ #define SSWAP32(x) (other_endian ? __swap32(x) \
+- : (__u32)(x))
++ : (uint32_t)(x))
+
+ /* fdisk.c */
+ #define sgilabel ((sgi_partition *)MBRbuffer)
+only in patch2:
+unchanged:
+--- util-linux-2.13.orig/fdisk/fdiskbsdlabel.h
++++ util-linux-2.13/fdisk/fdiskbsdlabel.h
+@@ -34,10 +34,10 @@
+ * SUCH DAMAGE.
+ */
+
+-#include <linux/types.h> /* for __u32, __u16, __u8, __s16 */
++#include <stdint.h> /* for uint32_t, uint16_t, uint8_t, int16_t */
+
+ #ifndef BSD_DISKMAGIC
+-#define BSD_DISKMAGIC ((__u32) 0x82564557)
++#define BSD_DISKMAGIC ((uint32_t) 0x82564557)
+ #endif
+
+ #ifndef BSD_MAXPARTITIONS
+@@ -63,31 +63,31 @@
+ #define BSD_SBSIZE 8192 /* max size of fs superblock */
+
+ struct xbsd_disklabel {
+- __u32 d_magic; /* the magic number */
+- __s16 d_type; /* drive type */
+- __s16 d_subtype; /* controller/d_type specific */
++ uint32_t d_magic; /* the magic number */
++ int16_t d_type; /* drive type */
++ int16_t d_subtype; /* controller/d_type specific */
+ char d_typename[16]; /* type name, e.g. "eagle" */
+ char d_packname[16]; /* pack identifier */
+ /* disk geometry: */
+- __u32 d_secsize; /* # of bytes per sector */
+- __u32 d_nsectors; /* # of data sectors per track */
+- __u32 d_ntracks; /* # of tracks per cylinder */
+- __u32 d_ncylinders; /* # of data cylinders per unit */
+- __u32 d_secpercyl; /* # of data sectors per cylinder */
+- __u32 d_secperunit; /* # of data sectors per unit */
++ uint32_t d_secsize; /* # of bytes per sector */
++ uint32_t d_nsectors; /* # of data sectors per track */
++ uint32_t d_ntracks; /* # of tracks per cylinder */
++ uint32_t d_ncylinders; /* # of data cylinders per unit */
++ uint32_t d_secpercyl; /* # of data sectors per cylinder */
++ uint32_t d_secperunit; /* # of data sectors per unit */
+ /*
+ * Spares (bad sector replacements) below
+ * are not counted in d_nsectors or d_secpercyl.
+ * Spare sectors are assumed to be physical sectors
+ * which occupy space at the end of each track and/or cylinder.
+ */
+- __u16 d_sparespertrack; /* # of spare sectors per track */
+- __u16 d_sparespercyl; /* # of spare sectors per cylinder */
++ uint16_t d_sparespertrack; /* # of spare sectors per track */
++ uint16_t d_sparespercyl; /* # of spare sectors per cylinder */
+ /*
+ * Alternate cylinders include maintenance, replacement,
+ * configuration description areas, etc.
+ */
+- __u32 d_acylinders; /* # of alt. cylinders per unit */
++ uint32_t d_acylinders; /* # of alt. cylinders per unit */
+
+ /* hardware characteristics: */
+ /*
+@@ -106,30 +106,30 @@
+ * Finally, d_cylskew is the offset of sector 0 on cylinder N
+ * relative to sector 0 on cylinder N-1.
+ */
+- __u16 d_rpm; /* rotational speed */
+- __u16 d_interleave; /* hardware sector interleave */
+- __u16 d_trackskew; /* sector 0 skew, per track */
+- __u16 d_cylskew; /* sector 0 skew, per cylinder */
+- __u32 d_headswitch; /* head switch time, usec */
+- __u32 d_trkseek; /* track-to-track seek, usec */
+- __u32 d_flags; /* generic flags */
++ uint16_t d_rpm; /* rotational speed */
++ uint16_t d_interleave; /* hardware sector interleave */
++ uint16_t d_trackskew; /* sector 0 skew, per track */
++ uint16_t d_cylskew; /* sector 0 skew, per cylinder */
++ uint32_t d_headswitch; /* head switch time, usec */
++ uint32_t d_trkseek; /* track-to-track seek, usec */
++ uint32_t d_flags; /* generic flags */
+ #define NDDATA 5
+- __u32 d_drivedata[NDDATA]; /* drive-type specific information */
++ uint32_t d_drivedata[NDDATA]; /* drive-type specific information */
+ #define NSPARE 5
+- __u32 d_spare[NSPARE]; /* reserved for future use */
+- __u32 d_magic2; /* the magic number (again) */
+- __u16 d_checksum; /* xor of data incl. partitions */
++ uint32_t d_spare[NSPARE]; /* reserved for future use */
++ uint32_t d_magic2; /* the magic number (again) */
++ uint16_t d_checksum; /* xor of data incl. partitions */
+ /* filesystem and partition information: */
+- __u16 d_npartitions; /* number of partitions in following */
+- __u32 d_bbsize; /* size of boot area at sn0, bytes */
+- __u32 d_sbsize; /* max size of fs superblock, bytes */
++ uint16_t d_npartitions; /* number of partitions in following */
++ uint32_t d_bbsize; /* size of boot area at sn0, bytes */
++ uint32_t d_sbsize; /* max size of fs superblock, bytes */
+ struct xbsd_partition { /* the partition table */
+- __u32 p_size; /* number of sectors in partition */
+- __u32 p_offset; /* starting sector */
+- __u32 p_fsize; /* filesystem basic fragment size */
+- __u8 p_fstype; /* filesystem type, see below */
+- __u8 p_frag; /* filesystem fragments per block */
+- __u16 p_cpg; /* filesystem cylinders per group */
++ uint32_t p_size; /* number of sectors in partition */
++ uint32_t p_offset; /* starting sector */
++ uint32_t p_fsize; /* filesystem basic fragment size */
++ uint8_t p_fstype; /* filesystem type, see below */
++ uint8_t p_frag; /* filesystem fragments per block */
++ uint16_t p_cpg; /* filesystem cylinders per group */
+ } d_partitions[BSD_MAXPARTITIONS]; /* actually may be more */
+ };
+
+only in patch2:
+unchanged:
+--- util-linux-2.13.orig/fdisk/fdiskaixlabel.h
++++ util-linux-2.13/fdisk/fdiskaixlabel.h
+@@ -1,7 +1,7 @@
+ #ifndef FDISK_AIX_LABEL_H
+ #define FDISK_AIX_LABEL_H
+
+-#include <linux/types.h> /* for __u32 etc */
++#include <stdint.h> /* for uint32_t etc */
+ /*
+ * Copyright (C) Andreas Neuper, Sep 1998.
+ * This file may be redistributed under
+only in patch2:
+unchanged:
+--- util-linux-2.13.orig/fdisk/fdisksunlabel.h
++++ util-linux-2.13/fdisk/fdisksunlabel.h
+@@ -1,15 +1,15 @@
+ #ifndef FDISK_SUN_LABEL_H
+ #define FDISK_SUN_LABEL_H
+
+-#include <linux/types.h> /* for __u16, __u32 */
++#include <stdint.h> /* for uint16_t, uint32_t */
+
+ struct sun_partition {
+- __u32 start_cylinder;
+- __u32 num_sectors;
++ uint32_t start_cylinder;
++ uint32_t num_sectors;
+ };
+
+ struct sun_tag_flag {
+- __u16 tag;
++ uint16_t tag;
+ #define SUN_TAG_UNASSIGNED 0x00 /* Unassigned partition */
+ #define SUN_TAG_BOOT 0x01 /* Boot partition */
+ #define SUN_TAG_ROOT 0x02 /* Root filesystem */
+@@ -27,7 +27,7 @@
+ #define SUN_TAG_LINUX_LVM 0x8e /* Linux LVM */
+ #define SUN_TAG_LINUX_RAID 0xfd /* LInux RAID */
+
+- __u16 flag;
++ uint16_t flag;
+ #define SUN_FLAG_UNMNT 0x01 /* Unmountable partition*/
+ #define SUN_FLAG_RONLY 0x10 /* Read only */
+ };
+@@ -43,32 +43,32 @@
+
+ struct sun_disk_label {
+ char label_id[SUN_LABEL_ID_SIZE];
+- __u32 version;
++ uint32_t version;
+ char volume_id[SUN_VOLUME_ID_SIZE];
+- __u16 num_partitions;
++ uint16_t num_partitions;
+ struct sun_tag_flag part_tags[SUN_NUM_PARTITIONS];
+- __u32 bootinfo[3];
+- __u32 sanity;
+- __u32 resv[10];
+- __u32 part_timestamps[SUN_NUM_PARTITIONS];
+- __u32 write_reinstruct;
+- __u32 read_reinstruct;
+- __u8 pad[148];
+- __u16 rpm;
+- __u16 pcyl;
+- __u16 apc;
+- __u16 resv1;
+- __u16 resv2;
+- __u16 intrlv;
+- __u16 ncyl;
+- __u16 acyl;
+- __u16 nhead;
+- __u16 nsect;
+- __u16 resv3;
+- __u16 resv4;
++ uint32_t bootinfo[3];
++ uint32_t sanity;
++ uint32_t resv[10];
++ uint32_t part_timestamps[SUN_NUM_PARTITIONS];
++ uint32_t write_reinstruct;
++ uint32_t read_reinstruct;
++ uint8_t pad[148];
++ uint16_t rpm;
++ uint16_t pcyl;
++ uint16_t apc;
++ uint16_t resv1;
++ uint16_t resv2;
++ uint16_t intrlv;
++ uint16_t ncyl;
++ uint16_t acyl;
++ uint16_t nhead;
++ uint16_t nsect;
++ uint16_t resv3;
++ uint16_t resv4;
+ struct sun_partition partitions[SUN_NUM_PARTITIONS];
+- __u16 magic;
+- __u16 cksum;
++ uint16_t magic;
++ uint16_t cksum;
+ };
+
+ #define SUN_LABEL_MAGIC 0xDABE
+@@ -82,7 +82,7 @@
+ extern void sun_nolabel(void);
+ extern void create_sunlabel(void);
+ extern void sun_delete_partition(int i);
+-extern int sun_change_sysid(int i, __u16 sys);
++extern int sun_change_sysid(int i, uint16_t sys);
+ extern void sun_list_table(int xtra);
+ extern void verify_sun(void);
+ extern void add_sun_partition(int n, int sys);
+@@ -93,7 +93,7 @@
+ extern void sun_set_ilfact(void);
+ extern void sun_set_rspeed(void);
+ extern void sun_set_pcylcount(void);
+-extern void toggle_sunflags(int i, __u16 mask);
++extern void toggle_sunflags(int i, uint16_t mask);
+ extern int sun_get_sysid(int i);
+
+ #endif /* FDISK_SUN_LABEL_H */
+only in patch2:
+unchanged:
+--- util-linux-2.13.orig/fdisk/fdiskmaclabel.h
++++ util-linux-2.13/fdisk/fdiskmaclabel.h
+@@ -1,7 +1,7 @@
+ #ifndef FDISK_MAC_LABEL_H
+ #define FDISK_MAC_LABEL_H
+
+-#include <linux/types.h> /* for __u32 etc */
++#include <stdint.h> /* for uint32_t etc */
+ /*
+ * Copyright (C) Andreas Neuper, Sep 1998.
+ * This file may be redistributed under
+only in patch2:
+unchanged:
+--- util-linux-2.13.orig/fdisk/fdisksunlabel.c
++++ util-linux-2.13/fdisk/fdisksunlabel.c
+@@ -17,6 +17,7 @@
+ #include <sys/ioctl.h> /* ioctl */
+ #include <sys/stat.h> /* stat */
+ #include <sys/sysmacros.h> /* major */
++#include <stdint.h> /* uint*_t */
+
+ #include "nls.h"
+
+@@ -26,7 +27,9 @@
+ #include <scsi/scsi.h> /* SCSI_IOCTL_GET_IDLUN */
+ #undef u_char
+ #endif
++#ifdef __linux__
+ #include <linux/major.h> /* FLOPPY_MAJOR */
++#endif
+
+ #include "common.h"
+ #include "fdisk.h"
+@@ -57,17 +60,20 @@
+ };
+
+ static inline unsigned short __swap16(unsigned short x) {
+- return (((__u16)(x) & 0xFF) << 8) | (((__u16)(x) & 0xFF00) >> 8);
++ return (((uint16_t)(x) & 0xFF) << 8) | (((uint16_t)(x) & 0xFF00) >> 8);
+ }
+-static inline __u32 __swap32(__u32 x) {
+- return (((__u32)(x) & 0xFF) << 24) | (((__u32)(x) & 0xFF00) << 8) | (((__u32)(x) & 0xFF0000) >> 8) | (((__u32)(x) & 0xFF000000) >> 24);
++static inline uint32_t __swap32(uint32_t x) {
++ return (((uint32_t)(x) & 0xFF) << 24) | (((uint32_t)(x) & 0xFF00) << 8) | (((uint32_t)(x) & 0xFF0000) >> 8) | (((uint32_t)(x) & 0xFF000000) >> 24);
+ }
+
+ #define SSWAP16(x) (other_endian ? __swap16(x) \
+- : (__u16)(x))
++ : (uint16_t)(x))
+ #define SSWAP32(x) (other_endian ? __swap32(x) \
+- : (__u32)(x))
++ : (uint32_t)(x))
+
++#ifndef FLOPPY_MAJOR
++#define FLOPPY_MAJOR 2
++#endif
+ #ifndef IDE0_MAJOR
+ #define IDE0_MAJOR 3
+ #endif
+@@ -96,7 +102,7 @@
+ }
+ }
+
+-static void set_sun_partition(int i, __u32 start, __u32 stop, __u16 sysid)
++static void set_sun_partition(int i, uint32_t start, uint32_t stop, uint16_t sysid)
+ {
+ sunlabel->part_tags[i].tag = SSWAP16(sysid);
+ sunlabel->part_tags[i].flag = SSWAP16(0);
+@@ -270,7 +276,7 @@
+ set_changed(0);
+ }
+
+-void toggle_sunflags(int i, __u16 mask)
++void toggle_sunflags(int i, uint16_t mask)
+ {
+ struct sun_tag_flag *p = &sunlabel->part_tags[i];
+
+@@ -279,7 +285,7 @@
+ set_changed(i);
+ }
+
+-static void fetch_sun(__u32 *starts, __u32 *lens, __u32 *start, __u32 *stop)
++static void fetch_sun(uint32_t *starts, uint32_t *lens, uint32_t *start, uint32_t *stop)
+ {
+ int i, continuous = 1;
+
+@@ -328,7 +334,7 @@
+
+ void verify_sun(void)
+ {
+- __u32 starts[SUN_NUM_PARTITIONS], lens[SUN_NUM_PARTITIONS], start, stop;
++ uint32_t starts[SUN_NUM_PARTITIONS], lens[SUN_NUM_PARTITIONS], start, stop;
+ int i,j,k,starto,endo;
+ int array[SUN_NUM_PARTITIONS];
+
+@@ -394,10 +400,10 @@
+
+ void add_sun_partition(int n, int sys)
+ {
+- __u32 starts[SUN_NUM_PARTITIONS], lens[SUN_NUM_PARTITIONS];
++ uint32_t starts[SUN_NUM_PARTITIONS], lens[SUN_NUM_PARTITIONS];
+ struct sun_partition *part = &sunlabel->partitions[n];
+ struct sun_tag_flag *tag = &sunlabel->part_tags[n];
+- __u32 start, stop, stop2;
++ uint32_t start, stop, stop2;
+ int whole_disk = 0;
+
+ char mesg[256];
+@@ -530,7 +536,7 @@
+ part->num_sectors = 0;
+ }
+
+-int sun_change_sysid(int i, __u16 sys)
++int sun_change_sysid(int i, uint16_t sys)
+ {
+ struct sun_partition *part = &sunlabel->partitions[i];
+ struct sun_tag_flag *tag = &sunlabel->part_tags[i];
+@@ -597,8 +603,8 @@
+ struct sun_tag_flag *tag = &sunlabel->part_tags[i];
+
+ if (part->num_sectors) {
+- __u32 start = SSWAP32(part->start_cylinder) * heads * sectors;
+- __u32 len = SSWAP32(part->num_sectors);
++ uint32_t start = SSWAP32(part->start_cylinder) * heads * sectors;
++ uint32_t len = SSWAP32(part->num_sectors);
+ printf(
+ "%s %c%c %9ld %9ld %9ld%c %2x %s\n",
+ /* device */ partname(disk_device, i+1, w),
+only in patch2:
+unchanged:
+--- util-linux-2.13.orig/fdisk/cfdisk.c
++++ util-linux-2.13/fdisk/cfdisk.c
+@@ -78,7 +78,6 @@
+ #include <string.h>
+ #include <sys/stat.h>
+ #include <sys/ioctl.h>
+-#include <linux/types.h>
+
+ #include "nls.h"
+ #include "xstrncpy.h"
+only in patch2:
+unchanged:
+--- util-linux-2.13.orig/sys-utils/rdev.c
++++ util-linux-2.13/sys-utils/rdev.c
+@@ -94,6 +94,10 @@
+
+ #define DEFAULT_OFFSET 508
+
++#ifndef PATH_MAX
++#define PATH_MAX 4096
++#endif
++
+
+ static void
+ die(char *msg) {
+only in patch2:
+unchanged:
+--- util-linux-2.13.orig/misc-utils/namei.c
++++ util-linux-2.13/misc-utils/namei.c
+@@ -59,6 +59,10 @@
+ #include <sys/param.h>
+ #include "nls.h"
+
++#ifndef MAXPATHLEN
++#define MAXPATHLEN 4096
++#endif
++
+ #define ERR strerror(errno),errno
+
+ int symcount;
+only in patch2:
+unchanged:
+--- util-linux-2.13.orig/misc-utils/Makefile.am
++++ util-linux-2.13/misc-utils/Makefile.am
+@@ -34,8 +34,10 @@
+ endif
+
+ if HAVE_NCURSES
++if LINUX
+ usrbinexec_PROGRAMS += setterm
+ man_MANS += setterm.1
++endif
+ if HAVE_TINFO
+ setterm_LDADD = -ltinfo
+ else
+only in patch2:
+unchanged:
+--- util-linux-2.13.orig/disk-utils/Makefile.am
++++ util-linux-2.13/disk-utils/Makefile.am
+@@ -1,6 +1,6 @@
+ include $(top_srcdir)/config/include-Makefile.am
+
+-man_MANS = blockdev.8 fdformat.8 isosize.8 mkfs.8 mkswap.8 \
++man_MANS = blockdev.8 isosize.8 mkfs.8 mkswap.8 \
+ fsck.minix.8 mkfs.minix.8 mkfs.bfs.8
+
+ sbin_PROGRAMS = mkfs mkswap blockdev fsck.minix mkfs.minix mkfs.bfs
+@@ -9,7 +9,12 @@
+ mkfs_bfs_SOURCES = mkfs.bfs.c
+ mkswap_SOURCES = mkswap.c swapheader.h
+
+-usrbinexec_PROGRAMS = fdformat isosize
++usrbinexec_PROGRAMS = isosize
++
++if LINUX
++man_MANS += fdformat.8
++usrbinexec_PROGRAMS += fdformat
++endif
+
+ if BUILD_ELVTUNE
+ sbin_PROGRAMS += elvtune
+only in patch2:
+unchanged:
+--- util-linux-2.13.orig/login-utils/wall.c
++++ util-linux-2.13/login-utils/wall.c
+@@ -63,6 +63,10 @@
+ #include "pathnames.h"
+ #include "carefulputc.h"
+
++#ifndef MAXHOSTNAMELEN
++#define MAXHOSTNAMELEN 64
++#endif
++
+ void makemsg __P((char *));
+
+ #define IGNOREUSER "sleeper"
+only in patch2:
+unchanged:
+--- util-linux-2.13.orig/login-utils/checktty.c
++++ util-linux-2.13/login-utils/checktty.c
+@@ -25,7 +25,9 @@
+ #include "nls.h"
+
+ #include <sys/sysmacros.h>
++#ifdef __linux__
+ #include <linux/major.h>
++#endif
+
+ #include "pathnames.h"
+ #include "login.h"
+@@ -118,6 +120,7 @@
+ static int
+ isapty(const char *tty)
+ {
++#ifdef __linux__
+ char devname[100];
+ struct stat stb;
+
+@@ -147,6 +150,7 @@
+ #endif
+
+ }
++#endif
+ return 0;
+ }
+
+only in patch2:
+unchanged:
+--- util-linux-2.13.orig/schedutils/Makefile.am
++++ util-linux-2.13/schedutils/Makefile.am
+@@ -2,12 +2,16 @@
+
+ if BUILD_SCHEDUTILS
+
+-usrbinexec_PROGRAMS = chrt ionice
+-man_MANS = chrt.1 ionice.1
++usrbinexec_PROGRAMS =
++man_MANS =
+
++if LINUX
++usrbinexec_PROGRAMS += ionice chrt
++man_MANS += ionice.1 chrt.1
+ if HAVE_SCHED_GETAFFINITY
+ usrbinexec_PROGRAMS += taskset
+ man_MANS += taskset.1
+ endif
++endif
+
+ endif
+only in patch2:
+unchanged:
+--- util-linux-2.13.orig/Makefile.am
++++ util-linux-2.13/Makefile.am
+@@ -8,14 +8,19 @@
+ hwclock \
+ login-utils \
+ misc-utils \
+- mount \
+- partx \
+ po \
+ schedutils \
+ sys-utils \
+ text-utils \
+ tests
+
++if LINUX
++SUBDIRS += \
++ mount \
++ partx
++endif
++
++
+ ACLOCAL_AMFLAGS = -I m4
+
+ EXTRA_DIST = \
More information about the Glibc-bsd-commits
mailing list