Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffspart: broken layout when blocksize is larger than first partition start #202

Open
shenki opened this issue Nov 28, 2018 · 0 comments
Open

Comments

@shenki
Copy link
Member

shenki commented Nov 28, 2018

Creating a ffs image with this configuration:

@0,0x0,
FIRST,0x400,0x100,,,/dev/zero
$ touch test.ffs
$ ./ffspart -s 0x1000 -c 10 -i test.csv -p test.ffs
$ pflash -i -F test.ffs 
Flash info:
-----------
Name          = /home/joel/dev/skiboot/external/ffspart/test.ffs
Total size    = 0MB	 Flags E:ECC, P:PRESERVED, R:READONLY, B:BACKUP
Erase granule =  0KB           F:REPROVISION, V:VOLATILE, C:CLEARECC

TOC@0x00000000 Partitions:
-----------
ID=00            part 0x00000000..0x00001000 (actual=0x00001000) [----------]
ID=01           FIRST 0x00000000..0x00000000 (actual=0x00000100) [----------]

FIRST should start at 0x400, but as eraseblock size 0x1000 > 0x400, the toc (named 'part') is placed there first, and everything is broken from then on.

While it's a bad idea to have any partition smaller than the eraseblock size, ffspart should still create the image, and perhaps warn the user when creating the partition boundry when it is not eraseblock aligned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant