From patchwork Fri Jul 5 09:20:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Peng X-Patchwork-Id: 1128882 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45hvWL6Vwtz9sN1 for ; Mon, 8 Jul 2019 15:43:26 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=lenovo.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 45hvWL3rMmzDqPC for ; Mon, 8 Jul 2019 15:43:26 +1000 (AEST) X-Original-To: openbmc@lists.ozlabs.org Delivered-To: openbmc@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lenovo.com (client-ip=67.219.250.214; helo=mail1.bemta24.messagelabs.com; envelope-from=pengms1@lenovo.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=lenovo.com Received: from mail1.bemta24.messagelabs.com (mail1.bemta24.messagelabs.com [67.219.250.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 45g8T8570XzDqWt for ; Fri, 5 Jul 2019 19:20:27 +1000 (AEST) Received: from [67.219.250.198] (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits)) by server-2.bemta.az-b.us-west-2.aws.symcld.net id FF/38-12929-8561F1D5; Fri, 05 Jul 2019 09:20:24 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKKsWRWlGSWpSXmKPExsWSLveKTTdcTD7 W4NJ7VYsZex8wW5xqecFisffARhYHZo8Fm0o9zs9YyBjAFMWamZeUX5HAmvFm/Tm2gvX93BUz J+5hbmB89Ieri5GLQ0jgP6PEvWVv2boYOYGcF4wSNz96QSR2M0q8+r6NGSTBJqAlsfD/HqYuR g4OEQENif/vMkFqmAWaGSX+NJxmBKkRFqiVOLH6KVi9iECQxJ1bB6HsJIlDB7+zgtgsAioSG/ rmsIPYvAKWEivvHGCEWPaNVaK1v4EFJMEpECix5mMr2FBGAVmJaY/uM4HYzALiEnOnzQIbJCE gILFkz3lmCFtU4uXjf1BxBYkZb7dA1SdInHi/lAVimaDEyZlPWCYwisxCMmoWkrJZSMpmAf3J LKApsX6XPkSJosSU7ofsELaGROucuezI4gsY2VcxmicVZaZnlOQmZuboGhoY6BoaGukaGhvpG pnrJVbpJumVFuuWpxaX6BrpJZYX6xVX5ibnpOjlpZZsYgTGZ0pBi/QOxuZZb/QOMUpyMCmJ8l 48IxcrxJeUn1KZkVicEV9UmpNafIhRhoNDSYJ3q5B8rJBgUWp6akVaZg4wVcCkJTh4lER4VUD SvMUFibnFmekQqVOM9hwTXs5dxMzRtnUekDx4FER+b164iFmIJS8/L1VKnFcMpE0ApC2jNA9u KCy1XWKUlRLmZWRgYBDiKUgtys0sQZV/xSjOwagkzKsEMoUnM68EbvcroLOYgM6amSIHclZJI kJKqoGpY0IBQ7jbrpnLNDgbbd5ckeD8OP0Ip2DWdMeqV6qdW07IGFaWzLpdYx1xoZfLNq3815 d9oXvOcEnL66iVS9jp8zZm2CW3mURwWBn/j1uWV/OH4X5i3eRTtZzK3ybx3uXqXy6n8v32FD5 2q/0P5opx6peZPNj81GRyZMka7pLvBsyMO+74/fq7X3/xkW/qB9b/2vWqTjV2wc5a4xqDBsf+ lw4fk/8vYQrdWGz5hmvrrguSJxVus65fYHdslUGXQdv+xX1n3k8vMD8Z/Tb7/SIBmWd2r9ReL VhuLLx2c8Wvs5PzVmuXy147yrb95jTG7pdqZzbftjbltlPT5VvKuevQ+6qi53+/y6a1b1udo6 umxFKckWioxVxUnAgA+lTRLugDAAA= X-Env-Sender: pengms1@lenovo.com X-Msg-Ref: server-8.tower-346.messagelabs.com!1562318419!414473!1 X-Originating-IP: [103.30.234.6] X-SYMC-ESS-Client-Auth: outbound-route-from=pass X-StarScan-Received: X-StarScan-Version: 9.43.9; banners=-,-,- X-VirusChecked: Checked Received: (qmail 17724 invoked from network); 5 Jul 2019 09:20:22 -0000 Received: from unknown (HELO apsmtp.lenovo.com) (103.30.234.6) by server-8.tower-346.messagelabs.com with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 5 Jul 2019 09:20:22 -0000 Received: from pekwpmail02.lenovo.com (unknown [10.96.93.80]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by Forcepoint Email with ESMTPS id DE388464278C7D5050FC; Fri, 5 Jul 2019 17:20:18 +0800 (CST) Received: from pekwpmail05.lenovo.com (10.96.93.83) by pekwpmail02.lenovo.com (10.96.93.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1591.10; Fri, 5 Jul 2019 17:20:16 +0800 Received: from pekwpmail05.lenovo.com ([fe80::c91f:415c:90bb:3ddf]) by pekwpmail05.lenovo.com ([fe80::c91f:415c:90bb:3ddf%7]) with mapi id 15.01.1591.008; Fri, 5 Jul 2019 17:20:16 +0800 From: Andrew MS1 Peng To: Patrick Venture Subject: =?utf-8?b?562U5aSNOiBbRXh0ZXJuYWxdIFJlOiBDbGFyaWZ5IHNvbWUgcXVl?= =?utf-8?q?stions_about_in-band_firmware_update?= Thread-Topic: [External] Re: Clarify some questions about in-band firmware update Thread-Index: AQHVLbs1dsu/waorW0Gpb5Z+B5KLlqaxHt4AgAdZIVD///lkAIAACYOAgAAmGICAAY5tkP//0CmAgAHI3WA= Date: Fri, 5 Jul 2019 09:20:16 +0000 Message-ID: References: <26428e13a88d4ea7bcee9c792b892c7c@lenovo.com> <027a78e697414daaa44d775062fdb93e@lenovo.com> <4db1f213a797472b99fe664d59e296f3@lenovo.com> <53220789ed064fa09ed23424cc099b77@lenovo.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.96.12.251] MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 08 Jul 2019 15:38:31 +1000 X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: OpenBMC Maillist , "benjaminfair@google.com" , Duke KH Du Errors-To: openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "openbmc" Hi Patrick, Following your instructions to build SDK environment, the host tool has been compiled successfully. I really appreciate your help. Regards, Andrew 发件人: Patrick Venture 发送时间: 2019年7月4日 21:59 收件人: Andrew MS1 Peng 抄送: Duke KH Du ; benjaminfair@google.com; OpenBMC Maillist 主题: Re: [External] Re: Clarify some questions about in-band firmware update On Thu, Jul 4, 2019 at 5:19 AM Andrew MS1 Peng > wrote: Hi Patrick, I refer to https://github.com/openbmc/docs/blob/master/development/dev-environment.md#download-and-install-sdk to set up my OpenBmc SDK environment, but it seems to be different from yours since your SDK environment has packagegroup-core-standalone-sdk-target.bbappend file. I would like to build your SDK environment to test, could you give me some clue or guideline to set up the environment? The file to which you're referring is not special to my environment and it's part of openbmc. I added ipmi-blob-tool to it so that I wouldn't have to build it ahead of building burn_my_bmc. I provided the patch in my email so you could make the same change. I didn't follow those instructions because I don't know when the last build was of the SDK that's published there. But you can build it yourself trivially: $ git clone https://github.com/openbmc/openbmc.git $ pushd openbmc ### apply the patch or change I mentioned $ TEMPLATECONF=meta-phosphor/conf source oe-init-build-env $ umask a+rx,u+rwx $ MACHINE=qemux86-64 bitbake obmc-phosphor-image -c populate_sdk ### wait while it builds everything $ SDK_DIR=/opt/openbmc-phosphor/2.7.0 $ sudo ./tmp/deploy/sdk/oecore-x86_64-core2-64-toolchain-nodistro.0.sh -d $SDK_DIR ### let it install the SDK $ source $SDK_DIR/environment-setup-core2-64-openbmc-linux $ git clone https://github.com/openbmc/phosphor-ipmi-flash $ pushd phosphor-ipmi-flash $ export OECORE_TARGET_SYSROOT=$SDK_DIR/sysroots/core2-64-openbmc-linux $ autoreconf -if $ ./configure --enable-oe-sdk --host "$(uname -m)" --disable-build-bmc-blob-handler AR=x86_64-openbmc-linux-gcc-ar RANLIB=x86_64-openbmc-linux-gcc-ranlib ### and it's built $ popd $ popd Like I said though, you don't need to use the SDK at all to build it. You can just build it on your development workstation following the instructions in the README and it'll take a lot less time. • My SDK environment setup procedure ## Fetch the OpenBmc x86-64 toolchain 1. wget https://openpower.xyz/job/openbmc-build-sdk/distro=ubuntu,target=qemux86-64/lastSuccessfulBuild/artifact/deploy/sdk/oecore-x86_64-core2-64-toolchain-nodistro.0.sh ## install toolchain 2. run ./oecore-x86_64-core2-64-toolchain-nodistro.0.sh ## run source env 3. source ~/SDK/oecore-x86_64/environment-setup-core2-64-openbmc-linux ## Fetch source code then compile ipmi-blob-tool and phosphor-ipmi-flash 4.1 git clone https://github.com/openbmc/ipmi-blob-tool 4.1.1 cd ipmi-blob-tool 4.1.2 ./bootstrap.sh 4.1.3 ./configure --prefix=/home/pengms1/SDK/OpenBmc/rootfs --build=x86_64-linux --host=x86_64-openbmc-linux -with-libtool-sysroot=/home/pengms1/SDK/oecore-x86_64/sysroots/core2-64-openbmc-linux/ -enable-shared --enable-static 4.1.4 make && make install 4.2 git clone https://github.com/openbmc/phosphor-ipmi-flash 4.2.1 cd phosphor-ipmi-flash 4.2.2 ./bootstrap.sh 4.2.3 export PKG_CONFIG_PATH="/home/pengms1/SDK/oecore-x86_64/sysroots/core2-64-openbmc-linux/usr/lib/pkgconfig:/home/pengms1/SDK/oecore-x86_64/sysroots/core2-64-openbmc-linux/usr/share/pkgconfig:/home/pengms1/SDK/OpenBmc/rootfs/lib/pkgconfig" 4.2.4 ./configure --prefix=/home/pengms1/SDK/OpenBmc/rootfs --build=x86_64-linux --host=x86_64-openbmc-linux -with-libtool-sysroot=/home/pengms1/SDK/oecore-x86_64/sysroots/core2-64-openbmc-linux/ --disable-build-bmc-blob-handler 4.2.5 make CPPFLAGS="-I /home/pengms1/SDK/OpenBmc/rootfs/include/" LDFLAGS="-L/home/pengms1/SDK/OpenBmc/rootfs/lib -lipmiblob" • Compile status Source code hash id Compile Status Attached file c37fe1e938238a10520ff6d120ccf5194ff60fa2 Compile successful successful.log 33311b47b3b656cfc16568b4b971730cb79130bc Compile failed failed.log Regards, Andrew 发件人: Patrick Venture > 发送时间: 2019年7月4日 1:04 收件人: Andrew MS1 Peng > 抄送: Duke KH Du >; benjaminfair@google.com; OpenBMC Maillist > 主题: Re: [External] Re: Clarify some questions about in-band firmware update On Wed, Jul 3, 2019 at 7:47 AM Patrick Venture > wrote: On Wed, Jul 3, 2019 at 7:13 AM Patrick Venture > wrote: On Wed, Jul 3, 2019 at 4:51 AM Andrew MS1 Peng > wrote: Hi Patrick, Could you help to take a look compile issue as below? I can compile host tool with hash id c37fe1e938238a10520ff6d120ccf5194ff60fa2 successfully, but fail to compile with hash id c37fe1e938238a10520ff6d120ccf5194ff60fa2 or later. Thanks. /home/pengms1/SDK/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/libexec/x86_64-openbmc-linux/gcc/x86_64-openbmc-linux/9.1.0/real-ld: burn_my_bmc-main.o: in function `host_tool::DevMemDevice::DevMemDevice(internal::Sys const*)': /home/pengms1/SDK/OpenBmc/phosphor-ipmi-flash/tools/io.hpp:46: undefined reference to `internal::sys_impl' /home/pengms1/SDK/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/libexec/x86_64-openbmc-linux/gcc/x86_64-openbmc-linux/9.1.0/real-ld: burn_my_bmc-main.o: in function `host_tool::BtDataHandler::BtDataHandler(ipmiblob::BlobInterface*, internal::Sys const*)': /home/pengms1/SDK/OpenBmc/phosphor-ipmi-flash/tools/bt.hpp:17: undefined reference to `internal::sys_impl' /home/pengms1/SDK/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/libexec/x86_64-openbmc-linux/gcc/x86_64-openbmc-linux/9.1.0/real-ld: burn_my_bmc-main.o: in function `host_tool::LpcDataHandler::LpcDataHandler(ipmiblob::BlobInterface*, host_tool::HostIoInterface*, unsigned int, unsigned int, internal::Sys const*)': /home/pengms1/SDK/OpenBmc/phosphor-ipmi-flash/tools/lpc.hpp:28: undefined reference to `internal::sys_impl' /home/pengms1/SDK/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/libexec/x86_64-openbmc-linux/gcc/x86_64-openbmc-linux/9.1.0/real-ld: burn_my_bmc-main.o: in function `host_tool::P2aDataHandler::P2aDataHandler(ipmiblob::BlobInterface*, host_tool::HostIoInterface*, host_tool::PciUtilInterface*, internal::Sys const*)': /home/pengms1/SDK/OpenBmc/phosphor-ipmi-flash/tools/p2a.hpp:28: undefined reference to `internal::sys_impl' /home/pengms1/SDK/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/libexec/x86_64-openbmc-linux/gcc/x86_64-openbmc-linux/9.1.0/real-ld: ./.libs/libupdater.a(libupdater_la-updater.o): in function `host_tool::updaterMain(host_tool::UpdateHandlerInterface*, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)': /home/pengms1/SDK/OpenBmc/phosphor-ipmi-flash/tools/updater.cpp:42: undefined reference to `ipmi_flash::staticLayoutBlobId[abi:cxx11]' /home/pengms1/SDK/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/libexec/x86_64-openbmc-linux/gcc/x86_64-openbmc-linux/9.1.0/real-ld: /home/pengms1/SDK/OpenBmc/phosphor-ipmi-flash/tools/updater.cpp:42: undefined reference to `ipmi_flash::ubiTarballBlobId[abi:cxx11]' /home/pengms1/SDK/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/libexec/x86_64-openbmc-linux/gcc/x86_64-openbmc-linux/9.1.0/real-ld: /home/pengms1/SDK/OpenBmc/phosphor-ipmi-flash/tools/updater.cpp:59: undefined reference to `ipmi_flash::hashBlobId[abi:cxx11]' /home/pengms1/SDK/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/libexec/x86_64-openbmc-linux/gcc/x86_64-openbmc-linux/9.1.0/real-ld: /home/pengms1/SDK/OpenBmc/phosphor-ipmi-flash/tools/updater.cpp:64: undefined reference to `ipmi_flash::verifyBlobId[abi:cxx11]' /home/pengms1/SDK/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/libexec/x86_64-openbmc-linux/gcc/x86_64-openbmc-linux/9.1.0/real-ld: /home/pengms1/SDK/OpenBmc/phosphor-ipmi-flash/tools/updater.cpp:76: undefined reference to `ipmi_flash::updateBlobId[abi:cxx11]' /home/pengms1/SDK/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/libexec/x86_64-openbmc-linux/gcc/x86_64-openbmc-linux/9.1.0/real-ld: ./.libs/libupdater.a(libupdater_la-handler.o): in function `host_tool::UpdateHandler::cleanArtifacts()': /home/pengms1/SDK/OpenBmc/phosphor-ipmi-flash/tools/handler.cpp:167: undefined reference to `ipmi_flash::cleanupBlobId[abi:cxx11]' collect2: error: ld returned 1 exit status Makefile:500: recipe for target 'burn_my_bmc' failed make[3]: *** [burn_my_bmc] Error 1 make[3]: Leaving directory '/home/pengms1/SDK/OpenBmc/phosphor-ipmi-flash/tools' Makefile:632: recipe for target 'all-recursive' failed make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory '/home/pengms1/SDK/OpenBmc/phosphor-ipmi-flash/tools' Makefile:611: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/home/pengms1/SDK/OpenBmc/phosphor-ipmi-flash' Makefile:463: recipe for target 'all' failed make: *** [all] Error 2 Since that builds for me, I need to see how you're building it, not just the failure output. How are you configuring it to build? What changes have you made to the recipe? I assume you meant you can build at that revision but not after. The patchset after actually fixes it so it'll build properly given the instructions specified in the README. There's a common base library used to store the common strings, etc, which are what you're seeing missing in the output. Basically, I'd need to see more output, the commands that are running before the errors. I'm building the SDK presently to see if I can reproduce in that environment. If you don't need to build in that environment, you can build this without it. The steps on the README were written while building it in a ubuntu docker instance that had nothing installed (then installed git, gcc, etc). Firstly, I ran into the issue where ipmi-blob-tool isn't installed into the sdk by default: Then. I'm seeing this, which is likely the cause of the problem. x86_64-openbmc-linux-ar: .libs/libupdater.lax/libfirmware_common.a/libfirmware_common_la-sys.o: plugin needed to handle lto object x86_64-openbmc-linux-ar: .libs/libupdater.lax/libfirmware_common.a/libfirmware_common_la-util.o: plugin needed to handle lto object x86_64-openbmc-linux-ranlib: .libs/libupdater.a(libfirmware_common_la-sys.o): plugin needed to handle lto object x86_64-openbmc-linux-ranlib: .libs/libupdater.a(libfirmware_common_la-util.o): plugin needed to handle lto object I don't see this issue when building within other instances, bitbake, or docker ubuntu. https://github.com/openbmc/meta-phosphor/blob/master/classes/flto-automake.bbclass This defines what should be used with flto in these cases... (our bitbake recipes don't' use this consistently). $ ./configure --enable-oe-sdk --host "$(uname -m)" --disable-build-bmc-blob-handler ... checking for x86_64-ar... (cached) x86_64-openbmc-linux-ar checking for archiver @FILE support... @ checking for x86_64-strip... (cached) x86_64-openbmc-linux-strip checking for x86_64-ranlib... x86_64-openbmc-linux-ranlib So it looks like it isn't checking for the gcc-ar and gcc-ranlib by default (no surprise). I ran this: $ make clean; make distclean; $ ./configure --enable-oe-sdk --host "$(uname -m)" --disable-build-bmc-blob-handler AR=x86_64-openbmc-linux-gcc-ar RANLIB=x86_64-openbmc-linux-gcc-ranlib ... checking for x86_64-ar... (cached) x86_64-openbmc-linux-gcc-ar checking for archiver @FILE support... @ checking for x86_64-strip... (cached) x86_64-openbmc-linux-strip checking for x86_64-ranlib... x86_64-openbmc-linux-gcc-ranlib ... $ make ... make[3]: Entering directory '/usr/local/google/git/workspaces/phosphor-ipmi-flash/tools' CXX burn_my_bmc-main.o CXX libupdater_la-updater.lo CXX libupdater_la-handler.lo CXX libupdater_la-helper.lo CXX libupdater_la-bt.lo CXX libupdater_la-lpc.lo CXX libupdater_la-io.lo CXX libupdater_la-pci.lo CXX libupdater_la-p2a.lo CXX libupdater_la-progress.lo CXXLD libupdater.la /opt/openbmc-phosphor/2.7.0/sysroots/x86_64-oesdk-linux/usr/bin/x86_64-openbmc-linux/../../libexec/x86_64-openbmc-linux/gcc/x86_64-openbmc-linux/9.1.0/ar: `u' modifier ignored since `D' is the default (see `U') CXXLD burn_my_bmc make[3]: Leaving directory '/usr/local/google/git/workspaces/phosphor-ipmi-flash/tools' Making all in test make[3]: Entering directory '/usr/local/google/git/workspaces/phosphor-ipmi-flash/tools/test' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory '/usr/local/google/git/workspaces/phosphor-ipmi-flash/tools/test' make[2]: Leaving directory '/usr/local/google/git/workspaces/phosphor-ipmi-flash/tools' make[1]: Leaving directory '/usr/local/google/git/workspaces/phosphor-ipmi-flash' .... This worked fine. 1) I should switch to flto-automake in the recipe 2) I can write up a section on compiling this against the SDK. 3) I should push for use of flto-automake in other recipes**until there's an upstream change to support this automatically (maybe there is***separate email thread)): grep -rn "\-flto" ./build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-*|grep Makefile.am ./build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-dbus-interfaces/1.0+gitAUTOINC+1f0e2ce6e1-r1/git/Makefile.am:9:libphosphor_dbus_la_CXXFLAGS = $(SYSTEMD_CFLAGS) $(SDBUSPLUS_CFLAGS) -flto ./build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-fan/1.0+gitAUTOINC+d9a580aa50-r1/git/presence/Makefile.am:28: -flto ./build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-fan/1.0+gitAUTOINC+d9a580aa50-r1/git/control/Makefile.am:30: -flto ./build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-fan/1.0+gitAUTOINC+d9a580aa50-r1/git/monitor/Makefile.am:31: -flto ./build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-fan/1.0+gitAUTOINC+d9a580aa50-r1/git/cooling-type/Makefile.am:17: -flto ./build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-inventory-manager/1.0+gitAUTOINC+ded627c42f-r1/git/Makefile.am:13:phosphor_inventory_CXXFLAGS = $(SDBUSPLUS_CFLAGS) -flto ./build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-ipmi-host/1.0+gitAUTOINC+2a5d8d1ffe-r1/git/user_channel/Makefile.am:2: -flto \ ./build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-ipmi-host/1.0+gitAUTOINC+2a5d8d1ffe-r1/git/libipmid/Makefile.am:2: -flto \ ./build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-ipmi-host/1.0+gitAUTOINC+2a5d8d1ffe-r1/git/Makefile.am:38: -flto \ ./build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-ipmi-host/1.0+gitAUTOINC+2a5d8d1ffe-r1/git/test/Makefile.am:2: -flto \ ./build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-ipmi-net/1.0+gitAUTOINC+052b7cf374-r1/git/Makefile.am:76: -flto \ ./build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-logging/1.0+gitAUTOINC+0a0b5ea558-r1/git/phosphor-rsyslog-config/Makefile.am:23: -flto ./build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-network/1.0+gitAUTOINC+7bcaccfdae-r1/git/Makefile.am:45:ncsi_netlink_CXXFLAGS = -flto ./build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-network/1.0+gitAUTOINC+7bcaccfdae-r1/git/Makefile.am:98: -flto ./build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-software-manager/1.0+gitAUTOINC+a013560f96-r1/git/Makefile.am:101: -flto ./build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-time-manager/1.0+gitAUTOINC+66bc0a5a9f-r1/git/Makefile.am:24: -flto ./build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-time-manager/1.0+gitAUTOINC+66bc0a5a9f-r1/git/test/Makefile.am:24: $(SDBUSPLUS_CFLAGS) -flto ./build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-user-manager/1.0+gitAUTOINC+75b5a6fc4c-r1/git/phosphor-ldap-config/Makefile.am:26: -flto ./build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-user-manager/1.0+gitAUTOINC+75b5a6fc4c-r1/git/phosphor-ldap-mapper/Makefile.am:21: -flto Regards, Andrew 发件人: Patrick Venture > 发送时间: 2019年6月29日 6:24 收件人: Andrew MS1 Peng > 抄送: OpenBMC Maillist >; Duke KH Du >; benjaminfair@google.com; Adriana Kobylak > 主题: Re: [External] Re: Clarify some questions about in-band firmware update On Fri, Jun 28, 2019 at 7:09 AM Patrick Venture > wrote: On Fri, Jun 28, 2019 at 4:30 AM Andrew MS1 Peng > 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@hsbmc: $ ./burn_my_bmc -bash: ./burn_my_bmc: No such file or directory pengms1@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 > 发送时间: 2019年6月27日 9:59 收件人: Andrew MS1 Peng >; OpenBMC Maillist > 抄送: Duke KH Du >; benjaminfair@google.com; Adriana Kobylak > 主题: [External] Re: Clarify some questions about in-band firmware update On Wed, Jun 26, 2019 at 7:44 AM Patrick Venture > wrote: On Wed, Jun 26, 2019 at 4:28 AM Andrew MS1 Peng > 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. --- a/meta-phosphor/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bbappend +++ b/meta-phosphor/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bbappend @@ -1 +1 @@ -RRECOMMENDS_${PN}_append = " gtest sdbusplus phosphor-logging libstdc++-staticdev" +RRECOMMENDS_${PN}_append = " gtest sdbusplus phosphor-logging libstdc++-staticdev ipmi-blob-tool"