summarylogtreecommitdiffstats
path: root/cpu_arch
blob: 6e23fd8a7036e60ae066483a749b423a3c053aaf (plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
#!/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 --enable CONFIG_USER_NS_UNPRIVILEGED
  elif [[ $_ns = "2" ]]; then
    msg2 "Disable CONFIG_USER_NS_UNPRIVILEGED"
    scripts/config --disable CONFIG_USER_NS_UNPRIVILEGED
  else
    msg2 "Enable CONFIG_USER_NS_UNPRIVILEGED"
    scripts/config --enable 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 750HZ"
    scripts/config --enable CONFIG_HZ_750
    scripts/config --set-val CONFIG_HZ 750
  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 --disable CONFIG_V4L2_LOOPBACK
  fi

  sleep 2s

  #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 --disable 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
    scripts/config --disable CONFIG_MQ_IOSCHED_DEADLINE_NODEFAULT
  elif [[ "$_deadline" = "2" ]]; then
    msg2 "Enable Deadline I/O scheduler"
    scripts/config --enable CONFIG_MQ_IOSCHED_DEADLINE

    sleep 2s

    plain ""
    plain "#########################################"
    plain "Enable/disable MQ-Deadline-Nodefault I/O Scheduler"
    plain ""
    plain "This renames the mq-deadline scheduler to "mq-deadline-nodefault""
    plain "and also drops its alias of "deadline"."
    plain "This can prevent existing userspace from forcing this scheduler"
    plain "over the kernel's choice."
    plain ""
    read -rp "`echo $' > 1.Disable\n > 2.Enable\n > Default (Enable)\nchoice[1-2]: '`" _deadline_nodefault
    if [[ "$_deadline_nodefault" = "1" ]]; then
      msg2 "Disable MQ-Deadline-Nodefault I/O scheduler"
      scripts/config --disable CONFIG_MQ_IOSCHED_DEADLINE_NODEFAULT
    elif [[ "$_deadline_nodefault" = "2" ]]; then
      msg2 "Enable MQ-Deadline-Nodefault I/O scheduler"
      scripts/config --enable CONFIG_MQ_IOSCHED_DEADLINE_NODEFAULT
    else
      msg2 "Enable MQ-Deadline-Nodefault I/O scheduler"
      scripts/config --enable CONFIG_MQ_IOSCHED_DEADLINE_NODEFAULT
    fi
  else
    msg2 "Disable MQ-Deadline I/O scheduler"
    scripts/config --disable CONFIG_MQ_IOSCHED_DEADLINE
    scripts/config --disable CONFIG_MQ_IOSCHED_DEADLINE_NODEFAULT
  fi

  sleep 2s

  plain ""
  plain "#########################################"
  plain "Enable/disable CONFIG_BFQ_CGROUP_DEBUG"
  read -rp "`echo $' > 1.Disable\n > 2.Enable\n > Default (Enable)\nchoice[1-2]: '`" _bfq_cgroup
  if [[ "$_bfq_cgroup" = "1" ]]; then
    msg2 "disable CONFIG_BFQ_CGROUP_DEBUG..."
    scripts/config --disable CONFIG_BFQ_CGROUP_DEBUG
  elif [[ "$_bfq_cgroup" = "2" ]]; then
    msg2 "Enable CONFIG_BFQ_CGROUP_DEBUG..."
    scripts/config --enable CONFIG_BFQ_CGROUP_DEBUG
  else
    msg2 "Enable CONFIG_BFQ_CGROUP_DEBUG..."
    scripts/config --enable CONFIG_BFQ_CGROUP_DEBUG
  fi

  sleep 2s

  plain ""
  plain "#########################################"
  plain "Disable debug options?"
  read -rp "`echo $' > 1.Disable\n > 2.Keep\n > Default (Disable)\nchoice[1-2]: '`" _debug
  if [[ "$_debug" = "1" ]]; then
    msg2 "Disable debug options"
    scripts/config --disable CONFIG_SLUB_DEBUG
    scripts/config --disable CONFIG_PM_DEBUG
    scripts/config --disable CONFIG_PM_ADVANCED_DEBUG
    scripts/config --disable CONFIG_PM_SLEEP_DEBUG
    scripts/config --disable CONFIG_ACPI_DEBUG
    scripts/config --disable CONFIG_SCHED_DEBUG
    scripts/config --disable CONFIG_LATENCYTOP
    scripts/config --disable CONFIG_DEBUG_PREEMPT
    scripts/config --disable CONFIG_DEBUG_INFO
    scripts/config --disable CONFIG_CGROUP_BPF
    scripts/config --disable CONFIG_BPF_LSM
    scripts/config --disable CONFIG_BPF_PRELOAD
    scripts/config --disable CONFIG_BPF_LIRC_MODE2
    scripts/config --disable CONFIG_BPF_KPROBE_OVERRIDE
    scripts/config --disable CONFIG_DEBUG_INFO_REDUCED
    scripts/config --disable CONFIG_DEBUG_INFO_COMPRESSED
    scripts/config --disable CONFIG_DEBUG_INFO_SPLI
    scripts/config --disable CONFIG_GDB_SCRIPTS
    scripts/config --disable CONFIG_DEBUG_INFO_DWARF4
    scripts/config --disable CONFIG_DEBUG_INFO_BTF
    scripts/config --disable CONFIG_BPF_PRELOAD
    scripts/config --disable CONFIG_BPF_PRELOAD_UMD
    scripts/config --disable CONFIG_BPF_STREAM_PARSER
    scripts/config --disable CONFIG_DMA_API_DEBUG
    scripts/config --disable CONFIG_DMA_API_DEBUG_SG
    scripts/config --disable CONFIG_DMA_MAP_BENCHMARK
    scripts/config --disable CONFIG_DEBUG_FS
    scripts/config --disable CONFIG_GCOV_KERNEL
    scripts/config --disable CONFIG_GCOV_PROFILE_ALL
    scripts/config --disable CONFIG_DEBUG_FS
    scripts/config --disable CONFIG_GENERIC_IRQ_DEBUGFS
    scripts/config --disable CONFIG_ACPI_DEBUGGER
    scripts/config --disable CONFIG_ACPI_DEBUGGER_USER
    scripts/config --disable CONFIG_ACPI_EC_DEBUGFS
    scripts/config --disable CONFIG_ACPI_APEI_ERST_DEBUG
    scripts/config --disable CONFIG_NFIT_SECURITY_DEBUG
    scripts/config --disable CONFIG_DMADEVICES_DEBUG
    scripts/config --disable CONFIG_DMADEVICES_VDEBUG
    scripts/config --disable CONFIG_DMATEST
    scripts/config --disable CONFIG_BTRFS_DEBUG
    scripts/config --disable CONFIG_BTRFS_FS_REF_VERIFY
    scripts/config --disable CONFIG_BTRFS_ASSERT
    scripts/config --disable CONFIG_BTRFS_FS_RUN_SANITY_TESTS
    scripts/config --disable CONFIG_BTRFS_FS_CHECK_INTEGRITY
    scripts/config --disable CONFIG_EXT4_DEBUG
    scripts/config --disable CONFIG_EXT4_KUNIT_TESTS
    scripts/config --disable CONFIG_SECURITY_APPARMOR_DEBUG
    scripts/config --disable CONFIG_SECURITY_APPARMOR_DEBUG_ASSERTS
    scripts/config --disable CONFIG_SECURITY_APPARMOR_DEBUG_MESSAGES
    scripts/config --disable CONFIG_SECURITY_APPARMOR_KUNIT_TEST
    scripts/config --disable CONFIG_POWER_SUPPLY_DEBUG
    scripts/config --disable CONFIG_NTFS_DEBUG
    scripts/config --disable CONFIG_GENERIC_IRQ_DEBUGFS
    scripts/config --disable CONFIG_CIFS_STATS2
    scripts/config --disable CONFIG_CIFS_DEBUG
    scripts/config --disable CONFIG_CIFS_DEBUG2
    scripts/config --disable CONFIG_CIFS_DEBUG_DUMP_KEYS
    scripts/config --disable CONFIG_JBD2_DEBUG
    scripts/config --disable CONFIG_CONFIG_NFS_DEBUG
    scripts/config --disable CONFIG_TRACE_IRQFLAGS_SUPPORT
    scripts/config --disable CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT
    scripts/config --disable CONFIG_EARLY_PRINTK_USB
    scripts/config --disable CONFIG_X86_VERBOSE_BOOTUP
    scripts/config --disable CONFIG_EARLY_PRINTK
    scripts/config --disable CONFIG_EARLY_PRINTK_DBGP
    scripts/config --disable CONFIG_EARLY_PRINTK_USB_XDBC
    scripts/config --disable CONFIG_EFI_PGT_DUMP
    scripts/config --disable CONFIG_DEBUG_TLBFLUSH
    scripts/config --disable CONFIG_IOMMU_DEBUG
    scripts/config --disable CONFIG_IOMMU_LEAK
    scripts/config --disable CONFIG_HAVE_MMIOTRACE_SUPPORT
    scripts/config --disable CONFIG_X86_DECODER_SELFTEST
    scripts/config --disable CONFIG_IO_DELAY_0X80
    scripts/config --disable CONFIG_IO_DELAY_0XED
    scripts/config --disable CONFIG_IO_DELAY_UDELAY
    scripts/config --disable CONFIG_IO_DELAY_NONE
    scripts/config --disable CONFIG_DEBUG_BOOT_PARAMS
    scripts/config --disable CONFIG_CPA_DEBUG
    scripts/config --disable CONFIG_DEBUG_ENTRY
    scripts/config --disable CONFIG_DEBUG_NMI_SELFTEST
    scripts/config --disable CONFIG_DEBUG_IMR_SELFTEST
    scripts/config --disable CONFIG_X86_DEBUG_FPU
    scripts/config --disable CONFIG_PUNIT_ATOM_DEBUG
    scripts/config --disable CONFIG_UNWINDER_ORC
    scripts/config --disable CONFIG_UNWINDER_FRAME_POINTER
    scripts/config --disable CONFIG_UNWINDER_GUESS
    scripts/config --disable CONFIG_FRAME_POINTER
    scripts/config --disable CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
    scripts/config --disable CONFIG_THINKPAD_ACPI_DEBUG
    scripts/config --disable CONFIG_THINKPAD_ACPI_UNSAFE_LEDS
    scripts/config --disable CONFIG_CMA_DEBUG
    scripts/config --disable CONFIG_CMA_DEBUGFS
    scripts/config --disable CONFIG_EDAC_DEBUG
    scripts/config --disable CONFIG_ATM_IA_DEBUG
    scripts/config --disable CONFIG_ATM_FORE200E_DEBUG
    scripts/config --disable CONFIG_BCMA_DEBUG
  elif [[ "$_debug" = "2" ]]; then
    msg2 "Keep debug options"
  else
    msg2 "Disable debug options"
    scripts/config --disable CONFIG_SLUB_DEBUG
    scripts/config --disable CONFIG_PM_DEBUG
    scripts/config --disable CONFIG_PM_ADVANCED_DEBUG
    scripts/config --disable CONFIG_PM_SLEEP_DEBUG
    scripts/config --disable CONFIG_ACPI_DEBUG
    scripts/config --disable CONFIG_SCHED_DEBUG
    scripts/config --disable CONFIG_LATENCYTOP
    scripts/config --disable CONFIG_DEBUG_PREEMPT
    scripts/config --disable CONFIG_DEBUG_INFO
    scripts/config --disable CONFIG_CGROUP_BPF
    scripts/config --disable CONFIG_BPF_LSM
    scripts/config --disable CONFIG_BPF_PRELOAD
    scripts/config --disable CONFIG_BPF_LIRC_MODE2
    scripts/config --disable CONFIG_BPF_KPROBE_OVERRIDE
    scripts/config --disable CONFIG_DEBUG_INFO_REDUCED
    scripts/config --disable CONFIG_DEBUG_INFO_COMPRESSED
    scripts/config --disable CONFIG_DEBUG_INFO_SPLI
    scripts/config --disable CONFIG_GDB_SCRIPTS
    scripts/config --disable CONFIG_DEBUG_INFO_DWARF4
    scripts/config --disable CONFIG_DEBUG_INFO_BTF
    scripts/config --disable CONFIG_BPF_PRELOAD
    scripts/config --disable CONFIG_BPF_PRELOAD_UMD
    scripts/config --disable CONFIG_BPF_STREAM_PARSER
    scripts/config --disable CONFIG_DMA_API_DEBUG
    scripts/config --disable CONFIG_DMA_API_DEBUG_SG
    scripts/config --disable CONFIG_DMA_MAP_BENCHMARK
    scripts/config --disable CONFIG_DEBUG_FS
    scripts/config --disable CONFIG_GCOV_KERNEL
    scripts/config --disable CONFIG_GCOV_PROFILE_ALL
    scripts/config --disable CONFIG_DEBUG_FS
    scripts/config --disable CONFIG_GENERIC_IRQ_DEBUGFS
    scripts/config --disable CONFIG_ACPI_DEBUGGER
    scripts/config --disable CONFIG_ACPI_DEBUGGER_USER
    scripts/config --disable CONFIG_ACPI_EC_DEBUGFS
    scripts/config --disable CONFIG_ACPI_APEI_ERST_DEBUG
    scripts/config --disable CONFIG_NFIT_SECURITY_DEBUG
    scripts/config --disable CONFIG_DMADEVICES_DEBUG
    scripts/config --disable CONFIG_DMADEVICES_VDEBUG
    scripts/config --disable CONFIG_DMATEST
    scripts/config --disable CONFIG_BTRFS_DEBUG
    scripts/config --disable CONFIG_BTRFS_FS_REF_VERIFY
    scripts/config --disable CONFIG_BTRFS_ASSERT
    scripts/config --disable CONFIG_BTRFS_FS_RUN_SANITY_TESTS
    scripts/config --disable CONFIG_BTRFS_FS_CHECK_INTEGRITY
    scripts/config --disable CONFIG_EXT4_DEBUG
    scripts/config --disable CONFIG_EXT4_KUNIT_TESTS
    scripts/config --disable CONFIG_SECURITY_APPARMOR_DEBUG
    scripts/config --disable CONFIG_SECURITY_APPARMOR_DEBUG_ASSERTS
    scripts/config --disable CONFIG_SECURITY_APPARMOR_DEBUG_MESSAGES
    scripts/config --disable CONFIG_SECURITY_APPARMOR_KUNIT_TEST
    scripts/config --disable CONFIG_POWER_SUPPLY_DEBUG
    scripts/config --disable CONFIG_NTFS_DEBUG
    scripts/config --disable CONFIG_GENERIC_IRQ_DEBUGFS
    scripts/config --disable CONFIG_CIFS_STATS2
    scripts/config --disable CONFIG_CIFS_DEBUG
    scripts/config --disable CONFIG_CIFS_DEBUG2
    scripts/config --disable CONFIG_CIFS_DEBUG_DUMP_KEYS
    scripts/config --disable CONFIG_JBD2_DEBUG
    scripts/config --disable CONFIG_CONFIG_NFS_DEBUG
    scripts/config --disable CONFIG_TRACE_IRQFLAGS_SUPPORT
    scripts/config --disable CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT
    scripts/config --disable CONFIG_EARLY_PRINTK_USB
    scripts/config --disable CONFIG_X86_VERBOSE_BOOTUP
    scripts/config --disable CONFIG_EARLY_PRINTK
    scripts/config --disable CONFIG_EARLY_PRINTK_DBGP
    scripts/config --disable CONFIG_EARLY_PRINTK_USB_XDBC
    scripts/config --disable CONFIG_EFI_PGT_DUMP
    scripts/config --disable CONFIG_DEBUG_TLBFLUSH
    scripts/config --disable CONFIG_IOMMU_DEBUG
    scripts/config --disable CONFIG_IOMMU_LEAK
    scripts/config --disable CONFIG_HAVE_MMIOTRACE_SUPPORT
    scripts/config --disable CONFIG_X86_DECODER_SELFTEST
    scripts/config --disable CONFIG_IO_DELAY_0X80
    scripts/config --disable CONFIG_IO_DELAY_0XED
    scripts/config --disable CONFIG_IO_DELAY_UDELAY
    scripts/config --disable CONFIG_IO_DELAY_NONE
    scripts/config --disable CONFIG_DEBUG_BOOT_PARAMS
    scripts/config --disable CONFIG_CPA_DEBUG
    scripts/config --disable CONFIG_DEBUG_ENTRY
    scripts/config --disable CONFIG_DEBUG_NMI_SELFTEST
    scripts/config --disable CONFIG_DEBUG_IMR_SELFTEST
    scripts/config --disable CONFIG_X86_DEBUG_FPU
    scripts/config --disable CONFIG_PUNIT_ATOM_DEBUG
    scripts/config --disable CONFIG_UNWINDER_ORC
    scripts/config --disable CONFIG_UNWINDER_FRAME_POINTER
    scripts/config --disable CONFIG_UNWINDER_GUESS
    scripts/config --disable CONFIG_FRAME_POINTER
    scripts/config --disable CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
    scripts/config --disable CONFIG_THINKPAD_ACPI_DEBUG
    scripts/config --disable CONFIG_THINKPAD_ACPI_UNSAFE_LEDS
    scripts/config --disable CONFIG_CMA_DEBUG
    scripts/config --disable CONFIG_CMA_DEBUGFS
    scripts/config --disable CONFIG_EDAC_DEBUG
    scripts/config --disable CONFIG_ATM_IA_DEBUG
    scripts/config --disable CONFIG_ATM_FORE200E_DEBUG
    scripts/config --disable CONFIG_BCMA_DEBUG
  fi

  sleep 2s

  plain ""
  plain "#########################################"
  plain "Enable/disable CONFIG_SCHED_AUTOGROUP_DEFAULT_ENABLED"
  plain ""
  plain "If set, automatic process group scheduling will be enabled per"
  plain "default but can be disabled through passing autogroup=0 on the"
  plain "kernel commandline during boot or a value of 0 via the file"
  plain "proc/sys/kernel/sched_autogroup_enabled."
  plain ""
  read -rp "`echo $' > 1.Enable\n > 2.Disable\n > Default (Disable)\nchoice[1-2]: '`" _autogroup
  if [[ "$_autogroup" = "1" ]]; then
    msg2 "Enable CONFIG_SCHED_AUTOGROUP_DEFAULT_ENABLED"
    scripts/config --enable CONFIG_SCHED_AUTOGROUP_DEFAULT_ENABLED
  elif [[ "$_autogroup" = "2" ]]; then
    msg2 "Disable CONFIG_SCHED_AUTOGROUP_DEFAULT_ENABLED"
    scripts/config --disable CONFIG_SCHED_AUTOGROUP_DEFAULT_ENABLED
  else
    msg2 "Enable CONFIG_SCHED_AUTOGROUP_DEFAULT_ENABLED"
    scripts/config --disable CONFIG_SCHED_AUTOGROUP_DEFAULT_ENABLED
  fi

  sleep 2s

  plain ""
  plain "#########################################"
  plain "Enable CONFIG_ZENIFY a selection of patches from Zen/Liquorix kernel"
  plain "and additional tweaks for a better gaming experience (ZENIFY)"
  plain ""
  plain "Tunes the kernel for responsiveness at the cost of throughput and power usage."
  #plain ""
  #plain "	  --- Virtual Memory Subsystem ---------------------------"
  #plain ""
  #plain "	    Mem dirty before bg writeback..:  10 %  ->  20 %"
  #plain "	    Mem dirty before sync writeback:  20 %  ->  50 %"
  #plain ""
  #plain "	  --- Block Layer ----------------------------------------"
  #plain ""
  #plain "	    Queue depth...............:      128    -> 512"
  #plain "	    Default MQ scheduler......: mq-deadline -> bfq"
  #plain ""
  #plain "	  --- CFS CPU Scheduler ----------------------------------"
  #plain ""
  #plain "	    Scheduling latency.............:   6    ->   3    ms"
  #plain "	    Minimal granularity............:   0.75 ->   0.3  ms"
  #plain "	    Wakeup granularity.............:   1    ->   0.5  ms"
  #plain "	    CPU migration cost.............:   0.5  ->   0.25 ms"
  #plain "	    Bandwidth slice size...........:   5    ->   3    ms"
  #plain "	    Ondemand fine upscaling limit..:  95 %  ->  85 %"
  #plain ""
  #plain "	  --- MuQSS CPU Scheduler --------------------------------"
  #plain ""
  #plain "     Scheduling interval............:   6    ->   3    ms"
  #plain "	    ISO task max realtime use......:  70 %  ->  25 %"
  #plain "	    Ondemand coarse upscaling limit:  80 %  ->  45 %"
  #plain "	    Ondemand fine upscaling limit..:  95 %  ->  45 %"
  #plain ""
  read -rp "`echo $' > 1.Yes\n > 2.No\n > Default (Yes)\nchoice[1-2]: '`" _zenify
  if [[ "$_zenify" = "1" ]]; then
    msg2 "Enable CONFIG_ZENIFY"
    scripts/config --enable CONFIG_ZENIFY
  elif [[ "$_zenify" = "2" ]]; then
    msg2 "Disable CONFIG_ZENIFY"
    scripts/config --disable CONFIG_ZENIFY
  else
    msg2 "Enable CONFIG_ZENIFY"
    scripts/config --enable CONFIG_ZENIFY
  fi

  sleep 2s

  plain ""
  plain "#########################################"
  plain "Enable support for fsync, an experimental replacement for esync in"
  plain "Valve Proton 4.11+"
  read -rp "`echo $' > 1.Yes\n > 2.No\n > Default (Yes)\nchoice[1-2]: '`" _fsync
  if [[ "$_fsync" = "1" ]]; then
    msg2 "Enable Fsync support"
    scripts/config --enable CONFIG_FUTEX
    scripts/config --enable CONFIG_FUTEX_PI
  elif [[ "$_fsync" = "2" ]]; then
    msg2 "Disable Fsync support"
    scripts/config --disable CONFIG_FUTEX
    scripts/config --disable CONFIG_FUTEX_PI
  else
    msg2 "Enable Fsync support"
    scripts/config --enable CONFIG_FUTEX
    scripts/config --enable CONFIG_FUTEX_PI
  fi

  sleep 2s

  plain ""
  plain "#########################################"
  plain "Enable support for futex2, an experimental replacement for esync and"
  plain "fsync in Valve Proton 5.13 experimental"
  plain "Can be enabled alongside regular fsync patchset to have a fallback option"
  plain "Enabling Futex2 will enable fsync support by default"
  plain "https://gitlab.collabora.com/tonyk/linux/-/tree/futex2-dev"
  plain "https://github.com/ValveSoftware/Proton/issues/4568"
  plain ""
  read -rp "`echo $' > 1.Yes\n > 2.No\n > Default (Yes)\nchoice[1-2]: '`" _futex2
  if [[ "$_futex2" = "1" ]]; then
    msg2 "Enable Futex2 support"
    scripts/config --enable CONFIG_FUTEX2
  elif [[ "$_futex2" = "2" ]]; then
    msg2 "Disable Futex2 support"
    scripts/config --disable CONFIG_FUTEX2
  else
    msg2 "Enable Futex2 support"
    scripts/config --enable CONFIG_FUTEX2
  fi

  sleep 2s

  plain ""
  plain "#########################################"
  plain "Enable support for winesync, an experimental replacement for esync"
  plain "https://repo.or.cz/linux/zf.git/shortlog/refs/heads/winesync"
  read -rp "`echo $' > 1.Yes\n > 2.No\n > Default (Yes)\nchoice[1-2]: '`" _wine
  if [[ "$_wine" = "1" ]]; then
    msg2 "Enable winesync support"
    scripts/config --module CONFIG_WINESYNC
  elif [[ "$_wine" = "2" ]]; then
    msg2 "Disable winesync support"
    scripts/config --disable CONFIG_WINESYNC
  else
    msg2 "Enable winesync support"
    scripts/config --module CONFIG_WINESYNC
  fi

  sleep 2s

  plain ""
  if [[ $_cpu_sched = "1" ]]; then
    msg2 "Enable MuQSS"
    scripts/config --enable CONFIG_SCHED_MC
    scripts/config --enable CONFIG_SCHED_SMT
    scripts/config --enable CONFIG_SMP
    scripts/config --enable CONFIG_SCHED_MC_PRIO
    scripts/config --enable CONFIG_SCHED_MUQSS
    msg2 "Disable CFS"
    scripts/config --disable CONFIG_FAIR_GROUP_SCHED
    scripts/config --disable CONFIG_CFS_BANDWIDTH

    plain ""
    plain "#########################################"
    plain "MuQSS configuration"
    plain ""
    plain "Set CONFIG_RQ"
    plain ""
    plain "RQ_NONE : No sharing: This is the default behaviour where the CPU"
    plain "scheduler has one runqueue per CPU, whether it is a physical or"
    plain "logical CPU (hyperthread)."
    plain ""
    plain "RQ_SMT : SMT (hyperthread) siblings : With this option enabled,"
    plain "the CPU scheduler will have one runqueue shared by SMT (hyperthread)"
    plain "siblings. As these logical cores share one physical core, sharing"
    plain "the runqueue resource can lead to decreased overhead, lower latency"
    plain "and higher throughput."
    plain ""
    plain "RQ_MC : Multicore siblings : With this option enabled, the CPU"
    plain "scheduler will have one runqueue shared by multicore siblings"
    plain "in addition to any SMT siblings. As these physical cores share"
    plain "caches, sharing the runqueue resource will lead to lower latency,"
    plain "but its effects on overhead and throughput are less predictable. As"
    plain "a general rule, 6 or fewer cores will likely benefit from this,"
    plain "while larger CPUs will only derive a latency benefit. If your"
    plain "workloads are primarily single threaded, this will possibly worsen"
    plain "throughput. If you are only concerned about latency then enable this"
    plain "regardless of how many cores you have."
    plain ""
    plain "RQ_MC_LLC : Multicore siblings (LLC) : With this option enabled, the"
    plain "CPU scheduler will behave similarly as with Multicore siblings."
    plain "This option takes LLC cache into account when scheduling tasks."
    plain "Option may benefit CPUs with multiple LLC caches, such as Ryzen and"
    plain "Xeon CPUs."
    plain ""
    plain "RQ_SMP : Symmetric Multi-Processing : With this option enabled, the"
    plain "CPU scheduler will have one runqueue shared by all physical CPUs"
    plain "unless they are on separate NUMA nodes. As physical CPUs usually do"
    plain "not share resources, sharing the runqueue will normally worsen"
    plain "throughput but improve latency. If you only care about latency"
    plain "enable this"
    plain ""
    plain "RQ_ALL : With this option enabled, the CPU scheduler will have one"
    plain "runqueue regardless of the architecture configuration, including"
    plain "across NUMA nodes. This can substantially decrease throughput in"
    plain "NUMA configurations, but light NUMA designs will not be dramatically"
    plain "affected. This option should only be chosen if latency is the"
    plain "prime concern."
    plain ""
    read -rp "`echo $' > 1.RQ_NONE\n > 2.RQ_SMT\n > 3.RQ_MC\n > 4.RQ_MC_LLC\n > 5.RQ_SMP\n > 6.RQ_ALL\n > Default (RQ_MC)\nchoice[1-6]: '`" _config_rq
    if [[ $_config_rq = "1" ]]; then
      msg2 "Set to RQ_NONE"
      scripts/config --enable CONFIG_RQ_NONE
      scripts/config --set-val CONFIG_SHARERQ 0
      msg2 "Disable CFS"
      scripts/config --disable CONFIG_FAIR_GROUP_SCHED
      scripts/config --disable CONFIG_CFS_BANDWIDTH
    elif [[ $_config_rq = "2" ]]; then
      msg2 "Set to RQ_SMT"
      scripts/config --enable CONFIG_RQ_SMT
      scripts/config --set-val CONFIG_SHARERQ 1
      msg2 "Disable CFS"
      scripts/config --disable CONFIG_FAIR_GROUP_SCHED
      scripts/config --disable CONFIG_CFS_BANDWIDTH

      sleep 2

      plain ""
      plain "#########################################"
      plain "Enable/disable CONFIG_SMT_NICE"
      plain ""
      plain "SMT nice support makes each logical CPU aware of what is running on"
      plain "its hyperthread siblings, maintaining appropriate distribution of"
      plain "CPU according to nice levels and scheduling policies at the expense"
      plain "of slightly increased overhead."
      plain "If unsure Enable"
      plain ""
      read -rp "`echo $' > 1.Disable\n > 2.Enable\n > Default (Enable)\nchoice[1-2]: '`" _smt_nice
      if [[ $_smt_nice = "1" ]]; then
        msg2 "Disable CONFIG_SMT_NICE"
        scripts/config --disable CONFIG_SMT_NICE
      elif [[ $_smt_nice = "2" ]]; then
        msg2 "Enable CONFIG_SMT_NICE"
        scripts/config --enable CONFIG_SMT_NICE
      else
        msg2 "Enable CONFIG_SMT_NICE"
        scripts/config --enable CONFIG_SMT_NICE
      fi

    elif [[ $_config_rq = "3" ]]; then
      msg2 "Set to RQ_MC"
      scripts/config --enable CONFIG_RQ_MC
      scripts/config --set-val CONFIG_SHARERQ 2
      msg2 "Disable CFS"
      scripts/config --disable CONFIG_FAIR_GROUP_SCHED
      scripts/config --disable CONFIG_CFS_BANDWIDTH
    elif [[ $_config_rq = "4" ]]; then
      msg2 "Set to RQ_MC_LLC"
      scripts/config --enable CONFIG_RQ_MC_LLC
      scripts/config --set-val CONFIG_SHARERQ 3
      msg2 "Disable CFS"
      scripts/config --disable CONFIG_FAIR_GROUP_SCHED
      scripts/config --disable CONFIG_CFS_BANDWIDTH
    elif [[ $_config_rq = "5" ]]; then
      msg2 "Set to RQ_SMP"
      scripts/config --enable CONFIG_RQ_SMP
      scripts/config --set-val CONFIG_SHARERQ 4
      msg2 "Disable CFS"
      scripts/config --disable CONFIG_FAIR_GROUP_SCHED
      scripts/config --disable CONFIG_CFS_BANDWIDTH
    elif [[ $_config_rq = "6" ]]; then
      msg2 "Set to RQ_ALL"
      scripts/config --enable CONFIG_RQ_ALL
      scripts/config --set-val CONFIG_SHARERQ 5
      msg2 "Disable CFS"
      scripts/config --disable CONFIG_FAIR_GROUP_SCHED
      scripts/config --disable CONFIG_CFS_BANDWIDTH
    else
      msg2 "Set to RQ_MC"
      scripts/config --enable CONFIG_RQ_MC
      scripts/config --set-val CONFIG_SHARERQ 2
      msg2 "Disable CFS"
      scripts/config --disable CONFIG_FAIR_GROUP_SCHED
      scripts/config --disable CONFIG_CFS_BANDWIDTH
    fi
  elif [[ $_cpu_sched = "2" ]]; then
    msg2 "Enable CONFIG_SCHED_ALT, this feature enable alternative CPU scheduler..."
    scripts/config --enable CONFIG_SCHED_ALT
    msg2 "Enable BMQ CPU scheduler..."
    scripts/config --enable CONFIG_SCHED_BMQ
    scripts/config --disable CONFIG_SCHED_PDS
    msg2 "Disable CFS"
    scripts/config --disable CONFIG_FAIR_GROUP_SCHED
    scripts/config --disable CONFIG_CFS_BANDWIDTH
  elif [[ $_cpu_sched = "3" ]]; then
    msg2 "Enable CONFIG_SCHED_ALT, this feature enable alternative CPU scheduler..."
    scripts/config --enable CONFIG_SCHED_ALT
    msg2 "Enable PDS CPU scheduler..."
    scripts/config --disable CONFIG_SCHED_BMQ
    scripts/config --enable CONFIG_SCHED_PDS
    msg2 "Disable CFS"
    scripts/config --disable CONFIG_FAIR_GROUP_SCHED
    scripts/config --disable CONFIG_CFS_BANDWIDTH
  elif [[ $_cpu_sched = "4" ]]; then
    msg2 "Enable CacULE CPU scheduler..."
    scripts/config --enable CONFIG_CACULE_SCHED
    msg2 "Disable CFS"
    scripts/config --disable CONFIG_FAIR_GROUP_SCHED
    scripts/config --disable CONFIG_CFS_BANDWIDTH

    plain ""
    plain "#########################################"
    plain "Apply suggested config by Hamad Al Marri"
    read -rp "`echo $' > 1.Yes\n > 2.No\n > Default (No)\nchoice[1-2]: '`" _suggest_cacule
    if [[ $_suggest_cacule = "1" ]]; then
      msg2 "Apply suggested config"
      msg2 "Processor type and features Cacule"
      scripts/config --disable CONFIG_RETPOLINE
      scripts/config --disable CONFIG_X86_5LEVEL
      scripts/config --disable CONFIG_KEXEC
      scripts/config --disable CONFIG_KEXEC_FILE
      scripts/config --disable CONFIG_CRASH_DUMP
      scripts/config --set-val CONFIG_NR_CPUS "12"
      scripts/config --disable CONFIG_EXPERT
      scripts/config --disable CONFIG_SCHED_AUTOGROUP
      scripts/config --disable CONFIG_CGROUP_SCHED
    elif [[ $_suggest_cacule = "2" ]]; then
      msg2 "Skip suggested config"
    else
      msg2 "Skip suggested config"
    fi
  elif [[ $_cpu_sched = "5" ]]; then
    msg2 "Enable CONFIG_SCHED_ALT, this feature enable alternative CPU scheduler..."
    scripts/config --enable CONFIG_SCHED_ALT
    msg2 "Enable UPDS CPU scheduler..."
    scripts/config --disable CONFIG_SCHED_BMQ
    scripts/config --enable CONFIG_SCHED_PDS
    msg2 "Disable CFS"
    scripts/config --disable CONFIG_FAIR_GROUP_SCHED
    scripts/config --disable CONFIG_CFS_BANDWIDTH
  elif [[ $_cpu_sched = "6" ]]; then
    msg2 "Enable CacULE CPU scheduler..."
    scripts/config --enable CONFIG_CACULE_SCHED
    msg2 "Enable CacULE-RDB CPU scheduler..."
    scripts/config --enable CONFIG_CACULE_RDB
    msg2 "Disable CFS"
    scripts/config --disable CONFIG_FAIR_GROUP_SCHED
    scripts/config --disable CONFIG_CFS_BANDWIDTH

    plain ""
    plain "#########################################"
    plain "Apply suggested config by Hamad Al Marri"
    read -rp "`echo $' > 1.Yes\n > 2.No\n > Default (No)\nchoice[1-2]: '`" _suggest_cacule
    if [[ $_suggest_cacule = "1" ]]; then
      msg2 "Apply suggested config"
      msg2 "Processor type and features Cacule"
      scripts/config --disable CONFIG_RETPOLINE
      scripts/config --disable CONFIG_X86_5LEVEL
      scripts/config --disable CONFIG_KEXEC
      scripts/config --disable CONFIG_KEXEC_FILE
      scripts/config --disable CONFIG_CRASH_DUMP
      scripts/config --set-val CONFIG_NR_CPUS "12"
      scripts/config --disable CONFIG_EXPERT
      scripts/config --disable CONFIG_SCHED_AUTOGROUP
      scripts/config --disable CONFIG_CGROUP_SCHED
    elif [[ $_suggest_cacule = "2" ]]; then
      msg2 "Skip suggested config"
    else
      msg2 "Skip suggested config"
    fi
  else
    msg2 "Enable CFS"
    scripts/config --enable CONFIG_FAIR_GROUP_SCHED
    scripts/config --enable CONFIG_CFS_BANDWIDTH
  fi

  sleep 2s
}

