openbmc / entity-manager

Run-time JSON driven system configuration manager
Other
26 stars 48 forks source link

cross compile for entity-manager #2

Closed vyattalee closed 4 years ago

vyattalee commented 4 years ago

how to fix the following cross compile issue?

the same cross compile environment-setup work fine for phosphor-state-manager, but there is the following issue existing in entity-manager.

$ echo ${CONFIGURE_FLAGS} --target=arm-openbmc-linux-gnueabi --host=arm-openbmc-linux-gnueabi --build=x86_64-linux --with-libtool-sysroot=/home/jienl/CPP_Workspace/openbmc/sdk/romulus-2019-10-09/sysroots/arm1176jzs-openbmc-linux-gnueabi

~/CPP_Workspace/openbmc/modify-entity-manager$ make [ 2%] Performing update step for 'nlohmann-json' [ 4%] No configure step for 'nlohmann-json' [ 7%] No build step for 'nlohmann-json' [ 9%] Performing install step for 'nlohmann-json' [ 11%] Completed 'nlohmann-json' [ 19%] Built target nlohmann-json [ 21%] Performing update step for 'sdbusplus-project' [ 23%] No configure step for 'sdbusplus-project' [ 26%] Performing build step for 'sdbusplus-project'

feistjj commented 4 years ago

You need to apt install autconf and autoconf archive as sdbusplus requires them

https://github.com/openbmc/entity-manager/blob/ce80db74ee4eceef3dcd236c74ba4d2aaaf76bda/CMakeLists.txt#L81

vyattalee commented 4 years ago

thanks for your information firstly. autconf and autoconf archive has been already installed. by the way, I use the native compile environment to compile the entity-manager. it is ok. but it doesn't work in cross compile environment

native compile environment as below: gcc version: gcc (Ubuntu 8.3.0-6ubuntu1~18.04.1) 8.3.0 Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

autoconf --version autoconf (GNU Autoconf) 2.69 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+/Autoconf: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html, http://gnu.org/licenses/exceptions.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Written by David J. MacKenzie and Akim Demaille.

automake --version automake (GNU automake) 1.15.1 Copyright (C) 2017 Free Software Foundation, Inc. License GPLv2+: GNU GPL version 2 or later http://gnu.org/licenses/gpl-2.0.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Written by Tom Tromey tromey@redhat.com and Alexandre Duret-Lutz adl@gnu.org._

cross compile enviornment as below: _echo ${CONFIGURE_FLAGS} --target=arm-openbmc-linux-gnueabi --host=arm-openbmc-linux-gnueabi --build=x86_64-linux --with-libtool-sysroot=/home/jienl/CPP_Workspace/openbmc/sdk/romulus-2019-10-09/sysroots/arm1176jzs-openbmc-linux-gnueabi

which autoconf /home/jienl/CPP_Workspace/openbmc/sdk/romulus-2019-10-09/sysroots/x86_64-oesdk-linux/usr/bin/autoconf

which automake /home/jienl/CPP_Workspace/openbmc/sdk/romulus-2019-10-09/sysroots/x86_64-oesdk-linux/usr/bin/automake

autoconf --version autoconf (GNU Autoconf) 2.69 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+/Autoconf: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html, http://gnu.org/licenses/exceptions.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Written by David J. MacKenzie and Akim Demaille.

automake --version automake (GNU automake) 1.16.1 Copyright (C) 2018 Free Software Foundation, Inc. License GPLv2+: GNU GPL version 2 or later https://gnu.org/licenses/gpl-2.0.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Written by Tom Tromey tromey@redhat.com and Alexandre Duret-Lutz adl@gnu.org._

vyattalee commented 4 years ago

log for native compile

make Scanning dependencies of target sdbusplus-project [ 2%] Creating directories for 'sdbusplus-project' [ 4%] Performing download step (git clone) for 'sdbusplus-project' -- sdbusplus-project download command succeeded. See also /home/jienl/CPP_Workspace/openbmc/modify-entity-manager/sdbusplus-project/src/sdbusplus-project-stamp/sdbusplus-project-download-*.log [ 7%] No patch step for 'sdbusplus-project' [ 9%] Performing update step for 'sdbusplus-project' [ 11%] No configure step for 'sdbusplus-project' [ 14%] Performing build step for 'sdbusplus-project'

You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example:

git checkout -b

