code stringlengths 1 1.96M | language stringclasses 1
value |
|---|---|
#!/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
#
# 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
# 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
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
# 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
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/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
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
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
# 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/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
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
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
#
# 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
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
# 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
# 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
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
# Copyright 2008 by Denys Vlasenko
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
test -f "$bindir/.config" && . "$bindir/.config"
# testing "test name" "options" "expected result" "file input" "stdin"
testing "expand" \
"expand" \
" 12345678 12345678\n" \
"" ... | Shell |
#!/bin/sh
# Used by both gunzip and bunzip2 tests
FAILCOUNT=0
if test "${0##*/}" = "gunzip.tests"; then
unpack=gunzip
ext=gz
elif test "${0##*/}" = "bunzip2.tests"; then
unpack=bunzip2
ext=bz2
else
echo "WTF? argv0='$0'"
exit 1
fi
bb="busybox "
unset LC_ALL
unset LC_MESSAGES
unset LANG
unset... | Shell |
#!/bin/sh
# unit test for uuencode to test functionality.
# Copyright 2006 by Erik Hovland <erik@hovland.org>
# Licensed under GPLv2, see file LICENSE in this source tree.
# AUDIT: Unit tests for uuencode
. ./testing.sh
# testing "test name" "command(s)" "expected result" "file input" "stdin"
# file input will be f... | Shell |
#!/bin/sh
# Usage:
# runtest [applet1] [applet2...]
. ./testing.sh
total_failed=0
# Run one old-style test.
# Tests are stored in applet/testcase shell scripts.
# They are run using "sh -x -e applet/testcase".
# Option -e will make testcase stop on the first failed command.
run_applet_testcase()
{
local applet="$1"... | Shell |
#!/bin/sh
. ./md5sum.tests sha1sum d41337e834377140ae7f98460d71d908598ef04f
| Shell |
#!/bin/sh
#
# These are not ash tests, we use ash as a way to test lineedit!
#
# Copyright 2010 by Denys Vlasenko
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
test -f "$bindir/.config" && . "$bindir/.config"
test x"CONFIG_SCRIPT" = x"y" || exit 0
test x"CONFIG_HEXDUMP" = x"y" || exit 0... | Shell |
#!/bin/sh
# Copyright 2010 Nokia Corporation
# Written by Alexander Shishkin
# Licensed under GPLv2 or later, see file LICENSE in this source tree.
. ./testing.sh
# testing "test name" "command(s)" "expected result" "file input" "stdin"
optional FEATURE_AR_CREATE
rm test.a 2>/dev/null
testing "ar creates archives" ... | Shell |
#!/bin/sh
# SUSv3 compliant seq tests.
# Copyright 2006 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 will... | Shell |
#!/bin/sh
# SUSv3 compliant sed tests.
# Copyright 2005 by Rob Landley <rob@landley.net>
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# testing "description" "commands" "result" "infile" "stdin"
# Corner cases
testing "sed no files (stdin)" 'sed ""' "hello\n" "" "hello\n"
testing "se... | Shell |
#!/bin/sh
# Used by {ms5,shaN}sum
# We pipe texts 0...999 bytes long, {md5,shaN}sum them,
# then {md5,shaN}sum the resulting list.
# Then we compare the result with expected result.
#
# Here are the expected results:
# efe30c482e0b687e0cca0612f42ca29b
# d41337e834377140ae7f98460d71d908598ef04f
# 8e1d3ed57ebc130f0f7250... | Shell |
#!/bin/sh
. ./md5sum.tests sha512sum fe413e0f177324d1353893ca0772ceba83fd41512ba63895a0eebb703ef9feac2fb4e92b2cb430b3bda41b46b0cb4ea8307190a5cc795157cfb680a9cd635d0f
| Shell |
#!/bin/sh
# mkfs.minix tests.
# Copyright 2007 by Denys Vlasenko
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# testing "test name" "options" "expected result" "file input" "stdin"
# '\n' produces 10 on little endian, but not on big endian
cr=`echo | od -i | sed 's/ *$//g;s/.* //g;2d... | Shell |
#!/bin/sh
# Copyright 2005 by Rob Landley <rob@landley.net>
# Licensed under GPLv2, see file LICENSE in this source tree.
# AUDIT:
. ./testing.sh
# testing "test name" "commands" "expected result" "file input" "stdin"
# file input will be file called "input"
# test can create a file "actual" instead of writing ... | Shell |
#!/bin/sh
# Copyright 2006 Bernhard Reutner-Fischer
# Licensed under GPLv2 or later, see file LICENSE in this source tree.
. ./testing.sh
a="taskset"
# testing "test name" "opts" "expected result" "file inp" "stdin"
testing "taskset (get from pid 1)" "$a -p 1 >/dev/null;echo \$?" "0\n" "" ""
testing "tas... | Shell |
#!/bin/sh
# Copyright 2008 by Denys Vlasenko
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
test x"`id -u`" = x"0" || {
echo "SKIPPED: makedevs (must be root to test this)"
exit 0
}
unset LANG
unset LC_COLLATE
unset LC_ALL
# ls -ln is showing date. Need to remove that, it's variable
... | Shell |
#!/bin/sh
# Copyright 2008 by Denys Vlasenko
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
umask 022
# ls -ln shows date. Need to remove that, it's variable.
# sed: coalesce spaces
# cut: remove date
# grep: remove "total NNN" lines
FILTER_LS="sed 's/ */ /g' | cut -d' ' -f 1-5,9- | gr... | Shell |
#!/bin/sh
# Copyright 2008 by Denys Vlasenko <vda.linux@googlemail.com>
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# testing "description" "command" "result" "infile" "stdin"
testing "comm test 1" "comm input -" "\t123\n""456\n""abc\n""\tdef\n" "456\nabc\n" "123\ndef\n... | Shell |
#!/bin/sh
# Tests for the sourcecode base itself.
# Copyright 2006 by Mike Frysinger <vapier@gentoo.org>
# Licensed under GPLv2, see file LICENSE in this source tree.
[ -n "$srcdir" ] || srcdir=$(pwd)
. ./testing.sh
#
# if we don't have the sourcecode available, let's just bail
#
[ -s "$srcdir/../Makefile" ] || exi... | Shell |
#!/bin/sh
. ./md5sum.tests sha3sum c29d77bc548fa2b20a04c861400a5360879c52156e2a54a3415b99a9a3123e1d5f36714a24eca8c1f05a8e2d8ba859c930d41141f64a255c6794436fc99c486a
| Shell |
#!/bin/sh
# Copyright 2009 by Denys Vlasenko
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# testing "test name" "options" "expected result" "file input" "stdin"
# Simple one-block file transfer
# rx => 'C'
# rx <= SOH <blockno> <255-blockno> <128 byte padded with x1A> <crc> <crc>
# rx... | Shell |
#!/bin/sh
# Copyright 2009 by Denys Vlasenko <vda.linux@googlemail.com>
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# testing "description" "arguments" "result" "infile" "stdin"
testing "tr does not treat [] in [a-z] as special" \
"tr '[q-z]' '_Q-Z+'" \
"_QWe+" "" "[qwe]"
testing... | Shell |
#!/bin/sh
# unit test for sum.
# Copyright 2007 by Bernhard Reutner-Fischer
# Licensed under GPLv2 or later, see file LICENSE in this source tree.
# AUDIT: Unit tests for sum
. ./testing.sh
# testing "test name" "options" "expected result" "file input" "stdin"
# file input will be file called "input"
# test can... | Shell |
#!/bin/sh
# SUSv3 compliant sort tests.
# Copyright 2005 by Rob Landley <rob@landley.net>
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# The basic tests. These should work even with the small busybox.
testing "sort" "sort input" "a\nb\nc\n" "c\na\nb\n" ""
testing "sort #2" "sort inp... | Shell |
#!/bin/sh
# Copyright 2007 by Denys Vlasenko <vda.linux@googlemail.com>
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
test -f "$bindir/.config" && . "$bindir/.config"
test "`id -u`" = 0 || {
echo "SKIPPED: mount (must be root to test this)"
exit 0
}
if test x"$CONFIG_MKFS_MINIX" != x... | Shell |
#!/bin/sh
FAILCOUNT=0
ext=bz2
bb="busybox "
unset LC_ALL
unset LC_MESSAGES
unset LANG
unset LANGUAGE
hello_gz() {
# Gzipped "HELLO\n"
#_________________________ vvv vvv vvv vvv - mtime
$ECHO -ne "\x1f\x8b\x08\x00\x85\x1d\xef\x45\x02\x03\xf3\x70\xf5\xf1\xf1\xe7"
$ECHO -ne "\x02\x00\x6e\xd7\xac\xfd\x... | Shell |
#!/bin/sh
. ./md5sum.tests sha256sum 8e1d3ed57ebc130f0f72508446559eeae06451ae6d61b1e8ce46370cfb8963c3
| Shell |
#!/bin/sh
# Wrapper for User Mode Linux emulation environment
RUNFILE="$(pwd)/${1}.testroot"
if [ -z "$RUNFILE" ] || [ ! -x "$RUNFILE" ]
then
echo "Can't run '$RUNFILE'"
exit 1
fi
shift
if [ -z $(which linux) ]
then
echo "No User Mode Linux."
exit 1;
fi
linux rootfstype=hostfs rw init="$RUNFILE" TESTDIR=`p... | Shell |
#!/bin/sh
# Copyright 2008 by Denys Vlasenko
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# Need this in order to not execute shell builtin
bb="busybox "
# testing "test name" "command" "expected result" "file input" "stdin"
testing "printf produces no further output 1" \
"${bb}prin... | 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
# Tests for busybox applet itself.
# Copyright 2005 by Rob Landley <rob@landley.net>
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
HELPDUMP=`true | busybox 2>&1 | cat`
# We need to test under calling the binary under other names.
optional FEATURE_VERBOSE_USAGE
testing "busy... | Shell |
#!/bin/sh
# Copyright 2008 by Denys Vlasenko
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# testing "test name" "cmd" "expected result" "file input" "stdin"
testing "start-stop-daemon -x without -a" \
'start-stop-daemon -S -x true 2>&1; echo $?' \
"0\n" \
"" ""
testing "start-stop... | Shell |
#!/bin/sh
# Copyright 2008 by Denys Vlasenko
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# testing "test name" "command" "expected result" "file input" "stdin"
testing "xargs -E _ stops on underscore" \
"xargs -E _" \
"a\n" \
"" "a\n_\nb\n"
testing "xargs -E ''" \
"xargs -E ''" ... | Shell |
#!/bin/sh
# Copyright 2009 by Denys Vlasenko <vda.linux@googlemail.com>
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# testing "test name" "command" "expected result" "file input" "stdin"
# file input will be file called "input"
# test can create a file "actual" instead of writing... | Shell |
#!/bin/sh
# Copyright 2008 by Denys Vlasenko <vda.linux@googlemail.com>
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
COLLAPSE=$(( 0x00010000))
TRIM=$(( 0x00020000))
GREEDY=$(( 0x00040000))
MIN_DIE=$(( 0x00100000))
KEEP_COPY=$((0x00200000))
ESCAPE=$(( 0x00400000))
NORMAL=$(( ... | Shell |
#!/bin/sh
# Copyright 2010 by Denys Vlasenko
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
test -f "$bindir/.config" && . "$bindir/.config"
rm -rf ls.testdir 2>/dev/null
mkdir ls.testdir || exit 1
# testing "test name" "command" "expected result" "file input" "stdin"
# With Unicode pr... | Shell |
#!/bin/sh
# Copyright 2008 by Denys Vlasenko
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# testing "test name" "command(s)" "expected result" "file input" "stdin"
testing "patch with old_file == new_file" \
'patch 2>&1; echo $?; cat input' \
"\
patching file input
0
qwe
asd
zxc
" \
... | Shell |
#!/bin/sh
# Copyright 2009 by Denys Vlasenko
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
unset LANG
unset LANGUAGE
unset LC_COLLATE
unset LC_ALL
umask 022
rm -rf tar.tempdir 2>/dev/null
mkdir tar.tempdir && cd tar.tempdir || exit 1
# testing "test name" "script" "expected result" "f... | Shell |
#!/bin/sh
# pidof tests.
# Copyright 2005 by Bernhard Reutner-Fischer
# Licensed under GPLv2, see file LICENSE in this source tree.
# AUDIT:
. ./testing.sh
# testing "test name" "options" "expected result" "file input" "stdin"
testing "pidof (exit with error)" \
"pidof veryunlikelyoccuringbinaryname ; echo \$?" "... | Shell |
#!/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
# Readlink tests.
# Copyright 2006 by Natanael Copa <n@tanael.org>
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
TESTDIR=readlink_testdir
TESTFILE="$TESTDIR/testfile"
TESTLINK="testlink"
FAILLINK="$TESTDIR/$TESTDIR/testlink"
# create the dir and test files
mkdir -p "./$TESTD... | Shell |
#!/bin/sh
# Copyright 2008 by Denys Vlasenko
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# ls -ln is showing date. Need to remove that, it's variable
# sed: (1) "maj, min" -> "maj,min" (2) coalesce spaces
# cut: remove date
FILTER_LS="grep -v '^total ' | sed -e 's/, */,/g' -e 's/ */... | Shell |
#!/bin/sh
# Copyright 2010 by Denys Vlasenko
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
test -f "$bindir/.config" && . "$bindir/.config"
# testing "test name" "command" "expected result" "file input" "stdin"
testing "cal 2000" "cal 1 2000" "\
January 2000
Su Mo Tu We Th Fr Sa
... | Shell |
#!/bin/sh
# SUSv3 compliant mount and umount tests.
# Copyright 2005 by Rob Landley <rob@landley.net>
# Licensed under GPLv2, see file LICENSE in this source tree.
if [ -z "$TESTDIR" ]
then
echo 'Need $TESTDIR'
exit 1
fi
cd "$TESTDIR"
. testing.sh
# If we aren't PID 1, barf.
#if [ $$ -ne 1 ]
#then
# echo "SK... | Shell |
#!/bin/sh
# Copyright 2007 by Denys Vlasenko <vda.linux@googlemail.com>
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# testing "test name" "options" "expected result" "file input" "stdin"
# file input will be file called "input"
# test can create a file "actual" instead of writing... | Shell |
#!/bin/sh
# Copyright 2008 by Denys Vlasenko
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# testing "test name" "commands" "expected result" "file input" "stdin"
optional DESKTOP
testing "od -b" \
"od -b" \
"\
0000000 110 105 114 114 117
0000005
" \
"" "HELLO"
SKIP=
optional DESKTO... | Shell |
#!/bin/sh
# Copyright 2007 by Denys Vlasenko <vda.linux@googlemail.com>
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# testing "test name" "command" "expected result" "file input" "stdin"
# file input will be file called "input"
# test can create a file "actual" instead of writing... | Shell |
#!/bin/sh
# Copyright 2008 by Denys Vlasenko
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
test -f "$bindir/.config" && . "$bindir/.config"
# testing "test name" "options" "expected result" "file input" "stdin"
testing "unexpand case 1" "unexpand" \
"\t12345678\n" "" " 12345678... | Shell |
#!/bin/sh
# Copyright 2008 by Denys Vlasenko
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# testing "test name" "commands" "expected result" "file input" "stdin"
# diff outputs date/time in the header, which should not be analysed
# NB: sed has tab character in s command!
TRIM_TAB="se... | Shell |
#!/bin/sh
# Copyright 2010 by Denys Vlasenko
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# Opening quote in "omitting directory 'dir'" message:
sq='`' # GNU cp: `
sq="'" # bbox cp: '
rm -rf cp.testdir >/dev/null
mkdir cp.testdir
mkdir cp.testdir/dir
> cp.testdir/dir/file
ln -s fil... | Shell |
#!/bin/sh
# Tests for unzip.
# Copyright 2006 Rob Landley <rob@landley.net>
# Copyright 2006 Glenn McGrath
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# testing "test name" "options" "expected result" "file input" "stdin"
# file input will be file called "input"
# test can create... | Shell |
#!/bin/sh
# Copyright 2007 by Denys Vlasenko <vda.linux@googlemail.com>
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# testing "description" "command" "result" "infile" "stdin"
testing "awk -F case 0" "awk -F '[#]' '{ print NF }'" "" "" ""
testing "awk -F case 1" "awk -F '[#]' '{ ... | Shell |
#!/bin/sh
. ./bunzip2.tests
| Shell |
# Simple test harness infrastructure for BusyBox
#
# Copyright 2005 by Rob Landley
#
# License is GPLv2, see LICENSE in the busybox tarball for full license text.
# This file defines two functions, "testing" and "optional"
# and a couple more...
# The following environment variables may be set to enable optional beha... | Shell |
#!/bin/sh
# Copyright 2009 by Denys Vlasenko
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
test -f "$bindir/.config" && . "$bindir/.config"
# testing "test name" "options" "expected result" "file input" "stdin"
testing "fold -s" "fold -w 7 -s" \
"123456\n\t\nasdf" \
"" ... | 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/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
# TODO: use getopt to avoid parsing options as filenames,
# and to support -- and --help
for i in "$@"
do
sed -e '1!G;h;$!d' "$i"
done
| Shell |
#!/bin/sh
cat /etc/nologin.txt 2>/dev/null || echo "This account is not available"
sleep 5
exit 1
| Shell |
#!/bin/sh
# TODO: use getopt to avoid parsing options as filenames,
# and to support -- and --help
[ $# -ne 0 ] && DASH_I=-i
sed $DASH_I -e 's/\r$//' "$@"
| Shell |
#!/bin/sh
# TODO: use getopt to avoid parsing options as filenames,
# and to support -- and --help
[ $# -ne 0 ] && DASH_I=-i
sed $DASH_I -e 's/$/\r/' "$@"
| 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
# 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
# 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 |
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
### BEGIN INIT INFO
# Provides: openvpn
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: This shell script takes care of starting and stopping OpenVP... | Shell |
#!/bin/bash
####################################
# Tear Down Ethernet bridge on Linux
####################################
# Define Bridge Interface
br="br0"
# Define list of TAP interfaces to be bridged together
tap="tap0"
ifconfig $br down
brctl delbr $br
for t in $tap; do
openvpn --rmtun --dev $t
done
| Shell |
#!/bin/sh
#
# openvpn This shell script takes care of starting and stopping
# openvpn on RedHat or other chkconfig-based system.
#
# chkconfig: 345 24 76
#
# description: OpenVPN is a robust and highly flexible tunneling application that
# uses all of the encryption, authentication, and... | Shell |
#!/bin/bash
#################################
# Set up Ethernet bridge on Linux
# Requires: bridge-utils
#################################
# Define Bridge Interface
br="br0"
# Define list of TAP interfaces to be bridged,
# for example tap="tap0 tap1 tap2".
tap="tap0"
# Define physical ethernet interface to be bridg... | Shell |
#!/bin/bash
#################################
# Set up Ethernet bridge on Linux
# Requires: bridge-utils
#################################
# Define Bridge Interface
br="br0"
# Define list of TAP interfaces to be bridged,
# for example tap="tap0 tap1 tap2".
tap="tap7"
# Define physical ethernet interface to be bridg... | Shell |
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2007-03-29.01
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
# Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public ... | Shell |
#!/bin/sh
# This is the master OpenVPN build script for Windows.
# This script will build OpenVPN, the TAP driver, and
# the installer from source, targeting x86 on Windows
# 2000 and higher, and x64 on Windows 2003 and higher.
# For quick start options, see pre-built notes below.
#
# Note that if you are only looking... | Shell |
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2006-05-10.23
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redi... | Shell |
#!/bin/sh
route add -net 10.0.0.0 netmask 255.255.255.0 gw $5
| Shell |
#!/bin/sh
# stop all openvpn processes
killall -TERM openvpn
| Shell |
#!/bin/bash
# A Sample OpenVPN-aware firewall.
# eth0 is connected to the internet.
# eth1 is connected to a private subnet.
# Change this subnet to correspond to your private
# ethernet subnet. Home will use HOME_NET/24 and
# Office will use OFFICE_NET/24.
PRIVATE=10.0.0.0/24
# Loopback address
LOOP=127.0.0.1
# ... | Shell |
#!/bin/sh
# A sample OpenVPN startup script
# for Linux.
# openvpn config file directory
dir=/etc/openvpn
# load the firewall
$dir/firewall.sh
# load TUN/TAP kernel module
modprobe tun
# enable IP forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
# Invoke openvpn for each VPN tunnel
# in daemon mode. Alternative... | Shell |
#!/bin/sh
route add -net 10.0.1.0 netmask 255.255.255.0 gw $5
| Shell |
#! /bin/sh
#
# t_lpback.sh - script to test OpenVPN's crypto loopback
# Copyright (C) 2005 Matthias Andree
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, o... | Shell |
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2006-12-25.00
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby ... | Shell |
#!/bin/sh
#
# Bring up vpn routing.
# calculate the network address
remote_network=`ipcalc -n "$remote"/"$remote_netmask_bits"`
remote_network="${remote_network#*=}"
# add the stuff that doesn't change if it's not already there
grep -q '^202 ' /etc/iproute2/rt_tables
if [ "$?" -ne 0 ]
then
echo 202 vpn.out >> /e... | Shell |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.