Questions on openBMC compilation
Lei YU
mine260309 at gmail.com
Mon Apr 9 13:28:41 AEST 2018
On Fri, Apr 6, 2018 at 9:00 AM, Mam Nag <mam.nagv at yahoo.com> wrote:
> Hello,
>
>
>
> I am working on supporting new platform which has AST2500. Some of the
> questions I have are:
>
>
>
> 1. If I want to make changes to any openBMC component for development,
> is folder “openbmc/build/tmp/work/” right location to make changes?
No.
>
> 2. When I try to build openBMC for AST2500, no option to configure the
> linux kernel. If I want to add new driver to the kernel to support new
> sensor chip. Once add the code into kernel
>
> a. can I know which configuration file to change in the linux kernel
> to enable new driver. In standard kernel this can be done through .config.
> However in openBMC we didn’t find .config file.
It depends on the machine for the specific configs.
The common config for AST2500 is at:
meta-openbmc-bsp/meta-aspeed/meta-ast2500/recipes-kernel/linux/linux-obmc/defconfig
The machine specific config is put at "meta-machine" layer, e.g.
meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-kernel/linux/linux-obmc/romulus.cfg
>
> b. Once step “a” is done how do I recompile openBMC build? . Do I need
> to run “bitbake obmc-phosphor-image” again?. Will this take my changes
> done?. FYI: I made small one line change in kernel source code, reran
> “bitbake obmc-phosphor-image” and got message “NOTE: Tasks Summary:
> Attempted 3940 tasks of which 3940 didn't need to be rerun and all
> succeeded” – looks like changes are not recognized.
There are several ways to modify a repo, e.g. you can modify the recipe
to point to your own code, or add patches to the recipe.
But I would suggest to use the "devtool" way to modify code.
E.g. to modify the kernel, you actually need to modify the "linux-obmc"
recipe, so you can do:
```
# It will create build/workspace/sources/linux-obmc/ and add linux-obmc's
# bbappend in build/workspace/appends/ automatically
# So when you do build, bitbake will build the code in your workspace
devtool modify linux-obmc
# Do modifications in build/workspace/sources/linux-obmc/
bitbake obmc-phosphor-image # Now build your code
```
>
> 3. I want add new sensor to “recipes-phosphor/sensors/”. (I have gone
> through “docs/sensor-architecture.md” and couldn’t find details for the
> below questions)
>
> a. Is there any specific rules to name “.conf” file?
>
Yes, the doc actually mentions this:
The children of the obmc/hwmon directory should follow the children of the
devicetree/base directory path on the system as defined by the kernel.
In short, the conf file's name and path shall match the device tree.
> b. If there are multiple sensors inside i2c bus, how are “.conf” files
> for each of the sensors defined?
The same as above, each conf file matches the devices tree's specific device.
>
> c. How does openBMC/phosphor know which i2c device register it has to
> talk to for a specific sensor
The same as above.
>
> 4. How do I add this sensor to “Dbus” interface?. Does step 2 cover
> this?
phosphor-hwmon parse the .conf, read the hwmon sensor in sysfs, and create
Dbus objects.
So both step 2 and step 3 are necessary.
>
> 5. How do I add sensor to “hwmon”
The save as above.
>
> 6. Noticed there are many “bin” files generated after the build, can I
> know which file to use to flash that has “uboot+kernel+openbmc+…”. Can I
> flash this image on new system, without making any changes to openBMC
> components ?
Please refer to
https://github.com/openbmc/docs/blob/master/code-update/code-update.md
>
> Thanks in advance for your help.
>
>
More information about the openbmc
mailing list