File: Kernel-Build-HOWTO.html

package info (click to toggle)
et131x 1.2.3-2-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 5,440 kB
  • ctags: 2,577
  • sloc: ansic: 11,515; makefile: 146
file content (3523 lines) | stat: -rwxr-xr-x 79,731 bytes parent folder | download
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
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" >
<head>
  <title>Digital Hermit - Kernel-Build-HOWTO</title>
  <base href="http://www.digitalhermit.com/" />
  <link rel="stylesheet" type="text/css" href="css/phpnav.css" />
  <link rel="shortcut icon" href="favicon.ico" />
 <script type=text/javascript
   src="http://www.digitalhermit.com/cgi-bin/reblogger/reblogger.pl?command=load&user=kwan">
 </script>

  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="description" 
        content="Use PHP to create a hierarchical menu which expands the current selection." />
  <meta name="keywords" content="Create a Hierarchical Navigation Menu, 
        PHP, navigation, menu, expandable, expanding, website navigation" />
</head>

<!-- don't we all just wish IE && Netscape 4.x to /dev/null -->
<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">

<br />
<table align="center" cellspacing="0" cellpadding="3" width="90%" border="0">
<tr>
	<td class="endbar">
	<span class="larger">Digital Hermit</span>
	&nbsp;--&nbsp;Unix&nbsp;and&nbsp;Linux&nbsp;Solutions&nbsp;
	</td>
  	<td class="endbar" align="right">
		<a href="about/index.html">About</a>
		&nbsp;&nbsp;
		<a href ="linux/index.html">Linux</a>
		&nbsp;&nbsp;
		<a href ="math/index.html">Mathematics</a>
		&nbsp;&nbsp;
		<a href ="science/index.html">Science</a>
		&nbsp;&nbsp;
		<a href ="film/index.html">The Project</a>
		&nbsp;&nbsp;
	</td>
</tr>
<tr><td colspan="2" class="smaller">&nbsp;</td></tr>
<tr valign="top">
  <td colspan="2" class="main">
  <table align="center" width="100%" border="0">
    <tr valign="top">
  <td class="nav">
<pre><font size=-1>
</font></pre>
  <table border="0" width="100%">
    <tr><td width="16"><img src="images/dir_open.gif" width="16" height="16" border="0"></td><td colspan="2"><a href="index.html">Home</a></td></tr>
    <tr><td width="16"><img src="images/dir_closed.gif" width="16" height="16" border="0"></td><td colspan="2"><a href="about/">About</a></td></tr>
    <tr><td width="16"><img src="images/dir_closed.gif" width="16" height="16" border="0"></td><td colspan="2"><a href="film/">Film</a></td></tr>
    <tr><td width="16"><img src="images/dir_open.gif" width="16" height="16" border="0"></td><td colspan="2"><a href="linux/">Linux</a></td></tr>
    <tr><td>&nbsp;</td><td width="12"><img src="images/file_sel.gif" width="12" height="16" border="0"></td><td colspan="1">Kernel&nbsp;Rebuild</td></tr>
    <tr><td>&nbsp;</td><td width="12"><img src="images/file.gif" width="12" height="16" border="0"></td><td colspan="1"><a href="linux/donate.html">Donate</a></td></tr>
    <tr><td>&nbsp;</td><td width="12"><img src="images/file.gif" width="12" height="16" border="0"></td><td colspan="1"><a href="linux/dsl_reboot.html">DSL Reboot</a></td></tr>
    <tr><td>&nbsp;</td><td width="12"><img src="images/file.gif" width="12" height="16" border="0"></td><td colspan="1"><a href="linux/dualboot.html">Dual Boot</a></td></tr>
    <tr><td>&nbsp;</td><td width="12"><img src="images/file.gif" width="12" height="16" border="0"></td><td colspan="1"><a href="linux/hiresconsole.html">Framebuffer</a></td></tr>
    <tr><td>&nbsp;</td><td width="12"><img src="images/file.gif" width="12" height="16" border="0"></td><td colspan="1"><a href="linux/kernel.html">kernel.html</a></td></tr>
    <tr><td>&nbsp;</td><td width="12"><img src="images/file.gif" width="12" height="16" border="0"></td><td colspan="1"><a href="linux/questions.html">Questions</a></td></tr>
    <tr><td>&nbsp;</td><td width="12"><img src="images/file.gif" width="12" height="16" border="0"></td><td colspan="1"><a href="linux/sbnna.html">SBNNA</a></td></tr>
    <tr><td>&nbsp;</td><td width="16"><img src="images/dir_closed.gif" width="16" height="16" border="0"></td><td colspan="1"><a href="linux/gimp/">Gimp</a></td></tr>
    <tr><td>&nbsp;</td><td width="16"><img src="images/dir_closed.gif" width="16" height="16" border="0"></td><td colspan="1"><a href="linux/lvm/">LVM</a></td></tr>
    <tr><td>&nbsp;</td><td width="16"><img src="images/dir_closed.gif" width="16" height="16" border="0"></td><td colspan="1"><a href="linux/packet_analysis/">Packet Analysis</a></td></tr>
    <tr><td>&nbsp;</td><td width="16"><img src="images/dir_closed.gif" width="16" height="16" border="0"></td><td colspan="1"><a href="linux/printing/">Printing</a></td></tr>
    <tr><td>&nbsp;</td><td width="16"><img src="images/dir_closed.gif" width="16" height="16" border="0"></td><td colspan="1"><a href="linux/ray_tracing/">Ray Tracing</a></td></tr>
    <tr><td>&nbsp;</td><td width="16"><img src="images/dir_closed.gif" width="16" height="16" border="0"></td><td colspan="1"><a href="linux/redhat_install/">Installation</a></td></tr>
    <tr><td>&nbsp;</td><td width="16"><img src="images/dir_closed.gif" width="16" height="16" border="0"></td><td colspan="1"><a href="linux/rpm/">RPM</a></td></tr>
    <tr><td>&nbsp;</td><td width="16"><img src="images/dir_closed.gif" width="16" height="16" border="0"></td><td colspan="1"><a href="linux/science/">Linux&nbsp;in&nbsp;Science</a></td></tr>
    <tr><td>&nbsp;</td><td width="16"><img src="images/dir_closed.gif" width="16" height="16" border="0"></td><td colspan="1"><a href="linux/scripts/">Scripts</a></td></tr>
    <tr><td>&nbsp;</td><td width="16"><img src="images/dir_closed.gif" width="16" height="16" border="0"></td><td colspan="1"><a href="linux/trouble_shooting/">Troubleshooting</a></td></tr>
    <tr><td width="16"><img src="images/dir_closed.gif" width="16" height="16" border="0"></td><td colspan="2"><a href="math/">Mathematics</a></td></tr>
    <tr><td width="16"><img src="images/dir_closed.gif" width="16" height="16" border="0"></td><td colspan="2"><a href="science/">Science</a></td></tr>
  </table>
  </td>
      <td><div class="contents">


<BODY CLASS="BOOK" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" >
	<DIV CLASS="BOOK">
		<A NAME="AEN1" ></A>
		<DIV CLASS="TITLEPAGE">
			<H1 CLASS="TITLE"><A NAME="AEN2"></A>Kernel Rebuild Guide</H1 >
			<H3 CLASS="AUTHOR" ><A NAME="AEN6" ></A >Kwan Lowe</H3>
			<DIV CLASS="AFFILIATION">
				<SPAN CLASS="ORGNAME">Digital Hermit<BR></SPAN>
				<DIV CLASS="ADDRESS"><P CLASS="ADDRESS" >kwan@digitalhermit.com</P >
			</DIV>
		</DIV>
		<HR>
	</DIV >
	
	<HR><H1
><A
NAME="DEDICATION"
></A
>Dedication</H1
><P
>To penguin lovers everywhere...</P
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#INTRO"
>Introduction</A
></DT
><DD
><DL
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#COPYRIGHT"
>Copyright and License</A
></DT
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#WHY-REBUILD"
>Why Rebuild?</A
></DT
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#SECTION-INTRO"
>What is the kernel?</A
></DT
></DL
></DD
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#PREPARATION"
>Preparation</A
></DT
><DD
><DL
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#HARDWARE-REQUIREMENTS"
>Hardware Requirements</A
></DT
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#SOFTWARE-REQUIREMENTS"
>Software Requirements</A
></DT
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#DETERMINE-HARDWARE"
>Determine Current Hardware</A
></DT
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#DOWNLOAD"
>Acquiring the Sources</A
></DT
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#DOWNLOAD-SOURCE"
>Download the Source</A
></DT
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#EXTRACT-PATCH"
>Extract and Patch</A
></DT
></DL
></DD
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#CONFIGURATION"
>Configuration</A
></DT
><DD
><DL
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#CONFIGURATION-INTRO"
>The Configuration Process</A
></DT
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#MODULE-OR-STATIC"
>Compile Modules or Static</A
></DT
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#CHANGE-PATCHLEVEL"
>Assign Unique Name</A
></DT
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#BACKUP-CONFIG"
>Backup <TT
CLASS="FILENAME"
>.config</TT
></A
></DT
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#CONFIGURATION-2-4"
>Configuring the 2.4.x kernels</A
></DT
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#CONFIGURATION-2-6"
>Configuring the 2.6.x kernels</A
></DT
></DL
></DD
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#BUILDING"
>Build</A
></DT
><DD
><DL
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#MAKE-DEP-CLEAN"
>Dependencies</A
></DT
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#MAKE-IMAGE"
>Build the Kernel</A
></DT
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#MAKE-MODULES"
>Build the Modules</A
></DT
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#MKINITRD"
>Create Initial RAMDisk</A
></DT
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#TROUBLESHOOTING"
>Troubleshooting Build Failures</A
></DT
></DL
></DD
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#AEN536"
>Installation</A
></DT
><DD
><DL
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#INSTALLATION"
>Copy the Kernel and System.map</A
></DT
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#GRUB-CONFIGURATION"
>GrUB Configuration</A
></DT
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#LILO-CONFIGURATION"
>LiLO Configuration</A
></DT
></DL
></DD
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#AEN585"
>Bibliography</A
></DT
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#RESOURCES"
>Resources</A
></DT
><DD
><DL
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#INTERNET-RESOURCES"
>Online Resources</A
></DT
></DL
></DD
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#ABOUT"
>Feedback</A
></DT
><DD
><DL
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#ABOUT-FEEDBACK"
>Comments and corrections</A
></DT
></DL
></DD
><DT
><A
HREF="/linux/Kernel-Build-HOWTO.html#COLOPHON"
>Colophon</A
></DT
></DL
></DIV
><DIV
CLASS="CHAPTER"
><HR><H1
><A
NAME="INTRO"
></A
>Introduction</H1
><DIV
CLASS="SECTION"
><H1
CLASS="SECTION"
><A
NAME="COPYRIGHT"
></A
>Copyright and License</H1
><P
>		This document, <I
CLASS="EMPHASIS"
>Kernel Build HOWTO</I
>, is copyrighted
		(c) 2004 by <I
