Changeset 148 in MondoRescue
- Timestamp:
- Dec 2, 2005, 8:22:32 PM (19 years ago)
- Location:
- branches/2.05
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.05/mindi/README.pxe
r95 r148 20 20 (You need to have backup your data using the NFS option of mondoarchive) 21 21 22 If you used the -p option of mondoarchive, you 'll have tospecify the real name of mondo images to use during restore. To do that use prefix=machine on the initrd line, after the pxe keyword, to load the ISO images saved with -p machine.23 Without prefix keyword, imagesname mondorescue-1.iso, ... will be used.22 If you used the -p option of mondoarchive, you may specify the real name of mondo images to use during restore. To do that use prefix=machine on the initrd line, after the pxe keyword, to load the ISO images saved with -p machine. 23 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. 24 24 25 25 During boot mondorestore will start your NFS configuration and mount mondo's content from the network rather than from a physical media. -
branches/2.05/mindi/mindi
r138 r148 55 55 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" 56 56 PCMCIA_MODS="pcmcia_core ds yenta_socket" 57 USB_MODS="usb-storage usb-ohci usb-uhci usbcore usb_storage hid uhci_hcd ehci_hcd uhci-hcd ehci-hcd "57 USB_MODS="usb-storage usb-ohci usb-uhci usbcore usb_storage hid uhci_hcd ehci_hcd uhci-hcd ehci-hcd usbkbd" 58 58 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" 59 59 NET_MODS="sunrpc nfs nfsacl lockd loop e100 bcm5700 e1000 eepro100 tg3" … … 1214 1214 [ "$ESTIMATED_TOTAL_NOOF_SLICES" ] && echo "total-slices $ESTIMATED_TOTAL_NOOF_SLICES" >> $outfile 1215 1215 AddFileToCfgIfExists $MONDO_TMP/NFS-CLIENT-IPADDR nfs-client-ipaddr $outfile 1216 AddFileToCfgIfExists $MONDO_TMP/NFS-CLIENT-NETMASK nfs-client-netmask $outfile 1217 AddFileToCfgIfExists $MONDO_TMP/NFS-CLIENT-DEFGW nfs-client-defgw $outfile 1216 1218 AddFileToCfgIfExists $MONDO_TMP/NFS-SERVER-MOUNT nfs-server-mount $outfile 1217 1219 AddFileToCfgIfExists $MONDO_TMP/NFS-SERVER-PATH nfs-server-path $outfile … … 1220 1222 AddFileToCfgIfExists $MONDO_TMP/ISO-DEV iso-dev $outfile 1221 1223 AddFileToCfgIfExists $MONDO_TMP/ISO-MNT iso-mnt $outfile 1224 AddFileToCfgIfExists $MONDO_TMP/ISO-PREFIX iso-prefix $outfile 1222 1225 AddFileToCfgIfExists $MONDO_TMP/ISODIR isodir $outfile 1223 1226 AddFileToCfgIfExists $MONDO_TMP/BOOTLOADER.DEVICE bootloader.device $outfile … … 2001 2004 rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)\n" 2002 2005 if [ "$retval" -eq "0" ] ; then 2003 echo -en "...$DONE\r" 2004 if [ "$KERN_DISK_MADE" ] && [ "$disksize" != "2880" ] ; then 2005 LogIt "... 1440KB boot+root disks were created OK\r" 2006 else 2007 LogIt "... "$disksize"KB boot disk was created OK\r" 2008 fi 2009 else 2010 echo -en "...failed\r" 2011 LogIt $disksize"KB boot disk was NOT created\r" 2012 rm -f $imagefile 2006 echo -en "...$DONE\r" 2007 if [ "$KERN_DISK_MADE" ] ; then 2008 LogIt "... $disksize KB boot disks were created OK\r" 2009 fi 2010 else 2011 echo -en "...failed\r" 2012 LogIt $disksize"KB boot disk was NOT created\r" 2013 rm -f $imagefile 2013 2014 fi 2014 2015 [ "$retval" -ne "0" ] && LogIt "PrepareBootDiskImage() is returning nonzero\n" 2015 #0421#$imagesdir/mindi-boot.1440.img2016 2016 return $retval 2017 2017 } … … 2119 2119 if [ "$KERN_DISK_MADE" ] ; then 2120 2120 rm -f $imagefile 2121 LogIt "... 1440KB boot+root disks were created OK\r" 2122 else 2123 LogIt "... "$disksize"KB boot disk was created OK\r" 2124 fi 2125 else 2126 echo -en "...failed\r" 2127 LogIt $disksize"KB boot disk was NOT created\r" 2128 rm -f $imagefile 2121 LogIt "... $disksize KB boot disks were created OK\r" 2122 fi 2123 else 2124 echo -en "...failed\r" 2125 LogIt $disksize"KB boot disk was NOT created\r" 2126 rm -f $imagefile 2129 2127 fi 2130 2128 [ "$retval" -ne "0" ] && LogIt "PrepareBootDiskImage() is returning nonzero\n" -
branches/2.05/mindi/rootfs/sbin/init
r116 r148 622 622 # HandleCDROMorFloppies 623 623 #el 624 if [ "` cat /tmp/mondo-restore.cfg | grep "tape "`" ] || [ "`cat /tmp/mondo-restore.cfg | grep udev`" ] ; then624 if [ "`| grep -i 'tape ' /tmp/mondo-restore.cfg`" ] || [ "`grep -i udev /tmp/mondo-restore.cfg`" ] ; then 625 625 HandleTape 626 626 else 627 if [ "`cat /proc/cmdline | grep -i pxe`" ] ; then627 if [ "`cat /proc/cmdline | grep -i pxe`" ] || [ "`grep -i iso-prefix /tmp/mondo-restore.cfg`" ] ; then 628 628 LogIt "PXE boot found" 629 imgname="mondorescue" 629 imgname=`grep iso-prefix /tmp/mondo-restore.cfg | cut -d' ' -f2-` 630 if [ "$imgname" = "" ]; then 631 imgname="mondorescue" 632 fi 630 633 if [ "`cat /proc/cmdline | grep -i prefix`" ] ; then 631 for i in "`cat /proc/cmdline`"; do634 for i in `cat /proc/cmdline` ; do 632 635 if [ "`echo $i | grep -i prefix`" ] ; then 633 636 imgname=`echo $i | cut -d'=' -f2` -
branches/2.05/mondo/mondo/common/libmondo-files.c
r144 r148 1188 1188 char nfs_mount[MAX_STR_LEN]; 1189 1189 char nfs_client_ipaddr[MAX_STR_LEN]; 1190 char nfs_client_netmask[MAX_STR_LEN]; 1191 char nfs_client_defgw[MAX_STR_LEN]; 1190 1192 char nfs_server_ipaddr[MAX_STR_LEN]; 1191 1193 char tmp[MAX_STR_LEN]; … … 1215 1217 strcpy(nfs_client_ipaddr, 1216 1218 call_program_and_get_last_line_of_output(command)); 1219 sprintf(command, 1220 "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f9 | cut -d':' -f2"); 1221 strcpy(nfs_client_netmask, 1222 call_program_and_get_last_line_of_output(command)); 1223 sprintf(command, 1224 "route | egrep '^default' | awk '{printf $2}'"); 1225 strcpy(nfs_client_defgw, 1226 call_program_and_get_last_line_of_output(command)); 1217 1227 sprintf(tmp, 1218 1228 "nfs_client_ipaddr=%s; nfs_server_ipaddr=%s; nfs_mount=%s", … … 1229 1239 } 1230 1240 fprintf(fout, "ifconfig lo 127.0.0.1 # config loopback\n"); 1231 fprintf(fout, "ifconfig %s %s # config client\n", nfs_dev, 1232 nfs_client_ipaddr); 1241 fprintf(fout, "ifconfig %s %s netmask %s # config client\n", nfs_dev, 1242 nfs_client_ipaddr, nfs_client_netmask); 1243 fprintf(fout, "route add default gw %s # default route\n", nfs_client_defgw); 1233 1244 fprintf(fout, "ping -c 1 %s # ping server\n", nfs_server_ipaddr); 1234 1245 fprintf(fout, "mount -t nfs -o nolock %s /tmp/isodir\n", … … 1249 1260 sprintf(tmp, "%s/NFS-CLIENT-IPADDR", bkpinfo->tmpdir); 1250 1261 write_one_liner_data_file(tmp, nfs_client_ipaddr); 1262 sprintf(tmp, "%s/NFS-CLIENT-NETMASK", bkpinfo->tmpdir); 1263 write_one_liner_data_file(tmp, nfs_client_netmask); 1264 sprintf(tmp, "%s/NFS-CLIENT-DEFGW", bkpinfo->tmpdir); 1265 write_one_liner_data_file(tmp, nfs_client_defgw); 1251 1266 sprintf(tmp, "%s/NFS-SERVER-IPADDR", bkpinfo->tmpdir); 1252 1267 write_one_liner_data_file(tmp, nfs_server_ipaddr); … … 1255 1270 sprintf(tmp, "%s/NFS-SERVER-PATH", bkpinfo->tmpdir); 1256 1271 write_one_liner_data_file(tmp, bkpinfo->nfs_remote_dir); 1272 sprintf(tmp, "%s/ISO-PREFIX", bkpinfo->tmpdir); 1273 write_one_liner_data_file(tmp, bkpinfo->prefix); 1257 1274 log_it("Finished storing NFS configuration"); 1258 1275 } -
branches/2.05/mondo/mondo/common/libmondo-tools.c
r128 r148 826 826 write_one_liner_data_file(tmp, iso_path); 827 827 log_it("isodir: %s", iso_path); 828 sprintf(tmp, "%s/ISO-PREFIX", bkpinfo->tmpdir); 829 write_one_liner_data_file(tmp, bkpinfo->prefix); 830 log_it("iso-prefix: %s", bkpinfo->prefix); 828 831 829 832 /* End patch */ … … 969 972 strcpy(bkpinfo->isodir, "/root/images/mondo"); 970 973 } 971 strcpy(bkpinfo->prefix, "mondorescue");974 strcpy(bkpinfo->prefix, STD_PREFIX); 972 975 973 976 bkpinfo->scratchdir[0] = '\0'; … … 1261 1264 return (0); 1262 1265 } else { 1263 sprintf(command, " cat %s | grep \"%s .*\"| cut -d' ' -f2,3,4,5",1264 config_file, label);1266 sprintf(command, "grep '%s .*' %s| cut -d' ' -f2,3,4,5", 1267 label, config_file); 1265 1268 strcpy(value, call_program_and_get_last_line_of_output(command)); 1266 1269 if (strlen(value) == 0) { … … 1477 1480 ("mktemp -q /tmp/mojo-jojo.blah.XXXXXX")); 1478 1481 if (does_file_exist(config_file)) { 1479 sprintf(command, " cat %s | grep -vx \"%s .*\" > %s", config_file,1480 label, tempfile);1482 sprintf(command, "grep -vx '%s .*' %s > %s", 1483 label, config_file, tempfile); 1481 1484 paranoid_system(command); 1482 1485 } -
branches/2.05/mondo/mondo/common/my-stuff.h
r141 r148 212 212 213 213 #define IA64_BOOT_SIZE "8192" /* Should be coherent with mindi */ 214 #define STD_PREFIX "mondorescue" /* Should be coherent with mindi */ 214 215 215 216 /** -
branches/2.05/mondo/mondo/mondorestore/mondo-rstr-tools.c
r128 r148 735 735 } 736 736 #ifdef __FreeBSD__ 737 sprintf(mount_cmd, "/mnt/isodir/%s/%s/% d.iso", bkpinfo->isodir,738 bkpinfo->nfs_remote_dir, g_current_media_number);737 sprintf(mount_cmd, "/mnt/isodir/%s/%s/%s-%d.iso", bkpinfo->isodir, 738 bkpinfo->nfs_remote_dir, bkpinfo->prefix, g_current_media_number); 739 739 mddev = make_vn(mount_cmd); 740 740 sprintf(mount_cmd, "mount_cd9660 -r %s " MNT_CDROM, mddev); 741 741 #else 742 sprintf(mount_cmd, "mount %s/%s/% d.iso -t iso9660 -o loop,ro %s",742 sprintf(mount_cmd, "mount %s/%s/%s-%d.iso -t iso9660 -o loop,ro %s", 743 743 bkpinfo->isodir, bkpinfo->nfs_remote_dir, 744 g_current_media_number, MNT_CDROM);744 bkpinfo->prefix, g_current_media_number, MNT_CDROM); 745 745 #endif 746 746 … … 748 748 if (bkpinfo->backup_media_type == iso) { 749 749 #ifdef __FreeBSD__ 750 sprintf(mount_cmd, "%s/% d.iso", bkpinfo->isodir,751 g_current_media_number);750 sprintf(mount_cmd, "%s/%s-%d.iso", bkpinfo->isodir, 751 bkpinfo->prefix, g_current_media_number); 752 752 mddev = make_vn(mount_cmd); 753 753 sprintf(mount_cmd, "mount_cd9660 -r %s %s", mddev, MNT_CDROM); 754 754 #else 755 sprintf(mount_cmd, "mount %s/% d.iso -t iso9660 -o loop,ro %s",756 bkpinfo->isodir, g_current_media_number, MNT_CDROM);755 sprintf(mount_cmd, "mount %s/%s-%d.iso -t iso9660 -o loop,ro %s", 756 bkpinfo->isodir, bkpinfo->prefix, g_current_media_number, MNT_CDROM); 757 757 #endif 758 758 } else if (strstr(bkpinfo->media_device, "/dev/")) … … 1034 1034 } else { 1035 1035 bkpinfo->backup_media_type = iso; 1036 if (read_cfg_var(cfg_file, "iso-prefix", value) == 0) { 1037 strcpy(bkpinfo->prefix,value); 1038 } else { 1039 strcpy(bkpinfo->prefix,STD_PREFIX); 1040 } 1036 1041 } 1037 1042 } 1038 1043 } else if (!strcmp(value, "nfs")) { 1039 1044 bkpinfo->backup_media_type = nfs; 1045 if (read_cfg_var(cfg_file, "iso-prefix", value) == 0) { 1046 strcpy(bkpinfo->prefix,value); 1047 } else { 1048 strcpy(bkpinfo->prefix,STD_PREFIX); 1049 } 1040 1050 } else if (!strcmp(value, "tape")) { 1041 1051 bkpinfo->backup_media_type = tape; … … 1200 1210 } 1201 1211 } 1202 /* bkpinfo->isodir should now be the true path to 1.iso etc... */1212 /* bkpinfo->isodir should now be the true path to prefix-1.iso etc... */ 1203 1213 if (bkpinfo->backup_media_type == iso) { 1204 1214 sprintf(bkpinfo->isodir, "%s%s", iso_mnt, iso_path);
Note:
See TracChangeset
for help on using the changeset viewer.