- Timestamp:
- Jun 19, 2013, 8:34:46 AM (12 years ago)
- Location:
- branches/3.1
- Files:
-
- 2 deleted
- 68 edited
- 12 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3.1/mindi/COPYING
r30 r3147 3 3 4 4 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 675 Mass Ave, Cambridge, MA 02139,USA5 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 6 Everyone is permitted to copy and distribute verbatim copies 7 7 of this license document, but changing it is not allowed. … … 283 283 284 284 END OF TERMS AND CONDITIONS 285 286 287 Appendix: How to Apply These Terms to Your New Programs 288 289 If you develop a new program, and you want it to be of the greatest 290 possible use to the public, the best way to achieve this is to make it 291 free software which everyone can redistribute and change under these terms. 292 293 To do so, attach the following notices to the program. It is safest 294 to attach them to the start of each source file to most effectively 295 convey the exclusion of warranty; and each file should have at least 296 the "copyright" line and a pointer to where the full notice is found. 297 298 <one line to give the program's name and a brief idea of what it does.> 299 Copyright (C) 19yy <name of author> 300 301 This program is free software; you can redistribute it and/or modify 302 it under the terms of the GNU General Public License as published by 303 the Free Software Foundation; either version 2 of the License, or 304 (at your option) any later version. 305 306 This program is distributed in the hope that it will be useful, 307 but WITHOUT ANY WARRANTY; without even the implied warranty of 308 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 309 GNU General Public License for more details. 310 311 You should have received a copy of the GNU General Public License 312 along with this program; if not, write to the Free Software 313 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 314 315 Also add information on how to contact you by electronic and paper mail. 316 317 If the program is interactive, make it output a short notice like this 318 when it starts in an interactive mode: 319 320 Gnomovision version 69, Copyright (C) 19yy name of author 321 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 322 This is free software, and you are welcome to redistribute it 323 under certain conditions; type `show c' for details. 324 325 The hypothetical commands `show w' and `show c' should show the appropriate 326 parts of the General Public License. Of course, the commands you use may 327 be called something other than `show w' and `show c'; they could even be 328 mouse-clicks or menu items--whatever suits your program. 329 330 You should also get your employer (if you work as a programmer) or your 331 school, if any, to sign a "copyright disclaimer" for the program, if 332 necessary. Here is a sample; alter the names: 333 334 Yoyodyne, Inc., hereby disclaims all copyright interest in the program 335 `Gnomovision' (which makes passes at compilers) written by James Hacker. 336 337 <signature of Ty Coon>, 1 April 1989 338 Ty Coon, President of Vice 339 340 This General Public License does not permit incorporating your program into 341 proprietary programs. If your program is a subroutine library, you may 342 consider it more useful to permit linking proprietary applications with the 343 library. If this is what you want to do, use the GNU Library General 344 Public License instead of this License. -
branches/3.1/mindi/README.ProLiant
r2937 r3147 1 1 $Id$ 2 3 MondoRescue provides enhanced HP ProLiant support. 4 5 HP ProLiant provides the possibility to be configured from a HW perspective at BIOS, Smart Arry (Raid) and iLO (management board) level from a Linux system. 6 7 The information is stored in the EEPROM of each HW component (BIOS, SA and iLO), retrieved through the below mentioned HP tools, and stored on the disk with XML files. These files are available at restore time, to be used by the same tools, also available, to reconfigure the HW in a similar way to what it was at backup time. 8 9 Only if you add FirmWare components under /usr/local/bin (CPxxx.scexe files) then these files will also be launched at restore time to force a specific FW version to be installed. As long as FirmWare files are not stored under /usr/local/bin, they won't be applied. 10 At restore time, MondoRescue will ask a question (if not in unattended mode) in order to know if you want to restore the HW *configuration* (not HW FirmWare) content. It will then re-apply what was stored in the XML files to configure the platform exactly as it was at backup time, from a HW confiuration perspective. 2 11 3 12 ------------------------------------------------------------------------------------- 4 13 14 If you have a ProLiant system you first need to get the hp-scripting-tools, hponcfg and hpacucli packages. Due to licenses issues, mindi cannot provide those tools itself. You need to get them from http://downloads.linux.hp.com/SDR 15 16 Example for a RHEL6 OS: 17 18 wget http://downloads.linux.hp.com/SDR/downloads/bootstrap.sh 19 sh ./bootstrap.sh SPP 20 sh ./bootstrap.sh Extras 21 yum install -y hpacucli hponcfg hp-scripting-tools 22 23 You're now ready to check your configuration by running: 24 mindi-bkphw /var/cache/mindi /etc/mindi 25 [First parameter is the directory where files will be generated, 26 Second parameter is the configuration directory of the file deplist.d/ProLiant.conf is located] 27 28 ------------------------------------------------------------------------------------- 29 Older method: 30 5 31 If you have a ProLiant system you first need to get the hp-scripting-tools, hponcfg and hpacucli packages. Due to licenses issues, mindi cannot provide those tools itself. You need to get them from http://downloads.linux.hp.com/SDR/downloads/ProLiantSupportPack/ 32 33 Example for a RHEL6 OS: 6 34 7 35 wget http://downloads.linux.hp.com/SDR/downloads/ProLiantSupportPack/RedHat/6Server/x86_64/8.72/hpacucli-8.70-8.0.noarch.rpm … … 13 41 wget http://downloads.linux.hp.com/SDR/downloads/ProLiantSupportPack/RedHat/6Server/i386/8.72/hp-scripting-tools-8.70-52.rhel6.i386.rpm 14 42 yum install -y (or worst case rpm -Uvh) hp-scripting-tools-8.70-52.rhel6.i386.rpm 15 (will install hp-conrep under /sbin)43 (will install hp-conrep or hp-rcu under /sbin) 16 44 17 45 You're now ready to check your configuration by running: -
branches/3.1/mindi/README.bootparam
r2937 r3147 28 28 29 29 excludedevs="dev1 dev2" 30 Exclude those evices from retoration process (no LVM action done suc has pvcreate, and no partitioning. Those devices are removed from /var/cache/mindi/mountlist.txt and /var/cache/mindi/i-want-my-lvm)30 Exclude those devices from restoration process (no LVM action done such as pvcreate, and no partitioning. Those devices are removed from /var/cache/mindi/mountlist.txt and /var/cache/mindi/i-want-my-lvm) 31 31 32 32 forcemods="mod1 mod2" … … 60 60 Call mondorestore with -o and the tape device 61 61 62 obdrmods="mod1 mod2" 63 Remove these modules in order to be able to reset the tape dvice using it and place it in sequential mode. A default list of modules is aloready embedded so this should only be used if the list is unsufficient. Please report that usage to dev team. 64 62 65 pre=/path/to/script 63 66 Execute a pre-configuration script before calling mondorestore. Could be an NFS shared script e.g., or a script located in the initrd. Eg: pre=/tmp/isodir/my-pre.sh. Note that the script should be executable. … … 70 73 71 74 serial=/dev/ttySx 72 When using a serial console, associate it to the tty device so it works correctly at restore time. By default set up /dev/ttyS0 as serial console. Pass the value of your serial console if different. 75 When using a serial console, associate it to the tty device so it works correctly at restore time. By default set up /dev/ttyS0 as serial console. Pass the value of your serial console if different. You may also want to pass console=ttySx so your kernel can deal with it. serial takes precedence over console for mindi. 73 76 74 77 textonly -
branches/3.1/mindi/README.ia64
r1565 r3147 5 5 So a perl script called parted2fdisk.pl was written that will take as input all the order that mindi/mondo pass to fdisk, translate them to be given to parted and print the result in fdisk format. So this is a filter allowing fdisk replacement. It's only used on ia64. On other archs, parted2fdisk is a link to fdisk. 6 6 7 Thus mindi/mondo launched by root will pass all their call to parted2fdisk instead of the real fdisk, and be able to support the GPT format. It will call fdisk and parted for its work. 8 9 To get it on the system to restore, please do the following as root: 10 11 make -f Makefile.parted2fdisk 12 make -f Makefile.parted2fdisk install 13 mv rootfs/sbin/parted2fdisk-ia64 rootfs/sbin/parted2fdisk 14 15 This will produce a binary version that will be used by mondorestore during the restoration process on ia64 to handle the GPT format. (Note again that on ia32 parte2fdisk is in fact a link to fdisk to avoid any compatibility issue) 7 Thus mindi/mondorestore commands launched by root will pass all their call to parted2fdisk on ia64 instead of the real fdisk, and be able to support the GPT format. It will call fdisk and parted for its work. (Note again that on ia32 parte2fdisk is in fact a link to fdisk to avoid any compatibility issue) 16 8 17 9 The install.sh script will setup everything correctly for you. … … 21 13 On Itanium systems you won't generally find an installed isolinux.bin file which is required by mindi to create the bootable images. You'll generally have to take an i386 package for your distribution and install it on your itanium system so that you provide the required missing file. 22 14 23 On SLES 10, fdisk is no rprovided anymore. You'll have to rebuild the util-linux package by desactivating fdisk removal in the spec file.15 On SLES 10, fdisk is not provided anymore. You'll have to rebuild the util-linux package by desactivating fdisk removal in the spec file. 24 16 25 17 Please report any problem around that tool to bruno@mondorescue.org 26 18 Bruno. 27 19 20 2013-06-08 no binary made anymore, only perl scripts 28 21 2005-12-12 parted2fdisk used everywhere 29 22 2005-03-23 Explain compilation and backup/restore split -
branches/3.1/mindi/README.pxe
r2937 r3147 11 11 label mondo 12 12 kernel vmlinuz-mondo 13 append initrd=initrd-mondo load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=131072 rw root=/dev/ram iso acpi=off apm=off devfs=nomount exec-shield=0 pxe [proto=nfs|sshfs] [prefix=machine] [ipconf=(ipdev:ipadr:netmask:broadcast:gateway|ipdev:dhcp)] [hwaddr=M:A:C:A:D:R] [netfsmount=server:mountpoint] [netfsopt=-o option][netfspath=local_path] [ping=#] ...13 append initrd=initrd-mondo load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=131072 selinux=0 rw root=/dev/ram iso acpi=off apm=off devfs=nomount exec-shield=0 pxe [proto=nfs|sshfs|smbfs] [prefix=machine] [ipconf=(ipdev:ipadr:netmask:broadcast:gateway|ipdev:dhcp)] [hwaddr=M:A:C:A:D:R] [netfsmount=server:mountpoint] [netfsopt=-o option][netfspath=local_path] [ping=#] ... 14 14 15 15 ipdev is the device name (e.g. eth2) … … 20 20 dhcp is a keyword. Using it will provide all the previous 4 values to activate the LAN interface. 21 21 hwaddr is the MAC address of the device you want to use to restore through 22 proto is the protocol to use for mounting the remote share (default is NFS, sshfs isalso available)22 proto is the protocol to use for mounting the remote share (default is NFS, sshfs and smbfs are also available) 23 23 server is the ip addr of the Remote Network server 24 24 mountpoint is the mount point on the Remote Network server to use (if NFS, should be in /etc/exports of the NFS server) … … 27 27 netfspath is the local path on the remote server where the image is located, if different from the one at backup time. 28 28 local_path is the local directory under which the mage was made (with the -d option) 29 rmadisk_size may have to be increase to 131072 on more recent distributions such as rhel 529 rmadisk_size may have to be increase to 262144 or more on more recent distributions such as RHEL 6 30 30 The [] mean this parameter is optional 31 31 The () mean that you have a choice with the '|' meaning 'or' … … 49 49 CAVEAT: the limit to the number of char on the append line is 255. Use symlinks to reduce the size of your path if needed. 50 50 51 NOTE: If you don't have selinux=0 on the boot line, you may have issues restoring extended attributes on your filesystem and thus be unable to log on at next reboot after restore. 52 51 53 Please report any problem around that tool to bruno_at_mondorescue.org 52 54 -
branches/3.1/mindi/analyze-my-lvm
r2937 r3147 13 13 GetValueFromField() { 14 14 local res 15 sed s/' '/~/ "$1" | tr -s ' ' ' ' | sed s/'~ '/'~'/ | grep -i "$2~" | cut -d'~' -f2,3,4,5 | tr '~' ' ' | gawk '{ if ($2=="MB") {printf "%dm",$1;} else if ($2=="MiB") {printf "%dm",$1;} else if ($2=="KB") {printf "%dk",$1;} else if ($2=="KiB") {printf "%dk",$1;} else if ($2=="GB") {printf "%fg",$1;} else if ($2=="GiB") {printf "%fg",$1;} else if ($2=="TB") {printf "%dt",$1;} else if ($2=="TiB") {printf "%dt",$1;} else {print $0;};}'15 grep -i "$2" "$1" | perl -pi -e 's/\s*(.*)\s\s\s+(.+)$/$2/;s/\sT[i]*B/t/;s/\sG[i]*B/g/;s/\sM[i]*B/m/;s/\sK[i]*B/k/' 16 16 } 17 17 … … 54 54 # Exclude LVs member of that env var 55 55 if [ "$MINDI_EXCLUDE_DEVS" ] ; then 56 list_of_devices="`mindi -- readalllink $LV_full_string`"56 list_of_devices="`mindi --nolog --readalllink $LV_full_string 2> /dev/null`" 57 57 l="" 58 58 for d in $list_of_devices; do … … 84 84 device=$1 85 85 output="" 86 $LVMCMD lvdisplay $device > $fname86 $LVMCMD lvdisplay $device | cat > $fname 87 87 stripes=`GetValueFromField $fname "Stripes"` 88 88 stripesize=`GetValueFromField $fname "Stripe size (MByte)"`m … … 90 90 [ "$stripesize" = "k" ] && stripesize="" 91 91 allocation=`GetValueFromField $fname "LV Size"` 92 [ ! "`echo "$allocation" | grep "[k,m,g ]"`" ] && allocation="$allocation"m92 [ ! "`echo "$allocation" | grep "[k,m,g,t]"`" ] && allocation="$allocation"m 93 93 if echo "$allocation" | grep -E '^.*g$' > /dev/null 2> /dev/null ; then 94 94 val=`echo "$allocation" | sed s/g//` … … 127 127 128 128 129 130 131 129 ProcessVolumeGroup() { 132 130 local current_VG physical_volumes i list_of_devices VG_params … … 152 150 # If multipath check which type of devide are given, mpath prefered 153 151 for d in $list_of_devices; do 154 l="$l `mindi -- readalllink $d`"152 l="$l `mindi --nolog --readalllink $d 2> /dev/null`" 155 153 l="$l `GiveMapperOfdm $d`" 156 154 done … … 184 182 skip=0 185 183 l="" 186 l="$l `mindi -- readalllink $d`"184 l="$l `mindi --nolog --readalllink $d 2> /dev/null`" 187 185 l="$l `GiveMapperOfdm $d`" 188 186 list_of_devices="`echo $l | sort -u`" … … 207 205 for d in `cat $MINDI_TMP/pv.tmp2`; do 208 206 skip=0 209 l="$l `mindi -- readalllink $d`"207 l="$l `mindi --nolog --readalllink $d 2> /dev/null`" 210 208 l="$l `GiveMapperOfdm $d`" 211 209 list_of_devices="`echo $l | sort -u`" … … 239 237 GiveMapperOfdm () { 240 238 241 major=`stat - c "%t" $1 2> /dev/null`242 minor=`stat - c "%T" $1 2> /dev/null`239 major=`stat -L -c "%t" $1 2> /dev/null` 240 minor=`stat -L -c "%T" $1 2> /dev/null` 243 241 244 242 for i in `ls /dev/mapper/*`; do 245 mj=`stat - c "%t" $i`246 mn=`stat - c "%T" $i`243 mj=`stat -L -c "%t" $i` 244 mn=`stat -L -c "%T" $i` 247 245 if [ "$mj" = "$major" ] && [ "$mn" = "$minor" ]; then 248 246 echo "$i" 249 247 return 250 248 fi 249 done 250 echo $1 251 } 252 253 GiveVGLVOfdm () { 254 255 major=`stat -L -c "%t" $1 2> /dev/null` 256 minor=`stat -L -c "%T" $1 2> /dev/null` 257 258 for v in `vgs --noheadings | awk '{print $1}'`; do 259 for i in `ls /dev/$v/*`; do 260 mj=`stat -L -c "%t" $i` 261 mn=`stat -L -c "%T" $i` 262 if [ "$mj" = "$major" ] && [ "$mn" = "$minor" ]; then 263 echo "$i" 264 return 265 fi 266 done 251 267 done 252 268 echo $1 … … 292 308 293 309 ListAllLogicalVolumesSortedBydm() { 294 for d in `ListAllLogicalVolumes` ; do 295 dm=`mindi --readalllink $d | tail -1` 296 echo "$dm|$d" >> $MINDI_TMP/sorteddm 297 done 298 sort -t'|' $MINDI_TMP/sorteddm | cut -d'|' -f2 310 rm -f $MINDI_TMP/sorteddm 311 for d in `ListAllLogicalVolumes` ; do 312 dm=`mindi --nolog --readalllink $d 2> /dev/null | tail -1` 313 echo "$dm|$d" >> $MINDI_TMP/sorteddm 314 done 315 if [ -f $MINDI_TMP/sorteddm ]; then 316 cut -d'-' -f2- $MINDI_TMP/sorteddm | sort -t'|' -n | cut -d'|' -f2 317 fi 299 318 } 300 319 … … 333 352 # -------------------------------- main ----------------------------------- 334 353 354 # These exports are needed to avoid bad formating of display commands (, instead of . for separator e.g.) 355 # Fix #654 356 export LANG=C 357 export LANGUAGE=C 358 335 359 if [ "$1" = "--givemapperofdm" ] ; then 336 360 shift 337 361 if [ _"$1" != _"" ] ; then 338 362 GiveMapperOfdm $1 363 fi 364 exit 0 365 fi 366 367 if [ "$1" = "--givevglvofdm" ] ; then 368 shift 369 if [ _"$1" != _"" ] ; then 370 GiveVGLVOfdm $1 339 371 fi 340 372 exit 0 -
branches/3.1/mindi/deplist.d/ProLiant.conf
r2937 r3147 10 10 # XML file under /opt/hp/hp-scripting-tools/etc/conrep.xml 11 11 /sbin/hp-conrep 12 /sbin/hp-rcu 13 /sbin/hp-fm 12 14 13 15 # Previous method -
branches/3.1/mindi/deplist.d/addon.conf
r2409 r3147 4 4 # 5 5 /usr/games/petris 6 /usr/bin/nano -
branches/3.1/mindi/deplist.d/base.conf
r2937 r3147 77 77 /usr/bin/head 78 78 /usr/bin/less 79 # On ArchLinux 80 /bin/less 79 81 80 /usr/bin/sort 82 81 /usr/bin/uniq -
branches/3.1/mindi/deplist.d/fs.conf
r2409 r3147 5 5 /sbin/mkfs 6 6 /sbin/mkswap 7 /sbin/swaplabel 7 8 /sbin/mke2fs 8 9 /sbin/mkfs.ext2 … … 20 21 /sbin/mkfs.minix 21 22 /sbin/mkfs.ocfs2 23 /sbin/mkfs.btrfs 22 24 23 25 # … … 34 36 /sbin/fsck.jfs 35 37 /sbin/badblocks 38 /sbin/btrfsck 36 39 37 # ext2/3 40 # ext2/3/4 38 41 # 39 42 /sbin/e2label 43 /sbin/e4label 40 44 /sbin/tune2fs 45 /sbin/tune4fs 41 46 /etc/mke2fs.conf 42 47 … … 53 58 /sbin/make_reiser4 54 59 /sbin/measurefs.reiser4 60 61 # 62 # BTRFS 63 # 64 /sbin/btrfs 65 /sbin/btrfs-convert 66 /sbin/btrfsctl 67 /sbin/btrfs-debug-tree 68 /sbin/btrfs-image 69 /sbin/btrfs-map-logical 70 /sbin/btrfs-show 71 /sbin/btrfstune 72 /sbin/btrfs-vol 73 /sbin/btrfs-zero-log 55 74 56 75 # -
branches/3.1/mindi/deplist.d/minimal.conf
r2937 r3147 9 9 # Used by init 10 10 /bin/sh 11 /bin/bash 12 /bin/mt 11 13 /bin/awk 12 14 /usr/bin/awk … … 77 79 /lib/libnss_files.so.2 78 80 /sbin/shutdown 81 /etc/init.d/functions 82 /etc/init.d/functions 83 /etc/rc.d/functions 84 /usr/bin/grep 79 85 80 86 # Compression … … 84 90 /sbin/klogd 85 91 /sbin/syslogd 92 /sbin/rsyslogd 86 93 # On ArchLinux 87 94 /usr/sbin/syslog-ng … … 94 101 /bin/mount 95 102 /sbin/losetup 103 /sbin/mount.nfs 104 /sbin/mount.nfs4 105 /etc/rpc 106 /etc/netconfig 107 /usr/bin/sshfs 108 /sbin/mount.fuse 109 /usr/bin/fusermount 110 # On ArchLinux 111 /bin/fusermount 112 /usr/bin/ssh 113 # Required by ssh as dlopened 114 /lib/libnss_compat.so 115 /usr/lib/libnss_compat.so 116 /usr/lib64/libnss_compat.so 117 /lib/libnss_compat.so.2 118 /usr/lib/libnss_compat.so.2 119 /usr/lib64/libnss_compat.so.2 120 /lib/libnss_files.so 121 /usr/lib/libnss_files.so 122 /usr/lib64/libnss_files.so 123 /lib/libnss_files.so.2 124 /usr/lib/libnss_files.so.2 125 /usr/lib64/libnss_files.so.2 126 /etc/ssh 127 /usr/bin/ulockmgr_server 128 #On ArchLinux 129 /bin/ulockmgr_server 130 /sbin/mount.cifs 131 /sbin/mount.cifs3 132 /sbin/mount.smb 133 /sbin/mount.smb3 134 /sbin/mount.smbfs 135 /sbin/mount.smbfs3 96 136 /sbin/mount.ntfs 97 137 /sbin/mount.ntfs-3g 98 138 /sbin/fstab-decode 99 139 100 # For udev/devfs140 # For devfs 101 141 /sbin/MAKEDEV 102 /etc/init.d/functions103 142 # On ArchLinux 104 143 /etc/rc.d/functions 105 144 /etc/services 106 145 /sbin/devfsd 107 /etc/udev108 /etc/hotplug.d109 /sbin/udev.static110 /sbin/udevsend111 /sbin/udevd112 146 /sbin/hwup 113 147 /sbin/path_id … … 129 163 /sbin/hwup 130 164 165 /sbin/usb_id 166 /sbin/vol_id 167 /sbin/pam_console_apply 168 169 # For upstart/systemd 170 /etc/init 171 /sbin/start 172 /sbin/stop 173 /sbin/status 174 /sbin/shutdown 175 /sbin/initctl 176 131 177 # Modules 132 178 /sbin/insmod 133 179 /sbin/lsmod 134 # On ArchLinux 180 /sbin/kmod 181 # On SLES 11 SP2 135 182 /bin/lsmod 183 # On ArchLinux 184 /usr/bin/lsmod 185 /usr/bin/insmod 186 /usr/bin/kmod 136 187 /sbin/modprobe 137 188 /etc/modprobe.d … … 168 219 # Not completely mandatory 169 220 /usr/bin/tty 221 # Network System Tools 222 /bin/ping 223 /sbin/ifconfig 224 /sbin/route 225 /sbin/rpcbind 226 227 # Busybox 228 /usr/lib/mindi/rootfs/bin/busybox 229 /usr/lib64/mindi/rootfs/bin/busybox -
branches/3.1/mindi/deplist.d/net.conf
r2508 r3147 10 10 /usr/bin/scp 11 11 12 # DHCP 13 /sbin/dhclient 14 /sbin/dhclient-script 15 /var/lib/dhcp/dhclient.leases 16 /var/lib/dhclient/dhclient.leases 17 /var/lib/dhclient 18 # On ArchLinnux 19 /usr/sbin/dhcpcd 20 /var/lib/dhcpd 21 12 22 # Useful for debug 13 23 /usr/sbin/ethtool -
branches/3.1/mindi/install.sh
r2513 r3147 40 40 MINDIVER=PBVER 41 41 MINDIREV=PBREV 42 VERSTR=${MINDIVER}-r${MINDIREV} 42 43 ARCH=`/bin/uname -m` 43 echo "mindi $ {MINDIVER}-r${MINDIREV}will be installed under $local"44 echo "mindi $VERSTR will be installed under $local" 44 45 45 46 if [ _"$MINDI_CACHE" = _"" ]; then … … 78 79 install -m 644 $f $conf/deplist.d 79 80 done 80 for f in mindi-bkphw mindi-get-perl-modules parted2fdisk.pl; do81 install -m 755 $f $local/sbin82 done83 81 84 82 # Substitute variables for mindi 85 83 sed -e "s~^MINDI_PREFIX=XXX~MINDI_PREFIX=$sublocal~" -e "s~^MINDI_CONF=YYY~MINDI_CONF=$subconf~" -e "s~^MINDI_DATA=LLL~MINDI_DATA=$sublocaldata~" -e "s~^MINDI_CACHE=CCC~MINDI_CACHE=$MINDI_CACHE~" mindi > $local/sbin/mindi 86 84 sed -e "s~^MINDI_CONF=YYY~MINDI_CONF=$subconf~" -e "s~^export MINDI_CACHE=CCC~export MINDI_CACHE=$MINDI_CACHE~" rootfs/sbin/init > $localdata/mindi/rootfs/sbin/init 87 chmod 755 $local/sbin/mindi $local/sbin/mindi-bkphw 88 85 chmod 755 $local/sbin/mindi 89 86 install -m 644 mindi.8 $MANDIR 90 87 #install -m 644 ChangeLog COPYING README README.ia64 README.pxe TODO INSTALL svn.log $DOCDIR 88 89 # Manage perl script man pages 90 for s in mindi-bkphw mindi-get-perl-modules parted2fdisk.pl; do 91 install -m 755 $s $local/sbin 92 pod2man -c "$s a MondoRescue tool" --section=8 --release="$VERSTR" $local/sbin/$s > $s.8 93 install -m 644 $s.8 $MANDIR 94 # Generate the list of perl modules needed at restore time for mindi 95 cat > $conf/perl-scripts << EOF 96 $sublocal/sbin/$s 97 EOF 98 done 99 (cd $MANDIR ; ln -s parted2fdisk.pl.8 parted2fdisk.9) 100 101 if [ "_$PREFIX" = "_" ] && [ ! -f $locallib/mindi/rootfs/bin/busybox ]; then 102 echo "WARNING: no busybox found, mindi will not work on this arch ($ARCH)" 103 fi 91 104 92 105 # Managing parted2fdisk … … 96 109 else 97 110 # FHS requires fdisk under /sbin 98 (cd $local/sbin && ln -sf /sbin/fdisk parted2fdisk)111 (cd $local/sbin && ln -sf ../../sbin/fdisk parted2fdisk) 99 112 echo "Symlinking fdisk to parted2fdisk" 100 113 ( cd $localdata/mindi/rootfs/sbin && ln -sf fdisk parted2fdisk) … … 109 122 fi 110 123 111 # Generate the list of perl modules needed at restore time for mindi112 cat > $conf/perl-scripts << EOF113 $sublocal/sbin/mindi-get-perl-modules114 $sublocal/sbin/mindi-bkphw115 $sublocal/sbin/parted2fdisk.pl116 EOF117 118 124 exit 0 -
branches/3.1/mindi/mindi
r2937 r3147 21 21 # In case of problem with udev you can try to add udevdebug 22 22 MINDI_ADDITIONAL_BOOT_PARAMS="devfs=nomount noresume selinux=0 barrier=off udevtimeout=10" 23 MINDI_DEFAULT_BOOT_OPTION="interactive" 24 # For a CD Recovery use 10000 instead rather. Beware till Hardcoded below. Planned to be changed on the perl version 25 # So this parameter only applies to non CD recovery. 26 MINDI_BOOT_TIMEOUT="300" 23 27 24 28 MINDI_REV=PBREV … … 35 39 TMPDIR=/tmp 36 40 37 EXTRA_SPACE= 80152# increase if you run out of ramdisk space38 BOOT_SIZE= 36864# size of the boot disk41 EXTRA_SPACE=120000 # increase if you run out of ramdisk space 42 BOOT_SIZE=65600 # size of the boot disk 39 43 40 44 PROMPT_MAKE_CD_IMAGE="yes" … … 58 62 MY_FSTAB=/etc/fstab 59 63 TAPE_MODS="ht st osst ide-tape ide_tape" 60 SCSI_MODS="3w-xxxx 3w_xxxx 3w_9xxx 3w-9xxx 53c7,8xx a100u2w a320raid aacraid adpahci advansys aha152x aha1542 aha1740 aic79xx aic79xx_mod aic7xxx aic7xxx_mod aic7xxx_old AM53C974 atp870u BusLogic cciss cpqfc hpsa dmx3191d dpt_i2o dtc eata eata_dma eata_pio fdomain gdth g_NCR5380 i2o_block i2o_core ide-scsi ieee1394 imm in2000 initio ips iscsi iscsi_tcp libiscsi scsi_transport_iscsi libiscsi_tcp isp megaraid megaraid_mm megaraid_mbox megaraid_sas mega_sr mptbase mptscsih mptsas mptspi mptfc mptscsi mptctl NCR53c406a ncr53c8xx nsp32 pas16 pci2000 pci2220i pcmcia ppa psi240i qla1280 qla2200 qla2300 qla2400 qla2xxx qla2xxx_conf qlogicfas qlogicfc qlogicisp qlogicfas qlogicfas408 raw1394 scsi_mod scsi_transport_sas scsi_transport_spi scsi_transport_fc sd_mod crc_t10dif crc-t10dif seagate sg sim710 sr_mod sym53c416 sym53c8xx sym53c8xx_2 t128 tmscsim u14-34f ultrastor wd7000 vmhgfs intermodule scsi_dh scsi_tgt emcpdm emcpgpx emcpmpx emcpdc395x diskdumplib scsi_dump_register arcmsr"64 SCSI_MODS="3w-xxxx 3w_xxxx 3w_9xxx 3w-9xxx 53c7,8xx a100u2w a320raid aacraid adpahci advansys aha152x aha1542 aha1740 aic79xx aic79xx_mod aic7xxx aic7xxx_mod aic7xxx_old AM53C974 atp870u BusLogic cciss cpqfc hpsa dmx3191d dpt_i2o dtc eata eata_dma eata_pio fdomain gdth g_NCR5380 i2o_block i2o_core ide-scsi ieee1394 imm in2000 initio ips iscsi be2iscsi cxgb3i cxgb3 cxgb4i cxgb4 libcxgbi iscsi_boot_sysfs iscsi_target_mod iscsi_tcp libiscsi libiscsi2 scsi_transport_iscsi scsi_transport_iscsi2 libiscsi_tcp uio isp megaraid megaraid_mm megaraid_mbox megaraid_sas mega_sr mptbase mptscsih mptsas mptspi mptfc mptscsi mptctl NCR53c406a ncr53c8xx nsp32 pas16 pci2000 pci2220i pcmcia ppa psi240i qla1280 qla2200 qla2300 qla2400 qla2xxx qla2xxx_conf qlogicfas qlogicfc qlogicisp qlogicfas qlogicfas408 raw1394 scsi_mod scsi_transport_sas scsi_transport_spi scsi_transport_fc sd_mod crc_t10dif crc-t10dif seagate sg sim710 sr_mod sym53c416 sym53c8xx sym53c8xx_2 t128 tmscsim u14-34f ultrastor wd7000 vmhgfs intermodule scsi_dh scsi_tgt emcpdm emcpgpx emcpmpx emcp scsi_dh_emc scsi_dh_alua dc395x diskdumplib scsi_dump_register arcmsr" 61 65 62 66 # ide-probe-mod 63 IDE_MODS="ide ide-floppy floppy ide-generic ide-detect ide-mod ide-disk ide_disk ide-cd ide_cd ide_cd_mod ide-cd_mod ide-cs ide-core ide_core ide-gd_mod ide_gd_mod edd paride ata_generic ide_pci_generic ata_piix libata dock via82cxxx generic nvidia ahci libahci sata_nv cmd64x pata_ amd pata_marvell pata_serverworks pata_sis pata_sil680 pata_jmicron pata_atiixpamd74xx sis5513 jmicron sata_promise sata_via serverworks sata_svw blkbk virtio virtio_ring virtio_pci virtio_blk virtio_balloon"67 IDE_MODS="ide ide-floppy floppy ide-generic ide-detect ide-mod ide-disk ide_disk ide-cd ide_cd ide_cd_mod ide-cd_mod ide-cs ide-core ide_core ide-gd_mod ide_gd_mod edd paride ata_generic ide_pci_generic ata_piix libata dock via82cxxx generic nvidia ahci libahci sata_nv cmd64x pata_via pata_amd pata_marvell pata_serverworks pata_sis pata_sil680 pata_jmicron pata_atiixp pata_acpi amd74xx sis5513 jmicron sata_promise sata_via serverworks sata_svw blkbk virtio virtio_ring virtio_pci virtio_blk virtio_balloon" 64 68 PCMCIA_MODS="pcmcia_core ds yenta_socket" 65 USB_MODS="usb-storage usb-ohci usb-uhci usbcore usb_ storage input hiduhci_hcd ehci_hcd uhci-hcd ehci-hcd ohci-hcd ohci_hcd xhci usbkbd usbhid keybdev mousedev libusual scsi_mod ff-memless ums_cypress ums-cypress cp210x usbserial"66 NET_MODS="auth_rpcgss sunrpc nfs nfs_acl lockd fscache loop mii 3c59x e100 bcm5700 bnx2 bnx2x bnx2i mdio e1000 e1000e igb dca eepro100 ne2k-pci tg3 libphy pcnet32 8139cp 8139too 8390 forcedeth vmxnet vmxnet3 vmnet exportfs fuse libcrc32c crc32c netbk xenblktap r8169 virtio_net"69 USB_MODS="usb-storage usb-ohci usb-uhci usbcore usb_common usb-common usb_storage input hid hid_generic uhci_hcd ehci_hcd uhci-hcd ehci-hcd ohci-hcd ohci_hcd xhci usbkbd usbhid keybdev mousedev libusual scsi_mod ff-memless ums_cypress ums-cypress cp210x usbserial" 70 NET_MODS="auth_rpcgss sunrpc nfs nfs_acl lockd fscache loop mii 3c59x e100 bcm5700 cnic be2net 8021q bnx2 bnx2x bnx2i mdio e1000 e1000e igb dca eepro100 ne2k-pci tg3 libphy pcnet32 8139cp 8139too 8390 forcedeth vmxnet vmxnet3 vmnet exportfs fuse crc32c libcrc32c netbk xenblktap r8169 virtio_net via_rhine garp" 67 71 CDROM_MODS="$TAPE_MODS $IDE_MODS $USB_MODS $PCMCIA_MODS $SCSI_MODS $NET_MODS af_packet cdrom isocd isofs inflate_fs nls_iso8859-1 nls_base nls_cp437 nls_utf8 sg sr_mod zlib_inflate iso9660 vfat fat" 68 72 # Those modules will only go on the backup media, not the boot media. 69 EXTRA_MODS="$CDROM_MODS loop md-mod linear raid0 raid1 xor raid10 raid5 raid456 raid6_pq async_pq xor async_tx async_memcpy async_xor lvm-mod dm-mod dm_mod dm-snapshot dm_snapshot dm-zero dm_zero dm-mirror dm_mirror dm-multipath dm-round-robin dm-emc dm-hp-sw dm-rdac dm-region-hash dm-snapshot dm-log multipath jfs xfs xfs_support pagebuf reiserfs ext2 ext3 minix nfs nfs_acl nfsd lockd sunrpc jbd mbcache ext4 jbd2 crc16 ocfs2 ocfs2_dlm ocfs2_nodemanager configfs"73 EXTRA_MODS="$CDROM_MODS loop md-mod linear raid0 raid1 xor raid10 raid5 raid456 raid6_pq async_pq xor async_tx async_memcpy async_xor lvm-mod dm-mod dm_mod dm-snapshot dm_snapshot dm-zero dm_zero dm-mirror dm_mirror dm-multipath dm-round-robin dm-emc dm-hp-sw dm-rdac dm-region-hash dm-snapshot dm-log multipath jfs xfs btrfs zlib_deflate xfs_support pagebuf reiserfs ext2 ext3 minix nfs nfs_acl nfsd lockd sunrpc jbd mbcache ext4 jbd2 crc16 ocfs2 ocfs2_dlm ocfs2_nodemanager configfs vxodm vxgms vxglm gab llt dmpaa vxspec vxio vxdmp vxportal fdd vxfs " 70 74 # Replace with that line for HP OCMP e.g. 71 75 #DENY_MODS="MPS_Driver_Mapper mps octtldrv tscttl streams kqemu fdomain" 72 DENY_MODS="kqemu "76 DENY_MODS="kqemu vxfen" 73 77 # Force some modules to be included 74 78 FORCE_MODS="" … … 118 122 fi 119 123 124 125 # Function to log on screen only 126 LogScreen() { 127 if [ -e /dev/stderr ] ; then 128 echo -e "$1" >> /dev/stderr 129 elif [ -e /usr/bin/logger ] ; then 130 /usr/bin/logger -s $1 131 fi 132 } 133 134 # Function to log in log file only 135 LogFile() { 136 137 echo -e "$1" >> $LOGFILE 138 if [ _"$2" != _"" ]; then 139 grep -Ev "tar: Removing \`/\'" "$2" >> $LOGFILE 140 fi 141 rm -f "$2" 142 } 143 144 # Function to log in both screen and logfile 145 LogAll() { 146 LogScreen "$1" 147 LogFile "$1" "$2" 148 } 149 150 # Preserved for compatibility 151 LogIt() { 152 LogAll "$1" "$2" 153 } 154 120 155 # Last function called before exiting 121 156 # Parameter is exit code value … … 126 161 if [ _"$MONDO_SHARE" != _"" ] ; then 127 162 echo "------------- mindi logfile included -------------------------" >> /var/log/mondoarchive.log 128 cat $LOGFILE >> /var/log/mondoarchive.log 163 if [ -f $LOGFILE ]; then 164 cat $LOGFILE >> /var/log/mondoarchive.log 165 else 166 echo "No LOGFILE available in that mindi run" >> /var/log/mondoarchive.log 167 fi 129 168 echo "--------------------------------------------------------------">> /var/log/mondoarchive.log 130 169 fi … … 139 178 exit $1 140 179 } 141 142 LogOnly() {143 echo -e "$1" >> $LOGFILE144 if [ _"$2" != _"" ]; then145 grep -Ev "tar: Removing \`/\'" "$2" >> $LOGFILE146 fi147 rm -f "$2"148 }149 150 # Function to log on screen only151 LogScreen() {152 if [ -e /dev/stderr ] ; then153 echo -e "$1" >> /dev/stderr154 elif [ -e /usr/bin/logger ] ; then155 /usr/bin/logger -s $1156 fi157 }158 159 # Function to log in log file only160 LogFile() {161 162 echo -e "$1" >> $LOGFILE163 if [ _"$2" != _"" ]; then164 grep -Ev "tar: Removing \`/\'" "$2" >> $LOGFILE165 fi166 rm -f "$2"167 }168 169 # Function to log in both screen and logfile170 LogAll() {171 LogScreen "$1"172 LogFile "$1" "$2"173 }174 175 # Preserved for compatibility176 LogIt() {177 LogAll "$1" "$2"178 }179 180 180 181 181 Die() { … … 239 239 [ "$KBDEPTH" -gt "128" ] && Die "Edit $MINDI_SBIN/mindi and disable FindAndAddUserKeyboardMappingFile (line 2160, approx.)" 240 240 if [ -e "$bigdir/$mappath" ] ; then 241 LogFile " $mappath already added"241 LogFile "INFO: $mappath already added" 242 242 return 243 243 elif [ -d "$bigdir/$mappath" ] ; then … … 245 245 return 246 246 fi 247 LogFile " Added kbd map $mappath"247 LogFile "INFO: Added kbd map $mappath" 248 248 if [ ! -e "$mappath" ] ; then 249 249 mappath=`grep "i[3-8]86" $MINDI_TMP/keymaps.find | grep "$locale[^r][^/]" | grep -vx " *#.*"` 250 250 if [ ! -e "$mappath" ] ; then 251 LogAll " Cannot add $mappath: kbd map file not found"251 LogAll "WARNING: Cannot add $mappath: kbd map file not found" 252 252 return 253 253 fi 254 else 255 echo -en "`basename $mappath | tr '.' '#' | sed s/#kmap#gz// | sed s/#inc#gz//` " | tr '#' '.' 254 256 fi 255 257 … … 257 259 mkdir -p $bigdir/etc 258 260 # TODO: why not use the cp.lis here ? 259 tar cf - -C / $mappath 2>> $MINDI_TMP/$$.log | (cd "$bigdir" ; tar xf -) || LogAll " AKMF -- Could not copy $mappath to $bigdir" $MINDI_TMP/$$.log261 tar cf - -C / $mappath 2>> $MINDI_TMP/$$.log | (cd "$bigdir" ; tar xf -) || LogAll "WARNING: AKMF -- Could not copy $mappath to $bigdir" $MINDI_TMP/$$.log 260 262 if [ "`echo $mappath | grep -F ".gz"`" ] ; then 261 included_list=`gzip -dc $mappath | grep -Fi include | sed s/'"'// | sed s/'"'//| cut -d' ' -f2`263 included_list=`gzip -dc $mappath | grep -Fi include | sed s/'"'//g | cut -d' ' -f2` 262 264 else 263 included_list=`grep -Fi include $mappath | sed s/'"'// | sed s/'"'//| cut -d' ' -f2`265 included_list=`grep -Fi include $mappath | sed s/'"'//g | cut -d' ' -f2` 264 266 fi 265 267 for included_item in $included_list ; do … … 278 280 279 281 CopyDependenciesToDirectory() { 280 local outdir incoming fname counter d found282 local outdir incoming counter d found tdir 281 283 outdir=$1 282 noof_lines=$2283 284 mkdir -p $outdir 284 285 incoming=`ReadLine` 285 progress=0286 counter=0 286 287 while [ "$incoming" != "" ] ; do 287 288 # Non absolute file names should not arrive till here => skipped 288 289 if [ `echo "$incoming" | cut -c1` != '/' ]; then 289 LogAll " Unable to handle $incoming"290 LogAll "WARNING: Unable to handle $incoming" 290 291 incoming=`ReadLine` 291 292 continue … … 298 299 d=`dirname "$d"` 299 300 done 300 if [ -d "$incoming" ] && [ ! -h "$incoming" ]; then301 if [ -d "$incoming" ]; then 301 302 find $incoming/* -maxdepth 0 2> /dev/null | CopyDependenciesToDirectory $outdir 0 302 303 elif [ -e "$incoming" ] && [ $found = "false" ]; then 303 tar cf - -C / $incoming 2>> $MINDI_TMP/$$.log | (cd "$outdir" ; tar xf -) || Die "Cannot copy $incoming to $outdir - did you run out of disk space?" $MINDI_TMP/$$.log 304 304 if [ ! -h "$incoming" ]; then 305 tar cf - -C / $incoming 2>> $MINDI_TMP/$$.log | (cd "$outdir" ; tar xf -) || Die "Cannot copy $incoming to $outdir - did you run out of disk space?" $MINDI_TMP/$$.log 306 else 307 tdir=`dirname "$incoming"` 308 if [ ! -e "$outdir/$tdir" ]; then 309 mkdir -p "$outdir/$tdir" 310 fi 311 cp --no-dereference --preserve=all $incoming "$outdir/$tdir" 312 fi 305 313 # Only uncompress modules if not using udevd 306 314 if [ "`echo "$incoming" | grep "lib/modules/.*\..*o\.gz"`" != "" ] && [ "`ps auxww | grep -v grep | grep -qw udevd`" != "" ]; then 307 gunzip -f $outdir/$incoming || LogAll " Cannot gunzip $outdir/$incoming"308 fi 309 [ -x "$outdir" ] && StripExecutable $outdir "-$filename-"310 progress=$(($progress+1))311 LogProgress $ progress $noof_lines315 gunzip -f $outdir/$incoming || LogAll "WARNING: Cannot gunzip $outdir/$incoming" 316 fi 317 [ -x "$outdir" ] && StripExecutable $outdir 318 counter=$(($counter+1)) 319 LogProgress $counter $2 312 320 fi 313 321 incoming=`ReadLine` … … 326 334 327 335 328 329 336 DropOptimizedLibraries() { 330 local outdir filelist list_of_optimized_libraries optimized_lib_name vanilla_lib_name reason msg resolved res progress337 local outdir filelist list_of_optimized_libraries optimized_lib_name vanilla_lib_name reason msg resolved res 331 338 filelist=$1 332 339 outdir=$2 333 340 334 progress=0335 341 list_of_optimized_libraries=`grep "lib/i[5-7]86/" $filelist` 336 342 if [ "$list_of_optimized_libraries" = "" ] ; then 337 343 return 0 338 else339 noof_lines=`echo $list_of_optimized_libraries | tr ' ' '\n' | wc -l`340 344 fi 341 345 echo -en "Dropping i686-optimized libraries if appropriate" 342 346 for optimized_lib_name in $list_of_optimized_libraries ; do 347 echo -en "." 343 348 reason="" 344 349 vanilla_lib_name=`echo "$optimized_lib_name" | sed -e 's/i[5-7]86//' -e 's/cmov//' -e 's/nosegneg//' | tr -s '/' '/'` 345 350 echo "$vanilla_lib_name" >> $filelist 346 LogFile " Adding $vanilla_lib_name to filelist"351 LogFile "INFO: Adding $vanilla_lib_name to filelist" 347 352 mkdir -p $outdir$optimized_lib_name > /dev/null 2> /dev/null 348 353 rmdir $outdir$optimized_lib_name > /dev/null 2> /dev/null … … 350 355 # This may return multiple files 351 356 for resolved in `ReadAllLink $vanilla_lib_name`; do 352 LogFile " Adding as deps $resolved to filelist"357 LogFile "INFO: Adding as deps $resolved to filelist" 353 358 vanilla_resolved_name=`echo "$resolved" | sed -e 's/i[5-7]86//' -e 's/cmov//' -e 's/nosegneg//' | tr -s '/' '/'` 354 359 if [ "$vanilla_resolved_name" != "$resolved" ]; then … … 356 361 rmdir $outdir$resolved > /dev/null 2> /dev/null 357 362 ln -sf $vanilla_resolved_name $outdir$resolved 358 LogFile " Excluding deps $resolved"363 LogFile "INFO: Excluding deps $resolved" 359 364 grep -Fvx "$resolved" "$filelist" > $filelist.tmp 360 LogFile " Replacing it with $vanilla_resolved_name"365 LogFile "INFO: Replacing it with $vanilla_resolved_name" 361 366 echo "$vanilla_resolved_name" >> $filelist.tmp 362 367 mv -f $filelist.tmp $filelist 363 368 fi 364 369 done 365 progress=$(($progress+1))366 LogProgress $progress $noof_lines367 370 done 368 371 $AWK '{ print $1; }' $filelist | sort -u > $filelist.tmp … … 374 377 FindAndAddUserKeyboardMappingFile() { 375 378 local r res mapfile mappath included_item included_list keyfile mp locale 376 Log File "Analyzing your keyboard's configuration."379 LogAll "INFO: Analyzing your keyboard's configuration." 377 380 KEYDIR=/lib/kbd 378 381 [ ! -e "$KEYDIR" ] && KEYDIR=/usr/share/kbd # Slackware … … 382 385 [ ! -e "$KEYDIR" ] && KEYDIR=/etc/condole-setup 383 386 if [ ! -e "$KEYDIR" ] ; then 384 LogAll " Keyboard mapping directory not found. I shall use default map at boot-time."387 LogAll "WARNING: Keyboard mapping directory not found. I shall use default map at boot-time." 385 388 return 0 386 389 fi 387 LogFile "Adding the following keyboard mapping tables: "388 390 if [ -e "/etc/sysconfig/keyboard" ] ; then 389 LogFile " Red Hat-style config detected."391 LogFile "INFO: Red Hat-style config detected." 390 392 keyfile=/etc/sysconfig/keyboard 391 393 elif [ -e "/etc/rc.d/rc.keymap" ] ; then 392 LogFile " Slackware-style config detected."394 LogFile "INFO: Slackware-style config detected." 393 395 keyfile=/etc/rc.d/rc.keymap 394 396 elif [ -e "/etc/rc.config" ] ; then 395 LogFile " Debian-style config detected."397 LogFile "INFO: Debian-style config detected." 396 398 keyfile=/etc/rc.config 397 399 elif [ -e "/etc/console/boottime.kmap.gz" ] ; then 398 LogFile " Debian-style config detected."400 LogFile "INFO: Debian-style config detected." 399 401 mkdir -p $bigdir/tmp 400 402 echo "/etc/console/boottime.kmap.gz" > $MINDI_CACHE/KEYMAP-LIVES-HERE … … 406 408 return 0 407 409 elif [ -e "/etc/console-setup/boottime.kmap.gz" ] || [ -e "/etc/console-setup/cached.kmap.gz" ] ; then 408 LogFile " Ubuntu-style config detected."410 LogFile "INFO: Ubuntu-style config detected." 409 411 mkdir -p $bigdir/tmp 410 412 if [ -e "/etc/console-setup/boottime.kmap.gz" ] ; then … … 421 423 return 0 422 424 elif [ -e "/etc/rc.conf" ] ; then 423 echo "ArchLinux config detected." >> $LOGFILE425 LogFile "INFO: ArchLinux config detected." 424 426 keyfile=/etc/rc.conf 425 427 elif [ -e "/etc/conf.d/keymaps" ] ; then 426 LogFile " Gentoo-style config detected."428 LogFile "INFO: Gentoo-style config detected." 427 429 keyfile=/etc/conf.d/keymaps 428 430 else 429 Log All"Searching for rc.config ..."431 LogFile "Searching for rc.config ..." 430 432 keyfile=`find /etc -name rc.config | head -n1` 431 433 if [ "$keyfile" = "" ] || [ ! -e "$keyfile" ] ; then 432 LogAll " Unknown config detected. Default keyboard map will be used."434 LogAll "WARNING: Unknown config detected. Default keyboard map will be used." 433 435 return 434 436 else 435 LogFile " Found $keyfile"437 LogFile "INFO: Found $keyfile" 436 438 fi 437 439 fi 438 440 if [ ! -e "$KEYDIR/keymaps" ] ; then 439 LogAll " Keyboard mapping directory not found. Default keyboard map will be used."441 LogAll "WARNING: Keyboard mapping directory not found. Default keyboard map will be used." 440 442 return 441 443 fi 442 LogFile "keyfile=$keyfile" 443 locale=`grep -F KEYTABLE "$keyfile" | tr -d '"' |cut -d'=' -f2` 444 LogFile "INFO: keyfile=$keyfile" 445 # For SLES we need to remove the .map.gz extension Cf #614 446 locale=`grep -F KEYTABLE "$keyfile" | grep -v '^#' | tr -d '"' |cut -d'=' -f2 | sed 's/.map.gz$//'` 444 447 [ ! "$locale" ] && locale=`grep '.map$' "$keyfile" | sed 's/^.* //'` # Slackware 445 [ ! "$locale" ] && locale=`grep -E '^KEYMAP=' "$keyfile" | tr -d '"' |cut -d'=' -f2` # Gentoo & ArchLinux446 LogFile " locale=$locale"448 [ ! "$locale" ] && locale=`grep -E '^KEYMAP=' "$keyfile" | grep -v '^#' | tr -d '"' |cut -d'=' -f2` # Gentoo & ArchLinux 449 LogFile "INFO: locale=$locale" 447 450 # 448 451 # Process the keymaps dir once for all … … 455 458 echo "$mp" | grep -q " " >> $LOGFILE 456 459 if [ $? -eq 0 ]; then 457 LogAll "WARNING: Multiple keymaps found: $mp" 458 LogFile " The following one will be used"460 LogAll "WARNING: Multiple keymaps found: $mp" 461 LogFile "INFO: The following one will be used" 459 462 fi 460 463 for i in $mp ; do … … 463 466 done 464 467 if [ ! -e "$mappath" ] || [ -d "$mappath" ] ; then 465 mappath=$(find / -name "*/kbd/keymaps/*/$locale")466 fi 467 LogFile " mappath = $mappath"468 mappath=$(find / -wholename "*/kbd/keymaps/*/$locale | head -1") 469 fi 470 LogFile "INFO: mappath = $mappath" 468 471 if [ ! -e "$mappath" ] || [ -d "$mappath" ] ; then 469 LogAll " Keyboard mapping file not found. Default keyboard map will be used."472 LogAll "WARNING: Keyboard mapping file not found. Default keyboard map will be used." 470 473 return 471 474 fi 475 LogAll "INFO: Adding the following keyboard mapping tables: " 472 476 mkdir -p $bigdir/tmp 473 477 echo "$mappath" > $MINDI_CACHE/KEYMAP-LIVES-HERE … … 490 494 [ ! -e "$MBOOTC32" ] && MBOOTC32=`find / -name mboot.c32 | grep -x "/.*/mboot.c32"` 491 495 [ ! -e "$MBOOTC32" ] && Die "Please install mboot.c32 first. If your syslinux RPM doesn't include mboot.c32, you may download an isolinux RPM from Mondo's website - go to http://www.mondorescue.org/downloads.shtml" 492 LogFile " Found mboot.c32 at $MBOOTC32"496 LogFile "INFO: Found mboot.c32 at $MBOOTC32" 493 497 } 494 498 … … 502 506 [ ! -e "$ISOLINUX" ] && ISOLINUX=`find / -name isolinux.bin | grep -x "/.*/isolinux.bin"` 503 507 [ ! -e "$ISOLINUX" ] && Die "Please install isolinux first. If your syslinux RPM doesn't include isolinux, you may download an isolinux RPM from Mondo's website - go to http://www.mondorescue.org/downloads.shtml" 504 LogFile " Found isolinux.bin at $ISOLINUX"508 LogFile "INFO: Found isolinux.bin at $ISOLINUX" 505 509 } 506 510 … … 510 514 511 515 if [ ! -e "$1" ] ; then 512 LogAll "WARNING -cannot search specific path '$1'"516 LogAll "WARNING: cannot search specific path '$1'" 513 517 return 1 514 518 fi 515 519 # Find all files and links (required for some VMWare VMs) 516 modpaths=`find "$1" -name $2.*o -o -name $2.o.gz -o -name $2.ko.gz -o -name $2 -type f -o -type l`520 modpaths=`find "$1" -name $2.*o -o -name $2.o.gz -o -name $2.ko.gz -o -name $2.ko.xz -o -name $2 -type f -o -type l` 517 521 echo "$modpaths" 518 522 } … … 541 545 filelist=`GenerateListForFile "$incoming"` 542 546 r=$? 543 [ "$r" -ne "0" ] && LogAll " $incoming not found"547 [ "$r" -ne "0" ] && LogAll "WARNING: $incoming not found" 544 548 res=$(($res+$r)) 545 # LogFile " '$incoming' generates filelist '$filelist'"549 # LogFile "INFO: '$incoming' generates filelist '$filelist'" 546 550 for fname in $filelist ; do 547 551 [ "$fname" != "" ] && echo "$fname" >> $tempfile … … 610 614 progress=0 611 615 noof_lines=`cat $tempfile | wc -l` 612 LogFile "---------------------------------" 613 LogFile "List of dependencies: " 614 LogFile "---------------------------------" 616 LogFile "---------------------------------" 617 LogFile "List of dependencies: " 618 LogFile "---------------------------------" 615 619 for fname in `cat $tempfile` ; do 616 620 echo "$fname" | tee -a $LOGFILE >> $outfile.pre … … 624 628 mkdir -p $bigdir/bin 625 629 if [ -e "$MINDI_TMP/post-nuke.tgz" ] ; then 626 LogAll "\nI ncorporating post-nuke tarball"630 LogAll "\nINFO: Incorporating post-nuke tarball" 627 631 old_pwd=`pwd` 628 632 cd "$bigdir" 629 tar -zxf $MINDI_TMP/post-nuke.tgz 2>> $MINDI_TMP/$$.log || LogAll "E rror occurredwhen untarring post-nuke tarball" $MINDI_TMP/$$.log633 tar -zxf $MINDI_TMP/post-nuke.tgz 2>> $MINDI_TMP/$$.log || LogAll "ERROR: when untarring post-nuke tarball" $MINDI_TMP/$$.log 630 634 cd "$old_pwd" 631 635 fi 632 cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2>> $LOGFILE || LogAll "\nMondo v1.2x defaults to LILO as the bootloader, BTW." 636 if cp -f $MINDI_TMP/mondo*restore $bigdir/usr/bin 2>> $LOGFILE ; then 637 LocateDeps $bigdir/usr/bin/mondo*restore >> $outfile.pre 638 else 639 LogIt "ERROR: Cannot find mondo*restore in mondo's tempdir, $MINDI_TMP" 640 LogIt " I bet you've got a spare copy of Mondo or Mindi floating around on your system." 641 LogIt " If Mindi was called by Mondo then send me a bug report." 642 LogIt " It not, type 'ps ax' to see which Mondo-related process is still running then kill it. :-)" 643 LogIt " Finally, run Mindi again." 644 Die "Odd." 645 fi 646 cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2>> $LOGFILE || LogIt "\nINFO: Mondo v1.2x defaults to LILO as the bootloader, BTW." 633 647 if [ -e "$MINDI_TMP/NETFS-DEV" ] ; then 634 LogAll "\nI ncorporating NFS-related settings"635 for r in NETFS-* ; do648 LogAll "\nINFO: Incorporating Network-related settings" 649 for r in NETFS-* ISO-PREFIX ; do 636 650 cp -f $MINDI_TMP/$r $bigdir/tmp 2>> $LOGFILE || Die "Cannot copy $r - did you run out of disk space?" 637 LogFile " Copying $r to ramdisk"651 LogFile "INFO: Copying $r to ramdisk" 638 652 done 639 653 fi … … 693 707 local lcMagicExt2fs="EXT2-fs: blocksize too small for device." 694 708 local lcMagicExt3fs="<3>EXT3-fs: blocksize too small for journal device." 695 local lcMagicInitfs="<6>checking if image is initramfs...|<6>Unpacking initramfs...|<6>Trying to unpack rootfs image as 696 initramfs" 709 local lcMagicInitfs="<6>checking if image is initramfs...|<6>Unpacking initramfs...|<6>Trying to unpack rootfs image as initramfs" 697 710 698 711 # local variables … … 702 715 703 716 # say where we are. 704 LogFile " GetInitrdFilesystemToUse(): called with parameter: $lvKernelImage"717 LogFile "INFO: GetInitrdFilesystemToUse(): called with parameter: $lvKernelImage" 705 718 706 719 # verify that file exists 707 720 [ ! -f $lvKernelImage ] && Die "File $lvKernelImage not found. Terminating." 708 721 709 # Kernel may be gzip compressed 722 # Kernel may be gzip compressed - Case of RHEL5 - SLES11SP1 710 723 file $lvKernelImage 2>&1 | grep -q gzip 711 724 if [ $? -eq 0 ]; then 712 lvScanRes=`gzip -cd $lvKernelImage | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicExt3fs|$lcMagicInitfs"` 713 714 # determine which filesystem to use for initrd image: ext2|3fs, gzip'ed cpio (initramfs) or cramfs 715 if [ `echo $lvScanRes | grep -Ec "$lcMagicExt2fs"` -eq 1 ]; then 716 lvUseFilesystem="ext2fs" 717 elif [ `echo $lvScanRes | grep -Ec "$lcMagicExt3fs"` -eq 1 ]; then 718 lvUseFilesystem="ext3fs" 719 elif [ `echo $lvScanRes | grep -Ec "$lcMagicInitfs"` -eq 1 ]; then 720 lvUseFilesystem="initramfs" 721 elif [ `echo $lvScanRes | grep -Ec "$lcMagicCramfs"` -eq 1 ]; then 722 lvUseFilesystem="cramfs" 725 LogFile "INFO: Found a gzip compressed kernel $lvKernelImage" 726 lvScanRes=`gzip -cd $lvKernelImage | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicExt3fs|$lcMagicInitfs" 2> /dev/null` 727 else 728 LogFile "INFO: Found a non gzip compressed kernel $lvKernelImage" 729 # kernel is x86 boot sector in RHEL3/4 with embedded gzip content 730 # get offet of gzip magic "1f8b0800" in file (for these older kernels) 731 lvOffset=`od -vA n -t x1 $lvKernelImage | tr -d '[:space:]' | awk '{ print match($0, "1f8b0800")}' 2> /dev/null` 732 if [ $lvOffset -eq 0 ]; then 733 LogFile "INFO: gzip magic not found in file $lvKernelImage. Supposing initramfs." 734 lvScanRes=$lcMagicInitfs 723 735 else 724 lvUseFilesystem="UNSUPPORTED" 725 fi 726 736 lvOffset=`expr $lvOffset / 2` 737 LogFile "INFO: GetInitrdFilesystemToUse(): gzip magic found at lvOffset $lvOffset." 738 # scan again kernel image 739 lvScanRes=`dd ibs=1 skip=$lvOffset if=$lvKernelImage obs=1M 2>/dev/null | gunzip -c 2> /dev/null | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicExt3fs|$lcMagicInitfs" 2> /dev/null` 740 fi 741 fi 742 743 # determine which filesystem to use for initrd image: ext2|3fs, gzip'ed cpio (initramfs) or cramfs 744 if [ `echo $lvScanRes | grep -Ec "$lcMagicExt2fs"` -eq 1 ]; then 745 lvUseFilesystem="ext2fs" 746 elif [ `echo $lvScanRes | grep -Ec "$lcMagicExt3fs"` -eq 1 ]; then 747 lvUseFilesystem="ext3fs" 748 elif [ `echo $lvScanRes | grep -Ec "$lcMagicInitfs"` -eq 1 ]; then 749 lvUseFilesystem="initramfs" 750 elif [ `echo $lvScanRes | grep -Ec "$lcMagicCramfs"` -eq 1 ]; then 751 lvUseFilesystem="cramfs" 727 752 else 728 # In that case, we are after 2.6.30 and use the supported initramfs 753 # In that case, we are most probably after 2.6.30 and use the supported initramfs 754 LogFile "No automatic detection found previously. Supposing initramfs." 755 LogFile "Report on the MondoRescue mailing-list withyour log files" 729 756 lvUseFilesystem="initramfs" 730 757 fi 758 731 759 # say what we are using 732 LogFile " GetInitrdFilesystemToUse(): Filesytem to use for initial ramdisk is $lvUseFilesystem."760 LogFile "INFO: GetInitrdFilesystemToUse(): Filesytem to use for initial ram disk is $lvUseFilesystem." 733 761 734 762 # return file system to use … … 804 832 r=`find /lib/modules/$kern -type f | grep "/${module}\..*o" | tail -n1` 805 833 if [ -z "$r" ]; then 806 echo "$MODULES" | grep -wq $module 807 if [ $? -ne 0 ]; then 834 if [ "`echo "$MODULES" | grep -w $module`" ]; then 808 835 r="[live module file not found]" 809 836 else … … 813 840 [ -f "$r" ] && echo "$r" >> $outfile 814 841 fi 815 LogFile "module $module --> $r" 816 [ -f "$r" ] && echo "$r" >> $outfile 842 LogFile "INFO: module $module --> $r" 817 843 progress=$(($progress+1)) 818 844 LogProgress $progress $noof_lines … … 830 856 for fname in $incoming ; do 831 857 if [ ! -e "$fname" ] ; then 832 LogFile "WARNING - $fname does not exist; cannot be LDD'd."858 LogFile "WARNING: $fname does not exist; cannot be LDD'd." 833 859 if echo $fname | grep lvm &> /dev/null ; then 834 LogFile " This warning only affects you if you are using LVM."860 LogFile " This warning only affects you if you are using LVM." 835 861 if echo "$MODULES" | grep lvm &> /dev/null ; then 836 LogFile " I think you are, so please take heed!"862 LogFile " I think you are, so please take heed!" 837 863 else 838 LogFile " I don't think you are, so don't worry about it."864 LogFile " I don't think you are, so don't worry about it." 839 865 fi 840 866 fi 841 867 elif [ -h "$fname" ] && [ -x "$fname" ] ; then 842 LogFile " $fname is softlink"868 LogFile "INFO: $fname is softlink" 843 869 else 844 870 ldd $fname 2> /dev/null | ProcessLDD … … 850 876 # Give all symlinks recursively of a full path name 851 877 ReadAllLink() { 852 853 incoming="$*" 854 855 for file in $incoming ; do 856 if [ ! -f $file ]; then 857 continue 858 fi 859 echo "$file" 860 if [ ! -h $file ]; then 861 continue 862 fi 863 864 link=`readlink $file` 865 d=`dirname $file` 866 fchar=`echo $link | cut -c1` 867 # If mother dir is a link print it 868 if [ -h "$d" ]; then 869 echo "$d" 870 d=`readlink $d` 871 fi 872 if [ "$fchar" != "/" ]; then 873 # Relative or local link 874 ReadAllLink "$d/$link" 875 else 876 # Absolute path 877 ReadAllLink $link 878 fi 879 done 878 file="$1" 879 880 while [ `echo $file | grep -Ec '\.\./'` -ne 0 ]; do 881 # We need to normalise the path with .. in it 882 file=`echo $file | perl -pi -e 's|([^/]*)/([^/]+)/\.\./([^/]+)|$1/$3|g'` 883 done 884 echo "$file" 885 if [ ! -h $file ]; then 886 return 0 887 fi 888 889 link=`readlink $file` 890 d=`dirname $file` 891 fchar=`echo $link | cut -c1` 892 # If mother dir is a link print it 893 if [ -h "$d" ]; then 894 echo "$d" 895 d=`readlink $d` 896 fi 897 if [ "$fchar" != "/" ]; then 898 # Relative or local link 899 ReadAllLink "$d/$link" 900 else 901 # Absolute path 902 ReadAllLink $link 903 fi 880 904 } 881 905 … … 933 957 } 934 958 935 # Function to log on screen only936 LogScreen() {937 if [ -e /dev/stderr ] ; then938 echo -e "$1" >> /dev/stderr939 elif [ -e /usr/bin/logger ] ; then940 /usr/bin/logger -s $1941 fi942 }943 944 # Function to log in log file only945 LogFile() {946 947 echo -e "$1" >> $LOGFILE948 if [ _"$2" != _"" ]; then949 grep -Ev "tar: Removing \`/\'" "$2" >> $LOGFILE950 fi951 rm -f "$2"952 }953 954 # Function to log in both screen and logfile955 LogAll() {956 LogScreen "$1"957 LogFile "$1" "$2"958 }959 960 959 # Called by TurnTgzIntoRdz, to make mondorestore.cfg 961 960 MakeMondoConfigFile() { … … 963 962 outfile=$1 964 963 > $outfile 965 [ "$BACKUP_MEDIA_TYPE" ] && echo "backup-media-type $BACKUP_MEDIA_TYPE" >> $outfile966 964 [ "$TAPESIZE" ] && echo "media-size $TAPESIZE" >> $outfile 967 965 [ "$TAPEDEV" ] && echo "media-dev $TAPEDEV" >> $outfile … … 978 976 echo "use-lzo $use_lzo" >> $outfile 979 977 echo "use-gzip $use_gzip" >> $outfile 978 echo "use-star $use_star" >> $outfile 980 979 echo "use-lzma $use_lzma" >> $outfile 981 980 echo "use-comp $use_comp" >> $outfile 982 echo "use-star $use_star" >> $outfile983 981 echo "use-udev $use_udev" >> $outfile 984 982 echo "datestamp `date`" >> $outfile 985 983 [ "$ESTIMATED_TOTAL_NOOF_SLICES" ] && echo "total-slices $ESTIMATED_TOTAL_NOOF_SLICES" >> $outfile 984 AddFileToCfgIfExists $MINDI_TMP/NETFS-DEV netfs-dev $outfile 985 AddFileToCfgIfExists $MINDI_TMP/NETFS-PROTO netfs-proto $outfile 986 AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-IPADDR netfs-client-ipaddr $outfile 987 AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-NETMASK netfs-client-netmask $outfile 988 AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-BROADCAST netfs-client-broadcast $outfile 989 AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-HWADDR netfs-client-hwaddr $outfile 990 AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-DEFGW netfs-client-defgw $outfile 986 991 AddFileToCfgIfExists $MINDI_TMP/NETFS-SERVER-MOUNT netfs-server-mount $outfile 987 992 AddFileToCfgIfExists $MINDI_TMP/NETFS-SERVER-USER netfs-server-user $outfile 988 993 AddFileToCfgIfExists $MINDI_TMP/NETFS-SERVER-PATH netfs-server-path $outfile 989 994 AddFileToCfgIfExists $MINDI_TMP/NETFS-SERVER-IPADDR netfs-server-ipaddr $outfile 990 AddFileToCfgIfExists $MINDI_TMP/NETFS-PROTO netfs-proto $outfile991 AddFileToCfgIfExists $MINDI_TMP/NETFS-DEV netfs-dev $outfile992 AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-IPADDR netfs-client-ipaddr $outfile993 AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-NETMASK netfs-client-netmask $outfile994 AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-BROADCAST netfs-client-broadcast $outfile995 AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-DEFGW netfs-client-defgw $outfile996 995 AddFileToCfgIfExists $MINDI_TMP/ISO-DEV iso-dev $outfile 997 996 AddFileToCfgIfExists $MINDI_TMP/ISO-MNT iso-mnt $outfile … … 1000 999 AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.DEVICE bootloader.device $outfile 1001 1000 AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.NAME bootloader.name $outfile 1001 AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.VER bootloader.ver $outfile 1002 AddFileToCfgIfExists $MINDI_TMP/KEYMAP-LIVES-HERE keymap-lives-here $outfile 1002 1003 AddFileToCfgIfExists $MINDI_TMP/TAPEDEV-HAS-DATA-DISKS tapedev-has-data-disks $outfile 1004 AddFileToCfgIfExists $MINDI_TMP/BACKUP-MEDIA-TYPE backup-media-type $outfile 1005 AddFileToCfgIfExists $MINDI_TMP/DIFFERENTIAL differential $outfile 1006 AddFileToCfgIfExists $MINDI_TMP/ACL acl $outfile 1007 AddFileToCfgIfExists $MINDI_TMP/XATTR xattr $outfile 1008 AddFileToCfgIfExists $MINDI_TMP/OBDR obdr $outfile 1003 1009 } 1004 1010 … … 1021 1027 absolute_partition old_partition_fmt current_lvolume uname skip 1022 1028 1023 LogFile "------------------------------------" 1024 LogFile "Your raw fstab file looks like this:" 1025 LogFile "------------------------------------" 1029 LogFile "------------------------------------" 1030 LogFile "Your raw fstab file looks like this:" 1031 LogFile "------------------------------------" 1026 1032 cat $MY_FSTAB >> $LOGFILE 1027 LogAll "-----------------------------------" 1028 LogAll "Your mountlist will look like this:" 1029 LogAll "-----------------------------------" 1033 LogAll "-----------------------------------" 1034 LogAll "Your mountlist will look like this:" 1035 LogAll "-----------------------------------" 1030 1036 1031 1037 # mountlist(OUT) … … 1042 1048 1043 1049 if [ $LVM != "false" ]; then 1044 Log File "Analyzing LVM..."1050 LogAll "INFO: Analyzing LVM..." 1045 1051 $MINDI_DATA/analyze-my-lvm > $MINDI_TMP/lvm.res 1046 1052 if [ $? -ne 0 ]; then … … 1055 1061 done 1056 1062 [ "$IMAGE_DEVS" != "" ] && all_partitions="`echo "$all_partitions $IMAGE_DEVS" | tr ' ' '\n' | sort -u | tr '\n ' ' '`" 1057 printf "%-15s %-15s %-15s % s %s\n" DEVICE MOUNTPOINT FORMAT "SIZE MB" LABEL/UUID | tee -a $LOGFILE1058 printf "%-15s %-15s %-15s % s %s\n" ------ ---------- ------ ------- ---------- | tee -a $LOGFILE1063 printf "%-15s %-15s %-15s %-13s %-15s\n" DEVICE MOUNTPOINT FORMAT "SIZE MB" LABEL/UUID | tee -a $LOGFILE 1064 printf "%-15s %-15s %-15s %-13s %-15s\n" ------ ---------- ------ ------- ---------- | tee -a $LOGFILE 1059 1065 useless_dev="/dev/floppy /dev/fd0h1440 /dev/fd0H1440 /dev/cdrom /dev/cdrom/cdrom /dev/cdrom/cdrom1 /dev/cdrom/cdrom2 /dev/cdrom0 /dev/cdrom1 /dev/cdrom2 /dev/cdrom3 /dev/cdrw /dev/scd /dev/ram :/ /dev/sr0 /dev/sr1 /dev/cdrom1 tmpfs devpts sysfs proc debugfs" 1060 1066 for c_p in $all_partitions ; do … … 1064 1070 if [ -h "$c_p" ] && [ "`echo "$c_p" | grep -F "/dev/hd"`" = "" ] && [ "`echo "$c_p" | grep -F "/dev/sd"`" = "" ] && [ "`echo "$c_p" | grep -F "/dev/md"`" = "" ] ; then 1065 1071 current_partition=`readlink -f $c_p` 1066 [ "`echo "$current_partition" | grep -F "/dev/mapper"`" != "" ] && current_partition="$c_p" 1072 if [ "`echo "$current_partition" | grep -F "/dev/mapper"`" != "" ]; then 1073 current_partition="$c_p" 1074 elif [ "`echo $current_partition | grep -E '^/dev/dm-'`" ]; then 1075 # For SLES 11 type of distro, do not use dm devices as they are unable to be handled by lvm commands 1076 current_partition=`$MINDI_LIB/analyze-my-lvm --givevglvofdm $current_partition` 1077 fi 1067 1078 [ "`echo "$useless_dev" | grep -F "$current_partition"`" ] && continue 1068 1079 else … … 1074 1085 uuid="" 1075 1086 absolute_partition=`readlink -f $c_p` 1076 partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $2}' | head -n1` 1077 1078 # Detects noauto partitions not mounted and exclude them 1079 partition_option=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $4}' | head -n1` 1080 if [ "`echo "$partition_option" | grep -i noauto`" != "" ] && [ "`mount | grep -w "$partition_mountpt"`" = "" ] ; then 1081 continue 1082 fi 1087 partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | grep -w "$current_partition" | grep -vx " *#.*" | $AWK '{print $2}' | head -n1` 1083 1088 1084 1089 # set default in case we dont't find it … … 1087 1092 # This part tries to retrieve the correct device from a LABEL line in /etc/fstab 1088 1093 # current_partition contains only first column of /etc/fstab 1089 if [ "`echo "$current_partition" | /bin/grep -i "LABEL="`" != "" ]; then1094 if [ "`echo "$current_partition" | grep -i "LABEL="`" != "" ]; then 1090 1095 redhat_label=`echo "$current_partition" | cut -d'=' -f2` 1091 1096 actual_dev="" … … 1098 1103 # 2nd try : blkid, the good way for all LABEL except swap 1099 1104 if [ "x$actual_dev" = "x" -a -x "/sbin/blkid" ]; then 1100 actual_dev=`/sbin/blkid | /bin/grep "$redhat_label" | grep LABEL= | cut -d':' -f1`1105 actual_dev=`/sbin/blkid | grep "$redhat_label" | grep LABEL= | cut -d':' -f1` 1101 1106 # For LVM FS it will give a /dev/dm-# which should then be converted 1102 1107 if [ $LVM = "v2" ] && [ "`echo $actual_dev | grep '/dev/dm'`" ]; then … … 1117 1122 # For LVM gives a /dev/mapper entry 1118 1123 if [ "x$actual_dev" = "x" ]; then 1119 actual_dev=`/bin/mount -l | /bin/grep "\[$redhat_label\]" | cut -d' ' -f1`1124 actual_dev=`/bin/mount -l | grep "\[$redhat_label\]" | cut -d' ' -f1` 1120 1125 fi 1121 1126 … … 1123 1128 # SWAP only 1124 1129 if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ]; then 1125 list_swaps=`cat /proc/swaps | /bin/grep "/dev/" | $AWK '{ print $1 }' `1130 list_swaps=`cat /proc/swaps | grep "/dev/" | $AWK '{ print $1 }' ` 1126 1131 for dev_swap in $list_swaps ; do 1127 dev_exists=`/sbin/vol_id $dev_swap | /bin/grep "$redhat_label"`1132 dev_exists=`/sbin/vol_id $dev_swap | grep "$redhat_label"` 1128 1133 if [ "x$dev_exists" != "x" ]; then 1129 1134 actual_dev=$dev_swap … … 1137 1142 # or could be a string that isn't a complete device name (eg. LABEL =SWAP-cciss/c0d0p) 1138 1143 # SWAP only 1139 if [ "x$actual_dev" = "x" -a _"`echo $current_partition | /bin/grep -iE 'LABEL=SWAP|LABEL=SW-'`" != _"" ]; then1144 if [ "x$actual_dev" = "x" -a _"`echo $current_partition | grep -iE 'LABEL=SWAP|LABEL=SW-'`" != _"" ]; then 1140 1145 skip="" 1141 1146 uname=$KERVERRUN … … 1168 1173 # This part tries to retrieve the correct device from a UUID line in /etc/fstab 1169 1174 # current_partition contains only first column of /etc/fstab 1170 elif [ "`echo "$current_partition" | /bin/grep -i "UUID="`" != "" ]; then1175 elif [ "`echo "$current_partition" | grep -i "UUID="`" != "" ]; then 1171 1176 uuid=`echo "$current_partition" | cut -d'=' -f2` 1172 1177 actual_dev="" … … 1179 1184 # 2nd try : blkid, the good way for all UUID except swap 1180 1185 if [ "x$actual_dev" = "x" -a -x "/sbin/blkid" ]; then 1181 actual_dev=`/sbin/blkid | /bin/grep "$uuid" | grep UUID= | cut -d':' -f1`1186 actual_dev=`/sbin/blkid | grep "$uuid" | grep UUID= | cut -d':' -f1` 1182 1187 # For LVM FS it will give a /dev/dm-# which should then be converted 1183 1188 if [ $LVM = "v2" ] && [ "`echo $actual_dev | grep '/dev/dm'`" ]; then … … 1197 1202 # 3th try, with vol_id 1198 1203 if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ]; then 1199 list_dev=`mount | /bin/grep -E '^/' | $AWK '{ print $1 }' `1204 list_dev=`mount | grep -E '^/' | $AWK '{ print $1 }' ` 1200 1205 for dev in $list_dev ; do 1201 dev_exists=`/sbin/vol_id $dev | /bin/grep "$uuid"`1206 dev_exists=`/sbin/vol_id $dev | grep "$uuid"` 1202 1207 if [ "x$dev_exists" != "x" ]; then 1203 1208 actual_dev=$dev … … 1209 1214 # 4th try, with dumpuuid (VMWare only ?) for swap 1210 1215 if [ "x$actual_dev" = "x" -a -x "/sbin/dumpuuid" ]; then 1211 list_dev=`cat /proc/swaps | /bin/grep -E '^/' | $AWK '{ print $1 }' `1216 list_dev=`cat /proc/swaps | grep -E '^/' | $AWK '{ print $1 }' ` 1212 1217 for dev in $list_dev ; do 1213 dev_exists=`/sbin/dumpuuid $dev | /bin/grep "$uuid"`1218 dev_exists=`/sbin/dumpuuid $dev | grep "$uuid"` 1214 1219 if [ "x$dev_exists" != "x" ]; then 1215 1220 actual_dev=$dev … … 1230 1235 if [ _"$partition_mountpt" = _"" ]; then 1231 1236 # set default in case we dont't find it 1232 for tmpp in `tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -Ev "^#" | $AWK '{print $1}'`; do1233 if [ _"`readlink -f $tmpp`" = _" $current_partition" ]; then1237 for tmpp in `tr -s '\t' ' ' < $MY_FSTAB | grep -Ev "^#" | $AWK '{print $1}'`; do 1238 if [ _"`readlink -f $tmpp`" = _"`readlink -f $current_partition`" ]; then 1234 1239 str_to_find_fmt_with=$tmpp 1235 partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$tmpp" | /bin/grep -vx " *#.*" | $AWK '{print $2}' | head -n1`1240 partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | grep -w "$tmpp" | grep -vx " *#.*" | $AWK '{print $2}' | head -n1` 1236 1241 break; 1237 1242 fi 1238 1243 done 1239 1244 fi 1245 fi 1246 1247 # Detects noauto partitions not mounted and exclude them 1248 partition_option=`tr -s '\t' ' ' < $MY_FSTAB | grep -w "$str_to_find_fmt_with" | grep -vx " *#.*" | $AWK '{print $4}' | head -n1` 1249 if [ "`echo "$partition_option" | grep -i noauto`" != "" ] && [ "`mount | grep -w "$partition_mountpt"`" = "" ] ; then 1250 LogFile "INFO: Excluding $current_partition from mountlist (due to noauto option in fstab)" 1251 continue 1252 fi 1253 # Detects bind partitions and exclude them 1254 if [ "`echo "$partition_option" | grep -iw bind`" != "" ]; then 1255 LogFile "INFO: Excluding $current_partition from mountlist (due to bind option in fstab)" 1256 continue 1240 1257 fi 1241 1258 … … 1257 1274 for d in `echo $MINDI_EXCLUDE_DEVS | sed 's/|/ /g'`; do 1258 1275 if [ "`echo " $list_of_devices " | grep " $d"`" != "" ]; then 1259 echo "Excluding $current_partition from mountlist (due to excluded device $d)" >> $LOGFILE1276 LogFile "INFO: Excluding $current_partition from mountlist (due to excluded device $d)" 1260 1277 skip=1 1261 1278 continue … … 1268 1285 1269 1286 partition_format=`$AWK '$1 == "'"$str_to_find_fmt_with"'" {print $3}' $MY_FSTAB` 1287 # Detects iso9660 ISO images and exclude them 1288 if [ "`echo "$partition_format" | grep -iw iso9660`" != "" ]; then 1289 LogFile "INFO: Excluding $current_partition from mountlist (due to iso9660 format in fstab)" 1290 continue 1291 fi 1270 1292 # Some distributions such as Debian do not put /dev/<VG>/<LV> in fstab 1271 1293 # for LVM partitions but use /dev/mapper/<VG>-<LV> instead. Fortunately, … … 1280 1302 # into any of the LVM tools if possible. 1281 1303 1282 1304 current_lvolume="$current_partition" 1283 1305 if [ $LVM = "v2" ] && [ "`echo $current_partition | grep -E '^/dev/mapper/'`" ]; then 1284 1306 # .static dir are a Debian specificity … … 1286 1308 echo $current_lvolume | grep -q ' ' 1287 1309 if [ $? -eq 0 ]; then 1288 LogFile "WARNING: Multiple Logical Volumes found. Report to dev team" 1310 LogFile "WARNING: Multiple Logical Volumes found. Report to dev team" 1289 1311 fi 1290 1312 # if it's not found, it may well be a real device such as a multipath one … … 1301 1323 partition_size="lvm" 1302 1324 else 1303 partition_size=`SizeOfPartition $current_partition`1304 1325 [ "`echo "$current_partition" | grep "[0-9]"`" = "" ] && continue 1305 1326 [ "`echo "$current_partition" | grep -c "^/"`" -ne "1" ] && continue 1306 1327 if [ "$partition_format" = "swap" ] || [ "$partition_mountpt" = "swap" ] ; then 1328 # Skip swap files 1329 [ "`echo "$current_partition" | grep -E "^/dev"`" = "" ] && continue 1307 1330 partition_size=`grep -Fv "Priority" /proc/swaps | tr -s '\t' ' ' | grep -F "$current_partition " | $AWK '{print $3}'` 1308 1331 [ "$partition_mountpt" != "swap" ] && partition_mountpt="swap" … … 1317 1340 [ "$items" -gt "0" ] && partition_size=$(($totalsize/$items)) || partition_size=0 1318 1341 [ "$partition_size" -lt "125000" ] && partition_size=125000 1319 LogFile "I 'm guessing $c_p is $(($partition_size/1024))MB"1342 LogFile "INFO: I'm guessing $c_p is $(($partition_size/1024))MB" 1320 1343 fi 1344 else 1345 partition_size=`SizeOfPartition $current_partition` 1321 1346 fi 1322 1347 fi … … 1335 1360 fi 1336 1361 psz=$partition_size 1337 LogFile " Examining $current_partition (mount=$partition_mountpt fmt=$partition_format psz=$psz)"1362 LogFile "INFO: Examining $current_partition (mount=$partition_mountpt fmt=$partition_format psz=$psz)" 1338 1363 [ "$psz" != "lvm" ] && psz=$(($psz/1024)) 1339 1364 if [ "`echo " $IMAGE_DEVS " | grep -F " $current_partition "`" != "" ] ; then … … 1343 1368 partition_size=$(($partition_size+1)); # just in case 1344 1369 if [ "$partition_format" = "Linux" ] ; then 1345 LogFile " Are you imaging a mounted swap partition? Silly..."1346 LogFile " Reverting format from $old_partition_fmt to $partition_format"1370 LogFile "WARNING: Are you imaging a mounted swap partition? Silly..." 1371 LogFile "WARNING: Reverting format from $old_partition_fmt to $partition_format" 1347 1372 partition_format=$old_partition_fmt 1348 1373 fi … … 1350 1375 1351 1376 if [ ! "$partition_mountpt" ] ; then 1352 LogFile "------- $FDISK -l $qq log ------------" 1377 LogFile "------- $FDISK -l $qq log ------------" 1353 1378 for qq in "" `find /dev/ida/c*d* ! -name '*p*' 2> /dev/null`; do 1354 1379 partition_format=`$FDISK -l $qq 2>> $LOGFILE | grep -w "$c_p" | sed 's/12/|/' | tr -s '\t' ' ' | cut -d'|' -f2 | cut -d' ' -f2-9` 1355 1380 [ "$partition_format" ] && break 1356 1381 done 1357 LogFile "------- $FDISK log end ------------" 1382 LogFile "------- $FDISK log end ------------" 1358 1383 if [ "$partition_format" = "Compaq diagnostics" ] ; then 1359 1384 partition_format="compaq" 1360 1385 elif [ ! "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then 1361 LogAll " Unable to find mountpoint of $current_partition - ignoring"1386 LogAll "WARNING: Unable to find mountpoint of $current_partition - ignoring" 1362 1387 continue 1363 1388 fi … … 1372 1397 unofficial_outstring=`printf "%-15s %-15s %-15s %7s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$label"` 1373 1398 if [ "$current_partition" = "" ] ; then 1374 LogFile " Unknown partition (outstring = $unofficial_outstring)"1399 LogFile "WARNING: Unknown partition (outstring = $unofficial_outstring)" 1375 1400 elif [ "$partition_mountpt" = "" ] && [ -f "/etc/raidtab" ] ; then 1376 1401 if [ "`grep -F device /etc/raidtab 2>/dev/null | grep -F $current_partition`" ] ; then … … 1380 1405 printf "%s %s %s %s %s %s\n" $current_partition $partition_mountpt $partition_format $partition_size "$label" >> $mountlist 1381 1406 else 1382 LogFile " Unknown mountpoint (outstring = $unofficial_outstring)"1407 LogFile "WARNING: Unknown mountpoint (outstring = $unofficial_outstring)" 1383 1408 fi 1384 1409 elif [ "$partition_format" = "" ] ; then 1385 LogFile " Unknown format (outstring = $unofficial_outstring)"1410 LogFile "WARNING: Unknown format (outstring = $unofficial_outstring)" 1386 1411 elif [ "$partition_size" = "" ] ; then 1387 LogFile " Unknown partition size (outstring = $unofficial_outstring)"1412 LogFile "WARNING: Unknown partition size (outstring = $unofficial_outstring)" 1388 1413 elif [ "$partition_mountpt" = "/proc" ] || [ "$partition_mountpt" = "/dev/pts" ] ; then 1389 1414 continue 1390 1415 else 1391 1416 if [ "$partition_format" = "dos" ] || [ "$partition_format" = "msdos" ] ; then 1392 LogFile " vfat should be used instead of dos/msdos as a partition format"1417 LogFile "WARNING: vfat should be used instead of dos/msdos as a partition format" 1393 1418 partition_format="vfat" 1394 1419 fi … … 1404 1429 # Coherency verification 1405 1430 ML01=`cat $file | wc -l` 1406 ML02=`grep -v ' lvm' $file | wc -l`1431 ML02=`grep -vE ' lvm | raid | swap ' $file | wc -l` 1407 1432 ML1=`$AWK '{print $1}' $file | sort -u | wc -l` 1408 ML2=`grep -v ' lvm' $file | $AWK '{print $2}' | sort -u | wc -l`1433 ML2=`grep -vE ' lvm | raid | swap ' $file | $AWK '{print $2}' | sort -u | wc -l` 1409 1434 if [ "$ML01" -ne "$ML1" ]; then 1410 1435 LogFile "--------------------------------------------" 1411 echo "WARNING: Duplicate device entry in mountlist" | tee -a $LOGFILE1436 LogAll "WARNING: Duplicate device entry in mountlist" 1412 1437 LogFile "--------------------------------------------" 1413 1438 fi 1414 1439 if [ "$ML02" -ne "$ML2" ]; then 1415 1440 LogFile "--------------------------------------------" 1416 echo "WARNING: Duplicate mountpoint entry in mountlist" | tee -a $LOGFILE1441 LogAll "WARNING: Duplicate mountpoint entry in mountlist" 1417 1442 LogFile "------------------------------------------------" 1418 1443 fi … … 1422 1447 local i old_pwd 1423 1448 if [ -z "$ISO_CMD" ]; then 1424 Log File "Neither mkisofs nor genisoimage found, unable to make CD image"1449 LogAll "ERROR: Neither mkisofs nor genisoimage found, unable to make CD image" 1425 1450 return 1426 1451 fi … … 1432 1457 rm -Rf $MINDI_TMP/iso 1433 1458 mkdir -p $MINDI_TMP/iso/{images,archives} 1434 cp -f $MINDI_CACHE/{*.gz,*.img} $MINDI_TMP/iso/images 2>> $LOGFILE || LogAll "OfferToMakeBootableISO: Cannot copy $MINDI_CACHE/*.gz to $MINDI_TMP/iso/images"1435 LogFile "mindi_lib = $MINDI_DATA"1459 LogFile "INFO: mindi_lib = $MINDI_DATA" 1460 cp -f $MINDI_CACHE/{*.gz,*.img} $MINDI_TMP/iso/images 2>> $LOGFILE || LogAll "WARNING: OfferToMakeBootableISO: Cannot copy $MINDI_CACHE/*.gz to $MINDI_TMP/iso/images" 1436 1461 for i in memdisk memtest.bin memtest.img ; do 1437 1462 j=$MINDI_DATA/$i 1438 1463 k=$MINDI_TMP/iso 1439 1464 if [ -e "$j" ] ; then 1440 LogAll " Copying $j to $k"1465 LogAll "INFO: Copying $j to $k" 1441 1466 cp -f $j $k 2>> $LOGFILE || Die "Failed to copy $j to $k" 1442 1467 cp -f $j $MINDI_TMP 2>> $LOGFILE || Die "Failed to copy $j to $MINDI_TMP" … … 1446 1471 fi 1447 1472 done 1448 MakeMessageFile > $MINDI_TMP/iso/message.txt1473 MakeMessageFile | cut -c1-80 > $MINDI_TMP/iso/message.txt 1449 1474 if [ $KERNEL_IS_XEN = "yes" ]; then 1450 1475 cp $xenkernelpath $MINDI_TMP/iso/xen.gz 2>> $LOGFILE || Die "Cannot copy xen.gz ($xenkernelpath) to mindi tmp ($MINDI_TMP/iso/xen.gz). Did you run out of disk space?" … … 1487 1512 fi 1488 1513 if [ "$?" -ne "0" ] ; then 1489 LogFile "----------- $ISO_CMD's errors --------------" 1490 cat $MINDI_TMP/mkisofs.log >> $LOGFILE 1491 echo "$ISO_CMD returned the following errors:-" 1492 cat $MINDI_TMP/mkisofs.log 1493 LogAll "Failed to create ISO image." 1514 LogFile "----------- $ISO_CMD's errors --------------" 1515 LogAll "$ISO_CMD returned the following errors:" 1516 cat $MINDI_TMP/mkisofs.log | tee -a $LOGFILE 1517 LogAll "ERROR: Failed to create ISO image." 1494 1518 else 1495 LogAll " Created bootable ISO image at $MINDI_CACHE/mindi.iso"1519 LogAll "INFO: Created bootable ISO image at $MINDI_CACHE/mindi.iso" 1496 1520 fi 1497 1521 rm -f $MINDI_TMP/mkisofs.log … … 1522 1546 echo -en "Transforming $USBDEVICE in a Bootable device " 1523 1547 echo -en "." 1524 LogFile " Transforming $USBDEVICE in a Bootable device"1525 LogFile " Checking $USBDEVICE"1548 LogFile "INFO: Transforming $USBDEVICE in a Bootable device" 1549 LogFile "INFO: Checking $USBDEVICE" 1526 1550 $FDISK -l $USBDEVICE 2>&1 >> $LOGFILE 1527 1551 if [ $? -ne 0 ]; then 1528 LogAll " Unable to access $USBDEVICE"1529 LogAll " Make sure your USB device is pluged in"1530 exit -11552 LogAll "ERROR: Unable to access $USBDEVICE" 1553 LogAll " Make sure your USB device is plugged in" 1554 MindiExit -1 1531 1555 fi 1532 1556 echo -en "." 1533 1557 # Some distro do auto mount at that point (Ubuntu) 1534 LogFile " Unmounting $USBPART just in case"1558 LogFile "INFO: Unmounting $USBPART just in case" 1535 1559 umount $USBPART 2>> $LOGFILE 1>> $LOGFILE 1536 1560 # If your key has no MBR it may cause an issue 1537 1561 # Use dd if=mbr.bin of=$USBDEVICE or ms-sys -s $USBDEVICE 1538 1562 if [ -r $MBRFILE ]; then 1539 Log File "Installing an MBR ($MBRFILE) on $USBDEVICE"1563 LogAll "INFO: Installing an MBR ($MBRFILE) on $USBDEVICE" 1540 1564 dd if=$MBRFILE of=$USBDEVICE 1541 1565 else 1542 Log File "You may need to install an MBR (usually in $MBRFILE, but not found on your system)"1543 Log File "on $USBDEVICE with dd if=$MBRFILE of=$USBDEVICE"1544 fi 1545 LogFile " Preparing $USBDEVICE"1566 LogAll "WARNING: You may need to install an MBR (usually in $MBRFILE, but not found on your system)" 1567 LogAll " on $USBDEVICE with dd if=$MBRFILE of=$USBDEVICE" 1568 fi 1569 LogFile "INFO: Preparing $USBDEVICE" 1546 1570 cat > $MINDI_TMP/fdisk.txt << EOF 1547 1571 d … … 1562 1586 $FDISK $USBDEVICE 2>> $LOGFILE 1>> $LOGFILE < $MINDI_TMP/fdisk.txt 1563 1587 if [ $? -ne 0 ]; then 1564 LogAll " Unable to create a vfat Filesystem on $USBDEVICE"1565 LogAll " Make sure your USB device is pluged in"1588 LogAll "ERROR: Unable to create a vfat Filesystem on $USBDEVICE" 1589 LogAll " Make sure your USB device is plugged in" 1566 1590 $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE 1567 1591 MindiExit -1 … … 1572 1596 LogFile "----------------" 1573 1597 rm -f $MINDI_TMP/fdisk.txt 1574 LogFile " The USB device $USBDEVICE now looks like this:"1598 LogFile "INFO: The USB device $USBDEVICE now looks like this:" 1575 1599 $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE 1576 1600 echo -en "." 1601 # Calling kpartx in case devices were not created 1602 if [ -x "/sbin/kpartx" ]; then 1603 /sbin/kpartx -a $USBDEVICE 1604 fi 1577 1605 # Some distro do auto mount at that point (Ubuntu) 1578 LogFile " Unmounting $USBPART just in case again"1606 LogFile "INFO: Unmounting $USBPART just in case again" 1579 1607 umount $USBPART 2>> $LOGFILE 1>> $LOGFILE 1580 1608 echo -en "." 1581 LogFile "Creating a vfat filesystem on $USBPART" 1609 # Some distro have a dmsetup conf at that point so removing it Cf: http://trac.mondorescue.org/ticket/651 1610 if [ "`which dmsetup`" != "" ]; then 1611 block_id="`echo $USBPART | sed 's|/dev/||g'`" 1612 if [[ "`dmsetup ls | awk '{print $1}' | grep $block_id`" != "" ]]; then 1613 LogFile "INFO: Removing $block_id from device mapper." 1614 sleep 1 1615 dmsetup remove $block_id 1616 fi 1617 fi 1618 echo -en "." 1619 LogFile "INFO: Creating a vfat filesystem on $USBPART" 1582 1620 mkdosfs -F 32 $USBPART 2>&1 >> $LOGFILE 1583 1621 if [ $? -ne 0 ]; then 1584 LogAll " Unable to create a vfat filesystem on $USBPART"1585 LogAll " Make sure your USB device is pluged in and partitioned ($USBPART must exist on it)"1622 LogAll "ERROR: Unable to create a vfat filesystem on $USBPART" 1623 LogAll " Make sure your USB device is plugged in and partitioned ($USBPART must exist on it)" 1586 1624 $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE 1587 1625 MindiExit -1 1588 1626 fi 1589 1627 echo -en "." 1590 LogFile " Mounting $USBPART on $MINDI_TMP/usb"1628 LogFile "INFO: Mounting $USBPART on $MINDI_TMP/usb" 1591 1629 mount $USBPART $MINDI_TMP/usb 2>> $LOGFILE 1592 1630 if [ $? -ne 0 ]; then 1593 LogAll " Unable to mount $USBPART on $MINDI_TMP/usb"1594 LogAll " Make sure your USB device is pluged in, partitioned and formated ($USBPART must exist on it)"1631 LogAll "ERROR: Unable to mount $USBPART on $MINDI_TMP/usb" 1632 LogAll " Make sure your USB device is plugged in, partitioned and formated ($USBPART must exist on it)" 1595 1633 $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE 1596 1634 MindiExit -1 … … 1598 1636 echo -en "." 1599 1637 mkdir -p $MINDI_TMP/usb/images 1600 cp -f $MINDI_CACHE/*.img $MINDI_CACHE/*.gz $MINDI_TMP/usb/images 2>> $LOGFILE || LogAll " OfferToMakeBootableUSB: Cannot copy $i to $MINDI_TMP/usb/images"1638 cp -f $MINDI_CACHE/*.img $MINDI_CACHE/*.gz $MINDI_TMP/usb/images 2>> $LOGFILE || LogAll "ERROR: OfferToMakeBootableUSB: Cannot copy $i to $MINDI_TMP/usb/images" 1601 1639 echo -en "." 1602 LogFile " mindi_lib = $MINDI_DATA"1640 LogFile "INFO: mindi_lib = $MINDI_DATA" 1603 1641 for i in memdisk memtest.bin memtest.img ; do 1604 1642 j=$MINDI_DATA/$i 1605 1643 k=$MINDI_TMP/usb 1606 1644 if [ -e "$j" ] ; then 1607 Log All "Copying $j to $k"1645 LogIt "INFO: Copying $j to $k" 1608 1646 cp -f $j $k 2>> $LOGFILE || Die "Failed to copy $j to $k" 1609 1647 cp -f $j $MINDI_TMP 2>> $LOGFILE || Die "Failed to copy $j to $MINDI_TMP" … … 1611 1649 done 1612 1650 echo -en "." 1613 MakeMessageFile > $MINDI_TMP/usb/message.txt1651 MakeMessageFile | cut -c1-80 > $MINDI_TMP/usb/message.txt 1614 1652 echo -en "." 1615 1653 cp $kernelpath $MINDI_TMP/usb/vmlinuz 2>> $LOGFILE || Die "Cannot copy vmlinuz ($kernelpath) to mindi tmp ($MINDI_TMP/usb/vmlinuz). Did you run out of disk space?" … … 1630 1668 umount $MINDI_TMP/usb 1631 1669 if [ "$ARCH" != "ia64" ] ; then 1632 syslinux -s $USBPART 2>> $MINDI_TMP/syslinux.log 1633 if [ "$?" -ne "0" ] ; then 1670 syslinux -v 2>&1 | grep -q 4.02 1671 if [ $? -eq 0 ]; then 1672 # This buggy version of syslinux requires a call to --stupid and not -s 1673 syslinux --stupid $USBPART 2>> $MINDI_TMP/syslinux.log 1674 res=$? 1675 else 1676 syslinux -s $USBPART 2>> $MINDI_TMP/syslinux.log 1677 res=$? 1678 fi 1679 if [ $res -ne 0 ] ; then 1634 1680 LogAll "----------- syslinux's errors --------------" 1635 1681 cat $MINDI_TMP/syslinux.log |tee -a $LOGFILE 1636 echo"------------------------------------------"1637 Log All "Failed to create USB image."1682 LogAll "------------------------------------------" 1683 LogIt "ERROR: Failed to create USB image." 1638 1684 else 1639 1685 echo -e "$DONE" 1640 LogFile " Created bootable USB image on $USBDEVICE"1686 LogFile "INFO: Created bootable USB image on $USBDEVICE" 1641 1687 fi 1642 1688 rm -f $MINDI_TMP/syslinux.log 1643 1689 else 1644 echo "No USB boot support for ia64"1690 LogAll "ERROR: No USB boot support for ia64" 1645 1691 MindiExit -1 1646 1692 fi … … 1718 1764 echo -en "default${sep}iso\n" 1719 1765 else 1720 echo -en "default${sep} interactive\n"1766 echo -en "default${sep}${MINDI_DEFAULT_BOOT_OPTION}\n" 1721 1767 fi 1722 1768 else … … 1726 1772 # Handle timeout 1727 1773 if [ "$CDRECOVERY" != "yes" ] ; then 1728 echo -en "timeout${sep} 300\n"1774 echo -en "timeout${sep}${MINDI_BOOT_TIMEOUT}\n" 1729 1775 else 1730 1776 echo -en "timeout${sep}10000\n" … … 1746 1792 for i in $options ; do 1747 1793 ooo=$i 1748 [ "$ooo" = "RESTORE" ] && ooo=" nuke"1794 [ "$ooo" = "RESTORE" ] && ooo="RESTORE nuke" 1749 1795 if [ "$type" = "elilo" ]; then 1750 1796 outstr="image=/vmlinuz\n\tlabel=$i\n\tinitrd=/initrd.img\n\troot=/dev/ram0 append=\" rw ramdisk_size=$ramdisk_size $ooo $MINDI_ADDITIONAL_BOOT_PARAMS \"\n" … … 1802 1848 fi 1803 1849 1804 mount -t vfat -o loop $imagefile $mountpoint || LogAll " Cannot mount (PBDI)"1850 mount -t vfat -o loop $imagefile $mountpoint || LogAll "ERROR: Cannot mount (PBDI)" 1805 1851 1806 1852 # copy Mindi's skeleton fs & lilo/syslinux/whatever stuff into it … … 1808 1854 liloconf=$mountpoint/elilo.conf 1809 1855 1810 MakeMessageFile > $mountpoint/message.txt1856 MakeMessageFile | cut -c1-80 > $mountpoint/message.txt 1811 1857 1812 1858 if [ "$ARCH" != "ia64" ] ; then … … 1833 1879 fi 1834 1880 1835 LogFile " Copying $MINDI_TMP/initrd.img to $mountpoint/initrd.img..."1881 LogFile "INFO: Copying $MINDI_TMP/initrd.img to $mountpoint/initrd.img..." 1836 1882 cp -f $MINDI_TMP/initrd.img $mountpoint/initrd.img 2>> $LOGFILE 1837 1883 if [ "$?" -ne "0" ] ; then 1838 LogAll " Failed to copy $MINDI_TMP/initrd.img to $mountpoint"1884 LogAll "ERROR: Failed to copy $MINDI_TMP/initrd.img to $mountpoint" 1839 1885 cat $MINDI_TMP/mtpt.$$ >> $LOGFILE 1840 LogAll " Please unload some of your modules and try again."1886 LogAll " Please unload some of your modules and try again." 1841 1887 rm -f $MINDI_TMP/mtpt.$$ 1842 LogAll "Cannot incorporate initrd.img in bootdisk (kernel / modules too big?). Try to increase EXTRA_SPACE and BOOT_SIZE in $MINDI_CONFIG" 1888 LogAll " Cannot incorporate initrd.img in bootdisk (kernel / modules too big?)." 1889 LogAll " Try to increase EXTRA_SPACE and BOOT_SIZE in $MINDI_CONFIG" 1843 1890 retval=$(($retval+1)) 1844 1891 fi … … 1858 1905 1859 1906 if [ "$retval" -ne "0" ] ; then 1860 LogFile " Files at mountpoint ($mountpoint) :-"1907 LogFile "INFO: Files at mountpoint ($mountpoint) :" 1861 1908 du -sk $mountpoint/* >> $LOGFILE 1862 LogFile "--- end of list of files ---" 1909 LogFile "--- end of list of files ---" 1863 1910 echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n" >> $LOGFILE 1864 1911 [ "$mountpoint" != "" ] && rm -f $mountpoint/vmlinuz 1865 1912 cd "$old_pwd" 1866 1913 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 1867 rmdir $mountpoint || LogAll " Cannot rmdir (PBDI)"1914 rmdir $mountpoint || LogAll "ERROR: Cannot rmdir (PBDI)" 1868 1915 1869 1916 rm -f $imagefile … … 1871 1918 fi 1872 1919 max_kernel_size=$(($free_space+`du -sk $kernelpath | cut -f1`)) 1873 LogFile " Free space left on image = $free_space KB"1874 LogFile " Max kernel size on $BOOT_SIZE KB image (est'd) = $max_kernel_size K"1920 LogFile "INFO: Free space left on image = $free_space KB" 1921 LogFile "INFO: Max kernel size on $BOOT_SIZE KB image (est'd) = $max_kernel_size K" 1875 1922 1876 1923 # make it bootable … … 1883 1930 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 1884 1931 echo -en "..." 1885 rmdir $mountpoint || LogAll " Cannot rmdir (PBDI)"1932 rmdir $mountpoint || LogAll "ERROR: Cannot rmdir (PBDI)" 1886 1933 1887 1934 if [ "$retval" -eq "0" ] ; then 1888 1935 echo -en "...$DONE\n" 1889 LogAll "$BOOT_SIZE KB boot disk was created OK\n" 1936 if [ "$KERN_DISK_MADE" ] ; then 1937 [ "$imagefile" != "" ] && rm -f $imagefile 1938 LogAll "INFO: $BOOT_SIZE KB boot disks were created OK\n" 1939 fi 1890 1940 else 1891 1941 echo -en "...failed\n" 1892 LogAll " $BOOT_SIZEKB boot disk was NOT created\n"1893 rm -f $imagefile1894 fi 1895 [ "$retval" -ne "0" ] && LogAll " PrepareBootDiskImage() is returning nonzero"1942 LogAll "WARNING: $BOOT_SIZE""KB boot disk was NOT created\n" 1943 [ "$imagefile" != "" ] && rm -f $imagefile 1944 fi 1945 [ "$retval" -ne "0" ] && LogAll "ERROR: PrepareBootDiskImage() is returning nonzero" 1896 1946 return $retval 1897 1947 } … … 1944 1994 Die "You have $res files present in dependency list\nbut absent from filesystem." 1945 1995 fi 1946 FindAndAddUserKeyboardMappingFile 1996 FindAndAddUserKeyboardMappingFile 1947 1997 mkdir -p $bigdir/tmp 1948 1998 [ -d "/mnt/.boot.d" ] && echo "Oh Jebus" > $bigdir/tmp/DUMBASS-GENTOO … … 1962 2012 i=`cat $MINDI_TMP/BOOTLOADER.DEVICE 2> /dev/null` 1963 2013 if [ "$i" ] ; then 1964 LogAll " Backing up $i's MBR"2014 LogAll "INFO: Backing up $i's MBR" 1965 2015 dd if=$i of=$bigdir/BOOTLOADER.MBR bs=446 count=1 >> $LOGFILE 2>> $LOGFILE 1966 2016 sleep 1 … … 1968 2018 j=$i 1969 2019 [ -h "$j" ] && j=`readlink -f $j` 1970 LogAll " Creating /dev/boot_device ($j)"2020 LogAll "INFO: Creating /dev/boot_device ($j)" 1971 2021 mkdir -p $bigdir/dev 1972 2022 cp -pRdf $j $bigdir/dev/boot_device 2>> $LOGFILE || Die "Unable to create /dev/boot_device on ramdisk" … … 1980 2030 if [ -d /$ti ]; then 1981 2031 mkdir -p $ti 1982 cp -Rdf /$ti/* $ti 2>> $LOGFILE || LogAll " WARNING - error occurred while copying terminfo"2032 cp -Rdf /$ti/* $ti 2>> $LOGFILE || LogAll "ERROR: issue copying terminfo" 1983 2033 fi 1984 2034 if [ -e "$MONDO_SHARE/restore-scripts" ]; then … … 1987 2037 fi 1988 2038 if [ -d "/lib/dev-state" ]; then 1989 tar cf - -C / ./lib/dev-state 2>> $MINDI_TMP/$$.log | tar xf - || LogAll " Unable to handle /lib/dev-state" $MINDI_TMP/$$.log2039 tar cf - -C / ./lib/dev-state 2>> $MINDI_TMP/$$.log | tar xf - || LogAll "ERROR: Unable to handle /lib/dev-state" $MINDI_TMP/$$.log 1990 2040 fi 1991 2041 cd "$old_pwd" … … 2006 2056 fi 2007 2057 fi 2058 LogFile "Your mountlist.txt file content is:" 2059 LogFile "-----------------------------------" 2060 cat $bigdir/$MINDI_CACHE/mountlist.txt >> $LOGFILE 2061 LogFile "-----------------------------------" 2008 2062 2009 2063 echo -en "Tarring and zipping the data content..." 2010 2064 size_of_all_tools=`du -sk $bigdir | cut -f1` 2011 (cd "$bigdir" ; tar -b 4096 -cf - . 2>> $MINDI_TMP/$$.log | gzip -9 > $imagesdir/all.tar.gz || LogAll " Problem creating all.tar.gz" $MINDI_TMP/$$.log)2065 (cd "$bigdir" ; tar -b 4096 -cf - . 2>> $MINDI_TMP/$$.log | gzip -9 > $imagesdir/all.tar.gz || LogAll "ERROR: Problem creating all.tar.gz" $MINDI_TMP/$$.log) 2012 2066 LogFile "Size of the data content" 2013 2067 LogFile "------------------------" … … 2124 2178 if [ "$?" -eq "0" ] ; then 2125 2179 cp -f $tmpfile $1 2>> $LOGFILE 2126 LogFile " Stripped binary $2"2180 LogFile "INFO: Stripped binary $2" 2127 2181 fi 2128 2182 rm -f $tmpfile … … 2164 2218 # It's a Xen kernel 2165 2219 KERNEL_IS_XEN="yes" 2166 LogFile "I t's a Xen kernel..."2167 fi 2168 2169 for fname in `find $root -maxdepth 2 -type f | grep -Ei 'lin|kern|xen' | grep -Ev '^/proc/|^/net/ '` ; do2220 LogFile "INFO: It's a Xen kernel..." 2221 fi 2222 2223 for fname in `find $root -maxdepth 2 -type f | grep -Ei 'lin|kern|xen' | grep -Ev '^/proc/|^/net/|^/mnt|^/lib|^/lib64|^/bin|^/sbin|^/usr|^/tmp'` ; do 2170 2224 [ ! -e "$fname" ] && continue 2171 2225 [ "$fname" = "/boot/vmlinuz.shipped" ] && [ -f "/boot/vmlinuz" ] && continue; # ignore SuSE's extra kernel … … 2200 2254 fi 2201 2255 if [ ! "$possible_kernels" ] ; then 2202 LogAll " No kernel matches exactly. Are there any duff kernels?"2256 LogAll "INFO: No kernel matches exactly. Are there any duff kernels?" 2203 2257 possible_kernels="$duff_kernels" 2204 2258 if [ ! "$possible_kernels" ] ; then 2205 LogAll " Sorry, no duff kernels either"2259 LogAll "INFO: Sorry, no duff kernels either" 2206 2260 else 2207 LogAll "I bet you're running Debian or Gentoo, aren't you?"2208 LogAll " Your kernel doesn't have a sane builddate. Oh well..."2261 LogAll "INFO: I bet you're running Debian or Gentoo, aren't you?" 2262 LogAll "INFO: Your kernel doesn't have a sane builddate. Oh well..." 2209 2263 fi 2210 2264 fi … … 2219 2273 LogAll "Could not find your kernel." 2220 2274 if [ -e "/boot/vmlinuz" ] ; then 2221 LogAll " Using /boot/vmlinuz as a last resort."2275 LogAll "INFO: Using /boot/vmlinuz as a last resort." 2222 2276 output=/boot/vmlinuz 2223 2277 else … … 2226 2280 elif [ "$noof_kernels" -eq "1" ] ; then 2227 2281 kp=`echo "$possible_kernels" | sed s/' '//` 2228 LogFile " Your kernel is $kp (v$KERVERRUN)"2282 LogFile "INFO: Your kernel is $kp (v$KERVERRUN)" 2229 2283 output="$kp" 2230 2284 else 2231 2285 for i in $possible_kernels ; do 2232 2286 if [ "`echo $i | grep "$KERVERRUN"`" ]; then 2233 LogAll " OK, I used my initiative and found that "2234 LogAll " $i is probably your kernel. "2287 LogAll "INFO: OK, I used my initiative and found that " 2288 LogAll "INFO: $i is probably your kernel. " 2235 2289 output="$i" 2236 2290 break … … 2240 2294 if [ "`echo " $possible_kernels " | grep -F "/boot/vmlinuz " &> /dev/null`" ]; then 2241 2295 output=/boot/vmlinuz 2242 LogFile " Schlomo, this one's for you."2296 LogFile "INFO: Schlomo, this one's for you." 2243 2297 else 2244 LogFile " Two or more possible kernels found. You may specify any one of them and the "2245 LogFile " boot disks will still work, probably. If one does not work, try another."2246 LogFile " $possible_kernels"2298 LogFile "INFO: Two or more possible kernels found. You may specify any one of them and the " 2299 LogFile "INFO: boot disks will still work, probably. If one does not work, try another." 2300 LogFile "INFO: $possible_kernels" 2247 2301 output="" 2248 2302 fi … … 2254 2308 elif [ "$noof_xenkernels" -eq "1" ]; then 2255 2309 xenkernelpath=`echo "$possible_xenkernels" | sed s/' '//` 2256 LogFile " Your Xen kernel is $xenkernelpath (v$KERVERRUN)"2310 LogFile "INFO: Your Xen kernel is $xenkernelpath (v$KERVERRUN)" 2257 2311 else 2258 2312 for i in $possible_xenkernels ; do 2259 2313 if [ "`echo $i | grep "$KERVERRUN"`" ]; then 2260 LogFile " OK, I used my initiative and found that "2261 LogFile " $i is probably your Xen kernel. "2314 LogFile "INFO: OK, I used my initiative and found that " 2315 LogFile "INFO: $i is probably your Xen kernel. " 2262 2316 xenkernelpath="$i" 2263 2317 break … … 2268 2322 if [ ! -n "$new_possible_xenkernels" ]; then 2269 2323 xenkernelpath=`echo $new_possible_xenkernels | tr -s ' ' '\n' | head -1` 2270 LogFile " Using $xenkernelpath"2324 LogFile "INFO: Using $xenkernelpath" 2271 2325 else 2272 LogFile " Two or more possible Xen kernels found. You may specify any one of them and the "2273 LogFile " boot disks will still work, probably. If one does not work, try another."2274 LogFile " $possible_xenkernels"2326 LogFile "INFO: Two or more possible Xen kernels found. You may specify any one of them and the " 2327 LogFile "INFO: boot disks will still work, probably. If one does not work, try another." 2328 LogFile "INFO: $possible_xenkernels" 2275 2329 output="" 2276 2330 xenkernelpath=`echo $possible_xenkernels | tr -s ' ' '\n' | head -1` 2277 LogFile " Using $xenkernelpath"2331 LogFile "INFO: Using $xenkernelpath" 2278 2332 fi 2279 2333 fi … … 2302 2356 # Get kbd conf from data disk preparation 2303 2357 cat $MINDI_CACHE/KEYMAP-LIVES-HERE >> $MINDI_TMP/cp.lis 2304 # AL04Oct08: Check whether /lib64 is a link and if so explicitly create one in rootfs2358 # AL04Oct08: Check whether /lib64 or /lib is a link and if so explicitly create one in rootfs 2305 2359 if [ -h "/lib64" ]; then 2306 2360 echo lib >> $MINDI_TMP/mkdir.lis 2307 2361 echo ln -s lib lib64 >> $MINDI_TMP/ln.lis 2362 fi 2363 if [ -h "/lib" ]; then 2364 echo usr/lib >> $MINDI_TMP/mkdir.lis 2365 mv lib/* usr/lib 2366 echo ln -s usr/lib lib >> $MINDI_TMP/ln.lis 2367 fi 2368 # Check whether /sbin and /bin are a link and if so explicitly create one in rootfs (Fedora 17 crazyness) 2369 if [ -h "/sbin" ]; then 2370 echo usr/sbin >> $MINDI_TMP/mkdir.lis 2371 mv sbin/* usr/sbin 2372 echo ln -s usr/sbin sbin >> $MINDI_TMP/ln.lis 2373 fi 2374 if [ -h "/bin" ]; then 2375 echo usr/bin >> $MINDI_TMP/mkdir.lis 2376 mv bin/* usr/bin 2377 echo ln -s usr/bin bin >> $MINDI_TMP/ln.lis 2308 2378 fi 2309 2379 … … 2330 2400 echo /etc/ld.so.c* >> $MINDI_TMP/cp.lis 2331 2401 2332 # Avoid an issue on some distro (RHEL5) 2402 # Handle the case where busybox and mount are dynamically linked 2403 file $MINDI_LIB/rootfs/bin/busybox 2>&1 | grep -q "dynamically" 2404 if [ $? -eq 0 ]; then 2405 # We want to use the real mount and all the supported variants (nfs, cifs, ...) 2406 rm -f bin/mount 2407 fi 2408 2409 # Copy of files from the minimal env needed as per the deplist.d/minimal.conf file (which includes all busybox deps) 2410 rm -f $MINDI_TMP/minimal.lis $MINDI_TMP/minimal2.lis 2411 for f in `grep -v " *#.*" $DEPLIST_DIR/minimal.conf | sort -u`; do 2412 if [ -r $f ]; then 2413 echo $f >> $MINDI_TMP/minimal.lis 2414 LocateDeps $f >> $MINDI_TMP/minimal2.lis 2415 fi 2416 done 2417 for f in `cat $MINDI_TMP/minimal.lis` `sort -u $MINDI_TMP/minimal2.lis`; do 2418 ReadAllLink $f >> $MINDI_TMP/minimal.lis 2419 done 2420 # Initial / are trucated by tar 2421 finallist="" 2422 # Remove directories from the list, as tar will create them anyway 2423 # and it may hurt if /lib is in it as on Debian/Ubuntu 2424 for f in `sort -u $MINDI_TMP/minimal.lis`; do 2425 if [ ! -d $f ]; then 2426 finallist="$finallist $f" 2427 fi 2428 done 2429 tar cf - $finallist 2>> $MINDI_TMP/$$.log | tar xUf - || LogIt "WARNING: Problem in minimal analysis" $MINDI_TMP/$$.log 2430 2431 # To improve support for distribution scripts, we now prefer to use bash as the std shell. Also fixes #600 2432 ln -sf /bin/bash bin/sh 2433 LogIt "INFO: Using bash as default shell" 2434 rm -f $MINDI_TMP/minimal.lis $MINDI_TMP/minimal2.lis 2435 2436 # Avoids an issue on some distro (RHEL5) 2333 2437 echo ./etc/ld.so.conf.d/kernelcap* >> $MINDI_TMP/rm.lis 2334 2438 … … 2341 2445 if [ $? -eq 0 ]; then 2342 2446 USE_UDEV="yes" 2343 LogFile " udev device manager found"2447 LogFile "INFO: udev device manager found" 2344 2448 echo /etc/udev /lib*/udev >> $MINDI_TMP/cp.lis 2345 2449 # This avoids NIC remapping if on another machine at restore time on Debian at least … … 2373 2477 rm -f $MINDI_TMP/udev.lis 2374 2478 else 2375 LogAll " udevd daemon not in standard place (/sbin)"2376 LogAll " mindi will use static devices which may cause problems"2479 LogAll "WARNING: udevd daemon not in standard place (/sbin or /usr/bin)" 2480 LogAll " mindi will use static devices which may cause problems" 2377 2481 fi 2378 2482 fi … … 2382 2486 mindi-bkphw $MINDI_CACHE $MINDI_CONF | tee -a $LOGFILE 2383 2487 if [ -d $MINDI_CACHE/bkphw ]; then 2384 LogAll " Hardware Information found and saved ..."2488 LogAll "INFO: Hardware Information found and saved ..." 2385 2489 echo $MINDI_CACHE/bkphw >> $MIDNDI_TMP/cp.lis 2386 2490 if [ -f $MINDI_CACHE/tools.files ]; then … … 2421 2525 fi 2422 2526 for i in $DENY_MODS; do 2423 LogFile " Removing $i from the list of modules to load"2527 LogFile "INFO: Removing $i from the list of modules to load" 2424 2528 list_of_groovy_mods=`echo ${list_of_groovy_mods} | tr ' ' '\n' | grep -Ev "^${i}$" | tr '\n' ' '` 2425 2529 done 2426 2530 2427 [ -e "$needed_modules_path" ] || LogAll " path $needed_modules_path does not exist.\n If you're not using a modular kernel then you're NUTS."2531 [ -e "$needed_modules_path" ] || LogAll "WARNING: path $needed_modules_path does not exist.\n If you're not using a modular kernel then you're NUTS." 2428 2532 for i in $list_of_groovy_mods ; do 2429 2533 needed_modules="$needed_modules `FindSpecificModuleInPath $needed_modules_path $i`" … … 2457 2561 # Copy an additional ProLiant tool for OBDR support 2458 2562 if [ -f $MINDI_TMP/OBDR ]; then 2563 found=0 2459 2564 if [ -x /usr/bin/hpsa_obdr_mode ]; then 2460 2565 echo $mountpoint/usr/bin >> $MINDI_TMP/mkdir.lis 2461 2566 echo /usr/bin/hpsa_obdr_mode >> $MINDI_TMP/cp.lis 2462 LogIt "Copying /usr/bin/hpsa_obdr_mode to ramdisk for improved OBDR support" 2463 else 2464 LogAll "WARNING: You're using OBDR mode without having the /usr/bin/hpsa_obdr_mode tool" 2567 LogIt "INFO: Copying /usr/bin/hpsa_obdr_mode to ramdisk for improved Smart Array OBDR support" 2568 found=1 2569 fi 2570 if [ -x /usr/bin/sg_wr_mode ]; then 2571 mkdir -p $mountpoint/usr/bin 2572 lis="/usr/bin/sg_map /usr/bin/sg_inq /usr/bin/sg_reset /usr/bin/rev" 2573 LocateDeps $lis > $MINDI_TMP/obdr.lis 2574 (cd $mountpoint ; tar cf - $lis -C / `sort -u $MINDI_TMP/obdr.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in obdr.lis analysis" $MINDI_TMP/$$.log) 2575 LogIt "INFO: Copying /usr/bin/sg_reset to ramdisk for improved SCSI OBDR support" 2576 found=1 2577 fi 2578 if [ $found -eq 0 ]; then 2579 LogAll "WARNING: You're using OBDR mode without having the /usr/bin/hpsa_obdr_mode nor the /usr/bin/sg_wr_mode tool" 2465 2580 LogAll " This may lead to a tape not going back to sequential mode after OBDR boot" 2466 2581 fi … … 2523 2638 LogFile "Content of initial ramdisk:" 2524 2639 LogFile "---------------------------" 2640 mkdir -p $mountpoint/proc 2525 2641 (cd "$mountpoint" ; ls -Rla ) >> $LOGFILE 2526 2642 LogFile "---------------------------" 2527 2643 2528 2644 # Determine what filesystem to use for initrd image 2529 LogFile " Call GetInitrdFilesystemToUse() with parameter ${kernelpath} to get filesystem to use for initrd."2645 LogFile "INFO: Call GetInitrdFilesystemToUse() with parameter ${kernelpath} to get filesystem to use for initrd." 2530 2646 gvFileSystem=`GetInitrdFilesystemToUse ${kernelpath}` 2531 2647 [ -z gvFileSystem ] && Die "GetFilesystemToUse() failed. Terminating." 2532 if [ "$gvFileSystem" = "ext2fs" ] || [ "$gvFileSystem" = "ext3fs" ] ; then2648 if [ "$gvFileSystem" = "ext2fs" ] || [ "$gvFileSystem" = "ext3fs" ] || [ "$gvFileSystem" = "ext4fs" ]; then 2533 2649 # say what will be used 2534 LogFile " Creating an $gvFileSystem initrd image..."2650 LogFile "INFO: Creating an $gvFileSystem initrd image..." 2535 2651 # kernel expects linuxrc in ext2 filesystem 2536 2652 ( cd "$mountpoint" && ln -sf sbin/init linuxrc ) … … 2538 2654 umount $mountpoint || Die "Cannot unmount $tempfile" 2539 2655 dd if=$tempfile bs=1k 2> /dev/null > ${rdz_fname}.tmp 2> /dev/null 2540 bs=`tune2fs -l ${rdz_fname}.tmp | grep -E '^Block size:' | cut -d: -f2 | sed 's/^ *//'` 2656 if [ "$gvFileSystem" = "ext4fs" ] && [ -x "/sbin/tune4fs" ]; then 2657 bs=`/sbin/tune4fs -l ${rdz_fname}.tmp | grep -E '^Block size:' | cut -d: -f2 | sed 's/^ *//'` 2658 else 2659 bs=`tune2fs -l ${rdz_fname}.tmp | grep -E '^Block size:' | cut -d: -f2 | sed 's/^ *//'` 2660 fi 2541 2661 MINDI_ADDITIONAL_BOOT_PARAMS="$MINDI_ADDITIONAL_BOOT_PARAMS ramdisk_blocksize=$bs" 2542 2662 gzip -c9 ${rdz_fname}.tmp > $rdz_fname 2543 2663 rm -f ${rdz_fname}.tmp 2544 2664 # log that we are done 2545 LogFile " ...done."2665 LogFile " ...done." 2546 2666 elif [ "$gvFileSystem" = "initramfs" ]; then 2547 2667 # say what will be used 2548 LogFile " Creating a gzip'ed cpio (AKA initramfs) initrd image..."2668 LogFile "INFO: Creating a gzip'ed cpio (AKA initramfs) initrd image..." 2549 2669 # make sure that cpio is there 2550 2670 which cpio &> /dev/null; [ $? -eq 0 ] || Die "cpio not found. Please install package cpio and try again." … … 2558 2678 umount $mountpoint || Die "Cannot unmount $tempfile" 2559 2679 # log that we are done 2560 LogFile " ...done."2680 LogFile " ...done." 2561 2681 else 2562 2682 Die "Filesystem $gvFileSystem not supported for initrd image. Terminating." … … 2585 2705 fi 2586 2706 2707 # --nolog needs to be first, and is used in analyze-my-lvm 2708 if [ "$1" = "--nolog" ] ; then 2709 shift 2710 LOGFILE=/dev/stderr 2711 else 2712 > $LOGFILE 2713 fi 2587 2714 if [ "$1" = "--printvar" ] ; then 2588 2715 shift … … 2594 2721 2595 2722 > $LOGFILE 2596 LogFile "mindi v$MINDI_VERSION" 2597 LogFile "$ARCH architecture detected" 2598 LogFile "mindi called with the following arguments:" 2599 LogFile "$*" 2600 LogFile "Start date : `date`" 2601 LogFile "-----------------------------" 2723 LogFile "mindi v$MINDI_VERSION" 2724 LogFile "$ARCH architecture detected" 2725 LogFile "mindi called with the following arguments:" 2726 echo "$@">> $LOGFILE 2727 LogFile "Start date : `date`" 2728 LogFile "-----------------------------" 2602 2729 2603 2730 # Log some capital variables … … 2609 2736 LogFile "MINDI_CONF = $MINDI_CONF" 2610 2737 if [ -f $MINDI_CONFIG ]; then 2611 LogFile "-----------------------------" 2612 LogFile " Mindi configuration file " 2613 LogFile "-----------------------------" 2738 LogFile "-----------------------------" 2739 LogFile " Mindi configuration file " 2740 LogFile "-----------------------------" 2614 2741 grep -Ev '^#' $MINDI_CONFIG >> $LOGFILE 2615 LogFile "-----------------------------" 2616 fi 2617 2742 LogFile "-----------------------------" 2743 fi 2744 LogFile "In Mindi" 2745 LogFile "--------" 2746 LogFile "EXTRA_SPACE = $EXTRA_SPACE" 2747 LogFile "BOOT_SIZE = $BOOT_SIZE" 2748 LogFile "--------" 2618 2749 2619 2750 trap AbortHere SIGTERM SIGHUP SIGQUIT SIGKILL SIGABRT SIGINT … … 2626 2757 if which awk &> /dev/null ; then 2627 2758 if ! which gawk &> /dev/null ; then 2628 Log All "You have awk but not gawk.\nPlease note that mindi works fine with a _sane_ awk binary.\nIf your awk binary misbehaves then please contact your vendor\nor distribution's mailing list for technical support.\n"2759 LogIt "INFO: You have awk but not gawk.\nPlease note that mindi works fine with a _sane_ awk binary.\nIf your awk binary misbehaves then please contact your vendor\nor distribution's mailing list for technical support.\n" 2629 2760 fi 2630 2761 fi … … 2632 2763 [ ! -e "$FDISK" ] && Die "Cannot find $FDISK" 2633 2764 2634 [ "`echo $KERVERRUN | grep "2.4.[0-6]" | grep -v "2.4.[0-9][0-9]"`" != "" ] && echo "WARNING! Your kernel may have buggy loopfs code. Consider upgrading to 2.4.7"2765 [ "`echo $KERVERRUN | grep -E "2\.4\.[0-6]" | grep -vE "2\.4\.[0-9][0-9]"`" != "" ] && echo "WARNING! Your kernel may have buggy loopfs code. Consider upgrading to 2.4.7" 2635 2766 2636 2767 # Update the PATH variable if incomplete … … 2638 2769 PATH=$PATH:/sbin:/usr/sbin 2639 2770 export PATH 2640 LogFile " Your PATH did not include /sbin or /usr/sbin. I have fixed that, temporarily."2641 LogFile " However, you may wish to ask your vendor to provide a permanent fix..."2642 LogFile " Or you might like to call 'su -' instead of 'su', for example."2771 LogFile "INFO: Your PATH did not include /sbin or /usr/sbin. I have fixed that, temporarily." 2772 LogFile "INFO: However, you may wish to ask your vendor to provide a permanent fix..." 2773 LogFile "INFO: Or you might like to call 'su -' instead of 'su', for example." 2643 2774 fi 2644 2775 … … 2682 2813 fi 2683 2814 2684 LogFile " LVM set to $LVM"2685 LogFile "----------" 2686 LogFile "mount result:" 2687 LogFile "-------------" 2815 LogFile "INFO: LVM set to $LVM" 2816 LogFile "----------" 2817 LogFile "mount result:" 2818 LogFile "-------------" 2688 2819 mount >> $LOGFILE 2689 LogFile "-------------"2690 2820 if [ -e /etc/raidtab ]; then 2691 LogFile "-------------" 2692 LogFile "/etc/raidtab content:" 2693 LogFile "-------------" 2821 LogFile "-------------" 2822 LogFile "/etc/raidtab content:" 2823 LogFile "-------------" 2694 2824 cat /etc/raidtab >> $LOGFILE 2825 else 2826 LogFile "No file /etc/raidtab" 2827 fi 2828 if [ -e /etc/mdadm.conf ]; then 2829 LogFile "-------------" 2830 LogFile "/etc/mdadm.conf content:" 2831 LogFile "-------------" 2832 cat /etc/mdadm.conf >> $LOGFILE 2833 else 2834 LogFile "-------------" 2835 LogFile "No file /etc/mdadm.conf" 2695 2836 fi 2696 2837 LogFile "-------------" … … 2702 2843 LogFile "-------------" 2703 2844 cat /proc/swaps >> $LOGFILE 2704 LogFile "-------------" 2705 LogFile "cat /proc/partitions:" 2706 LogFile "-------------" 2845 LogFile "-------------" 2846 if [ -e /proc/mdstat ]; then 2847 LogFile "cat /proc/mdstat:" 2848 LogFile "-------------" 2849 cat /proc/mdstat >> $LOGFILE 2850 else 2851 LogFile "No pseudo file /proc/mdstat" 2852 fi 2853 LogFile "-------------" 2854 LogFile "cat /proc/partitions:" 2855 LogFile "-------------" 2707 2856 cat /proc/partitions >> $LOGFILE 2708 LogFile "-------------" 2709 LogFile "cat /proc/filesystems:" 2710 LogFile "-------------" 2857 LogFile "-------------" 2858 LogFile "cat /proc/filesystems:" 2859 LogFile "-------------" 2711 2860 cat /proc/filesystems >> $LOGFILE 2712 LogFile "-------------" 2713 LogFile "lsmod result:" 2714 LogFile "-------------" 2861 LogFile "-------------" 2862 LogFile "lsmod result:" 2863 LogFile "-------------" 2715 2864 lsmod >> $LOGFILE 2716 2865 MODULES="`cat /proc/modules | $AWK '{print $1}'`" 2717 2866 if [ -x /usr/sbin/esxcfg-module ]; then 2718 LogFile "-------------" 2719 LogFile " VMWare ESX server detected - Enabling dedicated support"2720 LogFile "-------------" 2721 LogFile "VMWare modules" 2722 LogFile "-------------" 2867 LogFile "-------------" 2868 LogFile "INFO: VMWare ESX server detected - Enabling dedicated support" 2869 LogFile "-------------" 2870 LogFile "VMWare modules" 2871 LogFile "-------------" 2723 2872 /usr/sbin/esxcfg-module -l >> $LOGFILE 2724 2873 MODULES="$MODULES `/usr/sbin/esxcfg-module -l | $AWK '{print $1}'`" 2725 2874 fi 2726 LogFile "FORCE_MODS:"2727 LogFile "-------------"2728 LogFile $FORCE_MODS2729 LogFile "-------------"2730 LogFile "DENY_MODS:"2731 LogFile "-------------"2732 LogFile $DENY_MODS2733 LogFile "-------------"2734 LogFile "df result:"2735 LogFile "----------"2736 df -T >> $LOGFILE2737 LogFile "-------------"2738 2875 LogFile "Liste of extra modules is:" 2739 2876 LogFile "-------------" 2740 2877 LogFile "$EXTRA_MODS" 2741 2878 LogFile "-------------" 2879 LogFile "FORCE_MODS:" 2880 LogFile "-------------" 2881 LogFile "$FORCE_MODS" 2882 LogFile "-------------" 2883 LogFile "DENY_MODS:" 2884 LogFile "-------------" 2885 LogFile "$DENY_MODS" 2886 LogFile "-------------" 2887 LogFile "df result:" 2888 LogFile "----------" 2889 df -aT >> $LOGFILE 2890 LogFile "-------------" 2891 LogFile "df -i result:" 2892 LogFile "----------" 2893 df -i >> $LOGFILE 2894 LogFile "-------------" 2895 if [ -r /boot/grub/menu.lst ]; then 2896 LogFile "-------------" 2897 LogFile "INFO: /boot/grub/menu.lst content" 2898 LogFile "-------------" 2899 cat /boot/grub/menu.lst >> $LOGFILE 2900 LogFile "-------------" 2901 fi 2902 if [ -r /boot/grub/grub.conf ]; then 2903 LogFile "-------------" 2904 LogFile "INFO: /boot/grub/grub.conf content" 2905 LogFile "-------------" 2906 cat /boot/grub/grub.conf >> $LOGFILE 2907 LogFile "-------------" 2908 fi 2909 if [ -r /boot/grub/grub.cfg ]; then 2910 LogFile "-------------" 2911 LogFile "INFO: /boot/grub/grub.cfg content" 2912 LogFile "-------------" 2913 cat /boot/grub/grub.cfg >> $LOGFILE 2914 LogFile "-------------" 2915 fi 2916 if [ -r /boot/grub/device.map ]; then 2917 LogFile "-------------" 2918 LogFile "INFO: /boot/grub/device.map content" 2919 LogFile "-------------" 2920 cat /boot/grub/device.map >> $LOGFILE 2921 LogFile "-------------" 2922 fi 2923 if [ -r /etc/lilo.conf ]; then 2924 LogFile "-------------" 2925 LogFile "INFO: /etc/lilo.conf content" 2926 LogFile "-------------" 2927 cat /etc/lilo.conf >> $LOGFILE 2928 fi 2929 LogFile "Full fdisk info" 2930 LogFile "---------------" 2931 $FDISK -l >> $LOGFILE 2932 LogFile "----------------" 2933 LogFile "List of extra modules is:" 2934 LogFile "$EXTRA_MODS" 2935 LogFile "-------------" 2742 2936 2743 2937 # Compute libata version … … 2747 2941 if [ "$laver" = "2" ]; then 2748 2942 DENY_MODS="$DENY_MODS ide-generic" 2749 LogFile "ide-generic removed from module list as your system uses libata v2+" 2750 LogFile "-------------" 2751 fi 2943 LogFile "INFO: ide-generic removed from module list as your system uses libata v2+" 2944 LogFile "-------------" 2945 fi 2946 fi 2947 2948 # Check for McAfee which disturbs the access to some files (tgz in articular) 2949 if [ "x`cat /proc/linuxshield/enabled 2>/dev/null`" = "x1" ]; then 2950 LogFile "WARNING: McAfee LinuxShield is enabled. McAfee might block access to certain special files." 2951 LogFile "WARNING: Check in /var/opt/NAI/LinuxShield/etc/nailsd.cfg for 'nailsd.profile.OAS.action.error: Block'" 2952 LogFile "WARNING: You have two options:" 2953 LogFile "WARNING: - Exclude all directories with special files (check McAfee System Events Log)" 2954 LogFile "WARNING: - Disable the scanner during the backup" 2752 2955 fi 2753 2956 2754 2957 # Check for ISO_CMD command 2755 2958 if [ ! -x $ISO_CMD ]; then 2756 echo "NOTE: No CD image (ISO file) utility found" >> $LOGFILE2959 LogFile "NOTE: No CD image (ISO file) utility found" 2757 2960 fi 2758 2961 … … 2788 2991 if [ $KERNEL_IS_XEN = "yes" ]; then 2789 2992 echo "$xenkernelpath" 2790 Log Only "xenkernelpath = $xenkernelpath"2993 LogFile "INFO: xenkernelpath = $xenkernelpath" 2791 2994 MindiExit 0 2792 2995 else … … 2795 2998 else 2796 2999 echo "$resk" 2797 Log Only "kernelpath = $resk"3000 LogFile "INFO: kernelpath = $resk" 2798 3001 MindiExit 0 2799 3002 fi … … 2806 3009 elif [ "$1" = "--readalllink" ] ; then 2807 3010 [ ! "$2" ] && Die "Please specify the binary to look at" 2808 shift2809 ReadAllLink $*2810 3011 # Avoids logfile content for mondo 2811 3012 export MONDO_SHARE="" 3013 ReadAllLink $2 2812 3014 MindiExit $? 2813 3015 elif [ "$1" = "--makemessage" ] ; then 2814 MakeMessageFile 3016 MakeMessageFile | cut -c1-80 2815 3017 MindiExit 0 2816 3018 elif [ "$1" = "--makemountlist" ] ; then … … 2853 3055 ### 2854 3056 if [ $KERNEL_IS_XEN = "yes" ]; then 2855 LogAll " xenkernelpath = $xenkernelpath"3057 LogAll "INFO: xenkernelpath = $xenkernelpath" 2856 3058 fi 2857 3059 kernelname=`echo $kernelpath | cut -d'-' -f2- | sed 's/.[bg]z[2]*$//'` 2858 3060 if [ ! -d "/lib/modules/$kernelname" ] 2859 3061 then 2860 LogAll " Module path for ${kernelpath} not found..."2861 LogAll " using running kernel\'s modules."3062 LogAll "WARNING: Module path for ${kernelpath} not found..." 3063 LogAll " using running kernel\'s modules." 2862 3064 kernelname=$KERVERRUN 2863 3065 else 2864 3066 LogAll "Using modules for kernel: ${kernelname}" 2865 3067 fi 2866 LogAll " kernelname = $kernelname"2867 LogAll " kernelpath = $kernelpath"3068 LogAll "INFO: kernelname = $kernelname" 3069 LogAll "INFO: kernelpath = $kernelpath" 2868 3070 ### 2869 3071 ### end of Sq-Modification … … 2881 3083 if [ "${11}" ] ; then 2882 3084 LILO_OPTIONS="" 2883 # LogAll " LILO will use conservative settings, to be compatible with older BIOSes."3085 # LogAll "INFO: LILO will use conservative settings, to be compatible with older BIOSes." 2884 3086 fi 2885 3087 ESTIMATED_TOTAL_NOOF_SLICES=${12} … … 2918 3120 LogFile "DIFFERENTIAL = $DIFFERENTIAL" 2919 3121 LogFile "INTERNAL TAPE BLOCK SIZE = $INTERNAL_TAPE_BLOCK_SIZE" 3122 if [ -f $MINDI_LIB/rootfs/bin/busybox ]; then 3123 LogIt "Mindi-`$MINDI_LIB/rootfs/bin/busybox 2>&1 | head -1`" 3124 else 3125 LogIt "ERROR: No mindi-busybox installed" 3126 fi 2920 3127 2921 3128 if [ "$PROMPT_MAKE_USB_IMAGE" = "yes" ] && [ "$USBDEVICE" != "" ]; then 2922 LogAll "I ncluding the generation of a Bootable USB device on $USBDEVICE"3129 LogAll "INFO: Including the generation of a Bootable USB device on $USBDEVICE" 2923 3130 fi 2924 3131 … … 2940 3147 fi 2941 3148 fi 2942 LogFile " Mindi's temp dir=$MINDI_TMP"2943 LogFile "M indi's output dir=$MINDI_CACHE"2944 [ "$(($RANDOM%64))" -eq "0" ] && Log All "Dude, I've looked inside your computer and it's really dusty..."3149 LogFile "INFO: Mindi's temp dir=$MINDI_TMP" 3150 LogFile "MINFO: indi's output dir=$MINDI_CACHE" 3151 [ "$(($RANDOM%64))" -eq "0" ] && LogIt "INFO: Dude, I've looked inside your computer and it's really dusty..." 2945 3152 2946 3153 PrepareDataDiskImages … … 2948 3155 export ramdisk_size=$(($size_of_all_tools+$EXTRA_SPACE)) 2949 3156 2950 LogFile " Ramdisk will be $ramdisk_size KB"3157 LogFile "INFO: Ramdisk will be $ramdisk_size KB" 2951 3158 PrepareBootDiskImage $kernelpath || Die "Failed to create $ramdisk_size MB disk image." 2952 3159 … … 2983 3190 fi 2984 3191 # cleanup 2985 LogAll " $FRIENDLY_OUTSTRING"3192 LogAll "INFO: $FRIENDLY_OUTSTRING" 2986 3193 for mtpt in $FLOPPY_WAS_MOUNTED ; do 2987 3194 mount $mtpt -
branches/3.1/mindi/mindi-bkphw
r2937 r3147 2 2 # 3 3 # $Id$ 4 # Copyright B. Cornec 2005-2013 5 # Provided under the GPL v2 4 6 # 5 7 # Backup the hardware configuration on machine supporting it … … 8 10 use strict; 9 11 use File::Basename; 12 13 =pod 14 15 =head1 NAME 16 17 mindi-bkphw keeps track of your hardware configuration (BIOS, Raid, Management board, ...) 18 19 =head1 DESCRIPTION 20 21 mindi-bkphw keeps track of your hardware configuration by calling the tool provided by IHV (Independant Hardware Vendor) in order to store the configuration of the system BIOS, the RAID controller or the onboard management card if any of those is present. 22 23 For the moment, this is only working for HP ProLiant servers, as HP provides all these tools in a convenient way to perform these actions. Other manufacturer can provide patches or relevant info in order to be supported as well here. 24 25 =head1 SYNOPSIS 26 27 mindi-bkphw /path/to/cache-dir /path/to/conf-dir 28 29 =head1 ARGUMENTS 30 31 =over 4 32 33 =item B</path/to/cache-dir> 34 35 This is the directory where the generated files will be stored. 36 37 =item B</path/to/conf-dir> 38 39 This is the directory where the configuration file describing the tools needed to backup hardware information is stored. Generaly /etc/mindi. It should contain a deplist.d subdirectory, and for now only the ProLiant.conf file is used in it. 40 41 =back 42 43 =head1 WEB SITES 44 45 The main Web site of the project is available at L<http://www.mondorescue.org>. Bug reports should be filled using the trac instance of the project at L<http://trac.mondorescue.org/>. 46 47 =head1 USER MAILING LIST 48 49 For community exchanges around MondoRescue please use the list L<http://sourceforge.net/mailarchive/forum.php?forum_name=mondo-devel> 50 51 =head1 AUTHORS 52 53 The MondoRescue team lead by Bruno Cornec L<mailto:bruno@mondorescue.org>. 54 55 =head1 COPYRIGHT 56 57 MondoRescue is distributed under the GPL v2.0 license or later, 58 described in the file C<COPYING> included with the distribution. 59 60 =cut 61 10 62 11 63 # Handling Configuration files … … 31 83 close(SYSTEM); 32 84 33 die " WARNING: No product name found for Hardware support\n" if (not defined $productname);85 die "INFO: No product name found for Hardware support\n" if (not defined $productname); 34 86 35 87 if ($productname =~ /proliant/i) { 36 88 print "Detected a $productname. Nice. Continue to support my job :-)\n"; 37 89 print "Activating ProLiant support for mindi\n"; 38 print "You can install the SmartStart Scripting toolkit tool $tool\nto benefit from mindi's enhanced ProLiant support\n"; 39 print "Get it from http://www.hp.com/servers/sstoolkit\n"; 40 print "And use the SDR to get all other HP ProLiant packages\n"; 41 print "Get it from http://downloads.linux.hp.com/SDR/downloads/ProLiantSupportPack/\n"; 90 print "You can install SDR packages to benefit from mindi's enhanced ProLiant support\n"; 91 print "Get them from http://downloads.linux.hp.com/SDR/\n"; 42 92 open(PROLIANT,"$confdir/deplist.d/ProLiant.conf") || die "Unable to open $confdir/deplist.d/ProLiant.conf"; 43 93 # generate a list of what need to be put on the backup media … … 71 121 } 72 122 if ($tool =~ /\/conrep$/) { 123 my $xmlf = "/opt/hp/hp-scripting-tools/etc/conrep.xml"; 73 124 # From the package 74 if ( ! -f "/opt/hp/hp-scripting-tools/etc/conrep.xml") {75 $ret = system("$tool -s -x /opt/hp/hp-scripting-tools/etc/conrep.xml-f$bkpdir/conrep.dat");125 if (-f $xmlf) { 126 $ret = system("$tool -s -x $xmlf -f$bkpdir/conrep.dat"); 76 127 # From the SSSTK 77 } elsif (! -f "/usr/share/conrep/conrep.xml") {78 $ret = system("$tool -s -x /usr/share/conrep/conrep.xml -f$bkpdir/conrep.dat");79 128 } else { 80 next; 129 $xmlf = "/usr/share/conrep/conrep.xml"; 130 if (-f $xmlf) { 131 $ret = system("$tool -s -x $xmlf -f$bkpdir/conrep.dat"); 132 } else { 133 next; 134 } 81 135 } 82 136 print SCRIPT "$tool -l -f$locbkpdir/conrep.dat\n"; 83 print TOOLS "$tool.xml\n"; 137 print TOOLS "$xmlf\n"; 138 } 139 if ($tool =~ /\/hp-rcu$/) { 140 $ret = system("$tool -s -f$bkpdir/conrep.dat"); 141 print SCRIPT "$tool -l -f$locbkpdir/conrep.dat\n"; 84 142 } 85 143 if ($tool =~ /\/hpacuscripting$/) { … … 100 158 print SCRIPT "./$tool -s\n"; 101 159 } 160 if ($tool =~ /\/hp-fm/) { 161 print "Found $tool, firmware will be upgraded at restore time on your HP ProLiant\n"; 162 print SCRIPT "./$tool upgrade\n"; 163 } 102 164 # Kept for compatibility with older version of tools 103 165 if (($tool =~ /\/hpacucli$/) && ($hasfound == 0)) { … … 114 176 close(SCRIPT); 115 177 } else { 116 print "\n WARNING: No Hardware support for $productname.\nNot a big issue, just less features and risks ;-)\n";178 print "\nINFO: No Hardware support for $productname.\nNot a big issue, just less features and risks ;-)\n"; 117 179 print "You may ask your manufacturer to contribute to the mindi project (harmless)\n"; 118 180 } -
branches/3.1/mindi/mindi-get-perl-modules
r2850 r3147 1 1 #!/usr/bin/perl -w 2 # 3 # $Id$ 4 # Copyright B. Cornec 2005-2013 5 # Provided under the GPL v2 2 6 # 3 7 # Get perl modules required by mindi and mondo and that should be on the restore media … … 7 11 use File::Find; 8 12 use Cwd; 13 14 15 =pod 16 17 =head1 NAME 18 19 mindi-get-perl-modules keeps track of the perl modules that should be on your restore media 20 21 =head1 DESCRIPTION 22 23 mindi-get-perl-modules keeps track of the perl modules that should be on your restore media by analyzing the references made to them in the scripts passed as parameters and returning all the modules needed to have them work correctly. 24 25 =head1 SYNOPSIS 26 27 mindi-get-perl-modules /path/to/perl-script ... 28 29 =head1 ARGUMENTS 30 31 =over 4 32 33 =item B</path/to/perl-script> 34 35 This is the path of the perl script to analyze and for which we want its perl modules in dependence to be included 36 37 =back 38 39 =head1 WEB SITES 40 41 The main Web site of the project is available at L<http://www.mondorescue.org>. Bug reports should be filled using the trac instance of the project at L<http://trac.mondorescue.org/>. 42 43 =head1 USER MAILING LIST 44 45 For community exchanges around MondoRescue please use the list L<http://sourceforge.net/mailarchive/forum.php?forum_name=mondo-devel> 46 47 =head1 AUTHORS 48 49 The MondoRescue team lead by Bruno Cornec L<mailto:bruno@mondorescue.org>. 50 51 =head1 COPYRIGHT 52 53 MondoRescue is distributed under the GPL v2.0 license or later, 54 described in the file C<COPYING> included with the distribution. 55 56 =cut 57 9 58 10 59 my $file = get_perl_modules(@ARGV) if (defined $ARGV[0]); … … 100 149 sub process_file { 101 150 102 103 104 105 106 107 151 my %line; 152 my %require; 153 my $current_line; 154 my $tag; 155 156 foreach my $file (@_) { 108 157 109 open(FILE, "<$file") || return(\%require); 110 111 while (<FILE>) { 112 113 # skip the "= <<" block 114 115 if ( ( m/^\s*\$(.*)\s*=\s*<<\s*["'](.*)['"]/i) || 116 ( m/^\s*\$(.*)\s*=\s*<<\s*(.*);/i) ) { 117 $tag = $2; 118 while (<FILE>) { 119 ( $_ =~ /^$tag/) && last; 120 } 121 } 122 123 # skip the documentation 124 125 # we should not need to have item in this if statement (it 126 # properly belongs in the over/back section) but people do not 127 # read the perldoc. 128 129 if ( (m/^=(head1|head2|pod|item)/) .. (m/^=(cut)/) ) { 130 next; 131 } 132 133 if ( (m/^=(over)/) .. (m/^=(back)/) ) { 134 next; 135 } 136 137 # skip the data section 138 if (m/^__(DATA|END)__$/) { 139 last; 140 } 141 142 # Each keyword can appear multiple times. Don't 143 # bother with datastructures to store these strings, 144 # if we need to print it print it now. 145 146 if ( m/^\s*\$RPM_Requires\s*=\s*["'](.*)['"]/i) { 147 foreach $_ (split(/\s+/, $1)) { 148 print "$_\n"; 149 } 150 } 151 152 if ( 158 open(FILE, "<$file") || return(\%require); 159 while (<FILE>) { 160 161 # skip the "= <<" block 162 163 if ( ( m/^\s*\$(.*)\s*=\s*<<\s*["'](.*)['"]/i) || 164 ( m/^\s*\$(.*)\s*=\s*<<\s*(.*);/i) ) { 165 $tag = $2; 166 while (<FILE>) { 167 ( $_ =~ /^$tag/) && last; 168 } 169 } 170 171 # skip the documentation 172 173 # we should not need to have item in this if statement (it 174 # properly belongs in the over/back section) but people do not 175 # read the perldoc. 176 177 if ( (m/^=(head1|head2|pod|item)/) .. (m/^=(cut)/) ) { 178 next; 179 } 180 181 if ( (m/^=(over)/) .. (m/^=(back)/) ) { 182 next; 183 } 184 185 # skip the data section 186 if (m/^__(DATA|END)__$/) { 187 last; 188 } 189 190 # Each keyword can appear multiple times. Don't 191 # bother with datastructures to store these strings, 192 # if we need to print it print it now. 193 194 if ( m/^\s*\$RPM_Requires\s*=\s*["'](.*)['"]/i) { 195 foreach $_ (split(/\s+/, $1)) { 196 print "$_\n"; 197 } 198 } 199 200 if ( 153 201 154 202 # ouch could be in a eval, perhaps we do not want these since we catch … … 160 208 161 209 162 (m/^(\s*) # we hope the inclusion starts the line 163 (require|use)\s+(?!\{) # do not want 'do {' loops 164 # quotes around name are always legal 165 [\'\"]?([^\;\ \'\"\t]*)[\'\"]?[\t\;\ ] 166 # the syntax for 'use' allows version requirements 167 \s*([.0-9]*) 168 /x) 169 ) { 170 my ($whitespace, $statement, $module, $version) = ($1, $2, $3,$4); 171 my $usebase; 172 173 # we only consider require statements that are flush against 174 # the left edge. any other require statements give too many 175 # false positives, as they are usually inside of an if statement 176 # as a fallback module or a rarely used option 177 178 ($whitespace ne "" && $statement eq "require") && next; 179 180 # if there is some interpolation of variables just skip this 181 # dependency, we do not want 182 # do "$ENV{LOGDIR}/$rcfile"; 183 184 ($module =~ m/\$/) && next; 185 186 # skip if the phrase was "use of" -- shows up in gimp-perl, et al 187 next if $module eq 'of'; 188 189 # if the module ends in a comma we probaly caught some 190 # documentation of the form 'check stuff,\n do stuff, clean 191 # stuff.' there are several of these in the perl distribution 192 193 ($module =~ m/[,>]$/) && next; 194 195 # if the module name starts in a dot it is not a module name. 196 # Is this necessary? Please give me an example if you turn this 197 # back on. 198 199 # ($module =~ m/^\./) && next; 200 201 # if the module ends with .pm strip it to leave only basename. 202 # starts with /, which means its an absolute path to a file 203 if ($module =~ m(^/)) { 204 print "$module\n"; 205 next; 206 } 207 208 # as seen in some perl scripts 209 # use base qw(App::CLI Class::Accessor::Chained::Fast App::CLI::Command); 210 if ($module eq 'base') { 211 $require{$module} = $version; 212 $line{$module} = $current_line; 213 ($module = $_) =~ s/use\s*base\s*//; 214 $module =~ s/qw\((.*)\)\s*;/$1/; 215 $module =~ s/qw(.)(.*)\1\s*;/$2/; 216 $module =~ s/\s*;$//; 217 $module =~ s/#.*//; 218 $usebase = 1; 219 } 220 # sometimes people do use POSIX qw(foo), or use POSIX(qw(foo)) etc 221 # we can strip qw.*$, as well as (.*$: 222 $module =~ s/qw.*$//; 223 $module =~ s/\(.*$//; 224 225 $module =~ s/\.pm$//; 226 227 # some perl programmers write 'require URI/URL;' when 228 # they mean 'require URI::URL;' 229 230 $module =~ s/\//::/; 231 232 # trim off trailing parenthesis if any. Sometimes people pass 233 # the module an empty list. 234 235 $module =~ s/\(\s*\)$//; 236 237 # if module is a number then both require and use interpret that 238 # to mean that a particular version of perl is specified. Don't 239 # add a dependency, though, since the rpm will already require 240 # perl-base at the build version (via find-requires) 241 next if $module =~ /^v?\d/; 242 243 # ph files do not use the package name inside the file. 244 # perlmodlib documentation says: 245 # the .ph files made by h2ph will probably end up as 246 # extension modules made by h2xs. 247 # so do not spend much effort on these. 248 249 # there is no easy way to find out if a file named systeminfo.ph 250 # will be included with the name sys/systeminfo.ph so only use the 251 # basename of *.ph files 252 253 ($module =~ m/\.ph$/) && next; 254 255 # if the module was loaded trough base, we need to split the list 256 if ($usebase) { 257 my $current_line = $_; 258 foreach (split(/\s+/, $module)) { 259 next unless $_; 260 $require{$_} = $version; 261 $line{$_} = $current_line; 262 } 263 } else { 264 $require{$module}=$version; 265 $line{$module}=$current_line; 266 } 267 } 268 } 269 270 close(FILE) || 271 die("$0: Could not close file: '$file' : $!\n"); 210 (m/^(\s*) # we hope the inclusion starts the line 211 (require|use)\s+(?!\{) # do not want 'do bracket' loops 212 # quotes around name are always legal 213 [\'\"]?([^\;\ \'\"\t]*)[\'\"]?[\t\;\ ] 214 # the syntax for 'use' allows version requirements 215 \s*([.0-9]*) 216 /x) 217 ) { 218 my ($whitespace, $statement, $module, $version) = ($1, $2, $3,$4); 219 my $usebase; 220 221 # we only consider require statements that are flush against 222 # the left edge. any other require statements give too many 223 # false positives, as they are usually inside of an if statement 224 # as a fallback module or a rarely used option 225 226 ($whitespace ne "" && $statement eq "require") && next; 227 228 # if there is some interpolation of variables just skip this 229 # dependency, we do not want 230 # do "$ENV{LOGDIR}/$rcfile"; 231 232 ($module =~ m/\$/) && next; 233 234 # skip if the phrase was "use of" -- shows up in gimp-perl, et al 235 next if $module eq 'of'; 236 237 # if the module ends in a comma we probaly caught some 238 # documentation of the form 'check stuff,\n do stuff, clean 239 # stuff.' there are several of these in the perl distribution 240 241 ($module =~ m/[,>]$/) && next; 242 243 # if the module name starts in a dot it is not a module name. 244 # Is this necessary? Please give me an example if you turn this 245 # back on. 246 247 # ($module =~ m/^\./) && next; 248 249 # if the module ends with .pm strip it to leave only basename. 250 # starts with /, which means its an absolute path to a file 251 if ($module =~ m(^/)) { 252 print "$module\n"; 253 next; 254 } 255 256 # as seen in some perl scripts 257 # use base qw(App::CLI Class::Accessor::Chained::Fast App::CLI::Command); 258 if ($module eq 'base') { 259 $require{$module} = $version; 260 $line{$module} = $current_line; 261 ($module = $_) =~ s/use\s*base\s*//; 262 $module =~ s/qw\((.*)\)\s*;/$1/; 263 $module =~ s/qw(.)(.*)\1\s*;/$2/; 264 $module =~ s/\s*;$//; 265 $module =~ s/#.*//; 266 $usebase = 1; 267 } 268 # sometimes people do use POSIX qw(foo), or use POSIX(qw(foo)) etc 269 # we can strip qw.*$, as well as (.*$: 270 $module =~ s/qw.*$//; 271 $module =~ s/\(.*$//; 272 273 $module =~ s/\.pm$//; 274 275 # some perl programmers write 'require URI/URL;' when 276 # they mean 'require URI::URL;' 277 278 $module =~ s/\//::/; 279 280 # trim off trailing parenthesis if any. Sometimes people pass 281 # the module an empty list. 282 283 $module =~ s/\(\s*\)$//; 284 285 # if module is a number then both require and use interpret that 286 # to mean that a particular version of perl is specified. Don't 287 # add a dependency, though, since the rpm will already require 288 # perl-base at the build version (via find-requires) 289 next if $module =~ /^v?\d/; 290 291 # ph files do not use the package name inside the file. 292 # perlmodlib documentation says: 293 # the .ph files made by h2ph will probably end up as 294 # extension modules made by h2xs. 295 # so do not spend much effort on these. 296 297 # there is no easy way to find out if a file named systeminfo.ph 298 # will be included with the name sys/systeminfo.ph so only use the 299 # basename of *.ph files 300 301 ($module =~ m/\.ph$/) && next; 302 303 # if the module was loaded trough base, we need to split the list 304 if ($usebase) { 305 my $current_line = $_; 306 foreach (split(/\s+/, $module)) { 307 next unless $_; 308 $require{$_} = $version; 309 $line{$_} = $current_line; 310 } 311 } else { 312 $require{$module}=$version; 313 $line{$module}=$current_line; 314 } 315 } 272 316 } 273 317 274 return(\%require); 275 } 318 close(FILE) || die("$0: Could not close file: '$file' : $!\n"); 319 } 320 321 return(\%require); 322 } -
branches/3.1/mindi/mindi.conf
r2850 r3147 9 9 # BOOT_SIZE=32768 # size of the boot disk 10 10 # MINDI_ADDITIONAL_BOOT_PARAMS="devfs=nomount noresume selinux=0 barrier=off udevtimeout=10 acpi=off" 11 # MINDI_DEFAULT_BOOT_OPTION="interactive ipconf=eth0:10.0.0.1:255.0.0.0:10.255.255.255:10.2.3.4" -
branches/3.1/mindi/parted2fdisk.pl
r2192 r3147 9 9 # Tested on ia64 with RHAS 2.1 - Mandrake 9.0 - RHEL 3.0 - SLES 10 10 10 # 11 # (c) Bruno Cornec <Bruno.Cornec@hp.com>12 # Licensed under the GPL11 # Copyright B. Cornec 2000-2013 12 # Provided under the GPL v2 13 13 14 14 use strict; 15 16 17 =pod 18 19 =head1 NAME 20 21 parted2fdisk is a fdisk lie command using parted internally. 22 23 =head1 DESCRIPTION 24 25 parted2fdisk behaves like a fdisk command, but dialog internally with parted in order to manipulate partiion tables, which allow it to support GPT partition format as well as MBR, contrary to fdisk. It aimed at providing compatible external interface wti fdisk. Developed initialy for ia64 Linux, but is also useful now on x86 systems using GPT partition format (for large HDDs). 26 27 =head1 SYNOPSIS 28 29 parted2fdisk -s partition 30 parted2fdisk -l device 31 parted2fdisk [-n] device 32 33 =head1 OPTIONS 34 35 =over 4 36 37 =item B<-s> 38 39 Print the size (in blocks) of the given partition. 40 41 =item B<-n> 42 43 Fake mode. Doesn't pass the commands just simulate. 44 45 =item B<-l> 46 47 List the partition tables for the specified device and then exit. 48 49 =item B<no option> 50 51 Allow the creation and manipulation of partition tables. 52 53 =back 54 55 =head1 ARGUMENTS 56 57 =over 4 58 59 =item B<partition> 60 61 partition device file (only used with -s option). 62 63 =item B<device> 64 65 device file to work on. 66 67 =back 68 69 =head1 WEB SITES 70 71 The main Web site of the project is available at L<http://www.mondorescue.org>. Bug reports should be filled using the trac instance of the project at L<http://trac.mondorescue.org/>. 72 73 =head1 USER MAILING LIST 74 75 For community exchanges around MondoRescue please use the list L<http://sourceforge.net/mailarchive/forum.php?forum_name=mondo-devel> 76 77 =head1 AUTHORS 78 79 The MondoRescue team lead by Bruno Cornec L<mailto:bruno@mondorescue.org>. 80 81 =head1 COPYRIGHT 82 83 MondoRescue is distributed under the GPL v2.0 license or later, 84 described in the file C<COPYING> included with the distribution. 85 86 =cut 87 15 88 16 89 $ENV{LANG} = "C"; -
branches/3.1/mindi/rootfs/etc/init.d/rcS
r2937 r3147 53 53 mount / -o rw,remount > /dev/null 2> /dev/null 54 54 LogIt "Launching Shell" 55 setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1' 55 for i in `cat /proc/cmdline`; do 56 echo $i | grep -qi console= && console=`echo $i | cut -d= -f2` 57 echo $i | grep -qi serial= && serial=`echo $i | cut -d= -f2` 58 done 59 LogIt "Launching Shell" 60 if [[ $serial != "" && -e $serial ]]; then 61 setsid sh -c "exec sh <$serial >$serial 2>&1" 62 elif [[ $console != "" && -e $console ]]; then 63 setsid sh -c "exec sh <$console >$console 2>&1" 64 else 65 setsid sh -c "exec sh </dev/tty1 >/dev/tty1 2>&1" 66 fi 56 67 } 57 68 … … 95 106 openvt $opt 7 /bin/sh /sbin/wait-for-petris 96 107 openvt $opt 8 /usr/bin/tail -f $LOGFILE 108 openvt $opt 9 /usr/bin/tail -f /var/log/messages 97 109 # May avoid shell error messages 98 110 chmod 666 /dev/tty* /dev/console … … 130 142 [ ! "$tapedev" ] && tapedev=`grep media-dev /tmp/mondo-restore.cfg 2>/dev/null | tr -s ' ' ' ' | cut -d' ' -f2` 131 143 mt -f $tapedev rewind 144 if [ $? -ne 0 ]; then 145 LogIt "WARNING: $tapedev failed to rewind, either not a tape or still in OBDR mode." 1 146 LogIt " Trying to find the corresponding SCSI generic device." 1 147 c=0 148 for d in `ls /sys/class/scsi_device/*`; do 149 devtype=`cat $d/device/type` 150 if [ _"$devtype" -eq _"1" ]; then 151 LogIt "NOTE: Device /dev/sg$c is a Sequential device." 1 152 if [ -x /usr/bin/sg_map ]; then 153 dev=`/usr/bin/sg_map | grep -E "^/dev/sg$c" | awk '{print $2}'` 154 LogIt " Retry using device $dev" 1 155 fi 156 elif [ _"$devtype" -eq _"0" ]; then 157 # Skipping a HDD 158 /bin/true 159 elif [ _"$devtype" -eq _"5" ]; then 160 # Checking whether it's a CD or a tape in OBDR mode 161 grep -q -i -E 'dat|ultrium|tape' $d/device/model 162 if [ $? -eq 0 ]; then 163 # Is probably a Tape drive left in OBDR. 164 LogIt "Found that /dev/sg$c is a tape drive (`cat $d/device/model`)." 1 165 grep -q -i -w 'hp' $d/device/vendor 166 if [ $? -eq 0 ]; then 167 LogIt "This is an HP tape drive, even better :-)." 1 168 fi 169 if [ -x /usr/bin/sg_reset ]; then 170 OBDR_MODS="st mptsas mptspi aic7xxx aic94xx mpt2sas " 171 if [ "`grep -i obdrmods /proc/cmdline`" ]; then 172 OBDR_MODS="$OBDR_MODS `cat /proc/cmdline | sed 's~.*obdrmods=\"\(.*\)\".*~\1~'`" 173 fi 174 LogIt "Removing modules $OBDR_MODS." 1 175 for m in $OBDR_MODS; do 176 rmmod $i 177 done 178 LogIt "Trying to force device /dev/sg$c to be in sequential mode." 1 179 /usr/bin/sg_reset -d /dev/sg$c 180 LogIt "Inserting modules `rev $OBDR_MODS`." 1 181 for m in `rev $OBDR_MODS`; do 182 modprobe $i 183 done 184 LogIt "Retry again as the device has been set back into sequential mode." 1 185 mt -f $tapedev fsf 2 186 res=$? 187 # exit the loop to continue and return if that previous mt failed. 188 # If it succeeded we transparently continue !! 189 break 190 else 191 LogIt "WARNING: Unable to reset /dev/sg$c as the sg_reset command is not availble." 1 192 fi 193 fi 194 else 195 LogIt "Device /dev/sg$c has an unknown type $devtype." 1 196 fi 197 c=`expr $c + 1` 198 done 199 200 if [ $res -ne 0 ]; then 201 cd $old_pwd 202 return $res 203 fi 204 fi 205 132 206 mt -f $tapedev fsf 2 133 207 # 32k is DEFAULT_INTERNAL_TAPE_BLOCK_SIZE … … 150 224 151 225 # Here we can add the USB storage module, it's working even with OBDR ! 152 modprobe -q usb-storage 226 modprobe -q usb-storage 2> /dev/null 153 227 # Tape takes some time to appear 154 228 sleep 10 … … 156 230 UntarTapeStuff $tapedev 157 231 res=$? 232 tapedev="default tape device" 158 233 while [ "$res" -ne "0" ] ; do 159 234 LogIt "$tapedev failed to act as extended data disk for booting." 1 160 LogIt "Please specify an alternate tape device," 1235 LogIt "Please specify an alternate non-rewinding tape device, such as /dev/nst0" 1 161 236 LogIt "or hit <Enter> to boot from another media." 1 162 237 echo -en "---> " … … 198 273 fi 199 274 echo "Activating a potential USB Storage device" 200 modprobe -q usb-storage 275 modprobe -q usb-storage 2> /dev/null 201 276 for i in 1 2 3 4 5 6 7 8 9 10 ; do 202 277 sleep 1 … … 322 397 ps | grep -v grep |grep udevd 2> /dev/null 1> /dev/null 323 398 if [ $? -ne 0 ]; then 324 /sbin/udevd --daemon & 399 if [ -x /sbin/udevd ]; then 400 /sbin/udevd --daemon & 401 elif [ -x /usr/bin/udevd ]; then 402 /usr/bin/udevd --daemon & 403 fi 325 404 echo "Waiting for udev to start..." 326 405 sleep 5 … … 337 416 /sbin/udevsettle --timeout=10 338 417 LogIt "Discovering with udevsettle" 339 elif [ -x /sbin/udevadm ] ; then340 UdevadmTrigger341 /sbin/udevadmsettle --timeout=10418 elif [ -x /sbin/udevadm ] || [ -x /usr/bin/udevadm ]; then 419 ua=`UdevadmTrigger` 420 $ua settle --timeout=10 342 421 LogIt "Discovering with udevadm" 343 422 fi … … 390 469 return 391 470 fi 392 modprobe -q uhcd_hci 393 modprobe -q usbhid 471 modprobe -q uhcd_hci 2> /dev/null 472 modprobe -q usbhid 2> /dev/null 394 473 } 395 474 … … 403 482 LogIt "Scanning LVM's..." 1 404 483 if which lvm ; then 405 modprobe -q dm-mod 406 modprobe -q dm_mod 484 modprobe -q dm-mod 2> /dev/null 485 modprobe -q dm_mod 2> /dev/null 407 486 lvm vgscan --mknodes 408 487 else … … 602 681 # For technical reasons, some sets are as large as 16MB. 603 682 # I am allowing 32MB because selective restore occupies a lot of space. 604 for size in 128m 64m 48m 40m 32m ; do683 for size in 256m 128m 64m 48m 40m 32m ; do 605 684 mount_cmd="mount /dev/shm -t tmpfs -o size=$size" ; # was 34m until 04/2003 606 685 LogIt "Trying '$mount_cmd'" … … 651 730 } 652 731 653 654 732 EnableCcissIfAppropriate() { 655 733 local f … … 668 746 669 747 # Now engage all Smart Array controllers to detect attached devices 670 for f in /proc/driver/cciss/cciss* ; do 671 LogIt "Engaging $f" 672 echo "engage scsi" > $f 673 LogIt "...result=$?" 674 done 748 if [ -d "/proc/driver/cciss" ]; then 749 for f in /proc/driver/cciss/cciss* ; do 750 LogIt "Engaging $f" 751 echo "engage scsi" > $f 752 LogIt "...result=$?" 753 done 754 fi 675 755 } 676 756 … … 685 765 if [ $? -eq 0 ]; then 686 766 echo "Forcing first $j..." 687 modprobe -q $j 767 modprobe -q $j 2> /dev/null 688 768 fi 689 769 done … … 701 781 fi 702 782 echo "Probing $j..." 703 modprobe -q $j 783 modprobe -q $j 2> /dev/null 704 784 done 705 785 } … … 707 787 UdevadmTrigger() { 708 788 789 # This function should just echo the return value $ua 790 709 791 if [ -x /sbin/udevadm ]; then 710 v=`/sbin/udevadm --version` 711 if [ "$v" -ge "146" ]; then 712 /sbin/udevadm trigger --type=failed 792 ua="/sbin/udevadm" 793 elif [ -x /usr/bin/udevadm ]; then 794 ua="/usr/bin/udevadm" 795 else 796 LogIt "WARNING: Unable to find udevadm. Not triggering udev" 797 ua="/bin/true" 798 fi 799 800 v="`$ua --version`" 801 802 if [ -x "$v" ]; then 803 LogIt "Triggering udev again..." 804 if [ "$v" -ge "146" -a "$v" -lt "174" ]; then 805 $ua trigger --type=failed 806 elif [ "$v" -lt "146" ]; then 807 $ua trigger --retry-failed 713 808 else 714 /sbin/udevadm trigger --retry-failed 715 fi 716 fi 809 LogIt "... not needed" 810 fi 811 fi 812 echo $ua 717 813 } 718 814 … … 730 826 # (useful for rules creating network ifcfg files) 731 827 if [ -e "/tmp/USE-UDEV" ] ; then 732 UdevadmTrigger828 ua=`UdevadmTrigger` 733 829 fi 734 830 } … … 739 835 MINDI_REV=PBREV 740 836 trap CaughtSoftReset SIGTERM 741 trap GetShell SIGINT R837 trap GetShell SIGINT 742 838 LOGFILE=/var/log/mondorestore.log 743 839 PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/mondo:/usr/games … … 907 1003 dmesg >> $LOGFILE 908 1004 LogIt "-------------" 1005 LogIt "/proc/mdstat:" >> $LOGFILE 1006 LogIt "-------------" 1007 cat /proc/mdstat >> $LOGFILE 1008 LogIt "-------------" 909 1009 LogIt "/proc/swaps:" >> $LOGFILE 910 1010 LogIt "-------------" … … 937 1037 # Not sure it's still needed, but shouldn't hurt 938 1038 if [ -e "/tmp/USE-UDEV" ] ; then 939 UdevadmTrigger1039 ua=`UdevadmTrigger` 940 1040 fi 941 1041 if grep "backup-media-type" /tmp/mondo-restore.cfg > /dev/null 2> /dev/null ; then -
branches/3.1/mindi/rootfs/etc/passwd
r2444 r3147 10 10 man:x:13:15:man:/usr/man: 11 11 guest:x:405:100:guest:/dev/null:/dev/null 12 rpc:x:492:491:system user for rpcbind:/var/lib/rpcbind:/sbin/nologin 13 rpcuser:x:491:490:system user for nfs-utils:/var/lib/nfs:/bin/false 12 14 nobody:x:65534:100:nobody:/dev/null: -
branches/3.1/mindi/rootfs/sbin/start-netfs
r2937 r3147 138 138 ln -sf /dev/console /dev/tty 139 139 sshfs -o ro,StrictHostKeyChecking=no $netfsopt $netfsmount /tmp/isodir 140 elif [ "$proto" = "smbfs" ]; then 141 LogIt "Mounting SMBFS share ($netfsmount) on /tmp/isodir..." 142 mount -t cifs $netfsopt $netfsmount /tmp/isodir -o ro 140 143 elif [ "$proto" != "" ]; then 144 if [ -x /sbin/rpcbind ]; then 145 "Startng rpcbind daemon..." 146 /sbin/rpcbind & 147 fi 141 148 LogIt "Mounting Network share ($netfsmount) on /tmp/isodir..." 142 149 touch /etc/mtab -
branches/3.1/mondo-doc/mondoarchive.8
r2937 r3147 127 127 and mondoarchive will try to do its best to support it. 128 128 Other protocols are available such as sshfs for fuse SSH based filesystem 129 mount, with the same syntax e.g. 'sshfs://user@192.168.1.3:/home/nfs' 129 mount, with the same syntax e.g. 'sshfs://user@192.168.1.3:/home/nfs' and 130 smbfs (aka cifs) for SaMBa or Windows based filesystem mount. 130 131 131 132 .TP … … 157 158 158 159 .TP 159 .BI "\-E " "\*(lq path|...\*(rq"160 Exclude path(s) from backup. The paths should be separated with a pipe and surrounded by quotes.160 .BI "\-E " "\*(lqdir|...\*(rq" 161 Exclude dir(s) from backup. The dirs should be separated with a pipe and surrounded by quotes. 161 162 This is the prefered and recommended option when doing partial archiving. 162 163 Note that mondo automatically excludes removable media (/mnt/floppy, … … 171 172 You may also specify full disk device to this option as with \-E 172 173 \*(lq/dev/sda|/dev/cciss/c0d0\*(rq 173 174 .TP 175 .BI "\-I " "\*(lqpath|...\*(rq" 176 Include paths(s) in backup. The paths should be separated with a pipe and surrounded by quotes. 174 N.B.: If for example you have a disk /dev/mapper/vgsan-lvdir mounted on a /mnt mountpoint 175 excluding the /dev/mapper/vgsan-lvdir device prevents mondorestore to touch the LVM structure 176 of this device at restore time (no pv|vg|lvcreate will occur). 177 However, if you exclude the mount point /mnt, the LVM structure will be re-created at restore time. 178 ALL DATA WILL THEN BE LOST ON THIS DEVICE. Use what is required for your configuration. 179 180 .TP 181 .BI "\-I " "\*(lqdir|...\*(rq" 182 Include dirs(s) in backup. The dirs should be separated with a pipe and surrounded by quotes. 177 183 This option is mainly used to perform tests 178 184 in order to reduce the time taken by the archiving operation. 179 The default backup pathis \*(lq/\*(rq but you may specify alternatives,185 The default backup dir is \*(lq/\*(rq but you may specify alternatives, 180 186 e.g. \-I \*(lq/home|/etc\*(rq to override that. 181 187 You may also specify full disk device to this option as with \-I … … 267 273 268 274 .TP 275 .BI "\-F " 276 Do not retry when a command failed but just exits. This is useful for an 277 automated mode launched from cron where you want to avoid filling your logs 278 due to an answer which is impossible to give. 279 280 .TP 281 .BI "\-G " 282 Use gzip, the standard and quicker Linux compression engine, instead of bzip2. 283 284 .TP 269 285 .BI "\-H " 270 286 When you boot from the tape/CD, your hard drive will be wiped and the archives … … 279 295 280 296 .TP 281 .BI "\-G " 282 Use gzip, the standard and quicker Linux compression engine, instead of bzip2. 297 .BI "\-M " "max-size" 298 Gives the maximum size of a biggie file (by default 64 MB). The value should 299 be given in kB. Example use \-M 128000 to have biggie being more than 128 MB. 283 300 284 301 .TP … … 288 305 .TP 289 306 .BI "\-R " 290 EXPERIMENTAL. Do not use in mission-critical environments. Star is an 291 alternative to afio. Mondo now supports POSIX ACLs and extended 292 attributes, so \-R is essentially redundant for now. 307 Star is an alternative to afio. Can be useful for distributions considering 308 that afio is not free enough due to its age and old licenses (wrongly in our 309 opinion). Star can be used to have a better support of sparse file compared to 310 afio. Also star supports natively POSIX ACLs, where as afio requires a special 311 additional handlling. 293 312 294 313 .TP -
branches/3.1/mondo-doc/mondorescue-howto.sgml
r2937 r3147 324 324 If you want to backup the whole computer (excluding /sys, /run and /proc, 325 325 naturally as well as /tmp) then leave this as / which is the default. Otherwise, 326 specify subsets, (e.g. /usr/local /home ) being sure to put a space326 specify subsets, (e.g. /usr/local|/home ) being sure to put a pipe 327 327 in between each path. 328 328 </entry> … … 338 338 If you are backing up your whole computer then you might want to 339 339 exclude certain directories, e.g. /shared/MP3. Please specify them 340 in the 'exclude directories' dialog box. Please put a space in341 between each path, e.g. /shared/private /scratch /nfs/windows340 in the 'exclude directories' dialog box. Please put a pipe in 341 between each path, e.g. /shared/private|/scratch|/nfs|/windows 342 342 </entry> 343 343 </row> -
branches/3.1/mondo-doc/mondorestore.8
r2937 r3147 106 106 Specify the restore device (CD/tape/USB) or directory (NFS/ISO). For CD-R[W] drives, 107 107 this is the SCSI node where the drive may be found, e.g. '0,1,0'. For tape 108 users, this is the tape streamers /dev entry, e.g. '/dev/ st0'. For USB users,108 users, this is the tape streamers /dev entry, e.g. '/dev/nst0'. For USB users, 109 109 this is the device name of your key or external disk. For ISO users, 110 110 this is the directory where the ISO images are stored. For NFS users, this is -
branches/3.1/mondo/COPYING
r30 r3147 3 3 4 4 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 675 Mass Ave, Cambridge, MA 02139,USA5 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 6 Everyone is permitted to copy and distribute verbatim copies 7 7 of this license document, but changing it is not allowed. … … 283 283 284 284 END OF TERMS AND CONDITIONS 285 286 287 Appendix: How to Apply These Terms to Your New Programs 288 289 If you develop a new program, and you want it to be of the greatest 290 possible use to the public, the best way to achieve this is to make it 291 free software which everyone can redistribute and change under these terms. 292 293 To do so, attach the following notices to the program. It is safest 294 to attach them to the start of each source file to most effectively 295 convey the exclusion of warranty; and each file should have at least 296 the "copyright" line and a pointer to where the full notice is found. 297 298 <one line to give the program's name and a brief idea of what it does.> 299 Copyright (C) 19yy <name of author> 300 301 This program is free software; you can redistribute it and/or modify 302 it under the terms of the GNU General Public License as published by 303 the Free Software Foundation; either version 2 of the License, or 304 (at your option) any later version. 305 306 This program is distributed in the hope that it will be useful, 307 but WITHOUT ANY WARRANTY; without even the implied warranty of 308 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 309 GNU General Public License for more details. 310 311 You should have received a copy of the GNU General Public License 312 along with this program; if not, write to the Free Software 313 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 314 315 Also add information on how to contact you by electronic and paper mail. 316 317 If the program is interactive, make it output a short notice like this 318 when it starts in an interactive mode: 319 320 Gnomovision version 69, Copyright (C) 19yy name of author 321 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 322 This is free software, and you are welcome to redistribute it 323 under certain conditions; type `show c' for details. 324 325 The hypothetical commands `show w' and `show c' should show the appropriate 326 parts of the General Public License. Of course, the commands you use may 327 be called something other than `show w' and `show c'; they could even be 328 mouse-clicks or menu items--whatever suits your program. 329 330 You should also get your employer (if you work as a programmer) or your 331 school, if any, to sign a "copyright disclaimer" for the program, if 332 necessary. Here is a sample; alter the names: 333 334 Yoyodyne, Inc., hereby disclaims all copyright interest in the program 335 `Gnomovision' (which makes passes at compilers) written by James Hacker. 336 337 <signature of Ty Coon>, 1 April 1989 338 Ty Coon, President of Vice 339 340 This General Public License does not permit incorporating your program into 341 proprietary programs. If your program is a subroutine library, you may 342 consider it more useful to permit linking proprietary applications with the 343 library. If this is what you want to do, use the GNU Library General 344 Public License instead of this License. -
branches/3.1/mondo/bootstrap
r2239 r3147 26 26 fi 27 27 28 autoscan 28 29 make maintainer-clean >/dev/null 2>&1 29 30 libtoolize -f -c --automake … … 31 32 autoheader 32 33 automake --add-missing --copy 33 autoconf 34 autoconf -W all 34 35 rm -rf autom4te.cache -
branches/3.1/mondo/configure.in
r2603 r3147 10 10 define(MONDO_REV,m4_normalize(rPBREV))) 11 11 define(MONDO_TAG,MONDO_VER-MONDO_REV) 12 AC_INIT([Mondo Rescue], MONDO_TAG,[mondo-devel@lists.sourceforge.net])12 AC_INIT([Mondo Rescue],[MONDO_TAG],[mondo-devel@lists.sourceforge.net]) 13 13 AC_CONFIG_SRCDIR([src/mondoarchive/mondoarchive.c]) 14 14 AC_CONFIG_MACRO_DIR([m4]) 15 A M_CONFIG_HEADER(config.h)15 AC_CONFIG_HEADERS([config.h]) 16 16 17 AC_PREREQ([2.68]) 17 18 AC_CANONICAL_HOST 18 19 AC_CANONICAL_TARGET … … 20 21 21 22 AM_INIT_AUTOMAKE([mondo], MONDO_VER) 22 AM_MAINTAINER_MODE23 24 23 LT_INIT 25 24 … … 27 26 AC_PROG_AWK 28 27 AC_PROG_CC 29 #AC_PROG_RANLIB30 28 AC_PROG_LIBTOOL 31 29 AC_PROG_CPP … … 120 118 AC_HEADER_STDC 121 119 AC_HEADER_SYS_WAIT 122 AC_CHECK_HEADERS([fcntl.h stddef.h stdlib.h string.h sys/ioctl.h sys/param.h sys/time.h unistd.h]) 120 AC_HEADER_STDBOOL 121 AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h locale.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h unistd.h utime.h]) 123 122 124 123 # Checks for typedefs, structures, and compiler characteristics. 125 124 AC_C_CONST 125 AC_C_INLINE 126 AC_PROG_GCC_TRADITIONAL 127 AC_TYPE_MODE_T 126 128 AC_TYPE_OFF_T 127 129 AC_TYPE_PID_T 130 AC_TYPE_SIZE_T 131 AC_TYPE_SSIZE_T 132 AC_STRUCT_ST_BLOCKS 128 133 129 134 # Checks for library functions. 130 135 AC_FUNC_CHOWN 131 136 AC_FUNC_FORK 132 AC_ PROG_GCC_TRADITIONAL137 AC_FUNC_FSEEKO 133 138 AC_FUNC_LSTAT 134 139 AC_FUNC_MALLOC 135 AC_TYPE_SIGNAL136 140 AC_FUNC_VPRINTF 137 AC_CHECK_FUNCS([bzero getcwd memmove memset mkdir mkfifo getopt setenv strcasecmp strchr strerror strrchr strstr mkdtemp])141 AC_CHECK_FUNCS([bzero getcwd gethostbyname inet_ntoa memmove memset mkdir mkdtemp mkfifo getopt setenv strcasecmp strcspn strchr strdup strerror strncasecmp strrchr strspn strstr uname utime]) 138 142 139 AC_OUTPUT([Makefile src/Makefile src/lib/Makefile src/common/Makefile src/mondoarchive/Makefile src/mondorestore/Makefile src/restore-scripts/Makefile src/restore-scripts/mondo/Makefile src/post-nuke.sample/Makefile src/post-nuke.sample/usr/Makefile src/post-nuke.sample/usr/bin/Makefile test/Makefile deplist.d/Makefile]) 143 AC_CONFIG_FILES([Makefile src/Makefile src/lib/Makefile src/common/Makefile src/mondoarchive/Makefile src/mondorestore/Makefile src/restore-scripts/Makefile src/restore-scripts/mondo/Makefile src/post-nuke.sample/Makefile src/post-nuke.sample/usr/Makefile src/post-nuke.sample/usr/bin/Makefile test/Makefile deplist.d/Makefile]) 144 AC_OUTPUT -
branches/3.1/mondo/src/common/libmondo-archive.c
r2937 r3147 213 213 paranoid_free(tmp); 214 214 215 mr_asprintf(command, "star H=exustar list=%s -c " STAR_ACL_SZ " file=%s", filelist, fname);215 mr_asprintf(command, "star H=exustar list=%s -c -sparse " STAR_ACL_SZ " file=%s", filelist, fname); 216 216 if (bkpinfo->use_lzo) { 217 217 mr_free(command); … … 511 511 char *use_star_sz = NULL; 512 512 char *bootldr_str = NULL; 513 char *bootldr_ver = NULL; 513 514 char *tape_device = NULL; 514 515 char *broken_bios_sz = NULL; … … 682 683 run_program_and_log_output("ln -sf /boot/grub/grub.conf /boot/grub/menu.lst", 5); 683 684 } 684 if ((!does_file_exist("/boot/grub/menu.lst")) && (!does_file_exist("/boot/grub/grub.cfg"))) { 685 fatal_error("The de facto standard location for your boot loader's config file is /boot/grub/menu.lst or /boot/grub/grub.cfg but I cannot find it there. What is wrong with your Linux distribution?"); 686 } 685 if ((!does_file_exist("/boot/grub/menu.lst")) && (!does_file_exist("/boot/grub/grub.cfg")) && (!does_file_exist("/boot/grub2/grub.cfg"))) { 686 fatal_error("The de facto standard location for your boot loader's config file is /boot/grub/menu.lst, /boot/grub/grub.cfg, or /boot/grub2/grub.cfg but I cannot find it there. What is wrong with your Linux distribution?"); 687 } 688 mr_asprintf(&bootldr_ver, "%s", call_program_and_get_last_line_of_output("grub --version")); 687 689 } else if (bkpinfo->boot_loader == 'E') { 688 690 mr_asprintf(bootldr_str, "ELILO"); … … 719 721 } 720 722 log_to_screen("Your boot loader is %s and it boots from %s", bootldr_str, bkpinfo->boot_device); 723 if (bootldr_ver != NULL) { 724 mr_asprintf(&tmp, "Boot loader version string: %s", bootldr_ver); 725 log_to_screen(tmp); 726 mr_free(tmp); 727 } 721 728 722 729 mr_asprintf(tmp, "%s/BOOTLOADER.DEVICE", bkpinfo->tmpdir); … … 927 934 char *curr_acl_list_fname = NULL; 928 935 929 struct s_bkpinfo *bkpinfo_bis;930 936 char *tmp = NULL; 931 937 int res = 0, retval = 0; … … 940 946 p_next_set_to_archive = (int *) (inbuf + 8); 941 947 p_list_of_fileset_flags = (char *) (inbuf + 12); 942 bkpinfo_bis = (struct s_bkpinfo *) (inbuf + BKPINFO_LOC_OFFSET);943 948 944 949 mr_asprintf(archiving_filelist_fname, FILELIST_FNAME_RAW_SZ, bkpinfo->tmpdir, 0L); … … 1474 1479 1475 1480 log_msg(2, "make_usb_fs --- scratchdir=%s", bkpinfo->scratchdir); 1476 (void)getcwd(old_pwd, MAX_STR_LEN - 1);1481 tmp1 = getcwd(old_pwd, MAX_STR_LEN - 1); 1477 1482 mr_asprintf(tmp, "chmod 700 %s", bkpinfo->scratchdir); 1478 1483 run_program_and_log_output(tmp, FALSE); 1479 1484 mr_free(tmp); 1480 (void)chdir(bkpinfo->scratchdir); 1485 if (chdir(bkpinfo->scratchdir)) { 1486 // FIXME 1487 } 1481 1488 1482 1489 mds = media_descriptor_string(bkpinfo->backup_media_type); … … 1542 1549 } 1543 1550 1544 (void)chdir(old_pwd); 1551 if (chdir(old_pwd)) { 1552 // FIXME 1553 } 1545 1554 if (retval) { 1546 1555 log_msg(1, "WARNING - make_usb_fs returned an error"); … … 1599 1608 1600 1609 log_msg(2, "make_iso_fs --- scratchdir=%s --- destfile=%s", bkpinfo->scratchdir, destfile); 1601 (void)getcwd(old_pwd, MAX_STR_LEN - 1);1610 tmp2 = getcwd(old_pwd, MAX_STR_LEN - 1); 1602 1611 mr_asprintf(tmp, "chmod 700 %s", bkpinfo->scratchdir); 1603 1612 run_program_and_log_output(tmp, FALSE); 1604 1613 mr_free(tmp); 1605 1614 1606 chdir(bkpinfo->scratchdir); 1615 if (chdir(bkpinfo->scratchdir)) { 1616 // FIXME 1617 } 1607 1618 1608 1619 if (bkpinfo->call_before_iso) { … … 1813 1824 } 1814 1825 1815 chdir(old_pwd); 1826 if (chdir(old_pwd)) { 1827 // FIXME 1828 } 1816 1829 if (retval) { 1817 1830 log_msg(1, "WARNING - make_iso_fs returned an error"); … … 1866 1879 /*@ pointers ******************************************* */ 1867 1880 FILE *fin = NULL; 1881 char *q; 1868 1882 1869 1883 /*@ buffers ******************************************** */ … … 2411 2425 /*@ long long ****************************************************** */ 2412 2426 off_t length_of_incoming_file = (off_t)0; 2413 t_archtype type;2414 2427 va_list ap; 2415 2428 … … 2433 2446 write_header_block_to_stream(length_of_incoming_file, curr_file, 2434 2447 start_chr); 2435 if (strstr(curr_file, ".afio.") || strstr(curr_file, ".star.")) {2436 type = fileset;2437 } else if (strstr(curr_file, "slice")) {2438 type = biggieslice;2439 } else {2440 type = other;2441 }2442 2448 res = write_file_to_stream_from_file(curr_file); 2443 2449 retval += res; … … 2798 2804 mr_free(tmp); 2799 2805 2800 (void) fwrite((void *) &biggiestruct, 1, sizeof(biggiestruct), fout); 2801 fclose(fout); 2802 2806 res = fwrite((void *) &biggiestruct, 1, sizeof(biggiestruct), fout); 2807 if (fout != NULL) { 2808 paranoid_fclose(fout); 2809 } 2803 2810 log_msg(1, "Opening in %s; slicing it and writing to CD/tape", file_to_openin); 2804 2811 if (!(fin = fopen(file_to_openin, "r"))) { … … 2839 2846 if (blksize > 0) { 2840 2847 totalread = totalread + blksize; 2841 (void)fwrite(tempblock, 1, blksize, fout);2848 res = fwrite(tempblock, 1, blksize, fout); 2842 2849 } else { 2843 2850 break; … … 3131 3138 log_to_screen("Please reboot from the 1st %s in Compare Mode, as a precaution.", mds); 3132 3139 mr_free(mds); 3133 chdir("/"); 3140 if (chdir("/")) { 3141 // FIXME 3142 } 3134 3143 log_it("Before calling verification of image()"); 3135 3144 if (bkpinfo->backup_media_type == usb) { … … 3209 3218 assert(bkpinfo != NULL); 3210 3219 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 3211 chdir("/"); 3220 if (chdir("/")) { 3221 // FIXME 3222 } 3212 3223 mvaddstr_and_log_it(g_currentY, 0, 3213 3224 "Verifying archives against live filesystem"); … … 3232 3243 bkpinfo->media_device = find_cdrom_device(FALSE); // replace 0,0,0 with /dev/cdrom 3233 3244 } 3234 chdir("/"); 3245 if (chdir("/")) { 3246 // FIXME 3247 } 3235 3248 for (cdno = 1; cdno < 99 && bkpinfo->verify_data; cdno++) { 3236 3249 if (cdno != g_current_media_number) { … … 3253 3266 } 3254 3267 mr_asprintf(tmp, "grep 'afio: ' %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> %s/changed.files", MONDO_LOGFILE, MONDO_CACHE); 3255 (void)system(tmp);3268 res = system(tmp); 3256 3269 mr_free(tmp); 3257 3270 3258 3271 mr_asprintf(tmp, "grep 'star: ' %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s/changed.files", MONDO_LOGFILE, MONDO_CACHE); 3259 (void)system(tmp);3272 res = system(tmp); 3260 3273 mr_free(tmp); 3261 3274 run_program_and_log_output("umount " MNT_CDROM, FALSE); -
branches/3.1/mondo/src/common/libmondo-cli.c
r2937 r3147 20 20 extern int g_loglevel; 21 21 extern bool g_text_mode; 22 extern bool g_fail_immediately; 22 23 extern char g_startdir[MAX_STR_LEN]; ///< ????? @bug ????? 23 24 extern char *MONDO_OPTIONS; … … 53 54 54 55 extern void free_MR_global_filenames(void); 56 57 long g_max_biggie_size = BIGGIEMAXSIZE; 55 58 56 59 /** … … 101 104 mr_free(tmp); 102 105 106 /* Before erasing dirs go into a safe place */ 107 if (chdir("/tmp")) { 108 // FIXME 109 } 110 mr_asprintf(tmp, "rm -Rf %s/tmp.mondo.*", bkpinfo->tmpdir); 111 paranoid_system(tmp); 112 mr_free(tmp); 113 103 114 mr_asprintf(tmp, "mkdir -p %s", bkpinfo->scratchdir); 104 115 paranoid_system(tmp); … … 162 173 int i = 0; 163 174 int retval = 0; 164 int percent = 0;165 int lastpos = 0;166 175 167 176 /*@ buffers ** */ … … 355 364 mr_free(p); 356 365 log_to_screen("You didn't specify a tape streamer device. I'm assuming %s", flag_val['d']); 357 percent = 0;358 366 } 359 367 … … 498 506 if (strstr(bkpinfo->netfs_proto, "sshfs")) { 499 507 mr_asprintf(tmp1, "sshfs %s@%s", bkpinfo->netfs_user, bkpinfo->netfs_mount); 508 } else if (strstr(bkpinfo->netfs_proto, "smbfs")) { 509 sprintf(tmp, "mount -t cifs %s -o user=%s", bkpinfo->netfs_mount, bkpinfo->netfs_user); 500 510 } else if (strstr(bkpinfo->netfs_proto, "nfs")) { 501 511 mr_asprintf(tmp1, "mount %s@%s", bkpinfo->netfs_user, bkpinfo->netfs_mount); … … 507 517 if (strstr(bkpinfo->netfs_proto, "sshfs")) { 508 518 mr_asprintf(tmp1, "sshfs %s", bkpinfo->netfs_mount); 519 } else if (strstr(bkpinfo->netfs_proto, "smbfs")) { 520 sprintf(tmp, "mount -t cifs %s", bkpinfo->netfs_mount); 509 521 } else if (strstr(bkpinfo->netfs_proto, "nfs")) { 510 522 mr_asprintf(tmp1, "mount %s", bkpinfo->netfs_mount); … … 629 641 } 630 642 mr_free(tmp1); 631 lastpos = 0;632 643 633 644 mr_make_devlist_from_pathlist(flag_val['E'], 'E'); … … 637 648 if (flag_set['e']) { 638 649 bkpinfo->please_dont_eject = TRUE; 650 } 651 652 if (flag_set['M']) { 653 g_max_biggie_size = atol(flag_val['M']); 654 log_msg(1, "Max size for biggie file is now %ld KB", g_max_biggie_size); 639 655 } 640 656 … … 778 794 /* Before changing remove old ones if any */ 779 795 if (bkpinfo->scratchdir) { 780 chdir("/tmp"); 796 if (chdir("/tmp")) { 797 // FIXME 798 } 781 799 mr_asprintf(tmp1, "rm -Rf %s", bkpinfo->scratchdir); 782 800 paranoid_system(tmp1); … … 859 877 log_to_screen("Please install LZOP. You can't use '-L' until you do.\n"); 860 878 } 879 } 880 881 if (flag_set['F']) { 882 log_msg(3, "-F means we will fail immediately at the first interaction request"); 883 g_fail_immediately = TRUE; 861 884 } 862 885 -
branches/3.1/mondo/src/common/libmondo-devices.c
r2937 r3147 331 331 char *searchstr = NULL; 332 332 char *tmp = NULL; 333 char *p; 333 334 334 335 /*@ ints ******************************************************* */ … … 816 817 } 817 818 818 mr_asprintf(command, "%s -scanbus | grep \"[0-9],[0-9],[0-9]\" | grep \"[D|C][V|D]\" | grep -n \"\" | grep \"%s\" | cut -d':' -f2", cdr_exe, g_cdrw_drive_is_here);819 mr_asprintf(command, "%s -scanbus | grep \"[0-9],[0-9],[0-9]\" | grep -E \"[D|C][V|D]\" | grep -n \"\" | grep \"%s\" | cut -d':' -f2", cdr_exe, g_cdrw_drive_is_here); 819 820 mr_free(cdr_exe); 820 821 … … 848 849 } 849 850 850 tmp = call_program_and_get_last_line_of_output("dvdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\"| grep -E '[D|C][V|D]' | cut -d':' -f1",TRUE);851 tmp = call_program_and_get_last_line_of_output("dvdrecord -scanbus 2> /dev/null | grep -E '\)\ \'' | grep -n '' | grep -E '[D|C][V|D]' | cut -d':' -f1",TRUE); 851 852 log_msg(5, "tmp = '%s'", tmp); 852 853 if (!tmp[0]) 853 854 mr_free(tmp); 854 tmp = call_program_and_get_last_line_of_output("cdrecord -scanbus 2> /dev/null | grep \ ") '\" | grep -n \"\"| grep -E '[D|C][V|D]' | cut -d':' -f1",TRUE);855 tmp = call_program_and_get_last_line_of_output("cdrecord -scanbus 2> /dev/null | grep \)\ \' | grep -n '' | grep -E '[D|C][V|D]' | cut -d':' -f1",TRUE); 855 856 if (tmp[0]) { 856 857 devno = atoi(tmp) - 1; … … 886 887 #if linux 887 888 unsigned long long s = 0; 888 int fileid, cylinders = 0 , cylindersleft = 0;889 int fileid, cylinders = 0; 889 890 int cylindersize = 0; 890 891 int gotgeo = 0; … … 935 936 if (ioctl(fileid, HDIO_GETGEO, &hdgeo) != -1) { 936 937 if (hdgeo.cylinders && hdgeo.heads && hdgeo.sectors) { 937 cylindersleft = cylinders = hdgeo.cylinders;938 938 cylindersize = hdgeo.heads * hdgeo.sectors / 2; 939 939 outvalA = cylindersize * cylinders / 1024; … … 983 983 char *command = NULL; 984 984 char *format_sz = NULL; 985 char *p; 985 986 986 987 FILE *pin; … … 1822 1823 1823 1824 /* Check for LVM */ 1824 mr_asprintf(command, "pvdisplay -c %s | grep '%s:' 2> /dev/null", partitions[i], partitions[i]);1825 mr_asprintf(command, "pvdisplay -c %s 2> /dev/null", partitions[i]); 1825 1826 log_msg(5, " Running: %s", command); 1826 1827 tmp = call_program_and_get_last_line_of_output(command,TRUE); … … 2638 2639 char *p = NULL; 2639 2640 char *q = NULL; 2641 char *tmpro = NULL; 2642 char *tmp1 = NULL; 2640 2643 char *mds = NULL; 2641 2644 char *sz_size = NULL; … … 2873 2876 bkpinfo->media_size[i] = bkpinfo->media_size[0]; 2874 2877 } 2878 bkpinfo->use_obdr = ask_me_yes_or_no 2879 ("Do you want to activate OBDR support for your tapes ?"); 2880 if (bkpinfo->use_obdr) { 2881 log_msg(4, "obdr mode = TRUE"); 2882 } else { 2883 log_msg(4, "obdr mode = FALSE"); 2884 } 2875 2885 if (archiving_to_media) { 2876 2886 if ((compression_type = which_compression_type()) == NULL) { … … 2968 2978 if (bkpinfo->disaster_recovery) { 2969 2979 mr_asprintf(command ,"umount %s/isodir 2> /dev/null", bkpinfo->tmpdir); 2970 (void)system(command);2980 paranoid_system(command); 2971 2981 mr_free(command); 2972 2982 2973 2983 } 2974 p = popup_and_get_string("Network protocol", "Which Network protocol should I use?", bkpinfo->netfs_proto); 2984 <<<<<<< .courant 2985 p = popup_and_get_string("Network protocol", "Which Network protocol should I use (nfs/sshfs/smbfs) ?", bkpinfo->netfs_proto); 2975 2986 if (p == NULL) { 2976 2987 log_to_screen("User has chosen not to backup the PC"); … … 3016 3027 3017 3028 if (bkpinfo->restore_data) { 3029 /* mount th FS read-only in restore mode to avoid any erase of whatever */ 3030 mr_asprintf(tmpro, "-o ro"); 3031 } else { 3032 mr_asprintf(tmpro, ""); 3033 } 3034 3035 /* Build the mount string */ 3036 if (strstr(bkpinfo->netfs_proto, "smbfs")) { 3037 mr_asprintf(tmp, "mount -t cifs %s %s %s",bkpinfo->netfs_mount, bkpinfo->isodir,tmpro); 3038 if (bkpinfo->netfs_user) { 3039 mr_strcat(tmp, " -o user=%s", bkpinfo->netfs_user); 3040 } 3041 else { 3018 3042 if (strstr(bkpinfo->netfs_proto, "sshfs")) { 3019 mr_asprintf(tmp, "sshfs -o ro");3043 mr_asprintf(tmp, "sshfs %s ",tmpro); 3020 3044 } else { 3021 mr_asprintf(tmp, "mount -t %s -o nolock ,ro", bkpinfo->netfs_proto);3045 mr_asprintf(tmp, "mount -t %s -o nolock %s ", bkpinfo->netfs_proto,tmpro); 3022 3046 } 3023 } else { 3024 if (strstr(bkpinfo->netfs_proto, "sshfs")) { 3025 mr_asprintf(tmp, "sshfs"); 3026 } else { 3027 mr_asprintf(tmp, "mount -t %s -o nolock", bkpinfo->netfs_proto); 3047 if (bkpinfo->netfs_user) { 3048 mr_strcat(tmp, "%s@", bkpinfo->netfs_user); 3028 3049 } 3029 } 3030 if (bkpinfo->netfs_user) { 3031 mr_strcat(tmp, "%s@", bkpinfo->netfs_user); 3032 } 3033 mr_strcat(tmp, "%s %s", bkpinfo->netfs_mount, bkpinfo->isodir); 3050 mr_strcat(tmp, "%s %s", bkpinfo->netfs_mount, bkpinfo->isodir); 3051 } 3034 3052 run_program_and_log_output(tmp, 3); 3035 3053 mr_free(tmp); … … 3037 3055 malloc_string(g_selfmounted_isodir); 3038 3056 strcpy(g_selfmounted_isodir, bkpinfo->isodir); 3057 } 3039 3058 } 3040 3059 if (!is_this_device_mounted(bkpinfo->netfs_mount)) { … … 3193 3212 } 3194 3213 3195 3196 3214 p = popup_and_get_string("Exclude paths", "Please enter paths which you do NOT want to backup. Separate them with '|'. NB: /tmp and /proc are always excluded. :-) Just hit 'Enter' if you want to do a full system backup.", bkpinfo->exclude_paths); 3197 3215 if (p == NULL) { -
branches/3.1/mondo/src/common/libmondo-filelist.c
r2937 r3147 30 30 31 31 extern char *MONDO_LOGFILE; 32 33 extern long g_max_biggie_size; 32 34 33 35 /* Reference to global bkpinfo */ … … 195 197 /*@ long ****************************************/ 196 198 long lino = 0; 197 long max_sane_size_for_a_file;199 // A big file has more than 64 MB of real content 198 200 long curr_set_size; 199 201 long noof_lines; … … 221 223 assert_string_is_neither_NULL_nor_zerolength(filelist); 222 224 assert(maxsetsizeK > 0); 223 224 max_sane_size_for_a_file = 64L * 1024L;225 // max_sane_size_for_a_file = maxsetsizeK*2;226 // if (max_sane_size_for_a_file > 32*1024)227 // { max_sane_size_for_a_file = 32*1024; }228 225 229 226 log_it("filelist=%s;", filelist); … … 269 266 siz = 0; 270 267 } else { 271 siz = (long) (buf.st_size >> 10); 272 } 273 if (siz > max_sane_size_for_a_file) { 274 log_msg(10, "Adding %s to big files\n", incoming); 268 // blocks are 512 bytes long - cf man 2 stat - Pass to the previous unit (MB => kB e.g.) 269 // use blocks instead of size to allow sparse file correct handling as much as possible 270 siz = (long) ((buf.st_blocks*512) >> 10); 271 } 272 if (siz > g_max_biggie_size) { 273 log_msg(10, "Adding %s to big files (size = %ld)\n", incoming, siz); 275 274 fprintf(fbig, "%s\n", incoming); 276 275 } else { 277 276 curr_set_size += siz; 278 log_msg(10, "Adding %s to filelist %d \n", incoming, curr_set_no);277 log_msg(10, "Adding %s to filelist %d (size = %ld)\n", incoming, curr_set_no, siz); 279 278 fprintf(fout, "%s\n", incoming); 280 279 if (curr_set_size > maxsetsizeK) { … … 400 399 char *tmp = NULL; 401 400 401 char *p; 402 402 403 pattr = popen(syscall, "r"); 403 404 if (!pattr) { … … 431 432 char *strtmp = NULL; 432 433 char *tmp = NULL; 434 char *p = NULL; 433 435 int i; 434 436 … … 517 519 int retval = 0; 518 520 int i; 519 char *p, *q ;521 char *p, *q, *r; 520 522 char *tmp = NULL; 521 523 FILE *pin, *pout, *faclin; … … 1323 1325 char *skip_these = NULL; 1324 1326 char *new_with_pipe; 1325 char *strtmp ;1326 char *token ;1327 char *strtmp = NULL; 1328 char *token = NULL; 1327 1329 char *find_excludes = NULL; 1328 1330 char *name_of_evalcall_form = NULL; … … 1374 1376 1375 1377 log_msg(5, "find command = %s", strtmp); 1376 (void)system(strtmp);1378 paranoid_system(strtmp); 1377 1379 mr_free(strtmp); 1378 1380 … … 1510 1512 char *sz_filelist; 1511 1513 char *exclude_paths = NULL; 1512 int i;1513 1514 FILE *fout; 1514 1515 char *command = NULL; … … 1597 1598 fatal_error("Cannot openout to sz_filelist"); 1598 1599 } 1599 i = 0;1600 1600 if ((!include_paths) || (strlen(include_paths) == 0)) { 1601 1601 log_msg(1, "Including only '/' in %s", sz_filelist); … … 1697 1697 { 1698 1698 /*@ int ******************************************************** */ 1699 int noof_chars;1700 1699 static int depth = 0; 1701 1700 static char original_string[MAX_STR_LEN]; … … 1715 1714 assert(startnode != NULL); 1716 1715 assert(string_to_find != NULL); 1717 1718 noof_chars = strlen(string_to_find) + 1; /* we include the '\0' */1719 1716 1720 1717 log_msg(7, "starting --- str=%s", string_to_find); -
branches/3.1/mondo/src/common/libmondo-files.c
r2937 r3147 51 51 /*@ pointers **************************************************** */ 52 52 char *p = NULL; 53 char *q; 53 54 FILE *fin; 54 55 … … 126 127 char *command = NULL; 127 128 char *incoming = NULL; 129 char *q; 128 130 129 131 /*@ long ******************************************************** */ … … 204 206 char *tmp = NULL; 205 207 char *incoming = NULL; 208 char *q; 206 209 207 210 /*@ int ********************************************************* */ … … 471 474 char *output = NULL; 472 475 char *command = NULL; 476 char *p = NULL; 473 477 474 478 /*@ pointers **************************************************** */ … … 540 544 char *curr_cksum = NULL; 541 545 char *tmp = NULL; 546 char *q; 542 547 543 548 /*@ long [long] ************************************************* */ … … 679 684 /*@ buffers **************************************************** */ 680 685 char *incoming = NULL; 686 char *p = NULL; 681 687 682 688 /*@ end vars *************************************************** */ … … 743 749 char *tmp = NULL; 744 750 char *command = NULL; 751 char *comment; 745 752 746 753 /*@ long ******************************************************** */ … … 972 979 return (1); 973 980 } 974 fscanf(fin, "%s\n", contents);981 res = fscanf(fin, "%s\n", contents); 975 982 i = strlen(contents); 976 983 if (i > 0 && contents[i - 1] < 32) { … … 978 985 } 979 986 paranoid_fclose(fin); 987 res = 0; 980 988 return (res); 981 989 } … … 1020 1028 if (res) { 1021 1029 fatal_error("Failed to copy Mondo's stuff to scratchdir"); 1030 } 1031 1032 mr_asprintf(command, "cp -f %s/LAST-FILELIST-NUMBER %s", bkpinfo->tmpdir, bkpinfo->scratchdir); 1033 1034 if (run_program_and_log_output(command, FALSE)) { 1035 fatal_error("Failed to copy LAST-FILELIST-NUMBER to scratchdir"); 1022 1036 } 1023 1037 -
branches/3.1/mondo/src/common/libmondo-fork.c
r2937 r3147 42 42 char *newcall = NULL; 43 43 char *tmp = NULL; 44 char *p; 44 45 45 46 /*@ pointers **************************************************** */ … … 258 259 FILE *fin; 259 260 char *p; 261 char *q; 260 262 261 263 /*@ end vars *************************************************** */ … … 300 302 fin = fopen(tmp1, "r"); 301 303 if (fin) { 302 for ( fgets(incoming, MAX_STR_LEN, fin); !feof(fin);fgets(incoming, MAX_STR_LEN, fin)) {304 for (q = fgets(incoming, MAX_STR_LEN, fin); !feof(fin) && (q != NULL); q = fgets(incoming, MAX_STR_LEN, fin)) { 303 305 p = incoming; 304 306 while (p && *p) { … … 545 547 log_msg(1, "bytes_read_in = %ld", bytes_read_in); 546 548 547 fwrite(tmp1, 1, bytes_read_in, ftmp); 548 fread(tmp1, 1, tmpcap, fin); 549 log_msg(0, "tmp1 = '%s'", tmp1); 550 fwrite(tmp1, 1, tmpcap, ftmp); 549 if (fwrite(tmp, 1, bytes_read_in, ftmp)) { 550 fatal_error("Can't fwrite here"); 551 } 552 553 sprintf(tmp, "I am here - %lld", (long long)ftello(fin)); 554 if (fread(tmp, 1, tmpcap, fin)) { 555 fatal_error("Can't fread here"); 556 } 557 log_msg(0, "tmp = '%s'", tmp); 558 if (fwrite(tmp, 1, tmpcap, ftmp)) { 559 fatal_error("Can't fwrite there"); 560 } 551 561 fclose(ftmp); 552 562 mr_free(tmp1); -
branches/3.1/mondo/src/common/libmondo-mountlist.c
r2937 r3147 50 50 int pos = 0, npos = 0; 51 51 int res = 0; 52 int mountpoint_copies = 0;53 52 int device_copies = 0; 54 53 int i = 0; … … 112 111 } 113 112 /* does partition /dev/adXsYZ exist more than once in the mountlist? */ 114 for (i = 0, mountpoint_copies = 0,device_copies = 0;113 for (i = 0, device_copies = 0; 115 114 i < mountlist->entries; i++) { 116 115 if (!strcmp(device, mountlist->el[i].device)) { … … 214 213 } 215 214 /* does partition /dev/adXsY exist more than once in the mountlist? */ 216 for (i = 0, mountpoint_copies = 0,device_copies = 0;215 for (i = 0, device_copies = 0; 217 216 i < mountlist->entries; i++) { 218 217 if (!strcmp(device, mountlist->el[i].device)) { … … 277 276 } 278 277 /* does partition /dev/adXsYZ exist more than once in the mountlist? */ 279 for (i = 0, mountpoint_copies = 0,device_copies = 0;278 for (i = 0, device_copies = 0; 280 279 i < mountlist->entries; i++) { 281 280 if (!strcmp(device, mountlist->el[i].device)) { … … 384 383 int pos = 0; 385 384 int res = 0; 386 int mountpoint_copies = 0;387 385 int device_copies = 0; 388 386 int i = 0; … … 461 459 462 460 /* does partition /dev/hdNX exist more than once in the mountlist? */ 463 for (i = 0, mountpoint_copies = 0,device_copies = 0;461 for (i = 0, device_copies = 0; 464 462 i < mountlist->entries; i++) { 465 463 if (!strcmp(device, mountlist->el[i].device)) { … … 807 805 char *tmp = NULL; 808 806 char *p = NULL; 807 char *q = NULL; 809 808 810 809 int items = 0; … … 926 925 } 927 926 paranoid_fclose(fout); 927 if (!(fout = fopen(MONDO_MNTLISTCHG, "w"))) { 928 log_OS_error("WMTD - Cannot openout "MONDO_MNTLISTCHG); 929 return (1); 930 } 931 fprintf(fout, "the mountlist was changed by mondorestore\n"); 932 paranoid_fclose(fout); 928 933 return (0); 929 934 } -
branches/3.1/mondo/src/common/libmondo-raid-EXT.h
r558 r3147 53 53 #endif 54 54 55 extern int parse_mdstat( struct raidlist_itself *raidlist, char *device_prefix);56 extern int create_raidtab_from_mdstat(char * raidtab_fname);55 extern int parse_mdstat(char *mdstat_fname, struct raidlist_itself *raidlist, char *device_prefix); 56 extern int create_raidtab_from_mdstat(char *mdstat_fname, char *raidtab_fname); -
branches/3.1/mondo/src/common/libmondo-raid.c
r2937 r3147 15 15 #include "libmondo-tools-EXT.h" 16 16 #include "libmondo-string-EXT.h" 17 #include "libmondo-fork-EXT.h" 17 18 #include "lib-common-externs.h" 18 19 #include "libmondo-raid.h" … … 429 430 char *incoming = NULL; 430 431 char *p; 432 char *q; 431 433 432 434 assert(fin != NULL); … … 604 606 return (1); 605 607 } 608 malloc_string(label); 609 malloc_string(value); 606 610 items = 0; 607 611 log_it("Loading raidtab..."); … … 615 619 strcpy(raidlist->el[items].additional_vars.el[v].label, label); 616 620 strcpy(raidlist->el[items].additional_vars.el[v].value, value); 621 log_msg(2,"Found raidtab entry Label: %s Value: %s",raidlist->el[items].additional_vars.el[v].label,raidlist->el[items].additional_vars.el[v].value); 617 622 v++; 618 623 mr_free(label); … … 690 695 raidrec->raid_level = atoi(value); 691 696 } 697 log_msg(4,"Found raid level %d",raidrec->raid_level); 692 698 } else if (!strcmp(label, "nr-raid-disks")) { /* ignore it */ 693 699 } else if (!strcmp(label, "nr-spare-disks")) { /* ignore it */ … … 710 716 log_msg(1, "Unknown RAID parity algorithm '%s'\n.", value); 711 717 } 718 log_msg(4,"Found raid parity %d",raidrec->parity); 712 719 } else if (!strcmp(label, "device")) { 713 720 get_next_raidtab_line(fin, &labelB, &valueB); … … 735 742 strcpy(raidrec->additional_vars.el[v].label, label); 736 743 strcpy(raidrec->additional_vars.el[v].value, value); 737 raidrec->additional_vars.entries = ++v; 744 log_msg(4,"Found additional raid pair #%d: %s / %s",v,raidrec->additional_vars.el[v].label,raidrec->additional_vars.el[v].value); 745 v++; 746 raidrec->additional_vars.entries = v; 738 747 } 739 748 } … … 950 959 951 960 952 int parse_mdstat(struct raidlist_itself *raidlist, char *device_prefix) { 953 954 const char delims[] = " "; 955 956 FILE *fin; 957 int res = 0, row, i, index_min; 958 int lastpos = 0; 959 size_t len = 0; 960 char *token; 961 char *string = NULL; 962 char *pos; 963 char type; 964 char *strtmp; 961 int parse_mdstat(char *mdstat_fname, struct raidlist_itself *raidlist, char *device_prefix) { 962 963 const char delims[] = " "; 964 965 FILE *fin = NULL; 966 int res = 0, row, i, index_min; 967 int v = 0; 968 int lastpos = 0; 969 size_t len = 0; 970 char *token = NULL; 971 char *string = NULL; 972 char *cmd = NULL; 973 char *pos = NULL; 974 char type; 975 char *strtmp = NULL; 976 char *strtmp2 = NULL; 965 977 966 978 // open file … … 1044 1056 raidlist->el[raidlist->entries].raid_level = 10; 1045 1057 } else { 1046 log_msg(1, "Unknown RAID level '%s'.\n", token); 1047 paranoid_free(string); 1048 paranoid_free(token); 1049 return 1; 1050 } 1051 mr_free(token); 1058 switch (row) { 1059 case 1: // device information 1060 // check whether last line of record and if so skip 1061 log_msg(8, "This is the device line\n"); 1062 pos = strcasestr(string, "unused devices: "); 1063 if (pos != NULL) { 1064 break; 1065 } 1066 // tokenise string 1067 token = mr_strtok(string, delims, &lastpos); 1068 if (token == NULL) { 1069 // should not happen ! 1070 break; 1071 } 1072 // get RAID device name 1073 mr_asprintf(&strtmp,"%s%s", device_prefix, token); 1074 strncpy(raidlist->el[raidlist->entries].raid_device, strtmp, 63); 1075 raidlist->el[raidlist->entries].raid_device[63] = '\0'; 1076 mr_free(strtmp); 1077 mr_free(token); 1078 // store the UUID value in the additional_vars structure 1079 v = raidlist->el[raidlist->entries].additional_vars.entries; 1080 strcpy(raidlist->el[raidlist->entries].additional_vars.el[v].label, "UUID"); 1081 mr_asprintf(&cmd,"mdadm --detail %s | grep UUID | cut -d: -f2- | sed 's/^ *//'", raidlist->el[raidlist->entries].raid_device); 1082 mr_asprintf(&strtmp, "%s", call_program_and_get_last_line_of_output(cmd)); 1083 strcpy(raidlist->el[raidlist->entries].additional_vars.el[v].value, strtmp); 1084 mr_free(strtmp); 1085 v++; 1086 // store the Version value in the additional_vars structure 1087 strcpy(raidlist->el[raidlist->entries].additional_vars.el[v].label, "Version"); 1088 mr_asprintf(&cmd,"mdadm --detail %s | grep Version | cut -d: -f2- | sed 's/^ *//'", raidlist->el[raidlist->entries].raid_device); 1089 mr_asprintf(&strtmp, "%s", call_program_and_get_last_line_of_output(cmd)); 1090 strcpy(raidlist->el[raidlist->entries].additional_vars.el[v].value, strtmp); 1091 mr_free(strtmp); 1092 v++; 1093 raidlist->el[raidlist->entries].additional_vars.entries = v; 1094 // skip ':' and status 1095 token = mr_strtok (string, delims, &lastpos); 1096 if (token == NULL) { 1097 // should not happen ! 1098 break; 1099 } 1100 mr_free(token); 1101 token = mr_strtok (string, delims, &lastpos); 1102 if (token == NULL) { 1103 // should not happen ! 1104 break; 1105 } 1106 if (!strcmp(token, "inactive")) { 1107 log_msg(1, "RAID device '%s' inactive.\n", 1108 raidlist->el[raidlist->entries].raid_device); 1109 mr_free(string); 1110 mr_free(token); 1111 return 1; 1112 } 1113 mr_free(token); 1052 1114 1053 1115 // get RAID devices (type, index, device) … … 1097 1159 } 1098 1160 1161 // get RAID devices (type, index, device) 1162 // Note: parity disk for RAID4 is last normal disk, there is no '(P)' 1163 raidlist->el[raidlist->entries].data_disks.entries = 0; 1164 raidlist->el[raidlist->entries].spare_disks.entries = 0; 1165 raidlist->el[raidlist->entries].failed_disks.entries = 0; 1166 while((token = mr_strtok (string, delims, &lastpos))) { 1167 if ((pos = strstr(token, "("))) { 1168 type = *(pos+1); 1169 } else { 1170 type = ' '; 1171 } 1172 pos = strstr(token, "["); 1173 *pos = '\0'; 1174 switch(type) { 1175 case ' ': // normal data disks 1176 raidlist->el[raidlist->entries].data_disks.el[raidlist->el[raidlist->entries].data_disks.entries].index = atoi(pos + 1); 1177 mr_asprintf(&strtmp,"%s%s", device_prefix, token); 1178 strcpy(raidlist->el[raidlist->entries].data_disks.el[raidlist->el[raidlist->entries].data_disks.entries].device, strtmp); 1179 mr_free(strtmp); 1180 raidlist->el[raidlist->entries].data_disks.entries++; 1181 break; 1182 case 'S': // spare disks 1183 raidlist->el[raidlist->entries].spare_disks.el[raidlist->el[raidlist->entries].spare_disks.entries].index = atoi(pos + 1); 1184 mr_asprintf(&strtmp,"%s%s", device_prefix, token); 1185 strcpy(raidlist->el[raidlist->entries].spare_disks.el[raidlist->el[raidlist->entries].spare_disks.entries].device, strtmp); 1186 mr_free(strtmp); 1187 raidlist->el[raidlist->entries].spare_disks.entries++; 1188 break; 1189 case 'F': // failed disks 1190 raidlist->el[raidlist->entries].failed_disks.el[raidlist->el[raidlist->entries].failed_disks.entries].index = atoi(pos + 1); 1191 mr_asprintf(&strtmp,"%s%s", device_prefix, token); 1192 strcpy(raidlist->el[raidlist->entries].failed_disks.el[raidlist->el[raidlist->entries].failed_disks.entries].device, strtmp); 1193 mr_free(strtmp); 1194 raidlist->el[raidlist->entries].failed_disks.entries++; 1195 log_it("At least one failed disk found in RAID array.\n"); 1196 break; 1197 default: // error 1198 log_msg(1, "Unknown device type '%c'\n", type); 1199 mr_free(string); 1200 mr_free(token); 1201 return 1; 1202 break; 1203 } 1204 mr_free(token); 1205 } 1206 1099 1207 // adjust index for each device so that it starts with 0 for every type 1100 1208 index_min = 99; 1101 1209 for (i=0; i<raidlist->el[raidlist->entries].data_disks.entries;i++) { 1102 1103 1104 1210 if (raidlist->el[raidlist->entries].data_disks.el[i].index < index_min) { 1211 index_min = raidlist->el[raidlist->entries].data_disks.el[i].index; 1212 } 1105 1213 } 1106 1214 if (index_min > 0) { 1107 1108 1109 1215 for (i=0; i<raidlist->el[raidlist->entries].data_disks.entries;i++) { 1216 raidlist->el[raidlist->entries].data_disks.el[i].index = raidlist->el[raidlist->entries].data_disks.el[i].index - index_min; 1217 } 1110 1218 } 1111 1219 index_min = 99; 1112 1220 for (i=0; i<raidlist->el[raidlist->entries].spare_disks.entries;i++) { 1113 1114 1115 1221 if (raidlist->el[raidlist->entries].spare_disks.el[i].index < index_min) { 1222 index_min = raidlist->el[raidlist->entries].spare_disks.el[i].index; 1223 } 1116 1224 } 1117 1225 if (index_min > 0) { 1118 1119 1120 1226 for (i=0; i<raidlist->el[raidlist->entries].spare_disks.entries;i++) { 1227 raidlist->el[raidlist->entries].spare_disks.el[i].index = raidlist->el[raidlist->entries].spare_disks.el[i].index - index_min; 1228 } 1121 1229 } 1122 1230 index_min = 99; 1123 1231 for (i=0; i<raidlist->el[raidlist->entries].failed_disks.entries;i++) { 1124 1125 1126 1232 if (raidlist->el[raidlist->entries].failed_disks.el[i].index < index_min) { 1233 index_min = raidlist->el[raidlist->entries].failed_disks.el[i].index; 1234 } 1127 1235 } 1128 1236 if (index_min > 0) { 1129 1130 1131 1237 for (i=0; i<raidlist->el[raidlist->entries].failed_disks.entries;i++) { 1238 raidlist->el[raidlist->entries].failed_disks.el[i].index = raidlist->el[raidlist->entries].failed_disks.el[i].index - index_min; 1239 } 1132 1240 } 1133 1241 break; 1134 1242 case 2: // config information 1135 1243 // check for persistent super block 1136 1244 if (strcasestr(string, "super non-persistent")) { 1137 1138 } else {1139 1140 }1141 // extract chunk size1142 if (!(pos = strcasestr(string, "k chunk"))) {1143 1144 } else {1145 1146 1147 1148 1149 paranoid_free(string);1150 1151 1152 1153 1154 }1155 // extract parity if present1156 if ((pos = strcasestr(string, "algorithm"))) {1157 1158 } else {1159 1160 }1161 break;1162 1163 if (!(pos = strchr(string, '\%'))) {1164 1165 1166 1167 1168 1169 } else {1170 1171 1172 1173 1174 paranoid_free(string);1175 1176 1177 1178 1179 }1180 break;1181 1182 if (raidlist->el[raidlist->entries].progress != -1 &&1183 raidlist->el[raidlist->entries].progress != 999) {1184 log_msg(1, "Row %d should not occur in record!\n", row);1185 }1186 break;1187 1188 1189 1190 } 1191 // close file 1192 fclose(fin); 1193 // free string 1194 paranoid_free(string);1195 1196 1197 1198 } 1199 1200 1201 1202 1203 int create_raidtab_from_mdstat(char * raidtab_fname)1245 raidlist->el[raidlist->entries].persistent_superblock = 0; 1246 } else { 1247 raidlist->el[raidlist->entries].persistent_superblock = 1; 1248 } 1249 // extract chunk size 1250 if (!(pos = strcasestr(string, "k chunk"))) { 1251 raidlist->el[raidlist->entries].chunk_size = -1; 1252 } else { 1253 while (*pos != ' ') { 1254 pos -= 1; 1255 if (pos < string) { 1256 log_it("String underflow!\n"); 1257 mr_free(string); 1258 return 1; 1259 } 1260 } 1261 raidlist->el[raidlist->entries].chunk_size = atoi(pos + 1); 1262 } 1263 // extract parity if present 1264 if ((pos = strcasestr(string, "algorithm"))) { 1265 raidlist->el[raidlist->entries].parity = atoi(pos + 9); 1266 } else { 1267 raidlist->el[raidlist->entries].parity = -1; 1268 } 1269 break; 1270 case 3: // optional build status information 1271 if (!(pos = strchr(string, '\%'))) { 1272 if (strcasestr(string, "delayed")) { 1273 raidlist->el[raidlist->entries].progress = -1; // delayed (therefore, stuck at 0%) 1274 } else { 1275 raidlist->el[raidlist->entries].progress = 999; // not found 1276 } 1277 } else { 1278 while (*pos != ' ') { 1279 pos -= 1; 1280 if (pos < string) { 1281 printf("ERROR: String underflow!\n"); 1282 mr_free(string); 1283 return 1; 1284 } 1285 } 1286 raidlist->el[raidlist->entries].progress = atoi(pos); 1287 } 1288 break; 1289 default: // error or IN PROGRESS 1290 if (raidlist->el[raidlist->entries].progress != -1 && 1291 raidlist->el[raidlist->entries].progress != 999) { 1292 log_msg(1, "Row %d should not occur in record!\n", row); 1293 } 1294 break; 1295 } 1296 row++; 1297 } 1298 // free string 1299 mr_free(string); 1300 } 1301 // close file 1302 fclose(fin); 1303 // return success 1304 return 0; 1305 1306 } 1307 1308 1309 1310 1311 int create_raidtab_from_mdstat(char *mdstat_fname,char *raidtab_fname) 1204 1312 { 1205 1313 struct raidlist_itself *raidlist; … … 1209 1317 1210 1318 // FIXME: Prefix '/dev/' should really be dynamic! 1211 if (parse_mdstat( raidlist, "/dev/")) {1212 log_to_screen("Sorry, cannot read %s", MDSTAT_FILE);1319 if (parse_mdstat(mdstat_fname,raidlist, "/dev/")) { 1320 log_to_screen("Sorry, cannot read %s", mdstat_fname); 1213 1321 return (1); 1214 1322 } -
branches/3.1/mondo/src/common/libmondo-raid.h
r558 r3147 43 43 #endif 44 44 45 int create_raidtab_from_mdstat(char * raidtab_fname);46 int parse_mdstat( struct raidlist_itself *raidlist, char *device_prefix);45 int create_raidtab_from_mdstat(char *mdstat_fname, char *raidtab_fname); 46 int parse_mdstat(char *mdstat_fname, struct raidlist_itself *raidlist, char *device_prefix); -
branches/3.1/mondo/src/common/libmondo-stream.c
r2937 r3147 116 116 char *blk; 117 117 int i; 118 int j; 118 119 119 120 blk = (char *) malloc(256 * 1024); … … 131 132 } 132 133 for (i = 0; i < 8 && !feof(g_tape_stream); i++) { 133 (void) fread(blk, 1, 256 * 1024, g_tape_stream); 134 j = fread(blk, 1, 256 * 1024, g_tape_stream); 135 if (j) { 136 // FIXME 137 } 134 138 } 135 139 sleep(1); … … 185 189 } 186 190 for (i = 0; i < 4 * 8; i++) { 187 (void) fwrite(blk, 1, 256 * 1024, g_tape_stream); 191 if (fwrite(blk, 1, 256 * 1024, g_tape_stream)) { 192 //FIXME 193 } 188 194 if (should_we_write_to_next_tape 189 195 (bkpinfo->media_size[g_current_media_number], (off_t)256 * 1024)) { … … 362 368 { 363 369 int res = 0; 364 char *fname = (char *)&res; /* Should NOT be NULL */ 370 char fname_buf[PATH_MAX]; 371 char *fname = (char *)fname_buf; /* Should NOT be NULL */ 365 372 char *tmp = NULL; 366 373 … … 419 426 res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr); 420 427 log_msg(1, "End of extended attributes, now looking for afioball"); 421 return ( 0);428 return (res); 422 429 } 423 430 … … 521 528 { 522 529 long long final_alleged_writeK, final_projected_certain_writeK, 523 final_actually_certain_writeK = 0,cposK, bufsize_K;530 cposK, bufsize_K; 524 531 int last, curr, i; 525 t_archtype type = other;526 532 char *command = NULL; 527 533 char *tmpdir = NULL; … … 557 563 cposK = g_tapecatalog->el[curr].tape_posK; 558 564 if (cposK < final_projected_certain_writeK) { 559 final_actually_certain_writeK = cposK;560 565 break; 561 566 } … … 835 840 g_tape_stream); 836 841 } 837 (void) fwrite(datablock, 1, (size_t) length, fout); 842 if (fwrite(datablock, 1, (size_t) length, fout)) { 843 // FIXME 844 } 838 845 g_tape_posK += length / 1024; 839 846 } … … 860 867 close_evalcall_form(); 861 868 log_it("Saved all.tar.gz to '%s'", outfname); 862 (void) getcwd(old_cwd, MAX_STR_LEN); 863 chdir(bkpinfo->tmpdir); 869 if (getcwd(old_cwd, MAX_STR_LEN)) { 870 // FIXME 871 } 872 if (chdir(bkpinfo->tmpdir)) { 873 // FIXME 874 } 864 875 mr_asprintf(tmp, "tar -zxf %s ."MINDI_CACHE"/mondorestore.cfg 2> /dev/null", outfname); 865 876 paranoid_system(tmp); … … 867 878 868 879 paranoid_system("cp -f ."MINDI_CACHE"/mondorestore.cfg . 2> /dev/null"); 869 chdir(old_cwd); 880 if (chdir(old_cwd)) { 881 // FIXME 882 } 870 883 unlink(outfname); 871 884 mr_free(outfname); … … 1049 1062 unsigned int crctt; 1050 1063 1051 bool had_to_resync = FALSE;1052 1053 1064 /*@ init ******************************************************* */ 1054 1065 malloc_string(temp_fname); … … 1062 1073 1063 1074 res = read_header_block_from_stream(&temp_size, temp_fname, &ctrl_chr); 1075 if (res) { 1076 // FIXME 1077 } 1064 1078 if (orig_size != temp_size && orig_size != -1) { 1065 1079 log_to_screen("output file's size should be %ld K but is apparently %ld K", (long) size >> 10, (long) temp_size >> 10); … … 1100 1114 for (size = orig_size; size > where_I_was_before_tape_change; 1101 1115 size -= bytes_to_write) { 1102 bytes_read = 1103 fread(datablock, 1, bytes_to_read, g_tape_stream); 1116 bytes_read = fread(datablock, 1, bytes_to_read, g_tape_stream); 1104 1117 } 1105 1118 log_msg(4, "'size' is now %lld (should be %lld)", size, 1106 1119 where_I_was_before_tape_change); 1107 1120 log_to_screen("Successfully re-sync'd tape"); 1108 had_to_resync = TRUE;1109 1121 bytes_read = fread(datablock, 1, bytes_to_read, g_tape_stream); 1110 1122 } 1111 1123 1112 (void) fwrite(datablock, 1, (size_t) bytes_to_write, fout); // for blocking reasons, bytes_successfully_read_in isn't necessarily the same as bytes_to_write 1124 if (fwrite(datablock, 1, (size_t) bytes_to_write, fout)) { // for blocking reasons, bytes_successfully_read_in isn't necessarily the same as bytes_to_write 1125 // FIXME 1126 } 1113 1127 1114 1128 #ifdef EXTRA_TAPE_CHECKSUMS … … 1177 1191 } 1178 1192 while (!(*pcontrol_char = tempblock[7000])) { 1179 g_tape_posK += 1180 fread(tempblock, 1, (size_t) TAPE_BLOCK_SIZE, 1181 g_tape_stream) / 1024; 1193 g_tape_posK += fread(tempblock, 1, (size_t) TAPE_BLOCK_SIZE, g_tape_stream) / 1024; 1182 1194 } 1183 1195 memcpy((char *) plen, tempblock + 7001, sizeof(long long)); … … 1320 1332 ctrl_chr = -1; 1321 1333 while (ctrl_chr != BLK_START_AN_AFIO_OR_SLICE) { 1322 res = 1323 read_header_block_from_stream(&temp_size, temp_fname, &ctrl_chr); 1334 res = read_header_block_from_stream(&temp_size, temp_fname, &ctrl_chr); 1324 1335 if (ctrl_chr == BLK_START_AN_AFIO_OR_SLICE) { 1325 1336 break; … … 1330 1341 } 1331 1342 while (ctrl_chr != BLK_START_FILE) { 1332 res = 1333 read_header_block_from_stream(&temp_size, temp_fname, &ctrl_chr); 1343 res = read_header_block_from_stream(&temp_size, temp_fname, &ctrl_chr); 1334 1344 if (ctrl_chr == BLK_START_FILE) { 1335 1345 break; … … 1356 1366 bytes_to_write = 1357 1367 (size < TAPE_BLOCK_SIZE) ? (long) size : TAPE_BLOCK_SIZE; 1358 // FIXME - needs error-checking and -catching1359 fread(datablock, 1, (size_t) TAPE_BLOCK_SIZE, g_tape_stream);1360 }1361 res =1362 1368 if (fread(datablock, 1, (size_t) TAPE_BLOCK_SIZE, g_tape_stream)) { 1369 // FIXME - needs error-checking and -catching 1370 } 1371 } 1372 res = read_header_block_from_stream(&temp_size, temp_fname, &ctrl_chr); 1363 1373 if (ctrl_chr != BLK_STOP_FILE) { 1364 1374 wrong_marker(BLK_STOP_FILE, ctrl_chr); 1365 1375 } 1366 res = 1367 read_header_block_from_stream(&temp_size, temp_fname, &ctrl_chr); 1376 res = read_header_block_from_stream(&temp_size, temp_fname, &ctrl_chr); 1368 1377 if (ctrl_chr != BLK_STOP_AN_AFIO_OR_SLICE) { 1369 1378 wrong_marker(BLK_STOP_AN_AFIO_OR_SLICE, ctrl_chr); 1370 1379 } 1371 res = 1372 read_header_block_from_stream(&temp_size, temp_fname, &ctrl_chr); 1380 res = read_header_block_from_stream(&temp_size, temp_fname, &ctrl_chr); 1373 1381 if (ctrl_chr != BLK_START_AN_AFIO_OR_SLICE) { 1374 1382 wrong_marker(BLK_START_AN_AFIO_OR_SLICE, ctrl_chr); 1375 1383 } 1376 res = 1377 read_header_block_from_stream(&temp_size, temp_fname, &ctrl_chr); 1384 res = read_header_block_from_stream(&temp_size, temp_fname, &ctrl_chr); 1378 1385 if (ctrl_chr != BLK_START_FILE) { 1379 1386 wrong_marker(BLK_START_FILE, ctrl_chr); … … 1689 1696 bytes_to_read = TAPE_BLOCK_SIZE; 1690 1697 } 1691 (void) fread(datablock, 1, (size_t) bytes_to_read, fin); 1698 if (fread(datablock, 1, (size_t) bytes_to_read, fin)) { 1699 // FIXME 1700 } 1692 1701 g_tape_posK += 1693 1702 fwrite(datablock, 1, /*bytes_to_read */ -
branches/3.1/mondo/src/common/libmondo-string-EXT.h
r2508 r3147 23 23 extern void strip_spaces(char *in_out); 24 24 extern char *trim_empty_quotes(char *incoming); 25 extern char *truncate_to_drive_name(c har *partition);25 extern char *truncate_to_drive_name(const char *partition); 26 26 extern char *turn_raid_level_number_to_string(int raid_level); 27 27 -
branches/3.1/mondo/src/common/libmondo-string.c
r2508 r3147 665 665 */ 666 666 void strip_spaces(char *in_out) 667 { 668 /*@ buffers ***************************************************** */ 669 char *tmp = NULL; 670 671 /*@ int ******************************************************** */ 672 int i; 673 674 /*@ end vars *************************************************** */ 675 676 assert(in_out != NULL); 677 malloc_string(tmp); 678 for (i = 0; in_out[i] <= ' ' && i < (int) strlen(in_out) -1; i++); 679 strcpy(tmp, in_out + i); 680 for (i = (int) strlen(tmp) -1; i >= 0 && tmp[i] <= ' '; i--); 681 i++; 682 tmp[i] = '\0'; 683 684 // Now tmp contains the stripped string 685 strcpy(in_out,tmp); 686 paranoid_free(tmp); 687 } 688 689 /** 690 * Remove all characters whose ASCII value is less than or equal to 32 691 * (spaces and control characters) from both sides of @p in_out. 692 * @param in_out The string to strip spaces/control characters from (modified). 693 */ 694 void strip_spaces2(char *in_out) 667 695 { 668 696 /*@ buffers ***************************************************** */ … … 752 780 * @return @p partition. 753 781 */ 754 char *truncate_to_drive_name(c har *partition)782 char *truncate_to_drive_name(const char *partition) 755 783 { 756 784 int i = strlen(partition) - 1; -
branches/3.1/mondo/src/common/libmondo-string.h
r2508 r3147 21 21 void strip_spaces(char *in_out); 22 22 char *trim_empty_quotes(char *incoming); 23 char *truncate_to_drive_name(c har *partition);23 char *truncate_to_drive_name(const char *partition); 24 24 char *turn_raid_level_number_to_string(int raid_level); 25 25 void printf_silly_message(void); -
branches/3.1/mondo/src/common/libmondo-tools.c
r2937 r3147 304 304 { 305 305 #ifdef __FreeBSD__ 306 system("kldstat | grep msdosfs || kldload msdosfs 2> /dev/null");307 system("kldstat | grep ext2fs || kldload ext2fs 2> /dev/null");306 paranoid_system("kldstat | grep msdosfs || kldload msdosfs 2> /dev/null"); 307 paranoid_system("kldstat | grep ext2fs || kldload ext2fs 2> /dev/null"); 308 308 #else 309 system("modprobe -a msdos vfat loop &> /dev/null");309 paranoid_system("modprobe -a msdos vfat loop &> /dev/null"); 310 310 #endif 311 311 } … … 643 643 colon++; 644 644 hent = gethostbyname(colon); 645 mr_asprintf( bkpinfo->netfs_user,"%s", hostname);645 mr_asprintf(&(bkpinfo->netfs_user),"%s", hostname); 646 646 } else { 647 647 hent = gethostbyname(hostname); … … 713 713 } 714 714 715 /* From busybox under GPLv2 */ 716 #ifndef HAVE_MKDTEMP 717 /* This is now actually part of POSIX.1, but was only added in 2008 */ 718 char* mkdtemp(char *template) 719 { 720 if (mktemp(template) == NULL || mkdir(template, 0700) != 0) 721 return NULL; 722 return template; 723 } 724 #endif 725 715 726 void setup_tmpdir(char *path) { 716 727 … … 721 732 /* purging a potential old tmpdir */ 722 733 log_it("Purging old tmpdir %s", bkpinfo->tmpdir); 723 chdir("/tmp"); 734 if (chdir("/tmp")) { 735 // FIXME 736 } 724 737 mr_asprintf(tmp,"rm -Rf %s",bkpinfo->tmpdir); 725 738 mr_free(bkpinfo->tmpdir); 726 (void)system(tmp);739 paranoid_system(tmp); 727 740 mr_free(tmp); 728 741 } … … 1032 1045 mr_free(tmp); 1033 1046 1034 if (!run_program_and_log_output("parted2fdisk -l | grep -i raid", 1)1047 if (!run_program_and_log_output("parted2fdisk -l 2>/dev/null | grep -i raid", 1) 1035 1048 && !does_file_exist("/etc/raidtab")) { 1036 1049 log_to_screen 1037 1050 ("You have RAID partitions but no /etc/raidtab - creating one from /proc/mdstat"); 1038 create_raidtab_from_mdstat( "/etc/raidtab");1051 create_raidtab_from_mdstat(MDSTAT_FILE,"/etc/raidtab"); 1039 1052 } 1040 1053 -
branches/3.1/mondo/src/common/libmondo-verify.c
r2937 r3147 412 412 char *outlog = NULL; 413 413 char *tmp = NULL; 414 char *p = NULL; 414 415 415 416 /*@ pointers ******************************************************* */ … … 477 478 bkpinfo->use_star = TRUE; 478 479 if (strstr(tarball_fname, ".bz2")) 479 mr_asprintf(command, "star - diff diffopts=mode,size,data file=%s %s >> %s 2>> %s", tarball_fname, (strstr(tarball_fname, ".bz2")) ? "-bz" : " ", outlog, outlog);480 mr_asprintf(command, "star -sparse -diff diffopts=mode,size,data file=%s %s >> %s 2>> %s", tarball_fname, (strstr(tarball_fname, ".bz2")) ? "-bz" : " ", outlog, outlog); 480 481 } else { 481 482 bkpinfo->use_star = FALSE; … … 681 682 682 683 mr_asprintf(tmp, "echo \"%s\" >> %s/biggies.changed", biggie_fname, bkpinfo->tmpdir); 683 system(tmp);684 paranoid_system(tmp); 684 685 mr_free(tmp); 685 686 } … … 738 739 log_it("Grabbing the EXAT files"); 739 740 if (ctrl_chr == BLK_START_EXTENDED_ATTRIBUTES) { 740 res = 741 read_EXAT_files_from_tape(&size, fname, &ctrl_chr, 741 res = read_EXAT_files_from_tape(&size, fname, &ctrl_chr, 742 742 curr_xattr_list_fname, 743 743 curr_acl_list_fname); … … 765 765 if (ctrl_chr == BLK_START_EXTENDED_ATTRIBUTES) { 766 766 log_it("Reading EXAT files from tape"); 767 res = 768 read_EXAT_files_from_tape(&size, fname, &ctrl_chr, 767 res = read_EXAT_files_from_tape(&size, fname, &ctrl_chr, 769 768 curr_xattr_list_fname, 770 769 curr_acl_list_fname); … … 848 847 if (ctrl_chr == BLK_START_EXTENDED_ATTRIBUTES) { 849 848 log_it("Grabbing the EXAT biggiefiles"); 850 res = 851 read_EXAT_files_from_tape(&size, orig_fname, 849 res = read_EXAT_files_from_tape(&size, orig_fname, 852 850 &ctrl_chr, curr_xattr_list_fname, 853 851 curr_acl_list_fname); -
branches/3.1/mondo/src/common/mondostructures.h
r2816 r3147 191 191 * A type of file in the catalog of recent archives. 192 192 */ 193 typedef enum { other, ///< Some other kind of file. 193 typedef enum { 194 other, ///< Some other kind of file. 194 195 fileset, ///< An afioball (fileset), optionally compressed. 195 196 biggieslice ///< A slice of a biggiefile, optionally compressed. … … 201 202 typedef enum { 202 203 nuke = 0, /// Nuke mode 203 interactive, /// Interactive mode204 interactive, /// Interactive mode 204 205 compare, /// Compare mode 205 206 mbr, /// MBR mode -
branches/3.1/mondo/src/common/newt-specific.c
r2937 r3147 57 57 */ 58 58 bool g_exiting = FALSE; 59 60 // Decide whether we should continue to ask questions or exit (cron use case) 61 extern bool g_fail_immediately; 59 62 60 63 /** … … 122 125 char *tmp; 123 126 124 assert_string_is_neither_NULL_nor_zerolength(prompt); 125 127 assert_string_is_neither_NULL_nor_zerolength(prompt); 128 129 if (g_fail_immediately) { 130 // We consider the user aborted by using the -F option 131 log_msg(3, "Exiting at first interaction request due to -F"); 132 finish(1); 133 } 126 134 if (g_text_mode) { 127 135 while (1) { … … 163 171 /*@ buffer *********************************************************** */ 164 172 char *tmp = NULL; 173 char *p; 165 174 int i; 166 175 167 assert_string_is_neither_NULL_nor_zerolength(prompt); 176 if (g_fail_immediately) { 177 // We consider the user aborted by using the -F option 178 log_msg(3, "Exiting at first interaction request due to -F"); 179 finish(1); 180 } 168 181 169 182 if (g_text_mode) { … … 318 331 sync(); 319 332 320 chdir("/"); 333 if (chdir("/")) { 334 // FIXME 335 } 321 336 if (g_selfmounted_isodir) { 322 337 mr_asprintf(command, "umount -d %s", g_selfmounted_isodir); … … 369 384 370 385 /* Before removing dir, make sure we're out of them */ 371 chdir("/tmp"); 386 if (chdir("/tmp")) { 387 // FIXME 388 } 372 389 run_program_and_log_output("umount -d " MNT_CDROM, FALSE); 373 390 if (g_selfmounted_isodir) { … … 385 402 log_msg(8,"erasing tempdir %s",bkpinfo->tmpdir); 386 403 mr_asprintf(command, "rm -Rf %s", bkpinfo->tmpdir); 387 system(command);404 paranoid_system(command); 388 405 mr_free(command); 389 406 } … … 394 411 log_msg(8,"erasing scratchdir %s",bkpinfo->scratchdir); 395 412 mr_asprintf(command, "rm -Rf %s", bkpinfo->scratchdir); 396 system(command);413 paranoid_system(command); 397 414 mr_free(command); 398 415 } … … 424 441 char *command = NULL; 425 442 char *tmp = NULL; 443 char *p = NULL; 426 444 427 445 /*@ pointers ********************************************************* */ … … 763 781 /*@ buffers *********************************************************** */ 764 782 char *prompt = NULL; 783 char *q; 765 784 766 785 /*@ newt ************************************************************** */ … … 1130 1149 static char *possible_responses[] = { "none", "cdr", "cdrw", "dvd", "tape", "cdstream", "udev", "netfs", "iso", NULL }; 1131 1150 char *outstr = NULL; 1151 char *p; 1132 1152 t_bkptype backup_type; 1133 1153 int i; … … 1286 1306 newtPushHelpLine(" Please specify the level of compression that you want."); 1287 1307 newtCenteredWindow(34, 13, "How much compression?"); 1288 b1 = newtButton(4, 1, "Maximum ");1289 b2 = newtButton(18, 1, "Average ");1290 b3 = newtButton(4, 5, "Minimum ");1291 b4 = newtButton(18, 5, " None ");1308 b1 = newtButton(4, 1, "Maximum (9)"); 1309 b2 = newtButton(18, 1, "Average (4)"); 1310 b3 = newtButton(4, 5, "Minimum (1)"); 1311 b4 = newtButton(18, 5, " None (0) "); 1292 1312 b5 = newtButton(4, 9, " Exit "); 1293 1313 myForm = newtForm(NULL, NULL, 0); … … 1327 1347 bool done; 1328 1348 char *tmp = NULL; 1349 char *p; 1329 1350 char *tmp1 = NULL; 1330 1351 FILE *fin, *fout; … … 1563 1584 } /* extern "C" */ 1564 1585 #endif 1565 1566 1567 void wait_until_software_raids_are_prepped(char *mdstat_file, int wait_for_percentage); -
branches/3.1/mondo/src/include/my-stuff.h
r2850 r3147 313 313 #define DONT_KNOW_HOW_TO_EVALUATE_THIS_DEVICE_TYPE "/dev/md" 314 314 #define RAID_DEVICE_STUB DONT_KNOW_HOW_TO_EVALUATE_THIS_DEVICE_TYPE 315 #define SANE_FORMATS "swap image vfat ext2 ext3 ext4 xfs vfs jfs reiserfs vmfs dos minix coda fuse.sshfs nfs nfs4 ntfs ntfs-3g hpfs raid lvm cifs ocfs ocfs2 "315 #define SANE_FORMATS "swap image vfat ext2 ext3 ext4 xfs vfs jfs reiserfs vmfs dos minix coda fuse.sshfs nfs nfs4 ntfs ntfs-3g hpfs raid lvm cifs ocfs ocfs2 btrfs" 316 316 #define ALT_TAPE "/dev/ht0" 317 317 #define MKE2FS_OR_NEWFS "mke2fs" … … 331 331 #define ACL_BIGGLST_FNAME_RAW_SZ "%s/acl_list.big.gz" 332 332 333 #define BIGGIEMAXSIZE 64L*1024L 333 334 /** 334 335 * The template for an afioball filename. … … 339 340 #define ARCH_BUFFER_NUM (ARCH_THREADS*4) // Number of permissible queued afio files 340 341 #define DO_MBR_PLEASE "/tmp/DO-MBR-PLEASE" 342 #define MONDO_MNTLISTCHG "/tmp/mountlist.changed" 341 343 342 344 -
branches/3.1/mondo/src/lib/mr_conf.c
r2508 r3147 97 97 int mr_conf_open(const char *filename) { 98 98 size_t length; /*length of the buffer/file */ 99 size_t res = 0;100 99 101 100 /* check if mr_conf is already opened? */ … … 126 125 /*reading file in buffer (skip all 0 characters) */ 127 126 128 res = fread(buffer, sizeof(char), length, CONF); 127 if (fread(buffer, sizeof(char), length, CONF)) { 128 // FIXME 129 } 129 130 buffer[length] = (char) 0; /*finalize the string */ 130 131 -
branches/3.1/mondo/src/lib/mr_str.c
r2421 r3147 28 28 size_t pos1 = 0; 29 29 size_t pos2 = 0; 30 31 if (instr == NULL) { 32 *lastpos = 0; 33 return token; 34 } 35 36 if (delims == NULL) { 37 *lastpos = 0; 38 return token; 39 } 30 40 31 41 if (strlen(instr) <= *lastpos) { -
branches/3.1/mondo/src/mondoarchive/mondoarchive.c
r2508 r3147 47 47 */ 48 48 bool g_ISO_restore_mode = FALSE; 49 50 /* Whether we should fail immediately at first error */ 51 bool g_fail_immediately = FALSE; 49 52 50 53 /* Do we use extended attributes and acl ? … … 159 162 int retval = 0; 160 163 char *say_at_end = NULL; 164 FILE *fin = NULL; 161 165 162 166 printf("Initializing...\n"); … … 260 264 g_loglevel = 10; 261 265 finish(set_acl_list(argv[2], argv[3])); 266 } 267 if (argc >= 2 && !strcmp(argv[1], "mkraidtab")) { 268 g_loglevel = 10; 269 g_text_mode = TRUE; 270 setup_newt_stuff(); 271 #undef MDSTAT_FILE 272 #define MDSTAT_FILE "/tmp/mdstat" 273 if (!(fin = fopen(MDSTAT_FILE, "r"))) { 274 log_msg(1, "Could not open %s.\n", MDSTAT_FILE); 275 finish(1); 276 } 277 278 create_raidtab_from_mdstat(MDSTAT_FILE,"/tmp/raidtab"); 279 finish(0); 262 280 } 263 281 … … 397 415 run_program_and_log_output("mount", 2); 398 416 399 system("rm -f "MONDO_CACHE"/last-backup.aborted");417 paranoid_system("rm -f "MONDO_CACHE"/last-backup.aborted"); 400 418 if (!retval) { 401 419 printf("Mondoarchive ran OK.\n"); … … 421 439 mr_free(tmp); 422 440 423 chdir("/tmp"); 441 if (chdir("/tmp")) { 442 // FIXME 443 } 424 444 425 445 if (!g_text_mode) { -
branches/3.1/mondo/src/mondoarchive/mondoarchive.h
r2340 r3147 9 9 */ 10 10 char *MONDO_LOGFILE = "/var/log/mondoarchive.log"; 11 char *MONDO_OPTIONS = "0123456789A:B:C:DE: GHI:J:K:LNOP:QRS:T:UVWYb:c:d:ef:gik:l:mn:op:rs:tuw:x:z";11 char *MONDO_OPTIONS = "0123456789A:B:C:DE:FGHI:J:K:LM:NOP:QRS:T:UVWYb:c:d:ef:gik:l:mn:op:rs:tuw:x:z"; 12 12 13 13 /* No restriction on ps options */ -
branches/3.1/mondo/src/mondorestore/mondo-prep.c
r2937 r3147 110 110 popup_and_OK 111 111 ("I must now reboot. Please leave the boot media in the drive and repeat your actions - e.g. type 'nuke' - and it should work fine."); 112 system("reboot");112 paranoid_system("reboot"); 113 113 } 114 114 } … … 171 171 172 172 int do_my_funky_lvm_stuff(bool just_erase_existing_volumes, 173 173 bool vacuum_pack) 174 174 { 175 /** 175 /** buffers **********************************************/ 176 176 char *tmp = NULL; 177 177 char *tmp1 = NULL; … … 188 188 char *p; 189 189 char *q; 190 char *r; 190 191 191 192 /** int ***************************************************/ … … 442 443 /** pointers *********************************************************/ 443 444 char *p; 445 char *q; 444 446 445 447 /** init *************************************************************/ … … 503 505 } else { 504 506 strcpy(new_mountlist->el[new_mountlist->entries].device, 505 507 old_mountlist->el[lino].device); 506 508 strcpy(new_mountlist->el[new_mountlist->entries].mountpoint, 507 509 old_mountlist->el[lino].mountpoint); 508 510 strcpy(new_mountlist->el[new_mountlist->entries].format, 509 511 old_mountlist->el[lino].format); 510 512 new_mountlist->el[new_mountlist->entries].size = 511 513 old_mountlist->el[lino].size; … … 527 529 * @return 0 for success, nonzero for failure. 528 530 */ 529 int create_raid_device_via_mdadm(struct raidlist_itself *raidlist, char *device) 530 { 531 /** int **************************************************************/ 532 int i = 0; 533 int j = 0; 534 int res = 0; 535 536 /** buffers ***********************************************************/ 537 char *devices = NULL; 538 char *strtmp = NULL; 539 char *level = NULL; 540 char *program = NULL; 541 char *tmp = NULL; 542 char *oldmd = NULL; 543 char *bootdevice; 544 char *name; 531 int create_raid_device_via_mdadm(struct raidlist_itself *raidlist, char *device, bool test) { 532 /** int **************************************************************/ 533 int i = 0; 534 int j = 0; 535 int v = 0; 536 int res = 0; 537 538 /** buffers ***********************************************************/ 539 char *devices = NULL; 540 char *level = NULL; 541 char *program = NULL; 545 542 546 543 malloc_string(bootdevice); … … 735 732 /* format raid partition */ 736 733 mr_asprintf(program, "for plex in `vinum lv -r %s | grep '^P' | tr '\t' ' ' | tr -s ' ' | cut -d' ' -f2`; do echo $plex; done > /tmp/plexes", basename(device)); 737 system(program);734 paranoid_system(program); 738 735 if (g_fprep) { 739 736 fprintf(g_fprep, "%s\n", program); … … 752 749 753 750 mr_asprintf(tmp, "vinum init %s", line); 754 system(tmp);751 paranoid_system(tmp); 755 752 mr_free(tmp); 756 753 … … 781 778 log_to_screen("Initializing RAID device %s", device); 782 779 783 // Shouldn't be necessary.780 // Shouldn't be necessary. 784 781 log_to_screen("Stopping %s", device); 785 782 stop_raid_device(device); … … 789 786 log_msg(1, "Making %s", device); 790 787 // use mkraid if it exists, otherwise use mdadm 791 792 res = create_raid_device_via_mdadm(raidlist, device);793 788 if (run_program_and_log_output("which mkraid", FALSE)) { 789 res = create_raid_device_via_mdadm(raidlist, device, TRUE); 790 log_msg(1, "Creating RAID device %s via mdadm returned %d", device, res); 794 791 } else { 795 792 mr_asprintf(program, "mkraid --really-force %s", device); … … 884 881 */ 885 882 int format_everything(struct mountlist_itself *mountlist, bool interactively, 886 883 struct raidlist_itself *raidlist) 887 884 { 888 885 /** int **************************************************************/ … … 907 904 log_it("format_everything (mountlist, interactively = %s", (interactively) ? "true" : "false"); 908 905 909 mvaddstr_and_log_it(g_currentY, 0, "Formatting partitions 906 mvaddstr_and_log_it(g_currentY, 0, "Formatting partitions "); 910 907 open_progress_form("Formatting partitions", 911 912 913 908 "I am now formatting your hard disk partitions.", 909 "This may take up to five minutes.", "", 910 mountlist->entries + 1); 914 911 915 912 progress_step = … … 949 946 sleep(2); 950 947 // This last step is probably necessary 951 // 952 // 953 // system("sync"); system("sync");system("sync");954 // 948 // log_to_screen("Re-starting software RAIDs..."); 949 // start_all_raid_devices(mountlist); 950 // paranoid_system("sync"); paranoid_system("sync"); paranoid_system("sync"); 951 // sleep(5); 955 952 // do LVMs now 956 953 log_msg(1, "Creating LVMs"); … … 992 989 continue; 993 990 } else if (!does_file_exist(me->device) 994 995 991 && strncmp(me->device, "/dev/hd", 7) 992 && strncmp(me->device, "/dev/sd", 7)) { 996 993 log_it("Not formatting %s yet - doesn't exist - probably an LVM", me->device); 997 994 continue; … … 1049 1046 } 1050 1047 newtSuspend(); 1051 system("clear");1048 paranoid_system("clear"); 1052 1049 newtResume(); 1053 1050 return (retval); … … 1064 1061 */ 1065 1062 int make_dummy_partitions(FILE * pout_to_fdisk, char *drivename, 1066 1063 int devno_we_must_allow_for) 1067 1064 { 1068 1065 /** int **************************************************************/ … … 1178 1175 fprintf(f, "\n\n%u partitions:\n", lp->d_npartitions); 1179 1176 fprintf(f, 1180 "# 1177 "# size offset fstype [fsize bsize bps/cpg]\n"); 1181 1178 pp = lp->d_partitions; 1182 1179 for (i = 0; i < lp->d_npartitions; i++, pp++) { 1183 1180 if (pp->p_size) { 1184 fprintf(f, " 1181 fprintf(f, " %c: %8lu %8lu ", 'a' + i, (u_long) pp->p_size, 1185 1182 (u_long) pp->p_offset); 1186 1183 if (pp->p_fstype < FSMAXTYPES) … … 1191 1188 1192 1189 case FS_UNUSED: /* XXX */ 1193 fprintf(f, " 1190 fprintf(f, " %5lu %5lu %5.5s ", (u_long) pp->p_fsize, 1194 1191 (u_long) (pp->p_fsize * pp->p_frag), ""); 1195 1192 break; 1196 1193 1197 1194 case FS_BSDFFS: 1198 fprintf(f, " 1195 fprintf(f, " %5lu %5lu %5u ", (u_long) pp->p_fsize, 1199 1196 (u_long) (pp->p_fsize * pp->p_frag), pp->p_cpg); 1200 1197 break; 1201 1198 1202 1199 case FS_BSDLFS: 1203 fprintf(f, " 1200 fprintf(f, " %5lu %5lu %5d", (u_long) pp->p_fsize, 1204 1201 (u_long) (pp->p_fsize * pp->p_frag), pp->p_cpg); 1205 1202 break; … … 1217 1214 fprintf(f, "- %lu", 1218 1215 (u_long) ((pp->p_offset + pp->p_size + 1219 1220 1216 lp->d_secpercyl - 1) / lp->d_secpercyl - 1217 1)); 1221 1218 if (pp->p_size % lp->d_secpercyl) 1222 1219 putc('*', f); … … 1256 1253 /* 1257 1254 * Nobody in these enligthened days uses the CHS geometry for 1258 * anything, but nontheless try to get it right. 1255 * anything, but nontheless try to get it right. If we fail 1259 1256 * to get any good ideas from the device, construct something 1260 1257 * which is IBM-PC friendly. … … 1340 1337 lp->d_partitions[c - 'a'].p_cpg = 64; 1341 1338 } else if (!strcasecmp(mountlist->el[idx].format, "raid") 1342 1339 || !strcasecmp(mountlist->el[idx].format, "vinum")) { 1343 1340 lp->d_partitions[c - 'a'].p_fstype = FS_VINUM; 1344 1341 } else if (!strcmp(mountlist->el[idx].format, "swap")) { … … 1422 1419 char *format = NULL; 1423 1420 char *tmp = NULL; 1421 char *tmp1 = NULL; 1424 1422 char *tmp1 = NULL; 1425 1423 … … 1511 1509 1512 1510 /* OK, we've found partition /dev/hdxN in mountlist; let's prep it */ 1513 /* For FreeBSD, that is 1511 /* For FreeBSD, that is /dev/adXsY */ 1514 1512 1515 1513 log_it("Found partition %s in mountlist", device_str); … … 1540 1538 previous_devno = 1541 1539 make_dummy_partitions(pout_to_fdisk, drivename, 1542 1540 current_devno); 1543 1541 } 1544 1542 } … … 1595 1593 sync(); 1596 1594 paranoid_pclose(pout_to_fdisk); 1597 log_msg(0,1598 1595 paranoid_system("sync"); 1596 log_msg(0,"------------------- fdisk.log looks like this ------------------"); 1599 1597 mr_asprintf(tmp, "cat %s >> %s", FDISK_LOG, MONDO_LOGFILE); 1600 1598 system(tmp); … … 1625 1623 * Create partition number @p partno on @p drive with @p fdisk. 1626 1624 * @param drive The drive to create the partition on. 1627 // 1625 // * @param partno The partition number of the new partition (1-4 are primary, >=5 is logical). 1628 1626 * @param prev_partno The partition number of the most recently prepped partition. 1629 1627 * @param format The filesystem type of this partition (used to set the type). … … 1656 1654 1657 1655 log_it("partition_device('%s', %d, %d, '%s', %lld) --- starting", 1658 1656 drive, partno, prev_partno, format, partsize); 1659 1657 1660 1658 if (!strncmp(drive, RAID_DEVICE_STUB, strlen(RAID_DEVICE_STUB))) { … … 1743 1741 retval = 1744 1742 set_partition_type(pout_to_fdisk, drive, partno, format, 1745 1743 partsize); 1746 1744 if (retval) { 1747 1745 log_msg(1, "Failed. Trying again..."); 1748 1746 retval = 1749 1747 set_partition_type(pout_to_fdisk, drive, partno, 1750 1748 format, partsize); 1751 1749 } 1752 1750 } … … 1783 1781 retval = 1784 1782 set_partition_type(pout_to_fdisk, drive, partno, format, 1785 1783 partsize); 1786 1784 if (retval) { 1787 1785 log_it("Partitioned %s but failed to set its type", partition_name); … … 1832 1830 /** buffer *********************************************************/ 1833 1831 struct list_of_disks *drivelist; 1834 /* 1832 /* struct mountlist_itself new_mtlist, *mountlist; */ 1835 1833 1836 1834 /** end ************************************************************/ … … 1840 1838 1841 1839 log_it("partition_everything() --- starting"); 1842 mvaddstr_and_log_it(g_currentY, 0, "Partitioning hard drives 1843 /* 1840 mvaddstr_and_log_it(g_currentY, 0, "Partitioning hard drives "); 1841 /* mountlist=orig_mtlist; */ 1844 1842 if (mountlist_contains_raid_devices(mountlist)) { 1845 /* 1846 /* 1843 /* mountlist=&new_mtlist; */ 1844 /* extrapolate_mountlist_to_include_raid_partitions(mountlist,orig_mtlist); */ 1847 1845 log_msg(0, 1848 1846 "Mountlist, including the partitions incorporated in RAID devices:-"); … … 1865 1863 1866 1864 open_progress_form("Partitioning devices", 1867 1868 1869 1865 "I am now going to partition all your drives.", 1866 "This should not take more than five minutes.", "", 1867 mountlist->entries); 1870 1868 1871 1869 make_list_of_drives_in_mountlist(mountlist, drivelist); … … 1885 1883 } 1886 1884 newtSuspend(); 1887 system("clear");1885 paranoid_system("clear"); 1888 1886 newtResume(); 1889 1887 paranoid_free(drivelist); … … 1906 1904 */ 1907 1905 int set_partition_type(FILE * pout_to_fdisk, const char *drive, int partno, 1908 1906 const char *format, long long partsize) 1909 1907 { 1910 1908 /** buffers *********************************************************/ … … 1939 1937 } 1940 1938 } else if (strcmp(format, "ext2") == 0 1941 || strcmp(format, "reiserfs") == 0 1942 || strcmp(format, "ext3") == 0 1943 || strcmp(format, "ext4") == 0 1944 || strcmp(format, "xfs") == 0 1945 || strcmp(format, "jfs") == 0) { 1939 || strcmp(format, "reiserfs") == 0 1940 || strcmp(format, "ext3") == 0 1941 || strcmp(format, "ext4") == 0 1942 || strcmp(format, "xfs") == 0 1943 || strcmp(format, "jfs") == 0 1944 || strcmp(format, "btrfs") == 0) { 1946 1945 mr_asprintf(partcode, "83"); 1947 1946 } else if (strcmp(format, "minix") == 0) { … … 1956 1955 mr_asprintf(partcode, "7"); 1957 1956 } else if ((strcmp(format, "ufs") == 0) 1958 1957 || (strcmp(format, "ffs") == 0)) { /* raid autodetect */ 1959 1958 mr_asprintf(partcode, "a5"); 1960 1959 } else if (strcmp(format, "lvm") == 0) { … … 2108 2107 mr_asprintf(program, "vinum stop -f %s", raid_device); 2109 2108 #else 2110 2111 2109 // use raidstop if it exists, otherwise use mdadm 2110 if (run_program_and_log_output("which raidstop", FALSE)) { 2112 2111 mr_asprintf(program, "mdadm -S %s", raid_device); 2113 2112 } else { … … 2174 2173 /** pointers ********************************************************/ 2175 2174 FILE *fin; 2175 char *q; 2176 2176 int i; 2177 2177 … … 2203 2203 for (p = dev; *p > 32; p++); 2204 2204 *p = '\0'; 2205 re s= stop_raid_device(dev);2205 retval += stop_raid_device(dev); 2206 2206 mr_free(dev); 2207 2207 } … … 2261 2261 } else if (strcmp(format, "ext4") == 0) { 2262 2262 mr_asprintf(program, "mkfs -t ext4 -F -q"); 2263 } else if (strcmp(format, "btrfs") == 0) { 2264 strcpy(program, "mkfs.btrfs"); 2263 2265 } else if (strcmp(format, "minix") == 0) { 2264 2266 mr_asprintf(program, "mkfs.minix"); … … 2297 2299 * There are a few problems with this function: 2298 2300 * - It won't work if there was any unallocated space on the user's hard drive 2299 * 2301 * when it was backed up. 2300 2302 * - It won't work if the user's hard drive lies about its size (more common 2301 * 2303 * than you'd think). 2302 2304 * 2303 2305 * @param mountlist The mountlist to use for resizing @p drive_name. … … 2311 2313 /** int *************************************************************/ 2312 2314 int partno, lastpart; 2313 /** remove driveno, noof_drives stan benoit apr 2002**/2314 2315 2315 2316 /** float ***********************************************************/ -
branches/3.1/mondo/src/mondorestore/mondo-rstr-compare.c
r2704 r3147 71 71 return (1); 72 72 } 73 fread((void *) &biggiestruct, 1, sizeof(biggiestruct), fin); 73 if (fread((void *) &biggiestruct, 1, sizeof(biggiestruct), fin)) { 74 // FIXME 75 } 74 76 paranoid_fclose(fin); 75 77 … … 218 220 int retval = 0; 219 221 int res; 220 long noof_lines;221 222 long archiver_errors; 222 223 bool use_star; … … 289 290 if (use_star) { 290 291 // doesn't use compressor_exe 291 mr_asprintf(command, "%s - diff H=exustar file=%s >> %s 2>> %s", archiver_exe, tarball_fname, logfile, logfile);292 mr_asprintf(command, "%s -sparse -diff H=exustar file=%s >> %s 2>> %s", archiver_exe, tarball_fname, logfile, logfile); 292 293 } else { 293 294 mr_asprintf(command, "%s -r -b %ld -M 16m -c %ld %s %s >> %s 2>> %s", archiver_exe, TAPE_BLOCK_SIZE, BUFSIZE, compressor_exe, tarball_fname, logfile, logfile); … … 308 309 if (length_of_file(logfile) > 5) { 309 310 mr_asprintf(command, "sed s/': \\\"'/\\|/ %s | sed s/'\\\": '/\\|/ | cut -d'|' -f2 | sort -u | grep -vE \"^dev/.*\" >> "MONDO_CACHE"/changed.txt", logfile); 310 system(command);311 paranoid_system(command); 311 312 mr_free(command); 312 313 … … 337 338 { 338 339 int retval = 0; 339 int res;340 340 int current_tarball_number = 0; 341 341 … … 409 409 log_to_screen(progress_str); 410 410 } else { 411 re s= compare_a_tarball(tarball_fname, current_tarball_number);411 retval += compare_a_tarball(tarball_fname, current_tarball_number); 412 412 413 413 g_current_progress++; … … 459 459 assert(bkpinfo != NULL); 460 460 461 getcwd(cwd, MAX_STR_LEN - 1); 462 chdir(bkpinfo->restore_path); 463 getcwd(new, MAX_STR_LEN - 1); 461 if (getcwd(cwd, MAX_STR_LEN - 1)) { 462 // FIXME 463 } 464 if (chdir(bkpinfo->restore_path)) { 465 //FIXME 466 } 467 if (getcwd(new, MAX_STR_LEN - 1)) { 468 // FIXME 469 } 464 470 insist_on_this_cd_number(g_current_media_number); 465 471 unlink(MONDO_CACHE"/changed.txt"); … … 467 473 resA = compare_all_tarballs(); 468 474 resB = compare_all_biggiefiles(); 469 chdir(cwd); 475 if (chdir(cwd)) { 476 // FIXME 477 } 470 478 noof_changed_files = count_lines_in_file(MONDO_CACHE"/changed.txt"); 471 479 if (noof_changed_files) { … … 594 602 595 603 log_msg(2, "calling popup_changelist_from_file()"); 596 getcwd(cwd, MAX_STR_LEN - 1); 597 chdir(bkpinfo->restore_path); 598 getcwd(new, MAX_STR_LEN - 1); 604 if (getcwd(cwd, MAX_STR_LEN - 1)) { 605 //FIXME 606 } 607 if (chdir(bkpinfo->restore_path)) { 608 // FIXME 609 } 610 if (getcwd(new, MAX_STR_LEN - 1)) { 611 //FIXME 612 } 599 613 popup_changelist_from_file(MONDO_CACHE"/changed.files"); 600 chdir(cwd); 614 if (chdir(cwd)) { 615 // FIXME 616 } 601 617 log_msg(2, "Returning from popup_changelist_from_file()"); 602 618 } … … 634 650 assert(bkpinfo != NULL); 635 651 malloc_string(dir); 636 getcwd(dir, MAX_STR_LEN); 637 chdir(bkpinfo->restore_path); 652 if (getcwd(dir, MAX_STR_LEN)) { 653 // FIXME 654 } 655 if (chdir(bkpinfo->restore_path)) { 656 // FIXME 657 } 638 658 639 659 mvaddstr_and_log_it(g_currentY, … … 647 667 } 648 668 res = verify_tape_backups(); 649 chdir(dir); 669 if (chdir(dir)) { 670 // FIXME 671 } 650 672 if (length_of_file(MONDO_CACHE"/changed.txt") > 2 651 673 && length_of_file(MONDO_CACHE"/changed.files") > 2) { … … 686 708 malloc_string(dir); 687 709 688 getcwd(dir, MAX_STR_LEN); 689 chdir(bkpinfo->restore_path); 710 if (getcwd(dir, MAX_STR_LEN)) { 711 // FIXME 712 } 713 if (chdir(bkpinfo->restore_path)) { 714 // FIXME 715 } 690 716 691 717 mvaddstr_and_log_it(g_currentY, 692 718 0, "Verifying archives against filesystem"); 693 719 res = verify_tape_backups(); 694 chdir(dir); 720 if (chdir(dir)) { 721 // FIXME 722 } 695 723 if (res) { 696 724 mvaddstr_and_log_it(g_currentY++, 74, "Failed."); -
branches/3.1/mondo/src/mondorestore/mondo-rstr-newt.c
r2937 r3147 137 137 /** int **************************************************************/ 138 138 int i = 0; 139 int num_to_add = 0;140 139 141 140 /** newt *************************************************************/ … … 233 232 mr_asprintf(drive_to_add, "%s", device_str); 234 233 for (i = strlen(drive_to_add); isdigit(drive_to_add[i - 1]); i--); 235 num_to_add = atoi(drive_to_add + i);236 234 mr_free(drive_to_add); 237 235 … … 1943 1941 finish(1); 1944 1942 } 1945 newtPushHelpLine 1946 (" Please edit the mountlist to your satisfaction, then click OK or Cancel."); 1943 newtPushHelpLine("WARNING: No LVM modification possible here. Edit /tmp/i-want-my-lvm instead"); 1947 1944 i = 4; 1948 1945 bAdd = newtCompactButton(i, 17, " Add "); … … 2423 2420 newtComponent b2; 2424 2421 newtComponent b3; 2425 newtComponent b_res;2426 2422 2427 2423 … … 2434 2430 myForm = newtForm(NULL, NULL, 0); 2435 2431 newtFormAddComponents(myForm, b1, b2, b3, NULL); 2436 b_res = newtRunForm(myForm);2437 2432 newtFormDestroy(myForm); 2438 2433 newtPopWindow(); … … 2886 2881 mr_getline(tmp, stdin); 2887 2882 output = tmp[0]; 2888 free(tmp);2883 mr_free(tmp); 2889 2884 } 2890 2885 return (output); -
branches/3.1/mondo/src/mondorestore/mondo-rstr-tools.c
r2937 r3147 80 80 char *incoming = NULL; 81 81 char *question = NULL; 82 char *q; 82 83 83 84 assert_string_is_neither_NULL_nor_zerolength(infname); … … 209 210 if (is_this_device_mounted(g_isodir_device)) { 210 211 log_to_screen("WARNING - isodir is already mounted"); 211 already_mounted = TRUE;212 212 } else { 213 213 mr_asprintf(mount_isodir_command, "mount %s", g_isodir_device); … … 1082 1082 char *tmp; 1083 1083 char *tmp1 = NULL; 1084 char *q; 1084 1085 int res = 0; 1085 1086 pid_t pid; … … 1088 1089 malloc_string(tmp); 1089 1090 1090 getcwd(tmp, MAX_STR_LEN); 1091 chdir(bkpinfo->tmpdir); 1091 if (getcwd(tmp, MAX_STR_LEN) == NULL) { 1092 // FIXME 1093 } 1094 if (chdir(bkpinfo->tmpdir)) { 1095 // FIXME 1096 } 1092 1097 log_msg(1, "chdir(%s)", bkpinfo->tmpdir); 1093 1098 log_to_screen("Extracting filelist and biggielist from media..."); … … 1116 1121 } 1117 1122 } 1118 chdir(tmp); 1123 if (chdir(tmp)) { 1124 // FIXME 1125 } 1119 1126 1120 1127 log_msg(2, "Forking"); … … 1147 1154 unlink(MINDI_CACHE"/filelist.full.gz"); 1148 1155 if (g_text_mode) { 1149 printf("Restore which directory? --> "); 1150 mr_getline(tmp1, stdin); 1151 toggle_path_selection(filelist, tmp1, TRUE); 1152 if (strlen(tmp1) == 0) { 1156 q = NULL; 1157 while (q == NULL) { 1158 printf("Restore which directory? --> "); 1159 mr_getline(q, stdin); 1160 } 1161 toggle_path_selection(filelist, q, TRUE); 1162 if (strlen(q) == 0) { 1153 1163 res = 1; 1154 1164 } else { 1155 1165 res = 0; 1156 1166 } 1157 mr_free( tmp1);1167 mr_free(q); 1158 1168 } else { 1159 1169 res = edit_filelist(filelist); … … 1229 1239 newtSuspend(); 1230 1240 } 1231 (void)system("chroot " MNT_RESTORING);1241 paranoid_system("chroot " MNT_RESTORING); 1232 1242 if (!g_text_mode) { 1233 1243 newtResume(); … … 1271 1281 backup_crucial_file(MNT_RESTORING, "/boot/grub/menu.lst"); 1272 1282 backup_crucial_file(MNT_RESTORING, "/boot/grub/grub.cfg"); 1283 backup_crucial_file(MNT_RESTORING, "/boot/grub2/grub.cfg"); 1273 1284 backup_crucial_file(MNT_RESTORING, "/etc/lilo.conf"); 1274 1285 backup_crucial_file(MNT_RESTORING, "/etc/elilo.conf"); 1275 1286 backup_crucial_file(MNT_RESTORING, "/boot/grub/device.map"); 1287 backup_crucial_file(MNT_RESTORING, "/boot/grub2/device.map"); 1276 1288 backup_crucial_file(MNT_RESTORING, "/etc/mtab"); 1277 1289 device = read_cfg_var(MINDI_CACHE"/mondorestore.cfg", "bootloader.device"); … … 1385 1397 char *p = NULL; 1386 1398 1387 int res = 0;1388 1399 bool done; 1400 int res = 0; /* FALSE */ 1401 bool mntlistchg = FALSE; 1402 FILE *fin = NULL; 1389 1403 1390 1404 assert_string_is_neither_NULL_nor_zerolength(bd); … … 1397 1411 0, 1398 1412 "Modifying fstab, mtab, device.map and menu.lst/grub.cfg, and running GRUB... "); 1413 /* Did we changed the mountlist ? If yes, then force editing conf files */ 1414 if ((fin = fopen(MONDO_MNTLISTCHG, "r")) != NULL) { 1415 mntlistchg = TRUE; 1416 } 1399 1417 for (done = FALSE; !done;) { 1400 1418 p = popup_and_get_string("Boot device", "Please confirm/enter the boot device. If in doubt, try /dev/hda", boot_device); … … 1406 1424 continue; 1407 1425 } 1408 mr_asprintf(command, "stabgrub-me %s", p); 1409 mr_free(p); 1410 1411 res = run_program_and_log_output(command, 1); 1412 mr_free(command); 1413 1414 if (res) { 1426 /* Only try to adapt grub here first if the mountlist wasn't changed before */ 1427 if (! mntlistchg) { 1428 mr_asprintf(command, "stabgrub-me %s", p); 1429 mr_free(p); 1430 1431 res = run_program_and_log_output(command, 1); 1432 mr_free(command); 1433 } 1434 1435 if ((res) || (mntlistchg)){ 1415 1436 popup_and_OK 1416 1437 ("GRUB installation failed. You will now edit fstab, mtab, device.map and menu.lst/grub.cfg in order to fix grub install"); 1438 } else { 1439 popup_and_OK("The mountlist was changed. You will now edit fstab, mtab, device.map and menu.lst/grub.cfg in order to fix grub install"); 1440 } 1417 1441 if (!g_text_mode) { 1418 1442 newtSuspend(); … … 1426 1450 } else if (does_file_exist(MNT_RESTORING"/boot/grub/grub.cfg")) { 1427 1451 sprintf(tmp, "chroot %s %s /boot/grub/grub.cfg", MNT_RESTORING, editor); 1452 } else if (does_file_exist(MNT_RESTORING"/boot/grub2/grub.cfg")) { 1453 sprintf(tmp, "chroot %s %s /boot/grub2/grub.cfg", MNT_RESTORING, editor); 1428 1454 } 1429 1455 paranoid_system(tmp); 1430 sprintf(tmp, "chroot %s %s /boot/grub/device.map", MNT_RESTORING, editor); 1456 if (does_file_exist(MNT_RESTORING"/boot/grub/device.map")) { 1457 sprintf(tmp, "chroot %s %s /boot/grub/device.map", MNT_RESTORING, editor); 1458 } else if (does_file_exist(MNT_RESTORING"/boot/grub2/device.map")) { 1459 sprintf(tmp, "chroot %s %s /boot/grub2/device.map", MNT_RESTORING, editor); 1460 } 1431 1461 paranoid_system(tmp); 1432 1462 if (!g_text_mode) { … … 1439 1469 ("GRUB installation failed. Please fix the conf files so that a manual install using 'grub-install' or similar command works. You are now chroot()'ed to your restored system. Please type 'exit' when you are done."); 1440 1470 newtSuspend(); 1441 system("chroot " MNT_RESTORING);1471 paranoid_system("chroot " MNT_RESTORING); 1442 1472 newtResume(); 1443 1473 popup_and_OK("Thank you."); … … 1501 1531 ("Because of bugs in GRUB's own installer, GRUB was not installed properly. Please install the boot loader manually now, using this chroot()'ed shell prompt. Type 'exit' when you have finished."); 1502 1532 newtSuspend(); 1503 system("chroot " MNT_RESTORING);1533 paranoid_system("chroot " MNT_RESTORING); 1504 1534 newtResume(); 1505 1535 popup_and_OK("Thank you."); … … 1846 1876 FILE *fout; 1847 1877 char *incoming = NULL; 1878 char *q; 1848 1879 1849 1880 assert_string_is_neither_NULL_nor_zerolength(output_file); … … 1935 1966 "in preparation for the post-restoration reboot.", 1936 1967 "", mountlist->entries); 1937 chdir("/"); 1968 if (chdir("/")) { 1969 // FIXME 1970 } 1938 1971 for (i = 0; 1939 1972 i < 10 … … 2032 2065 /* @} - end restoreUtilityGroup */ 2033 2066 2034 void wait_until_software_raids_are_prepped(char *mdstat_file, 2035 int wait_for_percentage) 2067 void wait_until_software_raids_are_prepped(char *mdstat_file, int wait_for_percentage) 2036 2068 { 2037 2069 struct raidlist_itself *raidlist; 2038 int unfinished_mdstat_devices = 9999, i; 2070 int unfinished_mdstat_devices = 9999; 2071 int i = 0; 2039 2072 char *screen_message = NULL; 2040 2073 … … 2045 2078 while (unfinished_mdstat_devices > 0) { 2046 2079 // FIXME: Prefix '/dev/' should really be dynamic! 2047 if (parse_mdstat( raidlist, "/dev/")) {2080 if (parse_mdstat(MDSTAT_FILE, raidlist, "/dev/")) { 2048 2081 log_to_screen("Sorry, cannot read %s", MDSTAT_FILE); 2049 2082 log_msg(1,"Sorry, cannot read %s", MDSTAT_FILE); 2050 2083 return; 2051 2084 } 2052 for (unfinished_mdstat_devices = i =0; i <= raidlist->entries; i++) {2085 for (unfinished_mdstat_devices = 0; i <= raidlist->entries; i++) { 2053 2086 if (raidlist->el[i].progress < wait_for_percentage) { 2054 2087 unfinished_mdstat_devices++; … … 2067 2100 sleep(2); 2068 2101 // FIXME: Prefix '/dev/' should really be dynamic! 2069 if (parse_mdstat( raidlist, "/dev/")) {2102 if (parse_mdstat(MDSTAT_FILE, raidlist, "/dev/")) { 2070 2103 break; 2071 2104 } -
branches/3.1/mondo/src/mondorestore/mondoprep.h
r2316 r3147 82 82 83 83 84 char *truncate_to_drive_name(c har *partition);84 char *truncate_to_drive_name(const char *partition); 85 85 void create_mountlist_for_drive(struct mountlist_itself *mountlist, 86 86 char *drive_name, -
branches/3.1/mondo/src/mondorestore/mondorestore.c
r2937 r3147 63 63 */ 64 64 bool g_ISO_restore_mode = FALSE; /* are we in Iso Mode? */ 65 66 /* Whether we should fail immediately at first error */ 67 bool g_fail_immediately = FALSE; 65 68 66 69 /** … … 618 621 ("Label/Identify your ext2/ext3/ext4 partitions if necessary?")) { 619 622 mvaddstr_and_log_it(g_currentY, 0, 620 "Using tune2fs to identify your ext2,3,4 partitions");623 "Using tune2fs/tune4fs to identify your ext2,3,4 partitions"); 621 624 if (does_file_exist("/tmp/fstab.new")) { 622 625 mr_asprintf(fstab_fname, "/tmp/fstab.new"); … … 710 713 711 714 712 /* MONDO - saving your a$$since Feb 18th, 2000 */715 /* MONDO - saving your systems since Feb 18th, 2000 */ 713 716 714 717 … … 730 733 int retval = 0; 731 734 int res = 0; 732 bool boot_loader_installed = FALSE;733 735 char *tmp = NULL; 734 736 char *tmp1 = NULL; … … 829 831 log_msg(1, 830 832 "Great! Boot loader was installed. No need for msg at end."); 831 boot_loader_installed = TRUE;832 833 } 833 834 clean_blkid(); … … 836 837 mvaddstr_and_log_it(g_currentY, 837 838 0, 838 "Using tune2fs to identify your ext2,3partitions");839 "Using tune2fs/tune4fs to identify your ext2,3,4 partitions"); 839 840 840 841 mr_asprintf(tmp, "label-partitions-as-necessary %s < /tmp/fstab >> %s 2>> %s", MINDI_CACHE"/mountlist.txt", MONDO_LOGFILE, MONDO_LOGFILE); … … 1601 1602 1602 1603 if (use_star) { 1603 mr_asprintf(command, "star -x -force-remove - U " STAR_ACL_SZ " errctl=file=%s", tarball_fname);1604 mr_asprintf(command, "star -x -force-remove -sparse -U " STAR_ACL_SZ " file=%s", tarball_fname); 1604 1605 if (strstr(tarball_fname, ".bz2")) { 1605 1606 mr_strcat(command, " -bz"); … … 1639 1640 } 1640 1641 1641 if (g_getfattr) { 1642 log_msg(1, "Setting fattr list %s", xattr_fname); 1643 if (length_of_file(xattr_fname) > 0) { 1644 res = set_fattr_list(filelist_subset_fname, xattr_fname); 1645 if (res) { 1646 log_to_screen("Errors occurred while setting extended attributes"); 1647 } else { 1648 log_msg(1, "I set xattr OK"); 1642 if (! use_star) { 1643 if (g_getfattr) { 1644 log_msg(1, "Setting fattr list %s", xattr_fname); 1645 if (length_of_file(xattr_fname) > 0) { 1646 res = set_fattr_list(filelist_subset_fname, xattr_fname); 1647 if (res) { 1648 log_to_screen("Errors occurred while setting extended attributes"); 1649 } else { 1650 log_msg(1, "I set xattr OK"); 1651 } 1652 retval += res; 1649 1653 } 1650 retval += res; 1651 } 1652 } 1653 if (g_getfacl) { 1654 log_msg(1, "Setting acl list %s", acl_fname); 1655 if (length_of_file(acl_fname) > 0) { 1656 res = set_acl_list(filelist_subset_fname, acl_fname); 1657 if (res) { 1658 log_to_screen 1659 ("Errors occurred while setting access control lists"); 1660 } else { 1661 log_msg(1, "I set ACL OK"); 1654 } 1655 if (g_getfacl) { 1656 log_msg(1, "Setting acl list %s", acl_fname); 1657 if (length_of_file(acl_fname) > 0) { 1658 res = set_acl_list(filelist_subset_fname, acl_fname); 1659 if (res) { 1660 log_to_screen("Errors occurred while setting access control lists"); 1661 } else { 1662 log_msg(1, "I set ACL OK"); 1663 } 1664 retval += res; 1662 1665 } 1663 retval += res; 1664 } 1665 } 1666 if (retval) { 1666 } 1667 } else { 1668 retval = res; 1669 } 1670 // Be verbose for star 1671 if (retval || use_star) { 1667 1672 mr_asprintf(command, "cat %s >> %s", temp_log, MONDO_LOGFILE); 1668 system(command);1673 paranoid_system(command); 1669 1674 paranoid_free(command); 1670 1675 1671 log_msg(2, "Errors occurred while processing fileset #%d", 1672 current_tarball_number); 1676 if (retval) { 1677 log_msg(2, "Errors occurred while processing fileset #%d", current_tarball_number); 1678 } 1673 1679 } else { 1674 1680 log_msg(2, "Fileset #%d processed OK", current_tarball_number); … … 1782 1788 if (strstr(tarball_fname, ".star.")) { 1783 1789 use_star = TRUE; 1784 mr_asprintf(command, "star - t file=%s %s", afio_fname, executable);1790 mr_asprintf(command, "star -sparse -t file=%s %s", afio_fname, executable); 1785 1791 } else { 1786 1792 use_star = FALSE; … … 1816 1822 if (strstr(tarball_fname, ".star.")) { 1817 1823 // star 1818 mr_asprintf(command, "star - x file=%s %s", afio_fname, executable);1824 mr_asprintf(command, "star -sparse -x file=%s %s", afio_fname, executable); 1819 1825 if (filelist) { 1820 1826 mr_strcat(command, " list=%s", filelist_subset_fname); … … 2216 2222 res = read_header_block_from_stream(&biggie_size, biggie_fname, &ctrl_chr); 2217 2223 if (ctrl_chr == BLK_START_EXTENDED_ATTRIBUTES) { 2218 res = 2219 read_EXAT_files_from_tape(&biggie_size, biggie_fname, &ctrl_chr, xattr_fname, acl_fname); 2224 res = read_EXAT_files_from_tape(&biggie_size, biggie_fname, &ctrl_chr, xattr_fname, acl_fname); 2220 2225 } 2221 2226 … … 2354 2359 mr_free(tmp); 2355 2360 2356 chdir(bkpinfo->restore_path); /* I don't know why this is needed _here_ but it seems to be. -HR, 02/04/2002 */ 2361 if (chdir(bkpinfo->restore_path)) { /* I don't know why this is needed _here_ but it seems to be. -HR, 02/04/2002 */ 2362 //FIXME 2363 } 2357 2364 2358 2365 run_program_and_log_output("pwd", 5); … … 2470 2477 log_msg(2, "restore_everything() --- starting"); 2471 2478 g_current_media_number = 1; 2472 getcwd(cwd, MAX_STR_LEN - 1); 2479 if (getcwd(cwd, MAX_STR_LEN - 1)) { 2480 // FIXME 2481 } 2473 2482 mr_asprintf(tmp, "mkdir -p %s", bkpinfo->restore_path); 2474 2483 run_program_and_log_output(tmp, FALSE); … … 2476 2485 2477 2486 log_msg(1, "Changing dir to %s", bkpinfo->restore_path); 2478 chdir(bkpinfo->restore_path); 2479 getcwd(newpath, MAX_STR_LEN - 1); 2487 if (chdir(bkpinfo->restore_path)) { 2488 //FIXME 2489 } 2490 if (getcwd(newpath, MAX_STR_LEN - 1)) { 2491 // FIXME 2492 } 2480 2493 log_msg(1, "path is now %s", newpath); 2481 2494 log_msg(1, "restoring everything"); … … 2511 2524 resB = restore_all_biggiefiles_from_CD(filelist); 2512 2525 } 2513 chdir(cwd); 2526 if (chdir(cwd)) { 2527 //FIXME 2528 } 2514 2529 if (resA + resB) { 2515 2530 log_to_screen("Errors occurred while data was being restored."); … … 2654 2669 if (argc == 2 && strcmp(argv[1], "--edit-mountlist") == 0) { 2655 2670 #ifdef __FreeBSD__ 2656 system("mv -f /tmp/raidconf.txt /etc/raidtab");2671 paranoid_system("mv -f /tmp/raidconf.txt /etc/raidtab"); 2657 2672 if (!does_file_exist("/etc/raidtab")) 2658 system("vinum printconfig > /etc/raidtab");2673 paranoid_system("vinum printconfig > /etc/raidtab"); 2659 2674 #endif 2660 2675 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 2661 2676 res = let_user_edit_the_mountlist(mountlist, raidlist); 2662 2677 #ifdef __FreeBSD__ 2663 system("mv -f /etc/raidtab /tmp/raidconf.txt");2678 paranoid_system("mv -f /etc/raidtab /tmp/raidconf.txt"); 2664 2679 #endif 2665 2680 paranoid_MR_finish(res); … … 2734 2749 2735 2750 if (argc == 3 && strcmp(argv[1], "--mdconv") == 0) { 2736 finish(create_raidtab_from_mdstat( argv[2]));2751 finish(create_raidtab_from_mdstat(MDSTAT_FILE,argv[2])); 2737 2752 } 2738 2753 … … 2820 2835 mr_asprintf(tmp, "sshfs -o ro %s /tmp/isodir", bkpinfo->netfs_mount); 2821 2836 } 2822 } else { 2823 if (bkpinfo->netfs_user) { 2824 mr_asprintf(tmp, "mount %s@%s -o nolock,ro /tmp/isodir", bkpinfo->netfs_user,bkpinfo->netfs_mount); 2837 } else { 2838 if (strstr(bkpinfo->netfs_proto, "smbfs")) { 2839 if (bkpinfo->netfs_user) { 2840 mr_asprintf(tmp, "mount -t cifs %s /tmp/isodir -o user=%s,nolock,ro ", bkpinfo->netfs_mount,bkpinfo->netfs_user); 2841 } else { 2842 mr_asprintf(tmp, "mount -t cifs %s /tmp/isodir -o nolock,ro ", bkpinfo->netfs_mount); 2843 } 2825 2844 } else { 2826 mr_asprintf(tmp, "mount %s -o nolock,ro /tmp/isodir", bkpinfo->netfs_mount); 2845 if (bkpinfo->netfs_user) { 2846 mr_asprintf(tmp, "mount %s@%s -o nolock,ro /tmp/isodir", bkpinfo->netfs_user,bkpinfo->netfs_mount); 2847 } else { 2848 mr_asprintf(tmp, "mount %s -o nolock,ro /tmp/isodir", bkpinfo->netfs_mount); 2849 } 2827 2850 } 2828 2851 } … … 2956 2979 if (strstr(bkpinfo->tmpdir,"mondo.tmp.") != NULL) { 2957 2980 mr_asprintf(tmp, "rm -Rf %s", bkpinfo->tmpdir); 2958 system(tmp);2981 paranoid_system(tmp); 2959 2982 mr_free(tmp); 2960 2983 } -
branches/3.1/mondo/src/restore-scripts/mondo/grub-MR
r2937 r3147 107 107 if [ "$MNT_RESTORING" ] ; then 108 108 if [ -x $MNT_RESTORING/usr/sbin/grub-install.unsupported ]; then 109 echo "Now I'll use grub-install.unsupportedin chroot" >> $LOGFILE110 chroot $MNT_RESTORING /usr/sbin/grub-install .unsupported $1>> $LOGFILE 2>> $LOGFILE109 echo "Now I'll use OpenSuSE/SLES new grub-install in chroot" >> $LOGFILE 110 chroot $MNT_RESTORING /usr/sbin/grub-install >> $LOGFILE 2>> $LOGFILE 111 111 res=$? 112 echo "grub-install .unsupportedin chroot returned $res" >> $LOGFILE112 echo "grub-install in chroot returned $res" >> $LOGFILE 113 113 fi 114 114 else 115 115 if [ -x /usr/sbin/grub-install.unsupported ]; then 116 echo "Now I'll use grub-install.unsupportedlocally" >> $LOGFILE117 /usr/sbin/grub-install .unsupported $1>> $LOGFILE 2>> $LOGFILE116 echo "Now I'll use OpenSuSE/SLES new grub-install locally" >> $LOGFILE 117 /usr/sbin/grub-install >> $LOGFILE 2>> $LOGFILE 118 118 res=$? 119 echo "grub-install .unsupportedreturned $res" >> $LOGFILE119 echo "grub-install returned $res" >> $LOGFILE 120 120 fi 121 121 fi … … 124 124 echo "Now I'll use grub-install" >> $LOGFILE 125 125 if [ "$MNT_RESTORING" ] ; then 126 echo "Launching: chroot $MNT_RESTORING grub-install $1" >> $LOGFILE 126 127 chroot $MNT_RESTORING grub-install $1 >> $LOGFILE 2>> $LOGFILE 127 128 res=$? 128 129 else 130 echo "Launching: grub-install $1" >> $LOGFILE 129 131 grub-install $1 >> $LOGFILE 2>> $LOGFILE 130 132 res=$? 131 133 fi 132 134 echo "grub-install returned $res" >> $LOGFILE 135 [ "$res" -eq "0" ] && exit 0 136 137 138 echo "Now I'll use grub2-install" >> $LOGFILE 139 if [ "$MNT_RESTORING" ] ; then 140 chroot $MNT_RESTORING grub2-install $1 >> $LOGFILE 2>> $LOGFILE 141 res=$? 142 else 143 grub2-install $1 >> $LOGFILE 2>> $LOGFILE 144 res=$? 145 fi 146 echo "grub2-install returned $res" >> $LOGFILE 133 147 [ "$res" -eq "0" ] && exit 0 134 148 … … 190 204 elif [ -f "/mnt/RESTORING/boot/grub/grub.cfg" ]; then 191 205 grep -vE '^#' /boot/grub/grub.cfg > /mnt/RESTORING/tmp/grub.conf 206 elif [ -f "/mnt/RESTORING/boot/grub2/grub.cfg" ]; then 207 grep -vE '^#' /boot/grub2/grub.cfg > /mnt/RESTORING/tmp/grub.conf 192 208 else 193 209 echo "Unable to find Grub conf file" | tee -a $LOGFILE -
branches/3.1/mondo/src/restore-scripts/mondo/label-partitions-as-necessary
r2462 r3147 28 28 else 29 29 if [ "$format" = "ext2" ] || [ "$format" = "ext3" ] || [ "$format" = "ext4" ]; then 30 command="tune2fs $opttun $label $mountpt" 30 if [ "$format" = "ext4" ] && [ -x "/sbin/tune4fs" ]; then 31 command="/sbin/tune4fs $opttun $label $mountpt" 32 else 33 command="tune2fs $opttun $label $mountpt" 34 fi 31 35 LogIt "Running $command" 32 36 $command … … 38 42 if [ "$opttun" = "-U" ]; then 39 43 LogIt "Creating uuid $label on swap partition $mountpt" 40 echo -n "$label" | perl -ne 's/-//g;chomp;print pack "H*",$_' | dd conv=notrunc "of=$mountpt" obs=1 seek=1036 44 if [ -x "/sbin/swaplabel" ]; then 45 /sbin/swaplabel $opttun $label $mountpt 46 else 47 echo -n "$label" | perl -ne 's/-//g;chomp;print pack "H*",$_' | dd conv=notrunc "of=$mountpt" obs=1 seek=1036 48 fi 41 49 else 42 command="mkswap $opttun $label $mountpt" 50 if [ -x "/sbin/swaplabel" ]; then 51 command="/sbin/swaplabel $opttun $label $mountpt" 52 else 53 command="mkswap $opttun $label $mountpt" 54 fi 43 55 LogIt "Running $command" 44 56 $command 45 57 fi 46 58 else 47 LogIt "I am NOT going to run tune2 fs/reiserfstune: the partition is format '$format', which doesn't like tune2fs/reiserfstune anyway"59 LogIt "I am NOT going to run tune2|4fs/reiserfstune: the partition is format '$format', which doesn't like tune2|4fs/reiserfstune anyway" 48 60 fi 49 61 fi … … 53 65 # --------------------------------------------- 54 66 55 LogIt "Identifying your drives with tune2fs"67 LogIt "Identifying your drives with FS tune tool" 56 68 if [ "$#" -ne "1" ] ; then 57 69 LogIt "label-partitions-as-necessary $MINDI_CACHE/mountlist.txt < /tmp/fstab.new" 1 -
branches/3.1/mondo/src/restore-scripts/mondo/make-me-bootable
r2196 r3147 2 2 3 3 4 if [ "$#" -ne " 1" ] && [ "$#" -ne "2" ] ; then5 echo "make-me-bootable <fname> (dummy)"4 if [ "$#" -ne "2" ] && [ "$#" -ne "3" ] ; then 5 echo "make-me-bootable <fname> <drive> [noaction]" 6 6 exit 1 7 7 fi 8 8 9 d ummy=$29 drivetouse=$2 10 10 boot_drv="" 11 11 boot_part="" 12 12 root_drv="" 13 13 root_part="" 14 if [ ! "$LOGFILE" ]; then 15 LOGFILE="/tmp/mondorestore2.log" 16 fi 17 dummy="$3" 14 18 15 HAVE_ACTIVE="false" 19 activepart=`parted2fdisk -l $drivetouse | tr -s '\t' ' ' | grep "$drivetouse" | grep '*' | cut -d' ' -f1` 20 16 21 for i in `cat $1 | tr -s '\t' ' ' | cut -d' ' -f1 | grep -vE "/dev/fd|none|#"` ; do 17 mountpt=`grep "$i " $1 | tr -s '\t' ' ' | cut -d' ' -f2`18 format=`grep "$i " $1 | tr -s '\t' ' ' | cut -d' ' -f3`19 22 # Warning wrong if LVM ! 20 23 drive=`echo $i | sed -e 's/[0-9]*$//' -e 's/\([0-9]\)p$/\1/'` 21 partno=`echo $i | sed -e 's/^.*[^0-9]\([0-9]*\)$/\1/'` 24 if [ "$drivetouse" = "$drive" ]; then 25 # We can continue as this is the drive we ned to work on 26 partno=`echo $i | sed -e 's/^.*[^0-9]\([0-9]*\)$/\1/'` 27 mountpt=`grep "$i " $1 | tr -s '\t' ' ' | cut -d' ' -f2` 22 28 23 if [ "$HAVE_ACTIVE" = "false" ] && [ "`parted2fdisk -l $drive | tr -s '\t' ' ' | grep "$i " | grep -v "*"`" ] ; then24 29 if [ "$mountpt" = "/" ] ; then 25 30 root_drv=$drive 26 root_part=$partno31 root_part=$partno 27 32 elif [ "$mountpt" = "/boot" ] ; then 28 33 boot_drv=$drive … … 46 51 47 52 if [ "$drive" ] ; then 53 if [ "$partno" = "0" ] || [ ! "$partno" ] ; then 54 partno="1" 55 fi 56 cmd="" 57 for p in "$activepart"; do 58 # First desactivate active partitions (coming from previous usage) 59 cmd="${cmd}a\n$p\n" 60 if [ "$dummy" != "" ] ; then 61 echo "Will desactivate $p on $drive" >> $LOGFILE 62 fi 63 done 64 # Then activate the one which should 48 65 if [ "$dummy" != "" ] ; then 49 if [ "$partno" = "0" ] || [ ! "$partno" ] ; then 50 partno="1" 51 fi 52 echo "$partno" 53 else 54 echo -en "a\n$partno\nw\n" | parted2fdisk $drive >> $LOGFILE 2>> $LOGFILE 55 fi 66 echo "Would activate $partno on $drive" >> $LOGFILE 67 else 68 echo -en "${cmd}a\n$partno\np\nw\n" | parted2fdisk $drive >> $LOGFILE 2>> $LOGFILE 69 fi 56 70 fi 57 71 exit 0 -
branches/3.1/mondo/src/restore-scripts/mondo/stabgrub-me
r2508 r3147 57 57 LocateOldGrub() { 58 58 old_grubconf="" 59 if [ -f "/mnt/RESTORING/boot/grub/menu.lst" ] || [ -f "/mnt/RESTORING/boot/grub/grub.cfg" ] ; then59 if [ -f "/mnt/RESTORING/boot/grub/menu.lst" ] || [ -f "/mnt/RESTORING/boot/grub/grub.cfg" ] || [ -f "/mnt/RESTORING/boot/grub2/grub.cfg" ] ; then 60 60 LogIt "No need for menu.lst/grub.cfg search." 2 61 61 if [ -f "/mnt/RESTORING/boot/grub/menu.lst" ]; then … … 63 63 elif [ -f "/mnt/RESTORING/boot/grub/grub.cfg" ]; then 64 64 old_grubconf=/mnt/RESTORING/boot/grub/grub.cfg 65 elif [ -f "/mnt/RESTORING/boot/grub2/grub.cfg" ]; then 66 old_grubconf=/mnt/RESTORING/boot/grub2/grub.cfg 65 67 fi 66 68 if [ -L "$old_grubconf" ] ; then … … 68 70 if [ _"`echo $l | cut -c1`" = _"/" ]; then 69 71 # If readlink gives an absolute path it's related to the chroot 70 old_grubconf=/mnt/RESTORING/$l72 old_grubconf=/mnt/RESTORING/$l 71 73 else 72 74 # If readlink gives a relative path, it's in the same dir 73 old_grubconf=/mnt/RESTORING/boot/grub/$l 75 d=`dirname "$old_grubconf"` 76 old_grubconf=$d/$l 74 77 fi 75 fi 78 fi 76 79 return 0 77 80 fi … … 128 131 elif [ -f /mnt/RESTORING/boot/grub/grub.cfg ]; then 129 132 new_grubconf=/mnt/RESTORING/boot/grub/grub.cfg.NEW 133 elif [ -f /mnt/RESTORING/boot/grub2/grub.cfg ]; then 134 new_grubconf=/mnt/RESTORING/boot/grub2/grub.cfg.NEW 130 135 fi 131 136 # change back to /tmp if /mnt/RESTORING/etc be problematic -
branches/3.1/mondo/test/Makefile.am
r2310 r3147 3 3 ## The program 4 4 sbin_PROGRAMS = mrtest_mountlist mrtest_truncname mrtest_conf mrtest_mem mrtest_msg mrtest_string 5 mrtestdir = $(pkglibdir)/test 6 mrtest_PROGRAMS = mrtest_mountlist mrtest_truncname mrtest_stresc 5 7 mrtest_mountlist_SOURCES = test-mountlist.c ${top_builddir}/src/mondorestore/mondo-prep.c ${top_builddir}/src/mondorestore/mondo-rstr-newt.c ${top_builddir}/src/mondorestore/mondo-rstr-tools.c 6 8 mrtest_mountlist_LDADD = ${top_builddir}/src/common/libmondo.a ${top_builddir}/src/lib/libmr.a @MONDORESTORE_STATIC@ … … 15 17 mrtest_string_SOURCES = test-string.c 16 18 mrtest_string_LDADD = ${top_builddir}/src/common/libmondo.a ${top_builddir}/src/lib/libmr.a @MONDORESTORE_STATIC@ 19 mrtest_stresc_SOURCES = test-mr_stresc.c 20 mrtest_stresc_LDADD = ${top_builddir}/src/lib/libmr.a @MONDORESTORE_STATIC@ -
branches/3.1/mondo/test/test-mountlist.c
r2623 r3147 3 3 * 4 4 * Test program for mountlist management at restore time 5 * C n be used on host system with valgrind easier than with mondorestore5 * Can be used on host system with valgrind easier than with mondorestore 6 6 */ 7 7 #include <stdio.h> … … 12 12 #include "../mondorestore/mondorestore.h" 13 13 #include "../mondorestore/mr-externs.h" 14 15 #define RAIDTAB_TEST "/tmp/raidtab" 16 #define MOUNTLIST_TEST "/tmp/mountlist.txt" 14 17 15 18 extern void twenty_seconds_til_yikes(void); … … 23 26 extern int g_partition_table_locked_up; 24 27 extern int g_noof_rows; 28 29 /* Whether we should fail immediately at first error */ 30 bool g_fail_immediately = FALSE; 25 31 26 32 bool g_ISO_restore_mode = FALSE; /* are we in Iso Mode? */ … … 64 70 65 71 setup_newt_stuff(); 72 mr_asprintf(&g_mountlist_fname, MOUNTLIST_TEST); 66 73 log_it("before mountlist"); 67 74 load_mountlist(mountlist, MINDI_CACHE"/mountlist.txt"); … … 69 76 resize_mountlist_proportionately_to_suit_new_drives(mountlist); 70 77 log_it("after resize_mountlist_proportionately_to_suit_new_drives"); 71 load_raidtab_into_raidlist(raidlist, RAIDTAB_ FNAME);78 load_raidtab_into_raidlist(raidlist, RAIDTAB_TEST); 72 79 log_it("after load_raidtab_into_raidlist"); 73 80 edit_mountlist(MINDI_CACHE"/mountlist.txt", mountlist, raidlist); … … 78 85 mr_free(flaws_str); 79 86 87 log_it("before check raidlist content"); 88 log_it("after check raidlist content"); 89 90 log_it("before create mdadm dev"); 91 create_raid_device_via_mdadm(raidlist,"/dev/md0",FALSE); 92 create_raid_device_via_mdadm(raidlist,"/dev/md1",FALSE); 93 log_it("after create mdadm dev"); 94 95 free(mountlist); 96 free(raidlist); 80 97 mr_free(MONDO_LOGFILE); 98 mr_free(g_mountlist_fname); 81 99 exit(0); 82 100 } -
branches/3.1/mondo/test/test-truncname.c
r2623 r3147 23 23 extern int g_noof_rows; 24 24 25 /* Whether we should fail immediately at first error */ 26 bool g_fail_immediately = FALSE; 27 25 28 bool g_ISO_restore_mode = FALSE; /* are we in Iso Mode? */ 26 29 bool g_I_have_just_nuked = FALSE; … … 37 40 38 41 extern char *MONDO_LOGFILE; 39 extern char *truncate_to_drive_name(c har *);42 extern char *truncate_to_drive_name(const char *); 40 43 /* We don't have a cleanup function yet */ 41 44 void (*mr_cleanup)(int) = NULL; -
branches/3.1/website/downloads.shtml
r2937 r3147 11 11 <h2>This is Free Software</h2> 12 12 </div> 13 <p>Copyright (c) 2000-20 0613 <p>Copyright (c) 2000-2013 14 14 Mondo Rescue is a copyrighted work, written collectively by many 15 15 <a href="/thanks.shtml">contributors</a>, delivered under the GPL.</p> … … 35 35 <ul> 36 36 <li>Update times: Master site</li> 37 <li>Internet Bandwith: 4Mbit</li>37 <li>Internet Bandwith: 10Mbit</li> 38 38 </ul> 39 39 </li> … … 56 56 <li><i>USA</i>:</li> 57 57 <ul> 58 <li>muskokamug.org: 59 <a href="http://mondorescue.muskokamug.org/">Ftp site (http)</a> 58 <li>Peter Clark: 59 <a href="http://mondo.mirror.pclark.com/">Web site</a>, 60 <a href="ftp://mondo.mirror.pclark.com/pub/mondorescue/">Ftp site (ftp)</a> 61 <a href="http://mondo.mirror.pclark.com/ftp/pub/mondorescue/">Ftp site (http)</a> 60 62 <ul> 61 <li>Update times: multiple times/day</li> 63 <li>Update times: 1 time/day</li> 64 <li>Internet Bandwith: 8 Mbit</li> 62 65 </ul> 63 66 </li> … … 113 116 <ul> 114 117 <li>RedHat <a href="ftp://ftp.mondorescue.org/redhat/7.3">7.3</a>, <a href="ftp://ftp.mondorescue.org/redhat/9">9</a>.</li> 115 <li>Fedora <a href="ftp://ftp.mondorescue.org/fedora/4">Core 4</a>, <a href="ftp://ftp.mondorescue.org/fedora/5">Core 5</a>, <a href="ftp://ftp.mondorescue.org/fedora/6">Core 6</a>, <a href="ftp://ftp.mondorescue.org/fedora/7">7</a>, <a href="ftp://ftp.mondorescue.org/fedora/8">8</a>, <a href="ftp://ftp.mondorescue.org/fedora/9">9</a>, <a href="ftp://ftp.mondorescue.org/fedora/10">10</a>, <a href="ftp://ftp.mondorescue.org/fedora/11">11</a>, <a href="ftp://ftp.mondorescue.org/fedora/12">12</a>, <a href="ftp://ftp.mondorescue.org/fedora/13">13</a>, <a href="ftp://ftp.mondorescue.org/fedora/14">14</a>, <a href="ftp://ftp.mondorescue.org/fedora/15">15</a> .</li>118 <li>Fedora <a href="ftp://ftp.mondorescue.org/fedora/4">Core 4</a>, <a href="ftp://ftp.mondorescue.org/fedora/5">Core 5</a>, <a href="ftp://ftp.mondorescue.org/fedora/6">Core 6</a>, <a href="ftp://ftp.mondorescue.org/fedora/7">7</a>, <a href="ftp://ftp.mondorescue.org/fedora/8">8</a>, <a href="ftp://ftp.mondorescue.org/fedora/9">9</a>, <a href="ftp://ftp.mondorescue.org/fedora/10">10</a>, <a href="ftp://ftp.mondorescue.org/fedora/11">11</a>, <a href="ftp://ftp.mondorescue.org/fedora/12">12</a>, <a href="ftp://ftp.mondorescue.org/fedora/13">13</a>, <a href="ftp://ftp.mondorescue.org/fedora/14">14</a>, <a href="ftp://ftp.mondorescue.org/fedora/15">15</a>, <a href="ftp://ftp.mondorescue.org/fedora/16">16</a>, <a href="ftp://ftp.mondorescue.org/fedora/17">17</a>, <a href="ftp://ftp.mondorescue.org/fedora/18">18</a>.</li> 116 119 <li>RedHat Enterprise Linux <a href="ftp://ftp.mondorescue.org/rhel/2.1">2.1</a>, <a href="ftp://ftp.mondorescue.org/rhel/3">3</a>, <a href="ftp://ftp.mondorescue.org/rhel/4">4</a>, <a href="ftp://ftp.mondorescue.org/rhel/5">5</a>, <a href="ftp://ftp.mondorescue.org/rhel/6">6</a>.</li> (The same packages can be used for other RHEL clones such as CentOS, OEL, Scientific Linux, ...) 117 <li>Mageia <a href="ftp://ftp.mondorescue.org/mageia/1">1</a> .</li>120 <li>Mageia <a href="ftp://ftp.mondorescue.org/mageia/1">1</a>, <a href="ftp://ftp.mondorescue.org/mageia/2">2</a>.</li> 118 121 <li>Mandriva <a href="ftp://ftp.mondorescue.org/mandrake/10.1">10.1</a>, <a href="ftp://ftp.mondorescue.org/mandrake/10.2">10.2</a>, <a href="ftp://ftp.mondorescue.org/mandriva/2006.0">2006.0</a>, <a href="ftp://ftp.mondorescue.org/mandriva/2007.0">2007.0</a>, <a href="ftp://ftp.mondorescue.org/mandriva/2007.1">2007.1</a>., <a href="ftp://ftp.mondorescue.org/mandriva/2008.0">2008.0</a>, <a href="ftp://ftp.mondorescue.org/mandriva/2008.1">2008.1</a>, <a href="ftp://ftp.mondorescue.org/mandriva/2009.0">2009.0</a>, <a href="ftp://ftp.mondorescue.org/mandriva/2009.1">2009.1</a>, <a href="ftp://ftp.mondorescue.org/mandriva/2010.0">2010.0</a>, <a href="ftp://ftp.mondorescue.org/mandriva/2010.1">2010.1</a>.</li> 119 <li>OpenSuSE <a href="ftp://ftp.mondorescue.org/suse/10.0">10.0</a>, <a href="ftp://ftp.mondorescue.org/suse/10.1">10.1</a>, <a href="ftp://ftp.mondorescue.org/suse/10.2">10.2</a>, <a href="ftp://ftp.mondorescue.org/suse/10.3">10.3</a>, <a href="ftp://ftp.mondorescue.org/opensuse/11.0">11.0</a>, <a href="ftp://ftp.mondorescue.org/opensuse/11.1">11.1</a>, <a href="ftp://ftp.mondorescue.org/opensuse/11.2">11.2</a>, <a href="ftp://ftp.mondorescue.org/opensuse/11.3">11.3</a>, <a href="ftp://ftp.mondorescue.org/opensuse/11.4">11.4</a> . Look also at <a href="http://www.mikenjane.net/~mike/">this</a> web page for SuSE details. <a href="http://packman.links2linux.org/">Packman</a> may have some useful additional packages.122 <li>OpenSuSE <a href="ftp://ftp.mondorescue.org/suse/10.0">10.0</a>, <a href="ftp://ftp.mondorescue.org/suse/10.1">10.1</a>, <a href="ftp://ftp.mondorescue.org/suse/10.2">10.2</a>, <a href="ftp://ftp.mondorescue.org/suse/10.3">10.3</a>, <a href="ftp://ftp.mondorescue.org/opensuse/11.0">11.0</a>, <a href="ftp://ftp.mondorescue.org/opensuse/11.1">11.1</a>, <a href="ftp://ftp.mondorescue.org/opensuse/11.2">11.2</a>, <a href="ftp://ftp.mondorescue.org/opensuse/11.3">11.3</a>, <a href="ftp://ftp.mondorescue.org/opensuse/11.4">11.4</a>, <a href="ftp://ftp.mondorescue.org/opensuse/12.1">12.1</a>, <a href="ftp://ftp.mondorescue.org/opensuse/12.2">12.2</a>, <a href="ftp://ftp.mondorescue.org/opensuse/12.3">12.3</a>,. Look also at <a href="http://www.mikenjane.net/~mike/">this</a> web page for SuSE details. <a href="http://packman.links2linux.org/">Packman</a> may have some useful additional packages. 120 123 <li>SuSE Linux Enterprise Server <a href="ftp://ftp.mondorescue.org/sles/9">9</a>, <a href="ftp://ftp.mondorescue.org/sles/10">10</a>, <a href="ftp://ftp.mondorescue.org/sles/11">11</a>.</li> 121 124 <li>Asianux <a href="ftp://ftp.mondorescue.org/asianux/2">2</a>, <a href="ftp://ftp.mondorescue.org/asianux/3">3</a>.</li> 122 125 <li>Debian <a href="ftp://ftp.mondorescue.org/debian/3.1">3.1</a>, <a href="ftp://ftp.mondorescue.org/debian/4.0">4.0</a>, <a href="ftp://ftp.mondorescue.org/debian/5.0">5.0</a>, <a href="ftp://ftp.mondorescue.org/debian/6.0">6.0</a>. Look also at <a href="http://www.desknow.com/desknow/directfiles/aleidenfrost/mr-debs-unofficial/index.html">this</a> web page for Debian details.</li> 123 <li>Ubuntu <a href="ftp://ftp.mondorescue.org/ubuntu/6.04">6.04</a>, <a href="ftp://ftp.mondorescue.org/ubuntu/7.04">7.04</a>, <a href="ftp://ftp.mondorescue.org/ubuntu/7.10">7.10</a>, <a href="ftp://ftp.mondorescue.org/ubuntu/8.04">8.04</a>, <a href="ftp://ftp.mondorescue.org/ubuntu/8.10">8.10</a>, <a href="ftp://ftp.mondorescue.org/ubuntu/9.04">9.04</a>, <a href="ftp://ftp.mondorescue.org/ubuntu/9.10">9.10</a>, <a href="ftp://ftp.mondorescue.org/ubuntu/10.04">10.04</a>, <a href="ftp://ftp.mondorescue.org/ubuntu/10.10">10.10</a>, <a href="ftp://ftp.mondorescue.org/ubuntu/11.04">11.04</a> .</li>126 <li>Ubuntu <a href="ftp://ftp.mondorescue.org/ubuntu/6.04">6.04</a>, <a href="ftp://ftp.mondorescue.org/ubuntu/7.04">7.04</a>, <a href="ftp://ftp.mondorescue.org/ubuntu/7.10">7.10</a>, <a href="ftp://ftp.mondorescue.org/ubuntu/8.04">8.04</a>, <a href="ftp://ftp.mondorescue.org/ubuntu/8.10">8.10</a>, <a href="ftp://ftp.mondorescue.org/ubuntu/9.04">9.04</a>, <a href="ftp://ftp.mondorescue.org/ubuntu/9.10">9.10</a>, <a href="ftp://ftp.mondorescue.org/ubuntu/10.04">10.04</a>, <a href="ftp://ftp.mondorescue.org/ubuntu/10.10">10.10</a>, <a href="ftp://ftp.mondorescue.org/ubuntu/11.04">11.04</a>, <a href="ftp://ftp.mondorescue.org/ubuntu/11.10">11.10</a>, <a href="ftp://ftp.mondorescue.org/ubuntu/12.04">12.04</a>, <a href="ftp://ftp.mondorescue.org/ubuntu/12.10">12.10</a>.</li> 124 127 <li>Gentoo <a href="ftp://ftp.mondorescue.org/gentoo/nover">nover</a>. 128 <!-- 125 129 <li>Slackware <a href="ftp://ftp.mondorescue.org/slackware/10.2">10.2</a>, <a href="ftp://ftp.mondorescue.org/slackware/11.0">11.0</a>. 130 --> 126 131 </ul> 127 132 -
branches/3.1/website/index.shtml
r2491 r3147 14 14 </div> 15 15 <div class="c"> <img src="/images/screenshots.png" alt="Mondo Rescue screenshots" title="Mondo Rescue Screenshots" /></div> 16 <p class="c">Mondo Rescue is a GPL disaster recovery solution. It supports Linux (i386, x86_64, ia64) and FreeBSD (i386). It's packaged for multiple distributions ( RedHat, RHEL, SuSE, SLES, Mandriva, Debian, Gentoo). </p>16 <p class="c">Mondo Rescue is a GPL disaster recovery solution. It supports Linux (i386, x86_64, ia64) and FreeBSD (i386). It's packaged for multiple distributions (Fedora, RHEL, openSuSE, SLES, Mandriva, Mageia, Debian, Ubuntu, Gentoo). </p> 17 17 <p class="c">It supports tapes, disks, network and CD/DVD as backup media, multiple filesystems, LVM, software and hardware Raid.</p> 18 18 <p class="c">You need it to be safe.</p> -
branches/3.1/website/mondorescue.org.conf
r2937 r3147 34 34 </Directory> 35 35 36 </VirtualHost> 37 38 <VirtualHost 10.3.252.23> 39 ServerName ftp.mondorescue.org 40 ServerAdmin webmaster@mondorescue.org 41 DocumentRoot /prj/www/html/mondorescue 42 CustomLog /var/log/httpd/www.mondorescue.org/access_log combined 43 Errorlog /var/log/httpd/www.mondorescue.org/error_log 44 RewriteEngine On 45 RewriteRule ^/index\.html$ /index.shtml 46 RewriteRule ^/$ /index.shtml 47 48 <Directory "/prj/www/html/mondorescue"> 49 DirectoryIndex index.shtml 50 Options -Indexes MultiViews FollowSymLinks +Includes 51 AllowOverride None 52 Order allow,deny 53 Allow from all 54 </Directory> 55 56 <Directory "/prj/www/html/mondorescue/ftp"> 57 Options Indexes MultiViews FollowSymLinks 58 AllowOverride None 59 Order allow,deny 60 Allow from all 61 </Directory> 36 62 </VirtualHost> 37 63 … … 113 139 CustomLog /var/log/httpd/www.mondorescue.com/access_log combined 114 140 Errorlog /var/log/httpd/www.mondorescue.com/error_log 141 RewriteEngine On 142 RewriteRule ^/index\.html$ /index.shtml 143 RewriteRule ^/$ /index.shtml 115 144 <Directory "/prj/www/html/mondorescue"> 116 145 DirectoryIndex index.shtml … … 128 157 129 158 </VirtualHost> 159 160 <VirtualHost 10.3.252.23> 161 ServerName ftp.mondorescue.com 162 ServerAdmin webmaster@mondorescue.com 163 DocumentRoot /prj/www/html/mondorescue 164 CustomLog /var/log/httpd/www.mondorescue.com/access_log combined 165 Errorlog /var/log/httpd/www.mondorescue.com/error_log 166 RewriteEngine On 167 RewriteRule ^/index\.html$ /index.shtml 168 RewriteRule ^/$ /index.shtml 169 <Directory "/prj/www/html/mondorescue"> 170 DirectoryIndex index.shtml 171 Options -Indexes MultiViews FollowSymLinks +Includes 172 AllowOverride None 173 Order allow,deny 174 Allow from all 175 </Directory> 176 <Directory "/prj/www/html/mondorescue/ftp"> 177 Options Indexes MultiViews FollowSymLinks 178 AllowOverride None 179 Order allow,deny 180 Allow from all 181 </Directory> 182 183 </VirtualHost> -
branches/3.1/website/old/feedback.html
r358 r3147 141 141 or <A HREF="http://htmlgear.lycos.com/guest/control.guest?u=hugorabs&i=1&a=view"><B>read</B></A> 142 142 the guest book? :-)</P> 143 <P ALIGN=JUSTIFY>144 If you are an employer in the USA or Canada and you like my software,145 would you be interested in seeing my résumé [<A HREF="../download/hrcv-30mar04.html">.html</A>]146 [<A HREF="../download/hrcv-30mar04.doc">.doc</A>]? I am working in147 the UK at the moment but I am emigrating in August 2004. I am148 confident that I would be an asset to your firm. (Well, I would say149 that, wouldn't I?)</P>150 143 <P ALIGN=JUSTIFY> 151 144 If you are looking at this page because you are having trouble with
Note:
See TracChangeset
for help on using the changeset viewer.