CLASS="EMPHASIS"
>Kwan L. Lowe</I
>.	Permission is granted
		to copy, distribute and/or modify this document under the terms of
		the GNU Free Documentation License, Version 1.2 or any later version
		published by the Free Software Foundation; with no Invariant Sections,
		with no Front-Cover Texts, and with no Back-Cover Texts.  A copy of
		the license is available at 
		<A
HREF="http://www.gnu.org/copyleft/fdl.html"
TARGET="_top"
>			http://www.gnu.org/copyleft/fdl.html
		</A
>.
	</P
><P
>		Linux is a registered trademark of Linus Torvalds.
	</P
></DIV
><DIV
CLASS="SECTION"
><HR><H1
CLASS="SECTION"
><A
NAME="WHY-REBUILD"
></A
>Why Rebuild?</H1
><P
>			Why rebuild the kernel? The main reason was once to optimize the
			kernel to your environment (hardware and usage patterns). With
			modern hardware there is rarely a need to recompile unless there
			is a particular feature of a new kernel that you must have. The
			performance gains are probably not noticeable unless specific
			benchmarks are being run. 
		</P
><P
>			This said, the newest Linux kernel (2.6.5 as of this writing)
			has noticeable improvements for the typical desktop user as a result
			of the improved scheduling system in the new kernel. Even for older
			kernels, rebuilding is often necessary for low memory situations,
			esoteric hardware, and in cases where every ounce of performance must
			be extracted.
		</P
><P
>			This guide covers the steps necessary to build both the 2.4.x and 2.6.x
			series of kernels. Because the process is quite different from one version
			to the next, the two kernel versions are described in separate chapters. 
		</P
></DIV
><DIV
CLASS="SECTION"
><HR><H1
CLASS="SECTION"
><A
NAME="SECTION-INTRO"
></A
>What is the kernel?</H1
><P
>			The Linux kernel is often likened to the conductor in an orchestra. Among 
			other things, it makes sure that all other processes in the system work
			together coherently. Though it is only a small part of the operating system,
			the kernel has the most important job of keeping everything else synchronized.
		</P
></DIV
></DIV
><DIV
CLASS="CHAPTER"
><HR><H1
><A
NAME="PREPARATION"
></A
>Preparation</H1
><DIV
CLASS="SECTION"
><H1
CLASS="SECTION"
><A
NAME="HARDWARE-REQUIREMENTS"
></A
>Hardware Requirements</H1
><P
>			Hardware requirements can differ greatly between kernel versions, and indeed,
			within versions depending upon the configuration. Though the Linux 2.4.x kernel
			can boot with as little as 8M of RAM, a more realistic number is about 64M. 
			As of this writing, the published minimum hardware required for the typical distribution
			is about 128M RAM, 2G of hard drive space, and 200MhZ Pentium or equivalent CPU.
			To actually build the kernel, however, requires a little extra hardware. The 
			kernel sources themselves will occupy anywhere from 40M to 80M of filesystem space. 
			To build them requires a minimum of 400M of drive space for all the interim files.
			The actual kernel and included modules will require anywhere from 4M for an almost 
			useless, bare minimum kernel to about 40M fully loaded.
			<A
NAME="AEN49"
HREF="/linux/Kernel-Build-HOWTO.html#FTN.AEN49"
>[1]</A
>
			Luckily, the kernel does not need to be built on the same machine on which it
			will be deployed. This means that you can compile and package your kernel on 
			a more robust machine and then install on the minimal system.
		</P
></DIV
><DIV
CLASS="SECTION"
><HR><H1
CLASS="SECTION"
><A
NAME="SOFTWARE-REQUIREMENTS"
></A
>Software Requirements</H1
><P
>			The minimum software versions for a kernel build are found in the 
			<TT
CLASS="FILENAME"
>./Documentation/Changes</TT
>
			file of the installed sources. They are as follows:

		2.4.x series
		<TABLE
BORDER="0"
BGCOLOR="/linux/Kernel-Build-HOWTO.html#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>		o  Gnu C                  2.91.66     # gcc --version
		o  Gnu make               3.77        # make --version
		o  binutils               2.9.1.0.25  # ld -v
		o  util-linux             2.10o       # fdformat --version
		o  modutils               2.4.2       # insmod -V
		o  e2fsprogs              1.19        # tune2fs
		o  reiserfsprogs          3.x.0b      # reiserfsck 2&#62;&#38;1|grep reiserfsprogs
		o  pcmcia-cs              3.1.21      # cardmgr -V
		o  PPP                    2.4.0       # pppd --version
		o  isdn4k-utils           3.1pre1     # isdnctrl 2&#62;&#38;1|grep version

		</PRE
></TD
></TR
></TABLE
>

		2.6.x series
		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>		o  Gnu C                  2.95.3       # gcc --version
		o  Gnu make               3.78         # make --version
		o  binutils               2.12         # ld -v
		o  util-linux             2.10o        # fdformat --version
		o  module-init-tools      0.9.10       # depmod -V
		o  e2fsprogs              1.29         # tune2fs 
		o  jfsutils               1.1.3        # fsck.jfs -V
		o  reiserfsprogs          3.6.3        # reiserfsck -V 2&#62;&#38;1|grep reiserfsprogs
		o  xfsprogs               2.1.0        # xfs_db -V
		o  pcmcia-cs              3.1.21       # cardmgr -V
		o  quota-tools            3.09         # quota -V
		o  PPP                    2.4.0        # pppd --version
		o  isdn4k-utils           3.1pre1      # isdnctrl 2&#62;&#38;1|grep version
		o  nfs-utils              1.0.5        # showmount --version
		o  procps                 3.1.13       # ps --version
		o  oprofile               0.5.3        # oprofiled --version
		</PRE
></TD
></TR
></TABLE
>
		
		A common sticking point on distributions transitioning between
		2.4.x and 2.6.x kernels is the <TT
CLASS="FILENAME"
>module-init-tools</TT
>
		package which must be updated to work with the 2.6.x kernel. Also,
		be aware that the underlying version of glibc, the GNU libc
		package, is implied. If you are upgrading from particularly old
		distributions then you will likely need to upgrade glibc itself.

		<A
NAME="AEN58"
HREF="/linux/Kernel-Build-HOWTO.html#FTN.AEN58"
>[2]</A
>
		
		</P
></DIV
><DIV
CLASS="SECTION"
><HR><H1
CLASS="SECTION"
><A
NAME="DETERMINE-HARDWARE"
></A
>Determine Current Hardware</H1
><P
>			Once you have determined that your hardware and software meet the minimum
			requirements for the kernel build, we will need to collect more detailed 
			information about the system. This is needed during the configuration process
			when we decide which hardware will be supported under our new kernel. Among
			the information we will gather include: Processor, Drive type and Controller 
			(SCSI, IDE), Ethernet devices, Graphics and Sound Cards, USB HUB.
		</P
><P
>			We start by running the <TT
CLASS="FILENAME"
>/sbin/lspci</TT
> utility to print
			information about our hardware:

		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>/sbin/lspci</B
>
		</PRE
></TD
></TR
></TABLE
>

		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>		00:00.0 Host bridge: Silicon Integrated Systems [SiS] 735 Host (rev 01)
		00:01.0 PCI bridge: Silicon Integrated Systems [SiS] 5591/5592 AGP
		00:02.0 ISA bridge: Silicon Integrated Systems [SiS] 85C503/5513
		00:02.2 USB Controller: Silicon Integrated Systems [SiS] 7001 (rev 07)
		00:02.3 USB Controller: Silicon Integrated Systems [SiS] 7001 (rev 07)
		00:02.5 IDE interface: Silicon Integrated Systems [SiS] 5513 [IDE] (rev d0)
		00:02.7 Multimedia audio controller: SiS7012 PCI Audio Accelerator (rev a0)
		00:03.0 Ethernet controller: [SiS] SiS900 10/100 Ethernet (rev 90)
		01:00.0 VGA compatible controller: ATI Technologies Inc Rage 128 RF/SG AGP
		</PRE
></TD
></TR
></TABLE
>

		Next, we must determine our processor type if not known. Some Linux systems 
		contain a <TT
CLASS="FILENAME"
>/proc</TT
> filesystem that allows a user to view 
		raw information about the system. If <TT
CLASS="FILENAME"
>/proc</TT
> exists you
		can issue the following command to get CPU information:

		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>cat /proc/cpuinfo</B
>
		</PRE
></TD
></TR
></TABLE
>
		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>&#13;		processor       : 0
		vendor_id       : AuthenticAMD
		cpu family      : 6
		model           : 6
		model name      : AMD Athlon(tm) XP 1800+
		stepping        : 2
		cpu MHz         : 1526.870
		cache size      : 256 KB
		fdiv_bug        : no
		hlt_bug         : no
		f00f_bug        : no
		coma_bug        : no
		fpu             : yes
		fpu_exception   : yes
		cpuid level     : 1
		wp              : yes
		flags           : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge 
		bogomips        : 3047.42
		</PRE
></TD
></TR
></TABLE
>
		</P
></DIV
><DIV
CLASS="SECTION"
><HR><H1
CLASS="SECTION"
><A
NAME="DOWNLOAD"
></A
>Acquiring the Sources</H1
><P
>		There are many ways to acquire the Linux kernel sources. If you are using a
		packaged distribution then most likely the distributor will bundle a kernel
		source package. These are installable via the package installation method,
		whether RPM, apt, YAST, portage, etc.. If you decide to go this route, please 
		consult your distribution's documentation for specifics. 
		</P
><P
>		The other option is to use the <SPAN
CLASS="QUOTE"
>"pristine"</SPAN
> sources, either the
		<SPAN
CLASS="QUOTE"
>"official"</SPAN
> sources from Linus Torvalds himself, or one of the
		regularly maintained trees from people such as Alan Cox, Robert Love, Andrew Morton, et al..
		These sources are often on the bleeding-edge of kernel development, full of
		new features and untested code. 
		</P
