備注:之前看文檔,一直以為要ssh的密鑰之類的,實際不需要;
一、目的:1、熟悉目錄結構;2、掌握編譯方法;3、記錄編譯過程;4、掌握燒寫方法;
二、步驟:
1、獲取下載包
rv1126_rv1109_linux_v1.8.0_20210224.tar
2、解壓
mkdir rv1126
tar xvf rv1126_rv1109_linux_v1.8.0_20210224.tar
cd rv1126
3、編譯環境搭建(大約要3-4h)
sudo apt-get install repo device-tree-compiler git-core u-boot-tools mtools parted libudev-dev libusb-1.0-0-dev python-linaro-image-tools linaro-image-tools autoconf autotools-dev libsigsegv2 m4 intltool libdrm-dev curl sed make binutils build-essential gcc g++ bash patch gzip gawk bzip2 perl tar cpio python unzip rsync file bc wget libncurses5 libqt4-dev libglib2.0-dev libgtk2.0-dev libglade2-dev cvs git mercurial openssh-client subversion asciidoc w3m dblatex graphviz python-matplotlib libc6:i386 libssl-dev expect fakeroot cmake flex bison liblz4-tool libtool keychain;
3.1遇到錯誤(解決方法,刪除鎖定文件:sudo rm /var/lib/dpkg/lock-frontend ;sudo rm /var/lib/dpkg/lock)
【
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
】
4、SDK下載--->本地解壓的方式,不需要從網絡下載(跳過此步)
repo init --repo-url ssh://git@www.rockchip.com.cn/repo/rk/tools/repo -u ssh://git@www.rockchip.com.cn/linux/rk/platform/manifests -b linux -m rv1126_rv1109_linux_release.xml
4.1遇到的錯誤
【The authenticity of host 'www.rockchip.com.cn (58.22.7.114)' can't be established.
ECDSA key fingerprint is SHA256:veOzrhgNGlRJJyd8jnHIsazEzt1CDJ0NZ3Dfq6gODRM.
Are you sure you want to continue connecting (yes/no)? Host key verification failed.
The authenticity of host 'www.rockchip.com.cn (58.22.7.114)' can't be established.
ECDSA key fingerprint is SHA256:veOzrhgNGlRJJyd8jnHIsazEzt1CDJ0NZ3Dfq6gODRM.
Are you sure you want to continue connecting (yes/no)? yes】
5、SDK本地獲取
.repo/repo/repo sync -l //獲取
.repo/repo/repo sync -c //更新
6、查看SDK版本:realpath .repo/manifests/rv1126_rv1109_linux_release.xml
7、為每個工程創建default 分支 :.repo/repo/repo start default --all(沒明白含義)
8、切換板級配置命令:./build.sh lunch
9、中間編譯rootfs時,遇到一個linux HEAD downloading,一直在downloading;
--->依據文檔,手動配置下文件系統,實際啥都沒配,編譯通過(正確的解決方法:需要手動把linux.HEAD.tar相關的包放到buildroot/dl目錄下);
10、重新編譯一次,遇到一個問題:host-gettext-0.19.8.1編譯不過去,后續是直接去掉了dl目錄下的gettext-0.19.8.1.tar.xz文件,不編譯這個選項了/或者把編譯的host-gettext-0.19.8.1拷到recovery目錄下(這個地方有點不清晰,弄明白了,編譯ncurses-6.1庫的時候,需要依據下述的方法去配置configure #CFLAGS="-O3 -fPIC" ./configure make make install
);
11、燒寫程序,需要加載新的設備驅動;
12、g++: internal compiler error: Killed (program cc1plus)----》編譯庫文件時,make -j12 遇到這個錯誤,應該是虛擬機內存不足導致的,編譯參數改成make -j6可正編譯通過