Changeset 1903 in MondoRescue for branches/stable/mindi
- Timestamp:
- Apr 10, 2008, 1:13:58 AM (16 years ago)
- Location:
- branches/stable/mindi
- Files:
-
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi/aux-tools/sbin/calc-disk-size
r911 r1903 6 6 CalcDiskSize() { 7 7 local res cylinders sectorsize disksize i curr stub out 8 res=`parted2fdisk -l $1 2> 8 res=`parted2fdisk -l $1 2>/dev/null | grep -i "cylinders of"` 9 9 cylinders=`echo "$res" | cut -d' ' -f5` 10 10 sectorsize=`echo "$res" | cut -d' ' -f7` 11 cylindermod=`parted2fdisk -l $1 2> 11 cylindermod=`parted2fdisk -l $1 2>/dev/null | grep -i $1:`; # note colon at end to make sure it's not the /dev/sda# partition info 12 12 cylnum=`echo "$cylindermod" | cut -d' ' -f7` 13 13 predisksize=$(($cylinders*$sectorsize/1024)) -
branches/stable/mindi/mindi
r1886 r1903 2715 2715 fi 2716 2716 2717 for w in cdrom floppygroovy-stuff ; do2717 for w in cdrom groovy-stuff ; do 2718 2718 mkdir -p mnt/$w 2719 2719 done … … 2760 2760 done 2761 2761 2762 [ -e "$ floppy_modules_path" ] || LogIt "path $floppy_modules_path does not exist.\n If you're not using a modular kernel then you're NUTS."2762 [ -e "$needed_modules_path" ] || LogIt "path $needed_modules_path does not exist.\n If you're not using a modular kernel then you're NUTS." 2763 2763 for i in $list_of_groovy_mods ; do 2764 2764 needed_modules="$needed_modules `FindSpecificModuleInPath $needed_modules_path $i`" … … 2779 2779 2780 2780 # Also copy modules.dep in case of udev so that normal modprobe works 2781 cp --parents -pdf /$ floppy_modules_path/modules.dep $mountpoint 2>/dev/null || LogIt "Unable to copy modules.dep to $mountpoint"2781 cp --parents -pdf /$needed_modules_path/modules.dep $mountpoint 2>/dev/null || LogIt "Unable to copy modules.dep to $mountpoint" 2782 2782 2783 2783 # For all modules supported, create symlinks under the mountpoint -
branches/stable/mindi/mindi-bkphw
r1842 r1903 15 15 my $confdir = "$ARGV[1]"; 16 16 17 die "You need dmidecode for Hardware support\n" if (! -x "/usr/sbin/dmidecode"); 18 17 19 mkdir $bkpdir,0755 if (! -d $bkpdir) ; 18 open(SYSTEM,"/usr/sbin/dmidecode -s 'system-product-name' |") || die "You need /usr/sbin/dmidecode for mindi hardware support";20 open(SYSTEM,"/usr/sbin/dmidecode -s 'system-product-name' 2> /dev/null |") || die "You need /usr/sbin/dmidecode for mindi hardware support"; 19 21 my $productname = <SYSTEM>; 20 22 close(SYSTEM); 21 23 22 die " No product name found for Hardware support\n" if (not defined $productname);24 die "ERROR: No product name found for Hardware support\n" if (not defined $productname); 23 25 24 26 chomp($productname); … … 71 73 } 72 74 if ($tool =~ /\.scexe$/) { 75 print "Found $tool, that firmware will be applied at restore time on your HP Proliant\n"; 73 76 print SCRIPT "$tool\n"; 74 77 } … … 81 84 close(SCRIPT); 82 85 } else { 83 print " No Hardware support for $productname\n";86 print "WARNING: No Hardware support for $productname\n"; 84 87 print "You may ask your manufacturer to contribute to the mindi project\n"; 85 88 } -
branches/stable/mindi/parted2fdisk.pl
r1842 r1903 277 277 if ($args =~ /^-/) { 278 278 # -l or -s 279 open (FDISK, "$fdisk $fargs |") || die "Unable to read from $fdisk";279 open (FDISK, "$fdisk $fargs 2>/dev/null |") || die "Unable to read from $fdisk"; 280 280 while (<FDISK>) { 281 281 print; … … 284 284 } else { 285 285 # Modification mode 286 open (FDISK, "| $fdisk $fargs ") || die "Unable to modify through $fdisk";286 open (FDISK, "| $fdisk $fargs 2>/dev/null") || die "Unable to modify through $fdisk"; 287 287 while (<STDIN>) { 288 288 print FDISK; … … 444 444 my $foo; 445 445 446 open (FDISK, "$fdisk -l $device |") || die "Unable to read from $fdisk";446 open (FDISK, "$fdisk -l $device 2>/dev/null |") || die "Unable to read from $fdisk"; 447 447 while (<FDISK>) { 448 448 if ($_ =~ /heads/) { … … 468 468 my $foo; 469 469 470 open (FDISK, "$fdisk -l $device |") || die "Unable to read from $fdisk";470 open (FDISK, "$fdisk -l $device 2>/dev/null |") || die "Unable to read from $fdisk"; 471 471 while (<FDISK>) { 472 472 print if (($_ !~ /^\/dev\//) and (not (defined $wpart)) and ($verbose == 1)); … … 606 606 my $type = ""; 607 607 608 open (FDISK, "$fdisk -l $device |") || die "Unable to read from $fdisk";608 open (FDISK, "$fdisk -l $device 2>/dev/null |") || die "Unable to read from $fdisk"; 609 609 while (<FDISK>) { 610 610 if ($_ =~ /EFI GPT/) { -
branches/stable/mindi/rootfs/README
r1581 r1903 6 6 which may be found at <http://www.mondorescue.org>. 7 7 8 This CD (or image)contains the tools required to do8 This media image contains the tools required to do 9 9 basic system maintenance, e.g. formatting, moving files, mounting partitions. 10 10 -
branches/stable/mindi/rootfs/sbin/find-and-mount-cdrom
r1842 r1903 25 25 fi 26 26 if [ "$res" -ne "0" ] ; then 27 28 29 30 31 32 33 34 fi35 LogIt "$device has a CD-ROM in it"36 umount /mnt/cdrom37 ln -sf $device /dev/cdrom38 if [ "$?" -ne "0" ]; then39 LogIt "Unable to softlink $device to /dev/cdrom. That's weird."40 continue41 fi27 res=`cat /tmp/mount.log` 28 if [ "$res" = "mount: No medium found" ] ; then 29 [ ! "$SECOND_TRY" ] && LogIt "There is a CD-ROM drive at $device but no CD in it." 30 else 31 [ ! "$SECOND_TRY" ] && LogIt "It's not in $device; I'll keep looking" 32 fi 33 continue 34 fi 35 LogIt "$device has a CD-ROM in it" 36 umount /mnt/cdrom 37 ln -sf $device /dev/cdrom 38 if [ "$?" -ne "0" ]; then 39 LogIt "Unable to softlink $device to /dev/cdrom. That's weird." 40 continue 41 fi 42 42 LogIt "CD-ROM found at $device" 43 mount /mnt/cdrom43 mount $device -t iso9660 -o ro /mnt/cdrom 2> /tmp/mount.log 44 44 if [ "$?" -ne "0" ] ; then 45 LogIt "Cannot mount /dev/cdrom (type $format) (dev=$device)"45 LogIt "Cannot mount /dev/cdrom (type iso9660) (dev=$device)" 46 46 continue 47 47 elif [ ! -d "/mnt/cdrom/archives" ] ; then … … 51 51 LogIt "$device is where the Mondo CD lives." 52 52 which hdparm > /dev/null 2> /dev/null && hdparm -u1 -c3 -d1 $device 53 return 054 fi53 return 0 54 fi 55 55 done 56 56 LogIt "Failed to find CD-ROM" … … 80 80 exit 0 81 81 fi 82 83 LogIt "Unable to find and mount your CD-ROM" 1 84 LogIt "You probably miss the correct driver to support your CD-ROM drive" 1 85 exit 2 -
branches/stable/mindi/rootfs/sbin/init
r1842 r1903 124 124 LogIt "$tapedev failed to act as extended data disk for booting." 1 125 125 LogIt "Please specify an alternate tape device," 1 126 LogIt "or hit <Enter> to boot from CD/floppies." 1126 LogIt "or hit <Enter> to boot from another media." 1 127 127 echo -en "---> " 128 128 read tapedev … … 140 140 if [ "$res" -ne "0" ] ; then 141 141 cd / 142 LogIt "Failed to use tape as extended datadisk. Reverting to cd." 1142 LogIt "Failed to use tape as extended datadisk. Reverting to another media." 1 143 143 HandleCDROM 144 144 res=$? … … 155 155 156 156 157 H HandleCDROM() {157 HandleCDROM() { 158 158 # Just in case we have an iLO ensure we will map it correctly 159 159 echo "$DENY_MODS" | grep -q "usb-storage " … … 186 186 LogIt "OK, I am running on a CD-ROM. Good." 3 187 187 CD_MOUNTED_OK=yes 188 elif [ "$res" -eq "1" ] ; then 189 LogIt "OK, I am running on floppies. Good." 3 190 CD_MOUNTED_OK="" 191 else 192 LogIt "OK, I am falling back to floppy mode." 3 193 LogIt "(You may not have the right drivers" 3 194 LogIt "to support the hardware on which we are running)" 3 195 LogIt "That means you'll have to copy the data disk images from" 3 196 LogIt "the CD/hard disk/whatever to physical 1.44MB disks and" 3 197 LogIt "insert them, one after the other. Please see the manual." 3 198 LogIt "The images are in /images on the CD, or /root/images/mindi" 3 199 LogIt "on your hard disk. Your archives are probably fine but" 3 200 LogIt "your tape streamer and/or CD-ROM drive are eccentric. :-)" 3 188 else 189 LogIt "You probably not have the right drivers" 3 190 LogIt "to support the hardware on which we are running" 3 191 LogIt "Your archives are probably fine but" 3 192 LogIt "your tape streamer and/or CD-ROM drive are unsupported at that point." 3 201 193 CD_MOUNTED_OK="" 202 194 fi … … 316 308 # Depending on udevd version it gives back the hand or not :-( 317 309 /sbin/udevd --daemon & 318 sleep 2310 sleep 5 319 311 mkdir -p /dev/.udev/queue/ 320 312 if [ -x /sbin/udevtrigger ]; then … … 619 611 mount -o remount rw / 620 612 [ ! "$GROOVY" ] && Die "I'm not groovy!" 621 for i in $GROOVY /mnt/ floppy /mnt/cdrom /mnt/isodir /var/local/petris /tmp/isodir; do613 for i in $GROOVY /mnt/cdrom /mnt/isodir /var/local/petris /tmp/isodir; do 622 614 mkdir -p $i 623 615 done … … 781 773 else 782 774 LogIt "backup-media-type is not specified in config file." 783 LogIt "I think this CD/floppyhas no archives on it."775 LogIt "I think this media has no archives on it." 784 776 fi 785 777 if grep "RESTORE" /proc/cmdline > /dev/null 2> /dev/null ; then -
branches/stable/mindi/rootfs/sbin/untar
r1770 r1903 14 14 # ---------------------- main ---------------------- 15 15 16 mountpoint=/ mnt/floppy16 mountpoint=/dev/null 17 17 [ -e "/tmp/CDROM-LIVES-HERE" ] && mountpoint=/mnt/cdrom/images 18 18 [ "$#" -eq "2" ] || Die "untar <tarball> <untar_to>" … … 22 22 if [ -e "/tmp/CDROM-LIVES-HERE" ] ; then 23 23 [ -e "$tarball" ] || LogIt "Can't find CD's $tarball" 1 24 else25 while [ ! -f "$tarball" ] ; do26 echo -e -n "Please insert data (floppy) disk #$diskno and press ENTER."27 read line28 mount /dev/fd0 -t ext2 -o ro $mountpoint29 [ -f "$tarball" ] || umount $mountpoint ; # unmount if tarball not on disk30 echo -en "Working..."31 done32 24 fi 33 25
Note:
See TracChangeset
for help on using the changeset viewer.