How to let openbmc's kernel load jffs2 file system

Milton Miller II miltonm at us.ibm.com
Tue Jul 14 14:30:07 AEST 2020



"郁雷"  wrote:
>Sent by: "openbmc" 
>On Tue, Jul 14, 2020 at 9:34 AM 周 远清 <zhouyuanqing8 at outlook.com>
>wrote:
>>
>> Hello everyone,
>>
>> The rofs squashfs currently loaded by the kernel of openbmc is very
>inconvenient to debug because squashfs is a read-only file system. I
>made a jffs2 file system, after modifying the bootarg parameters of
>uboot, the kernel still loads squashfs.
>
>By default the root (/) is mounted by an overlayfs, so the whole
>rootfs is writable, see below:
>
>    cow on / type overlay
>(rw,relatime,lowerdir=run/initramfs/ro,upperdir=run/initramfs/rw/cow,
>workdir=run/initramfs/rw/work)
>
>Be noted that the rwfs mounted at /run/initramfs/rw has a limited
>size, so you could only put files with limited size.
>For testing purposes, you could manually create overlayfs mount in
>tmpfs, that way you could use the ramfs instead of rwfs, and it will
>be cleaned after BMC reboot.
>

The openbmc init script support mounting hte overlayfs from ram
for code update or just using more memory than you have left for rwfs.

Add the folowing option to either your kernel command line or set 
in the u-boot environment variable openbmcinit

overlay-filesystem-in-ram

to use a tmpfs for the overlay.  To restore files from the rwfs partiton
that are whitelisted add

copy-files-to-ram


example

https://github.com/openbmc/openbmc/tree/master/meta-phosphor/recipes-phosphor/initrdscripts/files


>From os prompt
fwsetenv openbmcinit overlay-filesystem-in-ram copy-files-to-ram

or from  u-boot
setenv openbmcinit overlay-filesystem-in-ram copy-files-to-ram
saveenv

To save files in the whitelist (/run/initrd/whitelist) to the rwfs,

touch /run/initrdramfs/image-rwfs
reboot

Milton
(author of the phosphor init scripts)

>-- 
>BRs,
>Lei YU
>
>



More information about the openbmc mailing list