Page MenuHomeFreeBSD

Add flashmap rootfs search function
AbandonedPublic

Authored by yamori813_yahoo.co.jp on Dec 27 2017, 8:40 AM.

Details

Summary

This code based geom_map.c. This function enable by kernel
option GEOM_FLASHMAP_ADJUST_BORDER.

Test Plan

RT3050 at sys/mips/mediatek code.

Diff Detail

Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 13857
Build 14069: arc lint + arc unit

Event Timeline

mizhka requested changes to this revision.Dec 27 2017, 12:46 PM

Hi,

Small cosmetic changes are required.
But I don't get idea why this marker lookup can't be done by flash_slicer code.
Could you please clarify benefit?

Thank you!

sys/geom/geom_flashmap.c
212–214

add declaration at top of file?

218

128 bytes on stack is not good, please malloc/free it.

254

bootverbose?

259

please prefix g_flashmap_%

This revision now requires changes to proceed.Dec 27 2017, 12:46 PM

If kernel configuration change and kernel size make big then std partition information is missing. In this case boot stop at mountroot. It's inconvenient. Non-FDT slicer geom_map have same function. I think more better this function set by FDT information than kernel option. But I don't know FDT access in geom code.

  • rewrite rootfs check logic

I think dts must not have kernel size because of it's change kernel configuration. This code separate to kernel and rootfs from firmware partition.

This is dts entory.

firmware: partition@50000 {
        label = "firmware";
        reg = <0x00050000 0x003b0000>;
        read-only;
};

This is boot log.

cfid0: slice 00050000-0015ffff: firmware (1087KB)
cfid0: slice 00160000-003fffff: rootfs (2687KB)

  • check 64K and 128K boundly. add comment and static
  • delete kernel option make to default
  • impliment of a few u-boot have space before header
In D13648#285288, @mizhka_gmail.com wrote:

Hi,
Small cosmetic changes are required.
But I don't get idea why this marker lookup can't be done by flash_slicer code.
Could you please clarify benefit?
Thank you!

I checked dev/bhnd/cores/chipc/chipc_slicer.c. This code on CFI or SPI low level driver code. General CFI and SPI driver code use not only u-boot. I think good that is not change CFE and SPI driver code. Also I think geom_flashmap change is more small side effect than flash_slicer change.

sbruno removed a reviewer: sbruno.Mar 24 2019, 1:43 PM

Now this patch is conflict. I hope some body make this future.