8,460
个编辑
更改
→在开发板的linux系统中单独编译内核源码的方法
<ol start="2" style="list-style-type: decimal;">
<li><p>然后配置下默认的内核配置</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''cd linux-orangepi'''</p>
<p>orangepi@orangepi:~/linux-orangepi$ '''make rockchip_linux_defconfig'''</p>|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| </libig></ol> '''rockchip_linux_defconfig在内核源码中的路径为arch/arm64/configs/'''</big>|}</li></ol>
<ol start="3" style="list-style-type: decimal;">
<li><p>然后编译内核源码</p>
{| class="wikitable" style="width:800px;" |-|<p>orangepi@orangepi:~/linux-orangepi$ '''make -j10'''</p>|}</li>
<li><p>然后安装下内核模块</p>
{| class="wikitable" style="width:800px;" |-|<p>orangepi@orangepi:~/linux-orangepi$ '''sudo make modules_install'''</p>|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''内核模块的安装路径为:/li><lib/ol>modules'''
'''执行完sudo make modules_install命令后可以看到/lib/modules/下会多了一个内核模块的文件夹:'''
orangepi@orangepi5plus:~$ '''ls /lib/modules'''
'''<span style="color:#FF0000">5.10.110+</span>''' 5.10.110-rockchip-rk3588</big>|}</li></ol>
<ol start="5" style="list-style-type: decimal;">
<li><p>然后安装内核镜像和uInitrd</p>
{| class="wikitable" style="width:800px;" |-|<p>orangepi@orangepi:~/linux-orangepi$ '''sudo make install'''</p>|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| </li></olbig> '''内核镜像和uInitrd的安装路径为:/boot/'''
'''执行完 sudo make install命令后可以看到/boot/下会多了一个内核文件:'''
orangepi@orangepi5plus:~/orange-pi-5.10-rk3588$ '''ls /boot/vmlinuz*'''
'''<span style="color:#FF0000">/boot/vmlinuz-5.10.110+</span>''' /boot/vmlinuz-5.10.110-rockchip-rk3588<br />
<br />
'''系统启动时实际加载的是/boot/Image这个文件,Image是vmlinuz文件的拷贝。'''</big>|}</li></ol>
<ol start="6" style="list-style-type: decimal;">
<li><p>然后安装dtb文件到'''/boot/dtb'''中</p>
{| class="wikitable" style="width:800px;" |-|<p>orangepi@orangepi:~/linux-orangepi$ '''sudo make dtbs_install INSTALL_DTBS_PATH=/boot/dtb/'''</p>|}</li>
<li><p>然后重启Linux系统就会加载新编译的内核了</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''uname -r'''</p>
<p>'''5.10.110+'''</p>|}</li></ol>
<span id="openwrt系统使用说明"></span>