Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
kiddin9 committed Nov 3, 2024
1 parent 208007c commit a6b998f
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
18 changes: 18 additions & 0 deletions devices/amlogic_meson8b/diy/target/linux/amlogic/image/boot.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 设置环境变量
setenv condev "console=ttyAML0,115200n8 no_console_suspend consoleblank=0"
setenv kernel_loadaddr "0x00208000"
setenv dtb_loadaddr "0x21800000"
setenv initrd_loadaddr "0x22000000"
setenv dtb_name "dtb"
setenv boot_start "bootm ${kernel_loadaddr} - ${dtb_loadaddr}"

# 设置 bootargs_emmc 环境变量
setenv bootargs_emmc "root=/dev/mmcblk1p2 rootwait ro ${condev} fsck.repair=yes net.ifnames=0"

# 尝试加载并启动系统
if fatload mmc 1 ${initrd_loadaddr} uInitrd &&
setenv bootargs ${bootargs_emmc} &&
fatload mmc 1 ${kernel_loadaddr} uImage &&
fatload mmc 1 ${dtb_loadaddr} ${dtb_name}; then
run boot_start
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

# 检查参数数量
if [ "$#" -ne 5 ]; then
echo "Usage: $0 <output_image> <boot_partition_image> <rootfs_image>"
exit 1
fi

OUTPUT_IMAGE=$1
BOOT_PARTITION_IMAGE=$2
ROOTFS_IMAGE=$3


# 下载并准备工具
ver="v0.3.1"
curl -L -o ./AmlImg https://github.com/hzyitc/AmlImg/releases/download/$ver/AmlImg_${ver}_linux_amd64
chmod +x ./AmlImg
curl -L -o ./uboot.img https://github.com/shiyu1314/u-boot-onecloud/releases/download/build-20230901-0443/eMMC.burn.img
./AmlImg unpack ./uboot.img burn/

# 转换镜像格式
img2simg ${BOOT_PARTITION_IMAGE} burn/boot.simg
img2simg ${ROOTFS_IMAGE} burn/rootfs.simg

# 创建命令文件
cat <<EOF >>burn/commands.txt
PARTITION:boot:sparse:boot.simg
PARTITION:rootfs:sparse:rootfs.simg
EOF

# 打包生成最终镜像
./AmlImg pack ${OUTPUT_IMAGE} burn/

# 清理临时文件夹
rm -rf burn

0 comments on commit a6b998f

Please sign in to comment.