Changeset 149


Ignore:
Timestamp:
Dec 3, 2005, 11:38:14 PM (13 years ago)
Author:
bcornec
Message:

merge -r144:148 $SVN_M/branches/2.05

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/mindi/README.pxe

    r96 r149  
    2020(You need to have backup your data using the NFS option of mondoarchive)
    2121
    22 If you used the -p option of mondoarchive, you'll have to 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, images name mondorescue-1.iso, ... will be used.
     22If 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.
     23Without 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.
    2424
    2525During boot mondorestore will start your NFS configuration and mount mondo's content from the network rather than from a physical media.
  • trunk/mindi/mindi

    r140 r149  
    5555IDE_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"
    5656PCMCIA_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"
     57USB_MODS="usb-storage usb-ohci usb-uhci usbcore usb_storage hid uhci_hcd ehci_hcd uhci-hcd ehci-hcd usbkbd"
    5858CDROM_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"
    5959NET_MODS="sunrpc nfs nfsacl lockd loop e100 bcm5700 e1000 eepro100 tg3"
     
    12141214    [ "$ESTIMATED_TOTAL_NOOF_SLICES" ] && echo "total-slices $ESTIMATED_TOTAL_NOOF_SLICES" >> $outfile
    12151215   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
    12161218   AddFileToCfgIfExists $MONDO_TMP/NFS-SERVER-MOUNT  nfs-server-mount  $outfile
    12171219   AddFileToCfgIfExists $MONDO_TMP/NFS-SERVER-PATH   nfs-server-path   $outfile
     
    12201222   AddFileToCfgIfExists $MONDO_TMP/ISO-DEV           iso-dev           $outfile
    12211223   AddFileToCfgIfExists $MONDO_TMP/ISO-MNT           iso-mnt           $outfile
     1224   AddFileToCfgIfExists $MONDO_TMP/ISO-PREFIX        iso-prefix        $outfile
    12221225   AddFileToCfgIfExists $MONDO_TMP/ISODIR            isodir            $outfile
    12231226   AddFileToCfgIfExists $MONDO_TMP/BOOTLOADER.DEVICE bootloader.device $outfile
     
    20012004    rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)\n"
    20022005    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
    20132014    fi
    20142015    [ "$retval" -ne "0" ] && LogIt "PrepareBootDiskImage() is returning nonzero\n"
    2015 #0421#$imagesdir/mindi-boot.1440.img
    20162016    return $retval
    20172017}
     
    21192119        if [ "$KERN_DISK_MADE" ] ; then
    21202120            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
    21292127    fi
    21302128    [ "$retval" -ne "0" ] && LogIt "PrepareBootDiskImage() is returning nonzero\n"
  • trunk/mindi/rootfs/sbin/init

    r113 r149  
    622622#    HandleCDROMorFloppies
    623623#el
    624 if [ "`cat /tmp/mondo-restore.cfg | grep "tape "`" ] || [ "`cat /tmp/mondo-restore.cfg | grep udev`" ] ; then
     624if [ "`| grep -i 'tape ' /tmp/mondo-restore.cfg`" ] || [ "`grep -i udev /tmp/mondo-restore.cfg`" ] ; then
    625625    HandleTape
    626626else
    627     if [ "`cat /proc/cmdline | grep -i pxe`" ] ; then
     627    if [ "`cat /proc/cmdline | grep -i pxe`" ] || [ "`grep -i iso-prefix /tmp/mondo-restore.cfg`" ] ; then
    628628        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
    630633        if [ "`cat /proc/cmdline | grep -i prefix`" ] ; then
    631             for i in "`cat /proc/cmdline`" ; do
     634            for i in `cat /proc/cmdline` ; do
    632635                if [ "`echo $i | grep -i prefix`" ] ; then
    633636                    imgname=`echo $i | cut -d'=' -f2`
  • trunk/mondo/mondo/common/libmondo-files.c

    r145 r149  
    11921192    char nfs_mount[MAX_STR_LEN];
    11931193    char nfs_client_ipaddr[MAX_STR_LEN];
     1194    char nfs_client_netmask[MAX_STR_LEN];
     1195    char nfs_client_defgw[MAX_STR_LEN];
    11941196    char nfs_server_ipaddr[MAX_STR_LEN];
    11951197    char tmp[MAX_STR_LEN];
     
    12191221    strcpy(nfs_client_ipaddr,
    12201222           call_program_and_get_last_line_of_output(command));
     1223    sprintf(command,
     1224            "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f9 | cut -d':' -f2");
     1225    strcpy(nfs_client_netmask,
     1226           call_program_and_get_last_line_of_output(command));
     1227    sprintf(command,
     1228            "route | egrep '^default' | awk '{printf $2}'");
     1229    strcpy(nfs_client_defgw,
     1230           call_program_and_get_last_line_of_output(command));
    12211231    sprintf(tmp,
    12221232            "nfs_client_ipaddr=%s; nfs_server_ipaddr=%s; nfs_mount=%s",
     
    12331243    }
    12341244    fprintf(fout, "ifconfig lo 127.0.0.1  # config loopback\n");
    1235     fprintf(fout, "ifconfig %s %s   # config client\n", nfs_dev,
    1236             nfs_client_ipaddr);
     1245    fprintf(fout, "ifconfig %s %s netmask %s    # config client\n", nfs_dev,
     1246            nfs_client_ipaddr, nfs_client_netmask);
     1247    fprintf(fout, "route add default gw %s  # default route\n", nfs_client_defgw);
    12371248    fprintf(fout, "ping -c 1 %s # ping server\n", nfs_server_ipaddr);
    12381249    fprintf(fout, "mount -t nfs -o nolock %s /tmp/isodir\n",
     
    12531264    sprintf(tmp, "%s/NFS-CLIENT-IPADDR", bkpinfo->tmpdir);
    12541265    write_one_liner_data_file(tmp, nfs_client_ipaddr);
     1266    sprintf(tmp, "%s/NFS-CLIENT-NETMASK", bkpinfo->tmpdir);
     1267    write_one_liner_data_file(tmp, nfs_client_netmask);
     1268    sprintf(tmp, "%s/NFS-CLIENT-DEFGW", bkpinfo->tmpdir);
     1269    write_one_liner_data_file(tmp, nfs_client_defgw);
    12551270    sprintf(tmp, "%s/NFS-SERVER-IPADDR", bkpinfo->tmpdir);
    12561271    write_one_liner_data_file(tmp, nfs_server_ipaddr);
     
    12591274    sprintf(tmp, "%s/NFS-SERVER-PATH", bkpinfo->tmpdir);
    12601275    write_one_liner_data_file(tmp, bkpinfo->nfs_remote_dir);
     1276    sprintf(tmp, "%s/ISO-PREFIX", bkpinfo->tmpdir);
     1277    write_one_liner_data_file(tmp, bkpinfo->prefix);
    12611278    log_it("Finished storing NFS configuration");
    12621279}
  • trunk/mondo/mondo/common/libmondo-tools.c

    r146 r149  
    607607        log_it("isodir: %s", iso_path);
    608608        paranoid_free(iso_path);
    609 
     609        asprintf(&tmp, "%s/ISO-PREFIX", bkpinfo->tmpdir);
     610        write_one_liner_data_file(tmp, bkpinfo->prefix);
     611        log_it("iso-prefix: %s",  bkpinfo->prefix);
     612        paranoid_free(tmp);
    610613/* End patch */
    611614    }                           // end of iso code
     
    743746        strcpy(bkpinfo->isodir, "/root/images/mondo");
    744747    }
    745     strcpy(bkpinfo->prefix, "mondorescue");
     748    strcpy(bkpinfo->prefix, STD_PREFIX);
    746749
    747750    bkpinfo->scratchdir[0] = '\0';
     
    10411044        return (0);
    10421045    } else {
    1043         asprintf(&command, "cat %s | grep \"%s .*\" | cut -d' ' -f2,3,4,5",
    1044                  config_file, label);
     1046        asprintf(&command, "grep '%s .*' %s| cut -d' ' -f2,3,4,5",
     1047                label, config_file);
    10451048        strcpy(value, call_program_and_get_last_line_of_output(command));
    10461049        paranoid_free(command);
     
    12751278             ("mktemp -q /tmp/mojo-jojo.blah.XXXXXX"));
    12761279    if (does_file_exist(config_file)) {
    1277         asprintf(&command, "cat %s | grep -vx \"%s .*\" > %s", config_file,
    1278                  label, tempfile);
     1280        asprintf(&command, "grep -vx '%s .*' %s > %s",
     1281                label, config_file, tempfile);
    12791282        paranoid_system(command);
    12801283        paranoid_free(command);
  • trunk/mondo/mondo/common/my-stuff.h

    r146 r149  
    8080
    8181#define IA64_BOOT_SIZE "8192"   /* Should be coherent with mindi */
     82#define STD_PREFIX "mondorescue"    /* Should be coherent with mindi */
    8283
    8384/**
  • trunk/mondo/mondo/mondorestore/mondo-rstr-tools.c

    r142 r149  
    737737        }
    738738#ifdef __FreeBSD__
    739         sprintf(mount_cmd, "/mnt/isodir/%s/%s/%d.iso", bkpinfo->isodir,
    740                 bkpinfo->nfs_remote_dir, g_current_media_number);
     739        sprintf(mount_cmd, "/mnt/isodir/%s/%s/%s-%d.iso", bkpinfo->isodir,
     740                bkpinfo->nfs_remote_dir, bkpinfo->prefix, g_current_media_number);
    741741        mddev = make_vn(mount_cmd);
    742742        sprintf(mount_cmd, "mount_cd9660 -r %s " MNT_CDROM, mddev);
    743743#else
    744         sprintf(mount_cmd, "mount %s/%s/%d.iso -t iso9660 -o loop,ro %s",
     744        sprintf(mount_cmd, "mount %s/%s/%s-%d.iso -t iso9660 -o loop,ro %s",
    745745                bkpinfo->isodir, bkpinfo->nfs_remote_dir,
    746                 g_current_media_number, MNT_CDROM);
     746                bkpinfo->prefix, g_current_media_number, MNT_CDROM);
    747747#endif
    748748
    749749    } else if (bkpinfo->backup_media_type == iso) {
    750750#ifdef __FreeBSD__
    751         sprintf(mount_cmd, "%s/%d.iso", bkpinfo->isodir,
    752                 g_current_media_number);
     751        sprintf(mount_cmd, "%s/%s-%d.iso", bkpinfo->isodir,
     752                bkpinfo->prefix, g_current_media_number);
    753753        mddev = make_vn(mount_cmd);
    754754        sprintf(mount_cmd, "mount_cd9660 -r %s %s", mddev, MNT_CDROM);
    755755#else
    756         sprintf(mount_cmd, "mount %s/%d.iso -t iso9660 -o loop,ro %s",
    757                 bkpinfo->isodir, g_current_media_number, MNT_CDROM);
     756        sprintf(mount_cmd, "mount %s/%s-%d.iso -t iso9660 -o loop,ro %s",
     757                bkpinfo->isodir, bkpinfo->prefix, g_current_media_number, MNT_CDROM);
    758758#endif
    759759    } else if (strstr(bkpinfo->media_device, "/dev/"))
     
    10351035                } else {
    10361036                    bkpinfo->backup_media_type = iso;
     1037                    if (read_cfg_var(cfg_file, "iso-prefix", value) == 0) {
     1038                            strcpy(bkpinfo->prefix,value);
     1039                    } else {
     1040                            strcpy(bkpinfo->prefix,STD_PREFIX);
     1041                    }
    10371042                }
    10381043            }
    10391044        } else if (!strcmp(value, "nfs")) {
    10401045            bkpinfo->backup_media_type = nfs;
     1046            if (read_cfg_var(cfg_file, "iso-prefix", value) == 0) {
     1047                    strcpy(bkpinfo->prefix,value);
     1048            } else {
     1049                    strcpy(bkpinfo->prefix,STD_PREFIX);
     1050            }
    10411051        } else if (!strcmp(value, "tape")) {
    10421052            bkpinfo->backup_media_type = tape;
     
    12011211                }
    12021212            }
    1203             /* bkpinfo->isodir should now be the true path to 1.iso etc... */
     1213            /* bkpinfo->isodir should now be the true path to prefix-1.iso etc... */
    12041214            if (bkpinfo->backup_media_type == iso) {
    12051215                sprintf(bkpinfo->isodir, "%s%s", iso_mnt, iso_path);
Note: See TracChangeset for help on using the changeset viewer.