#!/system/bin/sh
recovery_DIR="recovery.img"
boot_DIR="boot.img"
if [ "$1" == "$boot_DIR" ];then
echo "update boot img start"
chmod 777 boot.img
if [ ! -x "$boot_DIR" ]; then
echo " no boot img file "
echo " update boot img err , shll exit."
exit 0
fi
busybox dd if=boot.img of=/dev/block/mmcblk0p1; sync
sync
echo "update boot img ok "
exit 0
fi
if [ "$1" == "$recovery_DIR" ];then
echo "update recover img start"
chmod 777 recovery.img
if [ ! -x "$recovery_DIR" ]; then
echo " no recovery.img file "
echo " update recovery img err,shll exit."
exit 0
fi
busybox dd if=recovery.img of=/dev/block/mmcblk0p2; sync
echo "update recovery img ok "
exit 0
fi
echo "请输入 ./update-img-ok.sh < recovery.img | boot.img >"
exit 0
本文介绍了一个用于更新Android设备的启动分区(boot.img)和恢复分区(recovery.img)的shell脚本。该脚本通过参数指定要更新的分区文件,并使用busybox dd命令将指定的映像文件写入到相应的设备节点上。
2560

被折叠的 条评论
为什么被折叠?



