Posted: Sun 16 Jun 2013, 12:49
It's actually haymonth here . With 12 days-week . 1 day for the god of work . 11 days free .
Code: Select all
diff -ruNt busybox-1.19.4_orig/coreutils/cal.c busybox-1.19.4/coreutils/cal.c
--- busybox-1.19.4_orig/coreutils/cal.c 2012-02-04 20:24:55.000000000 +0100
+++ busybox-1.19.4/coreutils/cal.c 2012-02-11 01:51:33.000000000 +0100
@@ -139,7 +139,7 @@
month_names[i] = xstrdup(buf);
if (i < 7) {
- zero_tm.tm_wday = i;
+ zero_tm.tm_wday = i + 1; /* MHHP: + 1, for Monday as first day of the week */
/* abbreviated weekday name according to locale */
strftime(buf, sizeof(buf), "%a", &zero_tm);
#if ENABLE_UNICODE_SUPPORT
@@ -264,7 +264,7 @@
* 3 Sep. 1752 through 13 Sep. 1752. Returns Thursday for all
* missing days.
*/
- temp = (long)(year - 1) * 365 + leap_years_since_year_1(year - 1) + day;
+ temp = (long)(year - 1) * 365 + leap_years_since_year_1(year - 1) + day - 1; /* MHHP: - 1, for Monday as first day of the week */
if (temp < FIRST_MISSING_DAY) {
dw = ((temp - 1 + SATURDAY) % 7);
} else {
Karl Godt wrote:2013 06:June 01:watday 02:disday 03:dongsday ...
would be really helpful
Code: Select all
f=/tmp/bla;echo;date "+%Y %m:%B">$f;m=`cat $f`;y=${m:0:4};m=${m:5:2};for i in `seq 31`;do date -d $y-$m-$i "+%d:%A">>$f 2>/dev/null;done;grep -v '-' $f|tr '\n' ' ';echo
Hi, L18L.L18L wrote:Karl Godt wrote:2013 06:June 01:watday 02:disday 03:dongsday ...
would be really helpfulCode: Select all
f=/tmp/bla;echo;date "+%Y %m:%B">$f;m=`cat $f`;y=${m:0:4};m=${m:5:2};for i in `seq 31`;do date -d $y-$m-$i "+%d:%A">>$f 2>/dev/null;done;grep -v '-' $f|tr '\n' ' ';echo
Why osmo and not compare with minixcal [edit] size: 8556B [/edit]musher0 wrote:... (168 bytes rather than 1Mb for osmo!)...
L18L,L18L wrote:technosaurus,
apologies for derailing your threadWhy osmo and not compare with minixcalmusher0 wrote:... (168 bytes rather than 1Mb for osmo!)...
The REAL cal does not: http://pubs.opengroup.org/onlinepubs/96 ... s/cal.htmlmusher0 wrote: (see picture)
Maybe it depends on the locale parameters that you use?
Still, the real cal offers more choices...
Code: Select all
$ { echo 0; { for cmd in `busybox |sed -ne 's/,/\n/gp' |grep -v xz`; do size `command -v $cmd` 2>/dev/null |tail -n 1; done; }|awk '{print $4 " + "}';echo p; }|busybox dc
12215080
Code: Select all
$ ./busybox; ls -l busybox
BusyBox v1.22.0.git (2013-06-12 22:24:54 PDT) multi-call binary.
BusyBox is copyrighted by many authors between 1998-2012.
Licensed under GPLv2. See source distribution for detailed
copyright notices.
Usage: busybox [function [arguments]...]
or: busybox --list[-full]
or: busybox --install [-s] [DIR]
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:
[, [[, acpid, add-shell, addgroup, adduser, adjtimex, ar, arp, ash,
awk, base64, basename, bash, bbconfig, beep, blkid, blockdev,
bootchartd, brctl, bunzip2, bzcat, bzip2, cal, cat, catv, chat, chattr,
chgrp, chmod, chown, chpasswd, chpst, chroot, chrt, chvt, cksum, clear,
cmp, comm, conspy, cp, cpio, crond, crontab, cryptpw, cttyhack, cut,
date, dc, dd, deallocvt, delgroup, deluser, depmod, devmem, df,
dhcprelay, diff, dirname, dmesg, dnsd, dnsdomainname, dos2unix, dpkg,
dpkg-deb, du, dumpkmap, dumpleases, echo, ed, egrep, eject, env,
envdir, envuidgid, expand, expr, fakeidentd, false, fbset, fbsplash,
fbvnc, fdflush, fdformat, fdisk, fgconsole, fgrep, find, findfs,
flash_eraseall, flash_lock, flash_unlock, flashcp, flock, fold, free,
freeramdisk, fsck, fsck.minix, fsync, ftpd, ftpget, ftpput, fuser,
getopt, getty, grep, groups, guess_fs, gunzip, gzip, halt, hd, hdparm,
head, hexdump, hostid, hostname, httpd, hush, hwclock, id, ifconfig,
ifdown, ifenslave, ifplugd, ifup, inetd, init, inotifyd, insmod,
install, ionice, iostat, ip, ipaddr, ipcalc, ipcrm, ipcs, iplink,
iproute, iprule, iptunnel, kbd_mode, kill, killall, killall5, klogd,
less, linux32, linux64, linuxrc, ln, loadfont, loadkmap, logger, login,
logname, logread, losetup, lpd, lpq, lpr, ls, lsattr, lsmod, lsof,
lspci, lsusb, lzcat, lzma, lzop, lzopcat, makedevs, makemime, man,
md5sum, mdev, mesg, microcom, mkdir, mkdosfs, mke2fs, mkfifo,
mkfs.ext2, mkfs.minix, mkfs.reiser, mkfs.vfat, mknod, mkpasswd, mkswap,
mktemp, modinfo, modprobe, more, mount, mountpoint, mpstat, msh, mv,
nameif, nanddump, nandwrite, nbd-client, nc, netstat, nice, nmeter,
nohup, nroff, nslookup, ntpd, od, openvt, passwd, patch, pgrep, pidof,
ping, ping6, pipe_progress, pivot_root, pkill, pmap, popmaildir,
poweroff, powertop, printenv, printf, ps, pscan, pstree, pwd, pwdx,
raidautorun, rdate, rdev, readahead, readlink, readprofile, realpath,
reboot, reformime, remove-shell, renice, reset, resize, rev, rfkill,
rm, rmdir, rmmod, route, rpm, rpm2cpio, rtcwake, run-parts, runsv,
runsvdir, rx, script, scriptreplay, sed, sendmail, seq, setarch,
setconsole, setfont, setkeycodes, setlogcons, setserial, setsid,
setuidgid, sh, sha1sum, sha256sum, sha3sum, sha512sum, showkey,
slattach, sleep, smemcap, softlimit, sort, split, start-stop-daemon,
stat, strings, stty, su, sulogin, sum, sv, svlogd, swapoff, swapon,
switch_root, sync, sysctl, syslogd, tac, tail, tar, tcpsvd, tee,
telnet, telnetd, test, tftp, tftpd, time, timeout, top, touch, tr,
traceroute, traceroute6, true, tty, ttysize, tunctl, tune2fs,
ubiattach, ubidetach, ubimkvol, ubirmvol, ubirsvol, ubiupdatevol,
udhcpc, udhcpc6, udhcpd, udpsvd, umount, uname, uncompress, unexpand,
uniq, unix2dos, unlzma, unlzop, unxz, unzip, uptime, usleep, uudecode,
uuencode, vconfig, vi, vlock, volname, watch, watchdog, wc, wget,
which, whoami, whois, xargs, xz, xzcat, yes, zcat, zcip
-rwxr-xr-x 1 ibid ibid 947304 Jun 12 23:01 busybox
http://busybox.net/downloads/busybox-snapshot.tar.bz2, and I can build a static busybox with that and more in less than one megabyte:
I'm using musl from git as libc--I useKarl Godt wrote:http://busybox.net/downloads/busybox-snapshot.tar.bz2, and I can build a static busybox with that and more in less than one megabyte:
Without pam and dmalloc mine is
bash-3.00# ls -l ./busybox
-rwxr-xr-x 1 root root 1939492 2013-06-19 11:28 ./busybox
the double size .
Upx'd would be 50% ~ 1MB estimated .
Use full modutils , disabled pretty output for lsmod and dmesg .
Had o switch the header directory /usr/include from the current upgraded one to the Puppy-4 kernel 2.6.30.5 /usr/include for
miscutils/adjtimex.c: In function ‘adjtimex_main’:
miscutils/adjtimex.c:92: Fehler: ‘ADJ_OFFSET_SINGLESHOT’ undeclared (first use in this function)
then switch back to the current for
miscutils/rfkill.c:23:26: error: linux/rfkill.h: No such file or directory
and finally switch to Lupu-5.1.1 /usr/include for
miscutils/ubi_tools.c:67:26: error: mtd/ubi-user.h: No such file or directory
.
Code: Select all
make CC=/path/to/musl-gcc CFLAGS="-static -Os -D_ALL_SOURCE"
Code: Select all
# CONFIG_EXTRA_COMPAT is not set
# CONFIG_USE_PORTABLE_CODE is not set
# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set
# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
# CONFIG_INSTALL_NO_USR is not set
# CONFIG_LOCALE_SUPPORT is not set
# CONFIG_UNICODE_USING_LOCALE is not set
# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set
# CONFIG_UNICODE_BIDI_SUPPORT is not set
# CONFIG_UNICODE_NEUTRAL_TABLE is not set
# CONFIG_FEATURE_CLEAN_UP is not set
# CONFIG_FEATURE_UTMP is not set
# CONFIG_FEATURE_WTMP is not set
# CONFIG_SELINUX is not set
# CONFIG_FEATURE_HAVE_RPC is not set
# CONFIG_PIE is not set
# CONFIG_NOMMU is not set
# CONFIG_BUILD_LIBBUSYBOX is not set
# CONFIG_FEATURE_INDIVIDUAL is not set
# CONFIG_FEATURE_SHARED_BUSYBOX is not set
# CONFIG_DEBUG is not set
# CONFIG_DEBUG_PESSIMIZE is not set
# CONFIG_WERROR is not set
# CONFIG_DMALLOC is not set
# CONFIG_EFENCE is not set
# CONFIG_INSTALL_APPLET_HARDLINKS is not set
# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set
# CONFIG_INSTALL_APPLET_DONT is not set
# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set
# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set
# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set
# CONFIG_FEATURE_SYSTEMD is not set
# CONFIG_FEATURE_HWIB is not set
# CONFIG_FEATURE_TAR_SELINUX is not set
# CONFIG_WHO is not set
# CONFIG_USERS is not set
# CONFIG_FEATURE_VI_REGEX_SEARCH is not set
# CONFIG_FEATURE_FIND_CONTEXT is not set
# CONFIG_FEATURE_CALL_TELINIT is not set
# CONFIG_PAM is not set
# CONFIG_MODPROBE_SMALL is not set
# CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE is not set
# CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set
# CONFIG_FEATURE_2_4_MODULES is not set
# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set
# CONFIG_FDISK_SUPPORT_LARGE_DISKS is not set
# CONFIG_FEATURE_MOUNT_NFS is not set
# CONFIG_DEVFSD is not set
# CONFIG_DEVFSD_MODLOAD is not set
# CONFIG_DEVFSD_FG_NP is not set
# CONFIG_DEVFSD_VERBOSE is not set
# CONFIG_LAST is not set
# CONFIG_FEATURE_LAST_SMALL is not set
# CONFIG_FEATURE_LAST_FANCY is not set
# CONFIG_FEATURE_MAKEDEVS_LEAF is not set
# CONFIG_MT is not set
# CONFIG_RUNLEVEL is not set
# CONFIG_TASKSET is not set
# CONFIG_FEATURE_TASKSET_FANCY is not set
# CONFIG_WALL is not set
# CONFIG_NC_110_COMPAT is not set
# CONFIG_ARPING is not set
# CONFIG_ETHER_WAKE is not set
# CONFIG_FEATURE_IFUPDOWN_IP is not set
# CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN is not set
# CONFIG_FEATURE_INETD_RPC is not set
# CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set
# CONFIG_FEATURE_PS_WIDE is not set
# CONFIG_FEATURE_PS_LONG is not set
# CONFIG_CHCON is not set
# CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set
# CONFIG_GETENFORCE is not set
# CONFIG_GETSEBOOL is not set
# CONFIG_LOAD_POLICY is not set
# CONFIG_MATCHPATHCON is not set
# CONFIG_RESTORECON is not set
# CONFIG_RUNCON is not set
# CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set
# CONFIG_SELINUXENABLED is not set
# CONFIG_SETENFORCE is not set
# CONFIG_SETFILES is not set
# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set
# CONFIG_SETSEBOOL is not set
# CONFIG_SESTATUS is not set
# CONFIG_ASH_IDLE_TIMEOUT is not set
# CONFIG_ASH_MAIL is not set
# CONFIG_FEATURE_SH_IS_HUSH is not set
# CONFIG_FEATURE_SH_IS_NONE is not set
# CONFIG_FEATURE_BASH_IS_HUSH is not set
# CONFIG_FEATURE_BASH_IS_NONE is not set
Code: Select all
bash-3.00# diff -up bb-config-ibidem bb-config-krg |grep -E '^\+|^\-'
--- bb-config-ibidem 2013-06-19 21:18:35.000000000 -0100
+++ bb-config-krg 2013-06-19 21:20:05.000000000 -0100
-# CONFIG_EXTRA_COMPAT is not set
-# CONFIG_INSTALL_NO_USR is not set
-# CONFIG_LOCALE_SUPPORT is not set
-# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set
-# CONFIG_UNICODE_BIDI_SUPPORT is not set
-# CONFIG_UNICODE_NEUTRAL_TABLE is not set
-# CONFIG_FEATURE_CLEAN_UP is not set
-# CONFIG_FEATURE_UTMP is not set
-# CONFIG_FEATURE_WTMP is not set
+# CONFIG_FEATURE_SUID_CONFIG_QUIET is not set
-# CONFIG_FEATURE_HAVE_RPC is not set
-# CONFIG_DEBUG is not set
-# CONFIG_DEBUG_PESSIMIZE is not set
-# CONFIG_FEATURE_SYSTEMD is not set
-# CONFIG_FEATURE_HWIB is not set
+# CONFIG_FEATURE_USERNAME_COMPLETION is not set
+# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set
+# CONFIG_FEATURE_SKIP_ROOTFS is not set
+# CONFIG_MONOTONIC_SYSCALL is not set
+# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set
-# CONFIG_WHO is not set
-# CONFIG_USERS is not set
-# CONFIG_FEATURE_VI_REGEX_SEARCH is not set
+# CONFIG_UNCOMPRESS is not set
+# CONFIG_LZMA is not set
+# CONFIG_XZ is not set
+# CONFIG_FEATURE_DATE_NANO is not set
+# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set
+# CONFIG_FEATURE_BLKID_TYPE is not set
+# CONFIG_FEATURE_DMESG_PRETTY is not set
+# CONFIG_FEATURE_SGI_LABEL is not set
+# CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS is not set
-# CONFIG_DEVFSD is not set
-# CONFIG_DEVFSD_MODLOAD is not set
-# CONFIG_DEVFSD_FG_NP is not set
-# CONFIG_DEVFSD_VERBOSE is not set
-# CONFIG_LAST is not set
+# CONFIG_FEATURE_VOLUMEID_SQUASHFS is not set
+# CONFIG_INOTIFYD is not set
-# CONFIG_FEATURE_LAST_FANCY is not set
-# CONFIG_FEATURE_MAKEDEVS_LEAF is not set
-# CONFIG_MT is not set
-# CONFIG_RUNLEVEL is not set
-# CONFIG_TASKSET is not set
-# CONFIG_FEATURE_TASKSET_FANCY is not set
-# CONFIG_WALL is not set
-# CONFIG_NC_110_COMPAT is not set
-# CONFIG_ARPING is not set
-# CONFIG_ETHER_WAKE is not set
-# CONFIG_FEATURE_IFUPDOWN_IP is not set
-# CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN is not set
-# CONFIG_FEATURE_INETD_RPC is not set
-# CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set
+# CONFIG_FEATURE_MAKEDEVS_TABLE is not set
+# CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN is not set
+# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set
+# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set
+# CONFIG_FEATURE_RUNSVDIR_LOG is not set
-# CONFIG_ASH_IDLE_TIMEOUT is not set
+# CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set
+# CONFIG_FEATURE_BASH_IS_ASH is not set
-# CONFIG_FEATURE_BASH_IS_NONE is not set
+# CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set
bash-3.00#
Use musl regex.h, but make sure you turn off vi regex support and CONFIG_EXTRA_COMPAT (these need glibc extensions). There is a reason that I disabled those.Karl Godt wrote:# pwd
/usr/musl/include
# find -type l
./rpc
./asm-generic
./asm
./regex.h
./sys/cdefs.h
./sched.h
./bits/wordsize.h
./bits/sockaddr.h
./bits/types.h
./bits/typesizes.h
./bits/sched.h
./sched.h-normal
./asm-x86
./mtd
./net/if_slip.h
./net/if_packet.h
./linux
#
Had some problems with musl . less compiled without options and inetd without rpc at the end .
But regex.h is problematic . Used the regular regex.h but final link failed . grep without -E is unusable for me :
findutils/lib.a(grep.o): In function `grep_file':
grep.c: (.text+0x24b): undefined reference to `re_compile_pattern'
Size without vi(also regex.h) and grep : 976KB .
But since no one will ever revive P-I 100MHz 64MB-Ram boards , probably 2MB static Busybox still is very nice and less troublesome than musl's 1MB at it's current state .
Did that, compiled fine .Use musl regex.h, but make sure you turn off vi regex support and CONFIG_EXTRA_COMPAT (these need glibc extensions). There is a reason that I disabled those.
Also disable anything RPC related.
Tar.bz2 with Binary(without Links) and .config inkluded :Also, be sure to use the branches specified! There are a couple small incompatibility issues in mainline musl/busybox at present.
Hello, Ibidem.Ibidem wrote:The REAL cal does not: http://pubs.opengroup.org/onlinepubs/96 ... s/cal.htmlmusher0 wrote: (see picture)
Maybe it depends on the locale parameters that you use?
Still, the real cal offers more choices...
You seem to have fallen for the GNU fallacy that "number of features" == "how good it is".
In reality, there are several factors in determining quality:
(1) Features
a-some features that everyone needs
b-some features that vastly improve things for many people
c-some features that are used once in a while
d-some features that are actively harmful
(2) How stable the implementation is
(3) size of the implementation
Busybox focuses on 2 & 3, implementing the features that are needed rather than "everything that everyone has ever done".
Additionally, Busybox is oriented towards following standards.
(..)
Code: Select all
bbconfig |grep '^#'
From busybox official homepage http://busybox.net/about.htmlmusher0 wrote:You can't pass a Coke for a Pepsi, and vice versa. I wish someone on this
forum would have told me the true nature of busybox: it would have
saved me days of research on the Internet for the more complete
utilities i needed -- as well as a feeling of having been duped.
(emphasis is mine). And it has been like that from day one. The reason why Puppy uses busybox is because of that small size. Puppy only uses the full GNU utilities when it is absolutely necessary. That's one of the reason why Puppy stays small when other distro grows by leaps and bounds.About Busybox wrote:BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides replacements for most of the utilities you usually find in GNU fileutils, shellutils, etc. The utilities in BusyBox generally have fewer options than their full-featured GNU cousins; however, the options that are included provide the expected functionality and behave very much like their GNU counterparts. BusyBox provides a fairly complete environment for any small or embedded system.
BusyBox has been written with size-optimization and limited resources in mind. It is also extremely modular so you can easily include or exclude commands (or features) at compile time. This makes it easy to customize your embedded systems. To create a working system, just add some device nodes in /dev, a few configuration files in /etc, and a Linux kernel.
Looking through your config, I see a few things I'm curious about...jamesbond wrote:
@Karl: My 64-bit static compile of busybox (using uclibc) is about 1.2MB with almost all applets enabled (except the runit tools). 64-bit compile is usually 20% larger than 32-bit compile. bbconfig attached.