lnls-dig/hpm-downloader

Workaround openMMC bug in interpreting the 'components' field

Closed this issue · 0 comments

openMMC uses the components field of the 'Initiate upgrade action' command as an index to select what functions will handle the upgrade instead of interpreting it as a bit field. As a consequence, trying to do an bootloader upgrade will fail due to this check:

switch(img_info.actions[i].components){
case 1: printf("[INFO] \t {Upgrade action detected} \t Upgrade for component 0 \n"); break;
case 2: printf("[INFO] \t {Upgrade action detected} \t Upgrade for component 1 \n"); break;
case 4: printf("[INFO] \t {Upgrade action detected} \t Upgrade for component 2 \n"); break;
case 8: printf("[INFO] \t {Upgrade action detected} \t Upgrade for component 3 \n"); break;
case 16: printf("[INFO] \t {Upgrade action detected} \t Upgrade for component 4 \n"); break;
case 32: printf("[INFO] \t {Upgrade action detected} \t Upgrade for component 5 \n"); break;
case 64: printf("[INFO] \t {Upgrade action detected} \t Upgrade for component 6 \n"); break;
case 128: printf("[INFO] \t {Upgrade action detected} \t Upgrade for component 7 \n"); break;
default: printf("[INFO] \t {Upgrade action} \t\t Components value : 0x%02x \n", img_info.actions[i].components); return 0xFB;
}

Add a new command line argument to allow optionally skipping this test until this bug is fixed in openMMC. This flag could be named --ignore-component-check.