Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
1798 lines (1675 loc) · 101 KB
/
Copy pathindex.html
File metadata and controls
1798 lines (1675 loc) · 101 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RISC-V From Scratch - RISC-V 新手村</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;600;700&display=swap');
body {
font-family: 'Inter', 'Noto Sans SC', sans-serif;
}
.gradient-text {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.hero-gradient {
background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}
.card-hover {
transition: all 0.3s ease;
}
.card-hover:hover {
transform: translateY(-4px);
box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}
.nav-item {
position: relative;
}
.nav-item::after {
content: '';
position: absolute;
bottom: -2px;
left: 0;
width: 0;
height: 2px;
background: linear-gradient(90deg, #667eea, #764ba2);
transition: width 0.3s ease;
}
.nav-item:hover::after {
width: 100%;
}
.code-block {
background: #1e1e2e;
border-radius: 8px;
overflow-x: auto;
}
.code-block code {
color: #cdd6f4;
font-family: 'Fira Code', monospace;
}
.timeline-item::before {
content: '';
position: absolute;
left: -8px;
top: 0;
width: 16px;
height: 16px;
border-radius: 50%;
background: linear-gradient(135deg, #667eea, #764ba2);
}
.scroll-indicator {
animation: bounce 2s infinite;
}
@keyframes bounce {
0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
40% { transform: translateY(-10px); }
60% { transform: translateY(-5px); }
}
.tab-active {
border-bottom: 2px solid #667eea;
color: #667eea;
}
.route-card {
border: 2px solid transparent;
transition: all 0.3s ease;
}
.route-card:hover {
border-color: #667eea;
}
.route-card.recommended {
border-color: #f59e0b;
position: relative;
}
.route-card.recommended::before {
content: '推荐';
position: absolute;
top: -12px;
right: 20px;
background: linear-gradient(135deg, #f59e0b, #d97706);
color: white;
padding: 4px 12px;
border-radius: 20px;
font-size: 12px;
font-weight: 600;
}
.checklist-item input:checked + label {
text-decoration: line-through;
color: #6b7280;
}
.github-link {
transition: all 0.3s ease;
}
.github-link:hover {
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
}
</style>
</head>
<body class="bg-gray-50 text-gray-800">
<!-- Navigation -->
<nav class="fixed top-0 w-full bg-white/90 backdrop-blur-md shadow-sm z-50">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16 items-center">
<div class="flex items-center space-x-2">
<i class="fas fa-microchip text-2xl text-purple-600"></i>
<span class="font-bold text-xl">RISC-V From Scratch</span>
</div>
<div class="hidden md:flex space-x-6">
<a href="#overview" class="nav-item text-gray-700 hover:text-purple-600 font-medium">项目介绍</a>
<a href="#roadmap" class="nav-item text-gray-700 hover:text-purple-600 font-medium">主线指南</a>
<a href="#faq" class="nav-item text-gray-700 hover:text-purple-600 font-medium">FAQ</a>
<a href="#template" class="nav-item text-gray-700 hover:text-purple-600 font-medium">提交模板</a>
</div>
<a href="https://github.com/openRuyi-Project/RISC-V-From-Scratch" target="_blank"
class="github-link flex items-center space-x-2 px-4 py-2 rounded-lg bg-gray-900 text-white hover:bg-gray-800">
<i class="fab fa-github text-lg"></i>
<span class="hidden sm:inline font-medium">GitHub</span>
</a>
</div>
</div>
</nav>
<!-- Hero Section -->
<section class="hero-gradient min-h-screen flex items-center justify-center pt-16">
<div class="max-w-5xl mx-auto px-4 text-center text-white">
<div class="mb-6">
<span class="inline-block px-4 py-2 rounded-full bg-white/20 backdrop-blur-sm text-sm font-medium">
🏰 RISC-V 新手村
</span>
</div>
<h1 class="text-5xl md:text-7xl font-bold mb-6 leading-tight">
从零构建 <span class="text-yellow-300">RISC-V</span><br>Linux 系统
</h1>
<p class="text-xl md:text-2xl text-white/90 mb-8 max-w-3xl mx-auto">
亲手打造 riscv64 Linux From Scratch,掌握系统构建的核心技能,<br>
加入目标发行版开发之旅
</p>
<div class="flex flex-col sm:flex-row gap-4 justify-center mb-8">
<a href="#roadmap" class="px-8 py-4 bg-white text-purple-700 rounded-xl font-semibold text-lg hover:shadow-lg transition-all">
<i class="fas fa-map-marked-alt mr-2"></i>查看主线步骤
</a>
<a href="#overview" class="px-8 py-4 bg-white/20 backdrop-blur-sm text-white rounded-xl font-semibold text-lg hover:bg-white/30 transition-all border border-white/30">
<i class="fas fa-book mr-2"></i>阅读文档
</a>
</div>
<!-- GitHub Repo Link -->
<div class="mb-12">
<a href="https://github.com/openRuyi-Project/RISC-V-From-Scratch" target="_blank"
class="inline-flex items-center space-x-3 px-6 py-3 bg-gray-900/50 backdrop-blur-sm rounded-full text-white hover:bg-gray-900/70 transition-all border border-white/20">
<i class="fab fa-github text-2xl"></i>
<div class="text-left">
<div class="text-xs text-gray-300">项目组织</div>
<div class="font-semibold">RISC-V-From-Scratch</div>
</div>
<i class="fas fa-external-link-alt text-sm ml-2"></i>
</a>
</div>
<div class="grid grid-cols-2 md:grid-cols-4 gap-6 max-w-4xl mx-auto text-center">
<div class="bg-white/10 backdrop-blur-sm rounded-xl p-4">
<div class="text-3xl font-bold text-yellow-300">1</div>
<div class="text-sm text-white/80">新人主线</div>
</div>
<div class="bg-white/10 backdrop-blur-sm rounded-xl p-4">
<div class="text-3xl font-bold text-yellow-300">20+</div>
<div class="text-sm text-white/80">FAQ 条目</div>
</div>
<div class="bg-white/10 backdrop-blur-sm rounded-xl p-4">
<div class="text-3xl font-bold text-yellow-300">4</div>
<div class="text-sm text-white/80">阶段验证</div>
</div>
<div class="bg-white/10 backdrop-blur-sm rounded-xl p-4">
<div class="text-3xl font-bold text-yellow-300">∞</div>
<div class="text-sm text-white/80">成长可能</div>
</div>
</div>
</div>
<div class="absolute bottom-8 left-1/2 transform -translate-x-1/2 scroll-indicator">
<i class="fas fa-chevron-down text-white/60 text-2xl"></i>
</div>
</section>
<!-- Overview Section -->
<section id="overview" class="py-20 bg-white">
<div class="max-w-6xl mx-auto px-4">
<div class="text-center mb-16">
<h2 class="text-4xl font-bold mb-4">🎉 欢迎来到新手村</h2>
<p class="text-xl text-gray-600 max-w-3xl mx-auto">
这里是通往 <strong>目标发行版</strong> 的第一道门槛。通过亲手构建 riscv64 Linux 系统,
你将深入理解 Linux 的基本构成,为参与目标发行版开发打下坚实基础。
</p>
</div>
<div class="bg-gradient-to-r from-indigo-50 via-purple-50 to-pink-50 rounded-2xl p-6 md:p-8 border border-purple-100 mb-12">
<div class="flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4">
<div>
<h3 class="text-2xl font-bold mb-2">🚀 10 分钟速读路径</h3>
<p class="text-gray-600 text-sm">
想快速进入实作:先看主线要求,再按构建步骤推进;遇到问题查 FAQ,最后按模板提交。
</p>
</div>
<a href="readme.md" class="inline-flex items-center px-4 py-2 bg-gray-900 text-white rounded-lg font-medium hover:bg-gray-800 transition-colors">
<i class="fas fa-book mr-2"></i>阅读总览文档
</a>
</div>
<div class="grid sm:grid-cols-2 lg:grid-cols-4 gap-3 mt-5 text-sm">
<a href="#roadmap" class="bg-white rounded-xl p-3 border border-purple-100 hover:border-purple-300 hover:shadow-sm transition-all">
<div class="font-semibold text-purple-700">1. 对齐主线要求</div>
<div class="text-gray-500">glibc + systemd</div>
</a>
<a href="readme.md" class="bg-white rounded-xl p-3 border border-purple-100 hover:border-purple-300 hover:shadow-sm transition-all">
<div class="font-semibold text-purple-700">2. 按三段式构建</div>
<div class="text-gray-500">Stage 1 → Stage 3</div>
</a>
<a href="#faq" class="bg-white rounded-xl p-3 border border-purple-100 hover:border-purple-300 hover:shadow-sm transition-all">
<div class="font-semibold text-purple-700">3. 先定位再修复</div>
<div class="text-gray-500">优先查 FAQ 与速查表</div>
</a>
<a href="#template" class="bg-white rounded-xl p-3 border border-purple-100 hover:border-purple-300 hover:shadow-sm transition-all">
<div class="font-semibold text-purple-700">4. 按模板提交</div>
<div class="text-gray-500">模板 + 检查清单 + 花活</div>
</a>
</div>
</div>
<!-- LFS and RISC-V Context -->
<div class="grid lg:grid-cols-5 gap-6 mb-8">
<div class="lg:col-span-3 bg-white rounded-2xl p-8 border border-gray-100 shadow-sm">
<div class="flex items-center space-x-3 mb-4">
<div class="w-10 h-10 bg-indigo-100 rounded-xl flex items-center justify-center">
<i class="fas fa-book-open text-indigo-600"></i>
</div>
<h3 class="text-2xl font-bold">什么是 LFS</h3>
</div>
<p class="text-gray-600">
<strong>LFS(Linux From Scratch)</strong>不是装现成发行版,而是从工具链到用户态组件逐层构建系统。
你会真正理解“为什么能启动、为什么会失败、为什么路径污染会造成连锁故障”。
</p>
<ul class="mt-4 space-y-2 text-sm text-gray-700">
<li class="flex items-start"><i class="fas fa-check text-indigo-500 mr-2 mt-1"></i><span>从 binutils/GCC 到 glibc 的依赖关系</span></li>
<li class="flex items-start"><i class="fas fa-check text-indigo-500 mr-2 mt-1"></i><span>从内核到 init/systemd 的启动链路</span></li>
<li class="flex items-start"><i class="fas fa-check text-indigo-500 mr-2 mt-1"></i><span>从构建错误到运行故障的系统级排障方法</span></li>
</ul>
</div>
<div class="lg:col-span-2 bg-gradient-to-br from-purple-600 via-indigo-600 to-blue-600 text-white rounded-2xl p-8">
<h3 class="text-2xl font-bold mb-3">为什么是 RISC-V</h3>
<ul class="space-y-3 text-sm text-white/90">
<li class="flex items-start"><i class="fas fa-route mt-1 mr-2 text-yellow-300"></i><span>启动路径清晰:OpenSBI -> Kernel -> init</span></li>
<li class="flex items-start"><i class="fas fa-code-branch mt-1 mr-2 text-yellow-300"></i><span>Host/Target 边界明确,强制建立正确交叉构建思维</span></li>
<li class="flex items-start"><i class="fas fa-sync-alt mt-1 mr-2 text-yellow-300"></i><span>方法可迁移:学会一套,可迁到其他架构与场景</span></li>
</ul>
</div>
</div>
<div class="bg-gray-900 text-white rounded-2xl p-8 mb-16">
<div class="flex flex-col lg:flex-row lg:items-center lg:justify-between gap-6">
<div>
<h3 class="text-2xl font-bold mb-2">🏁 挑战定位:构建 + 自我展示</h3>
<p class="text-gray-300">
`RISC-V-From-Scratch` 不只是“把系统做出来”,还要把你的工程判断讲清楚。
先完成主线,再展示你的优化、自动化、加固或可观测性设计。
</p>
</div>
<a href="#template" class="inline-flex items-center px-5 py-3 bg-white text-gray-900 rounded-xl font-semibold hover:bg-gray-100 transition-colors">
<i class="fas fa-lightbulb mr-2"></i>查看花活模板项
</a>
</div>
</div>
<div class="grid md:grid-cols-3 gap-8 mb-16">
<div class="card-hover bg-gradient-to-br from-purple-50 to-blue-50 rounded-2xl p-8">
<div class="w-14 h-14 bg-purple-600 rounded-xl flex items-center justify-center mb-6">
<i class="fas fa-tools text-white text-2xl"></i>
</div>
<h3 class="text-xl font-bold mb-3">亲手构建</h3>
<p class="text-gray-600">从零开始构建一个可运行的 riscv64 Linux 系统,理解每个组件的作用</p>
</div>
<div class="card-hover bg-gradient-to-br from-blue-50 to-cyan-50 rounded-2xl p-8">
<div class="w-14 h-14 bg-blue-600 rounded-xl flex items-center justify-center mb-6">
<i class="fas fa-brain text-white text-2xl"></i>
</div>
<h3 class="text-xl font-bold mb-3">深入理解</h3>
<p class="text-gray-600">掌握交叉编译、C库、内核、初始化系统等核心概念</p>
</div>
<div class="card-hover bg-gradient-to-br from-cyan-50 to-teal-50 rounded-2xl p-8">
<div class="w-14 h-14 bg-cyan-600 rounded-xl flex items-center justify-center mb-6">
<i class="fas fa-users text-white text-2xl"></i>
</div>
<h3 class="text-xl font-bold mb-3">加入社区</h3>
<p class="text-gray-600">成为目标发行版开发者,与志同道合的伙伴共建 RISC-V 生态</p>
</div>
</div>
<!-- GitHub Repository Card -->
<div class="bg-gradient-to-r from-gray-900 to-gray-800 rounded-2xl p-8 text-white mb-8">
<div class="flex flex-col md:flex-row items-center justify-between gap-6">
<div class="flex items-center space-x-4">
<div class="w-16 h-16 bg-white rounded-xl flex items-center justify-center">
<i class="fab fa-github text-4xl text-gray-900"></i>
</div>
<div>
<h3 class="text-xl font-bold">项目组织 / RISC-V-From-Scratch</h3>
<p class="text-gray-400 text-sm">通往目标发行版的新手村挑战</p>
</div>
</div>
<a href="https://github.com/openRuyi-Project/RISC-V-From-Scratch" target="_blank"
class="px-6 py-3 bg-purple-600 hover:bg-purple-700 rounded-xl font-semibold transition-colors flex items-center space-x-2">
<span>查看仓库</span>
<i class="fas fa-arrow-right"></i>
</a>
</div>
</div>
<!-- Three Directory Isolation -->
<div class="bg-white rounded-2xl p-8 shadow-lg mb-8">
<div class="flex items-center space-x-3 mb-6">
<div class="w-10 h-10 bg-red-100 rounded-xl flex items-center justify-center">
<i class="fas fa-layer-group text-red-600"></i>
</div>
<div>
<h3 class="text-xl font-bold">三元目录隔离(铁律)</h3>
<p class="text-sm text-gray-500">任何偏离此结构的构建都将引入路径污染与权限混乱</p>
</div>
</div>
<div class="grid md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
<div class="bg-gradient-to-br from-purple-50 to-purple-100 rounded-xl p-4 border-2 border-purple-200">
<div class="flex items-center space-x-2 mb-2">
<i class="fas fa-folder text-purple-600"></i>
<span class="font-mono text-sm font-bold text-purple-800">${CLFS}/</span>
</div>
<p class="text-xs text-gray-600">最终目标系统根目录(riscv64 架构)</p>
</div>
<div class="bg-gradient-to-br from-blue-50 to-blue-100 rounded-xl p-4 border-2 border-blue-200">
<div class="flex items-center space-x-2 mb-2">
<i class="fas fa-hammer text-blue-600"></i>
<span class="font-mono text-sm font-bold text-blue-800">cross-tools/</span>
</div>
<p class="text-xs text-gray-600">Host 架构可执行文件(x86_64→riscv64 交叉编译器)</p>
</div>
<div class="bg-gradient-to-br from-green-50 to-green-100 rounded-xl p-4 border-2 border-green-200">
<div class="flex items-center space-x-2 mb-2">
<i class="fas fa-microchip text-green-600"></i>
<span class="font-mono text-sm font-bold text-green-800">tools/</span>
</div>
<p class="text-xs text-gray-600">Target 架构可执行文件(riscv64,通过 QEMU 解释执行)</p>
</div>
<div class="bg-gradient-to-br from-orange-50 to-orange-100 rounded-xl p-4 border-2 border-orange-200">
<div class="flex items-center space-x-2 mb-2">
<i class="fas fa-code text-orange-600"></i>
<span class="font-mono text-sm font-bold text-orange-800">sources/</span>
</div>
<p class="text-xs text-gray-600">源码与构建目录(普通用户权限操作)</p>
</div>
</div>
<div class="bg-red-50 border border-red-200 rounded-xl p-4">
<h4 class="font-bold text-red-800 mb-2 flex items-center">
<i class="fas fa-exclamation-triangle mr-2"></i>关键原则
</h4>
<ul class="text-sm text-red-700 space-y-1">
<li>• <code>cross-tools</code> 与 <code>tools</code> <strong>绝对分离</strong></li>
<li>• 所有构建过程不得在 <code>${CLFS}</code> 外安装任何文件</li>
</ul>
</div>
</div>
<!-- Version Lock Matrix -->
<div class="bg-white rounded-2xl p-8 shadow-lg mb-8">
<div class="flex items-center space-x-3 mb-6">
<div class="w-10 h-10 bg-blue-100 rounded-xl flex items-center justify-center">
<i class="fas fa-lock text-blue-600"></i>
</div>
<div>
<h3 class="text-xl font-bold">版本锁定矩阵</h3>
<p class="text-sm text-gray-500">RISC-V 生态演进快速,必须预先验证以下兼容性</p>
</div>
</div>
<div class="overflow-x-auto">
<table class="w-full">
<thead>
<tr class="bg-gray-50">
<th class="px-4 py-3 text-left font-semibold text-gray-700">组件</th>
<th class="px-4 py-3 text-left font-semibold text-gray-700">推荐版本</th>
<th class="px-4 py-3 text-left font-semibold text-gray-700">注意事项</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-100">
<tr>
<td class="px-4 py-3 font-medium">QEMU</td>
<td class="px-4 py-3"><span class="px-2 py-1 bg-green-100 text-green-700 rounded text-sm">≥ 8.0</span></td>
<td class="px-4 py-3 text-sm text-gray-600">低版本无法正确处理 glibc 2.38+ 的 <code>clone3</code></td>
</tr>
<tr>
<td class="px-4 py-3 font-medium">GCC</td>
<td class="px-4 py-3"><span class="px-2 py-1 bg-blue-100 text-blue-700 rounded text-sm">13.x</span></td>
<td class="px-4 py-3 text-sm text-gray-600">与 Binutils 版本需匹配</td>
</tr>
<tr>
<td class="px-4 py-3 font-medium">Binutils</td>
<td class="px-4 py-3"><span class="px-2 py-1 bg-purple-100 text-purple-700 rounded text-sm">2.42</span></td>
<td class="px-4 py-3 text-sm text-gray-600">-</td>
</tr>
<tr>
<td class="px-4 py-3 font-medium">Linux Kernel</td>
<td class="px-4 py-3"><span class="px-2 py-1 bg-orange-100 text-orange-700 rounded text-sm">6.6.x</span></td>
<td class="px-4 py-3 text-sm text-gray-600">头文件版本不必与运行内核完全一致</td>
</tr>
<tr>
<td class="px-4 py-3 font-medium">systemd</td>
<td class="px-4 py-3"><span class="px-2 py-1 bg-yellow-100 text-yellow-700 rounded text-sm">随构建清单锁定</span></td>
<td class="px-4 py-3 text-sm text-gray-600">建议与当前 glibc/QEMU 组合完成兼容性验证</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Three Stage Methodology -->
<div class="bg-gray-900 rounded-2xl p-8 md:p-12 text-white mb-8">
<h3 class="text-2xl font-bold mb-8 text-center">🏗️ 三段式构建核心方法论</h3>
<div class="grid md:grid-cols-3 gap-8">
<div class="relative pl-8 border-l-2 border-purple-500 timeline-item">
<div class="text-purple-400 font-bold mb-2">Stage 1</div>
<h4 class="text-lg font-semibold mb-2">构建交叉编译器</h4>
<p class="text-gray-400 text-sm">在 x86_64 宿主机上构建 riscv64-unknown-linux-gnu-gcc 工具链</p>
</div>
<div class="relative pl-8 border-l-2 border-blue-500 timeline-item">
<div class="text-blue-400 font-bold mb-2">Stage 2</div>
<h4 class="text-lg font-semibold mb-2">构建临时系统</h4>
<p class="text-gray-400 text-sm">安装内核头文件、glibc,重建完整 GCC</p>
</div>
<div class="relative pl-8 border-l-2 border-cyan-500 timeline-item">
<div class="text-cyan-400 font-bold mb-2">Stage 3</div>
<h4 class="text-lg font-semibold mb-2">构建最终系统</h4>
<p class="text-gray-400 text-sm">安装 coreutils、bash、systemd,完成主线启动配置</p>
</div>
</div>
</div>
<!-- Three Passes Compiler Build -->
<div class="bg-white rounded-2xl p-8 shadow-lg">
<div class="flex items-center space-x-3 mb-6">
<div class="w-10 h-10 bg-indigo-100 rounded-xl flex items-center justify-center">
<i class="fas fa-cogs text-indigo-600"></i>
</div>
<div>
<h3 class="text-xl font-bold">编译器构建三 Passes(CLFS 正统)</h3>
<p class="text-sm text-gray-500">传承的交叉编译器构建流程</p>
</div>
</div>
<div class="space-y-6">
<!-- Pass 1 -->
<div class="border-l-4 border-purple-500 pl-4">
<div class="flex items-center space-x-2 mb-2">
<span class="px-2 py-1 bg-purple-100 text-purple-700 rounded text-sm font-bold">Pass 1</span>
<h4 class="font-bold">最小化交叉编译器(无 libc)</h4>
</div>
<div class="code-block p-3 text-sm mb-2">
<code>
<span class="text-green-400"># Binutils(无依赖)</span><br>
../binutils-2.42/configure \
--prefix=${CLFS}/cross-tools \
--target=${TARGET} \
--with-sysroot=${CLFS} \
--disable-nls --disable-werror<br><br>
<span class="text-green-400"># GCC(仅 C 语言,无 libc)</span><br>
../gcc-13.2.0/configure \
--prefix=${CLFS}/cross-tools \
--target=${TARGET} \
--with-sysroot=${CLFS} \
--enable-languages=c \
--disable-shared --disable-threads --without-headers
</code>
</div>
</div>
<!-- Pass 2 -->
<div class="border-l-4 border-blue-500 pl-4">
<div class="flex items-center space-x-2 mb-2">
<span class="px-2 py-1 bg-blue-100 text-blue-700 rounded text-sm font-bold">Pass 2</span>
<h4 class="font-bold">C 库安装</h4>
</div>
<div class="bg-blue-50 rounded-lg p-3 text-sm">
<p><strong>glibc 路径:</strong>先安装内核头文件,再构建 glibc,使用 Pass 1 GCC</p>
</div>
</div>
<!-- Pass 3 -->
<div class="border-l-4 border-green-500 pl-4">
<div class="flex items-center space-x-2 mb-2">
<span class="px-2 py-1 bg-green-100 text-green-700 rounded text-sm font-bold">Pass 3</span>
<h4 class="font-bold">完整交叉编译器</h4>
</div>
<div class="bg-green-50 rounded-lg p-3 text-sm">
<p>重新构建 GCC,启用 <code>--enable-threads=posix</code> 与 <code>--enable-shared</code></p>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- RISC-V Specifics Section -->
<section class="py-16 bg-gradient-to-br from-indigo-900 via-purple-900 to-pink-900 text-white">
<div class="max-w-6xl mx-auto px-4">
<div class="text-center mb-12">
<span class="text-purple-300 font-semibold">⚠️ RISC-V 架构特化要点</span>
<h2 class="text-4xl font-bold mt-2 mb-4">特殊注意事项</h2>
</div>
<div class="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
<!-- Page Size -->
<div class="bg-white/10 backdrop-blur-sm rounded-2xl p-6 border border-white/20">
<div class="w-12 h-12 bg-yellow-500 rounded-xl flex items-center justify-center mb-4">
<i class="fas fa-memory text-white text-xl"></i>
</div>
<h4 class="font-bold text-lg mb-2">页大小</h4>
<p class="text-gray-300 text-sm mb-3">RISC-V 支持 4KB/16KB/64KB 页大小,但用户态软件常硬编码 4KB 假设</p>
<div class="code-block bg-black/30 p-2 text-xs">
<code class="text-green-300">libc_cv_pagesize=4096</code>
</div>
</div>
<!-- Boot Flow -->
<div class="bg-white/10 backdrop-blur-sm rounded-2xl p-6 border border-white/20">
<div class="w-12 h-12 bg-blue-500 rounded-xl flex items-center justify-center mb-4">
<i class="fas fa-play-circle text-white text-xl"></i>
</div>
<h4 class="font-bold text-lg mb-2">启动流程</h4>
<div class="text-sm text-gray-300 space-y-1">
<div>OpenSBI (M-mode)</div>
<div class="text-gray-500">↓</div>
<div>Linux Kernel (S-mode)</div>
<div class="text-gray-500">↓</div>
<div>init (U-mode)</div>
</div>
<p class="text-xs text-purple-300 mt-2">无需构建 EDK2/UEFI</p>
</div>
<!-- Linker Check -->
<div class="bg-white/10 backdrop-blur-sm rounded-2xl p-6 border border-white/20">
<div class="w-12 h-12 bg-red-500 rounded-xl flex items-center justify-center mb-4">
<i class="fas fa-exclamation-triangle text-white text-xl"></i>
</div>
<h4 class="font-bold text-lg mb-2">链接器检查</h4>
<p class="text-gray-300 text-sm mb-3">出现“文件存在但无法执行”时,优先检查 ELF 解释器路径与 glibc 链接器是否匹配</p>
<div class="code-block bg-black/30 p-2 text-xs">
<code class="text-green-300">readelf -l /bin/ls | grep interpreter</code>
</div>
</div>
<!-- RVC -->
<div class="bg-white/10 backdrop-blur-sm rounded-2xl p-6 border border-white/20">
<div class="w-12 h-12 bg-green-500 rounded-xl flex items-center justify-center mb-4">
<i class="fas fa-compress-alt text-white text-xl"></i>
</div>
<h4 class="font-bold text-lg mb-2">压缩指令集 (RVC)</h4>
<p class="text-gray-300 text-sm mb-3">确保工具链与内核均启用 RVC 支持</p>
<div class="code-block bg-black/30 p-2 text-xs">
<code class="text-green-300">--with-arch=rv64gc</code>
</div>
</div>
</div>
</div>
</section>
<!-- Init System Selection -->
<section class="py-16 bg-white">
<div class="max-w-6xl mx-auto px-4">
<div class="text-center mb-12">
<span class="text-purple-600 font-semibold">🎨 Init 系统基线</span>
<h2 class="text-4xl font-bold mt-2 mb-4">systemd 统一基线</h2>
<p class="text-gray-600">新人统一使用 systemd,确保与当前开发协作基线一致</p>
</div>
<div class="max-w-3xl mx-auto">
<!-- systemd -->
<div class="bg-gradient-to-br from-purple-50 to-pink-50 rounded-2xl p-8 border-2 border-purple-200 relative">
<div class="absolute -top-3 left-6 px-3 py-1 bg-purple-600 text-white text-xs font-bold rounded-full">
🏭 唯一主线
</div>
<div class="flex items-center space-x-3 mb-4">
<div class="text-3xl">⭐⭐⭐</div>
<div>
<h3 class="text-xl font-bold">systemd</h3>
<p class="text-purple-600 font-medium">高复杂度</p>
</div>
</div>
<ul class="space-y-2 text-sm text-gray-600 mb-6">
<li class="flex items-center"><i class="fas fa-check text-purple-500 mr-2"></i>现代初始化系统</li>
<li class="flex items-center"><i class="fas fa-check text-purple-500 mr-2"></i>与目标发行版协作基线一致</li>
<li class="flex items-center"><i class="fas fa-check text-purple-500 mr-2"></i>新人直接按该主线完成构建</li>
</ul>
<div class="bg-white rounded-xl p-3 text-xs text-gray-500">
rootfs 大小: ~200MB+(取决于组件裁剪)
</div>
</div>
</div>
</div>
</section>
<!-- Verification Nodes -->
<section class="py-16 bg-gray-50">
<div class="max-w-6xl mx-auto px-4">
<div class="text-center mb-12">
<span class="text-purple-600 font-semibold">✅ 阶段性验证节点</span>
<h2 class="text-4xl font-bold mt-2 mb-4">硬性验证,避免复合故障</h2>
<p class="text-gray-600">在关键节点设置硬性验证,确保每一步的错误不扩散</p>
</div>
<div class="grid md:grid-cols-2 lg:grid-cols-4 gap-6">
<!-- Node 1 -->
<div class="bg-white rounded-2xl p-6 shadow-sm border-t-4 border-purple-500">
<div class="w-12 h-12 bg-purple-100 rounded-xl flex items-center justify-center mb-4">
<span class="text-2xl font-bold text-purple-600">1</span>
</div>
<h4 class="font-bold text-lg mb-2">工具链完整性</h4>
<p class="text-sm text-gray-600 mb-3">验证交叉编译器可生成正确的 riscv64 可执行文件</p>
<div class="code-block bg-gray-900 p-2 text-xs rounded">
<code class="text-green-400">file /tmp/test<br><span class="text-gray-400"># ELF 64-bit RISC-V</span></code>
</div>
</div>
<!-- Node 2 -->
<div class="bg-white rounded-2xl p-6 shadow-sm border-t-4 border-blue-500">
<div class="w-12 h-12 bg-blue-100 rounded-xl flex items-center justify-center mb-4">
<span class="text-2xl font-bold text-blue-600">2</span>
</div>
<h4 class="font-bold text-lg mb-2">Chroot 环境</h4>
<p class="text-sm text-gray-600 mb-3">验证可以进入目标系统并运行基本命令</p>
<div class="code-block bg-gray-900 p-2 text-xs rounded">
<code class="text-green-400">chroot "${CLFS}" \
/tools/bin/bash \
-c "gcc --version"</code>
</div>
</div>
<!-- Node 3 -->
<div class="bg-white rounded-2xl p-6 shadow-sm border-t-4 border-green-500">
<div class="w-12 h-12 bg-green-100 rounded-xl flex items-center justify-center mb-4">
<span class="text-2xl font-bold text-green-600">3</span>
</div>
<h4 class="font-bold text-lg mb-2">系统启动</h4>
<p class="text-sm text-gray-600 mb-3">使用单用户模式验证系统可正常启动</p>
<div class="code-block bg-gray-900 p-2 text-xs rounded">
<code class="text-green-400">qemu-system-riscv64 ...<br>-append "init=/bin/sh"</code>
</div>
</div>
<!-- Node 4 -->
<div class="bg-white rounded-2xl p-6 shadow-sm border-t-4 border-orange-500">
<div class="w-12 h-12 bg-orange-100 rounded-xl flex items-center justify-center mb-4">
<span class="text-2xl font-bold text-orange-600">4</span>
</div>
<h4 class="font-bold text-lg mb-2">服务管理</h4>
<p class="text-sm text-gray-600 mb-3">验证关机/重启命令可正确触发内核关机</p>
<div class="code-block bg-gray-900 p-2 text-xs rounded">
<code class="text-green-400">reboot<br>poweroff<br><span class="text-gray-400"># 应正常关机</span></code>
</div>
</div>
</div>
</div>
</section>
<!-- Roadmap Section -->
<section id="roadmap" class="py-20 bg-white">
<div class="max-w-6xl mx-auto px-4">
<div class="text-center mb-16">
<span class="text-purple-600 font-semibold">🗺️ 主线执行</span>
<h2 class="text-4xl font-bold mt-2 mb-4">glibc + systemd 执行路径</h2>
<p class="text-gray-600 max-w-2xl mx-auto">
不再做多路线分流。新人统一按 <strong>glibc + systemd</strong> 主线推进,
完成构建、验证与提交后即可进入后续协作。
</p>
</div>
<div class="grid md:grid-cols-4 gap-4 mb-8">
<a href="ROADMAP.md" class="bg-gray-50 rounded-xl p-4 border border-gray-200 hover:border-purple-300 hover:shadow-sm transition-all">
<div class="text-xs text-gray-500 mb-1">Step 1</div>
<div class="font-semibold">确认主线要求</div>
<div class="text-xs text-gray-500 mt-1">先看 ROADMAP</div>
</a>
<a href="readme.md" class="bg-gray-50 rounded-xl p-4 border border-gray-200 hover:border-purple-300 hover:shadow-sm transition-all">
<div class="text-xs text-gray-500 mb-1">Step 2</div>
<div class="font-semibold">执行三段构建</div>
<div class="text-xs text-gray-500 mt-1">按 readme.md</div>
</a>
<a href="#faq" class="bg-gray-50 rounded-xl p-4 border border-gray-200 hover:border-purple-300 hover:shadow-sm transition-all">
<div class="text-xs text-gray-500 mb-1">Step 3</div>
<div class="font-semibold">节点排障验证</div>
<div class="text-xs text-gray-500 mt-1">FAQ + 速查表</div>
</a>
<a href="#template" class="bg-gray-50 rounded-xl p-4 border border-gray-200 hover:border-purple-300 hover:shadow-sm transition-all">
<div class="text-xs text-gray-500 mb-1">Step 4</div>
<div class="font-semibold">按模板提交</div>
<div class="text-xs text-gray-500 mt-1">模板 + Checklist</div>
</a>
</div>
<div class="max-w-3xl mx-auto">
<div class="route-card recommended bg-white rounded-2xl shadow-lg overflow-hidden">
<div class="h-2 bg-gradient-to-r from-purple-500 to-pink-500"></div>
<div class="p-8">
<div class="flex items-center justify-between mb-4">
<span class="text-4xl">🏭</span>
<span class="px-3 py-1 bg-purple-100 text-purple-700 rounded-full text-sm font-semibold">
新人唯一主线
</span>
</div>
<h3 class="text-2xl font-bold mb-2">glibc + systemd</h3>
<div class="flex items-center text-sm text-gray-600 mb-6">
<i class="far fa-clock mr-2"></i>预计 3-5 天
</div>
<ul class="space-y-3 mb-6 text-sm">
<li class="flex items-center"><i class="fas fa-check text-green-500 mr-2"></i>glibc 2.40+(核心 C 库)</li>
<li class="flex items-center"><i class="fas fa-check text-green-500 mr-2"></i>systemd(主线初始化系统)</li>
<li class="flex items-center"><i class="fas fa-check text-green-500 mr-2"></i>GNU coreutils + bash + util-linux</li>
<li class="flex items-center"><i class="fas fa-check text-green-500 mr-2"></i>完成后可直接进入开发协作</li>
</ul>
<div class="pt-6 border-t text-sm text-gray-600">
历史提交中的其他技术栈仅作参考,不作为新人要求。
</div>
</div>
</div>
</div>
</div>
</section>
<!-- FAQ Section -->
<section id="faq" class="py-20 bg-gray-50">
<div class="max-w-4xl mx-auto px-4">
<div class="text-center mb-12">
<span class="text-purple-600 font-semibold">❓ 常见问题</span>
<h2 class="text-4xl font-bold mt-2 mb-4">遇到问题?这里有答案</h2>
<p class="text-gray-600">精选 20+ 个常见问题,基于历届试炼者的实际踩坑经验整理</p>
</div>
<div class="space-y-4">
<!-- FAQ Item 1 -->
<div class="bg-white rounded-xl shadow-sm overflow-hidden">
<button class="faq-toggle w-full px-6 py-4 text-left flex items-center justify-between hover:bg-gray-50 transition-colors">
<div class="flex items-center space-x-3">
<span class="w-8 h-8 bg-purple-100 rounded-lg flex items-center justify-center text-purple-600 font-bold text-sm">Q1</span>
<span class="font-semibold">VFS: unable to mount root fs</span>
</div>
<i class="fas fa-chevron-down text-gray-400 transform transition-transform"></i>
</button>
<div class="faq-content hidden px-6 pb-4">
<div class="pl-11 text-gray-600 space-y-3">
<p><strong>原因:</strong>内核缺少 VirtIO 块设备驱动,或 root= 参数与设备名不匹配</p>
<div class="code-block p-3 text-sm">
<code>
<span class="text-green-400"># 确保内核配置包含:</span><br>
CONFIG_VIRTIO_BLK=y<br>
CONFIG_VIRTIO_PCI=y<br><br>
<span class="text-green-400"># 检查 QEMU 参数,确保设备名匹配:</span><br>
-append "root=/dev/vda rw"
</code>
</div>
</div>
</div>
</div>
<!-- FAQ Item 2 -->
<div class="bg-white rounded-xl shadow-sm overflow-hidden">
<button class="faq-toggle w-full px-6 py-4 text-left flex items-center justify-between hover:bg-gray-50 transition-colors">
<div class="flex items-center space-x-3">
<span class="w-8 h-8 bg-purple-100 rounded-lg flex items-center justify-center text-purple-600 font-bold text-sm">Q2</span>
<span class="font-semibold">Chroot 后 "Exec format error"</span>
</div>
<i class="fas fa-chevron-down text-gray-400 transform transition-transform"></i>
</button>
<div class="faq-content hidden px-6 pb-4">
<div class="pl-11 text-gray-600 space-y-3">
<p><strong>原因:</strong>qemu-riscv64-static 未复制到 chroot 环境,或 binfmt_misc 未注册</p>
<div class="code-block p-3 text-sm">
<code>
<span class="text-green-400"># 1. 复制 QEMU 解释器</span><br>
cp /usr/bin/qemu-riscv64-static ${CLFS}/usr/bin/<br><br>
<span class="text-green-400"># 2. 注册 binfmt_misc</span><br>
sudo update-binfmts --enable qemu-riscv64
</code>
</div>
</div>
</div>
</div>
<!-- FAQ Item 3 -->
<div class="bg-white rounded-xl shadow-sm overflow-hidden">
<button class="faq-toggle w-full px-6 py-4 text-left flex items-center justify-between hover:bg-gray-50 transition-colors">
<div class="flex items-center space-x-3">
<span class="w-8 h-8 bg-purple-100 rounded-lg flex items-center justify-center text-purple-600 font-bold text-sm">Q3</span>
<span class="font-semibold">systemd 启动后进入 emergency mode</span>
</div>
<i class="fas fa-chevron-down text-gray-400 transform transition-transform"></i>
</button>
<div class="faq-content hidden px-6 pb-4">
<div class="pl-11 text-gray-600 space-y-3">
<p><strong>原因:</strong>常见于 <code>/etc/fstab</code>、<code>root=</code> 参数或关键挂载点不一致</p>
<div class="code-block p-3 text-sm">
<code>
<span class="text-green-400"># 检查失败单元与启动错误</span><br>
systemctl --failed<br>
journalctl -b -p err<br><br>
<span class="text-green-400"># 核对设备与 fstab</span><br>
lsblk -f<br>
cat /etc/fstab
</code>
</div>
</div>
</div>
</div>
<!-- FAQ Item 4 -->
<div class="bg-white rounded-xl shadow-sm overflow-hidden">
<button class="faq-toggle w-full px-6 py-4 text-left flex items-center justify-between hover:bg-gray-50 transition-colors">
<div class="flex items-center space-x-3">
<span class="w-8 h-8 bg-purple-100 rounded-lg flex items-center justify-center text-purple-600 font-bold text-sm">Q4</span>
<span class="font-semibold">程序提示 "not found" 但文件存在</span>
</div>
<i class="fas fa-chevron-down text-gray-400 transform transition-transform"></i>
</button>
<div class="faq-content hidden px-6 pb-4">
<div class="pl-11 text-gray-600 space-y-3">
<p><strong>原因:</strong>通常是 ELF 解释器路径与 rootfs 中链接器不匹配</p>
<div class="code-block p-3 text-sm">
<code>
<span class="text-green-400"># 排查解释器路径</span><br>
readelf -l /bin/ls | grep interpreter<br><br>
<span class="text-green-400"># 确认 glibc 链接器存在</span><br>
ls ${CLFS}/lib/ld-linux-riscv64*.so.1
</code>
</div>
</div>
</div>
</div>
<!-- FAQ Item 5 -->
<div class="bg-white rounded-xl shadow-sm overflow-hidden">
<button class="faq-toggle w-full px-6 py-4 text-left flex items-center justify-between hover:bg-gray-50 transition-colors">
<div class="flex items-center space-x-3">
<span class="w-8 h-8 bg-purple-100 rounded-lg flex items-center justify-center text-purple-600 font-bold text-sm">Q5</span>
<span class="font-semibold">程序运行崩溃 / glibc 2.42 兼容性问题</span>
</div>
<i class="fas fa-chevron-down text-gray-400 transform transition-transform"></i>
</button>
<div class="faq-content hidden px-6 pb-4">
<div class="pl-11 text-gray-600 space-y-3">
<p><strong>原因:</strong>glibc 2.42 需要 QEMU 支持 termios2,否则程序会崩溃</p>
<div class="code-block p-3 text-sm">
<code>
<span class="text-green-400"># 检查 QEMU 版本</span><br>
qemu-system-riscv64 --version<br><br>
<span class="text-green-400"># 解决方案:</span><br>
<span class="text-yellow-400"># 1. 升级到 QEMU 10.1.2+</span><br>
<span class="text-yellow-400"># 2. 或使用打补丁的版本</span><br>
<span class="text-yellow-400"># 3. 临时降级 glibc 到 2.40</span>
</code>
</div>
</div>
</div>
</div>
<!-- FAQ Item 6 -->
<div class="bg-white rounded-xl shadow-sm overflow-hidden">
<button class="faq-toggle w-full px-6 py-4 text-left flex items-center justify-between hover:bg-gray-50 transition-colors">
<div class="flex items-center space-x-3">
<span class="w-8 h-8 bg-purple-100 rounded-lg flex items-center justify-center text-purple-600 font-bold text-sm">Q6</span>
<span class="font-semibold">进入 chroot 后黑屏一片</span>
</div>
<i class="fas fa-chevron-down text-gray-400 transform transition-transform"></i>
</button>
<div class="faq-content hidden px-6 pb-4">
<div class="pl-11 text-gray-600 space-y-3">
<p><strong>原因:</strong>没有安装可用 shell(推荐 bash)</p>
<div class="code-block p-3 text-sm">
<code>
<span class="text-green-400"># 先检查 shell 是否存在</span><br>
test -x ${CLFS}/bin/bash || test -x ${CLFS}/bin/sh || echo "缺少 shell"<br><br>
<span class="text-green-400"># 确保 /bin/sh 指向可用 shell</span><br>
ln -sf bash ${CLFS}/bin/sh
</code>
</div>
</div>
</div>
</div>
<!-- FAQ Item 7 -->
<div class="bg-white rounded-xl shadow-sm overflow-hidden">
<button class="faq-toggle w-full px-6 py-4 text-left flex items-center justify-between hover:bg-gray-50 transition-colors">
<div class="flex items-center space-x-3">
<span class="w-8 h-8 bg-purple-100 rounded-lg flex items-center justify-center text-purple-600 font-bold text-sm">Q7</span>
<span class="font-semibold">内核启动后黑屏/无输出</span>
</div>
<i class="fas fa-chevron-down text-gray-400 transform transition-transform"></i>
</button>
<div class="faq-content hidden px-6 pb-4">
<div class="pl-11 text-gray-600 space-y-3">
<p><strong>原因:</strong>内核未启用串口控制台,或设备树不匹配</p>
<div class="code-block p-3 text-sm">
<code>
<span class="text-green-400"># 确保内核配置包含</span><br>
CONFIG_SERIAL_8250=y<br>
CONFIG_SERIAL_8250_CONSOLE=y<br>
CONFIG_HVC_RISCV_SBI=y<br><br>
<span class="text-green-400"># 启动参数添加 earlycon</span><br>
-append "earlycon=sbi console=ttyS0"
</code>
</div>
</div>
</div>
</div>
<!-- FAQ Item 8 -->
<div class="bg-white rounded-xl shadow-sm overflow-hidden">
<button class="faq-toggle w-full px-6 py-4 text-left flex items-center justify-between hover:bg-gray-50 transition-colors">
<div class="flex items-center space-x-3">
<span class="w-8 h-8 bg-purple-100 rounded-lg flex items-center justify-center text-purple-600 font-bold text-sm">Q8</span>
<span class="font-semibold">chroot 中 systemctl 报 “Failed to connect to bus”</span>
</div>
<i class="fas fa-chevron-down text-gray-400 transform transition-transform"></i>
</button>
<div class="faq-content hidden px-6 pb-4">
<div class="pl-11 text-gray-600 space-y-3">
<p><strong>原因:</strong>chroot 环境下 PID 1 通常不是 systemd,这属于预期行为</p>
<div class="code-block p-3 text-sm">
<code>
<span class="text-green-400"># 在正式启动后的目标系统中验证</span><br>
ps -p 1 -o comm=<br>
systemctl status<br>
systemctl list-units --type=service --state=running | head
</code>
</div>
</div>
</div>
</div>
<!-- FAQ Item 9 -->
<div class="bg-white rounded-xl shadow-sm overflow-hidden">
<button class="faq-toggle w-full px-6 py-4 text-left flex items-center justify-between hover:bg-gray-50 transition-colors">
<div class="flex items-center space-x-3">
<span class="w-8 h-8 bg-purple-100 rounded-lg flex items-center justify-center text-purple-600 font-bold text-sm">Q9</span>
<span class="font-semibold">util-linux 安装报错 "chgrp: Operation not permitted"</span>
</div>
<i class="fas fa-chevron-down text-gray-400 transform transition-transform"></i>
</button>
<div class="faq-content hidden px-6 pb-4">
<div class="pl-11 text-gray-600 space-y-3">
<p><strong>原因:</strong>安装脚本尝试修改文件组,某些环境下权限不足</p>
<div class="code-block p-3 text-sm">
<code>
<span class="text-green-400"># 检查必要工具是否已安装</span><br>
ls -l ${CLFS}/bin/mount<br>
ls -l ${CLFS}/sbin/agetty<br><br>
<span class="text-yellow-400"># 如果都存在,可忽略 chgrp 错误</span>
</code>
</div>
</div>
</div>
</div>
<!-- FAQ Item 10 -->