From 81e664582e597ad71b0c103393b8d899d7884d5c Mon Sep 17 00:00:00 2001 From: John Klug Date: Tue, 25 Jul 2017 17:31:01 -0500 Subject: Useful scripts for working with images --- scripts/deploy.sh | 19 +++++++++++++++++++ scripts/imageinfo.sh | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100755 scripts/deploy.sh create mode 100755 scripts/imageinfo.sh 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 -- cgit v1.2.3