编译全志A64内核

搭建好了一个最新系统-Ubuntu-22,制作全志A64镜像
开发板:全志helpera64
将V2.5文件夹的source目录下,lichee.tar.gz文件,拷贝到Ubuntu中。
首先安装32位的库文件

sudo apt-get install lib32z1
./arm-linux-gnueabi-gcc -v
./arm-linux-gnueabi-gcc: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

安装支持支持交叉编译器的库文件

sudo apt-get install libstdc++6-i386-cross

/************/
添加lib32成功,安装必要的编译工具

sudo apt-get install lib32stdc++6
sudo apt-get install make
sudo apt-get install fakeroot
sudo apt-get install gcc

(…查询资料

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 700 --slave /usr/bin/g++ g++ /usr/bin/g+±7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g+±8
如果你想改变使用的版本,那就运行一下这条命令吧,

sudo update-alternatives --config gcc


)

解决方案
下载gcc-9与g+±9

sudo apt install gcc-9 g++-9

将gcc g++版本都切换为9

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 100

通过 gcc -v 查看 切换成功

编译镜像

./build.sh clean

./build

出现错误
awk: line 2: function strtonum never defined
awk: line 2: function strtonum never defined

安装gawk

sudo apt-get install gawk

再次编译成功

INFO: build rootfs OK.
INFO: ----------------------------------------
INFO: build lichee OK.

lichee$ ls out/sun50iw1p1/dragonboard/common/
arisc  boot.img  buildroot  rootfs.ext4  sunxi.dtb  vmlinux.tar.bz2
lichee$ ls tools/buildroot/target/dragonboard/
build.sh  clean.sh  output  rootfs  rootfs.ext4  rootfs.tar.gz  src  sysroot  sysroot.tar.gz
book@book-virtual-machine:~/workspace/a64/lichee$

打包固件

book@book-virtual-machine:~/workspace/a64/lichee$ ./build.sh pack

Dragon execute image.cfg SUCCESS !
----------image is at----------

/home/book/workspace/a64/lichee/tools/pack/sun50iw1p1_dragonboard_v2_uart0.img

pack finish

你可能感兴趣的:(linux,kernel)