From 5e1a84ab74d5e97582427f016f291a8c11e66f99 Mon Sep 17 00:00:00 2001 From: jutteau Date: Fri, 11 May 2007 18:10:19 +0000 Subject: Completion du script de mise à jour de la pc-104 : * Ajout des sources de busybox dans ./conf/busybox/ * Ajout d'un fichier réclamé par les script dans ./conf/busybox.links --- i/pc104/initrd/conf/busybox/include/applets.h | 341 ++ i/pc104/initrd/conf/busybox/include/busybox.h | 39 + i/pc104/initrd/conf/busybox/include/dump.h | 50 + i/pc104/initrd/conf/busybox/include/grp_.h | 133 + i/pc104/initrd/conf/busybox/include/inet_common.h | 25 + i/pc104/initrd/conf/busybox/include/libbb.h | 902 +++++ i/pc104/initrd/conf/busybox/include/platform.h | 311 ++ i/pc104/initrd/conf/busybox/include/pwd_.h | 122 + i/pc104/initrd/conf/busybox/include/shadow_.h | 114 + i/pc104/initrd/conf/busybox/include/unarchive.h | 118 + i/pc104/initrd/conf/busybox/include/usage.h | 3688 +++++++++++++++++++++ i/pc104/initrd/conf/busybox/include/xatonum.h | 157 + i/pc104/initrd/conf/busybox/include/xregex.h | 18 + 13 files changed, 6018 insertions(+) create mode 100644 i/pc104/initrd/conf/busybox/include/applets.h create mode 100644 i/pc104/initrd/conf/busybox/include/busybox.h create mode 100644 i/pc104/initrd/conf/busybox/include/dump.h create mode 100644 i/pc104/initrd/conf/busybox/include/grp_.h create mode 100644 i/pc104/initrd/conf/busybox/include/inet_common.h create mode 100644 i/pc104/initrd/conf/busybox/include/libbb.h create mode 100644 i/pc104/initrd/conf/busybox/include/platform.h create mode 100644 i/pc104/initrd/conf/busybox/include/pwd_.h create mode 100644 i/pc104/initrd/conf/busybox/include/shadow_.h create mode 100644 i/pc104/initrd/conf/busybox/include/unarchive.h create mode 100644 i/pc104/initrd/conf/busybox/include/usage.h create mode 100644 i/pc104/initrd/conf/busybox/include/xatonum.h create mode 100644 i/pc104/initrd/conf/busybox/include/xregex.h (limited to 'i/pc104/initrd/conf/busybox/include') diff --git a/i/pc104/initrd/conf/busybox/include/applets.h b/i/pc104/initrd/conf/busybox/include/applets.h new file mode 100644 index 0000000..3aaf011 --- /dev/null +++ b/i/pc104/initrd/conf/busybox/include/applets.h @@ -0,0 +1,341 @@ +/* vi: set sw=4 ts=4: */ +/* + * applets.h - a listing of all busybox applets. + * + * If you write a new applet, you need to add an entry to this list to make + * busybox aware of it. + * + * It is CRUCIAL that this listing be kept in ascii order, otherwise the binary + * search lookup contributed by Gaute B Strokkenes stops working. If you value + * your kneecaps, you'll be sure to *make sure* that any changes made to this + * file result in the listing remaining in ascii order. You have been warned. + */ + +#undef APPLET +#undef APPLET_ODDNAME +#undef APPLET_NOUSAGE + +#if defined(PROTOTYPES) +# define APPLET(a,b,c) extern int a##_main(int argc, char **argv); +# define APPLET_NOUSAGE(a,b,c,d) extern int b##_main(int argc, char **argv); +# define APPLET_ODDNAME(a,b,c,d,e) extern int b##_main(int argc, char **argv); +#elif defined(MAKE_USAGE) +# ifdef CONFIG_FEATURE_VERBOSE_USAGE +# define APPLET(a,b,c) a##_trivial_usage "\n\n" a##_full_usage "\0" +# define APPLET_NOUSAGE(a,b,c,d) "\b\0" +# define APPLET_ODDNAME(a,b,c,d,e) e##_trivial_usage "\n\n" e##_full_usage "\0" +# else +# define APPLET(a,b,c) a##_trivial_usage "\0" +# define APPLET_NOUSAGE(a,b,c,d) "\b\0" +# define APPLET_ODDNAME(a,b,c,d,e) e##_trivial_usage "\0" +# endif +#elif defined(MAKE_LINKS) +# define APPLET(a,b,c) LINK b a +# define APPLET_NOUSAGE(a,b,c,d) LINK c a +# define APPLET_ODDNAME(a,b,c,d,e) LINK c a +#else + const struct BB_applet applets[] = { +# define APPLET(a,b,c) {#a,a##_main,b,c}, +# define APPLET_NOUSAGE(a,b,c,d) {#a,b##_main,c,d}, +# define APPLET_ODDNAME(a,b,c,d,e) {#a,b##_main,c,d}, +#endif + +#ifdef CONFIG_INSTALL_NO_USR +# define _BB_DIR_USR_BIN _BB_DIR_BIN +# define _BB_DIR_USR_SBIN _BB_DIR_SBIN +#endif + +// _BB_SUID_ALWAYS: will complain if busybox isn't suid +// and is run by non-root (applet_main() will not be called at all) +// _BB_SUID_NEVER: will drop suid prior to applet_main() +// _BB_SUID_MAYBE: neither of the above + +USE_TEST(APPLET_NOUSAGE([, test, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_TEST(APPLET_NOUSAGE([[, test, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_ADDGROUP(APPLET(addgroup, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_ADDUSER(APPLET(adduser, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_ADJTIMEX(APPLET(adjtimex, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_AR(APPLET(ar, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_ARP(APPLET(arp, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_ARPING(APPLET(arping, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_ASH(APPLET_NOUSAGE(ash, ash, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_AWK(APPLET(awk, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_BASENAME(APPLET(basename, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_BBCONFIG(APPLET(bbconfig, _BB_DIR_BIN, _BB_SUID_NEVER)) +//USE_BBSH(APPLET(bbsh, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_BUNZIP2(APPLET(bunzip2, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_BUNZIP2(APPLET_ODDNAME(bzcat, bunzip2, _BB_DIR_USR_BIN, _BB_SUID_NEVER, bzcat)) +USE_CAL(APPLET(cal, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_CAT(APPLET(cat, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_CATV(APPLET(catv, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_CHATTR(APPLET(chattr, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_CHCON(APPLET(chcon, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_CHGRP(APPLET(chgrp, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_CHMOD(APPLET(chmod, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_CHOWN(APPLET(chown, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_CHPST(APPLET(chpst, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_CHROOT(APPLET(chroot, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) +USE_CHRT(APPLET(chrt, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_CHVT(APPLET(chvt, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_CKSUM(APPLET(cksum, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_CLEAR(APPLET(clear, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_CMP(APPLET(cmp, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_COMM(APPLET(comm, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_CP(APPLET(cp, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_CPIO(APPLET(cpio, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_CROND(APPLET(crond, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) +USE_CRONTAB(APPLET(crontab, _BB_DIR_USR_BIN, _BB_SUID_ALWAYS)) +USE_CUT(APPLET(cut, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_DATE(APPLET(date, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_DC(APPLET(dc, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_DD(APPLET(dd, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_DEALLOCVT(APPLET(deallocvt, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_DELGROUP(APPLET_ODDNAME(delgroup, deluser, _BB_DIR_BIN, _BB_SUID_NEVER, delgroup)) +USE_DELUSER(APPLET(deluser, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_DEVFSD(APPLET(devfsd, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_DF(APPLET(df, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_APP_DHCPRELAY(APPLET(dhcprelay, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) +USE_DIFF(APPLET(diff, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_DIRNAME(APPLET(dirname, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_DMESG(APPLET(dmesg, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_DNSD(APPLET(dnsd, _BB_DIR_USR_SBIN, _BB_SUID_ALWAYS)) +USE_DOS2UNIX(APPLET(dos2unix, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_DPKG(APPLET(dpkg, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_DPKG_DEB(APPLET_ODDNAME(dpkg-deb, dpkg_deb, _BB_DIR_USR_BIN, _BB_SUID_NEVER, dpkg_deb)) +USE_DU(APPLET(du, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_DUMPKMAP(APPLET(dumpkmap, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_APP_DUMPLEASES(APPLET(dumpleases, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +//USE_E2FSCK(APPLET(e2fsck, _BB_DIR_SBIN, _BB_SUID_NEVER)) +//USE_E2LABEL(APPLET_NOUSAGE(e2label, tune2fs, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_ECHO(APPLET(echo, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_ED(APPLET(ed, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_FEATURE_GREP_EGREP_ALIAS(APPLET_NOUSAGE(egrep, grep, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_EJECT(APPLET(eject, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_ENV(APPLET(env, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_ENVDIR(APPLET_ODDNAME(envdir, chpst, _BB_DIR_USR_BIN, _BB_SUID_NEVER, envdir)) +USE_ENVUIDGID(APPLET_ODDNAME(envuidgid, chpst, _BB_DIR_USR_BIN, _BB_SUID_NEVER, envuidgid)) +USE_ETHER_WAKE(APPLET_ODDNAME(ether-wake, ether_wake, _BB_DIR_USR_BIN, _BB_SUID_NEVER, ether_wake)) +USE_EXPR(APPLET(expr, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_FAKEIDENTD(APPLET(fakeidentd, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) +USE_FALSE(APPLET(false, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_FBSET(APPLET(fbset, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) +USE_FDFLUSH(APPLET_ODDNAME(fdflush, freeramdisk, _BB_DIR_BIN, _BB_SUID_NEVER, fdflush)) +USE_FDFORMAT(APPLET(fdformat, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_FDISK(APPLET(fdisk, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_FEATURE_GREP_FGREP_ALIAS(APPLET_NOUSAGE(fgrep, grep, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_FIND(APPLET(find, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +//USE_FINDFS(APPLET_NOUSAGE(findfs, tune2fs, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_FOLD(APPLET(fold, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_FREE(APPLET(free, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_FREERAMDISK(APPLET(freeramdisk, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_FSCK(APPLET(fsck, _BB_DIR_SBIN, _BB_SUID_NEVER)) +//USE_E2FSCK(APPLET_NOUSAGE(fsck.ext2, e2fsck, _BB_DIR_SBIN, _BB_SUID_NEVER)) +//USE_E2FSCK(APPLET_NOUSAGE(fsck.ext3, e2fsck, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_FSCK_MINIX(APPLET_ODDNAME(fsck.minix, fsck_minix, _BB_DIR_SBIN, _BB_SUID_NEVER, fsck_minix)) +USE_FTPGET(APPLET_ODDNAME(ftpget, ftpgetput, _BB_DIR_USR_BIN, _BB_SUID_NEVER,ftpget)) +USE_FTPPUT(APPLET_ODDNAME(ftpput, ftpgetput, _BB_DIR_USR_BIN, _BB_SUID_NEVER,ftpput)) +USE_FUSER(APPLET(fuser, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_GETENFORCE(APPLET(getenforce, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) +USE_GETOPT(APPLET(getopt, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_GETSEBOOL(APPLET(getsebool, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) +USE_GETTY(APPLET(getty, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_GREP(APPLET(grep, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_GUNZIP(APPLET(gunzip, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_GZIP(APPLET(gzip, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_HALT(APPLET(halt, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_HDPARM(APPLET(hdparm, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_HEAD(APPLET(head, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_HEXDUMP(APPLET(hexdump, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_HOSTID(APPLET(hostid, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_HOSTNAME(APPLET(hostname, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_HTTPD(APPLET(httpd, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) +USE_HUSH(APPLET_NOUSAGE(hush, hush, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_HWCLOCK(APPLET(hwclock, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_ID(APPLET(id, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_IFCONFIG(APPLET(ifconfig, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_IFUPDOWN(APPLET_ODDNAME(ifdown, ifupdown, _BB_DIR_SBIN, _BB_SUID_NEVER, ifdown)) +USE_IFUPDOWN(APPLET_ODDNAME(ifup, ifupdown, _BB_DIR_SBIN, _BB_SUID_NEVER, ifup)) +USE_INETD(APPLET(inetd, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) +USE_INIT(APPLET(init, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_INSMOD(APPLET(insmod, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_INSTALL(APPLET(install, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_IP(APPLET(ip, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_IPADDR(APPLET(ipaddr, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_IPCALC(APPLET(ipcalc, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_IPCRM(APPLET(ipcrm, _BB_DIR_USR_BIN, _BB_SUID_ALWAYS)) +USE_IPCS(APPLET(ipcs, _BB_DIR_USR_BIN, _BB_SUID_ALWAYS)) +USE_IPLINK(APPLET(iplink, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_IPROUTE(APPLET(iproute, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_IPRULE(APPLET(iprule, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_IPTUNNEL(APPLET(iptunnel, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_KILL(APPLET(kill, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_KILLALL(APPLET_ODDNAME(killall, kill, _BB_DIR_USR_BIN, _BB_SUID_NEVER, killall)) +USE_KILLALL5(APPLET_ODDNAME(killall5, kill, _BB_DIR_USR_BIN, _BB_SUID_NEVER, killall5)) +USE_KLOGD(APPLET(klogd, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_LASH(APPLET(lash, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_LAST(APPLET(last, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_LENGTH(APPLET(length, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_LESS(APPLET(less, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_SETARCH(APPLET_NOUSAGE(linux32, setarch, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_SETARCH(APPLET_NOUSAGE(linux64, setarch, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_FEATURE_INITRD(APPLET_NOUSAGE(linuxrc, init, _BB_DIR_ROOT, _BB_SUID_NEVER)) +USE_LN(APPLET(ln, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_LOADFONT(APPLET(loadfont, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_LOADKMAP(APPLET(loadkmap, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_LOGGER(APPLET(logger, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_LOGIN(APPLET(login, _BB_DIR_BIN, _BB_SUID_ALWAYS)) +USE_LOGNAME(APPLET(logname, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_LOGREAD(APPLET(logread, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_LOSETUP(APPLET(losetup, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_LS(APPLET(ls, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_LSATTR(APPLET(lsattr, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_LSMOD(APPLET(lsmod, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_UNLZMA(APPLET_ODDNAME(lzmacat, unlzma, _BB_DIR_USR_BIN, _BB_SUID_NEVER, lzmacat)) +USE_MATCHPATHCON(APPLET(matchpathcon, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) +USE_MAKEDEVS(APPLET(makedevs, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_MD5SUM(APPLET_ODDNAME(md5sum, md5_sha1_sum, _BB_DIR_USR_BIN, _BB_SUID_NEVER, md5sum)) +USE_MDEV(APPLET(mdev, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_MESG(APPLET(mesg, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_MKDIR(APPLET(mkdir, _BB_DIR_BIN, _BB_SUID_NEVER)) +//USE_MKE2FS(APPLET(mke2fs, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_MKFIFO(APPLET(mkfifo, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +//USE_MKE2FS(APPLET_NOUSAGE(mkfs.ext2, mke2fs, _BB_DIR_SBIN, _BB_SUID_NEVER)) +//USE_MKE2FS(APPLET_NOUSAGE(mkfs.ext3, mke2fs, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_MKFS_MINIX(APPLET_ODDNAME(mkfs.minix, mkfs_minix, _BB_DIR_SBIN, _BB_SUID_NEVER, mkfs_minix)) +USE_MKNOD(APPLET(mknod, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_MKSWAP(APPLET(mkswap, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_MKTEMP(APPLET(mktemp, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_MODPROBE(APPLET(modprobe, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_MORE(APPLET(more, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_MOUNT(APPLET(mount, _BB_DIR_BIN, USE_DESKTOP(_BB_SUID_MAYBE) SKIP_DESKTOP(_BB_SUID_NEVER))) +USE_MOUNTPOINT(APPLET(mountpoint, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_MSH(APPLET_NOUSAGE(msh, msh, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_MT(APPLET(mt, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_MV(APPLET(mv, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_NAMEIF(APPLET(nameif, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_NC(APPLET(nc, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_NETSTAT(APPLET(netstat, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_NICE(APPLET(nice, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_NMETER(APPLET(nmeter, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_NOHUP(APPLET(nohup, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_NSLOOKUP(APPLET(nslookup, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_OD(APPLET(od, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_OPENVT(APPLET(openvt, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_PASSWD(APPLET(passwd, _BB_DIR_USR_BIN, _BB_SUID_ALWAYS)) +USE_PATCH(APPLET(patch, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_PIDOF(APPLET(pidof, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_PING(APPLET(ping, _BB_DIR_BIN, _BB_SUID_MAYBE)) +USE_PING6(APPLET(ping6, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_PIPE_PROGRESS(APPLET_NOUSAGE(pipe_progress, pipe_progress, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_PIVOT_ROOT(APPLET(pivot_root, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_HALT(APPLET_ODDNAME(poweroff, halt, _BB_DIR_SBIN, _BB_SUID_NEVER, poweroff)) +USE_PRINTENV(APPLET(printenv, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_PRINTF(APPLET(printf, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_PS(APPLET(ps, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_PWD(APPLET(pwd, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_RAIDAUTORUN(APPLET(raidautorun, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_RDATE(APPLET(rdate, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) +USE_READAHEAD(APPLET(readahead, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_READLINK(APPLET(readlink, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_READPROFILE(APPLET(readprofile, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) +USE_REALPATH(APPLET(realpath, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_HALT(APPLET_ODDNAME(reboot, halt, _BB_DIR_SBIN, _BB_SUID_NEVER, reboot)) +USE_RENICE(APPLET(renice, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_RESET(APPLET(reset, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_RESIZE(APPLET(resize, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_RM(APPLET(rm, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_RMDIR(APPLET(rmdir, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_RMMOD(APPLET(rmmod, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_ROUTE(APPLET(route, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_RPM(APPLET(rpm, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_RPM2CPIO(APPLET(rpm2cpio, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_RUN_PARTS(APPLET_ODDNAME(run-parts, run_parts, _BB_DIR_BIN, _BB_SUID_NEVER, run_parts)) +USE_RUNCON(APPLET(runcon, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_RUNLEVEL(APPLET(runlevel, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_RUNSV(APPLET(runsv, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_RUNSVDIR(APPLET(runsvdir, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_RX(APPLET(rx, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_SELINUXENABLED(APPLET(selinuxenabled, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) +USE_SED(APPLET(sed, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_SEQ(APPLET(seq, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_SETARCH(APPLET(setarch, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_SETCONSOLE(APPLET(setconsole, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_SETENFORCE(APPLET(setenforce, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) +USE_SETKEYCODES(APPLET(setkeycodes, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_SETLOGCONS(APPLET(setlogcons, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) +USE_SETSID(APPLET(setsid, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_SETUIDGID(APPLET_ODDNAME(setuidgid, chpst, _BB_DIR_USR_BIN, _BB_SUID_NEVER, setuidgid)) +USE_FEATURE_SH_IS_ASH(APPLET_NOUSAGE(sh, ash, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_FEATURE_SH_IS_HUSH(APPLET_NOUSAGE(sh, hush, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_FEATURE_SH_IS_LASH(APPLET_NOUSAGE(sh, lash, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_FEATURE_SH_IS_MSH(APPLET_NOUSAGE(sh, msh, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_SHA1SUM(APPLET_ODDNAME(sha1sum, md5_sha1_sum, _BB_DIR_USR_BIN, _BB_SUID_NEVER, sha1sum)) +USE_SLEEP(APPLET(sleep, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_SOFTLIMIT(APPLET_ODDNAME(softlimit, chpst, _BB_DIR_USR_BIN, _BB_SUID_NEVER, softlimit)) +USE_SORT(APPLET(sort, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_START_STOP_DAEMON(APPLET_ODDNAME(start-stop-daemon, start_stop_daemon, _BB_DIR_SBIN, _BB_SUID_NEVER, start_stop_daemon)) +USE_STAT(APPLET(stat, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_STRINGS(APPLET(strings, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_STTY(APPLET(stty, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_SU(APPLET(su, _BB_DIR_BIN, _BB_SUID_ALWAYS)) +USE_SULOGIN(APPLET(sulogin, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_SUM(APPLET(sum, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_SV(APPLET(sv, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_SVLOGD(APPLET(svlogd, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_SWAPONOFF(APPLET_ODDNAME(swapoff, swap_on_off, _BB_DIR_SBIN, _BB_SUID_NEVER,swapoff)) +USE_SWAPONOFF(APPLET_ODDNAME(swapon, swap_on_off, _BB_DIR_SBIN, _BB_SUID_NEVER, swapon)) +USE_SWITCH_ROOT(APPLET(switch_root, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_SYNC(APPLET(sync, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_BB_SYSCTL(APPLET(sysctl, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_SYSLOGD(APPLET(syslogd, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_TAIL(APPLET(tail, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_TAR(APPLET(tar, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_TASKSET(APPLET(taskset, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_TEE(APPLET(tee, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_TELNET(APPLET(telnet, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_TELNETD(APPLET(telnetd, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) +USE_TEST(APPLET(test, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +#if ENABLE_FEATURE_TFTP_GET || ENABLE_FEATURE_TFTP_PUT +USE_TFTP(APPLET(tftp, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +#endif +USE_TIME(APPLET(time, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_TOP(APPLET(top, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_TOUCH(APPLET(touch, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_TR(APPLET(tr, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_TRACEROUTE(APPLET(traceroute, _BB_DIR_USR_BIN, _BB_SUID_MAYBE)) +USE_TRUE(APPLET(true, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_TTY(APPLET(tty, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +//USE_TUNE2FS(APPLET(tune2fs, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_APP_UDHCPC(APPLET(udhcpc, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_APP_UDHCPD(APPLET(udhcpd, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) +USE_UMOUNT(APPLET(umount, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_UNAME(APPLET(uname, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_UNCOMPRESS(APPLET(uncompress, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_UNIQ(APPLET(uniq, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_UNIX2DOS(APPLET_ODDNAME(unix2dos, dos2unix, _BB_DIR_USR_BIN, _BB_SUID_NEVER, unix2dos)) +USE_UNLZMA(APPLET(unlzma, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_UNZIP(APPLET(unzip, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_UPTIME(APPLET(uptime, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_USLEEP(APPLET(usleep, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_UUDECODE(APPLET(uudecode, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_UUENCODE(APPLET(uuencode, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_VCONFIG(APPLET(vconfig, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_VI(APPLET(vi, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_VLOCK(APPLET(vlock, _BB_DIR_USR_BIN, _BB_SUID_ALWAYS)) +USE_WATCH(APPLET(watch, _BB_DIR_BIN, _BB_SUID_NEVER)) +USE_WATCHDOG(APPLET(watchdog, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_WC(APPLET(wc, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_WGET(APPLET(wget, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_WHICH(APPLET(which, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_WHO(APPLET(who, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_WHOAMI(APPLET(whoami, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_XARGS(APPLET(xargs, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_YES(APPLET(yes, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_GUNZIP(APPLET_ODDNAME(zcat, gunzip, _BB_DIR_BIN, _BB_SUID_NEVER, zcat)) +USE_ZCIP(APPLET(zcip, _BB_DIR_SBIN, _BB_SUID_NEVER)) + +#if !defined(PROTOTYPES) && !defined(MAKE_USAGE) + { 0,NULL,0,0 } +}; + +#endif diff --git a/i/pc104/initrd/conf/busybox/include/busybox.h b/i/pc104/initrd/conf/busybox/include/busybox.h new file mode 100644 index 0000000..76ff7b7 --- /dev/null +++ b/i/pc104/initrd/conf/busybox/include/busybox.h @@ -0,0 +1,39 @@ +/* vi: set sw=4 ts=4: */ +/* + * Busybox main internal header file + * + * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. + */ +#ifndef _BB_INTERNAL_H_ +#define _BB_INTERNAL_H_ 1 + +#include "libbb.h" + +/* order matters: used as index into "install_dir[]" in busybox.c */ +enum Location { + _BB_DIR_ROOT = 0, + _BB_DIR_BIN, + _BB_DIR_SBIN, + _BB_DIR_USR_BIN, + _BB_DIR_USR_SBIN +}; + +enum SUIDRoot { + _BB_SUID_NEVER = 0, + _BB_SUID_MAYBE, + _BB_SUID_ALWAYS +}; + +struct BB_applet { + const char *name; + int (*main) (int argc, char **argv); + __extension__ enum Location location:4; + __extension__ enum SUIDRoot need_suid:4; +}; + +/* Defined in busybox.c and applet.c */ +extern int busybox_main(int argc, char **argv); +extern const struct BB_applet applets[]; +extern const unsigned short NUM_APPLETS; + +#endif /* _BB_INTERNAL_H_ */ diff --git a/i/pc104/initrd/conf/busybox/include/dump.h b/i/pc104/initrd/conf/busybox/include/dump.h new file mode 100644 index 0000000..7e17154 --- /dev/null +++ b/i/pc104/initrd/conf/busybox/include/dump.h @@ -0,0 +1,50 @@ +/* vi: set sw=4 ts=4: */ +#define F_IGNORE 0x01 /* %_A */ +#define F_SETREP 0x02 /* rep count set, not default */ +#define F_ADDRESS 0x001 /* print offset */ +#define F_BPAD 0x002 /* blank pad */ +#define F_C 0x004 /* %_c */ +#define F_CHAR 0x008 /* %c */ +#define F_DBL 0x010 /* %[EefGf] */ +#define F_INT 0x020 /* %[di] */ +#define F_P 0x040 /* %_p */ +#define F_STR 0x080 /* %s */ +#define F_U 0x100 /* %_u */ +#define F_UINT 0x200 /* %[ouXx] */ +#define F_TEXT 0x400 /* no conversions */ + +enum _vflag { ALL, DUP, FIRST, WAIT }; /* -v values */ + +typedef struct _pr { + struct _pr *nextpr; /* next print unit */ + unsigned int flags; /* flag values */ + int bcnt; /* byte count */ + char *cchar; /* conversion character */ + char *fmt; /* printf format */ + char *nospace; /* no whitespace version */ +} PR; + +typedef struct _fu { + struct _fu *nextfu; /* next format unit */ + struct _pr *nextpr; /* next print unit */ + unsigned int flags; /* flag values */ + int reps; /* repetition count */ + int bcnt; /* byte count */ + char *fmt; /* format string */ +} FU; + +typedef struct _fs { /* format strings */ + struct _fs *nextfs; /* linked list of format strings */ + struct _fu *nextfu; /* linked list of format units */ + int bcnt; +} FS; + +extern void bb_dump_add(const char *fmt); +extern int bb_dump_dump(char **argv); +extern int bb_dump_size(FS * fs); + +extern FS *bb_dump_fshead; /* head of format strings */ +extern int bb_dump_blocksize; /* data block size */ +extern int bb_dump_length; /* max bytes to read */ +extern enum _vflag bb_dump_vflag; +extern off_t bb_dump_skip; /* bytes to skip */ diff --git a/i/pc104/initrd/conf/busybox/include/grp_.h b/i/pc104/initrd/conf/busybox/include/grp_.h new file mode 100644 index 0000000..061b86e --- /dev/null +++ b/i/pc104/initrd/conf/busybox/include/grp_.h @@ -0,0 +1,133 @@ +/* vi: set sw=4 ts=4: */ +/* Copyright (C) 1991,92,95,96,97,98,99,2000,01 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +/* + * POSIX Standard: 9.2.1 Group Database Access + */ + +#if !ENABLE_USE_BB_PWD_GRP + +#include + +#else + +#ifndef _GRP_H +#define _GRP_H 1 + +/* The group structure. */ +struct group { + char *gr_name; /* Group name. */ + char *gr_passwd; /* Password. */ + gid_t gr_gid; /* Group ID. */ + char **gr_mem; /* Member list. */ +}; + +/* We don't reimplement this, just supplying prototype */ +/* The function itself is in libc */ +/* Set the group set for the current user to GROUPS (N of them). */ +extern int setgroups(size_t __n, __const gid_t *__groups); + + +#define setgrent bb_internal_setgrent +#define endgrent bb_internal_endgrent +#define getgrent bb_internal_getgrent +#define fgetgrent bb_internal_fgetgrent +#define putgrent bb_internal_putgrent +#define getgrgid bb_internal_getgrgid +#define getgrnam bb_internal_getgrnam +#define getgrent_r bb_internal_getgrent_r +#define getgrgid_r bb_internal_getgrgid_r +#define getgrnam_r bb_internal_getgrnam_r +#define fgetgrent_r bb_internal_fgetgrent_r +#define getgrouplist bb_internal_getgrouplist +#define initgroups bb_internal_initgroups + + +/* All function names below should be remapped by #defines above + * in order to not collide with libc names. + * In theory it isn't necessary, but I saw weird interactions at link time. + * Let's play safe */ + + +/* Rewind the group-file stream. */ +extern void setgrent(void); + +/* Close the group-file stream. */ +extern void endgrent(void); + +/* Read an entry from the group-file stream, opening it if necessary. */ +extern struct group *getgrent(void); + +/* Read a group entry from STREAM. */ +extern struct group *fgetgrent(FILE *__stream); + +/* Write the given entry onto the given stream. */ +extern int putgrent(__const struct group *__restrict __p, + FILE *__restrict __f); + +/* Search for an entry with a matching group ID. */ +extern struct group *getgrgid(gid_t __gid); + +/* Search for an entry with a matching group name. */ +extern struct group *getgrnam(__const char *__name); + +/* Reentrant versions of some of the functions above. + + PLEASE NOTE: the `getgrent_r' function is not (yet) standardized. + The interface may change in later versions of this library. But + the interface is designed following the principals used for the + other reentrant functions so the chances are good this is what the + POSIX people would choose. */ + +extern int getgrent_r(struct group *__restrict __resultbuf, + char *__restrict __buffer, size_t __buflen, + struct group **__restrict __result); + +/* Search for an entry with a matching group ID. */ +extern int getgrgid_r(gid_t __gid, struct group *__restrict __resultbuf, + char *__restrict __buffer, size_t __buflen, + struct group **__restrict __result); + +/* Search for an entry with a matching group name. */ +extern int getgrnam_r(__const char *__restrict __name, + struct group *__restrict __resultbuf, + char *__restrict __buffer, size_t __buflen, + struct group **__restrict __result); + +/* Read a group entry from STREAM. This function is not standardized + an probably never will. */ +extern int fgetgrent_r(FILE *__restrict __stream, + struct group *__restrict __resultbuf, + char *__restrict __buffer, size_t __buflen, + struct group **__restrict __result); + +/* Store at most *NGROUPS members of the group set for USER into + *GROUPS. Also include GROUP. The actual number of groups found is + returned in *NGROUPS. Return -1 if the if *NGROUPS is too small. */ +extern int getgrouplist(__const char *__user, gid_t __group, + gid_t *__groups, int *__ngroups); + +/* Initialize the group set for the current user + by reading the group database and using all groups + of which USER is a member. Also include GROUP. */ +extern int initgroups(__const char *__user, gid_t __group); + + +#endif /* grp.h */ +#endif diff --git a/i/pc104/initrd/conf/busybox/include/inet_common.h b/i/pc104/initrd/conf/busybox/include/inet_common.h new file mode 100644 index 0000000..bda6211 --- /dev/null +++ b/i/pc104/initrd/conf/busybox/include/inet_common.h @@ -0,0 +1,25 @@ +/* vi: set sw=4 ts=4: */ +/* + * stolen from net-tools-1.59 and stripped down for busybox by + * Erik Andersen + * + * Heavily modified by Manuel Novoa III Mar 12, 2001 + * + */ + +#include "platform.h" + +/* hostfirst!=0 If we expect this to be a hostname, + try hostname database first + */ +extern int INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirst); + +/* numeric: & 0x8000: "default" instead of "*", + * & 0x4000: host instead of net, + * & 0x0fff: don't resolve + */ +extern int INET_rresolve(char *name, size_t len, struct sockaddr_in *s_in, + int numeric, unsigned int netmask); + +extern int INET6_resolve(const char *name, struct sockaddr_in6 *sin6); +extern int INET6_rresolve(char *name, size_t len, struct sockaddr_in6 *sin6, int numeric); diff --git a/i/pc104/initrd/conf/busybox/include/libbb.h b/i/pc104/initrd/conf/busybox/include/libbb.h new file mode 100644 index 0000000..659bfca --- /dev/null +++ b/i/pc104/initrd/conf/busybox/include/libbb.h @@ -0,0 +1,902 @@ +/* vi: set sw=4 ts=4: */ +/* + * Busybox main internal header file + * + * Based in part on code from sash, Copyright (c) 1999 by David I. Bell + * Permission has been granted to redistribute this code under the GPL. + * + * Licensed under the GPL version 2, see the file LICENSE in this tarball. + */ +#ifndef __LIBBUSYBOX_H__ +#define __LIBBUSYBOX_H__ 1 + +#include "platform.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if ENABLE_SELINUX +#include +#include +#endif + +#if ENABLE_LOCALE_SUPPORT +#include +#else +#define setlocale(x,y) ((void)0) +#endif + +#include "pwd_.h" +#include "grp_.h" +/* ifdef it out, because it may include */ +/* and we may not even _have_ ! */ +#if ENABLE_FEATURE_SHADOWPASSWDS +#include "shadow_.h" +#endif + +/* Try to pull in PATH_MAX */ +#include +#include +#ifndef PATH_MAX +#define PATH_MAX 256 +#endif + +/* Tested to work correctly (IIRC :]) */ +#define MAXINT(T) (T)( \ + ((T)-1) > 0 \ + ? (T)-1 \ + : (T)~((T)1 << (sizeof(T)*8-1)) \ + ) + +#define MININT(T) (T)( \ + ((T)-1) > 0 \ + ? (T)0 \ + : ((T)1 << (sizeof(T)*8-1)) \ + ) + +/* Large file support */ +/* Note that CONFIG_LFS forces bbox to be built with all common ops + * (stat, lseek etc) mapped to "largefile" variants by libc. + * Practically it means that open() automatically has O_LARGEFILE added + * and all filesize/file_offset parameters and struct members are "large" + * (in today's world - signed 64bit). For full support of large files, + * we need a few helper #defines (below) and careful use of off_t + * instead of int/ssize_t. No lseek64(), O_LARGEFILE etc necessary */ +#if ENABLE_LFS +/* CONFIG_LFS is on */ +# if ULONG_MAX > 0xffffffff +/* "long" is long enough on this system */ +# define XATOOFF(a) xatoul_range(a, 0, LONG_MAX) +/* usage: sz = BB_STRTOOFF(s, NULL, 10); if (errno || sz < 0) die(); */ +# define BB_STRTOOFF bb_strtoul +# define STRTOOFF strtoul +/* usage: printf("size: %"OFF_FMT"d (%"OFF_FMT"x)\n", sz, sz); */ +# define OFF_FMT "l" +# else +/* "long" is too short, need "long long" */ +# define XATOOFF(a) xatoull_range(a, 0, LLONG_MAX) +# define BB_STRTOOFF bb_strtoull +# define STRTOOFF strtoull +# define OFF_FMT "ll" +# endif +#else +/* CONFIG_LFS is off */ +# if UINT_MAX == 0xffffffff +/* While sizeof(off_t) == sizeof(int), off_t is typedef'ed to long anyway. + * gcc will throw warnings on printf("%d", off_t). Crap... */ +# define XATOOFF(a) xatoi_u(a) +# define BB_STRTOOFF bb_strtou +# define STRTOOFF strtol +# define OFF_FMT "l" +# else +# define XATOOFF(a) xatoul_range(a, 0, LONG_MAX) +# define BB_STRTOOFF bb_strtoul +# define STRTOOFF strtol +# define OFF_FMT "l" +# endif +#endif +/* scary. better ideas? (but do *test* them first!) */ +#define OFF_T_MAX ((off_t)~((off_t)1 << (sizeof(off_t)*8-1))) + +/* This structure defines protocol families and their handlers. */ +struct aftype { + const char *name; + const char *title; + int af; + int alen; + char *(*print) (unsigned char *); + const char *(*sprint) (struct sockaddr *, int numeric); + int (*input) (/*int type,*/ const char *bufp, struct sockaddr *); + void (*herror) (char *text); + int (*rprint) (int options); + int (*rinput) (int typ, int ext, char **argv); + + /* may modify src */ + int (*getmask) (char *src, struct sockaddr * mask, char *name); +}; + +/* This structure defines hardware protocols and their handlers. */ +struct hwtype { + const char *name; + const char *title; + int type; + int alen; + char *(*print) (unsigned char *); + int (*input) (const char *, struct sockaddr *); + int (*activate) (int fd); + int suppress_null_addr; +}; + +/* Some useful definitions */ +#undef FALSE +#define FALSE ((int) 0) +#undef TRUE +#define TRUE ((int) 1) +#undef SKIP +#define SKIP ((int) 2) + +/* for mtab.c */ +#define MTAB_GETMOUNTPT '1' +#define MTAB_GETDEVICE '2' + +#define BUF_SIZE 8192 +#define EXPAND_ALLOC 1024 + +/* Macros for min/max. */ +#ifndef MIN +#define MIN(a,b) (((a)<(b))?(a):(b)) +#endif + +#ifndef MAX +#define MAX(a,b) (((a)>(b))?(a):(b)) +#endif + +/* buffer allocation schemes */ +#if ENABLE_FEATURE_BUFFERS_GO_ON_STACK +#define RESERVE_CONFIG_BUFFER(buffer,len) char buffer[len] +#define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char buffer[len] +#define RELEASE_CONFIG_BUFFER(buffer) ((void)0) +#else +#if ENABLE_FEATURE_BUFFERS_GO_IN_BSS +#define RESERVE_CONFIG_BUFFER(buffer,len) static char buffer[len] +#define RESERVE_CONFIG_UBUFFER(buffer,len) static unsigned char buffer[len] +#define RELEASE_CONFIG_BUFFER(buffer) ((void)0) +#else +#define RESERVE_CONFIG_BUFFER(buffer,len) char *buffer=xmalloc(len) +#define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len) +#define RELEASE_CONFIG_BUFFER(buffer) free (buffer) +#endif +#endif + + +#if defined(__GLIBC__) && __GLIBC__ < 2 +int vdprintf(int d, const char *format, va_list ap); +#endif +// This is declared here rather than #including in order to avoid +// confusing the two versions of basename. See the dirname/basename man page +// for details. +char *dirname(char *path); +/* Include our own copy of struct sysinfo to avoid binary compatibility + * problems with Linux 2.4, which changed things. Grumble, grumble. */ +struct sysinfo { + long uptime; /* Seconds since boot */ + unsigned long loads[3]; /* 1, 5, and 15 minute load averages */ + unsigned long totalram; /* Total usable main memory size */ + unsigned long freeram; /* Available memory size */ + unsigned long sharedram; /* Amount of shared memory */ + unsigned long bufferram; /* Memory used by buffers */ + unsigned long totalswap; /* Total swap space size */ + unsigned long freeswap; /* swap space still available */ + unsigned short procs; /* Number of current processes */ + unsigned short pad; /* Padding needed for m68k */ + unsigned long totalhigh; /* Total high memory size */ + unsigned long freehigh; /* Available high memory size */ + unsigned int mem_unit; /* Memory unit size in bytes */ + char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */ +}; +extern int sysinfo(struct sysinfo* info); + + +extern void chomp(char *s); +extern void trim(char *s); +extern char *skip_whitespace(const char *); +extern char *skip_non_whitespace(const char *); + +//TODO: supply a pointer to char[11] buffer (avoid statics)? +extern const char *bb_mode_string(mode_t mode); +extern int is_directory(const char *name, int followLinks, struct stat *statBuf); +extern int remove_file(const char *path, int flags); +extern int copy_file(const char *source, const char *dest, int flags); +extern int recursive_action(const char *fileName, int recurse, + int followLinks, int depthFirst, + int (*fileAction) (const char *fileName, struct stat* statbuf, void* userData, int depth), + int (*dirAction) (const char *fileName, struct stat* statbuf, void* userData, int depth), + void* userData, int depth); +extern int device_open(const char *device, int mode); +extern int get_console_fd(void); +extern char *find_block_device(const char *path); +/* bb_copyfd_XX print read/write errors and return -1 if they occur */ +extern off_t bb_copyfd_eof(int fd1, int fd2); +extern off_t bb_copyfd_size(int fd1, int fd2, off_t size); +extern void bb_copyfd_exact_size(int fd1, int fd2, off_t size); +/* "short" copy can be detected by return value < size */ +/* this helper yells "short read!" if param is not -1 */ +extern void complain_copyfd_and_die(off_t sz) ATTRIBUTE_NORETURN; +extern char bb_process_escape_sequence(const char **ptr); +/* TODO: sometimes modifies its parameter, which + * makes it rather inconvenient at times: */ +extern char *bb_get_last_path_component(char *path); +extern int ndelay_on(int fd); +extern int ndelay_off(int fd); + + +extern DIR *xopendir(const char *path); +extern DIR *warn_opendir(const char *path); + +char *xrealloc_getcwd_or_warn(char *cwd); +char *xmalloc_readlink_or_warn(const char *path); +char *xmalloc_realpath(const char *path); +extern void xstat(const char *filename, struct stat *buf); +extern pid_t spawn(char **argv); +extern pid_t xspawn(char **argv); +extern int wait4pid(int pid); +extern void xsetgid(gid_t gid); +extern void xsetuid(uid_t uid); +extern void xdaemon(int nochdir, int noclose); +/* More clever/thorough xdaemon */ +extern void bb_sanitize_stdio_maybe_daemonize(int daemonize); +extern void bb_sanitize_stdio(void); +/* NB: be careful: dont open syslog/network sockets before bb_daemonize */ +extern void bb_daemonize(void); +extern void xchdir(const char *path); +extern void xsetenv(const char *key, const char *value); +extern int xopen(const char *pathname, int flags); +extern int xopen3(const char *pathname, int flags, int mode); +extern off_t xlseek(int fd, off_t offset, int whence); +extern off_t fdlength(int fd); + + +int xsocket(int domain, int type, int protocol); +void xbind(int sockfd, struct sockaddr *my_addr, socklen_t addrlen); +void xlisten(int s, int backlog); +void xconnect(int s, const struct sockaddr *s_addr, socklen_t addrlen); +int setsockopt_reuseaddr(int fd); +int setsockopt_broadcast(int fd); +/* NB: returns port in host byte order */ +unsigned bb_lookup_port(const char *port, const char *protocol, unsigned default_port); +typedef struct len_and_sockaddr { + socklen_t len; + union { + struct sockaddr sa; + struct sockaddr_in sin; +#if ENABLE_FEATURE_IPV6 + struct sockaddr_in6 sin6; +#endif + }; +} len_and_sockaddr; +/* Create stream socket, and allocated suitable lsa + * (lsa of correct size and lsa->sa.sa_family (AF_INET/AF_INET6)) */ +int xsocket_stream(len_and_sockaddr **lsap); +/* Create server TCP socket bound to bindaddr:port. bindaddr can be NULL, + * numeric IP ("N.N.N.N") or numeric IPv6 address, + * and can have ":PORT" suffix (for IPv6 use "[X:X:...:X]:PORT"). + * If there is no suffix, port argument is used */ +int create_and_bind_stream_or_die(const char *bindaddr, int port); +/* Create client TCP socket connected to peer:port. Peer cannot be NULL. + * Peer can be numeric IP ("N.N.N.N"), numeric IPv6 address or hostname, + * and can have ":PORT" suffix (for IPv6 use "[X:X:...:X]:PORT"). + * If there is no suffix, port argument is used */ +int create_and_connect_stream_or_die(const char *peer, int port); +/* Connect to peer identified by lsa */ +int xconnect_stream(const len_and_sockaddr *lsa); +/* Return malloc'ed len_and_sockaddr with socket address of host:port + * Currently will return IPv4 or IPv6 sockaddrs only + * (depending on host), but in theory nothing prevents e.g. + * UNIX socket address being returned, IPX sockaddr etc... + * On error does bb_error_msg and returns NULL */ +len_and_sockaddr* host2sockaddr(const char *host, int port); +/* Version which dies on error */ +len_and_sockaddr* xhost2sockaddr(const char *host, int port); +len_and_sockaddr* xdotted2sockaddr(const char *host, int port); +#if ENABLE_FEATURE_IPV6 +/* Same, useful if you want to force family (e.g. IPv6) */ +len_and_sockaddr* host_and_af2sockaddr(const char *host, int port, sa_family_t af); +len_and_sockaddr* xhost_and_af2sockaddr(const char *host, int port, sa_family_t af); +#else +/* [we evaluate af: think about "host_and_af2sockaddr(..., af++)"] */ +#define host_and_af2sockaddr(host, port, af) ((void)(af), host2sockaddr((host), (port))) +#define xhost_and_af2sockaddr(host, port, af) ((void)(af), xhost2sockaddr((host), (port))) +#endif +/* Assign sin[6]_port member if the socket is of corresponding type, + * otherwise no-op. Useful for ftp. + * NB: does NOT do htons() internally, just direct assignment. */ +void set_nport(len_and_sockaddr *lsa, unsigned port); +/* Retrieve sin[6]_port or return -1 for non-INET[6] lsa's */ +int get_nport(const len_and_sockaddr *lsa); +/* Reverse DNS. Returns NULL on failure. */ +char* xmalloc_sockaddr2host(const struct sockaddr *sa, socklen_t salen); +/* This one doesn't append :PORTNUM */ +char* xmalloc_sockaddr2host_noport(const struct sockaddr *sa, socklen_t salen); +/* This one also doesn't fall back to dotted IP (returns NULL) */ +char* xmalloc_sockaddr2hostonly_noport(const struct sockaddr *sa, socklen_t salen); +/* inet_[ap]ton on steroids */ +char* xmalloc_sockaddr2dotted(const struct sockaddr *sa, socklen_t salen); +char* xmalloc_sockaddr2dotted_noport(const struct sockaddr *sa, socklen_t salen); +// "old" (ipv4 only) API +// users: traceroute.c hostname.c +struct hostent *xgethostbyname(const char *name); +// Also inetd.c and inetd.c are using gethostbyname(), +// + inet_common.c has additional IPv4-only stuff + + +extern char *xstrdup(const char *s); +extern char *xstrndup(const char *s, int n); +extern char *safe_strncpy(char *dst, const char *src, size_t size); +extern char *xasprintf(const char *format, ...) __attribute__ ((format (printf, 1, 2))); +// gcc-4.1.1 still isn't good enough at optimizing it +// (+200 bytes compared to macro) +//static ATTRIBUTE_ALWAYS_INLINE +//int LONE_DASH(const char *s) { return s[0] == '-' && !s[1]; } +//static ATTRIBUTE_ALWAYS_INLINE +//int NOT_LONE_DASH(const char *s) { return s[0] != '-' || s[1]; } +#define LONE_DASH(s) ((s)[0] == '-' && !(s)[1]) +#define NOT_LONE_DASH(s) ((s)[0] != '-' || (s)[1]) +#define LONE_CHAR(s,c) ((s)[0] == (c) && !(s)[1]) +#define NOT_LONE_CHAR(s,c) ((s)[0] != (c) || (s)[1]) + +/* dmalloc will redefine these to it's own implementation. It is safe + * to have the prototypes here unconditionally. */ +extern void *xmalloc(size_t size); +extern void *xrealloc(void *old, size_t size); +extern void *xzalloc(size_t size); + +extern ssize_t safe_read(int fd, void *buf, size_t count); +extern ssize_t full_read(int fd, void *buf, size_t count); +extern void xread(int fd, void *buf, size_t count); +extern unsigned char xread_char(int fd); +extern char *reads(int fd, char *buf, size_t count); +extern ssize_t read_close(int fd, void *buf, size_t count); +extern ssize_t open_read_close(const char *filename, void *buf, size_t count); +extern void *xmalloc_open_read_close(const char *filename, size_t *sizep); + +extern ssize_t safe_write(int fd, const void *buf, size_t count); +extern ssize_t full_write(int fd, const void *buf, size_t count); +extern void xwrite(int fd, const void *buf, size_t count); + +/* Reads and prints to stdout till eof, then closes FILE. Exits on error: */ +extern void xprint_and_close_file(FILE *file); +extern char *xmalloc_fgets(FILE *file); +/* Read up to (and including) TERMINATING_STRING: */ +extern char *xmalloc_fgets_str(FILE *file, const char *terminating_string); +/* Chops off '\n' from the end, unlike fgets: */ +extern char *xmalloc_getline(FILE *file); +extern char *bb_get_chunk_from_file(FILE *file, int *end); +extern void die_if_ferror(FILE *file, const char *msg); +extern void die_if_ferror_stdout(void); +extern void xfflush_stdout(void); +extern void fflush_stdout_and_exit(int retval) ATTRIBUTE_NORETURN; +extern int fclose_if_not_stdin(FILE *file); +extern FILE *xfopen(const char *filename, const char *mode); +/* Prints warning to stderr and returns NULL on failure: */ +extern FILE *fopen_or_warn(const char *filename, const char *mode); +/* "Opens" stdin if filename is special, else just opens file: */ +extern FILE *fopen_or_warn_stdin(const char *filename); + + +extern void utoa_to_buf(unsigned n, char *buf, unsigned buflen); +extern char *utoa(unsigned n); +extern void itoa_to_buf(int n, char *buf, unsigned buflen); +extern char *itoa(int n); +extern void smart_ulltoa5(unsigned long long ul, char buf[5]); +/* Put a string of hex bytes (ala "1b"), return advanced pointer */ +extern char *bin2hex(char *buf, const char *cp, int count); + +struct suffix_mult { + const char *suffix; + unsigned mult; +}; +#include "xatonum.h" +/* Specialized: */ +/* Using xatoi() instead of naive atoi() is not always convenient - + * in many places people want *non-negative* values, but store them + * in signed int. Therefore we need this one: + * dies if input is not in [0, INT_MAX] range. Also will reject '-0' etc */ +int xatoi_u(const char *numstr); +/* Useful for reading port numbers */ +uint16_t xatou16(const char *numstr); + + +/* These parse entries in /etc/passwd and /etc/group. This is desirable + * for BusyBox since we want to avoid using the glibc NSS stuff, which + * increases target size and is often not needed on embedded systems. */ +long xuname2uid(const char *name); +long xgroup2gid(const char *name); +/* wrapper: allows string to contain numeric uid or gid */ +unsigned long get_ug_id(const char *s, long (*xname2id)(const char *)); +/* from chpst. Does not die, returns 0 on failure */ +struct bb_uidgid_t { + uid_t uid; + gid_t gid; +}; +/* always sets uid and gid */ +int get_uidgid(struct bb_uidgid_t*, const char*, int numeric_ok); +/* chown-like handling of "user[:[group]" */ +void parse_chown_usergroup_or_die(struct bb_uidgid_t *u, char *user_group); +/* what is this? */ +/*extern char *bb_getug(char *buffer, char *idname, long id, int bufsize, char prefix);*/ +char *bb_getpwuid(char *name, long uid, int bufsize); +char *bb_getgrgid(char *group, long gid, int bufsize); +/* versions which cache results (useful for ps, ls etc) */ +const char* get_cached_username(uid_t uid); +const char* get_cached_groupname(gid_t gid); +void clear_username_cache(void); +/* internally usernames are saved in fixed-sized char[] buffers */ +enum { USERNAME_MAX_SIZE = 16 - sizeof(int) }; + + +enum { BB_GETOPT_ERROR = 0x80000000 }; +extern const char *opt_complementary; +#if ENABLE_GETOPT_LONG +extern const struct option *applet_long_options; +#endif +extern uint32_t option_mask32; +extern uint32_t getopt32(int argc, char **argv, const char *applet_opts, ...); + + +typedef struct llist_s { + char *data; + struct llist_s *link; +} llist_t; +extern void llist_add_to(llist_t **old_head, void *data); +extern void llist_add_to_end(llist_t **list_head, void *data); +extern void *llist_pop(llist_t **elm); +extern void llist_unlink(llist_t **head, llist_t *elm); +extern void llist_free(llist_t *elm, void (*freeit)(void *data)); +extern llist_t* llist_rev(llist_t *list); + +enum { + LOGMODE_NONE = 0, + LOGMODE_STDIO = 1<<0, + LOGMODE_SYSLOG = 1<<1, + LOGMODE_BOTH = LOGMODE_SYSLOG + LOGMODE_STDIO, +}; +extern const char *msg_eol; +extern int logmode; +extern int die_sleep; +extern int xfunc_error_retval; +extern void sleep_and_die(void) ATTRIBUTE_NORETURN; +extern void bb_show_usage(void) ATTRIBUTE_NORETURN ATTRIBUTE_EXTERNALLY_VISIBLE; +extern void bb_error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); +extern void bb_error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))); +extern void bb_perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); +extern void bb_perror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))); +extern void bb_vherror_msg(const char *s, va_list p); +extern void bb_herror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); +extern void bb_herror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))); +extern void bb_perror_nomsg_and_die(void) ATTRIBUTE_NORETURN; +extern void bb_perror_nomsg(void); +extern void bb_info_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); +/* These are used internally -- you shouldn't need to use them */ +extern void bb_verror_msg(const char *s, va_list p, const char *strerr); +extern void bb_vperror_msg(const char *s, va_list p); +extern void bb_vinfo_msg(const char *s, va_list p); + + +/* applets which are useful from another applets */ +int bb_cat(char** argv); +int bb_echo(char** argv); +int bb_test(int argc, char** argv); +#if ENABLE_ROUTE +void bb_displayroutes(int noresolve, int netstatfmt); +#endif +int chown_main(int argc, char **argv); +#if ENABLE_GUNZIP +int gunzip_main(int argc, char **argv); +#endif +int bbunpack(char **argv, + char* (*make_new_name)(char *filename), + USE_DESKTOP(long long) int (*unpacker)(void) +); + + +/* Networking */ +int create_icmp_socket(void); +int create_icmp6_socket(void); +/* interface.c */ +extern int interface_opt_a; +int display_interfaces(char *ifname); +const struct aftype *get_aftype(const char *name); +const struct hwtype *get_hwtype(const char *name); +const struct hwtype *get_hwntype(int type); + + +#ifndef BUILD_INDIVIDUAL +extern struct BB_applet *find_applet_by_name(const char *name); +extern void run_applet_by_name(const char *name, int argc, char **argv); +#endif + +extern struct mntent *find_mount_point(const char *name, const char *table); +extern void erase_mtab(const char * name); +extern unsigned int tty_baud_to_value(speed_t speed); +extern speed_t tty_value_to_baud(unsigned int value); +extern void bb_warn_ignoring_args(int n); + +extern int get_linux_version_code(void); + +extern char *query_loop(const char *device); +extern int del_loop(const char *device); +extern int set_loop(char **device, const char *file, unsigned long long offset); + + +//TODO: provide pointer to buf (avoid statics)? +const char *make_human_readable_str(unsigned long long size, + unsigned long block_size, unsigned long display_unit); + +//TODO: pass buf pointer or return allocated buf (avoid statics)? +char *bb_askpass(int timeout, const char * prompt); +int bb_ask_confirmation(void); +int klogctl(int type, char * b, int len); + +extern int bb_parse_mode(const char* s, mode_t* theMode); + +char *concat_path_file(const char *path, const char *filename); +char *concat_subpath_file(const char *path, const char *filename); +char *last_char_is(const char *s, int c); + +int execable_file(const char *name); +char *find_execable(const char *filename); +int exists_execable(const char *filename); + +#if ENABLE_FEATURE_EXEC_PREFER_APPLETS +int bb_execvp(const char *file, char *const argv[]); +#define BB_EXECVP(prog,cmd) bb_execvp(prog,cmd) +#define BB_EXECLP(prog,cmd,...) \ + execlp((find_applet_by_name(prog)) ? CONFIG_BUSYBOX_EXEC_PATH : prog, \ + cmd, __VA_ARGS__) +#else +#define BB_EXECVP(prog,cmd) execvp(prog,cmd) +#define BB_EXECLP(prog,cmd,...) execlp(prog,cmd, __VA_ARGS__) +#endif + +USE_DESKTOP(long long) int uncompress(int fd_in, int fd_out); +int inflate(int in, int out); + + +int bb_make_directory(char *path, long mode, int flags); + +int get_signum(const char *name); +const char *get_signame(int number); + +char *bb_simplify_path(const char *path); + +#define FAIL_DELAY 3 +extern void bb_do_delay(int seconds); +extern void change_identity(const struct passwd *pw); +extern const char *change_identity_e2str(const struct passwd *pw); +extern void run_shell(const char *shell, int loginshell, const char *command, const char **additional_args); +#if ENABLE_SELINUX +extern void renew_current_security_context(void); +extern void set_current_security_context(security_context_t sid); +extern context_t set_security_context_component(security_context_t cur_context, + char *user, char *role, char *type, char *range); +extern void setfscreatecon_or_die(security_context_t scontext); +#endif +extern void selinux_or_die(void); +extern int restricted_shell(const char *shell); +extern void setup_environment(const char *shell, int loginshell, int changeenv, const struct passwd *pw); +extern int correct_password(const struct passwd *pw); +extern char *pw_encrypt(const char *clear, const char *salt); +extern int obscure(const char *old, const char *newval, const struct passwd *pwdp); +extern int index_in_str_array(const char * const string_array[], const char *key); +extern int index_in_substr_array(const char * const string_array[], const char *key); +extern void print_login_issue(const char *issue_file, const char *tty); +extern void print_login_prompt(void); +#ifdef BB_NOMMU +extern void vfork_daemon(int nochdir, int noclose); +extern void vfork_daemon_rexec(int nochdir, int noclose, + int argc, char **argv, char *foreground_opt); +#endif +extern int get_terminal_width_height(const int fd, int *width, int *height); + +char *is_in_ino_dev_hashtable(const struct stat *statbuf); +void add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name); +void reset_ino_dev_hashtable(void); +#ifdef __GLIBC__ +/* At least glibc has horrendously large inline for this, so wrap it */ +extern unsigned long long bb_makedev(unsigned int major, unsigned int minor); +#undef makedev +#define makedev(a,b) bb_makedev(a,b) +#endif + + +#if ENABLE_FEATURE_EDITING +/* It's NOT just ENABLEd or disabled. It's a number: */ +#ifdef CONFIG_FEATURE_EDITING_HISTORY +#define MAX_HISTORY (CONFIG_FEATURE_EDITING_HISTORY + 0) +#else +#define MAX_HISTORY 0 +#endif +struct line_input_t { + int flags; + const char *path_lookup; +#if MAX_HISTORY + int cnt_history; + int cur_history; + USE_FEATURE_EDITING_SAVEHISTORY(const char *hist_file;) + char *history[MAX_HISTORY + 1]; +#endif +}; +enum { + DO_HISTORY = 1 * (MAX_HISTORY > 0), + SAVE_HISTORY = 2 * (MAX_HISTORY > 0) * ENABLE_FEATURE_EDITING_SAVEHISTORY, + TAB_COMPLETION = 4 * ENABLE_FEATURE_TAB_COMPLETION, + USERNAME_COMPLETION = 8 * ENABLE_FEATURE_USERNAME_COMPLETION, + VI_MODE = 0x10 * ENABLE_FEATURE_EDITING_VI, + WITH_PATH_LOOKUP = 0x20, + FOR_SHELL = DO_HISTORY | SAVE_HISTORY | TAB_COMPLETION | USERNAME_COMPLETION, +}; +typedef struct line_input_t line_input_t; +line_input_t *new_line_input_t(int flags); +int read_line_input(const char* prompt, char* command, int maxsize, line_input_t *state); +#else +int read_line_input(const char* prompt, char* command, int maxsize); +#define read_line_input(prompt, command, maxsize, state) \ + read_line_input(prompt, command, maxsize) +#endif + + +#ifndef COMM_LEN +#ifdef TASK_COMM_LEN +enum { COMM_LEN = TASK_COMM_LEN }; +#else +/* synchronize with sizeof(task_struct.comm) in /usr/include/linux/sched.h */ +enum { COMM_LEN = 16 }; +#endif +#endif +typedef struct { + DIR *dir; +/* Fields are set to 0/NULL if failed to determine (or not requested) */ + char *cmd; + unsigned long vsz; + unsigned long stime, utime; + unsigned pid; + unsigned ppid; + unsigned pgid; + unsigned sid; + unsigned uid; + unsigned gid; + /* basename of executable file in call to exec(2), size from */ + /* sizeof(task_struct.comm) in /usr/include/linux/sched.h */ + char state[4]; + char comm[COMM_LEN]; +// user/group? - use passwd/group parsing functions +} procps_status_t; +enum { + PSSCAN_PID = 1 << 0, + PSSCAN_PPID = 1 << 1, + PSSCAN_PGID = 1 << 2, + PSSCAN_SID = 1 << 3, + PSSCAN_UIDGID = 1 << 4, + PSSCAN_COMM = 1 << 5, + PSSCAN_CMD = 1 << 6, + PSSCAN_STATE = 1 << 7, + PSSCAN_VSZ = 1 << 8, + PSSCAN_STIME = 1 << 9, + PSSCAN_UTIME = 1 << 10, + /* These are all retrieved from proc/NN/stat in one go: */ + PSSCAN_STAT = PSSCAN_PPID | PSSCAN_PGID | PSSCAN_SID + | PSSCAN_COMM | PSSCAN_STATE + | PSSCAN_VSZ | PSSCAN_STIME | PSSCAN_UTIME, +}; +procps_status_t* alloc_procps_scan(int flags); +void free_procps_scan(procps_status_t* sp); +procps_status_t* procps_scan(procps_status_t* sp, int flags); +pid_t *find_pid_by_name(const char* procName); +pid_t *pidlist_reverse(pid_t *pidList); + + +extern const char bb_uuenc_tbl_base64[]; +extern const char bb_uuenc_tbl_std[]; +void bb_uuencode(const unsigned char *s, char *store, const int length, const char *tbl); + +typedef struct sha1_ctx_t { + uint32_t count[2]; + uint32_t hash[5]; + uint32_t wbuf[16]; +} sha1_ctx_t; +void sha1_begin(sha1_ctx_t *ctx); +void sha1_hash(const void *data, size_t length, sha1_ctx_t *ctx); +void *sha1_end(void *resbuf, sha1_ctx_t *ctx); + +typedef struct md5_ctx_t { + uint32_t A; + uint32_t B; + uint32_t C; + uint32_t D; + uint64_t total; + uint32_t buflen; + char buffer[128]; +} md5_ctx_t; +void md5_begin(md5_ctx_t *ctx); +void md5_hash(const void *data, size_t length, md5_ctx_t *ctx); +void *md5_end(void *resbuf, md5_ctx_t *ctx); + +uint32_t *crc32_filltable(int endian); + + +enum { /* DO NOT CHANGE THESE VALUES! cp.c, mv.c, install.c depend on them. */ + FILEUTILS_PRESERVE_STATUS = 1, + FILEUTILS_DEREFERENCE = 2, + FILEUTILS_RECUR = 4, + FILEUTILS_FORCE = 8, + FILEUTILS_INTERACTIVE = 0x10, + FILEUTILS_MAKE_HARDLINK = 0x20, + FILEUTILS_MAKE_SOFTLINK = 0x40, +#if ENABLE_SELINUX + FILEUTILS_PRESERVE_SECURITY_CONTEXT = 0x80, + FILEUTILS_SET_SECURITY_CONTEXT = 0x100 +#endif +}; + +#define FILEUTILS_CP_OPTSTR "pdRfils" USE_SELINUX("c") +extern const char *applet_name; +extern const char BB_BANNER[]; + +extern const char bb_msg_full_version[]; +extern const char bb_msg_memory_exhausted[]; +extern const char bb_msg_invalid_date[]; +extern const char bb_msg_read_error[]; +extern const char bb_msg_write_error[]; +extern const char bb_msg_unknown[]; +extern const char bb_msg_can_not_create_raw_socket[]; +extern const char bb_msg_perm_denied_are_you_root[]; +extern const char bb_msg_requires_arg[]; +extern const char bb_msg_invalid_arg[]; +extern const char bb_msg_standard_input[]; +extern const char bb_msg_standard_output[]; + +extern const char bb_str_default[]; +/* NB: (bb_hexdigits_upcase[i] | 0x20) -> lowercase hex digit */ +extern const char bb_hexdigits_upcase[]; + +extern const char bb_path_mtab_file[]; +extern const char bb_path_nologin_file[]; +extern const char bb_path_passwd_file[]; +extern const char bb_path_shadow_file[]; +extern const char bb_path_gshadow_file[]; +extern const char bb_path_group_file[]; +extern const char bb_path_securetty_file[]; +extern const char bb_path_motd_file[]; +extern const char bb_path_wtmp_file[]; +extern const char bb_dev_null[]; + +extern const int const_int_0; +extern const int const_int_1; + +#ifndef BUFSIZ +#define BUFSIZ 4096 +#endif +extern char bb_common_bufsiz1[BUFSIZ+1]; +/* This struct is deliberately not defined. */ +/* See docs/keep_data_small.txt */ +struct globals; +/* Magic prevents this from going into rodata */ +/* If you want to assign a value, use PTR_TO_GLOBALS = xxx */ +extern struct globals *const ptr_to_globals; +#define PTR_TO_GLOBALS (*(struct globals**)&ptr_to_globals) + +/* You can change LIBBB_DEFAULT_LOGIN_SHELL, but don't use it, + * use bb_default_login_shell and following defines. + * If you change LIBBB_DEFAULT_LOGIN_SHELL, + * don't forget to change increment constant. */ +#define LIBBB_DEFAULT_LOGIN_SHELL "-/bin/sh" +extern const char bb_default_login_shell[]; +/* "/bin/sh" */ +#define DEFAULT_SHELL (bb_default_login_shell+1) +/* "sh" */ +#define DEFAULT_SHELL_SHORT_NAME (bb_default_login_shell+6) + + +#if ENABLE_FEATURE_DEVFS +# define CURRENT_VC "/dev/vc/0" +# define VC_1 "/dev/vc/1" +# define VC_2 "/dev/vc/2" +# define VC_3 "/dev/vc/3" +# define VC_4 "/dev/vc/4" +# define VC_5 "/dev/vc/5" +#if defined(__sh__) || defined(__H8300H__) || defined(__H8300S__) +/* Yes, this sucks, but both SH (including sh64) and H8 have a SCI(F) for their + respective serial ports .. as such, we can't use the common device paths for + these. -- PFM */ +# define SC_0 "/dev/ttsc/0" +# define SC_1 "/dev/ttsc/1" +# define SC_FORMAT "/dev/ttsc/%d" +#else +# define SC_0 "/dev/tts/0" +# define SC_1 "/dev/tts/1" +# define SC_FORMAT "/dev/tts/%d" +#endif +# define VC_FORMAT "/dev/vc/%d" +# define LOOP_FORMAT "/dev/loop/%d" +# define LOOP_NAME "/dev/loop/" +# define FB_0 "/dev/fb/0" +#else +# define CURRENT_VC "/dev/tty0" +# define VC_1 "/dev/tty1" +# define VC_2 "/dev/tty2" +# define VC_3 "/dev/tty3" +# define VC_4 "/dev/tty4" +# define VC_5 "/dev/tty5" +#if defined(__sh__) || defined(__H8300H__) || defined(__H8300S__) +# define SC_0 "/dev/ttySC0" +# define SC_1 "/dev/ttySC1" +# define SC_FORMAT "/dev/ttySC%d" +#else +# define SC_0 "/dev/ttyS0" +# define SC_1 "/dev/ttyS1" +# define SC_FORMAT "/dev/ttyS%d" +#endif +# define VC_FORMAT "/dev/tty%d" +# define LOOP_FORMAT "/dev/loop%d" +# define LOOP_NAME "/dev/loop" +# define FB_0 "/dev/fb0" +#endif + +/* The following devices are the same on devfs and non-devfs systems. */ +#define CURRENT_TTY "/dev/tty" +#define DEV_CONSOLE "/dev/console" + + +#ifndef RB_POWER_OFF +/* Stop system and switch power off if possible. */ +#define RB_POWER_OFF 0x4321fedc +#endif + +/* Make sure we call functions instead of macros. */ +#undef isalnum +#undef isalpha +#undef isascii +#undef isblank +#undef iscntrl +#undef isgraph +#undef islower +#undef isprint +#undef ispunct +#undef isspace +#undef isupper +#undef isxdigit + +/* This one is more efficient - we save ~400 bytes */ +#undef isdigit +#define isdigit(a) ((unsigned)((a) - '0') <= 9) + + +#ifdef DMALLOC +#include +#endif + +#endif /* __LIBBUSYBOX_H__ */ diff --git a/i/pc104/initrd/conf/busybox/include/platform.h b/i/pc104/initrd/conf/busybox/include/platform.h new file mode 100644 index 0000000..69d031d --- /dev/null +++ b/i/pc104/initrd/conf/busybox/include/platform.h @@ -0,0 +1,311 @@ +/* vi: set sw=4 ts=4: */ +/* + Copyright 2006, Bernhard Fischer + + Licensed under the GPL v2 or later, see the file LICENSE in this tarball. +*/ +#ifndef __PLATFORM_H +#define __PLATFORM_H 1 + +/* Convenience macros to test the version of gcc. */ +#undef __GNUC_PREREQ +#if defined __GNUC__ && defined __GNUC_MINOR__ +# define __GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +#else +# define __GNUC_PREREQ(maj, min) 0 +#endif + +/* __restrict is known in EGCS 1.2 and above. */ +#if !__GNUC_PREREQ (2,92) +# ifndef __restrict +# define __restrict /* Ignore */ +# endif +#endif + +/* Define macros for some gcc attributes. This permits us to use the + macros freely, and know that they will come into play for the + version of gcc in which they are supported. */ + +#if !__GNUC_PREREQ (2,7) +# ifndef __attribute__ +# define __attribute__(x) +# endif +#endif + +#undef inline +#if defined(__STDC_VERSION__) && __STDC_VERSION__ > 199901L +/* it's a keyword */ +#else +# if __GNUC_PREREQ (2,7) +# define inline __inline__ +# else +# define inline +# endif +#endif + +#ifndef __const +# define __const const +#endif + +# define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) +# define ATTRIBUTE_PACKED __attribute__ ((__packed__)) +# define ATTRIBUTE_ALIGNED(m) __attribute__ ((__aligned__(m))) +# if __GNUC_PREREQ (3,0) +# define ATTRIBUTE_ALWAYS_INLINE __attribute__ ((always_inline)) inline +# else +# define ATTRIBUTE_ALWAYS_INLINE inline +# endif + +/* -fwhole-program makes all symbols local. The attribute externally_visible + forces a symbol global. */ +# if __GNUC_PREREQ (4,1) +# define ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__ ((__externally_visible__)) +# else +# define ATTRIBUTE_EXTERNALLY_VISIBLE +# endif /* GNUC >= 4.1 */ + +/* We use __extension__ in some places to suppress -pedantic warnings + about GCC extensions. This feature didn't work properly before + gcc 2.8. */ +#if !__GNUC_PREREQ (2,8) +# ifndef __extension__ +# define __extension__ +# endif +#endif + +/* gcc-2.95 had no va_copy but only __va_copy. */ +#if !__GNUC_PREREQ (3,0) +# include +# if !defined va_copy && defined __va_copy +# define va_copy(d,s) __va_copy((d),(s)) +# endif +#endif + +/* ---- Endian Detection ------------------------------------ */ + +#if (defined __digital__ && defined __unix__) +# include +# define __BIG_ENDIAN__ (BYTE_ORDER == BIG_ENDIAN) +# define __BYTE_ORDER BYTE_ORDER +#elif !defined __APPLE__ +# include +# include +#endif + +#ifdef __BIG_ENDIAN__ +# define BB_BIG_ENDIAN 1 +# define BB_LITTLE_ENDIAN 0 +#elif __BYTE_ORDER == __BIG_ENDIAN +# define BB_BIG_ENDIAN 1 +# define BB_LITTLE_ENDIAN 0 +#else +# define BB_BIG_ENDIAN 0 +# define BB_LITTLE_ENDIAN 1 +#endif + +#if BB_BIG_ENDIAN +#define SWAP_BE16(x) (x) +#define SWAP_BE32(x) (x) +#define SWAP_BE64(x) (x) +#define SWAP_LE16(x) bswap_16(x) +#define SWAP_LE32(x) bswap_32(x) +#define SWAP_LE64(x) bswap_64(x) +#else +#define SWAP_BE16(x) bswap_16(x) +#define SWAP_BE32(x) bswap_32(x) +#define SWAP_BE64(x) bswap_64(x) +#define SWAP_LE16(x) (x) +#define SWAP_LE32(x) (x) +#define SWAP_LE64(x) (x) +#endif + +/* ---- Networking ------------------------------------------ */ +#ifndef __APPLE__ +# include +#else +# include +#endif + +#ifndef __socklen_t_defined +typedef int socklen_t; +#endif + +/* ---- Compiler dependent settings ------------------------- */ +#if (defined __digital__ && defined __unix__) +# undef HAVE_MNTENT_H +#else +# define HAVE_MNTENT_H 1 +#endif /* ___digital__ && __unix__ */ + +/* linux/loop.h relies on __u64. Make sure we have that as a proper type + * until userspace is widely fixed. */ +#ifndef __GNUC__ +#if defined __INTEL_COMPILER +__extension__ typedef __signed__ long long __s64; +__extension__ typedef unsigned long long __u64; +#endif /* __INTEL_COMPILER */ +#endif /* ifndef __GNUC__ */ + +/*----- Kernel versioning ------------------------------------*/ +#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) + +/* ---- miscellaneous --------------------------------------- */ + +#if defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ < 5 && \ + !defined(__dietlibc__) && \ + !defined(_NEWLIB_VERSION) && \ + !(defined __digital__ && defined __unix__) +# error "Sorry, this libc version is not supported :(" +#endif + +// Don't perpetuate e2fsck crap into the headers. Clean up e2fsck instead. + +#if defined __GLIBC__ || defined __UCLIBC__ \ + || defined __dietlibc__ || defined _NEWLIB_VERSION +#include +#define HAVE_FEATURES_H +#include +#define HAVE_STDINT_H +#else +/* Largest integral types. */ +#if __BIG_ENDIAN__ +typedef long int intmax_t; +typedef unsigned long int uintmax_t; +#else +__extension__ +typedef long long int intmax_t; +__extension__ +typedef unsigned long long int uintmax_t; +#endif +#endif + +/* Size-saving "small" ints (arch-dependent) */ +#if defined(i386) || defined(__x86_64__) || defined(__mips__) || defined(__cris__) +/* add other arches which benefit from this... */ +typedef signed char smallint; +typedef unsigned char smalluint; +#else +/* for arches where byte accesses generate larger code: */ +typedef int smallint; +typedef unsigned smalluint; +#endif + +/* ISO C Standard: 7.16 Boolean type and values */ +#if (defined __digital__ && defined __unix__) +/* old system without (proper) C99 support */ +#define bool smalluint +#else +/* modern system, so use it */ +#include +#endif + + +/* uclibc does not implement daemon() for no-mmu systems. + * For 0.9.29 and svn, __ARCH_USE_MMU__ indicates no-mmu reliably. + * For earlier versions there is no reliable way to check if we are building + * for a mmu-less system; the user should pass EXTRA_CFLAGS="-DBB_NOMMU" + * on his own. + */ +#if defined __UCLIBC__ && __UCLIBC_MAJOR__ >= 0 && __UCLIBC_MINOR__ >= 9 && \ + __UCLIBC_SUBLEVEL__ > 28 && !defined __ARCH_USE_MMU__ +#define BB_NOMMU +#endif + +/* Platforms that haven't got dprintf need to implement fdprintf() in + * libbb. This would require a platform.c. It's not going to be cleaned + * out of the tree, so stop saying it should be. */ +#if !defined(__dietlibc__) +/* Needed for: glibc */ +/* Not needed for: dietlibc */ +/* Others: ?? (add as needed) */ +#define fdprintf dprintf +#endif + +#if defined(__dietlibc__) +static ATTRIBUTE_ALWAYS_INLINE char* strchrnul(const char *s, char c) { + while (*s && *s != c) ++s; + return (char*)s; +} +#endif + +/* Don't use lchown with glibc older than 2.1.x ... uC-libc lacks it */ +#if (defined __GLIBC__ && __GLIBC__ <= 2 && __GLIBC_MINOR__ < 1) || \ + defined __UC_LIBC__ +# define lchown chown +#endif + +/* THIS SHOULD BE CLEANED OUT OF THE TREE ENTIRELY */ +/* FIXME: fix tar.c! */ +#ifndef FNM_LEADING_DIR +#define FNM_LEADING_DIR 0 +#endif + +#if (defined __digital__ && defined __unix__) +#include +#define HAVE_STANDARDS_H +#include +#define HAVE_INTTYPES_H +#define PRIu32 "u" + +/* use legacy setpgrp(pidt_,pid_t) for now. move to platform.c */ +#define bb_setpgrp do { pid_t __me = getpid(); setpgrp(__me,__me); } while (0) + +#if !defined ADJ_OFFSET_SINGLESHOT && defined MOD_CLKA && defined MOD_OFFSET +#define ADJ_OFFSET_SINGLESHOT (MOD_CLKA | MOD_OFFSET) +#endif +#if !defined ADJ_FREQUENCY && defined MOD_FREQUENCY +#define ADJ_FREQUENCY MOD_FREQUENCY +#endif +#if !defined ADJ_TIMECONST && defined MOD_TIMECONST +#define ADJ_TIMECONST MOD_TIMECONST +#endif +#if !defined ADJ_TICK && defined MOD_CLKB +#define ADJ_TICK MOD_CLKB +#endif + +#else +#define bb_setpgrp setpgrp() +#endif + +#if defined(__linux__) +#include +// Make sure we have all the new mount flags we actually try to use. +#ifndef MS_BIND +#define MS_BIND (1<<12) +#endif +#ifndef MS_MOVE +#define MS_MOVE (1<<13) +#endif +#ifndef MS_RECURSIVE +#define MS_RECURSIVE (1<<14) +#endif +#ifndef MS_SILENT +#define MS_SILENT (1<<15) +#endif + +// The shared subtree stuff, which went in around 2.6.15 +#ifndef MS_UNBINDABLE +#define MS_UNBINDABLE (1<<17) +#endif +#ifndef MS_PRIVATE +#define MS_PRIVATE (1<<18) +#endif +#ifndef MS_SLAVE +#define MS_SLAVE (1<<19) +#endif +#ifndef MS_SHARED +#define MS_SHARED (1<<20) +#endif + + +#if !defined(BLKSSZGET) +#define BLKSSZGET _IO(0x12, 104) +#endif +#if !defined(BLKGETSIZE64) +#define BLKGETSIZE64 _IOR(0x12,114,size_t) +#endif +#endif + +#endif /* platform.h */ diff --git a/i/pc104/initrd/conf/busybox/include/pwd_.h b/i/pc104/initrd/conf/busybox/include/pwd_.h new file mode 100644 index 0000000..f47e4eb --- /dev/null +++ b/i/pc104/initrd/conf/busybox/include/pwd_.h @@ -0,0 +1,122 @@ +/* vi: set sw=4 ts=4: */ +/* Copyright (C) 1991,92,95,96,97,98,99,2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +/* + * POSIX Standard: 9.2.2 User Database Access + */ + +#if !ENABLE_USE_BB_PWD_GRP + +#include + +#else + +#ifndef _PWD_H +#define _PWD_H 1 + +/* The passwd structure. */ +struct passwd { + char *pw_name; /* Username. */ + char *pw_passwd; /* Password. */ + uid_t pw_uid; /* User ID. */ + gid_t pw_gid; /* Group ID. */ + char *pw_gecos; /* Real name. */ + char *pw_dir; /* Home directory. */ + char *pw_shell; /* Shell program. */ +}; + + +#define setpwent bb_internal_setpwent +#define endpwent bb_internal_endpwent +#define getpwent bb_internal_getpwent +#define fgetpwent bb_internal_fgetpwent +#define putpwent bb_internal_putpwent +#define getpwuid bb_internal_getpwuid +#define getpwnam bb_internal_getpwnam +#define getpwent_r bb_internal_getpwent_r +#define getpwuid_r bb_internal_getpwuid_r +#define getpwnam_r bb_internal_getpwnam_r +#define fgetpwent_r bb_internal_fgetpwent_r +#define getpw bb_internal_getpw + + +/* All function names below should be remapped by #defines above + * in order to not collide with libc names. + * In theory it isn't necessary, but I saw weird interactions at link time. + * Let's play safe */ + + +/* Rewind the password-file stream. */ +extern void setpwent(void); + +/* Close the password-file stream. */ +extern void endpwent(void); + +/* Read an entry from the password-file stream, opening it if necessary. */ +extern struct passwd *getpwent(void); + +/* Read an entry from STREAM. */ +extern struct passwd *fgetpwent(FILE *__stream); + +/* Write the given entry onto the given stream. */ +extern int putpwent(__const struct passwd *__restrict __p, + FILE *__restrict __f); + +/* Search for an entry with a matching user ID. */ +extern struct passwd *getpwuid(uid_t __uid); + +/* Search for an entry with a matching username. */ +extern struct passwd *getpwnam(__const char *__name); + +/* Reentrant versions of some of the functions above. + + PLEASE NOTE: the `getpwent_r' function is not (yet) standardized. + The interface may change in later versions of this library. But + the interface is designed following the principals used for the + other reentrant functions so the chances are good this is what the + POSIX people would choose. */ + +extern int getpwent_r(struct passwd *__restrict __resultbuf, + char *__restrict __buffer, size_t __buflen, + struct passwd **__restrict __result); + +extern int getpwuid_r(uid_t __uid, + struct passwd *__restrict __resultbuf, + char *__restrict __buffer, size_t __buflen, + struct passwd **__restrict __result); + +extern int getpwnam_r(__const char *__restrict __name, + struct passwd *__restrict __resultbuf, + char *__restrict __buffer, size_t __buflen, + struct passwd **__restrict __result); + +/* Read an entry from STREAM. This function is not standardized and + probably never will. */ +extern int fgetpwent_r(FILE *__restrict __stream, + struct passwd *__restrict __resultbuf, + char *__restrict __buffer, size_t __buflen, + struct passwd **__restrict __result); + +/* Re-construct the password-file line for the given uid + in the given buffer. This knows the format that the caller + will expect, but this need not be the format of the password file. */ +extern int getpw(uid_t __uid, char *__buffer); + +#endif /* pwd.h */ +#endif diff --git a/i/pc104/initrd/conf/busybox/include/shadow_.h b/i/pc104/initrd/conf/busybox/include/shadow_.h new file mode 100644 index 0000000..fb2153c --- /dev/null +++ b/i/pc104/initrd/conf/busybox/include/shadow_.h @@ -0,0 +1,114 @@ +/* vi: set sw=4 ts=4: */ +/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +/* Declaration of types and functions for shadow password suite */ + +#if !ENABLE_USE_BB_SHADOW + +#include + +#else + +#ifndef _SHADOW_H +#define _SHADOW_H 1 + +/* Paths to the user database files */ +#ifndef _PATH_SHADOW +#define _PATH_SHADOW "/etc/shadow" +#endif + +/* Structure of the password file */ +struct spwd { + char *sp_namp; /* Login name */ + char *sp_pwdp; /* Encrypted password */ + long int sp_lstchg; /* Date of last change */ + long int sp_min; /* Minimum number of days between changes */ + long int sp_max; /* Maximum number of days between changes */ + long int sp_warn; /* Number of days to warn user to change the password */ + long int sp_inact; /* Number of days the account may be inactive */ + long int sp_expire; /* Number of days since 1970-01-01 until account expires */ + unsigned long int sp_flag; /* Reserved */ +}; + + +#define setspent bb_internal_setspent +#define endspent bb_internal_endspent +#define getspent bb_internal_getspent +#define getspnam bb_internal_getspnam +#define sgetspent bb_internal_sgetspent +#define fgetspent bb_internal_fgetspent +#define putspent bb_internal_putspent +#define getspent_r bb_internal_getspent_r +#define getspnam_r bb_internal_getspnam_r +#define sgetspent_r bb_internal_sgetspent_r +#define fgetspent_r bb_internal_fgetspent_r +#define lckpwdf bb_internal_lckpwdf +#define ulckpwdf bb_internal_ulckpwdf + + +/* All function names below should be remapped by #defines above + * in order to not collide with libc names. + * In theory it isn't necessary, but I saw weird interactions at link time. + * Let's play safe */ + + +/* Open database for reading */ +extern void setspent(void); + +/* Close database */ +extern void endspent(void); + +/* Get next entry from database, perhaps after opening the file */ +extern struct spwd *getspent(void); + +/* Get shadow entry matching NAME */ +extern struct spwd *getspnam(__const char *__name); + +/* Read shadow entry from STRING */ +extern struct spwd *sgetspent(__const char *__string); + +/* Read next shadow entry from STREAM */ +extern struct spwd *fgetspent(FILE *__stream); + +/* Write line containing shadow password entry to stream */ +extern int putspent(__const struct spwd *__p, FILE *__stream); + +/* Reentrant versions of some of the functions above */ +extern int getspent_r(struct spwd *__result_buf, char *__buffer, + size_t __buflen, struct spwd **__result); + +extern int getspnam_r(__const char *__name, struct spwd *__result_buf, + char *__buffer, size_t __buflen, + struct spwd **__result); + +extern int sgetspent_r(__const char *__string, struct spwd *__result_buf, + char *__buffer, size_t __buflen, + struct spwd **__result); + +extern int fgetspent_r(FILE *__stream, struct spwd *__result_buf, + char *__buffer, size_t __buflen, + struct spwd **__result); +/* Protect password file against multi writers */ +extern int lckpwdf(void); + +/* Unlock password file */ +extern int ulckpwdf(void); + +#endif /* shadow.h */ +#endif diff --git a/i/pc104/initrd/conf/busybox/include/unarchive.h b/i/pc104/initrd/conf/busybox/include/unarchive.h new file mode 100644 index 0000000..36b56a9 --- /dev/null +++ b/i/pc104/initrd/conf/busybox/include/unarchive.h @@ -0,0 +1,118 @@ +/* vi: set sw=4 ts=4: */ +#ifndef __UNARCHIVE_H__ +#define __UNARCHIVE_H__ + +#define ARCHIVE_PRESERVE_DATE 1 +#define ARCHIVE_CREATE_LEADING_DIRS 2 +#define ARCHIVE_EXTRACT_UNCONDITIONAL 4 +#define ARCHIVE_EXTRACT_QUIET 8 +#define ARCHIVE_EXTRACT_NEWER 16 +#define ARCHIVE_NOPRESERVE_OWN 32 +#define ARCHIVE_NOPRESERVE_PERM 64 + +#include "libbb.h" + +typedef struct file_headers_s { + char *name; + char *link_name; + off_t size; + uid_t uid; + gid_t gid; + mode_t mode; + time_t mtime; + dev_t device; +} file_header_t; + +typedef struct archive_handle_s { + /* define if the header and data component should be processed */ + char (*filter)(struct archive_handle_s *); + llist_t *accept; + /* List of files that have been rejected */ + llist_t *reject; + /* List of files that have successfully been worked on */ + llist_t *passed; + + /* Contains the processed header entry */ + file_header_t *file_header; + + /* process the header component, e.g. tar -t */ + void (*action_header)(const file_header_t *); + + /* process the data component, e.g. extract to filesystem */ + void (*action_data)(struct archive_handle_s *); + + /* How to process any sub archive, e.g. get_header_tar_gz */ + char (*action_data_subarchive)(struct archive_handle_s *); + + /* Contains the handle to a sub archive */ + struct archive_handle_s *sub_archive; + + /* The raw stream as read from disk or stdin */ + int src_fd; + + /* Count the number of bytes processed */ + off_t offset; + + /* Function that skips data: read_by_char or read_by_skip */ + void (*seek)(const struct archive_handle_s *archive_handle, const unsigned int amount); + + /* Temporary storage */ + char *buffer; + + /* Flags and misc. stuff */ + unsigned char flags; + +} archive_handle_t; + + +extern archive_handle_t *init_handle(void); + +extern char filter_accept_all(archive_handle_t *archive_handle); +extern char filter_accept_list(archive_handle_t *archive_handle); +extern char filter_accept_list_reassign(archive_handle_t *archive_handle); +extern char filter_accept_reject_list(archive_handle_t *archive_handle); + +extern void unpack_ar_archive(archive_handle_t *ar_archive); + +extern void data_skip(archive_handle_t *archive_handle); +extern void data_extract_all(archive_handle_t *archive_handle); +extern void data_extract_to_stdout(archive_handle_t *archive_handle); +extern void data_extract_to_buffer(archive_handle_t *archive_handle); + +extern void header_skip(const file_header_t *file_header); +extern void header_list(const file_header_t *file_header); +extern void header_verbose_list(const file_header_t *file_header); + +extern void check_header_gzip_or_die(int src_fd); + +extern char get_header_ar(archive_handle_t *archive_handle); +extern char get_header_cpio(archive_handle_t *archive_handle); +extern char get_header_tar(archive_handle_t *archive_handle); +extern char get_header_tar_bz2(archive_handle_t *archive_handle); +extern char get_header_tar_lzma(archive_handle_t *archive_handle); +extern char get_header_tar_gz(archive_handle_t *archive_handle); + +extern void seek_by_jump(const archive_handle_t *archive_handle, const unsigned int amount); +extern void seek_by_read(const archive_handle_t *archive_handle, const unsigned int amount); + +extern ssize_t archive_xread_all_eof(archive_handle_t *archive_handle, unsigned char *buf, size_t count); + +extern void data_align(archive_handle_t *archive_handle, const unsigned short boundary); +extern const llist_t *find_list_entry(const llist_t *list, const char *filename); +extern const llist_t *find_list_entry2(const llist_t *list, const char *filename); + +extern USE_DESKTOP(long long) int uncompressStream(int src_fd, int dst_fd); + +typedef struct inflate_unzip_result { + off_t bytes_out; + uint32_t crc; +} inflate_unzip_result; + +extern USE_DESKTOP(long long) int inflate_unzip(inflate_unzip_result *res, unsigned bufsize, int in, int out); +extern USE_DESKTOP(long long) int inflate_gunzip(int in, int out); +extern USE_DESKTOP(long long) int unlzma(int src_fd, int dst_fd); + +extern int open_transformer(int src_fd, + USE_DESKTOP(long long) int (*transformer)(int src_fd, int dst_fd)); + +#endif diff --git a/i/pc104/initrd/conf/busybox/include/usage.h b/i/pc104/initrd/conf/busybox/include/usage.h new file mode 100644 index 0000000..66f8638 --- /dev/null +++ b/i/pc104/initrd/conf/busybox/include/usage.h @@ -0,0 +1,3688 @@ +/* vi: set sw=8 ts=8: */ +/* + * This file suffers from chronically incorrect tabification + * of messages. Before editing this file: + * 1. Switch you editor to 8-space tab mode. + * 2. Do not use \t in messages, use real tab character. + * 3. Start each source line with message as follows: + * |<7 spaces>"text with tabs".... + */ + +#ifndef __BB_USAGE_H__ +#define __BB_USAGE_H__ + +#define addgroup_trivial_usage \ + "[-g GID] group_name [user_name]" +#define addgroup_full_usage \ + "Add a group to the system" \ + "\n\nOptions:\n" \ + " -g GID Specify gid" + +#define adduser_trivial_usage \ + "[OPTIONS] user_name" +#define adduser_full_usage \ + "Add a user to the system" \ + "\n\nOptions:\n" \ + " -h DIR Assign home directory DIR\n" \ + " -g GECOS Assign gecos field GECOS\n" \ + " -s SHELL Assign login shell SHELL\n" \ + " -G Add the user to existing group GROUP\n" \ + " -S Create a system user (ignored)\n" \ + " -D Do not assign a password (logins still possible via ssh)\n" \ + " -H Do not create the home directory" + +#define adjtimex_trivial_usage \ + "[-q] [-o offset] [-f frequency] [-p timeconstant] [-t tick]" +#define adjtimex_full_usage \ + "Read and optionally set system timebase parameters.\n" \ + "See adjtimex(2)." \ + "\n\nOptions:\n" \ + " -q Quiet mode - do not print\n" \ + " -o offset Time offset, microseconds\n" \ + " -f frequency Frequency adjust, integer kernel units (65536 is 1ppm)\n" \ + " (positive values make the system clock run fast)\n" \ + " -t tick Microseconds per tick, usually 10000\n" \ + " -p timeconstant" + +#define ar_trivial_usage \ + "[-o] [-v] [-p] [-t] [-x] ARCHIVE FILES" +#define ar_full_usage \ + "Extract or list FILES from an ar archive" \ + "\n\nOptions:\n" \ + " -o Preserve original dates\n" \ + " -p Extract to stdout\n" \ + " -t List\n" \ + " -x Extract\n" \ + " -v Verbosely list files processed" + +#define arp_trivial_usage \ + "\n" \ + "[-vn] [-H type] [-i if] -a [hostname]\n" \ + "[-v] [-i if] -d hostname [pub]\n" \ + "[-v] [-H type] [-i if] -s hostname hw_addr [temp]\n" \ + "[-v] [-H type] [-i if] -s hostname hw_addr [netmask nm] pub\n" \ + "[-v] [-H type] [-i if] -Ds hostname ifa [netmask nm] pub\n" +#define arp_full_usage \ + "Manipulate the system ARP cache" \ + "\n\nOptions:" \ + "\n -a Display (all) hosts" \ + "\n -s Set a new ARP entry" \ + "\n -d Delete a specified entry" \ + "\n -v Verbose" \ + "\n -n Don't resolve names" \ + "\n -i if Specify network interface (e.g. eth0)" \ + "\n -D Read from given device" \ + "\n -A, -p Specify protocol family" \ + "\n -H hwtype Specify hardware address type" + +#define arping_trivial_usage \ + "[-fqbDUA] [-c count] [-w timeout] [-i device] [-s sender] target" +#define arping_full_usage \ + "Ping hosts by ARP requests/replies" \ + "\n\nOptions:\n" \ + " -f Quit on first ARP reply\n" \ + " -q Be quiet\n" \ + " -b Keep broadcasting, don't go unicast\n" \ + " -D Duplicated address detection mode\n" \ + " -U Unsolicited ARP mode, update your neighbours\n" \ + " -A ARP answer mode, update your neighbours\n" \ + " -c count Stop after sending count ARP request packets\n" \ + " -w timeout Time to wait for ARP reply, in seconds\n" \ + " -i device Outgoing interface name, default is eth0\n" \ + " -s sender Set specific sender IP address\n" \ + " target Target IP address of ARP request" + +#define ash_trivial_usage \ + "[FILE]...\n" \ + "or: ash -c command [args]..." +#define ash_full_usage \ + "The ash shell (command interpreter)" + +#define awk_trivial_usage \ + "[OPTION]... [program-text] [FILE ...]" +#define awk_full_usage \ + "Options:\n" \ + " -v var=val Assign value 'val' to variable 'var'\n" \ + " -F sep Use 'sep' as field separator\n" \ + " -f progname Read program source from file 'progname'" + +#define basename_trivial_usage \ + "FILE [SUFFIX]" +#define basename_full_usage \ + "Strip directory path and suffixes from FILE.\n" \ + "If specified, also remove any trailing SUFFIX." +#define basename_example_usage \ + "$ basename /usr/local/bin/foo\n" \ + "foo\n" \ + "$ basename /usr/local/bin/\n" \ + "bin\n" \ + "$ basename /foo/bar.txt .txt\n" \ + "bar" + +#define bunzip2_trivial_usage \ + "[OPTION]... [FILE]" +#define bunzip2_full_usage \ + "Uncompress FILE (or standard input if FILE is '-' or omitted)" \ + "\n\nOptions:\n" \ + " -c Write output to standard output\n" \ + " -f Force" + +#define busybox_notes_usage \ + "Hello world!\n" + +#define bzcat_trivial_usage \ + "FILE" +#define bzcat_full_usage \ + "Uncompress to stdout" + +#define unlzma_trivial_usage \ + "[OPTION]... [FILE]" +#define unlzma_full_usage \ + "Uncompress FILE (or standard input if FILE is '-' or omitted)" \ + "\n\nOptions:\n" \ + " -c Write output to standard output\n" \ + " -f Force" + +#define lzmacat_trivial_usage \ + "FILE" +#define lzmacat_full_usage \ + "Uncompress to stdout" + +#define cal_trivial_usage \ + "[-jy] [[month] year]" +#define cal_full_usage \ + "Display a calendar" \ + "\n\nOptions:" \ + "\n -j Use julian dates" \ + "\n -y Display the entire year" + +#define cat_trivial_usage \ + "[-u] [FILE]..." +#define cat_full_usage \ + "Concatenate FILE(s) and print them to stdout" \ + "\n\nOptions:" \ + "\n -u Ignored since unbuffered i/o is always used" +#define cat_example_usage \ + "$ cat /proc/uptime\n" \ + "110716.72 17.67" + +#define catv_trivial_usage \ + "[-etv] [FILE]..." +#define catv_full_usage \ + "Display nonprinting characters as ^x or M-x" \ + "\n\nOptions:\n" \ + " -e End each line with $\n" \ + " -t Show tabs as ^I\n" \ + " -v Don't use ^x or M-x escapes" +#define chattr_trivial_usage \ + "[-R] [-+=AacDdijsStTu] [-v version] files..." +#define chattr_full_usage \ + "Change file attributes on an ext2 fs\n\n" \ + "Modifiers:\n" \ + " - Remove attributes\n" \ + " + Add attributes\n" \ + " = Set attributes\n" \ + "Attributes:\n" \ + " A Don't track atime\n" \ + " a Append mode only\n" \ + " c Enable compress\n" \ + " D Write dir contents synchronously\n" \ + " d Do not backup with dump\n" \ + " i Cannot be modified (immutable)\n" \ + " j Write all data to journal first\n" \ + " s Zero disk storage when deleted\n" \ + " S Write file contents synchronously\n" \ + " t Disable tail-merging of partial blocks with other files\n" \ + " u Allow file to be undeleted\n" \ + "Options:\n" \ + " -R Recursively list subdirectories\n" \ + " -v Set the file's version/generation number" + +#define chcon_trivial_usage \ + "[OPTIONS] CONTEXT FILE...\n" \ + " chcon [OPTIONS] [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE...\n" \ + " chcon [OPTIONS] --reference=RFILE FILE...\n" +#define chcon_full_usage \ + "Change the security context of each FILE to CONTEXT\n" \ + "\n -v, --verbose Verbose" \ + "\n -c, --changes Report changes made" \ + "\n -h, --no-dereference Affect symlinks instead of their targets" \ + "\n -f, --silent, --quiet Suppress most error messages" \ + "\n --reference=RFILE Use RFILE's group instead of using a CONTEXT value" \ + "\n -u, --user=USER Set user USER in the target security context" \ + "\n -r, --role=ROLE Set role ROLE in the target security context" \ + "\n -t, --type=TYPE Set type TYPE in the target security context" \ + "\n -l, --range=RANGE Set range RANGE in the target security context" \ + "\n -R, --recursive Recurse subdirectories" \ + +#define chmod_trivial_usage \ + "[-R"USE_DESKTOP("cvf")"] MODE[,MODE]... FILE..." +#define chmod_full_usage \ + "Each MODE is one or more of the letters ugoa, one of the\n" \ + "symbols +-= and one or more of the letters rwxst" \ + "\n\nOptions:" \ + "\n -R Changes files and directories recursively" \ + USE_DESKTOP( \ + "\n -c List changed files" \ + "\n -v List all files" \ + "\n -f Hide errors" \ + ) +#define chmod_example_usage \ + "$ ls -l /tmp/foo\n" \ + "-rw-rw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo\n" \ + "$ chmod u+x /tmp/foo\n" \ + "$ ls -l /tmp/foo\n" \ + "-rwxrw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo*\n" \ + "$ chmod 444 /tmp/foo\n" \ + "$ ls -l /tmp/foo\n" \ + "-r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo\n" + +#define chgrp_trivial_usage \ + "[-RhLHP"USE_DESKTOP("cvf")"]... GROUP FILE..." +#define chgrp_full_usage \ + "Change the group membership of each FILE to GROUP" \ + "\n\nOptions:" \ + "\n -R Recurse directories" \ + "\n -h Affect symlinks instead of symlink targets" \ + "\n -L Traverse all symlinks to directories" \ + "\n -H Traverse symlinks on command line only" \ + "\n -P Do not traverse symlinks (default)" \ + USE_DESKTOP( \ + "\n -c List changed files" \ + "\n -v Verbose" \ + "\n -f Hide errors" \ + ) +#define chgrp_example_usage \ + "$ ls -l /tmp/foo\n" \ + "-r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo\n" \ + "$ chgrp root /tmp/foo\n" \ + "$ ls -l /tmp/foo\n" \ + "-r--r--r-- 1 andersen root 0 Apr 12 18:25 /tmp/foo\n" + +#define chown_trivial_usage \ + "[-RhLHP"USE_DESKTOP("cvf")"]... OWNER[<.|:>[GROUP]] FILE..." +#define chown_full_usage \ + "Change the owner and/or group of each FILE to OWNER and/or GROUP" \ + "\n\nOptions:" \ + "\n -R Recurse directories" \ + "\n -h Affect symlinks instead of symlink targets" \ + "\n -L Traverse all symlinks to directories" \ + "\n -H Traverse symlinks on command line only" \ + "\n -P Do not traverse symlinks (default)" \ + USE_DESKTOP( \ + "\n -c List changed files" \ + "\n -v List all files" \ + "\n -f Hide errors" \ + ) +#define chown_example_usage \ + "$ ls -l /tmp/foo\n" \ + "-r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo\n" \ + "$ chown root /tmp/foo\n" \ + "$ ls -l /tmp/foo\n" \ + "-r--r--r-- 1 root andersen 0 Apr 12 18:25 /tmp/foo\n" \ + "$ chown root.root /tmp/foo\n" \ + "ls -l /tmp/foo\n" \ + "-r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo\n" + +#define chpst_trivial_usage \ + "[-vP012] [-u user[:group]] [-U user[:group]] [-e dir] " \ + "[-/ dir] [-n nice] [-m bytes] [-d bytes] [-o files] " \ + "[-p processes] [-f bytes] [-c bytes] prog args" +#define chpst_full_usage \ + "Change the process state and run specified program" \ + "\n\nOptions:\n" \ + " -u user[:grp] Set uid and gid\n" \ + " -U user[:grp] Set environment variables UID and GID\n" \ + " -e dir Set environment variables as specified by files\n" \ + " in the directory: file=1st_line_of_file\n" \ + " -/ dir Chroot to dir\n" \ + " -n inc Add inc to nice value\n" \ + " -m bytes Limit data segment, stack segment, locked physical pages,\n" \ + " and total of all segment per process to bytes bytes each\n" \ + " -d bytes Limit data segment\n" \ + " -o n Limit the number of open file descriptors per process to n\n" \ + " -p n Limit number of processes per uid to n\n" \ + " -f bytes Limit output file size to bytes bytes\n" \ + " -c bytes Limit core file size to bytes bytes\n" \ + " -v Verbose\n" \ + " -P Run prog in a new process group\n" \ + " -0 Close standard input\n" \ + " -1 Close standard output\n" \ + " -2 Close standard error" +#define setuidgid_trivial_usage \ + "account prog args" +#define setuidgid_full_usage \ + "Set uid and gid to account's uid and gid, removing all supplementary\n" \ + "groups, then run prog" +#define envuidgid_trivial_usage \ + "account prog args" +#define envuidgid_full_usage \ + "Set $UID to account's uid and $GID to account's gid, then run prog" +#define envdir_trivial_usage \ + "dir prog args" +#define envdir_full_usage \ + "Set various environment variables as specified by files\n" \ + "in the directory dir, then run prog" +#define softlimit_trivial_usage \ + "[-a allbytes] [-c corebytes] [-d databytes] [-f filebytes] " \ + "[-l lockbytes] [-m membytes] [-o openfiles] [-p processes] " \ + "[-r residentbytes] [-s stackbytes] [-t cpusecs] prog args" +#define softlimit_full_usage \ + "Set soft resource limits, then run prog" \ + "\n\nOptions:\n" \ + " -m n Same as -d n -s n -l n -a n\n" \ + " -d n Limit the data segment per process to n bytes\n" \ + " -s n Limit the stack segment per process to n bytes\n" \ + " -l n Limit the locked physical pages per process to n bytes\n" \ + " -a n Limit the total of all segments per process to n bytes\n" \ + " -o n Limit the number of open file descriptors per process to n\n" \ + " -p n Limit the number of processes per uid to n\n" \ + "Options controlling file sizes:\n" \ + " -f n Limit output file sizes to n bytes\n" \ + " -c n Limit core file sizes to n bytes\n" \ + "Efficiency opts:\n" \ + " -r n Limit the resident set size to n bytes. This limit is not\n" \ + " enforced unless physical memory is full\n" \ + " -t n Limit the CPU time to n seconds. This limit is not enforced\n" \ + " except that the process receives a SIGXCPU signal after n seconds\n" \ + "\n" \ + "Some options may have no effect on some operating systems\n" \ + "n may be =, indicating that soft limit should be set equal to hard limit" + +#define chroot_trivial_usage \ + "NEWROOT [COMMAND...]" +#define chroot_full_usage \ + "Run COMMAND with root directory set to NEWROOT" +#define chroot_example_usage \ + "$ ls -l /bin/ls\n" \ + "lrwxrwxrwx 1 root root 12 Apr 13 00:46 /bin/ls -> /BusyBox\n" \ + "# mount /dev/hdc1 /mnt -t minix\n" \ + "# chroot /mnt\n" \ + "# ls -l /bin/ls\n" \ + "-rwxr-xr-x 1 root root 40816 Feb 5 07:45 /bin/ls*\n" + +#define chvt_trivial_usage \ + "N" +#define chvt_full_usage \ + "Change the foreground virtual terminal to /dev/ttyN" + +#define cksum_trivial_usage \ + "FILES..." +#define cksum_full_usage \ + "Calculate the CRC32 checksums of FILES" + +#define clear_trivial_usage \ + "" +#define clear_full_usage \ + "Clear screen" + +#define cmp_trivial_usage \ + "[-l] [-s] FILE1 [FILE2" USE_DESKTOP(" [SKIP1 [SKIP2]") "]]" +#define cmp_full_usage \ + "Compares FILE1 vs stdin if FILE2 is not specified" \ + "\n\nOptions:\n" \ + " -l Write the byte numbers (decimal) and values (octal)\n" \ + " for all differing bytes\n" \ + " -s Quiet mode - do not print" + +#define comm_trivial_usage \ + "[-123] FILE1 FILE2" +#define comm_full_usage \ + "Compare FILE1 to FILE2, or to stdin if - is specified" \ + "\n\nOptions:\n" \ + " -1 Suppress lines unique to FILE1\n" \ + " -2 Suppress lines unique to FILE2\n" \ + " -3 Suppress lines common to both files" + +#define bbconfig_trivial_usage \ + "" +#define bbconfig_full_usage \ + "Print the config file which built busybox" + +#define bbsh_trivial_usage \ + "[FILE]...\n" \ + "or: bbsh -c command [args]..." +#define bbsh_full_usage \ + "The bbsh shell (command interpreter)" + +#define chrt_trivial_usage \ + "[OPTION]... [prio] [pid | command [arg]...]" +#define chrt_full_usage \ + "manipulate real-time attributes of a process" \ + "\n\nOptions:\n" \ + " -p operate on pid\n" \ + " -r set scheduling policy to SCHED_RR\n" \ + " -f set scheduling policy to SCHED_FIFO\n" \ + " -o set scheduling policy to SCHED_OTHER\n" \ + " -m show min and max priorities" + +#define chrt_example_usage \ + "$ chrt -r 4 sleep 900 ; x=$!\n" \ + "$ chrt -f -p 3 $x\n" \ + "You need CAP_SYS_NICE privileges to set scheduling attributes of a process" + +#define cp_trivial_usage \ + "[OPTION]... SOURCE DEST" +#define cp_full_usage \ + "Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY" \ + "\n\nOptions:" \ + "\n -a Same as -dpR" \ + USE_SELINUX( \ + "\n -c Preserves security context" \ + ) \ + "\n -d,-P Preserve links" \ + "\n -H,-L Dereference all symlinks (default)" \ + "\n -p Preserve file attributes if possible" \ + "\n -f Force overwrite" \ + "\n -i Prompt before overwrite" \ + "\n -R,-r Recurse directories" \ + "\n -l,-s Create (sym)links" + +#define cpio_trivial_usage \ + "-[dimtuv][F cpiofile]" +#define cpio_full_usage \ + "Extract or list files from a cpio archive\n" \ + "Main operation mode:\n" \ + " d Make leading directories\n" \ + " i Extract\n" \ + " m Preserve mtime\n" \ + " t List\n" \ + " v Verbose\n" \ + " u Unconditional overwrite\n" \ + " F Input from file" + +#define crond_trivial_usage \ + "-d[#] -c -f -b" +#define crond_full_usage \ + " -d [#] -l [#] -S -L logfile -f -b -c dir\n" \ + " -d num Debug level\n" \ + " -l num Log level (8 - default)\n" \ + " -S Log to syslogd (default)\n" \ + " -L file Log to file\n" \ + " -f Run in foreground\n" \ + " -b Run in background (default)\n" \ + " -c dir Working dir" + +#define crontab_trivial_usage \ + "[-c dir] {file|-}|[-u|-l|-e|-d user]" +#define crontab_full_usage \ + " File replace crontab from file\n" \ + " - replace crontab from stdin\n" \ + " -u user specify user\n" \ + " -l [user] list crontab for user\n" \ + " -e [user] edit crontab for user\n" \ + " -d [user] delete crontab for user\n" \ + " -c dir specify crontab directory" + + +#define cut_trivial_usage \ + "[OPTION]... [FILE]..." +#define cut_full_usage \ + "Print selected fields from each input FILE to standard output" \ + "\n\nOptions:\n" \ + " -b LIST Output only bytes from LIST\n" \ + " -c LIST Output only characters from LIST\n" \ + " -d CHAR Use CHAR instead of tab as the field delimiter\n" \ + " -s Output only the lines containing delimiter\n" \ + " -f N Print only these fields\n" \ + " -n Ignored" +#define cut_example_usage \ + "$ echo \"Hello world\" | cut -f 1 -d ' '\n" \ + "Hello\n" \ + "$ echo \"Hello world\" | cut -f 2 -d ' '\n" \ + "world\n" + +#define date_trivial_usage \ + "[OPTION]... [MMDDhhmm[[CC]YY][.ss]] [+FORMAT]" +#define date_full_usage \ + "Display current time in the given FORMAT, or set system date" \ + "\n\nOptions:\n" \ + " -R Outputs RFC-822 compliant date string\n" \ + " -d STRING Displays time described by STRING, not 'now'\n" \ + USE_FEATURE_DATE_ISOFMT( \ + " -I[TIMESPEC] Outputs an ISO-8601 compliant date/time string\n" \ + " TIMESPEC='date' (or missing) for date only,\n" \ + " 'hours', 'minutes', or 'seconds' for date and,\n" \ + " time to the indicated precision\n" \ + " -D hint Use 'hint' as date format, via strptime()\n" \ + ) \ + " -s Sets time described by STRING\n" \ + " -r FILE Displays the last modification time of FILE\n" \ + " -u Prints or sets Coordinated Universal Time" +#define date_example_usage \ + "$ date\n" \ + "Wed Apr 12 18:52:41 MDT 2000\n" + +#define dc_trivial_usage \ + "expression ..." +#define dc_full_usage \ + "This is a Tiny RPN calculator that understands the\n" \ + "following operations: +, add, -, sub, *, mul, /, div, %, mod, " \ + "**, exp, and, or, not, eor.\n" \ + "For example: 'dc 2 2 add' -> 4, and 'dc 8 8 \\* 2 2 + /' -> 16." \ + "\n\nOptions:\n" \ + "p - Prints the value on the top of the stack, without altering the stack\n" \ + "f - Prints the entire contents of the stack without altering anything\n" \ + "o - Pops the value off the top of the stack and uses it to set the output radix\n" \ + " Only 10 and 16 are supported" +#define dc_example_usage \ + "$ dc 2 2 + p\n" \ + "4\n" \ + "$ dc 8 8 \\* 2 2 + / p\n" \ + "16\n" \ + "$ dc 0 1 and p\n" \ + "0\n" \ + "$ dc 0 1 or p\n" \ + "1\n" \ + "$ echo 72 9 div 8 mul p | dc\n" \ + "64\n" + +#define dd_trivial_usage \ + "[if=FILE] [of=FILE] " USE_FEATURE_DD_IBS_OBS("[ibs=N] [obs=N] ") "[bs=N] [count=N] [skip=N]\n" \ + " [seek=N]" USE_FEATURE_DD_IBS_OBS(" [conv=notrunc|noerror|sync]") +#define dd_full_usage \ + "Copy a file with converting and formatting" \ + "\n\nOptions:\n" \ + " if=FILE Read from FILE instead of stdin\n" \ + " of=FILE Write to FILE instead of stdout\n" \ + " bs=N Read and write N bytes at a time\n" \ + USE_FEATURE_DD_IBS_OBS( \ + " ibs=N Read N bytes at a time\n") \ + USE_FEATURE_DD_IBS_OBS( \ + " obs=N Write N bytes at a time\n") \ + " count=N Copy only N input blocks\n" \ + " skip=N Skip N input blocks\n" \ + " seek=N Skip N output blocks\n" \ + USE_FEATURE_DD_IBS_OBS( \ + " conv=notrunc Don't truncate output file\n" \ + " conv=noerror Continue after read errors\n" \ + " conv=sync Pad blocks with zeros\n") \ + "\n" \ + "Numbers may be suffixed by c (x1), w (x2), b (x512), kD (x1000), k (x1024),\n" \ + "MD (x1000000), M (x1048576), GD (x1000000000) or G (x1073741824)" +#define dd_example_usage \ + "$ dd if=/dev/zero of=/dev/ram1 bs=1M count=4\n" \ + "4+0 records in\n" \ + "4+0 records out\n" + +#define deallocvt_trivial_usage \ + "[N]" +#define deallocvt_full_usage \ + "Deallocate unused virtual terminal /dev/ttyN" + +#define delgroup_trivial_usage \ + "GROUP" +#define delgroup_full_usage \ + "Delete group GROUP from the system" + +#define deluser_trivial_usage \ + "USER" +#define deluser_full_usage \ + "Delete user USER from the system" + +#define devfsd_trivial_usage \ + "mntpnt [-v]" \ + USE_DEVFSD_FG_NP("[-fg][-np]" ) +#define devfsd_full_usage \ + "Manage devfs permissions and old device name symlinks" \ + "\n\nOptions:" \ + "\n mntpnt The mount point where devfs is mounted" \ + "\n -v Print the protocol version numbers for devfsd" \ + "\n and the kernel-side protocol version and exits" \ + USE_DEVFSD_FG_NP( \ + "\n -fg Run the daemon in the foreground" \ + "\n -np Exit after parsing the configuration file" \ + "\n and processing synthetic REGISTER events," \ + "\n do not poll for events") + +#define df_trivial_usage \ + "[-" USE_FEATURE_HUMAN_READABLE("hm") "k] [FILESYSTEM ...]" +#define df_full_usage \ + "Print the filesystem space used and space available" \ + "\n\nOptions:\n" \ + USE_FEATURE_HUMAN_READABLE( \ + "\n -h Print sizes in human readable format (e.g., 1K 243M 2G )\n" \ + " -m Print sizes in megabytes\n" \ + " -k Print sizes in kilobytes(default)") \ + SKIP_FEATURE_HUMAN_READABLE( \ + "\n -k Ignored") +#define df_example_usage \ + "$ df\n" \ + "Filesystem 1k-blocks Used Available Use% Mounted on\n" \ + "/dev/sda3 8690864 8553540 137324 98% /\n" \ + "/dev/sda1 64216 36364 27852 57% /boot\n" \ + "$ df /dev/sda3\n" \ + "Filesystem 1k-blocks Used Available Use% Mounted on\n" \ + "/dev/sda3 8690864 8553540 137324 98% /\n" + +#define dhcprelay_trivial_usage \ + "[client_device_list] [server_device]" +#define dhcprelay_full_usage \ + "Relay dhcp requests from client devices to server device" + +#define dhcprelay_trivial_usage \ + "[client_device_list] [server_device]" +#define dhcprelay_full_usage \ + "Relay dhcp requests from client devices to server device" + +#define diff_trivial_usage \ + "[-abdiNqrTstw] [-L LABEL] [-S FILE] [-U LINES] FILE1 FILE2" +#define diff_full_usage \ + "Compare files line by line and output the differences between them.\n" \ + "This diff implementation only supports unified diffs." \ + "\n\nOptions:\n" \ + " -a Treat all files as text\n" \ + " -b Ignore changes in the amount of whitespace\n" \ + " -d Try hard to find a smaller set of changes\n" \ + " -i Ignore case differences\n" \ + " -L Use LABEL instead of the filename in the unified header\n" \ + " -N Treat absent files as empty\n" \ + " -q Output only whether files differ\n" \ + " -r Recursively compare subdirectories\n" \ + " -S Start with FILE when comparing directories\n" \ + " -T Make tabs line up by prefixing a tab when necessary\n" \ + " -s Report when two files are the same\n" \ + " -t Expand tabs to spaces in output\n" \ + " -U Output LINES lines of context\n" \ + " -w Ignore all whitespace" + +#define dirname_trivial_usage \ + "FILENAME" +#define dirname_full_usage \ + "Strip non-directory suffix from FILENAME" +#define dirname_example_usage \ + "$ dirname /tmp/foo\n" \ + "/tmp\n" \ + "$ dirname /tmp/foo/\n" \ + "/tmp\n" + +#define dmesg_trivial_usage \ + "[-c] [-n LEVEL] [-s SIZE]" +#define dmesg_full_usage \ + "Print or control the kernel ring buffer" \ + "\n\nOptions:\n" \ + " -c Clears the ring buffer's contents after printing\n" \ + " -n LEVEL Sets console logging level\n" \ + " -s SIZE Use a buffer of size SIZE" + +#define dnsd_trivial_usage \ + "[-c config] [-t seconds] [-p port] [-i iface-ip] [-d]" +#define dnsd_full_usage \ + "Small and static DNS server daemon" \ + "\n\nOptions:\n" \ + " -c Config filename\n" \ + " -t TTL in seconds\n" \ + " -p Listening port\n" \ + " -i Listening iface ip (default all)\n" \ + " -d Daemonize" + +#define dos2unix_trivial_usage \ + "[option] [FILE]" +#define dos2unix_full_usage \ + "Convert FILE from dos format to unix format. When no option\n" \ + "is given, the input is converted to the opposite output format.\n" \ + "When no file is given, use stdin for input and stdout for output." \ + "\n\nOptions:\n" \ + " -u Output will be in UNIX format\n" \ + " -d Output will be in DOS format" + +#define dpkg_trivial_usage \ + "[-ilCPru] [-F option] package_name" +#define dpkg_full_usage \ + "Install, remove and manage Debian packages" \ + "\n\nOptions:\n" \ + " -i Install the package\n" \ + " -l List of installed packages\n" \ + " -C Configure an unpackaged package\n" \ + " -F depends Ignore dependency problems\n" \ + " -P Purge all files of a package\n" \ + " -r Remove all but the configuration files for a package\n" \ + " -u Unpack a package, but don't configure it" + +#define dpkg_deb_trivial_usage \ + "[-cefxX] FILE [argument]" +#define dpkg_deb_full_usage \ + "Perform actions on Debian packages (.debs)" \ + "\n\nOptions:\n" \ + " -c List contents of filesystem tree\n" \ + " -e Extract control files to [argument] directory\n" \ + " -f Display control field name starting with [argument]\n" \ + " -x Extract packages filesystem tree to directory\n" \ + " -X Verbose extract" +#define dpkg_deb_example_usage \ + "$ dpkg-deb -X ./busybox_0.48-1_i386.deb /tmp\n" + +#define du_trivial_usage \ + "[-aHLdclsx" USE_FEATURE_HUMAN_READABLE("hm") "k] [FILE]..." +#define du_full_usage \ + "Summarize disk space used for each FILE and/or directory.\n" \ + "Disk space is printed in units of " \ + USE_FEATURE_DU_DEFAULT_BLOCKSIZE_1K("1024") \ + SKIP_FEATURE_DU_DEFAULT_BLOCKSIZE_1K("512") \ + " bytes." \ + "\n\nOptions:\n" \ + " -a Show sizes of files in addition to directories\n" \ + " -H Follow symlinks that are FILE command line args\n" \ + " -L Follow all symlinks encountered\n" \ + " -d N Limit output to directories (and files with -a) of depth < N\n" \ + " -c Output a grand total\n" \ + " -l Count sizes many times if hard linked\n" \ + " -s Display only a total for each argument\n" \ + " -x Skip directories on different filesystems\n" \ + USE_FEATURE_HUMAN_READABLE( \ + " -h Print sizes in human readable format (e.g., 1K 243M 2G )\n" \ + " -m Print sizes in megabytes\n" \ + ) \ + " -k Print sizes in kilobytes" \ + USE_FEATURE_DU_DEFAULT_BLOCKSIZE_1K("(default)") +#define du_example_usage \ + "$ du\n" \ + "16 ./CVS\n" \ + "12 ./kernel-patches/CVS\n" \ + "80 ./kernel-patches\n" \ + "12 ./tests/CVS\n" \ + "36 ./tests\n" \ + "12 ./scripts/CVS\n" \ + "16 ./scripts\n" \ + "12 ./docs/CVS\n" \ + "104 ./docs\n" \ + "2417 .\n" + +#define dumpkmap_trivial_usage \ + "> keymap" +#define dumpkmap_full_usage \ + "Print out a binary keyboard translation table to standard output" +#define dumpkmap_example_usage \ + "$ dumpkmap > keymap\n" + +#define dumpleases_trivial_usage \ + "[-r|-a] [-f LEASEFILE]" +#define dumpleases_full_usage \ + "Display DHCP leases granted by udhcpd" \ + "\n\nOptions:\n" \ + " -f, --file=FILENAME Leases file to load\n" \ + " -r, --remaining Interpret lease times as time remaining\n" \ + " -a, --absolute Interpret lease times as expire time" + +#define e2fsck_trivial_usage \ + "[-panyrcdfvstDFSV] [-b superblock] [-B blocksize] " \ + "[-I inode_buffer_blocks] [-P process_inode_size] " \ + "[-l|-L bad_blocks_file] [-C fd] [-j external_journal] " \ + "[-E extended-options] device" +#define e2fsck_full_usage \ + "Check ext2/ext3 file system" \ + "\n\nOptions:\n" \ + " -p Automatic repair (no questions)\n" \ + " -n Make no changes to the filesystem\n" \ + " -y Assume 'yes' to all questions\n" \ + " -c Check for bad blocks and add them to the badblock list\n" \ + " -f Force checking even if filesystem is marked clean\n" \ + " -v Be verbose\n" \ + " -b superblock Use alternative superblock\n" \ + " -B blocksize Force blocksize when looking for superblock\n" \ + " -j journal Set location of the external journal\n" \ + " -l file Add to badblocks list\n" \ + " -L file Set badblocks list" + +#define echo_trivial_usage \ + USE_FEATURE_FANCY_ECHO("[-neE] ") "[ARG ...]" +#define echo_full_usage \ + "Print the specified ARGs to stdout" \ + USE_FEATURE_FANCY_ECHO( \ + "\n\nOptions:\n" \ + " -n Suppress trailing newline\n" \ + " -e Interpret backslash-escaped characters (i.e., \\t=tab)\n" \ + " -E Disable interpretation of backslash-escaped characters" \ + ) +#define echo_example_usage \ + "$ echo \"Erik is cool\"\n" \ + "Erik is cool\n" \ + USE_FEATURE_FANCY_ECHO("$ echo -e \"Erik\\nis\\ncool\"\n" \ + "Erik\n" \ + "is\n" \ + "cool\n" \ + "$ echo \"Erik\\nis\\ncool\"\n" \ + "Erik\\nis\\ncool\n") + +#define eject_trivial_usage \ + "[-t] [-T] [DEVICE]" +#define eject_full_usage \ + "Eject specified DEVICE (or default /dev/cdrom)" \ + "\n\nOptions:\n" \ + " -t Close tray\n" \ + " -T Open/close tray (toggle)" + +#define ed_trivial_usage "" +#define ed_full_usage "" + +#define env_trivial_usage \ + "[-iu] [-] [name=value]... [command]" +#define env_full_usage \ + "Print the current environment or run a program after setting\n" \ + "up the specified environment" \ + "\n\nOptions:\n" \ + " -, -i Start with an empty environment\n" \ + " -u Remove variable from the environment" + +#define ether_wake_trivial_usage \ + "[-b] [-i iface] [-p aa:bb:cc:dd[:ee:ff]] MAC" +#define ether_wake_full_usage \ + "Send a magic packet to wake up sleeping machines.\n" \ + "MAC must be a station address (00:11:22:33:44:55) or\n" \ + "a hostname with a known 'ethers' entry." \ + "\n\nOptions:\n" \ + " -b Send wake-up packet to the broadcast address\n" \ + " -i iface Use interface ifname instead of the default \"eth0\"\n" \ + " -p pass Append the four or six byte password PW to the packet" + +#define expr_trivial_usage \ + "EXPRESSION" +#define expr_full_usage \ + "Print the value of EXPRESSION to standard output.\n\n" \ + "EXPRESSION may be:\n" \ + " ARG1 | ARG2 ARG1 if it is neither null nor 0, otherwise ARG2\n" \ + " ARG1 & ARG2 ARG1 if neither argument is null or 0, otherwise 0\n" \ + " ARG1 < ARG2 ARG1 is less than ARG2\n" \ + " ARG1 <= ARG2 ARG1 is less than or equal to ARG2\n" \ + " ARG1 = ARG2 ARG1 is equal to ARG2\n" \ + " ARG1 != ARG2 ARG1 is unequal to ARG2\n" \ + " ARG1 >= ARG2 ARG1 is greater than or equal to ARG2\n" \ + " ARG1 > ARG2 ARG1 is greater than ARG2\n" \ + " ARG1 + ARG2 Sum of ARG1 and ARG2\n" \ + " ARG1 - ARG2 Difference of ARG1 and ARG2\n" \ + " ARG1 * ARG2 Product of ARG1 and ARG2\n" \ + " ARG1 / ARG2 Quotient of ARG1 divided by ARG2\n" \ + " ARG1 % ARG2 Remainder of ARG1 divided by ARG2\n" \ + " STRING : REGEXP Anchored pattern match of REGEXP in STRING\n" \ + " match STRING REGEXP Same as STRING : REGEXP\n" \ + " substr STRING POS LENGTH Substring of STRING, POS counted from 1\n" \ + " index STRING CHARS Index in STRING where any CHARS is found, or 0\n" \ + " length STRING Length of STRING\n" \ + " quote TOKEN Interpret TOKEN as a string, even if\n" \ + " it is a keyword like 'match' or an\n" \ + " operator like '/'\n" \ + " (EXPRESSION) Value of EXPRESSION\n\n" \ + "Beware that many operators need to be escaped or quoted for shells.\n" \ + "Comparisons are arithmetic if both ARGs are numbers, else\n" \ + "lexicographical. Pattern matches return the string matched between\n" \ + "\\( and \\) or null; if \\( and \\) are not used, they return the number\n" \ + "of characters matched or 0." + +#define fakeidentd_trivial_usage \ + "[-fiw] [-b ADDR] [STRING]" +#define fakeidentd_full_usage \ + "Provide fake ident (auth) service" \ + "\n\nOptions:" \ + "\n -f Run in foreground" \ + "\n -i Inetd mode" \ + "\n -w Inetd 'wait' mode" \ + "\n -b ADDR Bind to specified address" \ + "\n STRING Ident answer string (default is 'nobody')" + +#define false_trivial_usage \ + "" +#define false_full_usage \ + "Return an exit code of FALSE (1)" +#define false_example_usage \ + "$ false\n" \ + "$ echo $?\n" \ + "1\n" + +#define fbset_trivial_usage \ + "[options] [mode]" +#define fbset_full_usage \ + "Show and modify frame buffer settings" +#define fbset_example_usage \ + "$ fbset\n" \ + "mode \"1024x768-76\"\n" \ + " # D: 78.653 MHz, H: 59.949 kHz, V: 75.694 Hz\n" \ + " geometry 1024 768 1024 768 16\n" \ + " timings 12714 128 32 16 4 128 4\n" \ + " accel false\n" \ + " rgba 5/11,6/5,5/0,0/0\n" \ + "endmode\n" + +#define fdflush_trivial_usage \ + "DEVICE" +#define fdflush_full_usage \ + "Force floppy disk drive to detect disk change" + +#define fdformat_trivial_usage \ + "[-n] DEVICE" +#define fdformat_full_usage \ + "Format floppy disk" \ + "\n\nOptions:\n" \ + " -n Don't verify after format" + +#define fdisk_trivial_usage \ + "[-luv] [-C CYLINDERS] [-H HEADS] [-S SECTORS] [-b SSZ] DISK" +#define fdisk_full_usage \ + "Change partition table" \ + "\n\nOptions:\n" \ + " -l List partition table(s)\n" \ + " -u Give Start and End in sector (instead of cylinder) units\n" \ + " -s PARTITION Give partition size(s) in blocks\n" \ + " -b 2048 (for certain MO disks) use 2048-byte sectors\n" \ + " -C CYLINDERS Set the number of cylinders\n" \ + " -H HEADS Set the number of heads\n" \ + " -S SECTORS Set the number of sectors\n" \ + " -v Give fdisk version" + +#define find_trivial_usage \ + "[PATH...] [EXPRESSION]" +#define find_full_usage \ + "Search for files in a directory hierarchy. The default PATH is\n" \ + "the current directory; default EXPRESSION is '-print'\n" \ + "\nEXPRESSION may consist of:\n" \ + " -follow Dereference symlinks\n" \ + " -name PATTERN File name (leading directories removed) matches PATTERN\n" \ + " -print Print (default and assumed)" \ + USE_FEATURE_FIND_PRINT0( \ + "\n -print0 Delimit output with null characters rather than" \ + "\n newlines" \ + ) USE_FEATURE_FIND_TYPE( \ + "\n -type X Filetype matches X (where X is one of: f,d,l,b,c,...)" \ + ) USE_FEATURE_FIND_PERM( \ + "\n -perm PERMS Permissions match any of (+NNN); all of (-NNN);" \ + "\n or exactly (NNN)" \ + ) USE_FEATURE_FIND_MTIME( \ + "\n -mtime DAYS Modified time is greater than (+N); less than (-N);" \ + "\n Or exactly (N) days" \ + ) USE_FEATURE_FIND_MMIN( \ + "\n -mmin MINS Modified time is greater than (+N); less than (-N);" \ + "\n or exactly (N) minutes" \ + ) USE_FEATURE_FIND_NEWER( \ + "\n -newer FILE Modified time is more recent than FILE's" \ + ) USE_FEATURE_FIND_INUM( \ + "\n -inum N File has inode number N" \ + ) USE_FEATURE_FIND_EXEC( \ + "\n -exec CMD Execute CMD with all instances of {} replaced by the" \ + "\n files matching EXPRESSION" \ + ) USE_DESKTOP( \ + "\n -size N File size is N" \ + "\n -prune Stop traversing current subtree" \ + "\n (expr) Group" \ + ) + +#define find_example_usage \ + "$ find / -name passwd\n" \ + "/etc/passwd\n" + +#define fold_trivial_usage \ + "[-bs] [-w WIDTH] [FILE]" +#define fold_full_usage \ + "Wrap input lines in each FILE (standard input by default), writing to\n" \ + "standard output" \ + "\n\nOptions:\n" \ + " -b Count bytes rather than columns\n" \ + " -s Break at spaces\n" \ + " -w Use WIDTH columns instead of 80" + +#define free_trivial_usage \ + "" +#define free_full_usage \ + "Display the amount of free and used system memory" +#define free_example_usage \ + "$ free\n" \ + " total used free shared buffers\n" \ + " Mem: 257628 248724 8904 59644 93124\n" \ + " Swap: 128516 8404 120112\n" \ + "Total: 386144 257128 129016\n" \ + +#define freeramdisk_trivial_usage \ + "DEVICE" +#define freeramdisk_full_usage \ + "Free all memory used by the specified ramdisk" +#define freeramdisk_example_usage \ + "$ freeramdisk /dev/ram2\n" + +#define fsck_trivial_usage \ + "[-ANPRTV] [ -C fd ] [-t fstype] [fs-options] [filesys ...]" +#define fsck_full_usage \ + "Check and repair filesystems" \ + "\n\nOptions:\n" \ + " -A Walk /etc/fstab and check all filesystems\n" \ + " -N Don't execute, just show what would be done\n" \ + " -P When using -A, check filesystems in parallel\n" \ + " -R When using -A, skip the root filesystem\n" \ + " -T Don't show title on startup\n" \ + " -V Verbose\n" \ + " -C n Write status information to specified filedescriptor\n" \ + " -t type List of filesystem types to check" + +#define fsck_minix_trivial_usage \ + "[-larvsmf] /dev/name" +#define fsck_minix_full_usage \ + "Perform a consistency check for MINIX filesystems" \ + "\n\nOptions:\n" \ + " -l Lists all filenames\n" \ + " -r Perform interactive repairs\n" \ + " -a Perform automatic repairs\n" \ + " -v Verbose\n" \ + " -s Outputs super-block information\n" \ + " -m Activates MINIX-like \"mode not cleared\" warnings\n" \ + " -f Force file system check" + +#define ftpget_trivial_usage \ + "[options] remote-host local-file remote-file" +#define ftpget_full_usage \ + "Retrieve a remote file via FTP" \ + "\n\nOptions:\n" \ + " -c, --continue Continue a previous transfer\n" \ + " -v, --verbose Verbose\n" \ + " -u, --username Username to be used\n" \ + " -p, --password Password to be used\n" \ + " -P, --port Port number to be used" + +#define ftpput_trivial_usage \ + "[options] remote-host remote-file local-file" +#define ftpput_full_usage \ + "Store a local file on a remote machine via FTP" \ + "\n\nOptions:\n" \ + " -v, --verbose Verbose\n" \ + " -u, --username Username to be used\n" \ + " -p, --password Password to be used\n" \ + " -P, --port Port number to be used" + +#define fuser_trivial_usage \ + "[options] file OR port/proto" +#define fuser_full_usage \ + "Options:\n" \ + " -m Show all processes on the same mounted fs\n" \ + " -k Kill all processes that match\n" \ + " -s Don't print or kill anything\n" \ + " -4 When using port/proto only search IPv4 space\n" \ + " -6 When using port/proto only search IPv6 space\n" \ + " -SIGNAL When used with -k, this signal will be used to kill" + +#define getenforce_trivial_usage +#define getenforce_full_usage + +#define getopt_trivial_usage \ + "[OPTIONS]..." +#define getopt_full_usage \ + "Parse command options\n" \ + " -a, --alternative Allow long options starting with single -\n" \ + " -l, --longoptions=longopts Long options to be recognized\n" \ + " -n, --name=progname The name under which errors are reported\n" \ + " -o, --options=optstring Short options to be recognized\n" \ + " -q, --quiet Disable error reporting by getopt(3)\n" \ + " -Q, --quiet-output No normal output\n" \ + " -s, --shell=shell Set shell quoting conventions\n" \ + " -T, --test Test for getopt(1) version\n" \ + " -u, --unquoted Do not quote the output" +#define getopt_example_usage \ + "$ cat getopt.test\n" \ + "#!/bin/sh\n" \ + "GETOPT=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \\\n" \ + " -n 'example.busybox' -- \"$@\"`\n" \ + "if [ $? != 0 ] ; then exit 1 ; fi\n" \ + "eval set -- \"$GETOPT\"\n" \ + "while true ; do\n" \ + " case $1 in\n" \ + " -a|--a-long) echo \"Option a\" ; shift ;;\n" \ + " -b|--b-long) echo \"Option b, argument '$2'\" ; shift 2 ;;\n" \ + " -c|--c-long)\n" \ + " case \"$2\" in\n" \ + " \"\") echo \"Option c, no argument\"; shift 2 ;;\n" \ + " *) echo \"Option c, argument '$2'\" ; shift 2 ;;\n" \ + " esac ;;\n" \ + " --) shift ; break ;;\n" \ + " *) echo \"Internal error!\" ; exit 1 ;;\n" \ + " esac\n" \ + "done\n" + +#define getsebool_trivial_usage \ + "-a or getsebool boolean..." +#define getsebool_full_usage \ + " -a Show all SELinux booleans" + +#define getty_trivial_usage \ + "[OPTIONS]... baud_rate,... line [termtype]" +#define getty_full_usage \ + "Open a tty, prompt for a login name, then invoke /bin/login" \ + "\n\nOptions:\n" \ + " -h Enable hardware (RTS/CTS) flow control\n" \ + " -i Do not display /etc/issue before running login\n" \ + " -L Local line, so do not do carrier detect\n" \ + " -m Get baud rate from modem's CONNECT status message\n" \ + " -w Wait for a CR or LF before sending /etc/issue\n" \ + " -n Do not prompt the user for a login name\n" \ + " -f issue_file Display issue_file instead of /etc/issue\n" \ + " -l login_app Invoke login_app instead of /bin/login\n" \ + " -t timeout Terminate after timeout if no username is read\n" \ + " -I initstring Sets the init string to send before anything else\n" \ + " -H login_host Log login_host into the utmp file as the hostname" + +#define grep_trivial_usage \ + "[-HhrilLnqvso" \ + USE_DESKTOP("w") \ + "eF" \ + USE_FEATURE_GREP_EGREP_ALIAS("E") \ + USE_FEATURE_GREP_CONTEXT("ABC") \ + "] PATTERN [FILEs...]" +#define grep_full_usage \ + "Search for PATTERN in each FILE or standard input" \ + "\n\nOptions:" \ + "\n -H Prefix output lines with filename where match was found" \ + "\n -h Suppress the prefixing filename on output" \ + "\n -r Recurse subdirectories" \ + "\n -i Ignore case distinctions" \ + "\n -l List names of files that match" \ + "\n -L List names of files that do not match" \ + "\n -n Print line number with output lines" \ + "\n -q Be quiet. Returns 0 if PATTERN was found, 1 otherwise" \ + "\n -v Select non-matching lines" \ + "\n -s Suppress file open/read error messages" \ + "\n -c Only print count of matching lines" \ + "\n -f Read PATTERN from file" \ + "\n -o Show only the part of a line that matches PATTERN" \ + USE_DESKTOP( \ + "\n -w Match whole words only") \ + "\n -e PATTERN is a regular expression" \ + "\n -F PATTERN is a set of newline-separated strings" \ + USE_FEATURE_GREP_EGREP_ALIAS( \ + "\n -E PATTERN is an extended regular expression") \ + USE_FEATURE_GREP_CONTEXT( \ + "\n -A Print NUM lines of trailing context" \ + "\n -B Print NUM lines of leading context" \ + "\n -C Print NUM lines of output context") \ + +#define grep_example_usage \ + "$ grep root /etc/passwd\n" \ + "root:x:0:0:root:/root:/bin/bash\n" \ + "$ grep ^[rR]oo. /etc/passwd\n" \ + "root:x:0:0:root:/root:/bin/bash\n" + +#define gunzip_trivial_usage \ + "[OPTION]... FILE" +#define gunzip_full_usage \ + "Uncompress FILE (or standard input if FILE is '-')" \ + "\n\nOptions:\n" \ + " -c Write output to standard output\n" \ + " -f Force read when source is a terminal\n" \ + " -t Test compressed file integrity" +#define gunzip_example_usage \ + "$ ls -la /tmp/BusyBox*\n" \ + "-rw-rw-r-- 1 andersen andersen 557009 Apr 11 10:55 /tmp/BusyBox-0.43.tar.gz\n" \ + "$ gunzip /tmp/BusyBox-0.43.tar.gz\n" \ + "$ ls -la /tmp/BusyBox*\n" \ + "-rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar\n" + +#define gzip_trivial_usage \ + "[OPTION]... [FILE]..." +#define gzip_full_usage \ + "Compress FILE(s) with maximum compression.\n" \ + "When FILE is '-' or unspecified, reads standard input. Implies -c." \ + "\n\nOptions:\n" \ + " -c Write output to standard output instead of FILE.gz\n" \ + " -d Decompress\n" \ + " -f Force write when destination is a terminal" +#define gzip_example_usage \ + "$ ls -la /tmp/busybox*\n" \ + "-rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/busybox.tar\n" \ + "$ gzip /tmp/busybox.tar\n" \ + "$ ls -la /tmp/busybox*\n" \ + "-rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/busybox.tar.gz\n" + +#define halt_trivial_usage \ + "[-d] [-n] [-f]" +#define halt_full_usage \ + "Halt the system" \ + "\n\nOptions:\n" \ + " -d Delay interval for halting\n" \ + " -n No call to sync()\n" \ + " -f Force halt (don't go through init)" + +#define hdparm_trivial_usage \ + "[options] [device] .." +#define hdparm_full_usage \ + USE_FEATURE_HDPARM_GET_IDENTITY( \ + "If no device name is specified try to read from stdin.\n\n") \ + "Options:\n" \ + " -a Get/set fs readahead\n" \ + " -A Set drive read-lookahead flag (0/1)\n" \ + " -b Get/set bus state (0 == off, 1 == on, 2 == tristate)\n" \ + " -B Set Advanced Power Management setting (1-255)\n" \ + " -c Get/set IDE 32-bit IO setting\n" \ + " -C Check IDE power mode status\n" \ + USE_FEATURE_HDPARM_HDIO_GETSET_DMA( \ + " -d Get/set using_dma flag\n") \ + " -D Enable/disable drive defect-mgmt\n" \ + " -f Flush buffer cache for device on exit\n" \ + " -g Display drive geometry\n" \ + " -h Display terse usage information\n" \ + USE_FEATURE_HDPARM_GET_IDENTITY( \ + " -i Display drive identification\n") \ + USE_FEATURE_HDPARM_GET_IDENTITY( \ + " -I Detailed/current information directly from drive\n") \ + " -k Get/set keep_settings_over_reset flag (0/1)\n" \ + " -K Set drive keep_features_over_reset flag (0/1)\n" \ + " -L Set drive doorlock (0/1) (removable harddisks only)\n" \ + " -m Get/set multiple sector count\n" \ + " -n Get/set ignore-write-errors flag (0/1)\n" \ + " -p Set PIO mode on IDE interface chipset (0,1,2,3,4,...)\n" \ + " -P Set drive prefetch count\n" \ + " -q Change next setting quietly\n" \ + " -Q Get/set DMA tagged-queuing depth (if supported)\n" \ + " -r Get/set readonly flag (DANGEROUS to set)\n" \ + USE_FEATURE_HDPARM_HDIO_SCAN_HWIF( \ + " -R Register an IDE interface (DANGEROUS)\n") \ + " -S Set standby (spindown) timeout\n" \ + " -t Perform device read timings\n" \ + " -T Perform cache read timings\n" \ + " -u Get/set unmaskirq flag (0/1)\n" \ + USE_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF( \ + " -U Un-register an IDE interface (DANGEROUS)\n") \ + " -v Defaults; same as -mcudkrag for IDE drives\n" \ + " -V Display program version and exit immediately\n" \ + USE_FEATURE_HDPARM_HDIO_DRIVE_RESET( \ + " -w Perform device reset (DANGEROUS)\n") \ + " -W Set drive write-caching flag (0/1) (DANGEROUS)\n" \ + USE_FEATURE_HDPARM_HDIO_TRISTATE_HWIF( \ + " -x Tristate device for hotswap (0/1) (DANGEROUS)\n") \ + " -X Set IDE xfer mode (DANGEROUS)\n" \ + " -y Put IDE drive in standby mode\n" \ + " -Y Put IDE drive to sleep\n" \ + " -Z Disable Seagate auto-powersaving mode\n" \ + " -z Re-read partition table" + +#define head_trivial_usage \ + "[OPTION]... [FILE]..." +#define head_full_usage \ + "Print first 10 lines of each FILE to standard output.\n" \ + "With more than one FILE, precede each with a header giving the\n" \ + "file name. With no FILE, or when FILE is -, read standard input." \ + "\n\nOptions:" \ + "\n -n NUM Print first NUM lines instead of first 10" \ + USE_FEATURE_FANCY_HEAD( \ + "\n -c NUM Output the first NUM bytes" \ + "\n -q Never output headers giving file names" \ + "\n -v Always output headers giving file names") +#define head_example_usage \ + "$ head -n 2 /etc/passwd\n" \ + "root:x:0:0:root:/root:/bin/bash\n" \ + "daemon:x:1:1:daemon:/usr/sbin:/bin/sh\n" + +#define hexdump_trivial_usage \ + "[-[bcCdefnosvx]] [OPTION] FILE" +#define hexdump_full_usage \ + "Display file(s) or standard input in a user specified format" \ + "\n\nOptions:\n" \ + " -b One-byte octal display\n" \ + " -c One-byte character display\n" \ + " -C Canonical hex+ASCII, 16 bytes per line\n" \ + " -d Two-byte decimal display\n" \ + " -e FORMAT STRING\n" \ + " -f FORMAT FILE\n" \ + " -n LENGTH Interpret only length bytes of input\n" \ + " -o Two-byte octal display\n" \ + " -s OFFSET Skip offset bytes\n" \ + " -v Display all input data\n" \ + " -x Two-byte hexadecimal display" + +#define hostid_trivial_usage \ + "" +#define hostid_full_usage \ + "Print out a unique 32-bit identifier for the machine" + +#define hostname_trivial_usage \ + "[OPTION] {hostname | -F FILE}" +#define hostname_full_usage \ + "Get or set the hostname or DNS domain name. If a hostname is given\n" \ + "(or FILE with the -F parameter), the host name will be set." \ + "\n\nOptions:\n" \ + " -s Short\n" \ + " -i Addresses for the hostname\n" \ + " -d DNS domain name\n" \ + " -f Fully qualified domain name\n" \ + " -F FILE Use the contents of FILE to specify the hostname" +#define hostname_example_usage \ + "$ hostname\n" \ + "sage\n" + +#define httpd_trivial_usage \ + "[-c ]" \ + " [-p ]" \ + " [-i] [-f]" \ + USE_FEATURE_HTTPD_SETUID(" [-u user[:grp]]") \ + USE_FEATURE_HTTPD_BASIC_AUTH(" [-r ]") \ + USE_FEATURE_HTTPD_AUTH_MD5(" [-m pass]") \ + " [-h home]" \ + " [-d/-e ]" +#define httpd_full_usage \ + "Listen for incoming http server requests" \ + "\n\nOptions:\n" \ + " -c FILE Specifies configuration file. (default httpd.conf)\n" \ + " -p PORT Server port (default 80)\n" \ + " -i Assume that we are started from inetd\n" \ + " -f Do not daemonize\n" \ + USE_FEATURE_HTTPD_SETUID( \ + " -u USER[:GRP] Set uid/gid after binding to port\n") \ + USE_FEATURE_HTTPD_BASIC_AUTH( \ + " -r REALM Authentication Realm for Basic Authentication\n") \ + USE_FEATURE_HTTPD_AUTH_MD5( \ + " -m PASS Crypt PASS with md5 algorithm\n") \ + " -h HOME Specifies http HOME directory (default ./)\n" \ + " -e STRING HTML encode STRING\n" \ + " -d STRING URL decode STRING" + +#define hwclock_trivial_usage \ + "[-r|--show] [-s|--hctosys] [-w|--systohc]" \ + " [-l|--localtime] [-u|--utc]" \ + " [-f FILE]" +#define hwclock_full_usage \ + "Query and set a hardware clock (RTC)" \ + "\n\nOptions:\n" \ + " -r Read hardware clock and print result\n" \ + " -s Set the system time from the hardware clock\n" \ + " -w Set the hardware clock to the current system time\n" \ + " -u The hardware clock is kept in coordinated universal time\n" \ + " -l The hardware clock is kept in local time\n" \ + " -f FILE Use the specified clock (e.g. /dev/rtc2)" + +#define id_trivial_usage \ + "[OPTIONS]... [USERNAME]" +#define id_full_usage \ + "Print information for USERNAME or the current user" \ + "\n\nOptions:\n" \ + USE_SELINUX( \ + " -Z prints only the security context\n" \ + ) \ + " -g Prints only the group ID\n" \ + " -u Prints only the user ID\n" \ + " -n Print a name instead of a number\n" \ + " -r Prints the real user ID instead of the effective ID" +#define id_example_usage \ + "$ id\n" \ + "uid=1000(andersen) gid=1000(andersen)\n" + +#define ifconfig_trivial_usage \ + USE_FEATURE_IFCONFIG_STATUS("[-a]") " [
]" +#define ifconfig_full_usage \ + "Configure a network interface" \ + "\n\nOptions:\n" \ + USE_FEATURE_IPV6( \ + " [add
[/]]\n") \ + USE_FEATURE_IPV6( \ + " [del
[/]]\n") \ + " [[-]broadcast [
]] [[-]pointopoint [
]]\n" \ + " [netmask
] [dstaddr
]\n" \ + USE_FEATURE_IFCONFIG_SLIP( \ + " [outfill ] [keepalive ]\n") \ + " " USE_FEATURE_IFCONFIG_HW("[hw ether
] ") "[metric ] [mtu ]\n" \ + " [[-]trailers] [[-]arp] [[-]allmulti]\n" \ + " [multicast] [[-]promisc] [txqueuelen ] [[-]dynamic]\n" \ + USE_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ( \ + " [mem_start ] [io_addr ] [irq ]\n") \ + " [up|down] ..." + +#define ifup_trivial_usage \ + "<-ahinv> " +#define ifup_full_usage \ + "Options:\n" \ + " -a De/configure all interfaces automatically\n" \ + " -i FILE Use FILE for interface definitions\n" \ + " -n Print out what would happen, but don't do it\n" \ + " (note that this option doesn't disable mappings)\n" \ + " -v Print out what would happen before doing it\n" \ + " -m Don't run any mappings\n" \ + " -f Force de/configuration" + +#define ifdown_trivial_usage \ + "<-ahinv> " +#define ifdown_full_usage \ + "Options:\n" \ + " -a De/configure all interfaces automatically\n" \ + " -i FILE Use FILE for interface definitions\n" \ + " -n Print out what would happen, but don't do it\n" \ + " (note that this option doesn't disable mappings)\n" \ + " -v Print out what would happen before doing it\n" \ + " -m Don't run any mappings\n" \ + " -f Force de/configuration" + +#define inetd_trivial_usage \ + "[-f] [-q len] [conf]" +#define inetd_full_usage \ + "Listen for network connections and launch programs" \ + "\n\nOptions:\n" \ + " -f Run in foreground\n" \ + " -q N Set the size of the socket listen queue to N\n" \ + " (default: 128)" + +#define init_trivial_usage \ + "" +#define init_full_usage \ + "Init is the parent of all processes" +#define init_notes_usage \ +"This version of init is designed to be run only by the kernel.\n" \ +"\n" \ +"BusyBox init doesn't support multiple runlevels. The runlevels field of\n" \ +"the /etc/inittab file is completely ignored by BusyBox init. If you want\n" \ +"runlevels, use sysvinit.\n" \ +"\n" \ +"BusyBox init works just fine without an inittab. If no inittab is found,\n" \ +"it has the following default behavior:\n" \ +"\n" \ +" ::sysinit:/etc/init.d/rcS\n" \ +" ::askfirst:/bin/sh\n" \ +" ::ctrlaltdel:/sbin/reboot\n" \ +" ::shutdown:/sbin/swapoff -a\n" \ +" ::shutdown:/bin/umount -a -r\n" \ +" ::restart:/sbin/init\n" \ +"\n" \ +"if it detects that /dev/console is _not_ a serial console, it will also run:\n" \ +"\n" \ +" tty2::askfirst:/bin/sh\n" \ +" tty3::askfirst:/bin/sh\n" \ +" tty4::askfirst:/bin/sh\n" \ +"\n" \ +"If you choose to use an /etc/inittab file, the inittab entry format is as follows:\n" \ +"\n" \ +" :::\n" \ +"\n" \ +" :\n" \ +"\n" \ +" WARNING: This field has a non-traditional meaning for BusyBox init!\n" \ +" The id field is used by BusyBox init to specify the controlling tty for\n" \ +" the specified process to run on. The contents of this field are\n" \ +" appended to \"/dev/\" and used as-is. There is no need for this field to\n" \ +" be unique, although if it isn't you may have strange results. If this\n" \ +" field is left blank, the controlling tty is set to the console. Also\n" \ +" note that if BusyBox detects that a serial console is in use, then only\n" \ +" entries whose controlling tty is either the serial console or /dev/null\n" \ +" will be run. BusyBox init does nothing with utmp. We don't need no\n" \ +" stinkin' utmp.\n" \ +"\n" \ +" :\n" \ +"\n" \ +" The runlevels field is completely ignored.\n" \ +"\n" \ +" :\n" \ +"\n" \ +" Valid actions include: sysinit, respawn, askfirst, wait,\n" \ +" once, restart, ctrlaltdel, and shutdown.\n" \ +"\n" \ +" The available actions can be classified into two groups: actions\n" \ +" that are run only once, and actions that are re-run when the specified\n" \ +" process exits.\n" \ +"\n" \ +" Run only-once actions:\n" \ +"\n" \ +" 'sysinit' is the first item run on boot. init waits until all\n" \ +" sysinit actions are completed before continuing. Following the\n" \ +" completion of all sysinit actions, all 'wait' actions are run.\n" \ +" 'wait' actions, like 'sysinit' actions, cause init to wait until\n" \ +" the specified task completes. 'once' actions are asynchronous,\n" \ +" therefore, init does not wait for them to complete. 'restart' is\n" \ +" the action taken to restart the init process. By default this should\n" \ +" simply run /sbin/init, but can be a script which runs pivot_root or it\n" \ +" can do all sorts of other interesting things. The 'ctrlaltdel' init\n" \ +" actions are run when the system detects that someone on the system\n" \ +" console has pressed the CTRL-ALT-DEL key combination. Typically one\n" \ +" wants to run 'reboot' at this point to cause the system to reboot.\n" \ +" Finally the 'shutdown' action specifies the actions to taken when\n" \ +" init is told to reboot. Unmounting filesystems and disabling swap\n" \ +" is a very good here.\n" \ +"\n" \ +" Run repeatedly actions:\n" \ +"\n" \ +" 'respawn' actions are run after the 'once' actions. When a process\n" \ +" started with a 'respawn' action exits, init automatically restarts\n" \ +" it. Unlike sysvinit, BusyBox init does not stop processes from\n" \ +" respawning out of control. The 'askfirst' actions acts just like\n" \ +" respawn, except that before running the specified process it\n" \ +" displays the line \"Please press Enter to activate this console.\"\n" \ +" and then waits for the user to press enter before starting the\n" \ +" specified process.\n" \ +"\n" \ +" Unrecognized actions (like initdefault) will cause init to emit an\n" \ +" error message, and then go along with its business. All actions are\n" \ +" run in the order they appear in /etc/inittab.\n" \ +"\n" \ +" :\n" \ +"\n" \ +" Specifies the process to be executed and its command line.\n" \ +"\n" \ +"Example /etc/inittab file:\n" \ +"\n" \ +" # This is run first except when booting in single-user mode\n" \ +" #\n" \ +" ::sysinit:/etc/init.d/rcS\n" \ +" \n" \ +" # /bin/sh invocations on selected ttys\n" \ +" #\n" \ +" # Start an \"askfirst\" shell on the console (whatever that may be)\n" \ +" ::askfirst:-/bin/sh\n" \ +" # Start an \"askfirst\" shell on /dev/tty2-4\n" \ +" tty2::askfirst:-/bin/sh\n" \ +" tty3::askfirst:-/bin/sh\n" \ +" tty4::askfirst:-/bin/sh\n" \ +" \n" \ +" # /sbin/getty invocations for selected ttys\n" \ +" #\n" \ +" tty4::respawn:/sbin/getty 38400 tty4\n" \ +" tty5::respawn:/sbin/getty 38400 tty5\n" \ +" \n" \ +" \n" \ +" # Example of how to put a getty on a serial line (for a terminal)\n" \ +" #\n" \ +" #::respawn:/sbin/getty -L ttyS0 9600 vt100\n" \ +" #::respawn:/sbin/getty -L ttyS1 9600 vt100\n" \ +" #\n" \ +" # Example how to put a getty on a modem line\n" \ +" #::respawn:/sbin/getty 57600 ttyS2\n" \ +" \n" \ +" # Stuff to do when restarting the init process\n" \ +" ::restart:/sbin/init\n" \ +" \n" \ +" # Stuff to do before rebooting\n" \ +" ::ctrlaltdel:/sbin/reboot\n" \ +" ::shutdown:/bin/umount -a -r\n" \ +" ::shutdown:/sbin/swapoff -a\n" + +#define insmod_trivial_usage \ + "[OPTION]... MODULE [symbol=value]..." +#define insmod_full_usage \ + "Load the specified kernel modules into the kernel" \ + "\n\nOptions:\n" \ + " -f Force module to load into the wrong kernel version\n" \ + " -k Make module autoclean-able\n" \ + " -v Verbose output\n" \ + " -q Quiet output\n" \ + " -L Lock to prevent simultaneous loads of a module\n" \ + USE_FEATURE_INSMOD_LOAD_MAP( \ + " -m Output load map to stdout\n") \ + " -o NAME Set internal module name to NAME\n" \ + " -x Do not export externs" + +#define install_trivial_usage \ + "[-cgmops] [sources] " +#define install_full_usage \ + "Copy files and set attributes" \ + "\n\nOptions:\n" \ + " -c Copy the file, default\n" \ + " -d Create directories\n" \ + " -g Set group ownership\n" \ + " -m Set permission modes\n" \ + " -o Set ownership\n" \ + " -p Preserve date\n" \ + " -s Strip symbol tables" \ + USE_SELINUX( \ + "\n -Z Set security context of copy" \ + ) + +#define ip_trivial_usage \ + "[OPTIONS] {address | link | route | tunnel | rule} {COMMAND}" +#define ip_full_usage \ + "ip [OPTIONS] OBJECT {COMMAND}\n" \ + "where OBJECT := {link | addr | route | tunnel |rule}\n" \ + "OPTIONS := { -f[amily] { inet | inet6 | link } | -o[neline] }" + +#define ipaddr_trivial_usage \ + "{ {add|del} IFADDR dev STRING | {show|flush}\n" \ + " [ dev STRING ] [ to PREFIX ] }" +#define ipaddr_full_usage \ + "ipaddr {add|delete} IFADDR dev STRING\n" \ + "ipaddr {show|flush} [ dev STRING ] [ scope SCOPE-ID ]\n" \ + " [ to PREFIX ] [ label PATTERN ]\n" \ + " IFADDR := PREFIX | ADDR peer PREFIX\n" \ + " [ broadcast ADDR ] [ anycast ADDR ]\n" \ + " [ label STRING ] [ scope SCOPE-ID ]\n" \ + " SCOPE-ID := [ host | link | global | NUMBER ]" + +#define ipcalc_trivial_usage \ + "[OPTION]...
[[/]] [NETMASK]" +#define ipcalc_full_usage \ + "Calculate IP network settings from a IP address" \ + "\n\nOptions:" \ + "\n -b --broadcast Display calculated broadcast address" \ + "\n -n --network Display calculated network address" \ + "\n -m --netmask Display default netmask for IP" \ + USE_FEATURE_IPCALC_FANCY( \ + "\n -p --prefix Display the prefix for IP/NETMASK" \ + "\n -h --hostname Display first resolved host name" \ + "\n -s --silent Don't ever display error messages") + +#define ipcrm_trivial_usage \ + "[-[MQS] key] [-[mqs] id]" +#define ipcrm_full_usage \ + "The upper-case options MQS are used to remove a shared memory segment by a\n" \ + "segment by a shmkey value. The lower-case options mqs are used\n" \ + "to remove a segment by shmid value.\n" \ + "\n\nOptions:\n" \ + " -[mM] Remove the memory segment after the last detach\n" \ + " -[qQ] Remove the message queue\n" \ + " -[sS] Remove the semaphore" + +#define ipcs_trivial_usage \ + "[[-smq] -i shmid] | [[-asmq] [-tcplu]]" +#define ipcs_full_usage \ + " -i Specify a specific resource id\n" \ + "Resource specification:\n" \ + " -m Shared memory segments\n" \ + " -q Message queues\n" \ + " -s Semaphore arrays\n" \ + " -a All (default)\n" \ + "Output format:\n" \ + " -t Time\n" \ + " -c Creator\n" \ + " -p Pid\n" \ + " -l Limits\n" \ + " -u Summary" + +#define iplink_trivial_usage \ + "{ set DEVICE { up | down | arp { on | off } | show [ DEVICE ] }" +#define iplink_full_usage \ + "iplink set DEVICE { up | down | arp | multicast { on | off } |\n" \ + " dynamic { on | off } |\n" \ + " mtu MTU }\n" \ + "iplink show [ DEVICE ]" + +#define iproute_trivial_usage \ + "{ list | flush | { add | del | change | append |\n" \ + " replace | monitor } ROUTE }" +#define iproute_full_usage \ + "iproute { list | flush } SELECTOR\n" \ + "iproute get ADDRESS [ from ADDRESS iif STRING ]\n" \ + " [ oif STRING ] [ tos TOS ]\n" \ + "iproute { add | del | change | append | replace | monitor } ROUTE\n" \ + " SELECTOR := [ root PREFIX ] [ match PREFIX ] [ proto RTPROTO ]\n" \ + " ROUTE := [ TYPE ] PREFIX [ tos TOS ] [ proto RTPROTO ]" + +#define iprule_trivial_usage \ + "{[ list | add | del ] RULE}" +#define iprule_full_usage \ + "iprule [ list | add | del ] SELECTOR ACTION\n" \ + " SELECTOR := [ from PREFIX ] [ to PREFIX ] [ tos TOS ] [ fwmark FWMARK ]\n" \ + " [ dev STRING ] [ pref NUMBER ]\n" \ + " ACTION := [ table TABLE_ID ] [ nat ADDRESS ]\n" \ + " [ prohibit | reject | unreachable ]\n" \ + " [ realms [SRCREALM/]DSTREALM ]\n" \ + " TABLE_ID := [ local | main | default | NUMBER ]" + +#define iptunnel_trivial_usage \ + "{ add | change | del | show } [ NAME ]\n" \ + " [ mode { ipip | gre | sit } ]\n" \ + " [ remote ADDR ] [ local ADDR ] [ ttl TTL ]" +#define iptunnel_full_usage \ + "iptunnel { add | change | del | show } [ NAME ]\n" \ + " [ mode { ipip | gre | sit } ] [ remote ADDR ] [ local ADDR ]\n" \ + " [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n" \ + " [ ttl TTL ] [ tos TOS ] [ [no]pmtudisc ] [ dev PHYS_DEV ]" + +#define kill_trivial_usage \ + "[-l] [-signal] process-id [process-id ...]" +#define kill_full_usage \ + "Send a signal (default is TERM) to the specified process(es)" \ + "\n\nOptions:\n" \ + " -l List all signal names and numbers" +#define kill_example_usage \ + "$ ps | grep apache\n" \ + "252 root root S [apache]\n" \ + "263 www-data www-data S [apache]\n" \ + "264 www-data www-data S [apache]\n" \ + "265 www-data www-data S [apache]\n" \ + "266 www-data www-data S [apache]\n" \ + "267 www-data www-data S [apache]\n" \ + "$ kill 252\n" + +#define killall_trivial_usage \ + "[-l] [-q] [-signal] process-name [process-name ...]" +#define killall_full_usage \ + "Send a signal (default is TERM) to the specified process(es)" \ + "\n\nOptions:\n" \ + " -l List all signal names and numbers\n" \ + " -q Do not complain if no processes were killed" +#define killall_example_usage \ + "$ killall apache\n" + +#define killall5_trivial_usage \ + "[-l] [-signal]" +#define killall5_full_usage \ + "Send a signal (default is TERM) to all processes outside current session" \ + "\n\nOptions:\n" \ + " -l List all signal names and numbers\n" \ + +#define klogd_trivial_usage \ + "[-c n] [-n]" +#define klogd_full_usage \ + "Kernel logger" \ + "\n\nOptions:\n" \ + " -c n Sets the default log level of console messages to n\n" \ + " -n Run as foreground process" + +#define length_trivial_usage \ + "STRING" +#define length_full_usage \ + "Print out the length of the specified STRING" +#define length_example_usage \ + "$ length Hello\n" \ + "5\n" + +#define less_trivial_usage \ + "[-EMNmh~?] FILE1 FILE2..." +#define less_full_usage \ + "View a file or list of files. The position within files can be\n" \ + "changed, and files can be manipulated in various ways." \ + "\n\nOptions:\n" \ + " -E Quit once the end of a file is reached\n" \ + " -M Display a status line containing the current line numbers\n" \ + " and the percentage through the file\n" \ + " -N Prefix line numbers to each line\n" \ + " -m Display a status line containing the percentage through the\n" \ + " file\n" \ + " -~ Suppress ~s displayed when input past the end of the file is\n" \ + " reached" + +#define setarch_trivial_usage \ + " [args ...]" +#define setarch_full_usage \ + "Personality may be:\n" \ + " linux32 Set 32bit uname emulation\n" \ + " linux64 Set 64bit uname emulation" + +#define ln_trivial_usage \ + "[OPTION] TARGET... LINK_NAME|DIRECTORY" +#define ln_full_usage \ + "Create a link named LINK_NAME or DIRECTORY to the specified TARGET.\n" \ + "You may use '--' to indicate that all following arguments are non-options." \ + "\n\nOptions:\n" \ + " -s Make symlinks instead of hardlinks\n" \ + " -f Remove existing destination files\n" \ + " -n No dereference symlinks - treat like normal file\n" \ + " -b Make a backup of the target (if exists) before link operation\n" \ + " -S suf Use suffix instead of ~ when making backup files" +#define ln_example_usage \ + "$ ln -s BusyBox /tmp/ls\n" \ + "$ ls -l /tmp/ls\n" \ + "lrwxrwxrwx 1 root root 7 Apr 12 18:39 ls -> BusyBox*\n" + +#define loadfont_trivial_usage \ + "< font" +#define loadfont_full_usage \ + "Load a console font from standard input" +#define loadfont_example_usage \ + "$ loadfont < /etc/i18n/fontname\n" + +#define loadkmap_trivial_usage \ + "< keymap" +#define loadkmap_full_usage \ + "Load a binary keyboard translation table from standard input" +#define loadkmap_example_usage \ + "$ loadkmap < /etc/i18n/lang-keymap\n" + +#define logger_trivial_usage \ + "[OPTION]... [MESSAGE]" +#define logger_full_usage \ + "Write MESSAGE to the system log. If MESSAGE is omitted, log stdin." \ + "\n\nOptions:\n" \ + " -s Log to stderr as well as the system log\n" \ + " -t TAG Log using the specified tag (defaults to user name)\n" \ + " -p PRIO Enter the message with the specified priority.\n" \ + " This may be numerical or a 'facility.level' pair." +#define logger_example_usage \ + "$ logger \"hello\"\n" + +#define login_trivial_usage \ + "[OPTION]... [username] [ENV=VAR ...]" +#define login_full_usage \ + "Begin a new session on the system" \ + "\n\nOptions:\n" \ + " -f Do not authenticate (user already authenticated)\n" \ + " -h Name of the remote host for this login\n" \ + " -p Preserve environment" + +#define logname_trivial_usage \ + "" +#define logname_full_usage \ + "Print the name of the current user" +#define logname_example_usage \ + "$ logname\n" \ + "root\n" + +#define logread_trivial_usage \ + "[OPTION]..." +#define logread_full_usage \ + "Show the messages from syslogd (using circular buffer)" \ + "\n\nOptions:\n" \ + " -f Output data as the log grows" + +#define losetup_trivial_usage \ + "[-o OFFSET] [-d] LOOPDEVICE [FILE]]" +#define losetup_full_usage \ + "(Dis)associate LOOPDEVICE with FILE, or display current associations" \ + "\n\nOptions:\n" \ + " -d Disassociate LOOPDEVICE\n" \ + " -o OFFSET Start OFFSET bytes into FILE" +#define losetup_notes_usage \ + "No arguments will display all current associations.\n" \ + "One argument (losetup /dev/loop1) will display the current association\n" \ + "(if any), or disassociate it (with -d). The display shows the offset\n" \ + "and filename of the file the loop device is currently bound to.\n\n" \ + "Two arguments (losetup /dev/loop1 file.img) create a new association,\n" \ + "with an optional offset (-o 12345). Encryption is not yet supported.\n\n" + +#define ls_trivial_usage \ + "[-1Aa" USE_FEATURE_LS_TIMESTAMPS("c") "Cd" \ + USE_FEATURE_LS_TIMESTAMPS("e") USE_FEATURE_LS_FILETYPES("F") "iln" \ + USE_FEATURE_LS_FILETYPES("p") USE_FEATURE_LS_FOLLOWLINKS("L") \ + USE_FEATURE_LS_RECURSIVE("R") USE_FEATURE_LS_SORTFILES("rS") "s" \ + USE_FEATURE_AUTOWIDTH("T") USE_FEATURE_LS_TIMESTAMPS("tu") \ + USE_FEATURE_LS_SORTFILES("v") USE_FEATURE_AUTOWIDTH("w") "x" \ + USE_FEATURE_LS_SORTFILES("X") USE_FEATURE_HUMAN_READABLE("h") "k" \ + USE_SELINUX("K") "] [filenames...]" +#define ls_full_usage \ + "List directory contents" \ + "\n\nOptions:" \ + "\n -1 List files in a single column" \ + "\n -A Do not list implied . and .." \ + "\n -a Do not hide entries starting with ." \ + "\n -C List entries by columns" \ + USE_FEATURE_LS_TIMESTAMPS( \ + "\n -c With -l: show ctime") \ + USE_FEATURE_LS_COLOR( \ + "\n --color[={always,never,auto}] Control coloring") \ + "\n -d List directory entries instead of contents" \ + USE_FEATURE_LS_TIMESTAMPS( \ + "\n -e List both full date and full time") \ + USE_FEATURE_LS_FILETYPES( \ + "\n -F Append indicator (one of */=@|) to entries") \ + "\n -i List the i-node for each file" \ + "\n -l Use a long listing format" \ + "\n -n List numeric UIDs and GIDs instead of names" \ + USE_FEATURE_LS_FILETYPES( \ + "\n -p Append indicator (one of /=@|) to entries") \ + USE_FEATURE_LS_FOLLOWLINKS( \ + "\n -L List entries pointed to by symlinks") \ + USE_FEATURE_LS_RECURSIVE( \ + "\n -R List subdirectories recursively") \ + USE_FEATURE_LS_SORTFILES( \ + "\n -r Sort the listing in reverse order") \ + USE_FEATURE_LS_SORTFILES( \ + "\n -S Sort the listing by file size") \ + "\n -s List the size of each file, in blocks" \ + USE_FEATURE_AUTOWIDTH( \ + "\n -T NUM Assume Tabstop every NUM columns") \ + USE_FEATURE_LS_TIMESTAMPS( \ + "\n -t With -l: show modification time") \ + USE_FEATURE_LS_TIMESTAMPS( \ + "\n -u With -l: show access time") \ + USE_FEATURE_LS_SORTFILES( \ + "\n -v Sort the listing by version") \ + USE_FEATURE_AUTOWIDTH( \ + "\n -w NUM Assume the terminal is NUM columns wide") \ + "\n -x List entries by lines instead of by columns" \ + USE_FEATURE_LS_SORTFILES( \ + "\n -X Sort the listing by extension") \ + USE_FEATURE_HUMAN_READABLE( \ + "\n -h Print sizes in human readable format (e.g., 1K 243M 2G)") \ + USE_SELINUX( \ + "\n -k Print security context") \ + USE_SELINUX( \ + "\n -K Print security context in long format") \ + USE_SELINUX( \ + "\n -Z Print security context and permission") + +#define lsattr_trivial_usage \ + "[-Radlv] [files...]" +#define lsattr_full_usage \ + "List file attributes on an ext2 fs" \ + "\n\nOptions:\n" \ + " -R Recursively list subdirectories\n" \ + " -a Do not hide entries starting with .\n" \ + " -d List directory entries instead of contents\n" \ + " -l Print long flag names\n" \ + " -v List the file's version/generation number" + +#define lsmod_trivial_usage \ + "" +#define lsmod_full_usage \ + "List the currently loaded kernel modules" + +#ifdef CONFIG_FEATURE_MAKEDEVS_LEAF +#define makedevs_trivial_usage \ + "NAME TYPE MAJOR MINOR FIRST LAST [s]" +#define makedevs_full_usage \ + "Create a range of block or character special files\n\n" \ + "TYPEs include:\n" \ + " b: Make a block (buffered) device\n" \ + " c or u: Make a character (un-buffered) device\n" \ + " p: Make a named pipe. MAJOR and MINOR are ignored for named pipes\n" \ + "\n" \ + "FIRST specifies the number appended to NAME to create the first device.\n" \ + "LAST specifies the number of the last item that should be created\n" \ + "If 's' is the last argument, the base device is created as well.\n\n" \ + "For example:\n" \ + " makedevs /dev/ttyS c 4 66 2 63 -> ttyS2-ttyS63\n" \ + " makedevs /dev/hda b 3 0 0 8 s -> hda,hda1-hda8" +#define makedevs_example_usage \ + "# makedevs /dev/ttyS c 4 66 2 63\n" \ + "[creates ttyS2-ttyS63]\n" \ + "# makedevs /dev/hda b 3 0 0 8 s\n" \ + "[creates hda,hda1-hda8]\n" +#endif + +#ifdef CONFIG_FEATURE_MAKEDEVS_TABLE +#define makedevs_trivial_usage \ + "[-d device_table] rootdir" +#define makedevs_full_usage \ + "Create a range of special files as specified in a device table.\n" \ + "Device table entries take the form of:\n" \ + " \n" \ + "Where name is the file name, type can be one of:\n" \ + " f A regular file\n" \ + " d Directory\n" \ + " c Character special device file\n" \ + " b Block special device file\n" \ + " p Fifo (named pipe)\n" \ + "uid is the user id for the target file, gid is the group id for the\n" \ + "target file. The rest of the entries (major, minor, etc) apply to\n" \ + "to device special files. A '-' may be used for blank entries." +#define makedevs_example_usage \ + "For example:\n" \ + " \n" \ + "/dev d 755 0 0 - - - - -\n" \ + "/dev/console c 666 0 0 5 1 - - -\n" \ + "/dev/null c 666 0 0 1 3 0 0 -\n" \ + "/dev/zero c 666 0 0 1 5 0 0 -\n" \ + "/dev/hda b 640 0 0 3 0 0 0 -\n" \ + "/dev/hda b 640 0 0 3 1 1 1 15\n\n" \ + "Will Produce:\n" \ + "/dev\n" \ + "/dev/console\n" \ + "/dev/null\n" \ + "/dev/zero\n" \ + "/dev/hda\n" \ + "/dev/hda[0-15]\n" +#endif + +#define matchpathcon_trivial_usage \ + "[-n] [-N] [-f file_contexts_file] [-p prefix] [-V]" +#define matchpathcon_full_usage \ + " -n Do not display path" \ + "\n -N Do not use translations" \ + "\n -f Use alternate file_context file" \ + "\n -p Use prefix to speed translations" \ + "\n -V Verify file context on disk matches defaults" + +#define md5sum_trivial_usage \ + "[OPTION] [FILEs...]" \ + USE_FEATURE_MD5_SHA1_SUM_CHECK("\n or: md5sum [OPTION] -c [FILE]") +#define md5sum_full_usage \ + "Print" USE_FEATURE_MD5_SHA1_SUM_CHECK(" or check") " MD5 checksums" \ + "\n\nOptions:\n" \ + "With no FILE, or when FILE is -, read standard input." \ + USE_FEATURE_MD5_SHA1_SUM_CHECK("\n\n" \ + " -c Check MD5 sums against given list\n" \ + "\nThe following two options are useful only when verifying checksums:\n" \ + " -s Don't output anything, status code shows success\n" \ + " -w Warn about improperly formatted MD5 checksum lines") +#define md5sum_example_usage \ + "$ md5sum < busybox\n" \ + "6fd11e98b98a58f64ff3398d7b324003\n" \ + "$ md5sum busybox\n" \ + "6fd11e98b98a58f64ff3398d7b324003 busybox\n" \ + "$ md5sum -c -\n" \ + "6fd11e98b98a58f64ff3398d7b324003 busybox\n" \ + "busybox: OK\n" \ + "^D\n" + +#define mdev_trivial_usage \ + "[-s]" +#define mdev_full_usage \ + " -s Scan /sys and populate /dev during system boot\n\n" \ + "Called with no options (via hotplug) it uses environment variables\n" \ + "to determine which device to add/remove." +#define mdev_notes_usage "" \ + USE_FEATURE_MDEV_CONFIG( \ + "The mdev config file contains lines that look like:\n" \ + " hd[a-z][0-9]* 0:3 660\n\n" \ + "That's device name (with regex match), uid:gid, and permissions.\n\n" \ + USE_FEATURE_MDEV_EXEC( \ + "Optionally, that can be followed (on the same line) by a special character\n" \ + "and a command line to run after creating/before deleting the corresponding\n" \ + "device(s). The environment variable $MDEV indicates the active device node\n" \ + "(which is useful if it's a regex match). For example:\n\n" \ + " hdc root:cdrom 660 *ln -s $MDEV cdrom\n\n" \ + "The special characters are @ (run after creating), $ (run before deleting),\n" \ + "and * (run both after creating and before deleting). The commands run in\n" \ + "the /dev directory, and use system() which calls /bin/sh.\n\n" \ + ) \ + "Config file parsing stops on the first matching line. If no config\n"\ + "entry is matched, devices are created with default 0:0 660. (Make\n"\ + "the last line match .* to override this.)\n\n" \ + ) + +#define mesg_trivial_usage \ + "[y|n]" +#define mesg_full_usage \ + "Control write access to your terminal\n" \ + " y Allow write access to your terminal\n" \ + " n Disallow write access to your terminal" + +#define mkdir_trivial_usage \ + "[OPTION] DIRECTORY..." +#define mkdir_full_usage \ + "Create the DIRECTORY(ies) if they do not already exist" \ + "\n\nOptions:\n" \ + " -m Set permission mode (as in chmod), not rwxrwxrwx - umask\n" \ + " -p No error if existing, make parent directories as needed" \ + USE_SELINUX( \ + "\n -Z Set security context" \ + ) + +#define mkdir_example_usage \ + "$ mkdir /tmp/foo\n" \ + "$ mkdir /tmp/foo\n" \ + "/tmp/foo: File exists\n" \ + "$ mkdir /tmp/foo/bar/baz\n" \ + "/tmp/foo/bar/baz: No such file or directory\n" \ + "$ mkdir -p /tmp/foo/bar/baz\n" + +#define mke2fs_trivial_usage \ + "[-c|-l filename] [-b block-size] [-f fragment-size] [-g blocks-per-group] " \ + "[-i bytes-per-inode] [-j] [-J journal-options] [-N number-of-inodes] [-n] " \ + "[-m reserved-blocks-percentage] [-o creator-os] [-O feature[,...]] [-q] " \ + "[r fs-revision-level] [-E extended-options] [-v] [-F] [-L volume-label] " \ + "[-M last-mounted-directory] [-S] [-T filesystem-type] " \ + "device [blocks-count]" +#define mke2fs_full_usage \ + " -b size Block size in bytes\n" \ + " -c Check for bad blocks before creating\n" \ + " -E opts Set extended options\n" \ + " -f size Fragment size in bytes\n" \ + " -F Force (ignore sanity checks)\n" \ + " -g num Number of blocks in a block group\n" \ + " -i ratio The bytes/inode ratio\n" \ + " -j Create a journal (ext3)\n" \ + " -J opts Set journal options (size/device)\n" \ + " -l file Read bad blocks list from file\n" \ + " -L lbl Set the volume label\n" \ + " -m percent Percent of fs blocks to reserve for admin\n" \ + " -M dir Set last mounted directory\n" \ + " -n Do not actually create anything\n" \ + " -N num Number of inodes to create\n" \ + " -o os Set the 'creator os' field\n" \ + " -O features Dir_index/filetype/has_journal/journal_dev/sparse_super\n" \ + " -q Quiet execution\n" \ + " -r rev Set filesystem revision\n" \ + " -S Write superblock and group descriptors only\n" \ + " -T fs-type Set usage type (news/largefile/largefile4)\n" \ + " -v Verbose execution" + +#define mkfifo_trivial_usage \ + "[OPTIONS] name" +#define mkfifo_full_usage \ + "Create a named pipe (identical to 'mknod name p')" \ + "\n\nOptions:\n" \ + " -m Create the pipe using the specified mode (default a=rw)" \ + USE_SELINUX( \ + "\n -Z Set security context" \ + ) + +#define mkfs_minix_trivial_usage \ + "[-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]" +#define mkfs_minix_full_usage \ + "Make a MINIX filesystem" \ + "\n\nOptions:\n" \ + " -c Check the device for bad blocks\n" \ + " -n [14|30] Specify the maximum length of filenames\n" \ + " -i INODES Specify the number of inodes for the filesystem\n" \ + " -l FILENAME Read the bad blocks list from FILENAME\n" \ + " -v Make a Minix version 2 filesystem" + +#define mknod_trivial_usage \ + "[OPTIONS] NAME TYPE MAJOR MINOR" +#define mknod_full_usage \ + "Create a special file (block, character, or pipe)" \ + "\n\nOptions:\n" \ + " -m Create the special file using the specified mode (default a=rw)" \ + "\n\nTYPEs include:\n" \ + " b: Make a block (buffered) device\n" \ + " c or u: Make a character (un-buffered) device\n" \ + " p: Make a named pipe. MAJOR and MINOR are ignored for named pipes" \ + USE_SELINUX( \ + "\n -Z Set security context" \ + ) + +#define mknod_example_usage \ + "$ mknod /dev/fd0 b 2 0\n" \ + "$ mknod -m 644 /tmp/pipe p\n" + +#define mkswap_trivial_usage \ + "[-c] [-v0|-v1] device [block-count]" +#define mkswap_full_usage \ + "Prepare a disk partition to be used as swap partition" \ + "\n\nOptions:\n" \ + " -c Check for read-ability\n" \ + " -v0 Make version 0 swap [max 128 Megs]\n" \ + " -v1 Make version 1 swap [big!] (default for kernels > 2.1.117)\n" \ + " block-count Number of block to use (default is entire partition)" + +#define mktemp_trivial_usage \ + "[-dq] TEMPLATE" +#define mktemp_full_usage \ + "Create a temporary file with its name based on TEMPLATE.\n" \ + "TEMPLATE is any name with six 'Xs' (i.e., /tmp/temp.XXXXXX)." \ + "\n\nOptions:\n" \ + " -d Make a directory instead of a file\n" \ + " -q Fail silently if an error occurs" +#define mktemp_example_usage \ + "$ mktemp /tmp/temp.XXXXXX\n" \ + "/tmp/temp.mWiLjM\n" \ + "$ ls -la /tmp/temp.mWiLjM\n" \ + "-rw------- 1 andersen andersen 0 Apr 25 17:10 /tmp/temp.mWiLjM\n" + +#define modprobe_trivial_usage \ + "[-knqrsv] MODULE [symbol=value ...]" +#define modprobe_full_usage \ + "Options:\n" \ + " -k Make module autoclean-able\n" \ + " -n Just show what would be done\n" \ + " -q Quiet output\n" \ + " -r Remove module (stacks) or do autoclean\n" \ + " -s Report via syslog instead of stderr\n" \ + " -v Verbose output" +#define modprobe_notes_usage \ +"modprobe can (un)load a stack of modules, passing each module options (when\n" \ +"loading). modprobe uses a configuration file to determine what option(s) to\n" \ +"pass each module it loads.\n" \ +"\n" \ +"The configuration file is searched (in order) amongst:\n" \ +"\n" \ +" /etc/modprobe.conf (2.6 only)\n" \ +" /etc/modules.conf\n" \ +" /etc/conf.modules (deprecated)\n" \ +"\n" \ +"They all have the same syntax (see below). If none is present, it is\n" \ +"_not_ an error; each loaded module is then expected to load without\n" \ +"options. Once a file is found, the others are tested for.\n" \ +"\n" \ +"/etc/modules.conf entry format:\n" \ +"\n" \ +" alias \n" \ +" Makes it possible to modprobe alias_name, when there is no such module.\n" \ +" It makes sense if your mod_name is long, or you want a more representative\n" \ +" name for that module (eg. 'scsi' in place of 'aha7xxx').\n" \ +" This makes it also possible to use a different set of options (below) for\n" \ +" the module and the alias.\n" \ +" A module can be aliased more than once.\n" \ +"\n" \ +" options \n" \ +" When loading module mod_name (or the module aliased by alias_name), pass\n" \ +" the \"symbol=value\" pairs as option to that module.\n" \ +"\n" \ +"Sample /etc/modules.conf file:\n" \ +"\n" \ +" options tulip irq=3\n" \ +" alias tulip tulip2\n" \ +" options tulip2 irq=4 io=0x308\n" \ +"\n" \ +"Other functionality offered by 'classic' modprobe is not available in\n" \ +"this implementation.\n" \ +"\n" \ +"If module options are present both in the config file, and on the command line,\n" \ +"then the options from the command line will be passed to the module _after_\n" \ +"the options from the config file. That way, you can have defaults in the config\n" \ +"file, and override them for a specific usage from the command line.\n" +#define modprobe_example_usage \ + "(with the above /etc/modules.conf):\n\n" \ + "$ modprobe tulip\n" \ + " will load the module 'tulip' with default option 'irq=3'\n\n" \ + "$ modprobe tulip irq=5\n" \ + " will load the module 'tulip' with option 'irq=5', thus overriding the default\n\n" \ + "$ modprobe tulip2\n" \ + " will load the module 'tulip' with default options 'irq=4 io=0x308',\n" \ + " which are the default for alias 'tulip2'\n\n" \ + "$ modprobe tulip2 irq=8\n" \ + " will load the module 'tulip' with default options 'irq=4 io=0x308 irq=8',\n" \ + " which are the default for alias 'tulip2' overridden by the option 'irq=8'\n\n" \ + " from the command line\n\n" \ + "$ modprobe tulip2 irq=2 io=0x210\n" \ + " will load the module 'tulip' with default options 'irq=4 io=0x308 irq=4 io=0x210',\n" \ + " which are the default for alias 'tulip2' overridden by the options 'irq=2 io=0x210'\n\n" \ + " from the command line\n" + +#define more_trivial_usage \ + "[FILE ...]" +#define more_full_usage \ + "View FILE or standard input one screenful at a time" +#define more_example_usage \ + "$ dmesg | more\n" + +#define mount_trivial_usage \ + "[flags] DEVICE NODE [-o options,more-options]" +#define mount_full_usage \ + "Mount a filesystem. Filesystem autodetection requires /proc be mounted." \ + "\n\nOptions:\n" \ + " -a Mount all filesystems in fstab\n" \ + USE_FEATURE_MTAB_SUPPORT( \ + " -f \"Fake\" Add entry to mount table but don't mount it\n" \ + " -n Don't write a mount table entry\n" \ + ) \ + " -o option One of many filesystem options, listed below\n" \ + " -r Mount the filesystem read-only\n" \ + " -t fs-type Specify the filesystem type\n" \ + " -w Mount for reading and writing (default)\n" \ + "\n" \ + "Options for use with the \"-o\" flag:\n" \ + USE_FEATURE_MOUNT_LOOP( \ + " loop Ignored (loop devices are autodetected)\n" \ + ) \ + USE_FEATURE_MOUNT_FLAGS( \ + " [a]sync Writes are asynchronous / synchronous\n" \ + " [no]atime Disable / enable updates to inode access times\n" \ + " [no]diratime Disable / enable atime updates to directories\n" \ + " [no]dev Allow use of special device files / disallow them\n" \ + " [no]exec Allow use of executable files / disallow them\n" \ + " [no]suid Allow set-user-id-root programs / disallow them\n" \ + " [r]shared Convert [recursively] to a shared subtree\n" \ + " [r]slave Convert [recursively] to a slave subtree\n" \ + " [r]private Convert [recursively] to a private subtree\n" \ + " [un]bindable Make mount point [un]able to be bind mounted\n" \ + " bind Bind a directory to an additional location\n" \ + " move Relocate an existing mount point\n" \ + ) \ + " remount Remount a mounted filesystem, changing its flags\n" \ + " ro/rw Mount for read-only / read-write\n" \ + "\n" \ + "There are EVEN MORE flags that are specific to each filesystem\n" \ + "You'll have to see the written documentation for those filesystems" +#define mount_example_usage \ + "$ mount\n" \ + "/dev/hda3 on / type minix (rw)\n" \ + "proc on /proc type proc (rw)\n" \ + "devpts on /dev/pts type devpts (rw)\n" \ + "$ mount /dev/fd0 /mnt -t msdos -o ro\n" \ + "$ mount /tmp/diskimage /opt -t ext2 -o loop\n" \ + "$ mount cd_image.iso mydir\n" +#define mount_notes_usage \ + "Returns 0 for success, number of failed mounts for -a, or errno for one mount." + +#define mountpoint_trivial_usage \ + "[-q] <[-d] DIR | -x DEVICE>" +#define mountpoint_full_usage \ + "mountpoint checks if the directory is a mountpoint" \ + "\n\nOptions:\n" \ + " -q Be more quiet\n" \ + " -d Print major/minor device number of the filesystem\n" \ + " -x Print major/minor device number of the blockdevice" +#define mountpoint_example_usage \ + "$ mountpoint /proc\n" \ + "/proc is not a mountpoint\n" \ + "$ mountpoint /sys\n" \ + "/sys is a mountpoint\n" + +#define mt_trivial_usage \ + "[-f device] opcode value" +#define mt_full_usage \ + "Control magnetic tape drive operation\n" \ + "\nAvailable Opcodes:\n\n" \ + "bsf bsfm bsr bss datacompression drvbuffer eof eom erase\n" \ + "fsf fsfm fsr fss load lock mkpart nop offline ras1 ras2\n" \ + "ras3 reset retension rewind rewoffline seek setblk setdensity\n" \ + "setpart tell unload unlock weof wset" + +#define mv_trivial_usage \ + "[OPTION]... SOURCE DEST\n" \ + "or: mv [OPTION]... SOURCE... DIRECTORY" +#define mv_full_usage \ + "Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY" \ + "\n\nOptions:\n" \ + " -f Don't prompt before overwriting\n" \ + " -i Interactive, prompt before overwrite" +#define mv_example_usage \ + "$ mv /tmp/foo /bin/bar\n" + +#define nameif_trivial_usage \ + "[-s] [-c FILE] [{IFNAME MACADDR}]" +#define nameif_full_usage \ + "Rename network interface while it in the down state" \ + "\n\nOptions:\n" \ + " -c FILE Use configuration file (default is /etc/mactab)\n" \ + " -s Use syslog (LOCAL0 facility)\n" \ + " IFNAME MACADDR new_interface_name interface_mac_address" +#define nameif_example_usage \ + "$ nameif -s dmz0 00:A0:C9:8C:F6:3F\n" \ + " or\n" \ + "$ nameif -c /etc/my_mactab_file\n" \ + +#if ENABLE_NC_SERVER || ENABLE_NC_EXTRA +#define NC_OPTIONS_STR "\n\nOptions:" +#else +#define NC_OPTIONS_STR +#endif + +#define nc_trivial_usage \ + USE_NC_EXTRA("[-iN] [-wN] ")USE_NC_SERVER("[-l] [-p PORT] ") \ + "["USE_NC_EXTRA("-f FILENAME|")"IPADDR PORTNUM]"USE_NC_EXTRA(" [-e COMMAND]") +#define nc_full_usage \ + "Open a pipe to IP:port" USE_NC_EXTRA(" or file") \ + NC_OPTIONS_STR \ + USE_NC_EXTRA( \ + "\n -e Exec rest of command line after connect" \ + "\n -i SECS Delay interval for lines sent" \ + "\n -w SECS Timeout for connect" \ + "\n -f FILE Use file (ala /dev/ttyS0) instead of network" \ + ) \ + USE_NC_SERVER( \ + "\n -l Listen mode, for inbound connects" \ + USE_NC_EXTRA( \ + "\n (use -l twice with -e for persistent server)") \ + "\n -p PORT Local port number" \ + ) + +#define nc_notes_usage "" \ + USE_NC_EXTRA( \ + "To use netcat as a terminal emulator on a serial port:\n\n" \ + "$ stty 115200 -F /dev/ttyS0\n" \ + "$ stty raw -echo -ctlecho && nc -f /dev/ttyS0\n" \ + ) + +#define nc_example_usage \ + "$ nc foobar.somedomain.com 25\n" \ + "220 foobar ESMTP Exim 3.12 #1 Sat, 15 Apr 2000 00:03:02 -0600\n" \ + "help\n" \ + "214-Commands supported:\n" \ + "214- HELO EHLO MAIL RCPT DATA AUTH\n" \ + "214 NOOP QUIT RSET HELP\n" \ + "quit\n" \ + "221 foobar closing connection\n" + +#define netstat_trivial_usage \ + "[-laenrtuwx]" +#define netstat_full_usage \ + "Display networking information" \ + "\n\nOptions:\n" \ + " -l Display listening server sockets\n" \ + " -a Display all sockets (default: connected)\n" \ + " -e Display other/more information\n" \ + " -n Don't resolve names\n" \ + " -r Display routing table\n" \ + " -t Tcp sockets\n" \ + " -u Udp sockets\n" \ + " -w Raw sockets\n" \ + " -x Unix sockets" + +#define nice_trivial_usage \ + "[-n ADJUST] [COMMAND [ARG] ...]" +#define nice_full_usage \ + "Run a program with modified scheduling priority" \ + "\n\nOptions:\n" \ + " -n ADJUST Adjust the scheduling priority by ADJUST" + +#define nmeter_trivial_usage \ + "format_string" +#define nmeter_full_usage \ + "Monitor system in real time\n\n" \ + "Format specifiers:\n" \ + "%Nc or %[cN] Monitor CPU. N - bar size, default 10\n" \ + " (displays: S:system U:user N:niced D:iowait I:irq i:softirq)\n" \ + "%[niface] Monitor network interface 'iface'\n" \ + "%m Monitor allocated memory\n" \ + "%[mf] Monitor free memory\n" \ + "%[mt] Monitor total memory\n" \ + "%s Monitor allocated swap\n" \ + "%f Monitor number of used file descriptors\n" \ + "%Ni Monitor total/specific IRQ rate\n" \ + "%x Monitor context switch rate\n" \ + "%p Monitor forks\n" \ + "%[pn] Monitor # of processes\n" \ + "%b Monitor block io\n" \ + "%Nt Show time (with N decimal points)\n" \ + "%Nd Milliseconds between updates (default=1000)\n" \ + "%r Print instead of at EOL" +#define nmeter_example_usage \ + "nmeter '%250d%t %20c int %i bio %b mem %m forks%p'" + +#define nohup_trivial_usage \ + "COMMAND [ARGS]" +#define nohup_full_usage \ + "Run a command immune to hangups, with output to a non-tty" +#define nohup_example_usage \ + "$ nohup make &" + +#define nslookup_trivial_usage \ + "[HOST] [SERVER]" +#define nslookup_full_usage \ + "Query the nameserver for the IP address of the given HOST\n" \ + "optionally using a specified DNS server" +#define nslookup_example_usage \ + "$ nslookup localhost\n" \ + "Server: default\n" \ + "Address: default\n" \ + "\n" \ + "Name: debian\n" \ + "Address: 127.0.0.1\n" + +#define od_trivial_usage \ + "[-aBbcDdeFfHhIiLlOovXx] [FILE]" +#define od_full_usage \ + "Write an unambiguous representation, octal bytes by default, of FILE\n" \ + "to standard output. With no FILE, or when FILE is -, read standard input." + +#define openvt_trivial_usage \ + " [ARGS...]" +#define openvt_full_usage \ + "Start a command on a new virtual terminal" +#define openvt_example_usage \ + "openvt 2 /bin/ash\n" + +#define passwd_trivial_usage \ + "[OPTION] [name]" +#define passwd_full_usage \ + "Change a user password. If no name is specified,\n" \ + "changes the password for the current user." \ + "\n\nOptions:\n" \ + " -a Define which algorithm shall be used for the password\n" \ + " (choices: des, md5)\n" /* ", sha1)" */ \ + " -d Delete the password for the specified user account\n" \ + " -l Locks (disables) the specified user account\n" \ + " -u Unlocks (re-enables) the specified user account" + +#define patch_trivial_usage \ + "[-p] [-i ]" +#define patch_full_usage \ + " -p NUM Strip NUM leading components from file names\n" \ + " -i DIFF Read DIFF instead of stdin" +#define patch_example_usage \ + "$ patch -p1 < example.diff\n" \ + "$ patch -p0 -i example.diff" + +#if (ENABLE_FEATURE_PIDOF_SINGLE || ENABLE_FEATURE_PIDOF_OMIT) +#define USAGE_PIDOF "Options:" +#else +#define USAGE_PIDOF "\nThis version of pidof accepts no options." +#endif + +#define pidof_trivial_usage \ + "process-name [OPTION] [process-name ...]" + +#define pidof_full_usage \ + "List the PIDs of all processes with names that match the\n" \ + "names on the command line\n" \ + USAGE_PIDOF \ + USE_FEATURE_PIDOF_SINGLE( \ + "\n -s Display only a single PID") \ + USE_FEATURE_PIDOF_OMIT( \ + "\n -o Omit given pid") \ + USE_FEATURE_PIDOF_OMIT( \ + "\n Use %PPID to omit the parent pid of pidof itself") +#define pidof_example_usage \ + "$ pidof init\n" \ + "1\n" \ + USE_FEATURE_PIDOF_OMIT( \ + "$ pidof /bin/sh\n20351 5973 5950\n") \ + USE_FEATURE_PIDOF_OMIT( \ + "$ pidof /bin/sh -o %PPID\n20351 5950") + +#ifndef CONFIG_FEATURE_FANCY_PING +#define ping_trivial_usage \ + "host" +#define ping_full_usage \ + "Send ICMP ECHO_REQUEST packets to network hosts" +#define ping6_trivial_usage \ + "host" +#define ping6_full_usage \ + "Send ICMP ECHO_REQUEST packets to network hosts" +#else +#define ping_trivial_usage \ + "[OPTION]... host" +#define ping_full_usage \ + "Send ICMP ECHO_REQUEST packets to network hosts" \ + "\n\nOptions:\n" \ + " -4, -6 Force IPv4 or IPv6 hostname resolution\n" \ + " -c CNT Send only CNT pings\n" \ + " -s SIZE Send SIZE data bytes in packets (default=56)\n" \ + " -I iface/IP Use interface or IP address as source\n" \ + " -q Quiet mode, only displays output at start\n" \ + " and when finished" +#define ping6_trivial_usage \ + "[OPTION]... host" +#define ping6_full_usage \ + "Send ICMP ECHO_REQUEST packets to network hosts" \ + "\n\nOptions:\n" \ + " -c CNT Send only CNT pings\n" \ + " -s SIZE Send SIZE data bytes in packets (default=56)\n" \ + " -I iface/IP Use interface or IP address as source\n" \ + " -q Quiet mode, only displays output at start\n" \ + " and when finished" +#endif +#define ping_example_usage \ + "$ ping localhost\n" \ + "PING slag (127.0.0.1): 56 data bytes\n" \ + "64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=20.1 ms\n" \ + "\n" \ + "--- debian ping statistics ---\n" \ + "1 packets transmitted, 1 packets received, 0% packet loss\n" \ + "round-trip min/avg/max = 20.1/20.1/20.1 ms\n" +#define ping6_example_usage \ + "$ ping6 ip6-localhost\n" \ + "PING ip6-localhost (::1): 56 data bytes\n" \ + "64 bytes from ::1: icmp6_seq=0 ttl=64 time=20.1 ms\n" \ + "\n" \ + "--- ip6-localhost ping statistics ---\n" \ + "1 packets transmitted, 1 packets received, 0% packet loss\n" \ + "round-trip min/avg/max = 20.1/20.1/20.1 ms\n" + +#define pivot_root_trivial_usage \ + "NEW_ROOT PUT_OLD" +#define pivot_root_full_usage \ + "Move the current root file system to PUT_OLD and make NEW_ROOT\n" \ + "the new root file system" + +#define poweroff_trivial_usage \ + "[-d] [-n] [-f]" +#define poweroff_full_usage \ + "Halt and shut off power" \ + "\n\nOptions:\n" \ + " -d Delay interval for halting\n" \ + " -n No call to sync()\n" \ + " -f Force power off (don't go through init)" + +#define printenv_trivial_usage \ + "[VARIABLES...]" +#define printenv_full_usage \ + "Print all or part of environment.\n" \ + "If no environment VARIABLE specified, print them all." + +#define printf_trivial_usage \ + "FORMAT [ARGUMENT...]" +#define printf_full_usage \ + "Format and print ARGUMENT(s) according to FORMAT,\n" \ + "where FORMAT controls the output exactly as in C printf" +#define printf_example_usage \ + "$ printf \"Val=%d\\n\" 5\n" \ + "Val=5\n" + + +#if ENABLE_DESKTOP + +#define ps_trivial_usage \ + "" +#define ps_full_usage \ + "Report process status" \ + "\n\nOptions:" \ + "\n -o col1,col2=header Select columns for display" \ + +#else /* !ENABLE_DESKTOP */ + +#if !defined CONFIG_SELINUX && !ENABLE_FEATURE_PS_WIDE +#define USAGE_PS "\nThis version of ps accepts no options" +#else +#define USAGE_PS "\nOptions:" +#endif + +#define ps_trivial_usage \ + "" +#define ps_full_usage \ + "Report process status\n" \ + USAGE_PS \ + USE_SELINUX( \ + "\n -Z Show SE Linux context") \ + USE_FEATURE_PS_WIDE( \ + "\n w Wide output") + +#endif /* ENABLE_DESKTOP */ + +#define ps_example_usage \ + "$ ps\n" \ + " PID Uid Gid State Command\n" \ + " 1 root root S init\n" \ + " 2 root root S [kflushd]\n" \ + " 3 root root S [kupdate]\n" \ + " 4 root root S [kpiod]\n" \ + " 5 root root S [kswapd]\n" \ + " 742 andersen andersen S [bash]\n" \ + " 743 andersen andersen S -bash\n" \ + " 745 root root S [getty]\n" \ + " 2990 andersen andersen R ps\n" + + +#define pwd_trivial_usage \ + "" +#define pwd_full_usage \ + "Print the full filename of the current working directory" +#define pwd_example_usage \ + "$ pwd\n" \ + "/root\n" + +#define raidautorun_trivial_usage \ + "DEVICE" +#define raidautorun_full_usage \ + "Tell the kernel to automatically search and start RAID arrays" +#define raidautorun_example_usage \ + "$ raidautorun /dev/md0" + +#define rdate_trivial_usage \ + "[-sp] HOST" +#define rdate_full_usage \ + "Get and possibly set the system date and time from a remote HOST" \ + "\n\nOptions:\n" \ + " -s Set the system date and time (default)\n" \ + " -p Print the date and time" + +#define readahead_trivial_usage \ + "[FILE]..." +#define readahead_full_usage \ + "Preload FILE(s) in RAM cache so that subsequent reads for those" \ + "files do not block on disk I/O" + +#define readlink_trivial_usage \ + USE_FEATURE_READLINK_FOLLOW("[-f] ") "FILE" +#define readlink_full_usage \ + "Display the value of a symlink" \ + USE_FEATURE_READLINK_FOLLOW( \ + "\n\nOptions:\n" \ + " -f Canonicalize by following all symlinks") + +#define readprofile_trivial_usage \ + "[OPTIONS]..." +#define readprofile_full_usage \ + "Options:\n" \ + " -m (Default: /boot/System.map)\n" \ + " -p (Default: /proc/profile)\n" \ + " -M Set the profiling multiplier to \n" \ + " -i Print only info about the sampling step\n" \ + " -v Print verbose data\n" \ + " -a Print all symbols, even if count is 0\n" \ + " -b Print individual histogram-bin counts\n" \ + " -s Print individual counters within functions\n" \ + " -r Reset all the counters (root only)\n" \ + " -n Disable byte order auto-detection" + +#define realpath_trivial_usage \ + "pathname ..." +#define realpath_full_usage \ + "Return the absolute pathnames of given argument" + +#define reboot_trivial_usage \ + "[-d] [-n] [-f]" +#define reboot_full_usage \ + "Reboot the system" \ + "\n\nOptions:\n" \ + " -d Delay interval for rebooting\n" \ + " -n No call to sync()\n" \ + " -f Force reboot (don't go through init)" + +#define renice_trivial_usage \ + "{{-n INCREMENT} | PRIORITY} [[ -p | -g | -u ] ID ...]" +#define renice_full_usage \ + "Change priority of running processes" \ + "\n\nOptions:\n" \ + " -n Adjusts current nice value (smaller is faster)\n" \ + " -p Process id(s) (default)\n" \ + " -g Process group id(s)\n" \ + " -u Process user name(s) and/or id(s)" + +#define reset_trivial_usage \ + "" +#define reset_full_usage \ + "Reset the screen" + +#define resize_trivial_usage \ + "" +#define resize_full_usage \ + "Resize the screen" + +#define rm_trivial_usage \ + "[OPTION]... FILE..." +#define rm_full_usage \ + "Remove (unlink) the FILE(s). You may use '--' to\n" \ + "indicate that all following arguments are non-options." \ + "\n\nOptions:\n" \ + " -i Always prompt before removing each destination\n" \ + " -f Remove existing destinations, never prompt\n" \ + " -r,-R Remove the contents of directories recursively" +#define rm_example_usage \ + "$ rm -rf /tmp/foo\n" + +#define rmdir_trivial_usage \ + "[OPTION]... DIRECTORY..." +#define rmdir_full_usage \ + "Remove the DIRECTORY, if it is empty" +#define rmdir_example_usage \ + "# rmdir /tmp/foo\n" + +#define rmmod_trivial_usage \ + "[OPTION]... [MODULE]..." +#define rmmod_full_usage \ + "Unload the specified kernel modules from the kernel" \ + "\n\nOptions:\n" \ + " -a Remove all unused modules (recursively)" +#define rmmod_example_usage \ + "$ rmmod tulip\n" + +#define route_trivial_usage \ + "[{add|del|delete}]" +#define route_full_usage \ + "Edit the kernel's routing tables" \ + "\n\nOptions:\n" \ + " -n Dont resolve names\n" \ + " -e Display other/more information\n" \ + " -A inet" USE_FEATURE_IPV6("{6}") " Select address family" + +#define rpm_trivial_usage \ + "-i -q[ildc]p package.rpm" +#define rpm_full_usage \ + "Manipulate RPM packages" \ + "\n\nOptions:" \ + "\n -i Install package" \ + "\n -q Query package" \ + "\n -p Query uninstalled package" \ + "\n -i Show information" \ + "\n -l List contents" \ + "\n -d List documents" \ + "\n -c List config files" + +#define rpm2cpio_trivial_usage \ + "package.rpm" +#define rpm2cpio_full_usage \ + "Output a cpio archive of the rpm file" + +#define runcon_trivial_usage \ + "[-c] [-u USER] [-r ROLE] [-t TYPE] [-l RANGE] COMMAND [args]\n" \ + " runcon CONTEXT COMMAND [args]" +#define runcon_full_usage \ + "runcon [-c] [-u USER] [-r ROLE] [-t TYPE] [-l RANGE] COMMAND [args]\n" \ + "runcon CONTEXT COMMAND [args]\n" \ + "Run a program in a different security context\n\n" \ + " CONTEXT Complete security context\n" \ + " -c, --compute Compute process transition context before modifying\n" \ + " -t, --type=TYPE Type (for same role as parent)\n" \ + " -u, --user=USER User identity\n" \ + " -r, --role=ROLE Role\n" \ + " -l, --range=RNG Levelrange" \ + +#define run_parts_trivial_usage \ + "[-t] [-a ARG] [-u MASK] DIRECTORY" +#define run_parts_full_usage \ + "Run a bunch of scripts in a directory" \ + "\n\nOptions:\n" \ + " -t Prints what would be run, but does not actually run anything\n" \ + " -a ARG Pass ARG as an argument for every program invoked\n" \ + " -u MASK Set the umask to MASK before executing every program" + +#define runlevel_trivial_usage \ + "[utmp]" +#define runlevel_full_usage \ + "Find the current and previous system runlevel.\n\n" \ + "If no utmp file exists or if no runlevel record can be found,\n" \ + "print \"unknown\"" +#define runlevel_example_usage \ + "$ runlevel /var/run/utmp\n" \ + "N 2" + +#define runsv_trivial_usage \ + "dir" +#define runsv_full_usage \ + "Start and monitor a service and optionally an appendant log service" + +#define runsvdir_trivial_usage \ + "[-P] dir" +#define runsvdir_full_usage \ + "Start a runsv process for each subdirectory" + +#define rx_trivial_usage \ + "FILE" +#define rx_full_usage \ + "Receive a file using the xmodem protocol" +#define rx_example_usage \ + "$ rx /tmp/foo\n" + +#define sed_trivial_usage \ + "[-efinr] pattern [files...]" +#define sed_full_usage \ + "Options:\n" \ + " -e script Add the script to the commands to be executed\n" \ + " -f scriptfile Add script-file contents to the\n" \ + " commands to be executed\n" \ + " -i Edit files in-place\n" \ + " -n Suppress automatic printing of pattern space\n" \ + " -r Use extended regular expression syntax\n" \ + "\n" \ + "If no -e or -f is given, the first non-option argument is taken as the sed\n" \ + "script to interpret. All remaining arguments are names of input files; if no\n" \ + "input files are specified, then the standard input is read. Source files\n" \ + "will not be modified unless -i option is given." + +#define sed_example_usage \ + "$ echo \"foo\" | sed -e 's/f[a-zA-Z]o/bar/g'\n" \ + "bar\n" + +#define selinuxenabled_trivial_usage +#define selinuxenabled_full_usage + +#define seq_trivial_usage \ + "[first [increment]] last" +#define seq_full_usage \ + "Print numbers from FIRST to LAST, in steps of INCREMENT.\n" \ + "FIRST, INCREMENT default to 1" \ + "\n\nArguments:\n" \ + " LAST\n" \ + " FIRST LAST\n" \ + " FIRST INCREMENT LAST" + +#define setconsole_trivial_usage \ + "[-r|--reset] [DEVICE]" +#define setconsole_full_usage \ + "Redirect system console output to DEVICE (default: /dev/tty)" \ + "\n\nOptions:\n" \ + " -r Reset output to /dev/console" + +#define setenforce_trivial_usage \ + "[ Enforcing | Permissive | 1 | 0 ]" +#define setenforce_full_usage + +#define setkeycodes_trivial_usage \ + "SCANCODE KEYCODE ..." +#define setkeycodes_full_usage \ + "Set entries into the kernel's scancode-to-keycode map,\n" \ + "allowing unusual keyboards to generate usable keycodes.\n\n" \ + "SCANCODE may be either xx or e0xx (hexadecimal),\n" \ + "and KEYCODE is given in decimal" +#define setkeycodes_example_usage \ + "$ setkeycodes e030 127\n" + +#define setlogcons_trivial_usage \ + "N" +#define setlogcons_full_usage \ + "Redirect the kernel output to console N (0 for current)" + +#define setsid_trivial_usage \ + "program [arg ...]" +#define setsid_full_usage \ + "Run any program in a new session by calling setsid() before\n" \ + "exec'ing the rest of its arguments. See setsid(2) for details." + +#define lash_trivial_usage \ + "[FILE]...\n" \ + "or: sh -c command [args]..." +#define lash_full_usage \ + "The BusyBox LAme SHell (command interpreter)" +#define lash_notes_usage \ + "This command does not yet have proper documentation.\n\n" \ + "Use lash just as you would use any other shell. It properly handles pipes,\n" \ + "redirects, job control, can be used as the shell for scripts, and has a\n" \ + "sufficient set of builtins to do what is needed. It does not (yet) support\n" \ + "Bourne Shell syntax. If you need things like \"if-then-else\", \"while\", and such\n" \ + "use ash or bash. If you just need a very simple and extremely small shell,\n" \ + "this will do the job." + +#define last_trivial_usage \ + "" +#define last_full_usage \ + "Show listing of the last users that logged into the system" + +#define sha1sum_trivial_usage \ + "[OPTION] [FILEs...]" \ + USE_FEATURE_MD5_SHA1_SUM_CHECK("\n or: sha1sum [OPTION] -c [FILE]") +#define sha1sum_full_usage \ + "Print" USE_FEATURE_MD5_SHA1_SUM_CHECK(" or check") " SHA1 checksums.\n" \ + "With no FILE, or when FILE is -, read standard input." \ + "\n\nOptions:\n" \ + USE_FEATURE_MD5_SHA1_SUM_CHECK( \ + " -c Check SHA1 sums against given list\n" \ + "\nThe following two options are useful only when verifying checksums:\n" \ + " -s Don't output anything, status code shows success\n" \ + " -w Warn about improperly formatted SHA1 checksum lines") + +#define sleep_trivial_usage \ + USE_FEATURE_FANCY_SLEEP("[") "N" USE_FEATURE_FANCY_SLEEP("]...") +#define sleep_full_usage \ + SKIP_FEATURE_FANCY_SLEEP("Pause for N seconds") \ + USE_FEATURE_FANCY_SLEEP( \ + "Pause for a time equal to the total of the args given, where each arg can\n" \ + "have an optional suffix of (s)econds, (m)inutes, (h)ours, or (d)ays") +#define sleep_example_usage \ + "$ sleep 2\n" \ + "[2 second delay results]\n" \ + USE_FEATURE_FANCY_SLEEP( \ + "$ sleep 1d 3h 22m 8s\n" \ + "[98528 second delay results]\n") + +#define sort_trivial_usage \ + "[-nru" \ + USE_FEATURE_SORT_BIG("gMcszbdfimSTokt] [-o outfile] [-k start[.offset][opts][,end[.offset][opts]] [-t char") \ + "] [FILE]..." +#define sort_full_usage \ + "Sort lines of text in the specified files" \ + "\n\nOptions:\n" \ + USE_FEATURE_SORT_BIG( \ + " -b Ignore leading blanks\n" \ + " -c Check whether input is sorted\n" \ + " -d Dictionary order (blank or alphanumeric only)\n" \ + " -f Ignore case\n" \ + " -g General numerical sort\n" \ + " -i Ignore unprintable characters\n" \ + " -k Specify sort key\n" \ + " -M Sort month\n") \ + " -n Sort numbers\n" \ + USE_FEATURE_SORT_BIG( \ + " -o Output to file\n" \ + " -k Sort by key\n" \ + " -t Use key separator other than whitespace\n") \ + " -r Reverse sort order\n" \ + USE_FEATURE_SORT_BIG( \ + " -s Stable (don't sort ties alphabetically)\n") \ + " -u Suppress duplicate lines" \ + USE_FEATURE_SORT_BIG( \ + "\n -z Input terminated by nulls, not newlines\n") \ + USE_FEATURE_SORT_BIG( \ + " -mST Ignored for GNU compatibility") \ + "" +#define sort_example_usage \ + "$ echo -e \"e\\nf\\nb\\nd\\nc\\na\" | sort\n" \ + "a\n" \ + "b\n" \ + "c\n" \ + "d\n" \ + "e\n" \ + "f\n" \ + USE_FEATURE_SORT_BIG( \ + "$ echo -e \"c 3\\nb 2\\nd 2\" | $SORT -k 2,2n -k 1,1r\n" \ + "d 2\n" \ + "b 2\n" \ + "c 3\n" \ + ) \ + "" + +#define start_stop_daemon_trivial_usage \ + "[OPTIONS] [--start|--stop] ... [-- arguments...]" +#define start_stop_daemon_full_usage \ + "Start and stop services" \ + "\n\nOptions:" \ + "\n -S|--start Start" \ + "\n -K|--stop Stop" \ + "\n -a|--startas Starts process specified by pathname" \ + "\n -b|--background Force process into background" \ + "\n -u|--user | Stop this user's processes" \ + "\n -x|--exec Program to either start or check" \ + "\n -m|--make-pidfile Create the -p file and enter pid in it" \ + "\n -n|--name Stop processes with this name" \ + "\n -p|--pidfile Save or load pid using a pid-file" \ + "\n -q|--quiet Be quiet" \ + USE_FEATURE_START_STOP_DAEMON_FANCY( \ + "\n -o|--oknodo Exit status 0 if nothing done" \ + "\n -v|--verbose Be verbose" \ + "\n -N|--nicelevel Add N to process's nice level" \ + ) \ + "\n -s|--signal Signal to send (default TERM)" \ + "\n -c|--chuid [:[]] Change to specified user/group" + +#define stat_trivial_usage \ + "[OPTION] FILE..." +#define stat_full_usage \ + "Display file (default) or filesystem status" \ + "\n\nOptions:\n" \ + USE_FEATURE_STAT_FORMAT( \ + " -c fmt Use the specified format\n") \ + " -f Display filesystem status\n" \ + " -L,-l Dereference links\n" \ + " -t Display info in terse form" \ + USE_SELINUX( \ + "\n -Z Print security context" \ + ) \ + USE_FEATURE_STAT_FORMAT( \ + "\n\nValid format sequences for files:\n" \ + " %a Access rights in octal\n" \ + " %A Access rights in human readable form\n" \ + " %b Number of blocks allocated (see %B)\n" \ + " %B The size in bytes of each block reported by %b\n" \ + " %d Device number in decimal\n" \ + " %D Device number in hex\n" \ + " %f Raw mode in hex\n" \ + " %F File type\n" \ + " %g Group ID of owner\n" \ + " %G Group name of owner\n" \ + " %h Number of hard links\n" \ + " %i Inode number\n" \ + " %n File name\n" \ + " %N Quoted file name with dereference if symlink\n" \ + " %o I/O block size\n" \ + " %s Total size, in bytes\n" \ + " %t Major device type in hex\n" \ + " %T Minor device type in hex\n" \ + " %u User ID of owner\n" \ + " %U User name of owner\n" \ + " %x Time of last access\n" \ + " %X Time of last access as seconds since Epoch\n" \ + " %y Time of last modification\n" \ + " %Y Time of last modification as seconds since Epoch\n" \ + " %z Time of last change\n" \ + " %Z Time of last change as seconds since Epoch\n" \ + "\nValid format sequences for file systems:\n" \ + " %a Free blocks available to non-superuser\n" \ + " %b Total data blocks in file system\n" \ + " %c Total file nodes in file system\n" \ + " %d Free file nodes in file system\n" \ + " %f Free blocks in file system\n" \ + USE_SELINUX( \ + " %C Security context in SELinux\n" \ + ) \ + " %i File System ID in hex\n" \ + " %l Maximum length of filenames\n" \ + " %n File name\n" \ + " %s Block size (for faster transfers)\n" \ + " %S Fundamental block size (for block counts)\n" \ + " %t Type in hex\n" \ + " %T Type in human readable form" \ + ) + +#define strings_trivial_usage \ + "[-afo] [-n length] [file ... ]" +#define strings_full_usage \ + "Display printable strings in a binary file" \ + "\n\nOptions:" \ + "\n -a Scan the whole files (this is the default)" \ + "\n -f Precede each string with the name of the file where it was found" \ + "\n -n N Specifies that at least N characters forms a sequence (default 4)" \ + "\n -o Each string is preceded by its decimal offset in the file" + +#define stty_trivial_usage \ + "[-a|g] [-F DEVICE] [SETTING]..." +#define stty_full_usage \ + "Without arguments, prints baud rate, line discipline,\n" \ + "and deviations from stty sane" \ + "\n\nOptions:" \ + "\n -F DEVICE Open device instead of stdin" \ + "\n -a Print all current settings in human-readable form" \ + "\n -g Print in stty-readable form" \ + "\n [SETTING] See manpage" + +#define su_trivial_usage \ + "[OPTION]... [-] [username]" +#define su_full_usage \ + "Change user id or become root" \ + "\n\nOptions:" \ + "\n -p, -m Preserve environment" \ + "\n -c Command to pass to 'sh -c'" \ + "\n -s Shell to use instead of default shell" + +#define sulogin_trivial_usage \ + "[OPTION]... [tty-device]" +#define sulogin_full_usage \ + "Single user login" \ + "\n\nOptions:" \ + "\n -t Timeout" + +#define sum_trivial_usage \ + "[rs] [files...]" +#define sum_full_usage \ + "Checksum and count the blocks in a file" \ + "\n\nOptions:\n" \ + " -r Use BSD sum algorithm (1K blocks)\n" \ + " -s Use System V sum algorithm (512byte blocks)" + +#define sv_trivial_usage \ + "[-v] [-w sec] command service..." +#define sv_full_usage \ + "Report the current status and control the state of services " \ + "monitored by the runsv supervisor" + +#define svlogd_trivial_usage \ + "[-ttv] [-r c] [-R abc] [-l len] [-b buflen] dir..." +#define svlogd_full_usage \ + "Continuously read log data from standard input, optionally " \ + "filter log messages, and write the data to one or more automatically " \ + "rotated logs" + +#define swapoff_trivial_usage \ + "[-a] [DEVICE]" +#define swapoff_full_usage \ + "Stop swapping virtual memory pages on DEVICE" \ + "\n\nOptions:\n" \ + " -a Stop swapping on all swap devices" + +#define swapon_trivial_usage \ + "[-a] [DEVICE]" +#define swapon_full_usage \ + "Start swapping virtual memory pages on DEVICE" \ + "\n\nOptions:\n" \ + " -a Start swapping on all swap devices" + +#define switch_root_trivial_usage \ + "[-c /dev/console] NEW_ROOT NEW_INIT [ARGUMENTS_TO_INIT]" +#define switch_root_full_usage \ + "Use from PID 1 under initramfs to free initramfs, chroot to NEW_ROOT,\n" \ + "and exec NEW_INIT" \ + "\n\nOptions:\n" \ + " -c Redirect console to device on new root" + +#define sync_trivial_usage \ + "" +#define sync_full_usage \ + "Write all buffered filesystem blocks to disk" + +#define sysctl_trivial_usage \ + "[OPTIONS]... [VALUE]..." +#define sysctl_full_usage \ + "Configure kernel parameters at runtime" \ + "\n\nOptions:\n" \ + " -n Use this option to disable printing of the key name when printing values\n" \ + " -w Use this option when you want to change a sysctl setting\n" \ + " -p Load in sysctl settings from the file specified or /etc/sysctl.conf if none given\n" \ + " -a Display all values currently available\n" \ + " -A Display all values currently available in table form" +#define sysctl_example_usage \ + "sysctl [-n] variable ...\n" \ + "sysctl [-n] -w variable=value ...\n" \ + "sysctl [-n] -a\n" \ + "sysctl [-n] -p (default /etc/sysctl.conf)\n" \ + "sysctl [-n] -A\n" + +#define syslogd_trivial_usage \ + "[OPTION]..." +#define syslogd_full_usage \ + "System logging utility.\n" \ + "Note that this version of syslogd ignores /etc/syslog.conf." \ + "\n\nOptions:" \ + "\n -n Run as foreground process" \ + "\n -O FILE Use an alternate log file (default=/var/log/messages)" \ + "\n -l n Sets the local log level of messages to n" \ + "\n -S Make logging output smaller" \ + USE_FEATURE_ROTATE_LOGFILE( \ + "\n -s SIZE Max size (KB) before rotate (default=200KB, 0=off)" \ + "\n -b NUM Number of rotated logs to keep (default=1, max=99, 0=purge)") \ + USE_FEATURE_REMOTE_LOG( \ + "\n -R HOST[:PORT] Log to IP or hostname on PORT (default PORT=514/UDP)" \ + "\n -L Log locally and via network logging (default is network only)") \ + USE_FEATURE_IPC_SYSLOG( \ + "\n -C[size(KiB)] Log to a shared mem buffer (read the buffer using logread)") + /* NB: -Csize shouldn't have space (because size is optional) */ +/* "\n -m MIN Minutes between MARK lines (default=20, 0=off)" */ +#define syslogd_example_usage \ + "$ syslogd -R masterlog:514\n" \ + "$ syslogd -R 192.168.1.1:601\n" + +#define tail_trivial_usage \ + "[OPTION]... [FILE]..." +#define tail_full_usage \ + "Print last 10 lines of each FILE to standard output.\n" \ + "With more than one FILE, precede each with a header giving the\n" \ + "file name. With no FILE, or when FILE is -, read standard input." \ + "\n\nOptions:" \ + USE_FEATURE_FANCY_TAIL( \ + "\n -c N[kbm] Output the last N bytes") \ + "\n -n N[kbm] Print last N lines instead of last 10" \ + "\n -f Output data as the file grows" \ + USE_FEATURE_FANCY_TAIL( \ + "\n -q Never output headers giving file names" \ + "\n -s SEC Wait SEC seconds between reads with -f" \ + "\n -v Always output headers giving file names" \ + "\n\n" \ + "If the first character of N (bytes or lines) is a '+', output begins with\n" \ + "the Nth item from the start of each file, otherwise, print the last N items\n" \ + "in the file. N bytes may be suffixed by k (x1024), b (x512), or m (1024^2)." ) +#define tail_example_usage \ + "$ tail -n 1 /etc/resolv.conf\n" \ + "nameserver 10.0.0.1\n" + +#define tar_trivial_usage \ + "-[" USE_FEATURE_TAR_CREATE("c") USE_FEATURE_TAR_GZIP("z") \ + USE_FEATURE_TAR_BZIP2("j") USE_FEATURE_TAR_LZMA("a") \ + USE_FEATURE_TAR_COMPRESS("Z") "xtvO] " \ + USE_FEATURE_TAR_FROM("[-X FILE] ") \ + "[-f TARFILE] [-C DIR] [FILE(s)] ..." +#define tar_full_usage \ + "Create, extract, or list files from a tar file" \ + "\n\nOptions:\n" \ + USE_FEATURE_TAR_CREATE( \ + " c Create\n") \ + " x Extract\n" \ + " t List\n" \ + "\nArchive format selection:\n" \ + USE_FEATURE_TAR_GZIP( \ + " z Filter the archive through gzip\n") \ + USE_FEATURE_TAR_BZIP2( \ + " j Filter the archive through bzip2\n") \ + USE_FEATURE_TAR_LZMA( \ + " a Filter the archive through lzma\n") \ + USE_FEATURE_TAR_COMPRESS( \ + " Z Filter the archive through compress\n") \ + "\nFile selection:\n" \ + " f Name of TARFILE or \"-\" for stdin\n" \ + " O Extract to stdout\n" \ + USE_FEATURE_TAR_FROM( \ + " exclude File to exclude\n" \ + " X File with names to exclude\n") \ + " C Change to directory DIR before operation\n" \ + " v Verbosely list files processed" +#define tar_example_usage \ + "$ zcat /tmp/tarball.tar.gz | tar -xf -\n" \ + "$ tar -cf /tmp/tarball.tar /usr/local\n" + +#define taskset_trivial_usage \ + "[OPTIONS] [mask] [pid | command [arg]...]" +#define taskset_full_usage \ + "Set or get CPU affinity" \ + "\n\nOptions:\n" \ + " -p Operate on an existing PID" +#define taskset_example_usage \ + "$ taskset 0x7 ./dgemm_test&\n" \ + "$ taskset -p 0x1 $!\n" \ + "pid 4790's current affinity mask: 7\n" \ + "pid 4790's new affinity mask: 1\n" \ + "$ taskset 0x7 /bin/sh -c './taskset -p 0x1 $$'\n" \ + "pid 6671's current affinity mask: 1\n" \ + "pid 6671's new affinity mask: 1\n" \ + "$ taskset -p 1\n" \ + "pid 1's current affinity mask: 3\n" + +#define tee_trivial_usage \ + "[OPTION]... [FILE]..." +#define tee_full_usage \ + "Copy standard input to each FILE, and also to standard output" \ + "\n\nOptions:\n" \ + " -a Append to the given FILEs, do not overwrite\n" \ + " -i Ignore interrupt signals (SIGINT)" +#define tee_example_usage \ + "$ echo \"Hello\" | tee /tmp/foo\n" \ + "$ cat /tmp/foo\n" \ + "Hello\n" + +#ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN +#define telnet_trivial_usage \ + "[-a] [-l USER] HOST [PORT]" +#define telnet_full_usage \ + "Connect to remote telnet server" \ + "\n\nOptions:\n" \ + " -a Attempt an automatic login with the USER variable\n" \ + " -l USER Attempt an automatic login with the USER argument\n" \ + " HOST The official name, alias or the IP address of the\n" \ + " remote host\n" \ + " PORT The remote port number to connect to. If it is not\n" \ + " specified, the default telnet (23) port is used." +#else +#define telnet_trivial_usage \ + "HOST [PORT]" +#define telnet_full_usage \ + "Connect to remote telnet server" +#endif + +#define telnetd_trivial_usage \ + "[OPTION]" +#define telnetd_full_usage \ + "Handle incoming telnet connections" \ + SKIP_FEATURE_TELNETD_STANDALONE(" via inetd") \ + "\n\nOptions:" \ + "\n -l LOGIN Exec LOGIN on connect" \ + "\n -f issue_file Display issue_file instead of /etc/issue" \ + USE_FEATURE_TELNETD_STANDALONE( \ + "\n -p PORT Port to listen to" \ + "\n -b ADDR Address to bind to" \ + "\n -F Stay in foreground" \ + "\n -i Run as inetd subservice" \ + ) + +#define test_trivial_usage \ + "EXPRESSION\n or [ EXPRESSION ]" +#define test_full_usage \ + "Check file types and compares values returning an exit code\n" \ + "determined by the value of EXPRESSION" +#define test_example_usage \ + "$ test 1 -eq 2\n" \ + "$ echo $?\n" \ + "1\n" \ + "$ test 1 -eq 1\n" \ + "$ echo $?\n" \ + "0\n" \ + "$ [ -d /etc ]\n" \ + "$ echo $?\n" \ + "0\n" \ + "$ [ -d /junk ]\n" \ + "$ echo $?\n" \ + "1\n" + +#define tftp_trivial_usage \ + "[OPTION]... HOST [PORT]" +#define tftp_full_usage \ + "Transfer a file from/to tftp server using \"octet\" mode" \ + "\n\nOptions:" \ + "\n -l FILE Local FILE" \ + "\n -r FILE Remote FILE" \ + USE_FEATURE_TFTP_GET( \ + "\n -g Get file" \ + ) \ + USE_FEATURE_TFTP_PUT( \ + "\n -p Put file" \ + ) \ + USE_FEATURE_TFTP_BLOCKSIZE( \ + "\n -b SIZE Transfer blocks of SIZE octets" \ + ) +#define time_trivial_usage \ + "[OPTION]... COMMAND [ARGS...]" +#define time_full_usage \ + "Run the program COMMAND with arguments ARGS. When COMMAND finishes,\n" \ + "COMMAND's resource usage information is displayed." \ + "\n\nOptions:\n" \ + " -v Display verbose resource usage information" + +#define top_trivial_usage \ + "[-b] [-n count] [-d seconds]" +#define top_full_usage \ + "Provide a view of process activity in real time.\n" \ + "Read the status of all processes from /proc each \n" \ + "and show the status for however many processes will fit on the screen." + +#define touch_trivial_usage \ + "[-c] FILE [FILE ...]" +#define touch_full_usage \ + "Update the last-modified date on the given FILE[s]" \ + "\n\nOptions:\n" \ + " -c Do not create any files" +#define touch_example_usage \ + "$ ls -l /tmp/foo\n" \ + "/bin/ls: /tmp/foo: No such file or directory\n" \ + "$ touch /tmp/foo\n" \ + "$ ls -l /tmp/foo\n" \ + "-rw-rw-r-- 1 andersen andersen 0 Apr 15 01:11 /tmp/foo\n" + +#define tr_trivial_usage \ + "[-cds] STRING1 [STRING2]" +#define tr_full_usage \ + "Translate, squeeze, and/or delete characters from\n" \ + "standard input, writing to standard output" \ + "\n\nOptions:\n" \ + " -c Take complement of STRING1\n" \ + " -d Delete input characters coded STRING1\n" \ + " -s Squeeze multiple output characters of STRING2 into one character" +#define tr_example_usage \ + "$ echo \"gdkkn vnqkc\" | tr [a-y] [b-z]\n" \ + "hello world\n" + +#define traceroute_trivial_usage \ + "[-FIldnrv] [-f 1st_ttl] [-m max_ttl] [-p port#] [-q nqueries]\n" \ + " [-s src_addr] [-t tos] [-w wait] [-g gateway] [-i iface]\n" \ + " [-z pausemsecs] host [data size]" +#define traceroute_full_usage \ + "Trace the route ip packets follow going to \"host\"" \ + "\n\nOptions:\n" \ + " -F Set the don't fragment bit\n" \ + " -I Use ICMP ECHO instead of UDP datagrams\n" \ + " -l Display the ttl value of the returned packet\n" \ + " -d Set SO_DEBUG options to socket\n" \ + " -n Print hop addresses numerically rather than symbolically\n" \ + " -r Bypass the normal routing tables and send directly to a host\n" \ + " -v Verbose output\n" \ + " -m max_ttl Set the max time-to-live (max number of hops)\n" \ + " -p port# Set the base UDP port number used in probes\n" \ + " (default is 33434)\n" \ + " -q nqueries Set the number of probes per 'ttl' to nqueries\n" \ + " (default is 3)\n" \ + " -s src_addr Use the following IP address as the source address\n" \ + " -t tos Set the type-of-service in probe packets to the following value\n" \ + " (default 0)\n" \ + " -w wait Set the time (in seconds) to wait for a response to a probe\n" \ + " (default 3 sec)\n" \ + " -g Specify a loose source route gateway (8 maximum)" + + +#define true_trivial_usage \ + "" +#define true_full_usage \ + "Return an exit code of TRUE (0)" +#define true_example_usage \ + "$ true\n" \ + "$ echo $?\n" \ + "0\n" + +#define tty_trivial_usage \ + "" +#define tty_full_usage \ + "Print the file name of the terminal connected to standard input" \ + USE_INCLUDE_SUSv2( \ + "\n\nOptions:\n" \ + " -s Print nothing, only return an exit status") +#define tty_example_usage \ + "$ tty\n" \ + "/dev/tty2\n" + +#define tune2fs_trivial_usage \ + "[-c max-mounts-count] [-e errors-behavior] [-g group] " \ + "[-i interval[d|m|w]] [-j] [-J journal-options] [-l] [-s sparse-flag] " \ + "[-m reserved-blocks-percent] [-o [^]mount-options[,...]] " \ + "[-r reserved-blocks-count] [-u user] [-C mount-count] " \ + "[-L volume-label] [-M last-mounted-dir] [-O [^]feature[,...]] " \ + "[-T last-check-time] [-U UUID] device" +#define tune2fs_full_usage \ + "Adjust filesystem options on ext[23] filesystems" + +#define udhcpc_trivial_usage \ + "[-Cfbnqtv] [-c CID] [-V VCLS] [-H HOSTNAME] [-i INTERFACE]\n[-p pidfile] [-r IP] [-s script]" +#define udhcpc_full_usage \ + " -V,--vendorclass=CLASSID Set vendor class identifier\n" \ + " -i,--interface=INTERFACE Interface to use (default: eth0)\n" \ + " -H,-h,--hostname=HOSTNAME Client hostname\n" \ + " -c,--clientid=CLIENTID Set client identifier\n" \ + " -C,--clientid-none Suppress default client identifier\n" \ + " -p,--pidfile=file Store process ID of daemon in file\n" \ + " -r,--request=IP IP address to request (default: none)\n" \ + " -s,--script=file Run file at dhcp events (default: /usr/share/udhcpc/default.script)\n" \ + " -t,--retries=NUM Send up to NUM request packets\n"\ + " -f,--foreground Do not fork after getting lease\n" \ + " -b,--background Fork to background if lease cannot be immediately negotiated\n" \ + " -n,--now Exit with failure if lease cannot be immediately negotiated\n" \ + " -q,--quit Quit after obtaining lease\n" \ + " -R,--release Release IP on quit\n" \ + " -v,--version Display version" \ + +#define udhcpd_trivial_usage \ + "[configfile]\n" \ + +#define udhcpd_full_usage \ + "" + +#define umount_trivial_usage \ + "[flags] FILESYSTEM|DIRECTORY" +#define umount_full_usage \ + "Unmount file systems" \ + "\n\nOptions:\n" \ + USE_FEATURE_UMOUNT_ALL( \ + "\n -a Unmount all file systems" USE_FEATURE_MTAB_SUPPORT(" in /etc/mtab")) \ + USE_FEATURE_MTAB_SUPPORT( \ + "\n -n Don't erase /etc/mtab entries") \ + "\n -r Try to remount devices as read-only if mount is busy" \ + "\n -l Lazy umount (detach filesystem)" \ + "\n -f Force umount (i.e., unreachable NFS server)" \ + USE_FEATURE_MOUNT_LOOP( \ + "\n -D Do not free loop device (if a loop device has been used)") +#define umount_example_usage \ + "$ umount /dev/hdc1\n" + +#define uname_trivial_usage \ + "[OPTION]..." +#define uname_full_usage \ + "Print certain system information. With no OPTION, same as -s." \ + "\n\nOptions:\n" \ + " -a Print all information\n" \ + " -m The machine (hardware) type\n" \ + " -n Print the machine's network node hostname\n" \ + " -r Print the operating system release\n" \ + " -s Print the operating system name\n" \ + " -p Print the host processor type\n" \ + " -v Print the operating system version" +#define uname_example_usage \ + "$ uname -a\n" \ + "Linux debian 2.4.23 #2 Tue Dec 23 17:09:10 MST 2003 i686 GNU/Linux\n" + +#define uncompress_trivial_usage \ + "[-c] [-f] [ name ... ]" +#define uncompress_full_usage \ + "Uncompress .Z file[s]" \ + "\n\nOptions:\n" \ + " -c Extract to stdout\n" \ + " -f Force overwrite an existing file" + +#define uniq_trivial_usage \ + "[-fscdu]... [INPUT [OUTPUT]]" +#define uniq_full_usage \ + "Discard all but one of successive identical lines from INPUT\n" \ + "(or standard input), writing to OUTPUT (or standard output)" \ + "\n\nOptions:\n" \ + " -c Prefix lines by the number of occurrences\n" \ + " -d Only print duplicate lines\n" \ + " -u Only print unique lines\n" \ + " -f N Skip the first N fields\n" \ + " -s N Skip the first N chars (after any skipped fields)" +#define uniq_example_usage \ + "$ echo -e \"a\\na\\nb\\nc\\nc\\na\" | sort | uniq\n" \ + "a\n" \ + "b\n" \ + "c\n" + +#define unix2dos_trivial_usage \ + "[option] [FILE]" +#define unix2dos_full_usage \ + "Convert FILE from unix format to dos format. When no option\n" \ + "is given, the input is converted to the opposite output format.\n" \ + "When no file is given, use stdin for input and stdout for output." \ + "\n\nOptions:\n" \ + " -u Output will be in UNIX format\n" \ + " -d Output will be in DOS format" + +#define unzip_trivial_usage \ + "[-opts[modifiers]] file[.zip] [list] [-x xlist] [-d exdir]" +#define unzip_full_usage \ + "Extract files from ZIP archives" \ + "\n\nOptions:\n" \ + " -l List archive contents (short form)\n" \ + " -n Never overwrite existing files (default)\n" \ + " -o Overwrite files without prompting\n" \ + " -p Send output to stdout\n" \ + " -q Be quiet\n" \ + " -x Exclude these files\n" \ + " -d Extract files into this directory" + +#define uptime_trivial_usage \ + "" +#define uptime_full_usage \ + "Display the time since the last boot" +#define uptime_example_usage \ + "$ uptime\n" \ + " 1:55pm up 2:30, load average: 0.09, 0.04, 0.00\n" + +#define usleep_trivial_usage \ + "N" +#define usleep_full_usage \ + "Pause for N microseconds" +#define usleep_example_usage \ + "$ usleep 1000000\n" \ + "[pauses for 1 second]\n" + +#define uudecode_trivial_usage \ + "[FILE]..." +#define uudecode_full_usage \ + "Uudecode a file" \ + "\n\nOptions:\n" \ + " -o FILE Direct output to FILE" +#define uudecode_example_usage \ + "$ uudecode -o busybox busybox.uu\n" \ + "$ ls -l busybox\n" \ + "-rwxr-xr-x 1 ams ams 245264 Jun 7 21:35 busybox\n" + +#define uuencode_trivial_usage \ + "[OPTION] [INFILE] REMOTEFILE" +#define uuencode_full_usage \ + "Uuencode a file" \ + "\n\nOptions:\n" \ + " -m Use base64 encoding per RFC1521" +#define uuencode_example_usage \ + "$ uuencode busybox busybox\n" \ + "begin 755 busybox\n" \ + "\n" \ + "$ uudecode busybox busybox > busybox.uu\n" \ + "$\n" + +#define vconfig_trivial_usage \ + "COMMAND [OPTIONS] ..." +#define vconfig_full_usage \ + "Create and remove virtual ethernet devices" \ + "\n\nOptions:\n" \ + " add [interface-name] [vlan_id]\n" \ + " rem [vlan-name]\n" \ + " set_flag [interface-name] [flag-num] [0 | 1]\n" \ + " set_egress_map [vlan-name] [skb_priority] [vlan_qos]\n" \ + " set_ingress_map [vlan-name] [skb_priority] [vlan_qos]\n" \ + " set_name_type [name-type]" + +#define vi_trivial_usage \ + "[OPTION] [FILE]..." +#define vi_full_usage \ + "Edit FILE" \ + "\n\nOptions:\n" \ + " -R Read-only - do not write to the file" + +#define vlock_trivial_usage \ + "[OPTIONS]" +#define vlock_full_usage \ + "Lock a virtual terminal. A password is required to unlock." \ + "\n\nOptions:\n" \ + " -a Lock all VTs" + +#define watch_trivial_usage \ + "[-n ] [-t] COMMAND..." +#define watch_full_usage \ + "Execute a program periodically" \ + "\n\nOptions:\n" \ + " -n Loop period in seconds - default is 2\n" \ + " -t Don't print header" +#define watch_example_usage \ + "$ watch date\n" \ + "Mon Dec 17 10:31:40 GMT 2000\n" \ + "Mon Dec 17 10:31:42 GMT 2000\n" \ + "Mon Dec 17 10:31:44 GMT 2000" + +#define watchdog_trivial_usage \ + "[-t ] [-F] DEV" +#define watchdog_full_usage \ + "Periodically write to watchdog device DEV" \ + "\n\nOptions:\n" \ + " -t Timer period in seconds - default is 30\n" \ + " -F Stay in the foreground and don't fork" + +#define wc_trivial_usage \ + "[OPTION]... [FILE]..." +#define wc_full_usage \ + "Print line, word, and byte counts for each FILE, and a total line if\n" \ + "more than one FILE is specified. With no FILE, read standard input." \ + "\n\nOptions:\n" \ + " -c Print the byte counts\n" \ + " -l Print the newline counts\n" \ + " -L Print the length of the longest line\n" \ + " -w Print the word counts" +#define wc_example_usage \ + "$ wc /etc/passwd\n" \ + " 31 46 1365 /etc/passwd\n" + +#define wget_trivial_usage \ + "[-c|--continue] [-q|--quiet] [-O|--output-document file]\n" \ + " [--header 'header: value'] [-Y|--proxy on/off] [-P DIR]\n" \ + " [-U|--user-agent agent] url" +#define wget_full_usage \ + "Retrieve files via HTTP or FTP" \ + "\n\nOptions:\n" \ + " -c Continue retrieval of aborted transfers\n" \ + " -q Quiet mode - do not print\n" \ + " -P Set directory prefix to DIR\n" \ + " -O Save to filename ('-' for stdout)\n" \ + " -U Adjust 'User-Agent' field\n" \ + " -Y Use proxy ('on' or 'off')" + +#define which_trivial_usage \ + "[COMMAND ...]" +#define which_full_usage \ + "Locate a COMMAND" +#define which_example_usage \ + "$ which login\n" \ + "/bin/login\n" + +#define who_trivial_usage \ + " " +#define who_full_usage \ + "Print the current user names and related information" + +#define whoami_trivial_usage \ + "" +#define whoami_full_usage \ + "Print the user name associated with the current effective user id" + +#define xargs_trivial_usage \ + "[OPTIONS] [COMMAND] [ARGS...]" +#define xargs_full_usage \ + "Execute COMMAND on every item given by standard input" \ + "\n\nOptions:\n" \ + USE_FEATURE_XARGS_SUPPORT_CONFIRMATION( \ + " -p Prompt the user about whether to run each command\n") \ + " -r Do not run command for empty read lines\n" \ + USE_FEATURE_XARGS_SUPPORT_TERMOPT( \ + " -x Exit if the size is exceeded\n") \ + USE_FEATURE_XARGS_SUPPORT_ZERO_TERM( \ + " -0 Input filenames are terminated by a null character\n") \ + " -t Print the command line on stderr before executing it" +#define xargs_example_usage \ + "$ ls | xargs gzip\n" \ + "$ find . -name '*.c' -print | xargs rm\n" + +#define yes_trivial_usage \ + "[OPTION]... [STRING]..." +#define yes_full_usage \ + "Repeatedly output a line with all specified STRING(s), or 'y'" + +#define zcat_trivial_usage \ + "FILE" +#define zcat_full_usage \ + "Uncompress to stdout" + +#define zcip_trivial_usage \ + "[OPTIONS] ifname script" +#define zcip_full_usage \ + "Manage a ZeroConf IPv4 link-local address" \ + "\n\nOptions:\n" \ + " -f Foreground mode\n" \ + " -q Quit after address (no daemon)\n" \ + " -r 169.254.x.x Request this address first\n" \ + " -v Verbose" + +#endif /* __BB_USAGE_H__ */ diff --git a/i/pc104/initrd/conf/busybox/include/xatonum.h b/i/pc104/initrd/conf/busybox/include/xatonum.h new file mode 100644 index 0000000..cf088a4 --- /dev/null +++ b/i/pc104/initrd/conf/busybox/include/xatonum.h @@ -0,0 +1,157 @@ +/* vi: set sw=4 ts=4: */ +/* + * ascii-to-numbers implementations for busybox + * + * Copyright (C) 2003 Manuel Novoa III + * + * Licensed under GPLv2, see file LICENSE in this tarball for details. + */ + +/* Provides extern declarations of functions */ +#define DECLARE_STR_CONV(type, T, UT) \ +\ +unsigned type xstrto##UT##_range_sfx(const char *str, int b, unsigned type l, unsigned type u, const struct suffix_mult *sfx); \ +unsigned type xstrto##UT##_range(const char *str, int b, unsigned type l, unsigned type u); \ +unsigned type xstrto##UT##_sfx(const char *str, int b, const struct suffix_mult *sfx); \ +unsigned type xstrto##UT(const char *str, int b); \ +unsigned type xato##UT##_range_sfx(const char *str, unsigned type l, unsigned type u, const struct suffix_mult *sfx); \ +unsigned type xato##UT##_range(const char *str, unsigned type l, unsigned type u); \ +unsigned type xato##UT##_sfx(const char *str, const struct suffix_mult *sfx); \ +unsigned type xato##UT(const char *str); \ +type xstrto##T##_range_sfx(const char *str, int b, type l, type u, const struct suffix_mult *sfx) ;\ +type xstrto##T##_range(const char *str, int b, type l, type u); \ +type xato##T##_range_sfx(const char *str, type l, type u, const struct suffix_mult *sfx); \ +type xato##T##_range(const char *str, type l, type u); \ +type xato##T##_sfx(const char *str, const struct suffix_mult *sfx); \ +type xato##T(const char *str); \ + +/* Unsigned long long functions always exist */ +DECLARE_STR_CONV(long long, ll, ull) + + +/* Provides inline definitions of functions */ +/* (useful for mapping them to the type of the same width) */ +#define DEFINE_EQUIV_STR_CONV(narrow, N, W, UN, UW) \ +\ +static ATTRIBUTE_ALWAYS_INLINE \ +unsigned narrow xstrto##UN##_range_sfx(const char *str, int b, unsigned narrow l, unsigned narrow u, const struct suffix_mult *sfx) \ +{ return xstrto##UW##_range_sfx(str, b, l, u, sfx); } \ +static ATTRIBUTE_ALWAYS_INLINE \ +unsigned narrow xstrto##UN##_range(const char *str, int b, unsigned narrow l, unsigned narrow u) \ +{ return xstrto##UW##_range(str, b, l, u); } \ +static ATTRIBUTE_ALWAYS_INLINE \ +unsigned narrow xstrto##UN##_sfx(const char *str, int b, const struct suffix_mult *sfx) \ +{ return xstrto##UW##_sfx(str, b, sfx); } \ +static ATTRIBUTE_ALWAYS_INLINE \ +unsigned narrow xstrto##UN(const char *str, int b) \ +{ return xstrto##UW(str, b); } \ +static ATTRIBUTE_ALWAYS_INLINE \ +unsigned narrow xato##UN##_range_sfx(const char *str, unsigned narrow l, unsigned narrow u, const struct suffix_mult *sfx) \ +{ return xato##UW##_range_sfx(str, l, u, sfx); } \ +static ATTRIBUTE_ALWAYS_INLINE \ +unsigned narrow xato##UN##_range(const char *str, unsigned narrow l, unsigned narrow u) \ +{ return xato##UW##_range(str, l, u); } \ +static ATTRIBUTE_ALWAYS_INLINE \ +unsigned narrow xato##UN##_sfx(const char *str, const struct suffix_mult *sfx) \ +{ return xato##UW##_sfx(str, sfx); } \ +static ATTRIBUTE_ALWAYS_INLINE \ +unsigned narrow xato##UN(const char *str) \ +{ return xato##UW(str); } \ +static ATTRIBUTE_ALWAYS_INLINE \ +narrow xstrto##N##_range_sfx(const char *str, int b, narrow l, narrow u, const struct suffix_mult *sfx) \ +{ return xstrto##W##_range_sfx(str, b, l, u, sfx); } \ +static ATTRIBUTE_ALWAYS_INLINE \ +narrow xstrto##N##_range(const char *str, int b, narrow l, narrow u) \ +{ return xstrto##W##_range(str, b, l, u); } \ +static ATTRIBUTE_ALWAYS_INLINE \ +narrow xato##N##_range_sfx(const char *str, narrow l, narrow u, const struct suffix_mult *sfx) \ +{ return xato##W##_range_sfx(str, l, u, sfx); } \ +static ATTRIBUTE_ALWAYS_INLINE \ +narrow xato##N##_range(const char *str, narrow l, narrow u) \ +{ return xato##W##_range(str, l, u); } \ +static ATTRIBUTE_ALWAYS_INLINE \ +narrow xato##N##_sfx(const char *str, const struct suffix_mult *sfx) \ +{ return xato##W##_sfx(str, sfx); } \ +static ATTRIBUTE_ALWAYS_INLINE \ +narrow xato##N(const char *str) \ +{ return xato##W(str); } \ + +/* If long == long long, then just map them one-to-one */ +#if ULONG_MAX == ULLONG_MAX +DEFINE_EQUIV_STR_CONV(long, l, ll, ul, ull) +#else +/* Else provide extern defs */ +DECLARE_STR_CONV(long, l, ul) +#endif + +/* Same for int -> [long] long */ +#if UINT_MAX == ULLONG_MAX +DEFINE_EQUIV_STR_CONV(int, i, ll, u, ull) +#elif UINT_MAX == ULONG_MAX +DEFINE_EQUIV_STR_CONV(int, i, l, u, ul) +#else +DECLARE_STR_CONV(int, i, u) +#endif + +/* Specialized */ + +int BUG_xatou32_unimplemented(void); +static ATTRIBUTE_ALWAYS_INLINE uint32_t xatou32(const char *numstr) +{ + if (UINT_MAX == 0xffffffff) + return xatou(numstr); + if (ULONG_MAX == 0xffffffff) + return xatoul(numstr); + return BUG_xatou32_unimplemented(); +} + +/* Non-aborting kind of convertors */ + +unsigned long long bb_strtoull(const char *arg, char **endp, int base); +long long bb_strtoll(const char *arg, char **endp, int base); + +#if ULONG_MAX == ULLONG_MAX +static ATTRIBUTE_ALWAYS_INLINE +unsigned long bb_strtoul(const char *arg, char **endp, int base) +{ return bb_strtoull(arg, endp, base); } +static ATTRIBUTE_ALWAYS_INLINE +long bb_strtol(const char *arg, char **endp, int base) +{ return bb_strtoll(arg, endp, base); } +#else +unsigned long bb_strtoul(const char *arg, char **endp, int base); +long bb_strtol(const char *arg, char **endp, int base); +#endif + +#if UINT_MAX == ULLONG_MAX +static ATTRIBUTE_ALWAYS_INLINE +unsigned bb_strtou(const char *arg, char **endp, int base) +{ return bb_strtoull(arg, endp, base); } +static ATTRIBUTE_ALWAYS_INLINE +int bb_strtoi(const char *arg, char **endp, int base) +{ return bb_strtoll(arg, endp, base); } +#elif UINT_MAX == ULONG_MAX +static ATTRIBUTE_ALWAYS_INLINE +unsigned bb_strtou(const char *arg, char **endp, int base) +{ return bb_strtoul(arg, endp, base); } +static ATTRIBUTE_ALWAYS_INLINE +int bb_strtoi(const char *arg, char **endp, int base) +{ return bb_strtol(arg, endp, base); } +#else +unsigned bb_strtou(const char *arg, char **endp, int base); +int bb_strtoi(const char *arg, char **endp, int base); +#endif + +int BUG_bb_strtou32_unimplemented(void); +static ATTRIBUTE_ALWAYS_INLINE +uint32_t bb_strtou32(const char *arg, char **endp, int base) +{ + if (sizeof(uint32_t) == sizeof(unsigned)) + return bb_strtou(arg, endp, base); + if (sizeof(uint32_t) == sizeof(unsigned long)) + return bb_strtoul(arg, endp, base); + return BUG_bb_strtou32_unimplemented(); +} + +/* Floating point */ + +/* double bb_strtod(const char *arg, char **endp); */ diff --git a/i/pc104/initrd/conf/busybox/include/xregex.h b/i/pc104/initrd/conf/busybox/include/xregex.h new file mode 100644 index 0000000..23cf19c --- /dev/null +++ b/i/pc104/initrd/conf/busybox/include/xregex.h @@ -0,0 +1,18 @@ +/* vi: set sw=4 ts=4: */ +/* + * Busybox xregcomp utility routine. This isn't in libbb.h because the + * C library we're linking against may not support regex.h. + * + * Based in part on code from sash, Copyright (c) 1999 by David I. Bell + * Permission has been granted to redistribute this code under the GPL. + * + * Licensed under GPLv2 or later, see file License in this tarball for details. + */ +#ifndef __BB_REGEX__ +#define __BB_REGEX__ + +#include +char* regcomp_or_errmsg(regex_t *preg, const char *regex, int cflags); +void xregcomp(regex_t *preg, const char *regex, int cflags); + +#endif -- cgit v1.2.3