1 Star 0 Fork 0

zhanghao/sd-fuse_h3

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
mk-emmc-image.sh 2.60 KB
一键复制 编辑 原始数据 按行查看 历史
Lawrence-Tang 提交于 2019-11-09 17:21 . remove -images from filename
#!/bin/bash
# Copyright (C) Guangzhou FriendlyARM Computer Tech. Co., Ltd.
# (http://www.friendlyarm.com)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, you can access it online at
# http://www.gnu.org/licenses/gpl-2.0.html.
function usage() {
echo "Usage: $0 <friendlycore-xenial_4.14_armhf|friendlywrt_4.14_armhf>"
exit 0
}
if [ $# -eq 0 ]; then
usage
fi
# ----------------------------------------------------------
# Get platform, target OS
true ${SOC:=h3}
true ${TARGET_OS:=${1,,}}
case ${TARGET_OS} in
friendlycore-xenial_4.14_armhf | friendlywrt_4.14_armhf)
;;
*)
echo "Error: Unsupported target OS: ${TARGET_OS}"
exit 0
esac
download_img() {
local PARTMAP=$(dirname $0)/${1}/partmap.txt
if [ ! -f "${PARTMAP}" ]; then
ROMFILE=`./tools/get_pkg_filename.sh ${1}`
cat << EOF
Warn: Image not found for ${1}
----------------
you may download them from the netdisk (dl.friendlyarm.com) to get a higher downloading speed,
the image files are stored in a directory called images-for-eflasher, for example:
tar xvzf /path/to/NETDISK/images-for-eflasher/${ROMFILE}
----------------
Or, download from http (Y/N)?
EOF
while read -r -n 1 -t 3600 -s USER_REPLY; do
if [[ ${USER_REPLY} = [Nn] ]]; then
echo ${USER_REPLY}
exit 1
elif [[ ${USER_REPLY} = [Yy] ]]; then
echo ${USER_REPLY}
break;
fi
done
if [ -z ${USER_REPLY} ]; then
echo "Cancelled."
exit 1
fi
./tools/get_rom.sh ${1} || exit 1
fi
}
download_img ${TARGET_OS}
download_img eflasher
# Automatically re-run script under sudo if not root
if [ $(id -u) -ne 0 ]; then
echo "Re-running script under sudo..."
sudo "$0" "$@"
exit
fi
./mk-sd-image.sh eflasher && \
./tools/fill_img_to_eflasher out/${SOC}_eflasher-$(date +%Y%m%d).img ${SOC} $@ && {
rm -f out/${SOC}_eflasher-$(date +%Y%m%d).img
mkdir -p out/images-for-eflasher
tar czf out/images-for-eflasher/${TARGET_OS}.tgz ${TARGET_OS}
echo "all done."
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/haobaobao/sd-fuse_h3.git
git@gitee.com:haobaobao/sd-fuse_h3.git
haobaobao
sd-fuse_h3
sd-fuse_h3
master

搜索帮助