固件制作指南

固件制作指南

固件制作指南

Titan固件​

安装依赖

apt-get -y install zip

拷贝固件依赖的文件

export TMP=pack_dirmkdir -p $TMP/factory/cp $TARGET_ROOTFS/usr/lib/u-boot/spacemit/bootinfo_emmc.bin $TMP/factorycp $TARGET_ROOTFS/usr/lib/u-boot/spacemit/bootinfo_sd.bin $TMP/factorycp $TARGET_ROOTFS/usr/lib/u-boot/spacemit/bootinfo_spinand.bin $TMP/factorycp $TARGET_ROOTFS/usr/lib/u-boot/spacemit/bootinfo_spinor.bin $TMP/factorycp $TARGET_ROOTFS/usr/lib/u-boot/spacemit/FSBL.bin $TMP/factorycp $TARGET_ROOTFS/usr/lib/u-boot/spacemit/u-boot.itb $TMPcp $TARGET_ROOTFS/usr/lib/u-boot/spacemit/env.bin $TMPcp $TARGET_ROOTFS/usr/lib/riscv64-linux-gnu/opensbi/generic/fw_dynamic.itb $TMPcp bootfs.ext4 $TMPcp rootfs.ext4 $TMP

下载参考分区表

wget -P $TMP https://gitee.com/bianbu/image-config/raw/main/fastboot.yamlwget -P $TMP https://gitee.com/bianbu/image-config/raw/main/partition_2M.jsonwget -P $TMP https://gitee.com/bianbu/image-config/raw/main/partition_flash.jsonwget -P $TMP https://gitee.com/bianbu/image-config/raw/main/partition_universal.json

打包

cd $TMPzip -r ../bianbu-custom.zip *

SDCARD镜像​

下面介绍如何使用genimage制作SDCARD镜像。

安装依赖

echo 'tzdata tzdata/Areas select Asia' | debconf-set-selectionsecho 'tzdata tzdata/Zones/Asia select Shanghai' | debconf-set-selectionsDEBIAN_FRONTEND=noninteractive apt-get -y install wget python3 genimage

拷贝固件依赖的文件

export TMP=pack_dirmkdir -p $TMP/factory/cp $TARGET_ROOTFS/usr/lib/u-boot/spacemit/bootinfo_emmc.bin $TMP/factorycp $TARGET_ROOTFS/usr/lib/u-boot/spacemit/bootinfo_sd.bin $TMP/factorycp $TARGET_ROOTFS/usr/lib/u-boot/spacemit/bootinfo_spinand.bin $TMP/factorycp $TARGET_ROOTFS/usr/lib/u-boot/spacemit/bootinfo_spinor.bin $TMP/factorycp $TARGET_ROOTFS/usr/lib/u-boot/spacemit/FSBL.bin $TMP/factorycp $TARGET_ROOTFS/usr/lib/u-boot/spacemit/u-boot.itb $TMPcp $TARGET_ROOTFS/usr/lib/u-boot/spacemit/env.bin $TMPcp $TARGET_ROOTFS/usr/lib/riscv64-linux-gnu/opensbi/generic/fw_dynamic.itb $TMPcp bootfs.ext4 $TMPcp rootfs.ext4 $TMP

下载参考分区表

wget -P $TMP https://gitee.com/bianbu/image-config/raw/main/partition_universal.json

下载生成genimage.cfg的脚本,并生成genimage.cfg

wget -P $TMP https://gitee.com/bianbu-linux/scripts/raw/bl-v1.0.y/gen_imgcfg.pypython3 $TMP/gen_imgcfg.py -i $TMP/partition_universal.json -n bianbu-custom.sdcard -o $TMP/genimage.cfg

生成SDCARD镜像

ROOTPATH_TMP="$(mktemp -d)"GENIMAGE_TMP="$(mktemp -d)"genimage \ --config "$TMP/genimage.cfg" \ --rootpath "$ROOTPATH_TMP" \ --tmppath "$GENIMAGE_TMP" \ --inputpath "$TMP" \ --outputpath "."

当看到以下信息时,说明打包成功。

INFO: hdimage(bianbu-custom): adding partition 'bootinfo' from 'factory/bootinfo_sd.bin' ...INFO: hdimage(bianbu-custom): adding partition 'fsbl' (in MBR) from 'factory/FSBL.bin' ...INFO: hdimage(bianbu-custom): adding partition 'env' (in MBR) from 'env.bin' ...INFO: hdimage(bianbu-custom): adding partition 'opensbi' (in MBR) from 'fw_dynamic.itb' ...INFO: hdimage(bianbu-custom): adding partition 'uboot' (in MBR) from 'u-boot.itb' ...INFO: hdimage(bianbu-custom): adding partition 'bootfs' (in MBR) from 'bootfs.ext4' ...INFO: hdimage(bianbu-custom): adding partition 'rootfs' (in MBR) from 'rootfs.ext4' ...INFO: hdimage(bianbu-custom): adding partition '[MBR]' ...INFO: hdimage(bianbu-custom): adding partition '[GPT header]' ...INFO: hdimage(bianbu-custom): adding partition '[GPT array]' ...INFO: hdimage(bianbu-custom): adding partition '[GPT backup]' ...INFO: hdimage(bianbu-custom): writing GPTINFO: hdimage(bianbu-custom): writing protective MBRINFO: hdimage(bianbu-custom): writing MBRINFO: cmd: "rm -rf "/tmp/tmp.rX4fZ39DKG"/*" (stderr):

相关推荐

深度剖析:五大智能炒菜机品牌,谁才是你的最佳厨房拍档?
365提款成功但是不到账

深度剖析:五大智能炒菜机品牌,谁才是你的最佳厨房拍档?

📅 08-09 👁️ 8035
如何利用微信进行高效工作任务管理?5个实用技巧让你事半功倍
365网手机版下载

如何利用微信进行高效工作任务管理?5个实用技巧让你事半功倍

📅 07-05 👁️ 9790
谷歌浏览器网页自动刷新设置与取消方式
365网手机版下载

谷歌浏览器网页自动刷新设置与取消方式

📅 08-02 👁️ 4626