2023-07-12 內(nèi)核開發(fā)環(huán)境 概念 工具鏈 編譯 安裝

安裝 toolchains 主要是gcc 和 make? 其他的缺什么安什么

sudo apt install gcc binutils


aarch64-linux-gnu-gcc --version?

gcc --version

下載源碼:? https://git.kernel.org/pub/scm/linux/kernel/git/

cd /usr/src

git clone https://kernel.googlesource.com/pub/scm/linux/kernel/git/mmind/linux-rockchip? ?????????沒開梯子 訪問不了。。。。

git clone https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git? ????????很慢,100多k每秒。。。。

https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git/snapshot/linux-rockchip-6.5-rc1.tar.gz? ? ? ?直接瀏覽器下載,幾M每秒

然后ftp linux? , put過去 ,然后 tar -zxvf .......

ssh -2 yang@192.168.0.105

you can use make menuconfig for a ncurses-based interface or make xconfig for an X-based interface

The kernel configuration command, given a default configuration file, is as follows:

make <foo_defconfig>

This will generate a new .config file in the main (root) directory, while the

old .config will be renamed .config.old. This can be useful to revert the

previous configuration changes. Then, to customize the configuration, you can use the

following command:

make menuconfig

16 Introduction to Kernel Development

Saving your changes will update your .config file. While you could share this config

with your teammates, you are better off creating a default configuration file in the same

minimal format as those shipped with the Linux kernel sources. To do that, you can use

the following command:

make savedefconfig

This command will create a minimal (since it won't store non-default settings)

configuration file. The generated default configuration file will be called defconfig

and stored at the root of the source tree. You can store it in another location using the

following command:

mv defconfig arch/<arch>/configs/myown_defconfig

This way, you can share a reference configuration inside the kernel sources and

other developers can now get the same .config file as you by running the

following command:

make myown_defconfig


獲取本機(jī)配置文件? ?cp /boot/config-`uname -r` .config? 或者?zcat /proc/config.gz

cp /boot/config-`uname -r` .config? ? ? ? #在本機(jī)配置的基礎(chǔ)上修改配置文件

make menuconfig

make -j8 #8核心一起工作

apt? ?install libssl-dev?


2個(gè)多小時(shí),編譯完成

安裝內(nèi)核,本地安裝? make install

報(bào)錯(cuò) 找不到6.5的頭文件。。。。

make headers_install ????#error: rsync , apt install rsync ,繼續(xù)?headers_install ????成功;??

make install? #機(jī)子直接重啟。。。。。。apt update ,apt upgrade ,在升級了一個(gè)initramfs 什么的 可能,再來就不崩潰重啟 還是報(bào)錯(cuò),好像是無線網(wǎng)卡驅(qū)動(dòng)不支持?

亂搞哦,,,,,,,,,


make modules? ?

make modules_install? #沒報(bào)錯(cuò)。。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容