diff options
author | John Klug <john.klug@multitech.com> | 2017-07-25 17:31:01 -0500 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2017-07-25 17:31:57 -0500 |
commit | 81e664582e597ad71b0c103393b8d899d7884d5c (patch) | |
tree | 2bec8c8035d8230e63d4f6df53b48e70875618b8 /scripts | |
parent | c89dd1b071e6e184b968f6592161d1bd83cd0c0e (diff) | |
download | meta-mlinux-81e664582e597ad71b0c103393b8d899d7884d5c.tar.gz meta-mlinux-81e664582e597ad71b0c103393b8d899d7884d5c.tar.bz2 meta-mlinux-81e664582e597ad71b0c103393b8d899d7884d5c.zip |
Useful scripts for working with images
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/deploy.sh | 19 | ||||
-rwxr-xr-x | scripts/imageinfo.sh | 38 |
2 files changed, 57 insertions, 0 deletions
diff --git a/scripts/deploy.sh b/scripts/deploy.sh new file mode 100755 index 0000000..00a2b13 --- /dev/null +++ b/scripts/deploy.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# copyies the latest jffs2 and uImage to the +# +remote=$1 +flashdir=/var/volatile/flash-upgrade +if ((${#remote} == 0)) ; then + echo must have the name or address of the remote Conduit + echo usage example: + echo deploy.sh root@image0 + exit 1 +fi + +fs=$(ls -t *.jffs2 | head -1) +kern=$(ls -t uImage--*.bin | head -1) + +ssh "$1" mkdir $flashdir +ssh -t "$1" "touch /var/volatile/do_flash_upgrade; [[ -x /usr/bin/sudo ]] && sudo chown root /var/volatile/do_flash_upgrade" +scp $kern "$1":$flashdir/uImage.bin +scp $fs "$1":$flashdir/rootfs.jffs2 diff --git a/scripts/imageinfo.sh b/scripts/imageinfo.sh new file mode 100755 index 0000000..5b4d5a0 --- /dev/null +++ b/scripts/imageinfo.sh @@ -0,0 +1,38 @@ +#!/bin/bash +if ((${#1} == 0)) ; then + echo 'usage: imageinfo.sh userid@system' + exit 1 +fi +ssh $1 '[[ -d /opt/rs9113 ]] && cp -a /opt/rs9113/*.ko /lib/modules/$(uname -r)/extra || depmod -a' +echo fetching ipklists +d=$(mktemp -d mVerXXXXX) +ssh $1 opkg list | sort >$d/ipklist.txt +ssh $1 uname -a >$d/drivers.txt +drivers=$(ssh $1 lsmod | sed 's/ .*//' | sort) +for driver in $drivers ; do + if [[ "$driver" == "Module" ]] ; then + continue + fi + { + echo + echo "$driver" + echo "--------------" + ssh $1 modinfo $driver | grep -v '^alias:' + } >>$d/drivers.txt +done +scp $1:/etc/mlinux-\* $d +cd $d +echo "--------------" >>drivers.txt + +extrad=( +"bootstrap 3.5.3-r3" +"u-boot-mtcap 2012.10-r6" +"uImage 3.12.27-r14.2" +) +((i=0)) +while ((i < ${#extrad[@]})) ; do + printf "%-15s %-s\n" ${extrad[$i]} >>drivers.txt + ((i++)) +done +zip image_versions.zip *.txt mlinux* +echo Zip file is $(pwd)/image_versions.zip |