Changeset 1669 for branches/stable


Ignore:
Timestamp:
Sep 30, 2007, 8:16:06 PM (12 years ago)
Author:
bruno
Message:

use conf file for kernel_path

Location:
branches/stable/mondo
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/distributions/conf/mondo.conf.dist

    r1639 r1669  
    9191#mondorescue_kernel="/boot/vmlinuz.special"
    9292
     93# DONE
    9394#
    9495# Additional modules to support
  • branches/stable/mondo/src/common/libmondo-archive.c

    r1663 r1669  
    474474    copy_mondo_and_mindi_stuff_to_scratchdir(); // payload, too, if it exists
    475475#if __FreeBSD__ == 5
    476     strcpy(bkpinfo->kernel_path, "/boot/kernel/kernel");
     476    mr_allocstr(bkpinfo->kernel_path, "/boot/kernel/kernel");
    477477#elif __FreeBSD__ == 4
    478     strcpy(bkpinfo->kernel_path, "/kernel");
     478    mr_allocstr(bkpinfo->kernel_path, "/kernel");
    479479#elif linux
    480480    if (figure_out_kernel_path_interactively_if_necessary
     
    763763    fd1 = mr_fopen(MONDORESTORECFG, "a");
    764764
     765    mr_fprintf(fd, "mindi_use_own_kernel=yes\n");
     766    if (strcmp(mr_conf->mondo_kernel,"FAILSAFE") == 0) {
     767    } else {
     768    }
    765769    mr_fprintf(fd, "mindi_kernel=%s\n", bkpinfo->kernel_path);
    766     mr_fprintf(fd, "mindi_use_own_kernel=yes\n");
    767770
    768771    mr_fprintf(fd1, "files-in-filelist=%ld\n", lines_in_filelist);
     
    868871    } else {
    869872        mr_fprintf(fd1, "differential=no\n");
     873    }
     874    if (mr_conf->mondo_create_mindi_cd) {
     875        mr_fprintf(fd1, "mindi_write_cd=yes\n");
     876    } else {
     877        mr_fprintf(fd1, "mindi_write_cd=no\n");
    870878    }
    871879
  • branches/stable/mondo/src/common/libmondo-devices.c

    r1663 r1669  
    19881988#endif
    19891989        {
    1990             strcpy(bkpinfo->kernel_path, "FAILSAFE");
     1990            mr_allocstr(bkpinfo->kernel_path, "FAILSAFE");
    19911991        }
    19921992
  • branches/stable/mondo/src/common/libmondo-files.c

    r1663 r1669  
    250250    char *command = NULL;
    251251
    252     malloc_string(tmp);
    253     if (!kernel[0]) {
    254         strcpy(kernel,
     252    if (kernel == NULL) {
     253        mr_allocstr(kernel,
    255254               call_program_and_get_last_line_of_output
    256255               ("mindi --findkernel 2> /dev/null"));
    257256    }
    258257    // If we didn't get anything back, check whether mindi raised a fatal error
    259     if (!kernel[0]) {
     258    if (kernel == NULL) {
    260259        mr_asprintf(&command, "grep 'Fatal error' /var/log/mindi.log");
    261         strcpy(tmp, call_program_and_get_last_line_of_output(command));
     260        mr_asprintf(&tmp, call_program_and_get_last_line_of_output(command));
    262261        if (strlen(tmp) > 1) {
    263262            popup_and_OK(tmp);
     
    265264        }
    266265        mr_free(command);
     266        mr_free(tmp);
    267267    }
    268268    log_it("Calling Mindi with kernel path of '%s'", kernel);
    269     while (!kernel[0]) {
     269    while (kernel == NULL) {
    270270        if (!ask_me_yes_or_no
    271271            ("Kernel not found or invalid. Choose another?")) {
  • branches/stable/mondo/src/common/libmondo-tools.c

    r1663 r1669  
    740740
    741741    bkpinfo->media_size = mr_conf->iso_burning_speed;
     742    mr_asprintf(&tmp,mr_conf->kernel);
     743    bkpinfo->kernel_path = tmp;
     744
    742745    bkpinfo->boot_loader = '\0';
    743746    bkpinfo->boot_device[0] = '\0';
     
    773776    bkpinfo->image_devs[0] = '\0';
    774777    bkpinfo->postnuke_tarball[0] = '\0';
    775     bkpinfo->kernel_path[0] = '\0';
    776778    bkpinfo->nfs_mount[0] = '\0';
    777779    bkpinfo->nfs_remote_dir[0] = '\0';
  • branches/stable/mondo/src/common/mondostructures.h

    r1639 r1669  
    525525   * included with Mindi.
    526526   */
    527     char kernel_path[MAX_STR_LEN];
     527    char *kernel_path;
    528528
    529529  /**
  • branches/stable/mondo/src/mondoarchive/mondo-cli.c

    r1663 r1669  
    593593    }
    594594    if (flag_set['k']) {
    595         strncpy(bkpinfo->kernel_path, flag_val['k'], MAX_STR_LEN);
     595        mr_allocstr(bkpinfo->kernel_path, flag_val['k']);
    596596        if (!strcmp(bkpinfo->kernel_path, "failsafe")) {
    597             strcpy(bkpinfo->kernel_path, "FAILSAFE");
     597            mr_allocstr(bkpinfo->kernel_path, "FAILSAFE");
    598598        }
    599599        if (strcmp(bkpinfo->kernel_path, "FAILSAFE")
Note: See TracChangeset for help on using the changeset viewer.