ubuntu16.04
仓库的地址换成ntc-chip-revived的
https://github.com/ntc-chip-revived/CHIP-linux/tree/a58ccbc30da8f1d9bcb4770af79bbbc41023908b
https://github.com/ntc-chip-revived/CHIP-u-boot/tree/c23364e2cd21ef74f7405fa03e537582f062c4c0
https://github.com/ntc-chip-revived/RTL8723BS/tree/1b4af26d8754150e420ba4a642610e97d904b8da

遇到的一些错误

bash: ./build.sh: /bin/env: 解释器错误: 没有那个文件或目录
删除#!/bin/env bash

/home/xuefei/chip-arch-build/scripts/check_prereqs.sh: 第 20 行: hash: dtc: 未找到
sudo apt-get install device-tree-compiler

/home/xuefei/chip-arch-build/scripts/check_prereqs.sh: 第 20 行: hash: fastboot: 未找到
ERROR: fastboot not found!
sudo apt-get install android-tools-adb android-tools-fastboot

/home/xuefei/chip-arch-build/scripts/check_prereqs.sh: 第 20 行: hash: sunxi-fel: 未找到
ERROR: sunxi-fel not found!
sudo apt-get install sunxi-tools

/home/xuefei/chip-arch-build/scripts/check_prereqs.sh: 第 20 行: hash: ubinize:未找到
ERROR: ubinize not found!
sudo apt install mtd-utils

/home/xuefei/chip-arch-build/scripts/check_prereqs.sh: 第 20 行: hash: img2simg:未找到
ERROR: img2simg not found!
sudo apt install img2simg
sudo apt install android-tools-fsutils

/home/xuefei/chip-arch-build/scripts/check_prereqs.sh: 第 20 行: hash: arm-linux-gnueabihf-gcc: 未找到
ERROR: arm-linux-gnueabihf-gcc not found!
sudo apt install gcc-arm-linux-gnueabihf

/home/xuefei/chip-arch-build/scripts/check_prereqs.sh: 第 20 行: hash: arm-none-eabi-gcc:未找到
sudo apt install gcc-arm-none-eabi

/home/xuefei/chip-arch-build/scripts/check_prereqs.sh: 第 20 行: hash: mkimage: 未找到
ERROR: mkimage not found!
sudo apt-get install u-boot-tools

正在解析主机 de7.mirror.archlinuxarm.org (de7.mirror.archlinuxarm.org)... 失败:未知的名称或服务。
wget: 无法解析主机地址 “de7.mirror.archlinuxarm.org”
Entering fakeroot and making image
^Cubinize: error!: cannot stat "ubifs.img" referred from section "ubifs"
         error 2 (No such file or directory)
Cannot open input file ubi.img
Downloading generic armv7 image
--2022-05-06 23:23:44--  http://de7.mirror.archlinuxarm.org/os/ArchLinuxARM-armv7-latest.tar.gz
正在解析主机 de7.mirror.archlinuxarm.org (de7.mirror.archlinuxarm.org)... 失败:未知的名称或服务。
wget: 无法解析主机地址 “de7.mirror.archlinuxarm.org”
Entering fakeroot and making image
修改scripts下make_rootfs.sh第10行文件地址为http://mirror.archlinuxarm.org/os/ArchLinuxARM-armv7-latest.tar.gz
估计需要科学上网

整理相关依赖

sudo apt-get install device-tree-compiler android-tools-adb android-tools-fastboot sunxi-tools mtd-utils android-tools-fsutils gcc-arm-linux-gnueabihf gcc-arm-none-eabi u-boot-tools

Entering fakeroot and making image
ubinize: error!: error in section "ubifs": size of the image file "ubifs.img" is 598671360, which is larger than volume size 524288000
Cannot open input file ubi.img
configs文件夹下ubinize.cfg中vol_size=500MiB改成生成的ubifs.img的实际大小
我这里是598.7M,所以我改为600M

两个月前macromorgan在reddit上发布了新的刷机文章,修复了wifi难以连接等问题
下面记录一下我的刷机步骤
1、准备文件
原文件地址
https://macromorgan.s3.amazonaws.com/ntc-chip-mainline/flash_tool_v3.tar.gz https://macromorgan.s3.amazonaws.com/ntc-chip-mainline/ntc-chip_2022.02.25.swu

sunxi-tools要用master分支最新代码编译出来的,所以我修改了一下
flash_tool_v3.zip
全部文件下载地址
链接: https://pan.baidu.com/s/1Nmr0Rw8fUrpB2wbdRG0yiA 提取码: 9h9i 复制这段内容后打开百度网盘手机App,操作更方便哦
--来自百度网盘超级会员v3的分享
跳线连接GND和FEL进入刷机模式 ,插上USB线
cd flash_tool_v3
sudo ./flash_device_erase_nand.sh
sendpix0.jpg
执行完毕,等待一段时间后chip会自动关闭
然后再去掉跳线,重新插上usb
按一下chip上的小按键,或者是pocketchip按到开机
然后在浏览器里打开http://chip.local/或者http://10.10.10.10/
sendpix1.jpg
然后选择ntc-chip_2022.02.25.swu刷起来,刷完会自动重启

git clone https://github.com/macromorgan/chip-debroot.git
cd chip-debroot
git clone https://source.denx.de/u-boot/u-boot.git
cd u-boot
git checkout v2022.01
cd ..
cd u-boot_files/
cp *.patch /home/xuefei/chip-debroot/u-boot/
cp *.config /home/xuefei/chip-debroot/u-boot/
cd ..
cd u-boot
mv chip.config .config
git am --signoff < 0001-board-Add-support-for-Source-Parts-Original-Popcorn.patch
git am --signoff < 0001-i2c-mvtwsi-Add-compatible-string-for-allwinner-sun4i.patch
git am --signoff < 0001-sunxi-Add-option-to-prevent-power-on-when-plug-in.patch
git am --signoff < 0001-sunxi-Add-support-for-slc-emulation-on-mlc-NAND.patch
git am --signoff < 0001-sunxi-nand-Undo-removal-of-DMA-specific-code-that-br.patch
git am --signoff < 0001-w1-Loosen-timings-for-w1-reset.patch

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
看错误,缺少什么装什么
列出一部分
sudo apt install gcc-arm-linux-gnueabihf bison flex swig libarchive-tools python3-dev

编译u-boot
暂时未测试是否可用
2022.4.14测试发现 生成的spl/sunxi-spl.bin 无法刷入
执行 sunxi-fel spl spl/sunxi-spl.bin 会出现usb_bulk_send() ERROR -7: Operation timed out
但macromorgan的可以刷入,这就很奇怪……