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);
            }
        }
Beispiel #2
0
 private void SetDisplayOptions(Guid entry)
 {
     invoker.Invoke($@"/displayorder {{{entry}}}");
     invoker.Invoke($@"/default {{{entry}}}");
     invoker.Invoke($@"/timeout 30");
 }