mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-16 08:40:06 +02:00
Also build blkid, fdisk, hexdump and uuidgen, but put fdisk in a subpackage, marked as untested, as the geometry detection is not implemented for Haiku, so the default values are not useful at all. fdisk is working fine but it does not know how to inform Haiku that a partition table was modified. Workaround: reboot.
178 lines
4.4 KiB
Plaintext
178 lines
4.4 KiB
Plaintext
From f9bda2ce44de1d434aee3e985b0ea88d9306434b Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
|
|
Date: Tue, 22 Aug 2017 18:43:38 +0200
|
|
Subject: Haiku patches
|
|
|
|
|
|
diff --git a/include/c.h b/include/c.h
|
|
index c8bcb37..bf6ff26 100644
|
|
--- a/include/c.h
|
|
+++ b/include/c.h
|
|
@@ -29,6 +29,10 @@
|
|
# define LOGIN_NAME_MAX 256
|
|
#endif
|
|
|
|
+#ifndef _SC_HOST_NAME_MAX
|
|
+#define _SC_HOST_NAME_MAX 72
|
|
+#endif
|
|
+
|
|
/*
|
|
* Compiler-specific stuff
|
|
*/
|
|
diff --git a/include/ttyutils.h b/include/ttyutils.h
|
|
index a9baab3..961fd49 100644
|
|
--- a/include/ttyutils.h
|
|
+++ b/include/ttyutils.h
|
|
@@ -61,15 +61,23 @@ extern int get_terminal_name(const char **path, const char **name,
|
|
static inline void reset_virtual_console(struct termios *tp, int flags)
|
|
{
|
|
/* Use defaults of <sys/ttydefaults.h> for base settings */
|
|
+#ifdef TTYDEF_IFLAG
|
|
tp->c_iflag |= TTYDEF_IFLAG;
|
|
+#endif
|
|
+#ifdef TTYDEF_OFLAG
|
|
tp->c_oflag |= TTYDEF_OFLAG;
|
|
+#endif
|
|
+#ifdef TTYDEF_LFLAG
|
|
tp->c_lflag |= TTYDEF_LFLAG;
|
|
+#endif
|
|
|
|
if ((flags & UL_TTY_KEEPCFLAGS) == 0) {
|
|
#ifdef CBAUD
|
|
tp->c_lflag &= ~CBAUD;
|
|
#endif
|
|
+#ifdef TTYDEF_CFLAG
|
|
tp->c_cflag |= (B38400 | TTYDEF_CFLAG);
|
|
+#endif
|
|
}
|
|
|
|
/* Sane setting, allow eight bit characters, no carriage return delay
|
|
@@ -115,7 +123,11 @@ static inline void reset_virtual_console(struct termios *tp, int flags)
|
|
# define FFDLY 0
|
|
#endif
|
|
|
|
+#ifdef IMAXBEL
|
|
tp->c_iflag |= (BRKINT | ICRNL | IMAXBEL);
|
|
+#else
|
|
+ tp->c_iflag |= (BRKINT | ICRNL);
|
|
+#endif
|
|
tp->c_iflag &= ~(IGNBRK | INLCR | IGNCR | IXOFF | IUCLC | IXANY | ISTRIP);
|
|
tp->c_oflag |= (OPOST | ONLCR | NL0 | CR0 | TAB0 | BS0 | VT0 | FF0);
|
|
tp->c_oflag &= ~(OLCUC | OCRNL | ONOCR | ONLRET | OFILL | \
|
|
@@ -145,24 +157,48 @@ static inline void reset_virtual_console(struct termios *tp, int flags)
|
|
*/
|
|
tp->c_cc[VTIME] = 0;
|
|
tp->c_cc[VMIN] = 1;
|
|
+#ifdef CINTR
|
|
tp->c_cc[VINTR] = CINTR;
|
|
+#endif
|
|
+#ifdef CQUIT
|
|
tp->c_cc[VQUIT] = CQUIT;
|
|
+#endif
|
|
+#ifdef CERASE
|
|
tp->c_cc[VERASE] = CERASE; /* ASCII DEL (0177) */
|
|
+#endif
|
|
+#ifdef CKILL
|
|
tp->c_cc[VKILL] = CKILL;
|
|
+#endif
|
|
+#ifdef CEOF
|
|
tp->c_cc[VEOF] = CEOF;
|
|
+#endif
|
|
#ifdef VSWTC
|
|
tp->c_cc[VSWTC] = _POSIX_VDISABLE;
|
|
#elif defined(VSWTCH)
|
|
tp->c_cc[VSWTCH] = _POSIX_VDISABLE;
|
|
#endif
|
|
+#ifdef CSTART
|
|
tp->c_cc[VSTART] = CSTART;
|
|
+#endif
|
|
+#ifdef CSTOP
|
|
tp->c_cc[VSTOP] = CSTOP;
|
|
+#endif
|
|
+#ifdef CSUSP
|
|
tp->c_cc[VSUSP] = CSUSP;
|
|
+#endif
|
|
tp->c_cc[VEOL] = _POSIX_VDISABLE;
|
|
+#ifdef VREPRINT
|
|
tp->c_cc[VREPRINT] = CREPRINT;
|
|
+#endif
|
|
+#ifdef VDISCARD
|
|
tp->c_cc[VDISCARD] = CDISCARD;
|
|
+#endif
|
|
+#ifdef VWERASE
|
|
tp->c_cc[VWERASE] = CWERASE;
|
|
+#endif
|
|
+#ifdef CLNEXT
|
|
tp->c_cc[VLNEXT] = CLNEXT;
|
|
+#endif
|
|
tp->c_cc[VEOL2] = _POSIX_VDISABLE;
|
|
}
|
|
|
|
diff --git a/lib/randutils.c b/lib/randutils.c
|
|
index de42795..9e07457 100644
|
|
--- a/lib/randutils.c
|
|
+++ b/lib/randutils.c
|
|
@@ -13,7 +13,9 @@
|
|
#include <string.h>
|
|
#include <sys/time.h>
|
|
|
|
+#ifndef __HAIKU__
|
|
#include <sys/syscall.h>
|
|
+#endif
|
|
|
|
#include "c.h"
|
|
#include "randutils.h"
|
|
--
|
|
2.14.1
|
|
|
|
|
|
From e8ab90b9e91df50304e32a77325d2030c1d4aeb6 Mon Sep 17 00:00:00 2001
|
|
From: fbrosson <fbrosson@localhost>
|
|
Date: Tue, 1 May 2018 23:37:15 +0000
|
|
Subject: define {makedev,major,minor} macros in blkidP.h for libblkid
|
|
|
|
|
|
diff --git a/libblkid/src/blkidP.h b/libblkid/src/blkidP.h
|
|
index 22c9856..1a08190 100644
|
|
--- a/libblkid/src/blkidP.h
|
|
+++ b/libblkid/src/blkidP.h
|
|
@@ -341,6 +341,10 @@ UL_DEBUG_DECLARE_MASK(libblkid);
|
|
#define UL_DEBUG_CURRENT_MASK UL_DEBUG_MASK(libblkid)
|
|
#include "debugobj.h"
|
|
|
|
+#define makedev(ma, mi) ((dev_t)(((((unsigned int)(ma)) << 8) & 0xff00) | (mi)))
|
|
+#define major(devnum) (((unsigned int)((devnum) & 0xff00) >> 8))
|
|
+#define minor(devnum) (unsigned int)((devnum) & 0xffff00ff)
|
|
+
|
|
extern void blkid_debug_dump_dev(blkid_dev dev);
|
|
|
|
|
|
--
|
|
2.17.0
|
|
|
|
|
|
From 8ea31be2a92c3b90417061333da461f1e330e9bb Mon Sep 17 00:00:00 2001
|
|
From: fbrosson <fbrosson@localhost>
|
|
Date: Fri, 4 May 2018 21:25:57 +0000
|
|
Subject: define {makedev,major,minor} macros in sysfs.h for fdisk
|
|
|
|
|
|
diff --git a/include/sysfs.h b/include/sysfs.h
|
|
index 9a72a20..b21ab10 100644
|
|
--- a/include/sysfs.h
|
|
+++ b/include/sysfs.h
|
|
@@ -16,6 +16,10 @@
|
|
#include <inttypes.h>
|
|
#include <dirent.h>
|
|
|
|
+#define makedev(ma, mi) ((dev_t)(((((unsigned int)(ma)) << 8) & 0xff00) | (mi)))
|
|
+#define major(devnum) (((unsigned int)((devnum) & 0xff00) >> 8))
|
|
+#define minor(devnum) (unsigned int)((devnum) & 0xffff00ff)
|
|
+
|
|
struct sysfs_cxt {
|
|
dev_t devno;
|
|
int dir_fd; /* /sys/block/<name> */
|
|
--
|
|
2.17.0
|
|
|