Skip to content

Commit 171840d

Browse files
author
dongyongtao
committed
conf/evalsoc: fix preramfs.sh not read the lastline if without \n, which is ignored
Signed-off-by: dongyongtao <[email protected]>
1 parent d81cbab commit 171840d

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

conf/evalsoc/preramfs.sh

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,35 @@ SOCCONF_DIR=$1
44
ROOTFS_DIR=$2
55
COPYLIST=$3
66

7+
RED='\e[31m'
8+
GREEN='\e[32m'
9+
YELLOW='\e[33m'
10+
BLUE='\e[34m'
11+
RESET='\e[0m'
12+
713
if [ "$#" -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
1016
fi
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

1521
function 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

0 commit comments

Comments
 (0)