line 24 in /etc/preinit:
size=$(awk '/MemTotal:/ {l=5242880;mt=($2*1024);print((s=mt/2)l)?mt-l:s}' /proc/meminfo)
if the 'mt' is more then 5MB and less then 10MB, the 'size' = 'mt-5242880'. if the formula above is established , the 'size' will be very small in the case when 'mt' = 5.1M.
I did a test, and got the result as below:
$mount
...
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,size=8k) #here,very small
...
Is it a bug? can anyone pls give me some advices?
Why mount a very small tmpfs on /tmp in /etc/preinit
最新推荐文章于 2024-10-29 19:36:21 发布
本文介绍了一个使用awk命令根据/proc/meminfo中的MemTotal值来动态调整tmpfs挂载点大小的方法。当总内存介于5MB到10MB之间时,会从总内存中减去固定值来设置tmpfs的大小。
1020

被折叠的 条评论
为什么被折叠?



