|
本帖最后由 鲁棒棒 于 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}/.
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
|