本文來源電子發(fā)燒友社區(qū),作者:TLLED, 帖子地址:https://bbs.elecfans.com/jishu_2303430_1_1.html
按照教程來搭建開發(fā)編譯環(huán)境,使用ubuntu 18.04 64位虛擬機(jī)。
1、安裝工具包
1.1、將setup_env.sh復(fù)制到ubuntu系統(tǒng)目錄下
1.2、查看下setup_env.sh內(nèi)容
1.3、運(yùn)行命令
root@ubuntu:/home/a40i# chmod +x setup_env.sh
root@ubuntu:/home/a40i# ./setup_env.sh
等待安裝完成
1.4、升級gcc
更改之前GCC版本
執(zhí)行命令
安裝依賴包
root@ubuntu:/home/a40i# sudo apt-get install libgmp-dev
root@ubuntu:/home/a40i# sudo apt-get install libmpfr4 libmpfr-dev
root@ubuntu:/home/a40i# sudo apt-get install libmpc-dev libmpc2
root@ubuntu:/home/a40i# sudo apt-get install libtool
root@ubuntu:/home/a40i# sudo apt-get install bison
root@ubuntu:/home/a40i# sudo apt-get install flex
安裝gcc4.8.1
root@ubuntu:/home/a40i# sudo add-apt-repository ppa:ubuntu-toolchain-r/test
root@ubuntu:/home/a40i# sudo apt-get update
root@ubuntu:/home/a40i# sudo apt-get install gcc-4.8
root@ubuntu:/home/a40i# sudo apt-get install g++-4.8
root@ubuntu:/home/a40i# sudo apt-get install gcc-4.8-multilib
root@ubuntu:/home/a40i# sudo apt-get install g++-4.8-multilib
root@ubuntu:/home/a40i# sudo apt-get install gcc-4.8-doc
root@ubuntu:/home/a40i# sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20
root@ubuntu:/home/a40i# sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20
root@ubuntu:/home/a40i# sudo update-alternatives --config gcc
root@ubuntu:/home/a40i# sudo update-alternatives --config g++
root@ubuntu:/home/a40i# sudo apt-get update
更改之后GCC版本
1.5、將busybox.tar.gz文件復(fù)制到ubuntu下
解壓文件
root@ubuntu:/home/a40i# tar xvf busybox.tar.gz -C /usr/bin/
二、編譯內(nèi)核
2.1、復(fù)制文件
將內(nèi)核源碼復(fù)制到ubuntu
執(zhí)行命令
root@ubuntu:/home/a40i# cp /mnt/hgfs/share/a40i/xa* /home/a40i/
2.2、解壓文件
執(zhí)行命令
root@ubuntu:/home/a40i# cat xa* > lichee.tar.gz
root@ubuntu:/home/a40i# tar xvf lichee.tar.gz
解壓后的文件
解壓文件系統(tǒng)
root@ubuntu:/home/a40i/lichee# tar xvf rootfs-a40i.tar.gz
2.3、配置編譯選項
執(zhí)行命令:hui@ubuntu:/home/a40i/lichee$ sudo ./build.sh config
2.4、編譯內(nèi)核
命令:hui@ubuntu:/home/a40i/lichee$ sudo ./build.sh -m kernel
編譯過程中提示報錯
執(zhí)行命令:hui@ubuntu:/home/a40i/lichee$ sudo apt-get install u-boot-tools
繼續(xù)編譯,編譯內(nèi)核成功
2.5、文件系統(tǒng)打包
對壓縮的文件系統(tǒng)進(jìn)行打包處理
hui@ubuntu:/home/a40i/lichee$ sudo ./build.sh -m pack_rootfs
2.6、鏡像打包
對上面編譯的完成的文件進(jìn)行鏡像打包,生成鏡像文件
hui@ubuntu:/home/a40i/lichee$ sudo ./build.sh pack
-
飛凌
+關(guān)注
關(guān)注
0文章
135瀏覽量
16408
發(fā)布評論請先 登錄
5分鐘學(xué)會網(wǎng)絡(luò)服務(wù)搭建!飛凌i.MX9352開發(fā)板 + Linux 6.1實戰(zhàn)示例

【米爾-全志T536開發(fā)板試用體驗】- 開發(fā)環(huán)境搭建與測試

支持OpenHarmony操作系統(tǒng)!飛凌OK527N-C開發(fā)板免費(fèi)試用 #開發(fā)板試用 #HarmonyOS
有獎丨米爾 NXP i.MX91開發(fā)板免費(fèi)試用來啦

5分鐘學(xué)會網(wǎng)絡(luò)服務(wù)搭建,飛凌i.MX9352 + Linux 6.1實戰(zhàn)示例

3.1s啟動!飛凌嵌入式i.MX93開發(fā)板部署LVGL,打造更高效的GUI

【飛凌嵌入式OK3588J-C開發(fā)板體驗】OK3588J-C開發(fā)板開箱評測
【AG32開發(fā)板體驗連載】AG32開發(fā)板初體驗-項目概述
【龍芯2K0300蜂鳥板試用】龍芯2K0300蜂鳥開發(fā)板開發(fā)環(huán)境搭建
linux開發(fā)板如何編譯curl
【飛凌嵌入式OK3576-C開發(fā)板體驗】應(yīng)用編譯運(yùn)行
【飛凌嵌入式OK3576-C開發(fā)板體驗】開箱報告
SemiDrive X9 AI 開發(fā)環(huán)境搭建

評論