Skip to content
Snippets Groups Projects
Forked from Reform / reform-boundary-uboot
Source project has a limited visibility.
  • Gabor Juhos's avatar
    0f307343
    common/cmd_bootm.c: prevent running of subcommands before 'bootm start' · 0f307343
    Gabor Juhos authored
    
    The execution order of the bootm subcommands is fixed.
    Although here is a sanity check in the state machine
    which should prevent running the subcommands in wrong
    order but it does not catch all possible errors.
    
    It is possible to run any subcommand without running
    'bootm start' first which leads to unexpected behaviour.
    For example, running 'bootm loados' without 'bootm start'
    causes a hang:
    
        U-Boot> bootm loados
           XIP Invalid Image ... OK
        OK
    
    Add a sanity check to 'do_bootm_subcommand' in order
    to ensure that no subcommands can be executed before
    'bootm start'.
    
    After the patch running of any subcommand without running
    'bootm start' will cause an error like this:
    
        U-Boot> bootm loados
        Trying to execute a command out of order
        bootm - boot application image from memory
    
        Usage:
        bootm [addr [arg ...]]
            - boot application image stored in memory
        ...
    
    Signed-off-by: default avatarGabor Juhos <juhosg@openwrt.org>
    0f307343
    History
    common/cmd_bootm.c: prevent running of subcommands before 'bootm start'
    Gabor Juhos authored
    
    The execution order of the bootm subcommands is fixed.
    Although here is a sanity check in the state machine
    which should prevent running the subcommands in wrong
    order but it does not catch all possible errors.
    
    It is possible to run any subcommand without running
    'bootm start' first which leads to unexpected behaviour.
    For example, running 'bootm loados' without 'bootm start'
    causes a hang:
    
        U-Boot> bootm loados
           XIP Invalid Image ... OK
        OK
    
    Add a sanity check to 'do_bootm_subcommand' in order
    to ensure that no subcommands can be executed before
    'bootm start'.
    
    After the patch running of any subcommand without running
    'bootm start' will cause an error like this:
    
        U-Boot> bootm loados
        Trying to execute a command out of order
        bootm - boot application image from memory
    
        Usage:
        bootm [addr [arg ...]]
            - boot application image stored in memory
        ...
    
    Signed-off-by: default avatarGabor Juhos <juhosg@openwrt.org>