diff options
author | John Klug <john.klug@multitech.com> | 2016-12-15 12:22:18 -0600 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2016-12-15 12:22:18 -0600 |
commit | 978eec32d3736f7054a92c01c850fcd9ad6bdf3e (patch) | |
tree | 81acdeb35b65c6077c942416b23659fd2d456525 /recipes-navigation | |
parent | 61c3ea12a2db4803e013343f1681f88d04ba6b47 (diff) | |
download | meta-mlinux-978eec32d3736f7054a92c01c850fcd9ad6bdf3e.tar.gz meta-mlinux-978eec32d3736f7054a92c01c850fcd9ad6bdf3e.tar.bz2 meta-mlinux-978eec32d3736f7054a92c01c850fcd9ad6bdf3e.zip |
Files to create a gps package update using a bash archive
Diffstat (limited to 'recipes-navigation')
-rwxr-xr-x | recipes-navigation/gpsd/gpsdupdater/bin/bldgpsd.sh | 61 | ||||
-rwxr-xr-x | recipes-navigation/gpsd/gpsdupdater/lib/bashinstaller.sh | 22 | ||||
-rwxr-xr-x | recipes-navigation/gpsd/gpsdupdater/lib/opkginstall.sh | 16 |
3 files changed, 99 insertions, 0 deletions
diff --git a/recipes-navigation/gpsd/gpsdupdater/bin/bldgpsd.sh b/recipes-navigation/gpsd/gpsdupdater/bin/bldgpsd.sh new file mode 100755 index 0000000..aeedf67 --- /dev/null +++ b/recipes-navigation/gpsd/gpsdupdater/bin/bldgpsd.sh @@ -0,0 +1,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 + diff --git a/recipes-navigation/gpsd/gpsdupdater/lib/bashinstaller.sh b/recipes-navigation/gpsd/gpsdupdater/lib/bashinstaller.sh new file mode 100755 index 0000000..8b04288 --- /dev/null +++ b/recipes-navigation/gpsd/gpsdupdater/lib/bashinstaller.sh @@ -0,0 +1,22 @@ +#!/bin/bash +echo "" +echo "Self Extracting Installer" +echo "" + +export TMPDIR=`mktemp -d /tmp/selfextract.XXXXXX` + +ARCHIVE=`awk '/^__ARCHIVE_BELOW__/ {print NR + 1; exit 0; }' $0` + +tail -n+$ARCHIVE $0 | (cd $TMPDIR; pwd; ls; cpio -ivdum) + +CDIR=`pwd` +cd $TMPDIR +./opkginstall.sh + +cd $CDIR + +#rm -rf $TMPDIR + +exit 0 + +__ARCHIVE_BELOW__ diff --git a/recipes-navigation/gpsd/gpsdupdater/lib/opkginstall.sh b/recipes-navigation/gpsd/gpsdupdater/lib/opkginstall.sh new file mode 100755 index 0000000..57f7604 --- /dev/null +++ b/recipes-navigation/gpsd/gpsdupdater/lib/opkginstall.sh @@ -0,0 +1,16 @@ +#!/bin/bash +list="" +for f in *.ipk ; do + if [[ $f =~ ^busybox ]] ; then + continue + fi + [[ $f =~ ([^_]*) ]] && true + list+="${BASH_REMATCH[1]} " +done +list=$(echo $list | xargs) +echo $list +set -x +opkg --force-depends --force-remove --force-removal-of-dependent-packages remove $list +opkg install *.ipk +opkg upgrade busybox*.ipk +set +x |