Changeset 1043 in MondoRescue for trunk/mindi
- Timestamp:
- Jan 8, 2007, 11:31:22 PM (18 years ago)
- Location:
- trunk/mindi
- Files:
-
- 4 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/mindi/ChangeLog
r903 r1043 2 2 3 3 MINDI CHANGES 4 5 1.2.1 (2006-12-23) 6 - mindi now supports a configuration file (Bruno Cornec) 7 - Fix again support for LABEL on swap partitions (Bruno Cornec) 8 - mindi now prints mindi-busybox version (Bruno Cornec) 9 - mindi now supports gzip compression format (#113) (Bruno Cornec) 10 - Inline code of some useless functions for readability (Bruno Cornec) 11 - Add support for nvidia and ahci drivers (Bruno Cornec) 12 - Remove wrong full path name for cut (Matija Nalis/Bruno Cornec) 13 - UUID support (Bruno Cornec) 14 - Cleaner messages generated on screen (with defaults) and in logs (Bruno Cornec) 15 - First use of a configuration file with mindi to permit variable to be overwritten (Bruno Cornec) 16 - All temporary files are now under MINDI_TMP, unique dir under /tmp by default and not removed when called by mondo (Bruno Cornec) 17 - All generated files are now under CACHE_LOC, /var/cache/mindi by default (Bruno Cornec) 18 - Fix bug #100 where the temporary dir could be removed and be /home (Matija Nalis/Bruno Cornec) 19 - Should now work correctly under x86_64 distributions (Bruno Cornec) 20 - Fix a blocking bug in mindi where a " was misplaced (Bruno Cornec) 21 - New MindiExit function called everywhere (Bruno Cornec) 22 - TAG is now per package (Bruno Cornec) 23 - Add CentOS build support (Andy Wright/Bruno Cornec) 24 - Removal of grep -w|-x during restore as not supported by busybox fixes bug #101 (Alfred Chua/Bruno Cornec) 25 - init now reports the mindi version when executed (Bruno Cornec) 4 26 5 27 1.2.0 (2006-10-04) -
trunk/mindi/distributions/debian/rules
r939 r1043 26 26 dh_installdirs 27 27 # Build the installation tree: 28 ( export RPMBUILDMINDI=true && export HEAD=$(CURDIR)/debian/$(PACKAGE_NAME) && export PREFIX=/usr && export CONFDIR=/etc && export MANDIR=$(PREFIX)/share/man && &&export LIBDIR=$(PREFIX)/lib && export DOCDIR=$(PREFIX)/share/doc && ./install.sh )28 ( export RPMBUILDMINDI=true && export HEAD=$(CURDIR)/debian/$(PACKAGE_NAME) && export PREFIX=/usr && export CONFDIR=/etc && export MANDIR=$(PREFIX)/share/man && export LIBDIR=$(PREFIX)/lib && export DOCDIR=$(PREFIX)/share/doc && ./install.sh ) 29 29 30 30 # Build architecture-independent files here. -
trunk/mindi/mindi
r979 r1043 93 93 TAPE_MODS="ht st osst ide-tape ide_tape" 94 94 SCSI_MODS="3w-xxxx 53c7,8xx a100u2w a320raid aacraid advansys aha152x aha1542 aha1740 aic79xx aic79xx_mod aic7xxx aic7xxx_mod aic7xxx_old AM53C974 atp870u BusLogic cciss cpqfc 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 isp megaraid mptbase mptscsih NCR53c406a ncr53c8xx nsp32 pas16 pci2000 pci2220i pcmcia ppa psi240i qla1280 qla2200 qla2300 qlogicfas qlogicfc qlogicisp raw1394 scsi_debug scsi_mod sd_mod seagate sg sim710 sr_mod sym53c416 sym53c8xx sym53c8xx_2 t128 tmscsim u14-34f ultrastor wd7000 vmhgfs" 95 IDE_MODS="ide ide-generic ide-detect ide-mod ide-disk ide-cd ide_cd ide-cs ide-core ide_core libata edd paride ata_piix libata via82cxxx generic "95 IDE_MODS="ide ide-generic ide-detect ide-mod ide-disk ide-cd ide_cd ide-cs ide-core ide_core libata edd paride ata_piix libata via82cxxx generic nvidia ahci" 96 96 PCMCIA_MODS="pcmcia_core ds yenta_socket" 97 97 USB_MODS="usb-storage usb-ohci usb-uhci usbcore usb_storage hid uhci_hcd ehci_hcd uhci-hcd ehci-hcd usbkbd usbhid" 98 98 CDROM_MODS="$TAPE_MODS $FLOPPY_MODS $IDE_MODS af_packet cdrom isocd isofs inflate_fs nls_iso8859-1 nls_cp437 sg sr_mod zlib_inflate $USB_MODS $PCMCIA_MODS" 99 NET_MODS="sunrpc nfs nfs_acl lockd loop mii 3c59x e100 bcm5700 bnx2 e1000 eepro100 ne2k-pci tg3 pcnet32 8139cp 8139too 8390 vmxnet" 100 EXTRA_MODS="$CDROM_MODS vfat fat loop md-mod linear raid0 raid1 xor raid5 lvm-mod dm-mod jfs xfs xfs_support pagebuf reiserfs ext2 ext3 minix nfs nfs_acl nfsd lockd sunrpc jbd" 99 NET_MODS="sunrpc nfs nfs_acl lockd loop mii 3c59x e100 bcm5700 bnx2 e1000 eepro100 ne2k-pci tg3 pcnet32 8139cp 8139too 8390 vmxnet vmnet" 100 NET_MODS="sunrpc nfs nfs_acl lockd loop mii 3c59x e100 bcm5700 bnx2 e1000 eepro100 ne2k-pci tg3 pcnet32 8139cp 8139too 8390 vmxnet vmnet" 101 EXTRA_MODS="$CDROM_MODS vfat fat loop md-mod linear raid0 raid1 xor raid5 lvm-mod dm-mod dm-snapshot dm-zero dm-mirror jfs xfs xfs_support pagebuf reiserfs ext2 ext3 minix nfs nfs_acl nfsd lockd sunrpc jbd mbcache" 101 102 102 103 BOOT_MEDIA_MESSAGE="$mindi_boot_msg" … … 139 140 echo -en "label memtest\n kernel memdisk\n append initrd=memtest.img\n\n" 140 141 fi 141 }142 143 144 AbortIfYourDistroIsAPieceOfStercus() {145 which which > /dev/null 2> /dev/null || Die "Please install 'which'."146 which strings > /dev/null 2> /dev/null || Die "Please install binutils and libbinutils; you have no 'strings' executable."147 which gawk > /dev/null 2> /dev/null || Die "Gawk is missing from your computer. Please install gawk. You may find the package on Debian's website. How did I know you're running Debian? Because only Debian would be stupid enough not to include gawk in your distribution."148 which gawk > /dev/null 2> /dev/null && AWK=`which gawk 2>/dev/null` || AWK="`which awk 2>/dev/null`"149 if which awk &> /dev/null ; then150 if ! which gawk &> /dev/null ; then151 LogIt "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"152 fi153 fi154 which mke2fs > /dev/null 2> /dev/null || Die "Please put mke2fs in system path"155 [ ! -e "$FDISK" ] && Die "Cannot find (s)fdisk"156 }157 158 159 AbortIfMkfsVfatMissing() {160 #if grep -F "vfat" /etc/fstab &> /dev/null ; then161 if ! which mkfs.vfat &> /dev/null ; then162 Die "mkfs.vfat missing from your filesystem - please install your dosfstools RPM or DEB package. Perhaps your PATH environmental variable is broken, too?"163 fi164 #fi165 142 } 166 143 … … 610 587 611 588 612 FindHomeOfMindiAndMondo() {613 [ "$MINDI_PREFIX" = "XXX" ] && Die "Mindi has not been installed correctly."614 echo "MINDI_LIB = $MINDI_LIB" >> $LOGFILE615 echo "MINDI_SBIN = $MINDI_SBIN" >> $LOGFILE616 [ "$MINDI_CONF" = "YYY" ] && Die "Mindi has not been installed correctly."617 echo "MINDI_CONF = $MINDI_CONF" >> $LOGFILE618 echo "MONDO_SHARE = $MONDO_SHARE" >> $LOGFILE619 }620 621 622 589 FindIsolinuxBinary() { 623 590 ISOLINUX=/usr/lib/isolinux.bin … … 642 609 else 643 610 LILO_EXE=`which false` 644 fi645 }646 647 648 FindELiloBinary() {649 if which elilo &> /dev/null ; then650 LILO_EXE=elilo651 else652 LILO_EXE=`which false`653 fi654 }655 656 657 FixPathIfBroken() {658 if [ -e "/sbin/mkfs" ] && ! which mkfs &> /dev/null ; then659 PATH=$PATH:/sbin:/usr/sbin660 export PATH661 echo "Your PATH did not include /sbin or /usr/sbin. I have fixed that, temporarily." >> $LOGFILE662 echo "However, you may wish to ask your vendor to provide a permanent fix..." >> $LOGFILE663 echo "You might like to call 'su -' instead of 'su', for example." >> $LOGFILE664 611 fi 665 612 } … … 1010 957 fi 1011 958 1012 link=`readlink $file`959 link=`readlink -f $file` 1013 960 d=`dirname $file` 1014 961 if [ ! -e "$link" -a ! -e "$d/$link" ]; then … … 1076 1023 [ "$INTERNAL_TAPE_BLOCK_SIZE" ] && echo "internal-tape-block-size $INTERNAL_TAPE_BLOCK_SIZE" >> $outfile 1077 1024 use_lzo=$USE_LZO; [ "$use_lzo" = "" ] && use_lzo="no" 1025 use_gzip=$USE_GZIP; [ "$use_gzip" = "" ] && use_gzip="no" 1078 1026 use_comp=$USE_COMP; [ "$use_comp" = "" ] && use_comp="yes" 1079 1027 use_star=$USE_STAR; [ "$use_star" = "" ] && use_star="no" 1080 1028 echo "use-lzo $use_lzo" >> $outfile 1029 echo "use-gzip $use_gzip" >> $outfile 1081 1030 echo "use-star $use_star" >> $outfile 1082 1031 echo "use-comp $use_comp" >> $outfile … … 1239 1188 if [ "`echo "$current_partition" | /bin/grep -i "LABEL="`" != "" ]; then 1240 1189 str_to_find_fmt_with=$current_partition 1241 redhat_label=`echo "$current_partition" | /bin/cut -d'=' -f2`1190 redhat_label=`echo "$current_partition" | cut -d'=' -f2` 1242 1191 actual_dev="" 1243 1192 … … 1249 1198 # 2nd try : blkid, the good way for all LABEL except swap 1250 1199 if [ "x$actual_dev" = "x" -a -x "/sbin/blkid" ]; then 1251 actual_dev=`/sbin/blkid | /bin/grep "$redhat_label" | grep LABEL= | /bin/cut -d':' -f1`1200 actual_dev=`/sbin/blkid | /bin/grep "$redhat_label" | grep LABEL= | cut -d':' -f1` 1252 1201 # For LVM FS it will give a /dev/dm-# which should then be converted 1253 1202 if [ $LVM = "v2" ] && [ "`echo $actual_dev | grep '/dev/dm'`" ]; then … … 1268 1217 # For LVM gives a /dev/mapper entry 1269 1218 if [ "x$actual_dev" = "x" ]; then 1270 actual_dev=`/bin/mount -l | /bin/grep "\[$redhat_label\]" | /bin/cut -d' ' -f1`1219 actual_dev=`/bin/mount -l | /bin/grep "\[$redhat_label\]" | cut -d' ' -f1` 1271 1220 fi 1272 1221 … … 1292 1241 do 1293 1242 # Location of the swap label for kernel 2.6 1294 try_dev_label=`dd bs=1 count=16 skip=1052 if=$try_dev &> /dev/null`1243 try_dev_label=`dd bs=1 count=16 skip=1052 if=$try_dev 2> /dev/null` 1295 1244 if [ "x$try_dev_label" = "x$redhat_label" ]; then 1296 1245 actual_dev=$try_dev … … 1298 1247 done 1299 1248 fi 1300 fi 1301 1249 1250 # Check if one of all those tries has known success 1251 if [ "x$actual_dev" != "x" ]; then 1252 current_partition=$actual_dev 1253 else 1254 Die "Your system uses a LABEL partition ($current_partition), but you lack the tool to support it.\nPlease replace labels with their correct devices in /etc/fstab or install findfs|blkid|vol_id" 1255 fi 1302 1256 # This part tries to retrieve the correct device from a UUID line in /etc/fstab 1303 1257 # current_partition contains only first column of /etc/fstab 1304 if [ "`echo "$current_partition" | /bin/grep -i "UUID="`" != "" ]; then1258 elif [ "`echo "$current_partition" | /bin/grep -i "UUID="`" != "" ]; then 1305 1259 str_to_find_fmt_with=$current_partition 1306 uuid=`echo "$current_partition" | /bin/cut -d'=' -f2`1260 uuid=`echo "$current_partition" | cut -d'=' -f2` 1307 1261 actual_dev="" 1308 1262 … … 1314 1268 # 2nd try : blkid, the good way for all LABEL except swap 1315 1269 if [ "x$actual_dev" = "x" -a -x "/sbin/blkid" ]; then 1316 actual_dev=`/sbin/blkid | /bin/grep "$uuid" | grep UUID= | /bin/cut -d':' -f1`1270 actual_dev=`/sbin/blkid | /bin/grep "$uuid" | grep UUID= | cut -d':' -f1` 1317 1271 # For LVM FS it will give a /dev/dm-# which should then be converted 1318 1272 if [ $LVM = "v2" ] && [ "`echo $actual_dev | grep '/dev/dm'`" ]; then … … 1590 1544 old_pwd=`pwd` 1591 1545 cd $MINDI_TMP/iso 1592 mkdir -p $MONDO_ROOT/iso/isolinux1593 1546 echo "mindi_lib = $MINDI_LIB" >> $LOGFILE 1594 1547 for i in memdisk memtest.bin memtest.img ; do … … 1603 1556 done 1604 1557 MakeSyslinuxMessageFile $MINDI_TMP/iso/isolinux/message.txt 1605 cp $kernelpath $MINDI_TMP/iso/isolinux/vmlinuz 2> /dev/null || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_ROOT/isolinux/vmlinuz). Did you run out of disk space?" 1558 cp $kernelpath $MINDI_TMP/iso/isolinux/vmlinuz 2> /dev/null || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MINDI_TMP/iso/isolinux/vmlinuz). Did you run out of disk space?" 1559 cp $kernelpath $MONDO_ROOT/vmlinuz 2> /dev/null || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_ROOT/vmlinuz). Did you run out of disk space?" 1606 1560 cp $MINDI_TMP/mindi.rdz $MINDI_TMP/iso/isolinux/initrd.img 2>> $LOGFILE 1607 cp $MINDI_TMP/mindi.rdz $ CACHE_LOC/initrd.img 2>> $LOGFILE1561 cp $MINDI_TMP/mindi.rdz $MONDO_ROOT/initrd.img 2>> $LOGFILE 1608 1562 [ -e "$iso_cfg_file" ] || Die "FIXME - unable to find $iso_cfg_file - this should never occur" 1609 1563 cd $MINDI_TMP/iso/isolinux … … 2643 2597 echo -en "$LAST_FILELIST_NUMBER" > $mountpoint/tmp/LAST-FILELIST-NUMBER 2644 2598 [ "$USE_LZO" = "yes" ] && echo -en "Pras 4 Pres 2004" >> $mountpoint/tmp/USING-LZO 2599 [ "$USE_GZIP" = "yes" ] && echo -en "YES" >> $mountpoint/tmp/USING-GZIP 2645 2600 [ "$USE_COMP" = "yes" ] && echo -en "Compression, yep" >> $mountpoint/tmp/USING-COMP 2646 2601 [ "$USE_STAR" = "yes" ] && echo -en "Using star. Hooray." >> $mountpoint/tmp/USING-STAR … … 2712 2667 2713 2668 ############################################################################## 2714 #----------------------------------- main -----------------------------------#2669 #----------------------------------- Main -----------------------------------# 2715 2670 ############################################################################## 2716 2671 … … 2737 2692 [ -e "/sbin/mkdosfs" ] && [ ! -e "/sbin/mkfs.vfat" ] && ln -sf /sbin/mkdosfs /sbin/mkfs.vfat 2738 2693 2739 FindHomeOfMindiAndMondo 2694 # Log some capital variables 2695 [ "$MINDI_PREFIX" = "XXX" ] && Die "Mindi has not been installed correctly." 2696 echo "MINDI_LIB = $MINDI_LIB" >> $LOGFILE 2697 echo "MINDI_SBIN = $MINDI_SBIN" >> $LOGFILE 2698 [ "$MINDI_CONF" = "YYY" ] && Die "Mindi has not been installed correctly." 2699 echo "MINDI_CONF = $MINDI_CONF" >> $LOGFILE 2700 echo "MONDO_SHARE = $MONDO_SHARE" >> $LOGFILE 2701 2740 2702 trap AbortHere SIGTERM SIGHUP SIGQUIT SIGKILL SIGABRT SIGINT 2741 AbortIfYourDistroIsAPieceOfStercus 2703 2704 # Sanity checks 2705 which which > /dev/null 2> /dev/null || Die "Please install 'which'." 2706 which strings > /dev/null 2> /dev/null || Die "Please install binutils and libbinutils; you have no 'strings' executable." 2707 which gawk > /dev/null 2> /dev/null || Die "Gawk is missing from your computer. Please install gawk. You may find the package on Debian's website. How did I know you're running Debian? Because only Debian would be stupid enough not to include gawk in your distribution." 2708 which gawk > /dev/null 2> /dev/null && AWK=`which gawk 2>/dev/null` || AWK="`which awk 2>/dev/null`" 2709 if which awk &> /dev/null ; then 2710 if ! which gawk &> /dev/null ; then 2711 LogIt "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" 2712 fi 2713 fi 2714 which mke2fs > /dev/null 2> /dev/null || Die "Please put mke2fs in system path" 2715 [ ! -e "$FDISK" ] && Die "Cannot find (s)fdisk" 2716 2742 2717 [ "`uname -r | 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" 2743 2718 # If we have a 2.6 kernel, the system uses module-init-tools which means that we … … 2755 2730 [ ! -e "/etc/modules.conf" ] && Die "/etc/modules.conf not found; you may have to create a softlink from /etc/conf.modules to /etc/modules.conf; of course, all good distros use modules.conf anyway..." 2756 2731 fi 2757 FixPathIfBroken 2732 2733 # Update the PATH variable if incomplete 2734 if [ -e "/sbin/mkfs" ] && ! which mkfs &> /dev/null ; then 2735 PATH=$PATH:/sbin:/usr/sbin 2736 export PATH 2737 echo "Your PATH did not include /sbin or /usr/sbin. I have fixed that, temporarily." >> $LOGFILE 2738 echo "However, you may wish to ask your vendor to provide a permanent fix..." >> $LOGFILE 2739 echo " Or you might like to call 'su -' instead of 'su', for example." >> $LOGFILE 2740 fi 2741 2758 2742 [ -f "$MINDI_LIB/vmlinuz" ] && FAILSAFE_KVER=`strings $MINDI_LIB/vmlinuz 2> /dev/null | grep -E "2\.[46]" | cut -d' ' -f1` 2759 AbortIfMkfsVfatMissing 2743 2744 if ! which mkfs.vfat &> /dev/null ; then 2745 Die "mkfs.vfat missing from your filesystem - please install your dosfstools RPM or DEB package. Perhaps your PATH environmental variable is broken, too?" 2746 fi 2747 2760 2748 ### BERLIOS 2761 2749 ### Fix as it's not mandatory on ia64 2762 2750 if [ "$ARCH" = "ia64" ] ; then 2763 FindELiloBinary 2751 if which elilo &> /dev/null ; then 2752 LILO_EXE=elilo 2753 else 2754 LILO_EXE=`which false` 2755 fi 2764 2756 else 2765 2757 FindIsolinuxBinary … … 2774 2766 MAX_COMPRESSED_SIZE=1300 2775 2767 kernelpath="" 2776 MONDO_ROOT= $TMPMONDO/mondo-root2768 MONDO_ROOT=/var/cache/mondo 2777 2769 mkdir -p $MONDO_ROOT 2778 2770 … … 2788 2780 LVM="false" 2789 2781 fi 2782 echo "LVM set to $LVM" >> $LOGFILE 2783 echo "----------" >> $LOGFILE 2784 echo "df result:" >> $LOGFILE 2785 echo "----------" >> $LOGFILE 2786 df -T >> $LOGFILE 2787 echo "-------------" >> $LOGFILE 2788 echo "lsmod result:" >> $LOGFILE 2789 echo "-------------" >> $LOGFILE 2790 lsmod >> $LOGFILE 2791 echo "-------------" >> $LOGFILE 2790 2792 2791 2793 if [ "$#" -ge "2" ] ; then … … 2824 2826 # Change MINDI_TMP for the one provided by mondo 2825 2827 # So that it can get back the built files 2826 rm -rf $MINDI_TMP 2828 mv $MINDI_TMP/* $MINDI_TMP/.??* $MONDO_TMP 2> /dev/null 2829 rmdir $MINDI_TMP 2827 2830 MINDI_TMP=$MONDO_TMP 2828 2831 mkdir -p $MINDI_TMP 2832 # This is the scratch dir in mondo 2829 2833 CACHE_LOC=$3 2830 2834 if [ _"$CACHE_LOC" != _"" ]; then … … 2873 2877 INTERNAL_TAPE_BLOCK_SIZE="${18}" 2874 2878 DIFFERENTIAL="${19}" 2875 NOT_BOOT="${20}" 2879 USE_GZIP="${20}" 2880 NOT_BOOT="${21}" 2876 2881 [ "$USE_COMP" = "" ] && USE_COMP=yes 2882 [ "$USE_GZIP" = "" ] && USE_GZIP=no 2877 2883 [ "$NOT_BOOT" = "" ] && NOT_BOOT=no 2878 2884 [ "$TAPEDEV" ] && LogIt "This is a tape-based backup. Fine." … … 2917 2923 else 2918 2924 echo "You are using Mindi-Linux v$MINDI_VERSION to make boot+data disks" >> /var/log/mondo-archive.log 2925 fi 2926 if [ -f $MINDI_LIB/rootfs/bin/busybox ]; then 2927 LogIt "Mindi-`$MINDI_LIB/rootfs/bin/busybox 2>&1 | head -1`" 2928 else 2929 LogIt "Unable to find mindi-busybox, please install it" 2930 MindiExit -1 2919 2931 fi 2920 2932 -
trunk/mindi/rootfs/README
r295 r1043 1 # $Id$ 2 # 1 3 README MINDI LINUX / MONDO RESCUE February 7th, 2002 2 4 … … 24 26 accordingly. 25 27 26 Before you e-mail me, please read the FAQ, the manual, the log and preferably28 Before you e-mail us, please read the FAQ, the manual, the log and preferably 27 29 the mailing list. 28 30 29 - Hugo Rabson <hugo@firstlinux.net>31 - Dev Team 30 32 31 33
Note:
See TracChangeset
for help on using the changeset viewer.