From 835b43d61e9b680f976dd4d8aae660158c951961 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 24 Oct 2026 13:24:12 -0500 Subject: [PATCH] Fix all the remaining "make change" targets, and remove "make" as a dependency from single.sh (call genconfig.sh directly.) --- scripts/change.sh | 1 + scripts/install.c | 6 +----- scripts/single.sh | 6 +++--- toys/net/netcat.c | 2 +- toys/net/ping.c | 2 +- toys/other/reboot.c | 4 ++-- toys/posix/ulimit.c | 2 +- 7 files changed, 10 insertions(+), 13 deletions(-) diff --git a/scripts/change.sh b/scripts/change.sh index dda5ee14..9f69e770 100755 --- a/scripts/change.sh +++ b/scripts/change.sh @@ -12,6 +12,7 @@ mkdir -p "$PREFIX" || exit 1 # Build all the commands standalone for i in $("$UNSTRIPPED"/instlist) do + [ "$i" == "[" ] && continue # TODO echo -n " $i" && scripts/single.sh $i &>$PREFIX/${i}.bad && rm $PREFIX/${i}.bad || echo -n '*' diff --git a/scripts/install.c b/scripts/install.c index c88174db..8a7bf8d5 100644 --- a/scripts/install.c +++ b/scripts/install.c @@ -22,11 +22,7 @@ struct {char *name; int flags;} toy_list[] = { #undef NEWTOY #undef OLDTOY #define NEWTOY(name,opt,flags) HELP_##name "\0" -#if CFG_TOYBOX -#define OLDTOY(name,oldname,flags) "\xff" #oldname "\0" -#else -#define OLDTOY(name, oldname, flags) HELP_##oldname "\0" -#endif +#define OLDTOY(name,oldname,flags) USE_TOYBOX("\xff" #oldname)SKIP_TOYBOX(HELP_##oldname) "\0" #include "generated/help.h" static char help_data[] = diff --git a/scripts/single.sh b/scripts/single.sh index 43fb3805..76aa37cd 100755 --- a/scripts/single.sh +++ b/scripts/single.sh @@ -13,7 +13,7 @@ source scripts/portability.sh export KCONFIG_CONFIG if [ ! -e ${KCONFIG_CONFIG:=.config} ] then - KCONFIG_CONFIG=.singleconfig make defconfig + KCONFIG_CONFIG=.singleconfig scripts/genconfig -d else # Force dependencies to rebuild headers if we build multiplexer after this. touch "$KCONFIG_CONFIG" @@ -33,7 +33,7 @@ do fi TOYFILE="${NEWTOY/:*/}" - make allnoconfig > /dev/null || exit 1 + scripts/genconfig.sh -n || exit 1 # For the shell pull in MAYFORK commands from other source files as builtins. unset DEPENDS MPDEL @@ -51,7 +51,7 @@ do DEPENDS="$({ echo $DEPENDS $GLOBDEP; $SED -n "/^config *$i"'$/,/^$/{s/^[ \t]*depends on //;T;s/[!][A-Z0-9_]*//g;s/ *&& */|/g;p}' $TOYFILE;}| xargs | tr ' ' '|')" NAME=$(echo $i | tr a-z- A-Z_) $SED -ri -e "$MPDEL" \ - -e "s/# (CONFIG_($NAME|${NAME}_.*${DEPENDS:+|$DEPENDS})) is not set/\1=y/" \ + -e "s/# (CONFIG_($NAME${DEPENDS:+|$DEPENDS})) is not set/\1=y/" \ "$KCONFIG_CONFIG" || exit 1 export OUTNAME="$PREFIX$i" diff --git a/toys/net/netcat.c b/toys/net/netcat.c index a280a1cd..a8519d7c 100644 --- a/toys/net/netcat.c +++ b/toys/net/netcat.c @@ -5,7 +5,7 @@ * TODO: genericize for telnet/microcom/tail-f, fix -t with login_tty() USE_NETCAT(NEWTOY(netcat, "^tElLw#<1W#<1p#<1>65535q#<1O:o:s:f:46uUnz[!tlL][!Lw][!Lu][!46U][!oO]", TOYFLAG_BIN)) -USE_NETCAT(OLDTOY(nc, netcat, TOYFLAG_USR|TOYFLAG_BIN)) +USE_NC(OLDTOY(nc, netcat, TOYFLAG_USR|TOYFLAG_BIN)) config NETCAT bool "netcat" diff --git a/toys/net/ping.c b/toys/net/ping.c index 3c00e0c2..1e0aaefc 100644 --- a/toys/net/ping.c +++ b/toys/net/ping.c @@ -12,7 +12,7 @@ // -s > 4064 = sizeof(toybuf)-sizeof(struct icmphdr)-CMSG_SPACE(sizeof(uint8_t)), then kernel adds 20 bytes USE_PING(NEWTOY(ping, "<1>1m#t#<0>255=64c#<0=3s#<0>4064=56i%W#<0=3w#<0qf46I:[-46]", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LINEBUF)) -USE_PING(OLDTOY(ping6, ping, TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LINEBUF)) +USE_PING6(OLDTOY(ping6, ping, TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LINEBUF)) config PING bool "ping" diff --git a/toys/other/reboot.c b/toys/other/reboot.c index 4770d1f1..6aa990b7 100644 --- a/toys/other/reboot.c +++ b/toys/other/reboot.c @@ -3,8 +3,8 @@ * Copyright 2013 Elie De Brauwer USE_REBOOT(NEWTOY(reboot, "d:fn", TOYFLAG_SBIN|TOYFLAG_NEEDROOT)) -USE_REBOOT(OLDTOY(halt, reboot, TOYFLAG_SBIN|TOYFLAG_NEEDROOT)) -USE_REBOOT(OLDTOY(poweroff, reboot, TOYFLAG_SBIN|TOYFLAG_NEEDROOT)) +USE_HALT(OLDTOY(halt, reboot, TOYFLAG_SBIN|TOYFLAG_NEEDROOT)) +USE_POWEROFF(OLDTOY(poweroff, reboot, TOYFLAG_SBIN|TOYFLAG_NEEDROOT)) config REBOOT bool "reboot" diff --git a/toys/posix/ulimit.c b/toys/posix/ulimit.c index ffb1eb38..70fefcb9 100644 --- a/toys/posix/ulimit.c +++ b/toys/posix/ulimit.c @@ -17,7 +17,7 @@ * runtime). We support -P to affect processes other than us. USE_ULIMIT(NEWTOY(ulimit, ">1P#<1SHavutsrRqpnmlifedc[-SH][!apvutsrRqnmlifedc]", TOYFLAG_USR|TOYFLAG_BIN)) -USE_ULIMIT(OLDTOY(prlimit, ulimit, TOYFLAG_USR|TOYFLAG_BIN)) +USE_PRLIMIT(OLDTOY(prlimit, ulimit, TOYFLAG_USR|TOYFLAG_BIN)) config ULIMIT bool "ulimit" -- 2.39.5