Toybrick

RK3399ProD编译Linux内核源码

snsing

注册会员

积分
94
楼主
发表于 2019-8-29 08:48:47    查看: 17994|回复: 10 | [复制链接]    打印 | 只看该作者
本帖最后由 snsing 于 2019-8-29 20:16 编辑

各位大咖,我下载了你们RK3399ProD的内核源码:https://github.com/rockchip-toybrick/kernel,想单独编译linux的内核,执行./make.sh linux prod命令,报错.在论坛里面和下载资料都没有找到一个知道文档,劳驾帮忙看看,谢谢。

命令:./make.sh linux prod
#
# configuration written to .config
#
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  HOSTCC  scripts/extract-cert
  CC      scripts/mod/empty.o
  CC      scripts/mod/devicetable-offsets.s
  CHK     include/generated/utsrelease.h
gcc: error: unrecognized command line option '-mlittle-endian'
gcc: error: unrecognized command line option '-mgeneral-regs-only'
make[2]: *** [scripts/mod/empty.o] 错误 1
make[2]: *** 正在等待未完成的任务....
gcc: error: unrecognized command line option '-mlittle-endian'
gcc: error: unrecognized command line option '-mgeneral-regs-only'
make[2]: *** [scripts/mod/devicetable-offsets.s] 错误 1
make[1]: *** [scripts/mod] 错误 2
  CHK     include/generated/timeconst.h
make[1]: *** 正在等待未完成的任务....
  CC      kernel/bounds.s
scripts/extract-cert.c:21:25: fatal error: openssl/bio.h: 没有那个文件或目录
#include <openssl/bio.h>
                         ^
compilation terminated.
gcc: error: unrecognized command line option '-mlittle-endian'
gcc: error: unrecognized command line option '-mgeneral-regs-only'
make[1]: *** [kernel/bounds.s] 错误 1
make: *** [prepare0] 错误 2
make: *** 正在等待未完成的任务....
make[1]: *** [scripts/extract-cert] 错误 1
make: *** [scripts] 错误 2
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  HOSTCC  scripts/extract-cert
  CC      scripts/mod/empty.o
  CHK     include/generated/utsrelease.h
  CC      scripts/mod/devicetable-offsets.s
gcc: error: unrecognized command line option '-mlittle-endian'
gcc: error: unrecognized command line option '-mgeneral-regs-only'
make[2]: *** [scripts/mod/empty.o] 错误 1
make[2]: *** 正在等待未完成的任务....
gcc: error: unrecognized command line option '-mlittle-endian'
gcc: error: unrecognized command line option '-mgeneral-regs-only'
make[2]: *** [scripts/mod/devicetable-offsets.s] 错误 1
make[1]: *** [scripts/mod] 错误 2
make[1]: *** 正在等待未完成的任务....
  CHK     include/generated/timeconst.h
  CC      kernel/bounds.s
scripts/extract-cert.c:21:25: fatal error: openssl/bio.h: 没有那个文件或目录
#include <openssl/bio.h>
                         ^
compilation terminated.
gcc: error: unrecognized command line option '-mlittle-endian'
gcc: error: unrecognized command line option '-mgeneral-regs-only'
make[1]: *** [kernel/bounds.s] 错误 1
make: *** [prepare0] 错误 2
make: *** 正在等待未完成的任务....
make[1]: *** [scripts/extract-cert] 错误 1
make: *** [scripts] 错误 2
cp: 无法获取"arch/arm64/boot/dts/rockchip/rk3399pro-toybrick-prod-linux-edp.dtb" 的文件状态(stat): 没有那个文件或目录
cp: 无法获取"arch/arm64/boot/dts/rockchip/rk3399pro-toybrick-prod-linux-mipi.dtb" 的文件状态(stat): 没有那个文件或目录
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  HOSTCC  scripts/extract-cert
  CC      scripts/mod/empty.o
  CC      scripts/mod/devicetable-offsets.s
  CHK     include/generated/utsrelease.h
gcc: error: unrecognized command line option '-mlittle-endian'
gcc: error: unrecognized command line option '-mgeneral-regs-only'
gcc: error: unrecognized command line option '-mlittle-endian'
gcc: error: unrecognized command line option '-mgeneral-regs-only'
make[2]: *** [scripts/mod/devicetable-offsets.s] 错误 1
make[2]: *** 正在等待未完成的任务....
make[2]: *** [scripts/mod/empty.o] 错误 1
make[1]: *** [scripts/mod] 错误 2
make[1]: *** 正在等待未完成的任务....
  CHK     include/generated/timeconst.h
  CC      kernel/bounds.s
scripts/extract-cert.c:21:25: fatal error: openssl/bio.h: 没有那个文件或目录
#include <openssl/bio.h>
                         ^
