- 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
#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,
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);
/* Unattended install on hdd? */
if (IsUnattendedSetup && UnattendMBRInstallType == 2)
{
- return BOOT_LOADER_HARDDISK_PAGE;
+ return BOOT_LOADER_HARDDISK_MBR_PAGE;
}
MUIDisplayPage(BOOT_LOADER_PAGE);
Line++;
if (Line<12)
- Line=14;
+ Line=15;
- if (Line>14)
+ if (Line>15)
Line=12;
CONSOLE_InvertTextXY(8, Line, 60, 1);
Line--;
if (Line<12)
- Line=14;
+ Line=15;
- if (Line>14)
+ if (Line>15)
Line=12;
CONSOLE_InvertTextXY(8, Line, 60, 1);
{
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;
}
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;
/* 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;
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 */
{
8,
12,
- "\91« £ ¥ § ०¤ ç â¢êà¤¨ï ¤¨áª (¢ MBR).",
+ "Install bootloader on the harddisk (MBR and VBR).",
TEXT_STYLE_NORMAL
},
{
8,
13,
- "\91« £ ¥ § ०¤ ç ¤¨áª¥â .",
+ "Install bootloader on the harddisk (VBR only).",
TEXT_STYLE_NORMAL
},
{
8,
14,
+ "\91« £ ¥ § ०¤ ç ¤¨áª¥â .",
+ TEXT_STYLE_NORMAL
+ },
+ {
+ 8,
+ 15,
"\84 ¥ ᥠ᫠£ § ०¤ ç.",
TEXT_STYLE_NORMAL
},
{
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\9fit instalaci zavadØ\9fe.",
TEXT_STYLE_NORMAL
},
{
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
},
{
8,
12,
- "\84\9a¡\98«á©«\98©\9e «¦¬ bootloader ©«¦ ©¡¢\9e¨æ \9bå©¡¦ (MBR).",
+ "Install bootloader on the harddisk (MBR and VBR).",
TEXT_STYLE_NORMAL
},
{
8,
13,
- "\84\9a¡\98«á©«\98©\9e «¦¬ bootloader ©\9c £ \98 \9b ©¡â«\98.",
+ "Install bootloader on the harddisk (VBR only).",
TEXT_STYLE_NORMAL
},
{
8,
14,
+ "\84\9a¡\98«á©«\98©\9e «¦¬ bootloader ©\9c £ \98 \9b ©¡â«\98.",
+ TEXT_STYLE_NORMAL
+ },
+ {
+ 8,
+ 15,
"\8c\98 £\9e \9aå¤\9c \9c\9a¡\98«á©«\98©\9e «¦¬ bootloader.",
TEXT_STYLE_NORMAL
},
{
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
},
{
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
},
{
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,
"\8era paigalda alglaadurit.",
TEXT_STYLE_NORMAL
},
{
8,
12,
- "Installer le chargeur de d\82marrage sur le disque dur (MBR).",
+ "Install bootloader on the harddisk (MBR and VBR).",
TEXT_STYLE_NORMAL
},
{
8,
13,
- "Installer le chargeur de d\82marrage sur une disquette.",
+ "Install bootloader on the harddisk (VBR only).",
TEXT_STYLE_NORMAL
},
{
8,
14,
+ "Installer le chargeur de d\82marrage sur une disquette.",
+ TEXT_STYLE_NORMAL
+ },
+ {
+ 8,
+ 15,
"Ne pas installer le chargeur de d\82marrage.",
TEXT_STYLE_NORMAL
},
{
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
},
{
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
},
{
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
},
{
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
},
{
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
},
{
8,
12,
- "\93áâ ®¢ª ¦¥á⪨© ¤¨áª (§ £à㧮çë© á¥ªâ®à).",
+ "Install bootloader on the harddisk (MBR and VBR).",
TEXT_STYLE_NORMAL
},
{
8,
13,
- "\93áâ ®¢ª £¨¡ª¨© ¤¨áª.",
+ "Install bootloader on the harddisk (VBR only).",
TEXT_STYLE_NORMAL
},
{
8,
14,
+ "\93áâ ®¢ª £¨¡ª¨© ¤¨áª.",
+ TEXT_STYLE_NORMAL
+ },
+ {
+ 8,
+ 15,
"\8d¥ ãáâ ¢«¨¢ âì § £àã§ç¨ª.",
TEXT_STYLE_NORMAL
},
{
8,
12,
- "Nainçtalova\9c zav dza\9f syst\82mu na pevnì disk (zav dzac¡ sektor).",
+ "Install bootloader on the harddisk (MBR and VBR).",
TEXT_STYLE_NORMAL
},
{
8,
13,
- "Nainçtalova\9c zav dza\9f syst\82mu na disketu.",
+ "Install bootloader on the harddisk (VBR only).",
TEXT_STYLE_NORMAL
},
{
8,
14,
+ "Nainçtalova\9c zav dza\9f syst\82mu na disketu.",
+ TEXT_STYLE_NORMAL
+ },
+ {
+ 8,
+ 15,
"Presko\9fi\9c inçtal ciu zav dza\9fa syst\82mu.",
TEXT_STYLE_NORMAL
},
{
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
},
{
8,
12,
- "\82áâ ®¢¨â¨ bootloader ¦®àá⪨© ¤¨áª (bootsector).",
+ "Install bootloader on the harddisk (MBR and VBR).",
TEXT_STYLE_NORMAL
},
{
8,
13,
- "\82áâ ®¢¨â¨ bootloader ¤¨áª¥âã.",
+ "Install bootloader on the harddisk (VBR only).",
TEXT_STYLE_NORMAL
},
{
8,
14,
+ "\82áâ ®¢¨â¨ bootloader ¤¨áª¥âã.",
+ TEXT_STYLE_NORMAL
+ },
+ {
+ 8,
+ 15,
"\8d¥ ¢áâ ®¢«î¢ ⨠bootloader.",
TEXT_STYLE_NORMAL
},
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,