Changeset 2937 in MondoRescue
- Timestamp:
- Jan 28, 2012, 1:51:28 AM (13 years ago)
- Location:
- branches/3.1
- Files:
-
- 4 deleted
- 39 edited
- 5 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3.1/mindi/README.bkphw
r2696 r2937 5 5 Mindi has a script able to store the Hardware configuration and those parameters may be restored before launching mondorestore during the boot phase computed by mindi, in order to re-setup the machine as the original one. 6 6 7 For the moment, only HP Pro liant systems are supported. If you have tools to allow support for other type of machines, feel free to contribute patches to that script.7 For the moment, only HP ProLiant systems are supported. If you have tools to allow support for other type of machines, feel free to contribute patches to that script. For details on how to use ProLiant tools, please look at the README.ProLiant file 8 8 9 If you have a Proliant system you first need to get the Smart Start Scripting Toolkit. Due to licenses issues, mindi cannot provide those tools itself. You need to get them from http://www.hp.com/servers/sstoolkit 10 11 Mindi expects to find those tools under /usr/local/bin as described in the deplist.d/proliant.conf configuration file. Here are the steps to set it up correctly: 12 13 Older URL: 14 wget ftp://ftp.hp.com/pub/softlib2/software1/pubsw-linux/p308169895/v40154/ss-scripting-toolkit-linux-1.70.tar.gz 15 wget ftp://ftp.hp.com/pub/softlib2/software1/pubsw-linux/p308169895/v43548/ss-scripting-toolkit-linux-1.81.tar.gz 16 17 cd /tmp 18 wget ftp://ftp.hp.com/pub/softlib2/software1/pubsw-linux/p308169895/v44247/ss-scripting-toolkit-linux-1.90.tar.gz 19 mkdir ssstk 20 cd ssstk 21 tar xvfz ../ss-scripting-toolkit-linux-1.90.tar.gz 22 cp -a utilities/hponcfg /usr/local/bin 23 cp -a utilities/conrep /usr/local/bin 24 cp -a utilities/conrep.xml /usr/local/bin 25 # For versions <= 1.90 26 cp -a utilities/cpqacuxe/cpqacuxe /usr/local/bin 27 cp -a utilities/cpqacuxe/bld /usr/local/bin 28 mv /usr/local/bin/bld/*.so /usr/local/lib 29 # For recent versions 30 cp -a utilities/hpacucli /usr/local/bin 31 echo /usr/local/lib >> /etc/ld.so.conf 32 ldconfig 33 34 You're now ready to check your configuration by running: 35 mindi-bkphw /var/cache/mindi /etc/mindi 36 [First parameter is the directory where files will be generated, 37 Second parameter is the directory of the file proliant.files is located] 38 39 For these tools to work you may have to install additional packages such as hpasm and hprsm from the HP Web site, as well as some libstdc++ compatibility packages (compat-libstdc++-33 and compat-libstdc++-296 on RHEL 5 e.g.) 40 41 In order to have a working hponcfg binary you also need to install the hprsm/hpasm packages from HP Web site. Refer to http://welcome.hp.com/country/us/en/support.html?pageDisplay=drivers 42 9 2011-10-07 Move ProLiant section to a specific file 43 10 2007-05-30 Initial file -
branches/3.1/mindi/README.bootparam
r2816 r2937 40 40 41 41 nohw 42 Do not call the mindi-rsthw script which try to restore also your BIOSes configuration (Pro liant only)42 Do not call the mindi-rsthw script which try to restore also your BIOSes configuration (ProLiant only for now) 43 43 44 44 nolvm -
branches/3.1/mindi/README.pxe
r2499 r2937 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)] [ netfsmount=server:mountpoint] [netfsopt=-o option][netfspath=local_path] [ping=#] ...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=#] ... 14 14 15 15 ipdev is the device name (e.g. eth2) … … 19 19 gateway is the default gateway (e.g. 192.168.1.254) 20 20 dhcp is a keyword. Using it will provide all the previous 4 values to activate the LAN interface. 21 hwaddr is the MAC address of the device you want to use to restore through 21 22 proto is the protocol to use for mounting the remote share (default is NFS, sshfs is also available) 22 23 server is the ip addr of the Remote Network server … … 48 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. 49 50 50 Please report any problem around that tool to bruno @mondorescue.org51 Please report any problem around that tool to bruno_at_mondorescue.org 51 52 53 2011-10-09 adds support for hwaddr 52 54 2009-12-05 nfsopt added tp allow for custom options at mount time 53 55 2009-09-09 Changed to netfs for multi protocol support (nfs, sshfs, ...) -
branches/3.1/mindi/analyze-my-lvm
r2816 r2937 60 60 done 61 61 list_of_devices="`echo $l | sort -u`" 62 for ed in $MINDI_EXCLUDE_DEVS; do62 for ed in `echo $MINDI_EXCLUDE_DEVS | sed 's/|/ /g'`; do 63 63 if [ "`echo " $list_of_devices" | grep " $ed"`" != "" ]; then 64 64 echo "Not including device $LV_full_string as it was excluded" … … 159 159 160 160 if [ "$MINDI_EXCLUDE_DEVS" ] ; then 161 for ed in $MINDI_EXCLUDE_DEVS; do161 for ed in `echo $MINDI_EXCLUDE_DEVS | sed 's/|/ /g'`; do 162 162 if [ "`echo " $list_of_devices" | grep " $ed"`" != "" ]; then 163 163 echo $current_VG >> $MINDI_TMP/excludedvgs … … 188 188 list_of_devices="`echo $l | sort -u`" 189 189 if [ "$MINDI_EXCLUDE_DEVS" ] ; then 190 for ed in $MINDI_EXCLUDE_DEVS; do190 for ed in `echo $MINDI_EXCLUDE_DEVS | sed 's/|/ /g'`; do 191 191 if [ "`echo " $list_of_devices " | grep " $ed"`" != "" ]; then 192 192 skip=1 … … 211 211 list_of_devices="`echo $l | sort -u`" 212 212 if [ "$MINDI_EXCLUDE_DEVS" ] ; then 213 for ed in $MINDI_EXCLUDE_DEVS; do213 for ed in `echo $MINDI_EXCLUDE_DEVS | sed 's/|/ /g'`; do 214 214 if [ "`echo " $list_of_devices " | grep " $ed"`" != "" ]; then 215 215 skip=1 … … 266 266 skip=0 267 267 if [ "$MINDI_EXCLUDE_DEVS" ] ; then 268 for ed in $MINDI_EXCLUDE_DEVS; do268 for ed in `echo $MINDI_EXCLUDE_DEVS | sed 's/|/ /g'`; do 269 269 if [ "`echo " $rep " | grep " $ed"`" != "" ]; then 270 270 skip=1 … … 291 291 } 292 292 293 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 299 } 293 300 294 301 ListAllLogicalVolumes() { … … 414 421 echo "" 415 422 echo "Finally, create the LV's (logical volumes)." 416 all_logical_volumes=`ListAllLogicalVolumes `423 all_logical_volumes=`ListAllLogicalVolumesSortedBydm` 417 424 for current_LV in $all_logical_volumes ; do 418 425 ProcessLogicalVolume $current_LV -
branches/3.1/mindi/deplist.d/base.conf
r2816 r2937 63 63 /usr/bin/cmp 64 64 /sbin/ctrlaltdel 65 /usr/bin/halt66 65 /bin/dd 67 66 /usr/bin/eject 68 67 /usr/bin/env 69 68 /sbin/halt 69 /usr/bin/halt 70 70 /sbin/ldconfig 71 71 /usr/bin/wc -
branches/3.1/mindi/deplist.d/minimal.conf
r2850 r2937 123 123 /etc/sysconfig/udev 124 124 /sbin/consoletype 125 # On SLES 10 126 /sbin/path_id 127 /sbin/scsi_id 128 /sbin/scsi_tur 129 /sbin/hwup 125 130 126 131 # Modules -
branches/3.1/mindi/mindi
r2874 r2937 36 36 37 37 EXTRA_SPACE=80152 # increase if you run out of ramdisk space 38 BOOT_SIZE=3 2768# size of the boot disk38 BOOT_SIZE=36864 # size of the boot disk 39 39 40 40 PROMPT_MAKE_CD_IMAGE="yes" … … 54 54 # If set to "no", the kernel is not a Xen kernel 55 55 # If "yes", mindi will modify isolinux.cfg for the Xen kernel. 56 xenkernelpath="" 56 57 57 58 MY_FSTAB=/etc/fstab … … 60 61 61 62 # ide-probe-mod 62 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 amd74xx sis5513 jmicron sata_promise sata_via serverworks sata_svw blkbk virtio"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_atiixp amd74xx sis5513 jmicron sata_promise sata_via serverworks sata_svw blkbk virtio virtio_ring virtio_pci virtio_blk virtio_balloon" 63 64 PCMCIA_MODS="pcmcia_core ds yenta_socket" 64 65 USB_MODS="usb-storage usb-ohci usb-uhci usbcore usb_storage input hid 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" 65 NET_MODS="auth_rpcgss sunrpc nfs nfs_acl lockd fscache loop mii 3c59x e100 bcm5700 bnx2 bnx2x 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"66 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 "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" 67 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" 67 68 # Those modules will only go on the backup media, not the boot media. 68 EXTRA_MODS="$CDROM_MODS vfat fatloop 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"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" 69 70 # Replace with that line for HP OCMP e.g. 70 71 #DENY_MODS="MPS_Driver_Mapper mps octtldrv tscttl streams kqemu fdomain" … … 72 73 # Force some modules to be included 73 74 FORCE_MODS="" 75 76 # Find MBR in case of bootable USB device to build 77 MBRFILE=/usr/lib/syslinux/mbr.bin 78 [ ! -r "$MBRFILE" ] && MBRFILE=/usr/lib64/syslinux/mbr.bin 79 [ ! -r "$MBRFILE" ] && MBRFILE=/usr/share/syslinux/mbr.bin 80 [ ! -r "$MBRFILE" ] && MBRFILE=/usr/share/lib/syslinux/mbr.bin 81 [ ! -r "$MBRFILE" ] && MBRFILE=/usr/share/lib64/syslinux/mbr.bin 74 82 75 83 LOGFILE=/var/log/mindi.log … … 132 140 } 133 141 134 LogIt() { 135 if [ -e /dev/stderr ] ; then 136 echo -e "$1" >> /dev/stderr 137 elif [ -e /usr/bin/logger ] ; then 138 /usr/bin/logger -s $1 139 fi 142 LogOnly() { 140 143 echo -e "$1" >> $LOGFILE 141 144 if [ _"$2" != _"" ]; then … … 143 146 fi 144 147 rm -f "$2" 148 } 149 150 # Function to log on screen only 151 LogScreen() { 152 if [ -e /dev/stderr ] ; then 153 echo -e "$1" >> /dev/stderr 154 elif [ -e /usr/bin/logger ] ; then 155 /usr/bin/logger -s $1 156 fi 157 } 158 159 # Function to log in log file only 160 LogFile() { 161 162 echo -e "$1" >> $LOGFILE 163 if [ _"$2" != _"" ]; then 164 grep -Ev "tar: Removing \`/\'" "$2" >> $LOGFILE 165 fi 166 rm -f "$2" 167 } 168 169 # Function to log in both screen and logfile 170 LogAll() { 171 LogScreen "$1" 172 LogFile "$1" "$2" 173 } 174 175 # Preserved for compatibility 176 LogIt() { 177 LogAll "$1" "$2" 145 178 } 146 179 … … 369 402 mkdir -p $bigdir/etc/console 370 403 cp /etc/console/boottime.kmap.gz $bigdir/etc/console 2>> $LOGFILE 404 echo "" 371 405 echo -e "$DONE" 372 406 return 0 … … 383 417 mkdir -p $bigdir/etc/console-setup 384 418 cp $kbdfile $bigdir/etc/console-setup 2>> $LOGFILE 419 echo "" 385 420 echo -e "$DONE" 386 421 return 0 … … 439 474 KBDEPTH=0 440 475 AddKeyboardMappingFile $mappath 476 echo "" 441 477 echo -e "$DONE" 442 478 rm -f $MINDI_TMP/keymaps.find … … 453 489 [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/share/lib64/syslinux/mboot.c32 454 490 [ ! -e "$MBOOTC32" ] && MBOOTC32=`find / -name mboot.c32 | grep -x "/.*/mboot.c32"` 455 [ ! -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. com and click on 'Download'"491 [ ! -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" 456 492 LogFile "Found mboot.c32 at $MBOOTC32" 457 493 } … … 465 501 [ ! -e "$ISOLINUX" ] && ISOLINUX=/usr/share/lib64/syslinux/isolinux.bin 466 502 [ ! -e "$ISOLINUX" ] && ISOLINUX=`find / -name isolinux.bin | grep -x "/.*/isolinux.bin"` 467 [ ! -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. com and click on 'Download'"503 [ ! -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" 468 504 LogFile "Found isolinux.bin at $ISOLINUX" 469 505 } … … 704 740 # $1: raid device (/dev/md...) 705 741 GetRaidDevMembers() { 742 if [ ! -f /etc/raidtab ]; then 743 return 744 fi 706 745 $AWK "/^[[:space:]]*#/ {next} /^[[:space:]]*raiddev/ {if(dev) exit; if(\$2 == \"$1\") dev=\$2} /^[[:space:]]*device/ {if(dev) {print \$2}}" < /etc/raidtab 707 746 } … … 977 1016 978 1017 MakeMountlist() { 979 local scratchdirmountlist all_partitions current_partition \1018 local mountlist all_partitions current_partition \ 980 1019 partition_size partition_format outstring partition_number \ 981 1020 partition_mountpt c_p lwm_info psz lvm_dev unofficial_outstring \ … … 990 1029 LogAll "-----------------------------------" 991 1030 992 # scratchdir, mountlist(OUT) 993 scratchdir=$MINDI_TMP 1031 # mountlist(OUT) 994 1032 mountlist=$1 995 1033 … … 1019 1057 printf "%-15s %-15s %-15s %s %s\n" DEVICE MOUNTPOINT FORMAT "SIZE MB" LABEL/UUID | tee -a $LOGFILE 1020 1058 printf "%-15s %-15s %-15s %s %s\n" ------ ---------- ------ ------- ---------- | tee -a $LOGFILE 1021 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 "1059 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" 1022 1060 for c_p in $all_partitions ; do 1023 # Skip evices, network FS, cisf1061 # Skip fd/cd devices, network FS, cifs 1024 1062 [ "`echo "$useless_dev" | grep -F "$c_p"`" != "" ] || [ "`echo "$c_p" | grep ":"`" != "" ] || [ "`echo "$c_p" | grep -E "^//"`" != "" ]&& continue 1025 1063 [ "`echo "$c_p" | grep -x "/dev/cdroms.*"`" ] && continue … … 1032 1070 fi 1033 1071 [ "$c_p" = "none" ] && continue 1034 # Debian 5 does that1035 [ "$c_p" = "proc" ] && continue1036 1072 redhat_label="" 1037 1073 label="" … … 1110 1146 [ "`echo $uname | grep "2.6.19"`" != "" ] && skip=1052 1111 1147 [ "`echo $uname | grep "2.6.[2-9]"`" != "" ] && skip=1052 1148 [ "`echo $uname | grep "3.[0-9]*.[0-9]*"`" != "" ] && skip=1052 1112 1149 if [ $skip = "" ]; then 1113 1150 Die "Your kernel is too old. I don't know how to support labelled swap spaces with it" … … 1218 1255 list_of_devices="`echo $l | sort -u`" 1219 1256 1220 for d in $MINDI_EXCLUDE_DEVS; do1257 for d in `echo $MINDI_EXCLUDE_DEVS | sed 's/|/ /g'`; do 1221 1258 if [ "`echo " $list_of_devices " | grep " $d"`" != "" ]; then 1222 1259 echo "Excluding $current_partition from mountlist (due to excluded device $d)" >> $LOGFILE … … 1268 1305 [ "`echo "$current_partition" | grep -c "^/"`" -ne "1" ] && continue 1269 1306 if [ "$partition_format" = "swap" ] || [ "$partition_mountpt" = "swap" ] ; then 1270 partition_size=`grep -Fv "Priority" /proc/swaps | tr -s '\t' ' ' | grep -F "$current_partition " | $AWK '{print $3}'`1307 partition_size=`grep -Fv "Priority" /proc/swaps | tr -s '\t' ' ' | grep -F "$current_partition " | $AWK '{print $3}'` 1271 1308 [ "$partition_mountpt" != "swap" ] && partition_mountpt="swap" 1272 1309 [ "$partition_format" != "swap" ] && partition_format="swap" … … 1487 1524 LogFile "Transforming $USBDEVICE in a Bootable device" 1488 1525 LogFile "Checking $USBDEVICE" 1489 $FDISK -l $USBDEVICE 2> > $LOGFILE 1>> $LOGFILE1526 $FDISK -l $USBDEVICE 2>&1 >> $LOGFILE 1490 1527 if [ $? -ne 0 ]; then 1491 1528 LogAll "Unable to access $USBDEVICE" … … 1499 1536 # If your key has no MBR it may cause an issue 1500 1537 # Use dd if=mbr.bin of=$USBDEVICE or ms-sys -s $USBDEVICE 1538 if [ -r $MBRFILE ]; then 1539 LogFile "Installing an MBR ($MBRFILE) on $USBDEVICE" 1540 dd if=$MBRFILE of=$USBDEVICE 1541 else 1542 LogFile "You may need to install an MBR (usually in $MBRFILE, but not found on your system) " 1543 LogFile "on $USBDEVICE with dd if=$MBRFILE of=$USBDEVICE" 1544 fi 1501 1545 LogFile "Preparing $USBDEVICE" 1502 $FDISK $USBDEVICE 2>> $LOGFILE 1>> $LOGFILE<< EOF1546 cat > $MINDI_TMP/fdisk.txt << EOF 1503 1547 d 1504 1548 d … … 1516 1560 w 1517 1561 EOF 1562 $FDISK $USBDEVICE 2>> $LOGFILE 1>> $LOGFILE < $MINDI_TMP/fdisk.txt 1518 1563 if [ $? -ne 0 ]; then 1519 1564 LogAll "Unable to create a vfat Filesystem on $USBDEVICE" … … 1522 1567 MindiExit -1 1523 1568 fi 1569 LogFile "fdisk build file" 1570 LogFile "----------------" 1571 cat $MINDI_TMP/fdisk.txt >> $LOGFILE 1572 LogFile "----------------" 1573 rm -f $MINDI_TMP/fdisk.txt 1524 1574 LogFile "The USB device $USBDEVICE now looks like this:" 1525 1575 $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE … … 2023 2073 local devpath drive res stub 2024 2074 device=$1 2075 if [ "`echo "$device" | grep -E "^/dev/"`" = "" ] ; then 2076 Die "Cannot find $device's size - is your /etc/fstab sane?" 2077 fi 2025 2078 if [ "`echo "$device" | grep -F "/dev/md"`" != "" ] ; then 2026 2079 res=`SizeOfRaidPartition $device` … … 2091 2144 2092 2145 2146 # WARNING: This function should just echo the final result !!! 2147 # 2093 2148 TryToFindKernelPath() { 2094 local fname incoming res fkern_ver we_want_version possible_kernels noof_kernels kernelpath kdate duff_kernels2149 local fname fkern_ver we_want_version possible_kernels noof_kernels possible_xenkernels noof_xenkernels kp kdate duff_kernels output root 2095 2150 2096 2151 we_want_version=$KERVERRUN 2097 2152 possible_kernels="" 2098 2153 duff_kernels="" 2154 output="" 2099 2155 2100 2156 if [ "$ARCH" = "ia64" ] ; then … … 2104 2160 fi 2105 2161 # See if we're booted from a Xen kernel 2106 if [ -d /proc/sys/xen ]; then 2162 # From http://wiki.xensource.com/xenwiki/XenCommonProblems#head-26434581604cc8357d9762aaaf040e8d87b37752 2163 if [ -f /proc/xen/capabilities ]; then 2107 2164 # It's a Xen kernel 2108 2165 KERNEL_IS_XEN="yes" 2109 Log It"It's a Xen kernel..."2166 LogFile "It's a Xen kernel..." 2110 2167 fi 2111 2168 … … 2168 2225 fi 2169 2226 elif [ "$noof_kernels" -eq "1" ] ; then 2170 k ernelpath=`echo "$possible_kernels" | sed s/' '//`2171 LogFile "Your kernel is $k ernelpath (v$KERVERRUN)"2172 output="$k ernelpath"2227 kp=`echo "$possible_kernels" | sed s/' '//` 2228 LogFile "Your kernel is $kp (v$KERVERRUN)" 2229 output="$kp" 2173 2230 else 2174 2231 for i in $possible_kernels ; do 2175 if echo $i | grep "$KERVERRUN"; then2232 if [ "`echo $i | grep "$KERVERRUN"`" ]; then 2176 2233 LogAll "OK, I used my initiative and found that " 2177 2234 LogAll "$i is probably your kernel. " 2178 2235 output="$i" 2236 break 2179 2237 fi 2180 2238 done 2181 if [ -n "$output" ]; then2182 if echo " $possible_kernels " | grep -F "/boot/vmlinuz " &> /dev/null; then2239 if [ ! -n "$output" ]; then 2240 if [ "`echo " $possible_kernels " | grep -F "/boot/vmlinuz " &> /dev/null`" ]; then 2183 2241 output=/boot/vmlinuz 2184 echo "Schlomo, this one's for you." >> $LOGFILE2242 LogFile "Schlomo, this one's for you." 2185 2243 else 2186 Log It"Two or more possible kernels found. You may specify any one of them and the "2187 Log It"boot disks will still work, probably. If one does not work, try another."2188 Log It"$possible_kernels"2189 echo""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" 2247 output="" 2190 2248 fi 2191 2249 fi … … 2196 2254 elif [ "$noof_xenkernels" -eq "1" ]; then 2197 2255 xenkernelpath=`echo "$possible_xenkernels" | sed s/' '//` 2198 echo "Your Xen kernel is $xenkernelpath (v$KERVERRUN)" >> $LOGFILE2256 LogFile "Your Xen kernel is $xenkernelpath (v$KERVERRUN)" 2199 2257 else 2200 2258 for i in $possible_xenkernels ; do 2201 if echo $i | grep "$KERVERRUN"; then2202 Log It"OK, I used my initiative and found that "2203 LogIt"$i is probably your Xen kernel. "2259 if [ "`echo $i | grep "$KERVERRUN"`" ]; then 2260 LogFile "OK, I used my initiative and found that " 2261 LogFile "$i is probably your Xen kernel. " 2204 2262 xenkernelpath="$i" 2263 break 2205 2264 fi 2206 2265 done 2207 if [ -n "$xenkernelpath" ]; then2266 if [ ! -n "$xenkernelpath" ]; then 2208 2267 new_possible_xenkernels=`echo "$possible_xenkernels" | tr -s ' ' '\n' | grep -E "^/boot" | sort -u | tr '\n' ' '` 2209 2268 if [ ! -n "$new_possible_xenkernels" ]; then 2210 2269 xenkernelpath=`echo $new_possible_xenkernels | tr -s ' ' '\n' | head -1` 2211 Log It"Using $xenkernelpath"2270 LogFile "Using $xenkernelpath" 2212 2271 else 2213 LogIt"Two or more possible Xen kernels found. You may specify any one of them and the "2214 Log It"boot disks will still work, probably. If one does not work, try another."2215 LogIt"$possible_xenkernels"2216 echo""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" 2275 output="" 2217 2276 xenkernelpath=`echo $possible_xenkernels | tr -s ' ' '\n' | head -1` 2218 Log It"Using $xenkernelpath"2277 LogFile "Using $xenkernelpath" 2219 2278 fi 2220 2279 fi 2221 2280 fi 2222 xenkernelname=`basename $xenkernelpath`2223 2281 if [[ -z "$xenkernelpath" || ! -f "$xenkernelpath" ]]; then 2224 2282 Die "Cannot find Xen kernel $xenkernelpath, aborting" 2225 2283 fi 2226 2284 fi 2285 LogAll "TryToFindKernelPath found $output" 2227 2286 echo "$output" 2228 2287 } … … 2258 2317 echo `cat $MINDI_TMP/mnt.lis` `sort -u $MINDI_TMP/deps.lis` >> $MINDI_TMP/cp.lis 2259 2318 rm -f $MINDI_TMP/deps.lis $MINDI_TMP/mnt.lis 2319 2320 # Copy of files mandatory for ssh to automate mount if sshfs is used 2321 echo .ssh >> $MINDI_TMP/mkdir.lis 2322 echo ~root/.ssh/* >> $MINDI_TMP/cp.lis 2323 echo > $mountpoint/tmp/myssh << EOF 2324 ssh -o StrictHostKeyChecking=no $* 2325 EOF 2326 chmod 755 $mountpoint/tmp/myssh 2327 echo $mountpoint/tmp/myssh >> $MINDI_TMP/cp.lis 2260 2328 2261 2329 # Copy of files mandatory for ld.so … … 2279 2347 # This avoids NIC remapping if on another machine at restore time on Ubuntu at least 2280 2348 echo ./etc/udev/rules.d/[0-9][0-9]-persistent-net.rules >> $MINDI_TMP/rm.lis 2349 2350 # Do not do it if it's a link (Ubuntu 64 bits #503) 2351 if [ -e "/lib64/udev" ] && [ ! -h "/lib64" ] && [ ! -h "/lib64/udev" ]; then 2352 echo /lib64/udev >> $MINDI_TMP/mkdir.lis 2353 echo /lib64/udev/* >> $MINDI_TMP/cp.lis 2354 fi 2355 if [ -e "/lib32/udev" ] && [ ! -h "/lib32" ] && [ ! -h "/lib32/udev" ]; then 2356 echo /lib32/udev >> $MINDI_TMP/mkdir.lis 2357 echo /lib32/udev/* >> $MINDI_TMP/cp.lis 2358 fi 2359 if [ -e "/lib/udev" ] && [ ! -h "/lib" ] && [ ! -h "/lib/udev" ]; then 2360 echo /lib/udev >> $MINDI_TMP/mkdir.lis 2361 echo /lib/udev/* >> $MINDI_TMP/cp.lis 2362 fi 2281 2363 if [ -x /sbin/udevd ]; then 2282 2364 # Get only the files which exist in the udev.files list … … 2296 2378 fi 2297 2379 2298 # Management of potential HW info (Pro liant only at the moment)2380 # Management of potential HW info (ProLiant only at the moment) 2299 2381 rm -rf $MINDI_CACHE/bkphw 2300 2382 mindi-bkphw $MINDI_CACHE $MINDI_CONF | tee -a $LOGFILE … … 2371 2453 echo "lib/firmware" >> $MINDI_TMP/mkdir.lis 2372 2454 echo "/lib/firmware" >> $MINDI_TMP/cp.lis 2455 fi 2456 2457 # Copy an additional ProLiant tool for OBDR support 2458 if [ -f $MINDI_TMP/OBDR ]; then 2459 if [ -x /usr/bin/hpsa_obdr_mode ]; then 2460 echo $mountpoint/usr/bin >> $MINDI_TMP/mkdir.lis 2461 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" 2465 LogAll " This may lead to a tape not going back to sequential mode after OBDR boot" 2466 fi 2373 2467 fi 2374 2468 … … 2418 2512 # Finally remove useless stff 2419 2513 (cd $mountpoint ; rm -f `cat $MINDI_TMP/rm.lis`) 2>&1 >> $LOGFILE 2420 2421 # Copy of files mandatory for ssh to automate mount if sshfs is used2422 cp -rp ~root/.ssh/*.pub ~root/.ssh/config ~root/.ssh/known* $mountpoint/.ssh 2> /dev/null2423 cat > $mountpoint/bin/myssh << EOF2424 ssh -o StrictHostKeyChecking=no $*2425 EOF2426 chmod 755 $mountpoint/bin/myssh2427 2514 2428 2515 # Finally integrate what we provide statically as part of mindi … … 2695 2782 if [ "$#" -ne "0" ] ; then 2696 2783 if [ "$1" = "--findkernel" ] ; then 2697 res =`TryToFindKernelPath`2784 resk=`TryToFindKernelPath` 2698 2785 # Avoids logfile content for mondo 2699 2786 export MONDO_SHARE="" 2700 if [ "$res " = "" ] ; then2787 if [ "$resk" = "" ] ; then 2701 2788 if [ $KERNEL_IS_XEN = "yes" ]; then 2702 2789 echo "$xenkernelpath" 2703 MindiExit 0 2790 LogOnly "xenkernelpath = $xenkernelpath" 2791 MindiExit 0 2704 2792 else 2705 2793 MindiExit -1 2706 2794 fi 2707 2795 else 2708 echo "$res" 2709 MindiExit 0 2796 echo "$resk" 2797 LogOnly "kernelpath = $resk" 2798 MindiExit 0 2710 2799 fi 2711 2800 elif [ "$1" = "--locatedeps" ] ; then … … 2765 2854 if [ $KERNEL_IS_XEN = "yes" ]; then 2766 2855 LogAll "xenkernelpath = $xenkernelpath" 2767 LogAll "xenkernelname = $xenkernelname"2768 2856 fi 2769 2857 kernelname=`echo $kernelpath | cut -d'-' -f2- | sed 's/.[bg]z[2]*$//'` -
branches/3.1/mindi/mindi-bkphw
r2709 r2937 11 11 # Handling Configuration files 12 12 my $tool = ""; 13 my $tooldir = "";14 13 my $ret = 0; 14 my $productname = undef; 15 15 16 16 die "No CACHE_DIR parameter" if ((not defined $ARGV[0]) || (! -d $ARGV[0])); … … 24 24 mkdir $bkpdir,0755 if (! -d $bkpdir) ; 25 25 open(SYSTEM,"/usr/sbin/dmidecode -s 'system-product-name' 2> /dev/null |") || die "You need /usr/sbin/dmidecode for mindi hardware support"; 26 my $productname = <SYSTEM>; 26 while (<SYSTEM>) { 27 next if (/^#/); 28 $productname = $_; 29 chomp($productname); 30 } 27 31 close(SYSTEM); 28 32 29 die " ERROR: No product name found for Hardware support\n" if (not defined $productname);33 die "WARNING: No product name found for Hardware support\n" if (not defined $productname); 30 34 31 chomp($productname);32 35 if ($productname =~ /proliant/i) { 33 36 print "Detected a $productname. Nice. Continue to support my job :-)\n"; 34 print "Activating Proliant support for mindi\n"; 35 open(PROLIANT,"$confdir/proliant.files") || die "Unable to open $confdir/proliant.files"; 37 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"; 42 open(PROLIANT,"$confdir/deplist.d/ProLiant.conf") || die "Unable to open $confdir/deplist.d/ProLiant.conf"; 43 # generate a list of what need to be put on the backup media 36 44 open(TOOLS,"> $bkpdir/../tools.files") || die "Unable to open $bkpdir/../tools.files"; 45 # generate a script that will be launched at rstore time to perform the HW setup 37 46 open(SCRIPT,"> $bkpdir/../mindi-rsthw") || die "Unable to open $bkpdir/../mindi-rsthw"; 38 47 print SCRIPT << 'EOF'; 39 48 #!/bin/bash 40 49 # 50 # Script generated by mindi 51 # 41 52 # This script will restore potentially your HW configuration 42 # on your system before partioning occurs 53 # on your system before partioning occurs. 54 # 43 55 # You may want to reboot after that step if you think that 44 56 # resetting BIOS parameters to the value restored 45 # may have an impact on you restoration process 57 # may have an impact on your restoration process or if 58 # you want to benefit from any firmware update that could have happened. 46 59 # 47 # put dynamic libraries at an accessible place48 for l in /usr/local/lib/*; do49 ln -sf $l /usr/lib50 done51 60 EOF 52 61 while($tool = <PROLIANT>) { 62 my $hasfound = 0; 53 63 next if ($tool =~ /^#/); 54 64 chomp($tool); 55 $tooldir = dirname($tool);65 # skip non-executable/exising binaries 56 66 if (! (-x $tool)) { 57 print "You could install the SmartStart Scripting toolkit tool $tool\nto benefit from mindi's enhanced hardware support\n";58 print "Get it from http://www.hp.com/servers/sstoolkit\n";59 67 next; 60 68 } else { 61 print "Found $tool, activating enhanced HP Pro liant support in mindi\n";69 print "Found $tool, activating enhanced HP ProLiant support in mindi\n"; 62 70 print TOOLS "$tool\n"; 63 71 } 64 72 if ($tool =~ /\/conrep$/) { 65 $ret = system("cd $tooldir ; $tool -s -f$bkpdir/conrep.dat"); 66 print SCRIPT "(cd $tooldir ; $tool -l -f$locbkpdir/conrep.dat)\n"; 73 # 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"); 76 # 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 } else { 80 next; 81 } 82 print SCRIPT "$tool -l -f$locbkpdir/conrep.dat\n"; 67 83 print TOOLS "$tool.xml\n"; 68 84 } 69 if ($tool =~ /\/.acuxebin$/) { 85 if ($tool =~ /\/hpacuscripting$/) { 86 $hasfound = 1; 70 87 my $dir=basename($tool); 71 $ret = system("export ACUXE_BIN_INSTALLATION_DIR=$dir ; export IM_CFGFILE_PATH=$dir ; export ACUXE_LOCK_FILES_DIR=$dir/locks ; $tool -c $bkpdir/cpqacuxe.dat"); 72 print SCRIPT "export ACUXE_BIN_INSTALLATION_DIR=$dir ; export IM_CFGFILE_PATH=$dir ; export ACUXE_LOCK_FILES_DIR=$dir/locks ; $tool -i $locbkpdir/cpqacuxe.dat\n"; 73 print TOOLS "$tooldir/bld\n"; 74 } 75 if ($tool =~ /\/hpacucli$/) { 76 my $dir=basename($tool); 77 $ret = system("export ACUXE_BIN_INSTALLATION_DIR=$dir ; export IM_CFGFILE_PATH=$dir ; export ACUXE_LOCK_FILES_DIR=$dir/locks ; $tool -c $bkpdir/hpacucli.dat"); 78 print SCRIPT "export ACUXE_BIN_INSTALLATION_DIR=$dir ; export IM_CFGFILE_PATH=$dir ; export ACUXE_LOCK_FILES_DIR=$dir/locks ; $tool -i $locbkpdir/hpacucli.dat\n"; 79 print TOOLS "$tooldir/bld\n"; 88 # Just backup internal info for a DR 89 $ret = system("$tool -c $bkpdir/hpacuscripting.dat -internal"); 90 # We could want to reset it before. 91 print SCRIPT "# $tool -reset -i $locbkpdir/hpacusripting.dat\n"; 92 print SCRIPT "$tool -i $locbkpdir/hpacusripting.dat\n"; 80 93 } 81 94 if ($tool =~ /\/hponcfg$/) { 82 $ret = system("$tool - w $bkpdir/hponcfg.dat");83 print SCRIPT "$tool - r$locbkpdir/hponcfg.dat\n";95 $ret = system("$tool -a -w $bkpdir/hponcfg.dat"); 96 print SCRIPT "$tool -f $locbkpdir/hponcfg.dat\n"; 84 97 } 85 98 if ($tool =~ /\.scexe$/) { 86 print "Found $tool, that firmware will be applied at restore time on your HP Proliant\n"; 87 print SCRIPT "./$tool\n"; 99 print "Found $tool, that firmware will be applied at restore time on your HP ProLiant\n"; 100 print SCRIPT "./$tool -s\n"; 101 } 102 # Kept for compatibility with older version of tools 103 if (($tool =~ /\/hpacucli$/) && ($hasfound == 0)) { 104 my $dir=basename($tool); 105 $ret = system("$tool -c $bkpdir/hpacucli.dat"); 106 print SCRIPT "$tool -i $locbkpdir/hpacucli.dat\n"; 88 107 } 89 108 if ($ret != 0) { … … 96 115 } else { 97 116 print "\nWARNING: No Hardware support for $productname.\nNot a big issue, just less features and risks ;-)\n"; 98 print "You may ask your manufacturer to contribute to the mindi project \n";117 print "You may ask your manufacturer to contribute to the mindi project (harmless)\n"; 99 118 } 100 119 rmdir $bkpdir if (-d $bkpdir) ; -
branches/3.1/mindi/rootfs/etc/init.d/rcS
r2893 r2937 131 131 mt -f $tapedev rewind 132 132 mt -f $tapedev fsf 2 133 # 32k is DEFAULT_INTERNAL_TAPE_BLOCK_SIZE 134 mt -f $tapedev setblk 32768 133 135 dd if=$tapedev bs=32k count=1024 | tar -zx 134 136 res=$? … … 651 653 652 654 EnableCcissIfAppropriate() { 653 local i fname 654 for i in 0 1 2 3 ; do 655 fname="/proc/driver/cciss/cciss$i" 656 if [ -e "$fname" ] ; then 657 LogIt "Engaging $fname" 658 echo "engage scsi" > $fname 659 LogIt "...result=$?" 660 fi 655 local f 656 657 # In some cases, the OBDR tape remains in CD-ROM mode. This branch solves that issue (#498) 658 if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg 2>/dev/null`" ] && [ -x /usr/bin/hpsa_obdr_mode ]; then 659 for lun in `/usr/bin/hpsa_obdr_mode -m query /dev/cciss/* 2>&1 | grep "is an OBDR device" | cut -d' ' -f4`; do 660 /usr/bin/hpsa_obdr_mode -m query -l $lun /dev/cciss/* 2>&1 | grep -q "is in CD-ROM mode" 661 if [ $? -eq 0 ]; then 662 # This tape/lun should be brought back in Sequential mode 663 LogIt "Putting back tape $lun in Sequential mode..." 664 /usr/bin/hpsa_obdr_mode -m tape -l $lun /dev/cciss/* 2>&1 > /dev/null 665 fi 666 done 667 fi 668 669 # 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=$?" 661 674 done 662 675 } … … 743 756 done 744 757 #/bin/update 758 mkdir /proc 2> /dev/null 745 759 mount /proc/ /proc -v -t proc 746 760 mkdir /sys 2> /dev/null -
branches/3.1/mindi/rootfs/sbin/find-and-mount-cdrom
r2816 r2937 33 33 fi 34 34 LogIt "$device has a CD-ROM in it" 35 umount /mnt/cdrom35 umount -d /mnt/cdrom 36 36 ln -sf $device /dev/cdrom 37 37 if [ "$?" -ne "0" ]; then -
branches/3.1/mindi/rootfs/sbin/install-additional-tools
r2594 r2937 4 4 # 5 5 ######################################################################## 6 7 8 Die() {9 echo "Fatal error! $1" >> /dev/stderr10 exit 111 }12 13 6 14 7 … … 60 53 cd $old_pwd 61 54 echo -e -n "\r" 62 [ ! -e "$MINDI_CACHE/CDROM-LIVES-HERE" ] && [ -e "$tarball" ] && umount $mountpoint55 [ ! -e "$MINDI_CACHE/CDROM-LIVES-HERE" ] && [ -e "$tarball" ] && umount -d $mountpoint 63 56 sleep 1 64 57 fi -
branches/3.1/mindi/rootfs/sbin/post-init
r2591 r2937 26 26 else 27 27 if [ "$iso$nuke$compare$interactive$pxe" != "" ] ; then 28 LogIt "FYI, this CD was made by Mindi, not Mondo." 1 28 LogIt "The mondorestore command was not found on your backup media" 1 29 LogIt "It may mean your device is not seen correctly." 1 30 LogIt "Check driver list and error messages." 1 29 31 exit 0 30 32 else -
branches/3.1/mindi/rootfs/sbin/start-netfs
r2709 r2937 10 10 ipcount=3 11 11 12 ipconf="" 13 pre="" 14 post="" 12 # Get info from config file 15 13 ipdev="" 14 hwaddr="" 16 15 ipaddress="" 17 16 ipnetmask="" … … 19 18 ipgateway="" 20 19 proto="" 20 ipconf="" 21 pre="" 22 post="" 21 23 netfsmount="" 22 24 imgname="" … … 26 28 if [ -f $MINDI_CACHE/mondorestore.cfg ]; then 27 29 ipdev=`grep netfs-dev $MINDI_CACHE/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-` 30 hwaddr=`grep netfs-client-hwaddr $MINDI_CACHE/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-` 28 31 ipaddress=`grep netfs-client-ipaddr $MINDI_CACHE/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-` 29 32 ipnetmask=`grep netfs-client-netmask $MINDI_CACHE/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-` … … 46 49 for i in `cat $CMDLINE` ; do 47 50 echo $i | grep -qi ping= && ipcount=`echo $i | cut -d= -f2` 51 echo $i | grep -qi hwaddr= && hwaddr=`echo $i | cut -d= -f2` 48 52 echo $i | grep -qi ipconf= && ipconf=`echo $i | cut -d= -f2` 49 53 echo $i | grep -qi netfsmount= && export netfsmount=`echo $i | cut -d= -f2` … … 93 97 ipgateway=`echo $ipconf | cut -d: -f5` 94 98 fi 99 100 # If same system, map to the right MAC address 101 hwaddr_found=`ifconfig $ipdev | /bin/grep HWaddr | awk '{print $NF}'` 102 if [ "$hwaddr" != "$hwaddr_found" ]; then 103 ipdev_new=`ifconfig -a | /bin/grep $hwaddr | awk '{print $1}'` 104 if [ "$ipdev_new" != "" ]; then 105 LogIt "Interface $ipdev changed to $ipdev_new (MAC: $hwaddr)" 106 ipdev=$ipdev_new 107 else 108 LogIt "NOTE: Interface $ipdev kept despite it doesn't match the $hwaddr MAC address" 109 fi 110 fi 111 95 112 LogIt "Configuring $ipdev statically ($ipaddress/$ipnetmask)" 96 113 ifconfig $ipdev $ipaddress netmask $ipnetmask broadcast $ipbroadcast 97 114 route add default gw $ipgateway 115 98 116 fi 117 118 # Leave time to the satck to wake up (reported by some users) 119 sleep 5 99 120 100 121 # ping server helps waking interface up -
branches/3.1/mondo-doc/mindi.8
r2295 r2937 27 27 .B mindi 28 28 .br 29 .BR "mindi -v"| " --version"| "-V"| " -version"29 .BR "mindi \-v"| " --version"| " \-V"| " -version" 30 30 .br 31 31 .BI "mindi --findkernel" … … 64 64 .SH OPTIONS 65 65 .TP 66 .BI " -v"| " --version"| "-V"| " -version"66 .BI "\-v"| " --version"| " \-V"| " -version" 67 67 .RI Prints the version of mindi. 68 68 .TP -
branches/3.1/mondo-doc/mondoarchive.8
r2850 r2937 114 114 Use ISO files (CD images) as backup media. This is good for backing up your 115 115 system to a spare hard drive. The 116 .B -n116 .B \-n 117 117 switch is a wiser choice if you plan to restore from a remote filesystem. 118 118 … … 161 161 This is the prefered and recommended option when doing partial archiving. 162 162 Note that mondo automatically excludes removable media (/mnt/floppy, 163 /mnt/cdrom, /proc, /sys, / tmp). For example, if you are backing up to an NFS mount but you163 /mnt/cdrom, /proc, /sys, /run, /tmp). For example, if you are backing up to an NFS mount but you 164 164 do not want to include the contents of the mount in a backup, exclude your 165 165 local mount-point with this switch. It will also work with partitions, e.g. … … 173 173 174 174 .TP 175 .BI " -I " "\*(lqpath|...\*(rq"175 .BI "\-I " "\*(lqpath|...\*(rq" 176 176 Include paths(s) in backup. The paths should be separated with a pipe and surrounded by quotes. 177 177 This option is mainly used to perform tests … … 186 186 .BR \-E 187 187 option, the \-E content should be subdirectories of those mentioned in 188 the \-I only, as -I takes precedence.189 190 .TP 191 .BI " -J " "file"188 the \-I only, as \-I takes precedence. 189 190 .TP 191 .BI "\-J " "file" 192 192 Specify an explicit list of files and directories to include in a plain text file, one item 193 193 (file or directory) per line. Beware that directories placed in that file are not managed recursively contrary to what is done with the \-I option. 194 194 195 195 .TP 196 .BI " -N"196 .BI "\-N" 197 197 Exclude all mounted network filesystems. This currently means NFS, SMB, Coda, MVFS, AFS 198 198 OCFS and Netware. In other words, only backup the local hard disk(s). 199 199 200 200 .TP 201 .BI " -d " "dev|dir"201 .BI "\-d " "dev|dir" 202 202 Specify the backup device (CD/tape/USB) or directory (NFS/ISO). For CD-R[W] drives, 203 203 this is the SCSI node where the drive may be found, e.g. '0,1,0'. For tape … … 205 205 this is the device name of your key or external disk. For ISO users, 206 206 this is the directory where the ISO images are stored. For NFS users, this is 207 the directory withinthe NFS mount where the backups are stored. The default207 the subdirectory under the NFS mount where the backups are stored. The default 208 208 for ISO and NFS is '/var/cache/mondo'. 209 209 210 210 .TP 211 .BI " -g "211 .BI "\-g " 212 212 GUI mode. Without this switch, the screen output of mondoarchive is suitable 213 213 for processing by an 'expect' wrapper, enabling the user to backup nightly via … … 216 216 217 217 .TP 218 .BI " -k " "path"218 .BI "\-k " "path" 219 219 Path of user's kernel. If you are a Debian (<3.0) or Gentoo (<1.4) user then specify 220 220 .B \-k FAILSAFE … … 222 222 223 223 .TP 224 .BI " -m "224 .BI "\-m " 225 225 Manual (not self-retracting) CD trays are often found on laptops. If you are 226 226 a laptop user, your CD burner has BurnProof technology or you experience … … 228 228 229 229 .TP 230 .BI " -o "230 .BI "\-o " 231 231 Use OBDR (One Button Disaster Recovery) type of tapes. 232 232 By default, tapes are not bootable. With this flag, tape will be made bootable … … 234 234 235 235 .TP 236 .BI " -s " "size"236 .BI "\-s " "size" 237 237 How much can each of your backup media hold? You may use 'm' and 'g' on the end 238 238 of the number, e.g. '700m' for an extra-large CD-R. You no longer need to … … 240 240 241 241 .TP 242 .BI " -x " "'dev ...'"242 .BI "\-x " "'dev ...'" 243 243 Specify non-Linux partitions which you want to backup, e.g. NTFS or BeOS. 244 244 … … 246 246 .SH MINOR OPTIONS 247 247 .TP 13 248 .BI " -[0-9] "248 .BI "\-[0-9] " 249 249 Specify the compression level. Default is 3. No compression is 0. 250 250 251 251 .TP 252 .BI " -A " "command"252 .BI "\-A " "command" 253 253 This command will be called after each CD/NFS/ISO file is written. It is useful 254 254 if you want to do something with an ISO after creating it, e.g. write it to a 255 255 CD burner using a non-standard command. 256 .B -A256 .B \-A 257 257 understands two tokens \- _ISO_ and _CD#_ - which will be translated into the 258 258 ISO's filename and its index number (1, 2, ...) respectively. So, you could use … … 267 267 268 268 .TP 269 .BI " -H "269 .BI "\-H " 270 270 When you boot from the tape/CD, your hard drive will be wiped and the archives 271 271 will be restored. Your decision to boot from the tape/CD will be taken as … … 274 274 275 275 .TP 276 .BI " -L "276 .BI "\-L " 277 277 Use lzo, a fast compression engine, instead of bzip2. You may find lzo on 278 278 Mondo's website or via FreshMeat. WARNING! Some versions of LZO are unstable. 279 279 280 280 .TP 281 .BI " -G "281 .BI "\-G " 282 282 Use gzip, the standard and quicker Linux compression engine, instead of bzip2. 283 283 284 284 .TP 285 .BI " -Y "285 .BI "\-Y " 286 286 Use lzma, the new quicker and optimized Linux compression engine, instead of bzip2. 287 287 288 288 .TP 289 .BI " -R "289 .BI "\-R " 290 290 EXPERIMENTAL. Do not use in mission-critical environments. Star is an 291 291 alternative to afio. Mondo now supports POSIX ACLs and extended … … 293 293 294 294 .TP 295 .BI " -P " "tarball"295 .BI "\-P " "tarball" 296 296 Post-nuke tarball. If you boot into Nuke Mode and everything is restored 297 297 successfully then the … … 304 304 305 305 .TP 306 .BI " -S " "path"306 .BI "\-S " "path" 307 307 Specify the full pathname of the scratchdir, the directory where ISO 308 308 images are built before being archived. If you have plenty of RAM and … … 310 310 311 311 .TP 312 .BI " -T " "path"312 .BI "\-T " "path" 313 313 Specify the full pathname of the tempdir, the directory where temporary 314 314 files (other than ISO images being assembled) are stored. See … … 316 316 317 317 .TP 318 .BI " -W "318 .BI "\-W " 319 319 Don't make your backup self-booting. This is a really bad idea, IMO. Don't do 320 320 this unless you have really great boot disks in your hand and you are an anally … … 323 323 324 324 .TP 325 .BI " -b "325 .BI "\-b " 326 326 Specify the internal block size used by the tape drive. This is usually 32K but 327 327 some drives just don't like that. They should but they don't. That's what … … 330 330 331 331 .TP 332 .BI " -e "332 .BI "\-e " 333 333 Don't eject the CD or tape when backing up... 334 334 335 335 .TP 336 .BI " -f " "device"336 .BI "\-f " "device" 337 337 Specify the drive on which your Master Boot Record lives. Usually, this is 338 338 discovered automatically. A good use case may be when you have software RAID. 339 339 340 340 .TP 341 .BI " -l " "GRUB|LILO|ELILO|RAW"341 .BI "\-l " "GRUB|LILO|ELILO|RAW" 342 342 Specify the boot loader. By default, your Master Boot Record is examined and 343 343 the boot loader can usually be discovered. If you specify RAW then the MBR will … … 347 347 348 348 .TP 349 .BI " -Q "349 .BI "\-Q " 350 350 Give more detailed information about the boot loader. 351 351 352 352 .TP 353 .BI " -K " "loglevel"353 .BI "\-K " "loglevel" 354 354 Specify the loglevel. Use 99 for full debug. Standard debug level is 4. 355 355 356 356 .TP 357 .BI " -v "357 .BI "\-v " 358 358 Gives mondoarchive version. 359 359 360 360 .TP 361 .BI " -z "361 .BI "\-z " 362 362 Use extended attributes and acl for each file and store them in the 363 363 backup media. Use this option if you use SElinux e.g. but it will slow … … 377 377 support questions. 378 378 379 .SH ENVIRONMENT VARIABLES 380 .IR ARCH 381 This variable is passed to the environment by mondoarchive so that 382 parted2fdisk.pl is aware of the underlying hardware architecture. 383 384 .IR MONDO_SHARE 385 This variable is passed to the environment by mondoarchive so that 386 mindi is aware that it's called from it and act accordingly. It contains 387 the shared directory for the mondo package. 388 389 .IR PATH 390 This variable is modified internally by mondoarchive so that /sbin:/usr/sbin:/usr/local/sbin 391 are appended to it systematically in order to find the required tools. 392 393 .IR TMPDIR 394 This variable is used, if defined, as the target directory to create 395 all the temporary files needed during the operation (not the scratch files) 396 397 .IR TMP 398 This variable is used, if defined and if TMPDIR is not defined, as the target 399 directory to create all the temporary files needed during the operation 400 (not the scratch files) 379 401 380 402 .SH NOTES … … 450 472 451 473 .BI USB: 452 Backup to your USB key, using gzip compression:453 .br 454 .I "mondoarchive -OU -d /dev/sda - G"474 Backup to your 4GB USB key, using gzip compression: 475 .br 476 .I "mondoarchive -OU -d /dev/sda -s 4g -G" 455 477 456 478 .BI RAID: -
branches/3.1/mondo-doc/mondorescue-howto.sgml
r2850 r2937 322 322 </entry> 323 323 <entry> 324 If you want to backup the whole computer (excluding /sysand /proc,325 naturally) then leave this as / which is the default. Otherwise,324 If you want to backup the whole computer (excluding /sys, /run and /proc, 325 naturally as well as /tmp) then leave this as / which is the default. Otherwise, 326 326 specify subsets, (e.g. /usr/local /home ) being sure to put a space 327 327 in between each path. -
branches/3.1/mondo-doc/mondorestore.8
r2715 r2937 41 41 42 42 .TP 43 .BI " -p " prefix43 .BI "\-p " prefix 44 44 Use 45 45 .B prefix … … 52 52 53 53 .TP 54 .BI " -i "54 .BI "\-i " 55 55 Use ISO files (CD images) as restore media. This is good when having backed up your 56 56 system to a spare hard drive. The … … 59 59 60 60 .TP 61 .BI " -n " mount61 .BI "\-n " mount 62 62 Use files residing on NFS partition as restore media. 63 63 .I mount … … 66 66 67 67 .TP 68 .BI " -t "68 .BI "\-t " 69 69 Use tape streamer as restore device and its tapes as restore media. 70 70 71 71 .TP 72 .BI " -U "72 .BI "\-U " 73 73 Use a generic USB device as restore device. Use this if you want to read 74 74 your backup from a USB key or USB disk. … … 79 79 80 80 .TP 81 .BI " -u "81 .BI "\-u " 82 82 Use a generic streaming device as restore device. Use this if you want to read 83 83 your backup from a device that is not directly support by mondoarchive. This will … … 86 86 87 87 .TP 88 .BI " -E " "\*(lqpath ...\*(rq"88 .BI "\-E " "\*(lqpath ...\*(rq" 89 89 Exclude path(s) from restore (future dev). The paths should be separated with a pipe. 90 90 For example, if you are restoring up … … 92 92 93 93 .TP 94 .BI " -I " "\*(lqpath ...\*(rq"94 .BI "\-I " "\*(lqpath ...\*(rq" 95 95 Include paths(s) to restore (future dev). 96 96 97 97 .TP 98 .BI " -J " "file"98 .BI "\-J " "file" 99 99 Specify an explicit list of files and directories to restore in a plain 100 100 text file, one item (file or directory) per line. Beware that 101 101 directories placed in that file are not managed recursively contrary to 102 what is done with the \-I option .103 104 .TP 105 .BI " -d " "dev|dir"102 what is done with the \-I option (future dev). 103 104 .TP 105 .BI "\-d " "dev|dir" 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 … … 113 113 114 114 .TP 115 .BI " -g "115 .BI "\-g " 116 116 GUI mode. Without this switch, the screen output of mondorestore is text based. 117 117 118 118 .TP 119 .BI " -m "119 .BI "\-m " 120 120 Manual (not self-retracting) CD trays are often found on laptops. If you are 121 121 a laptop user, your CD burner has BurnProof technology or you experience … … 123 123 124 124 .TP 125 .BI " -o "125 .BI "\-o " 126 126 Use OBDR (One Button Disaster Recovery) type of tapes. 127 127 By default, tapes are not bootable. With this flag, tape will be read as bootable tapes … … 129 129 130 130 .TP 131 .BI " -x " "'dev ...'"131 .BI "\-x " "'dev ...'" 132 132 Specify non-Linux partitions which you want to restore (future dev). 133 133 134 134 .TP 135 .BI " -T " "path"135 .BI "\-T " "path" 136 136 Specify the full pathname of the tempdir, the directory where temporary files 137 137 are stored. 138 138 139 139 .TP 140 .BI " -b "140 .BI "\-b " 141 141 Specify the internal block size used by the tape drive. This is usually 32K but 142 142 some drives just don't like that. They should but they don't. That's what … … 145 145 146 146 .TP 147 .BI " -e "147 .BI "\-e " 148 148 Don't eject the CD or tape when restoring... 149 149 150 150 .TP 151 .BI " -f " "device"151 .BI "\-f " "device" 152 152 Specify the drive on which your Master Boot Record lives. Usually, this is 153 153 discovered automatically. (future dev) 154 154 155 155 .TP 156 .BI " -Q "156 .BI "\-Q " 157 157 Give more detailed information about the boot loader. 158 158 159 159 .TP 160 .BI " -K " "loglevel"160 .BI "\-K " "loglevel" 161 161 Specify the loglevel. Use 99 for full debug. Standard debug level is 4. 162 162 163 163 .TP 164 .BI " -z "164 .BI "\-z " 165 165 Use extended attributes and acl for each file and store them in the 166 166 backup media. Use this option if you use SElinux e.g. but it will slow … … 168 168 169 169 .TP 170 .BI " -Z "170 .BI "\-Z " 171 171 Specify mondorestore mode. Mode could be one of 172 172 .IR nuke: … … 196 196 and moved under /var/log at the end. 197 197 198 .SH ENVIRONMENT VARIABLES 199 .IR TMPDIR 200 This variable is used, if defined, as the target directory to create 201 all the temporary files needed during the operation (not the scratch files) 202 203 .IR TMP 204 This variable is used, if defined and if TMPDIR is not defined, as the target 205 directory to create all the temporary files needed during the operation 206 (not the scratch files) 207 208 .IR dirimg 209 This variable is setup by the rcS script to store the network remote directory in PXE mode. 210 (managed internally) 211 212 .IR imgname 213 This variable is setup by the rcS script to overwrite the prefix name in PXE mode. 214 (managed internally) 215 216 .IR netfsmount 217 This variable is setup by the rcS script to store the network file system mount point in PXE mode. 218 (managed internally) 219 220 .IR MRUSBDEV 221 This variable contains the device file of the USB device to restore from. 222 (equivalent if the usb-dev parameter of the mondorescue config file) 223 198 224 .SH NOTES 199 225 A link to Mondo's HTML-based manual (by Bruno Cornec, Mikael Hultgren, -
branches/3.1/mondo/src/common/libmondo-archive.c
r2850 r2937 483 483 * - @c compression_level 484 484 * - @c differential 485 * - @c exclude_paths486 485 * - @c image_devs 487 486 * - @c kernel_path … … 610 609 611 610 if (!bkpinfo->nonbootable_backup && (bkpinfo->boot_loader == '\0' || bkpinfo->boot_device == NULL)) { 611 update_evalcall_form(2); 612 612 613 613 #ifdef __FreeBSD__ … … 782 782 mr_free(command); 783 783 log_msg(1, "lines_in_filelist = %ld", lines_in_filelist); 784 update_evalcall_form(3); 784 785 785 786 /* 1 2 3 4 5 6 7 8 9 10 */ … … 832 833 833 834 mvaddstr_and_log_it(g_currentY, 0, "Calling MINDI to create boot+data disks"); 835 open_evalcall_form("Calling MINDI to create boot+data disks"); 834 836 res = run_external_binary_with_percentage_indicator_NEW("Generating boot+data disks", command); 837 update_evalcall_form(99); 835 838 paranoid_free(command); 836 839 … … 874 877 mr_free(tmp); 875 878 } 879 close_evalcall_form(); 876 880 return (res); 877 881 } … … 1471 1475 log_msg(2, "make_usb_fs --- scratchdir=%s", bkpinfo->scratchdir); 1472 1476 (void) getcwd(old_pwd, MAX_STR_LEN - 1); 1473 mr_asprintf(tmp, "chmod 7 55%s", bkpinfo->scratchdir);1477 mr_asprintf(tmp, "chmod 700 %s", bkpinfo->scratchdir); 1474 1478 run_program_and_log_output(tmp, FALSE); 1475 1479 mr_free(tmp); … … 1499 1503 run_program_and_log_output(tmp, FALSE); 1500 1504 mr_free(tmp); 1505 1501 1506 1502 1507 /* Mindi always create one single parition on the USB dev */ … … 1595 1600 log_msg(2, "make_iso_fs --- scratchdir=%s --- destfile=%s", bkpinfo->scratchdir, destfile); 1596 1601 (void) getcwd(old_pwd, MAX_STR_LEN - 1); 1597 mr_asprintf(tmp, "chmod 7 55%s", bkpinfo->scratchdir);1602 mr_asprintf(tmp, "chmod 700 %s", bkpinfo->scratchdir); 1598 1603 run_program_and_log_output(tmp, FALSE); 1599 1604 mr_free(tmp); … … 2599 2604 2600 2605 if (!ok_go_ahead_burn_it) { 2601 eject_device(cdrom_dev); 2606 if (!bkpinfo->please_dont_eject) { 2607 eject_device(cdrom_dev); 2608 } 2602 2609 mds = media_descriptor_string(g_backup_media_type); 2603 2610 mr_asprintf(tmp, "I am about to burn %s #%d of the backup set. Please insert %s and press Enter.", mds, g_current_media_number, mds); … … 3254 3261 run_program_and_log_output("umount " MNT_CDROM, FALSE); 3255 3262 // if (bkpinfo->backup_media_type != iso && !bkpinfo->please_dont_eject_when_restoring) 3256 //{3257 eject_device(bkpinfo->media_device);3258 //}3263 if (!bkpinfo->please_dont_eject) { 3264 eject_device(bkpinfo->media_device); 3265 } 3259 3266 } 3260 3267 mr_asprintf(tmp, "%s/changed.files", MONDO_CACHE); -
branches/3.1/mondo/src/common/libmondo-cli.c
r2850 r2937 488 488 *p = '\0'; 489 489 } 490 mr_asprintf(tmp1, "mount | grep -E \"^[ %s@]*%s[/]* .*\" | cut -d' ' -f3", bkpinfo->netfs_user, bkpinfo->netfs_mount);490 mr_asprintf(tmp1, "mount | grep -E \"^[a-z]*#*[%s@]*%s[/]* .*\" | cut -d' ' -f3", bkpinfo->netfs_user, bkpinfo->netfs_mount); 491 491 mr_free(bkpinfo->isodir); 492 492 bkpinfo->isodir = call_program_and_get_last_line_of_output(tmp1,TRUE); … … 776 776 777 777 if (flag_set['S']) { 778 /* Before changing remove old ones if any */ 779 if (bkpinfo->scratchdir) { 780 chdir("/tmp"); 781 mr_asprintf(tmp1, "rm -Rf %s", bkpinfo->scratchdir); 782 paranoid_system(tmp1); 783 mr_free(tmp1); 784 } 778 785 mr_asprintf(bkpinfo->scratchdir, "%s/mondo.scratch.%ld", flag_val['S'], random() % 32768); 779 786 } -
branches/3.1/mondo/src/common/libmondo-devices.c
r2850 r2937 94 94 { 95 95 // log_it("rctada: Retracting all CD trays", __LINE__); 96 if (strlen(g_cdrom_drive_is_here) > 0) { 97 inject_device(g_cdrom_drive_is_here); 98 } 99 if (strlen(g_dvd_drive_is_here) > 0) { 100 inject_device(g_dvd_drive_is_here); 101 } 102 if (strlen(g_cdrw_drive_is_here) > 0) { 103 inject_device(g_cdrw_drive_is_here); 96 if (!bkpinfo->please_dont_eject) { 97 if (strlen(g_cdrom_drive_is_here) > 0) { 98 inject_device(g_cdrom_drive_is_here); 99 } 100 if (strlen(g_dvd_drive_is_here) > 0) { 101 inject_device(g_dvd_drive_is_here); 102 } 103 if (strlen(g_cdrw_drive_is_here) > 0) { 104 inject_device(g_cdrw_drive_is_here); 105 } 104 106 } 105 107 // log_it("rctada: killing autorun"); … … 537 539 tmp1 = find_home_of_exe(cdr_exe); 538 540 if (tmp1) { 539 mr_asprintf(command, "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep CD| cut -d' ' -f2 | head -n1", cdr_exe);541 mr_asprintf(command, "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -E '[D|C][V|D]' | cut -d' ' -f2 | head -n1", cdr_exe); 540 542 tmp = call_program_and_get_last_line_of_output(command,TRUE); 541 543 mr_free(command); … … 846 848 } 847 849 848 tmp = call_program_and_get_last_line_of_output("dvdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\" | grep DVD| cut -d':' -f1",TRUE);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); 849 851 log_msg(5, "tmp = '%s'", tmp); 850 852 if (!tmp[0]) 851 853 mr_free(tmp); 852 tmp = call_program_and_get_last_line_of_output("cdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\" | grep DVD| cut -d':' -f1",TRUE);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); 853 855 if (tmp[0]) { 854 856 devno = atoi(tmp) - 1; … … 1448 1450 if ((res = what_number_cd_is_this()) != cd_number_i_want) { 1449 1451 log_msg(3, "Currently, we hold %d but we want %d", res, cd_number_i_want); 1452 1453 /* Now we need to umount the current media to have the next mounted after */ 1454 run_program_and_log_output("umount -d " MNT_CDROM, FALSE); 1455 log_msg(3, "Mounting next media %d",cd_number_i_want); 1456 g_current_media_number = cd_number_i_want; 1457 mount_media(); 1458 1450 1459 mds = media_descriptor_string(bkpinfo->backup_media_type); 1451 1460 log_msg(3, "Insisting on %s #%d", mds, cd_number_i_want); … … 1457 1466 if (is_this_device_mounted(MNT_CDROM)) { 1458 1467 res = 1459 run_program_and_log_output("umount " MNT_CDROM, FALSE);1468 run_program_and_log_output("umount -d " MNT_CDROM, FALSE); 1460 1469 } else { 1461 1470 res = 0; … … 1995 2004 char *tmp = NULL; 1996 2005 char *tmp1 = NULL; 2006 char *tmp2 = NULL; 1997 2007 1998 2008 if (pathlist == NULL) { … … 2052 2062 /* Adds a | to ensure correct detection even at both ends */ 2053 2063 mr_asprintf(tmp1,"|%s",token); 2064 mr_asprintf(&tmp2,"|%s|",token); 2054 2065 if (mode == 'E') { 2055 2066 /* Add the token if not already in the list */ 2056 2067 mr_asprintf(tmp,"|%s|",bkpinfo->exclude_paths); 2057 if (strstr(tmp,tmp 1) == NULL) {2068 if (strstr(tmp,tmp2) == NULL) { 2058 2069 if (bkpinfo->exclude_paths) { 2059 2070 mr_strcat(bkpinfo->exclude_paths,tmp1); … … 2066 2077 /* Add the token if not already in the list */ 2067 2078 mr_asprintf(tmp,"|%s|",bkpinfo->include_paths); 2068 if (strstr(tmp,tmp 1) == NULL) {2079 if (strstr(tmp,tmp2) == NULL) { 2069 2080 mr_strcat(bkpinfo->include_paths, "%s", tmp1); 2070 2081 } … … 2072 2083 } 2073 2084 mr_free(tmp); 2085 mr_free(tmp2); 2074 2086 break; 2075 2087 } -
branches/3.1/mondo/src/common/libmondo-filelist.c
r2874 r2937 1366 1366 #if linux 1367 1367 // 2.6 has /sys as a proc-type thing -- must be excluded 1368 mr_asprintf(strtmp, "find '%s' -maxdepth %d -fstype mvfs -prune -o -fstype devpts -prune -o -fstype tmpfs -prune -o -fstype proc-prune -o -fstype sysfs -prune -o -fstype rpc_pipefs -prune -o -fstype none -prune -o %s -type d -print > %s 2> /dev/null", dir, MAX_SKEL_DEPTH, find_excludes, g_skeleton_filelist);1368 mr_asprintf(strtmp, "find '%s' -maxdepth %d -fstype mvfs -prune -o -fstype devpts -prune -o -fstype tmpfs -prune -o fstype devtmpfs -prune -o -fstype proc -prune -o -fstype selinuxfs -prune -o -fstype securityfs -prune -o -fstype hugetlbfs -o -fstype cgroup -prune -prune -o -fstype mqueue -prune -o -fstype debugfs -prune -o -fstype sysfs -prune -o -fstype rpc_pipefs -prune -o -fstype none -prune -o %s -type d -print > %s 2> /dev/null", dir, MAX_SKEL_DEPTH, find_excludes, g_skeleton_filelist); 1369 1369 #else 1370 1370 // On BSD, for example, /sys is the kernel sources -- don't exclude … … 1582 1582 mr_free(tmp1); 1583 1583 1584 mr_asprintf(exclude_paths, MONDO_CACHE"|%s|%s|%s|.|..|"MNT_CDROM"|"MNT_FLOPPY"|/media|/tmp|/proc|/sys|/ dev/shm|"MINDI_CACHE, tmp2, (bkpinfo->tmpdir[0] == '/' && bkpinfo->tmpdir[1] == '/') ? (bkpinfo->tmpdir + 1) : bkpinfo->tmpdir, (bkpinfo->scratchdir[0] == '/' && bkpinfo->scratchdir[1] == '/') ? (bkpinfo->scratchdir + 1) : bkpinfo->scratchdir);1584 mr_asprintf(exclude_paths, MONDO_CACHE"|%s|%s|%s|.|..|"MNT_CDROM"|"MNT_FLOPPY"|/media|/tmp|/proc|/sys|/run|/dev/shm|"MINDI_CACHE, tmp2, (bkpinfo->tmpdir[0] == '/' && bkpinfo->tmpdir[1] == '/') ? (bkpinfo->tmpdir + 1) : bkpinfo->tmpdir, (bkpinfo->scratchdir[0] == '/' && bkpinfo->scratchdir[1] == '/') ? (bkpinfo->scratchdir + 1) : bkpinfo->scratchdir); 1585 1585 if (excp != NULL) { 1586 1586 mr_strcat(exclude_paths,"|%s",excp); -
branches/3.1/mondo/src/common/libmondo-files-EXT.h
r2569 r2937 45 45 extern long size_of_partition_in_mountlist_K(char *tmpdir, char *dev); 46 46 47 extern int make_grub_install_scriptlet(char *outfile);48 47 extern int read_one_liner_data_file(char *fname, char *contents); -
branches/3.1/mondo/src/common/libmondo-files.c
r2850 r2937 904 904 if (res) { 905 905 log_to_screen("Please install '%s'. I cannot find it on your system.", fname); 906 log_to_screen("There may be hyperlink at http://www.mondorescue. comwhich");906 log_to_screen("There may be hyperlink at http://www.mondorescue.org which"); 907 907 log_to_screen("will take you to the relevant (missing) package."); 908 908 return (1); … … 1063 1063 /*@ buffers ******** */ 1064 1064 char *netfs_dev = NULL; 1065 char * mac_addr = NULL;1065 char *netfs_client_hwaddr = NULL; 1066 1066 char *netfs_mount = NULL; 1067 1067 char *netfs_client_ipaddr = NULL; … … 1127 1127 if (!strncmp(netfs_dev, "bond", 4) || !strncmp(netfs_dev, "alb", 3) || !strncmp(netfs_dev, "aft", 3)) { 1128 1128 log_to_screen("Found bonding device %s; looking for corresponding ethN slave device\n", netfs_dev); 1129 mr_asprintf(command, "%s", "ifconfig %s | awk '{print $5}' | head -n1", netfs_dev); 1130 mac_addr = call_program_and_get_last_line_of_output(command,TRUE); 1129 1130 mr_asprintf(command, "ifconfig %s | awk '{print $5}' | head -n1", netfs_dev); 1131 netfs_client_hwaddr = call_program_and_get_last_line_of_output(command,TRUE); 1131 1132 mr_free(command); 1132 1133 1133 mr_asprintf(command, "ifconfig | grep -E '%s' | grep -v '%s' | head -n1 | cut -d' ' -f1", mac_addr,netfs_dev); 1134 mr_free(mac_addr); 1134 mr_asprintf(command, "ifconfig | grep -E '%s' | grep -v '%s' | head -n1 | cut -d' ' -f1", netfs_client_hwaddr, netfs_dev); 1135 1135 mr_free(netfs_dev); 1136 1136 … … 1151 1151 mr_free(netfs_mount); 1152 1152 1153 mr_asprintf(tmp, "%s/NETFS-SERVER-PATH", bkpinfo->tmpdir);1154 write_one_liner_data_file(tmp, bkpinfo->netfs_remote_dir);1155 mr_free(tmp);1156 1157 1153 mr_asprintf(tmp, "%s/NETFS-CLIENT-IPADDR", bkpinfo->tmpdir); 1158 1154 write_one_liner_data_file(tmp, netfs_client_ipaddr); 1155 mr_free(tmp); 1156 1157 mr_asprintf(tmp, "%s/NETFS-CLIENT-HWADDR", bkpinfo->tmpdir); 1158 write_one_liner_data_file(tmp, netfs_client_hwaddr); 1159 1159 mr_free(tmp); 1160 1160 … … 1306 1306 } 1307 1307 1308 1309 /**1310 * Create a small script that mounts /boot, calls @c grub-install, and syncs the disks.1311 * @param outfile Where to put the script.1312 * @return 0 for success, 1 for failure.1313 */1314 int make_grub_install_scriptlet(char *outfile)1315 {1316 FILE *fout;1317 char *tmp = NULL;1318 int retval = 0;1319 1320 if ((fout = fopen(outfile, "w"))) {1321 fprintf(fout,1322 "#!/bin/sh\n\nmount /boot > /dev/null 2> /dev/null\ngrub-install $@\nres=$?\nsync;sync;sync\nexit $res\n");1323 paranoid_fclose(fout);1324 log_msg(2, "Created %s", outfile);1325 mr_asprintf(tmp, "chmod +x %s", outfile);1326 paranoid_system(tmp);1327 mr_free(tmp);1328 retval = 0;1329 } else {1330 retval = 1;1331 }1332 return (retval);1333 }1334 1335 1308 /* @} - end fileGroup */ -
branches/3.1/mondo/src/common/libmondo-files.h
r2569 r2937 44 44 int make_hole_for_dir(const char *outdir_fname); 45 45 long size_of_partition_in_mountlist_K(char *tmpdir, char *dev); 46 int make_grub_install_scriptlet(char *outfile);47 48 46 int read_one_liner_data_file(char *fname, char *contents); -
branches/3.1/mondo/src/common/libmondo-fork.c
r2704 r2937 97 97 * - @c bkpinfo->manual_cd_tray 98 98 * - @c bkpinfo->backup_media_type 99 * - @c bkpinfo->please_dont_eject_when_restoring100 99 * @param basic_call The call to mkisofs. May contain tokens that will be resolved to actual data. The tokens are: 101 100 * - @c _ISO_ will become the ISO file (@p isofile) -
branches/3.1/mondo/src/common/libmondo-mountlist.c
r2816 r2937 840 840 !strcmp(mountlist->el[items].device, "/sys") || 841 841 !strcmp(mountlist->el[items].device, "sys") || 842 !strcmp(mountlist->el[items].device, "/run") || 843 !strcmp(mountlist->el[items].device, "run") || 842 844 !strcmp(mountlist->el[items].device, "/devpts") || 843 845 !strcmp(mountlist->el[items].device, "devpts") -
branches/3.1/mondo/src/common/libmondo-raid.c
r2523 r2937 1022 1022 // get RAID level 1023 1023 token = mr_strtok(string, delims, &lastpos); 1024 // skip potential auto-read-only entry 1025 if (!strcmp(token, "(auto-read-only)")) { 1026 mr_free(token); 1027 token = mr_strtok (string, delims, &lastpos); 1028 } 1024 1029 if (!strcmp(token, "multipath")) { 1025 1030 raidlist->el[raidlist->entries].raid_level = -2; -
branches/3.1/mondo/src/common/libmondo-stream.c
r2704 r2937 737 737 738 738 set_tape_block_size_with_mt(bkpinfo->internal_tape_block_size); 739 740 /* restore compression mode on */ 741 mr_asprintf(&command, "mt -f %s compression on",bkpinfo->media_device); 742 res = run_program_and_log_output(command, 1); 743 paranoid_free(command); 744 739 745 return(res); 740 746 } -
branches/3.1/mondo/src/common/libmondo-tools.c
r2850 r2937 378 378 log_msg(1, "Post-param"); 379 379 if (bkpinfo->backup_media_type == tape) { 380 if (whine_if_not_found("mt") == 1) { 381 fatal_error("Please install the mt command"); 382 } 380 383 log_msg(1, "Tape"); 381 384 if (bkpinfo->media_device == NULL) { … … 718 721 /* purging a potential old tmpdir */ 719 722 log_it("Purging old tmpdir %s", bkpinfo->tmpdir); 723 chdir("/tmp"); 720 724 mr_asprintf(tmp,"rm -Rf %s",bkpinfo->tmpdir); 721 725 mr_free(bkpinfo->tmpdir); -
branches/3.1/mondo/src/common/libmondo-verify.c
r2508 r2937 987 987 verify_all_slices_on_CD(mountpoint); 988 988 989 mr_asprintf(tmp1, "umount %s", mountpoint);989 mr_asprintf(tmp1, "umount -d %s", mountpoint); 990 990 #ifdef __FreeBSD__ 991 991 ret += system(tmp1); … … 1118 1118 #ifdef __FreeBSD__ 1119 1119 ret = 0; 1120 mr_asprintf(command, "umount %s", mountpoint);1120 mr_asprintf(command, "umount -d %s", mountpoint); 1121 1121 ret += system(command); 1122 1122 ret += kick_vn(mddevice); 1123 1123 if (ret) { 1124 1124 #else 1125 mr_asprintf(command, "umount %s", mountpoint);1125 mr_asprintf(command, "umount -d %s", mountpoint); 1126 1126 if (system(command)) { 1127 1127 #endif … … 1136 1136 1137 1137 if (!does_file_exist(fname)) { 1138 mr_asprintf(command, "umount %s", bkpinfo->media_device);1138 mr_asprintf(command, "umount -d %s", bkpinfo->media_device); 1139 1139 run_program_and_log_output(command, 2); 1140 1140 mr_free(command); -
branches/3.1/mondo/src/common/newt-specific.c
r2874 r2937 262 262 char *tmp1 = NULL; 263 263 264 mr_asprintf(tmp,"ps %s | grep \" %s \" | awk '{print %s;}' | grep -v \"grep\"", ps_options, str , ps_proc_id);264 mr_asprintf(tmp,"ps %s | grep \" %s \" | grep -v \"grep\" | awk '{print %s;}'", ps_options, str , ps_proc_id); 265 265 run_program_and_log_output(tmp, TRUE); 266 266 if (strlen(tmp) > 0) { … … 320 320 chdir("/"); 321 321 if (g_selfmounted_isodir) { 322 mr_asprintf(command, "umount %s", g_selfmounted_isodir);322 mr_asprintf(command, "umount -d %s", g_selfmounted_isodir); 323 323 run_program_and_log_output(command, 5); 324 324 mr_free(command); … … 368 368 char *command = NULL; 369 369 370 chdir("/"); 371 run_program_and_log_output("umount " MNT_CDROM, FALSE); 370 /* Before removing dir, make sure we're out of them */ 371 chdir("/tmp"); 372 run_program_and_log_output("umount -d " MNT_CDROM, FALSE); 372 373 if (g_selfmounted_isodir) { 373 mr_asprintf(command, "umount %s", g_selfmounted_isodir);374 mr_asprintf(command, "umount -d %s", g_selfmounted_isodir); 374 375 run_program_and_log_output(command, 1); 375 376 mr_free(command); … … 382 383 log_msg(8,"tempdir is %s",bkpinfo->tmpdir); 383 384 if (strstr(bkpinfo->tmpdir ,"mondo.tmp.") != NULL) { 384 log_msg(8,"erasing tempdir ");385 log_msg(8,"erasing tempdir %s",bkpinfo->tmpdir); 385 386 mr_asprintf(command, "rm -Rf %s", bkpinfo->tmpdir); 386 387 system(command); … … 391 392 log_msg(8,"scratchdir is %s", bkpinfo->scratchdir); 392 393 if (strstr(bkpinfo->scratchdir ,"mondo.scratch.") != NULL) { 393 log_msg(8,"erasing scratchdir ");394 log_msg(8,"erasing scratchdir %s",bkpinfo->scratchdir); 394 395 mr_asprintf(command, "rm -Rf %s", bkpinfo->scratchdir); 395 396 system(command); … … 579 580 newtCenteredWindow(40, 7, title); 580 581 g_isoform_main = newtForm(NULL, NULL, 0); 581 g_isoform_timeline = newtLabel(1, 5, " This is the timeline");582 g_isoform_pcline = newtLabel(1, 6, " This is the pcline");582 g_isoform_timeline = newtLabel(1, 5, " "); 583 g_isoform_pcline = newtLabel(1, 6, " "); 583 584 newtFormAddComponents(g_isoform_main, g_isoform_timeline, 584 585 g_isoform_pcline, g_isoform_header, 585 586 g_isoform_scale, NULL); 587 newtDrawForm(g_isoform_main); 586 588 newtRefresh(); 587 589 } … … 647 649 g_scale = newtScale(3, 6, 54, (long long)g_maximum_progress); 648 650 g_progressForm = newtForm(NULL, NULL, 0); 649 g_percentline = newtLabel(10, 9, " This is the percentline");650 g_timeline = newtLabel(10, 8, " This is the timeline");651 g_percentline = newtLabel(10, 9, " "); 652 g_timeline = newtLabel(10, 8, " "); 651 653 newtFormAddComponents(g_progressForm, g_percentline, g_timeline, g_scale, g_blurb1, g_blurb3, g_blurb2, NULL); 652 654 newtPushHelpLine(b1c); 655 newtDrawForm(g_progressForm); 653 656 newtRefresh(); 654 657 } … … 969 972 } 970 973 if (!g_text_mode) { 974 newtDrawForm(g_isoform_main); 971 975 newtRefresh(); 972 976 } … … 1100 1104 mr_free(percentline_str); 1101 1105 1106 newtDrawForm(g_progressForm); 1102 1107 newtRefresh(); 1103 1108 } -
branches/3.1/mondo/src/mondorestore/mondo-prep.c
r2816 r2937 10 10 #include "mondoprep.h" 11 11 #include "../common/libmondo.h" 12 #include "../common/libmondo-tools-EXT.h" 12 13 #include "mondo-rstr-tools-EXT.h" 13 14 #include <sys/ioctl.h> … … 43 44 44 45 FILE *g_fprep = NULL; 45 46 46 extern char *g_mondo_cfg_file; // where m*ndo-restore.cfg (the config file) is stored 47 47 48 48 int g_partition_table_locked_up = 0; 49 50 51 52 53 54 55 56 49 57 50 … … 323 316 res = run_program_and_log_output(command, 5); 324 317 if (res > 0 && (p = strstr(command, "lvm "))) { 318 log_msg(0, "%s --> %d failed so removing lvm just in case", command, res); 325 319 *p = *(p + 1) = *(p + 2) = ' '; 326 320 res = run_program_and_log_output(command, 5); … … 545 539 char *level = NULL; 546 540 char *program = NULL; 541 char *tmp = NULL; 542 char *oldmd = NULL; 543 char *bootdevice; 544 char *name; 545 546 malloc_string(bootdevice); 547 malloc_string(name); 547 548 548 549 // leave straight away if raidlist is initial or has no entries … … 589 590 // - faulty devices ignored 590 591 // - persistent superblock always used as this is recommended 591 mr_asprintf(program, "mdadm --create --force --run --auto=yes %s --level=%s --raid-devices=%d", raidlist->el[i].raid_device, level, raidlist->el[i].data_disks.entries); 592 // As per bug #473, the parameter "-e 0.90" is used only when: 593 // 1) It detects that system boots from Raid-1 594 // 2) grub bootloader < v1 is used. 595 // Otherwise it won't boot which is bad. 596 read_cfg_var(g_mondo_cfg_file, "bootloader.device", bootdevice); 597 read_cfg_var(g_mondo_cfg_file, "bootloader.name", name); 598 if (strcmp(name,"GRUB") == 0) { 599 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output("grub --version")); 600 if ((strstr(tmp, "GRUB 0.9") != NULL) && (strcmp(raidlist->el[i].raid_device,device) == 0)) { 601 mr_free(oldmd); 602 mr_asprintf(oldmd, "-e 0.90"); 603 log_it("Forcing old metadata 0.90 for md on %s for old GRUB", device); 604 } 605 } else if ((strcmp(name,"LILO") == 0) && (strcmp(raidlist->el[i].raid_device,device) == 0)) { 606 mr_free(oldmd); 607 mr_asprintf(oldmd, "-e 0.90"); 608 log_it("Forcing old metadata 0.90 for md on %s for LILO", device); 609 } else { 610 mr_asprintf(oldmd, ""); 611 } 612 mr_free(device); 613 mr_free(name); 614 615 mr_asprintf(program, "mdadm --create --force --run --auto=yes %s --level=%s --raid-devices=%d %s", raidlist->el[i].raid_device, level, raidlist->el[i].data_disks.entries, oldmd); 616 mr_free(oldmd); 592 617 if (raidlist->el[i].parity != -1) { 593 618 mr_asprintf(strtmp, "%s", program); … … 2289 2314 2290 2315 /** float ***********************************************************/ 2291 long longfactor;2316 float factor; 2292 2317 long long new_size; 2293 2318 … … 2322 2347 2323 2348 drivemntlist = malloc(sizeof(struct mountlist_reference)); 2324 drivemntlist->el = 2325 malloc(sizeof(struct mountlist_line *) * MAX_MOUNTLIST_ENTRIES); 2349 drivemntlist->el = malloc(sizeof(struct mountlist_line *) * MAX_MOUNTLIST_ENTRIES); 2326 2350 2327 2351 if (!drivemntlist) { … … 2337 2361 } 2338 2362 2339 if (original_size_of_drive <= 0 ) {2363 if (original_size_of_drive <= 0LL) { 2340 2364 log_to_screen("Cannot resize %s's entries. Drive not found.", drive_name); 2341 2365 return; 2342 2366 } 2343 factor = (current_size_of_drive) / (original_size_of_drive); 2344 log_to_screen("Disk %s was %lld MB; is now %lld MB; Proportionally resizing partitions (factor ~= %lld)", drive_name, original_size_of_drive/1024, current_size_of_drive/1024, factor); 2367 factor = ((float)current_size_of_drive/(float)original_size_of_drive); 2368 mr_asprintf(tmp, "Disk %s was %lld MB; is now %lld MB; Proportionally resizing partitions (factor ~= %.5f)", 2369 drive_name, original_size_of_drive/1024, current_size_of_drive/1024, factor); 2370 log_to_screen(tmp); 2371 mr_free(tmp); 2345 2372 2346 2373 lastpart = drivemntlist->entries - 1; … … 2348 2375 /* the 'atoi' thing is to make sure we don't try to resize _images_, whose formats will be numeric */ 2349 2376 if (!atoi(drivemntlist->el[partno]->format)) { 2350 new_size = ( drivemntlist->el[partno]->size) * factor;2377 new_size = (long long)((drivemntlist->el[partno]->size) * factor); 2351 2378 } else { 2352 2379 new_size = drivemntlist->el[partno]->size; -
branches/3.1/mondo/src/mondorestore/mondo-rstr-newt.c
r2816 r2937 1804 1804 #undef ACOMP 1805 1805 1806 newtDrawForm(editraidForm); 1806 1807 newtRefresh(); 1807 1808 b_res = newtRunForm(editraidForm); -
branches/3.1/mondo/src/mondorestore/mondo-rstr-tools.c
r2850 r2937 205 205 return (1); 206 206 } 207 paranoid_system("umount "MNT_CDROM" 2> /dev/null"); /* just in case */207 paranoid_system("umount -d " MNT_CDROM " 2> /dev/null"); /* just in case */ 208 208 209 209 if (is_this_device_mounted(g_isodir_device)) { … … 612 612 } 613 613 } 614 run_program_and_log_output("umount "MNT_CDROM, FALSE);614 run_program_and_log_output("umount -d "MNT_CDROM, FALSE); 615 615 if (!does_file_exist(cfg_file)) { 616 616 log_it("%s",cfg_file); … … 684 684 if (does_file_exist(MNT_CDROM"/archives/filelist.0")) { 685 685 bkpinfo->backup_media_type = cdr; 686 run_program_and_log_output("umount "MNT_CDROM, 1);686 run_program_and_log_output("umount -d "MNT_CDROM, 1); 687 687 log_it 688 688 ("Re-jigging configuration AGAIN. CD-R, not ISO."); … … 1414 1414 if (res) { 1415 1415 popup_and_OK 1416 ("GRUB installation failed. Please install manually using 'grub-install' or similar command. You are now chroot()'ed to your restored system. Please type 'exit' when you are done."); 1417 newtSuspend(); 1418 system("chroot " MNT_RESTORING); 1419 newtResume(); 1420 popup_and_OK("Thank you."); 1416 ("GRUB installation failed. You will now edit fstab, mtab, device.map and menu.lst/grub.cfg in order to fix grub install"); 1417 if (!g_text_mode) { 1418 newtSuspend(); 1419 } 1420 sprintf(tmp, "chroot %s %s /etc/fstab", MNT_RESTORING, editor); 1421 paranoid_system(tmp); 1422 sprintf(tmp, "chroot %s %s /etc/mtab", MNT_RESTORING, editor); 1423 paranoid_system(tmp); 1424 if (does_file_exist(MNT_RESTORING"/boot/grub/menu.lst")) { 1425 sprintf(tmp, "chroot %s %s /boot/grub/menu.lst", MNT_RESTORING, editor); 1426 } else if (does_file_exist(MNT_RESTORING"/boot/grub/grub.cfg")) { 1427 sprintf(tmp, "chroot %s %s /boot/grub/grub.cfg", MNT_RESTORING, editor); 1428 } 1429 paranoid_system(tmp); 1430 sprintf(tmp, "chroot %s %s /boot/grub/device.map", MNT_RESTORING, editor); 1431 paranoid_system(tmp); 1432 if (!g_text_mode) { 1433 newtResume(); 1434 } 1435 sprintf(command, "stabgrub-me %s", boot_device); 1436 res = run_program_and_log_output(command, 1); 1437 if (res) { 1438 popup_and_OK 1439 ("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 newtSuspend(); 1441 system("chroot " MNT_RESTORING); 1442 newtResume(); 1443 popup_and_OK("Thank you."); 1444 } else { 1445 popup_and_OK("GRUB is now installed correctly"); 1446 done = TRUE; 1447 } 1421 1448 } else { 1422 1449 done = TRUE; … … 1933 1960 1934 1961 /* Unmounting the local /proc and /sys first */ 1935 run_program_and_log_output("umount " MNT_RESTORING "/proc",3);1936 run_program_and_log_output("umount " MNT_RESTORING "/sys",3);1962 run_program_and_log_output("umount -d " MNT_RESTORING "/proc",3); 1963 run_program_and_log_output("umount -d " MNT_RESTORING "/sys",3); 1937 1964 1938 1965 for (lino = mountlist->entries - 1; lino >= 0; lino--) { … … 1948 1975 } else { 1949 1976 if (!strcmp(mountlist->el[lino].mountpoint, "/1")) { 1950 mr_asprintf(command, "umount %s/", MNT_RESTORING);1977 mr_asprintf(command, "umount -d %s/", MNT_RESTORING); 1951 1978 log_msg(3, 1952 1979 "Well, I know a certain kitty-kitty who'll be sleeping with Mommy tonight..."); 1953 1980 } else { 1954 mr_asprintf(command, "umount " MNT_RESTORING "%s", mountlist->el[lino].mountpoint);1981 mr_asprintf(command, "umount -d " MNT_RESTORING "%s", mountlist->el[lino].mountpoint); 1955 1982 1956 1983 /* To support latest Ubuntu where /var is a separate FS … … 1998 2025 *END_UNMOUNT_ALL_DEVICES * 1999 2026 **************************************************************************/ 2000 2001 2002 2027 2003 2028 /************************************************************************** -
branches/3.1/mondo/src/mondorestore/mondorestore.c
r2874 r2937 116 116 117 117 /************************************************************************** 118 * COMPAQ P ROLIANTStuff: needs some special help *118 * COMPAQ ProLiant Stuff: needs some special help * 119 119 **************************************************************************/ 120 120 121 121 /** 122 * The message to display if we detect that the user is using a Compaq Pro liant.122 * The message to display if we detect that the user is using a Compaq ProLiant. 123 123 */ 124 124 #define COMPAQ_PROLIANTS_SUCK "Partition and format your disk using Compaq's disaster recovery CD. After you've done that, please reboot with your Mondo media in Interactive Mode." … … 209 209 * @ingroup restoreUtilityGroup 210 210 */ 211 void offer_to_abort_because_Compaq_Pro liants_suck(void)211 void offer_to_abort_because_Compaq_ProLiants_suck(void) 212 212 { 213 213 popup_and_OK(COMPAQ_PROLIANTS_SUCK); … … 256 256 popup_and_OK("No restoring or comparing will take place today."); 257 257 if (is_this_device_mounted("/mnt/cdrom")) { 258 run_program_and_log_output("umount /mnt/cdrom", FALSE);258 run_program_and_log_output("umount -d /mnt/cdrom", FALSE); 259 259 } 260 260 if (g_ISO_restore_mode) { 261 mr_asprintf(tmp, "umount %s", bkpinfo->isodir);261 mr_asprintf(tmp, "umount -d %s", bkpinfo->isodir); 262 262 run_program_and_log_output(tmp, FALSE); 263 263 mr_free(tmp); … … 485 485 if (partition_table_contains_Compaq_diagnostic_partition 486 486 (mountlist)) { 487 offer_to_abort_because_Compaq_Pro liants_suck();487 offer_to_abort_because_Compaq_ProLiants_suck(); 488 488 done = TRUE; 489 489 } else { … … 693 693 } 694 694 if (is_this_device_mounted(MNT_CDROM)) { 695 paranoid_system("umount " MNT_CDROM);695 paranoid_system("umount -d " MNT_CDROM); 696 696 } 697 697 // if (! already_mounted) 698 698 // { 699 if (system("umount /tmp/isodir 2> /dev/null")) {699 if (system("umount -d /tmp/isodir 2> /dev/null")) { 700 700 log_to_screen 701 701 ("WARNING - unable to unmount device where the ISO files are stored."); … … 773 773 if (partition_table_contains_Compaq_diagnostic_partition 774 774 (mountlist)) { 775 offer_to_abort_because_Compaq_Pro liants_suck();775 offer_to_abort_because_Compaq_ProLiants_suck(); 776 776 } else { 777 777 twenty_seconds_til_yikes(); … … 949 949 "Tape : I don't need to unmount or eject the CD-ROM."); 950 950 } else { 951 run_program_and_log_output("umount " MNT_CDROM, FALSE);951 run_program_and_log_output("umount -d " MNT_CDROM, FALSE); 952 952 if (!bkpinfo->please_dont_eject) { 953 953 eject_device(bkpinfo->media_device); 954 954 } 955 955 } 956 run_program_and_log_output("umount " MNT_CDROM, FALSE);956 run_program_and_log_output("umount -d " MNT_CDROM, FALSE); 957 957 if (!bkpinfo->please_dont_eject) { 958 958 eject_device(bkpinfo->media_device); … … 2138 2138 2139 2139 /* Now we need to umount the current media to have the next mounted by insist_on_this_cd_number */ 2140 run_program_and_log_output("umount " MNT_CDROM, FALSE);2140 /* run_program_and_log_output("umount " MNT_CDROM, FALSE); */ 2141 2141 } 2142 2142 mr_free(mds); … … 2635 2635 make_hole_for_dir("/var/log"); 2636 2636 make_hole_for_dir("/tmp/tmpfs"); /* just in case... */ 2637 run_program_and_log_output("umount " MNT_CDROM, FALSE);2637 run_program_and_log_output("umount -d " MNT_CDROM, FALSE); 2638 2638 2639 2639 run_program_and_log_output("rm -Rf /tmp/tmpfs/mondo.tmp.*", FALSE); … … 2669 2669 fout = fopen("/tmp/out.txt", "w"); 2670 2670 fput_string_one_char_at_a_time(stderr, argv[2]); 2671 finish(0);2672 }2673 2674 if (argc == 3 && strcmp(argv[1], "--gendf") == 0) {2675 make_grub_install_scriptlet(argv[2]);2676 2671 finish(0); 2677 2672 } … … 2892 2887 sync(); 2893 2888 if (is_this_device_mounted(MNT_CDROM)) { 2894 run_program_and_log_output("umount " MNT_CDROM, FALSE);2889 run_program_and_log_output("umount -d " MNT_CDROM, FALSE); 2895 2890 } 2896 2891 … … 2950 2945 log_to_screen("Mondo-restore is exiting (retval=%d) ", retval); 2951 2946 2952 mr_asprintf(tmp, "umount %s", bkpinfo->isodir);2947 mr_asprintf(tmp, "umount -d %s", bkpinfo->isodir); 2953 2948 run_program_and_log_output(tmp, 5); 2954 2949 mr_free(tmp); -
branches/3.1/mondo/src/post-nuke.sample/usr/bin/Makefile.am
r424 r2937 1 1 postnukeusrbindir = $(pkgdatadir)/post-nuke.sample/usr/bin 2 postnukeusrbin_SCRIPTS = post-nuke 2 postnukeusrbin_SCRIPTS = post-nuke post-nuke.debian -
branches/3.1/mondo/src/restore-scripts/mondo/grub-MR
r2696 r2937 29 29 fi 30 30 if [ -e "$MNT_RESTORING/boot/grub/stage1" ] ; then 31 echo "Al right then."31 echo "All right then." 32 32 return 33 33 fi … … 136 136 FindBootPart $1 $2 2>&1 | tee -a $LOGFILE 137 137 mbrdev=`echo $1 | sed 's/\([^0-9]*\)[0-9]*$/\1/'` 138 if echo $ bootpart| grep "/cciss/" > /dev/null ; then139 partno=`basename $ bootpart| cut -d'p' -f2`138 if echo $mbrdev | grep "/cciss/" > /dev/null ; then 139 partno=`basename $mbrdev | cut -d'p' -f2` 140 140 mbrdev=`echo $mbrdev | cut -d'p' -f1` 141 elif echo $ bootpart| grep "/mapper/mpath" > /dev/null ; then142 partno=`basename $ bootpart| cut -d'p' -f3`143 mbrdev=`echo $mbrdev | cut -d'p' -f1 `144 else 145 partno=`basename $ bootpart| sed 's/[a-z]*//'`141 elif echo $mbrdev | grep "/mapper/mpath" > /dev/null ; then 142 partno=`basename $mbrdev | cut -d'p' -f3` 143 mbrdev=`echo $mbrdev | cut -d'p' -f1-4` 144 else 145 partno=`basename $mbrdev | sed 's/[a-z]*//'` 146 146 fi 147 147 if [ ! "$partno" ] ; then … … 150 150 partno=$(($partno-1)) 151 151 fi 152 if echo $ bootpart| grep "/md" > /dev/null ; then152 if echo $mbrdev | grep "/md" > /dev/null ; then 153 153 # FIXME: Why this if not used later 154 154 base=`basename $bootpart` -
branches/3.1/website/downloads.shtml
r2850 r2937 31 31 <a href="http://www.mondorescue.org">Web site</a>, 32 32 <a href="ftp://ftp.mondorescue.org">Ftp site (ftp)</a> 33 <a href="http://www.mondorescue.org/ftp">Ftp site (http)</a> 33 34 <a href="rsync://rsync.mondorescue.org::mondorescue-ftp">Ftp site (rsync)</a> 34 35 <ul> … … 38 39 </li> 39 40 </ul> 40 <li><i>Germany</i>:</li>41 <ul>42 <li>Linjection.org:43 <a href="http://mondorescue.linjection.org">Web site</a>,44 <a href="http://mondorescue.linjection.org/ftp">Ftp site (http)</a>45 </li>46 </ul>47 41 <li><i>Italy</i>:</li> 48 42 <ul> 49 <li>Daniele Carbonetti (<a href="http://www.dcl-arch.it">http://www.dcl-arch.it</a>): 50 <a href="http://mondorescue.dcl-arch.it">Web site</a>, 51 <a href="http://www.dcl-arch.it/pub/mondorescue">Ftp site (http)</a> 52 <a href="ftp://ftp.dcl-arch.it/pub/mondorescue">Ftp site (ftp)</a> 53 <a href="rsync://rsync.dcl-arch.it::mondorescue">Ftp site (rsync)</a> 43 <li>Dimitri Bellini (<a href="http://www.quadrata.it/">http://www.quadrata.it/</a>): 44 <a href="http://mondo.quadrata.it">Web site</a>, 45 <a href="ftp://mondo.quadrata.it/">Ftp site (ftp)</a> 46 <a href="http://mondo.quadrata.it/ftp">Ftp site (http)</a> 54 47 <ul> 55 <li>Update times: 2 times/day</li> 56 <li>Internet Bandwith: 100Mbit</li> 57 <li><i>doesn't seem to be active anymore</i></li> 48 <li>Update times: 1 time/day</li> 49 <li>Internet Bandwith: Mbit</li> 58 50 </ul> 59 51 </li> … … 78 70 </div> 79 71 <p><A NAME="dependencies"></A> 80 <p>The solution has been written in C/bash/perl and developed on a <a href="http://www.mandriva.com/">Mandriva</a> <a href="http://www.gnu.org/">Gnu</a>/<a href="http://www.lwn.net/">Linux</a> distribution. For it to work, you will need:</p>72 <p>The solution is being written in C/bash/perl and developed on a <a href="http://www.maegia.cg">Mageia</a> <a href="http://www.gnu.org/">Gnu</a>/<a href="http://www.lwn.net/">Linux</a> distribution. For it to work, you will need:</p> 81 73 <ul> 82 74 <li><b><a href="">afio</a></b>: the packaging tool used to create the archive packets</li> … … 88 80 </ul> 89 81 90 <p>For Ma ndriva/Mandrake distributions, just use the magic:<br>91 <tt>urpmi mondo</tt> </p>82 <p>For Mageia/Mandriva/Mandrake distributions, just use the magic:<br> 83 <tt>urpmi mondo</tt> 92 84 to use the native packages of your distribution, or download the <a href="ftp://ftp.mondorescue.org/mandriva/">repo file</a> mondorescue.addmedia script and launch it if you want to use upstream packages. 93 < p>94 <p>For Fedora distributions, after downloading the <a href="ftp://ftp.mondorescue.org/fedora/">repo file</a> mondorescue.repo and adding it to the /etc/yum.repos.d directory, just use the magic:<br>95 <tt>yum install mondo</tt> </p>96 < p>85 </p><p> 86 <p>For Fedora distributions, after downloading the <a href="ftp://ftp.mondorescue.org/fedora/">repo file</a> mondorescue.repo and adding it to the /etc/yum.repos.d directory, just use the magic:<br> 87 <tt>yum install mondo</tt> 88 </p><p> 97 89 For Debian/Ubuntu, just use the magic: <br> 98 <tt>apt-get install mondo</tt> </p>90 <tt>apt-get install mondo</tt> 99 91 to use the native packages of your distribution, or download the <a href="ftp://ftp.mondorescue.org/debian/">repo file</a> mondorescue.sources.list and add it to your /etc/apt/sources.list.d directory if you want to use upstream packages. 100 < p>92 </p><p> 101 93 For the other RPM based distributions, you will have to issue a <br> 102 94 <tt>rpm -ivh *.rpm</tt><br> … … 122 114 <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> 123 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> 124 <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> 116 <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> 125 118 <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> 126 <li>Mageia <a href="ftp://ftp.mondorescue.org/mageia/1">1</a>.</li>127 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. 128 120 <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> -
branches/3.1/website/mondorescue.org.conf
r2155 r2937 5 5 ServerAlias mondorescue.org 6 6 ServerAdmin webmaster@mondorescue.org 7 DocumentRoot / mondo/www/html/mondo7 DocumentRoot /prj/www/html/mondorescue 8 8 CustomLog /var/log/httpd/www.mondorescue.org/access_log combined 9 9 Errorlog /var/log/httpd/www.mondorescue.org/error_log … … 11 11 RewriteRule ^/index\.html$ /index.shtml 12 12 RewriteRule ^/$ /index.shtml 13 SetEnv TRAC_ENV "/mondo/trac/mondorescue.env"14 13 15 <Directory "/ mondo/www/html/mondo">14 <Directory "/prj/www/html/mondorescue"> 16 15 DirectoryIndex index.shtml 17 16 Options -Indexes MultiViews FollowSymLinks +Includes … … 21 20 </Directory> 22 21 23 <Directory "/mondo/www/cgi-bin"> 22 <Directory "/prj/www/html/mondorescue/ftp"> 23 Options Indexes MultiViews FollowSymLinks 24 AllowOverride None 25 Order allow,deny 26 Allow from all 27 </Directory> 28 29 <Directory "/var/www/cgi-bin"> 24 30 AllowOverride All 25 31 Options ExecCGI FollowSymLinks … … 28 34 </Directory> 29 35 30 ScriptAlias /cgi-bin/ "/mondo/www/cgi-bin/"31 32 36 </VirtualHost> 33 37 34 38 <VirtualHost 10.3.252.23> 35 39 ServerName trac.mondorescue.org 36 SetEnv TRAC_ENV "/mondo/trac/mondorescue.env" 37 DocumentRoot /mondo/www/cgi-bin/trac.cgi 40 DocumentRoot /prj/www/html/mondorescue 38 41 ServerAdmin webmaster@mondorescue.org 39 42 CustomLog /var/log/httpd/www.mondorescue.org/access_log combined 40 43 Errorlog /var/log/httpd/www.mondorescue.org/error_log 41 44 42 # fix mdk bug #16298 43 PassEnv LC_ALL 44 PassEnv LANG 45 46 <Directory "/mondo/www/cgi-bin"> 45 <Directory "/var/www/cgi-bin"> 47 46 AllowOverride All 48 47 Options ExecCGI FollowSymLinks … … 51 50 </Directory> 52 51 53 Alias /trac/ "/usr/share/trac/htdocs/" 54 ScriptAlias /cgi-bin/ "/mondo/www/cgi-bin/" 52 <Location "/"> 53 SetEnv TRAC_ENV "/prj/trac/mondorescue.env" 54 </Location> 55 55 56 # You need something like this to authenticate users 57 #<Location "/login"> 58 #AuthType Basic 59 #AuthName "MondoRescue" 60 #AuthUserFile /usr/local/etc/trac.htpasswd 61 #Require valid-user 62 #</Location> 56 ScriptAlias / "/var/www/cgi-bin/trac.fcgi/" 63 57 </VirtualHost> 64 58 … … 66 60 ServerName oldwww.mondorescue.org 67 61 ServerAdmin webmaster@mondorescue.org 68 DocumentRoot / mondo/www/html/oldwww62 DocumentRoot /prj/www/html/oldmondorescue 69 63 CustomLog /var/log/httpd/oldwww.mondorescue.org/access_log combined 70 64 Errorlog /var/log/httpd/oldwww.mondorescue.org/error_log 71 <Directory "/ mondo/www/html/oldwww">65 <Directory "/prj/www/html/oldmondorescue"> 72 66 Options -Indexes MultiViews FollowSymLinks +Includes 73 67 AllowOverride None … … 80 74 ServerName www1.mondorescue.org 81 75 ServerAdmin webmaster@mondorescue.org 82 DocumentRoot / mondo/www/html/test76 DocumentRoot /prj/www/html/testmondorescue 83 77 CustomLog /var/log/httpd/www1.mondorescue.org/access_log combined 84 78 Errorlog /var/log/httpd/www1.mondorescue.org/error_log 85 <Directory "/ mondo/www/html/test">79 <Directory "/prj/www/html/testmondorescue"> 86 80 Options -Indexes MultiViews FollowSymLinks +Includes 87 81 AllowOverride None … … 94 88 ServerName mondo.hpintelco.org 95 89 ServerAdmin webmaster@mondorescue.org 96 DocumentRoot / var/www/html90 DocumentRoot /prj/www/html/mondorescue 97 91 CustomLog /var/log/httpd/mondo.hpintelco.org/access_log combined 98 92 Errorlog /var/log/httpd/mondo.hpintelco.org/error_log 99 <Directory "/ var/www/html">93 <Directory "/prj/www/html/mondorescue"> 100 94 Options Indexes MultiViews FollowSymLinks +Includes 101 95 AllowOverride None … … 103 97 Allow from all 104 98 </Directory> 99 <Directory "/prj/www/html/mondorescue/ftp"> 100 Options Indexes MultiViews FollowSymLinks 101 AllowOverride None 102 Order allow,deny 103 Allow from all 104 </Directory> 105 105 106 </VirtualHost> 106 107 … … 109 110 ServerAlias mondorescue.com 110 111 ServerAdmin webmaster@mondorescue.com 111 DocumentRoot / mondo/www/html/mondo112 DocumentRoot /prj/www/html/mondorescue 112 113 CustomLog /var/log/httpd/www.mondorescue.com/access_log combined 113 114 Errorlog /var/log/httpd/www.mondorescue.com/error_log 114 <Directory "/ mondo/www/html/mondo">115 <Directory "/prj/www/html/mondorescue"> 115 116 DirectoryIndex index.shtml 116 117 Options -Indexes MultiViews FollowSymLinks +Includes … … 119 120 Allow from all 120 121 </Directory> 122 <Directory "/prj/www/html/mondorescue/ftp"> 123 Options Indexes MultiViews FollowSymLinks 124 AllowOverride None 125 Order allow,deny 126 Allow from all 127 </Directory> 128 121 129 </VirtualHost>
Note:
See TracChangeset
for help on using the changeset viewer.