- Timestamp:
- Dec 19, 2005, 7:31:56 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mindi/Makefile.parted2fdisk
r30 r236 18 18 19 19 install: $(PRG) 20 cp -a $(PRG) $(DEST) $(SUB)/$(PRG)-$(ARCH)20 cp -a $(PRG) $(DEST)/$(SUB)/$(PRG)-$(ARCH) -
trunk/mindi/README.pxe
r219 r236 9 9 mondo 10 10 kernel vmlinuz-mondo 11 initrd initrd-mondo load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=36864 rw root=/dev/ram iso_mode acpi=off apm=off devfs=nomount exec-shield=0 pxe [prefix="machine"] ...11 initrd initrd-mondo load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=36864 rw root=/dev/ram iso_mode acpi=off apm=off devfs=nomount exec-shield=0 pxe [prefix="machine"] [ipconf=(ipadr:netmask:broadcast:gateway|dhcp)] [ping=#] ... 12 12 13 13 The initrd and kernel file come rom the first bootable media … … 25 25 Without prefix keyword, the name of the images used during archiving with the -p option will be used (they may differ). If -p wasn't used then the name mondorescue-1.iso, ... will be used. 26 26 27 During boot mondorestore will start your NFS configuration and mount mondo's content from the network rather than from a physical media. 27 During boot mondorestore will start your NFS configuration and mount mondo's content from the network rather than from a physical media. You may alter the IP configuration stored from the original machine by passing the ipconf option describing respectively the IP address, netmask, broadcast and default gateway you want to setup for the machine, separated by ':'. Or alternatively, you may specify the dhcp keyword so that a DhCP request is made to get those information. On some configurations, you may also want to increase the number of ping queries made before the NFS mount, which is of 3 by default, using the ping option and give the number you want. 28 28 29 29 Please report any problem around that tool to bcornec@users.berlios.de 30 30 31 2005-12-18 new ipconf and ping option 31 32 2005-12-14 detailed explanations on where to find initrd and kernel -
trunk/mindi/install.sh
r219 r236 7 7 8 8 if [ "_$PREFIX" != "_" ]; then 9 local=$PREFIX /usr9 local=$PREFIX 10 10 if [ -f /usr/local/sbin/mindi ]; then 11 11 echo "WARNING: /usr/local/sbin/mindi exists. You should probably remove it !" 12 12 fi 13 conf=$ PREFIX/etc/mindi13 conf=$CONFDIR/mindi 14 14 echo $PATH | grep /usr/sbin > /dev/null || echo "Warning - your PATH environmental variable is BROKEN. Please add /usr/sbin to your PATH." 15 15 else … … 20 20 conf=$local/etc/mindi 21 21 echo $PATH | grep $local/sbin > /dev/null || echo "Warning - your PATH environmental variable is BROKEN. Please add $local/sbin to your PATH." 22 23 22 fi 24 23 … … 31 30 32 31 echo "Creating target directories ..." 33 mkdir -p $local/lib/mindi 34 mkdir -p $local/share/man/man8 35 mkdir -p $local/sbin 36 mkdir -p $conf 32 install -g root -o root -m 755 -d $conf $local/lib/mindi $local/share/man/man8 $local/sbin $local/doc/mindi 37 33 38 34 echo "Copying files ..." 39 cp deplist.txt $conf 40 cp -af rootfs aux-tools isolinux.cfg msg-txt sys-disk.raw.gz isolinux-H.cfg parted2fdisk.pl syslinux.cfg syslinux-H.cfg dev.tgz Mindi $local/lib/mindi 35 install -g root -o root -m 644 isolinux.cfg msg-txt sys-disk.raw.gz isolinux-H.cfg syslinux.cfg syslinux-H.cfg dev.tgz $local/lib/mindi 36 install -g root -o root -m 644 deplist.txt $conf 37 38 cp -af rootfs aux-tools Mindi $local/lib/mindi 41 39 chmod 755 $local/lib/mindi/rootfs/bin/* 42 40 chmod 755 $local/lib/mindi/rootfs/sbin/* 43 41 chmod 755 $local/lib/mindi/aux-tools/sbin/* 42 chown -R root:root $local/lib/mindi 44 43 45 cp -af analyze-my-lvm parted2fdisk.pl $local/sbin46 44 if [ "$RPMBUILDMINDI" = "true" ]; then 47 45 sed -e "s~^MINDI_PREFIX=XXX~MINDI_PREFIX=/usr~" -e "s~^MINDI_CONF=YYY~MINDI_CONF=/etc/mindi~" mindi > $local/sbin/mindi … … 50 48 fi 51 49 chmod 755 $local/sbin/mindi 52 ch mod 755 $local/sbin/analyze-my-lvm53 chmod 755 $local/sbin/parted2fdisk.pl 50 chown root:root $local/sbin/mindi 51 install -g root -o root -m 755 analyze-my-lvm parted2fdisk.pl $local/sbin 54 52 55 cp -a mindi.8 $local/share/man/man8 56 cp -a CHANGES COPYING README README.busybox README.ia64 README.pxe TODO INSTALL $local/share/lib/mindi 57 58 echo "Extracting symlinks ..." 59 ( cd $local/lib/mindi/rootfs && tar -xzf symlinks.tgz ) 53 install -g root -o root -m 644 mindi.8 $local/share/man/man8 54 install -g root -o root -m 644 CHANGES COPYING README README.busybox README.ia64 README.pxe TODO INSTALL $local/doc/mindi 60 55 61 56 ARCH=`/bin/arch` 62 57 echo $ARCH | grep -x "i[0-9]86" &> /dev/null && ARCH=i386 58 # For the moment, we don't build specific x86_64 busybox binaries 59 echo $ARCH | grep -x "x86_64" &> /dev/null && ARCH=i386 63 60 export ARCH 64 61 62 # Managing busybox 65 63 if [ -f $local/lib/mindi/rootfs/bin/busybox-$ARCH ]; then 66 64 echo "Installing busybox ..." 67 mv$local/lib/mindi/rootfs/bin/busybox-$ARCH $local/lib/mindi/rootfs/bin/busybox65 install -s -g root -o root -m 755 $local/lib/mindi/rootfs/bin/busybox-$ARCH $local/lib/mindi/rootfs/bin/busybox 68 66 else 69 67 echo "WARNING: no busybox found, mindi will not work on this arch ($ARCH)" 70 68 fi 71 72 69 if [ "$ARCH" = "i386" ] ; then 73 # FHS requires fdisk under /sbin74 (cd $local/sbin && ln -s /sbin/fdisk parted2fdisk)75 70 if [ -f $local/lib/mindi/rootfs/bin/busybox-$ARCH.net ]; then 76 71 echo "Installing busybox.net ..." 77 mv$local/lib/mindi/rootfs/bin/busybox-$ARCH.net $local/lib/mindi/rootfs/bin/busybox.net72 install -s -g root -o root -m 755 $local/lib/mindi/rootfs/bin/busybox-$ARCH.net $local/lib/mindi/rootfs/bin/busybox.net 78 73 else 79 74 echo "WARNING: no busybox.net found, mindi will not work on this arch ($ARCH) with network" 80 75 fi 81 76 fi 77 # Remove left busybox 78 rm -f $local/lib/mindi/rootfs/bin/busybox-* 82 79 80 # Managing parted2fdisk 83 81 if [ "$ARCH" = "ia64" ] ; then 84 (cd $local/sbin && ln -s parted2fdisk.pl parted2fdisk)82 (cd $local/sbin && ln -sf parted2fdisk.pl parted2fdisk) 85 83 make -f Makefile.parted2fdisk DEST=$local/lib/mindi install 86 84 if [ -f $local/lib/mindi/rootfs/sbin/parted2fdisk-$ARCH ]; then 87 85 echo "Installing parted2fdisk ..." 88 mv $local/lib/mindi/rootfs/sbin/parted2fdisk-$ARCH $local/lib/mindi/rootfs/sbin/parted2fdisk 86 install -s -g root -o root -m 755 $local/lib/mindi/rootfs/sbin/parted2fdisk-$ARCH $local/lib/mindi/rootfs/sbin/parted2fdisk 87 install -s -g root -o root -m 755 $local/lib/mindi/rootfs/sbin/parted2fdisk-$ARCH $local/sbin/parted2fdisk 89 88 else 90 89 echo "WARNING: no parted2fdisk found, mindi will not work on this arch ($ARCH)" 91 90 fi 92 91 else 92 # FHS requires fdisk under /sbin 93 (cd $local/sbin && ln -sf /sbin/fdisk parted2fdisk) 93 94 echo "Symlinking fdisk to parted2fdisk" 94 95 ( cd $local/lib/mindi/rootfs/sbin && ln -sf fdisk parted2fdisk) 95 96 fi 97 # Remove left parted2fdisk 98 rm -f $local/lib/mindi/rootfs/sbin/parted2fdisk-* 96 99 97 100 exit 0 -
trunk/mindi/mindi
r226 r236 222 222 mappath=$1 223 223 KBDEPTH=$(($KBDEPTH+1)) 224 [ "$KBDEPTH" -gt "128" ] && Die "Edit $MINDI_SBIN/mindi and disable FindAndAddUserKeyboardMappingFile (line 1170, approx.)"224 [ "$KBDEPTH" -gt "128" ] && Die "Edit $MINDI_SBIN/mindi and disable FindAndAddUserKeyboardMappingFile (line 2160, approx.)" 225 225 if [ -e "$bigdir/$mappath" ] ; then 226 226 echo "$mappath already added" >> $LOGFILE … … 422 422 while [ "$diskno" -le "$noof_disks" ] ; do 423 423 echo -en "#$diskno..." 424 cp -f $tardir/$diskno.tar.gz $outdir || LogIt "[line 250] Cannot copy $tardir/$diskno.tar.gz to $outdir"424 cp -f $tardir/$diskno.tar.gz $outdir || LogIt "[line 424] Cannot copy $tardir/$diskno.tar.gz to $outdir" 425 425 CreateOneDataDiskImage $tardir/$diskno.tar.gz $outdir/mindi-data-$diskno.img $diskno $noof_disks 426 426 diskno=$(($diskno+1)) … … 1672 1672 if [ "`DidMondoCallMe`" ] ; then 1673 1673 if [ "$CDRECOVERY" != "yes" ] ; then 1674 1675 1676 elif [ ! "$MONDO_TMP" ] ; then1677 1678 1679 1680 1674 if [ -e "$MONDO_TMP/start-nfs" ] ; then 1675 echo -en "Press <enter> to continue.\n" 1676 elif [ ! "$MONDO_TMP" ] ; then 1677 echo -en "FYI, this is _not_ a Mondo Rescue CD.\n" 1678 else 1679 echo -en "$BOOT_MEDIA_MESSAGE" 1680 fi 1681 1681 fi 1682 1682 fi … … 3258 3258 if [ "$imagesdir" != "/root/images/mindi" ] ; then 3259 3259 for i in `find $imagesdir -maxdepth 1 -name "*.iso" -o -name "*.img"` ; do 3260 cp -f $i /root/images/mindi || LogIt "[line 1613] Cannot copy $i to /root/images/mindi"3260 cp -f $i /root/images/mindi || LogIt "[line 3260] Cannot copy $i to /root/images/mindi" 3261 3261 done 3262 3262 fi -
trunk/mindi/mindi.spec
r219 r236 28 28 Group: Archiving/Backup 29 29 Autoreqprov: no 30 %endif 31 32 %if %is_suse 33 %define src %{name}-%{version}.tgz 34 Group: Archiving/Backup 30 35 %endif 31 36 … … 63 68 64 69 %{__rm} -rf $RPM_BUILD_ROOT 65 MINDIDIR=$RPM_BUILD_ROOT%{_libdir}/mindi 66 export PREFIX=${RPM_BUILD_ROOT}70 export PREFIX=${RPM_BUILD_ROOT}%{_exec_prefix} 71 export CONFDIR=${RPM_BUILD_ROOT}%{_sysconfdir} 67 72 export RPMBUILDMINDI="true" 68 73 69 74 ./install.sh 70 71 %{__rm} -f $MINDIDIR/rootfs/bin/busybox-ia64 $MINDIDIR/rootfs/sbin/parted2fdisk-ia64 $MINDIDIR/rootfs/bin/busybox-i386 $MINDIDIR/rootfs/bin/busybox-i386.net72 75 73 76 %clean … … 86 89 %{_mandir} 87 90 %{_libdir}/mindi 88 #%attr(755,root,root) %{_libdir}/mindi/aux-tools/sbin/*89 #%attr(755,root,root) %{_libdir}/mindi/rootfs/bin/*90 #%attr(755,root,root) %{_libdir}/mindi/rootfs/sbin/*91 91 %attr(755,root,root) %{_sbindir}/* 92 92 -
trunk/mindi/rootfs/sbin/init
r230 r236 649 649 # Simulate a local CD 650 650 echo "/mnt/cdrom" > /tmp/CDROM-LIVES-HERE 651 CD_MOUNTED_OK=yes 651 652 else 652 653 HandleCDROMorFloppies … … 654 655 fi 655 656 res=$? 656 echo " Please wait."657 insert-all-my-modules > /dev/null &658 sleep 7 657 echo "Inserting modules ..." 658 insert-all-my-modules > $LOGFILE 2> $LOGFILE 659 echo "Installing additional tools ..." 659 660 install-additional-tools 660 661 SwapTheMountExecs 661 662 ConfigureLoggingDaemons 662 echo "Please wait." 663 insert-all-my-modules & 664 sleep 7 663 echo "Inserting modules again ..." 664 insert-all-my-modules > $LOGFILE 2> $LOGFILE 665 665 if [ -e "/tmp/USE-DEVFS" ] ; then 666 666 umount /mnt/cdrom 2> /dev/null … … 669 669 RunDevfsd 670 670 fi 671 echo "Starting potential Raid/LVMs ..." 671 672 PauseForRaids 672 673 StartRaids -
trunk/mindi/rootfs/sbin/post-init
r30 r236 1 1 #!/bin/sh 2 2 # 3 # $Id$ 3 4 # 4 # 07/14/045 # - if interactive then not expert :)6 #7 # 06/12/048 # - tell user to call mondorestore --mbr after nuking9 #10 # 08/02/0311 # - don't call multifunc cd, even if it is one12 #13 # 05/30/0314 # - added hooks for multi-function CD15 #16 # 05/04/0317 # - better handling of mondorestore softlinks18 # - no more 'mondo-restore' --- it's 'mondorestore'19 #20 # 03/26/0321 # - report if mount-me, unmount-me, mondorestore missing22 # - call mondorestore instead of mondo-restore23 #24 # 07/15/0225 # - copy mountlist.txt to logfile at start26 #27 # 07/11/0228 # - exit w/o calling mondorestore, if non-mondo CD/floppy29 #30 # 06/28/0231 # - RESTORE == nuke_mode32 #33 # 06/24/0234 # - disabled isonuke35 #36 # 06/13/0237 # - added isonuke38 #39 # 02/03/0240 # - softlink mondo-restore -> mondorestore if mondorestore exists but m-r not41 #42 # 12/10/0143 # - removed the 'clear' from the start of the script44 #45 # 12/09/0146 # - broke up spaghetti code; made lots of subroutines47 # - moved some subroutines to /sbin/init, where they belong48 5 #------------------------------------------------------------ 49 6 … … 105 62 nuke=`cat /proc/cmdline | grep "nuke"` 106 63 if [ "$nuke" = "" ] ; then 107 nuke=`cat /proc/cmdline | grep "RESTORE "`64 nuke=`cat /proc/cmdline | grep -i "RESTORE "` 108 65 fi 109 66 expert=`cat /proc/cmdline | grep "expert"` … … 148 105 done 149 106 150 #if [ "$iso" ] && [ "$nuke" ] ; then151 # LogIt "------------------ISONUKE MODE-----------------" 1152 # mondorestore --isonuke153 #el154 #if [ "$iso" ] ; then155 # LogIt "--------------------ISO MODE-------------------" 1156 # mondorestore --iso157 #el158 107 if [ "$compare" ] ; then 159 108 LogIt "------------------COMPARE MODE-----------------" 1 -
trunk/mondo/mondo.spec
r219 r236 30 30 %endif 31 31 32 %if %is_suse 33 %define src %{name}-%{version}.tgz 34 Group: Archiving/Backup 35 %endif 32 36 33 37 Summary: A program which a Linux user can utilize to create a rescue/restore CD/tape -
trunk/mondo/mondo/common/libmondo-devices.c
r197 r236 1714 1714 paranoid_free(command); 1715 1715 1716 asprintf(&tmp, "mount %s -t nfs %s", bkpinfo->nfs_mount,1716 asprintf(&tmp, "mount -t nfs -o nolock %s %s", bkpinfo->nfs_mount, 1717 1717 bkpinfo->isodir); 1718 1718 run_program_and_log_output(tmp, 5); -
trunk/mondo/mondo/common/libmondo-files.c
r226 r236 1108 1108 fatal_error("Cannot store NFS config"); 1109 1109 } 1110 fprintf(fout, "#!/bin/sh\n"); 1111 fprintf(fout, "# number of ping\n"); 1112 fprintf(fout, "ipcount=3\n"); 1113 fprintf(fout, "for i in `cat /proc/cmdline` ; do\n"); 1114 fprintf(fout, " echo $i | grep -qi ping= && ipcount=`echo $i | cut -d= -f2`\n"); 1115 fprintf(fout, "done\n"); 1110 1116 fprintf(fout, "ifconfig lo 127.0.0.1 # config loopback\n"); 1111 fprintf(fout, "ifconfig %s %s netmask %s broadcast %s # config client\n", nfs_dev, 1112 nfs_client_ipaddr, nfs_client_netmask, nfs_client_broadcast); 1113 fprintf(fout, "route add default gw %s # default route\n", nfs_client_defgw); 1114 fprintf(fout, "ping -c 1 %s # ping server\n", nfs_server_ipaddr); 1117 fprintf(fout, "ipaddress=%s\n", nfs_client_ipaddr); 1118 fprintf(fout, "ipnetmask=%s\n", nfs_client_netmask); 1119 fprintf(fout, "ipbroadcast=%s\n", nfs_client_broadcast); 1120 fprintf(fout, "ipgateway=%s\n", nfs_client_defgw); 1121 fprintf(fout, "ipconf=\n"); 1122 fprintf(fout, "for i in `cat /proc/cmdline` ; do\n"); 1123 fprintf(fout, " echo $i | grep -qi ipconf= && ipconf=`echo $i | cut -d= -f2`\n"); 1124 fprintf(fout, "done\n"); 1125 fprintf(fout, "if [ \"$ipconf\" = \"dhcp\" ]; then\n"); 1126 fprintf(fout, " udhcpc -i %s\n", nfs_dev); 1127 fprintf(fout, "else\n"); 1128 fprintf(fout, " if [ \"$ipconf\" != \"\" ]; then\n"); 1129 fprintf(fout, " ipaddress=`echo $ipconf | cut -d: -f1`\n"); 1130 fprintf(fout, " ipnetmask=`echo $ipconf | cut -d: -f2`\n"); 1131 fprintf(fout, " ipbroadcast=`echo $ipconf | cut -d: -f3`\n"); 1132 fprintf(fout, " ipgateway=`echo $ipconf | cut -d: -f4`\n"); 1133 fprintf(fout, " fi\n"); 1134 fprintf(fout, " ifconfig %s $ipaddress netmask $ipnetmask broadcast $ipbroadcast\n", nfs_dev); 1135 fprintf(fout, " route add default gw $ipgateway\n"); 1136 fprintf(fout, "fi\n"); 1137 fprintf(fout, "ping -c $ipcount %s # ping server\n", nfs_server_ipaddr); 1115 1138 fprintf(fout, "mount -t nfs -o nolock %s /tmp/isodir\n", 1116 1139 bkpinfo->nfs_mount); 1117 fprintf(fout, "exit 0\n");1118 1140 paranoid_fclose(fout); 1119 1141 chmod(outfile, 0777); -
trunk/tools/rpm-env
r98 r236 52 52 fi 53 53 elif [ -e /etc/SuSE-release ]; then 54 export ddir="suse" 55 export dver=`cat /etc/SuSE-release | head -1 | awk '{print $3}'` 54 grep -q Enterprise /etc/SuSE-release 55 if [ $? -eq 0 ]; then 56 export ddir="sles" 57 export dver=`cat /etc/SuSE-release | head -1 | awk '{print $5}'` 58 else 59 export ddir="suse" 60 export dver=`cat /etc/SuSE-release | head -1 | awk '{print $3}'` 61 fi 56 62 else 57 63 export dver=""
Note:
See TracChangeset
for help on using the changeset viewer.