Changeset 2488 in MondoRescue
- Timestamp:
- Nov 18, 2009, 9:41:00 PM (15 years ago)
- Location:
- branches/2.2.10
- Files:
-
- 6 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mindi/deplist.d/minimal.conf
r2475 r2488 63 63 /bin/sleep 64 64 /bin/uname 65 /etc/services 66 /etc/protocols 67 /etc/shells 68 /etc/termcap 69 /etc/bashrc 65 70 66 71 # Compression -
branches/2.2.10/mindi/mindi
r2481 r2488 347 347 LogFile "Debian-style config detected." 348 348 mkdir -p $bigdir/tmp 349 echo "/etc/console/boottime.kmap.gz" > $ bigdir/tmp/KEYMAP-LIVES-HERE349 echo "/etc/console/boottime.kmap.gz" > $MINDI_CACHE/KEYMAP-LIVES-HERE 350 350 KBDEPTH=0 351 351 mkdir -p $bigdir/etc/console … … 356 356 LogFile "Ubuntu-style config detected." 357 357 mkdir -p $bigdir/tmp 358 echo "/etc/console-setup/boottime.kmap.gz" > $ bigdir/tmp/KEYMAP-LIVES-HERE358 echo "/etc/console-setup/boottime.kmap.gz" > $MINDI_CACHE/KEYMAP-LIVES-HERE 359 359 KBDEPTH=0 360 360 mkdir -p $bigdir/etc/console-setup … … 410 410 fi 411 411 mkdir -p $bigdir/tmp 412 echo "$mappath" > $ bigdir/tmp/KEYMAP-LIVES-HERE412 echo "$mappath" > $MINDI_CACHE/KEYMAP-LIVES-HERE 413 413 KBDEPTH=0 414 414 AddKeyboardMappingFile $mappath … … 922 922 AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.DEVICE bootloader.device $outfile 923 923 AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.NAME bootloader.name $outfile 924 AddFileToCfgIfExists $MINDI_TMP/KEYMAP-LIVES-HERE keymap-lives-here $outfile925 924 AddFileToCfgIfExists $MINDI_TMP/TAPEDEV-HAS-DATA-DISKS tapedev-has-data-disks $outfile 926 925 } … … 1412 1411 fi 1413 1412 echo -en "." 1413 # Some distro do auto mount at that point (Ubuntu) 1414 1414 LogFile "Unmounting $USBPART just in case" 1415 1415 umount $USBPART 2>> $LOGFILE 1>> $LOGFILE … … 1628 1628 1629 1629 1630 PrepareBootDiskImage_LILO() { 1631 local imagesdir dev imagefile mountpoint fname i kernelpath cfg_file testpath options retval outstr old_pwd ooo max_kernel_size liloconf 1630 1631 PrepareBootDiskImage() { 1632 local imagesdir dev imagefile mountpoint fname i kernelpath cfg_file testpath options retval outstr old_pwd ooo max_kernel_size bootimage liloconf mountefi 1632 1633 imagesdir=$MINDI_CACHE 1633 1634 kernelpath=$1 1634 1635 do_boot_root_thingy="" 1635 1636 retval=0 1637 1636 1638 [ ! -e "$kernelpath" ] && Die "PBDI - cannot find $kernelpath kernel" 1637 1639 echo -en "Making "$BOOT_SIZE"KB boot disk..." 1638 1640 TurnTgzIntoRdz $MINDI_DATA/rootfs $MINDI_TMP/initrd.img `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into initrd.img; are you SURE your kernel supports loopfs?" 1639 1641 echo -en "..." 1640 imagefile=$imagesdir/mindi-bootroot.$BOOT_SIZE.img 1641 mountpoint=$MINDI_TMP/mountpoint.$$ 1642 mkdir -p $mountpoint 1643 dd if=/dev/zero of=$imagefile bs=1k count=$BOOT_SIZE &> /dev/null || Die "Cannot dd blank file" 1644 mkdosfs $imagefile >> $LOGFILE 2>> $LOGFILE 1645 mount -t vfat -o loop $imagefile $mountpoint || LogAll "Cannot mount (PBDI)" 1646 # copy Mindi's skeleton fs & lilo/syslinux/whatever stuff into it 1647 mkdir -p $mountpoint/etc 1648 liloconf=$mountpoint/elilo.conf 1649 1650 MakeBootConfFile elilo > $liloconf 1651 1652 # Copy it so that CD-ROM menu entry is satisfied 1653 mountefi=0 1654 df -T | grep /boot/efi | grep -q vfat 1655 if [ $? -ne 0 ]; then 1656 mount /boot/efi 1657 if [ $? -ne 0 ]; then 1658 echo "You have to mount your EFI partition when using mindi" 1659 MindiExit -1 1660 fi 1661 mountefi=1 1662 fi 1663 el=`find /boot/efi -name elilo.efi` 1664 cp $el $mountpoint 1665 cp $liloconf $mountpoint 1666 if [ $mountefi -eq 1 ]; then 1667 umount /boot/efi 2>&1 > /dev/null 1668 fi 1669 1670 LogFile "Copying $MINDI_TMP/initrd.img to $mountpoint..." 1671 cp -f $MINDI_TMP/initrd.img $mountpoint 2>> $LOGFILE 1672 if [ "$?" -ne "0" ] ; then 1673 LogAll "Failed to copy $MINDI_TMP/initrd.img to $mountpoint" 1674 cat $MINDI_TMP/mtpt.$$ >> $LOGFILE 1675 LogAll "Please unload some of your modules and try again." 1676 rm -f $MINDI_TMP/mtpt.$$ 1677 LogAll "Cannot incorporate initrd.img in bootdisk (kernel / modules too big?)" 1678 retval=$(($retval+1)) 1679 fi 1680 MakeMessageFile > $mountpoint/message.txt 1681 1682 # copy the kernel across 1683 [ "$mountpoint" != "" ] && rm -Rf $mountpoint/lost+found 1684 dd if=/dev/zero of=$mountpoint/zero bs=1k count=16 &> /dev/null 1685 free_space=`df -k -P $mountpoint | tail -n1 | tr -s ' ' '\t' | cut -f4` 1686 cp -f $kernelpath $mountpoint/vmlinuz > /dev/null 2>> $LOGFILE 1687 if [ "$?" -ne "0" ] ; then 1688 LogFile "Files at mountpoint ($mountpoint) :-" 1689 du -sk $mountpoint/* >> $LOGFILE 1690 LogFile "--- end of list of files ---" 1691 echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n\ 1692 Sorry, your kernel is too big for your image.\n" >> $LOGFILE 1693 [ "$mountpoint" != "" ] && rm -f $mountpoint/vmlinuz 1694 cd $old_pwd 1695 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 1696 rmdir $mountpoint || LogAll "Cannot rmdir (PBDI)" 1697 [ "$imagefile" != "" ] && rm -f $imagefile 1698 return 0 1699 fi 1700 max_kernel_size=$(($free_space+`du -sk $kernelpath | cut -f1`)) 1701 LogFile "Free space left on image = $free_space KB" 1702 LogFile "Max kernel size on $BOOT_SIZE KB image (est'd) = $max_kernel_size K" 1703 # make it bootable 1704 [ "$mountpoint" != "" ] && rm -f $mountpoint/zero 1705 [ -e "$MINDI_DATA/memdisk" ] && cp -f $MINDI_DATA/memdisk $mountpoint 2>> $LOGFILE 1706 if [ "$KERN_DISK_MADE" ] ; then 1707 LogFile "Not running LILO. It's not that kind of disk." 1708 fi 1709 1710 cp `dirname $kernelpath`/*.efi $mountpoint 2>> $LOGFILE 1711 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 1712 echo -en "..." 1713 rmdir $mountpoint || LogAll "Cannot rmdir (PBDI)" 1714 if [ "$retval" -eq "0" ] ; then 1715 echo -en "...$DONE\n" 1716 if [ "$KERN_DISK_MADE" ] ; then 1717 LogAll "$BOOT_SIZE KB boot disks were created OK\n" 1718 fi 1719 else 1720 echo -en "...failed\n" 1721 LogAll $BOOT_SIZE"KB boot disk was NOT created\n" 1722 [ "$imagefile" != "" ] && rm -f $imagefile 1723 fi 1724 [ "$retval" -ne "0" ] && LogAll "PrepareBootDiskImage() is returning nonzero" 1725 return $retval 1726 } 1727 1728 1729 PrepareBootDiskImage_ISOLINUX() { 1730 local imagesdir dev imagefile mountpoint fname i kernelpath cfg_file testpath options retval outstr old_pwd ooo max_kernel_size bootimage 1731 imagesdir=$MINDI_CACHE 1732 kernelpath=$1 1733 do_boot_root_thingy="" 1734 local retval old_pwd 1735 retval=0 1736 1737 [ ! -e "$kernelpath" ] && Die "PBDI - cannot find $kernelpath kernel" 1738 echo -en "Making "$BOOT_SIZE"KB boot disk..." 1739 TurnTgzIntoRdz $MINDI_DATA/rootfs $MINDI_TMP/initrd.img `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into initrd.img; are you SURE your kernel supports loopfs?" 1740 echo -en "..." 1741 imagefile=$MINDI_TMP/mindi-bootroot.$BOOT_SIZE.img 1642 imagefile=$MINDI_CACHE/mindi-bootroot.$BOOT_SIZE.img 1742 1643 mountpoint=$MINDI_TMP/mountpoint.$$ 1743 1644 mkdir -p $mountpoint 1744 1645 dd if=/dev/zero of=$imagefile bs=1k count=$BOOT_SIZE &> /dev/null || Die "Cannot dd blank file" 1745 1646 LogFile "Creating vfat filesystem on $imagefile" 1746 mkfs.vfat $imagefile >> $LOGFILE 2>> $LOGFILE 1747 # syslinux should be run on a local file (doen't work through NFS Cf: #297) 1748 syslinux $imagefile >> $LOGFILE 2>> $LOGFILE 1749 1750 # Only move it now to its final destination abd use it now 1751 mv $imagefile $imagesdir 1752 imagefile=$imagesdir/mindi-bootroot.$BOOT_SIZE.img 1647 mkdosfs $imagefile >> $LOGFILE 2>> $LOGFILE 1648 if [ "$ARCH" != "ia64" ] ; then 1649 # syslinux should be run on a local file (doen't work through NFS Cf: #297) 1650 # Ensure that $MINDI_CACHE is not on NFS (it shouldn't) 1651 syslinux $imagefile >> $LOGFILE 2>> $LOGFILE 1652 fi 1753 1653 1754 1654 mount -t vfat -o loop $imagefile $mountpoint || LogAll "Cannot mount (PBDI)" 1755 1655 1756 1656 # copy Mindi's skeleton fs & lilo/syslinux/whatever stuff into it 1657 mkdir -p $mountpoint/etc 1658 liloconf=$mountpoint/elilo.conf 1659 1757 1660 MakeMessageFile > $mountpoint/message.txt 1758 MakeBootConfFile isolinux > $mountpoint/syslinux.cfg 1661 1662 if [ "$ARCH" != "ia64" ] ; then 1663 MakeBootConfFile isolinux > $mountpoint/syslinux.cfg 1664 else 1665 MakeBootConfFile elilo > $liloconf 1666 # Copy it so that CD-ROM menu entry is satisfied 1667 mountefi=0 1668 df -T | grep /boot/efi | grep -q vfat 1669 if [ $? -ne 0 ]; then 1670 mount /boot/efi 1671 if [ $? -ne 0 ]; then 1672 echo "You have to mount your EFI partition when using mindi" 1673 MindiExit -1 1674 fi 1675 mountefi=1 1676 fi 1677 el=`find /boot/efi -name elilo.efi` 1678 cp $el $mountpoint 1679 cp $liloconf $mountpoint 1680 if [ $mountefi -eq 1 ]; then 1681 umount /boot/efi 2>&1 > /dev/null 1682 fi 1683 fi 1684 1759 1685 LogFile "Copying $MINDI_TMP/initrd.img to $mountpoint/initrd.img..." 1760 1686 cp -f $MINDI_TMP/initrd.img $mountpoint/initrd.img 2>> $LOGFILE … … 1784 1710 rmdir $mountpoint || LogAll "Cannot rmdir (PBDI)" 1785 1711 1786 [ "$imagefile" != "" ] &&rm -f $imagefile1712 rm -f $imagefile 1787 1713 return 0 1788 1714 fi … … 1793 1719 # make it bootable 1794 1720 [ "$mountpoint" != "" ] && rm -f $mountpoint/zero 1795 mkdir -p $mountpoint/etc1796 1721 [ -e "$MINDI_DATA/memdisk" ] && cp -f $MINDI_DATA/memdisk $mountpoint 2>> $LOGFILE 1722 1723 if [ "$ARCH" = "ia64" ] ; then 1724 cp `dirname $kernelpath`/*.efi $mountpoint 2>> $LOGFILE 1725 fi 1797 1726 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 1798 1727 echo -en "..." … … 1801 1730 if [ "$retval" -eq "0" ] ; then 1802 1731 echo -en "...$DONE\n" 1803 if [ "$KERN_DISK_MADE" ] ; then 1804 [ "$imagefile" != "" ] && rm -f $imagefile 1805 LogAll "$BOOT_SIZE KB boot disks were created OK\n" 1806 fi 1732 LogAll "$BOOT_SIZE KB boot disk was created OK\n" 1807 1733 else 1808 1734 echo -en "...failed\n" 1809 LogAll $BOOT_SIZE"KB boot disk was NOT created\n"1810 [ "$imagefile" != "" ] &&rm -f $imagefile1735 LogAll "$BOOT_SIZE KB boot disk was NOT created\n" 1736 rm -f $imagefile 1811 1737 fi 1812 1738 [ "$retval" -ne "0" ] && LogAll "PrepareBootDiskImage() is returning nonzero" … … 1918 1844 fi 1919 1845 1920 LogFile -en "$FILES_IN_FILELIST" > $bigdir/FILES-IN-FILELIST1921 1846 if [ _"$MONDO_SHARE" != _"" ]; then 1922 1847 for q in filelist.full.gz biggielist.txt ; do … … 2250 2175 mindi-get-perl-modules `cat $MINDI_CONF/perl-scripts` >> $MINDI_TMP/cp.lis 2251 2176 2252 for w in cdrom groovy-stuff ; do 2253 echo mnt/$w >> $MINDI_TMP/mkdir.lis 2254 done 2177 echo mnt/cdrom >> $MINDI_TMP/mkdir.lis 2255 2178 2256 2179 ls /dev/fd0*[1,2][4,7,8]* >> $MINDI_TMP/cp.lis 2> /dev/null … … 2335 2258 2336 2259 # Then copy files needed 2337 LANGUAGE=C tar cf - `cat $MINDI_TMP/cp.lis` | (cd $mountpoint ; tar xf - ) 2>&1 | grep -Ev "tar: Removing.*/\'" >> $LOGFILE2260 LANGUAGE=C tar cf - `cat $MINDI_TMP/cp.lis` 2> /dev/null | (cd $mountpoint ; tar xf - ) 2>&1 | grep -Ev "tar: Removing.*/\'" >> $LOGFILE 2338 2261 2339 2262 # Then handle links … … 2353 2276 2354 2277 # Finally integrate what we provide statically as part of mindi 2355 (cd $tgz_dir_fname ; LANGUAGE=C tar cf - . ) | (cd $mountpoint ; tar xf - ) 2278 (cd $tgz_dir_fname ; LANGUAGE=C tar cf - . ) | (cd $mountpoint ; tar xf - ) 2>&1 | grep -Ev "tar: Removing.*/\'" >> $LOGFILE 2356 2279 2357 2280 # Extracting devices 2358 bash2359 2281 (cd $mountpoint/dev ; tar -zxf dev-entries.tgz) || Die "Cannot untar dev-entries.tgz" 2360 2282 rm -f $mountpoint/dev/dev-entries.tgz … … 2402 2324 Die "Filesystem $gvFileSystem not supported for initrd image. Terminating." 2403 2325 fi 2326 ls -al $MINDI_TMP/initrd.img > /tmp/initrd.log 2404 2327 2405 2328 if [ "$res" -eq "0" ] ; then … … 2756 2679 LogAll "Latest Mindi is available from http://www.mondorescue.org" 2757 2680 LogAll "------------------------------------------------------------------------------" 2758 2759 KERN_DISK_MADE=""2760 2761 2681 LogFile "DIFFERENTIAL = $DIFFERENTIAL" 2762 2682 LogFile "INTERNAL TAPE BLOCK SIZE = $INTERNAL_TAPE_BLOCK_SIZE" … … 2792 2712 2793 2713 LogFile "Ramdisk will be $ramdisk_size KB" 2794 if [ "$ARCH" = "ia64" ] ; then 2795 PrepareBootDiskImage_LILO $kernelpath || Die "Failed to create ia64 image disk image." 2796 else 2797 PrepareBootDiskImage_ISOLINUX $kernelpath || Die "Failed to create $ramdisk_size MB disk image." 2798 fi 2714 PrepareBootDiskImage $kernelpath || Die "Failed to create $ramdisk_size MB disk image." 2799 2715 2800 2716 [ -e "$MINDI_DATA/memtest.img" ] && BOOT_MEDIA_MESSAGE="$BOOT_MEDIA_MESSAGE\n\ -
branches/2.2.10/mindi/rootfs/sbin/find-and-mount-cdrom
r2462 r2488 70 70 [ "$SECOND_TRY" ] && add="At 2nd attempt, " || add="" 71 71 LogIt $add"CD-ROM found and mounted at $device" 3 72 echo "$device" > /tmp/CDROM-LIVES-HERE72 echo "$device" > $MINDI_CACHE/CDROM-LIVES-HERE 73 73 LogIt "find-and-mount-cdrom --- leaving (0)" 74 74 exit 0 -
branches/2.2.10/mindi/rootfs/sbin/ide-opt
r1983 r2488 8 8 echo -e -n "Optimizing IDE drive access..." 9 9 10 cdrom_lives_here=`cat /tmp/CDROM-LIVES-HERE`10 cdrom_lives_here=`cat $MINDI_CACHE/CDROM-LIVES-HERE` 11 11 if [ "$?" -ne "0" ] ; then 12 12 echo "I don't know where the CDROM lives. Optimization cancelled." -
branches/2.2.10/mindi/rootfs/sbin/init
r2487 r2488 84 84 85 85 LaunchTerminals() { 86 openvt 2/bin/sh87 openvt 3/bin/sh88 openvt 4/bin/sh89 openvt 5/bin/sh90 openvt 6/bin/sh91 openvt 7/bin/sh /sbin/wait-for-petris92 openvt 8/usr/bin/tail -f $LOGFILE86 openvt -l /bin/sh 87 openvt -l /bin/sh 88 openvt -l /bin/sh 89 openvt -l /bin/sh 90 openvt -l /bin/sh 91 openvt -l /bin/sh /sbin/wait-for-petris 92 openvt -l /usr/bin/tail -f $LOGFILE 93 93 # May avoid shell error messages 94 chmod 666 /dev/tty* /dev/console94 # chmod 666 /dev/tty* /dev/console 95 95 # By default first serial line is configured as tty 96 96 # Required to have a correct serial console support (MP on ia64 or VSP with iLO2 e.g.) -
branches/2.2.10/mindi/rootfs/sbin/install-additional-tools
r2445 r2488 15 15 # ------------ main ----------- 16 16 17 # if the file ' /tmp/CDROM-LIVES-HERE' exists then we should use the CD17 # if the file '$MINDI_CACHE/CDROM-LIVES-HERE' exists then we should use the CD 18 18 19 19 LogIt "Starting install-additional-tools" … … 40 40 41 41 mountpoint=/dev/null 42 [ -e " /tmp/CDROM-LIVES-HERE" ] && mountpoint=/mnt/cdrom/images42 [ -e "$MINDI_CACHE/CDROM-LIVES-HERE" ] && mountpoint=/mnt/cdrom/images 43 43 tarball=$mountpoint/all.tar.gz 44 if [ -e " /tmp/CDROM-LIVES-HERE" ] ; then44 if [ -e "$MINDI_CACHE/CDROM-LIVES-HERE" ] ; then 45 45 [ -e "$tarball" ] || LogIt "Can't find CD's $tarball" 1 46 46 fi … … 58 58 cd $old_pwd 59 59 echo -e -n "\r" 60 [ ! -e " /tmp/CDROM-LIVES-HERE" ] && umount $mountpoint60 [ ! -e "$MINDI_CACHE/CDROM-LIVES-HERE" ] && umount $mountpoint 61 61 sleep 1 62 62 fi -
branches/2.2.10/mondo/src/mondorestore/mondo-rstr-compare.c
r2462 r2488 653 653 654 654 mr_free(bkpinfo->media_device); 655 if (bkpinfo->disaster_recovery && does_file_exist( "/tmp/CDROM-LIVES-HERE")) {656 bkpinfo->media_device = last_line_of_file( "/tmp/CDROM-LIVES-HERE");655 if (bkpinfo->disaster_recovery && does_file_exist(MINDI_CACHE"/CDROM-LIVES-HERE")) { 656 bkpinfo->media_device = last_line_of_file(MINDI_CACHE"/CDROM-LIVES-HERE"); 657 657 } else { 658 658 bkpinfo->media_device = find_cdrom_device(FALSE); -
branches/2.2.10/mondo/src/mondorestore/mondo-rstr-tools.c
r2462 r2488 604 604 } else { 605 605 mr_free(bkpinfo->media_device); 606 if (bkpinfo->disaster_recovery && does_file_exist( "/tmp/CDROM-LIVES-HERE")) {607 bkpinfo->media_device = last_line_of_file( "/tmp/CDROM-LIVES-HERE");606 if (bkpinfo->disaster_recovery && does_file_exist(MINDI_CACHE"/CDROM-LIVES-HERE")) { 607 bkpinfo->media_device = last_line_of_file(MINDI_CACHE"/CDROM-LIVES-HERE"); 608 608 } else { 609 609 bkpinfo->media_device = find_cdrom_device(TRUE);
Note:
See TracChangeset
for help on using the changeset viewer.