回复： What does openbmc system do after update BMC Firmware and taps reboot?
1181052146 at qq.com
Thu Mar 5 00:50:47 AEDT 2020
Thanks a lot. It realy helps me a lot. Thanks again.
------------------ 原始邮件 ------------------
发件人: "Milton Miller II"<miltonm at us.ibm.com>;
发送时间: 2020年3月3日(星期二) 上午9:34
收件人: "南野ムルシエラゴ"<1181052146 at qq.com>;
抄送: "openbmc"<openbmc at lists.ozlabs.org>;
主题: Re: What does openbmc system do after update BMC Firmware and taps reboot?
Around 03/02/2020 01:30AM in some timezone, "南野ムルシエラゴ" <1181052146 at qq.com> wrote:
>I am learning how openbmc update BMC firmware. I am following the
>md" to update BMC Firmware. It works well for me.
>But I still do not know, why in step 7 should I reboot, and what
The low level workings was described better in the deprecated API
documentation; as it says only the API is deprecated and not the
>Later I found in
>diagrams.md", which tells that:
> [*] In a static layout configuration, the images are stored
>in RAM and the content is written to flash during BMC reboot.
> Reference the update and shutdown scripts provided by
>I am using a static layout. And I found two scripts named "shutdown"
>and "update" in "/run/initramfs/". So I thought it is that, the
>update applications put the firmware image in /run/initramfs/ and
>when I tap reboot, by some means the "update" script runs and the
>"update" script using "flashcp" command to write the firmware image
>to the /dev/mtd. Is that right?
Yes, the shutdown script is invoked by systemd and undoes the overlay
mount. This happends for both reboot and shutdown.
See the third bullet here
>What happens after I tap "reboot", and who calls the "update" script,
>and how it calls the "update" scripts?
The shutdown script finishes unmounting the overlay, from which initrd
was running. The shutdown script just runs using the busybox and libc.
The shutdown scripts notices the files in /run/initramfs and calls the
There is a big reason to do this at shutdown: Its very unwise to try
to run off a file system while the file system raw media is being
For a static layout, there is only flash space for one copy. The init
script can make a separate copy (the deprecated API doc explains how)
and then you can erase and flash at runtime (with full services and
network to monitor progress). The update script will automatically
detect the code-update mode; don't try to fake it out you will only
crash the machine.
If you want your bmc to be online set update mode and reboot (it gets
unset for the next boot every boot). (I've seen slow flash take
30 minutes to erase; others take just few minutes).
>Can someone tell me? Thanks a lot!
Feel free to ask more questions I try to answer questions in this area
daily. (I'm the author of the low level mechanism; the code-update API
was written by others).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the openbmc