Changeset 3746 in MondoRescue for branches/3.3/mondo/src/mondorestore
- Timestamp:
- Nov 19, 2019, 1:25:56 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mondo/src/mondorestore/mondo-rstr-tools.c
r3743 r3746 9 9 #include "mr_str.h" 10 10 #include "mr_file.h" 11 #include "mr_sys.h" 11 12 #include "../common/mondostructures.h" 12 13 #include "../common/libmondo.h" … … 1282 1283 /** malloc *******/ 1283 1284 char *device = NULL; 1285 char *disk = NULL; 1284 1286 char *name = NULL; 1287 char *type = NULL; 1285 1288 char *cmd = NULL; 1286 1289 1287 1290 malloc_string(device); 1288 1291 malloc_string(name); 1292 malloc_string(type); 1289 1293 1290 1294 /* In order to have a working bootloader, we need to have all devices … … 1294 1298 mr_asprintf(cmd,"tar cf - /dev | ( cd %s ; tar xf - )",MNT_RESTORING); 1295 1299 run_program_and_log_output(cmd, 3); 1296 paranoid_free(cmd);1300 mr_free(cmd); 1297 1301 1298 1302 backup_crucial_file(MNT_RESTORING, "/etc/fstab"); … … 1307 1311 read_cfg_var(g_mondo_cfg_file, "bootloader.device", device); 1308 1312 read_cfg_var(g_mondo_cfg_file, "bootloader.name", name); 1309 log_msg(2, "run_boot_loader: device='%s', name='%s'", device, name); 1313 read_cfg_var(g_mondo_cfg_file, "boot-type", type); 1314 log_msg(2, "run_boot_loader: device='%s', name='%s', type='%s'", device, name, type); 1310 1315 sync(); 1311 1316 1312 1317 offer_to_make_initrd(); 1318 1319 disk = truncate_to_drive_name(device); 1320 if (strcmp(type,"BIOS") == 0) { 1321 // Force installation of a MBR bootloader brought by mindi on the disk 1322 // in case none was available and we then start from a partition 1323 log_msg(2, "Reinstalling mbr.bin on %s", disk); 1324 mr_system("dd bs=440 count=1 conv=notrunc if=/tmp/mbr.bin of=%s &> /dev/null",disk); 1325 } else { 1326 // Same for GPT 1327 log_msg(2, "Reinstalling gptmbr.bin on %s", disk); 1328 mr_system("dd bs=440 count=1 conv=notrunc if=/tmp/gptmbr.bin of=%s &> /dev/null",disk); 1329 } 1330 1331 // Now reinstall bootloader 1313 1332 if (!strcmp(name, "LILO")) { 1314 1333 res = run_lilo(offer_to_hack_scripts);
Note:
See TracChangeset
for help on using the changeset viewer.