summaryrefslogtreecommitdiff
path: root/release/src/router/busybox/examples
diff options
context:
space:
mode:
Diffstat (limited to 'release/src/router/busybox/examples')
-rw-r--r--release/src/router/busybox/examples/bootfloppy/bootfloppy.txt18
-rw-r--r--[-rwxr-xr-x]release/src/router/busybox/examples/bootfloppy/etc/fstab0
-rwxr-xr-xrelease/src/router/busybox/examples/bootfloppy/etc/init.d/rcS3
-rw-r--r--[-rwxr-xr-x]release/src/router/busybox/examples/bootfloppy/etc/inittab0
-rw-r--r--[-rwxr-xr-x]release/src/router/busybox/examples/bootfloppy/etc/profile2
-rwxr-xr-xrelease/src/router/busybox/examples/bootfloppy/mkdevs.sh2
-rwxr-xr-xrelease/src/router/busybox/examples/bootfloppy/mkrootfs.sh6
-rw-r--r--[-rwxr-xr-x]release/src/router/busybox/examples/bootfloppy/syslinux.cfg2
-rw-r--r--[-rwxr-xr-x]release/src/router/busybox/examples/busybox.spec4
-rw-r--r--release/src/router/busybox/examples/depmod57
-rwxr-xr-xrelease/src/router/busybox/examples/depmod.pl343
-rw-r--r--release/src/router/busybox/examples/devfsd.conf133
-rw-r--r--release/src/router/busybox/examples/dnsd.conf1
-rw-r--r--release/src/router/busybox/examples/inetd.conf73
-rw-r--r--[-rwxr-xr-x]release/src/router/busybox/examples/inittab6
-rwxr-xr-xrelease/src/router/busybox/examples/udhcp/sample.bound3
-rwxr-xr-xrelease/src/router/busybox/examples/udhcp/sample.renew3
-rw-r--r--[-rwxr-xr-x]release/src/router/busybox/examples/udhcp/sample.script0
-rw-r--r--[-rwxr-xr-x]release/src/router/busybox/examples/udhcp/simple.script3
-rw-r--r--[-rwxr-xr-x]release/src/router/busybox/examples/udhcp/udhcpd.conf25
-rw-r--r--[-rwxr-xr-x]release/src/router/busybox/examples/undeb10
-rw-r--r--[-rwxr-xr-x]release/src/router/busybox/examples/unrpm4
-rw-r--r--release/src/router/busybox/examples/zcip.script38
23 files changed, 582 insertions, 154 deletions
diff --git a/release/src/router/busybox/examples/bootfloppy/bootfloppy.txt b/release/src/router/busybox/examples/bootfloppy/bootfloppy.txt
index 090ef049..9e2cbe2b 100644
--- a/release/src/router/busybox/examples/bootfloppy/bootfloppy.txt
+++ b/release/src/router/busybox/examples/bootfloppy/bootfloppy.txt
@@ -5,7 +5,7 @@ This document describes how to buid a boot floppy using the following
components:
- Linux Kernel (http://www.kernel.org)
- - uClibc: C library (http://cvs.uclinux.org/uClibc.html)
+ - uClibc: C library (http://www.uclibc.org/)
- Busybox: Unix utilities (http://busybox.net/)
- Syslinux: bootloader (http://syslinux.zytor.com)
@@ -38,13 +38,13 @@ Making a Root File System
The following steps will create a root file system.
- Create an empty file that you can format as a filesystem:
-
+
dd if=/dev/zero of=rootfs bs=1k count=4000
- Set up the rootfs file we just created to be used as a loop device (may not
- be necessary)
+ be necessary)
- losetup /dev/loop0 rootfs
+ losetup /dev/loop0 rootfs
- Format the rootfs file with a filesystem:
@@ -72,11 +72,11 @@ The following steps will create a root file system.
- Install the Busybox binary and accompanying symlinks:
(chdir to busybox directory)
- make PREFIX=(path to)loop/ install
+ make CONFIG_PREFIX=(path to)loop/ install
- Make device files in /dev:
- This can be done by running the 'mkdevs.sh' script. If you want the gory
+ This can be done by running the 'mkdevs.sh' script. If you want the gory
details, you can read the script.
- Make necessary files in /etc:
@@ -101,15 +101,15 @@ The following steps will create the boot floppy.
Note: You will need to have the mtools package installed beforehand.
- Insert a floppy in the drive and format it with an MSDOS filesystem:
-
+
mformat a:
(if the system doesn't know what device 'a:' is, look at /etc/mtools.conf)
- Run syslinux on the floppy:
-
+
syslinux -s /dev/fd0
-
+
(the -s stands for "safe, slow, and stupid" and should work better with
buggy BIOSes; it can be omitted)
diff --git a/release/src/router/busybox/examples/bootfloppy/etc/fstab b/release/src/router/busybox/examples/bootfloppy/etc/fstab
index ef14ca2c..ef14ca2c 100755..100644
--- a/release/src/router/busybox/examples/bootfloppy/etc/fstab
+++ b/release/src/router/busybox/examples/bootfloppy/etc/fstab
diff --git a/release/src/router/busybox/examples/bootfloppy/etc/init.d/rcS b/release/src/router/busybox/examples/bootfloppy/etc/init.d/rcS
new file mode 100755
index 00000000..4f29b923
--- /dev/null
+++ b/release/src/router/busybox/examples/bootfloppy/etc/init.d/rcS
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+/bin/mount -a
diff --git a/release/src/router/busybox/examples/bootfloppy/etc/inittab b/release/src/router/busybox/examples/bootfloppy/etc/inittab
index eb3e979c..eb3e979c 100755..100644
--- a/release/src/router/busybox/examples/bootfloppy/etc/inittab
+++ b/release/src/router/busybox/examples/bootfloppy/etc/inittab
diff --git a/release/src/router/busybox/examples/bootfloppy/etc/profile b/release/src/router/busybox/examples/bootfloppy/etc/profile
index e9b11e90..8a7c77d7 100755..100644
--- a/release/src/router/busybox/examples/bootfloppy/etc/profile
+++ b/release/src/router/busybox/examples/bootfloppy/etc/profile
@@ -4,5 +4,5 @@ echo
echo -n "Processing /etc/profile... "
# no-op
echo "Done"
-echo
+echo
diff --git a/release/src/router/busybox/examples/bootfloppy/mkdevs.sh b/release/src/router/busybox/examples/bootfloppy/mkdevs.sh
index 03a1a855..8e9512f8 100755
--- a/release/src/router/busybox/examples/bootfloppy/mkdevs.sh
+++ b/release/src/router/busybox/examples/bootfloppy/mkdevs.sh
@@ -57,6 +57,6 @@ ln -s vcs0 vcs
# virtual console screen w/ attributes devs
for i in `seq 0 9`; do
- mknod vcsa$i b 7 $i
+ mknod vcsa$i b 7 $((128 + i))
done
ln -s vcsa0 vcsa
diff --git a/release/src/router/busybox/examples/bootfloppy/mkrootfs.sh b/release/src/router/busybox/examples/bootfloppy/mkrootfs.sh
index e56d1046..5cdff21a 100755
--- a/release/src/router/busybox/examples/bootfloppy/mkrootfs.sh
+++ b/release/src/router/busybox/examples/bootfloppy/mkrootfs.sh
@@ -63,10 +63,10 @@ mount -o loop,exec rootfs $TARGET_DIR # must be root
# install uClibc
mkdir -p $TARGET_DIR/lib
cd $UCLIBC_DIR
-make INSTALL_DIR=
+make INSTALL_DIR=
cp -a libc.so* $BASE_DIR/$TARGET_DIR/lib
cp -a uClibc*.so $BASE_DIR/$TARGET_DIR/lib
-cp -a ld.so-1/d-link/ld-linux-uclibc.so* $BASE_DIR/$TARGET_DIR/lib
+cp -a ld.so-1/d-link/ld-linux-uclibc.so* $BASE_DIR/$TARGET_DIR/lib
cp -a ld.so-1/libdl/libdl.so* $BASE_DIR/$TARGET_DIR/lib
cp -a crypt/libcrypt.so* $BASE_DIR/$TARGET_DIR/lib
cd $BASE_DIR
@@ -76,7 +76,7 @@ cd $BASE_DIR
cd $BUSYBOX_DIR
make distclean
make CC=$BASE_DIR/$UCLIBC_DIR/extra/gcc-uClibc/i386-uclibc-gcc
-make PREFIX=$BASE_DIR/$TARGET_DIR install
+make CONFIG_PREFIX=$BASE_DIR/$TARGET_DIR install
cd $BASE_DIR
diff --git a/release/src/router/busybox/examples/bootfloppy/syslinux.cfg b/release/src/router/busybox/examples/bootfloppy/syslinux.cfg
index 8d407cad..fa2677ca 100755..100644
--- a/release/src/router/busybox/examples/bootfloppy/syslinux.cfg
+++ b/release/src/router/busybox/examples/bootfloppy/syslinux.cfg
@@ -4,4 +4,4 @@ timeout 10
prompt 1
label linux
kernel linux
- append initrd=rootfs.gz root=/dev/ram0
+ append initrd=rootfs.gz root=/dev/ram0
diff --git a/release/src/router/busybox/examples/busybox.spec b/release/src/router/busybox/examples/busybox.spec
index 188b09b2..494eed94 100755..100644
--- a/release/src/router/busybox/examples/busybox.spec
+++ b/release/src/router/busybox/examples/busybox.spec
@@ -34,11 +34,11 @@ make
%Install
rm -rf $RPM_BUILD_ROOT
-make PREFIX=$RPM_BUILD_ROOT install
+make CONFIG_PREFIX=$RPM_BUILD_ROOT install
%Clean
rm -rf $RPM_BUILD_ROOT
-%Files
+%Files
%defattr(-,root,root)
/
diff --git a/release/src/router/busybox/examples/depmod b/release/src/router/busybox/examples/depmod
new file mode 100644
index 00000000..d8c4cc5a
--- /dev/null
+++ b/release/src/router/busybox/examples/depmod
@@ -0,0 +1,57 @@
+#!/bin/sh
+#
+# Simple depmod, use to generate modprobe.conf
+#
+# Copyright (C) 2008 by Vladimir Dronnikov <dronnikov@gmail.com>
+#
+# Licensed under GPLv2
+#
+
+local BASE="${1:-/usr/lib/modules}"
+
+find "$BASE" -name '*.ko.gz' | while read I ; do
+ N=`basename "$I" '.ko.gz'`
+ echo -n "@$N"
+ zcat "$I" | strings | grep '^depends=' | sed -e 's/^depends=$//' -e 's/^depends=/,/' -e 's/,/ @/g'
+done | awk '
+{
+ # modules which has no dependencies are resolved
+ if ( NF == 1 ) { res[$1] = ""; next }
+ # others have to be resolved based on those which already resolved
+ i = $1; $1 = ""; deps[i] = $0; ++ndeps
+}
+END {
+ # resolve implicit dependencies
+ while ( ndeps ) for (mod in deps) {
+ if ( index(deps[mod], "@") > 0 ) {
+ $0 = deps[mod]
+ for ( i=1; i<=NF; ++i ) {
+ if ( substr($i,1,1) == "@" ) {
+ if ( $i in res ) {
+ $i = res[$i] " " substr($i,2)
+ }
+ }
+ }
+ deps[mod] = $0
+ } else {
+ res[mod] = deps[mod]
+ delete deps[mod]
+ --ndeps
+ }
+ }
+
+ # output dependencies in modules.dep format
+ for ( mod in res ) {
+ $0 = res[mod]
+ s = ""
+ delete a
+ for ( i=1; i<=NF; ++i ) {
+ if ( ! ($i in a) ) {
+ a[$i] = $i
+ s = " ," $i s
+ }
+ }
+ print "," substr(mod,2) ":" s
+ }
+}
+' | sort | sed -r -e "s!,([^,: ]*)!/usr/lib/modules/\\1.ko.gz!g"
diff --git a/release/src/router/busybox/examples/depmod.pl b/release/src/router/busybox/examples/depmod.pl
index c4964e7a..6b5ce2f5 100755
--- a/release/src/router/busybox/examples/depmod.pl
+++ b/release/src/router/busybox/examples/depmod.pl
@@ -1,152 +1,259 @@
#!/usr/bin/perl -w
-# vi: set ts=4:
+# vi: set sw=4 ts=4:
# Copyright (c) 2001 David Schleef <ds@schleef.org>
# Copyright (c) 2001 Erik Andersen <andersen@codepoet.org>
-# Copyright (c) 2001 Stuart Hughes <stuarth@lineo.com>
+# Copyright (c) 2001 Stuart Hughes <seh@zee2.com>
# Copyright (c) 2002 Steven J. Hill <shill@broadcom.com>
-# This program is free software; you can redistribute it and/or modify it
+# Copyright (c) 2006 Freescale Semiconductor, Inc <stuarth@freescale.com>
+#
+# History:
+# March 2006: Stuart Hughes <stuarth@freescale.com>.
+# Significant updates, including implementing the '-F' option
+# and adding support for 2.6 kernels.
+
+# This program is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
-
-# TODO -- use strict mode...
-#use strict;
-
-use Getopt::Long;
+use Getopt::Long qw(:config no_auto_abbrev no_ignore_case);
use File::Find;
-
+use strict;
# Set up some default values
-
+my $kdir="";
my $basedir="";
-my $kernel;
-my $kernelsyms;
+my $kernel="";
+my $kernelsyms="";
+my $symprefix="";
+my $all=0;
+my $quick=0;
+my $errsyms=0;
my $stdout=0;
my $verbose=0;
-
+my $help=0;
+my $nm = $ENV{'NM'} || "nm";
+
+# more globals
+my (@liblist) = ();
+my $exp = {};
+my $dep = {};
+my $mod = {};
+
+my $usage = <<TXT;
+$0 -b basedir { -k <vmlinux> | -F <System.map> } [options]...
+ Where:
+ -h --help : Show this help screen
+ -b --basedir : Modules base directory (e.g /lib/modules/<2.x.y>)
+ -k --kernel : Kernel binary for the target (e.g. vmlinux)
+ -F --kernelsyms : Kernel symbol file (e.g. System.map)
+ -n --stdout : Write to stdout instead of <basedir>/modules.dep
+ -v --verbose : Print out lots of debugging stuff
+ -P --symbol-prefix : Symbol prefix
+ -a --all : Probe all modules (default/only thing supported)
+ -e --errsyms : Report any symbols not supplied by modules/kernel
+TXT
# get command-line options
-
-my %opt;
-
GetOptions(
- \%opt,
- "help|h",
- "basedir|b=s" => \$basedir,
- "kernel|k=s" => \$kernel,
- "kernelsyms|F=s" => \$kernelsyms,
- "stdout|n" => \$stdout,
- "verbose|v" => \$verbose,
+ "help|h" => \$help,
+ "basedir|b=s" => \$basedir,
+ "kernel|k=s" => \$kernel,
+ "kernelsyms|F=s" => \$kernelsyms,
+ "stdout|n" => \$stdout,
+ "verbose|v" => \$verbose,
+ "symbol-prefix|P=s" => \$symprefix,
+ "all|a" => \$all,
+ # unsupported options
+ "quick|A" => \$quick,
+ # ignored options (for historical usage)
+ "quiet|q",
+ "root|r",
+ "unresolved-error|u"
);
-if (defined $opt{help}) {
- print
- " $0 [OPTION]... [basedir]\n",
- " -h --help\t\tShow this help screen\n",
- " -b --basedir\tModules base directory (defaults to /lib/modules)\n",
- " -k --kernel\tKernel binary for the target\n",
- " -F --kernelsyms\tKernel symbol file\n",
- " -n --stdout\tWrite to stdout instead of <basedir>/modules.dep\n",
- " -v --verbose\tPrint out lots of debugging stuff\n",
- ;
- exit 1;
-}
+die $usage if $help;
+die $usage unless $basedir && ( $kernel || $kernelsyms );
+die "can't use both -k and -F\n\n$usage" if $kernel && $kernelsyms;
+die "sorry, -A/--quick is not supported" if $quick;
+die "--errsyms requires --kernelsyms" if $errsyms && !$kernelsyms;
+# Strip any trailing or multiple slashes from basedir
+$basedir =~ s-/+$--g;
+
+# The base directory should contain /lib/modules somewhere
if($basedir !~ m-/lib/modules-) {
warn "WARNING: base directory does not match ..../lib/modules\n";
}
-# Find the list of .o files living under $basedir
-#if ($verbose) { printf "Locating all modules\n"; }
-my($ofile) = "";
-my($file) = "";
-my(@liblist) = ();
-find sub {
- if ( -f $_ && ! -d $_ ) {
+# if no kernel version is contained in the basedir, try to find one
+if($basedir !~ m-/lib/modules/\d\.\d-) {
+ opendir(BD, $basedir) or die "can't open basedir $basedir : $!\n";
+ foreach ( readdir(BD) ) {
+ next if /^\.\.?$/;
+ next unless -d "$basedir/$_";
+ warn "dir = $_\n" if $verbose;
+ if( /^\d\.\d/ ) {
+ $kdir = $_;
+ warn("Guessed module directory as $basedir/$kdir\n");
+ last;
+ }
+ }
+ closedir(BD);
+ die "Cannot find a kernel version under $basedir\n" unless $kdir;
+ $basedir = "$basedir/$kdir";
+}
+
+# Find the list of .o or .ko files living under $basedir
+warn "**** Locating all modules\n" if $verbose;
+find sub {
+ my $file;
+ if ( -f $_ && ! -d $_ ) {
$file = $File::Find::name;
- if ( $file =~ /.o$/ ) {
+ if ( $file =~ /\.k?o$/ ) {
push(@liblist, $file);
- if ($verbose) { printf "$file\n"; }
+ warn "$file\n" if $verbose;
}
}
}, $basedir;
-if ($verbose) { printf "Finished locating modules\n"; }
+warn "**** Finished locating modules\n" if $verbose;
-foreach $obj ( @liblist, $kernel ){
+foreach my $obj ( @liblist ){
# turn the input file name into a target tag name
- # vmlinux is a special that is only used to resolve symbols
- if($obj =~ /vmlinux/) {
- $tgtname = "vmlinux";
- } else {
- ($tgtname) = $obj =~ m-(/lib/modules/.*)$-;
- }
+ my ($tgtname) = $obj =~ m-(/lib/modules/.*)$-;
- warn "MODULE = $tgtname\n" if $verbose;
+ warn "\nMODULE = $tgtname\n" if $verbose;
# get a list of symbols
- @output=`nm $obj`;
- $ksymtab=grep m/ __ksymtab/, @output;
+ my @output=`$nm $obj`;
- # gather the exported symbols
- if($ksymtab){
- # explicitly exported
- foreach ( @output ) {
- / __ksymtab_(.*)$/ and do {
- warn "sym = $1\n" if $verbose;
- $exp->{$1} = $tgtname;
- };
- }
- } else {
- # exporting all symbols
- foreach ( @output) {
- / [ABCDGRST] (.*)$/ and do {
- warn "syma = $1\n" if $verbose;
- $exp->{$1} = $tgtname;
- };
- }
- }
- # gather the unresolved symbols
- foreach ( @output ) {
- !/ __this_module/ && / U (.*)$/ and do {
- warn "und = $1\n" if $verbose;
- push @{$dep->{$tgtname}}, $1;
- };
- }
+ build_ref_tables($tgtname, \@output, $exp, $dep);
}
-# reduce dependancies: remove unresolvable and resolved from vmlinux
+# vmlinux is a special name that is only used to resolve symbols
+my $tgtname = 'vmlinux';
+my @output = $kernelsyms ? `cat $kernelsyms` : `$nm $kernel`;
+warn "\nMODULE = $tgtname\n" if $verbose;
+build_ref_tables($tgtname, \@output, $exp, $dep);
+
+# resolve the dependencies for each module
+# reduce dependencies: remove unresolvable and resolved from vmlinux/System.map
# remove duplicates
-foreach $module (keys %$dep) {
+foreach my $module (keys %$dep) {
+ warn "reducing module: $module\n" if $verbose;
$mod->{$module} = {};
foreach (@{$dep->{$module}}) {
- if( $exp->{$_} ) {
+ if( $exp->{$_} ) {
warn "resolved symbol $_ in file $exp->{$_}\n" if $verbose;
next if $exp->{$_} =~ /vmlinux/;
$mod->{$module}{$exp->{$_}} = 1;
} else {
warn "unresolved symbol $_ in file $module\n";
}
- }
+ }
+}
+
+# build a complete dependency list for each module and make sure it
+# is kept in order proper order
+my $mod2 = {};
+sub maybe_unshift
+{
+ my ($array, $ele) = @_;
+ # chop off the leading path /lib/modules/<kver>/ as modprobe
+ # will handle relative paths just fine
+ $ele =~ s:^/lib/modules/[^/]*/::;
+ foreach (@{$array}) {
+ if ($_ eq $ele) {
+ return;
+ }
+ }
+ unshift (@{$array}, $ele);
}
+sub add_mod_deps
+{
+ my ($depth, $mod, $mod2, $module, $this_module) = @_;
+
+ $depth .= " ";
+ warn "${depth}loading deps of module: $this_module\n" if $verbose;
-# resolve the dependancies for each module
-if ($stdout == 1) {
- foreach $module ( keys %$mod ) {
- print "$module:\t";
- @sorted = sort bydep keys %{$mod->{$module}};
- print join(" \\\n\t",@sorted);
- print "\n\n";
+ foreach my $md (keys %{$mod->{$this_module}}) {
+ add_mod_deps ($depth, $mod, $mod2, $module, $md);
+ warn "${depth} outputting $md\n" if $verbose;
+ maybe_unshift (\@{$$mod2->{$module}}, $md);
}
-} else {
- open(OFILE, ">$basedir/modules.dep");
- foreach $module ( keys %$mod ) {
- print OFILE "$module:\t";
- @sorted = sort bydep keys %{$mod->{$module}};
- print OFILE join(" \\\n\t",@sorted);
- print OFILE "\n\n";
+
+ if (!%{$mod->{$this_module}}) {
+ warn "${depth} no deps\n" if $verbose;
}
}
+foreach my $module (keys %$mod) {
+ warn "filling out module: $module\n" if $verbose;
+ @{$mod2->{$module}} = ();
+ add_mod_deps ("", $mod, \$mod2, $module, $module);
+}
+
+# figure out where the output should go
+if ($stdout == 0) {
+ warn "writing $basedir/modules.dep\n" if $verbose;
+ open(STDOUT, ">$basedir/modules.dep")
+ or die "cannot open $basedir/modules.dep: $!";
+}
+my $kseries = $basedir =~ m,/2\.6\.[^/]*, ? '2.6' : '2.4';
+
+foreach my $module ( keys %$mod ) {
+ if($kseries eq '2.4') {
+ print "$module:\t";
+ my @sorted = sort bydep keys %{$mod->{$module}};
+ print join(" ",@sorted);
+ print "\n\n";
+ } else {
+ my $shortmod = $module;
+ $shortmod =~ s:^/lib/modules/[^/]*/::;
+ print "$shortmod:";
+ my @sorted = @{$mod2->{$module}};
+ printf " " if @sorted;
+ print join(" ",@sorted);
+ print "\n";
+ }
+}
+sub build_ref_tables
+{
+ my ($name, $sym_ar, $exp, $dep) = @_;
+
+ my $ksymtab = grep m/ ${symprefix}__ksymtab/, @$sym_ar;
+
+ # gather the exported symbols
+ if($ksymtab){
+ # explicitly exported
+ foreach ( @$sym_ar ) {
+ / ${symprefix}__ksymtab_(.*)$/ and do {
+ my $sym = ${symprefix} . $1;
+ warn "sym = $sym\n" if $verbose;
+ $exp->{$sym} = $name;
+ };
+ }
+ } else {
+ # exporting all symbols
+ foreach ( @$sym_ar ) {
+ / [ABCDGRSTW] (.*)$/ and do {
+ warn "syma = $1\n" if $verbose;
+ $exp->{$1} = $name;
+ };
+ }
+ }
+
+ # this takes makes sure modules with no dependencies get listed
+ push @{$dep->{$name}}, $symprefix . 'printk' unless $name eq 'vmlinux';
+
+ # gather the unresolved symbols
+ foreach ( @$sym_ar ) {
+ !/ ${symprefix}__this_module/ && / U (.*)$/ and do {
+ warn "und = $1\n" if $verbose;
+ push @{$dep->{$name}}, $1;
+ };
+ }
+}
+
sub bydep
{
foreach my $f ( keys %{$mod->{$b}} ) {
@@ -163,8 +270,11 @@ __END__
=head1 NAME
-depmod.pl - a cross platform script to generate kernel module dependency
- lists which can then be used by modprobe.
+depmod.pl - a cross platform script to generate kernel module
+dependency lists (modules.conf) which can then be used by modprobe
+on the target platform.
+
+It supports Linux 2.4 and 2.6 styles of modules.conf (auto-detected)
=head1 SYNOPSIS
@@ -172,12 +282,12 @@ depmod.pl [OPTION]... [basedir]...
Example:
- depmod.pl -F linux/System.map target/lib/modules
+ depmod.pl -F linux/System.map -b target/lib/modules/2.6.11
=head1 DESCRIPTION
The purpose of this script is to automagically generate a list of of kernel
-module dependancies. This script produces dependancy lists that should be
+module dependencies. This script produces dependency lists that should be
identical to the depmod program from the modutils package. Unlike the depmod
binary, however, depmod.pl is designed to be run on your host system, not
on your target system.
@@ -198,33 +308,39 @@ This displays the help message.
The base directory uner which the target's modules will be found. This
defaults to the /lib/modules directory.
+If you don't specify the kernel version, this script will search for
+one under the specified based directory and use the first thing that
+looks like a kernel version.
+
=item B<-k --kernel>
-Kernel binary for the target. You must either supply a kernel binary
+Kernel binary for the target (vmlinux). You must either supply a kernel binary
or a kernel symbol file (using the -F option).
=item B<-F --kernelsyms>
-Kernel symbol file for the target. You must supply either a kernel symbol file
-kernel binary for the target (using the -k option).
+Kernel symbol file for the target (System.map).
=item B<-n --stdout>
-Write to stdout instead of modules.dep. This is currently hard coded...
+Write to stdout instead of modules.dep
kernel binary for the target (using the -k option).
=item B<--verbose>
-Be verbose (not implemented)
+Verbose (debug) output
=back
-=head1 COPYRIGHT
+=head1 COPYRIGHT AND LICENSE
+
+ Copyright (c) 2001 David Schleef <ds@schleef.org>
+ Copyright (c) 2001 Erik Andersen <andersen@codepoet.org>
+ Copyright (c) 2001 Stuart Hughes <seh@zee2.com>
+ Copyright (c) 2002 Steven J. Hill <shill@broadcom.com>
+ Copyright (c) 2006 Freescale Semiconductor, Inc <stuarth@freescale.com>
-Copyright (c) 2001 David Schleef <ds@schleef.org>
-Copyright (c) 2001 Erik Andersen <andersen@lineo.com>
-Copyright (c) 2001 Stuart Hughes <stuarth@lineo.com>
-This program is free software; you can redistribute it and/or modify it
+This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
=head1 AUTHOR
@@ -232,6 +348,3 @@ under the same terms as Perl itself.
David Schleef <ds@schleef.org>
=cut
-
-# $Id: depmod.pl,v 1.1.3.1 2004/12/29 07:07:44 honor Exp $
-
diff --git a/release/src/router/busybox/examples/devfsd.conf b/release/src/router/busybox/examples/devfsd.conf
new file mode 100644
index 00000000..10f1c878
--- /dev/null
+++ b/release/src/router/busybox/examples/devfsd.conf
@@ -0,0 +1,133 @@
+# Sample /etc/devfsd.conf configuration file.
+# Richard Gooch <rgooch@atnf.csiro.au> 17-FEB-2002
+#
+# adapted for busybox devfsd implementation by Tito <farmatito@tiscali.it>
+#
+# Enable full compatibility mode for old device names. You may comment these
+# out if you don't use the old device names. Make sure you know what you're
+# doing!
+REGISTER .* MKOLDCOMPAT
+UNREGISTER .* RMOLDCOMPAT
+
+# You may comment out the above and uncomment the following if you've
+# configured your system to use the original "new" devfs names or the really
+# new names
+#REGISTER ^vc/ MKOLDCOMPAT
+#UNREGISTER ^vc/ RMOLDCOMPAT
+#REGISTER ^pty/ MKOLDCOMPAT
+#UNREGISTER ^pty/ RMOLDCOMPAT
+#REGISTER ^misc/ MKOLDCOMPAT
+#UNREGISTER ^misc/ RMOLDCOMPAT
+
+# You may comment these out if you don't use the original "new" names
+REGISTER .* MKNEWCOMPAT
+UNREGISTER .* RMNEWCOMPAT
+
+# Enable module autoloading. You may comment this out if you don't use
+# autoloading
+# Supported by busybox when CONFIG_DEVFSD_MODLOAD is set.
+# This actually doesn't work with busybox modutils but needs
+# the real modutils' modprobe
+LOOKUP .* MODLOAD
+
+# Uncomment the following if you want to set the group to "tty" for the
+# pseudo-tty devices. This is necessary so that mesg(1) can later be used to
+# enable/disable talk requests and wall(1) messages.
+REGISTER ^pty/s.* PERMISSIONS -1.tty 0600
+#REGISTER ^pts/.* PERMISSIONS -1.tty 0600
+
+# Restoring /dev/log on startup would trigger the minilogd/initlog deadlock
+# (minilogd falsely assuming syslogd has been started).
+REGISTER ^log$ IGNORE
+CREATE ^log$ IGNORE
+CHANGE ^log$ IGNORE
+DELETE ^log$ IGNORE
+
+#
+# Uncomment this if you want permissions to be saved and restored
+# Do not do this for pseudo-terminal devices
+REGISTER ^pt[sy] IGNORE
+CREATE ^pt[sy] IGNORE
+CHANGE ^pt[sy] IGNORE
+DELETE ^pt[sy] IGNORE
+REGISTER .* COPY /lib/dev-state/$devname $devpath
+CREATE .* COPY $devpath /lib/dev-state/$devname
+CHANGE .* COPY $devpath /lib/dev-state/$devname
+#DELETE .* CFUNCTION GLOBAL unlink /lib/dev-state/$devname
+# Busybox
+DELETE .* EXECUTE /bin/rm -f /lib/dev-state/$devname
+
+RESTORE /lib/dev-state
+
+#
+# Uncomment this if you want the old /dev/cdrom symlink
+#REGISTER ^cdroms/cdrom0$ CFUNCTION GLOBAL mksymlink $devname cdrom
+#UNREGISTER ^cdroms/cdrom0$ CFUNCTION GLOBAL unlink cdrom
+# busybox
+REGISTER ^cdroms/cdrom0$ EXECUTE /bin/ln -sf $devname cdrom
+UNREGISTER ^cdroms/cdrom0$ EXECUTE /bin/rm -f cdrom
+
+#REGISTER ^v4l/video0$ CFUNCTION GLOBAL mksymlink v4l/video0 video
+#UNREGISTER ^v4l/video0$ CFUNCTION GLOBAL unlink video
+#REGISTER ^radio0$ CFUNCTION GLOBAL mksymlink radio0 radio
+#UNREGISTER ^radio0$ CFUNCTION GLOBAL unlink radio
+# Busybox
+REGISTER ^v4l/video0$ EXECUTE /bin/ln -sf v4l/video0 video
+UNREGISTER ^v4l/video0$ EXECUTE /bin/rm -f video
+REGISTER ^radio0$ EXECUTE /bin/ln -sf radio0 radio
+UNREGISTER ^radio0$ EXECUTE /bin/rm -f radio
+
+# ALSA stuff
+#LOOKUP snd MODLOAD ACTION snd
+
+# Uncomment this to let PAM manage devfs
+# Not supported by busybox
+#REGISTER .* CFUNCTION /lib/security/pam_console_apply_devfsd.so pam_console_apply_single $devpath
+
+# Uncomment this to manage USB mouse
+# Not supported by busybox
+#REGISTER ^input/mouse0$ CFUNCTION GLOBAL mksymlink $devname usbmouse
+#UNREGISTER ^input/mouse0$ CFUNCTION GLOBAL unlink usbmouse
+# Busybox
+#REGISTER ^input/mouse0$ EXECUTE /bin/ln -sf $devname usbmouse
+#UNREGISTER ^input/mouse0$ EXECUTE /bin/rm -f usbmouse
+# Not supported by busybox
+#REGISTER ^input/mice$ CFUNCTION GLOBAL mksymlink $devname usbmouse
+#UNREGISTER ^input/mice$ CFUNCTION GLOBAL unlink usbmouse
+# Busybox
+REGISTER ^input/mice$ EXECUTE /bin/ln -sf $devname usbmouse
+UNREGISTER ^input/mice$ EXECUTE /bin/rm -f usbmouse
+
+# If you have removable media and want to force media revalidation when looking
+# up new or old compatibility names, uncomment the following lines
+# SCSI NEWCOMPAT /dev/sd/* names
+LOOKUP ^(sd/c[0-9]+b[0-9]+t[0-9]+u[0-9]+)p[0-9]+$ EXECUTE /bin/dd if=$mntpnt/\1 of=/dev/null count=1
+# SCSI OLDCOMPAT /dev/sd?? names
+LOOKUP ^(sd[a-z]+)[0-9]+$ EXECUTE /bin/dd if=$mntpnt/\1 of=/dev/null count=1
+# IDE NEWCOMPAT /dev/ide/hd/* names
+LOOKUP ^(ide/hd/c[0-9]+b[0-9]+t[0-9]+u[0-9]+)p[0-9]+$ EXECUTE /bin/dd if=$mntpnt/\1 of=/dev/null count=1
+# IDE OLDCOMPAT /dev/hd?? names
+LOOKUP ^(hd[a-z])[0-9]+$ EXECUTE /bin/dd if=$mntpnt/\1 of=/dev/null count=1
+# IDE-SCSI NEWCOMPAT /dev/sd/* names
+#LOOKUP ^(sd/c[0-9]+b[0-9]+t[0-9]+u[0-9]+)p[0-9]+$ EXECUTE /bin/dd if=$mntpnt/\1 of=/dev/null count=1
+#SCSI OLDCOMPAT /dev/scd? names
+LOOKUP ^(scd+)[0-9]+$ EXECUTE /bin/dd if=$mntpnt/\1 of=/dev/null count=1
+
+
+REGISTER ^dvb/card[0-9]+/[^/]+$ PERMISSIONS root.video 0660
+# Not supported by busybox
+#REGISTER ^dvb/card([0-9]+)/([^/0-9]*)[0-9]+$ CFUNCTION GLOBAL mksymlink /dev/$devname ost/\2\1
+#UNREGISTER ^dvb/card([0-9]+)/([^/0-9]*)[0-9]+$ CFUNCTION GLOBAL unlink ost/\2\1
+# Busybox
+REGISTER ^dvb/card([0-9]+)/([^/0-9]*)[0-9]+$ EXECUTE /bin/ln -sf /dev/$devname ost/\2\1
+UNREGISTER ^dvb/card([0-9]+)/([^/0-9]*)[0-9]+$ EXECUTE /bin/rm -f ost/\2\1
+
+# Include package-generated files from /etc/devfs/conf.d
+# Supported by busybox
+# INCLUDE /etc/devfs/conf.d/
+INCLUDE /etc/devfs/busybox/
+# Busybox: just for testing
+#INCLUDE /etc/devfs/nothing/
+#INCLUDE /etc/devfs/nothing/nothing
+#OPTIONAL_INCLUDE /etc/devfs/nothing/
+#OPTIONAL_INCLUDE /etc/devfs/nothing/nothing
diff --git a/release/src/router/busybox/examples/dnsd.conf b/release/src/router/busybox/examples/dnsd.conf
new file mode 100644
index 00000000..8af622b0
--- /dev/null
+++ b/release/src/router/busybox/examples/dnsd.conf
@@ -0,0 +1 @@
+thebox 192.168.1.5
diff --git a/release/src/router/busybox/examples/inetd.conf b/release/src/router/busybox/examples/inetd.conf
new file mode 100644
index 00000000..ca7e3d8e
--- /dev/null
+++ b/release/src/router/busybox/examples/inetd.conf
@@ -0,0 +1,73 @@
+# /etc/inetd.conf: see inetd(8) for further informations.
+#
+# Internet server configuration database
+#
+#
+# If you want to disable an entry so it isn't touched during
+# package updates just comment it out with a single '#' character.
+#
+# If you make changes to this file, either reboot your machine or
+# send the inetd process a HUP signal:
+# Do a "ps x" as root and look up the pid of inetd. Then do a
+# kill -HUP <pid of inetd>
+# inetd will re-read this file whenever it gets that signal.
+# <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
+#
+#:INTERNAL: Internal services
+# It is generally considered safer to keep these off.
+echo stream tcp nowait root internal
+echo dgram udp wait root internal
+#discard stream tcp nowait root internal
+#discard dgram udp wait root internal
+daytime stream tcp nowait root internal
+daytime dgram udp wait root internal
+#chargen stream tcp nowait root internal
+#chargen dgram udp wait root internal
+time stream tcp nowait root internal
+time dgram udp wait root internal
+
+# These are standard services.
+#
+#ftp stream tcp nowait root /usr/sbin/tcpd in.ftpd
+#telnet stream tcp nowait root /sbin/telnetd /sbin/telnetd
+#nntp stream tcp nowait root tcpd in.nntpd
+#smtp stream tcp nowait root tcpd sendmail -v
+#
+# Shell, login, exec and talk are BSD protocols.
+#
+# If you run an ntalk daemon (such as netkit-ntalk) on the old talk
+# port, that is, "talk" as opposed to "ntalk", it won't work and may
+# cause certain broken talk clients to malfunction.
+#
+# The talkd from netkit-ntalk 0.12 and higher, however, can speak the
+# old talk protocol and can be used safely.
+#
+#shell stream tcp nowait root /usr/sbin/tcpd in.rshd -L
+#login stream tcp nowait root /usr/sbin/tcpd in.rlogind -L
+#exec stream tcp nowait root /usr/sbin/tcpd in.rexecd
+#talk dgram udp wait root /usr/sbin/tcpd in.talkd
+#ntalk dgram udp wait root /usr/sbin/tcpd in.talkd
+#
+# Pop et al
+# Leave these off unless you're using them.
+#pop2 stream tcp nowait root /usr/sbin/tcpd in.pop2d
+#pop3 stream tcp nowait root /usr/sbin/tcpd in.pop3d
+#
+# The Internet UUCP service.
+# uucp stream tcp nowait uucp /usr/sbin/tcpd /usr/lib/uucp/uucico -l
+#
+# Tftp service is provided primarily for booting. Most sites
+# run this only on machines acting as "boot servers." If you don't
+# need it, don't use it.
+#
+#tftp dgram udp wait nobody /usr/sbin/tcpd in.tftpd
+#bootps dgram udp wait root /usr/sbin/in.bootpd in.bootpd
+#
+# Finger, systat and netstat give out user information which may be
+# valuable to potential "system crackers." Many sites choose to disable
+# some or all of these services to improve security.
+#
+#finger stream tcp nowait nobody /usr/sbin/tcpd in.fingerd -w
+#systat stream tcp nowait nobody /usr/sbin/tcpd /bin/ps -auwwx
+#netstat stream tcp nowait root /bin/netstat /bin/netstat -a
+#ident stream tcp nowait root /usr/sbin/in.identd in.identd
diff --git a/release/src/router/busybox/examples/inittab b/release/src/router/busybox/examples/inittab
index 38df9249..5f2af872 100755..100644
--- a/release/src/router/busybox/examples/inittab
+++ b/release/src/router/busybox/examples/inittab
@@ -1,6 +1,6 @@
# /etc/inittab init(8) configuration for BusyBox
#
-# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org>
+# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
#
#
# Note, BusyBox init doesn't support runlevels. The runlevels field is
@@ -17,12 +17,12 @@
# be unique, although if it isn't you may have strange results. If this
# field is left blank, it is completely ignored. Also note that if
# BusyBox detects that a serial console is in use, then all entries
-# containing non-empty id fields will _not_ be run. BusyBox init does
+# containing non-empty id fields will be ignored. BusyBox init does
# nothing with utmp. We don't need no stinkin' utmp.
#
# <runlevels>: The runlevels field is completely ignored.
#
-# <action>: Valid actions include: sysinit, respawn, askfirst, wait, once,
+# <action>: Valid actions include: sysinit, respawn, askfirst, wait, once,
# restart, ctrlaltdel, and shutdown.
#
# Note: askfirst acts just like respawn, but before running the specified
diff --git a/release/src/router/busybox/examples/udhcp/sample.bound b/release/src/router/busybox/examples/udhcp/sample.bound
index 20035267..2a95d8b7 100755
--- a/release/src/router/busybox/examples/udhcp/sample.bound
+++ b/release/src/router/busybox/examples/udhcp/sample.bound
@@ -15,9 +15,10 @@ then
do :
done
+ metric=0
for i in $router
do
- /sbin/route add default gw $i dev $interface
+ /sbin/route add default gw $i dev $interface metric $((metric++))
done
fi
diff --git a/release/src/router/busybox/examples/udhcp/sample.renew b/release/src/router/busybox/examples/udhcp/sample.renew
index c953e975..842bafe9 100755
--- a/release/src/router/busybox/examples/udhcp/sample.renew
+++ b/release/src/router/busybox/examples/udhcp/sample.renew
@@ -15,9 +15,10 @@ then
do :
done
+ metric=0
for i in $router
do
- /sbin/route add default gw $i dev $interface
+ /sbin/route add default gw $i dev $interface metric $((metric++))
done
fi
diff --git a/release/src/router/busybox/examples/udhcp/sample.script b/release/src/router/busybox/examples/udhcp/sample.script
index 9b717ac3..9b717ac3 100755..100644
--- a/release/src/router/busybox/examples/udhcp/sample.script
+++ b/release/src/router/busybox/examples/udhcp/sample.script
diff --git a/release/src/router/busybox/examples/udhcp/simple.script b/release/src/router/busybox/examples/udhcp/simple.script
index a52a7f81..98ebc159 100755..100644
--- a/release/src/router/busybox/examples/udhcp/simple.script
+++ b/release/src/router/busybox/examples/udhcp/simple.script
@@ -22,8 +22,9 @@ case "$1" in
:
done
+ metric=0
for i in $router ; do
- route add default gw $i dev $interface
+ route add default gw $i dev $interface metric $((metric++))
done
fi
diff --git a/release/src/router/busybox/examples/udhcp/udhcpd.conf b/release/src/router/busybox/examples/udhcp/udhcpd.conf
index 2b93e0fa..8c9a9684 100755..100644
--- a/release/src/router/busybox/examples/udhcp/udhcpd.conf
+++ b/release/src/router/busybox/examples/udhcp/udhcpd.conf
@@ -2,7 +2,7 @@
# The start and end of the IP lease block
-start 192.168.0.20 #default: 192.168.0.20
+start 192.168.0.20 #default: 192.168.0.20
end 192.168.0.254 #default: 192.168.0.254
@@ -33,7 +33,7 @@ interface eth0 #default: eth0
#auto_time 7200 #default: 7200 (2 hours)
-# The amount of time that an IP will be reserved (leased) for if a
+# The amount of time that an IP will be reserved (leased) for if a
# DHCP decline message is received (seconds).
#decline_time 3600 #default: 3600 (1 hour)
@@ -67,7 +67,7 @@ interface eth0 #default: eth0
#notify_file #default: (no script)
-#notify_file dumpleases # <--- usefull for debugging
+#notify_file dumpleases # <--- useful for debugging
# The following are bootp specific options, setable by udhcpd.
@@ -96,15 +96,15 @@ option lease 864000 # 10 days of seconds
#opt subnet
#opt timezone
#opt router
-#opt timesvr
-#opt namesvr
+#opt timesrv
+#opt namesrv
#opt dns
-#opt logsvr
-#opt cookiesvr
-#opt lprsvr
+#opt logsrv
+#opt cookiesrv
+#opt lprsrv
#opt bootsize
#opt domain
-#opt swapsvr
+#opt swapsrv
#opt rootpath
#opt ipttl
#opt mtu
@@ -114,3 +114,10 @@ option lease 864000 # 10 days of seconds
#opt ntpsrv
#opt tftp
#opt bootfile
+
+
+# Static leases map
+#static_lease 00:60:08:11:CE:4E 192.168.0.54
+#static_lease 00:60:08:11:CE:3E 192.168.0.44
+
+
diff --git a/release/src/router/busybox/examples/undeb b/release/src/router/busybox/examples/undeb
index a72e1e2b..37104e9d 100755..100644
--- a/release/src/router/busybox/examples/undeb
+++ b/release/src/router/busybox/examples/undeb
@@ -8,12 +8,12 @@ usage() {
echo "Usage: undeb -c package.deb <Print control file info>"
echo " undeb -l package.deb <List contents of deb package>"
echo " undeb -x package.deb /foo/boo <Extract deb package to this directory,"
-echo " put . for current directory>"
+echo " put . for current directory>"
exit
}
deb=$2
-
+
exist() {
if [ "$deb" = "" ]; then
usage
@@ -30,11 +30,11 @@ exist
type more >/dev/null 2>&1 && pager=more
type less >/dev/null 2>&1 && pager=less
[ "$pager" = "" ] && echo "No pager found!" && exit
-(ar -p $deb control.tar.gz | tar -xzO *control ; echo -e "\nPress enter to scroll, q to Quit!\n" ; ar -p $deb data.tar.gz | tar -tzv) | $pager
+(ar -p $deb control.tar.gz | tar -xzO *control ; echo -e "\nPress enter to scroll, q to Quit!\n" ; ar -p $deb data.tar.gz | tar -tzv) | $pager
exit
elif [ "$1" = "-c" ]; then
exist
-ar -p $deb control.tar.gz | tar -xzO *control
+ar -p $deb control.tar.gz | tar -xzO *control
exit
elif [ "$1" = "-x" ]; then
exist
@@ -44,7 +44,7 @@ elif [ ! -d "$3" ]; then
echo "No such directory $3!"
exit
fi
-ar -p $deb data.tar.gz | tar -xzvpf - -C $3 || exit
+ar -p $deb data.tar.gz | tar -xzvpf - -C $3 || exit
echo
echo "Extracted $deb to $3!"
exit
diff --git a/release/src/router/busybox/examples/unrpm b/release/src/router/busybox/examples/unrpm
index 376286a6..7fd3676f 100755..100644
--- a/release/src/router/busybox/examples/unrpm
+++ b/release/src/router/busybox/examples/unrpm
@@ -7,12 +7,12 @@
usage() {
echo "Usage: unrpm -l package.rpm <List contents of rpm package>"
echo " unrpm -x package.rpm /foo/boo <Extract rpm package to this directory,"
-echo " put . for current directory>"
+echo " put . for current directory>"
exit
}
rpm=$2
-
+
exist() {
if [ "$rpm" = "" ]; then
usage
diff --git a/release/src/router/busybox/examples/zcip.script b/release/src/router/busybox/examples/zcip.script
new file mode 100644
index 00000000..988e542a
--- /dev/null
+++ b/release/src/router/busybox/examples/zcip.script
@@ -0,0 +1,38 @@
+#!/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
+ ;;
+config)
+ if [ "x$ip" = x ]
+ then
+ exit 1
+ fi
+ # remember $ip for $interface, to use on restart
+ if [ "x$IP" != x -a -w "$IP.$interface" ]
+ then
+ echo $ip > "$IP.$interface"
+ fi
+ exec ip address add dev $interface \
+ scope link local "$ip/16" broadcast +
+ ;;
+deconfig)
+ if [ x$ip = x ]
+ then
+ exit 1
+ fi
+ exec ip address del dev $interface local $ip
+ ;;
+esac
+exit 1