Skip to contentSkip to conversation

RedBoot FIS Directory parsing bails out early

DISCUSSION Russ Dill 2 participants 3 messages Aug 23, 2005 – Aug 24, 2005 Memory technology devices (MTD)

lore
Share & tools
lore

Russ Dill

author
#0 lore raw

Deleted partitions cause the FIS directory parsing to bail out early, this is because in redboot, deleting a partition causes the first byte in the entry to be set to 0xff. The kernel is currently looking for 0xff as an end of table marker.

This means that if you create two partitions, ie, test1 and test2, and then delete test1, the kernel will no longer detect test1.

redboot.c should instead scan every entry in the FIS table, and throw out any entries that begin with 0xff, ie, change the break to a continue. The checksum check should also be changed from a break to a continue (even though checksums in fis tables were never implemented anyway).

pseudo patch:

struct fis_list *new_fl, **prev

if (buf[i].name[0] == 0xff)
- break;
+ continue;
if (!redboot_checksum(&buf[i]))
- break;
+ continue;

#1 lore raw
Quoted 20 lines · Russ Dill

Deleted partitions cause the FIS directory parsing to bail out early, this is because in redboot, deleting a partition causes the first byte in the entry to be set to 0xff. The kernel is currently looking for 0xff as an end of table marker.

This means that if you create two partitions, ie, test1 and test2, and then delete test1, the kernel will no longer detect test1.

redboot.c should instead scan every entry in the FIS table, and throw out any entries that begin with 0xff, ie, change the break to a continue. The checksum check should also be changed from a break to a continue (even though checksums in fis tables were never implemented anyway).

pseudo patch:

struct fis_list *new_fl, **prev

if (buf[i].name[0] == 0xff)

Review

Quoted 5 lines
(quoted diff) +2 -2
-       break;
+       continue;
 if (!redboot_checksum(&buf[i]))
-       break;
+       continue;

Care to provide a real patch ?

tglx

author
#2 lore raw
Quoted 26 lines
Quoted 20 lines

Deleted partitions cause the FIS directory parsing to bail out early, this is because in redboot, deleting a partition causes the first byte in the entry to be set to 0xff. The kernel is currently looking for 0xff as an end of table marker.

This means that if you create two partitions, ie, test1 and test2, and then delete test1, the kernel will no longer detect test1.

redboot.c should instead scan every entry in the FIS table, and throw out any entries that begin with 0xff, ie, change the break to a continue. The checksum check should also be changed from a break to a continue (even though checksums in fis tables were never implemented anyway).

pseudo patch:

struct fis_list *new_fl, **prev

if (buf[i].name[0] == 0xff)

Review

Quoted 5 lines
(quoted diff) +2 -2
-       break;
+       continue;
 if (!redboot_checksum(&buf[i]))
-       break;
+       continue;
Quoted 2 lines

Care to provide a real patch ?

Actually, looking at some linux boards out there, because the space allocated to the partition table is so large (usually around 120k), the extra space is often used for board specific stuff. It'd probably be good to add in a:

if (buf[i].name[0] == 0xff && buf[i].name[1] == 0xff)

        break;

Sorry though, I can't generate a real patch at the moment.