[parted-devel] [PATCH] libparted: Add support for MBR id and GPT GUID of UDF filesystem

Pali Rohár pali.rohar at gmail.com
Wed Aug 22 08:19:29 BST 2018


On Tuesday 21 August 2018 14:30:16 Phillip Susi wrote:
> On 8/19/2018 4:26 PM, Pali Rohár wrote:
> > UDF detection is not simple when you want to do it correctly. But later
> > I can implement it. What probe function needs to return? Just true/false
> > if device is a UDF filesystem? Or it needs to return also some metadata?
> 
> It doesn't just have some magic number at some offset you can look for
> to say yep, that looks like UDF?

Yes and no. Offset is according to anchor block descriptor and location
of this block of course depends on UDF fs block size. Plus there are 4
possible locations of anchor. But there is just a finite number of
possible locations and finite number of possible file system block
sizes. So it is not a problem, just "correct" implementation needs to
check all possible combinations -- and I hope you want "correct"
implementation :-)

> IIRC, yes, it is just true/false.

Ok, this should simplify things as we do not need to read volume label
and other identifiers...

> >> Also could you add a NEWS entry and a test case?
> > 
> > NEW entry is there:
> 
> It wasn't in the patch you posted, did you forget to stage it for the
> commit?

I just edited file and run git diff.

> > About test case, I looked into repository and I'm really not sure what
> > and how to write.
> > 
> > I just compiled and manually tested that when I create a new partition
> > of udf type it has correct MBR id.
> 
> When you run make check, the various test scripts in tests/ are run.
> They exercise parted in various ways and verify that it does what it's
> supposed to.  Take a look at t2400-dos-hfs-partition-type.sh.  It looks
> like almost exactly what you need to verify UDF on MBR ( just change the
> partition ID ).  I thought we had some tests checking the other type
> codes, but I don't see any that test GPT right now.  It should only need
> a little more tweaking to that script to check the right bytes in GPT to
> make sure they are using the right type code.

Ok, will look at file t2400-dos-hfs-partition-type.sh.

-- 
Pali Rohár
pali.rohar at gmail.com



More information about the parted-devel mailing list