Bug 13560

Summary: Partition numbering is broken for MBR primary partition #4
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: michaelcooper81
Component: meta-yoctoAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: akuster, poky.bs.watcher, poky.watcher, randy.macleod
Version: 2.7.2   
Target Milestone: 2.8 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
Proposed patch none

Description michaelcooper81 2019-09-27 18:40:04 UTC
Created attachment 4572 [details]
Proposed patch

When wks describes extra partitions that aren't in the partition table (e.g. boot loader) and describes four proper MBR partitions, the last partition gets added to fstab as partition #5 instead of #4.

Repro wks:

part bootloader --no-table
part /boot --ondisk mmcblk0 --label boot
part / --ondisk mmcblk0 --label root1
part / --ondisk mmcblk0 --label root2
part /data --ondisk mmcblk0 --label data
bootloader --ptable msdos

Generated fstab:
/dev/mmcblk0p1	/boot	ext4	defaults	0	0
/dev/mmcblk0p5	/data

(/dev/mmcblk0p5 should be /dev/mmcblk0p4)

Proposed patch attached.
Comment 1 Randy MacLeod 2019-10-03 14:37:13 UTC
Is there a test that we can add to ensure that this doesn't happen in the future?

Are you able to send a patch to the email list?
https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded#Sending_using_git-send-email
Comment 3 Armin Kuster 2019-10-17 14:53:30 UTC
made it into zeus
Comment 4 Richard Purdie 2019-10-17 14:54:06 UTC
Fixed with the above commit.
Comment 5 Richard Purdie 2019-10-17 15:15:09 UTC
Mark as resolved