Changeset 3829 in MondoRescue for branches/3.3/mondo/src/common/libmondo-files.c
- Timestamp:
- Mar 4, 2024, 5:11:25 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mondo/src/common/libmondo-files.c
r3826 r3829 269 269 * don't do anything. 270 270 * @param kernel Where to put the found kernel. 271 * @return 0 for success , 1 for failure.271 * @return 0 for success aborts otherwise 272 272 */ 273 273 int figure_out_kernel_path_interactively_if_necessary(char *kernel) … … 276 276 char *command = NULL; 277 277 278 if (!kernel[0]) { 279 tmp = call_program_and_get_last_line_of_output("mindi --findkernel 2> /dev/null"); 280 strcpy(kernel, tmp); 281 mr_free(tmp); 278 if (kernel == NULL) { 279 kernel = call_program_and_get_last_line_of_output("mindi --findkernel 2> /dev/null"); 282 280 } 283 281 // If we didn't get anything back, check whether mindi raised a fatal error 284 if ( !kernel[0]) {282 if (strcmp(kernel,"") == 0) { 285 283 mr_asprintf(command, "grep 'Fatal error' %s", MINDI_LOGFILE); 286 284 tmp = call_program_and_get_last_line_of_output(command); … … 295 293 } else { 296 294 // If we've found the kernel, allow sysadmin to modify it if he wants 297 if (!g_text_mode) { 298 if (!popup_and_get_string("Kernel path", "We found this full path name for your kernel. You should just use it in most cases", kernel, MAX_STR_LEN / 4)) { 299 fatal_error("Kernel not found. Please specify with the '-k' flag."); 295 while ((kernel == NULL) || (strcmp(kernel,"") == 0)) { 296 if (!g_text_mode) { 297 tmp = mr_popup_and_get_string("Kernel path", "We found this full path name for your kernel. You should just use it in most cases", kernel); 298 if (tmp == NULL) { 299 fatal_error("Kernel not found. Please specify with the '-k' flag."); 300 } else { 301 mr_free(kernel); 302 kernel = tmp; 303 } 300 304 } 301 305 } … … 304 308 305 309 log_it("Calling Mindi with kernel path of '%s'", kernel); 306 while (!kernel[0]) { 307 if (!ask_me_yes_or_no("Kernel not found or invalid. Choose another?")) { 308 return (1); 309 } 310 if (!popup_and_get_string("Kernel path", "What is the full path and filename of your kernel, please?", kernel, MAX_STR_LEN / 4)) { 311 fatal_error("Kernel not found. Please specify with the '-k' flag."); 312 } 313 log_it("User says kernel is at %s", kernel); 314 } 315 return (0); 310 return(0); 316 311 } 317 312
Note:
See TracChangeset
for help on using the changeset viewer.