Changeset 3147 in MondoRescue for branches/3.1/mindi/mindi
- Timestamp:
- Jun 19, 2013, 8:34:46 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.1/mindi/mindi
r2937 r3147 21 21 # In case of problem with udev you can try to add udevdebug 22 22 MINDI_ADDITIONAL_BOOT_PARAMS="devfs=nomount noresume selinux=0 barrier=off udevtimeout=10" 23 MINDI_DEFAULT_BOOT_OPTION="interactive" 24 # For a CD Recovery use 10000 instead rather. Beware till Hardcoded below. Planned to be changed on the perl version 25 # So this parameter only applies to non CD recovery. 26 MINDI_BOOT_TIMEOUT="300" 23 27 24 28 MINDI_REV=PBREV … … 35 39 TMPDIR=/tmp 36 40 37 EXTRA_SPACE= 80152# increase if you run out of ramdisk space38 BOOT_SIZE= 36864# size of the boot disk41 EXTRA_SPACE=120000 # increase if you run out of ramdisk space 42 BOOT_SIZE=65600 # size of the boot disk 39 43 40 44 PROMPT_MAKE_CD_IMAGE="yes" … … 58 62 MY_FSTAB=/etc/fstab 59 63 TAPE_MODS="ht st osst ide-tape ide_tape" 60 SCSI_MODS="3w-xxxx 3w_xxxx 3w_9xxx 3w-9xxx 53c7,8xx a100u2w a320raid aacraid adpahci advansys aha152x aha1542 aha1740 aic79xx aic79xx_mod aic7xxx aic7xxx_mod aic7xxx_old AM53C974 atp870u BusLogic cciss cpqfc hpsa dmx3191d dpt_i2o dtc eata eata_dma eata_pio fdomain gdth g_NCR5380 i2o_block i2o_core ide-scsi ieee1394 imm in2000 initio ips iscsi iscsi_tcp libiscsi scsi_transport_iscsi libiscsi_tcp isp megaraid megaraid_mm megaraid_mbox megaraid_sas mega_sr mptbase mptscsih mptsas mptspi mptfc mptscsi mptctl NCR53c406a ncr53c8xx nsp32 pas16 pci2000 pci2220i pcmcia ppa psi240i qla1280 qla2200 qla2300 qla2400 qla2xxx qla2xxx_conf qlogicfas qlogicfc qlogicisp qlogicfas qlogicfas408 raw1394 scsi_mod scsi_transport_sas scsi_transport_spi scsi_transport_fc sd_mod crc_t10dif crc-t10dif seagate sg sim710 sr_mod sym53c416 sym53c8xx sym53c8xx_2 t128 tmscsim u14-34f ultrastor wd7000 vmhgfs intermodule scsi_dh scsi_tgt emcpdm emcpgpx emcpmpx emcpdc395x diskdumplib scsi_dump_register arcmsr"64 SCSI_MODS="3w-xxxx 3w_xxxx 3w_9xxx 3w-9xxx 53c7,8xx a100u2w a320raid aacraid adpahci advansys aha152x aha1542 aha1740 aic79xx aic79xx_mod aic7xxx aic7xxx_mod aic7xxx_old AM53C974 atp870u BusLogic cciss cpqfc hpsa dmx3191d dpt_i2o dtc eata eata_dma eata_pio fdomain gdth g_NCR5380 i2o_block i2o_core ide-scsi ieee1394 imm in2000 initio ips iscsi be2iscsi cxgb3i cxgb3 cxgb4i cxgb4 libcxgbi iscsi_boot_sysfs iscsi_target_mod iscsi_tcp libiscsi libiscsi2 scsi_transport_iscsi scsi_transport_iscsi2 libiscsi_tcp uio isp megaraid megaraid_mm megaraid_mbox megaraid_sas mega_sr mptbase mptscsih mptsas mptspi mptfc mptscsi mptctl NCR53c406a ncr53c8xx nsp32 pas16 pci2000 pci2220i pcmcia ppa psi240i qla1280 qla2200 qla2300 qla2400 qla2xxx qla2xxx_conf qlogicfas qlogicfc qlogicisp qlogicfas qlogicfas408 raw1394 scsi_mod scsi_transport_sas scsi_transport_spi scsi_transport_fc sd_mod crc_t10dif crc-t10dif seagate sg sim710 sr_mod sym53c416 sym53c8xx sym53c8xx_2 t128 tmscsim u14-34f ultrastor wd7000 vmhgfs intermodule scsi_dh scsi_tgt emcpdm emcpgpx emcpmpx emcp scsi_dh_emc scsi_dh_alua dc395x diskdumplib scsi_dump_register arcmsr" 61 65 62 66 # ide-probe-mod 63 IDE_MODS="ide ide-floppy floppy ide-generic ide-detect ide-mod ide-disk ide_disk ide-cd ide_cd ide_cd_mod ide-cd_mod ide-cs ide-core ide_core ide-gd_mod ide_gd_mod edd paride ata_generic ide_pci_generic ata_piix libata dock via82cxxx generic nvidia ahci libahci sata_nv cmd64x pata_ amd pata_marvell pata_serverworks pata_sis pata_sil680 pata_jmicron pata_atiixpamd74xx sis5513 jmicron sata_promise sata_via serverworks sata_svw blkbk virtio virtio_ring virtio_pci virtio_blk virtio_balloon"67 IDE_MODS="ide ide-floppy floppy ide-generic ide-detect ide-mod ide-disk ide_disk ide-cd ide_cd ide_cd_mod ide-cd_mod ide-cs ide-core ide_core ide-gd_mod ide_gd_mod edd paride ata_generic ide_pci_generic ata_piix libata dock via82cxxx generic nvidia ahci libahci sata_nv cmd64x pata_via pata_amd pata_marvell pata_serverworks pata_sis pata_sil680 pata_jmicron pata_atiixp pata_acpi amd74xx sis5513 jmicron sata_promise sata_via serverworks sata_svw blkbk virtio virtio_ring virtio_pci virtio_blk virtio_balloon" 64 68 PCMCIA_MODS="pcmcia_core ds yenta_socket" 65 USB_MODS="usb-storage usb-ohci usb-uhci usbcore usb_ storage input hiduhci_hcd ehci_hcd uhci-hcd ehci-hcd ohci-hcd ohci_hcd xhci usbkbd usbhid keybdev mousedev libusual scsi_mod ff-memless ums_cypress ums-cypress cp210x usbserial"66 NET_MODS="auth_rpcgss sunrpc nfs nfs_acl lockd fscache loop mii 3c59x e100 bcm5700 bnx2 bnx2x bnx2i mdio e1000 e1000e igb dca eepro100 ne2k-pci tg3 libphy pcnet32 8139cp 8139too 8390 forcedeth vmxnet vmxnet3 vmnet exportfs fuse libcrc32c crc32c netbk xenblktap r8169 virtio_net"69 USB_MODS="usb-storage usb-ohci usb-uhci usbcore usb_common usb-common usb_storage input hid hid_generic uhci_hcd ehci_hcd uhci-hcd ehci-hcd ohci-hcd ohci_hcd xhci usbkbd usbhid keybdev mousedev libusual scsi_mod ff-memless ums_cypress ums-cypress cp210x usbserial" 70 NET_MODS="auth_rpcgss sunrpc nfs nfs_acl lockd fscache loop mii 3c59x e100 bcm5700 cnic be2net 8021q bnx2 bnx2x bnx2i mdio e1000 e1000e igb dca eepro100 ne2k-pci tg3 libphy pcnet32 8139cp 8139too 8390 forcedeth vmxnet vmxnet3 vmnet exportfs fuse crc32c libcrc32c netbk xenblktap r8169 virtio_net via_rhine garp" 67 71 CDROM_MODS="$TAPE_MODS $IDE_MODS $USB_MODS $PCMCIA_MODS $SCSI_MODS $NET_MODS af_packet cdrom isocd isofs inflate_fs nls_iso8859-1 nls_base nls_cp437 nls_utf8 sg sr_mod zlib_inflate iso9660 vfat fat" 68 72 # Those modules will only go on the backup media, not the boot media. 69 EXTRA_MODS="$CDROM_MODS loop md-mod linear raid0 raid1 xor raid10 raid5 raid456 raid6_pq async_pq xor async_tx async_memcpy async_xor lvm-mod dm-mod dm_mod dm-snapshot dm_snapshot dm-zero dm_zero dm-mirror dm_mirror dm-multipath dm-round-robin dm-emc dm-hp-sw dm-rdac dm-region-hash dm-snapshot dm-log multipath jfs xfs xfs_support pagebuf reiserfs ext2 ext3 minix nfs nfs_acl nfsd lockd sunrpc jbd mbcache ext4 jbd2 crc16 ocfs2 ocfs2_dlm ocfs2_nodemanager configfs"73 EXTRA_MODS="$CDROM_MODS loop md-mod linear raid0 raid1 xor raid10 raid5 raid456 raid6_pq async_pq xor async_tx async_memcpy async_xor lvm-mod dm-mod dm_mod dm-snapshot dm_snapshot dm-zero dm_zero dm-mirror dm_mirror dm-multipath dm-round-robin dm-emc dm-hp-sw dm-rdac dm-region-hash dm-snapshot dm-log multipath jfs xfs btrfs zlib_deflate xfs_support pagebuf reiserfs ext2 ext3 minix nfs nfs_acl nfsd lockd sunrpc jbd mbcache ext4 jbd2 crc16 ocfs2 ocfs2_dlm ocfs2_nodemanager configfs vxodm vxgms vxglm gab llt dmpaa vxspec vxio vxdmp vxportal fdd vxfs " 70 74 # Replace with that line for HP OCMP e.g. 71 75 #DENY_MODS="MPS_Driver_Mapper mps octtldrv tscttl streams kqemu fdomain" 72 DENY_MODS="kqemu "76 DENY_MODS="kqemu vxfen" 73 77 # Force some modules to be included 74 78 FORCE_MODS="" … … 118 122 fi 119 123 124 125 # Function to log on screen only 126 LogScreen() { 127 if [ -e /dev/stderr ] ; then 128 echo -e "$1" >> /dev/stderr 129 elif [ -e /usr/bin/logger ] ; then 130 /usr/bin/logger -s $1 131 fi 132 } 133 134 # Function to log in log file only 135 LogFile() { 136 137 echo -e "$1" >> $LOGFILE 138 if [ _"$2" != _"" ]; then 139 grep -Ev "tar: Removing \`/\'" "$2" >> $LOGFILE 140 fi 141 rm -f "$2" 142 } 143 144 # Function to log in both screen and logfile 145 LogAll() { 146 LogScreen "$1" 147 LogFile "$1" "$2" 148 } 149 150 # Preserved for compatibility 151 LogIt() { 152 LogAll "$1" "$2" 153 } 154 120 155 # Last function called before exiting 121 156 # Parameter is exit code value … … 126 161 if [ _"$MONDO_SHARE" != _"" ] ; then 127 162 echo "------------- mindi logfile included -------------------------" >> /var/log/mondoarchive.log 128 cat $LOGFILE >> /var/log/mondoarchive.log 163 if [ -f $LOGFILE ]; then 164 cat $LOGFILE >> /var/log/mondoarchive.log 165 else 166 echo "No LOGFILE available in that mindi run" >> /var/log/mondoarchive.log 167 fi 129 168 echo "--------------------------------------------------------------">> /var/log/mondoarchive.log 130 169 fi … … 139 178 exit $1 140 179 } 141 142 LogOnly() {143 echo -e "$1" >> $LOGFILE144 if [ _"$2" != _"" ]; then145 grep -Ev "tar: Removing \`/\'" "$2" >> $LOGFILE146 fi147 rm -f "$2"148 }149 150 # Function to log on screen only151 LogScreen() {152 if [ -e /dev/stderr ] ; then153 echo -e "$1" >> /dev/stderr154 elif [ -e /usr/bin/logger ] ; then155 /usr/bin/logger -s $1156 fi157 }158 159 # Function to log in log file only160 LogFile() {161 162 echo -e "$1" >> $LOGFILE163 if [ _"$2" != _"" ]; then164 grep -Ev "tar: Removing \`/\'" "$2" >> $LOGFILE165 fi166 rm -f "$2"167 }168 169 # Function to log in both screen and logfile170 LogAll() {171 LogScreen "$1"172 LogFile "$1" "$2"173 }174 175 # Preserved for compatibility176 LogIt() {177 LogAll "$1" "$2"178 }179 180 180 181 181 Die() { … … 239 239 [ "$KBDEPTH" -gt "128" ] && Die "Edit $MINDI_SBIN/mindi and disable FindAndAddUserKeyboardMappingFile (line 2160, approx.)" 240 240 if [ -e "$bigdir/$mappath" ] ; then 241 LogFile " $mappath already added"241 LogFile "INFO: $mappath already added" 242 242 return 243 243 elif [ -d "$bigdir/$mappath" ] ; then … … 245 245 return 246 246 fi 247 LogFile " Added kbd map $mappath"247 LogFile "INFO: Added kbd map $mappath" 248 248 if [ ! -e "$mappath" ] ; then 249 249 mappath=`grep "i[3-8]86" $MINDI_TMP/keymaps.find | grep "$locale[^r][^/]" | grep -vx " *#.*"` 250 250 if [ ! -e "$mappath" ] ; then 251 LogAll " Cannot add $mappath: kbd map file not found"251 LogAll "WARNING: Cannot add $mappath: kbd map file not found" 252 252 return 253 253 fi 254 else 255 echo -en "`basename $mappath | tr '.' '#' | sed s/#kmap#gz// | sed s/#inc#gz//` " | tr '#' '.' 254 256 fi 255 257 … … 257 259 mkdir -p $bigdir/etc 258 260 # TODO: why not use the cp.lis here ? 259 tar cf - -C / $mappath 2>> $MINDI_TMP/$$.log | (cd "$bigdir" ; tar xf -) || LogAll " AKMF -- Could not copy $mappath to $bigdir" $MINDI_TMP/$$.log261 tar cf - -C / $mappath 2>> $MINDI_TMP/$$.log | (cd "$bigdir" ; tar xf -) || LogAll "WARNING: AKMF -- Could not copy $mappath to $bigdir" $MINDI_TMP/$$.log 260 262 if [ "`echo $mappath | grep -F ".gz"`" ] ; then 261 included_list=`gzip -dc $mappath | grep -Fi include | sed s/'"'// | sed s/'"'//| cut -d' ' -f2`263 included_list=`gzip -dc $mappath | grep -Fi include | sed s/'"'//g | cut -d' ' -f2` 262 264 else 263 included_list=`grep -Fi include $mappath | sed s/'"'// | sed s/'"'//| cut -d' ' -f2`265 included_list=`grep -Fi include $mappath | sed s/'"'//g | cut -d' ' -f2` 264 266 fi 265 267 for included_item in $included_list ; do … … 278 280 279 281 CopyDependenciesToDirectory() { 280 local outdir incoming fname counter d found282 local outdir incoming counter d found tdir 281 283 outdir=$1 282 noof_lines=$2283 284 mkdir -p $outdir 284 285 incoming=`ReadLine` 285 progress=0286 counter=0 286 287 while [ "$incoming" != "" ] ; do 287 288 # Non absolute file names should not arrive till here => skipped 288 289 if [ `echo "$incoming" | cut -c1` != '/' ]; then 289 LogAll " Unable to handle $incoming"290 LogAll "WARNING: Unable to handle $incoming" 290 291 incoming=`ReadLine` 291 292 continue … … 298 299 d=`dirname "$d"` 299 300 done 300 if [ -d "$incoming" ] && [ ! -h "$incoming" ]; then301 if [ -d "$incoming" ]; then 301 302 find $incoming/* -maxdepth 0 2> /dev/null | CopyDependenciesToDirectory $outdir 0 302 303 elif [ -e "$incoming" ] && [ $found = "false" ]; then 303 tar cf - -C / $incoming 2>> $MINDI_TMP/$$.log | (cd "$outdir" ; tar xf -) || Die "Cannot copy $incoming to $outdir - did you run out of disk space?" $MINDI_TMP/$$.log 304 304 if [ ! -h "$incoming" ]; then 305 tar cf - -C / $incoming 2>> $MINDI_TMP/$$.log | (cd "$outdir" ; tar xf -) || Die "Cannot copy $incoming to $outdir - did you run out of disk space?" $MINDI_TMP/$$.log 306 else 307 tdir=`dirname "$incoming"` 308 if [ ! -e "$outdir/$tdir" ]; then 309 mkdir -p "$outdir/$tdir" 310 fi 311 cp --no-dereference --preserve=all $incoming "$outdir/$tdir" 312 fi 305 313 # Only uncompress modules if not using udevd 306 314 if [ "`echo "$incoming" | grep "lib/modules/.*\..*o\.gz"`" != "" ] && [ "`ps auxww | grep -v grep | grep -qw udevd`" != "" ]; then 307 gunzip -f $outdir/$incoming || LogAll " Cannot gunzip $outdir/$incoming"308 fi 309 [ -x "$outdir" ] && StripExecutable $outdir "-$filename-"310 progress=$(($progress+1))311 LogProgress $ progress $noof_lines315 gunzip -f $outdir/$incoming || LogAll "WARNING: Cannot gunzip $outdir/$incoming" 316 fi 317 [ -x "$outdir" ] && StripExecutable $outdir 318 counter=$(($counter+1)) 319 LogProgress $counter $2 312 320 fi 313 321 incoming=`ReadLine` … … 326 334 327 335 328 329 336 DropOptimizedLibraries() { 330 local outdir filelist list_of_optimized_libraries optimized_lib_name vanilla_lib_name reason msg resolved res progress337 local outdir filelist list_of_optimized_libraries optimized_lib_name vanilla_lib_name reason msg resolved res 331 338 filelist=$1 332 339 outdir=$2 333 340 334 progress=0335 341 list_of_optimized_libraries=`grep "lib/i[5-7]86/" $filelist` 336 342 if [ "$list_of_optimized_libraries" = "" ] ; then 337 343 return 0 338 else339 noof_lines=`echo $list_of_optimized_libraries | tr ' ' '\n' | wc -l`340 344 fi 341 345 echo -en "Dropping i686-optimized libraries if appropriate" 342 346 for optimized_lib_name in $list_of_optimized_libraries ; do 347 echo -en "." 343 348 reason="" 344 349 vanilla_lib_name=`echo "$optimized_lib_name" | sed -e 's/i[5-7]86//' -e 's/cmov//' -e 's/nosegneg//' | tr -s '/' '/'` 345 350 echo "$vanilla_lib_name" >> $filelist 346 LogFile " Adding $vanilla_lib_name to filelist"351 LogFile "INFO: Adding $vanilla_lib_name to filelist" 347 352 mkdir -p $outdir$optimized_lib_name > /dev/null 2> /dev/null 348 353 rmdir $outdir$optimized_lib_name > /dev/null 2> /dev/null … … 350 355 # This may return multiple files 351 356 for resolved in `ReadAllLink $vanilla_lib_name`; do 352 LogFile " Adding as deps $resolved to filelist"357 LogFile "INFO: Adding as deps $resolved to filelist" 353 358 vanilla_resolved_name=`echo "$resolved" | sed -e 's/i[5-7]86//' -e 's/cmov//' -e 's/nosegneg//' | tr -s '/' '/'` 354 359 if [ "$vanilla_resolved_name" != "$resolved" ]; then … … 356 361 rmdir $outdir$resolved > /dev/null 2> /dev/null 357 362 ln -sf $vanilla_resolved_name $outdir$resolved 358 LogFile " Excluding deps $resolved"363 LogFile "INFO: Excluding deps $resolved" 359 364 grep -Fvx "$resolved" "$filelist" > $filelist.tmp 360 LogFile " Replacing it with $vanilla_resolved_name"365 LogFile "INFO: Replacing it with $vanilla_resolved_name" 361 366 echo "$vanilla_resolved_name" >> $filelist.tmp 362 367 mv -f $filelist.tmp $filelist 363 368 fi 364 369 done 365 progress=$(($progress+1))366 LogProgress $progress $noof_lines367 370 done 368 371 $AWK '{ print $1; }' $filelist | sort -u > $filelist.tmp … … 374 377 FindAndAddUserKeyboardMappingFile() { 375 378 local r res mapfile mappath included_item included_list keyfile mp locale 376 Log File "Analyzing your keyboard's configuration."379 LogAll "INFO: Analyzing your keyboard's configuration." 377 380 KEYDIR=/lib/kbd 378 381 [ ! -e "$KEYDIR" ] && KEYDIR=/usr/share/kbd # Slackware … … 382 385 [ ! -e "$KEYDIR" ] && KEYDIR=/etc/condole-setup 383 386 if [ ! -e "$KEYDIR" ] ; then 384 LogAll " Keyboard mapping directory not found. I shall use default map at boot-time."387 LogAll "WARNING: Keyboard mapping directory not found. I shall use default map at boot-time." 385 388 return 0 386 389 fi 387 LogFile "Adding the following keyboard mapping tables: "388 390 if [ -e "/etc/sysconfig/keyboard" ] ; then 389 LogFile " Red Hat-style config detected."391 LogFile "INFO: Red Hat-style config detected." 390 392 keyfile=/etc/sysconfig/keyboard 391 393 elif [ -e "/etc/rc.d/rc.keymap" ] ; then 392 LogFile " Slackware-style config detected."394 LogFile "INFO: Slackware-style config detected." 393 395 keyfile=/etc/rc.d/rc.keymap 394 396 elif [ -e "/etc/rc.config" ] ; then 395 LogFile " Debian-style config detected."397 LogFile "INFO: Debian-style config detected." 396 398 keyfile=/etc/rc.config 397 399 elif [ -e "/etc/console/boottime.kmap.gz" ] ; then 398 LogFile " Debian-style config detected."400 LogFile "INFO: Debian-style config detected." 399 401 mkdir -p $bigdir/tmp 400 402 echo "/etc/console/boottime.kmap.gz" > $MINDI_CACHE/KEYMAP-LIVES-HERE … … 406 408 return 0 407 409 elif [ -e "/etc/console-setup/boottime.kmap.gz" ] || [ -e "/etc/console-setup/cached.kmap.gz" ] ; then 408 LogFile " Ubuntu-style config detected."410 LogFile "INFO: Ubuntu-style config detected." 409 411 mkdir -p $bigdir/tmp 410 412 if [ -e "/etc/console-setup/boottime.kmap.gz" ] ; then … … 421 423 return 0 422 424 elif [ -e "/etc/rc.conf" ] ; then 423 echo "ArchLinux config detected." >> $LOGFILE425 LogFile "INFO: ArchLinux config detected." 424 426 keyfile=/etc/rc.conf 425 427 elif [ -e "/etc/conf.d/keymaps" ] ; then 426 LogFile " Gentoo-style config detected."428 LogFile "INFO: Gentoo-style config detected." 427 429 keyfile=/etc/conf.d/keymaps 428 430 else 429 Log All"Searching for rc.config ..."431 LogFile "Searching for rc.config ..." 430 432 keyfile=`find /etc -name rc.config | head -n1` 431 433 if [ "$keyfile" = "" ] || [ ! -e "$keyfile" ] ; then 432 LogAll " Unknown config detected. Default keyboard map will be used."434 LogAll "WARNING: Unknown config detected. Default keyboard map will be used." 433 435 return 434 436 else 435 LogFile " Found $keyfile"437 LogFile "INFO: Found $keyfile" 436 438 fi 437 439 fi 438 440 if [ ! -e "$KEYDIR/keymaps" ] ; then 439 LogAll " Keyboard mapping directory not found. Default keyboard map will be used."441 LogAll "WARNING: Keyboard mapping directory not found. Default keyboard map will be used." 440 442 return 441 443 fi 442 LogFile "keyfile=$keyfile" 443 locale=`grep -F KEYTABLE "$keyfile" | tr -d '"' |cut -d'=' -f2` 444 LogFile "INFO: keyfile=$keyfile" 445 # For SLES we need to remove the .map.gz extension Cf #614 446 locale=`grep -F KEYTABLE "$keyfile" | grep -v '^#' | tr -d '"' |cut -d'=' -f2 | sed 's/.map.gz$//'` 444 447 [ ! "$locale" ] && locale=`grep '.map$' "$keyfile" | sed 's/^.* //'` # Slackware 445 [ ! "$locale" ] && locale=`grep -E '^KEYMAP=' "$keyfile" | tr -d '"' |cut -d'=' -f2` # Gentoo & ArchLinux446 LogFile " locale=$locale"448 [ ! "$locale" ] && locale=`grep -E '^KEYMAP=' "$keyfile" | grep -v '^#' | tr -d '"' |cut -d'=' -f2` # Gentoo & ArchLinux 449 LogFile "INFO: locale=$locale" 447 450 # 448 451 # Process the keymaps dir once for all … … 455 458 echo "$mp" | grep -q " " >> $LOGFILE 456 459 if [ $? -eq 0 ]; then 457 LogAll "WARNING: Multiple keymaps found: $mp" 458 LogFile " The following one will be used"460 LogAll "WARNING: Multiple keymaps found: $mp" 461 LogFile "INFO: The following one will be used" 459 462 fi 460 463 for i in $mp ; do … … 463 466 done 464 467 if [ ! -e "$mappath" ] || [ -d "$mappath" ] ; then 465 mappath=$(find / -name "*/kbd/keymaps/*/$locale")466 fi 467 LogFile " mappath = $mappath"468 mappath=$(find / -wholename "*/kbd/keymaps/*/$locale | head -1") 469 fi 470 LogFile "INFO: mappath = $mappath" 468 471 if [ ! -e "$mappath" ] || [ -d "$mappath" ] ; then 469 LogAll " Keyboard mapping file not found. Default keyboard map will be used."472 LogAll "WARNING: Keyboard mapping file not found. Default keyboard map will be used." 470 473 return 471 474 fi 475 LogAll "INFO: Adding the following keyboard mapping tables: " 472 476 mkdir -p $bigdir/tmp 473 477 echo "$mappath" > $MINDI_CACHE/KEYMAP-LIVES-HERE … … 490 494 [ ! -e "$MBOOTC32" ] && MBOOTC32=`find / -name mboot.c32 | grep -x "/.*/mboot.c32"` 491 495 [ ! -e "$MBOOTC32" ] && Die "Please install mboot.c32 first. If your syslinux RPM doesn't include mboot.c32, you may download an isolinux RPM from Mondo's website - go to http://www.mondorescue.org/downloads.shtml" 492 LogFile " Found mboot.c32 at $MBOOTC32"496 LogFile "INFO: Found mboot.c32 at $MBOOTC32" 493 497 } 494 498 … … 502 506 [ ! -e "$ISOLINUX" ] && ISOLINUX=`find / -name isolinux.bin | grep -x "/.*/isolinux.bin"` 503 507 [ ! -e "$ISOLINUX" ] && Die "Please install isolinux first. If your syslinux RPM doesn't include isolinux, you may download an isolinux RPM from Mondo's website - go to http://www.mondorescue.org/downloads.shtml" 504 LogFile " Found isolinux.bin at $ISOLINUX"508 LogFile "INFO: Found isolinux.bin at $ISOLINUX" 505 509 } 506 510 … … 510 514 511 515 if [ ! -e "$1" ] ; then 512 LogAll "WARNING -cannot search specific path '$1'"516 LogAll "WARNING: cannot search specific path '$1'" 513 517 return 1 514 518 fi 515 519 # Find all files and links (required for some VMWare VMs) 516 modpaths=`find "$1" -name $2.*o -o -name $2.o.gz -o -name $2.ko.gz -o -name $2 -type f -o -type l`520 modpaths=`find "$1" -name $2.*o -o -name $2.o.gz -o -name $2.ko.gz -o -name $2.ko.xz -o -name $2 -type f -o -type l` 517 521 echo "$modpaths" 518 522 } … … 541 545 filelist=`GenerateListForFile "$incoming"` 542 546 r=$? 543 [ "$r" -ne "0" ] && LogAll " $incoming not found"547 [ "$r" -ne "0" ] && LogAll "WARNING: $incoming not found" 544 548 res=$(($res+$r)) 545 # LogFile " '$incoming' generates filelist '$filelist'"549 # LogFile "INFO: '$incoming' generates filelist '$filelist'" 546 550 for fname in $filelist ; do 547 551 [ "$fname" != "" ] && echo "$fname" >> $tempfile … … 610 614 progress=0 611 615 noof_lines=`cat $tempfile | wc -l` 612 LogFile "---------------------------------" 613 LogFile "List of dependencies: " 614 LogFile "---------------------------------" 616 LogFile "---------------------------------" 617 LogFile "List of dependencies: " 618 LogFile "---------------------------------" 615 619 for fname in `cat $tempfile` ; do 616 620 echo "$fname" | tee -a $LOGFILE >> $outfile.pre … … 624 628 mkdir -p $bigdir/bin 625 629 if [ -e "$MINDI_TMP/post-nuke.tgz" ] ; then 626 LogAll "\nI ncorporating post-nuke tarball"630 LogAll "\nINFO: Incorporating post-nuke tarball" 627 631 old_pwd=`pwd` 628 632 cd "$bigdir" 629 tar -zxf $MINDI_TMP/post-nuke.tgz 2>> $MINDI_TMP/$$.log || LogAll "E rror occurredwhen untarring post-nuke tarball" $MINDI_TMP/$$.log633 tar -zxf $MINDI_TMP/post-nuke.tgz 2>> $MINDI_TMP/$$.log || LogAll "ERROR: when untarring post-nuke tarball" $MINDI_TMP/$$.log 630 634 cd "$old_pwd" 631 635 fi 632 cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2>> $LOGFILE || LogAll "\nMondo v1.2x defaults to LILO as the bootloader, BTW." 636 if cp -f $MINDI_TMP/mondo*restore $bigdir/usr/bin 2>> $LOGFILE ; then 637 LocateDeps $bigdir/usr/bin/mondo*restore >> $outfile.pre 638 else 639 LogIt "ERROR: Cannot find mondo*restore in mondo's tempdir, $MINDI_TMP" 640 LogIt " I bet you've got a spare copy of Mondo or Mindi floating around on your system." 641 LogIt " If Mindi was called by Mondo then send me a bug report." 642 LogIt " It not, type 'ps ax' to see which Mondo-related process is still running then kill it. :-)" 643 LogIt " Finally, run Mindi again." 644 Die "Odd." 645 fi 646 cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2>> $LOGFILE || LogIt "\nINFO: Mondo v1.2x defaults to LILO as the bootloader, BTW." 633 647 if [ -e "$MINDI_TMP/NETFS-DEV" ] ; then 634 LogAll "\nI ncorporating NFS-related settings"635 for r in NETFS-* ; do648 LogAll "\nINFO: Incorporating Network-related settings" 649 for r in NETFS-* ISO-PREFIX ; do 636 650 cp -f $MINDI_TMP/$r $bigdir/tmp 2>> $LOGFILE || Die "Cannot copy $r - did you run out of disk space?" 637 LogFile " Copying $r to ramdisk"651 LogFile "INFO: Copying $r to ramdisk" 638 652 done 639 653 fi … … 693 707 local lcMagicExt2fs="EXT2-fs: blocksize too small for device." 694 708 local lcMagicExt3fs="<3>EXT3-fs: blocksize too small for journal device." 695 local lcMagicInitfs="<6>checking if image is initramfs...|<6>Unpacking initramfs...|<6>Trying to unpack rootfs image as 696 initramfs" 709 local lcMagicInitfs="<6>checking if image is initramfs...|<6>Unpacking initramfs...|<6>Trying to unpack rootfs image as initramfs" 697 710 698 711 # local variables … … 702 715 703 716 # say where we are. 704 LogFile " GetInitrdFilesystemToUse(): called with parameter: $lvKernelImage"717 LogFile "INFO: GetInitrdFilesystemToUse(): called with parameter: $lvKernelImage" 705 718 706 719 # verify that file exists 707 720 [ ! -f $lvKernelImage ] && Die "File $lvKernelImage not found. Terminating." 708 721 709 # Kernel may be gzip compressed 722 # Kernel may be gzip compressed - Case of RHEL5 - SLES11SP1 710 723 file $lvKernelImage 2>&1 | grep -q gzip 711 724 if [ $? -eq 0 ]; then 712 lvScanRes=`gzip -cd $lvKernelImage | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicExt3fs|$lcMagicInitfs"` 713 714 # determine which filesystem to use for initrd image: ext2|3fs, gzip'ed cpio (initramfs) or cramfs 715 if [ `echo $lvScanRes | grep -Ec "$lcMagicExt2fs"` -eq 1 ]; then 716 lvUseFilesystem="ext2fs" 717 elif [ `echo $lvScanRes | grep -Ec "$lcMagicExt3fs"` -eq 1 ]; then 718 lvUseFilesystem="ext3fs" 719 elif [ `echo $lvScanRes | grep -Ec "$lcMagicInitfs"` -eq 1 ]; then 720 lvUseFilesystem="initramfs" 721 elif [ `echo $lvScanRes | grep -Ec "$lcMagicCramfs"` -eq 1 ]; then 722 lvUseFilesystem="cramfs" 725 LogFile "INFO: Found a gzip compressed kernel $lvKernelImage" 726 lvScanRes=`gzip -cd $lvKernelImage | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicExt3fs|$lcMagicInitfs" 2> /dev/null` 727 else 728 LogFile "INFO: Found a non gzip compressed kernel $lvKernelImage" 729 # kernel is x86 boot sector in RHEL3/4 with embedded gzip content 730 # get offet of gzip magic "1f8b0800" in file (for these older kernels) 731 lvOffset=`od -vA n -t x1 $lvKernelImage | tr -d '[:space:]' | awk '{ print match($0, "1f8b0800")}' 2> /dev/null` 732 if [ $lvOffset -eq 0 ]; then 733 LogFile "INFO: gzip magic not found in file $lvKernelImage. Supposing initramfs." 734 lvScanRes=$lcMagicInitfs 723 735 else 724 lvUseFilesystem="UNSUPPORTED" 725 fi 726 736 lvOffset=`expr $lvOffset / 2` 737 LogFile "INFO: GetInitrdFilesystemToUse(): gzip magic found at lvOffset $lvOffset." 738 # scan again kernel image 739 lvScanRes=`dd ibs=1 skip=$lvOffset if=$lvKernelImage obs=1M 2>/dev/null | gunzip -c 2> /dev/null | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicExt3fs|$lcMagicInitfs" 2> /dev/null` 740 fi 741 fi 742 743 # determine which filesystem to use for initrd image: ext2|3fs, gzip'ed cpio (initramfs) or cramfs 744 if [ `echo $lvScanRes | grep -Ec "$lcMagicExt2fs"` -eq 1 ]; then 745 lvUseFilesystem="ext2fs" 746 elif [ `echo $lvScanRes | grep -Ec "$lcMagicExt3fs"` -eq 1 ]; then 747 lvUseFilesystem="ext3fs" 748 elif [ `echo $lvScanRes | grep -Ec "$lcMagicInitfs"` -eq 1 ]; then 749 lvUseFilesystem="initramfs" 750 elif [ `echo $lvScanRes | grep -Ec "$lcMagicCramfs"` -eq 1 ]; then 751 lvUseFilesystem="cramfs" 727 752 else 728 # In that case, we are after 2.6.30 and use the supported initramfs 753 # In that case, we are most probably after 2.6.30 and use the supported initramfs 754 LogFile "No automatic detection found previously. Supposing initramfs." 755 LogFile "Report on the MondoRescue mailing-list withyour log files" 729 756 lvUseFilesystem="initramfs" 730 757 fi 758 731 759 # say what we are using 732 LogFile " GetInitrdFilesystemToUse(): Filesytem to use for initial ramdisk is $lvUseFilesystem."760 LogFile "INFO: GetInitrdFilesystemToUse(): Filesytem to use for initial ram disk is $lvUseFilesystem." 733 761 734 762 # return file system to use … … 804 832 r=`find /lib/modules/$kern -type f | grep "/${module}\..*o" | tail -n1` 805 833 if [ -z "$r" ]; then 806 echo "$MODULES" | grep -wq $module 807 if [ $? -ne 0 ]; then 834 if [ "`echo "$MODULES" | grep -w $module`" ]; then 808 835 r="[live module file not found]" 809 836 else … … 813 840 [ -f "$r" ] && echo "$r" >> $outfile 814 841 fi 815 LogFile "module $module --> $r" 816 [ -f "$r" ] && echo "$r" >> $outfile 842 LogFile "INFO: module $module --> $r" 817 843 progress=$(($progress+1)) 818 844 LogProgress $progress $noof_lines … … 830 856 for fname in $incoming ; do 831 857 if [ ! -e "$fname" ] ; then 832 LogFile "WARNING - $fname does not exist; cannot be LDD'd."858 LogFile "WARNING: $fname does not exist; cannot be LDD'd." 833 859 if echo $fname | grep lvm &> /dev/null ; then 834 LogFile " This warning only affects you if you are using LVM."860 LogFile " This warning only affects you if you are using LVM." 835 861 if echo "$MODULES" | grep lvm &> /dev/null ; then 836 LogFile " I think you are, so please take heed!"862 LogFile " I think you are, so please take heed!" 837 863 else 838 LogFile " I don't think you are, so don't worry about it."864 LogFile " I don't think you are, so don't worry about it." 839 865 fi 840 866 fi 841 867 elif [ -h "$fname" ] && [ -x "$fname" ] ; then 842 LogFile " $fname is softlink"868 LogFile "INFO: $fname is softlink" 843 869 else 844 870 ldd $fname 2> /dev/null | ProcessLDD … … 850 876 # Give all symlinks recursively of a full path name 851 877 ReadAllLink() { 852 853 incoming="$*" 854 855 for file in $incoming ; do 856 if [ ! -f $file ]; then 857 continue 858 fi 859 echo "$file" 860 if [ ! -h $file ]; then 861 continue 862 fi 863 864 link=`readlink $file` 865 d=`dirname $file` 866 fchar=`echo $link | cut -c1` 867 # If mother dir is a link print it 868 if [ -h "$d" ]; then 869 echo "$d" 870 d=`readlink $d` 871 fi 872 if [ "$fchar" != "/" ]; then 873 # Relative or local link 874 ReadAllLink "$d/$link" 875 else 876 # Absolute path 877 ReadAllLink $link 878 fi 879 done 878 file="$1" 879 880 while [ `echo $file | grep -Ec '\.\./'` -ne 0 ]; do 881 # We need to normalise the path with .. in it 882 file=`echo $file | perl -pi -e 's|([^/]*)/([^/]+)/\.\./([^/]+)|$1/$3|g'` 883 done 884 echo "$file" 885 if [ ! -h $file ]; then 886 return 0 887 fi 888 889 link=`readlink $file` 890 d=`dirname $file` 891 fchar=`echo $link | cut -c1` 892 # If mother dir is a link print it 893 if [ -h "$d" ]; then 894 echo "$d" 895 d=`readlink $d` 896 fi 897 if [ "$fchar" != "/" ]; then 898 # Relative or local link 899 ReadAllLink "$d/$link" 900 else 901 # Absolute path 902 ReadAllLink $link 903 fi 880 904 } 881 905 … … 933 957 } 934 958 935 # Function to log on screen only936 LogScreen() {937 if [ -e /dev/stderr ] ; then938 echo -e "$1" >> /dev/stderr939 elif [ -e /usr/bin/logger ] ; then940 /usr/bin/logger -s $1941 fi942 }943 944 # Function to log in log file only945 LogFile() {946 947 echo -e "$1" >> $LOGFILE948 if [ _"$2" != _"" ]; then949 grep -Ev "tar: Removing \`/\'" "$2" >> $LOGFILE950 fi951 rm -f "$2"952 }953 954 # Function to log in both screen and logfile955 LogAll() {956 LogScreen "$1"957 LogFile "$1" "$2"958 }959 960 959 # Called by TurnTgzIntoRdz, to make mondorestore.cfg 961 960 MakeMondoConfigFile() { … … 963 962 outfile=$1 964 963 > $outfile 965 [ "$BACKUP_MEDIA_TYPE" ] && echo "backup-media-type $BACKUP_MEDIA_TYPE" >> $outfile966 964 [ "$TAPESIZE" ] && echo "media-size $TAPESIZE" >> $outfile 967 965 [ "$TAPEDEV" ] && echo "media-dev $TAPEDEV" >> $outfile … … 978 976 echo "use-lzo $use_lzo" >> $outfile 979 977 echo "use-gzip $use_gzip" >> $outfile 978 echo "use-star $use_star" >> $outfile 980 979 echo "use-lzma $use_lzma" >> $outfile 981 980 echo "use-comp $use_comp" >> $outfile 982 echo "use-star $use_star" >> $outfile983 981 echo "use-udev $use_udev" >> $outfile 984 982 echo "datestamp `date`" >> $outfile 985 983 [ "$ESTIMATED_TOTAL_NOOF_SLICES" ] && echo "total-slices $ESTIMATED_TOTAL_NOOF_SLICES" >> $outfile 984 AddFileToCfgIfExists $MINDI_TMP/NETFS-DEV netfs-dev $outfile 985 AddFileToCfgIfExists $MINDI_TMP/NETFS-PROTO netfs-proto $outfile 986 AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-IPADDR netfs-client-ipaddr $outfile 987 AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-NETMASK netfs-client-netmask $outfile 988 AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-BROADCAST netfs-client-broadcast $outfile 989 AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-HWADDR netfs-client-hwaddr $outfile 990 AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-DEFGW netfs-client-defgw $outfile 986 991 AddFileToCfgIfExists $MINDI_TMP/NETFS-SERVER-MOUNT netfs-server-mount $outfile 987 992 AddFileToCfgIfExists $MINDI_TMP/NETFS-SERVER-USER netfs-server-user $outfile 988 993 AddFileToCfgIfExists $MINDI_TMP/NETFS-SERVER-PATH netfs-server-path $outfile 989 994 AddFileToCfgIfExists $MINDI_TMP/NETFS-SERVER-IPADDR netfs-server-ipaddr $outfile 990 AddFileToCfgIfExists $MINDI_TMP/NETFS-PROTO netfs-proto $outfile991 AddFileToCfgIfExists $MINDI_TMP/NETFS-DEV netfs-dev $outfile992 AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-IPADDR netfs-client-ipaddr $outfile993 AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-NETMASK netfs-client-netmask $outfile994 AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-BROADCAST netfs-client-broadcast $outfile995 AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-DEFGW netfs-client-defgw $outfile996 995 AddFileToCfgIfExists $MINDI_TMP/ISO-DEV iso-dev $outfile 997 996 AddFileToCfgIfExists $MINDI_TMP/ISO-MNT iso-mnt $outfile … … 1000 999 AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.DEVICE bootloader.device $outfile 1001 1000 AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.NAME bootloader.name $outfile 1001 AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.VER bootloader.ver $outfile 1002 AddFileToCfgIfExists $MINDI_TMP/KEYMAP-LIVES-HERE keymap-lives-here $outfile 1002 1003 AddFileToCfgIfExists $MINDI_TMP/TAPEDEV-HAS-DATA-DISKS tapedev-has-data-disks $outfile 1004 AddFileToCfgIfExists $MINDI_TMP/BACKUP-MEDIA-TYPE backup-media-type $outfile 1005 AddFileToCfgIfExists $MINDI_TMP/DIFFERENTIAL differential $outfile 1006 AddFileToCfgIfExists $MINDI_TMP/ACL acl $outfile 1007 AddFileToCfgIfExists $MINDI_TMP/XATTR xattr $outfile 1008 AddFileToCfgIfExists $MINDI_TMP/OBDR obdr $outfile 1003 1009 } 1004 1010 … … 1021 1027 absolute_partition old_partition_fmt current_lvolume uname skip 1022 1028 1023 LogFile "------------------------------------" 1024 LogFile "Your raw fstab file looks like this:" 1025 LogFile "------------------------------------" 1029 LogFile "------------------------------------" 1030 LogFile "Your raw fstab file looks like this:" 1031 LogFile "------------------------------------" 1026 1032 cat $MY_FSTAB >> $LOGFILE 1027 LogAll "-----------------------------------" 1028 LogAll "Your mountlist will look like this:" 1029 LogAll "-----------------------------------" 1033 LogAll "-----------------------------------" 1034 LogAll "Your mountlist will look like this:" 1035 LogAll "-----------------------------------" 1030 1036 1031 1037 # mountlist(OUT) … … 1042 1048 1043 1049 if [ $LVM != "false" ]; then 1044 Log File "Analyzing LVM..."1050 LogAll "INFO: Analyzing LVM..." 1045 1051 $MINDI_DATA/analyze-my-lvm > $MINDI_TMP/lvm.res 1046 1052 if [ $? -ne 0 ]; then … … 1055 1061 done 1056 1062 [ "$IMAGE_DEVS" != "" ] && all_partitions="`echo "$all_partitions $IMAGE_DEVS" | tr ' ' '\n' | sort -u | tr '\n ' ' '`" 1057 printf "%-15s %-15s %-15s % s %s\n" DEVICE MOUNTPOINT FORMAT "SIZE MB" LABEL/UUID | tee -a $LOGFILE1058 printf "%-15s %-15s %-15s % s %s\n" ------ ---------- ------ ------- ---------- | tee -a $LOGFILE1063 printf "%-15s %-15s %-15s %-13s %-15s\n" DEVICE MOUNTPOINT FORMAT "SIZE MB" LABEL/UUID | tee -a $LOGFILE 1064 printf "%-15s %-15s %-15s %-13s %-15s\n" ------ ---------- ------ ------- ---------- | tee -a $LOGFILE 1059 1065 useless_dev="/dev/floppy /dev/fd0h1440 /dev/fd0H1440 /dev/cdrom /dev/cdrom/cdrom /dev/cdrom/cdrom1 /dev/cdrom/cdrom2 /dev/cdrom0 /dev/cdrom1 /dev/cdrom2 /dev/cdrom3 /dev/cdrw /dev/scd /dev/ram :/ /dev/sr0 /dev/sr1 /dev/cdrom1 tmpfs devpts sysfs proc debugfs" 1060 1066 for c_p in $all_partitions ; do … … 1064 1070 if [ -h "$c_p" ] && [ "`echo "$c_p" | grep -F "/dev/hd"`" = "" ] && [ "`echo "$c_p" | grep -F "/dev/sd"`" = "" ] && [ "`echo "$c_p" | grep -F "/dev/md"`" = "" ] ; then 1065 1071 current_partition=`readlink -f $c_p` 1066 [ "`echo "$current_partition" | grep -F "/dev/mapper"`" != "" ] && current_partition="$c_p" 1072 if [ "`echo "$current_partition" | grep -F "/dev/mapper"`" != "" ]; then 1073 current_partition="$c_p" 1074 elif [ "`echo $current_partition | grep -E '^/dev/dm-'`" ]; then 1075 # For SLES 11 type of distro, do not use dm devices as they are unable to be handled by lvm commands 1076 current_partition=`$MINDI_LIB/analyze-my-lvm --givevglvofdm $current_partition` 1077 fi 1067 1078 [ "`echo "$useless_dev" | grep -F "$current_partition"`" ] && continue 1068 1079 else … … 1074 1085 uuid="" 1075 1086 absolute_partition=`readlink -f $c_p` 1076 partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $2}' | head -n1` 1077 1078 # Detects noauto partitions not mounted and exclude them 1079 partition_option=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $4}' | head -n1` 1080 if [ "`echo "$partition_option" | grep -i noauto`" != "" ] && [ "`mount | grep -w "$partition_mountpt"`" = "" ] ; then 1081 continue 1082 fi 1087 partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | grep -w "$current_partition" | grep -vx " *#.*" | $AWK '{print $2}' | head -n1` 1083 1088 1084 1089 # set default in case we dont't find it … … 1087 1092 # This part tries to retrieve the correct device from a LABEL line in /etc/fstab 1088 1093 # current_partition contains only first column of /etc/fstab 1089 if [ "`echo "$current_partition" | /bin/grep -i "LABEL="`" != "" ]; then1094 if [ "`echo "$current_partition" | grep -i "LABEL="`" != "" ]; then 1090 1095 redhat_label=`echo "$current_partition" | cut -d'=' -f2` 1091 1096 actual_dev="" … … 1098 1103 # 2nd try : blkid, the good way for all LABEL except swap 1099 1104 if [ "x$actual_dev" = "x" -a -x "/sbin/blkid" ]; then 1100 actual_dev=`/sbin/blkid | /bin/grep "$redhat_label" | grep LABEL= | cut -d':' -f1`1105 actual_dev=`/sbin/blkid | grep "$redhat_label" | grep LABEL= | cut -d':' -f1` 1101 1106 # For LVM FS it will give a /dev/dm-# which should then be converted 1102 1107 if [ $LVM = "v2" ] && [ "`echo $actual_dev | grep '/dev/dm'`" ]; then … … 1117 1122 # For LVM gives a /dev/mapper entry 1118 1123 if [ "x$actual_dev" = "x" ]; then 1119 actual_dev=`/bin/mount -l | /bin/grep "\[$redhat_label\]" | cut -d' ' -f1`1124 actual_dev=`/bin/mount -l | grep "\[$redhat_label\]" | cut -d' ' -f1` 1120 1125 fi 1121 1126 … … 1123 1128 # SWAP only 1124 1129 if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ]; then 1125 list_swaps=`cat /proc/swaps | /bin/grep "/dev/" | $AWK '{ print $1 }' `1130 list_swaps=`cat /proc/swaps | grep "/dev/" | $AWK '{ print $1 }' ` 1126 1131 for dev_swap in $list_swaps ; do 1127 dev_exists=`/sbin/vol_id $dev_swap | /bin/grep "$redhat_label"`1132 dev_exists=`/sbin/vol_id $dev_swap | grep "$redhat_label"` 1128 1133 if [ "x$dev_exists" != "x" ]; then 1129 1134 actual_dev=$dev_swap … … 1137 1142 # or could be a string that isn't a complete device name (eg. LABEL =SWAP-cciss/c0d0p) 1138 1143 # SWAP only 1139 if [ "x$actual_dev" = "x" -a _"`echo $current_partition | /bin/grep -iE 'LABEL=SWAP|LABEL=SW-'`" != _"" ]; then1144 if [ "x$actual_dev" = "x" -a _"`echo $current_partition | grep -iE 'LABEL=SWAP|LABEL=SW-'`" != _"" ]; then 1140 1145 skip="" 1141 1146 uname=$KERVERRUN … … 1168 1173 # This part tries to retrieve the correct device from a UUID line in /etc/fstab 1169 1174 # current_partition contains only first column of /etc/fstab 1170 elif [ "`echo "$current_partition" | /bin/grep -i "UUID="`" != "" ]; then1175 elif [ "`echo "$current_partition" | grep -i "UUID="`" != "" ]; then 1171 1176 uuid=`echo "$current_partition" | cut -d'=' -f2` 1172 1177 actual_dev="" … … 1179 1184 # 2nd try : blkid, the good way for all UUID except swap 1180 1185 if [ "x$actual_dev" = "x" -a -x "/sbin/blkid" ]; then 1181 actual_dev=`/sbin/blkid | /bin/grep "$uuid" | grep UUID= | cut -d':' -f1`1186 actual_dev=`/sbin/blkid | grep "$uuid" | grep UUID= | cut -d':' -f1` 1182 1187 # For LVM FS it will give a /dev/dm-# which should then be converted 1183 1188 if [ $LVM = "v2" ] && [ "`echo $actual_dev | grep '/dev/dm'`" ]; then … … 1197 1202 # 3th try, with vol_id 1198 1203 if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ]; then 1199 list_dev=`mount | /bin/grep -E '^/' | $AWK '{ print $1 }' `1204 list_dev=`mount | grep -E '^/' | $AWK '{ print $1 }' ` 1200 1205 for dev in $list_dev ; do 1201 dev_exists=`/sbin/vol_id $dev | /bin/grep "$uuid"`1206 dev_exists=`/sbin/vol_id $dev | grep "$uuid"` 1202 1207 if [ "x$dev_exists" != "x" ]; then 1203 1208 actual_dev=$dev … … 1209 1214 # 4th try, with dumpuuid (VMWare only ?) for swap 1210 1215 if [ "x$actual_dev" = "x" -a -x "/sbin/dumpuuid" ]; then 1211 list_dev=`cat /proc/swaps | /bin/grep -E '^/' | $AWK '{ print $1 }' `1216 list_dev=`cat /proc/swaps | grep -E '^/' | $AWK '{ print $1 }' ` 1212 1217 for dev in $list_dev ; do 1213 dev_exists=`/sbin/dumpuuid $dev | /bin/grep "$uuid"`1218 dev_exists=`/sbin/dumpuuid $dev | grep "$uuid"` 1214 1219 if [ "x$dev_exists" != "x" ]; then 1215 1220 actual_dev=$dev … … 1230 1235 if [ _"$partition_mountpt" = _"" ]; then 1231 1236 # set default in case we dont't find it 1232 for tmpp in `tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -Ev "^#" | $AWK '{print $1}'`; do1233 if [ _"`readlink -f $tmpp`" = _" $current_partition" ]; then1237 for tmpp in `tr -s '\t' ' ' < $MY_FSTAB | grep -Ev "^#" | $AWK '{print $1}'`; do 1238 if [ _"`readlink -f $tmpp`" = _"`readlink -f $current_partition`" ]; then 1234 1239 str_to_find_fmt_with=$tmpp 1235 partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$tmpp" | /bin/grep -vx " *#.*" | $AWK '{print $2}' | head -n1`1240 partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | grep -w "$tmpp" | grep -vx " *#.*" | $AWK '{print $2}' | head -n1` 1236 1241 break; 1237 1242 fi 1238 1243 done 1239 1244 fi 1245 fi 1246 1247 # Detects noauto partitions not mounted and exclude them 1248 partition_option=`tr -s '\t' ' ' < $MY_FSTAB | grep -w "$str_to_find_fmt_with" | grep -vx " *#.*" | $AWK '{print $4}' | head -n1` 1249 if [ "`echo "$partition_option" | grep -i noauto`" != "" ] && [ "`mount | grep -w "$partition_mountpt"`" = "" ] ; then 1250 LogFile "INFO: Excluding $current_partition from mountlist (due to noauto option in fstab)" 1251 continue 1252 fi 1253 # Detects bind partitions and exclude them 1254 if [ "`echo "$partition_option" | grep -iw bind`" != "" ]; then 1255 LogFile "INFO: Excluding $current_partition from mountlist (due to bind option in fstab)" 1256 continue 1240 1257 fi 1241 1258 … … 1257 1274 for d in `echo $MINDI_EXCLUDE_DEVS | sed 's/|/ /g'`; do 1258 1275 if [ "`echo " $list_of_devices " | grep " $d"`" != "" ]; then 1259 echo "Excluding $current_partition from mountlist (due to excluded device $d)" >> $LOGFILE1276 LogFile "INFO: Excluding $current_partition from mountlist (due to excluded device $d)" 1260 1277 skip=1 1261 1278 continue … … 1268 1285 1269 1286 partition_format=`$AWK '$1 == "'"$str_to_find_fmt_with"'" {print $3}' $MY_FSTAB` 1287 # Detects iso9660 ISO images and exclude them 1288 if [ "`echo "$partition_format" | grep -iw iso9660`" != "" ]; then 1289 LogFile "INFO: Excluding $current_partition from mountlist (due to iso9660 format in fstab)" 1290 continue 1291 fi 1270 1292 # Some distributions such as Debian do not put /dev/<VG>/<LV> in fstab 1271 1293 # for LVM partitions but use /dev/mapper/<VG>-<LV> instead. Fortunately, … … 1280 1302 # into any of the LVM tools if possible. 1281 1303 1282 1304 current_lvolume="$current_partition" 1283 1305 if [ $LVM = "v2" ] && [ "`echo $current_partition | grep -E '^/dev/mapper/'`" ]; then 1284 1306 # .static dir are a Debian specificity … … 1286 1308 echo $current_lvolume | grep -q ' ' 1287 1309 if [ $? -eq 0 ]; then 1288 LogFile "WARNING: Multiple Logical Volumes found. Report to dev team" 1310 LogFile "WARNING: Multiple Logical Volumes found. Report to dev team" 1289 1311 fi 1290 1312 # if it's not found, it may well be a real device such as a multipath one … … 1301 1323 partition_size="lvm" 1302 1324 else 1303 partition_size=`SizeOfPartition $current_partition`1304 1325 [ "`echo "$current_partition" | grep "[0-9]"`" = "" ] && continue 1305 1326 [ "`echo "$current_partition" | grep -c "^/"`" -ne "1" ] && continue 1306 1327 if [ "$partition_format" = "swap" ] || [ "$partition_mountpt" = "swap" ] ; then 1328 # Skip swap files 1329 [ "`echo "$current_partition" | grep -E "^/dev"`" = "" ] && continue 1307 1330 partition_size=`grep -Fv "Priority" /proc/swaps | tr -s '\t' ' ' | grep -F "$current_partition " | $AWK '{print $3}'` 1308 1331 [ "$partition_mountpt" != "swap" ] && partition_mountpt="swap" … … 1317 1340 [ "$items" -gt "0" ] && partition_size=$(($totalsize/$items)) || partition_size=0 1318 1341 [ "$partition_size" -lt "125000" ] && partition_size=125000 1319 LogFile "I 'm guessing $c_p is $(($partition_size/1024))MB"1342 LogFile "INFO: I'm guessing $c_p is $(($partition_size/1024))MB" 1320 1343 fi 1344 else 1345 partition_size=`SizeOfPartition $current_partition` 1321 1346 fi 1322 1347 fi … … 1335 1360 fi 1336 1361 psz=$partition_size 1337 LogFile " Examining $current_partition (mount=$partition_mountpt fmt=$partition_format psz=$psz)"1362 LogFile "INFO: Examining $current_partition (mount=$partition_mountpt fmt=$partition_format psz=$psz)" 1338 1363 [ "$psz" != "lvm" ] && psz=$(($psz/1024)) 1339 1364 if [ "`echo " $IMAGE_DEVS " | grep -F " $current_partition "`" != "" ] ; then … … 1343 1368 partition_size=$(($partition_size+1)); # just in case 1344 1369 if [ "$partition_format" = "Linux" ] ; then 1345 LogFile " Are you imaging a mounted swap partition? Silly..."1346 LogFile " Reverting format from $old_partition_fmt to $partition_format"1370 LogFile "WARNING: Are you imaging a mounted swap partition? Silly..." 1371 LogFile "WARNING: Reverting format from $old_partition_fmt to $partition_format" 1347 1372 partition_format=$old_partition_fmt 1348 1373 fi … … 1350 1375 1351 1376 if [ ! "$partition_mountpt" ] ; then 1352 LogFile "------- $FDISK -l $qq log ------------" 1377 LogFile "------- $FDISK -l $qq log ------------" 1353 1378 for qq in "" `find /dev/ida/c*d* ! -name '*p*' 2> /dev/null`; do 1354 1379 partition_format=`$FDISK -l $qq 2>> $LOGFILE | grep -w "$c_p" | sed 's/12/|/' | tr -s '\t' ' ' | cut -d'|' -f2 | cut -d' ' -f2-9` 1355 1380 [ "$partition_format" ] && break 1356 1381 done 1357 LogFile "------- $FDISK log end ------------" 1382 LogFile "------- $FDISK log end ------------" 1358 1383 if [ "$partition_format" = "Compaq diagnostics" ] ; then 1359 1384 partition_format="compaq" 1360 1385 elif [ ! "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then 1361 LogAll " Unable to find mountpoint of $current_partition - ignoring"1386 LogAll "WARNING: Unable to find mountpoint of $current_partition - ignoring" 1362 1387 continue 1363 1388 fi … … 1372 1397 unofficial_outstring=`printf "%-15s %-15s %-15s %7s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$label"` 1373 1398 if [ "$current_partition" = "" ] ; then 1374 LogFile " Unknown partition (outstring = $unofficial_outstring)"1399 LogFile "WARNING: Unknown partition (outstring = $unofficial_outstring)" 1375 1400 elif [ "$partition_mountpt" = "" ] && [ -f "/etc/raidtab" ] ; then 1376 1401 if [ "`grep -F device /etc/raidtab 2>/dev/null | grep -F $current_partition`" ] ; then … … 1380 1405 printf "%s %s %s %s %s %s\n" $current_partition $partition_mountpt $partition_format $partition_size "$label" >> $mountlist 1381 1406 else 1382 LogFile " Unknown mountpoint (outstring = $unofficial_outstring)"1407 LogFile "WARNING: Unknown mountpoint (outstring = $unofficial_outstring)" 1383 1408 fi 1384 1409 elif [ "$partition_format" = "" ] ; then 1385 LogFile " Unknown format (outstring = $unofficial_outstring)"1410 LogFile "WARNING: Unknown format (outstring = $unofficial_outstring)" 1386 1411 elif [ "$partition_size" = "" ] ; then 1387 LogFile " Unknown partition size (outstring = $unofficial_outstring)"1412 LogFile "WARNING: Unknown partition size (outstring = $unofficial_outstring)" 1388 1413 elif [ "$partition_mountpt" = "/proc" ] || [ "$partition_mountpt" = "/dev/pts" ] ; then 1389 1414 continue 1390 1415 else 1391 1416 if [ "$partition_format" = "dos" ] || [ "$partition_format" = "msdos" ] ; then 1392 LogFile " vfat should be used instead of dos/msdos as a partition format"1417 LogFile "WARNING: vfat should be used instead of dos/msdos as a partition format" 1393 1418 partition_format="vfat" 1394 1419 fi … … 1404 1429 # Coherency verification 1405 1430 ML01=`cat $file | wc -l` 1406 ML02=`grep -v ' lvm' $file | wc -l`1431 ML02=`grep -vE ' lvm | raid | swap ' $file | wc -l` 1407 1432 ML1=`$AWK '{print $1}' $file | sort -u | wc -l` 1408 ML2=`grep -v ' lvm' $file | $AWK '{print $2}' | sort -u | wc -l`1433 ML2=`grep -vE ' lvm | raid | swap ' $file | $AWK '{print $2}' | sort -u | wc -l` 1409 1434 if [ "$ML01" -ne "$ML1" ]; then 1410 1435 LogFile "--------------------------------------------" 1411 echo "WARNING: Duplicate device entry in mountlist" | tee -a $LOGFILE1436 LogAll "WARNING: Duplicate device entry in mountlist" 1412 1437 LogFile "--------------------------------------------" 1413 1438 fi 1414 1439 if [ "$ML02" -ne "$ML2" ]; then 1415 1440 LogFile "--------------------------------------------" 1416 echo "WARNING: Duplicate mountpoint entry in mountlist" | tee -a $LOGFILE1441 LogAll "WARNING: Duplicate mountpoint entry in mountlist" 1417 1442 LogFile "------------------------------------------------" 1418 1443 fi … … 1422 1447 local i old_pwd 1423 1448 if [ -z "$ISO_CMD" ]; then 1424 Log File "Neither mkisofs nor genisoimage found, unable to make CD image"1449 LogAll "ERROR: Neither mkisofs nor genisoimage found, unable to make CD image" 1425 1450 return 1426 1451 fi … … 1432 1457 rm -Rf $MINDI_TMP/iso 1433 1458 mkdir -p $MINDI_TMP/iso/{images,archives} 1434 cp -f $MINDI_CACHE/{*.gz,*.img} $MINDI_TMP/iso/images 2>> $LOGFILE || LogAll "OfferToMakeBootableISO: Cannot copy $MINDI_CACHE/*.gz to $MINDI_TMP/iso/images"1435 LogFile "mindi_lib = $MINDI_DATA"1459 LogFile "INFO: mindi_lib = $MINDI_DATA" 1460 cp -f $MINDI_CACHE/{*.gz,*.img} $MINDI_TMP/iso/images 2>> $LOGFILE || LogAll "WARNING: OfferToMakeBootableISO: Cannot copy $MINDI_CACHE/*.gz to $MINDI_TMP/iso/images" 1436 1461 for i in memdisk memtest.bin memtest.img ; do 1437 1462 j=$MINDI_DATA/$i 1438 1463 k=$MINDI_TMP/iso 1439 1464 if [ -e "$j" ] ; then 1440 LogAll " Copying $j to $k"1465 LogAll "INFO: Copying $j to $k" 1441 1466 cp -f $j $k 2>> $LOGFILE || Die "Failed to copy $j to $k" 1442 1467 cp -f $j $MINDI_TMP 2>> $LOGFILE || Die "Failed to copy $j to $MINDI_TMP" … … 1446 1471 fi 1447 1472 done 1448 MakeMessageFile > $MINDI_TMP/iso/message.txt1473 MakeMessageFile | cut -c1-80 > $MINDI_TMP/iso/message.txt 1449 1474 if [ $KERNEL_IS_XEN = "yes" ]; then 1450 1475 cp $xenkernelpath $MINDI_TMP/iso/xen.gz 2>> $LOGFILE || Die "Cannot copy xen.gz ($xenkernelpath) to mindi tmp ($MINDI_TMP/iso/xen.gz). Did you run out of disk space?" … … 1487 1512 fi 1488 1513 if [ "$?" -ne "0" ] ; then 1489 LogFile "----------- $ISO_CMD's errors --------------" 1490 cat $MINDI_TMP/mkisofs.log >> $LOGFILE 1491 echo "$ISO_CMD returned the following errors:-" 1492 cat $MINDI_TMP/mkisofs.log 1493 LogAll "Failed to create ISO image." 1514 LogFile "----------- $ISO_CMD's errors --------------" 1515 LogAll "$ISO_CMD returned the following errors:" 1516 cat $MINDI_TMP/mkisofs.log | tee -a $LOGFILE 1517 LogAll "ERROR: Failed to create ISO image." 1494 1518 else 1495 LogAll " Created bootable ISO image at $MINDI_CACHE/mindi.iso"1519 LogAll "INFO: Created bootable ISO image at $MINDI_CACHE/mindi.iso" 1496 1520 fi 1497 1521 rm -f $MINDI_TMP/mkisofs.log … … 1522 1546 echo -en "Transforming $USBDEVICE in a Bootable device " 1523 1547 echo -en "." 1524 LogFile " Transforming $USBDEVICE in a Bootable device"1525 LogFile " Checking $USBDEVICE"1548 LogFile "INFO: Transforming $USBDEVICE in a Bootable device" 1549 LogFile "INFO: Checking $USBDEVICE" 1526 1550 $FDISK -l $USBDEVICE 2>&1 >> $LOGFILE 1527 1551 if [ $? -ne 0 ]; then 1528 LogAll " Unable to access $USBDEVICE"1529 LogAll " Make sure your USB device is pluged in"1530 exit -11552 LogAll "ERROR: Unable to access $USBDEVICE" 1553 LogAll " Make sure your USB device is plugged in" 1554 MindiExit -1 1531 1555 fi 1532 1556 echo -en "." 1533 1557 # Some distro do auto mount at that point (Ubuntu) 1534 LogFile " Unmounting $USBPART just in case"1558 LogFile "INFO: Unmounting $USBPART just in case" 1535 1559 umount $USBPART 2>> $LOGFILE 1>> $LOGFILE 1536 1560 # If your key has no MBR it may cause an issue 1537 1561 # Use dd if=mbr.bin of=$USBDEVICE or ms-sys -s $USBDEVICE 1538 1562 if [ -r $MBRFILE ]; then 1539 Log File "Installing an MBR ($MBRFILE) on $USBDEVICE"1563 LogAll "INFO: Installing an MBR ($MBRFILE) on $USBDEVICE" 1540 1564 dd if=$MBRFILE of=$USBDEVICE 1541 1565 else 1542 Log File "You may need to install an MBR (usually in $MBRFILE, but not found on your system)"1543 Log File "on $USBDEVICE with dd if=$MBRFILE of=$USBDEVICE"1544 fi 1545 LogFile " Preparing $USBDEVICE"1566 LogAll "WARNING: You may need to install an MBR (usually in $MBRFILE, but not found on your system)" 1567 LogAll " on $USBDEVICE with dd if=$MBRFILE of=$USBDEVICE" 1568 fi 1569 LogFile "INFO: Preparing $USBDEVICE" 1546 1570 cat > $MINDI_TMP/fdisk.txt << EOF 1547 1571 d … … 1562 1586 $FDISK $USBDEVICE 2>> $LOGFILE 1>> $LOGFILE < $MINDI_TMP/fdisk.txt 1563 1587 if [ $? -ne 0 ]; then 1564 LogAll " Unable to create a vfat Filesystem on $USBDEVICE"1565 LogAll " Make sure your USB device is pluged in"1588 LogAll "ERROR: Unable to create a vfat Filesystem on $USBDEVICE" 1589 LogAll " Make sure your USB device is plugged in" 1566 1590 $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE 1567 1591 MindiExit -1 … … 1572 1596 LogFile "----------------" 1573 1597 rm -f $MINDI_TMP/fdisk.txt 1574 LogFile " The USB device $USBDEVICE now looks like this:"1598 LogFile "INFO: The USB device $USBDEVICE now looks like this:" 1575 1599 $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE 1576 1600 echo -en "." 1601 # Calling kpartx in case devices were not created 1602 if [ -x "/sbin/kpartx" ]; then 1603 /sbin/kpartx -a $USBDEVICE 1604 fi 1577 1605 # Some distro do auto mount at that point (Ubuntu) 1578 LogFile " Unmounting $USBPART just in case again"1606 LogFile "INFO: Unmounting $USBPART just in case again" 1579 1607 umount $USBPART 2>> $LOGFILE 1>> $LOGFILE 1580 1608 echo -en "." 1581 LogFile "Creating a vfat filesystem on $USBPART" 1609 # Some distro have a dmsetup conf at that point so removing it Cf: http://trac.mondorescue.org/ticket/651 1610 if [ "`which dmsetup`" != "" ]; then 1611 block_id="`echo $USBPART | sed 's|/dev/||g'`" 1612 if [[ "`dmsetup ls | awk '{print $1}' | grep $block_id`" != "" ]]; then 1613 LogFile "INFO: Removing $block_id from device mapper." 1614 sleep 1 1615 dmsetup remove $block_id 1616 fi 1617 fi 1618 echo -en "." 1619 LogFile "INFO: Creating a vfat filesystem on $USBPART" 1582 1620 mkdosfs -F 32 $USBPART 2>&1 >> $LOGFILE 1583 1621 if [ $? -ne 0 ]; then 1584 LogAll " Unable to create a vfat filesystem on $USBPART"1585 LogAll " Make sure your USB device is pluged in and partitioned ($USBPART must exist on it)"1622 LogAll "ERROR: Unable to create a vfat filesystem on $USBPART" 1623 LogAll " Make sure your USB device is plugged in and partitioned ($USBPART must exist on it)" 1586 1624 $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE 1587 1625 MindiExit -1 1588 1626 fi 1589 1627 echo -en "." 1590 LogFile " Mounting $USBPART on $MINDI_TMP/usb"1628 LogFile "INFO: Mounting $USBPART on $MINDI_TMP/usb" 1591 1629 mount $USBPART $MINDI_TMP/usb 2>> $LOGFILE 1592 1630 if [ $? -ne 0 ]; then 1593 LogAll " Unable to mount $USBPART on $MINDI_TMP/usb"1594 LogAll " Make sure your USB device is pluged in, partitioned and formated ($USBPART must exist on it)"1631 LogAll "ERROR: Unable to mount $USBPART on $MINDI_TMP/usb" 1632 LogAll " Make sure your USB device is plugged in, partitioned and formated ($USBPART must exist on it)" 1595 1633 $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE 1596 1634 MindiExit -1 … … 1598 1636 echo -en "." 1599 1637 mkdir -p $MINDI_TMP/usb/images 1600 cp -f $MINDI_CACHE/*.img $MINDI_CACHE/*.gz $MINDI_TMP/usb/images 2>> $LOGFILE || LogAll " OfferToMakeBootableUSB: Cannot copy $i to $MINDI_TMP/usb/images"1638 cp -f $MINDI_CACHE/*.img $MINDI_CACHE/*.gz $MINDI_TMP/usb/images 2>> $LOGFILE || LogAll "ERROR: OfferToMakeBootableUSB: Cannot copy $i to $MINDI_TMP/usb/images" 1601 1639 echo -en "." 1602 LogFile " mindi_lib = $MINDI_DATA"1640 LogFile "INFO: mindi_lib = $MINDI_DATA" 1603 1641 for i in memdisk memtest.bin memtest.img ; do 1604 1642 j=$MINDI_DATA/$i 1605 1643 k=$MINDI_TMP/usb 1606 1644 if [ -e "$j" ] ; then 1607 Log All "Copying $j to $k"1645 LogIt "INFO: Copying $j to $k" 1608 1646 cp -f $j $k 2>> $LOGFILE || Die "Failed to copy $j to $k" 1609 1647 cp -f $j $MINDI_TMP 2>> $LOGFILE || Die "Failed to copy $j to $MINDI_TMP" … … 1611 1649 done 1612 1650 echo -en "." 1613 MakeMessageFile > $MINDI_TMP/usb/message.txt1651 MakeMessageFile | cut -c1-80 > $MINDI_TMP/usb/message.txt 1614 1652 echo -en "." 1615 1653 cp $kernelpath $MINDI_TMP/usb/vmlinuz 2>> $LOGFILE || Die "Cannot copy vmlinuz ($kernelpath) to mindi tmp ($MINDI_TMP/usb/vmlinuz). Did you run out of disk space?" … … 1630 1668 umount $MINDI_TMP/usb 1631 1669 if [ "$ARCH" != "ia64" ] ; then 1632 syslinux -s $USBPART 2>> $MINDI_TMP/syslinux.log 1633 if [ "$?" -ne "0" ] ; then 1670 syslinux -v 2>&1 | grep -q 4.02 1671 if [ $? -eq 0 ]; then 1672 # This buggy version of syslinux requires a call to --stupid and not -s 1673 syslinux --stupid $USBPART 2>> $MINDI_TMP/syslinux.log 1674 res=$? 1675 else 1676 syslinux -s $USBPART 2>> $MINDI_TMP/syslinux.log 1677 res=$? 1678 fi 1679 if [ $res -ne 0 ] ; then 1634 1680 LogAll "----------- syslinux's errors --------------" 1635 1681 cat $MINDI_TMP/syslinux.log |tee -a $LOGFILE 1636 echo"------------------------------------------"1637 Log All "Failed to create USB image."1682 LogAll "------------------------------------------" 1683 LogIt "ERROR: Failed to create USB image." 1638 1684 else 1639 1685 echo -e "$DONE" 1640 LogFile " Created bootable USB image on $USBDEVICE"1686 LogFile "INFO: Created bootable USB image on $USBDEVICE" 1641 1687 fi 1642 1688 rm -f $MINDI_TMP/syslinux.log 1643 1689 else 1644 echo "No USB boot support for ia64"1690 LogAll "ERROR: No USB boot support for ia64" 1645 1691 MindiExit -1 1646 1692 fi … … 1718 1764 echo -en "default${sep}iso\n" 1719 1765 else 1720 echo -en "default${sep} interactive\n"1766 echo -en "default${sep}${MINDI_DEFAULT_BOOT_OPTION}\n" 1721 1767 fi 1722 1768 else … … 1726 1772 # Handle timeout 1727 1773 if [ "$CDRECOVERY" != "yes" ] ; then 1728 echo -en "timeout${sep} 300\n"1774 echo -en "timeout${sep}${MINDI_BOOT_TIMEOUT}\n" 1729 1775 else 1730 1776 echo -en "timeout${sep}10000\n" … … 1746 1792 for i in $options ; do 1747 1793 ooo=$i 1748 [ "$ooo" = "RESTORE" ] && ooo=" nuke"1794 [ "$ooo" = "RESTORE" ] && ooo="RESTORE nuke" 1749 1795 if [ "$type" = "elilo" ]; then 1750 1796 outstr="image=/vmlinuz\n\tlabel=$i\n\tinitrd=/initrd.img\n\troot=/dev/ram0 append=\" rw ramdisk_size=$ramdisk_size $ooo $MINDI_ADDITIONAL_BOOT_PARAMS \"\n" … … 1802 1848 fi 1803 1849 1804 mount -t vfat -o loop $imagefile $mountpoint || LogAll " Cannot mount (PBDI)"1850 mount -t vfat -o loop $imagefile $mountpoint || LogAll "ERROR: Cannot mount (PBDI)" 1805 1851 1806 1852 # copy Mindi's skeleton fs & lilo/syslinux/whatever stuff into it … … 1808 1854 liloconf=$mountpoint/elilo.conf 1809 1855 1810 MakeMessageFile > $mountpoint/message.txt1856 MakeMessageFile | cut -c1-80 > $mountpoint/message.txt 1811 1857 1812 1858 if [ "$ARCH" != "ia64" ] ; then … … 1833 1879 fi 1834 1880 1835 LogFile " Copying $MINDI_TMP/initrd.img to $mountpoint/initrd.img..."1881 LogFile "INFO: Copying $MINDI_TMP/initrd.img to $mountpoint/initrd.img..." 1836 1882 cp -f $MINDI_TMP/initrd.img $mountpoint/initrd.img 2>> $LOGFILE 1837 1883 if [ "$?" -ne "0" ] ; then 1838 LogAll " Failed to copy $MINDI_TMP/initrd.img to $mountpoint"1884 LogAll "ERROR: Failed to copy $MINDI_TMP/initrd.img to $mountpoint" 1839 1885 cat $MINDI_TMP/mtpt.$$ >> $LOGFILE 1840 LogAll " Please unload some of your modules and try again."1886 LogAll " Please unload some of your modules and try again." 1841 1887 rm -f $MINDI_TMP/mtpt.$$ 1842 LogAll "Cannot incorporate initrd.img in bootdisk (kernel / modules too big?). Try to increase EXTRA_SPACE and BOOT_SIZE in $MINDI_CONFIG" 1888 LogAll " Cannot incorporate initrd.img in bootdisk (kernel / modules too big?)." 1889 LogAll " Try to increase EXTRA_SPACE and BOOT_SIZE in $MINDI_CONFIG" 1843 1890 retval=$(($retval+1)) 1844 1891 fi … … 1858 1905 1859 1906 if [ "$retval" -ne "0" ] ; then 1860 LogFile " Files at mountpoint ($mountpoint) :-"1907 LogFile "INFO: Files at mountpoint ($mountpoint) :" 1861 1908 du -sk $mountpoint/* >> $LOGFILE 1862 LogFile "--- end of list of files ---" 1909 LogFile "--- end of list of files ---" 1863 1910 echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n" >> $LOGFILE 1864 1911 [ "$mountpoint" != "" ] && rm -f $mountpoint/vmlinuz 1865 1912 cd "$old_pwd" 1866 1913 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 1867 rmdir $mountpoint || LogAll " Cannot rmdir (PBDI)"1914 rmdir $mountpoint || LogAll "ERROR: Cannot rmdir (PBDI)" 1868 1915 1869 1916 rm -f $imagefile … … 1871 1918 fi 1872 1919 max_kernel_size=$(($free_space+`du -sk $kernelpath | cut -f1`)) 1873 LogFile " Free space left on image = $free_space KB"1874 LogFile " Max kernel size on $BOOT_SIZE KB image (est'd) = $max_kernel_size K"1920 LogFile "INFO: Free space left on image = $free_space KB" 1921 LogFile "INFO: Max kernel size on $BOOT_SIZE KB image (est'd) = $max_kernel_size K" 1875 1922 1876 1923 # make it bootable … … 1883 1930 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 1884 1931 echo -en "..." 1885 rmdir $mountpoint || LogAll " Cannot rmdir (PBDI)"1932 rmdir $mountpoint || LogAll "ERROR: Cannot rmdir (PBDI)" 1886 1933 1887 1934 if [ "$retval" -eq "0" ] ; then 1888 1935 echo -en "...$DONE\n" 1889 LogAll "$BOOT_SIZE KB boot disk was created OK\n" 1936 if [ "$KERN_DISK_MADE" ] ; then 1937 [ "$imagefile" != "" ] && rm -f $imagefile 1938 LogAll "INFO: $BOOT_SIZE KB boot disks were created OK\n" 1939 fi 1890 1940 else 1891 1941 echo -en "...failed\n" 1892 LogAll " $BOOT_SIZEKB boot disk was NOT created\n"1893 rm -f $imagefile1894 fi 1895 [ "$retval" -ne "0" ] && LogAll " PrepareBootDiskImage() is returning nonzero"1942 LogAll "WARNING: $BOOT_SIZE""KB boot disk was NOT created\n" 1943 [ "$imagefile" != "" ] && rm -f $imagefile 1944 fi 1945 [ "$retval" -ne "0" ] && LogAll "ERROR: PrepareBootDiskImage() is returning nonzero" 1896 1946 return $retval 1897 1947 } … … 1944 1994 Die "You have $res files present in dependency list\nbut absent from filesystem." 1945 1995 fi 1946 FindAndAddUserKeyboardMappingFile 1996 FindAndAddUserKeyboardMappingFile 1947 1997 mkdir -p $bigdir/tmp 1948 1998 [ -d "/mnt/.boot.d" ] && echo "Oh Jebus" > $bigdir/tmp/DUMBASS-GENTOO … … 1962 2012 i=`cat $MINDI_TMP/BOOTLOADER.DEVICE 2> /dev/null` 1963 2013 if [ "$i" ] ; then 1964 LogAll " Backing up $i's MBR"2014 LogAll "INFO: Backing up $i's MBR" 1965 2015 dd if=$i of=$bigdir/BOOTLOADER.MBR bs=446 count=1 >> $LOGFILE 2>> $LOGFILE 1966 2016 sleep 1 … … 1968 2018 j=$i 1969 2019 [ -h "$j" ] && j=`readlink -f $j` 1970 LogAll " Creating /dev/boot_device ($j)"2020 LogAll "INFO: Creating /dev/boot_device ($j)" 1971 2021 mkdir -p $bigdir/dev 1972 2022 cp -pRdf $j $bigdir/dev/boot_device 2>> $LOGFILE || Die "Unable to create /dev/boot_device on ramdisk" … … 1980 2030 if [ -d /$ti ]; then 1981 2031 mkdir -p $ti 1982 cp -Rdf /$ti/* $ti 2>> $LOGFILE || LogAll " WARNING - error occurred while copying terminfo"2032 cp -Rdf /$ti/* $ti 2>> $LOGFILE || LogAll "ERROR: issue copying terminfo" 1983 2033 fi 1984 2034 if [ -e "$MONDO_SHARE/restore-scripts" ]; then … … 1987 2037 fi 1988 2038 if [ -d "/lib/dev-state" ]; then 1989 tar cf - -C / ./lib/dev-state 2>> $MINDI_TMP/$$.log | tar xf - || LogAll " Unable to handle /lib/dev-state" $MINDI_TMP/$$.log2039 tar cf - -C / ./lib/dev-state 2>> $MINDI_TMP/$$.log | tar xf - || LogAll "ERROR: Unable to handle /lib/dev-state" $MINDI_TMP/$$.log 1990 2040 fi 1991 2041 cd "$old_pwd" … … 2006 2056 fi 2007 2057 fi 2058 LogFile "Your mountlist.txt file content is:" 2059 LogFile "-----------------------------------" 2060 cat $bigdir/$MINDI_CACHE/mountlist.txt >> $LOGFILE 2061 LogFile "-----------------------------------" 2008 2062 2009 2063 echo -en "Tarring and zipping the data content..." 2010 2064 size_of_all_tools=`du -sk $bigdir | cut -f1` 2011 (cd "$bigdir" ; tar -b 4096 -cf - . 2>> $MINDI_TMP/$$.log | gzip -9 > $imagesdir/all.tar.gz || LogAll " Problem creating all.tar.gz" $MINDI_TMP/$$.log)2065 (cd "$bigdir" ; tar -b 4096 -cf - . 2>> $MINDI_TMP/$$.log | gzip -9 > $imagesdir/all.tar.gz || LogAll "ERROR: Problem creating all.tar.gz" $MINDI_TMP/$$.log) 2012 2066 LogFile "Size of the data content" 2013 2067 LogFile "------------------------" … … 2124 2178 if [ "$?" -eq "0" ] ; then 2125 2179 cp -f $tmpfile $1 2>> $LOGFILE 2126 LogFile " Stripped binary $2"2180 LogFile "INFO: Stripped binary $2" 2127 2181 fi 2128 2182 rm -f $tmpfile … … 2164 2218 # It's a Xen kernel 2165 2219 KERNEL_IS_XEN="yes" 2166 LogFile "I t's a Xen kernel..."2167 fi 2168 2169 for fname in `find $root -maxdepth 2 -type f | grep -Ei 'lin|kern|xen' | grep -Ev '^/proc/|^/net/ '` ; do2220 LogFile "INFO: It's a Xen kernel..." 2221 fi 2222 2223 for fname in `find $root -maxdepth 2 -type f | grep -Ei 'lin|kern|xen' | grep -Ev '^/proc/|^/net/|^/mnt|^/lib|^/lib64|^/bin|^/sbin|^/usr|^/tmp'` ; do 2170 2224 [ ! -e "$fname" ] && continue 2171 2225 [ "$fname" = "/boot/vmlinuz.shipped" ] && [ -f "/boot/vmlinuz" ] && continue; # ignore SuSE's extra kernel … … 2200 2254 fi 2201 2255 if [ ! "$possible_kernels" ] ; then 2202 LogAll " No kernel matches exactly. Are there any duff kernels?"2256 LogAll "INFO: No kernel matches exactly. Are there any duff kernels?" 2203 2257 possible_kernels="$duff_kernels" 2204 2258 if [ ! "$possible_kernels" ] ; then 2205 LogAll " Sorry, no duff kernels either"2259 LogAll "INFO: Sorry, no duff kernels either" 2206 2260 else 2207 LogAll "I bet you're running Debian or Gentoo, aren't you?"2208 LogAll " Your kernel doesn't have a sane builddate. Oh well..."2261 LogAll "INFO: I bet you're running Debian or Gentoo, aren't you?" 2262 LogAll "INFO: Your kernel doesn't have a sane builddate. Oh well..." 2209 2263 fi 2210 2264 fi … … 2219 2273 LogAll "Could not find your kernel." 2220 2274 if [ -e "/boot/vmlinuz" ] ; then 2221 LogAll " Using /boot/vmlinuz as a last resort."2275 LogAll "INFO: Using /boot/vmlinuz as a last resort." 2222 2276 output=/boot/vmlinuz 2223 2277 else … … 2226 2280 elif [ "$noof_kernels" -eq "1" ] ; then 2227 2281 kp=`echo "$possible_kernels" | sed s/' '//` 2228 LogFile " Your kernel is $kp (v$KERVERRUN)"2282 LogFile "INFO: Your kernel is $kp (v$KERVERRUN)" 2229 2283 output="$kp" 2230 2284 else 2231 2285 for i in $possible_kernels ; do 2232 2286 if [ "`echo $i | grep "$KERVERRUN"`" ]; then 2233 LogAll " OK, I used my initiative and found that "2234 LogAll " $i is probably your kernel. "2287 LogAll "INFO: OK, I used my initiative and found that " 2288 LogAll "INFO: $i is probably your kernel. " 2235 2289 output="$i" 2236 2290 break … … 2240 2294 if [ "`echo " $possible_kernels " | grep -F "/boot/vmlinuz " &> /dev/null`" ]; then 2241 2295 output=/boot/vmlinuz 2242 LogFile " Schlomo, this one's for you."2296 LogFile "INFO: Schlomo, this one's for you." 2243 2297 else 2244 LogFile " Two or more possible kernels found. You may specify any one of them and the "2245 LogFile " boot disks will still work, probably. If one does not work, try another."2246 LogFile " $possible_kernels"2298 LogFile "INFO: Two or more possible kernels found. You may specify any one of them and the " 2299 LogFile "INFO: boot disks will still work, probably. If one does not work, try another." 2300 LogFile "INFO: $possible_kernels" 2247 2301 output="" 2248 2302 fi … … 2254 2308 elif [ "$noof_xenkernels" -eq "1" ]; then 2255 2309 xenkernelpath=`echo "$possible_xenkernels" | sed s/' '//` 2256 LogFile " Your Xen kernel is $xenkernelpath (v$KERVERRUN)"2310 LogFile "INFO: Your Xen kernel is $xenkernelpath (v$KERVERRUN)" 2257 2311 else 2258 2312 for i in $possible_xenkernels ; do 2259 2313 if [ "`echo $i | grep "$KERVERRUN"`" ]; then 2260 LogFile " OK, I used my initiative and found that "2261 LogFile " $i is probably your Xen kernel. "2314 LogFile "INFO: OK, I used my initiative and found that " 2315 LogFile "INFO: $i is probably your Xen kernel. " 2262 2316 xenkernelpath="$i" 2263 2317 break … … 2268 2322 if [ ! -n "$new_possible_xenkernels" ]; then 2269 2323 xenkernelpath=`echo $new_possible_xenkernels | tr -s ' ' '\n' | head -1` 2270 LogFile " Using $xenkernelpath"2324 LogFile "INFO: Using $xenkernelpath" 2271 2325 else 2272 LogFile " Two or more possible Xen kernels found. You may specify any one of them and the "2273 LogFile " boot disks will still work, probably. If one does not work, try another."2274 LogFile " $possible_xenkernels"2326 LogFile "INFO: Two or more possible Xen kernels found. You may specify any one of them and the " 2327 LogFile "INFO: boot disks will still work, probably. If one does not work, try another." 2328 LogFile "INFO: $possible_xenkernels" 2275 2329 output="" 2276 2330 xenkernelpath=`echo $possible_xenkernels | tr -s ' ' '\n' | head -1` 2277 LogFile " Using $xenkernelpath"2331 LogFile "INFO: Using $xenkernelpath" 2278 2332 fi 2279 2333 fi … … 2302 2356 # Get kbd conf from data disk preparation 2303 2357 cat $MINDI_CACHE/KEYMAP-LIVES-HERE >> $MINDI_TMP/cp.lis 2304 # AL04Oct08: Check whether /lib64 is a link and if so explicitly create one in rootfs2358 # AL04Oct08: Check whether /lib64 or /lib is a link and if so explicitly create one in rootfs 2305 2359 if [ -h "/lib64" ]; then 2306 2360 echo lib >> $MINDI_TMP/mkdir.lis 2307 2361 echo ln -s lib lib64 >> $MINDI_TMP/ln.lis 2362 fi 2363 if [ -h "/lib" ]; then 2364 echo usr/lib >> $MINDI_TMP/mkdir.lis 2365 mv lib/* usr/lib 2366 echo ln -s usr/lib lib >> $MINDI_TMP/ln.lis 2367 fi 2368 # Check whether /sbin and /bin are a link and if so explicitly create one in rootfs (Fedora 17 crazyness) 2369 if [ -h "/sbin" ]; then 2370 echo usr/sbin >> $MINDI_TMP/mkdir.lis 2371 mv sbin/* usr/sbin 2372 echo ln -s usr/sbin sbin >> $MINDI_TMP/ln.lis 2373 fi 2374 if [ -h "/bin" ]; then 2375 echo usr/bin >> $MINDI_TMP/mkdir.lis 2376 mv bin/* usr/bin 2377 echo ln -s usr/bin bin >> $MINDI_TMP/ln.lis 2308 2378 fi 2309 2379 … … 2330 2400 echo /etc/ld.so.c* >> $MINDI_TMP/cp.lis 2331 2401 2332 # Avoid an issue on some distro (RHEL5) 2402 # Handle the case where busybox and mount are dynamically linked 2403 file $MINDI_LIB/rootfs/bin/busybox 2>&1 | grep -q "dynamically" 2404 if [ $? -eq 0 ]; then 2405 # We want to use the real mount and all the supported variants (nfs, cifs, ...) 2406 rm -f bin/mount 2407 fi 2408 2409 # Copy of files from the minimal env needed as per the deplist.d/minimal.conf file (which includes all busybox deps) 2410 rm -f $MINDI_TMP/minimal.lis $MINDI_TMP/minimal2.lis 2411 for f in `grep -v " *#.*" $DEPLIST_DIR/minimal.conf | sort -u`; do 2412 if [ -r $f ]; then 2413 echo $f >> $MINDI_TMP/minimal.lis 2414 LocateDeps $f >> $MINDI_TMP/minimal2.lis 2415 fi 2416 done 2417 for f in `cat $MINDI_TMP/minimal.lis` `sort -u $MINDI_TMP/minimal2.lis`; do 2418 ReadAllLink $f >> $MINDI_TMP/minimal.lis 2419 done 2420 # Initial / are trucated by tar 2421 finallist="" 2422 # Remove directories from the list, as tar will create them anyway 2423 # and it may hurt if /lib is in it as on Debian/Ubuntu 2424 for f in `sort -u $MINDI_TMP/minimal.lis`; do 2425 if [ ! -d $f ]; then 2426 finallist="$finallist $f" 2427 fi 2428 done 2429 tar cf - $finallist 2>> $MINDI_TMP/$$.log | tar xUf - || LogIt "WARNING: Problem in minimal analysis" $MINDI_TMP/$$.log 2430 2431 # To improve support for distribution scripts, we now prefer to use bash as the std shell. Also fixes #600 2432 ln -sf /bin/bash bin/sh 2433 LogIt "INFO: Using bash as default shell" 2434 rm -f $MINDI_TMP/minimal.lis $MINDI_TMP/minimal2.lis 2435 2436 # Avoids an issue on some distro (RHEL5) 2333 2437 echo ./etc/ld.so.conf.d/kernelcap* >> $MINDI_TMP/rm.lis 2334 2438 … … 2341 2445 if [ $? -eq 0 ]; then 2342 2446 USE_UDEV="yes" 2343 LogFile " udev device manager found"2447 LogFile "INFO: udev device manager found" 2344 2448 echo /etc/udev /lib*/udev >> $MINDI_TMP/cp.lis 2345 2449 # This avoids NIC remapping if on another machine at restore time on Debian at least … … 2373 2477 rm -f $MINDI_TMP/udev.lis 2374 2478 else 2375 LogAll " udevd daemon not in standard place (/sbin)"2376 LogAll " mindi will use static devices which may cause problems"2479 LogAll "WARNING: udevd daemon not in standard place (/sbin or /usr/bin)" 2480 LogAll " mindi will use static devices which may cause problems" 2377 2481 fi 2378 2482 fi … … 2382 2486 mindi-bkphw $MINDI_CACHE $MINDI_CONF | tee -a $LOGFILE 2383 2487 if [ -d $MINDI_CACHE/bkphw ]; then 2384 LogAll " Hardware Information found and saved ..."2488 LogAll "INFO: Hardware Information found and saved ..." 2385 2489 echo $MINDI_CACHE/bkphw >> $MIDNDI_TMP/cp.lis 2386 2490 if [ -f $MINDI_CACHE/tools.files ]; then … … 2421 2525 fi 2422 2526 for i in $DENY_MODS; do 2423 LogFile " Removing $i from the list of modules to load"2527 LogFile "INFO: Removing $i from the list of modules to load" 2424 2528 list_of_groovy_mods=`echo ${list_of_groovy_mods} | tr ' ' '\n' | grep -Ev "^${i}$" | tr '\n' ' '` 2425 2529 done 2426 2530 2427 [ -e "$needed_modules_path" ] || LogAll " path $needed_modules_path does not exist.\n If you're not using a modular kernel then you're NUTS."2531 [ -e "$needed_modules_path" ] || LogAll "WARNING: path $needed_modules_path does not exist.\n If you're not using a modular kernel then you're NUTS." 2428 2532 for i in $list_of_groovy_mods ; do 2429 2533 needed_modules="$needed_modules `FindSpecificModuleInPath $needed_modules_path $i`" … … 2457 2561 # Copy an additional ProLiant tool for OBDR support 2458 2562 if [ -f $MINDI_TMP/OBDR ]; then 2563 found=0 2459 2564 if [ -x /usr/bin/hpsa_obdr_mode ]; then 2460 2565 echo $mountpoint/usr/bin >> $MINDI_TMP/mkdir.lis 2461 2566 echo /usr/bin/hpsa_obdr_mode >> $MINDI_TMP/cp.lis 2462 LogIt "Copying /usr/bin/hpsa_obdr_mode to ramdisk for improved OBDR support" 2463 else 2464 LogAll "WARNING: You're using OBDR mode without having the /usr/bin/hpsa_obdr_mode tool" 2567 LogIt "INFO: Copying /usr/bin/hpsa_obdr_mode to ramdisk for improved Smart Array OBDR support" 2568 found=1 2569 fi 2570 if [ -x /usr/bin/sg_wr_mode ]; then 2571 mkdir -p $mountpoint/usr/bin 2572 lis="/usr/bin/sg_map /usr/bin/sg_inq /usr/bin/sg_reset /usr/bin/rev" 2573 LocateDeps $lis > $MINDI_TMP/obdr.lis 2574 (cd $mountpoint ; tar cf - $lis -C / `sort -u $MINDI_TMP/obdr.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in obdr.lis analysis" $MINDI_TMP/$$.log) 2575 LogIt "INFO: Copying /usr/bin/sg_reset to ramdisk for improved SCSI OBDR support" 2576 found=1 2577 fi 2578 if [ $found -eq 0 ]; then 2579 LogAll "WARNING: You're using OBDR mode without having the /usr/bin/hpsa_obdr_mode nor the /usr/bin/sg_wr_mode tool" 2465 2580 LogAll " This may lead to a tape not going back to sequential mode after OBDR boot" 2466 2581 fi … … 2523 2638 LogFile "Content of initial ramdisk:" 2524 2639 LogFile "---------------------------" 2640 mkdir -p $mountpoint/proc 2525 2641 (cd "$mountpoint" ; ls -Rla ) >> $LOGFILE 2526 2642 LogFile "---------------------------" 2527 2643 2528 2644 # Determine what filesystem to use for initrd image 2529 LogFile " Call GetInitrdFilesystemToUse() with parameter ${kernelpath} to get filesystem to use for initrd."2645 LogFile "INFO: Call GetInitrdFilesystemToUse() with parameter ${kernelpath} to get filesystem to use for initrd." 2530 2646 gvFileSystem=`GetInitrdFilesystemToUse ${kernelpath}` 2531 2647 [ -z gvFileSystem ] && Die "GetFilesystemToUse() failed. Terminating." 2532 if [ "$gvFileSystem" = "ext2fs" ] || [ "$gvFileSystem" = "ext3fs" ] ; then2648 if [ "$gvFileSystem" = "ext2fs" ] || [ "$gvFileSystem" = "ext3fs" ] || [ "$gvFileSystem" = "ext4fs" ]; then 2533 2649 # say what will be used 2534 LogFile " Creating an $gvFileSystem initrd image..."2650 LogFile "INFO: Creating an $gvFileSystem initrd image..." 2535 2651 # kernel expects linuxrc in ext2 filesystem 2536 2652 ( cd "$mountpoint" && ln -sf sbin/init linuxrc ) … … 2538 2654 umount $mountpoint || Die "Cannot unmount $tempfile" 2539 2655 dd if=$tempfile bs=1k 2> /dev/null > ${rdz_fname}.tmp 2> /dev/null 2540 bs=`tune2fs -l ${rdz_fname}.tmp | grep -E '^Block size:' | cut -d: -f2 | sed 's/^ *//'` 2656 if [ "$gvFileSystem" = "ext4fs" ] && [ -x "/sbin/tune4fs" ]; then 2657 bs=`/sbin/tune4fs -l ${rdz_fname}.tmp | grep -E '^Block size:' | cut -d: -f2 | sed 's/^ *//'` 2658 else 2659 bs=`tune2fs -l ${rdz_fname}.tmp | grep -E '^Block size:' | cut -d: -f2 | sed 's/^ *//'` 2660 fi 2541 2661 MINDI_ADDITIONAL_BOOT_PARAMS="$MINDI_ADDITIONAL_BOOT_PARAMS ramdisk_blocksize=$bs" 2542 2662 gzip -c9 ${rdz_fname}.tmp > $rdz_fname 2543 2663 rm -f ${rdz_fname}.tmp 2544 2664 # log that we are done 2545 LogFile " ...done."2665 LogFile " ...done." 2546 2666 elif [ "$gvFileSystem" = "initramfs" ]; then 2547 2667 # say what will be used 2548 LogFile " Creating a gzip'ed cpio (AKA initramfs) initrd image..."2668 LogFile "INFO: Creating a gzip'ed cpio (AKA initramfs) initrd image..." 2549 2669 # make sure that cpio is there 2550 2670 which cpio &> /dev/null; [ $? -eq 0 ] || Die "cpio not found. Please install package cpio and try again." … … 2558 2678 umount $mountpoint || Die "Cannot unmount $tempfile" 2559 2679 # log that we are done 2560 LogFile " ...done."2680 LogFile " ...done." 2561 2681 else 2562 2682 Die "Filesystem $gvFileSystem not supported for initrd image. Terminating." … … 2585 2705 fi 2586 2706 2707 # --nolog needs to be first, and is used in analyze-my-lvm 2708 if [ "$1" = "--nolog" ] ; then 2709 shift 2710 LOGFILE=/dev/stderr 2711 else 2712 > $LOGFILE 2713 fi 2587 2714 if [ "$1" = "--printvar" ] ; then 2588 2715 shift … … 2594 2721 2595 2722 > $LOGFILE 2596 LogFile "mindi v$MINDI_VERSION" 2597 LogFile "$ARCH architecture detected" 2598 LogFile "mindi called with the following arguments:" 2599 LogFile "$*" 2600 LogFile "Start date : `date`" 2601 LogFile "-----------------------------" 2723 LogFile "mindi v$MINDI_VERSION" 2724 LogFile "$ARCH architecture detected" 2725 LogFile "mindi called with the following arguments:" 2726 echo "$@">> $LOGFILE 2727 LogFile "Start date : `date`" 2728 LogFile "-----------------------------" 2602 2729 2603 2730 # Log some capital variables … … 2609 2736 LogFile "MINDI_CONF = $MINDI_CONF" 2610 2737 if [ -f $MINDI_CONFIG ]; then 2611 LogFile "-----------------------------" 2612 LogFile " Mindi configuration file " 2613 LogFile "-----------------------------" 2738 LogFile "-----------------------------" 2739 LogFile " Mindi configuration file " 2740 LogFile "-----------------------------" 2614 2741 grep -Ev '^#' $MINDI_CONFIG >> $LOGFILE 2615 LogFile "-----------------------------" 2616 fi 2617 2742 LogFile "-----------------------------" 2743 fi 2744 LogFile "In Mindi" 2745 LogFile "--------" 2746 LogFile "EXTRA_SPACE = $EXTRA_SPACE" 2747 LogFile "BOOT_SIZE = $BOOT_SIZE" 2748 LogFile "--------" 2618 2749 2619 2750 trap AbortHere SIGTERM SIGHUP SIGQUIT SIGKILL SIGABRT SIGINT … … 2626 2757 if which awk &> /dev/null ; then 2627 2758 if ! which gawk &> /dev/null ; then 2628 Log All "You have awk but not gawk.\nPlease note that mindi works fine with a _sane_ awk binary.\nIf your awk binary misbehaves then please contact your vendor\nor distribution's mailing list for technical support.\n"2759 LogIt "INFO: You have awk but not gawk.\nPlease note that mindi works fine with a _sane_ awk binary.\nIf your awk binary misbehaves then please contact your vendor\nor distribution's mailing list for technical support.\n" 2629 2760 fi 2630 2761 fi … … 2632 2763 [ ! -e "$FDISK" ] && Die "Cannot find $FDISK" 2633 2764 2634 [ "`echo $KERVERRUN | grep "2.4.[0-6]" | grep -v "2.4.[0-9][0-9]"`" != "" ] && echo "WARNING! Your kernel may have buggy loopfs code. Consider upgrading to 2.4.7"2765 [ "`echo $KERVERRUN | grep -E "2\.4\.[0-6]" | grep -vE "2\.4\.[0-9][0-9]"`" != "" ] && echo "WARNING! Your kernel may have buggy loopfs code. Consider upgrading to 2.4.7" 2635 2766 2636 2767 # Update the PATH variable if incomplete … … 2638 2769 PATH=$PATH:/sbin:/usr/sbin 2639 2770 export PATH 2640 LogFile " Your PATH did not include /sbin or /usr/sbin. I have fixed that, temporarily."2641 LogFile " However, you may wish to ask your vendor to provide a permanent fix..."2642 LogFile " Or you might like to call 'su -' instead of 'su', for example."2771 LogFile "INFO: Your PATH did not include /sbin or /usr/sbin. I have fixed that, temporarily." 2772 LogFile "INFO: However, you may wish to ask your vendor to provide a permanent fix..." 2773 LogFile "INFO: Or you might like to call 'su -' instead of 'su', for example." 2643 2774 fi 2644 2775 … … 2682 2813 fi 2683 2814 2684 LogFile " LVM set to $LVM"2685 LogFile "----------" 2686 LogFile "mount result:" 2687 LogFile "-------------" 2815 LogFile "INFO: LVM set to $LVM" 2816 LogFile "----------" 2817 LogFile "mount result:" 2818 LogFile "-------------" 2688 2819 mount >> $LOGFILE 2689 LogFile "-------------"2690 2820 if [ -e /etc/raidtab ]; then 2691 LogFile "-------------" 2692 LogFile "/etc/raidtab content:" 2693 LogFile "-------------" 2821 LogFile "-------------" 2822 LogFile "/etc/raidtab content:" 2823 LogFile "-------------" 2694 2824 cat /etc/raidtab >> $LOGFILE 2825 else 2826 LogFile "No file /etc/raidtab" 2827 fi 2828 if [ -e /etc/mdadm.conf ]; then 2829 LogFile "-------------" 2830 LogFile "/etc/mdadm.conf content:" 2831 LogFile "-------------" 2832 cat /etc/mdadm.conf >> $LOGFILE 2833 else 2834 LogFile "-------------" 2835 LogFile "No file /etc/mdadm.conf" 2695 2836 fi 2696 2837 LogFile "-------------" … … 2702 2843 LogFile "-------------" 2703 2844 cat /proc/swaps >> $LOGFILE 2704 LogFile "-------------" 2705 LogFile "cat /proc/partitions:" 2706 LogFile "-------------" 2845 LogFile "-------------" 2846 if [ -e /proc/mdstat ]; then 2847 LogFile "cat /proc/mdstat:" 2848 LogFile "-------------" 2849 cat /proc/mdstat >> $LOGFILE 2850 else 2851 LogFile "No pseudo file /proc/mdstat" 2852 fi 2853 LogFile "-------------" 2854 LogFile "cat /proc/partitions:" 2855 LogFile "-------------" 2707 2856 cat /proc/partitions >> $LOGFILE 2708 LogFile "-------------" 2709 LogFile "cat /proc/filesystems:" 2710 LogFile "-------------" 2857 LogFile "-------------" 2858 LogFile "cat /proc/filesystems:" 2859 LogFile "-------------" 2711 2860 cat /proc/filesystems >> $LOGFILE 2712 LogFile "-------------" 2713 LogFile "lsmod result:" 2714 LogFile "-------------" 2861 LogFile "-------------" 2862 LogFile "lsmod result:" 2863 LogFile "-------------" 2715 2864 lsmod >> $LOGFILE 2716 2865 MODULES="`cat /proc/modules | $AWK '{print $1}'`" 2717 2866 if [ -x /usr/sbin/esxcfg-module ]; then 2718 LogFile "-------------" 2719 LogFile " VMWare ESX server detected - Enabling dedicated support"2720 LogFile "-------------" 2721 LogFile "VMWare modules" 2722 LogFile "-------------" 2867 LogFile "-------------" 2868 LogFile "INFO: VMWare ESX server detected - Enabling dedicated support" 2869 LogFile "-------------" 2870 LogFile "VMWare modules" 2871 LogFile "-------------" 2723 2872 /usr/sbin/esxcfg-module -l >> $LOGFILE 2724 2873 MODULES="$MODULES `/usr/sbin/esxcfg-module -l | $AWK '{print $1}'`" 2725 2874 fi 2726 LogFile "FORCE_MODS:"2727 LogFile "-------------"2728 LogFile $FORCE_MODS2729 LogFile "-------------"2730 LogFile "DENY_MODS:"2731 LogFile "-------------"2732 LogFile $DENY_MODS2733 LogFile "-------------"2734 LogFile "df result:"2735 LogFile "----------"2736 df -T >> $LOGFILE2737 LogFile "-------------"2738 2875 LogFile "Liste of extra modules is:" 2739 2876 LogFile "-------------" 2740 2877 LogFile "$EXTRA_MODS" 2741 2878 LogFile "-------------" 2879 LogFile "FORCE_MODS:" 2880 LogFile "-------------" 2881 LogFile "$FORCE_MODS" 2882 LogFile "-------------" 2883 LogFile "DENY_MODS:" 2884 LogFile "-------------" 2885 LogFile "$DENY_MODS" 2886 LogFile "-------------" 2887 LogFile "df result:" 2888 LogFile "----------" 2889 df -aT >> $LOGFILE 2890 LogFile "-------------" 2891 LogFile "df -i result:" 2892 LogFile "----------" 2893 df -i >> $LOGFILE 2894 LogFile "-------------" 2895 if [ -r /boot/grub/menu.lst ]; then 2896 LogFile "-------------" 2897 LogFile "INFO: /boot/grub/menu.lst content" 2898 LogFile "-------------" 2899 cat /boot/grub/menu.lst >> $LOGFILE 2900 LogFile "-------------" 2901 fi 2902 if [ -r /boot/grub/grub.conf ]; then 2903 LogFile "-------------" 2904 LogFile "INFO: /boot/grub/grub.conf content" 2905 LogFile "-------------" 2906 cat /boot/grub/grub.conf >> $LOGFILE 2907 LogFile "-------------" 2908 fi 2909 if [ -r /boot/grub/grub.cfg ]; then 2910 LogFile "-------------" 2911 LogFile "INFO: /boot/grub/grub.cfg content" 2912 LogFile "-------------" 2913 cat /boot/grub/grub.cfg >> $LOGFILE 2914 LogFile "-------------" 2915 fi 2916 if [ -r /boot/grub/device.map ]; then 2917 LogFile "-------------" 2918 LogFile "INFO: /boot/grub/device.map content" 2919 LogFile "-------------" 2920 cat /boot/grub/device.map >> $LOGFILE 2921 LogFile "-------------" 2922 fi 2923 if [ -r /etc/lilo.conf ]; then 2924 LogFile "-------------" 2925 LogFile "INFO: /etc/lilo.conf content" 2926 LogFile "-------------" 2927 cat /etc/lilo.conf >> $LOGFILE 2928 fi 2929 LogFile "Full fdisk info" 2930 LogFile "---------------" 2931 $FDISK -l >> $LOGFILE 2932 LogFile "----------------" 2933 LogFile "List of extra modules is:" 2934 LogFile "$EXTRA_MODS" 2935 LogFile "-------------" 2742 2936 2743 2937 # Compute libata version … … 2747 2941 if [ "$laver" = "2" ]; then 2748 2942 DENY_MODS="$DENY_MODS ide-generic" 2749 LogFile "ide-generic removed from module list as your system uses libata v2+" 2750 LogFile "-------------" 2751 fi 2943 LogFile "INFO: ide-generic removed from module list as your system uses libata v2+" 2944 LogFile "-------------" 2945 fi 2946 fi 2947 2948 # Check for McAfee which disturbs the access to some files (tgz in articular) 2949 if [ "x`cat /proc/linuxshield/enabled 2>/dev/null`" = "x1" ]; then 2950 LogFile "WARNING: McAfee LinuxShield is enabled. McAfee might block access to certain special files." 2951 LogFile "WARNING: Check in /var/opt/NAI/LinuxShield/etc/nailsd.cfg for 'nailsd.profile.OAS.action.error: Block'" 2952 LogFile "WARNING: You have two options:" 2953 LogFile "WARNING: - Exclude all directories with special files (check McAfee System Events Log)" 2954 LogFile "WARNING: - Disable the scanner during the backup" 2752 2955 fi 2753 2956 2754 2957 # Check for ISO_CMD command 2755 2958 if [ ! -x $ISO_CMD ]; then 2756 echo "NOTE: No CD image (ISO file) utility found" >> $LOGFILE2959 LogFile "NOTE: No CD image (ISO file) utility found" 2757 2960 fi 2758 2961 … … 2788 2991 if [ $KERNEL_IS_XEN = "yes" ]; then 2789 2992 echo "$xenkernelpath" 2790 Log Only "xenkernelpath = $xenkernelpath"2993 LogFile "INFO: xenkernelpath = $xenkernelpath" 2791 2994 MindiExit 0 2792 2995 else … … 2795 2998 else 2796 2999 echo "$resk" 2797 Log Only "kernelpath = $resk"3000 LogFile "INFO: kernelpath = $resk" 2798 3001 MindiExit 0 2799 3002 fi … … 2806 3009 elif [ "$1" = "--readalllink" ] ; then 2807 3010 [ ! "$2" ] && Die "Please specify the binary to look at" 2808 shift2809 ReadAllLink $*2810 3011 # Avoids logfile content for mondo 2811 3012 export MONDO_SHARE="" 3013 ReadAllLink $2 2812 3014 MindiExit $? 2813 3015 elif [ "$1" = "--makemessage" ] ; then 2814 MakeMessageFile 3016 MakeMessageFile | cut -c1-80 2815 3017 MindiExit 0 2816 3018 elif [ "$1" = "--makemountlist" ] ; then … … 2853 3055 ### 2854 3056 if [ $KERNEL_IS_XEN = "yes" ]; then 2855 LogAll " xenkernelpath = $xenkernelpath"3057 LogAll "INFO: xenkernelpath = $xenkernelpath" 2856 3058 fi 2857 3059 kernelname=`echo $kernelpath | cut -d'-' -f2- | sed 's/.[bg]z[2]*$//'` 2858 3060 if [ ! -d "/lib/modules/$kernelname" ] 2859 3061 then 2860 LogAll " Module path for ${kernelpath} not found..."2861 LogAll " using running kernel\'s modules."3062 LogAll "WARNING: Module path for ${kernelpath} not found..." 3063 LogAll " using running kernel\'s modules." 2862 3064 kernelname=$KERVERRUN 2863 3065 else 2864 3066 LogAll "Using modules for kernel: ${kernelname}" 2865 3067 fi 2866 LogAll " kernelname = $kernelname"2867 LogAll " kernelpath = $kernelpath"3068 LogAll "INFO: kernelname = $kernelname" 3069 LogAll "INFO: kernelpath = $kernelpath" 2868 3070 ### 2869 3071 ### end of Sq-Modification … … 2881 3083 if [ "${11}" ] ; then 2882 3084 LILO_OPTIONS="" 2883 # LogAll " LILO will use conservative settings, to be compatible with older BIOSes."3085 # LogAll "INFO: LILO will use conservative settings, to be compatible with older BIOSes." 2884 3086 fi 2885 3087 ESTIMATED_TOTAL_NOOF_SLICES=${12} … … 2918 3120 LogFile "DIFFERENTIAL = $DIFFERENTIAL" 2919 3121 LogFile "INTERNAL TAPE BLOCK SIZE = $INTERNAL_TAPE_BLOCK_SIZE" 3122 if [ -f $MINDI_LIB/rootfs/bin/busybox ]; then 3123 LogIt "Mindi-`$MINDI_LIB/rootfs/bin/busybox 2>&1 | head -1`" 3124 else 3125 LogIt "ERROR: No mindi-busybox installed" 3126 fi 2920 3127 2921 3128 if [ "$PROMPT_MAKE_USB_IMAGE" = "yes" ] && [ "$USBDEVICE" != "" ]; then 2922 LogAll "I ncluding the generation of a Bootable USB device on $USBDEVICE"3129 LogAll "INFO: Including the generation of a Bootable USB device on $USBDEVICE" 2923 3130 fi 2924 3131 … … 2940 3147 fi 2941 3148 fi 2942 LogFile " Mindi's temp dir=$MINDI_TMP"2943 LogFile "M indi's output dir=$MINDI_CACHE"2944 [ "$(($RANDOM%64))" -eq "0" ] && Log All "Dude, I've looked inside your computer and it's really dusty..."3149 LogFile "INFO: Mindi's temp dir=$MINDI_TMP" 3150 LogFile "MINFO: indi's output dir=$MINDI_CACHE" 3151 [ "$(($RANDOM%64))" -eq "0" ] && LogIt "INFO: Dude, I've looked inside your computer and it's really dusty..." 2945 3152 2946 3153 PrepareDataDiskImages … … 2948 3155 export ramdisk_size=$(($size_of_all_tools+$EXTRA_SPACE)) 2949 3156 2950 LogFile " Ramdisk will be $ramdisk_size KB"3157 LogFile "INFO: Ramdisk will be $ramdisk_size KB" 2951 3158 PrepareBootDiskImage $kernelpath || Die "Failed to create $ramdisk_size MB disk image." 2952 3159 … … 2983 3190 fi 2984 3191 # cleanup 2985 LogAll " $FRIENDLY_OUTSTRING"3192 LogAll "INFO: $FRIENDLY_OUTSTRING" 2986 3193 for mtpt in $FLOPPY_WAS_MOUNTED ; do 2987 3194 mount $mtpt
Note:
See TracChangeset
for help on using the changeset viewer.