How to auto mount tmpfs

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to auto mount tmpfs

Jump to solution
3,524 Views
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 Kudos
1 Solution
1,972 Views
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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
3 Replies
1,973 Views
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 Kudos
1,972 Views
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 Kudos
1,972 Views
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 Kudos