gzip improperly installed - When one builds and
installs gzip, gzcat, and gunzip only one binary is installed and it
is linked to 3 times. this saves lots of disk space since the same binary
preforms all 3 functions and knows which function to do based on either
command line arguments, or the name it is called by. A proper gzip install
looks like this:
wa3yre.wynn.com: ls -l | grep 90112
-rwxr-xr-x 3 root 90112 Oct 1 1994 gunzip
-rwxr-xr-x 3 root 90112 Oct 1 1994 gzcat
-rwxr-xr-x 3 root 90112 Oct 1 1994 gzip
wa3yre.wynn.com:
The Zaurus gzip install looks like this:
zbox.wynn.com:ls -l | grep 55120
-rwxrwxr-x 1 root root 55120 Apr 28 00:33 gunzip
-rwxrwxr-x 1 root root 55120 Apr 21 23:14 gzip
-rwxrwxr-x 1 root root 55120 Feb 4 05:25 zcat
zbox.wynn.com:
Note also that gzcat is called zcat, Sharp should really put the g
back to avoid confussion with the real zcat which is far less usefull.
We have these packages taking up
3 times the space they need to in a system with very limited disk space.
Is the person at sharp that builds the roms for the Zaurus a Unix Novice?
Furhter investigation of the system shows that the waste of space is even
worse because busybox includes gzip and gunzip.
zbox.wynn.com:busybox
BusyBox v0.52 (2001.08.30-07:09+0000) multi-call binary
Usage: busybox [function] [arguments]...
or: [function] [arguments]...
BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable. Most people will create a
link to busybox for each function they wish to use, and BusyBox
will act like whatever it was invoked as.
Currently defined functions:
basename, busybox, cat, chgrp, chmod, chown, chroot, chvt, clear,
cp, cut, date, dc, dd, deallocvt, df, dirname, dmesg, dpkg, dpkg-deb,
du, dumpkmap, dutmp, echo, env, false, fbset, fdflush, find, free,
freeramdisk, fsck.minix, grep, gunzip, gzip, halt, head, hostid,
hostname, id, init, kill, killall, klogd, length, linuxrc, ln,
loadacm, loadfont, loadkmap, logger, logname, ls, lsmod, makedevs,
md5sum, mkdir, mkfifo, mkfs.minix, mknod, mkswap, mktemp, more,
mount, mt, mv, nc, nslookup, ping, poweroff, printf, ps, pwd,
reboot, reset, rm, rmdir, sed, setkeycodes, sh, sleep, sort, swapoff,
swapon, sync, syslogd, tail, tar, tee, telnet, touch, tr, true,
tty, umount, uname, uniq, update, uptime, usleep, uudecode, uuencode,
wc, wget, which, whoami, xargs, yes, zcat
zbox.wynn.com:
This means that almost all the space taken by gzip, gunzip and zcat is wasted.
While the current busybox does not have gzcat defined, it could be recompiled
to have it with very little overhead added. If that is not desired gzcat
can be simulated with the simple shell program below.
#! /bin/sh
#
# gzcat - wrapper for gunzip applet of busy box to simulate the real
# gzcat. Copyright 2002/04/28 by Brett Wynkoop
# wynkoop@wynn.com.
# This software is released under the GNU public license. You can
# obtain a copy of the GPL at
# http://www.gnu.org/licenses/gpl.txt
#
PATH=/bin:/usr/bin
LD_LIBRARY_PATH=/lib:/usr/lib
export PATH LD_LIBRARY_PATH
MYNAME=`basename $0`
echo $@ | grep "\-h"
if [ $? -eq 0 ]
then
echo "usage: $MYNAME [-dfhlLnNrtvV19] [-S suffix] [file ...]"
gunzip -h 2>&1 | grep -v gunzip | grep -v stdout
echo
exit 0
fi
exec gunzip -c $@
Let's hope Sharp cuts this waste of disk space in future Rom Images. The wasted
165K of disk space is enough for several other programs to be installed.