curtin-dev team mailing list archive
-
curtin-dev team
-
Mailing list archive
-
Message #02809
[Merge] ~ogayot/curtin:sfdisk-accept-utf8 into curtin:master
The proposal to merge ~ogayot/curtin:sfdisk-accept-utf8 into curtin:master has been updated.
Commit message changed to:
block_meta_v2: make GPT partition name support more robust
In some cases, the sfdisk script will include GPT partition names. GPT
partition names support characters outside the ASCII range (they are
stored in UTF-16 in the GPT metadata). Therefore, it is currently a
wrong assumption that the sfdisk input is always valid ASCII.
Furthermore, we inject the name straight inside the sfdisk input script
(surrounded with double quotes)..
This can result in various problems if the name contains a '"' character
(the sfdisk field delimiter) or other characters such as '\\'.
Fixed by converting all the characters of the partition names into their
utf-8 \x notation. sfdisk natively supports reading this format. This
will have a slight implact on the readability of the sfdisk script, but
should make it way more robust.
udev: fix crash when PARTNAME is invalid utf-8
(We already merged a similar fix in probert)
GPT partition names are basically free-text fields but the udev PARTNAME
field ends up butchered by the kernel when it contains characters
outside the ASCII range.
When using pyudev, the values are all expected to be decodable using the
system's default encoding.
In curtin, it can result in a crash when iterating over all the
properties of a block device, that are mapped by pyudev.
To work around the issue, we now stop iterating over all the values. We
iterate over the keys and only access the value if we need it.
tests: make random_string a staticmethod instead of classmethod
CiTestCase.random_string was decorated with @classmethod.
I guess the purpose was to make the function usable without a CiTestCase
instance. However, @classmethod is used when a function should return an
instance of the class.
This is not what we want. @staticmethod is the right decorator in this
context.
For more details, see:
https://code.launchpad.net/~ogayot/curtin/+git/curtin/+merge/442225
--
Your team curtin developers is requested to review the proposed merge of ~ogayot/curtin:sfdisk-accept-utf8 into curtin:master.
References