private async Task MakeBootable(WindowsVolumes volumes, Phone phone) { Log.Information("Making Windows installation bootable..."); var bcdPath = Path.Combine(volumes.Boot.RootDir.Name, "EFI", "Microsoft", "Boot", "BCD"); var bcd = new BcdInvoker(bcdPath); var windowsPath = Path.Combine(volumes.Windows.RootDir.Name, "Windows"); var bootDriveLetter = volumes.Boot.Letter; await ProcessUtils.RunProcessAsync(BcdBootPath, $@"{windowsPath} /f UEFI /s {bootDriveLetter}:"); bcd.Invoke("/set {default} testsigning on"); bcd.Invoke("/set {default} nointegritychecks on"); await volumes.Boot.Partition.SetGptType(PartitionType.Esp); var updatedBootVolume = await phone.GetBootVolume(); Log.Verbose("Updated Boot Volume: {@Volume}", new { updatedBootVolume.Label, updatedBootVolume.Partition, }); if (!Equals(updatedBootVolume.Partition.PartitionType, PartitionType.Esp)) { Log.Warning("The system partition should be {Esp}, but it's {ActualType}", PartitionType.Esp, updatedBootVolume.Partition.PartitionType); } }
public BcdConfigurator(BcdInvoker invoker, Volume efiespVolume) { this.invoker = invoker; this.efiespVolume = efiespVolume; }
public BcdConfigurator(BcdInvoker invoker, Volume efiespVolume) { this.invoker = invoker; this.efiespVolume = efiespVolume; bcdEdit = @"c:\Windows\SysNative\bcdedit.exe"; }