Changeset 3829 in MondoRescue for branches/3.3/mondo/src
- Timestamp:
- Mar 4, 2024, 5:11:25 PM (15 months ago)
- Location:
- branches/3.3/mondo/src/common
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mondo/src/common/libmondo-cli.c
r3827 r3829 672 672 673 673 if ((flag_set['k']) && (! bkpinfo->restore_data)) { 674 strncpy(bkpinfo->kernel_path, flag_val['k'], MAX_STR_LEN);674 mr_asprintf(bkpinfo->kernel_path, "%s", flag_val['k']); 675 675 if (!does_file_exist(bkpinfo->kernel_path)) { 676 676 retval++; -
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 -
branches/3.3/mondo/src/common/libmondo-fork.c
r3728 r3829 34 34 * Call a program and retrieve its last line of output. 35 35 * @param call The program to run. 36 * @return The last line of its output .36 * @return The last line of its output or the empty string. 37 37 * @note The returned value points to storage that needs to be freed by the 38 38 * caller -
branches/3.3/mondo/src/common/libmondo-tools.c
r3828 r3829 855 855 bkpinfo->call_burn_iso = NULL; 856 856 bkpinfo->call_after_iso = NULL; 857 bkpinfo->kernel_path [0] = '\0';857 bkpinfo->kernel_path = NULL; 858 858 bkpinfo->netfs_mount = NULL; 859 859 bkpinfo->netfs_proto = NULL; -
branches/3.3/mondo/src/common/mondostructures.h
r3828 r3829 560 560 * Path to the user's kernel 561 561 */ 562 char kernel_path[MAX_STR_LEN];562 char *kernel_path; 563 563 564 564 /** -
branches/3.3/mondo/src/common/newt-specific.c
r3828 r3829 436 436 mr_free(bkpinfo->call_before_iso); 437 437 mr_free(bkpinfo->restore_path); 438 mr_free(bkpinfo->kernel_path); 438 439 /* Then free the structure */ 439 440 paranoid_free(bkpinfo);
Note:
See TracChangeset
for help on using the changeset viewer.