mirror of
https://ghproxy.com/https://github.com/tossp/redpill-tool-chain.git
synced 2024-09-20 17:37:37 +00:00
24 lines
540 B
Bash
Executable File
24 lines
540 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
T='/dev/synoboot'
|
|
S='images/redpill-DS[39]*.img'
|
|
|
|
cd $(dirname $(readlink -f "$0"))
|
|
|
|
IMG_FILE=`ls -lt ${S} 2>/dev/null | awk 'NR==1{print $9}'`
|
|
|
|
if [ ! -b "${T}" ];then
|
|
echo -e "The target block device address does not exist:\t${T}"
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -f "${IMG_FILE}" ];then
|
|
echo -e "Is not a valid file:\t${IMG_FILE}"
|
|
ls -lt ${S}
|
|
exit 1
|
|
fi
|
|
|
|
echo -e "Boot image:\t\t${PWD}/${IMG_FILE}"
|
|
echo -e "Target block device:\t${T}"
|
|
dd if="${IMG_FILE}" of="${T}" bs=4M conv=nocreat oflag=sync status=progress
|