diff options
author | Naoto Yamaguchi <i33399_YAMAGUCHI@aisin-aw.co.jp> | 2017-01-02 21:36:25 +0900 |
---|---|---|
committer | Jan-Simon Moeller <jsmoeller@linuxfoundation.org> | 2017-01-02 16:21:05 +0000 |
commit | 139350e5a3a0a60ae503f16edf34c1debd66bd17 (patch) | |
tree | 30e9d63381fe14138aba7ddcd1e36c8fb7a69b2e /recipes-demo-hmi | |
parent | 4d8306feaed755d181752f08abce39b5a8624996 (diff) |
Add a script to download mapdata
This patch is fix of SPEC-392.
Add a script to download the UK map data to the target /var/mapdata.
Change-Id: If97c723e342c01f252f1a625504ef2a02ce2fb12
Signed-off-by: Naoto Yamaguchi <i33399_YAMAGUCHI@aisin-aw.co.jp>
Diffstat (limited to 'recipes-demo-hmi')
-rwxr-xr-x | recipes-demo-hmi/navigation/navigation/download_mapdata.sh | 61 | ||||
-rwxr-xr-x[-rw-r--r--] | recipes-demo-hmi/navigation/navigation_git.bb | 6 |
2 files changed, 65 insertions, 2 deletions
diff --git a/recipes-demo-hmi/navigation/navigation/download_mapdata.sh b/recipes-demo-hmi/navigation/navigation/download_mapdata.sh new file mode 100755 index 000000000..d1f9a796b --- /dev/null +++ b/recipes-demo-hmi/navigation/navigation/download_mapdata.sh @@ -0,0 +1,61 @@ +#!/bin/sh +# +# AGL Navigation mapdata download scripts +# + +#-------------------------------------------------------------- +help() +{ +bn=`basename $0` +cat << EOF +usage +host: sudo $bn 'target_rootfs_path/' +target : $bn / +EOF + +} +#-check para------------------------------------------------------- +shift `expr $OPTIND - 1` + +if [ $# != 1 ]; then + help + exit +fi + +rootfs=$1 + +#---------------------------------------------------------------- + +# check the if root? ------------------------------ +userid=`id -u` +if [ $userid -ne "0" ]; then + echo "you're not root? run with sudo" + exit +fi + +if [ ! -e $1 ]; then + echo "rootfs:$1 not found" + exit +fi + +if [ ! -f $HOME/navi_data_UK.tar.gz ]; then + echo "no map data" + echo "start downloading..." + wget --directory-prefix=$HOME http://agl.wismobi.com/data/UnitedKingdom_TR9/navi_data_UK.tar.gz +else + echo "use downloaded map data" +fi + +mapdatadir=$rootfs/var/mapdata + +if [ ! -d $mapdatadir ]; then + echo "map data directory does not exist" + echo "create a directory" $mapdatadir + mkdir -p $mapdatadir +else + echo "map data directory exists" +fi + +tar xvzf $HOME/navi_data_UK.tar.gz -C $mapdatadir +sync +echo "done.." diff --git a/recipes-demo-hmi/navigation/navigation_git.bb b/recipes-demo-hmi/navigation/navigation_git.bb index 6a052c0ed..b497e9c54 100644..100755 --- a/recipes-demo-hmi/navigation/navigation_git.bb +++ b/recipes-demo-hmi/navigation/navigation_git.bb @@ -14,6 +14,7 @@ SRC_URI="git://github.com/AGLExport/gpsnavi.git \ file://flite.in \ file://jtalk.in \ file://config.xml \ + file://download_mapdata.sh \ " # To avoid C++ library link failure @@ -36,8 +37,9 @@ do_install_append() { install -d ${D}/usr/AGL/apps install -m 0644 ${WORKDIR}/widget/navigation.wgt ${D}/usr/AGL/apps/ + install -m 0755 ${WORKDIR}/download_mapdata.sh ${D}/usr/AGL/apps/ - install -d ${D}/usr/share/mapdata + install -d ${D}/var/mapdata } -FILES_${PN} += " /usr/AGL/apps/navigation.wgt /usr/share/mapdata " +FILES_${PN} += " /usr/AGL/apps/* /var/mapdata " |