util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Patches for kFreeBSD support from Debian
@ 2014-08-24 16:04 Andreas Henriksson
  2014-08-24 16:04 ` [PATCH 1/4] Report correct disk size on GNU/kFreeBSD. Thanks Tuco Andreas Henriksson
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Andreas Henriksson @ 2014-08-24 16:04 UTC (permalink / raw)
  To: util-linux; +Cc: Andreas Henriksson

Hello!

This is the patch set that has been shipping since forever
in Debian (minus the last one from me, which is new).
The patches where against util-linux 2.20.x before
I rebased them against current master.

I've failed to get the original patch authors to sign off
and submit their own patches, but as discussed on irc
I'm forwarding them to you 'as is'.


Andreas Henriksson (1):
  kFreeBSD: add hacks in ipcrm to avoid FTBFS

Aurelien Jarno (1):
  remaining kFreeBSD hackery for building.

Christoph Egger (1):
  Fixing FTBFS on !linux (Debian util-linux 2.20.1-1.2)

Robert Millan (1):
  Report correct disk size on GNU/kFreeBSD. Thanks Tuco.

 include/ttyutils.h       | 40 ++++++++++++++++++++++++++++++++++++++++
 lib/blkdev.c             |  4 ++++
 sys-utils/ipcrm.c        |  7 +++++++
 sys-utils/ipcs.c         |  2 ++
 term-utils/Makemodule.am |  1 +
 term-utils/agetty.c      | 16 ++++++++++++++++
 6 files changed, 70 insertions(+)

-- 
2.1.0.rc1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/4] Report correct disk size on GNU/kFreeBSD. Thanks Tuco.
  2014-08-24 16:04 [PATCH 0/4] Patches for kFreeBSD support from Debian Andreas Henriksson
@ 2014-08-24 16:04 ` Andreas Henriksson
  2014-08-24 16:04 ` [PATCH 2/4] remaining kFreeBSD hackery for building Andreas Henriksson
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Andreas Henriksson @ 2014-08-24 16:04 UTC (permalink / raw)
  To: util-linux; +Cc: Robert Millan

From: Robert Millan <rmh@debian.org>

Addresses-Debian-Bug: 592292
---
 lib/blkdev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/blkdev.c b/lib/blkdev.c
index f8182c0..a293529 100644
--- a/lib/blkdev.c
+++ b/lib/blkdev.c
@@ -25,6 +25,10 @@
 #include <sys/disk.h>
 #endif
 
+#ifdef __FreeBSD_kernel__
+#include <sys/disk.h>
+#endif
+
 #include "blkdev.h"
 #include "c.h"
 #include "linux_version.h"
-- 
2.1.0.rc1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4] remaining kFreeBSD hackery for building.
  2014-08-24 16:04 [PATCH 0/4] Patches for kFreeBSD support from Debian Andreas Henriksson
  2014-08-24 16:04 ` [PATCH 1/4] Report correct disk size on GNU/kFreeBSD. Thanks Tuco Andreas Henriksson
@ 2014-08-24 16:04 ` Andreas Henriksson
  2014-08-24 16:04 ` [PATCH 3/4] Fixing FTBFS on !linux (Debian util-linux 2.20.1-1.2) Andreas Henriksson
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Andreas Henriksson @ 2014-08-24 16:04 UTC (permalink / raw)
  To: util-linux; +Cc: Aurelien Jarno, LaMont Jones

From: Aurelien Jarno <aurel32@debian.org>

Addresses-Debian-Bug: #527384
Signed-off-by: LaMont Jones <lamont@debian.org>
---
 sys-utils/ipcs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys-utils/ipcs.c b/sys-utils/ipcs.c
index 8ed5698..9ce5366 100644
--- a/sys-utils/ipcs.c
+++ b/sys-utils/ipcs.c
@@ -461,8 +461,10 @@ static void do_msg (char format, int unit)
 			return;
 		}
 		printf (_("------ Messages Status --------\n"));
+#ifndef __FreeBSD_kernel__
 		printf (_("allocated queues = %d\n"), msginfo.msgpool);
 		printf (_("used headers = %d\n"), msginfo.msgmap);