><P
>		Untested code? This is a feature of the distributed development model of Linux
		and Open Source (??) in general. The traditional model of a software release is
		somewhat antithetical to this model, as new code must be released to allow 
		all developers to test and improve the code. However, because Linux is used in 
		production environments throughout world it is necessary to separate the unstable
		development tree from the tested, stable tree. This is done through the version
		number of the kernel. There are three main numbers associated with the kernel --
		the Major, Minor, and PatchLevel fields. The Major number rarely changes, and
		then only when/if the entire architecture is revamped. The Minor number changes
		more frequently, perhaps once every couple years. Kernels with an odd Minor number 
		are considered unstable, testing branches. Kernels with an even Minor number are 
		generally rock solid. The PatchLevel is updated frequently, sometimes more than 
		once a week in extreme cases. 
		</P
><P
>		To recap, you can build either from your distribution's modified kernel
		sources or from the stable or unstable branch of the offical sources. If you
		are making minor modifications to the configuration, it is perhaps safest to
		install your distributor's version. These kernels usually include stability
		and feature patches that may be missing from the stock kernels. For example,
		some distributors will include low-latency or security patches and do the
		more difficult work of integrating these into their system. The downside
		is that the distributors tend to lag behind the bleeding-edge kernels. If
		you would like to test features that are available in the newest tree then
		you will likely need to build from the "pristine" source from Linus or the 
		tree maintainer of your choice..

		FIXME: NO LONGER really true -- 2.6 based distributions are out there / will
		be (e.g., SuSE 9.1) by the end of April 2004.
		</P
></DIV
><DIV
CLASS="SECTION"
><HR><H1
CLASS="SECTION"
><A
NAME="DOWNLOAD-SOURCE"
></A
>Download the Source</H1
><P
>		Though the latest sources are always available from <A
HREF="http://kernel.org"
TARGET="_top"
>		<I
CLASS="CITETITLE"
>http://kernel.org</I
></A
>, to be kind to the Internet, always 
		use one of the mirrors listed at <A
HREF="http://kernel.org/mirrors"
TARGET="_top"
>		<I
CLASS="CITETITLE"
>http://kernel.org/mirrors</I
></A
>. In general, geographically
		close mirrors will tend to be fastest. You can either browse the sites with an
		Internet browser or with a dedicated FTP client.
		</P
><P
>		You will see several links to <TT
CLASS="FILENAME"
>/pub/linux</TT
> on
		the mirror site. Select the <TT
CLASS="FILENAME"
>kernel</TT
> directory,
		then the kernel version that you would like to install. As of
		this writing, 2.4.22 is the latest stable version and 2.6.0 is in
		pre-release state. Once you select a kernel version you will see
		several files.

		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>		ChangeLog-2.6.0-test9          25-Oct-2003 14:51    41k  
		LATEST-IS-2.6.0-test9          25-Oct-2003 14:51     0k  
		linux-2.6.0-test9.tar.bz2.sign 25-Oct-2003 15:14     1k  
		linux-2.6.0-test9.tar.gz       25-Oct-2003 15:14  39.7M  
		linux-2.6.0-test9.tar.gz.sign  25-Oct-2003 15:14     1k  
		linux-2.6.0-test9.tar.sign     25-Oct-2003 15:14     1k  
		patch-2.6.0-test9.bz2.sign     25-Oct-2003 15:14     1k  
		patch-2.6.0-test9.gz           25-Oct-2003 15:14   123k  
		patch-2.6.0-test9.gz.sign      25-Oct-2003 15:14     1k  
		patch-2.6.0-test9.sign         25-Oct-2003 15:14     1k  	
		</PRE
></TD
></TR
></TABLE
>

		The Changelog files detail the differences between versions. The
		linux- files are the compressed sources for the entire Linux kernel.
		Most sites will contain both gzip and bzip packages. The bzip
		packages tend to be about 20% smaller than the GZIP versions, so
		they are usually the best option since all modern Linux distributions contain
		BZIP utilities. 
		</P
><P
>		The patch files are a list of differences
		between versions of the kernel. If you have previously downloaded
		an earlier source package, you will only need to download the much
		smaller patch file to bring those up to date. We will discuss patch application
		in the next section. 
		</P
><P
>		There are also some <TT
CLASS="FILENAME"
>.sign</TT
> files
		that contain GPG checksum information which are useful for
		verifying that the sources you downloaded have not been corrupted or 
		maliciously modified. For more information on verifying the GPG signature,
		see 
		<A
HREF="http://www.kernel.org/signature.html"
TARGET="_top"
>		<I
CLASS="CITETITLE"
>http://www.kernel.org/signature.html</I
>
		</A
>.
		</P
><P
>		The <A
HREF="http://kernel.org"
TARGET="_top"
><I
CLASS="CITETITLE"
>http://kernel.org</I
>
		</A
> website is not the only place to retrieve patches. Many other vendors
		and individuals have developed patches to improve aspects of the kernel's
		performance, support new hardware, or introduce features that are too esoteric
		or experimental to make it to the stock kernel. For example, kernel hacker
		Robert Love had developed the <I
CLASS="EMPHASIS"
>pre-emptible</I
> kernel 
		modifications that made dramatic improvements to the responsiveness of a Linux
		system. These patches were not part of the standard 2.4.x kernel but were of
		such usefulness that they were officially adopted into the 2.6.0 series. For
		the most part these third-party patches are stable but do use your judgment when
		downloading and applying them.
		</P
></DIV
><DIV
CLASS="SECTION"
><HR><H1
CLASS="SECTION"
><A
NAME="EXTRACT-PATCH"
></A
>Extract and Patch</H1
><P
>		Once you have retrieved the kernel sources and patches, you will need to
		extract them and apply the patches. The pristine 2.4.x and 2.6.x sources can be
		built as a regular, unprivileged user and this is recommended. 
			<A
NAME="AEN109"
HREF="/linux/Kernel-Build-HOWTO.html#FTN.AEN109"
>[3]</A
>
		</P
><P
>	
		We will begin by creating a directory to hold all the source tarballs and patches,
		then proceed to extract the sources. For these examples we will assume that you 
		have previously downloaded an earlier release of the kernel and will now need to
		patch to bring it up to the current version.

		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>mkdir src</B
>
			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>cd src</B
>
		</PRE
