コード例 #1
0
        public async Task Prepare(IDisk disk)
        {
            Log.Verbose("Preparing Micro SD...");

            var windowsPartition = await disk.CreatePartition(PartitionType.Basic, "Windows");

            var vol = await windowsPartition.GetVolume();

            await vol.Format(FileSystemFormat.Ntfs, PartitionLabels.Windows);

            var volumes = await disk.GetVolumes();

            var system = volumes.First(x => x.Label == PartitionLabels.System);
            await system.Partition.SetGptType(PartitionType.Esp);

            Log.Verbose("Micro SD ready");
        }
コード例 #2
0
 public static Task <IPartition> CreatePartition(this IDisk self, PartitionType partitionType, string label = "")
 {
     return(self.CreatePartition(ByteSize.MaxValue, partitionType, label));
 }