mirror of
https://github.com/reactos/reactos.git
synced 2025-05-25 20:18:22 +00:00
[SETUP] Add support for selecting FS type in unattended setups
By default, we still fallback to FAT if nothing asked, or if there is an invalid input. 0 is FAT, 1 is BtrFS. This can be grown as soon as we add more IFS.
This commit is contained in:
parent
c526f94b8c
commit
4ed6b1ffca
4 changed files with 41 additions and 9 deletions
|
@ -196,6 +196,16 @@ CheckUnattendedSetup(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Search for FsType in the 'Unattend' section */
|
||||||
|
pSetupData->FsType = 0;
|
||||||
|
if (SpInfFindFirstLine(UnattendInf, L"Unattend", L"FsType", &Context))
|
||||||
|
{
|
||||||
|
if (SpInfGetIntField(&Context, 1, &IntValue))
|
||||||
|
{
|
||||||
|
pSetupData->FsType = IntValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Quit:
|
Quit:
|
||||||
SpInfCloseInfFile(UnattendInf);
|
SpInfCloseInfFile(UnattendInf);
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,6 +110,7 @@ typedef struct _USETUP_DATA
|
||||||
LONG MBRInstallType;
|
LONG MBRInstallType;
|
||||||
LONG FormatPartition;
|
LONG FormatPartition;
|
||||||
LONG AutoPartition;
|
LONG AutoPartition;
|
||||||
|
LONG FsType;
|
||||||
|
|
||||||
/* Settings lists *****/
|
/* Settings lists *****/
|
||||||
PGENERIC_LIST ComputerList;
|
PGENERIC_LIST ComputerList;
|
||||||
|
|
|
@ -2859,8 +2859,31 @@ SelectFileSystemPage(PINPUT_RECORD Ir)
|
||||||
|
|
||||||
if (FileSystemList == NULL)
|
if (FileSystemList == NULL)
|
||||||
{
|
{
|
||||||
/* Create the file system list, and by default select the "FAT" file system */
|
PWSTR DefaultFs;
|
||||||
FileSystemList = CreateFileSystemList(6, 26, PartEntry->New, L"FAT");
|
|
||||||
|
if (IsUnattendedSetup)
|
||||||
|
{
|
||||||
|
switch (USetupData.FsType)
|
||||||
|
{
|
||||||
|
/* 1 is for BtrFS */
|
||||||
|
case 1:
|
||||||
|
DefaultFs = L"BTRFS";
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* If we don't understand input, default to FAT */
|
||||||
|
default:
|
||||||
|
DefaultFs = L"FAT";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* By default select the "FAT" file system */
|
||||||
|
DefaultFs = L"FAT";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Create the file system list */
|
||||||
|
FileSystemList = CreateFileSystemList(6, 26, PartEntry->New, DefaultFs);
|
||||||
if (FileSystemList == NULL)
|
if (FileSystemList == NULL)
|
||||||
{
|
{
|
||||||
/* FIXME: show an error dialog */
|
/* FIXME: show an error dialog */
|
||||||
|
@ -2878,13 +2901,6 @@ SelectFileSystemPage(PINPUT_RECORD Ir)
|
||||||
{
|
{
|
||||||
if (USetupData.FormatPartition)
|
if (USetupData.FormatPartition)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* We use whatever currently selected file system we have
|
|
||||||
* (by default, this is "FAT", as per the initialization
|
|
||||||
* performed above). Note that it may be interesting to specify
|
|
||||||
* which file system to use in unattended installations, in the
|
|
||||||
* txtsetup.sif file.
|
|
||||||
*/
|
|
||||||
return FORMAT_PARTITION_PAGE;
|
return FORMAT_PARTITION_PAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,11 @@ FormatPartition=1
|
||||||
; 0 - disabled
|
; 0 - disabled
|
||||||
AutoPartition = 1
|
AutoPartition = 1
|
||||||
|
|
||||||
|
; choose default file system type
|
||||||
|
; 0 - FAT
|
||||||
|
; 1 - BtrFS
|
||||||
|
FsType = 0
|
||||||
|
|
||||||
; set this option to automatically
|
; set this option to automatically
|
||||||
; specify language in 2nd mode setup
|
; specify language in 2nd mode setup
|
||||||
; see hivesys.inf for available languages
|
; see hivesys.inf for available languages
|
||||||
|
|
Loading…
Reference in a new issue