private async Task MakeBootable(WindowsVolumes volumes, Phone phone, InstallOptions options) { 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 PatchBootIfNecessary(volumes.Boot, options); await volumes.Boot.Partition.SetGptType(PartitionType.Esp); var updatedBootVolume = await phone.GetBootVolume(); if (updatedBootVolume != null) { Log.Verbose("We shouldn't be able to get a reference to the Boot volume."); 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); } } }
private async Task MakeBootable(WindowsVolumes volumes, RaspberryPi 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; if (!bootDriveLetter.HasValue) { throw new DeploymentException("The Boot volume letter isn't accessible"); } 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); } }
private async Task ApplyWindowsImage(WindowsVolumes volumes, InstallOptions options, IObserver <double> progressObserver = null) { Log.Information("Applying Windows Image..."); await windowsImageService.ApplyImage(volumes.Windows, options.ImagePath, options.ImageIndex, progressObserver); progressObserver?.OnNext(double.NaN); }
public async Task Deploy(InstallOptions options, RaspberryPi phone, IObserver <double> progressObserver = null) { Log.Information("Deploying Windows 10 ARM64..."); await RemoveExistingWindowsPartitions(phone); await CreateWindowsPartition(phone); var windowsVolumes = new WindowsVolumes(await phone.GetBootVolume(), await phone.GetWindowsVolume()); await ApplyWindowsImage(windowsVolumes, options, progressObserver); await InjectDrivers(windowsVolumes.Windows); await MakeBootable(windowsVolumes, phone); Log.Information("Windows Image deployed"); }
private async Task MakeBootable(WindowsVolumes volumes) { Log.Verbose("Making Windows installation bootable..."); await bootCreator.MakeBootable(volumes.Boot, volumes.Windows); await volumes.Boot.Partition.SetGptType(PartitionType.Esp); var updatedBootVolume = await phone.GetBootVolume(); if (updatedBootVolume != null) { Log.Verbose("We shouldn't be able to get a reference to the Boot volume."); 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); } } }