+#endif
 		ipc_print_size(unit, _("used space"), msginfo.msgtql,
 			       unit == IPC_UNIT_DEFAULT ? _(" bytes\n") : "\n", 0);
 		return;
-- 
2.1.0.rc1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4] Fixing FTBFS on !linux (Debian util-linux 2.20.1-1.2)
  2014-08-24 16:04 [PATCH 0/4] Patches for kFreeBSD support from Debian Andreas Henriksson
  2014-08-24 16:04 ` [PATCH 1/4] Report correct disk size on GNU/kFreeBSD. Thanks Tuco Andreas Henriksson
  2014-08-24 16:04 ` [PATCH 2/4] remaining kFreeBSD hackery for building Andreas Henriksson
@ 2014-08-24 16:04 ` Andreas Henriksson
  2014-08-24 16:04 ` [PATCH 4/4] kFreeBSD: add hacks in ipcrm to avoid FTBFS Andreas Henriksson
  2014-09-17  9:00 ` [PATCH 0/4] Patches for kFreeBSD support from Debian Karel Zak
  4 siblings, 0 replies; 7+ messages in thread
From: Andreas Henriksson @ 2014-08-24 16:04 UTC (permalink / raw)
  To: util-linux; +Cc: Christoph Egger

From: Christoph Egger <christoph@debian.org>

Handle vc flags missing on FreeBSD
Fix tty creation on kFreeBSD taking patch from 2.19

Addresses-Debian-Bug: #650185
---
 include/ttyutils.h       | 40 ++++++++++++++++++++++++++++++++++++++++
 term-utils/Makemodule.am |  1 +
 term-utils/agetty.c      | 16 ++++++++++++++++
 3 files changed, 57 insertions(+)

diff --git a/include/ttyutils.h b/include/ttyutils.h
index 4f2fd88..e842f9f 100644
--- a/include/ttyutils.h
+++ b/include/ttyutils.h
@@ -74,6 +74,46 @@ static inline void reset_virtual_console(struct termios *tp, int flags)
 	/* Sane setting, allow eight bit characters, no carriage return delay
 	 * the same result as `stty sane cr0 pass8'
 	 */
+#ifndef IUCLC
+# define IUCLC 0
+#endif
+#ifndef NL0
+# define NL0 0
+#endif
+#ifndef CR0
+# define CR0 0
+#endif
+#ifndef BS0
+# define BS0 0
+#endif
+#ifndef VT0
+# define VT0 0
+#endif
+#ifndef FF0
+# define FF0 0
+#endif
+#ifndef OLCUC
+# define OLCUC 0
+#endif
+#ifndef OFILL
+# define OFILL 0
+#endif
+#ifndef NLDLY
+# define NLDLY 0
+#endif
+#ifndef CRDLY
+# define CRDLY 0
+#endif
+#ifndef BSDLY
+# define BSDLY 0
+#endif
+#ifndef VTDLY
+# define VTDLY 0
+#endif
+#ifndef FFDLY
+# define FFDLY 0
+#endif
+
 	tp->c_iflag |=  (BRKINT | ICRNL | IMAXBEL);
 	tp->c_iflag &= ~(IGNBRK | INLCR | IGNCR | IXOFF | IUCLC | IXANY | ISTRIP);
 	tp->c_oflag |=  (OPOST | ONLCR | NL0 | CR0 | TAB0 | BS0 | VT0 | FF0);
diff --git a/term-utils/Makemodule.am b/term-utils/Makemodule.am
index 5c73f3e..627aca0 100644
--- a/term-utils/Makemodule.am
+++ b/term-utils/Makemodule.am
@@ -23,6 +23,7 @@ sbin_PROGRAMS += agetty
 dist_man_MANS += term-utils/agetty.8
 agetty_SOURCES = term-utils/agetty.c
 agetty_LDADD = $(LDADD) libcommon.la
