chill wrote: 
> This is what I use.  Just give it the name (including path) of the image
> file as a command line parameter:
> 
> > 
Code:
--------------------
  >   > #!/bin/sh
  > 
  > imagefile=$1
  > 
  > #Find which device pCP booted from: command copied from /home/tc/.ashrc
  > TCEDEV="/dev/$(readlink /etc/sysconfig/tcedir | cut -d '/' -f3)"
  > device="${TCEDEV%%?}"
  > echo $device
  > 
  > #bs=$(fdisk -l | grep -A 3 mmcblk0: | grep Units: | awk -F= {'print $2'} | 
awk {'print $1'})
  > bs=$(fdisk -l | grep -A 3 $device: | grep Units: | awk -F= {'print $2'} | 
awk {'print $1'})
  > echo "blocksize="$bs
  > 
  > count=$(fdisk -l | grep $TCEDEV | awk {'print $5+1'})
  > echo "count="$count
  > 
  > dd if=$device bs=$bs count=$count | gzip > $imagefile
--------------------
> > 
Thanks for sharing:-)



The Earth Has Music For Those Who Listen
------------------------------------------------------------------------
Pommes's Profile: http://forums.slimdevices.com/member.php?userid=67682
View this thread: http://forums.slimdevices.com/showthread.php?t=113512

_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to