How to auto mount tmpfs

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to auto mount tmpfs

跳至解决方案
5,817 次查看
chandrashekhar
Contributor III

Hi,

I need to auto mount tmpfs to /media/ram , How to do that? One method I tried by adding entry in $meta/recipes-core/base-files/base-files/fstab  but its not working. I feel rootfs is not able to create ram directory in /media. How it can be done?

Regards,

Chandra

0 项奖励
回复
1 解答
4,265 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Hello Chandra,

Please refer to the following procedure.

Add the following line in the file poky/meta/recipes-core/base-files/base-files/fstab.

tmpfs /media/ram            tmpfs      defaults              0 0

Add "/media/ram" in the variable dirs755 in poky/meta/recipes-core/base-files/base-files_3.0.14.bb.

Execute the following in Yocto to rebuild rootfs image.

$ bitbake base-files -c cleansstate

$ bitbake fsl-image-core

Please refer to the following.

root@t1040qds:~# df /media/ram/

Filesystem    1K-blocks  Used Available Use% Mounted on

tmpfs            1999872      0       1999872  0% /media/ram


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
3 回复数
4,266 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Hello Chandra,

Please refer to the following procedure.

Add the following line in the file poky/meta/recipes-core/base-files/base-files/fstab.

tmpfs /media/ram            tmpfs      defaults              0 0

Add "/media/ram" in the variable dirs755 in poky/meta/recipes-core/base-files/base-files_3.0.14.bb.

Execute the following in Yocto to rebuild rootfs image.

$ bitbake base-files -c cleansstate

$ bitbake fsl-image-core

Please refer to the following.

root@t1040qds:~# df /media/ram/

Filesystem    1K-blocks  Used Available Use% Mounted on

tmpfs            1999872      0       1999872  0% /media/ram


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
4,265 次查看
chandrashekhar
Contributor III

Thanks Yiping. I am able to add directory and mount as mentioned as suggested by you. I have one more query that how can we modify the size of tmpfs ? As I can see in my board it is

root@t1040rdb:/media/ram# df -h

Filesystem      Size  Used Avail Use% Mounted on

/dev/root       126M   98M   22M  83% /

devtmpfs        915M  4.0K  915M   1% /dev

tmpfs           963M  184K  963M   1% /run

tmpfs           963M   96K  963M   1% /var/volatile

tmpfs           963M  167M  797M  18% /media/ram

I would like to increase /media/ram size. How it can be done?

0 项奖励
回复
4,265 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Hello Chandra,

Please modify the configuration as the following in poky/meta/recipes-core/base-files/base-files/fstab.

tmpfs           /media/ram       tmpfs size=4G         0  0

Then rebuild rootfs image

$ bitbake base-files -c cleansstate

$ bitbake fsl-image-core


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复