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

Add uboot CRC32 checks for kernel and device-tree #3141

Merged
merged 4 commits into from
Jun 14, 2023
Merged

Commits on Jun 14, 2023

  1. balena_check_crc: Add helper u-boot command for crc manipulation

    This helper command saves and compares crc32 sum for a memory
    area where the kernel image or the device-tree is loaded.
    
    Can be used after loading the kernel and the dtb, and also prior
    to calling booti.
    
    Signed-off-by: Alexandru Costache <alexandru@balena.io>
    Change-type: patch
    acostach authored and alexgg committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    770cbdb View commit details
    Browse the repository at this point in the history
  2. classes/resin-u-boot: Inject crc helper command

    ... and provide default values for the kernel and
    fdt address variables which can be modified by
    device repositories.
    
    Signed-off-by: Alexandru Costache <alexandru@balena.io>
    acostach authored and alexgg committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    215efb3 View commit details
    Browse the repository at this point in the history
  3. recipes-bsp/u-boot: Add script functions for checking kernel and dtb …

    …validity
    
    The balena_kernel_load_crc_save / balena_fdt_load_crc_check functions
    can be used in the device repository right after the kernel or
    dtb is loaded and prior to calling the main boot function,
    to verify if the memory areas of the kernel or fdt overlap
    or may otherwise be re-written. These functions will save
    create a file named overlap_detected in the boot partition,
    which can be checked during automated testing. These checks
    should not prevent booting in any way.
    
    Signed-off-by: Alexandru Costache <alexandru@balena.io>
    acostach authored and alexgg committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    15be0a6 View commit details
    Browse the repository at this point in the history
  4. tests/os: Add kernel - dtb overlap test

    If a kernel or dtb overlap or overwrite is detected in u-boot,
    a file named overlap_detected is created in the boot partition.
    
    In this test we check for the presence of this file.
    
    Signed-off-by: Alexandru Costache <alexandru@balena.io>
    acostach authored and alexgg committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    446bd6d View commit details
    Browse the repository at this point in the history