+agetty_LDADD += -lutil
 endif # BUILD_AGETTY
 
 
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index 3c30a5f..a7044f0 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -10,6 +10,7 @@
  *
  * This program is freely distributable.
  */
+
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -44,6 +45,12 @@
 #include "widechar.h"
 #include "ttyutils.h"
 
+#if defined(__FreeBSD_kernel__)
+#include <pty.h>
+#include <sys/param.h>
+#endif
+
+
 #ifdef __linux__
 #  include <sys/kd.h>
 #  include <sys/param.h>
@@ -76,6 +83,10 @@
 #  endif
 #endif
 
+#ifdef __FreeBSD_kernel__
+#define USE_SYSLOG
+#endif
+
 /* If USE_SYSLOG is undefined all diagnostics go to /dev/console. */
 #ifdef	USE_SYSLOG
 #  include <syslog.h>
@@ -1110,6 +1121,11 @@ static void open_tty(char *tty, struct termios *tp, struct options *op)
 			op->term = DEFAULT_TTYS1;
 	}
 #endif
+
+#if defined(__FreeBSD_kernel__)
+	login_tty (0);
+#endif
+
 	/*
 	 * Detect if this is a virtual console or serial/modem line.
 	 * In case of a virtual console the ioctl KDGKBMODE succeeds
-- 
2.1.0.rc1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4] kFreeBSD: add hacks in ipcrm to avoid FTBFS
  2014-08-24 16:04 [PATCH 0/4] Patches for kFreeBSD support from Debian Andreas Henriksson
                   ` (2 preceding siblings ...)
  2014-08-24 16:04 ` [PATCH 3/4] Fixing FTBFS on !linux (Debian util-linux 2.20.1-1.2) Andreas Henriksson
@ 2014-08-24 16:04 ` Andreas Henriksson
  2014-09-17  9:00 ` [PATCH 0/4] Patches for kFreeBSD support from Debian Karel Zak
  4 siblings, 0 replies; 7+ messages in thread
From: Andreas Henriksson @ 2014-08-24 16:04 UTC (permalink / raw)
  To: util-linux; +Cc: Andreas Henriksson

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
---
 sys-utils/ipcrm.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sys-utils/ipcrm.c b/sys-utils/ipcrm.c
index aa58172..6443f48 100644
--- a/sys-utils/ipcrm.c
+++ b/sys-utils/ipcrm.c
@@ -271,6 +271,13 @@ static int remove_all(type_id type)
 			ret |= remove_id(SEM, 0, rm_me);
 		}
 	}
+/* kFreeBSD hackery -- ah 20140723 */
+#ifndef MSG_STAT
+#define MSG_STAT 11
+#endif
+#ifndef MSG_INFO
+#define MSG_INFO 12
+#endif
 	if (type == MSG || type == ALL) {
 		maxid =
 		    msgctl(0, MSG_INFO, (struct msqid_ds *)(void *)&msginfo);
-- 
2.1.0.rc1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4] Patches for kFreeBSD support from Debian
  2014-08-24 16:04 [PATCH 0/4] Patches for kFreeBSD support from Debian Andreas Henriksson
                   ` (3 preceding siblings ...)
  2014-08-24 16:04 ` [PATCH 4/4] kFreeBSD: add hacks in ipcrm to avoid FTBFS Andreas Henriksson
@ 2014-09-17  9:00 ` Karel Zak
  2014-09-17 14:43   ` Andreas Henriksson
  4 siblings, 1 reply; 7+ messages in thread
From: Karel Zak @ 2014-09-17  9:00 UTC (permalink / raw)
  To: Andreas Henriksson; +Cc: util-linux

On Sun, Aug 24, 2014 at 06:04:40PM +0200, Andreas Henriksson wrote:
> This is the patch set that has been shipping since forever
> in Debian (minus the last one from me, which is new).

 Applied, thanks.

> Christoph Egger (1):
>   Fixing FTBFS on !linux (Debian util-linux 2.20.1-1.2)

 -lutil everywhere seems like overkill as login_tty() is probably 
 necessary for BSD only, so I have applied the patch below too.

    Karel


