* [PATCH 0/1] wic: fix extended/logical partition layout @ 2015-01-09 13:24 Maciej Borzecki 2015-01-09 13:24 ` [PATCH 1/1] " Maciej Borzecki 0 siblings, 1 reply; 9+ messages in thread From: Maciej Borzecki @ 2015-01-09 13:24 UTC (permalink / raw) To: openembedded-core, Tom Zanussi; +Cc: Maciek Borzecki The patch fixes a problem with laying out partitions in wic. The original code would steal sectors from the last primary partition to accommodate for EBR. This would originally work in mic, but fails with wic (reasons discussed further down this email). The patch removes the sector stealing from the last primary partition, replacing it with reservation of sectors for EBR before every logical partition. The reservation is done before the partition is aligned so that the fs inside the partition starts at desired alignment. The extended partition is created taking into account the EBR sector reservation. Since the extended partition is described in MBR and requires no additional sectors, the EBR from the first logical partition is accounted for when calculating extended partition size. The root cause is a fundamental difference in the preparation of disk image between the original mic code and wic. In mic, the disk image was created beforehand, mounted via loopback (thus requiring sudo), partitioned and then the file systems were created. For comparison in wic, we first create partition images, followed by preparation of a complete empty disk image file. The partitions (or in fact MBR entries) are created using parted. Only after this step is complete, the original partition image files are copied into the disk image using dd. Discrepancy between the MBR/EBR entries and locations where dd puts the data to is likely to produce either a faulty image or an unmountable partitions. Hopefully this list is the last patch fixing sector stealing. Maciej Borzecki (1): wic: fix extended/logical partition layout scripts/lib/wic/utils/partitionedfs.py | 40 ++++++++++++++++------------------ 1 file changed, 19 insertions(+), 21 deletions(-) -- 1.9.3 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/1] wic: fix extended/logical partition layout 2015-01-09 13:24 [PATCH 0/1] wic: fix extended/logical partition layout Maciej Borzecki @ 2015-01-09 13:24 ` Maciej Borzecki 2015-02-02 7:37 ` Maciej Borzecki 0 siblings, 1 reply; 9+ messages in thread From: Maciej Borzecki @ 2015-01-09 13:24 UTC (permalink / raw) To: openembedded-core, Tom Zanussi; +Cc: Maciek Borzecki The patch fixes an issue in laying out extended and logical partitions by wic. The original code produced disk images in which the size 3rd partition as described in MBR was incorrect. Depending on the type of file system used for that partition and size of the partition, it would be impossible to mount the partition correctly. For instance, kickstart file in which the 3rd partition had size of 1GB and used ext4 fs, would result in an image with an umountable partition. The root cause is reservation of sectors for EBR through stealing of last sector from the last primary partition. Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl> Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com> --- scripts/lib/wic/utils/partitionedfs.py | 40 ++++++++++++++++------------------ 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py index fb95cc7..9df93dc 100644 --- a/scripts/lib/wic/utils/partitionedfs.py +++ b/scripts/lib/wic/utils/partitionedfs.py @@ -156,6 +156,13 @@ class Image: # Skip one sector required for the partitioning scheme overhead d['offset'] += overhead + elif d['numpart'] > 3: + # Reserve a sector for EBR for every logical partition + # before alignment is performed. + if ptable_format == "msdos": + d['offset'] += 1 + + if p['align']: # If not first partition and we do have alignment set we need # to align the partition. @@ -185,14 +192,6 @@ class Image: p['num'] = d['numpart'] if d['ptable_format'] == "msdos": - if d['numpart'] > 2: - # Every logical partition requires an additional sector for - # the EBR, so steal the last sector from the end of each - # partition starting from the 3rd one for the EBR. This - # will make sure the logical partitions are aligned - # correctly. - p['size'] -= 1 - if d['numpart'] > 3: p['type'] = 'logical' p['num'] = d['numpart'] + 1 @@ -259,13 +258,20 @@ class Image: for p in self.partitions: d = self.disks[p['disk_name']] if d['ptable_format'] == "msdos" and p['num'] == 5: - # The last sector of the 3rd partition was reserved for the EBR - # of the first _logical_ partition. This is why the extended - # partition should start one sector before the first logical - # partition. + # Create an extended partition (note: extended + # partition is described in MBR and contains all + # logical partitions). The logical partitions save a + # sector for an EBR just before the start of a + # partition. The extended partition must start one + # sector before the start of the first logical + # partition. This way the first EBR is inside of the + # extended partition. Since the extended partitions + # starts a sector before the first logical partition, + # add a sector at the back, so that there is enough + # room for all logical partitions. self.__create_partition(d['disk'].device, "extended", None, p['start'] - 1, - d['offset'] - p['start']) + d['offset'] - p['start'] + 1) if p['fstype'] == "swap": parted_fs_type = "linux-swap" @@ -338,14 +344,6 @@ class Image: for p in self.partitions: d = self.disks[p['disk_name']] - if d['ptable_format'] == "msdos" and p['num'] == 5: - # The last sector of the 3rd partition was reserved for the EBR - # of the first _logical_ partition. This is why the extended - # partition should start one sector before the first logical - # partition. - self.__write_partition(p['num'], p['source_file'], - p['start'] - 1, - d['offset'] - p['start']) self.__write_partition(p['num'], p['source_file'], p['start'], p['size']) -- 1.9.3 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] wic: fix extended/logical partition layout 2015-01-09 13:24 ` [PATCH 1/1] " Maciej Borzecki @ 2015-02-02 7:37 ` Maciej Borzecki 2015-02-02 14:29 ` Tom Zanussi 0 siblings, 1 reply; 9+ messages in thread From: Maciej Borzecki @ 2015-02-02 7:37 UTC (permalink / raw) To: openembedded-core, Tom Zanussi; +Cc: Maciek Borzecki ping On 01/09 14:24, Maciej Borzecki wrote: > The patch fixes an issue in laying out extended and logical partitions > by wic. The original code produced disk images in which the size 3rd > partition as described in MBR was incorrect. Depending on the type of > file system used for that partition and size of the partition, it would > be impossible to mount the partition correctly. For instance, kickstart > file in which the 3rd partition had size of 1GB and used ext4 fs, would > result in an image with an umountable partition. The root cause is > reservation of sectors for EBR through stealing of last sector from the > last primary partition. > > Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl> > Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com> > --- > scripts/lib/wic/utils/partitionedfs.py | 40 ++++++++++++++++------------------ > 1 file changed, 19 insertions(+), 21 deletions(-) > > diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py > index fb95cc7..9df93dc 100644 > --- a/scripts/lib/wic/utils/partitionedfs.py > +++ b/scripts/lib/wic/utils/partitionedfs.py > @@ -156,6 +156,13 @@ class Image: > # Skip one sector required for the partitioning scheme overhead > d['offset'] += overhead > > + elif d['numpart'] > 3: > + # Reserve a sector for EBR for every logical partition > + # before alignment is performed. > + if ptable_format == "msdos": > + d['offset'] += 1 > + > + > if p['align']: > # If not first partition and we do have alignment set we need > # to align the partition. > @@ -185,14 +192,6 @@ class Image: > p['num'] = d['numpart'] > > if d['ptable_format'] == "msdos": > - if d['numpart'] > 2: > - # Every logical partition requires an additional sector for > - # the EBR, so steal the last sector from the end of each > - # partition starting from the 3rd one for the EBR. This > - # will make sure the logical partitions are aligned > - # correctly. > - p['size'] -= 1 > - > if d['numpart'] > 3: > p['type'] = 'logical' > p['num'] = d['numpart'] + 1 > @@ -259,13 +258,20 @@ class Image: > for p in self.partitions: > d = self.disks[p['disk_name']] > if d['ptable_format'] == "msdos" and p['num'] == 5: > - # The last sector of the 3rd partition was reserved for the EBR > - # of the first _logical_ partition. This is why the extended > - # partition should start one sector before the first logical > - # partition. > + # Create an extended partition (note: extended > + # partition is described in MBR and contains all > + # logical partitions). The logical partitions save a > + # sector for an EBR just before the start of a > + # partition. The extended partition must start one > + # sector before the start of the first logical > + # partition. This way the first EBR is inside of the > + # extended partition. Since the extended partitions > + # starts a sector before the first logical partition, > + # add a sector at the back, so that there is enough > + # room for all logical partitions. > self.__create_partition(d['disk'].device, "extended", > None, p['start'] - 1, > - d['offset'] - p['start']) > + d['offset'] - p['start'] + 1) > > if p['fstype'] == "swap": > parted_fs_type = "linux-swap" > @@ -338,14 +344,6 @@ class Image: > > for p in self.partitions: > d = self.disks[p['disk_name']] > - if d['ptable_format'] == "msdos" and p['num'] == 5: > - # The last sector of the 3rd partition was reserved for the EBR > - # of the first _logical_ partition. This is why the extended > - # partition should start one sector before the first logical > - # partition. > - self.__write_partition(p['num'], p['source_file'], > - p['start'] - 1, > - d['offset'] - p['start']) > > self.__write_partition(p['num'], p['source_file'], > p['start'], p['size']) > -- > 1.9.3 > > -- > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core -- Maciej Borzęcki Senior Software Developer at Open-RnD Sp. z o.o., Poland www.open-rnd.pl mobile: +48 889 117 365, fax: +48 42 657 9079 Niniejsza wiadomość wraz z załącznikami może zawierać chronione prawem lub poufne informacje i została wysłana wyłącznie do wiadomości i użytku osób, do których została zaadresowana. Jeśli wiadomość została otrzymana przypadkowo zabrania się jej kopiowania lub rozsyłania do osób trzecich. W takim przypadku uprasza się o natychmiastowe zniszczenie wiadomości oraz poinformowanie nadawcy o zaistniałej sytuacji za pomocą wiadomości zwrotnej. Dziękujemy. This message, including any attachments hereto, may contain privileged or confidential information and is sent solely for the attention and use of the intended addressee(s). If you are not an intended addressee, you may neither use this message nor copy or deliver it to anyone. In such case, you should immediately destroy this message and kindly notify the sender by reply email. Thank you. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] wic: fix extended/logical partition layout 2015-02-02 7:37 ` Maciej Borzecki @ 2015-02-02 14:29 ` Tom Zanussi 2015-02-03 10:05 ` Maciej Borzecki 0 siblings, 1 reply; 9+ messages in thread From: Tom Zanussi @ 2015-02-02 14:29 UTC (permalink / raw) To: Maciej Borzecki; +Cc: Maciek Borzecki, openembedded-core On Mon, 2015-02-02 at 08:37 +0100, Maciej Borzecki wrote: > ping > This looks reasonable, but I haven't been able to verify it due to wic problems introduced by the recent kernel changes in oe-core. If you have test cases e.g. the kickstart file(s) that you used for testing the fix, please include them. Also, any testing you may have done to show it doesn't cause regressions in existing use cases. Thanks, Tom > On 01/09 14:24, Maciej Borzecki wrote: > > The patch fixes an issue in laying out extended and logical partitions > > by wic. The original code produced disk images in which the size 3rd > > partition as described in MBR was incorrect. Depending on the type of > > file system used for that partition and size of the partition, it would > > be impossible to mount the partition correctly. For instance, kickstart > > file in which the 3rd partition had size of 1GB and used ext4 fs, would > > result in an image with an umountable partition. The root cause is > > reservation of sectors for EBR through stealing of last sector from the > > last primary partition. > > > > Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl> > > Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com> > > --- > > scripts/lib/wic/utils/partitionedfs.py | 40 ++++++++++++++++------------------ > > 1 file changed, 19 insertions(+), 21 deletions(-) > > > > diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py > > index fb95cc7..9df93dc 100644 > > --- a/scripts/lib/wic/utils/partitionedfs.py > > +++ b/scripts/lib/wic/utils/partitionedfs.py > > @@ -156,6 +156,13 @@ class Image: > > # Skip one sector required for the partitioning scheme overhead > > d['offset'] += overhead > > > > + elif d['numpart'] > 3: > > + # Reserve a sector for EBR for every logical partition > > + # before alignment is performed. > > + if ptable_format == "msdos": > > + d['offset'] += 1 > > + > > + > > if p['align']: > > # If not first partition and we do have alignment set we need > > # to align the partition. > > @@ -185,14 +192,6 @@ class Image: > > p['num'] = d['numpart'] > > > > if d['ptable_format'] == "msdos": > > - if d['numpart'] > 2: > > - # Every logical partition requires an additional sector for > > - # the EBR, so steal the last sector from the end of each > > - # partition starting from the 3rd one for the EBR. This > > - # will make sure the logical partitions are aligned > > - # correctly. > > - p['size'] -= 1 > > - > > if d['numpart'] > 3: > > p['type'] = 'logical' > > p['num'] = d['numpart'] + 1 > > @@ -259,13 +258,20 @@ class Image: > > for p in self.partitions: > > d = self.disks[p['disk_name']] > > if d['ptable_format'] == "msdos" and p['num'] == 5: > > - # The last sector of the 3rd partition was reserved for the EBR > > - # of the first _logical_ partition. This is why the extended > > - # partition should start one sector before the first logical > > - # partition. > > + # Create an extended partition (note: extended > > + # partition is described in MBR and contains all > > + # logical partitions). The logical partitions save a > > + # sector for an EBR just before the start of a > > + # partition. The extended partition must start one > > + # sector before the start of the first logical > > + # partition. This way the first EBR is inside of the > > + # extended partition. Since the extended partitions > > + # starts a sector before the first logical partition, > > + # add a sector at the back, so that there is enough > > + # room for all logical partitions. > > self.__create_partition(d['disk'].device, "extended", > > None, p['start'] - 1, > > - d['offset'] - p['start']) > > + d['offset'] - p['start'] + 1) > > > > if p['fstype'] == "swap": > > parted_fs_type = "linux-swap" > > @@ -338,14 +344,6 @@ class Image: > > > > for p in self.partitions: > > d = self.disks[p['disk_name']] > > - if d['ptable_format'] == "msdos" and p['num'] == 5: > > - # The last sector of the 3rd partition was reserved for the EBR > > - # of the first _logical_ partition. This is why the extended > > - # partition should start one sector before the first logical > > - # partition. > > - self.__write_partition(p['num'], p['source_file'], > > - p['start'] - 1, > > - d['offset'] - p['start']) > > > > self.__write_partition(p['num'], p['source_file'], > > p['start'], p['size']) > > -- > > 1.9.3 > > > > -- > > _______________________________________________ > > Openembedded-core mailing list > > Openembedded-core@lists.openembedded.org > > http://lists.openembedded.org/mailman/listinfo/openembedded-core > > -- > Maciej Borzęcki > Senior Software Developer at Open-RnD Sp. z o.o., Poland > www.open-rnd.pl > mobile: +48 889 117 365, fax: +48 42 657 9079 > > > Niniejsza wiadomość wraz z załącznikami może > zawierać chronione prawem lub poufne informacje i została > wysłana wyłącznie do wiadomości i użytku osób, do których > została zaadresowana. Jeśli wiadomość została otrzymana > przypadkowo zabrania się jej kopiowania lub rozsyłania do osób > trzecich. W takim przypadku uprasza się o natychmiastowe > zniszczenie wiadomości oraz poinformowanie nadawcy o > zaistniałej sytuacji za pomocą wiadomości zwrotnej. > Dziękujemy. > > This message, including any attachments hereto, > may contain privileged or confidential information and is sent > solely for the attention and use of the intended addressee(s). > If you are not an intended addressee, you may neither use this > message nor copy or deliver it to anyone. In such case, you > should immediately destroy this message and kindly notify the > sender by reply email. Thank you. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] wic: fix extended/logical partition layout 2015-02-02 14:29 ` Tom Zanussi @ 2015-02-03 10:05 ` Maciej Borzecki 2015-02-03 12:49 ` Tom Zanussi 0 siblings, 1 reply; 9+ messages in thread From: Maciej Borzecki @ 2015-02-03 10:05 UTC (permalink / raw) To: Tom Zanussi; +Cc: Maciek Borzecki, openembedded-core On 02/02 08:29, Tom Zanussi wrote: > On Mon, 2015-02-02 at 08:37 +0100, Maciej Borzecki wrote: > > ping > > > > This looks reasonable, but I haven't been able to verify it due to wic > problems introduced by the recent kernel changes in oe-core. > > If you have test cases e.g. the kickstart file(s) that you used for > testing the fix, please include them. Also, any testing you may have > done to show it doesn't cause regressions in existing use cases. Kickstart that fails without the patch: part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4 --size 16 part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4 part /var/lib/misc --ondisk mmcblk0 --fstype=ext4 --label misc --size 128 part /mnt --ondisk mmcblk0 --fstype=ext4 --label fakedata --size 128 When mounting kernel ext4 complains about bad geometry of the 3rd partition (i.e. ext4 partition image was exactly 131072 blocks, but parted entry states 131071 blocks, wic stole the last sector of this partition, to account for EBR for the first extended): EXT4-fs (mmcblk0p3): bad geometry: block count 131072 exceeds size of device (131071 blocks) Then the first extended partition is not found, logical partition /dev/mmcblk0p4 is the last one visible. I'm guessing the EBR was overwritten by the last block of the 3rd partition image, hence the kerel cannot figure out the location of the extended partition. The problem won't be triggered unless there is a logical parition in kickstart. The only other kickstart using MBR is directdisk.wks, but it has only 2 partitions defined there. With the patch you can go on and define more crazy layout like this one below and it mounts properly: part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4 --size 16 part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4 part /var/lib/misc --ondisk mmcblk0 --fstype=ext4 --label misc --size 128 part /mnt --ondisk mmcblk0 --fstype=ext4 --label fakedata --size 128 part /mnt2 --ondisk mmcblk0 --fstype=ext4 --label fakedata2 --size 13 part /mnt3 --ondisk mmcblk0 --fstype=ext4 --label fakedata3 --size 64 -- Maciej Borzęcki Senior Software Developer at Open-RnD Sp. z o.o., Poland www.open-rnd.pl mobile: +48 889 117 365, fax: +48 42 657 9079 Niniejsza wiadomość wraz z załącznikami może zawierać chronione prawem lub poufne informacje i została wysłana wyłącznie do wiadomości i użytku osób, do których została zaadresowana. Jeśli wiadomość została otrzymana przypadkowo zabrania się jej kopiowania lub rozsyłania do osób trzecich. W takim przypadku uprasza się o natychmiastowe zniszczenie wiadomości oraz poinformowanie nadawcy o zaistniałej sytuacji za pomocą wiadomości zwrotnej. Dziękujemy. This message, including any attachments hereto, may contain privileged or confidential information and is sent solely for the attention and use of the intended addressee(s). If you are not an intended addressee, you may neither use this message nor copy or deliver it to anyone. In such case, you should immediately destroy this message and kindly notify the sender by reply email. Thank you. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] wic: fix extended/logical partition layout 2015-02-03 10:05 ` Maciej Borzecki @ 2015-02-03 12:49 ` Tom Zanussi 2015-02-06 2:27 ` Alexandre Belloni 0 siblings, 1 reply; 9+ messages in thread From: Tom Zanussi @ 2015-02-03 12:49 UTC (permalink / raw) To: Maciej Borzecki; +Cc: Maciek Borzecki, openembedded-core On Tue, 2015-02-03 at 11:05 +0100, Maciej Borzecki wrote: > On 02/02 08:29, Tom Zanussi wrote: > > On Mon, 2015-02-02 at 08:37 +0100, Maciej Borzecki wrote: > > > ping > > > > > > > This looks reasonable, but I haven't been able to verify it due to wic > > problems introduced by the recent kernel changes in oe-core. > > > > If you have test cases e.g. the kickstart file(s) that you used for > > testing the fix, please include them. Also, any testing you may have > > done to show it doesn't cause regressions in existing use cases. > > Kickstart that fails without the patch: > > part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4 --size 16 > part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4 > part /var/lib/misc --ondisk mmcblk0 --fstype=ext4 --label misc --size 128 > part /mnt --ondisk mmcblk0 --fstype=ext4 --label fakedata --size 128 > > When mounting kernel ext4 complains about bad geometry of the 3rd > partition (i.e. ext4 partition image was exactly 131072 blocks, but > parted entry states 131071 blocks, wic stole the last sector of this > partition, to account for EBR for the first extended): > > EXT4-fs (mmcblk0p3): bad geometry: block count 131072 exceeds size of > device (131071 blocks) > > Then the first extended partition is not found, logical partition > /dev/mmcblk0p4 is the last one visible. I'm guessing the EBR was > overwritten by the last block of the 3rd partition image, hence the > kerel cannot figure out the location of the extended partition. > > The problem won't be triggered unless there is a logical parition in > kickstart. The only other kickstart using MBR is directdisk.wks, but it > has only 2 partitions defined there. > > With the patch you can go on and define more crazy layout like this one > below and it mounts properly: > > part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4 --size 16 > part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4 > part /var/lib/misc --ondisk mmcblk0 --fstype=ext4 --label misc --size 128 > part /mnt --ondisk mmcblk0 --fstype=ext4 --label fakedata --size 128 > part /mnt2 --ondisk mmcblk0 --fstype=ext4 --label fakedata2 --size 13 > part /mnt3 --ondisk mmcblk0 --fstype=ext4 --label fakedata3 --size 64 > > Great, thanks for the detailed info. Acked-by: Tom Zanussi <tom.zanussi@linux.intel.com> > -- > Maciej Borzęcki > Senior Software Developer at Open-RnD Sp. z o.o., Poland > www.open-rnd.pl > mobile: +48 889 117 365, fax: +48 42 657 9079 > > > Niniejsza wiadomość wraz z załącznikami może > zawierać chronione prawem lub poufne informacje i została > wysłana wyłącznie do wiadomości i użytku osób, do których > została zaadresowana. Jeśli wiadomość została otrzymana > przypadkowo zabrania się jej kopiowania lub rozsyłania do osób > trzecich. W takim przypadku uprasza się o natychmiastowe > zniszczenie wiadomości oraz poinformowanie nadawcy o > zaistniałej sytuacji za pomocą wiadomości zwrotnej. > Dziękujemy. > > This message, including any attachments hereto, > may contain privileged or confidential information and is sent > solely for the attention and use of the intended addressee(s). > If you are not an intended addressee, you may neither use this > message nor copy or deliver it to anyone. In such case, you > should immediately destroy this message and kindly notify the > sender by reply email. Thank you. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] wic: fix extended/logical partition layout 2015-02-03 12:49 ` Tom Zanussi @ 2015-02-06 2:27 ` Alexandre Belloni 2015-02-06 3:02 ` Tom Zanussi 0 siblings, 1 reply; 9+ messages in thread From: Alexandre Belloni @ 2015-02-06 2:27 UTC (permalink / raw) To: Tom Zanussi; +Cc: Maciek Borzecki, openembedded-core Hi, I hit that issue today. And that indeed solves it. Tested-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> We were wondering who is responsible to take that patch in, do you have an idea? On 03/02/2015 at 06:49:54 -0600, Tom Zanussi wrote : > On Tue, 2015-02-03 at 11:05 +0100, Maciej Borzecki wrote: > > On 02/02 08:29, Tom Zanussi wrote: > > > On Mon, 2015-02-02 at 08:37 +0100, Maciej Borzecki wrote: > > > > ping > > > > > > > > > > This looks reasonable, but I haven't been able to verify it due to wic > > > problems introduced by the recent kernel changes in oe-core. > > > > > > If you have test cases e.g. the kickstart file(s) that you used for > > > testing the fix, please include them. Also, any testing you may have > > > done to show it doesn't cause regressions in existing use cases. > > > > Kickstart that fails without the patch: > > > > part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4 --size 16 > > part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4 > > part /var/lib/misc --ondisk mmcblk0 --fstype=ext4 --label misc --size 128 > > part /mnt --ondisk mmcblk0 --fstype=ext4 --label fakedata --size 128 > > > > When mounting kernel ext4 complains about bad geometry of the 3rd > > partition (i.e. ext4 partition image was exactly 131072 blocks, but > > parted entry states 131071 blocks, wic stole the last sector of this > > partition, to account for EBR for the first extended): > > > > EXT4-fs (mmcblk0p3): bad geometry: block count 131072 exceeds size of > > device (131071 blocks) > > > > Then the first extended partition is not found, logical partition > > /dev/mmcblk0p4 is the last one visible. I'm guessing the EBR was > > overwritten by the last block of the 3rd partition image, hence the > > kerel cannot figure out the location of the extended partition. > > > > The problem won't be triggered unless there is a logical parition in > > kickstart. The only other kickstart using MBR is directdisk.wks, but it > > has only 2 partitions defined there. > > > > With the patch you can go on and define more crazy layout like this one > > below and it mounts properly: > > > > part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4 --size 16 > > part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4 > > part /var/lib/misc --ondisk mmcblk0 --fstype=ext4 --label misc --size 128 > > part /mnt --ondisk mmcblk0 --fstype=ext4 --label fakedata --size 128 > > part /mnt2 --ondisk mmcblk0 --fstype=ext4 --label fakedata2 --size 13 > > part /mnt3 --ondisk mmcblk0 --fstype=ext4 --label fakedata3 --size 64 > > > > > > Great, thanks for the detailed info. > > Acked-by: Tom Zanussi <tom.zanussi@linux.intel.com> > > > -- > > Maciej Borzęcki > > Senior Software Developer at Open-RnD Sp. z o.o., Poland > > www.open-rnd.pl > > mobile: +48 889 117 365, fax: +48 42 657 9079 > > > > > > Niniejsza wiadomość wraz z załącznikami może > > zawierać chronione prawem lub poufne informacje i została > > wysłana wyłącznie do wiadomości i użytku osób, do których > > została zaadresowana. Jeśli wiadomość została otrzymana > > przypadkowo zabrania się jej kopiowania lub rozsyłania do osób > > trzecich. W takim przypadku uprasza się o natychmiastowe > > zniszczenie wiadomości oraz poinformowanie nadawcy o > > zaistniałej sytuacji za pomocą wiadomości zwrotnej. > > Dziękujemy. > > > > This message, including any attachments hereto, > > may contain privileged or confidential information and is sent > > solely for the attention and use of the intended addressee(s). > > If you are not an intended addressee, you may neither use this > > message nor copy or deliver it to anyone. In such case, you > > should immediately destroy this message and kindly notify the > > sender by reply email. Thank you. > > > -- > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core -- Alexandre Belloni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] wic: fix extended/logical partition layout 2015-02-06 2:27 ` Alexandre Belloni @ 2015-02-06 3:02 ` Tom Zanussi 2015-02-06 11:43 ` Burton, Ross 0 siblings, 1 reply; 9+ messages in thread From: Tom Zanussi @ 2015-02-06 3:02 UTC (permalink / raw) To: Alexandre Belloni; +Cc: Maciek Borzecki, openembedded-core On Fri, 2015-02-06 at 03:27 +0100, Alexandre Belloni wrote: > Hi, > > I hit that issue today. And that indeed solves it. > > Tested-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> > > We were wondering who is responsible to take that patch in, do you have > an idea? > I think for master it's Ross, cc'ed. Sometimes it takes awhile, you just have to check every so often to see when it hits master. Ross can correct me, but I think this is where its staged before it hits master, so you can see what's in the queue for testing (master under test): http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=ross/mut Tom > On 03/02/2015 at 06:49:54 -0600, Tom Zanussi wrote : > > On Tue, 2015-02-03 at 11:05 +0100, Maciej Borzecki wrote: > > > On 02/02 08:29, Tom Zanussi wrote: > > > > On Mon, 2015-02-02 at 08:37 +0100, Maciej Borzecki wrote: > > > > > ping > > > > > > > > > > > > > This looks reasonable, but I haven't been able to verify it due to wic > > > > problems introduced by the recent kernel changes in oe-core. > > > > > > > > If you have test cases e.g. the kickstart file(s) that you used for > > > > testing the fix, please include them. Also, any testing you may have > > > > done to show it doesn't cause regressions in existing use cases. > > > > > > Kickstart that fails without the patch: > > > > > > part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4 --size 16 > > > part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4 > > > part /var/lib/misc --ondisk mmcblk0 --fstype=ext4 --label misc --size 128 > > > part /mnt --ondisk mmcblk0 --fstype=ext4 --label fakedata --size 128 > > > > > > When mounting kernel ext4 complains about bad geometry of the 3rd > > > partition (i.e. ext4 partition image was exactly 131072 blocks, but > > > parted entry states 131071 blocks, wic stole the last sector of this > > > partition, to account for EBR for the first extended): > > > > > > EXT4-fs (mmcblk0p3): bad geometry: block count 131072 exceeds size of > > > device (131071 blocks) > > > > > > Then the first extended partition is not found, logical partition > > > /dev/mmcblk0p4 is the last one visible. I'm guessing the EBR was > > > overwritten by the last block of the 3rd partition image, hence the > > > kerel cannot figure out the location of the extended partition. > > > > > > The problem won't be triggered unless there is a logical parition in > > > kickstart. The only other kickstart using MBR is directdisk.wks, but it > > > has only 2 partitions defined there. > > > > > > With the patch you can go on and define more crazy layout like this one > > > below and it mounts properly: > > > > > > part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4 --size 16 > > > part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4 > > > part /var/lib/misc --ondisk mmcblk0 --fstype=ext4 --label misc --size 128 > > > part /mnt --ondisk mmcblk0 --fstype=ext4 --label fakedata --size 128 > > > part /mnt2 --ondisk mmcblk0 --fstype=ext4 --label fakedata2 --size 13 > > > part /mnt3 --ondisk mmcblk0 --fstype=ext4 --label fakedata3 --size 64 > > > > > > > > > > Great, thanks for the detailed info. > > > > Acked-by: Tom Zanussi <tom.zanussi@linux.intel.com> > > > > > -- > > > Maciej Borzęcki > > > Senior Software Developer at Open-RnD Sp. z o.o., Poland > > > www.open-rnd.pl > > > mobile: +48 889 117 365, fax: +48 42 657 9079 > > > > > > > > > Niniejsza wiadomość wraz z załącznikami może > > > zawierać chronione prawem lub poufne informacje i została > > > wysłana wyłącznie do wiadomości i użytku osób, do których > > > została zaadresowana. Jeśli wiadomość została otrzymana > > > przypadkowo zabrania się jej kopiowania lub rozsyłania do osób > > > trzecich. W takim przypadku uprasza się o natychmiastowe > > > zniszczenie wiadomości oraz poinformowanie nadawcy o > > > zaistniałej sytuacji za pomocą wiadomości zwrotnej. > > > Dziękujemy. > > > > > > This message, including any attachments hereto, > > > may contain privileged or confidential information and is sent > > > solely for the attention and use of the intended addressee(s). > > > If you are not an intended addressee, you may neither use this > > > message nor copy or deliver it to anyone. In such case, you > > > should immediately destroy this message and kindly notify the > > > sender by reply email. Thank you. > > > > > > -- > > _______________________________________________ > > Openembedded-core mailing list > > Openembedded-core@lists.openembedded.org > > http://lists.openembedded.org/mailman/listinfo/openembedded-core > > -- > Alexandre Belloni, Free Electrons > Embedded Linux, Kernel and Android engineering > http://free-electrons.com ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] wic: fix extended/logical partition layout 2015-02-06 3:02 ` Tom Zanussi @ 2015-02-06 11:43 ` Burton, Ross 0 siblings, 0 replies; 9+ messages in thread From: Burton, Ross @ 2015-02-06 11:43 UTC (permalink / raw) To: Tom Zanussi; +Cc: Maciek Borzecki, OE-core [-- Attachment #1: Type: text/plain, Size: 584 bytes --] On 6 February 2015 at 03:02, Tom Zanussi <tom.zanussi@linux.intel.com> wrote: > I think for master it's Ross, cc'ed. Sometimes it takes awhile, you > just have to check every so often to see when it hits master. Ross can > correct me, but I think this is where its staged before it hits master, > so you can see what's in the queue for testing (master under test): > > http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=ross/mut > That right. I've been adding the wic patches over the last few days so they'll be hitting master early next week. Ross [-- Attachment #2: Type: text/html, Size: 1128 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2015-02-06 11:44 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-01-09 13:24 [PATCH 0/1] wic: fix extended/logical partition layout Maciej Borzecki 2015-01-09 13:24 ` [PATCH 1/1] " Maciej Borzecki 2015-02-02 7:37 ` Maciej Borzecki 2015-02-02 14:29 ` Tom Zanussi 2015-02-03 10:05 ` Maciej Borzecki 2015-02-03 12:49 ` Tom Zanussi 2015-02-06 2:27 ` Alexandre Belloni 2015-02-06 3:02 ` Tom Zanussi 2015-02-06 11:43 ` Burton, Ross
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox