找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 2365|回复: 11

[Debian] 华北工控EMB-3531(RK3399) 编译新版本armbian

[复制链接]
本帖最后由 鲁棒棒 于 2023-4-26 23:35 编辑

这个板子的特点就是做工还行,大小适中,有pci-e,minipci-e,无论存储或者做路由器都有比较好的扩展空间。

恩山上其他人的帖子
https://www.right.com.cn/forum/f ... 01&highlight=rk3399

https://www.right.com.cn/forum/f ... light=rk3399&page=1
https://www.right.com.cn/forum/thread-8251255-1-1.html

但是,官方的armbian版本太老了,用的不爽,所以参考以下连接修改了一个脚本全自动编译。
把上面某个帖子里dts下载下来,重命名并存储到${WORK_DIR}/kernel/arch/arm64/boot/dts/rockchip/rock960-model-ab-linux.dts目录下
https://discuss.96boards.org/t/building-a-linux-5-kernel/7530/8


#!/bin/bash

LINUX_VERSION=${1:-5.8}
BASE_DIR=`readlink -f ${2:-.}`
echo "Using: ${LINUX_VERSION} into ${BASE_DIR}"
CURR_DIR=${PWD}
WORK_DIR=${BASE_DIR}/rock960_${LINUX_VERSION}
OUT_DIR=${WORK_DIR}/out
if [ ! -e ${WORK_DIR} ]; then
        mkdir -p ${WORK_DIR}
elif [ ! -d ${WORK_DIR} ]; then
                echo "${WORK_DIR} already exists but is not a directory" 1>&2
fi

if [ ! -e ${OUT_DIR} ]; then
        mkdir -p ${OUT_DIR}
elif [ ! -d ${OUT_DIR} ]; then
                echo "${OUT_DIR} already exists but is not a directory" 1>&2
fi


#mkdir -p ${WORK_DIR}
#mkdir -p ${OUT_DIR}
cd ${WORK_DIR}

sudo apt update
sudo apt-get install -y build-essential git libncurses5-dev libssl-dev make
sudo apt-get install -y bison device-tree-compiler flex gcc-arm-none-eabi mtools python
sudo apt-get remove -y apt-listchanges
sudo apt-get install -y zlib1g:i386

export ARCH=arm64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib/x86_64-linux-gnu
#if not exist

if [ ! -e ${WORK_DIR}/toolchain ]; then
                wget http://releases.linaro.org/compo ... 64-linux-gnu.tar.xz
    mkdir ${WORK_DIR}/toolchain
                tar -xf gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz -C ${WORK_DIR}/toolchain --strip-components=1
elif [ ! -d ${WORK_DIR}/toolchain ]; then
                echo "$dir already exists but is not a directory" 1>&2
fi

#wget http://releases.linaro.org/compo ... 64-linux-gnu.tar.xz
#mkdir ${WORK_DIR}/toolchain
#tar -xf gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz -C ${WORK_DIR}/toolchain --strip-components=1

folder=${WORK_DIR}/arm-trusted-firmware
url="https://github.com/ARM-software/arm-trusted-firmware.git"
if [ ! git clone --depth 1 ${url} ${folder} 2>/dev/null ] && [ -d ${folder} ] ; then
    echo "Clone failed because the folder ${folder} exists"
fi

#git clone --depth 1 https://github.com/ARM-software/arm-trusted-firmware.git
export CROSS_COMPILE=${WORK_DIR}/toolchain/bin/aarch64-linux-gnu-
cd ${WORK_DIR}/arm-trusted-firmware/
sudo make distclean
make CROSS_COMPILE=${WORK_DIR}/toolchain/bin/aarch64-linux-gnu- PLAT=rk3399

cd ${WORK_DIR}
folder=${WORK_DIR}/kernel
url="https://github.com/96rocks/kernel.git"
if [ ! git clone --branch release-4.4-rock960 --depth 1 ${url} ${folder} 2>/dev/null ] && [ -d ${folder} ] ; then
    echo "Clone failed because the folder ${folder} exists"
fi

#git clone --branch release-4.4-rock960 --depth 1 https://github.com/96rocks/kernel.git
cd ${WORK_DIR}/kernel
sudo make distclean
make rockchip_linux_defconfig
make Image dtbs -j$(nproc)
ls -l ${WORK_DIR}/kernel/arch/arm64/boot/dts/rockchip/rock960-model-ab-linux.dtb
cp ${WORK_DIR}/kernel/arch/arm64/boot/dts/rockchip/rock960-model-ab-linux.dtb ${OUT_DIR}/.

cd ${WORK_DIR}
folder=${WORK_DIR}/build
url="https://github.com/96rocks/build.git"
if [ ! git clone --depth 1 ${url} ${folder} 2>/dev/null ] && [ -d ${folder} ] ; then
    echo "Clone failed because the folder ${folder} exists"
fi
#git clone --depth 1 https://github.com/96rocks/build.git

if [ ! -e ${WORK_DIR}/out/kernel ]; then
    mkdir -p ${WORK_DIR}/out/kernel
elif [ ! -d ${WORK_DIR}/out/kernel ]; then
    echo "$dir already exists but is not a directory" 1>&2
fi

cd ${WORK_DIR}/out/kernel
#mkdir -p ${WORK_DIR}/out/kernel && cd ${WORK_DIR}/out/kernel
cp ${WORK_DIR}/kernel/arch/arm64/boot/Image .
cd ${WORK_DIR}/build
patch -p0 < ${CURR_DIR}/mk-image.sh.patch
cd ${WORK_DIR}
./build/mk-image.sh -c rk3399 -t boot

