code stringlengths 1 1.96M | language stringclasses 1
value |
|---|---|
#!/bin/sh
# SUSv3 compliant uniq tests.
# Copyright 2005 by Rob Landley <rob@landley.net>
# Licensed under GPLv2, see file LICENSE in this source tree.
# AUDIT: Full SUSv3 coverage (except internationalization).
. ./testing.sh
# testing "test name" "options" "expected result" "file input" "stdin"
# file input wil... | Shell |
#!/bin/sh
# Copyright 2011 by Denys Vlasenko
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# testing "test name" "commands" "expected result" "file input" "stdin"
testing "uncompress < \x1f\x9d\x90 \x01 x N" \
'uncompress 2>&1 1>/dev/null; echo $?' \
"\
uncompress: corrupted data
1
" \... | Shell |
#!/bin/sh
# Leak test for gunzip. Watch top for growing process size.
# In this case we look for leaks in "concatenated .gz" code -
# we feed gunzip with a stream of .gz files.
i=$PID
c=0
while true; do
c=$((c + 1))
echo "Block# $c" >&2
# RANDOM is not very random on some shells. Spice it up.
i=$((i * ... | Shell |
#!/bin/sh
# Leak test for gunzip. Watch top for growing process size.
# Just using urandom will make gzip use method 0 (store) -
# not good for test coverage!
cat /dev/urandom \
| while true; do read junk; echo "junk $RANDOM $junk"; done \
| ../busybox gzip \
| ../busybox gunzip -c >/dev/null
| Shell |
#!/bin/sh
# Test that concatenated gz files are unpacking correctly.
# It also tests that unpacking in general is working right.
# Since zip code has many corner cases, run it for a few hours
# to get a decent coverage (200000 tests or more).
gzip="gzip"
gunzip="../busybox gunzip"
# Or the other way around:
#gzip="../... | Shell |
#!/bin/sh
busybox=../busybox
i=4000
echo "Before we started $i copies of '$busybox sleep 10':"
$busybox nmeter '%t %[pn] %m' | head -3
while test $i != 0; do
$busybox sleep 10 &
i=$((i-1))
done
sleep 1
echo "After:"
$busybox nmeter '%t %[pn] %m' | head -3
| Shell |
#!/bin/sh
t_text=0
t_data=0
t_bss=0
printf "%9s %11s %9s %9s %s\n" "text+data" "text+rodata" rwdata bss filename
find -name '*.o' | grep -v '^\./scripts/' | grep -vF built-in.o \
| sed 's:^\./::' | xargs "${CROSS_COMPILE}size" | grep '^ *[0-9]' \
| {
while read text data bss dec hex filename; do
t_text=$((t_text... | Shell |
#!/bin/sh
# If not specified in environment...
if ! test "$LIBC"; then
# Select which libc to build against
LIBC="glibc"
LIBC="uclibc"
fi
# x86 32-bit:
#CROSS_COMPILER_PREFIX="i486-linux-uclibc-"
# My system has strange prefix for x86 64-bit uclibc:
#CROSS_COMPILER_PREFIX="x86_64-pc-linux-gnu-"
if test $# -lt 2 ||... | Shell |
#!/bin/sh
usage() {
echo "Usage: ${0##*/} DIR1 DIR2"
echo
echo "Compares all object files recursivelty found in DIR1 and DIR2."
echo "Prints diff of their disassembly."
echo
exit $1
}
filter() {
# sed removes " address: " prefixes which mess up diff
sed $'s/^\\(\t*\\)[ ]*[0-9a-f][0-9a-f]*:[ \t]*/\\1/' \
| se... | Shell |
#!/bin/sh
grep -n -B1 -r $'^\t*}$' . | grep -A1 '.[ch]-[0-9]*-$'
grep -n -A1 -r $'^\t*{$' . | grep -B1 '.[ch]-[0-9]*-$'
# or (less surefire ones):
grep -n -B1 -r $'^\t*}' . | grep -A1 '.[ch]-[0-9]*-$'
grep -n -A1 -r $'^\t*{' . | grep -B1 '.[ch]-[0-9]*-$'
# find trailing empty lines
find -type f | while read file; do
... | Shell |
#!/bin/sh
# Note: was using sed OPTS CMD -- FILES
# but users complain that many sed implementations
# are misinterpreting --.
test $# -ge 2 || { echo "Syntax: $0 SRCTREE OBJTREE"; exit 1; }
# cd to objtree
cd -- "$2" || { echo "Syntax: $0 SRCTREE OBJTREE"; exit 1; }
# In separate objtree build, include/ might not e... | Shell |
#!/bin/sh
# Copyright 2006 Rob Landley <rob@landley.net>
# Licensed under GPLv2 or later, see file LICENSE in this source tree.
# Dumb little utility function to print out the assembly dump of a single
# function, or list the functions so dumpable in an executable. You'd think
# there would be a way to get objdump t... | Shell |
#!/bin/sh
#
# Copyright (C) 2002 Khalid Aziz <khalid_aziz at hp.com>
# Copyright (C) 2002 Randy Dunlap <rddunlap at osdl.org>
# Copyright (C) 2002 Al Stone <ahs3 at fc.hp.com>
# Copyright (C) 2002 Hewlett-Packard Company
#
# This program is free software; you can redistribute it and/or modify
# it under the terms o... | Shell |
#!/bin/sh
busybox=../busybox
$busybox sleep 10 &
pid=$!
sleep 1
echo "Memory map of '$busybox sleep 10':"
size $busybox
pmap $pid | env - grep "^[0-9a-f][0-9a-f]* " | sort -r -t " " -k2,999
| Shell |
#!/bin/sh
# Check ncurses compatibility
# What library to link
ldflags()
{
for ext in so a dylib ; do
for lib in ncursesw ncurses curses ; do
$cc -print-file-name=lib${lib}.${ext} | grep -q /
if [ $? -eq 0 ]; then
echo "-l${lib}"
exit
fi
done
done
exit 1
}
# Where is ncurses.h?
ccflags()
{
if... | Shell |
#!/bin/sh
# Needed for systems without gettext
$* -xc -o /dev/null - > /dev/null 2>&1 << EOF
#include <libintl.h>
int main()
{
gettext("");
return 0;
}
EOF
if [ ! "$?" -eq "0" ]; then
echo -DKBUILD_NO_NLS;
fi
| Shell |
#!/bin/sh
# Processes current directory recursively:
# printf("abc\n") -> puts("abc"). Beware of fprintf etc...
# BTW, gcc 4.1.2 already does the same! Can't believe it...
grep -lr 'printf\([^%%]*\\n"\)' . | grep '.[ch]$' | xargs -n1 \
sed -e 's/\([^A-Za-z0-9_]\)printf(\( *"[^%]*\)\\n")/\1puts(\2")/' -i
| Shell |
#!/bin/sh
#
# gcc-version gcc-command
#
# Prints the gcc version of `gcc-command' in a canonical 4-digit form
# such as `0295' for gcc-2.95, `0303' for gcc-3.3, etc.
#
compiler="$*"
MAJ_MIN=$(echo __GNUC__ __GNUC_MINOR__ | $compiler -E -xc - | tail -n 1)
printf '%02d%02d\n' $MAJ_MIN
| Shell |
#!/bin/sh
b=`basename $PWD`
test "${b#busybox}" != "$b" || { echo "Must be run in busybox tree"; exit 1; }
cd ..
cp -pPR "$b" busybox.$$.test_tree
cd busybox.$$.test_tree
make defconfig
make $MAKEOPTS
make clean
cd ..
diff -urp "$b" busybox.$$.test_tree >busybox.$$.test_tree.diff
cat busybox.$$.test_tree.diff
| Shell |
#!/bin/sh
b=`basename $PWD`
test "${b#busybox}" != "$b" || { echo "Must be run in busybox tree"; exit 1; }
rm -rf ../testdir_make_O.$$
mkdir ../testdir_make_O.$$
odir=`cd ../testdir_make_O.$$ && pwd`
test -d "$odir" || exit 1
make O="$odir" $MAKEOPTS "$@" defconfig busybox 2>&1 | tee test_make_O.log
| Shell |
#!/bin/sh
test -d "$1" || exit 1
test -d "$2" || exit 1
{
(
cd "$1" || exit 1
find -name '*.o' -o -name '*.os' # -o -name '*.so'
)
(
cd "$2" || exit 1
find -name '*.o' -o -name '*.os' # -o -name '*.so'
)
} | sed 's:^\./::' | sort | uniq | \
tee LST | \
(
IFS=''
while read -r oname; do
if ! test -f "$1/$o... | Shell |
#!/bin/sh
# Common variables are elusive, they don't show up in size output!
# This script will show all commons in *.o, sorted by size
find ! -path './scripts/*' -a ! -name built-in.o -a -name '*.o' \
| while read name; do
b=`basename "$name"`
nm "$name" | sed "s/^/$b: /"
done | grep -i ' c ' | sort -k2
| Shell |
#!/bin/sh
debug=false
# Linker flags used:
#
# Informational:
# --warn-common
# -Map $EXE.map
# --verbose
#
# Optimizations:
# --sort-common reduces padding
# --sort-section alignment reduces padding
# --gc-sections throws out unused sections,
# does ... | Shell |
#!/bin/bash
# Whitespace fixer
# Usage: fix_ws [dir]...
temp="/tmp/fix_ws.$$.$RANDOM"
# Using $'xxx' bashism
begin8sp_tab=$'s/^ /\t/'
beginchar7sp_chartab=$'s/^\\([^ \t]\\) /\\1\t/'
tab8sp_tabtab=$'s/\t /\t\t/g'
tab8sptab_tabtabtab=$'s/\t \t/\t\t\t/g'
begin17sptab_tab=$'s/^ \\{1,7\\}\t/\t/'... | Shell |
#!/bin/sh
run_testsuite=true
test -d "$1" || { echo "'$1' is not a directory"; exit 1; }
test -x "$1/scripts/randomtest" || { echo "No scripts/randomtest in '$1'"; exit 1; }
export LIBC="uclibc"
export CROSS_COMPILER_PREFIX="i686-"
export MAKEOPTS="-j9"
cnt=0
fail=0
while sleep 1; do
echo "Passes: $cnt Failures: $... | Shell |
#!/bin/sh
# Create signed release tarballs and signature files from current svn.
# Since you don't have my gpg key, this doesn't do you much good,
# but if I get hit by a bus the next maintainer might find this useful.
# Run this in an empty directory. The VERSION= line can get confused
# otherwise.
#svn co svn://bu... | Shell |
#!/bin/sh
# This script finds applets with multiple uses of bb_common_bufsiz1
# (== possible bugs).
# Currently (2007-06-04) reports 3 false positives:
# ./coreutils/diff.c:7
# ./loginutils/getty.c:2
# ./util-linux/mount.c:5
find -name '*.c' \
| while read name; do
grep -Hc bb_common_bufsiz1 "$name"
done | grep -... | Shell |
#!/bin/bash
# Test script for busybox id vs. coreutils id.
# Needs root privileges for some tests.
cp /usr/bin/id .
BUSYBOX=./busybox
ID=./id
LIST=`awk -F: '{ printf "%s\n", $1 }' /etc/passwd`
FLAG_USER_EXISTS="no"
TEST_USER="f583ca884c1d93458fb61ed137ff44f6"
echo "test 1: id [options] nousername"
rm -f foo bar
for O... | Shell |
#!/bin/sh
# Depmod output may be hard to diff.
# This script sorts dependencies within "xx.ko: yy.ko zz.ko" lines,
# and sorts all lines too.
# Usage:
#
# [./busybox] depmod -n | ./depmod_process.sh | sort >OUTFILE
#
# and then you can diff OUTFILEs. Useful for comparing bbox depmod
# with module-init-tools depmod and... | Shell |
#!/bin/bash
# (using bashism (arrays) in dhcp config)
#exec >/dev/null
exec 2>&1
exec </dev/null
user=root
pool="us.pool.ntp.org" # replace "us" with your country code
service="${PWD##*/}"
rundir="/var/run/service/$service"
default_p_opt="-p 0.$pool -p 1.$pool -p 2.$pool -p 3.$pool"
# Make sure rundir/ exists
mkdi... | Shell |
#!/bin/sh
user=logger
logdir="/var/log/service/`(cd ..;basename $PWD)`"
mkdir -p "$logdir" 2>/dev/null
chown -R "$user": "$logdir"
chmod -R go-rwxst,u+rwX "$logdir"
rm logdir
ln -s "$logdir" logdir
# make this dir accessible to logger
chmod a+rX .
exec >/dev/null
exec 2>&1
exec \
env - PATH="$PATH" \
softlimit \
se... | Shell |
#!/bin/sh
cd log/logdir || exit 1
watch -n2 'w=`ttysize w`; h=`ttysize h`; tail -$((h-3)) current 2>&1 | cut -b1-$((w-2))'
| Shell |
#!/bin/sh
cd log/logdir || exit 1
cat @* current | $PAGER
| Shell |
#!/bin/sh
# Note that there is no provision to prevent several copies of the script
# to be run in quick succession. In fact, it happens rather often
# if initial syncronization results in a step.
# You will see "step" and then "stratum" script runs, sometimes
# as close as only 0.002 seconds apart.
#
# Script should ... | Shell |
#!/bin/sh
#exec >/dev/null
exec 2>&1
exec </dev/null
user=www
user=root
echo "* Starting tcpsvd for httpd [$$]"
exec \
env - PATH="$PATH" \
softlimit \
tcpsvd \
-v -E -l localhost -c 5 \
0 88 \
setuidgid "$user" \
httpd -vvv -i -h /pub/httpd_root
| Shell |
#!/bin/sh
user=logger
logdir="/var/log/service/`(cd ..;basename $PWD)`"
mkdir -p "$logdir" 2>/dev/null
chown -R "$user": "$logdir"
chmod -R go-rwxst,u+rwX "$logdir"
rm logdir
ln -s "$logdir" logdir
# make this dir accessible to logger
chmod a+rX .
exec >/dev/null
exec 2>&1
exec \
env - PATH="$PATH" \
softlimit \
se... | Shell |
#!/bin/sh
cd log/logdir || exit 1
watch -n2 'w=`ttysize w`; h=`ttysize h`; tail -$((h-3)) current 2>&1 | cut -b1-$((w-2))'
| Shell |
#!/bin/sh
cd log/logdir || exit 1
cat @* current | $PAGER
| Shell |
#!/bin/sh
#exec >/dev/null
exec 2>&1
exec </dev/null
pwd="$PWD"
if="${PWD##*/ifplugd_}"
echo "* Starting ifplugd on $if [$$]"
exec \
env - PATH="$PATH" \
softlimit \
setuidgid root \
ifplugd -apqns -t3 -u8 -d8 -i "$if" -r "$pwd/ifplugd_handler"
# We use -t3 to wake ifplugd up less often.
# If after three tests (3*... | Shell |
#!/bin/sh
# parameters:
# $1: interface
# $2: state
if test -d "/var/service/dhcp_$1"; then
if test x"$2" = x"down"; then
echo "Downing /var/service/dhcp_$1"
sv d "/var/service/dhcp_$1"
fi
if test x"$2" = x"up"; then
echo "Upping /var/service/dhcp_$1"
sv u "/var/service/dhcp_$1"
fi
fi
| Shell |
#!/bin/sh
user=logger
logdir="/var/log/service/`(cd ..;basename $PWD)`"
mkdir -p "$logdir" 2>/dev/null
chown -R "$user": "$logdir"
chmod -R go-rwxst,u+rwX "$logdir"
rm logdir
ln -s "$logdir" logdir
# make this dir accessible to logger
chmod a+rX .
exec >/dev/null
exec 2>&1
exec \
env - PATH="$PATH" \
softlimit \
se... | Shell |
#!/bin/sh
cd log/logdir || exit 1
watch -n2 'w=`ttysize w`; h=`ttysize h`; tail -$((h-3)) current 2>&1 | cut -b1-$((w-2))'
| Shell |
#!/bin/sh
cd log/logdir || exit 1
cat @* current | $PAGER
| Shell |
#!/bin/sh
exec >/dev/null
exec 2>&1
exec </dev/null
user=root
options="-D -2 -m /dev/psaux -t ps2"
#options="-D -2 -m /dev/ttyS0 -t bare"
exec \
env - PATH="$PATH" \
softlimit \
setuidgid "$user" \
gpm $options
| Shell |
#!/bin/sh
#exec >/dev/null
exec 2>&1
exec </dev/null
user=root # for bind to port 69
exec \
env - \
softlimit \
setuidgid "$user" \
udpsvd -v -c 10 -l localhost \
0 69 \
tftpd /pub/tftpd_root
| Shell |
#!/bin/sh
user=logger
logdir="/var/log/service/`(cd ..;basename $PWD)`"
mkdir -p "$logdir" 2>/dev/null
chown -R "$user": "$logdir"
chmod -R go-rwxst,u+rwX "$logdir"
rm logdir
ln -s "$logdir" logdir
# make this dir accessible to logger
chmod a+rX .
exec >/dev/null
exec 2>&1
exec \
env - PATH="$PATH" \
softlimit \
se... | Shell |
#!/bin/sh
cd log/logdir || exit 1
watch -n2 'w=`ttysize w`; h=`ttysize h`; tail -$((h-3)) current 2>&1 | cut -b1-$((w-2))'
| Shell |
#!/bin/sh
cd log/logdir || exit 1
cat @* current | $PAGER
| Shell |
#!/bin/sh
#exec >/dev/null
exec 2>&1
exec </dev/null
user=www
user=root
exec \
env - PATH="$PATH" \
softlimit \
tcpsvd \
-vE -l 0 -c 40 \
0.0.0.0 21 \
setuidgid "$user" \
ftpd -vv -t10 /pub/ftpd_root
| Shell |
#!/bin/sh
user=logger
logdir="/var/log/service/`(cd ..;basename $PWD)`"
mkdir -p "$logdir" 2>/dev/null
chown -R "$user": "$logdir"
chmod -R go-rwxst,u+rwX "$logdir"
rm logdir
ln -s "$logdir" logdir
# make this dir accessible to logger
chmod a+rX .
exec >/dev/null
exec 2>&1
exec \
env - PATH="$PATH" \
softlimit \
se... | Shell |
#!/bin/sh
cd log/logdir || exit 1
watch -n2 'w=`ttysize w`; h=`ttysize h`; tail -$((h-3)) current 2>&1 | cut -b1-$((w-2))'
| Shell |
#!/bin/sh
cd log/logdir || exit 1
cat @* current | $PAGER
| Shell |
#!/bin/sh
#exec >/dev/null
exec 2>&1
exec </dev/null
echo "* Starting inetd [$$]"
exec \
env - PATH="$PATH" \
softlimit \
inetd -f -e "$PWD/inetd.conf"
# inetd [-f] [-q len] [conf]
# -f Run in foreground
# -e Log to stderr (default is syslog)
# -q N Set the size of the socket listen queue to N
# ... | Shell |
#!/bin/sh
user=logger
logdir="/var/log/service/`(cd ..;basename $PWD)`"
mkdir -p "$logdir" 2>/dev/null
chown -R "$user": "$logdir"
chmod -R go-rwxst,u+rwX "$logdir"
rm logdir
ln -s "$logdir" logdir
# make this dir accessible to logger
chmod a+rX .
exec >/dev/null
exec 2>&1
exec \
env - PATH="$PATH" \
softlimit \
se... | Shell |
#!/bin/sh
cd log/logdir || exit 1
watch -n2 'w=`ttysize w`; h=`ttysize h`; tail -$((h-3)) current 2>&1 | cut -b1-$((w-2))'
| Shell |
#!/bin/sh
cd log/logdir || exit 1
cat @* current | $PAGER
| Shell |
#!/bin/bash
domain=`(. /boot.conf; echo "$DNSDOMAINNAME") 2>/dev/null`
echo "# This file is automagically regenerated with each boot"
echo
test "$domain" && echo "domain $domain"
test "$domain" && echo "search $domain"
echo
echo "# Note that nslookup can choke on DNS server which itself"
echo "# does NOT have domain ... | Shell |
#!/bin/sh
echo "\
# This file is automagically regenerated
# Note! /etc/nsswitch.conf may override this!
# For loopbacking
127.0.0.1 localhost
# Our local IPs"
hostname=`hostname`
test "$hostname" || hostname=localhost
domain=`(. /boot.conf; echo "$DNSDOMAINNAME")`
test "$domain" && hostname="$hostname $hostname.$do... | Shell |
#!/bin/bash
# (using bashism: arrays)
service="${PWD##*/}"
rundir="/var/run/service/$service"
user=root
extif=if
ext_open_tcp="21 22 80" # space-separated
# Make ourself one-shot
sv o .
# Debug
#date '+%Y-%m-%d %H:%M:%S' >>"$0.log"
### filter This is the default table (if no -t option is passed). It contains
### ... | Shell |
#!/bin/sh
echo; echo "* Firewall:"
{
echo '---FILTER--';
iptables -v -L -x -n;
echo '---NAT-----';
iptables -t nat -v -L -x -n;
echo '---MANGLE--';
iptables -t mangle -v -L -x -n;
} \
| grep -v '^$' | grep -Fv 'bytes target' | $PAGER
| Shell |
#!/bin/bash
# Mostly redundant except when you need dns[]=your_static_dns_srv
#
let cfg=cfg+1
if[$cfg]=lo
ip[$cfg]=127.0.0.1
ipmask[$cfg]=127.0.0.1/8
gw[$cfg]=''
net[$cfg]=''
#dns[$cfg]=127.0.0.1
| Shell |
#!/bin/sh
# A small network with no routers
# (maybe *we* are their router)
#
let cfg=cfg+1
if[$cfg]=if
ip[$cfg]=192.168.0.1
ipmask[$cfg]=192.168.0.1/24
### gw[$cfg]=
### net[$cfg]=0/0
### dns[$cfg]=''
| Shell |
#!/bin/sh
# If we have simple static address...
#
let cfg=cfg+1
if[$cfg]=if
ip[$cfg]=11.22.33.44
ipmask[$cfg]=11.22.33.44/24
gw[$cfg]=11.22.33.1
net[$cfg]=0/0
dns[$cfg]='11.22.33.2 11.22.33.3'
| Shell |
#!/bin/sh
delay=67
if=${PWD##*/dhcp_}
if=${if%%_pinger}
if test -f "$0.log"; then
tail -999 "$0.log" >"$0.log.new"
mv "$0.log.new" "$0.log"
fi
test -f "/var/service/dhcp_$if/dhcp_$if.out" || exec env - sleep "$delay"
. "/var/service/dhcp_$if/dhcp_$if.out"
test x"$router" != x"" || exec env - sleep "$delay"
#echo... | Shell |
#!/bin/sh
exec >/dev/null
exec 2>&1
exec </dev/null
# Since per-process /proc/net/ (-> /proc/self/net/) appeared,
# we need to be root
user="root"
tty="/dev/tty9"
cmd="nmeter '%t %c x %x p%p f %f b %b m %m if%[nif]'"
chmod -R a+X . # or else env will moan
chown "$user": "$tty" # devfs made happy
eval exec \
env - P... | Shell |
#!/bin/sh
exec 2>&1
exec </dev/null
pwd="$PWD"
if="${PWD##*/dhcp_}"
echo "* Upping iface $if"
ip link set dev "$if" up
echo "* Starting udhcpc"
exec \
env - PATH="$PATH" \
softlimit \
setuidgid root \
udhcpc -vv \
--hostname=null \
--foreground \
--interface="$if" \
--pidfile="$pwd/udhcpc.pid" \
--script="$pwd/dhc... | Shell |
#!/bin/sh
# convert:
# dhcptype=5
# serverid=172.16.42.102
# lease=97200
# interface=eth0
# ip=172.16.42.177
# subnet=255.255.255.0
# mask=24
# broadcast=172.16.22.255
# router=172.16.42.98
# dns=10.34.32.125 10.32.63.5 10.34.255.7 10.11.255.27
# domain=lab.example.com example.com
# ntpsrv=10.34.32.125 10.34.255.7
# ... | Shell |
#!/bin/sh
user=logger
logdir="/var/log/service/`(cd ..;basename $PWD)`"
mkdir -p "$logdir" 2>/dev/null
chown -R "$user": "$logdir"
chmod -R go-rwxst,u+rwX "$logdir"
rm logdir
ln -s "$logdir" logdir
# make this dir accessible to logger
chmod a+rX .
exec >/dev/null
exec 2>&1
exec \
env - PATH="$PATH" \
softlimit \
se... | Shell |
#!/bin/sh
# convert:
# dhcptype=5
# serverid=172.16.42.102
# lease=97200
# interface=eth0
# ip=172.16.42.177
# subnet=255.255.255.0
# mask=24
# broadcast=172.16.22.255
# router=172.16.42.98
# dns=10.34.32.125 10.32.63.5 10.34.255.7 10.11.255.27
# domain=lab.example.com example.com
# ntpsrv=10.34.32.125 10.34.255.7
# ... | Shell |
#!/bin/sh
cd log/logdir || exit 1
watch -n2 'w=`ttysize w`; h=`ttysize h`; tail -$((h-3)) current 2>&1 | cut -b1-$((w-2))'
| Shell |
#!/bin/sh
# executed by udhcpc
# parameters: $1 and environment
# $1 is:
#
# deconfig: udhcpc starts, or lease is lost.
# Environment example: interface=eth0
#
# bound: lease is obtained. Environment example:
# dhcptype=5
# serverid=172.16.42.102
# lease=97200
# interface=eth0
# ip=172.16.42.177
# subnet=255.255.255.0
... | Shell |
#!/bin/sh
cd log/logdir || exit 1
cat @* current | $PAGER
| Shell |
#!/bin/sh
if test x"$TERM" = x"" -o x"$TERM" = x"unknown"; then
TERM="linux"
echo "* Setting TERM='$TERM'"
fi
export TERM
ttyname=`tty`
ttybase="${ttyname%%[0123456789]*}" # strip numeric tail
if test x"$ttybase" = x"/dev/vc/" -o x"$ttybase" = x"/dev/tty"; then
echo "* Activating Cyrillic KOI8-R -> CP866 font... | Shell |
#!/bin/sh
exec >/dev/null
exec 2>&1
exec </dev/null
user=root
baud=38400
delay=3
export TERM=linux
tty="/dev/${PWD##*/getty_}"
if ! test -e "$tty"; then
exec env - sleep 32000
fi
sleep "$delay"
chown "$user" "$tty" # - devfs made happy
exec <"$tty" >"$tty" 2>&1
# using . in order to be able to set env (TERM etc... | Shell |
#!/bin/sh
ttyname=`tty`
ttybase="${ttyname%%[0123456789]*}" # strip numeric tail
if test "$ttybase" = "/dev/tty"; then
tail="${ttyname:8}"
echo "* Setting terminal device's owner to $LOGIN_UID:$LOGIN_GID"
chown "$LOGIN_UID:$LOGIN_GID" "/dev/vcs$tail" "/dev/vcsa$tail"
fi
# We can do this also, but login does it... | Shell |
#!/bin/sh
#
# makedev.sh - creates device files for a busybox boot floppy image
# we do our work in the dev/ directory
if [ -z "$1" ]; then
echo "usage: `basename $0` path/to/dev/dir"
exit 1
fi
cd $1
# miscellaneous one-of-a-kind stuff
mknod console c 5 1
mknod full c 1 7
mknod kmem c 1 2
mknod mem c 1 1
mknod n... | Shell |
# /etc/profile: system-wide .profile file for the Bourne shells
echo
echo -n "Processing /etc/profile... "
# no-op
echo "Done"
echo
| Shell |
#! /bin/sh
/bin/mount -a
| Shell |
#!/bin/bash
#
# Formats a floppy to use Syslinux
dummy=""
# need to have mtools installed
if [ -z `which mformat` -o -z `which mcopy` ]; then
echo "You must have the mtools package installed to run this script"
exit 1
fi
# need an arg for the location of the kernel
if [ -z "$1" ]; then
echo "usage: `basename $0... | Shell |
#!/bin/bash
#
# mkrootfs.sh - creates a root file system
#
# TODO: need to add checks here to verify that busybox, uClibc and bzImage
# exist
# command-line settable variables
BUSYBOX_DIR=..
UCLIBC_DIR=../../uClibc
TARGET_DIR=./loop
FSSIZE=4000
CLEANUP=1
MKFS='mkfs.ext2 -F'
# don't-touch variables
BASE_DIR=`pwd`
... | Shell |
#!/bin/sh
#
# This should work with the GNU version of tar and gzip!
# This should work with the bash or ash shell!
# Requires the programs (ar, tar, gzip, and the pager more or less).
#
usage() {
echo "Usage: undeb -c package.deb <Print control file info>"
echo " undeb -l package.deb <List ... | Shell |
#!/bin/sh
# only for use as a "zcip" callback script
if [ "x$interface" = x ]
then
exit 1
fi
# zcip should start on boot/resume and various media changes
case "$1" in
init)
# for now, zcip requires the link to be already up,
# and it drops links when they go down. that isn't
# the most robust model...
exit 0
;... | Shell |
#!/bin/sh
#
# This should work with the GNU version of cpio and gzip!
# This should work with the bash or ash shell!
# Requires the programs (cpio, gzip, and the pager more or less).
#
usage() {
echo "Usage: unrpm -l package.rpm <List contents of rpm package>"
echo " unrpm -x package.rpm /foo/boo <Ex... | Shell |
#!/bin/sh
# Sample udhcpc deconfig script
/sbin/ifconfig $interface 0.0.0.0
| Shell |
#!/bin/sh
# Currently, we only dispatch according to command. However, a more
# elaborate system might dispatch by command and interface or do some
# common initialization first, especially if more dhcp event notifications
# are added.
exec /usr/share/udhcpc/sample.$1
| Shell |
#!/bin/sh
# Sample udhcpc bound script
RESOLV_CONF="/etc/udhcpc/resolv.conf"
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet"
/sbin/ifconfig $interface $ip $BROADCAST $NETMASK
if [ -n "$router" ]
then
echo "deleting routers"
while /sbin/route del default gw 0.0... | Shell |
#!/bin/sh
# Sample udhcpc nak script
echo Received a NAK: $message
| Shell |
#!/bin/sh
# Sample udhcpc renew script
RESOLV_CONF="/etc/udhcpc/resolv.conf"
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet"
/sbin/ifconfig $interface $ip $BROADCAST $NETMASK
if [ -n "$router" ]
then
echo "deleting routers"
while /sbin/route del default gw 0.0... | Shell |
#!/bin/sh
# udhcpc script edited by Tim Riker <Tim@Rikers.org>
RESOLV_CONF="/etc/resolv.conf"
[ -n "$1" ] || { echo "Error: should be called from udhcpc"; exit 1; }
NETMASK=""
[ -n "$subnet" ] && NETMASK="netmask $subnet"
BROADCAST="broadcast +"
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
case "$1" in
... | Shell |
#!/bin/sh
# Build Busybox against Android's bionic
# Originally by Dan Fandrich
#
# Configure with "make android_defconfig"
#
# This file has been tested on Android Froyo (the lack of ttyname_r in
# the android libc must be patched around) and Gingerbread.
# Point this to the Android root directory; it's used in the d... | Shell |
#!/bin/sh
#
# Simple depmod, use to generate modprobe.conf
#
# Copyright (C) 2008 by Vladimir Dronnikov <dronnikov@gmail.com>
#
# Licensed under GPLv2, see file LICENSE in this source tree.
#
local BASE="${1:-/usr/lib/modules}"
find "$BASE" -name '*.ko.gz' | while read I ; do
N=`basename "$I" '.ko.gz'`
echo -n "@$N... | Shell |
#!/bin/sh
target="$1"
loc="$2"
test "$target" || exit 1
test "$loc" || loc=.
test -x "$loc/usage" || exit 1
test "$SED" || SED=sed
test "$DD" || DD=dd
# Some people were bitten by their system lacking a (proper) od
od -v -t x1 </dev/null >/dev/null
if test $? != 0; then
echo 'od tool is not installed or cannot acce... | Shell |
#!/bin/sh
# Make busybox links list file.
# input $1: full path to Config.h
# input $2: full path to applets.h
# output (stdout): list of pathnames that should be linked to busybox
# Maintainer: Larry Doolittle <ldoolitt@recycle.lbl.gov>
export LC_ALL=POSIX
export LC_CTYPE=POSIX
CONFIG_H=${1:-include/autoconf.h}
AP... | Shell |
#!/bin/sh
export LC_ALL=POSIX
export LC_CTYPE=POSIX
prefix=$1
if [ -z "$prefix" ]; then
echo "usage: applets/install.sh DESTINATION [--symlinks/--hardlinks/--scriptwrapper]"
exit 1
fi
h=`sort busybox.links | uniq`
linkopts=""
scriptwrapper="n"
cleanup="0"
noclobber="0"
case "$2" in
--hardlinks) linkopts="-f"... | Shell |
#!/bin/sh
# Disabling features we do not match exactly:
system_mke2fs='/sbin/mke2fs -O ^resize_inode'
bbox_mke2fs='./busybox mke2fs'
gen_image() { # params: mke2fs_invocation image_name
>$2
dd seek=$((kilobytes-1)) bs=1K count=1 </dev/zero of=$2 >/dev/null 2>&1 || exit 1
$1 -F $2 $kilobytes >$2.raw_out 2>... | Shell |
if [ -z "$ANDROID_NDK_R3" ] ; then
echo '$ANDROID_NDK_R3' must point to an android-ndk-r3 installation
echo 'Get it at: http://dl.google.com/android/ndk/android-ndk-r3-linux-x86.zip'
exit -1
fi
cd vanilla
make mrproper
cd ..
egrep -v 'CONFIG_CROSS_COMPILER_PREFIX|CONFIG_SYSROOT|CONFIG_EXTRA_CFLAGS' config > vanil... | Shell |
#!/bin/sh
#
# CA - wrapper around ca to make it easier to use ... basically ca requires
# some setup stuff to be done before you can use it and this makes
# things easier between now and when Eric is convinced to fix it :-)
#
# CA -newca ... will setup the right stuff
# CA -newreq ... will generate a certific... | Shell |
#!/bin/sh
#
# build using pthreads where it's already built into the system
#
/bin/rm -f mttest
gcc -DPTHREADS -I../../include -g mttest.c -o mttest -L../.. -lssl -lcrypto -lpthread
| Shell |
#!/bin/sh
#
# build using pthreads
#
# http://www.mit.edu:8001/people/proven/pthreads.html
#
/bin/rm -f mttest
pgcc -DPTHREADS -I../../include -g mttest.c -o mttest -L../.. -lssl -lcrypto
| Shell |
#!/bin/sh
/bin/rm -f mttest
cc -DSOLARIS -I../../include -g mttest.c -o mttest -L../.. -lthread -lssl -lcrypto -lnsl -lsocket
| Shell |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.