- Add the option to write only the VBR so FreeLoader can easily be chain loaded by GRUB or another boot loader
- Dedicated to James Tabor :)

svn path=/trunk/; revision=48703
This commit is contained in:
Cameron Gutman 2010-09-05 17:09:18 +00:00
parent 113c47805c
commit 38a87f0176
21 changed files with 211 additions and 63 deletions

View file

@ -2156,6 +2156,28 @@ InstallFatBootcodeToPartition(PUNICODE_STRING SystemRootPath,
#endif
}
NTSTATUS
InstallVBRToPartition(PUNICODE_STRING SystemRootPath,
PUNICODE_STRING SourceRootPath,
PUNICODE_STRING DestinationArcPath,
UCHAR PartitionType)
{
if ((PartitionType == PARTITION_FAT_12) ||
(PartitionType == PARTITION_FAT_16) ||
(PartitionType == PARTITION_HUGE) ||
(PartitionType == PARTITION_XINT13) ||
(PartitionType == PARTITION_FAT32) ||
(PartitionType == PARTITION_FAT32_XINT13))
{
return InstallFatBootcodeToPartition(SystemRootPath,
SourceRootPath,
DestinationArcPath,
PartitionType);
}
return STATUS_UNSUCCESSFUL;
}
NTSTATUS
InstallFatBootcodeToFloppy(PUNICODE_STRING SourceRootPath,

View file

@ -78,6 +78,12 @@ InstallFatBootcodeToPartition(PUNICODE_STRING SystemRootPath,
PUNICODE_STRING DestinationArcPath,
UCHAR PartitionType);
NTSTATUS
InstallVBRToPartition(PUNICODE_STRING SystemRootPath,
PUNICODE_STRING SourceRootPath,
PUNICODE_STRING DestinationArcPath,
UCHAR PartitionType);
NTSTATUS
InstallFatBootcodeToFloppy(PUNICODE_STRING SourceRootPath,
PUNICODE_STRING DestinationArcPath);

View file

@ -3480,7 +3480,7 @@ BootLoaderPage(PINPUT_RECORD Ir)
/* Unattended install on hdd? */
if (IsUnattendedSetup && UnattendMBRInstallType == 2)
{
return BOOT_LOADER_HARDDISK_PAGE;
return BOOT_LOADER_HARDDISK_MBR_PAGE;
}
MUIDisplayPage(BOOT_LOADER_PAGE);
@ -3497,9 +3497,9 @@ BootLoaderPage(PINPUT_RECORD Ir)
Line++;
if (Line<12)
Line=14;
Line=15;
if (Line>14)
if (Line>15)
Line=12;
CONSOLE_InvertTextXY(8, Line, 60, 1);
@ -3511,9 +3511,9 @@ BootLoaderPage(PINPUT_RECORD Ir)
Line--;
if (Line<12)
Line=14;
Line=15;
if (Line>14)
if (Line>15)
Line=12;
CONSOLE_InvertTextXY(8, Line, 60, 1);
@ -3530,13 +3530,17 @@ BootLoaderPage(PINPUT_RECORD Ir)
{
if (Line == 12)
{
return BOOT_LOADER_HARDDISK_PAGE;
return BOOT_LOADER_HARDDISK_MBR_PAGE;
}
else if (Line == 13)
{
return BOOT_LOADER_FLOPPY_PAGE;
return BOOT_LOADER_HARDDISK_VBR_PAGE;
}
else if (Line == 14)
{
return BOOT_LOADER_FLOPPY_PAGE;
}
else if (Line == 15)
{
return SUCCESS_PAGE;
}
@ -3592,9 +3596,30 @@ BootLoaderFloppyPage(PINPUT_RECORD Ir)
return BOOT_LOADER_FLOPPY_PAGE;
}
static PAGE_NUMBER
BootLoaderHarddiskVbrPage(PINPUT_RECORD Ir)
{
UCHAR PartitionType;
NTSTATUS Status;
PartitionType = PartitionList->ActiveBootPartition->
PartInfo[PartitionList->ActiveBootPartitionNumber].PartitionType;
Status = InstallVBRToPartition(&SystemRootPath,
&SourceRootPath,
&DestinationArcPath,
PartitionType);
if (!NT_SUCCESS(Status))
{
MUIDisplayError(ERROR_WRITE_BOOT, Ir, POPUP_WAIT_ENTER);
return QUIT_PAGE;
}
return SUCCESS_PAGE;
}
static PAGE_NUMBER
BootLoaderHarddiskPage(PINPUT_RECORD Ir)
BootLoaderHarddiskMbrPage(PINPUT_RECORD Ir)
{
UCHAR PartitionType;
NTSTATUS Status;
@ -3604,24 +3629,12 @@ BootLoaderHarddiskPage(PINPUT_RECORD Ir)
/* Step 1: Write the VBR */
PartitionType = PartitionList->ActiveBootPartition->
PartInfo[PartitionList->ActiveBootPartitionNumber].PartitionType;
if ((PartitionType == PARTITION_FAT_12) ||
(PartitionType == PARTITION_FAT_16) ||
(PartitionType == PARTITION_HUGE) ||
(PartitionType == PARTITION_XINT13) ||
(PartitionType == PARTITION_FAT32) ||
(PartitionType == PARTITION_FAT32_XINT13))
{
Status = InstallFatBootcodeToPartition(&SystemRootPath,
&SourceRootPath,
&DestinationArcPath,
PartitionType);
if (!NT_SUCCESS(Status))
{
MUIDisplayError(ERROR_INSTALL_BOOTCODE, Ir, POPUP_WAIT_ENTER);
return QUIT_PAGE;
}
}
else
Status = InstallVBRToPartition(&SystemRootPath,
&SourceRootPath,
&DestinationArcPath,
PartitionType);
if (!NT_SUCCESS(Status))
{
MUIDisplayError(ERROR_WRITE_BOOT, Ir, POPUP_WAIT_ENTER);
return QUIT_PAGE;
@ -3915,8 +3928,12 @@ RunUSetup(VOID)
Page = BootLoaderFloppyPage(&Ir);
break;
case BOOT_LOADER_HARDDISK_PAGE:
Page = BootLoaderHarddiskPage(&Ir);
case BOOT_LOADER_HARDDISK_MBR_PAGE:
Page = BootLoaderHarddiskMbrPage(&Ir);
break;
case BOOT_LOADER_HARDDISK_VBR_PAGE:
Page = BootLoaderHarddiskVbrPage(&Ir);
break;
/* Repair pages */

View file

@ -995,18 +995,24 @@ static MUI_ENTRY bgBGBootLoaderEntries[] =
{
8,
12,
"‘« £ ­¥ ­  § ΰ¥¦¤ η ­  βΆκΰ¤¨ο ¤¨α<C2A8> (Ά MBR).",
"Install bootloader on the harddisk (MBR and VBR).",
TEXT_STYLE_NORMAL
},
{
8,
13,
"‘« £ ­¥ ­  § ΰ¥¦¤ η ­  ¤¨α<C2A8>¥β .",
"Install bootloader on the harddisk (VBR only).",
TEXT_STYLE_NORMAL
},
{
8,
14,
"‘« £ ­¥ ­  § à¥¦¤ ç ­  ¤¨áª¥â .",
TEXT_STYLE_NORMAL
},
{
8,
15,
"„  ­¥ ᥠ᫠£  § à¥¦¤ ç.",
TEXT_STYLE_NORMAL
},

View file

@ -993,18 +993,24 @@ static MUI_ENTRY csCZBootLoaderEntries[] =
{
8,
12,
"Nainstalovat zavad؟ na disk (MBR).",
"Install bootloader on the harddisk (MBR and VBR).",
TEXT_STYLE_NORMAL
},
{
8,
13,
"Nainstalovat zavad؟ na disketu.",
"Install bootloader on the harddisk (VBR only).",
TEXT_STYLE_NORMAL
},
{
8,
14,
"Nainstalovat zavad؟ na disketu.",
TEXT_STYLE_NORMAL
},
{
8,
15,
"PýeskoŸit instalaci zavadØŸe.",
TEXT_STYLE_NORMAL
},

View file

@ -986,18 +986,24 @@ static MUI_ENTRY deDEBootLoaderEntries[] =
{
8,
12,
"Boot-Loader auf der Festplatte installieren (Bootsektor).",
"Install bootloader on the harddisk (MBR and VBR).",
TEXT_STYLE_NORMAL
},
{
8,
13,
"Boot-Loader auf einer Diskette installieren.",
"Install bootloader on the harddisk (VBR only).",
TEXT_STYLE_NORMAL
},
{
8,
14,
"Boot-Loader auf einer Diskette installieren.",
TEXT_STYLE_NORMAL
},
{
8,
15,
"Boot-Loader nicht installieren.",
TEXT_STYLE_NORMAL
},

View file

@ -1009,18 +1009,24 @@ static MUI_ENTRY elGRBootLoaderEntries[] =
{
8,
12,
"„š¡˜«á©«˜©ž «¦¬ bootloader ©«¦ ©¡¢ž¨æ ›å©¡¦ (MBR).",
"Install bootloader on the harddisk (MBR and VBR).",
TEXT_STYLE_NORMAL
},
{
8,
13,
"„š¡˜«á©«˜©ž «¦¬ bootloader ©œ £ ˜ › ©¡â«˜.",
"Install bootloader on the harddisk (VBR only).",
TEXT_STYLE_NORMAL
},
{
8,
14,
"„š¡˜«á©«˜©ž «¦¬ bootloader ©œ £ ˜ › ©¡â«˜.",
TEXT_STYLE_NORMAL
},
{
8,
15,
"Œ˜ £ž šå¤œ  œš¡˜«á©«˜©ž «¦¬ bootloader.",
TEXT_STYLE_NORMAL
},

View file

@ -985,18 +985,24 @@ static MUI_ENTRY enUSBootLoaderEntries[] =
{
8,
12,
"Install bootloader on the harddisk (bootsector).",
"Install bootloader on the harddisk (MBR and VBR).",
TEXT_STYLE_NORMAL
},
{
8,
13,
"Install bootloader on a floppy disk.",
"Install bootloader on the harddisk (VBR only).",
TEXT_STYLE_NORMAL
},
{
8,
14,
"Install bootloader on a floppy disk.",
TEXT_STYLE_NORMAL
},
{
8,
15,
"Skip install bootloader.",
TEXT_STYLE_NORMAL
},

View file

@ -992,18 +992,24 @@ static MUI_ENTRY esESBootLoaderEntries[] =
{
8,
12,
"Instalar cargador de arranque en el disco duro (sector de boot).",
"Install bootloader on the harddisk (MBR and VBR).",
TEXT_STYLE_NORMAL
},
{
8,
13,
"Instalar cargador de inicio en un disquete.",
"Install bootloader on the harddisk (VBR only).",
TEXT_STYLE_NORMAL
},
{
8,
14,
"Instalar cargador de inicio en un disquete.",
TEXT_STYLE_NORMAL
},
{
8,
15,
"Omitir la instalaci¢n del cargador de arranque.",
TEXT_STYLE_NORMAL
},

View file

@ -985,18 +985,24 @@ static MUI_ENTRY etEEBootLoaderEntries[] =
{
8,
12,
"Paigalda alglaadur kävakettale (MBR).",
"Install bootloader on the harddisk (MBR and VBR).",
TEXT_STYLE_NORMAL
},
{
8,
13,
"Paigalda alglaadur flopikettale.",
"Install bootloader on the harddisk (VBR only).",
TEXT_STYLE_NORMAL
},
{
8,
14,
"Paigalda alglaadur flopikettale.",
TEXT_STYLE_NORMAL
},
{
8,
15,
"Žra paigalda alglaadurit.",
TEXT_STYLE_NORMAL
},

View file

@ -998,18 +998,24 @@ static MUI_ENTRY frFRBootLoaderEntries[] =
{
8,
12,
"Installer le chargeur de dmarrage sur le disque dur (MBR).",
"Install bootloader on the harddisk (MBR and VBR).",
TEXT_STYLE_NORMAL
},
{
8,
13,
"Installer le chargeur de dmarrage sur une disquette.",
"Install bootloader on the harddisk (VBR only).",
TEXT_STYLE_NORMAL
},
{
8,
14,
"Installer le chargeur de dmarrage sur une disquette.",
TEXT_STYLE_NORMAL
},
{
8,
15,
"Ne pas installer le chargeur de dmarrage.",
TEXT_STYLE_NORMAL
},

View file

@ -986,18 +986,24 @@ static MUI_ENTRY itITBootLoaderEntries[] =
{
8,
12,
"Installazione del bootloader sul disco fisso (settore di avvio).",
"Install bootloader on the harddisk (MBR and VBR).",
TEXT_STYLE_NORMAL
},
{
8,
13,
"Installazione del bootloader su un disco floppy.",
"Install bootloader on the harddisk (VBR only).",
TEXT_STYLE_NORMAL
},
{
8,
14,
"Installazione del bootloader su un disco floppy.",
TEXT_STYLE_NORMAL
},
{
8,
15,
"Salta l'installazione del bootloader.",
TEXT_STYLE_NORMAL
},

View file

@ -986,18 +986,24 @@ static MUI_ENTRY jaJPBootLoaderEntries[] =
{
8,
12,
"ブートローダヲ ハードディスク (ブートセクタ)ニ インストール スル。",
"Install bootloader on the harddisk (MBR and VBR).",
TEXT_STYLE_NORMAL
},
{
8,
13,
"ブートローダヲ フロッピー ディスクニ インストール スル。",
"Install bootloader on the harddisk (VBR only).",
TEXT_STYLE_NORMAL
},
{
8,
14,
"ÌÞ°ÄÛ°ÀÞ¦ ÌÛ¯Ëß° ÃÞ¨½¸Æ ²Ý½Ä°Ù ½Ù¡",
TEXT_STYLE_NORMAL
},
{
8,
15,
"ÌÞ°ÄÛ°ÀÞÉ ²Ý½Ä°Ù¦ ½·¯Ìß ½Ù¡",
TEXT_STYLE_NORMAL
},

View file

@ -995,18 +995,24 @@ static MUI_ENTRY ltLTBootLoaderEntries[] =
{
8,
12,
"Install bootloader on the harddisk (MBR).",
"Install bootloader on the harddisk (MBR and VBR).",
TEXT_STYLE_NORMAL
},
{
8,
13,
"Install bootloader on a floppy disk.",
"Install bootloader on the harddisk (VBR only).",
TEXT_STYLE_NORMAL
},
{
8,
14,
"Install bootloader on a floppy disk.",
TEXT_STYLE_NORMAL
},
{
8,
15,
"Skip install bootloader.",
TEXT_STYLE_NORMAL
},

View file

@ -1012,18 +1012,24 @@ static MUI_ENTRY nlNLBootLoaderEntries[] =
{
8,
12,
"Installeer de bootloader op de harde schijf (bootsector).",
"Install bootloader on the harddisk (MBR and VBR).",
TEXT_STYLE_NORMAL
},
{
8,
13,
"Installeer de bootloader op een floppy disk.",
"Install bootloader on the harddisk (VBR only).",
TEXT_STYLE_NORMAL
},
{
8,
14,
"Installeer de bootloader op een floppy disk.",
TEXT_STYLE_NORMAL
},
{
8,
15,
"Installeren bootloader overslaan.",
TEXT_STYLE_NORMAL
},

View file

@ -994,18 +994,24 @@ static MUI_ENTRY plPLBootLoaderEntries[] =
{
8,
12,
" Wgraj bootloader na dysk twardy (MBR).",
"Install bootloader on the harddisk (MBR and VBR).",
TEXT_STYLE_NORMAL
},
{
8,
13,
" Wgraj bootloader na dyskietk©.",
"Install bootloader on the harddisk (VBR only).",
TEXT_STYLE_NORMAL
},
{
8,
14,
" Wgraj bootloader na dyskietk©.",
TEXT_STYLE_NORMAL
},
{
8,
15,
" Pomiä wgrywanie bootloadera.",
TEXT_STYLE_NORMAL
},

View file

@ -986,18 +986,24 @@ static MUI_ENTRY ruRUBootLoaderEntries[] =
{
8,
12,
"αβ ­®Ά<EFBFBD>  ­  ¦¥αβ<CEB1>¨© ¤¨α<C2A8> (§ £ΰ㧮η­λ© α¥<CEB1>β®ΰ).",
"Install bootloader on the harddisk (MBR and VBR).",
TEXT_STYLE_NORMAL
},
{
8,
13,
"αβ ­®Ά<EFBFBD>  ­  £¨΅<C2A8>¨© ¤¨α<C2A8>.",
"Install bootloader on the harddisk (VBR only).",
TEXT_STYLE_NORMAL
},
{
8,
14,
"“áâ ­®¢ª  ­  £¨¡ª¨© ¤¨áª.",
TEXT_STYLE_NORMAL
},
{
8,
15,
"<EFBFBD>¥ ãáâ ­ ¢«¨¢ âì § £àã§ç¨ª.",
TEXT_STYLE_NORMAL
},

View file

@ -993,18 +993,24 @@ static MUI_ENTRY skSKBootLoaderEntries[] =
{
8,
12,
"Nainçtalovaś zav dzaź systmu na pevně disk (zav dzacˇ sektor).",
"Install bootloader on the harddisk (MBR and VBR).",
TEXT_STYLE_NORMAL
},
{
8,
13,
"Nainçtalovaś zav dzaź systmu na disketu.",
"Install bootloader on the harddisk (VBR only).",
TEXT_STYLE_NORMAL
},
{
8,
14,
"Nainçtalovaœ zav dzaŸ systmu na disketu.",
TEXT_STYLE_NORMAL
},
{
8,
15,
"PreskoŸiœ inçtal ciu zav dzaŸa systmu.",
TEXT_STYLE_NORMAL
},

View file

@ -986,18 +986,24 @@ static MUI_ENTRY svSEBootLoaderEntries[] =
{
8,
12,
"Install bootloader on the harddisk (MBR).",
"Install bootloader on the harddisk (MBR and VBR).",
TEXT_STYLE_NORMAL
},
{
8,
13,
"Install bootloader on a floppy disk.",
"Install bootloader on the harddisk (VBR only).",
TEXT_STYLE_NORMAL
},
{
8,
14,
"Install bootloader on a floppy disk.",
TEXT_STYLE_NORMAL
},
{
8,
15,
"Skip install bootloader.",
TEXT_STYLE_NORMAL
},

View file

@ -991,18 +991,24 @@ static MUI_ENTRY ukUABootLoaderEntries[] =
{
8,
12,
"‚áâ ­®¢¨â¨ bootloader ­  ¦®àá⪨© ¤¨áª (bootsector).",
"Install bootloader on the harddisk (MBR and VBR).",
TEXT_STYLE_NORMAL
},
{
8,
13,
"‚áâ ­®¢¨â¨ bootloader ­  ¤¨áª¥âã.",
"Install bootloader on the harddisk (VBR only).",
TEXT_STYLE_NORMAL
},
{
8,
14,
"‚áâ ­®¢¨â¨ bootloader ­  ¤¨áª¥âã.",
TEXT_STYLE_NORMAL
},
{
8,
15,
"<EFBFBD>¥ ¢áâ ­®¢«î¢ â¨ bootloader.",
TEXT_STYLE_NORMAL
},

View file

@ -108,7 +108,8 @@ typedef enum _PAGE_NUMBER
REGISTRY_PAGE,
BOOT_LOADER_PAGE,
BOOT_LOADER_FLOPPY_PAGE,
BOOT_LOADER_HARDDISK_PAGE,
BOOT_LOADER_HARDDISK_MBR_PAGE,
BOOT_LOADER_HARDDISK_VBR_PAGE,
REPAIR_INTRO_PAGE,