Documentation
¶
Index ¶
- func InjectWinPEPayload(bootWimPath, injectDir string, registryPatches ...RegistryPatch) error
- func PatchDevcellWim(wimPath string, imageNum int, registryPatches ...RegistryPatch) error
- func PatchRegistry(wim *wimlib.WIM, imageNum int, rp RegistryPatch) (cleanup func(), err error)
- func VerifyRegistry(wim *wimlib.WIM, imageNum int, hivePath string, checks []DWordCheck) error
- type DWordCheck
- type RegistryPatch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InjectWinPEPayload ¶
func InjectWinPEPayload(bootWimPath, injectDir string, registryPatches ...RegistryPatch) error
func PatchDevcellWim ¶
func PatchDevcellWim(wimPath string, imageNum int, registryPatches ...RegistryPatch) error
func PatchRegistry ¶
func PatchRegistry(wim *wimlib.WIM, imageNum int, rp RegistryPatch) (cleanup func(), err error)
PatchRegistry extracts a registry hive from a WIM image, applies DWORD patches, and writes the modified hive back. The WIM is NOT overwritten — call wim.Overwrite() after all modifications are done. The returned cleanup function removes the temp directory holding the patched hive; call it AFTER wim.Overwrite() completes since wimlib needs the file to exist at overwrite time.
func VerifyRegistry ¶
VerifyRegistry extracts a registry hive from a WIM image and verifies that every check's DWORD value matches the expectation. Returns the first non-optional mismatch as an error. Optional checks that fail (key/value missing) are silently skipped.
Types ¶
type DWordCheck ¶
DWordCheck describes a single registry DWORD expectation for VerifyRegistry.
func HyperVBootChecks ¶
func HyperVBootChecks() []DWordCheck
HyperVBootChecks returns the registry value expectations corresponding to HyperVBootPatches. Use with VerifyRegistry to assert patches were applied correctly.
type RegistryPatch ¶
type RegistryPatch struct {
// HivePath is the path inside the WIM image
// (e.g. `\Windows\System32\config\SYSTEM`).
HivePath string
// Patches are the DWORD values to overwrite.
Patches []regedit.DWordPatch
}
RegistryPatch describes a set of DWORD modifications to apply to a registry hive inside a WIM image. The hive is extracted to a temp file, patched, and written back.
func HyperVBootPatches ¶
func HyperVBootPatches() RegistryPatch
HyperVBootPatches returns the registry patches needed to make Hyper-V services start at boot in WinPE. Without these, hvservice has Start=3 (Manual) and never loads.