All of lore.kernel.org
 help / color / mirror / Atom feed
* What does openbmc system do after update BMC Firmware and taps reboot?
@ 2020-03-02  7:24 =?gb18030?B?xM/SsKXgpeult6WopemltA==?=
  2020-03-02 20:41 ` Vijay Khemka
  2020-03-03  1:34 ` Milton Miller II
  0 siblings, 2 replies; 4+ messages in thread
From: =?gb18030?B?xM/SsKXgpeult6WopemltA==?= @ 2020-03-02  7:24 UTC (permalink / raw)
  To: =?gb18030?B?b3BlbmJtYw==?=

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb18030", Size: 1221 bytes --]

Greetings:

I am learning how openbmc update BMC firmware. I am following the guide "https://github.com/openbmc/docs/blob/master/code-update/code-update.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 reboot do?
Later I found in "https://github.com/openbmc/docs/blob/master/code-update/code-update-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 initrdscripts
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?
What happens after I tap "reboot", and who calls the "update" script, and how it calls the "update" scripts?
Can someone tell me? Thanks a lot!

Best Regards!
Liu Hongwei

[-- Attachment #2: Type: text/html, Size: 1355 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: What does openbmc system do after update BMC Firmware and taps reboot?
  2020-03-02  7:24 What does openbmc system do after update BMC Firmware and taps reboot? =?gb18030?B?xM/SsKXgpeult6WopemltA==?=
@ 2020-03-02 20:41 ` Vijay Khemka
  2020-03-03  1:34 ` Milton Miller II
  1 sibling, 0 replies; 4+ messages in thread
From: Vijay Khemka @ 2020-03-02 20:41 UTC (permalink / raw)
  To: 南野ムルシエラゴ,
	openbmc

[-- Attachment #1: Type: text/plain, Size: 1673 bytes --]

During reboot, shutdown scripts check for any images in initramfs and it overwrites to its predefined partition via update scripts.

From: openbmc <openbmc-bounces+vijaykhemka=fb.com@lists.ozlabs.org> on behalf of 南野ムルシエラゴ <1181052146@qq.com>
Date: Sunday, March 1, 2020 at 11:30 PM
To: openbmc <openbmc@lists.ozlabs.org>
Subject: What does openbmc system do after update BMC Firmware and taps reboot?

Greetings:

I am learning how openbmc update BMC firmware. I am following the guide "https://github.com/openbmc/docs/blob/master/code-update/code-update.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 reboot do?
Later I found in "https://github.com/openbmc/docs/blob/master/code-update/code-update-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 initrdscripts<https://github.com/openbmc/openbmc/tree/master/meta-phosphor/recipes-phosphor/initrdscripts>
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?
What happens after I tap "reboot", and who calls the "update" script, and how it calls the "update" scripts?
Can someone tell me? Thanks a lot!

Best Regards!
Liu Hongwei


[-- Attachment #2: Type: text/html, Size: 3893 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: What does openbmc system do after update BMC Firmware and taps reboot?
  2020-03-02  7:24 What does openbmc system do after update BMC Firmware and taps reboot? =?gb18030?B?xM/SsKXgpeult6WopemltA==?=
  2020-03-02 20:41 ` Vijay Khemka
@ 2020-03-03  1:34 ` Milton Miller II
  2020-03-04 13:50   ` =?gb18030?B?u9i4tKO6ICBXaGF0IGRvZXMgb3BlbmJtYyBzeXN0ZW0gZG8gYWZ0ZXIgdXBkYXRlIEJNQyBGaXJtd2FyZSBhbmQgdGFwcyByZWJvb3Q/?= =?gb18030?B?xM/SsKXgpeult6WopemltA==?=
  1 sibling, 1 reply; 4+ messages in thread
From: Milton Miller II @ 2020-03-03  1:34 UTC (permalink / raw)
  To: 南野ムルシエラゴ; +Cc: openbmc

Around 03/02/2020 01:30AM in some timezone,  "南野ムルシエラゴ" <1181052146@qq.com> wrote:

>Greetings:
>
>I am learning how openbmc update BMC firmware. I am following the
>guide
>"https://github.com/openbmc/docs/blob/master/code-update/code-update.
>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
>reboot do?

The low level workings was described better in the deprecated API 
documentation; as it says only the API is deprecated and not the 
underlying mechanism.  

https://github.com/openbmc/docs/blob/master/code-update/code-update-deprecated.md#preparing-for-bmc-code-update

>Later I found in
>"https://github.com/openbmc/docs/blob/master/code-update/code-update-
>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
>initrdscripts



>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

https://www.freedesktop.org/wiki/Software/systemd/InitrdInterface/


>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
update script.


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 
replaced.

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).

>
>Best Regards!
>Liu Hongwei
>

milton

^ permalink raw reply	[flat|nested] 4+ messages in thread

* =?gb18030?B?u9i4tKO6ICBXaGF0IGRvZXMgb3BlbmJtYyBzeXN0ZW0gZG8gYWZ0ZXIgdXBkYXRlIEJNQyBGaXJtd2FyZSBhbmQgdGFwcyByZWJvb3Q/?=
  2020-03-03  1:34 ` Milton Miller II
@ 2020-03-04 13:50   ` =?gb18030?B?xM/SsKXgpeult6WopemltA==?=
  0 siblings, 0 replies; 4+ messages in thread
From: =?gb18030?B?xM/SsKXgpeult6WopemltA==?= @ 2020-03-04 13:50 UTC (permalink / raw)
  To: =?gb18030?B?TWlsdG9uIE1pbGxlciBJSQ==?=; +Cc: =?gb18030?B?b3BlbmJtYw==?=

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb18030", Size: 3628 bytes --]

Hi, Milton


Thanks a lot. It realy helps me a lot. Thanks again.


Best Regards!
Liu Hongwei





------------------&nbsp;ԭʼÓʼþ&nbsp;------------------
·¢¼þÈË:&nbsp;"Milton Miller II"<miltonm@us.ibm.com&gt;;
·¢ËÍʱ¼ä:&nbsp;2020Äê3ÔÂ3ÈÕ(ÐÇÆÚ¶þ) ÉÏÎç9:34
ÊÕ¼þÈË:&nbsp;"ÄÏÒ°¥à¥ë¥·¥¨¥é¥´"<1181052146@qq.com&gt;;
³­ËÍ:&nbsp;"openbmc"<openbmc@lists.ozlabs.org&gt;;
Ö÷Ìâ:&nbsp;Re:  What does openbmc system do after update BMC Firmware and taps reboot?



Around 03/02/2020 01:30AM in some timezone,&nbsp; "ÄÏÒ°¥à¥ë¥·¥¨¥é¥´" <1181052146@qq.com&gt; wrote:

&gt;Greetings:
&gt;
&gt;I am learning how openbmc update BMC firmware. I am following the
&gt;guide
&gt;"https://github.com/openbmc/docs/blob/master/code-update/code-update.
&gt;md" to update BMC Firmware. It works well for me.
&gt;But I still do not know, why in step 7 should I reboot, and what
&gt;reboot do?

The low level workings was described better in the deprecated API 
documentation; as it says only the API is deprecated and not the 
underlying mechanism.&nbsp; 

https://github.com/openbmc/docs/blob/master/code-update/code-update-deprecated.md#preparing-for-bmc-code-update

&gt;Later I found in
&gt;"https://github.com/openbmc/docs/blob/master/code-update/code-update-
&gt;diagrams.md", which tells that:
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [*] In a static layout configuration, the images are stored
&gt;in RAM and the content is written to flash during BMC reboot. 
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Reference the update and shutdown scripts provided by
&gt;initrdscripts



&gt;I am using a static layout. And I found two scripts named "shutdown"
&gt;and "update" in "/run/initramfs/". So I thought it is that, the
&gt;update applications put the firmware image in /run/initramfs/ and
&gt;when I tap reboot, by some means the "update" script runs and the
&gt;"update" script using "flashcp" command to write the firmware image
&gt;to the /dev/mtd. Is that right?

Yes, the shutdown script is invoked by systemd and undoes the overlay 
mount.&nbsp; This happends for both reboot and shutdown.

See the third bullet here

https://www.freedesktop.org/wiki/Software/systemd/InitrdInterface/


&gt;What happens after I tap "reboot", and who calls the "update" script,
&gt;and how it calls the "update" scripts?

The shutdown script finishes unmounting the overlay, from which initrd
was running.&nbsp; The shutdown script just runs using the busybox and libc.
The shutdown scripts notices the files in /run/initramfs and calls the
update script.


There is a big reason to do this at shutdown:&nbsp;&nbsp; Its very unwise to try 
to run off a file system while the file system raw media is being 
replaced.

For a static layout, there is only flash space for one copy.&nbsp; 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).&nbsp; 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).&nbsp; (I've seen slow flash take 
30 minutes to erase; others take just few minutes).

&gt;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).

&gt;
&gt;Best Regards!
&gt;Liu Hongwei
&gt;

milton

[-- Attachment #2: Type: text/html, Size: 4217 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-03-04 13:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-02  7:24 What does openbmc system do after update BMC Firmware and taps reboot? =?gb18030?B?xM/SsKXgpeult6WopemltA==?=
2020-03-02 20:41 ` Vijay Khemka
2020-03-03  1:34 ` Milton Miller II
2020-03-04 13:50   ` =?gb18030?B?u9i4tKO6ICBXaGF0IGRvZXMgb3BlbmJtYyBzeXN0ZW0gZG8gYWZ0ZXIgdXBkYXRlIEJNQyBGaXJtd2FyZSBhbmQgdGFwcyByZWJvb3Q/?= =?gb18030?B?xM/SsKXgpeult6WopemltA==?=

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.