Changeset 1581 in MondoRescue for branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c
- Timestamp:
- Jul 27, 2007, 2:11:55 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c
r1556 r1581 2081 2081 2082 2082 /** 2083 * Get the configuration file from the floppy,tape, or CD.2083 * Get the configuration file from the tape, or CD. 2084 2084 * @param bkpinfo The backup information structure. Fields used: 2085 2085 * - @c bkpinfo->backup_media_type … … 2122 2122 mr_msg(2, "mountpt = %s; cfg_file=%s", mountpt, cfg_file); 2123 2123 2124 /* Floppy? */2125 mr_asprintf(&tmp, "mkdir -p %s", mountpt);2126 run_program_and_log_output(tmp, FALSE);2127 mr_free(tmp);2128 2129 2124 mr_asprintf(&tmp, "mkdir -p %s/tmp", bkpinfo->tmpdir); 2130 2125 run_program_and_log_output(tmp, FALSE); 2131 2126 mr_free(tmp); 2132 2127 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_ramdisk2172 (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 }2183 2128 if (!does_file_exist(cfg_file)) { 2184 2129 mr_msg(2, "gcffa --- we don't have cfg file yet."); … … 2232 2177 if (!does_file_exist("tmp/mondo-restore.cfg")) { 2233 2178 log_to_screen(_ 2234 ("Cannot find config info on tape/CD /floppy"));2179 ("Cannot find config info on tape/CD")); 2235 2180 return (1); 2236 2181 } 2237 2182 } else { 2238 /* BERLIOS : Useless ? */2239 /* That boot image doesn't always exist where the following method always works2240 log_msg(2,2241 "gcffa --- looking at mounted CD for mindi-boot.2880.img");2242 mr_asprintf(&command,2243 "mount " MNT_CDROM2244 "/images/mindi-boot.2880.img -o loop %s", mountpt);2245 */2246 2183 mr_asprintf(&mounted_cfgf_path, "%s/%s", mountpt, cfg_file); 2247 2184 if (!does_file_exist(mounted_cfgf_path)) {
Note:
See TracChangeset
for help on using the changeset viewer.