summaryrefslogtreecommitdiff
path: root/recipes-navigation/gpsd/gpsdupdater/bin/bldgpsd.sh
blob: aeedf67e38f15094515e89f9ce66f7214c0db700 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# This program creates an installer bash script.
# To install you execute:
# bash gpsdipk.sh
# Files needed
# ~/lib/opkginstall.sh
# ~/lib/bashinstaller.sh
#
function usage
{
  echo 'bldgpsd [mlinuxdir]' 2>&1
  exit
}
function cleanup
{
  if [[ $tmpdir =~ ^/var/tmp/gpsdbld ]] ; then
    rm -rf $tmpdir
  fi
}
if (($# != 1)) ; then
  usage
fi
trap cleanup exit
mlpath="$1"


fullpath=$(readlink ${mlpath})
tmpdirtemplate=/var/tmp/gpsdbld.XXXXX
tmpdir=$(mktemp -d $tmpdirtemplate)
FLIST=\
"
libpanelw5_*_arm926ejste.ipk
python-curses_*_arm926ejste.ipk
python-json_*_arm926ejste.ipk
libgps22_0*_arm926ejste.ipk  
gpsd_*_arm926ejste.ipk 
gpsd-conf_*_arm926ejste.ipk 
gpsd-gpsctl_*_arm926ejste.ipk 
gpsd-udev_*_arm926ejste.ipk 
gps-utils_*_arm926ejste.ipk 
python-pygps_*_arm926ejste.ipk 
ntp_*_arm926ejste.ipk 
ntp-utils_*_arm926ejste.ipk 
ntp-tickadj_*_arm926ejste.ipk 
busybox_*_arm926ejste.ipk 
"
armpath=${mlpath}/build/tmp/deploy/ipk/arm926ejste
if ! [[ -d $armpath ]] ; then
  echo $armpath does not exist.  No files to save
  exit 1
fi
mkdir ${tmpdir}/packages
cp ~/lib/bashinstaller.sh $tmpdir/packages/gpsdipk.sh

echo directory is $armpath
echo list is $FLIST
chmod +x ~/lib/bashinstaller.sh
(cd $armpath; cp ~/lib/opkginstall.sh . ; echo opkginstall.sh $FLIST | tr ' ' '\n' | cpio -ov -Hcrc >>${tmpdir}/packages/gpsdipk.sh ; rm opkginstall.sh)
mv ${tmpdir}/packages/gpsdipk.sh /var/tmp
echo installer is /var/tmp/gpsdipk.sh