Changeset 148 in MondoRescue for branches/2.05/mondo


Ignore:
Timestamp:
Dec 2, 2005, 8:22:32 PM (18 years ago)
Author:
bcornec
Message:
  • Bug on USB keyboard corrected
  • PXE mode reviewed (netmask and route management added in start-nfs)
  • -p option with PXE doesn't require a parameter anymore and it now works with the parameter
  • -p option should work correctly with iso and nfs modes
  • cosmetic messages improvement for mindi
  • use STD_PREFIX
Location:
branches/2.05/mondo/mondo
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2.05/mondo/mondo/common/libmondo-files.c

    r144 r148  
    11881188    char nfs_mount[MAX_STR_LEN];
    11891189    char nfs_client_ipaddr[MAX_STR_LEN];
     1190    char nfs_client_netmask[MAX_STR_LEN];
     1191    char nfs_client_defgw[MAX_STR_LEN];
    11901192    char nfs_server_ipaddr[MAX_STR_LEN];
    11911193    char tmp[MAX_STR_LEN];
     
    12151217    strcpy(nfs_client_ipaddr,
    12161218           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));
    12171227    sprintf(tmp,
    12181228            "nfs_client_ipaddr=%s; nfs_server_ipaddr=%s; nfs_mount=%s",
     
    12291239    }
    12301240    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);
    12331244    fprintf(fout, "ping -c 1 %s # ping server\n", nfs_server_ipaddr);
    12341245    fprintf(fout, "mount -t nfs -o nolock %s /tmp/isodir\n",
     
    12491260    sprintf(tmp, "%s/NFS-CLIENT-IPADDR", bkpinfo->tmpdir);
    12501261    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);
    12511266    sprintf(tmp, "%s/NFS-SERVER-IPADDR", bkpinfo->tmpdir);
    12521267    write_one_liner_data_file(tmp, nfs_server_ipaddr);
     
    12551270    sprintf(tmp, "%s/NFS-SERVER-PATH", bkpinfo->tmpdir);
    12561271    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);
    12571274    log_it("Finished storing NFS configuration");
    12581275}
  • branches/2.05/mondo/mondo/common/libmondo-tools.c

    r128 r148  
    826826        write_one_liner_data_file(tmp, iso_path);
    827827        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);
    828831
    829832/* End patch */
     
    969972        strcpy(bkpinfo->isodir, "/root/images/mondo");
    970973    }
    971     strcpy(bkpinfo->prefix, "mondorescue");
     974    strcpy(bkpinfo->prefix, STD_PREFIX);
    972975
    973976    bkpinfo->scratchdir[0] = '\0';
     
    12611264        return (0);
    12621265    } 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);
    12651268        strcpy(value, call_program_and_get_last_line_of_output(command));
    12661269        if (strlen(value) == 0) {
     
    14771480           ("mktemp -q /tmp/mojo-jojo.blah.XXXXXX"));
    14781481    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);
    14811484        paranoid_system(command);
    14821485    }
  • branches/2.05/mondo/mondo/common/my-stuff.h

    r141 r148  
    212212
    213213#define IA64_BOOT_SIZE "8192"   /* Should be coherent with mindi */
     214#define STD_PREFIX "mondorescue"    /* Should be coherent with mindi */
    214215
    215216/**
  • branches/2.05/mondo/mondo/mondorestore/mondo-rstr-tools.c

    r128 r148  
    735735        }
    736736#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);
    739739        mddev = make_vn(mount_cmd);
    740740        sprintf(mount_cmd, "mount_cd9660 -r %s " MNT_CDROM, mddev);
    741741#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",
    743743                bkpinfo->isodir, bkpinfo->nfs_remote_dir,
    744                 g_current_media_number, MNT_CDROM);
     744                bkpinfo->prefix, g_current_media_number, MNT_CDROM);
    745745#endif
    746746
     
    748748     if (bkpinfo->backup_media_type == iso) {
    749749#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);
    752752        mddev = make_vn(mount_cmd);
    753753        sprintf(mount_cmd, "mount_cd9660 -r %s %s", mddev, MNT_CDROM);
    754754#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);
    757757#endif
    758758    } else if (strstr(bkpinfo->media_device, "/dev/"))
     
    10341034                } else {
    10351035                    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                    }
    10361041                }
    10371042            }
    10381043        } else if (!strcmp(value, "nfs")) {
    10391044            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            }
    10401050        } else if (!strcmp(value, "tape")) {
    10411051            bkpinfo->backup_media_type = tape;
     
    12001210                }
    12011211            }
    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... */
    12031213            if (bkpinfo->backup_media_type == iso) {
    12041214                sprintf(bkpinfo->isodir, "%s%s", iso_mnt, iso_path);
Note: See TracChangeset for help on using the changeset viewer.