view scripts/single.sh @ 1315:0f42d83199a9 draft

logname and whoami are the same as id -un, so merge them. Since the starting letters are greater than those for 'id' or 'groups', we cn just check if the first letter is greater than 'i'.
author Isaac Dunham <ibid.ag@gmail.com>
date Sun, 25 May 2014 11:46:58 -0500
parents ecec71144ddd
children 8a67f42e4f76
line wrap: on
line source

#!/bin/bash

# Build a standalone toybox command

if [ -z "$1" ]
then
  echo "usage: single.sh command" >&2
  exit 1
fi

NAME=$(echo $1 | tr a-z- A-Z_)
export KCONFIG_CONFIG=.singleconfig

make allnoconfig > /dev/null &&
sed -i -e "s/\(CONFIG_TOYBOX\)=y/# \1 is not set/" \
       -e "s/# CONFIG_\($NAME\|${NAME}_[^ ]*\|TOYBOX_HELP[^ ]*\) is not set/CONFIG_\1=y/" \
       "$KCONFIG_CONFIG" &&
make &&
mv toybox $PREFIX$1