[External] Re: Clarify some questions about in-band firmware update

Patrick Venture venture at google.com
Tue Jul 2 02:17:24 AEST 2019


On Fri, Jun 28, 2019 at 3:24 PM Patrick Venture <venture at google.com> wrote:

>
>
> On Fri, Jun 28, 2019 at 7:09 AM Patrick Venture <venture at google.com>
> wrote:
>
>>
>>
>> On Fri, Jun 28, 2019 at 4:30 AM Andrew MS1 Peng <pengms1 at lenovo.com>
>> wrote:
>>
>>> Hi Patrick,
>>>
>>>
>>> I synchronized our Openbmc repository with *upstream* repository then
>>> compiled and checked the result yesterday, we can generate *dynamically
>>> linked binary but still failed to generate statically linked binary.  *I
>>> used *OpenBmc *environment to compile and also created a SDK environment
>>> by using x86-64 toolchain (
>>> oecore-x86_64-core2-64-toolchain-nodistro.0.sh) to compile, the compile
>>> result is the same. *It seems to the linker not find the *archive file
>>> libpci.a, *could you take a look my problem? Thanks.*
>>>
>>>
>>>
>>> *I will get error message when I run the tool in my host platform as
>>> below. The** dynamically linked binary** is not convenience to use
>>> since I have to modify *rpath and interpreter of already compiled ELF.
>>>
>>> pengms1 at hsbmc: $ ./burn_my_bmc
>>>
>>> -bash: ./burn_my_bmc: No such file or directory
>>>
>>> pengms1 at hsbmc: $ ldd ./burn_my_bmc
>>> *./burn_my_bmc: /lib/x86_64-linux-gnu/libpci.so.3: version `LIBPCI_3.5'
>>> not found (required by ./burn_my_bmc)*
>>>
>>> *       linux-vdso.so.1 =>  (0x00007ffcd2363000)*
>>>
>>> *       libipmiblob.so.0 =>
>>> /home/pengms1/SDK/OpenBmc/rootfs/lib/libipmiblob.so.0 (0x00007f25d373a000)*
>>>
>>> *       libpci.so.3 => /lib/x86_64-linux-gnu/libpci.so.3
>>> (0x00007f25d3512000)*
>>>
>>> *       libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
>>> (0x00007f25d3190000)*
>>>
>>> *       libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
>>> (0x00007f25d2f79000)*
>>>
>>> *       libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6
>>> (0x00007f25d2baf000)*
>>>
>>> *       libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6
>>> (0x00007f25d28a6000)*
>>>
>>> *       libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1
>>> (0x00007f25d268b000)*
>>>
>>> *       libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2
>>> (0x00007f25d2470000)*
>>>
>>> *       libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1
>>> (0x00007f25d2450000)*
>>>
>>> *       /lib/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
>>> (0x000055731193b000)*
>>>
>>> *       librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1
>>> (0x00007f25d2247000)*
>>>
>>> *       libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
>>> (0x00007f25d202a000)*
>>>
>>>
>>>
>>> *The compile error message is below:*
>>>
>>> x86_64-openbmc-linux-libtool: link: x86_64-openbmc-linux-g++ -m64
>>> -march=core2 -mtune=core2 -msse3 -mfpmath=sse
>>> --sysroot=/home/pengms1/openbmc_trunk_x86/build/tmp/work/core2-64-openbmc-linux/phosphor-ipmi-flash/0.1+gitAUTOINC+7c79b252c1-r1/recipe-sysroot
>>> -std=c++17 -I../../git -O2 -pipe -g -feliminate-unused-debug-types
>>> -fmacro-prefix-map=/home/pengms1/openbmc_trunk_x86/build/tmp/work/core2-64-openbmc-linux/phosphor-ipmi-flash/0.1+gitAUTOINC+7c79b252c1-r1=/usr/src/debug/phosphor-ipmi-flash/0.1+gitAUTOINC+7c79b252c1-r1
>>> -fdebug-prefix-map=/home/pengms1/openbmc_trunk_x86/build/tmp/work/core2-64-openbmc-linux/phosphor-ipmi-flash/0.1+gitAUTOINC+7c79b252c1-r1=/usr/src/debug/phosphor-ipmi-flash/0.1+gitAUTOINC+7c79b252c1-r1
>>> -fdebug-prefix-map=/home/pengms1/openbmc_trunk_x86/build/tmp/work/core2-64-openbmc-linux/phosphor-ipmi-flash/0.1+gitAUTOINC+7c79b252c1-r1/recipe-sysroot=
>>> -fdebug-prefix-map=/home/pengms1/openbmc_trunk_x86/build/tmp/work/core2-64-openbmc-linux/phosphor-ipmi-flash/0.1+gitAUTOINC+7c79b252c1-r1/recipe-sysroot-native=
>>> -fvisibility-inlines-hidden -Wall -Werror -DENABLE_REBOOT_UPDATE
>>> -DENABLE_STATIC_LAYOUT -DENABLE_LPC_BRIDGE -DASPEED_LPC -static -o
>>> burn_my_bmc burn_my_bmc-main.o  ./.libs/libupdater.a -lipmiblob -lpci
>>>
>>> |
>>> /home/pengms1/openbmc_trunk_x86/build/tmp/work/core2-64-openbmc-linux/phosphor-ipmi-flash/0.1+gitAUTOINC+7c79b252c1-r1/recipe-sysroot-native/usr/bin/x86_64-openbmc-linux/../../libexec/x86_64-openbmc-linux/gcc/x86_64-openbmc-linux/9.1.0/ld:
>>> *cannot find -lpci*
>>>
>>
>> That's indicating that it couldn't find the pciutils installed.  Like I
>> said yesterday, I hadn't tried to build the host-tool in this environment
>> and had to clean up the dependency checks for it.  That said, I went
>> through and fixed it all and got it to build as expected from a pure ubuntu
>> docker container.  Those patches are up for review and not yet in OpenBMC.
>> That said, I dont' know why the lpci might not be found for that
>> compilation other than possibly the pciutils recipe is broken.  I found
>> yesterday while getting this to work that the instructions on the pciutils
>> README weren't quite right for building the library AND installing that
>> library.
>>
>> So I wrote up custom instructions in the README for phosphor-ipmi-flash,
>> that patch is under review.
>>
>> If you want to debut your current environment, you need to see if you can
>> find the pkgconfig file and libraries defined:
>> https://github.com/pciutils/pciutils/blob/master/lib/libpci.pc.in
>>
>> Basically search for libpci.pc and then read that file.  Verify the
>> shared library objects are in the SDK environment.
>>
>> If you need the libpci archive object for static compilation, that may
>> not be installed by default, you'll want to read the pciutils README.
>>
>>
>>>
>>>
>>> *My OpenBmc build **environment is below.*
>>>
>>> OpenBmc Setting
>>>
>>> phosphor-ipmi-flash setting (build *static binary*)
>>>
>>> Extra setting
>>>
>>> *Build Configuration:*
>>>
>>> *BB_VERSION           = "1.43.0"*
>>>
>>> *BUILD_SYS            = "x86_64-linux"*
>>>
>>> *NATIVELSBSTRING      = "ubuntu-16.04"*
>>>
>>> *TARGET_SYS           = "x86_64-openbmc-linux"*
>>>
>>> *MACHINE              = "qemux86-64"*
>>>
>>> *DISTRO               = "openbmc-phosphor"*
>>>
>>> *DISTRO_VERSION       = "0.1.2"*
>>>
>>> *TUNE_FEATURES        = "m64 core2"*
>>>
>>> *TARGET_FPU           = ""*
>>>
>>> EXTRA_OECONF += " --enable-build-host-tool --enable-static-layout
>>> --enable-lpc-bridge
>>> --enable-aspeed-lpc MAPPED_ADDRESS=0x98000000 --enable-reboot-update "
>>>
>>> EXTRA_OEMAKE += " LDFLAGS=-all-static " (Build a *statically linked
>>> binary*)
>>>
>>> DISABLE_STATIC = ""  (Build *statically library for *ipmi-blob-tool)
>>>
>>> phosphor-ipmi-flash setting (build *dynamic binary*)
>>>
>>> EXTRA_OECONF += " --enable-build-host-tool --enable-static-layout
>>> --enable-lpc-bridge
>>> --enable-aspeed-lpc MAPPED_ADDRESS=0x98000000 --enable-reboot-update "
>>>
>>>
>>>
>>> Regards,
>>> Andrew
>>>
>>>
>>>
>>> *发件人:* Patrick Venture <venture at google.com>
>>> *发送时间:* 2019年6月27日 9:59
>>> *收件人:* Andrew MS1 Peng <pengms1 at lenovo.com>; OpenBMC Maillist <
>>> openbmc at lists.ozlabs.org>
>>> *抄送:* Duke KH Du <dukh at lenovo.com>; benjaminfair at google.com; Adriana
>>> Kobylak <anoo at us.ibm.com>
>>> *主题:* [External] Re: Clarify some questions about in-band firmware
>>> update
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Wed, Jun 26, 2019 at 7:44 AM Patrick Venture <venture at google.com>
>>> wrote:
>>>
>>>
>>>
>>>
>>>
>>> On Wed, Jun 26, 2019 at 4:28 AM Andrew MS1 Peng <pengms1 at lenovo.com>
>>> wrote:
>>>
>>> Hi Patrick,
>>>
>>>
>>>
>>> I have some questions as below, could you help to clarify. Thanks.
>>>
>>> 1.      Do you have any plans to support BIOS update in
>>> phosphor-ipmi-flash?
>>>
>>> If the answer is no, we would like to help to add this feature. Could
>>> you give us some advice or clues to implement it.
>>>
>>>
>>>
>>> This could be added to the design (first step).
>>>
>>> I could probably roll out this in a day or two, it's not a difficult
>>> extension with a few caveats. We'd have to define new services, such as
>>> update_bios.service instead of update_bmc.service.
>>>
>>>
>>>
>>> I have some cycles, so I don't mind reviewing the changes required and
>>> rolling something out --
>>>
>>>
>>>
>>> 2.      The FPGA rom image is embedded in BMC image, we would like to
>>> add fpga-update.service and fpga-verify.service in phosphor-ipmi-flash, we
>>> expect that run both services after update BMC image completely. Do you
>>> have any concerns about it?
>>>
>>>
>>>
>>> There are a couple things to unpack here.  The FPGA rom is embedded in
>>> the BMC image.  How is the BMC updated?  I ask because a machine can (and
>>> is expected to) provide its own update_bmc.service implementation.  This
>>> service could trigger the fpga-verify and fpga-update services within
>>> whatever code is called from the update_bmc service you specify.
>>>
>>>
>>>
>>> 3.      How can I make a static executable host tool (burn_my_bmc)?
>>> Currently, I can’t to make a *statically linked binary successfully*,
>>> but I have made it before you added p2a function.
>>>
>>> For the host tool you need to specify very little, you should be able to
>>> build it via:
>>>
>>> ./bootstrap.sh
>>>
>>> ./configure
>>>
>>> ./make
>>>
>>>
>>>
>>> You will need to checkout and install ipmi-blob-tool first
>>> (openbmc/ipmi-blob-tool)
>>>
>>>
>>>
>>>
>>>
>>> ^^ --- those steps should go on the README.  Will add them shortly.
>>>
>>>
>>>
>>> Based on different OS environment as below, I would like to have a
>>> static executable since *dynamically linked binary can’t work normally
>>> in host OS.*
>>>
>>> Host OS environment
>>>
>>> Build environment (OpenBmc)
>>>
>>> Gcc  v4.8.5
>>>
>>> Gcc   v8.3.0
>>>
>>> Glibc  v2.17
>>>
>>> Glibc  v2.29
>>>
>>>
>>>
>>> The bitbake recipe isn't meant to be used for the host tool.  It
>>> explicitly disables building the host-tool by default.  You should be able
>>> to check out the repo and build from there.  Let me know if you run into
>>> issues with that.
>>>
>>>
>>>
>>> 4.      I didn’t find the below service files in source tree, where can
>>> find default services or should we provide our own services?
>>>
>>> update_bmc.service
>>> verify_image.service
>>> prepare_update.service
>>>
>>>
>>>
>>> That's correct.  There are currently no default service files.  I am
>>> thinking of providing a default prepare_update service in a later CL,
>>> however updating the BMC or verifying the image depend entirely on the
>>> system -- which makes it difficult to have a default.  In point of fact,
>>> there isn't really a valid default phosphor-ipmi-flash build for a BMC.
>>> Everything needs to be specified.
>>>
>>>
>>>
>>> ^--- I can work on making the ubi bmc option available if the ubi distro
>>> feature is enabled, etc -- providing some defaults.
>>>
>>> ^--- I have a plan to provide a prepare_update.service once I finish
>>> testing Aspeed LPC support.
>>>
>>>
>>>
>>>
>>>
>>> I've been reviewing the build process for the host-tool and the
>>> configure file and other pieces require the BMC-stuff to be installed first
>>> (sdbusplus, etc).  I'm going to cleanup the configure file so that if
>>> you're building the host-tool it doesn't try to build the BMC stuff.
>>>
>>>
>>>
>>>
>>>
>>> Regards,
>>> Andrew
>>>
>>>
> Andrew, the steps here should work for you to build out the host-tool:
> https://github.com/openbmc/phosphor-ipmi-flash#building-and-using-the-host-tool
>
> That said, because you requested we support BIOS images too, I'm looking
> at re-working some of the blobIDs involved.  That said, the host-tool and
> BMC version are locked together.
>

Uploaded design change to support host bios, for review:
https://gerrit.openbmc-project.xyz/c/openbmc/docs/+/23246
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20190701/81b8b31d/attachment-0001.htm>


More information about the openbmc mailing list