/[clonezilla-sysresccd]/trunk/create-clonezilla-sysresccd/create-clonezilla-sysresccd.sh
ViewVC logotype

Diff of /trunk/create-clonezilla-sysresccd/create-clonezilla-sysresccd.sh

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

revision 63 by sng, Wed May 26 20:30:21 2010 UTC revision 174 by sng, Sun May 29 14:32:14 2011 UTC
# Line 1  Line 1 
1  ##############################################################################  ##############################################################################
2  #                                                                            #  #                                                                            #
3  # create-clonezilla-sysresccd, (C) 2007-2010 S. Georgaras <sng@hellug.gr>    #  # create-clonezilla-sysresccd, (C) 2007-2011 S. Georgaras <sng@hellug.gr>    #
4  #                                                                            #  #                                                                            #
5  # This file is part of Clonezilla-SysRescCD.                                 #  # This file is part of Clonezilla-SysRescCD.                                 #
6  #                                                                            #  #                                                                            #
# Line 18  Line 18 
18  # with Clonezilla-SysRescCD. If not, see <http://www.gnu.org/licenses/>.     #  # with Clonezilla-SysRescCD. If not, see <http://www.gnu.org/licenses/>.     #
19  #                                                                            #  #                                                                            #
20  ##############################################################################  ##############################################################################
21    function evalPrograms(){
22    local ans
23    
24    echo -n "Looking for curl...   "
25    if [ -z "$(curl -V 2>/dev/null)" ];then
26      echo failed
27      unset curlFound
28      echo
29      echo "curl was not found on your system, so the ISO files cannot be download"
30      echo "Please install curl and try again"
31      exit 1
32    else
33      echo found
34      curlFound=1
35    fi
36    
37    echo -n "Looking for md5sum...   "
38    if [ -z "$(md5sum --version 2>/dev/null)" ];then
39      echo failed
40      unset md5sumFound
41      echo
42      echo "  Info: md5sum was not found on your system"
43      echo "        The ISO files will not be validated."
44      echo
45      echo -n "     Do you want to continue? (y/[n]) "
46      read ans
47      if [ "$ans" != "y" ];then
48        exit
49      fi
50    else
51      echo found
52      md5sumFound=1
53    fi
54    }
55    
56    function downloadIsoFiles(){
57    local clonIso
58    local sysIso="http://sourceforge.net/projects/systemrescuecd/files/sysresccd-x86/"$sysVersion"/systemrescuecd-x86-"$sysVersion".iso/download"
59    
60    # Start with Clonezilla Live
61    if [ "$1" = "all" ] || [ -z "$1" ];then
62      # Download all files
63      for clonType in i686 i486 amd64;do
64        clonIso="http://sourceforge.net/projects/clonezilla/files/clonezilla_live_stable/OldFiles/"$clonVersion"/clonezilla-live-"$clonVersion"-"$clonType".iso/download"
65        downloadClonezillaLive
66      done
67    else
68      clonType="$1"
69      clonIso="http://sourceforge.net/projects/clonezilla/files/clonezilla_live_stable/OldFiles/"$clonVersion"/clonezilla-live-"$clonVersion"-"$clonType".iso/download"
70      downloadClonezillaLive
71    fi
72    
73    # Download System Rescue CD
74    echo "
75    ******  Downloading System Rescue CD "$sysVersion" ******"
76    unset curlContinue
77    if [ -e systemrescuecd-x86-"$sysVersion".iso ];then
78      if [ -n "$md5sumFound" ];then
79        echo "$sysmd5  systemrescuecd-x86-"$sysVersion".iso" > test.md5sum
80        echo -n "File found. Checking integrity of "
81        md5sum -c test.md5sum 2>/dev/null
82        if [ "$?" -eq 0 ];then
83          rm -f test.md5sum 2>/dev/null
84          return
85        else
86          echo "File systemrescuecd-x86-"$sysVersion".iso already exists"
87          echo "You can continue downloading the file or restart it"
88          echo -n "Continue downloading? (y/[n]): "
89          read ans
90          if [ "$ans" = "y" ] || [ "$ans" = "Y" ];then
91            curlContinue=1
92          else
93            rm -f test.md5sum 2>/dev/null
94          fi
95        fi
96      else
97        echo "File systemrescuecd-x86-"$sysVersion".iso already exists"
98        echo "You can continue downloading the file or restart it"
99        echo "If you do continue downloading, and since md5sum was not found,"
100        echo "make sure you check the file's integrity manually, after the"
101        echo "download is complete"
102        echo -n "Continue downloading? (y/[n]): "
103        read ans
104        if [ "$ans" = "y" ] || [ "$ans" = "Y" ];then
105          curlContinue=1
106        fi
107      fi
108    fi
109    if [ -z "$curlContinue" ];then
110      curl -L "$sysIso" -o systemrescuecd-x86-"$sysVersion".iso
111    else
112      curl -L -C - "$sysIso" -o systemrescuecd-x86-"$sysVersion".iso
113    fi
114    # Check integrity
115    if [ -n "$md5sumFound" ];then
116      echo "$sysmd5  systemrescuecd-x86-"$sysVersion".iso" > test.md5sum
117      echo -n "Checking integrity of "
118      md5sum -c test.md5sum 2>/dev/null
119      if [ "$?" -eq 1 ];then
120        echo "Integrity check on systemrescuecd-x86-"$sysVersion".iso failed!!!"
121        echo -n "Do you want to delete this file? ([y]/n): "
122        read ans
123        if [ "$ans" = "y" ] || [ "$ans" = "Y" ];then
124          rm -f systemrescuecd-x86-"$sysVersion".iso 2>/dev/null && echo "File deleted..." || echo "******  Error deleting file!!!  ******
125      Please delete systemrescuecd-x86-"$sysVersion".iso manually"
126        fi
127      fi
128      rm -f test.md5sum 2>/dev/null
129    fi
130    }
131    
132    function downloadClonezillaLive(){
133    echo "
134    ******  Downloading Clonezilla Live "$clonVersion" "$clonType"  ******"
135    unset curlContinue
136    if [ -e clonezilla-live-"$clonVersion"-"$clonType".iso ];then
137      if [ -n "$md5sumFound" ];then
138        if [ "$clonType" = "amd64" ];then
139          echo "$amd64md5  clonezilla-live-"$clonVersion"-"$clonType".iso">test.md5sum
140        elif [ "$clonType" = "i486" ];then
141          echo "$i486md5  clonezilla-live-"$clonVersion"-"$clonType".iso">test.md5sum
142        else
143          echo "$i686md5  clonezilla-live-"$clonVersion"-"$clonType".iso">test.md5sum
144        fi
145        unset checkmd5
146        echo -n "File found. Checking integrity of "
147        md5sum -c test.md5sum 2>/dev/null && checkmd5=1
148      
149        if [ -z "$checkmd5" ];then
150          # md5 check failed
151          unset checkmd5
152          echo "File clonezilla-live-"$clonVersion"-"$clonType".iso already exists"
153          echo "You can continue downloading the file or restart it"
154          echo -n "Continue downloading? (y/[n]): "
155          read ans
156          if [ "$ans" = "y" ] || [ "$ans" = "Y" ];then
157            curlContinue=1
158          else
159            rm -f test.md5sum 2>/dev/null
160            return
161          fi
162        else
163          # file is ok
164          return
165        fi
166      else
167        # no md5sum
168        echo "File clonezilla-live-"$clonVersion"-"$clonType".iso already exists"
169        echo "You can continue downloading the file or restart it"
170        echo "If you do continue downloading, and since md5sum was not found,"
171        echo "make sure you check the file's integrity manually, after the"
172        echo "download is complete"
173        echo -n "Continue downloading? (y/[n]): "
174        read ans
175        if [ "$ans" = "y" ] || [ "$ans" = "Y" ];then
176          curlContinue=1
177        fi
178      fi
179    fi
180    
181    # Check if we have to go to OldFiles
182    echo "Checking file availability..."
183    oldFiles="$(curl -IL "$clonIso" | grep '301 Moved Permanently')"
184    if [ -n "$oldFiles" ];then
185      # go to stable
186      clonIso="$(echo "$clonIso" | sed 's{OldFiles/{{')"
187      echo "This is Clonezilla Live Stable!!!"
188    else
189      echo "This is an older Clonezilla Live version!!!"
190    fi
191    
192    # Download file
193    if [ -z "$curlContinue" ];then
194      curl -L "$clonIso" -o clonezilla-live-"$clonVersion"-"$clonType".iso
195    else
196      curl -L -C - "$clonIso" -o clonezilla-live-"$clonVersion"-"$clonType".iso
197    fi  
198    
199    if [ -n "$md5sumFound" ];then
200      if [ "$clonType" = "amd64" ];then
201        echo "$amd64md5  clonezilla-live-"$clonVersion"-"$clonType".iso">test.md5sum
202      elif [ "$clonType" = "i486" ];then
203        echo "$i486md5  clonezilla-live-"$clonVersion"-"$clonType".iso">test.md5sum
204      else
205        echo "$i686md5  clonezilla-live-"$clonVersion"-"$clonType".iso">test.md5sum
206      fi
207      unset checkmd5
208      echo -n "Checking integrity of "
209      md5sum -c test.md5sum 2>/dev/null && checkmd5=1
210      rm -f test.md5sum 2>/dev/null
211      if [ -z "$checkmd5" ];then
212        echo "Integrity check on clonezilla-live-"$clonVersion"-"$clonType".iso failed!!!"
213        echo -n "Do you want to delete this file? ([y]/n): "
214        read ans
215        if [ "$ans" = "y" ] || [ "$ans" = "Y" ];then
216          rm -f clonezilla-live-"$clonVersion"-"$clonType".iso 2>/dev/null && echo "File deleted..." || echo "******  Error deleting file!!!  ******
217    Please delete clonezilla-live-"$clonVersion"-"$clonType".iso manually"
218        fi
219      fi
220    fi
221    
222    
223    }
224    
225  function noRoot(){  function noRoot(){
226  echo "    Error: You must be root to execute this script"  echo "    Error: You must be root to execute this script"
227  exit 1  exit 1
# Line 109  done Line 313  done
313    
314    
315  function createTempFolders(){  function createTempFolders(){
316  echo -n "Creating /root/tmp folder...   "  echo -n "Creating "$SAVE_DIR"/tmp folder...   "
317  mkdir /root/tmp 2>/dev/null  mkdir "$SAVE_DIR"/tmp 2>/dev/null
318  if [ ! -d /root/tmp ];then  if [ ! -d "$SAVE_DIR"/tmp ];then
319   echo   echo
320   echo "    Error creating folder: /root/tmp"   echo "    Error creating folder: "$SAVE_DIR"/tmp"
321   echo "          This shouldn't be happening..."   echo "          This shouldn't be happening..."
322   exit 1   exit 1
323  fi  fi
324  echo 'done'  echo 'done'
325    
326  echo -n "Creating temp folders...   "  echo -n "Creating temp folders...   "
327  rm -rf /root/tmp/clonezilla-sysresccd-"$version".iso 2>/dev/null  rm -rf "$SAVE_DIR"/tmp/clonezilla-sysresccd-"$version".iso 2>/dev/null
328  rm -rf /root/tmp/syscd 2>/dev/null  rm -rf "$SAVE_DIR"/tmp/syscd 2>/dev/null
329  rm -rf /root/tmp/clonecd 2>/dev/null  rm -rf "$SAVE_DIR"/tmp/clonecd 2>/dev/null
330  rm -rf /root/tmp/clonezilla-sysresccd 2>/dev/null  rm -rf "$SAVE_DIR"/tmp/clonezilla-sysresccd 2>/dev/null
331  mkdir /root/tmp/syscd /root/tmp/clonecd /root/tmp/clonezilla-sysresccd 2>/dev/null  mkdir "$SAVE_DIR"/tmp/syscd "$SAVE_DIR"/tmp/clonecd "$SAVE_DIR"/tmp/clonezilla-sysresccd 2>/dev/null
332  if [ ! -d /root/tmp/syscd ];then  if [ ! -d "$SAVE_DIR"/tmp/syscd ];then
333   echo   echo
334   echo "    Error creating temp folder: /root/tmp/syscd"   echo "    Error creating temp folder: "$SAVE_DIR"/tmp/syscd"
335   exit 1   exit 1
336  fi  fi
337  if [ ! -d /root/tmp/clonecd ];then  if [ ! -d "$SAVE_DIR"/tmp/clonecd ];then
338   echo   echo
339   echo "    Error creating temp folder: /root/tmp/clonecd"   echo "    Error creating temp folder: "$SAVE_DIR"/tmp/clonecd"
340   exit 1   exit 1
341  fi  fi
342    
343    
344  if [ ! -d /root/tmp/clonezilla-sysresccd ];then  if [ ! -d "$SAVE_DIR"/tmp/clonezilla-sysresccd ];then
345   echo   echo
346   echo "    Error creating temp folder: /root/tmp/clonezilla-sysresccd"   echo "    Error creating temp folder: "$SAVE_DIR"/tmp/clonezilla-sysresccd"
347   exit 1   exit 1
348  fi  fi
349  echo 'done'  echo 'done'
# Line 152  exit 1 Line 356  exit 1
356  }  }
357    
358  function errorISO(){  function errorISO(){
359  echo "   Error creating new ISO file: /root/tmp/output.iso"  echo "   Error creating new ISO file: "$SAVE_DIR"/tmp/output.iso"
360  rm /root/tmp/clonezilla-sysresccd-"$outName""$version".iso 2>/dev/null  rm "$SAVE_DIR"/tmp/clonezilla-sysresccd-"$outName""$version".iso 2>/dev/null
361  cleanUp  cleanUp
362  exit 1  exit 1
363  }  }
# Line 161  exit 1 Line 365  exit 1
365  function cleanUp(){  function cleanUp(){
366  echo -n "  echo -n "
367  Cleaning up...   "  Cleaning up...   "
368  umount /root/tmp/clonecd 2>/dev/null  umount "$SAVE_DIR"/tmp/clonecd 2>/dev/null
369  umount /root/tmp/syscd 2>/dev/null  umount "$SAVE_DIR"/tmp/syscd 2>/dev/null
370  if [ -z "$cleanUpValue" ];then  if [ -z "$cleanUpValue" ];then
371   rm -rf /root/tmp/clonezilla-sysresccd 2>/dev/null   rm -rf "$SAVE_DIR"/tmp/clonezilla-sysresccd 2>/dev/null
372  fi  fi
373  rm -rf /root/tmp/clonecd /root/tmp/syscd 2>/dev/null  rm -rf "$SAVE_DIR"/tmp/clonecd "$SAVE_DIR"/tmp/syscd 2>/dev/null
374  echo 'done'  echo 'done'
375  echo  echo
376  exit $exitStatus  exit $exitStatus
# Line 218  Available options are: Line 422  Available options are:
422    f           copy files only. Don't create ISO file and don't    f           copy files only. Don't create ISO file and don't
423                burn anything on CD                burn anything on CD
424    nf          don't copy files. Use files existing in folder    nf          don't copy files. Use files existing in folder
425                \"/root/tmp/clonezilla-sysresccd\".                \""$SAVE_DIR"/tmp/clonezilla-sysresccd\".
426                *** Caution: Dangerous!!! ***                *** Caution: Dangerous!!! ***
427    i           only create ISO file. Don't burn anything on CD    i           only create ISO file. Don't burn anything on CD
428    b           burn a previously created ISO file    b           burn a previously created ISO file
429      d [folder]  Use [folder]/tmp as temporary and output folder
430                  instead of $HOME/tmp
431    x [script]  A user defined and written BASH script    x [script]  A user defined and written BASH script
432                to be executed just before mastering the CD                to be executed just before mastering the CD
433      g [arch]    Download ISO files and exit. $(basename $0)
434                  will download the appropriate ISO files in
435                  order to succesfully build Clonezilla-SysRescCD.
436                  [arch] refers to Clonezilla Live architecture
437                  (i686,i486 or amd64 - use all to get them all)
438    v           print version and exit    v           print version and exit
439    h           print this screen and exit    h           print this screen and exit
440    
# Line 313  function readConfig(){ Line 524  function readConfig(){
524  }  }
525    
526  ####### Script starts here #######  ####### Script starts here #######
527    SAVE_DIR="$HOME"
528    
529    MKISOFS=genisoimage
530  onlyBurnISO=0  onlyBurnISO=0
531  onlyCopyFiles=0  onlyCopyFiles=0
532  onlyCreateISO=0  onlyCreateISO=0
# Line 323  profilesExist=0 Line 537  profilesExist=0
537  profilesError=0  profilesError=0
538    
539    
540  while getopts ":asp:bfihvn:x:" Option  while getopts ":asp:bfihvn:x:d:g:" Option
541  do  do
542   case $Option in   case $Option in
543   a)   a)
544    auto=yes    auto=yes
545          ;;    ;;
546   s)   s)
547    readConfig    readConfig
548    sourceProfiles    sourceProfiles
# Line 359  do Line 573  do
573    if [ $profilesExist -eq 1 ];then    if [ $profilesExist -eq 1 ];then
574     if $(isnumber "$OPTARG");then     if $(isnumber "$OPTARG");then
575      applyProfile $OPTARG      applyProfile $OPTARG
576                  usingProfile=yes      usingProfile=yes
577     else     else
578      echo "    Error in parameter: -p $OPTARG"      echo "    Error in parameter: -p $OPTARG"
579      exit 1      exit 1
# Line 404  do Line 618  do
618    fi    fi
619    noFileCopy=1    noFileCopy=1
620    ;;    ;;
621     d)
622      SAVE_DIR="$OPTARG"
623      if [ ! -d "$SAVE_DIR" ]; then
624        mkdir "$SAVEDIR" 2>/dev/null
625        if [ -d "$SAVE_DIR" ];then
626          echo "Error: \"$SAVE_DIR\" cannot be created!!!"
627          exit 1
628        fi
629      fi
630      ;;
631     g)
632      ARCH="$OPTARG"
633      if [ "$ARCH" != "i486" ]  && [ "$ARCH" != "i686" ]  && [ "$ARCH" != "amd64" ] && [ "$ARCH" != "all" ];then
634        echo "    Error in parameter -g. Should be -g [i668|i486|amd64|all]"
635        exit 1
636      fi
637      ;;
638   esac   esac
639  done  done
640  shift $(($OPTIND - 1))  shift $(($OPTIND - 1))
641    
642  test "$(whoami)" = "root" || noRoot  if [ -z "$ARCH" ];then
643      test "$(whoami)" = "root" || noRoot
644    else
645      evalPrograms
646      downloadIsoFiles $ARCH
647      exit
648    fi
649  # chack auto mode  # chack auto mode
650  if [ -n "$auto" ];then  if [ -n "$auto" ];then
651    if [ -z "$usingProfile" ];then    if [ -z "$usingProfile" ];then
652      echo '  Error: Parameter -a used without -p'      echo '  Error: Parameter -a used without -p'
653                  exit 1      exit 1
654          fi    fi
655    if [ -n "$onlyBurnISO" ];then    if [ "$onlyBurnISO" -eq 1 ];then
656      echo "  Error: Conflicting parameters -a and -b used"      echo "  Error: Conflicting parameters -a and -b used"
657                  exit 1      exit 1
658          fi    fi
659  fi  fi
660    
661  # Check input parameters  # Check input parameters
# Line 432  elif [ $checkInParms -gt 1 ];then Line 668  elif [ $checkInParms -gt 1 ];then
668   exit 1   exit 1
669  fi  fi
670  if [ "$outName" = "" ];then  if [ "$outName" = "" ];then
671   outFile=/root/tmp/clonezilla-sysresccd-"$version".iso   outFile="$SAVE_DIR"/tmp/clonezilla-sysresccd-"$version".iso
672  else  else
673   outFile=/root/tmp/clonezilla-sysresccd-"$outName"-"$version".iso   outFile="$SAVE_DIR"/tmp/clonezilla-sysresccd-"$outName"-"$version".iso
674  fi  fi
675    
676  if [ $onlyBurnISO -eq 0 ];then  if [ $onlyBurnISO -eq 0 ];then
# Line 483  Is this correct? (y/[n]): " Line 719  Is this correct? (y/[n]): "
719      if [ -n "$auto" ]; then      if [ -n "$auto" ]; then
720        ans=y        ans=y
721      else      else
722                  clear      clear
723    echo -n "Current CD info:    echo -n "Current CD info:
724       Preparer: $preparerID       Preparer: $preparerID
725       Publisher: $publisher       Publisher: $publisher
# Line 506  Is this correct? (y/[n]): " Line 742  Is this correct? (y/[n]): "
742    createTempFolders    createTempFolders
743    
744    echo -n "Mounting ISO files...   "    echo -n "Mounting ISO files...   "
745    mount "$sysCD" /root/tmp/syscd -o loop || errorMount '    Error mounting  "System Rescue CD" file'    mount "$sysCD" "$SAVE_DIR"/tmp/syscd -o loop || errorMount '    Error mounting  "System Rescue CD" file'
746    mount "$cloneCD" /root/tmp/clonecd -o loop || errorMount '    Error mounting  Clonezilla" file'    mount "$cloneCD" "$SAVE_DIR"/tmp/clonecd -o loop || errorMount '    Error mounting  Clonezilla" file'
747    echo 'done'    echo 'done'
748    echo -n "Copying files...   "    echo -n "Copying files...   "
749    cp -RL /root/tmp/syscd/* /root/tmp/clonezilla-sysresccd    cp -RL "$SAVE_DIR"/tmp/syscd/* "$SAVE_DIR"/tmp/clonezilla-sysresccd
750    cp -RL /root/tmp/clonecd/* /root/tmp/clonezilla-sysresccd    cp -RL "$SAVE_DIR"/tmp/clonecd/* "$SAVE_DIR"/tmp/clonezilla-sysresccd
751    echo 'done'    echo 'done'
752        
753        
754  #   echo -n "Extracting boot programs...  "  #   echo -n "Extracting boot programs...  "
755    echo "Extracting boot programs...  "    echo "Extracting boot programs...  "
756    cd /root/tmp/clonezilla-sysresccd/bootprog    cd "$SAVE_DIR"/tmp/clonezilla-sysresccd/bootprog
757    mkdir tmp    mkdir tmp
758    cp *zip tmp    cp *zip tmp
759    unzip -x sys*zip win32/syslinux.exe    unzip -x sys*zip win32/syslinux.exe
# Line 532  Is this correct? (y/[n]): " Line 768  Is this correct? (y/[n]): "
768        
769    if [ ! -z "$splash" ];then    if [ ! -z "$splash" ];then
770     echo -n "Copying new spalsh screen...   "     echo -n "Copying new spalsh screen...   "
771     cp -L "$splash" /root/tmp/clonezilla-sysresccd/isolinux/ocswp.png     cp -L "$splash" "$SAVE_DIR"/tmp/clonezilla-sysresccd/isolinux/ocswp.png
772     echo 'done'     echo 'done'
773    else    else
774     cp -L /root/.clonezilla-sysresccd/files/default-ocswp.png /root/tmp/clonezilla-sysresccd/isolinux/ocswp.png     cp -L /root/.clonezilla-sysresccd/files/default-ocswp.png "$SAVE_DIR"/tmp/clonezilla-sysresccd/isolinux/ocswp.png
775    fi    fi
776    
777    echo -n "Copying Super Grub Disk...   "    echo -n "Copying Super Grub Disk...   "
778    cp -L /root/.clonezilla-sysresccd/files/sgd.img /root/tmp/clonezilla-sysresccd/bootdisk/sgd.img && echo 'done' || {    cp -L /root/.clonezilla-sysresccd/files/sgd.img "$SAVE_DIR"/tmp/clonezilla-sysresccd/bootdisk/sgd.img && echo 'done' || {
779      echo      echo
780      echo      echo
781      echo      echo
782      echo "    Error: Copying Super Grub Disk failed!!!"      echo "    Error: Copying Super Grub Disk failed!!!"
783      echo      echo
784      echo "           Please make sure that the image file exists"      echo "           Please make sure that the image file exists"
785      echo "           Image file: /root/tmp/clonezilla-sysresccd/bootdisk/sgd.img"      echo "           Image file: "$SAVE_DIR"/tmp/clonezilla-sysresccd/bootdisk/sgd.img"
786      echo      echo
787      echo      echo
788      cleanUp      cleanUp
# Line 554  Is this correct? (y/[n]): " Line 790  Is this correct? (y/[n]): "
790    }    }
791    if [ -e /root/.clonezilla-sysresccd/files/sgd2.img ];then    if [ -e /root/.clonezilla-sysresccd/files/sgd2.img ];then
792     echo -n "Copying Super Grub Disk 2...   "     echo -n "Copying Super Grub Disk 2...   "
793     cp -L /root/.clonezilla-sysresccd/files/sgd2.img /root/tmp/clonezilla-sysresccd/bootdisk/grubdisk.img && echo 'done' || {     cp -L /root/.clonezilla-sysresccd/files/sgd2.img "$SAVE_DIR"/tmp/clonezilla-sysresccd/bootdisk/grubdisk.img && echo 'done' || {
794       echo       echo
795       echo       echo
796       echo       echo
797       echo "    Error: Copying Super Grub Disk 2 failed!!!"       echo "    Error: Copying Super Grub Disk 2 failed!!!"
798       echo       echo
799       echo "           Please make sure that the image file exists"       echo "           Please make sure that the image file exists"
800       echo "           Image file: /root/tmp/clonezilla-sysresccd/bootdisk/sgd2.img"       echo "           Image file: "$SAVE_DIR"/tmp/clonezilla-sysresccd/bootdisk/sgd2.img"
801       echo       echo
802       echo       echo
803       cleanUp       cleanUp
# Line 570  Is this correct? (y/[n]): " Line 806  Is this correct? (y/[n]): "
806    fi    fi
807    echo -n "Copying new cfg file(s)...   "    echo -n "Copying new cfg file(s)...   "
808    if [ -z $(echo "$cfgFile" | grep 'cfg$') ];then    if [ -z $(echo "$cfgFile" | grep 'cfg$') ];then
809      tar -C /root/tmp/clonezilla-sysresccd -xzhf /root/.clonezilla-sysresccd/files/menu-iso.tar.gz      tar -C "$SAVE_DIR"/tmp/clonezilla-sysresccd -xzhf /root/.clonezilla-sysresccd/files/menu-for-iso.tar.gz
810    else    else
811      cp -L "$cfgFile" /root/tmp/clonezilla-sysresccd/isolinux/isolinux.cfg      cp -L "$cfgFile" "$SAVE_DIR"/tmp/clonezilla-sysresccd/isolinux/isolinux.cfg
812    fi    fi
813    echo 'done'    echo 'done'
814        
815    echo -n "Creating folder restorecd...   "    echo -n "Creating folder restorecd...   "
816    WHERE="$(pwd)"    WHERE="$(pwd)"
817    mkdir /root/tmp/clonezilla-sysresccd/restorecd 2>/dev/null    mkdir "$SAVE_DIR"/tmp/clonezilla-sysresccd/restorecd 2>/dev/null
818    cd /root/.clonezilla-sysresccd/files    cd /root/.clonezilla-sysresccd/files
819    cp -L pre* ocs-iso what-cd continue-multi-cd isolinux-restore-cd.cfg \    cp -L pre* ocs-iso what-cd patch-clonezilla-sysresccd continue-multi-cd isolinux-restore-cd.cfg \
820      isolinux-restore-cd-ram.cfg menu-iso.tar.gz doc.tar.gz imginfo imgconvert cust-menu /root/tmp/clonezilla-sysresccd/restorecd      isolinux-restore-cd-ram.cfg menu-for-iso.tar.gz doc.tar.gz imginfo imgconvert cust-menu "$SAVE_DIR"/tmp/clonezilla-sysresccd/restorecd
821    cp -L default-restore-ocswp.png /root/tmp/clonezilla-sysresccd/restorecd/ocswp.png    cp -L default-restore-ocswp.png "$SAVE_DIR"/tmp/clonezilla-sysresccd/restorecd/ocswp.png
822    cp sbminst /root/tmp/clonezilla-sysresccd/restorecd    cp sbminst "$SAVE_DIR"/tmp/clonezilla-sysresccd/restorecd
823        
824    # Copy Smart Boot Manager and rawrite-fdimage to bootdisk    # Copy Smart Boot Manager and rawrite-fdimage to bootdisk
825    mkdir /root/tmp/clonezilla-sysresccd/rawrite    mkdir "$SAVE_DIR"/tmp/clonezilla-sysresccd/rawrite
826    cp  raw* fd* *dll /root/tmp/clonezilla-sysresccd/rawrite    cp  raw* fd* *dll "$SAVE_DIR"/tmp/clonezilla-sysresccd/rawrite
827    cp sbm.img /root/tmp/clonezilla-sysresccd/bootdisk    cp sbm.img "$SAVE_DIR"/tmp/clonezilla-sysresccd/bootdisk
828    cd "$DebianLiveFolder" 2>/dev/null || debFilesError=yes    cd "$DebianLiveFolder" 2>/dev/null || debFilesError=yes
829  #   if [ -s files.tar.gz ];then  #   if [ -s files.tar.gz ];then
830  #     cp -L files.tar.gz /root/tmp/clonezilla-sysresccd/restorecd/ 2>/dev/null || debFilesError=yes  #     cp -L files.tar.gz "$SAVE_DIR"/tmp/clonezilla-sysresccd/restorecd/ 2>/dev/null || debFilesError=yes
831  #   else  #   else
832  #     [ -e "$DebianLiveFolder"/unifont.bgf ] || {  #     [ -e "$DebianLiveFolder"/unifont.bgf ] || {
833  #       uniFontCopied=yes  #       uniFontCopied=yes
834  #       cp -L /root/.clonezilla-sysresccd/files/unifont.bgf "$DebianLiveFolder"  #       cp -L /root/.clonezilla-sysresccd/files/unifont.bgf "$DebianLiveFolder"
835  #     }  #     }
836  #     tar chzf /root/tmp/clonezilla-sysresccd/restorecd/files.tar.gz unifont.bgf debian-live-for-ocs.iso 2>/dev/null || debFilesError=yes  #     tar chzf "$SAVE_DIR"/tmp/clonezilla-sysresccd/restorecd/files.tar.gz unifont.bgf debian-live-for-ocs.iso 2>/dev/null || debFilesError=yes
837  #     [ -z "$uniFontCopied" ] || rm "$DebianLiveFolder"/unifont.bgf  #     [ -z "$uniFontCopied" ] || rm "$DebianLiveFolder"/unifont.bgf
838  #   fi  #   fi
839  #   [ -z "$debFilesError" ] || {  #   [ -z "$debFilesError" ] || {
# Line 620  Is this correct? (y/[n]): " Line 856  Is this correct? (y/[n]): "
856    echo "done"    echo "done"
857    
858    echo -n "Copying documentation files...   "    echo -n "Copying documentation files...   "
859    cd /root/tmp/clonezilla-sysresccd    cd "$SAVE_DIR"/tmp/clonezilla-sysresccd
860    tar xzhf /root/tmp/clonezilla-sysresccd/restorecd/doc.tar.gz    tar xzhf "$SAVE_DIR"/tmp/clonezilla-sysresccd/restorecd/doc.tar.gz
861    echo 'done'    echo 'done'
862    
863    if [ ! -z "$exScript" ];then    if [ ! -z "$exScript" ];then
# Line 646  Is this correct? (y/[n]): " Line 882  Is this correct? (y/[n]): "
882   else   else
883    trap cleanUp 2    trap cleanUp 2
884    cleanUpValue=1    cleanUpValue=1
885    if [ ! -d  /root/tmp/clonezilla-sysresccd ];then    if [ ! -d  "$SAVE_DIR"/tmp/clonezilla-sysresccd ];then
886     echo "    Error accessing folder \"/root/tmp/clonezilla-sysresccd\""     echo "    Error accessing folder \""$SAVE_DIR"/tmp/clonezilla-sysresccd\""
887     exitStatus=1     exitStatus=1
888     cleanUp     cleanUp
889    fi    fi
890   fi   fi
891    
892   # move extra folders into utils   # move extra folders into utils
893   mv /root/tmp/clonezilla-sysresccd/rawrite /root/tmp/clonezilla-sysresccd/bootprog /root/tmp/clonezilla-sysresccd/utils   mv "$SAVE_DIR"/tmp/clonezilla-sysresccd/rawrite "$SAVE_DIR"/tmp/clonezilla-sysresccd/bootprog "$SAVE_DIR"/tmp/clonezilla-sysresccd/utils
894   mv /root/tmp/clonezilla-sysresccd/version /root/tmp/clonezilla-sysresccd/SystemRescueCD-Version   mv "$SAVE_DIR"/tmp/clonezilla-sysresccd/version "$SAVE_DIR"/tmp/clonezilla-sysresccd/SystemRescueCD-Version
895    
896    #
897    # re-build clonezilla filesystem.squashfs
898    #
899    echo -n "Rebuilding Clonezilla squashfs...   "
900    cd "$SAVE_DIR"/tmp/clonezilla-sysresccd/live
901    unsquashfs filesystem.squashfs 2>/dev/null 1>&2
902    cp -r ../README* ../doc ../restorecd squashfs-root
903    mksquashfs squashfs-root aa.squashfs -always-use-fragments -no-duplicates -all-root 2>/dev/null 1>&2
904    mv aa.squashfs filesystem.squashfs
905    rm -rf squashfs-root
906    cd
907    echo 'done'
908    
909   if [ $onlyCopyFiles -eq 1 ];then   if [ $onlyCopyFiles -eq 1 ];then
910    cleanUpValue=1    cleanUpValue=1
911  #   echo  #   echo
912  #   echo  #   echo
913    echo "Both CDs have been copyied in: /root/tmp/clonezilla-sysresccd"    echo "Both CDs have been copyied in: "$SAVE_DIR"/tmp/clonezilla-sysresccd"
914    cleanUp    cleanUp
915   fi   fi
916   echo   echo
# Line 671  if [ -z "$auto" ]; then Line 920  if [ -z "$auto" ]; then
920  ************************************************************************  ************************************************************************
921     Ready to master your CD. If you want to alter any files contained     Ready to master your CD. If you want to alter any files contained
922     in the CD, now is the right time.     in the CD, now is the right time.
923        CD root is \"/root/tmp/clonezilla-sysresccd\"        CD root is \""$SAVE_DIR"/tmp/clonezilla-sysresccd\"
924    
925     When you are done     When you are done
926  ***********************************************************************  ***********************************************************************
# Line 681  Press ENTER to continue...   " Line 930  Press ENTER to continue...   "
930  else  else
931    echo "Creating new ISO file."    echo "Creating new ISO file."
932  fi  fi
933    find /root/tmp/clonezilla-sysresccd -name "*~" -exec rm '{}' ';'    find "$SAVE_DIR"/tmp/clonezilla-sysresccd -name "*~" -exec rm '{}' ';'
934  #   mkisofs -quiet -f -r -J -o "$outFile" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -iso-level 3 -joliet-long -input-charset utf-8 -output-charset utf-8 -V "$volLabel" -publisher "$publisher" -p "$preparerID" /root/tmp/clonezilla-sysresccd || errorISO  #    $MKISOFS -quiet -f -r -J -o "$outFile" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -iso-level 3 -joliet-long -input-charset utf-8 -output-charset utf-8 -V "$volLabel" -publisher "$publisher" -p "$preparerID" "$SAVE_DIR"/tmp/clonezilla-sysresccd || errorISO
935    mkisofs -quiet -f -r -J -o "$outFile" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -V "$volLabel" -publisher "$publisher" -p "$preparerID" /root/tmp/clonezilla-sysresccd || errorISO     $MKISOFS -quiet -f -r -J -o "$outFile" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -V "$volLabel" -publisher "$publisher" -p "$preparerID" "$SAVE_DIR"/tmp/clonezilla-sysresccd || errorISO
936    echo "    echo "
937  Done creating new ISO file  Done creating new ISO file
938  The file is saved as $outFile"  The file is saved as $outFile"
# Line 718  while [ 1 ];do Line 967  while [ 1 ];do
967     ans=n     ans=n
968   else   else
969     echo -n "Do you want to burn this ISO file? ([y]/n): "     echo -n "Do you want to burn this ISO file? ([y]/n): "
970      read ans     read ans
971   fi   fi
972  done  done
973  burnISO=0  burnISO=0

Legend:
Removed from v.63  
changed lines
  Added in v.174

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26