Platform: ROCKCHIP
OS: Android 6.0
Kernel: 3.10.92
此方法适用于全新eMMC(MaskRom模式)以及已经刷过系统的(RockUsb模式)板子升级.
1.编译整个系统。
$ ./1_build_debug.sh
脚本参见下方的附内容。
2.拷贝所有 Images
$ cp rockdev/rk3288-eng/* RKTools/linux/Linux_Pack_Firmware/rockdev/Images
3.拷贝loader
$cpockdev/rk3288-eng/RK3288UbootLoader_V2.30.10.bin RKTools/linux/Linux_Pack_Firmware/rockdev/
4.修改package-file
# NAME Relative path #HWDEF HWDEF package-file package-file bootloader RK3288UbootLoader_V2.30.10.bin parameter parameter resource Image/resource.img kernel Image/kernel.img boot Image/boot.img recovery Image/recovery.img system Image/system.img backup RESERVED
5.修改parameter
6.修改mkupdate.sh
#!/bin/bash
pause()
{
echo "Press any key to quit:"
read -n1 -s key
exit 1
}
echo "start to make update.img..."
if [ ! -f "parameter" ]; then
echo "Error:No found parameter!"
pause
fi
if [ ! -f "package-file" ]; then
echo "Error:No found package-file!"
pause
fi
./afptool -pack ./ Image/update.img || pause
./rkImageMaker -RK32 RK3288UbootLoader_V2.30.10.bin Image/update.img update.img -os_type:androidos || pause
echo "Making update.img OK."
echo "Press any key to quit:"
read -n1 -s key
exit 0
7.生成update.img
[kris@ecovacs:~/rk3288/RKTools/linux/Linux_Pack_Firmware/rockdev]$ ./mkupdate.sh
start to make update.img...
Android Firmware Package Tool v1.62
------ PACKAGE ------
Add file: ./package-file
Add file: ./RK3288UbootLoader_V2.30.10.bin
Add file: ./parameter
Add file: ./Image/resource.img
Add file: ./Image/kernel.img
Add file: ./Image/boot.img
Add file: ./Image/recovery.img
Add file: ./Image/system.img
Add CRC...
Make firmware OK!
------ OK ------
********RKImageMaker ver 1.63********
Generating new image, please wait...
Writing head info...
Writing boot file...
Writing firmware...
Generating MD5 data...
MD5 data generated successfully!
New image generated successfully!
Making update.img OK.
Press any key to quit:
8.插上usb cable线,升级
upgrade_tool从 rk3288/RKTools/linux/Linux_Upgrade_Tool/Linux_Upgrade_Tool_v1.23
Copy过来。
[kris@ecovacs:~/rk3288/RKTools/linux/Linux_Pack_Firmware/rockdev_bk]$ ./upgrade_tool
List of rockusb connected
DevNo=1 Vid=0x2207,Pid=0x320a,LocationID=31a Maskrom
Found 1 rockusb,Select input DevNo,Rescan press <R>,Quit press <Q>:1
---------------------Tool Usage ---------------------
Help: H
Quit: Q
Version: V
Clear Screen: CS
------------------Upgrade Command ------------------
ChooseDevice: CD
SwitchDevice: SD
UpgradeFirmware: UF <Firmware>
UpgradeLoader: UL <Loader>
DownloadImage: DI <-p|-b|-k|-s|-r|-m image> [parameter file]
DownloadBoot: DB <Loader>
EraseFlash: EF <Loader|firmware>
LowerFormat: LF
----------------Professional Command -----------------
TestDevice: TD
ResetDevice: RD [subcode]
ResetPipe: RP [pipe]
ReadFlashID: RID
ReadFlashInfo: RFI
ReadChipInfo: RCI
ReadSector: RS <BeginSec> <SectorLen> [-decode] [File]
WriteSector: WS <BeginSec> <File>
ReadLBA: RL <BeginSec> <SectorLen> [File]
WriteLBA: WL <BeginSec> <File>
EraseBlock: EB <CS> <BeginBlock> <BlokcLen> [--Force]
-------------------------------------------------------
Rockusb>uf update.img
Loading firmware...
Support Type:RK32 FW Ver:6.0.00 FW Time:2016-10-25 11:36:04
Loader ver:2.30 Loader Time:2016-09-06 14:29:09
Upgrade firmware ok.
这样就可以开机了。
附:简易编译整个工程脚本
Platform: RK3288
OS: Android 6.0
Kernel: 3.10.92
RK没有直接提供编译整个工程的脚本,为了方便,简单编写了一个.
这样就不需要每次手动敲命令了,脚本放在根目录下即可执行.
注意事项:
1.红色部分每个项目不同,需要修改.
2.确保java openjdk安装并检查路径.
3.默认没参数时编译整个android.
脚本实现:
#!/bin/bash
#Usage:
#./1_build_debug.sh [all|kernel|uboot|recoveryimage|${module}]
# Default is building android. "all" option includes building otapackage.
choice=rk3288-eng
build_path=./
log_file=${build_path}/build.log
uboot_path=${build_path}/u-boot
kernel_path=${build_path}/kernel
need_rename=1
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/
source ${build_path}/build/envsetup.sh >/dev/null
TARGET_PRODUCT=`get_build_var TARGET_PRODUCT`
PRODUCT_OUT=`get_build_var PRODUCT_OUT`
IMAGE_PATH=rockdev/Image-${TARGET_PRODUCT}
IMAGE_PATH_FINAL=rockdev/${choice}
OEM_TARGET=$1
build_uboot()
{
cd ${build_path}/u-boot
make rk3288_defconfig
make
cd -
}
build_kernel()
{
cd ${build_path}/kernel
make rockchip_benebot_defconfig
make rk3288-benebot.img
cd -
}
build_all()
{
build_uboot
build_kernel
lunch $choice
if [ $1 == "ota" ]; then
make otapackage -j4 2>&1 | tee ${log_file}
else
make $OEM_TARGET -j4 2>&1 | tee ${log_file}
fi
./mkimage.sh
}
build_module()
{
lunch $choice
make $OEM_TARGET -j4 2>&1 | tee ${log_file}
}
copy_image()
{
if [ $1 == "uboot" ]; then
cp ${uboot_path}/RK3288*.bin ${IMAGE_PATH}/
elif [ $1 == "kernel" ]; then
cp ${kernel_path}/kernel.img ${IMAGE_PATH}/
cp ${kernel_path}/resource.img ${IMAGE_PATH}/
elif [ $1 == "all" ]; then
cp ${uboot_path}/RK3288*.bin ${IMAGE_PATH}/
cp ${kernel_path}/kernel.img ${IMAGE_PATH}/
cp ${kernel_path}/resource.img ${IMAGE_PATH}/
cp ${PRODUCT_OUT}/rk3288-ota*.zip ${IMAGE_PATH}/
fi
}
if [ ! -d ${IMAGE_PATH} ]; then
mkdir -p ${IMAGE_PATH}
fi
if [ ! -d ${IMAGE_PATH_FINAL} ]; then
mkdir -p ${IMAGE_PATH_FINAL}
fi
if [ -z $OEM_TARGET ]; then
echo "Default build all images..."
build_all
copy_image all
elif [ $OEM_TARGET == "kernel" ]; then
build_kernel
copy_image kernel
elif [ $OEM_TARGET == "uboot" ]; then
build_uboot
copy_image uboot
elif [ $OEM_TARGET == "all" ]; then
build_all ota
copy_image all
elif [ $OEM_TARGET == "bootimage" ]; then
build_module
./mkimage.sh
else
build_module
need_rename=0
fi
if [ $need_rename != "0" ]; then
mv $IMAGE_PATH/* $IMAGE_PATH_FINAL/
fi