/[clonezilla-sysresccd]/trunk/create-clonezilla-sysresccd/files/imginfo
ViewVC logotype

Diff of /trunk/create-clonezilla-sysresccd/files/imginfo

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 47 by sng, Thu May 20 12:12:53 2010 UTC revision 143 by sng, Wed Oct 6 11:55:21 2010 UTC
# Line 20  Line 20 
20  #                                                                            #  #                                                                            #
21  ##############################################################################  ##############################################################################
22  # DEBUG=true  # DEBUG=true
23  versionNumber='0.1'  versionNumber='0.2'
24    
25  function readImage(){  function readImage(){
26  # set -x  # set -x
# Line 33  function readImage(){ Line 33  function readImage(){
33    }    }
34    img[$count]="$(basename "$tmp")"    img[$count]="$(basename "$tmp")"
35    
36    
37      sizeInDisk[$count]=`du -hc "$(dirname "$n")" | sed -e '$!d' -e 's|[ \t].*||'`B
38      diskModel[$count]="Disk "`head -n 1 "$(dirname "$n")"/*parted`
39    [ -r "$(dirname "$n")"/disk ] && {    [ -r "$(dirname "$n")"/disk ] && {
40      hasDisk=1      hasDisk=1
41      type[$count]=disk      type[$count]=disk
# Line 41  function readImage(){ Line 44  function readImage(){
44      partCount=$(cat "$(dirname "$n")"/parts | awk '{print NF}')      partCount=$(cat "$(dirname "$n")"/parts | awk '{print NF}')
45      tmp=$(dirname "$n")      tmp=$(dirname "$n")
46      diskSizeFromImage[$count]=$(getDiskSizeFromImage "$tmp")      diskSizeFromImage[$count]=$(getDiskSizeFromImage "$tmp")
47      id[$count]="Image: ${img[$count]}, ${type[$count]}: ${activeItem[$count]}"", size: ${diskSizeFromImage[$count]}, parts: $partCount"      if [ -z "$EXTENDED" ];then
48          id[$count]="Image: ${img[$count]}, ${type[$count]}: ${activeItem[$count]}"", size: ${diskSizeFromImage[$count]}, parts: $partCount"
49        else
50          id[$count]="Image: ${img[$count]}, image size: ${sizeInDisk[$count]}, ${type[$count]}: ${activeItem[$count]}"", size: ${diskSizeFromImage[$count]}, parts: $partCount, ${diskModel[$count]}"
51        fi
52      # scan parts      # scan parts
53      pCount=1      pCount=1
54      tmpImg="${img[$count]}"      tmpImg="${img[$count]}"
# Line 63  function readImage(){ Line 70  function readImage(){
70      calcInputSize /"$tmp" "${activeItem[$count]}"      calcInputSize /"$tmp" "${activeItem[$count]}"
71      imagePartitionSize[$count]="$THIS_INPUT_SIZE"      imagePartitionSize[$count]="$THIS_INPUT_SIZE"
72      partitionIdName[$count]=$(getPartitionIdNameFromImage "$tmp" "${activeItem[$count]}")      partitionIdName[$count]=$(getPartitionIdNameFromImage "$tmp" "${activeItem[$count]}")
73      id[$count]="Image: ${img[$count]}, ${type[$count]}: ${activeItem[$count]}, size: ${imagePartitionSize[$count]}, type: ${partitionIdName[$count]}"      if [ -z "$EXTENDED" ];then
74          id[$count]="Image: ${img[$count]}, ${type[$count]}: ${activeItem[$count]}, size: ${imagePartitionSize[$count]}, type: ${partitionIdName[$count]}"
75        else
76          id[$count]="Image: ${img[$count]}, image size: ${sizeInDisk[$count]}, ${type[$count]}: ${activeItem[$count]}, size: ${imagePartitionSize[$count]}, type: ${partitionIdName[$count]}, ${diskModel[$count]}"
77        fi
78    }    }
79    imgCount="$count"    imgCount="$count"
80    ((count++))    ((count++))
# Line 243  fi Line 254  fi
254    
255  function printVersion(){  function printVersion(){
256      echo "Clonezilla Live Image Information      echo "Clonezilla Live Image Information
257  $(basename $0) v. $versionNumber - (C) 2009 S. Georgaras <sng@hellug.gr>  $(basename $0) v. $versionNumber - (C) 2009-2010 S. Georgaras <sng@hellug.gr>
258      "      "
259  }  }
260    
# Line 254  echo "Usage: $(basename $0) <options> <d Line 265  echo "Usage: $(basename $0) <options> <d
265  Available options:  Available options:
266    s         Search in sub-directories too    s         Search in sub-directories too
267    i [name]  Pring info for image [name]    i [name]  Pring info for image [name]
268      e         Print extended info (image size and disk model)
269    v         Print version info and exit    v         Print version info and exit
270    h         Print this screen and exit"    h         Print this screen and exit"
271    
# Line 265  Available options: Line 277  Available options:
277  #  #
278  #  #
279  # set -x  # set -x
280  while getopts hvdsi: opt  while getopts hvdsei: opt
281  do  do
282    case "$opt" in    case "$opt" in
283    i)    i)
# Line 287  do Line 299  do
299    h)    h)
300      printHelp      printHelp
301      exit;;      exit;;
302      e)
303        EXTENDED=y;;
304    esac    esac
305  done  done
306  shift $(( OPTIND - 1 ))  shift $(( OPTIND - 1 ))

Legend:
Removed from v.47  
changed lines
  Added in v.143

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26