swysocki / gpt-image Goto Github PK
View Code? Open in Web Editor NEWTool to create GPT disk image files
License: MIT License
Tool to create GPT disk image files
License: MIT License
Allow starting a partition at a specific LBA. Make necessary calculations for alignment.
Disk space is finite. There needs to be a check to ensure there is enough room to add a partition.
A GUID is generated for each GPT header. The GUID needs to match for both the primary and backup header. This creates a corrupt disk image.
Check to ensure a partition's length will fit within the disk and not overwrite another
Check to ensure it fits within the boundaries CONSIDERING the backup GPT table at the end of disk
Allow the removal of a partition from disk.
Replace the Entry module with a simpler pattern for constructing the byte structure based on the struct.Struct
object. Something similar to what the gptsum
project uses: https://github.com/NicolasT/gptsum/blob/main/src/gptsum/gpt.py
enable setting partition attributes such as read-only and hidden
Partition entry field (0x50) is hard-coded to the max entries 128*128. Set this field to the actual count of partition entries.
Sector size is hard-coded to 512 bytes. This is an obvious limitation ๐จ
Allow the modification of partition information:
Use the table Mnemonic names from the EFI Spec: https://www.intel.com/content/dam/doc/product-specification/efi-v1-10-specification.pdf as class attributes.
This will make it easier when comparing with the EFI spec.
Opening an existing disk is a bit cumbersome because a Disk instance needs to be created. It will be less confusing to call
Disk.open('my-image.gpt')
and return a Disk instance.
Allow bytes to be written to a partition
Validate the generated image is valid using an external tool such as sfdisk
or sgdisk
.
Add this test to CI.
Output information about the GPT table for each class. JSON would be useful!
self.image_path.touch(exists_ok=False)
does not allow overwriting the image file. This should be an option.
sfdisk
reports:
GPT PMBR size mismatch (4096 != 4095) will be corrected by write.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.