Tiny Core Base > TCB Bugs
printf in /init, it has missing "f"
nick65go:
so, in summary,
curaga solved the bug for the next TC version, using
--- Code: ---awk '{printf("%d\n", $2/3)}'`
--- End code ---
rich explained the logic of empiric/statistic chose of average file size = 3K bytes of system ("/") in 90% RAM
for normal boot option (like without user providing a boot code of "noembed").
This also means that it is expected to use the rest 10% RAM for zram_swap in memory, or else that 10% RAM is wasted.
FYI: If I would be nasty, I could ask about the second branch from /init, when the user provides the boot code of "noembed".
So here again we have a tmp file-system mounted and then chroot into it.
But in this case neglecting the nr_inode parameter for the mount command. so using by default 1/2 ratio.
(how convenient, the final result is another number of inodes, for the same core.gz in the same RAM size).
I do not use this second (noembed) branch, so is no point to complicate the code. Plus very few appl nowadays need it.
nick65go:
(no intention to put salt on the wound), I found another piece of code, with the same awk problem:
tc-config: Remove needless modprobes, reported by Rich
https://github.com/tinycorelinux/Core-scripts/commit/fcca3f6c9bdc2762c81222380347bf1ad94e7482
while [ ! -e /dev/zram0 ]; do usleep 50000; done
grep MemFree /proc/meminfo | awk '{print $2/4 "K"}' > /sys/block/zram0/disksize
curaga:
Fixed, thanks.
The noembed case is for special setups, but you have to note it already takes 2x the ram temporarily. For a moment, both the old and new initrd are held in memory. This means you won't be using it on memory-constrained setups, and so an inode limit makes less sense. The 90% size is raising a limit, not lowering.
nick65go:
@curaga: got it! thanks for the feed-back. will be nice that a full check for all "awk" strings in tc scripts to be done by a skilled programmer; not just cherry-picking like I did.
also, a suggestion: to insert a very short comment in /init, like
--- Code: ---# allocate 1 inode for 3KB average file size in ram
--- End code ---
just because I did not have the documentation of this, I (un-necessary) searched the internet (minutes/hours) for this info.
Navigation
[0] Message Index
[*] Previous page
Go to full version