Skip to content

Commit

Permalink
Merge pull request #283 from Dennisbonke/util-linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennisbonke authored Nov 8, 2023
2 parents e55838c + e6ec0fc commit 4afdafa
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 25 deletions.
12 changes: 6 additions & 6 deletions bootstrap.d/sys-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ packages:
- libiconv
- file
- libxcrypt
revision: 6
revision: 7
configure:
- args:
- '@THIS_SOURCE_DIR@/configure'
Expand Down Expand Up @@ -954,7 +954,7 @@ packages:
- libiconv
- file
- libxcrypt
revision: 7
revision: 8
configure:
- args:
- '@THIS_SOURCE_DIR@/configure'
Expand All @@ -975,15 +975,15 @@ packages:
- '--disable-unshare'
- '--disable-nsenter'
- '--disable-setpriv'
- '--disable-eject'
- '--enable-eject'
- '--disable-plymouth_support'
- '--disable-fdformat'
- '--disable-hwclock'
- '--disable-hwclock-cmos'
- '--disable-hwclock-gplv3'
- '--disable-wdctl'
- '--disable-logger'
- '--disable-switch_root'
- '--enable-switch_root'
- '--disable-pivot_root'
- '--disable-chmem'
- '--disable-ipcrm'
Expand All @@ -1005,12 +1005,12 @@ packages:
- '--disable-swapon'
- '--disable-lscpu'
- '--disable-chcpu'
- '--disable-blockdev'
- '--enable-blockdev'
- '--disable-prlimit'
- '--disable-lsipc'
- '--disable-lsns'
- '--disable-readprofile'
- '--disable-dmesg'
- '--enable-dmesg'
- '--disable-fincore'
- '--disable-fsfreeze'
- '--disable-blkdiscard'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 3b0ef9e87835d779a439a00088907d2e6e71feca Mon Sep 17 00:00:00 2001
From 1fd62d461931bec2e2ec50eccb3345edf26aa0dd Mon Sep 17 00:00:00 2001
From: Dennis Bonke <[email protected]>
Date: Thu, 21 Jan 2021 12:23:48 +0100
Subject: [PATCH 1/2] Stub out several unsupported things on managarm
Subject: [PATCH 1/3] Stub out several unsupported things on managarm

Signed-off-by: Dennis Bonke <[email protected]>
---
Expand All @@ -18,7 +18,7 @@ Signed-off-by: Dennis Bonke <[email protected]>
10 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c
index d96b6e9e0..3a5b20939 100644
index 11f8b9a..bacba72 100644
--- a/disk-utils/cfdisk.c
+++ b/disk-utils/cfdisk.c
@@ -22,6 +22,7 @@
Expand All @@ -30,7 +30,7 @@ index d96b6e9e0..3a5b20939 100644
#ifdef HAVE_LIBMOUNT
# include <libmount.h> /* keep it optional for non-linux systems */
diff --git a/include/namespace.h b/include/namespace.h
index 2d0a56e02..75d0f439d 100644
index 2d0a56e..75d0f43 100644
--- a/include/namespace.h
+++ b/include/namespace.h
@@ -7,6 +7,7 @@
Expand All @@ -48,7 +48,7 @@ index 2d0a56e02..75d0f439d 100644
+#endif /* !__managarm__ */
#endif /* UTIL_LINUX_NAMESPACE_H */
diff --git a/include/path.h b/include/path.h
index 2a4f80ecd..183a0d4a8 100644
index 2a4f80e..183a0d4 100644
--- a/include/path.h
+++ b/include/path.h
@@ -124,6 +124,7 @@ int ul_path_countf_dirents(struct path_cxt *pc, const char *path, ...)
Expand All @@ -66,7 +66,7 @@ index 2a4f80ecd..183a0d4a8 100644
+#endif /* !__managarm__ */
#endif /* UTIL_LINUX_PATH_H */
diff --git a/lib/cpuset.c b/lib/cpuset.c
index 2847db853..78ffd5f1b 100644
index 2847db8..78ffd5f 100644
--- a/lib/cpuset.c
+++ b/lib/cpuset.c
@@ -1,3 +1,4 @@
Expand All @@ -80,7 +80,7 @@ index 2847db853..78ffd5f1b 100644
#endif
+#endif
diff --git a/lib/path.c b/lib/path.c
index 75fa85305..fe3702970 100644
index 75fa853..fe37029 100644
--- a/lib/path.c
+++ b/lib/path.c
@@ -977,6 +977,7 @@ FILE *ul_prefix_fopen(const char *prefix, const char *path, const char *mode)
Expand All @@ -100,7 +100,7 @@ index 75fa85305..fe3702970 100644

#ifdef TEST_PROGRAM_PATH
diff --git a/libblkid/src/topology/ioctl.c b/libblkid/src/topology/ioctl.c
index 3aba09e4f..76b750e20 100644
index 3aba09e..76b750e 100644
--- a/libblkid/src/topology/ioctl.c
+++ b/libblkid/src/topology/ioctl.c
@@ -16,6 +16,8 @@
Expand All @@ -113,7 +113,7 @@ index 3aba09e4f..76b750e20 100644

