Skip to content

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

Open
@shenki

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions