-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil-linux-diet.patch
More file actions
248 lines (218 loc) · 6.95 KB
/
util-linux-diet.patch
File metadata and controls
248 lines (218 loc) · 6.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
--- util-linux-ng-2.18/libmount/src/fs.c~ 2010-06-08 10:44:20.000000000 +0200
+++ util-linux-ng-2.18/libmount/src/fs.c 2010-08-26 11:12:31.326572794 +0200
@@ -17,6 +17,9 @@
#include <errno.h>
#include <blkid.h>
#include <stddef.h>
+#ifdef __dietlibc__
+#include <sys/stat.h> /* for major and minor macros */
+#endif
#include "nls.h"
#include "mountP.h"
--- util-linux-ng-2.18/libmount/src/tab_parse.c~ 2010-06-07 12:35:06.000000000 +0200
+++ util-linux-ng-2.18/libmount/src/tab_parse.c 2010-08-26 11:16:35.762572782 +0200
@@ -9,6 +9,9 @@
#include <limits.h>
#include <dirent.h>
#include <fcntl.h>
+#ifdef __dietlibc__
+#include <sys/stat.h> /* for makedev macro */
+#endif
#include "at.h"
#include "mangle.h"
--- util-linux-2.19/lib/strutils.c~ 2011-01-31 16:43:47.000000000 +0100
+++ util-linux-2.19/lib/strutils.c 2011-02-10 12:49:12.221843465 +0100
@@ -12,6 +12,9 @@
#include <sys/stat.h>
#include <locale.h>
#include <string.h>
+#ifdef __dietlibc__
+#include <stdint.h>
+#endif
static int do_scale_by_power (uintmax_t *x, int base, int power)
{
--- util-linux-2.19/lib/at.c~ 2011-01-31 16:43:47.000000000 +0100
+++ util-linux-2.19/lib/at.c 2011-02-10 20:30:37.336797058 +0100
@@ -7,6 +7,7 @@
#include <stdlib.h>
#include <fcntl.h>
#include <sys/stat.h>
+#include <limits.h>
#include "at.h"
--- util-linux-2.19/misc-utils/findmnt.c~ 2011-01-31 16:43:47.000000000 +0100
+++ util-linux-2.19/misc-utils/findmnt.c 2011-02-10 20:54:23.100130391 +0100
@@ -36,6 +36,9 @@
# include <libudev.h>
#endif
#include <libmount.h>
+#ifdef __dietlibc__
+#include <sys/stat.h> /* for major and minor macros */
+#endif
#include "pathnames.h"
#include "nls.h"
--- util-linux-2.19/disk-utils/fsck.c~ 2011-02-07 16:19:29.000000000 +0100
+++ util-linux-2.19/disk-utils/fsck.c 2011-02-10 21:09:27.024658725 +0100
@@ -270,7 +270,13 @@
if (verbose)
printf(_("Locking disk %s ... "), diskname);
- inst->lock = open(diskname, O_CLOEXEC | O_RDONLY);
+ inst->lock = open(diskname,
+#ifdef O_CLOEXEC
+ O_CLOEXEC | O_RDONLY
+#else
+ O_RDONLY
+#endif
+ );
if (inst->lock >= 0) {
int rc = -1;
--- util-linux-2.21/configure.ac~ 2012-02-24 12:53:35.000000000 +0200
+++ util-linux-2.21/configure.ac 2012-03-05 21:03:25.833675080 +0200
@@ -323,6 +323,7 @@ AC_CHECK_FUNCS([ \
llseek \
lseek64 \
mempcpy \
+ mkostemp \
nanosleep \
personality \
posix_fadvise \
@@ -330,6 +331,7 @@
usleep \
warn \
warnx \
+ versionsort \
])
AC_FUNC_FSEEKO
--- util-linux-2.19/misc-utils/findfs.c~ 2011-01-31 16:43:47.000000000 +0100
+++ util-linux-2.19/misc-utils/findfs.c 2011-02-10 22:24:39.615735924 +0100
@@ -12,6 +12,7 @@
#include <blkid.h>
+#include "c.h"
#include "nls.h"
static void __attribute__((__noreturn__)) usage(int rc)
--- util-linux-2.21/libmount/src/tab_parse.c~ 2012-03-05 21:00:14.000000000 +0200
+++ util-linux-2.21/libmount/src/tab_parse.c 2012-03-05 21:05:27.562569076 +0200
@@ -524,7 +524,13 @@
DIR *dir = NULL;
struct dirent **namelist = NULL;
- n = scandir(dirname, &namelist, mnt_table_parse_dir_filter, versionsort);
+ n = scandir(dirname, &namelist, mnt_table_parse_dir_filter,
+#ifdef HAVE_VERSIONSORT
+ versionsort
+#else
+ alphasort
+#endif
+ );
if (n <= 0)
return 0;
--- util-linux-2.22.1/lib/tt.c.orig 2012-09-20 15:16:51.349635172 +0200
+++ util-linux-2.22.1/lib/tt.c 2012-10-13 16:58:37.331962836 +0200
@@ -59,11 +59,13 @@
*/
static size_t mbs_safe_width(const char *s)
{
- mbstate_t st;
const char *p = s;
size_t width = 0;
+#ifdef HAVE_WIDECHAR
+ mbstate_t st;
memset(&st, 0, sizeof(st));
+#endif
while (p && *p) {
if (iscntrl((unsigned char) *p)) {
@@ -108,7 +110,9 @@
*/
static char *mbs_safe_encode(const char *s, size_t *width)
{
+#ifdef HAVE_WIDECHAR
mbstate_t st;
+#endif
const char *p = s;
char *res, *r;
size_t sz = s ? strlen(s) : 0;
@@ -117,8 +121,9 @@
if (!sz)
return NULL;
+#ifdef HAVE_WIDECHAR
memset(&st, 0, sizeof(st));
-
+#endif
res = malloc((sz * 4) + 1);
if (!res)
return NULL;
--- util-linux-2.22.1/include/ttyutils.h.orig 2012-09-20 15:16:51.343635134 +0200
+++ util-linux-2.22.1/include/ttyutils.h 2012-10-13 16:58:53.058628843 +0200
@@ -11,6 +11,7 @@
#define UL_TTY_KEEPCFLAGS (1 << 1)
#define UL_TTY_UTF8 (1 << 2)
+#ifndef __dietlibc__
static inline void reset_virtual_console(struct termios *tp, int flags)
{
/* Use defaults of <sys/ttydefaults.h> for base settings */
@@ -78,6 +79,7 @@
tp->c_cc[VLNEXT] = CLNEXT;
tp->c_cc[VEOL2] = _POSIX_VDISABLE;
}
+#endif
static inline int get_terminal_width(void)
{
--- util-linux-2.22.1/configure.ac.orig 2012-10-13 17:14:16.488590090 +0200
+++ util-linux-2.22.1/configure.ac 2012-10-13 22:11:41.324507881 +0200
@@ -915,6 +915,9 @@
UL_REQUIRES_HAVE([cramfs], [z], [z library])
AM_CONDITIONAL(BUILD_CRAMFS, test "x$build_cramfs" = xyes)
+AC_ARG_ENABLE([minix], AS_HELP_STRING([--disable-minix], [do not build fsck.minix]), [], enable_minix=yes)
+UL_BUILD_INIT([minix])
+AM_CONDITIONAL(BUILD_MINIX, test "x$build_minix" = xyes)
if test "x$have_io" = xyes -o "x$linux_os" = xyes; then
build_hwclock=yes
@@ -1193,6 +1196,12 @@
[sched_getaffinity])
AM_CONDITIONAL(BUILD_TASKSET, test "x$build_taskset" = xyes)
+AC_ARG_ENABLE([setarch], AS_HELP_STRING([--disable-setarch], [do not build setarch]), [], enable_setarch=yes)
+UL_BUILD_INIT([setarch])
+AM_CONDITIONAL(BUILD_SETARCH, test "x$build_setarch" = xyes)
+AC_ARG_ENABLE([ldattach], AS_HELP_STRING([--disable-ldattach], [do not build ldattach]), [], enable_ldattach=yes)
+UL_BUILD_INIT([ldattach])
+AM_CONDITIONAL(BUILD_LDATTACH, test "x$build_ldattach" = xyes)
AC_ARG_ENABLE([wall],
AS_HELP_STRING([--disable-wall], [do not build wall]),
--- util-linux-2.22.1/disk-utils/Makemodule.am.orig 2012-09-20 15:16:51.321634997 +0200
+++ util-linux-2.22.1/disk-utils/Makemodule.am 2012-10-13 22:12:29.384505863 +0200
@@ -1,4 +1,4 @@
-
+if BUILD_MINIX
sbin_PROGRAMS += fsck.minix
dist_man_MANS += disk-utils/fsck.minix.8
fsck_minix_SOURCES = \
@@ -6,6 +6,7 @@
disk-utils/minix_programs.h \
lib/ismounted.c
fsck_minix_LDADD = $(LDADD) libcommon.la
+endif
sbin_PROGRAMS += mkfs.minix
dist_man_MANS += disk-utils/mkfs.minix.8
--- util-linux-2.22.1/sys-utils/Makemodule.am.orig 2012-10-10 14:14:06.515276813 +0200
+++ util-linux-2.22.1/sys-utils/Makemodule.am 2012-10-13 22:18:31.467824001 +0200
@@ -59,10 +59,12 @@
cytune_SOURCES = sys-utils/cytune.c sys-utils/cyclades.h
cytune_LDADD = $(LDADD) libcommon.la
+if BUILD_LDATTACH
usrsbin_exec_PROGRAMS += ldattach
dist_man_MANS += sys-utils/ldattach.8
ldattach_SOURCES = sys-utils/ldattach.c
ldattach_LDADD = $(LDADD) libcommon.la
+endif
usrsbin_exec_PROGRAMS += tunelp
dist_man_MANS += sys-utils/tunelp.8
@@ -73,6 +75,7 @@
rtcwake_SOURCES = sys-utils/rtcwake.c
rtcwake_LDADD = $(LDADD) libcommon.la
+if BUILD_SETARCH
usrbin_exec_PROGRAMS += setarch
dist_man_MANS += sys-utils/setarch.8
setarch_SOURCES = sys-utils/setarch.c
@@ -123,6 +124,7 @@
INSTALL_EXEC_HOOKS += install-exec-hook-setarch
UNINSTALL_HOOKS += uninstall-hook-setarch
+endif
endif # LINUX