Skip to content
Snippets Groups Projects
  • Rafał Miłecki's avatar
    93259e8c
    bcm4908: support "rootfs_data" on U-Boot devices · 93259e8c
    Rafał Miłecki authored
    
    1. Create "rootfs_data" dynamicaly
    
    U-Boot firmware images can contain only 2 UBI volumes: bootfs (container
    with U-Boot + kernel + DTBs) and rootfs (e.g. squashfs). There is no way
    to include "rootfs_data" UBI volume or make firmware file tell U-Boot to
    create one.
    
    For that reason "rootfs_data" needs to be created dynamically. Use
    preinit script to handle that. Fire it right before "mount_root" one.
    
    2. Relate "rootfs_data" to flashed firmware
    
    As already explained flashing new firmware with U-Boot will do nothing
    to the "rootfs_data". It could result in new firmware reusing old
    "rootfs_data" overlay UBI volume and its file. Users expect a clean
    state after flashing firmware (even if flashing the same one).
    
    Solve that by reading flash counter of running firmware and storing it
    in "rootfs_data" UBI volume. Every mismatch will result in wiping old
    data.
    
    Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
    93259e8c
    History
    bcm4908: support "rootfs_data" on U-Boot devices
    Rafał Miłecki authored
    
    1. Create "rootfs_data" dynamicaly
    
    U-Boot firmware images can contain only 2 UBI volumes: bootfs (container
    with U-Boot + kernel + DTBs) and rootfs (e.g. squashfs). There is no way
    to include "rootfs_data" UBI volume or make firmware file tell U-Boot to
    create one.
    
    For that reason "rootfs_data" needs to be created dynamically. Use
    preinit script to handle that. Fire it right before "mount_root" one.
    
    2. Relate "rootfs_data" to flashed firmware
    
    As already explained flashing new firmware with U-Boot will do nothing
    to the "rootfs_data". It could result in new firmware reusing old
    "rootfs_data" overlay UBI volume and its file. Users expect a clean
    state after flashing firmware (even if flashing the same one).
    
    Solve that by reading flash counter of running firmware and storing it
    in "rootfs_data" UBI volume. Every mismatch will result in wiping old
    data.
    
    Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>