Date
1 - 1 of 1
[DefaultStores] and 'defaultstore' connection
Konstantin Aladyshev
Hello!
I'm trying to understand the usage of `[DefaultStores]` in the DSC
file. For example:
```
[DefaultStores]
0|STANDARD
1|MANUFACTURING
```
Is this `DefaultStores` mechanics connected with the `defaultstore`s
from the actual VFR file?
For example:
```
defaultstore StandardDefault,
prompt = STRING_TOKEN(STANDARD_DEFAULT_PROMPT),
attribute = 0x0000;
defaultstore ManufactureDefault,
prompt = STRING_TOKEN(MFG_DEFAULT_PROMPT),
attribute = 0x0001;
form
formid = 1,
title = STRING_TOKEN(FORMID1_TITLE);
checkbox
varid = FormData.CheckboxValue,
prompt = STRING_TOKEN(CHECKBOX_PROMPT),
help = STRING_TOKEN(CHECKBOX_HELP),
default = TRUE, defaultstore = StandardDefault,
default = FALSE, defaultstore = ManufactureDefault,
endcheckbox;
numeric
name = NumericQuestion,
varid = FormData.NumericValue,
prompt = STRING_TOKEN(NUMERIC_PROMPT),
help = STRING_TOKEN(NUMERIC_HELP),
default = 7, defaultstore = StandardDefault,
default = 8, defaultstore = ManufactureDefault,
endnumeric;
...
endform;
```
Does the `PcdSetNvStoreDefaultId=1` setting in the PEI stage supposed
to set all defaults in all HII forms to the `ManufactureDefault`
storage?
```
PcdSet16S (PcdSetNvStoreDefaultId, 0x1);
```
Or does this setting only affects PCDs which were overridden in sections:
```
[PcdsDynamicExHii.common.DEFAULT.MANUFACTURING]
```
___________
There is not a lot of documentation on the subject. The closest one is
this guide: https://github.com/lgao4/edk2/wiki/StructurePcd-Enable-Steps
But at least with it I was able to get something from the
`DefaultStores` mechanics. Here is a snippet from the DSC file:
```
[PcdsDynamicExHii.common.DEFAULT.STANDARD]
gMyPkgTokenSpaceGuid.PcdCustomFormStruct|L"FormData"|gFormsetGuid|0x0|{0x00}|NV,BS,RT
gMyPkgTokenSpaceGuid.PcdCustomFormStruct.NumericValue|76
[PcdsDynamicExHii.common.DEFAULT.MANUFACTURING]
gMyPkgTokenSpaceGuid.PcdCustomFormStruct|L"FormData"|gFormsetGuid|0x0|{0x00}|NV,BS,RT
gMyPkgTokenSpaceGuid.PcdCustomFormStruct.NumericValue|77
[PcdsDynamicExVpd]
gEfiMdeModulePkgTokenSpaceGuid.PcdNvStoreDefaultValueBuffer|*
```
This code essentially creates an EFI VAR with all 0 except the
`NumericValue` field which is equal to 77.
So it looks like if I want to set all Form elements to
`ManufactureDefault` I have to manually set the PCDs to each field
with values from the VFR. This doesn't look right. So I'm obviously
missing something.
Can you please explain to me:
1) Is this `DefaultStores` mechanic connected with the `defaultstore`s
from the actual VFR file?
2) Does the `PcdSetNvStoreDefaultId=1` setting in the PEI stage
suppose to set all defaults in all HII forms to the
`ManufactureDefault` storage?
3) If I want to set manufacturing defaults, do I have to manually set
all form fields with this PCD mechanics?
Best regards,
Konstantin Aladyshev
I'm trying to understand the usage of `[DefaultStores]` in the DSC
file. For example:
```
[DefaultStores]
0|STANDARD
1|MANUFACTURING
```
Is this `DefaultStores` mechanics connected with the `defaultstore`s
from the actual VFR file?
For example:
```
defaultstore StandardDefault,
prompt = STRING_TOKEN(STANDARD_DEFAULT_PROMPT),
attribute = 0x0000;
defaultstore ManufactureDefault,
prompt = STRING_TOKEN(MFG_DEFAULT_PROMPT),
attribute = 0x0001;
form
formid = 1,
title = STRING_TOKEN(FORMID1_TITLE);
checkbox
varid = FormData.CheckboxValue,
prompt = STRING_TOKEN(CHECKBOX_PROMPT),
help = STRING_TOKEN(CHECKBOX_HELP),
default = TRUE, defaultstore = StandardDefault,
default = FALSE, defaultstore = ManufactureDefault,
endcheckbox;
numeric
name = NumericQuestion,
varid = FormData.NumericValue,
prompt = STRING_TOKEN(NUMERIC_PROMPT),
help = STRING_TOKEN(NUMERIC_HELP),
default = 7, defaultstore = StandardDefault,
default = 8, defaultstore = ManufactureDefault,
endnumeric;
...
endform;
```
Does the `PcdSetNvStoreDefaultId=1` setting in the PEI stage supposed
to set all defaults in all HII forms to the `ManufactureDefault`
storage?
```
PcdSet16S (PcdSetNvStoreDefaultId, 0x1);
```
Or does this setting only affects PCDs which were overridden in sections:
```
[PcdsDynamicExHii.common.DEFAULT.MANUFACTURING]
```
___________
There is not a lot of documentation on the subject. The closest one is
this guide: https://github.com/lgao4/edk2/wiki/StructurePcd-Enable-Steps
But at least with it I was able to get something from the
`DefaultStores` mechanics. Here is a snippet from the DSC file:
```
[PcdsDynamicExHii.common.DEFAULT.STANDARD]
gMyPkgTokenSpaceGuid.PcdCustomFormStruct|L"FormData"|gFormsetGuid|0x0|{0x00}|NV,BS,RT
gMyPkgTokenSpaceGuid.PcdCustomFormStruct.NumericValue|76
[PcdsDynamicExHii.common.DEFAULT.MANUFACTURING]
gMyPkgTokenSpaceGuid.PcdCustomFormStruct|L"FormData"|gFormsetGuid|0x0|{0x00}|NV,BS,RT
gMyPkgTokenSpaceGuid.PcdCustomFormStruct.NumericValue|77
[PcdsDynamicExVpd]
gEfiMdeModulePkgTokenSpaceGuid.PcdNvStoreDefaultValueBuffer|*
```
This code essentially creates an EFI VAR with all 0 except the
`NumericValue` field which is equal to 77.
So it looks like if I want to set all Form elements to
`ManufactureDefault` I have to manually set the PCDs to each field
with values from the VFR. This doesn't look right. So I'm obviously
missing something.
Can you please explain to me:
1) Is this `DefaultStores` mechanic connected with the `defaultstore`s
from the actual VFR file?
2) Does the `PcdSetNvStoreDefaultId=1` setting in the PEI stage
suppose to set all defaults in all HII forms to the
`ManufactureDefault` storage?
3) If I want to set manufacturing defaults, do I have to manually set
all form fields with this PCD mechanics?
Best regards,
Konstantin Aladyshev