[TuxOnIce-devel] 126.96.36.199: UUID support + bug fixes.
ncunningham at crca.org.au
Thu Dec 3 13:28:22 UTC 2009
Please find attached a new patch, 188.8.131.52.
1) UUID support.
This patch adds UUID support. You can now have a commandline that includes
The old format still works.
The code that parses the UUID has the following restrictions:
1) "UUID=" is case sensitive. uuid= won't work.
2) the UUID itself may contain any number of dashes anywhere within it
(they don't have to match the above pattern, and may be completely
removed), but no other non-hexidecimal characters.
The UUID may be proceeded by 'file:' or 'swap:', but they're unnecessary.
The UUID may be followed by ':[block number]' as with old versions of
resume= command lines.
UUIDs are now stored in the image header, and are given priority over
dev_ts (that is, major and minor numbers). This should mean that you can
have devices end up with different major and minor numbers at resume
time and you'll still be able to read the image. I haven't tested this,
The code that actually finds UUIDs is simple and straight forward. It
uses a variant of a table that you can find in libuuid source
(rearranged so we don't reread superblocks multiple times, and with a
new field saying where UUIDs are stored). For each registered block
device, it checks each potential filesystem type until it finds a
matching filesystem signature before checking the UUID location for that
filesystem type for a matching UUID. None of this requires that VFS
support for the filesystem be compiled or loaded at the time or at
When writing the image header, the inverse is done (we get the UUID by
searching the known dev for a filesystem type we recognise, and store
the UUID for that fs type).
The UUID part of the table in incomplete at the moment. I have only
filled in swapspace, xfs, ext[2|3|4], xfs and reiserfs offsets. I've
only tested swapspace. That said, filesystems that aren't mentioned in
the first sentence of this para could still work provided that they're
sufficiently unique - it's just that the first 16 bytes of the partition
will be used as the UUID, instead of the real UUID.
2) File allocator fixed.
The file allocator has been fixed so that it properly works now. As
previously, echoing the name of a file into
/sys/power/tuxonice/file/target will cause /sys/power/tuxonice/resume to
be set to the resume= parameter you will need (assuming you point it at
a valid file). The value put in resume= will be a UUID in the first
instance, and only /dev/<whatever> if a UUID can't be found (which
should only happen if you use a whole partition with the file allocator).
Tested fine under VirtualBox on my 64 bit machine YMMV. As always, I
3) Misc other changes / bug fixes
As always, misc other bug fixes.
Oh, and yes - I know 2.6.32 is out :) I was hoping to beat it to release!
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 117772 bytes
Desc: not available
More information about the TuxOnIce-devel