[oe-commits] [openembedded-core] 01/03: wic: ensure generated disk system identifier is non-zero

git at git.openembedded.org git at git.openembedded.org
Fri Jul 28 15:28:29 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit b8725dee34067764eeafdd416b33484742a384f8
Author: Jonathan Liu <net147 at gmail.com>
AuthorDate: Sat Jul 29 00:45:27 2017 +1000

    wic: ensure generated disk system identifier is non-zero
    
    Zero may be interpreted as no MBR signature present and another
    partitioning program might install a new MBR signature.
    
    Signed-off-by: Jonathan Liu <net147 at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 scripts/lib/wic/plugins/imager/direct.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index 9cb2c46..c9c52e1 100644
--- a/scripts/lib/wic/plugins/imager/direct.py
+++ b/scripts/lib/wic/plugins/imager/direct.py
@@ -303,7 +303,7 @@ class PartitionedImage():
                           # all partitions (in bytes)
         self.ptable_format = ptable_format  # Partition table format
         # Disk system identifier
-        self.identifier = int.from_bytes(os.urandom(4), 'little')
+        self.identifier = int.from_bytes(os.urandom(4), 'little') or 0xffffffff
 
         self.partitions = partitions
         self.partimages = []

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list