persistent storage and bcc upgrade

Milton Miller II miltonm at us.ibm.com
Tue Aug 20 14:28:09 AEST 2019


On August 19, 2019 around 4:52PM in some timezone, Vijay Khemka wrote:
>       
> Team,
> I have a following question
>  what are directories mounted as rw and kept as persistent across
>reboot?

It depends on the flash layout you choose, but the default phosphor
initramfs will mount a readwrite overlay over the whole root.  From
that, /tmp and /run are excluded via a ramfs.

The UBI option will only allow writes to /var and /etc, and /home/root
(well, also /run and /tmp are tmpfs again).

That said you can do other customization.

>How are we updating BMC image and what happens to persistent storage
>after upgrade. I am using “flashcp” which copies complete 32 mb image
>which means  it wipes out everything stored currently.

Are you doing flashcp while the filesystem is mounted?  How are you
avoiding errors?

Are you booting in "code update mode" which will copy the squashfs
to RAM?   If so then read on.

The phosphor-initfs recipe has a whitelist file (was going to be
a directory but never made the patch) that will copy files from
the read-write backing filesystem to the overlay over the / to
the /run initramfs.  When booted in code-update mode, the files
and directories in the whitelist are copied to /run.  

When systemd shutown target is activated, the initramfs shutdown
script will call the update script to save any initramfs images.  
After writing images with flash_erase and flash_cp it will 
mount the read-write partition and copy back the ram overlay to
the persistent read-write filesystem (only the files in the
whitelist).  The shutdown script will also copy the u-boot env
partition back to the mtd, so variables there will also be restored.

This is the default for aspeed AST2500 and ASt2400 and as far as 
I know would also run for npcm (they just have an additional 
partition).

This was somewhat described in the newly merged (today)

https://github.com/openbmc/docs/blob/master/code-update/flash-layout.md

Feels free to ask more questions though the list.

milton



More information about the openbmc mailing list