Repository navigation
Expand file tree
/
Copy pathconfigure
More file actions
executable file
·700 lines (591 loc) · 19.2 KB
/
Copy pathconfigure
File metadata and controls
executable file
·700 lines (591 loc) · 19.2 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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
#!/bin/bash
CONFIGH="config.h"
if [ -t 1 ]; then
RED="[1;31m"
GREEN="[1;32m"
COL_RESET="[0;m"
fi
MISSING_DEFS=0
[ -z "$CC" ] && CC=gcc
CC="${CROSS_COMPILE}${CC}"
CFLAGS="${CFLAGS}"
if [ "${SYSROOT}xx" != "xx" ]; then
CFLAGS="${CFLAGS} --sysroot=${SYSROOT}"
fi
echo "#pragma once" > $CONFIGH
echo "/* This file is auto-generated by configure */" >> $CONFIGH
TMP=$(mktemp)
trap 'rm -f "$TMP" "$TMP.log" "$TMP.c"' EXIT
check_header()
{
echo -n "[*] Checking header $1 ... "
rm -f "$TMP" || exit 1
echo "#include <$1>" >"$TMP.c"
${CC} ${CFLAGS} "$TMP.c" -E &>"$TMP.log"
if [ $? -eq 0 ]; then
echo $GREEN "[YES]" $COL_RESET
echo "#define $2 1" >> $CONFIGH
else
echo $RED "[NO]" $COL_RESET
MISSING_DEFS=1
fi
}
# check_enum_member HEADER SYMBOL...: an enum member is not a preprocessor
# symbol, so the #ifndef in a shim header cannot tell whether HEADER has it.
# Compile-test each member and emit HAVE_<SYMBOL>; the shim header defines
# its fallback under #ifndef HAVE_<SYMBOL>.
check_enum_member()
{
local hdr="$1" sym
shift
for sym in "$@"; do
echo -n "[*] Checking if $hdr has $sym.. "
rm -f "$TMP" || exit 1
cat >"$TMP.c" << EOF
#include <$hdr>
int main(void)
{
return $sym;
}
EOF
${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
if [ ! -x "$TMP" ]; then
echo $RED "[NO]" $COL_RESET
MISSING_DEFS=1
else
echo $GREEN "[YES]" $COL_RESET
echo "#define HAVE_$sym 1" >> $CONFIGH
fi
done
}
#############################################################################################
echo "[*] Checking system headers."
#############################################################################################
# Are ipv6 headers usable ?
[ -z "$IPV6" ] && IPV6=yes
if [[ "$IPV6" == "yes" ]]; then
echo -n "[*] Checking ipv6 headers ... "
rm -f "$TMP" || exit 1
cat >"$TMP.c" << EOF
#include <netinet/in.h>
#include <netinet/ip6.h>
#include <linux/in6.h>
#include <linux/ipv6.h>
int main()
{
struct in6_addr test;
}
EOF
${CC} ${CFLAGS} -D_GNU_SOURCE "$TMP.c" -o "$TMP" &>"$TMP.log"
if [ ! -x "$TMP" ]; then
echo $RED "[BROKEN]" $COL_RESET "See https://patchwork.ozlabs.org/patch/425881/"
else
echo $GREEN "[OK]" $COL_RESET
echo "#define USE_IPV6 1" >> $CONFIGH
fi
fi
#############################################################################################
# is /usr/include/linux/if_pppox.h new enough to feature pppol2tpin6/pppol2tpv3in6
#
echo -n "[*] Checking if pppox can use pppol2tpin6.. "
rm -f "$TMP" || exit 1
cat >"$TMP.c" << EOF
#include <stdio.h>
#include <netinet/in.h>
#include <linux/if.h>
#include <linux/if_pppox.h>
int main(void)
{
struct sockaddr_pppol2tpin6 *pppox;
printf("%d\n", pppox->sa_family);
}
EOF
${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
if [ ! -x "$TMP" ]; then
echo $RED "[NO]" $COL_RESET
MISSING_DEFS=1
else
echo $GREEN "[YES]" $COL_RESET
echo "#define USE_PPPOL2TPIN6 1" >> $CONFIGH
fi
#############################################################################################
# is /usr/include/linux/if_pppox.h new enough to feature pppol2tpv3
#
echo -n "[*] Checking if pppox can use pppol2tpv3.. "
rm -f "$TMP" || exit 1
cat >"$TMP.c" << EOF
#include <stdio.h>
#include <netinet/in.h>
#include <linux/if.h>
#include <linux/if_pppox.h>
int main(void)
{
struct sockaddr_pppol2tpv3 *pppox;
printf("%d\n", pppox->sa_family);
}
EOF
${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
if [ ! -x "$TMP" ]; then
echo $RED "[NO]" $COL_RESET
MISSING_DEFS=1
else
echo $GREEN "[YES]" $COL_RESET
echo "#define USE_PPPOL2TPV3 1" >> $CONFIGH
fi
#############################################################################################
# is /usr/include/linux/if_pppox.h new enough to feature pptp
#
echo -n "[*] Checking if pppox can use pptp.. "
rm -f "$TMP" || exit 1
cat >"$TMP.c" << EOF
#include <stdio.h>
#include <netinet/in.h>
#include <linux/if.h>
#include <linux/if_pppox.h>
int main(void)
{
struct sockaddr_pppox *pppox;
printf("%d\n", pppox->sa_addr.pptp.call_id);
}
EOF
${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
if [ ! -x "$TMP" ]; then
echo $RED "[NO]" $COL_RESET
MISSING_DEFS=1
else
echo $GREEN "[YES]" $COL_RESET
echo "#define USE_PPPOX_PPTP 1" >> $CONFIGH
fi
#############################################################################################
# is /usr/include/linux/llc.h new enough to feature LLC_OPT_PKTINFO
#
echo -n "[*] Checking if llc can use LLC_OPT_PKTINFO.. "
rm -f "$TMP" || exit 1
cat >"$TMP.c" << EOF
#include <stdio.h>
#include <net/if.h>
#include <linux/llc.h>
int main(void)
{
printf("%d\n", LLC_OPT_PKTINFO);
}
EOF
${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
if [ ! -x "$TMP" ]; then
echo $RED "[NO]" $COL_RESET
MISSING_DEFS=1
else
echo $GREEN "[YES]" $COL_RESET
echo "#define USE_LLC_OPT_PKTINFO 1" >> $CONFIGH
fi
#############################################################################################
# Do glibc headers provides struct termios2
echo -n "[*] Checking if glibc headers provide termios2.. "
rm -f "$TMP" || exit 1
cat >"$TMP.c" << EOF
#include <sys/ioctl.h>
#include <sys/vt.h>
#include <termios.h>
int main()
{
struct termios2 test;
}
EOF
${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
if [ ! -x "$TMP" ]; then
echo $RED "[NO]" $COL_RESET
MISSING_DEFS=1
else
echo $GREEN "[YES]" $COL_RESET
echo "#define HAVE_TERMIOS2 1" >> $CONFIGH
fi
#############################################################################################
# Do glibc headers provides nvme ioctls
echo -n "[*] Checking if glibc headers provide nvme ioctls.. "
rm -f "$TMP" || exit 1
cat >"$TMP.c" << EOF
#include <sys/ioctl.h>
#include <linux/nvme_ioctl.h>
int main(int argc, char* argv[])
{
unsigned int foo = NVME_IOCTL_IO_CMD;
}
EOF
${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
if [ ! -x "$TMP" ]; then
echo $RED "[NO]" $COL_RESET
MISSING_DEFS=1
else
echo $GREEN "[YES]" $COL_RESET
echo "#define USE_NVME 1" >> $CONFIGH
fi
#############################################################################################
# is /usr/include/linux/bpf.h new enough to feature bpf
#
echo -n "[*] Checking if bpf_attr can use map_flags.. "
rm -f "$TMP" || exit 1
cat >"$TMP.c" << EOF
#include <stdio.h>
#include <linux/bpf.h>
int main(void)
{
union bpf_attr attr = {
.map_flags = 0,
};
enum bpf_prog_type type = BPF_PROG_TYPE_PERF_EVENT;
}
EOF
${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
if [ ! -x "$TMP" ]; then
echo $RED "[NO]" $COL_RESET
MISSING_DEFS=1
else
echo $GREEN "[YES]" $COL_RESET
echo "#define USE_BPF 1" >> $CONFIGH
fi
#############################################################################################
# is /usr/include/linux/btrfs.h new enough to feature btrfs
#
echo -n "[*] Checking if btrfs can use btrfs_ioctl_defrag_range_args.. "
rm -f "$TMP" || exit 1
cat >"$TMP.c" << EOF
#include <stdio.h>
#include <linux/btrfs.h>
int main(void)
{
struct btrfs_ioctl_defrag_range_args args;
}
EOF
${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
if [ ! -x "$TMP" ]; then
echo $RED "[NO]" $COL_RESET
MISSING_DEFS=1
else
echo $GREEN "[YES]" $COL_RESET
echo "#define USE_BTRFS 1" >> $CONFIGH
fi
#############################################################################################
# Does linux/xattr.h define struct xattr_args (added in 6.13)
#
echo -n "[*] Checking if struct xattr_args is defined.. "
rm -f "$TMP" || exit 1
cat >"$TMP.c" << EOF
#include <linux/xattr.h>
int main(void)
{
struct xattr_args args = { .flags = 0 };
return args.flags;
}
EOF
${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
if [ ! -x "$TMP" ]; then
echo $RED "[NO]" $COL_RESET
MISSING_DEFS=1
else
echo $GREEN "[YES]" $COL_RESET
echo "#define USE_XATTR_ARGS 1" >> $CONFIGH
fi
#############################################################################################
# Does linux/io_uring.h give io_uring_clone_buffers the src_off/dst_off/nr
# members (added in 6.13)
#
echo -n "[*] Checking if io_uring_clone_buffers has src_off.. "
rm -f "$TMP" || exit 1
cat >"$TMP.c" << EOF
#include <linux/io_uring.h>
int main(void)
{
struct io_uring_clone_buffers b = { .src_off = 0, .dst_off = 0, .nr = 0 };
return b.src_off + b.dst_off + b.nr;
}
EOF
${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
if [ ! -x "$TMP" ]; then
echo $RED "[NO]" $COL_RESET
MISSING_DEFS=1
else
echo $GREEN "[YES]" $COL_RESET
echo "#define USE_IO_URING_CLONE_BUFFERS_OFF 1" >> $CONFIGH
fi
#############################################################################################
# Does linux/io_uring.h give io_uring_napi the opcode/op_param members
# (added in 6.13)
#
echo -n "[*] Checking if io_uring_napi has opcode/op_param.. "
rm -f "$TMP" || exit 1
cat >"$TMP.c" << EOF
#include <linux/io_uring.h>
int main(void)
{
struct io_uring_napi n = { .opcode = 0, .op_param = 0 };
return n.opcode + n.op_param;
}
EOF
${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
if [ ! -x "$TMP" ]; then
echo $RED "[NO]" $COL_RESET
MISSING_DEFS=1
else
echo $GREEN "[YES]" $COL_RESET
echo "#define USE_IO_URING_NAPI_OP 1" >> $CONFIGH
fi
#############################################################################################
# Does linux/bpf.h give union bpf_attr the fd_by_id_token_fd member
# (added in 6.13)
#
echo -n "[*] Checking if bpf_attr has fd_by_id_token_fd.. "
rm -f "$TMP" || exit 1
cat >"$TMP.c" << EOF
#include <linux/bpf.h>
int main(void)
{
union bpf_attr a = { .fd_by_id_token_fd = 0 };
return a.fd_by_id_token_fd;
}
EOF
${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
if [ ! -x "$TMP" ]; then
echo $RED "[NO]" $COL_RESET
MISSING_DEFS=1
else
echo $GREEN "[YES]" $COL_RESET
echo "#define USE_BPF_FD_BY_ID_TOKEN_FD 1" >> $CONFIGH
fi
#############################################################################################
# Does linux/bpf.h give union bpf_attr the prog_stream_read member
# (BPF_PROG_STREAM_READ_BY_FD, added post-6.18)
#
echo -n "[*] Checking if bpf_attr has prog_stream_read.. "
rm -f "$TMP" || exit 1
cat >"$TMP.c" << EOF
#include <linux/bpf.h>
int main(void)
{
union bpf_attr a = { .prog_stream_read.stream_id = 0 };
return a.prog_stream_read.stream_id;
}
EOF
${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
if [ ! -x "$TMP" ]; then
echo $RED "[NO]" $COL_RESET
MISSING_DEFS=1
else
echo $GREEN "[YES]" $COL_RESET
echo "#define USE_BPF_PROG_STREAM_READ 1" >> $CONFIGH
fi
#############################################################################################
# Does linux/bpf.h give union bpf_attr the link_create.cgroup member
# (added in 6.13)
#
echo -n "[*] Checking if bpf_attr has link_create.cgroup.. "
rm -f "$TMP" || exit 1
cat >"$TMP.c" << EOF
#include <linux/bpf.h>
int main(void)
{
union bpf_attr a = { .link_create.cgroup.relative_fd = 0 };
return a.link_create.cgroup.relative_fd;
}
EOF
${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
if [ ! -x "$TMP" ]; then
echo $RED "[NO]" $COL_RESET
MISSING_DEFS=1
else
echo $GREEN "[YES]" $COL_RESET
echo "#define USE_BPF_LINK_CREATE_CGROUP 1" >> $CONFIGH
fi
#############################################################################################
# Does linux/iommufd.h give the IOMMU_HWPT_ALLOC_PASID flag
# (added in 6.14). The flag is an enum value, not a #define, so we
# need a compile test rather than #ifdef.
#
echo -n "[*] Checking if iommufd has IOMMU_HWPT_ALLOC_PASID.. "
rm -f "$TMP" || exit 1
cat >"$TMP.c" << EOF
#include <linux/iommufd.h>
int main(void)
{
return IOMMU_HWPT_ALLOC_PASID;
}
EOF
${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
if [ ! -x "$TMP" ]; then
echo $RED "[NO]" $COL_RESET
MISSING_DEFS=1
else
echo $GREEN "[YES]" $COL_RESET
echo "#define HAVE_IOMMU_HWPT_ALLOC_PASID 1" >> $CONFIGH
fi
#############################################################################################
# Does linux/iommufd.h give the IOMMU_HW_INFO_FLAG_INPUT_TYPE flag
# and the in_data_type member of iommu_hw_info (added in 6.14).
# Enum value, so compile-test.
#
echo -n "[*] Checking if iommufd has IOMMU_HW_INFO_FLAG_INPUT_TYPE.. "
rm -f "$TMP" || exit 1
cat >"$TMP.c" << EOF
#include <linux/iommufd.h>
int main(void)
{
struct iommu_hw_info h = { .in_data_type = 0 };
return h.in_data_type + IOMMU_HW_INFO_FLAG_INPUT_TYPE;
}
EOF
${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
if [ ! -x "$TMP" ]; then
echo $RED "[NO]" $COL_RESET
MISSING_DEFS=1
else
echo $GREEN "[YES]" $COL_RESET
echo "#define HAVE_IOMMU_HW_INFO_INPUT_TYPE 1" >> $CONFIGH
fi
#############################################################################################
# struct mnt_id_req's reserved offset-4 __u32 is named `spare' on older
# linux-libc-dev and `mnt_ns_fd' on newer headers (e.g. Debian 13).
# Same slot, different name -- compile-test which one this host has so
# statmount.c writes the STATMOUNT_BY_FD fd to the member that exists.
#
echo -n "[*] Checking mnt_id_req offset-4 field name.. "
rm -f "$TMP" || exit 1
cat >"$TMP.c" << EOF
#include <linux/mount.h>
int main(void)
{
struct mnt_id_req r = { .mnt_ns_fd = 0 };
return (int) r.mnt_ns_fd;
}
EOF
${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
if [ ! -x "$TMP" ]; then
echo "[spare]"
else
echo $GREEN "[mnt_ns_fd]" $COL_RESET
echo "#define HAVE_MNT_ID_REQ_MNT_NS_FD 1" >> $CONFIGH
fi
#############################################################################################
# Enum members the include/kernel/ shim headers fall back on, each defined
# there under #ifndef HAVE_<SYMBOL>. RTA_DEL_REASON and NHA_DST_PORT were
# added in 7.3.
#
check_enum_member linux/rtnetlink.h RTA_DEL_REASON
check_enum_member linux/nexthop.h NHA_DST_PORT
# enum bpf_cmd, from BPF_OBJ_PIN to the newest.
check_enum_member linux/bpf.h BPF_OBJ_PIN BPF_OBJ_GET BPF_PROG_ATTACH \
BPF_PROG_DETACH BPF_PROG_TEST_RUN BPF_PROG_GET_NEXT_ID \
BPF_MAP_GET_NEXT_ID BPF_PROG_GET_FD_BY_ID BPF_MAP_GET_FD_BY_ID \
BPF_OBJ_GET_INFO_BY_FD BPF_PROG_QUERY BPF_RAW_TRACEPOINT_OPEN \
BPF_BTF_LOAD BPF_BTF_GET_FD_BY_ID BPF_TASK_FD_QUERY \
BPF_MAP_LOOKUP_AND_DELETE_ELEM BPF_MAP_FREEZE BPF_BTF_GET_NEXT_ID \
BPF_MAP_LOOKUP_BATCH BPF_MAP_LOOKUP_AND_DELETE_BATCH \
BPF_MAP_UPDATE_BATCH BPF_MAP_DELETE_BATCH BPF_LINK_CREATE \
BPF_LINK_UPDATE BPF_LINK_GET_FD_BY_ID BPF_LINK_GET_NEXT_ID \
BPF_ENABLE_STATS BPF_ITER_CREATE BPF_LINK_DETACH BPF_PROG_BIND_MAP \
BPF_TOKEN_CREATE BPF_PROG_STREAM_READ_BY_FD BPF_PROG_ASSOC_STRUCT_OPS
# enum bpf_map_type, from BPF_MAP_TYPE_LRU_HASH to the newest.
check_enum_member linux/bpf.h BPF_MAP_TYPE_LRU_HASH \
BPF_MAP_TYPE_LRU_PERCPU_HASH BPF_MAP_TYPE_LPM_TRIE \
BPF_MAP_TYPE_ARRAY_OF_MAPS BPF_MAP_TYPE_HASH_OF_MAPS \
BPF_MAP_TYPE_DEVMAP BPF_MAP_TYPE_SOCKMAP BPF_MAP_TYPE_CPUMAP \
BPF_MAP_TYPE_XSKMAP BPF_MAP_TYPE_SOCKHASH \
BPF_MAP_TYPE_REUSEPORT_SOCKARRAY BPF_MAP_TYPE_QUEUE \
BPF_MAP_TYPE_STACK BPF_MAP_TYPE_SK_STORAGE BPF_MAP_TYPE_DEVMAP_HASH \
BPF_MAP_TYPE_STRUCT_OPS BPF_MAP_TYPE_RINGBUF \
BPF_MAP_TYPE_INODE_STORAGE BPF_MAP_TYPE_TASK_STORAGE \
BPF_MAP_TYPE_BLOOM_FILTER BPF_MAP_TYPE_USER_RINGBUF \
BPF_MAP_TYPE_CGRP_STORAGE BPF_MAP_TYPE_ARENA BPF_MAP_TYPE_INSN_ARRAY \
BPF_MAP_TYPE_RHASH
# enum bpf_attach_type, from BPF_TRACE_KPROBE_SESSION to the newest.
check_enum_member linux/bpf.h BPF_TRACE_KPROBE_SESSION \
BPF_TRACE_UPROBE_SESSION BPF_TRACE_FSESSION BPF_TRACE_FENTRY_MULTI \
BPF_TRACE_FEXIT_MULTI BPF_TRACE_FSESSION_MULTI
# BPF_F_LOCK is a member of the anonymous map-update flags enum, unlike the
# other BPF_F_* flags, which are macros.
check_enum_member linux/bpf.h BPF_F_LOCK
# drm-ras's error-threshold commands and attribute.
check_enum_member drm/drm_ras.h DRM_RAS_CMD_GET_ERROR_THRESHOLD \
DRM_RAS_CMD_SET_ERROR_THRESHOLD \
DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_THRESHOLD
# The binder ioctl requests after the first seven.
check_enum_member linux/android/binder.h BINDER_GET_NODE_DEBUG_INFO \
BINDER_GET_NODE_INFO_FOR_REF BINDER_SET_CONTEXT_MGR_EXT \
BINDER_FREEZE BINDER_GET_FROZEN_INFO \
BINDER_ENABLE_ONEWAY_SPAM_DETECTION BINDER_GET_EXTENDED_ERROR
# sunrpc's entry-nest and cache-flush attributes, which landed after the
# family itself.
check_enum_member linux/sunrpc_netlink.h SUNRPC_A_IP_MAP_SEQNO \
SUNRPC_A_IP_MAP_CLASS SUNRPC_A_IP_MAP_ADDR SUNRPC_A_IP_MAP_DOMAIN \
SUNRPC_A_IP_MAP_NEGATIVE SUNRPC_A_IP_MAP_EXPIRY \
SUNRPC_A_UNIX_GID_REQS_REQUESTS SUNRPC_A_UNIX_GID_SEQNO \
SUNRPC_A_UNIX_GID_UID SUNRPC_A_UNIX_GID_GIDS \
SUNRPC_A_UNIX_GID_NEGATIVE SUNRPC_A_UNIX_GID_EXPIRY \
SUNRPC_A_CACHE_FLUSH_MASK
# psp's device netns id, taken by DEV_ASSOC and DEV_DISASSOC.
check_enum_member linux/psp.h PSP_A_DEV_NSID
# netdev's attributes added since v6.12, and the cmds of page pools, NAPI
# configuration and queue leasing.
check_enum_member linux/netdev.h NETDEV_A_NAPI_IRQ_SUSPEND_TIMEOUT \
NETDEV_A_NAPI_THREADED NETDEV_A_DMABUF_RX_PAGE_SIZE \
NETDEV_A_QUEUE_LEASE NETDEV_A_LEASE_IFINDEX NETDEV_A_LEASE_QUEUE \
NETDEV_A_LEASE_NETNS_ID NETDEV_CMD_PAGE_POOL_GET \
NETDEV_CMD_PAGE_POOL_STATS_GET NETDEV_CMD_NAPI_SET \
NETDEV_CMD_QUEUE_CREATE
# ethtool's hardware timestamp provider, which TSINFO_GET nests.
check_enum_member linux/ethtool_netlink_generated.h \
ETHTOOL_A_TSINFO_HWTSTAMP_PROVIDER \
ETHTOOL_A_TS_HWTSTAMP_PROVIDER_INDEX \
ETHTOOL_A_TS_HWTSTAMP_PROVIDER_QUALIFIER
#############################################################################################
check_header linux/fsmap.h USE_FSMAP
check_header linux/if_alg.h USE_IF_ALG
check_header linux/rds.h USE_RDS
check_header linux/vfio.h USE_VFIO
check_header linux/iommufd.h USE_IOMMUFD
check_header linux/vduse.h USE_VDUSE
check_header linux/android/binder.h USE_BINDER
check_header drm/drm.h USE_DRM
check_header drm/exynos_drm.h USE_DRM_EXYNOS
check_header sound/compress_offload.h USE_SNDDRV_COMPRESS_OFFLOAD
check_header linux/seccomp.h USE_SECCOMP
check_header linux/vhost.h USE_VHOST
check_header execinfo.h USE_BACKTRACE
check_header bluetooth/bluetooth.h USE_BLUETOOTH
check_header linux/vm_sockets.h USE_VSOCK
check_header linux/if_pppox.h USE_PPPOX
check_header linux/can.h USE_CAN
check_header linux/rxrpc.h USE_RXRPC
check_header linux/llc.h USE_LLC
check_header linux/if_xdp.h USE_XDP
check_header linux/mctp.h USE_MCTP
check_header linux/sctp.h USE_SCTP
check_header linux/tcp.h USE_TCP_REPAIR_OPT
check_header linux/x25.h USE_X25
check_header linux/phonet.h USE_PHONET
check_header linux/atm.h USE_ATM
#############################################################################################
# Optional: guard-page armour for alloc_shared() regions. Off-by-default
# hunt instrument that wraps tagged shared regions in PROT_NONE pages so
# a forward overflow (buf[size]) faults at the writer PC instead of
# scribbling an adjacent pool and crashing an unrelated consumer many
# operations later.
#
# Opt in at configure time with GUARD_SHARED=1. Without the build flag
# the guard machinery compiles out entirely and alloc_shared keeps its
# legacy single-mmap path; with the build flag the runtime --guard-shared
# scope (off|pools|all, default off) gates whether any guarding fires.
echo -n "[*] Guard-page armour for alloc_shared (GUARD_SHARED): "
if [ "${GUARD_SHARED:-0}" = "1" ]; then
echo $GREEN "[ON]" $COL_RESET
echo "#define CONFIG_GUARD_SHARED 1" >> $CONFIGH
else
echo "[off]"
fi
#############################################################################################
if [ "$MISSING_DEFS" == "1" ]; then
echo "[-] Some header definitions were missing. This is not fatal."
echo " It usually means you're building on an older distribution which doesn't"
echo " have header files describing newer kernel features."
echo " Trinity will still compile and run, it just won't use those new features."
echo " Go ahead, and run 'make'"
fi
exit 0