compilation terminated.
gcc: error: unrecognized command line option '-mlittle-endian'
gcc: error: unrecognized command line option '-mgeneral-regs-only'
make[1]: *** [kernel/bounds.s] 错误 1
make: *** [prepare0] 错误 2
make: *** 正在等待未完成的任务....
make[1]: *** [scripts/extract-cert] 错误 1
make: *** [scripts] 错误 2
cp: 无法获取"arch/arm64/boot/dts/rockchip/rk3399pro-toybrick-prod-linux.dtb" 的文件状态(stat): 没有那个文件或目录
cp: 无法获取"arch/arm64/boot/dts/rockchip/rk3399pro-toybrick-prod-linux.dtb" 的文件状态(stat): 没有那个文件或目录
cp: 无法获取"arch/arm64/boot/Image" 的文件状态(stat): 没有那个文件或目录
sns@sns:/media/sns/videoV3/Toybrick_RK3399ProD/kernel/kernel-stable$

我看代码里面是没有arch/arm64/boot/dts/rockchip/rk3399pro-toybrick-prod-linux-edp.dtb和rch/arm64/boot/dts/rockchip/rk3399pro-toybrick-prod-linux.dtb文件。
但是make.sh是怎么打包到里面的?
另外这个make.sh也没有设置编译器,这个源码路径是不是不对,哪位大咖编译过,能给一份linux源码吗?




回复

使用道具 举报

snsing

注册会员

积分
94
来自 3#
 楼主| 发表于 2019-8-29 16:31:55 | 只看该作者
jefferyzhang 发表于 2019-8-29 16:07
gcc 是你自己电脑的编译器,
想编译在板子上跑的,需要用交叉编译环境,使用 aarch64-gcc ...

已经编辑通过,我想问问
2)烧写linux系统固件(单系统):
a) 烧写所有固件:
sudo ./flash.py -l all

b) 烧写uboot.img和trust.img:
sudo ./flash.py -l uboot

c) 烧写boot_linux.img:
sudo ./flash.py -l boot

d) 烧写rootfs.img:
sudo ./flash.py -l rootfs
rootfs.img 在哪里获得?
回复

使用道具 举报

snsing

注册会员

积分
94
来自 4#
 楼主| 发表于 2019-8-29 16:38:17 | 只看该作者
本帖最后由 snsing 于 2019-8-29 19:15 编辑
jefferyzhang 发表于 2019-8-29 16:07
gcc 是你自己电脑的编译器,
想编译在板子上跑的,需要用交叉编译环境,使用 aarch64-gcc ...
问题1:
命令
cd kernel
./make.sh linux prod
使用另外的编译器能够编译得到内核,但是在烧写时没有rootfs.img ,无法验证。
sns@sns:/media/sns/videoV3/RK3399ProD/linuxTool-v1.0$ sudo python ./flash.py -l all
Command: ./bin/flash.x86_64 UL  ./images/MiniLoaderAll.bin
Program Data in /media/sns/videoV3/RK3399ProD/linuxTool-v1.0/bin
Loading loader...
Support Type:RK330C        Loader ver:1.15        Loader Time:2019-05-14 09:19:58
Upgrade loader ok.
Command: ./bin/flash.x86_64 DI -p ./images//parameter-linux.txt
Program Data in /media/sns/videoV3/RK3399ProD/linuxTool-v1.0/bin
directlba=1,first4access=1,gpt=1
Write gpt...
Write gpt ok.
Command: ./bin/flash.x86_64 DI -uboot ./images/uboot.img ./images//parameter-linux.txt
Program Data in /media/sns/videoV3/RK3399ProD/linuxTool-v1.0/bin
directlba=1,first4access=1,gpt=1
Download uboot start...(0x00002000)
Download image ok.
Command: ./bin/flash.x86_64 DI -trust ./images/trust.img ./images//parameter-linux.txt
Program Data in /media/sns/videoV3/RK3399ProD/linuxTool-v1.0/bin
directlba=1,first4access=1,gpt=1
Download trust start...(0x00004000)
Download image ok.
Command: ./bin/flash.x86_64 DI -boot_linux ./images/boot_linux.img
Program Data in /media/sns/videoV3/RK3399ProD/linuxTool-v1.0/bin
directlba=1,first4access=1,gpt=1
Download boot_linux start...(0x00006000)
Download image ok.
Command: ./bin/flash.x86_64 DI -rootfs ./images/rootfs.img
Program Data in /media/sns/videoV3/RK3399ProD/linuxTool-v1.0/bin
check download item failed!
sns@sns:/media/sns/videoV3/RK3399ProD/linuxTool-v1.0$

