=====================================
1) Thou shall turn on CONFIG_BUSYBOX_CONFIG_MKFS_EXT2=y
Justification: ~15-20k binary vs 350k (with stripping) for mkfs.ext2 and
if you want the proper mkfs.ext4 etc you can install it in your overlay
- extroot. Busybox mkfs.ext2 and e2fsprogs are configured not to collide
with each-other. This patch makes the need for e2fsprogs libext2
redundant. Not having this (like we do right now) will flood the bug
reports with idiots (like me) wondering why they bricked their router
when it can't mount /tmp.
2) Debatable: Thou shall disable zram-swap, zram-swap shall block this
PROC_ZRAM_TMPFS option.
Justification: Right now they both want to use /dev/zram0, but the
system will have no space for running apps if they are both running at
the same time. You need to allocate 1/3 ram to each at best. That will
have be a new compile time option in a further patch, that I will
release should someone make the argument for wanting both of these.
You either want 1 of 3 possible setups. #1 This patch. Best for people
who need to opkg -d ram a lot of stuff #2 tmpfs and progs BOTH can use
zram-swap which makes it a better overall choice, after thinking about
this patch it isn't worth it as much as just using zram-swap. But better
have a working feature than a broken one as it exists in buildroot now
Or #3 Assuming you have a fast storage device connected to your openwrt
(most don't but some NASes do) ZSWAP kernel will dynamically use free
memory to offer a pre-swap cache, and allow compressed data (lzo/lz4) to
be wrote to swap. It may require an actual initialized swap device to
work. I haven't RTFMed yet.
3) Debatable: LZ4 should be on by default. (My two cents)
Justification: It's almost compresses well as LZO but it's less CPU
intensive for those without Floating point SMID's which is most home
routers. So put some help about that in the Makefile. LZ4 is included as
a dependency to the zram.ko module and will be loaded at early boot by
modprobe / procd. Contrary to rumors circulating on openwrt's trac it
actually works :) https://dev.openwrt.org/ticket/22666#comment:3
4) Highly recommended: Makefile should block option if your kernel isn't
4.4.
Justification: https://dev.openwrt.org/ticket/21705 & above
5) Stop openwrt folks trying to patch the kernel to make two zram
devices by default because you can hot-add them.
https://dev.openwrt.org/ticket/19586#comment:10
Here's the patch
---------------------------------------------
procd: remove dependency on bloated e2fsprogs/libext2 and use
CONFIG_BUSYBOX_CONFIG_MKFS_EXT2=y
At a minimum (see accompanying email on mailing list) advising my two
cents on the pros and cons of this patch
you need to add a configuration option to the Makefile if you want lz4
support
config PROCD_ZRAM_TMPFS
bool
default n
prompt "Mount /tmp using zram."
endmenu
&
ifeq ($(CONFIG_PROCD_ZRAM_TMPFS_LZ4),y)
CMAKE_OPTIONS += -DZRAM_TMPFS_LZ4=1
endif
Signed-off-by: Luke McKee <hojuruku@gmail.com>
@@ -82,7 +82,7 @@
int
mount_zram_on_tmp(void)
{
- char *mkfs[] = { "/usr/sbin/mkfs.ext4", "-b", "4096", "-F", "-L",
"TEMP", "-m", "0", "/dev/zram0", NULL };
+ char *mkfs[] = { "/sbin/mkfs.ext2", "-b", "4096", "-F", "-L",
"TEMP", "-m", "0", "/dev/zram0", NULL };
FILE *fp;