></TD
></TR
></TABLE
>

		If your Linux sources are in BZIP compressed format (that is, end with a 
		<TT
CLASS="FILENAME"
>.bz2</TT
> extenstion, then use the following command:
		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>tar xfvj /path/to/linux-2.6.0-test7.tar.bz2</B
>
		</PRE
></TD
></TR
></TABLE
>

		Otherwise, use the options for GZIP compressed data:

		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>tar xfvz /path/to/linux-2.6.0-test7.tar.gz</B
>
		</PRE
></TD
></TR
></TABLE
>

		You should see a list of filenames scroll by as they are being extracted. Verify that
		the new kernel source directory is created:

		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>ls -l</B
>
		</PRE
></TD
></TR
></TABLE
>
		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>		total 4
		drwxr-xr-x   18 kwan   users   4096 Oct  8 15:24 linux-2.6.0-test7
		-rw-r--r--    1 kwan   users 276260 Nov 15 02:05 patch-2.6.0-test8.gz
		-rw-r--r--    1 kwan   users 126184 Nov 15 02:07 patch-2.6.0-test9.gz
		</PRE
></TD
></TR
></TABLE
>

		Next we must apply the patches in order. Patch files are created by the 
		<TT
CLASS="FILENAME"
>diff</TT
> program, and can selectively modify one or more files
		by adding, deleting, or modifying lines in the source code. Because they contain only
		the differences between files it is usually a lot faster (and better for the Internet
		in general) if you patch to the current release. (TBF unclear). Appendix TBF shows
		a typical patch file. Like the kernel sources, the patch files are also compressed. 

		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>gunzip patch-2.6.0-test8.gz</B
>
			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>gunzip patch-2.6.0-test9.gz</B
>
			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>ls -l</B
>
		</PRE
></TD
></TR
></TABLE
>
		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>		-rw-r--r--    1 kwan  users  1072806 Nov 15 02:05 patch-2.6.0-test8
		-rw-r--r--    1 kwan  users   486902 Nov 15 02:07 patch-2.6.0-test9
		</PRE
></TD
></TR
></TABLE
>

		Once the patches are uncompressed we can apply them to the kernel sources. Remember
		that it is important to apply them in order. 
		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>cd linux-2.6.0-test7</B
>
			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>patch -p1 &#60;../patch-2.6.0.test8</B
>
			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>patch -p1 &#60;../patch-2.6.0.test9</B
>
		</PRE
></TD
></TR
></TABLE
>
	
		If it is successful you will see messages similar to the following scroll by:

		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>		patching file Documentation/filesystems/jfs.txt
		patching file Documentation/filesystems/xfs.txt
		patching file Documentation/ia64/fsys.txt
		patching file Documentation/ide.txt
		patching file Documentation/x86_64/boot-options.txt
		patching file Makefile
		</PRE
></TD
></TR
></TABLE
>

		If unsuccessful you will get a warning and be prompted for a file to patch. If 
		this occurs, press <B
CLASS="KEYCAP"
>Ctrl</B
>-<B
CLASS="KEYCAP"
>C</B
>
		to break out of the patch utility and verify that you are using the correct
		patch and applying them in the correct order. 
		</P
><P
>		Once all the patches are applied you might consider backing up the directory. 
			
		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>cd ..</B
>
			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>mv linux-2.6.0-test7 linux-2.6.0-test9</B
>
			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>tar cfvj linux-2.6.0-test9.tar.bz2 linux-2.6.0-test9</B
>
		</PRE
></TD
></TR
></TABLE
>
		</P
></DIV
></DIV
><DIV
CLASS="CHAPTER"
><HR><H1
><A
NAME="CONFIGURATION"
></A
>Configuration</H1
><DIV
CLASS="SECTION"
><H1
CLASS="SECTION"
><A
NAME="CONFIGURATION-INTRO"
></A
>The Configuration Process</H1
><P
>			The configuration process is the most strenous portion of the kernel
			rebuild process. In this step you are deciding which features will be 
			included in the final kernel and it can require lots of hardware
			knowledge. In truth, it is not too onerous. The current kernels have
			graphical configuration programs and though not perfect, provide help
			screens for most of the configuration options.
		</P
><P
>			Many changes were made to the configuration subsystem in the 2.6.x kernel
			series. It is easier to add modules and much more robust than before.
			It has also changed dramatically in appearance especially when using the
			X-based configuration tool, xconfig.  For this reason the configuration 
			steps for the different branches have been split into two sections in this 
			chapter. 
		</P
><P
>			As mentioned, both configuration tools provide context sensitive help 
			screens for the different options. Because this help is readily available
			to the user (and more importantly, because there are several hundred
			options) this guide will only cover a fraction of the choices. 
		</P
></DIV
><DIV
CLASS="SECTION"
><HR><H1
CLASS="SECTION"
><A
NAME="MODULE-OR-STATIC"
></A
>Compile Modules or Static</H1
><P
>			One of the first choices you will make is whether or not to build device
			support directly into the kernel or as a module. In the early days of Linux,
			when module support was in its infancy, it was possible that static (i.e.,
			compiled in) drivers were faster. With any modern CPU, the time to load and
			unload the modules and the memory required for the module loader subsystem
			is negligible even to benchmarking utilities. Some devices, notably the disk
			controller, can be built directly into the kernel in order to simplify 
			the boot process. 

			<A
NAME="AEN170"
HREF="/linux/Kernel-Build-HOWTO.html#FTN.AEN170"
>[4]</A
>
		</P
><P
>			You may also choose to disable some options entirely. Though you will not have any
			performance increases, there are advantages to disabling features that are not
			required. For one, the compile times will be drastically reduced depending on 
			which subsystem is disabled. For another, the final kernel and installed modules
			will require less space. On modern hard drives of 40G, 60G, and even 250G, an
			extra 20M or so is negligible but is significant on embedded or older systems.
			The disadvantage is that you will not have support for those features until you
			recompile the kernel. One other thing to keep in mind, as noted in
			KERNELTRAP.ORG (http://www.kerneltrap.org/node/view/799):

		<A
NAME="AEN173"
></A
><TABLE
BORDER="0"
WIDTH="100%"
CELLSPACING="0"
CELLPADDING="0"
CLASS="BLOCKQUOTE"
><TR
><TD
WIDTH="10%"
VALIGN="TOP"
>&nbsp;</TD
><TD
WIDTH="80%"
VALIGN="TOP"
><P
CLASS="LITERALLAYOUT"
>			Having&nbsp;unnecessary&nbsp;drivers&nbsp;will&nbsp;make&nbsp;the&nbsp;kernel&nbsp;bigger,&nbsp;and&nbsp;can&nbsp;under&nbsp;some&nbsp;<br>
			circumstances&nbsp;lead&nbsp;to&nbsp;problems:&nbsp;probing&nbsp;for&nbsp;a&nbsp;nonexistent&nbsp;controller&nbsp;card&nbsp;may&nbsp;<br>
			confuse&nbsp;your&nbsp;other&nbsp;controllers.<br>
			</P
></TD
><TD
WIDTH="10%"
VALIGN="TOP"
>&nbsp;</TD
></TR
><TR
><TD
COLSPAN="2"
ALIGN="RIGHT"
VALIGN="TOP"
>--<SPAN
CLASS="ATTRIBUTION"
>kerneltrap.org</SPAN
></TD
><TD
WIDTH="10%"
>&nbsp;</TD
></TR
></TABLE
>

		</P
></DIV
><DIV
CLASS="SECTION"
><HR><H1
CLASS="SECTION"
><A
NAME="CHANGE-PATCHLEVEL"
></A
>Assign Unique Name</H1
><P
>		We have so far extracted and patched the Linux sources. During our preparation
		we also determined what hardware is installed in the system so that we will
		know which modules will need compilation. Before we proceed to actually configuring
		the kernel there are a couple minor but important details to complete. 
		</P
><P
>		Inside the Linux source directory is the default <TT
CLASS="FILENAME"
>Makefile</TT
>. This
		file is used by the <TT
CLASS="APPLICATION"
>make</TT
> utility to compile the Linux
		sources. The first few lines of the <TT
CLASS="FILENAME"
>Makefile</TT
> contains some
		versioning information:

		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>		VERSION = 2
		PATCHLEVEL = 4
		SUBLEVEL = 22
		EXTRAVERSION = -1
		</PRE
></TD
></TR
></TABLE
>

		Note that there is an additional EXTRAVERSION field. To prevent overwriting any
		existing kernel modules on the system we will change this EXTRAVERSION to something
		unique. When the final installation steps are run, kernel module files will then get
		written to 
		<TT
CLASS="FILENAME"
>/lib/modules/$VERSION.$PATCHLEVEL.$SUBLEVEL-$EXTRAVERSION.</TT
>
		</P
></DIV
><DIV
CLASS="SECTION"
><HR><H1
CLASS="SECTION"
><A
NAME="BACKUP-CONFIG"
></A
>Backup <TT
CLASS="FILENAME"
>.config</TT
></H1
><P
>		Finally, before we begin, please note that the configuration choices are kept in the
		<TT
CLASS="FILENAME"
>../linux/.config</TT
> file. If you have not already run any configurations, 
		this file will not exist. If you have, and would like to save your configuration, copy the 
		<TT
CLASS="FILENAME"
>.config</TT
> to another file:

		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>cd linux</B
>
			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>cp .config config.save</B
>
		</PRE
></TD
></TR
></TABLE
>

		If you are using the sources from a vendor, then the default configuration
		files are usually included in the <TT
CLASS="FILENAME"
>configs</TT
> or in the
		<TT
CLASS="FILENAME"
>./arch/i386/defconfig</TT
> (for i386 machines) file. You
		can use these configurations as a starting point for your customizations.
		The <TT
CLASS="FILENAME"
>.config</TT
> <I
CLASS="EMPHASIS"
>will</I
> be overwritten
		in the next step, so do make a backup before proceeding!
		</P
><P
>		We begin the configuration by wiping out all previous configurations
		and resetting the source directory to a pristine state. The main
		reason for doing this is that some files do not automatically get
		rebuilt, which can lead to failed builds, or at worst, a buggy kernel.

		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>make mrproper</B
>
		</PRE
></TD
></TR
></TABLE
>

		In the 2.4.x series, a few dozen lines of <B
CLASS="COMMAND"
>rm -f</B
> commands 
		will appear as all generated files get removed. The 2.6.x process is less noisy and
		returns only a few CLEAN messages. Please note that it is generally safe to omit 
		the <B
CLASS="COMMAND"
>make mrproper</B
> step during subsequent rebuilds. 

		</P
><P
>		As of this writing (December 15, 2003), the 2.4.x kernel is in wide deployment.
		The 2.6.0 has just been released to the world. 
		FIXME -- the previous sentence needs to be updated
		Though the configuration and
		build procedures are quite similar, there are enough differences to warrant
		separate sections for each kernel. If you are building a 2.6.x series kernel,
		skip to <A
HREF="/linux/Kernel-Build-HOWTO.html#CONFIGURATION-2-6"
>the Section called <I
>Configuring the 2.6.x kernels</I
></A
>. Otherwise, proceed to the next section,
		<A
HREF="/linux/Kernel-Build-HOWTO.html#CONFIGURATION-2-4"
>the Section called <I
>Configuring the 2.4.x kernels</I
></A
>.
		</P
></DIV
><DIV
CLASS="SECTION"
><HR><H1
CLASS="SECTION"
><A
NAME="CONFIGURATION-2-4"
></A
>Configuring the 2.4.x kernels</H1
><P
>		Our next step is to run the configuration utility. In the 2.4.x kernels there are 
		four main frontends: config, oldconfig, menuconfig, xconfig.  We choose one 
		configuration method and run it, for example:

		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>make config</B
>
		</PRE
></TD
></TR
></TABLE
>

		</P
><P
>		<B
CLASS="COMMAND"
>config</B
> is the least user-friendly option as it merely presents 
		a series of questions that must be answered sequentially. Alas, if an error is made 
		you must begin the process from the top. Pressing <B
CLASS="KEYCAP"
>Enter</B
> will accept
		the default entry, which is in upper case.
		</P
><P
>		<B
CLASS="COMMAND"
>oldconfig</B
> will read the defaults from an existing 
		<TT
CLASS="FILENAME"
>.config</TT
> and rewrite necessary links and files. Use this option
		if you've made minor changes to source files or need to script the rebuild process.
		Note that <B
CLASS="COMMAND"
>oldconfig</B
> will only work within the
		same major version of the kernel. You <I
CLASS="EMPHASIS"
>cannot</I
>,
		for example, use a 2.4.x <TT
CLASS="FILENAME"
>.config</TT
> with the
		2.6.x kernel.
		</P
><P
>		<B
CLASS="COMMAND"
>menuconfig</B
> is an <I
CLASS="EMPHASIS"
>ncurses</I
>-based frontend.
		Your system must have the <TT
CLASS="FILENAME"
>ncurses-devel</TT
> libraries installed
		in order to use this utility. As the help text at the top of the screen indicates,
		use the arrow keys to navigate the menu. Press <B
CLASS="KEYCAP"
>Enter</B
> to select
		sub-menus. Press the highlighted letter on each option to jump directly to that option.
		To build an option directly into the kernel, press <B
CLASS="KEYCAP"
>Y</B
>. To disable an
		option entirely, press <B
CLASS="KEYCAP"
>N</B
>. To build an option as a loadable module,
		press <B
CLASS="KEYCAP"
>M</B
>. You can also access content-specific help screens by 
		pressing <B
CLASS="KEYCAP"
>?</B
> on each page or selecting <B
CLASS="COMMAND"
>HELP</B
> from
		the lower menu. <A
HREF="/linux/Kernel-Build-HOWTO.html#MENUCONFIG-GRAPHIC"
>Figure 1</A
> shows an example screen.
		<A
NAME="AEN235"
HREF="#FTN.AEN235"
>[5]</A
>
				
		<DIV
CLASS="FIGURE"
><A
NAME="MENUCONFIG-GRAPHIC"
></A
><DIV
CLASS="MEDIAOBJECT"
><P
><IMG
SRC="/linux/images/menuconfig.jpg"><DIV
CLASS="CAPTION"
><P
></P
></DIV
></P
></DIV
><P
><B
>Figure 1. make menuconfig</B
></P
></DIV
>
		</P
><P
>		<B
CLASS="COMMAND"
>xconfig</B
>, as the name suggests, is an <TT
CLASS="APPLICATION"
>X Window</TT
>
		based frontend. It requires the Tcl/Tk and X libraries to work, and of course, an X server.
		<A
HREF="/linux/Kernel-Build-HOWTO.html#XCONFIG-GRAPHIC"
>Figure 2</A
> shows an example screen.
			
		<DIV
CLASS="FIGURE"
><A
NAME="XCONFIG-GRAPHIC"
></A
><DIV
CLASS="MEDIAOBJECT"
><P
><IMG
SRC="/linux/images/xconfig.jpg"><DIV
CLASS="CAPTION"
><P
></P
></DIV
></P
></DIV
><P
><B
>Figure 2. make xconfig</B
></P
></DIV
>
		</P
><P
>		For the purposes of this next section we will assume that <B
CLASS="COMMAND"
>make xconfig</B
>
		is used. The options are identical otherwise. As mentioned, there are literally hundreds
		of configuration options and this precludes us from listing every one of them. If you 
		are unsure of an option use the online help or consult the kernel documentation found
		in the <TT
CLASS="FILENAME"
>../linux/Documentation</TT
> directory. We begin by typing:

		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>make xconfig</B
>
		</PRE
></TD
></TR
></TABLE
>

		The main configuration menu will appear. Selecting an item will bring up another window
		with further options. These in turn can spawn other sub-menus. 

		<P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>Code Maturity Level Options</DT
><DD
><P
>					This option allows configuration of alpha-quality software. It is best
					to disable this option if the kernel is intended for a stable production
					system. If you require an experimental feature in the kernel, such as
					a driver for new hardware, then enable this option but be aware that 
					it <SPAN
CLASS="QUOTE"
>"may not meet the normal level of reliability"</SPAN
> as tested
					code. 
					</P
></DD
><DT
>Loadable Module Support</DT
><DD
><P
>						You will almost certainly want to enable module support. If you
						will need third-party kernel modules you will also need to
						enable <I
CLASS="EMPHASIS"
>Set Version Information on All Module Symbols</I
>.	
					 </P
></DD
><DT
>Processor Type and Features</DT
><DD
><P
>						This is perhaps the most important option to choose. In the Preparation
						section we determined our processor type by examining 
						<TT
CLASS="FILENAME"
>/proc/cpuinfo</TT
> and we use that information here to
						select the appropriate processor. Included in this submenu are features
						such as <I
CLASS="EMPHASIS"
>Low Latency Scheduling</I
> which can improve
						desktop responsiveness, <I
CLASS="EMPHASIS"
>Symmetric Multi-processing Support</I
>
						for machines with multiple CPUs, and <I
CLASS="EMPHASIS"
>High Memory Support</I
>
						for machines with more than 1G of RAM. Laptop users can also benefit from
						the <I
CLASS="EMPHASIS"
>CPU Frequency Scaling</I
> feature.
					</P
></DD
><DT
>General Setup</DT
><DD
><P
>						Choices for <SPAN
CLASS="ACRONYM"
>PCI</SPAN
>, <SPAN
CLASS="ACRONYM"
>ISA</SPAN
>,
						<SPAN
CLASS="ACRONYM"
>PCMCIA</SPAN
> and other architectural support such as 
						<I
CLASS="EMPHASIS"
>Advanced Power Management</I
> are found here.
					</P
></DD
><DT
>Memory Technology Devices</DT
><DD
><P
>						<SPAN
CLASS="ACRONYM"
>MTD</SPAN
> devices include <SPAN
CLASS="PRODUCTNAME"
>Compact Flash</SPAN
>
						devices. Some digital cameras will require this support.
						</P
></DD
><DT
>Block Devices</DT
><DD
><P
>						The Block Device section contains options for floppy and hard drives,
						including parallel port devices, tape drives and <SPAN
CLASS="ACRONYM"
>RAID</SPAN
>
						controllers. Important options include loopback device support, which
						allows mounting on disk images, and initrd support, which is needed to
						preload drivers necessary to boot the system.
					</P
></DD
><DT
>Multi-Device support (<SPAN
CLASS="ACRONYM"
>RAID</SPAN
> and <SPAN
CLASS="ACRONYM"
>LVM</SPAN
>)</DT
><DD
><P
>						Important for servers, these options include <SPAN
CLASS="ACRONYM"
>RAID</SPAN
> support
						for combining multiple disks. Note that this option is not needed for 
						certain hardware <SPAN
CLASS="ACRONYM"
>RAID</SPAN
> that function below the operating
						system level. <SPAN
CLASS="ACRONYM"
>LVM</SPAN
> is a useful subsystem that allows,
						among other things, dynamic resizing of filesystems.	
					</P
></DD
><DT
><SPAN
CLASS="ACRONYM"
>ATA/IDE/MFM/RLL</SPAN
> support.</DT
><DD
><P
>						This section includes options for <SPAN
CLASS="ACRONYM"
>IDE/ATAPI</SPAN
> chipsets,
						including performance tweaks such as <SPAN
CLASS="ACRONYM"
>DMA</SPAN
>. Most systems
						will need this support.
					</P
></DD
><DT
>Cryptography Support (CryptoAPI)</DT
><DD
><P
>						Useful options include Loopback Crypto Support, which allows encrypted
						filesystem images to be mounted. Even with full access to the PC, 
						loopback encryption can help safeguard data.
					</P
></DD
><DT
>Networking Options</DT
><DD
><P
>					 	Many choices are available for networking. <SPAN
CLASS="ACRONYM"
>TCP/IP</SPAN
>,
						<SPAN
CLASS="ACRONYM"
>IP</SPAN
> tunneling, packet filtering, <SPAN
CLASS="ACRONYM"
>IPv4</SPAN
>
						and <SPAN
CLASS="ACRONYM"
>IPv6</SPAN
>, routing support and network QoS are among
						the most useful. If your kernel is intended for a dedicated firewall or
						router device, then the options here can significantly improve performance.
						Read the online and kernel documentation.
					</P
></DD
><DT
><SPAN
CLASS="ACRONYM"
>SCSI</SPAN
> Support</DT
><DD
><P
>						<SPAN
CLASS="ACRONYM"
>SCSI</SPAN
> support is needed for not only true 
						<SPAN
CLASS="ACRONYM"
>SCSI</SPAN
> devices, but also for <SPAN
CLASS="ACRONYM"
>IDE</SPAN
>
						<SPAN
CLASS="ACRONYM"
>CDR/W</SPAN
> drives in <SPAN
CLASS="ACRONYM"
>SCSI</SPAN
> emulation
						mode. If your root filesystem is mounted on a <SPAN
CLASS="ACRONYM"
>SCSI</SPAN
>
						disk, then you must build support directly into the kernel and not as
						a module. 
					</P
></DD
><DT
>Character Devices</DT
><DD
><P
>						Dozens of options are available here, including support for many
						serial and parallel devices, hardware sensors (for system monitors),
						mice, joysticks and <SPAN
CLASS="ACRONYM"
>DRM</SPAN
>. Many of the options can
						be safely disabled without problem.
					</P
></DD
><DT
>File Systems</DT
><DD
><P
>						It is a good idea to build support for your root filesystem directly
						into the kernel. Though the <TT
CLASS="APPLICATION"
>initrd</TT
> utilities
						can get around the chicken-and-egg boot problem, it is generally safer
						and easier to just build the fs modules directly. Many options can also
						be safely disabled if you have no use for the feature.
					</P
></DD
></DL
></DIV
>
	</P
><P
>		Once all the configuration changes have been made, you can go ahead and save settings.
		By defaulti, the configuration is placed in the <TT
CLASS="FILENAME"
>.config</TT
> file
		in the topmost directory. Because this file is deleted by <B
CLASS="COMMAND"
>make mrproper</B
>
		and is also hidden, it is a good idea to use the <I
CLASS="EMPHASIS"
>Save to Alternate File</I
>
		before exiting. It will prompt for another save location. Enter something outside of the
		source tree and with a useful name such as <TT
CLASS="FILENAME"
>kernel-2.4.22-lowlatency.config</TT
>. 	
		Once this is done, exit the configuration menu. You will be prompted to save the
		configuration again. Select <B
CLASS="COMMAND"
>Yes</B
> and continue. 
	</P
><P
>		The configuration for the 2.4.x kernel is now complete. You may now skip to 
		<A
HREF="#BUILDING"
>the chapter called <I
>Build</I
></A
>.
	</P
></DIV
><DIV
CLASS="SECTION"
><HR><H1
CLASS="SECTION"
><A
NAME="CONFIGURATION-2-6"
></A
>Configuring the 2.6.x kernels</H1
><P
>		Our next step is to run the configuration utility. On the 2.6.x kernels there
		are four main frontend programs: config, menuconfig, and xconfig. 
		</P
><P
>		<B
CLASS="COMMAND"
>config</B
> is the least user-friendly option as it merely presents 
		a series of questions that must be answered sequentially. Alas, if an error is made 
		you must begin the process from the top. Pressing <B
CLASS="KEYCAP"
>Enter</B
> will accept
		the default entry which is in upper case.
		</P
><P
>		<B
CLASS="COMMAND"
>oldconfig</B
> will read the defaults from an existing 
		<TT
CLASS="FILENAME"
>.config</TT
> and rewrite necessary links and files. Use this option
		if you've made minor changes to source files or need to script the rebuild process.
		</P
><P
>		<B
CLASS="COMMAND"
>menuconfig</B
> is an <I
CLASS="EMPHASIS"
>ncurses</I
> based frontend.
		Your system must have the <TT
CLASS="FILENAME"
>ncurses-devel</TT
> libraries installed
		in order to use this utility. As the help text at the top of the screen indicates,
		use the arrow keys to navigate the menu. Press <B
CLASS="KEYCAP"
>Enter</B
> to select
		sub-menus. Press the highlighted letter on each option to jump directly to that option.
		To build an option directly into the kernel, press <B
CLASS="KEYCAP"
>Y</B
>. To disable an
		option entirely, press <B
CLASS="KEYCAP"
>N</B
>. To build an option as a loadable module,
		press <B
CLASS="KEYCAP"
>M</B
>. You can also access content-specific help screens by 
		pressing <B
CLASS="KEYCAP"
>?</B
> on each page or selecting <B
CLASS="COMMAND"
>HELP</B
> from
		the lower menu. <A
HREF="/linux/Kernel-Build-HOWTO.html#MENUCONFIG-GRAPHIC"
>Figure 1 in the Section called <I
>Configuring the 2.4.x kernels</I
></A
> shows an example screen from
		the 2.4.x kernel series.
		</P
><P
>		<B
CLASS="COMMAND"
>xconfig</B
> is a graphical frontend using <TT
CLASS="APPLICATION"
>qconf</TT
>
		by Roman Zippel. It requires the <TT
CLASS="APPLICATION"
>qt</TT
> and X libraries to 
		build and use. The interface is intuitive and customizable. Online help is automatically
		shown for each kernel configuration option. It also can show dependency information for
		each module which can help diagnose build errors. <A
HREF="/linux/Kernel-Build-HOWTO.html#XCONFIG26-GRAPHIC"
>Figure 3</A
> shows an
		example of the <B
CLASS="COMMAND"
>xconfig</B
> screen. 

		From the online help:
		<A
NAME="AEN391"
></A
><TABLE
BORDER="0"
WIDTH="100%"
CELLSPACING="0"
CELLPADDING="0"
CLASS="BLOCKQUOTE"
><TR
><TD
WIDTH="10%"
VALIGN="TOP"
>&nbsp;</TD
><TD
WIDTH="80%"
VALIGN="TOP"
><P
CLASS="LITERALLAYOUT"
>			For&nbsp;each&nbsp;option,&nbsp;a&nbsp;blank&nbsp;box&nbsp;indicates&nbsp;the&nbsp;feature&nbsp;is&nbsp;disabled,&nbsp;a&nbsp;check<br>
			indicates&nbsp;it&nbsp;is&nbsp;enabled,&nbsp;and&nbsp;a&nbsp;dot&nbsp;indicates&nbsp;that&nbsp;it&nbsp;is&nbsp;to&nbsp;be&nbsp;compiled<br>
			as&nbsp;a&nbsp;module.&nbsp;Clicking&nbsp;on&nbsp;the&nbsp;box&nbsp;will&nbsp;cycle&nbsp;through&nbsp;the&nbsp;three&nbsp;states.<br>
			If&nbsp;you&nbsp;do&nbsp;not&nbsp;see&nbsp;an&nbsp;option&nbsp;(e.g.,&nbsp;a&nbsp;device&nbsp;driver)&nbsp;that&nbsp;you&nbsp;believe<br>
			should&nbsp;be&nbsp;present,&nbsp;try&nbsp;turning&nbsp;on&nbsp;Show&nbsp;All&nbsp;Options&nbsp;under&nbsp;the&nbsp;Options&nbsp;menu.<br>
			Although&nbsp;there&nbsp;is&nbsp;no&nbsp;cross&nbsp;reference&nbsp;yet&nbsp;to&nbsp;help&nbsp;you&nbsp;figure&nbsp;out&nbsp;what&nbsp;other<br>
			options&nbsp;must&nbsp;be&nbsp;enabled&nbsp;to&nbsp;support&nbsp;the&nbsp;option&nbsp;you&nbsp;are&nbsp;interested&nbsp;in,&nbsp;you&nbsp;can<br>
			still&nbsp;view&nbsp;the&nbsp;help&nbsp;of&nbsp;a&nbsp;grayed-out&nbsp;option.<br>
			</P
></TD
><TD
WIDTH="10%"
VALIGN="TOP"
>&nbsp;</TD
></TR
><TR
><TD
COLSPAN="2"
ALIGN="RIGHT"
VALIGN="TOP"
>--<SPAN
CLASS="ATTRIBUTION"
>qconf help</SPAN
></TD
><TD
WIDTH="10%"
>&nbsp;</TD
></TR
></TABLE
>

		<DIV
CLASS="FIGURE"
><A
NAME="XCONFIG26-GRAPHIC"
></A
><DIV
CLASS="MEDIAOBJECT"
><P
><IMG
SRC="/linux/images/xconfig2_6.jpg"><DIV
CLASS="CAPTION"
><P
></P
></DIV
></P
></DIV
><P
><B
>Figure 3. make xconfig</B
></P
></DIV
>
		</P
><P
>		Once you have decided which configuration option to use, start the process with 
		<B
CLASS="COMMAND"
>make</B
> followed by either <B
CLASS="COMMAND"
>config</B
>, 
		<B
CLASS="COMMAND"
>menuconfig</B
>, or <B
CLASS="COMMAND"
>xconfig</B
>. For example:

		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>		 	<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>make menuconfig</B
>
		</PRE
></TD
></TR
></TABLE
>

		The system will take a few moments to build the configuration utility. Next you
		will be presented with the configuration menus. Though similar to the 2.4.x series,
		the 2.6.x menu is more logically organized with better grouping of sub-modules.
		Following are some of the top level configuration options in the 2.6 kernel.
		</P
><P
>		<P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>Code Maturity Level Options</DT
><DD
><P
>						This option allows configuration of alpha-quality software or obsoleted
						drivers. It is best to disable this option if the kernel is intended for 
						a stable production system. If you require an experimental feature in the 
						kernel, such as a driver for new hardware, then enable this option but be 
						aware that it <SPAN
CLASS="QUOTE"
>"may not meet the normal level of reliability"</SPAN
> 
						as more rigorously tested code. 
					</P
></DD
><DT
>General Setup</DT
><DD
><P
>						This section contains options for <B
CLASS="COMMAND"
>sysctl</B
> support,
						a feature allowing run-time configuration of the kernel. A new feature,
						kernel <TT
CLASS="FILENAME"
>.config</TT
> support, allows the complete 
						kernel configuration to be viewed during run-time. This addresses 
						many requests to be able to see what features were compiled into
						the kernel.
					</P
></DD
><DT
>Loadable Module Support</DT
><DD
><P
>						You will almost certainly want to enable module support. If you
						will need third-party kernel modules you will also need to
						enable <I
CLASS="EMPHASIS"
>Set Version Information on All Module Symbols</I
>.	
					 </P
></DD
><DT
>Processor Type and Features</DT
><DD
><P
>						This is perhaps the most important configuration choice. In the Preparation
						section we determined our processor type by examining 
						<TT
CLASS="FILENAME"
>/proc/cpuinfo</TT
> and we use that information here to
						select the appropriate processor. Included in this submenu are features
						such as <I
CLASS="EMPHASIS"
>Preemptible Kernel</I
> which can improve
						desktop responsiveness, <I
CLASS="EMPHASIS"
>Symmetric Multi-processing Support</I
>
						for machines with multiple CPUs, and <I
CLASS="EMPHASIS"
>High Memory Support</I
>
						for machines with more than 1G of RAM. 
					</P
></DD
><DT
>Power Management Options</DT
><DD
><P
>						Found here are options for <SPAN
CLASS="ACRONYM"
>ACPI</SPAN
> and <SPAN
CLASS="ACRONYM"
>CPU</SPAN
>
						Frequency Scaling which can dramatically improve laptop power usage. Read 
						the <TT
CLASS="FILENAME"
>Documentation/power</TT
> file for more information.
					</P
></DD
><DT
>Bus Options (<SPAN
CLASS="ACRONYM"
> PCI, PCMCIA, EISA, MCA, ISA</SPAN
>)</DT
><DD
><P
>						Here are found options for all system bus devices. On modern machines
						the <SPAN
CLASS="ACRONYM"
>ISA</SPAN
> and <SPAN
CLASS="ACRONYM"
>MCA</SPAN
> support can often
						be disabled. 
					</P
></DD
><DT
>Executable File Formats</DT
><DD
><P
>						Interesting features here include the kernel support for miscellaneous
						binaries, which can allow seamless operation of non-Linux binaries
						with a little userland help.
					</P
></DD
><DT
>Device Drivers</DT
><DD
><P
>						All the device-driver configuration options that were previously scattered throughout
						the 2.4.x menus are now neatly organized under this option. Features
						such as <SPAN
CLASS="ACRONYM"
>SCSI</SPAN
> support, graphic card optimizations,
						sound, <SPAN
CLASS="ACRONYM"
>USB</SPAN
> and other hardware are configured here.
					</P
></DD
><DT
>File Systems</DT
><DD
><P
>						Found here are options for filesystems which are supported by the 
						kernel, such as <SPAN
CLASS="ACRONYM"
>EXT2</SPAN
> and ReiserFS. It is best to
						build support for the root filesystems directly into the kernel rather
						than as a module. 
					</P
></DD
><DT
>Security Options</DT
><DD
><P
>						Interesting options here include support for <SPAN
CLASS="ACRONYM"
>NSA</SPAN
>
						Security Enhanced Linux and other, somewhat experimental, features
						to increase security.
					</P
></DD
></DL
></DIV
>
	</P
></DIV
></DIV
><DIV
CLASS="CHAPTER"
><HR><H1
><A
NAME="BUILDING"
></A
>Build</H1
><DIV
CLASS="SECTION"
><H1
CLASS="SECTION"
><A
NAME="MAKE-DEP-CLEAN"
></A
>Dependencies</H1
><P
>		The next step is to create the necessary include files and generate dependency information. This
		step is only required for the 2.4.x kernel tree. 
		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>			<TT
CLASS="PROMPT"
>$</TT
><B
CLASS="COMMAND"
>make dep</B
>
		</PRE
></TD
></TR
></TABLE
>

		Lots of messages will scroll by. Depending on the speed of your machine and on
		what options you chose, this may take several minutes to complete. Once the dependency 
		information is created we can clean up some miscellaneous object files. This step
		is required for all versions of the kernel.

		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>			<TT
CLASS="PROMPT"
>$</TT
><B
CLASS="COMMAND"
>make clean</B
>
		</PRE
></TD
></TR
></TABLE
>

		</P
></DIV
><DIV
CLASS="SECTION"
><HR><H1
CLASS="SECTION"
><A
NAME="MAKE-IMAGE"
></A
>Build the Kernel</H1
><P
>		We are now (finally) ready to start the actual kernel build. At the prompt type:

		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>			<TT
CLASS="PROMPT"
>$</TT
><B
CLASS="COMMAND"
>make bzImage</B
>
		</PRE
></TD
></TR
></TABLE
>

		As the Kbuild documentation states:
		<A
NAME="AEN490"
></A
><TABLE
BORDER="0"
WIDTH="100%"
CELLSPACING="0"
CELLPADDING="0"
CLASS="BLOCKQUOTE"
><TR
><TD
WIDTH="10%"
VALIGN="TOP"
>&nbsp;</TD
><TD
WIDTH="80%"
VALIGN="TOP"
><P
CLASS="LITERALLAYOUT"
>			Some&nbsp;computers&nbsp;won't&nbsp;work&nbsp;with&nbsp;'make&nbsp;bzImage',&nbsp;either&nbsp;due&nbsp;to&nbsp;hardware<br>
			problems&nbsp;or&nbsp;very&nbsp;old&nbsp;versions&nbsp;of&nbsp;lilo&nbsp;or&nbsp;loadlin.&nbsp;If&nbsp;your&nbsp;kernel&nbsp;image<br>
			is&nbsp;small,&nbsp;you&nbsp;may&nbsp;use&nbsp;'make&nbsp;zImage',&nbsp;'make&nbsp;zdisk',&nbsp;or&nbsp;'make&nbsp;zlilo'<br>
			on&nbsp;these&nbsp;systems.<br>
			</P
></TD
><TD
WIDTH="10%"
VALIGN="TOP"
>&nbsp;</TD
></TR
><TR
><TD
COLSPAN="2"
ALIGN="RIGHT"
VALIGN="TOP"
>--<SPAN
CLASS="ATTRIBUTION"
>Kbuild 2.4 Documentation</SPAN
></TD
><TD
WIDTH="10%"
>&nbsp;</TD
></TR
></TABLE
>


		<A
NAME="AEN493"
HREF="/linux/Kernel-Build-HOWTO.html#FTN.AEN493"
>[6]</A
>

		On an Athlon 1800XP, building the bzImage took approximately seven
		minutes for a moderately configured kernel. On a Pentium 100 used as a 
		baseline, a similar configuration took almost 45 minutes. If you are not 
		in a hurry you may want to start the build on a console while you continue to work. 

		The main difference between the 2.4 and 2.6 trees is the amount of information
		presented on the screen. Much less information is displayed with 2.6.x, making
		errors and warnings easier to spot.

		If everything went correctly then the new kernel should exist in 
		<TT
CLASS="FILENAME"
>./arch/$ARCH/boot</TT
>. For example, on IA32 
		systems we can verify this with:

		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>			<TT
CLASS="PROMPT"
>$</TT
><B
CLASS="COMMAND"
>ls -l arch/i386/boot</B
>
		</PRE
></TD
></TR
></TABLE
>

	
		</P
></DIV
><DIV
CLASS="SECTION"
><HR><H1
CLASS="SECTION"
><A
NAME="MAKE-MODULES"
></A
>Build the Modules</H1
><P
>&#13;		There is one more step needed for the build process, however. You have created the 
		kernel, but now you need to create all the loadable modules if you have them
		configured.  Be aware that typical distribution kernels tend to have almost every
		feature installed, plus a few others for good measure. These can typically take
		an hour or so to build on our Athlon XP1800. The stock kernels are somewhat 
		leaner by default and take, on average, 25 minutes to compile. To build the modules
		we run:

		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>make modules</B
>
		</PRE
></TD
></TR
></TABLE
>

		Again, lots of messages will scroll by on the screen. Here also the 2.6.x series
		is less talkative, outputting only summary information. Once the modules are built
		they can be installed. If you were building as a non-privileged user you will now 
		need to switch to root to complete this next step:

		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>su</B
>
			password:
			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>make modules_install</B
>
		</PRE
></TD
></TR
></TABLE
>

		The freshly baked modules will be copied into <TT
CLASS="FILENAME"
>/lib/modules/KERNEL_VERSION</TT
>.

		</P
></DIV
><DIV
CLASS="SECTION"
><HR><H1
CLASS="SECTION"
><A
NAME="MKINITRD"
></A
>Create Initial RAMDisk</H1
><P
>			If you have built your main boot drivers as modules (e.g., SCSI host
			adapter, filesystem, RAID drivers) then you will need to create an 
			initial RAMdisk image. The initrd is a way of sidestepping the chicken
			and egg problem of booting -- drivers are needed to load the root
			filesystem but the filesystem cannot be loaded because the drivers
			are on the filesystem.  As the manpage for <B
CLASS="COMMAND"
>mkinitrd</B
>
			states:

		<A
NAME="AEN515"
></A
><TABLE
BORDER="0"
WIDTH="100%"
CELLSPACING="0"
CELLPADDING="0"
CLASS="BLOCKQUOTE"
><TR
><TD
WIDTH="10%"
VALIGN="TOP"
>&nbsp;</TD
><TD
WIDTH="80%"
VALIGN="TOP"
><P
CLASS="LITERALLAYOUT"
>	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mkinitrd&nbsp;creates&nbsp;filesystem&nbsp;images&nbsp;which&nbsp;are&nbsp;suitable&nbsp;for&nbsp;use&nbsp;as&nbsp;Linux&nbsp;initial<br>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ramdisk(initrd)&nbsp;images.&nbsp;Such&nbsp;images&nbsp;are&nbsp;often&nbsp;used&nbsp;for&nbsp;preloading&nbsp;&nbsp;the<br>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;block&nbsp;device&nbsp;modules&nbsp;(such&nbsp;as&nbsp;IDE,&nbsp;SCSI&nbsp;or&nbsp;RAID)&nbsp;which&nbsp;are&nbsp;needed&nbsp;to&nbsp;access&nbsp;the<br>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;filesystem.&nbsp;mkinitrd&nbsp;automatically&nbsp;loads&nbsp;filesystem&nbsp;&nbsp;modules&nbsp;(such&nbsp;as<br>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ext3&nbsp;and&nbsp;jbd),&nbsp;IDE&nbsp;modules,all&nbsp;scsi_hostadapter&nbsp;entries&nbsp;in&nbsp;/etc/modules.conf,<br>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;raid&nbsp;modules&nbsp;if&nbsp;the&nbsp;systems&nbsp;root&nbsp;partition&nbsp;is&nbsp;on&nbsp;raid,&nbsp;which&nbsp;makes&nbsp;it<br>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;simple&nbsp;to&nbsp;build&nbsp;and&nbsp;use&nbsp;kernels&nbsp;using&nbsp;modular&nbsp;device&nbsp;drivers.<br>
			</P
></TD
><TD
WIDTH="10%"
VALIGN="TOP"
>&nbsp;</TD
></TR
><TR
><TD
COLSPAN="2"
ALIGN="RIGHT"
VALIGN="TOP"
>--<SPAN
CLASS="ATTRIBUTION"
>MKINITRD(8)</SPAN
></TD
><TD
WIDTH="10%"
>&nbsp;</TD
></TR
></TABLE
>

			To create the initrd, do the following:
			<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>				<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>mkinitrd /boot/initrd-2.6.0.img 2.6.0</B
>
			</PRE
></TD
></TR
></TABLE
>

			Some versions of mkinitrd may require other options to specify
			the location of the new kernel. On SuSe 9.0, for example, the
			following syntax is required:

			<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>				<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>mkinitrd -k vmlinux-VERSION -i initrd-VERSION</B
>
			</PRE
></TD
></TR
></TABLE
>

			<A
NAME="AEN524"
HREF="/linux/Kernel-Build-HOWTO.html#FTN.AEN524"
>[7]</A
>
		</P
></DIV
><DIV
CLASS="SECTION"
><HR><H1
CLASS="SECTION"
><A
NAME="TROUBLESHOOTING"
></A
>Troubleshooting Build Failures</H1
><P
>			If your build fails with a signal 11 error it is most likely because of
			hardware problems; often the culprit is failing memory. Unfortunately,
			the BIOS memory check is close to useless in detecting intermittent
			memory failures. Even dedicated memory checkers do not stress memory
			as much as gcc running a kernel build. One way to tell if hardware is
			at fault is to restart the 'make bzImage' process. If you can get a
			little further before failing again then it is a hardware error. There
			are several possible ways to try to correct these.
		</P
><P
>			Try changing your memory settings in the BIOS to more conservative
			levels. For example, change to SLOW or NORMAL instead of FAST. Verify
			that all the fans are working correctly.
			<A
NAME="AEN530"
HREF="/linux/Kernel-Build-HOWTO.html#FTN.AEN530"
>[8]</A
>
			 Swap out the memory. One trick is to specify less memory than is
			 actually installed by passing values to the kernel on boot. This
			 prevents the kernel from accessing all the memory in the machine,
			 and could help diagnose bad SIMMs or SDRAMs.
		</P
><P
>			If instead the 'make' fails at the same point each time, then it is a
			configuration error. These usually result from not enabling a feature
			that is required by another. For example, IP Firewalling requires
			TCP/IP. If the prerequisite is not enabled, the build will fail. You
			may also get errors if you select the wrong processor or are using
			either a very old or development compiler.
		</P
><P
>			Also keep in mind that the kernel is highly sensitive to the versions
			of the build tools such as the compiler and linker. The versions listed
			are <I
CLASS="EMPHASIS"
>requirements</I
>, not <I
CLASS="EMPHASIS"
>suggested</I
>.
		</P
></DIV
></DIV
><DIV
CLASS="CHAPTER"
><HR><H1
><A
NAME="AEN536"
></A
>Installation</H1
><DIV
CLASS="SECTION"
><H1
CLASS="SECTION"
><A
NAME="INSTALLATION"
></A
>Copy the Kernel and System.map</H1
><P
>		Once your kernel is created, you can prepare it for use. From the
		<TT
CLASS="FILENAME"
>./linux</TT
> directory, copy the kernel and 
		<TT
CLASS="FILENAME"
>System.map</TT
> file to /boot. In the following
		examples change KERNEL_VERSION to the version of your kernel.
		<A
NAME="AEN543"
HREF="/linux/Kernel-Build-HOWTO.html#FTN.AEN543"
>[9]</A
>

		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>cp arch/i386/boot/bzImage /boot/bzImage-KERNEL_VERSION</B
>
			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>cp System.map /boot/System.map-KERNEL_VERSION</B
>
			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>ln -s /boot/System.map-KERNEL_VERSION /boot/System.map</B
>
		</PRE
></TD
></TR
></TABLE
>
		</P
><P
>		The next step is to configure your bootloader. The bootloader is the
		first program that runs when a computer is booted. For this document it is
		assumed that you are running an IA32 system with a standard PC BIOS. If
		you are running the <SPAN
CLASS="PRODUCTNAME"
><SPAN
CLASS="ACRONYM"
>LiLO</SPAN
></SPAN
>
		bootloader skip to the <A
HREF="/linux/Kernel-Build-HOWTO.html#LILO-CONFIGURATION"
>the Section called <I
>LiLO Configuration</I
></A
> otherwise
		proceed to <A
HREF="/linux/Kernel-Build-HOWTO.html#GRUB-CONFIGURATION"
>the Section called <I
>GrUB Configuration</I
></A
>.
		</P
><P
>		FIXME: Need information on non-IA32 bootloaders!!
		</P
></DIV
><DIV
CLASS="SECTION"
><HR><H1
CLASS="SECTION"
><A
NAME="GRUB-CONFIGURATION"
></A
>GrUB Configuration</H1
><P
>		GrUB is beginning to supplant LiLO as the bootloader of choice in more 
		recent Linux distributions. It is generally more flexible and a lot more
		forgiving of system errors. For example, LiLO generally requires that an alternate boot
		disk is used if the kernel configuration renders the system unbootable 
		Grub allows <SPAN
CLASS="QUOTE"
>"on-the-fly"</SPAN
> modification of kernel location, 
		boot parameters, kernel to boot, etc..	
		</P
><P
>		Once you have copied the bzImage and System.map to <TT
CLASS="FILENAME"
>/boot</TT
>,
		edit the grub configuration file located in <TT
CLASS="FILENAME"
>/boot/grub/menu.lst</TT
>.
		On some distributions <TT
CLASS="FILENAME"
>/etc/grub.conf</TT
> is a symbolic link to
		this file. 

		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>		# Note that you do not have to rerun grub after making changes to this file
		#boot=/dev/hda
		default=0
		timeout=10
		title Red Hat Linux (2.4.20-24.9)
			root (hd0,1)
			kernel /boot/vmlinuz-2.4.20-24.9 ro root=LABEL=/
			initrd /boot/initrd-2.4.20-24.9.img
		title Red Hat Linux (2.4.20-20.9)
			root (hd0,1)
			kernel /boot/vmlinuz-2.4.20-20.9 ro root=LABEL=/
			initrd /boot/initrd-2.4.20-20.9.img
		</PRE
></TD
></TR
></TABLE
>

		Edit the file to include your new kernel information. Keep in mind that GrUB counts
		starting from 0, so (hd0,1) references the first controller, <I
CLASS="EMPHASIS"
>second</I
>
		partition. If you have created an initial RAMdisk be sure to include it here too. 
		A typical configuration may look something like this:

		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>		title Test Kernel (2.6.0)
			root (hd0,1)
			kernel /boot/bzImage-2.6.0 ro root=LABEL=/
			initrd /boot/initrd-2.6.0.img
		</PRE
></TD
></TR
></TABLE
>
		</P
></DIV
><DIV
CLASS="SECTION"
><HR><H1
CLASS="SECTION"
><A
NAME="LILO-CONFIGURATION"
></A
>LiLO Configuration</H1
><P
>		LiLO is an older bootloader. Its configuration file is located in 
		<TT
CLASS="FILENAME"
>/etc/lilo.conf</TT
> on most systems. Unlike GrUB,
		any changes to lilo.conf will not be set until the lilo program is
		rerun. 
		
		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>		boot=/dev/hda
		map=/boot/map
		install=/boot/boot.b
		default=test-2.6.0
		keytable=/boot/us.klt
		lba32
		prompt
		timeout=50
		message=/boot/message
		menu-scheme=wb:bw:wb:bw
		image=/boot/vmlinuz
			label=linux
			root=/dev/hda3
			append=" ide1=autotune ide0=autotune"
			read-only
		  
		image=/boot/bzImage-2.6.0
			label=test-2.6.0
			root=/dev/hda2
			read-only
		</PRE
></TD
></TR
></TABLE
>  

		The important sections are the <I
CLASS="EMPHASIS"
>image=/boot/bzImage</I
> and 
		the <I
CLASS="EMPHASIS"
>default=test-2.6.0</I
> options. Notice that you can have 
		several image sections in the lilo.conf, allowing multiple configurations.
		Install the new kernel by running the lilo program.

  		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>		<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
> /sbin/lilo</B
>
		</PRE
></TD
></TR
></TABLE
>

		If you are installing and testing the kernel remotely, you can
		instead specify to LiLO that the new kernel is loaded only for the next
		boot by using the following syntax:
		<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>		<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
> /sbin/lilo -R test-2.6.0</B
>
		</PRE
></TD
></TR
></TABLE
>


		Messages will appear showing the newly added kernel with an asterisk marking
		the default image. If you get errors, consult the lilo documentation for the
		correct syntax.
		</P
></DIV
></DIV
><A
NAME="AEN585"
></A
><HR><H1
><A
NAME="AEN585"
></A
>Bibliography</H1
><H2
CLASS="BIBLIODIV"
><A
NAME="AEN587"
></A
>Books</H2
><DIV
CLASS="BIBLIOENTRY"
><A
NAME="AEN589"
></A
><P
>[LinuxKernel]&nbsp;<SPAN
CLASS="AUTHOR"
>Daniel P. Dovet </SPAN
><SPAN
CLASS="AUTHOR"
>and Marco Cesati</SPAN
>, 2003, <SPAN
CLASS="EDITOR"
>Edited by FIXME FIXME</SPAN
>, 0672325128 , SAMS, <I
>Linux Kernel Development</I
>.</P
><DIV
CLASS="BIBLIOENTRYBLOCK"
STYLE="margin-left=0.5in"
></DIV
></DIV
><DIV
CLASS="APPENDIX"
><HR><H1
><A
NAME="RESOURCES"
></A
>Resources</H1
><DIV
CLASS="SECTION"
><H1
CLASS="SECTION"
><A
NAME="INTERNET-RESOURCES"
></A
>Online Resources</H1
><P
>			</P
></DIV
></DIV
><DIV
CLASS="APPENDIX"
><HR><H1
><A
NAME="ABOUT"
></A
>Feedback</H1
><DIV
CLASS="SECTION"
><H1
CLASS="SECTION"
><A
NAME="ABOUT-FEEDBACK"
></A
>Comments and corrections</H1
><P
>				The current maintainer of this <I
CLASS="CITETITLE"
>HOWTO</I
>
				is Kwan Lowe.  Please send corrections,
				additions, comments and criticisms to
				<TT
CLASS="EMAIL"
>&#60;<A
HREF="mailto:kwan@digitalhermit.com"
>kwan@digitalhermit.com</A
>&#62;</TT
>.
			</P
><P
>				The <I
CLASS="CITETITLE"
>HOWTO</I
>'s maintainer is not a
				professional writer.  If you find some parts of this
				<I
CLASS="CITETITLE"
>HOWTO</I
> difficult to comprehend then let the
				maintainer know.
			</P
></DIV
></DIV
><DIV
CLASS="COLOPHON"
><HR><H1
><A
NAME="COLOPHON"
></A
>Colophon</H1
><P
>		Written in DocBook 4.1 <SPAN
CLASS="ACRONYM"
>SGML</SPAN
>.
		<TT
CLASS="APPLICATION"
>Vim</TT
> was
		used to create the <SPAN
CLASS="ACRONYM"
>SGML</SPAN
> source file. The
		<SPAN
CLASS="ACRONYM"
>HTML</SPAN
>, <SPAN
CLASS="PRODUCTNAME"
>PostScript</SPAN
> and
		<SPAN
CLASS="PRODUCTNAME"
><SPAN
CLASS="ACRONYM"
>PDF</SPAN
></SPAN
> output was
		generated from the DocBook source by the Linux Documentation
		Project.
	</P
></DIV
></DIV
><H3
CLASS="FOOTNOTES"
>Notes</H3
><TABLE
BORDER="0"
CLASS="FOOTNOTES"
WIDTH="100%"
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.AEN49"
HREF="/linux/Kernel-Build-HOWTO.html#AEN49"
>[1]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>					I have successfully installed a serviceable machine on an original Pentium 100, 
					64M RAM, and 1.2G of drive space. A full build of the 2.6.0test9 kernel took 
					approximately 4 hours to complete.
				</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.AEN58"
HREF="#AEN58"
>[2]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>			On an RPM-based system you can query a minimal version with a
			command such as:
			<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>rpm -q --requires gcc|grep glibc</B
>
			</PRE
></TD
></TR
></TABLE
>
			</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.AEN109"
HREF="/linux/Kernel-Build-HOWTO.html#AEN109"
>[3]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>			Distributions will often install the kernel sources into     
			<TT
CLASS="FILENAME"
>/usr/src/linux</TT
>. To build in this directory
			will require root access. Note that there are usually two source packages --
			one called something like <TT
CLASS="FILENAME"
>kernel-source-VERSION-i386.rpm</TT
>
			and another called <TT
CLASS="FILENAME"
>kernel-VERSION.src.rpm</TT
>. You can generally
			rebuild the <TT
CLASS="FILENAME"
>src.rpm</TT
> as an unpriveleged user.
			</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.AEN170"
HREF="/linux/Kernel-Build-HOWTO.html#AEN170"
>[4]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>		  		This is a relative thing. The initrd utility is robust and easy to
				use. Bootloaders have also improved to the point that little effort
				is saved by using static kernels. My two cents.
				</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.AEN235"
HREF="/linux/Kernel-Build-HOWTO.html#AEN235"
>[5]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>			I have noticed some minor screen corruption when using menuconfig in 
			slightly non-standard terminals. Though it functions normally some of the
			menu entries may be difficult to read until the screen is refreshed.
			</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.AEN493"
HREF="/linux/Kernel-Build-HOWTO.html#AEN493"
>[6]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>			The difference between 'zImage' files and 'bzImage' files is that
			'bzImage' uses a different layout and a different loading algorithm,
			and thus has a larger capacity. Both files use gzip compression. The
			'bz' in 'bzImage' stands for 'big zImage', not for 'bzip'!
			</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.AEN524"
HREF="/linux/Kernel-Build-HOWTO.html#AEN524"
>[7]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>				At this writing there are some issues with the modules.conf when moving
				from 2.4 to 2.6 kernels. Some module names have changed which seems to 
				cause glitches with initrd. 
				</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.AEN530"
HREF="/linux/Kernel-Build-HOWTO.html#AEN530"
>[8]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
> 
				For a long while, I thought that the xmatrix screensaver was
				crashing my machine because of the numerous core dumps I would
				discover in my home directory. It turned out that xmatrix was
				cpu intensive. Unknown to me, the CPU fan on this machine had
				failed. Everything was fine until xmatrix started, causing the
				processor to overheat, eventually leading to a crash.
				</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.AEN543"
HREF="/linux/Kernel-Build-HOWTO.html#AEN543"
>[9]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>			Jerome Walter offers the following information for PowerPPC
			plaforms:
			
			On a PowerPC (PreP architecture). To make the system bootable, one 
			needs to copy the bzImage file into the special partition (PreP Boot 
			Partition type 41), using dd. Assuming that the so called partition 
			is named /dev/sda1, the command should look like :
			<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>			<TT
CLASS="PROMPT"
>$ </TT
><B
CLASS="COMMAND"
>dd if=bzImage-you-have-just-done.img of=/dev/sda1</B
>
			</PRE
></TD
></TR
></TABLE
>

			People should be warned that if their partition is too small, the
			bzImage will not fit, and the boot procedure will fail.
		</P
></TD
></TR
></TABLE
>

      </div></td>
    </tr>
  </table>
  </td>
</tr>

<tr><td colspan="2" class="smaller">&nbsp;</td></tr>
<tr>
	<td colspan="2" align="center" class="endbar">
	&#169; 2002, 2003 &nbsp;&nbsp;&nbsp; 
	<a href="http://www.digitalhermit.com/about/index.html">Kwan Lowe</a> 
	&nbsp;&nbsp;&nbsp; <a href="http://www.digitalhermit.com">DigitalHermit</a>
	</td>
</tr>
</table>
<br />



</body>
</html>