HEAD is now at d2dd27dc Merge branch 'release/3.1.2' into develop [ 26%] No patch step for 'nlohmann-json' [ 28%] Performing update step for 'nlohmann-json' [ 30%] No configure step for 'nlohmann-json' [ 33%] No build step for 'nlohmann-json' [ 35%] Performing install step for 'nlohmann-json' [ 38%] Completed 'nlohmann-json' [ 38%] Built target nlohmann-json Scanning dependencies of target valijson [ 40%] Creating directories for 'valijson' [ 42%] Performing download step (git clone) for 'valijson' Cloning into 'valijson-src'... Note: checking out 'c2f22fddf599d04dc33fcd7ed257c698a05345d9'.

You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example:

git checkout -b

HEAD is now at c2f22fd Minor change to internal/optional.hp so that __has_include is used only if __cplusplus >= 201703 [ 45%] No patch step for 'valijson' [ 47%] Performing update step for 'valijson' [ 50%] No configure step for 'valijson' [ 52%] No build step for 'valijson' [ 54%] Performing install step for 'valijson' [ 57%] Completed 'valijson' [ 57%] Built target valijson Scanning dependencies of target entity-manager [ 59%] Building CXX object CMakeFiles/entity-manager.dir/src/EntityManager.cpp.o [ 61%] Building CXX object CMakeFiles/entity-manager.dir/src/Overlay.cpp.o [ 64%] Building CXX object CMakeFiles/entity-manager.dir/src/Utils.cpp.o [ 66%] Linking CXX executable entity-manager [ 66%] Built target entity-manager Scanning dependencies of target entityManagerTests [ 69%] Building CXX object CMakeFiles/entityManagerTests.dir/test/test_entity-manager.cpp.o [ 71%] Building CXX object CMakeFiles/entityManagerTests.dir/src/Utils.cpp.o [ 73%] Linking CXX executable entityManagerTests [ 73%] Built target entityManagerTests Scanning dependencies of target Boost [ 76%] Creating directories for 'Boost' [ 78%] Performing download step (download, verify and extract) for 'Boost' -- verifying file... file='/home/jienl/CPP_Workspace/openbmc/modify-entity-manager/Boost-prefix/src/boost_1_69_0.tar.gz' -- File already exists and hash match (skip download): file='/home/jienl/CPP_Workspace/openbmc/modify-entity-manager/Boost-prefix/src/boost_1_69_0.tar.gz' MD5='b50944c0c13f81ce2c006802a1186f5a' -- extracting... src='/home/jienl/CPP_Workspace/openbmc/modify-entity-manager/Boost-prefix/src/boost_1_69_0.tar.gz' dst='/home/jienl/CPP_Workspace/openbmc/modify-entity-manager/boost-src' -- extracting... [tar xfz] -- extracting... [analysis] -- extracting... [rename] -- extracting... [clean up] -- extracting... done [ 80%] No patch step for 'Boost' [ 83%] No update step for 'Boost' [ 85%] No configure step for 'Boost' [ 88%] No build step for 'Boost' [ 90%] Performing install step for 'Boost' [ 92%] Completed 'Boost' [ 92%] Built target Boost Scanning dependencies of target fru-device [ 95%] Building CXX object CMakeFiles/fru-device.dir/src/FruDevice.cpp.o [ 97%] Building CXX object CMakeFiles/fru-device.dir/src/Utils.cpp.o [100%] Linking CXX executable fru-device [100%] Built target fru-device

vyattalee commented 4 years ago

log for cross compile

make [ 2%] Performing update step for 'nlohmann-json' [ 4%] No configure step for 'nlohmann-json' [ 7%] No build step for 'nlohmann-json' [ 9%] Performing install step for 'nlohmann-json' [ 11%] Completed 'nlohmann-json' [ 19%] Built target nlohmann-json [ 21%] Performing update step for 'sdbusplus-project' [ 23%] No configure step for 'sdbusplus-project' [ 26%] Performing build step for 'sdbusplus-project'

vyattalee commented 4 years ago

You need to apt install autconf and autoconf archive as sdbusplus requires them

https://github.com/openbmc/entity-manager/blob/ce80db74ee4eceef3dcd236c74ba4d2aaaf76bda/CMakeLists.txt#L81

would you please help us to find out the root cause for cross compile issue? thanks so much.

feistjj commented 4 years ago

It builds in yocto under cross compile, I would check to see what flags yocto uses if you really want to avoid yocto. Yocto build is the only one we plan to support.

