-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepare
2004 lines (1929 loc) · 94 KB
/
prepare
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
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/bash
#_ _ _ _ _ _____ _ _
#| | _______ ____ _| | | || |___ | || |
#| |/ / _ \ \ / / _` | | | || |_ / /| || |_
#| < __/\ V / (_| | | |__ _/ / |__ _|
#|_|\_\___| \_/ \__,_|_|_| |_|/_/ |_|
configure(){
plain ""
plain "#########################################"
plain "Set module SIG level"
read -rp "`echo $' > 1.SHA1\n > 2.SHA224\n > 3.SHA256\n > 4.SHA384\n > 5.SHA512\n > Default (SHA512)\nchoice[1-5]: '`" _sig;
if [[ $_sig = "1" ]]; then
msg2 "Set SIG level to SHA1"
scripts/config --undefine MODULE_SIG_FORCE
scripts/config --disable MODULE_SIG_FORCE
scripts/config --enable CONFIG_MODULE_SIG
scripts/config --enable CONFIG_MODULE_SIG_ALL
scripts/config --disable CONFIG_MODULE_SIG_SHA224
scripts/config --disable CONFIG_MODULE_SIG_SHA256
scripts/config --disable CONFIG_MODULE_SIG_SHA384
scripts/config --disable CONFIG_MODULE_SIG_SHA512
scripts/config --enable CONFIG_MODULE_SIG_SHA1
scripts/config --set-val CONFIG_MODULE_SIG_HASH "sha1"
elif [[ $_sig = "2" ]]; then
msg2 "Set SIG level to SHA224"
scripts/config --undefine MODULE_SIG_FORCE
scripts/config --disable MODULE_SIG_FORCE
scripts/config --enable CONFIG_MODULE_SIG
scripts/config --enable CONFIG_MODULE_SIG_ALL
scripts/config --disable CONFIG_MODULE_SIG_SHA1
scripts/config --disable CONFIG_MODULE_SIG_SHA256
scripts/config --disable CONFIG_MODULE_SIG_SHA384
scripts/config --disable CONFIG_MODULE_SIG_SHA512
scripts/config --enable CONFIG_MODULE_SIG_SHA224
scripts/config --set-val CONFIG_MODULE_SIG_HASH "sha224"
elif [[ $_sig = "3" ]]; then
msg2 "Set SIG level to SHA256"
scripts/config --undefine MODULE_SIG_FORCE
scripts/config --disable MODULE_SIG_FORCE
scripts/config --enable CONFIG_MODULE_SIG
scripts/config --enable CONFIG_MODULE_SIG_ALL
scripts/config --disable CONFIG_MODULE_SIG_SHA1
scripts/config --disable CONFIG_MODULE_SIG_SHA224
scripts/config --disable CONFIG_MODULE_SIG_SHA384
scripts/config --disable CONFIG_MODULE_SIG_SHA512
scripts/config --enable CONFIG_MODULE_SIG_SHA256
scripts/config --set-val CONFIG_MODULE_SIG_HASH "sha256"
elif [[ $_sig = "4" ]]; then
msg2 "Set SIG level to SHA384"
scripts/config --undefine MODULE_SIG_FORCE
scripts/config --disable MODULE_SIG_FORCE
scripts/config --enable CONFIG_MODULE_SIG
scripts/config --enable CONFIG_MODULE_SIG_ALL
scripts/config --disable CONFIG_MODULE_SIG_SHA1
scripts/config --disable CONFIG_MODULE_SIG_SHA224
scripts/config --disable CONFIG_MODULE_SIG_SHA256
scripts/config --disable CONFIG_MODULE_SIG_SHA512
scripts/config --enable CONFIG_MODULE_SIG_SHA384
scripts/config --set-val CONFIG_MODULE_SIG_HASH "sha384"
elif [[ $_sig = "5" ]]; then
msg2 "Set SIG level to SHA512"
scripts/config --undefine MODULE_SIG_FORCE
scripts/config --disable MODULE_SIG_FORCE
scripts/config --enable CONFIG_MODULE_SIG
scripts/config --enable CONFIG_MODULE_SIG_ALL
scripts/config --disable CONFIG_MODULE_SIG_SHA1
scripts/config --disable CONFIG_MODULE_SIG_SHA224
scripts/config --disable CONFIG_MODULE_SIG_SHA256
scripts/config --disable CONFIG_MODULE_SIG_SHA384
scripts/config --enable CONFIG_MODULE_SIG_SHA512
scripts/config --set-val CONFIG_MODULE_SIG_HASH "sha512"
else
msg2 "Set SIG level to SHA512"
scripts/config --undefine MODULE_SIG_FORCE
scripts/config --disable MODULE_SIG_FORCE
scripts/config --enable CONFIG_MODULE_SIG
scripts/config --enable CONFIG_MODULE_SIG_ALL
scripts/config --disable CONFIG_MODULE_SIG_SHA1
scripts/config --disable CONFIG_MODULE_SIG_SHA224
scripts/config --disable CONFIG_MODULE_SIG_SHA256
scripts/config --disable CONFIG_MODULE_SIG_SHA384
scripts/config --enable CONFIG_MODULE_SIG_SHA512
scripts/config --set-val CONFIG_MODULE_SIG_HASH "sha512"
fi
sleep 2s
plain ""
plain "#########################################"
plain "Set module compression"
read -rp "`echo $' > 1.GZIP\n > 2.XZ\n > 3.ZSTD\n > Default (ZSTD)\nchoice[1-3]: '`" _compression;
if [[ $_compression = "1" ]]; then
msg2 "Set module compression to GZIP"
scripts/config --enable CONFIG_MODULE_COMPRESS
scripts/config --disable CONFIG_MODULE_COMPRESS_XZ
scripts/config --disable CONFIG_MODULE_COMPRESS_ZSTD
scripts/config --enable CONFIG_MODULE_COMPRESS_GZIP
elif [[ $_compression = "2" ]]; then
msg2 "Set module compression to XZ"
scripts/config --enable CONFIG_MODULE_COMPRESS
scripts/config --disable CONFIG_MODULE_COMPRESS_ZSTD
scripts/config --disable CONFIG_MODULE_COMPRESS_GZIP
scripts/config --enable CONFIG_MODULE_COMPRESS_XZ
elif [[ $_compression = "3" ]]; then
msg2 "Set module compression to ZSTD"
scripts/config --enable CONFIG_MODULE_COMPRESS
scripts/config --disable CONFIG_MODULE_COMPRESS_GZIP
scripts/config --disable CONFIG_MODULE_COMPRESS_XZ
scripts/config --enable CONFIG_MODULE_COMPRESS_ZSTD
else
msg2 "Set module compression to ZSTD"
scripts/config --enable CONFIG_MODULE_COMPRESS
scripts/config --disable CONFIG_MODULE_COMPRESS_GZIP
scripts/config --disable CONFIG_MODULE_COMPRESS_XZ
scripts/config --enable CONFIG_MODULE_COMPRESS_ZSTD
fi
sleep 2s
plain ""
plain "#########################################"
plain "Enable/disable CONFIG_STACK_VALIDATION"
plain "Gives better stack traces. Also is enabled in all official kernel"
plain "packages by Archlinux team"
read -rp "`echo $' > 1.Enable\n > 2.Disable\n > Default (Enable)\nchoice[1-2]: '`" _config_stack;
if [[ $_config_stack = "1" ]]; then
msg2 "Enable CONFIG_STACK_VALIDATION"
scripts/config --enable CONFIG_STACK_VALIDATION
elif [[ $_config_stack = "2" ]]; then
msg2 "Disable CONFIG_STACK_VALIDATION"
scripts/config --disable CONFIG_STACK_VALIDATION
else
msg2 "Enable CONFIG_STACK_VALIDATION"
scripts/config --enable CONFIG_STACK_VALIDATION
fi
sleep 2s
plain ""
plain "#########################################"
plain "Enable/disable IKCONFIG"
plain "Enable access to the kernel configuration file through /proc/config.gz"
read -rp "`echo $' > 1.Enable\n > 2.Disable\n > Default (Enable)\nchoice[1-2]: '`" _ikconfig;
if [[ $_ikconfig = "1" ]]; then
msg2 "Enable IKCONFIG"
scripts/config --enable CONFIG_IKCONFIG
scripts/config --enable CONFIG_IKCONFIG_PROC
elif [[ $_ikconfig = "2" ]]; then
msg2 "Disable IKCONFIG"
scripts/config --disable CONFIG_IKCONFIG
scripts/config --disable CONFIG_IKCONFIG_PROC
else
msg2 "Enable IKCONFIG"
scripts/config --enable CONFIG_IKCONFIG
scripts/config --enable CONFIG_IKCONFIG_PROC
fi
sleep 2s
plain ""
plain "#########################################"
plain "Enable/disable NUMA"
plain "Better option is to disable NUMA since most users do not have multiple"
plain "processors... Breaks CUDA/NvEnc..."
read -rp "`echo $' > 1.Enable\n > 2.Disable (possibly increase performance)\n > Default (Disable)\nchoice[1-2]: '`" _numa;
if [[ $_numa = "1" ]]; then
msg2 "Enable NUMA"
scripts/config --enable CONFIG_NUMA
scripts/config --enable CONFIG_NUMA
scripts/config --enable CONFIG_AMD_NUMA
scripts/config --enable CONFIG_X86_64_ACPI_NUMA
scripts/config --enable CONFIG_NODES_SPAN_OTHER_NODES
scripts/config --enable CONFIG_NUMA_EMU
scripts/config --enable CONFIG_NEED_MULTIPLE_NODES
scripts/config --enable CONFIG_USE_PERCPU_NUMA_NODE_ID
scripts/config --enable CONFIG_ACPI_NUMA
scripts/config --enable CONFIG_ARCH_SUPPORTS_NUMA_BALANCING
scripts/config --set-val CONFIG_NODES_SHIFT 5
scripts/config --enable CONFIG_NEED_MULTIPLE_NODES
elif [[ $_numa = "2" ]]; then
msg2 "Disable NUMA"
scripts/config --disable CONFIG_NUMA
scripts/config --disable CONFIG_AMD_NUMA
scripts/config --disable CONFIG_X86_64_ACPI_NUMA
scripts/config --disable CONFIG_NODES_SPAN_OTHER_NODES
scripts/config --disable CONFIG_NUMA_EMU
scripts/config --disable CONFIG_NEED_MULTIPLE_NODES
scripts/config --disable CONFIG_USE_PERCPU_NUMA_NODE_ID
scripts/config --disable CONFIG_ACPI_NUMA
scripts/config --disable CONFIG_ARCH_SUPPORTS_NUMA_BALANCING
scripts/config --disable CONFIG_NODES_SHIFT
scripts/config --undefine CONFIG_NODES_SHIFT
scripts/config --disable CONFIG_NEED_MULTIPLE_NODES
else
msg2 "Disable NUMA"
scripts/config --disable CONFIG_NUMA
scripts/config --disable CONFIG_AMD_NUMA
scripts/config --disable CONFIG_X86_64_ACPI_NUMA
scripts/config --disable CONFIG_NODES_SPAN_OTHER_NODES
scripts/config --disable CONFIG_NUMA_EMU
scripts/config --disable CONFIG_NEED_MULTIPLE_NODES
scripts/config --disable CONFIG_USE_PERCPU_NUMA_NODE_ID
scripts/config --disable CONFIG_ACPI_NUMA
scripts/config --disable CONFIG_ARCH_SUPPORTS_NUMA_BALANCING
scripts/config --disable CONFIG_NODES_SHIFT
scripts/config --undefine CONFIG_NODES_SHIFT
scripts/config --disable CONFIG_NEED_MULTIPLE_NODES
fi
sleep 2s
plain ""
plain "#########################################"
plain "Enable/disable FUNCTION_TRACER/GRAPH_TRACER"
plain "Limits debugging and analyzing of the kernel"
read -rp "`echo $' > 1.Enable\n > 2.Disable (possibly increase performance)\n > Default (Disable)\nchoice[1-2]: '`" _tracer;
if [[ $_tracer = "1" ]]; then
msg2 "Enable FUNCTION_TRACER/GRAPH_TRACER"
scripts/config --enable CONFIG_FUNCTION_TRACER
scripts/config --enable CONFIG_STACK_TRACER
elif [[ $_tracer = "2" ]]; then
msg2 "Disable FUNCTION_TRACER/GRAPH_TRACER"
scripts/config --disable CONFIG_FUNCTION_TRACER
scripts/config --disable CONFIG_STACK_TRACER
else
msg2 "Disable FUNCTION_TRACER/GRAPH_TRACER"
scripts/config --disable CONFIG_FUNCTION_TRACER
scripts/config --disable CONFIG_STACK_TRACER
fi
sleep 2s
plain ""
plain "#########################################"
plain "Enable/Disable CONFIG_USER_NS_UNPRIVILEGED"
plain ""
plain "Allow unprivileged users to create namespaces"
plain "When disabled, unprivileged users will not be able to create"
plain "new namespaces. Allowing users to create their own namespaces"
plain "has been part of several recent local privilege escalation"
plain "exploits, so if you need user namespaces but are"
plain "paranoid^Wsecurity-conscious you want to disable this."
plain "This setting can be overridden at runtime via the"
plain "kernel.unprivileged_userns_clone sysctl."
plain ""
read -rp "`echo $' > 1.Enable\n > 2.Disable\n > Default (Disable)\nchoice[1-2]: '`" _ns;
if [[ $_ns = "1" ]]; then
msg2 "Enable CONFIG_USER_NS_UNPRIVILEGED"
scripts/config --disable CONFIG_USER_NS_UNPRIVILEGED
elif [[ $_ns = "2" ]]; then
msg2 "Disable CONFIG_USER_NS_UNPRIVILEGED"
scripts/config --disable CONFIG_USER_NS_UNPRIVILEGED
else
msg2 "Disable CONFIG_USER_NS_UNPRIVILEGED"
scripts/config --disable CONFIG_USER_NS_UNPRIVILEGED
fi
sleep 2s
plain ""
plain "#########################################"
plain "Set CPU Frequency scaling"
plain ""
plain "performance : When attached to a policy object, this governor causes"
plain "the highest frequency, within the scaling_max_freq policy limit, to be"
plain "requested for that policy. The request is made once at that time the"
plain "governor for the policy is set to performance and whenever the"
plain "scaling_max_freq or scaling_min_freq policy limits change after that."
plain ""
plain "powersave : When attached to a policy object, this governor causes the"
plain "lowest frequency, within the scaling_min_freq policy limit, to be"
plain "requested for that policy.The request is made once at that time the"
plain "governor for the policy is set to powersave and whenever the"
plain "scaling_max_freq or scaling_min_freq policy limits change after that."
plain ""
plain "userspace : This governor does not do anything by itself. Instead, it"
plain "allows user space to set the CPU frequency for the policy it is"
plain "attached to by writing to the scaling_setspeed attribute of that policy."
plain ""
plain "schedutil : This governor uses CPU utilization data available from the"
plain "CPU scheduler. It generally is regarded as a part of th CPU scheduler,"
plain "so it can access the scheduler’s internal data structures directly."
plain ""
plain "ondemand : This governor uses CPU load as a CPU frequency selection"
plain "metric. In order to estimate the current CPU load, it measures the time"
plain "elapsed between consecutive invocations of its worker routine and computes"
plain "the fraction of that time in which the given CPU was not idle. The"
plain "ratio of the non-idle (active) time to the total CPU time is"
plain "taken as an estimate of the load."
plain ""
plain "conservative : This governor uses CPU load as a CPU frequency selection"
plain "metric. It estimates the CPU load in the same way as the"
plain "ondemand governor described above, but the CPU frequency selection"
plain "algorithm implemented by it is different."
plain ""
plain "Full documentation at : https://www.kernel.org/doc/html/v4.14/admin-guide/pm/cpufreq.html"
plain ""
read -rp "`echo $' > 1.Powersave\n > 2.Userspace\n > 3.Ondemand\n > 4.Conservative\n > 5.Schedutil\n > 6.Performance\n > 7.Default(zen-kernel)\n > Default (Performance)\nchoice[1-7]: '`" _cpu_freq;
if [[ $_cpu_freq = "1" ]]; then
msg2 "Set CPU Frequency scaling CONFIG_CPU_FREQ_DEFAULT_GOV/CONFIG_CPU_FREQ_GOV for powersave"
scripts/config --enable CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE
scripts/config --enable CONFIG_CPU_FREQ_GOV_POWERSAVE
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE
scripts/config --disable CONFIG_CPU_FREQ_GOV_USERSPACE
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND
scripts/config --disable CONFIG_CPU_FREQ_GOV_ONDEMAND
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
scripts/config --disable CONFIG_CPU_FREQ_GOV_CONSERVATIVE
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL
scripts/config --disable CONFIG_CPU_FREQ_GOV_SCHEDUTIL
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE
scripts/config --disable CONFIG_CPU_FREQ_GOV_PERFORMANCE
elif [[ $_cpu_freq = "2" ]]; then
msg2 "Set CPU Frequency scaling CONFIG_CPU_FREQ_DEFAULT_GOV/CONFIG_CPU_FREQ_GOV for userspace"
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE
scripts/config --disable CONFIG_CPU_FREQ_GOV_POWERSAVE
scripts/config --enable CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE
scripts/config --enable CONFIG_CPU_FREQ_GOV_USERSPACE
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND
scripts/config --disable CONFIG_CPU_FREQ_GOV_ONDEMAND
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
scripts/config --disable CONFIG_CPU_FREQ_GOV_CONSERVATIVE
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL
scripts/config --disable CONFIG_CPU_FREQ_GOV_SCHEDUTIL
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE
scripts/config --disable CONFIG_CPU_FREQ_GOV_PERFORMANCE
elif [[ $_cpu_freq = "3" ]]; then
msg2 "Set CPU Frequency scaling CONFIG_CPU_FREQ_DEFAULT_GOV/CONFIG_CPU_FREQ_GOV for ondemand"
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE
scripts/config --disable CONFIG_CPU_FREQ_GOV_POWERSAVE
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE
scripts/config --disable CONFIG_CPU_FREQ_GOV_USERSPACE
scripts/config --enable CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND
scripts/config --enable CONFIG_CPU_FREQ_GOV_ONDEMAND
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
scripts/config --disable CONFIG_CPU_FREQ_GOV_CONSERVATIVE
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL
scripts/config --disable CONFIG_CPU_FREQ_GOV_SCHEDUTIL
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE
scripts/config --disable CONFIG_CPU_FREQ_GOV_PERFORMANCE
elif [[ $_cpu_freq = "4" ]]; then
msg2 "Set CPU Frequency scaling CONFIG_CPU_FREQ_DEFAULT_GOV/CONFIG_CPU_FREQ_GOV for conservative"
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE
scripts/config --disable CONFIG_CPU_FREQ_GOV_POWERSAVE
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE
scripts/config --disable CONFIG_CPU_FREQ_GOV_USERSPACE
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND
scripts/config --disable CONFIG_CPU_FREQ_GOV_ONDEMAND
scripts/config --enable CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
scripts/config --enable CONFIG_CPU_FREQ_GOV_CONSERVATIVE
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL
scripts/config --disable CONFIG_CPU_FREQ_GOV_SCHEDUTIL
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE
scripts/config --disable CONFIG_CPU_FREQ_GOV_PERFORMANCE
elif [[ $_cpu_freq = "5" ]]; then
msg2 "Set CPU Frequency scaling CONFIG_CPU_FREQ_DEFAULT_GOV/CONFIG_CPU_FREQ_GOV for schedutil"
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE
scripts/config --disable CONFIG_CPU_FREQ_GOV_POWERSAVE
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE
scripts/config --disable CONFIG_CPU_FREQ_GOV_USERSPACE
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND
scripts/config --disable CONFIG_CPU_FREQ_GOV_ONDEMAND
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
scripts/config --disable CONFIG_CPU_FREQ_GOV_CONSERVATIVE
scripts/config --enable CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL
scripts/config --enable CONFIG_CPU_FREQ_GOV_SCHEDUTIL
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE
scripts/config --disable CONFIG_CPU_FREQ_GOV_PERFORMANCE
elif [[ $_cpu_freq = "6" ]]; then
msg2 "Set CPU Frequency scaling CONFIG_CPU_FREQ_DEFAULT_GOV/CONFIG_CPU_FREQ_GOV for performance"
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE
scripts/config --disable CONFIG_CPU_FREQ_GOV_POWERSAVE
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE
scripts/config --disable CONFIG_CPU_FREQ_GOV_USERSPACE
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND
scripts/config --disable CONFIG_CPU_FREQ_GOV_ONDEMAND
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
scripts/config --disable CONFIG_CPU_FREQ_GOV_CONSERVATIVE
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL
scripts/config --disable CONFIG_CPU_FREQ_GOV_SCHEDUTIL
scripts/config --enable CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE
scripts/config --enable CONFIG_CPU_FREQ_GOV_PERFORMANCE
elif [[ $_cpu_freq = "7" ]]; then
msg2 "Set CPU Frequency scaling default from zen kernel"
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE
scripts/config --enable CONFIG_CPU_FREQ_GOV_POWERSAVE
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE
scripts/config --enable CONFIG_CPU_FREQ_GOV_USERSPACE
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND
scripts/config --enable CONFIG_CPU_FREQ_GOV_ONDEMAND
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
scripts/config --enable CONFIG_CPU_FREQ_GOV_CONSERVATIVE
scripts/config --enable CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL
scripts/config --enable CONFIG_CPU_FREQ_GOV_SCHEDUTIL
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE
scripts/config --enable CONFIG_CPU_FREQ_GOV_PERFORMANCE
else
msg2 "Set CPU Frequency scaling CONFIG_CPU_FREQ_DEFAULT_GOV/CONFIG_CPU_FREQ_GOV for performance"
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE
scripts/config --disable CONFIG_CPU_FREQ_GOV_POWERSAVE
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE
scripts/config --disable CONFIG_CPU_FREQ_GOV_USERSPACE
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND
scripts/config --disable CONFIG_CPU_FREQ_GOV_ONDEMAND
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
scripts/config --disable CONFIG_CPU_FREQ_GOV_CONSERVATIVE
scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL
scripts/config --disable CONFIG_CPU_FREQ_GOV_SCHEDUTIL
scripts/config --enable CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE
scripts/config --enable CONFIG_CPU_FREQ_GOV_PERFORMANCE
fi
sleep 2s
plain ""
plain "#########################################"
plain "Set CPU DEVFREQ Governor"
plain ""
plain "Simple Ondemand : Chooses frequency based on the recent load on the"
plain "device. Works similar as ONDEMAND governor of CPUFREQ does. A device"
plain "with Simple-Ondemand should be able to provide busy/total counter"
plain "values that imply the usage rate. A device may provide tuned values"
plain "to the governor with data field at devfreq_add_device()."
plain ""
plain "Performance : Sets the frequency at the maximum available frequency."
plain "This governor always returns UINT_MAX as frequency so that the DEVFREQ"
plain "framework returns the highest frequency available at any time."
plain ""
plain "Powersave : Sets the frequency at the minimum available frequency."
plain "This governor always returns 0 as frequency so that the DEVFREQ"
plain "framework returns the lowest frequency available at any time."
plain ""
plain "Userspace : Sets the frequency at the user specified one. This"
plain "governor returns the user configured frequency if there has been an"
plain "input to /sys/devices/.../power/devfreq_set_freq. Otherwise, the"
plain "governor does not change the frequency given at the initialization."
plain ""
plain "Passive : Sets the frequency based on the frequency of its parent"
plain "devfreq device. This governor does not change the frequency by itself"
plain "through sysfs entries. The passive governor recommends that devfreq"
plain "device uses the OPP table to get the frequency/voltage."
plain ""
read -rp "`echo $' > 1.Simple Ondemand\n > 2.Powersave\n > 3.Userspace\n > 4.Passive\n > 5.Performance\n > 6.Default(zen kernel : all)\n > Default (Performance)\nchoice[1-6]: '`" _devfreq
if [[ $_devfreq = "1" ]]; then
msg2 "Set CPU DEVFREQ GOV CONFIG_DEVFREQ_GOV for simple ondemand"
scripts/config --enable CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND
scripts/config --disable CONFIG_DEVFREQ_GOV_POWERSAVE
scripts/config --disable CONFIG_DEVFREQ_GOV_USERSPACE
scripts/config --disable CONFIG_DEVFREQ_GOV_PASSIVE
scripts/config --disable CONFIG_DEVFREQ_GOV_PERFORMANCE
elif [[ $_devfreq = "2" ]]; then
msg2 "Set CPU DEVFREQ GOV CONFIG_DEVFREQ_GOV for powersave"
scripts/config --disable CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND
scripts/config --undefine CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND
scripts/config --enable CONFIG_DEVFREQ_GOV_POWERSAVE
scripts/config --disable CONFIG_DEVFREQ_GOV_USERSPACE
scripts/config --disable CONFIG_DEVFREQ_GOV_PASSIVE
scripts/config --disable CONFIG_DEVFREQ_GOV_PERFORMANCE
elif [[ $_devfreq = "3" ]]; then
msg2 "Set CPU DEVFREQ GOV CONFIG_DEVFREQ_GOV for userspace"
scripts/config --disable CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND
scripts/config --undefine CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND
scripts/config --disable CONFIG_DEVFREQ_GOV_POWERSAVE
scripts/config --enable CONFIG_DEVFREQ_GOV_USERSPACE
scripts/config --disable CONFIG_DEVFREQ_GOV_PASSIVE
scripts/config --disable CONFIG_DEVFREQ_GOV_PERFORMANCE
elif [[ $_devfreq = "4" ]]; then
msg2 "Set CPU DEVFREQ GOV CONFIG_DEVFREQ_GOV for passive"
scripts/config --disable CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND
scripts/config --undefine CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND
scripts/config --disable CONFIG_DEVFREQ_GOV_POWERSAVE
scripts/config --disable CONFIG_DEVFREQ_GOV_USERSPACE
scripts/config --enable CONFIG_DEVFREQ_GOV_PASSIVE
scripts/config --disable CONFIG_DEVFREQ_GOV_PERFORMANCE
elif [[ $_devfreq = "5" ]]; then
msg2 "Set CPU DEVFREQ GOV CONFIG_DEVFREQ_GOV for performance"
scripts/config --disable CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND
scripts/config --undefine CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND
scripts/config --disable CONFIG_DEVFREQ_GOV_POWERSAVE
scripts/config --disable CONFIG_DEVFREQ_GOV_USERSPACE
scripts/config --disable CONFIG_DEVFREQ_GOV_PASSIVE
scripts/config --enable CONFIG_DEVFREQ_GOV_PERFORMANCE
elif [[ $_devfreq = "6" ]]; then
msg2 "Set CPU DEVFREQ GOV CONFIG_DEVFREQ_GOV default from zen kernel"
scripts/config --enable CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND
scripts/config --enable CONFIG_DEVFREQ_GOV_POWERSAVE
scripts/config --enable CONFIG_DEVFREQ_GOV_USERSPACE
scripts/config --enable CONFIG_DEVFREQ_GOV_PASSIVE
scripts/config --enable CONFIG_DEVFREQ_GOV_PERFORMANCE
else
msg2 "Set CPU DEVFREQ GOV CONFIG_DEVFREQ_GOV for performance"
scripts/config --disable CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND
scripts/config --undefine CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND
scripts/config --disable CONFIG_DEVFREQ_GOV_POWERSAVE
scripts/config --disable CONFIG_DEVFREQ_GOV_USERSPACE
scripts/config --disable CONFIG_DEVFREQ_GOV_PASSIVE
scripts/config --enable CONFIG_DEVFREQ_GOV_PERFORMANCE
fi
sleep 2s
plain ""
plain "#########################################"
plain "Set PCIEASPM driver"
plain ""
plain "BIOS default : Use the BIOS defaults for PCI Express ASPM."
plain ""
plain "Powersave : Enable PCI Express ASPM L0s and L1 where possible, even if"
plain "the BIOS did not."
plain ""
plain "Power Supersave : Same as PCIEASPM_POWERSAVE, except it also enables L1"
plain "substates where possible. This would result in higher power savings while"
plain "staying in L1 where the components support it."
plain ""
plain "Performance : Disable PCI Express ASPM L0s and L1, even if the BIOS enabled them."
plain ""
read -rp "`echo $' > 1.Default\n > 2.Powersave\n > 3.Supersave\n > 4.Performance\n > Default (Performance)\nchoice[1-4]: '`" _pcieaspm
if [[ $_pcieaspm = "1" ]]; then
msg2 "Set PCIEASPM DRIVER to default"
scripts/config --enable CONFIG_PCIEASPM
scripts/config --enable CONFIG_PCIEASPM_DEFAULT
elif [[ $_pcieaspm = "2" ]]; then
msg2 "Set PCIEASPM DRIVER to powersave"
scripts/config --enable CONFIG_PCIEASPM
scripts/config --enable CONFIG_PCIEASPM_POWERSAVE
elif [[ $_pcieaspm = "3" ]]; then
msg2 "Set PCIEASPM DRIVER to supersave"
scripts/config --enable CONFIG_PCIEASPM
scripts/config --enable CONFIG_PCIEASPM_SUPERSAVE
elif [[ $_pcieaspm = "4" ]]; then
msg2 "Set PCIEASPM DRIVER to performance"
scripts/config --enable CONFIG_PCIEASPM
scripts/config --enable CONFIG_PCIEASPM_PERFORMANCE
else
msg2 "Set PCIEASPM DRIVER to performance"
scripts/config --enable CONFIG_PCIEASPM
scripts/config --enable CONFIG_PCIEASPM_PERFORMANCE
fi
sleep 2s
plain ""
plain "#########################################"
plain "Set PCIE_BUS driver"
plain ""
plain "Tune Off : Use the BIOS defaults; don't touch MPS at all. This is the"
plain "same as booting with 'pci=pcie_bus_tune_off'."
plain ""
plain "Default : Default choice; ensure that the MPS matches upstream bridge."
plain ""
plain "Safe : Use largest MPS that boot-time devices support. If you have a closed"
plain "system with no possibility of adding new devices,"
plain "this will use the largest MPS that's supported by all devices. This is"
plain "the same as booting with 'pci=pcie_bus_safe'."
plain ""
plain "Performance : Use MPS and MRRS for best performance. Ensure that a given"
plain "device's MPS is no larger than its parent MPS, which allows us to"
plain "keep all switches/bridges to the max MPS supported by their parent."
plain "This is the same as booting with 'pci=pcie_bus_perf'."
plain ""
plain "Peer2peer : Set MPS = 128 for all devices. MPS configuration effected by"
plain "the other options could cause the MPS on one root port to"
plain "be different than that of the MPS on another, which may cause hot-added"
plain "devices or peer-to-peer DMA to fail. Set MPS to the"
plain "smallest possible value (128B) system-wide to avoid these issues. This is"
plain "the same as booting with 'pci=pcie_bus_peer2peer'."
plain ""
read -rp "`echo $' > 1.Tune off\n > 2.Default\n > 3.Safe\n > 4.Performance\n > 5.Peer2peer\n > Default (Performance)\nchoice[1-5]: '`" _pcie_bus
if [[ $_pcie_bus = "1" ]]; then
msg2 "Set CONFIG_PCIE_BUS for tune off"
scripts/config --enable CONFIG_PCIE_BUS_TUNE_OFF
elif [[ $_pcie_bus = "2" ]] || [[ $_pcie_bus = "6" ]]; then
msg2 "Set CONFIG_PCIE_BUS for default"
scripts/config --enable CONFIG_PCIE_BUS_DEAULT
elif [[ $_pcie_bus = "3" ]]; then
msg2 "Set CONFIG_PCIE_BUS for safe"
scripts/config --enable CONFIG_PCIE_BUS_SAFE
elif [[ $_pcie_bus = "4" ]]; then
msg2 "Set CONFIG_PCIE_BUS for performance"
scripts/config --enable CONFIG_PCIE_BUS_PERFORMANCE
elif [[ $_pcie_bus = "5" ]]; then
msg2 "Set CONFIG_PCIE_BUS for peerpeer"
scripts/config --enable CONFIG_PCIE_BUS_PEER2PEER
else
msg2 "Set CONFIG_PCIE_BUS for performance"
scripts/config --enable CONFIG_PCIE_BUS_PERFORMANCE
fi
sleep 2s
plain ""
plain "#########################################"
plain "Set Optimization"
plain ""
plain "Optimize for performance (-O2) : This is the default optimization level"
plain "for the kernel, building with the "-O2""
plain "compiler flag for best performance and most helpful compile-time warnings."
plain ""
plain "Optimize more for performance (-O3) : Choosing this option will pass \"-O3"
plain "to your compiler to optimize the kernel yet more for performance."
plain ""
plain "Optimize for size (-Os) : Choosing this option will pass "-Os" to your"
plain "compiler resulting in a smaller kernel."
plain ""
read -rp "`echo $' > 1.Optimize for performance(-O2)\n > 2.Optimize for performance(-O3)\n > 3.Optimize for size(-Os)\n > Default (Optimize for performance (-O3))\nchoice[1-3]: '`" _optimize
if [[ "$_optimize" = "1" ]]; then
msg2 "Enable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE"
scripts/config --disable CONFIG_CC_OPTIMIZE_FOR_SIZE
scripts/config --disable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
scripts/config --enable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
elif [[ "$_optimize" = "2" ]]; then
msg2 "Enable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3"
scripts/config --disable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
scripts/config --disable CONFIG_CC_OPTIMIZE_FOR_SIZE
scripts/config --enable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
elif [[ "$_optimize" = "3" ]]; then
msg2 "Enable CONFIG_CC_OPTIMIZE_FOR_SIZE..."
scripts/config --disable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
scripts/config --disable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
scripts/config --enable CONFIG_CC_OPTIMIZE_FOR_SIZE
else
msg2 "Enable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3"
scripts/config --disable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
scripts/config --disable CONFIG_CC_OPTIMIZE_FOR_SIZE
scripts/config --enable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
fi
sleep 2s
plain ""
plain "#########################################"
plain "Set timer frequency"
plain ""
plain "100 HZ : 100 Hz is a typical choice for servers, SMP and NUMA systems"
plain "with lots of processors that may show reduced performance if"
plain "too many timer interrupts are occurring."
plain ""
plain "250 HZ : 250 Hz is a good compromise choice allowing server performance"
plain "while also showing good interactive responsiveness even"
plain "on SMP and NUMA systems. If you are going to be using NTSC video"
plain "or multimedia, selected 300Hz instead."
plain ""
plain "300 HZ : 300 Hz is a good compromise choice allowing server performance"
plain "while also showing good interactive responsiveness even"
plain "on SMP and NUMA systems and exactly dividing by both PAL and"
plain "NTSC frame rates for video and multimedia work."
plain ""
plain "750 HZ : 750 Hz is a balanced timer frequency. Provides fast interactivity"
plain "on desktops with good smoothness without increasing CPU power"
plain "consumption and sacrificing the battery life on laptops."
plain ""
plain "1000 HZ : 1000 Hz is the preferred choice for desktop systems and other"
plain "systems requiring fast interactive responses to events."
plain ""
read -rp "`echo $' > 1.100\n > 2.250\n > 3.300\n > 4.750\n > 5.1000\n > Default (1000)\nchoice[1-6]: '`" _timer_freq
if [[ "$_timer_freq" = "1" ]]; then
msg2 "Set timer frequency to 100HZ"
scripts/config --enable CONFIG_HZ_100
scripts/config --set-val CONFIG_HZ 100
elif [[ "$_timer_freq" = "2" ]]; then
msg2 "Set timer frequency to 250HZ"
scripts/config --enable CONFIG_HZ_250
scripts/config --set-val CONFIG_HZ 250
elif [[ "$_timer_freq" = "3" ]]; then
msg2 "Set timer frequency to 300HZ"
scripts/config --enable CONFIG_HZ_300
scripts/config --set-val CONFIG_HZ 300
elif [[ "$_timer_freq" = "4" ]]; then
msg2 "Set timer frequency to 750HZ"
scripts/config --enable CONFIG_HZ_750
scripts/config --set-val CONFIG_HZ 750
elif [[ "$_timer_freq" = "5" ]]; then
msg2 "Set timer frequency to 1000HZ"
scripts/config --enable CONFIG_HZ_1000
scripts/config --set-val CONFIG_HZ 1000
else
msg2 "Set timer frequency to 1000HZ"
scripts/config --enable CONFIG_HZ_1000
scripts/config --set-val CONFIG_HZ 1000
fi
sleep 2
plain ""
plain "#########################################"
plain "Set Preemption Model"
plain ""
plain "PREEMPT_NONE (No Forced Preemption (Server)) :"
plain ""
plain "This is the traditional Linux preemption model, geared towards"
plain "throughput. It will still provide good latencies most of the"
plain "time, but there are no guarantees and occasional longer delays"
plain "are possible."
plain "Select this option if you are building a kernel for a server or"
plain "scientific/computation system, or if you want to maximize the"
plain "raw processing power of the kernel, irrespective of scheduling"
plain "latencies."
plain ""
plain "PREEMPT_VOLUNTARY (Voluntary Kernel Preemption (Desktop)) :"
plain ""
plain "This option reduces the latency of the kernel by adding more"
plain "(explicit preemption points) to the kernel code. These new"
plain "preemption points have been selected to reduce the maximum"
plain "latency of rescheduling, providing faster application reactions,"
plain "at the cost of slightly lower throughput."
plain "This allows reaction to interactive events by allowing a"
plain "low priority process to voluntarily preempt itself even if it"
plain "is in kernel mode executing a system call. This allows"
plain "applications to run more 'smoothly' even when the system is"
plain "under load."
plain "Select this if you are building a kernel for a desktop system."
plain ""
plain "PREEMPT (Preemptible Kernel (Low-Latency Desktop)) :"
plain ""
plain "This option reduces the latency of the kernel by making"
plain "all kernel code (that is not executing in a critical section)"
plain "preemptible. This allows reaction to interactive events by"
plain "permitting a low priority process to be preempted involuntarily"
plain "even if it is in kernel mode executing a system call and would"
plain "otherwise not be about to reach a natural preemption point."
plain "This allows applications to run more 'smoothly' even when the"
plain "system is under load, at the cost of slightly lower throughput"
plain "and a slight runtime overhead to kernel code."
plain "Select this if you are building a kernel for a desktop or"
plain "embedded system with latency requirements in the milliseconds"
plain "range."
plain ""
read -rp "`echo $' > 1.PREEMPT_NONE\n > 2.PREEMPT_VOLUNTARY\n > 3.PREEMPT\n > Default (PREEMPT)\nchoice[1-3]: '`" _preempt
if [[ "$_preempt" = "1" ]]; then
msg2 "Enable PREEMPT_NONE"
scripts/config --enable CONFIG_PREEMPT_NONE
scripts/config --disable CONFIG_PREEMPT_VOLUNTARY
scripts/config --disable CONFIG_PREEMPT
scripts/config --enable CONFIG_PREEMPT_COUNT
scripts/config --enable CONFIG_PREEMPTION
elif [[ "$_preempt" = "2" ]]; then
msg2 "Enable PREEMPT_VOLUNTARY"
scripts/config --disable CONFIG_PREEMPT_NONE
scripts/config --enable CONFIG_PREEMPT_VOLUNTARY
scripts/config --disable CONFIG_PREEMPT
scripts/config --enable CONFIG_PREEMPT_COUNT
scripts/config --enable CONFIG_PREEMPTION
elif [[ "$_preempt" = "3" ]]; then
msg2 "Enable PREEMPT"
scripts/config --disable CONFIG_PREEMPT_NONE
scripts/config --disable CONFIG_PREEMPT_VOLUNTARY
scripts/config --enable CONFIG_PREEMPT
scripts/config --enable CONFIG_PREEMPT_COUNT
scripts/config --enable CONFIG_PREEMPTION
else
msg2 "Enable PREEMPT"
scripts/config --disable CONFIG_PREEMPT_NONE
scripts/config --disable CONFIG_PREEMPT_VOLUNTARY
scripts/config --enable CONFIG_PREEMPT
scripts/config --enable CONFIG_PREEMPT_COUNT
scripts/config --enable CONFIG_PREEMPTION
fi
sleep 2s
plain ""
plain "#########################################"
plain "Enable/disable CONFIG_IRQ_FORCE_THREADING"
read -rp "`echo $' > 1.Enable\n > 2.Disable\n > Default (Enable)\nchoice[1-2]: '`" _irq
if [[ "$_irq" = "1" ]]; then
msg2 "Enable CONFIG_IRQ_FORCE_THREADING"
scripts/config --enable CONFIG_IRQ_FORCE_THREADING
elif [[ "$_irq" = "2" ]]; then
msg2 "Disable CONFIG_IRQ_FORCE_THREADING"
scripts/config --disable CONFIG_IRQ_FORCE_THREADING
else
msg2 "Enable CONFIG_IRQ_FORCE_THREADING"
scripts/config --enable CONFIG_IRQ_FORCE_THREADING
fi
sleep 2s
plain ""
plain "#########################################"
plain "Use CattaRappa mode (Tickless/Dynticks) ?"
plain "Can give higher performances in many cases but lower consistency on"
plain "some hardware."
plain "Just tickless idle can perform better with some platforms (mostly AMD)"
plain "or CPU schedulers (mostly MuQSS)."
plain ""
read -rp "`echo $' > 1.Periodic ticks\n > 2.Full tickless\n > 3.Tickless idle\n > Default (Full tickless)\nchoice[1-3]: '`" _tick
if [[ "$_tick" = "1" ]]; then
msg2 "Set to periodic ticks"
scripts/config --enable CONFIG_HZ_PERIODIC
scripts/config --disable CONFIG_NO_HZ_IDLE
scripts/config --disable CONFIG_NO_HZ_FULL
scripts/config --disable CONFIG_NO_HZ
scripts/config --disable CONFIG_NO_HZ_COMMON
elif [[ "$_tick" = "2" ]]; then
msg2 "Set to full tickless"
scripts/config --disable CONFIG_HZ_PERIODIC
scripts/config --disable CONFIG_NO_HZ_IDLE
scripts/config --enable CONFIG_NO_HZ_FULL
scripts/config --enable CONFIG_NO_HZ
scripts/config --enable CONFIG_NO_HZ_COMMON
#scripts/config --enable CONFIG_CONTEXT_TRACKING
#scripts/config --disable CONFIG_CONTEXT_TRACKING_FORCE
elif [[ "$_tick" = "3" ]]; then
msg2 "Set to tickless idle"
scripts/config --disable CONFIG_HZ_PERIODIC
scripts/config --enable CONFIG_NO_HZ_IDLE
scripts/config --disable CONFIG_NO_HZ_FULL
scripts/config --enable CONFIG_NO_HZ
scripts/config --enable CONFIG_NO_HZ_COMMON
else
msg2 "Set to full tickless"
scripts/config --disable CONFIG_HZ_PERIODIC
scripts/config --disable CONFIG_NO_HZ_IDLE
scripts/config --enable CONFIG_NO_HZ_FULL
scripts/config --enable CONFIG_NO_HZ
scripts/config --enable CONFIG_NO_HZ_COMMON
#scripts/config --enable CONFIG_CONTEXT_TRACKING
#scripts/config --disable CONFIG_CONTEXT_TRACKING_FORCE
fi
sleep 2s
plain ""
plain "#########################################"
plain "Enable/disable Device Tree and Open Firmware support"
read -rp "`echo $' > 1.Enable\n > 2.Disable\n > Default (Disable)\nchoice[1-2]: '`" _of
if [[ "$_of" = "1" ]]; then
msg2 "Enable Device Tree and Open Firmware support"
scripts/config --enable CONFIG_OF
elif [[ "$_of" = "1" ]]; then
msg2 "Disable Device Tree and Open Firmware support"
scripts/config --disable CONFIG_OF
else
msg2 "Disable Device Tree and Open Firmware support"
scripts/config --disable CONFIG_OF
fi
sleep 2s
plain ""
plain "#########################################"
plain "Enable/disable tristate V4L2 loopback device"
read -rp "`echo $' > 1.Enable\n > 2.Disable\n > Default (Enable)\nchoice[1-2]: '`" _loopback
if [[ "$_loopback" = "1" ]]; then
msg2 "Enable tristate V4L2 loopback device"
scripts/config --module CONFIG_V4L2_LOOPBACK
elif [[ "$_loopback" = "2" ]]; then
msg2 "Disable tristate V4L2 loopback device"
scripts/config --disable CONFIG_V4L2_LOOPBACK
else
msg2 "Enable tristate V4L2 loopback device"
scripts/config --module CONFIG_V4L2_LOOPBACK
fi
sleep 2s
# uncomment spadfs because of build fail
#plain ""
#plain "#########################################"
#plain "Enable/disable tristate SPADFS file system support"
#read -rp "`echo $' > 1.Enable\n > 2.Disable\n > Default (Enable)\nchoice[1-2]: '`" _spadfs
#if [[ "$_spadfs" = "1" ]]; then
# msg2 "Enable tristate SPADFS file system support"
# scripts/config --module CONFIG_SPADFS_FS
#elif [[ "$_spadfs" = "2" ]]; then
# msg2 "Disable tristate SPADFS file system support"
# scripts/config --disable CONFIG_SPADFS_FS
#else
# msg2 "Enable tristate V4L2 SPADFS file system support"
# scripts/config --module CONFIG_SPADFS_FS
#fi
#sleep 2s
plain ""
plain "#########################################"
plain "Enable/disable NTFS/NTFS3"
plain ""
plain "NTFS :"
plain "Linux-NTFS comes with a number of user-space programs known as ntfsprogs."
plain "These include mkntfs, a full-featured ntfs filesystem format utility,"
plain "ntfsundelete used for recovering files that were unintentionally deleted"
plain "from an NTFS volume and ntfsresize which is used to resize an NTFS partition."
plain "See the web site for more information."
plain "To mount an NTFS 1.2/3.x (Windows NT4/2000/XP/2003) volume, use the file"
plain "system type 'ntfs'. The driver currently supports read-only mode (with no"
plain "fault-tolerance, encryption or journalling) and very limited, but safe, write"
plain "support."
plain "For fault tolerance and raid support (i.e. volume and stripe sets), you can"
plain "use the kernel's Software RAID / MD driver. See section Using Software RAID"
plain "with NTFS for details."
plain ""
plain "NTFS3 :"
plain "NTFS3 is fully functional NTFS Read-Write driver. The driver works with"
plain "NTFS versions up to 3.1, normal/compressed/sparse files"
plain "and journal replaying. File system type to use on mount is 'ntfs3'."
plain "- This driver implements NTFS read/write support for normal, sparse and compressed files."
plain "- Supports native journal replaying;"
plain "- Supports extended attributes"
plain "Predefined extended attributes:"
plain "- 'system.ntfs_security' gets/sets security descriptor (SECURITY_DESCRIPTOR_RELATIVE)"
plain "- 'system.ntfs_attrib' gets/sets ntfs file/dir attributes."
plain "Note: applied to empty files, this allows to switch type between sparse(0x200), compressed(0x800) and normal;"
plain "- Supports NFS export of mounted NTFS volumes."
plain ""
read -rp "`echo $' > 1.Enable\n > 2.Disable\n > Default (Enable)\nchoice[1-2]: '`" _ntfs
if [[ "$_ntfs" = "1" ]]; then
msg2 "Enable ntfs"
scripts/config --module CONFIG_NTFS_FS
scripts/config --enable CONFIG_NTFS_RW
msg2 "Enable ntfs3"
scripts/config --module CONFIG_NTFS3_FS
scripts/config --enable CONFIG_NTFS3_64BIT_CLUSTER
scripts/config --enable CONFIG_NTFS3_LZX_XPRESS
scripts/config --enable CONFIG_NTFS3_FS_POSIX_ACL
elif [[ "$_ntfs" = "2" ]]; then
msg2 "Disable ntfs"
scripts/config --disable CONFIG_NTFS_FS
scripts/config --disable CONFIG_NTFS_RW
msg2 "Disable ntfs3"
scripts/config --disable CONFIG_NTFS3_FS
scripts/config --disable CONFIG_NTFS3_64BIT_CLUSTER
scripts/config --disable CONFIG_NTFS3_LZX_XPRESS
scripts/config --disable CONFIG_NTFS3_FS_POSIX_ACL
else
msg2 "Enable ntfs"
scripts/config --module CONFIG_NTFS_FS
scripts/config --enable CONFIG_NTFS_RW
msg2 "Enable ntfs3"
scripts/config --module CONFIG_NTFS3_FS
scripts/config --enable CONFIG_NTFS3_64BIT_CLUSTER
scripts/config --enable CONFIG_NTFS3_LZX_XPRESS
scripts/config --enable CONFIG_NTFS3_FS_POSIX_ACL
fi
sleep 2s
plain ""
plain "#########################################"
plain "Enable/disable Virtual (SCSI) Host Bus Adapter (VHBA)"
plain ""
plain "This is the in-kernel part of CDEmu, a CD/DVD-ROM device emulator."
plain "This driver can also be built as a module. If so, the module will be called vhba."
plain ""
read -rp "`echo $' > 1.Enable\n > 2.Disable\n > Default (Enable)\nchoice[1-2]: '`" _vhba
if [[ "$_vhba" = "1" ]]; then
msg2 "Enable CONFIG_VHBA"
scripts/config --module CONFIG_VHBA
elif [[ "$_vhba" = "2" ]]; then
msg2 "Disable CONFIG_VHBA"
scripts/config --disable CONFIG_VHBA
else
msg2 "Enable CONFIG_VHBA"
scripts/config --module CONFIG_VHBA
fi
sleep 2s
plain ""
plain "#########################################"
plain "Enable/disable Kyber I/O Scheduler"
plain ""
plain "The Kyber I/O scheduler is a low-overhead scheduler suitable for"
plain "multiqueue and other fast devices. Given target latencies for reads"
plain "and synchronous writes, it will self-tune queue depths to achieve"
plain "that goal."
plain ""
read -rp "`echo $' > 1.Disable\n > 2.Enable\n > Default (Disable)\nchoice[1-2]: '`" _kyber
if [[ "$_kyber" = "1" ]]; then
msg2 "Disabling Kyber I/O scheduler"
scripts/config --disable CONFIG_MQ_IOSCHED_KYBER
elif [[ "$_kyber" = "2" ]]; then
msg2 "Enable Kyber I/O scheduler"
scripts/config --enable CONFIG_MQ_IOSCHED_KYBER
else
msg2 "Disabling Kyber I/O scheduler"
scripts/config --disable CONFIG_MQ_IOSCHED_KYBER
fi
sleep 2s
plain ""
plain "#########################################"
plain "Enable/disable MQ-Deadline I/O Scheduler"
plain ""
plain "MQ version of the deadline IO scheduler.MQ version of the deadline"
plain "IO scheduler."
plain ""
plain "deadline i/o scheduler : The goal of the deadline io scheduler is"
plain "to attempt to guarantee a start service time for a request. As we"
plain "focus mainly on read latencies, this is tunable. When a read request"
plain "first enters the io scheduler, it is assigned a deadline that is the"
plain "current time + the read_expire value in units of milliseconds."
plain ""
read -rp "`echo $' > 1.Disable\n > 2.Enable\n > Default (Disable)\nchoice[1-2]: '`" _deadline
if [[ "$_deadline" = "1" ]]; then
msg2 "Disabling MQ-Deadline I/O scheduler"
scripts/config --disable CONFIG_MQ_IOSCHED_DEADLINE