summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaciej Borzecki <maciej.borzecki@open-rnd.pl>2014-12-22 15:28:02 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-12-25 08:18:13 +0000
commit052c67c8450fb1d9e0a10d7c60b23727c3830b24 (patch)
treee54b4488eedde08c5e1b395df444b5eadd63dc13
parent51374d55ef64689f393dc0aeb1943086ac0bc6b6 (diff)
downloadpoky-052c67c8450fb1d9e0a10d7c60b23727c3830b24.tar.gz
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. (From OE-Core rev: e2664f563921467fe38bb74f4dd2a41eb004ee9f) 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>
-rw-r--r--scripts/lib/wic/imager/direct.py16
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):
100 for num, p in enumerate(parts, 1): 100 for num, p in enumerate(parts, 1):
101 if not p.mountpoint or p.mountpoint == "/" or p.mountpoint == "/boot": 101 if not p.mountpoint or p.mountpoint == "/" or p.mountpoint == "/boot":
102 continue 102 continue
103 if self._ptable_format == 'msdos' and num > 3: 103
104 device_name = "/dev/" + p.disk + str(num + 1) 104 part = ''
105 else: 105 # mmc device partitions are named mmcblk0p1, mmcblk0p2..
106 device_name = "/dev/" + p.disk + str(num) 106 if p.disk.startswith('mmcblk'):
107 part = 'p'
108
109 pnum = num
110 if self._ptable_format == 'msdos' and pnum > 3:
111 # account for logical partition numbering, ex. sda5..
112 pnum += 1
113
114 device_name = "/dev/" + p.disk + part + str(pnum)
107 115
108 opts = "defaults" 116 opts = "defaults"
109 if p.fsopts: 117 if p.fsopts: