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

An error on the file 'config-static-bmc-reboot.json' generation #10

Open
FredChangInv323 opened this issue May 12, 2022 · 4 comments
Open

Comments

@FredChangInv323
Copy link

I build the source code by meson with "-Dupdate-type=static-layout". But that file will embed error values like the following.

###config-static-bmc-reboot.json###
[{
        "blob": "/flash/image",
        "handler": {
                "type": "file",
                "path": ""/run/initramfs/bmc-image""
        },
        "actions": {
                "preparation": {
                        "type": "systemd",
                        "unit": ""phosphor-ipmi-flash-bmc-prepare.target""
                },
                "verification": {
                        "type": "systemd",
                        "unit": ""phosphor-ipmi-flash-bmc-verify.target""
                },
                "update": {
                        "type": "reboot"
                }
        }
}]

I found that the line "conf_data.set_quoted('STATIC_HANDLER_STAGED_NAME', get_option('static-handler-staged-name'))" in meson will quote the string and define STATIC_HANDLER_STAGED_NAME in header. It will be used in config-static-bmc-reboot.json.in to generate config-static-bmc-reboot.json file.

The line in config-static-bmc-reboot.json.in will give the string more than one quote.

"path": "@STATIC_HANDLER_STAGED_NAME@" 
to 
"path": ""/run/initramfs/bmc-image""

Is it a bug or not?
Please help, thanks.

@williamspatrick
Copy link
Member

Looks like a bug. Can you supply a fix?

@brandonkimbk
Copy link
Contributor

brandonkimbk commented May 12, 2022

Ah it looks like we probably haven't hit this case (most likely started happening during the meson migration) because at Google, we just override the json itself (take a look at "dummy-gbmc-update"): https://github.com/openbmc/openbmc/tree/master/meta-google/recipes-phosphor/flash

It seems like the simple fix is to, either take out the "" around the @STATIC_HANDLER_STAGED_NAME@ in the json or use .set instead of .set_quoted in the meson. I don't really have a preference - maybe easier to use .set instead in meson opposed to changing the json templates?

Do you mind making the change to test it with your use case by any chance?

@FredChangInv323
Copy link
Author

Maybe taking out the "" around the @STATIC_HANDLER_STAGED_NAME@ is the right way.
Because using .set instead of .set_quoted causes the error definition in config.h.

#define STATIC_HANDLER_STAGED_NAME /run/initramfs/bmc-image

Thanks.

@brandonkimbk
Copy link
Contributor

Ah yes, that makes sense. Thanks Fred - please feel free to take the "" around the jsons and push the code for review on Gerrit if possible. If you're unable to, I can push the change for review as well - just let me konw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants