Ejemplo n.º 1
0
        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);
                }
            }
        }
Ejemplo n.º 2
0
        public async Task Execute()
        {
            var disk = await phone.GetDeviceDisk();

            var espPart = await disk.GetBootEfiEspPartition();

            if (espPart != null)
            {
                await espPart.SetGptType(PartitionType.Basic);
            }

            var bootVol = await phone.GetBootVolume();

            var finalPath = Path.Combine(bootVol.RootDir.Name, destination);
            await fileSystemOperations.Copy(origin, finalPath);

            await bootVol.Partition.SetGptType(PartitionType.Esp);
        }
        private async Task <WindowsVolumes> CreatePartitions()
        {
            Log.Verbose("Creating Windows partitions...");

            await(await phone.GetDeviceDisk()).CreateReservedPartition((ulong)ReservedPartitionSize.Bytes);

            var bootPartition = await(await phone.GetDeviceDisk()).CreatePartition((ulong)BootPartitionSize.Bytes);
            var bootVolume    = await bootPartition.GetVolume();

            await bootVolume.Mount();

            await bootVolume.Format(FileSystemFormat.Fat32, BootPartitionLabel);

            var windowsPartition = await(await phone.GetDeviceDisk()).CreatePartition(ulong.MaxValue);
            var winVolume        = await windowsPartition.GetVolume();

            await winVolume.Mount();

            await winVolume.Format(FileSystemFormat.Ntfs, WindowsPartitonLabel);

            Log.Verbose("Windows Partitions created successfully");

            return(new WindowsVolumes(await phone.GetBootVolume(), await phone.GetWindowsVolume()));
        }