diff options
author | Maciej Borzecki <maciej.borzecki@open-rnd.pl> | 2014-12-22 15:28:02 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-12-24 17:48:58 +0000 |
commit | e2664f563921467fe38bb74f4dd2a41eb004ee9f (patch) | |
tree | a7b7b2328f985523979f28c0c64950a751d48bb2 /scripts/lib | |
parent | 9e906f4260d9ce44a78cc315930677b3bd0ab9c1 (diff) | |
download | openembedded-core-e2664f563921467fe38bb74f4dd2a41eb004ee9f.tar.gz openembedded-core-e2664f563921467fe38bb74f4dd2a41eb004ee9f.tar.bz2 openembedded-core-e2664f563921467fe38bb74f4dd2a41eb004ee9f.zip |
wic: account for mmcblk device partition naming
MMC block device partitions are named differently than other block
devices and use the scheme: mmcblk<devnum>p<partnum>, ex: mmcblk0p1,
mmcblk0p2. The current code generates incorrect parition names missing
'p' infix for fstab entries. The patch resolves this problem.
Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/wic/imager/direct.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py index 6b2ab3368e..b1dc3e96f4 100644 --- a/scripts/lib/wic/imager/direct.py +++ b/scripts/lib/wic/imager/direct.py @@ -100,10 +100,18 @@ class DirectImageCreator(BaseImageCreator): for num, p in enumerate(parts, 1): if not p.mountpoint or p.mountpoint == "/" or p.mountpoint == "/boot": continue - if self._ptable_format == 'msdos' and num > 3: - device_name = "/dev/" + p.disk + str(num + 1) - else: - device_name = "/dev/" + p.disk + str(num) + + part = '' + # mmc device partitions are named mmcblk0p1, mmcblk0p2.. + if p.disk.startswith('mmcblk'): + part = 'p' + + pnum = num + if self._ptable_format == 'msdos' and pnum > 3: + # account for logical partition numbering, ex. sda5.. + pnum += 1 + + device_name = "/dev/" + p.disk + part + str(pnum) opts = "defaults" if p.fsopts: |