- Timestamp:
- Nov 19, 2019, 1:25:56 PM (5 years ago)
- Location:
- branches/3.3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mindi/mindi
r3744 r3746 134 134 if [ -d "/sys/firmware/efi" ]; then 135 135 BOOT_TYPE="UEFI" 136 else 137 # Find MBR in case of bootable USB device to build 138 MBRFILE=/usr/lib/syslinux/mbr.bin 139 [ ! -r "$MBRFILE" ] && MBRFILE=/usr/lib64/syslinux/mbr.bin 140 [ ! -r "$MBRFILE" ] && MBRFILE=/usr/share/syslinux/mbr.bin 141 [ ! -r "$MBRFILE" ] && MBRFILE=/usr/share/lib/syslinux/mbr.bin 142 [ ! -r "$MBRFILE" ] && MBRFILE=/usr/share/lib64/syslinux/mbr.bin 143 fi 136 fi 137 138 # Find MBR file in case of bootable USB device to build and for restoring it 139 MBRFILE=/usr/lib/syslinux/mbr.bin 140 [ ! -r "$MBRFILE" ] && MBRFILE=/usr/lib64/syslinux/mbr.bin 141 [ ! -r "$MBRFILE" ] && MBRFILE=/usr/share/syslinux/mbr.bin 142 [ ! -r "$MBRFILE" ] && MBRFILE=/usr/share/lib/syslinux/mbr.bin 143 [ ! -r "$MBRFILE" ] && MBRFILE=/usr/share/lib64/syslinux/mbr.bin 144 145 # Find GPTMBR in case of bootable USB device to build and for restoring it 146 GPTMBRFILE=/usr/lib/syslinux/gptmbr.bin 147 [ ! -r "$GPTMBRFILE" ] && GPTMBRFILE=/usr/lib64/syslinux/gptmbr.bin 148 [ ! -r "$GPTMBRFILE" ] && GPTMBRFILE=/usr/share/syslinux/gptmbr.bin 149 [ ! -r "$GPTMBRFILE" ] && GPTMBRFILE=/usr/share/lib/syslinux/gptmbr.bin 150 [ ! -r "$GPTMBRFILE" ] && GPTMBRFILE=/usr/share/lib64/syslinux/gptmbr.bin 144 151 145 152 # Function to log on screen only … … 2439 2446 cp -pRdf $MINDI_TMP/$q $bigdir/tmp 2>> $LOGFILE 2440 2447 done 2448 for q in $MBRFILE $GPTMBRFILE; do 2449 if [ -r $q ]; then 2450 cp -a $q $bigdir/tmp 2>> $LOGFILE 2451 else 2452 LogFile "Unable to copy $q to bigdir. May be unable to restore MBR" 2453 fi 2454 done 2441 2455 fi 2442 2456 … … 3370 3384 $FDISK -l >> $LOGFILE 3371 3385 LogFile "----------------" 3386 LogFile "MBRFILE = $MBRFILE" 3387 LogFile "GPTMBRFILE = $GPTMBRFILE" 3372 3388 3373 3389 # Compute libata version -
branches/3.3/mondo/src/common/libmondo-archive.c
r3650 r3746 629 629 } 630 630 bootldr_ver = call_program_and_get_last_line_of_output("grub --version 2> /dev/null"); 631 if (strcmp(bootldr_ver,"") == 0) {631 if (strcmp(bootldr_ver,"") == 0) { 632 632 mr_free(bootldr_ver); 633 633 bootldr_ver = call_program_and_get_last_line_of_output("grub2-install --version"); -
branches/3.3/mondo/src/common/libmondo-devices.c
r3719 r3746 2515 2515 } 2516 2516 } 2517 /* TODO: Useless I think */ 2517 2518 if (bkpinfo->disaster_recovery) { 2518 2519 mr_asprintf(command ,"umount %s/isodir 2> /dev/null", bkpinfo->tmpdir); -
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.