aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2024-04-08 19:49:16 +0000
committerElliott Hughes <enh@google.com>2024-04-08 19:49:22 +0000
commit454cf8f1812e3b949781fce04c38ff66fee44347 (patch)
treeb5d0161c70d7ba66728349e95b76b632d2dce9f3
parent9a270c2510a3c163c0ae68be4d3ba831c379471b (diff)
parent96d9f66127d84fba2f56f4754fc302e826968751 (diff)
downloadtoybox-454cf8f1812e3b949781fce04c38ff66fee44347.tar.gz
Upgrade toybox to 96d9f66127d84fba2f56f4754fc302e826968751
This project was upgraded with external_updater. Usage: tools/external_updater/updater.sh update external/toybox For more info, check https://cs.android.com/android/platform/superproject/+/main:tools/external_updater/README.md Test: TreeHugger Change-Id: I7b47e3a9faac842297b84cba305af77698f96e18
-rw-r--r--.gitignore18
-rw-r--r--METADATA4
-rw-r--r--android/device/generated/config.h2
-rw-r--r--android/device/generated/help.h2
-rw-r--r--android/linux/generated/config.h2
-rw-r--r--android/linux/generated/help.h2
-rw-r--r--android/mac/generated/config.h2
-rw-r--r--android/mac/generated/help.h2
-rw-r--r--lib/args.c11
-rw-r--r--lib/password.c2
-rwxr-xr-xmkroot/mkroot.sh35
-rwxr-xr-xscripts/make.sh6
-rwxr-xr-xscripts/prereq/build.sh16
-rw-r--r--scripts/prereq/generated/config.h4
-rw-r--r--scripts/prereq/generated/flags.h21
-rw-r--r--scripts/prereq/generated/help.h1
-rw-r--r--scripts/prereq/generated/newtoys.h1
-rwxr-xr-xscripts/recreate-prereq.sh5
-rwxr-xr-x[-rw-r--r--]tests/fold.test0
-rwxr-xr-x[-rw-r--r--]tests/touch.test0
-rw-r--r--toys/other/watch.c20
-rw-r--r--www/roadmap.html262
22 files changed, 220 insertions, 198 deletions
diff --git a/.gitignore b/.gitignore
index 43a79349..2b74ad14 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,10 +1,10 @@
syntax: glob
-.config*
-.single*
-change/
-generated/
-kconfig/mconf
-kconfig/conf
-kconfig/*.c
-toybox
-toybox_unstripped
+/.config*
+/.single*
+/change/
+/generated/
+/kconfig/mconf
+/kconfig/conf
+/kconfig/*.c
+/toybox
+/toybox_unstripped
diff --git a/METADATA b/METADATA
index d5348dcc..513ea30c 100644
--- a/METADATA
+++ b/METADATA
@@ -9,12 +9,12 @@ third_party {
last_upgrade_date {
year: 2024
month: 4
- day: 1
+ day: 8
}
homepage: "https://landley.net/toybox/"
identifier {
type: "Git"
value: "https://github.com/landley/toybox"
- version: "d1acc6e88be52e96e558717805b438c1f46ba529"
+ version: "96d9f66127d84fba2f56f4754fc302e826968751"
}
}
diff --git a/android/device/generated/config.h b/android/device/generated/config.h
index 903901ee..7dca3830 100644
--- a/android/device/generated/config.h
+++ b/android/device/generated/config.h
@@ -28,6 +28,8 @@
#define USE_TOYBOX_SMACK(...)
#define CFG_TOYBOX_SUID 0
#define USE_TOYBOX_SUID(...)
+#define CFG_TOYBOX_UID_SYS 100
+#define CFG_TOYBOX_UID_USR 500
#define CFG_TOYBOX_ZHELP 0
#define USE_TOYBOX_ZHELP(...)
#define CFG_ACPI 1
diff --git a/android/device/generated/help.h b/android/device/generated/help.h
index 44ce000a..74661d3d 100644
--- a/android/device/generated/help.h
+++ b/android/device/generated/help.h
@@ -146,7 +146,7 @@
#define HELP_watchdog "usage: watchdog [-F] [-t UPDATE] [-T DEADLINE] DEV\n\nStart the watchdog timer at DEV with optional timeout parameters.\n\n-F run in the foreground (do not daemonize)\n-t poke watchdog every UPDATE seconds (default 4)\n-T reboot if not poked for DEADLINE seconds (default 60)"
-#define HELP_watch "usage: watch [-tebx] [-n SEC] PROG ARGS\n\nRun PROG every -n seconds, showing output. Hit q to quit.\n\n-n Loop period in seconds (default 2)\n-t Don't print header\n-e Exit on error\n-b Beep on command error\n-x Exec command directly (vs \"sh -c\")"
+#define HELP_watch "usage: watch [-tebx] [-n SEC] COMMAND...\n\nRun COMMAND every -n seconds, showing output that fits terminal, q to quit.\n\n-n Number of seconds between repeats (default 2.0)\n-t Don't print header\n-e Exit on error\n-b Beep on command error\n-x Exec command directly (without \"sh -c\")"
#define HELP_w "usage: w\n\nShow who is logged on and since how long they logged in."
diff --git a/android/linux/generated/config.h b/android/linux/generated/config.h
index 737e2dc2..3e2afb23 100644
--- a/android/linux/generated/config.h
+++ b/android/linux/generated/config.h
@@ -28,6 +28,8 @@
#define USE_TOYBOX_SMACK(...)
#define CFG_TOYBOX_SUID 0
#define USE_TOYBOX_SUID(...)
+#define CFG_TOYBOX_UID_SYS 100
+#define CFG_TOYBOX_UID_USR 500
#define CFG_TOYBOX_ZHELP 0
#define USE_TOYBOX_ZHELP(...)
#define CFG_ACPI 0
diff --git a/android/linux/generated/help.h b/android/linux/generated/help.h
index 4f80dbc8..b3c74b17 100644
--- a/android/linux/generated/help.h
+++ b/android/linux/generated/help.h
@@ -148,7 +148,7 @@
#define HELP_watchdog "usage: watchdog [-F] [-t UPDATE] [-T DEADLINE] DEV\n\nStart the watchdog timer at DEV with optional timeout parameters.\n\n-F run in the foreground (do not daemonize)\n-t poke watchdog every UPDATE seconds (default 4)\n-T reboot if not poked for DEADLINE seconds (default 60)"
-#define HELP_watch "usage: watch [-tebx] [-n SEC] PROG ARGS\n\nRun PROG every -n seconds, showing output. Hit q to quit.\n\n-n Loop period in seconds (default 2)\n-t Don't print header\n-e Exit on error\n-b Beep on command error\n-x Exec command directly (vs \"sh -c\")"
+#define HELP_watch "usage: watch [-tebx] [-n SEC] COMMAND...\n\nRun COMMAND every -n seconds, showing output that fits terminal, q to quit.\n\n-n Number of seconds between repeats (default 2.0)\n-t Don't print header\n-e Exit on error\n-b Beep on command error\n-x Exec command directly (without \"sh -c\")"
#define HELP_w "usage: w\n\nShow who is logged on and since how long they logged in."
diff --git a/android/mac/generated/config.h b/android/mac/generated/config.h
index b06bd580..c395991f 100644
--- a/android/mac/generated/config.h
+++ b/android/mac/generated/config.h
@@ -28,6 +28,8 @@
#define USE_TOYBOX_SMACK(...)
#define CFG_TOYBOX_SUID 0
#define USE_TOYBOX_SUID(...)
+#define CFG_TOYBOX_UID_SYS 100
+#define CFG_TOYBOX_UID_USR 500
#define CFG_TOYBOX_ZHELP 0
#define USE_TOYBOX_ZHELP(...)
#define CFG_ACPI 0
diff --git a/android/mac/generated/help.h b/android/mac/generated/help.h
index 4f80dbc8..b3c74b17 100644
--- a/android/mac/generated/help.h
+++ b/android/mac/generated/help.h
@@ -148,7 +148,7 @@
#define HELP_watchdog "usage: watchdog [-F] [-t UPDATE] [-T DEADLINE] DEV\n\nStart the watchdog timer at DEV with optional timeout parameters.\n\n-F run in the foreground (do not daemonize)\n-t poke watchdog every UPDATE seconds (default 4)\n-T reboot if not poked for DEADLINE seconds (default 60)"
-#define HELP_watch "usage: watch [-tebx] [-n SEC] PROG ARGS\n\nRun PROG every -n seconds, showing output. Hit q to quit.\n\n-n Loop period in seconds (default 2)\n-t Don't print header\n-e Exit on error\n-b Beep on command error\n-x Exec command directly (vs \"sh -c\")"
+#define HELP_watch "usage: watch [-tebx] [-n SEC] COMMAND...\n\nRun COMMAND every -n seconds, showing output that fits terminal, q to quit.\n\n-n Number of seconds between repeats (default 2.0)\n-t Don't print header\n-e Exit on error\n-b Beep on command error\n-x Exec command directly (without \"sh -c\")"
#define HELP_w "usage: w\n\nShow who is logged on and since how long they logged in."
diff --git a/lib/args.c b/lib/args.c
index c5ba4505..9b94521d 100644
--- a/lib/args.c
+++ b/lib/args.c
@@ -206,12 +206,13 @@ static void gotflag(struct getoptflagstate *gof, struct opts *opt, int longopt)
while (*list) list=&((*list)->next);
*list = xzalloc(sizeof(struct arg_list));
(*list)->arg = arg;
- } else if (type == '#' || type == '-') {
- long long l = atolx(arg);
+ } else if (type == '#' || type == '-' || type == '%') {
+ long long l = (type == '%') ? xparsemillitime(arg) : atolx(arg);
if (type == '-' && !ispunct(*arg)) l*=-1;
- if (l < opt->val[0].l) help_exit("-%c < %ld", opt->c, opt->val[0].l);
- if (l > opt->val[1].l) help_exit("-%c > %ld", opt->c, opt->val[1].l);
+ arg = (type == '%') ? "ms" : "";
+ if (l < opt->val[0].l) help_exit("-%c < %ld%s", opt->c, opt->val[0].l, arg);
+ if (l > opt->val[1].l) help_exit("-%c > %ld%s", opt->c, opt->val[1].l, arg);
*(opt->arg) = l;
} else if (CFG_TOYBOX_FLOAT && type == '.') {
@@ -222,7 +223,7 @@ static void gotflag(struct getoptflagstate *gof, struct opts *opt, int longopt)
help_exit("-%c < %lf", opt->c, (double)opt->val[0].f);
if (opt->val[1].l != LONG_MAX && *f > opt->val[1].f)
help_exit("-%c > %lf", opt->c, (double)opt->val[1].f);
- } else if (type=='%') *(opt->arg) = xparsemillitime(arg);
+ }
}
// Parse this command's options string into struct getoptflagstate, which
diff --git a/lib/password.c b/lib/password.c
index f653e41d..461b4118 100644
--- a/lib/password.c
+++ b/lib/password.c
@@ -56,6 +56,7 @@ int read_password(char *buf, int buflen, char *mesg)
int i, tty = tty_fd(), ret = 1;
// Set NOP signal handler to return from the read.
+ fflush(0);
sigaction(SIGINT, &sa, &oldsa);
tcflush(tty, TCIFLUSH);
xset_terminal(tty, 1, 0, &oldtermio);
@@ -77,6 +78,7 @@ int read_password(char *buf, int buflen, char *mesg)
tcsetattr(0, TCSANOW, &oldtermio);
sigaction(SIGINT, &oldsa, 0);
xputc('\n');
+ fflush(0);
buf[i*!ret] = 0;
return ret;
diff --git a/mkroot/mkroot.sh b/mkroot/mkroot.sh
index a4879edd..cb6a78f9 100755
--- a/mkroot/mkroot.sh
+++ b/mkroot/mkroot.sh
@@ -135,7 +135,7 @@ if [ $$ -eq 1 ]; then
[ -z "$HANDOFF" ] && [ -e /mnt/init ] && HANDOFF=/mnt/init
[ -z "$HANDOFF" ] && HANDOFF=/bin/sh && echo -e '\e[?7hType exit when done.'
- setsid -c <>/dev/$(sed '$s@.*/@@' /sys/class/tty/console/active) >&0 2>&1 \
+ setsid -c <>/dev/$(sed '$s@.*[ /]@@' /sys/class/tty/console/active) >&0 2>&1 \
$HANDOFF
reboot -f &
sleep 5
@@ -197,7 +197,7 @@ get_target_config()
# Each target needs board config, serial console, RTC, ethernet, block device.
KARGS=ttyS0 VMLINUX=vmlinux
- if [ "$CROSS" == armv5l ]; then
+ if [ "$CROSS" == armv5l ] || [ "$CROSS" == armv4l ]; then
# This could use the same VIRT board as armv7, but let's demonstrate a
# different one requiring a separate device tree binary.
KARCH=arm KARGS=ttyAMA0 VMLINUX=arch/arm/boot/zImage
@@ -246,32 +246,32 @@ get_target_config()
QEMU="microblaze -M petalogix-s3adsp1800" KARCH=microblaze KARGS=ttyUL0
KCONF="$(be2csv MMU CPU_BIG_ENDIAN SERIAL_UARTLITE{,_CONSOLE} \
XILINX_{EMACLITE,MICROBLAZE0_{FAMILY="spartan3adsp",USE_{{MSR,PCMP}_INSTR,BARREL,HW_MUL}=1}})"
- elif [ "$CROSS" == mips ] || [ "$CROSS" == mipsel ]; then
- QEMU="mips -M malta" KARCH=mips
+ elif [ "${CROSS#mips}" != "$CROSS" ]; then # mips mipsel mips64 mips64el
+ QEMU="$CROSS -M malta" KARCH=mips
KCONF="$(be2csv MIPS_MALTA CPU_MIPS32_R2 BLK_DEV_SD NET_VENDOR_AMD PCNET32 \
PCI SERIAL_8250{,_CONSOLE} ATA{,_SFF,_BMDMA,_PIIX} POWER_RESET{,_SYSCON})"
- [ "$CROSS" == mipsel ] && KCONF+=,CPU_LITTLE_ENDIAN &&
- QEMU="mipsel -M malta"
+ [ "${CROSS/64/}" == "$CROSS" ] && KCONF+=,CPU_MIPS32_R2 ||
+ KCONF+=,64BIT,CPU_MIPS64_R1,MIPS32_O32
+ [ "${CROSS%el}" != "$CROSS" ] && KCONF+=,CPU_LITTLE_ENDIAN
elif [ "$CROSS" == or1k ]; then
KARCH=openrisc QEMU="or1k -M or1k-sim" KARGS=FIXME BUILTIN=1
- KCONF="$(be2csv OPENRISC_BUILTIN_DTB=\\\"or1ksim\\\" ETHOC SERIO \
- SERIAL_OF_PLATFORM SERIAL_8250{,_CONSOLE})"
+ KCONF="$(be2csv ETHOC SERIO SERIAL_OF_PLATFORM SERIAL_8250{,_CONSOLE})"
+ KCONF+=,OPENRISC_BUILTIN_DTB=\"or1ksim\"
elif [ "$CROSS" == powerpc ]; then
KARCH=powerpc QEMU="ppc -M g3beige"
KCONF="$(be2csv ALTIVEC PATA_MACIO BLK_DEV_SD MACINTOSH_DRIVERS SERIO \
- NET_VENDOR_8390 NE2K_PCI BOOTX_TEXT PPC_{PMAC,OF_BOOT_TRAMPOLINE} \
- ATA{,_SFF,_BMDMA} ADB{,_CUDA} SERIAL_PMACZILOG{,_TTYS,_CONSOLE})"
+ NET_VENDOR_{8390,NATSEMI} NE2K_PCI SERIAL_PMACZILOG{,_TTYS,_CONSOLE} \
+ ATA{,_SFF,_BMDMA} ADB{,_CUDA} BOOTX_TEXT PPC_{PMAC,OF_BOOT_TRAMPOLINE})"
elif [ "$CROSS" == powerpc64 ] || [ "$CROSS" == powerpc64le ]; then
KARCH=powerpc QEMU="ppc64 -M pseries -vga none" KARGS=hvc0
KCONF="$(be2csv PPC64 BLK_DEV_SD ATA NET_VENDOR_IBM IBMVETH HVC_CONSOLE \
PPC_{PSERIES,OF_BOOT_TRAMPOLINE,TRANSACTIONAL_MEM,DISABLE_WERROR} \
SCSI_{LOWLEVEL,IBMVSCSI})"
-#SECTION_MISMATCH_WARN_ONLY
[ "$CROSS" == powerpc64le ] && KCONF=$KCONF,CPU_LITTLE_ENDIAN
elif [ "$CROSS" = s390x ]; then
QEMU="s390x" KARCH=s390 VMLINUX=arch/s390/boot/bzImage
KCONF="$(be2csv MARCH_Z900 PACK_STACK S390_GUEST VIRTIO_{NET,BLK} \
- SCLP_{TTY,CONSOLE,VT220_{TTY,CONSOLE}})"
+ SCLP_VT220_{TTY,CONSOLE})"
elif [ "$CROSS" == sh2eb ]; then
BUILTIN=1 KARCH=sh
KCONF="$(be2csv CPU_{SUBTYPE_J2,BIG_ENDIAN} SH_JCORE_SOC SMP JCORE_EMAC \
@@ -287,7 +287,7 @@ get_target_config()
RTS7751R2D_PLUS SERIAL_SH_SCI{,_CONSOLE} NET_VENDOR_REALTEK 8139CP \
BLK_DEV_SD ATA{,_SFF,_BMDMA} PATA_PLATFORM BINFMT_ELF_FDPIC \
MEMORY_START=0x0c000000)"
-#see also SPI SPI_SH_SCI MFD_SM501 RTC_CLASS RTC_DRV_R9701 RTC_DRV_SH RTC_HCTOSYS
+#see also SPI{,_SH_SCI} MFD_SM501 RTC_{CLASS,DRV_{R9701,SH},HCTOSYS}
[ "$CROSS" == sh4eb ] && KCONF+=,CPU_BIG_ENDIAN
else die "Unknown \$CROSS=$CROSS"
fi
@@ -303,6 +303,7 @@ get_target_config()
# ----- Build kernel for target
+INITRAMFS=initramfs.cpio.gz
if [ -z "$LINUX" ] || [ ! -d "$LINUX/kernel" ]; then
echo 'No $LINUX directory, kernel build skipped.'
else
@@ -312,7 +313,6 @@ else
get_target_config
# Write the qemu launch script
- INITRAMFS=initramfs.cpio.gz
if [ -n "$QEMU" ]; then
[ -z "$BUILTIN" ] && INITRD='-initrd "$DIR"/'"$INITRAMFS"
{ echo DIR='"$(dirname $0)";' qemu-system-"$QEMU" -m 256 '"$@"' $QEMU_MORE \
@@ -350,13 +350,6 @@ else
# Expand miniconfig to full .config
make ARCH=$KARCH allnoconfig KCONFIG_ALLCONFIG="$OUTDOC/linux-miniconfig" &&
-
- # Second config pass to remove stupid kernel defaults
- # See http://lkml.iu.edu/hypermail/linux/kernel/1912.3/03493.html
- sed -e 's/# CONFIG_EXPERT .*/CONFIG_EXPERT=y/' -e "$(sed -E -e '/^$/d' \
- -e 's@([^,]*)($|,)@/^CONFIG_\1=y/d;$a# CONFIG_\1 is not set\n@g' \
- <<< VT,SCHED_DEBUG,DEBUG_MISC,X86_DEBUG_FPU)" -i .config &&
- yes "" | make ARCH=$KARCH oldconfig > /dev/null &&
cp .config "$OUTDOC/linux-fullconfig" &&
# Build kernel. Copy config, device tree binary, and kernel binary to output
diff --git a/scripts/make.sh b/scripts/make.sh
index 5fef9887..512fdc75 100755
--- a/scripts/make.sh
+++ b/scripts/make.sh
@@ -147,9 +147,9 @@ fi
# Rebuild config.h from .config
$SED -En $KCONFIG_CONFIG > "$GENDIR"/config.h \
- -e 's/^# CONFIG_(.*) is not set.*/#define CFG_\1 0\n#define USE_\1(...)/p' \
- -e 's/^CONFIG_(.*)=y.*/#define CFG_\1 1\n#define USE_\1(...) __VA_ARGS__/p'\
- || exit 1
+ -e 's/^# CONFIG_(.*) is not set.*/#define CFG_\1 0\n#define USE_\1(...)/p;t' \
+ -e 's/^CONFIG_(.*)=y.*/#define CFG_\1 1\n#define USE_\1(...) __VA_ARGS__/p;t'\
+ -e 's/^CONFIG_(.*)=/#define CFG_\1 /p' || exit 1
# Process config.h and newtoys.h to generate FLAG_x macros. Note we must
# always #define the relevant macro, even when it's disabled, because we
diff --git a/scripts/prereq/build.sh b/scripts/prereq/build.sh
index 4c88dbab..ac1fa11b 100755
--- a/scripts/prereq/build.sh
+++ b/scripts/prereq/build.sh
@@ -3,13 +3,13 @@
BUILD='cc -funsigned-char -I scripts/prereq -I . -Os -ffunction-sections -fdata-sections -fno-asynchronous-unwind-tables -fno-strict-aliasing -DTOYBOX_VERSION=""'
LINK=''
FILES="
-main.c toys/lsb/gzip.c toys/other/readlink.c toys/other/taskset.c
-toys/other/which.c toys/pending/tr.c toys/posix/basename.c toys/posix/cat.c
-toys/posix/chmod.c toys/posix/cmp.c toys/posix/dirname.c toys/posix/echo.c
-toys/posix/fold.c toys/posix/grep.c toys/posix/head.c toys/posix/ln.c
-toys/posix/ls.c toys/posix/mkdir.c toys/posix/od.c toys/posix/rm.c
-toys/posix/sed.c toys/posix/sort.c toys/posix/tail.c toys/posix/tee.c
-toys/posix/uname.c toys/posix/wc.c toys/posix/xargs.c
+main.c toys/lsb/gzip.c toys/other/readlink.c toys/other/which.c
+toys/pending/tr.c toys/posix/basename.c toys/posix/cat.c toys/posix/chmod.c
+toys/posix/cmp.c toys/posix/dirname.c toys/posix/echo.c toys/posix/fold.c
+toys/posix/grep.c toys/posix/head.c toys/posix/ln.c toys/posix/ls.c
+toys/posix/mkdir.c toys/posix/od.c toys/posix/rm.c toys/posix/sed.c
+toys/posix/sort.c toys/posix/tail.c toys/posix/tee.c toys/posix/uname.c
+toys/posix/wc.c toys/posix/xargs.c
"
-$BUILD lib/*.c $FILES $LINK -o toybox
+$BUILD lib/*.c $FILES $LINK -o toybox-prereq
diff --git a/scripts/prereq/generated/config.h b/scripts/prereq/generated/config.h
index 43eb0b6b..f46eed9b 100644
--- a/scripts/prereq/generated/config.h
+++ b/scripts/prereq/generated/config.h
@@ -530,8 +530,8 @@
#define USE_SYSCTL(...)
#define CFG_TAC 0
#define USE_TAC(...)
-#define CFG_NPROC 1
-#define USE_NPROC(...) __VA_ARGS__
+#define CFG_NPROC 0
+#define USE_NPROC(...)
#define CFG_TASKSET 0
#define USE_TASKSET(...)
#define CFG_TIMEOUT 0
diff --git a/scripts/prereq/generated/flags.h b/scripts/prereq/generated/flags.h
index 2565862c..811899dd 100644
--- a/scripts/prereq/generated/flags.h
+++ b/scripts/prereq/generated/flags.h
@@ -348,16 +348,6 @@
#undef FLAG_f
#endif
-// taskset <1^pa
-#undef OPTSTR_taskset
-#define OPTSTR_taskset "<1^pa"
-#ifdef CLEANUP_taskset
-#undef CLEANUP_taskset
-#undef FOR_taskset
-#undef FLAG_a
-#undef FLAG_p
-#endif
-
// tee ia ia
#undef OPTSTR_tee
#define OPTSTR_tee "ia"
@@ -751,15 +741,6 @@
#define FLAG_f (1LL<<4)
#endif
-#ifdef FOR_taskset
-#define CLEANUP_taskset
-#ifndef TT
-#define TT this.taskset
-#endif
-#define FLAG_a (FORCED_FLAG<<0)
-#define FLAG_p (FORCED_FLAG<<1)
-#endif
-
#ifdef FOR_tee
#define CLEANUP_tee
#ifndef TT
@@ -840,8 +821,6 @@
#define OPTSTR_gitremote "<1"
#undef OPTSTR_makedevs
#define OPTSTR_makedevs "<1>1d:"
-#undef OPTSTR_nproc
-#define OPTSTR_nproc "(all)"
#undef OPTSTR_toybox
#define OPTSTR_toybox 0
#undef OPTSTR_which
diff --git a/scripts/prereq/generated/help.h b/scripts/prereq/generated/help.h
index 9b17e37b..4457710d 100644
--- a/scripts/prereq/generated/help.h
+++ b/scripts/prereq/generated/help.h
@@ -18,7 +18,6 @@
#define HELP_ls ""
#define HELP_make ""
#define HELP_mkdir ""
-#define HELP_nproc ""
#define HELP_od ""
#define HELP_readlink ""
#define HELP_rm ""
diff --git a/scripts/prereq/generated/newtoys.h b/scripts/prereq/generated/newtoys.h
index 289a3c5e..a9ed915d 100644
--- a/scripts/prereq/generated/newtoys.h
+++ b/scripts/prereq/generated/newtoys.h
@@ -73,7 +73,6 @@ USE_NBD_CLIENT(OLDTOY(nbd-client, nbd_client, TOYFLAG_USR|TOYFLAG_BIN))
USE_NBD_SERVER(OLDTOY(nbd-server, nbd_server, TOYFLAG_USR|TOYFLAG_BIN))
USE_NETCAT(OLDTOY(nc, netcat, TOYFLAG_USR|TOYFLAG_BIN))
USE_NETCAT(NEWTOY(netcat, "^tElLw#<1W#<1p#<1>65535q#<1s:f:46uUnvz[!tlL][!Lw][!Lu][!46U]", TOYFLAG_BIN))
-USE_NPROC(NEWTOY(nproc, "(all)", TOYFLAG_USR|TOYFLAG_BIN))
USE_OD(NEWTOY(od, "j#vw#<1=16N#xsodcbA:t*", TOYFLAG_USR|TOYFLAG_BIN))
USE_PASSWD(NEWTOY(passwd, ">1a:dlu", TOYFLAG_STAYROOT|TOYFLAG_USR|TOYFLAG_BIN))
USE_PASTE(NEWTOY(paste, "d:s", TOYFLAG_USR|TOYFLAG_BIN))
diff --git a/scripts/recreate-prereq.sh b/scripts/recreate-prereq.sh
index 328290ef..ec90f5ac 100755
--- a/scripts/recreate-prereq.sh
+++ b/scripts/recreate-prereq.sh
@@ -6,7 +6,7 @@
mkroot/record-commands make clean defconfig toybox
sed -i 's/default y/default n/' generated/Config.probed
-CMDLIST="$(echo toybox; ./toybox cut -DF 1 log.txt | sort -u)"
+CMDLIST="$(echo toybox; ./toybox cut -DF 1 log.txt | sort -u | grep -v nproc)"
{
for i in $(tr '[:lower:]' '[:upper:]' <<<"$CMDLIST")
do
@@ -24,10 +24,11 @@ cat > scripts/prereq/build.sh << 'EOF'
BUILD='cc -funsigned-char -I scripts/prereq -I . -Os -ffunction-sections -fdata-sections -fno-asynchronous-unwind-tables -fno-strict-aliasing -DTOYBOX_VERSION=""'
LINK=''
EOF
+grep -A999 FILES= generated/build.sh >> scripts/prereq/build.sh
+sed -i 's/ toybox$/&-prereq/' scripts/prereq/build.sh
# harvest stripped down headers
-grep -A999 FILES= generated/build.sh >> scripts/prereq/build.sh
echo > scripts/prereq/generated/tags.h
sed 's/.*/#define HELP_& ""/' <<<"$CMDLIST" > scripts/prereq/generated/help.h
egrep "($(xargs <<<"$CMDLIST"|tr ' [:lower:]' '|[:upper:]'))" \
diff --git a/tests/fold.test b/tests/fold.test
index 80c7fd3c..80c7fd3c 100644..100755
--- a/tests/fold.test
+++ b/tests/fold.test
diff --git a/tests/touch.test b/tests/touch.test
index 6d131d7c..6d131d7c 100644..100755
--- a/tests/touch.test
+++ b/tests/touch.test
diff --git a/toys/other/watch.c b/toys/other/watch.c
index 995aae15..a47aa3c2 100644
--- a/toys/other/watch.c
+++ b/toys/other/watch.c
@@ -1,4 +1,4 @@
-/* watch.c - Execute a program periodically
+/* watch.c - Show bounded output of a periodically executed command.
*
* Copyright 2013 Sandeep Sharma <sandeep.jack2756@gmail.com>
* Copyright 2013 Kyungwan Han <asura321@gmail.com>
@@ -6,21 +6,22 @@
* No standard. See http://man7.org/linux/man-pages/man1/watch.1.html
*
* TODO: trailing combining characters
+
USE_WATCH(NEWTOY(watch, "^<1n%<100=2000tebx", TOYFLAG_USR|TOYFLAG_BIN))
config WATCH
bool "watch"
default y
help
- usage: watch [-tebx] [-n SEC] PROG ARGS
+ usage: watch [-tebx] [-n SEC] COMMAND...
- Run PROG every -n seconds, showing output. Hit q to quit.
+ Run COMMAND every -n seconds, showing output that fits terminal, q to quit.
- -n Loop period in seconds (default 2)
+ -n Number of seconds between repeats (default 2.0)
-t Don't print header
-e Exit on error
-b Beep on command error
- -x Exec command directly (vs "sh -c")
+ -x Exec command directly (without "sh -c")
*/
#define FOR_watch
@@ -57,7 +58,7 @@ static void watch_child(int sig)
static int watch_escape(FILE *out, int cols, int wc)
{
if (wc==27 || (wc>=7 && wc<=13)) return -1;
- if (wc < 32) return 0;
+ if (wc<32) return 0;
return crunch_escape(out, cols, wc);
}
@@ -88,13 +89,12 @@ void watch_main(void)
xsignal_flags(SIGCHLD, watch_child, SA_RESTART|SA_NOCLDSTOP);
for (;;) {
- fflush(NULL);
+ fflush(0);
// Time for a new period?
if ((now = millitime())>=then) {
-
// Incrementing then instead of adding offset to now avoids drift,
- // loop is in case we got suspend/resumed and need to skip periods
+ // loop in case we got suspend/resumed and need to skip periods
while ((then += TT.n)<=now);
start_redraw(&width, &height);
@@ -112,7 +112,7 @@ void watch_main(void)
if (pad>0) draw_trim(cmd, -pad, pad);
printf("%c", pad<cmdlen ? '*' : ' ');
if (width) xputs(ss+(width>ctimelen ? 0 : width-1));
- if (yy>=3) xprintf("\r\n");
+ if (height>=3) xprintf("\r\n");
xx = 0;
yy = 2;
}
diff --git a/www/roadmap.html b/www/roadmap.html
index 79a44089..78b1729b 100644
--- a/www/roadmap.html
+++ b/www/roadmap.html
@@ -20,6 +20,7 @@
<a href=#sash>sash</a>, <a href=#sbase>sbase</a>,
<a href=#uclinux>uclinux</a>...</li>
<li><a href=#packages>Other Packages</a></li>
+<li><a href=#todo>TODO list</a></li>
</ul>
<a name="goals" />
@@ -34,7 +35,7 @@ commplation.</p>
<p>The most interesting publicly available standards are A) POSIX-2008 (also
known as SUSv4), B) the Linux Standard Base version 4.1, and C) the official
<a href=https://www.kernel.org/doc/man-pages/>Linux man pages</a>.
-But they include commands we've decided not implement, exclude
+But each of those include commands we've decided not implement, exclude
commands or features we have, and don't always entirely match reality.</p>
<p>The most thorough real world test (other than a large interactive
@@ -48,19 +49,17 @@ plus <a href=faq.html#cross>musl-cross-make</a> to hermetically build
<a href=https://source.android.com>AOSP</a>.</p>
<p>We've also checked what commands were provided by similar projects
-(klibc, sash, sbase, embutils,
-nash, and beastiebox), looked at various vendor configurations of busybox,
-and collected end user requests.</p>
+(klibc, sash, sbase, embutils, nash, beastiebox...), looked at various
+vendor configurations of busybox, and collected end user requests.</p>
<p>Finally, we'd like to provide a good replacement for the Bash shell,
-which was the first program Linux ever ran and remains the standard shell
-of Linux (no matter what Ubuntu says). This doesn't necessarily mean including
-every last Bash 5.x feature, but does involve {various,features} &lt(beyond)
-posix.</p>
+which was the first program Linux ever ran (leading up to the 0.0.1 release
+in 1991) and remains the standard shell of Linux (no matter what Ubuntu says).
+This doesn't necessarily mean including every last Bash 5.x feature, but
+does involve {various,features} &lt(beyond) posix.</p>
<p>See the <a href=status.html>status page</a> for the categorized command list
-and progress towards implementing it. There's also a
-<a href=todo.html>historical todo list</a> from the project's 2011 relaunch.</p>
+and progress towards implementing it.</p>
<hr />
<a name="standards">
@@ -68,22 +67,30 @@ and progress towards implementing it. There's also a
<h3><a name=susv4 /><a href="#susv4">POSIX-2008/SUSv4</a></h3>
<p>The best standards describe reality rather than attempting to impose a
-new one. A good standard should document, not legislate.
+new one. I.E. "A good standard should document, not legislate."
Standards which document existing reality tend to be approved by
-more than one standards body, such ANSI and ISO both approving <a href=https://landley.net/c99-draft.html>C99</a>. That's why IEEE 1003.1-2008,
+more than one standards body, such as ANSI and ISO both approving <a href=https://landley.net/c99-draft.html>C99</a>. That's why IEEE 1003.1-2008,
the Single Unix Specification version 4, and the Open Group Base Specification
-edition 7 are all the same standard from three sources, but most people just
-call it "posix" (portable operating system derived from unix).
+edition 7 are all the same standard from three sources, which most people just
+call "posix" (short for "portable operating system that works like unix").
It's available <a href=https://pubs.opengroup.org/onlinepubs/9699919799>online in full</a>, and may be downloaded as a tarball.
Previous versions (<a href=https://pubs.opengroup.org/onlinepubs/009695399/>SUSv3</a> and
<a href=https://pubs.opengroup.org/onlinepubs/7990989775/>SUSv2</a>)
-are also available.
-(Note:
+are also available.</p>
+
+<p>The original Posix was a collection of different standards (POSIX.1
+from 1988, POSIX.1b from 1993, and POSIX.1c from 1995). The unified
+SUSv2 came out in 1997 and SUSv3 came out in 2001.
<a href=https://pubs.opengroup.org/onlinepubs/9699919799.2008edition/>Posix
-2008</a> was reissued in 2013 and 2018, the first was minor wordsmithing
+2008</a> was then reissued in 2013 and 2018, the first was minor wordsmithing
with no behavioral changes, the second was to renew a ten year timeout
-to still be considered a "current standard" by some government regulations.
-It's still posix-2008/SUSv4/issue 7.)</p>
+to still be considered a "current standard" by some government regulations,
+but isn't officially a new standard. It's still posix-2008/SUSv4/Issue 7.
+The endless committee process to produce
+"Issue 8" has been ongoing for over 15 years now, with conference
+calls on mondays and thursdays, mostly to discuss recent bug tracker
+entries then publish the minutes of the meeting on the mailing list.
+Prominent committee members have died during this time.</p>
<h3>Why not just use posix for everything?</h3>
@@ -116,7 +123,7 @@ versions of the standard have been removed, while obsolete commands like
cksum, compress, sccs and uucp remain with no mention of modern counterparts
like crc32/sha1sum, gzip/xz, svn/git or scp/rsync. Meanwhile posix' description
of the commands
-themselves are missing dozens of features and specify silly things like ebcdic
+themselves are missing dozens of features, and specify silly things like ebcdic
support in dd or that wc should use %d (not %lld) for byte counts. So
we have to extensively filter posix to get a useful set of recommendations.</p>
@@ -131,7 +138,7 @@ val what), fortran support (asa fort77), and batch processing support (batch
qalter qdel qhold qmove qmsg qrerun qrls qselect qsig qstat qsub).</p>
<p>Some commands are for a compiler toolchain (ar c99 cflow ctags cxref gencat
-iconv lex m4 make nm strings strip tsort yacc) which is out of scope for
+iconv lex m4 make nm strings strip yacc) which is out of scope for
toybox and should be supplied externally. (Some of these might be
revisited later, but not for toybox 1.0.)</p>
@@ -141,7 +148,7 @@ type ulimit umask unalias wait). These may be implemented as part of the
built-in toybox shell, but are not exported into $PATH via symlinks and
thus are not part of toybox's main command list. (If you fork a
child process and have it "cd" then exit, you've accomplished nothing.)
-Again, what posix provides is incomplete: a shell also needs exit, if, while,
+Again, what posix lists as "commands" is incomplete: a shell also needs exit, if, while,
for, case, export, set, unset, trap, exec... (And for bash compatibility
function, source, declare...)</p>
@@ -167,7 +174,7 @@ csplit cut date dd df diff dirname du echo env expand expr false file find
fold fuser getconf grep head id join kill link ln logger logname ls man
mkdir mkfifo more mv newgrp nice nl nohup od paste patch printf ps
pwd renice rm rmdir sed sh sleep sort split stty tabs tail tee test time
-touch tput tr true tty uname unexpand uniq unlink uudecode uuencode vi wc
+touch tput tr true tsort tty uname unexpand uniq unlink uudecode uuencode vi wc
who xargs zcat
</span>
</b></blockquote>
@@ -182,11 +189,11 @@ being consumed by <a href=https://landley.net/notes-2010.html#18-07-2010>the Lin
<p>Where POSIX allowed its standards process to be compromised
by leaving things out (but what
they DID standardize tends to be respected, if sometimes obsolete),
-the Linux Standard Base's failure mode is different. They respond to
-pressure by including anything their members pay them enough to promote,
+the Linux Standard Base's failure mode was different. They responded to
+pressure by including anything their members paid them enough to promote,
such as allowing Red Hat to push
RPM into the standard even though all sorts of distros (Debian, Slackware, Arch,
-Gentoo, Android) don't use it and never will. This means anything in the LSB is
+Gentoo, Android, Alpine...) don't use it and never will. This means anything in the LSB is
at best a suggestion: arbitrary portions of this standard are widely
ignored.</p>
@@ -199,19 +206,20 @@ of those donors</a> regardless of technical merit. (The Linux Foundation, which
maintains the LSB, is NOT a 501c3. It's a 501c6, the
same kind of legal entity as the Tobacco Institute and
<a href=https://lwn.net/Articles/706585/>Microsoft's</a>
-old "<a href=https://en.wikipedia.org/wiki/Don%27t_Copy_That_Floppy>Don't Copy That Floppy</a>" program.) Debian officially
+old "<a href=https://en.wikipedia.org/wiki/Don%27t_Copy_That_Floppy>Don't Copy That Floppy</a>" campaign.) Debian officially
<a href=http://lwn.net/Articles/658809>washed its hands of LSB</a> by
refusing to adopt release 5.0 in 2015, and no longer even pretends to support
it (which affects Debian derivatives like Ubuntu and Knoppix). Toybox has
-stayed on 4.1 for similar reasons: a lot of historical effort went into
-producing the standard before the Linux Foundation took over.</p>
+stayed on 4.1 for similar reasons.</p>
<p>That said, Posix by itself isn't enough, and this is the next most
-comprehensive standards effort for Linux so far, so we salvage what we can.</p>
+comprehensive standards effort for Linux so far, so we salvage what we can.
+A lot of historical effort went into producing the standard before the
+Linux Foundation took over.</p>
<h3>Analysis</h3>
-<p>The LSB specifies a <a href=http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/cmdbehav.html>list of command line
+<p>LSB 4.1 specifies a <a href=http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/cmdbehav.html>list of command line
utilities</a>:</p>
<blockquote><b>
@@ -223,8 +231,8 @@ patch pidof remove_initd renice sed sendmail seq sh shutdown su sync
tar umount useradd userdel usermod xargs zcat
</b></blockquote>
-<p>Where posix specifies one of those commands, LSB's deltas tend to be
-accomodations for broken tool versions which aren't up to date with the
+<p>Where posix specifies one of those commands, LSB's deltas tended to be
+accomodations for broken tool versions which ween't up to date with the
standard yet. (See <a href=http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/more.html>more</a> and <a href=http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/xargs.html>xargs</a>
for examples.)</p>
@@ -234,7 +242,7 @@ various legacy tool implementations "compliant", this means we're mostly
interested in the set of LSB tools that aren't mentioned in posix.</p>
<p>Of these, gettext and msgfmt are internationalization, install_initd and
-remove_initd weren't present in Ubuntu 10.04, lpr is out of scope,
+remove_initd weren't present even in Ubuntu 10.04, lpr is out of scope,
lsb_release just reports information in /etc/os-release, and sendmail's
turned into a pile of cryptographic verification and DNS shenanigans due
to spammers.</p>
@@ -252,12 +260,13 @@ su sync tar umount useradd userdel usermod zcat
<h3><a name=rfc /><a href="#rfc">IETF RFCs and Man Pages</a></h3>
-<p>They're very nice, but there's thousands of them.</p>
+<p>They're very nice, but there's thousands of them. The signal to noise
+ratio here is terrible.</p>
<p>Discussion of standards wouldn't be complete without the Internet
Engineering Task Force's "<a href=https://www.rfc-editor.org/in-notes/rfc-index.txt>Request For Comments</a>" collection and Michael Kerrisk's
-<a href=https://www.kernel.org/doc/man-pages/>Linux man-pages project</a>.
-Except these aren't standards, they're collections of documentation with
+<a href=https://www.kernel.org/doc/man-pages/>Linux man-pages project</a>...
+except these aren't standards, they're collections of documentation with
low barriers to inclusion. They're not saying "you should support
X", they're saying "if you do, here's how".
Thus neither really helps us select which commands to include.</p>
@@ -275,13 +284,14 @@ the result. As with man pages they can be <a href=https://www.ietf.org/rfc/rfc06
<a href=https://www.ietf.org/rfc/rfc1951.txt>terse and impenetrable</a>,
have developed a certain amount of <a href=https://www.ietf.org/rfc/rfc8179.txt>bureaucracy</a> over the years, and often the easiest way to understand what
they <a href=https://www.ietf.org/rfc/rfc4330.txt>document</a> is to find an <a href=https://www.ietf.org/rfc/rfc1769.txt>earlier version</a> to read first.
-(The greybeard community problem where all documentation is written by people
-who don't remember NOT already knowing this stuff.)</p>
+(This is an example of the greybeard community problem, where all current
+documentation was written by people who don't remember NOT already knowing
+this stuff and the resources they originally learned from are long gone.)</p>
<p>That said, RFC documents can be useful (especially for networking protocols)
and the four URL templates the recommended starting files
-for new commands (toys/example/{skeleton,hello}.c) provide point to posix, lsb,
-man, and rfc pages.</p>
+for new commands (hello.c and skeleton.c in the toys/example directory)
+provide point to example posix, lsb, man, and rfc pages online.</p>
<hr />
<a name="dev_env">
@@ -310,18 +320,18 @@ resize2fs tune2fs fsck.ext2 genext2fs mke2fs xzcat
configure, make, and install in each package, and providing basic command line
facilities such as a text editor. (It does not include a compiler toolchain or
C library, those are outside the scope of the toybox project, although mkroot
-has a <a href=https://landley.net/code/qcc>potentialy follow-up project</a>.
+has a <a href=https://landley.net/code/qcc>potential follow-up project</a>.
For now we use distro toolchains,
<a href=https://github.com/richfelker/musl-cross-make>musl-cross-make</a>,
and the Android NDK for build testing.)
-That build system also instaled bash 2.05b as #!/bin/sh and its scripts
+That build system also installed bash 2.05b as #!/bin/sh and its scripts
required bash extensions not present in shells such as busybox ash.
-To replace that toysh needs to supply several bash extensions _and_ work
+To replace that, toysh needs to supply several bash extensions _and_ work
when called under the name "bash".</p>
<p>The above command list was collected using a command line recording wrapper
-(scripts/record-commands and toys/example/logpath.c) which scripts/mkroot.sh
-also uses to populate root/log/*-commands.txt. Try
+(mkroot/record-commands and toys/example/logpath.c) which mkroot/mkroot.sh
+also uses to populate root/build/log/*-commands.txt. Try
<b>awk '{print $1}' root/build/log/*-commands.txt | sort -u | grep -v musl | xargs</b>
after building a mkroot target to see the list of commands called out
of the $PATH during that build.</p>
@@ -351,7 +361,7 @@ project ("mkroot") designed to use an existing cross+native toolchain (such as
or the Android NDK) instead of building its own cross and native compilers
from source. In 2019 the still-incomplete
mkroot was merged into toybox as the "make root" target (which runs
-scripts/mkroot.sh). This is intended
+mkroot/mkroot.sh). This is intended
as a simpler way of providing essentially the same build environment, and doesn't
significantly affect the rest of this analysis (although the "rebuild itself
from source" test should now include building musl-cross-make under either
@@ -453,7 +463,7 @@ replace existing Android versions, so we should take into account Android's use
cases when doing so. This includes:</p>
<blockquote><b>
<span id=toolbox>
-dd getevent gzip modprobe newfs_msdos sh
+getevent gzip modprobe newfs_msdos sh
</span>
</b></blockquote>
@@ -465,7 +475,7 @@ the libmodprobe-based implementation.) These should be a priority for
cleanup:</p>
<blockquote><b>
-bc dd diff expr getfattr lsof more stty tr traceroute
+diff expr getopt tr brctl getfattr lsof modprobe more stty traceroute vi
</b></blockquote>
<p>Android wishlist:</p>
@@ -499,7 +509,7 @@ awk bc bzip2 jar java javap m4 make python python2.7 python3 xz
</b></blockquote>
<p>Subtracting what's already in toybox (including the following toybox toys
-that are still in pending: <code>dd diff expr getopt gzip lsof tr</code>),
+that are still in pending: <code>diff expr gzip lsof tr</code>),
that leaves:</p>
<blockquote><b>
@@ -606,7 +616,7 @@ usleep vi watch wc wget which who whoami xargs xzcat yes zcat
</span>
</b></blockquote>
-
+<p>Nobody seems entirely sure why.</p>
<a name="fhs" />
<hr /><a href=fhs>Filesystem Hierachy Standard</a>
@@ -619,8 +629,8 @@ managed to achieve before they chased away the hobbyists maintaining it.
Only one version (3.0 in 2015) has been released since the Linux Foundation
absorbed the FHS. The previous release, Version 2.3, was released in 2004.
The Linux Foundation did not retain earlier versions. The contents of
-the relevant sections appear identical between the two versions, the
-Linux Foundation just added section numbers.</p>
+the relevant sections appear identical between the two versions, in the
+11 years between releases the Linux Foundation just added section numbers.</p>
<p><a href=https://refspects.linuxfoundation.org/FHS_3.0/fhs-3.0.html>FHS 3.0</a>
section 3.4.2 requires commands to be in the /bin directory, and then 3.4.3
@@ -629,9 +639,9 @@ and then 3.16.2 and 3.16.3 similarly cover /sbin. There are linux
specific sections in 6.1.2 and 6.1.6 but everything in them is obsolete.</p>
<p>The /bin options include csh but not bash, and ed but not vi.
-The /sbin options have update which seems obsolete (filesystem
+The /sbin options have "update" which seems obsolete (filesystem
buffers haven't needed a userspace process to flush them for DECADES),
-fastboot and fasthalt (reboot and halt have -nf), and
+"fastboot" and "fasthalt" (reboot and halt have -nf), and
fsck.* and mkfs.* that don't actually specify any specific filesystems.
Removing that gives us:</p>
@@ -656,15 +666,15 @@ which sed make bash patch gzip bzip2 tar cpio unzip rsync file bc wget
</b></p></blockquote>
<p>(It also lists binutils gcc g++ perl python, and for debian it wants
-build-essential. And it wants file to be in /usr/bin because
+the build-essential meta-package. And it wants file to be in /usr/bin because
<a href=https://git.busybox.net/buildroot/tree/support/dependencies/dependencies.sh?h=2018.02.x#n84>libtool
breaks otherwise</a>.)</p>
<p>Oddly, buildroot can't NOT cross compile. Buildroot does not support a cross toolchain that lives in "/usr/bin"
-with a prefix of "" (if you try, and chop out the test for a blank prefix,
-it dies trying to run "/usr/bin/-gcc"). You can patch your way to
-making it work if you try, but buildroot's developers explicitly do not
-support this.</p>
+with a prefix of "". If you try, and chop out the test for a blank prefix,
+it dies trying to run "/usr/bin/-gcc". In theory you can modify any open source
+project to do anything if you rewrite enough of it, but buildroot's developers
+explicitly do not support this usage model.</p>
<hr /><a name=klibc />
<h2>klibc:</h2>
@@ -702,19 +712,15 @@ which removes mknodes, mksyntax, sha1hash, and fixdep from the list.
"rm -rf -- $@", and minips is more commonly called "ps": I'm not doing aliases
for these oddball names.
The "kinit" command is another gratuitous rename, it's init running as PID 1.
-The halt, poweroff, and reboot commands work with it.</p>
-
-<p>Yet more stale forks of dash and gzip got sucked in here (see "dubious
+The halt, poweroff, and reboot commands work with it.
+Yet more stale forks of dash and gzip got sucked in here (see "dubious
license terms" above).</p>
<p>In theory "blkid" or "file" handle fstype (and df for mounted filesystems),
-but we could do fstype.</p>
-
-<p>We should implement nfsmount, and probably smbmount
-and p9mount even though this hasn't got one. The reason these aren't
-in the base "mount" command is they interactively query login credentials.</p>
-
-<p>The ipconfig command here has a built in dhcp client, so it's ifconfig
+but we could do fstype. We should also implement nfsmount, and probably smbmount
+and p9mount even though this hasn't got one. (The reason these aren't
+in the base "mount" command is they interactively query login credentials.)
+The ipconfig command here has a built in dhcp client, so it's ifconfig
and dhcpcd and maybe some other stuff.</p>
<p>The resume command is... weird. It finds a swap partition and reads data
@@ -769,8 +775,8 @@ non-configurable iconv now that utf8+unicode exist.</li>
unistd.h; it probably belongs in the development toolchain.</li>
<li><b>getent</b> handles retrieving entries from passwd-style databases
(in a rather lame way) and is trivially replacable by grep.</li>
-<li><b>locale</b> was discussed under <a href=#susv4>posix</a>.
-localedef compiles locale definitions, which musl currently does not use.</li>
+<li><b>locale</b> was discussed under <a href=#susv4>posix</a>.</li>
+<li><b>localedef</b> compiles locale definitions, which musl currently does not use.</li>
<li><b>mtrace</b> is a perl script to use the malloc debugging that glibc has built-in;
this is not relevant for musl, and would necessarily vary with libc.</li>
<li><b>nscd</b> is a name service caching daemon, which is not yet relevant for musl.</li>
@@ -794,7 +800,7 @@ outputting a great deal of extra information about each timezone.</li>
<li><b>zic</b> converts a description of a timezone to a file in tz format.</li>
</ul>
-<p>We implemented getconf, and I could see maybe arguing for ncsd.
+<p>We implemented getconf and iconv, and I could see maybe arguing for ncsd.
The rest are not relevant to toybox.</p>
</b></blockquote>
@@ -1394,43 +1400,12 @@ assembler for each architecture.)</p>
<h3>Packages from LFS ch6 toybox does NOT plan to replace:</h3>
-<ul>
-<li><b>linux-api-headers</b></li>
-<li><b>man-pages glibc</b></li>
-<li><b>zlib</b></li>
-<li><b>readline</b></li>
-<li><b>gmp</b></li>
-<li><b>mpfr</b></li>
-<li><b>mpc</b></li>
-<li><b>gcc</b></li>
-<li><b>pkg-config</b></li>
-<li><b>ncurses</b></li>
-<li><b>acl</b></li>
-<li><b>libcap</b></li>
-<li><b>psmisc</b></li>
-<li><b>iana-etc</b></li>
-<li><b>libtool</b></li>
-<li><b>gdbm</b></li>
-<li><b>gperf</b></li>
-<li><b>expat</b></li>
-<li><b>perl</b></li>
-<li><b>XML::Parser</b></li>
-<li><b>intltool</b></li>
-<li><b>autoconf</b></li>
-<li><b>automake</b></li>
-<li><b>gettext</b></li>
-<li><b>libelf</b></li>
-<li><b>libffi</b></li>
-<li><b>openssl</b></li>
-<li><b>python</b></li>
-<li><b>ninja</b></li>
-<li><b>meson</b></li>
-<li><b>check</b></li>
-<li><b>groff</b></li>
-<li><b>grub</b></li>
-<li><b>libpipeline</b></li>
-<li><b>texinfo</b></li>
-</ul>
+<blockquote><p><b>
+linux-api-headers man-pages glibc zlib readline gmp mpfr mpc gcc pkg-config
+ncurses acl libcap psmisc iana-etc libtool gdbm gperf expat perl XML::Parser
+intltool autoconf automake gettext libelf libffi openssl python ninja meson
+check groff grub libpipeline texinfo
+</b></p></blockquote>
<p>That said, we do implement our own zlib and readline replacements, and
presumably _could_ export them as library bindings. Plus we provide
@@ -1447,5 +1422,72 @@ created busybox mdev way back when (which replaces it) and plans to do a
new one for toybox as soon as we work out what subset is still needed now that
devtmpfs is available.</p>
+<hr /><a name=todo /><h2>TODO list</h2>
+
+<ul>
+<li><p>Fill out "development" command list (finish toysh, implement awk, etc.)</p></li>
+
+<p><li>Handle "pending" directory.
+<ul>
+<li>Cleanup and promote the "pending" commands used to run mkroot.</li>
+<ul><li>Enabled by $PENDING in mkroot.sh (sh route)</li></ul>
+
+<li>Cleanup and promote the "pending" commands used to build mkroot.</li>
+<ul><li>In scripts/install.sh the $PENDING list symlinked from the host $PATH
+into "make airlock" directory (expr git tr bash sh gzip awk bison flex make).</li></ul>
+<li>Cleanup and promote all $PENDING commands used by android
+<ul><li><b>grep pending Android.bp</b>
+in <a href=https://android.googlesource.com/platform/external/toybox>their repo</a>
+(diff expr tr brctl getfattr lsof modprobe more stty traceroute vi)</li></ul>
+</li>
+
+<li>Cleanup/promote/delete remaining "pending" commands</li>
+<ul><li>Once empty, remove toys/pending and maybe collape together other
+directories into just toys/*.c (with "default n" meaning examples, and
+a "posix_defconfig" target alongside macos/bsd/android).</li></ul>
+
+</ul></li></p>
+
+<li><p>Replace kconfig/ with a new implementation (menu/def/yes/no/old).</p></li>
+
+<p><li>Automate Linux From Scratch build.
+<ul>
+
+<li>Automate the <a href=https://linuxfromscratch.org/lfs/downloads/stable/LFS-BOOK-12.0-NOCHUNKS.html>existing build</a>
+<ul>
+<li>create chroot directory from host (chapters 4-6)</li>
+<li>setup/launch chroot directory (start of chapter 7)</li>
+<li>build in chroot directory (chapters 7-10)</li>
+</ul>
+</li>
+
+<li>Add record-commands support (both inside and outside chroot)</li>
+<li>Build host-&gt;chroot part with PATH=$PWD/airlock (moving one command over at a time)
+<ul><li>Set up native compiler, enumerate/build/install "temp stuff" toybox
+doesn't provide yet (make, busybox commands, etc).</li></ul>
+</li>
+
+<li>Run host-&gt;chroot build under mkroot, with airlock built+packaged for
+target (toybox, native compiler, temp stuff from busybox or "make")</li>
+<li>Run chroot build to completion in chroot under mkroot (kernel etc smoketest)</li>
+<li>Run chroot build outside chroot (keeping toybox at start of $PATH)
+to prove toybox commands sufficient to build ALL packages</li>
+<li>Package LFS build (mkroot/packages/lfs)
+
+<ul>
+<li>host/chroot/target build scripts</li>
+<li><a href=http://ftp.osuosl.org/pub/lfs/lfs-packages/>download</a> and
+setup packages.</li>
+<li>Note: I already did this <a href=https://github.com/landley/control-images/tree/master/images/lfs-bootstrap/mnt>long ago</a> for LFS 6.7.</li>
+</li>
+</ul>
+
+</ul></p>
+
+<li><p>1.0 release</p></li>
+
+<li><p>Tackle AOSP build.</p></li>
+</ul>
+
<!-- #include "footer.html" -->