/*
diff --git a/login-utils/logindefs.c b/login-utils/logindefs.c
index 97150dc28..35371ec3f 100644
index 97150dc..35371ec 100644
--- a/login-utils/logindefs.c
+++ b/login-utils/logindefs.c
@@ -26,7 +26,7 @@
Expand All @@ -126,7 +126,7 @@ index 97150dc28..35371ec3f 100644
#include <sys/types.h>
#include <pwd.h>
diff --git a/login-utils/lslogins.c b/login-utils/lslogins.c
index 8a6ef713f..2b56879c3 100644
index 773d13a..90e617f 100644
--- a/login-utils/lslogins.c
+++ b/login-utils/lslogins.c
@@ -25,7 +25,7 @@
Expand All @@ -139,7 +139,7 @@ index 8a6ef713f..2b56879c3 100644
#include <grp.h>
#include <shadow.h>
diff --git a/misc-utils/lsblk.h b/misc-utils/lsblk.h
index 87221271e..6ae1ebecc 100644
index 8722127..6ae1ebe 100644
--- a/misc-utils/lsblk.h
+++ b/misc-utils/lsblk.h
@@ -13,6 +13,8 @@
Expand All @@ -152,7 +152,7 @@ index 87221271e..6ae1ebecc 100644
#include "list.h"
#include "debug.h"
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index 191fa29c0..bf985a2f9 100644
index 191fa29..bf985a2 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -88,6 +88,14 @@
Expand All @@ -162,7 +162,7 @@ index 191fa29c0..bf985a2f9 100644
+#elif defined __managarm__
+# define USE_SYSLOG
+# ifndef DEFAULT_VCTERM
+# define DEFAULT_VCTERM "linux"
+# define DEFAULT_VCTERM "managarm"
+# endif
+# ifndef DEFAULT_STERM
+# define DEFAULT_STERM "vt100"
Expand All @@ -171,5 +171,5 @@ index 191fa29c0..bf985a2f9 100644
# ifndef DEFAULT_VCTERM
# define DEFAULT_VCTERM "vt100"
--
2.30.0
2.42.0

Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
From b07e4d05bb062d95ebc17e1a98b63dc31b82723f Mon Sep 17 00:00:00 2001
From 4ab3b76533cfa09f90713940cfa9f375a982bbc4 Mon Sep 17 00:00:00 2001
From: Dennis Bonke <[email protected]>
Date: Tue, 16 Feb 2021 10:21:13 +0100
Subject: [PATCH 2/2] Revamp the configure script to allow for more fine-grained
control over the programs build. Make configure think that Managarm is Linux.
Subject: [PATCH 2/3] Revamp the configure script to allow for more
fine-grained control over the programs build. Make configure think that
Managarm is Linux.

Signed-off-by: Dennis Bonke <[email protected]>
---
configure.ac | 258 ++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 216 insertions(+), 42 deletions(-)

diff --git a/configure.ac b/configure.ac
index 2ac4c2bdf..345a3d319 100644
index 2ac4c2b..345a3d3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -212,6 +212,8 @@ bsd_os=no
Expand Down Expand Up @@ -465,5 +466,5 @@ index 2ac4c2bdf..345a3d319 100644


--
2.30.0
2.42.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
From 10a44f7810e19e1346838dd5e7daa6f3376ebd4c Mon Sep 17 00:00:00 2001
From: Dennis Bonke <[email protected]>
Date: Wed, 8 Nov 2023 02:38:22 +0100
Subject: [PATCH 3/3] Add some missing includes and disable floppy support in
blkdev

Signed-off-by: Dennis Bonke <[email protected]>
---
disk-utils/blockdev.c | 2 ++
lib/blkdev.c | 3 ++-
lib/pager.c | 1 +
term-utils/agetty.c | 1 +
term-utils/setterm.c | 1 +
5 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/disk-utils/blockdev.c b/disk-utils/blockdev.c
index f425d15..1e16203 100644
--- a/disk-utils/blockdev.c
+++ b/disk-utils/blockdev.c
@@ -9,6 +9,8 @@
#include <string.h>
#include <unistd.h>
#include <sys/ioctl.h>
+#include <sys/mount.h>
+#include <linux/fs.h>
#include <errno.h>

#include "c.h"
diff --git a/lib/blkdev.c b/lib/blkdev.c
index c22853d..c4bfc89 100644
--- a/lib/blkdev.c
+++ b/lib/blkdev.c
@@ -114,7 +114,8 @@ blkdev_get_size(int fd, unsigned long long *bytes)
return 0;
#endif

-#ifdef FDGETPRM
+//#ifdef FDGETPRM
+#if 0
{
struct floppy_struct this_floppy;

diff --git a/lib/pager.c b/lib/pager.c
index 747521e..94450c1 100644
--- a/lib/pager.c
+++ b/lib/pager.c
@@ -10,6 +10,7 @@
#include <string.h>
#include <err.h>
#include <sys/types.h>
+#include <sys/select.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <signal.h>
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index bf985a2..52dc861 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -20,6 +20,7 @@
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/types.h>
+#include <sys/select.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <fcntl.h>
diff --git a/term-utils/setterm.c b/term-utils/setterm.c
index 22afc76..dba1c27 100644
--- a/term-utils/setterm.c
+++ b/term-utils/setterm.c
@@ -57,6 +57,7 @@
#include <sys/klog.h>
#include <sys/param.h> /* for MAXPATHLEN */
#include <sys/time.h>
+#include <sys/select.h>
#include <termios.h>
#include <unistd.h>

--
2.42.0

0 comments on commit 4afdafa

Please sign in to comment.