[OpenWrt-Devel] procd: patch to support busybox mkfs.ext2

Luke McKee hojuruku at gmail.com
Sun Jul 3 06:31:49 EDT 2016


m.storchak at gmail dot com wrote:
Is there a reason to use full path specification? Why can't
mkfs.ext{2|4} be called and whichever is found first in PATH gets
executed? In this case only one of e2fsprogs and busybox implementations
should be required. Let busybox be default, but please leave an option
to use full e2fsprogs and disable mkfs.ext* in busybox.
Something like DEPENDS:= ... +!BUSYBOX_CONFIG_MKFS_EXT2:e2fsprogs


Oh for the love of god. .... I'm fixing something that's in my opinion completely useless for 90% of the openwrt market due to size constraints to put libext2fs and e2fsprogs in rootfs and can't be used as is. 

Look at a technical level zram-swap works better, so as far as I'm concerned roll back this whole d$#$ feature. It's a niche market for those who want to have scripts to opkg -d ram install stuff and updated their profile to include LD_LIBRARY_PATH=/tmp/lib:/tmp/usr/lib or reconfigured their overlayfs.

Addressing your concerns:

1) If you format with mkfs.ext4 you have the added overhead of writing to the ram twice for a journal, you don't need because it's in ram. So #1 we won't be calling mkfs.ext4, and as someone else suggested we won't call tune2fs because busybox doesn't support trimming ext4 features like someone else said.

2) Your second point:
DEPENDS work like that for packages, but I'm not sure if they work in 
define Package/procd/config
stanzas - for the second time.


so I passed the buck to the maintainer who's job is to do the Makefile. 
Depends for Package/xyz/config is undocumented at openwrt dev dogs.

3) I'm not a C programmer but I RTFM
http://linux.die.net/man/2/execve, 

You've got to fork before you can run another process, unix semantics.
So now your proposed mod asks the patch to adds all this unnecessary crap to see first see files exist and they are executable. 
Bash scans the path for you - C doesn't. We'll if you really really want to use the bloat ware in rootfs image, then this patch will work, without busybox's 20k mkfs.ext2. Ext2 uses 7k ram (compressed). The journal is going to add double the compression/cpu overhead too, and waste a bit of ram. You'll be using more then 7k with ext4.

execve() also allows executable shell scripts (assuming you have the kernel bin_fmt enabled for it)
So if you really really want to use this patch without busybox mkfs.ext2 and use the fatter one...
put 
#/bin/ash
until [ -z "$1" ]  
do
  MKFS_ARGS="$MKFS_ARGS $1 "
  shift
done
/usr/sbin/mkfs.ext2 ${MKFS_ARGS}

In the place of /sbin/mkfs.ext2

Considering that 95% of openwrt users are consumer routers with 4-8mb flash
do we install 500k of stripped compressed code for mkfs.ext2 from e2fsprogs.
For the extra 20k busybox bloat (I h haven't measured it's 40k of source) what's wrong with having two mkfs.ext2's if you are so obsessed with putting bloatware in your image. Most routers aren't formatting ext4 fs. I was bitching about using ext4 vs ext2, but relented.

Does anyone remember when openwrt ran in a 2MB image on a WRT54G?

On top of this patchwork at lede chomped up my patch for no good reason when i used thunderbird in text mode..
http://patchwork.ozlabs.org/patch/643714/

I can see why the openwrt-devs get grumpy at working with everyone ;)

And before anyone grumbles about LZ4, I got half the upload speed using LZ4 sshing a openwrt image /tmp so LZO will be even worse (the default as it was before this patch). 1.6MB per second.
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list