commit 8026fa9bc7525c4cef02c17099e2db79284078f8
Author: Karel Zak <kzak@redhat.com>
Date:   Wed Sep 17 10:56:46 2014 +0200

    build-sys: use -lutil for BSD only
    
    Signed-off-by: Karel Zak <kzak@redhat.com>

diff --git a/configure.ac b/configure.ac
index 5b558ec..387372f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -136,9 +136,17 @@ PKG_PROG_PKG_CONFIG
 GTK_DOC_CHECK([1.10])
 AC_PATH_PROG([XSLTPROC], [xsltproc])
 
+
 linux_os=no
-AS_CASE([${host_os}], [*linux*], [linux_os=yes])
+bsd_os=no
+AS_CASE([${host_os}],
+  [*linux*],
+     [linux_os=yes],
+  [*bsd*],
+     [bsd_os=yes])
 AM_CONDITIONAL([LINUX], [test "x$linux_os" = xyes])
+AM_CONDITIONAL([BSD], [test "x$bsd_os" = xyes])
+
 
 dnl define ARCH_<NAME> conditionals
 UL_SET_ARCH([I86], [i?86-*])
diff --git a/term-utils/Makemodule.am b/term-utils/Makemodule.am
index 627aca0..e7ac707 100644
--- a/term-utils/Makemodule.am
+++ b/term-utils/Makemodule.am
@@ -23,7 +23,9 @@ sbin_PROGRAMS += agetty
 dist_man_MANS += term-utils/agetty.8
 agetty_SOURCES = term-utils/agetty.c
 agetty_LDADD = $(LDADD) libcommon.la
+if BSD
 agetty_LDADD += -lutil
+endif
 endif # BUILD_AGETTY
 
 

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4] Patches for kFreeBSD support from Debian
  2014-09-17  9:00 ` [PATCH 0/4] Patches for kFreeBSD support from Debian Karel Zak
@ 2014-09-17 14:43   ` Andreas Henriksson
  0 siblings, 0 replies; 7+ messages in thread
From: Andreas Henriksson @ 2014-09-17 14:43 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux

Hello Karel Zak!

Thanks for reviewing/merging these. I'll try to find time to do
a test-build on a kfreebsd machine and also forward you the
libmount/fsck related patches soon.

On Wed, Sep 17, 2014 at 11:00:10AM +0200, Karel Zak wrote:
[...]
> > Christoph Egger (1):
> >   Fixing FTBFS on !linux (Debian util-linux 2.20.1-1.2)
> 
>  -lutil everywhere seems like overkill as login_tty() is probably 
>  necessary for BSD only, so I have applied the patch below too.
> 
>     Karel

You are probably right! This is from the i386 build logs in Debian:

[...]
 dh_shlibdeps -a
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/util-linux/sbin/agetty was not linked against libutil.so.1 (it uses none of the library's symbols)
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/bsdutils/usr/bin/logger was not linked against libsystemd-id128.so.0 (it uses none of the library's symbols)
   dh_installdeb -a
[...]

Full log at:
https://buildd.debian.org/status/fetch.php?pkg=util-linux&arch=i386&ver=2.25.1-1&stamp=1410137520


Regards,
Andreas Henriksson

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-09-17 14:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-24 16:04 [PATCH 0/4] Patches for kFreeBSD support from Debian Andreas Henriksson
2014-08-24 16:04 ` [PATCH 1/4] Report correct disk size on GNU/kFreeBSD. Thanks Tuco Andreas Henriksson
2014-08-24 16:04 ` [PATCH 2/4] remaining kFreeBSD hackery for building Andreas Henriksson
2014-08-24 16:04 ` [PATCH 3/4] Fixing FTBFS on !linux (Debian util-linux 2.20.1-1.2) Andreas Henriksson
2014-08-24 16:04 ` [PATCH 4/4] kFreeBSD: add hacks in ipcrm to avoid FTBFS Andreas Henriksson
2014-09-17  9:00 ` [PATCH 0/4] Patches for kFreeBSD support from Debian Karel Zak
2014-09-17 14:43   ` Andreas Henriksson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).