问题2:
编译安卓的内核,将boot.img烧写能够成果,没有进入桌面就一直不停重启。
命令是:
cd kernel
./make.sh android prod
回复

使用道具 举报

jefferyzhang

版主

积分
12983
沙发
发表于 2019-8-29 16:07:26 | 只看该作者
gcc 是你自己电脑的编译器,
想编译在板子上跑的,需要用交叉编译环境,使用 aarch64-gcc
回复

使用道具 举报

jefferyzhang

版主

积分
12983
5#
发表于 2019-8-29 19:43:54 | 只看该作者
请在wiki上下载全套固件
回复

使用道具 举报

snsing

注册会员

积分
94
6#
 楼主| 发表于 2019-8-29 19:57:07 | 只看该作者
本帖最后由 snsing 于 2019-8-29 20:17 编辑
jefferyzhang 发表于 2019-8-29 19:43
请在wiki上下载全套固件

就是你们的固件包:http://t.rock-chips.com/portal.php?mod=list&catid=11&product_id=4解压后仅仅有:
/TB-RK3399ProD固件/image-TB-RK3399ProD-Release-V1.3/Release-V1.3/img/boot.img
/TB-RK3399ProD固件/image-TB-RK3399ProD-Release-V1.3/Release-V1.3/img/boot_linux.img
/TB-RK3399ProD固件/image-TB-RK3399ProD-Release-V1.3/Release-V1.3/img/kernel.img
/TB-RK3399ProD固件/image-TB-RK3399ProD-Release-V1.3/Release-V1.3/img/MiniLoaderAll.bin
/TB-RK3399ProD固件/image-TB-RK3399ProD-Release-V1.3/Release-V1.3/img/misc.img
/TB-RK3399ProD固件/image-TB-RK3399ProD-Release-V1.3/Release-V1.3/img/oem.img
/TB-RK3399ProD固件/image-TB-RK3399ProD-Release-V1.3/Release-V1.3/img/parameter.txt
/TB-RK3399ProD固件/image-TB-RK3399ProD-Release-V1.3/Release-V1.3/img/parameter-android.txt
/TB-RK3399ProD固件/image-TB-RK3399ProD-Release-V1.3/Release-V1.3/img/parameter-dual.txt
/TB-RK3399ProD固件/image-TB-RK3399ProD-Release-V1.3/Release-V1.3/img/parameter-linux.txt
/TB-RK3399ProD固件/image-TB-RK3399ProD-Release-V1.3/Release-V1.3/img/ramdisk.img
/TB-RK3399ProD固件/image-TB-RK3399ProD-Release-V1.3/Release-V1.3/img/recovery.img
/TB-RK3399ProD固件/image-TB-RK3399ProD-Release-V1.3/Release-V1.3/img/resource.img
/TB-RK3399ProD固件/image-TB-RK3399ProD-Release-V1.3/Release-V1.3/img/system.img
/TB-RK3399ProD固件/image-TB-RK3399ProD-Release-V1.3/Release-V1.3/img/trust.img
/TB-RK3399ProD固件/image-TB-RK3399ProD-Release-V1.3/Release-V1.3/img/uboot.img
/TB-RK3399ProD固件/image-TB-RK3399ProD-Release-V1.3/Release-V1.3/img/vendor.img

没有Linux的rootfs.img。
回复

使用道具 举报

jefferyzhang

版主

积分
12983
7#
发表于 2019-8-30 08:08:44 | 只看该作者
snsing 发表于 2019-8-29 19:57
就是你们的固件包:http://t.rock-chips.com/portal.php?mod=list&catid=11&product_id=4解压后仅仅有:
/ ...

往前个版本翻,可能是rootfs.img没有更新,他们就没重复上传了
回复

使用道具 举报

snsing

注册会员

积分
94
8#
 楼主| 发表于 2019-9-9 09:00:46 | 只看该作者
jefferyzhang 发表于 2019-8-30 08:08
往前个版本翻,可能是rootfs.img没有更新,他们就没重复上传了

可以了,谢谢
回复

使用道具 举报

lipandeng

注册会员

积分
134
QQ
9#
发表于 2020-5-5 15:18:00 | 只看该作者
snsing 发表于 2019-8-29 16:31
已经编辑通过,我想问问
2)烧写linux系统固件(单系统):
a) 烧写所有固件:

你好,请问怎么编译通过的阿,可否分享下
回复

使用道具 举报

NIELSONGOD

中级会员

积分
246
10#
发表于 2020-7-13 09:30:02 | 只看该作者

请问您的u-boot怎么编译生成trust.img文件的呀。我执行./make.sh trust 报错需要rkbin的SDK我下载了这个SDK仍然不行。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


快速回复 返回顶部 返回列表