cpu_arch(){
  plain ""
  plain "#########################################"
  plain "Set cpu microarchitecture optimization in GCC"
  read -rp "`echo $'   > 1) M486SX : Select this for an 486-class CPU without an FPU such as AMD/Cyrix/IBM/Intel SL/SLC/SLC2/SLC3/SX/SX2 and UMC U5S.\n \
  > 2) M486 : Select this for an 486-class CPU such as AMD/Cyrix/IBM/Intel 486DX/DX2/DX4 and UMC U5D.\n \
  > 3) M586 : Select this for an 586 or 686 series processor such as the AMD K5,the Cyrix 5x86, 6x86 and 6x86MX. This choice does not assume the RDTSC (Read Time Stamp Counter) instruction.\n \
  > 4) M586TSC : Select this for a Pentium Classic processor with the RDTSC (Read Time Stamp Counter) instruction for benchmarking.\n \
  > 5) M586MMX : Select this for a Pentium with the MMX graphics/multimedia extended instructions.\n \
  > 6) M686 : Select this for Intel Pentium Pro chips.\n \
  > 7) MPENTIUMII : Select this for Intel chips based on the Pentium-II and pre-Coppermine Celeron core.\n \
  > 8) MPENTIUMIII : Select this for Intel chips based on the Pentium-III and Celeron-Coppermine core.\n \
  > 9) MPENTIUMM : Select this for Intel Pentium M (not Pentium-4 M) notebook chips.\n \
  > 10) MPENTIUM4 : Select this for Intel Pentium 4 chips.\n \
  > 11) MK6 : Select this for an AMD K6-family processor.\n \
  > 12) MK7 : Select this for an AMD Athlon K7-family processor.\n \
  > 13) MK8 : Select this for an AMD Opteron or Athlon64 Hammer-family processor.\n \
  > 14) MK8SSE3 : Select this for improved AMD Opteron or Athlon64 Hammer-family processors.\n \
  > 15) MK10 : Select this for an AMD 61xx Eight-Core Magny-Cours, Athlon X2 7x50,Phenom X3/X4/II, Athlon II X2/X3/X4, or Turion II-family processor.\n \
  > 16) MBARCELONA : Select this for AMD Family 10h Barcelona processors.\n \
  > 17) MBOBCAT : Select this for AMD Family 14h Bobcat processors.\n \
  > 18) MJAGUAR : Select this for AMD Family 16h Jaguar processors.\n \
  > 19) MBULLDOZER : Select this for AMD Family 15h Bulldozer processors.\n \
  > 20) MPILEDRIVER : Select this for AMD Family 15h Piledriver processors.\n \
  > 21) MSTEAMROLLER : Select this for AMD Family 15h Steamroller processors.\n \
  > 22) MEXCAVATOR : Select this for AMD Family 15h Excavator processors.\n \
  > 23) MZEN : Select this for AMD Family 17h Zen processors.\n \
  > 24) MZEN2 : Select this for AMD Family 17h Zen 2 processors.\n \
  > 25) MZEN3 : Select this for AMD Family 19h Zen 3 processors. - GCC 10.3 required\n \
  > 26) MCRUSOE : Select this for a Transmeta Crusoe processor.\n \
  > 27) MEFFICEON : Select this for a Transmeta Efficeon processor.\n \
  > 28) MWINCHIPC6 : Select this for an IDT Winchip C6 chip.\n \
  > 29) MWINCHIP3D : Select this for an IDT Winchip-2, 2A or 3.\n \
  > 30) MELAN : Select this for an AMD Elan processor.\n \
  > 31) MGEODEGX1 : Select this for a Geode GX1 (Cyrix MediaGX) chip.\n \
  > 32) MGEODE_LX Select this for AMD Geode GX and LX processors.\n \
  > 33) MCYRIXIII : Select this for a Cyrix III or C3 chip.\n \
  > 34) MVIAC3_2 : Select this for a VIA C3 "Nehemiah".\n \
  > 35) MVIAC7 : Select this for a VIA C7.\n \
  > 36) MPSC : Optimize for Intel Pentium 4, Pentium D and older Nocona/Dempsey Xeon CPUs with Intel 64bit which is compatible with x86-64.\n \
  > 37) MATOM : Select this for the Intel Atom platform.\n \
  > 38) MCORE2 : Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and 53xx) CPUs.\n \
  > 39) MNEHALEM : Select this for 1st Gen Core processors in the Nehalem family.\n \
  > 40) MWESTMERE : Select this for the Intel Westmere formerly Nehalem-C family.\n \
  > 41) MSILVERMONT Select this for the Intel Silvermont platform.\n \
  > 42) MGOLDMONT : Select this for the Intel Goldmont platform including Apollo Lake and Denverton.\n \
  > 43) MGOLDMONTPLUS : Select this for the Intel Goldmont Plus platform including Gemini Lake.\n \
  > 44) MSANDYBRIDGE : Select this for 2nd Gen Core processors in the Sandy Bridge family.\n \
  > 45) MIVYBRIDGE : Select this for 3rd Gen Core processors in the Ivy Bridge family.\n \
  > 46) MHASWELL : Select this for 4th Gen Core processors in the Haswell family.\n \
  > 47) MBROADWELL : Select this for 5th Gen Core processors in the Broadwell family.\n \
  > 48) MSKYLAKE : Select this for 6th Gen Core processors in the Skylake family.\n \
  > 49) MSKYLAKEX : Select this for 6th Gen Core processors in the Skylake X family.\n \
  > 50) MCANNONLAKE : Select this for 8th Gen Core processors.\n \
  > 51) MICELAKE : Select this for 10th Gen Core processors in the Ice Lake family.\n \
  > 52) MCASCADELAKE : Select this for Xeon processors in the Cascade Lake family.\n \
  > 53) MCOOPERLAKE : Select this for Xeon processors in the Cooper Lake family. - GCC 10.1 required\n \
  > 54) MTIGERLAKE : Select this for third-generation 10 nm process processors in the Tiger Lake family. - GCC 10.1 required\n \
  > 55) MSAPPHIRERAPIDS : Select this for third-generation 10 nm process processors in the Sapphire Rapids family. - GCC 11 required\n \
  > 56) MALDERLAKE : Select this for twelfth-generation processors in the Alder Lake family.- GCC 11 required\n \
  > 57) GENERIC_CPU : Generic x86-64 CPU. Run equally well on all x86-64 CPUs.\n \
  > 58) GENERIC_CPU2 : Run equally well on all x86-64 CPUs with min support of x86-64-v2. - GCC 11 required\n \
  > 59) GENERIC_CPU3 : Generic x86-64-v3 CPU with v3 instructions. Run equally well on all x86-64 CPUs with min support of x86-64-v3. - GCC 11 required\n \
  > 60) GENERIC_CPU4 : Generic x86-64 CPU with v4 instructions. Run equally well on all x86-64 CPUs with min support of x86-64-v4. - GCC 11 required\n \
  > 61) MNATIVE_INTEL : Intel-Native optimizations autodetected by GCC.\n \
  > 62) MNATIVE_AMD : AMD-Native optimizations autodetected by GCC.\n \
  > Default (57 : Gneric CPU)\nchoice[0-56]: '`" _microarchitecture

  if [[ "$_microarchitecture" = "1" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_M486
  elif [[ "$_microarchitecture" = "2" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_M486
  elif [[ "$_microarchitecture" = "3" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_M586
  elif [[ "$_microarchitecture" = "4" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_M586TSC
  elif [[ "$_microarchitecture" = "5" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_M586MMX
  elif [[ "$_microarchitecture" = "6" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_M686
  elif [[ "$_microarchitecture" = "7" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MPENTIUMII
  elif [[ "$_microarchitecture" = "8" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MPENTIUMIII
  elif [[ "$_microarchitecture" = "9" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MPENTIUMM
  elif [[ "$_microarchitecture" = "10" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MPENTIUM4
  elif [[ "$_microarchitecture" = "11" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MK6
  elif [[ "$_microarchitecture" = "12" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MK7
  elif [[ "$_microarchitecture" = "13" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MK8
  elif [[ "$_microarchitecture" = "14" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MK8SSE3
  elif [[ "$_microarchitecture" = "15" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MK10
  elif [[ "$_microarchitecture" = "16" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MBARCELONA
  elif [[ "$_microarchitecture" = "17" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MBOBCAT
  elif [[ "$_microarchitecture" = "18" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MJAGUAR
  elif [[ "$_microarchitecture" = "19" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MBULLDOZER
  elif [[ "$_microarchitecture" = "20" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MPILEDRIVER
  elif [[ "$_microarchitecture" = "21" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MSTEAMROLLER
  elif [[ "$_microarchitecture" = "22" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MEXCAVATOR
  elif [[ "$_microarchitecture" = "23" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MZEN
  elif [[ "$_microarchitecture" = "24" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MZEN2
  elif [[ "$_microarchitecture" = "25" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MZEN3
  elif [[ "$_microarchitecture" = "26" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MCRUSOE
  elif [[ "$_microarchitecture" = "27" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MEFFICEON
  elif [[ "$_microarchitecture" = "28" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MWINCHIPC6
  elif [[ "$_microarchitecture" = "29" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MWINCHIP3D
  elif [[ "$_microarchitecture" = "30" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MELAN
  elif [[ "$_microarchitecture" = "31" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MGEODEGX1
  elif [[ "$_microarchitecture" = "32" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MGEODE_LX
  elif [[ "$_microarchitecture" = "33" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MCYRIXIII
  elif [[ "$_microarchitecture" = "34" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MVIAC3_2
  elif [[ "$_microarchitecture" = "35" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MVIAC7
  elif [[ "$_microarchitecture" = "36" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MPSC
  elif [[ "$_microarchitecture" = "37" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MATOM
  elif [[ "$_microarchitecture" = "38" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MCORE2
  elif [[ "$_microarchitecture" = "39" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MNEHALEM
  elif [[ "$_microarchitecture" = "40" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MWESTMERE
  elif [[ "$_microarchitecture" = "41" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MSILVERMONT
  elif [[ "$_microarchitecture" = "42" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MGOLDMONT
  elif [[ "$_microarchitecture" = "43" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MGOLDMONTPLUS
  elif [[ "$_microarchitecture" = "44" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MSANDYBRIDGE
  elif [[ "$_microarchitecture" = "45" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MIVYBRIDGE
  elif [[ "$_microarchitecture" = "46" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MHASWELL
  elif [[ "$_microarchitecture" = "47" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MBROADWELL
  elif [[ "$_microarchitecture" = "48" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MSKYLAKE
  elif [[ "$_microarchitecture" = "49" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MSKYLAKEX
  elif [[ "$_microarchitecture" = "50" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MCANNONLAKE
  elif [[ "$_microarchitecture" = "51" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MICELAKE
  elif [[ "$_microarchitecture" = "52" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MCASCADELAKE
  elif [[ "$_microarchitecture" = "53" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MCOOPERLAKE
  elif [[ "$_microarchitecture" = "54" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MTIGERLAKE
  elif [[ "$_microarchitecture" = "55" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MSAPPHIRERAPIDS
  elif [[ "$_microarchitecture" = "56" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MALDERLAKE
  elif [[ "$_microarchitecture" = "57" ]]; then
    scripts/config --enable CONFIG_GENERIC_CPU
  elif [[ "$_microarchitecture" = "58" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_GENERIC_CPU2
  elif [[ "$_microarchitecture" = "59" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_GENERIC_CPU3
  elif [[ "$_microarchitecture" = "60" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_GENERIC_CPU4
  elif [[ "$_microarchitecture" = "61" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MNATIVE_INTEL
  elif [[ "$_microarchitecture" = "62" ]]; then
    scripts/config --disable CONFIG_GENERIC_CPU
    scripts/config --enable CONFIG_MNATIVE_AMD
  else
    scripts/config --enable CONFIG_GENERIC_CPU
  fi

  plain ""

  sleep 2
}