File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -4,28 +4,35 @@ SOCCONF_DIR=$1
44ROOTFS_DIR=$2
55COPYLIST=$3
66
7+ RED=' \e[31m'
8+ GREEN=' \e[32m'
9+ YELLOW=' \e[33m'
10+ BLUE=' \e[34m'
11+ RESET=' \e[0m'
12+
713if [ " $# " -lt 2 ]; then
8- echo " Usage: $0 <SoC Conf Directory> <Rootfs Directory> [Copy File List]"
14+ echo -e " ${RED} Usage: $0 <SoC Conf Directory> <Rootfs Directory> [Copy File List]${RESET} "
915 exit 1
1016fi
1117
12- echo " SOC Configuration Directory is ${SOCCONF_DIR} "
13- echo " Rootfs Directory is ${ROOTFS_DIR} "
18+ echo -e " ${YELLOW} SOC Configuration Directory is ${SOCCONF_DIR}${RESET } "
19+ echo -e " ${YELLOW} Rootfs Directory is ${ROOTFS_DIR}${RESET } "
1420
1521function copy_files() {
1622 local copyfl=$1
1723 if [ " x$copyfl " == " x" ] ; then
18- echo " No copy file list specified"
24+ echo -e ${RED} " No copy file list specified${RESET} "
1925 return
2026 fi
2127 if [ ! -f $copyfl ] ; then
2228 copyfl=${SOCCONF_DIR} /${copyfl}
2329 if [ ! -f $copyfl ] ; then
24- echo " Can't find $copyfl , please check!"
30+ echo -e " ${RED} Can't find $copyfl , please check!${RESET} "
2531 return
2632 fi
2733 fi
28- while read -r src dst
34+ echo -e " ${YELLOW} Will use $( readlink -f ${copyfl} ) ${RESET} "
35+ while read -r src dst || [[ -n " $src " ]]
2936 do
3037 if [ " x$src " == " x" ] ; then
3138 continue
@@ -41,7 +48,7 @@ function copy_files() {
4148 fi
4249 dstdir=${ROOTFS_DIR} /$dst
4350 mkdir -p $dstdir
44- echo " Copy $src to $dstdir "
51+ echo -e " ${BLUE} Copy $src to $dstdir ${RESET} "
4552 if [ -f $src ] ; then
4653 cp -f $src $dstdir
4754 else
You can’t perform that action at this time.
0 commit comments