/[clonezilla-sysresccd]/trunk/create-clonezilla-sysresccd/files/prerun.toram
ViewVC logotype

Annotation of /trunk/create-clonezilla-sysresccd/files/prerun.toram

Parent Directory Parent Directory | Revision Log Revision Log


Revision 84 - (hide annotations)
Thu Jul 15 20:54:27 2010 UTC (10 years, 7 months ago) by sng
File size: 4480 byte(s)
- updating site
- getting cust-menu in ocs-live-dev (zip file creation script)

1 sng 64
2 sng 47 #!/bin/sh
3 sng 48 ##############################################################################
4     # #
5     # prerun.toram, (C) 2007-2010 S. Georgaras <sng@hellug.gr> #
6     # #
7     # This file is part of Clonezilla-SysRescCD. #
8     # #
9     # Clonezilla-SysRescCD is free software: you can redistribute it and/or #
10     # modify it under the terms of the GNU General Public License as published #
11     # by the Free Software Foundation, either version 2 of the License, or #
12     # (at your option) any later version. #
13     # #
14     # Clonezilla-SysRescCD is distributed in the hope that it will be useful, #
15     # but WITHOUT ANY WARRANTY; without even the implied warranty of #
16     # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
17     # GNU General Public License for more details. #
18     # #
19     # You should have received a copy of the GNU General Public License along #
20     # with Clonezilla-SysRescCD. If not, see <http://www.gnu.org/licenses/>. #
21     # #
22     ##############################################################################
23    
24 sng 47 setterm -foreground yellow
25     echo '
26     ##########################################'
27     setterm -foreground white
28     echo -n " Modifying .bashrc ... "
29     echo >> /root/.bashrc
30     echo "##########################################" >> /root/.bashrc
31     echo "# aliases by Spiros" >> /root/.bashrc
32     echo "##########################################" >> /root/.bashrc
33     echo "# aliases..." >> /root/.bashrc
34     echo "alias ls='ls --color'" >> /root/.bashrc
35     echo "alias lf='ls -F --color'" >> /root/.bashrc
36     echo "alias l='ls -la --color'" >> /root/.bashrc
37     echo "##########################################" >> /root/.bashrc
38     setterm -foreground green;echo 'done';setterm -foreground white
39    
40    
41    
42     #
43     # replace /live/image/restorecd with $restorecdFiles
44     #
45     echo -n " Copying new scripts... "
46 sng 64 for script in what-cd patch-clonezilla-sysresccd continue-multi-cd reloc-img imginfo imgconvert sbminst;do
47 sng 47 cp /live/image/restorecd/"$script" /usr/bin 2>/dev/null
48     chmod +x /usr/bin/"$script" 2>/dev/null
49     done
50     cp /live/image/restorecd/ocs-iso /opt/drbl/sbin
51     cp /live/image/restorecd/cust-menu /opt/drbl/sbin
52     chmod +x opt/drbl/sbin/ocs-iso
53     chmod +x opt/drbl/sbin/cust-menu
54 sng 84 # add cust-menu execution command to zip file creation script
55     sed '/echo "Packing the output file $output_filename..."/i\
56     cust-menu -publisher "DRBL/Clonezilla http://drbl.name http://clonezilla.org" -V "$iso_label_tag"' /opt/drbl/sbin/ocs-live-dev > /opt/drbl/sbin/ocs-live-dev.tmp && mv /opt/drbl/sbin/ocs-live-dev.tmp /opt/drbl/sbin/ocs-live-dev
57     chmod +x /opt/drbl/sbin/ocs-live-dev
58 sng 47 setterm -foreground green;echo 'done';setterm -foreground white
59    
60     setterm -foreground yellow
61     echo '##########################################
62     '
63     setterm -foreground white
64     #
65     # execute S09mountcd
66     #
67     # only when auto-restore and load to RAM
68     #
69     #
70     echo
71     echo -n "Trying to determine and mount your CD-ROM... "
72     rm -rf /home/partimag 2>/dev/null
73     mkdir /home/partimag
74    
75     # search all CDs
76     for n in $(cat /proc/sys/dev/cdrom/info | grep 'drive name' |sed 's|drive name:[ \t]*||' | awk '{for(i=1;i<=NF;i++) print $i}')
77     do
78     mount /dev/"$n" /home/partimag 2>/dev/null && {
79     if [ -e /home/partimag/restorecd/ocswp.png ];then
80     break
81     else
82     umount /home/partimag 2>/dev/null
83     fi
84     }
85     done
86    
87     # search all partitions
88     if [ -z "$(mount | grep /home/partimag)" ];then
89     for n in $(cat /proc/partitions | grep [0-9]$ | sed 's|.* ||' | grep -v loop)
90     do
91     mount /dev/"$n" /home/partimag 2>/dev/null && {
92     if [ -e /home/partimag/restorecd/ocswp.png ];then
93     break
94     else
95     umount /home/partimag 2>/dev/null
96     fi
97     }
98     done
99     fi
100    
101     if [ -z "$(mount | grep /home/partimag)" ];then
102     setterm -foreground magenta
103     echo failed
104     setterm -foreground white
105     echo
106     echo "Mounting the System Image has failed... You should boot"
107     echo " Clonezilla Live to RAM for this to work!!!"
108     echo "Press ENTER to restart..."
109     read
110     reboot
111     exit 1
112     fi
113    
114     setterm -foreground green
115     echo 'done
116     '
117 sng 48 setterm -foreground white

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26