Just reading your logs assuming you're missing flags:

/home/jienl/CPP_Workspace/openbmc/modify-entity-manager/sdbusplus-src': configure: error: cannot run C++ compiled programs. If you meant to cross compile, use --host'.

But I've never attempted to cross compile outside of a yocto environment.

vyattalee commented 4 years ago

It builds in yocto under cross compile, I would check to see what flags yocto uses if you really want to avoid yocto. Yocto build is the only one we plan to support.

Just reading your logs assuming you're missing flags:

/home/jienl/CPP_Workspace/openbmc/modify-entity-manager/sdbusplus-src': configure: error: cannot run C++ compiled programs. If you meant to cross compile, use --host'.

But I've never attempted to cross compile outside of a yocto environment.

would you please share the guide how to cross compile entity-manager using yocto build tools? thanks. I want to upload the entity-manager into software emulator QEMU which builds up within Romulus SDK. toolchain: oecore-x86_64-arm1176jzs-toolchain-nodistro.0.sh. I think it can support yocto build environment. but it doesn't work. what is problem in it? welcome you show us. thanks.

feistjj commented 4 years ago

just add

IMAGE_INSTALL_append += " entity-manager"

to the end of your local.conf, and it will put it in the image.

vyattalee commented 4 years ago

I refered to OpenBMC Hello World in SDK(https://github.com/openbmc/docs/blob/master/development/sdk-hello-world.md). I think it can compile and build up independently like Hello World example, and upload the build into qemu setup and make it run correctly. but it seem.....

thanks for your information. Now I following your comments. and integrate the entity-manager into palmetto bmc qemu setup. but it seem not work normally. what can I do for the following permission denied issue? thanks in advance.

_root@palmetto:/# journalctl |grep entity Oct 17 14:57:32 palmetto kernel: Setting up static identity map for 0x40100000 - 0x40100058 Oct 17 14:57:51 palmetto entity-manager[134]: terminate called after throwing an instance of 'sdbusplus::exception::SdBusError' Oct 17 14:57:51 palmetto entity-manager[134]: what(): sd_bus_request_name: org.freedesktop.DBus.Error.AccessDenied: Permission denied Oct 17 14:57:54 palmetto entity-manager[155]: terminate called after throwing an instance of 'sdbusplus::exception::SdBusError' Oct 17 14:57:54 palmetto entity-manager[155]: what(): sd_bus_request_name: org.freedesktop.DBus.Error.AccessDenied: Permission denied Oct 17 14:57:55 palmetto entity-manager[158]: terminate called after throwing an instance of 'sdbusplus::exception::SdBusError' Oct 17 14:57:55 palmetto entity-manager[158]: what(): sd_bus_request_name: org.freedesktop.DBus.Error.AccessDenied: Permission denied Oct 17 14:57:56 palmetto entity-manager[163]: terminate called after throwing an instance of 'sdbusplus::exception::SdBusError' Oct 17 14:57:56 palmetto entity-manager[163]: what(): sd_bus_request_name: org.freedesktop.DBus.Error.AccessDenied: Permission denied Oct 17 14:57:56 palmetto entity-manager[166]: terminate called after throwing an instance of 'sdbusplus::exception::SdBusError' Oct 17 14:57:56 palmetto entity-manager[166]: what(): sd_bus_requestname: org.freedesktop.DBus.Error.AccessDenied: Permission denied root@palmetto:/#

feistjj commented 4 years ago

I'm not sure, all of our applications run as root currently. @geissonator or @bradbishop might know more about palmetto permissions

bradbishop commented 4 years ago

at 12:24 PM, James Feist notifications@github.com wrote:

I'm not sure, all of our applications run as root currently. @geissonator
or @bradbishop might know more about palmetto permissions

I’m pretty sure phosphor-inventory-manager and entity-manager are both
trying to grab the same busname.

I know it is confusing, sorry, but there are basically two different
implementations for sensors and fru inventory functionality in OpenBMC:

phosphor-inventory-manager+phosphor-hwmon vs entity-manager+dbus-sensors.

Palmetto uses the former. There isn’t any reason why the latter can’t work
on Palmetto (this is something I’ve been meaning to try myself) but it
would be a complex exercise. Unless bringing up entity-manager on Palmetto
is specifically your intent, I would suggest you either:

Use phosphor-inventory-manager with the Palmetto system.

Or if you specifically want to evaluate entity-manager, use a platform that
already supports it (unfortunately I don’t think there are any
entity-manager platforms that have qemu support - James correct me if I’m
wrong…)

feistjj commented 4 years ago

I’m pretty sure phosphor-inventory-manager and entity-manager are both trying to grab the same busname.

Pretty sure this isn't the case, entity manager claims xyz.openbmc_project.EntityManager

vyattalee commented 4 years ago

at 12:24 PM, James Feist notifications@github.com wrote: I'm not sure, all of our applications run as root currently. @geissonator or @bradbishop might know more about palmetto permissions I’m pretty sure phosphor-inventory-manager and entity-manager are both trying to grab the same busname. I know it is confusing, sorry, but there are basically two different implementations for sensors and fru inventory functionality in OpenBMC: phosphor-inventory-manager+phosphor-hwmon vs entity-manager+dbus-sensors. Palmetto uses the former. There isn’t any reason why the latter can’t work on Palmetto (this is something I’ve been meaning to try myself) but it would be a complex exercise. Unless bringing up entity-manager on Palmetto is specifically your intent, I would suggest you either: Use phosphor-inventory-manager with the Palmetto system. Or if you specifically want to evaluate entity-manager, use a platform that already supports it (unfortunately I don’t think there are any entity-manager platforms that have qemu support - James correct me if I’m wrong…)

thanks so much for your quick reply. do you mean I can run entity-manager instance on qemu setup? it doesn't work usually.

bradbishop commented 4 years ago

at 5:54 PM, James Feist notifications@github.com wrote:

Pretty sure this isn't the case, entity manager claims
xyz.openbmc_project.EntityManager

Oops, thanks James. I’m not sure what is going on then.

bradbishop commented 4 years ago

at 7:16 AM, Brad Bishop bradleyb@fuzziesquirrel.com wrote:

Oops, thanks James. I’m not sure what is going on then.

My next guess is that something is going on with the dbus permissions.
These are found in /etc/dbus-1/system.d

I would have thought the org.openbmc.conf file in there would prevent this
error. Do you have that file?

vyattalee commented 4 years ago

at 7:16 AM, Brad Bishop bradleyb@fuzziesquirrel.com wrote: Oops, thanks James. I’m not sure what is going on then. My next guess is that something is going on with the dbus permissions. These are found in /etc/dbus-1/system.d I would have thought the org.openbmc.conf file in there would prevent this error. Do you have that file?

thanks so much for your clarification. I dump the file /etc/dbus-1/system.d as below, it seems to remap to the files /usr/share/dbus-1/system.d/*.conf. I also dump the file /usr/share/dbus-1/system.d/org.freedesktop.systemd1.conf. but I can't find the org.openbmc.conf file anywhere.

_root@palmetto:/# cat /etc/dbus-1/system.conf

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">

_ _root@palmetto:/# cat /usr/share/dbus-1/system.d/org.freedesktop.systemd1.conf _ root@palmetto:/# ls /usr/share/dbus-1/system.d/ org.freedesktop.hostname1.conf org.freedesktop.resolve1.conf org.freedesktop.timedate1.conf org.freedesktop.network1.conf org.freedesktop.systemd1.conf org.freedesktop.timesync1.conf
vyattalee commented 4 years ago

at 7:16 AM, Brad Bishop bradleyb@fuzziesquirrel.com wrote: Oops, thanks James. I’m not sure what is going on then. My next guess is that something is going on with the dbus permissions. These are found in /etc/dbus-1/system.d I would have thought the org.openbmc.conf file in there would prevent this error. Do you have that file?

Hi Brad,

would you please provide the org.openbmc.conf file for us? thanks.

By the way, if I update the entity-manager, how to compile my local modified module and build it into the image .

bradbishop commented 4 years ago

Hi Brad,

would you please provide the org.openbmc.conf file for us? thanks.

https://github.com/openbmc/openbmc/blob/master/meta-phosphor/recipes-phosphor/dbus/dbus-perms/org.openbmc.conf

By the way, if I update the entity-manager, how to compile my local modified module and build it into the image .

with devtool:

https://wiki.yoctoproject.org/wiki/TipsAndTricks/Patching_the_source_for_a_recipe

vyattalee commented 4 years ago

Hi Brad, would you please provide the org.openbmc.conf file for us? thanks. https://github.com/openbmc/openbmc/blob/master/meta-phosphor/recipes-phosphor/dbus/dbus-perms/org.openbmc.conf By the way, if I update the entity-manager, how to compile my local modified module and build it into the image . with devtool: https://wiki.yoctoproject.org/wiki/TipsAndTricks/Patching_the_source_for_a_recipe

Hi Brad,

thanks so much for your quick reply. :)

vyattalee commented 4 years ago

Hi Brad, would you please provide the org.openbmc.conf file for us? thanks. https://github.com/openbmc/openbmc/blob/master/meta-phosphor/recipes-phosphor/dbus/dbus-perms/org.openbmc.conf By the way, if I update the entity-manager, how to compile my local modified module and build it into the image . with devtool: https://wiki.yoctoproject.org/wiki/TipsAndTricks/Patching_the_source_for_a_recipe

Hi Brad,

the file org.openbmc.conf can suppress sbus permission issues. but it doesn't work normally. I put the file org.openbmc.conf into the directory /etc/dbus-1/system.d/, but there is the following log report. root@palmetto:~# journalctl |grep Entity Oct 23 22:54:36 palmetto systemd[1]: Starting Entity Manager... Oct 23 22:54:37 palmetto systemd[1]: Started Entity Manager. Oct 23 22:54:41 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Main process exited, code=exited, status=1/FAILURE Oct 23 22:54:41 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Failed with result 'exit-code'. Oct 23 22:54:41 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Service RestartSec=100ms expired, scheduling restart. Oct 23 22:54:41 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Scheduled restart job, restart counter is at 1. Oct 23 22:54:41 palmetto systemd[1]: Stopped Entity Manager. Oct 23 22:54:41 palmetto systemd[1]: Starting Entity Manager... Oct 23 22:54:41 palmetto systemd[1]: Started Entity Manager. Oct 23 22:54:42 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Main process exited, code=exited, status=1/FAILURE Oct 23 22:54:42 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Failed with result 'exit-code'. Oct 23 22:54:43 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Service RestartSec=100ms expired, scheduling restart. Oct 23 22:54:43 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Scheduled restart job, restart counter is at 2. Oct 23 22:54:43 palmetto systemd[1]: Stopped Entity Manager. Oct 23 22:54:43 palmetto systemd[1]: Starting Entity Manager... Oct 23 22:54:43 palmetto systemd[1]: Started Entity Manager. Oct 23 22:54:44 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Main process exited, code=exited, status=1/FAILURE Oct 23 22:54:44 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Failed with result 'exit-code'. Oct 23 22:54:44 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Service RestartSec=100ms expired, scheduling restart. Oct 23 22:54:44 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Scheduled restart job, restart counter is at 3. Oct 23 22:54:44 palmetto systemd[1]: Stopped Entity Manager. Oct 23 22:54:44 palmetto systemd[1]: Starting Entity Manager... Oct 23 22:54:45 palmetto systemd[1]: Started Entity Manager. Oct 23 22:54:46 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Main process exited, code=exited, status=1/FAILURE Oct 23 22:54:46 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Failed with result 'exit-code'. Oct 23 22:54:46 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Service RestartSec=100ms expired, scheduling restart.

root@palmetto:~# journalctl |grep entity-manager Oct 23 22:54:40 palmetto entity-manager[143]: Error communicating to mapper. Oct 23 22:54:42 palmetto entity-manager[157]: Error communicating to mapper. Oct 23 22:54:44 palmetto entity-manager[160]: Error communicating to mapper. Oct 23 22:54:46 palmetto entity-manager[163]: Error communicating to mapper. Oct 23 22:54:48 palmetto entity-manager[169]: Error communicating to mapper. Oct 23 22:54:49 palmetto entity-manager[172]: Error communicating to mapper. Oct 23 22:54:51 palmetto entity-manager[175]: Error communicating to mapper. Oct 23 22:54:53 palmetto entity-manager[178]: Error communicating to mapper. Oct 23 22:54:54 palmetto entity-manager[181]: Error communicating to mapper.

If there is no configuration file org.openbmc.conf in the directory /etc/dbus-1/system.d/, the following log report as below root@palmetto:~# journalctl | grep Entity Oct 23 22:49:59 palmetto systemd[1]: Starting Entity Manager... Oct 23 22:49:59 palmetto systemd[1]: Started Entity Manager. Oct 23 22:50:01 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Main process exited, code=killed, status=6/ABRT Oct 23 22:50:01 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Failed with result 'signal'. Oct 23 22:50:01 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Service RestartSec=100ms expired, scheduling restart. Oct 23 22:50:01 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Scheduled restart job, restart counter is at 1. Oct 23 22:50:01 palmetto systemd[1]: Stopped Entity Manager. Oct 23 22:50:01 palmetto systemd[1]: Starting Entity Manager... Oct 23 22:50:01 palmetto systemd[1]: Started Entity Manager. Oct 23 22:50:02 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Main process exited, code=killed, status=6/ABRT Oct 23 22:50:02 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Failed with result 'signal'. Oct 23 22:50:02 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Service RestartSec=100ms expired, scheduling restart. Oct 23 22:50:02 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Scheduled restart job, restart counter is at 2. Oct 23 22:50:02 palmetto systemd[1]: Stopped Entity Manager. Oct 23 22:50:02 palmetto systemd[1]: Starting Entity Manager... Oct 23 22:50:02 palmetto systemd[1]: Started Entity Manager. Oct 23 22:50:02 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Main process exited, code=killed, status=6/ABRT Oct 23 22:50:02 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Failed with result 'signal'. Oct 23 22:50:02 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Service RestartSec=100ms expired, scheduling restart. Oct 23 22:50:02 palmetto systemd[1]: xyz.openbmc_project.EntityManager.service: Scheduled restart job, restart counter is at 3. Oct 23 22:50:02 palmetto systemd[1]: Stopped Entity Manager.

root@palmetto:~# journalctl | grep entity-manager Oct 23 22:50:01 palmetto entity-manager[143]: terminate called after throwing an instance of 'sdbusplus::exception::SdBusError' Oct 23 22:50:01 palmetto entity-manager[143]: what(): sd_bus_request_name: org.freedesktop.DBus.Error.AccessDenied: Permission denied Oct 23 22:50:02 palmetto entity-manager[149]: terminate called after throwing an instance of 'sdbusplus::exception::SdBusError' Oct 23 22:50:02 palmetto entity-manager[149]: what(): sd_bus_request_name: org.freedesktop.DBus.Error.AccessDenied: Permission denied Oct 23 22:50:02 palmetto entity-manager[152]: terminate called after throwing an instance of 'sdbusplus::exception::SdBusError' Oct 23 22:50:02 palmetto entity-manager[152]: what(): sd_bus_request_name: org.freedesktop.DBus.Error.AccessDenied: Permission denied Oct 23 22:50:03 palmetto entity-manager[155]: terminate called after throwing an instance of 'sdbusplus::exception::SdBusError' Oct 23 22:50:03 palmetto entity-manager[155]: what(): sd_bus_request_name: org.freedesktop.DBus.Error.AccessDenied: Permission denied Oct 23 22:50:03 palmetto entity-manager[158]: terminate called after throwing an instance of 'sdbusplus::exception::SdBusError' Oct 23 22:50:03 palmetto entity-manager[158]: what(): sd_bus_request_name: org.freedesktop.DBus.Error.AccessDenied: Permission denied

bradbishop commented 4 years ago

Hi Brad,

the file org.openbmc.conf can suppress sbus permission issues. but it doesn't work normally. I put the file org.openbmc.conf into the directory /etc/dbus-1/system.d/, but there is the following log report.

root@palmetto:~# journalctl |grep entity-manager Oct 23 22:54:40 palmetto entity-manager[143]: Error communicating to mapper. Oct 23 22:54:42 palmetto entity-manager[157]: Error communicating to mapper. Oct 23 22:54:44 palmetto entity-manager[160]: Error communicating to mapper. Oct 23 22:54:46 palmetto entity-manager[163]: Error communicating to mapper. Oct 23 22:54:48 palmetto entity-manager[169]: Error communicating to mapper. Oct 23 22:54:49 palmetto entity-manager[172]: Error communicating to mapper. Oct 23 22:54:51 palmetto entity-manager[175]: Error communicating to mapper. Oct 23 22:54:53 palmetto entity-manager[178]: Error communicating to mapper. Oct 23 22:54:54 palmetto entity-manager[181]: Error communicating to mapper.

The mapper is not running. I don’t understand how you wound up with a palmetto image is missing both the mapper and the dbus-perms recipe. How exactly did you build this image?

vyattalee commented 4 years ago

Hi Brad, the file org.openbmc.conf can suppress sbus permission issues. but it doesn't work normally. I put the file org.openbmc.conf into the directory /etc/dbus-1/system.d/, but there is the following log report. @.***:~# journalctl |grep entity-manager Oct 23 22:54:40 palmetto entity-manager[143]: Error communicating to mapper. Oct 23 22:54:42 palmetto entity-manager[157]: Error communicating to mapper. Oct 23 22:54:44 palmetto entity-manager[160]: Error communicating to mapper. Oct 23 22:54:46 palmetto entity-manager[163]: Error communicating to mapper. Oct 23 22:54:48 palmetto entity-manager[169]: Error communicating to mapper. Oct 23 22:54:49 palmetto entity-manager[172]: Error communicating to mapper. Oct 23 22:54:51 palmetto entity-manager[175]: Error communicating to mapper. Oct 23 22:54:53 palmetto entity-manager[178]: Error communicating to mapper. Oct 23 22:54:54 palmetto entity-manager[181]: Error communicating to mapper. The mapper is not running. I don’t understand how you wound up with a palmetto image is missing both the mapper and the dbus-perms recipe. How exactly did you build this image?

Hi Brad, thanks so much firstly. my platform is similar as palmetto configuration, so I want to do simulation on palmetto qemu. I am Interested in entity-manager. I do try to introduce it into palmetto platform, is it feasible or not? what platform is suggested to work fine for entity-manager? do you have any suggestion if I integrate the entity-manager into palmetto? thanks again.

vyattalee commented 4 years ago

Hi Brad and Feistjj

Now Entity Manager can work fine on palmetto platform. but I add some trace log in source code which can't be found in qemu terminal. would you please give some guide for how to debug and trouble shooting entity manager? by the way, what is the use of the variable DEBUG (constexpr const bool DEBUG = false) in source code? thanks.

     Starting Name Service Cache Daemon...

[ OK ] Started Phosphor certificate manager for bmcweb. Starting Rsyslog config updater... Starting Entity Manager... [ OK ] Started Phosphor sysfs LED controller. Starting Phosphor Inventory Manager... [ OK ] Started Fru Device. Starting Phosphor LED Group Management Daemon... Starting LDAP daemon... [ OK ] Started Start bmcweb server. Starting Phosphor User Manager... Starting Permit User Sessions... Starting Phosphor LDAP privilege mapper... [ OK ] Started Phosphor Dump core monitor.. Starting Hostboot Boot Settings... [ OK ] Started Phosphor certificate manager for nslcd. Starting Phosphor DBus Service Discovery Manager... [ OK ] Started System Logging Service. [ OK ] Started OpenBMC ipKVM daemon. [ OK ] Started SSH Key Generation. [ OK ] Started Name Service Cache Daemon. [ OK ] Started Permit User Sessions. [ OK ] Started Hostboot Boot Settings. [ OK ] Started LDAP daemon. [ OK ] Started Clear one time boot overrides. [ OK ] Started Entity Manager. Starting Hostname Service... [ OK ] Started Serial Getty on ttyS4.

root@palmetto:~# journalctl |grep Entity Oct 28 21:17:43 palmetto systemd[1]: Starting Entity Manager... Oct 28 21:17:52 palmetto systemd[1]: Started Entity Manager.

root@palmetto:~# busctl --list |grep entity :1.29 232 entity-manager root :1.29 xyz.openbmc_project.En... - -
xyz.openbmc_project.EntityManager 232 entity-manager root :1.29 xyz.openbmc_project.En... - -

feistjj commented 4 years ago

what is the use of the variable DEBUG (constexpr const bool DEBUG = false) in source code?

It turns on extra debug prints.

I would start by using a Probe: "TRUE" so something gets installed. There is a nice guide here: https://github.com/openbmc/entity-manager/blob/master/docs/my_first_sensors.md that helps getting started

vyattalee commented 4 years ago

what is the use of the variable DEBUG (constexpr const bool DEBUG = false) in source code?

It turns on extra debug prints.

I would start by using a Probe: "TRUE" so something gets installed. There is a nice guide here: https://github.com/openbmc/entity-manager/blob/master/docs/my_first_sensors.md that helps getting started

Hi feistjj, thanks so much for your information. it is very useful. any good materials is welcomed.

Regards

Li Jie

feistjj commented 4 years ago

Closing this issue as this has moved from an issue with entity-manager to help getting started, suggest using the mailing list for help so others can learn as well.

https://lists.ozlabs.org/listinfo/openbmc