ls -l ${WORK_DIR}/kernel/arch/arm64/boot/Image
ls -l ${WORK_DIR}/out/boot.img
ls -l ${WORK_DIR}/kernel/arch/arm64/boot/dts/rockchip/rock960-model-ab-linux.dtb
cp ${WORK_DIR}/kernel/arch/arm64/boot/Image ${OUT_DIR}/Image.96rocks
cp ${WORK_DIR}/kernel/arch/arm64/boot/dts/rockchip/rock960-model-ab-linux.dtb ${OUT_DIR}/.

cd ${WORK_DIR}
folder=${WORK_DIR}/u-boot
url="https://gitlab.denx.de/u-boot/u-boot.git"
if [ ! git clone --depth 1 ${url} ${folder} 2>/dev/null ] && [ -d ${folder} ] ; then
    echo "Clone failed because the folder ${folder} exists"
fi

#git clone --depth 1 https://gitlab.denx.de/u-boot/u-boot.git
cd ${WORK_DIR}/u-boot
export BL31=${WORK_DIR}/arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf
sudo make distclean
make ARCH=arm64 rock960-rk3399_defconfig
make CROSS_COMPILE=${WORK_DIR}/toolchain/bin/aarch64-linux-gnu-
ls -l ${WORK_DIR}/u-boot/idbloader.img
ls -l ${WORK_DIR}/u-boot/u-boot-rockchip.bin
ls -l ${WORK_DIR}/u-boot/u-boot.itb
cp ${WORK_DIR}/u-boot/idbloader.img ${OUT_DIR}/.
cp ${WORK_DIR}/u-boot/u-boot-rockchip.bin ${OUT_DIR}/.
cp ${WORK_DIR}/u-boot/u-boot.itb ${OUT_DIR}/.

cd ${WORK_DIR}
folder=${WORK_DIR}/linux
url="https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
if [ ! git clone --branch linux-${LINUX_VERSION}.y --depth 1 ${url} ${folder} 2>/dev/null ] && [ -d ${folder} ] ; then
    echo "Clone failed because the folder ${folder} exists"
fi

#git clone --branch linux-${LINUX_VERSION}.y --depth 1 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

cp ${WORK_DIR}/kernel/arch/arm/configs/rockchip_linux_defconfig ${WORK_DIR}/linux/arch/arm/configs/rockchip_linux_defconfig
cp ${WORK_DIR}/kernel/arch/arm64/configs/rockchip_linux_defconfig ${WORK_DIR}/linux/arch/arm64/configs/rockchip_linux_defconfig

cd ${WORK_DIR}/linux
patch -p0 < ${CURR_DIR}/rockchip_linux_defconfig.patch
sudo make distclean
make ARCH=arm64 rockchip_linux_defconfig
make ARCH=arm64 CROSS_COMPILE=${WORK_DIR}/toolchain/bin/aarch64-linux-gnu- -j$(nproc)
ls -l ${WORK_DIR}/linux/arch/arm64/boot/Image
ls -l ${WORK_DIR}/linux/arch/arm64/boot/dts/rockchip/rk3399-rock960.dtb
cp ${WORK_DIR}/linux/arch/arm64/boot/Image ${OUT_DIR}/.
cp ${WORK_DIR}/linux/arch/arm64/boot/dts/rockchip/rk3399-rock960.dtb ${OUT_DIR}/.


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
支持一个
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

重启卡死吗???

点评

不会卡死  详情 回复 发表于 2023-4-26 23:13
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
空城312 发表于 2023-4-26 16:13
重启卡死吗???

不会卡死
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

大佬能分享一下镜像吗?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

大佬能分享一下镜像吗?完全整不明白
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

希望大佬分享下镜像
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

希望大佬分享下镜像
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

已经有比较完善的dtb了,估计很快会释放出新固件
https://github.com/ophub/amlogic-s9xxx-armbian/issues/1620

点评

不翻车的做法,下载nanopc t4固件,用附件的dtb替换nanopc t4固件里面的rk3399-nanopc-t4.dtb,显示、网络都正常,声卡暂时不正常,应该要继续修改dtb。 其他固件目前很多都有问题。 替换方法,用diskgenius打开im  详情 回复 发表于 2023-12-3 23:30
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

jarodcq 发表于 2023-8-17 20:36
已经有比较完善的dtb了,估计很快会释放出新固件
https://github.com/ophub/amlogic-s9xxx-armbian/issues/ ...

不翻车的做法,下载nanopc t4固件,用附件的dtb替换nanopc t4固件里面的rk3399-nanopc-t4.dtb,显示、网络都正常,声卡暂时不正常,应该要继续修改dtb。

其他固件目前很多都有问题。

替换方法,用diskgenius打开img文件,找到dtb目录,粘贴dtb。

Armbian_23.5.1_Nanopct4_jammy_current_6.1.30_minimal.img下测试成功






本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

请教,EMB3531怎么刷入armbian?怎么U盘启动?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

u盘启动没试过,刷armbian教程非常多,正常刷,就是loader要选rk3399_loader_v1.26.bin
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

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

本版积分规则

关闭

欢迎大家光临恩山无线论坛上一条 /1 下一条

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-29 12:27

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

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