Changeset 1770 in MondoRescue for branches/stable/mindi
- Timestamp:
- Nov 6, 2007, 11:01:53 AM (16 years ago)
- Location:
- branches/stable/mindi
- Files:
-
- 1 deleted
- 12 edited
- 5 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi/ChangeLog
r1681 r1770 3 3 MINDI CHANGES 4 4 5 1.2.5(2007-10-11)5 2.0.0 (2007-10-11) 6 6 - Build process adapted to use pb http://trac.project-builder.org (Bruno Cornec) 7 7 - Really Fix #163 support for 3w-9xxx 3w_9xxx (Bruno Cornec) -
branches/stable/mindi/README.bkphw
r1469 r1770 11 11 Mindi expects to find those tools under /usr/local/bin as described in the deplist.d/proliant.conf configuration file. Here are the steps to set it up correctly: 12 12 13 Older URL: 14 wget ftp://ftp.compaq.com/pub/softlib2/software1/pubsw-linux/p308169895/v40154/ss-scripting-toolkit-linux-1.70.tar.gz 15 13 16 cd /tmp 14 wget ftp://ftp. compaq.com/pub/softlib2/software1/pubsw-linux/p308169895/v40154/ss-scripting-toolkit-linux-1.70.tar.gz17 wget ftp://ftp.hp.com/pub/softlib2/software1/pubsw-linux/p308169895/v43548/ss-scripting-toolkit-linux-1.81.tar.gz 15 18 mkdir ssstk 16 19 cd ssstk 17 tar xvfz ../ss-scripting-toolkit-linux-1. 70.tar.gz20 tar xvfz ../ss-scripting-toolkit-linux-1.81.tar.gz 18 21 cp -a utilities/hponcfg /usr/local/bin 19 22 cp -a utilities/conrep /usr/local/bin … … 34 37 35 38 2007-05-30 Initial file 39 >>>>>>> .fusion-droit.r1769 -
branches/stable/mindi/README.proliant
r1529 r1770 1 $Id$ 2 1 3 If you're making a backup with mondoarchive on a Proliant system that you want to be able to restore using the Virtual Media function of Proliants, then you have to ensure that the required drivers will be available at restore time. 2 4 In order to ensure that, you may want to do on 2.2.x versions: -
branches/stable/mindi/deplist.txt
r1591 r1770 28 28 mount 29 29 devfsd burnBX burnK6 burnK7 burnMMX burnP5 burnP6 lucifer tiobench tiotest bonnie++ mprime ide-smart 30 # helps for debugging 31 /usr/bin/ldd 32 /usr/bin/strace 33 34 # For file command 35 /usr/share/misc/file/magic /usr/share/file/magic 36 37 # For swap uuid support and probably then more in the future 38 /usr/bin/perl 30 39 31 40 # For Debug mode -
branches/stable/mindi/install.sh
r1693 r1770 121 121 chmod 755 $locallib/mindi/rootfs/sbin/* 122 122 chmod 755 $locallib/mindi/aux-tools/sbin/* 123 124 # Substitute variables for init 125 perl -pi -e "s~^MINDI_VER=VVV~MINDI_VER=$MINDIVER~ ; s~^MINDI_REV=RRR~MINDI_REV=$MINDIREV~" $locallib/mindi/rootfs/sbin/init 123 install -m 755 analyze-my-lvm $locallib/mindi 124 install -m 644 isolinux.cfg msg-txt sys-disk.raw.gz isolinux-H.cfg syslinux.cfg syslinux-H.cfg dev.tgz $locallib/mindi 125 install -m 644 deplist.txt udev.files proliant.files $conf 126 126 127 127 # Substitute variables for mindi 128 sed -e "s~^MINDI_PREFIX=XXX~MINDI_PREFIX=$sublocal~" -e "s~^MINDI_CONF=YYY~MINDI_CONF=$subconf~" -e "s~^MINDI_VER=VVV~MINDI_VER=$MINDIVER~" -e "s~^MINDI_REV=RRR~MINDI_REV=$MINDIREV~" -e "s~^MINDI_LIB=LLL~MINDI_LIB=$sublocallib~" mindi > $local/sbin/mindi 128 sed -e "s~^MINDI_PREFIX=XXX~MINDI_PREFIX=$sublocal~" -e "s~^MINDI_CONF=YYY~MINDI_CONF=$subconf~" -e "s~^MINDI_LIB=LLL~MINDI_LIB=$sublocallib~" mindi > $local/sbin/mindi 129 sed -e "s~= "YYY"~= "$subconf"~" mindi-bkphw > $local/sbin/mindi-bkphw 129 130 sed -e "s~^my \$mindiconf=YYY~my \$mindiconf=\"$subconf\";~" mindi-bkphw > $local/sbin/mindi-bkphw 130 131 chmod 755 $local/sbin/mindi $local/sbin/mindi-bkphw 131 132 install -m 755 parted2fdisk.pl $local/sbin 132 install -m 755 analyze-my-lvm $locallib/mindi133 133 134 134 install -m 644 mindi.8 $MANDIR -
branches/stable/mindi/mindi
r1693 r1770 416 416 dd if=/dev/zero of=$imagefile bs=1k count=1440 &> /dev/null || LogIt "Cannot dd (CODI)" 417 417 echo "Creating ext2 filesystem on $imagefile" >> $LOGFILE 418 mke2fs -N 12 -F $imagefile &> /dev/null|| Die "Unable to create an ext2 file system on $imagefile"418 mke2fs -N 12 -F $imagefile >> $LOGFILE 2>> $LOGFILE || Die "Unable to create an ext2 file system on $imagefile" 419 419 mount -t ext2 -o loop $imagefile $mountpoint || Die "Can't loopmount $imagefile to $mountpoint! The reason may be missing support for loopfs or ext2 (or both) in the running kernel." 420 420 mv $tarball $mountpoint/ … … 511 511 [ ! -e "$KEYDIR" ] && KEYDIR=/usr/lib/kbd 512 512 [ ! -e "$KEYDIR" ] && KEYDIR=/usr/share 513 [ ! -e "$KEYDIR" ] && KEYDIR=/etc/condole 514 [ ! -e "$KEYDIR" ] && KEYDIR=/etc/condole-setup 513 515 if [ ! -e "$KEYDIR" ] ; then 514 516 LogIt "Keyboard mapping directory not found. I shall use default map at boot-time." … … 532 534 mkdir -p $bigdir/etc/console 533 535 cp /etc/console/boottime.kmap.gz $bigdir/etc/console 2>> $LOGFILE 536 echo -e "$DONE" 537 return 0 538 elif [ -e "/etc/console-setup/boottime.kmap.gz" ] ; then 539 echo "Ubuntu-style config detected." >> $LOGFILE 540 echo -en "Adding the following keyboard mapping tables: " 541 mkdir -p $bigdir/tmp 542 echo "/etc/console-setup/boottime.kmap.gz" > $bigdir/tmp/KEYMAP-LIVES-HERE 543 KBDEPTH=0 544 mkdir -p $bigdir/etc/console-setup 545 cp /etc/console-setup/boottime.kmap.gz $bigdir/etc/console-setup 2>> $LOGFILE 534 546 echo -e "$DONE" 535 547 return 0 … … 860 872 local lcMagicCramfs="<3>cramfs: wrong magic" 861 873 local lcMagicExt2fs="<3>EXT2-fs: blocksize too small for device." 862 local lcMagicInitfs="<6>checking if image is initramfs... "874 local lcMagicInitfs="<6>checking if image is initramfs...|<6>Unpacking initramfs..." 863 875 864 876 # local variables … … 874 886 875 887 # Kernel may be gzip compressed 876 file $lvKernelImage 2>&1 | grep -q 888 file $lvKernelImage 2>&1 | grep -q gzip 877 889 if [ $? -eq 0 ]; then 878 lvScanRes=`gzip -cd $lvKernelImage | strings | grep - e "$lcMagicCramfs" -e "$lcMagicExt2fs" -e "$lcMagicInitfs"`890 lvScanRes=`gzip -cd $lvKernelImage | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicInitfs"` 879 891 else 880 892 # get offet of gzip magic "1f8b0800" in file … … 885 897 886 898 # scan kernel image for initrd filessystem support 887 lvScanRes=`dd ibs=1 skip=$lvOffset if=$lvKernelImage obs=1M 2>/dev/null | gunzip -c 2> /dev/null | strings | grep - e "$lcMagicCramfs" -e "$lcMagicExt2fs" -e "$lcMagicInitfs"`899 lvScanRes=`dd ibs=1 skip=$lvOffset if=$lvKernelImage obs=1M 2>/dev/null | gunzip -c 2> /dev/null | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicInitfs"` 888 900 fi 889 901 890 902 # determine which filesystem to use for initrd image: ext2fs, gzip'ed cpio (initramfs ) or cramfs 891 if [ `echo $lvScanRes | grep - c "$lcMagicExt2fs"` -eq 1 ]; then903 if [ `echo $lvScanRes | grep -Ec "$lcMagicExt2fs"` -eq 1 ]; then 892 904 lvUseFilesystem="ext2fs" 893 elif [ `echo $lvScanRes | grep - c "$lcMagicInitfs"` -eq 1 ]; then905 elif [ `echo $lvScanRes | grep -Ec "$lcMagicInitfs"` -eq 1 ]; then 894 906 lvUseFilesystem="initramfs" 895 elif [ `echo $lvScanRes | grep - c "$lcMagicCramfs"` -eq 1 ]; then907 elif [ `echo $lvScanRes | grep -Ec "$lcMagicCramfs"` -eq 1 ]; then 896 908 lvUseFilesystem="cramfs" 897 909 else … … 942 954 local res currline partition all_partitions ap_orig remaining i j 943 955 944 grep -vx " *#.*" $MY_FSTAB | grep -vx " *none.*" | $AWK '/^\/dev\/[imhs]d||^LABEL \=\/|^UUID=/ && !/fdd|cdr|zip|floppy/ {print $1}'956 grep -vx " *#.*" $MY_FSTAB | grep -vx " *none.*" | $AWK '/^\/dev\/[imhs]d||^LABEL=\/|^UUID=/ && !/fdd|cdr|zip|floppy/ {print $1}' 945 957 [ -e "/etc/raidtab" ] && $AWK '/^ *device/ {print $2}' /etc/raidtab 946 958 return … … 966 978 for i in $DENY_MODS; do 967 979 module_list=`echo ${module_list} | tr ' ' '\n' | grep -Ev "^${i}$" | tr '\n' ' '` 980 EXTRA_MODS=`echo ${EXTRA_MODS} | tr ' ' '\n' | grep -Ev "^${i}$" | tr '\n' ' '` 968 981 done 969 982 ### … … 993 1006 LocateDeps() { 994 1007 local incoming fname deps 995 incoming="$ 1"1008 incoming="$*" 996 1009 for fname in $incoming ; do 997 1010 if [ ! -e "$fname" ] ; then … … 1106 1119 1107 1120 echo -en "for outerloop in 1 2 3 4 5 ; do\necho -en \".\"\n" >> $outfile 1108 # BERLIOS: That code is duplicated - Should be done once only1109 1121 list_to_echo="$MODULES" 1110 1122 # Remove unwanted modules from list 1111 1123 for i in $DENY_MODS; do 1112 1124 list_to_echo=`echo ${list_to_echo} | tr ' ' '\n' | grep -Ev "^${i}$" | tr '\n' ' '` 1125 EXTRA_MODS=`echo ${EXTRA_MODS} | tr ' ' '\n' | grep -Ev "^${i}$" | tr '\n' ' '` 1113 1126 done 1114 1127 … … 1120 1133 infile="/etc/modules.conf" 1121 1134 fi 1135 1122 1136 for module in $list_to_echo $EXTRA_MODS ; do 1123 1137 params=`sed -n "s/^options \\+$module \\+//p" $infile` … … 1184 1198 done 1185 1199 [ "$IMAGE_DEVS" != "" ] && all_partitions="`echo "$all_partitions $IMAGE_DEVS" | tr ' ' '\n' | sort -u | tr '\n ' ' '`" 1186 printf " %-15s %-15s %-15s %-15s %-15s %-15s\n" DEVICE MOUNTPOINT FORMAT "SIZE (MB)" LABELUUID | tee -a $LOGFILE1200 printf " %-15s %-15s %-15s %-15s %-15s\n" DEVICE MOUNTPOINT FORMAT "SIZE (MB)" LABEL/UUID | tee -a $LOGFILE 1187 1201 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" 1188 1202 for c_p in $all_partitions ; do … … 1436 1450 fi 1437 1451 fi 1452 if [ "$redhat_label" ]; then 1453 label="$redhat_label" 1454 elif [ "$uuid" ]; then 1455 label="$uuid" 1456 fi 1438 1457 partition_format="`echo "$partition_format" | cut -d',' -f1`"; # in case user has ext3,ext2 or something dumb like that 1439 1458 [ "$partition_format" = "auto" ] && partition_format="`mount | grep -w $current_partition | $AWK '{print$5;}'`"; # in case user uses 'auto' (dumb!) 1440 unofficial_outstring=`printf "\t%-15s %-15s %-15s %7s %-15s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$redhat_label" $uuid`1459 unofficial_outstring=`printf "\t%-15s %-15s %-15s %7s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$label"` 1441 1460 if [ "$current_partition" = "" ] ; then 1442 1461 echo "Unknown partition (outstring = $unofficial_outstring)" >> $LOGFILE … … 1445 1464 partition_mountpt=raid 1446 1465 partition_format=raid 1447 printf "\t%-15s %-15s %-15s %7s %-15s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$redhat_label" $uuid| tee -a $LOGFILE1448 printf "%s %s %s %s %s %s\n" $current_partition $partition_mountpt $partition_format $partition_size "$ redhat_label" $uuid>> $mountlist1466 printf "\t%-15s %-15s %-15s %7s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$label" | tee -a $LOGFILE 1467 printf "%s %s %s %s %s %s\n" $current_partition $partition_mountpt $partition_format $partition_size "$label" >> $mountlist 1449 1468 else 1450 1469 echo "Unknown mountpoint (outstring = $unofficial_outstring)" >> $LOGFILE … … 1461 1480 partition_format="vfat" 1462 1481 fi 1463 printf "\t%-15s %-15s %-15s %7s %-15s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$redhat_label" $uuid| tee -a $LOGFILE1464 printf "%s %s %s %s %s %s\n" $current_partition $partition_mountpt $partition_format $partition_size "$redhat_label" $uuid>> $mountlist1482 printf "\t%-15s %-15s %-15s %7s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$label" | tee -a $LOGFILE 1483 printf "%s %s %s %s %s\n" $current_partition $partition_mountpt $partition_format $partition_size "$label" >> $mountlist 1465 1484 fi 1466 1485 done … … 1608 1627 local i old_pwd 1609 1628 if [ "$PROMPT_MAKE_USB_IMAGE" = "yes" ] && [ _"$MONDO_SHARE" = _"" ]; then 1610 echo "Shall I make a bootable USB image ?" 1611 echo -en "WARNING: This will erase all content on $USBDEVICE (y/[n]) " 1629 echo "Shall I make a bootable USB image ? (y/[n] " 1612 1630 read i 1613 1631 [ "$i" != "y" ] && [ "$i" != "Y" ] && return 0 1632 if [ "$USBDEVICE" = "" ]; then 1633 echo -en "Please enter the device name of your USB device (e.g. /dev/sda) : " 1634 read dev 1635 USBDEVICE=$dev 1636 fi 1637 echo "WARNING: This will erase all content on $USBDEVICE" 1638 echo -en "Are you sure you want to use $USBDEVICE (y/[n]) " 1614 1639 fi 1615 1640 if [ _"$MINDI_TMP" = _"" ]; then … … 1632 1657 echo -en "." 1633 1658 echo "Unmounting $USBDEVICE just in case" >> $LOGFILE 1634 umount $USB DEVICE 2>&1>> $LOGFILE1659 umount $USBPART 2>> $LOGFILE 1>> $LOGFILE 1635 1660 echo "Erasing $USBDEVICE" >> $LOGFILE 1636 $FDISK $USBDEVICE 2> &1>> $LOGFILE << EOF1661 $FDISK $USBDEVICE 2>> $LOGFILE 1>> $LOGFILE << EOF 1637 1662 d 1638 1663 d … … 1688 1713 cp -f $j $k 2> /dev/null || Die "Failed to copy $j to $k" 1689 1714 cp -f $j $MINDI_TMP 2> /dev/null || Die "Failed to copy $j to $MINDI_TMP" 1690 if [ _"$MONDO_SHARE" != _"" ]; then1691 cp -f $j $MONDO_ROOT 2>> $LOGFILE || Die "Failed to copy $j to $MONDO_ROOT"1692 fi1693 1715 fi 1694 1716 done … … 1708 1730 cd $old_pwd 1709 1731 echo -en "." 1732 umount $MINDI_TMP/usb 1710 1733 if [ "$ARCH" != "ia64" ] ; then 1711 if [ _"$MONDO_SHARE" != _"" ]; then1712 cp -f $MONDO_SHARE/autorun $MONDO_ROOT 2>> $LOGFILE1713 fi1714 umount $MINDI_TMP/usb1715 1734 syslinux $USBPART 2>> $MINDI_TMP/syslinux.log 1716 1735 if [ "$?" -ne "0" ] ; then … … 1725 1744 else 1726 1745 echo "No USB boot support for ia64" | tee -a $LOGFILE 1727 umount $MINDI_TMP/usb1728 1746 MindiExit -1 1729 1747 fi … … 1878 1896 mountefi=1 1879 1897 fi 1880 cp /boot/efi/elilo.efi $mountpoint 1898 el=`find /boot/efi -name elilo.efi` 1899 cp $el $mountpoint 1881 1900 cp $liloconf $mountpoint/elilo.efi $mountpoint/efi/boot 1882 1901 if [ $mountefi -eq 1 ]; then … … 2197 2216 incoming=`echo "$incoming" | awk '{if (match($1,/\//)) {print $1} else {if (match($3,/\//)) print $3} fi}'` 2198 2217 for f in $incoming ; do 2199 echo "$f `ReadAllLink $f`" 2218 echo "$f" 2219 echo "`ReadAllLink $f`" 2200 2220 done 2201 2221 read incoming … … 2546 2566 echo -en "..." 2547 2567 echo "Creating ext2 filesystem on $tempfile" >> $LOGFILE 2548 mke2fs -b 1024 -m 1 -i 2048 -F $tempfile &> /dev/null|| Die "Unable to create an ext2 file system on $tempfile"2568 mke2fs -b 1024 -m 1 -i 2048 -F $tempfile >> $LOGFILE 2>> $LOGFILE || Die "Unable to create an ext2 file system on $tempfile" 2549 2569 echo -en "..." 2550 2570 mkdir -p $mountpoint … … 2569 2589 mkdir -p tmp 2570 2590 [ -e "/dev/.devfsd" ] && echo "/dev/.devfsd found" > tmp/USE-DEVFS 2591 2592 # Management of udev (which includes modprobe in rules) 2593 ps auxww | grep -v grep | grep -qw udevd 2594 if [ $? -eq 0 ]; then 2595 echo "udev device manager found" > tmp/USE-UDEV 2596 LogIt "udev device manager found" 2597 cp --parents -Rdf /etc/udev . 2> /dev/null 2598 cp --parents -Rdf /lib/udev /lib64/udev . 2> /dev/null 2599 if [ -x /sbin/udevd ]; then 2600 lis=`grep -Ev '^#' $MINDI_CONF/udev.files` 2601 LocateDeps $lis > $MINDI_TMP/udev.lis 2602 for i in $lis; do 2603 if [ "`echo $i | cut -c1`" = "/" ]; then 2604 j=`echo $i | cut -c2-` 2605 rm -f $j 2606 fi 2607 done 2608 cp --parents -Rdf $lis `sort -u $MINDI_TMP/udev.lis` . 2609 rm -f $MINDI_TMP/udev.lis 2610 else 2611 echo "udevd daemon not in standard place (/sbin)" 2>&1 | tee -a $LOGFILE 2612 echo "mindi will use static devices which may cause problems" 2>&1 | tee -a $LOGFILE 2613 rm -f tmp/USE-UDEV 2614 fi 2615 fi 2616 # Management of potential HW info (Proliant only at the moment) 2617 mindi-bkphw $MINDI_CACHE $MINDI_CONF | tee -a $LOGFILE 2618 if [ -d $MINDI_CACHE/bkphw ]; then 2619 LogIt "Hardware Information found and saved ..." 2620 cp -rp $MINDI_CACHE/bkphw . 2621 lis=`grep -Ev '^#' $MINDI_CACHE/tools.files` 2622 LocateDeps $lis > $MINDI_TMP/tools.lis 2623 cp --parents -Rdf $lis `sort -u $MINDI_TMP/tools.lis` . 2624 if [ -f $MINDI_CACHE/mindi-rsthw ]; then 2625 mv -f $MINDI_CACHE/mindi-rsthw . 2626 chmod 755 ./mindi-rsthw 2627 fi 2628 rm -f $MINDI_TMP/tools.lis $MINDI_CACHE/tools.files 2629 fi 2630 2571 2631 for w in cdrom floppy groovy-stuff ; do 2572 2632 mkdir -p mnt/$w … … 2580 2640 2581 2641 cp --parents -Rdf /dev/fd0*[1,2][4,7,8]* . 2> /dev/null 2642 2643 # Handle the case where busybox is dynamically linked 2644 file $MINDI_LIB/rootfs/bin/busybox 2>&1 | grep -q "dynamically" 2645 if [ $? -eq 0 ]; then 2646 LocateDeps $MINDI_LIB/rootfs/bin/busybox > $MINDI_TMP/busy.lis 2647 cp --parents -Rdf `sort -u $MINDI_TMP/busy.lis` . 2648 rm -f $MINDI_TMP/busy.lis 2649 fi 2582 2650 cd $old_pwd 2583 2651 echo -en "..." … … 2604 2672 list_of_groovy_mods="$list_of_groovy_mods $NET_MODS" 2605 2673 fi 2606 [ -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." 2674 if [ "$PROMPT_MAKE_USB_IMAGE" = "yes" ] && [ "$USBDEVICE" != "" ]; then 2675 list_of_groovy_mods="$list_of_groovy_mods $EXTRA_MODS" 2676 fi 2677 for i in $DENY_MODS; do 2678 echo "Removing $i from the list of modules to load" >> $LOGFILE 2679 list_of_groovy_mods=`echo ${list_of_groovy_mods} | tr ' ' '\n' | grep -Ev "^${i}$" | tr '\n' ' '` 2680 done 2681 2682 [ -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." 2607 2683 for i in $list_of_groovy_mods ; do 2608 2684 needed_modules="$needed_modules `FindSpecificModuleInPath $needed_modules_path $i`" … … 2612 2688 [ "$YOUR_KERNEL_SUCKS" ] && i=$MINDI_TMP/$i 2613 2689 echo "Adding $i ($s KB) to the rootfs" >> $LOGFILE 2614 cp -df $i $mountpoint/ 2>/dev/null || LogIt "Unable to copy $i to $mountpoint" 2690 cp --parents -pdf $i $mountpoint 2>/dev/null || LogIt "Unable to copy $i to $mountpoint" 2691 if [ "`echo "$i" | grep -F ".gz"`" ]; then 2692 gunzip -f $mountpoint/$i 2693 i=`echo $i | sed 's/.gz//'` 2694 fi 2695 (cd $mountpoint ; ln -s $i . 2>/dev/null) 2615 2696 [ "`echo "$i" | grep -F ".gz"`" ] && gunzip -f $mountpoint/`basename $i` 2616 2697 done 2698 # Also copy modules.dep in case of udev so that normal modprobe works 2699 p=`echo $i | cut -d/ -f1-3` 2700 cp -df $p/modules.dep $mountpoint/$p 2>/dev/null || LogIt "Unable to copy modules.dep to $mountpoint" 2617 2701 if [ ! -e "/sbin/devfsd" ] || [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] ; then 2618 2702 echo "Deleting devfsd daemon from ramdisk" >> $LOGFILE … … 2830 2914 fi 2831 2915 2832 if ! which mkfs.vfat &> /dev/null ; then2916 if ! which mkfs.vfat 1> /dev/null 2> /dev/null ; then 2833 2917 Die "mkfs.vfat missing from your filesystem - please install your dosfstools RPM or DEB package. Perhaps your PATH environmental variable is broken, too?" 2834 2918 fi … … 2918 3002 echo "-------------" >> $LOGFILE 2919 3003 /usr/sbin/esxcfg-module -l >> $LOGFILE 2920 MODULES="$MODULES ` esxcfg-module -l | awk '{print $1}'`"3004 MODULES="$MODULES `/usr/sbin/esxcfg-module -l | awk '{print $1}'`" 2921 3005 fi 2922 3006 echo "-------------" >> $LOGFILE … … 2925 3009 echo "-------------" >> $LOGFILE 2926 3010 3011 # Compute libata version 3012 laver=`modinfo libata | grep -Ei '^Version:' | cut -d: -f2 | cut -d. -f1 | sed 's/ *//g'` 3013 # If libata v2 is used then remove ide-generic as it will perturbate boot 3014 if [ "`echo $MODULES | grep libata`" ]; then 3015 if [ "$laver" = "2" ]; then 3016 DENY_MODS="$DENY_MODS ide-generic" 3017 echo "ide-generic removed from module list as your system uses libata v2+" >> $LOGFILE 3018 echo "-------------" >> $LOGFILE 3019 fi 3020 fi 2927 3021 2928 3022 FLOPPY_WAS_MOUNTED="" … … 2982 3076 MindiExit 0 2983 3077 fi 3078 elif [ "$1" = "--locatedeps" ] ; then 3079 [ ! "$2" ] && Die "Please specify the binary to look at" 3080 LocateDeps $2 3081 # Avoids logfile content for mondo 3082 export MONDO_SHARE="" 3083 MindiExit $? 2984 3084 elif [ "$1" = "--makemountlist" ] ; then 2985 3085 [ ! "$2" ] && Die "Please specify the output file" … … 3004 3104 export MINDI_TMP=$MONDO_TMP 3005 3105 mkdir -p $MINDI_TMP 3006 # This is the scratch dir in mondo 3106 # This is the scratch dir in mondo - subdir images 3007 3107 MINDI_CACHE=$3 3008 3108 if [ _"$MINDI_CACHE" != _"" ]; then … … 3050 3150 fi 3051 3151 [ "$CDRECOVERY" = "yes" ] && [ "$PROMPT_MAKE_TAPE_IMAGE" = "yes" ] && Die "Sorry, you can't use --cd-recovery and --write-tapes at the same time" 3152 # MONDO_ROOT is the real scratchdir 3052 3153 MONDO_ROOT=`echo $MINDI_CACHE | sed 's/\(.*\)\/.*/\1/'` 3053 3154 if [ _"$MONDO_ROOT" != _"" ]; then … … 3208 3309 Die "Cannot find all.tar.gz, to be written to tape" 3209 3310 fi 3210 elif [ "$PROMPT_MAKE_USB_IMAGE" = "yes" ] ; then3311 elif [ "$PROMPT_MAKE_USB_IMAGE" = "yes" ] && [ "$USBDEVICE" != "" ]; then 3211 3312 OfferToMakeBootableUSB $MINDI_CACHE 3212 3313 else -
branches/stable/mindi/mindi-bkphw
r1469 r1770 5 5 # 6 6 use strict; 7 use AppConfig;8 7 use File::Basename; 9 8 10 9 # Handling Configuration files 11 my $mindiconf=YYY 12 my $file1 = "$mindiconf/mindi.conf.dist"; 13 my $file2 = "$mindiconf/mindi.conf"; 10 die "No CACHE_DIR parameter" if ((not defined $ARGV[0]) || (! -d $ARGV[0])); 11 my $bkpdir = "$ARGV[0]/bkphw"; 12 die "No CONF_DIR parameter" if ((not defined $ARGV[1]) || (! -d $ARGV[1])); 13 my $confdir = "$ARGV[1]"; 14 14 15 my $tool = ""; 15 16 my $tooldir = ""; 16 17 my $ret = 0; 17 18 18 my $config = AppConfig->new({ 19 # Auto Create variables mentioned in Conf file 20 CREATE => 1, 21 DEBUG => 0, 22 GLOBAL => { 23 # Each conf item has one single parameter 24 ARGCOUNT => AppConfig::ARGCOUNT_ONE, 25 DEFAULT => '<undef>' 26 } 27 }); 28 $config->file($file1, $file2); 29 19 mkdir $bkpdir,0755 if (! -d $bkpdir) ; 30 20 open(SYSTEM,"dmidecode -s 'system-product-name' |") || die "You need dmidecode for mindi hardware support"; 31 21 my $productname = <SYSTEM>; … … 36 26 print "Detected an HP Hardware. Nice. Continue to support my job :-)\n"; 37 27 print "Activating Proliant support for mindi\n"; 38 open(PROLIANT,"$mindiconf/deplist.d/proliant.conf") || die "Unable to open $mindiconf/deplist.d/proliant.conf"; 28 open(PROLIANT,"$confdir/proliant.files") || die "Unable to open $confdir/proliant.files"; 29 open(TOOLS,"> $bkpdir/../tools.files") || die "Unable to open $bkpdir/../tools.files"; 30 open(SCRIPT,"> $bkpdir/../mindi-rsthw") || die "Unable to open $bkpdir/../mindi-rsthw"; 31 print SCRIPT << "EOF"; 32 #!/bin/bash 33 # 34 # This script will restore potentially your HW configuration 35 # on your system before partioning occurs 36 # You may want to reboot after that step if you think that 37 # resetting BIOS parameters to the value restored 38 # may have an impact on you restoration process 39 # 40 EOF 39 41 while($tool = <PROLIANT>) { 40 42 next if ($tool =~ /^#/); … … 47 49 } else { 48 50 print "Found $tool, activating enhanced HP Proliant support in mindi\n"; 51 print TOOLS "$tool\n"; 49 52 } 50 if ($tool =~ /conrep/) { 51 $ret = system("(cd $tooldir ; $tool -s -f".$config->get("mindi_cache_dir")."/conrep.dat)"); 53 if ($tool =~ /\/conrep$/) { 54 $ret = system("(cd $tooldir ; $tool -s -f$bkpdir/conrep.dat)"); 55 print SCRIPT "(cd $tooldir ; $tool -s -f$bkpdir/conrep.dat)"); 56 print TOOLS "$tool.xml\n"; 52 57 } 53 if ($tool =~ /cpqacuxe/) { 54 $ret = system("$tool -c ".$config->get("mindi_cache_dir")."/cpqacuxe.dat"); 58 if ($tool =~ /\/cpqacuxe$/) { 59 $ret = system("$tool -c $bkpdir/cpqacuxe.dat"); 60 print SCRIPT "$tool -r $bkpdir/cpqacuxe.dat"); 61 print TOOLS "$tooldir/bld\n"; 55 62 } 56 if ($tool =~ /hponcfg/) { 57 $ret = system("$tool -w ".$config->get("mindi_cache_dir")."/hponcfg.dat"); 63 if ($tool =~ /\/hponcfg$/) { 64 $ret = system("$tool -w $bkpdir/hponcfg.dat"); 65 print SCRIPT "$tool -r $bkpdir/hponcfg.dat"); 66 } 67 if ($tool =~ /\.scexe$/) { 68 print SCRIPT "$tool"); 58 69 } 59 70 if ($ret != 0) { … … 61 72 } 62 73 } 74 close(PROLIANT); 75 close(TOOLS); 76 close(SCRIPT); 63 77 } else { 64 78 print "No Hardware support for $productname\n"; 65 79 print "Ask your manufacturer to contribute to the mindi project\n"; 66 80 } 81 rmdir $bkpdir if (-d $bkpdir) ; -
branches/stable/mindi/rootfs/etc/group
r1061 r1770 10 10 wheel::10:root 11 11 floppy::11:root 12 mail::12:mail 13 news::13:news 14 uucp::14:uucp 15 man::15:man 16 cdrom::24: 17 tape::26: 18 plugdev::46: 19 audio::81: 20 users::100:games 21 scanner::105: 22 nvram::105: 23 fuse::106: 12 24 nogroup::65534: -
branches/stable/mindi/rootfs/sbin/find-and-mount-cdrom
r1581 r1770 4 4 TryToFindCDROM() { 5 5 # hda1 is there for testing 6 7 8 9 if [ "`grep "using-cdstream=yes" /tmp/mondo-restore.cfg`" ]; then10 11 12 13 14 15 6 LogIt "find-and-mount-cdrom --- starting" 7 for device in /dev/hd? /dev/scd? /dev/rcd? /dev/sr? /dev/cd? /dev/ide/*/*/*/*/cd /dev/scsi/*/*/*/*/cd; do 8 [ ! "$SECOND_TRY" ] && LogIt "Trying $device" 9 if [ "`grep "using-cdstream yes" /tmp/mondo-restore.cfg`" ]; then 10 pwd=`pwd` 11 cd $GROOVY 12 tar -zxf $device 2> /tmp/mount.log 13 res=$? 14 cd $pwd 15 if [ "$res" -eq "0" ] ; then 16 16 clear 17 18 echo "Using cdstrea mas extd dsk." > /tmp/TAPEDEV-HAS-DATA-DISKS19 20 21 22 23 24 25 17 LogIt "Using cdstream as extended datadisk ($device). Good." 3 18 echo "Using cdstrea as extd dsk." > /tmp/TAPEDEV-HAS-DATA-DISKS 19 ln -sf $device /dev/cdrom 20 exit 0 21 fi 22 else 23 mount $device -t iso9660 -o ro /mnt/cdrom 2> /tmp/mount.log 24 res=$? 25 fi 26 26 if [ "$res" -ne "0" ] ; then 27 27 res=`cat /tmp/mount.log` … … 37 37 ln -sf $device /dev/cdrom 38 38 if [ "$?" -ne "0" ]; then 39 40 39 LogIt "Unable to softlink $device to /dev/cdrom. That's weird." 40 continue 41 41 fi 42 42 LogIt "CD-ROM found at $device" 43 43 mount /mnt/cdrom 44 45 46 47 48 49 50 51 52 53 44 if [ "$?" -ne "0" ] ; then 45 LogIt "Cannot mount /dev/cdrom (type $format) (dev=$device)" 46 continue 47 elif [ ! -d "/mnt/cdrom/archives" ] ; then 48 LogIt "There is a CD in $device but it's not a Mondo CD" 49 continue 50 else 51 LogIt "$device is where the Mondo CD lives." 52 which hdparm > /dev/null 2> /dev/null && hdparm -u1 -c3 -d1 $device 53 return 0 54 54 fi 55 56 57 55 done 56 LogIt "Failed to find CD-ROM" 57 return 1 58 58 } 59 59 … … 63 63 [ "$1" = "--second-try" ] && SECOND_TRY=yes 64 64 if [ ! "$GROOVY" ] ; then 65 66 65 LogIt "I'm not groovy!" 66 exit 1 67 67 fi 68 68 69 69 TryToFindCDROM 70 70 if [ "$?" -eq "0" ] ; then 71 72 73 74 75 71 [ "$SECOND_TRY" ] && add="At 2nd attempt, " || add="" 72 LogIt $add"CD-ROM found and mounted at $device" 3 73 echo "$device" > /tmp/CDROM-LIVES-HERE 74 LogIt "find-and-mount-cdrom --- leaving (0)" 75 exit 0 76 76 fi 77 77 [ "$1" = "--second-try" ] && exit 1; 78 78 if [ "`grep "using-cdstream=yes" /tmp/mondo-restore.cfg`" ] ; then 79 80 79 LogIt "Because you are using cdstream, I won't try to mount CD." 80 exit 0 81 81 fi -
branches/stable/mindi/rootfs/sbin/init
r1675 r1770 8 8 9 9 CaughtSoftReset() { 10 11 10 trap SIGTERM 11 reboot 12 12 } 13 13 14 14 15 15 ConfigureLoggingDaemons() { 16 17 18 19 20 21 16 echo -en "Running klogd..." 17 klogd -c 2 > /dev/null 2> /dev/null 18 echo -en "Done.\nRunning syslogd..." 19 syslogd > /dev/null 2> /dev/null 20 echo "Done." 21 LogIt "klogd and syslogd have been started." 22 22 } 23 23 … … 25 25 26 26 CopyBootDevEntry() { 27 28 29 30 31 32 27 local outfile devfile 28 devfile=/dev/boot_device 29 outfile=`cat /BOOTLOADER.DEVICE 2> /dev/null` 30 [ ! "$outfile" ] && return 0 31 echo -en "Copying boot device to $outfile..." 32 if [ -e "$outfile" ] ; then 33 33 echo "OK." 34 34 return 0 35 36 37 38 39 35 fi 36 mkdir -p $outfile 37 rmdir $outfile 38 cp -pRdf $devfile $outfile 39 if [ "$?" -ne "0" ] ; then 40 40 echo "Failed." 41 41 return 1 42 42 else 43 43 echo "OK." 44 44 return 0 45 45 fi 46 46 } 47 47 … … 49 49 50 50 Die() { 51 52 51 LogIt "Fatal error! $1" 1 52 exit 1 53 53 } 54 54 … … 56 56 57 57 ExtractDevTarballs() { 58 59 60 61 62 63 64 65 66 67 68 58 cd / 59 for fname in ataraid.tgz ida.tgz i2o.tgz rd.tgz raw.tgz cciss.tgz nst.tgz dm.tgz vc.tgz ; do 60 if [ ! -e "/$fname" ] ; then 61 LogIt "/$fname not found; cannot extract to /." 1 62 else 63 echo -en "\rExtracting /$fname... " 64 tar -zxf /$fname || LogIt "Error occurred while extracting /$fname" 65 fi 66 done 67 echo -en "\r" 68 LogIt "Extracted additional /dev entries OK. " 1 69 69 } 70 70 … … 72 72 73 73 LaunchTerminals() { 74 75 76 77 78 79 74 openvt 2 /bin/sh 75 openvt 3 /bin/sh 76 openvt 4 /bin/sh 77 openvt 5 /bin/sh 78 openvt 6 /bin/sh 79 openvt 7 /bin/sh /sbin/wait-for-petris 80 80 } 81 81 82 82 83 83 LoadKeymap() { 84 85 86 87 88 84 local fname 85 fname=`grep keymap-lives-here /tmp/mondo-restore.cfg | cut -d'=' -f2 2> /dev/null` 86 [ "$fname" = "" ] && return 87 if which loadkeys > /dev/null 2> /dev/null ; then 88 loadkeys $fname 89 89 # loadkmap != loadkeys 90 90 # elif which loadkmap > /dev/null 2> /dev/null ; then 91 91 # loadkmap < $fname 92 93 94 92 else 93 LogIt "Using default keyboard map." 1 94 fi 95 95 } 96 96 97 97 98 98 UntarTapeStuff() { 99 100 101 102 103 [ ! "$tapedev" ] && tapedev=`grep media-dev /tmp/mondo-restore.cfg | tr -s ' ' ' ' | cut -d'=' -f2`99 local old_pwd res 100 old_pwd=`pwd` 101 cd $GROOVY 102 [ "$1" != "" ] && tapedev=$1 103 [ ! "$tapedev" ] && tapedev=`grep media-dev /tmp/mondo-restore.cfg | tr -s ' ' ' ' | cut -d' ' -f2` 104 104 # tar -zxf $tapedev 105 106 107 105 dd if=$tapedev bs=32k count=1024 | tar -zx 106 res=$? 107 if [ "$res" -eq "0" ] ; then 108 108 grep -v media-dev /tmp/mondo-restore.cfg > /tmp/mr.cfg 109 109 echo "media-dev=$tapedev" >> /tmp/mr.cfg 110 111 112 113 110 cp -f /tmp/mr.cfg /tmp/mondo-restore.cfg 111 fi 112 cd $old_pwd 113 return $res 114 114 } 115 115 116 116 HandleTape() { 117 118 119 120 121 122 123 124 125 LogIt "or hit <Enter> to boot from CD." 1126 127 128 129 130 131 132 133 134 117 local res tapedev 118 tapedev="" ; # will be set by UntarTapeStuff() 119 cd $GROOVY 120 UntarTapeStuff $tapedev || UntarTapeStuff /dev/st0 || UntarTapeStuff /dev/osst0 || UntarTapeStuff /dev/ht0 121 res=$? 122 while [ "$res" -ne "0" ] ; do 123 LogIt "$tapedev failed to act as extended data disk for booting." 1 124 LogIt "Please specify an alternate tape device," 1 125 LogIt "or hit <Enter> to boot from CD/floppies." 1 126 echo -en "---> " 127 read tapedev 128 if [ "$tapedev" ] ; then 129 LogIt "User specified $tapedev instead" 130 UntarTapeStuff $tapedev 131 res=$? 132 else 133 LogIt "User opted not to specify an alternate tapedev" 134 res=1 135 135 break 136 137 138 139 136 fi 137 done 138 139 if [ "$res" -ne "0" ] ; then 140 140 cd / 141 141 LogIt "Failed to use tape as extended datadisk. Reverting to cd." 1 142 142 HandleCDROM 143 143 res=$? 144 144 else 145 145 # clear 146 146 LogIt "Using tape as extended datadisk. Good." 3 147 147 echo "Using tape as extd ddisk." > /tmp/TAPEDEV-HAS-DATA-DISKS 148 148 res=0 149 150 151 149 CD_MOUNTED_OK=yes 150 fi 151 return $res 152 152 } 153 153 … … 155 155 156 156 HHandleCDROM() { 157 158 159 157 find-and-mount-cdrom 158 res=$? 159 if [ "$res" -ne "0" ] ; then 160 160 LogIt "First call to find-and-mount-cdrom failed." 1 161 161 LogIt "Sleeping for 3 seconds and trying again." 1 … … 163 163 find-and-mount-cdrom 164 164 res=$? 165 166 165 fi 166 if [ "$res" -eq "0" ] ; then 167 167 LogIt "OK, I am running on a CD-ROM. Good." 3 168 CD_MOUNTED_OK=yes 169 else 168 CD_MOUNTED_OK=yes 169 elif [ "$res" -eq "1" ] ; then 170 LogIt "OK, I am running on floppies. Good." 3 171 CD_MOUNTED_OK="" 172 else 170 173 LogIt "OK, I am unable to go on. You seem to be missing a driver" 3 171 174 LogIt "Your archives are probably fine but" 3 172 175 LogIt "your tape streamer and/or CD-ROM drive are eccentric. :-)" 3 173 176 CD_MOUNTED_OK="" 174 175 177 fi 178 return 0 176 179 } 177 180 … … 186 189 # Load the VIA IDE module first thing if it exists (requires ide-core). 187 190 # This is to ensure that DMA is working for VIA chipsets with 2.6 kernels. 188 189 190 191 for module in /ide-core.ko /via82cxxx.ko; do 192 [ -f "$module" ] && MyInsmod $module > /dev/null 2> /dev/null 193 done 191 194 # Then load the remaining modules in normal (i.e. arbitrary) order. 192 193 194 195 196 195 for j in 1 2 3 4 5 ; do 196 for i in `ls /*.*o* 2> /dev/null` ; do 197 [ -f "$i" ] && MyInsmod $i > /dev/null 2> /dev/null 198 done 199 done 197 200 } 198 201 … … 200 203 201 204 PauseForRaids() { 202 203 204 205 206 207 208 209 210 205 if [ "`dmesg | grep -i "RAID Controller"`" != "" ] || [ "`dmesg | grep -i "Vendor: 3ware"`" != "" ] ; then 206 LogIt "RAID controller(s) detected. Pausing 10 seconds to let them warm up." 1 207 echo -en "Pausing..." 208 for i in 1 2 3 4 5 6 7 8 9 10 ; do 209 sleep 1 210 echo -en "$(($i*10))%..." 211 done 212 echo "Done." 213 fi 211 214 } 212 215 … … 217 220 # config file path compiled into devfsd 218 221 RunDevfsd() { 219 220 222 loc=`which devfsd 2> /dev/null` 223 if [ "$loc" != "" ] ; then 221 224 LogIt "Devfs found. Testing kernel support..." 222 225 if [ ! -e "/dev/.devfsd" ] ; then 223 226 mount -t devfs devfs /dev 2>> $LOGFILE 224 227 if [ "$?" -ne "0" ] ; then 225 228 LogIt "Error while trying to mount devfs" 226 229 else … … 242 245 LogIt "No devfs kernel support." 243 246 fi 244 fi 245 } 246 247 248 249 247 fi 248 } 249 250 # Taken from udev management in Mandriva 2008.0. Kudos guys 251 make_extra_nodes () { 252 # there are a few things that sysfs does not export for us. 253 # these things are listed in /etc/udev/links.conf 254 grep '^[^#]' /etc/udev-links.conf | \ 255 while read type name arg1; do 256 [ "$type" -a "$name" -a ! -e "/dev/$name" -a ! -L "/dev/$name" ] ||continue 257 case "$type" in 258 L) ln -s $arg1 /dev/$name ;; 259 D) mkdir -p /dev/$name ;; 260 M) mknod /dev/$name $arg1 && chmod 600 /dev/$name;; 261 *) echo "udev-links.conf: unparseable line (%s %s %s)\n" "$type" "$name" "$arg1" ;; 262 esac 263 done 264 } 265 266 267 RunUdevd() { 268 # Inspiration from Mandriva 2008.0 startup script 269 echo "Preparing udev environment..." 270 mv /dev /dev.static 271 mkdir /dev 272 mount -n -o size=5M,mode=0755 -t tmpfs none /dev 273 make_extra_nodes 274 mount -n -t devpts -o mode=620 none /dev/pts 275 mount -n -t tmpfs none /dev/shm 276 PKLVL=`cut -f1 /proc/sys/kernel/printk` 277 echo 0 > /proc/sys/kernel/printk 278 if [ -x /sbin/startudev ]; then 279 /sbin/startudev 280 fi 281 # Depending on udevd version it gives back the hand or not :-( 282 /sbin/udevd --daemon & 283 sleep 2 284 echo $PKLVL > /proc/sys/kernel/printk 285 # May avoid shell error messages 286 chmod 644 /dev/tty* 287 } 288 289 RstHW() { 290 291 # Restore the HW configuration if available (NOT by default) 292 answer="NO" 293 294 if [ -x ./mindi-rsthw ]; then 295 grep -q RESTORE /proc/cmdline 296 if [ "$?" -ne 0 ]; then 297 clear 298 echo "*********************************************************************" 299 echo "Do you want to restore the HW configuration of the original machine ?" 300 echo "(This may dammage your hardware so be sure to check twice before saying yes)" 301 echo "*********************************************************************" 302 echo "Please confirm by typing YES exactly as written here (NO by default)" 303 echo -n "--> " 304 read answer 305 else 306 answer="YES" 307 fi 308 if [ "$answer" -eq "YES" ] ; then 309 ./mindi-rsthw 310 fi 311 fi 312 } 250 313 251 314 … … 262 325 263 326 SpaceTests() { 264 265 266 267 LogIt "Please re-run Mondo/Mindi but editmindi first" 1268 269 270 271 327 [ -e "/tmp/filelist.full" ] && cp /tmp/filelist.full /tmp/FLF 328 if [ "`HowMuchFreeSpaceOnRamdisk`" -le "3" ] ; then 329 LogIt "Ramdisk is a bit smaller than I would like." 1 330 LogIt "Please re-run Mondo/Mindi but edit /usr/local/mindi first" 1 331 LogIt "and set EXTRA_SPACE to something high, e.g. 8000" 1 332 Die "Aborting. Please reboot." 333 fi 334 rm -f /tmp/FLF 272 335 } 273 336 … … 275 338 276 339 StartLvms() { 277 278 340 if [ -e "/tmp/i-want-my-lvm" ] ; then 341 LogIt "Scanning LVM's..." 1 279 342 if which lvm ; then 280 343 MyInsmod dm-mod … … 284 347 vgscan 285 348 fi 286 287 288 289 290 349 grep -E "^#.*vgchange" /tmp/i-want-my-lvm | sed "s/^#[ ]*//" > /tmp/start-lvm 350 chmod +x /tmp/start-lvm 351 echo -en "Starting LVM's..." 352 /tmp/start-lvm & 353 for i in 1 2 3 4 5 ; do 291 354 echo -en "." 292 355 sleep 1 293 294 295 356 done 357 echo "Done." 358 fi 296 359 # If necessary, cannibalize 'analyze-my-lvm'; copy some of its code here, 297 360 # pipe vgscan's output, strip it, run 'vgchange' on its output, etc.etc. 298 361 LogIt "LVM's have been started." 299 362 } 300 363 301 364 302 365 StartRaids() { 303 304 305 366 local raid_devices i 367 368 raid_devices=`grep /dev/md /tmp/mountlist.txt | cut -d' ' -f1` 306 369 if which raidstart > /dev/null 2> /dev/null ; then 307 308 309 310 370 for i in $raid_devices ; do 371 if grep `basename $i` /proc/mdstat > /dev/null 2> /dev/null ; then 372 LogIt "$i is started already; no need to run 'raidstart $i'" 1 373 else 311 374 LogIt "Running 'raidstart $i'" 1 312 375 raidstart $i 313 314 376 fi 377 done 315 378 elif which mdrun > /dev/null 2> /dev/null ; then 316 379 LogIt "Running 'mdrun'" 1 … … 319 382 LogIt "Running 'mdadm'" 1 320 383 for i in $raid_devices ; do 321 322 323 384 if grep `basename $i` /proc/mdstat > /dev/null 2> /dev/null ; then 385 LogIt "$i is started already; no need to run 'mdadm $i'" 1 386 else 324 387 if [ -f /etc/mdadm.conf ] ; then 325 388 LogIt "Running 'mdadm $i' with user supplied /etc/mdadm.conf" 1 … … 332 395 mdadm -Ac partitions -m dev $i 333 396 fi 334 335 397 fi 398 done 336 399 else 337 400 LogIt "Warning: Neither 'raidstart' nor 'mdrun''found. RAID devices may not have started." 1 … … 342 405 343 406 TryAgainToFindCD() { 344 345 346 347 348 349 350 351 352 353 354 355 407 local res 408 mount | grep /mnt/cdrom && return 0 409 [ "`grep "backup_media_type" /tmp/mondo-restore.cfg | grep "cdstream"`" ] && return 410 LogIt "Trying to mount CD-ROM a 2nd time..." 411 find-and-mount-cdrom --second-try 412 res=$? 413 if [ "$res" -eq "0" ] ; then 414 CD_MOUNTED_OK=yes 415 LogIt "CD-ROM drive mounted successfully." 1 416 else 417 LogIt "I still cannot find or mount the CD-ROM drive, by the way." 418 fi 356 419 } 357 420 … … 360 423 UseTmpfs() 361 424 { 362 363 364 425 local mount_cmd 426 echo -en "Mounting /tmp/tmpfs..." 427 mkdir -p /tmp/tmpfs 365 428 # For technical reasons, some sets are as large as 16MB. 366 429 # I am allowing 32MB because selective restore occupies a lot of space. 367 368 369 430 for size in 64m 48m 40m 32m ; do 431 mount_cmd="mount /dev/shm -t tmpfs -o size=$size" ; # was 34m until 04/2003 432 LogIt "Trying '$mount_cmd'" 370 433 $mount_cmd /tmp/tmpfs 2>> $LOGFILE 371 434 res=$? 372 435 [ "$res" -eq "0" ] && break 373 374 375 376 436 done 437 if [ "$res" -ne "0" ] ; then 438 LogIt "Failed. I could not run '$mount_cmd /tmp/tmpfs'. Your kernel is BROKEN or you do not have enough RAM." 1 439 umount /tmp/tmpfs > /dev/null 2> /dev/null 377 440 rmdir /tmp/tmpfs 378 441 ln -sf /mnt/RESTORING/tmp /tmp/tmpfs; # used by mondo-restore 379 442 LogIt "Failed to mount /tmp/tmpfs; using ugly softlink instead" 380 else 381 LogIt "Great. Pivot succeeded w/ size=$size" 1 382 echo -en "Pivoting /tmp..." 383 umount /tmp/tmpfs 384 mkdir -p /tmp.old 385 mv -f /tmp/* /tmp.old/ 386 $mount_cmd /tmp 387 mv /tmp.old/* /tmp/ 388 rmdir /tmp.old 389 mkdir -p /tmp/tmpfs 390 mkdir -p $GROOVY 443 else 444 LogIt "Great. Pivot succeeded w/ size=$size" 1 445 echo -en "Pivoting /tmp..." 446 umount /tmp/tmpfs 447 mkdir -p /tmp.old 448 mv /tmp/* /tmp.old/ 449 # Try to Deal with a busybox bug on inexistant links 450 cp /tmp/* /tmp.old/ 451 rm -f /tmp/* 452 $mount_cmd /tmp 453 mv /tmp.old/* /tmp/ 454 # Try to Deal with a busybox bug on inexistant links 455 cp /tmp.old/* /tmp/ 456 rm -rf /tmp.old 457 mkdir -p /tmp/tmpfs 458 mkdir -p $GROOVY 391 459 echo "Done." 392 460 LogIt "Successfully mounted dynamic /tmp ramdisk" … … 394 462 # mv -f /var/log /tmp/tmpfs/var/log 395 463 # ln -sf /tmp/tmpfs/var/log /var/log 396 464 fi 397 465 } 398 466 … … 400 468 WelcomeMessage() 401 469 { 402 403 404 470 echo "********************************************************************" 471 echo "MINDI-LINUX by Mondo Dev Team - web site: http://www.mondorescue.org" 472 echo "Boot disk based on AlfaLinux & Trinux. BusyBox by Erik Andersen." 405 473 which petris > /dev/null 2> /dev/null && echo "Petris was written by Peter Seidler <p.seidler@mail1.stofanet.dk>." 406 407 408 474 echo "Executables and source code are covered by the GNU GPL. No warranty." 475 echo "running on $ARCH" 476 echo "********************************************************************" 409 477 } 410 478 411 479 412 480 EnableCcissIfAppropriate() { 413 414 481 local i fname 482 for i in 0 1 2 3 4 5 6 7 8 9 ; do 415 483 fname="/proc/driver/cciss/cciss$i" 416 484 if [ -e "$fname" ] ; then … … 419 487 LogIt "...result=$?" 420 488 fi 421 489 done 422 490 } 423 491 … … 427 495 install-additional-tools 428 496 echo "Inserting modules ..." 497 # Keep the kernel silent again 498 PKLVL=`cut -f1 /proc/sys/kernel/printk` 499 echo 0 > /proc/sys/kernel/printk 429 500 insert-all-my-modules >> $LOGFILE 2>> $LOGFILE 501 echo $PKLVL > /proc/sys/kernel/printk 430 502 } 431 503 432 504 # ------------------------ main ----------------------- 433 505 434 MINDI_VER= VVV435 MINDI_REV= RRR506 MINDI_VER=PBVER 507 MINDI_REV=PBREV 436 508 trap CaughtSoftReset SIGTERM 437 509 LOGFILE=/var/log/mondorestore.log … … 446 518 [ ! "$GROOVY" ] && Die "I'm not groovy!" 447 519 for i in $GROOVY /mnt/floppy /mnt/cdrom /mnt/isodir /var/local/petris /tmp/isodir; do 448 520 mkdir -p $i 449 521 done 450 522 #/bin/update … … 454 526 rm -f /foozero 455 527 456 echo 0 > /proc/sys/kernel/exec-shield 2>> /dev/null 457 458 ExtractDevTarballs 528 if [ -f /proc/sys/kernel/exec-shield ]; then 529 echo 0 > /proc/sys/kernel/exec-shield 2>> /dev/null 530 fi 531 532 if [ -f /proc/modules ]; then 533 echo "/sbin/modprobe" > /proc/sys/kernel/modprobe 534 fi 535 536 if [ -e "/tmp/USE-UDEV" ] ; then 537 RunUdevd 538 else 539 ExtractDevTarballs 540 fi 459 541 LaunchTerminals 542 543 # Keeping kernel silent for module insertion 544 PKLVL=`cut -f1 /proc/sys/kernel/printk` 545 echo 0 > /proc/sys/kernel/printk 460 546 InsertEssentialModules 547 echo $PKLVL > /proc/sys/kernel/printk 548 461 549 EnableCcissIfAppropriate 550 RstHW 462 551 #------------------------------- 463 552 #WHOLIVESINAPINEAPPLEUNDERTHESEA#;# --- don't touch this :) … … 465 554 UseTmpfs 466 555 if [ ! -e "/tmp/mondo-restore.cfg" ] ; then 467 468 fi 469 470 if [ "`grep -i 'tape ' /tmp/mondo-restore.cfg`" ] || [ "`grep -i udev /tmp/mondo-restore.cfg`" ] 471 556 LogIt "Warning - /tmp/mondo-restore.cfg not found" 557 fi 558 559 if [ "`grep -i 'tape ' /tmp/mondo-restore.cfg`" ] || [ "`grep -i udev /tmp/mondo-restore.cfg`" ]; then 560 HandleTape 472 561 ExtractDataDisksAndLoadModules 473 562 elif [ "`grep -i pxe /proc/cmdline`" ]; then 474 563 # We need to get here exported variables from start-nfs 475 564 . /sbin/start-nfs 476 565 477 566 # Simulate a local CD 478 567 echo "/mnt/cdrom" > /tmp/CDROM-LIVES-HERE 479 CD_MOUNTED_OK=yes 568 CD_MOUNTED_OK=yes 569 ExtractDataDisksAndLoadModules 570 elif [ "`grep -i usb= /proc/cmdline`" ] || [ "`grep -i usb /tmp/mondo-restore.cfg | grep media-type`" ]; then 571 # We need to get here exported variables from start-nfs 572 . /sbin/start-usb 573 574 # Simulate a local CD 575 echo "/mnt/cdrom" > /tmp/CDROM-LIVES-HERE 576 CD_MOUNTED_OK=yes 480 577 ExtractDataDisksAndLoadModules 481 578 else … … 483 580 ExtractDataDisksAndLoadModules 484 581 # We need to get here exported variables from start-nfs 485 582 . /sbin/start-nfs 486 583 fi 487 584 res=$? 488 585 ConfigureLoggingDaemons 489 586 if [ -e "/tmp/USE-DEVFS" ] ; then 490 491 492 493 587 umount /mnt/cdrom 2> /dev/null 588 mv /dev/cdrom /cdrom.lnk 2> /dev/null 589 CD_MOUNTED_OK="" 590 RunDevfsd 494 591 fi 495 592 echo "Starting potential Raid/LVMs ..." … … 503 600 #clear 504 601 if [ -e "/dev/md0" ] && [ ! -e "/dev/md/0" ] && [ "`grep /dev/md/ /tmp/mountlist.txt`" != "" ] ; then 505 506 507 508 509 602 LogIt "Creating /dev/md/* softlinks just in case." 1 603 mkdir -p /dev/md 604 cp -af /dev/md0 /dev/md/0 2> /dev/null 605 cp -af /dev/md1 /dev/md/1 2> /dev/null 606 cp -af /dev/md2 /dev/md/2 2> /dev/null 510 607 fi 511 608 export ARCH=`uname -m` … … 550 647 #ctrlaltdel soft 551 648 for path in /usr.bin /usr/bin ; do 552 553 649 fname=$path/nano 650 [ -e "$fname" ] && ln -sf $fname /usr/bin/pico 554 651 done 555 652 res=`which nano 2> /dev/null` 556 653 [ "$res" ] && ln -sf /usr/bin/ 557 654 for i in null stdout stdin stderr ; do 558 655 cp -af /dev/$i /tmp 559 656 done 560 657 if grep "backup-media-type" /tmp/mondo-restore.cfg > /dev/null 2> /dev/null ; then 561 562 563 658 LogIt "backup-media-type is specified in config file - great." 659 LogIt "Calling post-init $mountlist" 660 post-init 564 661 else 565 566 LogIt "I think this mediahas no archives on it."662 LogIt "backup-media-type is not specified in config file." 663 LogIt "I think this CD/floppy has no archives on it." 567 664 fi 568 665 if grep "RESTORE" /proc/cmdline > /dev/null 2> /dev/null ; then -
branches/stable/mindi/rootfs/sbin/install-additional-tools
r1339 r1770 19 19 LogIt "Starting install-additional-tools" 20 20 mountdir=$GROOVY 21 # Should be the same as in mindi => conf param 22 MAX_DISKS=99 21 23 mkdir -p $mountdir 22 24 diskno=1 … … 25 27 LogIt "I am assuming the data disks' contents are already in $mountdir." 26 28 else 27 while [ "$diskno" -lt " 20" ] ; do28 LogIt "PLEASE WAIT. Untarring and softlinkingdisk #$diskno" 229 untar -and-softlink $diskno $mountdir /29 while [ "$diskno" -lt "$MAX_DISKS" ] ; do 30 LogIt "PLEASE WAIT. Untarring disk #$diskno" 2 31 untar $diskno $mountdir 30 32 res=$(($res+$?)) 31 33 [ -e "/LAST-DISK" ] && diskno=999 … … 36 38 rm -f /LAST-DISK 37 39 38 echo -e -n "Recombining large files..." 40 LogIt "Recombining large files..." 1 39 41 biggienumber=0 40 42 while [ -e "$mountdir/slice-$biggienumber.name" ] ; do 41 43 stub=$mountdir/slice-$biggienumber 42 44 biggiefname=`cat $stub.name` 45 if [ -f $biggiefname ]; then 46 LogIt "$biggiefname already exists - skipped" 1 47 biggienumber=$(($biggienumber+1)) 48 continue 49 fi 43 50 biggiefsize=`cat $stub.size` 44 51 rm -f $stub.name $stub.size … … 56 63 done 57 64 58 echo "$biggiefname ($biggiefsize KB) restored. $sliceno slices." >> $LOGFILE65 LogIt "$biggiefname ($biggiefsize KB) restored. $sliceno slices." 1 59 66 60 67 mkdir -p $biggiefname … … 64 71 rm -f /tmp/out.dat 65 72 biggienumber=$(($biggienumber+1)) 66 echo -e -n "."67 73 done 68 echo -en "Done. \r"69 74 rm -f /slice* 70 75 71 LogIt "Resolving softlinks" 72 echo -en "Finalizing softlinks..." 76 LogIt "Populating / with tar file content..." 1 73 77 74 78 cd $mountdir 75 for path in `find | grep -v /etc/fstab` ; do 76 if [ -d "$path" ] ; then 77 mkdir /$path 2> /dev/null 78 else 79 # Patch from Andrew Bulhak 80 if [ -h "/$path" ] ; then 81 # echo "removing symlink /$path" 82 rm -f /$path 83 fi 84 # end patch 85 mv -f $path /$path 86 fi 87 done 88 cp -f etc/fstab /tmp/fstab 89 tar cf - sbin bin usr/bin usr/sbin lib usr/lib lib64 usr/lib64 | (cd / ; tar xf -) 79 if [ -f etc/fstab ]; then 80 mv etc/fstab /tmp 81 fi 82 if [ -f etc/raidtab ]; then 83 mv etc/raidtab /tmp 84 fi 90 85 86 liste=`ls` 87 if [ "$liste" ]; then 88 tar cf - $liste | (cd / ; tar xf -) 89 rm -fr $liste 90 fi 91 91 cd / 92 93 for i in modprobe lsmod depmod rmmod ; do94 [ -e "$mountdir/sbin/$i" ] && ln -sf $mountdir/sbin/$i /sbin/$i95 done96 92 97 93 sync;sync;sync 98 94 99 echo "Done." 100 101 for j in io.sys msdos.sys embleer.B.bz2 embleer.C.bz2 ; do 102 [ -e "$mountdir/$j" ] && ln -sf $mountdir/$j /$j 103 done 104 [ -e "$mountdir/etc/fstab" ] && ln -sf $mountdir/etc/fstab /tmp/fstab 105 [ -e "$mountdir/etc/raidtab" ] && ln -sf $mountdir/etc/raidtab /tmp/raidtab 95 LogIt "Done." 1 106 96 107 97 which gawk 2> /dev/null > /dev/null -
branches/stable/mindi/rootfs/sbin/start-nfs
r1312 r1770 35 35 done 36 36 37 if [ $ipdev = "" ] && [ $ipconf= "" ]; then37 if [ "$ipdev" = "" ] && [ "$ipconf" = "" ]; then 38 38 # No network configuration neither stored during archive 39 39 # nor on cmdline so no network wanted => exiting … … 49 49 if [ $? -eq 0 ]; then 50 50 ipdev=`echo $ipconf | cut -d: -f1` 51 echo"Making DHCP request on $ipdev"51 LogIt "Making DHCP request on $ipdev" 52 52 udhcpc -i $ipdev 53 53 else … … 59 59 ipgateway=`echo $ipconf | cut -d: -f5` 60 60 fi 61 echo"Configuring $ipdev statically ($ipaddress/$ipnetmask)"61 LogIt "Configuring $ipdev statically ($ipaddress/$ipnetmask)" 62 62 ifconfig $ipdev $ipaddress netmask $ipnetmask broadcast $ipbroadcast 63 63 route add default gw $ipgateway
Note:
See TracChangeset
for help on using the changeset viewer.