Ignore:
Timestamp:
Jul 27, 2007, 2:11:55 AM (17 years ago)
Author:
Bruno Cornec
Message:

Continue to remove floppy support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c

    r1556 r1581  
    20812081
    20822082/**
    2083  * Get the configuration file from the floppy, tape, or CD.
     2083 * Get the configuration file from the tape, or CD.
    20842084 * @param bkpinfo The backup information structure. Fields used:
    20852085 * - @c bkpinfo->backup_media_type
     
    21222122    mr_msg(2, "mountpt = %s; cfg_file=%s", mountpt, cfg_file);
    21232123
    2124     /* Floppy? */
    2125     mr_asprintf(&tmp, "mkdir -p %s", mountpt);
    2126     run_program_and_log_output(tmp, FALSE);
    2127     mr_free(tmp);
    2128 
    21292124    mr_asprintf(&tmp, "mkdir -p %s/tmp", bkpinfo->tmpdir);
    21302125    run_program_and_log_output(tmp, FALSE);
    21312126    mr_free(tmp);
    21322127
    2133     mr_asprintf(&tmp, "%s", call_program_and_get_last_line_of_output("dmesg | grep -i floppy"));
    2134     if (strcmp(tmp, "")) {
    2135         mr_asprintf(&command, "mount /dev/fd0u1722 %s", mountpt);
    2136         mr_asprintf(&tmp,
    2137             "(sleep 15; kill `ps | grep \"%s\" | cut -d' ' -f1` 2> /dev/null) &",
    2138             command);
    2139         mr_msg(1, "tmp = '%s'", tmp);
    2140         system(tmp);
    2141         mr_free(tmp);
    2142 
    2143         res = run_program_and_log_output(command, FALSE);
    2144         mr_free(command);
    2145 
    2146         if (res) {
    2147             mr_asprintf(&command, "mount /dev/fd0H1440 %s", mountpt);
    2148             res = run_program_and_log_output(command, FALSE);
    2149             mr_free(command);
    2150         }
    2151     } else {
    2152         res = 1;
    2153     }
    2154     if (res) {
    2155         try_plan_B = TRUE;
    2156     } else {
    2157         try_plan_B = TRUE;
    2158         mr_msg(2,
    2159                 "Mounted floppy OK but I don't trust it because the archives might contain more up-to-date config file than the floppy does.");
    2160         // NB: If busybox does not support 'mount -o loop' then Plan A WILL NOT WORK.
    2161         mr_msg(2, "Processing floppy (plan A?)");
    2162         mr_asprintf(&ramdisk_fname, "%s/mindi.rdz", mountpt);
    2163         if (!does_file_exist(ramdisk_fname)) {
    2164             mr_free(ramdisk_fname);
    2165             mr_asprintf(&ramdisk_fname, "%s/initrd.img", mountpt);
    2166         }
    2167         if (!does_file_exist(ramdisk_fname)) {
    2168             mr_msg(2,
    2169                     "Cannot find ramdisk file on mountpoint. Are you sure that's a boot disk in the drive?");
    2170         }
    2171         if (extract_config_file_from_ramdisk
    2172             (bkpinfo, ramdisk_fname, cfg_file, mountlist_file)) {
    2173             mr_msg(2,
    2174                     "Warning - failed to extract config file from ramdisk. I think this boot disk is mangled.");
    2175         }
    2176         mr_asprintf(&command, "umount %s", mountpt);
    2177         run_program_and_log_output(command, 5);
    2178         mr_free(command);
    2179 
    2180         unlink(ramdisk_fname);
    2181         mr_free(ramdisk_fname);
    2182     }
    21832128    if (!does_file_exist(cfg_file)) {
    21842129        mr_msg(2, "gcffa --- we don't have cfg file yet.");
     
    22322177            if (!does_file_exist("tmp/mondo-restore.cfg")) {
    22332178                log_to_screen(_
    2234                               ("Cannot find config info on tape/CD/floppy"));
     2179                              ("Cannot find config info on tape/CD"));
    22352180                return (1);
    22362181            }
    22372182        } else {
    2238             /* BERLIOS : Useless ? */
    2239             /* That boot image doesn't always exist where the following method always works
    2240             log_msg(2,
    2241                     "gcffa --- looking at mounted CD for mindi-boot.2880.img");
    2242             mr_asprintf(&command,
    2243                     "mount " MNT_CDROM
    2244                     "/images/mindi-boot.2880.img -o loop %s", mountpt);
    2245                     */
    22462183            mr_asprintf(&mounted_cfgf_path, "%s/%s", mountpt, cfg_file);
    22472184            if (!does_file_exist(mounted_cfgf_path)) {
Note: See TracChangeset for help on using the changeset viewer.