This commit was manufactured by cvs2svn to create tag 'whiterussian_rc3'. whiterussian_rc3 whiterussian_rc3
authorOpenWrt Development <openwrt-devel@lists.openwrt.org>
Wed, 14 Sep 2005 15:29:02 +0000 (15:29 +0000)
committerOpenWrt Development <openwrt-devel@lists.openwrt.org>
Wed, 14 Sep 2005 15:29:02 +0000 (15:29 +0000)
SVN-Revision: 1922

784 files changed:
CVSROOT/checkoutlist [deleted file]
CVSROOT/ciabot.pl [deleted file]
CVSROOT/commitinfo [deleted file]
CVSROOT/config [deleted file]
CVSROOT/cvswrappers [deleted file]
CVSROOT/editinfo [deleted file]
CVSROOT/loginfo [deleted file]
CVSROOT/modules [deleted file]
CVSROOT/notify [deleted file]
CVSROOT/rcsinfo [deleted file]
CVSROOT/taginfo [deleted file]
CVSROOT/verifymsg [deleted file]
obsolete-buildroot/.cvsignore [deleted file]
obsolete-buildroot/Makefile [deleted file]
obsolete-buildroot/README [deleted file]
obsolete-buildroot/README.pppoe [deleted file]
obsolete-buildroot/make/MISSING.mk [deleted file]
obsolete-buildroot/make/arptables.mk [deleted file]
obsolete-buildroot/make/autoconf.mk [deleted file]
obsolete-buildroot/make/automake.mk [deleted file]
obsolete-buildroot/make/bash.mk [deleted file]
obsolete-buildroot/make/berkeleydb.mk [deleted file]
obsolete-buildroot/make/binutils-uclibc.mk [deleted file]
obsolete-buildroot/make/bison.mk [deleted file]
obsolete-buildroot/make/boa.mk [deleted file]
obsolete-buildroot/make/bridge.mk [deleted file]
obsolete-buildroot/make/busybox.mk [deleted file]
obsolete-buildroot/make/bzip2.mk [deleted file]
obsolete-buildroot/make/ccache.mk [deleted file]
obsolete-buildroot/make/chillispot.mk [deleted file]
obsolete-buildroot/make/coreutils.mk [deleted file]
obsolete-buildroot/make/cramfsroot.mk [deleted file]
obsolete-buildroot/make/customize.mk [deleted file]
obsolete-buildroot/make/dhcp-fwd.mk [deleted file]
obsolete-buildroot/make/dhcp_relay.mk [deleted file]
obsolete-buildroot/make/diffutils.mk [deleted file]
obsolete-buildroot/make/dnsmasq.mk [deleted file]
obsolete-buildroot/make/dropbear.mk [deleted file]
obsolete-buildroot/make/ebtables.mk [deleted file]
obsolete-buildroot/make/ed.mk [deleted file]
obsolete-buildroot/make/ext2root.mk [deleted file]
obsolete-buildroot/make/fakeroot.mk [deleted file]
obsolete-buildroot/make/file.mk [deleted file]
obsolete-buildroot/make/findutils.mk [deleted file]
obsolete-buildroot/make/flex.mk [deleted file]
obsolete-buildroot/make/fprobe.mk [deleted file]
obsolete-buildroot/make/gawk.mk [deleted file]
obsolete-buildroot/make/gcc-uclibc-2.95.mk [deleted file]
obsolete-buildroot/make/gcc-uclibc-3.3.mk [deleted file]
obsolete-buildroot/make/gdb.mk [deleted file]
obsolete-buildroot/make/gdbserver.mk [deleted file]
obsolete-buildroot/make/gettext.mk [deleted file]
obsolete-buildroot/make/grep.mk [deleted file]
obsolete-buildroot/make/gzip.mk [deleted file]
obsolete-buildroot/make/hostap.mk [deleted file]
obsolete-buildroot/make/hotplug.mk [deleted file]
obsolete-buildroot/make/ipkg-utils.mk [deleted file]
obsolete-buildroot/make/iproute2.mk [deleted file]
obsolete-buildroot/make/iptables.mk [deleted file]
obsolete-buildroot/make/jffs2-bbc.mk [deleted file]
obsolete-buildroot/make/jffs2root.mk [deleted file]
obsolete-buildroot/make/jpeg.mk [deleted file]
obsolete-buildroot/make/kernel-headers.mk [deleted file]
obsolete-buildroot/make/kmod-ipt6.mk [deleted file]
obsolete-buildroot/make/kmod-ipv6.mk [deleted file]
obsolete-buildroot/make/kmod-nfs.mk [deleted file]
obsolete-buildroot/make/kmod-ppp-async.mk [deleted file]
obsolete-buildroot/make/kmod-ppp-mppe-mppc.mk [deleted file]
obsolete-buildroot/make/kmod-sched.mk [deleted file]
obsolete-buildroot/make/kmod-tun.mk [deleted file]
obsolete-buildroot/make/less.mk [deleted file]
obsolete-buildroot/make/libfloat.mk [deleted file]
obsolete-buildroot/make/libglib12.mk [deleted file]
obsolete-buildroot/make/libmad.mk [deleted file]
obsolete-buildroot/make/libpcap.mk [deleted file]
obsolete-buildroot/make/libpthread.mk [deleted file]
obsolete-buildroot/make/libtool.mk [deleted file]
obsolete-buildroot/make/links.mk [deleted file]
obsolete-buildroot/make/lrzsz.mk [deleted file]
obsolete-buildroot/make/ltp-testsuite.mk [deleted file]
obsolete-buildroot/make/ltrace.mk [deleted file]
obsolete-buildroot/make/lzo.mk [deleted file]
obsolete-buildroot/make/m4.mk [deleted file]
obsolete-buildroot/make/make.mk [deleted file]
obsolete-buildroot/make/matrixssl.mk [deleted file]
obsolete-buildroot/make/microcom.mk [deleted file]
obsolete-buildroot/make/microwin.mk [deleted file]
obsolete-buildroot/make/mkdosfs.mk [deleted file]
obsolete-buildroot/make/mke2fs.mk [deleted file]
obsolete-buildroot/make/mrouted.mk [deleted file]
obsolete-buildroot/make/ncurses.mk [deleted file]
obsolete-buildroot/make/netfilter.mk [deleted file]
obsolete-buildroot/make/netkitbase.mk [deleted file]
obsolete-buildroot/make/netkittelnet.mk [deleted file]
obsolete-buildroot/make/netsnmp.mk [deleted file]
obsolete-buildroot/make/newt.mk [deleted file]
obsolete-buildroot/make/ntp.mk [deleted file]
obsolete-buildroot/make/ntpclient.mk [deleted file]
obsolete-buildroot/make/oidentd.mk [deleted file]
obsolete-buildroot/make/openssh.mk [deleted file]
obsolete-buildroot/make/openssl.mk [deleted file]
obsolete-buildroot/make/openvpn.mk [deleted file]
obsolete-buildroot/make/openwrt.mk [deleted file]
obsolete-buildroot/make/patch.mk [deleted file]
obsolete-buildroot/make/pciutils.mk [deleted file]
obsolete-buildroot/make/pcmcia.mk [deleted file]
obsolete-buildroot/make/ppp.mk [deleted file]
obsolete-buildroot/make/pppd.mk [deleted file]
obsolete-buildroot/make/pppoecd.mk [deleted file]
obsolete-buildroot/make/pptp-client.mk [deleted file]
obsolete-buildroot/make/pptp-server.mk [deleted file]
obsolete-buildroot/make/radvd.mk [deleted file]
obsolete-buildroot/make/sed.mk [deleted file]
obsolete-buildroot/make/slang.mk [deleted file]
obsolete-buildroot/make/socat.mk [deleted file]
obsolete-buildroot/make/squashfsroot.mk [deleted file]
obsolete-buildroot/make/strace.mk [deleted file]
obsolete-buildroot/make/system-linux.mk [deleted file]
obsolete-buildroot/make/tar.mk [deleted file]
obsolete-buildroot/make/tcpdump.mk [deleted file]
obsolete-buildroot/make/tinylogin.mk [deleted file]
obsolete-buildroot/make/tn5250.mk [deleted file]
obsolete-buildroot/make/ttcp.mk [deleted file]
obsolete-buildroot/make/uclibc.mk [deleted file]
obsolete-buildroot/make/udhcp.mk [deleted file]
obsolete-buildroot/make/util-linux.mk [deleted file]
obsolete-buildroot/make/valgrind.mk [deleted file]
obsolete-buildroot/make/vsftpd.mk [deleted file]
obsolete-buildroot/make/vtun.mk [deleted file]
obsolete-buildroot/make/wshaper.mk [deleted file]
obsolete-buildroot/make/wtools.mk [deleted file]
obsolete-buildroot/make/zlib.mk [deleted file]
obsolete-buildroot/sources/.cvsignore [deleted file]
obsolete-buildroot/sources/STLport-4.5.3.patch [deleted file]
obsolete-buildroot/sources/binutils-uclibc-001-debian.patch [deleted file]
obsolete-buildroot/sources/binutils-uclibc-100-conf.patch [deleted file]
obsolete-buildroot/sources/binutils-uclibc-200-build_modules.patch [deleted file]
obsolete-buildroot/sources/binutils-uclibc-210-cflags.patch [deleted file]
obsolete-buildroot/sources/boa-config.site-i386 [deleted file]
obsolete-buildroot/sources/boa.conf [deleted file]
obsolete-buildroot/sources/bridge.patch [deleted file]
obsolete-buildroot/sources/dnsmasq1-100-bugfix.patch [deleted file]
obsolete-buildroot/sources/file.patch [deleted file]
obsolete-buildroot/sources/gcc-uclibc-3.3-100-conf.patch [deleted file]
obsolete-buildroot/sources/gcc-uclibc-3.3-110-conf.patch [deleted file]
obsolete-buildroot/sources/gcc-uclibc-3.3-120-softfloat.patch [deleted file]
obsolete-buildroot/sources/gcc-uclibc-3.3-200-code.patch [deleted file]
obsolete-buildroot/sources/gcc-uclibc-3.3-loop.patch [deleted file]
obsolete-buildroot/sources/gcc2.95-mega.patch.bz2 [deleted file]
obsolete-buildroot/sources/gcc2.95-uclibc-conf.patch [deleted file]
obsolete-buildroot/sources/gcc3.3-mega.patch.bz2 [deleted file]
obsolete-buildroot/sources/gdb-5.3-uclibc.patch [deleted file]
obsolete-buildroot/sources/gdb.patch [deleted file]
obsolete-buildroot/sources/genext2fs.patch [deleted file]
obsolete-buildroot/sources/hotplug.patch [deleted file]
obsolete-buildroot/sources/ipkg-utils-1.7-ipkg_build_clean.patch [deleted file]
obsolete-buildroot/sources/ipkg-utils-1.7-ipkg_buildpackage.patch [deleted file]
obsolete-buildroot/sources/iproute2-cross-ar-20010824.patch [deleted file]
obsolete-buildroot/sources/iproute2-htb3.6_tc.patch [deleted file]
obsolete-buildroot/sources/iptables-openwrt-extensions.patch [deleted file]
obsolete-buildroot/sources/libfloat.patch [deleted file]
obsolete-buildroot/sources/libglib_configure_1.2.10.bz2 [deleted file]
obsolete-buildroot/sources/libssl.control [deleted file]
obsolete-buildroot/sources/ltp-testsuite.patch [deleted file]
obsolete-buildroot/sources/lzo-cross-compile.patch [deleted file]
obsolete-buildroot/sources/mime.types [deleted file]
obsolete-buildroot/sources/mrouted-sys_errlist.patch [deleted file]
obsolete-buildroot/sources/netkittelnet.patch [deleted file]
obsolete-buildroot/sources/netsnmp.patch [deleted file]
obsolete-buildroot/sources/openvpn [deleted file]
obsolete-buildroot/sources/openwrt/busybox/busybox.config [deleted file]
obsolete-buildroot/sources/openwrt/busybox/patches/100-killall5.patch [deleted file]
obsolete-buildroot/sources/openwrt/busybox/patches/110-telnetd.patch [deleted file]
obsolete-buildroot/sources/openwrt/busybox/patches/120-no_login_for_telnetd.patch [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/chillispot/CONTROL/conffiles [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/chillispot/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/chillispot/root/etc/init.d/chilli [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/dhcp-fwd/CONTROL/conffiles [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/dhcp-fwd/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/dhcp-fwd/root/etc/dhcp-fwd.conf [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/dhcp-fwd/root/etc/init.d/dhcp-fwd [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/dropbear/CONTROL/conffiles [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/dropbear/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/dropbear/CONTROL/postinst [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/dropbear/S51dropbear [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/dropbear/dropbear.patch [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/fprobe/CONTROL/conffiles [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/fprobe/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/fprobe/root/etc/fprobe.conf [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/fprobe/root/etc/init.d/fprobe [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/ip6tables/ip6tables.control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/iproute/ip/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/iproute/tc/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/kmod-ipt6/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/kmod-ipt6/CONTROL/rules [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/kmod-ipt6/kmod-ipt6.control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/kmod-ipv6/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/kmod-ipv6/CONTROL/rules [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/kmod-ipv6/kmod-ipv6.control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/kmod-nfs/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/kmod-nfs/CONTROL/postinst [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/kmod-nfs/CONTROL/rules [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/kmod-ppp-async/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/kmod-ppp-async/CONTROL/rules [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/kmod-ppp-mppe-mppc/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/kmod-ppp-mppe-mppc/CONTROL/rules [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/kmod-sched/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/kmod-sched/CONTROL/rules [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/kmod-tun/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/kmod-tun/CONTROL/rules [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/libmatrixssl/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/libpcap/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/libpthread/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/libpthread/CONTROL/rules [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/ntpclient/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.client.conffiles [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.client.control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.client.ex.control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.client.preinst [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.client.ssh_config [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.patch [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.S50sshd-ipk [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.conffiles [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.postinst [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.preinst [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.sshd_config [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.sftp-client.control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.sftp-server.control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/openssl/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/openssl/openssl.patch [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/ppp-radius-plugin/CONTROL/conffiles [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/ppp-radius-plugin/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/ppp-radius-plugin/root/etc/ppp/radius-options [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/ppp-radius-plugin/root/etc/ppp/radius.conf [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/ppp-radius-plugin/root/etc/ppp/radius/dictionary [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/ppp-radius-plugin/root/etc/ppp/radius/dictionary.microsoft [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/ppp-radius-plugin/root/etc/ppp/radius/servers [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/ppp/CONTROL/conffiles [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/ppp/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/ppp/root/etc/ppp/chap-secrets [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/ppp/root/etc/ppp/options [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/ppp/root/etc/ppp/peers/.placeholder [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/pppoecd/CONTROL/conffiles [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/pppoecd/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/pppoecd/CONTROL/postrm [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/pppoecd/CONTROL/prerm [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/pppoecd/pppoecd-pathnames.patch [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/pppoecd/pppoecd.patch [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/pppoecd/root/etc/ppp/ip-up [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/pptp-client/CONTROL/conffiles [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/pptp-client/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/pptp-client/root/etc/ppp/peers/pptp-client-sample [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/pptp-client/root/etc/ppp/pptp-client-options [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/pptp-server/CONTROL/conffiles [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/pptp-server/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/pptp-server/root/etc/init.d/pptp-server [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/pptp-server/root/etc/ppp/pptp-server-options [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/pptp-server/root/etc/pptpd.conf [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/radvd/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/radvd/CONTROL/postinst [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/radvd/radvd.conf.example [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/strace/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/tcpdump/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/vsftpd/CONTROL/conffiles [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/vsftpd/CONTROL/control [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/vsftpd/root/etc/init.d/vsftpd [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/vsftpd/root/etc/vsftpd.conf [deleted file]
obsolete-buildroot/sources/openwrt/ipkg/zlib/control [deleted file]
obsolete-buildroot/sources/openwrt/kernel/compressed-20040531.tar.bz2 [deleted file]
obsolete-buildroot/sources/openwrt/kernel/diag.c [deleted file]
obsolete-buildroot/sources/openwrt/kernel/linux.config [deleted file]
obsolete-buildroot/sources/openwrt/kernel/netfilter/patches/100-revert_netfilter.patch [deleted file]
obsolete-buildroot/sources/openwrt/kernel/netfilter/patches/110-conntrack_setting.patch [deleted file]
obsolete-buildroot/sources/openwrt/kernel/patches/110-sch_htb.patch [deleted file]
obsolete-buildroot/sources/openwrt/kernel/patches/120-openwrt.patch [deleted file]
obsolete-buildroot/sources/openwrt/kernel/patches/130-nfsswap.patch [deleted file]
obsolete-buildroot/sources/openwrt/kernel/patches/140-ebtables-brnf-5.patch [deleted file]
obsolete-buildroot/sources/openwrt/kernel/patches/150-mppe-mppc-0.98.patch [deleted file]
obsolete-buildroot/sources/openwrt/kernel/patches/160-expr.patch [deleted file]
obsolete-buildroot/sources/openwrt/patches/libpcap/00_debian_libpcap0.8_0.8.3-4.diff [deleted file]
obsolete-buildroot/sources/openwrt/patches/matrixssl/matrixssl-1.1.2-openwrt.patch [deleted file]
obsolete-buildroot/sources/openwrt/patches/matrixssl/matrixssl-1.2.1-examples_fix.patch [deleted file]
obsolete-buildroot/sources/openwrt/patches/ppp/000_ppp-2.4.2-cvs-20040427.patch [deleted file]
obsolete-buildroot/sources/openwrt/patches/ppp/008_pathnames.h.diff [deleted file]
obsolete-buildroot/sources/openwrt/patches/ppp/010_scripts_README.diff [deleted file]
obsolete-buildroot/sources/openwrt/patches/ppp/011_scripts_redialer.diff [deleted file]
obsolete-buildroot/sources/openwrt/patches/ppp/018_ip-up_option.diff [deleted file]
obsolete-buildroot/sources/openwrt/patches/ppp/057_pppoe-interface-change [deleted file]
obsolete-buildroot/sources/openwrt/patches/ppp/auth_hook_segfault [deleted file]
obsolete-buildroot/sources/openwrt/patches/ppp/cifdefroute.dif [deleted file]
obsolete-buildroot/sources/openwrt/patches/ppp/close_devfd [deleted file]
obsolete-buildroot/sources/openwrt/patches/ppp/fix_closed_fds [deleted file]
obsolete-buildroot/sources/openwrt/patches/ppp/no_crypt_hack [deleted file]
obsolete-buildroot/sources/openwrt/patches/ppp/ppp-2.3.11-oedod.dif [deleted file]
obsolete-buildroot/sources/openwrt/patches/ppp/ppp-2.4.2-stripMSdomain [deleted file]
obsolete-buildroot/sources/openwrt/patches/ppp/pppdump-no-deflate [deleted file]
obsolete-buildroot/sources/openwrt/patches/ppp/setevn_call_file [deleted file]
obsolete-buildroot/sources/openwrt/patches/ppp/syslog_local2 [deleted file]
obsolete-buildroot/sources/openwrt/patches/ppp/z01_ppp-2.4.2-openwrt.patch [deleted file]
obsolete-buildroot/sources/openwrt/patches/ppp/z02_ppp-2.4.2-stdopt-mppe-mppc-1.1.patch [deleted file]
obsolete-buildroot/sources/openwrt/patches/pptp-server/poptop-1.1.3-20030409-CCOPTS.patch [deleted file]
obsolete-buildroot/sources/openwrt/patches/tcpdump/00_debian_tcpdump_3.8.3-3.diff [deleted file]
obsolete-buildroot/sources/openwrt/patches/vsftpd/vsftpd-1.2.2-openwrt.patch [deleted file]
obsolete-buildroot/sources/openwrt/patches/wrt54g-router.patch [deleted file]
obsolete-buildroot/sources/openwrt/patches/wrt54g-shared.patch [deleted file]
obsolete-buildroot/sources/openwrt/root/bin/firstboot [deleted file]
obsolete-buildroot/sources/openwrt/root/bin/ipkg [deleted file]
obsolete-buildroot/sources/openwrt/root/bin/login [deleted file]
obsolete-buildroot/sources/openwrt/root/etc/banner [deleted file]
obsolete-buildroot/sources/openwrt/root/etc/dnsmasq.conf [deleted file]
obsolete-buildroot/sources/openwrt/root/etc/functions.sh [deleted file]
obsolete-buildroot/sources/openwrt/root/etc/init.d/S10boot [deleted file]
obsolete-buildroot/sources/openwrt/root/etc/init.d/S40network [deleted file]
obsolete-buildroot/sources/openwrt/root/etc/init.d/S45firewall [deleted file]
obsolete-buildroot/sources/openwrt/root/etc/init.d/S50dnsmasq [deleted file]
obsolete-buildroot/sources/openwrt/root/etc/init.d/S50httpd [deleted file]
obsolete-buildroot/sources/openwrt/root/etc/init.d/S50telnet [deleted file]
obsolete-buildroot/sources/openwrt/root/etc/init.d/S99done [deleted file]
obsolete-buildroot/sources/openwrt/root/etc/init.d/rcS [deleted file]
obsolete-buildroot/sources/openwrt/root/etc/inittab [deleted file]
obsolete-buildroot/sources/openwrt/root/etc/ipkg.conf [deleted file]
obsolete-buildroot/sources/openwrt/root/etc/nvram.overrides [deleted file]
obsolete-buildroot/sources/openwrt/root/etc/preinit [deleted file]
obsolete-buildroot/sources/openwrt/root/etc/profile [deleted file]
obsolete-buildroot/sources/openwrt/root/etc/sysctl.conf [deleted file]
obsolete-buildroot/sources/openwrt/root/rom/note [deleted file]
obsolete-buildroot/sources/openwrt/root/sbin/halt [deleted file]
obsolete-buildroot/sources/openwrt/root/sbin/hotplug [deleted file]
obsolete-buildroot/sources/openwrt/root/sbin/ifdown [deleted file]
obsolete-buildroot/sources/openwrt/root/sbin/ifup [deleted file]
obsolete-buildroot/sources/openwrt/root/sbin/wifi [deleted file]
obsolete-buildroot/sources/openwrt/root/usr/share/udhcpc/default.script [deleted file]
obsolete-buildroot/sources/openwrt/root/www/index.html [deleted file]
obsolete-buildroot/sources/openwrt/tools/addpattern.c [deleted file]
obsolete-buildroot/sources/openwrt/tools/sstrip.c [deleted file]
obsolete-buildroot/sources/openwrt/tools/trx.c [deleted file]
obsolete-buildroot/sources/patch-kernel.sh [deleted file]
obsolete-buildroot/sources/pppoecd.prerm [deleted file]
obsolete-buildroot/sources/sedcheck.sh [deleted file]
obsolete-buildroot/sources/specs-arm-soft-float [deleted file]
obsolete-buildroot/sources/specs-mips-soft-float [deleted file]
obsolete-buildroot/sources/specs-mipsel-soft-float [deleted file]
obsolete-buildroot/sources/specs-powerpc-soft-float [deleted file]
obsolete-buildroot/sources/squashfs.patch [deleted file]
obsolete-buildroot/sources/tinyx-011010.patch [deleted file]
obsolete-buildroot/sources/uClibc-ldso-0.9.24.patch [deleted file]
obsolete-buildroot/sources/uClibc.config [deleted file]
obsolete-buildroot/sources/uClibc.config-locale [deleted file]
obsolete-buildroot/sources/uClibc.config-openwrt [deleted file]
obsolete-buildroot/sources/util-linux.patch [deleted file]
obsolete-buildroot/sources/valgrind.patch [deleted file]
obsolete-buildroot/sources/vtun.patch [deleted file]
obsolete-buildroot/sources/yacc [deleted file]
openwrt/LICENSE [new file with mode: 0644]
openwrt/Makefile
openwrt/README
openwrt/docs/CHANGES [deleted file]
openwrt/docs/README [deleted file]
openwrt/docs/buildroot-documentation.html
openwrt/package/Config.in
openwrt/package/Makefile
openwrt/package/arptables/Makefile
openwrt/package/asterisk/patches/asterisk-1.0.7-no_gtk.patch [new file with mode: 0644]
openwrt/package/base-files/Makefile [new file with mode: 0644]
openwrt/package/base-files/default/bin/firstboot [new file with mode: 0755]
openwrt/package/base-files/default/bin/login [new file with mode: 0755]
openwrt/package/base-files/default/etc/banner [new file with mode: 0644]
openwrt/package/base-files/default/etc/firewall.user [new file with mode: 0755]
openwrt/package/base-files/default/etc/functions.sh [new file with mode: 0755]
openwrt/package/base-files/default/etc/group [new file with mode: 0644]
openwrt/package/base-files/default/etc/hosts [new file with mode: 0644]
openwrt/package/base-files/default/etc/init.d/S05nvram [new file with mode: 0755]
openwrt/package/base-files/default/etc/init.d/S10boot [new file with mode: 0755]
openwrt/package/base-files/default/etc/init.d/S40network [new file with mode: 0755]
openwrt/package/base-files/default/etc/init.d/S45firewall [new file with mode: 0755]
openwrt/package/base-files/default/etc/init.d/S50httpd [new file with mode: 0755]
openwrt/package/base-files/default/etc/init.d/S50telnet [new file with mode: 0755]
openwrt/package/base-files/default/etc/init.d/S99done [new file with mode: 0755]
openwrt/package/base-files/default/etc/init.d/rcS [new file with mode: 0755]
openwrt/package/base-files/default/etc/inittab [new file with mode: 0644]
openwrt/package/base-files/default/etc/ipkg.conf [new file with mode: 0644]
openwrt/package/base-files/default/etc/nvram.overrides [new file with mode: 0644]
openwrt/package/base-files/default/etc/passwd [new file with mode: 0644]
openwrt/package/base-files/default/etc/preinit [new file with mode: 0755]
openwrt/package/base-files/default/etc/profile [new file with mode: 0644]
openwrt/package/base-files/default/etc/protocols [new file with mode: 0644]
openwrt/package/base-files/default/etc/shells [new file with mode: 0644]
openwrt/package/base-files/default/etc/sysctl.conf [new file with mode: 0644]
openwrt/package/base-files/default/rom/note [new file with mode: 0644]
openwrt/package/base-files/default/sbin/backup [new file with mode: 0755]
openwrt/package/base-files/default/sbin/halt [new file with mode: 0755]
openwrt/package/base-files/default/sbin/ifdown [new file with mode: 0755]
openwrt/package/base-files/default/sbin/ifup [new file with mode: 0755]
openwrt/package/base-files/default/sbin/mount_root [new file with mode: 0755]
openwrt/package/base-files/default/sbin/restore [new file with mode: 0755]
openwrt/package/base-files/default/usr/share/udhcpc/default.script [new file with mode: 0755]
openwrt/package/base-files/files/hotplug [new file with mode: 0755]
openwrt/package/base-files/ipkg/base-files.conffiles [new file with mode: 0644]
openwrt/package/base-files/ipkg/base-files.control [new file with mode: 0644]
openwrt/package/base-files/ipkg/hotplug.control [new file with mode: 0644]
openwrt/package/base-files/ipkg/libgcc.control [new file with mode: 0644]
openwrt/package/base-files/ipkg/uclibc.control [new file with mode: 0644]
openwrt/package/busybox/patches/160-tar_fix.patch [new file with mode: 0644]
openwrt/package/busybox/patches/170-udhcp-options.patch [new file with mode: 0644]
openwrt/package/bwm/Makefile
openwrt/package/dhcp-forwarder/Makefile
openwrt/package/dnsmasq/Makefile
openwrt/package/dnsmasq/files/S50dnsmasq [new file with mode: 0755]
openwrt/package/dnsmasq/files/dnsmasq.conf [new file with mode: 0644]
openwrt/package/dnsmasq/ipkg/dnsmasq.conffiles [new file with mode: 0644]
openwrt/package/dropbear/files/S50dropbear
openwrt/package/dsniff/Config.in
openwrt/package/dsniff/Makefile
openwrt/package/dsniff/patches/arpspoof-fix.patch [new file with mode: 0644]
openwrt/package/frickin/files/frickin.init
openwrt/package/fuse/Makefile
openwrt/package/gmp/Makefile
openwrt/package/htpdate/files/htpdate.init
openwrt/package/ipkg/Config.in
openwrt/package/ipkg/Makefile
openwrt/package/ipkg/patches/no-diff.patch [new file with mode: 0644]
openwrt/package/iptables/kernelconfig.mk
openwrt/package/kismet/Config.in
openwrt/package/kismet/Makefile
openwrt/package/kismet/files/kismet.conf
openwrt/package/kismet/files/kismet_drone.conf
openwrt/package/kismet/ipkg/kismet-client.conffiles
openwrt/package/kismet/ipkg/kismet-drone.conffiles
openwrt/package/kismet/ipkg/kismet-server.conffiles
openwrt/package/kismet/ipkg/kismet.control [new file with mode: 0644]
openwrt/package/kismet/patches/100-remove_sources.patch [deleted file]
openwrt/package/kismet/patches/100-wrt54g_source.patch [new file with mode: 0644]
openwrt/package/kismet/patches/110-uclibc++_fixes.patch
openwrt/package/kismet/patches/120-cleanup.patch [new file with mode: 0644]
openwrt/package/kismet/patches/120-remove_sound.patch [deleted file]
openwrt/package/lcd4linux/ipkg/lcd4linux.control
openwrt/package/libnids/Config.in
openwrt/package/lighttpd/Makefile
openwrt/package/lighttpd/patches/500-configure_cross.patch [new file with mode: 0644]
openwrt/package/madwifi-tools/Config.in [new file with mode: 0644]
openwrt/package/madwifi-tools/Makefile [new file with mode: 0644]
openwrt/package/madwifi-tools/ipkg/madwifi-tools.control [new file with mode: 0644]
openwrt/package/madwifi-tools/patches/001-no_kerneldir.patch [new file with mode: 0644]
openwrt/package/mtd/Config.in [new file with mode: 0644]
openwrt/package/mtd/Makefile [new file with mode: 0644]
openwrt/package/mtd/ipkg/mtd-static.control [new file with mode: 0644]
openwrt/package/mtd/ipkg/mtd.control [new file with mode: 0644]
openwrt/package/mtd/mtd.c [new file with mode: 0644]
openwrt/package/ncurses/Makefile
openwrt/package/net-snmp/patches/901-ipsec-interfaces.patch [new file with mode: 0644]
openwrt/package/nfs-server/Makefile
openwrt/package/nmap/Makefile
openwrt/package/nvram/Makefile [new file with mode: 0644]
openwrt/package/nvram/ipkg/nvram.control [new file with mode: 0644]
openwrt/package/nvram/src/Makefile [new file with mode: 0644]
openwrt/package/nvram/src/bcmtimer.h [new file with mode: 0644]
openwrt/package/nvram/src/defaults.c [new file with mode: 0644]
openwrt/package/nvram/src/linux_timer.c [new file with mode: 0644]
openwrt/package/nvram/src/main.c [new file with mode: 0644]
openwrt/package/nvram/src/nvram_convert.c [new file with mode: 0644]
openwrt/package/nvram/src/nvram_convert.h [new file with mode: 0644]
openwrt/package/nvram/src/nvram_linux.c [new file with mode: 0644]
openwrt/package/nvram/src/shutils.c [new file with mode: 0644]
openwrt/package/nvram/src/wl.c [new file with mode: 0644]
openwrt/package/nvram/src/wl_linux.c [new file with mode: 0644]
openwrt/package/openldap/Makefile
openwrt/package/openntpd/ipkg/openntpd.postinst
openwrt/package/openssh/Config.in
openwrt/package/openssh/files/S50sshd
openwrt/package/openswan/Config.in
openwrt/package/openvpn/Config.in
openwrt/package/openvpn/Makefile
openwrt/package/openwrt/Makefile [deleted file]
openwrt/package/openwrt/include/bcmnvram.h [deleted file]
openwrt/package/openwrt/include/bcmutils.h [deleted file]
openwrt/package/openwrt/include/cy_conf.h [deleted file]
openwrt/package/openwrt/include/epivers.h [deleted file]
openwrt/package/openwrt/include/proto/802.11.h [deleted file]
openwrt/package/openwrt/include/proto/ethernet.h [deleted file]
openwrt/package/openwrt/include/shutils.h [deleted file]
openwrt/package/openwrt/include/typedefs.h [deleted file]
openwrt/package/openwrt/include/utils.h [deleted file]
openwrt/package/openwrt/include/wlcompat.h [deleted file]
openwrt/package/openwrt/include/wlioctl.h [deleted file]
openwrt/package/openwrt/include/wlutils.h [deleted file]
openwrt/package/openwrt/jffs2root.c [deleted file]
openwrt/package/openwrt/libnvram/Makefile [deleted file]
openwrt/package/openwrt/libnvram/main.c [deleted file]
openwrt/package/openwrt/libnvram/nvram_convert.c [deleted file]
openwrt/package/openwrt/libnvram/nvram_convert.h [deleted file]
openwrt/package/openwrt/libnvram/nvram_linux.c [deleted file]
openwrt/package/openwrt/libshared/Makefile [deleted file]
openwrt/package/openwrt/libshared/bcmtimer.h [deleted file]
openwrt/package/openwrt/libshared/defaults.c [deleted file]
openwrt/package/openwrt/libshared/linux_timer.c [deleted file]
openwrt/package/openwrt/libshared/shutils.c [deleted file]
openwrt/package/openwrt/libshared/wl.c [deleted file]
openwrt/package/openwrt/libshared/wl_linux.c [deleted file]
openwrt/package/openwrt/mtd.c [deleted file]
openwrt/package/openwrt/openwrt-utils.control [deleted file]
openwrt/package/openwrt/wlc.c [deleted file]
openwrt/package/osiris/Config.in
openwrt/package/osiris/patches/install-non-interactive.patch [deleted file]
openwrt/package/portmap/Makefile
openwrt/package/portmap/files/portmap.init [new file with mode: 0644]
openwrt/package/postgresql/ipkg/pgsql-cli.control
openwrt/package/ppp/Makefile
openwrt/package/ppp/files/ifup.pppoe [new file with mode: 0644]
openwrt/package/ppp/files/pppoe.init [deleted file]
openwrt/package/ppp/patches/100-debian_close_dev_ppp.patch [new file with mode: 0644]
openwrt/package/ppp/patches/101-debian_ip-up_option.patch [new file with mode: 0644]
openwrt/package/ppp/patches/102-debian_pppoe_multicast_pado.patch [new file with mode: 0644]
openwrt/package/ppp/patches/103-debian_pppoe_cleanup.patch [new file with mode: 0644]
openwrt/package/ppp/patches/104-debian_fix_linkpidfile.patch [new file with mode: 0644]
openwrt/package/ppp/patches/105-debian_pppoatm_cleanup.patch [new file with mode: 0644]
openwrt/package/ppp/patches/106-debian_pppoatm_fix_mtu.patch [new file with mode: 0644]
openwrt/package/ppp/patches/107-debian_stripMSdomain.patch [new file with mode: 0644]
openwrt/package/ppp/patches/108-debian_defaultroute.patch [new file with mode: 0644]
openwrt/package/ppp/patches/109-debian_demand.patch [new file with mode: 0644]
openwrt/package/ppp/patches/200-makefile.patch [new file with mode: 0644]
openwrt/package/ppp/patches/201-mppe_mppc_1.1.patch [new file with mode: 0644]
openwrt/package/ppp/patches/202-no_atm.patch [new file with mode: 0644]
openwrt/package/ppp/patches/203-no_strip.patch [new file with mode: 0644]
openwrt/package/ppp/patches/204-opt_flags.patch [new file with mode: 0644]
openwrt/package/ppp/patches/205-pppoe_iface_name.patch [new file with mode: 0644]
openwrt/package/ppp/patches/206-radius_config.patch [new file with mode: 0644]
openwrt/package/ppp/patches/207-ppp_reconnect.patch [new file with mode: 0644]
openwrt/package/ppp/patches/208-no_exponential_timeout.patch [new file with mode: 0644]
openwrt/package/ppp/patches/ppp-2.4.3-makefile.patch [deleted file]
openwrt/package/ppp/patches/ppp-2.4.3-mppe-mppc-1.1.patch [deleted file]
openwrt/package/ppp/patches/ppp-2.4.3-no-atm.patch [deleted file]
openwrt/package/ppp/patches/ppp-2.4.3-no-strip.patch [deleted file]
openwrt/package/ppp/patches/ppp-2.4.3-opt-flags.patch [deleted file]
openwrt/package/ppp/patches/ppp-2.4.3-pppoe-iface-name.patch [deleted file]
openwrt/package/ppp/patches/ppp-2.4.3-radius-config.patch [deleted file]
openwrt/package/pptp/Makefile
openwrt/package/pptp/files/ifup.pptp [new file with mode: 0644]
openwrt/package/pptp/files/options.pptp
openwrt/package/pptp/files/pptp.init [deleted file]
openwrt/package/quagga/Config.in
openwrt/package/quagga/Makefile
openwrt/package/quagga/files/quagga.init [new file with mode: 0644]
openwrt/package/quagga/ipkg/quagga-bgpd.control
openwrt/package/quagga/ipkg/quagga-ospf6d.control
openwrt/package/quagga/ipkg/quagga-ospfd.control
openwrt/package/quagga/ipkg/quagga-ripd.control
openwrt/package/quagga/ipkg/quagga-ripngd.control
openwrt/package/quagga/ipkg/quagga-vtysh.control [new file with mode: 0644]
openwrt/package/quagga/ipkg/quagga-zebra.control [deleted file]
openwrt/package/quagga/patches/quagga-cross.patch
openwrt/package/quagga/patches/quagga-readline.patch [new file with mode: 0644]
openwrt/package/rsync/Config.in
openwrt/package/rules.mk
openwrt/package/ser/Makefile
openwrt/package/sqlite/ipkg/sqlite-cli.control
openwrt/package/uclibc++/Config.in
openwrt/package/uclibc++/Makefile
openwrt/package/uclibc++/ipkg/uclibc++.control [new file with mode: 0644]
openwrt/package/uclibc++/uClibc++.control [deleted file]
openwrt/package/uclibc++/uclibc++.config
openwrt/package/vtun/Config.in
openwrt/package/vtun/Makefile
openwrt/package/vtun/ipkg/vtun.control
openwrt/package/wificonf/Makefile
openwrt/package/wificonf/wificonf.c
openwrt/package/wpa_supplicant/ipkg/wpa-supplicant.control
openwrt/package/xinetd/Makefile
openwrt/package/zlib/Makefile
openwrt/package/zlib/patches/zlib-1.2.2-CAN-2005-2096.patch [new file with mode: 0644]
openwrt/scripts/download.pl
openwrt/scripts/ipkg
openwrt/target/Makefile
openwrt/target/default/target_skeleton/bin/firstboot [deleted file]
openwrt/target/default/target_skeleton/bin/ipkg [deleted file]
openwrt/target/default/target_skeleton/bin/login [deleted file]
openwrt/target/default/target_skeleton/etc/banner [deleted file]
openwrt/target/default/target_skeleton/etc/dnsmasq.conf [deleted file]
openwrt/target/default/target_skeleton/etc/functions.sh [deleted file]
openwrt/target/default/target_skeleton/etc/group [deleted file]
openwrt/target/default/target_skeleton/etc/hosts [deleted file]
openwrt/target/default/target_skeleton/etc/init.d/S10boot [deleted file]
openwrt/target/default/target_skeleton/etc/init.d/S40network [deleted file]
openwrt/target/default/target_skeleton/etc/init.d/S45firewall [deleted file]
openwrt/target/default/target_skeleton/etc/init.d/S50dnsmasq [deleted file]
openwrt/target/default/target_skeleton/etc/init.d/S50httpd [deleted file]
openwrt/target/default/target_skeleton/etc/init.d/S50telnet [deleted file]
openwrt/target/default/target_skeleton/etc/init.d/S99done [deleted file]
openwrt/target/default/target_skeleton/etc/init.d/rcS [deleted file]
openwrt/target/default/target_skeleton/etc/inittab [deleted file]
openwrt/target/default/target_skeleton/etc/ipkg.conf [deleted file]
openwrt/target/default/target_skeleton/etc/modules [deleted file]
openwrt/target/default/target_skeleton/etc/nvram.overrides [deleted file]
openwrt/target/default/target_skeleton/etc/passwd [deleted file]
openwrt/target/default/target_skeleton/etc/preinit [deleted file]
openwrt/target/default/target_skeleton/etc/profile [deleted file]
openwrt/target/default/target_skeleton/etc/protocols [deleted file]
openwrt/target/default/target_skeleton/etc/shells [deleted file]
openwrt/target/default/target_skeleton/etc/sysctl.conf [deleted file]
openwrt/target/default/target_skeleton/rom/note [deleted file]
openwrt/target/default/target_skeleton/sbin/backup [deleted file]
openwrt/target/default/target_skeleton/sbin/halt [deleted file]
openwrt/target/default/target_skeleton/sbin/hotplug [deleted file]
openwrt/target/default/target_skeleton/sbin/ifdown [deleted file]
openwrt/target/default/target_skeleton/sbin/ifup [deleted file]
openwrt/target/default/target_skeleton/sbin/mount_root [deleted file]
openwrt/target/default/target_skeleton/sbin/restore [deleted file]
openwrt/target/default/target_skeleton/usr/share/udhcpc/default.script [deleted file]
openwrt/target/default/target_skeleton/www/index.html [deleted file]
openwrt/target/linux/Config.in
openwrt/target/linux/Makefile
openwrt/target/linux/control/kmod-pwc.control [new file with mode: 0644]
openwrt/target/linux/control/kmod-videodev.control [new file with mode: 0644]
openwrt/target/linux/image/Makefile
openwrt/target/linux/image/brcm/Makefile
openwrt/target/linux/image/jffs2.mk
openwrt/target/linux/image/jffs2/Makefile
openwrt/target/linux/image/jffs2/patches/gcc4-fix.patch [new file with mode: 0644]
openwrt/target/linux/image/squashfs.mk
openwrt/target/linux/imagebuilder/Makefile [new file with mode: 0644]
openwrt/target/linux/imagebuilder/lists/default.brcm-2.4 [new file with mode: 0644]
openwrt/target/linux/imagebuilder/lists/micro.brcm-2.4 [new file with mode: 0644]
openwrt/target/linux/imagebuilder/lists/pptp.brcm-2.4 [new file with mode: 0644]
openwrt/target/linux/linux-2.4/Makefile
openwrt/target/linux/linux-2.4/broadcom.mk
openwrt/target/linux/linux-2.4/config/brcm
openwrt/target/linux/linux-2.4/patches/brcm/001-bcm47xx.patch
openwrt/target/linux/linux-2.4/patches/brcm/003-bcm47xx_cache_fixes.patch [new file with mode: 0644]
openwrt/target/linux/linux-2.4/patches/brcm/003-bcm47xx_workarounds.patch [deleted file]
openwrt/target/linux/linux-2.4/patches/brcm/004-bcm94710_mmu.patch [deleted file]
openwrt/target/linux/linux-2.4/patches/brcm/004-ide_workaround.patch [new file with mode: 0644]
openwrt/target/linux/linux-2.4/patches/brcm/005-diag_led.patch [new file with mode: 0644]
openwrt/target/linux/linux-2.4/patches/generic/100-ebtables.patch [deleted file]
openwrt/target/linux/linux-2.4/patches/generic/111-bridging_performance.patch [new file with mode: 0644]
openwrt/target/linux/linux-2.4/patches/generic/112-netfilter_connmark.patch [new file with mode: 0644]
openwrt/target/linux/linux-2.4/patches/generic/208-usb2_fix.patch [new file with mode: 0644]
openwrt/target/linux/linux-2.4/patches/generic/209-mkdep_fix.patch [new file with mode: 0644]
openwrt/target/linux/package/Config.in
openwrt/target/linux/package/Makefile
openwrt/target/linux/package/fuse/Makefile
openwrt/target/linux/package/madwifi/Config.in [new file with mode: 0644]
openwrt/target/linux/package/madwifi/Makefile [new file with mode: 0644]
openwrt/target/linux/package/madwifi/files/madwifi.init [new file with mode: 0644]
openwrt/target/linux/package/madwifi/files/madwifi.modules [new file with mode: 0644]
openwrt/target/linux/package/madwifi/ipkg/kmod-madwifi.control [new file with mode: 0644]
openwrt/target/linux/package/madwifi/patches/100-kernel_cflags.patch [new file with mode: 0644]
openwrt/target/linux/package/openwrt/Makefile [new file with mode: 0644]
openwrt/target/linux/package/openwrt/include/bcmnvram.h [new file with mode: 0644]
openwrt/target/linux/package/openwrt/include/bcmutils.h [new file with mode: 0644]
openwrt/target/linux/package/openwrt/include/cy_conf.h [new file with mode: 0644]
openwrt/target/linux/package/openwrt/include/epivers.h [new file with mode: 0644]
openwrt/target/linux/package/openwrt/include/proto/802.11.h [new file with mode: 0644]
openwrt/target/linux/package/openwrt/include/proto/ethernet.h [new file with mode: 0644]
openwrt/target/linux/package/openwrt/include/shutils.h [new file with mode: 0644]
openwrt/target/linux/package/openwrt/include/typedefs.h [new file with mode: 0644]
openwrt/target/linux/package/openwrt/include/utils.h [new file with mode: 0644]
openwrt/target/linux/package/openwrt/include/wlcompat.h [new file with mode: 0644]
openwrt/target/linux/package/openwrt/include/wlioctl.h [new file with mode: 0644]
openwrt/target/linux/package/openwrt/include/wlutils.h [new file with mode: 0644]
openwrt/target/linux/package/openwrt/ipkg/base-files-arch.control [new file with mode: 0644]
openwrt/target/linux/package/openwrt/jffs2root.c [new file with mode: 0644]
openwrt/target/linux/package/wlcompat/Config.in
openwrt/target/linux/package/wlcompat/Makefile
openwrt/target/linux/package/wlcompat/ipkg/kmod-wlcompat-debug.control [new file with mode: 0644]
openwrt/target/linux/package/wlcompat/wlcompat.c
openwrt/target/linux/rules.mk
openwrt/target/utils/Makefile
openwrt/target/utils/src/addpattern.c
openwrt/target/utils/src/trx.c
openwrt/toolchain/Config.in
openwrt/toolchain/Config.in.devel
openwrt/toolchain/Makefile
openwrt/toolchain/binutils/2.14.90.0.8/001-debian.patch [deleted file]
openwrt/toolchain/binutils/2.14.90.0.8/100-uclibc-conf.patch [deleted file]
openwrt/toolchain/binutils/2.14.90.0.8/600-arm-textrel.patch [deleted file]
openwrt/toolchain/binutils/2.15.90.0.1.1/100-uclibc-conf.patch [deleted file]
openwrt/toolchain/binutils/2.15.90.0.1.1/600-arm-textrel.patch [deleted file]
openwrt/toolchain/binutils/2.15.90.0.1/100-uclibc-conf.patch [deleted file]
openwrt/toolchain/binutils/2.15.90.0.1/600-arm-textrel.patch [deleted file]
openwrt/toolchain/binutils/2.15.90.0.2/100-uclibc-conf.patch [deleted file]
openwrt/toolchain/binutils/2.15.90.0.2/600-arm-textrel.patch [deleted file]
openwrt/toolchain/binutils/2.15.90.0.3/100-uclibc-conf.patch [deleted file]
openwrt/toolchain/binutils/2.15.90.0.3/500-branch-likely.patch [deleted file]
openwrt/toolchain/binutils/2.15.90.0.3/600-arm-textrel.patch [deleted file]
openwrt/toolchain/binutils/2.15.91.0.1/100-uclibc-conf.patch [deleted file]
openwrt/toolchain/binutils/2.15.91.0.1/600-arm-textrel.patch [deleted file]
openwrt/toolchain/binutils/2.15.91.0.2/100-uclibc-conf.patch [deleted file]
openwrt/toolchain/binutils/2.15.91.0.2/500-branch-likely.patch [deleted file]
openwrt/toolchain/binutils/2.15.91.0.2/600-arm-textrel.patch [deleted file]
openwrt/toolchain/binutils/2.15.91.0.2/700-binutils-20040817-linkonce.patch [deleted file]
openwrt/toolchain/binutils/2.15.91.0.2/701-binutils-dup-sections.patch [deleted file]
openwrt/toolchain/binutils/2.15.91.0.2/702-binutils-skip-comments.patch [deleted file]
openwrt/toolchain/binutils/2.15.92.0.2/100-uclibc-conf.patch [deleted file]
openwrt/toolchain/binutils/2.15.92.0.2/300-001_ld_makefile_patch.patch [deleted file]
openwrt/toolchain/binutils/2.15.92.0.2/300-006_better_file_error.patch [deleted file]
openwrt/toolchain/binutils/2.15.92.0.2/300-012_check_ldrunpath_length.patch [deleted file]
openwrt/toolchain/binutils/2.15.92.0.2/300-117_mips_symbolic_link.patch [deleted file]
openwrt/toolchain/binutils/2.15.92.0.2/300-120_mips_xgot_multigot_workaround.patch [deleted file]
openwrt/toolchain/binutils/2.15.92.0.2/600-arm-textrel.patch [deleted file]
openwrt/toolchain/binutils/2.15.92.0.2/702-binutils-skip-comments.patch [deleted file]
openwrt/toolchain/binutils/2.15.94.0.1/100-uclibc-conf.patch [deleted file]
openwrt/toolchain/binutils/2.15.94.0.1/300-001_ld_makefile_patch.patch [deleted file]
openwrt/toolchain/binutils/2.15.94.0.1/300-006_better_file_error.patch [deleted file]
openwrt/toolchain/binutils/2.15.94.0.1/300-012_check_ldrunpath_length.patch [deleted file]
openwrt/toolchain/binutils/2.15.94.0.1/300-120_mips_xgot_multigot_workaround.patch [deleted file]
openwrt/toolchain/binutils/2.15.94.0.1/702-binutils-skip-comments.patch [deleted file]
openwrt/toolchain/binutils/2.16.90.0.1/100-uclibc-conf.patch [deleted file]
openwrt/toolchain/binutils/2.16.90.0.1/300-001_ld_makefile_patch.patch [deleted file]
openwrt/toolchain/binutils/2.16.90.0.1/300-006_better_file_error.patch [deleted file]
openwrt/toolchain/binutils/2.16.90.0.1/300-012_check_ldrunpath_length.patch [deleted file]
openwrt/toolchain/binutils/2.16.90.0.1/300-120_mips_xgot_multigot_workaround.patch [deleted file]
openwrt/toolchain/binutils/2.16.90.0.1/702-binutils-skip-comments.patch [deleted file]
openwrt/toolchain/binutils/Config.in
openwrt/toolchain/binutils/Makefile
openwrt/toolchain/binutils/binutils.mk [deleted file]
openwrt/toolchain/ccache/Config.in [deleted file]
openwrt/toolchain/ccache/Config.in.2 [deleted file]
openwrt/toolchain/ccache/Makefile.in [deleted file]
openwrt/toolchain/ccache/ccache.mk [deleted file]
openwrt/toolchain/gcc/3.3.5/100-uclibc-conf.patch [deleted file]
openwrt/toolchain/gcc/3.3.5/110-uclibc-conf.patch [deleted file]
openwrt/toolchain/gcc/3.3.5/120-softfloat.patch [deleted file]
openwrt/toolchain/gcc/3.3.5/200-uclibc-locale.patch [deleted file]
openwrt/toolchain/gcc/3.3.5/500-loop.patch [deleted file]
openwrt/toolchain/gcc/3.3.5/820-no-mips-empic-relocs.patch [deleted file]
openwrt/toolchain/gcc/3.3.5/specs-arm-soft-float [deleted file]
openwrt/toolchain/gcc/3.3.5/specs-mips-soft-float [deleted file]
openwrt/toolchain/gcc/3.3.5/specs-mipsel-soft-float [deleted file]
openwrt/toolchain/gcc/3.3.5/specs-powerpc-soft-float [deleted file]
openwrt/toolchain/gcc/3.4.3/100-uclibc-conf.patch [deleted file]
openwrt/toolchain/gcc/3.4.3/200-uclibc-locale.patch [deleted file]
openwrt/toolchain/gcc/3.4.3/300-libstdc++-pic.patch [deleted file]
openwrt/toolchain/gcc/3.4.3/600-gcc34-arm-ldm-peephole.patch [deleted file]
openwrt/toolchain/gcc/3.4.3/601-gcc34-arm-ldm.patch [deleted file]
openwrt/toolchain/gcc/3.4.3/602-sdk-libstdc++-includes.patch [deleted file]
openwrt/toolchain/gcc/3.4.3/700-pr15068-fix.patch [deleted file]
openwrt/toolchain/gcc/3.4.3/800-arm-bigendian.patch [deleted file]
openwrt/toolchain/gcc/3.4.3/810-arm-bigendian-uclibc.patch [deleted file]
openwrt/toolchain/gcc/3.4.3/arm-softfloat.patch.conditional [deleted file]
openwrt/toolchain/gcc/4.0.0/100-uclibc-conf.patch [deleted file]
openwrt/toolchain/gcc/4.0.0/200-uclibc-locale.patch [deleted file]
openwrt/toolchain/gcc/Config.in
openwrt/toolchain/gcc/Makefile
openwrt/toolchain/gcc/Makefile.in [deleted file]
openwrt/toolchain/gcc/gcc-uclibc-3.x.mk [deleted file]
openwrt/toolchain/gcc/i386-gcc-soft-float.patch [deleted file]
openwrt/toolchain/ipkg-utils/1.7/ipkg-utils-1.7-ipkg_build_tar.patch [new file with mode: 0644]
openwrt/toolchain/kernel-headers/Makefile
openwrt/toolchain/kernel-headers/config.mips [new file with mode: 0644]
openwrt/toolchain/kernel-headers/kernel-headers.mk [deleted file]
openwrt/toolchain/kernel-headers/linux.config [deleted file]
openwrt/toolchain/sed/Makefile
openwrt/toolchain/sed/sed.mk [deleted file]
openwrt/toolchain/uClibc/Config.in
openwrt/toolchain/uClibc/Makefile
openwrt/toolchain/uClibc/files/config.mips [new file with mode: 0644]
openwrt/toolchain/uClibc/uClibc.config [deleted file]
openwrt/toolchain/uClibc/uClibc.config-locale [deleted file]
openwrt/toolchain/uClibc/uclibc.mk [deleted file]
root/bin/firstboot [deleted file]
root/bin/ipkg [deleted file]
root/bin/login [deleted file]
root/etc/dnsmasq.conf [deleted file]
root/etc/functions.sh [deleted file]
root/etc/init.d/S10boot [deleted file]
root/etc/init.d/S40network [deleted file]
root/etc/init.d/S45firewall [deleted file]
root/etc/init.d/S50services [deleted file]
root/etc/init.d/S99done [deleted file]
root/etc/init.d/rcS [deleted file]
root/etc/inittab [deleted file]
root/etc/ipkg.conf [deleted file]
root/etc/motd [deleted file]
root/etc/nvram.overrides [deleted file]
root/etc/preinit [deleted file]
root/etc/profile [deleted file]
root/etc/sysctl.conf [deleted file]
root/sbin/halt [deleted file]
root/sbin/hotplug [deleted file]
root/sbin/ifdown [deleted file]
root/sbin/ifup [deleted file]
root/sbin/wifi [deleted file]
root/usr/share/udhcpc/default.script [deleted file]
root/www/index.html [deleted file]

diff --git a/CVSROOT/checkoutlist b/CVSROOT/checkoutlist
deleted file mode 100644 (file)
index b04b350..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# The "checkoutlist" file is used to support additional version controlled
-# administrative files in $CVSROOT/CVSROOT, such as template files.
-#
-# The first entry on a line is a filename which will be checked out from
-# the corresponding RCS file in the $CVSROOT/CVSROOT directory.
-# The remainder of the line is an error message to use if the file cannot
-# be checked out.
-#
-# File format:
-#
-#      [<whitespace>]<filename><whitespace><error message><end-of-line>
-#
-# comment lines begin with '#'
diff --git a/CVSROOT/ciabot.pl b/CVSROOT/ciabot.pl
deleted file mode 100755 (executable)
index a4869ed..0000000
+++ /dev/null
@@ -1,327 +0,0 @@
-#!/usr/bin/perl -w
-#
-# ciabot -- Mail a CVS log message to a given address, for the purposes of CIA
-#
-# Loosely based on cvslog by Russ Allbery <rra@stanford.edu>
-# Copyright 1998  Board of Trustees, Leland Stanford Jr. University
-#
-# Copyright 2001, 2003, 2004  Petr Baudis <pasky@ucw.cz>
-#
-# This program is free software; you can redistribute it and/or modify it under
-# the terms of the GNU General Public License version 2, as published by the
-# Free Software Foundation.
-#
-# The master location of this file is
-# http://pasky.or.cz/~pasky/dev/cvs/ciabot.pl.
-#
-# This program is designed to run from the loginfo CVS administration file. It
-# takes a log message, massaging it and mailing it to the address given below.
-#
-# Its record in the loginfo file should look like:
-#
-#       ALL        $CVSROOT/CVSROOT/ciabot.pl %s $USER project from_email dest_email ignore_regexp
-#
-# Note that the last four parameters are optional, you can alternatively change
-# the defaults below in the configuration section.
-#
-# If it does not work, try to disable $xml_rpc in the configuration section
-# below.
-#
-# ciabot.pl,v 1.110 2004/01/09 17:40:13 pasky
-# $Id$
-
-use strict;
-use vars qw ($project $from_email $dest_email $rpc_uri $sendmail $sync_delay
-               $xml_rpc $ignore_regexp $alt_local_message_target);
-
-
-
-
-### Configuration
-
-# Project name (as known to CIA).
-$project = 'ELinks';
-
-# The from address in generated mails.
-$from_email = 'pasky@ucw.cz';
-
-# Mail all reports to this address.
-$dest_email = 'cia@navi.cx';
-
-# If using XML-RPC, connect to this URI.
-$rpc_uri = 'http://cia.navi.cx/RPC2';
-
-# Path to your USCD sendmail compatible binary (your mailer daemon created this
-# program somewhere).
-$sendmail = '/usr/sbin/sendmail';
-
-# Number of seconds to wait for possible concurrent instances. CVS calls up
-# this script for each involved directory separately and this is the sync
-# delay. 5s looks as a safe value, but feel free to increase if you are running
-# this on a slower (or overloaded) machine or if you have really a lot of
-# directories.
-$sync_delay = 5;
-
-# This script can communicate with CIA either by mail or by an XML-RPC
-# interface. The XML-RPC interface is faster and more efficient, however you
-# need to have RPC::XML perl module installed, and some large CVS hosting sites
-# (like Savannah or Sourceforge) might not allow outgoing HTTP connections
-# while they allow outgoing mail. Also, this script will hang and eventually
-# not deliver the event at all if CIA server happens to be down, which is
-# unfortunately not an uncommon condition.
-$xml_rpc = 0;
-
-# You can make this bot to totally ignore events concerning the objects
-# specified below. Each object is composed of <module>/<path>/<filename>,
-# therefore file Manifest in root directory of module gentoo will be called
-# "gentoo/Manifest", while file src/bfu/inphist.c of module elinks will be
-# called "elinks/src/bfu/inphist.c". Easy, isn't it?
-#
-# This variable should contain regexp, against which will each object be
-# checked, and if the regexp is matched, the file is ignored. Therefore ie.  to
-# ignore all changes in the two files above and everything concerning module
-# 'admin', use:
-#
-#$ignore_regexp = "^(gentoo/Manifest|elinks/src/bfu/inphist.c|admin/)";
-$ignore_regexp = "/Manifest\$";
-
-# It can be useful to also grab the generated XML message by some other
-# programs and ie. autogenerate some content based on it. Here you can specify
-# a file to which it will be appended.
-$alt_local_message_target = "";
-
-
-
-
-### The code itself
-
-use vars qw ($user $module $tag @files $logmsg $message);
-
-my @dir; # This array stores all the affected directories
-my @dirfiles;  # This array is mapped to the @dir array and contains files
-               # affected in each directory
-
-
-
-### Input data loading
-
-
-# These arguments are from %s; first the relative path in the repository
-# and then the list of files modified.
-
-@files = split (' ', ($ARGV[0] or ''));
-$dir[0] = shift @files or die "$0: no directory specified\n";
-$dirfiles[0] = "@files" or die "$0: no files specified\n";
-
-
-# Guess module name.
-
-$module = $dir[0]; $module =~ s#/.*##;
-
-
-# Figure out who is doing the update.
-
-$user = $ARGV[1];
-
-
-# Use the optional parameters, if supplied.
-
-$project = $ARGV[2] if $ARGV[2];
-$from_email = $ARGV[3] if $ARGV[3];
-$dest_email = $ARGV[4] if $ARGV[4];
-$ignore_regexp = $ARGV[5] if $ARGV[5];
-
-
-# Parse stdin (what's interesting is the tag and log message)
-
-while (<STDIN>) {
-  $tag = $1 if /^\s*Tag: ([a-zA-Z0-9_-]+)/;
-  last if /^Log Message/;
-}
-
-while (<STDIN>) {
-  next unless ($_ and $_ ne "\n" and $_ ne "\r\n");
-  s/&/&amp;/g;
-  s/</&lt;/g;
-  s/>/&gt;/g;
-  $logmsg .= $_;
-}
-
-
-
-### Remove to-be-ignored files
-
-$dirfiles[0] = join (' ',
-  grep {
-    my $f = "$module/$dir[0]/$_";
-    $f !~ m/$ignore_regexp/;
-  } split (/\s+/, $dirfiles[0])
-) if ($ignore_regexp);
-exit unless $dirfiles[0];
-
-
-
-### Sync between the multiple instances potentially being ran simultanously
-
-my $sum; # _VERY_ simple hash of the log message. It is really weak, but I'm
-         # lazy and it's really sorta exceptional to even get more commits
-         # running simultanously anyway.
-map { $sum += ord $_ } split(//, $logmsg);
-
-my $syncfile; # Name of the file used for syncing
-$syncfile = "/tmp/cvscia.$project.$module.$sum";
-
-
-if (-f $syncfile and -w $syncfile) {
-  # The synchronization file for this file already exists, so we are not the
-  # first ones. So let's just dump what we know and exit.
-
-  open(FF, ">>$syncfile") or die "aieee... can't log, can't log! $syncfile blocked!";
-  print FF "$dirfiles[0]!@!$dir[0]\n";
-  close(FF);
-  exit;
-
-} else {
-  # We are the first one! Thus, we'll fork, exit the original instance, and
-  # wait a bit with the new one. Then we'll grab what the others collected and
-  # go on.
-
-  # We don't need to care about permissions since all the instances of the one
-  # commit will obviously live as the same user.
-
-  # system("touch") in a different way
-  open(FF, ">>$syncfile") or die "aieee... can't log, can't log! $syncfile blocked!";
-  close(FF);
-
-  exit if (fork);
-  sleep($sync_delay);
-
-  open(FF, $syncfile);
-  my ($dirnum) = 1; # 0 is the one we got triggerred for
-  while (<FF>) {
-    chomp;
-    ($dirfiles[$dirnum], $dir[$dirnum]) = split(/!@!/);
-    $dirnum++;
-  }
-  close(FF);
-
-  unlink($syncfile);
-}
-
-
-
-### Compose the mail message
-
-
-my ($VERSION) = '$Revision$' =~ / (\d+\.\d+) /;
-my $ts = time;
-
-$message = <<EM
-<message>
-   <generator>
-       <name>CIA Perl client for CVS</name>
-       <version>$VERSION</version>
-       <url>http://pasky.or.cz/~pasky/dev/cvs/ciabot.pl</url>
-   </generator>
-   <source>
-       <project>$project</project>
-       <module>$module</module>
-EM
-;
-$message .= "       <branch>$tag</branch>" if ($tag);
-$message .= <<EM
-   </source>
-   <timestamp>
-       $ts
-   </timestamp>
-   <body>
-       <commit>
-           <author>$user</author>
-           <files>
-EM
-;
-
-for (my $dirnum = 0; $dirnum < @dir; $dirnum++) {
-  map {
-    $_ = $dir[$dirnum] . '/' . $_;
-    s#^.*?/##; # weed out the module name
-    s/&/&amp;/g;
-    s/</&lt;/g;
-    s/>/&gt;/g;
-    $message .= "  <file>$_</file>\n";
-  } split(/ /, $dirfiles[$dirnum]);
-}
-
-$message .= <<EM
-           </files>
-           <log>
-$logmsg
-           </log>
-       </commit>
-   </body>
-</message>
-EM
-;
-
-
-
-### Write the message to an alt-target
-
-if ($alt_local_message_target and open (ALT, ">>$alt_local_message_target")) {
-  print ALT $message;
-  close ALT;
-}
-
-
-
-### Send out the XML-RPC message
-
-
-if ($xml_rpc) {
-  # We gotta be careful from now on. We silence all the warnings because
-  # RPC::XML code is crappy and works with undefs etc.
-  $^W = 0;
-  $RPC::XML::ERROR if (0); # silence perl's compile-time warning
-
-  require RPC::XML;
-  require RPC::XML::Client;
-
-  my $rpc_client = new RPC::XML::Client $rpc_uri;
-  my $rpc_request = RPC::XML::request->new('hub.deliver', $message);
-  my $rpc_response = $rpc_client->send_request($rpc_request);
-
-  unless (ref $rpc_response) {
-    die "XML-RPC Error: $RPC::XML::ERROR\n";
-  }
-  exit;
-}
-
-
-
-### Send out the mail
-
-
-# Open our mail program
-
-open (MAIL, "| $sendmail -t -oi -oem") or die "Cannot execute $sendmail : " . ($?>>8);
-
-
-# The mail header
-
-print MAIL <<EOM;
-From: $from_email
-To: $dest_email
-Content-type: text/xml
-Subject: DeliverXML
-
-EOM
-
-print MAIL $message;
-
-
-# Close the mail
-
-close MAIL;
-die "$0: sendmail exit status " . ($? >> 8) . "\n" unless ($? == 0);
-
-# vi: set sw=2:
diff --git a/CVSROOT/commitinfo b/CVSROOT/commitinfo
deleted file mode 100644 (file)
index b19e7b7..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-# The "commitinfo" file is used to control pre-commit checks.
-# The filter on the right is invoked with the repository and a list 
-# of files to check.  A non-zero exit of the filter program will 
-# cause the commit to be aborted.
-#
-# The first entry on a line is a regular expression which is tested
-# against the directory that the change is being committed to, relative
-# to the $CVSROOT.  For the first match that is found, then the remainder
-# of the line is the name of the filter to run.
-#
-# If the repository name does not match any of the regular expressions in this
-# file, the "DEFAULT" line is used, if it is specified.
-#
-# If the name "ALL" appears as a regular expression it is always used
-# in addition to the first matching regex or "DEFAULT".
diff --git a/CVSROOT/config b/CVSROOT/config
deleted file mode 100644 (file)
index ff43ec0..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# Set this to "no" if pserver shouldn't check system users/passwords
-#SystemAuth=no
-
-# Put CVS lock files in this directory rather than directly in the repository.
-#LockDir=/var/lock/cvs
-
-# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top
-# level of the new working directory when using the `cvs checkout'
-# command.
-#TopLevelAdmin=no
-
-# Set `LogHistory' to `all' or `TOFEWGCMAR' to log all transactions to the
-# history file, or a subset as needed (ie `TMAR' logs all write operations)
-#LogHistory=TOFEWGCMAR
diff --git a/CVSROOT/cvswrappers b/CVSROOT/cvswrappers
deleted file mode 100644 (file)
index 0accaf1..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-# This file affects handling of files based on their names.
-#
-# The -t/-f options allow one to treat directories of files
-# as a single file, or to transform a file in other ways on
-# its way in and out of CVS.
-#
-# The -m option specifies whether CVS attempts to merge files.
-#
-# The -k option specifies keyword expansion (e.g. -kb for binary).
-#
-# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)
-#
-#  wildcard    [option value][option value]...
-#
-#  where option is one of
-#  -f          from cvs filter         value: path to filter
-#  -t          to cvs filter           value: path to filter
-#  -m          update methodology      value: MERGE or COPY
-#  -k          expansion mode          value: b, o, kkv, &c
-#
-#  and value is a single-quote delimited value.
-# For example:
-#*.gif -k 'b'
diff --git a/CVSROOT/editinfo b/CVSROOT/editinfo
deleted file mode 100644 (file)
index d78886c..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-# The "editinfo" file is used to allow verification of logging
-# information.  It works best when a template (as specified in the
-# rcsinfo file) is provided for the logging procedure.  Given a
-# template with locations for, a bug-id number, a list of people who
-# reviewed the code before it can be checked in, and an external
-# process to catalog the differences that were code reviewed, the
-# following test can be applied to the code:
-#
-#   Making sure that the entered bug-id number is correct.
-#   Validating that the code that was reviewed is indeed the code being
-#       checked in (using the bug-id number or a seperate review
-#       number to identify this particular code set.).
-#
-# If any of the above test failed, then the commit would be aborted.
-#
-# Actions such as mailing a copy of the report to each reviewer are
-# better handled by an entry in the loginfo file.
-#
-# One thing that should be noted is the the ALL keyword is not
-# supported.  There can be only one entry that matches a given
-# repository.
diff --git a/CVSROOT/loginfo b/CVSROOT/loginfo
deleted file mode 100644 (file)
index c584783..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# The "loginfo" file controls where "cvs commit" log information
-# is sent.  The first entry on a line is a regular expression which must match
-# the directory that the change is being made to, relative to the
-# $CVSROOT.  If a match is found, then the remainder of the line is a filter
-# program that should expect log information on its standard input.
-#
-# If the repository name does not match any of the regular expressions in this
-# file, the "DEFAULT" line is used, if it is specified.
-#
-# If the name ALL appears as a regular expression it is always used
-# in addition to the first matching regex or DEFAULT.
-#
-# You may specify a format string as part of the
-# filter.  The string is composed of a `%' followed
-# by a single format character, or followed by a set of format
-# characters surrounded by `{' and `}' as separators.  The format
-# characters are:
-#
-#   s = file name
-#   V = old version number (pre-checkin)
-#   v = new version number (post-checkin)
-#
-# For example:
-#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog
-# or
-#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
-
-#^buildroot     ( $CVSROOT/CVSROOT/ciabot.pl %s $USER openwrt cvs-commits@openwrt.ksilebo.net cia@navi.cx )
-#^root ( $CVSROOT/CVSROOT/ciabot.pl %s $USER openwrt cvs-commits@openwrt.ksilebo.net cia@navi.cx )
diff --git a/CVSROOT/modules b/CVSROOT/modules
deleted file mode 100644 (file)
index cb9e9ef..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-# Three different line formats are valid:
-#      key     -a    aliases...
-#      key [options] directory
-#      key [options] directory files...
-#
-# Where "options" are composed of:
-#      -i prog         Run "prog" on "cvs commit" from top-level of module.
-#      -o prog         Run "prog" on "cvs checkout" of module.
-#      -e prog         Run "prog" on "cvs export" of module.
-#      -t prog         Run "prog" on "cvs rtag" of module.
-#      -u prog         Run "prog" on "cvs update" of module.
-#      -d dir          Place module in directory "dir" instead of module name.
-#      -l              Top-level directory only -- do not recurse.
-#
-# NOTE:  If you change any of the "Run" options above, you'll have to
-# release and re-checkout any working directories of these modules.
-#
-# And "directory" is a path to a directory relative to $CVSROOT.
-#
-# The "-a" option specifies an alias.  An alias is interpreted as if
-# everything on the right of the "-a" had been typed on the command line.
-#
-# You can encode a module within a module by using the special '&'
-# character to interpose another module into the current module.  This
-# can be useful for creating a module that consists of many directories
-# spread out over the entire source repository.
diff --git a/CVSROOT/notify b/CVSROOT/notify
deleted file mode 100644 (file)
index 34f0bc2..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-# The "notify" file controls where notifications from watches set by
-# "cvs watch add" or "cvs edit" are sent.  The first entry on a line is
-# a regular expression which is tested against the directory that the
-# change is being made to, relative to the $CVSROOT.  If it matches,
-# then the remainder of the line is a filter program that should contain
-# one occurrence of %s for the user to notify, and information on its
-# standard input.
-#
-# "ALL" or "DEFAULT" can be used in place of the regular expression.
-#
-# For example:
-#ALL mail %s -s "CVS notification"
diff --git a/CVSROOT/rcsinfo b/CVSROOT/rcsinfo
deleted file mode 100644 (file)
index 49e59f4..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# The "rcsinfo" file is used to control templates with which the editor
-# is invoked on commit and import.
-#
-# The first entry on a line is a regular expression which is tested
-# against the directory that the change is being made to, relative to the
-# $CVSROOT.  For the first match that is found, then the remainder of the
-# line is the name of the file that contains the template.
-#
-# If the repository name does not match any of the regular expressions in this
-# file, the "DEFAULT" line is used, if it is specified.
-#
-# If the name "ALL" appears as a regular expression it is always used
-# in addition to the first matching regex or "DEFAULT".
diff --git a/CVSROOT/taginfo b/CVSROOT/taginfo
deleted file mode 100644 (file)
index 274a46d..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-# The "taginfo" file is used to control pre-tag checks.
-# The filter on the right is invoked with the following arguments:
-#
-# $1 -- tagname
-# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d
-# $3 -- repository
-# $4->  file revision [file revision ...]
-#
-# A non-zero exit of the filter program will cause the tag to be aborted.
-#
-# The first entry on a line is a regular expression which is tested
-# against the directory that the change is being committed to, relative
-# to the $CVSROOT.  For the first match that is found, then the remainder
-# of the line is the name of the filter to run.
-#
-# If the repository name does not match any of the regular expressions in this
-# file, the "DEFAULT" line is used, if it is specified.
-#
-# If the name "ALL" appears as a regular expression it is always used
-# in addition to the first matching regex or "DEFAULT".
diff --git a/CVSROOT/verifymsg b/CVSROOT/verifymsg
deleted file mode 100644 (file)
index 86f747c..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-# The "verifymsg" file is used to allow verification of logging
-# information.  It works best when a template (as specified in the
-# rcsinfo file) is provided for the logging procedure.  Given a
-# template with locations for, a bug-id number, a list of people who
-# reviewed the code before it can be checked in, and an external
-# process to catalog the differences that were code reviewed, the
-# following test can be applied to the code:
-#
-#   Making sure that the entered bug-id number is correct.
-#   Validating that the code that was reviewed is indeed the code being
-#       checked in (using the bug-id number or a seperate review
-#       number to identify this particular code set.).
-#
-# If any of the above test failed, then the commit would be aborted.
-#
-# Actions such as mailing a copy of the report to each reviewer are
-# better handled by an entry in the loginfo file.
-#
-# One thing that should be noted is the the ALL keyword is not
-# supported.  There can be only one entry that matches a given
-# repository.
diff --git a/obsolete-buildroot/.cvsignore b/obsolete-buildroot/.cvsignore
deleted file mode 100644 (file)
index 08611a0..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-UMlinux
-root_fs*
-build_*
-toolchain_build_*
diff --git a/obsolete-buildroot/Makefile b/obsolete-buildroot/Makefile
deleted file mode 100644 (file)
index 45c1e85..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-# Makefile for a simple busybox/uClibc root filesystem
-#
-# Copyright (C) 2001-2004 Erik Andersen <andersen@codepoet.org>
-# Copyright (C) 2002 by Tim Riker <Tim@Rikers.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Library General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-
-
-#############################################################
-#
-# EDIT this stuff to suit your system and preferences
-#
-# Use := when possible to get precomputation, thereby
-# speeding up the build process.
-#
-#############################################################
-
-SNAPSHOT:=20050101
-
-ARCH:=mipsel
-#USE_UCLIBC_SNAPSHOT:=$(SNAPSHOT)
-USE_UCLIBC_LDSO_0_9_24:=false
-#USE_BUSYBOX_SNAPSHOT:=$(SNAPSHOT)
-USE_NETFILTER_SNAPSHOT:=20041009
-USE_BRIDGE_VERSION:=1.0.4
-BUILD_WITH_LARGEFILE:=true
-
-OPTIMIZE_FOR_CPU=$(ARCH)
-
-# Command used to download source code
-WGET:=wget --passive-ftp
-
-# Soft floating point options.
-# Notes:
-#   Currently builds with gcc 3.3 for arm, mips, mipsel, powerpc.
-#   (i386 support will be added back in at some point.)
-#   Only tested with multilib enabled.
-#   For i386, long double is the same as double (64 bits).  While this
-#      is unusual for x86, it seemed the best approach considering the
-#      limitations in the gcc floating point emulation library.
-#   For arm, soft float uses the usual libfloat routines.
-#   Custom specs files are used to set the default gcc mode to soft float
-#      as a convenience, since you shouldn't link hard and soft float
-#      together.  In fact, arm won't even let you.
-# (Un)comment the appropriate line below.
-#SOFT_FLOAT:=true
-SOFT_FLOAT:=false
-
-TARGET_OPTIMIZATION=-Os -mips2
-TARGET_DEBUGGING= #-g
-
-# Currently the unwind stuff seems to work for staticly linked apps but
-# not dynamic.  So use setjmp/longjmp exceptions by default.
-# GCC_USE_SJLJ_EXCEPTIONS:=--enable-sjlj-exceptions
-GCC_USE_SJLJ_EXCEPTIONS:=
-
-# Any additional gcc options you may want to include....
-EXTRA_GCC_CONFIG_OPTIONS:=
-
-# Enable the following if you want locale/gettext/i18n support.
-# NOTE!  Currently the pregnerated locale stuff only works for x86!
-#ENABLE_LOCALE:=true
-ENABLE_LOCALE:=false
-
-# If you want multilib enabled, enable this...
-MULTILIB:=--enable-multilib
-
-# Build/install c++ compiler and libstdc++?
-#INSTALL_LIBSTDCPP:=true
-INSTALL_LIBSTDCPP:=false
-
-# Build/install java compiler and libgcj? (requires c++)
-# WARNING!!! DOES NOT BUILD FOR TARGET WITHOUT INTERVENTION!!!  mjn3
-#INSTALL_LIBGCJ:=true
-INSTALL_LIBGCJ:=false
-
-# For SMP machines some stuff can be run in parallel
-#JLEVEL=-j3
-
-#############################################################
-#
-# The list of stuff to build for the target filesystem
-#
-#############################################################
-TARGETS:=host-sed openwrt-code.bin
-
-PACKAGES:=oidentd iproute2 kmod-sched wshaper zlib openssl openssh pppoecd dropbear chillispot dhcp-fwd ip6tables kmod-ipt6 kmod-ipv6 kmod-nfs kmod-ppp-async kmod-ppp-mppe-mppc ppp pppoecd pptp-server kmod-tun fprobe libpcap libpthread pptp-client vsftpd matrixssl ntpclient radvd strace
-
-#############################################################
-#
-# You should probably leave this stuff alone unless you know
-# what you are doing.
-#
-#############################################################
-
-ifeq ($(SOFT_FLOAT),true)
-SOFT_FLOAT_CONFIG_OPTION:=--without-float
-TARGET_SOFT_FLOAT:=-msoft-float
-ARCH_FPU_SUFFIX:=_nofpu
-else
-SOFT_FLOAT_CONFIG_OPTION:=
-TARGET_SOFT_FLOAT:=
-ARCH_FPU_SUFFIX:=
-endif
-
-ifeq ($(INSTALL_LIBGCJ),true)
-INSTALL_LIBSTDCPP:=true
-endif
-
-# WARNING -- uClibc currently disables large file support on cris.
-ifeq ("$(strip $(ARCH))","cris")
-BUILD_WITH_LARGEFILE:=false
-endif
-
-ifneq ($(BUILD_WITH_LARGEFILE),true)
-DISABLE_LARGEFILE= --disable-largefile
-endif
-TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING)
-
-HOSTCC:=gcc
-BASE_DIR:=${shell pwd}
-SOURCE_DIR:=$(BASE_DIR)/sources
-DL_DIR:=$(SOURCE_DIR)/dl
-PATCH_DIR=$(SOURCE_DIR)/patches
-BUILD_DIR:=$(BASE_DIR)/build_$(ARCH)$(ARCH_FPU_SUFFIX)
-TARGET_DIR:=$(BUILD_DIR)/root
-STAGING_DIR=$(BUILD_DIR)/staging_dir
-TOOL_BUILD_DIR=$(BASE_DIR)/toolchain_build_$(ARCH)$(ARCH_FPU_SUFFIX)
-TARGET_PATH=$(STAGING_DIR)/bin:/bin:/sbin:/usr/bin:/usr/sbin
-IMAGE:=$(BASE_DIR)/root_fs_$(ARCH)$(ARCH_FPU_SUFFIX)
-REAL_GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-linux-uclibc
-GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-linux
-KERNEL_CROSS=$(STAGING_DIR)/bin/$(OPTIMIZE_FOR_CPU)-linux-uclibc-
-TARGET_CROSS=$(STAGING_DIR)/bin/$(OPTIMIZE_FOR_CPU)-linux-uclibc-
-TARGET_CC=$(TARGET_CROSS)gcc
-#STRIP=$(TARGET_CROSS)strip --remove-section=.comment --remove-section=.note --strip-unneeded
-STRIP=$(STAGING_DIR)/bin/sstrip
-
-HOST_ARCH:=$(shell $(HOSTCC) -dumpmachine | sed -e s'/-.*//' \
-       -e 's/sparc.*/sparc/' \
-       -e 's/arm.*/arm/g' \
-       -e 's/m68k.*/m68k/' \
-       -e 's/ppc/powerpc/g' \
-       -e 's/v850.*/v850/g' \
-       -e 's/sh[234]/sh/' \
-       -e 's/mips-.*/mips/' \
-       -e 's/mipsel-.*/mipsel/' \
-       -e 's/cris.*/cris/' \
-       -e 's/i[3-9]86/i386/' \
-       )
-GNU_HOST_NAME:=$(HOST_ARCH)-pc-linux-gnu
-TARGET_CONFIGURE_OPTS=PATH=$(TARGET_PATH) \
-               AR=$(TARGET_CROSS)ar \
-               AS=$(TARGET_CROSS)as \
-               LD=$(TARGET_CROSS)ld \
-               NM=$(TARGET_CROSS)nm \
-               CC=$(TARGET_CROSS)gcc \
-               GCC=$(TARGET_CROSS)gcc \
-               CXX=$(TARGET_CROSS)g++ \
-               RANLIB=$(TARGET_CROSS)ranlib
-
-ifeq ($(ENABLE_LOCALE),true)
-DISABLE_NLS:=
-else
-DISABLE_NLS:=--disable-nls
-endif
-
-all:   world
-
-TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
-TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS))
-TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS))
-
-
-PACKAGES_IPK:=$(patsubst %,%-ipk,$(PACKAGES))
-OPENWRT_IPK_DIR=$(SOURCE_DIR)/openwrt/ipkg
-
-world: $(DL_DIR) $(TARGETS_SOURCE) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) $(TARGETS)
-       @echo "ALL DONE."
-
-packages: ipkg-utils $(PACKAGES_IPK)
-       -@mkdir -p $(BASE_DIR)/packages
-       { \
-               cd $(BASE_DIR)/packages; \
-               mv $(BUILD_DIR)/*.ipk .; \
-               $(IPKG_MAKE_INDEX) . > Packages; \
-       }
-       @echo "ALL DONE."
-
-.PHONY: all world clean dirclean distclean source $(TARGETS) \
-       $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE)
-
-include make/*.mk
-
-#############################################################
-#
-# staging and target directories do NOT list these as
-# dependancies anywhere else
-#
-#############################################################
-$(DL_DIR):
-       mkdir $(DL_DIR)
-
-$(BUILD_DIR):
-       mkdir $(BUILD_DIR)
-
-$(STAGING_DIR):
-       rm -rf $(STAGING_DIR)
-       mkdir -p $(STAGING_DIR)/lib
-       mkdir -p $(STAGING_DIR)/usr
-       ln -fs $(REAL_GNU_TARGET_NAME)/include $(STAGING_DIR)/include
-       ln -fs ../lib $(STAGING_DIR)/usr/lib
-       ln -fs ../$(REAL_GNU_TARGET_NAME)/include $(STAGING_DIR)/usr/include
-
-
-$(TARGET_DIR):
-       rm -rf $(TARGET_DIR)
-       cp -a $(SOURCE_DIR)/openwrt/root/ $(TARGET_DIR)
-       -find $(TARGET_DIR) -type d -name CVS -exec rm -rf {} \; > /dev/null 2>&1
-
-source: $(TARGETS_SOURCE)
-
-#############################################################
-#
-# Cleanup and misc junk
-#
-#############################################################
-clean:
-       rm -rf $(TOOL_BUILD_DIR) $(BUILD_DIR) $(IMAGE) \
-               $(BASE_DIR)/packages \
-               openwrt-linux.trx openwrt-g-code.bin openwrt-gs-code.bin \
-               openwrt-kmodules.tar.bz2
-
-dirclean: $(TARGETS_DIRCLEAN)
-       rm -rf $(TARGET_DIR) $(STAGING_DIR) $(IMAGE) \
-               $(BASE_DIR)/packages \
-               openwrt-linux.trx openwrt-g-code.bin openwrt-gs-code.bin \
-               openwrt-kmodules.tar.bz2
-
-distclean:
-       rm -rf $(DL_DIR) $(BUILD_DIR) $(LINUX_KERNEL) $(IMAGE) \
-               openwrt-linux.trx openwrt-g-code.bin openwrt-gs-code.bin \
-               openwrt-kmodules.tar.bz2
-
-sourceball: 
-       rm -rf $(BUILD_DIR)
-       set -e; \
-       cd ..; \
-       rm -f buildroot.tar.bz2; \
-       tar -cvf buildroot.tar buildroot; \
-       bzip2 -9 buildroot.tar; \
diff --git a/obsolete-buildroot/README b/obsolete-buildroot/README
deleted file mode 100644 (file)
index e602646..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-This is a modified uClibc buildroot, customized to build OpenWRT.
-
-If you already have the linksys tarball (check make/openwrt.mk for the
-version used), then move/copy/symlink it into sources/dl.  At the
-moment (2004/03/05) I'm using wrt54gv2.2.02.2.tgz.
-
-Simply running 'make' will build openwrt-code.bin and a tarball of
-the kernel modules.  Customizations of the kernel, uClibc, and busybox
-are possible by modifying the appropriate config files in source.
-Copies of the stock openwrt Makefile, uClibc.config, busybox.config,
-are included with a '-openwrt' suffix.
-
-Remember that different configurations of uClibc may not be binary
-compatible.  Also, uClibc is not necessarily binary compatible between
-versions.  In particular, dynamicly linked applications and libraries
-built with the linksys/broadcom toolchain are NOT binary compatible
-with current uClibc.
-
-Manuel Novoa III
-mjn3@codepoet.org
-
-
-2004/03/16  Added patch to support boardtype of bcm94710ap.
-            Updated resetmon patch as per mbm.
-           Set busybox and uClibc snapshots to known good versions.
-
-2004/03/30  Switch to wrt54gs.2.07.1.tgz as the base tarball.
-            Start grabbing the (updated) root skeleton from openwrt cvs.
-            Add busybox applets: passwd and nameif.
-            Update snapshots of buildroot, uClibc, and busybox.
-            Fix broken /var symlink.
-
-2004/03/31  Replace diag_led.c with mbm's rewrite.
-            Create code.bin files for both 'G' and 'GS' units.
-            Update busybox for sed fix.
-
-2004/05/08 Add busybox applets: chown, chgrp, lsmod, sysctl
-           Remove: ipaddr, iplink, iproute
-           Update snapshots of buildroot, uClibc, busybox, netfilter.
-
-.. more changes as yet undocumented ..
diff --git a/obsolete-buildroot/README.pppoe b/obsolete-buildroot/README.pppoe
deleted file mode 100644 (file)
index f5231cf..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-OPENWRT PPPOECD NOTES
-=====================
-
-1. GENERAL
-----------
-
-This package is used to estabilish basic connection to the 
-Internet via DSL/ADSL modems. This is also known as the 
-PPPoE or PPP-over-Ethernet connection.
-
-The PPPOECD program included in the OpenWrt distribution is a 
-modified version of the PPPOECD that is present in the original 
-Linksys firmware.
-
-This modified version is directly supported by the OpenWrt 
-startup scripts.
-
-2. BUILDING
------------
-
-If you have a pre-compiled PPPOECD package, skip this section.
-
-PPPOECD can be built in two ways. As an integrated part
-of the OpenWrt FLASH image or as an .ipk package that can
-be installed separately.
-
-To build PPPOECD as an embedded component, add "pppoecd" to the
-TARGETS variable in the main OpenWrt Makefile before the 
-"openwrt-bin" value.
-
-To build as a standalone package, add "pppoecd" to the
-PACKAGES variable in the main OpenWrt Makefile.
-
-3. NVRAM variables
-------------------
-
-In order for the PPPoE link to be established by the networking
-scripts the following NVRAM variables must be present:
-
-wan_ifname     Should be set to: ppp0
-
-wan_proto      Should be set to: pppoe
-
-pppoe_ifname   Set it to the WAN interface on which the PPPoE 
-               is to function. On a 2.0 or a GS model it is 
-               usually vlan1. The 1.0 and 1.1 models used vlan2.
-
-ppp_username   User name for your PPPoE connection.
-
-ppp_passwd     Password for the connection.
-
-ppp_redialperiod Time between reconnect attempts. 
-                Usualy set to 30. 
-
-ppp_idletime   Time the link has to stay dead before reconnecting. 
-               Usually set to 5.
-               
-wan_mtu                The Maxumum Transfer Unit for the PPPoE connection.
-               Typically 1492.
-
-Please consult the OpenWrt WIKI or the forum for more 
-information on NVRAM variables.
-
-
-4. STARTUP / SHUTDOWN
----------------------
-
-OpenWrt will attempt to connect using PPPOECD when starting up. 
-The script responsible for that is /etc/init.d/S40network.
-
-You can also manually start the PPPOECD by doing:
-
-  ifup wan
-
-Similarly you can shutdown the PPPOECD by doing:
-
-  ifdown wan
-
-  
-5. CONFIGURATION
-----------------
-
-PPPoE firewall configuration is the standard OpenWrt configuration
-in /etc/init.d/S45firewall that applies to all the other types
-of connections to the Internet.
-
-Additional actions can be performed when connecting or disconnecting
-by modifying "ip-up" and "ip-down" scripts in the /etc/ppp directory.
-
-When connecting, PPPOECD creates /tmp/resolv.conf file that contains
-DNS server entries as supplied by the ISP. The standard ip-up 
-script will also add a default route leading via the PPPoE link.
-
-6. DIFFERENCES FROM THE ORIGINAL PPPOECD
-----------------------------------------
-
-The main difference is the location of files. Original Linksys 
-PPPOECD operated almost exclusively in the /tmp/ppp directory. This
-however prevents any persistent configuration of the program via
-ip-up or ip-down scripts. Also the program itself was located in
-/usr/sbin whereas OpenWrt scripts expect it to be in /sbin directory.
-
-
diff --git a/obsolete-buildroot/make/MISSING.mk b/obsolete-buildroot/make/MISSING.mk
deleted file mode 100644 (file)
index b1cf83d..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-## missing variables that should be declared somewhere 
-
-LINUX_VERSION := 2.4.20
diff --git a/obsolete-buildroot/make/arptables.mk b/obsolete-buildroot/make/arptables.mk
deleted file mode 100644 (file)
index 4b9508f..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-########################################################################
-#
-# arptables
-#
-# Arptables is used to set up, maintain, and inspect the tables of ARP
-# rules in the Linux kernel. It is analogous to iptables, but operates
-# at the ARP layer rather than the IP layer."
-#
-########################################################################
-
-ARPTABLES_NAME=arptables
-ARPTABLES_VER=v0.0.3-2
-ARPTABLES_SOURCE=$(ARPTABLES_NAME)-$(ARPTABLES_VER).tar.gz
-ARPTABLES_SOURCE_URL=http://unc.dl.sourceforge.net/sourceforge/ebtables/
-ARPTABLES_BUILD_DIR=$(BUILD_DIR)/$(ARPTABLES_NAME)-$(ARPTABLES_VER)
-
-$(DL_DIR)/$(ARPTABLES_SOURCE):
-        $(WGET) -P $(DL_DIR) $(ARPTABLES_SOURCE_URL)/$(ARPTABLES_SOURCE)
-
-$(ARPTABLES_BUILD_DIR)/.unpacked: $(DL_DIR)/$(ARPTABLES_SOURCE)
-       zcat $(DL_DIR)/$(ARPTABLES_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(ARPTABLES_BUILD_DIR)/.unpacked
-
-$(ARPTABLES_BUILD_DIR)/.configured: $(ARPTABLES_BUILD_DIR)/.unpacked
-       # Allow patches.  Needed for openwrt for instance.
-       $(SOURCE_DIR)/patch-kernel.sh $(ARPTABLES_BUILD_DIR) $(SOURCE_DIR) $(ARPTABLES_NAME)-*.patch
-       touch  $(ARPTABLES_BUILD_DIR)/.configured
-
-$(ARPTABLES_BUILD_DIR)/$(ARPTABLES_NAME): $(ARPTABLES_BUILD_DIR)/.configured
-       $(TARGET_CONFIGURE_OPTS) \
-       $(MAKE) -C $(ARPTABLES_BUILD_DIR) \
-               CC=$(TARGET_CC) COPT_FLAGS="$(TARGET_CFLAGS)"
-
-$(TARGET_DIR)/sbin/$(ARPTABLES_NAME): $(ARPTABLES_BUILD_DIR)/$(ARPTABLES_NAME)
-       mkdir -p $(TARGET_DIR)/sbin/
-       cp $(ARPTABLES_BUILD_DIR)/$(ARPTABLES_NAME) $(TARGET_DIR)/sbin/$(ARPTABLES_NAME)
-       $(STRIP) $(TARGET_DIR)/sbin/$(ARPTABLES_NAME)
-
-$(ARPTABLES_NAME): $(TARGET_DIR)/sbin/$(ARPTABLES_NAME) 
-
-$(ARPTABLES_NAME)-source: $(DL_DIR)/$(ARPTABLES_SOURCE)
-
-$(ARPTABLES_NAME)-clean:
-       -$(MAKE) -C $(ARPTABLES_BUILD_DIR) clean
-
-$(ARPTABLES_NAME)-dirclean:
-       rm -rf $(ARPTABLES_BUILD_DIR)
diff --git a/obsolete-buildroot/make/autoconf.mk b/obsolete-buildroot/make/autoconf.mk
deleted file mode 100644 (file)
index 8343160..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-#############################################################
-#
-# autoconf
-#
-#############################################################
-AUTOCONF_SOURCE:=autoconf-2.57.tar.bz2
-AUTOCONF_SITE:=ftp://ftp.gnu.org/gnu/autoconf
-AUTOCONF_CAT:=bzcat
-AUTOCONF_DIR:=$(BUILD_DIR)/autoconf-2.57
-AUTOCONF_BINARY:=autoconf
-AUTOCONF_TARGET_BINARY:=usr/bin/autoconf
-
-$(DL_DIR)/$(AUTOCONF_SOURCE):
-        $(WGET) -P $(DL_DIR) $(AUTOCONF_SITE)/$(AUTOCONF_SOURCE)
-
-autoconf-source: $(DL_DIR)/$(AUTOCONF_SOURCE)
-
-$(AUTOCONF_DIR)/.unpacked: $(DL_DIR)/$(AUTOCONF_SOURCE)
-       $(AUTOCONF_CAT) $(DL_DIR)/$(AUTOCONF_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(AUTOCONF_DIR)/.unpacked
-
-$(AUTOCONF_DIR)/.configured: $(AUTOCONF_DIR)/.unpacked
-       (cd $(AUTOCONF_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) EMACS="no" \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-       );
-       touch  $(AUTOCONF_DIR)/.configured
-
-$(AUTOCONF_DIR)/bin/$(AUTOCONF_BINARY): $(AUTOCONF_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(AUTOCONF_DIR)
-
-$(TARGET_DIR)/$(AUTOCONF_TARGET_BINARY): $(AUTOCONF_DIR)/bin/$(AUTOCONF_BINARY)
-       $(MAKE) \
-           prefix=$(TARGET_DIR)/usr \
-           exec_prefix=$(TARGET_DIR)/usr \
-           bindir=$(TARGET_DIR)/usr/bin \
-           sbindir=$(TARGET_DIR)/usr/sbin \
-           libexecdir=$(TARGET_DIR)/usr/lib \
-           datadir=$(TARGET_DIR)/usr/share \
-           sysconfdir=$(TARGET_DIR)/etc \
-           localstatedir=$(TARGET_DIR)/var \
-           libdir=$(TARGET_DIR)/usr/lib \
-           infodir=$(TARGET_DIR)/usr/info \
-           mandir=$(TARGET_DIR)/usr/man \
-           includedir=$(TARGET_DIR)/usr/include \
-           -C $(AUTOCONF_DIR) install;
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-
-autoconf: uclibc $(TARGET_DIR)/$(AUTOCONF_TARGET_BINARY)
-
-autoconf-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(AUTOCONF_DIR) uninstall
-       -$(MAKE) -C $(AUTOCONF_DIR) clean
-
-autoconf-dirclean:
-       rm -rf $(AUTOCONF_DIR)
-
diff --git a/obsolete-buildroot/make/automake.mk b/obsolete-buildroot/make/automake.mk
deleted file mode 100644 (file)
index 6ac6600..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-#############################################################
-#
-# automake
-#
-#############################################################
-AUTOMAKE_SOURCE:=automake-1.6.3.tar.bz2
-AUTOMAKE_SITE:=ftp://ftp.gnu.org/gnu/automake
-AUTOMAKE_CAT:=bzcat
-AUTOMAKE_DIR:=$(BUILD_DIR)/automake-1.6.3
-AUTOMAKE_BINARY:=automake
-AUTOMAKE_TARGET_BINARY:=usr/bin/automake
-
-$(DL_DIR)/$(AUTOMAKE_SOURCE):
-        $(WGET) -P $(DL_DIR) $(AUTOMAKE_SITE)/$(AUTOMAKE_SOURCE)
-
-automake-source: $(DL_DIR)/$(AUTOMAKE_SOURCE)
-
-$(AUTOMAKE_DIR)/.unpacked: $(DL_DIR)/$(AUTOMAKE_SOURCE)
-       $(AUTOMAKE_CAT) $(DL_DIR)/$(AUTOMAKE_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(AUTOMAKE_DIR)/.unpacked
-
-$(AUTOMAKE_DIR)/.configured: $(AUTOMAKE_DIR)/.unpacked
-       (cd $(AUTOMAKE_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-       );
-       touch  $(AUTOMAKE_DIR)/.configured
-
-$(AUTOMAKE_DIR)/$(AUTOMAKE_BINARY): $(AUTOMAKE_DIR)/.configured
-       $(MAKE) -C $(AUTOMAKE_DIR)
-       touch -c $(AUTOMAKE_DIR)/$(AUTOMAKE_BINARY)
-
-$(TARGET_DIR)/$(AUTOMAKE_TARGET_BINARY): $(AUTOMAKE_DIR)/$(AUTOMAKE_BINARY)
-       $(MAKE) \
-           prefix=$(TARGET_DIR)/usr \
-           exec_prefix=$(TARGET_DIR)/usr \
-           bindir=$(TARGET_DIR)/usr/bin \
-           sbindir=$(TARGET_DIR)/usr/sbin \
-           libexecdir=$(TARGET_DIR)/usr/lib \
-           datadir=$(TARGET_DIR)/usr/share \
-           sysconfdir=$(TARGET_DIR)/etc \
-           localstatedir=$(TARGET_DIR)/var \
-           libdir=$(TARGET_DIR)/usr/lib \
-           infodir=$(TARGET_DIR)/usr/info \
-           mandir=$(TARGET_DIR)/usr/man \
-           includedir=$(TARGET_DIR)/usr/include \
-           -C $(AUTOMAKE_DIR) install;
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-       touch -c $(TARGET_DIR)/$(AUTOMAKE_TARGET_BINARY)
-
-automake: uclibc $(TARGET_DIR)/$(AUTOMAKE_TARGET_BINARY)
-
-automake-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) -C $(AUTOMAKE_DIR) uninstall
-       -$(MAKE) -C $(AUTOMAKE_DIR) clean
-
-automake-dirclean:
-       rm -rf $(AUTOMAKE_DIR)
-
diff --git a/obsolete-buildroot/make/bash.mk b/obsolete-buildroot/make/bash.mk
deleted file mode 100644 (file)
index 26c408f..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-#############################################################
-#
-# bash
-#
-#############################################################
-BASH_SOURCE:=bash-2.05b.tar.gz
-BASH_SITE:=ftp://ftp.gnu.org/gnu/bash
-BASH_CAT:=zcat
-BASH_DIR:=$(BUILD_DIR)/bash-2.05b
-BASH_BINARY:=bash
-BASH_TARGET_BINARY:=bin/bash
-
-$(DL_DIR)/$(BASH_SOURCE):
-        $(WGET) -P $(DL_DIR) $(BASH_SITE)/$(BASH_SOURCE)
-
-bash-source: $(DL_DIR)/$(BASH_SOURCE)
-
-$(BASH_DIR)/.unpacked: $(DL_DIR)/$(BASH_SOURCE)
-       $(BASH_CAT) $(DL_DIR)/$(BASH_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       # This is broken when -lintl is added to LIBS
-       $(SED) 's,LIBS_FOR_BUILD =.*,LIBS_FOR_BUILD =,g' \
-               $(BASH_DIR)/builtins/Makefile.in
-       touch $(BASH_DIR)/.unpacked
-
-$(BASH_DIR)/.configured: $(BASH_DIR)/.unpacked
-       (cd $(BASH_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) CC_FOR_BUILD=$(HOSTCC) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ac_cv_func_setvbuf_reversed=no \
-               bash_cv_have_mbstate_t=yes \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-               $(DISABLE_LARGEFILE) \
-               --with-curses \
-               --enable-alias \
-       );
-       touch  $(BASH_DIR)/.configured
-
-$(BASH_DIR)/$(BASH_BINARY): $(BASH_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) CC_FOR_BUILD=$(HOSTCC) -C $(BASH_DIR)
-
-$(TARGET_DIR)/$(BASH_TARGET_BINARY): $(BASH_DIR)/$(BASH_BINARY)
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(BASH_DIR) install
-       rm -f $(TARGET_DIR)/bin/bash*
-       mv $(TARGET_DIR)/usr/bin/bash* $(TARGET_DIR)/bin/
-       (cd $(TARGET_DIR)/bin; ln -fs bash sh)
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-
-bash: ncurses uclibc $(TARGET_DIR)/$(BASH_TARGET_BINARY)
-
-bash-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(BASH_DIR) uninstall
-       -$(MAKE) -C $(BASH_DIR) clean
-
-bash-dirclean:
-       rm -rf $(BASH_DIR)
-
diff --git a/obsolete-buildroot/make/berkeleydb.mk b/obsolete-buildroot/make/berkeleydb.mk
deleted file mode 100644 (file)
index c935a12..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-#############################################################
-#
-# berkeley db
-#
-#############################################################
-DB_SITE:=http://www.sleepycat.com/update/snapshot
-DB_SOURCE:=db-4.1.25.NC.tar.gz
-DB_DIR:=$(BUILD_DIR)/db-4.1.25.NC
-
-
-$(DL_DIR)/$(DB_SOURCE):
-       $(WGET) -P $(DL_DIR) $(DB_SITE)/$(DB_SOURCE)
-
-berkeleydb-source: $(DL_DIR)/$(DB_SOURCE)
-
-$(DB_DIR)/.dist: $(DL_DIR)/$(DB_SOURCE)
-       zcat $(DL_DIR)/$(DB_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch  $(DB_DIR)/.dist
-
-$(DB_DIR)/.configured: $(DB_DIR)/.dist
-       (cd $(DB_DIR)/build_unix; rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               ../dist/configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               --with-gnu-ld \
-               --enable-shared \
-               --disable-cxx \
-               --disable-java \
-               --disable-rpc \
-               --disable-tcl \
-               --disable-compat185 \
-               --with-pic \
-       );
-       $(SED) 's/\.lo/.o/g' $(DB_DIR)/build_unix/Makefile
-       touch  $(DB_DIR)/.configured
-
-$(DB_DIR)/build_unix/.libs/libdb-4.1.so: $(DB_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(DB_DIR)/build_unix
-
-$(STAGING_DIR)/lib/libdb-4.1.so: $(DB_DIR)/build_unix/.libs/libdb-4.1.so
-       $(MAKE) \
-           prefix=$(STAGING_DIR) \
-           exec_prefix=$(STAGING_DIR) \
-           bindir=$(STAGING_DIR)/bin \
-           sbindir=$(STAGING_DIR)/sbin \
-           libexecdir=$(STAGING_DIR)/lib \
-           datadir=$(STAGING_DIR)/share \
-           sysconfdir=$(STAGING_DIR)/etc \
-           localstatedir=$(STAGING_DIR)/var \
-           libdir=$(STAGING_DIR)/lib \
-           infodir=$(STAGING_DIR)/info \
-           mandir=$(STAGING_DIR)/man \
-           includedir=$(STAGING_DIR)/include \
-           -C $(DB_DIR)/build_unix install;
-       chmod a-x $(STAGING_DIR)/lib/libdb*so*
-       rm -f $(STAGING_DIR)/bin/db_*
-       rm -rf $(STAGING_DIR)/share/locale $(STAGING_DIR)/info \
-               $(STAGING_DIR)/man $(STAGING_DIR)/share/doc
-
-$(TARGET_DIR)/lib/libdb-4.1.so: $(STAGING_DIR)/lib/libdb-4.1.so
-       rm -rf $(TARGET_DIR)/lib/libdb*
-       cp -a $(STAGING_DIR)/lib/libdb*so*  $(TARGET_DIR)/lib/
-       rm -f $(TARGET_DIR)/lib/libdb.so $(TARGET_DIR)/lib/libdb.la $(TARGET_DIR)/lib/libdb.a
-       (cd $(TARGET_DIR)/usr/lib; ln -fs /lib/libdb-4.1.so libdb.so)
-       -$(STRIP) $(TARGET_DIR)/lib/libdb*so*
-
-$(TARGET_DIR)/usr/lib/libdb.a: $(STAGING_DIR)/lib/libdb-4.1.a
-       cp -dpf $(STAGING_DIR)/include/db.h $(TARGET_DIR)/usr/include/
-       cp -dpf $(STAGING_DIR)/lib/libdb*.a $(TARGET_DIR)/usr/lib/
-       cp -dpf $(STAGING_DIR)/lib/libdb*.la $(TARGET_DIR)/usr/lib/
-       touch -c $(TARGET_DIR)/usr/lib/libdb.a
-
-berkeleydb-headers: $(TARGET_DIR)/usr/lib/libdb.a
-
-berkeleydb-clean: 
-       $(MAKE) -C $(DB_DIR)/build_unix clean
-
-berkeleydb-dirclean: 
-       rm -rf $(DB_DIR) 
-
-berkeleydb: uclibc $(TARGET_DIR)/lib/libdb-4.1.so
-
diff --git a/obsolete-buildroot/make/binutils-uclibc.mk b/obsolete-buildroot/make/binutils-uclibc.mk
deleted file mode 100644 (file)
index aec830c..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-#############################################################
-#
-# build binutils for use on the host system
-#
-#############################################################
-BINUTILS_SITE:=http://ftp.kernel.org/pub/linux/devel/binutils
-BINUTILS_SOURCE:=binutils-2.14.90.0.7.tar.bz2
-BINUTILS_DIR:=$(TOOL_BUILD_DIR)/binutils-2.14.90.0.7
-BINUTILS_CAT:=bzcat
-
-BINUTILS_DIR1:=$(TOOL_BUILD_DIR)/binutils-build
-
-$(DL_DIR)/$(BINUTILS_SOURCE):
-       $(WGET) -P $(DL_DIR) $(BINUTILS_SITE)/$(BINUTILS_SOURCE)
-
-$(BINUTILS_DIR)/.unpacked: $(DL_DIR)/$(BINUTILS_SOURCE)
-       mkdir -p $(TOOL_BUILD_DIR)
-       mkdir -p $(DL_DIR)
-       $(BINUTILS_CAT) $(DL_DIR)/$(BINUTILS_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf -
-       touch $(BINUTILS_DIR)/.unpacked
-
-$(BINUTILS_DIR)/.patched: $(BINUTILS_DIR)/.unpacked
-       # Apply any files named binutils-*.patch from the source directory to binutils
-       $(SOURCE_DIR)/patch-kernel.sh $(BINUTILS_DIR) $(SOURCE_DIR) binutils-uclibc*.patch
-       touch $(BINUTILS_DIR)/.patched
-
-$(BINUTILS_DIR1)/.configured: $(BINUTILS_DIR)/.patched
-       mkdir -p $(BINUTILS_DIR1)
-       (cd $(BINUTILS_DIR1); \
-               $(BINUTILS_DIR)/configure \
-               --prefix=$(STAGING_DIR) \
-               --build=$(GNU_HOST_NAME) \
-               --host=$(GNU_HOST_NAME) \
-               --target=$(REAL_GNU_TARGET_NAME) \
-               $(DISABLE_NLS) \
-               $(MULTILIB) \
-               $(SOFT_FLOAT_CONFIG_OPTION) );
-       touch $(BINUTILS_DIR1)/.configured
-
-$(BINUTILS_DIR1)/binutils/objdump: $(BINUTILS_DIR1)/.configured
-       $(MAKE) $(JLEVEL) -C $(BINUTILS_DIR1) all
-
-# Make install will put gettext data in staging_dir/share/locale.
-# Unfortunatey, it isn't configureable.
-$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/bin/ld: $(BINUTILS_DIR1)/binutils/objdump 
-       $(MAKE) $(JLEVEL) -C $(BINUTILS_DIR1) install
-
-binutils-dependancies:
-       @if [ -z "`which bison`" ] ; then \
-               echo -e "\n\nYou must install 'bison' on your build machine\n"; \
-               exit 1; \
-       fi;
-       @if [ -z "`which flex`" ] ; then \
-               echo -e "\n\nYou must install 'flex' on your build machine\n"; \
-               exit 1; \
-       fi;
-       @if [ -z "`which msgfmt`" ] ; then \
-               echo -e "\n\nYou must install 'gettext' on your build machine\n"; \
-               exit 1; \
-       fi;
-
-binutils: binutils-dependancies $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/bin/ld
-
-binutils-source: $(DL_DIR)/$(BINUTILS_SOURCE)
-
-binutils-clean:
-       rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
-       -$(MAKE) -C $(BINUTILS_DIR1) clean
-
-binutils-dirclean:
-       rm -rf $(BINUTILS_DIR1)
-
-
-
-#############################################################
-#
-# build binutils for use on the target system
-#
-#############################################################
-BINUTILS_DIR2:=$(BUILD_DIR)/binutils-target
-$(BINUTILS_DIR2)/.configured: $(BINUTILS_DIR)/.patched
-       mkdir -p $(BINUTILS_DIR2)
-       (cd $(BINUTILS_DIR2); \
-               PATH=$(TARGET_PATH) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               CFLAGS_FOR_BUILD="-O2 -g" \
-               $(BINUTILS_DIR)/configure \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --build=$(GNU_HOST_NAME) \
-               --host=$(REAL_GNU_TARGET_NAME) \
-               --target=$(REAL_GNU_TARGET_NAME) \
-               $(DISABLE_NLS) \
-               $(MULTILIB) \
-               $(SOFT_FLOAT_CONFIG_OPTION) );
-       touch $(BINUTILS_DIR2)/.configured
-
-$(BINUTILS_DIR2)/binutils/objdump: $(BINUTILS_DIR2)/.configured
-       PATH=$(TARGET_PATH) \
-       $(MAKE) $(JLEVEL) -C $(BINUTILS_DIR2) all
-
-$(TARGET_DIR)/usr/bin/ld: $(BINUTILS_DIR2)/binutils/objdump 
-       PATH=$(TARGET_PATH) \
-       $(MAKE) $(JLEVEL) DESTDIR=$(TARGET_DIR) \
-               tooldir=/usr build_tooldir=/usr \
-               -C $(BINUTILS_DIR2) install
-       #rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-       #       $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-       -$(STRIP) $(TARGET_DIR)/usr/$(REAL_GNU_TARGET_NAME)/bin/* > /dev/null 2>&1
-       -$(STRIP) $(TARGET_DIR)/usr/bin/* > /dev/null 2>&1 
-
-binutils_target: $(GCC_DEPENDANCY) $(TARGET_DIR)/usr/bin/ld
-
-binutils_target-clean:
-       rm -f $(TARGET_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
-       -$(MAKE) -C $(BINUTILS_DIR2) clean
-
-binutils_target-dirclean:
-       rm -rf $(BINUTILS_DIR2)
-
diff --git a/obsolete-buildroot/make/bison.mk b/obsolete-buildroot/make/bison.mk
deleted file mode 100644 (file)
index 89c9b91..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#############################################################
-#
-# bison
-#
-#############################################################
-BISON_SOURCE:=bison-1.35.tar.bz2
-BISON_SITE:=ftp://ftp.gnu.org/gnu/bison
-BISON_DIR:=$(BUILD_DIR)/bison-1.35
-BISON_CAT:=bzcat
-BISON_BINARY:=src/bison
-BISON_TARGET_BINARY:=usr/bin/bison
-
-$(DL_DIR)/$(BISON_SOURCE):
-        $(WGET) -P $(DL_DIR) $(BISON_SITE)/$(BISON_SOURCE)
-
-bison-source: $(DL_DIR)/$(BISON_SOURCE)
-
-$(BISON_DIR)/.unpacked: $(DL_DIR)/$(BISON_SOURCE)
-       $(BISON_CAT) $(DL_DIR)/$(BISON_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(BISON_DIR)/.unpacked
-
-$(BISON_DIR)/.configured: $(BISON_DIR)/.unpacked
-       (cd $(BISON_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               gt_cv_func_gnugettext2_libintl=yes \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-       );
-       touch  $(BISON_DIR)/.configured
-
-$(BISON_DIR)/$(BISON_BINARY): $(BISON_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(BISON_DIR)
-
-$(TARGET_DIR)/$(BISON_TARGET_BINARY): $(BISON_DIR)/$(BISON_BINARY)
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(BISON_DIR) install
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-       cp -a $(SOURCE_DIR)/yacc $(TARGET_DIR)/usr/bin/yacc
-
-bison: uclibc $(TARGET_DIR)/$(BISON_TARGET_BINARY)
-
-bison-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(BISON_DIR) uninstall
-       -$(MAKE) -C $(BISON_DIR) clean
-
-bison-dirclean:
-       rm -rf $(BISON_DIR)
-
diff --git a/obsolete-buildroot/make/boa.mk b/obsolete-buildroot/make/boa.mk
deleted file mode 100644 (file)
index 1eb233f..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#############################################################
-#
-# boa
-#
-#############################################################
-
-BOA_VERSION=0.94.14rc4
-
-# Don't alter below this line unless you (think) you know
-# what you are doing! Danger, Danger!
-
-BOA_SOURCE=boa-$(BOA_VERSION).tar.gz
-BOA_SITE=http://www.boa.org/
-BOA_DIR=$(BUILD_DIR)/${shell basename $(BOA_SOURCE) .tar.gz}
-BOA_WORKDIR=$(BUILD_DIR)/boa_workdir
-
-$(DL_DIR)/$(BOA_SOURCE):
-       $(WGET) -P $(DL_DIR) $(BOA_SITE)/$(BOA_SOURCE)
-
-$(BOA_DIR)/.unpacked:  $(DL_DIR)/$(BOA_SOURCE)
-       gzip -d -c $(DL_DIR)/$(BOA_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(BOA_DIR)/.unpacked
-
-$(BOA_WORKDIR)/Makefile: $(BOA_DIR)/.unpacked
-       rm -f $(BOA_WORKDIR)/Makefile
-       mkdir -p $(BOA_WORKDIR)
-       (cd $(BOA_WORKDIR) && CONFIG_SITE=$(SOURCE_DIR)/boa-config.site-$(ARCH) \
-               CC=$(TARGET_CC) $(BOA_DIR)/configure)
-       touch $(BOA_WORKDIR)/.depend
-        
-$(BOA_WORKDIR)/boa $(BOA_WORKDIR)/boa_indexer: $(BOA_WORKDIR)/Makefile
-       rm -f $@
-       $(MAKE) VPATH=$(BOA_DIR)/src/ -C $(BOA_WORKDIR)
-
-$(BOA_WORKDIR)/.installed: $(BOA_WORKDIR)/boa $(BOA_WORKDIR)/boa_indexer
-       mkdir -p $(TARGET_DIR)/usr/sbin
-       cp -f $(BOA_WORKDIR)/src/boa $(TARGET_DIR)/usr/sbin/boa
-       mkdir -p $(TARGET_DIR)/usr/lib/boa
-       cp -f $(BOA_WORKDIR)/src/boa_indexer $(TARGET_DIR)/usr/lib/boa/boa_indexer
-       mkdir -p $(TARGET_DIR)/etc/boa
-       cp -f $(SOURCE_DIR)/boa.conf $(TARGET_DIR)/etc/boa
-       cp -f $(SOURCE_DIR)/mime.types $(TARGET_DIR)/etc/mime.types
-       strip --strip-all $(TARGET_DIR)/usr/sbin/boa $(TARGET_DIR)/usr/lib/boa/boa_indexer
-       touch $(BOA_WORKDIR)/.installed
-
-boa:   uclibc $(BOA_WORKDIR)/.installed
-
-boa-source: $(DL_DIR)/$(BOA_SOURCE)
-
-boa-clean:
-       @if [ -d $(BOA_WORKDIR)/Makefile ] ; then \
-               $(MAKE) -C $(BOA_WORKDIR) clean ; \
-       fi;
-
-boa-dirclean:
-       rm -rf $(BOA_DIR) $(BOA_WORKDIR)
-
diff --git a/obsolete-buildroot/make/bridge.mk b/obsolete-buildroot/make/bridge.mk
deleted file mode 100644 (file)
index 8e5f699..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#############################################################
-#
-# bridgeutils - User Space Program For Controling Bridging
-#
-#############################################################
-
-ifeq ($(strip $(USE_BRIDGE_VERSION)),)
-USE_BRIDGE_VERSION=0.9.7
-endif
-BRIDGE_SOURCE_URL=http://dl.sourceforge.net/sourceforge/bridge/
-BRIDGE_SOURCE=bridge-utils-$(USE_BRIDGE_VERSION).tar.gz
-BRIDGE_BUILD_DIR=$(BUILD_DIR)/bridge-utils-$(USE_BRIDGE_VERSION)
-BRIDGE_TARGET_BINARY:=usr/sbin/brctl
-
-$(DL_DIR)/$(BRIDGE_SOURCE):
-        $(WGET) -P $(DL_DIR) $(BRIDGE_SOURCE_URL)/$(BRIDGE_SOURCE) 
-
-$(BRIDGE_BUILD_DIR)/.unpacked: $(DL_DIR)/$(BRIDGE_SOURCE)
-       # ack! it's a .tgz which is really a bzip 
-       zcat $(DL_DIR)/$(BRIDGE_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       patch -p1 -d $(BRIDGE_BUILD_DIR) < $(SOURCE_DIR)/bridge.patch 
-       touch $(BRIDGE_BUILD_DIR)/.unpacked
-
-$(BRIDGE_BUILD_DIR)/.configured: $(BRIDGE_BUILD_DIR)/.unpacked
-       (cd $(BRIDGE_BUILD_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-               --with-linux-headers=$(LINUX_DIR) \
-       );
-       touch  $(BRIDGE_BUILD_DIR)/.configured
-
-$(BRIDGE_BUILD_DIR)/brctl/brctl: $(BRIDGE_BUILD_DIR)/.configured
-       $(MAKE) -C $(BRIDGE_BUILD_DIR)
-
-$(TARGET_DIR)/$(BRIDGE_TARGET_BINARY): $(BRIDGE_BUILD_DIR)/brctl/brctl
-       cp -af $(BRIDGE_BUILD_DIR)/brctl/brctl $(TARGET_DIR)/$(BRIDGE_TARGET_BINARY)
-       $(STRIP) $(TARGET_DIR)/$(BRIDGE_TARGET_BINARY)
-       #cp -af $(BRIDGE_BUILD_DIR)/brctl/brctld $(TARGET_DIR)/usr/sbin/
-       #$(STRIP) $(TARGET_DIR)/usr/sbin/brctld
-
-bridge: $(TARGET_DIR)/$(BRIDGE_TARGET_BINARY)
-
-bridge-source: $(DL_DIR)/$(BRIDGE_SOURCE)
-
-bridge-clean:
-       #$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(BRIDGE_BUILD_DIR) uninstall
-       -$(MAKE) -C $(BRIDGE_BUILD_DIR) clean
-
-bridge-dirclean:
-       rm -rf $(BRIDGE_BUILD_DIR)
diff --git a/obsolete-buildroot/make/busybox.mk b/obsolete-buildroot/make/busybox.mk
deleted file mode 100644 (file)
index 1020382..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#############################################################
-#
-# busybox
-#
-#############################################################
-
-ifneq ($(strip $(USE_BUSYBOX_SNAPSHOT)),)
-# Be aware that this changes daily....
-BUSYBOX_DIR:=$(BUILD_DIR)/busybox
-BUSYBOX_SOURCE:=busybox-$(strip $(USE_BUSYBOX_SNAPSHOT)).tar.bz2
-BUSYBOX_SITE:=http://www.busybox.net/downloads/snapshots
-else
-BUSYBOX_DIR:=$(BUILD_DIR)/busybox-1.00
-BUSYBOX_SOURCE:=busybox-1.00.tar.bz2
-BUSYBOX_SITE:=http://www.busybox.net/downloads
-endif
-BUSYBOX_UNZIP=bzcat
-BUSYBOX_CONFIG:=$(SOURCE_DIR)/openwrt/busybox/busybox.config
-
-$(DL_DIR)/$(BUSYBOX_SOURCE):
-        $(WGET) -P $(DL_DIR) $(BUSYBOX_SITE)/$(BUSYBOX_SOURCE)
-
-busybox-source: $(DL_DIR)/$(BUSYBOX_SOURCE) $(BUSYBOX_CONFIG)
-
-$(BUSYBOX_DIR)/.configured: $(DL_DIR)/$(BUSYBOX_SOURCE) $(BUSYBOX_CONFIG)
-       $(BUSYBOX_UNZIP) $(DL_DIR)/$(BUSYBOX_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       # Allow busybox patches.
-       $(SOURCE_DIR)/patch-kernel.sh $(BUSYBOX_DIR) $(SOURCE_DIR)/openwrt/busybox/patches
-       cp $(BUSYBOX_CONFIG) $(BUSYBOX_DIR)/.config
-       $(SED) "s,^CROSS.*,CROSS=$(TARGET_CROSS)\n\
-               PREFIX=$(TARGET_DIR),;" $(BUSYBOX_DIR)/Rules.mak
-ifeq ($(strip $(BUILD_WITH_LARGEFILE)),true)
-       $(SED) "s/^.*CONFIG_LFS.*/CONFIG_LFS=y/;" $(BUSYBOX_DIR)/.config
-else
-       $(SED) "s/^.*CONFIG_LFS.*/CONFIG_LFS=n/;" $(BUSYBOX_DIR)/.config
-endif
-       $(MAKE) CC=$(TARGET_CC) CROSS="$(TARGET_CROSS)" -C $(BUSYBOX_DIR) oldconfig
-       touch $(BUSYBOX_DIR)/.configured
-
-busybox-unpack: $(BUSYBOX_DIR)/.configured
-
-$(BUSYBOX_DIR)/busybox: $(BUSYBOX_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) CROSS="$(TARGET_CROSS)" PREFIX="$(TARGET_DIR)" \
-               EXTRA_CFLAGS="$(TARGET_CFLAGS) -fomit-frame-pointer" -C $(BUSYBOX_DIR)
-
-$(TARGET_DIR)/bin/busybox: $(BUSYBOX_DIR)/busybox
-       $(MAKE) CC=$(TARGET_CC) CROSS="$(TARGET_CROSS)" PREFIX="$(TARGET_DIR)" \
-               EXTRA_CFLAGS="$(TARGET_CFLAGS)" -C $(BUSYBOX_DIR) install
-       # Just in case
-       -chmod a+x $(TARGET_DIR)/usr/share/udhcpc/default.script
-
-busybox: uclibc $(TARGET_DIR)/bin/busybox
-
-busybox-clean:
-       rm -f $(TARGET_DIR)/bin/busybox
-       -$(MAKE) -C $(BUSYBOX_DIR) clean
-
-busybox-dirclean:
-       rm -rf $(BUSYBOX_DIR)
diff --git a/obsolete-buildroot/make/bzip2.mk b/obsolete-buildroot/make/bzip2.mk
deleted file mode 100644 (file)
index e3ce6f6..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-#############################################################
-#
-# bzip2
-#
-#############################################################
-BZIP2_SOURCE:=bzip2-1.0.2.tar.gz
-BZIP2_SITE:=ftp://sources.redhat.com/pub/bzip2/v102
-BZIP2_DIR:=$(BUILD_DIR)/bzip2-1.0.2
-BZIP2_CAT:=zcat
-BZIP2_BINARY:=$(BZIP2_DIR)/bzip2
-BZIP2_TARGET_BINARY:=$(TARGET_DIR)/usr/bin/bzmore
-
-$(DL_DIR)/$(BZIP2_SOURCE):
-        $(WGET) -P $(DL_DIR) $(BZIP2_SITE)/$(BZIP2_SOURCE)
-
-bzip2-source: $(DL_DIR)/$(BZIP2_SOURCE)
-
-$(BZIP2_DIR)/.unpacked: $(DL_DIR)/$(BZIP2_SOURCE)
-       $(BZIP2_CAT) $(DL_DIR)/$(BZIP2_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       $(SED) "s,ln \$$(,ln -sf \$$(,g" $(BZIP2_DIR)/Makefile
-       $(SED) "s,ln -s (lib.*),ln -sf \$$1 ; ln -sf libbz2.so.1.0.2 libbz2.so,g" \
-           $(BZIP2_DIR)/Makefile-libbz2_so
-ifeq ($(strip $(BUILD_WITH_LARGEFILE)),false)
-       $(SED) "s,^BIGFILES,#BIGFILES,g" $(BZIP2_DIR)/Makefile
-       $(SED) "s,^BIGFILES,#BIGFILES,g" $(BZIP2_DIR)/Makefile-libbz2_so
-endif
-       touch $(BZIP2_DIR)/.unpacked
-
-$(STAGING_DIR)/lib/libbz2.so.1.0.2: $(BZIP2_DIR)/.unpacked
-       $(TARGET_CONFIGURE_OPTS) \
-       $(MAKE) CC=$(TARGET_CC) -C $(BZIP2_DIR) -f Makefile-libbz2_so
-       $(TARGET_CONFIGURE_OPTS) \
-       $(MAKE) CC=$(TARGET_CC) -C $(BZIP2_DIR) libbz2.a
-       cp $(BZIP2_DIR)/bzlib.h $(STAGING_DIR)/include/ 
-       cp $(BZIP2_DIR)/libbz2.so.1.0.2 $(STAGING_DIR)/lib/ 
-       cp $(BZIP2_DIR)/libbz2.a $(STAGING_DIR)/lib/ 
-       (cd $(STAGING_DIR)/lib/; ln -sf libbz2.so.1.0.2 libbz2.so) 
-       (cd $(STAGING_DIR)/lib/; ln -sf libbz2.so.1.0.2 libbz2.so.1.0) 
-
-$(BZIP2_BINARY): $(STAGING_DIR)/lib/libbz2.so.1.0.2
-       $(TARGET_CONFIGURE_OPTS) \
-       $(MAKE) CC=$(TARGET_CC) -C $(BZIP2_DIR) bzip2 bzip2recover
-
-$(BZIP2_TARGET_BINARY): $(BZIP2_BINARY)
-       (cd $(TARGET_DIR)/usr/bin; \
-       rm -f bzip2 bunzip2 bzcat bzip2recover bzgrep bzegrep bzfgrep bzmore bzless bzdiff bzcmp);
-       $(TARGET_CONFIGURE_OPTS) \
-       $(MAKE) PREFIX=$(TARGET_DIR)/usr -C $(BZIP2_DIR) install
-       rm -f $(TARGET_DIR)/usr/lib/libbz2.a
-       rm -f $(TARGET_DIR)/usr/include/bzlib.h
-       cp $(BZIP2_DIR)/libbz2.so.1.0.2 $(TARGET_DIR)/usr/lib/
-       (cd $(TARGET_DIR)/usr/lib; \
-       ln -sf libbz2.so.1.0.2 libbz2.so.1.0; \
-       ln -sf libbz2.so.1.0.2 libbz2.so)
-       (cd $(TARGET_DIR)/usr/bin; \
-       ln -sf bzip2 bunzip2; \
-       ln -sf bzip2 bzcat; \
-       ln -sf bzdiff bzcmp; \
-       ln -sf bzmore bzless; \
-       ln -sf bzgrep bzegrep; \
-       ln -sf bzgrep bzfgrep;)
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-
-$(TARGET_DIR)/usr/lib/libbz2.a: $(STAGING_DIR)/lib/libbz2.a
-       mkdir -p $(TARGET_DIR)/usr/include 
-       cp $(STAGING_DIR)/include/bzlib.h $(TARGET_DIR)/usr/include/
-       cp $(STAGING_DIR)/lib/libbz2.a $(TARGET_DIR)/usr/lib/ 
-       rm -f $(TARGET_DIR)/lib/libbz2.so
-       (cd $(TARGET_DIR)/usr/lib; \
-               ln -fs /usr/lib/libbz2.so.1.0 libbz2.so; \
-       )
-       -$(STRIP)  $(TARGET_DIR)/usr/lib/libbz2.so.1.0
-       touch -c $(TARGET_DIR)/usr/lib/libbz2.a
-
-bzip2-headers: $(TARGET_DIR)/usr/lib/libbz2.a
-
-bzip2: uclibc $(BZIP2_TARGET_BINARY)
-
-bzip2-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(BZIP2_DIR) uninstall
-       -$(MAKE) -C $(BZIP2_DIR) clean
-
-bzip2-dirclean:
-       rm -rf $(BZIP2_DIR)
-
diff --git a/obsolete-buildroot/make/ccache.mk b/obsolete-buildroot/make/ccache.mk
deleted file mode 100644 (file)
index f973a52..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-#############################################################
-#
-# build ccache to make recompiles faster on the build system
-#
-#############################################################
-CCACHE_SITE:=http://ccache.samba.org/ftp/ccache
-CCACHE_SOURCE:=ccache-2.3.tar.gz
-CCACHE_DIR1:=$(TOOL_BUILD_DIR)/ccache-2.3
-CCACHE_DIR2:=$(BUILD_DIR)/ccache-2.3
-CCACHE_CAT:=zcat
-CCACHE_BINARY:=ccache
-CCACHE_TARGET_BINARY:=usr/bin/ccache
-
-$(DL_DIR)/$(CCACHE_SOURCE):
-       $(WGET) -P $(DL_DIR) $(CCACHE_SITE)/$(CCACHE_SOURCE)
-
-$(CCACHE_DIR1)/.unpacked: $(DL_DIR)/$(CCACHE_SOURCE)
-       $(CCACHE_CAT) $(DL_DIR)/$(CCACHE_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf -
-       touch $(CCACHE_DIR1)/.unpacked
-
-$(CCACHE_DIR1)/.patched: $(CCACHE_DIR1)/.unpacked
-       $(SED) "s,getenv(\"CCACHE_PATH\"),\"$(STAGING_DIR)/usr/bin\",g" \
-               $(CCACHE_DIR1)/execute.c
-       $(SED) "s,getenv(\"CCACHE_DIR\"),\"$(CCACHE_DIR1)/cache\",g" \
-               $(CCACHE_DIR1)/ccache.c
-       mkdir -p $(CCACHE_DIR1)/cache
-       touch $(CCACHE_DIR1)/.patched
-
-$(CCACHE_DIR1)/.configured: $(CCACHE_DIR1)/.patched
-       mkdir -p $(CCACHE_DIR1)
-       (cd $(CCACHE_DIR1); rm -rf config.cache; \
-               CC=$(HOSTCC) \
-               $(CCACHE_DIR1)/configure \
-               --target=$(GNU_HOST_NAME) \
-               --host=$(GNU_HOST_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-       );
-       touch $(CCACHE_DIR1)/.configured
-
-$(CCACHE_DIR1)/$(CCACHE_BINARY): $(CCACHE_DIR1)/.configured
-       $(MAKE) CC=$(HOSTCC) -C $(CCACHE_DIR1)
-
-$(STAGING_DIR)/$(CCACHE_TARGET_BINARY): $(CCACHE_DIR1)/$(CCACHE_BINARY)
-       mkdir -p $(STAGING_DIR)/usr/bin;
-       mkdir -p $(TOOL_BUILD_DIR)/.ccache;
-       cp $(CCACHE_DIR1)/ccache $(STAGING_DIR)/usr/bin
-       (cd $(STAGING_DIR)/usr/bin; \
-               ln -fs $(OPTIMIZE_FOR_CPU)-linux-uclibc-gcc $(OPTIMIZE_FOR_CPU)-linux-gcc; \
-               ln -fs $(OPTIMIZE_FOR_CPU)-linux-uclibc-gcc $(OPTIMIZE_FOR_CPU)-linux-cc; \
-               ln -fs $(OPTIMIZE_FOR_CPU)-linux-uclibc-gcc $(OPTIMIZE_FOR_CPU)-linux-uclibc-cc);
-       [ -f $(STAGING_DIR)/bin/$(OPTIMIZE_FOR_CPU)-linux-uclibc-gcc ] && \
-               mv $(STAGING_DIR)/bin/$(OPTIMIZE_FOR_CPU)-linux-uclibc-gcc $(STAGING_DIR)/usr/bin/
-       (cd $(STAGING_DIR)/bin; \
-               ln -fs ../usr/bin/ccache $(OPTIMIZE_FOR_CPU)-linux-cc; \
-               ln -fs ../usr/bin/ccache $(OPTIMIZE_FOR_CPU)-linux-gcc; \
-               ln -fs ../usr/bin/ccache $(OPTIMIZE_FOR_CPU)-linux-uclibc-cc; \
-               ln -fs ../usr/bin/ccache $(OPTIMIZE_FOR_CPU)-linux-uclibc-gcc);
-ifeq ($(INSTALL_LIBSTDCPP),true)
-       [ -f $(STAGING_DIR)/bin/$(OPTIMIZE_FOR_CPU)-linux-uclibc-c++ ] && \
-               mv $(STAGING_DIR)/bin/$(OPTIMIZE_FOR_CPU)-linux-uclibc-c++ $(STAGING_DIR)/usr/bin/
-       [ -f $(STAGING_DIR)/bin/$(OPTIMIZE_FOR_CPU)-linux-uclibc-g++ ] && \
-               mv $(STAGING_DIR)/bin/$(OPTIMIZE_FOR_CPU)-linux-uclibc-g++  $(STAGING_DIR)/usr/bin/
-       (cd $(STAGING_DIR)/bin; \
-               ln -fs ../usr/bin/ccache $(OPTIMIZE_FOR_CPU)-linux-c++; \
-               ln -fs ../usr/bin/ccache $(OPTIMIZE_FOR_CPU)-linux-g++;\
-               ln -fs ../usr/bin/ccache $(OPTIMIZE_FOR_CPU)-linux-uclibc-c++; \
-               ln -fs ../usr/bin/ccache $(OPTIMIZE_FOR_CPU)-linux-uclibc-g++);
-endif
-
-ifeq ($(GCC_2_95_TOOLCHAIN),true)
-ccache: gcc2_95 $(STAGING_DIR)/$(CCACHE_TARGET_BINARY)
-else
-ccache: gcc3_3 $(STAGING_DIR)/$(CCACHE_TARGET_BINARY)
-endif
-
-ccache-clean:
-       $(MAKE) -C $(CCACHE_DIR1) uninstall
-       -$(MAKE) -C $(CCACHE_DIR1) clean
-
-ccache-dirclean:
-       rm -rf $(CCACHE_DIR1)
-
-
-
-
-#############################################################
-#
-# build ccache for use on the target system
-#
-#############################################################
-
-$(CCACHE_DIR2)/.unpacked: $(DL_DIR)/$(CCACHE_SOURCE)
-       $(CCACHE_CAT) $(DL_DIR)/$(CCACHE_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(CCACHE_DIR2)/.unpacked
-
-$(CCACHE_DIR2)/.patched: $(CCACHE_DIR2)/.unpacked
-       touch $(CCACHE_DIR2)/.patched
-
-$(CCACHE_DIR2)/.configured: $(CCACHE_DIR2)/.patched
-       mkdir -p $(CCACHE_DIR2)
-       (cd $(CCACHE_DIR2); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               $(CCACHE_DIR2)/configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-       );
-       touch $(CCACHE_DIR2)/.configured
-
-$(CCACHE_DIR2)/$(CCACHE_BINARY): $(CCACHE_DIR2)/.configured
-       $(MAKE) -C $(CCACHE_DIR2)
-
-$(TARGET_DIR)/$(CCACHE_TARGET_BINARY): $(CCACHE_DIR2)/$(CCACHE_BINARY)
-       $(MAKE) DESTDIR=$(TARGET_DIR) -C $(CCACHE_DIR2) install
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-       # put a bunch of symlinks into /bin, since that is earlier
-       # in the default PATH than /usr/bin where gcc lives
-       (cd $(TARGET_DIR)/bin; \
-               ln -fs /usr/bin/ccache cc; \
-               ln -fs /usr/bin/ccache gcc; \
-               ln -fs /usr/bin/ccache c++; \
-               ln -fs /usr/bin/ccache g++;)
-
-ccache_target: uclibc $(TARGET_DIR)/$(CCACHE_TARGET_BINARY)
-
-ccache_target-sources: $(DL_DIR)/$(CCACHE_SOURCE)
-
-ccache_target-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) -C $(CCACHE_DIR2) uninstall
-       -$(MAKE) -C $(CCACHE_DIR2) clean
-
-ccache_target-dirclean:
-       rm -rf $(CCACHE_DIR2)
-
diff --git a/obsolete-buildroot/make/chillispot.mk b/obsolete-buildroot/make/chillispot.mk
deleted file mode 100644 (file)
index 9cc9a94..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-#############################################################
-#
-# chillispot
-#
-#############################################################
-
-CHILLISPOT_VERSION:=0.96
-CHILLISPOT_RELEASE:=1
-
-CHILLISPOT_SOURCE:=chillispot-$(CHILLISPOT_VERSION).tar.gz
-CHILLISPOT_SITE:=http://www.chillispot.org/download/
-CHILLISPOT_CAT:=zcat
-CHILLISPOT_DIR:=$(BUILD_DIR)/chillispot-$(CHILLISPOT_VERSION)
-CHILLISPOT_BINARY:=src/chilli
-CHILLISPOT_TARGET_BINARY:=usr/sbin/chilli
-
-CHILLISPOT_BUILD_DIR := $(BUILD_DIR)/chillispot_$(CHILLISPOT_VERSION)-$(CHILLISPOT_RELEASE)
-CHILLISPOT_IPK_DIR := $(OPENWRT_IPK_DIR)/chillispot
-CHILLISPOT_IPK := $(CHILLISPOT_BUILD_DIR)_$(ARCH).ipk
-
-
-$(DL_DIR)/$(CHILLISPOT_SOURCE):
-        $(WGET) -P $(DL_DIR) $(CHILLISPOT_SITE)/$(CHILLISPOT_SOURCE)
-
-chillispot-source: $(DL_DIR)/$(CHILLISPOT_SOURCE)
-
-$(CHILLISPOT_DIR)/.stamp-unpacked: $(DL_DIR)/$(CHILLISPOT_SOURCE)
-       $(CHILLISPOT_CAT) $(DL_DIR)/$(CHILLISPOT_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-
-       touch $(CHILLISPOT_DIR)/.stamp-unpacked
-
-$(CHILLISPOT_DIR)/.stamp-configured: $(CHILLISPOT_DIR)/.stamp-unpacked
-       (cd $(CHILLISPOT_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ac_cv_func_malloc_0_nonnull=yes \
-               ac_cv_func_memcmp_working=yes \
-               ac_cv_func_setvbuf_reversed=no \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib/locate \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var/lib \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-               $(DISABLE_LARGEFILE) \
-       );
-       touch  $(CHILLISPOT_DIR)/.stamp-configured
-
-$(CHILLISPOT_DIR)/.stamp-built: $(CHILLISPOT_DIR)/.stamp-configured
-       $(MAKE) CC=$(TARGET_CC) $(TARGET_CONFIGURE_OPTS) -C $(CHILLISPOT_DIR) 
-       touch  $(CHILLISPOT_DIR)/.stamp-built
-
-$(CHILLISPOT_BUILD_DIR)/CONTROL/control: $(CHILLISPOT_DIR)/.stamp-built
-       rm -rf $(CHILLISPOT_BUILD_DIR)
-       mkdir -p $(CHILLISPOT_BUILD_DIR)/usr/sbin
-       cp -a $(CHILLISPOT_DIR)/src/chilli $(CHILLISPOT_BUILD_DIR)/usr/sbin/
-       $(STRIP) $(CHILLISPOT_BUILD_DIR)/usr/sbin/*
-       mkdir -p $(CHILLISPOT_BUILD_DIR)/etc
-       cp -a $(CHILLISPOT_DIR)/doc/chilli.conf $(CHILLISPOT_BUILD_DIR)/etc
-       cp -a $(CHILLISPOT_IPK_DIR)/root/* $(CHILLISPOT_BUILD_DIR)/
-       chmod 0755 $(CHILLISPOT_BUILD_DIR)/etc
-       chmod 0600 $(CHILLISPOT_BUILD_DIR)/etc/chilli.conf
-       chmod 0755 $(CHILLISPOT_BUILD_DIR)/etc/init.d
-       chmod 0755 $(CHILLISPOT_BUILD_DIR)/etc/init.d/*
-       chmod 0755 $(CHILLISPOT_BUILD_DIR)/usr
-       chmod 0755 $(CHILLISPOT_BUILD_DIR)/usr/sbin
-       chmod 0755 $(CHILLISPOT_BUILD_DIR)/usr/sbin/*
-       cp -a $(CHILLISPOT_IPK_DIR)/CONTROL $(CHILLISPOT_BUILD_DIR)/
-       perl -pi -e "s/^Vers.*:.*$$/Version: $(CHILLISPOT_VERSION)-$(CHILLISPOT_RELEASE)/" $(CHILLISPOT_BUILD_DIR)/CONTROL/control
-       perl -pi -e "s/^Arch.*:.*$$/Architecture: $(ARCH)/" $(CHILLISPOT_BUILD_DIR)/CONTROL/control
-
-       touch $(CHILLISPOT_BUILD_DIR)/CONTROL/control
-
-
-$(CHILLISPOT_IPK): $(CHILLISPOT_BUILD_DIR)/CONTROL/control
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(CHILLISPOT_BUILD_DIR)
-
-
-chillispot-ipk: ipkg-utils $(CHILLISPOT_IPK)
-
-chillispot-clean:
-       $(MAKE) -C $(CHILLISPOT_DIR) clean
-
-chillispot-dirclean:
-       rm -rf $(CHILLISPOT_DIR)
diff --git a/obsolete-buildroot/make/coreutils.mk b/obsolete-buildroot/make/coreutils.mk
deleted file mode 100644 (file)
index 825c0f3..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#############################################################
-#
-# coreutils
-#
-#############################################################
-COREUTILS_SOURCE:=coreutils-5.0.tar.bz2
-COREUTILS_SITE:=ftp://ftp.gnu.org/gnu/coreutils/
-COREUTILS_CAT:=bzcat
-COREUTILS_DIR:=$(BUILD_DIR)/coreutils-5.0
-COREUTILS_BINARY:=src/vdir
-COREUTILS_TARGET_BINARY:=bin/vdir
-BIN_PROGS:=cat chgrp chmod chown cp date dd df dir echo false hostname \
-       ln ls mkdir mknod mv pwd rm rmdir vdir sleep stty sync touch true uname
-
-$(DL_DIR)/$(COREUTILS_SOURCE):
-        $(WGET) -P $(DL_DIR) $(COREUTILS_SITE)/$(COREUTILS_SOURCE)
-
-coreutils-source: $(DL_DIR)/$(COREUTILS_SOURCE)
-
-$(COREUTILS_DIR)/.unpacked: $(DL_DIR)/$(COREUTILS_SOURCE)
-       $(COREUTILS_CAT) $(DL_DIR)/$(COREUTILS_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(COREUTILS_DIR)/.unpacked
-
-$(COREUTILS_DIR)/.configured: $(COREUTILS_DIR)/.unpacked
-       (cd $(COREUTILS_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-               $(DISABLE_LARGEFILE) \
-               --disable-rpath \
-               --disable-dependency-tracking \
-       );
-       #Fix up the max number of open files per process, which apparently 
-       # is not set when cross compiling
-       $(SED) 's,.*UTILS_OPEN_MAX.*,#define UTILS_OPEN_MAX 1019,g' \
-               $(COREUTILS_DIR)/config.h
-       # This is undefined when crosscompiling...
-       $(SED) 's,.*HAVE_PROC_UPTIME.*,#define HAVE_PROC_UPTIME 1,g' \
-               $(COREUTILS_DIR)/config.h
-       touch  $(COREUTILS_DIR)/.configured
-
-$(COREUTILS_DIR)/$(COREUTILS_BINARY): $(COREUTILS_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(COREUTILS_DIR)
-       rm -f $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY)
-
-$(TARGET_DIR)/$(COREUTILS_TARGET_BINARY): $(COREUTILS_DIR)/$(COREUTILS_BINARY)
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(COREUTILS_DIR) install
-       # some things go in root rather than usr
-       for f in $(BIN_PROGS); do \
-               mv $(TARGET_DIR)/usr/bin/$$f $(TARGET_DIR)/bin/$$f; \
-       done
-       # link for archaic shells
-       ln -fs test $(TARGET_DIR)/usr/bin/[
-       # gnu thinks chroot is in bin, debian thinks it's in sbin
-       mv $(TARGET_DIR)/usr/bin/chroot $(TARGET_DIR)/usr/sbin/chroot
-       $(STRIP) $(TARGET_DIR)/usr/sbin/chroot > /dev/null 2>&1
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-
-coreutils: uclibc $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY)
-
-coreutils-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(COREUTILS_DIR) uninstall
-       -$(MAKE) -C $(COREUTILS_DIR) clean
-
-coreutils-dirclean:
-       rm -rf $(COREUTILS_DIR)
-
diff --git a/obsolete-buildroot/make/cramfsroot.mk b/obsolete-buildroot/make/cramfsroot.mk
deleted file mode 100644 (file)
index 89f9981..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#############################################################
-#
-# mkcramfs to build to target cramfs filesystems
-#
-#############################################################
-CRAMFS_DIR=$(BUILD_DIR)/cramfs-1.1
-CRAMFS_SOURCE=cramfs-1.1.tar.gz
-CRAMFS_SITE=http://aleron.dl.sourceforge.net/sourceforge/cramfs
-CRAMFS_PATCH=$(SOURCE_DIR)/cramfs.patch
-
-$(DL_DIR)/$(CRAMFS_SOURCE):
-        $(WGET) -P $(DL_DIR) $(CRAMFS_SITE)/$(CRAMFS_SOURCE)
-
-$(CRAMFS_DIR): $(DL_DIR)/$(CRAMFS_SOURCE) $(CRAMFS_PATCH)
-       zcat $(DL_DIR)/$(CRAMFS_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       cat $(CRAMFS_PATCH) | patch -p1 -d $(CRAMFS_DIR)
-
-$(CRAMFS_DIR)/mkcramfs: $(CRAMFS_DIR)
-       $(MAKE) CFLAGS="-Wall -O2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" -C $(CRAMFS_DIR);
-       touch -c $(CRAMFS_DIR)/mkcramfs
-
-cramfs: $(CRAMFS_DIR)/mkcramfs
-
-cramfs-source: $(DL_DIR)/$(CRAMFS_SOURCE)
-
-cramfs-clean:
-       -$(MAKE) -C $(CRAMFS_DIR) clean
-
-cramfs-dirclean:
-       rm -rf $(CRAMFS_DIR)
-
-#############################################################
-#
-# Build the cramfs root filesystem image
-#
-#############################################################
-
-cramfsroot: cramfs
-       #-@find $(TARGET_DIR)/lib -type f -name \*.so\* | xargs $(STRIP)  2>/dev/null || true;
-       -@find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIP) 2>/dev/null || true;
-       @rm -rf $(TARGET_DIR)/usr/man
-       @rm -rf $(TARGET_DIR)/usr/info
-       $(CRAMFS_DIR)/mkcramfs -q -D $(SOURCE_DIR)/device_table.txt $(TARGET_DIR) $(IMAGE)
-
-cramfsroot-source: cramfs-source
-
-cramfsroot-clean:
-       -$(MAKE) -C $(CRAMFS_DIR) clean
-
-cramfsroot-dirclean:
-       rm -rf $(CRAMFS_DIR)
-
diff --git a/obsolete-buildroot/make/customize.mk b/obsolete-buildroot/make/customize.mk
deleted file mode 100644 (file)
index 2cfed18..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#############################################################
-#
-# Any custom stuff you feel like doing....
-#
-#############################################################
-CUST_DIR:=$(SOURCE_DIR)/customize
-ROOT_DIR:=$(BUILD_DIR)/root
-
-customize:
-       cp -af $(CUST_DIR)/* $(ROOT_DIR)/
diff --git a/obsolete-buildroot/make/dhcp-fwd.mk b/obsolete-buildroot/make/dhcp-fwd.mk
deleted file mode 100644 (file)
index b4f0a9a..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-## dhcp-fwd
-
-DHCP_FWD_VERSION := 0.7
-DHCP_FWD_RELEASE := 1
-
-DHCP_FWD_SOURCE := dhcp-forwarder-$(DHCP_FWD_VERSION).tar.bz2
-DHCP_FWD_SITE := http://www-user.tu-chemnitz.de/~ensc/dhcp-fwd/files/
-DHCP_FWD_DIR := $(BUILD_DIR)/dhcp-forwarder-$(DHCP_FWD_VERSION)
-DHCP_FWD_CAT := bzcat
-
-DHCP_FWD_BUILD_DIR := $(BUILD_DIR)/dhcp-fwd_$(DHCP_FWD_VERSION)-$(DHCP_FWD_RELEASE)
-DHCP_FWD_IPK_DIR := $(OPENWRT_IPK_DIR)/dhcp-fwd
-DHCP_FWD_IPK := $(DHCP_FWD_BUILD_DIR)_$(ARCH).ipk
-
-
-$(DL_DIR)/$(DHCP_FWD_SOURCE):
-        $(WGET) -P $(DL_DIR) $(DHCP_FWD_SITE)/$(DHCP_FWD_SOURCE)
-
-
-$(DHCP_FWD_DIR)/.stamp-unpacked: $(DL_DIR)/$(DHCP_FWD_SOURCE)
-       $(DHCP_FWD_CAT) $(DL_DIR)/$(DHCP_FWD_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-
-       touch $(DHCP_FWD_DIR)/.stamp-unpacked
-
-
-$(DHCP_FWD_DIR)/.stamp-configured: $(DHCP_FWD_DIR)/.stamp-unpacked
-       cd $(DHCP_FWD_DIR) ; \
-       rm -rf config.cache ; \
-       $(TARGET_CONFIGURE_OPTS) \
-       CFLAGS="$(TARGET_CFLAGS)" \
-       ac_cv_func_malloc_0_nonnull="yes" \
-       ./configure \
-         --target=$(GNU_TARGET_NAME) \
-         --host=$(GNU_TARGET_NAME) \
-         --build=$(GNU_HOST_NAME) \
-         --prefix=/usr \
-         --exec-prefix=/usr \
-         --bindir=/usr/bin \
-         --sbindir=/usr/sbin \
-         --libexecdir=/usr/lib \
-         --datadir=/usr/share \
-         --infodir=/usr/share/info \
-         --mandir=/usr/share/man \
-         --localstatedir=/var \
-         --sysconfdir=/etc \
-         $(DISABLE_NLS) \
-         
-       touch $(DHCP_FWD_DIR)/.stamp-configured
-
-
-$(DHCP_FWD_DIR)/.stamp-built: $(DHCP_FWD_DIR)/.stamp-configured
-       cd  $(DHCP_FWD_DIR) ; \
-       touch config.guess ; \
-       touch config.sub ; \
-       $(MAKE) \
-         CC=$(TARGET_CC) \
-         cfg_filename="/etc/dhcp-fwd.conf" \
-        all \
-
-       touch $(DHCP_FWD_DIR)/.stamp-built
-
-
-$(DHCP_FWD_BUILD_DIR)/CONTROL/control: $(DHCP_FWD_DIR)/.stamp-built
-       rm -rf $(DHCP_FWD_BUILD_DIR)
-       mkdir -p $(DHCP_FWD_BUILD_DIR)/usr/sbin
-       cp -a $(DHCP_FWD_DIR)/dhcp-fwd $(DHCP_FWD_BUILD_DIR)/usr/sbin/
-       $(STRIP) $(DHCP_FWD_BUILD_DIR)/usr/sbin/*
-       cp -a $(DHCP_FWD_IPK_DIR)/root/* $(DHCP_FWD_BUILD_DIR)/
-       chmod 0755 $(DHCP_FWD_BUILD_DIR)/etc
-       chmod 0755 $(DHCP_FWD_BUILD_DIR)/etc/init.d
-       chmod 0755 $(DHCP_FWD_BUILD_DIR)/etc/init.d/*
-       chmod 0644 $(DHCP_FWD_BUILD_DIR)/etc/dhcp-fwd.conf
-       chmod 0755 $(DHCP_FWD_BUILD_DIR)/usr
-       chmod 0755 $(DHCP_FWD_BUILD_DIR)/usr/sbin
-       chmod 0755 $(DHCP_FWD_BUILD_DIR)/usr/sbin/*
-       cp -a $(DHCP_FWD_IPK_DIR)/CONTROL $(DHCP_FWD_BUILD_DIR)/
-       perl -pi -e "s/^Vers.*:.*$$/Version: $(DHCP_FWD_VERSION)-$(DHCP_FWD_RELEASE)/" $(DHCP_FWD_BUILD_DIR)/CONTROL/control
-       perl -pi -e "s/^Arch.*:.*$$/Architecture: $(ARCH)/" $(DHCP_FWD_BUILD_DIR)/CONTROL/control
-
-       touch $(DHCP_FWD_BUILD_DIR)/CONTROL/control
-
-
-$(DHCP_FWD_IPK): $(DHCP_FWD_BUILD_DIR)/CONTROL/control
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(DHCP_FWD_BUILD_DIR)
-
-
-dhcp-fwd-ipk: ipkg-utils $(DHCP_FWD_IPK)
-
-dhcp-fwd-clean:
-       rm -rf $(DHCP_FWD_IPK)
-       rm -rf $(DHCP_FWD_BUILD_DIR)
-       rm -rf $(DHCP_FWD_DIR)
diff --git a/obsolete-buildroot/make/dhcp_relay.mk b/obsolete-buildroot/make/dhcp_relay.mk
deleted file mode 100644 (file)
index 8252b4a..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#############################################################
-#
-# dhcp_relay
-#
-#############################################################
-DHCP_RELAY_SOURCE:=dhcp-3.0pl2.tar.gz
-DHCP_RELAY_SITE:=ftp://ftp.isc.org/isc/dhcp
-DHCP_RELAY_CAT:=zcat
-DHCP_RELAY_DIR:=$(BUILD_DIR)/dhcp-3.0pl2
-DHCP_RELAY_BINARY:=work.linux-2.2/relay/dhcrelay
-DHCP_RELAY_TARGET_BINARY:=usr/sbin/dhcrelay
-BVARS=PREDEFINES='-D_PATH_DHCPD_DB=\"/var/lib/dhcp/dhcpd.leases\" \
-       -D_PATH_DHCLIENT_DB=\"/var/lib/dhcp/dhclient.leases\"' \
-       VARDB=/var/lib/dhcp
-
-$(DL_DIR)/$(DHCP_RELAY_SOURCE):
-        $(WGET) -P $(DL_DIR) $(DHCP_RELAY_SITE)/$(DHCP_RELAY_SOURCE)
-
-dhcp_relay-source: $(DL_DIR)/$(DHCP_RELAY_SOURCE)
-
-$(DHCP_RELAY_DIR)/.unpacked: $(DL_DIR)/$(DHCP_RELAY_SOURCE)
-       $(DHCP_RELAY_CAT) $(DL_DIR)/$(DHCP_RELAY_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(DHCP_RELAY_DIR)/.unpacked
-
-$(DHCP_RELAY_DIR)/.configured: $(DHCP_RELAY_DIR)/.unpacked
-       (cd $(DHCP_RELAY_DIR); $(TARGET_CONFIGURE_OPTS) ./configure );
-       touch  $(DHCP_RELAY_DIR)/.configured
-
-$(DHCP_RELAY_DIR)/$(DHCP_RELAY_BINARY): $(DHCP_RELAY_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) $(BVARS) -C $(DHCP_RELAY_DIR)
-       $(STRIP) $(DHCP_RELAY_DIR)/$(DHCP_RELAY_BINARY)
-
-$(TARGET_DIR)/$(DHCP_RELAY_TARGET_BINARY): $(DHCP_RELAY_DIR)/$(DHCP_RELAY_BINARY)
-       (cd $(TARGET_DIR)/var/lib; ln -sf /tmp dhcp)
-       cp -a $(DHCP_RELAY_DIR)/$(DHCP_RELAY_BINARY) $(TARGET_DIR)/$(DHCP_RELAY_TARGET_BINARY) 
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-
-dhcp_relay: uclibc $(TARGET_DIR)/$(DHCP_RELAY_TARGET_BINARY)
-
-dhcp_relay-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(DHCP_RELAY_DIR) uninstall
-       -$(MAKE) -C $(DHCP_RELAY_DIR) clean
-
-dhcp_relay-dirclean:
-       rm -rf $(DHCP_RELAY_DIR)
-
diff --git a/obsolete-buildroot/make/diffutils.mk b/obsolete-buildroot/make/diffutils.mk
deleted file mode 100644 (file)
index 0019bd8..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-#############################################################
-#
-# diffutils
-#
-#############################################################
-DIFFUTILS_SOURCE:=diffutils-2.8.4.tar.gz
-DIFFUTILS_SITE:=ftp://alpha.gnu.org/gnu/diffutils/
-DIFFUTILS_CAT:=zcat
-DIFFUTILS_DIR:=$(BUILD_DIR)/diffutils-2.8.4
-DIFFUTILS_BINARY:=src/diff
-DIFFUTILS_TARGET_BINARY:=usr/bin/diff
-
-$(DL_DIR)/$(DIFFUTILS_SOURCE):
-        $(WGET) -P $(DL_DIR) $(DIFFUTILS_SITE)/$(DIFFUTILS_SOURCE)
-
-diffutils-source: $(DL_DIR)/$(DIFFUTILS_SOURCE)
-
-$(DIFFUTILS_DIR)/.unpacked: $(DL_DIR)/$(DIFFUTILS_SOURCE)
-       $(DIFFUTILS_CAT) $(DL_DIR)/$(DIFFUTILS_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(DIFFUTILS_DIR)/.unpacked
-
-$(DIFFUTILS_DIR)/.configured: $(DIFFUTILS_DIR)/.unpacked
-       (cd $(DIFFUTILS_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-               $(DISABLE_LARGEFILE) \
-       );
-       touch  $(DIFFUTILS_DIR)/.configured
-
-$(DIFFUTILS_DIR)/$(DIFFUTILS_BINARY): $(DIFFUTILS_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(DIFFUTILS_DIR)
-
-$(TARGET_DIR)/$(DIFFUTILS_TARGET_BINARY): $(DIFFUTILS_DIR)/$(DIFFUTILS_BINARY)
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(DIFFUTILS_DIR) install
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-
-diffutils: uclibc $(TARGET_DIR)/$(DIFFUTILS_TARGET_BINARY)
-
-diffutils-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(DIFFUTILS_DIR) uninstall
-       -$(MAKE) -C $(DIFFUTILS_DIR) clean
-
-diffutils-dirclean:
-       rm -rf $(DIFFUTILS_DIR)
-
diff --git a/obsolete-buildroot/make/dnsmasq.mk b/obsolete-buildroot/make/dnsmasq.mk
deleted file mode 100644 (file)
index 6345603..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#############################################################
-#
-# dnsmasq
-#
-#############################################################
-
-DNSMASQ_SITE=http://thekelleys.org.uk/dnsmasq
-ifeq ($(filter $(TARGETS),dnsmasq1),)
-DNSMASQ_SOURCE=dnsmasq-2.19.tar.gz
-DNSMASQ_DIR=$(BUILD_DIR)/dnsmasq-2.19
-DNSMASQ_VER=dnsmasq2
-else
-DNSMASQ_SOURCE=dnsmasq-1.18.tar.gz
-DNSMASQ_DIR=$(BUILD_DIR)/dnsmasq-1.18
-DNSMASQ_VER=dnsmasq1
-endif
-DNSMASQ_BINARY=dnsmasq
-DNSMASQ_TARGET_BINARY=usr/sbin/dnsmasq
-
-$(DL_DIR)/$(DNSMASQ_SOURCE):
-       $(WGET) -P $(DL_DIR) $(DNSMASQ_SITE)/$(DNSMASQ_SOURCE)
-
-$(DNSMASQ_DIR)/.source: $(DL_DIR)/$(DNSMASQ_SOURCE)
-       zcat $(DL_DIR)/$(DNSMASQ_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       $(SOURCE_DIR)/patch-kernel.sh $(DNSMASQ_DIR) $(SOURCE_DIR) \
-               $(DNSMASQ_VER)-*.patch
-       touch $(DNSMASQ_DIR)/.source
-
-$(DNSMASQ_DIR)/$(DNSMASQ_BINARY): $(DNSMASQ_DIR)/.source
-       $(MAKE) CC=$(TARGET_CC) CFLAGS="$(TARGET_CFLAGS)" \
-               BINDIR=/usr/sbin MANDIR=/usr/man -C $(DNSMASQ_DIR)
-
-$(TARGET_DIR)/$(DNSMASQ_TARGET_BINARY): $(DNSMASQ_DIR)/$(DNSMASQ_BINARY)
-       $(MAKE) BINDIR=/usr/sbin MANDIR=/usr/man \
-               DESTDIR=$(TARGET_DIR) -C $(DNSMASQ_DIR) install
-       $(STRIP) $(TARGET_DIR)/$(DNSMASQ_TARGET_BINARY)
-       rm -rf $(TARGET_DIR)/usr/man
-
-dnsmasq: uclibc $(TARGET_DIR)/$(DNSMASQ_TARGET_BINARY)
-
-dnsmasq1: uclibc $(TARGET_DIR)/$(DNSMASQ_TARGET_BINARY)
-
-dnsmasq-source: $(DL_DIR)/$(DNSMASQ_SOURCE)
-
-dnsmasq-clean:
-       #$(MAKE) prefix=$(TARGET_DIR)/usr -C $(DNSMASQ_DIR) uninstall
-       -$(MAKE) -C $(DNSMASQ_DIR) clean
-
-dnsmasq-dirclean:
-       rm -rf $(DNSMASQ_DIR)
diff --git a/obsolete-buildroot/make/dropbear.mk b/obsolete-buildroot/make/dropbear.mk
deleted file mode 100644 (file)
index a848a5d..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-######################################################
-#
-#  An example makefile to fetch a package from sources
-#  then fetch the ipkg updates required to the base package
-#  extract the archives into the build tree
-#  and then build the source
-#
-######################################################
-
-
-#  For this example we'll use a fairly simple package that compiles easily
-#  and has sources available for download at sourceforge
-DROPBEAR=dropbear-0.44
-DROPBEAR_TARGET=.built
-DROPBEAR_DIR=$(BUILD_DIR)/$(DROPBEAR)
-DROPBEAR_IPK=$(BUILD_DIR)/$(DROPBEAR)_mipsel.ipk
-DROPBEAR_IPK_DIR=$(BUILD_DIR)/$(DROPBEAR)-ipk
-
-DROPBEAR_SITE=http://matt.ucc.asn.au/dropbear/
-DROPBEAR_SOURCE=$(DROPBEAR).tar.bz2
-
-
-# We need to download sources if we dont have them
-$(DL_DIR)/$(DROPBEAR_SOURCE) :
-       $(WGET) -P $(DL_DIR) $(DROPBEAR_SITE)/$(DROPBEAR_SOURCE)
-
-# if we have the sources, they do no good unless they are unpacked
-$(DROPBEAR_DIR)/.unpacked:     $(DL_DIR)/$(DROPBEAR_SOURCE)
-       bzcat $(DL_DIR)/$(DROPBEAR_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       cat $(SOURCE_DIR)/openwrt/ipkg/dropbear/dropbear.patch | patch -p1 -d $(DROPBEAR_DIR)
-       touch $(DROPBEAR_DIR)/.unpacked
-       
-# if we have the sources unpacked, we need to configure them
-$(DROPBEAR_DIR)/.configured:   $(DROPBEAR_DIR)/.unpacked
-       (cd $(DROPBEAR_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               LD=$(TARGET_CROSS)gcc \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --disable-zlib \
-       );
-       touch $(DROPBEAR_DIR)/.configured
-       
-       
-# now that we have it all in place, just build it
-$(DROPBEAR_DIR)/$(DROPBEAR_TARGET):    $(DROPBEAR_DIR)/.configured
-       mkdir -p $(DROPBEAR_IPK_DIR)/usr/bin
-       cd $(DROPBEAR_DIR) && make PROGRAMS="dbclient dropbear" MULTI=1 && rm -f ssh && ln -s dbclient ssh
-       $(STAGING_DIR)/bin/sstrip $(DROPBEAR_DIR)/dropbearmulti
-       cd $(DROPBEAR_DIR) && cp -dpf dropbearmulti ssh dropbear dbclient $(DROPBEAR_IPK_DIR)/usr/bin
-       
-       cd $(DROPBEAR_DIR) && make SCPPROGRESS=1 scp
-       $(STAGING_DIR)/bin/sstrip $(DROPBEAR_DIR)/scp
-       cd $(DROPBEAR_DIR) && cp -dpf scp $(DROPBEAR_IPK_DIR)/usr/bin
-       
-       cd $(DROPBEAR_DIR) && make clean && make dropbearkey 
-       $(STAGING_DIR)/bin/sstrip $(DROPBEAR_DIR)/dropbearkey
-       mkdir -p $(DROPBEAR_IPK_DIR)/tmp
-       cd $(DROPBEAR_DIR) && cp -dpf dropbearkey $(DROPBEAR_IPK_DIR)/tmp/dropbearkey
-       touch $(DROPBEAR_DIR)/$(DROPBEAR_TARGET)
-       
-$(DROPBEAR_IPK): uclibc $(DROPBEAR_DIR)/$(DROPBEAR_TARGET)
-       mkdir -p $(DROPBEAR_IPK_DIR)/CONTROL
-       cp $(SOURCE_DIR)/openwrt/ipkg/dropbear/CONTROL/conffiles $(DROPBEAR_IPK_DIR)/CONTROL
-       cp $(SOURCE_DIR)/openwrt/ipkg/dropbear/CONTROL/control $(DROPBEAR_IPK_DIR)/CONTROL
-       cp $(SOURCE_DIR)/openwrt/ipkg/dropbear/CONTROL/postinst $(DROPBEAR_IPK_DIR)/CONTROL
-       mkdir -p $(DROPBEAR_IPK_DIR)/etc/init.d
-       cp $(SOURCE_DIR)/openwrt/ipkg/dropbear/S51dropbear $(DROPBEAR_IPK_DIR)/etc/init.d
-
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(DROPBEAR_IPK_DIR)
-
-dropbear-ipk: $(DROPBEAR_IPK)
diff --git a/obsolete-buildroot/make/ebtables.mk b/obsolete-buildroot/make/ebtables.mk
deleted file mode 100644 (file)
index 5db6cd8..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-########################################################################
-#
-# ebtables
-#
-# Utility that enables basic Ethernet frame filtering on a Linux bridge,
-# MAC NAT and brouting.
-#
-########################################################################
-
-EBTABLES_NAME=ebtables
-EBTABLES_VERSION=v2.0.6
-EBTABLES_SOURCE=$(EBTABLES_NAME)-$(EBTABLES_VERSION).tar.gz
-#EBTABLES_SOURCE_URL=http://unc.dl.sourceforge.net/sourceforge/$(EBTABLES_NAME)/
-EBTABLES_SOURCE_URL=http://aleron.dl.sourceforge.net/sourceforge/$(EBTABLES_NAME)/
-EBTABLES_BUILD_DIR=$(BUILD_DIR)/$(EBTABLES_NAME)-$(EBTABLES_VERSION)
-
-$(DL_DIR)/$(EBTABLES_SOURCE):
-        $(WGET) -P $(DL_DIR) $(EBTABLES_SOURCE_URL)/$(EBTABLES_SOURCE)
-
-$(EBTABLES_BUILD_DIR)/.unpacked: $(DL_DIR)/$(EBTABLES_SOURCE)
-       zcat $(DL_DIR)/$(EBTABLES_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(EBTABLES_BUILD_DIR)/.unpacked
-
-$(EBTABLES_BUILD_DIR)/.configured: $(EBTABLES_BUILD_DIR)/.unpacked
-       # Allow patches.  Needed for openwrt for instance.
-       $(SOURCE_DIR)/patch-kernel.sh $(LINUX_DIR)/../.. $(SOURCE_DIR) $(EBTABLES_NAME)-*.patch
-       touch  $(EBTABLES_BUILD_DIR)/.configured
-
-$(EBTABLES_BUILD_DIR)/$(EBTABLES_NAME): $(EBTABLES_BUILD_DIR)/.configured
-       $(TARGET_CONFIGURE_OPTS) \
-       $(MAKE) -C $(EBTABLES_BUILD_DIR) \
-               CC=$(TARGET_CC) CFLAGS="$(TARGET_CFLAGS)" \
-               LDFLAGS="$(TARGET_LDFLAGS)"
-
-$(TARGET_DIR)/sbin/$(EBTABLES_NAME): $(EBTABLES_BUILD_DIR)/$(EBTABLES_NAME)
-       mkdir -p $(TARGET_DIR)/sbin/
-       $(TARGET_CONFIGURE_OPTS) \
-       $(MAKE) -C $(EBTABLES_BUILD_DIR)        \
-               MANDIR=$(TARGET_DIR)/usr/share/man \
-               ETHERTYPESPATH=${D}/etc/ \
-               BINPATH=$(TARGET_DIR)/sbin/ \
-               CC=$(TARGET_CC) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               install
-       $(STRIP) $(TARGET_DIR)/sbin/$(EBTABLES_NAME)
-       rm -rf $(TARGET_DIR)/usr/share/man
-
-$(EBTABLES_NAME): $(TARGET_DIR)/sbin/$(EBTABLES_NAME) 
-
-$(EBTABLES_NAME)-source: $(DL_DIR)/$(EBTABLES_SOURCE)
-
-$(EBTABLES_NAME)-clean:
-       -$(MAKE) -C $(EBTABLES_BUILD_DIR) clean
-
-$(EBTABLES_NAME)-dirclean:
-       rm -rf $(EBTABLES_BUILD_DIR)
diff --git a/obsolete-buildroot/make/ed.mk b/obsolete-buildroot/make/ed.mk
deleted file mode 100644 (file)
index de6c3cb..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#############################################################
-#
-# ed
-#
-#############################################################
-ED_SOURCE:=ed_0.2.orig.tar.gz
-ED_PATCH:=ed_0.2-19.diff.gz
-ED_SITE:=http://ftp.debian.org/debian/pool/main/e/ed
-ED_CAT:=zcat
-ED_DIR:=$(BUILD_DIR)/ed-0.2
-ED_BINARY:=ed
-ED_TARGET_BINARY:=bin/ed
-
-$(DL_DIR)/$(ED_SOURCE):
-        $(WGET) -P $(DL_DIR) $(ED_SITE)/$(ED_SOURCE)
-
-$(DL_DIR)/$(ED_PATCH):
-        $(WGET) -P $(DL_DIR) $(ED_SITE)/$(ED_PATCH)
-
-ed-source: $(DL_DIR)/$(ED_SOURCE) $(DL_DIR)/$(ED_PATCH)
-
-$(ED_DIR)/.unpacked: $(DL_DIR)/$(ED_SOURCE) $(DL_DIR)/$(ED_PATCH)
-       $(ED_CAT) $(DL_DIR)/$(ED_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       $(SOURCE_DIR)/patch-kernel.sh $(ED_DIR) $(DL_DIR) $(ED_PATCH)
-       touch $(ED_DIR)/.unpacked
-
-$(ED_DIR)/.configured: $(ED_DIR)/.unpacked
-       (cd $(ED_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               $(DISABLE_NLS) \
-       );
-       touch  $(ED_DIR)/.configured
-
-$(ED_DIR)/$(ED_BINARY): $(ED_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(ED_DIR)
-
-$(TARGET_DIR)/$(ED_TARGET_BINARY): $(ED_DIR)/$(ED_BINARY)
-       cp -a $(ED_DIR)/$(ED_BINARY) $(TARGET_DIR)/$(ED_TARGET_BINARY)
-
-ed: uclibc $(TARGET_DIR)/$(ED_TARGET_BINARY)
-
-ed-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(ED_DIR) uninstall
-       -$(MAKE) -C $(ED_DIR) clean
-
-ed-dirclean:
-       rm -rf $(ED_DIR)
-
diff --git a/obsolete-buildroot/make/ext2root.mk b/obsolete-buildroot/make/ext2root.mk
deleted file mode 100644 (file)
index c155f8b..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#############################################################
-#
-# genext2fs to build to target ext2 filesystems
-#
-#############################################################
-GENEXT2_DIR=$(BUILD_DIR)/genext2fs-1.3
-GENEXT2_SOURCE=genext2fs_1.3.orig.tar.gz
-GENEXT2_SITE=http://ftp.debian.org/debian/pool/main/g/genext2fs
-GENEXT2_PATCH=$(SOURCE_DIR)/genext2fs.patch
-
-$(DL_DIR)/$(GENEXT2_SOURCE):
-       $(WGET) -P $(DL_DIR) $(GENEXT2_SITE)/$(GENEXT2_SOURCE)
-
-$(GENEXT2_DIR): $(DL_DIR)/$(GENEXT2_SOURCE) $(GENEXT2_PATCH)
-       zcat $(DL_DIR)/$(GENEXT2_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       mv $(GENEXT2_DIR).orig $(GENEXT2_DIR)
-       cat $(GENEXT2_PATCH) | patch -p1 -d $(GENEXT2_DIR)
-
-$(GENEXT2_DIR)/genext2fs: $(GENEXT2_DIR)
-       $(MAKE) CFLAGS="-Wall -O2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \
-               -D_FILE_OFFSET_BITS=64" -C $(GENEXT2_DIR);
-       touch -c $(GENEXT2_DIR)/genext2fs
-
-genext2fs: $(GENEXT2_DIR)/genext2fs
-
-
-
-#############################################################
-#
-# Build the ext2 root filesystem image
-#
-#############################################################
-
-# How much KB we want to add to the calculated size for slack space
-#GENEXT2_ADDTOROOTSIZE=4096
-GENEXT2_ADDTOROOTSIZE=16384
-GENEXT2_REALSIZE=$(subst total,, $(shell LANG=C du $(TARGET_DIR) -s -c -k | grep total )) 
-GENEXT2_SIZE=$(shell expr $(GENEXT2_REALSIZE) + $(GENEXT2_ADDTOROOTSIZE))
-# We currently add about 400 device nodes, so add that into the total
-GENEXT2_INODES=$(shell expr $(shell find $(TARGET_DIR) | wc -l) + 400)
-#GENEXT2_SIZE=100000
-
-ext2root: genext2fs
-       #-@find $(TARGET_DIR)/lib -type f -name \*.so\* | xargs $(STRIP)  2>/dev/null || true;
-       -@find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIP) 2>/dev/null || true;
-       $(GENEXT2_DIR)/genext2fs -i $(GENEXT2_INODES) -b $(GENEXT2_SIZE) \
-               -d $(TARGET_DIR) -q -D $(SOURCE_DIR)/device_table.txt $(IMAGE)
-
-ext2root-source: $(DL_DIR)/$(GENEXT2_SOURCE)
-
-ext2root-clean:
-       -$(MAKE) -C $(GENEXT2_DIR) clean
-
-ext2root-dirclean:
-       rm -rf $(GENEXT2_DIR)
-
diff --git a/obsolete-buildroot/make/fakeroot.mk b/obsolete-buildroot/make/fakeroot.mk
deleted file mode 100644 (file)
index f56105f..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#############################################################
-#
-# fakeroot
-#
-#############################################################
-FAKEROOT_SOURCE:=fakeroot_0.7.5.tar.gz
-FAKEROOT_SITE:=http://ftp.debian.org/debian/pool/main/f/fakeroot
-FAKEROOT_CAT:=zcat
-FAKEROOT_DIR:=$(BUILD_DIR)/fakeroot-0.7.5
-
-
-$(DL_DIR)/$(FAKEROOT_SOURCE):
-        $(WGET) -P $(DL_DIR) $(FAKEROOT_SITE)/$(FAKEROOT_SOURCE)
-
-fakeroot-source: $(DL_DIR)/$(FAKEROOT_SOURCE)
-
-$(FAKEROOT_DIR)/.unpacked: $(DL_DIR)/$(FAKEROOT_SOURCE)
-       $(FAKEROOT_CAT) $(DL_DIR)/$(FAKEROOT_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       # If using busybox getopt, make it be quiet.
-       $(SED) "s,getopt --version,getopt --version 2>/dev/null," \
-               $(FAKEROOT_DIR)/scripts/fakeroot
-       touch $(FAKEROOT_DIR)/.unpacked
-
-$(FAKEROOT_DIR)/.configured: $(FAKEROOT_DIR)/.unpacked
-       (cd $(FAKEROOT_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libdir=/usr/lib/libfakeroot \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-       );
-       touch  $(FAKEROOT_DIR)/.configured
-
-$(FAKEROOT_DIR)/faked: $(FAKEROOT_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(FAKEROOT_DIR)
-
-$(TARGET_DIR)/usr/bin/fakeroot: $(FAKEROOT_DIR)/faked
-       $(MAKE) DESTDIR=$(TARGET_DIR) -C $(FAKEROOT_DIR) install
-       -mv $(TARGET_DIR)/usr/bin/$(ARCH)-linux-faked $(TARGET_DIR)/usr/bin/faked 
-       -mv $(TARGET_DIR)/usr/bin/$(ARCH)-linux-fakeroot $(TARGET_DIR)/usr/bin/fakeroot 
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-
-fakeroot: uclibc $(TARGET_DIR)/usr/bin/fakeroot 
-
-fakeroot-clean: 
-       $(MAKE) -C $(FAKEROOT_DIR) clean
-
-fakeroot-dirclean: 
-       rm -rf $(FAKEROOT_DIR) 
-
-
diff --git a/obsolete-buildroot/make/file.mk b/obsolete-buildroot/make/file.mk
deleted file mode 100644 (file)
index e3ef381..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#############################################################
-#
-# file
-#
-#############################################################
-FILE_SOURCE:=file-4.08.tar.gz
-FILE_SITE:=ftp://ftp.astron.com/pub/file
-FILE_DIR:=$(BUILD_DIR)/file-4.08
-FILE_CAT:=zcat
-FILE_BINARY:=src/file
-FILE_TARGET_BINARY:=usr/bin/file
-
-$(DL_DIR)/$(FILE_SOURCE):
-        $(WGET) -P $(DL_DIR) $(FILE_SITE)/$(FILE_SOURCE)
-
-file-source: $(DL_DIR)/$(FILE_SOURCE)
-
-$(FILE_DIR)/.unpacked: $(DL_DIR)/$(FILE_SOURCE)
-       $(FILE_CAT) $(DL_DIR)/$(FILE_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       cat $(SOURCE_DIR)/file.patch | patch -p1 -d $(FILE_DIR)
-       touch  $(FILE_DIR)/.unpacked
-
-$(FILE_DIR)/.configured: $(FILE_DIR)/.unpacked
-       (cd $(FILE_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share/misc \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-               $(DISABLE_LARGEFILE) \
-               --disable-fsect-man5 \
-       );
-       touch  $(FILE_DIR)/.configured
-
-$(FILE_DIR)/$(FILE_BINARY): $(FILE_DIR)/.configured
-       $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(FILE_DIR)
-
-$(TARGET_DIR)/$(FILE_TARGET_BINARY): $(FILE_DIR)/$(FILE_BINARY)
-       $(MAKE) $(TARGET_CONFIGURE_OPTS) DESTDIR=$(TARGET_DIR) -C $(FILE_DIR) install
-       -($(STRIP) $(TARGET_DIR)/usr/lib/libmagic.so.*.* > /dev/null 2>&1)
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-
-file: zlib uclibc $(TARGET_DIR)/$(FILE_TARGET_BINARY)
-
-file-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(FILE_DIR) uninstall
-       -$(MAKE) -C $(FILE_DIR) clean
-
-file-dirclean:
-       rm -rf $(FILE_DIR)
-
diff --git a/obsolete-buildroot/make/findutils.mk b/obsolete-buildroot/make/findutils.mk
deleted file mode 100644 (file)
index 0a68a13..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#############################################################
-#
-# findutils
-#
-#############################################################
-FINDUTILS_SOURCE:=findutils_4.1.7.orig.tar.gz
-FINDUTILS_SITE:=http://ftp.debian.org/debian/pool/main/f/findutils
-FINDUTILS_CAT:=zcat
-FINDUTILS_DIR:=$(BUILD_DIR)/findutils-4.1.7
-FINDUTILS_BINARY:=find/find
-FINDUTILS_TARGET_BINARY:=usr/bin/find
-
-$(DL_DIR)/$(FINDUTILS_SOURCE):
-        $(WGET) -P $(DL_DIR) $(FINDUTILS_SITE)/$(FINDUTILS_SOURCE)
-
-findutils-source: $(DL_DIR)/$(FINDUTILS_SOURCE)
-
-$(FINDUTILS_DIR)/.unpacked: $(DL_DIR)/$(FINDUTILS_SOURCE)
-       $(FINDUTILS_CAT) $(DL_DIR)/$(FINDUTILS_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       mv $(FINDUTILS_DIR).orig $(FINDUTILS_DIR)
-       touch $(FINDUTILS_DIR)/.unpacked
-
-$(FINDUTILS_DIR)/.configured: $(FINDUTILS_DIR)/.unpacked
-       (cd $(FINDUTILS_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ac_cv_func_setvbuf_reversed=no \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib/locate \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var/lib \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-               $(DISABLE_LARGEFILE) \
-       );
-       touch  $(FINDUTILS_DIR)/.configured
-
-$(FINDUTILS_DIR)/$(FINDUTILS_BINARY): $(FINDUTILS_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(FINDUTILS_DIR)
-
-# This stuff is needed to work around GNU make deficiencies
-findutils-target_binary: $(FINDUTILS_DIR)/$(FINDUTILS_BINARY)
-       @if [ -L $(TARGET_DIR)/$(FINDUTILS_TARGET_BINARY) ] ; then \
-               rm -f $(TARGET_DIR)/$(FINDUTILS_TARGET_BINARY); fi;
-       @if [ ! -f $(FINDUTILS_DIR)/$(FINDUTILS_BINARY) -o $(TARGET_DIR)/$(FINDUTILS_TARGET_BINARY) \
-       -ot $(FINDUTILS_DIR)/$(FINDUTILS_BINARY) ] ; then \
-           set -x; \
-           $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(FINDUTILS_DIR) install; \
-           $(STRIP) $(TARGET_DIR)/usr/lib/locate/* > /dev/null 2>&1; \
-           rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc; fi;
-
-findutils: uclibc findutils-target_binary
-
-findutils-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(FINDUTILS_DIR) uninstall
-       -$(MAKE) -C $(FINDUTILS_DIR) clean
-
-findutils-dirclean:
-       rm -rf $(FINDUTILS_DIR)
-
diff --git a/obsolete-buildroot/make/flex.mk b/obsolete-buildroot/make/flex.mk
deleted file mode 100644 (file)
index a29fa58..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#############################################################
-#
-# flex
-#
-#############################################################
-FLEX_SOURCE:=flex_2.5.4a.orig.tar.gz
-FLEX_PATCH:=flex_2.5.4a-24.diff.gz
-FLEX_SITE:=http://ftp.debian.org/debian/pool/main/f/flex
-FLEX_DIR:=$(BUILD_DIR)/flex-2.5.4
-FLEX_CAT:=zcat
-FLEX_BINARY:=flex
-FLEX_TARGET_BINARY:=usr/bin/flex
-
-$(DL_DIR)/$(FLEX_SOURCE):
-        $(WGET) -P $(DL_DIR) $(FLEX_SITE)/$(FLEX_SOURCE)
-
-$(DL_DIR)/$(FLEX_PATCH):
-        $(WGET) -P $(DL_DIR) $(FLEX_SITE)/$(FLEX_PATCH)
-
-flex-source: $(DL_DIR)/$(FLEX_SOURCE) $(DL_DIR)/$(FLEX_PATCH)
-
-$(FLEX_DIR)/.unpacked: $(DL_DIR)/$(FLEX_SOURCE) $(DL_DIR)/$(FLEX_PATCH)
-       $(FLEX_CAT) $(DL_DIR)/$(FLEX_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       #$(SOURCE_DIR)/patch-kernel.sh $(FLEX_DIR) $(DL_DIR) $(FLEX_PATCH)
-       touch $(FLEX_DIR)/.unpacked
-
-$(FLEX_DIR)/.configured: $(FLEX_DIR)/.unpacked
-       (cd $(FLEX_DIR); autoconf; rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-               $(DISABLE_LARGEFILE) \
-       );
-       touch  $(FLEX_DIR)/.configured
-
-$(FLEX_DIR)/$(FLEX_BINARY): $(FLEX_DIR)/.configured
-       $(MAKE) -C $(FLEX_DIR)
-
-$(TARGET_DIR)/$(FLEX_TARGET_BINARY): $(FLEX_DIR)/$(FLEX_BINARY)
-       $(MAKE) \
-           prefix=$(TARGET_DIR)/usr \
-           exec_prefix=$(TARGET_DIR)/usr \
-           bindir=$(TARGET_DIR)/usr/bin \
-           sbindir=$(TARGET_DIR)/usr/sbin \
-           libexecdir=$(TARGET_DIR)/usr/lib \
-           datadir=$(TARGET_DIR)/usr/share \
-           sysconfdir=$(TARGET_DIR)/etc \
-           sharedstatedir=$(TARGET_DIR)/usr/com \
-           localstatedir=$(TARGET_DIR)/var \
-           libdir=$(TARGET_DIR)/usr/lib \
-           infodir=$(TARGET_DIR)/usr/info \
-           mandir=$(TARGET_DIR)/usr/man \
-           includedir=$(TARGET_DIR)/usr/include \
-           -C $(FLEX_DIR) install;
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-       (cd $(TARGET_DIR)/usr/bin; ln -s flex lex)
-
-flex: uclibc $(TARGET_DIR)/$(FLEX_TARGET_BINARY)
-
-flex-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) -C $(FLEX_DIR) uninstall
-       -$(MAKE) -C $(FLEX_DIR) clean
-
-flex-dirclean:
-       rm -rf $(FLEX_DIR)
-
diff --git a/obsolete-buildroot/make/fprobe.mk b/obsolete-buildroot/make/fprobe.mk
deleted file mode 100644 (file)
index 409029c..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-## fprobe
-
-FPROBE_VERSION:=1.0.5
-FPROBE_RELEASE:=1
-
-FPROBE_SOURCE:=fprobe-$(FPROBE_VERSION).tar.bz2
-FPROBE_SITE:=http://dl.sourceforge.net/sourceforge/fprobe/
-FPROBE_DIR:=$(BUILD_DIR)/fprobe-$(FPROBE_VERSION)
-FPROBE_CAT:=bzcat
-
-FPROBE_PATCH_DIR := $(SOURCE_DIR)/openwrt/patches/fprobe
-
-FPROBE_BUILD_DIR := $(BUILD_DIR)/fprobe_$(FPROBE_VERSION)-$(FPROBE_RELEASE)
-FPROBE_IPK_DIR := $(OPENWRT_IPK_DIR)/fprobe
-FPROBE_IPK := $(FPROBE_BUILD_DIR)_$(ARCH).ipk
-
-
-$(DL_DIR)/$(FPROBE_SOURCE):
-        $(WGET) -P $(DL_DIR) $(FPROBE_SITE)/$(FPROBE_SOURCE)
-
-
-$(FPROBE_DIR)/.stamp-unpacked: $(DL_DIR)/$(FPROBE_SOURCE)
-       $(FPROBE_CAT) $(DL_DIR)/$(FPROBE_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-
-       touch $(FPROBE_DIR)/.stamp-unpacked
-
-
-$(FPROBE_DIR)/.stamp-configured: $(FPROBE_DIR)/.stamp-unpacked
-       cd $(FPROBE_DIR) ; \
-       rm -rf config.cache ; \
-       $(TARGET_CONFIGURE_OPTS) \
-       CFLAGS="$(TARGET_CFLAGS)" \
-       ./configure \
-         --target=$(GNU_TARGET_NAME) \
-         --host=$(GNU_TARGET_NAME) \
-         --build=$(GNU_HOST_NAME) \
-         --prefix=/usr \
-         --exec-prefix=/usr \
-         --bindir=/usr/bin \
-         --sbindir=/usr/sbin \
-         --libexecdir=/usr/lib/locate \
-         --sysconfdir=/etc \
-         --datadir=/usr/share \
-         --localstatedir=/var/lib \
-         --mandir=/usr/share/man \
-         --infodir=/usr/share/info \
-         --includedir=/usr/include \
-         --libdir=/usr/lib \
-         $(DISABLE_NLS) \
-         --with-membulk=index8 \
-         --with-hash=xor8
-
-       touch $(FPROBE_DIR)/.stamp-configured
-
-
-$(FPROBE_DIR)/.stamp-built: $(FPROBE_DIR)/.stamp-configured
-       cd $(FPROBE_DIR) ; \
-       $(MAKE) \
-         CC=$(TARGET_CC) \
-
-       touch $(FPROBE_DIR)/.stamp-built
-
-
-$(FPROBE_DIR)/.stamp-installed: $(FPROBE_DIR)/.stamp-built
-       mkdir -p $(FPROBE_BUILD_DIR)
-       cd $(FPROBE_DIR) ; \
-       $(MAKE) \
-         DESTDIR="$(FPROBE_BUILD_DIR)" \
-        install \
-        
-       install -m0755 -d $(FPROBE_BUILD_DIR)/etc
-       install -m0644 $(FPROBE_IPK_DIR)/root/etc/fprobe.conf $(FPROBE_BUILD_DIR)/etc/
-
-       install -m0755 -d $(FPROBE_BUILD_DIR)/etc/init.d
-       install -m0755 $(FPROBE_IPK_DIR)/root/etc/init.d/fprobe $(FPROBE_BUILD_DIR)/etc/init.d/
-
-       rm -rf $(FPROBE_BUILD_DIR)/usr/share
-
-       $(STRIP) $(FPROBE_BUILD_DIR)/usr/sbin/*
-       
-       touch $(FPROBE_DIR)/.stamp-installed
-
-
-$(FPROBE_IPK): $(FPROBE_DIR)/.stamp-installed
-       cp -a $(FPROBE_IPK_DIR)/CONTROL $(FPROBE_BUILD_DIR)/
-       perl -pi -e "s/^Vers.*:.*$$/Version: $(FPROBE_VERSION)-$(FPROBE_RELEASE)/" $(FPROBE_BUILD_DIR)/CONTROL/control
-       perl -pi -e "s/^Arch.*:.*$$/Architecture: $(ARCH)/" $(FPROBE_BUILD_DIR)/CONTROL/control
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(FPROBE_BUILD_DIR)
-
-
-fprobe-source: $(DL_DIR)/$(FPROBE_SOURCE)
-
-fprobe-ipk: ipkg-utils libpcap-ipk $(FPROBE_IPK)
-
-fprobe-clean:
-       $(MAKE) -C $(FPROBE_DIR) clean
-
-fprobe-clean-all:
-       rm -rf $(FPROBE_DIR)
-       rm -rf $(FPROBE_BUILD_DIR)
-       rm -rf $(FPROBE_IPK)
diff --git a/obsolete-buildroot/make/gawk.mk b/obsolete-buildroot/make/gawk.mk
deleted file mode 100644 (file)
index 523b047..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#############################################################
-#
-# gawk
-#
-#############################################################
-GAWK_SOURCE:=gawk-3.1.2.tar.gz
-GAWK_SITE:=ftp://ftp.gnu.org/gnu/gawk
-GAWK_CAT:=zcat
-GAWK_DIR:=$(BUILD_DIR)/gawk-3.1.2
-GAWK_BINARY:=gawk
-GAWK_TARGET_BINARY:=usr/bin/gawk
-
-$(DL_DIR)/$(GAWK_SOURCE):
-        $(WGET) -P $(DL_DIR) $(GAWK_SITE)/$(GAWK_SOURCE)
-
-gawk-source: $(DL_DIR)/$(GAWK_SOURCE)
-
-$(GAWK_DIR)/.unpacked: $(DL_DIR)/$(GAWK_SOURCE)
-       $(GAWK_CAT) $(DL_DIR)/$(GAWK_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(GAWK_DIR)/.unpacked
-
-$(GAWK_DIR)/.configured: $(GAWK_DIR)/.unpacked
-       (cd $(GAWK_DIR); rm -rf config.cache; autoconf; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ac_cv_func_getpgrp_void=yes \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-               $(DISABLE_LARGEFILE) \
-       );
-       touch  $(GAWK_DIR)/.configured
-
-$(GAWK_DIR)/$(GAWK_BINARY): $(GAWK_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(GAWK_DIR)
-
-$(TARGET_DIR)/$(GAWK_TARGET_BINARY): $(GAWK_DIR)/$(GAWK_BINARY)
-       rm -f $(TARGET_DIR)/usr/bin/awk
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(GAWK_DIR) install
-       rm -f $(TARGET_DIR)/usr/bin/gawk-*
-       (cd $(TARGET_DIR)/usr/bin; ln -sf gawk awk) 
-       $(STRIP) $(TARGET_DIR)/usr/lib/awk/* > /dev/null 2>&1
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-
-gawk: uclibc $(TARGET_DIR)/$(GAWK_TARGET_BINARY)
-
-gawk-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(GAWK_DIR) uninstall
-       -$(MAKE) -C $(GAWK_DIR) clean
-
-gawk-dirclean:
-       rm -rf $(GAWK_DIR)
-
diff --git a/obsolete-buildroot/make/gcc-uclibc-2.95.mk b/obsolete-buildroot/make/gcc-uclibc-2.95.mk
deleted file mode 100644 (file)
index 9294b53..0000000
+++ /dev/null
@@ -1,276 +0,0 @@
-# Makefile for to build a gcc/uClibc toolchain
-#
-# Copyright (C) 2002-2003 Erik Andersen <andersen@uclibc.org>
-# Copyright (C) 2004 Manuel Novoa III <mjn3@uclibc.org>
-#
-# 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, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-ifeq ($(GCC_2_95_TOOLCHAIN),true)
-
-GCC_SITE:=http://www.uclibc.org/downloads/toolchain
-GCC_SOURCE:=gcc-20011006.tar.bz2
-GCC_DIR:=$(TOOL_BUILD_DIR)/gcc-20011006
-GCC_CAT:=bzcat
-
-STLPORT_SITE=http://www.stlport.org/archive
-STLPORT_SOURCE=STLport-4.5.3.tar.gz
-STLPORT_DIR=$(TOOL_BUILD_DIR)/STLport-4.5.3
-GCC_STRIP_HOST_BINARIES:=true
-
-#############################################################
-#
-# Setup some initial stuff
-#
-#############################################################
-
-ifeq ($(INSTALL_LIBSTDCPP),true)
-TARGET_LANGUAGES:=c,c++
-STLPORT_TARGET=stlport
-else
-TARGET_LANGUAGES:=c
-STLPORT_TARGET=
-endif
-
-#############################################################
-#
-# build the first pass gcc compiler
-#
-#############################################################
-GCC_BUILD_DIR1:=$(TOOL_BUILD_DIR)/gcc2_95-initial
-
-$(DL_DIR)/$(GCC_SOURCE):
-       $(WGET) -P $(DL_DIR) $(GCC_SITE)/$(GCC_SOURCE)
-
-$(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
-       $(GCC_CAT) $(DL_DIR)/$(GCC_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf -
-       touch $(GCC_DIR)/.unpacked
-
-$(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked
-       # Apply any files named gcc-*.patch from the source directory to gcc
-       $(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) $(SOURCE_DIR) gcc2.95-mega.patch.bz2
-       $(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) $(SOURCE_DIR) gcc2.95-uclibc-conf.patch
-       #$(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) $(SOURCE_DIR) gcc-uclibc2_95*.patch
-       #
-       # We do not wish to build the libstdc++ library provided with gcc,
-       # since it doesn't seem to work at all with uClibc plus gcc 2.95...
-       #
-       mv $(GCC_DIR)/libstdc++ $(GCC_DIR)/libstdc++.orig
-       mv $(GCC_DIR)/libio $(GCC_DIR)/libio.orig
-       #
-       touch $(GCC_DIR)/.patched
-
-# The --without-headers option stopped working with gcc 3.0 and has never been
-# # fixed, so we need to actually have working C library header files prior to
-# # the step or libgcc will not build...
-$(GCC_BUILD_DIR1)/.configured: $(GCC_DIR)/.patched
-       mkdir -p $(GCC_BUILD_DIR1)
-       -mkdir -p $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/include
-       # Important!  Required for limits.h to be fixed.
-       ln -sf include $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include
-       (cd $(GCC_BUILD_DIR1); PATH=$(TARGET_PATH) \
-               $(GCC_DIR)/configure \
-               --prefix=$(STAGING_DIR) \
-               --build=$(GNU_HOST_NAME) \
-               --host=$(GNU_HOST_NAME) \
-               --target=$(REAL_GNU_TARGET_NAME) \
-               --enable-languages=c \
-               --disable-shared \
-               --includedir=$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/include \
-               --with-headers=$(TOOL_BUILD_DIR)/uClibc_dev/usr/include \
-               --disable-__cxa_atexit \
-               --enable-target-optspace \
-               --with-gnu-ld \
-               $(DISABLE_NLS) \
-               $(MULTILIB) \
-               $(SOFT_FLOAT_CONFIG_OPTION) \
-               $(EXTRA_GCC_CONFIG_OPTIONS));
-       touch $(GCC_BUILD_DIR1)/.configured
-
-$(GCC_BUILD_DIR1)/.compiled: $(GCC_BUILD_DIR1)/.configured
-       PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR1) all-gcc
-       touch $(GCC_BUILD_DIR1)/.compiled
-
-$(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc: $(GCC_BUILD_DIR1)/.compiled
-       PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR1) install-gcc
-       #rm -f $(STAGING_DIR)/bin/gccbug $(STAGING_DIR)/bin/gcov
-       #rm -rf $(STAGING_DIR)/info $(STAGING_DIR)/man $(STAGING_DIR)/share/doc $(STAGING_DIR)/share/locale
-
-gcc2_95_initial: uclibc-configured binutils $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc
-
-gcc2_95_initial-clean:
-       rm -rf $(GCC_BUILD_DIR1)
-       rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
-
-gcc2_95_initial-dirclean:
-       rm -rf $(GCC_BUILD_DIR1)
-
-#############################################################
-#
-# STLport -- an alternative C++ library
-#
-#############################################################
-STLPORT_PATCH=$(SOURCE_DIR)/STLport-4.5.3.patch
-
-$(DL_DIR)/$(STLPORT_SOURCE):
-       $(WGET) -P $(DL_DIR) $(STLPORT_SITE)/$(STLPORT_SOURCE)
-
-$(STLPORT_DIR)/Makefile: $(DL_DIR)/$(STLPORT_SOURCE) $(STLPORT_PATCH)
-       zcat $(DL_DIR)/$(STLPORT_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf - 
-       cat $(STLPORT_PATCH) | patch -d $(STLPORT_DIR) -p1
-
-$(STLPORT_DIR)/lib/libstdc++.a: $(STLPORT_DIR)/Makefile
-       $(MAKE) ARCH=$(OPTIMIZE_FOR_CPU) PREFIX=$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME) -C $(STLPORT_DIR)
-
-$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libstdc++.a: $(STLPORT_DIR)/lib/libstdc++.a
-       $(MAKE) ARCH=$(OPTIMIZE_FOR_CPU) PREFIX=$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME) -C $(STLPORT_DIR) install
-
-stlport: $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libstdc++.a
-
-stlport-source: $(DL_DIR)/$(STLPORT_SOURCE)
-
-stlport-clean:
-       rm -f $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libstdc++*
-       rm -f $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/include/c++*
-       -$(MAKE) -C $(STLPORT_DIR) clean
-
-stlport-dirclean:
-       rm -f $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libstdc++*
-       rm -f $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/include/g++-v3*
-       rm -rf $(STLPORT_DIR)
-
-#############################################################
-#
-# second pass compiler build.  Build the compiler targeting 
-# the newly built shared uClibc library.
-#
-#############################################################
-GCC_BUILD_DIR2:=$(TOOL_BUILD_DIR)/gcc2_95-final
-
-$(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.patched $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libc.a
-       mkdir -p $(GCC_BUILD_DIR2)
-       (cd $(GCC_BUILD_DIR2); PATH=$(TARGET_PATH) \
-               $(GCC_DIR)/configure \
-               --prefix=$(STAGING_DIR) \
-               --build=$(GNU_HOST_NAME) \
-               --host=$(GNU_HOST_NAME) \
-               --target=$(REAL_GNU_TARGET_NAME) \
-               --enable-languages=$(TARGET_LANGUAGES) \
-               --enable-shared \
-               --with-gxx-include-dir=$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/include/c++ \
-               --disable-__cxa_atexit \
-               --enable-target-optspace \
-               --with-gnu-ld \
-               $(DISABLE_NLS) \
-               $(MULTILIB) \
-               $(SOFT_FLOAT_CONFIG_OPTION) \
-               $(EXTRA_GCC_CONFIG_OPTIONS));
-       touch $(GCC_BUILD_DIR2)/.configured
-
-$(GCC_BUILD_DIR2)/.compiled: $(GCC_BUILD_DIR2)/.configured
-       PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR2) all
-       touch $(GCC_BUILD_DIR2)/.compiled
-
-$(GCC_BUILD_DIR2)/.installed: $(GCC_BUILD_DIR2)/.compiled
-       PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR2) install
-       # Strip the host binaries
-ifeq ($(GCC_STRIP_HOST_BINARIES),true)
-       -strip --strip-all -R .note -R .comment $(STAGING_DIR)/bin/*
-endif
-       # Set up the symlinks to enable lying about target name.
-       set -e; \
-       (cd $(STAGING_DIR); \
-               ln -sf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \
-               cd bin; \
-               for app in $(REAL_GNU_TARGET_NAME)-* ; do \
-                       ln -sf $${app} \
-                       $(GNU_TARGET_NAME)$${app##$(REAL_GNU_TARGET_NAME)}; \
-               done; \
-       );
-       touch $(GCC_BUILD_DIR2)/.installed
-
-gcc2_95: uclibc-configured binutils gcc2_95_initial $(LIBFLOAT_TARGET) uclibc \
-       $(GCC_BUILD_DIR2)/.installed $(GCC_TARGETS) $(STLPORT_TARGET)
-
-gcc2_95-source: $(DL_DIR)/$(GCC_SOURCE)
-
-gcc2_95-clean:
-       rm -rf $(GCC_BUILD_DIR2)
-       rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
-
-gcc2_95-dirclean:
-       rm -rf $(GCC_BUILD_DIR2)
-
-#############################################################
-#
-# Next build target gcc compiler
-#
-#############################################################
-GCC_BUILD_DIR3:=$(BUILD_DIR)/gcc2_95-target
-
-$(GCC_BUILD_DIR3)/.configured: $(GCC_BUILD_DIR2)/.installed
-       mkdir -p $(GCC_BUILD_DIR3)
-       (cd $(GCC_BUILD_DIR3); PATH=$(TARGET_PATH) \
-               $(GCC_DIR)/configure \
-               --prefix=/usr \
-               --build=$(GNU_HOST_NAME) \
-               --host=$(REAL_GNU_TARGET_NAME) \
-               --target=$(REAL_GNU_TARGET_NAME) \
-               --enable-languages=$(TARGET_LANGUAGES) \
-               --enable-shared \
-               --with-gxx-include-dir=/usr/include/c++ \
-               --disable-__cxa_atexit \
-               --enable-target-optspace \
-               --with-gnu-ld \
-               $(DISABLE_NLS) \
-               $(MULTILIB) \
-               $(SOFT_FLOAT_CONFIG_OPTION) \
-               $(EXTRA_GCC_CONFIG_OPTIONS));
-       touch $(GCC_BUILD_DIR3)/.configured
-
-$(GCC_BUILD_DIR3)/.compiled: $(GCC_BUILD_DIR3)/.configured
-       PATH=$(TARGET_PATH) \
-       $(MAKE) $(JLEVEL) $(TARGET_GCC_ARGS) -C $(GCC_BUILD_DIR3) all
-       touch $(GCC_BUILD_DIR3)/.compiled
-
-$(TARGET_DIR)/usr/bin/gcc: $(GCC_BUILD_DIR3)/.compiled
-       PATH=$(TARGET_PATH) \
-       $(MAKE) $(JLEVEL) DESTDIR=$(TARGET_DIR) -C $(GCC_BUILD_DIR3) install
-       # Remove broken specs file (cross compile flag is set).
-       rm -f $(TARGET_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs
-       -(cd $(TARGET_DIR)/bin; find -type f | xargs $(STRIP) > /dev/null 2>&1)
-       -(cd $(TARGET_DIR)/usr/bin; find -type f | xargs $(STRIP) > /dev/null 2>&1)
-       -(cd $(TARGET_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION); $(STRIP) cc1 cc1plus collect2 > /dev/null 2>&1)
-       -(cd $(TARGET_DIR)/usr/lib; $(STRIP) libstdc++.so.*.*.* > /dev/null 2>&1)
-       -(cd $(TARGET_DIR)/lib; $(STRIP) libgcc_s.so.*.*.* > /dev/null 2>&1)
-       #
-       rm -f $(TARGET_DIR)/usr/lib/*.la*
-       #rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-       #       $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-       # Work around problem of missing syslimits.h
-       cp -f $(STAGING_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/include/syslimits.h $(TARGET_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/include/
-       # These are in /lib, so...
-       #rm -rf $(TARGET_DIR)/usr/lib/libgcc_s.so*
-       #touch -c $(TARGET_DIR)/usr/bin/gcc
-
-gcc2_95_target: uclibc_target binutils_target $(TARGET_DIR)/usr/bin/gcc
-
-gcc2_95_target-clean:
-       rm -rf $(GCC_BUILD_DIR3)
-       rm -f $(TARGET_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
-
-gcc2_95_target-dirclean:
-       rm -rf $(GCC_BUILD_DIR3)
-
-endif
diff --git a/obsolete-buildroot/make/gcc-uclibc-3.3.mk b/obsolete-buildroot/make/gcc-uclibc-3.3.mk
deleted file mode 100644 (file)
index b3795e6..0000000
+++ /dev/null
@@ -1,267 +0,0 @@
-# Makefile for to build a gcc/uClibc toolchain
-#
-# Copyright (C) 2002-2003 Erik Andersen <andersen@uclibc.org>
-# Copyright (C) 2004 Manuel Novoa III <mjn3@uclibc.org>
-#
-# 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, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-ifneq ($(GCC_2_95_TOOLCHAIN),true)
-
-# Shiny new stuff...
-GCC_VERSION:=3.3.3
-GCC_SITE:=ftp://ftp.gnu.org/gnu/gcc/releases/gcc-$(GCC_VERSION)
-#GCC_SITE:=http://www.binarycode.org/gcc/releases/gcc-$(GCC_VERSION)
-#GCC_SITE:=http://gcc.get-software.com/releases/gcc-$(GCC_VERSION)
-
-#
-# snapshots....
-#GCC_VERSION:=3.3-20031013
-#GCC_SITE:=http://gcc.get-software.com/snapshots/$(GCC_VERSION)
-#
-GCC_SOURCE:=gcc-$(GCC_VERSION).tar.bz2
-GCC_DIR:=$(TOOL_BUILD_DIR)/gcc-$(GCC_VERSION)
-GCC_CAT:=bzcat
-GCC_STRIP_HOST_BINARIES:=true
-
-#############################################################
-#
-# Setup some initial stuff
-#
-#############################################################
-
-ifeq ($(INSTALL_LIBGCJ),true)
-TARGET_LANGUAGES:=c,c++,java
-else
-ifeq ($(INSTALL_LIBSTDCPP),true)
-TARGET_LANGUAGES:=c,c++
-else
-TARGET_LANGUAGES:=c
-endif
-endif
-
-#############################################################
-#
-# build the first pass gcc compiler
-#
-#############################################################
-GCC_BUILD_DIR1:=$(TOOL_BUILD_DIR)/gcc-3.3-initial
-
-$(DL_DIR)/$(GCC_SOURCE):
-       $(WGET) -P $(DL_DIR) $(GCC_SITE)/$(GCC_SOURCE)
-
-$(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
-       $(GCC_CAT) $(DL_DIR)/$(GCC_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf -
-       touch $(GCC_DIR)/.unpacked
-
-$(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked
-       # Apply any files named gcc-*.patch from the source directory to gcc
-       $(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) $(SOURCE_DIR) gcc3.3-mega.patch.bz2
-       $(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) $(SOURCE_DIR) gcc-uclibc-3.3*.patch
-ifeq ($(SOFT_FLOAT),true)
-ifeq ("$(strip $(ARCH))","i386")
-       $(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) $(SOURCE_DIR) i386-gcc-soft-float.patch
-endif
-endif
-       touch $(GCC_DIR)/.patched
-
-# The --without-headers option stopped working with gcc 3.0 and has never been
-# # fixed, so we need to actually have working C library header files prior to
-# # the step or libgcc will not build...
-$(GCC_BUILD_DIR1)/.configured: $(GCC_DIR)/.patched
-       mkdir -p $(GCC_BUILD_DIR1)
-       -mkdir -p $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/include
-       (cd $(GCC_BUILD_DIR1); PATH=$(TARGET_PATH) \
-               $(GCC_DIR)/configure \
-               --prefix=$(STAGING_DIR) \
-               --build=$(GNU_HOST_NAME) \
-               --host=$(GNU_HOST_NAME) \
-               --target=$(REAL_GNU_TARGET_NAME) \
-               --enable-languages=c \
-               --disable-shared \
-               --includedir=$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/include \
-               --with-sysroot=$(TOOL_BUILD_DIR)/uClibc_dev/ \
-               --disable-__cxa_atexit \
-               --enable-target-optspace \
-               --with-gnu-ld \
-               $(DISABLE_NLS) \
-               $(MULTILIB) \
-               $(SOFT_FLOAT_CONFIG_OPTION) \
-               $(EXTRA_GCC_CONFIG_OPTIONS));
-       touch $(GCC_BUILD_DIR1)/.configured
-
-$(GCC_BUILD_DIR1)/.compiled: $(GCC_BUILD_DIR1)/.configured
-       PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR1) all-gcc
-       touch $(GCC_BUILD_DIR1)/.compiled
-
-$(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc: $(GCC_BUILD_DIR1)/.compiled
-       PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR1) install-gcc
-       #rm -f $(STAGING_DIR)/bin/gccbug $(STAGING_DIR)/bin/gcov
-       #rm -rf $(STAGING_DIR)/info $(STAGING_DIR)/man $(STAGING_DIR)/share/doc $(STAGING_DIR)/share/locale
-
-gcc3_3_initial: uclibc-configured binutils $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc
-
-gcc3_3_initial-clean:
-       rm -rf $(GCC_BUILD_DIR1)
-       rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
-
-gcc3_3_initial-dirclean:
-       rm -rf $(GCC_BUILD_DIR1)
-
-#############################################################
-#
-# second pass compiler build.  Build the compiler targeting 
-# the newly built shared uClibc library.
-#
-#############################################################
-GCC_BUILD_DIR2:=$(TOOL_BUILD_DIR)/gcc-3.3-final
-$(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.patched $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libc.a
-       mkdir -p $(GCC_BUILD_DIR2)
-       # Important!  Required for limits.h to be fixed.
-       ln -sf include $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include
-       (cd $(GCC_BUILD_DIR2); PATH=$(TARGET_PATH) \
-               $(GCC_DIR)/configure \
-               --prefix=$(STAGING_DIR) \
-               --build=$(GNU_HOST_NAME) \
-               --host=$(GNU_HOST_NAME) \
-               --target=$(REAL_GNU_TARGET_NAME) \
-               --enable-languages=$(TARGET_LANGUAGES) \
-               --enable-shared \
-               --with-gxx-include-dir=$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/include/c++ \
-               --disable-__cxa_atexit \
-               --enable-target-optspace \
-               --with-gnu-ld \
-               $(DISABLE_NLS) \
-               $(MULTILIB) \
-               $(SOFT_FLOAT_CONFIG_OPTION) \
-               $(GCC_USE_SJLJ_EXCEPTIONS) \
-               $(EXTRA_GCC_CONFIG_OPTIONS));
-       touch $(GCC_BUILD_DIR2)/.configured
-
-$(GCC_BUILD_DIR2)/.compiled: $(GCC_BUILD_DIR2)/.configured
-       PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR2) all
-       touch $(GCC_BUILD_DIR2)/.compiled
-
-$(GCC_BUILD_DIR2)/.installed: $(GCC_BUILD_DIR2)/.compiled
-       PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR2) install
-       # Strip the host binaries
-ifeq ($(GCC_STRIP_HOST_BINARIES),true)
-       -strip --strip-all -R .note -R .comment $(STAGING_DIR)/bin/*
-endif
-       # Set up the symlinks to enable lying about target name.
-       set -e; \
-       (cd $(STAGING_DIR); \
-               ln -sf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \
-               cd bin; \
-               for app in $(REAL_GNU_TARGET_NAME)-* ; do \
-                       ln -sf $${app} \
-                       $(GNU_TARGET_NAME)$${app##$(REAL_GNU_TARGET_NAME)}; \
-               done; \
-       );
-ifeq ($(SOFT_FLOAT),true)
-       # Replace specs file with one that defaults to soft float mode.
-       if [ ! -f $(STAGING_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs ] ; then \
-               echo staging dir specs file is missing ; \
-               /bin/false ; \
-       fi;
-       cp $(SOURCE_DIR)/specs-$(ARCH)-soft-float $(STAGING_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs
-endif
-       touch $(GCC_BUILD_DIR2)/.installed
-
-gcc3_3: uclibc-configured binutils gcc3_3_initial $(LIBFLOAT_TARGET) uclibc \
-       $(GCC_BUILD_DIR2)/.installed $(GCC_TARGETS)
-
-gcc3_3-source: $(DL_DIR)/$(GCC_SOURCE)
-
-gcc3_3-clean:
-       rm -rf $(GCC_BUILD_DIR2)
-       rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
-
-gcc3_3-dirclean:
-       rm -rf $(GCC_BUILD_DIR2)
-
-#############################################################
-#
-# Next build target gcc compiler
-#
-#############################################################
-GCC_BUILD_DIR3:=$(BUILD_DIR)/gcc-3.3-target
-
-$(GCC_BUILD_DIR3)/.configured: $(GCC_BUILD_DIR2)/.installed
-       mkdir -p $(GCC_BUILD_DIR3)
-       (cd $(GCC_BUILD_DIR3); PATH=$(TARGET_PATH) \
-               $(GCC_DIR)/configure \
-               --prefix=/usr \
-               --build=$(GNU_HOST_NAME) \
-               --host=$(REAL_GNU_TARGET_NAME) \
-               --target=$(REAL_GNU_TARGET_NAME) \
-               --enable-languages=$(TARGET_LANGUAGES) \
-               --enable-shared \
-               --with-gxx-include-dir=/usr/include/c++ \
-               --disable-__cxa_atexit \
-               --enable-target-optspace \
-               --with-gnu-ld \
-               $(DISABLE_NLS) \
-               $(MULTILIB) \
-               $(SOFT_FLOAT_CONFIG_OPTION) \
-               $(GCC_USE_SJLJ_EXCEPTIONS) \
-               $(EXTRA_GCC_CONFIG_OPTIONS));
-       touch $(GCC_BUILD_DIR3)/.configured
-
-$(GCC_BUILD_DIR3)/.compiled: $(GCC_BUILD_DIR3)/.configured
-       PATH=$(TARGET_PATH) \
-       $(MAKE) $(JLEVEL) $(TARGET_GCC_ARGS) -C $(GCC_BUILD_DIR3) all
-       touch $(GCC_BUILD_DIR3)/.compiled
-
-$(TARGET_DIR)/usr/bin/gcc: $(GCC_BUILD_DIR3)/.compiled
-       PATH=$(TARGET_PATH) \
-       $(MAKE) $(JLEVEL) DESTDIR=$(TARGET_DIR) -C $(GCC_BUILD_DIR3) install
-ifeq ($(SOFT_FLOAT),true)
-       # Replace specs file with one that defaults to soft float mode.
-       if [ ! -f $(TARGET_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs ] ; then \
-               echo target dir specs file is missing ; \
-               /bin/false ; \
-       fi;
-       cp $(SOURCE_DIR)/specs-$(ARCH)-soft-float $(TARGET_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs
-       # Make sure gcc does not think we are cross compiling
-       $(SED) "s/^1/0/;" $(TARGET_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs
-else
-       # Remove broken specs file (cross compile flag is set).
-       rm -f $(TARGET_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs
-endif
-       -(cd $(TARGET_DIR)/bin; find -type f | xargs $(STRIP) > /dev/null 2>&1)
-       -(cd $(TARGET_DIR)/usr/bin; find -type f | xargs $(STRIP) > /dev/null 2>&1)
-       -(cd $(TARGET_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION); $(STRIP) cc1 cc1plus collect2 > /dev/null 2>&1)
-       -(cd $(TARGET_DIR)/usr/lib; $(STRIP) libstdc++.so.*.*.* > /dev/null 2>&1)
-       -(cd $(TARGET_DIR)/lib; $(STRIP) libgcc_s.so.*.*.* > /dev/null 2>&1)
-       #
-       rm -f $(TARGET_DIR)/usr/lib/*.la*
-       #rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-       #       $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-       # Work around problem of missing syslimits.h
-       cp -f $(STAGING_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/include/syslimits.h $(TARGET_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/include/
-       # These are in /lib, so...
-       #rm -rf $(TARGET_DIR)/usr/lib/libgcc_s.so*
-       #touch -c $(TARGET_DIR)/usr/bin/gcc
-
-gcc3_3_target: uclibc_target binutils_target $(TARGET_DIR)/usr/bin/gcc
-
-gcc3_3_target-clean:
-       rm -rf $(GCC_BUILD_DIR3)
-       rm -f $(TARGET_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
-
-gcc3_3_target-dirclean:
-       rm -rf $(GCC_BUILD_DIR3)
-
-endif
diff --git a/obsolete-buildroot/make/gdb.mk b/obsolete-buildroot/make/gdb.mk
deleted file mode 100644 (file)
index 59a08be..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-#############################################################
-#
-# gdb
-#
-#############################################################
-
-GDB_SITE:=ftp://ftp.gnu.org/gnu/gdb/
-GDB_DIR:=$(BUILD_DIR)/gdb-5.3
-GDB_SOURCE:=gdb-5.3.tar.gz
-GDB_PATCH:=$(SOURCE_DIR)/gdb.patch
-GDB_UCLIBC_PATCH:=$(SOURCE_DIR)/gdb-5.3-uclibc.patch
-
-$(DL_DIR)/$(GDB_SOURCE):
-       $(WGET) -P $(DL_DIR) $(GDB_SITE)/$(GDB_SOURCE)
-
-$(GDB_DIR)/.unpacked: $(DL_DIR)/$(GDB_SOURCE) $(GDB_PATCH)
-       gunzip -c $(DL_DIR)/$(GDB_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       cat $(GDB_PATCH) | patch -p1 -d $(GDB_DIR)
-       cat $(GDB_UCLIBC_PATCH) | patch -p1 -d $(GDB_DIR)
-       touch  $(GDB_DIR)/.unpacked
-
-$(GDB_DIR)/.configured: $(GDB_DIR)/.unpacked
-       # Copy a config.sub from gcc.  This is only necessary until
-       # gdb's config.sub supports <arch>-linux-uclibc tuples.
-       cp $(GCC_DIR)/config.sub $(GDB_DIR)
-       cp $(GCC_DIR)/config.sub $(GDB_DIR)/readline/support/
-       (cd $(GDB_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ac_cv_type_uintptr_t=yes \
-               gt_cv_func_gettext_libintl=yes \
-               ac_cv_func_dcgettext=yes \
-               gdb_cv_func_sigsetjmp=yes \
-               bash_cv_func_strcoll_broken=no \
-               bash_cv_must_reinstall_sighandlers=no \
-               bash_cv_func_sigsetjmp=present \
-               ./configure \
-               --target=$(REAL_GNU_TARGET_NAME) \
-               --host=$(REAL_GNU_TARGET_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               --includedir=$(STAGING_DIR)/include \
-               $(DISABLE_NLS) \
-               --without-uiout --disable-gdbmi \
-               --disable-tui --disable-gdbtk --without-x \
-               --disable-sim --enable-gdbserver \
-               --without-included-gettext \
-       );
-ifeq ($(ENABLE_LOCALE),true)
-       -$(SED) "s,^INTL *=.*,INTL = -lintl,g;" $(GDB_DIR)/gdb/Makefile
-endif
-       touch  $(GDB_DIR)/.configured
-
-$(GDB_DIR)/gdb/gdb: $(GDB_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(GDB_DIR)
-       $(STRIP) $(GDB_DIR)/gdb/gdb
-
-$(TARGET_DIR)/usr/bin/gdb: $(GDB_DIR)/gdb/gdb
-       install -c $(GDB_DIR)/gdb/gdb $(TARGET_DIR)/usr/bin/gdb
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-
-gdb: $(TARGET_DIR)/usr/bin/gdb
-
-gdb-source: $(DL_DIR)/$(GDB_SOURCE)
-
-gdb-clean: 
-       $(MAKE) -C $(GDB_DIR) clean
-
-gdb-dirclean: 
-       rm -rf $(GDB_DIR)
-
diff --git a/obsolete-buildroot/make/gdbserver.mk b/obsolete-buildroot/make/gdbserver.mk
deleted file mode 100644 (file)
index 1ab44a2..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#############################################################
-#
-# gdbserver
-#
-#############################################################
-
-#Use GDB_DIR/etc values from gdb.mk
-#Build gdbserver in a dir outside of the main gdb tree
-GDB_WDIR:=$(BUILD_DIR)/gdbserver
-
-
-$(GDB_WDIR)/.configured: $(GDB_DIR)/.unpacked
-       mkdir -p $(GDB_WDIR)
-       (cd $(GDB_WDIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               $(GDB_DIR)/gdb/gdbserver/configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               --includedir=$(STAGING_DIR)/include \
-               $(DISABLE_NLS) \
-               --without-uiout --disable-gdbmi \
-               --disable-tui --disable-gdbtk --without-x \
-               --without-included-gettext \
-       );
-       touch  $(GDB_WDIR)/.configured
-
-$(GDB_WDIR)/gdbserver: $(GDB_WDIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(GDB_WDIR)
-       $(STRIP) $(GDB_WDIR)/gdbserver
-
-$(TARGET_DIR)/usr/bin/gdbserver: $(GDB_WDIR)/gdbserver
-       install -c $(GDB_WDIR)/gdbserver $(TARGET_DIR)/usr/bin/gdbserver
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-
-gdbserver: $(TARGET_DIR)/usr/bin/gdbserver
-
-gdbserver-clean: 
-       $(MAKE) -C $(GDB_WDIR) clean
-
-gdbserver-dirclean: 
-       rm -rf $(GDB_WDIR)
-
diff --git a/obsolete-buildroot/make/gettext.mk b/obsolete-buildroot/make/gettext.mk
deleted file mode 100644 (file)
index 84c7a25..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#############################################################
-#
-# gettext
-#
-#############################################################
-GETTEXT_SOURCE:=gettext-0.11.5.tar.gz
-GETTEXT_SITE:=ftp://ftp.gnu.org/gnu/gettext
-GETTEXT_DIR:=$(BUILD_DIR)/gettext-0.11.5
-GETTEXT_CAT:=zcat
-GETTEXT_BINARY:=gettext
-GETTEXT_TARGET_BINARY:=usr/bin/gettext
-
-$(DL_DIR)/$(GETTEXT_SOURCE):
-        $(WGET) -P $(DL_DIR) $(GETTEXT_SITE)/$(GETTEXT_SOURCE)
-
-gettext-source: $(DL_DIR)/$(GETTEXT_SOURCE)
-
-$(GETTEXT_DIR)/.unpacked: $(DL_DIR)/$(GETTEXT_SOURCE)
-       $(GETTEXT_CAT) $(DL_DIR)/$(GETTEXT_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(GETTEXT_DIR)/.unpacked
-
-$(GETTEXT_DIR)/.configured: $(GETTEXT_DIR)/.unpacked
-       (cd $(GETTEXT_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-       );
-       touch  $(GETTEXT_DIR)/.configured
-
-$(GETTEXT_DIR)/$(GETTEXT_BINARY): $(GETTEXT_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(GETTEXT_DIR)
-
-$(TARGET_DIR)/$(GETTEXT_TARGET_BINARY): $(GETTEXT_DIR)/$(GETTEXT_BINARY)
-       $(MAKE) DESTDIR=$(STAGING_DIR) CC=$(TARGET_CC) -C $(GETTEXT_DIR) install
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(GETTEXT_DIR) install
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc \
-               $(TARGET_DIR)/usr/doc
-
-gettext: uclibc $(TARGET_DIR)/$(GETTEXT_TARGET_BINARY)
-
-gettext-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(GETTEXT_DIR) uninstall
-       -$(MAKE) -C $(GETTEXT_DIR) clean
-
-gettext-dirclean:
-       rm -rf $(GETTEXT_DIR)
-
diff --git a/obsolete-buildroot/make/grep.mk b/obsolete-buildroot/make/grep.mk
deleted file mode 100644 (file)
index cc7856c..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#############################################################
-#
-# grep
-#
-#############################################################
-GNUGREP_SOURCE:=grep_2.5.1.ds1.orig.tar.gz
-GNUGREP_SITE:=http://ftp.debian.org/debian/pool/main/g/grep/
-GNUGREP_DIR:=$(BUILD_DIR)/grep-2.5.1
-GNUGREP_CAT:=zcat
-GNUGREP_BINARY:=src/grep
-GNUGREP_TARGET_BINARY:=bin/grep
-
-$(DL_DIR)/$(GNUGREP_SOURCE):
-        $(WGET) -P $(DL_DIR) $(GNUGREP_SITE)/$(GNUGREP_SOURCE)
-
-grep-source: $(DL_DIR)/$(GNUGREP_SOURCE)
-
-$(GNUGREP_DIR)/.unpacked: $(DL_DIR)/$(GNUGREP_SOURCE)
-       rm -rf $(GNUGREP_DIR).xxx
-       $(GNUGREP_CAT) $(DL_DIR)/$(GNUGREP_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       mv $(GNUGREP_DIR) $(GNUGREP_DIR).xxx
-       $(GNUGREP_CAT) $(GNUGREP_DIR).xxx/grep_2.5.1.tar.gz | tar -C $(BUILD_DIR) -xvf -
-       rm -rf $(GNUGREP_DIR).xxx
-       touch $(GNUGREP_DIR)/.unpacked
-
-$(GNUGREP_DIR)/.configured: $(GNUGREP_DIR)/.unpacked
-       (cd $(GNUGREP_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-               $(DISABLE_LARGEFILE) \
-               --disable-perl-regexp \
-               --without-included-regex \
-       );
-       touch  $(GNUGREP_DIR)/.configured
-
-$(GNUGREP_DIR)/$(GNUGREP_BINARY): $(GNUGREP_DIR)/.configured
-       $(MAKE) -C $(GNUGREP_DIR)
-
-# This stuff is needed to work around GNU make deficiencies
-grep-target_binary: $(GNUGREP_DIR)/$(GNUGREP_BINARY)
-       @if [ -L $(TARGET_DIR)/$(GNUGREP_TARGET_BINARY) ] ; then \
-               rm -f $(TARGET_DIR)/$(GNUGREP_TARGET_BINARY); fi;
-       @if [ ! -f $(GNUGREP_DIR)/$(GNUGREP_BINARY) -o $(TARGET_DIR)/$(GNUGREP_TARGET_BINARY) -ot \
-       $(GNUGREP_DIR)/$(GNUGREP_BINARY) ] ; then \
-           set -x; \
-           rm -f $(TARGET_DIR)/bin/grep $(TARGET_DIR)/bin/egrep $(TARGET_DIR)/bin/fgrep; \
-           cp -a $(GNUGREP_DIR)/src/grep $(GNUGREP_DIR)/src/egrep \
-               $(GNUGREP_DIR)/src/fgrep $(TARGET_DIR)/bin/; fi
-
-grep: uclibc grep-target_binary
-
-grep-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) -C $(GNUGREP_DIR) uninstall
-       -$(MAKE) -C $(GNUGREP_DIR) clean
-
-grep-dirclean:
-       rm -rf $(GNUGREP_DIR)
-
diff --git a/obsolete-buildroot/make/gzip.mk b/obsolete-buildroot/make/gzip.mk
deleted file mode 100644 (file)
index 8098dd9..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#############################################################
-#
-# gzip
-#
-#############################################################
-GZIP_SOURCE:=gzip-1.3.5.tar.gz
-GZIP_SITE:=ftp://alpha.gnu.org/gnu/gzip
-GZIP_DIR:=$(BUILD_DIR)/gzip-1.3.5
-GZIP_CAT:=zcat
-GZIP_BINARY:=$(GZIP_DIR)/gzip
-GZIP_TARGET_BINARY:=$(TARGET_DIR)/bin/zmore
-
-ifeq ($(strip $(BUILD_WITH_LARGEFILE)),false)
-GZIP_LARGEFILE="--disable-largefile"
-endif
-
-$(DL_DIR)/$(GZIP_SOURCE):
-        $(WGET) -P $(DL_DIR) $(GZIP_SITE)/$(GZIP_SOURCE)
-
-gzip-source: $(DL_DIR)/$(GZIP_SOURCE)
-
-$(GZIP_DIR)/.unpacked: $(DL_DIR)/$(GZIP_SOURCE)
-       $(GZIP_CAT) $(DL_DIR)/$(GZIP_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(GZIP_DIR)/.unpacked
-
-$(GZIP_DIR)/.configured: $(GZIP_DIR)/.unpacked
-       (cd $(GZIP_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/ \
-               --bindir=/bin \
-               --sbindir=/bin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share/misc \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-               $(GZIP_LARGEFILE) \
-       );
-       touch  $(GZIP_DIR)/.configured
-
-$(GZIP_BINARY): $(GZIP_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(GZIP_DIR)
-
-$(GZIP_TARGET_BINARY): $(GZIP_BINARY)
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(GZIP_DIR) install
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-       (cd $(TARGET_DIR)/bin; \
-       ln -sf gzip gunzip; \
-       ln -sf gzip zcat; \
-       ln -sf zdiff zcmp; \
-       ln -sf zgrep zegrep; \
-       ln -sf zgrep zfgrep;)
-
-gzip: uclibc $(GZIP_TARGET_BINARY)
-
-gzip-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(GZIP_DIR) uninstall
-       -$(MAKE) -C $(GZIP_DIR) clean
-
-gzip-dirclean:
-       rm -rf $(GZIP_DIR)
-
diff --git a/obsolete-buildroot/make/hostap.mk b/obsolete-buildroot/make/hostap.mk
deleted file mode 100644 (file)
index b7908fd..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#############################################################
-#
-# hostap
-#
-#############################################################
-HOSTAP_SOURCE_URL=http://hostap.epitest.fi/cgi-bin/viewcvs.cgi/hostap/hostap.tar.gz?tarball=1
-HOSTAP_SOURCE=hostap.tar.gz
-HOSTAP_DIR=$(BUILD_DIR)/hostap-snapshot
-
-$(DL_DIR)/$(HOSTAP_SOURCE):
-       $(WGET) -P $(DL_DIR) $(HOSTAP_SOURCE_URL) -O $(DL_DIR)/$(HOSTAP_SOURCE)
-
-hostap-source: $(DL_DIR)/$(HOSTAP_SOURCE)
-
-$(HOSTAP_DIR)/.unpacked: $(DL_DIR)/$(HOSTAP_SOURCE)
-       zcat $(DL_DIR)/$(HOSTAP_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       mv -f $(BUILD_DIR)/hostap $(HOSTAP_DIR)
-       touch $(HOSTAP_DIR)/.unpacked
-
-$(HOSTAP_DIR)/.configured: $(HOSTAP_DIR)/.unpacked
-       #$(SED) "s,/.*#define PRISM2_DOWNLOAD_SUPPORT.*/,#define PRISM2_DOWNLOAD_SUPPORT,g" \
-       #       $(HOSTAP_DIR)/driver/modules/hostap_config.h
-       touch  $(HOSTAP_DIR)/.configured
-
-$(HOSTAP_DIR)/utils/hostap_crypt_conf: $(HOSTAP_DIR)/.configured
-       $(MAKE) -C $(HOSTAP_DIR)/utils CC=$(TARGET_CC) CFLAGS="-Os -Wall $(TARGET_CFLAGS) -I../driver/modules"
-       $(MAKE) -C $(HOSTAP_DIR)/hostapd CC=$(TARGET_CC) CFLAGS="-Os -Wall $(TARGET_CFLAGS) -I../driver/modules -I../utils"
-       touch -c $(HOSTAP_DIR)/driver/modules/hostap.o
-
-$(TARGET_DIR)//usr/bin/hostap_crypt_conf: $(HOSTAP_DIR)/utils/hostap_crypt_conf
-       # Make the dir
-       -rm -rf $(HOSTAP_TARGET_MODULE_DIR)
-       -mkdir -p $(HOSTAP_TARGET_MODULE_DIR)
-       # Copy the pcmcia-cs conf file
-       -mkdir -p $(TARGET_DIR)/etc/pcmcia
-       cp -af $(HOSTAP_DIR)/driver/etc/hostap_cs.conf $(TARGET_DIR)/etc/pcmcia/
-       # Copy The Utils
-       cp -af $(HOSTAP_DIR)/utils/hostap_crypt_conf $(TARGET_DIR)/usr/bin/
-       cp -af $(HOSTAP_DIR)/utils/hostap_diag $(TARGET_DIR)/usr/bin/
-       cp -af $(HOSTAP_DIR)/utils/prism2_param $(TARGET_DIR)/usr/bin/
-       cp -af $(HOSTAP_DIR)/utils/prism2_srec $(TARGET_DIR)/usr/bin/
-       # Copy hostapd
-       cp -af $(HOSTAP_DIR)/hostapd/hostapd $(TARGET_DIR)/usr/sbin/
-
-hostap: pcmcia $(TARGET_DIR)//usr/bin/hostap_crypt_conf
-
-hostap-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(HOSTAP_DIR) uninstall
-       -$(MAKE) -C $(HOSTAP_DIR) clean
-
-hostap-dirclean:
-       rm -rf $(HOSTAP_DIR)
-
diff --git a/obsolete-buildroot/make/hotplug.mk b/obsolete-buildroot/make/hotplug.mk
deleted file mode 100644 (file)
index e13a602..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#############################################################
-#
-# hotplug support
-#
-#############################################################
-HOTPLUG_SOURCE=diethotplug-0.4.tar.gz
-HOTPLUG_SITE=http://aleron.dl.sourceforge.net/sourceforge/linux-hotplug
-HOTPLUG_DIR=$(BUILD_DIR)/diethotplug-0.4
-HOTPLUG_PATCH=$(SOURCE_DIR)/hotplug.patch
-
-$(DL_DIR)/$(HOTPLUG_SOURCE):
-       $(WGET) -P $(DL_DIR) $(HOTPLUG_SITE)/$(HOTPLUG_SOURCE)
-
-$(HOTPLUG_DIR): $(DL_DIR)/$(HOTPLUG_SOURCE) $(HOTPLUG_PATCH)
-       zcat $(DL_DIR)/$(HOTPLUG_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       cat $(HOTPLUG_PATCH) | patch -p1 -d $(HOTPLUG_DIR)
-
-$(HOTPLUG_DIR)/hotplug: $(HOTPLUG_DIR)
-       $(MAKE) CROSS=$(TARGET_CROSS) DEBUG=false KLIBC=false \
-           KERNEL_INCLUDE_DIR=$(STAGING_DIR)/include \
-           TARGET_DIR=$(TARGET_DIR) -C $(HOTPLUG_DIR);
-       $(STRIP) $(HOTPLUG_DIR)/hotplug;
-       touch -c $(HOTPLUG_DIR)/hotplug
-
-$(TARGET_DIR)/sbin/hotplug: $(HOTPLUG_DIR)/hotplug
-       cp $(HOTPLUG_DIR)/hotplug $(TARGET_DIR)/sbin/hotplug;
-       touch -c $(TARGET_DIR)/sbin/hotplug
-
-hotplug: uclibc $(TARGET_DIR)/sbin/hotplug
-
-hotplug-source: $(DL_DIR)/$(HOTPLUG_SOURCE)
-
-hotplug-clean:
-       rm -f $(TARGET_DIR)/sbin/hotplug
-       -$(MAKE) -C $(HOTPLUG_DIR) clean
-
-hotplug-dirclean:
-       rm -rf $(HOTPLUG_DIR)
-
diff --git a/obsolete-buildroot/make/ipkg-utils.mk b/obsolete-buildroot/make/ipkg-utils.mk
deleted file mode 100644 (file)
index f8bc2b1..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#############################################################
-#
-# ipkg-utils for use on the host system
-#
-#############################################################
-
-IPKG_UTILS_VERSION:=1.7
-IPKG_UTILS_SITE:=http://handhelds.org/packages/ipkg-utils/
-IPKG_UTILS_SOURCE:=ipkg-utils-$(IPKG_UTILS_VERSION).tar.gz
-IPKG_UTILS_DIR:=$(TOOL_BUILD_DIR)/ipkg-utils-$(IPKG_UTILS_VERSION)
-
-IPKG_UTILS_PATCHES += ipkg-utils-1.7-ipkg_buildpackage.patch
-IPKG_UTILS_PATCHES += ipkg-utils-1.7-ipkg_build_clean.patch
-
-$(DL_DIR)/$(IPKG_UTILS_SOURCE):
-       $(WGET) -P $(DL_DIR) $(IPKG_UTILS_SITE)/$(IPKG_UTILS_SOURCE)
-
-$(IPKG_UTILS_DIR)/.unpacked: $(DL_DIR)/$(IPKG_UTILS_SOURCE)
-       mkdir -p $(TOOL_BUILD_DIR)
-       mkdir -p $(DL_DIR)
-       zcat $(DL_DIR)/$(IPKG_UTILS_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf -
-       cd $(SOURCE_DIR); cat $(IPKG_UTILS_PATCHES) | patch -p1 -d $(IPKG_UTILS_DIR)
-       touch $(IPKG_UTILS_DIR)/.unpacked
-
-$(STAGING_DIR)/bin/ipkg-build: $(IPKG_UTILS_DIR)/.unpacked
-       mkdir -p $(STAGING_DIR)/bin
-       install -m0755 $(IPKG_UTILS_DIR)/ipkg-build* $(STAGING_DIR)/bin
-       install -m0755 $(IPKG_UTILS_DIR)/ipkg-make-index $(STAGING_DIR)/bin
-       install -m0755 $(IPKG_UTILS_DIR)/ipkg.py $(STAGING_DIR)/bin
-
-ipkg-utils: $(STAGING_DIR)/bin/ipkg-build
-
-ipkg-utils-clean:
-       rm -f $(STAGING_DIR)/bin/ipkg*
-
-ipkg-utils-dirclean:
-       rm -rf $(IPKG_UTILS_DIR)
-
-
-IPKG_BUILDPACKAGE := PATH=$(TARGET_PATH) ipkg-buildpackage -c -o root -g root
-IPKG_BUILD := PATH=$(TARGET_PATH) ipkg-build -c -o root -g root
-IPKG_MAKE_INDEX := PATH=$(TARGET_PATH) ipkg-make-index
-
diff --git a/obsolete-buildroot/make/iproute2.mk b/obsolete-buildroot/make/iproute2.mk
deleted file mode 100644 (file)
index 94bed41..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-#############################################################
-#
-# iproute2
-#
-#############################################################
-
-IPROUTE2_DIR=$(BUILD_DIR)/iproute2
-IP_IPK_DIR=$(BUILD_DIR)/ip-2.0-ipk
-TC_IPK_DIR=$(BUILD_DIR)/tc-2.0-ipk
-
-#IPROUTE2_SOURCE_URL=ftp://ftp.inr.ac.ru/ip-routing/
-#IPROUTE2_SOURCE=iproute2-2.4.7-now-ss020116-try.tar.gz
-
-#Use the debian source for now, as the .ru site has availability problems
-IPROUTE2_SOURCE_URL=http://ftp.debian.org/debian/pool/main/i/iproute/
-IPROUTE2_SOURCE=iproute_20010824.orig.tar.gz
-IPROUTE2_PATCH:=iproute_20010824-8.diff.gz
-IPROUTE2_PATCH_2:=iproute2-*.patch
-
-
-$(DL_DIR)/$(IPROUTE2_SOURCE):
-        $(WGET) -P $(DL_DIR) $(IPROUTE2_SOURCE_URL)$(IPROUTE2_SOURCE)
-
-$(DL_DIR)/$(IPROUTE2_PATCH):
-       $(WGET) -P $(DL_DIR) $(IPROUTE2_SOURCE_URL)/$(IPROUTE2_PATCH)
-
-
-iproute2-source: $(DL_DIR)/$(IPROUTE2_SOURCE) #$(DL_DIR)/$(IPROUTE2_PATCH)
-
-$(IPROUTE2_DIR)/.unpacked: $(DL_DIR)/$(IPROUTE2_SOURCE) #$(DL_DIR)/$(IPROUTE2_PATCH)
-       rm -rf $(IPROUTE2_DIR).orig $(IPROUTE2_DIR)
-       zcat $(DL_DIR)/$(IPROUTE2_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       #zcat $(DL_DIR)/$(IPROUTE2_PATCH) | patch -p1 -d $(IPROUTE2_DIR)
-       $(SOURCE_DIR)/patch-kernel.sh $(IPROUTE2_DIR) $(SOURCE_DIR) $(IPROUTE2_PATCH_2)
-       # fun sed hacks.
-       $(SED) "s:-O2:${TARGET_CFLAGS}:g" $(IPROUTE2_DIR)/Makefile
-ifeq ($(ARCH),i386)
-       @# needed on atleast i386.. however breaks on mipsel
-       $(SED) 's:-I\.\./include-glibc::g' $(IPROUTE2_DIR)/Makefile
-endif
-       touch $(IPROUTE2_DIR)/.unpacked
-
-$(IPROUTE2_DIR)/.configured: $(IPROUTE2_DIR)/.unpacked
-       $(SED) "s,-I/usr/include/db3,," $(IPROUTE2_DIR)/Makefile
-       $(SED) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \
-               $(IPROUTE2_DIR)/Makefile
-       $(SED) "s,^LIBC_INCLUDE.*,LIBC_INCLUDE=$(STAGING_DIR)/include," \
-               $(IPROUTE2_DIR)/Makefile
-       # For now disable compiling of the misc directory because it seems to fail
-       rm -rf $(IPROUTE2_DIR)/misc 
-       $(SED) "s, misc,," $(IPROUTE2_DIR)/Makefile
-       touch  $(IPROUTE2_DIR)/.configured
-
-$(IPROUTE2_DIR)/tc/tc: $(IPROUTE2_DIR)/.configured
-       $(MAKE) -C $(IPROUTE2_DIR) $(TARGET_CONFIGURE_OPTS) KERNEL_INCLUDE=$(LINUX_DIR)/include
-
-$(TARGET_DIR)/usr/sbin/tc: $(IPROUTE2_DIR)/tc/tc
-       @# Make sure our $(TARGET_DIR)/usr/sbin/ exists.
-       -mkdir -p $(TARGET_DIR)/usr/sbin/
-       @# Copy The tc binary
-       cp -af $(IPROUTE2_DIR)/tc/tc $(TARGET_DIR)/usr/sbin/ && \
-               $(STRIP) $(TARGET_DIR)/usr/sbin/tc
-
-iproute2: $(TARGET_DIR)/usr/sbin/tc
-
-iproute2-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(IPROUTE2_DIR) uninstall
-       -$(MAKE) -C $(IPROUTE2_DIR) clean
-
-iproute2-dirclean:
-       rm -rf $(IPROUTE2_DIR) $(IP_IPK_DIR) $(TC_IPK_DIR)
-       
-
-iproute2-ipk:  $(IPROUTE2_DIR)/tc/tc
-       mkdir -p $(IP_IPK_DIR)
-       mkdir -p $(TC_IPK_DIR)
-       cp -a $(OPENWRT_IPK_DIR)/iproute/ip/CONTROL $(IP_IPK_DIR)/CONTROL
-       cp -a $(OPENWRT_IPK_DIR)/iproute/tc/CONTROL $(TC_IPK_DIR)/CONTROL
-       mkdir -p $(IP_IPK_DIR)/usr/sbin
-       mkdir -p $(TC_IPK_DIR)/usr/sbin
-       install -m 755 $(IPROUTE2_DIR)/ip/ip $(IP_IPK_DIR)/usr/sbin/
-       install -m 755 $(IPROUTE2_DIR)/tc/tc $(TC_IPK_DIR)/usr/sbin/
-       $(STRIP) $(IP_IPK_DIR)/usr/sbin/ip
-       $(STRIP) $(TC_IPK_DIR)/usr/sbin/tc
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(IP_IPK_DIR)
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(TC_IPK_DIR)
diff --git a/obsolete-buildroot/make/iptables.mk b/obsolete-buildroot/make/iptables.mk
deleted file mode 100644 (file)
index 8139e5a..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#############################################################
-#
-# iptables
-#
-#############################################################
-IPTABLES_SOURCE_URL=http://www.netfilter.org/files
-IPTABLES_SOURCE=iptables-1.2.11.tar.bz2
-IPTABLES_BUILD_DIR=$(BUILD_DIR)/iptables-1.2.11
-IP6TABLES_IPK=$(BUILD_DIR)/ip6tables_1.2.11-1_mipsel.ipk
-IP6TABLES_IPK_DIR:=$(BUILD_DIR)/ip6tables-1.2.11-ipk
-
-$(DL_DIR)/$(IPTABLES_SOURCE):
-        $(WGET) -P $(DL_DIR) $(IPTABLES_SOURCE_URL)/$(IPTABLES_SOURCE) 
-
-$(IPTABLES_BUILD_DIR)/.unpacked: $(DL_DIR)/$(IPTABLES_SOURCE)
-       bzcat $(DL_DIR)/$(IPTABLES_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(IPTABLES_BUILD_DIR)/.unpacked
-
-$(IPTABLES_BUILD_DIR)/.configured: $(IPTABLES_BUILD_DIR)/.unpacked
-       # Allow patches.  Needed for openwrt for instance.
-       $(SOURCE_DIR)/patch-kernel.sh $(IPTABLES_BUILD_DIR) $(SOURCE_DIR) iptables-*.patch
-       #
-       $(SED) "s;\[ -f /usr/include/netinet/ip6.h \];grep -q '__UCLIBC_HAS_IPV6__ 1' \
-               $(BUILD_DIR)/uClibc-0.9.27/include/bits/uClibc_config.h;" $(IPTABLES_BUILD_DIR)/Makefile
-       touch  $(IPTABLES_BUILD_DIR)/.configured
-
-$(IPTABLES_BUILD_DIR)/iptables: $(IPTABLES_BUILD_DIR)/.configured
-       $(TARGET_CONFIGURE_OPTS) \
-       $(MAKE) -C $(IPTABLES_BUILD_DIR) \
-               KERNEL_DIR=$(LINUX_DIR) PREFIX=/usr \
-               CC=$(TARGET_CC) COPT_FLAGS="$(TARGET_CFLAGS)"
-
-$(TARGET_DIR)/sbin/iptables: $(IPTABLES_BUILD_DIR)/iptables
-       $(TARGET_CONFIGURE_OPTS) \
-       $(MAKE) -C $(IPTABLES_BUILD_DIR) \
-               KERNEL_DIR=$(LINUX_DIR) PREFIX=/usr \
-               CC=$(TARGET_CC) COPT_FLAGS="$(TARGET_CFLAGS)" \
-               DESTDIR=$(TARGET_DIR) install
-       $(STRIP) $(TARGET_DIR)/usr/sbin/iptables*
-       $(STRIP) $(TARGET_DIR)/usr/sbin/ip6tables*
-       $(STRIP) $(TARGET_DIR)/usr/lib/iptables/*.so
-       rm -rf $(TARGET_DIR)/usr/man
-
-iptables: $(TARGET_DIR)/sbin/iptables 
-
-$(IP6TABLES_IPK):
-       mkdir -p $(IP6TABLES_IPK_DIR)/CONTROL
-       mkdir -p $(IP6TABLES_IPK_DIR)/usr/lib/iptables
-       mkdir -p $(IP6TABLES_IPK_DIR)/usr/sbin
-       install -m 644 $(OPENWRT_IPK_DIR)/ip6tables/ip6tables.control $(IP6TABLES_IPK_DIR)/CONTROL/control
-       install -m 755 $(IPTABLES_BUILD_DIR)/ip6tables $(IP6TABLES_IPK_DIR)/usr/sbin
-       install -m 755 $(IPTABLES_BUILD_DIR)/extensions/libip6t_*.so $(IP6TABLES_IPK_DIR)/usr/lib/iptables/
-       $(STRIP) $(IP6TABLES_IPK_DIR)/usr/sbin/ip6tables*
-       $(STRIP) $(IP6TABLES_IPK_DIR)/usr/lib/iptables/*.so
-       cd $(BUILD_DIR); $(STAGING_DIR)/bin/ipkg-build -c -o root -g root $(IP6TABLES_IPK_DIR)
-
-ip6tables-ipk: iptables $(IP6TABLES_IPK)
-
-iptables-source: $(DL_DIR)/$(IPTABLES_SOURCE)
-
-iptables-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(IPTABLES_BUILD_DIR) uninstall
-       -$(MAKE) -C $(IPTABLES_BUILD_DIR) clean
-
-iptables-dirclean:
-       rm -rf $(IPTABLES_BUILD_DIR)
-
diff --git a/obsolete-buildroot/make/jffs2-bbc.mk b/obsolete-buildroot/make/jffs2-bbc.mk
deleted file mode 100644 (file)
index 44f3a4f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#############################################################
-#
-# jffsbbc
-#
-#############################################################
-
-
-JFFSBBC_SOURCE:=bbc-0.54.3.tgz
-JFFSBBC_DIR:=$(BUILD_DIR)/bbc-0.54.3
-JFFSBBC_SITE:=http://www.inf.u-szeged.hu/jffs2
-JFFSBBC_CAT:=zcat
-
-LINUX_DIR:=$(BUILD_DIR)/WRT54GS/release/src/linux/linux
-
-$(DL_DIR)/$(JFFSBBC_SOURCE):
-        $(WGET) -P $(DL_DIR) $(JFFSBBC_SITE)/$(JFFSBBC_SOURCE)
-
-jffsbbc-source: $(DL_DIR)/$(JFFSBBC_SOURCE)
-
-$(JFFSBBC_DIR)/.unpacked: $(DL_DIR)/$(JFFSBBC_SOURCE)
-       $(JFFSBBC_CAT) $(DL_DIR)/$(JFFSBBC_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(JFFSBBC_DIR)/.unpacked
-
-$(LINUX_DIR)/.bbc-patched: $(LINUX_DIR)/.patched $(JFFSBBC_DIR)/.unpacked
-       -(cd $(JFFSBBC_DIR)/src; ./install.jffs2 linux-2.4.25.hpatch $(LINUX_DIR))
-       touch $(LINUX_DIR)/.bbc-patched
-
-jffsbbc: $(LINUX_DIR)/.bbc-patched
-
-jffsbbc-clean:
-
-jffsbbc-dirclean:
-       rm -rf $(JFFSBBC_DIR)
diff --git a/obsolete-buildroot/make/jffs2root.mk b/obsolete-buildroot/make/jffs2root.mk
deleted file mode 100644 (file)
index 08a66bb..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#############################################################
-#
-# mtd provides us with mkfs.jffs2, to target JFFS2 filesystems
-#
-#############################################################
-
-MTD_DIR:=$(BUILD_DIR)/mtd-20011217
-MTD_SOURCE=mtd_20011217.orig.tar.gz
-MTD_SITE=http://ftp.debian.org/debian/pool/main/m/mtd
-MKFS_JFFS2=${shell which mkfs.jffs2 || echo $(MTD_DIR)/util/mkfs.jffs2}
-
-$(DL_DIR)/$(MTD_SOURCE):
-       $(WGET) -P $(DL_DIR) $(MTD_SITE)/$(MTD_SOURCE)
-
-$(MTD_DIR)/.unpacked: $(DL_DIR)/$(MTD_SOURCE)
-       zcat $(DL_DIR)/$(MTD_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(MTD_DIR)/.unpacked
-
-$(MTD_DIR)/util/mkfs.jffs2: $(MTD_DIR)/.unpacked
-       CFLAGS=-I$(LINUX_DIR)/include $(MAKE) LINUXDIR=$(LINUX_DIR) -C $(MTD_DIR)/util
-
-mtd: $(MKFS_JFFS2)
-
-
-#############################################################
-#
-# Build the jffs2 root filesystem image
-#
-#############################################################
-
-jffs2root: mtd
-       #-@find $(TARGET_DIR)/lib -type f -name \*.so\* | xargs $(STRIP)  2>/dev/null || true;
-       -@find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIP) 2>/dev/null || true;
-       @rm -rf $(TARGET_DIR)/usr/man
-       @rm -rf $(TARGET_DIR)/usr/info
-       $(MKFS_JFFS2) --pad --little-endian --squash -e 0x20000 \
-               -D $(SOURCE_DIR)/device_table.txt -d $(TARGET_DIR) \
-               -o $(IMAGE)
-
-jffs2root-source: $(DL_DIR)/$(MTD_SOURCE)
-
-jffs2root-clean:
-       -$(MAKE) -C $(MTD_DIR) clean
-
-jffs2root-dirclean:
-       rm -rf $(MTD_DIR)
-
-
-
diff --git a/obsolete-buildroot/make/jpeg.mk b/obsolete-buildroot/make/jpeg.mk
deleted file mode 100644 (file)
index 307217f..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#############################################################
-#
-# jpeg (libraries needed by some apps)
-#
-#############################################################
-# Copyright (C) 2001-2003 by Erik Andersen <andersen@codepoet.org>
-# Copyright (C) 2002 by Tim Riker <Tim@Rikers.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Library General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-JPEG_DIR=$(BUILD_DIR)/jpeg-6b
-JPEG_SITE:=ftp://ftp.uu.net/graphics/jpeg/
-JPEG_SOURCE=jpegsrc.v6b.tar.gz
-JPEG_CAT:=zcat
-
-$(DL_DIR)/$(JPEG_SOURCE):
-        $(WGET) -P $(DL_DIR) $(JPEG_SITE)/$(JPEG_SOURCE)
-
-jpeg-source: $(DL_DIR)/$(JPEG_SOURCE)
-
-$(JPEG_DIR)/.unpacked: $(DL_DIR)/$(JPEG_SOURCE)
-       $(JPEG_CAT) $(DL_DIR)/$(JPEG_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       # The config.guess distributed with the package is not able
-       # to handle cross compilation.  Use the one from binutils.
-       cp $(BINUTILS_DIR)/config.guess $(JPEG_DIR)/
-       touch $(JPEG_DIR)/.unpacked
-
-$(JPEG_DIR)/.configured: $(JPEG_DIR)/.unpacked
-       (cd $(JPEG_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               --enable-shared \
-       );
-       touch  $(JPEG_DIR)/.configured
-
-$(STAGING_DIR)/lib/libjpeg.so.62.0.0: $(JPEG_DIR)/.configured
-       $(MAKE) -C $(JPEG_DIR) all
-       # Note: This does not install the utilities.
-       $(MAKE) -C $(JPEG_DIR) prefix=$(STAGING_DIR) exec_prefix=$(STAGING_DIR) install-headers install-lib
-
-$(TARGET_DIR)/lib/libjpeg.so.62.0.0: $(STAGING_DIR)/lib/libjpeg.so.62.0.0
-       cp -dpf $(STAGING_DIR)/lib/libjpeg.so* $(TARGET_DIR)/usr/lib/
-       -$(STRIP)  $(TARGET_DIR)/usr/lib/libjpeg.so.62.0.0
-
-jpeg: uclibc $(TARGET_DIR)/lib/libjpeg.so.62.0.0
-
-jpeg-clean:
-       -$(MAKE) -C $(JPEG_DIR) clean
diff --git a/obsolete-buildroot/make/kernel-headers.mk b/obsolete-buildroot/make/kernel-headers.mk
deleted file mode 100644 (file)
index 2f8f950..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-#############################################################
-#
-# Setup the kernel headers.  I include a generic package of
-# kernel headers here, so you shouldn't need to include your
-# own.  Be aware these kernel headers _will_ get blown away
-# by a 'make clean' so don't put anything sacred in here...
-#
-#############################################################
-ifneq ($(filter $(TARGETS),kernel-headers),)
-
-VERSION=2
-PATCHLEVEL=4
-SUBLEVEL=25
-LINUX_SITE:=http://www.uclibc.org/downloads/toolchain
-LINUX_SOURCE:=kernel-headers-2.4.25.tar.bz2
-LINUX_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux
-
-
-# Uncomment this for 2.6.x kernel header files
-#VERSION=2
-#PATCHLEVEL=6
-#SUBLEVEL=5
-#LINUX_SITE:=http://ep09.pld-linux.org/~mmazur/linux-libc-headers/
-#LINUX_SOURCE:=linux-libc-headers-2.6.5.0.tar.bz2
-#LINUX_UNPACK_DIR:=$(TOOL_BUILD_DIR)/linux-libc-headers-2.6.5.0
-
-
-
-LINUX_DIR:=$(TOOL_BUILD_DIR)/linux
-
-$(DL_DIR)/$(LINUX_SOURCE):
-       $(WGET) -P $(DL_DIR) $(LINUX_SITE)/$(LINUX_SOURCE)
-
-$(LINUX_DIR)/.unpacked: $(DL_DIR)/$(LINUX_SOURCE)
-       mkdir -p $(TOOL_BUILD_DIR)
-       bzcat $(DL_DIR)/$(LINUX_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf -
-ifneq ($(LINUX_UNPACK_DIR),$(LINUX_DIR))
-       mv $(LINUX_UNPACK_DIR) $(LINUX_DIR)
-endif
-       touch $(LINUX_DIR)/.unpacked
-
-$(LINUX_DIR)/.configured: $(LINUX_DIR)/.unpacked
-       rm -f $(LINUX_DIR)/include/asm
-       @if [ ! -f $(LINUX_DIR)/Makefile ] ; then \
-           echo -e "VERSION = $(VERSION)\nPATCHLEVEL = $(PATCHLEVEL)\n" > \
-                   $(LINUX_DIR)/Makefile; \
-           echo -e "SUBLEVEL = $(SUBLEVEL)\nEXTRAVERSION =\n" > \
-                   $(LINUX_DIR)/Makefile; \
-           echo -e "KERNELRELEASE=\$$(VERSION).\$$(PATCHLEVEL).\$$(SUBLEVEL)\$$(EXTRAVERSION)" >> \
-                   $(LINUX_DIR)/Makefile; \
-       fi;
-       @if [ "$(ARCH)" = "powerpc" ];then \
-           (cd $(LINUX_DIR)/include; ln -fs asm-ppc$(NOMMU) asm;) \
-       elif [ "$(ARCH)" = "mips" ];then \
-           (cd $(LINUX_DIR)/include; ln -fs asm-mips$(NOMMU) asm;) \
-       elif [ "$(ARCH)" = "mipsel" ];then \
-           (cd $(LINUX_DIR)/include; ln -fs asm-mips$(NOMMU) asm;) \
-       elif [ "$(ARCH)" = "arm" ];then \
-           (cd $(LINUX_DIR)/include; ln -fs asm-arm$(NOMMU) asm; \
-            cd asm; \
-            if [ ! -L proc ] ; then \
-            ln -fs proc-armv proc; \
-            ln -fs arch-ebsa285 arch; fi); \
-       elif [ "$(ARCH)" = "cris" ];then \
-           (cd $(LINUX_DIR)/include; ln -fs asm-cris asm;) \
-       else \
-           (cd $(LINUX_DIR)/include; ln -fs asm-$(ARCH)$(NOMMU) asm;) \
-       fi
-       touch $(LINUX_DIR)/include/linux/autoconf.h;
-       touch $(LINUX_DIR)/.configured
-
-$(LINUX_KERNEL): $(LINUX_DIR)/.configured
-
-kernel-headers: $(LINUX_DIR)/.configured
-
-kernel-headers-source: $(DL_DIR)/$(LINUX_SOURCE)
-
-kernel-headers-clean: clean
-       rm -f $(LINUX_KERNEL)
-       rm -rf $(LINUX_DIR)
-
-kernel-headers-dirclean:
-       rm -rf $(LINUX_DIR)
-
-endif
diff --git a/obsolete-buildroot/make/kmod-ipt6.mk b/obsolete-buildroot/make/kmod-ipt6.mk
deleted file mode 100644 (file)
index c3d78b9..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-kmod-ipt6-ipk: ipkg-utils $(OPENWRT_IPK_DIR)/kmod-ipt6/CONTROL/*
-       chmod a+x $(OPENWRT_IPK_DIR)/kmod-ipt6/CONTROL/rules
-       cd $(OPENWRT_IPK_DIR)/kmod-ipt6 ; $(IPKG_BUILDPACKAGE)
-       mv $(OPENWRT_IPK_DIR)/kmod-ipt6_*.ipk $(BUILD_DIR)
\ No newline at end of file
diff --git a/obsolete-buildroot/make/kmod-ipv6.mk b/obsolete-buildroot/make/kmod-ipv6.mk
deleted file mode 100644 (file)
index ce7959e..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-kmod-ipv6-ipk: ipkg-utils $(OPENWRT_IPK_DIR)/kmod-ipv6/CONTROL/*
-       chmod a+x $(OPENWRT_IPK_DIR)/kmod-ipv6/CONTROL/rules
-       cd $(OPENWRT_IPK_DIR)/kmod-ipv6 ; $(IPKG_BUILDPACKAGE)
-       mv $(OPENWRT_IPK_DIR)/kmod-ipv6_*.ipk $(BUILD_DIR)
\ No newline at end of file
diff --git a/obsolete-buildroot/make/kmod-nfs.mk b/obsolete-buildroot/make/kmod-nfs.mk
deleted file mode 100644 (file)
index 45cc60c..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-kmod-nfs-ipk: ipkg-utils $(OPENWRT_IPK_DIR)/kmod-nfs/CONTROL/*
-       chmod a+x $(OPENWRT_IPK_DIR)/kmod-nfs/CONTROL/rules
-       cd $(OPENWRT_IPK_DIR)/kmod-nfs ; $(IPKG_BUILDPACKAGE)
-       mv $(OPENWRT_IPK_DIR)/kmod-nfs_*.ipk $(BUILD_DIR)
\ No newline at end of file
diff --git a/obsolete-buildroot/make/kmod-ppp-async.mk b/obsolete-buildroot/make/kmod-ppp-async.mk
deleted file mode 100644 (file)
index 3b076ab..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-kmod-ppp-async-ipk: ipkg-utils $(OPENWRT_IPK_DIR)/kmod-ppp-async/CONTROL/*
-       chmod a+x $(OPENWRT_IPK_DIR)/kmod-ppp-async/CONTROL/rules
-       cd $(OPENWRT_IPK_DIR)/kmod-ppp-async ; $(IPKG_BUILDPACKAGE)
-       mv $(OPENWRT_IPK_DIR)/kmod-ppp-async_*.ipk $(BUILD_DIR)
\ No newline at end of file
diff --git a/obsolete-buildroot/make/kmod-ppp-mppe-mppc.mk b/obsolete-buildroot/make/kmod-ppp-mppe-mppc.mk
deleted file mode 100644 (file)
index 4dc24bf..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-kmod-ppp-mppe-mppc-ipk: ipkg-utils $(OPENWRT_IPK_DIR)/kmod-ppp-mppe-mppc/CONTROL/*
-       chmod a+x $(OPENWRT_IPK_DIR)/kmod-ppp-mppe-mppc/CONTROL/rules
-       cd $(OPENWRT_IPK_DIR)/kmod-ppp-mppe-mppc ; $(IPKG_BUILDPACKAGE)
-       mv $(OPENWRT_IPK_DIR)/kmod-ppp-mppe-mppc_*.ipk $(BUILD_DIR)
\ No newline at end of file
diff --git a/obsolete-buildroot/make/kmod-sched.mk b/obsolete-buildroot/make/kmod-sched.mk
deleted file mode 100644 (file)
index eb09d96..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-kmod-sched-ipk: ipkg-utils $(OPENWRT_IPK_DIR)/kmod-sched/CONTROL/*
-       chmod a+x $(OPENWRT_IPK_DIR)/kmod-sched/CONTROL/rules
-       cd $(OPENWRT_IPK_DIR)/kmod-sched ; $(IPKG_BUILDPACKAGE)
-       mv $(OPENWRT_IPK_DIR)/kmod-sched_*.ipk $(BUILD_DIR)
\ No newline at end of file
diff --git a/obsolete-buildroot/make/kmod-tun.mk b/obsolete-buildroot/make/kmod-tun.mk
deleted file mode 100644 (file)
index 75a5c54..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-kmod-tun-ipk: ipkg-utils $(OPENWRT_IPK_DIR)/kmod-tun/CONTROL/*
-       chmod a+x $(OPENWRT_IPK_DIR)/kmod-tun/CONTROL/rules
-       cd $(OPENWRT_IPK_DIR)/kmod-tun ; $(IPKG_BUILDPACKAGE)
-       mv $(OPENWRT_IPK_DIR)/kmod-tun_*.ipk $(BUILD_DIR)
\ No newline at end of file
diff --git a/obsolete-buildroot/make/less.mk b/obsolete-buildroot/make/less.mk
deleted file mode 100644 (file)
index af0ed4a..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#############################################################
-#
-# less
-#
-#############################################################
-LESS_SOURCE=less-381.tar.gz
-LESS_SITE=http://www.greenwoodsoftware.com/less
-LESS_DIR=$(BUILD_DIR)/less-381
-LESS_BINARY=less
-LESS_TARGET_BINARY=usr/bin/less
-
-$(DL_DIR)/$(LESS_SOURCE):
-       $(WGET) -P $(DL_DIR) $(LESS_SITE)/$(LESS_SOURCE)
-
-$(LESS_DIR)/.source: $(DL_DIR)/$(LESS_SOURCE)
-       zcat $(DL_DIR)/$(LESS_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(LESS_DIR)/.source
-
-$(LESS_DIR)/.configured: $(LESS_DIR)/.source
-       (cd $(LESS_DIR); \
-               $(TARGET_CONFIGURE_OPTS) \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --sysconfdir=/etc \
-       );
-       touch $(LESS_DIR)/.configured;
-
-$(LESS_DIR)/$(LESS_BINARY): $(LESS_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(LESS_DIR)
-
-$(TARGET_DIR)/$(LESS_TARGET_BINARY): $(LESS_DIR)/$(LESS_BINARY)
-       $(MAKE) prefix=$(TARGET_DIR)/usr -C $(LESS_DIR) install
-       rm -Rf $(TARGET_DIR)/usr/man
-
-less: uclibc $(TARGET_DIR)/$(LESS_TARGET_BINARY)
-
-less-source: $(DL_DIR)/$(LESS_SOURCE)
-
-less-clean:
-       $(MAKE) prefix=$(TARGET_DIR)/usr -C $(LESS_DIR) uninstall
-       -$(MAKE) -C $(LESS_DIR) clean
-
-less-dirclean:
-       rm -rf $(LESS_DIR)
-
diff --git a/obsolete-buildroot/make/libfloat.mk b/obsolete-buildroot/make/libfloat.mk
deleted file mode 100644 (file)
index dffef3d..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#############################################################
-#
-# libfloat
-#
-#############################################################
-LIBFLOAT_SOURCE:=libfloat_990616.orig.tar.gz
-LIBFLOAT_PATCH:=libfloat_990616-3.diff.gz
-LIBFLOAT_SITE:=http://ftp.debian.org/debian/pool/main/libf/libfloat
-LIBFLOAT_CAT:=zcat
-LIBFLOAT_DIR:=$(BUILD_DIR)/libfloat
-
-LIBFLOAT_TARGET=
-ifeq ($(strip $(SOFT_FLOAT)),true)
-ifeq ("$(strip $(ARCH))","arm")
-LIBFLOAT_TARGET+=$(STAGING_DIR)/lib/libfloat.so
-endif
-endif
-
-$(DL_DIR)/$(LIBFLOAT_SOURCE):
-        $(WGET) -P $(DL_DIR) $(LIBFLOAT_SITE)/$(LIBFLOAT_SOURCE)
-
-$(DL_DIR)/$(LIBFLOAT_PATCH):
-        $(WGET) -P $(DL_DIR) $(LIBFLOAT_SITE)/$(LIBFLOAT_PATCH)
-
-libfloat-source: $(DL_DIR)/$(LIBFLOAT_SOURCE) $(DL_DIR)/$(LIBFLOAT_PATCH)
-
-$(LIBFLOAT_DIR)/.unpacked: $(DL_DIR)/$(LIBFLOAT_SOURCE) $(DL_DIR)/$(LIBFLOAT_PATCH)
-       $(LIBFLOAT_CAT) $(DL_DIR)/$(LIBFLOAT_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       # Remove the binary files distributed with the the package.
-       make -C $(LIBFLOAT_DIR) clean
-       $(SOURCE_DIR)/patch-kernel.sh $(LIBFLOAT_DIR) $(DL_DIR) $(LIBFLOAT_PATCH)
-       $(SOURCE_DIR)/patch-kernel.sh $(LIBFLOAT_DIR) $(SOURCE_DIR) libfloat.patch
-       touch $(LIBFLOAT_DIR)/.unpacked
-
-$(LIBFLOAT_DIR)/libfloat.so.1: $(LIBFLOAT_DIR)/.unpacked $(TARGET_CC)
-       $(MAKE) CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld -C $(LIBFLOAT_DIR)
-
-$(STAGING_DIR)/lib/libfloat.so: $(LIBFLOAT_DIR)/libfloat.so.1
-       cp -a $(LIBFLOAT_DIR)/libfloat.a $(STAGING_DIR)/lib/libfloat.a
-       cp -a $(LIBFLOAT_DIR)/libfloat.so.1 $(STAGING_DIR)/lib/libfloat.so.1
-       (cd $(STAGING_DIR)/lib ; ln -sf libfloat.so.1 libfloat.so)
-       cp -a $(LIBFLOAT_DIR)/libfloat.a $(TARGET_DIR)/usr/lib/libfloat.a
-       cp -a $(LIBFLOAT_DIR)/libfloat.so.1 $(TARGET_DIR)/lib/libfloat.so.1
-       $(STRIP) $(TARGET_DIR)/lib/libfloat.so.1 > /dev/null 2>&1
-       (cd $(TARGET_DIR)/lib ; ln -sf libfloat.so.1 libfloat.so)
-       (cd $(TARGET_DIR)/usr/lib ; ln -sf /lib/libfloat.so libfloat.so)
-
-libfloat: $(STAGING_DIR)/lib/libfloat.so
-
-libfloat-clean:
-       -$(MAKE) -C $(LIBFLOAT_DIR) clean
-
-libfloat-dirclean:
-       rm -rf $(LIBFLOAT_DIR)
-
diff --git a/obsolete-buildroot/make/libglib12.mk b/obsolete-buildroot/make/libglib12.mk
deleted file mode 100644 (file)
index 00e1386..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-#############################################################
-#
-# libglib1.2
-#
-#############################################################
-LIBGLIB12_SOURCE:=glib-1.2.10.tar.gz
-LIBGLIB12_SITE:=ftp://ftp.gtk.org/pub/gtk/v1.2
-LIBGLIB12_CAT:=zcat
-LIBGLIB12_DIR:=$(BUILD_DIR)/glib-1.2.10
-LIBGLIB12_BINARY:=libglib.a
-LIBGLIB12_PATCH:=$(SOURCE_DIR)/libglib_configure_1.2.10.bz2
-
-
-$(DL_DIR)/$(LIBGLIB12_SOURCE):
-        $(WGET) -P $(DL_DIR) $(LIBGLIB12_SITE)/$(LIBGLIB12_SOURCE)
-
-libglib12-source: $(DL_DIR)/$(LIBGLIB12_SOURCE)
-
-$(LIBGLIB12_DIR)/.unpacked: $(DL_DIR)/$(LIBGLIB12_SOURCE)
-       $(LIBGLIB12_CAT) $(DL_DIR)/$(LIBGLIB12_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       bzcat $(LIBGLIB12_PATCH) | patch -p1 -d $(LIBGLIB12_DIR)
-       touch $(LIBGLIB12_DIR)/.unpacked
-
-$(LIBGLIB12_DIR)/.configured: $(LIBGLIB12_DIR)/.unpacked
-       (cd $(LIBGLIB12_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-               --enable-shared \
-       );
-       touch  $(LIBGLIB12_DIR)/.configured
-
-$(LIBGLIB12_DIR)/.libs/$(LIBGLIB12_BINARY): $(LIBGLIB12_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(LIBGLIB12_DIR)
-
-$(STAGING_DIR)/lib/$(LIBGLIB12_BINARY): $(LIBGLIB12_DIR)/.libs/$(LIBGLIB12_BINARY)
-       $(MAKE) prefix=$(STAGING_DIR) \
-           exec_prefix=$(STAGING_DIR) \
-           bindir=$(STAGING_DIR)/bin \
-           sbindir=$(STAGING_DIR)/sbin \
-           libexecdir=$(STAGING_DIR)/libexec \
-           datadir=$(STAGING_DIR)/share \
-           sysconfdir=$(STAGING_DIR)/etc \
-           sharedstatedir=$(STAGING_DIR)/com \
-           localstatedir=$(STAGING_DIR)/var \
-           libdir=$(STAGING_DIR)/lib \
-           includedir=$(STAGING_DIR)/include \
-           oldincludedir=$(STAGING_DIR)/include \
-           infodir=$(STAGING_DIR)/info \
-           mandir=$(STAGING_DIR)/man \
-           -C $(LIBGLIB12_DIR) install;
-
-$(TARGET_DIR)/lib/$(LIBGLIB12_BINARY): $(STAGING_DIR)/lib/$(LIBGLIB12_BINARY)
-       cp -a $(STAGING_DIR)/lib/$(LIBGLIB12_BINARY) $(TARGET_DIR)/lib/
-       cp -a $(STAGING_DIR)/lib/libglib.so $(TARGET_DIR)/lib/
-       cp -a $(STAGING_DIR)/lib/libglib-1.2.so.0 $(TARGET_DIR)/lib/
-       $(STRIP)  $(TARGET_DIR)/lib/$(LIBGLIB12_BINARY)
-
-libglib12: uclibc $(TARGET_DIR)/lib/$(LIBGLIB12_BINARY)
-
-libglib12-clean:
-       rm -f $(TARGET_DIR)/lib/$(LIBGLIB12_BINARY)
-       -$(MAKE) -C $(LIBGLIB12_DIR) clean
-
-libglib12-dirclean:
-       rm -rf $(LIBGLIB12_DIR)
-
diff --git a/obsolete-buildroot/make/libmad.mk b/obsolete-buildroot/make/libmad.mk
deleted file mode 100644 (file)
index fc07720..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#############################################################
-#
-# libmad
-#
-#############################################################
-
-LIBMAD_VERSION=0.15.0b
-
-# Don't alter below this line unless you (think) you know
-# what you are doing! Danger, Danger!
-
-LIBMAD_SOURCE=libmad-$(LIBMAD_VERSION).tar.gz
-LIBMAD_SITE=http://easynews.dl.sourceforge.net/sourceforge/mad/
-LIBMAD_DIR=$(BUILD_DIR)/${shell basename $(LIBMAD_SOURCE) .tar.gz}
-LIBMAD_WORKDIR=$(BUILD_DIR)/libmad-$(LIBMAD_VERSION)
-
-$(DL_DIR)/$(LIBMAD_SOURCE):
-       $(WGET) -P $(DL_DIR) $(LIBMAD_SITE)/$(LIBMAD_SOURCE)
-
-$(LIBMAD_DIR)/.unpacked:       $(DL_DIR)/$(LIBMAD_SOURCE)
-       gzip -d -c $(DL_DIR)/$(LIBMAD_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(LIBMAD_DIR)/.unpacked
-
-$(LIBMAD_DIR)/.configured: $(LIBMAD_DIR)/.unpacked
-       (cd $(LIBMAD_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --sysconfdir=/etc \
-               $(DISABLE_NLS) \
-       );
-       touch  $(LIBMAD_DIR)/.configured
-
-$(LIBMAD_WORKDIR)/libmad:      $(LIBMAD_DIR)/.configured
-       rm -f $@
-       $(MAKE) CC=$(TARGET_CC) -C $(LIBMAD_WORKDIR)
-
-$(LIBMAD_WORKDIR)/.installed:  $(LIBMAD_WORKDIR)/libmad
-       $(MAKE) prefix=$(TARGET_DIR)/usr -C $(LIBMAD_WORKDIR) install
-       touch $(LIBMAD_WORKDIR)/.installed
-
-libmad:        uclibc $(LIBMAD_WORKDIR)/.installed
-
-libmad-source: $(DL_DIR)/$(LIBMAD_SOURCE)
-
-libmad-clean:
-       @if [ -d $(LIBMAD_WORKDIR)/Makefile ] ; then \
-               $(MAKE) -C $(LIBMAD_WORKDIR) clean ; \
-       fi;
-
-libmad-dirclean:
-       rm -rf $(LIBMAD_DIR) $(LIBMAD_WORKDIR)
-
diff --git a/obsolete-buildroot/make/libpcap.mk b/obsolete-buildroot/make/libpcap.mk
deleted file mode 100644 (file)
index c63d08f..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-## libpcap
-
-LIBPCAP_VERSION:=0.8.3
-LIBPCAP_RELEASE:=1
-
-LIBPCAP_SOURCE:=libpcap-$(LIBPCAP_VERSION).tar.gz
-LIBPCAP_SITE:=http://www.tcpdump.org/release/
-LIBPCAP_DIR:=$(BUILD_DIR)/libpcap-$(LIBPCAP_VERSION)
-LIBPCAP_CAT:=zcat
-
-LIBPCAP_PATCH_DIR := $(SOURCE_DIR)/openwrt/patches/libpcap
-
-LIBPCAP_BUILD_DIR := $(BUILD_DIR)/libpcap_$(LIBPCAP_VERSION)-$(LIBPCAP_RELEASE)
-LIBPCAP_IPK_DIR := $(OPENWRT_IPK_DIR)/libpcap
-LIBPCAP_IPK := $(LIBPCAP_BUILD_DIR)_$(ARCH).ipk
-
-
-$(DL_DIR)/$(LIBPCAP_SOURCE):
-        $(WGET) -P $(DL_DIR) $(LIBPCAP_SITE)/$(LIBPCAP_SOURCE)
-
-
-$(LIBPCAP_DIR)/.stamp-unpacked: $(DL_DIR)/$(LIBPCAP_SOURCE)
-       $(LIBPCAP_CAT) $(DL_DIR)/$(LIBPCAP_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-
-       touch $(LIBPCAP_DIR)/.stamp-unpacked
-
-
-$(LIBPCAP_DIR)/.stamp-patched: $(LIBPCAP_DIR)/.stamp-unpacked
-       $(SOURCE_DIR)/patch-kernel.sh $(LIBPCAP_DIR) $(LIBPCAP_PATCH_DIR)
-       $(SOURCE_DIR)/patch-kernel.sh $(LIBPCAP_DIR) $(LIBPCAP_DIR)/debian/patches *patch
-
-       touch $(LIBPCAP_DIR)/.stamp-patched
-
-
-$(LIBPCAP_DIR)/.stamp-configured: $(LIBPCAP_DIR)/.stamp-patched
-       cd $(LIBPCAP_DIR) ; \
-       rm -rf config.cache ; \
-       $(TARGET_CONFIGURE_OPTS) \
-       CFLAGS="$(TARGET_CFLAGS)" \
-       ac_cv_linux_vers="2" \
-       ./configure \
-         --target=$(GNU_TARGET_NAME) \
-         --host=$(GNU_TARGET_NAME) \
-         --build=$(GNU_HOST_NAME) \
-         --prefix=/usr \
-         --exec-prefix=/usr \
-         --bindir=/usr/bin \
-         --sbindir=/usr/sbin \
-         --libexecdir=/usr/lib/locate \
-         --sysconfdir=/etc \
-         --datadir=/usr/share \
-         --localstatedir=/var/lib \
-         --mandir=/usr/share/man \
-         --infodir=/usr/share/info \
-         --includedir=/usr/include \
-         --libdir=/usr/lib \
-         $(DISABLE_NLS) \
-         --enable-shared \
-         --disable-static \
-         --with-pcap=linux \
-
-       touch $(LIBPCAP_DIR)/.stamp-configured
-
-
-$(LIBPCAP_DIR)/.stamp-built: $(LIBPCAP_DIR)/.stamp-configured
-       cd $(LIBPCAP_DIR) ; \
-       $(MAKE) \
-         CC=$(TARGET_CC) \
-         CCOPT="$(TARGET_OPTIMIZATION)" \
-
-       touch $(LIBPCAP_DIR)/.stamp-built
-
-
-$(LIBPCAP_DIR)/.stamp-installed: $(LIBPCAP_DIR)/.stamp-built
-       mkdir -p $(LIBPCAP_BUILD_DIR)
-       cd $(LIBPCAP_DIR) ; \
-       $(MAKE) \
-         DESTDIR="$(LIBPCAP_BUILD_DIR)" \
-        install \
-        
-       install -m0644 $(LIBPCAP_BUILD_DIR)/usr/include/pcap*.h $(STAGING_DIR)/include/
-       install -m0644 $(LIBPCAP_BUILD_DIR)/usr/lib/libpcap.a $(STAGING_DIR)/lib/
-       install -m0755 $(LIBPCAP_BUILD_DIR)/usr/lib/libpcap.so* $(STAGING_DIR)/lib/
-
-       rm -rf $(LIBPCAP_BUILD_DIR)/usr/share
-       rm -rf $(LIBPCAP_BUILD_DIR)/usr/include
-       rm -rf $(LIBPCAP_BUILD_DIR)/usr/lib/*.a
-       rm -rf $(LIBPCAP_BUILD_DIR)/usr/lib/*.so
-
-       $(STRIP) $(LIBPCAP_BUILD_DIR)/usr/lib/libpcap.so.*
-       
-       touch $(LIBPCAP_DIR)/.stamp-installed
-
-
-$(LIBPCAP_IPK): $(LIBPCAP_DIR)/.stamp-installed
-       cp -a $(LIBPCAP_IPK_DIR)/CONTROL $(LIBPCAP_BUILD_DIR)/
-       perl -pi -e "s/^Vers.*:.*$$/Version: $(LIBPCAP_VERSION)-$(LIBPCAP_RELEASE)/" $(LIBPCAP_BUILD_DIR)/CONTROL/control
-       perl -pi -e "s/^Arch.*:.*$$/Architecture: $(ARCH)/" $(LIBPCAP_BUILD_DIR)/CONTROL/control
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(LIBPCAP_BUILD_DIR)
-
-
-libpcap-source: $(DL_DIR)/$(LIBPCAP_SOURCE)
-
-libpcap-ipk: ipkg-utils $(LIBPCAP_IPK)
-
-libpcap-clean:
-       $(MAKE) -C $(LIBPCAP_DIR) clean
-
-libpcap-clean-all:
-       rm -rf $(LIBPCAP_DIR)
-       rm -rf $(LIBPCAP_BUILD_DIR)
-       rm -rf $(LIBPCAP_IPK)
-       rm -rf $(STAGING_DIR)/include/pcap*.h
-       rm -rf $(STAGING_DIR)/lib/libpcap.a
-       rm -rf $(STAGING_DIR)/lib/libpcap.so*
diff --git a/obsolete-buildroot/make/libpthread.mk b/obsolete-buildroot/make/libpthread.mk
deleted file mode 100644 (file)
index d247337..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-libpthread-ipk: ipkg-utils $(OPENWRT_IPK_DIR)/libpthread/CONTROL/*
-       chmod a+x $(OPENWRT_IPK_DIR)/libpthread/CONTROL/rules
-       cd $(OPENWRT_IPK_DIR)/libpthread ; $(IPKG_BUILDPACKAGE)
-       mv $(OPENWRT_IPK_DIR)/libpthread_*.ipk $(BUILD_DIR)
\ No newline at end of file
diff --git a/obsolete-buildroot/make/libtool.mk b/obsolete-buildroot/make/libtool.mk
deleted file mode 100644 (file)
index fbe1fb6..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#############################################################
-#
-# libtool
-#
-#############################################################
-LIBTOOL_SOURCE:=libtool_1.4.3.orig.tar.gz
-LIBTOOL_SITE:=http://ftp.debian.org/debian/pool/main/libt/libtool
-LIBTOOL_CAT:=zcat
-LIBTOOL_DIR:=$(BUILD_DIR)/libtool-1.4.3
-LIBTOOL_BINARY:=libtool
-LIBTOOL_TARGET_BINARY:=usr/bin/libtool
-
-$(DL_DIR)/$(LIBTOOL_SOURCE):
-        $(WGET) -P $(DL_DIR) $(LIBTOOL_SITE)/$(LIBTOOL_SOURCE)
-
-libtool-source: $(DL_DIR)/$(LIBTOOL_SOURCE)
-
-$(LIBTOOL_DIR)/.unpacked: $(DL_DIR)/$(LIBTOOL_SOURCE)
-       $(LIBTOOL_CAT) $(DL_DIR)/$(LIBTOOL_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(LIBTOOL_DIR)/.unpacked
-
-$(LIBTOOL_DIR)/.configured: $(LIBTOOL_DIR)/.unpacked
-       (cd $(LIBTOOL_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-       );
-       touch  $(LIBTOOL_DIR)/.configured
-
-$(LIBTOOL_DIR)/$(LIBTOOL_BINARY): $(LIBTOOL_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(LIBTOOL_DIR)
-       touch -c $(LIBTOOL_DIR)/$(LIBTOOL_BINARY)
-
-$(TARGET_DIR)/$(LIBTOOL_TARGET_BINARY): $(LIBTOOL_DIR)/$(LIBTOOL_BINARY)
-       $(MAKE) \
-           prefix=$(TARGET_DIR)/usr \
-           exec_prefix=$(TARGET_DIR)/usr \
-           bindir=$(TARGET_DIR)/usr/bin \
-           sbindir=$(TARGET_DIR)/usr/sbin \
-           libexecdir=$(TARGET_DIR)/usr/lib \
-           datadir=$(TARGET_DIR)/usr/share \
-           sysconfdir=$(TARGET_DIR)/etc \
-           localstatedir=$(TARGET_DIR)/var \
-           libdir=$(TARGET_DIR)/usr/lib \
-           infodir=$(TARGET_DIR)/usr/info \
-           mandir=$(TARGET_DIR)/usr/man \
-           includedir=$(TARGET_DIR)/usr/include \
-           -C $(LIBTOOL_DIR) install;
-       $(STRIP) $(TARGET_DIR)//usr/lib/libltdl.so.*.*.* > /dev/null 2>&1
-       $(SED) "s,^CC.*,CC=\"/usr/bin/gcc\"," $(TARGET_DIR)/usr/bin/libtool
-       $(SED) "s,^LD.*,LD=\"/usr/bin/ld\"," $(TARGET_DIR)/usr/bin/libtool
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-
-libtool: uclibc $(TARGET_DIR)/$(LIBTOOL_TARGET_BINARY)
-
-libtool-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(LIBTOOL_DIR) uninstall
-       -$(MAKE) -C $(LIBTOOL_DIR) clean
-
-libtool-dirclean:
-       rm -rf $(LIBTOOL_DIR)
-
diff --git a/obsolete-buildroot/make/links.mk b/obsolete-buildroot/make/links.mk
deleted file mode 100644 (file)
index 28c5a9c..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#############################################################
-#
-# links (text based web browser)
-#
-#############################################################
-LINKS_SITE:=http://artax.karlin.mff.cuni.cz/~mikulas/vyplody/links/download/no-ssl
-LINKS_SOURCE:=links-0.99pre9-no-ssl.tar.gz
-LINKS_DIR:=$(BUILD_DIR)/links-0.99pre9-no-ssl
-
-$(DL_DIR)/$(LINKS_SOURCE):
-       $(WGET) -P $(DL_DIR) $(LINKS_SITE)/$(LINKS_SOURCE)
-
-links-source: $(DL_DIR)/$(LINKS_SOURCE)
-
-$(LINKS_DIR)/.unpacked: $(DL_DIR)/$(LINKS_SOURCE)
-       zcat $(DL_DIR)/$(LINKS_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch  $(LINKS_DIR)/.unpacked
-
-$(LINKS_DIR)/.configured: $(LINKS_DIR)/.unpacked
-       (cd $(LINKS_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/tmp \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-       );
-       touch  $(LINKS_DIR)/.configured
-
-$(LINKS_DIR)/links: $(LINKS_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(LINKS_DIR)
-       $(STRIP) $(LINKS_DIR)/links
-
-$(TARGET_DIR)/usr/bin/links: $(LINKS_DIR)/links
-       install -c $(LINKS_DIR)/links $(TARGET_DIR)/usr/bin/links
-
-links-clean: 
-       $(MAKE) -C $(LINKS_DIR) clean
-
-links-dirclean: 
-       rm -rf $(LINKS_DIR) 
-
-links: uclibc $(TARGET_DIR)/usr/bin/links
-
diff --git a/obsolete-buildroot/make/lrzsz.mk b/obsolete-buildroot/make/lrzsz.mk
deleted file mode 100644 (file)
index 222d64a..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#############################################################
-#
-# lrzsz (provides zmodem)
-#
-#############################################################
-# Copyright (C) 2001-2003 by Erik Andersen <andersen@codepoet.org>
-# Copyright (C) 2002 by Tim Riker <Tim@Rikers.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Library General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-
-LRZSZ_SITE:=http://www.ohse.de/uwe/releases
-LRZSZ_SOURCE:=lrzsz-0.12.20.tar.gz
-LRZSZ_DIR:=$(BUILD_DIR)/lrzsz-0.12.20
-
-$(DL_DIR)/$(LRZSZ_SOURCE):
-       $(WGET) -P $(DL_DIR) $(LRZSZ_SITE)/$(LRZSZ_SOURCE)
-
-lrzsz-source: $(DL_DIR)/$(LRZSZ_SOURCE)
-
-$(LRZSZ_DIR)/.unpacked: $(DL_DIR)/$(LRZSZ_SOURCE)
-       zcat $(DL_DIR)/$(LRZSZ_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch  $(LRZSZ_DIR)/.unpacked
-
-$(LRZSZ_DIR)/.configured: $(LRZSZ_DIR)/.unpacked
-       (cd $(LRZSZ_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/tmp \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-               --disable-timesync \
-       );
-       $(SED) "s/-lnsl//;" $(LRZSZ_DIR)/src/Makefile
-       $(SED) "s~\(#define ENABLE_SYSLOG.*\)~/* \1 */~;" $(LRZSZ_DIR)/config.h
-       touch  $(LRZSZ_DIR)/.configured
-
-$(LRZSZ_DIR)/src/lrz: $(LRZSZ_DIR)/.configured
-       $(MAKE) CROSS_COMPILE="$(TARGET_CROSS)" prefix="$(TARGET_DIR)" -C $(LRZSZ_DIR)
-       $(STRIP) $(LRZSZ_DIR)/src/lrz $(LRZSZ_DIR)/src/lsz
-
-$(TARGET_DIR)/usr/bin/rz: $(LRZSZ_DIR)/src/lrz
-       cp $(LRZSZ_DIR)/src/lrz $(TARGET_DIR)/usr/bin/rz
-       cp $(LRZSZ_DIR)/src/lsz $(TARGET_DIR)/usr/bin/sz
-
-lrzsz: uclibc $(TARGET_DIR)/usr/bin/rz
-
-lrzsz-clean:
-       rm -f $(TARGET_DIR)/usr/bin/rz
-       -$(MAKE) -C $(LRZSZ_DIR) clean
-
-lrzsz-dirclean:
-       rm -rf $(LRZSZ_DIR)
diff --git a/obsolete-buildroot/make/ltp-testsuite.mk b/obsolete-buildroot/make/ltp-testsuite.mk
deleted file mode 100644 (file)
index cb4a016..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#############################################################
-#
-# ltp-testsuite
-#
-#############################################################
-LTP_TESTSUITE_SOURCE:=ltp-full-20040206.tgz
-LTP_TESTSUITE_SITE:=http://aleron.dl.sourceforge.net/sourceforge/ltp
-LTP_TESTSUITE_CAT:=zcat
-LTP_TESTSUITE_DIR:=$(BUILD_DIR)/ltp-full-20040206
-LTP_TESTSUITE_PATCH:=$(SOURCE_DIR)/ltp-testsuite.patch
-
-
-$(DL_DIR)/$(LTP_TESTSUITE_SOURCE):
-        $(WGET) -P $(DL_DIR) $(LTP_TESTSUITE_SITE)/$(LTP_TESTSUITE_SOURCE)
-
-ltp-testsuite-source: $(DL_DIR)/$(LTP_TESTSUITE_SOURCE)
-
-$(LTP_TESTSUITE_DIR)/.unpacked: $(DL_DIR)/$(LTP_TESTSUITE_SOURCE)
-       $(LTP_TESTSUITE_CAT) $(DL_DIR)/$(LTP_TESTSUITE_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       cat $(LTP_TESTSUITE_PATCH) | patch -p1 -d $(LTP_TESTSUITE_DIR)
-       touch $(LTP_TESTSUITE_DIR)/.unpacked
-
-$(LTP_TESTSUITE_DIR)/ltp-testsuite: $(LTP_TESTSUITE_DIR)/.unpacked
-       $(MAKE) $(TARGET_CONFIGURE_OPTS) CROSS_COMPILER=$(TARGET_CROSS) \
-               -C $(LTP_TESTSUITE_DIR)
-
-$(TARGET_DIR)/usr/bin/ltp-testsuite: $(LTP_TESTSUITE_DIR)/ltp-testsuite
-       $(MAKE) $(TARGET_CONFIGURE_OPTS) CROSS_COMPILER=$(TARGET_CROSS) \
-               -C $(LTP_TESTSUITE_DIR) install
-
-ltp-testsuite: uclibc $(TARGET_DIR)/usr/bin/ltp-testsuite
-
-ltp-testsuite-clean:
-       $(MAKE) -C $(LTP_TESTSUITE_DIR) clean
-
-ltp-testsuite-dirclean:
-       rm -rf $(LTP_TESTSUITE_DIR)
-
-
diff --git a/obsolete-buildroot/make/ltrace.mk b/obsolete-buildroot/make/ltrace.mk
deleted file mode 100644 (file)
index 9b41626..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#############################################################
-#
-# ltrace
-#
-#############################################################
-LTRACE_SOURCE=ltrace_0.3.31.tar.gz
-LTRACE_SITE=http://ftp.debian.org/debian/pool/main/l/ltrace
-LTRACE_DIR=$(BUILD_DIR)/ltrace-0.3.31
-LTRACE_BINARY=ltrace
-LTRACE_TARGET_BINARY=usr/bin/ltrace
-
-$(DL_DIR)/$(LTRACE_SOURCE):
-       $(WGET) -P $(DL_DIR) $(LTRACE_SITE)/$(LTRACE_SOURCE)
-
-$(LTRACE_DIR)/.source: $(DL_DIR)/$(LTRACE_SOURCE)
-       zcat $(DL_DIR)/$(LTRACE_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(LTRACE_DIR)/.source
-
-$(LTRACE_DIR)/.configured: $(LTRACE_DIR)/.source
-       (cd $(LTRACE_DIR); \
-               $(TARGET_CONFIGURE_OPTS) \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --sysconfdir=/etc \
-       );
-       touch $(LTRACE_DIR)/.configured;
-
-$(LTRACE_DIR)/$(LTRACE_BINARY): $(LTRACE_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(LTRACE_DIR)
-
-$(TARGET_DIR)/$(LTRACE_TARGET_BINARY): $(LTRACE_DIR)/$(LTRACE_BINARY)
-       $(MAKE) DESTDIR=$(TARGET_DIR) -C $(LTRACE_DIR) install
-       rm -Rf $(TARGET_DIR)/usr/man
-
-ltrace: uclibc $(TARGET_DIR)/$(LTRACE_TARGET_BINARY)
-
-ltrace-source: $(DL_DIR)/$(LTRACE_SOURCE)
-
-ltrace-clean:
-       $(MAKE) prefix=$(TARGET_DIR)/usr -C $(LTRACE_DIR) uninstall
-       -$(MAKE) -C $(LTRACE_DIR) clean
-
-ltrace-dirclean:
-       rm -rf $(LTRACE_DIR)
-
diff --git a/obsolete-buildroot/make/lzo.mk b/obsolete-buildroot/make/lzo.mk
deleted file mode 100644 (file)
index 48e9d7b..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#############################################################
-#
-# lzo
-#
-# Note: this builds only a static library, it does not provide
-#       anything to be installed into the target system.
-#
-#############################################################
-LZO_SOURCE:=lzo_1.08.orig.tar.gz
-LZO_SITE:=http://ftp.debian.org/debian/pool/main/l/lzo
-#LZO_SOURCE:=lzo-1.08.tar.bz2
-#LZO_SITE:=http://www.oberhumer.com/opensource/lzo/download
-LZO_DIR:=$(BUILD_DIR)/lzo-1.08
-LZO_CAT:=zcat
-LZO_PATCH:=$(SOURCE_DIR)/lzo-cross-compile.patch
-
-$(DL_DIR)/$(LZO_SOURCE):
-        $(WGET) -P $(DL_DIR) $(LZO_SITE)/$(LZO_SOURCE)
-
-lzo-source: $(DL_DIR)/$(LZO_SOURCE)
-
-$(LZO_DIR)/.unpacked: $(DL_DIR)/$(LZO_SOURCE)
-       $(LZO_CAT) $(DL_DIR)/$(LZO_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       cat $(LZO_PATCH) | patch -p1 -d $(LZO_DIR)
-       touch $(LZO_DIR)/.unpacked
-
-LZO_CONFIG_SHARED:=--disable-shared
-#LZO_CONFIG_SHARED:=--enable-shared
-
-$(LZO_DIR)/.configured: $(LZO_DIR)/.unpacked
-       (cd $(LZO_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(LZO_CONFIG_SHARED) \
-       );
-       touch  $(LZO_DIR)/.configured
-
-$(LZO_DIR)/src/liblzo.la: $(LZO_DIR)/.configured
-       $(MAKE) -C $(LZO_DIR)
-
-$(STAGING_DIR)/lib/liblzo.a: $(LZO_DIR)/src/liblzo.la
-       $(MAKE) CC=$(TARGET_CC) DESTDIR=$(STAGING_DIR) -C $(LZO_DIR) install
-
-lzo: uclibc $(STAGING_DIR)/lib/liblzo.a
-
-lzo-clean:
-       $(MAKE) DESTDIR=$(STAGING_DIR) -C $(LZO_DIR) uninstall
-       -$(MAKE) -C $(LZO_DIR) clean
-
-lzo-dirclean:
-       rm -rf $(LZO_DIR)
-
diff --git a/obsolete-buildroot/make/m4.mk b/obsolete-buildroot/make/m4.mk
deleted file mode 100644 (file)
index 5a09889..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#############################################################
-#
-# m4
-#
-#############################################################
-M4_SOURCE:=m4-1.4.tar.gz
-M4_SITE:=ftp://ftp.gnu.org/gnu/m4
-M4_CAT:=zcat
-M4_DIR:=$(BUILD_DIR)/m4-1.4
-M4_BINARY:=m4
-M4_TARGET_BINARY:=usr/bin/m4
-
-$(DL_DIR)/$(M4_SOURCE):
-        $(WGET) -P $(DL_DIR) $(M4_SITE)/$(M4_SOURCE)
-
-m4-source: $(DL_DIR)/$(M4_SOURCE)
-
-$(M4_DIR)/.unpacked: $(DL_DIR)/$(M4_SOURCE)
-       $(M4_CAT) $(DL_DIR)/$(M4_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(M4_DIR)/.unpacked
-
-$(M4_DIR)/.configured: $(M4_DIR)/.unpacked
-       (cd $(M4_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-       );
-       touch  $(M4_DIR)/.configured
-
-$(M4_DIR)/src/$(M4_BINARY): $(M4_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(M4_DIR)
-
-$(TARGET_DIR)/$(M4_TARGET_BINARY): $(M4_DIR)/src/$(M4_BINARY)
-       $(MAKE) \
-           prefix=$(TARGET_DIR)/usr \
-           exec_prefix=$(TARGET_DIR)/usr \
-           bindir=$(TARGET_DIR)/usr/bin \
-           sbindir=$(TARGET_DIR)/usr/sbin \
-           libexecdir=$(TARGET_DIR)/usr/lib \
-           datadir=$(TARGET_DIR)/usr/share \
-           sysconfdir=$(TARGET_DIR)/etc \
-           localstatedir=$(TARGET_DIR)/var \
-           libdir=$(TARGET_DIR)/usr/lib \
-           infodir=$(TARGET_DIR)/usr/info \
-           mandir=$(TARGET_DIR)/usr/man \
-           includedir=$(TARGET_DIR)/usr/include \
-           -C $(M4_DIR) install;
-       $(STRIP) $(TARGET_DIR)/$(M4_TARGET_BINARY) > /dev/null 2>&1
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-
-m4: uclibc $(TARGET_DIR)/$(M4_TARGET_BINARY)
-
-m4-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(M4_DIR) uninstall
-       -$(MAKE) -C $(M4_DIR) clean
-
-m4-dirclean:
-       rm -rf $(M4_DIR)
-
diff --git a/obsolete-buildroot/make/make.mk b/obsolete-buildroot/make/make.mk
deleted file mode 100644 (file)
index ec508fe..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-#############################################################
-#
-# make
-#
-#############################################################
-GNUMAKE_SOURCE:=make-3.80.tar.bz2
-GNUMAKE_SITE:=ftp://ftp.gnu.org/gnu/make
-GNUMAKE_DIR:=$(BUILD_DIR)/make-3.80
-GNUMAKE_CAT:=bzcat
-GNUMAKE_BINARY:=make
-GNUMAKE_TARGET_BINARY:=usr/bin/make
-
-$(DL_DIR)/$(GNUMAKE_SOURCE):
-        $(WGET) -P $(DL_DIR) $(GNUMAKE_SITE)/$(GNUMAKE_SOURCE)
-
-make-source: $(DL_DIR)/$(GNUMAKE_SOURCE)
-
-$(GNUMAKE_DIR)/.unpacked: $(DL_DIR)/$(GNUMAKE_SOURCE)
-       $(GNUMAKE_CAT) $(DL_DIR)/$(GNUMAKE_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(GNUMAKE_DIR)/.unpacked
-
-$(GNUMAKE_DIR)/.configured: $(GNUMAKE_DIR)/.unpacked
-       (cd $(GNUMAKE_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-               $(DISABLE_LARGEFILE) \
-       );
-       touch  $(GNUMAKE_DIR)/.configured
-
-$(GNUMAKE_DIR)/$(GNUMAKE_BINARY): $(GNUMAKE_DIR)/.configured
-       $(MAKE) -C $(GNUMAKE_DIR)
-
-$(TARGET_DIR)/$(GNUMAKE_TARGET_BINARY): $(GNUMAKE_DIR)/$(GNUMAKE_BINARY)
-       $(MAKE) DESTDIR=$(TARGET_DIR) -C $(GNUMAKE_DIR) install
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-
-make: uclibc $(TARGET_DIR)/$(GNUMAKE_TARGET_BINARY)
-
-make-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) -C $(GNUMAKE_DIR) uninstall
-       -$(MAKE) -C $(GNUMAKE_DIR) clean
-
-make-dirclean:
-       rm -rf $(GNUMAKE_DIR)
-
diff --git a/obsolete-buildroot/make/matrixssl.mk b/obsolete-buildroot/make/matrixssl.mk
deleted file mode 100644 (file)
index c71d224..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-## matrixssl
-
-MATRIXSSL_VERSION := 1.2.1
-MATRIXSSL_RELEASE := 1
-
-MATRIXSSL_SOURCE := matrixssl-1-2-1.tar.gz
-#MATRIXSSL_SITE := http://www.matrixssl.org/
-MATRIXSSL_SITE := http://nthill.free.fr/openwrt/sources/
-MATRIXSSL_DIR := $(BUILD_DIR)/matrixssl
-MATRIXSSL_CAT := zcat
-
-MATRIXSSL_PATCH_DIR := $(SOURCE_DIR)/openwrt/patches/matrixssl
-
-MATRIXSSL_BUILD_DIR := $(BUILD_DIR)/libmatrixssl_$(MATRIXSSL_VERSION)-$(MATRIXSSL_RELEASE)
-MATRIXSSL_IPK_DIR := $(OPENWRT_IPK_DIR)/libmatrixssl
-MATRIXSSL_IPK := $(MATRIXSSL_BUILD_DIR)_$(ARCH).ipk
-
-
-$(DL_DIR)/$(MATRIXSSL_SOURCE):
-        $(WGET) -P $(DL_DIR) $(MATRIXSSL_SITE)/$(MATRIXSSL_SOURCE)
-
-
-$(MATRIXSSL_DIR)/.stamp-unpacked: $(DL_DIR)/$(MATRIXSSL_SOURCE)
-       $(MATRIXSSL_CAT) $(DL_DIR)/$(MATRIXSSL_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-
-       touch $(MATRIXSSL_DIR)/.stamp-unpacked
-
-
-$(MATRIXSSL_DIR)/.stamp-patched: $(MATRIXSSL_DIR)/.stamp-unpacked
-       $(SOURCE_DIR)/patch-kernel.sh $(MATRIXSSL_DIR) $(MATRIXSSL_PATCH_DIR)
-
-       touch $(MATRIXSSL_DIR)/.stamp-patched
-
-
-$(MATRIXSSL_DIR)/.stamp-built: $(MATRIXSSL_DIR)/.stamp-patched
-       cd  $(MATRIXSSL_DIR) ; \
-       $(MAKE) -C src \
-         CC=$(TARGET_CC) \
-         DFLAGS="$(TARGET_CFLAGS)" \
-         STRIP=/bin/true \
-        all
-
-       touch $(MATRIXSSL_DIR)/.stamp-built
-
-
-$(MATRIXSSL_BUILD_DIR): $(MATRIXSSL_DIR)/.stamp-built
-       mkdir -p $(MATRIXSSL_BUILD_DIR)
-        
-       install -m0755 -d $(STAGING_DIR)/include/matrixSsl
-       install -m0644 $(MATRIXSSL_DIR)/matrixSsl.h $(STAGING_DIR)/include/matrixSsl/
-       ln -fs matrixSsl/matrixSsl.h $(STAGING_DIR)/include/
-       install -m0755 $(MATRIXSSL_DIR)/src/libmatrixssl.so $(STAGING_DIR)/lib/libmatrixssl.so.$(MATRIXSSL_VERSION)
-       ln -fs libmatrixssl.so.$(MATRIXSSL_VERSION) $(STAGING_DIR)/lib/libmatrixssl.so.1.2
-       ln -fs libmatrixssl.so.1.2 $(STAGING_DIR)/lib/libmatrixssl.so
-
-       mkdir -p $(MATRIXSSL_BUILD_DIR)/usr/lib
-       cp -a $(STAGING_DIR)/lib/libmatrixssl.so.* $(MATRIXSSL_BUILD_DIR)/usr/lib/
-
-       $(STRIP) $(MATRIXSSL_BUILD_DIR)/usr/lib/libmatrixssl.so.*
-
-
-$(MATRIXSSL_IPK): $(MATRIXSSL_BUILD_DIR)
-       cp -a $(MATRIXSSL_IPK_DIR)/CONTROL $(MATRIXSSL_BUILD_DIR)/
-       perl -pi -e "s/^Vers.*:.*$$/Version: $(MATRIXSSL_VERSION)-$(MATRIXSSL_RELEASE)/" $(MATRIXSSL_BUILD_DIR)/CONTROL/control
-       perl -pi -e "s/^Arch.*:.*$$/Architecture: $(ARCH)/" $(MATRIXSSL_BUILD_DIR)/CONTROL/control
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(MATRIXSSL_BUILD_DIR)
-
-
-matrixssl-ipk: ipkg-utils libpthread-ipk $(MATRIXSSL_IPK)
-
-matrixssl-clean:
-       $(MAKE) -C $(MATRIXSSL_DIR) clean
-
-matrixssl-clean-all:
-       rm -rf $(MATRIXSSL_DIR)
-       rm -rf $(MATRIXSSL_BUILD_DIR)
-       rm -rf $(MATRIXSSL_IPK)
-       rm -rf $(STAGING_DIR)/include/pcap*.h
-       rm -rf $(STAGING_DIR)/lib/libpcap.a
-       rm -rf $(STAGING_DIR)/lib/libpcap.so*
diff --git a/obsolete-buildroot/make/microcom.mk b/obsolete-buildroot/make/microcom.mk
deleted file mode 100644 (file)
index bf01cf3..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#############################################################
-#
-# microcom terminal emulator
-#
-# Maintainer: Tim Riker <Tim@Rikers.org>
-#
-#############################################################
-# Copyright (C) 2001-2003 by Erik Andersen <andersen@codepoet.org>
-# Copyright (C) 2002 by Tim Riker <Tim@Rikers.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Library General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-
-# TARGETS
-# http://microcom.port5.com/m102.tar.gz
-MICROCOM_SITE:=http://microcom.port5.com/
-MICROCOM_SOURCE:=m102.tar.gz
-MICROCOM_DIR:=$(BUILD_DIR)/microcom-1.02
-
-$(DL_DIR)/$(MICROCOM_SOURCE):
-       $(WGET) -P $(DL_DIR) $(MICROCOM_SITE)/$(MICROCOM_SOURCE)
-
-microcom-source: $(DL_DIR)/$(MICROCOM_SOURCE)
-
-$(MICROCOM_DIR)/.unpacked: $(DL_DIR)/$(MICROCOM_SOURCE)
-       mkdir -p $(MICROCOM_DIR)
-       zcat $(DL_DIR)/$(MICROCOM_SOURCE) | tar -C $(MICROCOM_DIR) -xvf -
-       touch  $(MICROCOM_DIR)/.unpacked
-
-$(MICROCOM_DIR)/.configured: $(MICROCOM_DIR)/.unpacked
-       $(SED) 's~gcc~${TARGET_CC}~' $(MICROCOM_DIR)/Makefile
-       touch  $(MICROCOM_DIR)/.configured
-
-$(MICROCOM_DIR)/microcom: $(MICROCOM_DIR)/.configured
-       $(MAKE) -C $(MICROCOM_DIR)
-
-$(TARGET_DIR)/usr/bin/microcom: $(MICROCOM_DIR)/microcom
-       install -c $(MICROCOM_DIR)/microcom $(TARGET_DIR)/usr/bin/microcom
-
-microcom-clean: 
-       rm $(MICROCOM_DIR)/*.o
-
-microcom-dirclean: 
-       rm -rf $(MICROCOM_DIR) 
-
-microcom: uclibc $(TARGET_DIR)/usr/bin/microcom 
-
diff --git a/obsolete-buildroot/make/microwin.mk b/obsolete-buildroot/make/microwin.mk
deleted file mode 100644 (file)
index e59600f..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#############################################################
-#
-# Microwindows - 2003/11/17 Greg Haerr
-# (requires CVS 2003/11/17 or later)
-#
-#############################################################
-MICROWIN_SITE:=ftp://ftp.microwindows.org/pub/microwindows
-MICROWIN_SOURCE:=microwindows-src-snapshot.tar.gz
-MICROWIN_DIR:=$(BUILD_DIR)/microwin
-#MICROWIN_SOURCE:=microwindows-0.91.tar.gz
-#MICROWIN_DIR:=$(BUILD_DIR)/microwindows-0.91
-
-MICROWIN_CAT:=zcat
-MICROWIN_BINARY:=$(MICROWIN_DIR)/src/bin/nano-X
-MICROWIN_TARGET_BINARY:=$(TARGET_DIR)/usr/bin/nano-X
-
-MICROWIN_CONFIG:=$(MICROWIN_DIR)/src/Configs/config.uclibc
-
-$(DL_DIR)/$(MICROWIN_SOURCE):
-        $(WGET) -P $(DL_DIR) $(MICROWIN_SITE)/$(MICROWIN_SOURCE)
-
-microwin-source: $(DL_DIR)/$(MICROWIN_SOURCE)
-
-$(MICROWIN_DIR)/.unpacked: $(DL_DIR)/$(MICROWIN_SOURCE)
-       $(MICROWIN_CAT) $(DL_DIR)/$(MICROWIN_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(MICROWIN_DIR)/.unpacked
-
-$(MICROWIN_DIR)/.configured: $(MICROWIN_DIR)/.unpacked
-       (cd $(MICROWIN_DIR); \
-       );
-       touch  $(MICROWIN_DIR)/.configured
-
-$(MICROWIN_BINARY): $(MICROWIN_DIR)/.configured
-       $(MAKE) ARCH=LINUX-$(shell echo $(ARCH) | tr a-z A-Z) $(shell echo $(ARCH) | tr a-z A-Z)TOOLSPREFIX=$(TARGET_CROSS) CC=$(TARGET_CC) -C $(MICROWIN_DIR)/src CONFIG=$(MICROWIN_CONFIG)
-
-$(MICROWIN_TARGET_BINARY): $(MICROWIN_BINARY)
-       $(MAKE) INSTALL_PREFIX=$(TARGET_DIR)/usr INSTALL_OWNER1= INSTALL_OWNER2= CC=$(TARGET_CC) -C $(MICROWIN_DIR)/src CONFIG=$(MICROWIN_CONFIG) install
-
-microwin: uclibc $(MICROWIN_TARGET_BINARY)
-
-microwin-clean:
-       -$(MAKE) -C $(MICROWIN_DIR)/src clean
-
-microwin-dirclean:
-       rm -rf $(MICROWIN_DIR)
-
diff --git a/obsolete-buildroot/make/mkdosfs.mk b/obsolete-buildroot/make/mkdosfs.mk
deleted file mode 100644 (file)
index 98288af..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#############################################################
-#
-# mkdosfs
-#
-#############################################################
-MKDOSFS_SOURCE=dosfstools-2.8.src.tar.gz
-MKDOSFS_SITE=http://ftp.uni-erlangen.de/pub/Linux/LOCAL/dosfstools
-MKDOSFS_DIR=$(BUILD_DIR)/dosfstools-2.8
-MKDOSFS_CAT:=zcat
-MKDOSFS_BINARY:=mkdosfs/mkdosfs
-MKDOSFS_TARGET_BINARY:=sbin/mkdosfs
-ifeq ($(strip $(BUILD_WITH_LARGEFILE)),true)
-MKDOSFS_CFLAGS="-Os -g -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
-else
-MKDOSFS_CFLAGS="-Os -g"
-endif
-
-$(DL_DIR)/$(MKDOSFS_SOURCE):
-        $(WGET) -P $(DL_DIR) $(MKDOSFS_SITE)/$(MKDOSFS_SOURCE)
-
-mkdosfs-source: $(DL_DIR)/$(MKDOSFS_SOURCE)
-
-$(MKDOSFS_DIR)/.unpacked: $(DL_DIR)/$(MKDOSFS_SOURCE)
-       $(MKDOSFS_CAT) $(DL_DIR)/$(MKDOSFS_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(MKDOSFS_DIR)/.unpacked
-
-$(MKDOSFS_DIR)/$(MKDOSFS_BINARY): $(MKDOSFS_DIR)/.unpacked
-       $(MAKE) CFLAGS=$(MKDOSFS_CFLAGS) CC=$(TARGET_CC) -C $(MKDOSFS_DIR);
-       $(STRIP) $(MKDOSFS_DIR)/mkdosfs/mkdosfs;
-       touch -c $(MKDOSFS_DIR)/mkdosfs/mkdosfs
-
-$(TARGET_DIR)/$(MKDOSFS_TARGET_BINARY): $(MKDOSFS_DIR)/$(MKDOSFS_BINARY)
-       cp -a $(MKDOSFS_DIR)/$(MKDOSFS_BINARY) $(TARGET_DIR)/$(MKDOSFS_TARGET_BINARY)
-       touch -c $(TARGET_DIR)/sbin/mkdosfs
-
-mkdosfs: uclibc $(TARGET_DIR)/$(MKDOSFS_TARGET_BINARY)
-
-mkdosfs-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(MKDOSFS_DIR) uninstall
-       -$(MAKE) -C $(MKDOSFS_DIR) clean
-
-mkdosfs-dirclean:
-       rm -rf $(MKDOSFS_DIR)
-
diff --git a/obsolete-buildroot/make/mke2fs.mk b/obsolete-buildroot/make/mke2fs.mk
deleted file mode 100644 (file)
index 6168cfa..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-#############################################################
-#
-# mke2fs
-#
-#############################################################
-MKE2FS_SOURCE=e2fsprogs-1.27.tar.gz
-MKE2FS_SITE=http://aleron.dl.sourceforge.net/sourceforge/e2fsprogs
-MKE2FS_DIR=$(BUILD_DIR)/e2fsprogs-1.27
-MKE2FS_CAT:=zcat
-MKE2FS_BINARY:=misc/mke2fs
-MKE2FS_TARGET_BINARY:=sbin/mke2fs
-
-$(DL_DIR)/$(MKE2FS_SOURCE):
-        $(WGET) -P $(DL_DIR) $(MKE2FS_SITE)/$(MKE2FS_SOURCE)
-
-mke2fs-source: $(DL_DIR)/$(MKE2FS_SOURCE)
-
-$(MKE2FS_DIR)/.unpacked: $(DL_DIR)/$(MKE2FS_SOURCE)
-       $(MKE2FS_CAT) $(DL_DIR)/$(MKE2FS_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(MKE2FS_DIR)/.unpacked
-
-$(MKE2FS_DIR)/.configured: $(MKE2FS_DIR)/.unpacked
-       (cd $(MKE2FS_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --with-cc=$(TARGET_CC) \
-               --with-linker=$(TARGET_CROSS)ld \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               --disable-elf-shlibs --disable-swapfs \
-               --disable-debugfs --disable-imager \
-               --disable-resizer --disable-fsck \
-               --without-catgets $(DISABLE_NLS) \
-       );
-       touch  $(MKE2FS_DIR)/.configured
-
-$(MKE2FS_DIR)/$(MKE2FS_BINARY): $(MKE2FS_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(MKE2FS_DIR)
-       $(STRIP) $(MKE2FS_DIR)/misc/mke2fs $(MKE2FS_DIR)/misc/badblocks;
-       touch -c $(MKE2FS_DIR)/misc/mke2fs
-
-$(TARGET_DIR)/$(MKE2FS_TARGET_BINARY): $(MKE2FS_DIR)/$(MKE2FS_BINARY)
-       #$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(MKE2FS_DIR) install
-       #rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-       #       $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-       # Only install a few selected items...
-       cp -dpf $(MKE2FS_DIR)/misc/mke2fs $(TARGET_DIR)/sbin/mke2fs;
-       cp -dpf $(MKE2FS_DIR)/misc/badblocks $(TARGET_DIR)/sbin/badblocks;
-       touch -c $(TARGET_DIR)/sbin/mke2fs
-
-mke2fs: uclibc $(TARGET_DIR)/$(MKE2FS_TARGET_BINARY)
-
-mke2fs-clean:
-       #$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(MKE2FS_DIR) uninstall
-       rm -f $(TARGET_DIR)/sbin/mke2fs $(TARGET_DIR)/sbin/badblocks;
-       -$(MAKE) -C $(MKE2FS_DIR) clean
-
-mke2fs-dirclean:
-       rm -rf $(MKE2FS_DIR)
-
diff --git a/obsolete-buildroot/make/mrouted.mk b/obsolete-buildroot/make/mrouted.mk
deleted file mode 100644 (file)
index 13a4f8c..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#############################################################
-#
-# mrouted
-#
-#
-#############################################################
-MROUTED_SOURCE:=mrouted_3.9-beta3.orig.tar.gz
-MROUTED_SITE:=http://ftp.debian.org/debian/pool/non-free/m/mrouted
-MROUTED_DIR:=$(BUILD_DIR)/mrouted-3.9-beta3.orig
-MROUTED_CAT:=zcat
-#MROUTED_PATCH:=$(SOURCE_DIR)/mrouted_3.9-beta3-1.1.diff
-MROUTED_PATCH:=mrouted_3.9-beta3-1.1.diff.gz
-MROUTED_BINARY:=mrouted
-MROUTED_TARGET_BINARY:=usr/sbin/mrouted
-
-$(DL_DIR)/$(MROUTED_SOURCE):
-        $(WGET) -P $(DL_DIR) $(MROUTED_SITE)/$(MROUTED_SOURCE)
-
-$(DL_DIR)/$(MROUTED_PATCH):
-        $(WGET) -P $(DL_DIR) $(MROUTED_SITE)/$(MROUTED_PATCH)
-
-mrouted-source: $(DL_DIR)/$(MROUTED_SOURCE) $(DL_DIR)/$(MROUTED_PATCH)
-
-$(MROUTED_DIR)/.unpacked: mrouted-source
-       $(MROUTED_CAT) $(DL_DIR)/$(MROUTED_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       $(MROUTED_CAT) $(DL_DIR)/$(MROUTED_PATCH) | patch -p1 -d $(MROUTED_DIR)
-       $(SOURCE_DIR)/patch-kernel.sh $(MROUTED_DIR) $(SOURCE_DIR) mrouted-*.patch
-       touch $(MROUTED_DIR)/.unpacked
-
-$(MROUTED_DIR)/$(MROUTED_BINARY): $(MROUTED_DIR)/.unpacked
-       $(TARGET_CONFIGURE_OPTS) \
-       $(MAKE) CC=$(TARGET_CC) -C $(MROUTED_DIR)
-
-$(TARGET_DIR)/$(MROUTED_TARGET_BINARY): $(MROUTED_DIR)/$(MROUTED_BINARY)
-       cp -a $(MROUTED_DIR)/$(MROUTED_BINARY) $(TARGET_DIR)/$(MROUTED_TARGET_BINARY)
-
-mrouted: uclibc $(TARGET_DIR)/$(MROUTED_TARGET_BINARY)
-
-mrouted-clean:
-       rm -f $(TARGET_DIR)/$(MROUTED_TARGET_BINARY)
-       -$(MAKE) -C $(MROUTED_DIR) clean
-
-mrouted-dirclean:
-       rm -rf $(MROUTED_DIR)
-
diff --git a/obsolete-buildroot/make/ncurses.mk b/obsolete-buildroot/make/ncurses.mk
deleted file mode 100644 (file)
index 42a6cd5..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-#############################################################
-#
-# ncurses
-# this installs only a few vital termcap entries
-#
-#############################################################
-# Copyright (C) 2002 by Ken Restivo <ken@246gt.com>
-# $Id$
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Library General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-
-# TARGETS
-NCURSES_SITE:=ftp://ftp.gnu.org/pub/gnu/ncurses
-NCURSES_DIR:=$(BUILD_DIR)/ncurses-5.2
-NCURSES_SOURCE:=ncurses-5.2.tar.gz
-
-$(DL_DIR)/$(NCURSES_SOURCE):
-       $(WGET) -P $(DL_DIR) $(NCURSES_SITE)/$(NCURSES_SOURCE)
-
-$(NCURSES_DIR)/.dist: $(DL_DIR)/$(NCURSES_SOURCE)
-       gunzip -c $(DL_DIR)/$(NCURSES_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       #use the local tic and not whatever the build system was going to find.
-       $(SED) 's~\$$srcdir/shlib tic\$$suffix~/usr/bin/tic~' \
-               $(NCURSES_DIR)/misc/run_tic.in
-       touch  $(NCURSES_DIR)/.dist
-
-$(NCURSES_DIR)/.configured: $(NCURSES_DIR)/.dist
-       (cd $(NCURSES_DIR); rm -rf config.cache; \
-               BUILD_CC=$(TARGET_CC) HOSTCC=$(HOSTCC) \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               --with-terminfo-dirs=/usr/share/terminfo \
-               --with-default-terminfo-dir=/usr/share/terminfo \
-               --libdir=$(STAGING_DIR)/lib \
-               --with-shared --without-cxx --without-cxx-binding \
-               --without-ada --without-progs $(DISABLE_NLS) \
-               --without-profile --without-debug --disable-rpath \
-               --enable-echo --enable-const --enable-overwrite \
-       );
-       touch  $(NCURSES_DIR)/.configured
-
-$(NCURSES_DIR)/lib/libncurses.so.5.2: $(NCURSES_DIR)/.configured
-       $(MAKE) BUILD_CC=$(TARGET_CC) HOSTCC=$(HOSTCC) \
-               BUILD_CCFLAGS="-I$(NCURSES_DIR) -I$(NCURSES_DIR)/include" \
-               BUILD_LDFLAGS="" DESTDIR=$(STAGING_DIR) -C $(NCURSES_DIR) \
-               libs panel menu form headers
-
-$(STAGING_DIR)/lib/libncurses.a: $(NCURSES_DIR)/lib/libncurses.so.5.2
-       BUILD_CC=$(TARGET_CC) HOSTCC=$(HOSTCC) CC=$(TARGET_CC) \
-       $(MAKE) \
-           prefix=$(STAGING_DIR) \
-           exec_prefix=$(STAGING_DIR) \
-           bindir=$(STAGING_DIR)/bin \
-           sbindir=$(STAGING_DIR)/sbin \
-           libexecdir=$(STAGING_DIR)/lib \
-           datadir=$(STAGING_DIR)/usr/share \
-           sysconfdir=$(STAGING_DIR)/etc \
-           localstatedir=$(STAGING_DIR)/var \
-           libdir=$(STAGING_DIR)/lib \
-           infodir=$(STAGING_DIR)/info \
-           mandir=$(STAGING_DIR)/man \
-           includedir=$(STAGING_DIR)/include \
-           gxx_include_dir=$(STAGING_DIR)/include/c++ \
-           ticdir=$(STAGING_DIR)/usr/share/terminfo \
-           -C $(NCURSES_DIR) install;
-           chmod a-x $(NCURSES_DIR)/lib/libncurses.so*
-           touch -c $(STAGING_DIR)/lib/libncurses.a 
-
-$(TARGET_DIR)/lib/libncurses.so.5.2: $(STAGING_DIR)/lib/libncurses.a
-       cp -dpf $(NCURSES_DIR)/lib/libncurses.so* $(TARGET_DIR)/lib/
-       -cp -dpf $(STAGING_DIR)/usr/lib/terminfo $(TARGET_DIR)/usr/lib/
-       mkdir -p $(TARGET_DIR)/usr/share/terminfo
-       for i in x/xterm x/xterm-color x/xterm-xfree86 v/vt100 v/vt200 a/ansi l/linux; do \
-               cp -dpf $(STAGING_DIR)/usr/share/terminfo/$${i} $(TARGET_DIR)/usr/share/terminfo/; \
-       done
-
-$(TARGET_DIR)/usr/lib/libncurses.a: $(STAGING_DIR)/lib/libncurses.a
-       cp -dpf $(NCURSES_DIR)/include/curses.h $(TARGET_DIR)/usr/include/ncurses.h
-       cp -dpf $(NCURSES_DIR)/include/term.h $(TARGET_DIR)/usr/include/
-       cp -dpf $(NCURSES_DIR)/include/unctrl.h $(TARGET_DIR)/usr/include/
-       cp -dpf $(NCURSES_DIR)/include/termcap.h $(TARGET_DIR)/usr/include/
-       cp -dpf $(NCURSES_DIR)/lib/libncurses.a $(TARGET_DIR)/usr/lib/
-       rm -f $(TARGET_DIR)/usr/lib/terminfo
-       (cd $(TARGET_DIR)/usr/lib; ln -fs /usr/share/terminfo)
-       (cd $(TARGET_DIR)/usr/lib; ln -fs libncurses.a libcurses.a)
-       (cd $(TARGET_DIR)/usr/lib; ln -fs libncurses.a libtermcap.a)
-       (cd $(TARGET_DIR)/usr/include; ln -fs ncurses.h curses.h)
-       rm -f $(TARGET_DIR)/lib/libncurses.so
-       (cd $(TARGET_DIR)/usr/lib; ln -fs /lib/libncurses.so.5.2 libncurses.so)
-       -$(STRIP)  $(TARGET_DIR)/lib/libncurses.so.5.2
-       touch -c $(TARGET_DIR)/usr/lib/libncurses.a
-
-ncurses-headers: $(TARGET_DIR)/usr/lib/libncurses.a
-
-ncurses-source: $(DL_DIR)/$(NCURSES_SOURCE)
-
-ncurses-clean: 
-       rm -f $(STAGING_DIR)/lib/libncurses.so* $(TARGET_DIR)/lib/libncurses.so*
-       rm -f $(STAGING_DIR)/usr/share/tabset $(TARGET_DIR)/usr/share/tabset
-       rm -rf $(STAGING_DIR)/usr/share/terminfo $(TARGET_DIR)/usr/share/terminfo
-       -$(MAKE) -C $(NCURSES_DIR) clean
-
-ncurses-dirclean: 
-       rm -rf $(NCURSES_DIR)
-
-ncurses: $(TARGET_DIR)/lib/libncurses.so.5.2
-
diff --git a/obsolete-buildroot/make/netfilter.mk b/obsolete-buildroot/make/netfilter.mk
deleted file mode 100644 (file)
index dd69b2c..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#############################################################
-#
-# netfilter
-#
-#############################################################
-
-ifeq ($(strip $(USE_NETFILTER_SNAPSHOT)),)
-USE_NETFILTER_SNAPSHOT=20040508
-endif
-NETFILTER_SOURCE:=patch-o-matic-$(USE_NETFILTER_SNAPSHOT).tar.bz2
-NETFILTER_DIR:=$(BUILD_DIR)/patch-o-matic-$(USE_NETFILTER_SNAPSHOT)
-NETFILTER_SITE:=ftp://ftp.netfilter.org/pub/patch-o-matic/snapshot
-NETFILTER_CAT:=bzcat
-
-# ipv6_mld breaks net/ipv6/mcast.c
-NETFILTER_EXCLUDE:=--exclude submitted/89_ipv6_mld_netfilter.patch
-
-NETFILTER_PATCHES:= \
-       base \
-       extra/CLASSIFY.patch \
-       extra/CONNMARK.patch \
-       extra/IPMARK.patch \
-       extra/condition.patch \
-       extra/h323-conntrack-nat.patch \
-       extra/mms-conntrack-nat.patch \
-       extra/pptp-conntrack-nat.patch \
-       extra/string.patch
-
-LINUX_DIR:=$(BUILD_DIR)/WRT54GS/release/src/linux/linux
-
-$(DL_DIR)/$(NETFILTER_SOURCE):
-        $(WGET) -P $(DL_DIR) $(NETFILTER_SITE)/$(NETFILTER_SOURCE)
-
-netfilter-source: $(DL_DIR)/$(NETFILTER_SOURCE)
-
-$(NETFILTER_DIR)/.unpacked: $(DL_DIR)/$(NETFILTER_SOURCE)
-       $(NETFILTER_CAT) $(DL_DIR)/$(NETFILTER_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       #ignore whitespace in patches
-       $(SED) "s,\-p1,\-l \-p1," $(NETFILTER_DIR)/runme
-       touch $(NETFILTER_DIR)/.unpacked
-
-$(LINUX_DIR)/.nf-patched: $(LINUX_DIR)/.unpacked $(NETFILTER_DIR)/.unpacked
-       $(SOURCE_DIR)/patch-kernel.sh $(LINUX_DIR) $(SOURCE_DIR)/openwrt/kernel/netfilter/patches
-       -(cd $(NETFILTER_DIR); KERNEL_DIR=$(LINUX_DIR) ./runme --batch $(NETFILTER_EXCLUDE) $(NETFILTER_PATCHES))
-       touch $(LINUX_DIR)/.nf-patched
-
-netfilter: $(LINUX_DIR)/.nf-patched
-
-netfilter-clean:
-
-netfilter-dirclean:
-       rm -rf $(NETFILTER_DIR)
diff --git a/obsolete-buildroot/make/netkitbase.mk b/obsolete-buildroot/make/netkitbase.mk
deleted file mode 100644 (file)
index cb2a023..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#############################################################
-#
-# netkitbase
-#
-#############################################################
-NETKITBASE_SOURCE:=netkit-base-0.17.tar.gz
-NETKITBASE_SITE:=ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/
-NETKITBASE_DIR:=$(BUILD_DIR)/netkit-base-0.17
-NETKITBASE_CAT:=zcat
-NETKITBASE_BINARY:=inetd/inetd
-NETKITBASE_TARGET_BINARY:=usr/sbin/inetd
-
-$(DL_DIR)/$(NETKITBASE_SOURCE):
-        $(WGET) -P $(DL_DIR) $(NETKITBASE_SITE)/$(NETKITBASE_SOURCE)
-
-netkitbase-source: $(DL_DIR)/$(NETKITBASE_SOURCE)
-
-$(NETKITBASE_DIR)/.unpacked: $(DL_DIR)/$(NETKITBASE_SOURCE)
-       $(NETKITBASE_CAT) $(DL_DIR)/$(NETKITBASE_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       # use ANSI syntax
-       $(SED) "s/main()/main(void)/;" $(NETKITBASE_DIR)/configure
-       # don't try to run cross compiled binaries while configuring things
-       $(SED) "s~./__conftest~#./__conftest~;" $(NETKITBASE_DIR)/configure
-       touch $(NETKITBASE_DIR)/.unpacked
-
-$(NETKITBASE_DIR)/.configured: $(NETKITBASE_DIR)/.unpacked
-       (cd $(NETKITBASE_DIR); PATH=$(TARGET_PATH) CC=$(TARGET_CC) \
-               ./configure --installroot=$(TARGET_DIR) --with-c-compiler=$(TARGET_CC) \
-       )
-       touch  $(NETKITBASE_DIR)/.configured
-
-$(NETKITBASE_DIR)/$(NETKITBASE_BINARY): $(NETKITBASE_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(NETKITBASE_DIR)
-       $(STRIP) $(NETKITBASE_DIR)/$(NETKITBASE_BINARY)
-
-$(TARGET_DIR)/$(NETKITBASE_TARGET_BINARY): $(NETKITBASE_DIR)/$(NETKITBASE_BINARY)
-       # Only install a few selected items...
-       mkdir -p $(TARGET_DIR)/usr/sbin
-       cp $(NETKITBASE_DIR)/$(NETKITBASE_BINARY) $(TARGET_DIR)/$(NETKITBASE_TARGET_BINARY)
-       mkdir -p $(TARGET_DIR)/etc
-       cp $(NETKITBASE_DIR)/etc.sample/inetd.conf $(TARGET_DIR)/etc/
-       $(SED) "s/^\([a-z]\)/#\1/;" $(TARGET_DIR)/etc/inetd.conf
-       #$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(NETKITBASE_DIR) install
-       #rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-       #       $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-
-netkitbase: uclibc $(TARGET_DIR)/$(NETKITBASE_TARGET_BINARY)
-
-netkitbase-clean:
-       #$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(NETKITBASE_DIR) uninstall
-       -rm -f $(TARGET_DIR)/usr/sbin/inetd $(TARGET_DIR)/etc/inetd.conf
-       -rm -f $(TARGET_DIR)/etc/inetd.conf
-       -$(MAKE) -C $(NETKITBASE_DIR) clean
-
-netkitbase-dirclean:
-       rm -rf $(NETKITBASE_DIR)
-
diff --git a/obsolete-buildroot/make/netkittelnet.mk b/obsolete-buildroot/make/netkittelnet.mk
deleted file mode 100644 (file)
index 401b885..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#############################################################
-#
-# netkittelnet
-#
-#############################################################
-NETKITTELNET_SOURCE:=netkit-telnet-0.17.tar.gz
-NETKITTELNET_SITE:=ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/
-NETKITTELNET_DIR:=$(BUILD_DIR)/netkit-telnet-0.17
-NETKITTELNET_CAT:=zcat
-NETKITTELNET_BINARY:=telnetd/telnetd
-NETKITTELNET_TARGET_BINARY:=usr/sbin/telnetd
-NETKITTELNET_PATCH:=$(SOURCE_DIR)/netkittelnet.patch
-
-$(DL_DIR)/$(NETKITTELNET_SOURCE):
-        $(WGET) -P $(DL_DIR) $(NETKITTELNET_SITE)/$(NETKITTELNET_SOURCE)
-
-netkittelnet-source: $(DL_DIR)/$(NETKITTELNET_SOURCE)
-
-$(NETKITTELNET_DIR)/.unpacked: $(DL_DIR)/$(NETKITTELNET_SOURCE)
-       $(NETKITTELNET_CAT) $(DL_DIR)/$(NETKITTELNET_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       # use ANSI syntax
-       $(SED) "s/main()/main(void)/;" $(NETKITTELNET_DIR)/configure
-       # Disable termcap support
-       $(SED) "s~\(.*termcap\.h.*\)~/* \1 */~;" $(NETKITTELNET_DIR)/telnetd/telnetd.c
-       # don't try to run cross compiled binaries while configuring things
-       cat $(NETKITTELNET_PATCH) | patch -p1 -d $(NETKITTELNET_DIR)
-       touch $(NETKITTELNET_DIR)/.unpacked
-
-$(NETKITTELNET_DIR)/.configured: $(NETKITTELNET_DIR)/.unpacked
-       (cd $(NETKITTELNET_DIR); PATH=$(TARGET_PATH) CC=$(TARGET_CC) \
-               ./configure --installroot=$(TARGET_DIR) --with-c-compiler=$(TARGET_CC) \
-       )
-       touch  $(NETKITTELNET_DIR)/.configured
-
-$(NETKITTELNET_DIR)/$(NETKITTELNET_BINARY): $(NETKITTELNET_DIR)/.configured
-       $(MAKE) SUB=telnetd CC=$(TARGET_CC) -C $(NETKITTELNET_DIR)
-       $(STRIP) $(NETKITTELNET_DIR)/$(NETKITTELNET_BINARY)
-
-$(TARGET_DIR)/$(NETKITTELNET_TARGET_BINARY): $(NETKITTELNET_DIR)/$(NETKITTELNET_BINARY)
-       # Only install a few selected items...
-       mkdir -p $(TARGET_DIR)/usr/sbin
-       rm -f $(TARGET_DIR)/$(NETKITTELNET_TARGET_BINARY)
-       cp $(NETKITTELNET_DIR)/$(NETKITTELNET_BINARY) $(TARGET_DIR)/$(NETKITTELNET_TARGET_BINARY)
-       # Enable telnet in inetd
-       $(SED) "s~^#telnet.*~telnet\tstream\ttcp\tnowait\troot\t/usr/sbin/telnetd\t/usr/sbin/telnetd~;" $(TARGET_DIR)/etc/inetd.conf
-       #$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(NETKITTELNET_DIR) install
-       #rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-       #       $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-
-netkittelnet: uclibc netkitbase $(TARGET_DIR)/$(NETKITTELNET_TARGET_BINARY)
-
-netkittelnet-clean:
-       #$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(NETKITTELNET_DIR) uninstall
-       -rm -f $(TARGET_DIR)/usr/sbin/telnetd
-       -$(MAKE) -C $(NETKITTELNET_DIR) clean
-
-netkittelnet-dirclean:
-       rm -rf $(NETKITTELNET_DIR)
-
diff --git a/obsolete-buildroot/make/netsnmp.mk b/obsolete-buildroot/make/netsnmp.mk
deleted file mode 100644 (file)
index eeb2449..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-#############################################################
-#
-# netsnmp
-#
-#############################################################
-
-NETSNMP_URL:=http://aleron.dl.sourceforge.net/sourceforge/net-snmp/
-NETSNMP_DIR:=$(BUILD_DIR)/net-snmp-5.1
-NETSNMP_SOURCE:=net-snmp-5.1.tar.gz
-NETSNMP_PATCH1:=net-snmp_5.1-5.diff.gz
-NETSNMP_PATCH1_URL:=http://ftp.debian.org/debian/pool/main/n/net-snmp/
-NETSNMP_PATCH2:=$(SOURCE_DIR)/netsnmp.patch
-
-$(DL_DIR)/$(NETSNMP_SOURCE):
-       $(WGET) -P $(DL_DIR) $(NETSNMP_URL)/$(NETSNMP_SOURCE)
-
-$(DL_DIR)/$(NETSNMP_PATCH1):
-       $(WGET) -P $(DL_DIR) $(NETSNMP_PATCH1_URL)/$(NETSNMP_PATCH1)
-
-$(NETSNMP_DIR)/.unpacked: $(DL_DIR)/$(NETSNMP_SOURCE) $(DL_DIR)/$(NETSNMP_PATCH1)
-       zcat $(DL_DIR)/$(NETSNMP_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       zcat $(DL_DIR)/$(NETSNMP_PATCH1) | patch -p1 -d $(NETSNMP_DIR)
-       cat $(NETSNMP_PATCH2) | patch -p1 -d $(NETSNMP_DIR)
-       touch  $(NETSNMP_DIR)/.unpacked
-
-# We set CAN_USE_SYSCTL to no and use /proc since the
-# sysctl code in this thing is apparently intended for
-# freebsd or some such thing...
-$(NETSNMP_DIR)/.configured: $(NETSNMP_DIR)/.unpacked
-       (cd $(NETSNMP_DIR); autoconf; \
-               ac_cv_CAN_USE_SYSCTL=no \
-               PATH=$(TARGET_PATH) \
-               ./configure \
-               --with-cc=$(TARGET_CROSS)gcc \
-               --with-ar=$(TARGET_CROSS)ar \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --with-endianness=little \
-               --with-persistent-directory=/var/lib/snmp \
-               --enable-ucd-snmp-compatibility \
-               --enable-shared \
-               --disable-static \
-               --with-logfile=none \
-               --without-rpm \
-               --with-openssl \
-               --without-dmalloc \
-               --without-efence \
-               --without-rsaref \
-               --with-sys-contact="root" \
-               --with-sys-location="Unknown" \
-               --with-mib-modules="host smux ucd-snmp/dlmod" \
-               --with-defaults \
-               --prefix=/usr \
-               --sysconfdir=/etc \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-       );
-       touch  $(NETSNMP_DIR)/.configured
-
-$(NETSNMP_DIR)/agent/snmpd: $(NETSNMP_DIR)/.configured
-       $(MAKE) -C $(NETSNMP_DIR)
-
-$(TARGET_DIR)/usr/sbin/snmpd: $(NETSNMP_DIR)/agent/snmpd
-       #$(MAKE) DESTDIR=$(TARGET_DIR) -C $(NETSNMP_DIR) install
-       $(MAKE) PREFIX=$(TARGET_DIR)/usr \
-           prefix=$(TARGET_DIR)/usr \
-           exec_prefix=$(TARGET_DIR)/usr \
-           persistentdir=$(TARGET_DIR)/var/lib/snmp \
-           infodir=$(TARGET_DIR)/usr/info \
-           mandir=$(TARGET_DIR)/usr/man \
-           includedir=$(STAGING_DIR)/include/net-snmp \
-           ucdincludedir=$(STAGING_DIR)/include/ucd-snmp \
-           -C $(NETSNMP_DIR) install;
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-       # Copy the .conf files.
-       mkdir -p $(TARGET_DIR)/etc/snmp
-       cp $(NETSNMP_DIR)/EXAMPLE.conf $(TARGET_DIR)/etc/snmp/snmpd.conf
-       cp $(NETSNMP_DIR)/EXAMPLE-trap.conf $(TARGET_DIR)/etc/snmp/snmptrapd.conf
-       -mv $(TARGET_DIR)/usr/share/snmp/mib2c*.conf $(TARGET_DIR)/etc/snmp
-       mkdir -p $(TARGET_DIR)/etc/default
-       cp $(NETSNMP_DIR)/debian/snmpd.default $(TARGET_DIR)/etc/default/snmpd
-       # Remove the unsupported snmpcheck program
-       rm $(TARGET_DIR)/usr/bin/snmpcheck
-       # Install the "broken" headers
-       cp $(NETSNMP_DIR)/agent/mibgroup/struct.h $(STAGING_DIR)/include/net-snmp/agent
-       cp $(NETSNMP_DIR)/agent/mibgroup/util_funcs.h $(STAGING_DIR)/include/net-snmp
-       cp $(NETSNMP_DIR)/agent/mibgroup/mibincl.h $(STAGING_DIR)/include/net-snmp/library
-       cp $(NETSNMP_DIR)/agent/mibgroup/header_complex.h $(STAGING_DIR)/include/net-snmp/agent
-
-netsnmp: $(TARGET_DIR)/usr/sbin/snmpd
-
-netsnmp-headers: $(TARGET_DIR)/usr/include/net-snmp/net-snmp-config.h
-       cp -a $(STAGING_DIR)/include/net-snmp $(TARGET_DIR)/usr/include/net-snmp
-       cp -a $(STAGING_DIR)/include/ucd-snmp $(TARGET_DIR)/usr/include/net-snmp
-
-netsnmp-source: $(DL_DIR)/$(NETSNMP_SOURCE)
-
-netsnmp-clean: 
-       $(MAKE) -C $(NETSNMP_DIR) clean
-
-netsnmp-dirclean: 
-       rm -rf $(NETSNMP_DIR)
-
diff --git a/obsolete-buildroot/make/newt.mk b/obsolete-buildroot/make/newt.mk
deleted file mode 100644 (file)
index cdf9a90..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-#############################################################
-#
-# newt
-#
-#############################################################
-NEWT_SOURCE=newt-0.51.0.tar.bz2
-NEWT_SITE=http://www.uclibc.org/
-NEWT_DIR=$(BUILD_DIR)/newt-0.51.0
-NEWT_VERSION=0.51.0
-ifeq ($(strip $(BUILD_WITH_LARGEFILE)),true)
-NEWT_CFLAGS=-Os -g -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-else
-NEWT_CFLAGS=-Os -g
-endif
-NEWT_CFLAGS+=-fPIC
-
-$(DL_DIR)/$(NEWT_SOURCE):
-       $(WGET) -P $(DL_DIR) $(NEWT_SITE)/$(NEWT_SOURCE)
-
-$(NEWT_DIR)/.source: $(DL_DIR)/$(NEWT_SOURCE)
-       bzcat $(DL_DIR)/$(NEWT_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(NEWT_DIR)/.source;
-
-$(NEWT_DIR)/.configured: $(NEWT_DIR)/.source
-       (cd $(NEWT_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-       );
-       touch $(NEWT_DIR)/.configured;
-
-$(NEWT_DIR)/libnewt.so.$(NEWT_VERSION): $(NEWT_DIR)/.configured
-       $(MAKE) CFLAGS="$(NEWT_CFLAGS)" CC=$(TARGET_CC) -C  $(NEWT_DIR)
-       touch -c $(NEWT_DIR)/libnewt.so.$(NEWT_VERSION)
-
-$(STAGING_DIR)/lib/libnewt.a: $(NEWT_DIR)/libnewt.so.$(NEWT_VERSION)
-       cp -a $(NEWT_DIR)/libnewt.a $(STAGING_DIR)/lib;
-       cp -a $(NEWT_DIR)/newt.h $(STAGING_DIR)/include;
-       cp -a $(NEWT_DIR)/libnewt.so* $(STAGING_DIR)/lib;
-       (cd $(STAGING_DIR)/lib; ln -fs libnewt.so.$(NEWT_VERSION) libnewt.so);
-       (cd $(STAGING_DIR)/lib; ln -fs libnewt.so.$(NEWT_VERSION) libnewt.so.0.51);
-       touch -c $(STAGING_DIR)/lib/libnewt.a
-
-$(TARGET_DIR)/lib/libnewt.so.$(NEWT_VERSION): $(STAGING_DIR)/lib/libnewt.a
-       cp -a $(STAGING_DIR)/lib/libnewt.so* $(TARGET_DIR)/lib;
-       -$(STRIP)  $(TARGET_DIR)/lib/libnewt.so*
-       touch -c $(TARGET_DIR)/lib/libnewt.so.$(NEWT_VERSION)
-
-newt: uclibc slang $(TARGET_DIR)/lib/libnewt.so.$(NEWT_VERSION)
-
-newt-source: $(DL_DIR)/$(NEWT_SOURCE)
-
-newt-clean:
-       rm -f $(TARGET_DIR)/lib/libnewt.so*
-       -$(MAKE) -C $(NEWT_DIR) clean
-
-newt-dirclean: slang-dirclean
-       rm -rf $(NEWT_DIR)
-
diff --git a/obsolete-buildroot/make/ntp.mk b/obsolete-buildroot/make/ntp.mk
deleted file mode 100644 (file)
index b3f840a..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#############################################################
-#
-# ntp
-#
-#############################################################
-NTP_SOURCE:=ntp-4.1.2.tar.gz
-NTP_SITE:=http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4
-NTP_DIR:=$(BUILD_DIR)/ntp-4.1.2
-NTP_CAT:=zcat
-NTP_BINARY:=ntpdate/ntpdate
-NTP_TARGET_BINARY:=usr/bin/ntpdate
-
-
-$(DL_DIR)/$(NTP_SOURCE):
-        $(WGET) -P $(DL_DIR) $(NTP_SITE)/$(NTP_SOURCE)
-
-ntp-source: $(DL_DIR)/$(NTP_SOURCE)
-
-$(NTP_DIR)/.unpacked: $(DL_DIR)/$(NTP_SOURCE)
-       $(NTP_CAT) $(DL_DIR)/$(NTP_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       $(SED) "s,^#if.*__GLIBC__.*_BSD_SOURCE.*$$,#if 0," \
-               $(NTP_DIR)/ntpd/refclock_pcf.c;
-       touch $(NTP_DIR)/.unpacked
-
-$(NTP_DIR)/.configured: $(NTP_DIR)/.unpacked
-       (cd $(NTP_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-               --with-shared \
-               --program-transform-name=s,,, \
-       );
-       touch  $(NTP_DIR)/.configured
-
-$(NTP_DIR)/$(NTP_BINARY): $(NTP_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(NTP_DIR)
-
-$(TARGET_DIR)/$(NTP_TARGET_BINARY): $(NTP_DIR)/$(NTP_BINARY)
-       install -m 755 $(NTP_DIR)/$(NTP_BINARY) $(TARGET_DIR)/$(NTP_TARGET_BINARY)
-
-ntp: uclibc $(TARGET_DIR)/$(NTP_TARGET_BINARY)
-
-ntp-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(NTP_DIR) uninstall
-       -$(MAKE) -C $(NTP_DIR) clean
-
-ntp-dirclean:
-       rm -rf $(NTP_DIR)
-
diff --git a/obsolete-buildroot/make/ntpclient.mk b/obsolete-buildroot/make/ntpclient.mk
deleted file mode 100644 (file)
index 131f5e4..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#############################################################
-#
-# ntpclient
-#
-#############################################################
-NTPCLIENT_VERSION:=2003_194
-NTPCLIENT_SOURCE:=ntpclient_$(NTPCLIENT_VERSION).tar.gz
-NTPCLIENT_SITE:=http://doolittle.faludi.com/ntpclient
-NTPCLIENT_DIR:=$(BUILD_DIR)/ntpclient
-NTPCLIENT_IPK=$(BUILD_DIR)/ntpclient_$(NTPCLIENT_VERSION)-1_mipsel.ipk
-NTPCLIENT_IPK_DIR:=$(BUILD_DIR)/ntpclient-$(NTPCLIENT_VERSION)-ipk
-
-$(DL_DIR)/$(NTPCLIENT_SOURCE):
-        $(WGET) -P $(DL_DIR) $(NTPCLIENT_SITE)/$(NTPCLIENT_SOURCE)
-
-ntpclient-source: $(DL_DIR)/$(NTPCLIENT_SOURCE)
-
-$(NTPCLIENT_DIR)/.unpacked: $(DL_DIR)/$(NTPCLIENT_SOURCE)
-       tar -C $(BUILD_DIR) -zxf $(DL_DIR)/$(NTPCLIENT_SOURCE)
-       touch $(NTPCLIENT_DIR)/.unpacked
-
-$(NTPCLIENT_DIR)/ntpclient: $(NTPCLIENT_DIR)/.unpacked
-       CFLAGS="$(TARGET_CFLAGS)" $(MAKE) $(TARGET_CONFIGURE_OPTS) LD=$(TARGET_CC) -C $(NTPCLIENT_DIR)
-
-$(NTPCLIENT_IPK): $(NTPCLIENT_DIR)/ntpclient
-       mkdir -p $(NTPCLIENT_IPK_DIR)/CONTROL $(NTPCLIENT_IPK_DIR)/usr/sbin
-       install -m 644 $(OPENWRT_IPK_DIR)/ntpclient/CONTROL/control $(NTPCLIENT_IPK_DIR)/CONTROL
-       install -m 755 $(NTPCLIENT_DIR)/ntpclient $(NTPCLIENT_IPK_DIR)/usr/sbin/
-       $(STRIP) $(NTPCLIENT_IPK_DIR)/usr/sbin/ntpclient
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(NTPCLIENT_IPK_DIR)
-
-ntpclient-ipk : uclibc $(NTPCLIENT_IPK)
-
-ntpclient-clean:
-       -$(MAKE) -C $(NTPCLIENT_DIR) clean
-
-ntpclient-dirclean:
-       rm -rf $(NTPCLIENT_DIR) $(NTPCLIENT_IPK_DIR)
diff --git a/obsolete-buildroot/make/oidentd.mk b/obsolete-buildroot/make/oidentd.mk
deleted file mode 100644 (file)
index 67cf74d..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-######################################################
-#
-#  An example makefile to fetch a package from sources
-#  then fetch the ipkg updates required to the base package
-#  extract the archives into the build tree
-#  and then build the source
-#
-######################################################
-
-
-#  For this example we'll use a fairly simple package that compiles easily
-#  and has sources available for download at sourceforge
-OIDENTD=oidentd-2.0.7
-OIDENTD_TARGET=oidentd
-OIDENTD_DIR=$(BUILD_DIR)/oidentd-2.0.7
-OIDENTD_IPKTARGET=oidentd-2.0.7_mipsel.ipk
-OIDENTD_SITE=http://easynews.dl.sourceforge.net/sourceforge/ojnk
-OIDENTD_SOURCE=oidentd-2.0.7.tar.gz
-OIDENTDIPK_SITE=http://openwrt.rozeware.bc.ca/ipkg-dev
-OIDENTDIPK_SRC=oidentd-2.0.7-pkg.tgz
-
-
-
-
-# define a target for the master makefile
-oidentd:       $(OIDENTD_DIR)/$(OIDENTD_TARGET)
-
-oidentd-ipk:   $(BUILD_DIR)/$(OIDENTD_IPKTARGET) 
-
-# We need to download sources if we dont have them
-$(DL_DIR)/$(OIDENTD_SOURCE) :
-       $(WGET) -P $(DL_DIR) $(OIDENTD_SITE)/$(OIDENTD_SOURCE)
-
-# As well as the upstream package sources, we need the updates
-# for ipkg packaging
-$(DL_DIR)/$(OIDENTDIPK_SRC)  :  
-       $(WGET) -P $(DL_DIR) $(OIDENTDIPK_SITE)/$(OIDENTDIPK_SRC)
-
-# if we have the sources, they do no good unless they are unpacked
-$(OIDENTD_DIR)/.unpacked:      $(DL_DIR)/$(OIDENTD_SOURCE)
-       tar -C $(BUILD_DIR) -zxf $(DL_DIR)/$(OIDENTD_SOURCE)
-       touch $(OIDENTD_DIR)/.unpacked
-       
-# if we have the sources unpacked, we need to configure them
-$(OIDENTD_DIR)/.configured:    $(OIDENTD_DIR)/.unpacked
-       (cd $(OIDENTD_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-       );
-       touch $(OIDENTD_DIR)/.configured
-       
-       
-# with the upstream sources unpacked, they still dont do much good without
-# the ipkg control and rule files
-$(OIDENTD_DIR)/ipkg/rules  :   $(DL_DIR)/$(OIDENTDIPK_SRC) $(OIDENTD_DIR)/.unpacked
-       tar -C $(OIDENTD_DIR) -zxf $(DL_DIR)/$(OIDENTDIPK_SRC)
-       
-# now that we have it all in place, just build it
-$(OIDENTD_DIR)/$(OIDENTD_TARGET):      $(OIDENTD_DIR)/.configured
-       cd $(OIDENTD_DIR); make
-       
-
-$(BUILD_DIR)/$(OIDENTD_IPKTARGET):     $(OIDENTD_DIR)/$(OIDENTD_TARGET) $(OIDENTD_DIR)/ipkg/rules
-       (cd $(OIDENTD_DIR); $(IPKG_BUILDPACKAGE))
-       
-       
-               
diff --git a/obsolete-buildroot/make/openssh.mk b/obsolete-buildroot/make/openssh.mk
deleted file mode 100644 (file)
index 867cf75..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-#############################################################
-#
-# openssh
-#
-#############################################################
-
-OPENSSH_SITE:=ftp://ftp.tux.org/bsd/openbsd/OpenSSH/portable/
-OPENSSH_DIR:=$(BUILD_DIR)/openssh-3.8p1
-OPENSSH_SOURCE:=openssh-3.8p1.tar.gz
-
-OPENSSH_IPK_DIR=$(OPENWRT_IPK_DIR)/openssh
-OPENSSH_IPK_BUILD_DIR:=$(BUILD_DIR)/openssh-3.8p1-ipk
-
-OPENSSH_SERVER_IPK:=$(BUILD_DIR)/openssh-server_3.8p1-1_mipsel.ipk
-OPENSSH_CLIENT_IPK:=$(BUILD_DIR)/openssh-client_3.8p1-1_mipsel.ipk
-OPENSSH_SFTP_SERVER_IPK:=$(BUILD_DIR)/openssh-sftp-server_3.8p1-1_mipsel.ipk
-OPENSSH_SFTP_CLIENT_IPK:=$(BUILD_DIR)/openssh-sftp-client_3.8p1-1_mipsel.ipk
-OPENSSH_CLIENT_EX_IPK:=$(BUILD_DIR)/openssh-client-extras_3.8p1-1_mipsel.ipk
-
-$(DL_DIR)/$(OPENSSH_SOURCE):
-       $(WGET) -P $(DL_DIR) $(OPENSSH_SITE)/$(OPENSSH_SOURCE)
-
-$(OPENSSH_DIR)/.unpacked: $(DL_DIR)/$(OPENSSH_SOURCE) $(OPENSSH_PATCH)
-       zcat $(DL_DIR)/$(OPENSSH_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       cat $(OPENSSH_IPK_DIR)/openssh.patch | patch -p1 -d $(OPENSSH_DIR)
-       touch  $(OPENSSH_DIR)/.unpacked
-
-$(OPENSSH_DIR)/.configured: $(OPENSSH_DIR)/.unpacked
-       (cd $(OPENSSH_DIR); rm -rf config.cache; autoconf; \
-               $(TARGET_CONFIGURE_OPTS) \
-               LD=$(TARGET_CROSS)gcc \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/sbin \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               --includedir=$(STAGING_DIR)/include \
-               --disable-lastlog --disable-utmp \
-               --disable-utmpx --disable-wtmp --disable-wtmpx \
-               --without-x \
-               $(DISABLE_NLS) \
-               $(DISABLE_LARGEFILE) \
-       );
-       touch  $(OPENSSH_DIR)/.configured
-
-$(OPENSSH_DIR)/ssh: $(OPENSSH_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(OPENSSH_DIR)
-       -$(STRIP)  $(OPENSSH_DIR)/scp
-       -$(STRIP)  $(OPENSSH_DIR)/sftp
-       -$(STRIP)  $(OPENSSH_DIR)/sftp-server
-       -$(STRIP)  $(OPENSSH_DIR)/ssh
-       -$(STRIP)  $(OPENSSH_DIR)/ssh-add
-       -$(STRIP)  $(OPENSSH_DIR)/ssh-agent
-       -$(STRIP)  $(OPENSSH_DIR)/ssh-keygen
-       -$(STRIP)  $(OPENSSH_DIR)/ssh-keyscan
-       -$(STRIP)  $(OPENSSH_DIR)/ssh-keysign
-       -$(STRIP)  $(OPENSSH_DIR)/ssh-rand-helper
-       -$(STRIP)  $(OPENSSH_DIR)/sshd
-
-$(TARGET_DIR)/usr/bin/ssh: $(OPENSSH_DIR)/ssh
-       $(MAKE) CC=$(TARGET_CC) DESTDIR=$(TARGET_DIR) -C $(OPENSSH_DIR) install
-       mkdir -p $(TARGET_DIR)/etc/init.d/
-       cp $(OPENSSH_DIR)/S50sshd $(TARGET_DIR)/etc/init.d/
-       chmod a+x $(TARGET_DIR)/etc/init.d/S50sshd
-       rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-       # since this is the embedded build, keep things to minimum
-       rm $(TARGET_DIR)/etc/moduli
-       rm $(TARGET_DIR)/usr/bin/sftp
-       rm $(TARGET_DIR)/usr/bin/ssh-add
-       rm $(TARGET_DIR)/usr/bin/ssh-agent
-       rm $(TARGET_DIR)/usr/bin/ssh-keyscan
-       rm $(TARGET_DIR)/usr/sbin/sftp-server
-       rm $(TARGET_DIR)/usr/sbin/ssh-keysign
-
-openssh: $(TARGET_DIR)/usr/bin/ssh
-
-$(OPENSSH_IPK_BUILD_DIR)/usr/bin/ssh: $(OPENSSH_DIR)/ssh
-       $(MAKE) CC=$(TARGET_CC) DESTDIR=$(OPENSSH_IPK_BUILD_DIR) -C $(OPENSSH_DIR) install
-       mkdir -p $(OPENSSH_IPK_BUILD_DIR)/etc/init.d/
-       cp $(OPENSSH_DIR)/S50sshd $(OPENSSH_IPK_BUILD_DIR)/etc/init.d/
-       chmod a+x $(OPENSSH_IPK_BUILD_DIR)/etc/init.d/S50sshd
-       rm -rf $(OPENSSH_IPK_BUILD_DIR)/usr/info $(OPENSSH_IPK_BUILD_DIR)/usr/man $(OPENSSH_IPK_BUILD_DIR)/usr/share/doc
-
-$(OPENSSH_SERVER_IPK): $(OPENSSH_IPK_BUILD_DIR)/usr/bin/ssh
-       rm -rf $(OPENSSH_IPK_BUILD_DIR)/build
-       mkdir -p $(OPENSSH_IPK_BUILD_DIR)/build/CONTROL
-       cp $(OPENSSH_IPK_DIR)/openssh.server.control $(OPENSSH_IPK_BUILD_DIR)/build/CONTROL/control
-       cp $(OPENSSH_IPK_DIR)/openssh.server.conffiles $(OPENSSH_IPK_BUILD_DIR)/build/CONTROL/conffiles
-       cp $(OPENSSH_IPK_DIR)/openssh.server.preinst $(OPENSSH_IPK_BUILD_DIR)/build/CONTROL/preinst
-       chmod a+x $(OPENSSH_IPK_BUILD_DIR)/build/CONTROL/preinst
-       cp $(OPENSSH_IPK_DIR)/openssh.server.postinst $(OPENSSH_IPK_BUILD_DIR)/build/CONTROL/postinst
-       chmod a+x $(OPENSSH_IPK_BUILD_DIR)/build/CONTROL/postinst
-       mkdir -p $(OPENSSH_IPK_BUILD_DIR)/build/etc/init.d
-       cp $(OPENSSH_IPK_DIR)/openssh.server.sshd_config $(OPENSSH_IPK_BUILD_DIR)/build/etc/sshd_config
-       cp $(OPENSSH_IPK_DIR)/openssh.server.S50sshd-ipk $(OPENSSH_IPK_BUILD_DIR)/build/etc/init.d/S50sshd
-       chmod a+x $(OPENSSH_IPK_BUILD_DIR)/build/etc/init.d/S50sshd
-       mkdir -p $(OPENSSH_IPK_BUILD_DIR)/build/usr/sbin
-       cp $(OPENSSH_IPK_BUILD_DIR)/usr/sbin/sshd $(OPENSSH_IPK_BUILD_DIR)/build/usr/sbin
-       mkdir -p $(OPENSSH_IPK_BUILD_DIR)/build/usr/bin
-       cp $(OPENSSH_IPK_BUILD_DIR)/usr/bin/ssh-keygen $(OPENSSH_IPK_BUILD_DIR)/build/usr/bin
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(OPENSSH_IPK_BUILD_DIR)/build
-       rm -rf $(OPENSSH_IPK_BUILD_DIR)/build
-
-$(OPENSSH_CLIENT_IPK): $(OPENSSH_IPK_BUILD_DIR)/usr/bin/ssh
-       rm -rf $(OPENSSH_IPK_BUILD_DIR)/build
-       mkdir -p $(OPENSSH_IPK_BUILD_DIR)/build/CONTROL
-       cp $(OPENSSH_IPK_DIR)/openssh.client.control $(OPENSSH_IPK_BUILD_DIR)/build/CONTROL/control
-       cp $(OPENSSH_IPK_DIR)/openssh.client.conffiles $(OPENSSH_IPK_BUILD_DIR)/build/CONTROL/conffiles
-       cp $(OPENSSH_IPK_DIR)/openssh.client.preinst $(OPENSSH_IPK_BUILD_DIR)/build/CONTROL/preinst
-       chmod a+x $(OPENSSH_IPK_BUILD_DIR)/build/CONTROL/preinst
-       mkdir -p $(OPENSSH_IPK_BUILD_DIR)/build/etc
-       cp $(OPENSSH_IPK_DIR)/openssh.client.ssh_config $(OPENSSH_IPK_BUILD_DIR)/build/etc/ssh_config
-       mkdir -p $(OPENSSH_IPK_BUILD_DIR)/build/usr/bin
-       cp $(OPENSSH_IPK_BUILD_DIR)/usr/bin/ssh $(OPENSSH_IPK_BUILD_DIR)/build/usr/bin
-       cp $(OPENSSH_IPK_BUILD_DIR)/usr/bin/scp $(OPENSSH_IPK_BUILD_DIR)/build/usr/bin
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(OPENSSH_IPK_BUILD_DIR)/build
-       rm -rf $(OPENSSH_IPK_BUILD_DIR)/build
-
-$(OPENSSH_SFTP_SERVER_IPK): $(OPENSSH_IPK_BUILD_DIR)/usr/bin/ssh
-       rm -rf $(OPENSSH_IPK_BUILD_DIR)/build
-       mkdir -p $(OPENSSH_IPK_BUILD_DIR)/build/CONTROL
-       cp $(OPENSSH_IPK_DIR)/openssh.sftp-server.control $(OPENSSH_IPK_BUILD_DIR)/build/CONTROL/control
-       mkdir -p $(OPENSSH_IPK_BUILD_DIR)/build/usr/sbin
-       cp $(OPENSSH_IPK_BUILD_DIR)/usr/sbin/sftp-server $(OPENSSH_IPK_BUILD_DIR)/build/usr/sbin
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(OPENSSH_IPK_BUILD_DIR)/build
-       rm -rf $(OPENSSH_IPK_BUILD_DIR)/build
-
-$(OPENSSH_SFTP_CLIENT_IPK): $(OPENSSH_IPK_BUILD_DIR)/usr/bin/ssh
-       rm -rf $(OPENSSH_IPK_BUILD_DIR)/build
-       mkdir -p $(OPENSSH_IPK_BUILD_DIR)/build/CONTROL
-       cp $(OPENSSH_IPK_DIR)/openssh.sftp-client.control $(OPENSSH_IPK_BUILD_DIR)/build/CONTROL/control
-       mkdir -p $(OPENSSH_IPK_BUILD_DIR)/build/usr/bin
-       cp $(OPENSSH_IPK_BUILD_DIR)/usr/bin/sftp $(OPENSSH_IPK_BUILD_DIR)/build/usr/bin
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(OPENSSH_IPK_BUILD_DIR)/build
-       rm -rf $(OPENSSH_IPK_BUILD_DIR)/build
-
-$(OPENSSH_CLIENT_EX_IPK): $(OPENSSH_IPK_BUILD_DIR)/usr/bin/ssh
-       rm -rf $(OPENSSH_IPK_BUILD_DIR)/build
-       mkdir -p $(OPENSSH_IPK_BUILD_DIR)/build/CONTROL
-       cp $(OPENSSH_IPK_DIR)/openssh.client.ex.control $(OPENSSH_IPK_BUILD_DIR)/build/CONTROL/control
-       mkdir -p $(OPENSSH_IPK_BUILD_DIR)/build/usr/bin
-       cp $(OPENSSH_IPK_BUILD_DIR)/usr/bin/ssh-add $(OPENSSH_IPK_BUILD_DIR)/build/usr/bin
-       cp $(OPENSSH_IPK_BUILD_DIR)/usr/bin/ssh-agent $(OPENSSH_IPK_BUILD_DIR)/build/usr/bin
-       cp $(OPENSSH_IPK_BUILD_DIR)/usr/bin/ssh-keyscan $(OPENSSH_IPK_BUILD_DIR)/build/usr/bin
-       mkdir -p $(OPENSSH_IPK_BUILD_DIR)/build/usr/sbin
-       cp $(OPENSSH_IPK_BUILD_DIR)/usr/sbin/ssh-keysign $(OPENSSH_IPK_BUILD_DIR)/build/usr/sbin
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(OPENSSH_IPK_BUILD_DIR)/build
-       rm -rf $(OPENSSH_IPK_BUILD_DIR)/build
-
-openssh-ipk: $(OPENSSH_SERVER_IPK) $(OPENSSH_CLIENT_IPK) \
-             $(OPENSSH_SFTP_SERVER_IPK) $(OPENSSH_SFTP_CLIENT_IPK) \
-            $(OPENSSH_CLIENT_EX_IPK)
-
-openssh-source: $(DL_DIR)/$(OPENSSH_SOURCE)
-
-openssh-clean: 
-       $(MAKE) -C $(OPENSSH_DIR) clean
-
-openssh-dirclean: 
-       rm -rf $(OPENSSH_DIR)
-
diff --git a/obsolete-buildroot/make/openssl.mk b/obsolete-buildroot/make/openssl.mk
deleted file mode 100644 (file)
index c9726a6..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-#############################################################
-#
-# openssl
-#
-#############################################################
-
-# TARGETS
-OPENSSL_SITE:=http://www.openssl.org/source
-OPENSSL_SOURCE:=openssl-0.9.7d.tar.gz
-OPENSSL_DIR:=$(BUILD_DIR)/openssl-0.9.7d
-OPENSSL_IPK_DIR=$(OPENWRT_IPK_DIR)/openssl
-OPENSSL_PATCH=$(OPENSSL_IPK_DIR)/openssl.patch
-
-OPENSSL_IPK_BUILD_DIR=$(BUILD_DIR)/openssl-0.9.7d-ipk
-LIBSSL_IPK=$(BUILD_DIR)/libssl_0.9.7d_mipsel.ipk
-
-$(DL_DIR)/$(OPENSSL_SOURCE):
-       $(WGET) -P $(DL_DIR) $(OPENSSL_SITE)/$(OPENSSL_SOURCE)
-
-$(OPENSSL_DIR)/.unpacked: $(DL_DIR)/$(OPENSSL_SOURCE) $(OPENSSL_PATCH)
-       gunzip -c $(DL_DIR)/$(OPENSSL_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       cat $(OPENSSL_PATCH) | patch -p1 -d $(OPENSSL_DIR)
-       # sigh... we have to resort to this just to set a gcc flag.
-       $(SED) 's,/CFLAG=,/CFLAG= $(TARGET_SOFT_FLOAT) ,g' \
-               $(OPENSSL_DIR)/Configure
-       touch  $(OPENSSL_DIR)/.unpacked
-
-$(OPENSSL_DIR)/Makefile: $(OPENSSL_DIR)/.unpacked
-       (cd $(OPENSSL_DIR); \
-       CFLAGS="-DOPENSSL_NO_KRB5 -DOPENSSL_NO_IDEA -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5" \
-       PATH=$(TARGET_PATH) ./Configure linux-$(ARCH) --prefix=/ \
-               --openssldir=/usr/lib/ssl -L$(STAGING_DIR)/lib -ldl \
-               -I$(STAGING_DIR)/include $(OPENSSL_OPTS) no-threads \
-               shared no-idea no-mdc2 no-rc5)
-
-$(OPENSSL_DIR)/apps/openssl: $(OPENSSL_DIR)/Makefile
-       $(MAKE) CC=$(TARGET_CC) -C $(OPENSSL_DIR) all build-shared
-       # Work around openssl build bug to link libssl.so with libcrypto.so.
-       -rm $(OPENSSL_DIR)/libssl.so.*.*.*
-       $(MAKE) CC=$(TARGET_CC) -C $(OPENSSL_DIR) do_linux-shared
-
-$(STAGING_DIR)/lib/libcrypto.a: $(OPENSSL_DIR)/apps/openssl
-       $(MAKE) CC=$(TARGET_CC) INSTALL_PREFIX=$(STAGING_DIR) -C $(OPENSSL_DIR) install
-       cp -fa $(OPENSSL_DIR)/libcrypto.so* $(STAGING_DIR)/lib/
-       chmod a-x $(STAGING_DIR)/lib/libcrypto.so.0.9.7
-       (cd $(STAGING_DIR)/lib; ln -fs libcrypto.so.0.9.7 libcrypto.so)
-       (cd $(STAGING_DIR)/lib; ln -fs libcrypto.so.0.9.7 libcrypto.so.0)
-       cp -fa $(OPENSSL_DIR)/libssl.so* $(STAGING_DIR)/lib/
-       chmod a-x $(STAGING_DIR)/lib/libssl.so.0.9.7
-       (cd $(STAGING_DIR)/lib; ln -fs libssl.so.0.9.7 libssl.so)
-       (cd $(STAGING_DIR)/lib; ln -fs libssl.so.0.9.7 libssl.so.0)
-
-$(TARGET_DIR)/usr/lib/libcrypto.so.0.9.7: $(STAGING_DIR)/lib/libcrypto.a
-       mkdir -p $(TARGET_DIR)/usr/lib
-       cp -fa $(STAGING_DIR)/lib/libcrypto.so* $(TARGET_DIR)/usr/lib/
-       cp -fa $(STAGING_DIR)/lib/libssl.so* $(TARGET_DIR)/usr/lib/
-       #cp -fa $(STAGING_DIR)/bin/openssl  $(TARGET_DIR)/bin/
-       -$(STRIP)  $(TARGET_DIR)/usr/lib/libssl.so.0.9.7
-       -$(STRIP)  $(TARGET_DIR)/usr/lib/libcrypto.so.0.9.7
-
-$(TARGET_DIR)/usr/lib/libssl.a: $(STAGING_DIR)/lib/libcrypto.a
-       mkdir -p $(TARGET_DIR)/usr/include 
-       cp -a $(STAGING_DIR)/include/openssl $(TARGET_DIR)/usr/include/
-       cp -dpf $(STAGING_DIR)/lib/libssl.a $(TARGET_DIR)/usr/lib/
-       cp -dpf $(STAGING_DIR)/lib/libcrypto.a $(TARGET_DIR)/usr/lib/
-       touch -c $(TARGET_DIR)/usr/lib/libssl.a
-
-openssl-headers: $(TARGET_DIR)/usr/lib/libssl.a
-
-openssl: uclibc $(TARGET_DIR)/usr/lib/libcrypto.so.0.9.7
-
-$(LIBSSL_IPK): uclibc $(STAGING_DIR)/lib/libcrypto.a
-       mkdir -p $(OPENSSL_IPK_BUILD_DIR)/CONTROL
-       cp $(OPENSSL_IPK_DIR)/control $(OPENSSL_IPK_BUILD_DIR)/CONTROL/control
-       mkdir -p $(OPENSSL_IPK_BUILD_DIR)/usr/lib
-       cp -fa $(STAGING_DIR)/lib/libcrypto.so* $(OPENSSL_IPK_BUILD_DIR)/usr/lib/
-       cp -fa $(STAGING_DIR)/lib/libssl.so* $(OPENSSL_IPK_BUILD_DIR)/usr/lib/
-       -$(STRIP)  $(OPENSSL_IPK_BUILD_DIR)/usr/lib/libssl.so.0.9.7
-       -$(STRIP)  $(OPENSSL_IPK_BUILD_DIR)/usr/lib/libcrypto.so.0.9.7
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(OPENSSL_IPK_BUILD_DIR)
-
-openssl-ipk: $(LIBSSL_IPK)
-
-openssl-source: $(DL_DIR)/$(OPENSSL_SOURCE)
-
-openssl-clean: 
-       rm -f $(STAGING_DIR)/bin/openssl  $(TARGET_DIR)/bin/openssl
-       rm -f $(STAGING_DIR)/lib/libcrypto.so* $(TARGET_DIR)/lib/libcrypto.so*
-       rm -f $(STAGING_DIR)/lib/libssl.so* $(TARGET_DIR)/lib/libssl.so*
-       rm -rf $(OPENSSL_IPK_BUILD_DIR)
-       $(MAKE) -C $(OPENSSL_DIR) clean
-
-openssl-dirclean: 
-       rm -rf $(OPENSSL_DIR) 
-
diff --git a/obsolete-buildroot/make/openvpn.mk b/obsolete-buildroot/make/openvpn.mk
deleted file mode 100644 (file)
index 0ac6279..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-#############################################################
-#
-# openvpn
-#
-# NOTE: Uses start-stop-daemon in init script, so be sure
-# to enable that within busybox
-#
-#############################################################
-OPENVPN_SOURCE:=openvpn-1.5.0.tar.gz
-OPENVPN_SITE:=http://aleron.dl.sourceforge.net/sourceforge/openvpn/
-OPENVPN_DIR:=$(BUILD_DIR)/openvpn-1.5.0
-OPENVPN_CAT:=zcat
-OPENVPN_BINARY:=openvpn
-OPENVPN_TARGET_BINARY:=usr/sbin/openvpn
-#OPENVPN_PATCH:=$(SOURCE_DIR)/openvpn.patch
-
-$(DL_DIR)/$(OPENVPN_SOURCE):
-        $(WGET) -P $(DL_DIR) $(OPENVPN_SITE)/$(OPENVPN_SOURCE)
-
-openvpn-source: $(DL_DIR)/$(OPENVPN_SOURCE)
-
-$(OPENVPN_DIR)/.unpacked: $(DL_DIR)/$(OPENVPN_SOURCE)
-       $(OPENVPN_CAT) $(DL_DIR)/$(OPENVPN_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       #cat $(OPENVPN_PATCH) | patch -p1 -d $(OPENVPN_DIR)
-       touch $(OPENVPN_DIR)/.unpacked
-
-$(OPENVPN_DIR)/.configured: $(OPENVPN_DIR)/.unpacked
-       (cd $(OPENVPN_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               --program-prefix="" \
-               --enable-pthread \
-       );
-       touch  $(OPENVPN_DIR)/.configured
-
-$(OPENVPN_DIR)/$(OPENVPN_BINARY): $(OPENVPN_DIR)/.configured
-       $(MAKE) -C $(OPENVPN_DIR)
-
-$(TARGET_DIR)/$(OPENVPN_TARGET_BINARY): $(OPENVPN_DIR)/$(OPENVPN_BINARY)
-       $(MAKE) DESTDIR=$(TARGET_DIR) -C $(OPENVPN_DIR) install
-       mkdir -p $(TARGET_DIR)/etc/openvpn
-       cp $(SOURCE_DIR)/openvpn $(TARGET_DIR)/etc/init.d/openvpn
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-
-openvpn: uclibc lzo openssl $(TARGET_DIR)/$(OPENVPN_TARGET_BINARY)
-
-openvpn-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) -C $(OPENVPN_DIR) uninstall
-       -$(MAKE) -C $(OPENVPN_DIR) clean
-
-openvpn-dirclean:
-       rm -rf $(OPENVPN_DIR)
-
diff --git a/obsolete-buildroot/make/openwrt.mk b/obsolete-buildroot/make/openwrt.mk
deleted file mode 100644 (file)
index 6b77c2c..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-# Makefile for to build the base openwrt
-#
-# Copyright (C) 2004 Manuel Novoa III <mjn3@uclibc.org>
-#
-# 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, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-######################################################################
-#
-# WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
-#
-# Currently the dependencies are not all handled.  But that's true of
-# our buildroot in general, since it wasn't really set up for end users.
-
-OPENWRT_TARGETS:= $(STAGING_DIR)/bin/sstrip gcc3_3 openwrt-linux openwrt-kmodules.tar.bz2 \
-       openwrt-shared openwrt-mtd openwrt-nvram openwrt-wlconf \
-       bridge dnsmasq1 iptables wtools busybox \
-       openwrt-rootprep
-
-.PHONY: $(OPENWRT_TARGETS) openwrt-code.bin
-
-openwrt-base: $(OPENWRT_TARGETS)
-
-######################################################################
-
-WRT54G_SOURCE=wrt54gs.2.07.1.tgz
-WRT54G_SITE=http://www.linksys.com/support/opensourcecode/wrt54gs/2.07.1
-WRT54G_DIR=$(BUILD_DIR)/WRT54GS
-
-LINUX_DIR=$(WRT54G_DIR)/release/src/linux/linux
-LINUX_FORMAT=zImage
-LINUX_BINLOC=arch/mips/brcm-boards/bcm947xx/compressed/vmlinuz
-
-TARGET_MODULES_DIR:=$(TARGET_DIR)/lib/modules/2.4.20
-
-$(LINUX_DIR)/.unpacked: $(WRT54G_DIR)/.prepared
-       -(cd $(BUILD_DIR); ln -sf $(LINUX_DIR) linux)
-       touch $(LINUX_DIR)/.unpacked
-
-$(LINUX_DIR)/.patched: $(WRT54G_DIR)/.prepared
-       $(SOURCE_DIR)/patch-kernel.sh $(LINUX_DIR) $(SOURCE_DIR)/openwrt/kernel/patches
-       # use replacement diag module code
-       cp -f $(SOURCE_DIR)/openwrt/kernel/diag.c $(LINUX_DIR)/drivers/net/diag/diag_led.c
-       cp -f $(SOURCE_DIR)/openwrt/kernel/linux.config $(LINUX_DIR)/.config
-       -(cd $(BUILD_DIR); ln -sf $(LINUX_DIR) linux)
-       -(cd $(LINUX_DIR)/arch/mips/brcm-boards/bcm947xx/; \
-       rm -rf compressed; \
-       tar jxvf $(SOURCE_DIR)/openwrt/kernel/compressed-20040531.tar.bz2; \
-       )
-       touch $(LINUX_DIR)/.patched
-
-$(LINUX_DIR)/.configured: $(LINUX_DIR)/.nf-patched $(LINUX_DIR)/.patched $(LINUX_DIR)/.bbc-patched
-       $(SED) "s,^CROSS_COMPILE.*,CROSS_COMPILE=$(KERNEL_CROSS),g;" $(LINUX_DIR)/Makefile
-       $(SED) "s,^CROSS_COMPILE.*,CROSS_COMPILE=$(KERNEL_CROSS),g;" $(LINUX_DIR)/arch/mips/Makefile
-       $(SED) "s,\-mcpu=,\-mtune=,g;" $(LINUX_DIR)/arch/mips/Makefile
-       make -C $(LINUX_DIR) oldconfig include/linux/version.h
-       touch $(LINUX_DIR)/.configured
-
-$(LINUX_DIR)/.depend_done:  $(LINUX_DIR)/.configured $(GCC_BUILD_DIR2)/.installed
-       $(MAKE) -C $(LINUX_DIR) dep
-       touch $(LINUX_DIR)/.depend_done
-
-$(LINUX_DIR)/$(LINUX_BINLOC): $(LINUX_DIR)/.depend_done
-       $(MAKE) -C $(LINUX_DIR) $(LINUX_FORMAT)
-
-openwrt-kmodules.tar.bz2: $(LINUX_DIR)/$(LINUX_BINLOC)
-       $(MAKE) -C $(LINUX_DIR) modules
-       $(MAKE) -C $(LINUX_DIR) DEPMOD=true \
-               INSTALL_MOD_PATH=$(LINUX_DIR)/modules modules_install
-       tar -C $(LINUX_DIR)/modules/lib -cjf openwrt-kmodules.tar.bz2 modules
-
-openwrt-linux: $(LINUX_DIR)/$(LINUX_BINLOC)
-
-$(DL_DIR)/$(WRT54G_SOURCE):
-       $(WGET) -P $(DL_DIR) $(WRT54G_SITE)/$(WRT54G_SOURCE)
-
-$(WRT54G_DIR)/.source: $(DL_DIR)/$(WRT54G_SOURCE)
-       zcat $(DL_DIR)/$(WRT54G_SOURCE) | tar -C $(BUILD_DIR) -xvf - WRT54GS/README.TXT WRT54GS/release
-       touch $(WRT54G_DIR)/.source
-
-$(WRT54G_DIR)/.prepared: $(WRT54G_DIR)/.source
-       $(SOURCE_DIR)/patch-kernel.sh $(WRT54G_DIR) $(SOURCE_DIR)/openwrt/patches
-       touch $(WRT54G_DIR)/.prepared
-
-######################################################################
-
-OPENWRT_ROOT_SKEL:=root.tar.gz
-OPENWRT_SITE=http://openwrt.ksilebo.net/cgi-bin/viewcvs.cgi/root
-
-$(DL_DIR)/$(OPENWRT_ROOT_SKEL):
-       $(WGET) -P $(DL_DIR) $(OPENWRT_SITE)/$(OPENWRT_ROOT_SKEL)
-
-######################################################################
-
-OPENWRT_SRCBASE:=$(WRT54G_DIR)/release/src
-OPENWRT_SHARED_BUILD_DIR:=$(OPENWRT_SRCBASE)/router/shared
-OPENWRT_SHARED_TARGET_BINARY:=usr/lib/libshared.so
-
-$(TARGET_DIR)/$(OPENWRT_SHARED_TARGET_BINARY): $(WRT54G_DIR)/.source
-       $(MAKE) -C $(OPENWRT_SHARED_BUILD_DIR) -f Makefile-openwrt \
-               SRCBASE=$(OPENWRT_SRCBASE) INSTALLDIR=$(TARGET_DIR) \
-               CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld STRIP="$(STRIP)" \
-               CFLAGS="$(TARGET_CFLAGS) -I. -I$(OPENWRT_SRCBASE)/include -Wall -I$(OPENWRT_SRCBASE)/" \
-               install
-
-openwrt-shared: $(TARGET_DIR)/$(OPENWRT_SHARED_TARGET_BINARY)
-
-openwrt-shared-clean:
-       -$(MAKE) -C $(OPENWRT_SHARED_BUILD_DIR) clean
-
-######################################################################
-
-OPENWRT_NVRAM_BUILD_DIR:=$(OPENWRT_SRCBASE)/router/nvram
-OPENWRT_NVRAM_TARGET_BINARY:=usr/sbin/nvram
-
-$(TARGET_DIR)/$(OPENWRT_NVRAM_TARGET_BINARY): $(WRT54G_DIR)/.source
-       $(MAKE) -C $(OPENWRT_NVRAM_BUILD_DIR) \
-               SRCBASE=$(OPENWRT_SRCBASE) INSTALLDIR=$(TARGET_DIR) \
-               CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld STRIP="$(STRIP)" \
-               CFLAGS="$(TARGET_CFLAGS) -I. -I$(OPENWRT_SRCBASE)/include -Wall -DOPENWRT_NVRAM" \
-               install
-
-
-openwrt-nvram: $(TARGET_DIR)/$(OPENWRT_NVRAM_TARGET_BINARY)
-
-openwrt-nvram-clean:
-       -$(MAKE) -C $(OPENWRT_NVRAM_BUILD_DIR) clean
-
-######################################################################
-
-OPENWRT_MTD_BUILD_DIR:=$(OPENWRT_SRCBASE)/router/rc
-OPENWRT_MTD_TARGET_BINARY:=sbin/mtd
-
-$(TARGET_DIR)/$(OPENWRT_MTD_TARGET_BINARY): $(WRT54G_DIR)/.source $(TARGET_DIR)/$(OPENWRT_NVRAM_TARGET_BINARY) # need libnvram
-       $(MAKE) -C $(OPENWRT_MTD_BUILD_DIR) -f Makefile-openwrt \
-               TOP=$(OPENWRT_SRCBASE)/router \
-               SRCBASE=$(OPENWRT_SRCBASE) INSTALLDIR=$(TARGET_DIR) \
-               CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld STRIP="$(STRIP)" \
-               CFLAGS="$(TARGET_CFLAGS) -I. -I$(OPENWRT_SRCBASE)/router/shared -I$(OPENWRT_SRCBASE)/include -Wall -I$(OPENWRT_SRCBASE)/" \
-               install
-
-openwrt-mtd: $(TARGET_DIR)/$(OPENWRT_MTD_TARGET_BINARY)
-
-openwrt-mtd-clean:
-       -$(MAKE) -C $(OPENWRT_MTD_BUILD_DIR) clean
-
-######################################################################
-
-OPENWRT_WLCONF_BUILD_DIR:=$(OPENWRT_SRCBASE)/router/wlconf
-OPENWRT_WLCONF_TARGET_BINARY:=usr/sbin/wlconf
-
-$(TARGET_DIR)/$(OPENWRT_WLCONF_TARGET_BINARY): $(WRT54G_DIR)/.source
-       $(MAKE) -C $(OPENWRT_WLCONF_BUILD_DIR) \
-               TOP=$(OPENWRT_SRCBASE)/router \
-               SRCBASE=$(OPENWRT_SRCBASE) INSTALLDIR=$(TARGET_DIR) \
-               CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld STRIP="$(STRIP)" \
-               CFLAGS="$(TARGET_CFLAGS) -I. -I$(OPENWRT_SRCBASE)/router/shared -I$(OPENWRT_SRCBASE)/include -Wall" \
-               install
-
-
-openwrt-wlconf: $(TARGET_DIR)/$(OPENWRT_WLCONF_TARGET_BINARY)
-
-openwrt-wlconf-clean:
-       -$(MAKE) -C $(OPENWRT_WLCONF_BUILD_DIR) clean
-
-######################################################################
-
-openwrt-rootprep:
-       # tmp
-       mkdir -p $(TARGET_DIR)/tmp
-       chmod a+rwxt $(TARGET_DIR)/tmp
-       ln -sf /tmp $(TARGET_DIR)/var
-       rm -f $(TARGET_DIR)/usr/tmp
-       ln -sf ../tmp $(TARGET_DIR)/usr/tmp
-       # dev
-       mkdir -p $(TARGET_DIR)/dev
-       # etc
-       mkdir -p $(TARGET_DIR)/etc
-       ln -sf /tmp/resolv.conf $(TARGET_DIR)/etc/resolv.conf
-       # miscellaneous
-       mkdir -p $(TARGET_DIR)/mnt
-       mkdir -p $(TARGET_DIR)/proc
-       mkdir -p $(TARGET_DIR)/jffs
-       mkdir -p $(TARGET_DIR)/rom
-       # modules
-       mkdir -p $(TARGET_MODULES_DIR)
-       cp $(LINUX_DIR)/drivers/net/wl/wl.o $(TARGET_MODULES_DIR)
-       #cp $(LINUX_DIR)/drivers/net/et.4702/et.4702.o $(TARGET_MODULES_DIR)
-       cp $(LINUX_DIR)/drivers/net/et/et.o $(TARGET_MODULES_DIR)
-       cp $(LINUX_DIR)/drivers/net/diag/diag.o $(TARGET_MODULES_DIR)
-
-######################################################################
-
-openwrt-prune: openwrt-base
-       # remove unneeded uClibc libs
-       rm -rf $(TARGET_DIR)/lib/libthread_db*
-       rm -rf $(TARGET_DIR)/lib/libpthread*
-       # remove unneeded uClibc utils
-       rm -f $(TARGET_DIR)/sbin/ldconfig
-       rm -f $(TARGET_DIR)/usr/bin/ldd
-       # remove other unneeded files
-       rm -f $(TARGET_DIR)/usr/sbin/iptables-save
-       rm -f $(TARGET_DIR)/usr/sbin/iptables-restore
-       rm -f $(TARGET_DIR)/usr/sbin/ip6tables
-       rm -f $(TARGET_DIR)/usr/lib/iptables/libip6*
-       -@find $(TARGET_DIR) -type f -perm +111 | xargs $(STAGING_DIR)/bin/sstrip 2>/dev/null || true;
-
-######################################################################
-
-$(STAGING_DIR)/bin/sstrip:
-       $(CC) -o $(STAGING_DIR)/bin/sstrip $(SOURCE_DIR)/openwrt/tools/sstrip.c
-
-wrt-tools:
-       $(CC) -o $(WRT54G_DIR)/release/tools/trx $(SOURCE_DIR)/openwrt/tools/trx.c
-       $(CC) -o $(WRT54G_DIR)/release/tools/addpattern $(SOURCE_DIR)/openwrt/tools/addpattern.c
-
-openwrt-linux.trx:  openwrt-prune squashfsroot wrt-tools
-       $(WRT54G_DIR)/release/tools/trx -o openwrt-linux.trx \
-               $(LINUX_DIR)/$(LINUX_BINLOC) $(IMAGE)
-
-openwrt-gs-code.bin: openwrt-linux.trx
-       $(WRT54G_DIR)/release/tools/addpattern -i openwrt-linux.trx \
-               -o openwrt-gs-code.bin -g
-
-openwrt-g-code.bin: openwrt-gs-code.bin
-       sed -e "1s,^W54S,W54G," < openwrt-gs-code.bin > openwrt-g-code.bin
-
-openwrt-code.bin: openwrt-gs-code.bin openwrt-g-code.bin
-
-######################################################################
diff --git a/obsolete-buildroot/make/patch.mk b/obsolete-buildroot/make/patch.mk
deleted file mode 100644 (file)
index d49102c..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#############################################################
-#
-# patch
-#
-#############################################################
-GNUPATCH_SOURCE:=patch_2.5.9.orig.tar.gz
-GNUPATCH_SITE:=http://ftp.debian.org/debian/pool/main/p/patch
-GNUPATCH_CAT:=zcat
-GNUPATCH_DIR:=$(BUILD_DIR)/patch-2.5.9
-GNUPATCH_BINARY:=patch
-GNUPATCH_TARGET_BINARY:=usr/bin/patch
-
-$(DL_DIR)/$(GNUPATCH_SOURCE):
-        $(WGET) -P $(DL_DIR) $(GNUPATCH_SITE)/$(GNUPATCH_SOURCE)
-
-patch-source: $(DL_DIR)/$(GNUPATCH_SOURCE)
-
-$(GNUPATCH_DIR)/.unpacked: $(DL_DIR)/$(GNUPATCH_SOURCE)
-       $(GNUPATCH_CAT) $(DL_DIR)/$(GNUPATCH_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(GNUPATCH_DIR)/.unpacked
-
-$(GNUPATCH_DIR)/.configured: $(GNUPATCH_DIR)/.unpacked
-       (cd $(GNUPATCH_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-               $(DISABLE_LARGEFILE) \
-       );
-       touch  $(GNUPATCH_DIR)/.configured
-
-$(GNUPATCH_DIR)/$(GNUPATCH_BINARY): $(GNUPATCH_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(GNUPATCH_DIR)
-
-$(TARGET_DIR)/$(GNUPATCH_TARGET_BINARY): $(GNUPATCH_DIR)/$(GNUPATCH_BINARY)
-       rm -f $(TARGET_DIR)/$(GNUPATCH_TARGET_BINARY)
-       cp -a $(GNUPATCH_DIR)/$(GNUPATCH_BINARY) $(TARGET_DIR)/$(GNUPATCH_TARGET_BINARY)
-
-patch: uclibc $(TARGET_DIR)/$(GNUPATCH_TARGET_BINARY)
-
-patch-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(GNUPATCH_DIR) uninstall
-       -$(MAKE) -C $(GNUPATCH_DIR) clean
-
-patch-dirclean:
-       rm -rf $(GNUPATCH_DIR)
-
diff --git a/obsolete-buildroot/make/pciutils.mk b/obsolete-buildroot/make/pciutils.mk
deleted file mode 100644 (file)
index f8608d8..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-#############################################################
-#
-# pciutils
-#
-#############################################################
-PCIUTILS_SOURCE:=pciutils-2.1.10.tar.gz
-PCIUTILS_SITE:=ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci
-PCIUTILS_DIR:=$(BUILD_DIR)/pciutils-2.1.10
-PCIUTILS_CAT:=zcat
-
-# Yet more targets...
-PCIIDS_SITE:=http://pciids.sourceforge.net/
-PCIIDS_SOURCE:=pci.ids.bz2
-PCIIDS_CAT:=bzcat
-
-$(DL_DIR)/$(PCIUTILS_SOURCE):
-        $(WGET) -P $(DL_DIR) $(PCIUTILS_SITE)/$(PCIUTILS_SOURCE)
-
-$(DL_DIR)/$(PCIIDS_SOURCE):
-       $(WGET) -P $(DL_DIR) $(PCIIDS_SITE)/$(PCIIDS_SOURCE)
-
-pciutils-source: $(DL_DIR)/$(PCIUTILS_SOURCE) $(DL_DIR)/$(PCIIDS_SOURCE)
-
-$(PCIUTILS_DIR)/.unpacked: $(DL_DIR)/$(PCIUTILS_SOURCE) $(DL_DIR)/$(PCIIDS_SOURCE)
-       $(PCIUTILS_CAT) $(DL_DIR)/$(PCIUTILS_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       $(PCIIDS_CAT) $(DL_DIR)/$(PCIIDS_SOURCE) > $(PCIUTILS_DIR)/pci.id
-       touch $(PCIUTILS_DIR)/.unpacked
-
-$(PCIUTILS_DIR)/.configured: $(PCIUTILS_DIR)/.unpacked
-       (cd $(PCIUTILS_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-       );
-       touch  $(PCIUTILS_DIR)/.configured
-
-$(PCIUTILS_DIR)/lspci: $(PCIUTILS_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(PCIUTILS_DIR)
-
-$(TARGET_DIR)/sbin/lspci: $(PCIUTILS_DIR)/lspci
-       install -c $(PCIUTILS_DIR)/lspci $(TARGET_DIR)/sbin/lspci
-
-$(TARGET_DIR)/sbin/setpci: $(PCIUTILS_DIR)/setpci
-       install -c $(PCIUTILS_DIR)/setpci $(TARGET_DIR)/sbin/setpci
-
-$(TARGET_DIR)/usr/share/misc/pci.ids: $(PCIUTILS_DIR)/.dist
-       install -Dc $(PCIUTILS_DIR)/pci.ids $(TARGET_DIR)/usr/share/misc/pci.ids
-
-
-pciutils: uclibc $(TARGET_DIR)/sbin/setpci $(TARGET_DIR)/sbin/lspci $(TARGET_DIR)/usr/share/misc/pci.ids
-
-pciutils-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(PCIUTILS_DIR) uninstall
-       -$(MAKE) -C $(PCIUTILS_DIR) clean
-
-pciutils-dirclean:
-       rm -rf $(PCIUTILS_DIR)
-
diff --git a/obsolete-buildroot/make/pcmcia.mk b/obsolete-buildroot/make/pcmcia.mk
deleted file mode 100644 (file)
index 8ae8263..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-#############################################################
-#
-# pcmcia card services
-#
-#############################################################
-# Copyright (C) 2001-2003 by Erik Andersen <andersen@codepoet.org>
-# Copyright (C) 2002 by Tim Riker <Tim@Rikers.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Library General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-
-PCMCIA_SOURCE:=pcmcia-cs-3.2.7.tar.gz
-PCMCIA_SITE:=http://aleron.dl.sourceforge.net/sourceforge/pcmcia-cs
-PCMCIA_DIR:=$(BUILD_DIR)/pcmcia-cs-3.2.7
-PCMCIA_PATCH:=$(SOURCE_DIR)/pcmcia.patch
-PCMCIA_CAT:=zcat
-
-$(DL_DIR)/$(PCMCIA_SOURCE):
-       $(WGET) -P $(DL_DIR) $(PCMCIA_SITE)/$(PCMCIA_SOURCE)
-
-pcmcia-source: $(DL_DIR)/$(PCMCIA_SOURCE)
-
-$(PCMCIA_DIR)/.unpacked: $(DL_DIR)/$(PCMCIA_SOURCE)
-       $(PCMCIA_CAT) $(DL_DIR)/$(PCMCIA_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(PCMCIA_DIR)/.unpacked
-
-$(PCMCIA_DIR)/.patched: $(PCMCIA_DIR)/.unpacked
-       cat $(PCMCIA_PATCH) | patch -d $(PCMCIA_DIR) -p1
-       touch $(PCMCIA_DIR)/.patched
-
-$(PCMCIA_DIR)/.configured: $(PCMCIA_DIR)/.patched
-       ( cd $(PCMCIA_DIR) ; ./Configure --kernel=$(LINUX_SOURCE_DIR) --noprompt \
-               --rcdir=/etc --arch=$(ARCH) --trust --srctree --nocardbus \
-               --sysv --kcc=$(KERNEL_CROSS)gcc --ucc=$(TARGET_CC) --ld=$(TARGET_CROSS)ld \
-               --target=$(TARGET_DIR))
-       $(SED) "s/pump/udhcpc/" $(PCMCIA_DIR)/etc/network
-       $(SED) "s/ide_cs/ide-cs/" $(PCMCIA_DIR)/etc/config
-       $(SED) "s/bind \"wvlan_cs\"/bind \"orinoco_cs\"/g" $(PCMCIA_DIR)/etc/config
-       touch $(PCMCIA_DIR)/.configured
-
-$(PCMCIA_DIR)/cardmgr/cardmgr: $(PCMCIA_DIR)/.configured
-       $(MAKE) -C $(PCMCIA_DIR) -i all
-       -A=`find $(PCMCIA_DIR) -type f -perm +111` ; \
-       for fo in $$A; do \
-               file $$fo | grep "ELF" | grep "executable" > /dev/null 2>&1; \
-               if [ $$? = 0 ] ; then \
-                       $(STRIP) $$fo; \
-               fi; \
-       done
-       touch -c $(PCMCIA_DIR)/cardmgr/cardmgr
-
-$(TARGET_DIR)/sbin/cardmgr: $(PCMCIA_DIR)/cardmgr/cardmgr
-       rm -rf $(TARGET_DIR)/etc/pcmcia;
-       $(MAKE) -i -C $(PCMCIA_DIR) install
-       rm -rf $(TARGET_DIR)/usr/man;
-       rm -rf $(TARGET_DIR)/usr/share/man;
-       rm -rf $(TARGET_DIR)/usr/X11R6/man;
-       rm -rf $(TARGET_DIR)/etc/rc.d;
-       rm -rf $(TARGET_DIR)/etc/rc?.d;
-       rm -f $(TARGET_DIR)/etc/init.d/pcmcia*;
-       rm -f $(TARGET_DIR)/sbin/dump_cis $(TARGET_DIR)/sbin/pack_cis
-       rm -f $(TARGET_DIR)/usr/share/pnp.ids $(TARGET_DIR)/sbin/lspnp $(TARGET_DIR)/sbin/setpnp;
-       rm -f $(TARGET_DIR)/sbin/pcinitrd
-       rm -f $(TARGET_DIR)/sbin/probe
-       rm -f $(TARGET_DIR)/sbin/ide_info
-       rm -f $(TARGET_DIR)/sbin/scsi_info
-       rm -f $(TARGET_DIR)/sbin/ftl_check
-       rm -f $(TARGET_DIR)/sbin/ftl_format
-       rm -f $(TARGET_DIR)/usr/X11R6/bin/xcardinfo
-       rm -rf $(TARGET_DIR)/etc/sysconfig
-       mkdir -p $(TARGET_DIR)/etc/default
-       cp -f $(PCMCIA_DIR)/etc/pcmcia $(TARGET_DIR)/etc/default/
-       cp -f $(PCMCIA_DIR)/etc/rc.pcmcia $(TARGET_DIR)/etc/init.d/S30pcmcia
-       rm -rf $(TARGET_DIR)/etc/pcmcia/cis
-       chmod a+x $(TARGET_DIR)/etc/init.d/S30pcmcia
-       chmod -R u+w $(TARGET_DIR)/etc/pcmcia/*
-
-# use busybox depmod.pl so we need the sources unpacked
-$(PCMCIA_DIR)/.modules.dep: $(BUSYBOX_DIR)/.configured $(TARGET_DIR)/lib/modules
-       [ -d $(TARGET_DIR)/lib/modules/$(LINUX_VERSION) ] && \
-       $(BUSYBOX_DIR)/examples/depmod.pl \
-               -b $(TARGET_DIR)/lib/modules/$(LINUX_VERSION)/ \
-               -k $(LINUX_DIR)/vmlinux \
-               -F $(LINUX_DIR)/System.map \
-               > $(TARGET_DIR)/lib/modules/$(LINUX_VERSION)/modules.dep
-       touch $(PCMCIA_DIR)/.modules.dep
-
-pcmcia: uclibc $(TARGET_DIR)/sbin/cardmgr $(PCMCIA_DIR)/.modules.dep
-
-pcmcia-clean:
-       rm -f $(TARGET_DIR)/sbin/cardmgr
-       -$(MAKE) -C $(PCMCIA_DIR) clean
-       rm -f $(PCMCIA_DIR)/.configured $(PCMCIA_DIR)/config.out
-
-pcmcia-dirclean:
-       rm -rf $(PCMCIA_DIR)
diff --git a/obsolete-buildroot/make/ppp.mk b/obsolete-buildroot/make/ppp.mk
deleted file mode 100644 (file)
index 66b17a6..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-## ppp & ppp-radius-plugin
-
-PPP_VERSION := 2.4.2
-PPP_RELEASE := 1
-
-PPP_SOURCE:=ppp-$(PPP_VERSION).tar.gz
-PPP_SITE:=ftp://ftp.samba.org/pub/ppp
-PPP_DIR:=$(BUILD_DIR)/ppp-$(PPP_VERSION)
-PPP_CAT:=zcat
-
-PPP_PATCH_DIR := $(SOURCE_DIR)/openwrt/patches/ppp
-
-PPP_BUILD_DIR := $(BUILD_DIR)/ppp_$(PPP_VERSION)-$(PPP_RELEASE)
-PPP_IPK_DIR := $(OPENWRT_IPK_DIR)/ppp
-PPP_IPK := $(PPP_BUILD_DIR)_$(ARCH).ipk
-
-PPP_RADIUS_PLUGIN_BUILD_DIR := $(BUILD_DIR)/ppp-radius-plugin_$(PPP_VERSION)-$(PPP_RELEASE)
-PPP_RADIUS_PLUGIN_IPK_DIR := $(OPENWRT_IPK_DIR)/ppp-radius-plugin
-PPP_RADIUS_PLUGIN_IPK := $(PPP_RADIUS_PLUGIN_BUILD_DIR)_$(ARCH).ipk
-
-
-$(DL_DIR)/$(PPP_SOURCE):
-        $(WGET) -P $(DL_DIR) $(PPP_SITE)/$(PPP_SOURCE)
-
-
-$(PPP_DIR)/.stamp-unpacked: $(DL_DIR)/$(PPP_SOURCE)
-       $(PPP_CAT) $(DL_DIR)/$(PPP_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-
-       touch $(PPP_DIR)/.stamp-unpacked
-
-
-$(PPP_DIR)/.stamp-patched: $(PPP_DIR)/.stamp-unpacked
-       $(SOURCE_DIR)/patch-kernel.sh $(PPP_DIR) $(PPP_PATCH_DIR)
-
-       touch $(PPP_DIR)/.stamp-patched
-
-
-$(PPP_DIR)/.stamp-configured: $(PPP_DIR)/.stamp-patched
-       cd $(PPP_DIR)/pppd/plugins/radius/radiusclient ; \
-       rm -rf config.cache ; \
-       echo > aclocal.m4; \
-       $(TARGET_CONFIGURE_OPTS) \
-       ac_cv_func_setvbuf_reversed=no \
-       ac_cv_func_uname=no \
-       ./configure \
-        --target=$(GNU_TARGET_NAME) \
-        --host=$(GNU_TARGET_NAME) \
-        --build=$(GNU_HOST_NAME) \
-        --prefix=/usr \
-        --exec-prefix=/usr \
-        --bindir=/usr/bin \
-        --sbindir=/usr/sbin \
-        --libexecdir=/usr/lib \
-        --sysconfdir=/etc \
-        --datadir=/usr/share \
-        --localstatedir=/var \
-        --mandir=/usr/share/man \
-        --infodir=/usr/share/info \
-        $(DISABLE_NLS) \
-        --disable-shared \
-        --enable-static \
-
-       cd $(PPP_DIR) ; \
-       rm -rf config.cache ; \
-       $(TARGET_CONFIGURE_OPTS) \
-       CFLAGS="$(TARGET_CFLAGS)" \
-       ./configure \
-        --target=$(GNU_TARGET_NAME) \
-        --host=$(GNU_TARGET_NAME) \
-        --build=$(GNU_HOST_NAME) \
-        --prefix=/usr \
-        --exec-prefix=/usr \
-        --bindir=/usr/bin \
-        --sbindir=/usr/sbin \
-        --libexecdir=/usr/lib \
-        --datadir=/usr/share \
-        --localstatedir=/var \
-        --mandir=/usr/share/man \
-        --infodir=/usr/share/info \
-        --sysconfdir=/etc \
-        $(DISABLE_NLS) \
-
-       touch $(PPP_DIR)/.stamp-configured
-
-
-$(PPP_DIR)/.stamp-built: $(PPP_DIR)/.stamp-configured
-       cd  $(PPP_DIR) ; \
-       $(MAKE) \
-        CC=$(TARGET_CC) \
-        COPTS="$(TARGET_CFLAGS)" \
-        all
-
-       touch $(PPP_DIR)/.stamp-built
-
-
-$(PPP_BUILD_DIR)/CONTROL/control: $(PPP_DIR)/.stamp-built
-       rm -rf $(PPP_BUILD_DIR)
-       mkdir -p $(PPP_BUILD_DIR)/usr/sbin
-       cp -a $(PPP_DIR)/pppd/pppd $(PPP_BUILD_DIR)/usr/sbin/
-       $(STRIP) $(PPP_BUILD_DIR)/usr/sbin/*
-       cp -a $(PPP_IPK_DIR)/root/* $(PPP_BUILD_DIR)/
-       chmod 0755 $(PPP_BUILD_DIR)/etc
-       chmod 0755 $(PPP_BUILD_DIR)/etc/ppp
-       chmod 0600 $(PPP_BUILD_DIR)/etc/ppp/chap-secrets
-       chmod 0644 $(PPP_BUILD_DIR)/etc/ppp/options
-       chmod 0755 $(PPP_BUILD_DIR)/etc/ppp/peers
-       chmod 0755 $(PPP_BUILD_DIR)/usr
-       chmod 0755 $(PPP_BUILD_DIR)/usr/sbin
-       chmod 0755 $(PPP_BUILD_DIR)/usr/sbin/*
-       cp -a $(PPP_IPK_DIR)/CONTROL $(PPP_BUILD_DIR)/
-       perl -pi -e "s/^Vers.*:.*$$/Version: $(PPP_VERSION)-$(PPP_RELEASE)/" $(PPP_BUILD_DIR)/CONTROL/control
-       perl -pi -e "s/^Arch.*:.*$$/Architecture: $(ARCH)/" $(PPP_BUILD_DIR)/CONTROL/control
-
-       touch $(PPP_BUILD_DIR)/CONTROL/control
-
-
-$(PPP_IPK): $(PPP_BUILD_DIR)/CONTROL/control
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(PPP_BUILD_DIR)
-
-
-$(PPP_RADIUS_PLUGIN_BUILD_DIR)/CONTROL/control: $(PPP_DIR)/.stamp-built
-       rm -rf $(PPP_RADIUS_PLUGIN_BUILD_DIR)
-       mkdir -p $(PPP_RADIUS_PLUGIN_BUILD_DIR)/usr/lib/pppd/$(PPP_VERSION)
-       cp -a $(PPP_DIR)/pppd/plugins/radius/radius.so $(PPP_RADIUS_PLUGIN_BUILD_DIR)/usr/lib/pppd/$(PPP_VERSION)/
-       $(STRIP) $(PPP_RADIUS_PLUGIN_BUILD_DIR)/usr/lib/pppd/$(PPP_VERSION)/*
-       cp -a $(PPP_RADIUS_PLUGIN_IPK_DIR)/root/* $(PPP_RADIUS_PLUGIN_BUILD_DIR)/
-       chmod 0755 $(PPP_RADIUS_PLUGIN_BUILD_DIR)/etc
-       chmod 0755 $(PPP_RADIUS_PLUGIN_BUILD_DIR)/etc/ppp
-       chmod 0644 $(PPP_RADIUS_PLUGIN_BUILD_DIR)/etc/ppp/radius.conf
-       chmod 0755 $(PPP_RADIUS_PLUGIN_BUILD_DIR)/etc/ppp/radius
-       chmod 0644 $(PPP_RADIUS_PLUGIN_BUILD_DIR)/etc/ppp/radius/dict*
-       chmod 0600 $(PPP_RADIUS_PLUGIN_BUILD_DIR)/etc/ppp/radius/servers
-       chmod 0755 $(PPP_RADIUS_PLUGIN_BUILD_DIR)/usr
-       chmod 0755 $(PPP_RADIUS_PLUGIN_BUILD_DIR)/usr/lib
-       chmod 0755 $(PPP_RADIUS_PLUGIN_BUILD_DIR)/usr/lib/pppd
-       chmod 0755 $(PPP_RADIUS_PLUGIN_BUILD_DIR)/usr/lib/pppd/$(PPP_VERSION)
-       cp -a $(PPP_RADIUS_PLUGIN_IPK_DIR)/CONTROL $(PPP_RADIUS_PLUGIN_BUILD_DIR)/
-       perl -pi -e "s/^Vers.*:.*$$/Version: $(PPP_VERSION)-$(PPP_RELEASE)/" $(PPP_RADIUS_PLUGIN_BUILD_DIR)/CONTROL/control
-       perl -pi -e "s/^Arch.*:.*$$/Architecture: $(ARCH)/" $(PPP_RADIUS_PLUGIN_BUILD_DIR)/CONTROL/control
-
-       touch $(PPP_RADIUS_PLUGIN_BUILD_DIR)/CONTROL/control
-
-
-$(PPP_RADIUS_PLUGIN_IPK): $(PPP_RADIUS_PLUGIN_BUILD_DIR)/CONTROL/control
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(PPP_RADIUS_PLUGIN_BUILD_DIR)
-
-
-ppp-ipk: ipkg-utils $(PPP_IPK) $(PPP_RADIUS_PLUGIN_IPK)
-
-ppp-ipk-clean:
-       rm -rf $(PPP_IPK) $(PPP_RADIUS_PLUGIN_IPK)
-       rm -rf $(PPP_BUILD_DIR) $(PPP_RADIUS_PLUGIN_BUILD_DIR)
-
-ppp-clean:
-       cd $(PPP_DIR) ; \
-       $(MAKE) clean
-
-ppp-dirclean:
-       rm -rf $(PPP_DIR)
-
-
diff --git a/obsolete-buildroot/make/pppd.mk b/obsolete-buildroot/make/pppd.mk
deleted file mode 100644 (file)
index a76149b..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-#############################################################
-#
-# pppd
-#
-#############################################################
-PPPD_SOURCE:=ppp-2.4.1.tar.gz
-PPPD_SITE:=ftp://ftp.samba.org/pub/ppp
-PPPD_DIR:=$(BUILD_DIR)/ppp-2.4.1
-PPPD_CAT:=zcat
-PPPD_BINARY:=pppd/pppd
-PPPD_TARGET_BINARY:=usr/sbin/pppd
-
-
-$(DL_DIR)/$(PPPD_SOURCE):
-        $(WGET) -P $(DL_DIR) $(PPPD_SITE)/$(PPPD_SOURCE)
-
-pppd-source: $(DL_DIR)/$(PPPD_SOURCE)
-
-$(PPPD_DIR)/.unpacked: $(DL_DIR)/$(PPPD_SOURCE)
-       $(PPPD_CAT) $(DL_DIR)/$(PPPD_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       $(SED) 's/ -DIPX_CHANGE -DHAVE_MULTILINK -DHAVE_MMAP//' $(PPPD_DIR)/pppd/Makefile.linux
-       $(SED) 's/$(INSTALL) -s/$(INSTALL)/' $(PPPD_DIR)/*/Makefile.linux
-       $(SED) 's/ -o root//' $(PPPD_DIR)/*/Makefile.linux
-       $(SED) 's/ -g daemon//' $(PPPD_DIR)/*/Makefile.linux
-       touch $(PPPD_DIR)/.unpacked
-
-$(PPPD_DIR)/.configured: $(PPPD_DIR)/.unpacked
-       (cd $(PPPD_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-       );
-       touch  $(PPPD_DIR)/.configured
-
-$(PPPD_DIR)/$(PPPD_BINARY): $(PPPD_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(PPPD_DIR)
-
-$(TARGET_DIR)/$(PPPD_TARGET_BINARY): $(PPPD_DIR)/$(PPPD_BINARY)
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(PPPD_DIR) install
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-
-pppd: uclibc $(TARGET_DIR)/$(PPPD_TARGET_BINARY)
-
-pppd-clean:
-       rm -f  $(TARGET_DIR)/usr/sbin/pppd
-       rm -f  $(TARGET_DIR)/usr/sbin/chat
-       rm -rf $(TARGET_DIR)/etc/ppp
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(PPPD_DIR) uninstall
-       -$(MAKE) -C $(PPPD_DIR) clean
-
-pppd-dirclean:
-       rm -rf $(PPPD_DIR)
-
-
diff --git a/obsolete-buildroot/make/pppoecd.mk b/obsolete-buildroot/make/pppoecd.mk
deleted file mode 100644 (file)
index 734fe7f..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-# build the Linksys pppoecd
-
-# Note that this patches the linksys pppd before patching pppoecd.
-# The pppd patch changes the pathnames that pppoecd will use. 
-# In an attempt to avoid conflicts the marker file is called 
-# .patched-pppoecd in the pppd directory.
-
-PPPD_DIR=$(BUILD_DIR)/WRT54GS/release/src/router/ppp/pppd
-PPPD_PATCH_DIR=$(OPENWRT_IPK_DIR)/pppoecd
-
-PPPOECD_DIR=$(BUILD_DIR)/WRT54GS/release/src/router/ppp/pppoecd
-PPPOECD_IPK_DIR=$(OPENWRT_IPK_DIR)/pppoecd
-PPPOECD_IPK_BUILD_DIR=$(BUILD_DIR)/pppoecd-1.0
-PPPOECD_PACKAGE=$(BUILD_DIR)/pppoecd_1.0_mipsel.ipk
-PPPOECD_BIN=$(TARGET_DIR)/sbin/pppoecd
-PPPOECD_IPK_BIN=$(PPPOECD_IPK_BUILD_DIR)/sbin/pppoecd
-
-# patch pppd for the openwrt compatible path names
-$(PPPD_DIR)/.patched-pppoecd: $(BUILD_DIR)/WRT54GS/.source
-       cat $(PPPD_PATCH_DIR)/pppoecd-pathnames.patch | patch -d $(PPPD_DIR)
-       touch $(PPPD_DIR)/.patched-pppoecd
-
-# patch the pppoecd itself for GCC3.x compatibility and to move pppoecd to /sbin
-$(PPPOECD_DIR)/.patched: $(PPPD_DIR)/.patched-pppoecd
-       cat $(PPPOECD_IPK_DIR)/pppoecd.patch | patch -d $(PPPOECD_DIR)
-       touch $(PPPOECD_DIR)/.patched
-
-# build the pppoecd binary for the ipk version
-$(PPPOECD_IPK_BIN): $(PPPOECD_DIR)/.patched
-       mkdir -p $(PPPOECD_IPK_BUILD_DIR)/etc/ppp
-       cp $(PPPOECD_IPK_DIR)/root/etc/ppp/ip-up $(PPPOECD_IPK_BUILD_DIR)/etc/ppp/ip-up
-       chmod a+x $(PPPOECD_IPK_BUILD_DIR)/etc/ppp/ip-up
-       $(MAKE) -C $(PPPOECD_DIR) CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld \
-               SRCBASE=$(OPENWRT_SRCBASE) INSTALLDIR=$(PPPOECD_IPK_BUILD_DIR) LIBDIR=$(UCLIBC_DIR)/lib \
-               STRIP="$(STRIP)" \
-               install
-
-# setup ipkg control files
-$(PPPOECD_IPK_BUILD_DIR)/CONTROL/control: 
-       mkdir -p $(PPPOECD_IPK_BUILD_DIR)/CONTROL
-       cp $(PPPOECD_IPK_DIR)/CONTROL/prerm $(PPPOECD_IPK_BUILD_DIR)/CONTROL/prerm
-       chmod a+x $(PPPOECD_IPK_BUILD_DIR)/CONTROL/prerm
-       cp $(PPPOECD_IPK_DIR)/CONTROL/postrm $(PPPOECD_IPK_BUILD_DIR)/CONTROL/postrm
-       chmod a+x $(PPPOECD_IPK_BUILD_DIR)/CONTROL/postrm
-       cp $(PPPOECD_IPK_DIR)/CONTROL/conffiles $(PPPOECD_IPK_BUILD_DIR)/CONTROL/conffiles
-       cp $(PPPOECD_IPK_DIR)/CONTROL/control $(PPPOECD_IPK_BUILD_DIR)/CONTROL/control
-       
-# build the ipk package
-$(PPPOECD_PACKAGE): $(PPPOECD_IPK_BIN) $(PPPOECD_IPK_BUILD_DIR)/CONTROL/control
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(PPPOECD_IPK_BUILD_DIR)
-
-# main target for building the ipk version
-pppoecd-ipk: $(PPPOECD_PACKAGE)
-       
-# the embedded binary
-$(PPPOECD_BIN): $(PPPOECD_DIR)/.patched
-       mkdir -p $(TARGET_DIR)/etc/ppp
-       cp $(PPPOECD_IPK_DIR)/root/etc/ppp/ip-up $(TARGET_DIR)/etc/ppp/ip-up
-       chmod a+x $(TARGET_DIR)/etc/ppp/ip-up
-       $(MAKE) -C $(PPPOECD_DIR) CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld \
-               SRCBASE=$(OPENWRT_SRCBASE) INSTALLDIR=$(TARGET_DIR) LIBDIR=$(UCLIBC_DIR)/lib \
-               STRIP="$(STRIP)" \
-               install
-
-# main target for building the embedded version        
-pppoecd: $(PPPOECD_BIN)
-
-pppoecd-clean:
-       -$(MAKE) -C $(PPPOECD_DIR) clean
-       rm -f $(TARGET_DIR)/usr/sbin/pppoecd
-       rm -rf $(PPPOECD_IPK_BUILD_DIR)
-       rm -f $(PPPOECD_PACKAGE)
diff --git a/obsolete-buildroot/make/pptp-client.mk b/obsolete-buildroot/make/pptp-client.mk
deleted file mode 100644 (file)
index 5fbddc1..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-## pptp-client
-
-PPTPC_VERSION := 1.5.0
-PPTPC_RELEASE := 1
-
-PPTPC_SOURCE := pptp-linux-$(PPTPC_VERSION).tar.gz
-PPTPC_SITE := dl.sourceforge.net/sourceforge/pptpclient/
-PPTPC_DIR := $(BUILD_DIR)/pptp-linux-$(PPTPC_VERSION)
-PPTPC_CAT := zcat
-
-PPTPC_PATCH_DIR := $(SOURCE_DIR)/openwrt/patches/pptp-client
-
-PPTPC_BUILD_DIR := $(BUILD_DIR)/pptp-client_$(PPTPC_VERSION)-$(PPTPC_RELEASE)
-PPTPC_IPK_DIR := $(OPENWRT_IPK_DIR)/pptp-client
-PPTPC_IPK := $(PPTPC_BUILD_DIR)_$(ARCH).ipk
-
-
-$(DL_DIR)/$(PPTPC_SOURCE):
-        $(WGET) -P $(DL_DIR) $(PPTPC_SITE)/$(PPTPC_SOURCE)
-
-
-$(PPTPC_DIR)/.stamp-unpacked: $(DL_DIR)/$(PPTPC_SOURCE)
-       $(PPTPC_CAT) $(DL_DIR)/$(PPTPC_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-
-       touch $(PPTPC_DIR)/.stamp-unpacked
-
-
-$(PPTPC_DIR)/.stamp-patched: $(PPTPC_DIR)/.stamp-unpacked
-
-       touch $(PPTPC_DIR)/.stamp-patched
-
-
-$(PPTPC_DIR)/.stamp-configured: $(PPTPC_DIR)/.stamp-patched
-         
-       touch $(PPTPC_DIR)/.stamp-configured
-
-
-$(PPTPC_DIR)/.stamp-built: $(PPTPC_DIR)/.stamp-configured
-       cd  $(PPTPC_DIR) ; \
-       $(MAKE) \
-         CC=$(TARGET_CC) \
-         DEBUG="" \
-         OPTIMIZE="$(TARGET_CFLAGS)" \
-        all \
-
-       touch $(PPTPC_DIR)/.stamp-built
-
-
-$(PPTPC_BUILD_DIR): $(PPTPC_DIR)/.stamp-built
-       mkdir -p $(PPTPC_BUILD_DIR)
-
-       install -m0755 -d $(PPTPC_BUILD_DIR)/usr/sbin
-       install -m0755 $(PPTPC_DIR)/pptp $(PPTPC_BUILD_DIR)/usr/sbin
-
-       install -m0755 -d $(PPTPC_BUILD_DIR)/etc/ppp
-       install -m0644 $(PPTPC_IPK_DIR)/root/etc/ppp/pptp-client-options $(PPTPC_BUILD_DIR)/etc/ppp/
-       install -m0755 -d $(PPTPC_BUILD_DIR)/etc/ppp/peers
-       install -m0644 $(PPTPC_IPK_DIR)/root/etc/ppp/peers/pptp-client-sample $(PPTPC_BUILD_DIR)/etc/ppp/peers/
-       
-       $(STRIP) $(PPTPC_BUILD_DIR)/usr/sbin/*
-
-       touch $(PPTPC_DIR)/.stamp-installed
-
-
-$(PPTPC_IPK): $(PPTPC_BUILD_DIR)
-       cp -a $(PPTPC_IPK_DIR)/CONTROL $(PPTPC_BUILD_DIR)/
-       perl -pi -e "s/^Vers.*:.*$$/Version: $(PPTPC_VERSION)-$(PPTPC_RELEASE)/" $(PPTPC_BUILD_DIR)/CONTROL/control
-       perl -pi -e "s/^Arch.*:.*$$/Architecture: $(ARCH)/" $(PPTPC_BUILD_DIR)/CONTROL/control
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(PPTPC_BUILD_DIR)
-
-
-pptp-client-ipk: ipkg-utils $(PPTPC_IPK)
-
-pptp-client-clean:
-       $(MAKE) -C $(PPTPC_DIR) clean
-
-pptp-client-clean-all:
-       rm -rf $(PPTPC_IPK)
-       rm -rf $(PPTPC_BUILD_DIR)
-       rm -rf $(PPTPC_DIR)
diff --git a/obsolete-buildroot/make/pptp-server.mk b/obsolete-buildroot/make/pptp-server.mk
deleted file mode 100644 (file)
index d394c26..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-## pptp-server
-
-PPTPD_VERSION := 1.1.3
-PPTPD_RELEASE := 1
-
-PPTPD_SOURCE := pptpd-1.1.3-20030409.tar.gz
-PPTPD_SITE := http://unc.dl.sourceforge.net/sourceforge/poptop/
-PPTPD_DIR := $(BUILD_DIR)/poptop
-PPTPD_CAT := zcat
-
-PPTPD_PATCH_DIR := $(SOURCE_DIR)/openwrt/patches/pptp-server
-
-PPTPD_BUILD_DIR := $(BUILD_DIR)/pptp-server_$(PPTPD_VERSION)-$(PPTPD_RELEASE)
-PPTPD_IPK_DIR := $(OPENWRT_IPK_DIR)/pptp-server
-PPTPD_IPK := $(PPTPD_BUILD_DIR)_$(ARCH).ipk
-
-
-$(DL_DIR)/$(PPTPD_SOURCE):
-        $(WGET) -P $(DL_DIR) $(PPTPD_SITE)/$(PPTPD_SOURCE)
-
-
-$(PPTPD_DIR)/.stamp-unpacked: $(DL_DIR)/$(PPTPD_SOURCE)
-       $(PPTPD_CAT) $(DL_DIR)/$(PPTPD_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-
-       touch $(PPTPD_DIR)/.stamp-unpacked
-
-
-$(PPTPD_DIR)/.stamp-patched: $(PPTPD_DIR)/.stamp-unpacked
-       $(SOURCE_DIR)/patch-kernel.sh $(PPTPD_DIR) $(PPTPD_PATCH_DIR)
-
-       touch $(PPTPD_DIR)/.stamp-patched
-
-
-$(PPTPD_DIR)/.stamp-configured: $(PPTPD_DIR)/.stamp-patched
-       cd $(PPTPD_DIR) ; \
-       rm -rf config.cache ; \
-       aclocal ; \
-       autoconf ; \
-       $(TARGET_CONFIGURE_OPTS) \
-       CFLAGS="$(TARGET_CFLAGS)" \
-       ./configure \
-         --target=$(GNU_TARGET_NAME) \
-         --host=$(GNU_TARGET_NAME) \
-         --build=$(GNU_HOST_NAME) \
-         --prefix=/usr \
-         --exec-prefix=/usr \
-         --bindir=/usr/bin \
-         --sbindir=/usr/sbin \
-         --libexecdir=/usr/lib \
-         --datadir=/usr/share \
-         --infodir=/usr/share/info \
-         --mandir=/usr/share/man \
-         --localstatedir=/var \
-         --sysconfdir=/etc \
-         $(DISABLE_NLS) \
-         --with-pppd-ip-alloc \
-         
-       touch $(PPTPD_DIR)/.stamp-configured
-
-
-$(PPTPD_DIR)/.stamp-built: $(PPTPD_DIR)/.stamp-configured
-       cd  $(PPTPD_DIR) ; \
-       touch config.guess ; \
-       touch config.sub ; \
-       $(MAKE) \
-        CC=$(TARGET_CC) \
-        COPTS="$(TARGET_CFLAGS)" \
-        all
-
-       touch $(PPTPD_DIR)/.stamp-built
-
-
-$(PPTPD_BUILD_DIR)/CONTROL/control: $(PPTPD_DIR)/.stamp-built
-       rm -rf $(PPTPD_BUILD_DIR)
-       mkdir -p $(PPTPD_BUILD_DIR)/usr/sbin
-       cp -a $(PPTPD_DIR)/pptpctrl $(PPTPD_BUILD_DIR)/usr/sbin/
-       cp -a $(PPTPD_DIR)/pptpd $(PPTPD_BUILD_DIR)/usr/sbin/
-       $(STRIP) $(PPTPD_BUILD_DIR)/usr/sbin/*
-       cp -a $(PPTPD_IPK_DIR)/root/* $(PPTPD_BUILD_DIR)/
-       chmod 0755 $(PPTPD_BUILD_DIR)/etc
-       chmod 0755 $(PPTPD_BUILD_DIR)/etc/init.d
-       chmod 0755 $(PPTPD_BUILD_DIR)/etc/init.d/*
-       chmod 0755 $(PPTPD_BUILD_DIR)/etc/ppp
-       chmod 0644 $(PPTPD_BUILD_DIR)/etc/ppp/pptp-server-options
-       chmod 0644 $(PPTPD_BUILD_DIR)/etc/pptpd.conf
-       chmod 0755 $(PPTPD_BUILD_DIR)/usr
-       chmod 0755 $(PPTPD_BUILD_DIR)/usr/sbin
-       chmod 0755 $(PPTPD_BUILD_DIR)/usr/sbin/*
-       cp -a $(PPTPD_IPK_DIR)/CONTROL $(PPTPD_BUILD_DIR)/
-       perl -pi -e "s/^Vers.*:.*$$/Version: $(PPTPD_VERSION)-$(PPTPD_RELEASE)/" $(PPTPD_BUILD_DIR)/CONTROL/control
-       perl -pi -e "s/^Arch.*:.*$$/Architecture: $(ARCH)/" $(PPTPD_BUILD_DIR)/CONTROL/control
-
-       touch $(PPTPD_BUILD_DIR)/CONTROL/control
-
-
-$(PPTPD_IPK): $(PPTPD_BUILD_DIR)/CONTROL/control
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(PPTPD_BUILD_DIR)
-
-
-pptp-server-ipk: ipkg-utils $(PPTPD_IPK)
-
-pptp-server-clean:
-       rm -rf $(PPTPD_IPK)
-       rm -rf $(PPTPD_BUILD_DIR)
-       rm -rf $(PPTPD_DIR)
diff --git a/obsolete-buildroot/make/radvd.mk b/obsolete-buildroot/make/radvd.mk
deleted file mode 100644 (file)
index 1602bbb..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#############################################################
-#
-# radvd
-#
-#############################################################
-RADVD_VERSION:=0.7.2
-RADVD_SOURCE:=radvd-$(RADVD_VERSION).tar.gz
-RADVD_SITE:=http://v6web.litech.org/radvd/dist
-RADVD_DIR:=$(BUILD_DIR)/radvd-$(RADVD_VERSION)
-RADVD_IPK=$(BUILD_DIR)/radvd_0.7.2-1_mipsel.ipk
-RADVD_IPK_DIR:=$(BUILD_DIR)/radvd-0.7.2-ipk
-
-$(DL_DIR)/$(RADVD_SOURCE):
-        $(WGET) -P $(DL_DIR) $(RADVD_SITE)/$(RADVD_SOURCE)
-
-radvd-source: $(DL_DIR)/$(RADVD_SOURCE)
-
-$(RADVD_DIR)/.unpacked: $(DL_DIR)/$(RADVD_SOURCE)
-       tar -C $(BUILD_DIR) -zxf $(DL_DIR)/$(RADVD_SOURCE)
-       touch $(RADVD_DIR)/.unpacked
-
-$(RADVD_DIR)/.configured: $(RADVD_DIR)/.unpacked
-       (cd $(RADVD_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --with-logfile=/tmp/radvd.log \
-               --with-pidfile=/tmp/run/radvd.pid \
-               --with-configfile=/etc/radvd.conf \
-       );
-       touch  $(RADVD_DIR)/.configured
-
-$(RADVD_DIR)/radvd: $(RADVD_DIR)/.configured
-       cp $(FLEX_DIR)/libfl.a $(RADVD_DIR)/libfl.a
-       $(MAKE) $(TARGET_CONFIGURE_OPTS) LD=$(TARGET_CC) LDFLAGS=-L. -C $(RADVD_DIR)
-
-$(RADVD_IPK):  $(RADVD_DIR)/radvd
-       mkdir -p $(RADVD_IPK_DIR)/CONTROL $(RADVD_IPK_DIR)/etc $(RADVD_IPK_DIR)/usr/sbin
-       install -m 644 $(OPENWRT_IPK_DIR)/radvd/CONTROL/control $(RADVD_IPK_DIR)/CONTROL/control
-       install -m 755 $(OPENWRT_IPK_DIR)/radvd/CONTROL/postinst $(RADVD_IPK_DIR)/CONTROL/postinst
-       install -m 644 $(OPENWRT_IPK_DIR)/radvd/radvd.conf.example $(RADVD_IPK_DIR)/etc/radvd.conf.example
-       install -m 755 $(RADVD_DIR)/radvd $(RADVD_IPK_DIR)/usr/sbin/
-       install -m 755 $(RADVD_DIR)/radvdump $(RADVD_IPK_DIR)/usr/sbin/
-       $(STRIP) $(RADVD_IPK_DIR)/usr/sbin/radvd
-       $(STRIP) $(RADVD_IPK_DIR)/usr/sbin/radvdump
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(RADVD_IPK_DIR)
-
-radvd-ipk : uclibc $(FLEX_DIR)/$(FLEX_BINARY) $(RADVD_IPK)
-
-radvd-clean:
-       -$(MAKE) -C $(RADVD_DIR) clean
-
-radvd-dirclean:
-       rm -rf $(RADVD_DIR) $(RADVD_IPK_DIR)
-
diff --git a/obsolete-buildroot/make/sed.mk b/obsolete-buildroot/make/sed.mk
deleted file mode 100644 (file)
index 2476c59..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-#############################################################
-#
-# sed
-#
-#############################################################
-SED_SOURCE:=sed-4.0.8.tar.gz
-SED_SITE:=ftp://ftp.gnu.org/gnu/sed
-SED_CAT:=zcat
-SED_DIR1:=$(TOOL_BUILD_DIR)/sed-4.0.8
-SED_DIR2:=$(BUILD_DIR)/sed-4.0.8
-SED_BINARY:=sed/sed
-SED_TARGET_BINARY:=bin/sed
-ifeq ($(strip $(BUILD_WITH_LARGEFILE)),true)
-SED_CPPFLAGS=-D_FILE_OFFSET_BITS=64
-endif
-SED:=$(STAGING_DIR)/bin/sed -i -e
-
-HOST_SED_TARGET=$(shell ./sources/sedcheck.sh)
-
-$(DL_DIR)/$(SED_SOURCE):
-        $(WGET) -P $(DL_DIR) $(SED_SITE)/$(SED_SOURCE)
-
-sed-source: $(DL_DIR)/$(SED_SOURCE)
-
-
-#############################################################
-#
-# build sed for use on the host system
-#
-#############################################################
-$(SED_DIR1)/.unpacked: $(DL_DIR)/$(SED_SOURCE)
-       mkdir -p $(TOOL_BUILD_DIR)
-       mkdir -p $(DL_DIR)
-       mkdir -p $(STAGING_DIR)/bin;
-       $(SED_CAT) $(DL_DIR)/$(SED_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf -
-       touch $(SED_DIR1)/.unpacked
-
-$(SED_DIR1)/.configured: $(SED_DIR1)/.unpacked
-       (cd $(SED_DIR1); rm -rf config.cache; \
-               ./configure \
-               --prefix=$(STAGING_DIR) \
-               --prefix=/usr \
-       );
-       touch  $(SED_DIR1)/.configured
-
-$(SED_DIR1)/$(SED_BINARY): $(SED_DIR1)/.configured
-       $(MAKE) -C $(SED_DIR1)
-
-# This stuff is needed to work around GNU make deficiencies
-build-sed-host-binary: $(SED_DIR1)/$(SED_BINARY)
-       @if [ -L $(STAGING_DIR)/$(SED_TARGET_BINARY) ] ; then \
-               rm -f $(STAGING_DIR)/$(SED_TARGET_BINARY); fi;
-       @if [ ! -f $(STAGING_DIR)/$(SED_TARGET_BINARY) -o $(STAGING_DIR)/$(SED_TARGET_BINARY) \
-       -ot $(SED_DIR1)/$(SED_BINARY) ] ; then \
-           set -x; \
-           mkdir -p $(STAGING_DIR)/bin; \
-           $(MAKE) DESTDIR=$(STAGING_DIR) -C $(SED_DIR1) install; \
-           mv $(STAGING_DIR)/usr/bin/sed $(STAGING_DIR)/bin/; \
-           rm -rf $(STAGING_DIR)/share/locale $(STAGING_DIR)/usr/info \
-                   $(STAGING_DIR)/usr/man $(STAGING_DIR)/usr/share/doc; fi
-
-use-sed-host-binary:
-       @if [ -x /usr/bin/sed ]; then SED="/usr/bin/sed"; else \
-           if [ -x /bin/sed ]; then SED="/bin/sed"; fi; fi; \
-           mkdir -p $(STAGING_DIR)/bin; \
-           rm -f $(STAGING_DIR)/$(SED_TARGET_BINARY); \
-           ln -s $$SED $(STAGING_DIR)/$(SED_TARGET_BINARY)
-
-host-sed: $(HOST_SED_TARGET)
-
-host-sed-clean:
-       $(MAKE) DESTDIR=$(STAGING_DIR) -C $(SED_DIR1) uninstall
-       -$(MAKE) -C $(SED_DIR1) clean
-
-host-sed-dirclean:
-       rm -rf $(SED_DIR1)
-
-
-#############################################################
-#
-# build sed for use on the target system
-#
-#############################################################
-$(SED_DIR2)/.unpacked: $(DL_DIR)/$(SED_SOURCE)
-       $(SED_CAT) $(DL_DIR)/$(SED_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(SED_DIR2)/.unpacked
-
-$(SED_DIR2)/.configured: $(SED_DIR2)/.unpacked
-       (cd $(SED_DIR2); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               CPPFLAGS="$(SED_CFLAGS)" \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-       );
-       touch  $(SED_DIR2)/.configured
-
-$(SED_DIR2)/$(SED_BINARY): $(SED_DIR2)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(SED_DIR2)
-
-# This stuff is needed to work around GNU make deficiencies
-sed-target_binary: $(SED_DIR2)/$(SED_BINARY)
-       @if [ -L $(TARGET_DIR)/$(SED_TARGET_BINARY) ] ; then \
-               rm -f $(TARGET_DIR)/$(SED_TARGET_BINARY); fi;
-
-       @if [ ! -f $(SED_DIR2)/$(SED_BINARY) -o $(TARGET_DIR)/$(SED_TARGET_BINARY) \
-       -ot $(SED_DIR2)/$(SED_BINARY) ] ; then \
-           set -x; \
-           $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(SED_DIR2) install; \
-           mv $(TARGET_DIR)/usr/bin/sed $(TARGET_DIR)/bin/; \
-           rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-                   $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc; fi
-
-sed: uclibc sed-target_binary
-
-sed-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(SED_DIR2) uninstall
-       -$(MAKE) -C $(SED_DIR2) clean
-
-sed-dirclean:
-       rm -rf $(SED_DIR2)
-
-
diff --git a/obsolete-buildroot/make/slang.mk b/obsolete-buildroot/make/slang.mk
deleted file mode 100644 (file)
index f7e2200..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#############################################################
-#
-# slang
-#
-#############################################################
-SLANG_SOURCE=slang-1.4.5-mini.tar.bz2
-SLANG_SITE:=http://www.uclibc.org/
-SLANG_DIR=$(BUILD_DIR)/slang-1.4.5-mini
-ifeq ($(strip $(BUILD_WITH_LARGEFILE)),true)
-SLANG_CFLAGS=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-endif
-SLANG_CFLAGS+=-fPIC
-
-$(DL_DIR)/$(SLANG_SOURCE):
-       $(WGET) -P $(DL_DIR) $(SLANG_SITE)/$(SLANG_SOURCE)
-
-$(SLANG_DIR): $(DL_DIR)/$(SLANG_SOURCE)
-       bzcat $(DL_DIR)/$(SLANG_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-
-$(SLANG_DIR)/libslang.so: $(SLANG_DIR)
-       $(MAKE) CFLAGS="-Os -g $(SLANG_CFLAGS)" CC=$(TARGET_CC) -C $(SLANG_DIR)
-       touch -c $(SLANG_DIR)/libslang.so;
-
-$(STAGING_DIR)/lib/libslang.so.1: $(SLANG_DIR)/libslang.so
-       cp -a $(SLANG_DIR)/libslang.a $(STAGING_DIR)/lib;
-       cp -a $(SLANG_DIR)/libslang.so $(STAGING_DIR)/lib;
-       cp -a $(SLANG_DIR)/slang.h $(STAGING_DIR)/include;
-       cp -a $(SLANG_DIR)/slcurses.h $(STAGING_DIR)/include;
-       (cd $(STAGING_DIR)/lib; ln -fs libslang.so libslang.so.1);
-       touch -c $(STAGING_DIR)/lib/libslang.so.1
-
-$(TARGET_DIR)/lib/libslang.so.1: $(STAGING_DIR)/lib/libslang.so.1
-       cp -a $(STAGING_DIR)/lib/libslang.so* $(TARGET_DIR)/lib;
-       -$(STRIP)  $(TARGET_DIR)/lib/libslang.so*
-       touch -c $(TARGET_DIR)/lib/libslang.so.1
-
-slang: uclibc $(STAGING_DIR)/lib/libslang.so.1 $(TARGET_DIR)/lib/libslang.so.1
-
-slang-source: $(DL_DIR)/$(SLANG_SOURCE)
-
-slang-clean:
-       rm -f $(TARGET_DIR)/lib/libslang.so*
-       -$(MAKE) -C $(SLANG_DIR) clean
-
-slang-dirclean:
-       rm -rf $(SLANG_DIR)
-
-
diff --git a/obsolete-buildroot/make/socat.mk b/obsolete-buildroot/make/socat.mk
deleted file mode 100644 (file)
index 010326d..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#############################################################
-#
-# socat
-#
-#############################################################
-
-SOCAT_VERSION=1.3.0.1
-
-# Don't alter below this line unless you (think) you know
-# what you are doing! Danger, Danger!
-
-SOCAT_SOURCE=socat-$(SOCAT_VERSION).tar.bz2
-SOCAT_SITE=http://www.dest-unreach.org/socat/download/
-#SOCAT_DIR=$(BUILD_DIR)/${shell basename $(SOCAT_SOURCE) .tar.bz2}
-SOCAT_DIR=$(BUILD_DIR)/socat-1.3
-#SOCAT_WORKDIR=$(BUILD_DIR)/socat_workdir
-SOCAT_WORKDIR=$(SOCAT_DIR)
-
-$(DL_DIR)/$(SOCAT_SOURCE):
-       $(WGET) -P $(DL_DIR) $(SOCAT_SITE)/$(SOCAT_SOURCE)
-
-$(SOCAT_DIR)/.unpacked:        $(DL_DIR)/$(SOCAT_SOURCE)
-       bzip2 -d -c $(DL_DIR)/$(SOCAT_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(SOCAT_DIR)/.unpacked
-
-$(SOCAT_WORKDIR)/Makefile: $(SOCAT_DIR)/.unpacked
-       rm -f $(SOCAT_WORKDIR)/Makefile
-       mkdir -p $(SOCAT_WORKDIR)
-       (cd $(SOCAT_WORKDIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               $(SOCAT_DIR)/configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-       );
-        
-$(SOCAT_WORKDIR)/socat:        $(SOCAT_WORKDIR)/Makefile
-       rm -f $@
-       $(MAKE) -C $(SOCAT_WORKDIR)
-
-$(SOCAT_WORKDIR)/.installed: $(SOCAT_WORKDIR)/socat
-       mkdir -p $(TARGET_DIR)/usr/man/man1
-       $(MAKE) -C $(SOCAT_WORKDIR) install prefix=$(TARGET_DIR)/usr
-
-socat: uclibc $(SOCAT_WORKDIR)/.installed
-
-socat-source: $(DL_DIR)/$(SOCAT_SOURCE)
-
-socat-clean:
-       @if [ -d $(SOCAT_WORKDIR)/Makefile ] ; then \
-               $(MAKE) -C $(SOCAT_WORKDIR) clean ; \
-       fi;
-
-socat-dirclean:
-       rm -rf $(SOCAT_DIR) $(SOCAT_WORKDIR)
-
diff --git a/obsolete-buildroot/make/squashfsroot.mk b/obsolete-buildroot/make/squashfsroot.mk
deleted file mode 100644 (file)
index f1d6c04..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#############################################################
-#
-# mksquashfs to build to target squashfs filesystems
-#
-#############################################################
-SQUASHFS_DIR=$(BUILD_DIR)/squashfs2.0r2
-SQUASHFS_SOURCE=squashfs2.0-r2.tar.gz
-SQUASHFS_SITE=http://dl.sourceforge.net/sourceforge/squashfs
-
-$(DL_DIR)/$(SQUASHFS_SOURCE):
-        $(WGET) -P $(DL_DIR) $(SQUASHFS_SITE)/$(SQUASHFS_SOURCE)
-
-$(SQUASHFS_DIR)/.unpacked: $(DL_DIR)/$(SQUASHFS_SOURCE) #$(SQUASHFS_PATCH)
-       zcat $(DL_DIR)/$(SQUASHFS_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       $(SOURCE_DIR)/patch-kernel.sh $(SQUASHFS_DIR) $(SOURCE_DIR) squashfs.patch
-       touch $(SQUASHFS_DIR)/.unpacked
-
-$(SQUASHFS_DIR)/squashfs-tools/mksquashfs: $(SQUASHFS_DIR)/.unpacked
-       $(MAKE) -C $(SQUASHFS_DIR)/squashfs-tools;
-
-squashfs: $(SQUASHFS_DIR)/squashfs-tools/mksquashfs
-
-squashfs-source: $(DL_DIR)/$(SQUASHFS_SOURCE)
-
-squashfs-clean:
-       -$(MAKE) -C $(SQUASHFS_DIR)/squashfs-tools clean
-
-squashfs-dirclean:
-       rm -rf $(SQUASHFS_DIR)
-
-#############################################################
-#
-# Build the squashfs root filesystem image
-#
-#############################################################
-
-squashfsroot: squashfs
-       #-@find $(TARGET_DIR)/lib -type f -name \*.so\* | xargs $(STRIP)  2>/dev/null || true;
-       #-@find $(TARGET_DIR) -type f -perm +111 | xargs $(STAGING_DIR)/bin/sstrip 2>/dev/null || true;
-       @rm -rf $(TARGET_DIR)/usr/man
-       @rm -rf $(TARGET_DIR)/usr/info
-       #$(SQUASHFS_DIR)/squashfs-tools/mksquashfs -q -D $(SOURCE_DIR)/device_table.txt $(TARGET_DIR) $(IMAGE)
-       $(SQUASHFS_DIR)/squashfs-tools/mksquashfs $(TARGET_DIR) $(IMAGE) -noappend -root-owned -le
-
-squashfsroot-source: squashfs-source
-
-squashfsroot-clean:
-       -$(MAKE) -C $(SQUASHFS_DIR) clean
-
-squashfsroot-dirclean:
-       rm -rf $(SQUASHFS_DIR)
-
diff --git a/obsolete-buildroot/make/strace.mk b/obsolete-buildroot/make/strace.mk
deleted file mode 100644 (file)
index 8de2935..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#############################################################
-#
-# strace
-#
-#############################################################
-STRACE_SOURCE:=strace-4.5.6.tar.bz2
-STRACE_SITE:=http://aleron.dl.sourceforge.net/sourceforge/strace
-STRACE_CAT:=bzcat
-STRACE_DIR:=$(BUILD_DIR)/strace-4.5.6
-STRACE_IPK=$(BUILD_DIR)/strace_4.5.6-1_mipsel.ipk
-STRACE_IPK_DIR:=$(BUILD_DIR)/strace-4.5.6-ipk
-
-
-$(DL_DIR)/$(STRACE_SOURCE):
-        $(WGET) -P $(DL_DIR) $(STRACE_SITE)/$(STRACE_SOURCE)
-
-strace-source: $(DL_DIR)/$(STRACE_SOURCE)
-
-$(STRACE_DIR)/.unpacked: $(DL_DIR)/$(STRACE_SOURCE)
-       $(STRACE_CAT) $(DL_DIR)/$(STRACE_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(STRACE_DIR)/.unpacked
-
-$(STRACE_DIR)/.configured: $(STRACE_DIR)/.unpacked
-       (cd $(STRACE_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-               $(DISABLE_LARGEFILE) \
-       );
-       touch  $(STRACE_DIR)/.configured
-
-$(STRACE_DIR)/strace: $(STRACE_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(STRACE_DIR)
-
-$(TARGET_DIR)/usr/bin/strace: $(STRACE_DIR)/strace
-       install -c $(STRACE_DIR)/strace $(TARGET_DIR)/usr/bin/strace
-       $(STRIP) $(TARGET_DIR)/usr/bin/strace > /dev/null 2>&1
-
-strace: uclibc $(TARGET_DIR)/usr/bin/strace 
-
-strace-ipk: $(STRACE_DIR)/strace
-       mkdir -p $(STRACE_IPK_DIR)/CONTROL
-       mkdir -p $(STRACE_IPK_DIR)/usr/bin
-       install -m 644 $(OPENWRT_IPK_DIR)/strace/CONTROL/control $(STRACE_IPK_DIR)/CONTROL/control
-       install -m 755 $(STRACE_DIR)/strace $(STRACE_IPK_DIR)/usr/bin/
-       $(STRIP) $(STRACE_IPK_DIR)/usr/bin/strace 
-       cd $(BUILD_DIR); $(STAGING_DIR)/bin/ipkg-build -c -o root -g root $(STRACE_IPK_DIR)
-
-strace-clean: 
-       $(MAKE) -C $(STRACE_DIR) clean
-
-strace-dirclean: 
-       rm -rf $(STRACE_DIR) $(STRACE_IPK_DIR)
diff --git a/obsolete-buildroot/make/system-linux.mk b/obsolete-buildroot/make/system-linux.mk
deleted file mode 100644 (file)
index 2f55dd5..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#############################################################
-#
-# System Linux kernel target
-#
-# This uses an existing linux kernel source tree on
-# your build system, and makes no effort at compiling
-# anything....
-#
-# You will probably want to change LINUX_SOURCE to
-# point to wherever you installed you kernel.
-#
-#  -Erik
-#
-#############################################################
-ifneq ($(filter $(TARGETS),system-linux),)
-
-LINUX_SOURCE=/usr/src/linux
-LINUX_DIR=$(BUILD_DIR)/linux
-LINUX_KERNEL=$(BUILD_DIR)/buildroot-kernel
-# Used by pcmcia-cs and others
-LINUX_SOURCE_DIR=$(LINUX_SOURCE)
-
-$(LINUX_DIR)/.configured:
-       mkdir -p $(LINUX_DIR)/include
-       (cd $(LINUX_DIR)/include; \
-       for i in $(LINUX_SOURCE)/include/*; do ln -sf $$i ; done; \
-       rm -f asm; \
-       if [ "$(ARCH)" = "powerpc" ];then \
-           ln -fs asm-ppc asm; \
-       elif [ "$(ARCH)" = "mips" ];then \
-           ln -fs asm-mips asm; \
-       elif [ "$(ARCH)" = "mipsel" ];then \
-           ln -fs asm-mips asm; \
-       elif [ "$(ARCH)" = "arm" ];then \
-           ln -fs asm-arm asm; \
-           (cd asm-arm; \
-           if [ ! -L proc ] ; then \
-           ln -fs proc-armv proc; \
-           ln -fs arch-ebsa285 arch; fi); \
-       elif [ "$(ARCH)" = "cris" ];then \
-           ln -fs asm-cris asm; \
-       else ln -fs asm-$(ARCH) asm; \
-       fi)
-       cp $(LINUX_SOURCE)/Makefile $(LINUX_DIR)/
-       cp $(LINUX_SOURCE)/Rules.make $(LINUX_DIR)/
-       touch $(LINUX_DIR)/.configured
-
-$(LINUX_KERNEL): $(LINUX_DIR)/.configured
-
-system-linux: $(LINUX_DIR)/.configured
-
-system-linux-clean: clean
-       rm -f $(LINUX_KERNEL)
-       rm -rf $(LINUX_DIR)
-
-system-linux-dirclean:
-       rm -rf $(LINUX_DIR)
-
-endif
diff --git a/obsolete-buildroot/make/tar.mk b/obsolete-buildroot/make/tar.mk
deleted file mode 100644 (file)
index 01e9187..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#############################################################
-#
-# tar
-#
-#############################################################
-GNUTAR_SOURCE:=tar-1.13.25.tar.gz
-GNUTAR_SITE:=ftp://alpha.gnu.org/gnu/tar
-GNUTAR_DIR:=$(BUILD_DIR)/tar-1.13.25
-GNUTAR_CAT:=zcat
-GNUTAR_BINARY:=src/tar
-GNUTAR_TARGET_BINARY:=bin/tar
-
-$(DL_DIR)/$(GNUTAR_SOURCE):
-        $(WGET) -P $(DL_DIR) $(GNUTAR_SITE)/$(GNUTAR_SOURCE)
-
-tar-source: $(DL_DIR)/$(GNUTAR_SOURCE)
-
-$(GNUTAR_DIR)/.unpacked: $(DL_DIR)/$(GNUTAR_SOURCE)
-       $(GNUTAR_CAT) $(DL_DIR)/$(GNUTAR_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(GNUTAR_DIR)/.unpacked
-
-$(GNUTAR_DIR)/.configured: $(GNUTAR_DIR)/.unpacked
-       (cd $(GNUTAR_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-               $(DISABLE_LARGEFILE) \
-       );
-       touch  $(GNUTAR_DIR)/.configured
-
-$(GNUTAR_DIR)/$(GNUTAR_BINARY): $(GNUTAR_DIR)/.configured
-       $(MAKE) -C $(GNUTAR_DIR)
-
-# This stuff is needed to work around GNU make deficiencies
-tar-target_binary: $(GNUTAR_DIR)/$(GNUTAR_BINARY)
-       @if [ -L $(TARGET_DIR)/$(GNUTAR_TARGET_BINARY) ] ; then \
-               rm -f $(TARGET_DIR)/$(GNUTAR_TARGET_BINARY); fi;
-       @if [ ! -f $(GNUTAR_DIR)/$(GNUTAR_BINARY) -o $(TARGET_DIR)/$(GNUTAR_TARGET_BINARY) \
-       -ot $(GNUTAR_DIR)/$(GNUTAR_BINARY) ] ; then \
-           set -x; \
-           rm -f $(TARGET_DIR)/$(GNUTAR_TARGET_BINARY); \
-           cp -a $(GNUTAR_DIR)/$(GNUTAR_BINARY) $(TARGET_DIR)/$(GNUTAR_TARGET_BINARY); fi ;
-
-tar: uclibc tar-target_binary
-
-tar-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) -C $(GNUTAR_DIR) uninstall
-       -$(MAKE) -C $(GNUTAR_DIR) clean
-
-tar-dirclean:
-       rm -rf $(GNUTAR_DIR)
-
diff --git a/obsolete-buildroot/make/tcpdump.mk b/obsolete-buildroot/make/tcpdump.mk
deleted file mode 100644 (file)
index f8d29e2..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-## tcpdump
-
-TCPDUMP_VERSION:=3.8.3
-TCPDUMP_RELEASE:=1
-
-TCPDUMP_SOURCE:=tcpdump-$(TCPDUMP_VERSION).tar.gz
-TCPDUMP_SITE:=http://www.tcpdump.org/release/
-TCPDUMP_DIR:=$(BUILD_DIR)/tcpdump-$(TCPDUMP_VERSION)
-TCPDUMP_CAT:=zcat
-
-TCPDUMP_PATCH_DIR := $(SOURCE_DIR)/openwrt/patches/tcpdump
-
-TCPDUMP_BUILD_DIR := $(BUILD_DIR)/tcpdump_$(TCPDUMP_VERSION)-$(TCPDUMP_RELEASE)
-TCPDUMP_IPK_DIR := $(OPENWRT_IPK_DIR)/tcpdump
-TCPDUMP_IPK := $(TCPDUMP_BUILD_DIR)_$(ARCH).ipk
-
-
-$(DL_DIR)/$(TCPDUMP_SOURCE):
-        $(WGET) -P $(DL_DIR) $(TCPDUMP_SITE)/$(TCPDUMP_SOURCE)
-
-
-$(TCPDUMP_DIR)/.stamp-unpacked: $(DL_DIR)/$(TCPDUMP_SOURCE)
-       $(TCPDUMP_CAT) $(DL_DIR)/$(TCPDUMP_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-
-       touch $(TCPDUMP_DIR)/.stamp-unpacked
-
-
-$(TCPDUMP_DIR)/.stamp-patched: $(TCPDUMP_DIR)/.stamp-unpacked
-       $(SOURCE_DIR)/patch-kernel.sh $(TCPDUMP_DIR) $(TCPDUMP_PATCH_DIR)
-       $(SOURCE_DIR)/patch-kernel.sh $(TCPDUMP_DIR) $(TCPDUMP_DIR)/debian/patches *patch
-
-       touch $(TCPDUMP_DIR)/.stamp-patched
-
-
-$(TCPDUMP_DIR)/.stamp-configured: $(TCPDUMP_DIR)/.stamp-patched
-       cd $(TCPDUMP_DIR) ; \
-       rm -rf config.cache ; \
-       $(TARGET_CONFIGURE_OPTS) \
-       CFLAGS="$(TARGET_CFLAGS)" \
-       ac_cv_linux_vers="2" \
-       ./configure \
-         --target=$(GNU_TARGET_NAME) \
-         --host=$(GNU_TARGET_NAME) \
-         --build=$(GNU_HOST_NAME) \
-         --prefix=/usr \
-         --exec-prefix=/usr \
-         --bindir=/usr/bin \
-         --sbindir=/usr/sbin \
-         --libexecdir=/usr/lib/locate \
-         --sysconfdir=/etc \
-         --datadir=/usr/share \
-         --localstatedir=/var/lib \
-         --mandir=/usr/share/man \
-         --infodir=/usr/share/info \
-         --includedir=/usr/include \
-         --libdir=/usr/lib \
-         $(DISABLE_NLS) \
-         --enable-shared \
-         --disable-static \
-
-       touch $(TCPDUMP_DIR)/.stamp-configured
-
-
-$(TCPDUMP_DIR)/.stamp-built: $(TCPDUMP_DIR)/.stamp-configured
-       cd $(TCPDUMP_DIR) ; \
-       $(MAKE) \
-         CC=$(TARGET_CC) \
-         CCOPT="$(TARGET_OPTIMIZATION)" \
-         INCLS="-I. -I$(srcdir)/missing" \
-         LDFLAGS="-lpcap" \
-         LIBS="" \
-
-       touch $(TCPDUMP_DIR)/.stamp-built
-
-
-$(TCPDUMP_DIR)/.stamp-installed: $(TCPDUMP_DIR)/.stamp-built
-       mkdir -p $(TCPDUMP_BUILD_DIR)
-       cd $(TCPDUMP_DIR) ; \
-       $(MAKE) \
-         DESTDIR="$(TCPDUMP_BUILD_DIR)" \
-        install \
-        
-       rm -rf $(TCPDUMP_BUILD_DIR)/usr/share
-
-       $(STRIP) $(TCPDUMP_BUILD_DIR)/usr/sbin/*
-       
-       touch $(TCPDUMP_DIR)/.stamp-installed
-
-
-$(TCPDUMP_IPK): $(TCPDUMP_DIR)/.stamp-installed
-       cp -a $(TCPDUMP_IPK_DIR)/CONTROL $(TCPDUMP_BUILD_DIR)/
-       perl -pi -e "s/^Vers.*:.*$$/Version: $(TCPDUMP_VERSION)-$(TCPDUMP_RELEASE)/" $(TCPDUMP_BUILD_DIR)/CONTROL/control
-       perl -pi -e "s/^Arch.*:.*$$/Architecture: $(ARCH)/" $(TCPDUMP_BUILD_DIR)/CONTROL/control
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(TCPDUMP_BUILD_DIR)
-
-
-tcpdump-source: $(DL_DIR)/$(TCPDUMP_SOURCE)
-
-# libpcap-clean prevent configure to find a local libpcap library
-tcpdump-ipk: ipkg-utils libpcap-ipk libpcap-clean $(TCPDUMP_IPK)
-
-tcpdump-clean:
-       $(MAKE) -C $(TCPDUMP_DIR) clean
-
-tcpdump-clean-all:
-       rm -rf $(TCPDUMP_DIR)
-       rm -rf $(TCPDUMP_BUILD_DIR)
-       rm -rf $(TCPDUMP_IPK)
diff --git a/obsolete-buildroot/make/tinylogin.mk b/obsolete-buildroot/make/tinylogin.mk
deleted file mode 100644 (file)
index 549de76..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#############################################################
-#
-# tinylogin
-#
-#############################################################
-# Enable this to use the tinylogin daily snapshot
-USE_TINYLOGIN_SNAPSHOT=true
-
-ifeq ($(USE_TINYLOGIN_SNAPSHOT),true)
-# Be aware that this changes daily....
-TINYLOGIN_DIR:=$(BUILD_DIR)/tinylogin
-TINYLOGIN_SOURCE:=tinylogin-snapshot.tar.bz2
-TINYLOGIN_SITE:=http://tinylogin.busybox.net/downloads/snapshots
-else
-TINYLOGIN_DIR:=$(BUILD_DIR)/tinylogin-1.4
-TINYLOGIN_SOURCE:=tinylogin-1.4.tar.bz2
-TINYLOGIN_SITE:=http://tinylogin.busybox.net/downloads
-endif
-
-$(DL_DIR)/$(TINYLOGIN_SOURCE):
-       $(WGET) -P $(DL_DIR) $(TINYLOGIN_SITE)/$(TINYLOGIN_SOURCE)
-
-tinylogin-source: $(DL_DIR)/$(TINYLOGIN_SOURCE)
-
-$(TINYLOGIN_DIR)/Config.h: $(DL_DIR)/$(TINYLOGIN_SOURCE)
-       bzcat $(DL_DIR)/$(TINYLOGIN_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       $(SED) "s/\`id -u\` -ne 0/0 == 1/" \
-               $(TINYLOGIN_DIR)/install.sh
-       $(SED) "s/4755 --owner=root --group=root/755/" \
-               $(TINYLOGIN_DIR)/install.sh
-       $(SED) "s/^DOSTATIC.*/DOSTATIC=false/g;" $(TINYLOGIN_DIR)/Makefile
-       $(SED) "s/^DODEBUG.*/DODEBUG=false/g;" $(TINYLOGIN_DIR)/Makefile
-       # date test this one
-       touch $(TINYLOGIN_DIR)/Config.h
-
-$(TINYLOGIN_DIR)/tinylogin: $(TINYLOGIN_DIR)/Config.h
-       $(MAKE) CC=$(TARGET_CC) CROSS="$(TARGET_CROSS)" \
-               CFLAGS_EXTRA="$(TARGET_CFLAGS)" -C $(TINYLOGIN_DIR)
-
-$(TARGET_DIR)/bin/tinylogin: $(TINYLOGIN_DIR)/tinylogin
-       $(MAKE) CC=$(TARGET_CC) CROSS="$(TARGET_CROSS)" \
-               PREFIX="$(TARGET_DIR)" -C $(TINYLOGIN_DIR) \
-               CFLAGS_EXTRA="$(TARGET_CFLAGS)" install
-
-tinylogin: uclibc $(TARGET_DIR)/bin/tinylogin
-
-tinylogin-clean:
-       rm -f $(TARGET_DIR)/bin/tinylogin
-       -$(MAKE) -C $(TINYLOGIN_DIR) clean
-
-tinylogin-dirclean:
-       rm -rf $(TINYLOGIN_DIR)
diff --git a/obsolete-buildroot/make/tn5250.mk b/obsolete-buildroot/make/tn5250.mk
deleted file mode 100644 (file)
index 6fcc160..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-TN5250_SITE:=http://aleron.dl.sourceforge.net/sourceforge/tn5250
-TN5250_DIR:=$(BUILD_DIR)/tn5250-0.16.4
-TN5250_SOURCE:=tn5250-0.16.4.tar.gz
-
-$(DL_DIR)/$(TN5250_SOURCE):
-       $(WGET) -P $(DL_DIR) $(TN5250_SITE)/$(TN5250_SOURCE) 
-
-$(TN5250_DIR)/.dist: $(DL_DIR)/$(TN5250_SOURCE)
-       gunzip -c $(DL_DIR)/$(TN5250_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       -touch $(TN5250_DIR)/.dist
-
-$(TN5250_DIR)/.configured: $(TN5250_DIR)/.dist
-       (cd $(TN5250_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-               --with-slang --without-x --without-ssl \
-       );
-       touch  $(TN5250_DIR)/.configured
-
-$(TN5250_DIR)/tn5250: $(TN5250_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) -C $(TN5250_DIR)
-
-$(TARGET_DIR)/usr/bin/tn5250: $(TN5250_DIR)/tn5250
-       install -c $(TN5250_DIR)/tn5250 $(TARGET_DIR)/usr/bin/tn5250
-
-tn5250: uclibc slang $(TARGET_DIR)/usr/bin/tn5250
-
-tn5250-source: $(DL_DIR)/$(TN5250_SOURCE)
-
-tn5250-clean: 
-       $(MAKE) -C $(TN5250_DIR) clean
-
-tn5250-dirclean: 
-       rm -rf $(TN5250_DIR) 
-
-
-
diff --git a/obsolete-buildroot/make/ttcp.mk b/obsolete-buildroot/make/ttcp.mk
deleted file mode 100644 (file)
index 7ff5f63..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#############################################################
-#
-# ttcp
-#
-#############################################################
-#
-TTCP_SOURCE_URL=http://ftp.sunet.se/ftp/pub/network/monitoring/ttcp
-TTCP_SOURCE=ttcp.c
-TTCP_BUILD_DIR=$(BUILD_DIR)/ttcp
-
-$(DL_DIR)/$(TTCP_SOURCE):
-        $(WGET) -P $(DL_DIR) $(TTCP_SOURCE_URL)/$(TTCP_SOURCE) 
-
-$(TTCP_BUILD_DIR)/.unpacked: $(DL_DIR)/$(TTCP_SOURCE)
-       -mkdir $(TTCP_BUILD_DIR)
-       cp -af $(DL_DIR)/$(TTCP_SOURCE) $(TTCP_BUILD_DIR)
-       touch $(TTCP_BUILD_DIR)/.unpacked
-
-$(TTCP_BUILD_DIR)/.configured: $(TTCP_BUILD_DIR)/.unpacked
-       touch  $(TTCP_BUILD_DIR)/.configured
-
-$(TTCP_BUILD_DIR)/ttcp: $(TTCP_BUILD_DIR)/.configured
-       $(TARGET_CC) -O2 -o $(TTCP_BUILD_DIR)/ttcp $(TTCP_BUILD_DIR)/$(TTCP_SOURCE) 
-
-$(TARGET_DIR)/usr/bin/ttcp: $(TTCP_BUILD_DIR)/ttcp
-       cp -af $(TTCP_BUILD_DIR)/ttcp $(TARGET_DIR)/usr/bin/
-
-ttcp: $(TARGET_DIR)/usr/bin/ttcp 
-
-ttcp-source: $(DL_DIR)/$(TTCP_SOURCE)
-
-ttcp-clean:
-       rm -f $(TTCP_BUILD_DIR)/*.o $(TTCP_BUILD_DIR)/ttcp      
-
-ttcp-dirclean:
-       rm -rf $(TTCP_BUILD_DIR)
-
diff --git a/obsolete-buildroot/make/uclibc.mk b/obsolete-buildroot/make/uclibc.mk
deleted file mode 100644 (file)
index d234084..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-#############################################################
-#
-# uClibc (the C library)
-#
-#############################################################
-ifneq ($(strip $(USE_UCLIBC_SNAPSHOT)),)
-# Be aware that this changes daily....
-UCLIBC_DIR:=$(BUILD_DIR)/uClibc
-UCLIBC_SOURCE:=uClibc-$(strip $(USE_UCLIBC_SNAPSHOT)).tar.bz2
-UCLIBC_SITE:=http://www.uclibc.org/downloads/snapshots
-else
-UCLIBC_DIR:=$(BUILD_DIR)/uClibc-0.9.27
-UCLIBC_SOURCE:=uClibc-0.9.27.tar.bz2
-UCLIBC_SITE:=http://www.uclibc.org/downloads
-endif
-
-UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \
-                -e 's/i.86/i386/' \
-               -e 's/sparc.*/sparc/' \
-               -e 's/arm.*/arm/g' \
-               -e 's/m68k.*/m68k/' \
-               -e 's/ppc/powerpc/g' \
-               -e 's/v850.*/v850/g' \
-               -e 's/sh64/sh/' \
-               -e 's/sh[234]/sh/' \
-               -e 's/mips.*/mips/' \
-               -e 's/mipsel.*/mips/' \
-               -e 's/cris.*/cris/' \
-)
-
-
-$(DL_DIR)/$(UCLIBC_SOURCE):
-       $(WGET) -P $(DL_DIR) $(UCLIBC_SITE)/$(UCLIBC_SOURCE)
-
-$(UCLIBC_DIR)/.unpacked: $(DL_DIR)/$(UCLIBC_SOURCE)
-ifeq ($(SOFT_FLOAT),true)
-       # Make sure we have a soft float specs file for this arch
-       if [ ! -f $(SOURCE_DIR)/specs-$(ARCH)-soft-float ] ; then \
-               echo soft float configured but no specs file for this arch ; \
-               /bin/false ; \
-       fi;
-endif
-       bzcat $(DL_DIR)/$(UCLIBC_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       #(cd $(BUILD_DIR) ; ln -s $(DL_DIR)/uClibc)
-       #-mkdir $(UCLIBC_DIR)
-       #(cd $(DL_DIR)/uClibc && tar cf - .) | (cd $(UCLIBC_DIR) && tar xvfp - )
-ifeq ($(strip $(USE_UCLIBC_LDSO_0_9_24)),true)
-       $(SOURCE_DIR)/patch-kernel.sh $(UCLIBC_DIR) $(SOURCE_DIR) uClibc-ldso-0.9.24.patch
-endif
-       touch $(UCLIBC_DIR)/.unpacked
-
-$(UCLIBC_DIR)/.configured: $(UCLIBC_DIR)/.unpacked $(LINUX_DIR)/.configured
-       $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(UCLIBC_DIR)/Rules.mak
-ifeq ($(ENABLE_LOCALE),true)
-       cp $(SOURCE_DIR)/uClibc.config-locale $(UCLIBC_DIR)/.config
-else
-       cp $(SOURCE_DIR)/uClibc.config $(UCLIBC_DIR)/.config
-endif
-       $(SED) 's,^.*TARGET_$(UCLIBC_TARGET_ARCH).*,TARGET_$(UCLIBC_TARGET_ARCH)=y,g' \
-               $(UCLIBC_DIR)/.config
-       $(SED) 's,^TARGET_ARCH.*,TARGET_ARCH=\"$(UCLIBC_TARGET_ARCH)\",g' $(UCLIBC_DIR)/.config
-       $(SED) 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE=\"$(LINUX_DIR)\",g' \
-               $(UCLIBC_DIR)/.config
-       $(SED) 's,^RUNTIME_PREFIX=.*,RUNTIME_PREFIX=\"/\",g' \
-               $(UCLIBC_DIR)/.config
-       $(SED) 's,^DEVEL_PREFIX=.*,DEVEL_PREFIX=\"/usr/\",g' \
-               $(UCLIBC_DIR)/.config
-       $(SED) 's,^SHARED_LIB_LOADER_PREFIX=.*,SHARED_LIB_LOADER_PREFIX=\"/lib\",g' \
-               $(UCLIBC_DIR)/.config
-ifeq ($(strip $(BUILD_WITH_LARGEFILE)),true)
-       $(SED) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=y,g' $(UCLIBC_DIR)/.config
-else
-       $(SED) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=n,g' $(UCLIBC_DIR)/.config
-endif
-       $(SED) 's,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g' $(UCLIBC_DIR)/.config
-ifeq ($(strip $(SOFT_FLOAT)),true)
-       $(SED) 's,.*HAS_FPU.*,HAS_FPU=n\nUCLIBC_HAS_FLOATS=y\nUCLIBC_HAS_SOFT_FLOAT=y,g' $(UCLIBC_DIR)/.config
-endif
-       mkdir -p $(TOOL_BUILD_DIR)/uClibc_dev/usr/include
-       mkdir -p $(TOOL_BUILD_DIR)/uClibc_dev/usr/lib
-       mkdir -p $(TOOL_BUILD_DIR)/uClibc_dev/lib
-       $(MAKE) -C $(UCLIBC_DIR) \
-               PREFIX=$(TOOL_BUILD_DIR)/uClibc_dev/ \
-               DEVEL_PREFIX=/usr/ \
-               RUNTIME_PREFIX=$(TOOL_BUILD_DIR)/uClibc_dev/ \
-               HOSTCC="$(HOSTCC)" \
-               pregen install_dev;
-       touch $(UCLIBC_DIR)/.configured
-
-$(UCLIBC_DIR)/lib/libc.a: $(UCLIBC_DIR)/.configured $(LIBFLOAT_TARGET)
-       $(MAKE) -C $(UCLIBC_DIR) \
-               PREFIX= \
-               DEVEL_PREFIX=$(REAL_GNU_TARGET_NAME)/ \
-               RUNTIME_PREFIX=/ \
-               HOSTCC="$(HOSTCC)" \
-               all
-ifeq ($(strip $(USE_UCLIBC_LDSO_0_9_24)),true)
-       #rm -rf $(UCLIBC_DIR)/ld-uClibc* $(UCLIBC_DIR)/libdl*
-       $(MAKE) -C $(UCLIBC_DIR)/ldso-0.9.24 \
-               PREFIX= \
-               DEVEL_PREFIX=$(REAL_GNU_TARGET_NAME)/ \
-               RUNTIME_PREFIX=/ \
-               HOSTCC="$(HOSTCC)" \
-               all shared
-endif
-
-$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libc.a: $(UCLIBC_DIR)/lib/libc.a
-       $(MAKE) -C $(UCLIBC_DIR) \
-               PREFIX=$(STAGING_DIR)/ \
-               DEVEL_PREFIX=$(REAL_GNU_TARGET_NAME)/ \
-               RUNTIME_PREFIX=$(REAL_GNU_TARGET_NAME)/ \
-               install_runtime
-       $(MAKE) -C $(UCLIBC_DIR) \
-               PREFIX=$(STAGING_DIR)/ \
-               DEVEL_PREFIX=$(REAL_GNU_TARGET_NAME)/ \
-               RUNTIME_PREFIX=$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/ \
-               install_dev
-       $(MAKE) -C $(UCLIBC_DIR) \
-               PREFIX=$(STAGING_DIR) \
-               HOSTCC="$(HOSTCC)" \
-               utils install_utils
-       # Clean up the host compiled utils...
-       $(MAKE) -C $(UCLIBC_DIR)/utils clean
-
-ifneq ($(TARGET_DIR),)
-$(TARGET_DIR)/lib/libc.so.0: $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libc.a
-       $(MAKE) -C $(UCLIBC_DIR) \
-               PREFIX=$(TARGET_DIR) \
-               DEVEL_PREFIX=/usr/ \
-               RUNTIME_PREFIX=/ \
-               install_runtime
-
-$(TARGET_DIR)/usr/bin/ldd: $(TARGET_DIR)/lib/libc.so.0
-       $(MAKE) -C $(UCLIBC_DIR) $(TARGET_CONFIGURE_OPTS) \
-               PREFIX=$(TARGET_DIR) utils install_utils
-
-UCLIBC_TARGETS=$(TARGET_DIR)/lib/libc.so.0 $(TARGET_DIR)/usr/bin/ldd
-endif
-
-uclibc-configured: $(UCLIBC_DIR)/.configured
-
-uclibc: $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libc.a \
-       $(UCLIBC_TARGETS)
-
-uclibc-source: $(DL_DIR)/$(UCLIBC_SOURCE)
-
-uclibc-configured-source: uclibc-source
-
-uclibc-clean:
-       -$(MAKE) -C $(UCLIBC_DIR) clean
-       rm -f $(UCLIBC_DIR)/.config
-
-uclibc-dirclean:
-       rm -rf $(UCLIBC_DIR)
-
-
-
-
-#############################################################
-#
-# uClibc for the target just needs its header files
-# and whatnot installed.
-#
-#############################################################
-
-$(TARGET_DIR)/usr/lib/libc.a: $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libc.a
-       $(MAKE) -C $(UCLIBC_DIR) \
-               PREFIX=$(TARGET_DIR) \
-               DEVEL_PREFIX=/usr/ \
-               RUNTIME_PREFIX=/ \
-               install_dev
-
-ifeq ($(GCC_2_95_TOOLCHAIN),true)
-uclibc_target: gcc2_95 uclibc $(TARGET_DIR)/usr/lib/libc.a
-else
-uclibc_target: gcc3_3 uclibc $(TARGET_DIR)/usr/lib/libc.a
-endif
-
-uclibc_target-clean:
-       rm -f $(TARGET_DIR)/include
-
-uclibc_target-dirclean:
-       rm -f $(TARGET_DIR)/include
-
diff --git a/obsolete-buildroot/make/udhcp.mk b/obsolete-buildroot/make/udhcp.mk
deleted file mode 100644 (file)
index 46cb203..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#############################################################
-#
-# uchdp DHCP client and/or server
-#
-#############################################################
-# Copyright (C) 2001-2003 by Erik Andersen <andersen@codepoet.org>
-# Copyright (C) 2002 by Tim Riker <Tim@Rikers.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Library General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-
-UDHCP_SOURCE:=udhcp-0.9.8.tar.gz
-UDHCP_SITE:=http://udhcp.busybox.net/downloads/
-UDHCP_DIR:=$(BUILD_DIR)/udhcp-0.9.8
-
-$(DL_DIR)/$(UDHCP_SOURCE):
-       $(WGET) -P $(DL_DIR) $(UDHCP_SITE)/$(UDHCP_SOURCE)
-
-udhcp-source: $(DL_DIR)/$(UDHCP_SOURCE)
-
-$(UDHCP_DIR)/.unpacked: $(DL_DIR)/$(UDHCP_SOURCE)
-       zcat $(DL_DIR)/$(UDHCP_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(UDHCP_DIR)/.unpacked
-
-#$(UDHCP_DIR)/.unpacked: 
-#      (cd $(BUILD_DIR); \
-#      CVS_PASSFILE=$(CVS_PASSFILE) \
-#      cvs -z3 -d:pserver:anonymous@busybox.net:/var/cvs co udhcp )
-#      touch $(UDHCP_DIR)/.unpacked
-
-$(UDHCP_DIR)/udhcpc: $(UDHCP_DIR)/.unpacked
-       $(MAKE) CROSS_COMPILE="$(TARGET_CROSS)" prefix="$(TARGET_DIR)" -C $(UDHCP_DIR)
-
-$(TARGET_DIR)/sbin/udhcpc: $(UDHCP_DIR)/udhcpc
-       $(SED) 's/pump/udhcpc/' $(TARGET_DIR)/etc/pcmcia/network*
-       $(SED) 's/PUMP/UDHCPC/' $(TARGET_DIR)/etc/pcmcia/network*
-       $(SED) 's/DHCP="n"/DHCP="y"/' $(TARGET_DIR)/etc/pcmcia/network*
-       mkdir -p $(TARGET_DIR)/sbin
-       rm -f $(TARGET_DIR)/sbin/udhcpc
-       cp $(UDHCP_DIR)/udhcpc $(TARGET_DIR)/sbin/
-       mkdir -p $(TARGET_DIR)/usr/share/udhcpc
-       cp $(UDHCP_DIR)/samples/simple.script $(TARGET_DIR)/usr/share/udhcpc/default.script
-       chmod a+x $(TARGET_DIR)/sbin/udhcpc $(TARGET_DIR)/usr/share/udhcpc/default.script
-
-udhcp: uclibc $(TARGET_DIR)/sbin/udhcpc
-
-udhcp-clean:
-       rm -f $(TARGET_DIR)/sbin/udhcpc
-       -$(MAKE) -C $(UDHCP_DIR) clean
-
-udhcp-dirclean:
-       rm -rf $(UDHCP_DIR)
diff --git a/obsolete-buildroot/make/util-linux.mk b/obsolete-buildroot/make/util-linux.mk
deleted file mode 100644 (file)
index c29a840..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#############################################################
-#
-# util-linux
-#
-#############################################################
-UTIL-LINUX_SOURCE:=util-linux_2.12.orig.tar.gz
-UTIL-LINUX_SITE:=http://ftp.debian.org/debian/pool/main/u/util-linux/
-UTIL-LINUX_PATCH:=util-linux_2.12-6.diff.gz
-UTIL-LINUX_CAT:=zcat
-UTIL-LINUX_DIR:=$(BUILD_DIR)/util-linux-2.12
-UTIL-LINUX_BINARY:=$(UTIL-LINUX_DIR)/misc-utils/mcookie
-UTIL-LINUX_TARGET_BINARY:=$(TARGET_DIR)/usr/bin/mcookie
-
-$(DL_DIR)/$(UTIL-LINUX_SOURCE):
-       $(WGET) -P $(DL_DIR) $(UTIL-LINUX_SITE)/$(UTIL-LINUX_SOURCE)
-
-$(DL_DIR)/$(UTIL-LINUX_PATCH):
-       $(WGET) -P $(DL_DIR) $(UTIL-LINUX_SITE)/$(UTIL-LINUX_PATCH)
-
-$(UTIL-LINUX_DIR)/.unpacked: $(DL_DIR)/$(UTIL-LINUX_SOURCE) $(DL_DIR)/$(UTIL-LINUX_PATCH)
-       $(UTIL-LINUX_CAT) $(DL_DIR)/$(UTIL-LINUX_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       $(UTIL-LINUX_CAT) $(DL_DIR)/$(UTIL-LINUX_PATCH) | patch -p1 -d $(UTIL-LINUX_DIR)
-       cat $(SOURCE_DIR)/util-linux.patch | patch -p1 -d $(UTIL-LINUX_DIR)
-       touch $(UTIL-LINUX_DIR)/.unpacked
-
-$(UTIL-LINUX_DIR)/.configured: $(UTIL-LINUX_DIR)/.unpacked
-       (cd $(UTIL-LINUX_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-               ARCH=$(ARCH) \
-       );
-       $(SED) "s,^INSTALLSUID=.*,INSTALLSUID=\\$$\(INSTALL\) -m \\$$\(BINMODE\)," \
-               $(UTIL-LINUX_DIR)/MCONFIG
-       $(SED) "s,^USE_TTY_GROUP=.*,USE_TTY_GROUP=no," $(UTIL-LINUX_DIR)/MCONFIG
-       touch $(UTIL-LINUX_DIR)/.configured
-
-$(UTIL-LINUX_BINARY): $(UTIL-LINUX_DIR)/.configured
-       $(MAKE) ARCH=$(ARCH) CC=$(TARGET_CC) -C $(UTIL-LINUX_DIR)
-
-$(UTIL-LINUX_TARGET_BINARY): $(UTIL-LINUX_BINARY)
-       $(MAKE) DESTDIR=$(TARGET_DIR) USE_TTY_GROUP=no -C $(UTIL-LINUX_DIR) install
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-
-util-linux: uclibc $(UTIL-LINUX_TARGET_BINARY)
-
-util-linux-source: $(DL_DIR)/$(UTIL-LINUX_SOURCE)
-
-util-linux-clean:
-       #There is no working 'uninstall' target.  Just skip it... 
-       #$(MAKE) DESTDIR=$(TARGET_DIR) -C $(UTIL-LINUX_DIR) uninstall
-       -$(MAKE) -C $(UTIL-LINUX_DIR) clean
-
-util-linux-dirclean:
-       rm -rf $(UTIL-LINUX_DIR)
-
-
diff --git a/obsolete-buildroot/make/valgrind.mk b/obsolete-buildroot/make/valgrind.mk
deleted file mode 100644 (file)
index 1c39c31..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-#############################################################
-#
-# valgrind
-#
-#############################################################
-
-VALGRIND_SITE:=http://developer.kde.org/~sewardj/
-VALGRIND_DIR:=$(BUILD_DIR)/valgrind-2.1.1
-VALGRIND_SOURCE:=valgrind-2.1.1.tar.bz2
-VALGRIND_PATCH:=$(SOURCE_DIR)/valgrind.patch
-
-$(DL_DIR)/$(VALGRIND_SOURCE):
-       $(WGET) -P $(DL_DIR) $(VALGRIND_SITE)/$(VALGRIND_SOURCE)
-
-$(VALGRIND_DIR)/.unpacked: $(DL_DIR)/$(VALGRIND_SOURCE)
-       bzcat $(DL_DIR)/$(VALGRIND_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch  $(VALGRIND_DIR)/.unpacked
-
-$(VALGRIND_DIR)/.patched: $(VALGRIND_DIR)/.unpacked
-       cat $(VALGRIND_PATCH) | patch -d $(VALGRIND_DIR) -p1
-       touch $(VALGRIND_DIR)/.patched
-
-$(VALGRIND_DIR)/.configured: $(VALGRIND_DIR)/.patched
-       (cd $(VALGRIND_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-               --without-uiout --disable-valgrindmi \
-               --disable-tui --disable-valgrindtk \
-               --without-x --without-included-gettext \
-       );
-       touch  $(VALGRIND_DIR)/.configured
-
-$(VALGRIND_DIR)/coregrind/valgrind.so: $(VALGRIND_DIR)/.configured
-       $(MAKE) -C $(VALGRIND_DIR)
-       -$(STRIP)  $(VALGRIND_DIR)/*.so*
-       touch -c $(VALGRIND_DIR)/coregrind/valgrind.so
-
-$(TARGET_DIR)/usr/bin/valgrind: $(VALGRIND_DIR)/coregrind/valgrind.so
-       $(MAKE) \
-           prefix=$(TARGET_DIR)/usr \
-           exec_prefix=$(TARGET_DIR)/usr \
-           bindir=$(TARGET_DIR)/usr/bin \
-           sbindir=$(TARGET_DIR)/usr/sbin \
-           libexecdir=$(TARGET_DIR)/usr/lib \
-           datadir=$(TARGET_DIR)/usr/share \
-           sysconfdir=$(TARGET_DIR)/etc \
-           sharedstatedir=$(TARGET_DIR)/usr/com \
-           localstatedir=$(TARGET_DIR)/var \
-           libdir=$(TARGET_DIR)/usr/lib \
-           infodir=$(TARGET_DIR)/usr/info \
-           mandir=$(TARGET_DIR)/usr/man \
-           includedir=$(TARGET_DIR)/usr/include \
-           -C $(VALGRIND_DIR) install;
-       rm -rf $(TARGET_DIR)/usr/share/doc/valgrind
-       #mkdir -p $(TARGET_DIR)/etc/default
-       #cp $(VALGRIND_DIR)/valgrind.default $(TARGET_DIR)/etc/default/valgrind
-       #mkdir -p $(TARGET_DIR)/usr/lib/valgrind
-       #cp $(VALGRIND_DIR)/woody.supp $(TARGET_DIR)/usr/lib/valgrind/
-       touch -c $(TARGET_DIR)/usr/bin/valgrind
-
-ifeq ($(ARCH),i386)
-valgrind: $(TARGET_DIR)/usr/bin/valgrind
-else
-valgrind:
-endif
-
-valgrind-source: $(DL_DIR)/$(VALGRIND_SOURCE)
-
-valgrind-clean: 
-       $(MAKE) -C $(VALGRIND_DIR) clean
-
-valgrind-dirclean: 
-       rm -rf $(VALGRIND_DIR)
-
diff --git a/obsolete-buildroot/make/vsftpd.mk b/obsolete-buildroot/make/vsftpd.mk
deleted file mode 100644 (file)
index 2fa4d1a..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-# vsftpd
-
-VSFTPD_VERSION:=1.2.2
-VSFTPD_RELEASE:=1
-
-VSFTPD_SOURCE:=vsftpd-$(VSFTPD_VERSION).tar.gz
-VSFTPD_SITE:=ftp://vsftpd.beasts.org/users/cevans/
-VSFTPD_DIR:=$(BUILD_DIR)/vsftpd-$(VSFTPD_VERSION)
-VSFTPD_CAT:=zcat
-
-VSFTPD_PATCH_DIR := $(SOURCE_DIR)/openwrt/patches/vsftpd
-
-VSFTPD_BUILD_DIR := $(BUILD_DIR)/vsftpd_$(VSFTPD_VERSION)-$(VSFTPD_RELEASE)
-VSFTPD_IPK_DIR := $(OPENWRT_IPK_DIR)/vsftpd
-VSFTPD_IPK := $(VSFTPD_BUILD_DIR)_$(ARCH).ipk
-
-
-$(DL_DIR)/$(VSFTPD_SOURCE):
-        $(WGET) -P $(DL_DIR) $(VSFTPD_SITE)/$(VSFTPD_SOURCE)
-
-
-$(VSFTPD_DIR)/.stamp-unpacked: $(DL_DIR)/$(VSFTPD_SOURCE)
-       $(VSFTPD_CAT) $(DL_DIR)/$(VSFTPD_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-
-       touch $(VSFTPD_DIR)/.stamp-unpacked
-
-
-$(VSFTPD_DIR)/.stamp-patched: $(VSFTPD_DIR)/.stamp-unpacked
-       $(SOURCE_DIR)/patch-kernel.sh $(VSFTPD_DIR) $(VSFTPD_PATCH_DIR)
-
-       touch  $(VSFTPD_DIR)/.stamp-patched
-
-
-$(VSFTPD_DIR)/.stamp-built: $(VSFTPD_DIR)/.stamp-patched
-       cd $(VSFTPD_DIR) ; \
-       $(MAKE) \
-         $(TARGET_CONFIGURE_OPTS) \
-         CFLAGS="$(TARGET_CFLAGS)" \
-        
-       touch  $(VSFTPD_DIR)/.stamp-built
-
-
-$(VSFTPD_BUILD_DIR): $(VSFTPD_DIR)/.stamp-built
-       mkdir -p $(VSFTPD_BUILD_DIR)
-
-       install -m0755 -d $(VSFTPD_BUILD_DIR)/usr/sbin
-       install -m0755 $(VSFTPD_DIR)/vsftpd $(VSFTPD_BUILD_DIR)/usr/sbin/
-
-       install -m0755 -d $(VSFTPD_BUILD_DIR)/etc
-       install -m0644 $(VSFTPD_IPK_DIR)/root/etc/vsftpd.conf $(VSFTPD_BUILD_DIR)/etc/
-       install -m0755 -d $(VSFTPD_BUILD_DIR)/etc/init.d
-       install -m0755 $(VSFTPD_IPK_DIR)/root/etc/init.d/vsftpd $(VSFTPD_BUILD_DIR)/etc/init.d/
-
-       $(STRIP) $(VSFTPD_BUILD_DIR)/usr/sbin/*
-
-
-$(VSFTPD_IPK): $(VSFTPD_BUILD_DIR)
-       cp -a $(VSFTPD_IPK_DIR)/CONTROL $(VSFTPD_BUILD_DIR)/
-       perl -pi -e "s/^Vers.*:.*$$/Version: $(VSFTPD_VERSION)-$(VSFTPD_RELEASE)/" $(VSFTPD_BUILD_DIR)/CONTROL/control
-       perl -pi -e "s/^Arch.*:.*$$/Architecture: $(ARCH)/" $(VSFTPD_BUILD_DIR)/CONTROL/control
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(VSFTPD_BUILD_DIR)
-
-
-vsftpd-source: $(DL_DIR)/$(VSFTPD_SOURCE)
-
-vsftpd-ipk: ipkg-utils $(VSFTPD_IPK)
-
-vsftpd-clean:
-       rm -rf $(VSFTPD_DIR)
-       rm -rf $(VSFTPD_BUILD_DIR)
-       rm -rf $(VSFTPD_IPK)
diff --git a/obsolete-buildroot/make/vtun.mk b/obsolete-buildroot/make/vtun.mk
deleted file mode 100644 (file)
index 595a6f8..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#############################################################
-#
-# vtun
-#
-# NOTE: Uses start-stop-daemon in init script, so be sure
-# to enable that within busybox
-#
-#############################################################
-VTUN_SOURCE:=vtun-2.6.tar.gz
-VTUN_SITE:=http://aleron.dl.sourceforge.net/sourceforge/vtun/
-VTUN_DIR:=$(BUILD_DIR)/vtun-2.6
-VTUN_CAT:=zcat
-VTUN_BINARY:=vtund
-VTUN_TARGET_BINARY:=usr/sbin/vtund
-VTUN_PATCH:=$(SOURCE_DIR)/vtun.patch
-
-$(DL_DIR)/$(VTUN_SOURCE):
-        $(WGET) -P $(DL_DIR) $(VTUN_SITE)/$(VTUN_SOURCE)
-
-vtun-source: $(DL_DIR)/$(VTUN_SOURCE)
-
-$(VTUN_DIR)/.unpacked: $(DL_DIR)/$(VTUN_SOURCE)
-       $(VTUN_CAT) $(DL_DIR)/$(VTUN_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       mv $(BUILD_DIR)/vtun $(VTUN_DIR)
-       cat $(VTUN_PATCH) | patch -p1 -d $(VTUN_DIR)
-       touch $(VTUN_DIR)/.unpacked
-
-$(VTUN_DIR)/.configured: $(VTUN_DIR)/.unpacked zlib lzo openssl
-       (cd $(VTUN_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               ./configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               --with-ssl-headers=$(STAGING_DIR)/include/openssl \
-               --with-lzo-headers=$(STAGING_DIR)/include \
-       );
-       touch  $(VTUN_DIR)/.configured
-
-$(VTUN_DIR)/$(VTUN_BINARY): $(VTUN_DIR)/.configured
-       $(MAKE) -C $(VTUN_DIR)
-
-$(TARGET_DIR)/$(VTUN_TARGET_BINARY): $(VTUN_DIR)/$(VTUN_BINARY)
-       $(MAKE) DESTDIR=$(TARGET_DIR) -C $(VTUN_DIR) install
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-
-vtun: uclibc $(TARGET_DIR)/$(VTUN_TARGET_BINARY)
-
-vtun-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) -C $(VTUN_DIR) uninstall
-       -$(MAKE) -C $(VTUN_DIR) clean
-
-vtun-dirclean:
-       rm -rf $(VTUN_DIR)
-
diff --git a/obsolete-buildroot/make/wshaper.mk b/obsolete-buildroot/make/wshaper.mk
deleted file mode 100644 (file)
index d892a60..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-######################################################
-#
-#  An example makefile to fetch a package from sources
-#  then fetch the ipkg updates required to the base package
-#  extract the archives into the build tree
-#  and then build the source
-#
-######################################################
-
-
-#  For this example we'll use a fairly simple package that compiles easily
-#  and has sources available for download at sourceforge
-WSHAPER=wondershaper-1.1a
-WSHAPER_TARGET=wondershaper-1.1a_mipsel.ipk
-WSHAPER_SITE=http://lartc.org/wondershaper
-WSHAPER_SOURCE=wondershaper-1.1a.tar.gz
-WSHAPERIPK_SITE=http://openwrt.rozeware.bc.ca/ipkg-dev
-WSHAPERIPK_SRC=wondershaper-1.1a-pkg.tgz
-
-
-
-# define a target for the master makefile
-wshaper-ipk:   $(BUILD_DIR)/$(WSHAPER_TARGET)
-
-# We need to download sources if we dont have them
-$(DL_DIR)/$(WSHAPER_SOURCE) :
-       $(WGET) -P $(DL_DIR) $(WSHAPER_SITE)/$(WSHAPER_SOURCE)
-
-# As well as the upstream package sources, we need the updates
-# for ipkg packaging
-$(DL_DIR)/$(WSHAPERIPK_SRC)  :  
-       $(WGET) -P $(DL_DIR) $(WSHAPERIPK_SITE)/$(WSHAPERIPK_SRC)
-
-# if we have the sources, they do no good unless they are unpacked
-$(BUILD_DIR)/$(WSHAPER)/.unpacked:     $(DL_DIR)/$(WSHAPER_SOURCE)
-       tar -C $(BUILD_DIR) -zxf $(DL_DIR)/$(WSHAPER_SOURCE)
-       touch $(BUILD_DIR)/$(WSHAPER)/.unpacked
-       
-# with the upstream sources unpacked, they still dont do much good without
-# the ipkg control and rule files
-$(BUILD_DIR)/$(WSHAPER)/ipkg/control  :        $(BUILD_DIR)/$(WSHAPER)/.unpacked $(DL_DIR)/$(WSHAPERIPK_SRC) 
-       tar -C $(BUILD_DIR)/$(WSHAPER) -zxf $(DL_DIR)/$(WSHAPERIPK_SRC)
-       
-# now that we have it all in place, just build it
-$(BUILD_DIR)/$(WSHAPER_TARGET):        $(BUILD_DIR)/$(WSHAPER)/ipkg/control
-       cd $(BUILD_DIR)/$(WSHAPER); $(IPKG_BUILDPACKAGE)
-       
-               
-       
-               
diff --git a/obsolete-buildroot/make/wtools.mk b/obsolete-buildroot/make/wtools.mk
deleted file mode 100644 (file)
index 53ed4ff..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#############################################################
-#
-# wtools - Wireless Tools
-#
-#############################################################
-#
-WTOOLS_SOURCE_URL=http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux
-WTOOLS_SOURCE=wireless_tools.26.tar.gz
-WTOOLS_BUILD_DIR=$(BUILD_DIR)/wireless_tools.26
-
-$(DL_DIR)/$(WTOOLS_SOURCE):
-        $(WGET) -P $(DL_DIR) $(WTOOLS_SOURCE_URL)/$(WTOOLS_SOURCE) 
-
-$(WTOOLS_BUILD_DIR)/.unpacked: $(DL_DIR)/$(WTOOLS_SOURCE)
-       zcat $(DL_DIR)/$(WTOOLS_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(WTOOLS_BUILD_DIR)/.unpacked
-
-$(WTOOLS_BUILD_DIR)/.configured: $(WTOOLS_BUILD_DIR)/.unpacked
-       touch  $(WTOOLS_BUILD_DIR)/.configured
-
-$(WTOOLS_BUILD_DIR)/iwconfig: $(WTOOLS_BUILD_DIR)/.configured
-       $(MAKE) -C $(WTOOLS_BUILD_DIR) \
-               CC=$(TARGET_CC) CFLAGS="$(TARGET_CFLAGS)" \
-               BUILD_SHARED=y # may want to make this an option
-
-$(TARGET_DIR)/sbin/iwconfig: $(WTOOLS_BUILD_DIR)/iwconfig
-       # Copy The Wireless Tools
-       cp -af $(WTOOLS_BUILD_DIR)/iwconfig $(TARGET_DIR)/sbin/
-       cp -af $(WTOOLS_BUILD_DIR)/iwevent $(TARGET_DIR)/sbin/
-       cp -af $(WTOOLS_BUILD_DIR)/iwgetid $(TARGET_DIR)/sbin/
-       cp -af $(WTOOLS_BUILD_DIR)/iwlist $(TARGET_DIR)/sbin/
-       cp -af $(WTOOLS_BUILD_DIR)/iwpriv $(TARGET_DIR)/sbin/
-       cp -af $(WTOOLS_BUILD_DIR)/iwspy $(TARGET_DIR)/sbin/
-       cp -af $(WTOOLS_BUILD_DIR)/libiw.so.26 $(TARGET_DIR)/lib
-       $(STRIP) $(TARGET_DIR)/sbin/iwconfig $(TARGET_DIR)/sbin/iwevent \
-               $(TARGET_DIR)/sbin/iwgetid $(TARGET_DIR)/sbin/iwlist \
-               $(TARGET_DIR)/sbin/iwpriv $(TARGET_DIR)/sbin/iwspy \
-               $(TARGET_DIR)/lib/libiw.so.26
-
-wtools: $(TARGET_DIR)/sbin/iwconfig 
-
-wtools-source: $(DL_DIR)/$(WTOOLS_SOURCE)
-
-wtools-clean:
-       $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(WTOOLS_BUILD_DIR) uninstall
-       -$(MAKE) -C $(WTOOLS_BUILD_DIR) clean
-
-wtools-dirclean:
-       rm -rf $(WTOOLS_BUILD_DIR)
-
diff --git a/obsolete-buildroot/make/zlib.mk b/obsolete-buildroot/make/zlib.mk
deleted file mode 100644 (file)
index 8583718..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-#############################################################
-#
-# zlib
-#
-#############################################################
-ZLIB_SOURCE=zlib-1.1.4.tar.bz2
-ZLIB_SITE=http://aleron.dl.sourceforge.net/sourceforge/libpng
-ZLIB_DIR=$(BUILD_DIR)/zlib-1.1.4
-ZLIB_CFLAGS= $(TARGET_CFLAGS) -fPIC
-ifeq ($(strip $(BUILD_WITH_LARGEFILE)),true)
-ZLIB_CFLAGS+= -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-endif
-
-ZLIB_IPK_DIR=$(BUILD_DIR)/zlib-1.1.4-ipk
-ZLIB_IPK=$(BUILD_DIR)/zlib_1.1.4-1_mipsel.ipk
-
-$(DL_DIR)/$(ZLIB_SOURCE):
-       $(WGET) -P $(DL_DIR) $(ZLIB_SITE)/$(ZLIB_SOURCE)
-
-$(ZLIB_DIR)/.source: $(DL_DIR)/$(ZLIB_SOURCE)
-       bzcat $(DL_DIR)/$(ZLIB_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       touch $(ZLIB_DIR)/.source
-
-$(ZLIB_DIR)/.configured: $(ZLIB_DIR)/.source
-       (cd $(ZLIB_DIR); \
-               ./configure \
-               --shared \
-               --prefix=/usr \
-               --exec-prefix=$(STAGING_DIR)/usr/bin \
-               --libdir=$(STAGING_DIR)/lib \
-               --includedir=$(STAGING_DIR)/include \
-       );
-       touch $(ZLIB_DIR)/.configured;
-
-$(ZLIB_DIR)/libz.so.1.1.4: $(ZLIB_DIR)/.configured
-       $(MAKE) LDSHARED="$(TARGET_CROSS)ld -shared -soname,libz.so.1" \
-               CFLAGS="$(ZLIB_CFLAGS)" CC=$(TARGET_CC) -C $(ZLIB_DIR) all libz.a;
-       touch -c $(ZLIB_DIR)/libz.so.1.1.4
-
-$(STAGING_DIR)/lib/libz.so.1.1.4: $(ZLIB_DIR)/libz.so.1.1.4
-       cp -dpf $(ZLIB_DIR)/libz.a $(STAGING_DIR)/lib;
-       cp -dpf $(ZLIB_DIR)/zlib.h $(STAGING_DIR)/include;
-       cp -dpf $(ZLIB_DIR)/zconf.h $(STAGING_DIR)/include;
-       cp -dpf $(ZLIB_DIR)/libz.so* $(STAGING_DIR)/lib;
-       (cd $(STAGING_DIR)/lib; ln -fs libz.so.1.1.4 libz.so.1);
-       chmod a-x $(STAGING_DIR)/lib/libz.so.1.1.4
-       touch -c $(STAGING_DIR)/lib/libz.so.1.1.4
-
-$(TARGET_DIR)/lib/libz.so.1.1.4: $(STAGING_DIR)/lib/libz.so.1.1.4
-       cp -dpf $(STAGING_DIR)/lib/libz.so* $(TARGET_DIR)/lib;
-       -$(STRIP)  $(TARGET_DIR)/lib/libz.so*
-       touch -c $(TARGET_DIR)/lib/libz.so.1.1.4
-
-$(TARGET_DIR)/usr/lib/libz.a: $(STAGING_DIR)/lib/libz.so.1.1.4
-       mkdir -p $(TARGET_DIR)/usr/include
-       cp -dpf $(STAGING_DIR)/include/zlib.h $(TARGET_DIR)/usr/include/
-       cp -dpf $(STAGING_DIR)/include/zconf.h $(TARGET_DIR)/usr/include/
-       cp -dpf $(STAGING_DIR)/lib/libz.a $(TARGET_DIR)/usr/lib/
-       rm -f $(TARGET_DIR)/lib/libz.so
-       (cd $(TARGET_DIR)/usr/lib; ln -fs /lib/libz.so.1.1.4 libz.so)
-       touch -c $(TARGET_DIR)/usr/lib/libz.a
-
-zlib-headers: $(TARGET_DIR)/usr/lib/libz.a
-
-zlib: uclibc $(TARGET_DIR)/lib/libz.so.1.1.4
-
-$(ZLIB_IPK): uclibc $(STAGING_DIR)/lib/libz.so.1.1.4
-       mkdir -p $(ZLIB_IPK_DIR)/CONTROL
-       cp $(SOURCE_DIR)/openwrt/ipkg/zlib/control $(ZLIB_IPK_DIR)/CONTROL/control
-       mkdir -p $(ZLIB_IPK_DIR)/lib
-       cp -dpf $(STAGING_DIR)/lib/libz.so* $(ZLIB_IPK_DIR)/lib;
-       -$(STRIP)  $(ZLIB_IPK_DIR)/lib/libz.so*
-       touch -c $(ZLIB_IPK_DIR)/lib/libz.so.1.1.4
-       cd $(BUILD_DIR); $(IPKG_BUILD) $(ZLIB_IPK_DIR)
-
-zlib-ipk: $(ZLIB_IPK)
-
-zlib-source: $(DL_DIR)/$(ZLIB_SOURCE)
-
-zlib-clean:
-       rm -f $(TARGET_DIR)/lib/libz.so*
-       -$(MAKE) -C $(ZLIB_DIR) clean
-
-zlib-dirclean:
-       rm -rf $(ZLIB_DIR)
-
diff --git a/obsolete-buildroot/sources/.cvsignore b/obsolete-buildroot/sources/.cvsignore
deleted file mode 100644 (file)
index 5c48862..0000000
+++ /dev/null
@@ -1 +0,0 @@
-dl
diff --git a/obsolete-buildroot/sources/STLport-4.5.3.patch b/obsolete-buildroot/sources/STLport-4.5.3.patch
deleted file mode 100644 (file)
index fee65f9..0000000
+++ /dev/null
@@ -1,407 +0,0 @@
-diff -urN STLport-4.5.3/Makefile STLport-4.5.3-devel/Makefile
---- STLport-4.5.3/Makefile     Wed Dec 31 17:00:00 1969
-+++ STLport-4.5.3-devel/Makefile       Tue Jan  7 15:28:08 2003
-@@ -0,0 +1,44 @@
-+# Makefile to compile stlport with uClibc
-+#
-+# Copyright (C) 2002 Erik Andersen <andersen@codepoet.org>
-+#
-+# 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, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+# General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-+
-+ARCH:=i386
-+PREFIX:=/usr/$(ARCH)-linux-uclibc
-+CROSS:= $(PREFIX)/../bin/$(ARCH)-linux-uclibc-
-+CC=$(CROSS)gcc
-+CXX=$(CROSS)g++
-+AR = $(CROSS)ar
-+STRIP = $(CROSS)strip --remove-section=.comment --remove-section=.note --strip-unneeded
-+.EXPORT_ALL_VARIABLES:
-+
-+all:
-+      rm -f lib/lib*
-+      make -C src -f gcc-uClibc.mak all
-+      (cd lib; rm -f libstdc++_debug.so; \
-+      ln -fs libstdc++.so.4.5 libstdc++.so; \
-+      ln -fs libstdc++.so.4.5 libstdc++.so.0;)
-+      $(STRIP) lib/libstdc++.so.4.5; 
-+
-+clean:
-+      make -C src -f gcc-uClibc.mak clean
-+      rm -rf lib/*
-+
-+install:
-+      (cd lib; \
-+      cp -a libstdc++.a $(PREFIX)/lib; \
-+      cp -a libstdc++.so libstdc++.so.0 libstdc++.so.4.5 $(PREFIX)/lib;)
-+      cp -a stlport $(PREFIX)/include/c++
-diff -urN STLport-4.5.3/src/dll_main.cpp STLport-4.5.3-devel/src/dll_main.cpp
---- STLport-4.5.3/src/dll_main.cpp     Sat Feb  2 16:11:56 2002
-+++ STLport-4.5.3-devel/src/dll_main.cpp       Tue Jan  7 15:28:08 2003
-@@ -52,7 +52,7 @@
- #  include <locale>
- # endif
--# if defined (_STLP_UNIX)
-+# if defined (_STLP_UNIX) && defined (_STLP_PTHREADS) && ! defined (_STLP_USE_UCLIBC)
- #  define _STLP_HAS_PERTHREAD_ALLOCATOR
- # include <stl/_pthread_alloc.h>
- # endif
-diff -urN STLport-4.5.3/src/gcc-uClibc.mak STLport-4.5.3-devel/src/gcc-uClibc.mak
---- STLport-4.5.3/src/gcc-uClibc.mak   Wed Dec 31 17:00:00 1969
-+++ STLport-4.5.3-devel/src/gcc-uClibc.mak     Tue Jan  7 15:28:08 2003
-@@ -0,0 +1,61 @@
-+#
-+# Basename for libraries
-+#
-+LIB_BASENAME:=libstdc++
-+LIB_SHAREDNAME:=$(LIB_BASENAME).so
-+LIB_SHAREDNAME_FULL:=$(LIB_SHAREDNAME).0
-+
-+#
-+# guts for common stuff
-+#
-+#
-+LINK:=$(AR) -cr
-+#DYN_LINK:=$(CC) -fno-exceptions -lpthread -lm -shared -Wl,-soname=$(LIB_SHAREDNAME_FULL) -o
-+DYN_LINK:=$(CC) -fno-exceptions -shared -Wl,-soname=$(LIB_SHAREDNAME_FULL) -o
-+
-+OBJEXT=o
-+DYNEXT=so
-+STEXT=a
-+RM=rm -rf
-+PATH_SEP=/
-+MKDIR=mkdir -p
-+COMP=GCC$(ARCH)
-+INSTALL_STEP = install_unix 
-+
-+all: release_dynamic release_static
-+#all: all_dynamic all_static symbolic_links 
-+
-+include common_macros.mak
-+STLDEBUG_NAME:=$(LIB_BASENAME).debug
-+
-+# Lets disable exception support, since this saves over 200k...
-+DEFINE_FLAGS:= -fno-exceptions
-+#DEFINE_FLAGS:= -D_STLP_NO_EXCEPTIONS -fno-exceptions -DSTL_NO_EXCEPTIONS
-+
-+#DEFINE_FLAGS+= -D_STLP_USE_UCLIBC -D_STLP_NO_WCHAR_T \
-+#     -DUSE_SPRINTF_INSTEAD -D_ISOC99_SOURCE
-+
-+WARNING_FLAGS:= -W -Wno-sign-compare -Wno-unused -Wno-uninitialized
-+INCLUDE_FLAGS = -I${STLPORT_DIR}
-+CXXFLAGS_COMMON = $(WARNING_FLAGS)  $(DEFINE_FLAGS) $(INCLUDE_FLAGS)
-+
-+CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -Os
-+CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -Os -fPIC
-+
-+CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -O -g
-+CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -O -g -fPIC
-+
-+CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
-+CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG -fPIC
-+
-+include common_percent_rules.mak
-+include common_rules.mak
-+
-+
-+#install: all
-+#     cp -p $(LIB_TARGET) ${D_LIB_TARGET} ../lib
-+
-+#%.s: %.cpp
-+#     $(CXX) $(CXXFLAGS) -O4 -S -pto $<  -o $@
-+
-+
-diff -urN STLport-4.5.3/src/num_put_float.cpp STLport-4.5.3-devel/src/num_put_float.cpp
---- STLport-4.5.3/src/num_put_float.cpp        Fri Jan 18 15:06:52 2002
-+++ STLport-4.5.3-devel/src/num_put_float.cpp  Tue Jan  7 15:28:08 2003
-@@ -65,6 +65,12 @@
- # endif
-+#  if defined(_STLP_USE_UCLIBC)
-+#    define __USE_ISOC99 1
-+#    include <math.h>
-+#    include <float.h>
-+#  endif
-+
- # include <cstdlib>
- #if defined (_MSC_VER) || defined (__MINGW32__) || defined (__BORLANDC__) || defined (__DJGPP)  || defined (_STLP_SCO_OPENSERVER) || defined (__NCR_SVR)
-@@ -209,7 +215,7 @@
- #ifdef USE_SPRINTF_INSTEAD
--#elif defined (__hpux) || defined (__DJGPP) || ( defined(_STLP_USE_GLIBC) && ! defined (__MSL__) )
-+#elif defined (__hpux) || defined (__DJGPP) || ( defined(_STLP_USE_GLIBC) && ! defined (__MSL__) ) || defined (_STLP_USE_UCLIBC)
- #  if defined (isfinite) 
- inline bool _Stl_is_nan_or_inf(double x) { return !isfinite(x); }
- #  else
-@@ -238,7 +244,7 @@
- }
- inline bool _Stl_is_neg_inf(double x)    { return _fpclass(x) == _FPCLASS_NINF; }
- inline bool _Stl_is_neg_nan(double x)    { return _isnan(x) && _copysign(1., x) < 0 ; } 
--#elif defined(__MRC__) || defined(__SC__)             //*TY 02/24/2000 - added support for MPW
-+#elif defined(__MRC__) || defined(__SC__)
- bool _Stl_is_nan_or_inf(double x) { return isnan(x) || !isfinite(x); }
- bool _Stl_is_inf(double x)        { return !isfinite(x); }
- bool _Stl_is_neg_inf(double x)    { return !isfinite(x) && signbit(x); }
-@@ -280,7 +286,7 @@
-   inline char* _Stl_qfcvtR(long double x, int n, int* pt, int* sign, char* buf)
-     { return fcvtbuf(x, n, pt, sign, buf); }
- # endif
--#elif defined (_STLP_USE_GLIBC)
-+#elif defined (_STLP_USE_GLIBC) || defined(_STLP_USE_UCLIBC)
-   inline char* _Stl_ecvtR(double x, int n, int* pt, int* sign, char* buf)
-     { return buf + ecvt_r(x, n, pt, sign, buf, NDIG+2); }
-   inline char* _Stl_fcvtR(double x, int n, int* pt, int* sign, char* buf)
-diff -urN STLport-4.5.3/src/stdio_streambuf.cpp STLport-4.5.3-devel/src/stdio_streambuf.cpp
---- STLport-4.5.3/src/stdio_streambuf.cpp      Thu Jan 10 11:41:52 2002
-+++ STLport-4.5.3-devel/src/stdio_streambuf.cpp        Tue Jan  7 15:28:08 2003
-@@ -82,7 +82,7 @@
-     _STLP_VENDOR_CSTD::fgetpos(_M_file, &pos);
-     // added 21 june 00 mdb,rjf,wjs: glibc 2.2 changed fpos_t to be a struct instead
-     // of a primitive type
--#if (defined(__GLIBC__) && ( (__GLIBC__ > 2) || ( (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 2) ) ) )
-+#if defined(_STLP_USE_UCLIBC) || (defined(__GLIBC__) && defined(_STLP_USE_GLIBC) && ( (__GLIBC__ > 2) || ( (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 2) ) ) )
-     return pos_type((streamoff)pos.__pos);
- #elif defined(__ISCPP__) || defined(__MVS__) || (__OS400__)
-      return pos_type(pos.__fpos_elem[ 0 ]);
-@@ -101,13 +101,16 @@
-   // added 21 june 00 mdb,rjf,wjs: glibc 2.2 changed fpos_t to be a struct instead
-   // of a primitive type
--#if (defined(__GLIBC__) && ( (__GLIBC__ > 2) || ( (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 2) ) ) )
-+#if (defined(__GLIBC__) && defined(_STLP_USE_GLIBC) && ( (__GLIBC__ > 2) || ( (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 2) ) ) )
-   fpos_t p;
-   p.__pos = pos;
-   memset( &(p.__state), 0, sizeof(p.__state) );
- #elif defined(__MVS__) || (__OS400__)
-   fpos_t p;
-   p.__fpos_elem[0] = pos;
-+#elif defined(_STLP_USE_UCLIBC)
-+  fpos_t p;
-+  p.__pos = pos;
- #else
-   fpos_t p(pos);
- #endif
-diff -urN STLport-4.5.3/stlport/config/_prolog.h STLport-4.5.3-devel/stlport/config/_prolog.h
---- STLport-4.5.3/stlport/config/_prolog.h     Sun Oct 28 13:26:44 2001
-+++ STLport-4.5.3-devel/stlport/config/_prolog.h       Tue Jan  7 15:28:08 2003
-@@ -1,3 +1,8 @@
-+/* Evil hack to make sure everything behaves itself */
-+#define _STLP_USE_UCLIBC
-+//#define _STLP_NO_WCHAR_T
-+//#define _ISOC99_SOURCE
-+//#define USE_SPRINTF_INSTEAD
- #if defined (_STLP_MSVC) || defined (__ICL) || defined (__BORLANDC__)
-diff -urN STLport-4.5.3/stlport/config/stl_gcc.h STLport-4.5.3-devel/stlport/config/stl_gcc.h
---- STLport-4.5.3/stlport/config/stl_gcc.h     Thu Jan 10 11:41:58 2002
-+++ STLport-4.5.3-devel/stlport/config/stl_gcc.h       Tue Jan  7 15:28:08 2003
-@@ -3,7 +3,7 @@
-  */
- /* Systems having GLIBC installed have different traits */
--#if ! defined (_STLP_USE_GLIBC) && ( defined (__linux__) || defined (__CYGWIN__) )
-+#if ! defined (_STLP_USE_GLIBC)  && ! defined (_STLP_USE_UCLIBC) && ( defined (__linux__) || defined (__CYGWIN__) )
- # define _STLP_USE_GLIBC
- #endif
-diff -urN STLport-4.5.3/stlport/cstdlib STLport-4.5.3-devel/stlport/cstdlib
---- STLport-4.5.3/stlport/cstdlib      Thu Aug 23 15:51:54 2001
-+++ STLport-4.5.3-devel/stlport/cstdlib        Tue Jan  7 15:28:08 2003
-@@ -55,9 +55,11 @@
- using _STLP_VENDOR_CSTD::atof;
- using _STLP_VENDOR_CSTD::atoi;
- using _STLP_VENDOR_CSTD::atol;
-+# ifndef _STLP_USE_UCLIBC
- using _STLP_VENDOR_CSTD::mblen;
- using _STLP_VENDOR_CSTD::mbstowcs;
- using _STLP_VENDOR_CSTD::mbtowc;
-+# endif
- using _STLP_VENDOR_CSTD::strtod;
- using _STLP_VENDOR_CSTD::strtol;
- using _STLP_VENDOR_CSTD::strtoul;
-diff -urN STLport-4.5.3/stlport/stl/_config.h STLport-4.5.3-devel/stlport/stl/_config.h
---- STLport-4.5.3/stlport/stl/_config.h        Fri Jan 18 15:08:36 2002
-+++ STLport-4.5.3-devel/stlport/stl/_config.h  Tue Jan  7 15:28:08 2003
-@@ -26,6 +26,16 @@
- #ifndef _STLP_CONFIG_H
- # define _STLP_CONFIG_H
-+/* Make the STLport headers provide uClibc support by default */
-+#define _STLP_NO_EXCEPTIONS           1
-+#define STL_NO_EXCEPTIONS             1
-+#define _STLP_USE_UCLIBC              1
-+//#define _STLP_NO_WCHAR_T            1
-+#define _STLP_NO_LONG_DOUBLE          1
-+#define USE_SPRINTF_INSTEAD           1
-+#define _ISOC99_SOURCE                        1
-+#define _STLP_NO_ANACHRONISMS         1
-+
- /*
-  * Purpose of this file :
-  *
-@@ -164,7 +174,7 @@
- /* Operating system recognition (basic) */
- # if defined (__unix) || defined (__linux__) || defined (__QNX__) || defined (_AIX)  || defined (__NetBSD__) || defined (__Lynx__)
- #  define _STLP_UNIX 1
--#  if defined (__linux__) && ! defined (_STLP_USE_GLIBC)
-+#  if defined (__linux__) && ! defined (_STLP_USE_GLIBC) && ! defined (_STLP_USE_UCLIBC)
- #   define _STLP_USE_GLIBC 1
- #  endif
- # elif defined(macintosh) || defined (_MAC)
-diff -urN STLport-4.5.3/stlport/stl/_stdio_file.h STLport-4.5.3-devel/stlport/stl/_stdio_file.h
---- STLport-4.5.3/stlport/stl/_stdio_file.h    Fri Jan 18 15:07:00 2002
-+++ STLport-4.5.3-devel/stlport/stl/_stdio_file.h      Tue Jan  7 15:28:08 2003
-@@ -634,6 +634,112 @@
- }
- # define _STLP_FILE_I_O_IDENTICAL
-+#elif defined(_STLP_USE_UCLIBC)
-+
-+#if defined(__MASK_READING)
-+
-+inline int   _FILE_fd(const FILE *__f) { return __f->__filedes; }
-+
-+//       Returns a pointer to the beginning of the buffer.
-+inline char* _FILE_I_begin(const FILE *__f) { return (char*) __f->__bufstart; }
-+
-+//       Returns the current read/write position within the buffer.
-+inline char* _FILE_I_next(const FILE *__f) { return (char*) __f->__bufpos; }
-+
-+//       Returns a pointer immediately past the end of the buffer.
-+inline char* _FILE_I_end(const FILE *__f) { return (char*)__f->__bufend; }
-+
-+//       Returns the number of characters remaining in the buffer, i.e.
-+//       _FILE_[IO]_end(__f) - _FILE_[IO]_next(__f).
-+inline ptrdiff_t _FILE_I_avail(const FILE *__f) 
-+  { return __f->__bufgetc_u - __f->__bufpos; }
-+
-+//       Increments the current read/write position by 1, returning the 
-+//       character at the old position.
-+inline char& _FILE_I_preincr(FILE *__f)  { return *(char*)(++__f->__bufpos); }
-+
-+//       Increments the current read/write position by 1, returning the 
-+//       character at the old position.
-+inline char& _FILE_I_postincr(FILE *__f)  { return *(char*)(__f->__bufpos++); }
-+
-+//       Decrements the current read/write position by 1, returning the 
-+//       character at the old position.
-+inline char& _FILE_I_predecr(FILE *__f)  { return *(char*)(--__f->__bufpos); }
-+
-+//       Decrements the current read/write position by 1, returning the 
-+//       character at the old position.
-+inline char& _FILE_I_postdecr(FILE *__f)  { return *(char*)(__f->__bufpos--); }
-+
-+//       Increments the current read/write position by __n.
-+inline void  _FILE_I_bump(FILE *__f, int __n) { __f->__bufpos += __n; }
-+
-+//       Sets the beginning of the bufer to __begin, the current read/write
-+//       position to __next, and the buffer's past-the-end pointer to __end.
-+//       If any of those pointers is null, then all of them must be null.
-+inline void _FILE_I_set(FILE *__f, char* __begin, char* __next, char* __end)
-+{
-+      __f->__bufstart = (unsigned char*)__begin;
-+      __f->__bufpos  =  (unsigned char*)__next;
-+      __f->__bufend  =  (unsigned char*)__end;
-+      __f->__bufgetc_u = (unsigned char*)__begin;
-+      __f->__bufputc_u = (unsigned char*)__end;
-+}
-+
-+# define _STLP_FILE_I_O_IDENTICAL
-+
-+#else    // Support old stdio for a little while.
-+
-+inline int   _FILE_fd(const FILE *__f) { return __f->filedes; }
-+
-+//       Returns a pointer to the beginning of the buffer.
-+inline char* _FILE_I_begin(const FILE *__f) { return (char*) __f->bufstart; }
-+
-+//       Returns the current read/write position within the buffer.
-+inline char* _FILE_I_next(const FILE *__f) { return (char*) __f->bufpos; }
-+
-+//       Returns a pointer immediately past the end of the buffer.
-+inline char* _FILE_I_end(const FILE *__f) { return (char*)__f->bufend; }
-+
-+//       Returns the number of characters remaining in the buffer, i.e.
-+//       _FILE_[IO]_end(__f) - _FILE_[IO]_next(__f).
-+inline ptrdiff_t _FILE_I_avail(const FILE *__f) 
-+  { return __f->bufgetc - __f->bufpos; }
-+
-+//       Increments the current read/write position by 1, returning the 
-+//       character at the old position.
-+inline char& _FILE_I_preincr(FILE *__f)  { return *(char*)(++__f->bufpos); }
-+
-+//       Increments the current read/write position by 1, returning the 
-+//       character at the old position.
-+inline char& _FILE_I_postincr(FILE *__f)  { return *(char*)(__f->bufpos++); }
-+
-+//       Decrements the current read/write position by 1, returning the 
-+//       character at the old position.
-+inline char& _FILE_I_predecr(FILE *__f)  { return *(char*)(--__f->bufpos); }
-+
-+//       Decrements the current read/write position by 1, returning the 
-+//       character at the old position.
-+inline char& _FILE_I_postdecr(FILE *__f)  { return *(char*)(__f->bufpos--); }
-+
-+//       Increments the current read/write position by __n.
-+inline void  _FILE_I_bump(FILE *__f, int __n) { __f->bufpos += __n; }
-+
-+//       Sets the beginning of the bufer to __begin, the current read/write
-+//       position to __next, and the buffer's past-the-end pointer to __end.
-+//       If any of those pointers is null, then all of them must be null.
-+inline void _FILE_I_set(FILE *__f, char* __begin, char* __next, char* __end)
-+{
-+      __f->bufstart = (unsigned char*)__begin;
-+      __f->bufpos  =  (unsigned char*)__next;
-+      __f->bufend  =  (unsigned char*)__end;
-+      __f->bufgetc = (unsigned char*)__begin;
-+      __f->bufputc = (unsigned char*)__end;
-+}
-+
-+# define _STLP_FILE_I_O_IDENTICAL
-+
-+#endif
-+
- #else  /* A C library that we don't have an implementation for. */
- # error The C++ I/O library is not configured for this compiler
-diff -urN STLport-4.5.3/stlport/stl/c_locale.h STLport-4.5.3-devel/stlport/stl/c_locale.h
---- STLport-4.5.3/stlport/stl/c_locale.h       Fri Jan 18 15:07:00 2002
-+++ STLport-4.5.3-devel/stlport/stl/c_locale.h Wed Jan  8 10:58:10 2003
-@@ -401,6 +401,21 @@
- #  define _Locale_SPACE _S
- #  define _Locale_PRINT (_P | _U | _L | _N | _B)
- #  define _Locale_ALPHA (_U | _L)
-+
-+# elif defined(_STLP_USE_UCLIBC) /* linux, using the gnu compiler */
-+
-+#  define _Locale_CNTRL  _IScntrl
-+#  define _Locale_UPPER  _ISupper
-+#  define _Locale_LOWER  _ISlower
-+#  define _Locale_DIGIT  _ISdigit
-+#  define _Locale_XDIGIT _ISxdigit
-+#  define _Locale_PUNCT  _ISpunct
-+#  define _Locale_SPACE  _ISspace
-+#  define _Locale_PRINT  _ISprint
-+#  define _Locale_ALPHA  _ISalpha
-+
-+#else
-+#  error Unknown Locale
- #endif
- # endif /* _STLP_C_LOCALE_H */
diff --git a/obsolete-buildroot/sources/binutils-uclibc-001-debian.patch b/obsolete-buildroot/sources/binutils-uclibc-001-debian.patch
deleted file mode 100644 (file)
index 1dd39a9..0000000
+++ /dev/null
@@ -1,2394 +0,0 @@
-diff -urN binutils-2.14.90.0.7.orig/bfd/ChangeLog binutils-2.14.90.0.7/bfd/ChangeLog
---- binutils-2.14.90.0.7.orig/bfd/ChangeLog    2003-10-29 10:37:47.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/ChangeLog 2004-04-20 01:26:12.000000000 -0600
-@@ -1,3 +1,34 @@
-+2003-10-29  Daniel Jacobowitz  <drow@mvista.com>
-+
-+        * elf32-arm.h (elf32_arm_final_link_relocate): Move check for
-+        SEC_ALLOC.
-+
-+2003-10-29  Philip Blundell  <philb@gnu.org>
-+
-+      * elf32-arm.h (elf32_arm_plt0_entry, elf32_arm_plt_entry): New
-+      code sequence.
-+      (PLT_HEADER_SIZE): New.
-+      (struct elf32_arm_pcrel_relocs_copied): Rename to ...
-+      (struct elf32_arm_relocs_copied): ... this.  Count both
-+      pcrel and non-pcrel relocs.  All uses updated.
-+      (struct elf32_arm_link_hash_table): Add pointers to dynamic linker
-+      sections and symbol/section mapping cache.
-+      (create_got_section): New.
-+      (elf32_arm_create_dynamic_sections): New.
-+      (elf_backend_create_dynamic_sections): Use it.
-+      (elf32_arm_final_link_relocate): Support garbage collection of relocs.
-+      (elf32_arm_check_relocs): Likewise.
-+      (elf32_arm_adjust_dynamic_symbol): Likewise.
-+      (elf32_arm_copy_indirect_symbol): New.
-+      (elf32_arm_link_hash_table_create): Initialise new fields. 
-+      (elf32_arm_gc_sweep_hook): Implement.
-+      (elf32_arm_discard_copies): Delete.
-+      (elf32_arm_finish_dynamic_symbol): Use new PLT code.
-+      (elf32_arm_finish_dynamic_sections): Likewise.
-+      (elf_backend_can_refcount): Define.
-+      (elf_backend_copy_indirect_symbol): Likewise.
-+      (elf_backend_plt_header_size): Set to PLT_HEADER_SIZE.
-+
- 2003-10-29  Alan Modra  <amodra@bigpond.net.au>
-       * elf64-ppc.c (elf_backend_grok_prstatus): Define.
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf-bfd.h binutils-2.14.90.0.7/bfd/elf-bfd.h
---- binutils-2.14.90.0.7.orig/bfd/elf-bfd.h    2003-10-29 10:37:47.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/elf-bfd.h 2004-04-20 01:26:12.000000000 -0600
-@@ -1303,7 +1303,7 @@
- extern enum elf_reloc_type_class _bfd_elf_reloc_type_class
-   (const Elf_Internal_Rela *);
- extern bfd_vma _bfd_elf_rela_local_sym
--  (bfd *, Elf_Internal_Sym *, asection *, Elf_Internal_Rela *);
-+  (bfd *, Elf_Internal_Sym *, asection **, Elf_Internal_Rela *);
- extern bfd_vma _bfd_elf_rel_local_sym
-   (bfd *, Elf_Internal_Sym *, asection **, bfd_vma);
- extern bfd_vma _bfd_elf_section_offset
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf-hppa.h binutils-2.14.90.0.7/bfd/elf-hppa.h
---- binutils-2.14.90.0.7.orig/bfd/elf-hppa.h   2003-08-21 09:28:47.000000000 -0600
-+++ binutils-2.14.90.0.7/bfd/elf-hppa.h        2004-04-20 01:26:12.000000000 -0600
-@@ -1346,11 +1346,11 @@
-         /* This is a local symbol.  */
-         sym = local_syms + r_symndx;
-         sym_sec = local_sections[r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sym_sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sym_sec, rel);
-         /* If this symbol has an entry in the PA64 dynamic hash
-            table, then get it.  */
--        dyn_name = get_dyn_name (input_section, h, rel,
-+        dyn_name = get_dyn_name (input_bfd, h, rel,
-                                  &dynh_buf, &dynh_buflen);
-         dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
-                                             dyn_name, FALSE, FALSE);
-@@ -1373,7 +1373,7 @@
-             /* If this symbol has an entry in the PA64 dynamic hash
-                table, then get it.  */
--            dyn_name = get_dyn_name (input_section, h, rel,
-+            dyn_name = get_dyn_name (input_bfd, h, rel,
-                                      &dynh_buf, &dynh_buflen);
-             dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
-                                                 dyn_name, FALSE, FALSE);
-@@ -1410,7 +1410,7 @@
-             /* If this symbol has an entry in the PA64 dynamic hash
-                table, then get it.  */
--            dyn_name = get_dyn_name (input_section, h, rel,
-+            dyn_name = get_dyn_name (input_bfd, h, rel,
-                                      &dynh_buf, &dynh_buflen);
-             dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
-                                                 dyn_name, FALSE, FALSE);
-@@ -1426,7 +1426,7 @@
-           }
-         else if (h->root.type == bfd_link_hash_undefweak)
-             {
--            dyn_name = get_dyn_name (input_section, h, rel,
-+            dyn_name = get_dyn_name (input_bfd, h, rel,
-                                      &dynh_buf, &dynh_buflen);
-             dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
-                                                 dyn_name, FALSE, FALSE);
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf-m10200.c binutils-2.14.90.0.7/bfd/elf-m10200.c
---- binutils-2.14.90.0.7.orig/bfd/elf-m10200.c 2003-07-23 09:08:08.000000000 -0600
-+++ binutils-2.14.90.0.7/bfd/elf-m10200.c      2004-04-20 01:26:12.000000000 -0600
-@@ -373,7 +373,7 @@
-       {
-         sym = local_syms + r_symndx;
-         sec = local_sections[r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-       }
-       else
-       {
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf-m10300.c binutils-2.14.90.0.7/bfd/elf-m10300.c
---- binutils-2.14.90.0.7.orig/bfd/elf-m10300.c 2003-08-21 09:28:47.000000000 -0600
-+++ binutils-2.14.90.0.7/bfd/elf-m10300.c      2004-04-20 01:26:12.000000000 -0600
-@@ -1574,7 +1574,7 @@
-       {
-         sym = local_syms + r_symndx;
-         sec = local_sections[r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-       }
-       else
-       {
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf.c binutils-2.14.90.0.7/bfd/elf.c
---- binutils-2.14.90.0.7.orig/bfd/elf.c        2003-10-29 10:37:47.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/elf.c     2004-04-20 01:26:12.000000000 -0600
-@@ -7367,9 +7367,10 @@
- bfd_vma
- _bfd_elf_rela_local_sym (bfd *abfd,
-                        Elf_Internal_Sym *sym,
--                       asection *sec,
-+                       asection **psec,
-                        Elf_Internal_Rela *rel)
- {
-+  asection *sec = *psec;
-   bfd_vma relocation;
-   relocation = (sec->output_section->vma
-@@ -7379,16 +7380,14 @@
-       && ELF_ST_TYPE (sym->st_info) == STT_SECTION
-       && sec->sec_info_type == ELF_INFO_TYPE_MERGE)
-     {
--      asection *msec;
--
--      msec = sec;
-       rel->r_addend =
--      _bfd_merged_section_offset (abfd, &msec,
-+      _bfd_merged_section_offset (abfd, psec,
-                                   elf_section_data (sec)->sec_info,
-                                   sym->st_value + rel->r_addend,
--                                  0)
--      - relocation;
--      rel->r_addend += msec->output_section->vma + msec->output_offset;
-+                                  0);
-+      sec = *psec;
-+      rel->r_addend -= relocation;
-+      rel->r_addend += sec->output_section->vma + sec->output_offset;
-     }
-   return relocation;
- }
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-arm.h binutils-2.14.90.0.7/bfd/elf32-arm.h
---- binutils-2.14.90.0.7.orig/bfd/elf32-arm.h  2003-10-29 10:37:47.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/elf32-arm.h       2004-04-20 01:26:12.000000000 -0600
-@@ -84,6 +84,12 @@
- static void arm_add_to_rel
-   PARAMS ((bfd *, bfd_byte *, reloc_howto_type *, bfd_signed_vma));
- #endif
-+static bfd_boolean allocate_dynrelocs 
-+  PARAMS ((struct elf_link_hash_entry *h, PTR inf));
-+static bfd_boolean create_got_section 
-+  PARAMS ((bfd * dynobj, struct bfd_link_info * info));
-+static bfd_boolean elf32_arm_create_dynamic_sections 
-+  PARAMS ((bfd * dynobj, struct bfd_link_info * info));
- static enum elf_reloc_type_class elf32_arm_reloc_type_class
-   PARAMS ((const Elf_Internal_Rela *));
- static bfd_boolean elf32_arm_object_p
-@@ -119,6 +125,12 @@
-    section.  */
- #define ELF_DYNAMIC_INTERPRETER     "/usr/lib/ld.so.1"
-+#ifdef FOUR_WORD_PLT
-+
-+/* The size in bytes of the special first entry in the procedure
-+   linkage table.  */
-+#define PLT_HEADER_SIZE 16
-+
- /* The size in bytes of an entry in the procedure linkage table.  */
- #define PLT_ENTRY_SIZE 16
-@@ -126,23 +138,56 @@
-    this.  It is set up so that any shared library function that is
-    called before the relocation has been set up calls the dynamic
-    linker first.  */
--static const bfd_vma elf32_arm_plt0_entry [PLT_ENTRY_SIZE / 4] =
-+static const bfd_vma elf32_arm_plt0_entry [PLT_HEADER_SIZE / 4] =
-   {
--    0xe52de004,       /* str   lr, [sp, #-4]!     */
--    0xe59fe010,       /* ldr   lr, [pc, #16]      */
--    0xe08fe00e,       /* add   lr, pc, lr         */
--    0xe5bef008        /* ldr   pc, [lr, #8]!      */
-+    0xe52de004,               /* str   lr, [sp, #-4]! */
-+    0xe59fe010,               /* ldr   lr, [pc, #16]  */
-+    0xe08fe00e,               /* add   lr, pc, lr     */
-+    0xe5bef008,               /* ldr   pc, [lr, #8]!  */
-   };
- /* Subsequent entries in a procedure linkage table look like
-    this.  */
- static const bfd_vma elf32_arm_plt_entry [PLT_ENTRY_SIZE / 4] =
-- {
--   0xe59fc004,        /* ldr   ip, [pc, #4]       */
--   0xe08fc00c,        /* add   ip, pc, ip         */
--   0xe59cf000,        /* ldr   pc, [ip]           */
--   0x00000000 /* offset to symbol in got  */
-- };
-+  {
-+    0xe28fc600,               /* add   ip, pc, #NN    */
-+    0xe28cca00,               /* add   ip, ip, #NN    */
-+    0xe5bcf000,               /* ldr   pc, [ip, #NN]! */
-+    0x00000000,               /* unused               */
-+  };
-+
-+#else
-+
-+/* The size in bytes of the special first entry in the procedure
-+   linkage table.  */
-+#define PLT_HEADER_SIZE 20
-+
-+/* The size in bytes of an entry in the procedure linkage table.  */
-+#define PLT_ENTRY_SIZE 12
-+
-+/* The first entry in a procedure linkage table looks like
-+   this.  It is set up so that any shared library function that is
-+   called before the relocation has been set up calls the dynamic
-+   linker first.  */
-+static const bfd_vma elf32_arm_plt0_entry [PLT_HEADER_SIZE / 4] =
-+  {
-+    0xe52de004,               /* str   lr, [sp, #-4]! */
-+    0xe59fe004,               /* ldr   lr, [pc, #4]   */
-+    0xe08fe00e,               /* add   lr, pc, lr     */
-+    0xe5bef008,               /* ldr   pc, [lr, #8]!  */
-+    0x00000000,               /* &GOT[0] - .          */
-+  };
-+
-+/* Subsequent entries in a procedure linkage table look like
-+   this.  */
-+static const bfd_vma elf32_arm_plt_entry [PLT_ENTRY_SIZE / 4] =
-+  {
-+    0xe28fc600,               /* add   ip, pc, #0xNN00000 */
-+    0xe28cca00,               /* add   ip, ip, #0xNN000   */
-+    0xe5bcf000,               /* ldr   pc, [ip, #0xNNN]!  */
-+  };
-+
-+#endif
- /* The ARM linker needs to keep track of the number of relocs that it
-    decides to copy in check_relocs for each symbol.  This is so that
-@@ -152,14 +197,16 @@
- /* This structure keeps track of the number of PC relative relocs we
-    have copied for a given symbol.  */
--struct elf32_arm_pcrel_relocs_copied
-+struct elf32_arm_relocs_copied
-   {
-     /* Next section.  */
--    struct elf32_arm_pcrel_relocs_copied * next;
-+    struct elf32_arm_relocs_copied * next;
-     /* A section in dynobj.  */
-     asection * section;
-     /* Number of relocs copied in this section.  */
-     bfd_size_type count;
-+    /* Number of relocs copied in this section.  */
-+    bfd_size_type pc_count;
-   };
- /* Arm ELF linker hash entry.  */
-@@ -168,13 +215,9 @@
-     struct elf_link_hash_entry root;
-     /* Number of PC relative relocs copied for this symbol.  */
--    struct elf32_arm_pcrel_relocs_copied * pcrel_relocs_copied;
-+    struct elf32_arm_relocs_copied * relocs_copied;
-   };
--/* Declare this now that the above structures are defined.  */
--static bfd_boolean elf32_arm_discard_copies
--  PARAMS ((struct elf32_arm_link_hash_entry *, PTR));
--
- /* Traverse an arm ELF linker hash table.  */
- #define elf32_arm_link_hash_traverse(table, func, info)                       \
-   (elf_link_hash_traverse                                             \
-@@ -204,6 +247,18 @@
-     /* A boolean indicating whether knowledge of the ARM's pipeline
-        length should be applied by the linker.  */
-     int no_pipeline_knowledge;
-+
-+    /* Short-cuts to get to dynamic linker sections.  */
-+    asection *sgot;
-+    asection *sgotplt;
-+    asection *srelgot;
-+    asection *splt;
-+    asection *srelplt;
-+    asection *sdynbss;
-+    asection *srelbss;
-+
-+    /* Small local sym to section mapping cache.  */
-+    struct sym_sec_cache sym_sec;
-   };
- /* Create an entry in an ARM ELF linker hash table.  */
-@@ -231,11 +286,121 @@
-        _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret,
-                                    table, string));
-   if (ret != (struct elf32_arm_link_hash_entry *) NULL)
--    ret->pcrel_relocs_copied = NULL;
-+    ret->relocs_copied = NULL;
-   return (struct bfd_hash_entry *) ret;
- }
-+/* Create .got, .gotplt, and .rel.got sections in DYNOBJ, and set up
-+   shortcuts to them in our hash table.  */
-+
-+static bfd_boolean
-+create_got_section (dynobj, info)
-+     bfd *dynobj;
-+     struct bfd_link_info *info;
-+{
-+  struct elf32_arm_link_hash_table *htab;
-+
-+  if (! _bfd_elf_create_got_section (dynobj, info))
-+    return FALSE;
-+
-+  htab = elf32_arm_hash_table (info);
-+  htab->sgot = bfd_get_section_by_name (dynobj, ".got");
-+  htab->sgotplt = bfd_get_section_by_name (dynobj, ".got.plt");
-+  if (!htab->sgot || !htab->sgotplt)
-+    abort ();
-+
-+  htab->srelgot = bfd_make_section (dynobj, ".rel.got");
-+  if (htab->srelgot == NULL
-+      || ! bfd_set_section_flags (dynobj, htab->srelgot,
-+                                (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
-+                                 | SEC_IN_MEMORY | SEC_LINKER_CREATED
-+                                 | SEC_READONLY))
-+      || ! bfd_set_section_alignment (dynobj, htab->srelgot, 2))
-+    return FALSE;
-+  return TRUE;
-+}
-+
-+/* Create .plt, .rel.plt, .got, .got.plt, .rel.got, .dynbss, and
-+   .rel.bss sections in DYNOBJ, and set up shortcuts to them in our
-+   hash table.  */
-+
-+static bfd_boolean
-+elf32_arm_create_dynamic_sections (dynobj, info)
-+     bfd *dynobj;
-+     struct bfd_link_info *info;
-+{
-+  struct elf32_arm_link_hash_table *htab;
-+
-+  htab = elf32_arm_hash_table (info);
-+  if (!htab->sgot && !create_got_section (dynobj, info))
-+    return FALSE;
-+
-+  if (!_bfd_elf_create_dynamic_sections (dynobj, info))
-+    return FALSE;
-+
-+  htab->splt = bfd_get_section_by_name (dynobj, ".plt");
-+  htab->srelplt = bfd_get_section_by_name (dynobj, ".rel.plt");
-+  htab->sdynbss = bfd_get_section_by_name (dynobj, ".dynbss");
-+  if (!info->shared)
-+    htab->srelbss = bfd_get_section_by_name (dynobj, ".rel.bss");
-+
-+  if (!htab->splt || !htab->srelplt || !htab->sdynbss
-+      || (!info->shared && !htab->srelbss))
-+    abort ();
-+
-+  return TRUE;
-+}
-+
-+/* Copy the extra info we tack onto an elf_link_hash_entry.  */
-+
-+static void
-+elf32_arm_copy_indirect_symbol (const struct elf_backend_data *bed,
-+                              struct elf_link_hash_entry *dir,
-+                              struct elf_link_hash_entry *ind)
-+{
-+  struct elf32_arm_link_hash_entry *edir, *eind;
-+
-+  edir = (struct elf32_arm_link_hash_entry *) dir;
-+  eind = (struct elf32_arm_link_hash_entry *) ind;
-+
-+  if (eind->relocs_copied != NULL)
-+    {
-+      if (edir->relocs_copied != NULL)
-+      {
-+        struct elf32_arm_relocs_copied **pp;
-+        struct elf32_arm_relocs_copied *p;
-+
-+        if (ind->root.type == bfd_link_hash_indirect)
-+          abort ();
-+
-+        /* Add reloc counts against the weak sym to the strong sym
-+           list.  Merge any entries against the same section.  */
-+        for (pp = &eind->relocs_copied; (p = *pp) != NULL; )
-+          {
-+            struct elf32_arm_relocs_copied *q;
-+
-+            for (q = edir->relocs_copied; q != NULL; q = q->next)
-+              if (q->section == p->section)
-+                {
-+                  q->pc_count += p->pc_count;
-+                  q->count += p->count;
-+                  *pp = p->next;
-+                  break;
-+                }
-+            if (q == NULL)
-+              pp = &p->next;
-+          }
-+        *pp = edir->relocs_copied;
-+      }
-+
-+      edir->relocs_copied = eind->relocs_copied;
-+      eind->relocs_copied = NULL;
-+    }
-+
-+  _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
-+}
-+
- /* Create an ARM elf linker hash table.  */
- static struct bfd_link_hash_table *
-@@ -256,10 +421,18 @@
-       return NULL;
-     }
-+  ret->sgot = NULL;
-+  ret->sgotplt = NULL;
-+  ret->srelgot = NULL;
-+  ret->splt = NULL;
-+  ret->srelplt = NULL;
-+  ret->sdynbss = NULL;
-+  ret->srelbss = NULL;
-   ret->thumb_glue_size = 0;
-   ret->arm_glue_size = 0;
-   ret->bfd_of_glue_owner = NULL;
-   ret->no_pipeline_knowledge = 0;
-+  ret->sym_sec.abfd = NULL;
-   return &ret->root.root;
- }
-@@ -1134,16 +1307,21 @@
- #ifndef OLD_ARM_ABI
-     case R_ARM_XPC25:
- #endif
-+      /* r_symndx will be zero only for relocs against symbols
-+       from removed linkonce sections, or sections discarded by
-+       a linker script.  */
-+      if (r_symndx == 0)
-+      return bfd_reloc_ok;
-+
-       /* When generating a shared object, these relocations are copied
-        into the output file to be resolved at run time.  */
--      if (info->shared
--        && r_symndx != 0
--        && (r_type != R_ARM_PC24
--            || (h != NULL
--                && h->dynindx != -1
--                && (! info->symbolic
--                    || (h->elf_link_hash_flags
--                        & ELF_LINK_HASH_DEF_REGULAR) == 0))))
-+      if ((info->shared
-+         && (input_section->flags & SEC_ALLOC)
-+         && (h == NULL
-+             || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
-+             || h->root.type != bfd_link_hash_undefweak)
-+         && (r_type != R_ARM_PC24
-+             || !SYMBOL_CALLS_LOCAL (info, h))))
-       {
-         Elf_Internal_Rela outrel;
-         bfd_byte *loc;
-@@ -1184,30 +1362,19 @@
-         if (skip)
-           memset (&outrel, 0, sizeof outrel);
--        else if (r_type == R_ARM_PC24)
--          {
--            BFD_ASSERT (h != NULL && h->dynindx != -1);
--            if ((input_section->flags & SEC_ALLOC) == 0)
--              relocate = TRUE;
--            outrel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_PC24);
--          }
-+        else if (h != NULL
-+                 && h->dynindx != -1
-+                 && (r_type == R_ARM_PC24
-+                     || !info->shared
-+                     || !info->symbolic
-+                     || (h->elf_link_hash_flags
-+                         & ELF_LINK_HASH_DEF_REGULAR) == 0))
-+          outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
-         else
-           {
--            if (h == NULL
--                || ((info->symbolic || h->dynindx == -1)
--                    && (h->elf_link_hash_flags
--                        & ELF_LINK_HASH_DEF_REGULAR) != 0))
--              {
--                relocate = TRUE;
--                outrel.r_info = ELF32_R_INFO (0, R_ARM_RELATIVE);
--              }
--            else
--              {
--                BFD_ASSERT (h->dynindx != -1);
--                if ((input_section->flags & SEC_ALLOC) == 0)
--                  relocate = TRUE;
--                outrel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_ABS32);
--              }
-+            /* This symbol is local, or marked to become local.  */
-+            relocate = TRUE;
-+            outrel.r_info = ELF32_R_INFO (0, R_ARM_RELATIVE);
-           }
-         loc = sreloc->contents;
-@@ -1617,16 +1784,17 @@
-       if (h != NULL)
-       {
-         bfd_vma off;
--        bfd_boolean dyn = elf_hash_table (info)->dynamic_sections_created;
-+        bfd_boolean dyn;
-         off = h->got.offset;
-         BFD_ASSERT (off != (bfd_vma) -1);
-+        dyn = globals->root.dynamic_sections_created;
--        if (!WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
-+        if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
-             || (info->shared
--                && (info->symbolic || h->dynindx == -1
--                    || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
--                && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
-+                && SYMBOL_REFERENCES_LOCAL (info, h))
-+            || (ELF_ST_VISIBILITY (h->other)
-+                && h->root.type == bfd_link_hash_undefweak))
-           {
-             /* This is actually a static link, or it is a -Bsymbolic link
-                and the symbol is defined locally.  We must initialize this
-@@ -1712,7 +1880,8 @@
-                                contents, rel->r_offset, value,
-                                (bfd_vma) 0);
--      if (h->plt.offset == (bfd_vma) -1)
-+      if (h->plt.offset == (bfd_vma) -1
-+        || globals->splt == NULL)
-         /* We didn't make a PLT entry for this symbol.  This
-            happens when statically linking PIC code, or when
-            using -Bsymbolic.  */
-@@ -1958,7 +2127,7 @@
-             bfd_put_32 (input_bfd, value, contents + rel->r_offset);
-           }
- #else
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
- #endif
-       }
-       else
-@@ -1983,9 +2152,10 @@
-               case R_ARM_THM_PC22:
-                 if (info->shared
-                     && (
--                (!info->symbolic && h->dynindx != -1)
-+                        (!info->symbolic && h->dynindx != -1)
-                         || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
-                         )
-+                    && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
-                     && ((input_section->flags & SEC_ALLOC) != 0
-                         /* DWARF will emit R_ARM_ABS32 relocations in its
-                            sections against symbols defined externally
-@@ -2603,7 +2773,82 @@
-      asection *sec ATTRIBUTE_UNUSED;
-      const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED;
- {
--  /* We don't support garbage collection of GOT and PLT relocs yet.  */
-+  Elf_Internal_Shdr *symtab_hdr;
-+  struct elf_link_hash_entry **sym_hashes;
-+  bfd_signed_vma *local_got_refcounts;
-+  const Elf_Internal_Rela *rel, *relend;
-+  unsigned long r_symndx;
-+  struct elf_link_hash_entry *h;
-+
-+  elf_section_data (sec)->local_dynrel = NULL;
-+
-+  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
-+  sym_hashes = elf_sym_hashes (abfd);
-+  local_got_refcounts = elf_local_got_refcounts (abfd);
-+
-+  relend = relocs + sec->reloc_count;
-+  for (rel = relocs; rel < relend; rel++)
-+    switch (ELF32_R_TYPE (rel->r_info))
-+      {
-+      case R_ARM_GOT32:
-+      r_symndx = ELF32_R_SYM (rel->r_info);
-+      if (r_symndx >= symtab_hdr->sh_info)
-+        {
-+          h = sym_hashes[r_symndx - symtab_hdr->sh_info];
-+          if (h->got.refcount > 0)
-+            h->got.refcount -= 1;
-+        }
-+      else if (local_got_refcounts != NULL)
-+        {
-+          if (local_got_refcounts[r_symndx] > 0)
-+            local_got_refcounts[r_symndx] -= 1;
-+        }
-+      break;
-+
-+      case R_ARM_ABS32:
-+      case R_ARM_REL32:
-+      case R_ARM_PC24:
-+      r_symndx = ELF32_R_SYM (rel->r_info);
-+      if (r_symndx >= symtab_hdr->sh_info)
-+        {
-+          struct elf32_arm_link_hash_entry *eh;
-+          struct elf32_arm_relocs_copied **pp;
-+          struct elf32_arm_relocs_copied *p;
-+
-+          h = sym_hashes[r_symndx - symtab_hdr->sh_info];
-+
-+          if (!info->shared && h->plt.refcount > 0)
-+            h->plt.refcount -= 1;
-+
-+          eh = (struct elf32_arm_link_hash_entry *) h;
-+
-+          for (pp = &eh->relocs_copied; (p = *pp) != NULL; pp = &p->next)
-+            if (p->section == sec)
-+              {
-+                if (ELF32_R_TYPE (rel->r_info) == R_ARM_PC24)
-+                  p->pc_count -= 1;
-+                p->count -= 1;
-+                if (p->count == 0)
-+                  *pp = p->next;
-+                break;
-+              }
-+        }
-+      break;
-+
-+      case R_ARM_PLT32:
-+      r_symndx = ELF32_R_SYM (rel->r_info);
-+      if (r_symndx >= symtab_hdr->sh_info)
-+        {
-+          h = sym_hashes[r_symndx - symtab_hdr->sh_info];
-+          if (h->plt.refcount > 0)
-+            h->plt.refcount -= 1;
-+        }
-+      break;
-+
-+      default:
-+      break;
-+      }
-+
-   return TRUE;
- }
-@@ -2622,13 +2867,15 @@
-   const Elf_Internal_Rela *rel;
-   const Elf_Internal_Rela *rel_end;
-   bfd *dynobj;
--  asection *sgot, *srelgot, *sreloc;
-+  asection *sreloc;
-   bfd_vma *local_got_offsets;
-+  struct elf32_arm_link_hash_table *htab;
-   if (info->relocatable)
-     return TRUE;
--  sgot = srelgot = sreloc = NULL;
-+  htab = elf32_arm_hash_table (info);
-+  sreloc = NULL;
-   dynobj = elf_hash_table (info)->dynobj;
-   local_got_offsets = elf_local_got_offsets (abfd);
-@@ -2653,126 +2900,82 @@
-       else
-         h = sym_hashes[r_symndx - symtab_hdr->sh_info];
--      /* Some relocs require a global offset table.  */
--      if (dynobj == NULL)
--      {
--        switch (ELF32_R_TYPE (rel->r_info))
--          {
--          case R_ARM_GOT32:
--          case R_ARM_GOTOFF:
--          case R_ARM_GOTPC:
--            elf_hash_table (info)->dynobj = dynobj = abfd;
--            if (! _bfd_elf_create_got_section (dynobj, info))
--              return FALSE;
--            break;
--
--          default:
--            break;
--          }
--      }
--
-       switch (ELF32_R_TYPE (rel->r_info))
-         {
--        case R_ARM_GOT32:
--          /* This symbol requires a global offset table entry.  */
--          if (sgot == NULL)
--            {
--              sgot = bfd_get_section_by_name (dynobj, ".got");
--              BFD_ASSERT (sgot != NULL);
--            }
-+        case R_ARM_PLT32:
-+          /* This symbol requires a procedure linkage table entry.  We
-+               actually build the entry in adjust_dynamic_symbol,
-+               because this might be a case of linking PIC code which is
-+               never referenced by a dynamic object, in which case we
-+               don't need to generate a procedure linkage table entry
-+               after all.  */
--          /* Get the got relocation section if necessary.  */
--          if (srelgot == NULL
--              && (h != NULL || info->shared))
--            {
--              srelgot = bfd_get_section_by_name (dynobj, ".rel.got");
-+          /* If this is a local symbol, we resolve it directly without
-+               creating a procedure linkage table entry.  */
-+          if (h == NULL)
-+            continue;
--              /* If no got relocation section, make one and initialize.  */
--              if (srelgot == NULL)
--                {
--                  srelgot = bfd_make_section (dynobj, ".rel.got");
--                  if (srelgot == NULL
--                      || ! bfd_set_section_flags (dynobj, srelgot,
--                                                  (SEC_ALLOC
--                                                   | SEC_LOAD
--                                                   | SEC_HAS_CONTENTS
--                                                   | SEC_IN_MEMORY
--                                                   | SEC_LINKER_CREATED
--                                                   | SEC_READONLY))
--                      || ! bfd_set_section_alignment (dynobj, srelgot, 2))
--                    return FALSE;
--                }
--            }
-+          h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
-+          h->plt.refcount++;
-+          break;
-+        case R_ARM_GOT32:
-+          /* This symbol requires a global offset table entry.  */
-           if (h != NULL)
-             {
--              if (h->got.offset != (bfd_vma) -1)
--                /* We have already allocated space in the .got.  */
--                break;
--
--              h->got.offset = sgot->_raw_size;
--
--              /* Make sure this symbol is output as a dynamic symbol.  */
--              if (h->dynindx == -1)
--                if (! bfd_elf32_link_record_dynamic_symbol (info, h))
--                  return FALSE;
--
--              srelgot->_raw_size += sizeof (Elf32_External_Rel);
-+              h->got.refcount++;
-             }
-           else
-             {
--              /* This is a global offset table entry for a local
--                   symbol.  */
--              if (local_got_offsets == NULL)
-+              bfd_signed_vma *local_got_refcounts;
-+
-+              /* This is a global offset table entry for a local symbol.  */
-+              local_got_refcounts = elf_local_got_refcounts (abfd);
-+              if (local_got_refcounts == NULL)
-                 {
-                   bfd_size_type size;
--                  unsigned int i;
-                   size = symtab_hdr->sh_info;
--                  size *= sizeof (bfd_vma);
--                  local_got_offsets = (bfd_vma *) bfd_alloc (abfd, size);
--                  if (local_got_offsets == NULL)
-+                  size *= (sizeof (bfd_signed_vma) + sizeof(char));
-+                  local_got_refcounts = ((bfd_signed_vma *)
-+                                         bfd_zalloc (abfd, size));
-+                  if (local_got_refcounts == NULL)
-                     return FALSE;
--                  elf_local_got_offsets (abfd) = local_got_offsets;
--                  for (i = 0; i < symtab_hdr->sh_info; i++)
--                    local_got_offsets[i] = (bfd_vma) -1;
-+                  elf_local_got_refcounts (abfd) = local_got_refcounts;
-                 }
--
--              if (local_got_offsets[r_symndx] != (bfd_vma) -1)
--                /* We have already allocated space in the .got.  */
--                break;
--
--              local_got_offsets[r_symndx] = sgot->_raw_size;
--
--              if (info->shared)
--                /* If we are generating a shared object, we need to
--                   output a R_ARM_RELATIVE reloc so that the dynamic
--                   linker can adjust this GOT entry.  */
--                srelgot->_raw_size += sizeof (Elf32_External_Rel);
-+              local_got_refcounts[r_symndx] += 1;
-             }
--
--          sgot->_raw_size += 4;
-           break;
--        case R_ARM_PLT32:
--          /* This symbol requires a procedure linkage table entry.  We
--               actually build the entry in adjust_dynamic_symbol,
--               because this might be a case of linking PIC code which is
--               never referenced by a dynamic object, in which case we
--               don't need to generate a procedure linkage table entry
--               after all.  */
--
--          /* If this is a local symbol, we resolve it directly without
--               creating a procedure linkage table entry.  */
--          if (h == NULL)
--            continue;
--
--          h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
-+        case R_ARM_GOTOFF:
-+        case R_ARM_GOTPC:
-+          if (htab->sgot == NULL)
-+            {
-+              if (htab->root.dynobj == NULL)
-+                htab->root.dynobj = abfd;
-+              if (!create_got_section (htab->root.dynobj, info))
-+                return FALSE;
-+            }
-           break;
-         case R_ARM_ABS32:
-         case R_ARM_REL32:
-         case R_ARM_PC24:
-+          if (h != NULL && !info->shared)
-+            {
-+              /* If this reloc is in a read-only section, we might
-+                 need a copy reloc.  We can't check reliably at this
-+                 stage whether the section is read-only, as input
-+                 sections have not yet been mapped to output sections.
-+                 Tentatively set the flag for now, and correct in
-+                 adjust_dynamic_symbol.  */
-+              h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
-+              
-+              /* We may need a .plt entry if the function this reloc
-+                 refers to is in a shared lib.  */
-+              h->plt.refcount += 1;
-+            }
-+
-           /* If we are creating a shared library, and this is a reloc
-                against a global symbol, or a non PC relative reloc
-                against a local symbol, then we need to copy the reloc
-@@ -2784,14 +2987,17 @@
-                possible that DEF_REGULAR is not set now but will be set
-                later (it is never cleared).  We account for that
-                possibility below by storing information in the
--               pcrel_relocs_copied field of the hash table entry.  */
-+               relocs_copied field of the hash table entry.  */
-           if (info->shared
--            && (ELF32_R_TYPE (rel->r_info) != R_ARM_PC24
--              || (h != NULL
--                && (! info->symbolic
--                  || (h->elf_link_hash_flags
--                    & ELF_LINK_HASH_DEF_REGULAR) == 0))))
-+              && (sec->flags & SEC_ALLOC) != 0
-+              && (ELF32_R_TYPE (rel->r_info) != R_ARM_PC24
-+                  || (h != NULL
-+                      && (! info->symbolic
-+                          || (h->elf_link_hash_flags
-+                              & ELF_LINK_HASH_DEF_REGULAR) == 0))))
-             {
-+              struct elf32_arm_relocs_copied *p, **head;
-+
-               /* When creating a shared object, we must copy these
-                    reloc types into the output file.  We create a reloc
-                    section in dynobj and make room for this reloc.  */
-@@ -2825,45 +3031,49 @@
-                           || ! bfd_set_section_alignment (dynobj, sreloc, 2))
-                         return FALSE;
-                     }
--                if (sec->flags & SEC_READONLY)
--                  info->flags |= DF_TEXTREL;
-+
-+                  elf_section_data (sec)->sreloc = sreloc;
-                 }
--              sreloc->_raw_size += sizeof (Elf32_External_Rel);
--              /* If we are linking with -Bsymbolic, and this is a
--                   global symbol, we count the number of PC relative
--                   relocations we have entered for this symbol, so that
--                   we can discard them again if the symbol is later
--                   defined by a regular object.  Note that this function
--                   is only called if we are using an elf_i386 linker
--                   hash table, which means that h is really a pointer to
--                   an elf_i386_link_hash_entry.  */
--              if (h != NULL && info->symbolic
--                  && ELF32_R_TYPE (rel->r_info) == R_ARM_PC24)
-+              /* If this is a global symbol, we count the number of
-+                 relocations we need for this symbol.  */
-+              if (h != NULL)
-                 {
--                  struct elf32_arm_link_hash_entry * eh;
--                  struct elf32_arm_pcrel_relocs_copied * p;
--
--                  eh = (struct elf32_arm_link_hash_entry *) h;
--
--                  for (p = eh->pcrel_relocs_copied; p != NULL; p = p->next)
--                    if (p->section == sreloc)
--                      break;
--
-+                  head = &((struct elf32_arm_link_hash_entry *) h)->relocs_copied;
-+                }
-+              else
-+                {
-+                  /* Track dynamic relocs needed for local syms too.
-+                     We really need local syms available to do this
-+                     easily.  Oh well.  */
-+                  
-+                  asection *s;
-+                  s = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
-+                                                 sec, r_symndx);
-+                  if (s == NULL)
-+                    return FALSE;
-+                  
-+                  head = ((struct elf32_arm_relocs_copied **)
-+                          &elf_section_data (s)->local_dynrel);
-+                }
-+              
-+              p = *head;
-+              if (p == NULL || p->section != sec)
-+                {
-+                  bfd_size_type amt = sizeof *p;
-+                  p = bfd_alloc (htab->root.dynobj, amt);
-                   if (p == NULL)
--                    {
--                      p = ((struct elf32_arm_pcrel_relocs_copied *)
--                           bfd_alloc (dynobj, (bfd_size_type) sizeof * p));
--                      if (p == NULL)
--                        return FALSE;
--                      p->next = eh->pcrel_relocs_copied;
--                      eh->pcrel_relocs_copied = p;
--                      p->section = sreloc;
--                      p->count = 0;
--                    }
--
--                  ++p->count;
-+                    return FALSE;
-+                  p->next = *head;
-+                  *head = p;
-+                  p->section = sec;
-+                  p->count = 0;
-+                  p->pc_count = 0;
-                 }
-+              
-+              p->count += 1;
-+              if (ELF32_R_TYPE (rel->r_info) == R_ARM_PC24)
-+                p->pc_count += 1;
-             }
-           break;
-@@ -3003,71 +3213,29 @@
-   if (h->type == STT_FUNC
-       || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
-     {
--      /* If we link a program (not a DSO), we'll get rid of unnecessary
--       PLT entries; we point to the actual symbols -- even for pic
--       relocs, because a program built with -fpic should have the same
--       result as one built without -fpic, specifically considering weak
--       symbols.
--       FIXME: m68k and i386 differ here, for unclear reasons.  */
--      if (! info->shared
--        && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0)
-+      if (h->plt.refcount <= 0
-+        || SYMBOL_CALLS_LOCAL (info, h)
-+        || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
-+            && h->root.type == bfd_link_hash_undefweak))
-       {
-         /* This case can occur if we saw a PLT32 reloc in an input
--           file, but the symbol was not defined by a dynamic object.
--           In such a case, we don't actually need to build a
--           procedure linkage table, and we can just do a PC32 reloc
--           instead.  */
--        BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0);
-+           file, but the symbol was never referred to by a dynamic
-+           object, or if all references were garbage collected.  In
-+           such a case, we don't actually need to build a procedure
-+           linkage table, and we can just do a PC24 reloc instead.  */
-+        h->plt.offset = (bfd_vma) -1;
-         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
--        return TRUE;
--      }
--
--      /* Make sure this symbol is output as a dynamic symbol.  */
--      if (h->dynindx == -1)
--      {
--        if (! bfd_elf32_link_record_dynamic_symbol (info, h))
--          return FALSE;
-       }
--      s = bfd_get_section_by_name (dynobj, ".plt");
--      BFD_ASSERT (s != NULL);
--
--      /* If this is the first .plt entry, make room for the special
--       first entry.  */
--      if (s->_raw_size == 0)
--      s->_raw_size += PLT_ENTRY_SIZE;
--
--      /* If this symbol is not defined in a regular file, and we are
--       not generating a shared library, then set the symbol to this
--       location in the .plt.  This is required to make function
--       pointers compare as equal between the normal executable and
--       the shared library.  */
--      if (! info->shared
--        && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
--      {
--        h->root.u.def.section = s;
--        h->root.u.def.value = s->_raw_size;
--      }
--
--      h->plt.offset = s->_raw_size;
--
--      /* Make room for this entry.  */
--      s->_raw_size += PLT_ENTRY_SIZE;
--
--      /* We also need to make an entry in the .got.plt section, which
--       will be placed in the .got section by the linker script.  */
--      s = bfd_get_section_by_name (dynobj, ".got.plt");
--      BFD_ASSERT (s != NULL);
--      s->_raw_size += 4;
--
--      /* We also need to make an entry in the .rel.plt section.  */
--
--      s = bfd_get_section_by_name (dynobj, ".rel.plt");
--      BFD_ASSERT (s != NULL);
--      s->_raw_size += sizeof (Elf32_External_Rel);
--
-       return TRUE;
-     }
-+  else
-+    /* It's possible that we incorrectly decided a .plt reloc was
-+       needed for an R_ARM_PC24 reloc to a non-function sym in
-+       check_relocs.  We can't decide accurately between function and
-+       non-function syms in check-relocs;  Objects loaded later in
-+       the link may change h->type.  So fix it now.  */
-+    h->plt.offset = (bfd_vma) -1;
-   /* If this is a weak symbol, and there is a real definition, the
-      processor independent code will have arranged for us to see the
-@@ -3142,6 +3310,198 @@
-   return TRUE;
- }
-+/* Allocate space in .plt, .got and associated reloc sections for
-+   dynamic relocs.  */
-+
-+static bfd_boolean
-+allocate_dynrelocs (h, inf)
-+     struct elf_link_hash_entry *h;
-+     PTR inf;
-+{
-+  struct bfd_link_info *info;
-+  struct elf32_arm_link_hash_table *htab;
-+  struct elf32_arm_link_hash_entry *eh;
-+  struct elf32_arm_relocs_copied *p;
-+
-+  if (h->root.type == bfd_link_hash_indirect)
-+    return TRUE;
-+
-+  if (h->root.type == bfd_link_hash_warning)
-+    /* When warning symbols are created, they **replace** the "real"
-+       entry in the hash table, thus we never get to see the real
-+       symbol in a hash traversal.  So look at it now.  */
-+    h = (struct elf_link_hash_entry *) h->root.u.i.link;
-+
-+  info = (struct bfd_link_info *) inf;
-+  htab = elf32_arm_hash_table (info);
-+
-+  if (htab->root.dynamic_sections_created
-+      && h->plt.refcount > 0)
-+    {
-+      /* Make sure this symbol is output as a dynamic symbol.
-+       Undefined weak syms won't yet be marked as dynamic.  */
-+      if (h->dynindx == -1
-+        && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
-+      {
-+        if (! bfd_elf32_link_record_dynamic_symbol (info, h))
-+          return FALSE;
-+      }
-+
-+      if (info->shared
-+        || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h))
-+      {
-+        asection *s = htab->splt;
-+
-+        /* If this is the first .plt entry, make room for the special
-+           first entry.  */
-+        if (s->_raw_size == 0)
-+          s->_raw_size += PLT_HEADER_SIZE;
-+
-+        h->plt.offset = s->_raw_size;
-+
-+        /* If this symbol is not defined in a regular file, and we are
-+           not generating a shared library, then set the symbol to this
-+           location in the .plt.  This is required to make function
-+           pointers compare as equal between the normal executable and
-+           the shared library.  */
-+        if (! info->shared
-+            && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
-+          {
-+            h->root.u.def.section = s;
-+            h->root.u.def.value = h->plt.offset;
-+          }
-+
-+        /* Make room for this entry.  */
-+        s->_raw_size += PLT_ENTRY_SIZE;
-+
-+        /* We also need to make an entry in the .got.plt section, which
-+           will be placed in the .got section by the linker script.  */
-+        htab->sgotplt->_raw_size += 4;
-+
-+        /* We also need to make an entry in the .rel.plt section.  */
-+        htab->srelplt->_raw_size += sizeof (Elf32_External_Rel);
-+      }
-+      else
-+      {
-+        h->plt.offset = (bfd_vma) -1;
-+        h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
-+      }
-+    }
-+  else
-+    {
-+      h->plt.offset = (bfd_vma) -1;
-+      h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
-+    }
-+
-+  if (h->got.refcount > 0)
-+    {
-+      asection *s;
-+      bfd_boolean dyn;
-+
-+      /* Make sure this symbol is output as a dynamic symbol.
-+       Undefined weak syms won't yet be marked as dynamic.  */
-+      if (h->dynindx == -1
-+        && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
-+      {
-+        if (! bfd_elf32_link_record_dynamic_symbol (info, h))
-+          return FALSE;
-+      }
-+
-+      s = htab->sgot;
-+      h->got.offset = s->_raw_size;
-+      s->_raw_size += 4;
-+      dyn = htab->root.dynamic_sections_created;
-+      if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
-+         || h->root.type != bfd_link_hash_undefweak)
-+        && (info->shared
-+            || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
-+      htab->srelgot->_raw_size += sizeof (Elf32_External_Rel);
-+    }
-+  else
-+    h->got.offset = (bfd_vma) -1;
-+
-+  eh = (struct elf32_arm_link_hash_entry *) h;
-+  if (eh->relocs_copied == NULL)
-+    return TRUE;
-+
-+  /* In the shared -Bsymbolic case, discard space allocated for
-+     dynamic pc-relative relocs against symbols which turn out to be
-+     defined in regular objects.  For the normal shared case, discard
-+     space for pc-relative relocs that have become local due to symbol
-+     visibility changes.  */
-+
-+  if (info->shared)
-+    {
-+      /* The only reloc that uses pc_count is R_ARM_PC24, which will
-+       appear on a call or on something like ".long foo - .".  We
-+       want calls to protected symbols to resolve directly to the
-+       function rather than going via the plt.  If people want
-+       function pointer comparisons to work as expected then they
-+       should avoid writing assembly like ".long foo - .".  */
-+      if (SYMBOL_CALLS_LOCAL (info, h))
-+      {
-+        struct elf32_arm_relocs_copied **pp;
-+
-+        for (pp = &eh->relocs_copied; (p = *pp) != NULL; )
-+          {
-+            p->count -= p->pc_count;
-+            p->pc_count = 0;
-+            if (p->count == 0)
-+              *pp = p->next;
-+            else
-+              pp = &p->next;
-+          }
-+      }
-+
-+      /* Also discard relocs on undefined weak syms with non-default
-+       visibility.  */
-+      if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
-+        && h->root.type == bfd_link_hash_undefweak)
-+      eh->relocs_copied = NULL;
-+    }
-+  else
-+    {
-+      /* For the non-shared case, discard space for relocs against
-+       symbols which turn out to need copy relocs or are not
-+       dynamic.  */
-+
-+      if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
-+        && (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
-+             && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
-+            || (htab->root.dynamic_sections_created
-+                && (h->root.type == bfd_link_hash_undefweak
-+                    || h->root.type == bfd_link_hash_undefined))))
-+      {
-+        /* Make sure this symbol is output as a dynamic symbol.
-+           Undefined weak syms won't yet be marked as dynamic.  */
-+        if (h->dynindx == -1
-+            && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
-+          {
-+            if (! bfd_elf32_link_record_dynamic_symbol (info, h))
-+              return FALSE;
-+          }
-+
-+        /* If that succeeded, we know we'll be keeping all the
-+           relocs.  */
-+        if (h->dynindx != -1)
-+          goto keep;
-+      }
-+
-+      eh->relocs_copied = NULL;
-+
-+    keep: ;
-+    }
-+
-+  /* Finally, allocate space.  */
-+  for (p = eh->relocs_copied; p != NULL; p = p->next)
-+    {
-+      asection *sreloc = elf_section_data (p->section)->sreloc;
-+      sreloc->_raw_size += p->count * sizeof (Elf32_External_Rel);
-+    }
-+
-+  return TRUE;
-+}
-+
- /* Set the sizes of the dynamic sections.  */
- static bfd_boolean
-@@ -3153,7 +3513,10 @@
-   asection * s;
-   bfd_boolean plt;
-   bfd_boolean relocs;
-+  bfd *ibfd;
-+  struct elf32_arm_link_hash_table *htab;
-+  htab = elf32_arm_hash_table (info);
-   dynobj = elf_hash_table (info)->dynobj;
-   BFD_ASSERT (dynobj != NULL);
-@@ -3168,26 +3531,74 @@
-         s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
-       }
-     }
--  else
--    {
--      /* We may have created entries in the .rel.got section.
--         However, if we are not creating the dynamic sections, we will
--         not actually use these entries.  Reset the size of .rel.got,
--         which will cause it to get stripped from the output file
--         below.  */
--      s = bfd_get_section_by_name (dynobj, ".rel.got");
--      if (s != NULL)
--      s->_raw_size = 0;
--    }
--
--  /* If this is a -Bsymbolic shared link, then we need to discard all
--     PC relative relocs against symbols defined in a regular object.
--     We allocated space for them in the check_relocs routine, but we
--     will not fill them in in the relocate_section routine.  */
--  if (info->shared && info->symbolic)
--    elf32_arm_link_hash_traverse (elf32_arm_hash_table (info),
--                                elf32_arm_discard_copies,
--                                (PTR) NULL);
-+
-+  /* Set up .got offsets for local syms, and space for local dynamic
-+     relocs.  */
-+  for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
-+    {
-+      bfd_signed_vma *local_got;
-+      bfd_signed_vma *end_local_got;
-+      char *local_tls_type;
-+      bfd_size_type locsymcount;
-+      Elf_Internal_Shdr *symtab_hdr;
-+      asection *srel;
-+
-+      if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour)
-+      continue;
-+
-+      for (s = ibfd->sections; s != NULL; s = s->next)
-+      {
-+        struct elf32_arm_relocs_copied *p;
-+
-+        for (p = *((struct elf32_arm_relocs_copied **)
-+                   &elf_section_data (s)->local_dynrel);
-+             p != NULL;
-+             p = p->next)
-+          {
-+            if (!bfd_is_abs_section (p->section)
-+                && bfd_is_abs_section (p->section->output_section))
-+              {
-+                /* Input section has been discarded, either because
-+                   it is a copy of a linkonce section or due to
-+                   linker script /DISCARD/, so we'll be discarding
-+                   the relocs too.  */
-+              }
-+            else if (p->count != 0)
-+              {
-+                srel = elf_section_data (p->section)->sreloc;
-+                srel->_raw_size += p->count * sizeof (Elf32_External_Rel);
-+                if ((p->section->output_section->flags & SEC_READONLY) != 0)
-+                  info->flags |= DF_TEXTREL;
-+              }
-+          }
-+      }
-+
-+      local_got = elf_local_got_refcounts (ibfd);
-+      if (!local_got)
-+      continue;
-+
-+      symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
-+      locsymcount = symtab_hdr->sh_info;
-+      end_local_got = local_got + locsymcount;
-+      s = htab->sgot;
-+      srel = htab->srelgot;
-+      for (; local_got < end_local_got; ++local_got, ++local_tls_type)
-+      {
-+        if (*local_got > 0)
-+          {
-+            *local_got = s->_raw_size;
-+            s->_raw_size += 4;
-+            if (info->shared)
-+              srel->_raw_size += sizeof (Elf32_External_Rel);
-+          }
-+        else
-+          *local_got = (bfd_vma) -1;
-+      }
-+    }
-+
-+  /* Allocate global sym .plt and .got entries, and space for global
-+     sym dynamic relocs.  */
-+  elf_link_hash_traverse (&htab->root, allocate_dynrelocs, (PTR) info);
-   /* The check_relocs and adjust_dynamic_symbol entry points have
-      determined the sizes of the various dynamic sections.  Allocate
-@@ -3312,33 +3723,6 @@
-   return TRUE;
- }
--/* This function is called via elf32_arm_link_hash_traverse if we are
--   creating a shared object with -Bsymbolic.  It discards the space
--   allocated to copy PC relative relocs against symbols which are
--   defined in regular objects.  We allocated space for them in the
--   check_relocs routine, but we won't fill them in in the
--   relocate_section routine.  */
--
--static bfd_boolean
--elf32_arm_discard_copies (h, ignore)
--     struct elf32_arm_link_hash_entry * h;
--     PTR ignore ATTRIBUTE_UNUSED;
--{
--  struct elf32_arm_pcrel_relocs_copied * s;
--
--  if (h->root.root.type == bfd_link_hash_warning)
--    h = (struct elf32_arm_link_hash_entry *) h->root.root.u.i.link;
--
--  /* We only discard relocs for symbols defined in a regular object.  */
--  if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
--    return TRUE;
--
--  for (s = h->pcrel_relocs_copied; s != NULL; s = s->next)
--    s->section->_raw_size -= s->count * sizeof (Elf32_External_Rel);
--
--  return TRUE;
--}
--
- /* Finish up dynamic symbol handling.  We set the contents of various
-    dynamic sections here.  */
-@@ -3362,6 +3746,7 @@
-       bfd_vma got_offset;
-       Elf_Internal_Rela rel;
-       bfd_byte *loc;
-+      bfd_vma got_displacement;
-       /* This symbol has an entry in the procedure linkage table.  Set
-        it up.  */
-@@ -3377,35 +3762,43 @@
-        corresponds to this symbol.  This is the index of this symbol
-        in all the symbols for which we are making plt entries.  The
-        first entry in the procedure linkage table is reserved.  */
--      plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
-+      plt_index = (h->plt.offset - PLT_HEADER_SIZE) / PLT_ENTRY_SIZE;
-       /* Get the offset into the .got table of the entry that
-        corresponds to this function.  Each .got entry is 4 bytes.
-        The first three are reserved.  */
-       got_offset = (plt_index + 3) * 4;
-+      /* Calculate the displacement between the PLT slot and the
-+       entry in the GOT.  */
-+      got_displacement = (sgot->output_section->vma
-+                        + sgot->output_offset
-+                        + got_offset
-+                        - splt->output_section->vma
-+                        - splt->output_offset
-+                        - h->plt.offset
-+                        - 8);
-+
-+      BFD_ASSERT ((got_displacement & 0xf0000000) == 0);
-+
-       /* Fill in the entry in the procedure linkage table.  */
--      bfd_put_32 (output_bfd, elf32_arm_plt_entry[0],
-+      bfd_put_32 (output_bfd, elf32_arm_plt_entry[0] | ((got_displacement & 0x0ff00000) >> 20),
-                 splt->contents + h->plt.offset + 0);
--      bfd_put_32 (output_bfd, elf32_arm_plt_entry[1],
-+      bfd_put_32 (output_bfd, elf32_arm_plt_entry[1] | ((got_displacement & 0x000ff000) >> 12),
-                 splt->contents + h->plt.offset + 4);
--      bfd_put_32 (output_bfd, elf32_arm_plt_entry[2],
-+      bfd_put_32 (output_bfd, elf32_arm_plt_entry[2] | (got_displacement & 0x00000fff),
-                 splt->contents + h->plt.offset + 8);
--      bfd_put_32 (output_bfd,
--                    (sgot->output_section->vma
--                     + sgot->output_offset
--                     + got_offset
--                     - splt->output_section->vma
--                     - splt->output_offset
--                     - h->plt.offset - 12),
--                    splt->contents + h->plt.offset + 12);
-+#ifdef FOUR_WORD_PLT
-+      bfd_put_32 (output_bfd, elf32_arm_plt_entry[3],
-+                splt->contents + h->plt.offset + 12);
-+#endif
-       /* Fill in the entry in the global offset table.  */
-       bfd_put_32 (output_bfd,
-                 (splt->output_section->vma
-                  + splt->output_offset),
-                 sgot->contents + got_offset);
--
-+      
-       /* Fill in the entry in the .rel.plt section.  */
-       rel.r_offset = (sgot->output_section->vma
-                     + sgot->output_offset
-@@ -3446,16 +3839,20 @@
-                     + sgot->output_offset
-                     + (h->got.offset &~ (bfd_vma) 1));
--      /* If this is a -Bsymbolic link, and the symbol is defined
--       locally, we just want to emit a RELATIVE reloc.  The entry in
--       the global offset table will already have been initialized in
--       the relocate_section function.  */
-+      /* If this is a static link, or it is a -Bsymbolic link and the
-+       symbol is defined locally or was forced to be local because
-+       of a version file, we just want to emit a RELATIVE reloc.
-+       The entry in the global offset table will already have been
-+       initialized in the relocate_section function.  */
-       if (info->shared
--        && (info->symbolic || h->dynindx == -1)
--        && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
--      rel.r_info = ELF32_R_INFO (0, R_ARM_RELATIVE);
-+        && SYMBOL_REFERENCES_LOCAL (info, h))
-+      {
-+        BFD_ASSERT((h->got.offset & 1) != 0);
-+        rel.r_info = ELF32_R_INFO (0, R_ARM_RELATIVE);
-+      }
-       else
-       {
-+        BFD_ASSERT((h->got.offset & 1) == 0);
-         bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset);
-         rel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_GLOB_DAT);
-       }
-@@ -3609,10 +4006,26 @@
-       /* Fill in the first entry in the procedure linkage table.  */
-       if (splt->_raw_size > 0)
-       {
-+        bfd_vma got_displacement;
-+
-+        /* Calculate the displacement between the PLT slot and &GOT[0].  */
-+        got_displacement = (sgot->output_section->vma
-+                            + sgot->output_offset
-+                            - splt->output_section->vma
-+                            - splt->output_offset
-+                            - 16);
-+
-         bfd_put_32 (output_bfd, elf32_arm_plt0_entry[0], splt->contents +  0);
-         bfd_put_32 (output_bfd, elf32_arm_plt0_entry[1], splt->contents +  4);
-         bfd_put_32 (output_bfd, elf32_arm_plt0_entry[2], splt->contents +  8);
-         bfd_put_32 (output_bfd, elf32_arm_plt0_entry[3], splt->contents + 12);
-+#ifdef FOUR_WORD_PLT
-+        /* The displacement value goes in the otherwise-unused last word of
-+           the second entry.  */
-+        bfd_put_32 (output_bfd, got_displacement,        splt->contents + 28);
-+#else
-+        bfd_put_32 (output_bfd, got_displacement,        splt->contents + 16);
-+#endif
-       }
-       /* UnixWare sets the entsize of .plt to 4, although that doesn't
-@@ -3714,7 +4127,7 @@
- #define elf_backend_check_relocs                elf32_arm_check_relocs
- #define elf_backend_relocate_section          elf32_arm_relocate_section
- #define elf_backend_adjust_dynamic_symbol     elf32_arm_adjust_dynamic_symbol
--#define elf_backend_create_dynamic_sections   _bfd_elf_create_dynamic_sections
-+#define elf_backend_create_dynamic_sections     elf32_arm_create_dynamic_sections
- #define elf_backend_finish_dynamic_symbol     elf32_arm_finish_dynamic_symbol
- #define elf_backend_finish_dynamic_sections   elf32_arm_finish_dynamic_sections
- #define elf_backend_size_dynamic_sections     elf32_arm_size_dynamic_sections
-@@ -3723,7 +4136,9 @@
- #define elf_backend_object_p                  elf32_arm_object_p
- #define elf_backend_section_flags             elf32_arm_section_flags
- #define elf_backend_final_write_processing      elf32_arm_final_write_processing
-+#define elf_backend_copy_indirect_symbol        elf32_arm_copy_indirect_symbol
-+#define elf_backend_can_refcount    1
- #define elf_backend_can_gc_sections 1
- #define elf_backend_plt_readonly    1
- #define elf_backend_want_got_plt    1
-@@ -3733,7 +4148,7 @@
- #endif
- #define elf_backend_got_header_size   12
--#define elf_backend_plt_header_size   PLT_ENTRY_SIZE
-+#define elf_backend_plt_header_size   PLT_HEADER_SIZE
- #include "elf32-target.h"
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-avr.c binutils-2.14.90.0.7/bfd/elf32-avr.c
---- binutils-2.14.90.0.7.orig/bfd/elf32-avr.c  2003-07-23 09:08:08.000000000 -0600
-+++ binutils-2.14.90.0.7/bfd/elf32-avr.c       2004-04-20 01:26:12.000000000 -0600
-@@ -750,7 +750,7 @@
-       {
-         sym = local_syms + r_symndx;
-         sec = local_sections [r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-         name = bfd_elf_string_from_elf_section
-           (input_bfd, symtab_hdr->sh_link, sym->st_name);
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-cris.c binutils-2.14.90.0.7/bfd/elf32-cris.c
---- binutils-2.14.90.0.7.orig/bfd/elf32-cris.c 2003-08-21 09:28:47.000000000 -0600
-+++ binutils-2.14.90.0.7/bfd/elf32-cris.c      2004-04-20 01:26:12.000000000 -0600
-@@ -847,7 +847,7 @@
-       {
-         sym = local_syms + r_symndx;
-         sec = local_sections [r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-         symname = (bfd_elf_string_from_elf_section
-                    (input_bfd, symtab_hdr->sh_link, sym->st_name));
-@@ -1292,16 +1292,7 @@
-                   {
-                     long indx;
--                    if (h == NULL)
--                      sec = local_sections[r_symndx];
--                    else
--                      {
--                        BFD_ASSERT (h->root.type == bfd_link_hash_defined
--                                    || (h->root.type
--                                        == bfd_link_hash_defweak));
--                        sec = h->root.u.def.section;
--                      }
--                    if (sec != NULL && bfd_is_abs_section (sec))
-+                    if (bfd_is_abs_section (sec))
-                       indx = 0;
-                     else if (sec == NULL || sec->owner == NULL)
-                       {
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-fr30.c binutils-2.14.90.0.7/bfd/elf32-fr30.c
---- binutils-2.14.90.0.7.orig/bfd/elf32-fr30.c 2003-07-23 09:08:08.000000000 -0600
-+++ binutils-2.14.90.0.7/bfd/elf32-fr30.c      2004-04-20 01:26:12.000000000 -0600
-@@ -552,7 +552,7 @@
-       {
-         sym = local_syms + r_symndx;
-         sec = local_sections [r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-         name = bfd_elf_string_from_elf_section
-           (input_bfd, symtab_hdr->sh_link, sym->st_name);
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-frv.c binutils-2.14.90.0.7/bfd/elf32-frv.c
---- binutils-2.14.90.0.7.orig/bfd/elf32-frv.c  2003-10-29 10:37:47.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/elf32-frv.c       2004-04-20 01:26:12.000000000 -0600
-@@ -724,7 +724,7 @@
-       {
-         sym = local_syms + r_symndx;
-         sec = local_sections [r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-         name = bfd_elf_string_from_elf_section
-           (input_bfd, symtab_hdr->sh_link, sym->st_name);
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-h8300.c binutils-2.14.90.0.7/bfd/elf32-h8300.c
---- binutils-2.14.90.0.7.orig/bfd/elf32-h8300.c        2003-10-29 10:37:47.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/elf32-h8300.c     2004-04-20 01:26:12.000000000 -0600
-@@ -435,7 +435,7 @@
-       {
-         sym = local_syms + r_symndx;
-         sec = local_sections[r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-       }
-       else
-       {
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-hppa.c binutils-2.14.90.0.7/bfd/elf32-hppa.c
---- binutils-2.14.90.0.7.orig/bfd/elf32-hppa.c 2003-10-29 10:37:47.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/elf32-hppa.c      2004-04-20 01:26:12.000000000 -0600
-@@ -3408,7 +3408,7 @@
-         /* This is a local symbol, h defaults to NULL.  */
-         sym = local_syms + r_symndx;
-         sym_sec = local_sections[r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sym_sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sym_sec, rel);
-       }
-       else
-       {
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-i370.c binutils-2.14.90.0.7/bfd/elf32-i370.c
---- binutils-2.14.90.0.7.orig/bfd/elf32-i370.c 2003-07-23 09:08:08.000000000 -0600
-+++ binutils-2.14.90.0.7/bfd/elf32-i370.c      2004-04-20 01:26:12.000000000 -0600
-@@ -1210,7 +1210,7 @@
-         sec = local_sections[r_symndx];
-         sym_name = "<local symbol>";
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-         addend = rel->r_addend;
-       }
-       else
-@@ -1363,16 +1363,7 @@
-                   {
-                     long indx;
--                    if (h == NULL)
--                      sec = local_sections[r_symndx];
--                    else
--                      {
--                        BFD_ASSERT (h->root.type == bfd_link_hash_defined
--                                    || (h->root.type
--                                        == bfd_link_hash_defweak));
--                        sec = h->root.u.def.section;
--                      }
--                    if (sec != NULL && bfd_is_abs_section (sec))
-+                    if (bfd_is_abs_section (sec))
-                       indx = 0;
-                     else if (sec == NULL || sec->owner == NULL)
-                       {
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-i860.c binutils-2.14.90.0.7/bfd/elf32-i860.c
---- binutils-2.14.90.0.7.orig/bfd/elf32-i860.c 2003-10-29 10:37:47.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/elf32-i860.c      2004-04-20 01:26:12.000000000 -0600
-@@ -1104,7 +1104,7 @@
-       {
-         sym = local_syms + r_symndx;
-         sec = local_sections [r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-         name = bfd_elf_string_from_elf_section
-           (input_bfd, symtab_hdr->sh_link, sym->st_name);
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-m32r.c binutils-2.14.90.0.7/bfd/elf32-m32r.c
---- binutils-2.14.90.0.7.orig/bfd/elf32-m32r.c 2003-10-29 10:37:47.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/elf32-m32r.c      2004-04-20 01:26:12.000000000 -0600
-@@ -1107,7 +1107,7 @@
-             sec = local_sections[r_symndx];
-             sym_name = "<local symbol>";
- #if !USE_REL
--            relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+            relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-             addend = rel->r_addend;
- #else
-             /* FIXME: This won't handle local relocations against SEC_MERGE
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-m68k.c binutils-2.14.90.0.7/bfd/elf32-m68k.c
---- binutils-2.14.90.0.7.orig/bfd/elf32-m68k.c 2003-08-21 09:28:47.000000000 -0600
-+++ binutils-2.14.90.0.7/bfd/elf32-m68k.c      2004-04-20 01:26:12.000000000 -0600
-@@ -1403,7 +1403,7 @@
-       {
-         sym = local_syms + r_symndx;
-         sec = local_sections[r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-       }
-       else
-       {
-@@ -1657,16 +1657,7 @@
-                   {
-                     long indx;
--                    if (h == NULL)
--                      sec = local_sections[r_symndx];
--                    else
--                      {
--                        BFD_ASSERT (h->root.type == bfd_link_hash_defined
--                                    || (h->root.type
--                                        == bfd_link_hash_defweak));
--                        sec = h->root.u.def.section;
--                      }
--                    if (sec != NULL && bfd_is_abs_section (sec))
-+                    if (bfd_is_abs_section (sec))
-                       indx = 0;
-                     else if (sec == NULL || sec->owner == NULL)
-                       {
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-mcore.c binutils-2.14.90.0.7/bfd/elf32-mcore.c
---- binutils-2.14.90.0.7.orig/bfd/elf32-mcore.c        2003-10-29 10:37:48.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/elf32-mcore.c     2004-04-20 01:26:12.000000000 -0600
-@@ -467,7 +467,7 @@
-       {
-         sym = local_syms + r_symndx;
-         sec = local_sections [r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-         addend = rel->r_addend;
-       }
-       else
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-msp430.c binutils-2.14.90.0.7/bfd/elf32-msp430.c
---- binutils-2.14.90.0.7.orig/bfd/elf32-msp430.c       2003-08-21 09:28:47.000000000 -0600
-+++ binutils-2.14.90.0.7/bfd/elf32-msp430.c    2004-04-20 01:26:12.000000000 -0600
-@@ -449,7 +449,7 @@
-       {
-         sym = local_syms + r_symndx;
-         sec = local_sections[r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-         name = bfd_elf_string_from_elf_section
-             (input_bfd, symtab_hdr->sh_link, sym->st_name);
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-openrisc.c binutils-2.14.90.0.7/bfd/elf32-openrisc.c
---- binutils-2.14.90.0.7.orig/bfd/elf32-openrisc.c     2003-07-23 09:08:08.000000000 -0600
-+++ binutils-2.14.90.0.7/bfd/elf32-openrisc.c  2004-04-20 01:26:12.000000000 -0600
-@@ -375,7 +375,7 @@
-       {
-         sym = local_syms + r_symndx;
-         sec = local_sections[r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-         name = bfd_elf_string_from_elf_section
-           (input_bfd, symtab_hdr->sh_link, sym->st_name);
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-ppc.c binutils-2.14.90.0.7/bfd/elf32-ppc.c
---- binutils-2.14.90.0.7.orig/bfd/elf32-ppc.c  2003-10-29 10:37:48.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/elf32-ppc.c       2004-04-20 01:26:12.000000000 -0600
-@@ -4727,7 +4727,7 @@
-         sec = local_sections[r_symndx];
-         sym_name = bfd_elf_local_sym_name (input_bfd, sym);
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-       }
-       else
-       {
-@@ -5455,44 +5455,9 @@
-         break;
-       case R_PPC_RELAX32:
--        {
--          unsigned long r_symndx;
--          Elf_Internal_Sym *sym;
--          asection *sym_sec;
--          bfd_byte *hit_addr = 0;
--          bfd_vma value = 0;
--
--          r_symndx = ELF32_R_SYM (rel->r_info);
--
--          if (r_symndx < symtab_hdr->sh_info)
--            {
--              sym = local_syms + r_symndx;
--              sym_sec = local_sections[r_symndx];
--
--              value = _bfd_elf_rela_local_sym (output_bfd, sym, sym_sec, rel);
--            }
--          else
--            {
--              bfd_boolean warned;
--              bfd_boolean unresolved_reloc;
--
--              RELOC_FOR_GLOBAL_SYMBOL (h, elf_sym_hashes (input_bfd),
--                                       r_symndx, symtab_hdr,
--                                       value, sym_sec,
--                                       unresolved_reloc, info,
--                                       warned);
--              if (warned)
--                continue;
--            }
--          hit_addr = contents + rel->r_offset;
--          value += rel->r_addend;
--
--          r = ppc_elf_install_value (output_bfd, hit_addr, value, r_type);
--          if (r != bfd_reloc_ok)
--            break;
--          else
--            continue;
--        }
-+        ppc_elf_install_value (output_bfd, contents + rel->r_offset,
-+                               relocation + addend, r_type);
-+        continue;
-         /* Indirect .sdata relocation.  */
-       case R_PPC_EMB_SDAI16:
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-s390.c binutils-2.14.90.0.7/bfd/elf32-s390.c
---- binutils-2.14.90.0.7.orig/bfd/elf32-s390.c 2003-08-21 09:28:47.000000000 -0600
-+++ binutils-2.14.90.0.7/bfd/elf32-s390.c      2004-04-20 01:26:12.000000000 -0600
-@@ -2327,7 +2327,7 @@
-       {
-         sym = local_syms + r_symndx;
-         sec = local_sections[r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-       }
-       else
-       {
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-sh.c binutils-2.14.90.0.7/bfd/elf32-sh.c
---- binutils-2.14.90.0.7.orig/bfd/elf32-sh.c   2003-10-29 10:37:48.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/elf32-sh.c        2004-04-20 01:26:12.000000000 -0600
-@@ -4805,7 +4805,7 @@
-           }
-         else if (! howto->partial_inplace)
-           {
--            relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+            relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-             addend = rel->r_addend;
-           }
-         else if ((sec->flags & SEC_MERGE)
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-sparc.c binutils-2.14.90.0.7/bfd/elf32-sparc.c
---- binutils-2.14.90.0.7.orig/bfd/elf32-sparc.c        2003-08-21 09:28:48.000000000 -0600
-+++ binutils-2.14.90.0.7/bfd/elf32-sparc.c     2004-04-20 01:26:12.000000000 -0600
-@@ -2182,7 +2182,7 @@
-       {
-         sym = local_syms + r_symndx;
-         sec = local_sections[r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-       }
-       else
-       {
-@@ -2459,16 +2459,8 @@
-                     if (is_plt)
-                       sec = htab->splt;
--                    else if (h == NULL)
--                      sec = local_sections[r_symndx];
--                    else
--                      {
--                        BFD_ASSERT (h->root.type == bfd_link_hash_defined
--                                    || (h->root.type
--                                        == bfd_link_hash_defweak));
--                        sec = h->root.u.def.section;
--                      }
--                    if (sec != NULL && bfd_is_abs_section (sec))
-+
-+                    if (bfd_is_abs_section (sec))
-                       indx = 0;
-                     else if (sec == NULL || sec->owner == NULL)
-                       {
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-v850.c binutils-2.14.90.0.7/bfd/elf32-v850.c
---- binutils-2.14.90.0.7.orig/bfd/elf32-v850.c 2003-10-29 10:37:48.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/elf32-v850.c      2004-04-20 01:26:12.000000000 -0600
-@@ -1681,7 +1681,7 @@
-       {
-         sym = local_syms + r_symndx;
-         sec = local_sections[r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
- #if 0
-         {
-           char * name;
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-vax.c binutils-2.14.90.0.7/bfd/elf32-vax.c
---- binutils-2.14.90.0.7.orig/bfd/elf32-vax.c  2003-08-21 09:28:48.000000000 -0600
-+++ binutils-2.14.90.0.7/bfd/elf32-vax.c       2004-04-20 01:26:12.000000000 -0600
-@@ -1483,7 +1483,7 @@
-       {
-         sym = local_syms + r_symndx;
-         sec = local_sections[r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-       }
-       else
-       {
-@@ -1737,16 +1737,7 @@
-                   {
-                     long indx;
--                    if (h == NULL)
--                      sec = local_sections[r_symndx];
--                    else
--                      {
--                        BFD_ASSERT (h->root.type == bfd_link_hash_defined
--                                    || (h->root.type
--                                        == bfd_link_hash_defweak));
--                        sec = h->root.u.def.section;
--                      }
--                    if (sec != NULL && bfd_is_abs_section (sec))
-+                    if (bfd_is_abs_section (sec))
-                       indx = 0;
-                     else if (sec == NULL || sec->owner == NULL)
-                       {
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-xstormy16.c binutils-2.14.90.0.7/bfd/elf32-xstormy16.c
---- binutils-2.14.90.0.7.orig/bfd/elf32-xstormy16.c    2003-07-23 09:08:09.000000000 -0600
-+++ binutils-2.14.90.0.7/bfd/elf32-xstormy16.c 2004-04-20 01:26:12.000000000 -0600
-@@ -845,7 +845,7 @@
-       {
-         sym = local_syms + r_symndx;
-         sec = local_sections [r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-         name = bfd_elf_string_from_elf_section
-           (input_bfd, symtab_hdr->sh_link, sym->st_name);
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf32-xtensa.c binutils-2.14.90.0.7/bfd/elf32-xtensa.c
---- binutils-2.14.90.0.7.orig/bfd/elf32-xtensa.c       2003-10-29 10:37:48.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/elf32-xtensa.c    2004-04-20 01:26:12.000000000 -0600
-@@ -2004,7 +2004,7 @@
-       {
-         sym = local_syms + r_symndx;
-         sec = local_sections[r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-       }
-       else
-       {
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-alpha.c binutils-2.14.90.0.7/bfd/elf64-alpha.c
---- binutils-2.14.90.0.7.orig/bfd/elf64-alpha.c        2003-10-29 10:37:48.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/elf64-alpha.c     2004-04-20 01:26:12.000000000 -0600
-@@ -4394,9 +4394,11 @@
-       if (r_symndx < symtab_hdr->sh_info)
-       {
-+        asection *msec;
-         sym = local_syms + r_symndx;
-         sec = local_sections[r_symndx];
--        value = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        msec = sec;
-+        value = _bfd_elf_rela_local_sym (output_bfd, sym, &msec, rel);
-         /* If this is a tp-relative relocation against sym 0,
-            this is hackery from relax_section.  Force the value to
-@@ -4424,7 +4426,6 @@
-             && !gotent->reloc_xlated)
-           {
-             struct alpha_elf_got_entry *ent;
--            asection *msec;
-             for (ent = gotent; ent; ent = ent->next)
-               {
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-hppa.c binutils-2.14.90.0.7/bfd/elf64-hppa.c
---- binutils-2.14.90.0.7.orig/bfd/elf64-hppa.c 2003-10-29 10:37:48.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/elf64-hppa.c      2004-04-20 01:26:12.000000000 -0600
-@@ -173,7 +173,7 @@
-          PTR info));
- static const char *get_dyn_name
--  PARAMS ((asection *, struct elf_link_hash_entry *,
-+  PARAMS ((bfd *, struct elf_link_hash_entry *,
-          const Elf_Internal_Rela *, char **, size_t *));
- /* This must follow the definitions of the various derived linker
-@@ -446,13 +446,14 @@
-    allocate memory as necessary, possibly reusing PBUF/PLEN.  */
- static const char *
--get_dyn_name (sec, h, rel, pbuf, plen)
--     asection *sec;
-+get_dyn_name (abfd, h, rel, pbuf, plen)
-+     bfd *abfd;
-      struct elf_link_hash_entry *h;
-      const Elf_Internal_Rela *rel;
-      char **pbuf;
-      size_t *plen;
- {
-+  asection *sec = abfd->sections;
-   size_t nlen, tlen;
-   char *buf;
-   size_t len;
-@@ -858,7 +859,7 @@
-       continue;
-       /* Collect a canonical name for this address.  */
--      addr_name = get_dyn_name (sec, h, rel, &buf, &buf_len);
-+      addr_name = get_dyn_name (abfd, h, rel, &buf, &buf_len);
-       /* Collect the canonical entry data for this address.  */
-       dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-mmix.c binutils-2.14.90.0.7/bfd/elf64-mmix.c
---- binutils-2.14.90.0.7.orig/bfd/elf64-mmix.c 2003-10-29 10:37:48.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/elf64-mmix.c      2004-04-20 01:26:12.000000000 -0600
-@@ -1472,7 +1472,7 @@
-       {
-         sym = local_syms + r_symndx;
-         sec = local_sections [r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-         name = bfd_elf_string_from_elf_section
-           (input_bfd, symtab_hdr->sh_link, sym->st_name);
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-ppc.c binutils-2.14.90.0.7/bfd/elf64-ppc.c
---- binutils-2.14.90.0.7.orig/bfd/elf64-ppc.c  2003-10-29 10:37:48.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/elf64-ppc.c       2004-04-20 01:26:12.000000000 -0600
-@@ -7385,7 +7385,7 @@
-         sec = local_sections[r_symndx];
-         sym_name = bfd_elf_local_sym_name (input_bfd, sym);
-         sym_type = ELF64_ST_TYPE (sym->st_info);
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-         if (elf_section_data (sec) != NULL)
-           {
-             long *opd_sym_adjust;
-@@ -8178,7 +8178,9 @@
-         relocation = TOCstart;
-         if (r_symndx == 0)
-           relocation += htab->stub_group[input_section->id].toc_off;
--        else if (sec != NULL && !unresolved_reloc)
-+        else if (unresolved_reloc)
-+          ;
-+        else if (sec != NULL && sec->id <= htab->top_id)
-           relocation += htab->stub_group[sec->id].toc_off;
-         else
-           unresolved_reloc = TRUE;
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-s390.c binutils-2.14.90.0.7/bfd/elf64-s390.c
---- binutils-2.14.90.0.7.orig/bfd/elf64-s390.c 2003-08-21 09:28:48.000000000 -0600
-+++ binutils-2.14.90.0.7/bfd/elf64-s390.c      2004-04-20 01:26:12.000000000 -0600
-@@ -2297,7 +2297,7 @@
-       {
-         sym = local_syms + r_symndx;
-         sec = local_sections[r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-       }
-       else
-       {
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-sh64.c binutils-2.14.90.0.7/bfd/elf64-sh64.c
---- binutils-2.14.90.0.7.orig/bfd/elf64-sh64.c 2003-10-29 10:37:48.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/elf64-sh64.c      2004-04-20 01:26:12.000000000 -0600
-@@ -1582,7 +1582,7 @@
-           }
-         else if (! howto->partial_inplace)
-           {
--            relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+            relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-             relocation |= ((sym->st_other & STO_SH5_ISA32) != 0);
-           }
-         else if ((sec->flags & SEC_MERGE)
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-sparc.c binutils-2.14.90.0.7/bfd/elf64-sparc.c
---- binutils-2.14.90.0.7.orig/bfd/elf64-sparc.c        2003-08-21 09:28:48.000000000 -0600
-+++ binutils-2.14.90.0.7/bfd/elf64-sparc.c     2004-04-20 01:26:12.000000000 -0600
-@@ -2070,7 +2070,7 @@
-       {
-         sym = local_syms + r_symndx;
-         sec = local_sections[r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-       }
-       else
-       {
-@@ -2247,16 +2247,8 @@
-                       if (is_plt)
-                         sec = splt;
--                      else if (h == NULL)
--                        sec = local_sections[r_symndx];
--                      else
--                        {
--                          BFD_ASSERT (h->root.type == bfd_link_hash_defined
--                                      || (h->root.type
--                                          == bfd_link_hash_defweak));
--                          sec = h->root.u.def.section;
--                        }
--                      if (sec != NULL && bfd_is_abs_section (sec))
-+
-+                      if (bfd_is_abs_section (sec))
-                         indx = 0;
-                       else if (sec == NULL || sec->owner == NULL)
-                         {
-diff -urN binutils-2.14.90.0.7.orig/bfd/elf64-x86-64.c binutils-2.14.90.0.7/bfd/elf64-x86-64.c
---- binutils-2.14.90.0.7.orig/bfd/elf64-x86-64.c       2003-08-21 09:28:48.000000000 -0600
-+++ binutils-2.14.90.0.7/bfd/elf64-x86-64.c    2004-04-20 01:26:12.000000000 -0600
-@@ -1823,7 +1823,7 @@
-         sym = local_syms + r_symndx;
-         sec = local_sections[r_symndx];
--        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
-+        relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-       }
-       else
-       {
-@@ -2048,16 +2048,7 @@
-                   {
-                     long sindx;
--                    if (h == NULL)
--                      sec = local_sections[r_symndx];
--                    else
--                      {
--                        BFD_ASSERT (h->root.type == bfd_link_hash_defined
--                                    || (h->root.type
--                                        == bfd_link_hash_defweak));
--                        sec = h->root.u.def.section;
--                      }
--                    if (sec != NULL && bfd_is_abs_section (sec))
-+                    if (bfd_is_abs_section (sec))
-                       sindx = 0;
-                     else if (sec == NULL || sec->owner == NULL)
-                       {
-diff -urN binutils-2.14.90.0.7.orig/bfd/elfxx-ia64.c binutils-2.14.90.0.7/bfd/elfxx-ia64.c
---- binutils-2.14.90.0.7.orig/bfd/elfxx-ia64.c 2003-10-29 10:37:48.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/elfxx-ia64.c      2004-04-20 01:26:12.000000000 -0600
-@@ -3849,9 +3849,11 @@
-       if (r_symndx < symtab_hdr->sh_info)
-       {
-         /* Reloc against local symbol.  */
-+        asection *msec;
-         sym = local_syms + r_symndx;
-         sym_sec = local_sections[r_symndx];
--        value = _bfd_elf_rela_local_sym (output_bfd, sym, sym_sec, rel);
-+        msec = sym_sec;
-+        value = _bfd_elf_rela_local_sym (output_bfd, sym, &msec, rel);
-         if ((sym_sec->flags & SEC_MERGE)
-             && ELF_ST_TYPE (sym->st_info) == STT_SECTION
-             && sym_sec->sec_info_type == ELF_INFO_TYPE_MERGE)
-@@ -3862,7 +3864,6 @@
-             if (loc_h && ! loc_h->sec_merge_done)
-               {
-                 struct elfNN_ia64_dyn_sym_info *dynent;
--                asection *msec;
-                 for (dynent = loc_h->info; dynent; dynent = dynent->next)
-                   {
-diff -urN binutils-2.14.90.0.7.orig/bfd/opncls.c binutils-2.14.90.0.7/bfd/opncls.c
---- binutils-2.14.90.0.7.orig/bfd/opncls.c     2003-10-29 10:37:48.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/opncls.c  2004-04-20 01:26:11.000000000 -0600
-@@ -150,6 +150,13 @@
- {
-   bfd *nbfd;
-   const bfd_target *target_vec;
-+  struct stat s;
-+
-+  if (stat (filename, &s) == 0)
-+    if (S_ISDIR(s.st_mode)) {
-+      bfd_set_error (bfd_error_file_not_recognized);
-+      return NULL;
-+    }
-   nbfd = _bfd_new_bfd ();
-   if (nbfd == NULL)
-diff -urN binutils-2.14.90.0.7.orig/binutils/objcopy.c binutils-2.14.90.0.7/binutils/objcopy.c
---- binutils-2.14.90.0.7.orig/binutils/objcopy.c       2003-10-29 10:37:48.000000000 -0700
-+++ binutils-2.14.90.0.7/binutils/objcopy.c    2004-04-20 01:26:12.000000000 -0600
-@@ -27,6 +27,7 @@
- #include "libiberty.h"
- #include "budbg.h"
- #include "filenames.h"
-+#include "elf-bfd.h"
- #include <sys/stat.h>
- /* A list of symbols to explicitly strip out, or to keep.  A linked
-@@ -385,6 +386,7 @@
-   -g --strip-debug                 Remove all debugging symbols & sections\n\
-      --strip-unneeded              Remove all symbols not needed by relocations\n\
-   -N --strip-symbol <name>         Do not copy symbol <name>\n\
-+     --only-keep-debug             Strip everything but the debug information\n\
-   -K --keep-symbol <name>          Only copy symbol <name>\n\
-   -L --localize-symbol <name>      Force symbol <name> to be marked as a local\n\
-   -G --keep-global-symbol <name>   Localize all symbols except <name>\n\
-@@ -457,6 +459,7 @@
-   -s --strip-all                   Remove all symbol and relocation information\n\
-   -g -S -d --strip-debug           Remove all debugging symbols & sections\n\
-      --strip-unneeded              Remove all symbols not needed by relocations\n\
-+     --only-keep-debug             Strip everything but the debug information\n\
-   -N --strip-symbol=<name>         Do not copy symbol <name>\n\
-   -K --keep-symbol=<name>          Only copy symbol <name>\n\
-   -x --discard-all                 Remove all non-global symbols\n\
-@@ -734,7 +737,7 @@
-       return FALSE;
-     }
--  return strip_symbols == STRIP_NONDEBUG ? TRUE : FALSE;
-+  return FALSE;
- }
- /* Choose which symbol entries to copy; put the result in OSYMS.
-@@ -1806,6 +1809,13 @@
-   if (p != NULL && p->set_flags)
-     flags = p->flags | (flags & (SEC_HAS_CONTENTS | SEC_RELOC));
-+  else if (strip_symbols == STRIP_NONDEBUG && (flags & SEC_ALLOC) != 0)
-+    {
-+      flags &= ~(SEC_HAS_CONTENTS | SEC_LOAD);
-+      if (obfd->xvec->flavour == bfd_target_elf_flavour)
-+      elf_section_type (osection) = SHT_NOBITS;
-+    }
-+
-   if (!bfd_set_section_flags (obfd, osection, flags))
-     {
-       err = _("flags");
-@@ -1926,6 +1936,8 @@
-       }
-       bfd_set_reloc (obfd, osection, relcount == 0 ? NULL : relpp, relcount);
-+      if (relcount == 0)
-+      free (relpp);
-     }
-   isection->_cooked_size = isection->_raw_size;
-diff -urN binutils-2.14.90.0.7.orig/binutils/readelf.c binutils-2.14.90.0.7/binutils/readelf.c
---- binutils-2.14.90.0.7.orig/binutils/readelf.c       2003-10-29 10:37:48.000000000 -0700
-+++ binutils-2.14.90.0.7/binutils/readelf.c    2004-04-20 01:26:12.000000000 -0600
-@@ -6055,7 +6055,7 @@
-   bytes = section->sh_size;
--  if (bytes == 0)
-+  if (bytes == 0 || section->sh_type == SHT_NOBITS)
-     {
-       printf (_("\nSection '%s' has no data to dump.\n"),
-             SECTION_NAME (section));
-diff -urN binutils-2.14.90.0.7.orig/gprof/gprof.texi binutils-2.14.90.0.7/gprof/gprof.texi
---- binutils-2.14.90.0.7.orig/gprof/gprof.texi 2002-08-01 18:49:32.000000000 -0600
-+++ binutils-2.14.90.0.7/gprof/gprof.texi      2004-04-20 01:26:11.000000000 -0600
-@@ -137,6 +137,10 @@
- If more than one profile file is specified, the @code{gprof}
- output shows the sum of the profile information in the given profile files.
-+If you use gcc 2.95.x or 3.0 to compile your binaries, you may need
-+to add the @samp{-fprofile-arcs} to the compile command line in order
-+for the call graphs to be properly stored in gmon.out.
-+
- @code{Gprof} calculates the amount of time spent in each routine.
- Next, these times are propagated along the edges of the call graph.
- Cycles are discovered, and calls into a cycle are made to share the time
-@@ -181,7 +185,7 @@
- @c man end
- @c man begin SEEALSO
--monitor(3), profil(2), cc(1), prof(1), and the Info entry for @file{gprof}.
-+profil(2), cc(1), prof(1), and the Info entry for @file{gprof}.
- ``An Execution Profiler for Modular Programs'',
- by S. Graham, P. Kessler, M. McKusick;
-@@ -267,6 +271,11 @@
- options.  The same option, @samp{-pg}, alters either compilation or linking
- to do what is necessary for profiling.  Here are examples:
-+If you use gcc 2.95.x or 3.0.x, you may need to add the
-+@samp{-fprofile-arcs} option to the compile line along with @samp{-pg}
-+in order to allow the call-graphs to be properly included in the gmon.out
-+file.
-+
- @example
- cc -g -c myprog.c utils.c -pg
- cc -o myprog myprog.o utils.o -pg
-diff -urN binutils-2.14.90.0.7.orig/ld/Makefile.am binutils-2.14.90.0.7/ld/Makefile.am
---- binutils-2.14.90.0.7.orig/ld/Makefile.am   2003-10-29 10:37:48.000000000 -0700
-+++ binutils-2.14.90.0.7/ld/Makefile.am        2004-04-20 01:26:11.000000000 -0600
-@@ -19,7 +19,7 @@
- # We put the scripts in the directory $(scriptdir)/ldscripts.
- # We can't put the scripts in $(datadir) because the SEARCH_DIR
- # directives need to be different for native and cross linkers.
--scriptdir = $(tooldir)/lib
-+scriptdir = $(libdir)
- EMUL = @EMUL@
- EMULATION_OFILES = @EMULATION_OFILES@
-diff -urN binutils-2.14.90.0.7.orig/ld/Makefile.in binutils-2.14.90.0.7/ld/Makefile.in
---- binutils-2.14.90.0.7.orig/ld/Makefile.in   2003-10-29 10:37:48.000000000 -0700
-+++ binutils-2.14.90.0.7/ld/Makefile.in        2004-04-20 01:26:11.000000000 -0600
-@@ -128,7 +128,7 @@
- # We put the scripts in the directory $(scriptdir)/ldscripts.
- # We can't put the scripts in $(datadir) because the SEARCH_DIR
- # directives need to be different for native and cross linkers.
--scriptdir = $(tooldir)/lib
-+scriptdir = $(libdir)
- EMUL = @EMUL@
- EMULATION_OFILES = @EMULATION_OFILES@
-diff -urN binutils-2.14.90.0.7.orig/ld/emultempl/elf32.em binutils-2.14.90.0.7/ld/emultempl/elf32.em
---- binutils-2.14.90.0.7.orig/ld/emultempl/elf32.em    2003-08-21 09:28:48.000000000 -0600
-+++ binutils-2.14.90.0.7/ld/emultempl/elf32.em 2004-04-20 01:26:11.000000000 -0600
-@@ -679,6 +679,8 @@
-             && command_line.rpath == NULL)
-           {
-             lib_path = (const char *) getenv ("LD_RUN_PATH");
-+            if ((lib_path) && (strlen (lib_path) == 0))
-+                lib_path = NULL;
-             if (gld${EMULATION_NAME}_search_needed (lib_path, l->name,
-                                                     force))
-               break;
-@@ -855,6 +857,8 @@
-   rpath = command_line.rpath;
-   if (rpath == NULL)
-     rpath = (const char *) getenv ("LD_RUN_PATH");
-+  if ((rpath) && (strlen (rpath) == 0))
-+      rpath = NULL;
-   if (! (bfd_elf${ELFSIZE}_size_dynamic_sections
-        (output_bfd, command_line.soname, rpath,
-         command_line.filter_shlib,
-diff -urN binutils-2.14.90.0.7.orig/ltmain.sh binutils-2.14.90.0.7/ltmain.sh
---- binutils-2.14.90.0.7.orig/ltmain.sh        2002-03-22 15:06:16.000000000 -0700
-+++ binutils-2.14.90.0.7/ltmain.sh     2004-04-20 01:26:12.000000000 -0600
-@@ -4413,6 +4413,10 @@
-       # LD_LIBRARY_PATH before the program is installed.
-       $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
-       $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
-+      if test -n "$linkname"; then
-+        $show "(cd $output_objdir && $rm ../$linkname && $LN_S $output_objdir/$linkname ../$linkname)"
-+        $run eval '(cd $output_objdir && $rm ../$linkname && $LN_S $output_objdir/$linkname ../$linkname)' || exit $?
-+      fi
-       ;;
-     esac
-     exit 0
-diff -urN binutils-2.14.90.0.7.orig/opcodes/Makefile.am binutils-2.14.90.0.7/opcodes/Makefile.am
---- binutils-2.14.90.0.7.orig/opcodes/Makefile.am      2003-10-29 10:37:49.000000000 -0700
-+++ binutils-2.14.90.0.7/opcodes/Makefile.am   2004-04-20 01:26:12.000000000 -0600
-@@ -284,7 +284,7 @@
- libopcodes_la_SOURCES =  dis-buf.c disassemble.c dis-init.c
- libopcodes_la_DEPENDENCIES = $(OFILES) ../bfd/libbfd.la
--libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ ../bfd/libbfd.la
-+libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ -L../bfd -lbfd
- libopcodes_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@
- # libtool will build .libs/libopcodes.a.  We create libopcodes.a in
-diff -urN binutils-2.14.90.0.7.orig/opcodes/Makefile.in binutils-2.14.90.0.7/opcodes/Makefile.in
---- binutils-2.14.90.0.7.orig/opcodes/Makefile.in      2003-10-29 10:37:49.000000000 -0700
-+++ binutils-2.14.90.0.7/opcodes/Makefile.in   2004-04-20 01:26:12.000000000 -0600
-@@ -394,7 +394,7 @@
- libopcodes_la_SOURCES = dis-buf.c disassemble.c dis-init.c
- libopcodes_la_DEPENDENCIES = $(OFILES) ../bfd/libbfd.la
--libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ ../bfd/libbfd.la
-+libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ -L../bfd -lbfd
- libopcodes_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@
- # libtool will build .libs/libopcodes.a.  We create libopcodes.a in
-@@ -593,7 +593,7 @@
- all-recursive install-data-recursive install-exec-recursive \
- installdirs-recursive install-recursive uninstall-recursive install-info-recursive \
- check-recursive installcheck-recursive info-recursive dvi-recursive:
--      @set fnord $(MAKEFLAGS); amf=$$2; \
-+      @set fnord $$MAKEFLAGS; amf=$$2; \
-       dot_seen=no; \
-       target=`echo $@ | sed s/-recursive//`; \
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-@@ -613,7 +613,7 @@
- mostlyclean-recursive clean-recursive distclean-recursive \
- maintainer-clean-recursive:
--      @set fnord $(MAKEFLAGS); amf=$$2; \
-+      @set fnord $$MAKEFLAGS; amf=$$2; \
-       dot_seen=no; \
-       rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
-         rev="$$subdir $$rev"; \
-diff -urN binutils-2.14.90.0.7.orig/opcodes/alpha-opc.c binutils-2.14.90.0.7/opcodes/alpha-opc.c
---- binutils-2.14.90.0.7.orig/opcodes/alpha-opc.c      2003-01-21 11:21:34.000000000 -0700
-+++ binutils-2.14.90.0.7/opcodes/alpha-opc.c   2004-04-20 01:26:11.000000000 -0600
-@@ -1105,7 +1105,8 @@
-   { "wmb",            MFC(0x18,0x4400), BASE, ARG_NONE },
-   { "fetch",          MFC(0x18,0x8000), BASE, { ZA, PRB } },
-   { "fetch_m",                MFC(0x18,0xA000), BASE, { ZA, PRB } },
--  { "rpcc",           MFC(0x18,0xC000), BASE, { RA } },
-+  { "rpcc",           MFC(0x18,0xC000), BASE, { RA, ZB } },
-+  { "rpcc",           MFC(0x18,0xC000), BASE, { RA, RB } },   /* ev6 una */
-   { "rc",             MFC(0x18,0xE000), BASE, { RA } },
-   { "ecb",            MFC(0x18,0xE800), BASE, { ZA, PRB } },  /* ev56 una */
-   { "rs",             MFC(0x18,0xF000), BASE, { RA } },
-diff -urN binutils-2.14.90.0.7.orig/opcodes/m68k-opc.c binutils-2.14.90.0.7/opcodes/m68k-opc.c
---- binutils-2.14.90.0.7.orig/opcodes/m68k-opc.c       2003-10-29 10:37:49.000000000 -0700
-+++ binutils-2.14.90.0.7/opcodes/m68k-opc.c    2004-04-20 01:26:12.000000000 -0600
-@@ -847,15 +847,15 @@
- {"fmoved",    two(0xF000, 0x7400), two(0xF1C0, 0xFC7F), "IiF7ws", cfloat },
- {"fmovel",    two(0xF000, 0x4000), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
- {"fmovel",    two(0xF000, 0x6000), two(0xF1C0, 0xFC7F), "IiF7$l", mfloat },
-+/* FIXME: the next two variants should not permit moving an address
-+   register to anything but the floating point instruction register.  */
-+{"fmovel",    two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8%s", mfloat },
-+{"fmovel",    two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Ii*ls8", mfloat },
- {"fmovel",    two(0xF000, 0x4000), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
- {"fmovel",    two(0xF000, 0x6000), two(0xF1C0, 0xFC7F), "IiF7bs", cfloat },
-   /* Move the FP control registers */
- {"fmovel",    two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8ps", cfloat },
- {"fmovel",    two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Iibss8", cfloat },
--/* FIXME: the next two variants should not permit moving an address
--   register to anything but the floating point instruction register.  */
--{"fmovel",    two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8%s", mfloat },
--{"fmovel",    two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Ii*ls8", mfloat },
- {"fmovep",    two(0xF000, 0x4C00), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
- {"fmovep",    two(0xF000, 0x6C00), two(0xF1C0, 0xFC00), "IiF7~pkC", mfloat },
- {"fmovep",    two(0xF000, 0x7C00), two(0xF1C0, 0xFC0F), "IiF7~pDk", mfloat },
diff --git a/obsolete-buildroot/sources/binutils-uclibc-100-conf.patch b/obsolete-buildroot/sources/binutils-uclibc-100-conf.patch
deleted file mode 100644 (file)
index 6e36af2..0000000
+++ /dev/null
@@ -1,646 +0,0 @@
-diff -urN binutils-2.14.90.0.7.orig/bfd/config.bfd binutils-2.14.90.0.7/bfd/config.bfd
---- binutils-2.14.90.0.7.orig/bfd/config.bfd   2003-10-29 10:37:47.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/config.bfd        2004-04-20 01:37:12.000000000 -0600
-@@ -121,7 +121,7 @@
-     targ_defvec=ecoffalpha_little_vec
-     targ_selvecs=bfd_elf64_alpha_vec
-     ;;
--  alpha*-*-linux-gnu* | alpha*-*-elf*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
-     targ_defvec=bfd_elf64_alpha_vec
-     targ_selvecs=ecoffalpha_little_vec
-     ;;
-@@ -131,7 +131,7 @@
-   alpha*-*-*)
-     targ_defvec=ecoffalpha_little_vec
-     ;;
--  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
-+  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-linux-uclibc* | ia64*-*-kfreebsd*-gnu)
-     targ_defvec=bfd_elf64_ia64_little_vec
-     targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
-     ;;
-@@ -214,7 +214,7 @@
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
--  armeb-*-elf | arm*b-*-linux-gnu*)
-+  armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_bigarm_vec
-     targ_selvecs=bfd_elf32_littlearm_vec
-     ;;
-@@ -222,7 +222,7 @@
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
--  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | arm*-*-uclinux* | arm-*-kfreebsd*-gnu)
-+  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | arm*-*-uclinux* | arm*-*-linux-uclibc* | arm-*-kfreebsd*-gnu)
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
-@@ -355,7 +355,7 @@
-     ;;
- #ifdef BFD64
--  hppa*64*-*-linux-gnu*)
-+  hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_hppa_linux_vec
-     targ_selvecs=bfd_elf64_hppa_vec
-     ;;
-@@ -366,7 +366,7 @@
-     ;;
- #endif
--  hppa*-*-linux-gnu* | hppa*-*-netbsd*)
-+  hppa*-*-linux-gnu* | hppa*-*-netbsd* | hppa*-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_hppa_linux_vec
-     targ_selvecs=bfd_elf32_hppa_vec
-     ;;
-@@ -488,7 +488,7 @@
-     targ_selvecs=bfd_elf32_i386_vec
-     targ_underscore=yes
-     ;;
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_i386_vec
-     targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
-     targ64_selvecs=bfd_elf64_x86_64_vec
-@@ -502,7 +502,7 @@
-     targ_defvec=bfd_elf64_x86_64_vec
-     targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
-     ;;
--  x86_64-*-linux-gnu*)
-+  x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_x86_64_vec
-     targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
-     ;;
-@@ -662,7 +662,7 @@
-     targ_selvecs=bfd_elf32_m68k_vec
-     targ_underscore=yes
-     ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_m68k_vec
-     targ_selvecs=m68klinux_vec
-     ;;
-@@ -929,7 +929,8 @@
-     ;;
- #endif
-   powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
--  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
-+  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
-+  powerpc-*-rtems* | \
-   powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
-     targ_defvec=bfd_elf32_powerpc_vec
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
-@@ -961,8 +962,8 @@
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
-     ;;
-   powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
--  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
--  powerpcle-*-rtems*)
-+  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
-+  powerpcle-*-vxworks* | powerpcle-*-rtems*)
-     targ_defvec=bfd_elf32_powerpcle_vec
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
-     targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
-@@ -1110,7 +1111,7 @@
-     targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
-     targ_underscore=yes
-     ;;
--  sparc-*-linux-gnu*)
-+  sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_sparc_vec
-     targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
-     ;;
-@@ -1157,7 +1158,7 @@
-     targ_defvec=sunos_big_vec
-     targ_underscore=yes
-     ;;
--  sparc64-*-linux-gnu*)
-+  sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_sparc_vec
-     targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
-     ;;
-diff -urN binutils-2.14.90.0.7.orig/bfd/configure binutils-2.14.90.0.7/bfd/configure
---- binutils-2.14.90.0.7.orig/bfd/configure    2003-10-29 10:37:47.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/configure 2004-04-20 01:32:29.000000000 -0600
-@@ -1699,6 +1699,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -5278,7 +5283,7 @@
-   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
-       COREFILE=''
-       ;;
--  alpha*-*-linux-gnu*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/alphalinux.h"'
-       ;;
-@@ -5338,7 +5343,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386mach3.h"'
-       ;;
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386linux.h"'
-       ;;
-@@ -5388,7 +5393,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/hp300bsd.h"'
-       ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/m68klinux.h"'
-       ;;
-diff -urN binutils-2.14.90.0.7.orig/bfd/configure.in binutils-2.14.90.0.7/bfd/configure.in
---- binutils-2.14.90.0.7.orig/bfd/configure.in 2003-10-29 10:37:47.000000000 -0700
-+++ binutils-2.14.90.0.7/bfd/configure.in      2004-04-20 01:32:29.000000000 -0600
-@@ -178,7 +178,7 @@
-   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
-       COREFILE=''
-       ;;
--  alpha*-*-linux-gnu*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/alphalinux.h"'
-       ;;
-@@ -259,7 +259,7 @@
-       TRAD_HEADER='"hosts/i386mach3.h"'
-       ;;
- changequote(,)dnl
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
- changequote([,])dnl
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386linux.h"'
-@@ -312,7 +312,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/hp300bsd.h"'
-       ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/m68klinux.h"'
-       ;;
-diff -urN binutils-2.14.90.0.7.orig/config.sub binutils-2.14.90.0.7/config.sub
---- binutils-2.14.90.0.7.orig/config.sub       2003-08-21 09:28:47.000000000 -0600
-+++ binutils-2.14.90.0.7/config.sub    2004-04-20 01:32:29.000000000 -0600
-@@ -118,7 +118,7 @@
- # Here we must recognize all the valid KERNEL-OS combinations.
- maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
- case $maybe_os in
--  nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
-+  nto-qnx* | linux-gnu* | linux-uclibc* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
-     os=-$maybe_os
-     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
-     ;;
-@@ -1131,7 +1131,8 @@
-             | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-             | -chorusos* | -chorusrdb* \
-             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
--            | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
-+            | -mingw32* | -linux-gnu* | -linux-uclibc* \
-+            | -uxpv* | -beos* | -mpeix* | -udk* \
-             | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
-             | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-diff -urN binutils-2.14.90.0.7.orig/configure binutils-2.14.90.0.7/configure
---- binutils-2.14.90.0.7.orig/configure        2003-10-29 10:38:23.000000000 -0700
-+++ binutils-2.14.90.0.7/configure     2004-04-20 01:32:29.000000000 -0600
-@@ -1276,6 +1276,18 @@
-   i[3456789]86-*-freebsd* | i[3456789]86-*-kfreebsd*-gnu)
-     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-     ;;
-+  i[3456789]86-*-linux-uclibc)
-+    # This section makes it possible to build newlib natively on linux.
-+    # If we are using a cross compiler then don't configure newlib.
-+    if test x${is_cross_compiler} != xno ; then
-+      noconfigdirs="$noconfigdirs target-newlib"
-+    fi
-+    noconfigdirs="$noconfigdirs target-libgloss"
-+    # If we are not using a cross compiler, do configure newlib.
-+    # Note however, that newlib will only be configured in this situation
-+    # if the --with-newlib option has been given, because otherwise
-+    # 'target-newlib' will appear in skipdirs.
-+    ;;
-   i[3456789]86-*-linux*)
-     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
-     # not build java stuff by default.
-diff -urN binutils-2.14.90.0.7.orig/configure.in binutils-2.14.90.0.7/configure.in
---- binutils-2.14.90.0.7.orig/configure.in     2003-10-29 10:38:20.000000000 -0700
-+++ binutils-2.14.90.0.7/configure.in  2004-04-20 01:32:29.000000000 -0600
-@@ -515,6 +515,19 @@
-   i[[3456789]]86-*-freebsd* | i[[3456789]]86-*-kfreebsd*-gnu)
-     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-     ;;
-+  i[3456789]86-*-linux-uclibc)
-+    # This section makes it possible to build newlib natively on linux.
-+    # If we are using a cross compiler then don't configure newlib.
-+    if test x${is_cross_compiler} != xno ; then
-+      noconfigdirs="$noconfigdirs target-newlib"
-+    fi
-+    noconfigdirs="$noconfigdirs target-libgloss"
-+    build_modules=
-+    # If we are not using a cross compiler, do configure newlib.
-+    # Note however, that newlib will only be configured in this situation
-+    # if the --with-newlib option has been given, because otherwise
-+    # 'target-newlib' will appear in skipdirs.
-+    ;;
-   i[[3456789]]86-*-linux*)
-     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
-     # not build java stuff by default.
-diff -urN binutils-2.14.90.0.7.orig/demangler/configure binutils-2.14.90.0.7/demangler/configure
---- binutils-2.14.90.0.7.orig/demangler/configure      2003-10-29 10:38:20.000000000 -0700
-+++ binutils-2.14.90.0.7/demangler/configure   2004-04-20 01:32:29.000000000 -0600
-@@ -1380,6 +1380,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.14.90.0.7.orig/gas/configure binutils-2.14.90.0.7/gas/configure
---- binutils-2.14.90.0.7.orig/gas/configure    2003-10-29 10:37:48.000000000 -0700
-+++ binutils-2.14.90.0.7/gas/configure 2004-04-20 01:37:58.000000000 -0600
-@@ -3215,6 +3215,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -4028,6 +4033,7 @@
-       alpha*-*-osf*)                  fmt=ecoff ;;
-       alpha*-*-linuxecoff*)           fmt=ecoff ;;
-       alpha*-*-linux-gnu*)            fmt=elf em=linux ;;
-+      alpha*-*-linux-uclibc*)         fmt=elf em=linux ;;
-       alpha*-*-netbsd*)                       fmt=elf em=nbsd ;;
-       alpha*-*-openbsd*)              fmt=elf em=obsd ;;
-@@ -4044,6 +4050,7 @@
-       arm*-*-conix*)                  fmt=elf ;;
-       arm-*-linux*aout*)              fmt=aout em=linux ;;
-       arm*-*-linux-gnu*)              fmt=elf  em=linux ;;
-+      arm*-*-linux-uclibc*)           fmt=elf  em=linux ;;
-       arm*-*-uclinux*)                        fmt=elf  em=linux ;;
-       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
-       arm-*-*n*bsd*)                  fmt=aout em=nbsd ;;
-@@ -4058,6 +4065,7 @@
-       avr-*-*)                                fmt=elf ;;
-       cris-*-linux-gnu*)              fmt=multi bfd_gas=yes em=linux ;;
-+      cris-*-linux-uclibc*)           fmt=multi bfd_gas=yes em=linux ;;
-       cris-*-*)                               fmt=multi bfd_gas=yes ;;
-       d10v-*-*)                               fmt=elf ;;
-@@ -4114,7 +4122,9 @@
-       i386-*-linux*oldld)             fmt=aout em=linux ;;
-       i386-*-linux*coff*)             fmt=coff em=linux ;;
-       i386-*-linux-gnu*)              fmt=elf em=linux ;;
-+      i386-*-linux-uclibc*)           fmt=elf em=linux ;;
-       x86_64-*-linux-gnu*)            fmt=elf em=linux ;;
-+      x86_64-*-linux-uclibc*)         fmt=elf em=linux ;;
-       i386-*-lynxos*)                 fmt=coff em=lynx ;;
-       i386-*-sysv[45]*)                       fmt=elf ;;
-       i386-*-solaris*)                        fmt=elf ;;
-@@ -4175,6 +4185,7 @@
-       ia64-*-elf*)                    fmt=elf ;;
-       ia64-*-aix*)                    fmt=elf em=ia64aix ;;
-       ia64-*-linux-gnu*)              fmt=elf em=linux ;;
-+      ia64-*-linux-uclibc*)           fmt=elf em=linux ;;
-       ia64-*-hpux*)                   fmt=elf em=hpux ;;
-       ia64-*-netbsd*)                 fmt=elf em=nbsd ;;
-@@ -4201,6 +4212,7 @@
-       m68k-*-hpux*)                   fmt=hp300 em=hp300 ;;
-       m68k-*-linux*aout*)             fmt=aout em=linux ;;
-       m68k-*-linux-gnu*)              fmt=elf em=linux ;;
-+      m68k-*-linux-uclibc*)           fmt=elf em=linux ;;
-       m68k-*-gnu*)                    fmt=elf ;;
-       m68k-*-lynxos*)                 fmt=coff em=lynx ;;
-       m68k-*-netbsdelf*)              fmt=elf em=nbsd ;;
-@@ -4257,7 +4269,7 @@
-       ppc-*-beos*)                    fmt=coff ;;
-       ppc-*-*n*bsd* | ppc-*-elf*)     fmt=elf ;;
-       ppc-*-eabi* | ppc-*-sysv4*)     fmt=elf ;;
--      ppc-*-linux-gnu*)                       fmt=elf em=linux
-+      ppc-*-linux-uclibc* | ppc-*-linux-gnu*)                 fmt=elf em=linux
-           case "$endian" in
-               big)  ;;
-               *)    { { echo "$as_me:$LINENO: error: GNU/Linux must be configured big endian" >&5
-@@ -4286,7 +4298,9 @@
-       ppc-*-kaos*)                    fmt=elf ;;
-       s390x-*-linux-gnu*)             fmt=elf em=linux ;;
-+      s390x-*-linux-uclibc*)          fmt=elf em=linux ;;
-       s390-*-linux-gnu*)              fmt=elf em=linux ;;
-+      s390-*-linux-uclibc*)           fmt=elf em=linux ;;
-       sh*-*-linux*)                   fmt=elf em=linux
-           case ${cpu} in
-@@ -4319,6 +4333,7 @@
-       sparc-*-coff)                   fmt=coff ;;
-       sparc-*-linux*aout*)            fmt=aout em=linux ;;
-       sparc-*-linux-gnu*)             fmt=elf em=linux ;;
-+      sparc-*-linux-uclibc*)          fmt=elf em=linux ;;
-       sparc-*-lynxos*)                        fmt=coff em=lynx ;;
-       sparc-fujitsu-none)             fmt=aout ;;
-       sparc-*-elf)                    fmt=elf ;;
-diff -urN binutils-2.14.90.0.7.orig/gas/configure.in binutils-2.14.90.0.7/gas/configure.in
---- binutils-2.14.90.0.7.orig/gas/configure.in 2003-10-29 10:37:48.000000000 -0700
-+++ binutils-2.14.90.0.7/gas/configure.in      2004-04-20 01:38:23.000000000 -0600
-@@ -192,6 +192,7 @@
-       alpha*-*-osf*)                  fmt=ecoff ;;
-       alpha*-*-linuxecoff*)           fmt=ecoff ;;
-       alpha*-*-linux-gnu*)            fmt=elf em=linux ;;
-+      alpha*-*-linux-uclibc*)         fmt=elf em=linux ;;
-       alpha*-*-netbsd*)                       fmt=elf em=nbsd ;;
-       alpha*-*-openbsd*)              fmt=elf em=obsd ;;
-@@ -208,6 +209,7 @@
-       arm*-*-conix*)                  fmt=elf ;;
-       arm-*-linux*aout*)              fmt=aout em=linux ;;
-       arm*-*-linux-gnu*)              fmt=elf  em=linux ;;
-+      arm*-*-linux-uclibc*)           fmt=elf  em=linux ;;
-       arm*-*-uclinux*)                        fmt=elf  em=linux ;;
-       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
-       arm-*-*n*bsd*)                  fmt=aout em=nbsd ;;
-@@ -222,6 +224,7 @@
-       avr-*-*)                                fmt=elf ;;
-       cris-*-linux-gnu*)              fmt=multi bfd_gas=yes em=linux ;;
-+      cris-*-linux-uclibc*)           fmt=multi bfd_gas=yes em=linux ;;
-       cris-*-*)                               fmt=multi bfd_gas=yes ;;
-       d10v-*-*)                               fmt=elf ;;
-@@ -278,7 +281,9 @@
-       i386-*-linux*oldld)             fmt=aout em=linux ;;
-       i386-*-linux*coff*)             fmt=coff em=linux ;;
-       i386-*-linux-gnu*)              fmt=elf em=linux ;;
-+      i386-*-linux-uclibc*)           fmt=elf em=linux ;;
-       x86_64-*-linux-gnu*)            fmt=elf em=linux ;;
-+      x86_64-*-linux-uclibc*)         fmt=elf em=linux ;;
-       i386-*-lynxos*)                 fmt=coff em=lynx ;;
- changequote(,)dnl
-       i386-*-sysv[45]*)                       fmt=elf ;;
-@@ -332,6 +337,7 @@
-       ia64-*-elf*)                    fmt=elf ;;
-       ia64-*-aix*)                    fmt=elf em=ia64aix ;;
-       ia64-*-linux-gnu*)              fmt=elf em=linux ;;
-+      ia64-*-linux-uclibc*)           fmt=elf em=linux ;;
-       ia64-*-hpux*)                   fmt=elf em=hpux ;;
-       ia64-*-netbsd*)                 fmt=elf em=nbsd ;;
-@@ -358,6 +364,7 @@
-       m68k-*-hpux*)                   fmt=hp300 em=hp300 ;;
-       m68k-*-linux*aout*)             fmt=aout em=linux ;;
-       m68k-*-linux-gnu*)              fmt=elf em=linux ;;
-+      m68k-*-linux-uclibc*)           fmt=elf em=linux ;;
-       m68k-*-gnu*)                    fmt=elf ;;
-       m68k-*-lynxos*)                 fmt=coff em=lynx ;;
-       m68k-*-netbsdelf*)              fmt=elf em=nbsd ;;
-@@ -412,7 +419,7 @@
-       ppc-*-beos*)                    fmt=coff ;;
-       ppc-*-*n*bsd* | ppc-*-elf*)     fmt=elf ;;
-       ppc-*-eabi* | ppc-*-sysv4*)     fmt=elf ;;
--      ppc-*-linux-gnu*)                       fmt=elf em=linux
-+      ppc-*-linux-uclibc* | ppc-*-linux-gnu*)                 fmt=elf em=linux
-           case "$endian" in
-               big)  ;;
-               *)    AC_MSG_ERROR(GNU/Linux must be configured big endian) ;;
-@@ -434,7 +441,9 @@
-       ppc-*-kaos*)                    fmt=elf ;;
-       s390x-*-linux-gnu*)             fmt=elf em=linux ;;
-+      s390x-*-linux-uclibc*)          fmt=elf em=linux ;;
-       s390-*-linux-gnu*)              fmt=elf em=linux ;;
-+      s390-*-linux-uclibc*)           fmt=elf em=linux ;;
-       sh*-*-linux*)                   fmt=elf em=linux
-           case ${cpu} in
-@@ -467,6 +476,7 @@
-       sparc-*-coff)                   fmt=coff ;;
-       sparc-*-linux*aout*)            fmt=aout em=linux ;;
-       sparc-*-linux-gnu*)             fmt=elf em=linux ;;
-+      sparc-*-linux-uclibc*)          fmt=elf em=linux ;;
-       sparc-*-lynxos*)                        fmt=coff em=lynx ;;
-       sparc-fujitsu-none)             fmt=aout ;;
-       sparc-*-elf)                    fmt=elf ;;
-diff -urN binutils-2.14.90.0.7.orig/ld/configure binutils-2.14.90.0.7/ld/configure
---- binutils-2.14.90.0.7.orig/ld/configure     2003-05-05 15:46:49.000000000 -0600
-+++ binutils-2.14.90.0.7/ld/configure  2004-04-20 01:32:29.000000000 -0600
-@@ -1578,6 +1578,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.14.90.0.7.orig/ld/configure.tgt binutils-2.14.90.0.7/ld/configure.tgt
---- binutils-2.14.90.0.7.orig/ld/configure.tgt 2003-10-29 10:37:48.000000000 -0700
-+++ binutils-2.14.90.0.7/ld/configure.tgt      2004-04-20 01:32:29.000000000 -0600
-@@ -30,6 +30,7 @@
-                       targ_extra_emuls="criself crislinux"
-                       targ_extra_libpath=$targ_extra_emuls ;;
- cris-*-linux-gnu*)    targ_emul=crislinux ;;
-+cris-*-linux-uclibc*) targ_emul=crislinux ;;
- cris-*-*)             targ_emul=criself
-                       targ_extra_emuls="crisaout crislinux"
-                       targ_extra_libpath=$targ_extra_emuls ;;
-@@ -59,14 +60,16 @@
-                       tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
-                       tdir_sun4=sparc-sun-sunos4
-                       ;;
--sparc64-*-linux-gnu*) targ_emul=elf64_sparc
-+sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)        \
-+                      targ_emul=elf64_sparc
-                       targ_extra_emuls="elf32_sparc sparclinux sun4"
-                       targ_extra_libpath=elf32_sparc
-                       tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
-                       tdir_sparclinux=${tdir_elf32_sparc}aout
-                       tdir_sun4=sparc-sun-sunos4
-                       ;;
--sparc*-*-linux-gnu*)  targ_emul=elf32_sparc
-+sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
-+                      targ_emul=elf32_sparc
-                       targ_extra_emuls="sparclinux elf64_sparc sun4"
-                       targ_extra_libpath=elf64_sparc
-                       tdir_sparclinux=${targ_alias}aout
-@@ -125,7 +128,7 @@
- m68*-ericsson-ose)    targ_emul=sun3 ;;
- m68*-apple-aux*)      targ_emul=m68kaux ;;
- *-tandem-none)                targ_emul=st2000 ;;
--i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
-+i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
- i[3-7]86-*-nto-qnx*)  targ_emul=i386nto ;;
- i[3-7]86-*-vsta)      targ_emul=vsta ;;
- i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
-@@ -149,14 +152,16 @@
-                       tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
-                       ;;
- i[3-7]86-*-linux*oldld)       targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
--i[3-7]86-*-linux-gnu*)        targ_emul=elf_i386
-+i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
-+                      targ_emul=elf_i386
-                       targ_extra_emuls=i386linux
-                       if test x${want64} = xtrue; then
-                         targ_extra_emuls="$targ_extra_emuls elf_x86_64"
-                       fi
-                       tdir_i386linux=${targ_alias}aout
-                       ;;
--x86_64-*-linux-gnu*)  targ_emul=elf_x86_64
-+x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
-+                      targ_emul=elf_x86_64
-                       targ_extra_emuls="elf_i386 i386linux"
-                       targ_extra_libpath=elf_i386
-                       tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
-@@ -256,10 +261,13 @@
- arm9e-*-elf)          targ_emul=armelf ;;
- arm-*-oabi)           targ_emul=armelf_oabi ;;
- arm*b-*-linux-gnu*)   targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
-+arm*b-*-linux-uclibc*)        targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
- arm*-*-linux-gnu*)    targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
-+arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- arm*-*-uclinux*)      targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- arm*-*-conix*)                targ_emul=armelf ;;
--thumb-*-linux-gnu* | thumb-*-uclinux*)        targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
-+thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
-+                      targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- strongarm-*-coff)     targ_emul=armcoff ;;
- strongarm-*-elf)      targ_emul=armelf ;;
- strongarm-*-kaos*)    targ_emul=armelf ;;
-@@ -360,7 +368,8 @@
-                       targ_extra_emuls=m68kelf
-                       tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
-                       ;;
--m68k-*-linux-gnu*)    targ_emul=m68kelf
-+m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
-+                      targ_emul=m68kelf
-                       targ_extra_emuls=m68klinux
-                       tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
-                       ;;
-@@ -376,9 +385,9 @@
- m68*-*-psos*)         targ_emul=m68kpsos ;;
- m68*-*-rtemscoff*)    targ_emul=m68kcoff ;;
- m68*-*-rtems*)                targ_emul=m68kelf ;;
--hppa*64*-*-linux-gnu*)        targ_emul=hppa64linux ;;
-+hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)  targ_emul=hppa64linux ;;
- hppa*64*-*)           targ_emul=elf64hppa ;;
--hppa*-*-linux-gnu*)   targ_emul=hppalinux ;;
-+hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*)   targ_emul=hppalinux ;;
- hppa*-*-*elf*)                targ_emul=hppaelf ;;
- hppa*-*-lites*)               targ_emul=hppaelf ;;
- hppa*-*-netbsd*)      targ_emul=hppanbsd ;;
-@@ -422,16 +431,20 @@
- mips*-*-rtems*)               targ_emul=elf32ebmip ;;
- mips*el-*-vxworks*)   targ_emul=elf32elmip ;;
- mips*-*-vxworks*)     targ_emul=elf32ebmip ;;
--mips64*el-*-linux-gnu*)       targ_emul=elf32ltsmipn32
-+mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*) \
-+                      targ_emul=elf32ltsmipn32
-                       targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
-                       ;;
--mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
-+mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*) \
-+                      targ_emul=elf32btsmipn32
-                       targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
-                       ;;
--mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
-+mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*) \
-+                      targ_emul=elf32ltsmip
-                       targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
-                       ;;
--mips*-*-linux-gnu*)   targ_emul=elf32btsmip
-+mips*-*-linux-gnu* | mips*-*-linux-uclibc*) \
-+                      targ_emul=elf32btsmip
-                       targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
-                       ;;
- mips*-*-lnews*)               targ_emul=mipslnews ;;
-@@ -454,6 +467,10 @@
- alpha*-*-linux-gnu*)  targ_emul=elf64alpha targ_extra_emuls=alpha
-                       tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
-                       ;;
-+alpha*-*-linux-uclibc*)       targ_emul=elf64alpha targ_extra_emuls=alpha
-+                      # The following needs to be checked...
-+                      tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
-+                      ;;
- alpha*-*-osf*)                targ_emul=alpha ;;
- alpha*-*-gnu*)                targ_emul=elf64alpha ;;
- alpha*-*-netware*)    targ_emul=alpha ;;
-diff -urN binutils-2.14.90.0.7.orig/libtool.m4 binutils-2.14.90.0.7/libtool.m4
---- binutils-2.14.90.0.7.orig/libtool.m4       2003-05-05 15:46:46.000000000 -0600
-+++ binutils-2.14.90.0.7/libtool.m4    2004-04-20 01:32:29.000000000 -0600
-@@ -645,6 +645,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
-diff -urN binutils-2.14.90.0.7.orig/ltconfig binutils-2.14.90.0.7/ltconfig
---- binutils-2.14.90.0.7.orig/ltconfig 2003-10-29 10:37:47.000000000 -0700
-+++ binutils-2.14.90.0.7/ltconfig      2004-04-20 01:32:29.000000000 -0600
-@@ -603,6 +603,7 @@
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case $host_os in
- linux-gnu*) ;;
-+linux-uclibc*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
-@@ -1259,6 +1260,24 @@
-   dynamic_linker='GNU/Linux ld.so'
-   ;;
-+linux-uclibc*)
-+  version_type=linux
-+  need_lib_prefix=no
-+  need_version=no
-+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-+  soname_spec='${libname}${release}.so$major'
-+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-+  shlibpath_var=LD_LIBRARY_PATH
-+  shlibpath_overrides_runpath=no
-+  # This implies no fast_install, which is unacceptable.
-+  # Some rework will be needed to allow for fast_install
-+  # before this can be enabled.
-+  # Note: copied from linux-gnu, and may not be appropriate.
-+  hardcode_into_libs=yes
-+  # Assume using the uClibc dynamic linker.
-+  dynamic_linker="uClibc ld.so"
-+  ;;
-+
- netbsd*)
-   need_lib_prefix=no
-   need_version=no
diff --git a/obsolete-buildroot/sources/binutils-uclibc-200-build_modules.patch b/obsolete-buildroot/sources/binutils-uclibc-200-build_modules.patch
deleted file mode 100644 (file)
index e9f8e75..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-Get around an odd build failure.
-diff -urN binutils-2.14.90.0.6/configure binutils-2.14.90.0.6-uClibc/configure
---- binutils-2.14.90.0.6/configure     2003-08-21 10:29:32.000000000 -0500
-+++ binutils-2.14.90.0.6-uClibc/configure      2004-01-07 05:43:40.000000000 -0600
-@@ -906,6 +906,11 @@
- fi
-+case "$target" in
-+  *-*-*-uclibc*)
-+    build_modules=
-+    ;;
-+esac
- ################################################################################
- srcname="gnu development package"
-diff -urN binutils-2.14.90.0.6/configure.in binutils-2.14.90.0.6-uClibc/configure.in
---- binutils-2.14.90.0.6/configure.in  2003-08-21 10:29:30.000000000 -0500
-+++ binutils-2.14.90.0.6-uClibc/configure.in   2004-01-07 05:44:02.000000000 -0600
-@@ -178,6 +178,11 @@
- fi
-+case "$target" in
-+  *-*-*-uclibc*)
-+    build_modules=
-+    ;;
-+esac
- ################################################################################
- srcname="gnu development package"
diff --git a/obsolete-buildroot/sources/binutils-uclibc-210-cflags.patch b/obsolete-buildroot/sources/binutils-uclibc-210-cflags.patch
deleted file mode 100644 (file)
index dc67d3c..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-diff -urN binutils-2.14.90.0.6/bfd/doc/Makefile.am binutils-2.14.90.0.6.new/bfd/doc/Makefile.am
---- binutils-2.14.90.0.6/bfd/doc/Makefile.am   2003-07-23 10:08:09.000000000 -0500
-+++ binutils-2.14.90.0.6.new/bfd/doc/Makefile.am       2004-03-01 16:05:16.000000000 -0600
-@@ -55,10 +55,10 @@
- MKDOC = chew$(EXEEXT_FOR_BUILD)
- $(MKDOC): chew.o
--      $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS)
-+      $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS)
- chew.o: chew.c
--      $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
-+      $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c
- protos: libbfd.h libcoff.h bfd.h
-diff -urN binutils-2.14.90.0.6/bfd/doc/Makefile.in binutils-2.14.90.0.6.new/bfd/doc/Makefile.in
---- binutils-2.14.90.0.6/bfd/doc/Makefile.in   2003-07-23 10:08:09.000000000 -0500
-+++ binutils-2.14.90.0.6.new/bfd/doc/Makefile.in       2004-03-01 16:05:03.000000000 -0600
-@@ -469,10 +469,10 @@
- $(MKDOC): chew.o
--      $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS)
-+      $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS)
- chew.o: chew.c
--      $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
-+      $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c
- protos: libbfd.h libcoff.h bfd.h
diff --git a/obsolete-buildroot/sources/boa-config.site-i386 b/obsolete-buildroot/sources/boa-config.site-i386
deleted file mode 100644 (file)
index 425d948..0000000
+++ /dev/null
@@ -1 +0,0 @@
-ac_cv_func_setvbuf_reversed=no
diff --git a/obsolete-buildroot/sources/boa.conf b/obsolete-buildroot/sources/boa.conf
deleted file mode 100644 (file)
index 91653e5..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-# Boa v0.94 configuration file
-# File format has not changed from 0.93
-# File format has changed little from 0.92
-# version changes are noted in the comments
-#
-# The Boa configuration file is parsed with a lex/yacc or flex/bison
-# generated parser.  If it reports an error, the line number will be
-# provided; it should be easy to spot.  The syntax of each of these
-# rules is very simple, and they can occur in any order.  Where possible
-# these directives mimic those of NCSA httpd 1.3; I saw no reason to 
-# introduce gratuitous differences.
-
-# $Id$
-
-# The "ServerRoot" is not in this configuration file.  It can be compiled
-# into the server (see defines.h) or specified on the command line with
-# the -c option, for example:
-#
-# boa -c /usr/local/boa
-
-
-# Port: The port Boa runs on.  The default port for http servers is 80.
-# If it is less than 1024, the server must be started as root.
-
-Port 80
-
-# Listen: the Internet address to bind(2) to.  If you leave it out,
-# it takes the behavior before 0.93.17.2, which is to bind to all
-# addresses (INADDR_ANY).  You only get one "Listen" directive,
-# if you want service on multiple IP addresses, you have three choices:
-#    1. Run boa without a "Listen" directive
-#       a. All addresses are treated the same; makes sense if the addresses
-#          are localhost, ppp, and eth0.
-#       b. Use the VirtualHost directive below to point requests to different
-#          files.  Should be good for a very large number of addresses (web
-#          hosting clients).
-#    2. Run one copy of boa per IP address, each has its own configuration
-#       with a "Listen" directive.  No big deal up to a few tens of addresses.
-#       Nice separation between clients.
-# The name you provide gets run through inet_aton(3), so you have to use dotted
-# quad notation.  This configuration is too important to trust some DNS.
-
-#Listen 192.68.0.5
-
-#  User: The name or UID the server should run as.
-# Group: The group name or GID the server should run as.
-
-User nobody
-Group nobody
-
-# ServerAdmin: The email address where server problems should be sent.
-# Note: this is not currently used, except as an environment variable
-# for CGIs.
-
-#ServerAdmin root@localhost
-
-# ErrorLog: The location of the error log file. If this does not start
-# with /, it is considered relative to the server root.
-# Set to /dev/null if you don't want errors logged.
-# If unset, defaults to /dev/stderr
-
-ErrorLog /var/log/boa/error_log
-# Please NOTE: Sending the logs to a pipe ('|'), as shown below,
-#  is somewhat experimental and might fail under heavy load.
-# "Usual libc implementations of printf will stall the whole
-#  process if the receiving end of a pipe stops reading."
-#ErrorLog "|/usr/sbin/cronolog --symlink=/var/log/boa/error_log /var/log/boa/error-%Y%m%d.log"
-
-# AccessLog: The location of the access log file. If this does not
-# start with /, it is considered relative to the server root.
-# Comment out or set to /dev/null (less effective) to disable 
-# Access logging.
-
-AccessLog /var/log/boa/access_log
-# Please NOTE: Sending the logs to a pipe ('|'), as shown below,
-#  is somewhat experimental and might fail under heavy load.
-# "Usual libc implementations of printf will stall the whole
-#  process if the receiving end of a pipe stops reading."
-#AccessLog  "|/usr/sbin/cronolog --symlink=/var/log/boa/access_log /var/log/boa/access-%Y%m%d.log"
-
-# UseLocaltime: Logical switch.  Uncomment to use localtime 
-# instead of UTC time
-#UseLocaltime
-
-# VerboseCGILogs: this is just a logical switch.
-#  It simply notes the start and stop times of cgis in the error log
-# Comment out to disable.
-
-#VerboseCGILogs
-
-# ServerName: the name of this server that should be sent back to 
-# clients if different than that returned by gethostname + gethostbyname 
-
-#ServerName www.your.org.here
-
-# VirtualHost: a logical switch.
-# Comment out to disable.
-# Given DocumentRoot /var/www, requests on interface 'A' or IP 'IP-A'
-# become /var/www/IP-A.
-# Example: http://localhost/ becomes /var/www/127.0.0.1
-#
-# Not used until version 0.93.17.2.  This "feature" also breaks commonlog
-# output rules, it prepends the interface number to each access_log line.
-# You are expected to fix that problem with a postprocessing script.
-
-#VirtualHost 
-
-# DocumentRoot: The root directory of the HTML documents.
-# Comment out to disable server non user files.
-
-DocumentRoot /var/www
-
-# UserDir: The name of the directory which is appended onto a user's home
-# directory if a ~user request is recieved.
-
-UserDir public_html
-
-# DirectoryIndex: Name of the file to use as a pre-written HTML
-# directory index.  Please MAKE AND USE THESE FILES.  On the
-# fly creation of directory indexes can be _slow_.
-# Comment out to always use DirectoryMaker
-
-DirectoryIndex index.html
-
-# DirectoryMaker: Name of program used to create a directory listing.
-# Comment out to disable directory listings.  If both this and
-# DirectoryIndex are commented out, accessing a directory will give
-# an error (though accessing files in the directory are still ok).
-
-DirectoryMaker /usr/lib/boa/boa_indexer
-
-# DirectoryCache: If DirectoryIndex doesn't exist, and DirectoryMaker
-# has been commented out, the the on-the-fly indexing of Boa can be used
-# to generate indexes of directories. Be warned that the output is 
-# extremely minimal and can cause delays when slow disks are used.
-# Note: The DirectoryCache must be writable by the same user/group that 
-# Boa runs as.
-
-# DirectoryCache /var/spool/boa/dircache
-
-# KeepAliveMax: Number of KeepAlive requests to allow per connection
-# Comment out, or set to 0 to disable keepalive processing
-
-KeepAliveMax 1000
-
-# KeepAliveTimeout: seconds to wait before keepalive connection times out
-
-KeepAliveTimeout 10
-
-# MimeTypes: This is the file that is used to generate mime type pairs
-# and Content-Type fields for boa.
-# Set to /dev/null if you do not want to load a mime types file.
-# Do *not* comment out (better use AddType!)
-
-MimeTypes /etc/mime.types
-
-# DefaultType: MIME type used if the file extension is unknown, or there
-# is no file extension.
-
-DefaultType text/plain
-
-# AddType: adds types without editing mime.types
-# Example: AddType type extension [extension ...]
-
-# Uncomment the next line if you want .cgi files to execute from anywhere
-#AddType application/x-httpd-cgi cgi
-
-# Redirect, Alias, and ScriptAlias all have the same semantics -- they
-# match the beginning of a request and take appropriate action.  Use
-# Redirect for other servers, Alias for the same server, and ScriptAlias
-# to enable directories for script execution.
-
-# Redirect allows you to tell clients about documents which used to exist in
-# your server's namespace, but do not anymore. This allows you to tell the
-# clients where to look for the relocated document.
-# Example: Redirect /bar http://elsewhere/feh/bar
-
-# Aliases: Aliases one path to another.
-# Example: Alias /path1/bar /path2/foo
-
-# Alias /doc /usr/doc
-
-# ScriptAlias: Maps a virtual path to a directory for serving scripts
-# Example: ScriptAlias /htbin/ /www/htbin/
-
-ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
-
diff --git a/obsolete-buildroot/sources/bridge.patch b/obsolete-buildroot/sources/bridge.patch
deleted file mode 100644 (file)
index f447377..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- bridge-utils-0.9.6/libbridge/Makefile.in.dist      2004-03-01 20:55:52.000000000 -0600
-+++ bridge-utils-0.9.6/libbridge/Makefile.in   2004-03-01 20:56:23.000000000 -0600
-@@ -5,7 +5,7 @@
- RANLIB=@RANLIB@
- CC=@CC@
--CFLAGS = -Wall -g $(KERNEL_HEADERS)
-+CFLAGS = -Wall -g @CFLAGS@ $(KERNEL_HEADERS)
- prefix=@prefix@
- exec_prefix=@exec_prefix@
diff --git a/obsolete-buildroot/sources/dnsmasq1-100-bugfix.patch b/obsolete-buildroot/sources/dnsmasq1-100-bugfix.patch
deleted file mode 100644 (file)
index c676a1a..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
---- dnsmasq-1.18/config.h.dist 2004-03-01 22:25:12.000000000 -0600
-+++ dnsmasq-1.18/config.h      2004-03-01 22:26:50.000000000 -0600
-@@ -126,7 +126,9 @@
- /* Must preceed __linux__ since uClinux defines __linux__ too. */
- #if defined(__uClinux__) || defined(__UCLIBC__)
-+#ifndef __UCLIBC_HAS_IPV6__
- #undef HAVE_LINUX_IPV6_PROC
-+#endif
- #define HAVE_GETOPT_LONG
- #undef HAVE_ARC4RANDOM
- #define HAVE_RANDOM
-diff -x CVS -urN dnsmasq-1.18/option.c dnsmasq.old/option.c
---- dnsmasq-1.18/option.c      2003-11-05 08:22:18.000000000 -0600
-+++ dnsmasq.old/option.c       2004-01-05 23:40:11.000000000 -0600
-@@ -578,8 +578,8 @@
- #ifdef HAVE_IPV6
-           else if (tmp->source_addr.sa.sa_family == AF_INET6)
-             tmp->source_addr.in6.sin6_port = htons(*query_port);
--        }
- #endif  
-+        }
-     }
-   
-   if (*if_addrs)
diff --git a/obsolete-buildroot/sources/file.patch b/obsolete-buildroot/sources/file.patch
deleted file mode 100644 (file)
index 4b77751..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
---- file-4.04/magic/Makefile.am.orig   2003-10-02 13:46:41.000000000 -0600
-+++ file-4.04/magic/Makefile.am        2003-10-02 13:47:38.000000000 -0600
-@@ -16,10 +16,10 @@
-       done >> $@
- magic.mgc: magic
--      $(top_builddir)/src/file -C -m magic
-+      /usr/bin/file -C -m magic
- magic.mime.mgc: magic.mime
--      $(top_builddir)/src/file -C -m magic.mime
-+      /usr/bin/file -C -m magic.mime
- magic_FRAGMENTS = \
- Magdir/acorn \
---- file-4.04/magic/Makefile.in.orig   2003-10-02 13:52:23.000000000 -0600
-+++ file-4.04/magic/Makefile.in        2003-10-02 13:52:53.000000000 -0600
-@@ -477,10 +477,10 @@
-       done >> $@
- magic.mgc: magic
--      $(top_builddir)/src/file -C -m magic
-+      /usr/bin/file -C -m magic
- magic.mime.mgc: magic.mime
--      $(top_builddir)/src/file -C -m magic.mime
-+      /usr/bin/file -C -m magic.mime
- # Tell versions [3.59,3.63) of GNU make to not export all variables.
- # Otherwise a system limit (for SysV at least) may be exceeded.
- .NOEXPORT:
diff --git a/obsolete-buildroot/sources/gcc-uclibc-3.3-100-conf.patch b/obsolete-buildroot/sources/gcc-uclibc-3.3-100-conf.patch
deleted file mode 100644 (file)
index 213b4fb..0000000
+++ /dev/null
@@ -1,1593 +0,0 @@
-diff -urN gcc-3.3.3/boehm-gc/config.sub gcc-3.3.3-new/boehm-gc/config.sub
---- gcc-3.3.3/boehm-gc/config.sub      2002-02-11 22:37:53.000000000 -0600
-+++ gcc-3.3.3-new/boehm-gc/config.sub  2004-02-16 21:12:16.000000000 -0600
-@@ -118,7 +118,7 @@
- # Here we must recognize all the valid KERNEL-OS combinations.
- maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
- case $maybe_os in
--  nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
-+  nto-qnx* | linux-gnu* | linux-uclibc* | storm-chaos* | os2-emx* | windows32-*)
-     os=-$maybe_os
-     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
-     ;;
-@@ -1089,7 +1089,8 @@
-             | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-             | -chorusos* | -chorusrdb* \
-             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
--            | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
-+            | -mingw32* | -linux-gnu* | -linux-uclibc* \
-+            | -uxpv* | -beos* | -mpeix* | -udk* \
-             | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
-             | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-diff -urN gcc-3.3.3/config.sub gcc-3.3.3-new/config.sub
---- gcc-3.3.3/config.sub       2003-01-30 17:25:36.000000000 -0600
-+++ gcc-3.3.3-new/config.sub   2004-02-16 21:12:16.000000000 -0600
-@@ -118,7 +118,7 @@
- # Here we must recognize all the valid KERNEL-OS combinations.
- maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
- case $maybe_os in
--  nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
-+  nto-qnx* | linux-gnu* | linux-uclibc* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
-     os=-$maybe_os
-     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
-     ;;
-@@ -1112,7 +1112,8 @@
-             | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-             | -chorusos* | -chorusrdb* \
-             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
--            | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
-+            | -mingw32* | -linux-gnu* | -linux-uclibc* \
-+            | -uxpv* | -beos* | -mpeix* | -udk* \
-             | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
-             | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-diff -urN gcc-3.3.3/gcc/config/arm/linux-elf.h gcc-3.3.3-new/gcc/config/arm/linux-elf.h
---- gcc-3.3.3/gcc/config/arm/linux-elf.h       2003-09-16 10:39:23.000000000 -0500
-+++ gcc-3.3.3-new/gcc/config/arm/linux-elf.h   2004-02-16 21:12:16.000000000 -0600
-@@ -78,6 +78,18 @@
-   "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
- #undef  LINK_SPEC
-+#ifdef USE_UCLIBC
-+#define LINK_SPEC "%{h*} %{version:-v} \
-+   %{b} %{Wl,*:%*} \
-+   %{static:-Bstatic} \
-+   %{shared:-shared} \
-+   %{symbolic:-Bsymbolic} \
-+   %{rdynamic:-export-dynamic} \
-+   %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0} \
-+   -X \
-+   %{mbig-endian:-EB}" \
-+   SUBTARGET_EXTRA_LINK_SPEC
-+#else
- #define LINK_SPEC "%{h*} %{version:-v} \
-    %{b} %{Wl,*:%*} \
-    %{static:-Bstatic} \
-@@ -88,6 +100,7 @@
-    -X \
-    %{mbig-endian:-EB}" \
-    SUBTARGET_EXTRA_LINK_SPEC
-+#endif
- #define TARGET_OS_CPP_BUILTINS()              \
-     do {                                      \
-diff -urN gcc-3.3.3/gcc/config/cris/linux.h gcc-3.3.3-new/gcc/config/cris/linux.h
---- gcc-3.3.3/gcc/config/cris/linux.h  2003-03-10 21:01:35.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config/cris/linux.h      2004-02-16 21:12:16.000000000 -0600
-@@ -81,6 +81,25 @@
- #undef CRIS_DEFAULT_CPU_VERSION
- #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
-+#ifdef USE_UCLIBC
-+
-+#undef CRIS_SUBTARGET_VERSION
-+#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-uclibc"
-+
-+#undef CRIS_LINK_SUBTARGET_SPEC
-+#define CRIS_LINK_SUBTARGET_SPEC \
-+ "-mcrislinux\
-+  -rpath-link include/asm/../..%s\
-+  %{shared} %{static}\
-+  %{symbolic:-Bdynamic} %{shlib:-Bdynamic} %{static:-Bstatic}\
-+  %{!shared: \
-+    %{!static: \
-+      %{rdynamic:-export-dynamic} \
-+      %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}} \
-+  %{!r:%{O2|O3: --gc-sections}}"
-+
-+#else  /* USE_UCLIBC */
-+
- #undef CRIS_SUBTARGET_VERSION
- #define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
-@@ -95,6 +114,8 @@
-   %{!shared:%{!static:%{rdynamic:-export-dynamic}}}\
-   %{!r:%{O2|O3: --gc-sections}}"
-+#endif  /* USE_UCLIBC */
-+
- /* Node: Run-time Target */
-diff -urN gcc-3.3.3/gcc/config/cris/t-linux-uclibc gcc-3.3.3-new/gcc/config/cris/t-linux-uclibc
---- gcc-3.3.3/gcc/config/cris/t-linux-uclibc   1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config/cris/t-linux-uclibc       2004-02-16 21:12:16.000000000 -0600
-@@ -0,0 +1,3 @@
-+T_CFLAGS = -DUSE_UCLIBC
-+TARGET_LIBGCC2_CFLAGS += -fPIC
-+CRTSTUFF_T_CFLAGS_S = $(TARGET_LIBGCC2_CFLAGS)
-diff -urN gcc-3.3.3/gcc/config/i386/linux.h gcc-3.3.3-new/gcc/config/i386/linux.h
---- gcc-3.3.3/gcc/config/i386/linux.h  2003-11-14 00:46:12.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config/i386/linux.h      2004-02-16 21:12:16.000000000 -0600
-@@ -136,6 +136,15 @@
-       %{static:-static}}}"
- #endif
- #else
-+#if defined USE_UCLIBC
-+#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
-+  %{!shared: \
-+    %{!ibcs: \
-+      %{!static: \
-+      %{rdynamic:-export-dynamic} \
-+      %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
-+      %{static:-static}}}"
-+#else
- #define LINK_SPEC "-m elf_i386 %{shared:-shared} \
-   %{!shared: \
-     %{!ibcs: \
-@@ -144,6 +153,7 @@
-       %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
-       %{static:-static}}}"
- #endif
-+#endif
- /* A C statement (sans semicolon) to output to the stdio stream
-    FILE the assembler definition of uninitialized global DECL named
-diff -urN gcc-3.3.3/gcc/config/mips/linux.h gcc-3.3.3-new/gcc/config/mips/linux.h
---- gcc-3.3.3/gcc/config/mips/linux.h  2003-12-23 02:58:00.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config/mips/linux.h      2004-02-16 21:12:16.000000000 -0600
-@@ -175,6 +175,17 @@
- /* Borrowed from sparc/linux.h */
- #undef LINK_SPEC
-+#ifdef USE_UCLIBC
-+#define LINK_SPEC \
-+ "%(endian_spec) \
-+  %{shared:-shared} \
-+  %{!shared: \
-+    %{!ibcs: \
-+      %{!static: \
-+        %{rdynamic:-export-dynamic} \
-+        %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
-+        %{static:-static}}}"
-+#else
- #define LINK_SPEC \
-  "%(endian_spec) \
-   %{shared:-shared} \
-@@ -184,6 +195,7 @@
-         %{rdynamic:-export-dynamic} \
-         %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
-         %{static:-static}}}"
-+#endif
- #undef SUBTARGET_ASM_SPEC
- #define SUBTARGET_ASM_SPEC "\
-diff -urN gcc-3.3.3/gcc/config/sh/linux.h gcc-3.3.3-new/gcc/config/sh/linux.h
---- gcc-3.3.3/gcc/config/sh/linux.h    2003-11-06 17:13:33.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config/sh/linux.h        2004-02-16 21:12:16.000000000 -0600
-@@ -44,12 +44,21 @@
- #undef SUBTARGET_LINK_EMUL_SUFFIX
- #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
- #undef SUBTARGET_LINK_SPEC
-+#ifdef USE_UCLIBC
-+#define SUBTARGET_LINK_SPEC \
-+  "%{shared:-shared} \
-+   %{!static: \
-+     %{rdynamic:-export-dynamic} \
-+     %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
-+   %{static:-static}"
-+#else
- #define SUBTARGET_LINK_SPEC \
-   "%{shared:-shared} \
-    %{!static: \
-      %{rdynamic:-export-dynamic} \
-      %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
-    %{static:-static}"
-+#endif
- /* The GNU C++ standard library requires that these macros be defined.  */
- #undef CPLUSPLUS_CPP_SPEC
-diff -urN gcc-3.3.3/gcc/config/sh/t-linux-uclibc gcc-3.3.3-new/gcc/config/sh/t-linux-uclibc
---- gcc-3.3.3/gcc/config/sh/t-linux-uclibc     1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config/sh/t-linux-uclibc 2004-02-16 21:12:16.000000000 -0600
-@@ -0,0 +1,16 @@
-+T_CFLAGS = -DUSE_UCLIBC
-+
-+# Don't run fixproto
-+STMP_FIXPROTO =
-+
-+TARGET_LIBGCC2_CFLAGS = -fpic
-+LIB1ASMFUNCS_CACHE = _ic_invalidate
-+
-+LIB2FUNCS_EXTRA=
-+
-+MULTILIB_OPTIONS= $(MULTILIB_ENDIAN) m3e/m4
-+MULTILIB_DIRNAMES= 
-+MULTILIB_MATCHES = 
-+MULTILIB_EXCEPTIONS=
-+
-+EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o
-diff -urN gcc-3.3.3/gcc/config/sh/t-sh64-uclibc gcc-3.3.3-new/gcc/config/sh/t-sh64-uclibc
---- gcc-3.3.3/gcc/config/sh/t-sh64-uclibc      1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config/sh/t-sh64-uclibc  2004-02-16 21:12:16.000000000 -0600
-@@ -0,0 +1,13 @@
-+EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o
-+
-+LIB1ASMFUNCS = \
-+  _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
-+  _shcompact_call_trampoline _shcompact_return_trampoline \
-+  _shcompact_incoming_args _ic_invalidate _nested_trampoline \
-+  _push_pop_shmedia_regs \
-+  _udivdi3 _divdi3 _umoddi3 _moddi3
-+
-+MULTILIB_OPTIONS = $(MULTILIB_ENDIAN) m5-32media-nofpu/m5-compact/m5-compact-nofpu/m5-64media/m5-64media-nofpu
-+MULTILIB_DIRNAMES= $(MULTILIB_ENDIAN) nofpu compact nofpu/compact media64 nofpu/media64
-+MULTILIB_MATCHES=
-+MULTILIB_EXCEPTIONS=
-diff -urN gcc-3.3.3/gcc/config/t-linux-uclibc gcc-3.3.3-new/gcc/config/t-linux-uclibc
---- gcc-3.3.3/gcc/config/t-linux-uclibc        1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config/t-linux-uclibc    2004-02-16 21:12:16.000000000 -0600
-@@ -0,0 +1,23 @@
-+T_CFLAGS = -DUSE_UCLIBC
-+
-+# Don't run fixproto
-+STMP_FIXPROTO =
-+
-+# Compile crtbeginS.o and crtendS.o with pic.
-+CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
-+# Compile libgcc2.a with pic.
-+TARGET_LIBGCC2_CFLAGS = -fPIC
-+
-+# Override t-slibgcc-elf-ver to export some libgcc symbols with
-+# the symbol versions that glibc used.
-+SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver
-+
-+# Use unwind-dw2-fde-glibc
-+#LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
-+#  $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
-+#LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
-+
-+# Use unwind-dw2-fde
-+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
-+  $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
-+LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h
-diff -urN gcc-3.3.3/gcc/config.gcc gcc-3.3.3-new/gcc/config.gcc
---- gcc-3.3.3/gcc/config.gcc   2004-01-21 00:06:00.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config.gcc       2004-02-16 21:12:16.000000000 -0600
-@@ -697,6 +697,17 @@
-       extra_parts=""
-       use_collect2=yes
-       ;;
-+arm*-*-linux-uclibc*)         # ARM GNU/Linux with ELF - uClibc
-+      tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/linux-gas.h arm/linux-elf.h"
-+      tmake_file="t-slibgcc-elf-ver t-linux-uclibc arm/t-linux"
-+      extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
-+      gnu_ld=yes
-+      case x${enable_threads} in
-+      x | xyes | xpthreads | xposix)
-+              thread_file='posix'
-+              ;;
-+      esac
-+      ;;
- arm*-*-linux*)                        # ARM GNU/Linux with ELF
-       tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/linux-gas.h arm/linux-elf.h"
-       tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
-@@ -772,6 +783,10 @@
-       tmake_file="cris/t-cris cris/t-elfmulti"
-       gas=yes
-       ;;
-+cris-*-linux-uclibc*)
-+      tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h"
-+      tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux-uclibc"
-+      ;;
- cris-*-linux*)
-       tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h"
-       tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux"
-@@ -1173,6 +1188,11 @@
-               thread_file='single'
-       fi
-       ;;
-+i[34567]86-*-linux*uclibc*)   # Intel 80386's running GNU/Linux
-+                              # with ELF format using uClibc
-+      tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h"
-+      tmake_file="t-slibgcc-elf-ver t-linux-uclibc i386/t-crtstuff"
-+      ;;
- i[34567]86-*-linux*)  # Intel 80386's running GNU/Linux
-                       # with ELF format using glibc 2
-                       # aka GNU/Linux C library 6
-@@ -1883,6 +1903,16 @@
-       tm_file="elfos.h ${tm_file} mips/netbsd.h"
-       tmake_file="${tmake_file} mips/t-netbsd"
-       ;;
-+mips*-*-linux-uclibc*)                        # Linux MIPS, either endian. uClibc
-+        tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h"
-+      case $machine in
-+        mipsisa32*-*)
-+                target_cpu_default="MASK_SOFT_FLOAT"
-+              tm_defines="MIPS_ISA_DEFAULT=32"
-+                ;;
-+        esac
-+      tmake_file="t-slibgcc-elf-ver t-linux-uclibc mips/t-linux"
-+      ;;
- mips*-*-linux*)                               # Linux MIPS, either endian.
-         tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h"
-       case $machine in
-@@ -2129,6 +2159,11 @@
-       out_file=rs6000/rs6000.c
-       tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm"
-       ;;
-+powerpc-*-linux-uclibc*)
-+      tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h"
-+      out_file=rs6000/rs6000.c
-+      tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux-uclibc rs6000/t-ppccomm"
-+      ;;
- powerpc-*-linux*)
-       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h"
-       out_file=rs6000/rs6000.c
-@@ -2313,10 +2348,18 @@
-               tmake_file="${tmake_file} sh/t-le"
-               ;;
-       esac
--      tmake_file="${tmake_file} sh/t-linux"
-+      case $machine in
-+      *-*-linux-uclibc*) tmake_file="${tmake_file} sh/t-linux-uclibc" ;;
-+      *) tmake_file="${tmake_file} sh/t-linux" ;;
-+      esac
-       tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/elf.h sh/linux.h"
-       gas=yes gnu_ld=yes
-       case $machine in
-+      sh64*-*-linux-uclibc*)
-+              tmake_file="${tmake_file} sh/t-sh64-uclibc"
-+              tm_file="${tm_file} sh/sh64.h"
-+              extra_headers="shmedia.h ushmedia.h sshmedia.h"
-+              ;;
-       sh64*)
-               tmake_file="${tmake_file} sh/t-sh64"
-               tm_file="${tm_file} sh/sh64.h"
-diff -urN gcc-3.3.3/libstdc++-v3/aclocal.m4 gcc-3.3.3-new/libstdc++-v3/aclocal.m4
---- gcc-3.3.3/libstdc++-v3/aclocal.m4  2004-01-12 10:18:44.000000000 -0600
-+++ gcc-3.3.3-new/libstdc++-v3/aclocal.m4      2004-02-16 21:12:16.000000000 -0600
-@@ -1216,6 +1216,9 @@
-   dnl Default to "generic"
-   if test x$enable_clocale_flag = xno; then
-     case x${target_os} in
-+      xlinux-uclibc*)
-+      enable_clocale_flag=uclibc
-+      ;;
-       xlinux* | xgnu*)
-       AC_EGREP_CPP([_GLIBCPP_ok], [
-         #include <features.h>
-@@ -1339,6 +1342,41 @@
-       CTIME_CC=config/locale/generic/time_members.cc
-       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
-       ;;
-+    xuclibc)
-+      AC_MSG_RESULT(uclibc)
-+
-+      # Declare intention to use gettext, and add support for specific
-+      # languages.
-+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
-+      ALL_LINGUAS="de fr"
-+
-+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
-+      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
-+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
-+      USE_NLS=yes
-+      fi
-+      # Export the build objects.
-+      for ling in $ALL_LINGUAS; do \
-+        glibcpp_MOFILES="$glibcpp_MOFILES $ling.mo"; \
-+        glibcpp_POFILES="$glibcpp_POFILES $ling.po"; \
-+      done
-+      AC_SUBST(glibcpp_MOFILES)
-+      AC_SUBST(glibcpp_POFILES)
-+
-+      CLOCALE_H=config/locale/uclibc/c_locale.h
-+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
-+      CCODECVT_H=config/locale/uclibc/codecvt_specializations.h
-+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
-+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
-+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
-+      CMESSAGES_H=config/locale/uclibc/messages_members.h
-+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
-+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
-+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
-+      CTIME_H=config/locale/uclibc/time_members.h
-+      CTIME_CC=config/locale/uclibc/time_members.cc
-+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
-+      ;;
-     *)
-       echo "$enable_clocale is an unknown locale package" 1>&2
-       exit 1
-diff -urN gcc-3.3.3/libstdc++-v3/configure gcc-3.3.3-new/libstdc++-v3/configure
---- gcc-3.3.3/libstdc++-v3/configure   2004-01-12 10:18:45.000000000 -0600
-+++ gcc-3.3.3-new/libstdc++-v3/configure       2004-02-17 00:21:12.000000000 -0600
-@@ -2996,6 +2996,9 @@
-       if test x$enable_clocale_flag = xno; then
-     case x${target_os} in
-+      xlinux-uclibc*)
-+      enable_clocale_flag=uclibc
-+      ;;
-       xlinux* | xgnu*)
-       cat > conftest.$ac_ext <<EOF
- #line 3002 "configure"
-@@ -3182,6 +3185,70 @@
-       CTIME_CC=config/locale/generic/time_members.cc
-       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
-       ;;
-+    xuclibc)
-+      echo "$ac_t""uclibc" 1>&6
-+
-+      # Declare intention to use gettext, and add support for specific
-+      # languages.
-+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
-+      ALL_LINGUAS="de fr"
-+
-+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
-+      # Extract the first word of "msgfmt", so it can be a program name with args.
-+set dummy msgfmt; ac_word=$2
-+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-+echo "configure:3117: checking for $ac_word" >&5
-+if eval "test \"`echo '$''{'ac_cv_prog_check_msgfmt'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  if test -n "$check_msgfmt"; then
-+  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
-+else
-+  IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS=":"
-+  ac_dummy="$PATH"
-+  for ac_dir in $ac_dummy; do
-+    test -z "$ac_dir" && ac_dir=.
-+    if test -f $ac_dir/$ac_word; then
-+      ac_cv_prog_check_msgfmt="yes"
-+      break
-+    fi
-+  done
-+  IFS="$ac_save_ifs"
-+  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
-+fi
-+fi
-+check_msgfmt="$ac_cv_prog_check_msgfmt"
-+if test -n "$check_msgfmt"; then
-+  echo "$ac_t""$check_msgfmt" 1>&6
-+else
-+  echo "$ac_t""no" 1>&6
-+fi
-+
-+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
-+      USE_NLS=yes
-+      fi
-+      # Export the build objects.
-+      for ling in $ALL_LINGUAS; do \
-+        glibcpp_MOFILES="$glibcpp_MOFILES $ling.mo"; \
-+        glibcpp_POFILES="$glibcpp_POFILES $ling.po"; \
-+      done
-+      
-+      
-+
-+      CLOCALE_H=config/locale/uclibc/c_locale.h
-+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
-+      CCODECVT_H=config/locale/uclibc/codecvt_specializations.h
-+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
-+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
-+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
-+      CMESSAGES_H=config/locale/uclibc/messages_members.h
-+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
-+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
-+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
-+      CTIME_H=config/locale/uclibc/time_members.h
-+      CTIME_CC=config/locale/uclibc/time_members.cc
-+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
-+      ;;
-     *)
-       echo "$enable_clocale is an unknown locale package" 1>&2
-       exit 1
-@@ -4212,6 +4279,968 @@
-   # GLIBCPP_CHECK_MATH_SUPPORT
-   case "$target" in
-+    *-uclibc*)
-+      os_include_dir="os/uclibc"
-+      for ac_hdr in nan.h ieeefp.h endian.h sys/isa_defs.h \
-+        machine/endian.h machine/param.h sys/machine.h sys/types.h \
-+        fp.h locale.h float.h inttypes.h
-+do
-+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-+echo "configure:4224: checking for $ac_hdr" >&5
-+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4229 "configure"
-+#include "confdefs.h"
-+#include <$ac_hdr>
-+EOF
-+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-+{ (eval echo configure:4234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-+if test -z "$ac_err"; then
-+  rm -rf conftest*
-+  eval "ac_cv_header_$ac_safe=yes"
-+else
-+  echo "$ac_err" >&5
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_header_$ac_safe=no"
-+fi
-+rm -f conftest*
-+fi
-+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-+  cat >> confdefs.h <<EOF
-+#define $ac_tr_hdr 1
-+EOF
-+ 
-+else
-+  echo "$ac_t""no" 1>&6
-+fi
-+done
-+
-+      SECTION_FLAGS='-ffunction-sections -fdata-sections'
-+      
-+      
-+  # If we're not using GNU ld, then there's no point in even trying these
-+  # tests.  Check for that first.  We should have already tested for gld
-+  # by now (in libtool), but require it now just to be safe...
-+  test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
-+  test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
-+  
-+
-+  # The name set by libtool depends on the version of libtool.  Shame on us
-+  # for depending on an impl detail, but c'est la vie.  Older versions used
-+  # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
-+  # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
-+  # makes sense).  We'll test with_gnu_ld everywhere else, so if that isn't
-+  # set (hence we're using an older libtool), then set it.
-+  if test x${with_gnu_ld+set} != xset; then
-+    if test x${ac_cv_prog_gnu_ld+set} != xset; then
-+      # We got through "ac_require(ac_prog_ld)" and still not set?  Huh?
-+      with_gnu_ld=no
-+    else
-+      with_gnu_ld=$ac_cv_prog_gnu_ld
-+    fi
-+  fi
-+
-+  # Start by getting the version number.  I think the libtool test already
-+  # does some of this, but throws away the result.
-+  
-+  ldver=`$LD --version 2>/dev/null | head -1 | \
-+         sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
-+  
-+  glibcpp_gnu_ld_version=`echo $ldver | \
-+         $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
-+
-+  # Set --gc-sections.
-+  if test "$with_gnu_ld" = "notbroken"; then
-+    # GNU ld it is!  Joy and bunny rabbits!
-+
-+    # All these tests are for C++; save the language and the compiler flags.
-+    # Need to do this so that g++ won't try to link in libstdc++
-+    ac_test_CFLAGS="${CFLAGS+set}"
-+    ac_save_CFLAGS="$CFLAGS"
-+    CFLAGS='-x c++  -Wl,--gc-sections'
-+
-+    # Check for -Wl,--gc-sections
-+    # XXX This test is broken at the moment, as symbols required for
-+    # linking are now in libsupc++ (not built yet.....). In addition, 
-+    # this test has cored on solaris in the past. In addition,
-+    # --gc-sections doesn't really work at the moment (keeps on discarding
-+    # used sections, first .eh_frame and now some of the glibc sections for
-+    # iconv). Bzzzzt. Thanks for playing, maybe next time.
-+    echo $ac_n "checking for ld that supports -Wl,--gc-sections""... $ac_c" 1>&6
-+echo "configure:4312: checking for ld that supports -Wl,--gc-sections" >&5
-+    if test "$cross_compiling" = yes; then
-+  ac_sectionLDflags=yes
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4317 "configure"
-+#include "confdefs.h"
-+
-+     int main(void) 
-+     {
-+       try { throw 1; }
-+       catch (...) { };
-+       return 0;
-+     }
-+    
-+EOF
-+if { (eval echo configure:4328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-+then
-+  ac_sectionLDflags=yes
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -fr conftest*
-+  ac_sectionLDflags=no
-+fi
-+rm -fr conftest*
-+fi
-+
-+    if test "$ac_test_CFLAGS" = set; then
-+      CFLAGS="$ac_save_CFLAGS"
-+    else
-+      # this is the suspicious part
-+      CFLAGS=''
-+    fi
-+    if test "$ac_sectionLDflags" = "yes"; then
-+      SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
-+    fi
-+    echo "$ac_t""$ac_sectionLDflags" 1>&6
-+  fi
-+
-+  # Set linker optimization flags.
-+  if test x"$with_gnu_ld" = x"yes"; then
-+    OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
-+  fi
-+
-+  
-+  
-+
-+      
-+    echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
-+echo "configure:4362: checking for main in -lm" >&5
-+ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
-+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  ac_save_LIBS="$LIBS"
-+LIBS="-lm  $LIBS"
-+cat > conftest.$ac_ext <<EOF
-+#line 4370 "configure"
-+#include "confdefs.h"
-+
-+int main() {
-+main()
-+; return 0; }
-+EOF
-+if { (eval echo configure:4377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+  rm -rf conftest*
-+  eval "ac_cv_lib_$ac_lib_var=yes"
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_lib_$ac_lib_var=no"
-+fi
-+rm -f conftest*
-+LIBS="$ac_save_LIBS"
-+
-+fi
-+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+    ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-+  cat >> confdefs.h <<EOF
-+#define $ac_tr_lib 1
-+EOF
-+
-+  LIBS="-lm $LIBS"
-+
-+else
-+  echo "$ac_t""no" 1>&6
-+fi
-+
-+  for ac_func in nan copysignf
-+do
-+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-+echo "configure:4407: checking for $ac_func" >&5
-+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4412 "configure"
-+#include "confdefs.h"
-+/* System header to define __stub macros and hopefully few prototypes,
-+    which can conflict with char $ac_func(); below.  */
-+#include <assert.h>
-+/* Override any gcc2 internal prototype to avoid an error.  */
-+/* We use char because int might match the return type of a gcc2
-+    builtin and then its argument prototype would still apply.  */
-+char $ac_func();
-+
-+int main() {
-+
-+/* The GNU C library defines this for functions which it implements
-+    to always fail with ENOSYS.  Some functions are actually named
-+    something starting with __ and the normal name is an alias.  */
-+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-+choke me
-+#else
-+$ac_func();
-+#endif
-+
-+; return 0; }
-+EOF
-+if { (eval echo configure:4435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=yes"
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=no"
-+fi
-+rm -f conftest*
-+fi
-+
-+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-+  cat >> confdefs.h <<EOF
-+#define $ac_tr_func 1
-+EOF
-+ 
-+else
-+  echo "$ac_t""no" 1>&6
-+LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"
-+fi
-+done
-+
-+
-+    for ac_func in __signbit
-+do
-+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-+echo "configure:4464: checking for $ac_func" >&5
-+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4469 "configure"
-+#include "confdefs.h"
-+/* System header to define __stub macros and hopefully few prototypes,
-+    which can conflict with char $ac_func(); below.  */
-+#include <assert.h>
-+/* Override any gcc2 internal prototype to avoid an error.  */
-+/* We use char because int might match the return type of a gcc2
-+    builtin and then its argument prototype would still apply.  */
-+char $ac_func();
-+
-+int main() {
-+
-+/* The GNU C library defines this for functions which it implements
-+    to always fail with ENOSYS.  Some functions are actually named
-+    something starting with __ and the normal name is an alias.  */
-+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-+choke me
-+#else
-+$ac_func();
-+#endif
-+
-+; return 0; }
-+EOF
-+if { (eval echo configure:4492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=yes"
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=no"
-+fi
-+rm -f conftest*
-+fi
-+
-+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-+  cat >> confdefs.h <<EOF
-+#define $ac_tr_func 1
-+EOF
-+ 
-+else
-+  echo "$ac_t""no" 1>&6
-+LIBMATHOBJS="$LIBMATHOBJS signbit.lo"
-+fi
-+done
-+
-+  for ac_func in __signbitf
-+do
-+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-+echo "configure:4520: checking for $ac_func" >&5
-+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4525 "configure"
-+#include "confdefs.h"
-+/* System header to define __stub macros and hopefully few prototypes,
-+    which can conflict with char $ac_func(); below.  */
-+#include <assert.h>
-+/* Override any gcc2 internal prototype to avoid an error.  */
-+/* We use char because int might match the return type of a gcc2
-+    builtin and then its argument prototype would still apply.  */
-+char $ac_func();
-+
-+int main() {
-+
-+/* The GNU C library defines this for functions which it implements
-+    to always fail with ENOSYS.  Some functions are actually named
-+    something starting with __ and the normal name is an alias.  */
-+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-+choke me
-+#else
-+$ac_func();
-+#endif
-+
-+; return 0; }
-+EOF
-+if { (eval echo configure:4548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=yes"
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=no"
-+fi
-+rm -f conftest*
-+fi
-+
-+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-+  cat >> confdefs.h <<EOF
-+#define $ac_tr_func 1
-+EOF
-+ 
-+else
-+  echo "$ac_t""no" 1>&6
-+LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"
-+fi
-+done
-+
-+
-+          if test x$ac_cv_func_copysignl = x"yes"; then
-+    for ac_func in __signbitl
-+do
-+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-+echo "configure:4578: checking for $ac_func" >&5
-+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4583 "configure"
-+#include "confdefs.h"
-+/* System header to define __stub macros and hopefully few prototypes,
-+    which can conflict with char $ac_func(); below.  */
-+#include <assert.h>
-+/* Override any gcc2 internal prototype to avoid an error.  */
-+/* We use char because int might match the return type of a gcc2
-+    builtin and then its argument prototype would still apply.  */
-+char $ac_func();
-+
-+int main() {
-+
-+/* The GNU C library defines this for functions which it implements
-+    to always fail with ENOSYS.  Some functions are actually named
-+    something starting with __ and the normal name is an alias.  */
-+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-+choke me
-+#else
-+$ac_func();
-+#endif
-+
-+; return 0; }
-+EOF
-+if { (eval echo configure:4606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=yes"
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=no"
-+fi
-+rm -f conftest*
-+fi
-+
-+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-+  cat >> confdefs.h <<EOF
-+#define $ac_tr_func 1
-+EOF
-+ 
-+else
-+  echo "$ac_t""no" 1>&6
-+LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"
-+fi
-+done
-+
-+  fi
-+
-+  if test -n "$LIBMATHOBJS"; then
-+    need_libmath=yes
-+  fi
-+  
-+  
-+
-+if test "$need_libmath" = yes; then
-+  GLIBCPP_BUILD_LIBMATH_TRUE=
-+  GLIBCPP_BUILD_LIBMATH_FALSE='#'
-+else
-+  GLIBCPP_BUILD_LIBMATH_TRUE='#'
-+  GLIBCPP_BUILD_LIBMATH_FALSE=
-+fi
-+
-+      
-+    enable_wchar_t=no
-+
-+      echo $ac_n "checking for mbstate_t""... $ac_c" 1>&6
-+echo "configure:4651: checking for mbstate_t" >&5
-+  cat > conftest.$ac_ext <<EOF
-+#line 4653 "configure"
-+#include "confdefs.h"
-+#include <wchar.h>
-+int main() {
-+mbstate_t teststate;
-+; return 0; }
-+EOF
-+if { (eval echo configure:4660: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-+  rm -rf conftest*
-+  have_mbstate_t=yes
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  have_mbstate_t=no
-+fi
-+rm -f conftest*
-+  echo "$ac_t""$have_mbstate_t" 1>&6
-+  if test x"$have_mbstate_t" = xyes; then
-+    cat >> confdefs.h <<\EOF
-+#define HAVE_MBSTATE_T 1
-+EOF
-+
-+  fi
-+
-+    for ac_hdr in wchar.h
-+do
-+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-+echo "configure:4682: checking for $ac_hdr" >&5
-+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4687 "configure"
-+#include "confdefs.h"
-+#include <$ac_hdr>
-+EOF
-+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-+{ (eval echo configure:4692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-+if test -z "$ac_err"; then
-+  rm -rf conftest*
-+  eval "ac_cv_header_$ac_safe=yes"
-+else
-+  echo "$ac_err" >&5
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_header_$ac_safe=no"
-+fi
-+rm -f conftest*
-+fi
-+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-+  cat >> confdefs.h <<EOF
-+#define $ac_tr_hdr 1
-+EOF
-+ ac_has_wchar_h=yes
-+else
-+  echo "$ac_t""no" 1>&6
-+ac_has_wchar_h=no
-+fi
-+done
-+
-+  for ac_hdr in wctype.h
-+do
-+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-+echo "configure:4723: checking for $ac_hdr" >&5
-+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4728 "configure"
-+#include "confdefs.h"
-+#include <$ac_hdr>
-+EOF
-+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-+{ (eval echo configure:4733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-+if test -z "$ac_err"; then
-+  rm -rf conftest*
-+  eval "ac_cv_header_$ac_safe=yes"
-+else
-+  echo "$ac_err" >&5
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_header_$ac_safe=no"
-+fi
-+rm -f conftest*
-+fi
-+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-+  cat >> confdefs.h <<EOF
-+#define $ac_tr_hdr 1
-+EOF
-+ ac_has_wctype_h=yes
-+else
-+  echo "$ac_t""no" 1>&6
-+ac_has_wctype_h=no
-+fi
-+done
-+
-+  
-+    if test x"$ac_has_wchar_h" = xyes &&
-+     test x"$ac_has_wctype_h" = xyes &&
-+     test x"$enable_c_mbchar" != xno; then
-+      
-+            echo $ac_n "checking for WCHAR_MIN and WCHAR_MAX""... $ac_c" 1>&6
-+echo "configure:4766: checking for WCHAR_MIN and WCHAR_MAX" >&5
-+    cat > conftest.$ac_ext <<EOF
-+#line 4768 "configure"
-+#include "confdefs.h"
-+#include <wchar.h>
-+int main() {
-+int i = WCHAR_MIN; int j = WCHAR_MAX;
-+; return 0; }
-+EOF
-+if { (eval echo configure:4775: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-+  rm -rf conftest*
-+  has_wchar_minmax=yes
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  has_wchar_minmax=no
-+fi
-+rm -f conftest*
-+    echo "$ac_t""$has_wchar_minmax" 1>&6
-+    
-+            echo $ac_n "checking for WEOF""... $ac_c" 1>&6
-+echo "configure:4788: checking for WEOF" >&5
-+    cat > conftest.$ac_ext <<EOF
-+#line 4790 "configure"
-+#include "confdefs.h"
-+
-+      #include <wchar.h>
-+      #include <stddef.h>
-+int main() {
-+wint_t i = WEOF;
-+; return 0; }
-+EOF
-+if { (eval echo configure:4799: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-+  rm -rf conftest*
-+  has_weof=yes
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  has_weof=no
-+fi
-+rm -f conftest*
-+    echo "$ac_t""$has_weof" 1>&6
-+  
-+        ac_wfuncs=yes
-+    for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset
-+do
-+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-+echo "configure:4815: checking for $ac_func" >&5
-+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4820 "configure"
-+#include "confdefs.h"
-+/* System header to define __stub macros and hopefully few prototypes,
-+    which can conflict with char $ac_func(); below.  */
-+#include <assert.h>
-+/* Override any gcc2 internal prototype to avoid an error.  */
-+/* We use char because int might match the return type of a gcc2
-+    builtin and then its argument prototype would still apply.  */
-+char $ac_func();
-+
-+int main() {
-+
-+/* The GNU C library defines this for functions which it implements
-+    to always fail with ENOSYS.  Some functions are actually named
-+    something starting with __ and the normal name is an alias.  */
-+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-+choke me
-+#else
-+$ac_func();
-+#endif
-+
-+; return 0; }
-+EOF
-+if { (eval echo configure:4843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=yes"
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=no"
-+fi
-+rm -f conftest*
-+fi
-+
-+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-+  cat >> confdefs.h <<EOF
-+#define $ac_tr_func 1
-+EOF
-+ 
-+else
-+  echo "$ac_t""no" 1>&6
-+\
-+    ac_wfuncs=no
-+fi
-+done
-+
-+  
-+        for ac_func in btowc wctob fgetwc fgetws fputwc fputws fwide \
-+    fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
-+    vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
-+    mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
-+    wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
-+    wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr
-+do
-+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-+echo "configure:4878: checking for $ac_func" >&5
-+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4883 "configure"
-+#include "confdefs.h"
-+/* System header to define __stub macros and hopefully few prototypes,
-+    which can conflict with char $ac_func(); below.  */
-+#include <assert.h>
-+/* Override any gcc2 internal prototype to avoid an error.  */
-+/* We use char because int might match the return type of a gcc2
-+    builtin and then its argument prototype would still apply.  */
-+char $ac_func();
-+
-+int main() {
-+
-+/* The GNU C library defines this for functions which it implements
-+    to always fail with ENOSYS.  Some functions are actually named
-+    something starting with __ and the normal name is an alias.  */
-+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-+choke me
-+#else
-+$ac_func();
-+#endif
-+
-+; return 0; }
-+EOF
-+if { (eval echo configure:4906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=yes"
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=no"
-+fi
-+rm -f conftest*
-+fi
-+
-+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-+  cat >> confdefs.h <<EOF
-+#define $ac_tr_func 1
-+EOF
-+ 
-+else
-+  echo "$ac_t""no" 1>&6
-+\
-+    ac_wfuncs=no
-+fi
-+done
-+
-+
-+    echo $ac_n "checking for ISO C99 wchar_t support""... $ac_c" 1>&6
-+echo "configure:4934: checking for ISO C99 wchar_t support" >&5
-+    if test x"$has_weof" = xyes &&
-+       test x"$has_wchar_minmax" = xyes &&
-+       test x"$ac_wfuncs" = xyes; then
-+      ac_isoC99_wchar_t=yes
-+    else
-+      ac_isoC99_wchar_t=no
-+    fi
-+    echo "$ac_t""$ac_isoC99_wchar_t" 1>&6
-+  
-+            ac_safe=`echo "iconv.h" | sed 'y%./+-%__p_%'`
-+echo $ac_n "checking for iconv.h""... $ac_c" 1>&6
-+echo "configure:4946: checking for iconv.h" >&5
-+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4951 "configure"
-+#include "confdefs.h"
-+#include <iconv.h>
-+EOF
-+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-+{ (eval echo configure:4956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-+if test -z "$ac_err"; then
-+  rm -rf conftest*
-+  eval "ac_cv_header_$ac_safe=yes"
-+else
-+  echo "$ac_err" >&5
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_header_$ac_safe=no"
-+fi
-+rm -f conftest*
-+fi
-+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+  ac_has_iconv_h=yes
-+else
-+  echo "$ac_t""no" 1>&6
-+ac_has_iconv_h=no
-+fi
-+
-+    ac_safe=`echo "langinfo.h" | sed 'y%./+-%__p_%'`
-+echo $ac_n "checking for langinfo.h""... $ac_c" 1>&6
-+echo "configure:4980: checking for langinfo.h" >&5
-+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4985 "configure"
-+#include "confdefs.h"
-+#include <langinfo.h>
-+EOF
-+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-+{ (eval echo configure:4990: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-+if test -z "$ac_err"; then
-+  rm -rf conftest*
-+  eval "ac_cv_header_$ac_safe=yes"
-+else
-+  echo "$ac_err" >&5
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_header_$ac_safe=no"
-+fi
-+rm -f conftest*
-+fi
-+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+  ac_has_langinfo_h=yes
-+else
-+  echo "$ac_t""no" 1>&6
-+ac_has_langinfo_h=no
-+fi
-+
-+
-+        echo $ac_n "checking for iconv in -liconv""... $ac_c" 1>&6
-+echo "configure:5014: checking for iconv in -liconv" >&5
-+ac_lib_var=`echo iconv'_'iconv | sed 'y%./+-%__p_%'`
-+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  ac_save_LIBS="$LIBS"
-+LIBS="-liconv  $LIBS"
-+cat > conftest.$ac_ext <<EOF
-+#line 5022 "configure"
-+#include "confdefs.h"
-+/* Override any gcc2 internal prototype to avoid an error.  */
-+/* We use char because int might match the return type of a gcc2
-+    builtin and then its argument prototype would still apply.  */
-+char iconv();
-+
-+int main() {
-+iconv()
-+; return 0; }
-+EOF
-+if { (eval echo configure:5033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+  rm -rf conftest*
-+  eval "ac_cv_lib_$ac_lib_var=yes"
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_lib_$ac_lib_var=no"
-+fi
-+rm -f conftest*
-+LIBS="$ac_save_LIBS"
-+
-+fi
-+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+  libiconv="-liconv"
-+else
-+  echo "$ac_t""no" 1>&6
-+fi
-+
-+    ac_save_LIBS="$LIBS"
-+    LIBS="$LIBS $libiconv"
-+
-+    for ac_func in iconv_open iconv_close iconv nl_langinfo
-+do
-+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-+echo "configure:5059: checking for $ac_func" >&5
-+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 5064 "configure"
-+#include "confdefs.h"
-+/* System header to define __stub macros and hopefully few prototypes,
-+    which can conflict with char $ac_func(); below.  */
-+#include <assert.h>
-+/* Override any gcc2 internal prototype to avoid an error.  */
-+/* We use char because int might match the return type of a gcc2
-+    builtin and then its argument prototype would still apply.  */
-+char $ac_func();
-+
-+int main() {
-+
-+/* The GNU C library defines this for functions which it implements
-+    to always fail with ENOSYS.  Some functions are actually named
-+    something starting with __ and the normal name is an alias.  */
-+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-+choke me
-+#else
-+$ac_func();
-+#endif
-+
-+; return 0; }
-+EOF
-+if { (eval echo configure:5087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=yes"
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=no"
-+fi
-+rm -f conftest*
-+fi
-+
-+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-+  cat >> confdefs.h <<EOF
-+#define $ac_tr_func 1
-+EOF
-+ \
-+    ac_XPG2funcs=yes
-+else
-+  echo "$ac_t""no" 1>&6
-+ac_XPG2funcs=no
-+fi
-+done
-+
-+  
-+    LIBS="$ac_save_LIBS"
-+
-+    echo $ac_n "checking for XPG2 wchar_t support""... $ac_c" 1>&6
-+echo "configure:5117: checking for XPG2 wchar_t support" >&5
-+    if test x"$ac_has_iconv_h" = xyes &&
-+       test x"$ac_has_langinfo_h" = xyes &&
-+       test x"$ac_XPG2funcs" = xyes; then
-+      ac_XPG2_wchar_t=yes
-+    else
-+      ac_XPG2_wchar_t=no
-+    fi
-+    echo "$ac_t""$ac_XPG2_wchar_t" 1>&6
-+  
-+            if test x"$ac_isoC99_wchar_t" = xyes &&
-+       test x"$ac_XPG2_wchar_t" = xyes; then
-+       cat >> confdefs.h <<\EOF
-+#define _GLIBCPP_USE_WCHAR_T 1
-+EOF
-+
-+       enable_wchar_t=yes 
-+    fi
-+  fi
-+  echo $ac_n "checking for enabled wchar_t specializations""... $ac_c" 1>&6
-+echo "configure:5137: checking for enabled wchar_t specializations" >&5
-+  echo "$ac_t""$enable_wchar_t" 1>&6  
-+  
-+
-+if test "$enable_wchar_t" = yes; then
-+  GLIBCPP_TEST_WCHAR_T_TRUE=
-+  GLIBCPP_TEST_WCHAR_T_FALSE='#'
-+else
-+  GLIBCPP_TEST_WCHAR_T_TRUE='#'
-+  GLIBCPP_TEST_WCHAR_T_FALSE=
-+fi    
-+
-+
-+      cat >> confdefs.h <<\EOF
-+#define HAVE_COPYSIGN 1
-+EOF
-+
-+      cat >> confdefs.h <<\EOF
-+#define HAVE_FINITE 1
-+EOF
-+
-+      cat >> confdefs.h <<\EOF
-+#define HAVE_FINITEF 1
-+EOF
-+
-+      cat >> confdefs.h <<\EOF
-+#define HAVE_ISINF 1
-+EOF
-+
-+      cat >> confdefs.h <<\EOF
-+#define HAVE_ISINFF 1
-+EOF
-+
-+      cat >> confdefs.h <<\EOF
-+#define HAVE_ISNAN 1
-+EOF
-+
-+      cat >> confdefs.h <<\EOF
-+#define HAVE_ISNANF 1
-+EOF
-+      ;;
-     *-linux*)
-       os_include_dir="os/gnu-linux"
-       for ac_hdr in nan.h ieeefp.h endian.h sys/isa_defs.h \
-diff -urN gcc-3.3.3/libstdc++-v3/configure.in gcc-3.3.3-new/libstdc++-v3/configure.in
---- gcc-3.3.3/libstdc++-v3/configure.in        2004-01-12 10:19:22.000000000 -0600
-+++ gcc-3.3.3-new/libstdc++-v3/configure.in    2004-02-16 23:13:45.000000000 -0600
-@@ -117,6 +117,36 @@
-   # GLIBCPP_CHECK_MATH_SUPPORT
-   case "$target" in
-+    *-uclibc*)
-+      os_include_dir="os/uclibc"
-+      AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
-+        machine/endian.h machine/param.h sys/machine.h sys/types.h \
-+        fp.h locale.h float.h inttypes.h])
-+      SECTION_FLAGS='-ffunction-sections -fdata-sections'
-+      AC_SUBST(SECTION_FLAGS)
-+      GLIBCPP_CHECK_LINKER_FEATURES
-+      GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
-+      GLIBCPP_CHECK_WCHAR_T_SUPPORT
-+
-+      AC_DEFINE(HAVE_COPYSIGN)
-+      #AC_DEFINE(HAVE_COPYSIGNF)
-+      AC_DEFINE(HAVE_FINITE)
-+      AC_DEFINE(HAVE_FINITEF)
-+      #AC_DEFINE(HAVE_FREXPF)
-+      #AC_DEFINE(HAVE_HYPOTF)
-+      AC_DEFINE(HAVE_ISINF)
-+      AC_DEFINE(HAVE_ISINFF)
-+      AC_DEFINE(HAVE_ISNAN)
-+      AC_DEFINE(HAVE_ISNANF)
-+      #AC_DEFINE(HAVE_SINCOS)
-+      #AC_DEFINE(HAVE_SINCOSF)
-+      #if test x"long_double_math_on_this_cpu" = x"yes"; then
-+        #AC_DEFINE(HAVE_FINITEL)
-+        #AC_DEFINE(HAVE_HYPOTL)
-+        #AC_DEFINE(HAVE_ISINFL)
-+        #AC_DEFINE(HAVE_ISNANL)
-+      #fi
-+      ;;
-     *-linux*)
-       os_include_dir="os/gnu-linux"
-       AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
-diff -urN gcc-3.3.3/libstdc++-v3/configure.target gcc-3.3.3-new/libstdc++-v3/configure.target
---- gcc-3.3.3/libstdc++-v3/configure.target    2003-10-01 14:07:07.000000000 -0500
-+++ gcc-3.3.3-new/libstdc++-v3/configure.target        2004-02-16 21:12:16.000000000 -0600
-@@ -133,6 +133,9 @@
-   freebsd*)
-     os_include_dir="os/bsd/freebsd"
-     ;;
-+  linux-uclibc*)
-+    os_include_dir="os/uclibc"
-+    ;;
-   gnu* | linux*)
-     os_include_dir="os/gnu-linux"
-     ;;
-diff -urN gcc-3.3.3/libstdc++-v3/include/c_std/std_cstdlib.h gcc-3.3.3-new/libstdc++-v3/include/c_std/std_cstdlib.h
---- gcc-3.3.3/libstdc++-v3/include/c_std/std_cstdlib.h 2003-04-18 05:08:05.000000000 -0500
-+++ gcc-3.3.3-new/libstdc++-v3/include/c_std/std_cstdlib.h     2004-02-16 21:12:16.000000000 -0600
-@@ -101,9 +101,11 @@
-   using ::labs;
-   using ::ldiv;
-   using ::malloc;
-+#if _GLIBCPP_USE_WCHAR_T
-   using ::mblen;
-   using ::mbstowcs;
-   using ::mbtowc;
-+#endif
-   using ::qsort;
-   using ::rand;
-   using ::realloc;
-@@ -112,8 +114,10 @@
-   using ::strtol;
-   using ::strtoul;
-   using ::system;
-+#if _GLIBCPP_USE_WCHAR_T
-   using ::wcstombs;
-   using ::wctomb;
-+#endif
-   inline long 
-   abs(long __i) { return labs(__i); }
-diff -urN gcc-3.3.3/libstdc++-v3/include/c_std/std_cwchar.h gcc-3.3.3-new/libstdc++-v3/include/c_std/std_cwchar.h
---- gcc-3.3.3/libstdc++-v3/include/c_std/std_cwchar.h  2003-04-18 05:08:05.000000000 -0500
-+++ gcc-3.3.3-new/libstdc++-v3/include/c_std/std_cwchar.h      2004-02-16 21:12:16.000000000 -0600
-@@ -165,7 +165,9 @@
-   using ::wcscoll;
-   using ::wcscpy;
-   using ::wcscspn;
-+#ifdef HAVE_WCSFTIME
-   using ::wcsftime;
-+#endif
-   using ::wcslen;
-   using ::wcsncat;
-   using ::wcsncmp;
-diff -urN gcc-3.3.3/ltconfig gcc-3.3.3-new/ltconfig
---- gcc-3.3.3/ltconfig 2003-02-19 20:10:02.000000000 -0600
-+++ gcc-3.3.3-new/ltconfig     2004-02-16 21:12:16.000000000 -0600
-@@ -603,6 +603,7 @@
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case $host_os in
- linux-gnu*) ;;
-+linux-uclibc*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
-@@ -1247,6 +1248,24 @@
-   dynamic_linker='GNU/Linux ld.so'
-   ;;
-+linux-uclibc*)
-+  version_type=linux
-+  need_lib_prefix=no
-+  need_version=no
-+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-+  soname_spec='${libname}${release}.so$major'
-+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-+  shlibpath_var=LD_LIBRARY_PATH
-+  shlibpath_overrides_runpath=no
-+  # This implies no fast_install, which is unacceptable.
-+  # Some rework will be needed to allow for fast_install
-+  # before this can be enabled.
-+  # Note: copied from linux-gnu, and may not be appropriate.
-+  hardcode_into_libs=yes
-+  # Assume using the uClibc dynamic linker.
-+  dynamic_linker="uClibc ld.so"
-+  ;;
-+
- netbsd*)
-   need_lib_prefix=no
-   need_version=no
diff --git a/obsolete-buildroot/sources/gcc-uclibc-3.3-110-conf.patch b/obsolete-buildroot/sources/gcc-uclibc-3.3-110-conf.patch
deleted file mode 100644 (file)
index f297c32..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-Use the patch by Carl Miller <chaz@energoncube.net> for powerpc, with
-some minor modifications.  Changed *os_uclibc to *os_linux_uclibc since
-at some point we might support other platforms.  Also updated to 3.3.3.
-diff -urN gcc-3.3.3/gcc/config/rs6000/linux.h gcc-3.3.3-new/gcc/config/rs6000/linux.h
---- gcc-3.3.3/gcc/config/rs6000/linux.h        2003-11-14 00:46:10.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config/rs6000/linux.h    2004-02-16 21:13:40.000000000 -0600
-@@ -64,7 +64,11 @@
- #define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
- #undef        LINK_OS_DEFAULT_SPEC
-+#ifdef USE_UCLIBC
-+#define LINK_OS_DEFAULT_SPEC "%(link_os_linux_uclibc)"
-+#else
- #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
-+#endif
- #undef TARGET_VERSION
- #define TARGET_VERSION fprintf (stderr, " (PowerPC GNU/Linux)");
-diff -urN gcc-3.3.3/gcc/config/rs6000/sysv4.h gcc-3.3.3-new/gcc/config/rs6000/sysv4.h
---- gcc-3.3.3/gcc/config/rs6000/sysv4.h        2003-10-28 13:55:41.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config/rs6000/sysv4.h    2004-02-16 21:13:40.000000000 -0600
-@@ -968,9 +968,11 @@
- %{mcall-linux: %(link_os_linux) } \
- %{mcall-gnu: %(link_os_gnu) } \
- %{mcall-netbsd: %(link_os_netbsd) } \
-+%{mcall-uclibc: %(link_os_linux_uclibc) } \
- %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
-          %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
--         %{!mcall-netbsd: %(link_os_default) }}}}}}}}}"
-+         %{!mcall-netbsd: %{!mcall-uclibc: \
-+         %(link_os_default) }}}}}}}}}}"
- #define LINK_OS_DEFAULT_SPEC ""
-@@ -1307,6 +1309,12 @@
- #define LINK_OS_WINDISS_SPEC ""
-+/* uClibc support for Linux. */
-+
-+#define LINK_OS_LINUX_UCLIBC_SPEC "-m elf32ppclinux %{!shared: %{!static: \
-+  %{rdynamic:-export-dynamic} \
-+  %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}}"
-+
- /* Define any extra SPECS that the compiler needs to generate.  */
- /* Override rs6000.h definition.  */
- #undef        SUBTARGET_EXTRA_SPECS
-@@ -1372,6 +1380,7 @@
-   { "link_os_netbsd",         LINK_OS_NETBSD_SPEC },                  \
-   { "link_os_vxworks",                LINK_OS_VXWORKS_SPEC },                 \
-   { "link_os_windiss",                LINK_OS_WINDISS_SPEC },                 \
-+  { "link_os_linux_uclibc",   LINK_OS_LINUX_UCLIBC_SPEC },            \
-   { "link_os_default",                LINK_OS_DEFAULT_SPEC },                 \
-   { "cc1_endian_big",         CC1_ENDIAN_BIG_SPEC },                  \
-   { "cc1_endian_little",      CC1_ENDIAN_LITTLE_SPEC },               \
diff --git a/obsolete-buildroot/sources/gcc-uclibc-3.3-120-softfloat.patch b/obsolete-buildroot/sources/gcc-uclibc-3.3-120-softfloat.patch
deleted file mode 100644 (file)
index f243189..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
---- gcc-3.3.2-old/configure.in 2003-08-09 01:57:21.000000000 -0500
-+++ gcc-3.3.2/configure.in     2004-01-15 12:46:29.000000000 -0600
-@@ -1418,6 +1418,11 @@
- fi
- FLAGS_FOR_TARGET=
-+case " $targargs " in
-+ *" --nfp "* | *" --without-float "*)
-+    FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -msoft-float'
-+    ;;
-+esac
- case " $target_configdirs " in
-  *" newlib "*)
-   case " $targargs " in
diff --git a/obsolete-buildroot/sources/gcc-uclibc-3.3-200-code.patch b/obsolete-buildroot/sources/gcc-uclibc-3.3-200-code.patch
deleted file mode 100644 (file)
index 5880d83..0000000
+++ /dev/null
@@ -1,3021 +0,0 @@
-Warning!  This patch is not finished.  The wide char time-related stuff
-is broken or non-functional.  But it serves as a starting point to get
-things building while I continue to work on the uClibc locale internals.
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h   1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h    2004-01-09 07:55:02.000000000 -0600
-@@ -0,0 +1,63 @@
-+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
-+
-+// Copyright (C) 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+// Written by Jakub Jelinek <jakub@redhat.com>
-+
-+#include <clocale>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning clean this up
-+#endif
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+                                                  
-+extern "C" __typeof(iswctype_l) __iswctype_l;
-+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
-+extern "C" __typeof(strcoll_l) __strcoll_l;
-+extern "C" __typeof(strftime_l) __strftime_l;
-+extern "C" __typeof(strtod_l) __strtod_l;
-+extern "C" __typeof(strtof_l) __strtof_l;
-+extern "C" __typeof(strtold_l) __strtold_l;
-+extern "C" __typeof(strtol_l) __strtol_l;
-+extern "C" __typeof(strtoll_l) __strtoll_l;
-+extern "C" __typeof(strtoul_l) __strtoul_l;
-+extern "C" __typeof(strtoull_l) __strtoull_l;
-+extern "C" __typeof(strxfrm_l) __strxfrm_l;
-+extern "C" __typeof(towlower_l) __towlower_l;
-+extern "C" __typeof(towupper_l) __towupper_l;
-+extern "C" __typeof(wcscoll_l) __wcscoll_l;
-+extern "C" __typeof(wcsftime_l) __wcsftime_l;
-+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
-+extern "C" __typeof(wctype_l) __wctype_l;
-+extern "C" __typeof(newlocale) __newlocale;
-+extern "C" __typeof(freelocale) __freelocale;
-+extern "C" __typeof(duplocale) __duplocale;
-+extern "C" __typeof(uselocale) __uselocale;
-+
-+#endif // GLIBC 2.3 and later
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.cc    1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.cc     2004-01-09 08:37:55.000000000 -0600
-@@ -0,0 +1,231 @@
-+// Wrapper for underlying C-language localization -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.8  Standard locale categories.
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <stdexcept>
-+#include <langinfo.h>
-+#include <bits/c++locale_internal.h>
-+
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
-+#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
-+#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
-+#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
-+#define __strtof_l(S, E, L)         strtof((S), (E))
-+#define __strtod_l(S, E, L)         strtod((S), (E))
-+#define __strtold_l(S, E, L)        strtold((S), (E))
-+#endif
-+
-+namespace std 
-+{
-+  template<>
-+    void
-+    __convert_to_v(const char* __s, long& __v, ios_base::iostate& __err, 
-+                 const __c_locale& __cloc, int __base)
-+    {
-+      if (!(__err & ios_base::failbit))
-+      {
-+      char* __sanity;
-+      errno = 0;
-+      long __l = __strtol_l(__s, &__sanity, __base, __cloc);
-+      if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
-+        __v = __l;
-+      else
-+        __err |= ios_base::failbit;
-+      }
-+    }
-+
-+  template<>
-+    void
-+    __convert_to_v(const char* __s, unsigned long& __v, 
-+                 ios_base::iostate& __err, const __c_locale& __cloc, 
-+                 int __base)
-+    {
-+      if (!(__err & ios_base::failbit))
-+      {
-+        char* __sanity;
-+        errno = 0;
-+        unsigned long __ul = __strtoul_l(__s, &__sanity, __base, __cloc);
-+          if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
-+          __v = __ul;
-+        else
-+          __err |= ios_base::failbit;
-+      }
-+    }
-+
-+#ifdef _GLIBCPP_USE_LONG_LONG
-+  template<>
-+    void
-+    __convert_to_v(const char* __s, long long& __v, ios_base::iostate& __err, 
-+                 const __c_locale& __cloc, int __base)
-+    {
-+      if (!(__err & ios_base::failbit))
-+      {
-+        char* __sanity;
-+        errno = 0;
-+        long long __ll = __strtoll_l(__s, &__sanity, __base, __cloc);
-+          if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
-+          __v = __ll;
-+        else
-+          __err |= ios_base::failbit;
-+      }
-+    }
-+
-+  template<>
-+    void
-+    __convert_to_v(const char* __s, unsigned long long& __v, 
-+                 ios_base::iostate& __err, const __c_locale& __cloc, 
-+                 int __base)
-+    {
-+      if (!(__err & ios_base::failbit))
-+      {      
-+        char* __sanity;
-+        errno = 0;
-+        unsigned long long __ull = __strtoull_l(__s, &__sanity, __base, 
-+                                                __cloc);
-+          if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
-+          __v = __ull;
-+        else
-+          __err |= ios_base::failbit;
-+      }  
-+    }
-+#endif
-+
-+  template<>
-+    void
-+    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
-+                 const __c_locale& __cloc, int)
-+    {
-+      if (!(__err & ios_base::failbit))
-+      {
-+        char* __sanity;
-+        errno = 0;
-+        float __f = __strtof_l(__s, &__sanity, __cloc);
-+          if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
-+          __v = __f;
-+        else
-+          __err |= ios_base::failbit;
-+      }
-+    }
-+
-+  template<>
-+    void
-+    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
-+                 const __c_locale& __cloc, int)
-+    {
-+      if (!(__err & ios_base::failbit))
-+      {
-+        char* __sanity;
-+        errno = 0;
-+        double __d = __strtod_l(__s, &__sanity, __cloc);
-+          if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
-+          __v = __d;
-+        else
-+          __err |= ios_base::failbit;
-+      }
-+    }
-+
-+  template<>
-+    void
-+    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
-+                 const __c_locale& __cloc, int)
-+    {
-+      if (!(__err & ios_base::failbit))
-+      {
-+        char* __sanity;
-+        errno = 0;
-+        long double __ld = __strtold_l(__s, &__sanity, __cloc);
-+          if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
-+          __v = __ld;
-+        else
-+          __err |= ios_base::failbit;
-+      }
-+    }
-+
-+  void
-+  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
-+                                  __c_locale __old)
-+  {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __cloc = __newlocale(1 << LC_ALL, __s, __old);
-+    if (!__cloc)
-+      {
-+      // This named locale is not supported by the underlying OS.
-+      __throw_runtime_error("attempt to create locale from unknown name");
-+      }
-+#else
-+    __cloc = NULL;
-+#endif
-+  }
-+  
-+  void
-+  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
-+  {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    if (_S_c_locale != __cloc)
-+      __freelocale(__cloc); 
-+#else
-+    __cloc = NULL;
-+#endif
-+  }
-+
-+  __c_locale
-+  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+  { return __duplocale(__cloc); }
-+#else
-+  { return __c_locale(); }
-+#endif
-+
-+  const char* locale::_S_categories[_S_categories_size 
-+                                  + _S_extra_categories_size] =
-+    {
-+      "LC_CTYPE", 
-+      "LC_NUMERIC",
-+      "LC_TIME", 
-+      "LC_COLLATE", 
-+      "LC_MONETARY",
-+      "LC_MESSAGES"
-+#if _GLIBCPP_NUM_CATEGORIES != 0
-+      , 
-+      "LC_PAPER", 
-+      "LC_NAME", 
-+      "LC_ADDRESS",
-+      "LC_TELEPHONE", 
-+      "LC_MEASUREMENT", 
-+      "LC_IDENTIFICATION" 
-+#endif
-+    };
-+}  // namespace std
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.h
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.h     1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.h      2004-01-09 07:51:06.000000000 -0600
-@@ -0,0 +1,118 @@
-+// Wrapper for underlying C-language localization -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.8  Standard locale categories.
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#ifndef _CPP_BITS_C_LOCALE_H
-+#define _CPP_BITS_C_LOCALE_H 1
-+
-+#pragma GCC system_header
-+
-+#include <clocale>
-+#include <langinfo.h>         // For codecvt
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix this
-+#endif
-+#ifdef __UCLIBC_HAS_LOCALE__
-+#include <iconv.h>            // For codecvt using iconv, iconv_t
-+#endif
-+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
-+#include <libintl.h>          // For messages
-+#endif
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning what is _GLIBCPP_C_LOCALE_GNU for
-+#endif
-+#define _GLIBCPP_C_LOCALE_GNU 1
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix categories
-+#endif
-+// #define _GLIBCPP_NUM_CATEGORIES 6
-+#define _GLIBCPP_NUM_CATEGORIES 0
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+namespace __gnu_cxx
-+{
-+  extern "C" __typeof(uselocale) __uselocale;
-+}
-+#endif
-+
-+namespace std
-+{
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+  typedef __locale_t          __c_locale;
-+#else
-+  typedef int*                        __c_locale;
-+#endif
-+
-+  // Convert numeric value of type _Tv to string and return length of
-+  // string.  If snprintf is available use it, otherwise fall back to
-+  // the unsafe sprintf which, in general, can be dangerous and should
-+  // be avoided.
-+  template<typename _Tv>
-+    int
-+    __convert_from_v(char* __out, const int __size, const char* __fmt,
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+                   _Tv __v, const __c_locale& __cloc, int __prec = -1)
-+    {
-+      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
-+#else
-+                   _Tv __v, const __c_locale&, int __prec = -1)
-+    {
-+# ifdef __UCLIBC_HAS_LOCALE__
-+      char* __old = setlocale(LC_ALL, NULL);
-+      char* __sav = static_cast<char*>(malloc(strlen(__old) + 1));
-+      if (__sav)
-+        strcpy(__sav, __old);
-+      setlocale(LC_ALL, "C");
-+# endif
-+#endif
-+
-+      int __ret;
-+      if (__prec >= 0)
-+        __ret = snprintf(__out, __size, __fmt, __prec, __v);
-+      else
-+        __ret = snprintf(__out, __size, __fmt, __v);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+      __gnu_cxx::__uselocale(__old);
-+#elif defined __UCLIBC_HAS_LOCALE__
-+      setlocale(LC_ALL, __sav);
-+      free(__sav);
-+#endif
-+      return __ret;
-+    }
-+}
-+
-+#endif
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_members.cc     1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_members.cc      2004-01-09 04:04:34.000000000 -0600
-@@ -0,0 +1,113 @@
-+// std::codecvt implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.1.5 - Template class codecvt
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+namespace std
-+{
-+  // Specializations.
-+#ifdef _GLIBCPP_USE_WCHAR_T
-+  codecvt_base::result
-+  codecvt<wchar_t, char, mbstate_t>::
-+  do_out(state_type& __state, const intern_type* __from, 
-+       const intern_type* __from_end, const intern_type*& __from_next,
-+       extern_type* __to, extern_type* __to_end,
-+       extern_type*& __to_next) const
-+  {
-+    result __ret = error;
-+    size_t __len = min(__from_end - __from, __to_end - __to);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_S_c_locale);
-+#endif
-+    size_t __conv = wcsrtombs(__to, &__from, __len, &__state);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+
-+    if (__conv == __len)
-+      {
-+      __from_next = __from;
-+      __to_next = __to + __conv;
-+      __ret = ok;
-+      }
-+    else if (__conv > 0 && __conv < __len)
-+      {
-+      __from_next = __from;
-+      __to_next = __to + __conv;
-+      __ret = partial;
-+      }
-+    else
-+      __ret = error;
-+      
-+    return __ret; 
-+  }
-+  
-+  codecvt_base::result
-+  codecvt<wchar_t, char, mbstate_t>::
-+  do_in(state_type& __state, const extern_type* __from, 
-+      const extern_type* __from_end, const extern_type*& __from_next,
-+      intern_type* __to, intern_type* __to_end,
-+      intern_type*& __to_next) const
-+  {
-+    result __ret = error;
-+    size_t __len = min(__from_end - __from, __to_end - __to);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_S_c_locale);
-+#endif
-+    size_t __conv = mbsrtowcs(__to, &__from, __len, &__state);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+
-+    if (__conv == __len)
-+      {
-+      __from_next = __from;
-+      __to_next = __to + __conv;
-+      __ret = ok;
-+      }
-+    else if (__conv > 0 && __conv < __len)
-+      {
-+      __from_next = __from;
-+      __to_next = __to + __conv;
-+      __ret = partial;
-+      }
-+    else
-+      __ret = error;
-+      
-+    return __ret; 
-+  }
-+#endif
-+}
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h      1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h       2004-01-09 01:53:51.000000000 -0600
-@@ -0,0 +1,461 @@
-+// Locale support (codecvt) -*- C++ -*-
-+
-+// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.1.5 Template class codecvt
-+//
-+
-+// Warning: this file is not meant for user inclusion.  Use <locale>.
-+
-+// Written by Benjamin Kosnik <bkoz@cygnus.com>
-+
-+  // XXX
-+  // Define this here to codecvt.cc can have _S_max_size definition.
-+#define _GLIBCPP_USE___ENC_TRAITS 1
-+
-+  // Extension to use icov for dealing with character encodings,
-+  // including conversions and comparisons between various character
-+  // sets.  This object encapsulates data that may need to be shared between
-+  // char_traits, codecvt and ctype.
-+  class __enc_traits
-+  {
-+  public:
-+    // Types: 
-+    // NB: A conversion descriptor subsumes and enhances the
-+    // functionality of a simple state type such as mbstate_t.
-+    typedef iconv_t   __desc_type;
-+    
-+  protected:
-+    // Data Members:
-+    // Max size of charset encoding name
-+    static const int  _S_max_size = 32;
-+    // Name of internal character set encoding.
-+    char              _M_int_enc[_S_max_size];
-+    // Name of external character set encoding.
-+    char              _M_ext_enc[_S_max_size];
-+
-+    // Conversion descriptor between external encoding to internal encoding.
-+    __desc_type               _M_in_desc;
-+    // Conversion descriptor between internal encoding to external encoding.
-+    __desc_type               _M_out_desc;
-+
-+    // Details the byte-order marker for the external encoding, if necessary.
-+    int                       _M_ext_bom;
-+
-+    // Details the byte-order marker for the internal encoding, if necessary.
-+    int                       _M_int_bom;
-+
-+  public:
-+    explicit __enc_traits() 
-+    : _M_in_desc(0), _M_out_desc(0), _M_ext_bom(0), _M_int_bom(0) 
-+    {
-+      memset(_M_int_enc, 0, _S_max_size);
-+      memset(_M_ext_enc, 0, _S_max_size);
-+    }
-+
-+    explicit __enc_traits(const char* __int, const char* __ext, 
-+                        int __ibom = 0, int __ebom = 0)
-+    : _M_in_desc(0), _M_out_desc(0), _M_ext_bom(0), _M_int_bom(0)
-+    {
-+      strncpy(_M_int_enc, __int, _S_max_size);
-+      strncpy(_M_ext_enc, __ext, _S_max_size);
-+    }
-+
-+    // 21.1.2 traits typedefs
-+    // p4
-+    // typedef STATE_T state_type
-+    // requires: state_type shall meet the requirements of
-+    // CopyConstructible types (20.1.3)
-+    __enc_traits(const __enc_traits& __obj): _M_in_desc(0), _M_out_desc(0)
-+    {
-+      strncpy(_M_int_enc, __obj._M_int_enc, _S_max_size);
-+      strncpy(_M_ext_enc, __obj._M_ext_enc, _S_max_size);
-+      _M_ext_bom = __obj._M_ext_bom;
-+      _M_int_bom = __obj._M_int_bom;
-+    }
-+
-+    // Need assignment operator as well.
-+    __enc_traits&
-+    operator=(const __enc_traits& __obj)
-+    {
-+      strncpy(_M_int_enc, __obj._M_int_enc, _S_max_size);
-+      strncpy(_M_ext_enc, __obj._M_ext_enc, _S_max_size);
-+      _M_in_desc = 0;
-+      _M_out_desc = 0;
-+      _M_ext_bom = __obj._M_ext_bom;
-+      _M_int_bom = __obj._M_int_bom;
-+      return *this;
-+    }
-+
-+    ~__enc_traits()
-+    {
-+      __desc_type __err = reinterpret_cast<iconv_t>(-1);
-+      if (_M_in_desc && _M_in_desc != __err) 
-+      iconv_close(_M_in_desc);
-+      if (_M_out_desc && _M_out_desc != __err) 
-+      iconv_close(_M_out_desc);
-+    } 
-+
-+    void
-+    _M_init()
-+    {
-+      const __desc_type __err = reinterpret_cast<iconv_t>(-1);
-+      if (!_M_in_desc)
-+      {
-+        _M_in_desc = iconv_open(_M_int_enc, _M_ext_enc);
-+        if (_M_in_desc == __err)
-+          __throw_runtime_error("creating iconv input descriptor failed.");
-+      }
-+      if (!_M_out_desc)
-+      {
-+        _M_out_desc = iconv_open(_M_ext_enc, _M_int_enc);
-+        if (_M_out_desc == __err)
-+          __throw_runtime_error("creating iconv output descriptor failed.");
-+      }
-+    }
-+
-+    bool
-+    _M_good()
-+    { 
-+      const __desc_type __err = reinterpret_cast<iconv_t>(-1);
-+      bool __test = _M_in_desc && _M_in_desc != __err; 
-+      __test &=  _M_out_desc && _M_out_desc != __err;
-+      return __test;
-+    }
-+
-+    const __desc_type* 
-+    _M_get_in_descriptor()
-+    { return &_M_in_desc; }
-+
-+    const __desc_type* 
-+    _M_get_out_descriptor()
-+    { return &_M_out_desc; }
-+
-+    int 
-+    _M_get_external_bom()
-+    { return _M_ext_bom; }
-+
-+    int 
-+    _M_get_internal_bom()
-+    { return _M_int_bom; }
-+
-+    const char* 
-+    _M_get_internal_enc()
-+    { return _M_int_enc; }
-+
-+    const char* 
-+    _M_get_external_enc()
-+    { return _M_ext_enc; }
-+  };
-+
-+  // Partial specialization
-+  // This specialization takes advantage of iconv to provide code
-+  // conversions between a large number of character encodings.
-+  template<typename _InternT, typename _ExternT>
-+    class codecvt<_InternT, _ExternT, __enc_traits>
-+    : public __codecvt_abstract_base<_InternT, _ExternT, __enc_traits>
-+    {
-+    public:      
-+      // Types:
-+      typedef codecvt_base::result                    result;
-+      typedef _InternT                                        intern_type;
-+      typedef _ExternT                                        extern_type;
-+      typedef __enc_traits                            state_type;
-+      typedef __enc_traits::__desc_type               __desc_type;
-+      typedef __enc_traits                            __enc_type;
-+
-+      // Data Members:
-+      static locale::id               id;
-+
-+      explicit 
-+      codecvt(size_t __refs = 0)
-+      : __codecvt_abstract_base<intern_type, extern_type, state_type>(__refs)
-+      { }
-+
-+      explicit 
-+      codecvt(__enc_type* __enc, size_t __refs = 0)
-+      : __codecvt_abstract_base<intern_type, extern_type, state_type>(__refs)
-+      { }
-+
-+    protected:
-+      virtual 
-+      ~codecvt() { }
-+
-+      virtual result
-+      do_out(state_type& __state, const intern_type* __from, 
-+           const intern_type* __from_end, const intern_type*& __from_next,
-+           extern_type* __to, extern_type* __to_end,
-+           extern_type*& __to_next) const;
-+
-+      virtual result
-+      do_unshift(state_type& __state, extern_type* __to, 
-+               extern_type* __to_end, extern_type*& __to_next) const;
-+
-+      virtual result
-+      do_in(state_type& __state, const extern_type* __from, 
-+          const extern_type* __from_end, const extern_type*& __from_next,
-+          intern_type* __to, intern_type* __to_end, 
-+          intern_type*& __to_next) const;
-+
-+      virtual int 
-+      do_encoding() const throw();
-+
-+      virtual bool 
-+      do_always_noconv() const throw();
-+
-+      virtual int 
-+      do_length(const state_type&, const extern_type* __from, 
-+              const extern_type* __end, size_t __max) const;
-+
-+      virtual int 
-+      do_max_length() const throw();
-+    };
-+
-+  template<typename _InternT, typename _ExternT>
-+    locale::id 
-+    codecvt<_InternT, _ExternT, __enc_traits>::id;
-+
-+  // This adaptor works around the signature problems of the second
-+  // argument to iconv():  SUSv2 and others use 'const char**', but glibc 2.2
-+  // uses 'char**', which matches the POSIX 1003.1-2001 standard.
-+  // Using this adaptor, g++ will do the work for us.
-+  template<typename _T>
-+    inline size_t
-+    __iconv_adaptor(size_t(*__func)(iconv_t, _T, size_t*, char**, size_t*),
-+                    iconv_t __cd, char** __inbuf, size_t* __inbytes,
-+                    char** __outbuf, size_t* __outbytes)
-+    { return __func(__cd, (_T)__inbuf, __inbytes, __outbuf, __outbytes); }
-+
-+  template<typename _InternT, typename _ExternT>
-+    codecvt_base::result
-+    codecvt<_InternT, _ExternT, __enc_traits>::
-+    do_out(state_type& __state, const intern_type* __from, 
-+         const intern_type* __from_end, const intern_type*& __from_next,
-+         extern_type* __to, extern_type* __to_end,
-+         extern_type*& __to_next) const
-+    {
-+      result __ret = codecvt_base::error;
-+      if (__state._M_good())
-+      {
-+        typedef state_type::__desc_type       __desc_type;
-+        const __desc_type* __desc = __state._M_get_out_descriptor();
-+        const size_t __fmultiple = sizeof(intern_type);
-+        size_t __fbytes = __fmultiple * (__from_end - __from);
-+        const size_t __tmultiple = sizeof(extern_type);
-+        size_t __tbytes = __tmultiple * (__to_end - __to); 
-+        
-+        // Argument list for iconv specifies a byte sequence. Thus,
-+        // all to/from arrays must be brutally casted to char*.
-+        char* __cto = reinterpret_cast<char*>(__to);
-+        char* __cfrom;
-+        size_t __conv;
-+
-+        // Some encodings need a byte order marker as the first item
-+        // in the byte stream, to designate endian-ness. The default
-+        // value for the byte order marker is NULL, so if this is
-+        // the case, it's not necessary and we can just go on our
-+        // merry way.
-+        int __int_bom = __state._M_get_internal_bom();
-+        if (__int_bom)
-+          {     
-+            size_t __size = __from_end - __from;
-+            intern_type* __cfixed = static_cast<intern_type*>(__builtin_alloca(sizeof(intern_type) * (__size + 1)));
-+            __cfixed[0] = static_cast<intern_type>(__int_bom);
-+            char_traits<intern_type>::copy(__cfixed + 1, __from, __size);
-+            __cfrom = reinterpret_cast<char*>(__cfixed);
-+            __conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
-+                                        &__fbytes, &__cto, &__tbytes); 
-+          }
-+        else
-+          {
-+            intern_type* __cfixed = const_cast<intern_type*>(__from);
-+            __cfrom = reinterpret_cast<char*>(__cfixed);
-+            __conv = __iconv_adaptor(iconv, *__desc, &__cfrom, &__fbytes, 
-+                                     &__cto, &__tbytes); 
-+          }
-+
-+        if (__conv != size_t(-1))
-+          {
-+            __from_next = reinterpret_cast<const intern_type*>(__cfrom);
-+            __to_next = reinterpret_cast<extern_type*>(__cto);
-+            __ret = codecvt_base::ok;
-+          }
-+        else 
-+          {
-+            if (__fbytes < __fmultiple * (__from_end - __from))
-+              {
-+                __from_next = reinterpret_cast<const intern_type*>(__cfrom);
-+                __to_next = reinterpret_cast<extern_type*>(__cto);
-+                __ret = codecvt_base::partial;
-+              }
-+            else
-+              __ret = codecvt_base::error;
-+          }
-+      }
-+      return __ret; 
-+    }
-+
-+  template<typename _InternT, typename _ExternT>
-+    codecvt_base::result
-+    codecvt<_InternT, _ExternT, __enc_traits>::
-+    do_unshift(state_type& __state, extern_type* __to, 
-+             extern_type* __to_end, extern_type*& __to_next) const
-+    {
-+      result __ret = codecvt_base::error;
-+      if (__state._M_good())
-+      {
-+        typedef state_type::__desc_type       __desc_type;
-+        const __desc_type* __desc = __state._M_get_in_descriptor();
-+        const size_t __tmultiple = sizeof(intern_type);
-+        size_t __tlen = __tmultiple * (__to_end - __to); 
-+        
-+        // Argument list for iconv specifies a byte sequence. Thus,
-+        // all to/from arrays must be brutally casted to char*.
-+        char* __cto = reinterpret_cast<char*>(__to);
-+        size_t __conv = __iconv_adaptor(iconv,*__desc, NULL, NULL,
-+                                          &__cto, &__tlen); 
-+        
-+        if (__conv != size_t(-1))
-+          {
-+            __to_next = reinterpret_cast<extern_type*>(__cto);
-+            if (__tlen == __tmultiple * (__to_end - __to))
-+              __ret = codecvt_base::noconv;
-+            else if (__tlen == 0)
-+              __ret = codecvt_base::ok;
-+            else
-+              __ret = codecvt_base::partial;
-+          }
-+        else 
-+          __ret = codecvt_base::error;
-+      }
-+      return __ret; 
-+    }
-+   
-+  template<typename _InternT, typename _ExternT>
-+    codecvt_base::result
-+    codecvt<_InternT, _ExternT, __enc_traits>::
-+    do_in(state_type& __state, const extern_type* __from, 
-+        const extern_type* __from_end, const extern_type*& __from_next,
-+        intern_type* __to, intern_type* __to_end, 
-+        intern_type*& __to_next) const
-+    { 
-+      result __ret = codecvt_base::error;
-+      if (__state._M_good())
-+      {
-+        typedef state_type::__desc_type       __desc_type;
-+        const __desc_type* __desc = __state._M_get_in_descriptor();
-+        const size_t __fmultiple = sizeof(extern_type);
-+        size_t __flen = __fmultiple * (__from_end - __from);
-+        const size_t __tmultiple = sizeof(intern_type);
-+        size_t __tlen = __tmultiple * (__to_end - __to); 
-+        
-+        // Argument list for iconv specifies a byte sequence. Thus,
-+        // all to/from arrays must be brutally casted to char*.
-+        char* __cto = reinterpret_cast<char*>(__to);
-+        char* __cfrom;
-+        size_t __conv;
-+
-+        // Some encodings need a byte order marker as the first item
-+        // in the byte stream, to designate endian-ness. The default
-+        // value for the byte order marker is NULL, so if this is
-+        // the case, it's not necessary and we can just go on our
-+        // merry way.
-+        int __ext_bom = __state._M_get_external_bom();
-+        if (__ext_bom)
-+          {     
-+            size_t __size = __from_end - __from;
-+            extern_type* __cfixed =  static_cast<extern_type*>(__builtin_alloca(sizeof(extern_type) * (__size + 1)));
-+            __cfixed[0] = static_cast<extern_type>(__ext_bom);
-+            char_traits<extern_type>::copy(__cfixed + 1, __from, __size);
-+            __cfrom = reinterpret_cast<char*>(__cfixed);
-+            __conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
-+                                       &__flen, &__cto, &__tlen); 
-+          }
-+        else
-+          {
-+            extern_type* __cfixed = const_cast<extern_type*>(__from);
-+            __cfrom = reinterpret_cast<char*>(__cfixed);
-+            __conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
-+                                       &__flen, &__cto, &__tlen); 
-+          }
-+
-+        
-+        if (__conv != size_t(-1))
-+          {
-+            __from_next = reinterpret_cast<const extern_type*>(__cfrom);
-+            __to_next = reinterpret_cast<intern_type*>(__cto);
-+            __ret = codecvt_base::ok;
-+          }
-+        else 
-+          {
-+            if (__flen < static_cast<size_t>(__from_end - __from))
-+              {
-+                __from_next = reinterpret_cast<const extern_type*>(__cfrom);
-+                __to_next = reinterpret_cast<intern_type*>(__cto);
-+                __ret = codecvt_base::partial;
-+              }
-+            else
-+              __ret = codecvt_base::error;
-+          }
-+      }
-+      return __ret; 
-+    }
-+  
-+  template<typename _InternT, typename _ExternT>
-+    int 
-+    codecvt<_InternT, _ExternT, __enc_traits>::
-+    do_encoding() const throw()
-+    {
-+      int __ret = 0;
-+      if (sizeof(_ExternT) <= sizeof(_InternT))
-+      __ret = sizeof(_InternT)/sizeof(_ExternT);
-+      return __ret; 
-+    }
-+  
-+  template<typename _InternT, typename _ExternT>
-+    bool 
-+    codecvt<_InternT, _ExternT, __enc_traits>::
-+    do_always_noconv() const throw()
-+    { return false; }
-+  
-+  template<typename _InternT, typename _ExternT>
-+    int 
-+    codecvt<_InternT, _ExternT, __enc_traits>::
-+    do_length(const state_type&, const extern_type* __from, 
-+            const extern_type* __end, size_t __max) const
-+    { return min(__max, static_cast<size_t>(__end - __from)); }
-+
-+#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
-+// 74.  Garbled text for codecvt::do_max_length
-+  template<typename _InternT, typename _ExternT>
-+    int 
-+    codecvt<_InternT, _ExternT, __enc_traits>::
-+    do_max_length() const throw()
-+    { return 1; }
-+#endif
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/collate_members.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/collate_members.cc     1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/collate_members.cc      2004-01-09 08:06:24.000000000 -0600
-@@ -0,0 +1,80 @@
-+// std::collate implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
-+#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
-+#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
-+#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
-+#endif
-+
-+namespace std
-+{
-+  // These are basically extensions to char_traits, and perhaps should
-+  // be put there instead of here.
-+  template<>
-+    int 
-+    collate<char>::_M_compare(const char* __one, const char* __two) const
-+    { 
-+      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
-+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
-+    }
-+  
-+  template<>
-+    size_t
-+    collate<char>::_M_transform(char* __to, const char* __from, 
-+                              size_t __n) const 
-+    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
-+
-+#ifdef _GLIBCPP_USE_WCHAR_T
-+  template<>
-+    int 
-+    collate<wchar_t>::_M_compare(const wchar_t* __one, 
-+                               const wchar_t* __two) const
-+    {
-+      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
-+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
-+    }
-+  
-+  template<>
-+    size_t
-+    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
-+                                 size_t __n) const
-+    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
-+#endif
-+}
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/ctype_members.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc       1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/ctype_members.cc        2004-01-09 08:15:41.000000000 -0600
-@@ -0,0 +1,274 @@
-+// std::ctype implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#define _LIBC
-+#include <locale>
-+#undef _LIBC
-+#include <bits/c++locale_internal.h>
-+
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __wctype_l(S, L)           wctype((S))
-+#define __towupper_l(C, L)         towupper((C))
-+#define __towlower_l(C, L)         towlower((C))
-+#define __iswctype_l(C, M, L)      iswctype((C), (M))
-+#endif
-+
-+namespace std
-+{
-+  // NB: The other ctype<char> specializations are in src/locale.cc and
-+  // various /config/os/* files.
-+  template<>
-+    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
-+    : ctype<char>(0, false, __refs) 
-+    {         
-+      _S_destroy_c_locale(_M_c_locale_ctype);
-+      _S_create_c_locale(_M_c_locale_ctype, __s); 
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+      _M_toupper = _M_c_locale_ctype->__ctype_toupper;
-+      _M_tolower = _M_c_locale_ctype->__ctype_tolower;
-+      _M_table = _M_c_locale_ctype->__ctype_b;
-+#endif
-+    }
-+
-+#ifdef _GLIBCPP_USE_WCHAR_T  
-+  ctype<wchar_t>::__wmask_type
-+  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
-+  {
-+    __wmask_type __ret;
-+    switch (__m)
-+      {
-+      case space:
-+      __ret = __wctype_l("space", _M_c_locale_ctype);
-+      break;
-+      case print:
-+      __ret = __wctype_l("print", _M_c_locale_ctype);
-+      break;
-+      case cntrl:
-+      __ret = __wctype_l("cntrl", _M_c_locale_ctype);
-+      break;
-+      case upper:
-+      __ret = __wctype_l("upper", _M_c_locale_ctype);
-+      break;
-+      case lower:
-+      __ret = __wctype_l("lower", _M_c_locale_ctype);
-+      break;
-+      case alpha:
-+      __ret = __wctype_l("alpha", _M_c_locale_ctype);
-+      break;
-+      case digit:
-+      __ret = __wctype_l("digit", _M_c_locale_ctype);
-+      break;
-+      case punct:
-+      __ret = __wctype_l("punct", _M_c_locale_ctype);
-+      break;
-+      case xdigit:
-+      __ret = __wctype_l("xdigit", _M_c_locale_ctype);
-+      break;
-+      case alnum:
-+      __ret = __wctype_l("alnum", _M_c_locale_ctype);
-+      break;
-+      case graph:
-+      __ret = __wctype_l("graph", _M_c_locale_ctype);
-+      break;
-+      default:
-+      __ret = 0;
-+      }
-+    return __ret;
-+  };
-+  
-+  wchar_t
-+  ctype<wchar_t>::do_toupper(wchar_t __c) const
-+  { return __towupper_l(__c, _M_c_locale_ctype); }
-+
-+  const wchar_t*
-+  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
-+  {
-+    while (__lo < __hi)
-+      {
-+        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
-+        ++__lo;
-+      }
-+    return __hi;
-+  }
-+  
-+  wchar_t
-+  ctype<wchar_t>::do_tolower(wchar_t __c) const
-+  { return __towlower_l(__c, _M_c_locale_ctype); }
-+  
-+  const wchar_t*
-+  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
-+  {
-+    while (__lo < __hi)
-+      {
-+        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
-+        ++__lo;
-+      }
-+    return __hi;
-+  }
-+
-+  bool
-+  ctype<wchar_t>::
-+  do_is(mask __m, wchar_t __c) const
-+  { 
-+    // Highest bitmask in ctype_base == 10, but extra in "C"
-+    // library for blank.
-+    bool __ret = false;
-+    const size_t __bitmasksize = 11; 
-+    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
-+      {
-+      const mask __bit = static_cast<mask>(_ISbit(__bitcur));
-+      if (__m & __bit)
-+        __ret |= __iswctype_l(__c, _M_convert_to_wmask(__bit), 
-+                              _M_c_locale_ctype); 
-+      }
-+    return __ret;    
-+  }
-+  
-+  const wchar_t* 
-+  ctype<wchar_t>::
-+  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
-+  {
-+    for (;__lo < __hi; ++__vec, ++__lo)
-+      {
-+      // Highest bitmask in ctype_base == 10, but extra in "C"
-+      // library for blank.
-+      const size_t __bitmasksize = 11; 
-+      mask __m = 0;
-+      for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
-+        { 
-+          const mask __bit = static_cast<mask>(_ISbit(__bitcur));
-+          if (__iswctype_l(*__lo, _M_convert_to_wmask(__bit), 
-+                           _M_c_locale_ctype))
-+            __m |= __bit;
-+        }
-+      *__vec = __m;
-+      }
-+    return __hi;
-+  }
-+  
-+  const wchar_t* 
-+  ctype<wchar_t>::
-+  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
-+  {
-+    while (__lo < __hi && !this->do_is(__m, *__lo))
-+      ++__lo;
-+    return __lo;
-+  }
-+
-+  const wchar_t*
-+  ctype<wchar_t>::
-+  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
-+  {
-+    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
-+      ++__lo;
-+    return __lo;
-+  }
-+
-+  wchar_t
-+  ctype<wchar_t>::
-+  do_widen(char __c) const
-+  {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_ctype);
-+#endif
-+    wchar_t __ret = btowc(__c);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+    return __ret;
-+  }
-+
-+  const char* 
-+  ctype<wchar_t>::
-+  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
-+  {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_ctype);
-+#endif
-+    mbstate_t __state;
-+    memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
-+    mbsrtowcs(__dest, &__lo, __hi - __lo, &__state);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+    return __hi;
-+  }
-+
-+  char
-+  ctype<wchar_t>::
-+  do_narrow(wchar_t __wc, char __dfault) const
-+  { 
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_ctype);
-+#endif
-+    int __c = wctob(__wc);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
-+  }
-+
-+  const wchar_t*
-+  ctype<wchar_t>::
-+  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
-+          char* __dest) const
-+  {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_ctype);
-+#endif
-+    size_t __offset = 0;
-+    while (true)
-+      {
-+      const wchar_t* __start = __lo + __offset;        
-+      size_t __len = __hi - __start;
-+      
-+      mbstate_t __state;
-+      memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
-+      size_t __con = wcsrtombs(__dest + __offset, &__start, __len, &__state);
-+      if (__con != __len && __start != 0)
-+        {
-+          __offset = __start - __lo;          
-+          __dest[__offset++] = __dfault;
-+        }
-+      else
-+        break;
-+      }
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+    return __hi;
-+  }
-+#endif //  _GLIBCPP_USE_WCHAR_T
-+}
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.cc    1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.cc     2004-01-09 08:46:16.000000000 -0600
-@@ -0,0 +1,100 @@
-+// std::messages implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix gettext stuff
-+#endif
-+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
-+extern "C" char *__dcgettext(const char *domainname,
-+                           const char *msgid, int category);
-+#undef gettext
-+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
-+#else
-+#undef gettext
-+#define gettext(msgid) (msgid)
-+#endif
-+
-+namespace std
-+{
-+  // Specializations.
-+  template<>
-+    string
-+    messages<char>::do_get(catalog, int, int, const string& __dfault) const
-+    {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+      __c_locale __old = __uselocale(_M_c_locale_messages);
-+      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
-+      __uselocale(__old);
-+      return string(__msg);
-+#elif defined __UCLIBC_HAS_LOCALE__
-+      char* __old = strdup(setlocale(LC_ALL, NULL));
-+      setlocale(LC_ALL, _M_name_messages);
-+      const char* __msg = gettext(__dfault.c_str());
-+      setlocale(LC_ALL, __old);
-+      free(__old);
-+      return string(__msg);
-+#else
-+      const char* __msg = gettext(__dfault.c_str());
-+      return string(__msg);
-+#endif
-+    }
-+
-+#ifdef _GLIBCPP_USE_WCHAR_T
-+  template<>
-+    wstring
-+    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
-+    {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+      __c_locale __old = __uselocale(_M_c_locale_messages);
-+      char* __msg = gettext(_M_convert_to_char(__dfault));
-+      __uselocale(__old);
-+      return _M_convert_from_char(__msg);
-+#elif defined __UCLIBC_HAS_LOCALE__
-+      char* __old = strdup(setlocale(LC_ALL, NULL));
-+      setlocale(LC_ALL, _M_name_messages);
-+      char* __msg = gettext(_M_convert_to_char(__dfault));
-+      setlocale(LC_ALL, __old);
-+      free(__old);
-+      return _M_convert_from_char(__msg);
-+# else
-+      char* __msg = gettext(_M_convert_to_char(__dfault));
-+      return _M_convert_from_char(__msg);
-+# endif
-+    }
-+#endif
-+}
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.h
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.h     1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.h      2004-01-09 08:52:48.000000000 -0600
-@@ -0,0 +1,122 @@
-+// std::messages implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.7.1.2  messages functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix prototypes for *textdomain funcs
-+#endif
-+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
-+extern "C" char *__textdomain(const char *domainname);
-+extern "C" char *__bindtextdomain(const char *domainname,
-+                                const char *dirname);
-+#else
-+#undef __textdomain
-+#undef __bindtextdomain
-+#define __textdomain(D)           ((void)0)
-+#define __bindtextdomain(D,P)     ((void)0)
-+#endif
-+
-+  // Non-virtual member functions.
-+  template<typename _CharT>
-+     messages<_CharT>::messages(size_t __refs)
-+     : locale::facet(__refs)
-+     {  
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+       _M_name_messages = _S_c_name;
-+#endif
-+       _M_c_locale_messages = _S_c_locale; 
-+     }
-+
-+  template<typename _CharT>
-+     messages<_CharT>::messages(__c_locale __cloc, 
-+                              const char* __s, size_t __refs) 
-+     : locale::facet(__refs)
-+     {
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+       _M_name_messages = new char[strlen(__s) + 1];
-+       strcpy(_M_name_messages, __s);
-+#endif
-+       _M_c_locale_messages = _S_clone_c_locale(__cloc); 
-+     }
-+
-+  template<typename _CharT>
-+    typename messages<_CharT>::catalog 
-+    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
-+                         const char* __dir) const
-+    { 
-+      __bindtextdomain(__s.c_str(), __dir);
-+      return this->do_open(__s, __loc); 
-+    }
-+
-+  // Virtual member functions.
-+  template<typename _CharT>
-+    messages<_CharT>::~messages()
-+    { 
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+      if (_S_c_name != _M_name_messages)
-+      delete [] _M_name_messages;
-+#endif
-+      _S_destroy_c_locale(_M_c_locale_messages); 
-+    }
-+
-+  template<typename _CharT>
-+    typename messages<_CharT>::catalog 
-+    messages<_CharT>::do_open(const basic_string<char>& __s, 
-+                            const locale&) const
-+    { 
-+      // No error checking is done, assume the catalog exists and can
-+      // be used.
-+      __textdomain(__s.c_str());
-+      return 0;
-+    }
-+
-+  template<typename _CharT>
-+    void    
-+    messages<_CharT>::do_close(catalog) const 
-+    { }
-+
-+   // messages_byname
-+   template<typename _CharT>
-+     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
-+     : messages<_CharT>(__refs) 
-+     { 
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+       if (_S_c_name != _M_name_messages)
-+       delete [] _M_name_messages;
-+       _M_name_messages = new char[strlen(__s) + 1];
-+       strcpy(_M_name_messages, __s);
-+#endif
-+       _S_destroy_c_locale(_M_c_locale_messages);
-+       _S_create_c_locale(_M_c_locale_messages, __s); 
-+     }
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/monetary_members.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc    1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/monetary_members.cc     2004-01-09 18:20:23.000000000 -0600
-@@ -0,0 +1,578 @@
-+// std::moneypunct implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#define _LIBC
-+#include <locale>
-+#undef _LIBC
-+#include <bits/c++locale_internal.h>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning optimize this for uclibc
-+#warning tailor for stub locale support
-+#endif
-+
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
-+#endif
-+
-+namespace std
-+{
-+  // Construct and return valid pattern consisting of some combination of:
-+  // space none symbol sign value
-+  money_base::pattern
-+  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
-+  { 
-+    pattern __ret;
-+
-+    // This insanely complicated routine attempts to construct a valid
-+    // pattern for use with monyepunct. A couple of invariants:
-+
-+    // if (__precedes) symbol -> value
-+    // else value -> symbol
-+    
-+    // if (__space) space
-+    // else none
-+
-+    // none == never first
-+    // space never first or last
-+
-+    // Any elegant implementations of this are welcome.
-+    switch (__posn)
-+      {
-+      case 0:
-+      case 1:
-+      // 1 The sign precedes the value and symbol.
-+      if (__space)
-+        {
-+          // Pattern starts with sign.
-+          if (__precedes)
-+            {
-+              __ret.field[1] = symbol;
-+              __ret.field[2] = space;
-+              __ret.field[3] = value;
-+            }
-+          else
-+            {
-+              __ret.field[1] = value;
-+              __ret.field[2] = space;
-+              __ret.field[3] = symbol;
-+            }
-+          __ret.field[0] = sign;
-+        }
-+      else
-+        {
-+          // Pattern starts with sign and ends with none.
-+          if (__precedes)
-+            {
-+              __ret.field[1] = symbol;
-+              __ret.field[2] = value;
-+            }
-+          else
-+            {
-+              __ret.field[1] = value;
-+              __ret.field[2] = symbol;
-+            }
-+          __ret.field[0] = sign;
-+          __ret.field[3] = none;
-+        }
-+      break;
-+      case 2:
-+      // 2 The sign follows the value and symbol.
-+      if (__space)
-+        {
-+          // Pattern either ends with sign.
-+          if (__precedes)
-+            {
-+              __ret.field[0] = symbol;
-+              __ret.field[1] = space;
-+              __ret.field[2] = value;
-+            }
-+          else
-+            {
-+              __ret.field[0] = value;
-+              __ret.field[1] = space;
-+              __ret.field[2] = symbol;
-+            }
-+          __ret.field[3] = sign;
-+        }
-+      else
-+        {
-+          // Pattern ends with sign then none.
-+          if (__precedes)
-+            {
-+              __ret.field[0] = symbol;
-+              __ret.field[1] = value;
-+            }
-+          else
-+            {
-+              __ret.field[0] = value;
-+              __ret.field[1] = symbol;
-+            }
-+          __ret.field[2] = sign;
-+          __ret.field[3] = none;
-+        }
-+      break;
-+      case 3:
-+      // 3 The sign immediately precedes the symbol.
-+      if (__space)
-+        {
-+          // Have space.
-+          if (__precedes)
-+            {
-+              __ret.field[0] = sign;
-+              __ret.field[1] = symbol;
-+              __ret.field[2] = space;
-+              __ret.field[3] = value;
-+            }
-+          else
-+            {
-+              __ret.field[0] = value;
-+              __ret.field[1] = space;
-+              __ret.field[2] = sign;
-+              __ret.field[3] = symbol;
-+            }
-+        }
-+      else
-+        {
-+          // Have none.
-+          if (__precedes)
-+            {
-+              __ret.field[0] = sign;
-+              __ret.field[1] = symbol;
-+              __ret.field[2] = value;
-+            }
-+          else
-+            {
-+              __ret.field[0] = value;
-+              __ret.field[1] = sign;
-+              __ret.field[2] = symbol;
-+            }
-+          __ret.field[3] = none;
-+        }
-+      break;
-+      case 4:
-+      // 4 The sign immediately follows the symbol. 
-+      if (__space)
-+        {
-+          // Have space.
-+          if (__precedes)
-+            {
-+              __ret.field[0] = symbol;
-+              __ret.field[1] = sign;
-+              __ret.field[2] = space;
-+              __ret.field[3] = value;
-+            }
-+          else
-+            {
-+              __ret.field[0] = value;
-+              __ret.field[1] = space;
-+              __ret.field[2] = symbol;
-+              __ret.field[3] = sign;
-+            }
-+        }
-+      else
-+        {
-+          // Have none.
-+          if (__precedes)
-+            {
-+              __ret.field[0] = symbol;
-+              __ret.field[1] = sign;
-+              __ret.field[2] = value;
-+            }
-+          else
-+            {
-+              __ret.field[0] = value;
-+              __ret.field[1] = symbol;
-+              __ret.field[2] = sign;
-+            }
-+          __ret.field[3] = none;
-+        }
-+      break;
-+      default:
-+      ;
-+      }
-+    return __ret;
-+  }
-+
-+  template<> 
-+    void
-+    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
-+                                                   const char*)
-+    {
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_decimal_point = '.';
-+        _M_thousands_sep = ',';
-+        _M_grouping = "";
-+        _M_curr_symbol = "";
-+        _M_positive_sign = "";
-+        _M_negative_sign = "";
-+        _M_frac_digits = 0;
-+        _M_pos_format = money_base::_S_default_pattern;
-+        _M_neg_format = money_base::_S_default_pattern;
-+      }
-+      else
-+      {
-+        // Named locale.
-+        _M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, __cloc));
-+        _M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, __cloc));
-+        _M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
-+        _M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
-+
-+        char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
-+        if (!__nposn)
-+          _M_negative_sign = "()";
-+        else
-+          _M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
-+
-+        // _Intl == true
-+        _M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
-+        _M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, __cloc));
-+        char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
-+        char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
-+        char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
-+        _M_pos_format = _S_construct_pattern(__pprecedes, __pspace, __pposn);
-+        char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
-+        char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
-+        _M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
-+      }
-+    }
-+
-+  template<> 
-+    void
-+    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
-+                                                    const char*)
-+    {
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_decimal_point = '.';
-+        _M_thousands_sep = ',';
-+        _M_grouping = "";
-+        _M_curr_symbol = "";
-+        _M_positive_sign = "";
-+        _M_negative_sign = "";
-+        _M_frac_digits = 0;
-+        _M_pos_format = money_base::_S_default_pattern;
-+        _M_neg_format = money_base::_S_default_pattern;
-+      }
-+      else
-+      {
-+        // Named locale.
-+        _M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, __cloc));
-+        _M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, __cloc));
-+        _M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
-+        _M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
-+
-+        char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
-+        if (!__nposn)
-+          _M_negative_sign = "()";
-+        else
-+          _M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
-+
-+        // _Intl == false
-+        _M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
-+        _M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
-+        char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
-+        char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
-+        char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
-+        _M_pos_format = _S_construct_pattern(__pprecedes, __pspace, __pposn);
-+        char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
-+        char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
-+        _M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
-+      }
-+    }
-+
-+  template<> 
-+    moneypunct<char, true>::~moneypunct()
-+    { }
-+
-+  template<> 
-+    moneypunct<char, false>::~moneypunct()
-+    { }
-+
-+#ifdef _GLIBCPP_USE_WCHAR_T
-+  template<> 
-+    void
-+    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+                                                      const char*)
-+#else
-+                                                      const char* __name)
-+#endif
-+    {
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_decimal_point = L'.';
-+        _M_thousands_sep = L',';
-+        _M_grouping = "";
-+        _M_curr_symbol = L"";
-+        _M_positive_sign = L"";
-+        _M_negative_sign = L"";
-+        _M_frac_digits = 0;
-+        _M_pos_format = money_base::_S_default_pattern;
-+        _M_neg_format = money_base::_S_default_pattern;
-+      }
-+      else
-+      {
-+        // Named locale.
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+        __c_locale __old = __uselocale(__cloc);
-+#else
-+        // Switch to named locale so that mbsrtowcs will work.
-+        char* __old = strdup(setlocale(LC_ALL, NULL));
-+        setlocale(LC_ALL, __name);
-+#endif
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix this
-+#endif
-+#ifdef __UCLIBC__
-+# ifdef __UCLIBC_HAS_XLOCALE__
-+        _M_decimal_point = __cloc->decimal_point_wc;
-+        _M_thousands_sep = __cloc->thousands_sep_wc;
-+# else
-+        _M_decimal_point = __global_locale->decimal_point_wc;
-+        _M_thousands_sep = __global_locale->thousands_sep_wc;
-+# endif
-+#else
-+        _M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
-+
-+        _M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
-+#endif
-+        _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
-+
-+        const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
-+        const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
-+        const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
-+
-+        mbstate_t __state;
-+        size_t __len = strlen(__cpossign);
-+        if (__len)
-+          {
-+            ++__len;
-+            memset(&__state, 0, sizeof(mbstate_t));
-+            wchar_t* __wcs = new wchar_t[__len];
-+            mbsrtowcs(__wcs, &__cpossign, __len, &__state);
-+            _M_positive_sign = __wcs;
-+          }
-+        else
-+          _M_positive_sign = L"";
-+
-+        char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
-+        __len = strlen(__cnegsign);
-+        if (!__nposn)
-+          _M_negative_sign = L"()";
-+        else if (__len)
-+          { 
-+            ++__len;
-+            memset(&__state, 0, sizeof(mbstate_t));
-+            wchar_t* __wcs = new wchar_t[__len];
-+            mbsrtowcs(__wcs, &__cnegsign, __len, &__state);
-+            _M_negative_sign = __wcs;
-+          }
-+        else
-+          _M_negative_sign = L"";
-+
-+        // _Intl == true.
-+        __len = strlen(__ccurr);
-+        if (__len)
-+          {
-+            ++__len;
-+            memset(&__state, 0, sizeof(mbstate_t));
-+            wchar_t* __wcs = new wchar_t[__len];
-+            mbsrtowcs(__wcs, &__ccurr, __len, &__state);
-+            _M_curr_symbol = __wcs;
-+          }
-+        else
-+          _M_curr_symbol = L"";
-+
-+        _M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, __cloc));
-+        char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
-+        char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
-+        char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
-+        _M_pos_format = _S_construct_pattern(__pprecedes, __pspace, __pposn);
-+        char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
-+        char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
-+        _M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+        __uselocale(__old);
-+#else
-+        setlocale(LC_ALL, __old);
-+        free(__old);
-+#endif
-+      }
-+    }
-+
-+  template<> 
-+    void
-+    moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+                                                       const char*)
-+#else
-+                                                       const char* __name)
-+#endif
-+    {
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_decimal_point = L'.';
-+        _M_thousands_sep = L',';
-+        _M_grouping = "";
-+        _M_curr_symbol = L"";
-+        _M_positive_sign = L"";
-+        _M_negative_sign = L"";
-+        _M_frac_digits = 0;
-+        _M_pos_format = money_base::_S_default_pattern;
-+        _M_neg_format = money_base::_S_default_pattern;
-+      }
-+      else
-+      {
-+        // Named locale.
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+        __c_locale __old = __uselocale(__cloc);
-+#else
-+        // Switch to named locale so that mbsrtowcs will work.
-+        char* __old = strdup(setlocale(LC_ALL, NULL));
-+        setlocale(LC_ALL, __name);
-+#endif
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix this
-+#endif
-+#ifdef __UCLIBC__
-+# ifdef __UCLIBC_HAS_XLOCALE__
-+        _M_decimal_point = __cloc->decimal_point_wc;
-+        _M_thousands_sep = __cloc->thousands_sep_wc;
-+# else
-+        _M_decimal_point = __global_locale->decimal_point_wc;
-+        _M_thousands_sep = __global_locale->thousands_sep_wc;
-+# endif
-+#else
-+        _M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
-+        _M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
-+#endif
-+        _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
-+
-+        const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
-+        const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
-+        const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
-+
-+        mbstate_t __state;
-+        size_t __len;
-+        __len = strlen(__cpossign);
-+        if (__len)
-+          {
-+            ++__len;
-+            memset(&__state, 0, sizeof(mbstate_t));
-+            wchar_t* __wcs = new wchar_t[__len];
-+            mbsrtowcs(__wcs, &__cpossign, __len, &__state);
-+            _M_positive_sign = __wcs;
-+          }
-+        else
-+          _M_positive_sign = L"";
-+
-+        char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
-+        __len = strlen(__cnegsign);
-+        if (!__nposn)
-+          _M_negative_sign = L"()";
-+        else if (__len)
-+          { 
-+            ++__len;
-+            memset(&__state, 0, sizeof(mbstate_t));
-+            wchar_t* __wcs = new wchar_t[__len];
-+            mbsrtowcs(__wcs, &__cnegsign, __len, &__state);
-+            _M_negative_sign = __wcs;
-+          }
-+        else
-+          _M_negative_sign = L"";
-+
-+        // _Intl == true.
-+        __len = strlen(__ccurr);
-+        if (__len)
-+          {
-+            ++__len;
-+            memset(&__state, 0, sizeof(mbstate_t));
-+            wchar_t* __wcs = new wchar_t[__len];
-+            mbsrtowcs(__wcs, &__ccurr, __len, &__state);
-+            _M_curr_symbol = __wcs;
-+          }
-+        else
-+          _M_curr_symbol = L"";
-+
-+        _M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
-+        char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
-+        char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
-+        char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
-+        _M_pos_format = _S_construct_pattern(__pprecedes, __pspace, __pposn);
-+        char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
-+        char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
-+        _M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+        __uselocale(__old);
-+#else
-+        setlocale(LC_ALL, __old);
-+        free(__old);
-+#endif
-+      }
-+    }
-+
-+  template<> 
-+    moneypunct<wchar_t, true>::~moneypunct()
-+    {
-+      if (wcslen(_M_positive_sign))
-+      delete [] _M_positive_sign;
-+      if (wcslen(_M_negative_sign) && (wcscmp(_M_negative_sign, L"()") != 0))
-+      delete [] _M_negative_sign;
-+      if (wcslen(_M_curr_symbol))
-+      delete [] _M_curr_symbol;
-+    }
-+
-+  template<> 
-+    moneypunct<wchar_t, false>::~moneypunct()
-+    {
-+      if (wcslen(_M_positive_sign))
-+      delete [] _M_positive_sign;
-+      if (wcslen(_M_negative_sign) && (wcscmp(_M_negative_sign, L"()") != 0))
-+      delete [] _M_negative_sign;
-+      if (wcslen(_M_curr_symbol))
-+      delete [] _M_curr_symbol;
-+    }
-+#endif
-+}
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/numeric_members.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc     1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/numeric_members.cc      2004-01-09 18:20:59.000000000 -0600
-@@ -0,0 +1,129 @@
-+// std::numpunct implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#define _LIBC
-+#include <locale>
-+#undef _LIBC
-+#include <bits/c++locale_internal.h>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning tailor for stub locale support
-+#endif
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
-+#endif
-+
-+namespace std
-+{
-+  template<> 
-+    void
-+    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
-+    {
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_decimal_point = '.';
-+        _M_thousands_sep = ',';
-+        _M_grouping = "";
-+      }
-+      else
-+      {
-+        // Named locale.
-+        _M_decimal_point = *(__nl_langinfo_l(RADIXCHAR, __cloc));
-+        _M_thousands_sep = *(__nl_langinfo_l(THOUSEP, __cloc));
-+        // Check for NUL, which implies no grouping.
-+        if (_M_thousands_sep == '\0')
-+          _M_grouping = "";
-+        else
-+          _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
-+      }
-+      // NB: There is no way to extact this info from posix locales.
-+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
-+      _M_truename = "true";
-+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
-+      _M_falsename = "false";
-+    }
-+ 
-+  template<> 
-+    numpunct<char>::~numpunct()
-+    { }
-+   
-+#ifdef _GLIBCPP_USE_WCHAR_T
-+  template<> 
-+    void
-+    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
-+    {
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_decimal_point = L'.';
-+        _M_thousands_sep = L',';
-+        _M_grouping = "";
-+      }
-+      else
-+      {
-+        // Named locale.
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix this
-+#endif
-+#ifdef __UCLIBC__
-+# ifdef __UCLIBC_HAS_XLOCALE__
-+        _M_decimal_point = __cloc->decimal_point_wc;
-+        _M_thousands_sep = __cloc->thousands_sep_wc;
-+# else
-+        _M_decimal_point = __global_locale->decimal_point_wc;
-+        _M_thousands_sep = __global_locale->thousands_sep_wc;
-+# endif
-+#else
-+        _M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
-+        _M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
-+#endif
-+        if (_M_thousands_sep == L'\0')
-+          _M_grouping = "";
-+        else
-+          _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
-+      }
-+      // NB: There is no way to extact this info from posix locales.
-+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
-+      _M_truename = L"true";
-+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
-+      _M_falsename = L"false";
-+    }
-+
-+  template<> 
-+    numpunct<wchar_t>::~numpunct()
-+    { }
-+ #endif
-+}
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.cc        1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.cc 2004-01-09 08:25:03.000000000 -0600
-@@ -0,0 +1,341 @@
-+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
-+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning tailor for stub locale support
-+#endif
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
-+#endif
-+
-+namespace std
-+{
-+  template<>
-+    void
-+    __timepunct<char>::
-+    _M_put(char* __s, size_t __maxlen, const char* __format, 
-+         const tm* __tm) const
-+    {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+      __strftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
-+#else
-+      char* __old = strdup(setlocale(LC_ALL, NULL));
-+      setlocale(LC_ALL, _M_name_timepunct);
-+      strftime(__s, __maxlen, __format, __tm);
-+      setlocale(LC_ALL, __old);
-+      free(__old);
-+#endif
-+    }
-+
-+  template<> 
-+    void
-+    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
-+    {
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_c_locale_timepunct = _S_c_locale;
-+
-+        _M_date_format = "%m/%d/%y";
-+        _M_date_era_format = "%m/%d/%y";
-+        _M_time_format = "%H:%M:%S";
-+        _M_time_era_format = "%H:%M:%S";
-+        _M_date_time_format = "";
-+        _M_date_time_era_format = "";
-+        _M_am = "AM";
-+        _M_pm = "PM";
-+        _M_am_pm_format = "";
-+
-+        // Day names, starting with "C"'s Sunday.
-+        _M_day1 = "Sunday";
-+        _M_day2 = "Monday";
-+        _M_day3 = "Tuesday";
-+        _M_day4 = "Wednesday";
-+        _M_day5 = "Thursday";
-+        _M_day6 = "Friday";
-+        _M_day7 = "Saturday";
-+
-+        // Abbreviated day names, starting with "C"'s Sun.
-+        _M_day_a1 = "Sun";
-+        _M_day_a2 = "Mon";
-+        _M_day_a3 = "Tue";
-+        _M_day_a4 = "Wed";
-+        _M_day_a5 = "Thu";
-+        _M_day_a6 = "Fri";
-+        _M_day_a7 = "Sat";
-+
-+        // Month names, starting with "C"'s January.
-+        _M_month01 = "January";
-+        _M_month02 = "February";
-+        _M_month03 = "March";
-+        _M_month04 = "April";
-+        _M_month05 = "May";
-+        _M_month06 = "June";
-+        _M_month07 = "July";
-+        _M_month08 = "August";
-+        _M_month09 = "September";
-+        _M_month10 = "October";
-+        _M_month11 = "November";
-+        _M_month12 = "December";
-+
-+        // Abbreviated month names, starting with "C"'s Jan.
-+        _M_month_a01 = "Jan";
-+        _M_month_a02 = "Feb";
-+        _M_month_a03 = "Mar";
-+        _M_month_a04 = "Apr";
-+        _M_month_a05 = "May";
-+        _M_month_a06 = "Jun";
-+        _M_month_a07 = "July";
-+        _M_month_a08 = "Aug";
-+        _M_month_a09 = "Sep";
-+        _M_month_a10 = "Oct";
-+        _M_month_a11 = "Nov";
-+        _M_month_a12 = "Dec";
-+      }
-+      else
-+      {
-+        _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
-+
-+        _M_date_format = __nl_langinfo_l(D_FMT, __cloc);
-+        _M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
-+        _M_time_format = __nl_langinfo_l(T_FMT, __cloc);
-+        _M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
-+        _M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
-+        _M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, __cloc);
-+        _M_am = __nl_langinfo_l(AM_STR, __cloc);
-+        _M_pm = __nl_langinfo_l(PM_STR, __cloc);
-+        _M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
-+
-+        // Day names, starting with "C"'s Sunday.
-+        _M_day1 = __nl_langinfo_l(DAY_1, __cloc);
-+        _M_day2 = __nl_langinfo_l(DAY_2, __cloc);
-+        _M_day3 = __nl_langinfo_l(DAY_3, __cloc);
-+        _M_day4 = __nl_langinfo_l(DAY_4, __cloc);
-+        _M_day5 = __nl_langinfo_l(DAY_5, __cloc);
-+        _M_day6 = __nl_langinfo_l(DAY_6, __cloc);
-+        _M_day7 = __nl_langinfo_l(DAY_7, __cloc);
-+
-+        // Abbreviated day names, starting with "C"'s Sun.
-+        _M_day_a1 = __nl_langinfo_l(ABDAY_1, __cloc);
-+        _M_day_a2 = __nl_langinfo_l(ABDAY_2, __cloc);
-+        _M_day_a3 = __nl_langinfo_l(ABDAY_3, __cloc);
-+        _M_day_a4 = __nl_langinfo_l(ABDAY_4, __cloc);
-+        _M_day_a5 = __nl_langinfo_l(ABDAY_5, __cloc);
-+        _M_day_a6 = __nl_langinfo_l(ABDAY_6, __cloc);
-+        _M_day_a7 = __nl_langinfo_l(ABDAY_7, __cloc);
-+
-+        // Month names, starting with "C"'s January.
-+        _M_month01 = __nl_langinfo_l(MON_1, __cloc);
-+        _M_month02 = __nl_langinfo_l(MON_2, __cloc);
-+        _M_month03 = __nl_langinfo_l(MON_3, __cloc);
-+        _M_month04 = __nl_langinfo_l(MON_4, __cloc);
-+        _M_month05 = __nl_langinfo_l(MON_5, __cloc);
-+        _M_month06 = __nl_langinfo_l(MON_6, __cloc);
-+        _M_month07 = __nl_langinfo_l(MON_7, __cloc);
-+        _M_month08 = __nl_langinfo_l(MON_8, __cloc);
-+        _M_month09 = __nl_langinfo_l(MON_9, __cloc);
-+        _M_month10 = __nl_langinfo_l(MON_10, __cloc);
-+        _M_month11 = __nl_langinfo_l(MON_11, __cloc);
-+        _M_month12 = __nl_langinfo_l(MON_12, __cloc);
-+
-+        // Abbreviated month names, starting with "C"'s Jan.
-+        _M_month_a01 = __nl_langinfo_l(ABMON_1, __cloc);
-+        _M_month_a02 = __nl_langinfo_l(ABMON_2, __cloc);
-+        _M_month_a03 = __nl_langinfo_l(ABMON_3, __cloc);
-+        _M_month_a04 = __nl_langinfo_l(ABMON_4, __cloc);
-+        _M_month_a05 = __nl_langinfo_l(ABMON_5, __cloc);
-+        _M_month_a06 = __nl_langinfo_l(ABMON_6, __cloc);
-+        _M_month_a07 = __nl_langinfo_l(ABMON_7, __cloc);
-+        _M_month_a08 = __nl_langinfo_l(ABMON_8, __cloc);
-+        _M_month_a09 = __nl_langinfo_l(ABMON_9, __cloc);
-+        _M_month_a10 = __nl_langinfo_l(ABMON_10, __cloc);
-+        _M_month_a11 = __nl_langinfo_l(ABMON_11, __cloc);
-+        _M_month_a12 = __nl_langinfo_l(ABMON_12, __cloc);
-+      }
-+    }
-+
-+#ifdef _GLIBCPP_USE_WCHAR_T
-+  template<>
-+    void
-+    __timepunct<wchar_t>::
-+    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
-+         const tm* __tm) const
-+    {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
-+#else
-+      char* __old = strdup(setlocale(LC_ALL, NULL));
-+      setlocale(LC_ALL, _M_name_timepunct);
-+      wcsftime(__s, __maxlen, __format, __tm);
-+      setlocale(LC_ALL, __old);
-+      free(__old);
-+#endif
-+    }
-+
-+  template<> 
-+    void
-+    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
-+    {
-+#warning wide time stuff
-+//       if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_c_locale_timepunct = _S_c_locale;
-+
-+        _M_date_format = L"%m/%d/%y";
-+        _M_date_era_format = L"%m/%d/%y";
-+        _M_time_format = L"%H:%M:%S";
-+        _M_time_era_format = L"%H:%M:%S";
-+        _M_date_time_format = L"";
-+        _M_date_time_era_format = L"";
-+        _M_am = L"AM";
-+        _M_pm = L"PM";
-+        _M_am_pm_format = L"";
-+
-+        // Day names, starting with "C"'s Sunday.
-+        _M_day1 = L"Sunday";
-+        _M_day2 = L"Monday";
-+        _M_day3 = L"Tuesday";
-+        _M_day4 = L"Wednesday";
-+        _M_day5 = L"Thursday";
-+        _M_day6 = L"Friday";
-+        _M_day7 = L"Saturday";
-+
-+        // Abbreviated day names, starting with "C"'s Sun.
-+        _M_day_a1 = L"Sun";
-+        _M_day_a2 = L"Mon";
-+        _M_day_a3 = L"Tue";
-+        _M_day_a4 = L"Wed";
-+        _M_day_a5 = L"Thu";
-+        _M_day_a6 = L"Fri";
-+        _M_day_a7 = L"Sat";
-+
-+        // Month names, starting with "C"'s January.
-+        _M_month01 = L"January";
-+        _M_month02 = L"February";
-+        _M_month03 = L"March";
-+        _M_month04 = L"April";
-+        _M_month05 = L"May";
-+        _M_month06 = L"June";
-+        _M_month07 = L"July";
-+        _M_month08 = L"August";
-+        _M_month09 = L"September";
-+        _M_month10 = L"October";
-+        _M_month11 = L"November";
-+        _M_month12 = L"December";
-+
-+        // Abbreviated month names, starting with "C"'s Jan.
-+        _M_month_a01 = L"Jan";
-+        _M_month_a02 = L"Feb";
-+        _M_month_a03 = L"Mar";
-+        _M_month_a04 = L"Apr";
-+        _M_month_a05 = L"May";
-+        _M_month_a06 = L"Jun";
-+        _M_month_a07 = L"July";
-+        _M_month_a08 = L"Aug";
-+        _M_month_a09 = L"Sep";
-+        _M_month_a10 = L"Oct";
-+        _M_month_a11 = L"Nov";
-+        _M_month_a12 = L"Dec";
-+      }
-+#if 0
-+      else
-+      {
-+        _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
-+
-+        _M_date_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_FMT, __cloc));
-+        _M_date_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_FMT, __cloc));
-+        _M_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT, __cloc));
-+        _M_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_T_FMT, __cloc));
-+        _M_date_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_T_FMT, __cloc));
-+        _M_date_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc));
-+        _M_am = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WAM_STR, __cloc));
-+        _M_pm = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WPM_STR, __cloc));
-+        _M_am_pm_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc));
-+
-+        // Day names, starting with "C"'s Sunday.
-+        _M_day1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_1, __cloc));
-+        _M_day2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_2, __cloc));
-+        _M_day3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_3, __cloc));
-+        _M_day4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_4, __cloc));
-+        _M_day5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_5, __cloc));
-+        _M_day6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_6, __cloc));
-+        _M_day7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_7, __cloc));
-+
-+        // Abbreviated day names, starting with "C"'s Sun.
-+        _M_day_a1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_1, __cloc));
-+        _M_day_a2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_2, __cloc));
-+        _M_day_a3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_3, __cloc));
-+        _M_day_a4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_4, __cloc));
-+        _M_day_a5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_5, __cloc));
-+        _M_day_a6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_6, __cloc));
-+        _M_day_a7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_7, __cloc));
-+
-+        // Month names, starting with "C"'s January.
-+        _M_month01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_1, __cloc));
-+        _M_month02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_2, __cloc));
-+        _M_month03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_3, __cloc));
-+        _M_month04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_4, __cloc));
-+        _M_month05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_5, __cloc));
-+        _M_month06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_6, __cloc));
-+        _M_month07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_7, __cloc));
-+        _M_month08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_8, __cloc));
-+        _M_month09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_9, __cloc));
-+        _M_month10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_10, __cloc));
-+        _M_month11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_11, __cloc));
-+        _M_month12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_12, __cloc));
-+
-+        // Abbreviated month names, starting with "C"'s Jan.
-+        _M_month_a01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_1, __cloc));
-+        _M_month_a02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_2, __cloc));
-+        _M_month_a03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_3, __cloc));
-+        _M_month_a04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_4, __cloc));
-+        _M_month_a05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_5, __cloc));
-+        _M_month_a06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_6, __cloc));
-+        _M_month_a07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_7, __cloc));
-+        _M_month_a08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_8, __cloc));
-+        _M_month_a09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_9, __cloc));
-+        _M_month_a10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_10, __cloc));
-+        _M_month_a11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_11, __cloc));
-+        _M_month_a12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_12, __cloc));
-+      }
-+#endif // 0
-+    }
-+#endif
-+}
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.h
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.h 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.h  2004-01-09 04:26:21.000000000 -0600
-@@ -0,0 +1,68 @@
-+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
-+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+  template<typename _CharT>
-+    __timepunct<_CharT>::__timepunct(size_t __refs) 
-+    : locale::facet(__refs)
-+    { 
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+      _M_name_timepunct = _S_c_name;
-+#endif
-+      _M_initialize_timepunct(); 
-+    }
-+
-+  template<typename _CharT>
-+    __timepunct<_CharT>::__timepunct(__c_locale __cloc, 
-+                                   const char* __s,
-+                                   size_t __refs) 
-+    : locale::facet(__refs)
-+    { 
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+      _M_name_timepunct = new char[strlen(__s) + 1];
-+      strcpy(_M_name_timepunct, __s);
-+#endif
-+      _M_initialize_timepunct(__cloc); 
-+    }
-+
-+  template<typename _CharT>
-+    __timepunct<_CharT>::~__timepunct()
-+    { 
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+      if (_S_c_name != _M_name_timepunct)
-+      delete [] _M_name_timepunct;
-+#endif
-+      _S_destroy_c_locale(_M_c_locale_timepunct); 
-+    }
-diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_base.h
---- gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_base.h       1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_base.h        2004-01-09 02:54:54.000000000 -0600
-@@ -0,0 +1,57 @@
-+// Locale support -*- C++ -*-
-+
-+// Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.1  Locales
-+//
-+  
-+// Information as gleaned from /usr/include/ctype.h
-+  
-+  struct ctype_base
-+  {
-+    // Note: In uClibc, the following two types depend on configuration.
-+
-+    // Non-standard typedefs.
-+    typedef const __ctype_touplow_t* __to_type;
-+    // NB: Offsets into ctype<char>::_M_table force a particular size
-+    // on the mask type. Because of this, we don't use an enum.
-+    typedef __ctype_mask_t    mask;   
-+
-+    static const mask upper           = _ISupper;
-+    static const mask lower   = _ISlower;
-+    static const mask alpha   = _ISalpha;
-+    static const mask digit   = _ISdigit;
-+    static const mask xdigit  = _ISxdigit;
-+    static const mask space   = _ISspace;
-+    static const mask print   = _ISprint;
-+    static const mask graph   = _ISgraph;
-+    static const mask cntrl   = _IScntrl;
-+    static const mask punct   = _ISpunct;
-+    static const mask alnum   = _ISalnum;
-+  };
-diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_inline.h
---- gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_inline.h     1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_inline.h      2002-06-24 00:49:19.000000000 -0500
-@@ -0,0 +1,69 @@
-+// Locale support -*- C++ -*-
-+
-+// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.1  Locales
-+//
-+  
-+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
-+// functions go in ctype.cc
-+  
-+  bool
-+  ctype<char>::
-+  is(mask __m, char __c) const
-+  { return _M_table[static_cast<unsigned char>(__c)] & __m; }
-+
-+  const char*
-+  ctype<char>::
-+  is(const char* __low, const char* __high, mask* __vec) const
-+  {
-+    while (__low < __high)
-+      *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
-+    return __high;
-+  }
-+
-+  const char*
-+  ctype<char>::
-+  scan_is(mask __m, const char* __low, const char* __high) const
-+  {
-+    while (__low < __high 
-+         && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
-+      ++__low;
-+    return __low;
-+  }
-+
-+  const char*
-+  ctype<char>::
-+  scan_not(mask __m, const char* __low, const char* __high) const
-+  {
-+    while (__low < __high 
-+         && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
-+      ++__low;
-+    return __low;
-+  }
-diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_noninline.h
---- gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_noninline.h  1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_noninline.h   2004-01-09 03:34:53.000000000 -0600
-@@ -0,0 +1,90 @@
-+// Locale support -*- C++ -*-
-+
-+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
-+// Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.1  Locales
-+//
-+  
-+// Information as gleaned from /usr/include/ctype.h
-+
-+  const ctype_base::mask*
-+  ctype<char>::classic_table() throw()
-+  { 
-+    return __C_ctype_b;
-+  }
-+
-+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
-+                   size_t __refs) 
-+  : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
-+  {
-+    _M_toupper = __C_ctype_toupper;
-+    _M_tolower = __C_ctype_tolower;
-+    _M_table = __table ? __table : __C_ctype_b;
-+    _M_c_locale_ctype = _S_c_locale;
-+  }
-+
-+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) : 
-+  __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
-+  {
-+    _M_toupper = __C_ctype_toupper;
-+    _M_tolower = __C_ctype_tolower;
-+    _M_table = __table ? __table : __C_ctype_b;
-+    _M_c_locale_ctype = _S_c_locale; 
-+  }
-+
-+  char
-+  ctype<char>::do_toupper(char __c) const
-+  { return _M_toupper[static_cast<unsigned char>(__c)]; }
-+
-+  const char*
-+  ctype<char>::do_toupper(char* __low, const char* __high) const
-+  {
-+    while (__low < __high)
-+      {
-+      *__low = _M_toupper[static_cast<unsigned char>(*__low)];
-+      ++__low;
-+      }
-+    return __high;
-+  }
-+
-+  char
-+  ctype<char>::do_tolower(char __c) const
-+  { return _M_tolower[static_cast<unsigned char>(__c)]; }
-+
-+  const char* 
-+  ctype<char>::do_tolower(char* __low, const char* __high) const
-+  {
-+    while (__low < __high)
-+      {
-+      *__low = _M_tolower[static_cast<unsigned char>(*__low)];
-+      ++__low;
-+      }
-+    return __high;
-+  }
-diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/os_defines.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/os_defines.h
---- gcc-3.3.2/libstdc++-v3/config/os/uclibc/os_defines.h       1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/os_defines.h        2004-01-09 04:56:13.000000000 -0600
-@@ -0,0 +1,56 @@
-+// Specific definitions for GNU/Linux  -*- C++ -*-
-+
-+// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+#ifndef _GLIBCPP_OS_DEFINES
-+#define _GLIBCPP_OS_DEFINES 1
-+
-+// System-specific #define, typedefs, corrections, etc, go here.  This
-+// file will come before all others.
-+
-+// This keeps isanum, et al from being propagated as macros.
-+#define __NO_CTYPE 1
-+
-+#include <features.h>
-+
-+// These systems have declarations mismatching those in libio.h by
-+// omitting throw qualifiers.  Cleanest way out is to not provide
-+// throw-qualifiers at all.  Defining it as empty here will make libio.h
-+// not define it.
-+#undef __THROW
-+#define __THROW
-+
-+// Tell Glibc not to try to provide its own inline versions of
-+// some math functions.  Those cause assembly-time clashes with
-+// our definitions.
-+#define __NO_MATH_INLINES
-+
-+// We must not see the optimized string functions GNU libc defines.
-+#define __NO_STRING_INLINES
-+
-+#endif
diff --git a/obsolete-buildroot/sources/gcc-uclibc-3.3-loop.patch b/obsolete-buildroot/sources/gcc-uclibc-3.3-loop.patch
deleted file mode 100644 (file)
index 476f84b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- gcc/gcc/loop.c     14 Feb 2004 14:46:03 -0000      1.488.2.3
-+++ gcc/gcc/loop.c     28 Apr 2004 22:02:53 -0000
-@@ -929,6 +929,7 @@
-                         || (! (GET_CODE (SET_SRC (set)) == REG
-                                && (REGNO (SET_SRC (set))
-                                    < FIRST_PSEUDO_REGISTER))))
-+                    && regno >= FIRST_PSEUDO_REGISTER 
-                     /* This test is not redundant; SET_SRC (set) might be
-                        a call-clobbered register and the life of REGNO
-                        might span a call.  */
diff --git a/obsolete-buildroot/sources/gcc2.95-mega.patch.bz2 b/obsolete-buildroot/sources/gcc2.95-mega.patch.bz2
deleted file mode 100644 (file)
index 4dffd84..0000000
Binary files a/obsolete-buildroot/sources/gcc2.95-mega.patch.bz2 and /dev/null differ
diff --git a/obsolete-buildroot/sources/gcc2.95-uclibc-conf.patch b/obsolete-buildroot/sources/gcc2.95-uclibc-conf.patch
deleted file mode 100644 (file)
index f244387..0000000
+++ /dev/null
@@ -1,291 +0,0 @@
-Warning!  The powerpc patch (rs6000/linux.h) is hack-ish and would
-definitely need to be improved to be acceptable upstream.  Also,
-this patch isn't complete as it only supports i386, arm, mips, and
-powerpc (rs6000).
-diff -urN gcc-20011006/config.sub gcc-20011006-new/config.sub
---- gcc-20011006/config.sub    2004-01-13 06:15:28.000000000 -0600
-+++ gcc-20011006-new/config.sub        2004-01-10 11:09:35.000000000 -0600
-@@ -68,7 +68,7 @@
- # Here we must recognize all the valid KERNEL-OS combinations.
- maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
- case $maybe_os in
--  linux-gnu*)
-+  linux-gnu* | linux-uclibc*)
-     os=-$maybe_os
-     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
-     ;;
-@@ -936,7 +936,8 @@
-             | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
-             | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
--            | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
-+            | -mingw32* | -linux-gnu* | -linux-uclibc* \
-+            | -uxpv* | -beos* | -mpeix* | -udk* \
-             | -interix* | -uwin* )
-       # Remember, each alternative MUST END IN *, to match a version number.
-               ;;
-diff -urN gcc-20011006/gcc/config/arm/linux-elf.h gcc-20011006-new/gcc/config/arm/linux-elf.h
---- gcc-20011006/gcc/config/arm/linux-elf.h    2004-01-13 06:15:28.000000000 -0600
-+++ gcc-20011006-new/gcc/config/arm/linux-elf.h        2004-01-10 11:12:11.000000000 -0600
-@@ -90,6 +90,18 @@
- #define ENDFILE_SPEC \
-   "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
-+#ifdef USE_UCLIBC
-+#define LINK_SPEC "%{h*} %{version:-v} \
-+   %{b} %{Wl,*:%*} \
-+   %{static:-Bstatic} \
-+   %{shared:-shared} \
-+   %{symbolic:-Bsymbolic} \
-+   %{rdynamic:-export-dynamic} \
-+   %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0} \
-+   -X \
-+   %{mbig-endian:-EB}" \
-+   SUBTARGET_EXTRA_LINK_SPEC
-+#else
- #define LINK_SPEC "%{h*} %{version:-v} \
-    %{b} %{Wl,*:%*} \
-    %{static:-Bstatic} \
-@@ -100,6 +112,7 @@
-    -X \
-    %{mbig-endian:-EB}" \
-    SUBTARGET_EXTRA_LINK_SPEC
-+#endif
- #undef  CPP_PREDEFINES
- #define CPP_PREDEFINES \
-diff -urN gcc-20011006/gcc/config/i386/linux.h gcc-20011006-new/gcc/config/i386/linux.h
---- gcc-20011006/gcc/config/i386/linux.h       2001-04-03 17:38:59.000000000 -0500
-+++ gcc-20011006-new/gcc/config/i386/linux.h   2004-01-10 11:15:38.000000000 -0600
-@@ -199,6 +199,15 @@
-       %{static:-static}}}"
- #endif
- #else
-+#if defined USE_UCLIBC
-+#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
-+  %{!shared: \
-+    %{!ibcs: \
-+      %{!static: \
-+      %{rdynamic:-export-dynamic} \
-+      %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
-+      %{static:-static}}}"
-+#else
- #define LINK_SPEC "-m elf_i386 %{shared:-shared} \
-   %{!shared: \
-     %{!ibcs: \
-@@ -207,6 +216,7 @@
-       %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
-       %{static:-static}}}"
- #endif
-+#endif
- /* Get perform_* macros to build libgcc.a.  */
- #include "i386/perform.h"
-diff -urN gcc-20011006/gcc/config/mips/linux.h gcc-20011006-new/gcc/config/mips/linux.h
---- gcc-20011006/gcc/config/mips/linux.h       2004-01-13 06:15:28.000000000 -0600
-+++ gcc-20011006-new/gcc/config/mips/linux.h   2004-01-10 11:16:39.000000000 -0600
-@@ -154,6 +154,17 @@
- /* Borrowed from sparc/linux.h */
- #undef LINK_SPEC
-+#ifdef USE_UCLIBC
-+#define LINK_SPEC \
-+ "%(endian_spec) \
-+  %{shared:-shared} \
-+  %{!shared: \
-+    %{!ibcs: \
-+      %{!static: \
-+        %{rdynamic:-export-dynamic} \
-+        %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
-+        %{static:-static}}}"
-+#else
- #define LINK_SPEC \
-  "%(endian_spec) \
-   %{shared:-shared} \
-@@ -163,6 +174,7 @@
-         %{rdynamic:-export-dynamic} \
-         %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
-         %{static:-static}}}"
-+#endif
- #undef SUBTARGET_ASM_SPEC
-diff -urN old/gcc-20011006/gcc/config/mips/t-linux-uclibc gcc-20011006/gcc/config/mips/t-linux-uclibc
---- old/gcc-20011006/gcc/config/mips/t-linux-uclibc    1969-12-31 18:00:00.000000000 -0600
-+++ gcc-20011006/gcc/config/mips/t-linux-uclibc        2004-01-14 02:51:10.000000000 -0600
-@@ -0,0 +1 @@
-+T_CFLAGS = -DUSE_UCLIBC
-diff -urN gcc-20011006/gcc/config/rs6000/linux.h gcc-20011006-new/gcc/config/rs6000/linux.h
---- gcc-20011006/gcc/config/rs6000/linux.h     2001-04-03 17:38:59.000000000 -0500
-+++ gcc-20011006-new/gcc/config/rs6000/linux.h 2004-01-10 11:15:38.000000000 -0600
-@@ -36,12 +36,21 @@
- #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
- #undef LINK_SPEC
-+#ifdef USE_UCLIBC
-+#define LINK_SPEC "-m elf32ppclinux %{G*} %{shared:-shared} \
-+  %{!shared: \
-+    %{!static: \
-+      %{rdynamic:-export-dynamic} \
-+      %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
-+    %{static:-static}}"
-+#else
- #define LINK_SPEC "-m elf32ppclinux %{G*} %{shared:-shared} \
-   %{!shared: \
-     %{!static: \
-       %{rdynamic:-export-dynamic} \
-       %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
-     %{static:-static}}"
-+#endif
- #undef        LIB_DEFAULT_SPEC
- #define LIB_DEFAULT_SPEC "%(lib_linux)"
-diff -urN gcc-20011006/gcc/config/t-linux-uclibc gcc-20011006-new/gcc/config/t-linux-uclibc
---- gcc-20011006/gcc/config/t-linux-uclibc     1969-12-31 18:00:00.000000000 -0600
-+++ gcc-20011006-new/gcc/config/t-linux-uclibc 2004-01-10 11:18:46.000000000 -0600
-@@ -0,0 +1,18 @@
-+T_CFLAGS = -DUSE_UCLIBC
-+
-+# Don't run fixproto
-+STMP_FIXPROTO =
-+
-+# Don't install "assert.h" in gcc. We use the one in glibc.
-+INSTALL_ASSERT_H =
-+
-+# Compile crtbeginS.o and crtendS.o with pic.
-+CRTSTUFF_T_CFLAGS_S = -fPIC
-+# Compile libgcc2.a with pic.
-+TARGET_LIBGCC2_CFLAGS = -fPIC
-+
-+# Do not build libgcc1. Let gcc generate those functions. The GNU/Linux
-+# C library can handle them.
-+LIBGCC1 = 
-+CROSS_LIBGCC1 =
-+LIBGCC1_TEST =
-diff -urN gcc-20011006/gcc/configure gcc-20011006-new/gcc/configure
---- gcc-20011006/gcc/configure 2004-01-13 06:15:28.000000000 -0600
-+++ gcc-20011006-new/gcc/configure     2004-01-10 11:28:54.000000000 -0600
-@@ -3219,6 +3219,24 @@
-                       ;;
-               esac
-               ;;
-+      arm*-*-linux-uclibc*)           # ARM GNU/Linux with ELF - uClibc
-+              xm_file=arm/xm-linux.h
-+              xmake_file=x-linux
-+              tm_file="arm/linux-elf.h"
-+              case $machine in
-+              armv2*-*-*)
-+                      tm_file="arm/linux-elf26.h $tm_file"
-+                      ;;
-+              esac
-+              tmake_file="t-linux-uclibc arm/t-linux"
-+              extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
-+              gnu_ld=yes
-+              case x${enable_threads} in
-+              x | xyes | xpthreads | xposix)
-+                      thread_file='posix'
-+                      ;;
-+              esac
-+              ;;
-       arm*-*-aout)
-               tm_file=arm/aout.h
-               tmake_file=arm/t-bare
-@@ -3631,6 +3649,18 @@
-                       thread_file='single'
-               fi
-               ;;
-+      i[34567]86-*-linux*uclibc*)     # Intel 80386's running GNU/Linux
-+                                      # with ELF format using uClibc
-+              xmake_file=x-linux
-+              tm_file=i386/linux.h
-+              tmake_file="t-linux-uclibc i386/t-crtstuff"
-+              extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
-+              gnu_ld=yes
-+              float_format=i386
-+              if test x$enable_threads = xyes; then
-+                      thread_file='posix'
-+              fi
-+              ;;
-       i[34567]86-*-linux-gnu*)        # Intel 80386's running GNU/Linux
-                                       # aka GNU/Linux C library 6
-               xmake_file=x-linux
-@@ -4696,7 +4726,19 @@
-               # On NetBSD, the headers are already okay, except for math.h.
-               tmake_file=t-netbsd
-               ;;
--       mips*-*-linux*)                         # Linux MIPS, either endian.
-+      mips*-*-linux-uclibc*)          # Linux (uclibc) MIPS, either endian.
-+              tmake_file=mips/t-linux-uclibc
-+              xmake_file=x-linux
-+              xm_file="xm-siglist.h ${xm_file}"
-+               case $machine in
-+                       mipsel-*)  tm_file="mips/elfl.h mips/linux.h" ;;
-+                       *)         tm_file="mips/elf.h mips/linux.h" ;;
-+               esac
-+              extra_parts="crtbegin.o crtend.o"
-+              gnu_ld=yes
-+              gas=yes
-+              ;;
-+      mips*-*-linux*)                         # Linux MIPS, either endian.
-               xmake_file=x-linux
-               xm_file="xm-siglist.h ${xm_file}"
-                case $machine in
-@@ -5159,6 +5201,24 @@
-                       thread_file='posix'
-               fi
-               ;;
-+      powerpc-*-linux-uclibc*)
-+              tm_file=rs6000/linux.h
-+              xm_file="xm-siglist.h rs6000/xm-sysv4.h"
-+              xm_defines="USG ${xm_defines}"
-+              out_file=rs6000/rs6000.c
-+              if test x$gas = xyes
-+              then
-+                      tmake_file="rs6000/t-ppcos t-linux-uclibc rs6000/t-ppccomm"
-+              else
-+                      tmake_file="rs6000/t-ppc t-linux-uclibc rs6000/t-ppccomm"
-+              fi
-+              xmake_file=x-linux
-+              extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
-+              extra_headers=ppc-asm.h
-+              if test x$enable_threads = xyes; then
-+                      thread_file='posix'
-+              fi
-+              ;;
-         powerpc-wrs-vxworks*)
-                 cpu_type=rs6000
-               xm_file="xm-siglist.h rs6000/xm-sysv4.h"
-diff -urN gcc-20011006/ltconfig gcc-20011006-new/ltconfig
---- gcc-20011006/ltconfig      1999-06-21 21:35:12.000000000 -0500
-+++ gcc-20011006-new/ltconfig  2004-01-10 11:34:23.000000000 -0600
-@@ -436,6 +436,7 @@
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case "$host_os" in
- linux-gnu*) ;;
-+linux-uclibc*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
-@@ -1773,6 +1774,22 @@
-   fi
-   ;;
-+linux-uclibc*)
-+  version_type=linux
-+  need_lib_prefix=no
-+  need_version=no
-+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-+  soname_spec='${libname}${release}.so$major'
-+  finish_cmds='PATH="$PATH:/sbin" ldconfig -n $libdir'
-+  shlibpath_var=LD_LIBRARY_PATH
-+  shlibpath_overrides_runpath=no
-+  deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
-+  file_magic_cmd=/usr/bin/file
-+  file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  # Assume using the uClibc dynamic linker.
-+  dynamic_linker="uClibc ld.so"
-+  ;;
-+
- netbsd*)
-   version_type=sunos
-   if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
diff --git a/obsolete-buildroot/sources/gcc3.3-mega.patch.bz2 b/obsolete-buildroot/sources/gcc3.3-mega.patch.bz2
deleted file mode 100644 (file)
index adfda5f..0000000
Binary files a/obsolete-buildroot/sources/gcc3.3-mega.patch.bz2 and /dev/null differ
diff --git a/obsolete-buildroot/sources/gdb-5.3-uclibc.patch b/obsolete-buildroot/sources/gdb-5.3-uclibc.patch
deleted file mode 100644 (file)
index f985303..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-diff -urN gdb-5.3/bfd/config.bfd gdb-5.3-new/bfd/config.bfd
---- gdb-5.3/bfd/config.bfd     2002-09-05 15:34:35.000000000 -0500
-+++ gdb-5.3-new/bfd/config.bfd 2004-01-11 06:25:31.000000000 -0600
-@@ -83,7 +83,7 @@
-     targ_defvec=ecoffalpha_little_vec
-     targ_selvecs=bfd_elf64_alpha_vec
-     ;;
--  alpha*-*-linux-gnu* | alpha*-*-elf*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
-     targ_defvec=bfd_elf64_alpha_vec
-     targ_selvecs=ecoffalpha_little_vec
-     ;;
-@@ -97,7 +97,8 @@
-     targ_defvec=bfd_elf64_ia64_aix_little_vec
-     targ_selvecs="bfd_elf64_ia64_aix_big_vec bfd_efi_app_ia64_vec"
-     ;;
--  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf*)
-+  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | \
-+  ia64*-*-linux-uclibc* | ia64*-*-elf*)
-     targ_defvec=bfd_elf64_ia64_little_vec
-     targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
-     ;;
-@@ -176,11 +177,12 @@
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
--  armeb-*-elf | arm*b-*-linux-gnu*)
-+  armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_bigarm_vec
-     targ_selvecs=bfd_elf32_littlearm_vec
-     ;;
--  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | arm*-*-uclinux*)
-+  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | \
-+  arm*-*-conix* | arm*-*-uclinux*)
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
-@@ -313,7 +315,7 @@
-     ;;
- #ifdef BFD64
--  hppa*64*-*-linux-gnu*)
-+  hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_hppa_linux_vec
-     targ_selvecs=bfd_elf64_hppa_vec
-     ;;
-@@ -324,7 +326,7 @@
-     ;;
- #endif
--  hppa*-*-linux-gnu*)
-+  hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_hppa_linux_vec
-     targ_selvecs=bfd_elf32_hppa_vec
-     ;;
-@@ -424,7 +426,7 @@
-     targ_selvecs=bfd_elf32_i386_vec
-     targ_underscore=yes
-     ;;
--  i[3456]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_i386_vec
-     targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
-     targ64_selvecs=bfd_elf64_x86_64_vec
-@@ -438,7 +440,7 @@
-     targ_defvec=bfd_elf64_x86_64_vec
-     targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
-     ;;
--  x86_64-*-linux-gnu*)
-+  x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_x86_64_vec
-     targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
-     ;;
-@@ -589,7 +591,7 @@
-     targ_defvec=hp300hpux_vec
-     targ_underscore=yes
-     ;;
--  m68*-*-linux*aout*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-     targ_defvec=m68klinux_vec
-     targ_selvecs=bfd_elf32_m68k_vec
-     targ_underscore=yes
-@@ -865,7 +867,8 @@
-     ;;
- #endif
-   powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
--  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
-+  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
-+  powerpc-*-rtems* | \
-   powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
-     targ_defvec=bfd_elf32_powerpc_vec
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
-@@ -887,8 +890,8 @@
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpcqnx_vec ppcboot_vec"
-     ;;
-   powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
--  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
--  powerpcle-*-rtems*)
-+  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
-+  powerpcle-*-vxworks* | powerpcle-*-rtems*)
-     targ_defvec=bfd_elf32_powerpcle_vec
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
-     targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
-@@ -1038,7 +1041,7 @@
-     targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
-     targ_underscore=yes
-     ;;
--  sparc-*-linux-gnu*)
-+  sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_sparc_vec
-     targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
-     ;;
-@@ -1081,7 +1084,7 @@
-     targ_defvec=sunos_big_vec
-     targ_underscore=yes
-     ;;
--  sparc64-*-linux-gnu*)
-+  sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_sparc_vec
-     targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
-     ;;
-diff -urN gdb-5.3/bfd/configure gdb-5.3-new/bfd/configure
---- gdb-5.3/bfd/configure      2002-08-28 05:38:44.000000000 -0500
-+++ gdb-5.3-new/bfd/configure  2004-01-11 06:27:15.000000000 -0600
-@@ -1677,6 +1677,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -5067,7 +5072,7 @@
-   alpha*-*-freebsd*)
-       COREFILE=''
-       ;;
--  alpha*-*-linux-gnu*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/alphalinux.h"'
-       ;;
-@@ -5126,7 +5131,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386mach3.h"'
-       ;;
--  i[3456]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386linux.h"'
-       ;;
diff --git a/obsolete-buildroot/sources/gdb.patch b/obsolete-buildroot/sources/gdb.patch
deleted file mode 100644 (file)
index e44b15c..0000000
+++ /dev/null
@@ -1,633 +0,0 @@
-Patch pending upstream, probably acceptable.
---------------------------------------------
-
-
-
-Daniel Jacobowitz <drow@mvista.com> writes:
-> I like this.  The way func_frame_chain_valid should really be used is
-> by something like:
-> 
->   /* NOTE: tm-i386nw.h and tm-i386v4.h override this.  */
->   set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
-> 
-> (copied from i386-tdep.c).
-> 
-> Does this patch work for you?
-
-Yes, thanks.  I've included a revised version of my patch below.
-
-> I'm curious as to why we can't just set this universally, or at least a
-> little more globally.  Most things that have a main () use it as a
-> normal main ().  I'd propose that we set it as the default frame chain,
-> and provide/document an option to ignore inside_main_func.
-
-Well, gdbarch is never supposed to change the default behavior of
-macros; this helps us convert pre-gdbarch targets incrementally.
-Simply turning on gdbarch for one's target ideally wouldn't change its
-behavior at all.
-
-
-[Patch revised for Debian snapshot]
---- snap/gdb/i386-linux-tdep.c.orig    2002-08-18 19:53:57.000000000 -0400
-+++ snap/gdb/i386-linux-tdep.c 2002-08-18 19:54:31.000000000 -0400
-@@ -452,6 +452,9 @@
-   set_solib_svr4_fetch_link_map_offsets (gdbarch,
-                                      i386_linux_svr4_fetch_link_map_offsets);
-+
-+  set_gdbarch_frame_chain_valid (gdbarch,
-+                               generic_func_frame_chain_valid);
- }
- /* Provide a prototype to silence -Wmissing-prototypes.  */
-[Hurd needs 6.  Take 8, since it does no real harm.]
-
-
-Package: gdb
-Severity: normal
-Tags: patch, sid
-
-Hello,
-
-GDB will crash on the Hurd after issuing the 'show' and hitting enter
-a few times:
-
-../../gdb/ui-out.c:130: gdb-internal-error: push_level: Assertion       +`uiout->level >= 0 && uiout->level < MAX_UI_OUT_LEVELS' failed.
-
-the problem is that MAX_UI_OUT_LEVELS is not high enough for the extra
-option we have on the Hurd, it should be rised to 6 then, which works
-fine:
-
---- gdb-5.2.cvs20020401/gdb/ui-out.c~   Fri May  3 02:19:20 2002
-+++ gdb-5.2.cvs20020401/gdb/ui-out.c    Fri May  3 02:19:32 2002
-@@ -45,7 +45,7 @@
-    is always available.  Stack/nested level 0 is reserved for the
-    top-level result. */
--enum { MAX_UI_OUT_LEVELS = 5 };
-+enum { MAX_UI_OUT_LEVELS = 8 };
- struct ui_out_level
-   {
-
--- 
-Robert Millan
-
-"5 years from now everyone will be running
-free GNU on their 200 MIPS, 64M SPARCstation-5"
-
-              Andrew S. Tanenbaum, 30 Jan 1992
-
-
-Submitted upstream, not liked very much.  It's a hack, but it will do for
-now.
-
-2002-07-31  Daniel Jacobowitz  <drow@mvista.com>
-
-       Fix PR gdb/568
-       * thread-db.c (lwp_from_thread): Only warn if unable to find
-       the thread.
-
-Index: thread-db.c
-===================================================================
-RCS file: /cvs/src/src/gdb/thread-db.c,v
-retrieving revision 1.22
-diff -u -p -r1.22 thread-db.c
---- gdb/gdb/thread-db.c        23 Mar 2002 17:38:13 -0000      1.22
-+++ gdb/gdb/thread-db.c        31 Jul 2002 16:29:52 -0000
-@@ -260,6 +260,12 @@ lwp_from_thread (ptid_t ptid)
-     return ptid;
-   err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (ptid), &th);
-+  if (err == TD_ERR)
-+    {
-+      warning ("Cannot find thread %ld: %s",
-+             (long) GET_THREAD (ptid), thread_db_err_str (err));
-+      return ptid;
-+    }
-   if (err != TD_OK)
-     error ("Cannot find thread %ld: %s",
-          (long) GET_THREAD (ptid), thread_db_err_str (err));
-From Michael Fedrowitz <michaelf@debian.org>.  Not submitted to FSF yet.
-
- Hi,
-
-gdb fails to build from source on m68k because some definitions have
-been removed from tm-m68k.h. The patch below readds them.
-
--Michael
-
-
-diff -urN gdb-5.2.cvs20020818.orig/gdb/config/m68k/tm-m68k.h gdb-5.2.cvs20020818/gdb/config/m68k/tm-m68k.h
---- gdb-5.2.cvs20020818.orig/gdb/config/m68k/tm-m68k.h 2002-07-10 19:01:38.000000000 +0200
-+++ gdb-5.2.cvs20020818/gdb/config/m68k/tm-m68k.h      2002-10-06 18:01:59.000000000 +0200
-@@ -26,8 +26,11 @@
- /* Generic 68000 stuff, to be included by other tm-*.h files.  */
- /* D0_REGNM and A0_REGNUM must be defined here because they are
--   used by the monitor.  */
-+   used by the monitor. FPC_REGNUM, FPS_REGNUM and FPI_REGNUM are
-+   defined here because they are used by m68klinux-nat.c.  */
- #define D0_REGNUM 0
- #define A0_REGNUM 8
--
-+#define FPC_REGNUM 26
-+#define FPS_REGNUM 27
-+#define FPI_REGNUM 28
-
-
-2002-11-24  Daniel Jacobowitz  <drow@mvista.com>
-
-       * doublest.c (convert_floatformat_to_doublest): Cast exp_bias to int.
-       * config/alpha/alpha-linux.mh (MH_CFLAGS): Add -mieee.
-
---- gdb-5.2.debian90.cvs20021120/gdb/doublest.c.orig   2002-11-24 17:48:16.000000000 -0500
-+++ gdb-5.2.debian90.cvs20021120/gdb/doublest.c        2002-11-24 17:48:25.000000000 -0500
-@@ -177,7 +177,7 @@
-   if (!special_exponent)
-     exponent -= fmt->exp_bias;
-   else if (exponent == 0)
--    exponent = 1 - fmt->exp_bias;
-+    exponent = 1 - (int)fmt->exp_bias;
-   /* Build the result algebraically.  Might go infinite, underflow, etc;
-      who cares. */
---- gdb-5.2.debian90.cvs20021120/gdb/config/alpha/alpha-linux.mh.orig  2002-11-24 17:50:30.000000000 -0500
-+++ gdb-5.2.debian90.cvs20021120/gdb/config/alpha/alpha-linux.mh       2002-11-24 17:50:41.000000000 -0500
-@@ -8,3 +8,5 @@
- MMALLOC = 
- MMALLOC_CFLAGS = -DNO_MMALLOC 
-+
-+MH_CFLAGS = -mieee
-In CVS but not in 5.3 branch...
-
-2002-10-23  Daniel Jacobowitz  <drow@mvista.com>
-
-       * lin-lwp.c (lin_lwp_resume): Remove resume_all test for !step.
-
-Index: lin-lwp.c
-===================================================================
-RCS file: /cvs/src/src/gdb/lin-lwp.c,v
-retrieving revision 1.35
-diff -u -p -r1.35 lin-lwp.c
---- gdb-5.2.90/gdb/lin-lwp.c   27 Aug 2002 22:37:06 -0000      1.35
-+++ gdb-5.2.90/gdb/lin-lwp.c   23 Oct 2002 04:23:13 -0000
-@@ -579,11 +579,8 @@ lin_lwp_resume (ptid_t ptid, int step, e
-   struct lwp_info *lp;
-   int resume_all;
--  /* Apparently the interpretation of PID is dependent on STEP: If
--     STEP is non-zero, a specific PID means `step only this process
--     id'.  But if STEP is zero, then PID means `continue *all*
--     processes, but give the signal only to this one'.  */
--  resume_all = (PIDGET (ptid) == -1) || !step;
-+  /* A specific PTID means `step only this process id'.  */
-+  resume_all = (PIDGET (ptid) == -1);
-   if (resume_all)
-     iterate_over_lwps (resume_set_callback, NULL);
-
-Not submitted yet, testing.
-
---- gdb-5.2.90/gdb/alpha-tdep.c.orig   Sun Nov 24 21:42:53 2002
-+++ gdb-5.2.90/gdb/alpha-tdep.c        Sun Nov 24 21:48:26 2002
-@@ -99,10 +99,12 @@
- static alpha_extra_func_info_t heuristic_proc_desc (CORE_ADDR,
-                                                   CORE_ADDR,
--                                                  struct frame_info *);
-+                                                  struct frame_info *,
-+                                                  int);
- static alpha_extra_func_info_t find_proc_desc (CORE_ADDR,
--                                             struct frame_info *);
-+                                             struct frame_info *,
-+                                             int);
- #if 0
- static int alpha_in_lenient_prologue (CORE_ADDR, CORE_ADDR);
-@@ -512,7 +514,7 @@
-   if (tmp != 0)
-     pc = tmp;
--  proc_desc = find_proc_desc (pc, frame->next);
-+  proc_desc = find_proc_desc (pc, frame->next, 1);
-   pcreg = proc_desc ? PROC_PC_REG (proc_desc) : ALPHA_RA_REGNUM;
-   if (frame->signal_handler_caller)
-@@ -596,10 +598,10 @@
- static alpha_extra_func_info_t
- heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc,
--                   struct frame_info *next_frame)
-+                   struct frame_info *next_frame, int read_sp_p)
- {
--  CORE_ADDR sp = read_next_frame_reg (next_frame, SP_REGNUM);
--  CORE_ADDR vfp = sp;
-+  CORE_ADDR sp;
-+  CORE_ADDR vfp;
-   CORE_ADDR cur_pc;
-   int frame_size;
-   int has_frame_reg = 0;
-@@ -607,6 +609,11 @@
-   int pcreg = -1;
-   int regno;
-+  if (read_sp_p)
-+    vfp = sp = read_next_frame_reg (next_frame, SP_REGNUM);
-+  else
-+    vfp = sp = 0;
-+
-   if (start_pc == 0)
-     return NULL;
-   memset (&temp_proc_desc, '\0', sizeof (temp_proc_desc));
-@@ -761,7 +768,7 @@
-   CORE_ADDR func_addr, func_end;
-   if (!proc_desc)
--    proc_desc = find_proc_desc (pc, NULL);
-+    proc_desc = find_proc_desc (pc, NULL, 0);
-   if (proc_desc)
-     {
-@@ -807,7 +814,7 @@
- }
- static alpha_extra_func_info_t
--find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame)
-+find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame, int read_sp_p)
- {
-   alpha_extra_func_info_t proc_desc;
-   struct block *b;
-@@ -879,7 +886,7 @@
-           {
-             alpha_extra_func_info_t found_heuristic =
-             heuristic_proc_desc (PROC_LOW_ADDR (proc_desc),
--                                 pc, next_frame);
-+                                 pc, next_frame, read_sp_p);
-             if (found_heuristic)
-               {
-                 PROC_LOCALOFF (found_heuristic) =
-@@ -921,7 +928,7 @@
-       startaddr = heuristic_proc_start (pc);
-       proc_desc =
--      heuristic_proc_desc (startaddr, pc, next_frame);
-+      heuristic_proc_desc (startaddr, pc, next_frame, read_sp_p);
-     }
-   return proc_desc;
- }
-@@ -937,7 +944,7 @@
-   if (saved_pc == 0 || inside_entry_file (saved_pc))
-     return 0;
--  proc_desc = find_proc_desc (saved_pc, frame);
-+  proc_desc = find_proc_desc (saved_pc, frame, 1);
-   if (!proc_desc)
-     return 0;
-@@ -979,7 +986,7 @@
- {
-   /* Use proc_desc calculated in frame_chain */
-   alpha_extra_func_info_t proc_desc =
--  frame->next ? cached_proc_desc : find_proc_desc (frame->pc, frame->next);
-+  frame->next ? cached_proc_desc : find_proc_desc (frame->pc, frame->next, 1);
-   frame->extra_info = (struct frame_extra_info *)
-     frame_obstack_alloc (sizeof (struct frame_extra_info));
-@@ -1291,7 +1298,7 @@
-   /* we need proc_desc to know how to restore the registers;
-      if it is NULL, construct (a temporary) one */
-   if (proc_desc == NULL)
--    proc_desc = find_proc_desc (frame->pc, frame->next);
-+    proc_desc = find_proc_desc (frame->pc, frame->next, 1);
-   /* Question: should we copy this proc_desc and save it in
-      frame->proc_desc?  If we do, who will free it?
-Not yet submitted upstream.  This requires some serious thinking about. 
-If the target stack worked in any logical way, this wouldn't be necessary...
-ending up with roughly:
-  thread_stratum: thread-db (silent reference to lin-lwp)
-  core_stratum: corelow
-  exec_stratum: exec
-  dummy_stratum: dummy
-just makes no sense.
-
-This patch fixes debugging threaded applications which are statically linked
-without breaking debugging threaded core files.  It also fixes the PIDs in
-generate-core-file'd corefiles.  Mostly.
-
-diff -x '*~' -ur o/gdb-5.2.debian90.cvs20021120/gdb/corelow.c gdb-5.2.debian90.cvs20021120/gdb/corelow.c
---- o/gdb-5.2.debian90.cvs20021120/gdb/corelow.c       2002-09-18 13:23:15.000000000 -0400
-+++ gdb-5.2.debian90.cvs20021120/gdb/corelow.c 2002-12-03 14:03:32.000000000 -0500
-@@ -350,7 +350,7 @@
-   bfd_map_over_sections (core_bfd, add_to_thread_list,
-                        bfd_get_section_by_name (core_bfd, ".reg"));
--  if (ontop)
-+  if (ontop || 1)
-     {
-       /* Fetch all registers from core file.  */
-       target_fetch_registers (-1);
-diff -x '*~' -ur o/gdb-5.2.debian90.cvs20021120/gdb/linux-proc.c gdb-5.2.debian90.cvs20021120/gdb/linux-proc.c
---- o/gdb-5.2.debian90.cvs20021120/gdb/linux-proc.c    2002-12-03 14:13:52.000000000 -0500
-+++ gdb-5.2.debian90.cvs20021120/gdb/linux-proc.c      2002-12-03 13:56:34.000000000 -0500
-@@ -177,7 +177,7 @@
- #ifdef FILL_FPXREGSET
-   gdb_fpxregset_t fpxregs;
- #endif
--  unsigned long merged_pid = ptid_get_tid (ptid) << 16 | ptid_get_pid (ptid);
-+  unsigned long merged_pid = ptid_get_tid (ptid) << 16; /*  | ptid_get_pid (ptid); */
-   fill_gregset (&gregs, -1);
-   note_data = (char *) elfcore_write_prstatus (obfd, 
-diff -x '*~' -ur o/gdb-5.2.debian90.cvs20021120/gdb/target.c gdb-5.2.debian90.cvs20021120/gdb/target.c
---- o/gdb-5.2.debian90.cvs20021120/gdb/target.c        2002-09-18 13:23:22.000000000 -0400
-+++ gdb-5.2.debian90.cvs20021120/gdb/target.c  2002-12-03 14:06:07.000000000 -0500
-@@ -1589,6 +1589,7 @@
-   dummy_target.to_find_memory_regions = dummy_find_memory_regions;
-   dummy_target.to_make_corefile_notes = dummy_make_corefile_notes;
-   dummy_target.to_magic = OPS_MAGIC;
-+  cleanup_target (&dummy_target);
- }
\f
-diff -x '*~' -ur o/gdb-5.2.debian90.cvs20021120/gdb/thread-db.c gdb-5.2.debian90.cvs20021120/gdb/thread-db.c
---- o/gdb-5.2.debian90.cvs20021120/gdb/thread-db.c     2002-12-03 14:13:50.000000000 -0500
-+++ gdb-5.2.debian90.cvs20021120/gdb/thread-db.c       2002-12-03 13:39:54.000000000 -0500
-@@ -57,6 +57,31 @@
- /* Non-zero if we're using this module's target vector.  */
- static int using_thread_db;
-+/* Macros to pass an event to the next target if we should not be handling it
-+   here in the thread_stratum.  */
-+#define FIND_NEXT_TARGET(METHOD_NAME)                 \
-+  struct target_ops *next_target = &thread_db_ops;    \
-+  while (1)                                           \
-+    {                                                 \
-+      next_target = find_target_beneath (next_target);        \
-+      if (next_target->METHOD_NAME != NULL)           \
-+      break;                                          \
-+    }
-+
-+#define MAYBE_HAND_DOWN(METHOD_NAME,ARGS)             \
-+  if (proc_handle.pid == 0)                           \
-+    {                                                 \
-+      FIND_NEXT_TARGET (METHOD_NAME);                 \
-+      (*next_target->METHOD_NAME) ARGS;                       \
-+      return;                                         \
-+    }
-+#define MAYBE_HAND_DOWN_RETURN(METHOD_NAME,ARGS)      \
-+  if (proc_handle.pid == 0)                           \
-+    {                                                 \
-+      FIND_NEXT_TARGET (METHOD_NAME);                 \
-+      return (*next_target->METHOD_NAME) ARGS;                \
-+    }
-+
- /* Non-zero if we have to keep this module's target vector active
-    across re-runs.  */
- static int keep_thread_db;
-@@ -489,9 +514,7 @@
- {
-   td_err_e err;
--  /* Don't attempt to use thread_db on targets which can not run
--     (core files).  */
--  if (objfile == NULL || !target_has_execution)
-+  if (objfile == NULL)
-     {
-       /* All symbols have been discarded.  If the thread_db target is
-          active, deactivate it now.  */
-@@ -515,7 +538,10 @@
-   /* Initialize the structure that identifies the child process.  Note
-      that at this point there is no guarantee that we actually have a
-      child process.  */
--  proc_handle.pid = GET_PID (inferior_ptid);
-+  if (target_has_execution)
-+    proc_handle.pid = GET_PID (inferior_ptid);
-+  else
-+    proc_handle.pid = 0;
-   /* Now attempt to open a connection to the thread library.  */
-   err = td_ta_new_p (&proc_handle, &thread_agent);
-@@ -758,6 +784,9 @@
-   struct cleanup *old_chain = save_inferior_ptid ();
-   int xfer;
-+  MAYBE_HAND_DOWN_RETURN (to_xfer_memory, (memaddr, myaddr, len, write,
-+                                         attrib, target));
-+
-   if (is_thread (inferior_ptid))
-     {
-       /* FIXME: This seems to be necessary to make sure breakpoints
-@@ -782,6 +811,8 @@
-   gdb_prfpregset_t fpregset;
-   td_err_e err;
-+  MAYBE_HAND_DOWN (to_fetch_registers, (regno));
-+
-   if (!is_thread (inferior_ptid))
-     {
-       /* Pass the request to the target beneath us.  */
-@@ -819,6 +850,8 @@
-   gdb_prfpregset_t fpregset;
-   td_err_e err;
-+  MAYBE_HAND_DOWN (to_store_registers, (regno));
-+
-   if (!is_thread (inferior_ptid))
-     {
-       /* Pass the request to the target beneath us.  */
-@@ -908,6 +941,8 @@
-   td_thrinfo_t ti;
-   td_err_e err;
-+  MAYBE_HAND_DOWN_RETURN (to_thread_alive, (ptid));
-+
-   if (is_thread (ptid))
-     {
-       err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (ptid), &th);
-@@ -961,6 +996,8 @@
- {
-   td_err_e err;
-+  MAYBE_HAND_DOWN (to_find_new_threads, ());
-+
-   /* Iterate over all user-space threads to discover new threads.  */
-   err = td_ta_thr_iter_p (thread_agent, find_new_threads_callback, NULL,
-                         TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY,
-@@ -972,6 +1009,8 @@
- static char *
- thread_db_pid_to_str (ptid_t ptid)
- {
-+  MAYBE_HAND_DOWN_RETURN (to_pid_to_str, (ptid));
-+
-   if (is_thread (ptid))
-     {
-       static char buf[64];
-Trivial.  Need to submit this.
-
---- gdb-5.2.debian90.cvs20021120/gdb/tracepoint.c.orig 2002-12-03 14:35:44.000000000 -0500
-+++ gdb-5.2.debian90.cvs20021120/gdb/tracepoint.c      2002-12-03 14:43:02.000000000 -0500
-@@ -861,6 +861,8 @@
-       else
-       line = gdb_readline (0);
-+      if (line == NULL || *line == EOF)
-+      break;
-       linetype = validate_actionline (&line, t);
-       if (linetype == BADLINE)
-       continue;               /* already warned -- collect another line */
-Fix build on Sparc.
-
---- gdb-5.3/gdb/sparc-nat.c.orig       2003-01-04 00:11:28.000000000 -0500
-+++ gdb-5.3/gdb/sparc-nat.c    2003-01-04 00:12:42.000000000 -0500
-@@ -33,6 +33,13 @@
- #include <sys/ptrace.h>
- #include <sys/wait.h>
- #ifdef __linux__
-+/* Sadly, <sys/ucontext.h> conflicts with <asm/reg.h> on Linux.  And
-+   -D_GNU_SOURCE brings in <sys/ucontext.h> implicitly with <signal.h>.
-+   Hack around this.  */
-+#undef FPU_REGS_TYPE
-+#define fpu asm_reg_fpu
-+#define fq asm_reg_fq
-+#define fpq asm_reg_fpq
- #include <asm/reg.h>
- #else
- #include <machine/reg.h>
-diff -urN gdb-5.3/gdb/gdbserver.orig/gdbreplay.c gdb-5.3/gdb/gdbserver/gdbreplay.c
---- gdb-5.3/gdb/gdbserver.orig/gdbreplay.c     2002-07-09 11:38:58.000000000 -0600
-+++ gdb-5.3/gdb/gdbserver/gdbreplay.c  2003-08-20 08:44:20.000000000 -0600
-@@ -54,14 +54,15 @@
- perror_with_name (char *string)
- {
- #ifndef STDC_HEADERS
--  extern int sys_nerr;
-   extern char *sys_errlist[];
-   extern int errno;
- #endif
-   const char *err;
-   char *combined;
--  err = (errno < sys_nerr) ? sys_errlist[errno] : "unknown error";
-+  err = strerror (errno);
-+  if (err == NULL)
-+    err = "unknown error";
-   combined = (char *) alloca (strlen (err) + strlen (string) + 3);
-   strcpy (combined, string);
-   strcat (combined, ": ");
-diff -urN gdb-5.3/gdb/gdbserver.orig/low-hppabsd.c gdb-5.3/gdb/gdbserver/low-hppabsd.c
---- gdb-5.3/gdb/gdbserver.orig/low-hppabsd.c   2002-01-17 14:13:49.000000000 -0700
-+++ gdb-5.3/gdb/gdbserver/low-hppabsd.c        2003-08-20 08:46:04.000000000 -0600
-@@ -61,7 +61,7 @@
-       execv (program, allargs);
-       fprintf (stderr, "Cannot exec %s: %s.\n", program,
--             errno < sys_nerr ? sys_errlist[errno] : "unknown error");
-+             strerror (errno));
-       fflush (stderr);
-       _exit (0177);
-     }
-diff -urN gdb-5.3/gdb/gdbserver.orig/low-lynx.c gdb-5.3/gdb/gdbserver/low-lynx.c
---- gdb-5.3/gdb/gdbserver.orig/low-lynx.c      2002-01-17 14:13:49.000000000 -0700
-+++ gdb-5.3/gdb/gdbserver/low-lynx.c   2003-08-20 08:46:18.000000000 -0600
-@@ -79,7 +79,7 @@
-       fprintf (stderr, "GDBserver (process %d):  Cannot exec %s: %s.\n",
-              getpid (), program,
--             errno < sys_nerr ? sys_errlist[errno] : "unknown error");
-+             strerror (errno));
-       fflush (stderr);
-       _exit (0177);
-     }
-diff -urN gdb-5.3/gdb/gdbserver.orig/low-nbsd.c gdb-5.3/gdb/gdbserver/low-nbsd.c
---- gdb-5.3/gdb/gdbserver.orig/low-nbsd.c      2002-01-17 14:13:49.000000000 -0700
-+++ gdb-5.3/gdb/gdbserver/low-nbsd.c   2003-08-20 08:46:27.000000000 -0600
-@@ -137,7 +137,7 @@
-       execv (program, allargs);
-       fprintf (stderr, "Cannot exec %s: %s.\n", program,
--             errno < sys_nerr ? sys_errlist[errno] : "unknown error");
-+             strerror (errno));
-       fflush (stderr);
-       _exit (0177);
-     }
-diff -urN gdb-5.3/gdb/gdbserver.orig/low-sparc.c gdb-5.3/gdb/gdbserver/low-sparc.c
---- gdb-5.3/gdb/gdbserver.orig/low-sparc.c     2002-01-17 14:13:50.000000000 -0700
-+++ gdb-5.3/gdb/gdbserver/low-sparc.c  2003-08-20 08:46:38.000000000 -0600
-@@ -44,7 +44,6 @@
- #include <sys/ptrace.h>
- #include <sys/reg.h>
--extern int sys_nerr;
- extern char **sys_errlist;
- extern int errno;
-@@ -67,7 +66,7 @@
-       execv (program, allargs);
-       fprintf (stderr, "Cannot exec %s: %s.\n", program,
--             errno < sys_nerr ? sys_errlist[errno] : "unknown error");
-+             strerror (errno));
-       fflush (stderr);
-       _exit (0177);
-     }
-diff -urN gdb-5.3/gdb/gdbserver.orig/low-sun3.c gdb-5.3/gdb/gdbserver/low-sun3.c
---- gdb-5.3/gdb/gdbserver.orig/low-sun3.c      2002-01-17 14:13:50.000000000 -0700
-+++ gdb-5.3/gdb/gdbserver/low-sun3.c   2003-08-20 08:46:51.000000000 -0600
-@@ -41,7 +41,6 @@
- #include <sys/ptrace.h>
- #include <machine/reg.h>
--extern int sys_nerr;
- extern char **sys_errlist;
- extern int errno;
-@@ -64,7 +63,7 @@
-       execv (program, allargs);
-       fprintf (stderr, "Cannot exec %s: %s.\n", program,
--             errno < sys_nerr ? sys_errlist[errno] : "unknown error");
-+             strerror (errno));
-       fflush (stderr);
-       _exit (0177);
-     }
-diff -urN gdb-5.3/gdb/gdbserver.orig/utils.c gdb-5.3/gdb/gdbserver/utils.c
---- gdb-5.3/gdb/gdbserver.orig/utils.c 2003-08-20 08:47:56.000000000 -0600
-+++ gdb-5.3/gdb/gdbserver/utils.c      2003-08-20 08:48:15.000000000 -0600
-@@ -33,16 +33,13 @@
- perror_with_name (char *string)
- {
- #ifndef STDC_HEADERS
--  extern int sys_nerr;
--  extern char *sys_errlist[];
-   extern int errno;
- #endif
-   const char *err;
-   char *combined;
--  if (errno < sys_nerr)
--    err = sys_errlist[errno];
--  else
-+  err = strerror (errno);
-+  if (err == NULL)
-     err = "unknown error";
-   combined = (char *) alloca (strlen (err) + strlen (string) + 3);
-diff -urN gdb-5.3/gdb/gdbserver.orig/linux-low.c.orig gdb-5.3/gdb/gdbserver/linux-low.c.orig
---- gdb-5.3/gdb/gdbserver.orig/linux-low.c     2003-08-20 08:40:27.000000000 -0600
-+++ gdb-5.3/gdb/gdbserver/linux-low.c  2003-08-20 08:44:54.000000000 -0600
-@@ -175,8 +175,7 @@
-   if (ptrace (PTRACE_ATTACH, pid, 0, 0) != 0)
-     {
-       fprintf (stderr, "Cannot attach to process %d: %s (%d)\n", pid,
--             errno < sys_nerr ? sys_errlist[errno] : "unknown error",
--             errno);
-+             strerror (errno), errno);
-       fflush (stderr);
-       /* If we fail to attach to an LWP, just return.  */
-
diff --git a/obsolete-buildroot/sources/genext2fs.patch b/obsolete-buildroot/sources/genext2fs.patch
deleted file mode 100644 (file)
index 73e5ce0..0000000
+++ /dev/null
@@ -1,2457 +0,0 @@
-diff -urN genext2fs-1.3.orig/Makefile genext2fs-1.3/Makefile
---- genext2fs-1.3.orig/Makefile        1969-12-31 17:00:00.000000000 -0700
-+++ genext2fs-1.3/Makefile     2003-04-21 01:41:42.000000000 -0600
-@@ -0,0 +1,46 @@
-+CC=gcc
-+CFLAGS=-Wall -O0 -g
-+
-+SRC=genext2fs.c
-+OBJS=$(patsubst %.c,%.o, $(SRC))
-+
-+all: genext2fs
-+INSTALL=install
-+
-+genext2fs: $(OBJS)
-+      $(CC) $(CFLAGS) -o $@ $(OBJS) -o $@
-+
-+$(OBJS): %.o : %.c
-+      $(CC) $(CFLAGS) -c $< -o $@
-+
-+$(OBJS): Makefile
-+
-+install:
-+      $(INSTALL) -d $(DESTDIR)/usr/bin/
-+      $(INSTALL) -m 755 genext2fs $(DESTDIR)/usr/bin/
-+      $(INSTALL) -d $(DESTDIR)/usr/share/man/man8/
-+      $(INSTALL) -m 644 genext2fs.8 $(DESTDIR)/usr/share/man/man8/
-+
-+clean:
-+      rm -rf *.o *.a core genext2fs
-+      rm -rf test ext2.img
-+
-+check: all
-+      mkdir -p test
-+      dd if=/dev/zero of=test/zero count=1
-+      ./genext2fs -b 4096 -d test ext2.img
-+      
-+      md5=`md5sum ext2.img | cut -f 1 -d " "`; \
-+      if [ "$$md5" != "89471302d95f96a76fbb2cff98182cde" ] ; then \
-+              echo "test failed."; \
-+      else \
-+              echo "test succeeded."; \
-+      fi
-+      
-+# test genext2fs by creating the image and comparing checksums
-+test: all
-+      sh ./test.sh
-+
-+# test genext2fs by actually mounting the created image.
-+test-mount: all
-+      sudo sh ./test-mount.sh
-diff -urN genext2fs-1.3.orig/debian/changelog genext2fs-1.3/debian/changelog
---- genext2fs-1.3.orig/debian/changelog        1969-12-31 17:00:00.000000000 -0700
-+++ genext2fs-1.3/debian/changelog     2003-04-21 01:41:42.000000000 -0600
-@@ -0,0 +1,17 @@
-+genext2fs (1.3-2) unstable; urgency=low
-+
-+  * apply fix from upstream cvs that appears to fix endian bug 
-+    (closes: #122411)
-+  * mention filesystem size limit in manpage (closes: #122729)
-+  * mention that hard links are not supported in manpage 
-+    (closes: #155464)
-+  * add sanity check at the end of the build
-+
-+ -- David Kimdon <dwhedon@debian.org>  Fri,  8 Mar 2002 23:17:36 -0800
-+
-+genext2fs (1.3-1) unstable; urgency=low
-+
-+  * Initial Release. (closes: #105263)
-+
-+ -- David Kimdon <dwhedon@debian.org>  Sat, 14 Jul 2001 13:24:49 -0700
-+
-diff -urN genext2fs-1.3.orig/debian/control genext2fs-1.3/debian/control
---- genext2fs-1.3.orig/debian/control  1969-12-31 17:00:00.000000000 -0700
-+++ genext2fs-1.3/debian/control       2003-04-21 01:41:42.000000000 -0600
-@@ -0,0 +1,19 @@
-+Source: genext2fs
-+Section: admin
-+Priority: optional
-+Maintainer: David Kimdon <dwhedon@debian.org>
-+Build-Depends: debhelper (>> 3.0.0)
-+Standards-Version: 3.5.2
-+
-+Package: genext2fs
-+Architecture: any
-+Depends: ${shlibs:Depends}
-+Description: ext2 filesystem generator for embedded systems
-+ `genext2fs' is meant to generate an ext2 filesystem
-+ as a normal (non-root) user. It doesn't require you to mount
-+ the image file to copy files on it. It doesn't even require
-+ you to be the superuser to make device nodes.
-+ .
-+ Warning ! `genext2fs' has been designed for embedded
-+ systems. As such, it will generate a filesystem for single-user
-+ usage: all files/directories/etc... will belong to UID/GID 0
-diff -urN genext2fs-1.3.orig/debian/copyright genext2fs-1.3/debian/copyright
---- genext2fs-1.3.orig/debian/copyright        1969-12-31 17:00:00.000000000 -0700
-+++ genext2fs-1.3/debian/copyright     2003-04-21 01:41:42.000000000 -0600
-@@ -0,0 +1,15 @@
-+This package was debianized by David Kimdon <dwhedon@debian.org> on
-+Sat, 14 Jul 2001 13:24:49 -0700.
-+
-+It was downloaded from http://freshmeat.net/projects/genext2fs/
-+Upstream Author(s):   Xavier Bestel <xbestel@aplio.fr>
-+
-+Copyright (C) 2000 Xavier Bestel <xavier.bestel@free.fr>
-+
-+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; version
-+2 of the License.
-+
-+On Debian systems, the complete text of the GNU General Public
-+License can be found in /usr/share/common-licenses/GPL file.
-diff -urN genext2fs-1.3.orig/debian/rules genext2fs-1.3/debian/rules
---- genext2fs-1.3.orig/debian/rules    1969-12-31 17:00:00.000000000 -0700
-+++ genext2fs-1.3/debian/rules 2003-04-21 01:41:42.000000000 -0600
-@@ -0,0 +1,70 @@
-+#!/usr/bin/make -f
-+# Sample debian/rules that uses debhelper.
-+# GNU copyright 1997 to 1999 by Joey Hess.
-+
-+# Uncomment this to turn on verbose mode.
-+#export DH_VERBOSE=1
-+
-+# This is the debhelper compatability version to use.
-+export DH_COMPAT=2
-+
-+configure: configure-stamp
-+configure-stamp:
-+      dh_testdir
-+      # Add here commands to configure the package.
-+      # ./configure --prefix=/usr --mandir=/usr/share/man/
-+
-+      touch configure-stamp
-+
-+build: configure-stamp build-stamp
-+build-stamp:
-+      dh_testdir
-+
-+      # Add here commands to compile the package.
-+      $(MAKE)
-+      $(MAKE) check
-+
-+      touch build-stamp
-+
-+clean:
-+      dh_testdir
-+      dh_testroot
-+      rm -f build-stamp configure-stamp
-+
-+      # Add here commands to clean up after the build process.
-+      -$(MAKE) clean
-+
-+      dh_clean
-+
-+install: build
-+      dh_testdir
-+      dh_testroot
-+      dh_clean -k
-+      dh_installdirs
-+
-+      # Add here commands to install the package into debian/genext2fs.
-+      $(MAKE) install DESTDIR=`pwd`/debian/genext2fs
-+
-+
-+# Build architecture-independent files here.
-+binary-indep: build install
-+# We have nothing to do by default.
-+
-+# Build architecture-dependent files here.
-+binary-arch: build install
-+      dh_testdir
-+      dh_testroot
-+      dh_installdocs
-+      dh_installchangelogs 
-+      dh_link
-+      dh_strip
-+      dh_compress
-+      dh_fixperms
-+      dh_installdeb
-+      dh_shlibdeps
-+      dh_gencontrol
-+      dh_md5sums
-+      dh_builddeb
-+
-+binary: binary-indep binary-arch
-+.PHONY: build clean binary-indep binary-arch binary install configure
-diff -urN genext2fs-1.3.orig/dev.txt genext2fs-1.3/dev.txt
---- genext2fs-1.3.orig/dev.txt 2000-09-28 09:03:19.000000000 -0600
-+++ genext2fs-1.3/dev.txt      1969-12-31 17:00:00.000000000 -0700
-@@ -1,94 +0,0 @@
--drwx          /dev
--crw-  10,190  /dev/lcd
--crw-  10,191  /dev/splc781
--crw-  4,0     /dev/console
--crw-  5,64    /dev/cua0
--crw-  5,65    /dev/cua1
--crw-  5,66    /dev/cua2
--crw-  5,70    /dev/cua6
--crw-  5,71    /dev/cua7
--crw-  5,72    /dev/cua8
--crw-  5,73    /dev/cua9
--crw-  29,0    /dev/fb0
--crw-  29,32   /dev/fb1
--crw-  1,2     /dev/kmem
--crw-  1,1     /dev/mem
--crw-  1,3     /dev/null
--crw-  2,2     /dev/ptyp2
--crw-  2,3     /dev/ptyp3
--crw-  2,5     /dev/ptyp5
--crw-  2,4     /dev/ptyp4
--crw-  10,178  /dev/triokb
--crw-  2,0     /dev/ptyp0
--crw-  2,6     /dev/ptyp6
--crw-  2,7     /dev/ptyp7
--crw-  2,8     /dev/ptyp8
--crw-  2,9     /dev/ptyp9
--crw-  2,10    /dev/ptypa
--crw-  2,11    /dev/ptypb
--crw-  2,12    /dev/ptypc
--crw-  2,13    /dev/ptypd
--crw-  2,14    /dev/ptype
--crw-  2,15    /dev/ptypf
--brw-  1,0     /dev/ram0
--brw-  1,1     /dev/ram1
--brw-  1,2     /dev/ram2
--brw-  1,3     /dev/ram3
--br--  31,0    /dev/rom0
--brw-  31,1    /dev/rom1
--brw-  31,2    /dev/rom2
--brw-  31,3    /dev/rom3
--crw-  5,0     /dev/tty
--crw-  4,0     /dev/tty0
--crwx  4,1     /dev/tty1
--crwx  4,2     /dev/tty2
--crwx  4,3     /dev/tty3
--crwx  4,4     /dev/tty4
--crw-  4,5     /dev/tty5
--crwx  4,6     /dev/tty6
--crw-  4,7     /dev/tty7
--crw-  4,8     /dev/tty8
--crw-  4,9     /dev/tty9
--crw-  4,64    /dev/ttyS0
--crw-  4,65    /dev/ttyS1
--crw-  4,66    /dev/ttyS2
--crw-  4,67    /dev/ttyS3
--crw-  4,68    /dev/ttyS4
--crw-  4,69    /dev/ttyS5
--crw-  4,70    /dev/ttyS6
--crw-  4,71    /dev/ttyS7
--crw-  4,72    /dev/ttyS8
--crw-  4,73    /dev/ttyS9
--crw-  3,0     /dev/ttyp0
--crw-  3,1     /dev/ttyp1
--crw-  3,2     /dev/ttyp2
--crw-  3,3     /dev/ttyp3
--crw-  3,4     /dev/ttyp4
--crw-  3,5     /dev/ttyp5
--crw-  3,6     /dev/ttyp6
--crw-  3,7     /dev/ttyp7
--crw-  3,8     /dev/ttyp8
--crw-  3,9     /dev/ttyp9
--crw-  3,10    /dev/ttypa
--crw-  3,11    /dev/ttypb
--crw-  3,12    /dev/ttypc
--crw-  3,13    /dev/ttypd
--crw-  3,14    /dev/ttype
--crw-  3,15    /dev/ttypf
--crw-  1,5     /dev/zero
--crwx  10,111  /dev/dtedrv
--crwx  4,110   /dev/ttyM
--crw-  77,1    /dev/tssnd
--crw-  77,2    /dev/tstone
--crw-  2,1     /dev/ptyp1
--crwx  10,180  /dev/triohook
--crw-  90,0    /dev/mtd0
--brw-  44,0    /dev/ftl0
--crw-  10,175  /dev/tporta
--crw-  10,176  /dev/tportb
--crwx  10,100  /dev/softmodem
--crwx  10,101  /dev/softmodem_signals
--crwx  10,181  /dev/triovoice
--crw-  5,67    /dev/cua3
--crw-  5,68    /dev/cua4
--crw-  5,69    /dev/cua5
-diff -urN genext2fs-1.3.orig/device_table.txt genext2fs-1.3/device_table.txt
---- genext2fs-1.3.orig/device_table.txt        1969-12-31 17:00:00.000000000 -0700
-+++ genext2fs-1.3/device_table.txt     2003-04-21 01:41:42.000000000 -0600
-@@ -0,0 +1,129 @@
-+# When building a target filesystem, it is desirable to not have to
-+# become root and then run 'mknod' a thousand times.  Using a device 
-+# table you can create device nodes and directories "on the fly".
-+#
-+# This is a sample device table file for use with genext2fs.  You can
-+# do all sorts of interesting things with a device table file.  For
-+# example, if you want to adjust the permissions on a particular file
-+# you can just add an entry like:
-+#   /sbin/foobar        f       2755    0       0       -       -       -       -       -
-+# and (assuming the file /sbin/foobar exists) it will be made setuid
-+# root (regardless of what its permissions are on the host filesystem.
-+# Furthermore, you can use a single table entry to create a many device
-+# minors.  For example, if I wanted to create /dev/hda and /dev/hda[0-15]
-+# I could just use the following two table entries:
-+#   /dev/hda    b       640     0       0       3       0       0       0       -
-+#   /dev/hda    b       640     0       0       3       1       1       1       15
-+# 
-+# Device table entries take the form of:
-+# <name>    <type>      <mode>  <uid>   <gid>   <major> <minor> <start> <inc>   <count>
-+# where name is the file name,  type can be one of: 
-+#       f       A regular file
-+#       d       Directory
-+#       c       Character special device file
-+#       b       Block special device file
-+#       p       Fifo (named pipe)
-+# uid is the user id for the target file, gid is the group id for the
-+# target file.  The rest of the entries (major, minor, etc) apply only 
-+# to device special files.
-+
-+# Have fun
-+# -Erik Andersen <andersen@codepoet.org>
-+#
-+
-+#<name>               <type>  <mode>  <uid>   <gid>   <major> <minor> <start> <inc>   <count>
-+/dev          d       755     0       0       -       -       -       -       -
-+/dev/mem      c       640     0       0       1       1       0       0       -
-+/dev/kmem     c       640     0       0       1       2       0       0       -
-+/dev/null     c       640     0       0       1       3       0       0       -
-+/dev/zero     c       640     0       0       1       5       0       0       -
-+/dev/random   c       640     0       0       1       8       0       0       -
-+/dev/urandom  c       640     0       0       1       9       0       0       -
-+/dev/tty      c       666     0       0       5       0       0       0       -
-+/dev/tty      c       666     0       0       4       0       0       1       6
-+/dev/console  c       640     0       0       5       1       0       0       -
-+/dev/ram      b       640     0       0       1       1       0       0       -
-+/dev/ram      b       640     0       0       1       0       0       1       4
-+/dev/loop     b       640     0       0       7       0       0       1       2
-+/dev/ptmx     c       666     0       0       5       2       0       0       -
-+#/dev/ttyS    c       640     0       0       4       64      0       1       4
-+#/dev/psaux   c       640     0       0       10      1       0       0       -
-+#/dev/rtc     c       640     0       0       10      135     0       0       -
-+
-+# Adjust permissions on some normal files
-+#/etc/shadow  f       600     0       0       -       -       -       -       -
-+#/bin/tinylogin       f       4755    0       0       -       -       -       -       -
-+
-+# User-mode Linux stuff
-+/dev/ubda     b       640     0       0       98      0       0       0       -
-+/dev/ubda     b       640     0       0       98      1       1       1       15
-+
-+# IDE Devices
-+/dev/hda      b       640     0       0       3       0       0       0       -
-+/dev/hda      b       640     0       0       3       1       1       1       15
-+/dev/hdb      b       640     0       0       3       64      0       0       -
-+/dev/hdb      b       640     0       0       3       65      1       1       15
-+#/dev/hdc     b       640     0       0       22      0       0       0       -
-+#/dev/hdc     b       640     0       0       22      1       1       1       15
-+#/dev/hdd     b       640     0       0       22      64      0       0       -
-+#/dev/hdd     b       640     0       0       22      65      1       1       15
-+#/dev/hde     b       640     0       0       33      0       0       0       -
-+#/dev/hde     b       640     0       0       33      1       1       1       15
-+#/dev/hdf     b       640     0       0       33      64      0       0       -
-+#/dev/hdf     b       640     0       0       33      65      1       1       15
-+#/dev/hdg     b       640     0       0       34      0       0       0       -
-+#/dev/hdg     b       640     0       0       34      1       1       1       15
-+#/dev/hdh     b       640     0       0       34      64      0       0       -
-+#/dev/hdh     b       640     0       0       34      65      1       1       15
-+
-+# SCSI Devices
-+#/dev/sda     b       640     0       0       8       0       0       0       -
-+#/dev/sda     b       640     0       0       8       1       1       1       15
-+#/dev/sdb     b       640     0       0       8       16      0       0       -
-+#/dev/sdb     b       640     0       0       8       17      1       1       15
-+#/dev/sdc     b       640     0       0       8       32      0       0       -
-+#/dev/sdc     b       640     0       0       8       33      1       1       15
-+#/dev/sdd     b       640     0       0       8       48      0       0       -
-+#/dev/sdd     b       640     0       0       8       49      1       1       15
-+#/dev/sde     b       640     0       0       8       64      0       0       -
-+#/dev/sde     b       640     0       0       8       65      1       1       15
-+#/dev/sdf     b       640     0       0       8       80      0       0       -
-+#/dev/sdf     b       640     0       0       8       81      1       1       15
-+#/dev/sdg     b       640     0       0       8       96      0       0       -
-+#/dev/sdg     b       640     0       0       8       97      1       1       15
-+#/dev/sdh     b       640     0       0       8       112     0       0       -
-+#/dev/sdh     b       640     0       0       8       113     1       1       15
-+#/dev/sg              c       640     0       0       21      0       0       1       15
-+#/dev/scd     b       640     0       0       11      0       0       1       15
-+#/dev/st              c       640     0       0       9       0       0       1       8
-+#/dev/nst     c       640     0       0       9       128     0       1       8
-+#/dev/st      c       640     0       0       9       32      1       1       4
-+#/dev/st      c       640     0       0       9       64      1       1       4
-+#/dev/st      c       640     0       0       9       96      1       1       4
-+
-+# Floppy disk devices
-+#/dev/fd              b       640     0       0       2       0       0       1       2
-+#/dev/fd0d360 b       640     0       0       2       4       0       0       -
-+#/dev/fd1d360 b       640     0       0       2       5       0       0       -
-+#/dev/fd0h1200        b       640     0       0       2       8       0       0       -
-+#/dev/fd1h1200        b       640     0       0       2       9       0       0       -
-+#/dev/fd0u1440        b       640     0       0       2       28      0       0       -
-+#/dev/fd1u1440        b       640     0       0       2       29      0       0       -
-+#/dev/fd0u2880        b       640     0       0       2       32      0       0       -
-+#/dev/fd1u2880        b       640     0       0       2       33      0       0       -
-+
-+# All the proprietary cdrom devices in the world
-+#/dev/aztcd   b       640     0       0       29      0       0       0       -
-+#/dev/bpcd    b       640     0       0       41      0       0       0       -
-+#/dev/capi20  c       640     0       0       68      0       0       1       2
-+#/dev/cdu31a  b       640     0       0       15      0       0       0       -
-+#/dev/cdu535  b       640     0       0       24      0       0       0       -
-+#/dev/cm206cd b       640     0       0       32      0       0       0       -
-+#/dev/sjcd    b       640     0       0       18      0       0       0       -
-+#/dev/sonycd  b       640     0       0       15      0       0       0       -
-+#/dev/gscd    b       640     0       0       16      0       0       0       -
-+#/dev/sbpcd   b       640     0       0       25      0       0       0       -
-+#/dev/sbpcd   b       640     0       0       25      0       0       1       4
-+#/dev/mcd     b       640     0       0       23      0       0       0       -
-+#/dev/optcd   b       640     0       0       17      0       0       0       -
-+
-diff -urN genext2fs-1.3.orig/genext2fs.8 genext2fs-1.3/genext2fs.8
---- genext2fs-1.3.orig/genext2fs.8     1969-12-31 17:00:00.000000000 -0700
-+++ genext2fs-1.3/genext2fs.8  2003-04-21 01:41:42.000000000 -0600
-@@ -0,0 +1,125 @@
-+.\"                                      Hey, EMACS: -*- nroff -*-
-+.\" First parameter, NAME, should be all caps
-+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
-+.\" other parameters are allowed: see man(7), man(1)
-+.TH GENEXT2FS 8 "July 14, 2001"
-+.\" Please adjust this date whenever revising the manpage.
-+.\"
-+.\" Some roff macros, for reference:
-+.\" .nh        disable hyphenation
-+.\" .hy        enable hyphenation
-+.\" .ad l      left justify
-+.\" .ad b      justify to both left and right margins
-+.\" .nf        disable filling
-+.\" .fi        enable filling
-+.\" .br        insert line break
-+.\" .sp <n>    insert n+1 empty lines
-+.\" for manpage-specific macros, see man(7)
-+.SH NAME
-+genext2fs \- ext2 filesystem generator for embedded systems
-+.SH SYNOPSIS
-+.B genext2fs
-+.RI [ options ]  " image"
-+.SH DESCRIPTION
-+\fBgenext2fs\fP generates an ext2 filesystem
-+as a normal (non-root) user. It doesn't require you to mount
-+the image file to copy files on it. It doesn't even require
-+you to be the superuser to make device nodes.
-+.SH OPTIONS
-+.TP
-+.BI -x \ image
-+Use this image as a starting point
-+.TP
-+.BI -d \ directory
-+Add this directory as source
-+.TP
-+.BI -f \ FILE
-+.TP
-+.BI -D \ FILE
-+Uses the named FILE as a device table file, to create device 
-+nodes and directories "on the fly".
-+.TP
-+.BI -b \ blocks
-+Size in blocks
-+.TP
-+.BI -i \ inodes
-+Number of inodes
-+.TP
-+.BI -r \ reserved
-+Number of reserved blocks
-+.TP
-+.BI -g \ path
-+Generate a block map file for this path
-+.TP
-+.BI -e \ value
-+Fill unallocated blocks with value
-+.TP
-+.BI -z
-+Make files with holes
-+.TP
-+.BI -U
-+Squash owners making all files be owned by root
-+.TP
-+.BI -P
-+Squash permissions on all files
-+.TP
-+.BI -q
-+Squash permissions and owners (same as -P -U)
-+.TP
-+.BI -v
-+Print resulting filesystem structure
-+.TP
-+.BI -h
-+Display help
-+.TP
-+.SH EXAMPLES
-+
-+.EX
-+.B
-+ genext2fs -b 1440 -d src /dev/fd0
-+.EE
-+
-+All files in the 
-+.I src
-+directory will be written to 
-+.B /dev/fd0
-+as a new ext2 filesystem image. You can then mount the floppy as
-+usual.
-+
-+.EX
-+.B
-+ genext2fs -b 1024 -d src -D device_table.txt flashdisk.img
-+.EE
-+
-+This example builds a filesystem from all the files in 
-+.I src
-+, then device nodes are created based on the content the device_table file
-+.I dev.txt.
-+An example device file follows:
-+
-+.EX
-+ #<name>              <type>  <mode>  <uid>   <gid>   <major> <minor> <start> <inc>   <count>
-+ /dev         d       755     0       0       -       -       -       -       -
-+ /dev/mem     c       640     0       0       1       1       0       0       -
-+ /dev/tty     c       666     0       0       5       0       0       0       -
-+ /dev/tty     c       666     0       0       4       0       0       1       6
-+ /dev/loop    b       640     0       0       7       0       0       1       2
-+ /dev/hda     b       640     0       0       3       0       0       0       -
-+ /dev/hda     b       640     0       0       3       1       1       1       16
-+.EE
-+
-+This device table creates the /dev directory, a character device
-+node /dev/mem (major 1, minor 1), it also creates /dev/tty, 
-+/dev/tty[0-5], /dev/loop[0-1], /dev/hda, and /dev/hda0 to /dev/hda15
-+.SH BUGS
-+\fBgenext2fs\fP does not support hard links.  Hard links present in the input
-+tree will be represented as separate files in the ext2 image.
-+
-+.SH SEE ALSO
-+.BR mkfs (8),
-+.BR genromfs (8),
-+.BR mkisofs (8).
-+.br
-+.SH AUTHOR
-+This manual page was written by David Kimdon <dwhedon@debian.org>,
-+for the Debian GNU/Linux system (but may be used by others).
-diff -urN genext2fs-1.3.orig/genext2fs.c genext2fs-1.3/genext2fs.c
---- genext2fs-1.3.orig/genext2fs.c     2001-06-18 02:11:32.000000000 -0600
-+++ genext2fs-1.3/genext2fs.c  2003-04-21 01:48:35.000000000 -0600
-@@ -1,3 +1,4 @@
-+/* vi: set sw=8 ts=8: */
- // genext2fs.c
- //
- // ext2 filesystem generator for embedded systems
-@@ -26,6 +27,22 @@
- //                    Bugfix: getcwd values for Solaris       xavier.gueguen@col.bsf.alcatel.fr
- //                    Bugfix: ANSI scanf for non-GNU C        xavier.gueguen@col.bsf.alcatel.fr
- //    28 Jun 2001     Bugfix: getcwd differs for Solaris/GNU  mike@sowbug.com
-+//    23 Mar 2002     Bugfix: test for IFCHR or IFBLK was flawed
-+//    10 Oct 2002     Added comments,makefile targets,        vsundar@ixiacom.com    
-+//                    endianess swap assert check.  
-+//                    Copyright (C) 2002 Ixia communications
-+//    12 Oct 2002     Added support for triple indirection    vsundar@ixiacom.com
-+//                    Copyright (C) 2002 Ixia communications
-+//    14 Oct 2002     Added support for groups                vsundar@ixiacom.com
-+//                    Copyright (C) 2002 Ixia communications
-+//    5 Jan 2003      Bugfixes: reserved inodes should be set vsundar@usc.edu
-+//                    only in the first group; directory names
-+//                    need to be null padded at the end; and 
-+//                    number of blocks per group should be a 
-+//                    multiple of 8. Updated md5 values. 
-+//    6 Jan 2003      Erik Andersen <andersee@debian.org> added
-+//                        mkfs.jffs2 compatible device table support,
-+//                        along with -q, -P, -U
- // `genext2fs' is a mean to generate an ext2 filesystem
-@@ -33,10 +50,6 @@
- // the image file to copy files on it. It doesn't even require
- // you to be the superuser to make device nodes.
- //
--// Warning ! `genext2fs' has been designed for embedded
--// systems. As such, it will generate a filesystem for single-user
--// usage: all files/directories/etc... will belong to UID/GID 0
--//
- // Example usage:
- //
- // # genext2fs -b 1440 -d srcdir /dev/fd0
-@@ -45,21 +58,15 @@
- // a new ext2 filesystem image. You can then mount the floppy as
- // usual.
- //
--// # genext2fs -b 1024 -d builddir -f devices.txt flashdisk.img
-+// # genext2fs -b 1024 -d builddir -D device_table.txt flashdisk.img
- //
- // This one would build a filesystem from all the files in builddir,
--// then would read a devices list and make apropriate nodes. The
--// format for the device list is:
--//
--// drwx            /dev
--// crw-    10,190  /dev/lcd
--// brw-    1,0     /dev/ram0
--// 
--// This device list builds the /dev directory, a character device
--// node /dev/lcd (major 10, minor 190) and a block device node
--// /dev/ram0 (major 1, minor 0)
-+// then would read the device_table.txt file and make apropriate nodes.
-+// The format for the device table file is covered in detail in the sample
-+// device_table.txt file provided with the genext2fs source.
-+#define _GNU_SOURCE
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-@@ -67,6 +74,11 @@
- #include <stdarg.h>
- #include <unistd.h>
- #include <sys/stat.h>
-+#include <assert.h>
-+#include <time.h>
-+#include <ctype.h>
-+#include <errno.h>
-+#include <fcntl.h>
-@@ -76,10 +88,14 @@
- #define BLOCKSIZE         1024
- #define BLOCKS_PER_GROUP  8192
- #define BYTES_PER_INODE   (8*BLOCKSIZE)
-+/* Percentage of blocks that are reserved.*/
- #define RESERVED_INODES   5/100
- // inode block size (why is it != BLOCKSIZE ?!?)
-+/* The field i_blocks in the ext2 inode stores the number of data blocks
-+   but in terms of 512 bytes. That is what INODE_BLOCKSIZE represents.
-+   INOBLK is the number of such blocks in an actual disk block            */
- #define INODE_BLOCKSIZE   512
- #define INOBLK            (BLOCKSIZE / INODE_BLOCKSIZE)
-@@ -147,6 +163,39 @@
- #define OP_HOLES     0x01       // make files with holes
-+/* Defines for accessing group details */
-+
-+// Number of groups in the filesystem
-+#define GRP_NBGROUPS(fs) ( ((fs)->sb.s_blocks_count-1)/(fs)->sb.s_blocks_per_group )
-+
-+// Get group block bitmap (bbm) given the group number
-+#define GRP_GET_GROUP_BBM(fs,grp) ( get_blk((fs),(fs)->gd[(grp)].bg_block_bitmap) )
-+
-+// Get group inode bitmap (ibm) given the group number
-+#define GRP_GET_GROUP_IBM(fs,grp) ( get_blk((fs),(fs)->gd[(grp)].bg_inode_bitmap) )
-+              
-+// Given an inode number find the group it belongs to
-+#define GRP_GROUP_OF_INODE(fs,nod) ( ((nod)-1) / (fs)->sb.s_inodes_per_group)
-+
-+//Given an inode number get the inode bitmap that covers it
-+#define GRP_GET_INODE_BITMAP(fs,nod) \
-+      ( GRP_GET_GROUP_IBM((fs),GRP_GROUP_OF_INODE((fs),(nod))) )
-+
-+//Given an inode number find its offset within the inode bitmap that covers it
-+#define GRP_IBM_OFFSET(fs,nod) \
-+      ( (nod) - GRP_GROUP_OF_INODE((fs),(nod))*(fs)->sb.s_inodes_per_group )
-+
-+// Given a block number find the group it belongs to
-+#define GRP_GROUP_OF_BLOCK(fs,blk) ( ((blk)-1) / (fs)->sb.s_blocks_per_group)
-+      
-+//Given a block number get the block bitmap that covers it
-+#define GRP_GET_BLOCK_BITMAP(fs,blk) \
-+      ( GRP_GET_GROUP_BBM((fs),GRP_GROUP_OF_BLOCK((fs),(blk))) )
-+
-+//Given a block number find its offset within the block bitmap that covers it
-+#define GRP_BBM_OFFSET(fs,blk) \
-+      ( (blk) - GRP_GROUP_OF_BLOCK((fs),(blk))*(fs)->sb.s_blocks_per_group )
-+
- // used types
-@@ -287,7 +336,6 @@
- {
-       groupdescriptor_decl
-       uint32 bg_reserved[3];
--      uint32 bg_pad_to_bk[(BLOCKSIZE-32)/sizeof(uint32)];
- } groupdescriptor;
- typedef struct
-@@ -304,6 +352,32 @@
- typedef uint8 block[BLOCKSIZE];
-+/* blockwalker fields:
-+   The blockwalker is used to access all the blocks of a file (including
-+   the indirection blocks) through repeated calls to walk_bw.  
-+   
-+   bpdir -> index into the inode->i_block[]. Indicates level of indirection.
-+   bnum -> total number of blocks so far accessed. including indirection
-+           blocks.
-+   bpind,bpdind,bptind -> index into indirection blocks.
-+   
-+   bpind, bpdind, bptind do *NOT* index into single, double and triple
-+   indirect blocks resp. as you might expect from their names. Instead 
-+   they are in order the 1st, 2nd & 3rd index to be used
-+   
-+   As an example..
-+   To access data block number 70000:
-+        bpdir: 15 (we are doing triple indirection)
-+        bpind: 0 ( index into the triple indirection block)
-+        bpdind: 16 ( index into the double indirection block)
-+        bptind: 99 ( index into the single indirection block)
-+      70000 = 12 + 256 + 256*256 + 16*256 + 100 (indexing starts from zero)
-+
-+   So,for double indirection bpind will index into the double indirection 
-+   block and bpdind into the single indirection block. For single indirection
-+   only bpind will be used.
-+*/
-+   
- typedef struct
- {
-       uint32 bnum;
-@@ -313,15 +387,14 @@
-       uint32 bptind;
- } blockwalker;
-+
-+/* Filesystem structure that support groups */
- #if BLOCKSIZE == 1024
- typedef struct
- {
-       block zero;          // The famous block 0
-       superblock sb;       // The superblock
--      groupdescriptor gd;  // The group desciptor
--      block bbm;           // The block bitmap
--      block ibm;           // The inode bitmap
--      inode itab[0];       // The inode table
-+      groupdescriptor gd[0]; // The group descriptors
- } filesystem;
- #else
- #error UNHANDLED BLOCKSIZE
-@@ -389,25 +462,113 @@
- #undef udecl32
- #undef utdecl32
--char * argv0;
-+static char * app_name;
-+static int squash_uids = 0;
-+static int squash_perms = 0;
-+static const char *const memory_exhausted = "memory exhausted";
- // error (un)handling
--inline void errexit(const char *fmt, ...)
-+static void verror_msg(const char *s, va_list p)
- {
--      va_list ap;
--      fprintf(stderr, "%s: ", argv0);
--      va_start(ap, fmt);
--      vfprintf(stderr, fmt, ap);
--      va_end(ap);
--      fprintf(stderr, "\n");
--      exit(1);
-+      fflush(stdout);
-+      fprintf(stderr, "%s: ", app_name);
-+      vfprintf(stderr, s, p);
-+}
-+static void error_msg(const char *s, ...)
-+{
-+      va_list p;
-+      va_start(p, s);
-+      verror_msg(s, p);
-+      va_end(p);
-+      putc('\n', stderr);
-+}
-+
-+static void error_msg_and_die(const char *s, ...)
-+{
-+      va_list p;
-+      va_start(p, s);
-+      verror_msg(s, p);
-+      va_end(p);
-+      putc('\n', stderr);
-+      exit(EXIT_FAILURE);
-+}
-+
-+static void vperror_msg(const char *s, va_list p)
-+{
-+      int err = errno;
-+      if (s == 0)
-+              s = "";
-+      verror_msg(s, p);
-+      if (*s)
-+              s = ": ";
-+      fprintf(stderr, "%s%s\n", s, strerror(err));
-+}
-+
-+#if 0
-+static void perror_msg(const char *s, ...)
-+{
-+      va_list p;
-+      va_start(p, s);
-+      vperror_msg(s, p);
-+      va_end(p);
-+}
-+#endif
-+static void perror_msg_and_die(const char *s, ...)
-+{
-+      va_list p;
-+      va_start(p, s);
-+      vperror_msg(s, p);
-+      va_end(p);
-+      exit(EXIT_FAILURE);
- }
--inline void pexit(const char * fname)
-+static FILE *xfopen(const char *path, const char *mode)
- {
--      fprintf(stderr, "%s: ", argv0);
--      perror(fname);
--      exit(1);
-+      FILE *fp;
-+      if ((fp = fopen(path, mode)) == NULL)
-+              perror_msg_and_die("%s", path);
-+      return fp;
-+}
-+
-+static char *xstrdup(const char *s)
-+{
-+      char *t;
-+
-+      if (s == NULL)
-+              return NULL;
-+      t = strdup(s);
-+      if (t == NULL)
-+              error_msg_and_die(memory_exhausted);
-+      return t;
-+}
-+
-+extern void *xrealloc(void *ptr, size_t size)
-+{
-+      ptr = realloc(ptr, size);
-+      if (ptr == NULL && size != 0)
-+              error_msg_and_die(memory_exhausted);
-+      return ptr;
-+}
-+
-+static char *xreadlink(const char *path)
-+{
-+      static const int GROWBY = 80; /* how large we will grow strings by */
-+
-+      char *buf = NULL;
-+      int bufsize = 0, readsize = 0;
-+
-+      do {
-+              buf = xrealloc(buf, bufsize += GROWBY);
-+              readsize = readlink(path, buf, bufsize); /* 1st try */
-+              if (readsize == -1) {
-+                      perror_msg_and_die("%s:%s", app_name, path);
-+              }
-+      }
-+      while (bufsize < readsize + 1);
-+
-+      buf[readsize] = '\0';
-+
-+      return buf;
- }
- // printf helper macro
-@@ -423,7 +584,7 @@
- {
- }
--// rounds a quantity up to a blocksize
-+/* Rounds qty upto a multiple of siz. siz should be a power of 2 */
- uint32 rndup(uint32 qty, uint32 siz)
- {
-       return (qty + (siz - 1)) & ~(siz - 1);
-@@ -444,7 +605,13 @@
- // return a given inode from a filesystem
- inline inode * get_nod(filesystem *fs, uint32 nod)
- {
--      return &fs->itab[nod-1];
-+      int grp,offset;
-+      inode *itab;
-+
-+      offset = GRP_IBM_OFFSET(fs,nod);
-+      grp = GRP_GROUP_OF_INODE(fs,nod);
-+      itab = (inode *)get_blk(fs, fs->gd[grp].bg_inode_table);
-+      return itab+offset-1;
- }
- // allocate a given block/inode in the bitmap
-@@ -479,29 +646,57 @@
- }
- // allocate a block
--uint32 alloc_blk(filesystem *fs)
-+uint32 alloc_blk(filesystem *fs, uint32  nod)
- {
--      uint32 bk;
--      if(!(bk = allocate(fs->bbm, 0)))
--              errexit("couldn't allocate a block (no free space)");
--      if(!(fs->gd.bg_free_blocks_count--))
--              errexit("group descr. free blocks count == 0 (corrupted fs?)");
-+      uint32 bk=0;
-+      uint32 grp,nbgroups;
-+
-+      grp = nod/fs->sb.s_inodes_per_group;
-+      nbgroups = ( fs->sb.s_blocks_count - fs->sb.s_first_data_block + fs->sb.s_blocks_per_group -1 ) / 
-+                                      fs->sb.s_blocks_per_group;
-+      if(!(bk = allocate(get_blk(fs,fs->gd[grp].bg_block_bitmap), 0))) {
-+              for(grp=0;grp<nbgroups && !bk;grp++)
-+                      bk=allocate(get_blk(fs,fs->gd[grp].bg_block_bitmap),0);
-+              grp--;
-+      }
-+      if (!bk)
-+              error_msg_and_die("couldn't allocate a block (no free space)");
-+      if(!(fs->gd[grp].bg_free_blocks_count--))
-+              error_msg_and_die("group descr %d. free blocks count == 0 (corrupted fs?)",grp);
-       if(!(fs->sb.s_free_blocks_count--))
--              errexit("superblock free blocks count == 0 (corrupted fs?)");
--      return bk;
-+              error_msg_and_die("superblock free blocks count == 0 (corrupted fs?)");
-+      return fs->sb.s_blocks_per_group*grp + bk;
- }
- // allocate an inode
- uint32 alloc_nod(filesystem *fs)
- {
--      uint32 nod;
--      if(!(nod = allocate(fs->ibm, 0)))
--              errexit("couldn't allocate an inode (no free inode)");
--      if(!(fs->gd.bg_free_inodes_count--))
--              errexit("group descr. free blocks count == 0 (corrupted fs?)");
-+      uint32 nod=0,best_group=0;
-+      uint32 grp,nbgroups,avefreei;
-+
-+      nbgroups = ( fs->sb.s_blocks_count - fs->sb.s_first_data_block + fs->sb.s_blocks_per_group -1 ) / 
-+                                      fs->sb.s_blocks_per_group;
-+
-+      /* Distribute inodes amongst all the blocks                           */
-+      /* For every block group with more than average number of free inodes */
-+      /* find the one with the most free blocks and allocate node there     */
-+      /* Idea from find_group_dir in fs/ext2/ialloc.c in 2.4.19 kernel      */
-+      /* We do it for all inodes.                                           */
-+      avefreei  =  fs->sb.s_free_inodes_count / nbgroups;
-+      for(grp=0;grp<nbgroups && !nod;grp++) {
-+              if (fs->gd[grp].bg_free_inodes_count < avefreei)
-+                      continue;
-+              if (!best_group || 
-+                      fs->gd[grp].bg_free_blocks_count > fs->gd[best_group].bg_free_blocks_count)
-+                      best_group = grp;
-+      }
-+      if (!(nod = allocate(get_blk(fs,fs->gd[best_group].bg_inode_bitmap),0)))
-+              error_msg_and_die("couldn't allocate an inode (no free inode)");
-+      if(!(fs->gd[best_group].bg_free_inodes_count--))
-+              error_msg_and_die("group descr. free blocks count == 0 (corrupted fs?)");
-       if(!(fs->sb.s_free_inodes_count--))
--              errexit("superblock free blocks count == 0 (corrupted fs?)");
--      return nod;
-+              error_msg_and_die("superblock free blocks count == 0 (corrupted fs?)");
-+      return fs->sb.s_inodes_per_group*best_group+nod;
- }
- // print a bitmap allocation
-@@ -546,14 +741,14 @@
-       {
-               bkref = &get_nod(fs, nod)->i_block[bw->bpdir = 0];
-               if(extend) // allocate first block
--                      *bkref = hole ? 0 : alloc_blk(fs);
-+                      *bkref = hole ? 0 : alloc_blk(fs,nod);
-       }
-       // direct block
-       else if(bw->bpdir < EXT2_NDIR_BLOCKS)
-       {
-               bkref = &get_nod(fs, nod)->i_block[++bw->bpdir];
-               if(extend) // allocate block
--                      *bkref = hole ? 0 : alloc_blk(fs);
-+                      *bkref = hole ? 0 : alloc_blk(fs,nod);
-       }
-       // first block in indirect block
-       else if(bw->bpdir == EXT2_NDIR_BLOCKS)
-@@ -562,11 +757,11 @@
-               bw->bpdir = EXT2_IND_BLOCK;
-               bw->bpind = 0;
-               if(extend) // allocate indirect block
--                      get_nod(fs, nod)->i_block[bw->bpdir] = alloc_blk(fs);
-+                      get_nod(fs, nod)->i_block[bw->bpdir] = alloc_blk(fs,nod);
-               b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]);
-               bkref = &b[bw->bpind];
-               if(extend) // allocate first block
--                      *bkref = hole ? 0 : alloc_blk(fs);
-+                      *bkref = hole ? 0 : alloc_blk(fs,nod);
-       }
-       // block in indirect block
-       else if((bw->bpdir == EXT2_IND_BLOCK) && (bw->bpind < BLOCKSIZE/4 - 1))
-@@ -575,7 +770,7 @@
-               b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]);
-               bkref = &b[bw->bpind];
-               if(extend) // allocate block
--                      *bkref = hole ? 0 : alloc_blk(fs);
-+                      *bkref = hole ? 0 : alloc_blk(fs,nod);
-       }
-       // first block in first indirect block in first double indirect block
-       else if(bw->bpdir == EXT2_IND_BLOCK)
-@@ -585,14 +780,14 @@
-               bw->bpind = 0;
-               bw->bpdind = 0;
-               if(extend) // allocate double indirect block
--                      get_nod(fs, nod)->i_block[bw->bpdir] = alloc_blk(fs);
-+                      get_nod(fs, nod)->i_block[bw->bpdir] = alloc_blk(fs,nod);
-               b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]);
-               if(extend) // allocate first indirect block
--                      b[bw->bpind] = alloc_blk(fs);
-+                      b[bw->bpind] = alloc_blk(fs,nod);
-               b = (uint32*)get_blk(fs, b[bw->bpind]);
-               bkref = &b[bw->bpdind];
-               if(extend) // allocate first block
--                      *bkref = hole ? 0 : alloc_blk(fs);
-+                      *bkref = hole ? 0 : alloc_blk(fs,nod);
-       }
-       // block in indirect block in double indirect block
-       else if((bw->bpdir == EXT2_DIND_BLOCK) && (bw->bpdind < BLOCKSIZE/4 - 1))
-@@ -602,7 +797,7 @@
-               b = (uint32*)get_blk(fs, b[bw->bpind]);
-               bkref = &b[bw->bpdind];
-               if(extend) // allocate block
--                      *bkref = hole ? 0 : alloc_blk(fs);
-+                      *bkref = hole ? 0 : alloc_blk(fs,nod);
-       }
-       // first block in indirect block in double indirect block
-       else if((bw->bpdir == EXT2_DIND_BLOCK) && (bw->bpind < BLOCKSIZE/4 - 1))
-@@ -612,20 +807,100 @@
-               bw->bpind++;
-               b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]);
-               if(extend) // allocate indirect block
--                      b[bw->bpind] = alloc_blk(fs);
-+                      b[bw->bpind] = alloc_blk(fs,nod);
-               b = (uint32*)get_blk(fs, b[bw->bpind]);
-               bkref = &b[bw->bpdind];
-               if(extend) // allocate first block
--                      *bkref = hole ? 0 : alloc_blk(fs);
-+                      *bkref = hole ? 0 : alloc_blk(fs,nod);
-+      }
-+
-+      /* Adding support for triple indirection */
-+      /* Just starting triple indirection. Allocate the indirection
-+         blocks and the first data block
-+       */
-+      else if (bw->bpdir == EXT2_DIND_BLOCK) 
-+      {
-+              bw->bnum += 3;
-+              bw->bpdir = EXT2_TIND_BLOCK;
-+              bw->bpind = 0;
-+              bw->bpdind = 0;
-+              bw->bptind = 0;
-+              if(extend) // allocate triple indirect block
-+                      get_nod(fs, nod)->i_block[bw->bpdir] = alloc_blk(fs,nod);
-+              b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]);
-+              if(extend) // allocate first double indirect block
-+                      b[bw->bpind] = alloc_blk(fs,nod);
-+              b = (uint32*)get_blk(fs, b[bw->bpind]);
-+              if(extend) // allocate first indirect block
-+                      b[bw->bpdind] = alloc_blk(fs,nod);
-+              b = (uint32*)get_blk(fs, b[bw->bpdind]);
-+              bkref = &b[bw->bptind];
-+              if(extend) // allocate first data block
-+                      *bkref = hole ? 0 : alloc_blk(fs,nod);
-+      }
-+      /* Still processing a single indirect block down the indirection
-+         chain.Allocate a data block for it
-+       */
-+      else if ( (bw->bpdir == EXT2_TIND_BLOCK) && 
-+                (bw->bptind < BLOCKSIZE/4 -1) )
-+      {
-+              bw->bptind++;
-+              b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]);
-+              b = (uint32*)get_blk(fs, b[bw->bpind]);
-+              b = (uint32*)get_blk(fs, b[bw->bpdind]);
-+              bkref = &b[bw->bptind];
-+              if(extend) // allocate data block
-+                      *bkref = hole ? 0 : alloc_blk(fs,nod);
-+      }
-+      /* Finished processing a single indirect block. But still in the 
-+         same double indirect block. Allocate new single indirect block
-+         for it and a data block
-+       */
-+      else if ( (bw->bpdir == EXT2_TIND_BLOCK) &&
-+                (bw->bpdind < BLOCKSIZE/4 -1) )
-+      {
-+              bw->bnum++;
-+              bw->bptind = 0;
-+              bw->bpdind++;
-+              b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]);
-+              b = (uint32*)get_blk(fs, b[bw->bpind]);
-+              if (extend) // allocate single indirect block
-+                      b[bw->bpdind] = alloc_blk(fs,nod);
-+              b = (uint32*)get_blk(fs, b[bw->bpdind]);
-+              bkref = &b[bw->bptind];
-+              if(extend) // allocate first data block
-+                      *bkref = hole ? 0 : alloc_blk(fs,nod);
-+      }
-+      /* Finished processing a double indirect block. Allocate the next
-+         double indirect block and the single,data blocks for it
-+       */
-+      else if ( (bw->bpdir == EXT2_TIND_BLOCK) && 
-+                (bw->bpind < BLOCKSIZE/4 - 1) )
-+      {
-+              bw->bnum += 2;
-+              bw->bpdind = 0;
-+              bw->bptind = 0;
-+              bw->bpind++;
-+              b = (uint32*)get_blk(fs, get_nod(fs, nod)->i_block[bw->bpdir]);
-+              if(extend) // allocate double indirect block
-+                      b[bw->bpind] = alloc_blk(fs,nod);
-+              b = (uint32*)get_blk(fs, b[bw->bpind]);
-+              if(extend) // allocate single indirect block
-+                      b[bw->bpdind] = alloc_blk(fs,nod);
-+              b = (uint32*)get_blk(fs, b[bw->bpdind]);
-+              bkref = &b[bw->bptind];
-+              if(extend) // allocate first block
-+                      *bkref = hole ? 0 : alloc_blk(fs,nod);
-       }
--      // I don't do triple indirect - it's such a small filesystem ...
-       else
--              errexit("file too big ! blocks list for inode %d extends past double indirect blocks!", nod);
-+              error_msg_and_die("file too big !"); 
-+      /* End change for walking triple indirection */
-+
-       if(*bkref)
-       {
-               bw->bnum++;
--              if(!allocated(fs->bbm, *bkref))
--                      errexit("[block %d of inode %d is unallocated !]", *bkref, nod);
-+              if(!allocated(GRP_GET_BLOCK_BITMAP(fs,*bkref), GRP_BBM_OFFSET(fs,*bkref)))
-+                      error_msg_and_die("[block %d of inode %d is unallocated !]", *bkref, nod);
-       }
-       if(extend)
-               get_nod(fs, nod)->i_blocks = bw->bnum * INOBLK;
-@@ -663,23 +938,40 @@
- }
- // link an entry (inode #) to a directory
--void add2dir(filesystem *fs, uint32 dnod, uint32 nod, const char* name)
-+void add2dir(filesystem *fs, uint32 dnod, uint32 nod, const char* name, uint32 mode, uid_t uid, gid_t gid, time_t ctime)
- {
-       blockwalker bw;
-       uint32 bk;
-       uint8 *b;
-       directory *d;
-       int reclen, nlen;
--      if((get_nod(fs, dnod)->i_mode & FM_IFMT) != FM_IFDIR)
--              errexit("can't add '%s' to a non-directory", name);
-+      inode *node;
-+      inode *pnode;
-+      
-+      /* Squash all permissions so files are owned by root 
-+       * and file permissions have group/other perms removed */
-+      if (squash_uids) {
-+              uid = gid = 0;
-+      }
-+      if (squash_perms) {
-+              if (!S_ISLNK(mode)) {
-+                      mode &= ~(S_IWGRP | S_IWOTH);
-+                      mode &= ~(S_ISUID | S_ISGID);
-+              }
-+      }
-+
-+      pnode = get_nod(fs, dnod);
-+
-+      if(!S_ISDIR(pnode->i_mode))
-+              error_msg_and_die("can't add '%s' to a non-directory", name);
-       if(!*name)
--              errexit("bad name '%s' (not meaningful)", name);
-+              error_msg_and_die("bad name '%s' (not meaningful)", name);
-       if(strchr(name, '/'))
--              errexit("bad name '%s' (contains a slash)", name);
-+              error_msg_and_die("bad name '%s' (contains a slash)", name);
-       nlen = strlen(name);
-       reclen = sizeof(directory) + rndup(nlen, 4);
-       if(reclen > BLOCKSIZE)
--              errexit("bad name '%s' (too long)", name);
-+              error_msg_and_die("bad name '%s' (too long)", name);
-       init_bw(fs, dnod, &bw);
-       while((bk = walk_bw(fs, dnod, &bw, 0, 0)) != WALK_END) // for all blocks in dir
-       {
-@@ -691,9 +983,16 @@
-                       if((!d->d_inode) && (d->d_rec_len >= reclen))
-                       {
-                               d->d_inode = nod;
--                              get_nod(fs, nod)->i_links_count++;
-+                              node = get_nod(fs, nod);
-+                              node->i_links_count++;
-                               d->d_name_len = nlen;
--                              strncpy(d->d_name, name, nlen);
-+                              strncpy(d->d_name, name, rndup(nlen,4));
-+                              node->i_mode = mode;
-+                              node->i_uid = uid;
-+                              node->i_gid = gid;
-+                              node->i_atime = ctime;
-+                              node->i_ctime = ctime;
-+                              node->i_mtime = ctime;
-                               return;
-                       }
-                       // if entry with enough room (last one?), shrink it & use it
-@@ -705,9 +1004,16 @@
-                               d = (directory*) (((int8*)d) + d->d_rec_len);
-                               d->d_rec_len = reclen;
-                               d->d_inode = nod;
--                              get_nod(fs, nod)->i_links_count++;
-+                              node = get_nod(fs, nod);
-+                              node->i_links_count++;
-                               d->d_name_len = nlen;
--                              strncpy(d->d_name, name, nlen);
-+                              strncpy(d->d_name, name, rndup(nlen,4));
-+                              node->i_mode = mode;
-+                              node->i_uid = uid;
-+                              node->i_gid = gid;
-+                              node->i_atime = ctime;
-+                              node->i_ctime = ctime;
-+                              node->i_mtime = ctime;
-                               return;
-                       }
-               }
-@@ -716,10 +1022,17 @@
-       b = get_workblk();
-       d = (directory*)b;
-       d->d_inode = nod;
--      get_nod(fs, nod)->i_links_count++;
-+      node = get_nod(fs, nod);
-+      node->i_links_count++;
-       d->d_rec_len = BLOCKSIZE;
-       d->d_name_len = nlen;
--      strncpy(d->d_name, name, nlen);
-+      strncpy(d->d_name, name, rndup(nlen,4));
-+      node->i_mode = mode;
-+      node->i_uid = uid;
-+      node->i_gid = gid;
-+      node->i_atime = ctime;
-+      node->i_ctime = ctime;
-+      node->i_mtime = ctime;
-       extend_blk(fs, dnod, b, 1);
-       get_nod(fs, dnod)->i_size += BLOCKSIZE;
-       free_workblk(b);
-@@ -747,7 +1060,7 @@
- // find the inode of a full path
- uint32 find_path(filesystem *fs, uint32 nod, const char * name)
- {
--      char *p, *n, *n2 = strdup(name);
-+      char *p, *n, *n2 = xstrdup(name);
-       n = n2;
-       while(*n == '/')
-       {
-@@ -770,27 +1083,32 @@
- }
- // make a full-fledged directory (i.e. with "." & "..")
--uint32 mkdir_fs(filesystem *fs, uint32 parent_nod, const char *name, uint32 mode)
-+uint32 mkdir_fs(filesystem *fs, uint32 parent_nod, const char *name, uint32 mode,
-+      uid_t uid, gid_t gid, time_t ctime)
- {
-       uint32 nod;
-       if((nod = find_dir(fs, parent_nod, name)))
-               return nod;
-               nod = alloc_nod(fs);
--      get_nod(fs, nod)->i_mode = FM_IFDIR | mode;
--      add2dir(fs, parent_nod, nod, name);
--      add2dir(fs, nod, nod, ".");
--      add2dir(fs, nod, parent_nod, "..");
--      fs->gd.bg_used_dirs_count++;
-+      if (!(mode & FM_IFDIR))
-+          mode |= FM_IFDIR;
-+      add2dir(fs, parent_nod, nod, name, mode, uid, gid, ctime);
-+      add2dir(fs, nod, nod, ".", mode, uid, gid, ctime);
-+      add2dir(fs, nod, parent_nod, "..", mode, uid, gid, ctime);
-+      fs->gd[GRP_GROUP_OF_INODE(fs,nod)].bg_used_dirs_count++;
-       return nod;
- }
- // make a symlink
--uint32 mklink_fs(filesystem *fs, uint32 parent_nod, const char *name, size_t size, uint8 * b)
-+uint32 mklink_fs(filesystem *fs, uint32 parent_nod, const char *name, size_t size,
-+      uint8 * b, uid_t uid, gid_t gid, time_t ctime)
- {
-+      uint32 mode;
-       uint32 nod = alloc_nod(fs);
-+      mode = FM_IFLNK | FM_IRWXU | FM_IRWXG | FM_IRWXO; 
-       get_nod(fs, nod)->i_mode = FM_IFLNK | FM_IRWXU | FM_IRWXG | FM_IRWXO;
-       get_nod(fs, nod)->i_size = size;
--      add2dir(fs, parent_nod, nod, name);
-+      add2dir(fs, parent_nod, nod, name, mode, uid, gid, ctime);
-       if(size <= 4 * (EXT2_TIND_BLOCK+1))
-       {
-               strncpy((char*)get_nod(fs, nod)->i_block, (char*)b, size);
-@@ -801,15 +1119,15 @@
- }
- // make a file from a FILE*
--uint32 mkfile_fs(filesystem *fs, uint32 parent_nod, const char *name, uint32 mode, size_t size, FILE *f)
-+uint32 mkfile_fs(filesystem *fs, uint32 parent_nod, const char *name, uint32 mode, size_t size, FILE *f, uid_t uid, gid_t gid, time_t ctime)
- {
-       uint8 * b;
-       uint32 nod = alloc_nod(fs);
--      get_nod(fs, nod)->i_mode = FM_IFREG | mode;
-+      mode |= FM_IFREG;
-       get_nod(fs, nod)->i_size = size;
--      add2dir(fs, parent_nod, nod, name);
-+      add2dir(fs, parent_nod, nod, name, mode, uid, gid, ctime);
-       if(!(b = (uint8*)malloc(rndup(size, BLOCKSIZE))))
--              errexit("not enough mem to read file '%s'", name);
-+              error_msg_and_die("not enough mem to read file '%s'", name);
-       memset(b, 0,rndup(size, BLOCKSIZE));
-       if(f)
-               fread(b, size, 1, f);
-@@ -824,6 +1142,15 @@
- uint32 get_mode(struct stat *st)
- {
-       uint32 mode = 0;
-+
-+      /* Squash file permissions as needed */
-+      if (squash_perms) {
-+              if (!S_ISLNK(mode)) {
-+                      st->st_mode &= ~(S_IWGRP | S_IWOTH);
-+                      st->st_mode &= ~(S_ISUID | S_ISGID);
-+              }
-+      }
-+
-       if(st->st_mode & S_IRUSR)
-               mode |= FM_IRUSR | FM_IRGRP | FM_IROTH;
-       if(st->st_mode & S_IWUSR)
-@@ -833,30 +1160,17 @@
-       return mode;
- }
--// retrieves a mode info from a string
--uint32 get_modestr(const char *p)
--{
--      uint32 mode = 0;
--      if(p[0] == 'r')
--              mode |= FM_IRUSR | FM_IRGRP | FM_IROTH;
--      if(p[1] == 'w')
--              mode |= FM_IWUSR | FM_IWGRP | FM_IWOTH;
--      if(p[2] == 'x' || p[2] == 's')
--              mode |= FM_IXUSR | FM_IXGRP | FM_IXOTH;
--      return mode;
--}
--
- // basename of a path - free me
- char * basename(const char * fullpath)
- {
-       char * p = strrchr(fullpath, '/');
--      return strdup(p ? p + 1 : fullpath);
-+      return xstrdup(p ? p + 1 : fullpath);
- }
- // dirname of a path - free me
- char * dirname(const char * fullpath)
- {
--      char * p, * n = strdup(fullpath);
-+      char * p, * n = xstrdup(fullpath);
-       if((p = strrchr(n, '/')))
-               *(p+1) = 0;
-       else
-@@ -864,66 +1178,6 @@
-       return n;
- }
--// adds entries to the filesystem from a text file
--void add2fs_from_file(filesystem *fs, uint32 this_nod, FILE * fh)
--{
--      uint32 mode;
--      uint32 nod, nod2;
--      char cmod[11], *path, *name, *dir;
--      int major, minor;
--      while(fscanf(fh, "%10s", cmod))
--      {
--              if(feof(fh))
--                      break;
--              mode = get_modestr(cmod + 1);
--              switch(*cmod)
--              {
--                      case 'd':
--                              fscanf(fh, "%" SCANF_PREFIX "s\n", SCANF_STRING(path));
--                              break;
--                      case 'c':
--                              mode |= FM_IFCHR;
--                              fscanf(fh, "%i, %i %" SCANF_PREFIX "s\n", &major, &minor, SCANF_STRING(path));
--                              break;
--                      case 'b':
--                              mode |= FM_IFBLK;
--                              fscanf(fh, "%i, %i %" SCANF_PREFIX "s\n", &major, &minor, SCANF_STRING(path));
--                              break;
--                      case '#':
--                              while(fgetc(fh) != '\n');
--                              continue;
--                      default:
--                              errexit("malformed text input file");
--              }
--              name = basename(path);
--              dir = dirname(path);
--              free(path);
--              if(!(nod = find_path(fs, this_nod, dir)))
--                      errexit("can't find directory '%s' to create '%s''", dir, name);
--              free(dir);
--              if((!strcmp(name, ".")) || (!strcmp(name, "..")))
--              {
--                      free(name);
--                      continue;
--              }
--              switch(*cmod)
--              {
--                      case 'd':
--                              mkdir_fs(fs, nod, name, mode);
--                              break;
--                      case 'c':
--                      case 'b':
--                              nod2 = alloc_nod(fs);
--                              get_nod(fs, nod2)->i_mode = mode;
--                              ((uint8*)get_nod(fs, nod2)->i_block)[0] = minor;
--                              ((uint8*)get_nod(fs, nod2)->i_block)[1] = major;
--                              add2dir(fs, nod, nod2, name);
--                              break;
--              }
--              free(name);
--      }
--}
--
- // adds a tree of entries to the filesystem from current dir
- void add2fs_from_dir(filesystem *fs, uint32 this_nod)
- {
-@@ -934,7 +1188,7 @@
-       struct stat st;
-       uint8 *b;
-       if(!(dh = opendir(".")))
--              pexit(".");
-+              perror_msg_and_die(".");
-       while((dent = readdir(dh)))
-       {
-               if((!strcmp(dent->d_name, ".")) || (!strcmp(dent->d_name, "..")))
-@@ -948,31 +1202,27 @@
-                               get_nod(fs, nod)->i_mode = (((st.st_mode & S_IFMT) == S_IFCHR) ? FM_IFCHR : FM_IFBLK) | get_mode(&st);
-                               ((uint8*)get_nod(fs, nod)->i_block)[0] = (st.st_rdev & 0xff);
-                               ((uint8*)get_nod(fs, nod)->i_block)[1] = (st.st_rdev >> 8);
--                              add2dir(fs, this_nod, nod, dent->d_name);
-+                              add2dir(fs, this_nod, nod, dent->d_name, st.st_mode, st.st_uid, st.st_gid, st.st_ctime);
-                               break;
-                       case S_IFLNK:
--                              if(!(b = (uint8*)malloc(rndup(st.st_size, BLOCKSIZE))))
--                                      errexit("out of memory");
--                              if(readlink(dent->d_name, (char*)b, st.st_size) < 0)
--                                      pexit(dent->d_name);
--                              mklink_fs(fs, this_nod, dent->d_name, st.st_size, b);
-+                              b = xreadlink(dent->d_name);
-+                              mklink_fs(fs, this_nod, dent->d_name, st.st_size, b, st.st_uid, st.st_gid, st.st_ctime);
-                               free(b);
-                               break;
-                       case S_IFREG:
--                              if(!(fh = fopen(dent->d_name, "r")))
--                                      pexit(dent->d_name);
--                              mkfile_fs(fs, this_nod, dent->d_name, get_mode(&st), st.st_size, fh);
-+                              fh = xfopen(dent->d_name, "r");
-+                              mkfile_fs(fs, this_nod, dent->d_name, st.st_mode, st.st_size, fh, st.st_uid, st.st_gid, st.st_ctime);
-                               fclose(fh);
-                               break;
-                       case S_IFDIR:
--                              nod = mkdir_fs(fs, this_nod, dent->d_name, get_mode(&st));
-+                              nod = mkdir_fs(fs, this_nod, dent->d_name, st.st_mode, st.st_uid, st.st_gid, st.st_ctime);
-                               if(chdir(dent->d_name) < 0)
--                                      pexit(dent->d_name);
-+                                      perror_msg_and_die(dent->d_name);
-                               add2fs_from_dir(fs, nod);
-                               chdir("..");
-                               break;
-                       default:
--                              fprintf(stderr, "ignoring entry %s", dent->d_name);
-+                              error_msg("ignoring entry %s", dent->d_name);
-               }
-       }
-       closedir(dh);
-@@ -981,9 +1231,11 @@
- // endianness swap of x-indirect blocks
- void swap_goodblocks(filesystem *fs, inode *nod)
- {
--      int i;
-+      int i,j,done=0;
-+      uint32 *b,*b2;
-+
-       int nblk = nod->i_blocks / INOBLK;
--      if((nod->i_size && !nblk) || (nod->i_mode & (FM_IFBLK | FM_IFCHR)))
-+      if((nod->i_size && !nblk) || ((nod->i_mode & FM_IFBLK) == FM_IFBLK) || ((nod->i_mode & FM_IFCHR) == FM_IFCHR))
-               for(i = 0; i <= EXT2_TIND_BLOCK; i++)
-                       nod->i_block[i] = swab32(nod->i_block[i]);
-       if(nblk <= EXT2_IND_BLOCK)
-@@ -991,20 +1243,55 @@
-       swap_block(get_blk(fs, nod->i_block[EXT2_IND_BLOCK]));
-       if(nblk <= EXT2_IND_BLOCK + BLOCKSIZE/4)
-               return;
-+      /* Currently this will fail b'cos the number of blocks as stored
-+         in i_blocks also includes the indirection blocks (see
-+         walk_bw). But this function assumes that i_blocks only
-+         stores the count of data blocks ( Actually according to
-+         "Understanding the Linux Kernel" (Table 17-3 p502 1st Ed)
-+         i_blocks IS supposed to store the count of data blocks). so
-+         with a file of size 268K nblk would be 269.The above check
-+         will be false even though double indirection hasn't been
-+         started.This is benign as 0 means block 0 which has been
-+         zeroed out and therefore points back to itself from any offset
-+       */
-+      assert(nod->i_block[EXT2_DIND_BLOCK] != 0);
-       for(i = 0; i < BLOCKSIZE/4; i++)
-+              /* Should this be...
-+              if(nblk > EXT2_IND_BLOCK + BLOCKSIZE/4 + (BLOCKSIZE/4)*i )
-+              */
-               if(nblk > EXT2_IND_BLOCK + BLOCKSIZE/4 + i)
-                       swap_block(get_blk(fs, ((uint32*)get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]))[i]));
-       swap_block(get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]));
-       if(nblk <= EXT2_IND_BLOCK + BLOCKSIZE/4 + BLOCKSIZE/4 * BLOCKSIZE/4)
-               return;
--      errexit("too big file on the filesystem");
-+      /* Adding support for triple indirection */
-+      b = (uint32*)get_blk(fs,nod->i_block[EXT2_TIND_BLOCK]);
-+      for(i=0;i < BLOCKSIZE/4 && !done ; i++) {
-+              b2 = (uint32*)get_blk(fs,b[i]); 
-+              for(j=0; j<BLOCKSIZE/4;j++) {
-+                      if (nblk > ( EXT2_IND_BLOCK + BLOCKSIZE/4 + 
-+                                   (BLOCKSIZE/4)*(BLOCKSIZE/4) + 
-+                                   i*(BLOCKSIZE/4)*(BLOCKSIZE/4) + 
-+                                   j*(BLOCKSIZE/4)) ) 
-+                        swap_block(get_blk(fs,b2[j]));
-+                      else {
-+                        done = 1;
-+                        break;
-+                      }
-+              }
-+              swap_block((uint8 *)b2);
-+      }
-+      swap_block((uint8 *)b);
-+      return;
- }
- void swap_badblocks(filesystem *fs, inode *nod)
- {
--      int i;
-+      int i,j,done=0;
-+      uint32 *b,*b2;
-+
-       int nblk = nod->i_blocks / INOBLK;
--      if((nod->i_size && !nblk) || (nod->i_mode & (FM_IFBLK | FM_IFCHR)))
-+      if((nod->i_size && !nblk) || ((nod->i_mode & FM_IFBLK) == FM_IFBLK) || ((nod->i_mode & FM_IFCHR) == FM_IFCHR))
-               for(i = 0; i <= EXT2_TIND_BLOCK; i++)
-                       nod->i_block[i] = swab32(nod->i_block[i]);
-       if(nblk <= EXT2_IND_BLOCK)
-@@ -1012,13 +1299,34 @@
-       swap_block(get_blk(fs, nod->i_block[EXT2_IND_BLOCK]));
-       if(nblk <= EXT2_IND_BLOCK + BLOCKSIZE/4)
-               return;
-+      /* See comment in swap_goodblocks */
-+      assert(nod->i_block[EXT2_DIND_BLOCK] != 0);
-       swap_block(get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]));
-       for(i = 0; i < BLOCKSIZE/4; i++)
-+              /* See comment in swap_goodblocks */
-               if(nblk > EXT2_IND_BLOCK + BLOCKSIZE/4 + i)
-                       swap_block(get_blk(fs, ((uint32*)get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]))[i]));
-       if(nblk <= EXT2_IND_BLOCK + BLOCKSIZE/4 + BLOCKSIZE/4 * BLOCKSIZE/4)
-               return;
--      errexit("too big file on the filesystem");
-+      /* Adding support for triple indirection */
-+      b = (uint32*)get_blk(fs,nod->i_block[EXT2_TIND_BLOCK]);
-+      swap_block((uint8 *)b);
-+      for(i=0;i < BLOCKSIZE/4 && !done ; i++) {
-+              b2 = (uint32*)get_blk(fs,b[i]); 
-+              swap_block((uint8 *)b2);
-+              for(j=0; j<BLOCKSIZE/4;j++) {
-+                      if (nblk > ( EXT2_IND_BLOCK + BLOCKSIZE/4 + 
-+                                   (BLOCKSIZE/4)*(BLOCKSIZE/4) + 
-+                                   i*(BLOCKSIZE/4)*(BLOCKSIZE/4) + 
-+                                   j*(BLOCKSIZE/4)) ) 
-+                        swap_block(get_blk(fs,b2[j]));
-+                      else {
-+                        done = 1;
-+                        break;
-+                      }
-+              }
-+      }
-+      return;
- }
- // endianness swap of the whole filesystem
-@@ -1045,7 +1353,8 @@
-               swap_goodblocks(fs, nod);
-               swap_nod(nod);
-       }
--      swap_gd(&fs->gd);
-+      for(i=0;i<GRP_NBGROUPS(fs);i++)
-+              swap_gd(&(fs->gd[i]));
-       swap_sb(&fs->sb);
- }
-@@ -1053,7 +1362,8 @@
- {
-       int i;
-       swap_sb(&fs->sb);
--      swap_gd(&fs->gd);
-+      for(i=0;i<GRP_NBGROUPS(fs);i++)
-+              swap_gd(&(fs->gd[i]));
-       for(i = 1; i < fs->sb.s_inodes_count; i++)
-       {
-               inode *nod = get_nod(fs, i);
-@@ -1084,53 +1394,118 @@
-       directory *d;
-       uint8 * b;
-       uint32 nod;
-+      uint32 nbgroups,nbinodes_per_group,overhead_per_group,free_blocks,
-+              free_blocks_per_group,nbblocks_per_group;
-+      uint32 gd,itbl,ibmpos,bbmpos,itblpos;
-+      int j;
-+      uint8 *bbm,*ibm;
-+      inode *itab0;
-       
-       if(nbblocks < 16) // totally arbitrary
--              errexit("too small filesystem");
--      if(nbblocks >BLOCKS_PER_GROUP) // I build only one group
--              errexit("too big filesystem");
-+              error_msg_and_die("too small filesystem");
-+
-+      /* nbblocks is the total number of blocks in the system. First 
-+       * calculate how much overhead blocks - inode table blocks,bitmap 
-+       * blocks,group descriptor blocks etc. - are needed assuming each 
-+       * group has BLOCKS_PER_GROUP blocks.Then recalculate nbblocks with 
-+       * this figure. Each group has the same number of blocks. So the fs 
-+       * has a size atleast the given value but usually rounded off to a i
-+       * higher number.
-+       */
-+      nbgroups = rndup(nbblocks,BLOCKS_PER_GROUP)/ BLOCKS_PER_GROUP;
-+      nbinodes_per_group = nbinodes/nbgroups +1;
-+      nbinodes_per_group = rndup(nbinodes_per_group, BLOCKSIZE/sizeof(inode));
-+      if (nbinodes_per_group < 16)
-+              nbinodes_per_group = 16; //minimum number b'cos the first 10 are reserved
-+      overhead_per_group = 3 /*super block,ibm,bbm*/
-+                           + /* No. of blocks that the inodes occupy */
-+                             nbinodes_per_group *sizeof(inode)/BLOCKSIZE 
-+                           + /* No. of blocks that group descriptors occupy */
-+                             rndup(nbgroups*sizeof(groupdescriptor),BLOCKSIZE)/BLOCKSIZE;
-+      free_blocks = nbblocks - overhead_per_group * nbgroups - 1 /*boot block */;
-+      free_blocks_per_group = free_blocks/nbgroups;
-+      if (free_blocks > free_blocks_per_group * nbgroups)
-+              free_blocks_per_group++;
-+      nbblocks_per_group = free_blocks_per_group + overhead_per_group;
-+      /* e2fsck complains if nbblocks_per_group is not a multiple of 8 */
-+      nbblocks_per_group = rndup(nbblocks_per_group,8);
-+      free_blocks_per_group = nbblocks_per_group - overhead_per_group;
-+      if (nbblocks_per_group > BLOCKS_PER_GROUP) {
-+              /* Can this happen ? */
-+              nbblocks_per_group = BLOCKS_PER_GROUP;
-+              free_blocks_per_group = nbblocks_per_group - overhead_per_group;
-+      }
-+      nbblocks = nbblocks_per_group * nbgroups + 1;
-+      
-+
-       if(!(fs = (filesystem*)calloc(nbblocks, BLOCKSIZE)))
--              errexit("not enough memory for filesystem");
-+              error_msg_and_die("not enough memory for filesystem");
-       // create the superblock for an empty filesystem
--      fs->sb.s_inodes_count = rndup(nbinodes, BLOCKSIZE/sizeof(inode));
-+      fs->sb.s_inodes_count = nbinodes_per_group * nbgroups;
-       fs->sb.s_blocks_count = nbblocks;
-       fs->sb.s_r_blocks_count = nbresrvd;
--      fs->sb.s_free_blocks_count = nbblocks;
-+      fs->sb.s_free_blocks_count = free_blocks_per_group*nbgroups;
-       fs->sb.s_free_inodes_count = fs->sb.s_inodes_count - EXT2_FIRST_INO + 1;
-       fs->sb.s_first_data_block = (BLOCKSIZE == 1024);
-       fs->sb.s_log_block_size = BLOCKSIZE >> 11;
-       fs->sb.s_log_frag_size = BLOCKSIZE >> 11;
--      fs->sb.s_blocks_per_group = BLOCKS_PER_GROUP;
--      fs->sb.s_frags_per_group = BLOCKS_PER_GROUP;
--      fs->sb.s_inodes_per_group = fs->sb.s_inodes_count;
-+      fs->sb.s_blocks_per_group = nbblocks_per_group;
-+      fs->sb.s_frags_per_group = nbblocks_per_group;
-+      fs->sb.s_inodes_per_group = nbinodes_per_group;
-       fs->sb.s_magic = EXT2_MAGIC_NUMBER;
-       // set up groupdescriptors
--      fs->sb.s_free_blocks_count -= 5 + fs->sb.s_inodes_count * sizeof(inode) / BLOCKSIZE;
--      fs->gd.bg_free_blocks_count = fs->sb.s_free_blocks_count;
--      fs->gd.bg_free_inodes_count = fs->sb.s_free_inodes_count;
--      fs->gd.bg_used_dirs_count = 1;
--      fs->gd.bg_block_bitmap = 3;
--      fs->gd.bg_inode_bitmap = 4;
--      fs->gd.bg_inode_table = 5;
--
--      // mark non-filesystem blocks and inodes as allocated
--      for(i = fs->sb.s_blocks_count; i <= BLOCKSIZE * 8; i++)
--              allocate(fs->bbm, i);
--      for(i = fs->sb.s_inodes_count + 1; i <= BLOCKSIZE * 8; i++)
--              allocate(fs->ibm, i);
--
--      // mark system blocsk and inodes as allocated
--      for(i = 1; i <= 4 + fs->sb.s_inodes_count * sizeof(inode) / BLOCKSIZE; i++)
--              allocate(fs->bbm, i);
--      for(i = 1; i < EXT2_FIRST_INO; i++)
--              allocate(fs->ibm, i);
--
--      // make root inode and directory
--      fs->itab[EXT2_ROOT_INO-1].i_mode = FM_IFDIR | FM_IRWXU | FM_IRWXG | FM_IRWXO;
--      fs->itab[EXT2_ROOT_INO-1].i_size = BLOCKSIZE;
--      fs->itab[EXT2_ROOT_INO-1].i_links_count = 2;
-+      gd = rndup(nbgroups*sizeof(groupdescriptor),BLOCKSIZE)/BLOCKSIZE;
-+      itbl = nbinodes_per_group*sizeof(inode)/BLOCKSIZE;
-+      for(i = 0,bbmpos=2+gd,ibmpos=3+gd,itblpos =4+gd;
-+              i<nbgroups;
-+              i++, bbmpos += nbblocks_per_group,ibmpos += nbblocks_per_group, 
-+              itblpos += nbblocks_per_group)  {
-+              
-+              fs->gd[i].bg_free_blocks_count = free_blocks_per_group;
-+              fs->gd[i].bg_free_inodes_count = nbinodes_per_group;
-+              fs->gd[i].bg_used_dirs_count = 0;
-+              fs->gd[i].bg_block_bitmap = bbmpos;
-+              fs->gd[i].bg_inode_bitmap = ibmpos;
-+              fs->gd[i].bg_inode_table = itblpos;
-+      }
-+
-+      /* Mark non-filesystem blocks and inodes as allocated */
-+      /* Mark system blocks and inodes as allocated         */
-+      for(i = 0; i<nbgroups;i++) {
-+
-+              /* Block bitmap */
-+              bbm = get_blk(fs,fs->gd[i].bg_block_bitmap);    
-+              //non-filesystem blocks.
-+              for(j=fs->sb.s_blocks_per_group + 1; j <= BLOCKSIZE * 8; j++)
-+                      allocate(bbm, j); 
-+              //system blocks
-+              for(j = 1; j <= 3+gd+itbl; j++)
-+                      allocate(bbm, j); 
-+              
-+              /* Inode bitmap */
-+              ibm = get_blk(fs,fs->gd[i].bg_inode_bitmap);    
-+              //non-filesystem inodes
-+              for(j = fs->sb.s_inodes_per_group+1; j <= BLOCKSIZE * 8; j++)
-+                      allocate(ibm, j);
-+      }
-+
-+      /* We have groups now. Add the root filesystem in group 0  */
-+      /* Also allocate the system inodes in group 0 and update   */
-+      /* directory count and inode count for group 0             */
-+
-+      ibm = get_blk(fs,fs->gd[0].bg_inode_bitmap);    
-+      for(j = 1; j < EXT2_FIRST_INO; j++) {
-+              allocate(ibm, j);
-+              fs->gd[0].bg_free_inodes_count--;
-+      }
-+      fs->gd[0].bg_used_dirs_count = 1;
-+      itab0 = (inode *)get_blk(fs,fs->gd[0].bg_inode_table);
-+      itab0[EXT2_ROOT_INO-1].i_mode = FM_IFDIR | FM_IRWXU | FM_IRWXG | FM_IRWXO; 
-+      itab0[EXT2_ROOT_INO-1].i_size = BLOCKSIZE;
-+      itab0[EXT2_ROOT_INO-1].i_links_count = 2;
-+
-       b = get_workblk();
-       d = (directory*)b;
-       d->d_inode = EXT2_ROOT_INO;
-@@ -1147,9 +1522,14 @@
-       // make lost+found directory and reserve blocks
-       if(fs->sb.s_r_blocks_count)
-       {
--              nod = mkdir_fs(fs, EXT2_ROOT_INO, "lost+found", FM_IRWXU | FM_IRWXG | FM_IRWXO);
-+              nod = mkdir_fs(fs, EXT2_ROOT_INO, "lost+found", S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH, 0, 0, time(NULL));
-               memset(b, 0, BLOCKSIZE);
-               ((directory*)b)->d_rec_len = BLOCKSIZE;
-+              /* We run into problems with e2fsck if directory lost+found grows
-+               * bigger than this. Need to find out why this happens - sundar
-+               */
-+              if (fs->sb.s_r_blocks_count > 2049 ) 
-+                      fs->sb.s_r_blocks_count=2049;
-               for(i = 1; i < fs->sb.s_r_blocks_count; i++)
-                       extend_blk(fs, nod, b, 1);
-               get_nod(fs, nod)->i_size = fs->sb.s_r_blocks_count * BLOCKSIZE;
-@@ -1170,24 +1550,24 @@
- // loads a filesystem from disk
- filesystem * load_fs(FILE * fh, int swapit)
- {
--      size_t fssize;
-+      size_t fssize = 0;
-       filesystem *fs;
-       if((fseek(fh, 0, SEEK_END) < 0) || ((fssize = ftell(fh)) < 0))
--              pexit("input filesystem image");
-+              perror_msg_and_die("input filesystem image");
-       rewind(fh);
-       fssize = (fssize + BLOCKSIZE - 1) / BLOCKSIZE;
-       if(fssize < 16) // totally arbitrary
--              errexit("too small filesystem");
--      if(fssize > BLOCKS_PER_GROUP) // I build only one group
--              errexit("too big filesystem");
-+              error_msg_and_die("too small filesystem");
-+/*    if(fssize > BLOCKS_PER_GROUP) // I build only one group
-+              error_msg_and_die("too big filesystem"); */
-       if(!(fs = (filesystem*)calloc(fssize, BLOCKSIZE)))
--              errexit("not enough memory for filesystem");
-+              error_msg_and_die("not enough memory for filesystem");
-       if(fread(fs, BLOCKSIZE, fssize, fh) != fssize)
--              pexit("input filesystem image");
-+              perror_msg_and_die("input filesystem image");
-       if(swapit)
-               swap_badfs(fs);
-       if(fs->sb.s_rev_level || (fs->sb.s_magic != EXT2_MAGIC_NUMBER))
--              errexit("not a suitable ext2 filesystem");
-+              error_msg_and_die("not a suitable ext2 filesystem");
-       return fs;
- }
-@@ -1230,9 +1610,9 @@
-       while((bk = walk_bw(fs, nod, &bw, 0, 0)) != WALK_END)
-       {
-               if(fsize <= 0)
--                      errexit("wrong size while saving inode %d", nod);
-+                      error_msg_and_die("wrong size while saving inode %d", nod);
-               if(fwrite(get_blk(fs, bk), (fsize > BLOCKSIZE) ? BLOCKSIZE : fsize, 1, f) != 1)
--                      errexit("error while saving inode %d", nod);
-+                      error_msg_and_die("error while saving inode %d", nod);
-               fsize -= BLOCKSIZE;
-       }
- }
-@@ -1250,7 +1630,7 @@
-       {
-               int i, j;
-               if(fsize <= 0)
--                      errexit("wrong size while saving inode %d", nod);
-+                      error_msg_and_die("wrong size while saving inode %d", nod);
-               b = get_blk(fs, bk);
-               for(i = 0; i < 64; i++)
-               {
-@@ -1406,7 +1786,7 @@
-                       s = (nod >= EXT2_FIRST_INO) ? "normal" : "unknown reserved"; 
-       }
-       printf("inode %d (%s, %d links): ", nod, s, get_nod(fs, nod)->i_links_count);
--      if(!allocated(fs->ibm, nod))
-+      if(!allocated(GRP_GET_INODE_BITMAP(fs,nod), GRP_IBM_OFFSET(fs,nod)))
-       {
-               printf("unallocated\n");
-               return;
-@@ -1440,24 +1820,46 @@
-               default:
-                       list_blocks(fs, nod);
-       }
-+      printf("Done with inode %d\n",nod);
- }
- // describes various fields in a filesystem
- void print_fs(filesystem *fs)
- {
--      int i;
--      printf("%d blocks (%d free, %d reserved), first data block: %d\n", fs->sb.s_blocks_count, fs->sb.s_free_blocks_count, fs->sb.s_r_blocks_count, fs->sb.s_first_data_block);
--      printf("%d inodes (%d free)\n", fs->sb.s_inodes_count, fs->sb.s_free_inodes_count);
--      printf("block size = %d, frag size = %d\n", fs->sb.s_log_block_size ? (fs->sb.s_log_block_size << 11) : 1024, fs->sb.s_log_frag_size ? (fs->sb.s_log_frag_size << 11) : 1024);
--      printf("%d blocks per group, %d frags per group, %d inodes per group\n", fs->sb.s_blocks_per_group, fs->sb.s_frags_per_group, fs->sb.s_inodes_per_group);
--      printf("block bitmap: block %d, inode bitmap: block %d, inode table: block %d\n", fs->gd.bg_block_bitmap, fs->gd.bg_inode_bitmap, fs->gd.bg_inode_table);
--      printf("block bitmap allocation:\n");
--      print_bm(fs->bbm, fs->sb.s_blocks_count);
--      printf("inode bitmap allocation:\n");
--      print_bm(fs->ibm, fs->sb.s_inodes_count);
--      for(i=1; i<=fs->sb.s_inodes_count; i++)
--              if(allocated(fs->ibm, i))
--                      print_inode(fs, i);
-+      int i,j;
-+      uint8 *ibm;
-+
-+      printf("%d blocks (%d free, %d reserved), first data block: %d\n",
-+             fs->sb.s_blocks_count, fs->sb.s_free_blocks_count,
-+             fs->sb.s_r_blocks_count, fs->sb.s_first_data_block);
-+      printf("%d inodes (%d free)\n", fs->sb.s_inodes_count,
-+             fs->sb.s_free_inodes_count);
-+      printf("block size = %d, frag size = %d\n",
-+             fs->sb.s_log_block_size ? (fs->sb.s_log_block_size << 11) : 1024,
-+             fs->sb.s_log_frag_size ? (fs->sb.s_log_frag_size << 11) : 1024);
-+      printf("Number of groups: %d\n",GRP_NBGROUPS(fs));
-+      printf("%d blocks per group,%d frags per group,%d inodes per group\n",
-+           fs->sb.s_blocks_per_group, fs->sb.s_frags_per_group,
-+           fs->sb.s_inodes_per_group);
-+      printf("Size of inode table: %d blocks\n",
-+                      fs->sb.s_inodes_per_group * sizeof(inode)/BLOCKSIZE);
-+      for (i = 0; i < GRP_NBGROUPS(fs); i++) {
-+              printf("Group No: %d\n", i);
-+              printf("block bitmap: block %d,inode bitmap: block %d, inode table: block %d\n",
-+                   fs->gd[i].bg_block_bitmap, fs->gd[i].bg_inode_bitmap,
-+                   fs->gd[i].bg_inode_table);
-+              printf("Free blocks count: %d\n",fs->gd[i].bg_free_blocks_count);
-+              printf("Free inodes count: %d\n",fs->gd[i].bg_free_inodes_count);
-+              printf("Used dir count: %d\n",fs->gd[i].bg_used_dirs_count);
-+              printf("block bitmap allocation:\n");
-+              print_bm(GRP_GET_GROUP_BBM(fs, i),fs->sb.s_blocks_per_group);
-+              printf("inode bitmap allocation:\n");
-+              ibm = GRP_GET_GROUP_IBM(fs, i);
-+              print_bm(ibm, fs->sb.s_inodes_per_group);
-+              for (j = 1; j <= fs->sb.s_inodes_per_group; j++)
-+                      if (allocated(ibm, j))
-+                              print_inode(fs, i*fs->sb.s_inodes_per_group + j);
-+      }
- }
- void dump_fs(filesystem *fs, FILE * fh, int swapit)
-@@ -1467,31 +1869,234 @@
-       if(swapit)
-               swap_goodfs(fs);
-       if(fwrite(fs, BLOCKSIZE, nbblocks, fh) < nbblocks)
--              pexit("output filesystem image");
-+              perror_msg_and_die("output filesystem image");
-       if(swapit)
-               swap_badfs(fs);
- }
-+/*  device table entries take the form of:
-+    <path>    <type> <mode>   <uid>   <gid>   <major> <minor> <start> <inc>   <count>
-+    /dev/mem     c    640       0       0         1       1       0     0         -
-+
-+    type can be one of: 
-+      f       A regular file
-+      d       Directory
-+      c       Character special device file
-+      b       Block special device file
-+      p       Fifo (named pipe)
-+
-+    I don't bother with symlinks (permissions are irrelevant), hard
-+    links (special cases of regular files), or sockets (why bother).
-+
-+    Regular files must exist in the target root directory.  If a char,
-+    block, fifo, or directory does not exist, it will be created.
-+*/
-+static int interpret_table_entry(filesystem *fs, char *line)
-+{
-+      char type, *name = NULL, *tmp, *dir, *bname;
-+      unsigned long mode = 0755, uid = 0, gid = 0, major = 0, minor = 0;
-+      unsigned long start = 0, increment = 1, count = 0;
-+      inode *entry;
-+      uint32 nod, parent;
-+
-+      if (sscanf (line, "%" SCANF_PREFIX "s %c %lo %lu %lu %lu %lu %lu %lu %lu",
-+                              SCANF_STRING(name), &type, &mode, &uid, &gid, &major, &minor,
-+                              &start, &increment, &count) < 0) 
-+      {
-+              return 1;
-+      }
-+
-+      if (!strcmp(name, "/")) {
-+              error_msg_and_die("Device table entries require absolute paths");
-+      }
-+
-+      /* Check if this file already exists... */
-+      switch (type) {
-+              case 'd':
-+                      mode |= S_IFDIR;
-+                      break;
-+              case 'f':
-+                      mode |= S_IFREG;
-+                      break;
-+              case 'p':
-+                      mode |= S_IFIFO;
-+                      break;
-+              case 'c':
-+                      mode |= S_IFCHR;
-+                      break;
-+              case 'b':
-+                      mode |= S_IFBLK;
-+                      break;
-+              default:
-+                      error_msg_and_die("Unsupported file type");
-+      }
-+      nod = 0;
-+      if (count==0)
-+              nod = find_path(fs, EXT2_ROOT_INO, name);
-+      if (nod) {
-+              /* Ok, we just need to fixup an existing entry 
-+               * and we will be all done... */
-+              entry = get_nod(fs, nod);
-+              entry->i_uid = uid;
-+              entry->i_gid = gid;
-+              entry->i_mode = mode;
-+              if (major) {
-+                      dev_t rdev = makedev(major, minor);
-+                      ((uint8*)entry->i_block)[0] = (rdev & 0xff);
-+                      ((uint8*)entry->i_block)[1] = (rdev >> 8);
-+              }
-+      } else {
-+              /* Try and find our parent now */
-+              tmp = xstrdup(name);
-+              dir = dirname(tmp);
-+              parent = find_path(fs, EXT2_ROOT_INO, dir);
-+              free(tmp);
-+              if (!parent) {
-+                      error_msg ("skipping device_table entry '%s': no parent directory!", name);
-+                      free(name);
-+                      return 1;
-+              }
-+
-+              tmp = xstrdup(name);
-+              bname = xstrdup(basename(tmp));
-+              free(tmp);
-+              switch (type) {
-+                      case 'd':
-+                              mkdir_fs(fs, parent, bname, mode|FM_IFDIR, uid, gid, time(NULL));
-+                              break;
-+                      case 'f':
-+#if 0
-+                              {
-+                                      // This is a bit odd.. This will try to include
-+                                      // the file of the same name from your _build_
-+                                      // system...  Probably a very bad idea....
-+                                      struct stat st;
-+                                      FILE *fh = xfopen(name, "r");
-+                                      lstat(name, &st);
-+                                      mkfile_fs(fs, parent, bname, mode|FM_IFREG, st.st_size, fh, uid, gid, st.st_ctime);
-+                                      fclose(fh);
-+                              }
-+#else
-+                              error_msg("ignoring entry %s", name);
-+#endif
-+                              break;
-+                      case 'p':
-+                              error_msg("ignoring entry %s", name);
-+                              break;
-+                      case 'c':
-+                      case 'b':
-+                              if (count > 0) {
-+                                      dev_t rdev;
-+                                      char *dname;
-+                                      unsigned long i;
-+                                      for (i = start; i < count; i++) {
-+                                              asprintf(&dname, "%s%lu", bname, i);
-+                                              nod = find_path(fs, EXT2_ROOT_INO, dname);
-+                                              if (nod) {
-+                                                      /* We just need to fixup an existing entry */ 
-+                                                      entry = get_nod(fs, nod);
-+                                              } else {
-+                                                      nod = alloc_nod(fs);
-+                                                      add2dir(fs, parent, nod, dname, mode, uid, gid, time(NULL));
-+                                                      entry = get_nod(fs, nod);
-+                                              }
-+                                              entry->i_uid = uid;
-+                                              entry->i_gid = gid;
-+                                              entry->i_mode = mode;
-+                                              rdev = makedev(major, minor + (i * increment - start));
-+                                              ((uint8*)entry->i_block)[0] = (rdev & 0xff);
-+                                              ((uint8*)entry->i_block)[1] = (rdev >> 8);
-+                                              free(dname);
-+                                      }
-+                              } else {
-+                                      dev_t rdev = makedev(major, minor);
-+                                      nod = alloc_nod(fs);
-+                                      add2dir(fs, parent, nod, bname, mode, uid, gid, time(NULL));
-+                                      entry = get_nod(fs, nod);
-+                                      ((uint8*)entry->i_block)[0] = (rdev & 0xff);
-+                                      ((uint8*)entry->i_block)[1] = (rdev >> 8);
-+                              }
-+                              break;
-+                      default:
-+                              error_msg_and_die("Unsupported file type");
-+              }
-+              free(bname);
-+      }
-+      free(name);
-+      return 0;
-+}
-+
-+static int parse_device_table(filesystem *root, FILE * file)
-+{
-+      char *line;
-+      int status = 0;
-+      size_t length = 0;
-+
-+      /* Turn off squash, since we must ensure that values
-+       * entered via the device table are not squashed */
-+      squash_uids = 0;
-+      squash_perms = 0;
-+
-+      /* Looks ok so far.  The general plan now is to read in one
-+       * line at a time, check for leading comment delimiters ('#'),
-+       * then try and parse the line as a device table.  If we fail
-+       * to parse things, try and help the poor fool to fix their
-+       * device table with a useful error msg... */
-+      line = NULL;
-+      while (getline(&line, &length, file) != -1) {
-+              /* First trim off any whitespace */
-+              int len = strlen(line);
-+
-+              /* trim trailing whitespace */
-+              while (len > 0 && isspace(line[len - 1]))
-+                      line[--len] = '\0';
-+              /* trim leading whitespace */
-+              memmove(line, &line[strspn(line, " \n\r\t\v")], len);
-+
-+              /* How long are we after trimming? */
-+              len = strlen(line);
-+
-+              /* If this is NOT a comment line, try to interpret it */
-+              if (len && *line != '#') {
-+                      if (interpret_table_entry(root, line))
-+                              status = 1;
-+              }
-+
-+              free(line);
-+              line = NULL;
-+      }
-+      fclose(file);
-+
-+      return status;
-+}
-+
-+/*
-+Local Variables:
-+c-file-style: "linux"
-+c-basic-offset: 4
-+tab-width: 4
-+End:
-+*/
-+
- void showhelp(void)
- {
-       fprintf(stderr, "Usage: %s [options] image\n"
-       "Create an ext2 filesystem image from directories/files\n\n"
--      "  -x image                Use this image as a starting point\n"
--      "  -d directory            Add this directory as source\n"
--      "  -f file                 Add nodes (e.g. devices) from this spec file\n"
--      "  -b blocks               Size in blocks\n"
--      "  -i inodes               Number of inodes\n"
--      "  -r reserved             Number of reserved blocks\n"
--      "  -g path                 Generate a block map file for this path\n"
--      "  -e value                Fill unallocated blocks with value\n"
--      "  -z                      Make files with holes\n"
--      "  -v                      Print resulting filesystem structure\n"
--      "  -h                      Show this help\n\n"
--      "Example of spec file:\n"
--      "drwx            /dev\n"
--      "crw-    10,190  /dev/lcd\n"
--      "brw-    1,0     /dev/ram0\n\n"
--      "Report bugs to xavier.bestel@free.fr\n", argv0);
-+      "  -x image         Use this image as a starting point\n"
-+      "  -d directory     Add this directory as source\n"
-+      "  -b blocks        Size in blocks\n"
-+      "  -i inodes        Number of inodes\n"
-+      "  -r reserved      Number of reserved blocks\n"
-+      "  -g path          Generate a block map file for this path\n"
-+      "  -e value         Fill unallocated blocks with value\n"
-+      "  -z               Make files with holes\n"
-+      "  -D,-f            Use the named FILE as a device table file\n"
-+      "  -q               Squash permissions and owners making all files be owned by root\n"
-+      "  -U               Squash owners making all files be owned by root\n"
-+      "  -P               Squash permissions on all files\n"
-+      "  -v               Print resulting filesystem structure\n"
-+      "  -h               Show this help\n\n"
-+      "Report bugs to xavier.bestel@free.fr\n", app_name);
- }
- #define MAX_DOPT 128
-@@ -1521,21 +2126,17 @@
-       filesystem *fs;
-       int i;
-       int c;
-+      struct stat sb;
-+      FILE *devtable = NULL;
--      argv0 = argv[0];
--      if(argc <= 1)
--      {
--              showhelp();
--              exit(1);
--      }
--      while((c = getopt(argc, argv, "x:f:d:b:i:r:g:e:zvh")) != EOF)
-+      app_name = argv[0];
-+      while((c = getopt(argc, argv, "x:d:b:i:r:g:e:zvhD:f:qUP")) != EOF)
-               switch(c)
-               {
-                       case 'x':
-                               fsin = optarg;
-                               break;
-                       case 'd':
--                      case 'f':
-                               dopt[didx++] = optarg;
-                               break;
-                       case 'b':
-@@ -1556,6 +2157,24 @@
-                       case 'z':
-                               holes = 1;
-                               break;
-+                      case 'f':
-+                      case 'D':
-+                              devtable = xfopen(optarg, "r");
-+                              if (fstat(fileno(devtable), &sb) < 0)
-+                                      perror_msg_and_die(optarg);
-+                              if (sb.st_size < 10)
-+                                      error_msg_and_die("%s: not a proper device table file", optarg);
-+                              break;
-+                      case 'q':
-+                              squash_uids = 1;
-+                              squash_perms = 1;
-+                              break;
-+                      case 'U':
-+                              squash_uids = 1;
-+                              break;
-+                      case 'P':
-+                              squash_perms = 1;
-+                              break;
-                       case 'v':
-                               verbose = 1;
-                               break;
-@@ -1566,16 +2185,14 @@
-                               exit(1);
-               }
-       if(optind < (argc - 1))
--              errexit("too many arguments");
-+              error_msg_and_die("too many arguments");
-       if(optind == (argc - 1))
-               fsout = argv[optind];
-       if(fsin)
-       {
-               if(strcmp(fsin, "-"))
-               {
--                      FILE * fh = fopen(fsin, "r");
--                      if(!fh)
--                              pexit(fsin);
-+                      FILE * fh = xfopen(fsin, "r");
-                       fs = load_fs(fh, bigendian);
-                       fclose(fh);
-               }
-@@ -1585,7 +2202,7 @@
-       else
-       {
-               if(nbblocks == -1)
--                      errexit("filesystem size unspecified");
-+                      error_msg_and_die("filesystem size unspecified");
-               if(nbinodes == -1)
-                       nbinodes = nbblocks * BLOCKSIZE / rndup(BYTES_PER_INODE, BLOCKSIZE);
-               if(nbresrvd == -1)
-@@ -1595,35 +2212,30 @@
-       for(i = 0; i < didx; i++)
-       {
-               struct stat st;
--              FILE *fh;
-               char *pdir;
-               stat(dopt[i], &st);
-               switch(st.st_mode & S_IFMT)
-               {
--                      case S_IFREG:
--                              if(!(fh = fopen(dopt[i], "r")))
--                                      pexit(dopt[i]);
--                              add2fs_from_file(fs, EXT2_ROOT_INO, fh);
--                              fclose(fh);
--                              break;
-                       case S_IFDIR:
-                               if(!(pdir = getcwd(0, GETCWD_SIZE)))
--                                      pexit(dopt[i]);
-+                                      perror_msg_and_die(dopt[i]);
-                               if(chdir(dopt[i]) < 0)
--                                      pexit(dopt[i]);
-+                                      perror_msg_and_die(dopt[i]);
-                               add2fs_from_dir(fs, EXT2_ROOT_INO);
-                               if(chdir(pdir) < 0)
--                                      pexit(pdir);
-+                                      perror_msg_and_die(pdir);
-                               free(pdir);
-                               break;
-                       default:
--                              errexit("%s in neither a file nor a directory", dopt[i]);
-+                              error_msg_and_die("%s is neither a file nor a directory", dopt[i]);
-               }
-       }
-       if(emptyval)
-               for(i = 1; i < fs->sb.s_blocks_count; i++)
--                      if(!allocated(fs->bbm, i))
-+                      if(!allocated(GRP_GET_BLOCK_BITMAP(fs,i),GRP_BBM_OFFSET(fs,i)))
-                               memset(get_blk(fs, i), emptyval, BLOCKSIZE);
-+      if(devtable)
-+              parse_device_table(fs, devtable);
-       if(verbose)
-               print_fs(fs);
-       for(i = 0; i < gidx; i++)
-@@ -1633,21 +2245,18 @@
-               char *p;
-               FILE *fh;
-               if(!(nod = find_path(fs, EXT2_ROOT_INO, gopt[i])))
--                      errexit("path %s not found in filesystem", gopt[i]);
-+                      error_msg_and_die("path %s not found in filesystem", gopt[i]);
-               while((p = strchr(gopt[i], '/')))
-                       *p = '_';
-               snprintf(fname, MAX_FILENAME-1, "%s.blk", gopt[i]);
--              if(!(fh = fopen(fname, "w")))
--                      pexit(fname);
-+              fh = xfopen(fname, "w");
-               fprintf(fh, "%d:", get_nod(fs, nod)->i_size);
-               flist_blocks(fs, nod, fh);
-               fclose(fh);
-       }
-       if(strcmp(fsout, "-"))
-       {
--              FILE * fh = fopen(fsout, "w");
--              if(!fh)
--                      pexit(fsout);
-+              FILE * fh = xfopen(fsout, "w");
-               dump_fs(fs, fh, bigendian);
-               fclose(fh);
-       }
-diff -urN genext2fs-1.3.orig/test-mount.sh genext2fs-1.3/test-mount.sh
---- genext2fs-1.3.orig/test-mount.sh   1969-12-31 17:00:00.000000000 -0700
-+++ genext2fs-1.3/test-mount.sh        2003-04-21 01:41:42.000000000 -0600
-@@ -0,0 +1,96 @@
-+#!/bin/sh
-+set -e
-+
-+cleanup () {
-+      set +e
-+      umount mnt 2>/dev/null
-+      rm -rf mnt ext2.img lsout fout test 2>/dev/null
-+}
-+
-+# dtest - Uses the -d directory option of genext2fs
-+# Creates an image with a file of given size and verifies it
-+# Usage: dtest file-size number-of-blocks 
-+dtest () {
-+      size=$1; blocks=$2;fname=$size 
-+      echo "Testing with file of size $size "
-+      mkdir -p test
-+      cd test
-+      dd if=/dev/zero of=file.$1 bs=1 count=$size 
-+      cd ..
-+      ./genext2fs -b $blocks -d test ext2.img 
-+      md5=`md5sum ext2.img | cut -f1 -d " "`
-+      if ! /sbin/e2fsck -fn ext2.img ; then
-+              echo "fsck failed"
-+              echo FAILED
-+              cleanup
-+              exit 1
-+      fi
-+      mkdir -p mnt
-+      if ! mount -t ext2 -o loop ext2.img mnt; then
-+              echo FAILED
-+              cleanup
-+              exit 1
-+      fi
-+      if (! [ -f mnt/file.$fname ]) || \
-+                      [ $fname != "`ls -al mnt | grep file.$fname |awk '{print $5}'`" ] ; then
-+              echo FAILED
-+              cleanup
-+              exit 1
-+      fi
-+      echo PASSED "(md5 checksum for the image: $md5)"
-+      cleanup
-+}
-+
-+# ftest - Uses the -f spec-file option of genext2fs
-+# Creates an image with the devices mentioned in the given spec 
-+# file and verifies it
-+# Usage: ftest spec-file number-of-blocks 
-+ftest () {
-+      fname=$1; blocks=$2; 
-+      echo "Testing with devices file $fname"
-+      ./genext2fs -b $blocks -f $fname ext2.img
-+      md5=`md5sum ext2.img | cut -f 1 -d " "`
-+      if ! /sbin/e2fsck -fn ext2.img ; then
-+              echo "fsck failed"
-+              echo FAILED
-+              cleanup
-+              exit 1
-+      fi
-+      mkdir -p mnt
-+      if ! mount -t ext2 -o loop ext2.img mnt; then
-+              echo FAILED
-+              cleanup
-+              exit 1
-+      fi
-+      if ! [ -d mnt/dev ] ; then
-+              echo FAILED
-+              cleanup
-+              exit 1
-+      fi
-+      cat dev.txt | grep ^[bc] | \
-+              awk '{print $1substr($1,2)substr($1,2),$2,$3}'| \
-+                      sort -d -k3.6 > fout
-+      ls -al mnt/dev | grep ^[bc] | \
-+              awk '{ print $1,$5$6,"/dev/"$10}' | \
-+                      sort -d -k3.6 > lsout
-+      if ! diff fout lsout ; then
-+              echo FAILED
-+              cleanup
-+              exit 1
-+      fi
-+      echo PASSED "(md5 checksum for the image: $md5)"
-+      cleanup
-+}
-+
-+dtest 0 4096 
-+dtest 0 8193
-+dtest 0 8194
-+dtest 1 4096 
-+dtest 12288 4096 
-+dtest 274432 4096 
-+dtest 8388608 9000 
-+dtest 16777216 20000
-+
-+ftest dev.txt 4096 
-+
-+exit 0
-diff -urN genext2fs-1.3.orig/test.sh genext2fs-1.3/test.sh
---- genext2fs-1.3.orig/test.sh 1969-12-31 17:00:00.000000000 -0700
-+++ genext2fs-1.3/test.sh      2003-04-21 01:41:42.000000000 -0600
-@@ -0,0 +1,53 @@
-+#!/bin/sh
-+set -e
-+
-+# dtest - Uses the -d directory option of genext2fs
-+# Creates an image with a file of given size and verifies it
-+# Usage: dtest file-size number-of-blocks correct-checksum
-+dtest () {
-+      size=$1; blocks=$2; checksum=$3
-+      echo "Testing with file of size $size "
-+      mkdir -p test
-+      cd test
-+      dd if=/dev/zero of=file.$1 bs=1 count=$size 
-+      cd ..
-+      ./genext2fs -b $blocks -d test ext2.img 
-+      md5=`md5sum ext2.img | cut -d" " -f1`
-+      rm -rf ext2.img test
-+      if [ $md5 == $checksum ] ; then
-+              echo PASSED
-+      else
-+              echo FAILED
-+              exit 1
-+      fi
-+}
-+
-+# ftest - Uses the -f spec-file option of genext2fs
-+# Creates an image with the devices mentioned in the given spec 
-+# file and verifies it
-+# Usage: ftest spec-file number-of-blocks correct-checksum
-+ftest () {
-+      fname=$1; blocks=$2; checksum=$3
-+      echo "Testing with devices file $fname"
-+      ./genext2fs -b $blocks -f $fname ext2.img
-+      md5=`md5sum ext2.img | cut -d" " -f1`
-+      rm -rf ext2.img
-+      if [ $md5 == $checksum ] ; then
-+              echo PASSED
-+      else
-+              echo FAILED
-+              exit 1
-+      fi
-+}
-+
-+dtest 0 4096 491a43ab93c2e5c186c9f1f72d88e5c5
-+dtest 0 8193 6289224f0b7f151994479ba156c43505
-+dtest 0 8194 3272c43c25e8d0c3768935861a643a65
-+dtest 1 4096 5ee24486d33af88c63080b09d8cadfb5
-+dtest 12288 4096 494498364defdc27b2770d1f9c1e3387
-+dtest 274432 4096 65c4bd8d30bf563fa5434119a12abff1
-+dtest 8388608 9000 9a49b0461ee236b7fd7c452fb6a1f2dc
-+dtest 16777216 20000 91e16429c901b68d30f783263f0611b7
-+
-+ftest dev.txt 4096 921ee9343b0759e16ad8d979d7dd16ec
-+exit 0
diff --git a/obsolete-buildroot/sources/hotplug.patch b/obsolete-buildroot/sources/hotplug.patch
deleted file mode 100644 (file)
index 22c356b..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-diff -urN diethotplug-0.4.orig/pci.c diethotplug-0.4/pci.c
---- diethotplug-0.4.orig/pci.c Wed Jan  9 13:57:29 2002
-+++ diethotplug-0.4/pci.c      Wed Jan 30 22:35:24 2002
-@@ -68,8 +68,8 @@
-               }
-               /* check that the class matches */
--              class_temp = pci_module_map[i].class_mask & pci_class;
--              if (pci_module_map[i].class != class_temp) {
-+              class_temp = (pci_module_map[i].class ^ pci_class) & pci_module_map[i].class_mask; 
-+              if (class_temp != 0) { 
-                       dbg ("class mask check failed %x != %x",
-                            pci_module_map[i].class, class_temp);
-                       continue;
---- diethotplug-0.4/Makefile.orig      Wed Jan  9 14:28:05 2002
-+++ diethotplug-0.4/Makefile   Mon Jul  8 07:29:00 2002
-@@ -135,13 +135,13 @@
- # Rules on how to create the generated header files
- usb_modules.h:
--      perl convert_usb.pl < /lib/modules/$(KERNEL_VERSION)/modules.usbmap > $@
-+      perl convert_usb.pl < $(TARGET_DIR)/lib/modules/$(KERNEL_VERSION)/modules.usbmap > $@
- pci_modules.h:
--      perl convert_pci.pl < /lib/modules/$(KERNEL_VERSION)/modules.pcimap > $@
-+      perl convert_pci.pl < $(TARGET_DIR)/lib/modules/$(KERNEL_VERSION)/modules.pcimap > $@
- ieee1394_modules.h:
--      perl convert_ieee1394.pl < /lib/modules/$(KERNEL_VERSION)/modules.ieee1394map > $@
-+      perl convert_ieee1394.pl < $(TARGET_DIR)/lib/modules/$(KERNEL_VERSION)/modules.ieee1394map > $@
- hotplug_version.h:
-       @echo \#define HOTPLUG_VERSION \"$(VERSION)\" > $@
diff --git a/obsolete-buildroot/sources/ipkg-utils-1.7-ipkg_build_clean.patch b/obsolete-buildroot/sources/ipkg-utils-1.7-ipkg_build_clean.patch
deleted file mode 100644 (file)
index 4cff731..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-diff -ruN ipkg-utils-1.7-old/ipkg-build ipkg-utils-1.7-new/ipkg-build
---- ipkg-utils-1.7-old/ipkg-build      2004-08-24 04:56:12.000000000 +0200
-+++ ipkg-utils-1.7-new/ipkg-build      2004-08-24 04:55:49.000000000 +0200
-@@ -47,6 +47,19 @@
-       PKG_ERROR=0
-+      cvs_dirs=`find . -name 'CVS'`
-+      if [ -n "$cvs_dirs" ]; then
-+          if [ "$noclean" = "1" ]; then
-+              echo "*** Warning: The following CVS directories where found.
-+You probably want to remove them: " >&2
-+              ls -ld $cvs_dirs
-+              echo >&2
-+          else
-+              echo "*** Removing the following files: $cvs_dirs"
-+              rm -rf "$cvs_dirs"
-+          fi
-+      fi
-+
-       tilde_files=`find . -name '*~'`
-       if [ -n "$tilde_files" ]; then
-           if [ "$noclean" = "1" ]; then
-@@ -134,8 +147,12 @@
-       for script in $CONTROL/preinst $CONTROL/postinst $CONTROL/prerm $CONTROL/postrm; do
-               if [ -f $script -a ! -x $script ]; then
-+                  if [ "$noclean" = "1" ]; then
-                       echo "*** Error: package script $script is not executable" >&2
-                       PKG_ERROR=1
-+                  else
-+                      chmod a+x $script
-+                  fi
-               fi
-       done
diff --git a/obsolete-buildroot/sources/ipkg-utils-1.7-ipkg_buildpackage.patch b/obsolete-buildroot/sources/ipkg-utils-1.7-ipkg_buildpackage.patch
deleted file mode 100644 (file)
index d0a3048..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -ruN ipkg-utils-1.7-old/ipkg-buildpackage ipkg-utils-1.7-new/ipkg-buildpackage
---- ipkg-utils-1.7-old/ipkg-buildpackage       2001-07-26 17:36:36.000000000 +0200
-+++ ipkg-utils-1.7-new/ipkg-buildpackage       2004-07-05 19:46:24.000000000 +0200
-@@ -30,8 +30,9 @@
- set -e
--#SCRIPTDIR=/usr/local/bin
--SCRIPTDIR=/other/kurth/ipaq-dev/familiar/dist/ipkg/util/
-+SCRIPTDIR=/usr/local/bin
-+
-+IPKG_BUILD_OPTIONS=$*
- SCRIPTNAME=`basename $0`
-@@ -212,7 +213,7 @@
- # build the ipk package
- owd=`pwd`
- cd ..
--ipkg-build /tmp/${pkg} || exit 1
-+ipkg-build $IPKG_BUILD_OPTIONS /tmp/${pkg} || exit 1
- rm -rf /tmp/${pkg}
diff --git a/obsolete-buildroot/sources/iproute2-cross-ar-20010824.patch b/obsolete-buildroot/sources/iproute2-cross-ar-20010824.patch
deleted file mode 100644 (file)
index 62ed488..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-diff -Nrup iproute2.orig/lib/Makefile iproute2/lib/Makefile
---- iproute2.orig/lib/Makefile 2000-04-16 13:42:52.000000000 -0400
-+++ iproute2/lib/Makefile      2004-06-03 19:17:51.000000000 -0400
-@@ -6,10 +6,10 @@ NLOBJ=ll_map.o libnetlink.o
- all: libnetlink.a libutil.a
- libnetlink.a: $(NLOBJ)
--      ar rcs $@ $(NLOBJ)
-+      $(AR) rcs $@ $(NLOBJ)
- libutil.a: $(UTILOBJ) $(ADDLIB)
--      ar rcs $@ $(UTILOBJ) $(ADDLIB)
-+      $(AR) rcs $@ $(UTILOBJ) $(ADDLIB)
- clean:
-       rm -f $(NLOBJ) $(UTILOBJ) $(ADDLIB) libnetlink.a libutil.a
-diff -Nrup iproute2.orig/tc/Makefile iproute2/tc/Makefile
---- iproute2.orig/tc/Makefile  2000-04-16 13:42:53.000000000 -0400
-+++ iproute2/tc/Makefile       2004-06-03 19:18:08.000000000 -0400
-@@ -43,7 +43,7 @@ all: libtc.a tc
- tc: $(TCOBJ) $(LIBNETLINK) $(LIBUTIL) $(TCLIB)
- libtc.a: $(TCLIB)
--      ar rcs $@ $(TCLIB)
-+      $(AR) rcs $@ $(TCLIB)
- clean:
-       rm -f $(TCOBJ) $(TCLIB) libtc.a tc
diff --git a/obsolete-buildroot/sources/iproute2-htb3.6_tc.patch b/obsolete-buildroot/sources/iproute2-htb3.6_tc.patch
deleted file mode 100644 (file)
index 4c2c104..0000000
+++ /dev/null
@@ -1,319 +0,0 @@
---- iproute2/tc/q_htb.c        Sun Oct 21 22:07:29 2001
-+++ iproute2new/tc/q_htb.c     Sun May 12 22:18:27 2002
-@@ -0,0 +1,306 @@
-+/*
-+ * q_htb.c            HTB.
-+ *
-+ *            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, or (at your option) any later version.
-+ *
-+ * Authors:   Martin Devera, devik@cdi.cz
-+ *
-+ */
-+
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <syslog.h>
-+#include <fcntl.h>
-+#include <sys/socket.h>
-+#include <netinet/in.h>
-+#include <arpa/inet.h>
-+#include <string.h>
-+
-+#include "utils.h"
-+#include "tc_util.h"
-+
-+#define HTB_TC_VER 0x30003
-+#if HTB_TC_VER >> 16 != TC_HTB_PROTOVER
-+#error "Different kernel and TC HTB versions"
-+#endif
-+
-+static void explain(void)
-+{
-+      fprintf(stderr, "Usage: ... qdisc add ... htb [default N] [r2q N]\n"
-+              " default  minor id of class to which unclassified packets are sent {0}\n"
-+              " r2q      DRR quantums are computed as rate in Bps/r2q {10}\n"
-+              " debug    string of 16 numbers each 0-3 {0}\n\n"
-+              "... class add ... htb rate R1 burst B1 [prio P] [slot S] [pslot PS]\n"
-+              "                      [ceil R2] [cburst B2] [mtu MTU] [quantum Q]\n"
-+              " rate     rate allocated to this class (class can still borrow)\n"
-+              " burst    max bytes burst which can be accumulated during idle period {computed}\n"
-+              " ceil     definite upper class rate (no borrows) {rate}\n"
-+              " cburst   burst but for ceil {computed}\n"
-+              " mtu      max packet size we create rate map for {1600}\n"
-+              " prio     priority of leaf; lower are served first {0}\n"
-+              " quantum  how much bytes to serve from leaf at once {use r2q}\n"
-+              "\nTC HTB version %d.%d\n",HTB_TC_VER>>16,HTB_TC_VER&0xffff
-+              );
-+}
-+
-+static void explain1(char *arg)
-+{
-+    fprintf(stderr, "Illegal \"%s\"\n", arg);
-+    explain();
-+}
-+
-+
-+#define usage() return(-1)
-+
-+static int htb_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
-+{
-+      struct tc_htb_glob opt;
-+      struct rtattr *tail;
-+      unsigned i; char *p;
-+      memset(&opt,0,sizeof(opt));
-+      opt.rate2quantum = 10;
-+      opt.version = 3;
-+
-+      while (argc > 0) {
-+              if (matches(*argv, "r2q") == 0) {
-+                  NEXT_ARG();
-+                  if (get_u32(&opt.rate2quantum, *argv, 10)) {
-+                      explain1("r2q"); return -1;
-+                  }
-+              } else if (matches(*argv, "default") == 0) {
-+                  NEXT_ARG();
-+                  if (get_u32(&opt.defcls, *argv, 16)) {
-+                      explain1("default"); return -1;
-+                  }
-+              } else if (matches(*argv, "debug") == 0) {
-+                  NEXT_ARG(); p = *argv;
-+                  for (i=0; i<16; i++,p++) {
-+                      if (*p<'0' || *p>'3') break;
-+                      opt.debug |= (*p-'0')<<(2*i);
-+                  }
-+              } else {
-+                      fprintf(stderr, "What is \"%s\"?\n", *argv);
-+                      explain();
-+                      return -1;
-+              }
-+              argc--; argv++;
-+      }
-+      tail = (struct rtattr*)(((void*)n)+NLMSG_ALIGN(n->nlmsg_len));
-+      addattr_l(n, 1024, TCA_OPTIONS, NULL, 0);
-+      addattr_l(n, 2024, TCA_HTB_INIT, &opt, NLMSG_ALIGN(sizeof(opt)));
-+      tail->rta_len = (((void*)n)+NLMSG_ALIGN(n->nlmsg_len)) - (void*)tail;
-+      return 0;
-+}
-+
-+static int htb_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
-+{
-+      int ok=0;
-+      struct tc_htb_opt opt;
-+      __u32 rtab[256],ctab[256];
-+      unsigned buffer=0,cbuffer=0;
-+      int cell_log=-1,ccell_log = -1,mtu;
-+      struct rtattr *tail;
-+
-+      memset(&opt, 0, sizeof(opt)); mtu = 1600; /* eth packet len */
-+
-+      while (argc > 0) {
-+              if (matches(*argv, "prio") == 0) {
-+                      NEXT_ARG();
-+                      if (get_u32(&opt.prio, *argv, 10)) {
-+                              explain1("prio"); return -1;
-+                      }
-+                      ok++;
-+              } else if (matches(*argv, "mtu") == 0) {
-+                      NEXT_ARG();
-+                      if (get_u32(&mtu, *argv, 10)) {
-+                              explain1("mtu"); return -1;
-+                      }
-+              } else if (matches(*argv, "quantum") == 0) {
-+                      NEXT_ARG();
-+                      if (get_u32(&opt.quantum, *argv, 10)) {
-+                              explain1("quantum"); return -1;
-+                      }
-+              } else if (matches(*argv, "burst") == 0 ||
-+                      strcmp(*argv, "buffer") == 0 ||
-+                      strcmp(*argv, "maxburst") == 0) {
-+                      NEXT_ARG();
-+                      if (get_size_and_cell(&buffer, &cell_log, *argv) < 0) {
-+                              explain1("buffer");
-+                              return -1;
-+                      }
-+                      ok++;
-+              } else if (matches(*argv, "cburst") == 0 ||
-+                      strcmp(*argv, "cbuffer") == 0 ||
-+                      strcmp(*argv, "cmaxburst") == 0) {
-+                      NEXT_ARG();
-+                      if (get_size_and_cell(&cbuffer, &ccell_log, *argv) < 0) {
-+                              explain1("cbuffer");
-+                              return -1;
-+                      }
-+                      ok++;
-+              } else if (strcmp(*argv, "ceil") == 0) {
-+                      NEXT_ARG();
-+                      if (opt.ceil.rate) {
-+                              fprintf(stderr, "Double \"ceil\" spec\n");
-+                              return -1;
-+                      }
-+                      if (get_rate(&opt.ceil.rate, *argv)) {
-+                              explain1("ceil");
-+                              return -1;
-+                      }
-+                      ok++;
-+              } else if (strcmp(*argv, "rate") == 0) {
-+                      NEXT_ARG();
-+                      if (opt.rate.rate) {
-+                              fprintf(stderr, "Double \"rate\" spec\n");
-+                              return -1;
-+                      }
-+                      if (get_rate(&opt.rate.rate, *argv)) {
-+                              explain1("rate");
-+                              return -1;
-+                      }
-+                      ok++;
-+              } else if (strcmp(*argv, "help") == 0) {
-+                      explain();
-+                      return -1;
-+              } else {
-+                      fprintf(stderr, "What is \"%s\"?\n", *argv);
-+                      explain();
-+                      return -1;
-+              }
-+              argc--; argv++;
-+      }
-+
-+/*    if (!ok)
-+              return 0;*/
-+
-+      if (opt.rate.rate == 0) {
-+              fprintf(stderr, "\"rate\" is required.\n");
-+              return -1;
-+      }
-+      /* if ceil params are missing, use the same as rate */
-+      if (!opt.ceil.rate) opt.ceil = opt.rate;
-+
-+      /* compute minimal allowed burst from rate; mtu is added here to make
-+         sute that buffer is larger than mtu and to have some safeguard space */
-+      if (!buffer) buffer = opt.rate.rate / HZ + mtu;
-+      if (!cbuffer) cbuffer = opt.ceil.rate / HZ + mtu;
-+
-+      if ((cell_log = tc_calc_rtable(opt.rate.rate, rtab, cell_log, mtu, 0)) < 0) {
-+              fprintf(stderr, "htb: failed to calculate rate table.\n");
-+              return -1;
-+      }
-+      opt.buffer = tc_calc_xmittime(opt.rate.rate, buffer);
-+      opt.rate.cell_log = cell_log;
-+      
-+      if ((ccell_log = tc_calc_rtable(opt.ceil.rate, ctab, cell_log, mtu, 0)) < 0) {
-+              fprintf(stderr, "htb: failed to calculate ceil rate table.\n");
-+              return -1;
-+      }
-+      opt.cbuffer = tc_calc_xmittime(opt.ceil.rate, cbuffer);
-+      opt.ceil.cell_log = ccell_log;
-+
-+      tail = (struct rtattr*)(((void*)n)+NLMSG_ALIGN(n->nlmsg_len));
-+      addattr_l(n, 1024, TCA_OPTIONS, NULL, 0);
-+      addattr_l(n, 2024, TCA_HTB_PARMS, &opt, sizeof(opt));
-+      addattr_l(n, 3024, TCA_HTB_RTAB, rtab, 1024);
-+      addattr_l(n, 4024, TCA_HTB_CTAB, ctab, 1024);
-+      tail->rta_len = (((void*)n)+NLMSG_ALIGN(n->nlmsg_len)) - (void*)tail;
-+      return 0;
-+}
-+
-+static int htb_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
-+{
-+      struct rtattr *tb[TCA_HTB_RTAB+1];
-+      struct tc_htb_opt *hopt;
-+      struct tc_htb_glob *gopt;
-+      double buffer,cbuffer;
-+      SPRINT_BUF(b1);
-+      SPRINT_BUF(b2);
-+
-+      if (opt == NULL)
-+              return 0;
-+
-+      memset(tb, 0, sizeof(tb));
-+      parse_rtattr(tb, TCA_HTB_RTAB, RTA_DATA(opt), RTA_PAYLOAD(opt));
-+
-+      if (tb[TCA_HTB_PARMS]) {
-+
-+          hopt = RTA_DATA(tb[TCA_HTB_PARMS]);
-+          if (RTA_PAYLOAD(tb[TCA_HTB_PARMS])  < sizeof(*hopt)) return -1;
-+
-+              if (!hopt->level) {
-+                      fprintf(f, "prio %d ", (int)hopt->prio);
-+                      if (show_details)
-+                              fprintf(f, "quantum %d ", (int)hopt->quantum);
-+              }
-+          fprintf(f, "rate %s ", sprint_rate(hopt->rate.rate, b1));
-+          buffer = ((double)hopt->rate.rate*tc_core_tick2usec(hopt->buffer))/1000000;
-+          fprintf(f, "ceil %s ", sprint_rate(hopt->ceil.rate, b1));
-+          cbuffer = ((double)hopt->ceil.rate*tc_core_tick2usec(hopt->cbuffer))/1000000;
-+          if (show_details) {
-+              fprintf(f, "burst %s/%u mpu %s ", sprint_size(buffer, b1),
-+                      1<<hopt->rate.cell_log, sprint_size(hopt->rate.mpu, b2));
-+              fprintf(f, "cburst %s/%u mpu %s ", sprint_size(cbuffer, b1),
-+                      1<<hopt->ceil.cell_log, sprint_size(hopt->ceil.mpu, b2));
-+              fprintf(f, "level %d ", (int)hopt->level);
-+          } else {
-+              fprintf(f, "burst %s ", sprint_size(buffer, b1));
-+              fprintf(f, "cburst %s ", sprint_size(cbuffer, b1));
-+          }
-+          if (show_raw)
-+              fprintf(f, "buffer [%08x] cbuffer [%08x] ", 
-+                      hopt->buffer,hopt->cbuffer);
-+      }
-+      if (tb[TCA_HTB_INIT]) {
-+          gopt = RTA_DATA(tb[TCA_HTB_INIT]);
-+          if (RTA_PAYLOAD(tb[TCA_HTB_INIT])  < sizeof(*gopt)) return -1;
-+
-+          fprintf(f, "r2q %d default %x direct_packets_stat %u", 
-+                  gopt->rate2quantum,gopt->defcls,gopt->direct_pkts);
-+              if (show_details)
-+                      fprintf(f," ver %d.%d",gopt->version >> 16,gopt->version & 0xffff);
-+      }
-+      return 0;
-+}
-+
-+static int htb_print_xstats(struct qdisc_util *qu, FILE *f, struct rtattr *xstats)
-+{
-+      struct tc_htb_xstats *st;
-+      if (xstats == NULL)
-+              return 0;
-+
-+      if (RTA_PAYLOAD(xstats) < sizeof(*st))
-+              return -1;
-+
-+      st = RTA_DATA(xstats);
-+      fprintf(f, " lended: %u borrowed: %u giants: %u\n", 
-+              st->lends,st->borrows,st->giants);
-+      fprintf(f, " tokens: %d ctokens: %d\n", st->tokens,st->ctokens);
-+      return 0;
-+}
-+
-+struct qdisc_util htb_util = {
-+      NULL,
-+      "htb",
-+      htb_parse_opt,
-+      htb_print_opt,
-+      htb_print_xstats,
-+      htb_parse_class_opt,
-+      htb_print_opt,
-+};
-+
-+/* for testing of old one */
-+struct qdisc_util htb2_util = {
-+      NULL,
-+      "htb2",
-+      htb_parse_opt,
-+      htb_print_opt,
-+      htb_print_xstats,
-+      htb_parse_class_opt,
-+      htb_print_opt,
-+};
---- iproute2/tc/Makefile       Tue Jul  6 18:13:07 1999
-+++ iproute2new/tc/Makefile    Thu May  9 12:34:19 2002
-@@ -21,6 +21,7 @@ ifeq ($(TC_CONFIG_DIFFSERV),y)
- endif
- #TCMODULES += q_csz.o
-+TCMODULES += q_htb.o
- #TCMODULES += q_hpfq.o
- #TCMODULES += q_hfsc.o
diff --git a/obsolete-buildroot/sources/iptables-openwrt-extensions.patch b/obsolete-buildroot/sources/iptables-openwrt-extensions.patch
deleted file mode 100644 (file)
index ca1fb1a..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-diff -burN iptables-1.2.11/extensions/Makefile iptables-1.2.11-openwrt/extensions/Makefile
---- iptables-1.2.11/extensions/Makefile        2004-06-17 12:22:54.000000000 +0200
-+++ iptables-1.2.11-openwrt/extensions/Makefile        2004-11-01 09:41:13.910649624 +0100
-@@ -5,12 +5,14 @@
- # header files are present in the include/linux directory of this iptables
- # package (HW)
- #
--PF_EXT_SLIB:=ah connlimit connmark conntrack dscp ecn esp helper icmp iprange length limit mac mark multiport owner physdev pkttype realm rpc sctp standard state tcp tcpmss tos ttl udp unclean CLASSIFY CONNMARK DNAT DSCP ECN LOG MARK MASQUERADE MIRROR NETMAP NOTRACK REDIRECT REJECT SAME SNAT TARPIT TCPMSS TOS TRACE TTL ULOG
--PF6_EXT_SLIB:=eui64 hl icmpv6 length limit mac mark multiport owner standard tcp udp HL LOG MARK TRACE
-+#PF_EXT_SLIB:=ah connlimit connmark conntrack dscp ecn esp helper icmp iprange length limit mac mark multiport owner physdev pkttype realm rpc sctp standard state tcp tcpmss tos ttl udp unclean CLASSIFY CONNMARK DNAT DSCP ECN LOG MARK MASQUERADE MIRROR NETMAP NOTRACK REDIRECT REJECT SAME SNAT TARPIT TCPMSS TOS TRACE TTL ULOG
-+PF_EXT_SLIB:=icmp iprange mark standard state tcp udp DNAT LOG MARK MASQUERADE REDIRECT REJECT SNAT TCPMSS
-+#PF6_EXT_SLIB:=eui64 hl icmpv6 length limit mac mark multiport owner standard tcp udp HL LOG MARK TRACE
-+PF6_EXT_SLIB:=eui64 icmpv6 mark standard tcp udp LOG
- # Optionals
--PF_EXT_SLIB_OPTS:=$(foreach T,$(wildcard extensions/.*-test),$(shell KERNEL_DIR=$(KERNEL_DIR) $(T)))
--PF6_EXT_SLIB_OPTS:=$(foreach T,$(wildcard extensions/.*-test6),$(shell KERNEL_DIR=$(KERNEL_DIR) $(T)))
-+#PF_EXT_SLIB_OPTS:=$(foreach T,$(wildcard extensions/.*-test),$(shell KERNEL_DIR=$(KERNEL_DIR) $(T)))
-+#PF6_EXT_SLIB_OPTS:=$(foreach T,$(wildcard extensions/.*-test6),$(shell KERNEL_DIR=$(KERNEL_DIR) $(T)))
- PF_EXT_ALL_SLIB:=$(patsubst extensions/libipt_%.c, %, $(wildcard extensions/libipt_*.c))
- PF6_EXT_ALL_SLIB:=$(patsubst extensions/libip6t_%.c, %, $(wildcard extensions/libip6t_*.c))
diff --git a/obsolete-buildroot/sources/libfloat.patch b/obsolete-buildroot/sources/libfloat.patch
deleted file mode 100644 (file)
index 90459a8..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-diff -urN libfloat-dist/Makefile libfloat/Makefile
---- libfloat-dist/Makefile     2003-10-26 00:33:45.000000000 -0500
-+++ libfloat/Makefile  2003-10-26 01:07:26.000000000 -0500
-@@ -1,7 +1,7 @@
- # Makefile for the Linux soft-float library
--CC=gcc -O2 -freg-struct-return -fomit-frame-pointer -D__LIBFLOAT__
--#CC=gcc -g -O2 -freg-struct-return -D__LIBFLOAT__
-+CFLAGS= -O2 -freg-struct-return -fomit-frame-pointer -D__LIBFLOAT__ -msoft-float
-+LIBGCC=$(shell $(CC) -print-libgcc-file-name)
- AR=ar
- all: libfloat.a libfloat.so.1
-@@ -12,24 +11,24 @@
- libfloat.so.1: softfloat.os fplib_glue.os
-       rm -f libfloat.so.1
--      gcc -shared -Wl,-soname,libfloat.so.1 softfloat.os fplib_glue.os -o libfloat.so.1
-+      $(LD) -shared -soname=libfloat.so.1 softfloat.os fplib_glue.os -o libfloat.so.1 $(LIBGCC)
- softfloat.o: softfloat/bits64/softfloat.c
--      $(CC) -c -o softfloat.o -Isoftfloat/bits64/ARM-gcc softfloat/bits64/softfloat.c
-+      $(CC) $(CFLAGS) -c -o softfloat.o -Isoftfloat/bits64/ARM-gcc softfloat/bits64/softfloat.c
- fplib_glue.o: fplib_glue.S
--      $(CC) -c -o fplib_glue.o fplib_glue.S
-+      $(CC) $(CFLAGS) -c -o fplib_glue.o fplib_glue.S
- softfloat.os: softfloat/bits64/softfloat.c
--      $(CC) -fpic -c -o softfloat.os -Isoftfloat/bits64/ARM-gcc softfloat/bits64/softfloat.c
-+      $(CC) $(CFLAGS) -fpic -c -o softfloat.os -Isoftfloat/bits64/ARM-gcc softfloat/bits64/softfloat.c
- fplib_glue.os: fplib_glue.S
--      $(CC) -fpic -c -o fplib_glue.os fplib_glue.S
-+      $(CC) $(CFLAGS) -fpic -c -o fplib_glue.os fplib_glue.S
- install: libfloat.a libfloat.so.1
-       cp -a libfloat.a $(DESTDIR)/usr/lib
--      cp -a libfloat.so.1 $(DESTDIR)/usr/lib
--      cd $(DESTDIR)/usr/lib; ln -s libfloat.so.1 libfloat.so
-+      cp -a libfloat.so.1 $(DESTDIR)/lib
-+      cd $(DESTDIR)/lib; ln -s libfloat.so.1 libfloat.so
-       #ldconfig
- clean: 
diff --git a/obsolete-buildroot/sources/libglib_configure_1.2.10.bz2 b/obsolete-buildroot/sources/libglib_configure_1.2.10.bz2
deleted file mode 100644 (file)
index 883a800..0000000
Binary files a/obsolete-buildroot/sources/libglib_configure_1.2.10.bz2 and /dev/null differ
diff --git a/obsolete-buildroot/sources/libssl.control b/obsolete-buildroot/sources/libssl.control
deleted file mode 100644 (file)
index 4fe0b87..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Package: libssl
-Priority: optional
-Version: 0.9.7d-1
-Architecture: mipsel
-Maintainer: below0
-Section: libs
-Source: Embedded in the main OpenWrt buildroot
-Description: OpenSSL libraries used for SSL encryption.
-
diff --git a/obsolete-buildroot/sources/ltp-testsuite.patch b/obsolete-buildroot/sources/ltp-testsuite.patch
deleted file mode 100644 (file)
index fed728e..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
---- ltp-full-20031002/testcases/kernel/syscalls/fmtmsg/Makefile.orig   2003-10-02 19:18:10.000000000 -0600
-+++ ltp-full-20031002/testcases/kernel/syscalls/fmtmsg/Makefile        2003-10-02 19:18:32.000000000 -0600
-@@ -24,7 +24,7 @@
- LOADLIBES+=   -L../../../../lib -lltp
- SRCS=$(wildcard *.c)
--TARGETS=$(patsubst %.c,%,$(SRCS))
-+TARGETS=#$(patsubst %.c,%,$(SRCS))
- all: $(TARGETS)
---- ltp-full-20031002/testcases/kernel/syscalls/profil/Makefile.orig   2003-10-02 19:27:53.000000000 -0600
-+++ ltp-full-20031002/testcases/kernel/syscalls/profil/Makefile        2003-10-02 19:28:02.000000000 -0600
-@@ -23,7 +23,7 @@
- LOADLIBES+=   -L../../../../lib -lltp 
- SRCS=$(wildcard *.c)
--TARGETS=$(patsubst %.c,%,$(SRCS))
-+TARGETS=#$(patsubst %.c,%,$(SRCS))
- all: $(TARGETS)
---- ltp-full-20031002/testcases/network/rpc/rpc01/Makefile.orig        2003-10-02 19:36:51.000000000 -0600
-+++ ltp-full-20031002/testcases/network/rpc/rpc01/Makefile     2003-10-02 19:37:03.000000000 -0600
-@@ -2,7 +2,7 @@
- LDLIBS += 
- SRCS=$(wildcard *.c)
--TARGETS=$(patsubst %.c,%,$(SRCS))
-+TARGETS=#$(patsubst %.c,%,$(SRCS))
- all: $(TARGETS)
---- ltp-full-20031002/tools/netpipe-2.4-ipv6/Makefile.orig     2003-11-07 16:41:39.000000000 -0700
-+++ ltp-full-20031002/tools/netpipe-2.4-ipv6/Makefile  2003-11-07 16:42:41.000000000 -0700
-@@ -10,7 +10,7 @@
- DRIV_OBJ   = netpipe.o
- INCLUDES   = netpipe.h
- # Default target is just TCP
--TARGETS    = NPtcp-ipv6
-+TARGETS    = #NPtcp-ipv6
- # If you have TCP, MPI and PVM
- #TARGETS    = NPtcp NPmpi NPpvm
- CFLAGS                    += -O -Wall
-@@ -28,12 +28,12 @@
- targets:    $(TARGETS)
- install:
--      @ln -f NPtcp-ipv6 ../../testcases/bin   
-+      #@ln -f NPtcp-ipv6 ../../testcases/bin  
- #
- # This section of the Makefile is for compiling the binaries
- #
--TCP:  NPtcp-ipv6
-+TCP:  #NPtcp-ipv6
-       @echo 'NPtcp has been built.'
- NPtcp-ipv6:   NPtcp.o TCP.o
diff --git a/obsolete-buildroot/sources/lzo-cross-compile.patch b/obsolete-buildroot/sources/lzo-cross-compile.patch
deleted file mode 100644 (file)
index 68a3d04..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-For some reason the lzo autoconf script uses a local macro that does
-a test for cross-compiles, and assumes that if the build target name
-and the host target name are the same that --host was not specified to
-the configure script. In the uClibc buildroot, this is not the case.
-
---- lzo-1.08/aclocal.m4        2002-07-12 18:31:52.000000000 -0700
-+++ lzo-1.08/aclocal.m4.new    2004-03-10 15:32:42.000000000 -0700
-@@ -205,12 +205,6 @@
- [
- AC_REQUIRE([AC_PROG_CC])
--if test "X$cross_compiling" = Xyes; then
--  if test "X$build" = "X$host"; then
--    AC_MSG_ERROR([you are cross compiling - please use the \`--host=' option])
--  fi
--fi
--
- ])
---- lzo-1.08/configure-dist    2004-03-11 02:18:28.000000000 -0600
-+++ lzo-1.08/configure 2004-03-11 02:19:16.000000000 -0600
-@@ -2282,13 +2282,13 @@
--if test "X$cross_compiling" = Xyes; then
--  if test "X$build" = "X$host"; then
--    { { echo "$as_me:$LINENO: error: you are cross compiling - please use the \`--host=' option" >&5
--echo "$as_me: error: you are cross compiling - please use the \`--host=' option" >&2;}
--   { (exit 1); exit 1; }; }
--  fi
--fi
-+#if test "X$cross_compiling" = Xyes; then
-+#  if test "X$build" = "X$host"; then
-+#    { { echo "$as_me:$LINENO: error: you are cross compiling - please use the \`--host=' option" >&5
-+#echo "$as_me: error: you are cross compiling - please use the \`--host=' option" >&2;}
-+#   { (exit 1); exit 1; }; }
-+#  fi
-+#fi
diff --git a/obsolete-buildroot/sources/mime.types b/obsolete-buildroot/sources/mime.types
deleted file mode 100644 (file)
index 53f6ea1..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-###############################################################################
-#
-#  MIME-TYPES and the extensions that represent them
-#
-#  This file is part of the "mime-support" package.  Please send email (not a
-#  bug report) to mime-support@packages.debian.org if you would like new types
-#  and/or extensions to be added.
-#
-#  Note: Compression schemes like "gzip", "bzip", and "compress" are not
-#  actually "mime-types".  They are "encodings" and hence must _not_ have
-#  entries in this file to map their extensions.  The "mime-type" of an
-#  encoded file refers to the type of data that has been encoded, not the
-#  type of the encoding.
-#
-###############################################################################
-
-
-application/activemessage
-application/andrew-inset
-application/applefile
-application/atomicmail
-application/cu-seeme                           csm cu
-application/dca-rft
-application/dec-dx
-application/dsptype                            tsp
-application/futuresplash                       spl
-application/ghostview
-application/mac-binhex40                       hqx
-application/macwriteii
-application/msaccess                           mdb
-application/msword                             doc dot
-application/news-message-id
-application/news-transmission
-application/octet-stream                       bin
-application/oda                                        oda
-application/pdf                                        pdf
-application/pgp-signature                      pgp
-application/postscript                         ps ai eps
-application/remote-printing
-application/rtf                                        rtf
-application/slate
-application/vnd.ms-excel                       xls xlb
-application/vnd.ms-powerpoint                  ppt pps pot
-application/vnd.wap.wmlc                       wmlc
-application/vnd.wap.wmlscriptc                 wmlsc
-application/wita
-application/wordperfect5.1                     wp5
-application/zip                                        zip
-application/x-123                              wk
-application/x-bcpio                            bcpio
-application/x-chess-pgn                                pgn
-application/x-core
-application/x-cpio                             cpio
-application/x-csh
-application/x-debian-package                   deb
-application/x-director                         dcr dir dxr
-application/x-dms                              dms
-application/x-dvi                              dvi
-application/x-executable
-application/x-font                             pfa pfb gsf pcf pcf.Z
-application/x-gnumeric                         gnumeric
-application/x-gtar                             gtar tgz
-application/x-hdf                              hdf
-application/x-httpd-php                                phtml pht php
-application/x-httpd-php3                       php3
-application/x-httpd-php3-source                        phps
-application/x-httpd-php3-preprocessed          php3p
-application/x-httpd-php4                       php4
-application/x-ica                              ica
-application/x-java                             class
-application/x-javascript                       js
-application/x-kdelnk
-application/x-kchart                           chrt
-application/x-killustrator                     kil
-application/x-kpresenter                       kpr kpt
-application/x-kspread                          ksp
-application/x-kword                            kwd kwt
-application/x-latex                            latex
-application/x-lha                              lha
-application/x-lzh                              lzh
-application/x-lzx                              lzx
-application/x-maker                            frm maker frame fm fb book fbdoc
-application/x-mif                              mif
-application/x-msdos-program                    com exe bat dll
-application/x-msi                              msi
-application/x-netcdf                           nc cdf
-application/x-ns-proxy-autoconfig              pac
-application/x-object                           o
-application/x-ogg                              ogg
-application/x-oz-application                   oza
-application/x-perl                             pl pm
-application/x-redhat-package-manager           rpm
-application/x-rx
-application/x-sh
-application/x-shar                             shar
-application/x-shellscript
-application/x-shockwave-flash                  swf swfl
-application/x-stuffit                          sit
-application/x-sv4cpio                          sv4cpio
-application/x-sv4crc                           sv4crc
-application/x-tar                              tar
-application/x-tcl
-application/x-tex
-application/x-tex-gf                           gf
-application/x-tex-pk                           pk PK
-application/x-texinfo                          texinfo texi
-application/x-trash                            ~ % bak old sik
-application/x-troff                            t tr roff
-application/x-troff-man                                man
-application/x-troff-me                         me
-application/x-troff-ms                         ms
-application/x-ustar                            ustar
-application/x-wais-source                      src
-application/x-wingz                            wz
-
-audio/basic                                    au snd
-audio/midi                                     mid midi
-audio/mpeg                                     mpga mpega mp2 mp3
-audio/mpegurl                                  m3u
-audio/prs.sid                                  sid
-audio/x-aiff                                   aif aiff aifc
-audio/x-gsm                                    gsm
-audio/x-pn-realaudio                           ra rm ram
-audio/x-wav                                    wav
-
-image/bitmap                                   bmp
-image/gif                                      gif
-image/ief                                      ief
-image/jpeg                                     jpeg jpg jpe
-image/pcx                                      pcx
-image/png                                      png
-image/tiff                                     tiff tif
-image/vnd.wap.wbmp                             wbmp
-image/x-cmu-raster                             ras
-image/x-coreldraw                              cdr
-image/x-coreldrawpattern                       pat
-image/x-coreldrawtemplate                      cdt
-image/x-corelphotopaint                                cpt
-image/x-jng                                    jng
-image/x-portable-anymap                                pnm
-image/x-portable-bitmap                                pbm
-image/x-portable-graymap                       pgm
-image/x-portable-pixmap                                ppm
-image/x-rgb                                    rgb
-image/x-xbitmap                                        xbm
-image/x-xpixmap                                        xpm
-image/x-xwindowdump                            xwd
-
-inode/chardevice
-inode/blockdevice
-inode/directory-locked
-inode/directory
-inode/fifo
-inode/socket
-
-message/external-body
-message/news
-message/partial
-message/rfc822
-
-multipart/alternative
-multipart/appledouble
-multipart/digest
-multipart/mixed
-multipart/parallel
-
-text/comma-separated-values                    csv
-text/css                                       css
-text/english
-text/html                                      htm html xhtml
-text/mathml                                    mml
-text/plain                                     txt text diff
-text/richtext                                  rtx
-text/tab-separated-values                      tsv
-text/vnd.wap.wml                               wml
-text/vnd.wap.wmlscript                         wmls
-text/xml                                       xml
-text/x-c++hdr                                  h++ hpp hxx hh
-text/x-c++src                                  c++ cpp cxx cc
-text/x-chdr                                    h
-text/x-crontab
-text/x-csh                                     csh
-text/x-csrc                                    c
-text/x-java                                    java
-text/x-makefile
-text/x-moc                                     moc
-text/x-pascal                                  p pas
-text/x-setext                                  etx
-text/x-sh                                      sh
-text/x-tcl                                     tcl tk
-text/x-tex                                     tex ltx sty cls
-text/x-vcalendar                               vcs
-text/x-vcard                                   vcf
-
-video/dl                                       dl
-video/fli                                      fli
-video/gl                                       gl
-video/mpeg                                     mpeg mpg mpe
-video/quicktime                                        qt mov
-video/x-mng                                    mng
-video/x-ms-asf                                 asf asx
-video/x-msvideo                                        avi
-video/x-sgi-movie                              movie
-
-x-world/x-vrml                                 vrm vrml wrl
diff --git a/obsolete-buildroot/sources/mrouted-sys_errlist.patch b/obsolete-buildroot/sources/mrouted-sys_errlist.patch
deleted file mode 100644 (file)
index 8498dc7..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-Patches from Kevin P. Fleming <kpfleming@backtobasicsmgmt.com>.
-
---- mrouted-3.9-beta3.orig/main.c~     2004-03-10 19:00:38.000000000 -0700
-+++ mrouted-3.9-beta3.orig/main.c      2004-03-10 19:02:33.000000000 -0700
-@@ -1001,10 +1001,8 @@
-                   thyme->tm_min, thyme->tm_sec, now.tv_usec / 1000, msg);
-       if (syserr == 0)
-           fprintf(stderr, "\n");
--      else if (syserr < sys_nerr)
--          fprintf(stderr, ": %s\n", sys_errlist[syserr]);
-       else
--          fprintf(stderr, ": errno %d\n", syserr);
-+          fprintf(stderr, ": %s\n", strerror(syserr));
-     }
-     /*
---- mrouted-3.9-beta3.orig/mrinfo.c~   1998-02-28 20:05:20.000000000 -0700
-+++ mrouted-3.9-beta3.orig/mrinfo.c    2004-03-10 19:01:49.000000000 -0700
-@@ -159,10 +159,8 @@
-               vfprintf(stderr, fmt, ap);
-               if (syserr == 0)
-                       fprintf(stderr, "\n");
--              else if (syserr < sys_nerr)
--                      fprintf(stderr, ": %s\n", sys_errlist[syserr]);
-               else
--                      fprintf(stderr, ": errno %d\n", syserr);
-+                      fprintf(stderr, ": %s\n", strerror(syserr));
-       }
-       if (severity <= LOG_ERR)
---- mrouted-3.9-beta3.orig/mapper.c~   1998-01-05 18:57:47.000000000 -0700
-+++ mrouted-3.9-beta3.orig/mapper.c    2004-03-10 19:02:04.000000000 -0700
-@@ -197,10 +197,8 @@
-           vfprintf(stderr, fmt, ap);
-           if (syserr == 0)
-               fprintf(stderr, "\n");
--          else if (syserr < sys_nerr)
--              fprintf(stderr, ": %s\n", sys_errlist[syserr]);
-           else
--              fprintf(stderr, ": errno %d\n", syserr);
-+              fprintf(stderr, ": %s\n", strerror(syserr));
-     }
-     if (severity <= LOG_ERR)
diff --git a/obsolete-buildroot/sources/netkittelnet.patch b/obsolete-buildroot/sources/netkittelnet.patch
deleted file mode 100644 (file)
index c894c2a..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
---- netkit-telnet-0.17/configure       Thu Apr 11 10:40:58 2002
-+++ FIXEDnetkittelnet/configure        Thu Apr 11 10:39:59 2002
-@@ -78,7 +78,6 @@
-     for TRY in egcs gcc g++ CC c++ cc; do
-        (
-            $TRY __conftest.c -o __conftest || exit 1;
--           ./__conftest || exit 1;
-        ) >/dev/null 2>&1 || continue;
-        CC=$TRY
-        break;
-@@ -94,7 +93,6 @@
-     echo -n 'Checking if C compiler works... '
-     if (
-           $CC __conftest.c -o __conftest || exit 1
--          ./__conftest || exit 1
-        ) >/dev/null 2>&1; then
-          echo 'yes'
-      else
-@@ -125,7 +123,6 @@
-     for TRY in egcs gcc g++ CC c++ cc; do
-        (
-            $TRY __conftest.cc -o __conftest || exit 1;
--           ./__conftest || exit 1;
-        ) >/dev/null 2>&1 || continue;
-        CXX=$TRY
-        break;
-@@ -141,7 +138,6 @@
-     echo -n 'Checking if C++ compiler works... '
-     if (
-           $CXX __conftest.cc -o __conftest || exit 1
--          ./__conftest || exit 1
-        ) >/dev/null 2>&1; then
-          echo 'yes'
-      else
-@@ -278,13 +274,11 @@
- EOF
- if (
-       $CXX $CXXFLAGS  __conftest.cc  -o __conftest || exit 1
--      ./__conftest || exit 1
-    ) >/dev/null 2>&1; then
-     echo 'yes'
- else
-     if (
-           $CXX $CXXFLAGS -D__USE_BSD_SIGNAL __conftest.cc  -o __conftest || exit 1
--          ./__conftest || exit 1
-        ) >/dev/null 2>&1; then
-         echo '-D__USE_BSD_SIGNAL'
-         CFLAGS="$CFLAGS -D__USE_BSD_SIGNAL"
-@@ -292,6 +286,7 @@
-     else
-         echo 'no'
-         echo 'This package needs BSD signal semantics to run.'
-+              echo "$CXX $CXXFLAGS  -D__USE_BSD_SIGNAL __conftest.cc  -o __conftest failed"
-         rm -f __conftest*
-         exit
-     fi
-@@ -330,31 +325,6 @@
-         echo 'no'
-     fi
- fi
--
--if [ x$NCURSES != x ]; then
--    LIBTERMCAP=-lncurses
--else
--    echo -n 'Checking for traditional termcap... '
--cat <<EOF >__conftest.cc
--#include <stdio.h>
--#include <termcap.h>
--int main(void) {
--    tgetent(NULL, NULL); return 0;
--}
--
--EOF
--    if (
--          $CXX $CXXFLAGS  __conftest.cc -ltermcap -o __conftest || exit 1
--       ) >/dev/null 2>&1; then
--        echo '-ltermcap'
--        LIBTERMCAP=-ltermcap
--    else
--        echo 'not found'
--        echo 'This package needs termcap to run.'
--        rm -f __conftest*
--        exit
--    fi
--fi
- rm -f __conftest*
- ##################################################
-@@ -468,7 +438,6 @@
- else
-     if (
-           $CXX $CXXFLAGS -D_GNU_SOURCE __conftest.cc  -o __conftest || exit 1
--          ./__conftest || exit 1
-        ) >/dev/null 2>&1; then
-         echo '-D_GNU_SOURCE'
-         CFLAGS="$CFLAGS -D_GNU_SOURCE"
-@@ -501,20 +470,17 @@
- EOF
- if (
-       $CXX $CXXFLAGS  __conftest.cc $LIBBSD -o __conftest || exit 1
--      ./__conftest || exit 1
-    ) >/dev/null 2>&1; then
-     echo 'ok'
- else
-     if (
-           $CXX $CXXFLAGS  __conftest.cc -lsnprintf $LIBBSD -o __conftest || exit 1
--          ./__conftest || exit 1
-        ) >/dev/null 2>&1; then
-         echo '-lsnprintf'
-         LIBS="$LIBS -lsnprintf"
-     else
-         if (
-               $CXX $CXXFLAGS  __conftest.cc -ldb $LIBBSD -o __conftest || exit 1
--              ./__conftest || exit 1
-            ) >/dev/null 2>&1; then
-             echo '-ldb'
-             LIBS="$LIBS -ldb"
-diff -urN netkit-telnet-0.17/telnetd/state.c netkit-telnet-0.17-dm/telnetd/state.c
---- netkit-telnet-0.17/telnetd/state.c 1999-12-12 11:41:44.000000000 -0800
-+++ netkit-telnet-0.17-dm/telnetd/state.c      2003-07-23 19:20:38.000000000 -0700
-@@ -43,10 +43,10 @@
- static int envvarok(char *varp);
--static unsigned char doopt[] = { IAC, DO, '%', 'c', 0 };
--static unsigned char dont[] = { IAC, DONT, '%', 'c', 0 };
--unsigned char will[] = { IAC, WILL, '%', 'c', 0 };
--unsigned char wont[] = { IAC, WONT, '%', 'c', 0 };
-+//static unsigned char doopt[] = { IAC, DO, '%', 'c', 0 };
-+//static unsigned char dont[] = { IAC, DONT, '%', 'c', 0 };
-+//unsigned char       will[] = { IAC, WILL, '%', 'c', 0 };
-+//unsigned char       wont[] = { IAC, WONT, '%', 'c', 0 };
- /*
-  * Buffer for sub-options, and macros
-@@ -422,7 +422,7 @@
-           set_his_want_state_will(option);
-       do_dont_resp[option]++;
-     }
--    netoprintf((char *)doopt, option);
-+    netoprintf( "%c%c%c", IAC, DO, option );
-     
-     DIAG(TD_OPTIONS, printoption("td: send do", option));
- }
-@@ -632,7 +632,7 @@
-       set_his_want_state_wont(option);
-       do_dont_resp[option]++;
-     }
--    netoprintf((char *) dont, option);
-+    netoprintf ( "%c%c%c", IAC, DONT, option );
-     DIAG(TD_OPTIONS, printoption("td: send dont", option));
- }
-@@ -769,7 +769,7 @@
-       set_my_want_state_will(option);
-       will_wont_resp[option]++;
-     }
--    netoprintf((char *) will, option);
-+    netoprintf( "%c%c%c", IAC, WILL, option);
-     DIAG(TD_OPTIONS, printoption("td: send will", option));
- }
-@@ -917,7 +917,7 @@
-       set_my_want_state_wont(option);
-       will_wont_resp[option]++;
-     }
--    netoprintf((char *)wont, option);
-+    netoprintf( "%c%c%c", IAC, WONT, option);
-     
-     DIAG(TD_OPTIONS, printoption("td: send wont", option));
- }
diff --git a/obsolete-buildroot/sources/netsnmp.patch b/obsolete-buildroot/sources/netsnmp.patch
deleted file mode 100644 (file)
index 076592b..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-diff -urN net-snmp-5.1-dist/agent/mibgroup/host/hr_system.c net-snmp-5.1/agent/mibgroup/host/hr_system.c
---- net-snmp-5.1-dist/agent/mibgroup/host/hr_system.c  2003-02-28 22:35:13.000000000 -0600
-+++ net-snmp-5.1/agent/mibgroup/host/hr_system.c       2004-03-31 22:06:05.000000000 -0600
-@@ -286,7 +286,11 @@
-                current user */
-             if (kill(utmp_p->ut_pid, 0) == -1 && errno == ESRCH) {
-                 utmp_p->ut_type = DEAD_PROCESS;
-+#if HAVE_UTMPX_H
-                 pututxline(utmp_p);
-+#else
-+                pututline(utmp_p);
-+#endif
-                 continue;
-             }
-             ++total;
-diff -urN net-snmp-5.1-dist/configure.in net-snmp-5.1/configure.in
---- net-snmp-5.1-dist/configure.in     2004-03-31 21:59:14.000000000 -0600
-+++ net-snmp-5.1/configure.in  2004-03-31 22:06:05.000000000 -0600
-@@ -1865,13 +1865,8 @@
- if test $cross_compiling = yes; then
-   if test $with_endianness = "big"; then
-     AC_DEFINE(WORDS_BIGENDIAN)
--  elif test -z $with_endianness; then
--    AC_MSG_ERROR([You are cross-compiling, but you have not specified the target's endianness])
-   fi
- else
--  if test $with_endianness; then
--    AC_MSG_ERROR([Endianness has been specified, but you are not cross-compiling.])
--  fi
-   AC_C_BIGENDIAN
- fi
diff --git a/obsolete-buildroot/sources/openvpn b/obsolete-buildroot/sources/openvpn
deleted file mode 100755 (executable)
index 94bdc60..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/bin/sh -e
-#
-# Original version by Robert Leslie
-# <rob@mars.org>, edited by iwj and cs
-# Modified for openvpn by Alberto Gonzalez Iniesta <agi@agi.as>
-# Modified for restarting / starting / stopping single tunnels by Richard Mueller <mueller@teamix.net>
-
-test $DEBIAN_SCRIPT_DEBUG && set -v -x
-
-DAEMON=/usr/sbin/openvpn
-CONFIG_DIR=/etc/openvpn
-test -x $DAEMON || exit 0
-test -d $CONFIG_DIR || exit 0
-
-start_vpn () {
-    $DAEMON --daemon --writepid /var/run/openvpn.$NAME.pid \
-            --config $CONFIG_DIR/$NAME.conf --cd $CONFIG_DIR || echo -n " FAILED->"
-    echo -n " $NAME"
-}
-stop_vpn () {
-   kill `cat $PIDFILE` || true
-  rm $PIDFILE
-}
-
-case "$1" in
-start)
-  echo -n "Starting openvpn:"
-
-  if test -z $2 ; then
-    for CONFIG in `cd $CONFIG_DIR; ls *.conf 2> /dev/null`; do
-      NAME=${CONFIG%%.conf}
-      start_vpn
-    done
-  else
-    if test -e $CONFIG_DIR/$2.conf ; then
-      NAME=$2
-      start_vpn
-    else
-      echo -n " No such VPN: $2"
-    fi
-  fi
-  echo "."
-
-  ;;
-stop)
-  echo -n "Stopping openvpn:"
-
-  if test -z $2 ; then
-    for PIDFILE in `ls /var/run/openvpn.*.pid 2> /dev/null`; do
-      NAME=`echo $PIDFILE | cut -c18-`
-      NAME=${NAME%%.pid}
-      stop_vpn
-      echo -n " $NAME"
-    done
-  else
-    if test -e /var/run/openvpn.$2.pid ; then
-      PIDFILE=`ls /var/run/openvpn.$2.pid 2> /dev/null`
-      NAME=`echo $PIDFILE | cut -c18-`
-      NAME=${NAME%%.pid}
-      stop_vpn
-      echo -n " $NAME"
-    else
-      echo -n " No such VPN: $2"
-    fi
-  fi
-  echo "."
-  ;;
-# We only 'reload' for running VPNs. New ones will only start with 'start' or 'restart'.
-reload|force-reload)
-  echo -n "Reloading openvpn:"
-  for PIDFILE in `ls /var/run/openvpn.*.pid 2> /dev/null`; do
-    NAME=`echo $PIDFILE | cut -c18-`
-    NAME=${NAME%%.pid}
-# If openvpn if running under a different user than root we'll need to restart
-    if egrep '^( |\t)*user' $CONFIG_DIR/$NAME.conf > /dev/null 2>&1 ; then
-      stop_vpn
-      sleep 1
-      start_vpn
-      echo -n "(restarted)"
-    else
-      kill -HUP `cat $PIDFILE` || true
-#    start-stop-daemon --stop --signal HUP --quiet --oknodo \
-#      --exec $DAEMON --pidfile $PIDFILE
-    echo -n " $NAME"
-    fi
-  done
-  echo "."
-  ;;
-
-restart)
-  $0 stop $2
-  sleep 1
-  $0 start $2
-  ;;
-*)
-  echo "Usage: $0 {start|stop|reload|restart|force-reload}" >&2
-  exit 1
-  ;;
-esac
-
-exit 0
-
-# vim:set ai et sts=2 sw=2 tw=0:
diff --git a/obsolete-buildroot/sources/openwrt/busybox/busybox.config b/obsolete-buildroot/sources/openwrt/busybox/busybox.config
deleted file mode 100644 (file)
index 1b78d20..0000000
+++ /dev/null
@@ -1,467 +0,0 @@
-#
-# Automatically generated make config: don't edit
-#
-HAVE_DOT_CONFIG=y
-
-#
-# General Configuration
-#
-# CONFIG_FEATURE_BUFFERS_USE_MALLOC is not set
-CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y
-# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
-CONFIG_FEATURE_VERBOSE_USAGE=y
-# CONFIG_FEATURE_INSTALLER is not set
-# CONFIG_LOCALE_SUPPORT is not set
-CONFIG_FEATURE_DEVFS=y
-CONFIG_FEATURE_DEVPTS=y
-# CONFIG_FEATURE_CLEAN_UP is not set
-CONFIG_FEATURE_SUID=y
-# CONFIG_FEATURE_SUID_CONFIG is not set
-# CONFIG_SELINUX is not set
-
-#
-# Build Options
-#
-# CONFIG_STATIC is not set
-CONFIG_LFS=y
-USING_CROSS_COMPILER=y
-CROSS_COMPILER_PREFIX="mipsel-uclibc-"
-EXTRA_CFLAGS_OPTIONS="-Os "
-
-#
-# Installation Options
-#
-# CONFIG_INSTALL_NO_USR is not set
-PREFIX="./_install"
-
-#
-# Archival Utilities
-#
-# CONFIG_AR is not set
-CONFIG_BUNZIP2=y
-# CONFIG_CPIO is not set
-# CONFIG_DPKG is not set
-# CONFIG_DPKG_DEB is not set
-CONFIG_GUNZIP=y
-CONFIG_FEATURE_GUNZIP_UNCOMPRESS=y
-CONFIG_GZIP=y
-# CONFIG_RPM2CPIO is not set
-# CONFIG_RPM is not set
-CONFIG_TAR=y
-CONFIG_FEATURE_TAR_CREATE=y
-CONFIG_FEATURE_TAR_BZIP2=y
-# CONFIG_FEATURE_TAR_FROM is not set
-CONFIG_FEATURE_TAR_GZIP=y
-# CONFIG_FEATURE_TAR_COMPRESS is not set
-# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
-CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
-# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set
-# CONFIG_UNCOMPRESS is not set
-# CONFIG_UNZIP is not set
-
-#
-# Common options for cpio and tar
-#
-# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
-
-#
-# Coreutils
-#
-CONFIG_BASENAME=y
-# CONFIG_CAL is not set
-CONFIG_CAT=y
-CONFIG_CHGRP=y
-CONFIG_CHMOD=y
-CONFIG_CHOWN=y
-CONFIG_CHROOT=y
-# CONFIG_CMP is not set
-CONFIG_CP=y
-CONFIG_CUT=y
-CONFIG_DATE=y
-CONFIG_FEATURE_DATE_ISOFMT=y
-CONFIG_DD=y
-CONFIG_DF=y
-# CONFIG_DIRNAME is not set
-# CONFIG_DOS2UNIX is not set
-# CONFIG_DU is not set
-CONFIG_ECHO=y
-CONFIG_FEATURE_FANCY_ECHO=y
-CONFIG_ENV=y
-CONFIG_EXPR=y
-CONFIG_FALSE=y
-# CONFIG_FOLD is not set
-CONFIG_HEAD=y
-# CONFIG_FEATURE_FANCY_HEAD is not set
-CONFIG_HOSTID=y
-# CONFIG_ID is not set
-CONFIG_INSTALL=y
-CONFIG_LENGTH=y
-CONFIG_LN=y
-# CONFIG_LOGNAME is not set
-CONFIG_LS=y
-CONFIG_FEATURE_LS_FILETYPES=y
-CONFIG_FEATURE_LS_FOLLOWLINKS=y
-CONFIG_FEATURE_LS_RECURSIVE=y
-CONFIG_FEATURE_LS_SORTFILES=y
-CONFIG_FEATURE_LS_TIMESTAMPS=y
-CONFIG_FEATURE_LS_USERNAME=y
-CONFIG_FEATURE_LS_COLOR=y
-CONFIG_MD5SUM=y
-CONFIG_MKDIR=y
-CONFIG_MKFIFO=y
-# CONFIG_MKNOD is not set
-CONFIG_MV=y
-# CONFIG_OD is not set
-# CONFIG_PRINTF is not set
-CONFIG_PWD=y
-# CONFIG_REALPATH is not set
-CONFIG_RM=y
-CONFIG_RMDIR=y
-# CONFIG_SEQ is not set
-# CONFIG_SHA1SUM is not set
-CONFIG_SLEEP=y
-CONFIG_FEATURE_FANCY_SLEEP=y
-CONFIG_SORT=y
-# CONFIG_STTY is not set
-CONFIG_SYNC=y
-CONFIG_TAIL=y
-CONFIG_FEATURE_FANCY_TAIL=y
-CONFIG_TEE=y
-CONFIG_FEATURE_TEE_USE_BLOCK_IO=y
-CONFIG_TEST=y
-
-#
-# test (forced enabled for use with shell)
-#
-# CONFIG_FEATURE_TEST_64 is not set
-CONFIG_TOUCH=y
-# CONFIG_TR is not set
-CONFIG_TRUE=y
-# CONFIG_TTY is not set
-CONFIG_UNAME=y
-CONFIG_UNIQ=y
-# CONFIG_USLEEP is not set
-# CONFIG_UUDECODE is not set
-# CONFIG_UUENCODE is not set
-# CONFIG_WATCH is not set
-CONFIG_WC=y
-# CONFIG_WHO is not set
-# CONFIG_WHOAMI is not set
-CONFIG_YES=y
-
-#
-# Common options for cp and mv
-#
-CONFIG_FEATURE_PRESERVE_HARDLINKS=y
-
-#
-# Common options for ls and more
-#
-CONFIG_FEATURE_AUTOWIDTH=y
-
-#
-# Common options for df, du, ls
-#
-CONFIG_FEATURE_HUMAN_READABLE=y
-
-#
-# Common options for md5sum, sha1sum
-#
-CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y
-
-#
-# Console Utilities
-#
-# CONFIG_CHVT is not set
-CONFIG_CLEAR=y
-# CONFIG_DEALLOCVT is not set
-# CONFIG_DUMPKMAP is not set
-# CONFIG_LOADFONT is not set
-# CONFIG_LOADKMAP is not set
-# CONFIG_OPENVT is not set
-CONFIG_RESET=y
-# CONFIG_SETKEYCODES is not set
-
-#
-# Debian Utilities
-#
-CONFIG_MKTEMP=y
-# CONFIG_PIPE_PROGRESS is not set
-# CONFIG_READLINK is not set
-CONFIG_RUN_PARTS=y
-# CONFIG_START_STOP_DAEMON is not set
-CONFIG_WHICH=y
-
-#
-# Editors
-#
-CONFIG_AWK=y
-CONFIG_FEATURE_AWK_MATH=y
-# CONFIG_PATCH is not set
-CONFIG_SED=y
-CONFIG_VI=y
-CONFIG_FEATURE_VI_COLON=y
-CONFIG_FEATURE_VI_YANKMARK=y
-CONFIG_FEATURE_VI_SEARCH=y
-CONFIG_FEATURE_VI_USE_SIGNALS=y
-CONFIG_FEATURE_VI_DOT_CMD=y
-CONFIG_FEATURE_VI_READONLY=y
-CONFIG_FEATURE_VI_SETOPTS=y
-CONFIG_FEATURE_VI_SET=y
-CONFIG_FEATURE_VI_WIN_RESIZE=y
-CONFIG_FEATURE_VI_OPTIMIZE_CURSOR=y
-
-#
-# Finding Utilities
-#
-CONFIG_FIND=y
-# CONFIG_FEATURE_FIND_MTIME is not set
-CONFIG_FEATURE_FIND_PERM=y
-CONFIG_FEATURE_FIND_TYPE=y
-CONFIG_FEATURE_FIND_XDEV=y
-# CONFIG_FEATURE_FIND_NEWER is not set
-# CONFIG_FEATURE_FIND_INUM is not set
-CONFIG_GREP=y
-CONFIG_FEATURE_GREP_EGREP_ALIAS=y
-CONFIG_FEATURE_GREP_FGREP_ALIAS=y
-CONFIG_FEATURE_GREP_CONTEXT=y
-CONFIG_XARGS=y
-CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION=y
-CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y
-CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y
-CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y
-
-#
-# Init Utilities
-#
-CONFIG_INIT=y
-CONFIG_FEATURE_USE_INITTAB=y
-# CONFIG_FEATURE_INITRD is not set
-# CONFIG_FEATURE_INIT_COREDUMPS is not set
-# CONFIG_FEATURE_EXTRA_QUIET is not set
-# CONFIG_HALT is not set
-# CONFIG_POWEROFF is not set
-CONFIG_REBOOT=y
-CONFIG_MESG=y
-
-#
-# Login/Password Management Utilities
-#
-# CONFIG_USE_BB_PWD_GRP is not set
-# CONFIG_ADDGROUP is not set
-# CONFIG_DELGROUP is not set
-# CONFIG_ADDUSER is not set
-# CONFIG_DELUSER is not set
-# CONFIG_GETTY is not set
-# CONFIG_FEATURE_U_W_TMP is not set
-# CONFIG_LOGIN is not set
-# CONFIG_FEATURE_SECURETTY is not set
-CONFIG_PASSWD=y
-# CONFIG_SU is not set
-# CONFIG_SULOGIN is not set
-# CONFIG_VLOCK is not set
-
-#
-# Common options for adduser, deluser, login, su
-#
-# CONFIG_FEATURE_SHADOWPASSWDS is not set
-
-#
-# Miscellaneous Utilities
-#
-# CONFIG_ADJTIMEX is not set
-CONFIG_CROND=y
-# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set
-CONFIG_CRONTAB=y
-# CONFIG_DC is not set
-# CONFIG_DEVFSD is not set
-# CONFIG_LAST is not set
-# CONFIG_HDPARM is not set
-# CONFIG_MAKEDEVS is not set
-# CONFIG_MT is not set
-# CONFIG_RX is not set
-CONFIG_STRINGS=y
-CONFIG_TIME=y
-# CONFIG_WATCHDOG is not set
-
-#
-# Linux Module Utilities
-#
-CONFIG_INSMOD=y
-CONFIG_FEATURE_2_4_MODULES=y
-# CONFIG_FEATURE_2_6_MODULES is not set
-# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
-# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
-# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
-# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
-CONFIG_LSMOD=y
-CONFIG_FEATURE_QUERY_MODULE_INTERFACE=y
-# CONFIG_MODPROBE is not set
-CONFIG_RMMOD=y
-# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set
-
-#
-# Networking Utilities
-#
-CONFIG_FEATURE_IPV6=y
-CONFIG_ARPING=y
-# CONFIG_FTPGET is not set
-# CONFIG_FTPPUT is not set
-# CONFIG_HOSTNAME is not set
-CONFIG_HTTPD=y
-# CONFIG_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY is not set
-CONFIG_FEATURE_HTTPD_BASIC_AUTH=y
-CONFIG_FEATURE_HTTPD_AUTH_MD5=y
-CONFIG_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP=y
-# CONFIG_FEATURE_HTTPD_SETUID is not set
-CONFIG_FEATURE_HTTPD_CONFIG_WITH_MIME_TYPES=y
-CONFIG_FEATURE_HTTPD_CGI=y
-CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV=y
-CONFIG_FEATURE_HTTPD_ENCODE_URL_STR=y
-CONFIG_IFCONFIG=y
-CONFIG_FEATURE_IFCONFIG_STATUS=y
-# CONFIG_FEATURE_IFCONFIG_SLIP is not set
-# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set
-CONFIG_FEATURE_IFCONFIG_HW=y
-CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS=y
-# CONFIG_IFUPDOWN is not set
-# CONFIG_INETD is not set
-# CONFIG_IP is not set
-CONFIG_IPCALC=y
-CONFIG_FEATURE_IPCALC_FANCY=y
-# CONFIG_IPADDR is not set
-# CONFIG_IPLINK is not set
-# CONFIG_IPROUTE is not set
-# CONFIG_IPTUNNEL is not set
-# CONFIG_NAMEIF is not set
-CONFIG_NC=y
-CONFIG_NETSTAT=y
-CONFIG_NSLOOKUP=y
-CONFIG_PING=y
-CONFIG_FEATURE_FANCY_PING=y
-CONFIG_PING6=y
-CONFIG_FEATURE_FANCY_PING6=y
-CONFIG_ROUTE=y
-# CONFIG_TELNET is not set
-CONFIG_TELNETD=y
-# CONFIG_FEATURE_TELNETD_INETD is not set
-# CONFIG_TFTP is not set
-CONFIG_TRACEROUTE=y
-CONFIG_FEATURE_TRACEROUTE_VERBOSE=y
-CONFIG_VCONFIG=y
-CONFIG_WGET=y
-CONFIG_FEATURE_WGET_STATUSBAR=y
-CONFIG_FEATURE_WGET_AUTHENTICATION=y
-CONFIG_FEATURE_WGET_IP6_LITERAL=y
-
-#
-# udhcp Server/Client
-#
-# CONFIG_UDHCPD is not set
-CONFIG_UDHCPC=y
-# CONFIG_FEATURE_UDHCP_SYSLOG is not set
-# CONFIG_FEATURE_UDHCP_DEBUG is not set
-
-#
-# Process Utilities
-#
-CONFIG_FREE=y
-CONFIG_KILL=y
-CONFIG_KILLALL=y
-CONFIG_KILLALL5=y
-CONFIG_PIDOF=y
-CONFIG_PS=y
-# CONFIG_RENICE is not set
-CONFIG_TOP=y
-FEATURE_CPU_USAGE_PERCENTAGE=y
-CONFIG_UPTIME=y
-CONFIG_SYSCTL=y
-
-#
-# Another Bourne-like Shell
-#
-CONFIG_FEATURE_SH_IS_ASH=y
-# CONFIG_FEATURE_SH_IS_HUSH is not set
-# CONFIG_FEATURE_SH_IS_LASH is not set
-# CONFIG_FEATURE_SH_IS_MSH is not set
-# CONFIG_FEATURE_SH_IS_NONE is not set
-CONFIG_ASH=y
-
-#
-# Ash Shell Options
-#
-CONFIG_ASH_JOB_CONTROL=y
-CONFIG_ASH_ALIAS=y
-CONFIG_ASH_MATH_SUPPORT=y
-# CONFIG_ASH_MATH_SUPPORT_64 is not set
-CONFIG_ASH_GETOPTS=y
-CONFIG_ASH_CMDCMD=y
-# CONFIG_ASH_MAIL is not set
-CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
-# CONFIG_ASH_RANDOM_SUPPORT is not set
-# CONFIG_HUSH is not set
-# CONFIG_LASH is not set
-# CONFIG_MSH is not set
-
-#
-# Bourne Shell Options
-#
-# CONFIG_FEATURE_SH_EXTRA_QUIET is not set
-# CONFIG_FEATURE_SH_STANDALONE_SHELL is not set
-CONFIG_FEATURE_COMMAND_EDITING=y
-CONFIG_FEATURE_COMMAND_HISTORY=15
-# CONFIG_FEATURE_COMMAND_SAVEHISTORY is not set
-CONFIG_FEATURE_COMMAND_TAB_COMPLETION=y
-# CONFIG_FEATURE_COMMAND_USERNAME_COMPLETION is not set
-CONFIG_FEATURE_SH_FANCY_PROMPT=y
-
-#
-# System Logging Utilities
-#
-CONFIG_SYSLOGD=y
-CONFIG_FEATURE_ROTATE_LOGFILE=y
-CONFIG_FEATURE_REMOTE_LOG=y
-CONFIG_FEATURE_IPC_SYSLOG=y
-CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=16
-CONFIG_LOGREAD=y
-# CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set
-CONFIG_KLOGD=y
-CONFIG_LOGGER=y
-
-#
-# Linux System Utilities
-#
-CONFIG_DMESG=y
-# CONFIG_FBSET is not set
-# CONFIG_FDFLUSH is not set
-# CONFIG_FDFORMAT is not set
-# CONFIG_FDISK is not set
-FDISK_SUPPORT_LARGE_DISKS=y
-# CONFIG_FREERAMDISK is not set
-# CONFIG_FSCK_MINIX is not set
-# CONFIG_MKFS_MINIX is not set
-# CONFIG_GETOPT is not set
-CONFIG_HEXDUMP=y
-# CONFIG_HWCLOCK is not set
-# CONFIG_LOSETUP is not set
-# CONFIG_MKSWAP is not set
-CONFIG_MORE=y
-CONFIG_FEATURE_USE_TERMIOS=y
-CONFIG_PIVOT_ROOT=y
-CONFIG_RDATE=y
-# CONFIG_SWAPONOFF is not set
-CONFIG_MOUNT=y
-CONFIG_NFSMOUNT=y
-CONFIG_UMOUNT=y
-CONFIG_FEATURE_MOUNT_FORCE=y
-
-#
-# Common options for mount/umount
-#
-CONFIG_FEATURE_MOUNT_LOOP=y
-# CONFIG_FEATURE_MTAB_SUPPORT is not set
-
-#
-# Debugging Options
-#
-# CONFIG_DEBUG is not set
diff --git a/obsolete-buildroot/sources/openwrt/busybox/patches/100-killall5.patch b/obsolete-buildroot/sources/openwrt/busybox/patches/100-killall5.patch
deleted file mode 100644 (file)
index 161b7e6..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-diff -urN busybox-dist/include/applets.h busybox/include/applets.h
---- busybox-dist/include/applets.h     2004-03-13 02:33:09.000000000 -0600
-+++ busybox/include/applets.h  2004-03-16 09:45:29.000000000 -0600
-@@ -313,6 +313,9 @@
- #ifdef CONFIG_KILLALL
-       APPLET(killall, kill_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
- #endif
-+#ifdef CONFIG_KILLALL5
-+      APPLET(killall5, kill_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
-+#endif
- #ifdef CONFIG_KLOGD
-       APPLET(klogd, klogd_main, _BB_DIR_SBIN, _BB_SUID_NEVER)
- #endif
-diff -urN busybox-dist/include/usage.h busybox/include/usage.h
---- busybox-dist/include/usage.h       2004-03-13 02:33:09.000000000 -0600
-+++ busybox/include/usage.h    2004-03-16 09:45:29.000000000 -0600
-@@ -1389,6 +1389,13 @@
- #define killall_example_usage \
-       "$ killall apache\n"
-+#define killall5_trivial_usage \
-+      ""
-+#define killall5_full_usage \
-+      ""
-+#define killall5_example_usage \
-+      ""
-+
- #define klogd_trivial_usage \
-       "[-c n] [-n]"
- #define klogd_full_usage \
-diff -urN busybox-dist/procps/Config.in busybox/procps/Config.in
---- busybox-dist/procps/Config.in      2003-12-24 00:02:11.000000000 -0600
-+++ busybox/procps/Config.in   2004-03-16 09:45:29.000000000 -0600
-@@ -30,6 +30,11 @@
-         specified commands.  If no signal name is specified, SIGTERM is
-         sent.
-+config CONFIG_KILLALL5
-+      bool "killall5"
-+      default n
-+      depends on CONFIG_KILL
-+      
- config CONFIG_PIDOF
-       bool "pidof"
-       default n
-diff -urN busybox-dist/procps/kill.c busybox/procps/kill.c
---- busybox-dist/procps/kill.c 2004-03-15 02:29:03.000000000 -0600
-+++ busybox/procps/kill.c      2004-03-16 09:45:29.000000000 -0600
-@@ -34,6 +34,7 @@
- #define KILL 0
- #define KILLALL 1
-+#define KILLALL5 2
- extern int kill_main(int argc, char **argv)
- {
-@@ -47,6 +48,9 @@
- #else
-       whichApp = KILL;
- #endif
-+#ifdef CONFIG_KILLALL5
-+      whichApp = (strcmp(bb_applet_name, "killall5") == 0)? KILLALL5 : whichApp;
-+#endif
-       /* Parse any options */
-       if (argc < 2)
-@@ -119,6 +123,20 @@
-               }
-       }
-+#ifdef CONFIG_KILLALL5
-+      else if (whichApp == KILLALL5) {
-+              procps_status_t * p;
-+              pid_t myPid=getpid();
-+              while ((p = procps_scan(0)) != 0) {
-+                      if (p->pid != 1 && p->pid != myPid && p->pid != p->ppid) {
-+                              if (kill(p->pid, signo) != 0) {
-+                                      bb_perror_msg( "Could not kill pid '%d'", p->pid);
-+                                      errors++;
-+                              }
-+                      }
-+              }
-+      }
-+#endif
- #ifdef CONFIG_KILLALL
-       else {
-               pid_t myPid=getpid();
diff --git a/obsolete-buildroot/sources/openwrt/busybox/patches/110-telnetd.patch b/obsolete-buildroot/sources/openwrt/busybox/patches/110-telnetd.patch
deleted file mode 100644 (file)
index e95757e..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-diff -urN busybox-1.00-pre8/networking/telnetd.c busybox-1.00-pre8-openwrt/networking/telnetd.c
---- busybox-1.00-pre8/networking/telnetd.c     2004-02-22 03:45:57.000000000 -0600
-+++ busybox-1.00-pre8-openwrt/networking/telnetd.c     2004-03-05 01:32:57.000000000 -0600
-@@ -44,6 +44,8 @@
- #include <arpa/telnet.h>
- #include <ctype.h>
- #include <sys/syslog.h>
-+#include <net/if.h>
-+
- #include "busybox.h"
-@@ -384,11 +386,13 @@
-       int portnbr = 23;
- #endif /* CONFIG_FEATURE_TELNETD_INETD */
-       int c;
-+      char *interface_name = NULL;
-+      struct ifreq interface;
-       static const char options[] =
- #ifdef CONFIG_FEATURE_TELNETD_INETD
--              "f:l:";
--#else /* CONFIG_EATURE_TELNETD_INETD */
--              "f:l:p:";
-+              "i:f:l:";
-+#else /* CONFIG_FEATURE_TELNETD_INETD */
-+              "i:f:l:p:";
- #endif /* CONFIG_FEATURE_TELNETD_INETD */
-       int maxlen, w, r;
-@@ -403,6 +407,9 @@
-                       case 'f':
-                               issuefile = strdup (optarg);
-                               break;
-+                        case 'i':
-+                                interface_name = strdup(optarg);
-+                                break;
-                       case 'l':
-                               loginpath = strdup (optarg);
-                               break;
-@@ -442,6 +449,13 @@
-       sa.sin_family = AF_INET;
-       sa.sin_port = htons(portnbr);
-+        /* Set it to listen on the specified interface */
-+        if (interface_name) {
-+                strncpy(interface.ifr_ifrn.ifrn_name, interface_name, IFNAMSIZ);
-+                (void)setsockopt(master_fd, SOL_SOCKET,
-+                                SO_BINDTODEVICE, &interface, sizeof(interface));
-+        }
-+
-       if (bind(master_fd, (struct sockaddr *) &sa, sizeof(sa)) < 0) {
-               bb_perror_msg_and_die("bind");
-       }
diff --git a/obsolete-buildroot/sources/openwrt/busybox/patches/120-no_login_for_telnetd.patch b/obsolete-buildroot/sources/openwrt/busybox/patches/120-no_login_for_telnetd.patch
deleted file mode 100644 (file)
index 3c31f1a..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ur busybox.orig/networking/Config.in busybox/networking/Config.in
---- busybox.orig/networking/Config.in  2004-09-23 22:08:46.000000000 +0200
-+++ busybox/networking/Config.in       2004-10-31 20:09:54.622922408 +0100
-@@ -492,7 +492,7 @@
- config CONFIG_TELNETD
-       bool "telnetd"
-       default n
--      select CONFIG_LOGIN
-+      #select CONFIG_LOGIN
-       help
-         A daemon for the TELNET protocol, allowing you to log onto the host
-         running the daemon.  Please keep in mind that the TELNET protocol
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/chillispot/CONTROL/conffiles b/obsolete-buildroot/sources/openwrt/ipkg/chillispot/CONTROL/conffiles
deleted file mode 100644 (file)
index 0848516..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/etc/chilli.conf
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/chillispot/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/chillispot/CONTROL/control
deleted file mode 100644 (file)
index bfd434f..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Package: chillispot
-Priority: optional
-Section: net
-Version: TBDL
-Architecture: TBDL
-Maintainer: Nico <nthill@free.fr>
-Source: http://openwrt.org/cgi-bin/viewcvs.cgi/buildroot/
-Description: a wireless access point controller
-Depends: kmod-tun
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/chillispot/root/etc/init.d/chilli b/obsolete-buildroot/sources/openwrt/ipkg/chillispot/root/etc/init.d/chilli
deleted file mode 100644 (file)
index 785784c..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-case $1 in
- start)
-  insmod tun >/dev/null 2>&1
-  [ -d /var/run ] || mkdir -p /var/run
-  /usr/sbin/chilli
-  ;;
- stop)
-  [ -f /var/run/chilli.pid ] && kill $(cat /var/run/chilli.pid) >/dev/null 2>&1
-  ;;
- *)
-  echo "usage: $0 (start|stop)"
-  exit 1
-esac
-
-exit $?
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/dhcp-fwd/CONTROL/conffiles b/obsolete-buildroot/sources/openwrt/ipkg/dhcp-fwd/CONTROL/conffiles
deleted file mode 100644 (file)
index 70be85a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/etc/dhcp-fwd.conf
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/dhcp-fwd/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/dhcp-fwd/CONTROL/control
deleted file mode 100644 (file)
index 0de5353..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-Package: dhcp-fwd
-Priority: optional
-Section: net
-Version: TBDL
-Architecture: TBDL
-Maintainer: Nico <nthill@free.fr>
-Source: http://openwrt.org/cgi-bin/viewcvs.cgi/buildroot/
-Description: a DHCP relay agent
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/dhcp-fwd/root/etc/dhcp-fwd.conf b/obsolete-buildroot/sources/openwrt/ipkg/dhcp-fwd/root/etc/dhcp-fwd.conf
deleted file mode 100644 (file)
index 15514e3..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-## $Id$
-
-## This file contains a sample configuration for the network shown
-## below:
-##
-##  --------------              ----------              -------------
-## |  DHCP Server |            |          |            |             |
-## | 192.168.8.66 |------<eth1>| dhcp-fwd |<eth2>------|   Clients   |
-## |              |            |          |            |             |
-##  --------------              ----------              -------------
-##  
-## By default, the dhcp-fwd agent looks at /etc/dhcp-fwd.conf
-## for this file. By using the '-c' option when calling dhcp-fwd, this
-## path can be changed.
-
-
-######### ENVIRONMENT SETTINGS #########
-####
-###
-## The server will drop its privileges and goes into a chroot-jail
-## after doing its initialization. The following parameters are
-## defining the needed parameters:
-
-## User and group names/ids. It can be a numeric id or a resolvable
-## alphanumeric-name.
-##
-## WARNING: when compiled with dietlibc the user-/group-names must be
-##          resolvable by files-NSS. LDAP or NIS NSS will not work so
-##          the numeric ids must be used
-user           daemon
-group          daemon
-
-## chroot() path
-chroot         /var/run/dhcp-fwd
-
-## Logfile and loglevel. The logfile-location is relatively to the
-## directory where dhcp-fwd was started and not to the chroot-directory.
-##
-## The loglevel option is not supported yet.
-logfile                /var/log/dhcp-fwd.log
-loglevel       1
-
-## SysV pidfile; contains the PID of the daemon-process and will be
-## written with root-privileges
-pidfile                /var/run/dhcp-fwd.pid
-
-
-## Set limit for resources. When using much interfaces or servers
-## below you will need to increase some values. Same holds when not
-## using dietlibc. Use '-1' as the value to disable the upper limit
-## for the given resource.
-##
-## Look into /proc/<pid>/status to find out the real usage of the
-## resources.
-ulimit core    0
-ulimit stack   64K
-ulimit data    32K
-ulimit rss     200K
-ulimit nproc   0
-ulimit nofile  0
-ulimit as      0
-
-
-######### INTERFACE SETTINGS #########
-####
-###
-## The interface where the forwarder listens for messages. There must
-## be specified BOTH the server-side and client-side interfaces!
-##
-## Each interface will be identified by its system-wide name
-## (e.g. eth0). After this it must be told whether there are
-## clients and servers, and if it is allowed to send broadcast
-## messages to clients. The bcast flags will be IGNORED when
-## forwarding messages to servers.
-
-#      IFNAME  clients servers bcast
-if     eth2    true    false   true
-if     eth1    false   true    true
-
-
-## Each interface can be given an RFC 3046 agent ID. The 'name' config
-## option sets this value; if an interface is not specified here, the
-## IFNAME will be assumed.
-
-#      IFNAME  agent-id
-name   eth2    ws-c
-
-
-## Each interface can be given an specific IP to be filled into the
-## 'giaddr' field.
-##
-## BEWARE: because the outgoing DHCP message will contain the "normal" IP
-## address of the outgoing-interface in its IP-header, some additional
-## work in the system must be done. You can e.g. add an iptables rule to
-## the 'nat' table similarly to this:
-##
-## | Chain POSTROUTING (policy ACCEPT)
-## | target     prot opt source               destination         
-## | SNAT       udp  --  192.168.0.6          192.168.8.66       udp spt:68 dpt:67 to:192.168.2.255 
-
-# ip   eth0    192.168.2.255
-
-
-######### SERVER SETTINGS #########
-####
-###
-## Definitions of the servers. There must be told the type ('ip' or
-## 'bcast') and the address. When using 'ip', the address is a non-bcast
-## IPv4 address (dotted, DNS-names are NOT supported); and when using
-## 'bcast' servers, the address is an IFNAME.
-
-#      TYPE    address
-server ip      192.168.8.66
-#server        bcast   eth1
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/dhcp-fwd/root/etc/init.d/dhcp-fwd b/obsolete-buildroot/sources/openwrt/ipkg/dhcp-fwd/root/etc/init.d/dhcp-fwd
deleted file mode 100644 (file)
index 597e1fc..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-case $1 in
- start)
-  [ -d /var/log ] || mkdir -p /var/log
-  [ -d /var/run/dhcp-wfd ] || mkdir -p /var/run/dhcp-fwd
-  dhcp-fwd
-  ;;
- stop)
-  [ -f /var/run/dhcpd-fwd.pid ] && kill $(cat /var/run/dhcpd-fwd.pid) 2>/dev/null
-  ;;
- *)
-  echo "usage: $0 (start|stop)"
-  exit 1
-esac
-
-exit $?
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/dropbear/CONTROL/conffiles b/obsolete-buildroot/sources/openwrt/ipkg/dropbear/CONTROL/conffiles
deleted file mode 100644 (file)
index 917cdba..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/etc/init.d/S51dropbear
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/dropbear/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/dropbear/CONTROL/control
deleted file mode 100644 (file)
index 5af874e..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Package: dropbear
-Version: 0.44-1
-Architecture: mipsel
-Maintainer: Leigh Dyer <lsd@linuxgamers.net>
-Source: http://matt.ucc.asn.au/dropbear/dropbear-0.44.tar.bz2
-Section: net
-Priority: optional
-Depends:
-Description: Lightweight SSH client and server system
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/dropbear/CONTROL/postinst b/obsolete-buildroot/sources/openwrt/ipkg/dropbear/CONTROL/postinst
deleted file mode 100755 (executable)
index bfe8b47..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-echo
-mkdir -p /etc/dropbear
-[ ! -f /etc/dropbear/dropbear_dss_host_key ] && { 
-/tmp/dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key
-}
-rm /tmp/dropbearkey
-[ ! -f /etc/passwd ] && {
-cat > /etc/passwd << EOF
-root::0:0:root:/tmp:/bin/ash
-EOF
-cat > /etc/shells << EOF
-/bin/ash
-EOF
-cat > /etc/group << EOF
-root:*:0:
-EOF
-passwd
-}
-
-cat << EOF
-==========================================
-dropbear is now configured to run on boot.
-==========================================
-To start it now, run the following command:
-
-/usr/bin/dropbear
-
-EOF
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/dropbear/S51dropbear b/obsolete-buildroot/sources/openwrt/ipkg/dropbear/S51dropbear
deleted file mode 100755 (executable)
index e9c237b..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-/usr/bin/dropbear
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/dropbear/dropbear.patch b/obsolete-buildroot/sources/openwrt/ipkg/dropbear/dropbear.patch
deleted file mode 100644 (file)
index 6a45edd..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -bBurN dropbear-0.44/options.h dropbear-0.44-openwrt/options.h
---- dropbear-0.44/options.h    2005-01-03 10:24:03.000000000 +0100
-+++ dropbear-0.44-openwrt/options.h    2005-01-14 13:19:38.902029040 +0100
-@@ -139,7 +139,7 @@
-  * will prevent Dropbear from blocking on the device. This could
-  * however significantly reduce the security of your ssh connections
-  * if the PRNG state becomes simpler. */
--#define DROPBEAR_RANDOM_DEV "/dev/random"
-+#define DROPBEAR_RANDOM_DEV "/dev/urandom"
- /* prngd must be manually set up to produce output */
- /*#define DROPBEAR_PRNGD_SOCKET "/var/run/dropbear-rng"*/
-@@ -188,7 +188,7 @@
- #define DROPBEAR_VERSION "0.44"
- #endif
--#define LOCAL_IDENT "SSH-2.0-dropbear_" DROPBEAR_VERSION
-+#define LOCAL_IDENT "SSH-2.0-OpenSSH"
- #define PROGNAME "dropbear"
- /* Spec recommends after one hour or 1 gigabyte of data. One hour
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/fprobe/CONTROL/conffiles b/obsolete-buildroot/sources/openwrt/ipkg/fprobe/CONTROL/conffiles
deleted file mode 100644 (file)
index d498dc4..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/etc/fprobe.conf
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/fprobe/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/fprobe/CONTROL/control
deleted file mode 100644 (file)
index d17142d..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Package: fprobe
-Priority: optional
-Section: net
-Version: TBDL
-Architecture: TBDL
-Maintainer: Nico <nthill@free.fr>
-Source: http://openwrt.org/cgi-bin/viewcvs.cgi/buildroot/
-Description: a NetFlow probe
-Depends: libpcap, libpthread
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/fprobe/root/etc/fprobe.conf b/obsolete-buildroot/sources/openwrt/ipkg/fprobe/root/etc/fprobe.conf
deleted file mode 100644 (file)
index 3abfba6..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-# Interface to listen on
-IFNAME=any
-
-# NetFlow collector (host:port)
-REMOTE=192.168.1.100:2055
-
-# Maximum log level (0=EMERG, 1=ALERT, 2=CRIT, 3=ERR, 4=WARNING, 5=NOTICE, 6=INFO, 7=DEBUG)
-LOG_LEVEL=3
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/fprobe/root/etc/init.d/fprobe b/obsolete-buildroot/sources/openwrt/ipkg/fprobe/root/etc/init.d/fprobe
deleted file mode 100644 (file)
index 2a61fce..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-DEFAULT=/etc/fprobe.conf
-OPTIONS=""
-[ -f $DEFAULT ] && . $DEFAULT
-[ -n "$IFNAME" ] && OPTIONS="$OPTIONS -i $IFNAME"
-[ -n "$LOG_LEVEL" ] && OPTIONS="$OPTIONS -v $LOG_LEVEL"
-[ -n "$REMOTE" ] && OPTIONS="$OPTIONS $REMOTE"
-
-case $1 in
- start)
-  [ -d /var/run ] || mkdir -p /var/run
-  /usr/sbin/fprobe $OPTIONS
-  ;;
- stop)
-  [ -f /var/run/fprobe.pid ] && kill $(cat /var/run/fprobe.pid) >/dev/null 2>&1
-  ;;
- *)
-  echo "usage: $0 (start|stop)"
-  exit 1
-esac
-
-exit $?
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/ip6tables/ip6tables.control b/obsolete-buildroot/sources/openwrt/ipkg/ip6tables/ip6tables.control
deleted file mode 100644 (file)
index adeb5b3..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Package: ip6tables
-Architecture: mipsel
-Version: 1.2.11-1
-Section: net
-Priority: optional
-Maintainer: Sebastien NOEL <me@twolife.org>
-Source: Embedded in the main OpenWrt buildroot
-Depends: kmod-ipv6, kmod-ipt6
-Description: Linux kernel 2.4+ IPv6 packet filter administration tools
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/iproute/ip/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/iproute/ip/CONTROL/control
deleted file mode 100644 (file)
index ed54f31..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Package: ip
-Architecture: mipsel
-Version: 2.0
-Section: net
-Priority: optional
-Maintainer: Gerry Rozema <gerryr@rozeware.bc.ca>
-Source: http://ftp.debian.org/debian/pool/main/i/iproute/iproute-20010824.orig.tar.gz 
-Depends:
-Description: iproute2 stuff
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/iproute/tc/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/iproute/tc/CONTROL/control
deleted file mode 100644 (file)
index b14e7c4..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Package: tc
-Architecture: mipsel
-Version: 2.0
-Section: net
-Priority: optional
-Maintainer: Gerry Rozema <gerryr@rozeware.bc.ca>
-Source: http://ftp.debian.org/debian/pool/main/i/iproute/iproute-20010824.orig.tar.gz 
-Depends: kmod-sched
-Description: iproute2 stuff
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/kmod-ipt6/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/kmod-ipt6/CONTROL/control
deleted file mode 100644 (file)
index 957732b..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Package: kmod-ipt6
-Architecture: mipsel
-Version: 2.4.20-1
-Section: kernel
-Priority: optional
-Maintainer: Sebastien NOEL <me@twolife.org>
-Source: Embedded in the main OpenWrt buildroot
-Depends: kmod-ipv6, ip6tables
-Description: ip6tables kernel modules
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/kmod-ipt6/CONTROL/rules b/obsolete-buildroot/sources/openwrt/ipkg/kmod-ipt6/CONTROL/rules
deleted file mode 100755 (executable)
index 82afed8..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/make -f
-
-ifeq ($(strip $(TOPDIR)),)
-TOPDIR := $(shell pwd)/../../../..
-endif
-
-
-PACKAGE := kmod-ipt6
-
-MY_INSTALL_DIR := /tmp/$(PACKAGE)
-
-
-build:
-
-
-install:
-       rm -rf $(MY_INSTALL_DIR)
-       install -m0755 -d $(MY_INSTALL_DIR)/lib/
-       bzcat $(TOPDIR)/openwrt-kmodules.tar.bz2 | tar -C $(MY_INSTALL_DIR)/lib/ -xvf - \
-        modules/2.4.20/kernel/net/ipv6/netfilter/*.o \
-       
-       install -m0755 -d $(MY_INSTALL_DIR)/lib/modules/2.4.20/ipt6
-       mv -f \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/kernel/net/ipv6/netfilter/*.o \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/ipt6/
-       
-       rm -rf \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/kernel
-
-
-clean:
-
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/kmod-ipt6/kmod-ipt6.control b/obsolete-buildroot/sources/openwrt/ipkg/kmod-ipt6/kmod-ipt6.control
deleted file mode 100644 (file)
index 957732b..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Package: kmod-ipt6
-Architecture: mipsel
-Version: 2.4.20-1
-Section: kernel
-Priority: optional
-Maintainer: Sebastien NOEL <me@twolife.org>
-Source: Embedded in the main OpenWrt buildroot
-Depends: kmod-ipv6, ip6tables
-Description: ip6tables kernel modules
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/kmod-ipv6/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/kmod-ipv6/CONTROL/control
deleted file mode 100644 (file)
index fdeb1c7..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Package: kmod-ipv6
-Architecture: mipsel
-Version: 2.4.20-1
-Section: kernel
-Priority: optional
-Maintainer: Sebastien NOEL <me@twolife.org>
-Source: Embedded in the main OpenWrt buildroot
-Depends:
-Description: Kernel modules for the IPv6 protocol
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/kmod-ipv6/CONTROL/rules b/obsolete-buildroot/sources/openwrt/ipkg/kmod-ipv6/CONTROL/rules
deleted file mode 100755 (executable)
index a1e8111..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/make -f
-
-ifeq ($(strip $(TOPDIR)),)
-TOPDIR := $(shell pwd)/../../../..
-endif
-
-
-PACKAGE := kmod-ipv6
-
-MY_INSTALL_DIR := /tmp/$(PACKAGE)
-
-
-build:
-
-
-install:
-       rm -rf $(MY_INSTALL_DIR)
-       install -m0755 -d $(MY_INSTALL_DIR)/lib/
-       bzcat $(TOPDIR)/openwrt-kmodules.tar.bz2 | tar -C $(MY_INSTALL_DIR)/lib/ -xvf - \
-        modules/2.4.20/kernel/net/ipv6/ipv6.o \
-       
-       mv -f \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/kernel/net/ipv6/ipv6.o \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/
-        
-       rm -rf \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/kernel
-
-
-clean:
-
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/kmod-ipv6/kmod-ipv6.control b/obsolete-buildroot/sources/openwrt/ipkg/kmod-ipv6/kmod-ipv6.control
deleted file mode 100644 (file)
index fdeb1c7..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Package: kmod-ipv6
-Architecture: mipsel
-Version: 2.4.20-1
-Section: kernel
-Priority: optional
-Maintainer: Sebastien NOEL <me@twolife.org>
-Source: Embedded in the main OpenWrt buildroot
-Depends:
-Description: Kernel modules for the IPv6 protocol
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/kmod-nfs/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/kmod-nfs/CONTROL/control
deleted file mode 100644 (file)
index 87cf409..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-Package: kmod-nfs
-Priority: optional
-Section: kernel
-Version: 2.4.20-1
-Architecture: mipsel
-Maintainer: Nico <nthill@free.fr>
-Source: http://openwrt.org/cgi-bin/viewcvs.cgi/buildroot/
-Description: NFS kernel modules
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/kmod-nfs/CONTROL/postinst b/obsolete-buildroot/sources/openwrt/ipkg/kmod-nfs/CONTROL/postinst
deleted file mode 100644 (file)
index 1371a39..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-cat << EOF
-
-
-Using the nfs modules:
- insmod sunrpc
- insmod lockd
- insmod nfs
- mount server:/mnt /mnt -o nolock
-
-If you do not specify nolock the mount process will hang
-until rpciod is killed. (killall -9 rpciod)
-
-- press enter -
-EOF
-read
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/kmod-nfs/CONTROL/rules b/obsolete-buildroot/sources/openwrt/ipkg/kmod-nfs/CONTROL/rules
deleted file mode 100755 (executable)
index 94129b7..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/make -f
-
-ifeq ($(strip $(TOPDIR)),)
-TOPDIR := $(shell pwd)/../../../..
-endif
-
-
-PACKAGE := kmod-nfs
-
-MY_INSTALL_DIR := /tmp/$(PACKAGE)
-
-
-build:
-
-
-install:
-       rm -rf $(MY_INSTALL_DIR)
-       install -m0755 -d $(MY_INSTALL_DIR)/lib/
-       bzcat $(TOPDIR)/openwrt-kmodules.tar.bz2 | tar -C $(MY_INSTALL_DIR)/lib/ -xvf - \
-        modules/2.4.20/kernel/fs/lockd/lockd.o \
-        modules/2.4.20/kernel/fs/nfs/nfs.o \
-        modules/2.4.20/kernel/net/sunrpc/sunrpc.o \
-        
-       mv -f \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/kernel/fs/lockd/*.o \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/
-       mv -f \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/kernel/fs/nfs/*.o \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/
-       mv -f \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/kernel/net/sunrpc/*.o \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/
-        
-       rm -rf \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/kernel
-
-
-clean:
-
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/kmod-ppp-async/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/kmod-ppp-async/CONTROL/control
deleted file mode 100644 (file)
index 108ae2b..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-Package: kmod-ppp-async
-Priority: optional
-Section: kernel
-Version: 2.4.20-1
-Architecture: mipsel
-Maintainer: Nico <nthill@free.fr>
-Source: http://openwrt.org/cgi-bin/viewcvs.cgi/buildroot/
-Description: PPP async serial channel driver kernel module
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/kmod-ppp-async/CONTROL/rules b/obsolete-buildroot/sources/openwrt/ipkg/kmod-ppp-async/CONTROL/rules
deleted file mode 100755 (executable)
index 7e137ed..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/make -f
-
-ifeq ($(strip $(TOPDIR)),)
-TOPDIR := $(shell pwd)/../../../..
-endif
-
-
-PACKAGE := kmod-ppp-async
-
-MY_INSTALL_DIR := /tmp/$(PACKAGE)
-
-
-build:
-
-
-install:
-       rm -rf $(MY_INSTALL_DIR)
-       install -m0755 -d $(MY_INSTALL_DIR)/lib/
-       bzcat $(TOPDIR)/openwrt-kmodules.tar.bz2 | tar -C $(MY_INSTALL_DIR)/lib/ -xvf - \
-        modules/2.4.20/kernel/drivers/net/ppp_async.o \
-        
-       mv -f \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/kernel/drivers/net/ppp_async.o \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/
-        
-       rm -rf \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/kernel
-
-
-clean:
-
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/kmod-ppp-mppe-mppc/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/kmod-ppp-mppe-mppc/CONTROL/control
deleted file mode 100644 (file)
index fb668fd..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-Package: kmod-ppp-mppe-mppc
-Priority: optional
-Section: kernel
-Version: 2.4.20-1
-Architecture: mipsel
-Maintainer: Nico <nthill@free.fr>
-Source: http://openwrt.org/cgi-bin/viewcvs.cgi/buildroot/
-Description: Microsoft PPP compression/encryption (MPPC/MPPE) kernel module
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/kmod-ppp-mppe-mppc/CONTROL/rules b/obsolete-buildroot/sources/openwrt/ipkg/kmod-ppp-mppe-mppc/CONTROL/rules
deleted file mode 100755 (executable)
index df16839..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/make -f
-
-ifeq ($(strip $(TOPDIR)),)
-TOPDIR := $(shell pwd)/../../../..
-endif
-
-
-PACKAGE := kmod-ppp-mppe-mppc
-
-MY_INSTALL_DIR := /tmp/$(PACKAGE)
-
-
-build:
-
-
-install:
-       rm -rf $(MY_INSTALL_DIR)
-       install -m0755 -d $(MY_INSTALL_DIR)/lib/
-       bzcat $(TOPDIR)/openwrt-kmodules.tar.bz2 | tar -C $(MY_INSTALL_DIR)/lib/ -xvf - \
-        modules/2.4.20/kernel/drivers/net/ppp_mppe_mppc.o \
-        
-       mv -f \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/kernel/drivers/net/ppp_mppe_mppc.o \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/
-        
-       rm -rf \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/kernel
-
-
-clean:
-
-
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/kmod-sched/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/kmod-sched/CONTROL/control
deleted file mode 100644 (file)
index f7669af..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-Package: kmod-sched
-Priority: optional
-Section: kernel
-Version: 2.4.20-1
-Architecture: mipsel
-Maintainer: Nico <nthill@free.fr>
-Source: http://openwrt.org/cgi-bin/viewcvs.cgi/buildroot/
-Description: Traffic Control (TC) kernel modules
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/kmod-sched/CONTROL/rules b/obsolete-buildroot/sources/openwrt/ipkg/kmod-sched/CONTROL/rules
deleted file mode 100755 (executable)
index bf3e6b4..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/make -f
-
-ifeq ($(strip $(TOPDIR)),)
-TOPDIR := $(shell pwd)/../../../..
-endif
-
-
-PACKAGE := kmod-sched
-
-MY_INSTALL_DIR := /tmp/$(PACKAGE)
-
-
-build:
-
-
-install:
-       rm -rf $(MY_INSTALL_DIR)
-       install -m0755 -d $(MY_INSTALL_DIR)/lib/
-       bzcat $(TOPDIR)/openwrt-kmodules.tar.bz2 | tar -C $(MY_INSTALL_DIR)/lib/ -xvf - \
-        modules/2.4.20/kernel/net/sched/*.o \
-        
-       install -m0755 -d $(MY_INSTALL_DIR)/lib/modules/2.4.20/sched
-       mv -f \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/kernel/net/sched/*.o \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/sched/
-        
-       rm -rf \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/kernel
-
-
-clean:
-
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/kmod-tun/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/kmod-tun/CONTROL/control
deleted file mode 100644 (file)
index 3c9ab98..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-Package: kmod-tun
-Priority: optional
-Section: kernel
-Version: 2.4.20-1
-Architecture: mipsel
-Maintainer: Nico <nthill@free.fr>
-Source: http://openwrt.org/cgi-bin/viewcvs.cgi/buildroot/
-Description: Universal TUN/TAP device driver kernel module
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/kmod-tun/CONTROL/rules b/obsolete-buildroot/sources/openwrt/ipkg/kmod-tun/CONTROL/rules
deleted file mode 100755 (executable)
index 58e95f7..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/make -f
-
-ifeq ($(strip $(TOPDIR)),)
-TOPDIR := $(shell pwd)/../../../..
-endif
-
-
-PACKAGE := kmod-tun
-
-MY_INSTALL_DIR := /tmp/$(PACKAGE)
-
-
-build:
-
-
-install:
-       rm -rf $(MY_INSTALL_DIR)
-       install -m0755 -d $(MY_INSTALL_DIR)/lib/
-       bzcat $(TOPDIR)/openwrt-kmodules.tar.bz2 | tar -C $(MY_INSTALL_DIR)/lib/ -xvf - \
-        modules/2.4.20/kernel/drivers/net/tun.o \
-        
-       mv -f \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/kernel/drivers/net/tun.o \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/
-        
-       rm -rf \
-        $(MY_INSTALL_DIR)/lib/modules/2.4.20/kernel
-
-
-clean:
-
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/libmatrixssl/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/libmatrixssl/CONTROL/control
deleted file mode 100644 (file)
index a417b42..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Package: libmatrixssl
-Priority: optional
-Section: libs
-Version: TBDL
-Architecture: TBDL
-Maintainer: Nico
-Source: http://openwrt.org/cgi-bin/viewcvs.cgi/buildroot/
-Description: an embedded SSL implementation
-Depends: libpthread
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/libpcap/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/libpcap/CONTROL/control
deleted file mode 100644 (file)
index 3ea09b3..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-Package: libpcap
-Priority: optional
-Section: libs
-Version: TBDL
-Architecture: TBDL
-Maintainer: Nico <nthill@free.fr>
-Source: http://openwrt.org/cgi-bin/viewcvs.cgi/buildroot/
-Description: a low-level packet capture library
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/libpthread/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/libpthread/CONTROL/control
deleted file mode 100644 (file)
index fa1bea0..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-Package: libpthread
-Priority: optional
-Section: libs
-Version: 0.9.27-1
-Architecture: mipsel
-Maintainer: Nico <nthill@free.fr>
-Source: http://openwrt.org/cgi-bin/viewcvs.cgi/buildroot/
-Description: POSIX threads library
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/libpthread/CONTROL/rules b/obsolete-buildroot/sources/openwrt/ipkg/libpthread/CONTROL/rules
deleted file mode 100755 (executable)
index b538467..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/make -f
-
-ifeq ($(strip $(TOPDIR)),)
-TOPDIR := $(shell pwd)/../../../..
-endif
-
-
-# variables extracted from $(TOPDIR)/Makefile
-ARCH:= mipsel
-STAGING_DIR=$(TOPDIR)/build_$(ARCH)/staging_dir
-REAL_GNU_TARGET_NAME=$(ARCH)-linux-uclibc
-TARGET_CROSS=$(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-
-STRIP=$(TARGET_CROSS)strip --remove-section=.comment --remove-section=.note
-# could be better if replaced with:
-#include $(TOPDIR)/Config
-
-
-PACKAGE := libpthread
-
-MY_INSTALL_DIR := /tmp/$(PACKAGE)
-
-
-build:
-
-
-install:
-       rm -rf $(MY_INSTALL_DIR)
-       install -m0755 -d $(MY_INSTALL_DIR)/lib
-       install -m0755 $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libpthread-0.9.27.so $(MY_INSTALL_DIR)/lib
-       $(STRIP) $(MY_INSTALL_DIR)/lib/libpthread*.so*
-       ln -fs libpthread-0.9.27.so $(MY_INSTALL_DIR)/lib/libpthread.so.0
-
-clean:
-
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/ntpclient/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/ntpclient/CONTROL/control
deleted file mode 100644 (file)
index 30194d1..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Package: ntpclient
-Architecture: mipsel
-Version: 2003.194-1
-Section: utils
-Priority: optional
-Maintainer: Sebastien NOEL <me@twolife.org>
-Source: http://doolittle.faludi.com/ntpclient/
-Depends:
-Description: utility to setting system time from NTP server
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.client.conffiles b/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.client.conffiles
deleted file mode 100644 (file)
index cb3c639..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/etc/ssh_config
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.client.control b/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.client.control
deleted file mode 100644 (file)
index 3585250..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-Package: openssh-client
-Priority: optional
-Version: 3.8p1-1
-Architecture: mipsel
-Maintainer: below0
-Section: net
-Depends: zlib libssl
-Source: Embedded in the main OpenWrt buildroot
-Description: The OpenSSH client. Allows for access to remote systems via the SSH protocol.
- Includes: ssh, scp
-
-
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.client.ex.control b/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.client.ex.control
deleted file mode 100644 (file)
index 5eb808a..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-Package: openssh-client-extras
-Priority: optional
-Version: 3.8p1-1
-Architecture: mipsel
-Maintainer: below0
-Section: net
-Depends: openssh-client
-Source: Embedded in the main OpenWrt buildroot
-Description: Various optional OpenSSH client tools.
- Includes: ssh-add, ssh-agent, ssh-keyscan, ssk-keysign
-
-
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.client.preinst b/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.client.preinst
deleted file mode 100644 (file)
index 029c789..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-# Make sure password and group databases exist
-if [ ! -f /etc/passwd ]; then
-   echo -e "root::0:0::/tmp:/bin/sh\nnobody:x:65534:65534:nobody:/tmp:/bin/sh\nsshd:x:100:65534:sshd:/var:/bin/false\n" > /etc/passwd
-   [ -f /etc/group ] || echo -e "root:x:0:\nnogroup:x:65534:\n" > /etc/group
-   echo "\n\nNOTICE: SSH requires proper root password to be configured, set it now."
-   passwd
-fi
-                
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.client.ssh_config b/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.client.ssh_config
deleted file mode 100644 (file)
index 2692e89..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#      $OpenBSD: ssh_config,v 1.19 2003/08/13 08:46:31 markus Exp $
-
-# This is the ssh client system-wide configuration file.  See
-# ssh_config(5) for more information.  This file provides defaults for
-# users, and the values can be changed in per-user configuration files
-# or on the command line.
-
-# Configuration data is parsed as follows:
-#  1. command line options
-#  2. user-specific file
-#  3. system-wide file
-# Any configuration value is only changed the first time it is set.
-# Thus, host-specific definitions should be at the beginning of the
-# configuration file, and defaults at the end.
-
-# Site-wide defaults for various options
-
-# Host *
-#   ForwardAgent no
-#   ForwardX11 no
-#   RhostsRSAAuthentication no
-#   RSAAuthentication yes
-#   PasswordAuthentication yes
-#   HostbasedAuthentication no
-#   BatchMode no
-#   CheckHostIP yes
-#   AddressFamily any
-#   ConnectTimeout 0
-#   StrictHostKeyChecking ask
-#   IdentityFile ~/.ssh/identity
-#   IdentityFile ~/.ssh/id_rsa
-#   IdentityFile ~/.ssh/id_dsa
-#   Port 22
-#   Protocol 2,1
-#   Cipher 3des
-#   Ciphers aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
-#   EscapeChar ~
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.patch b/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.patch
deleted file mode 100644 (file)
index 7d85a04..0000000
+++ /dev/null
@@ -1,289 +0,0 @@
---- openssh-3.6.1p1/Makefile.in.orig   2003-03-20 17:34:34.000000000 -0700
-+++ openssh-3.6.1p1/Makefile.in        2003-04-25 17:09:00.000000000 -0600
-@@ -27,7 +27,7 @@
- RAND_HELPER=$(libexecdir)/ssh-rand-helper
- PRIVSEP_PATH=@PRIVSEP_PATH@
- SSH_PRIVSEP_USER=@SSH_PRIVSEP_USER@
--STRIP_OPT=@STRIP_OPT@
-+STRIP_OPT=
- PATHS= -DSSHDIR=\"$(sysconfdir)\" \
-       -D_PATH_SSH_PROGRAM=\"$(SSH_PROGRAM)\" \
---- openssh-3.8p1/configure.ac.orig    2004-02-23 22:47:04.000000000 -0700
-+++ openssh-3.8p1/configure.ac 2004-03-19 01:41:47.000000000 -0700
-@@ -481,6 +481,9 @@
-       [
-               AC_MSG_RESULT(no)
-               AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
-+      ],
-+      [AC_MSG_RESULT(yes)
-+      AC_MSG_WARN([Cannot run test when crosscompiling, defaulted to yes.])
-       ]
- )
-@@ -632,6 +635,9 @@
-         else
-               AC_MSG_WARN([zlib version may have security problems])
-         fi
-+      ],
-+      [AC_MSG_RESULT(yes)
-+      AC_MSG_WARN([Cannot run test when crosscompiling, defaulted to yes.])
-       ]
- )
-@@ -696,6 +702,9 @@
-       [
-               AC_MSG_RESULT(no)
-               AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
-+      ],
-+      [AC_MSG_RESULT(yes)
-+      AC_MSG_WARN([Cannot run test when crosscompiling, defaulted to yes.])
-       ]
- )
-@@ -727,6 +736,9 @@
-                               [
-                                       AC_MSG_RESULT(no)
-                                       AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
-+                              ],
-+                              [AC_MSG_RESULT(yes)
-+                              AC_MSG_WARN([Cannot run test when crosscompiling, defaulted to yes.])
-                               ])
-               fi
-       ]
-@@ -840,7 +852,11 @@
-               ],
-               [AC_MSG_RESULT(yes)],
-               [AC_DEFINE(BROKEN_SETRESUID)
--               AC_MSG_RESULT(not implemented)]
-+               AC_MSG_RESULT(not implemented)
-+               ],
-+               [AC_MSG_RESULT(yes)
-+               AC_MSG_WARN([Cannot run test when crosscompiling, defaulted to yes.])
-+               ]
-       )
- ])
-@@ -854,7 +870,11 @@
-               ],
-               [AC_MSG_RESULT(yes)],
-               [AC_DEFINE(BROKEN_SETRESGID)
--               AC_MSG_RESULT(not implemented)]
-+               AC_MSG_RESULT(not implemented)
-+               ],
-+               [AC_MSG_RESULT(yes)
-+               AC_MSG_WARN([Cannot run test when crosscompiling, defaulted to yes.])
-+               ]
-       )
- ])
-@@ -890,6 +910,9 @@
-                       AC_MSG_RESULT(no)
-                       AC_DEFINE(BROKEN_SNPRINTF)
-                       AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
-+              ],
-+              [AC_MSG_RESULT(yes)
-+              AC_MSG_WARN([Cannot run test when crosscompiling, defaulted to yes.])
-               ]
-       )
- fi
-@@ -963,7 +986,10 @@
-               [
-                       AC_MSG_RESULT(no)
-                       AC_DEFINE(SSHD_ACQUIRES_CTTY)
--              ]
-+              ],
-+               [AC_MSG_RESULT(yes)
-+               AC_MSG_WARN([Cannot run test when crosscompiling, defaulted to yes.])
-+               ]
-       )
- fi
-@@ -1096,6 +1122,10 @@
-       [
-               AC_MSG_RESULT(not found)
-               AC_MSG_ERROR(OpenSSL version header not found.)
-+      ],
-+      [
-+              ssl_header_ver="0x0090704fL (OpenSSL 0.9.7d 17 Mar 2004)"
-+              AC_MSG_WARN([Cannot run test when crosscompiling, defaulted to $ssl_header_ver])
-       ]
- )
-@@ -1129,6 +1159,10 @@
-       [
-               AC_MSG_RESULT(not found)
-               AC_MSG_ERROR(OpenSSL library not found.)
-+      ],
-+      [
-+              ssl_header_ver="0x0090704fL (OpenSSL 0.9.7d 17 Mar 2004)"
-+              AC_MSG_WARN([Cannot run test when crosscompiling, defaulted to $ssl_library_ver])
-       ]
- )
-@@ -1148,7 +1182,11 @@
-               AC_MSG_ERROR([Your OpenSSL headers do not match your library.
- Check config.log for details.
- Also see contrib/findssl.sh for help identifying header/library mismatches.])
--      ]
-+      ],
-+      [
-+              AC_MSG_RESULT(yes)
-+              AC_MSG_WARN([Cannot run test when crosscompiling, defaulted to yes.])
-+      ]
- )
- # Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
-@@ -1183,6 +1221,11 @@
-               # Default to use of the rand helper if OpenSSL doesn't
-               # seed itself
-               USE_RAND_HELPER=yes
-+      ],
-+      [
-+              OPENSSL_SEEDS_ITSELF=yes
-+              AC_MSG_RESULT(yes)
-+              AC_MSG_WARN([Cannot run test when crosscompiling, defaulted to yes.])
-       ]
- )
-@@ -1773,7 +1816,8 @@
- #else
- main() { exit(0); }
- #endif
--              ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
-+              ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ],
-+              [ true ]
-       )
- fi
-@@ -1893,6 +1937,7 @@
- }
-               ],
-               [ ac_cv_have_accrights_in_msghdr="yes" ],
-+              [ ac_cv_have_accrights_in_msghdr="no" ],
-               [ ac_cv_have_accrights_in_msghdr="no" ]
-       )
- ])
-@@ -1917,7 +1962,8 @@
- }
-               ],
-               [ ac_cv_have_control_in_msghdr="yes" ],
--              [ ac_cv_have_control_in_msghdr="no" ]
-+              [ ac_cv_have_control_in_msghdr="no" ],
-+              [ ac_cv_have_control_in_msghdr="yes" ]
-       )
- ])
- if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
-@@ -2229,12 +2275,9 @@
-               )
-       fi
- fi
--AC_CHECK_FILE("/dev/ptc",
--      [
--              AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
--              have_dev_ptc=1
--      ]
--)
-+AC_MSG_CHECKING([for "/dev/ptc"])
-+AC_MSG_RESULT(no)
-+have_dev_ptc=0
- # Options from here on. Some of these are preset by platform above
- AC_ARG_WITH(mantype,
-@@ -2329,15 +2372,8 @@
- fi
- # check for /etc/default/login and use it if present.
--AC_ARG_ENABLE(etc-default-login,
--      [  --disable-etc-default-login       Disable using PATH from /etc/default/login [no]],,
--[
--AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ])
--
--if test "x$external_path_file" = "x/etc/default/login"; then
--      AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
--fi
--])
-+AC_MSG_CHECKING([for "/etc/default/login"])
-+AC_MSG_RESULT(no)
- dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
- if test $ac_cv_func_login_getcapbool = "yes" -a \
---- openssh-3.8p1.orig/sshd_config     Fri Sep 27 05:21:58 2002
-+++ openssh-3.8p1/sshd_config  Mon Mar 17 14:55:00 2003
-@@ -89,5 +89,8 @@
- #Banner /some/path
- #VerifyReverseMapping no
-+ClientAliveInterval 15
-+ClientAliveCountMax 4
-+
- # override default of no subsystems
--Subsystem     sftp    /usr/libexec/sftp-server
-+Subsystem     sftp    /usr/sbin/sftp-server
---- openssh-3.6.1p1/S50sshd    Fri Sep 27 05:21:58 2002
-+++ openssh-3.6.1p1/S50sshd    Mon Mar 17 14:55:00 2003
-@@ -0,0 +1,64 @@
-+#!/bin/sh
-+#
-+# sshd        Starts sshd.
-+#
-+
-+# Make sure the ssh-keygen progam exists
-+[ -f /usr/bin/ssh-keygen ] || exit 0
-+
-+# Check for the SSH1 RSA key
-+if [ ! -f /etc/ssh_host_key ] ; then
-+      echo Generating RSA Key...
-+      /usr/bin/ssh-keygen -t rsa1 -f /etc/ssh_host_key -C '' -N ''
-+fi
-+
-+# Check for the SSH2 RSA key
-+if [ ! -f /etc/ssh_host_rsa_key ] ; then
-+      echo Generating RSA Key...
-+      /usr/bin/ssh-keygen -t rsa -f /etc/ssh_host_rsa_key -C '' -N ''
-+fi
-+
-+# Check for the SSH2 DSA key
-+if [ ! -f /etc/ssh_host_dsa_key ] ; then
-+      echo Generating DSA Key...
-+      echo THIS CAN TAKE A MINUTE OR TWO DEPENDING ON YOUR PROCESSOR!
-+      echo
-+        /usr/bin/ssh-keygen -t dsa -f /etc/ssh_host_dsa_key -C '' -N ''
-+fi
-+                
-+umask 077
-+
-+start() {
-+      echo -n "Starting sshd: "
-+      /usr/sbin/sshd
-+      touch /var/lock/sshd
-+      echo "OK"
-+}     
-+stop() {
-+      echo -n "Stopping sshd: "
-+        killall       sshd 
-+      rm -f /var/lock/sshd
-+      echo "OK" 
-+}
-+restart() {
-+      stop
-+      start
-+}     
-+
-+case "$1" in
-+  start)
-+      start
-+      ;;
-+  stop)
-+      stop
-+      ;;
-+  restart|reload)
-+      restart
-+      ;;
-+  *)
-+      echo $"Usage: $0 {start|stop|restart}"
-+      exit 1
-+esac
-+
-+exit $?
-+
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.S50sshd-ipk b/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.S50sshd-ipk
deleted file mode 100644 (file)
index 6f77ad9..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/sh
-#
-# sshd        Starts sshd.
-#
-
-mkdir -p /var/lock
-mkdir -p /var/empty
-chmod 600 /var/empty
-
-umask 077
-
-start() {
-       echo -n "Starting sshd: "
-       /usr/sbin/sshd
-       touch /var/lock/sshd
-       echo "OK"
-}      
-stop() {
-       echo -n "Stopping sshd: "
-        killall        sshd 
-       rm -f /var/lock/sshd
-       echo "OK" 
-}
-restart() {
-       stop
-       start
-}      
-
-case "$1" in
-  start)
-       start
-       ;;
-  stop)
-       stop
-       ;;
-  restart|reload)
-       restart
-       ;;
-  *)
-       echo $"Usage: $0 {start|stop|restart}"
-       exit 1
-esac
-
-exit $?
-
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.conffiles b/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.conffiles
deleted file mode 100644 (file)
index 5877b3b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/etc/sshd_config
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.control b/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.control
deleted file mode 100644 (file)
index 943da93..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-Package: openssh-server
-Priority: optional
-Version: 3.8p1-1
-Architecture: mipsel
-Maintainer: below0
-Section: net
-Depends: zlib libssl
-Source: Embedded in the main OpenWrt buildroot
-Description: The OpenSSH server daemon. 
-  Allows for access to the system via the SSH client. 
-  Includes: sshd, ssh-keygen
-
-
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.postinst b/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.postinst
deleted file mode 100644 (file)
index 16d2bf4..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-# Check for the SSH1 RSA key
-if [ ! -f /etc/ssh_host_key ] ; then
-       echo Generating RSA Key...
-       /usr/bin/ssh-keygen -t rsa1 -f /etc/ssh_host_key -C '' -N ''
-fi
-
-# Check for the SSH2 RSA key
-if [ ! -f /etc/ssh_host_rsa_key ] ; then
-       echo Generating RSA Key...
-       /usr/bin/ssh-keygen -t rsa -f /etc/ssh_host_rsa_key -C '' -N ''
-fi
-
-# Check for the SSH2 DSA key
-if [ ! -f /etc/ssh_host_dsa_key ] ; then
-       echo "Generating DSA Key... (Takes a few minutes)"
-        /usr/bin/ssh-keygen -t dsa -f /etc/ssh_host_dsa_key -C '' -N ''
-fi
-                
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.preinst b/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.preinst
deleted file mode 100644 (file)
index 029c789..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-# Make sure password and group databases exist
-if [ ! -f /etc/passwd ]; then
-   echo -e "root::0:0::/tmp:/bin/sh\nnobody:x:65534:65534:nobody:/tmp:/bin/sh\nsshd:x:100:65534:sshd:/var:/bin/false\n" > /etc/passwd
-   [ -f /etc/group ] || echo -e "root:x:0:\nnogroup:x:65534:\n" > /etc/group
-   echo "\n\nNOTICE: SSH requires proper root password to be configured, set it now."
-   passwd
-fi
-                
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.sshd_config b/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.server.sshd_config
deleted file mode 100644 (file)
index 22e5dc2..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-#      $OpenBSD: sshd_config,v 1.68 2003/12/29 16:39:50 millert Exp $
-
-# This is the sshd server system-wide configuration file.  See
-# sshd_config(5) for more information.
-
-# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
-
-# The strategy used for options in the default sshd_config shipped with
-# OpenSSH is to specify options with their default value where
-# possible, but leave them commented.  Uncommented options change a
-# default value.
-
-#Port 22
-#Protocol 2,1
-#ListenAddress 0.0.0.0
-#ListenAddress ::
-
-# HostKey for protocol version 1
-#HostKey /etc/ssh_host_key
-# HostKeys for protocol version 2
-#HostKey /etc/ssh_host_rsa_key
-#HostKey /etc/ssh_host_dsa_key
-
-# Lifetime and size of ephemeral version 1 server key
-#KeyRegenerationInterval 1h
-#ServerKeyBits 768
-
-# Logging
-#obsoletes QuietMode and FascistLogging
-#SyslogFacility AUTH
-#LogLevel INFO
-
-# Authentication:
-
-#LoginGraceTime 2m
-#PermitRootLogin yes
-#StrictModes yes
-
-#RSAAuthentication yes
-#PubkeyAuthentication yes
-#AuthorizedKeysFile    .ssh/authorized_keys
-
-# For this to work you will also need host keys in /etc/ssh_known_hosts
-#RhostsRSAAuthentication no
-# similar for protocol version 2
-#HostbasedAuthentication no
-# Change to yes if you don't trust ~/.ssh/known_hosts for
-# RhostsRSAAuthentication and HostbasedAuthentication
-#IgnoreUserKnownHosts no
-# Don't read the user's ~/.rhosts and ~/.shosts files
-#IgnoreRhosts yes
-
-# To disable tunneled clear text passwords, change to no here!
-#PasswordAuthentication yes
-#PermitEmptyPasswords no
-
-# Change to no to disable s/key passwords
-#ChallengeResponseAuthentication yes
-
-# Kerberos options
-#KerberosAuthentication no
-#KerberosOrLocalPasswd yes
-#KerberosTicketCleanup yes
-#KerberosGetAFSToken no
-
-# GSSAPI options
-#GSSAPIAuthentication no
-#GSSAPICleanupCredentials yes
-
-# Set this to 'yes' to enable PAM authentication (via challenge-response)
-# and session processing. Depending on your PAM configuration, this may
-# bypass the setting of 'PasswordAuthentication' and 'PermitEmptyPasswords'
-#UsePAM no
-
-#AllowTcpForwarding yes
-#GatewayPorts no
-#X11Forwarding no
-#X11DisplayOffset 10
-#X11UseLocalhost yes
-#PrintMotd yes
-#PrintLastLog yes
-#TCPKeepAlive yes
-#UseLogin no
-#UsePrivilegeSeparation yes
-#PermitUserEnvironment no
-#Compression yes
-#ClientAliveInterval 0
-#ClientAliveCountMax 3
-#UseDNS yes
-#PidFile /var/run/sshd.pid
-#MaxStartups 10
-
-# no default banner path
-#Banner /some/path
-
-ClientAliveInterval 15
-ClientAliveCountMax 4
-
-# override default of no subsystems
-Subsystem      sftp    /usr/sbin/sftp-server
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.sftp-client.control b/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.sftp-client.control
deleted file mode 100644 (file)
index 12949f1..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-Package: openssh-sftp-client
-Priority: optional
-Version: 3.8p1-1
-Architecture: mipsel
-Maintainer: below0
-Section: net
-Depends: openssh-client
-Source: Embedded in the main OpenWrt buildroot
-Description: OpenSSH Secure FTP server. 
- Includes: sftp-server
-
-
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.sftp-server.control b/obsolete-buildroot/sources/openwrt/ipkg/openssh/openssh.sftp-server.control
deleted file mode 100644 (file)
index 45f5c9a..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-Package: openssh-sftp-server
-Priority: optional
-Version: 3.8p1-1
-Architecture: mipsel
-Maintainer: below0
-Section: net
-Depends: openssh-server
-Source: Embedded in the main OpenWrt buildroot
-Description: OpenSSH Secure FTP server. 
- Includes: sftp-server
-
-
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/openssl/control b/obsolete-buildroot/sources/openwrt/ipkg/openssl/control
deleted file mode 100644 (file)
index 4fe0b87..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Package: libssl
-Priority: optional
-Version: 0.9.7d-1
-Architecture: mipsel
-Maintainer: below0
-Section: libs
-Source: Embedded in the main OpenWrt buildroot
-Description: OpenSSL libraries used for SSL encryption.
-
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/openssl/openssl.patch b/obsolete-buildroot/sources/openwrt/ipkg/openssl/openssl.patch
deleted file mode 100644 (file)
index 2e8d50f..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
---- openssl-0.9.7.orig/Configure
-+++ openssl-0.9.7/Configure
-@@ -1,4 +1,4 @@
--:
-+#!/usr/bin/perl
- eval 'exec perl -S $0 ${1+"$@"}'
-     if $running_under_some_shell;
- ##
-@@ -373,6 +373,40 @@
- # assembler versions -- currently defunct:
- ##"OpenBSD-alpha","gcc:-DTERMIOS -O3 -fomit-frame-pointer:::(unknown):SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2:${alpha_asm}",
-+# Sane Linux configuration values, stolen from the Debian package....
-+"linux-alpha","gcc:-DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-alpha-ev4","gcc:-DTERMIO -O3 -mcpu=ev4 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-alpha-ev5","gcc:-DTERMIO -O3 -mcpu=ev5 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-arm","gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-freebsd-alpha","gcc:-DTERMIOS -O -fomit-frame-pointer::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC2::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-freebsd-i386",  "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::-pthread -D_REENTRANT -D_THREAD_SAFE -D_THREADSAFE:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-hppa","gcc:-DB_ENDIAN -DTERMIO -O2 -Wall::-D_REENTRANT::-ldl:BN_LLONG MD2_CHAR RC4_INDEX::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-hurd-i386","gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -m486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-ia64","gcc:-DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR:asm/ia64.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+#"linux-i386","gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:linux-shared:-fPIC",
-+"linux-i386","gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-i386-i486","gcc:-DL_ENDIAN -DTERMIO -O3 -march=i486 -mcpu=i486 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-i386-i586","gcc:-DL_ENDIAN -DTERMIO -O3 -march=i586 -mcpu=i586 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-i386-i686/cmov","gcc:-DL_ENDIAN -DTERMIO -O3 -march=i686 -mcpu=i686 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-m68k","gcc:-DB_ENDIAN -DTERMIO -O2 -Wall::-D_REENTRANT::-ldl:BN_LLONG MD2_CHAR RC4_INDEX::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-mips",   "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-mipsel",   "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-netbsd-i386",  "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -m486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-netbsd-m68k",  "gcc:-DB_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-netbsd-sparc", "gcc:-DB_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -mv8 -Wall::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-openbsd-alpha","gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown):::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-openbsd-i386",  "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -m486::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-openbsd-mips","gcc:-O2 -DL_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC2 DES_PTR BF_PTR:::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-powerpc","gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_UNROLL DES_RISC2 DES_PTR MD2_CHAR RC4_INDEX::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-s390","gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 
-+"linux-sh3",   "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-sh4",   "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-sh3eb",   "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-sh4eb",   "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-sparc","gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-sparc-v8","gcc:-DB_ENDIAN -DTERMIO -O3 -mcpu=v8 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-sparc-v9","gcc:-DB_ENDIAN -DTERMIO -O3 -mcpu=v9 -Wa,-Av8plus -fomit-frame-pointer -Wall -DULTRASPARC -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"linux-cris", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::dlfcn:linux-shared:-fpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
- # The intel boxes :-), It would be worth seeing if bsdi-gcc can use the
- # bn86-elf.o file file since it is hand tweaked assembler.
- "linux-elf",  "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
---- openssl-0.9.7.orig/crypto/md5/asm/md5-sparcv9.S
-+++ openssl-0.9.7/crypto/md5/asm/md5-sparcv9.S
-@@ -72,14 +72,14 @@
- #define Dval  R8
- #if defined(MD5_BLOCK_DATA_ORDER)
--# if defined(OPENSSL_SYSNAME_ULTRASPARC)
-+/*# if defined(OPENSSL_SYSNAME_ULTRASPARC)*/
- #  define     LOAD                    lda
- #  define     X(i)                    [%i1+i*4]%asi
- #  define     md5_block               md5_block_asm_data_order_aligned
- #  define     ASI_PRIMARY_LITTLE      0x88
--# else
-+/*# else
- #  error "MD5_BLOCK_DATA_ORDER is supported only on UltraSPARC!"
--# endif
-+# endif*/
- #else
- # define      LOAD                    ld
- # define      X(i)                    [%i1+i*4]
---- openssl-0.9.7.orig/crypto/opensslconf.h
-+++ openssl-0.9.7/crypto/opensslconf.h
-@@ -4,17 +4,38 @@
- /* OpenSSL was configured with the following options: */
- #ifndef OPENSSL_DOING_MAKEDEPEND
-+#ifndef OPENSSL_NO_IDEA
-+# define OPENSSL_NO_IDEA
-+#endif
-+#ifndef OPENSSL_NO_MDC2
-+# define OPENSSL_NO_MDC2
-+#endif
-+#ifndef OPENSSL_NO_RC5
-+# define OPENSSL_NO_RC5
-+#endif
- #ifndef OPENSSL_NO_KRB5
- # define OPENSSL_NO_KRB5
- #endif
- #endif /* OPENSSL_DOING_MAKEDEPEND */
-+#ifndef OPENSSL_THREADS
-+# define OPENSSL_THREADS
-+#endif
- /* The OPENSSL_NO_* macros are also defined as NO_* if the application
-    asks for it.  This is a transient feature that is provided for those
-    who haven't had the time to do the appropriate changes in their
-    applications.  */
- #ifdef OPENSSL_ALGORITHM_DEFINES
-+# if defined(OPENSSL_NO_IDEA) && !defined(NO_IDEA)
-+#  define NO_IDEA
-+# endif
-+# if defined(OPENSSL_NO_MDC2) && !defined(NO_MDC2)
-+#  define NO_MDC2
-+# endif
-+# if defined(OPENSSL_NO_RC5) && !defined(NO_RC5)
-+#  define NO_RC5
-+# endif
- # if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5)
- #  define NO_KRB5
- # endif
-@@ -27,7 +48,7 @@
- #if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */
- #if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR)
--#define OPENSSLDIR "/usr/local/ssl"
-+#define OPENSSLDIR "/usr/lib/ssl"
- #endif
- #endif
-@@ -79,7 +100,7 @@
- #if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)
- #define CONFIG_HEADER_BN_H
--#undef BN_LLONG
-+#define BN_LLONG
- /* Should we define BN_DIV2W here? */
-@@ -98,7 +119,7 @@
- #define CONFIG_HEADER_RC4_LOCL_H
- /* if this is defined data[i] is used instead of *data, this is a %20
-  * speedup on x86 */
--#undef RC4_INDEX
-+#define RC4_INDEX
- #endif
- #if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
-@@ -112,14 +133,14 @@
- /* the following is tweaked from a config script, that is why it is a
-  * protected undef/define */
- #ifndef DES_PTR
--#undef DES_PTR
-+#define DES_PTR
- #endif
- /* This helps C compiler generate the correct code for multiple functional
-  * units.  It reduces register dependancies at the expense of 2 more
-  * registers */
- #ifndef DES_RISC1
--#undef DES_RISC1
-+#define DES_RISC1
- #endif
- #ifndef DES_RISC2
-@@ -133,7 +154,7 @@
- /* Unroll the inner loop, this sometimes helps, sometimes hinders.
-  * Very mucy CPU dependant */
- #ifndef DES_UNROLL
--#undef DES_UNROLL
-+#define DES_UNROLL
- #endif
- /* These default values were supplied by
---- openssl-0.9.7.orig/ssl/ssl_algs.c
-+++ openssl-0.9.7/ssl/ssl_algs.c
-@@ -109,3 +109,8 @@
-       return(1);
-       }
-+#undef SSLeay_add_ssl_algorithms
-+int SSLeay_add_ssl_algorithms(void)
-+    {
-+         return SSL_library_init();
-+    }
---- openssl-0.9.7.orig/tools/c_rehash.in
-+++ openssl-0.9.7/tools/c_rehash.in
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/perl
-+#!/usr/bin/perl
- # Perl c_rehash script, scan all files in a directory
---- openssl-0.9.7.orig/util/clean-depend.pl
-+++ openssl-0.9.7/util/clean-depend.pl
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/perl -w
-+#!/usr/bin/perl
- # Clean the dependency list in a makefile of standard includes...
- # Written by Ben Laurie <ben@algroup.co.uk> 19 Jan 1999
---- openssl-0.9.7.orig/util/extract-names.pl
-+++ openssl-0.9.7/util/extract-names.pl
-@@ -1,4 +1,4 @@
--#!/usr/bin/perl
-+#!/usr/bin/perl
- $/ = "";                      # Eat a paragraph at once.
- while(<STDIN>) {
---- openssl-0.9.7.orig/util/mkdef.pl
-+++ openssl-0.9.7/util/mkdef.pl
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/perl -w
-+#!/usr/bin/perl
- #
- # generate a .def file
- #
---- openssl-0.9.7.orig/util/mkerr.pl
-+++ openssl-0.9.7/util/mkerr.pl
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/perl -w
-+#!/usr/bin/perl
- my $config = "crypto/err/openssl.ec";
- my $debug = 0;
---- openssl-0.9.7.orig/util/mkstack.pl
-+++ openssl-0.9.7/util/mkstack.pl
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/perl -w
-+#!/usr/bin/perl
- # This is a utility that searches out "DECLARE_STACK_OF()"
- # declarations in .h and .c files, and updates/creates/replaces
---- openssl-0.9.7.orig/util/pod2man.pl
-+++ openssl-0.9.7/util/pod2man.pl
-@@ -1,4 +1,4 @@
--: #!/usr/bin/perl-5.005
-+#!/usr/bin/perl
-     eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
-       if $running_under_some_shell;
---- openssl-0.9.7.orig/util/selftest.pl
-+++ openssl-0.9.7/util/selftest.pl
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/perl -w
-+#!/usr/bin/perl
- #
- # Run the test suite and generate a report
- #
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/ppp-radius-plugin/CONTROL/conffiles b/obsolete-buildroot/sources/openwrt/ipkg/ppp-radius-plugin/CONTROL/conffiles
deleted file mode 100644 (file)
index 70fe146..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/etc/ppp/radius.conf
-/etc/ppp/radius/servers
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/ppp-radius-plugin/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/ppp-radius-plugin/CONTROL/control
deleted file mode 100644 (file)
index e9411b3..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Package: ppp-radius-plugin
-Priority: optional
-Section: net
-Version: TBDL
-Architecture: TBDL
-Maintainer: Nico
-Source: http://openwrt.org/cgi-bin/viewcvs.cgi/buildroot/
-Description: a RADIUS plugin for the PPP daemon
-Depends: ppp
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/ppp-radius-plugin/root/etc/ppp/radius-options b/obsolete-buildroot/sources/openwrt/ipkg/ppp-radius-plugin/root/etc/ppp/radius-options
deleted file mode 100644 (file)
index 1cb1867..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-plugin radius.so
-radius-config-file /etc/ppp/radius.conf
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/ppp-radius-plugin/root/etc/ppp/radius.conf b/obsolete-buildroot/sources/openwrt/ipkg/ppp-radius-plugin/root/etc/ppp/radius.conf
deleted file mode 100644 (file)
index bf630fe..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-authserver localhost:1812
-acctserver localhost:1813
-dictionary /etc/ppp/radius/dictionary
-servers /etc/ppp/radius/servers
-seqfile /var/tmp/radius.seq
-radius_timeout 10
-radius_retries 3
-mapfile /dev/null
\ No newline at end of file
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/ppp-radius-plugin/root/etc/ppp/radius/dictionary b/obsolete-buildroot/sources/openwrt/ipkg/ppp-radius-plugin/root/etc/ppp/radius/dictionary
deleted file mode 100644 (file)
index 706d1ce..0000000
+++ /dev/null
@@ -1,253 +0,0 @@
-#
-# Updated 97/06/13 to livingston-radius-2.01 miquels@cistron.nl
-#
-#      This file contains dictionary translations for parsing
-#      requests and generating responses.  All transactions are
-#      composed of Attribute/Value Pairs.  The value of each attribute
-#      is specified as one of 4 data types.  Valid data types are:
-#
-#      string - 0-253 octets
-#      ipaddr - 4 octets in network byte order
-#      integer - 32 bit value in big endian order (high byte first)
-#      date - 32 bit value in big endian order - seconds since
-#                                      00:00:00 GMT,  Jan.  1,  1970
-#
-#      Enumerated values are stored in the user file with dictionary
-#      VALUE translations for easy administration.
-#
-#      Example:
-#
-#      ATTRIBUTE         VALUE
-#      ---------------   -----
-#      Framed-Protocol = PPP
-#      7               = 1     (integer encoding)
-#
-
-# The dictionary format now supports vendor-specific attributes.
-# Vendors are introduced like this:
-#
-#      VENDOR vendor_name vendor_number
-#
-# For example:
-#
-#      VENDOR RoaringPenguin 10055
-#
-# Vendor-specific attributes have a fifth field with the name of the
-# vendor.  For example:
-#
-#       ATTRIBUTE RP-Upstream-Speed-Limit 1 integer RoaringPenguin
-#
-# introduces a Roaring Penguin vendor-specific attribbute with name
-# RP-Upstream-Speed-Limit, number 1, type integer and vendor RoaringPenguin.
-
-#
-#      Following are the proper new names. Use these.
-#
-ATTRIBUTE      User-Name               1       string
-ATTRIBUTE      Password                2       string
-ATTRIBUTE      CHAP-Password           3       string
-ATTRIBUTE      NAS-IP-Address          4       ipaddr
-ATTRIBUTE      NAS-Port-Id             5       integer
-ATTRIBUTE      Service-Type            6       integer
-ATTRIBUTE      Framed-Protocol         7       integer
-ATTRIBUTE      Framed-IP-Address       8       ipaddr
-ATTRIBUTE      Framed-IP-Netmask       9       ipaddr
-ATTRIBUTE      Framed-Routing          10      integer
-ATTRIBUTE      Filter-Id               11      string
-ATTRIBUTE      Framed-MTU              12      integer
-ATTRIBUTE      Framed-Compression      13      integer
-ATTRIBUTE      Login-IP-Host           14      ipaddr
-ATTRIBUTE      Login-Service           15      integer
-ATTRIBUTE      Login-TCP-Port          16      integer
-ATTRIBUTE      Reply-Message           18      string
-ATTRIBUTE      Callback-Number         19      string
-ATTRIBUTE      Callback-Id             20      string
-ATTRIBUTE      Framed-Route            22      string
-ATTRIBUTE      Framed-IPX-Network      23      ipaddr
-ATTRIBUTE      State                   24      string
-ATTRIBUTE      Class                   25      string
-ATTRIBUTE      Session-Timeout         27      integer
-ATTRIBUTE      Idle-Timeout            28      integer
-ATTRIBUTE      Termination-Action      29      integer
-ATTRIBUTE      Called-Station-Id       30      string
-ATTRIBUTE      Calling-Station-Id      31      string
-ATTRIBUTE      NAS-Identifier          32      string
-ATTRIBUTE      Acct-Status-Type        40      integer
-ATTRIBUTE      Acct-Delay-Time         41      integer
-ATTRIBUTE      Acct-Input-Octets       42      integer
-ATTRIBUTE      Acct-Output-Octets      43      integer
-ATTRIBUTE      Acct-Session-Id         44      string
-ATTRIBUTE      Acct-Authentic          45      integer
-ATTRIBUTE      Acct-Session-Time       46      integer
-ATTRIBUTE      Acct-Input-Packets      47      integer
-ATTRIBUTE      Acct-Output-Packets     48      integer
-ATTRIBUTE      Acct-Terminate-Cause    49      integer
-ATTRIBUTE      Chap-Challenge          60      string
-ATTRIBUTE      NAS-Port-Type           61      integer
-ATTRIBUTE      Port-Limit              62      integer
-ATTRIBUTE      Connect-Info            77      string
-
-# RFC 2869
-ATTRIBUTE      Acct-Interim-Interval   85      integer
-
-#
-#      Experimental Non Protocol Attributes used by Cistron-Radiusd
-#
-ATTRIBUTE      Huntgroup-Name          221     string
-ATTRIBUTE      User-Category           1029    string
-ATTRIBUTE      Group-Name              1030    string
-ATTRIBUTE      Simultaneous-Use        1034    integer
-ATTRIBUTE      Strip-User-Name         1035    integer
-ATTRIBUTE      Fall-Through            1036    integer
-ATTRIBUTE      Add-Port-To-IP-Address  1037    integer
-ATTRIBUTE      Exec-Program            1038    string
-ATTRIBUTE      Exec-Program-Wait       1039    string
-ATTRIBUTE      Hint                    1040    string
-
-#
-#      Non-Protocol Attributes
-#      These attributes are used internally by the server
-#
-ATTRIBUTE      Expiration                21    date
-ATTRIBUTE      Auth-Type               1000    integer
-ATTRIBUTE      Menu                    1001    string
-ATTRIBUTE      Termination-Menu        1002    string
-ATTRIBUTE      Prefix                  1003    string
-ATTRIBUTE      Suffix                  1004    string
-ATTRIBUTE      Group                   1005    string
-ATTRIBUTE      Crypt-Password          1006    string
-ATTRIBUTE      Connect-Rate            1007    integer
-
-#
-#       Experimental, implementation specific attributes
-#
-# Limit session traffic
-ATTRIBUTE      Session-Octets-Limit    227     integer
-# What to assume as limit - 0 in+out, 1 in, 2 out, 3 max(in,out)
-ATTRIBUTE      Octets-Direction        228     integer
-
-#
-#      Integer Translations
-#
-
-#      User Types
-
-VALUE          Service-Type            Login-User              1
-VALUE          Service-Type            Framed-User             2
-VALUE          Service-Type            Callback-Login-User     3
-VALUE          Service-Type            Callback-Framed-User    4
-VALUE          Service-Type            Outbound-User           5
-VALUE          Service-Type            Administrative-User     6
-VALUE          Service-Type            NAS-Prompt-User         7
-
-#      Framed Protocols
-
-VALUE          Framed-Protocol         PPP                     1
-VALUE          Framed-Protocol         SLIP                    2
-
-#      Framed Routing Values
-
-VALUE          Framed-Routing          None                    0
-VALUE          Framed-Routing          Broadcast               1
-VALUE          Framed-Routing          Listen                  2
-VALUE          Framed-Routing          Broadcast-Listen        3
-
-#      Framed Compression Types
-
-VALUE          Framed-Compression      None                    0
-VALUE          Framed-Compression      Van-Jacobson-TCP-IP     1
-
-#      Login Services
-
-VALUE          Login-Service           Telnet                  0
-VALUE          Login-Service           Rlogin                  1
-VALUE          Login-Service           TCP-Clear               2
-VALUE          Login-Service           PortMaster              3
-
-#      Status Types
-
-VALUE          Acct-Status-Type        Start                   1
-VALUE          Acct-Status-Type        Stop                    2
-VALUE          Acct-Status-Type        Accounting-On           7
-VALUE          Acct-Status-Type        Accounting-Off          8
-
-#      Authentication Types
-
-VALUE          Acct-Authentic          RADIUS                  1
-VALUE          Acct-Authentic          Local                   2
-VALUE          Acct-Authentic          PowerLink128            100
-
-#      Termination Options
-
-VALUE          Termination-Action      Default                 0
-VALUE          Termination-Action      RADIUS-Request          1
-
-#      NAS Port Types, available in 3.3.1 and later
-
-VALUE          NAS-Port-Type           Async                   0
-VALUE          NAS-Port-Type           Sync                    1
-VALUE          NAS-Port-Type           ISDN                    2
-VALUE          NAS-Port-Type           ISDN-V120               3
-VALUE          NAS-Port-Type           ISDN-V110               4
-
-#      Acct Terminate Causes, available in 3.3.2 and later
-
-VALUE           Acct-Terminate-Cause    User-Request            1
-VALUE           Acct-Terminate-Cause    Lost-Carrier            2
-VALUE           Acct-Terminate-Cause    Lost-Service            3
-VALUE           Acct-Terminate-Cause    Idle-Timeout            4
-VALUE           Acct-Terminate-Cause    Session-Timeout         5
-VALUE           Acct-Terminate-Cause    Admin-Reset             6
-VALUE           Acct-Terminate-Cause    Admin-Reboot            7
-VALUE           Acct-Terminate-Cause    Port-Error              8
-VALUE           Acct-Terminate-Cause    NAS-Error               9
-VALUE           Acct-Terminate-Cause    NAS-Request             10
-VALUE           Acct-Terminate-Cause    NAS-Reboot              11
-VALUE           Acct-Terminate-Cause    Port-Unneeded           12
-VALUE           Acct-Terminate-Cause    Port-Preempted          13
-VALUE           Acct-Terminate-Cause    Port-Suspended          14
-VALUE           Acct-Terminate-Cause    Service-Unavailable     15
-VALUE           Acct-Terminate-Cause    Callback                16
-VALUE           Acct-Terminate-Cause    User-Error              17
-VALUE           Acct-Terminate-Cause    Host-Request            18
-
-#
-#      Non-Protocol Integer Translations
-#
-
-VALUE          Auth-Type               Local                   0
-VALUE          Auth-Type               System                  1
-VALUE          Auth-Type               SecurID                 2
-VALUE          Auth-Type               Crypt-Local             3
-VALUE          Auth-Type               Reject                  4
-
-#
-#      Cistron extensions
-#
-VALUE          Auth-Type               Pam                     253
-VALUE          Auth-Type               None                    254
-
-#
-#      Experimental Non-Protocol Integer Translations for Cistron-Radiusd
-#
-VALUE          Fall-Through            No                      0
-VALUE          Fall-Through            Yes                     1
-VALUE          Add-Port-To-IP-Address  No                      0
-VALUE          Add-Port-To-IP-Address  Yes                     1
-
-#
-#      Configuration Values
-#      uncomment these two lines to turn account expiration on
-#
-
-#VALUE         Server-Config           Password-Expiration     30
-#VALUE         Server-Config           Password-Warning        5
-
-#       Octets-Direction
-VALUE          Octets-Direction        Sum                     0
-VALUE          Octets-Direction        Input                   1
-VALUE          Octets-Direction        Output                  2
-VALUE          Octets-Direction        MaxOveral               3
-VALUE          Octets-Direction        MaxSession              4
-
-INCLUDE /etc/ppp/radius/dictionary.microsoft
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/ppp-radius-plugin/root/etc/ppp/radius/dictionary.microsoft b/obsolete-buildroot/sources/openwrt/ipkg/ppp-radius-plugin/root/etc/ppp/radius/dictionary.microsoft
deleted file mode 100644 (file)
index 09fdbba..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#
-#      Microsoft's VSA's, from RFC 2548
-#
-#      $Id$
-#
-
-VENDOR         Microsoft       311     Microsoft
-
-ATTRIBUTE      MS-CHAP-Response        1       string  Microsoft
-ATTRIBUTE      MS-CHAP-Error           2       string  Microsoft
-ATTRIBUTE      MS-CHAP-CPW-1           3       string  Microsoft
-ATTRIBUTE      MS-CHAP-CPW-2           4       string  Microsoft
-ATTRIBUTE      MS-CHAP-LM-Enc-PW       5       string  Microsoft
-ATTRIBUTE      MS-CHAP-NT-Enc-PW       6       string  Microsoft
-ATTRIBUTE      MS-MPPE-Encryption-Policy 7     string  Microsoft
-# This is referred to as both singular and plural in the RFC.
-# Plural seems to make more sense.
-ATTRIBUTE      MS-MPPE-Encryption-Type 8       string  Microsoft
-ATTRIBUTE      MS-MPPE-Encryption-Types  8     string  Microsoft
-ATTRIBUTE      MS-RAS-Vendor           9       integer Microsoft
-ATTRIBUTE      MS-CHAP-Domain          10      string  Microsoft
-ATTRIBUTE      MS-CHAP-Challenge       11      string  Microsoft
-ATTRIBUTE      MS-CHAP-MPPE-Keys       12      string  Microsoft
-ATTRIBUTE      MS-BAP-Usage            13      integer Microsoft
-ATTRIBUTE      MS-Link-Utilization-Threshold 14 integer        Microsoft
-ATTRIBUTE      MS-Link-Drop-Time-Limit 15      integer Microsoft
-ATTRIBUTE      MS-MPPE-Send-Key        16      string  Microsoft
-ATTRIBUTE      MS-MPPE-Recv-Key        17      string  Microsoft
-ATTRIBUTE      MS-RAS-Version          18      string  Microsoft
-ATTRIBUTE      MS-Old-ARAP-Password    19      string  Microsoft
-ATTRIBUTE      MS-New-ARAP-Password    20      string  Microsoft
-ATTRIBUTE      MS-ARAP-PW-Change-Reason 21     integer Microsoft
-
-ATTRIBUTE      MS-Filter               22      string  Microsoft
-ATTRIBUTE      MS-Acct-Auth-Type       23      integer Microsoft
-ATTRIBUTE      MS-Acct-EAP-Type        24      integer Microsoft
-
-ATTRIBUTE      MS-CHAP2-Response       25      string  Microsoft
-ATTRIBUTE      MS-CHAP2-Success        26      string  Microsoft
-ATTRIBUTE      MS-CHAP2-CPW            27      string  Microsoft
-
-ATTRIBUTE      MS-Primary-DNS-Server   28      ipaddr  Microsoft
-ATTRIBUTE      MS-Secondary-DNS-Server 29      ipaddr  Microsoft
-ATTRIBUTE      MS-Primary-NBNS-Server  30      ipaddr  Microsoft
-ATTRIBUTE      MS-Secondary-NBNS-Server 31     ipaddr  Microsoft
-
-#ATTRIBUTE     MS-ARAP-Challenge       33      string  Microsoft
-
-
-#
-#      Integer Translations
-#
-
-#      MS-BAP-Usage Values
-
-VALUE          MS-BAP-Usage            Not-Allowed     0
-VALUE          MS-BAP-Usage            Allowed         1
-VALUE          MS-BAP-Usage            Required        2
-
-#      MS-ARAP-Password-Change-Reason Values
-
-VALUE  MS-ARAP-PW-Change-Reason        Just-Change-Password            1
-VALUE  MS-ARAP-PW-Change-Reason        Expired-Password                2
-VALUE  MS-ARAP-PW-Change-Reason        Admin-Requires-Password-Change  3
-VALUE  MS-ARAP-PW-Change-Reason        Password-Too-Short              4
-
-#      MS-Acct-Auth-Type Values
-
-VALUE          MS-Acct-Auth-Type       PAP             1
-VALUE          MS-Acct-Auth-Type       CHAP            2
-VALUE          MS-Acct-Auth-Type       MS-CHAP-1       3
-VALUE          MS-Acct-Auth-Type       MS-CHAP-2       4
-VALUE          MS-Acct-Auth-Type       EAP             5
-
-#      MS-Acct-EAP-Type Values
-
-VALUE          MS-Acct-EAP-Type        MD5             4
-VALUE          MS-Acct-EAP-Type        OTP             5
-VALUE          MS-Acct-EAP-Type        Generic-Token-Card      6
-VALUE          MS-Acct-EAP-Type        TLS             13
-
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/ppp-radius-plugin/root/etc/ppp/radius/servers b/obsolete-buildroot/sources/openwrt/ipkg/ppp-radius-plugin/root/etc/ppp/radius/servers
deleted file mode 100644 (file)
index 0c5b3b9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-localhost secret
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/ppp/CONTROL/conffiles b/obsolete-buildroot/sources/openwrt/ipkg/ppp/CONTROL/conffiles
deleted file mode 100644 (file)
index 8ad17eb..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/etc/ppp/chap-secrets
-/etc/ppp/options
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/ppp/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/ppp/CONTROL/control
deleted file mode 100644 (file)
index b4e071e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-Package: ppp
-Priority: optional
-Section: net
-Version: TBDL
-Architecture: TBDL
-Maintainer: Nico <nthill@free.fr>
-Source: http://openwrt.org/cgi-bin/viewcvs.cgi/buildroot/
-Description: a Point-to-Point Protocol (PPP) daemon
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/ppp/root/etc/ppp/chap-secrets b/obsolete-buildroot/sources/openwrt/ipkg/ppp/root/etc/ppp/chap-secrets
deleted file mode 100644 (file)
index f31e376..0000000
+++ /dev/null
@@ -1 +0,0 @@
-nico  pptp-server  secret  172.16.1.101
\ No newline at end of file
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/ppp/root/etc/ppp/options b/obsolete-buildroot/sources/openwrt/ipkg/ppp/root/etc/ppp/options
deleted file mode 100644 (file)
index 77170e9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#debug
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/ppp/root/etc/ppp/peers/.placeholder b/obsolete-buildroot/sources/openwrt/ipkg/ppp/root/etc/ppp/peers/.placeholder
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/pppoecd/CONTROL/conffiles b/obsolete-buildroot/sources/openwrt/ipkg/pppoecd/CONTROL/conffiles
deleted file mode 100644 (file)
index 7ebe115..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/etc/ppp/ip-up
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/pppoecd/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/pppoecd/CONTROL/control
deleted file mode 100644 (file)
index 6996b8e..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-Package: pppoecd
-Priority: optional
-Version: 1.0
-Architecture: mipsel
-Maintainer: below0
-Section: net
-Source: Embedded in the main openwrt tarball
-Description: Linksys PPPoE daemon for access to internet using DSL modems
-
-
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/pppoecd/CONTROL/postrm b/obsolete-buildroot/sources/openwrt/ipkg/pppoecd/CONTROL/postrm
deleted file mode 100644 (file)
index 0d53d99..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-rm -rf /etc/ppp
-
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/pppoecd/CONTROL/prerm b/obsolete-buildroot/sources/openwrt/ipkg/pppoecd/CONTROL/prerm
deleted file mode 100644 (file)
index 092bf00..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-killall pppoecd
-sleep 3
-killall -9 pppoecd
\ No newline at end of file
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/pppoecd/pppoecd-pathnames.patch b/obsolete-buildroot/sources/openwrt/ipkg/pppoecd/pppoecd-pathnames.patch
deleted file mode 100644 (file)
index e6c1099..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
---- pathnames.h.orig   Tue Oct 14 03:09:53 2003
-+++ pathnames.h        Sat Jul 10 21:04:34 2004
-@@ -9,37 +9,37 @@
- #else /* HAVE_PATHS_H */
- #ifndef _PATH_VARRUN
--#define _PATH_VARRUN  "/tmp/ppp/"
-+#define _PATH_VARRUN  "/var/run"
- #endif
- #define _PATH_DEVNULL "/dev/null"
- #endif /* HAVE_PATHS_H */
- #ifndef _ROOT_PATH
--#define _ROOT_PATH
-+#define _ROOT_PATH "/etc"
- #endif
--#define _PATH_UPAPFILE         _ROOT_PATH "/tmp/ppp/pap-secrets"
--#define _PATH_CHAPFILE         _ROOT_PATH "/tmp/ppp/chap-secrets"
--#define _PATH_SYSOPTIONS _ROOT_PATH "/tmp/ppp/options"
--#define _PATH_IPUP     _ROOT_PATH "/tmp/ppp/ip-up"
--#define _PATH_IPDOWN   _ROOT_PATH "/tmp/ppp/ip-down"
--#define _PATH_AUTHUP   _ROOT_PATH "/tmp/ppp/auth-up"
--#define _PATH_AUTHDOWN         _ROOT_PATH "/tmp/ppp/auth-down"
--#define _PATH_TTYOPT   _ROOT_PATH "/tmp/ppp/options."
--#define _PATH_CONNERRS         _ROOT_PATH "/tmp/ppp/connect-errors"
--#define _PATH_PEERFILES        _ROOT_PATH "/tmp/ppp/peers/"
--#define _PATH_RESOLV   _ROOT_PATH "/tmp/ppp/resolv.conf"
-+#define _PATH_UPAPFILE         _ROOT_PATH "/ppp/pap-secrets"
-+#define _PATH_CHAPFILE         _ROOT_PATH "/ppp/chap-secrets"
-+#define _PATH_SYSOPTIONS _ROOT_PATH "/ppp/options"
-+#define _PATH_IPUP     _ROOT_PATH "/ppp/ip-up"
-+#define _PATH_IPDOWN   _ROOT_PATH "/ppp/ip-down"
-+#define _PATH_AUTHUP   _ROOT_PATH "/ppp/auth-up"
-+#define _PATH_AUTHDOWN         _ROOT_PATH "/ppp/auth-down"
-+#define _PATH_TTYOPT   _ROOT_PATH "/ppp/options."
-+#define _PATH_CONNERRS         "/tmp/connect-errors"
-+#define _PATH_PEERFILES        _ROOT_PATH "/ppp/peers/"
-+#define _PATH_RESOLV   "/tmp/resolv.conf"
- #define _PATH_USEROPT  ".ppprc"
- #ifdef INET6
--#define _PATH_IPV6UP     _ROOT_PATH "/tmp/ppp/ipv6-up"
--#define _PATH_IPV6DOWN   _ROOT_PATH "/tmp/ppp/ipv6-down"
-+#define _PATH_IPV6UP     _ROOT_PATH "/ppp/ipv6-up"
-+#define _PATH_IPV6DOWN   _ROOT_PATH "/ppp/ipv6-down"
- #endif
- #ifdef IPX_CHANGE
--#define _PATH_IPXUP    _ROOT_PATH "/tmp/ppp/ipx-up"
--#define _PATH_IPXDOWN  _ROOT_PATH "/tmp/ppp/ipx-down"
-+#define _PATH_IPXUP    _ROOT_PATH "/ppp/ipx-up"
-+#define _PATH_IPXDOWN  _ROOT_PATH "/ppp/ipx-down"
- #endif /* IPX_CHANGE */
- #ifdef __STDC__
-@@ -48,7 +48,7 @@
- #ifdef HAVE_PATHS_H
- #define _PATH_PPPDB   "/var/run/pppd.tdb"
- #else
--#define _PATH_PPPDB   "/tmp/ppp/pppd.tdb"
-+#define _PATH_PPPDB   "/tmp/pppd.tdb"
- #endif
- #endif /* __STDC__ */
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/pppoecd/pppoecd.patch b/obsolete-buildroot/sources/openwrt/ipkg/pppoecd/pppoecd.patch
deleted file mode 100644 (file)
index 4fa4afc..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
---- pppoe.c.orig       Sat Jul 10 20:55:38 2004
-+++ pppoe.c    Sat Jul 10 20:55:55 2004
-@@ -131,8 +131,7 @@
-     if (pppoe_srv_name !=NULL) {
-       if (strlen (pppoe_srv_name) > 255) {
--          poe_error (ses," Service name too long
--                      (maximum allowed 256 chars)");
-+          poe_error (ses," Service name too long (maximum allowed 256 chars)");
-           poe_die(-1);
-       }
-       ses->filt->stag = make_filter_tag(PTT_SRV_NAME,
---- Makefile.orig      Sun Jul 11 03:26:49 2004
-+++ Makefile   Sun Jul 11 03:27:18 2004
-@@ -68,9 +68,9 @@
- all: pppoecd
- install: all
--      install -d $(INSTALLDIR)/usr/sbin
--      install -m 755 pppoecd $(INSTALLDIR)/usr/sbin
--      $(STRIP) $(INSTALLDIR)/usr/sbin/pppoecd
-+      install -d $(INSTALLDIR)/sbin
-+      install -m 755 pppoecd $(INSTALLDIR)/sbin
-+      $(STRIP) $(INSTALLDIR)/sbin/pppoecd
- pppoecd: $(OBJS)
-       $(LD) -r -o .$@ $^ $(LIBCRYPT)
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/pppoecd/root/etc/ppp/ip-up b/obsolete-buildroot/sources/openwrt/ipkg/pppoecd/root/etc/ppp/ip-up
deleted file mode 100644 (file)
index da43294..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-# set default route
-/sbin/route add default gw $IPREMOTE
-
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/pptp-client/CONTROL/conffiles b/obsolete-buildroot/sources/openwrt/ipkg/pptp-client/CONTROL/conffiles
deleted file mode 100644 (file)
index 7b134c1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/etc/ppp/pptp-client-options
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/pptp-client/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/pptp-client/CONTROL/control
deleted file mode 100644 (file)
index a2f8662..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Package: pptp-client
-Priority: optional
-Section: net
-Version: TBDL
-Architecture: TBDL
-Maintainer: Nico <nthill@free.fr>
-Source: http://openwrt.org/cgi-bin/viewcvs.cgi/buildroot/
-Description: a Point-to-Point Tunneling Protocol (PPTP) client
-Depends: ppp
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/pptp-client/root/etc/ppp/peers/pptp-client-sample b/obsolete-buildroot/sources/openwrt/ipkg/pptp-client/root/etc/ppp/peers/pptp-client-sample
deleted file mode 100644 (file)
index 9872791..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#pty "/usr/sbin/pptp HOST --nolaunchpppd"
-#name USERNAME
-#remotename PROVIDER
-#require-mppe-128
-#file /etc/ppp/pptp-client-options
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/pptp-client/root/etc/ppp/pptp-client-options b/obsolete-buildroot/sources/openwrt/ipkg/pptp-client/root/etc/ppp/pptp-client-options
deleted file mode 100644 (file)
index 35cea63..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-lock
-defaultroute
-noauth
-nobsdcomp
-nodeflate
-noipdefault
-asyncmap 0
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/pptp-server/CONTROL/conffiles b/obsolete-buildroot/sources/openwrt/ipkg/pptp-server/CONTROL/conffiles
deleted file mode 100644 (file)
index 34a387b..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/etc/ppp/pptp-server-options
-/etc/pptpd.conf
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/pptp-server/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/pptp-server/CONTROL/control
deleted file mode 100644 (file)
index 8cb012e..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Package: pptp-server
-Priority: optional
-Section: net
-Version: TBDL
-Architecture: TBDL
-Maintainer: Nico <nthill@free.fr>
-Source: http://openwrt.org/cgi-bin/viewcvs.cgi/buildroot/
-Description: a Point-to-Point Tunneling Protocol (PPTP) server
-Depends: ppp
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/pptp-server/root/etc/init.d/pptp-server b/obsolete-buildroot/sources/openwrt/ipkg/pptp-server/root/etc/init.d/pptp-server
deleted file mode 100644 (file)
index 3015c66..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-case $1 in
- start)
-  insmod ppp_async >/dev/null 2>&1
-  insmod ppp_mppe_mppc >/dev/null 2>&1
-  [ -d /var/run ] || mkdir -p /var/run
-  /usr/sbin/pptpd
-  ;;
- stop)
-  [ -f /var/run/pptpd.pid ] && kill $(cat /var/run/pptpd.pid) >/dev/null 2>&1
-  ;;
- *)
-  echo "usage: $0 (start|stop)"
-  exit 1
-esac
-
-exit $?
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/pptp-server/root/etc/ppp/pptp-server-options b/obsolete-buildroot/sources/openwrt/ipkg/pptp-server/root/etc/ppp/pptp-server-options
deleted file mode 100644 (file)
index cca8027..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#debug
-#logfile /tmp/pptp-server.log
-172.16.1.1:
-auth
-name "pptp-server"
-lcp-echo-failure 3
-lcp-echo-interval 60
-default-asyncmap
-mtu 1482
-mru 1482
-nobsdcomp
-nodeflate
-#noproxyarp
-#nomppc
-nomppe-40
-nomppe-56
-nomppe-stateful
-require-mppe
-require-mppe-128
-require-mschap-v2
-refuse-chap
-refuse-mschap
-refuse-eap
-refuse-pap
-#ms-dns 172.16.1.1
-#plugin radius.so
-#radius-config-file /etc/radius.conf
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/pptp-server/root/etc/pptpd.conf b/obsolete-buildroot/sources/openwrt/ipkg/pptp-server/root/etc/pptpd.conf
deleted file mode 100644 (file)
index e9ac115..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#debug
-option /etc/ppp/pptp-server-options
-speed 115200
-stimeout 10
-#localip & remoteip are not needed, ip management is done by pppd
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/radvd/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/radvd/CONTROL/control
deleted file mode 100644 (file)
index 0c7066a..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Package: radvd
-Architecture: mipsel
-Version: 0.7.2-1
-Section: net
-Priority: optional
-Maintainer: twolife 
-Source: http://v6web.litech.org/radvd/
-Depends: kmod-ipv6
-Description: Routing Advertisement Daemon for IPv6
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/radvd/CONTROL/postinst b/obsolete-buildroot/sources/openwrt/ipkg/radvd/CONTROL/postinst
deleted file mode 100644 (file)
index d3274a2..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-# This code is from radvd package found on:
-# http://openwrt.org/ipkg/
-
-if [ ! -f /etc/radvd.conf ] ; then
-       echo
-       echo
-       echo See /etc/radvd.conf for configuration.
-       echo
-       cp /etc/radvd.conf.example /etc/radvd.conf
-fi
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/radvd/radvd.conf.example b/obsolete-buildroot/sources/openwrt/ipkg/radvd/radvd.conf.example
deleted file mode 100644 (file)
index dae402c..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# This conffile is from radvd package found on:
-# http://openwrt.org/ipkg/
-# For more examples, see the radvd documentation.
-
-interface br0
-{
-       AdvSendAdvert off;
-
-#
-# These settings cause advertisements to be sent every 3-10 seconds.  This
-# range is good for 6to4 with a dynamic IPv4 address, but can be greatly
-# increased when not using 6to4 prefixes.
-#
-
-       MinRtrAdvInterval 3;
-       MaxRtrAdvInterval 10;
-
-#
-# Disable Mobile IPv6 support
-#
-       AdvHomeAgentFlag off;
-
-#
-# example of a standard prefix
-#
-       prefix fec0:0:0:1::/64
-       {
-               AdvOnLink on;
-               AdvAutonomous on;
-               AdvRouterAddr off;
-       };
-
-};
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/strace/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/strace/CONTROL/control
deleted file mode 100644 (file)
index edbbc58..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Package: strace
-Architecture: mipsel
-Version: 4.5.6-1
-Section: utils
-Priority: optional
-Maintainer: Sebastien NOEL <me@twolife.org>
-Source: http://sourceforge.net/projects/strace/
-Depends:
-Description: A system call tracer
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/tcpdump/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/tcpdump/CONTROL/control
deleted file mode 100644 (file)
index ac349d4..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Package: tcpdump
-Priority: optional
-Section: net
-Version: TBDL
-Architecture: TBDL
-Maintainer: Nico <nthill@free.fr>
-Source: http://openwrt.org/cgi-bin/viewcvs.cgi/buildroot/
-Description: a powerful network traffic monitoring tool
-Depends: libpcap
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/vsftpd/CONTROL/conffiles b/obsolete-buildroot/sources/openwrt/ipkg/vsftpd/CONTROL/conffiles
deleted file mode 100644 (file)
index 45632cf..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/etc/vsftpd.conf
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/vsftpd/CONTROL/control b/obsolete-buildroot/sources/openwrt/ipkg/vsftpd/CONTROL/control
deleted file mode 100644 (file)
index 28b8ced..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-Package: vsftpd
-Priority: optional
-Section: net
-Version: TBDL
-Architecture: TBDL
-Maintainer: Nico <nthill@free.fr>
-Source: http://openwrt.org/cgi-bin/viewcvs.cgi/buildroot/
-Description: a fast and secure FTP server
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/vsftpd/root/etc/init.d/vsftpd b/obsolete-buildroot/sources/openwrt/ipkg/vsftpd/root/etc/init.d/vsftpd
deleted file mode 100644 (file)
index 0152e4e..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-case $1 in
- start)
-  [ -d /var/run/vsftpd ] || mkdir -p /var/run/vsftpd
-  /usr/sbin/vsftpd
-  ;;
- stop)
-  pid=$(pidof vsftpd)
-  x=$$ # exclude our pid since we have the same name
-  pid=$(echo $pid | sed -e "s/$x//")
-  [ -n "$pid" ] && kill -TERM $pid
-  ;;
- *)
-  echo "usage: $0 (start|stop)"
-  exit 1
-esac
-
-exit $?
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/vsftpd/root/etc/vsftpd.conf b/obsolete-buildroot/sources/openwrt/ipkg/vsftpd/root/etc/vsftpd.conf
deleted file mode 100644 (file)
index f3ba34f..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-background=YES
-listen=YES
-anonymous_enable=NO
-local_enable=YES
-write_enable=YES
-local_umask=022
-check_shell=NO
-#dirmessage_enable=YES
-#ftpd_banner=Welcome to blah FTP service.
-session_support=NO
-#syslog_enable=YES
-#userlist_enable=YES
-#userlist_deny=NO
-#userlist_file=/etc/vsftpd.users
-#xferlog_enable=YES
-#xferlog_file=/var/log/vsftpd.log
-#xferlog_std_format=YES
diff --git a/obsolete-buildroot/sources/openwrt/ipkg/zlib/control b/obsolete-buildroot/sources/openwrt/ipkg/zlib/control
deleted file mode 100644 (file)
index 608176d..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-Package: zlib
-Priority: optional
-Version: 1.1.4-1
-Architecture: mipsel
-Maintainer: below0
-Section: libs
-Source: Embedded in the main OpenWrt buildroot
-Description: zlib is a library implementing the 'deflate' compression system used by many programs.
-
-
diff --git a/obsolete-buildroot/sources/openwrt/kernel/compressed-20040531.tar.bz2 b/obsolete-buildroot/sources/openwrt/kernel/compressed-20040531.tar.bz2
deleted file mode 100644 (file)
index c8e06b8..0000000
Binary files a/obsolete-buildroot/sources/openwrt/kernel/compressed-20040531.tar.bz2 and /dev/null differ
diff --git a/obsolete-buildroot/sources/openwrt/kernel/diag.c b/obsolete-buildroot/sources/openwrt/kernel/diag.c
deleted file mode 100644 (file)
index 41cb17b..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-// replacement diag module
-// (c) 2004 openwrt 
-// mbm at alt dot org
-//
-// initial release 2004/03/28
-//
-// 2004/08/26 asus & buffalo support added
-
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/sysctl.h>
-#include <asm/io.h>
-#include <typedefs.h>
-#include <bcm4710.h>
-#include <sbutils.h>
-
-extern char * nvram_get(const char *name);
-static void *sbh;
-
-// v2.x - - - - -
-#define DIAG_GPIO (1<<1)
-#define DMZ_GPIO  (1<<7)
-
-static void set_gpio(uint32 mask, uint32 value) {
-       sb_gpiocontrol(sbh,mask,0);
-       sb_gpioouten(sbh,mask,mask);
-       sb_gpioout(sbh,mask,value);
-}
-
-static void v2_set_diag(u8 state) {
-       set_gpio(DIAG_GPIO,state);
-}
-static void v2_set_dmz(u8 state) {
-       set_gpio(DMZ_GPIO,state);
-}
-
-// v1.x - - - - -
-#define LED_DIAG   0x13
-#define LED_DMZ    0x12
-
-static void v1_set_diag(u8 state) {
-       if (!state) {
-               *(volatile u8*)(KSEG1ADDR(BCM4710_EUART)+LED_DIAG)=0xFF;
-       } else {
-               *(volatile u8*)(KSEG1ADDR(BCM4710_EUART)+LED_DIAG);
-       }
-}
-static void v1_set_dmz(u8 state) {
-       if (!state) {
-               *(volatile u8*)(KSEG1ADDR(BCM4710_EUART)+LED_DMZ)=0xFF;
-       } else {
-               *(volatile u8*)(KSEG1ADDR(BCM4710_EUART)+LED_DMZ);
-       }
-}
-
-// - - - - -
-static void ignore(u8 ignored) {};
-
-// - - - - -
-#define BIT_DMZ         0x01
-#define BIT_DIAG        0x04
-
-void (*set_diag)(u8 state);
-void (*set_dmz)(u8 state);
-
-static unsigned int diag = 0;
-
-static void diag_change()
-{
-       //printk(KERN_INFO "led -> %02x\n",diag);
-
-       set_diag(0xFF); // off
-       set_dmz(0xFF); // off
-
-       if(diag & BIT_DIAG)
-               set_diag(0x00); // on
-       if(diag & BIT_DMZ)
-               set_dmz(0x00); // on
-}
-
-static int proc_diag(ctl_table *table, int write, struct file *filp,
-               void *buffer, size_t *lenp)
-{
-       int r;
-       r = proc_dointvec(table, write, filp, buffer, lenp);
-       if (write && !r) {
-               diag_change();
-       }
-       return r;
-}
-
-// - - - - -
-static unsigned char reset_gpio = 0;
-static unsigned char reset_polarity = 0;
-static unsigned int reset = 0;
-
-static int proc_reset(ctl_table *table, int write, struct file *filp,
-               void *buffer, size_t *lenp)
-{
-
-       if (reset_gpio) {
-               sb_gpiocontrol(sbh,reset_gpio,reset_gpio);
-               sb_gpioouten(sbh,reset_gpio,0);
-               reset=!(sb_gpioin(sbh)&reset_gpio);
-
-               if (reset_polarity) reset=!reset;
-       } else {
-               reset=0;
-       }
-
-       return proc_dointvec(table, write, filp, buffer, lenp);
-}
-
-// - - - - -
-static struct ctl_table_header *diag_sysctl_header;
-
-static ctl_table sys_diag[] = {
-         { 
-          ctl_name: 2000,
-          procname: "diag", 
-          data: &diag,
-          maxlen: sizeof(diag), 
-          mode: 0644,
-          proc_handler: proc_diag
-        },
-        {
-          ctl_name: 2001,
-          procname: "reset",
-          data: &reset,
-          maxlen: sizeof(reset),
-          mode: 0444,
-          proc_handler: proc_reset 
-        },
-         { 0 }
-};
-
-static int __init diag_init()
-{
-       char *buf;
-       u32 board_type;
-       sbh = sb_kattach();
-       sb_gpiosetcore(sbh);
-
-       board_type = sb_boardtype(sbh);
-       printk(KERN_INFO "diag boardtype: %08x\n",board_type);
-
-       set_diag=ignore;
-       set_dmz=ignore;
-       
-       if ((board_type & 0xf00) == 0x400) {
-               board_type=1;
-               buf=nvram_get("boardtype")?:"";
-               if (!strcmp(buf,"bcm94710dev")) {
-                       buf=nvram_get("boardnum")?:"";
-                       if (!strcmp(buf,"42")) {
-                               // wrt54g v1.x
-                               set_diag=v1_set_diag;
-                               set_dmz=v1_set_dmz;
-                               reset_gpio=(1<<6);
-                               reset_polarity=0;
-                       } else if (!strcmp(buf,"asusX")) {
-                               //asus wl-500g
-                               //no leds
-                               reset_gpio=(1<<6);
-                               reset_polarity=1;
-                       }
-               } else if (!strcmp(buf,"bcm94710ap")) {
-                       buf=nvram_get("boardnum")?:"";
-                       if (!strcmp(buf,"42")) {
-                               // buffalo
-                               set_dmz=v2_set_dmz;
-                               reset_gpio=(1<<4);
-                               reset_polarity=1;
-                       } else if (!strcmp(buf,"44")) {
-                               //dell truemobile
-                               set_dmz=v2_set_dmz;
-                               reset_gpio=(1<<0);
-                               reset_polarity=0;
-                       }
-               }
-       } else {
-               board_type=2;
-               set_diag=v2_set_diag;
-               set_dmz=v2_set_dmz;
-               reset_gpio=(1<<6);
-               reset_polarity=0;
-               buf=nvram_get("boardnum")?:"";
-               if (!strcmp(buf,"44")) {
-                       set_diag=ignore;
-                       set_dmz=ignore;
-                       reset_gpio=(1<<5);
-                       reset_polarity=0;
-               }
-       }
-       printk(KERN_INFO "using v%d hardware\n",board_type);
-
-       diag_sysctl_header = register_sysctl_table(sys_diag, 0);
-       diag_change();
-
-       return 0;
-}
-
-static void __exit diag_exit()
-{
-       unregister_sysctl_table(diag_sysctl_header);
-}
-
-module_init(diag_init);
-module_exit(diag_exit);
diff --git a/obsolete-buildroot/sources/openwrt/kernel/linux.config b/obsolete-buildroot/sources/openwrt/kernel/linux.config
deleted file mode 100644 (file)
index 60424ce..0000000
+++ /dev/null
@@ -1,853 +0,0 @@
-#
-# Automatically generated by make menuconfig: don't edit
-#
-CONFIG_MIPS=y
-CONFIG_MIPS32=y
-# CONFIG_MIPS64 is not set
-
-#
-# Code maturity level options
-#
-CONFIG_EXPERIMENTAL=y
-
-#
-# Loadable module support
-#
-CONFIG_MODULES=y
-# CONFIG_MODVERSIONS is not set
-# CONFIG_KMOD is not set
-
-#
-# Machine selection
-#
-# CONFIG_ACER_PICA_61 is not set
-# CONFIG_MIPS_DB1000 is not set
-# CONFIG_MIPS_DB1100 is not set
-# CONFIG_MIPS_DB1500 is not set
-# CONFIG_MIPS_PB1000 is not set
-# CONFIG_MIPS_PB1100 is not set
-# CONFIG_MIPS_PB1500 is not set
-# CONFIG_BAGET_MIPS is not set
-# CONFIG_CASIO_E55 is not set
-# CONFIG_MIPS_COBALT is not set
-# CONFIG_DECSTATION is not set
-# CONFIG_MIPS_EV64120 is not set
-# CONFIG_MIPS_EV96100 is not set
-# CONFIG_MIPS_IVR is not set
-# CONFIG_HP_LASERJET is not set
-# CONFIG_IBM_WORKPAD is not set
-# CONFIG_LASAT is not set
-# CONFIG_MIPS_ITE8172 is not set
-# CONFIG_MIPS_ATLAS is not set
-# CONFIG_MIPS_MAGNUM_4000 is not set
-# CONFIG_MIPS_MALTA is not set
-# CONFIG_MIPS_SEAD is not set
-# CONFIG_MOMENCO_OCELOT is not set
-# CONFIG_MOMENCO_OCELOT_G is not set
-# CONFIG_DDB5074 is not set
-# CONFIG_DDB5476 is not set
-# CONFIG_DDB5477 is not set
-# CONFIG_NEC_OSPREY is not set
-# CONFIG_NEC_EAGLE is not set
-# CONFIG_OLIVETTI_M700 is not set
-# CONFIG_NINO is not set
-# CONFIG_SGI_IP22 is not set
-# CONFIG_SGI_IP27 is not set
-# CONFIG_SGI_IP32 is not set
-# CONFIG_SIBYTE_SB1xxx_SOC is not set
-CONFIG_MIPS_BRCM=y
-CONFIG_BCM947XX=y
-CONFIG_BCM4710=y
-CONFIG_BCM4310=y
-CONFIG_BCM4704=y
-# CONFIG_BCM5365 is not set
-# CONFIG_SNI_RM200_PCI is not set
-# CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_VICTOR_MPC30X is not set
-# CONFIG_ZAO_CAPCELLA is not set
-# CONFIG_HIGHMEM is not set
-CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
-CONFIG_CMDLINE="root=/dev/mtdblock2 rootfstype=squashfs init=/etc/preinit noinitrd console=ttyS0,115200"
-CONFIG_PCI=y
-CONFIG_NONCOHERENT_IO=y
-CONFIG_NEW_TIME_C=y
-CONFIG_NEW_IRQ=y
-CONFIG_HND=y
-# CONFIG_MIPS_AU1000 is not set
-
-#
-# CPU selection
-#
-CONFIG_CPU_MIPS32=y
-# CONFIG_CPU_MIPS64 is not set
-# CONFIG_CPU_R3000 is not set
-# CONFIG_CPU_TX39XX is not set
-# CONFIG_CPU_VR41XX is not set
-# CONFIG_CPU_R4300 is not set
-# CONFIG_CPU_R4X00 is not set
-# CONFIG_CPU_TX49XX is not set
-# CONFIG_CPU_R5000 is not set
-# CONFIG_CPU_R5432 is not set
-# CONFIG_CPU_R6000 is not set
-# CONFIG_CPU_NEVADA is not set
-# CONFIG_CPU_R8000 is not set
-# CONFIG_CPU_R10000 is not set
-# CONFIG_CPU_RM7000 is not set
-# CONFIG_CPU_SB1 is not set
-CONFIG_CPU_HAS_PREFETCH=y
-# CONFIG_VTAG_ICACHE is not set
-# CONFIG_64BIT_PHYS_ADDR is not set
-# CONFIG_CPU_ADVANCED is not set
-CONFIG_CPU_HAS_LLSC=y
-# CONFIG_CPU_HAS_LLDSCD is not set
-# CONFIG_CPU_HAS_WB is not set
-CONFIG_CPU_HAS_SYNC=y
-
-#
-# General setup
-#
-CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_NET=y
-# CONFIG_PCI_NAMES is not set
-# CONFIG_ISA is not set
-# CONFIG_EISA is not set
-# CONFIG_TC is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
-CONFIG_HOTPLUG=y
-
-#
-# PCMCIA/CardBus support
-#
-# CONFIG_PCMCIA is not set
-
-#
-# PCI Hotplug Support
-#
-# CONFIG_HOTPLUG_PCI is not set
-# CONFIG_HOTPLUG_PCI_COMPAQ is not set
-# CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set
-# CONFIG_HOTPLUG_PCI_ACPI is not set
-CONFIG_SYSVIPC=y
-# CONFIG_BSD_PROCESS_ACCT is not set
-CONFIG_SYSCTL=y
-# CONFIG_PRINT_SYSCALLS is not set
-CONFIG_KCORE_ELF=y
-# CONFIG_KCORE_AOUT is not set
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_MIPS32_COMPAT is not set
-# CONFIG_MIPS32_O32 is not set
-# CONFIG_MIPS32_N32 is not set
-# CONFIG_BINFMT_ELF32 is not set
-# CONFIG_BINFMT_MISC is not set
-# CONFIG_PM is not set
-
-#
-# Memory Technology Devices (MTD)
-#
-CONFIG_MTD=y
-# CONFIG_MTD_DEBUG is not set
-CONFIG_MTD_PARTITIONS=y
-# CONFIG_MTD_CONCAT is not set
-# CONFIG_MTD_REDBOOT_PARTS is not set
-CONFIG_MTD_CHAR=y
-# CONFIG_MTD_BLOCK is not set
-CONFIG_MTD_BLOCK_RO=y
-# CONFIG_FTL is not set
-# CONFIG_NFTL is not set
-
-#
-# RAM/ROM/Flash chip drivers
-#
-CONFIG_MTD_CFI=y
-# CONFIG_MTD_JEDECPROBE is not set
-CONFIG_MTD_GEN_PROBE=y
-CONFIG_MTD_CFI_ADV_OPTIONS=y
-CONFIG_MTD_CFI_NOSWAP=y
-# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
-# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
-CONFIG_MTD_CFI_GEOMETRY=y
-# CONFIG_MTD_CFI_B1 is not set
-CONFIG_MTD_CFI_B2=y
-# CONFIG_MTD_CFI_B4 is not set
-CONFIG_MTD_CFI_I1=y
-# CONFIG_MTD_CFI_I2 is not set
-# CONFIG_MTD_CFI_I4 is not set
-CONFIG_MTD_CFI_INTELEXT=y
-CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_CFI_SSTSTD=y
-# CONFIG_MTD_RAM is not set
-# CONFIG_MTD_ROM is not set
-# CONFIG_MTD_ABSENT is not set
-# CONFIG_MTD_OBSOLETE_CHIPS is not set
-# CONFIG_MTD_AMDSTD is not set
-# CONFIG_MTD_SHARP is not set
-# CONFIG_MTD_JEDEC is not set
-
-#
-# Mapping drivers for chip access
-#
-# CONFIG_MTD_PHYSMAP is not set
-CONFIG_MTD_BCM947XX=y
-# CONFIG_MTD_PB1000 is not set
-# CONFIG_MTD_PB1500 is not set
-# CONFIG_MTD_PB1100 is not set
-# CONFIG_MTD_CSTM_MIPS_IXX is not set
-# CONFIG_MTD_OCELOT is not set
-# CONFIG_MTD_LASAT is not set
-# CONFIG_MTD_PCI is not set
-
-#
-# Self-contained MTD device drivers
-#
-CONFIG_MTD_SFLASH=y
-# CONFIG_MTD_PMC551 is not set
-# CONFIG_MTD_SLRAM is not set
-# CONFIG_MTD_MTDRAM is not set
-# CONFIG_MTD_BLKMTD is not set
-# CONFIG_MTD_DOC1000 is not set
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOCPROBE is not set
-
-#
-# NAND Flash Device Drivers
-#
-# CONFIG_MTD_NAND is not set
-
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
-
-#
-# Plug and Play configuration
-#
-# CONFIG_PNP is not set
-# CONFIG_ISAPNP is not set
-
-#
-# Block devices
-#
-# CONFIG_BLK_DEV_MSYS is not set
-# CONFIG_NOROOT is not set
-# CONFIG_BLK_DEV_FD is not set
-# CONFIG_BLK_DEV_XD is not set
-# CONFIG_PARIDE is not set
-# CONFIG_BLK_CPQ_DA is not set
-# CONFIG_BLK_CPQ_CISS_DA is not set
-# CONFIG_CISS_SCSI_TAPE is not set
-# CONFIG_BLK_DEV_DAC960 is not set
-# CONFIG_BLK_DEV_UMEM is not set
-CONFIG_BLK_DEV_LOOP=y
-CONFIG_BLK_DEV_NBD=m
-# CONFIG_BLK_DEV_RAM is not set
-# CONFIG_BLK_DEV_INITRD is not set
-# CONFIG_BLK_STATS is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-# CONFIG_BLK_DEV_MD is not set
-# CONFIG_MD_LINEAR is not set
-# CONFIG_MD_RAID0 is not set
-# CONFIG_MD_RAID1 is not set
-# CONFIG_MD_RAID5 is not set
-# CONFIG_MD_MULTIPATH is not set
-# CONFIG_BLK_DEV_LVM is not set
-
-#
-# Networking options
-#
-CONFIG_PACKET=y
-CONFIG_PACKET_MMAP=y
-CONFIG_NETLINK_DEV=m
-CONFIG_NETFILTER=y
-# CONFIG_NETFILTER_DEBUG is not set
-# CONFIG_FILTER is not set
-CONFIG_UNIX=y
-CONFIG_NETSWAP=y
-CONFIG_INET=y
-# CONFIG_IP_MULTICAST is not set
-CONFIG_IP_ADVANCED_ROUTER=y
-CONFIG_IP_MULTIPLE_TABLES=y
-CONFIG_IP_ROUTE_FWMARK=y
-CONFIG_IP_ROUTE_NAT=y
-CONFIG_IP_ROUTE_MULTIPATH=y
-CONFIG_IP_ROUTE_TOS=y
-# CONFIG_IP_ROUTE_VERBOSE is not set
-# CONFIG_IP_ROUTE_LARGE_TABLES is not set
-# CONFIG_IP_PNP is not set
-CONFIG_NET_IPIP=m
-CONFIG_NET_IPGRE=m
-# CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
-# CONFIG_SYN_COOKIES is not set
-
-#
-#   IP: Netfilter Configuration
-#
-CONFIG_IP_NF_CONNTRACK=y
-CONFIG_IP_NF_FTP=y
-CONFIG_IP_NF_H323=y
-CONFIG_IP_NF_CONNTRACK_MARK=y
-# CONFIG_IP_NF_AMANDA is not set
-CONFIG_IP_NF_TFTP=y
-CONFIG_IP_NF_IRC=y
-CONFIG_IP_NF_CT_PROTO_GRE=y
-CONFIG_IP_NF_PPTP=y
-CONFIG_IP_NF_MMS=y
-CONFIG_IP_NF_QUEUE=m
-CONFIG_IP_NF_IPTABLES=y
-CONFIG_IP_NF_MATCH_LIMIT=m
-CONFIG_IP_NF_SET=m
-CONFIG_IP_NF_SET_MAX=256
-CONFIG_IP_NF_SET_IPMAP=m
-CONFIG_IP_NF_SET_PORTMAP=m
-CONFIG_IP_NF_SET_MACIPMAP=m
-CONFIG_IP_NF_SET_IPHASH=m
-CONFIG_IP_NF_MATCH_QUOTA=m
-CONFIG_IP_NF_POOL=m
-CONFIG_IP_POOL_STATISTICS=y
-CONFIG_IP_NF_MATCH_IPRANGE=m
-CONFIG_IP_NF_MATCH_DSTLIMIT=m
-CONFIG_IP_NF_MATCH_MAC=m
-CONFIG_IP_NF_MATCH_PKTTYPE=m
-CONFIG_IP_NF_MATCH_MARK=y
-CONFIG_IP_NF_MATCH_MULTIPORT=y
-CONFIG_IP_NF_MATCH_TOS=m
-CONFIG_IP_NF_MATCH_CONDITION=m
-# CONFIG_IP_NF_MATCH_RANDOM is not set
-CONFIG_IP_NF_MATCH_PSD=m
-# CONFIG_IP_NF_MATCH_OSF is not set
-# CONFIG_IP_NF_MATCH_NTH is not set
-CONFIG_IP_NF_MATCH_IPV4OPTIONS=m
-# CONFIG_IP_NF_MATCH_FUZZY is not set
-CONFIG_IP_NF_MATCH_RECENT=m
-CONFIG_IP_NF_MATCH_ECN=m
-CONFIG_IP_NF_MATCH_DSCP=m
-CONFIG_IP_NF_MATCH_AH_ESP=m
-CONFIG_IP_NF_MATCH_LENGTH=m
-# CONFIG_IP_NF_MATCH_U32 is not set
-CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_MATCH_TCPMSS=y
-# CONFIG_IP_NF_MATCH_REALM is not set
-CONFIG_IP_NF_MATCH_HELPER=m
-CONFIG_IP_NF_MATCH_STATE=y
-CONFIG_IP_NF_MATCH_CONNMARK=m
-CONFIG_IP_NF_MATCH_CONNLIMIT=m
-CONFIG_IP_NF_MATCH_CONNTRACK=m
-CONFIG_IP_NF_MATCH_UNCLEAN=m
-CONFIG_IP_NF_MATCH_STRING=m
-# CONFIG_IP_NF_MATCH_OWNER is not set
-CONFIG_IP_NF_MATCH_PHYSDEV=m
-CONFIG_IP_NF_FILTER=y
-CONFIG_IP_NF_TARGET_REJECT=y
-CONFIG_IP_NF_TARGET_NETLINK=m
-CONFIG_IP_NF_TARGET_IPV4OPTSSTRIP=m
-CONFIG_IP_NF_TARGET_MIRROR=m
-CONFIG_IP_NF_NAT=y
-CONFIG_IP_NF_NAT_NEEDED=y
-CONFIG_IP_NF_TARGET_MASQUERADE=y
-CONFIG_IP_NF_TARGET_REDIRECT=y
-CONFIG_IP_NF_NAT_H323=y
-# CONFIG_IP_NF_TARGET_SAME is not set
-# CONFIG_IP_NF_TARGET_NETMAP is not set
-CONFIG_IP_NF_NAT_PPTP=y
-CONFIG_IP_NF_NAT_PROTO_GRE=y
-# CONFIG_IP_NF_NAT_LOCAL is not set
-CONFIG_IP_NF_NAT_SNMP_BASIC=m
-CONFIG_IP_NF_NAT_IRC=y
-CONFIG_IP_NF_NAT_MMS=y
-CONFIG_IP_NF_NAT_FTP=y
-CONFIG_IP_NF_NAT_TFTP=y
-CONFIG_IP_NF_MANGLE=y
-CONFIG_IP_NF_TARGET_TOS=m
-CONFIG_IP_NF_TARGET_ECN=m
-CONFIG_IP_NF_TARGET_DSCP=m
-CONFIG_IP_NF_TARGET_MARK=y
-CONFIG_IP_NF_TARGET_IPMARK=m
-CONFIG_IP_NF_TARGET_CLASSIFY=m
-CONFIG_IP_NF_TARGET_LOG=y
-CONFIG_IP_NF_TARGET_CONNMARK=m
-CONFIG_IP_NF_TARGET_TTL=m
-CONFIG_IP_NF_TARGET_ULOG=m
-CONFIG_IP_NF_TARGET_TCPMSS=y
-# CONFIG_IP_NF_RAW is not set
-CONFIG_IP_NF_ARPTABLES=m
-CONFIG_IP_NF_ARPFILTER=m
-CONFIG_IP_NF_ARP_MANGLE=m
-CONFIG_IPV6=m
-
-#
-#   IPv6: Netfilter Configuration
-#
-CONFIG_IP6_NF_QUEUE=m
-CONFIG_IP6_NF_IPTABLES=m
-CONFIG_IP6_NF_MATCH_LIMIT=m
-CONFIG_IP6_NF_MATCH_MAC=m
-# CONFIG_IP6_NF_MATCH_RANDOM is not set
-# CONFIG_IP6_NF_MATCH_NTH is not set
-# CONFIG_IP6_NF_MATCH_FUZZY is not set
-# CONFIG_IP6_NF_MATCH_RT is not set
-# CONFIG_IP6_NF_MATCH_OPTS is not set
-# CONFIG_IP6_NF_MATCH_FRAG is not set
-# CONFIG_IP6_NF_MATCH_HL is not set
-CONFIG_IP6_NF_MATCH_MULTIPORT=m
-CONFIG_IP6_NF_MATCH_OWNER=m
-CONFIG_IP6_NF_MATCH_MARK=m
-# CONFIG_IP6_NF_MATCH_IPV6HEADER is not set
-# CONFIG_IP6_NF_MATCH_AHESP is not set
-CONFIG_IP6_NF_MATCH_LENGTH=m
-CONFIG_IP6_NF_MATCH_EUI64=m
-CONFIG_IP6_NF_FILTER=m
-CONFIG_IP6_NF_TARGET_REJECT=m
-# CONFIG_IP6_NF_TARGET_HL is not set
-CONFIG_IP6_NF_TARGET_LOG=m
-CONFIG_IP6_NF_MANGLE=m
-CONFIG_IP6_NF_TARGET_MARK=m
-# CONFIG_KHTTPD is not set
-# CONFIG_ATM is not set
-CONFIG_VLAN_8021Q=y
-# CONFIG_IPX is not set
-# CONFIG_ATALK is not set
-
-#
-# Appletalk devices
-#
-# CONFIG_DEV_APPLETALK is not set
-# CONFIG_DECNET is not set
-CONFIG_BRIDGE=y
-CONFIG_BRIDGE_NF_EBTABLES=m
-CONFIG_BRIDGE_EBT_T_FILTER=m
-CONFIG_BRIDGE_EBT_T_NAT=m
-CONFIG_BRIDGE_EBT_BROUTE=m
-CONFIG_BRIDGE_EBT_LOG=m
-CONFIG_BRIDGE_EBT_IPF=m
-CONFIG_BRIDGE_EBT_ARPF=m
-CONFIG_BRIDGE_EBT_AMONG=m
-CONFIG_BRIDGE_EBT_LIMIT=m
-CONFIG_BRIDGE_EBT_VLANF=m
-CONFIG_BRIDGE_EBT_802_3=m
-CONFIG_BRIDGE_EBT_PKTTYPE=m
-CONFIG_BRIDGE_EBT_STP=m
-CONFIG_BRIDGE_EBT_MARKF=m
-CONFIG_BRIDGE_EBT_ARPREPLY=m
-CONFIG_BRIDGE_EBT_SNAT=m
-CONFIG_BRIDGE_EBT_DNAT=m
-CONFIG_BRIDGE_EBT_REDIRECT=m
-CONFIG_BRIDGE_EBT_MARK_T=m
-# CONFIG_X25 is not set
-# CONFIG_LAPB is not set
-# CONFIG_LLC is not set
-# CONFIG_NET_DIVERT is not set
-# CONFIG_ECONET is not set
-CONFIG_WAN_ROUTER=m
-# CONFIG_NET_FASTROUTE is not set
-# CONFIG_NET_HW_FLOWCONTROL is not set
-
-#
-# QoS and/or fair queueing
-#
-CONFIG_NET_SCHED=y
-CONFIG_NET_SCH_CBQ=m
-CONFIG_NET_SCH_HTB=m
-CONFIG_NET_SCH_CSZ=m
-CONFIG_NET_SCH_PRIO=m
-CONFIG_NET_SCH_RED=m
-CONFIG_NET_SCH_SFQ=m
-CONFIG_NET_SCH_TEQL=m
-CONFIG_NET_SCH_TBF=m
-CONFIG_NET_SCH_GRED=m
-CONFIG_NET_SCH_DSMARK=m
-CONFIG_NET_SCH_INGRESS=m
-CONFIG_NET_QOS=y
-CONFIG_NET_ESTIMATOR=y
-CONFIG_NET_CLS=y
-CONFIG_NET_CLS_TCINDEX=m
-CONFIG_NET_CLS_ROUTE4=m
-CONFIG_NET_CLS_ROUTE=y
-CONFIG_NET_CLS_FW=m
-CONFIG_NET_CLS_U32=m
-CONFIG_NET_CLS_RSVP=m
-CONFIG_NET_CLS_RSVP6=m
-CONFIG_NET_CLS_POLICE=y
-
-#
-# Network testing
-#
-# CONFIG_NET_PKTGEN is not set
-
-#
-# Telephony Support
-#
-# CONFIG_PHONE is not set
-# CONFIG_PHONE_IXJ is not set
-# CONFIG_PHONE_IXJ_PCMCIA is not set
-
-#
-# ATA/IDE/MFM/RLL support
-#
-# CONFIG_IDE is not set
-# CONFIG_BLK_DEV_IDE_MODES is not set
-# CONFIG_BLK_DEV_HD is not set
-
-#
-# SCSI support
-#
-# CONFIG_SCSI is not set
-
-#
-# I2O device support
-#
-# CONFIG_I2O is not set
-# CONFIG_I2O_PCI is not set
-# CONFIG_I2O_BLOCK is not set
-# CONFIG_I2O_LAN is not set
-# CONFIG_I2O_SCSI is not set
-# CONFIG_I2O_PROC is not set
-
-#
-# Network device support
-#
-CONFIG_NETDEVICES=y
-
-#
-# Broadcom HND network devices
-#
-CONFIG_HND=y
-# CONFIG_IL is not set
-CONFIG_ET=m
-# CONFIG_ET_4413 is not set
-CONFIG_ET_47XX=y
-CONFIG_WL=m
-CONFIG_WL_AP=y
-CONFIG_WL_STA=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-CONFIG_TUN=m
-# CONFIG_ETHERTAP is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
-CONFIG_NET_ETHERNET=y
-# CONFIG_SUNLANCE is not set
-# CONFIG_HAPPYMEAL is not set
-# CONFIG_SUNBMAC is not set
-# CONFIG_SUNQE is not set
-# CONFIG_SUNGEM is not set
-# CONFIG_NET_VENDOR_3COM is not set
-# CONFIG_LANCE is not set
-# CONFIG_NET_VENDOR_SMC is not set
-# CONFIG_NET_VENDOR_RACAL is not set
-# CONFIG_HP100 is not set
-# CONFIG_NET_ISA is not set
-# CONFIG_NET_PCI is not set
-# CONFIG_NET_POCKET is not set
-
-#
-# Ethernet (1000 Mbit)
-#
-# CONFIG_ACENIC is not set
-# CONFIG_DL2K is not set
-# CONFIG_E1000 is not set
-# CONFIG_MYRI_SBUS is not set
-# CONFIG_NS83820 is not set
-# CONFIG_HAMACHI is not set
-# CONFIG_YELLOWFIN is not set
-# CONFIG_SK98LIN is not set
-# CONFIG_TIGON3 is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PLIP is not set
-CONFIG_PPP=y
-# CONFIG_PPP_MULTILINK is not set
-# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=m
-# CONFIG_PPP_SYNC_TTY is not set
-CONFIG_PPP_DEFLATE=m
-CONFIG_PPP_BSDCOMP=m
-CONFIG_PPP_MPPE=m
-CONFIG_PPPOE=m
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-CONFIG_NET_RADIO=y
-# CONFIG_STRIP is not set
-# CONFIG_WAVELAN is not set
-# CONFIG_ARLAN is not set
-# CONFIG_AIRONET4500 is not set
-# CONFIG_AIRONET4500_NONCS is not set
-# CONFIG_AIRONET4500_PROC is not set
-# CONFIG_AIRO is not set
-# CONFIG_HERMES is not set
-# CONFIG_PLX_HERMES is not set
-# CONFIG_PCI_HERMES is not set
-CONFIG_NET_WIRELESS=y
-
-#
-# Token Ring devices
-#
-# CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
-CONFIG_SHAPER=m
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# ISDN subsystem
-#
-# CONFIG_ISDN is not set
-
-#
-# Input core support
-#
-# CONFIG_INPUT is not set
-# CONFIG_INPUT_KEYBDEV is not set
-# CONFIG_INPUT_MOUSEDEV is not set
-# CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_EVDEV is not set
-
-#
-# Character devices
-#
-# CONFIG_VT is not set
-CONFIG_SERIAL=y
-CONFIG_SERIAL_CONSOLE=y
-# CONFIG_SERIAL_EXTENDED is not set
-# CONFIG_SERIAL_NONSTANDARD is not set
-CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=128
-
-#
-# I2C support
-#
-# CONFIG_I2C is not set
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
-# CONFIG_MOUSE is not set
-
-#
-# Joysticks
-#
-# CONFIG_INPUT_GAMEPORT is not set
-# CONFIG_QIC02_TAPE is not set
-
-#
-# Watchdog Cards
-#
-CONFIG_WATCHDOG=y
-CONFIG_WATCHDOG_NOWAYOUT=y
-# CONFIG_ACQUIRE_WDT is not set
-# CONFIG_ADVANTECH_WDT is not set
-# CONFIG_ALIM7101_WDT is not set
-# CONFIG_SC520_WDT is not set
-# CONFIG_PCWATCHDOG is not set
-# CONFIG_EUROTECH_WDT is not set
-# CONFIG_IB700_WDT is not set
-# CONFIG_WAFER_WDT is not set
-# CONFIG_I810_TCO is not set
-# CONFIG_MIXCOMWD is not set
-# CONFIG_60XX_WDT is not set
-# CONFIG_SC1200_WDT is not set
-CONFIG_SOFT_WATCHDOG=y
-# CONFIG_W83877F_WDT is not set
-# CONFIG_WDT is not set
-# CONFIG_WDTPCI is not set
-# CONFIG_MACHZ_WDT is not set
-# CONFIG_INDYDOG is not set
-# CONFIG_AMD7XX_TCO is not set
-# CONFIG_AMD_PM768 is not set
-# CONFIG_NVRAM is not set
-# CONFIG_RTC is not set
-# CONFIG_DTLK is not set
-# CONFIG_R3964 is not set
-# CONFIG_APPLICOM is not set
-
-#
-# Ftape, the floppy tape device driver
-#
-# CONFIG_FTAPE is not set
-# CONFIG_AGP is not set
-# CONFIG_DRM is not set
-
-#
-# File systems
-#
-CONFIG_BLKDEV_SWAP=m
-# CONFIG_QUOTA is not set
-# CONFIG_AUTOFS_FS is not set
-# CONFIG_AUTOFS4_FS is not set
-# CONFIG_REISERFS_FS is not set
-# CONFIG_REISERFS_CHECK is not set
-# CONFIG_REISERFS_PROC_INFO is not set
-# CONFIG_ADFS_FS is not set
-# CONFIG_ADFS_FS_RW is not set
-# CONFIG_AFFS_FS is not set
-# CONFIG_HFS_FS is not set
-# CONFIG_BEFS_FS is not set
-# CONFIG_BEFS_DEBUG is not set
-# CONFIG_BFS_FS is not set
-# CONFIG_EXT3_FS is not set
-# CONFIG_JBD is not set
-# CONFIG_JBD_DEBUG is not set
-# CONFIG_FAT_FS is not set
-# CONFIG_MSDOS_FS is not set
-# CONFIG_UMSDOS_FS is not set
-# CONFIG_VFAT_FS is not set
-# CONFIG_EFS_FS is not set
-# CONFIG_JFFS_FS is not set
-CONFIG_JFFS2_FS=y
-CONFIG_JFFS2_FS_DEBUG=0
-# CONFIG_JFFS2_BBC_ARMLIB is not set
-CONFIG_JFFS2_BBC_LZO=y
-CONFIG_JFFS2_BBC_LZARI=y
-CONFIG_JFFS2_BBC_LZHD=y
-CONFIG_JFFS2_BBC_LZSS=y
-# CONFIG_CRAMFS is not set
-CONFIG_SQUASHFS=y
-# CONFIG_TMPFS is not set
-CONFIG_RAMFS=y
-# CONFIG_ISO9660_FS is not set
-# CONFIG_JOLIET is not set
-# CONFIG_ZISOFS is not set
-# CONFIG_JFS_FS is not set
-# CONFIG_JFS_DEBUG is not set
-# CONFIG_JFS_STATISTICS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_VXFS_FS is not set
-# CONFIG_NTFS_FS is not set
-# CONFIG_NTFS_RW is not set
-# CONFIG_HPFS_FS is not set
-CONFIG_PROC_FS=y
-CONFIG_DEVFS_FS=y
-CONFIG_DEVFS_MOUNT=y
-# CONFIG_DEVFS_DEBUG is not set
-# CONFIG_DEVPTS_FS is not set
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_QNX4FS_RW is not set
-# CONFIG_ROMFS_FS is not set
-# CONFIG_EXT2_FS is not set
-# CONFIG_SYSV_FS is not set
-# CONFIG_UDF_FS is not set
-# CONFIG_UDF_RW is not set
-# CONFIG_UFS_FS is not set
-# CONFIG_UFS_FS_WRITE is not set
-
-#
-# Network File Systems
-#
-# CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
-CONFIG_NFS_FS=m
-CONFIG_NFS_V3=y
-# CONFIG_ROOT_NFS is not set
-CONFIG_SWAP_VIA_NFS=m
-CONFIG_NETSWAP=y
-# CONFIG_NFSD is not set
-# CONFIG_NFSD_V3 is not set
-# CONFIG_NFSD_TCP is not set
-CONFIG_SUNRPC=m
-CONFIG_LOCKD=m
-CONFIG_LOCKD_V4=y
-# CONFIG_SMB_FS is not set
-# CONFIG_NCP_FS is not set
-# CONFIG_NCPFS_PACKET_SIGNING is not set
-# CONFIG_NCPFS_IOCTL_LOCKING is not set
-# CONFIG_NCPFS_STRONG is not set
-# CONFIG_NCPFS_NFS_NS is not set
-# CONFIG_NCPFS_OS2_NS is not set
-# CONFIG_NCPFS_SMALLDOS is not set
-# CONFIG_NCPFS_NLS is not set
-# CONFIG_NCPFS_EXTRAS is not set
-# CONFIG_ZISOFS_FS is not set
-
-#
-# Partition Types
-#
-CONFIG_PARTITION_ADVANCED=y
-# CONFIG_ACORN_PARTITION is not set
-# CONFIG_OSF_PARTITION is not set
-# CONFIG_AMIGA_PARTITION is not set
-# CONFIG_ATARI_PARTITION is not set
-# CONFIG_MAC_PARTITION is not set
-# CONFIG_MSDOS_PARTITION is not set
-# CONFIG_LDM_PARTITION is not set
-# CONFIG_SGI_PARTITION is not set
-# CONFIG_ULTRIX_PARTITION is not set
-# CONFIG_SUN_PARTITION is not set
-# CONFIG_EFI_PARTITION is not set
-# CONFIG_SMB_NLS is not set
-# CONFIG_NLS is not set
-
-#
-# Multimedia devices
-#
-# CONFIG_VIDEO_DEV is not set
-
-#
-# Sound
-#
-# CONFIG_SOUND is not set
-
-#
-# USB support
-#
-# CONFIG_USB is not set
-
-#
-# Support for USB gadgets
-#
-# CONFIG_USB_GADGET is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BLUEZ is not set
-
-#
-# Kernel hacking
-#
-CONFIG_CROSSCOMPILE=y
-# CONFIG_KERNPROF is not set
-# CONFIG_MCOUNT is not set
-# CONFIG_DEBUG is not set
-CONFIG_MAGIC_SYSRQ=y
-# CONFIG_MIPS_UNCACHED is not set
-# CONFIG_KTRACE is not set
-# CONFIG_HWSIM is not set
-
-#
-# Library routines
-#
-CONFIG_ZLIB_INFLATE=y
-CONFIG_ZLIB_DEFLATE=y
diff --git a/obsolete-buildroot/sources/openwrt/kernel/netfilter/patches/100-revert_netfilter.patch b/obsolete-buildroot/sources/openwrt/kernel/netfilter/patches/100-revert_netfilter.patch
deleted file mode 100644 (file)
index 611261f..0000000
+++ /dev/null
@@ -1,5834 +0,0 @@
-diff -Nurb linux/include/linux/netfilter_ipv4/ip_conntrack.h linux.stock/include/linux/netfilter_ipv4/ip_conntrack.h
---- linux/include/linux/netfilter_ipv4/ip_conntrack.h  2003-08-12 07:43:11.000000000 -0400
-+++ linux.stock/include/linux/netfilter_ipv4/ip_conntrack.h    2004-05-09 04:13:03.000000000 -0400
-@@ -45,39 +45,27 @@
- #include <linux/netfilter_ipv4/ip_conntrack_tcp.h>
- #include <linux/netfilter_ipv4/ip_conntrack_icmp.h>
--#include <linux/netfilter_ipv4/ip_conntrack_proto_gre.h>
- /* per conntrack: protocol private data */
- union ip_conntrack_proto {
-       /* insert conntrack proto private data here */
--      struct ip_ct_gre gre;
-       struct ip_ct_tcp tcp;
-       struct ip_ct_icmp icmp;
- };
- union ip_conntrack_expect_proto {
-       /* insert expect proto private data here */
--      struct ip_ct_gre_expect gre;
- };
- /* Add protocol helper include file here */
--#include <linux/netfilter_ipv4/ip_conntrack_pptp.h>
--#include <linux/netfilter_ipv4/ip_conntrack_mms.h>
--#include <linux/netfilter_ipv4/ip_conntrack_h323.h>
--
- #include <linux/netfilter_ipv4/ip_conntrack_ftp.h>
- #include <linux/netfilter_ipv4/ip_conntrack_irc.h>
--#include <linux/netfilter_ipv4/ip_autofw.h>
- /* per expectation: application helper private data */
- union ip_conntrack_expect_help {
-       /* insert conntrack helper private data (expect) here */
--      struct ip_ct_pptp_expect exp_pptp_info;
--      struct ip_ct_mms_expect exp_mms_info;
--      struct ip_ct_h225_expect exp_h225_info;
-       struct ip_ct_ftp_expect exp_ftp_info;
-       struct ip_ct_irc_expect exp_irc_info;
--      struct ip_autofw_expect exp_autofw_info;
- #ifdef CONFIG_IP_NF_NAT_NEEDED
-       union {
-@@ -89,21 +77,16 @@
- /* per conntrack: application helper private data */
- union ip_conntrack_help {
-       /* insert conntrack helper private data (master) here */
--      struct ip_ct_pptp_master ct_pptp_info;
--      struct ip_ct_mms_master ct_mms_info;
--      struct ip_ct_h225_master ct_h225_info;
-       struct ip_ct_ftp_master ct_ftp_info;
-       struct ip_ct_irc_master ct_irc_info;
- };
- #ifdef CONFIG_IP_NF_NAT_NEEDED
- #include <linux/netfilter_ipv4/ip_nat.h>
--#include <linux/netfilter_ipv4/ip_nat_pptp.h>
- /* per conntrack: nat application helper private data */
- union ip_conntrack_nat_help {
-       /* insert nat helper private data here */
--      struct ip_nat_pptp nat_pptp_info;
- };
- #endif
-@@ -275,9 +258,5 @@
- }
- extern unsigned int ip_conntrack_htable_size;
--
--/* connection tracking time out variables. */
--extern int sysctl_ip_conntrack_tcp_timeouts[10];
--extern int sysctl_ip_conntrack_udp_timeouts[2];
- #endif /* __KERNEL__ */
- #endif /* _IP_CONNTRACK_H */
-diff -Nurb linux/include/linux/netfilter_ipv4/ip_conntrack_h323.h linux.stock/include/linux/netfilter_ipv4/ip_conntrack_h323.h
---- linux/include/linux/netfilter_ipv4/ip_conntrack_h323.h     2003-07-04 04:12:27.000000000 -0400
-+++ linux.stock/include/linux/netfilter_ipv4/ip_conntrack_h323.h       1969-12-31 19:00:00.000000000 -0500
-@@ -1,30 +0,0 @@
--#ifndef _IP_CONNTRACK_H323_H
--#define _IP_CONNTRACK_H323_H
--/* H.323 connection tracking. */
--
--#ifdef __KERNEL__
--/* Protects H.323 related data */
--DECLARE_LOCK_EXTERN(ip_h323_lock);
--#endif
--
--/* Default H.225 port */
--#define H225_PORT     1720
--
--/* This structure is per expected connection */
--struct ip_ct_h225_expect {
--      u_int16_t port;                 /* Port of the H.225 helper/RTCP/RTP channel */
--      enum ip_conntrack_dir dir;      /* Direction of the original connection */
--      unsigned int offset;            /* offset of the address in the payload */
--};
--
--/* This structure exists only once per master */
--struct ip_ct_h225_master {
--      int is_h225;                            /* H.225 or H.245 connection */
--#ifdef CONFIG_IP_NF_NAT_NEEDED
--      enum ip_conntrack_dir dir;              /* Direction of the original connection */
--      u_int32_t seq[IP_CT_DIR_MAX];           /* Exceptional packet mangling for signal addressess... */
--      unsigned int offset[IP_CT_DIR_MAX];     /* ...and the offset of the addresses in the payload */
--#endif
--};
--
--#endif /* _IP_CONNTRACK_H323_H */
-diff -Nurb linux/include/linux/netfilter_ipv4/ip_conntrack_mms.h linux.stock/include/linux/netfilter_ipv4/ip_conntrack_mms.h
---- linux/include/linux/netfilter_ipv4/ip_conntrack_mms.h      2003-07-04 04:12:27.000000000 -0400
-+++ linux.stock/include/linux/netfilter_ipv4/ip_conntrack_mms.h        1969-12-31 19:00:00.000000000 -0500
-@@ -1,31 +0,0 @@
--#ifndef _IP_CONNTRACK_MMS_H
--#define _IP_CONNTRACK_MMS_H
--/* MMS tracking. */
--
--#ifdef __KERNEL__
--#include <linux/netfilter_ipv4/lockhelp.h>
--
--DECLARE_LOCK_EXTERN(ip_mms_lock);
--
--#define MMS_PORT                         1755
--#define MMS_SRV_MSG_ID                   196610
--
--#define MMS_SRV_MSG_OFFSET               36
--#define MMS_SRV_UNICODE_STRING_OFFSET    60
--#define MMS_SRV_CHUNKLENLV_OFFSET        16
--#define MMS_SRV_CHUNKLENLM_OFFSET        32
--#define MMS_SRV_MESSAGELENGTH_OFFSET     8
--#endif
--
--/* This structure is per expected connection */
--struct ip_ct_mms_expect {
--      u_int32_t len;
--      u_int32_t padding;
--      u_int16_t port;
--};
--
--/* This structure exists only once per master */
--struct ip_ct_mms_master {
--};
--
--#endif /* _IP_CONNTRACK_MMS_H */
-diff -Nurb linux/include/linux/netfilter_ipv4/ip_conntrack_pptp.h linux.stock/include/linux/netfilter_ipv4/ip_conntrack_pptp.h
---- linux/include/linux/netfilter_ipv4/ip_conntrack_pptp.h     2003-07-04 04:12:27.000000000 -0400
-+++ linux.stock/include/linux/netfilter_ipv4/ip_conntrack_pptp.h       1969-12-31 19:00:00.000000000 -0500
-@@ -1,313 +0,0 @@
--/* PPTP constants and structs */
--#ifndef _CONNTRACK_PPTP_H
--#define _CONNTRACK_PPTP_H
--
--/* state of the control session */
--enum pptp_ctrlsess_state {
--      PPTP_SESSION_NONE,                      /* no session present */
--      PPTP_SESSION_ERROR,                     /* some session error */
--      PPTP_SESSION_STOPREQ,                   /* stop_sess request seen */
--      PPTP_SESSION_REQUESTED,                 /* start_sess request seen */
--      PPTP_SESSION_CONFIRMED,                 /* session established */
--};
--
--/* state of the call inside the control session */
--enum pptp_ctrlcall_state {
--      PPTP_CALL_NONE,
--      PPTP_CALL_ERROR,
--      PPTP_CALL_OUT_REQ,
--      PPTP_CALL_OUT_CONF,
--      PPTP_CALL_IN_REQ,
--      PPTP_CALL_IN_REP,
--      PPTP_CALL_IN_CONF,
--      PPTP_CALL_CLEAR_REQ,
--};
--
--
--/* conntrack private data */
--struct ip_ct_pptp_master {
--      enum pptp_ctrlsess_state sstate;        /* session state */
--
--      /* everything below is going to be per-expectation in newnat,
--       * since there could be more than one call within one session */
--      enum pptp_ctrlcall_state cstate;        /* call state */
--      u_int16_t pac_call_id;                  /* call id of PAC, host byte order */
--      u_int16_t pns_call_id;                  /* call id of PNS, host byte order */
--};
--
--/* conntrack_expect private member */
--struct ip_ct_pptp_expect {
--      enum pptp_ctrlcall_state cstate;        /* call state */
--      u_int16_t pac_call_id;                  /* call id of PAC */
--      u_int16_t pns_call_id;                  /* call id of PNS */
--};
--
--
--#ifdef __KERNEL__
--
--#include <linux/netfilter_ipv4/lockhelp.h>
--DECLARE_LOCK_EXTERN(ip_pptp_lock);
--
--#define IP_CONNTR_PPTP                PPTP_CONTROL_PORT
--
--union pptp_ctrl_union {
--                void                          *rawreq;
--              struct PptpStartSessionRequest  *sreq;
--              struct PptpStartSessionReply    *srep;
--              struct PptpStopSessionReqest    *streq;
--              struct PptpStopSessionReply     *strep;
--                struct PptpOutCallRequest       *ocreq;
--                struct PptpOutCallReply         *ocack;
--                struct PptpInCallRequest        *icreq;
--                struct PptpInCallReply          *icack;
--                struct PptpInCallConnected      *iccon;
--              struct PptpClearCallRequest     *clrreq;
--                struct PptpCallDisconnectNotify *disc;
--                struct PptpWanErrorNotify       *wanerr;
--                struct PptpSetLinkInfo          *setlink;
--};
--
--
--
--#define PPTP_CONTROL_PORT     1723
--
--#define PPTP_PACKET_CONTROL   1
--#define PPTP_PACKET_MGMT      2
--
--#define PPTP_MAGIC_COOKIE     0x1a2b3c4d
--
--struct pptp_pkt_hdr {
--      __u16   packetLength;
--      __u16   packetType;
--      __u32   magicCookie;
--};
--
--/* PptpControlMessageType values */
--#define PPTP_START_SESSION_REQUEST    1
--#define PPTP_START_SESSION_REPLY      2
--#define PPTP_STOP_SESSION_REQUEST     3
--#define PPTP_STOP_SESSION_REPLY               4
--#define PPTP_ECHO_REQUEST             5
--#define PPTP_ECHO_REPLY                       6
--#define PPTP_OUT_CALL_REQUEST         7
--#define PPTP_OUT_CALL_REPLY           8
--#define PPTP_IN_CALL_REQUEST          9
--#define PPTP_IN_CALL_REPLY            10
--#define PPTP_IN_CALL_CONNECT          11
--#define PPTP_CALL_CLEAR_REQUEST               12
--#define PPTP_CALL_DISCONNECT_NOTIFY   13
--#define PPTP_WAN_ERROR_NOTIFY         14
--#define PPTP_SET_LINK_INFO            15
--
--#define PPTP_MSG_MAX                  15
--
--/* PptpGeneralError values */
--#define PPTP_ERROR_CODE_NONE          0
--#define PPTP_NOT_CONNECTED            1
--#define PPTP_BAD_FORMAT                       2
--#define PPTP_BAD_VALUE                        3
--#define PPTP_NO_RESOURCE              4
--#define PPTP_BAD_CALLID                       5
--#define PPTP_REMOVE_DEVICE_ERROR      6
--
--struct PptpControlHeader {
--      __u16   messageType;
--      __u16   reserved;
--};
--
--/* FramingCapability Bitmap Values */
--#define PPTP_FRAME_CAP_ASYNC          0x1
--#define PPTP_FRAME_CAP_SYNC           0x2
--
--/* BearerCapability Bitmap Values */
--#define PPTP_BEARER_CAP_ANALOG                0x1
--#define PPTP_BEARER_CAP_DIGITAL               0x2
--
--struct PptpStartSessionRequest {
--      __u16   protocolVersion;
--      __u8    reserved1;
--      __u8    reserved2;
--      __u32   framingCapability;
--      __u32   bearerCapability;
--      __u16   maxChannels;
--      __u16   firmwareRevision;
--      __u8    hostName[64];
--      __u8    vendorString[64];
--};
--
--/* PptpStartSessionResultCode Values */
--#define PPTP_START_OK                 1
--#define PPTP_START_GENERAL_ERROR      2
--#define PPTP_START_ALREADY_CONNECTED  3
--#define PPTP_START_NOT_AUTHORIZED     4
--#define PPTP_START_UNKNOWN_PROTOCOL   5
--
--struct PptpStartSessionReply {
--      __u16   protocolVersion;
--      __u8    resultCode;
--      __u8    generalErrorCode;
--      __u32   framingCapability;
--      __u32   bearerCapability;
--      __u16   maxChannels;
--      __u16   firmwareRevision;
--      __u8    hostName[64];
--      __u8    vendorString[64];
--};
--
--/* PptpStopReasons */
--#define PPTP_STOP_NONE                        1
--#define PPTP_STOP_PROTOCOL            2
--#define PPTP_STOP_LOCAL_SHUTDOWN      3
--
--struct PptpStopSessionRequest {
--      __u8    reason;
--};
--
--/* PptpStopSessionResultCode */
--#define PPTP_STOP_OK                  1
--#define PPTP_STOP_GENERAL_ERROR               2
--
--struct PptpStopSessionReply {
--      __u8    resultCode;
--      __u8    generalErrorCode;
--};
--
--struct PptpEchoRequest {
--      __u32 identNumber;
--};
--
--/* PptpEchoReplyResultCode */
--#define PPTP_ECHO_OK                  1
--#define PPTP_ECHO_GENERAL_ERROR               2
--
--struct PptpEchoReply {
--      __u32   identNumber;
--      __u8    resultCode;
--      __u8    generalErrorCode;
--      __u16   reserved;
--};
--
--/* PptpFramingType */
--#define PPTP_ASYNC_FRAMING            1
--#define PPTP_SYNC_FRAMING             2
--#define PPTP_DONT_CARE_FRAMING                3
--
--/* PptpCallBearerType */
--#define PPTP_ANALOG_TYPE              1
--#define PPTP_DIGITAL_TYPE             2
--#define PPTP_DONT_CARE_BEARER_TYPE    3
--
--struct PptpOutCallRequest {
--      __u16   callID;
--      __u16   callSerialNumber;
--      __u32   minBPS;
--      __u32   maxBPS;
--      __u32   bearerType;
--      __u32   framingType;
--      __u16   packetWindow;
--      __u16   packetProcDelay;
--      __u16   reserved1;
--      __u16   phoneNumberLength;
--      __u16   reserved2;
--      __u8    phoneNumber[64];
--      __u8    subAddress[64];
--};
--
--/* PptpCallResultCode */
--#define PPTP_OUTCALL_CONNECT          1
--#define PPTP_OUTCALL_GENERAL_ERROR    2
--#define PPTP_OUTCALL_NO_CARRIER               3
--#define PPTP_OUTCALL_BUSY             4
--#define PPTP_OUTCALL_NO_DIAL_TONE     5
--#define PPTP_OUTCALL_TIMEOUT          6
--#define PPTP_OUTCALL_DONT_ACCEPT      7
--
--struct PptpOutCallReply {
--      __u16   callID;
--      __u16   peersCallID;
--      __u8    resultCode;
--      __u8    generalErrorCode;
--      __u16   causeCode;
--      __u32   connectSpeed;
--      __u16   packetWindow;
--      __u16   packetProcDelay;
--      __u32   physChannelID;
--};
--
--struct PptpInCallRequest {
--      __u16   callID;
--      __u16   callSerialNumber;
--      __u32   callBearerType;
--      __u32   physChannelID;
--      __u16   dialedNumberLength;
--      __u16   dialingNumberLength;
--      __u8    dialedNumber[64];
--      __u8    dialingNumber[64];
--      __u8    subAddress[64];
--};
--
--/* PptpInCallResultCode */
--#define PPTP_INCALL_ACCEPT            1
--#define PPTP_INCALL_GENERAL_ERROR     2
--#define PPTP_INCALL_DONT_ACCEPT               3
--
--struct PptpInCallReply {
--      __u16   callID;
--      __u16   peersCallID;
--      __u8    resultCode;
--      __u8    generalErrorCode;
--      __u16   packetWindow;
--      __u16   packetProcDelay;
--      __u16   reserved;
--};
--
--struct PptpInCallConnected {
--      __u16   peersCallID;
--      __u16   reserved;
--      __u32   connectSpeed;
--      __u16   packetWindow;
--      __u16   packetProcDelay;
--      __u32   callFramingType;
--};
--
--struct PptpClearCallRequest {
--      __u16   callID;
--      __u16   reserved;
--};
--
--struct PptpCallDisconnectNotify {
--      __u16   callID;
--      __u8    resultCode;
--      __u8    generalErrorCode;
--      __u16   causeCode;
--      __u16   reserved;
--      __u8    callStatistics[128];
--};
--
--struct PptpWanErrorNotify {
--      __u16   peersCallID;
--      __u16   reserved;
--      __u32   crcErrors;
--      __u32   framingErrors;
--      __u32   hardwareOverRuns;
--      __u32   bufferOverRuns;
--      __u32   timeoutErrors;
--      __u32   alignmentErrors;
--};
--
--struct PptpSetLinkInfo {
--      __u16   peersCallID;
--      __u16   reserved;
--      __u32   sendAccm;
--      __u32   recvAccm;
--};
--
--
--struct pptp_priv_data {
--      __u16   call_id;
--      __u16   mcall_id;
--      __u16   pcall_id;
--};
--
--#endif /* __KERNEL__ */
--#endif /* _CONNTRACK_PPTP_H */
-diff -Nurb linux/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h linux.stock/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h
---- linux/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h        2003-07-04 04:12:27.000000000 -0400
-+++ linux.stock/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h  1969-12-31 19:00:00.000000000 -0500
-@@ -1,121 +0,0 @@
--#ifndef _CONNTRACK_PROTO_GRE_H
--#define _CONNTRACK_PROTO_GRE_H
--#include <asm/byteorder.h>
--
--/* GRE PROTOCOL HEADER */
--
--/* GRE Version field */
--#define GRE_VERSION_1701      0x0
--#define GRE_VERSION_PPTP      0x1
--
--/* GRE Protocol field */
--#define GRE_PROTOCOL_PPTP     0x880B
--
--/* GRE Flags */
--#define GRE_FLAG_C            0x80
--#define GRE_FLAG_R            0x40
--#define GRE_FLAG_K            0x20
--#define GRE_FLAG_S            0x10
--#define GRE_FLAG_A            0x80
--
--#define GRE_IS_C(f)   ((f)&GRE_FLAG_C)
--#define GRE_IS_R(f)   ((f)&GRE_FLAG_R)
--#define GRE_IS_K(f)   ((f)&GRE_FLAG_K)
--#define GRE_IS_S(f)   ((f)&GRE_FLAG_S)
--#define GRE_IS_A(f)   ((f)&GRE_FLAG_A)
--
--/* GRE is a mess: Four different standards */
--struct gre_hdr {
--#if defined(__LITTLE_ENDIAN_BITFIELD)
--      __u16   rec:3,
--              srr:1,
--              seq:1,
--              key:1,
--              routing:1,
--              csum:1,
--              version:3,
--              reserved:4,
--              ack:1;
--#elif defined(__BIG_ENDIAN_BITFIELD)
--      __u16   csum:1,
--              routing:1,
--              key:1,
--              seq:1,
--              srr:1,
--              rec:3,
--              ack:1,
--              reserved:4,
--              version:3;
--#else
--#error "Adjust your <asm/byteorder.h> defines"
--#endif
--      __u16   protocol;
--};
--
--/* modified GRE header for PPTP */
--struct gre_hdr_pptp {
--      __u8  flags;            /* bitfield */
--      __u8  version;          /* should be GRE_VERSION_PPTP */
--      __u16 protocol;         /* should be GRE_PROTOCOL_PPTP */
--      __u16 payload_len;      /* size of ppp payload, not inc. gre header */
--      __u16 call_id;          /* peer's call_id for this session */
--      __u32 seq;              /* sequence number.  Present if S==1 */
--      __u32 ack;              /* seq number of highest packet recieved by */
--                              /*  sender in this session */
--};
--
--
--/* this is part of ip_conntrack */
--struct ip_ct_gre {
--      unsigned int stream_timeout;
--      unsigned int timeout;
--};
--
--/* this is part of ip_conntrack_expect */
--struct ip_ct_gre_expect {
--      struct ip_ct_gre_keymap *keymap_orig, *keymap_reply;
--};
--
--#ifdef __KERNEL__
--
--/* structure for original <-> reply keymap */
--struct ip_ct_gre_keymap {
--      struct list_head list;
--
--      struct ip_conntrack_tuple tuple;
--      struct ip_conntrack_expect *master;
--};
--
--
--/* add new tuple->key_reply pair to keymap */
--int ip_ct_gre_keymap_add(struct ip_conntrack_expect *exp,
--                       struct ip_conntrack_tuple *t,
--                       int reply);
--
--/* change an existing keymap entry */
--void ip_ct_gre_keymap_change(struct ip_ct_gre_keymap *km,
--                           struct ip_conntrack_tuple *t);
--
--
--
--/* get pointer to gre key, if present */
--static inline u_int32_t *gre_key(struct gre_hdr *greh)
--{
--      if (!greh->key)
--              return NULL;
--      if (greh->csum || greh->routing)
--              return (u_int32_t *) (greh+sizeof(*greh)+4);
--      return (u_int32_t *) (greh+sizeof(*greh));
--}
--
--/* get pointer ot gre csum, if present */
--static inline u_int16_t *gre_csum(struct gre_hdr *greh)
--{
--      if (!greh->csum)
--              return NULL;
--      return (u_int16_t *) (greh+sizeof(*greh));
--}
--
--#endif /* __KERNEL__ */
--
--#endif /* _CONNTRACK_PROTO_GRE_H */
-diff -Nurb linux/include/linux/netfilter_ipv4/ip_conntrack_tftp.h linux.stock/include/linux/netfilter_ipv4/ip_conntrack_tftp.h
---- linux/include/linux/netfilter_ipv4/ip_conntrack_tftp.h     2003-07-04 04:12:27.000000000 -0400
-+++ linux.stock/include/linux/netfilter_ipv4/ip_conntrack_tftp.h       1969-12-31 19:00:00.000000000 -0500
-@@ -1,13 +0,0 @@
--#ifndef _IP_CT_TFTP
--#define _IP_CT_TFTP
--
--#define TFTP_PORT 69
--
--struct tftphdr {
--      u_int16_t opcode;
--};
--
--#define TFTP_OPCODE_READ      1
--#define TFTP_OPCODE_WRITE     2
--
--#endif /* _IP_CT_TFTP */
-diff -Nurb linux/include/linux/netfilter_ipv4/ip_conntrack_tuple.h linux.stock/include/linux/netfilter_ipv4/ip_conntrack_tuple.h
---- linux/include/linux/netfilter_ipv4/ip_conntrack_tuple.h    2003-07-04 04:12:27.000000000 -0400
-+++ linux.stock/include/linux/netfilter_ipv4/ip_conntrack_tuple.h      2004-05-09 04:13:03.000000000 -0400
-@@ -14,7 +14,7 @@
- union ip_conntrack_manip_proto
- {
-       /* Add other protocols here. */
--      u_int32_t all;
-+      u_int16_t all;
-       struct {
-               u_int16_t port;
-@@ -25,9 +25,6 @@
-       struct {
-               u_int16_t id;
-       } icmp;
--      struct {
--              u_int32_t key;
--      } gre;
- };
- /* The manipulable part of the tuple. */
-@@ -47,7 +44,7 @@
-               u_int32_t ip;
-               union {
-                       /* Add other protocols here. */
--                      u_int64_t all;
-+                      u_int16_t all;
-                       struct {
-                               u_int16_t port;
-@@ -58,11 +55,6 @@
-                       struct {
-                               u_int8_t type, code;
-                       } icmp;
--                      struct {
--                              u_int16_t protocol;
--                              u_int8_t version;
--                              u_int32_t key;
--                      } gre;
-               } u;
-               /* The protocol. */
-@@ -80,16 +72,10 @@
- #ifdef __KERNEL__
- #define DUMP_TUPLE(tp)                                                \
--DEBUGP("tuple %p: %u %u.%u.%u.%u:%u -> %u.%u.%u.%u:%u\n",     \
-+DEBUGP("tuple %p: %u %u.%u.%u.%u:%hu -> %u.%u.%u.%u:%hu\n",   \
-        (tp), (tp)->dst.protonum,                              \
--       NIPQUAD((tp)->src.ip), ntohl((tp)->src.u.all),         \
--       NIPQUAD((tp)->dst.ip), ntohl((tp)->dst.u.all))
--
--#define DUMP_TUPLE_RAW(x)                                             \
--      DEBUGP("tuple %p: %u %u.%u.%u.%u:0x%08x -> %u.%u.%u.%u:0x%08x\n",\
--      (x), (x)->dst.protonum,                                         \
--      NIPQUAD((x)->src.ip), ntohl((x)->src.u.all),                    \
--      NIPQUAD((x)->dst.ip), ntohl((x)->dst.u.all))
-+       NIPQUAD((tp)->src.ip), ntohs((tp)->src.u.all),         \
-+       NIPQUAD((tp)->dst.ip), ntohs((tp)->dst.u.all))
- #define CTINFO2DIR(ctinfo) ((ctinfo) >= IP_CT_IS_REPLY ? IP_CT_DIR_REPLY : IP_CT_DIR_ORIGINAL)
-diff -Nurb linux/include/linux/netfilter_ipv4/ip_nat_pptp.h linux.stock/include/linux/netfilter_ipv4/ip_nat_pptp.h
---- linux/include/linux/netfilter_ipv4/ip_nat_pptp.h   2003-07-04 04:12:27.000000000 -0400
-+++ linux.stock/include/linux/netfilter_ipv4/ip_nat_pptp.h     1969-12-31 19:00:00.000000000 -0500
-@@ -1,11 +0,0 @@
--/* PPTP constants and structs */
--#ifndef _NAT_PPTP_H
--#define _NAT_PPTP_H
--
--/* conntrack private data */
--struct ip_nat_pptp {
--      u_int16_t pns_call_id;          /* NAT'ed PNS call id */
--      u_int16_t pac_call_id;          /* NAT'ed PAC call id */
--};
--
--#endif /* _NAT_PPTP_H */
-diff -Nurb linux/include/linux/netfilter_ipv4/ip_pool.h linux.stock/include/linux/netfilter_ipv4/ip_pool.h
---- linux/include/linux/netfilter_ipv4/ip_pool.h       2003-07-04 04:12:27.000000000 -0400
-+++ linux.stock/include/linux/netfilter_ipv4/ip_pool.h 1969-12-31 19:00:00.000000000 -0500
-@@ -1,64 +0,0 @@
--#ifndef _IP_POOL_H
--#define _IP_POOL_H
--
--/***************************************************************************/
--/*  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, or    */
--/*  (at your option) any later version.                                          */
--/*                                                                       */
--/*  This program is distributed in the hope that it will be useful,      */
--/*  but WITHOUT ANY WARRANTY; without even the implied warranty of       */
--/*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        */
--/*  GNU General Public License for more details.                         */
--/*                                                                       */
--/*  You should have received a copy of the GNU General Public License    */
--/*  along with this program; if not, write to the Free Software                  */
--/*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA*/
--/***************************************************************************/
--
--/* A sockopt of such quality has hardly ever been seen before on the open
-- * market!  This little beauty, hardly ever used: above 64, so it's
-- * traditionally used for firewalling, not touched (even once!) by the
-- * 2.0, 2.2 and 2.4 kernels!
-- *
-- * Comes with its own certificate of authenticity, valid anywhere in the
-- * Free world!
-- *
-- * Rusty, 19.4.2000
-- */
--#define SO_IP_POOL 81
--
--typedef int ip_pool_t;                        /* pool index */
--#define IP_POOL_NONE  ((ip_pool_t)-1)
--
--struct ip_pool_request {
--      int op;
--      ip_pool_t index;
--      u_int32_t addr;
--      u_int32_t addr2;
--};
--
--/* NOTE: I deliberately break the first cut ippool utility. Nobody uses it. */
--
--#define IP_POOL_BAD001                0x00000010
--
--#define IP_POOL_FLUSH         0x00000011      /* req.index, no arguments */
--#define IP_POOL_INIT          0x00000012      /* from addr to addr2 incl. */
--#define IP_POOL_DESTROY               0x00000013      /* req.index, no arguments */
--#define IP_POOL_ADD_ADDR      0x00000014      /* add addr to pool */
--#define IP_POOL_DEL_ADDR      0x00000015      /* del addr from pool */
--#define IP_POOL_HIGH_NR               0x00000016      /* result in req.index */
--#define IP_POOL_LOOKUP                0x00000017      /* result in addr and addr2 */
--#define IP_POOL_USAGE         0x00000018      /* result in addr */
--#define IP_POOL_TEST_ADDR     0x00000019      /* result (0/1) returned */
--
--#ifdef __KERNEL__
--
--/* NOTE: ip_pool_match() and ip_pool_mod() expect ADDR to be host byte order */
--extern int ip_pool_match(ip_pool_t pool, u_int32_t addr);
--extern int ip_pool_mod(ip_pool_t pool, u_int32_t addr, int isdel);
--
--#endif
--
--#endif /*_IP_POOL_H*/
-diff -Nurb linux/include/linux/netfilter_ipv4/ipt_pool.h linux.stock/include/linux/netfilter_ipv4/ipt_pool.h
---- linux/include/linux/netfilter_ipv4/ipt_pool.h      2003-07-04 04:12:27.000000000 -0400
-+++ linux.stock/include/linux/netfilter_ipv4/ipt_pool.h        1969-12-31 19:00:00.000000000 -0500
-@@ -1,25 +0,0 @@
--#ifndef _IPT_POOL_H
--#define _IPT_POOL_H
--
--#include <linux/netfilter_ipv4/ip_pool.h>
--
--#define IPT_POOL_INV_SRC      0x00000001
--#define IPT_POOL_INV_DST      0x00000002
--#define IPT_POOL_DEL_SRC      0x00000004
--#define IPT_POOL_DEL_DST      0x00000008
--#define IPT_POOL_INV_MOD_SRC  0x00000010
--#define IPT_POOL_INV_MOD_DST  0x00000020
--#define IPT_POOL_MOD_SRC_ACCEPT       0x00000040
--#define IPT_POOL_MOD_DST_ACCEPT       0x00000080
--#define IPT_POOL_MOD_SRC_DROP 0x00000100
--#define IPT_POOL_MOD_DST_DROP 0x00000200
--
--/* match info */
--struct ipt_pool_info
--{
--      ip_pool_t src;
--      ip_pool_t dst;
--      unsigned flags;
--};
--
--#endif /*_IPT_POOL_H*/
-diff -Nurb linux/net/ipv4/netfilter/Config.in linux.stock/net/ipv4/netfilter/Config.in
---- linux/net/ipv4/netfilter/Config.in 2004-02-19 06:04:35.000000000 -0500
-+++ linux.stock/net/ipv4/netfilter/Config.in   2004-05-09 04:13:03.000000000 -0400
-@@ -7,12 +7,7 @@
- tristate 'Connection tracking (required for masq/NAT)' CONFIG_IP_NF_CONNTRACK
- if [ "$CONFIG_IP_NF_CONNTRACK" != "n" ]; then
-   dep_tristate '  FTP protocol support' CONFIG_IP_NF_FTP $CONFIG_IP_NF_CONNTRACK
--  dep_tristate '  TFTP protocol support' CONFIG_IP_NF_TFTP $CONFIG_IP_NF_CONNTRACK
--  dep_tristate '  H.323 (netmeeting) support' CONFIG_IP_NF_H323 $CONFIG_IP_NF_CONNTRACK
-   dep_tristate '  IRC protocol support' CONFIG_IP_NF_IRC $CONFIG_IP_NF_CONNTRACK
--  dep_tristate '  MMS protocol support' CONFIG_IP_NF_MMS $CONFIG_IP_NF_CONNTRACK
--  dep_tristate '  GRE protocol support' CONFIG_IP_NF_CT_PROTO_GRE $CONFIG_IP_NF_CONNTRACK
--  dep_tristate '   PPTP protocol support' CONFIG_IP_NF_PPTP $CONFIG_IP_NF_CT_PROTO_GRE
- fi
- if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-@@ -22,19 +17,11 @@
- if [ "$CONFIG_IP_NF_IPTABLES" != "n" ]; then
- # The simple matches.
-   dep_tristate '  limit match support' CONFIG_IP_NF_MATCH_LIMIT $CONFIG_IP_NF_IPTABLES
--
--  dep_tristate '  IP address pool support' CONFIG_IP_NF_POOL $CONFIG_IP_NF_IPTABLES
--  if [ "$CONFIG_IP_NF_POOL" = "y" -o "$CONFIG_IP_NF_POOL" = "m" ]; then
--    bool '    enable statistics on pool usage' CONFIG_IP_POOL_STATISTICS n
--  fi
--
-   dep_tristate '  MAC address match support' CONFIG_IP_NF_MATCH_MAC $CONFIG_IP_NF_IPTABLES
-   dep_tristate '  Packet type match support' CONFIG_IP_NF_MATCH_PKTTYPE $CONFIG_IP_NF_IPTABLES
-   dep_tristate '  netfilter MARK match support' CONFIG_IP_NF_MATCH_MARK $CONFIG_IP_NF_IPTABLES
-   dep_tristate '  Multiple port match support' CONFIG_IP_NF_MATCH_MULTIPORT $CONFIG_IP_NF_IPTABLES
--  dep_tristate '  Multiple port with ranges match support' CONFIG_IP_NF_MATCH_MPORT $CONFIG_IP_NF_IPTABLES
-   dep_tristate '  TOS match support' CONFIG_IP_NF_MATCH_TOS $CONFIG_IP_NF_IPTABLES
--  dep_tristate '  TIME match support (EXPERIMENTAL)' CONFIG_IP_NF_MATCH_TIME $CONFIG_IP_NF_IPTABLES
-   dep_tristate '  ECN match support' CONFIG_IP_NF_MATCH_ECN $CONFIG_IP_NF_IPTABLES
-  
-   dep_tristate '  DSCP match support' CONFIG_IP_NF_MATCH_DSCP $CONFIG_IP_NF_IPTABLES
-@@ -52,7 +39,6 @@
-   fi
-   if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-     dep_tristate '  Unclean match support (EXPERIMENTAL)' CONFIG_IP_NF_MATCH_UNCLEAN $CONFIG_IP_NF_IPTABLES
--    dep_tristate '  Webstr match support (EXPERIMENTAL)' CONFIG_IP_NF_MATCH_WEBSTR $CONFIG_IP_NF_IPTABLES
-     dep_tristate '  Owner match support (EXPERIMENTAL)' CONFIG_IP_NF_MATCH_OWNER $CONFIG_IP_NF_IPTABLES
-   fi
- # The targets
-@@ -70,29 +56,6 @@
-       define_bool CONFIG_IP_NF_NAT_NEEDED y
-       dep_tristate '    MASQUERADE target support' CONFIG_IP_NF_TARGET_MASQUERADE $CONFIG_IP_NF_NAT
-       dep_tristate '    REDIRECT target support' CONFIG_IP_NF_TARGET_REDIRECT $CONFIG_IP_NF_NAT
--      dep_tristate '    Automatic port forwarding (autofw) target support' CONFIG_IP_NF_AUTOFW $CONFIG_IP_NF_NAT
--      dep_tristate '    TRIGGER target support (port-trigger)' CONFIG_IP_NF_TARGET_TRIGGER $CONFIG_IP_NF_NAT
--      if [ "$CONFIG_IP_NF_H323" = "m" ]; then
--       define_tristate CONFIG_IP_NF_NAT_H323 m
--      else
--        if [ "$CONFIG_IP_NF_H323" = "y" ]; then
--          define_tristate CONFIG_IP_NF_NAT_H323 $CONFIG_IP_NF_NAT
--        fi
--      fi
--      if [ "$CONFIG_IP_NF_PPTP" = "m" ]; then
--        define_tristate CONFIG_IP_NF_NAT_PPTP m
--      else
--        if [ "$CONFIG_IP_NF_PPTP" = "y" ]; then
--          define_tristate CONFIG_IP_NF_NAT_PPTP $CONFIG_IP_NF_NAT
--        fi
--      fi
--      if [ "$CONFIG_IP_NF_CT_PROTO_GRE" = "m" ]; then
--        define_tristate CONFIG_IP_NF_NAT_PROTO_GRE m
--      else
--        if [ "$CONFIG_IP_NF_CT_PROTO_GRE" = "y" ]; then
--          define_tristate CONFIG_IP_NF_NAT_PROTO_GRE $CONFIG_IP_NF_NAT
--        fi
--      fi
-       bool '    NAT of local connections (READ HELP)' CONFIG_IP_NF_NAT_LOCAL
-       if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-         dep_tristate '    Basic SNMP-ALG support (EXPERIMENTAL)' CONFIG_IP_NF_NAT_SNMP_BASIC $CONFIG_IP_NF_NAT
-@@ -104,13 +67,6 @@
-           define_tristate CONFIG_IP_NF_NAT_IRC $CONFIG_IP_NF_NAT
-         fi
-       fi
--      if [ "$CONFIG_IP_NF_MMS" = "m" ]; then
--        define_tristate CONFIG_IP_NF_NAT_MMS m
--      else
--        if [ "$CONFIG_IP_NF_MMS" = "y" ]; then
--          define_tristate CONFIG_IP_NF_NAT_MMS $CONFIG_IP_NF_NAT
--        fi
--      fi
-       # If they want FTP, set to $CONFIG_IP_NF_NAT (m or y), 
-       # or $CONFIG_IP_NF_FTP (m or y), whichever is weaker.  Argh.
-       if [ "$CONFIG_IP_NF_FTP" = "m" ]; then
-@@ -120,13 +76,6 @@
-           define_tristate CONFIG_IP_NF_NAT_FTP $CONFIG_IP_NF_NAT
-         fi
-       fi
--      if [ "$CONFIG_IP_NF_TFTP" = "m" ]; then
--        define_tristate CONFIG_IP_NF_NAT_TFTP m
--      else
--        if [ "$CONFIG_IP_NF_TFTP" = "y" ]; then
--          define_tristate CONFIG_IP_NF_NAT_TFTP $CONFIG_IP_NF_NAT
--        fi
--      fi
-     fi
-   fi
-diff -Nurb linux/net/ipv4/netfilter/Makefile linux.stock/net/ipv4/netfilter/Makefile
---- linux/net/ipv4/netfilter/Makefile  2004-02-19 06:04:35.000000000 -0500
-+++ linux.stock/net/ipv4/netfilter/Makefile    2004-05-09 04:13:03.000000000 -0400
-@@ -31,48 +31,20 @@
- # connection tracking
- obj-$(CONFIG_IP_NF_CONNTRACK) += ip_conntrack.o
-  
--# H.323 support
--obj-$(CONFIG_IP_NF_H323) += ip_conntrack_h323.o
--obj-$(CONFIG_IP_NF_NAT_H323) += ip_nat_h323.o
--ifdef CONFIG_IP_NF_NAT_H323
--      export-objs += ip_conntrack_h323.o
--endif
--
--
--# connection tracking protocol helpers
--obj-$(CONFIG_IP_NF_CT_PROTO_GRE) += ip_conntrack_proto_gre.o
--ifdef CONFIG_IP_NF_CT_PROTO_GRE
--      export-objs += ip_conntrack_proto_gre.o
--endif
--
--# NAT protocol helpers
--obj-$(CONFIG_IP_NF_NAT_PROTO_GRE) += ip_nat_proto_gre.o
--
- # connection tracking helpers
--obj-$(CONFIG_IP_NF_MMS) += ip_conntrack_mms.o
--ifdef CONFIG_IP_NF_NAT_MMS
--      export-objs += ip_conntrack_mms.o
--endif
--obj-$(CONFIG_IP_NF_PPTP) += ip_conntrack_pptp.o
--ifdef CONFIG_IP_NF_NAT_PPTP
--      export-objs += ip_conntrack_pptp.o
--endif
--obj-$(CONFIG_IP_NF_TFTP) += ip_conntrack_tftp.o
- obj-$(CONFIG_IP_NF_FTP) += ip_conntrack_ftp.o
- ifdef CONFIG_IP_NF_NAT_FTP
-       export-objs += ip_conntrack_ftp.o
- endif
-+
- obj-$(CONFIG_IP_NF_IRC) += ip_conntrack_irc.o
- ifdef CONFIG_IP_NF_NAT_IRC
-       export-objs += ip_conntrack_irc.o
- endif
- # NAT helpers 
--obj-$(CONFIG_IP_NF_NAT_PPTP) += ip_nat_pptp.o
--obj-$(CONFIG_IP_NF_NAT_TFTP) += ip_nat_tftp.o
- obj-$(CONFIG_IP_NF_NAT_FTP) += ip_nat_ftp.o
- obj-$(CONFIG_IP_NF_NAT_IRC) += ip_nat_irc.o
--obj-$(CONFIG_IP_NF_NAT_MMS) += ip_nat_mms.o
- # generic IP tables 
- obj-$(CONFIG_IP_NF_IPTABLES) += ip_tables.o
-@@ -86,19 +58,12 @@
- obj-$(CONFIG_IP_NF_MATCH_HELPER) += ipt_helper.o
- obj-$(CONFIG_IP_NF_MATCH_LIMIT) += ipt_limit.o
- obj-$(CONFIG_IP_NF_MATCH_MARK) += ipt_mark.o
--obj-$(CONFIG_IP_NF_POOL) += ipt_pool.o ip_pool.o
- obj-$(CONFIG_IP_NF_MATCH_MAC) += ipt_mac.o
- obj-$(CONFIG_IP_NF_MATCH_PKTTYPE) += ipt_pkttype.o
- obj-$(CONFIG_IP_NF_MATCH_MULTIPORT) += ipt_multiport.o
--
--obj-$(CONFIG_IP_NF_MATCH_MPORT) += ipt_mport.o
--
- obj-$(CONFIG_IP_NF_MATCH_OWNER) += ipt_owner.o
- obj-$(CONFIG_IP_NF_MATCH_TOS) += ipt_tos.o
--
--obj-$(CONFIG_IP_NF_MATCH_TIME) += ipt_time.o
--
- obj-$(CONFIG_IP_NF_MATCH_ECN) += ipt_ecn.o
- obj-$(CONFIG_IP_NF_MATCH_DSCP) += ipt_dscp.o
- obj-$(CONFIG_IP_NF_MATCH_AH_ESP) += ipt_ah.o ipt_esp.o
-@@ -109,7 +74,6 @@
- obj-$(CONFIG_IP_NF_MATCH_STATE) += ipt_state.o
- obj-$(CONFIG_IP_NF_MATCH_CONNTRACK) += ipt_conntrack.o
- obj-$(CONFIG_IP_NF_MATCH_UNCLEAN) += ipt_unclean.o
--obj-$(CONFIG_IP_NF_MATCH_WEBSTR) += ipt_webstr.o
- obj-$(CONFIG_IP_NF_MATCH_TCPMSS) += ipt_tcpmss.o
- # targets
-@@ -125,8 +89,6 @@
- obj-$(CONFIG_IP_NF_TARGET_LOG) += ipt_LOG.o
- obj-$(CONFIG_IP_NF_TARGET_ULOG) += ipt_ULOG.o
- obj-$(CONFIG_IP_NF_TARGET_TCPMSS) += ipt_TCPMSS.o
--obj-$(CONFIG_IP_NF_AUTOFW) += ip_autofw.o
--obj-$(CONFIG_IP_NF_TARGET_TRIGGER) += ipt_TRIGGER.o
- # generic ARP tables
- obj-$(CONFIG_IP_NF_ARPTABLES) += arp_tables.o
-diff -Nurb linux/net/ipv4/netfilter/ip_conntrack_core.c linux.stock/net/ipv4/netfilter/ip_conntrack_core.c
---- linux/net/ipv4/netfilter/ip_conntrack_core.c       2003-08-12 07:33:45.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ip_conntrack_core.c 2004-05-09 04:13:03.000000000 -0400
-@@ -47,7 +47,11 @@
- #define IP_CONNTRACK_VERSION  "2.1"
-+#if 0
-+#define DEBUGP printk
-+#else
- #define DEBUGP(format, args...)
-+#endif
- DECLARE_RWLOCK(ip_conntrack_lock);
- DECLARE_RWLOCK(ip_conntrack_expect_tuple_lock);
-@@ -62,29 +66,6 @@
- struct list_head *ip_conntrack_hash;
- static kmem_cache_t *ip_conntrack_cachep;
--#define SECS  * HZ
--#define MINS  * 60 SECS
--#define HOURS * 60 MINS
--#define DAYS  * 24 HOURS
--
--int sysctl_ip_conntrack_tcp_timeouts[10] = {
--       30 MINS,        /*      TCP_CONNTRACK_NONE,             */
--       5 DAYS,         /*      TCP_CONNTRACK_ESTABLISHED,      */
--       2 MINS,         /*      TCP_CONNTRACK_SYN_SENT,         */
--       60 SECS,        /*      TCP_CONNTRACK_SYN_RECV,         */
--       2 MINS,         /*      TCP_CONNTRACK_FIN_WAIT,         */
--       2 MINS,         /*      TCP_CONNTRACK_TIME_WAIT,        */
--       10 SECS,        /*      TCP_CONNTRACK_CLOSE,            */
--       60 SECS,        /*      TCP_CONNTRACK_CLOSE_WAIT,       */
--       30 SECS,        /*      TCP_CONNTRACK_LAST_ACK,         */
--       2 MINS,         /*      TCP_CONNTRACK_LISTEN,           */
--};
--
--int sysctl_ip_conntrack_udp_timeouts[2] = { 
--       30 SECS,        /*      UNREPLIED                       */ 
--       180 SECS        /*      ASSURED                         */
--};
--
- extern struct ip_conntrack_protocol ip_conntrack_generic_protocol;
- static inline int proto_cmpfn(const struct ip_conntrack_protocol *curr,
-@@ -129,6 +110,9 @@
- static inline u_int32_t
- hash_conntrack(const struct ip_conntrack_tuple *tuple)
- {
-+#if 0
-+      dump_tuple(tuple);
-+#endif
-       /* ntohl because more differences in low bits. */
-       /* To ensure that halves of the same connection don't hash
-          clash, we add the source per-proto again. */
-@@ -160,8 +144,6 @@
-       tuple->dst.ip = iph->daddr;
-       tuple->dst.protonum = iph->protocol;
--      tuple->src.u.all = tuple->dst.u.all = 0;
--
-       ret = protocol->pkt_to_tuple((u_int32_t *)iph + iph->ihl,
-                                    len - 4*iph->ihl,
-                                    tuple);
-@@ -177,8 +159,6 @@
-       inverse->dst.ip = orig->src.ip;
-       inverse->dst.protonum = orig->dst.protonum;
--      inverse->src.u.all = inverse->dst.u.all = 0;
--
-       return protocol->invert_tuple(inverse, orig);
- }
-@@ -196,8 +176,8 @@
- static void
- destroy_expect(struct ip_conntrack_expect *exp)
- {
--      DEBUGP("destroy_expect(%p) use=%d\n", exp, atomic_read(&exp->use));
--      IP_NF_ASSERT(atomic_read(&exp->use));
-+      DEBUGP("destroy_expect(%p) use=%d\n", exp, atomic_read(exp->use));
-+      IP_NF_ASSERT(atomic_read(exp->use));
-       IP_NF_ASSERT(!timer_pending(&exp->timeout));
-       kfree(exp);
-@@ -267,11 +247,11 @@
- static void unexpect_related(struct ip_conntrack_expect *expect)
- {
-       IP_NF_ASSERT(expect->expectant);
-+      IP_NF_ASSERT(expect->expectant->helper);
-       /* if we are supposed to have a timer, but we can't delete
-        * it: race condition.  __unexpect_related will
-        * be calledd by timeout function */
--      if (expect->expectant->helper
--          && expect->expectant->helper->timeout
-+      if (expect->expectant->helper->timeout
-           && !del_timer(&expect->timeout))
-               return;
-@@ -580,6 +560,7 @@
-       if (!h) {
-               /* Locally generated ICMPs will match inverted if they
-                  haven't been SNAT'ed yet */
-+              /* FIXME: NAT code has to handle half-done double NAT --RR */
-               if (hooknum == NF_IP_LOCAL_OUT)
-                       h = ip_conntrack_find_get(&origtuple, NULL);
-@@ -725,7 +706,6 @@
-       /* If the expectation is dying, then this is a looser. */
-       if (expected
--          && expected->expectant->helper
-           && expected->expectant->helper->timeout
-           && ! del_timer(&expected->timeout))
-               expected = NULL;
-@@ -744,7 +724,6 @@
-               conntrack->master = expected;
-               expected->sibling = conntrack;
-               LIST_DELETE(&ip_conntrack_expect_list, expected);
--              INIT_LIST_HEAD(&expected->list);
-               expected->expectant->expecting--;
-               nf_conntrack_get(&master_ct(conntrack)->infos[0]);
-       }
-@@ -821,9 +800,23 @@
-       int set_reply;
-       int ret;
-+      /* FIXME: Do this right please. --RR */
-       (*pskb)->nfcache |= NFC_UNKNOWN;
- /* Doesn't cover locally-generated broadcast, so not worth it. */
-+#if 0
-+      /* Ignore broadcast: no `connection'. */
-+      if ((*pskb)->pkt_type == PACKET_BROADCAST) {
-+              printk("Broadcast packet!\n");
-+              return NF_ACCEPT;
-+      } else if (((*pskb)->nh.iph->daddr & htonl(0x000000FF)) 
-+                 == htonl(0x000000FF)) {
-+              printk("Should bcast: %u.%u.%u.%u->%u.%u.%u.%u (sk=%p, ptype=%u)\n",
-+                     NIPQUAD((*pskb)->nh.iph->saddr),
-+                     NIPQUAD((*pskb)->nh.iph->daddr),
-+                     (*pskb)->sk, (*pskb)->pkt_type);
-+      }
-+#endif
-       /* Previously seen (loopback)?  Ignore.  Do this before
-            fragment check. */
-@@ -943,8 +936,8 @@
-        * so there is no need to use the tuple lock too */
-       DEBUGP("ip_conntrack_expect_related %p\n", related_to);
--      DEBUGP("tuple: "); DUMP_TUPLE_RAW(&expect->tuple);
--      DEBUGP("mask:  "); DUMP_TUPLE_RAW(&expect->mask);
-+      DEBUGP("tuple: "); DUMP_TUPLE(&expect->tuple);
-+      DEBUGP("mask:  "); DUMP_TUPLE(&expect->mask);
-       old = LIST_FIND(&ip_conntrack_expect_list, resent_expect,
-                       struct ip_conntrack_expect *, &expect->tuple, 
-@@ -954,8 +947,7 @@
-                  pointing into the payload - otherwise we should have to copy 
-                  the data filled out by the helper over the old one */
-               DEBUGP("expect_related: resent packet\n");
--              if (related_to->helper &&
--                  related_to->helper->timeout) {
-+              if (related_to->helper->timeout) {
-                       if (!del_timer(&old->timeout)) {
-                               /* expectation is dying. Fall through */
-                               old = NULL;
-@@ -970,32 +962,26 @@
-                       WRITE_UNLOCK(&ip_conntrack_lock);
-                       return -EEXIST;
-               }
--      } else if (related_to->helper &&
--                 related_to->helper->max_expected && 
-+      } else if (related_to->helper->max_expected && 
-                  related_to->expecting >= related_to->helper->max_expected) {
-               struct list_head *cur_item;
-               /* old == NULL */
--              if (!(related_to->helper->flags & 
--                    IP_CT_HELPER_F_REUSE_EXPECT)) {
--                      WRITE_UNLOCK(&ip_conntrack_lock);
-                       if (net_ratelimit())
-                               printk(KERN_WARNING
-                                      "ip_conntrack: max number of expected "
-                                      "connections %i of %s reached for "
--                                     "%u.%u.%u.%u->%u.%u.%u.%u\n",
-+                             "%u.%u.%u.%u->%u.%u.%u.%u%s\n",
-                                      related_to->helper->max_expected,
-                                      related_to->helper->name,
-                                      NIPQUAD(related_to->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.ip),
--                                     NIPQUAD(related_to->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.ip));
-+                             NIPQUAD(related_to->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.ip),
-+                             related_to->helper->flags & IP_CT_HELPER_F_REUSE_EXPECT ?
-+                             ", reusing" : "");
-+              if (!(related_to->helper->flags & 
-+                    IP_CT_HELPER_F_REUSE_EXPECT)) {
-+                      WRITE_UNLOCK(&ip_conntrack_lock);
-                       return -EPERM;
-               }
--              DEBUGP("ip_conntrack: max number of expected "
--                     "connections %i of %s reached for "
--                     "%u.%u.%u.%u->%u.%u.%u.%u, reusing\n",
--                     related_to->helper->max_expected,
--                     related_to->helper->name,
--                     NIPQUAD(related_to->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.ip),
--                     NIPQUAD(related_to->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.ip));
-  
-               /* choose the the oldest expectation to evict */
-               list_for_each(cur_item, &related_to->sibling_list) { 
-@@ -1055,8 +1041,7 @@
-       /* add to global list of expectations */
-       list_prepend(&ip_conntrack_expect_list, &new->list);
-       /* add and start timer if required */
--      if (related_to->helper &&
--          related_to->helper->timeout) {
-+      if (related_to->helper->timeout) {
-               init_timer(&new->timeout);
-               new->timeout.data = (unsigned long)new;
-               new->timeout.function = expectation_timed_out;
-@@ -1079,10 +1064,11 @@
-       MUST_BE_READ_LOCKED(&ip_conntrack_lock);
-       WRITE_LOCK(&ip_conntrack_expect_tuple_lock);
-+
-       DEBUGP("change_expect:\n");
--      DEBUGP("exp tuple: "); DUMP_TUPLE_RAW(&expect->tuple);
--      DEBUGP("exp mask:  "); DUMP_TUPLE_RAW(&expect->mask);
--      DEBUGP("newtuple:  "); DUMP_TUPLE_RAW(newtuple);
-+      DEBUGP("exp tuple: "); DUMP_TUPLE(&expect->tuple);
-+      DEBUGP("exp mask:  "); DUMP_TUPLE(&expect->mask);
-+      DEBUGP("newtuple:  "); DUMP_TUPLE(newtuple);
-       if (expect->ct_tuple.dst.protonum == 0) {
-               /* Never seen before */
-               DEBUGP("change expect: never seen before\n");
-@@ -1360,8 +1346,6 @@
-     0, NULL };
- #define NET_IP_CONNTRACK_MAX 2089
--#define NET_IP_CONNTRACK_TCP_TIMEOUTS  2090
--#define NET_IP_CONNTRACK_UDP_TIMEOUTS  2091
- #define NET_IP_CONNTRACK_MAX_NAME "ip_conntrack_max"
- #ifdef CONFIG_SYSCTL
-@@ -1370,14 +1354,6 @@
- static ctl_table ip_conntrack_table[] = {
-       { NET_IP_CONNTRACK_MAX, NET_IP_CONNTRACK_MAX_NAME, &ip_conntrack_max,
-         sizeof(ip_conntrack_max), 0644,  NULL, proc_dointvec },
--      { NET_IP_CONNTRACK_TCP_TIMEOUTS, "ip_conntrack_tcp_timeouts",
--          &sysctl_ip_conntrack_tcp_timeouts,
--          sizeof(sysctl_ip_conntrack_tcp_timeouts),
--          0644, NULL, &proc_dointvec_jiffies, &sysctl_jiffies },
--      { NET_IP_CONNTRACK_UDP_TIMEOUTS, "ip_conntrack_udp_timeouts",
--          &sysctl_ip_conntrack_udp_timeouts,
--          sizeof(sysctl_ip_conntrack_udp_timeouts),
--          0644, NULL, &proc_dointvec_jiffies, &sysctl_jiffies },
-       { 0 }
- };
-diff -Nurb linux/net/ipv4/netfilter/ip_conntrack_ftp.c linux.stock/net/ipv4/netfilter/ip_conntrack_ftp.c
---- linux/net/ipv4/netfilter/ip_conntrack_ftp.c        2003-07-04 04:12:31.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ip_conntrack_ftp.c  2004-05-09 04:13:03.000000000 -0400
-@@ -24,7 +24,11 @@
- static int loose = 0;
- MODULE_PARM(loose, "i");
-+#if 0
-+#define DEBUGP printk
-+#else
- #define DEBUGP(format, args...)
-+#endif
- static int try_rfc959(const char *, size_t, u_int32_t [], char);
- static int try_eprt(const char *, size_t, u_int32_t [], char);
-@@ -191,6 +195,16 @@
-       }
-       if (strnicmp(data, pattern, plen) != 0) {
-+#if 0
-+              size_t i;
-+
-+              DEBUGP("ftp: string mismatch\n");
-+              for (i = 0; i < plen; i++) {
-+                      DEBUGFTP("ftp:char %u `%c'(%u) vs `%c'(%u)\n",
-+                               i, data[i], data[i],
-+                               pattern[i], pattern[i]);
-+              }
-+#endif
-               return 0;
-       }
-@@ -214,6 +228,7 @@
-       return 1;
- }
-+/* FIXME: This should be in userspace.  Later. */
- static int help(const struct iphdr *iph, size_t len,
-               struct ip_conntrack *ct,
-               enum ip_conntrack_info ctinfo)
-@@ -249,6 +264,7 @@
-       }
-       /* Checksum invalid?  Ignore. */
-+      /* FIXME: Source route IP option packets --RR */
-       if (tcp_v4_check(tcph, tcplen, iph->saddr, iph->daddr,
-                        csum_partial((char *)tcph, tcplen, 0))) {
-               DEBUGP("ftp_help: bad csum: %p %u %u.%u.%u.%u %u.%u.%u.%u\n",
-diff -Nurb linux/net/ipv4/netfilter/ip_conntrack_h323.c linux.stock/net/ipv4/netfilter/ip_conntrack_h323.c
---- linux/net/ipv4/netfilter/ip_conntrack_h323.c       2003-07-04 04:12:31.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ip_conntrack_h323.c 1969-12-31 19:00:00.000000000 -0500
-@@ -1,302 +0,0 @@
--/* 
-- * H.323 'brute force' extension for H.323 connection tracking. 
-- * Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
-- *
-- * Based on ip_masq_h323.c for 2.2 kernels from CoRiTel, Sofia project.
-- * (http://www.coritel.it/projects/sofia/nat/)
-- * Uses Sampsa Ranta's excellent idea on using expectfn to 'bind'
-- * the unregistered helpers to the conntrack entries.
-- */
--
--
--#include <linux/module.h>
--#include <linux/netfilter.h>
--#include <linux/ip.h>
--#include <net/checksum.h>
--#include <net/tcp.h>
--
--#include <linux/netfilter_ipv4/lockhelp.h>
--#include <linux/netfilter_ipv4/ip_conntrack.h>
--#include <linux/netfilter_ipv4/ip_conntrack_core.h>
--#include <linux/netfilter_ipv4/ip_conntrack_helper.h>
--#include <linux/netfilter_ipv4/ip_conntrack_tuple.h>
--#include <linux/netfilter_ipv4/ip_conntrack_h323.h>
--
--MODULE_AUTHOR("Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>");
--MODULE_DESCRIPTION("H.323 'brute force' connection tracking module");
--MODULE_LICENSE("GPL");
--
--DECLARE_LOCK(ip_h323_lock);
--struct module *ip_conntrack_h323 = THIS_MODULE;
--
--#define DEBUGP(format, args...)
--
--static int h245_help(const struct iphdr *iph, size_t len,
--                   struct ip_conntrack *ct,
--                   enum ip_conntrack_info ctinfo)
--{
--      struct tcphdr *tcph = (void *)iph + iph->ihl * 4;
--      unsigned char *data = (unsigned char *) tcph + tcph->doff * 4;
--      unsigned char *data_limit;
--      u_int32_t tcplen = len - iph->ihl * 4;
--      u_int32_t datalen = tcplen - tcph->doff * 4;
--      int dir = CTINFO2DIR(ctinfo);
--      struct ip_ct_h225_master *info = &ct->help.ct_h225_info;
--      struct ip_conntrack_expect expect, *exp = &expect;
--      struct ip_ct_h225_expect *exp_info = &exp->help.exp_h225_info;
--      u_int16_t data_port;
--      u_int32_t data_ip;
--      unsigned int i;
--
--      DEBUGP("ct_h245_help: help entered %u.%u.%u.%u:%u->%u.%u.%u.%u:%u\n",
--              NIPQUAD(iph->saddr), ntohs(tcph->source),
--              NIPQUAD(iph->daddr), ntohs(tcph->dest));
--
--      /* Can't track connections formed before we registered */
--      if (!info)
--              return NF_ACCEPT;
--              
--      /* Until there's been traffic both ways, don't look in packets. */
--      if (ctinfo != IP_CT_ESTABLISHED
--          && ctinfo != IP_CT_ESTABLISHED + IP_CT_IS_REPLY) {
--              DEBUGP("ct_h245_help: Conntrackinfo = %u\n", ctinfo);
--              return NF_ACCEPT;
--      }
--
--      /* Not whole TCP header or too short packet? */
--      if (tcplen < sizeof(struct tcphdr) || tcplen < tcph->doff * 4 + 5) {
--              DEBUGP("ct_h245_help: tcplen = %u\n", (unsigned)tcplen);
--              return NF_ACCEPT;
--      }
--
--      /* Checksum invalid?  Ignore. */
--      if (tcp_v4_check(tcph, tcplen, iph->saddr, iph->daddr,
--                            csum_partial((char *)tcph, tcplen, 0))) {
--              DEBUGP("ct_h245_help: bad csum: %p %u %u.%u.%u.%u %u.%u.%u.%u\n",
--                     tcph, tcplen, NIPQUAD(iph->saddr),
--                     NIPQUAD(iph->daddr));
--              return NF_ACCEPT;
--      }
--
--      data_limit = (unsigned char *) data + datalen;
--      /* bytes: 0123   45
--                ipadrr port */
--      for (i = 0; data < (data_limit - 5); data++, i++) {
--              memcpy(&data_ip, data, sizeof(u_int32_t));
--              if (data_ip == iph->saddr) {
--                      memcpy(&data_port, data + 4, sizeof(u_int16_t));
--                      memset(&expect, 0, sizeof(expect));
--                      /* update the H.225 info */
--                      DEBUGP("ct_h245_help: new RTCP/RTP requested %u.%u.%u.%u:->%u.%u.%u.%u:%u\n",
--                              NIPQUAD(ct->tuplehash[!dir].tuple.src.ip),
--                              NIPQUAD(iph->saddr), ntohs(data_port));
--                      LOCK_BH(&ip_h323_lock);
--                      info->is_h225 = H225_PORT + 1;
--                      exp_info->port = data_port;
--                      exp_info->dir = dir;
--                      exp_info->offset = i;
--
--                      exp->seq = ntohl(tcph->seq) + i;
--                  
--                      exp->tuple = ((struct ip_conntrack_tuple)
--                              { { ct->tuplehash[!dir].tuple.src.ip,
--                                  { 0 } },
--                                { data_ip,
--                                  { data_port },
--                                  IPPROTO_UDP }});
--                      exp->mask = ((struct ip_conntrack_tuple)
--                              { { 0xFFFFFFFF, { 0 } },
--                                { 0xFFFFFFFF, { 0xFFFF }, 0xFFFF }});
--      
--                      exp->expectfn = NULL;
--                      
--                      /* Ignore failure; should only happen with NAT */
--                      ip_conntrack_expect_related(ct, exp);
--
--                      UNLOCK_BH(&ip_h323_lock);
--              }
--      }
--
--      return NF_ACCEPT;
--
--}
--
--/* H.245 helper is not registered! */
--static struct ip_conntrack_helper h245 = 
--      { { NULL, NULL },
--          "H.245",                            /* name */
--          IP_CT_HELPER_F_REUSE_EXPECT,                /* flags */
--          NULL,                                       /* module */
--          8,                                  /* max_ expected */
--          240,                                        /* timeout */
--          { { 0, { 0 } },                     /* tuple */
--            { 0, { 0 }, IPPROTO_TCP } },
--          { { 0, { 0xFFFF } },                        /* mask */
--            { 0, { 0 }, 0xFFFF } },
--          h245_help                           /* helper */
--      };
--
--static int h225_expect(struct ip_conntrack *ct)
--{
--      WRITE_LOCK(&ip_conntrack_lock);
--      ct->helper = &h245;
--      DEBUGP("h225_expect: helper for %p added\n", ct);
--      WRITE_UNLOCK(&ip_conntrack_lock);
--      
--      return NF_ACCEPT;       /* unused */
--}
--
--static int h225_help(const struct iphdr *iph, size_t len,
--                   struct ip_conntrack *ct,
--                   enum ip_conntrack_info ctinfo)
--{
--      struct tcphdr *tcph = (void *)iph + iph->ihl * 4;
--      unsigned char *data = (unsigned char *) tcph + tcph->doff * 4;
--      unsigned char *data_limit;
--      u_int32_t tcplen = len - iph->ihl * 4;
--      u_int32_t datalen = tcplen - tcph->doff * 4;
--      int dir = CTINFO2DIR(ctinfo);
--      struct ip_ct_h225_master *info = &ct->help.ct_h225_info;
--      struct ip_conntrack_expect expect, *exp = &expect;
--      struct ip_ct_h225_expect *exp_info = &exp->help.exp_h225_info;
--      u_int16_t data_port;
--      u_int32_t data_ip;
--      unsigned int i;
--      
--      DEBUGP("ct_h225_help: help entered %u.%u.%u.%u:%u->%u.%u.%u.%u:%u\n",
--              NIPQUAD(iph->saddr), ntohs(tcph->source),
--              NIPQUAD(iph->daddr), ntohs(tcph->dest));
--
--      /* Can't track connections formed before we registered */
--      if (!info)
--              return NF_ACCEPT;
--
--      /* Until there's been traffic both ways, don't look in packets. */
--      if (ctinfo != IP_CT_ESTABLISHED
--          && ctinfo != IP_CT_ESTABLISHED + IP_CT_IS_REPLY) {
--              DEBUGP("ct_h225_help: Conntrackinfo = %u\n", ctinfo);
--              return NF_ACCEPT;
--      }
--
--      /* Not whole TCP header or too short packet? */
--      if (tcplen < sizeof(struct tcphdr) || tcplen < tcph->doff * 4 + 5) {
--              DEBUGP("ct_h225_help: tcplen = %u\n", (unsigned)tcplen);
--              return NF_ACCEPT;
--      }
--
--      /* Checksum invalid?  Ignore. */
--      if (tcp_v4_check(tcph, tcplen, iph->saddr, iph->daddr,
--                            csum_partial((char *)tcph, tcplen, 0))) {
--              DEBUGP("ct_h225_help: bad csum: %p %u %u.%u.%u.%u %u.%u.%u.%u\n",
--                     tcph, tcplen, NIPQUAD(iph->saddr),
--                     NIPQUAD(iph->daddr));
--              return NF_ACCEPT;
--      }
--      
--      data_limit = (unsigned char *) data + datalen;
--      /* bytes: 0123   45
--                ipadrr port */
--      for (i = 0; data < (data_limit - 5); data++, i++) {
--              memcpy(&data_ip, data, sizeof(u_int32_t));
--              if (data_ip == iph->saddr) {
--                      memcpy(&data_port, data + 4, sizeof(u_int16_t));
--                      if (data_port == tcph->source) {
--                              /* Signal address */
--                              DEBUGP("ct_h225_help: sourceCallSignalAddress from %u.%u.%u.%u\n",
--                                      NIPQUAD(iph->saddr));
--                              /* Update the H.225 info so that NAT can mangle the address/port
--                                 even when we have no expected connection! */
--#ifdef CONFIG_IP_NF_NAT_NEEDED
--                              LOCK_BH(&ip_h323_lock);
--                              info->dir = dir;
--                              info->seq[IP_CT_DIR_ORIGINAL] = ntohl(tcph->seq) + i;
--                              info->offset[IP_CT_DIR_ORIGINAL] = i;
--                              UNLOCK_BH(&ip_h323_lock);
--#endif
--                      } else {
--                              memset(&expect, 0, sizeof(expect));
--
--                              /* update the H.225 info */
--                              LOCK_BH(&ip_h323_lock);
--                              info->is_h225 = H225_PORT;
--                              exp_info->port = data_port;
--                              exp_info->dir = dir;
--                              exp_info->offset = i;
--
--                              exp->seq = ntohl(tcph->seq) + i;
--
--                              exp->tuple = ((struct ip_conntrack_tuple)
--                                      { { ct->tuplehash[!dir].tuple.src.ip,
--                                          { 0 } },
--                                        { data_ip,
--                                          { data_port },
--                                          IPPROTO_TCP }});
--                              exp->mask = ((struct ip_conntrack_tuple)
--                                      { { 0xFFFFFFFF, { 0 } },
--                                        { 0xFFFFFFFF, { 0xFFFF }, 0xFFFF }});
--      
--                              exp->expectfn = h225_expect;
--                              
--                              /* Ignore failure */
--                              ip_conntrack_expect_related(ct, exp);
--
--                              DEBUGP("ct_h225_help: new H.245 requested %u.%u.%u.%u->%u.%u.%u.%u:%u\n",
--                                      NIPQUAD(ct->tuplehash[!dir].tuple.src.ip),
--                                      NIPQUAD(iph->saddr), ntohs(data_port));
--
--                              UNLOCK_BH(&ip_h323_lock);
--                      }  
--#ifdef CONFIG_IP_NF_NAT_NEEDED
--              } else if (data_ip == iph->daddr) {
--                      memcpy(&data_port, data + 4, sizeof(u_int16_t));
--                      if (data_port == tcph->dest) {
--                              /* Signal address */
--                              DEBUGP("ct_h225_help: destCallSignalAddress %u.%u.%u.%u\n",
--                                      NIPQUAD(iph->daddr));
--                              /* Update the H.225 info so that NAT can mangle the address/port
--                                 even when we have no expected connection! */
--                              LOCK_BH(&ip_h323_lock);
--                              info->dir = dir;
--                              info->seq[IP_CT_DIR_REPLY] = ntohl(tcph->seq) + i;
--                              info->offset[IP_CT_DIR_REPLY] = i;
--                              UNLOCK_BH(&ip_h323_lock);
--                      }
--#endif
--              }
--      }
--
--      return NF_ACCEPT;
--
--}
--
--static struct ip_conntrack_helper h225 = 
--      { { NULL, NULL },
--        "H.225",                                      /* name */
--        IP_CT_HELPER_F_REUSE_EXPECT,                  /* flags */
--        THIS_MODULE,                                  /* module */
--        2,                                            /* max_expected */
--        240,                                          /* timeout */
--        { { 0, { __constant_htons(H225_PORT) } },     /* tuple */
--          { 0, { 0 }, IPPROTO_TCP } },
--        { { 0, { 0xFFFF } },                          /* mask */
--          { 0, { 0 }, 0xFFFF } },
--        h225_help                                     /* helper */
--      };
--
--static int __init init(void)
--{
--      return ip_conntrack_helper_register(&h225);
--}
--
--static void __exit fini(void)
--{
--      /* Unregister H.225 helper */   
--      ip_conntrack_helper_unregister(&h225);
--}
--
--#ifdef CONFIG_IP_NF_NAT_NEEDED
--EXPORT_SYMBOL(ip_h323_lock);
--#endif
--
--module_init(init);
--module_exit(fini);
-diff -Nurb linux/net/ipv4/netfilter/ip_conntrack_mms.c linux.stock/net/ipv4/netfilter/ip_conntrack_mms.c
---- linux/net/ipv4/netfilter/ip_conntrack_mms.c        2003-07-04 04:12:31.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ip_conntrack_mms.c  1969-12-31 19:00:00.000000000 -0500
-@@ -1,292 +0,0 @@
--/* MMS extension for IP connection tracking
-- * (C) 2002 by Filip Sneppe <filip.sneppe@cronos.be>
-- * based on ip_conntrack_ftp.c and ip_conntrack_irc.c
-- *
-- * ip_conntrack_mms.c v0.3 2002-09-22
-- *
-- *      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, or (at your option) any later version.
-- *
-- *      Module load syntax:
-- *      insmod ip_conntrack_mms.o ports=port1,port2,...port<MAX_PORTS>
-- *
-- *      Please give the ports of all MMS servers You wish to connect to.
-- *      If you don't specify ports, the default will be TCP port 1755.
-- *
-- *      More info on MMS protocol, firewalls and NAT:
-- *      http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwmt/html/MMSFirewall.asp
-- *      http://www.microsoft.com/windows/windowsmedia/serve/firewall.asp
-- *
-- *      The SDP project people are reverse-engineering MMS:
-- *      http://get.to/sdp
-- */
--
--#include <linux/config.h>
--#include <linux/module.h>
--#include <linux/netfilter.h>
--#include <linux/ip.h>
--#include <linux/ctype.h>
--#include <net/checksum.h>
--#include <net/tcp.h>
--
--#include <linux/netfilter_ipv4/lockhelp.h>
--#include <linux/netfilter_ipv4/ip_conntrack_helper.h>
--#include <linux/netfilter_ipv4/ip_conntrack_mms.h>
--
--DECLARE_LOCK(ip_mms_lock);
--struct module *ip_conntrack_mms = THIS_MODULE;
--
--#define MAX_PORTS 8
--static int ports[MAX_PORTS];
--static int ports_c;
--#ifdef MODULE_PARM
--MODULE_PARM(ports, "1-" __MODULE_STRING(MAX_PORTS) "i");
--#endif
--
--#define DEBUGP(format, args...)
--
--#ifdef CONFIG_IP_NF_NAT_NEEDED
--EXPORT_SYMBOL(ip_mms_lock);
--#endif
--
--MODULE_AUTHOR("Filip Sneppe <filip.sneppe@cronos.be>");
--MODULE_DESCRIPTION("Microsoft Windows Media Services (MMS) connection tracking module");
--MODULE_LICENSE("GPL");
--
--/* #define isdigit(c) (c >= '0' && c <= '9') */
--
--/* copied from drivers/usb/serial/io_edgeport.c - not perfect but will do the trick */
--static void unicode_to_ascii (char *string, short *unicode, int unicode_size)
--{
--      int i;
--      for (i = 0; i < unicode_size; ++i) {
--              string[i] = (char)(unicode[i]);
--      }
--      string[unicode_size] = 0x00;
--}
--
--__inline static int atoi(char *s) 
--{
--      int i=0;
--      while (isdigit(*s)) {
--              i = i*10 + *(s++) - '0';
--      }
--      return i;
--}
--
--/* convert ip address string like "192.168.0.10" to unsigned int */
--__inline static u_int32_t asciiiptoi(char *s)
--{
--      unsigned int i, j, k;
--
--      for(i=k=0; k<3; ++k, ++s, i<<=8) {
--              i+=atoi(s);
--              for(j=0; (*(++s) != '.') && (j<3); ++j)
--                      ;
--      }
--      i+=atoi(s);
--      return ntohl(i);
--}
--
--int parse_mms(const char *data, 
--            const unsigned int datalen,
--            u_int32_t *mms_ip,
--            u_int16_t *mms_proto,
--            u_int16_t *mms_port,
--            char **mms_string_b,
--            char **mms_string_e,
--            char **mms_padding_e)
--{
--      int unicode_size, i;
--      char tempstring[28];       /* "\\255.255.255.255\UDP\65535" */
--      char getlengthstring[28];
--      
--      for(unicode_size=0; 
--          (char) *(data+(MMS_SRV_UNICODE_STRING_OFFSET+unicode_size*2)) != (char)0;
--          unicode_size++)
--              if ((unicode_size == 28) || (MMS_SRV_UNICODE_STRING_OFFSET+unicode_size*2 >= datalen)) 
--                      return -1; /* out of bounds - incomplete packet */
--      
--      unicode_to_ascii(tempstring, (short *)(data+MMS_SRV_UNICODE_STRING_OFFSET), unicode_size);
--      DEBUGP("ip_conntrack_mms: offset 60: %s\n", (const char *)(tempstring));
--      
--      /* IP address ? */
--      *mms_ip = asciiiptoi(tempstring+2);
--      
--      i=sprintf(getlengthstring, "%u.%u.%u.%u", HIPQUAD(*mms_ip));
--              
--      /* protocol ? */
--      if(strncmp(tempstring+3+i, "TCP", 3)==0)
--              *mms_proto = IPPROTO_TCP;
--      else if(strncmp(tempstring+3+i, "UDP", 3)==0)
--              *mms_proto = IPPROTO_UDP;
--
--      /* port ? */
--      *mms_port = atoi(tempstring+7+i);
--
--      /* we store a pointer to the beginning of the "\\a.b.c.d\proto\port" 
--         unicode string, one to the end of the string, and one to the end 
--         of the packet, since we must keep track of the number of bytes 
--         between end of the unicode string and the end of packet (padding) */
--      *mms_string_b  = (char *)(data + MMS_SRV_UNICODE_STRING_OFFSET);
--      *mms_string_e  = (char *)(data + MMS_SRV_UNICODE_STRING_OFFSET + unicode_size * 2);
--      *mms_padding_e = (char *)(data + datalen); /* looks funny, doesn't it */
--      return 0;
--}
--
--
--static int help(const struct iphdr *iph, size_t len,
--              struct ip_conntrack *ct,
--              enum ip_conntrack_info ctinfo)
--{
--      /* tcplen not negative guaranteed by ip_conntrack_tcp.c */
--      struct tcphdr *tcph = (void *)iph + iph->ihl * 4;
--      const char *data = (const char *)tcph + tcph->doff * 4;
--      unsigned int tcplen = len - iph->ihl * 4;
--      unsigned int datalen = tcplen - tcph->doff * 4;
--      int dir = CTINFO2DIR(ctinfo);
--      struct ip_conntrack_expect expect, *exp = &expect; 
--      struct ip_ct_mms_expect *exp_mms_info = &exp->help.exp_mms_info;
--      
--      u_int32_t mms_ip;
--      u_int16_t mms_proto;
--      char mms_proto_string[8];
--      u_int16_t mms_port;
--      char *mms_string_b, *mms_string_e, *mms_padding_e;
--           
--      /* Until there's been traffic both ways, don't look in packets. */
--      if (ctinfo != IP_CT_ESTABLISHED
--          && ctinfo != IP_CT_ESTABLISHED+IP_CT_IS_REPLY) {
--              DEBUGP("ip_conntrack_mms: Conntrackinfo = %u\n", ctinfo);
--              return NF_ACCEPT;
--      }
--
--      /* Not whole TCP header? */
--      if (tcplen < sizeof(struct tcphdr) || tcplen < tcph->doff*4) {
--              DEBUGP("ip_conntrack_mms: tcplen = %u\n", (unsigned)tcplen);
--              return NF_ACCEPT;
--      }
--
--      /* Checksum invalid?  Ignore. */
--      if (tcp_v4_check(tcph, tcplen, iph->saddr, iph->daddr,
--          csum_partial((char *)tcph, tcplen, 0))) {
--              DEBUGP("mms_help: bad csum: %p %u %u.%u.%u.%u %u.%u.%u.%u\n",
--                     tcph, tcplen, NIPQUAD(iph->saddr),
--                     NIPQUAD(iph->daddr));
--              return NF_ACCEPT;
--      }
--      
--      /* Only look at packets with 0x00030002/196610 on bytes 36->39 of TCP payload */
--      if( (MMS_SRV_MSG_OFFSET < datalen) && 
--          ((*(u32 *)(data+MMS_SRV_MSG_OFFSET)) == MMS_SRV_MSG_ID)) {
--              DEBUGP("ip_conntrack_mms: offset 37: %u %u %u %u, datalen:%u\n", 
--                     (u8)*(data+36), (u8)*(data+37), 
--                     (u8)*(data+38), (u8)*(data+39),
--                     datalen);
--              if(parse_mms(data, datalen, &mms_ip, &mms_proto, &mms_port,
--                           &mms_string_b, &mms_string_e, &mms_padding_e))
--                      if(net_ratelimit())
--                              printk(KERN_WARNING
--                                     "ip_conntrack_mms: Unable to parse data payload\n");
--
--              memset(&expect, 0, sizeof(expect));
--
--              sprintf(mms_proto_string, "(%u)", mms_proto);
--              DEBUGP("ip_conntrack_mms: adding %s expectation %u.%u.%u.%u -> %u.%u.%u.%u:%u\n",
--                     mms_proto == IPPROTO_TCP ? "TCP"
--                     : mms_proto == IPPROTO_UDP ? "UDP":mms_proto_string,
--                     NIPQUAD(ct->tuplehash[!dir].tuple.src.ip),
--                     NIPQUAD(mms_ip),
--                     mms_port);
--              
--              /* it's possible that the client will just ask the server to tunnel
--                 the stream over the same TCP session (from port 1755): there's 
--                 shouldn't be a need to add an expectation in that case, but it
--                 makes NAT packet mangling so much easier */
--              LOCK_BH(&ip_mms_lock);
--
--              DEBUGP("ip_conntrack_mms: tcph->seq = %u\n", tcph->seq);
--              
--              exp->seq = ntohl(tcph->seq) + (mms_string_b - data);
--              exp_mms_info->len     = (mms_string_e  - mms_string_b);
--              exp_mms_info->padding = (mms_padding_e - mms_string_e);
--              exp_mms_info->port    = mms_port;
--              
--              DEBUGP("ip_conntrack_mms: wrote info seq=%u (ofs=%u), len=%d, padding=%u\n",
--                     exp->seq, (mms_string_e - data), exp_mms_info->len, exp_mms_info->padding);
--              
--              exp->tuple = ((struct ip_conntrack_tuple)
--                            { { ct->tuplehash[!dir].tuple.src.ip, { 0 } },
--                            { mms_ip,
--                              { (__u16) ntohs(mms_port) },
--                              mms_proto } }
--                           );
--              exp->mask  = ((struct ip_conntrack_tuple)
--                           { { 0xFFFFFFFF, { 0 } },
--                             { 0xFFFFFFFF, { 0xFFFF }, 0xFFFF }});
--              exp->expectfn = NULL;
--              ip_conntrack_expect_related(ct, &expect);
--              UNLOCK_BH(&ip_mms_lock);
--      }
--
--      return NF_ACCEPT;
--}
--
--static struct ip_conntrack_helper mms[MAX_PORTS];
--static char mms_names[MAX_PORTS][10];
--
--/* Not __exit: called from init() */
--static void fini(void)
--{
--      int i;
--      for (i = 0; (i < MAX_PORTS) && ports[i]; i++) {
--              DEBUGP("ip_conntrack_mms: unregistering helper for port %d\n",
--                              ports[i]);
--              ip_conntrack_helper_unregister(&mms[i]);
--      }
--}
--
--static int __init init(void)
--{
--      int i, ret;
--      char *tmpname;
--
--      if (ports[0] == 0)
--              ports[0] = MMS_PORT;
--
--      for (i = 0; (i < MAX_PORTS) && ports[i]; i++) {
--              memset(&mms[i], 0, sizeof(struct ip_conntrack_helper));
--              mms[i].tuple.src.u.tcp.port = htons(ports[i]);
--              mms[i].tuple.dst.protonum = IPPROTO_TCP;
--              mms[i].mask.src.u.tcp.port = 0xFFFF;
--              mms[i].mask.dst.protonum = 0xFFFF;
--              mms[i].max_expected = 1;
--              mms[i].timeout = 0;
--              mms[i].flags = IP_CT_HELPER_F_REUSE_EXPECT;
--              mms[i].me = THIS_MODULE;
--              mms[i].help = help;
--
--              tmpname = &mms_names[i][0];
--              if (ports[i] == MMS_PORT)
--                      sprintf(tmpname, "mms");
--              else
--                      sprintf(tmpname, "mms-%d", ports[i]);
--              mms[i].name = tmpname;
--
--              DEBUGP("ip_conntrack_mms: registering helper for port %d\n", 
--                              ports[i]);
--              ret = ip_conntrack_helper_register(&mms[i]);
--
--              if (ret) {
--                      fini();
--                      return ret;
--              }
--              ports_c++;
--      }
--      return 0;
--}
--
--module_init(init);
--module_exit(fini);
-diff -Nurb linux/net/ipv4/netfilter/ip_conntrack_pptp.c linux.stock/net/ipv4/netfilter/ip_conntrack_pptp.c
---- linux/net/ipv4/netfilter/ip_conntrack_pptp.c       2003-07-04 04:12:31.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ip_conntrack_pptp.c 1969-12-31 19:00:00.000000000 -0500
-@@ -1,531 +0,0 @@
--/*
-- * ip_conntrack_pptp.c        - Version 1.11
-- *
-- * Connection tracking support for PPTP (Point to Point Tunneling Protocol).
-- * PPTP is a a protocol for creating virtual private networks.
-- * It is a specification defined by Microsoft and some vendors
-- * working with Microsoft.  PPTP is built on top of a modified
-- * version of the Internet Generic Routing Encapsulation Protocol.
-- * GRE is defined in RFC 1701 and RFC 1702.  Documentation of
-- * PPTP can be found in RFC 2637
-- *
-- * (C) 2000-2002 by Harald Welte <laforge@gnumonks.org>, 
-- *
-- * Development of this code funded by Astaro AG (http://www.astaro.com/)
-- *
-- * Limitations:
-- *     - We blindly assume that control connections are always
-- *       established in PNS->PAC direction.  This is a violation
-- *       of RFFC2673
-- *
-- * TODO: - finish support for multiple calls within one session
-- *       (needs expect reservations in newnat)
-- *     - testing of incoming PPTP calls 
-- */
--
--#include <linux/config.h>
--#include <linux/module.h>
--#include <linux/netfilter.h>
--#include <linux/ip.h>
--#include <net/checksum.h>
--#include <net/tcp.h>
--
--#include <linux/netfilter_ipv4/lockhelp.h>
--#include <linux/netfilter_ipv4/ip_conntrack_helper.h>
--#include <linux/netfilter_ipv4/ip_conntrack_proto_gre.h>
--#include <linux/netfilter_ipv4/ip_conntrack_pptp.h>
--
--MODULE_LICENSE("GPL");
--MODULE_AUTHOR("Harald Welte <laforge@gnumonks.org>");
--MODULE_DESCRIPTION("Netfilter connection tracking helper module for PPTP");
--
--DECLARE_LOCK(ip_pptp_lock);
--
--#define DEBUGP(format, args...)
--
--#define SECS *HZ
--#define MINS * 60 SECS
--#define HOURS * 60 MINS
--#define DAYS * 24 HOURS
--
--#define PPTP_GRE_TIMEOUT              (10 MINS)
--#define PPTP_GRE_STREAM_TIMEOUT       (5 DAYS)
--
--static int pptp_expectfn(struct ip_conntrack *ct)
--{
--      struct ip_conntrack_expect *exp, *other_exp;
--      struct ip_conntrack *master;
--
--      DEBUGP("increasing timeouts\n");
--      /* increase timeout of GRE data channel conntrack entry */
--      ct->proto.gre.timeout = PPTP_GRE_TIMEOUT;
--      ct->proto.gre.stream_timeout = PPTP_GRE_STREAM_TIMEOUT;
--
--      master = master_ct(ct);
--      if (!master) {
--              DEBUGP(" no master!!!\n");
--              return 0;
--      }
--
--      DEBUGP("completing tuples with ct info\n");
--      /* we can do this, since we're unconfirmed */
--      if (ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u.gre.key == 
--              htonl(master->help.ct_pptp_info.pac_call_id)) { 
--              /* assume PNS->PAC */
--              ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u.gre.key = 
--                      htonl(master->help.ct_pptp_info.pns_call_id);
--              ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u.gre.key =
--                      htonl(master->help.ct_pptp_info.pns_call_id);
--      } else {
--              /* assume PAC->PNS */
--              ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u.gre.key =
--                      htonl(master->help.ct_pptp_info.pac_call_id);
--              ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u.gre.key =
--                      htonl(master->help.ct_pptp_info.pns_call_id);
--      }
--
--      return 0;
--}
--
--/* timeout GRE data connections */
--static int pptp_timeout_related(struct ip_conntrack *ct)
--{
--      struct list_head *cur_item;
--      struct ip_conntrack_expect *exp;
--
--      list_for_each(cur_item, &ct->sibling_list) {
--              exp = list_entry(cur_item, struct ip_conntrack_expect,
--                               expected_list);
--
--              if (!exp->sibling)
--                      continue;
--
--              DEBUGP("setting timeout of conntrack %p to 0\n",
--                      exp->sibling);
--              exp->sibling->proto.gre.timeout = 0;
--              exp->sibling->proto.gre.stream_timeout = 0;
--              ip_ct_refresh(exp->sibling, 0);
--      }
--
--      return 0;
--}
--
--/* expect GRE connection in PNS->PAC direction */
--static inline int
--exp_gre(struct ip_conntrack *master,
--      u_int32_t seq,
--      u_int16_t callid,
--      u_int16_t peer_callid)
--{
--      struct ip_conntrack_expect exp;
--      struct ip_conntrack_tuple inv_tuple;
--
--      memset(&exp, 0, sizeof(exp));
--      /* tuple in original direction, PAC->PNS */
--      exp.tuple.src.ip = master->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.ip;
--      exp.tuple.src.u.gre.key = htonl(ntohs(peer_callid));
--      exp.tuple.dst.ip = master->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.ip;
--      exp.tuple.dst.u.gre.key = htonl(ntohs(callid));
--      exp.tuple.dst.u.gre.protocol = __constant_htons(GRE_PROTOCOL_PPTP);
--      exp.tuple.dst.u.gre.version = GRE_VERSION_PPTP;
--      exp.tuple.dst.protonum = IPPROTO_GRE;
--
--      exp.mask.src.ip = 0xffffffff;
--      exp.mask.src.u.all = 0;
--      exp.mask.dst.u.all = 0;
--      exp.mask.dst.u.gre.key = 0xffffffff;
--      exp.mask.dst.u.gre.version = 0xff;
--      exp.mask.dst.u.gre.protocol = 0xffff;
--      exp.mask.dst.ip = 0xffffffff;
--      exp.mask.dst.protonum = 0xffff;
--                      
--      exp.seq = seq;
--      exp.expectfn = pptp_expectfn;
--
--      exp.help.exp_pptp_info.pac_call_id = ntohs(callid);
--      exp.help.exp_pptp_info.pns_call_id = ntohs(peer_callid);
--
--      DEBUGP("calling expect_related ");
--      DUMP_TUPLE_RAW(&exp.tuple);
--      
--      /* Add GRE keymap entries */
--      ip_ct_gre_keymap_add(&exp, &exp.tuple, 0);
--      invert_tuplepr(&inv_tuple, &exp.tuple);
--      ip_ct_gre_keymap_add(&exp, &inv_tuple, 1);
--      
--      ip_conntrack_expect_related(master, &exp);
--
--      return 0;
--}
--
--static inline int 
--pptp_inbound_pkt(struct tcphdr *tcph,
--               struct pptp_pkt_hdr *pptph, 
--               size_t datalen,
--               struct ip_conntrack *ct,
--               enum ip_conntrack_info ctinfo)
--{
--      struct PptpControlHeader *ctlh;
--        union pptp_ctrl_union pptpReq;
--      
--      struct ip_ct_pptp_master *info = &ct->help.ct_pptp_info;
--      u_int16_t msg, *cid, *pcid;
--      u_int32_t seq;  
--
--      ctlh = (struct PptpControlHeader *) 
--              ((char *) pptph + sizeof(struct pptp_pkt_hdr));
--      pptpReq.rawreq = (void *) 
--              ((char *) ctlh + sizeof(struct PptpControlHeader));
--
--      msg = ntohs(ctlh->messageType);
--      DEBUGP("inbound control message %s\n", strMName[msg]);
--
--      switch (msg) {
--      case PPTP_START_SESSION_REPLY:
--              /* server confirms new control session */
--              if (info->sstate < PPTP_SESSION_REQUESTED) {
--                      DEBUGP("%s without START_SESS_REQUEST\n",
--                              strMName[msg]);
--                      break;
--              }
--              if (pptpReq.srep->resultCode == PPTP_START_OK)
--                      info->sstate = PPTP_SESSION_CONFIRMED;
--              else 
--                      info->sstate = PPTP_SESSION_ERROR;
--              break;
--
--      case PPTP_STOP_SESSION_REPLY:
--              /* server confirms end of control session */
--              if (info->sstate > PPTP_SESSION_STOPREQ) {
--                      DEBUGP("%s without STOP_SESS_REQUEST\n",
--                              strMName[msg]);
--                      break;
--              }
--              if (pptpReq.strep->resultCode == PPTP_STOP_OK)
--                      info->sstate = PPTP_SESSION_NONE;
--              else
--                      info->sstate = PPTP_SESSION_ERROR;
--              break;
--
--      case PPTP_OUT_CALL_REPLY:
--              /* server accepted call, we now expect GRE frames */
--              if (info->sstate != PPTP_SESSION_CONFIRMED) {
--                      DEBUGP("%s but no session\n", strMName[msg]);
--                      break;
--              }
--              if (info->cstate != PPTP_CALL_OUT_REQ &&
--                  info->cstate != PPTP_CALL_OUT_CONF) {
--                      DEBUGP("%s without OUTCALL_REQ\n", strMName[msg]);
--                      break;
--              }
--              if (pptpReq.ocack->resultCode != PPTP_OUTCALL_CONNECT) {
--                      info->cstate = PPTP_CALL_NONE;
--                      break;
--              }
--
--              cid = &pptpReq.ocack->callID;
--              pcid = &pptpReq.ocack->peersCallID;
--
--              info->pac_call_id = ntohs(*cid);
--              
--              if (htons(info->pns_call_id) != *pcid) {
--                      DEBUGP("%s for unknown callid %u\n",
--                              strMName[msg], ntohs(*pcid));
--                      break;
--              }
--
--              DEBUGP("%s, CID=%X, PCID=%X\n", strMName[msg], 
--                      ntohs(*cid), ntohs(*pcid));
--              
--              info->cstate = PPTP_CALL_OUT_CONF;
--
--              seq = ntohl(tcph->seq) + ((void *)pcid - (void *)pptph);
--              exp_gre(ct, seq, *cid, *pcid);
--              break;
--
--      case PPTP_IN_CALL_REQUEST:
--              /* server tells us about incoming call request */
--              if (info->sstate != PPTP_SESSION_CONFIRMED) {
--                      DEBUGP("%s but no session\n", strMName[msg]);
--                      break;
--              }
--              pcid = &pptpReq.icack->peersCallID;
--              DEBUGP("%s, PCID=%X\n", strMName[msg], ntohs(*pcid));
--              info->cstate = PPTP_CALL_IN_REQ;
--              info->pac_call_id= ntohs(*pcid);
--              break;
--
--      case PPTP_IN_CALL_CONNECT:
--              /* server tells us about incoming call established */
--              if (info->sstate != PPTP_SESSION_CONFIRMED) {
--                      DEBUGP("%s but no session\n", strMName[msg]);
--                      break;
--              }
--              if (info->sstate != PPTP_CALL_IN_REP
--                  && info->sstate != PPTP_CALL_IN_CONF) {
--                      DEBUGP("%s but never sent IN_CALL_REPLY\n",
--                              strMName[msg]);
--                      break;
--              }
--
--              pcid = &pptpReq.iccon->peersCallID;
--              cid = &info->pac_call_id;
--
--              if (info->pns_call_id != ntohs(*pcid)) {
--                      DEBUGP("%s for unknown CallID %u\n", 
--                              strMName[msg], ntohs(*cid));
--                      break;
--              }
--
--              DEBUGP("%s, PCID=%X\n", strMName[msg], ntohs(*pcid));
--              info->cstate = PPTP_CALL_IN_CONF;
--
--              /* we expect a GRE connection from PAC to PNS */
--              seq = ntohl(tcph->seq) + ((void *)pcid - (void *)pptph);
--              exp_gre(ct, seq, *cid, *pcid);
--
--              break;
--
--      case PPTP_CALL_DISCONNECT_NOTIFY:
--              /* server confirms disconnect */
--              cid = &pptpReq.disc->callID;
--              DEBUGP("%s, CID=%X\n", strMName[msg], ntohs(*cid));
--              info->cstate = PPTP_CALL_NONE;
--
--              /* untrack this call id, unexpect GRE packets */
--              pptp_timeout_related(ct);
--              /* NEWNAT: look up exp for call id and unexpct_related */
--              break;
--
--      case PPTP_WAN_ERROR_NOTIFY:
--              break;
--
--      case PPTP_ECHO_REQUEST:
--      case PPTP_ECHO_REPLY:
--              /* I don't have to explain these ;) */
--              break;
--      default:
--              DEBUGP("invalid %s (TY=%d)\n", (msg <= PPTP_MSG_MAX)
--                      ? strMName[msg]:strMName[0], msg);
--              break;
--      }
--
--      return NF_ACCEPT;
--
--}
--
--static inline int
--pptp_outbound_pkt(struct tcphdr *tcph,
--                struct pptp_pkt_hdr *pptph,
--                size_t datalen,
--                struct ip_conntrack *ct,
--                enum ip_conntrack_info ctinfo)
--{
--      struct PptpControlHeader *ctlh;
--        union pptp_ctrl_union pptpReq;
--      struct ip_ct_pptp_master *info = &ct->help.ct_pptp_info;
--      u_int16_t msg, *cid, *pcid;
--
--      ctlh = (struct PptpControlHeader *) ((void *) pptph + sizeof(*pptph));
--      pptpReq.rawreq = (void *) ((void *) ctlh + sizeof(*ctlh));
--
--      msg = ntohs(ctlh->messageType);
--      DEBUGP("outbound control message %s\n", strMName[msg]);
--
--      switch (msg) {
--      case PPTP_START_SESSION_REQUEST:
--              /* client requests for new control session */
--              if (info->sstate != PPTP_SESSION_NONE) {
--                      DEBUGP("%s but we already have one",
--                              strMName[msg]);
--              }
--              info->sstate = PPTP_SESSION_REQUESTED;
--              break;
--      case PPTP_STOP_SESSION_REQUEST:
--              /* client requests end of control session */
--              info->sstate = PPTP_SESSION_STOPREQ;
--              break;
--
--      case PPTP_OUT_CALL_REQUEST:
--              /* client initiating connection to server */
--              if (info->sstate != PPTP_SESSION_CONFIRMED) {
--                      DEBUGP("%s but no session\n",
--                              strMName[msg]);
--                      break;
--              }
--              info->cstate = PPTP_CALL_OUT_REQ;
--              /* track PNS call id */
--              cid = &pptpReq.ocreq->callID;
--              DEBUGP("%s, CID=%X\n", strMName[msg], ntohs(*cid));
--              info->pns_call_id = ntohs(*cid);
--              break;
--      case PPTP_IN_CALL_REPLY:
--              /* client answers incoming call */
--              if (info->cstate != PPTP_CALL_IN_REQ
--                  && info->cstate != PPTP_CALL_IN_REP) {
--                      DEBUGP("%s without incall_req\n", 
--                              strMName[msg]);
--                      break;
--              }
--              if (pptpReq.icack->resultCode != PPTP_INCALL_ACCEPT) {
--                      info->cstate = PPTP_CALL_NONE;
--                      break;
--              }
--              pcid = &pptpReq.icack->peersCallID;
--              if (info->pac_call_id != ntohs(*pcid)) {
--                      DEBUGP("%s for unknown call %u\n", 
--                              strMName[msg], ntohs(*pcid));
--                      break;
--              }
--              DEBUGP("%s, CID=%X\n", strMName[msg], ntohs(*pcid));
--              /* part two of the three-way handshake */
--              info->cstate = PPTP_CALL_IN_REP;
--              info->pns_call_id = ntohs(pptpReq.icack->callID);
--              break;
--
--      case PPTP_CALL_CLEAR_REQUEST:
--              /* client requests hangup of call */
--              if (info->sstate != PPTP_SESSION_CONFIRMED) {
--                      DEBUGP("CLEAR_CALL but no session\n");
--                      break;
--              }
--              /* FUTURE: iterate over all calls and check if
--               * call ID is valid.  We don't do this without newnat,
--               * because we only know about last call */
--              info->cstate = PPTP_CALL_CLEAR_REQ;
--              break;
--      case PPTP_SET_LINK_INFO:
--              break;
--      case PPTP_ECHO_REQUEST:
--      case PPTP_ECHO_REPLY:
--              /* I don't have to explain these ;) */
--              break;
--      default:
--              DEBUGP("invalid %s (TY=%d)\n", (msg <= PPTP_MSG_MAX)? 
--                      strMName[msg]:strMName[0], msg);
--              /* unknown: no need to create GRE masq table entry */
--              break;
--      }
--
--      return NF_ACCEPT;
--}
--
--
--/* track caller id inside control connection, call expect_related */
--static int 
--conntrack_pptp_help(const struct iphdr *iph, size_t len,
--                  struct ip_conntrack *ct, enum ip_conntrack_info ctinfo)
--
--{
--      struct pptp_pkt_hdr *pptph;
--      
--      struct tcphdr *tcph = (void *) iph + iph->ihl * 4;
--      u_int32_t tcplen = len - iph->ihl * 4;
--      u_int32_t datalen = tcplen - tcph->doff * 4;
--      void *datalimit;
--      int dir = CTINFO2DIR(ctinfo);
--      struct ip_ct_pptp_master *info = &ct->help.ct_pptp_info;
--
--      int oldsstate, oldcstate;
--      int ret;
--
--      /* don't do any tracking before tcp handshake complete */
--      if (ctinfo != IP_CT_ESTABLISHED 
--          && ctinfo != IP_CT_ESTABLISHED+IP_CT_IS_REPLY) {
--              DEBUGP("ctinfo = %u, skipping\n", ctinfo);
--              return NF_ACCEPT;
--      }
--      
--      /* not a complete TCP header? */
--      if (tcplen < sizeof(struct tcphdr) || tcplen < tcph->doff * 4) {
--              DEBUGP("tcplen = %u\n", tcplen);
--              return NF_ACCEPT;
--      }
--
--      /* checksum invalid? */
--      if (tcp_v4_check(tcph, tcplen, iph->saddr, iph->daddr,
--                      csum_partial((char *) tcph, tcplen, 0))) {
--              printk(KERN_NOTICE __FILE__ ": bad csum\n");
--//            return NF_ACCEPT;
--      }
--
--      if (tcph->fin || tcph->rst) {
--              DEBUGP("RST/FIN received, timeouting GRE\n");
--              /* can't do this after real newnat */
--              info->cstate = PPTP_CALL_NONE;
--
--              /* untrack this call id, unexpect GRE packets */
--              pptp_timeout_related(ct);
--              /* no need to call unexpect_related since master conn
--               * dies anyway */
--      }
--
--
--      pptph = (struct pptp_pkt_hdr *) ((void *) tcph + tcph->doff * 4);
--      datalimit = (void *) pptph + datalen;
--
--      /* not a full pptp packet header? */
--      if ((void *) pptph+sizeof(*pptph) >= datalimit) {
--              DEBUGP("no full PPTP header, can't track\n");
--              return NF_ACCEPT;
--      }
--      
--      /* if it's not a control message we can't do anything with it */
--        if (ntohs(pptph->packetType) != PPTP_PACKET_CONTROL ||
--          ntohl(pptph->magicCookie) != PPTP_MAGIC_COOKIE) {
--              DEBUGP("not a control packet\n");
--              return NF_ACCEPT;
--      }
--
--      oldsstate = info->sstate;
--      oldcstate = info->cstate;
--
--      LOCK_BH(&ip_pptp_lock);
--
--      if (dir == IP_CT_DIR_ORIGINAL)
--              /* client -> server (PNS -> PAC) */
--              ret = pptp_outbound_pkt(tcph, pptph, datalen, ct, ctinfo);
--      else
--              /* server -> client (PAC -> PNS) */
--              ret = pptp_inbound_pkt(tcph, pptph, datalen, ct, ctinfo);
--      DEBUGP("sstate: %d->%d, cstate: %d->%d\n",
--              oldsstate, info->sstate, oldcstate, info->cstate);
--      UNLOCK_BH(&ip_pptp_lock);
--
--      return ret;
--}
--
--/* control protocol helper */
--static struct ip_conntrack_helper pptp = { 
--      { NULL, NULL },
--      "pptp", IP_CT_HELPER_F_REUSE_EXPECT, THIS_MODULE, 2, 0,
--      { { 0, { tcp: { port: __constant_htons(PPTP_CONTROL_PORT) } } }, 
--        { 0, { 0 }, IPPROTO_TCP } },
--      { { 0, { tcp: { port: 0xffff } } }, 
--        { 0, { 0 }, 0xffff } },
--      conntrack_pptp_help };
--
--/* ip_conntrack_pptp initialization */
--static int __init init(void)
--{
--      int retcode;
--
--      DEBUGP(__FILE__ ": registering helper\n");
--      if ((retcode = ip_conntrack_helper_register(&pptp))) {
--                printk(KERN_ERR "Unable to register conntrack application "
--                              "helper for pptp: %d\n", retcode);
--              return -EIO;
--      }
--
--      return 0;
--}
--
--static void __exit fini(void)
--{
--      ip_conntrack_helper_unregister(&pptp);
--}
--
--module_init(init);
--module_exit(fini);
--
--EXPORT_SYMBOL(ip_pptp_lock);
-diff -Nurb linux/net/ipv4/netfilter/ip_conntrack_pptp_priv.h linux.stock/net/ipv4/netfilter/ip_conntrack_pptp_priv.h
---- linux/net/ipv4/netfilter/ip_conntrack_pptp_priv.h  2003-07-04 04:12:31.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ip_conntrack_pptp_priv.h    1969-12-31 19:00:00.000000000 -0500
-@@ -1,24 +0,0 @@
--#ifndef _IP_CT_PPTP_PRIV_H
--#define _IP_CT_PPTP_PRIV_H
--
--/* PptpControlMessageType names */
--static const char *strMName[] = {
--      "UNKNOWN_MESSAGE",
--      "START_SESSION_REQUEST",
--      "START_SESSION_REPLY",
--      "STOP_SESSION_REQUEST",
--      "STOP_SESSION_REPLY",
--      "ECHO_REQUEST",
--      "ECHO_REPLY",
--      "OUT_CALL_REQUEST",
--      "OUT_CALL_REPLY",
--      "IN_CALL_REQUEST",
--      "IN_CALL_REPLY",
--      "IN_CALL_CONNECT",
--      "CALL_CLEAR_REQUEST",
--      "CALL_DISCONNECT_NOTIFY",
--      "WAN_ERROR_NOTIFY",
--      "SET_LINK_INFO"
--};
--
--#endif
-diff -Nurb linux/net/ipv4/netfilter/ip_conntrack_proto_gre.c linux.stock/net/ipv4/netfilter/ip_conntrack_proto_gre.c
---- linux/net/ipv4/netfilter/ip_conntrack_proto_gre.c  2003-07-04 04:12:31.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ip_conntrack_proto_gre.c    1969-12-31 19:00:00.000000000 -0500
-@@ -1,320 +0,0 @@
--/*
-- * ip_conntrack_proto_gre.c - Version 1.11
-- *
-- * Connection tracking protocol helper module for GRE.
-- *
-- * GRE is a generic encapsulation protocol, which is generally not very
-- * suited for NAT, as it has no protocol-specific part as port numbers.
-- *
-- * It has an optional key field, which may help us distinguishing two 
-- * connections between the same two hosts.
-- *
-- * GRE is defined in RFC 1701 and RFC 1702, as well as RFC 2784 
-- *
-- * PPTP is built on top of a modified version of GRE, and has a mandatory
-- * field called "CallID", which serves us for the same purpose as the key
-- * field in plain GRE.
-- *
-- * Documentation about PPTP can be found in RFC 2637
-- *
-- * (C) 2000-2002 by Harald Welte <laforge@gnumonks.org>
-- *
-- * Development of this code funded by Astaro AG (http://www.astaro.com/)
-- *
-- */
--
--#include <linux/config.h>
--#include <linux/module.h>
--#include <linux/types.h>
--#include <linux/timer.h>
--#include <linux/netfilter.h>
--#include <linux/ip.h>
--#include <linux/in.h>
--#include <linux/list.h>
--
--#include <linux/netfilter_ipv4/lockhelp.h>
--
--DECLARE_RWLOCK(ip_ct_gre_lock);
--#define ASSERT_READ_LOCK(x) MUST_BE_READ_LOCKED(&ip_ct_gre_lock)
--#define ASSERT_WRITE_LOCK(x) MUST_BE_WRITE_LOCKED(&ip_ct_gre_lock)
--
--#include <linux/netfilter_ipv4/listhelp.h>
--#include <linux/netfilter_ipv4/ip_conntrack_protocol.h>
--#include <linux/netfilter_ipv4/ip_conntrack_helper.h>
--#include <linux/netfilter_ipv4/ip_conntrack_core.h>
--
--#include <linux/netfilter_ipv4/ip_conntrack_proto_gre.h>
--#include <linux/netfilter_ipv4/ip_conntrack_pptp.h>
--
--MODULE_LICENSE("GPL");
--MODULE_AUTHOR("Harald Welte <laforge@gnumonks.org>");
--MODULE_DESCRIPTION("netfilter connection tracking protocol helper for GRE");
--
--/* shamelessly stolen from ip_conntrack_proto_udp.c */
--#define GRE_TIMEOUT           (30*HZ)
--#define GRE_STREAM_TIMEOUT    (180*HZ)
--
--#define DEBUGP(x, args...)
--#define DUMP_TUPLE_GRE(x)
--                              
--/* GRE KEYMAP HANDLING FUNCTIONS */
--static LIST_HEAD(gre_keymap_list);
--
--static inline int gre_key_cmpfn(const struct ip_ct_gre_keymap *km,
--                              const struct ip_conntrack_tuple *t)
--{
--      return ((km->tuple.src.ip == t->src.ip) &&
--              (km->tuple.dst.ip == t->dst.ip) &&
--              (km->tuple.dst.protonum == t->dst.protonum) &&
--              (km->tuple.dst.u.all == t->dst.u.all));
--}
--
--/* look up the source key for a given tuple */
--static u_int32_t gre_keymap_lookup(struct ip_conntrack_tuple *t)
--{
--      struct ip_ct_gre_keymap *km;
--      u_int32_t key;
--
--      READ_LOCK(&ip_ct_gre_lock);
--      km = LIST_FIND(&gre_keymap_list, gre_key_cmpfn,
--                      struct ip_ct_gre_keymap *, t);
--      if (!km) {
--              READ_UNLOCK(&ip_ct_gre_lock);
--              return 0;
--      }
--
--      key = km->tuple.src.u.gre.key;
--      READ_UNLOCK(&ip_ct_gre_lock);
--
--      return key;
--}
--
--/* add a single keymap entry, associate with specified expect */
--int ip_ct_gre_keymap_add(struct ip_conntrack_expect *exp,
--                       struct ip_conntrack_tuple *t, int reply)
--{
--      struct ip_ct_gre_keymap *km;
--
--      km = kmalloc(sizeof(*km), GFP_ATOMIC);
--      if (!km)
--              return -1;
--
--      /* initializing list head should be sufficient */
--      memset(km, 0, sizeof(*km));
--
--      memcpy(&km->tuple, t, sizeof(*t));
--      km->master = exp;
--
--      if (!reply)
--              exp->proto.gre.keymap_orig = km;
--      else
--              exp->proto.gre.keymap_reply = km;
--
--      DEBUGP("adding new entry %p: ", km);
--      DUMP_TUPLE_GRE(&km->tuple);
--
--      WRITE_LOCK(&ip_ct_gre_lock);
--      list_append(&gre_keymap_list, km);
--      WRITE_UNLOCK(&ip_ct_gre_lock);
--
--      return 0;
--}
--
--/* change the tuple of a keymap entry (used by nat helper) */
--void ip_ct_gre_keymap_change(struct ip_ct_gre_keymap *km,
--                           struct ip_conntrack_tuple *t)
--{
--      DEBUGP("changing entry %p to: ", km);
--      DUMP_TUPLE_GRE(t);
--
--      WRITE_LOCK(&ip_ct_gre_lock);
--      memcpy(&km->tuple, t, sizeof(km->tuple));
--      WRITE_UNLOCK(&ip_ct_gre_lock);
--}
--
--
--/* PUBLIC CONNTRACK PROTO HELPER FUNCTIONS */
--
--/* invert gre part of tuple */
--static int gre_invert_tuple(struct ip_conntrack_tuple *tuple,
--                          const struct ip_conntrack_tuple *orig)
--{
--      tuple->dst.u.gre.protocol = orig->dst.u.gre.protocol;
--      tuple->dst.u.gre.version = orig->dst.u.gre.version;
--
--      tuple->dst.u.gre.key = orig->src.u.gre.key;
--      tuple->src.u.gre.key = orig->dst.u.gre.key;
--
--      return 1;
--}
--
--/* gre hdr info to tuple */
--static int gre_pkt_to_tuple(const void *datah, size_t datalen,
--                          struct ip_conntrack_tuple *tuple)
--{
--      struct gre_hdr *grehdr = (struct gre_hdr *) datah;
--      struct gre_hdr_pptp *pgrehdr = (struct gre_hdr_pptp *) datah;
--      u_int32_t srckey;
--
--      /* core guarantees 8 protocol bytes, no need for size check */
--
--      tuple->dst.u.gre.version = grehdr->version; 
--      tuple->dst.u.gre.protocol = grehdr->protocol;
--
--      switch (grehdr->version) {
--              case GRE_VERSION_1701:
--                      if (!grehdr->key) {
--                              DEBUGP("Can't track GRE without key\n");
--                              return 0;
--                      }
--                      tuple->dst.u.gre.key = *(gre_key(grehdr));
--                      break;
--
--              case GRE_VERSION_PPTP:
--                      if (ntohs(grehdr->protocol) != GRE_PROTOCOL_PPTP) {
--                              DEBUGP("GRE_VERSION_PPTP but unknown proto\n");
--                              return 0;
--                      }
--                      tuple->dst.u.gre.key = htonl(ntohs(pgrehdr->call_id));
--                      break;
--
--              default:
--                      printk(KERN_WARNING "unknown GRE version %hu\n",
--                              tuple->dst.u.gre.version);
--                      return 0;
--      }
--
--      srckey = gre_keymap_lookup(tuple);
--
--      tuple->src.u.gre.key = srckey;
--
--      return 1;
--}
--
--/* print gre part of tuple */
--static unsigned int gre_print_tuple(char *buffer,
--                                  const struct ip_conntrack_tuple *tuple)
--{
--      return sprintf(buffer, "version=%d protocol=0x%04x srckey=0x%x dstkey=0x%x ", 
--                      tuple->dst.u.gre.version,
--                      ntohs(tuple->dst.u.gre.protocol),
--                      ntohl(tuple->src.u.gre.key),
--                      ntohl(tuple->dst.u.gre.key));
--}
--
--/* print private data for conntrack */
--static unsigned int gre_print_conntrack(char *buffer,
--                                      const struct ip_conntrack *ct)
--{
--      return sprintf(buffer, "timeout=%u, stream_timeout=%u ",
--                     (ct->proto.gre.timeout / HZ),
--                     (ct->proto.gre.stream_timeout / HZ));
--}
--
--/* Returns verdict for packet, and may modify conntrack */
--static int gre_packet(struct ip_conntrack *ct,
--                    struct iphdr *iph, size_t len,
--                    enum ip_conntrack_info conntrackinfo)
--{
--      /* If we've seen traffic both ways, this is a GRE connection.
--       * Extend timeout. */
--      if (ct->status & IPS_SEEN_REPLY) {
--              ip_ct_refresh(ct, ct->proto.gre.stream_timeout);
--              /* Also, more likely to be important, and not a probe. */
--              set_bit(IPS_ASSURED_BIT, &ct->status);
--      } else
--              ip_ct_refresh(ct, ct->proto.gre.timeout);
--      
--      return NF_ACCEPT;
--}
--
--/* Called when a new connection for this protocol found. */
--static int gre_new(struct ip_conntrack *ct,
--                 struct iphdr *iph, size_t len)
--{ 
--      DEBUGP(": ");
--      DUMP_TUPLE_GRE(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
--
--      /* initialize to sane value.  Ideally a conntrack helper
--       * (e.g. in case of pptp) is increasing them */
--      ct->proto.gre.stream_timeout = GRE_STREAM_TIMEOUT;
--      ct->proto.gre.timeout = GRE_TIMEOUT;
--
--      return 1;
--}
--
--/* Called when a conntrack entry has already been removed from the hashes
-- * and is about to be deleted from memory */
--static void gre_destroy(struct ip_conntrack *ct)
--{
--      struct ip_conntrack_expect *master = ct->master;
--
--      DEBUGP(" entering\n");
--
--      if (!master) {
--              DEBUGP("no master exp for ct %p\n", ct);
--              return;
--      }
--
--      WRITE_LOCK(&ip_ct_gre_lock);
--      if (master->proto.gre.keymap_orig) {
--              DEBUGP("removing %p from list\n", master->proto.gre.keymap_orig);
--              list_del(&master->proto.gre.keymap_orig->list);
--              kfree(master->proto.gre.keymap_orig);
--      }
--      if (master->proto.gre.keymap_reply) {
--              DEBUGP("removing %p from list\n", master->proto.gre.keymap_reply);
--              list_del(&master->proto.gre.keymap_reply->list);
--              kfree(master->proto.gre.keymap_reply);
--      }
--      WRITE_UNLOCK(&ip_ct_gre_lock);
--}
--
--/* protocol helper struct */
--static struct ip_conntrack_protocol gre = { { NULL, NULL }, IPPROTO_GRE,
--                                          "gre", 
--                                          gre_pkt_to_tuple,
--                                          gre_invert_tuple,
--                                          gre_print_tuple,
--                                          gre_print_conntrack,
--                                          gre_packet,
--                                          gre_new,
--                                          gre_destroy,
--                                          NULL,
--                                          THIS_MODULE };
--
--/* ip_conntrack_proto_gre initialization */
--static int __init init(void)
--{
--      int retcode;
--
--      if ((retcode = ip_conntrack_protocol_register(&gre))) {
--                printk(KERN_ERR "Unable to register conntrack protocol "
--                              "helper for gre: %d\n", retcode);
--              return -EIO;
--      }
--
--      return 0;
--}
--
--static void __exit fini(void)
--{
--      struct list_head *pos, *n;
--
--      /* delete all keymap entries */
--      WRITE_LOCK(&ip_ct_gre_lock);
--      list_for_each_safe(pos, n, &gre_keymap_list) {
--              DEBUGP("deleting keymap %p\n", pos);
--              list_del(pos);
--              kfree(pos);
--      }
--      WRITE_UNLOCK(&ip_ct_gre_lock);
--
--      ip_conntrack_protocol_unregister(&gre); 
--}
--
--EXPORT_SYMBOL(ip_ct_gre_keymap_add);
--EXPORT_SYMBOL(ip_ct_gre_keymap_change);
--
--module_init(init);
--module_exit(fini);
-diff -Nurb linux/net/ipv4/netfilter/ip_conntrack_proto_tcp.c linux.stock/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
---- linux/net/ipv4/netfilter/ip_conntrack_proto_tcp.c  2003-08-12 07:33:45.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ip_conntrack_proto_tcp.c    2004-05-09 04:13:03.000000000 -0400
-@@ -15,11 +15,17 @@
- #include <linux/netfilter_ipv4/ip_conntrack_protocol.h>
- #include <linux/netfilter_ipv4/lockhelp.h>
-+#if 0
-+#define DEBUGP printk
-+#else
- #define DEBUGP(format, args...)
-+#endif
- /* Protects conntrack->proto.tcp */
- static DECLARE_RWLOCK(tcp_lock);
-+/* FIXME: Examine ipfilter's timeouts and conntrack transitions more
-+   closely.  They're more complex. --RR */
- /* Actually, I believe that neither ipmasq (where this code is stolen
-    from) nor ipfilter do it exactly right.  A new conntrack machine taking
-@@ -39,6 +45,25 @@
-       "LISTEN"
- };
-+#define SECS *HZ
-+#define MINS * 60 SECS
-+#define HOURS * 60 MINS
-+#define DAYS * 24 HOURS
-+
-+
-+static unsigned long tcp_timeouts[]
-+= { 30 MINS,  /*      TCP_CONNTRACK_NONE,     */
-+    5 DAYS,   /*      TCP_CONNTRACK_ESTABLISHED,      */
-+    2 MINS,   /*      TCP_CONNTRACK_SYN_SENT, */
-+    60 SECS,  /*      TCP_CONNTRACK_SYN_RECV, */
-+    2 MINS,   /*      TCP_CONNTRACK_FIN_WAIT, */
-+    2 MINS,   /*      TCP_CONNTRACK_TIME_WAIT,        */
-+    10 SECS,  /*      TCP_CONNTRACK_CLOSE,    */
-+    60 SECS,  /*      TCP_CONNTRACK_CLOSE_WAIT,       */
-+    30 SECS,  /*      TCP_CONNTRACK_LAST_ACK, */
-+    2 MINS,   /*      TCP_CONNTRACK_LISTEN,   */
-+};
-+
- #define sNO TCP_CONNTRACK_NONE
- #define sES TCP_CONNTRACK_ESTABLISHED
- #define sSS TCP_CONNTRACK_SYN_SENT
-@@ -161,13 +186,13 @@
-           && tcph->syn && tcph->ack)
-               conntrack->proto.tcp.handshake_ack
-                       = htonl(ntohl(tcph->seq) + 1);
-+      WRITE_UNLOCK(&tcp_lock);
-       /* If only reply is a RST, we can consider ourselves not to
-          have an established connection: this is a fairly common
-          problem case, so we can delete the conntrack
-          immediately.  --RR */
-       if (!(conntrack->status & IPS_SEEN_REPLY) && tcph->rst) {
--              WRITE_UNLOCK(&tcp_lock);
-               if (del_timer(&conntrack->timeout))
-                       conntrack->timeout.function((unsigned long)conntrack);
-       } else {
-@@ -178,9 +203,7 @@
-                   && tcph->ack_seq == conntrack->proto.tcp.handshake_ack)
-                       set_bit(IPS_ASSURED_BIT, &conntrack->status);
--              WRITE_UNLOCK(&tcp_lock);
--              ip_ct_refresh(conntrack, 
--                      sysctl_ip_conntrack_tcp_timeouts[newconntrack]);
-+              ip_ct_refresh(conntrack, tcp_timeouts[newconntrack]);
-       }
-       return NF_ACCEPT;
-diff -Nurb linux/net/ipv4/netfilter/ip_conntrack_proto_udp.c linux.stock/net/ipv4/netfilter/ip_conntrack_proto_udp.c
---- linux/net/ipv4/netfilter/ip_conntrack_proto_udp.c  2003-08-12 07:33:45.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ip_conntrack_proto_udp.c    2004-05-09 04:13:03.000000000 -0400
-@@ -5,7 +5,9 @@
- #include <linux/in.h>
- #include <linux/udp.h>
- #include <linux/netfilter_ipv4/ip_conntrack_protocol.h>
--#include <linux/netfilter_ipv4/ip_conntrack_udp.h>
-+
-+#define UDP_TIMEOUT (30*HZ)
-+#define UDP_STREAM_TIMEOUT (180*HZ)
- static int udp_pkt_to_tuple(const void *datah, size_t datalen,
-                           struct ip_conntrack_tuple *tuple)
-@@ -50,13 +52,11 @@
-       /* If we've seen traffic both ways, this is some kind of UDP
-          stream.  Extend timeout. */
-       if (conntrack->status & IPS_SEEN_REPLY) {
--              ip_ct_refresh(conntrack, 
--                      sysctl_ip_conntrack_udp_timeouts[UDP_STREAM_TIMEOUT]);
-+              ip_ct_refresh(conntrack, UDP_STREAM_TIMEOUT);
-               /* Also, more likely to be important, and not a probe */
-               set_bit(IPS_ASSURED_BIT, &conntrack->status);
-       } else
--              ip_ct_refresh(conntrack, 
--                      sysctl_ip_conntrack_udp_timeouts[UDP_TIMEOUT]);
-+              ip_ct_refresh(conntrack, UDP_TIMEOUT);
-       return NF_ACCEPT;
- }
-diff -Nurb linux/net/ipv4/netfilter/ip_conntrack_standalone.c linux.stock/net/ipv4/netfilter/ip_conntrack_standalone.c
---- linux/net/ipv4/netfilter/ip_conntrack_standalone.c 2003-08-12 07:33:45.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ip_conntrack_standalone.c   2004-05-09 04:13:03.000000000 -0400
-@@ -27,7 +27,11 @@
- #include <linux/netfilter_ipv4/ip_conntrack_helper.h>
- #include <linux/netfilter_ipv4/listhelp.h>
-+#if 0
-+#define DEBUGP printk
-+#else
- #define DEBUGP(format, args...)
-+#endif
- struct module *ip_conntrack_module = THIS_MODULE;
- MODULE_LICENSE("GPL");
-@@ -52,17 +56,12 @@
-       return len;
- }
-+/* FIXME: Don't print source proto part. --RR */
- static unsigned int
- print_expect(char *buffer, const struct ip_conntrack_expect *expect)
- {
-       unsigned int len;
--      if (!expect  || !expect->expectant || !expect->expectant->helper) {
--              DEBUGP("expect  %x expect->expectant %x expect->expectant->helper %x\n", 
--                      expect, expect->expectant, expect->expectant->helper);
--              return 0;
--      }
--
-       if (expect->expectant->helper->timeout)
-               len = sprintf(buffer, "EXPECTING: %lu ",
-                             timer_pending(&expect->timeout)
-@@ -294,6 +293,8 @@
-       return ret;
- }
-+/* FIXME: Allow NULL functions and sub in pointers to generic for
-+   them. --RR */
- int ip_conntrack_protocol_register(struct ip_conntrack_protocol *proto)
- {
-       int ret = 0;
-@@ -362,8 +363,6 @@
- EXPORT_SYMBOL(ip_ct_find_proto);
- EXPORT_SYMBOL(__ip_ct_find_proto);
- EXPORT_SYMBOL(ip_ct_find_helper);
--EXPORT_SYMBOL(sysctl_ip_conntrack_tcp_timeouts);
--EXPORT_SYMBOL(sysctl_ip_conntrack_udp_timeouts);
- EXPORT_SYMBOL(ip_conntrack_expect_related);
- EXPORT_SYMBOL(ip_conntrack_change_expect);
- EXPORT_SYMBOL(ip_conntrack_unexpect_related);
-diff -Nurb linux/net/ipv4/netfilter/ip_conntrack_tftp.c linux.stock/net/ipv4/netfilter/ip_conntrack_tftp.c
---- linux/net/ipv4/netfilter/ip_conntrack_tftp.c       2003-07-04 04:12:31.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ip_conntrack_tftp.c 1969-12-31 19:00:00.000000000 -0500
-@@ -1,126 +0,0 @@
--/*
-- * Licensed under GNU GPL version 2 Copyright Magnus Boden <mb@ozaba.mine.nu>
-- * Version: 0.0.7
-- *
-- * Thu 21 Mar 2002 Harald Welte <laforge@gnumonks.org>
-- *    - port to newnat API
-- *
-- */
--
--#include <linux/module.h>
--#include <linux/ip.h>
--#include <linux/udp.h>
--
--#include <linux/netfilter.h>
--#include <linux/netfilter_ipv4/ip_tables.h>
--#include <linux/netfilter_ipv4/ip_conntrack_helper.h>
--#include <linux/netfilter_ipv4/ip_conntrack_tftp.h>
--
--MODULE_AUTHOR("Magnus Boden <mb@ozaba.mine.nu>");
--MODULE_DESCRIPTION("Netfilter connection tracking module for tftp");
--MODULE_LICENSE("GPL");
--
--#define MAX_PORTS 8
--static int ports[MAX_PORTS];
--static int ports_c = 0;
--#ifdef MODULE_PARM
--MODULE_PARM(ports, "1-" __MODULE_STRING(MAX_PORTS) "i");
--MODULE_PARM_DESC(ports, "port numbers of tftp servers");
--#endif
--
--#define DEBUGP(format, args...)
--
--static int tftp_help(const struct iphdr *iph, size_t len,
--      struct ip_conntrack *ct,
--      enum ip_conntrack_info ctinfo)
--{
--      struct udphdr *udph = (void *)iph + iph->ihl * 4;
--      struct tftphdr *tftph = (void *)udph + 8;
--      struct ip_conntrack_expect exp;
--      
--      switch (ntohs(tftph->opcode)) {
--      /* RRQ and WRQ works the same way */
--      case TFTP_OPCODE_READ:
--      case TFTP_OPCODE_WRITE:
--              DEBUGP("");
--              DUMP_TUPLE(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
--              DUMP_TUPLE(&ct->tuplehash[IP_CT_DIR_REPLY].tuple);
--              memset(&exp, 0, sizeof(exp));
--
--              exp.tuple = ct->tuplehash[IP_CT_DIR_REPLY].tuple;
--              exp.mask.src.ip = 0xffffffff;
--              exp.mask.dst.ip = 0xffffffff;
--              exp.mask.dst.u.udp.port = 0xffff;
--              exp.mask.dst.protonum = 0xffff;
--              exp.expectfn = NULL;
--
--              DEBUGP("expect: ");
--              DUMP_TUPLE(&exp.tuple);
--              DUMP_TUPLE(&exp.mask);
--              ip_conntrack_expect_related(ct, &exp);
--              break;
--      default:
--              DEBUGP("Unknown opcode\n");
--      }
--      return NF_ACCEPT;
--}
--
--static struct ip_conntrack_helper tftp[MAX_PORTS];
--static char tftp_names[MAX_PORTS][10];
--
--static void fini(void)
--{
--      int i;
--
--      for (i = 0 ; i < ports_c; i++) {
--              DEBUGP("unregistering helper for port %d\n",
--                      ports[i]);
--              ip_conntrack_helper_unregister(&tftp[i]);
--      } 
--}
--
--static int __init init(void)
--{
--      int i, ret;
--      char *tmpname;
--
--      if (!ports[0])
--              ports[0]=TFTP_PORT;
--
--      for (i = 0 ; (i < MAX_PORTS) && ports[i] ; i++) {
--              /* Create helper structure */
--              memset(&tftp[i], 0, sizeof(struct ip_conntrack_helper));
--
--              tftp[i].tuple.dst.protonum = IPPROTO_UDP;
--              tftp[i].tuple.src.u.udp.port = htons(ports[i]);
--              tftp[i].mask.dst.protonum = 0xFFFF;
--              tftp[i].mask.src.u.udp.port = 0xFFFF;
--              tftp[i].max_expected = 1;
--              tftp[i].timeout = 0;
--              tftp[i].flags = IP_CT_HELPER_F_REUSE_EXPECT;
--              tftp[i].me = THIS_MODULE;
--              tftp[i].help = tftp_help;
--
--              tmpname = &tftp_names[i][0];
--              if (ports[i] == TFTP_PORT)
--                      sprintf(tmpname, "tftp");
--              else
--                      sprintf(tmpname, "tftp-%d", i);
--              tftp[i].name = tmpname;
--
--              DEBUGP("port #%d: %d\n", i, ports[i]);
--
--              ret=ip_conntrack_helper_register(&tftp[i]);
--              if (ret) {
--                      printk("ERROR registering helper for port %d\n",
--                              ports[i]);
--                      fini();
--                      return(ret);
--              }
--              ports_c++;
--      }
--      return(0);
--}
--
--module_init(init);
--module_exit(fini);
-diff -Nurb linux/net/ipv4/netfilter/ip_nat_core.c linux.stock/net/ipv4/netfilter/ip_nat_core.c
---- linux/net/ipv4/netfilter/ip_nat_core.c     2003-07-04 04:12:31.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ip_nat_core.c       2004-05-09 04:13:03.000000000 -0400
-@@ -31,7 +31,11 @@
- #include <linux/netfilter_ipv4/ip_conntrack_helper.h>
- #include <linux/netfilter_ipv4/listhelp.h>
-+#if 0
-+#define DEBUGP printk
-+#else
- #define DEBUGP(format, args...)
-+#endif
- DECLARE_RWLOCK(ip_nat_lock);
- DECLARE_RWLOCK_EXTERN(ip_conntrack_lock);
-@@ -207,6 +211,7 @@
- {
-       struct rtable *rt;
-+      /* FIXME: IPTOS_TOS(iph->tos) --RR */
-       if (ip_route_output(&rt, var_ip, 0, 0, 0) != 0) {
-               DEBUGP("do_extra_mangle: Can't get route to %u.%u.%u.%u\n",
-                      NIPQUAD(var_ip));
-@@ -429,7 +434,7 @@
-       *tuple = *orig_tuple;
-       while ((rptr = find_best_ips_proto_fast(tuple, mr, conntrack, hooknum))
-              != NULL) {
--              DEBUGP("Found best for "); DUMP_TUPLE_RAW(tuple);
-+              DEBUGP("Found best for "); DUMP_TUPLE(tuple);
-               /* 3) The per-protocol part of the manip is made to
-                  map into the range to make a unique tuple. */
-@@ -529,6 +534,31 @@
-       invert_tuplepr(&orig_tp,
-                      &conntrack->tuplehash[IP_CT_DIR_REPLY].tuple);
-+#if 0
-+      {
-+      unsigned int i;
-+
-+      DEBUGP("Hook %u (%s), ", hooknum,
-+             HOOK2MANIP(hooknum)==IP_NAT_MANIP_SRC ? "SRC" : "DST");
-+      DUMP_TUPLE(&orig_tp);
-+      DEBUGP("Range %p: ", mr);
-+      for (i = 0; i < mr->rangesize; i++) {
-+              DEBUGP("%u:%s%s%s %u.%u.%u.%u - %u.%u.%u.%u %u - %u\n",
-+                     i,
-+                     (mr->range[i].flags & IP_NAT_RANGE_MAP_IPS)
-+                     ? " MAP_IPS" : "",
-+                     (mr->range[i].flags
-+                      & IP_NAT_RANGE_PROTO_SPECIFIED)
-+                     ? " PROTO_SPECIFIED" : "",
-+                     (mr->range[i].flags & IP_NAT_RANGE_FULL)
-+                     ? " FULL" : "",
-+                     NIPQUAD(mr->range[i].min_ip),
-+                     NIPQUAD(mr->range[i].max_ip),
-+                     mr->range[i].min.all,
-+                     mr->range[i].max.all);
-+      }
-+      }
-+#endif
-       do {
-               if (!get_unique_tuple(&new_tuple, &orig_tp, mr, conntrack,
-@@ -538,6 +568,15 @@
-                       return NF_DROP;
-               }
-+#if 0
-+              DEBUGP("Hook %u (%s) %p\n", hooknum,
-+                     HOOK2MANIP(hooknum)==IP_NAT_MANIP_SRC ? "SRC" : "DST",
-+                     conntrack);
-+              DEBUGP("Original: ");
-+              DUMP_TUPLE(&orig_tp);
-+              DEBUGP("New: ");
-+              DUMP_TUPLE(&new_tuple);
-+#endif
-               /* We now have two tuples (SRCIP/SRCPT/DSTIP/DSTPT):
-                  the original (A/B/C/D') and the mangled one (E/F/G/H').
-@@ -554,6 +593,8 @@
-                    If fail this race (reply tuple now used), repeat. */
-       } while (!ip_conntrack_alter_reply(conntrack, &reply));
-+      /* FIXME: We can simply used existing conntrack reply tuple
-+           here --RR */
-       /* Create inverse of original: C/D/A/B' */
-       invert_tuplepr(&inv_tuple, &orig_tp);
-@@ -678,6 +719,17 @@
-                                               iph->check);
-               iph->daddr = manip->ip;
-       }
-+#if 0
-+      if (ip_fast_csum((u8 *)iph, iph->ihl) != 0)
-+              DEBUGP("IP: checksum on packet bad.\n");
-+
-+      if (proto == IPPROTO_TCP) {
-+              void *th = (u_int32_t *)iph + iph->ihl;
-+              if (tcp_v4_check(th, len - 4*iph->ihl, iph->saddr, iph->daddr,
-+                               csum_partial((char *)th, len-4*iph->ihl, 0)))
-+                      DEBUGP("TCP: checksum on packet bad\n");
-+      }
-+#endif
- }
- static inline int exp_for_packet(struct ip_conntrack_expect *exp,
-@@ -765,6 +817,7 @@
-                               continue;
-                       if (exp_for_packet(exp, pskb)) {
-+                              /* FIXME: May be true multiple times in the case of UDP!! */
-                               DEBUGP("calling nat helper (exp=%p) for packet\n",
-                                       exp);
-                               ret = helper->help(ct, exp, info, ctinfo, 
-@@ -926,6 +979,7 @@
-               INIT_LIST_HEAD(&byipsproto[i]);
-       }
-+      /* FIXME: Man, this is a hack.  <SIGH> */
-       IP_NF_ASSERT(ip_conntrack_destroyed == NULL);
-       ip_conntrack_destroyed = &ip_nat_cleanup_conntrack;
-diff -Nurb linux/net/ipv4/netfilter/ip_nat_h323.c linux.stock/net/ipv4/netfilter/ip_nat_h323.c
---- linux/net/ipv4/netfilter/ip_nat_h323.c     2003-07-04 04:12:31.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ip_nat_h323.c       1969-12-31 19:00:00.000000000 -0500
-@@ -1,403 +0,0 @@
--/* 
-- * H.323 'brute force' extension for NAT alteration. 
-- * Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
-- *
-- * Based on ip_masq_h323.c for 2.2 kernels from CoRiTel, Sofia project.
-- * (http://www.coritel.it/projects/sofia/nat.html)
-- * Uses Sampsa Ranta's excellent idea on using expectfn to 'bind'
-- * the unregistered helpers to the conntrack entries.
-- */
--
--
--#include <linux/module.h>
--#include <linux/netfilter.h>
--#include <linux/ip.h>
--#include <net/checksum.h>
--#include <net/tcp.h>
--
--#include <linux/netfilter_ipv4/lockhelp.h>
--#include <linux/netfilter_ipv4/ip_nat.h>
--#include <linux/netfilter_ipv4/ip_nat_helper.h>
--#include <linux/netfilter_ipv4/ip_nat_rule.h>
--#include <linux/netfilter_ipv4/ip_conntrack_tuple.h>
--#include <linux/netfilter_ipv4/ip_conntrack_helper.h>
--#include <linux/netfilter_ipv4/ip_conntrack_h323.h>
--
--MODULE_AUTHOR("Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>");
--MODULE_DESCRIPTION("H.323 'brute force' connection tracking module");
--MODULE_LICENSE("GPL");
--
--DECLARE_LOCK_EXTERN(ip_h323_lock);
--struct module *ip_nat_h323 = THIS_MODULE;
--
--#define DEBUGP(format, args...)
--
--
--static unsigned int 
--h225_nat_expected(struct sk_buff **pskb,
--                unsigned int hooknum,
--                struct ip_conntrack *ct,
--                struct ip_nat_info *info);
--
--static unsigned int h225_nat_help(struct ip_conntrack *ct,
--                                struct ip_conntrack_expect *exp,
--                                struct ip_nat_info *info,
--                                enum ip_conntrack_info ctinfo,
--                                unsigned int hooknum,
--                                struct sk_buff **pskb);
--                
--static struct ip_nat_helper h245 = 
--      { { NULL, NULL },
--          "H.245",                            /* name */
--        0,                                    /* flags */
--        NULL,                                 /* module */
--        { { 0, { 0 } },                       /* tuple */
--          { 0, { 0 }, IPPROTO_TCP } },
--        { { 0, { 0xFFFF } },                  /* mask */
--          { 0, { 0 }, 0xFFFF } },
--        h225_nat_help,                        /* helper */
--        h225_nat_expected                     /* expectfn */
--      };
--
--static unsigned int
--h225_nat_expected(struct sk_buff **pskb,
--                unsigned int hooknum,
--                struct ip_conntrack *ct,
--                struct ip_nat_info *info)
--{
--      struct ip_nat_multi_range mr;
--      u_int32_t newdstip, newsrcip, newip;
--      u_int16_t port;
--      struct ip_ct_h225_expect *exp_info;
--      struct ip_ct_h225_master *master_info;
--      struct ip_conntrack *master = master_ct(ct);
--      unsigned int is_h225, ret;
--      
--      IP_NF_ASSERT(info);
--      IP_NF_ASSERT(master);
--
--      IP_NF_ASSERT(!(info->initialized & (1<<HOOK2MANIP(hooknum))));
--
--      DEBUGP("h225_nat_expected: We have a connection!\n");
--      master_info = &ct->master->expectant->help.ct_h225_info;
--      exp_info = &ct->master->help.exp_h225_info;
--
--      LOCK_BH(&ip_h323_lock);
--
--      DEBUGP("master: ");
--      DUMP_TUPLE(&master->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
--      DUMP_TUPLE(&master->tuplehash[IP_CT_DIR_REPLY].tuple);
--      DEBUGP("conntrack: ");
--      DUMP_TUPLE(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
--      if (exp_info->dir == IP_CT_DIR_ORIGINAL) {
--              /* Make connection go to the client. */
--              newdstip = master->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.ip;
--              newsrcip = master->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.ip;
--              DEBUGP("h225_nat_expected: %u.%u.%u.%u->%u.%u.%u.%u (to client)\n",
--                     NIPQUAD(newsrcip), NIPQUAD(newdstip));
--      } else {
--              /* Make the connection go to the server */
--              newdstip = master->tuplehash[IP_CT_DIR_REPLY].tuple.src.ip;
--              newsrcip = master->tuplehash[IP_CT_DIR_REPLY].tuple.dst.ip;
--              DEBUGP("h225_nat_expected: %u.%u.%u.%u->%u.%u.%u.%u (to server)\n",
--                     NIPQUAD(newsrcip), NIPQUAD(newdstip));
--      }
--      port = exp_info->port;
--      is_h225 = master_info->is_h225 == H225_PORT;
--      UNLOCK_BH(&ip_h323_lock);
--      
--      if (HOOK2MANIP(hooknum) == IP_NAT_MANIP_SRC)
--              newip = newsrcip;
--      else
--              newip = newdstip;
--
--      DEBUGP("h225_nat_expected: IP to %u.%u.%u.%u\n", NIPQUAD(newip));
--
--      mr.rangesize = 1;
--      /* We don't want to manip the per-protocol, just the IPs... */
--      mr.range[0].flags = IP_NAT_RANGE_MAP_IPS;
--      mr.range[0].min_ip = mr.range[0].max_ip = newip;
--
--      /* ... unless we're doing a MANIP_DST, in which case, make
--         sure we map to the correct port */
--      if (HOOK2MANIP(hooknum) == IP_NAT_MANIP_DST) {
--              mr.range[0].flags |= IP_NAT_RANGE_PROTO_SPECIFIED;
--              mr.range[0].min = mr.range[0].max
--                      = ((union ip_conntrack_manip_proto)
--                              { port });
--      }
--
--      ret = ip_nat_setup_info(ct, &mr, hooknum);
--      
--      if (is_h225) {
--              DEBUGP("h225_nat_expected: H.225, setting NAT helper for %p\n", ct);
--              /* NAT expectfn called with ip_nat_lock write-locked */
--              info->helper = &h245;
--      }
--      return ret;
--}
--
--static int h323_signal_address_fixup(struct ip_conntrack *ct,
--                                   struct sk_buff **pskb,
--                                   enum ip_conntrack_info ctinfo)
--{
--      struct iphdr *iph = (*pskb)->nh.iph;
--      struct tcphdr *tcph = (void *)iph + iph->ihl*4;
--      unsigned char *data;
--      u_int32_t tcplen = (*pskb)->len - iph->ihl*4;
--      u_int32_t datalen = tcplen - tcph->doff*4;
--      struct ip_ct_h225_master *info = &ct->help.ct_h225_info; 
--      u_int32_t newip;
--      u_int16_t port;
--      u_int8_t buffer[6];
--      int i;
--
--      MUST_BE_LOCKED(&ip_h323_lock);
--
--      DEBUGP("h323_signal_address_fixup: %s %s\n",
--              between(info->seq[IP_CT_DIR_ORIGINAL], ntohl(tcph->seq), ntohl(tcph->seq) + datalen)
--                      ? "yes" : "no",
--              between(info->seq[IP_CT_DIR_REPLY], ntohl(tcph->seq), ntohl(tcph->seq) + datalen)
--                      ? "yes" : "no");
--      if (!(between(info->seq[IP_CT_DIR_ORIGINAL], ntohl(tcph->seq), ntohl(tcph->seq) + datalen)
--            || between(info->seq[IP_CT_DIR_REPLY], ntohl(tcph->seq), ntohl(tcph->seq) + datalen)))
--              return 1;
--
--      DEBUGP("h323_signal_address_fixup: offsets %u + 6  and %u + 6 in %u\n", 
--              info->offset[IP_CT_DIR_ORIGINAL], 
--              info->offset[IP_CT_DIR_REPLY],
--              tcplen);
--      DUMP_TUPLE(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
--      DUMP_TUPLE(&ct->tuplehash[IP_CT_DIR_REPLY].tuple);
--
--      for (i = 0; i < IP_CT_DIR_MAX; i++) {
--              DEBUGP("h323_signal_address_fixup: %s %s\n",
--                      info->dir == IP_CT_DIR_ORIGINAL ? "original" : "reply",
--                      i == IP_CT_DIR_ORIGINAL ? "caller" : "callee");
--              if (!between(info->seq[i], ntohl(tcph->seq), 
--                           ntohl(tcph->seq) + datalen))
--                      continue;
--              if (!between(info->seq[i] + 6, ntohl(tcph->seq),
--                           ntohl(tcph->seq) + datalen)) {
--                      /* Partial retransmisison. It's a cracker being funky. */
--                      if (net_ratelimit()) {
--                              printk("H.323_NAT: partial packet %u/6 in %u/%u\n",
--                                   info->seq[i],
--                                   ntohl(tcph->seq),
--                                   ntohl(tcph->seq) + datalen);
--                      }
--                      return 0;
--              }
--
--              /* Change address inside packet to match way we're mapping
--                 this connection. */
--              if (i == IP_CT_DIR_ORIGINAL) {
--                      newip = ct->tuplehash[!info->dir].tuple.dst.ip;
--                      port = ct->tuplehash[!info->dir].tuple.dst.u.tcp.port;
--              } else {
--                      newip = ct->tuplehash[!info->dir].tuple.src.ip;
--                      port = ct->tuplehash[!info->dir].tuple.src.u.tcp.port;
--              }
--
--              data = (char *) tcph + tcph->doff * 4 + info->offset[i];
--
--              DEBUGP("h323_signal_address_fixup: orig %s IP:port %u.%u.%u.%u:%u\n", 
--                      i == IP_CT_DIR_ORIGINAL ? "source" : "dest  ", 
--                      data[0], data[1], data[2], data[3],
--                      (data[4] << 8 | data[5]));
--
--              /* Modify the packet */
--              memcpy(buffer, &newip, 4);
--              memcpy(buffer + 4, &port, 2);
--              if (!ip_nat_mangle_tcp_packet(pskb, ct, ctinfo, info->offset[i],
--                                            6, buffer, 6))
--                      return 0;
--
--              DEBUGP("h323_signal_address_fixup:  new %s IP:port %u.%u.%u.%u:%u\n", 
--                      i == IP_CT_DIR_ORIGINAL ? "source" : "dest  ", 
--                      data[0], data[1], data[2], data[3],
--                      (data[4] << 8 | data[5]));
--      }
--
--      return 1;
--}
--
--static int h323_data_fixup(struct ip_ct_h225_expect *info,
--                         struct ip_conntrack *ct,
--                         struct sk_buff **pskb,
--                         enum ip_conntrack_info ctinfo,
--                         struct ip_conntrack_expect *expect)
--{
--      u_int32_t newip;
--      u_int16_t port;
--      u_int8_t buffer[6];
--      struct ip_conntrack_tuple newtuple;
--      struct iphdr *iph = (*pskb)->nh.iph;
--      struct tcphdr *tcph = (void *)iph + iph->ihl*4;
--      unsigned char *data;
--      u_int32_t tcplen = (*pskb)->len - iph->ihl*4;
--      struct ip_ct_h225_master *master_info = &ct->help.ct_h225_info;
--      int is_h225;
--
--      MUST_BE_LOCKED(&ip_h323_lock);
--      DEBUGP("h323_data_fixup: offset %u + 6 in %u\n", info->offset, tcplen);
--      DUMP_TUPLE(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
--      DUMP_TUPLE(&ct->tuplehash[IP_CT_DIR_REPLY].tuple);
--
--      if (!between(expect->seq + 6, ntohl(tcph->seq),
--                  ntohl(tcph->seq) + tcplen - tcph->doff * 4)) {
--              /* Partial retransmisison. It's a cracker being funky. */
--              if (net_ratelimit()) {
--                      printk("H.323_NAT: partial packet %u/6 in %u/%u\n",
--                           expect->seq,
--                           ntohl(tcph->seq),
--                           ntohl(tcph->seq) + tcplen - tcph->doff * 4);
--              }
--              return 0;
--      }
--
--      /* Change address inside packet to match way we're mapping
--         this connection. */
--      if (info->dir == IP_CT_DIR_REPLY) {
--              /* Must be where client thinks server is */
--              newip = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.ip;
--              /* Expect something from client->server */
--              newtuple.src.ip = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.ip;
--              newtuple.dst.ip = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.ip;
--      } else {
--              /* Must be where server thinks client is */
--              newip = ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.ip;
--              /* Expect something from server->client */
--              newtuple.src.ip = ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.ip;
--              newtuple.dst.ip = ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.ip;
--      }
--
--      is_h225 = (master_info->is_h225 == H225_PORT);
--
--      if (is_h225) {
--              newtuple.dst.protonum = IPPROTO_TCP;
--              newtuple.src.u.tcp.port = expect->tuple.src.u.tcp.port;
--      } else {
--              newtuple.dst.protonum = IPPROTO_UDP;
--              newtuple.src.u.udp.port = expect->tuple.src.u.udp.port;
--      }
--      
--      /* Try to get same port: if not, try to change it. */
--      for (port = ntohs(info->port); port != 0; port++) {
--              if (is_h225)
--                      newtuple.dst.u.tcp.port = htons(port);
--              else
--                      newtuple.dst.u.udp.port = htons(port);
--
--              if (ip_conntrack_change_expect(expect, &newtuple) == 0)
--                      break;
--      }
--      if (port == 0) {
--              DEBUGP("h323_data_fixup: no free port found!\n");
--              return 0;
--      }
--
--      port = htons(port);
--
--      data = (char *) tcph + tcph->doff * 4 + info->offset;
--
--      DEBUGP("h323_data_fixup: orig IP:port %u.%u.%u.%u:%u\n", 
--              data[0], data[1], data[2], data[3],
--              (data[4] << 8 | data[5]));
--
--      /* Modify the packet */
--      memcpy(buffer, &newip, 4);
--      memcpy(buffer + 4, &port, 2);
--      if (!ip_nat_mangle_tcp_packet(pskb, ct, ctinfo, info->offset,
--                                    6, buffer, 6))
--              return 0;
--      
--      DEBUGP("h323_data_fixup: new IP:port %u.%u.%u.%u:%u\n", 
--              data[0], data[1], data[2], data[3],
--              (data[4] << 8 | data[5]));
--
--      return 1;
--}
--
--static unsigned int h225_nat_help(struct ip_conntrack *ct,
--                                struct ip_conntrack_expect *exp,
--                                struct ip_nat_info *info,
--                                enum ip_conntrack_info ctinfo,
--                                unsigned int hooknum,
--                                struct sk_buff **pskb)
--{
--      int dir;
--      struct ip_ct_h225_expect *exp_info;
--      
--      /* Only mangle things once: original direction in POST_ROUTING
--         and reply direction on PRE_ROUTING. */
--      dir = CTINFO2DIR(ctinfo);
--      DEBUGP("nat_h323: dir %s at hook %s\n",
--             dir == IP_CT_DIR_ORIGINAL ? "ORIG" : "REPLY",
--             hooknum == NF_IP_POST_ROUTING ? "POSTROUTING"
--             : hooknum == NF_IP_PRE_ROUTING ? "PREROUTING"
--             : hooknum == NF_IP_LOCAL_OUT ? "OUTPUT" : "???");
--      if (!((hooknum == NF_IP_POST_ROUTING && dir == IP_CT_DIR_ORIGINAL)
--            || (hooknum == NF_IP_PRE_ROUTING && dir == IP_CT_DIR_REPLY))) {
--              DEBUGP("nat_h323: Not touching dir %s at hook %s\n",
--                     dir == IP_CT_DIR_ORIGINAL ? "ORIG" : "REPLY",
--                     hooknum == NF_IP_POST_ROUTING ? "POSTROUTING"
--                     : hooknum == NF_IP_PRE_ROUTING ? "PREROUTING"
--                     : hooknum == NF_IP_LOCAL_OUT ? "OUTPUT" : "???");
--              return NF_ACCEPT;
--      }
--
--      if (!exp) {
--              LOCK_BH(&ip_h323_lock);
--              if (!h323_signal_address_fixup(ct, pskb, ctinfo)) {
--                      UNLOCK_BH(&ip_h323_lock);
--                      return NF_DROP;
--              }
--              UNLOCK_BH(&ip_h323_lock);
--              return NF_ACCEPT;
--      }
--              
--      exp_info = &exp->help.exp_h225_info;
--
--      LOCK_BH(&ip_h323_lock);
--      if (!h323_data_fixup(exp_info, ct, pskb, ctinfo, exp)) {
--              UNLOCK_BH(&ip_h323_lock);
--              return NF_DROP;
--      }
--      UNLOCK_BH(&ip_h323_lock);
--
--      return NF_ACCEPT;
--}
--
--static struct ip_nat_helper h225 = 
--      { { NULL, NULL },
--        "H.225",                                      /* name */
--        IP_NAT_HELPER_F_ALWAYS,                       /* flags */
--        THIS_MODULE,                                  /* module */
--        { { 0, { __constant_htons(H225_PORT) } },     /* tuple */
--          { 0, { 0 }, IPPROTO_TCP } },
--        { { 0, { 0xFFFF } },                          /* mask */
--          { 0, { 0 }, 0xFFFF } },
--        h225_nat_help,                                /* helper */
--        h225_nat_expected                             /* expectfn */
--      };
--
--static int __init init(void)
--{
--      int ret;
--      
--      ret = ip_nat_helper_register(&h225);
--
--      if (ret != 0)
--              printk("ip_nat_h323: cannot initialize the module!\n");
--
--      return ret;
--}
--
--static void __exit fini(void)
--{
--      ip_nat_helper_unregister(&h225);
--}
--
--module_init(init);
--module_exit(fini);
-diff -Nurb linux/net/ipv4/netfilter/ip_nat_helper.c linux.stock/net/ipv4/netfilter/ip_nat_helper.c
---- linux/net/ipv4/netfilter/ip_nat_helper.c   2003-07-04 04:12:31.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ip_nat_helper.c     2004-05-09 04:13:03.000000000 -0400
-@@ -8,9 +8,6 @@
-  *            - add support for SACK adjustment 
-  *    14 Mar 2002 Harald Welte <laforge@gnumonks.org>:
-  *            - merge SACK support into newnat API
-- *    16 Aug 2002 Brian J. Murrell <netfilter@interlinx.bc.ca>:
-- *            - make ip_nat_resize_packet more generic (TCP and UDP)
-- *            - add ip_nat_mangle_udp_packet
-  */
- #include <linux/version.h>
- #include <linux/config.h>
-@@ -25,7 +22,6 @@
- #include <net/icmp.h>
- #include <net/ip.h>
- #include <net/tcp.h>
--#include <net/udp.h>
- #define ASSERT_READ_LOCK(x) MUST_BE_READ_LOCKED(&ip_nat_lock)
- #define ASSERT_WRITE_LOCK(x) MUST_BE_WRITE_LOCKED(&ip_nat_lock)
-@@ -38,8 +34,13 @@
- #include <linux/netfilter_ipv4/ip_nat_helper.h>
- #include <linux/netfilter_ipv4/listhelp.h>
-+#if 0
-+#define DEBUGP printk
-+#define DUMP_OFFSET(x)        printk("offset_before=%d, offset_after=%d, correction_pos=%u\n", x->offset_before, x->offset_after, x->correction_pos);
-+#else
- #define DEBUGP(format, args...)
- #define DUMP_OFFSET(x)
-+#endif
- DECLARE_LOCK(ip_nat_seqofs_lock);
-                        
-@@ -50,12 +51,18 @@
-                    int new_size)
- {
-       struct iphdr *iph;
-+      struct tcphdr *tcph;
-+      void *data;
-       int dir;
-       struct ip_nat_seq *this_way, *other_way;
-       DEBUGP("ip_nat_resize_packet: old_size = %u, new_size = %u\n",
-               (*skb)->len, new_size);
-+      iph = (*skb)->nh.iph;
-+      tcph = (void *)iph + iph->ihl*4;
-+      data = (void *)tcph + tcph->doff*4;
-+
-       dir = CTINFO2DIR(ctinfo);
-       this_way = &ct->nat.info.seq[dir];
-@@ -77,9 +84,8 @@
-       }
-       iph = (*skb)->nh.iph;
--      if (iph->protocol == IPPROTO_TCP) {
--              struct tcphdr *tcph = (void *)iph + iph->ihl*4;
--              void *data = (void *)tcph + tcph->doff*4;
-+      tcph = (void *)iph + iph->ihl*4;
-+      data = (void *)tcph + tcph->doff*4;
-               DEBUGP("ip_nat_resize_packet: Seq_offset before: ");
-               DUMP_OFFSET(this_way);
-@@ -95,20 +101,25 @@
-                       this_way->correction_pos = ntohl(tcph->seq);
-                       this_way->offset_before = this_way->offset_after;
-                       this_way->offset_after = (int32_t)
--                              this_way->offset_before + new_size -
--                              (*skb)->len;
-+                      this_way->offset_before + new_size - (*skb)->len;
-               }
-               UNLOCK_BH(&ip_nat_seqofs_lock);
-               DEBUGP("ip_nat_resize_packet: Seq_offset after: ");
-               DUMP_OFFSET(this_way);
--      }
-       
-       return 1;
- }
-+/* Generic function for mangling variable-length address changes inside
-+ * NATed connections (like the PORT XXX,XXX,XXX,XXX,XXX,XXX command in FTP).
-+ *
-+ * Takes care about all the nasty sequence number changes, checksumming,
-+ * skb enlargement, ...
-+ *
-+ * */
- int 
- ip_nat_mangle_tcp_packet(struct sk_buff **skb,
-                        struct ip_conntrack *ct,
-@@ -163,7 +174,6 @@
-       tcph = (void *)iph + iph->ihl*4;
-       data = (void *)tcph + tcph->doff*4;
--      if (rep_len != match_len)
-               /* move post-replacement */
-               memmove(data + match_offset + rep_len,
-                       data + match_offset + match_len,
-@@ -198,104 +208,6 @@
-       return 1;
- }
-                       
--int 
--ip_nat_mangle_udp_packet(struct sk_buff **skb,
--                       struct ip_conntrack *ct,
--                       enum ip_conntrack_info ctinfo,
--                       unsigned int match_offset,
--                       unsigned int match_len,
--                       char *rep_buffer,
--                       unsigned int rep_len)
--{
--      struct iphdr *iph = (*skb)->nh.iph;
--      struct udphdr *udph = (void *)iph + iph->ihl * 4;
--      unsigned char *data;
--      u_int32_t udplen, newlen, newudplen;
--
--      udplen = (*skb)->len - iph->ihl*4;
--      newudplen = udplen - match_len + rep_len;
--      newlen = iph->ihl*4 + newudplen;
--
--      if (newlen > 65535) {
--              if (net_ratelimit())
--                      printk("ip_nat_mangle_udp_packet: nat'ed packet "
--                              "exceeds maximum packet size\n");
--              return 0;
--      }
--
--      if ((*skb)->len != newlen) {
--              if (!ip_nat_resize_packet(skb, ct, ctinfo, newlen)) {
--                      printk("resize_packet failed!!\n");
--                      return 0;
--              }
--      }
--
--      /* Alexey says: if a hook changes _data_ ... it can break
--         original packet sitting in tcp queue and this is fatal */
--      if (skb_cloned(*skb)) {
--              struct sk_buff *nskb = skb_copy(*skb, GFP_ATOMIC);
--              if (!nskb) {
--                      if (net_ratelimit())
--                              printk("Out of memory cloning TCP packet\n");
--                      return 0;
--              }
--              /* Rest of kernel will get very unhappy if we pass it
--                 a suddenly-orphaned skbuff */
--              if ((*skb)->sk)
--                      skb_set_owner_w(nskb, (*skb)->sk);
--              kfree_skb(*skb);
--              *skb = nskb;
--      }
--
--      /* skb may be copied !! */
--      iph = (*skb)->nh.iph;
--      udph = (void *)iph + iph->ihl*4;
--      data = (void *)udph + sizeof(struct udphdr);
--
--      if (rep_len != match_len)
--              /* move post-replacement */
--              memmove(data + match_offset + rep_len,
--                      data + match_offset + match_len,
--                      (*skb)->tail - (data + match_offset + match_len));
--
--      /* insert data from buffer */
--      memcpy(data + match_offset, rep_buffer, rep_len);
--
--      /* update skb info */
--      if (newlen > (*skb)->len) {
--              DEBUGP("ip_nat_mangle_udp_packet: Extending packet by "
--                      "%u to %u bytes\n", newlen - (*skb)->len, newlen);
--              skb_put(*skb, newlen - (*skb)->len);
--      } else {
--              DEBUGP("ip_nat_mangle_udp_packet: Shrinking packet from "
--                      "%u to %u bytes\n", (*skb)->len, newlen);
--              skb_trim(*skb, newlen);
--      }
--
--      /* update the length of the UDP and IP packets to the new values*/
--      udph->len = htons((*skb)->len - iph->ihl*4);
--      iph->tot_len = htons(newlen);
--
--      /* fix udp checksum if udp checksum was previously calculated */
--      if ((*skb)->csum != 0) {
--              (*skb)->csum = csum_partial((char *)udph +
--                                          sizeof(struct udphdr),
--                                          newudplen - sizeof(struct udphdr),
--                                          0);
--
--              udph->check = 0;
--              udph->check = csum_tcpudp_magic(iph->saddr, iph->daddr,
--                                              newudplen, IPPROTO_UDP,
--                                              csum_partial((char *)udph,
--                                                       sizeof(struct udphdr),
--                                                      (*skb)->csum));
--      }
--
--      ip_send_check(iph);
--
--      return 1;
--}
--
- /* Adjust one found SACK option including checksum correction */
- static void
- sack_adjust(struct tcphdr *tcph, 
-diff -Nurb linux/net/ipv4/netfilter/ip_nat_mms.c linux.stock/net/ipv4/netfilter/ip_nat_mms.c
---- linux/net/ipv4/netfilter/ip_nat_mms.c      2003-07-04 04:12:31.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ip_nat_mms.c        1969-12-31 19:00:00.000000000 -0500
-@@ -1,330 +0,0 @@
--/* MMS extension for TCP NAT alteration.
-- * (C) 2002 by Filip Sneppe <filip.sneppe@cronos.be>
-- * based on ip_nat_ftp.c and ip_nat_irc.c
-- *
-- * ip_nat_mms.c v0.3 2002-09-22
-- *
-- *      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, or (at your option) any later version.
-- *
-- *      Module load syntax:
-- *      insmod ip_nat_mms.o ports=port1,port2,...port<MAX_PORTS>
-- *
-- *      Please give the ports of all MMS servers You wish to connect to.
-- *      If you don't specify ports, the default will be TCP port 1755.
-- *
-- *      More info on MMS protocol, firewalls and NAT:
-- *      http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwmt/html/MMSFirewall.asp
-- *      http://www.microsoft.com/windows/windowsmedia/serve/firewall.asp
-- *
-- *      The SDP project people are reverse-engineering MMS:
-- *      http://get.to/sdp
-- */
--
--
--#include <linux/module.h>
--#include <linux/netfilter_ipv4.h>
--#include <linux/ip.h>
--#include <linux/tcp.h>
--#include <net/tcp.h>
--#include <linux/netfilter_ipv4/ip_nat.h>
--#include <linux/netfilter_ipv4/ip_nat_helper.h>
--#include <linux/netfilter_ipv4/ip_nat_rule.h>
--#include <linux/netfilter_ipv4/ip_conntrack_mms.h>
--#include <linux/netfilter_ipv4/ip_conntrack_helper.h>
--
--#define DEBUGP(format, args...)
--#define DUMP_BYTES(address, counter)
--
--#define MAX_PORTS 8
--static int ports[MAX_PORTS];
--static int ports_c = 0;
--
--#ifdef MODULE_PARM
--MODULE_PARM(ports, "1-" __MODULE_STRING(MAX_PORTS) "i");
--#endif
--
--MODULE_AUTHOR("Filip Sneppe <filip.sneppe@cronos.be>");
--MODULE_DESCRIPTION("Microsoft Windows Media Services (MMS) NAT module");
--MODULE_LICENSE("GPL");
--
--DECLARE_LOCK_EXTERN(ip_mms_lock);
--
--
--static int mms_data_fixup(const struct ip_ct_mms_expect *ct_mms_info,
--                          struct ip_conntrack *ct,
--                          struct sk_buff **pskb,
--                          enum ip_conntrack_info ctinfo,
--                          struct ip_conntrack_expect *expect)
--{
--      u_int32_t newip;
--      struct ip_conntrack_tuple t;
--      struct iphdr *iph = (*pskb)->nh.iph;
--      struct tcphdr *tcph = (void *) iph + iph->ihl * 4;
--      char *data = (char *)tcph + tcph->doff * 4;
--      int i, j, k, port;
--      u_int16_t mms_proto;
--
--      u_int32_t *mms_chunkLenLV    = (u_int32_t *)(data + MMS_SRV_CHUNKLENLV_OFFSET);
--      u_int32_t *mms_chunkLenLM    = (u_int32_t *)(data + MMS_SRV_CHUNKLENLM_OFFSET);
--      u_int32_t *mms_messageLength = (u_int32_t *)(data + MMS_SRV_MESSAGELENGTH_OFFSET);
--
--      int zero_padding;
--
--      char buffer[28];         /* "\\255.255.255.255\UDP\65635" * 2 (for unicode) */
--      char unicode_buffer[75]; /* 27*2 (unicode) + 20 + 1 */
--      char proto_string[6];
--      
--      MUST_BE_LOCKED(&ip_mms_lock);
--
--      /* what was the protocol again ? */
--      mms_proto = expect->tuple.dst.protonum;
--      sprintf(proto_string, "%u", mms_proto);
--      
--      DEBUGP("ip_nat_mms: mms_data_fixup: info (seq %u + %u) in %u, proto %s\n",
--             expect->seq, ct_mms_info->len, ntohl(tcph->seq),
--             mms_proto == IPPROTO_UDP ? "UDP"
--             : mms_proto == IPPROTO_TCP ? "TCP":proto_string);
--      
--      newip = ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.ip;
--
--      /* Alter conntrack's expectations. */
--      t = expect->tuple;
--      t.dst.ip = newip;
--      for (port = ct_mms_info->port; port != 0; port++) {
--              t.dst.u.tcp.port = htons(port);
--              if (ip_conntrack_change_expect(expect, &t) == 0) {
--                      DEBUGP("ip_nat_mms: mms_data_fixup: using port %d\n", port);
--                      break;
--              }
--      }
--      
--      if(port == 0)
--              return 0;
--
--      sprintf(buffer, "\\\\%u.%u.%u.%u\\%s\\%u",
--              NIPQUAD(newip),
--              expect->tuple.dst.protonum == IPPROTO_UDP ? "UDP"
--              : expect->tuple.dst.protonum == IPPROTO_TCP ? "TCP":proto_string,
--              port);
--      DEBUGP("ip_nat_mms: new unicode string=%s\n", buffer);
--      
--      memset(unicode_buffer, 0, sizeof(char)*75);
--
--      for (i=0; i<strlen(buffer); ++i)
--              *(unicode_buffer+i*2)=*(buffer+i);
--      
--      DEBUGP("ip_nat_mms: mms_data_fixup: padding: %u len: %u\n", ct_mms_info->padding, ct_mms_info->len);
--      DEBUGP("ip_nat_mms: mms_data_fixup: offset: %u\n", MMS_SRV_UNICODE_STRING_OFFSET+ct_mms_info->len);
--      DUMP_BYTES(data+MMS_SRV_UNICODE_STRING_OFFSET, 60);
--      
--      /* add end of packet to it */
--      for (j=0; j<ct_mms_info->padding; ++j) {
--              DEBUGP("ip_nat_mms: mms_data_fixup: i=%u j=%u byte=%u\n", 
--                     i, j, (u8)*(data+MMS_SRV_UNICODE_STRING_OFFSET+ct_mms_info->len+j));
--              *(unicode_buffer+i*2+j) = *(data+MMS_SRV_UNICODE_STRING_OFFSET+ct_mms_info->len+j);
--      }
--
--      /* pad with zeroes at the end ? see explanation of weird math below */
--      zero_padding = (8-(strlen(buffer)*2 + ct_mms_info->padding + 4)%8)%8;
--      for (k=0; k<zero_padding; ++k)
--              *(unicode_buffer+i*2+j+k)= (char)0;
--      
--      DEBUGP("ip_nat_mms: mms_data_fixup: zero_padding = %u\n", zero_padding);
--      DEBUGP("ip_nat_mms: original=> chunkLenLV=%u chunkLenLM=%u messageLength=%u\n",
--             *mms_chunkLenLV, *mms_chunkLenLM, *mms_messageLength);
--      
--      /* explanation, before I forget what I did:
--         strlen(buffer)*2 + ct_mms_info->padding + 4 must be divisable by 8;
--         divide by 8 and add 3 to compute the mms_chunkLenLM field,
--         but note that things may have to be padded with zeroes to align by 8 
--         bytes, hence we add 7 and divide by 8 to get the correct length */ 
--      *mms_chunkLenLM    = (u_int32_t) (3+(strlen(buffer)*2+ct_mms_info->padding+11)/8);
--      *mms_chunkLenLV    = *mms_chunkLenLM+2;
--      *mms_messageLength = *mms_chunkLenLV*8;
--      
--      DEBUGP("ip_nat_mms: modified=> chunkLenLV=%u chunkLenLM=%u messageLength=%u\n",
--             *mms_chunkLenLV, *mms_chunkLenLM, *mms_messageLength);
--      
--      ip_nat_mangle_tcp_packet(pskb, ct, ctinfo, 
--                               expect->seq - ntohl(tcph->seq),
--                               ct_mms_info->len + ct_mms_info->padding, unicode_buffer,
--                               strlen(buffer)*2 + ct_mms_info->padding + zero_padding);
--      DUMP_BYTES(unicode_buffer, 60);
--      
--      return 1;
--}
--
--static unsigned int
--mms_nat_expected(struct sk_buff **pskb,
--                 unsigned int hooknum,
--                 struct ip_conntrack *ct,
--                 struct ip_nat_info *info)
--{
--      struct ip_nat_multi_range mr;
--      u_int32_t newdstip, newsrcip, newip;
--
--      struct ip_conntrack *master = master_ct(ct);
--
--      IP_NF_ASSERT(info);
--      IP_NF_ASSERT(master);
--
--      IP_NF_ASSERT(!(info->initialized & (1 << HOOK2MANIP(hooknum))));
--
--      DEBUGP("ip_nat_mms: mms_nat_expected: We have a connection!\n");
--
--      newdstip = master->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.ip;
--      newsrcip = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.ip;
--      DEBUGP("ip_nat_mms: mms_nat_expected: hook %s: newsrc->newdst %u.%u.%u.%u->%u.%u.%u.%u\n",
--             hooknum == NF_IP_POST_ROUTING ? "POSTROUTING"
--             : hooknum == NF_IP_PRE_ROUTING ? "PREROUTING"
--             : hooknum == NF_IP_LOCAL_OUT ? "OUTPUT" : "???",
--             NIPQUAD(newsrcip), NIPQUAD(newdstip));
--
--      if (HOOK2MANIP(hooknum) == IP_NAT_MANIP_SRC)
--              newip = newsrcip;
--      else
--              newip = newdstip;
--
--      DEBUGP("ip_nat_mms: mms_nat_expected: IP to %u.%u.%u.%u\n", NIPQUAD(newip));
--
--      mr.rangesize = 1;
--      /* We don't want to manip the per-protocol, just the IPs. */
--      mr.range[0].flags = IP_NAT_RANGE_MAP_IPS;
--      mr.range[0].min_ip = mr.range[0].max_ip = newip;
--
--      return ip_nat_setup_info(ct, &mr, hooknum);
--}
--
--
--static unsigned int mms_nat_help(struct ip_conntrack *ct,
--                       struct ip_conntrack_expect *exp,
--                       struct ip_nat_info *info,
--                       enum ip_conntrack_info ctinfo,
--                       unsigned int hooknum,
--                       struct sk_buff **pskb)
--{
--      struct iphdr *iph = (*pskb)->nh.iph;
--      struct tcphdr *tcph = (void *) iph + iph->ihl * 4;
--      unsigned int datalen;
--      int dir;
--      struct ip_ct_mms_expect *ct_mms_info;
--
--      if (!exp)
--              DEBUGP("ip_nat_mms: no exp!!");
--
--      ct_mms_info = &exp->help.exp_mms_info;
--      
--      /* Only mangle things once: original direction in POST_ROUTING
--         and reply direction on PRE_ROUTING. */
--      dir = CTINFO2DIR(ctinfo);
--      if (!((hooknum == NF_IP_POST_ROUTING && dir == IP_CT_DIR_ORIGINAL)
--          ||(hooknum == NF_IP_PRE_ROUTING && dir == IP_CT_DIR_REPLY))) {
--              DEBUGP("ip_nat_mms: mms_nat_help: not touching dir %s at hook %s\n",
--                     dir == IP_CT_DIR_ORIGINAL ? "ORIG" : "REPLY",
--                     hooknum == NF_IP_POST_ROUTING ? "POSTROUTING"
--                     : hooknum == NF_IP_PRE_ROUTING ? "PREROUTING"
--                     : hooknum == NF_IP_LOCAL_OUT ? "OUTPUT" : "???");
--              return NF_ACCEPT;
--      }
--      DEBUGP("ip_nat_mms: mms_nat_help: beyond not touching (dir %s at hook %s)\n",
--             dir == IP_CT_DIR_ORIGINAL ? "ORIG" : "REPLY",
--             hooknum == NF_IP_POST_ROUTING ? "POSTROUTING"
--             : hooknum == NF_IP_PRE_ROUTING ? "PREROUTING"
--             : hooknum == NF_IP_LOCAL_OUT ? "OUTPUT" : "???");
--      
--      datalen = (*pskb)->len - iph->ihl * 4 - tcph->doff * 4;
--      
--      DEBUGP("ip_nat_mms: mms_nat_help: %u+%u=%u %u %u\n", exp->seq, ct_mms_info->len,
--             exp->seq + ct_mms_info->len,
--             ntohl(tcph->seq),
--             ntohl(tcph->seq) + datalen);
--      
--      LOCK_BH(&ip_mms_lock);
--      /* Check wether the whole IP/proto/port pattern is carried in the payload */
--      if (between(exp->seq + ct_mms_info->len,
--          ntohl(tcph->seq),
--          ntohl(tcph->seq) + datalen)) {
--              if (!mms_data_fixup(ct_mms_info, ct, pskb, ctinfo, exp)) {
--                      UNLOCK_BH(&ip_mms_lock);
--                      return NF_DROP;
--              }
--      } else {
--              /* Half a match?  This means a partial retransmisison.
--                 It's a cracker being funky. */
--              if (net_ratelimit()) {
--                      printk("ip_nat_mms: partial packet %u/%u in %u/%u\n",
--                             exp->seq, ct_mms_info->len,
--                             ntohl(tcph->seq),
--                             ntohl(tcph->seq) + datalen);
--              }
--              UNLOCK_BH(&ip_mms_lock);
--              return NF_DROP;
--      }
--      UNLOCK_BH(&ip_mms_lock);
--      
--      return NF_ACCEPT;
--}
--
--static struct ip_nat_helper mms[MAX_PORTS];
--static char mms_names[MAX_PORTS][10];
--
--/* Not __exit: called from init() */
--static void fini(void)
--{
--      int i;
--
--      for (i = 0; (i < MAX_PORTS) && ports[i]; i++) {
--              DEBUGP("ip_nat_mms: unregistering helper for port %d\n", ports[i]);
--              ip_nat_helper_unregister(&mms[i]);
--      }
--}
--
--static int __init init(void)
--{
--      int i, ret = 0;
--      char *tmpname;
--
--      if (ports[0] == 0)
--              ports[0] = MMS_PORT;
--
--      for (i = 0; (i < MAX_PORTS) && ports[i]; i++) {
--
--              memset(&mms[i], 0, sizeof(struct ip_nat_helper));
--
--              mms[i].tuple.dst.protonum = IPPROTO_TCP;
--              mms[i].tuple.src.u.tcp.port = htons(ports[i]);
--              mms[i].mask.dst.protonum = 0xFFFF;
--              mms[i].mask.src.u.tcp.port = 0xFFFF;
--              mms[i].help = mms_nat_help;
--              mms[i].me = THIS_MODULE;
--              mms[i].flags = 0;
--              mms[i].expect = mms_nat_expected;
--
--              tmpname = &mms_names[i][0];
--              if (ports[i] == MMS_PORT)
--                      sprintf(tmpname, "mms");
--              else
--                      sprintf(tmpname, "mms-%d", i);
--              mms[i].name = tmpname;
--
--              DEBUGP("ip_nat_mms: register helper for port %d\n",
--                              ports[i]);
--              ret = ip_nat_helper_register(&mms[i]);
--
--              if (ret) {
--                      printk("ip_nat_mms: error registering "
--                             "helper for port %d\n", ports[i]);
--                      fini();
--                      return ret;
--              }
--              ports_c++;
--      }
--
--      return ret;
--}
--
--module_init(init);
--module_exit(fini);
-diff -Nurb linux/net/ipv4/netfilter/ip_nat_pptp.c linux.stock/net/ipv4/netfilter/ip_nat_pptp.c
---- linux/net/ipv4/netfilter/ip_nat_pptp.c     2003-07-04 04:12:31.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ip_nat_pptp.c       1969-12-31 19:00:00.000000000 -0500
-@@ -1,412 +0,0 @@
--/*
-- * ip_nat_pptp.c      - Version 1.11
-- *
-- * NAT support for PPTP (Point to Point Tunneling Protocol).
-- * PPTP is a a protocol for creating virtual private networks.
-- * It is a specification defined by Microsoft and some vendors
-- * working with Microsoft.  PPTP is built on top of a modified
-- * version of the Internet Generic Routing Encapsulation Protocol.
-- * GRE is defined in RFC 1701 and RFC 1702.  Documentation of
-- * PPTP can be found in RFC 2637
-- *
-- * (C) 2000-2002 by Harald Welte <laforge@gnumonks.org>
-- *
-- * Development of this code funded by Astaro AG (http://www.astaro.com/)
-- *
-- * TODO: - Support for multiple calls within one session
-- *       (needs netfilter newnat code)
-- *     - NAT to a unique tuple, not to TCP source port
-- *       (needs netfilter tuple reservation)
-- *     - Support other NAT scenarios than SNAT of PNS
-- * 
-- */
--
--#include <linux/config.h>
--#include <linux/module.h>
--#include <linux/ip.h>
--#include <linux/tcp.h>
--#include <net/tcp.h>
--#include <linux/netfilter_ipv4/ip_nat.h>
--#include <linux/netfilter_ipv4/ip_nat_rule.h>
--#include <linux/netfilter_ipv4/ip_nat_helper.h>
--#include <linux/netfilter_ipv4/ip_nat_pptp.h>
--#include <linux/netfilter_ipv4/ip_conntrack_helper.h>
--#include <linux/netfilter_ipv4/ip_conntrack_proto_gre.h>
--#include <linux/netfilter_ipv4/ip_conntrack_pptp.h>
--
--MODULE_LICENSE("GPL");
--MODULE_AUTHOR("Harald Welte <laforge@gnumonks.org>");
--MODULE_DESCRIPTION("Netfilter NAT helper module for PPTP");
--
--
--#define DEBUGP(format, args...)
--
--static unsigned int
--pptp_nat_expected(struct sk_buff **pskb,
--                unsigned int hooknum,
--                struct ip_conntrack *ct,
--                struct ip_nat_info *info)
--{
--      struct ip_conntrack *master = master_ct(ct);
--      struct ip_nat_multi_range mr;
--      struct ip_ct_pptp_master *ct_pptp_info;
--      struct ip_nat_pptp *nat_pptp_info;
--      u_int32_t newsrcip, newdstip, newcid;
--      int ret;
--
--      IP_NF_ASSERT(info);
--      IP_NF_ASSERT(master);
--      IP_NF_ASSERT(!(info->initialized & (1 << HOOK2MANIP(hooknum))));
--
--      DEBUGP("we have a connection!\n");
--
--      LOCK_BH(&ip_pptp_lock);
--      ct_pptp_info = &master->help.ct_pptp_info;
--      nat_pptp_info = &master->nat.help.nat_pptp_info;
--
--      /* need to alter GRE tuple because conntrack expectfn() used 'wrong'
--       * (unmanipulated) values */
--      if (hooknum == NF_IP_PRE_ROUTING) {
--              DEBUGP("completing tuples with NAT info \n");
--              /* we can do this, since we're unconfirmed */
--              if (ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u.gre.key ==
--                      htonl(ct_pptp_info->pac_call_id)) {     
--                      /* assume PNS->PAC */
--                      ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u.gre.key =
--                              htonl(nat_pptp_info->pns_call_id);
--//                    ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u.gre.key =
--//                            htonl(nat_pptp_info->pac_call_id);
--                      ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u.gre.key =
--                              htonl(nat_pptp_info->pns_call_id);
--              } else {
--                      /* assume PAC->PNS */
--                      DEBUGP("WRONG DIRECTION\n");
--                      ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u.gre.key =
--                              htonl(nat_pptp_info->pac_call_id);
--                      ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u.gre.key =
--                              htonl(nat_pptp_info->pns_call_id);
--              }
--      }
--
--      if (HOOK2MANIP(hooknum) == IP_NAT_MANIP_DST) {
--              newdstip = master->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.ip;
--              newcid = htonl(master->nat.help.nat_pptp_info.pac_call_id);
--
--              mr.rangesize = 1;
--              mr.range[0].flags = IP_NAT_RANGE_MAP_IPS | IP_NAT_RANGE_PROTO_SPECIFIED;
--              mr.range[0].min_ip = mr.range[0].max_ip = newdstip;
--              mr.range[0].min = mr.range[0].max = 
--                      ((union ip_conntrack_manip_proto ) { newcid }); 
--              DEBUGP("change dest ip to %u.%u.%u.%u\n", 
--                      NIPQUAD(newdstip));
--              DEBUGP("change dest key to 0x%x\n", ntohl(newcid));
--              ret = ip_nat_setup_info(ct, &mr, hooknum);
--      } else {
--              newsrcip = master->tuplehash[IP_CT_DIR_REPLY].tuple.dst.ip;
--              /* nat_multi_range is in network byte order, and GRE tuple
--               * is 32 bits, not 16 like callID */
--              newcid = htonl(master->help.ct_pptp_info.pns_call_id);
--
--              mr.rangesize = 1;
--              mr.range[0].flags = IP_NAT_RANGE_MAP_IPS
--                                  |IP_NAT_RANGE_PROTO_SPECIFIED;
--              mr.range[0].min_ip = mr.range[0].max_ip = newsrcip;
--              mr.range[0].min = mr.range[0].max = 
--                      ((union ip_conntrack_manip_proto ) { newcid });
--              DEBUGP("change src ip to %u.%u.%u.%u\n", 
--                      NIPQUAD(newsrcip));
--              DEBUGP("change 'src' key to 0x%x\n", ntohl(newcid));
--              ret = ip_nat_setup_info(ct, &mr, hooknum);
--      }
--
--      UNLOCK_BH(&ip_pptp_lock);
--
--      return ret;
--
--}
--
--/* outbound packets == from PNS to PAC */
--static inline unsigned int
--pptp_outbound_pkt(struct tcphdr *tcph, struct pptp_pkt_hdr *pptph,
--                size_t datalen,
--                struct ip_conntrack *ct,
--                enum ip_conntrack_info ctinfo,
--                struct ip_conntrack_expect *exp)
--
--{
--      struct PptpControlHeader *ctlh;
--      union pptp_ctrl_union pptpReq;
--      struct ip_ct_pptp_master *ct_pptp_info = &ct->help.ct_pptp_info;
--      struct ip_nat_pptp *nat_pptp_info = &ct->nat.help.nat_pptp_info;
--
--      u_int16_t msg, *cid = NULL, new_callid;
--
--      ctlh = (struct PptpControlHeader *) ((void *) pptph + sizeof(*pptph));
--      pptpReq.rawreq = (void *) ((void *) ctlh + sizeof(*ctlh));
--
--      new_callid = htons(ct_pptp_info->pns_call_id);
--      
--      switch (msg = ntohs(ctlh->messageType)) {
--              case PPTP_OUT_CALL_REQUEST:
--                      cid = &pptpReq.ocreq->callID;
--
--                      /* save original call ID in nat_info */
--                      nat_pptp_info->pns_call_id = ct_pptp_info->pns_call_id;
--
--                      new_callid = tcph->source;
--                      /* save new call ID in ct info */
--                      ct_pptp_info->pns_call_id = ntohs(new_callid);
--                      break;
--              case PPTP_IN_CALL_REPLY:
--                      cid = &pptpReq.icreq->callID;
--                      break;
--              case PPTP_CALL_CLEAR_REQUEST:
--                      cid = &pptpReq.clrreq->callID;
--                      break;
--              case PPTP_CALL_DISCONNECT_NOTIFY:
--                      cid = &pptpReq.disc->callID;
--                      break;
--
--              default:
--                      DEBUGP("unknown outbound packet 0x%04x:%s\n", msg,
--                            (msg <= PPTP_MSG_MAX)? strMName[msg]:strMName[0]);
--                      /* fall through */
--
--              case PPTP_SET_LINK_INFO:
--                      /* only need to NAT in case PAC is behind NAT box */
--              case PPTP_START_SESSION_REQUEST:
--              case PPTP_START_SESSION_REPLY:
--              case PPTP_STOP_SESSION_REQUEST:
--              case PPTP_STOP_SESSION_REPLY:
--              case PPTP_ECHO_REQUEST:
--              case PPTP_ECHO_REPLY:
--                      /* no need to alter packet */
--                      return NF_ACCEPT;
--      }
--
--      IP_NF_ASSERT(cid);
--
--      DEBUGP("altering call id from 0x%04x to 0x%04x\n",
--              ntohs(*cid), ntohs(new_callid));
--      /* mangle packet */
--      tcph->check = ip_nat_cheat_check(*cid^0xFFFF, 
--                                       new_callid, tcph->check);
--      *cid = new_callid;
--
--      return NF_ACCEPT;
--}
--
--/* inbound packets == from PAC to PNS */
--static inline unsigned int
--pptp_inbound_pkt(struct tcphdr *tcph, struct pptp_pkt_hdr *pptph,
--               size_t datalen,
--               struct ip_conntrack *ct,
--               enum ip_conntrack_info ctinfo,
--               struct ip_conntrack_expect *oldexp)
--{
--      struct PptpControlHeader *ctlh;
--      union pptp_ctrl_union pptpReq;
--      struct ip_ct_pptp_master *ct_pptp_info = &ct->help.ct_pptp_info;
--      struct ip_nat_pptp *nat_pptp_info = &ct->nat.help.nat_pptp_info;
--
--      u_int16_t msg, new_cid = 0, new_pcid, *pcid = NULL, *cid = NULL;
--      u_int32_t old_dst_ip;
--
--      struct ip_conntrack_tuple t;
--
--      ctlh = (struct PptpControlHeader *) ((void *) pptph + sizeof(*pptph));
--      pptpReq.rawreq = (void *) ((void *) ctlh + sizeof(*ctlh));
--
--      new_pcid = htons(nat_pptp_info->pns_call_id);
--
--      switch (msg = ntohs(ctlh->messageType)) {
--      case PPTP_OUT_CALL_REPLY:
--              pcid = &pptpReq.ocack->peersCallID;     
--              cid = &pptpReq.ocack->callID;
--              if (!oldexp) {
--                      DEBUGP("outcall but no expectation\n");
--                      break;
--              }
--              old_dst_ip = oldexp->tuple.dst.ip;
--              t = oldexp->tuple;
--
--              /* save original PAC call ID in nat_info */
--              nat_pptp_info->pac_call_id = ct_pptp_info->pac_call_id;
--
--              /* store new callID in ct_info, so conntrack works */
--              //ct_pptp_info->pac_call_id = ntohs(tcph->source);
--              //new_cid = htons(ct_pptp_info->pac_call_id);
--
--              /* alter expectation */
--              if (t.dst.ip == ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.ip) {
--                      /* expectation for PNS->PAC direction */
--                      t.dst.u.gre.key = htonl(ct_pptp_info->pac_call_id);
--                      t.src.u.gre.key = htonl(nat_pptp_info->pns_call_id);
--              } else {
--                      /* expectation for PAC->PNS direction */
--                      t.dst.ip = ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.ip;
--                      DEBUGP("EXPECTATION IN WRONG DIRECTION!!!\n");
--              }
--
--              if (!ip_conntrack_change_expect(oldexp, &t)) {
--                      DEBUGP("successfully changed expect\n");
--              } else {
--                      DEBUGP("can't change expect\n");
--              }
--              ip_ct_gre_keymap_change(oldexp->proto.gre.keymap_orig, &t);
--              /* reply keymap */
--              t.src.ip = ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.ip;
--              t.dst.ip = ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.ip;
--              t.src.u.gre.key = htonl(nat_pptp_info->pac_call_id);
--              t.dst.u.gre.key = htonl(ct_pptp_info->pns_call_id);
--              ip_ct_gre_keymap_change(oldexp->proto.gre.keymap_reply, &t);
--
--              break;
--      case PPTP_IN_CALL_CONNECT:
--              pcid = &pptpReq.iccon->peersCallID;
--              if (!oldexp)
--                      break;
--              old_dst_ip = oldexp->tuple.dst.ip;
--              t = oldexp->tuple;
--
--              /* alter expectation, no need for callID */
--              if (t.dst.ip == ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.ip) {
--                      /* expectation for PNS->PAC direction */
--                      t.src.ip = ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.ip;
--              } else {
--                      /* expectation for PAC->PNS direction */
--                      t.dst.ip = ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.ip;
--              }
--
--              if (!ip_conntrack_change_expect(oldexp, &t)) {
--                      DEBUGP("successfully changed expect\n");
--              } else {
--                      DEBUGP("can't change expect\n");
--              }
--              break;
--      case PPTP_IN_CALL_REQUEST:
--              /* only need to nat in case PAC is behind NAT box */
--              break;
--      case PPTP_WAN_ERROR_NOTIFY:
--              pcid = &pptpReq.wanerr->peersCallID;
--              break;
--      default:
--              DEBUGP("unknown inbound packet %s\n",
--                      (msg <= PPTP_MSG_MAX)? strMName[msg]:strMName[0]);
--              /* fall through */
--
--      case PPTP_START_SESSION_REQUEST:
--      case PPTP_START_SESSION_REPLY:
--      case PPTP_STOP_SESSION_REQUEST:
--      case PPTP_ECHO_REQUEST:
--      case PPTP_ECHO_REPLY:
--              /* no need to alter packet */
--              return NF_ACCEPT;
--      }
--
--      /* mangle packet */
--      IP_NF_ASSERT(pcid);
--      DEBUGP("altering peer call id from 0x%04x to 0x%04x\n",
--              ntohs(*pcid), ntohs(new_pcid));
--      tcph->check = ip_nat_cheat_check(*pcid^0xFFFF, 
--                                       new_pcid, tcph->check);
--      *pcid = new_pcid;
--
--      if (new_cid) {
--              IP_NF_ASSERT(cid);
--              DEBUGP("altering call id from 0x%04x to 0x%04x\n",
--                      ntohs(*cid), ntohs(new_cid));
--              tcph->check = ip_nat_cheat_check(*cid^0xFFFF,
--                                              new_cid, tcph->check);
--              *cid = new_cid;
--      }
--
--      /* great, at least we don't need to resize packets */
--      return NF_ACCEPT;
--}
--
--
--static unsigned int tcp_help(struct ip_conntrack *ct,
--                           struct ip_conntrack_expect *exp,
--                           struct ip_nat_info *info,
--                           enum ip_conntrack_info ctinfo,
--                           unsigned int hooknum, struct sk_buff **pskb)
--{
--      struct iphdr *iph = (*pskb)->nh.iph;
--      struct tcphdr *tcph = (void *) iph + iph->ihl*4;
--      unsigned int datalen = (*pskb)->len - iph->ihl*4 - tcph->doff*4;
--      struct pptp_pkt_hdr *pptph;
--      void *datalimit;
--
--      int dir;
--
--      DEBUGP("entering\n");
--
--      /* Only mangle things once: original direction in POST_ROUTING
--         and reply direction on PRE_ROUTING. */
--      dir = CTINFO2DIR(ctinfo);
--      if (!((hooknum == NF_IP_POST_ROUTING && dir == IP_CT_DIR_ORIGINAL)
--            || (hooknum == NF_IP_PRE_ROUTING && dir == IP_CT_DIR_REPLY))) {
--              DEBUGP("Not touching dir %s at hook %s\n",
--                     dir == IP_CT_DIR_ORIGINAL ? "ORIG" : "REPLY",
--                     hooknum == NF_IP_POST_ROUTING ? "POSTROUTING"
--                     : hooknum == NF_IP_PRE_ROUTING ? "PREROUTING"
--                     : hooknum == NF_IP_LOCAL_OUT ? "OUTPUT" : "???");
--              return NF_ACCEPT;
--      }
--
--      /* if packet is too small, just skip it */
--      if (datalen < sizeof(struct pptp_pkt_hdr)+
--                    sizeof(struct PptpControlHeader)) {
--              DEBUGP("pptp packet too short\n");
--              return NF_ACCEPT;       
--      }
--
--
--      pptph = (struct pptp_pkt_hdr *) ((void *)tcph + tcph->doff*4);
--      datalimit = (void *) pptph + datalen;
--
--      LOCK_BH(&ip_pptp_lock);
--
--      if (dir == IP_CT_DIR_ORIGINAL) {
--              /* reuqests sent by client to server (PNS->PAC) */
--              pptp_outbound_pkt(tcph, pptph, datalen, ct, ctinfo, exp);
--      } else {
--              /* response from the server to the client (PAC->PNS) */
--              pptp_inbound_pkt(tcph, pptph, datalen, ct, ctinfo, exp);
--      }
--
--      UNLOCK_BH(&ip_pptp_lock);
--
--      return NF_ACCEPT;
--}
--
--/* nat helper struct for control connection */
--static struct ip_nat_helper pptp_tcp_helper = { 
--      { NULL, NULL },
--      "pptp", IP_NAT_HELPER_F_ALWAYS, THIS_MODULE,
--      { { 0, { tcp: { port: __constant_htons(PPTP_CONTROL_PORT) } } },
--        { 0, { 0 }, IPPROTO_TCP } },
--      { { 0, { tcp: { port: 0xFFFF } } },
--        { 0, { 0 }, 0xFFFF } },
--      tcp_help, pptp_nat_expected };
--
--                        
--static int __init init(void)
--{
--      DEBUGP("init_module\n" );
--
--        if (ip_nat_helper_register(&pptp_tcp_helper))
--              return -EIO;
--
--        return 0;
--}
--
--static void __exit fini(void)
--{
--      DEBUGP("cleanup_module\n" );
--        ip_nat_helper_unregister(&pptp_tcp_helper);
--}
--
--module_init(init);
--module_exit(fini);
-diff -Nurb linux/net/ipv4/netfilter/ip_nat_proto_gre.c linux.stock/net/ipv4/netfilter/ip_nat_proto_gre.c
---- linux/net/ipv4/netfilter/ip_nat_proto_gre.c        2003-07-04 04:12:31.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ip_nat_proto_gre.c  1969-12-31 19:00:00.000000000 -0500
-@@ -1,212 +0,0 @@
--/*
-- * ip_nat_proto_gre.c - Version 1.11
-- *
-- * NAT protocol helper module for GRE.
-- *
-- * GRE is a generic encapsulation protocol, which is generally not very
-- * suited for NAT, as it has no protocol-specific part as port numbers.
-- *
-- * It has an optional key field, which may help us distinguishing two 
-- * connections between the same two hosts.
-- *
-- * GRE is defined in RFC 1701 and RFC 1702, as well as RFC 2784 
-- *
-- * PPTP is built on top of a modified version of GRE, and has a mandatory
-- * field called "CallID", which serves us for the same purpose as the key
-- * field in plain GRE.
-- *
-- * Documentation about PPTP can be found in RFC 2637
-- *
-- * (C) 2000-2002 by Harald Welte <laforge@gnumonks.org>
-- *
-- * Development of this code funded by Astaro AG (http://www.astaro.com/)
-- *
-- */
--
--#include <linux/config.h>
--#include <linux/module.h>
--#include <linux/ip.h>
--#include <linux/netfilter_ipv4/ip_nat.h>
--#include <linux/netfilter_ipv4/ip_nat_rule.h>
--#include <linux/netfilter_ipv4/ip_nat_protocol.h>
--#include <linux/netfilter_ipv4/ip_conntrack_proto_gre.h>
--
--MODULE_LICENSE("GPL");
--MODULE_AUTHOR("Harald Welte <laforge@gnumonks.org>");
--MODULE_DESCRIPTION("Netfilter NAT protocol helper module for GRE");
--
--#define DEBUGP(x, args...)
--
--/* is key in given range between min and max */
--static int
--gre_in_range(const struct ip_conntrack_tuple *tuple,
--           enum ip_nat_manip_type maniptype,
--           const union ip_conntrack_manip_proto *min,
--           const union ip_conntrack_manip_proto *max)
--{
--      return ntohl(tuple->src.u.gre.key) >= ntohl(min->gre.key)
--              && ntohl(tuple->src.u.gre.key) <= ntohl(max->gre.key);
--}
--
--/* generate unique tuple ... */
--static int 
--gre_unique_tuple(struct ip_conntrack_tuple *tuple,
--               const struct ip_nat_range *range,
--               enum ip_nat_manip_type maniptype,
--               const struct ip_conntrack *conntrack)
--{
--      u_int32_t min, i, range_size;
--      u_int32_t key = 0, *keyptr;
--
--      if (maniptype == IP_NAT_MANIP_SRC)
--              keyptr = &tuple->src.u.gre.key;
--      else
--              keyptr = &tuple->dst.u.gre.key;
--
--      if (!(range->flags & IP_NAT_RANGE_PROTO_SPECIFIED)) {
--
--              switch (tuple->dst.u.gre.version) {
--              case 0:
--                      DEBUGP("NATing GRE version 0 (ct=%p)\n",
--                              conntrack);
--                      min = 1;
--                      range_size = 0xffffffff;
--                      break;
--              case GRE_VERSION_PPTP:
--                      DEBUGP("%p: NATing GRE PPTP\n", 
--                              conntrack);
--                      min = 1;
--                      range_size = 0xffff;
--                      break;
--              default:
--                      printk(KERN_WARNING "nat_gre: unknown GRE version\n");
--                      return 0;
--                      break;
--              }
--
--      } else {
--              min = ntohl(range->min.gre.key);
--              range_size = ntohl(range->max.gre.key) - min + 1;
--      }
--
--      DEBUGP("min = %u, range_size = %u\n", min, range_size); 
--
--      for (i = 0; i < range_size; i++, key++) {
--              *keyptr = htonl(min + key % range_size);
--              if (!ip_nat_used_tuple(tuple, conntrack))
--                      return 1;
--      }
--
--      DEBUGP("%p: no NAT mapping\n", conntrack);
--
--      return 0;
--}
--
--/* manipulate a GRE packet according to maniptype */
--static void 
--gre_manip_pkt(struct iphdr *iph, size_t len, 
--            const struct ip_conntrack_manip *manip,
--            enum ip_nat_manip_type maniptype)
--{
--      struct gre_hdr *greh = (struct gre_hdr *)((u_int32_t *)iph+iph->ihl);
--      struct gre_hdr_pptp *pgreh = (struct gre_hdr_pptp *) greh;
--
--      /* we only have destination manip of a packet, since 'source key' 
--       * is not present in the packet itself */
--      if (maniptype == IP_NAT_MANIP_DST) {
--              /* key manipulation is always dest */
--              switch (greh->version) {
--              case 0:
--                      if (!greh->key) {
--                              DEBUGP("can't nat GRE w/o key\n");
--                              break;
--                      }
--                      if (greh->csum) {
--                              *(gre_csum(greh)) = 
--                                      ip_nat_cheat_check(~*(gre_key(greh)),
--                                                      manip->u.gre.key,
--                                                      *(gre_csum(greh)));
--                      }
--                      *(gre_key(greh)) = manip->u.gre.key;
--                      break;
--              case GRE_VERSION_PPTP:
--                      DEBUGP("call_id -> 0x%04x\n", 
--                              ntohl(manip->u.gre.key));
--                      pgreh->call_id = htons(ntohl(manip->u.gre.key));
--                      break;
--              default:
--                      DEBUGP("can't nat unknown GRE version\n");
--                      break;
--              }
--      }
--}
--
--/* print out a nat tuple */
--static unsigned int 
--gre_print(char *buffer, 
--        const struct ip_conntrack_tuple *match,
--        const struct ip_conntrack_tuple *mask)
--{
--      unsigned int len = 0;
--
--      if (mask->dst.u.gre.version)
--              len += sprintf(buffer + len, "version=%d ",
--                              ntohs(match->dst.u.gre.version));
--
--      if (mask->dst.u.gre.protocol)
--              len += sprintf(buffer + len, "protocol=0x%x ",
--                              ntohs(match->dst.u.gre.protocol));
--
--      if (mask->src.u.gre.key)
--              len += sprintf(buffer + len, "srckey=0x%x ", 
--                              ntohl(match->src.u.gre.key));
--
--      if (mask->dst.u.gre.key)
--              len += sprintf(buffer + len, "dstkey=0x%x ",
--                              ntohl(match->src.u.gre.key));
--
--      return len;
--}
--
--/* print a range of keys */
--static unsigned int 
--gre_print_range(char *buffer, const struct ip_nat_range *range)
--{
--      if (range->min.gre.key != 0 
--          || range->max.gre.key != 0xFFFF) {
--              if (range->min.gre.key == range->max.gre.key)
--                      return sprintf(buffer, "key 0x%x ",
--                                      ntohl(range->min.gre.key));
--              else
--                      return sprintf(buffer, "keys 0x%u-0x%u ",
--                                      ntohl(range->min.gre.key),
--                                      ntohl(range->max.gre.key));
--      } else
--              return 0;
--}
--
--/* nat helper struct */
--static struct ip_nat_protocol gre = 
--      { { NULL, NULL }, "GRE", IPPROTO_GRE,
--        gre_manip_pkt,
--        gre_in_range,
--        gre_unique_tuple,
--        gre_print,
--        gre_print_range 
--      };
--                                
--static int __init init(void)
--{
--        if (ip_nat_protocol_register(&gre))
--                return -EIO;
--
--        return 0;
--}
--
--static void __exit fini(void)
--{
--        ip_nat_protocol_unregister(&gre);
--}
--
--module_init(init);
--module_exit(fini);
-diff -Nurb linux/net/ipv4/netfilter/ip_nat_standalone.c linux.stock/net/ipv4/netfilter/ip_nat_standalone.c
---- linux/net/ipv4/netfilter/ip_nat_standalone.c       2003-07-04 04:12:31.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ip_nat_standalone.c 2004-05-09 04:13:03.000000000 -0400
-@@ -37,7 +37,11 @@
- #include <linux/netfilter_ipv4/ip_conntrack_core.h>
- #include <linux/netfilter_ipv4/listhelp.h>
-+#if 0
-+#define DEBUGP printk
-+#else
- #define DEBUGP(format, args...)
-+#endif
- #define HOOKNAME(hooknum) ((hooknum) == NF_IP_POST_ROUTING ? "POST_ROUTING"  \
-                          : ((hooknum) == NF_IP_PRE_ROUTING ? "PRE_ROUTING" \
-@@ -354,6 +358,5 @@
- EXPORT_SYMBOL(ip_nat_helper_unregister);
- EXPORT_SYMBOL(ip_nat_cheat_check);
- EXPORT_SYMBOL(ip_nat_mangle_tcp_packet);
--EXPORT_SYMBOL(ip_nat_mangle_udp_packet);
- EXPORT_SYMBOL(ip_nat_used_tuple);
- MODULE_LICENSE("GPL");
-diff -Nurb linux/net/ipv4/netfilter/ip_nat_tftp.c linux.stock/net/ipv4/netfilter/ip_nat_tftp.c
---- linux/net/ipv4/netfilter/ip_nat_tftp.c     2003-07-04 04:12:31.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ip_nat_tftp.c       1969-12-31 19:00:00.000000000 -0500
-@@ -1,186 +0,0 @@
--/*
-- * Licensed under GNU GPL version 2 Copyright Magnus Boden <mb@ozaba.mine.nu>
-- * Version: 0.0.7
-- *
-- * Thu 21 Mar 2002 Harald Welte <laforge@gnumonks.org>
-- *    - Port to newnat API
-- *
-- * This module currently supports DNAT:
-- * iptables -t nat -A PREROUTING -d x.x.x.x -j DNAT --to-dest x.x.x.y
-- *
-- * and SNAT:
-- * iptables -t nat -A POSTROUTING { -j MASQUERADE , -j SNAT --to-source x.x.x.x }
-- *
-- * It has not been tested with
-- * -j SNAT --to-source x.x.x.x-x.x.x.y since I only have one external ip
-- * If you do test this please let me know if it works or not.
-- *
-- */
--
--#include <linux/module.h>
--#include <linux/netfilter_ipv4.h>
--#include <linux/ip.h>
--#include <linux/udp.h>
--
--#include <linux/netfilter.h>
--#include <linux/netfilter_ipv4/ip_tables.h>
--#include <linux/netfilter_ipv4/ip_conntrack_helper.h>
--#include <linux/netfilter_ipv4/ip_conntrack_tftp.h>
--#include <linux/netfilter_ipv4/ip_nat_helper.h>
--#include <linux/netfilter_ipv4/ip_nat_rule.h>
--
--MODULE_AUTHOR("Magnus Boden <mb@ozaba.mine.nu>");
--MODULE_DESCRIPTION("Netfilter NAT helper for tftp");
--MODULE_LICENSE("GPL");
--
--#define MAX_PORTS 8
--
--static int ports[MAX_PORTS];
--static int ports_c = 0;
--#ifdef MODULE_PARM
--MODULE_PARM(ports,"1-" __MODULE_STRING(MAX_PORTS) "i");
--MODULE_PARM_DESC(ports, "port numbers of tftp servers");
--#endif
--
--#define DEBUGP(format, args...)
--static unsigned int 
--tftp_nat_help(struct ip_conntrack *ct,
--            struct ip_conntrack_expect *exp,
--            struct ip_nat_info *info,
--            enum ip_conntrack_info ctinfo,
--            unsigned int hooknum,
--            struct sk_buff **pskb)
--{
--      int dir = CTINFO2DIR(ctinfo);
--      struct iphdr *iph = (*pskb)->nh.iph;
--      struct udphdr *udph = (void *)iph + iph->ihl * 4;
--      struct tftphdr *tftph = (void *)udph + 8;
--      struct ip_conntrack_tuple repl;
--
--      if (!((hooknum == NF_IP_POST_ROUTING && dir == IP_CT_DIR_ORIGINAL)
--            || (hooknum == NF_IP_PRE_ROUTING && dir == IP_CT_DIR_REPLY))) 
--              return NF_ACCEPT;
--
--      if (!exp) {
--              DEBUGP("no conntrack expectation to modify\n");
--              return NF_ACCEPT;
--      }
--
--      switch (ntohs(tftph->opcode)) {
--      /* RRQ and WRQ works the same way */
--      case TFTP_OPCODE_READ:
--      case TFTP_OPCODE_WRITE:
--              repl = ct->tuplehash[IP_CT_DIR_REPLY].tuple;
--              DEBUGP("");
--              DUMP_TUPLE(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
--              DUMP_TUPLE(&ct->tuplehash[IP_CT_DIR_REPLY].tuple);
--              DEBUGP("expecting: ");
--              DUMP_TUPLE_RAW(&repl);
--              DUMP_TUPLE_RAW(&exp->mask);
--              ip_conntrack_change_expect(exp, &repl);
--              break;
--      default:
--              DEBUGP("Unknown opcode\n");
--      }               
--
--      return NF_ACCEPT;
--}
--
--static unsigned int 
--tftp_nat_expected(struct sk_buff **pskb,
--                unsigned int hooknum,
--                struct ip_conntrack *ct, 
--                struct ip_nat_info *info) 
--{
--      const struct ip_conntrack *master = ct->master->expectant;
--      const struct ip_conntrack_tuple *orig = 
--                      &master->tuplehash[IP_CT_DIR_ORIGINAL].tuple;
--      struct ip_nat_multi_range mr;
--
--      IP_NF_ASSERT(info);
--      IP_NF_ASSERT(master);
--      IP_NF_ASSERT(!(info->initialized & (1 << HOOK2MANIP(hooknum))));
--
--      mr.rangesize = 1;
--      mr.range[0].flags = IP_NAT_RANGE_MAP_IPS;
--
--      if (HOOK2MANIP(hooknum) == IP_NAT_MANIP_SRC) {
--              mr.range[0].min_ip = mr.range[0].max_ip = orig->dst.ip; 
--              DEBUGP("orig: %u.%u.%u.%u:%u <-> %u.%u.%u.%u:%u "
--                      "newsrc: %u.%u.%u.%u\n",
--                        NIPQUAD((*pskb)->nh.iph->saddr), ntohs(udph->source),
--                      NIPQUAD((*pskb)->nh.iph->daddr), ntohs(udph->dest),
--                      NIPQUAD(orig->dst.ip));
--      } else {
--              mr.range[0].min_ip = mr.range[0].max_ip = orig->src.ip;
--              mr.range[0].min.udp.port = mr.range[0].max.udp.port = 
--                                                      orig->src.u.udp.port;
--              mr.range[0].flags |= IP_NAT_RANGE_PROTO_SPECIFIED;
--
--              DEBUGP("orig: %u.%u.%u.%u:%u <-> %u.%u.%u.%u:%u "
--                      "newdst: %u.%u.%u.%u:%u\n",
--                        NIPQUAD((*pskb)->nh.iph->saddr), ntohs(udph->source),
--                        NIPQUAD((*pskb)->nh.iph->daddr), ntohs(udph->dest),
--                        NIPQUAD(orig->src.ip), ntohs(orig->src.u.udp.port));
--      }
--
--      return ip_nat_setup_info(ct,&mr,hooknum);
--}
--
--static struct ip_nat_helper tftp[MAX_PORTS];
--static char tftp_names[MAX_PORTS][10];
--
--static void fini(void)
--{
--      int i;
--
--      for (i = 0 ; i < ports_c; i++) {
--              DEBUGP("unregistering helper for port %d\n", ports[i]);
--              ip_nat_helper_unregister(&tftp[i]);
--      }
--}
--
--static int __init init(void)
--{
--      int i, ret;
--      char *tmpname;
--
--      if (!ports[0])
--              ports[0] = TFTP_PORT;
--
--      for (i = 0 ; (i < MAX_PORTS) && ports[i] ; i++) {
--              memset(&tftp[i], 0, sizeof(struct ip_nat_helper));
--
--              tftp[i].tuple.dst.protonum = IPPROTO_UDP;
--              tftp[i].tuple.src.u.udp.port = htons(ports[i]);
--              tftp[i].mask.dst.protonum = 0xFFFF;
--              tftp[i].mask.src.u.udp.port = 0xFFFF;
--              tftp[i].help = tftp_nat_help;
--              tftp[i].flags = 0;
--              tftp[i].me = THIS_MODULE;
--              tftp[i].expect = tftp_nat_expected;
--
--              tmpname = &tftp_names[i][0];
--              if (ports[i] == TFTP_PORT)
--                      sprintf(tmpname, "tftp");
--              else
--                      sprintf(tmpname, "tftp-%d", i);
--              tftp[i].name = tmpname;
--              
--              DEBUGP("ip_nat_tftp: registering for port %d: name %s\n",
--                      ports[i], tftp[i].name);
--              ret = ip_nat_helper_register(&tftp[i]);
--
--              if (ret) {
--                      printk("ip_nat_tftp: unable to register for port %d\n",
--                              ports[i]);
--                      fini();
--                      return ret;
--              }
--              ports_c++;
--      }
--      return ret;
--}
--
--module_init(init);
--module_exit(fini);
-diff -Nurb linux/net/ipv4/netfilter/ip_pool.c linux.stock/net/ipv4/netfilter/ip_pool.c
---- linux/net/ipv4/netfilter/ip_pool.c 2003-07-04 04:12:31.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ip_pool.c   1969-12-31 19:00:00.000000000 -0500
-@@ -1,328 +0,0 @@
--/* Kernel module for IP pool management */
--
--#include <linux/module.h>
--#include <linux/ip.h>
--#include <linux/skbuff.h>
--#include <linux/netfilter_ipv4/ip_tables.h>
--#include <linux/netfilter_ipv4/ip_pool.h>
--#include <linux/errno.h>
--#include <asm/uaccess.h>
--#include <asm/bitops.h>
--#include <linux/interrupt.h>
--#include <linux/spinlock.h>
--
--#define DP(format, args...)
--
--MODULE_LICENSE("GPL");
--
--#define NR_POOL 16
--static int nr_pool = NR_POOL;/* overwrite this when loading module */
--
--struct ip_pool {
--      u_int32_t first_ip;     /* host byte order, included in range */
--      u_int32_t last_ip;      /* host byte order, included in range */
--      void *members;          /* the bitmap proper */
--      int nr_use;             /* total nr. of tests through this */
--      int nr_match;           /* total nr. of matches through this */
--      rwlock_t lock;
--};
--
--static struct ip_pool *POOL;
--
--static inline struct ip_pool *lookup(ip_pool_t index)
--{
--      if (index < 0 || index >= nr_pool) {
--              DP("ip_pool:lookup: bad index %d\n", index);
--              return 0;
--      }
--      return POOL+index;
--}
--
--int ip_pool_match(ip_pool_t index, u_int32_t addr)
--{
--        struct ip_pool *pool = lookup(index);
--      int res = 0;
--
--      if (!pool || !pool->members)
--              return 0;
--      read_lock_bh(&pool->lock);
--      if (pool->members) {
--              if (addr >= pool->first_ip && addr <= pool->last_ip) {
--                      addr -= pool->first_ip;
--                      if (test_bit(addr, pool->members)) {
--                              res = 1;
--#ifdef CONFIG_IP_POOL_STATISTICS
--                              pool->nr_match++;
--#endif
--                      }
--              }
--#ifdef CONFIG_IP_POOL_STATISTICS
--              pool->nr_use++;
--#endif
--      }
--      read_unlock_bh(&pool->lock);
--      return res;
--}
--
--static int pool_change(ip_pool_t index, u_int32_t addr, int isdel)
--{
--      struct ip_pool *pool;
--      int res = -1;
--
--      pool = lookup(index);
--      if (    !pool || !pool->members
--           || addr < pool->first_ip || addr > pool->last_ip)
--              return -1;
--      read_lock_bh(&pool->lock);
--      if (pool->members && addr >= pool->first_ip && addr <= pool->last_ip) {
--              addr -= pool->first_ip;
--              res = isdel
--                      ? (0 != test_and_clear_bit(addr, pool->members))
--                      : (0 != test_and_set_bit(addr, pool->members));
--      }
--      read_unlock_bh(&pool->lock);
--      return res;
--}
--
--int ip_pool_mod(ip_pool_t index, u_int32_t addr, int isdel)
--{
--      int res = pool_change(index,addr,isdel);
--
--      if (!isdel) res = !res;
--      return res;
--}
--
--static inline int bitmap_bytes(u_int32_t a, u_int32_t b)
--{
--      return 4*((((b-a+8)/8)+3)/4);
--}
--
--static inline int poolbytes(ip_pool_t index)
--{
--      struct ip_pool *pool = lookup(index);
--
--      return pool ? bitmap_bytes(pool->first_ip, pool->last_ip) : 0;
--}
--
--static int setpool(
--      struct sock *sk,
--      int optval,
--      void *user,
--      unsigned int len
--) {
--      struct ip_pool_request req;
--
--      DP("ip_pool:setpool: optval=%d, user=%p, len=%d\n", optval, user, len);
--      if (!capable(CAP_NET_ADMIN))
--              return -EPERM;
--      if (optval != SO_IP_POOL)
--              return -EBADF;
--      if (len != sizeof(req))
--              return -EINVAL;
--      if (copy_from_user(&req, user, sizeof(req)) != 0)
--              return -EFAULT;
--      printk("obsolete op - upgrade your ippool(8) utility.\n");
--      return -EINVAL;
--}
--
--static int getpool(
--      struct sock *sk,
--      int optval,
--      void *user,
--      int *len
--) {
--      struct ip_pool_request req;
--      struct ip_pool *pool;
--      ip_pool_t i;
--      int newbytes;
--      void *newmembers;
--      int res;
--
--      DP("ip_pool:getpool: optval=%d, user=%p\n", optval, user);
--      if (!capable(CAP_NET_ADMIN))
--              return -EINVAL;
--      if (optval != SO_IP_POOL)
--              return -EINVAL;
--      if (*len != sizeof(req)) {
--              return -EFAULT;
--      }
--      if (copy_from_user(&req, user, sizeof(req)) != 0)
--              return -EFAULT;
--      DP("ip_pool:getpool op=%d, index=%d\n", req.op, req.index);
--      if (req.op < IP_POOL_BAD001) {
--              printk("obsolete op - upgrade your ippool(8) utility.\n");
--              return -EFAULT;
--      }
--      switch(req.op) {
--      case IP_POOL_HIGH_NR:
--              DP("ip_pool HIGH_NR\n");
--              req.index = IP_POOL_NONE;
--              for (i=0; i<nr_pool; i++)
--                      if (POOL[i].members)
--                              req.index = i;
--              return copy_to_user(user, &req, sizeof(req));
--      case IP_POOL_LOOKUP:
--              DP("ip_pool LOOKUP\n");
--              pool = lookup(req.index);
--              if (!pool)
--                      return -EINVAL;
--              if (!pool->members)
--                      return -EBADF;
--              req.addr = htonl(pool->first_ip);
--              req.addr2 = htonl(pool->last_ip);
--              return copy_to_user(user, &req, sizeof(req));
--      case IP_POOL_USAGE:
--              DP("ip_pool USE\n");
--              pool = lookup(req.index);
--              if (!pool)
--                      return -EINVAL;
--              if (!pool->members)
--                      return -EBADF;
--              req.addr = pool->nr_use;
--              req.addr2 = pool->nr_match;
--              return copy_to_user(user, &req, sizeof(req));
--      case IP_POOL_TEST_ADDR:
--              DP("ip_pool TEST 0x%08x\n", req.addr);
--              pool = lookup(req.index);
--              if (!pool)
--                      return -EINVAL;
--              res = 0;
--              read_lock_bh(&pool->lock);
--              if (!pool->members) {
--                      DP("ip_pool TEST_ADDR no members in pool\n");
--                      res = -EBADF;
--                      goto unlock_and_return_res;
--              }
--              req.addr = ntohl(req.addr);
--              if (req.addr < pool->first_ip) {
--                      DP("ip_pool TEST_ADDR address < pool bounds\n");
--                      res = -ERANGE;
--                      goto unlock_and_return_res;
--              }
--              if (req.addr > pool->last_ip) {
--                      DP("ip_pool TEST_ADDR address > pool bounds\n");
--                      res = -ERANGE;
--                      goto unlock_and_return_res;
--              }
--              req.addr = (0 != test_bit((req.addr - pool->first_ip),
--                                      pool->members));
--              read_unlock_bh(&pool->lock);
--              return copy_to_user(user, &req, sizeof(req));
--      case IP_POOL_FLUSH:
--              DP("ip_pool FLUSH not yet implemented.\n");
--              return -EBUSY;
--      case IP_POOL_DESTROY:
--              DP("ip_pool DESTROY not yet implemented.\n");
--              return -EBUSY;
--      case IP_POOL_INIT:
--              DP("ip_pool INIT 0x%08x-0x%08x\n", req.addr, req.addr2);
--              pool = lookup(req.index);
--              if (!pool)
--                      return -EINVAL;
--              req.addr = ntohl(req.addr);
--              req.addr2 = ntohl(req.addr2);
--              if (req.addr > req.addr2) {
--                      DP("ip_pool INIT bad ip range\n");
--                      return -EINVAL;
--              }
--              newbytes = bitmap_bytes(req.addr, req.addr2);
--              newmembers = kmalloc(newbytes, GFP_KERNEL);
--              if (!newmembers) {
--                      DP("ip_pool INIT out of mem for %d bytes\n", newbytes);
--                      return -ENOMEM;
--              }
--              memset(newmembers, 0, newbytes);
--              write_lock_bh(&pool->lock);
--              if (pool->members) {
--                      DP("ip_pool INIT pool %d exists\n", req.index);
--                      kfree(newmembers);
--                      res = -EBUSY;
--                      goto unlock_and_return_res;
--              }
--              pool->first_ip = req.addr;
--              pool->last_ip = req.addr2;
--              pool->nr_use = 0;
--              pool->nr_match = 0;
--              pool->members = newmembers;
--              write_unlock_bh(&pool->lock);
--              return 0;
--      case IP_POOL_ADD_ADDR:
--              DP("ip_pool ADD_ADDR 0x%08x\n", req.addr);
--              req.addr = pool_change(req.index, ntohl(req.addr), 0);
--              return copy_to_user(user, &req, sizeof(req));
--      case IP_POOL_DEL_ADDR:
--              DP("ip_pool DEL_ADDR 0x%08x\n", req.addr);
--              req.addr = pool_change(req.index, ntohl(req.addr), 1);
--              return copy_to_user(user, &req, sizeof(req));
--      default:
--              DP("ip_pool:getpool bad op %d\n", req.op);
--              return -EINVAL;
--      }
--      return -EINVAL;
--
--unlock_and_return_res:
--      if (pool)
--              read_unlock_bh(&pool->lock);
--      return res;
--}
--
--static struct nf_sockopt_ops so_pool
--= { { NULL, NULL }, PF_INET,
--    SO_IP_POOL, SO_IP_POOL+1, &setpool,
--    SO_IP_POOL, SO_IP_POOL+1, &getpool,
--    0, NULL };
--
--MODULE_PARM(nr_pool, "i");
--
--static int __init init(void)
--{
--      ip_pool_t i;
--      int res;
--
--      if (nr_pool < 1) {
--              printk("ip_pool module init: bad nr_pool %d\n", nr_pool);
--              return -EINVAL;
--      }
--      POOL = kmalloc(nr_pool * sizeof(*POOL), GFP_KERNEL);
--      if (!POOL) {
--              printk("ip_pool module init: out of memory for nr_pool %d\n",
--                      nr_pool);
--              return -ENOMEM;
--      }
--      for (i=0; i<nr_pool; i++) {
--              POOL[i].first_ip = 0;
--              POOL[i].last_ip = 0;
--              POOL[i].members = 0;
--              POOL[i].nr_use = 0;
--              POOL[i].nr_match = 0;
--              POOL[i].lock = RW_LOCK_UNLOCKED;
--      }
--      res = nf_register_sockopt(&so_pool);
--      DP("ip_pool:init %d pools, result %d\n", nr_pool, res);
--      if (res != 0) {
--              kfree(POOL);
--              POOL = 0;
--      }
--      return res;
--}
--
--static void __exit fini(void)
--{
--      ip_pool_t i;
--
--      DP("ip_pool:fini BYEBYE\n");
--      nf_unregister_sockopt(&so_pool);
--      for (i=0; i<nr_pool; i++) {
--              if (POOL[i].members) {
--                      kfree(POOL[i].members);
--                      POOL[i].members = 0;
--              }
--      }
--      kfree(POOL);
--      POOL = 0;
--      DP("ip_pool:fini these are the famous last words\n");
--      return;
--}
--
--module_init(init);
--module_exit(fini);
-diff -Nurb linux/net/ipv4/netfilter/ip_tables.c linux.stock/net/ipv4/netfilter/ip_tables.c
---- linux/net/ipv4/netfilter/ip_tables.c       2003-07-04 04:12:31.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ip_tables.c 2004-05-09 04:13:03.000000000 -0400
-@@ -62,6 +62,11 @@
- #include <linux/netfilter_ipv4/lockhelp.h>
- #include <linux/netfilter_ipv4/listhelp.h>
-+#if 0
-+/* All the better to debug you with... */
-+#define static
-+#define inline
-+#endif
- /* Locking is simple: we assume at worst case there will be one packet
-    in user context and one from bottom halves (or soft irq if Alexey's
-@@ -83,6 +88,7 @@
- {
-       /* Size per table */
-       unsigned int size;
-+      /* Number of entries: FIXME. --RR */
-       unsigned int number;
-       /* Initial number of entries. Needed for module usage count */
-       unsigned int initial_entries;
-@@ -106,6 +112,11 @@
- #define TABLE_OFFSET(t,p) 0
- #endif
-+#if 0
-+#define down(x) do { printk("DOWN:%u:" #x "\n", __LINE__); down(x); } while(0)
-+#define down_interruptible(x) ({ int __r; printk("DOWNi:%u:" #x "\n", __LINE__); __r = down_interruptible(x); if (__r != 0) printk("ABORT-DOWNi:%u\n", __LINE__); __r; })
-+#define up(x) do { printk("UP:%u:" #x "\n", __LINE__); up(x); } while(0)
-+#endif
- /* Returns whether matches rule or not. */
- static inline int
-@@ -408,6 +419,12 @@
- {
-       void *ret;
-+#if 0
-+      duprintf("find_inlist: searching for `%s' in %s.\n",
-+               name, head == &ipt_target ? "ipt_target"
-+               : head == &ipt_match ? "ipt_match"
-+               : head == &ipt_tables ? "ipt_tables" : "UNKNOWN");
-+#endif
-       *error = down_interruptible(mutex);
-       if (*error != 0)
-@@ -745,6 +762,8 @@
-                       newinfo->underflow[h] = underflows[h];
-       }
-+      /* FIXME: underflows must be unconditional, standard verdicts
-+           < 0 (not IPT_RETURN). --RR */
-       /* Clear counters and comefrom */
-       e->counters = ((struct ipt_counters) { 0, 0 });
-@@ -957,6 +976,7 @@
-               goto free_counters;
-       }
-+      /* FIXME: use iterator macros --RR */
-       /* ... then go back and fix counters and names */
-       for (off = 0, num = 0; off < total_size; off += e->next_offset, num++){
-               unsigned int i;
-@@ -1134,6 +1154,14 @@
-                    const struct ipt_counters addme[],
-                    unsigned int *i)
- {
-+#if 0
-+      duprintf("add_counter: Entry %u %lu/%lu + %lu/%lu\n",
-+               *i,
-+               (long unsigned int)e->counters.pcnt,
-+               (long unsigned int)e->counters.bcnt,
-+               (long unsigned int)addme[*i].pcnt,
-+               (long unsigned int)addme[*i].bcnt);
-+#endif
-       ADD_COUNTER(e->counters, addme[*i].bcnt, addme[*i].pcnt);
-@@ -1495,6 +1523,7 @@
-               return 0;
-       }
-+      /* FIXME: Try tcp doff >> packet len against various stacks --RR */
- #define FWINVTCP(bool,invflg) ((bool) ^ !!(tcpinfo->invflags & invflg))
-@@ -1670,15 +1699,14 @@
- = { { NULL, NULL }, "icmp", &icmp_match, &icmp_checkentry, NULL };
- #ifdef CONFIG_PROC_FS
--static inline int print_name(const char *i,
-+static inline int print_name(const struct ipt_table *t,
-                            off_t start_offset, char *buffer, int length,
-                            off_t *pos, unsigned int *count)
- {
-       if ((*count)++ >= start_offset) {
-               unsigned int namelen;
--              namelen = sprintf(buffer + *pos, "%s\n",
--                                i + sizeof(struct list_head));
-+              namelen = sprintf(buffer + *pos, "%s\n", t->name);
-               if (*pos + namelen > length) {
-                       /* Stop iterating */
-                       return 1;
-@@ -1696,7 +1724,7 @@
-       if (down_interruptible(&ipt_mutex) != 0)
-               return 0;
--      LIST_FIND(&ipt_tables, print_name, void *,
-+      LIST_FIND(&ipt_tables, print_name, struct ipt_table *,
-                 offset, buffer, length, &pos, &count);
-       up(&ipt_mutex);
-@@ -1705,46 +1733,6 @@
-       *start=(char *)((unsigned long)count-offset);
-       return pos;
- }
--
--static int ipt_get_targets(char *buffer, char **start, off_t offset, int length)
--{
--      off_t pos = 0;
--      unsigned int count = 0;
--
--      if (down_interruptible(&ipt_mutex) != 0)
--              return 0;
--
--      LIST_FIND(&ipt_target, print_name, void *,
--                offset, buffer, length, &pos, &count);
--      
--      up(&ipt_mutex);
--
--      *start = (char *)((unsigned long)count - offset);
--      return pos;
--}
--
--static int ipt_get_matches(char *buffer, char **start, off_t offset, int length)
--{
--      off_t pos = 0;
--      unsigned int count = 0;
--
--      if (down_interruptible(&ipt_mutex) != 0)
--              return 0;
--      
--      LIST_FIND(&ipt_match, print_name, void *,
--                offset, buffer, length, &pos, &count);
--
--      up(&ipt_mutex);
--
--      *start = (char *)((unsigned long)count - offset);
--      return pos;
--}
--
--static struct { char *name; get_info_t *get_info; } ipt_proc_entry[] =
--{ { "ip_tables_names", ipt_get_tables },
--  { "ip_tables_targets", ipt_get_targets },
--  { "ip_tables_matches", ipt_get_matches },
--  { NULL, NULL} };
- #endif /*CONFIG_PROC_FS*/
- static int __init init(void)
-@@ -1770,20 +1758,14 @@
- #ifdef CONFIG_PROC_FS
-       {
-       struct proc_dir_entry *proc;
--      int i;
--      for (i = 0; ipt_proc_entry[i].name; i++) {
--              proc = proc_net_create(ipt_proc_entry[i].name, 0,
--                                     ipt_proc_entry[i].get_info);
-+      proc = proc_net_create("ip_tables_names", 0, ipt_get_tables);
-               if (!proc) {
--                      while (--i >= 0)
--                              proc_net_remove(ipt_proc_entry[i].name);
-                       nf_unregister_sockopt(&ipt_sockopts);
-                       return -ENOMEM;
-               }
-               proc->owner = THIS_MODULE;
-       }
--      }
- #endif
-       printk("ip_tables: (C) 2000-2002 Netfilter core team\n");
-@@ -1794,11 +1776,7 @@
- {
-       nf_unregister_sockopt(&ipt_sockopts);
- #ifdef CONFIG_PROC_FS
--      {
--      int i;
--      for (i = 0; ipt_proc_entry[i].name; i++)
--              proc_net_remove(ipt_proc_entry[i].name);
--      }
-+      proc_net_remove("ip_tables_names");
- #endif
- }
-diff -Nurb linux/net/ipv4/netfilter/ipchains_core.c linux.stock/net/ipv4/netfilter/ipchains_core.c
---- linux/net/ipv4/netfilter/ipchains_core.c   2003-07-04 04:12:31.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ipchains_core.c     2004-05-09 04:13:03.000000000 -0400
-@@ -977,10 +977,17 @@
-                   || ftmp->ipfw.fw_dst.s_addr!=frwl->ipfw.fw_dst.s_addr
-                   || ftmp->ipfw.fw_smsk.s_addr!=frwl->ipfw.fw_smsk.s_addr
-                   || ftmp->ipfw.fw_dmsk.s_addr!=frwl->ipfw.fw_dmsk.s_addr
-+#if 0
-+                  || ftmp->ipfw.fw_flg!=frwl->ipfw.fw_flg
-+#else
-                   || ((ftmp->ipfw.fw_flg & ~IP_FW_F_MARKABS)
-                       != (frwl->ipfw.fw_flg & ~IP_FW_F_MARKABS))
-+#endif
-                   || ftmp->ipfw.fw_invflg!=frwl->ipfw.fw_invflg
-                   || ftmp->ipfw.fw_proto!=frwl->ipfw.fw_proto
-+#if 0
-+                  || ftmp->ipfw.fw_mark!=frwl->ipfw.fw_mark
-+#endif
-                   || ftmp->ipfw.fw_redirpt!=frwl->ipfw.fw_redirpt
-                   || ftmp->ipfw.fw_spts[0]!=frwl->ipfw.fw_spts[0]
-                   || ftmp->ipfw.fw_spts[1]!=frwl->ipfw.fw_spts[1]
-@@ -1566,6 +1573,7 @@
-       )
- {
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,29)
-+      /* FIXME: No more `atomic' read and reset.  Wonderful 8-( --RR */
-       int reset = 0;
- #endif
-       struct ip_chain *i;
-diff -Nurb linux/net/ipv4/netfilter/ipfwadm_core.c linux.stock/net/ipv4/netfilter/ipfwadm_core.c
---- linux/net/ipv4/netfilter/ipfwadm_core.c    2003-10-14 04:09:33.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ipfwadm_core.c      2004-05-09 04:13:03.000000000 -0400
-@@ -20,7 +20,7 @@
-  *    license in recognition of the original copyright.
-  *                            -- Alan Cox.
-  *
-- *    $Id: ipfwadm_core.c,v 1.1.1.4 2003/10/14 08:09:33 sparq Exp $
-+ *    $Id: ipfwadm_core.c,v 1.9.2.2 2002/01/24 15:50:42 davem Exp $
-  *
-  *    Ported from BSD to Linux,
-  *            Alan Cox 22/Nov/1994.
-@@ -1205,6 +1205,7 @@
-       )
- {
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,29)
-+      /* FIXME: No more `atomic' read and reset.  Wonderful 8-( --RR */
-       int reset = 0;
- #endif
-       return ip_chain_procinfo(IP_FW_ACCT, buffer,start, offset,length,
-@@ -1223,6 +1224,7 @@
-       )
- {
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,29)
-+      /* FIXME: No more `atomic' read and reset.  Wonderful 8-( --RR */
-       int reset = 0;
- #endif
-       return ip_chain_procinfo(IP_FW_IN, buffer,start,offset,length,
-@@ -1237,6 +1239,7 @@
-       )
- {
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,29)
-+      /* FIXME: No more `atomic' read and reset.  Wonderful 8-( --RR */
-       int reset = 0;
- #endif
-       return ip_chain_procinfo(IP_FW_OUT, buffer,start,offset,length,
-@@ -1251,6 +1254,7 @@
-       )
- {
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,29)
-+      /* FIXME: No more `atomic' read and reset.  Wonderful 8-( --RR */
-       int reset = 0;
- #endif
-       return ip_chain_procinfo(IP_FW_FWD, buffer,start,offset,length,
-diff -Nurb linux/net/ipv4/netfilter/ipt_ECN.c linux.stock/net/ipv4/netfilter/ipt_ECN.c
---- linux/net/ipv4/netfilter/ipt_ECN.c 2003-10-14 04:02:57.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ipt_ECN.c   2004-05-09 04:13:03.000000000 -0400
-@@ -87,8 +87,8 @@
-       }
-       
-       if (diffs[0] != *tcpflags) {
--              diffs[0] = diffs[0] ^ 0xFFFF;
--              diffs[1] = *tcpflags;
-+              diffs[0] = htons(diffs[0]) ^ 0xFFFF;
-+              diffs[1] = htons(*tcpflags);
-               tcph->check = csum_fold(csum_partial((char *)diffs,
-                                                   sizeof(diffs),
-                                                   tcph->check^0xFFFF));
-diff -Nurb linux/net/ipv4/netfilter/ipt_LOG.c linux.stock/net/ipv4/netfilter/ipt_LOG.c
---- linux/net/ipv4/netfilter/ipt_LOG.c 2003-07-04 04:12:31.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ipt_LOG.c   2004-05-09 04:13:03.000000000 -0400
-@@ -14,11 +14,15 @@
- #include <net/route.h>
- #include <linux/netfilter_ipv4/ipt_LOG.h>
-+#if 0
-+#define DEBUGP printk
-+#else
- #define DEBUGP(format, args...)
-+#endif
- struct esphdr {
-       __u32   spi;
--}; 
-+}; /* FIXME evil kludge */
-         
- /* Use lock to serialize, so printks don't overlap */
- static spinlock_t log_lock = SPIN_LOCK_UNLOCKED;
-diff -Nurb linux/net/ipv4/netfilter/ipt_REJECT.c linux.stock/net/ipv4/netfilter/ipt_REJECT.c
---- linux/net/ipv4/netfilter/ipt_REJECT.c      2003-07-04 04:12:31.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ipt_REJECT.c        2004-05-09 04:13:03.000000000 -0400
-@@ -6,8 +6,6 @@
- #include <linux/module.h>
- #include <linux/skbuff.h>
- #include <linux/ip.h>
--#include <linux/udp.h>
--#include <linux/icmp.h>
- #include <net/icmp.h>
- #include <net/ip.h>
- #include <net/tcp.h>
-@@ -16,7 +14,11 @@
- #include <linux/netfilter_ipv4/ip_tables.h>
- #include <linux/netfilter_ipv4/ipt_REJECT.h>
-+#if 0
-+#define DEBUGP printk
-+#else
- #define DEBUGP(format, args...)
-+#endif
- /* If the original packet is part of a connection, but the connection
-    is not confirmed, our manufactured reply will not be associated
-@@ -155,7 +157,6 @@
- static void send_unreach(struct sk_buff *skb_in, int code)
- {
-       struct iphdr *iph;
--      struct udphdr *udph;
-       struct icmphdr *icmph;
-       struct sk_buff *nskb;
-       u32 saddr;
-@@ -167,6 +168,7 @@
-       if (!rt)
-               return;
-+      /* FIXME: Use sysctl number. --RR */
-       if (!xrlim_allow(&rt->u.dst, 1*HZ))
-               return;
-@@ -184,19 +186,6 @@
-       if (iph->frag_off&htons(IP_OFFSET))
-               return;
--      /* if UDP checksum is set, verify it's correct */
--      if (iph->protocol == IPPROTO_UDP
--          && skb_in->tail-(u8*)iph >= sizeof(struct udphdr)) {
--              int datalen = skb_in->len - (iph->ihl<<2);
--              udph = (struct udphdr *)((char *)iph + (iph->ihl<<2));
--              if (udph->check
--                  && csum_tcpudp_magic(iph->saddr, iph->daddr,
--                                       datalen, IPPROTO_UDP,
--                                       csum_partial((char *)udph, datalen,
--                                                    0)) != 0)
--                      return;
--      }
--                  
-       /* If we send an ICMP error to an ICMP error a mess would result.. */
-       if (iph->protocol == IPPROTO_ICMP
-           && skb_in->tail-(u8*)iph >= sizeof(struct icmphdr)) {
-@@ -271,6 +260,7 @@
-       /* Copy as much of original packet as will fit */
-       data = skb_put(nskb,
-                      length - sizeof(struct iphdr) - sizeof(struct icmphdr));
-+      /* FIXME: won't work with nonlinear skbs --RR */
-       memcpy(data, skb_in->nh.iph,
-              length - sizeof(struct iphdr) - sizeof(struct icmphdr));
-       icmph->checksum = ip_compute_csum((unsigned char *)icmph,
-diff -Nurb linux/net/ipv4/netfilter/ipt_ULOG.c linux.stock/net/ipv4/netfilter/ipt_ULOG.c
---- linux/net/ipv4/netfilter/ipt_ULOG.c        2003-07-04 04:12:32.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ipt_ULOG.c  2004-05-09 04:13:03.000000000 -0400
-@@ -12,7 +12,6 @@
-  *          module loadtime -HW
-  * 2002/07/07 remove broken nflog_rcv() function -HW
-  * 2002/08/29 fix shifted/unshifted nlgroup bug -HW
-- * 2002/10/30 fix uninitialized mac_len field - <Anders K. Pedersen>
-  *
-  * Released under the terms of the GPL
-  *
-@@ -32,7 +31,7 @@
-  *   Specify, after how many clock ticks (intel: 100 per second) the queue
-  * should be flushed even if it is not full yet.
-  *
-- * ipt_ULOG.c,v 1.22 2002/10/30 09:07:31 laforge Exp
-+ * ipt_ULOG.c,v 1.21 2002/08/29 10:54:34 laforge Exp
-  */
- #include <linux/module.h>
-@@ -60,7 +59,12 @@
- #define ULOG_NL_EVENT         111             /* Harald's favorite number */
- #define ULOG_MAXNLGROUPS      32              /* numer of nlgroups */
-+#if 0
-+#define DEBUGP(format, args...)       printk(__FILE__ ":" __FUNCTION__ ":" \
-+                                     format, ## args)
-+#else
- #define DEBUGP(format, args...)
-+#endif
- #define PRINTR(format, args...) do { if (net_ratelimit()) printk(format, ## args); } while (0)
-@@ -220,8 +224,7 @@
-           && in->hard_header_len <= ULOG_MAC_LEN) {
-               memcpy(pm->mac, (*pskb)->mac.raw, in->hard_header_len);
-               pm->mac_len = in->hard_header_len;
--      } else
--              pm->mac_len = 0;
-+      }
-       if (in)
-               strncpy(pm->indev_name, in->name, sizeof(pm->indev_name));
-diff -Nurb linux/net/ipv4/netfilter/ipt_multiport.c linux.stock/net/ipv4/netfilter/ipt_multiport.c
---- linux/net/ipv4/netfilter/ipt_multiport.c   2003-07-04 04:12:32.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ipt_multiport.c     2004-05-09 04:13:03.000000000 -0400
-@@ -8,7 +8,11 @@
- #include <linux/netfilter_ipv4/ipt_multiport.h>
- #include <linux/netfilter_ipv4/ip_tables.h>
-+#if 0
-+#define duprintf(format, args...) printk(format , ## args)
-+#else
- #define duprintf(format, args...)
-+#endif
- /* Returns 1 if the port is matched by the test, 0 otherwise. */
- static inline int
-@@ -74,7 +78,7 @@
-       /* Must specify proto == TCP/UDP, no unknown flags or bad count */
-       return (ip->proto == IPPROTO_TCP || ip->proto == IPPROTO_UDP)
--              && !(ip->invflags & IPT_INV_PROTO)
-+              && !(ip->flags & IPT_INV_PROTO)
-               && matchsize == IPT_ALIGN(sizeof(struct ipt_multiport))
-               && (multiinfo->flags == IPT_MULTIPORT_SOURCE
-                   || multiinfo->flags == IPT_MULTIPORT_DESTINATION
-diff -Nurb linux/net/ipv4/netfilter/ipt_pool.c linux.stock/net/ipv4/netfilter/ipt_pool.c
---- linux/net/ipv4/netfilter/ipt_pool.c        2003-07-04 04:12:32.000000000 -0400
-+++ linux.stock/net/ipv4/netfilter/ipt_pool.c  1969-12-31 19:00:00.000000000 -0500
-@@ -1,71 +0,0 @@
--/* Kernel module to match an IP address pool. */
--
--#include <linux/module.h>
--#include <linux/ip.h>
--#include <linux/skbuff.h>
--
--#include <linux/netfilter_ipv4/ip_tables.h>
--#include <linux/netfilter_ipv4/ip_pool.h>
--#include <linux/netfilter_ipv4/ipt_pool.h>
--
--static inline int match_pool(
--      ip_pool_t index,
--      __u32 addr,
--      int inv
--) {
--      if (ip_pool_match(index, ntohl(addr)))
--              inv = !inv;
--      return inv;
--}
--
--static int match(
--      const struct sk_buff *skb,
--      const struct net_device *in,
--      const struct net_device *out,
--      const void *matchinfo,
--      int offset,
--      const void *hdr,
--      u_int16_t datalen,
--      int *hotdrop
--) {
--      const struct ipt_pool_info *info = matchinfo;
--      const struct iphdr *iph = skb->nh.iph;
--
--      if (info->src != IP_POOL_NONE && !match_pool(info->src, iph->saddr,
--                                              info->flags&IPT_POOL_INV_SRC))
--              return 0;
--
--      if (info->dst != IP_POOL_NONE && !match_pool(info->dst, iph->daddr,
--                                              info->flags&IPT_POOL_INV_DST))
--              return 0;
--
--      return 1;
--}
--
--static int checkentry(
--      const char *tablename,
--      const struct ipt_ip *ip,
--      void *matchinfo,
--      unsigned int matchsize,
--      unsigned int hook_mask
--) {
--      if (matchsize != IPT_ALIGN(sizeof(struct ipt_pool_info)))
--              return 0;
--      return 1;
--}
--
--static struct ipt_match pool_match
--= { { NULL, NULL }, "pool", &match, &checkentry, NULL, THIS_MODULE };
--
--static int __init init(void)
--{
--      return ipt_register_match(&pool_match);
--}
--
--static void __exit fini(void)
--{
--      ipt_unregister_match(&pool_match);
--}
--
--module_init(init);
--module_exit(fini);
-diff -Nurb linux/net/ipv6/mcast.c linux.stock/net/ipv6/mcast.c
---- linux/net/ipv6/mcast.c     2003-10-14 04:09:34.000000000 -0400
-+++ linux.stock/net/ipv6/mcast.c       2004-05-09 04:13:22.000000000 -0400
-@@ -5,7 +5,7 @@
-  *    Authors:
-  *    Pedro Roque             <roque@di.fc.ul.pt>     
-  *
-- *    $Id: mcast.c,v 1.1.1.4 2003/10/14 08:09:34 sparq Exp $
-+ *    $Id: mcast.c,v 1.38 2001/08/15 07:36:31 davem Exp $
-  *
-  *    Based on linux/ipv4/igmp.c and linux/ipv4/ip_sockglue.c 
-  *
---- linux/include/linux/ppp-comp.h     2004-08-16 20:58:32.089851872 -0400
-+++ linux.stock/include/linux/ppp-comp.h       2004-08-16 20:59:48.217278744 -0400
-@@ -24,7 +24,7 @@
-  * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
-  * OR MODIFICATIONS.
-  *
-- * $Id: ppp-comp.h,v 1.1.1.4 2003/10/14 08:09:26 sparq Exp $
-+ * $Id: ppp-comp.h,v 1.6 1997/11/27 06:04:44 paulus Exp $
-  */
- /*
diff --git a/obsolete-buildroot/sources/openwrt/kernel/netfilter/patches/110-conntrack_setting.patch b/obsolete-buildroot/sources/openwrt/kernel/netfilter/patches/110-conntrack_setting.patch
deleted file mode 100644 (file)
index 87be89d..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
---- ../../buildroot-unpacked/build_mipsel/linux/net/ipv4/netfilter/ip_conntrack_core.c 2004-11-28 22:59:36.000000000 -0500
-+++ linux/net/ipv4/netfilter/ip_conntrack_core.c       2004-11-30 05:05:32.000000000 -0500
-@@ -1386,7 +1386,7 @@
-       nf_unregister_sockopt(&so_getorigdst);
- }
--static int hashsize = 0;
-+static int hashsize = 5953
- MODULE_PARM(hashsize, "i");
- int __init ip_conntrack_init(void)
-@@ -1407,7 +1407,7 @@
-               if (ip_conntrack_htable_size < 16)
-                       ip_conntrack_htable_size = 16;
-       }
--      ip_conntrack_max = 8 * ip_conntrack_htable_size;
-+      ip_conntrack_max = ip_conntrack_htable_size;
-       printk("ip_conntrack version %s (%u buckets, %d max)"
-              " - %Zd bytes per conntrack\n", IP_CONNTRACK_VERSION,
diff --git a/obsolete-buildroot/sources/openwrt/kernel/patches/110-sch_htb.patch b/obsolete-buildroot/sources/openwrt/kernel/patches/110-sch_htb.patch
deleted file mode 100644 (file)
index 3c9a50e..0000000
+++ /dev/null
@@ -1,570 +0,0 @@
---- linux/net/sched/sch_htb.c  2003-10-14 01:09:35.000000000 -0700
-+++ linux.2.4.26/net/sched/sch_htb.c   2004-05-10 00:05:51.000000000 -0700
-@@ -9,6 +9,8 @@
-  * Authors:   Martin Devera, <devik@cdi.cz>
-  *
-  * Credits (in time order) for older HTB versions:
-+ *              Stef Coene <stef.coene@docum.org>
-+ *                    HTB support at LARTC mailing list
-  *            Ondrej Kraus, <krauso@barr.cz> 
-  *                    found missing INIT_QDISC(htb)
-  *            Vladimir Smelhaus, Aamer Akhter, Bert Hubert
-@@ -17,9 +19,13 @@
-  *                    code review and helpful comments on shaping
-  *            Tomasz Wrona, <tw@eter.tym.pl>
-  *                    created test case so that I was able to fix nasty bug
-+ *            Wilfried Weissmann
-+ *                    spotted bug in dequeue code and helped with fix
-+ *            Jiri Fojtasek
-+ *                    fixed requeue routine
-  *            and many others. thanks.
-  *
-- * $Id: sch_htb.c,v 1.1.1.4 2003/10/14 08:09:35 sparq Exp $
-+ * $Id: sch_htb.c,v 1.25 2003/12/07 11:08:25 devik Exp devik $
-  */
- #include <linux/config.h>
- #include <linux/module.h>
-@@ -71,16 +77,12 @@
- #define HTB_HYSTERESIS 1/* whether to use mode hysteresis for speedup */
- #define HTB_QLOCK(S) spin_lock_bh(&(S)->dev->queue_lock)
- #define HTB_QUNLOCK(S) spin_unlock_bh(&(S)->dev->queue_lock)
--#define HTB_VER 0x30007       /* major must be matched with number suplied by TC as version */
-+#define HTB_VER 0x30010       /* major must be matched with number suplied by TC as version */
- #if HTB_VER >> 16 != TC_HTB_PROTOVER
- #error "Mismatched sch_htb.c and pkt_sch.h"
- #endif
--/* temporary debug defines to be removed after beta stage */
--#define DEVIK_MEND(N)
--#define DEVIK_MSTART(N)
--
- /* debugging support; S is subsystem, these are defined:
-   0 - netlink messages
-   1 - enqueue
-@@ -100,13 +102,16 @@
-  from LSB
-  */
- #ifdef HTB_DEBUG
--#define HTB_DBG(S,L,FMT,ARG...) if (((q->debug>>(2*S))&3) >= L) \
-+#define HTB_DBG_COND(S,L) (((q->debug>>(2*S))&3) >= L)
-+#define HTB_DBG(S,L,FMT,ARG...) if (HTB_DBG_COND(S,L)) \
-       printk(KERN_DEBUG FMT,##ARG)
- #define HTB_CHCL(cl) BUG_TRAP((cl)->magic == HTB_CMAGIC)
- #define HTB_PASSQ q,
- #define HTB_ARGQ struct htb_sched *q,
- #define static
-+#undef __inline__
- #define __inline__
-+#undef inline
- #define inline
- #define HTB_CMAGIC 0xFEFAFEF1
- #define htb_safe_rb_erase(N,R) do { BUG_TRAP((N)->rb_color != -1); \
-@@ -114,6 +119,7 @@
-               rb_erase(N,R); \
-               (N)->rb_color = -1; } while (0)
- #else
-+#define HTB_DBG_COND(S,L) (0)
- #define HTB_DBG(S,L,FMT,ARG...)
- #define HTB_PASSQ
- #define HTB_ARGQ
-@@ -219,6 +225,9 @@
-     /* time of nearest event per level (row) */
-     unsigned long near_ev_cache[TC_HTB_MAXDEPTH];
-+    /* cached value of jiffies in dequeue */
-+    unsigned long jiffies;
-+
-     /* whether we hit non-work conserving class during this dequeue; we use */
-     int nwc_hit;      /* this to disable mindelay complaint in dequeue */
-@@ -297,7 +306,7 @@
-          rules in it */
-       if (skb->priority == sch->handle)
-               return HTB_DIRECT;  /* X:0 (direct flow) selected */
--      if ((cl = htb_find(skb->priority,sch)) != NULL) 
-+      if ((cl = htb_find(skb->priority,sch)) != NULL && cl->level == 0) 
-               return cl;
-       tcf = q->filter_list;
-@@ -338,7 +347,7 @@
- static void htb_debug_dump (struct htb_sched *q)
- {
-       int i,p;
--      printk(KERN_DEBUG "htb*g j=%lu\n",jiffies);
-+      printk(KERN_DEBUG "htb*g j=%lu lj=%lu\n",jiffies,q->jiffies);
-       /* rows */
-       for (i=TC_HTB_MAXDEPTH-1;i>=0;i--) {
-               printk(KERN_DEBUG "htb*r%d m=%x",i,q->row_mask[i]);
-@@ -421,26 +430,24 @@
-       if ((delay <= 0 || delay > cl->mbuffer) && net_ratelimit())
-               printk(KERN_ERR "HTB: suspicious delay in wait_tree d=%ld cl=%X h=%d\n",delay,cl->classid,debug_hint);
- #endif
--      DEVIK_MSTART(9);
--      cl->pq_key = jiffies + PSCHED_US2JIFFIE(delay);
--      if (cl->pq_key == jiffies)
-+      cl->pq_key = q->jiffies + PSCHED_US2JIFFIE(delay);
-+      if (cl->pq_key == q->jiffies)
-               cl->pq_key++;
-       /* update the nearest event cache */
--      if (q->near_ev_cache[cl->level] - cl->pq_key < 0x80000000)
-+      if (time_after(q->near_ev_cache[cl->level], cl->pq_key))
-               q->near_ev_cache[cl->level] = cl->pq_key;
-       
-       while (*p) {
-               struct htb_class *c; parent = *p;
-               c = rb_entry(parent, struct htb_class, pq_node);
--              if (cl->pq_key - c->pq_key < 0x80000000)
-+              if (time_after_eq(cl->pq_key, c->pq_key))
-                       p = &parent->rb_right;
-               else 
-                       p = &parent->rb_left;
-       }
-       rb_link_node(&cl->pq_node, parent, p);
-       rb_insert_color(&cl->pq_node, &q->wait_pq[cl->level]);
--      DEVIK_MEND(9);
- }
- /**
-@@ -453,12 +460,14 @@
- {
-       rb_node_t *p;
-       if ((*n)->rb_right) {
-+              /* child at right. use it or its leftmost ancestor */
-               *n = (*n)->rb_right;
-               while ((*n)->rb_left) 
-                       *n = (*n)->rb_left;
-               return;
-       }
-       while ((p = (*n)->rb_parent) != NULL) {
-+              /* if we've arrived from left child then we have next node */
-               if (p->rb_left == *n) break;
-               *n = p;
-       }
-@@ -602,7 +611,7 @@
-     long toks;
-     if ((toks = (cl->ctokens + *diff)) < (
--#ifdef HTB_HYSTERESIS
-+#if HTB_HYSTERESIS
-           cl->cmode != HTB_CANT_SEND ? -cl->cbuffer :
- #endif
-                   0)) {
-@@ -610,7 +619,7 @@
-           return HTB_CANT_SEND;
-     }
-     if ((toks = (cl->tokens + *diff)) >= (
--#ifdef HTB_HYSTERESIS
-+#if HTB_HYSTERESIS
-           cl->cmode == HTB_CAN_SEND ? -cl->buffer :
- #endif
-           0))
-@@ -689,7 +698,6 @@
-     struct htb_sched *q = (struct htb_sched *)sch->data;
-     struct htb_class *cl = htb_classify(skb,sch);
--    DEVIK_MSTART(0);
-     if (cl == HTB_DIRECT || !cl) {
-       /* enqueue to helper queue */
-       if (q->direct_queue.qlen < q->direct_qlen && cl) {
-@@ -698,25 +706,20 @@
-       } else {
-           kfree_skb (skb);
-           sch->stats.drops++;
--          DEVIK_MEND(0);
-           return NET_XMIT_DROP;
-       }
-     } else if (cl->un.leaf.q->enqueue(skb, cl->un.leaf.q) != NET_XMIT_SUCCESS) {
-       sch->stats.drops++;
-       cl->stats.drops++;
--      DEVIK_MEND(0);
-       return NET_XMIT_DROP;
-     } else {
-       cl->stats.packets++; cl->stats.bytes += skb->len;
--      DEVIK_MSTART(1);
-       htb_activate (q,cl);
--      DEVIK_MEND(1);
-     }
-     sch->q.qlen++;
-     sch->stats.packets++; sch->stats.bytes += skb->len;
--    HTB_DBG(1,1,"htb_enq_ok cl=%X skb=%p\n",cl?cl->classid:0,skb);
--    DEVIK_MEND(0);
-+    HTB_DBG(1,1,"htb_enq_ok cl=%X skb=%p\n",(cl && cl != HTB_DIRECT)?cl->classid:0,skb);
-     return NET_XMIT_SUCCESS;
- }
-@@ -725,16 +728,18 @@
- {
-     struct htb_sched *q = (struct htb_sched *)sch->data;
-     struct htb_class *cl = htb_classify(skb,sch);
-+    struct sk_buff *tskb;
-     if (cl == HTB_DIRECT || !cl) {
-       /* enqueue to helper queue */
-       if (q->direct_queue.qlen < q->direct_qlen && cl) {
--          __skb_queue_tail(&q->direct_queue, skb);
--          q->direct_pkts++;
-+          __skb_queue_head(&q->direct_queue, skb);
-       } else {
--          kfree_skb (skb);
--          sch->stats.drops++;
--          return NET_XMIT_DROP;
-+            __skb_queue_head(&q->direct_queue, skb);
-+            tskb = __skb_dequeue_tail(&q->direct_queue);
-+            kfree_skb (tskb);
-+            sch->stats.drops++;
-+            return NET_XMIT_CN;       
-       }
-     } else if (cl->un.leaf.q->ops->requeue(skb, cl->un.leaf.q) != NET_XMIT_SUCCESS) {
-       sch->stats.drops++;
-@@ -744,7 +749,7 @@
-           htb_activate (q,cl);
-     sch->q.qlen++;
--    HTB_DBG(1,1,"htb_req_ok cl=%X skb=%p\n",cl?cl->classid:0,skb);
-+    HTB_DBG(1,1,"htb_req_ok cl=%X skb=%p\n",(cl && cl != HTB_DIRECT)?cl->classid:0,skb);
-     return NET_XMIT_SUCCESS;
- }
-@@ -819,7 +824,7 @@
-                                      cl->classid, diff,
-                                      (unsigned long long) q->now,
-                                      (unsigned long long) cl->t_c,
--                                     jiffies);
-+                                     q->jiffies);
-                       diff = 1000;
-               }
- #endif
-@@ -862,6 +867,7 @@
-  *
-  * Scans event queue for pending events and applies them. Returns jiffies to
-  * next pending event (0 for no event in pq).
-+ * Note: Aplied are events whose have cl->pq_key <= jiffies.
-  */
- static long htb_do_events(struct htb_sched *q,int level)
- {
-@@ -876,9 +882,9 @@
-               while (p->rb_left) p = p->rb_left;
-               cl = rb_entry(p, struct htb_class, pq_node);
--              if (cl->pq_key - (jiffies+1) < 0x80000000) {
--                      HTB_DBG(8,3,"htb_do_ev_ret delay=%ld\n",cl->pq_key - jiffies);
--                      return cl->pq_key - jiffies;
-+              if (time_after(cl->pq_key, q->jiffies)) {
-+                      HTB_DBG(8,3,"htb_do_ev_ret delay=%ld\n",cl->pq_key - q->jiffies);
-+                      return cl->pq_key - q->jiffies;
-               }
-               htb_safe_rb_erase(p,q->wait_pq+level);
-               diff = PSCHED_TDIFF_SAFE(q->now, cl->t_c, (u32)cl->mbuffer, 0);
-@@ -889,7 +895,7 @@
-                                      cl->classid, diff,
-                                      (unsigned long long) q->now,
-                                      (unsigned long long) cl->t_c,
--                                     jiffies);
-+                                     q->jiffies);
-                       diff = 1000;
-               }
- #endif
-@@ -916,6 +922,7 @@
-               rb_node_t **pptr;
-       } stk[TC_HTB_MAXDEPTH],*sp = stk;
-       
-+      BUG_TRAP(tree->rb_node);
-       sp->root = tree->rb_node;
-       sp->pptr = pptr;
-@@ -949,16 +956,36 @@
- htb_dequeue_tree(struct htb_sched *q,int prio,int level)
- {
-       struct sk_buff *skb = NULL;
--      //struct htb_sched *q = (struct htb_sched *)sch->data;
-       struct htb_class *cl,*start;
-       /* look initial class up in the row */
--      DEVIK_MSTART(6);
-       start = cl = htb_lookup_leaf (q->row[level]+prio,prio,q->ptr[level]+prio);
-       
-       do {
--              BUG_TRAP(cl && cl->un.leaf.q->q.qlen); if (!cl) return NULL;
-+next:
-+              BUG_TRAP(cl); 
-+              if (!cl) return NULL;
-               HTB_DBG(4,1,"htb_deq_tr prio=%d lev=%d cl=%X defic=%d\n",
-                               prio,level,cl->classid,cl->un.leaf.deficit[level]);
-+
-+              /* class can be empty - it is unlikely but can be true if leaf
-+                 qdisc drops packets in enqueue routine or if someone used
-+                 graft operation on the leaf since last dequeue; 
-+                 simply deactivate and skip such class */
-+              if (unlikely(cl->un.leaf.q->q.qlen == 0)) {
-+                      struct htb_class *next;
-+                      htb_deactivate(q,cl);
-+
-+                      /* row/level might become empty */
-+                      if ((q->row_mask[level] & (1 << prio)) == 0)
-+                              return NULL; 
-+                      
-+                      next = htb_lookup_leaf (q->row[level]+prio,
-+                                      prio,q->ptr[level]+prio);
-+                      if (cl == start) /* fix start if we just deleted it */
-+                              start = next;
-+                      cl = next;
-+                      goto next;
-+              }
-       
-               if (likely((skb = cl->un.leaf.q->dequeue(cl->un.leaf.q)) != NULL)) 
-                       break;
-@@ -971,8 +998,6 @@
-               cl = htb_lookup_leaf (q->row[level]+prio,prio,q->ptr[level]+prio);
-       } while (cl != start);
--      DEVIK_MEND(6);
--      DEVIK_MSTART(7);
-       if (likely(skb != NULL)) {
-               if ((cl->un.leaf.deficit[level] -= skb->len) < 0) {
-                       HTB_DBG(4,2,"htb_next_cl oldptr=%p quant_add=%d\n",
-@@ -984,11 +1009,8 @@
-                  gives us slightly better performance */
-               if (!cl->un.leaf.q->q.qlen)
-                       htb_deactivate (q,cl);
--      DEVIK_MSTART(8);
-               htb_charge_class (q,cl,level,skb->len);
--      DEVIK_MEND(8);
-       }
--      DEVIK_MEND(7);
-       return skb;
- }
-@@ -1002,9 +1024,8 @@
-                       printk(KERN_INFO "HTB delay %ld > 5sec\n", delay);
-               delay = 5*HZ;
-       }
--      del_timer(&q->timer);
--      q->timer.expires = jiffies + delay;
--      add_timer(&q->timer);
-+      /* why don't use jiffies here ? because expires can be in past */
-+      mod_timer(&q->timer, q->jiffies + delay);
-       sch->flags |= TCQ_F_THROTTLED;
-       sch->stats.overlimits++;
-       HTB_DBG(3,1,"htb_deq t_delay=%ld\n",delay);
-@@ -1016,7 +1037,11 @@
-       struct htb_sched *q = (struct htb_sched *)sch->data;
-       int level;
-       long min_delay;
-+#ifdef HTB_DEBUG
-+      int evs_used = 0;
-+#endif
-+      q->jiffies = jiffies;
-       HTB_DBG(3,1,"htb_deq dircnt=%d qlen=%d\n",skb_queue_len(&q->direct_queue),
-                       sch->q.qlen);
-@@ -1027,27 +1052,26 @@
-               return skb;
-       }
--      DEVIK_MSTART(2);
-       if (!sch->q.qlen) goto fin;
-       PSCHED_GET_TIME(q->now);
--      min_delay = HZ*5;
-+      min_delay = LONG_MAX;
-       q->nwc_hit = 0;
-       for (level = 0; level < TC_HTB_MAXDEPTH; level++) {
-               /* common case optimization - skip event handler quickly */
-               int m;
-               long delay;
--      DEVIK_MSTART(3);
--              if (jiffies - q->near_ev_cache[level] < 0x80000000 || 0) {
-+              if (time_after_eq(q->jiffies, q->near_ev_cache[level])) {
-                       delay = htb_do_events(q,level);
--                      q->near_ev_cache[level] += delay ? delay : HZ;
-+                      q->near_ev_cache[level] = q->jiffies + (delay ? delay : HZ);
-+#ifdef HTB_DEBUG
-+                      evs_used++;
-+#endif
-               } else
--                      delay = q->near_ev_cache[level] - jiffies;      
-+                      delay = q->near_ev_cache[level] - q->jiffies;   
-               
-               if (delay && min_delay > delay) 
-                       min_delay = delay;
--      DEVIK_MEND(3);
--      DEVIK_MSTART(5);
-               m = ~q->row_mask[level];
-               while (m != (int)(-1)) {
-                       int prio = ffz (m);
-@@ -1056,29 +1080,29 @@
-                       if (likely(skb != NULL)) {
-                               sch->q.qlen--;
-                               sch->flags &= ~TCQ_F_THROTTLED;
--      DEVIK_MEND(5);
-                               goto fin;
-                       }
-               }
--      DEVIK_MEND(5);
-       }
--      DEVIK_MSTART(4);
- #ifdef HTB_DEBUG
--      if (!q->nwc_hit && min_delay >= 5*HZ && net_ratelimit()) { 
--              printk(KERN_ERR "HTB: mindelay=%ld, report it please !\n",min_delay);
--              htb_debug_dump(q);
-+      if (!q->nwc_hit && min_delay >= 10*HZ && net_ratelimit()) {
-+              if (min_delay == LONG_MAX) {
-+                      printk(KERN_ERR "HTB: dequeue bug (%d,%lu,%lu), report it please !\n",
-+                                      evs_used,q->jiffies,jiffies);
-+                      htb_debug_dump(q);
-+              } else 
-+                      printk(KERN_WARNING "HTB: mindelay=%ld, some class has "
-+                                      "too small rate\n",min_delay);
-       }
- #endif
--      htb_delay_by (sch,min_delay);
--      DEVIK_MEND(4);
-+      htb_delay_by (sch,min_delay > 5*HZ ? 5*HZ : min_delay);
- fin:
--      HTB_DBG(3,1,"htb_deq_end %s j=%lu skb=%p\n",sch->dev->name,jiffies,skb);
--      DEVIK_MEND(2);
-+      HTB_DBG(3,1,"htb_deq_end %s j=%lu skb=%p\n",sch->dev->name,q->jiffies,skb);
-       return skb;
- }
- /* try to drop from each class (by prio) until one succeed */
--static int htb_drop(struct Qdisc* sch)
-+static unsigned int htb_drop(struct Qdisc* sch)
- {
-       struct htb_sched *q = (struct htb_sched *)sch->data;
-       int prio;
-@@ -1086,14 +1110,15 @@
-       for (prio = TC_HTB_NUMPRIO - 1; prio >= 0; prio--) {
-               struct list_head *p;
-               list_for_each (p,q->drops+prio) {
--                      struct htb_class *cl = list_entry(p,struct htb_class,
--                                      un.leaf.drop_list);
-+                      struct htb_class *cl = list_entry(p, struct htb_class,
-+                                                        un.leaf.drop_list);
-+                      unsigned int len;
-                       if (cl->un.leaf.q->ops->drop && 
--                              cl->un.leaf.q->ops->drop(cl->un.leaf.q)) {
-+                              (len = cl->un.leaf.q->ops->drop(cl->un.leaf.q))) {
-                               sch->q.qlen--;
-                               if (!cl->un.leaf.q->q.qlen)
-                                       htb_deactivate (q,cl);
--                              return 1;
-+                              return len;
-                       }
-               }
-       }
-@@ -1208,7 +1233,8 @@
-       gopt.direct_pkts = q->direct_pkts;
- #ifdef HTB_DEBUG
--      htb_debug_dump(q);
-+      if (HTB_DBG_COND(0,2))
-+              htb_debug_dump(q);
- #endif
-       gopt.version = HTB_VER;
-       gopt.rate2quantum = q->rate2quantum;
-@@ -1289,6 +1315,9 @@
-                                       return -ENOBUFS;
-               sch_tree_lock(sch);
-               if ((*old = xchg(&cl->un.leaf.q, new)) != NULL) {
-+                      if (cl->prio_activity)
-+                              htb_deactivate ((struct htb_sched*)sch->data,cl);
-+
-                       /* TODO: is it correct ? Why CBQ doesn't do it ? */
-                       sch->q.qlen -= (*old)->q.qlen;  
-                       qdisc_reset(*old);
-@@ -1323,7 +1352,7 @@
-       while ((tp = *fl) != NULL) {
-               *fl = tp->next;
--              tp->ops->destroy(tp);
-+              tcf_destroy(tp);
-       }
- }
-@@ -1371,11 +1400,16 @@
- #ifdef HTB_RATECM
-       del_timer_sync (&q->rttim);
- #endif
-+      /* This line used to be after htb_destroy_class call below
-+         and surprisingly it worked in 2.4. But it must precede it 
-+         because filter need its target class alive to be able to call
-+         unbind_filter on it (without Oops). */
-+      htb_destroy_filters(&q->filter_list);
-+      
-       while (!list_empty(&q->root)) 
-               htb_destroy_class (sch,list_entry(q->root.next,
-                                       struct htb_class,sibling));
--      htb_destroy_filters(&q->filter_list);
-       __skb_queue_purge(&q->direct_queue);
-       MOD_DEC_USE_COUNT;
- }
-@@ -1438,12 +1472,13 @@
-       parent = parentid == TC_H_ROOT ? NULL : htb_find (parentid,sch);
-       hopt = RTA_DATA(tb[TCA_HTB_PARMS-1]);
--      HTB_DBG(0,1,"htb_chg cl=%p, clid=%X, opt/prio=%d, rate=%u, buff=%d, quant=%d\n", cl,cl?cl->classid:0,(int)hopt->prio,hopt->rate.rate,hopt->buffer,hopt->quantum);
-+      HTB_DBG(0,1,"htb_chg cl=%p(%X), clid=%X, parid=%X, opt/prio=%d, rate=%u, buff=%d, quant=%d\n", cl,cl?cl->classid:0,classid,parentid,(int)hopt->prio,hopt->rate.rate,hopt->buffer,hopt->quantum);
-       rtab = qdisc_get_rtab(&hopt->rate, tb[TCA_HTB_RTAB-1]);
-       ctab = qdisc_get_rtab(&hopt->ceil, tb[TCA_HTB_CTAB-1]);
-       if (!rtab || !ctab) goto failure;
-       if (!cl) { /* new class */
-+              struct Qdisc *new_q;
-               /* check for valid classid */
-               if (!classid || TC_H_MAJ(classid^sch->handle) || htb_find(classid,sch))
-                       goto failure;
-@@ -1467,6 +1502,10 @@
-               cl->magic = HTB_CMAGIC;
- #endif
-+              /* create leaf qdisc early because it uses kmalloc(GFP_KERNEL)
-+                 so that can't be used inside of sch_tree_lock
-+                 -- thanks to Karlis Peisenieks */
-+              new_q = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops);
-               sch_tree_lock(sch);
-               if (parent && !parent->level) {
-                       /* turn parent into inner node */
-@@ -1485,8 +1524,7 @@
-                       memset (&parent->un.inner,0,sizeof(parent->un.inner));
-               }
-               /* leaf (we) needs elementary qdisc */
--              if (!(cl->un.leaf.q = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops)))
--                      cl->un.leaf.q = &noop_qdisc;
-+              cl->un.leaf.q = new_q ? new_q : &noop_qdisc;
-               cl->classid = classid; cl->parent = parent;
-@@ -1514,11 +1552,11 @@
-       if (!cl->level) {
-               cl->un.leaf.quantum = rtab->rate.rate / q->rate2quantum;
-               if (!hopt->quantum && cl->un.leaf.quantum < 1000) {
--                      printk(KERN_WARNING "HTB: quantum of class %X is small. Consider r2q change.", cl->classid);
-+                      printk(KERN_WARNING "HTB: quantum of class %X is small. Consider r2q change.\n", cl->classid);
-                       cl->un.leaf.quantum = 1000;
-               }
-               if (!hopt->quantum && cl->un.leaf.quantum > 200000) {
--                      printk(KERN_WARNING "HTB: quantum of class %X is big. Consider r2q change.", cl->classid);
-+                      printk(KERN_WARNING "HTB: quantum of class %X is big. Consider r2q change.\n", cl->classid);
-                       cl->un.leaf.quantum = 200000;
-               }
-               if (hopt->quantum)
---- linux/include/net/pkt_cls.h        2003-07-04 01:12:28.000000000 -0700
-+++ linux.2.4.26/include/net/pkt_cls.h 2004-05-10 22:21:40.000000000 -0700
-@@ -77,7 +77,11 @@
-       return -1;
- }
--
-+static inline void tcf_destroy(struct tcf_proto *tp)
-+{
-+      tp->ops->destroy(tp);
-+      kfree(tp);
-+}
- extern int register_tcf_proto_ops(struct tcf_proto_ops *ops);
- extern int unregister_tcf_proto_ops(struct tcf_proto_ops *ops);
diff --git a/obsolete-buildroot/sources/openwrt/kernel/patches/120-openwrt.patch b/obsolete-buildroot/sources/openwrt/kernel/patches/120-openwrt.patch
deleted file mode 100644 (file)
index 4e543de..0000000
+++ /dev/null
@@ -1,2521 +0,0 @@
-diff -Nurb linux.orig/Makefile linux/Makefile
---- linux.orig/Makefile        2003-10-14 04:00:10.000000000 -0400
-+++ linux/Makefile     2004-05-25 21:12:24.000000000 -0400
-@@ -17,7 +17,7 @@
- FINDHPATH     = $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net $(HPATH)/math-emu
- HOSTCC        = gcc
--HOSTCFLAGS    = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
-+HOSTCFLAGS    = -Wall -Wstrict-prototypes -Os -fomit-frame-pointer
- CROSS_COMPILE         =
-@@ -88,7 +88,7 @@
- CPPFLAGS := -D__KERNEL__ -I$(HPATH)
--CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
-+CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -Os \
-         -fno-strict-aliasing -fno-common
- # Turn on -pg to instrument the kernel with calls to mcount().
-diff -Nurb linux.orig/arch/mips/brcm-boards/bcm947xx/setup.c linux/arch/mips/brcm-boards/bcm947xx/setup.c
---- linux.orig/arch/mips/brcm-boards/bcm947xx/setup.c  2003-11-11 09:08:46.000000000 -0500
-+++ linux/arch/mips/brcm-boards/bcm947xx/setup.c       2004-05-25 21:12:24.000000000 -0400
-@@ -27,6 +27,7 @@
- #include <linux/ext2_fs.h>
- #include <linux/romfs_fs.h>
- #include <linux/cramfs_fs.h>
-+#include <linux/squashfs_fs.h>
- #endif
- #include <typedefs.h>
-@@ -160,37 +161,38 @@
- #ifdef CONFIG_MTD_PARTITIONS
- static struct mtd_partition bcm947xx_parts[] = {
--      { name: "pmon", offset: 0, size: 0, /*mask_flags: MTD_WRITEABLE,*/ },
-+      { name: "pmon", offset: 0, size: 0, mask_flags: MTD_WRITEABLE, },
-       { name: "linux", offset: 0, size: 0, },
-       { name: "rootfs", offset: 0, size: 0, /*mask_flags: MTD_WRITEABLE,*/ },
-       { name: "nvram", offset: 0, size: 0, },
-+      { name: "OpenWrt", offset: 0, size: 0, },
-       { name: NULL, },
- };
--struct mtd_partition * __init
--init_mtd_partitions(struct mtd_info *mtd, size_t size)
-+
-+static int __init
-+find_root(struct mtd_info *mtd, size_t size, struct mtd_partition *part)
- {
--      struct minix_super_block *minixsb;
--      struct ext2_super_block *ext2sb;
--      struct romfs_super_block *romfsb;
-       struct cramfs_super *cramfsb;
-+      struct squashfs_super_block *squashfsb;
-       struct trx_header *trx;
-+
-       unsigned char buf[512];
-       int off;
-       size_t len;
--      minixsb = (struct minix_super_block *) buf;
--      ext2sb = (struct ext2_super_block *) buf;
--      romfsb = (struct romfs_super_block *) buf;
-       cramfsb = (struct cramfs_super *) buf;
-+      squashfsb = (struct squashfs_super_block *) buf;
-       trx = (struct trx_header *) buf;
--      /* Look at every 64 KB boundary */
--      for (off = 0; off < size; off += (64 * 1024)) {
-+      part->offset = 0;
-+      part->size = 0;
-+
-+      for (off = 0; off < size; off += mtd->erasesize) {
-               memset(buf, 0xe5, sizeof(buf));
-               /*
--               * Read block 0 to test for romfs and cramfs superblock
-+               * Read block 0 to test for cramfs superblock
-                */
-               if (MTD_READ(mtd, off, sizeof(buf), &len, buf) ||
-                   len != sizeof(buf))
-@@ -198,75 +200,105 @@
-               /* Try looking at TRX header for rootfs offset */
-               if (le32_to_cpu(trx->magic) == TRX_MAGIC) {
--                      bcm947xx_parts[1].offset = off;
-                       if (le32_to_cpu(trx->offsets[1]) > off)
-                               off = le32_to_cpu(trx->offsets[1]);
-                       continue;
-               }
--              /* romfs is at block zero too */
--              if (romfsb->word0 == ROMSB_WORD0 &&
--                  romfsb->word1 == ROMSB_WORD1) {
--                      printk(KERN_NOTICE
--                             "%s: romfs filesystem found at block %d\n",
--                             mtd->name, off / BLOCK_SIZE);
--                      goto done;
--              }
--
--              /* so is cramfs */
-+              /* need to find cramfs */
-               if (cramfsb->magic == CRAMFS_MAGIC) {
-                       printk(KERN_NOTICE
-                              "%s: cramfs filesystem found at block %d\n",
-                              mtd->name, off / BLOCK_SIZE);
--                      goto done;
--              }
--              /*
--               * Read block 1 to test for minix and ext2 superblock
--               */
--              if (MTD_READ(mtd, off + BLOCK_SIZE, sizeof(buf), &len, buf) ||
--                  len != sizeof(buf))
--                      continue;
--
--              /* Try minix */
--              if (minixsb->s_magic == MINIX_SUPER_MAGIC ||
--                  minixsb->s_magic == MINIX_SUPER_MAGIC2) {
--                      printk(KERN_NOTICE
--                             "%s: Minix filesystem found at block %d\n",
--                             mtd->name, off / BLOCK_SIZE);
-+                      part->size = cramfsb->size;
-                       goto done;
-               }
--              /* Try ext2 */
--              if (ext2sb->s_magic == cpu_to_le16(EXT2_SUPER_MAGIC)) {
-+              /* or squashfs */
-+              if (squashfsb->s_magic == SQUASHFS_MAGIC) {
-                       printk(KERN_NOTICE
--                             "%s: ext2 filesystem found at block %d\n",
-+                              "%s: squashfs filesystem found at block %d\n",
-                              mtd->name, off / BLOCK_SIZE);
-+                      part->size = squashfsb->bytes_used+2048;
-                       goto done;
-               }
--      }
-+      }
-       printk(KERN_NOTICE
--             "%s: Couldn't find valid ROM disk image\n",
-+             "%s: Couldn't find valid cramfs image\n",
-              mtd->name);
-+      return -1;
-+      
-+done:
-+      part->offset = off;
-+      return 0;
-+}
-+
-+
-+struct mtd_partition * __init
-+init_mtd_partitions(struct mtd_info *mtd, size_t size)
-+{
-+
-+      bcm947xx_parts[0].offset=0;
-+      bcm947xx_parts[0].size=256*1024;
-- done:
-       /* Find and size nvram */
-       bcm947xx_parts[3].offset = size - ROUNDUP(NVRAM_SPACE, mtd->erasesize);
-       bcm947xx_parts[3].size = size - bcm947xx_parts[3].offset;
-       /* Find and size rootfs */
--      if (off < size) {
--              bcm947xx_parts[2].offset = off;
--              bcm947xx_parts[2].size = bcm947xx_parts[3].offset - bcm947xx_parts[2].offset;
--      }
-+      //if (off < size) {
-+      //      bcm947xx_parts[2].offset = off;
-+      //      bcm947xx_parts[2].size = bcm947xx_parts[3].offset - bcm947xx_parts[2].offset;
-+      //}
-+
-+      /* Find and size rootfs */
-+      find_root(mtd,size,&bcm947xx_parts[2]);
-+      
-+
-       /* Size linux (kernel and rootfs) */
-+      bcm947xx_parts[1].offset = bcm947xx_parts[0].size;
-       bcm947xx_parts[1].size = bcm947xx_parts[3].offset - bcm947xx_parts[1].offset;
-+
-+
-+      /* calculate leftover flash, and assign it to the jffs partition */
-+      size_t spot;
-+      size_t len;
-+      size_t mask;
-+      //  get the offset to the end of the root_fs
-+      spot=bcm947xx_parts[2].offset+bcm947xx_parts[2].size;
-+      //  round it up to an erase size boundary
-+    spot+=mtd->erasesize-1;
-+      //  mask the number to the boundary
-+      mask=mtd->erasesize;
-+      mask=mask-1;
-+      mask=mask^0xffffffff;
-+      spot&=mask;
-+      //  length = flashsize - start position - nvram size
-+      len=size-spot;
-+      len=len-bcm947xx_parts[3].size;
-+      
-+
-+      bcm947xx_parts[4].offset = spot;
-+      bcm947xx_parts[4].size = len;
-+
-+
-+
-+
-       /* Size pmon */
-       bcm947xx_parts[0].size = bcm947xx_parts[1].offset - bcm947xx_parts[0].offset;
-+      //int x;
-+      //for(x=0; x<5; x++) {
-+      //      printk(KERN_NOTICE
-+      //                 "Partition %d mask_flags %08x\n",
-+      //                 x,bcm947xx_parts[x].mask_flags);
-+      //}
-+
-+
-       return bcm947xx_parts;
- }
-diff -Nurb linux.orig/drivers/mtd/maps/bcm947xx-flash.c linux/drivers/mtd/maps/bcm947xx-flash.c
---- linux.orig/drivers/mtd/maps/bcm947xx-flash.c       2003-11-08 04:35:52.000000000 -0500
-+++ linux/drivers/mtd/maps/bcm947xx-flash.c    2004-05-25 21:12:24.000000000 -0400
-@@ -82,7 +82,21 @@
- void bcm947xx_map_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
- {
-+      //memcpy_fromio(to, map->map_priv_1 + from, len);
-+      if (len==1) {
-       memcpy_fromio(to, map->map_priv_1 + from, len);
-+      } else {
-+              int i;
-+              u16 *dest = (u16 *) to;
-+              u16 *src  = (u16 *) (map->map_priv_1 + from);
-+
-+              for (i = 0; i < (len / 2); i++) {
-+                      dest[i] = src[i];
-+              }
-+
-+              if (len & 1)
-+                      *((u8 *)dest+len-1) = src[i] & 0xff;
-+      }
- }
- void bcm947xx_map_write8(struct map_info *map, __u8 d, unsigned long adr)
-diff -Nurb linux.orig/drivers/net/Makefile linux/drivers/net/Makefile
---- linux.orig/drivers/net/Makefile    2004-02-12 21:35:15.000000000 -0500
-+++ linux/drivers/net/Makefile 2004-05-25 21:12:24.000000000 -0400
-@@ -25,7 +25,7 @@
- list-multi    :=      rcpci.o
- rcpci-objs    :=      rcpci45.o rclanmtl.o
--subdir-m += mac
-+# subdir-m += mac
- subdir-m += diag
- ifeq ($(CONFIG_HW_QOS),y)
-diff -Nurb linux.orig/fs/Config.in linux/fs/Config.in
---- linux.orig/fs/Config.in    2003-07-04 04:12:05.000000000 -0400
-+++ linux/fs/Config.in 2004-05-25 21:13:03.000000000 -0400
-@@ -47,6 +47,7 @@
-    int 'JFFS2 debugging verbosity (0 = quiet, 2 = noisy)' CONFIG_JFFS2_FS_DEBUG 0
- fi
- tristate 'Compressed ROM file system support' CONFIG_CRAMFS
-+tristate 'Squashed file system support' CONFIG_SQUASHFS
- bool 'Virtual memory file system support (former shm fs)' CONFIG_TMPFS
- define_bool CONFIG_RAMFS y
-diff -Nurb linux.orig/fs/Makefile linux/fs/Makefile
---- linux.orig/fs/Makefile     2003-07-04 04:12:05.000000000 -0400
-+++ linux/fs/Makefile  2004-05-25 21:13:03.000000000 -0400
-@@ -68,6 +68,7 @@
- subdir-$(CONFIG_SUN_OPENPROMFS)       += openpromfs
- subdir-$(CONFIG_BEFS_FS)      += befs
- subdir-$(CONFIG_JFS_FS)               += jfs
-+subdir-$(CONFIG_SQUASHFS)     += squashfs
- obj-$(CONFIG_BINFMT_AOUT)     += binfmt_aout.o
-diff -Nurb linux.orig/fs/squashfs/Makefile linux/fs/squashfs/Makefile
---- linux.orig/fs/squashfs/Makefile    1969-12-31 19:00:00.000000000 -0500
-+++ linux/fs/squashfs/Makefile 2004-05-25 21:13:03.000000000 -0400
-@@ -0,0 +1,11 @@
-+#
-+# Makefile for the linux squashfs routines.
-+#
-+
-+O_TARGET := squashfs.o
-+
-+obj-y  := inode.o
-+
-+obj-m := $(O_TARGET)
-+
-+include $(TOPDIR)/Rules.make
-diff -Nurb linux.orig/fs/squashfs/inode.c linux/fs/squashfs/inode.c
---- linux.orig/fs/squashfs/inode.c     1969-12-31 19:00:00.000000000 -0500
-+++ linux/fs/squashfs/inode.c  2004-05-25 21:13:03.000000000 -0400
-@@ -0,0 +1,1515 @@
-+/*
-+ * Squashfs - a compressed read only filesystem for Linux
-+ *
-+ * Copyright (c) 2002, 2003, 2004 Phillip Lougher <plougher@users.sourceforge.net>
-+ *
-+ * 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,
-+ * or (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+ * Squashfs - a compressed read only filesystem for Linux
-+ *
-+ * inode.c
-+ */
-+
-+#define SQUASHFS_1_0_COMPATIBILITY
-+
-+#include <linux/types.h>
-+#include <linux/squashfs_fs.h>
-+#include <linux/module.h>
-+#include <linux/errno.h>
-+#include <linux/slab.h>
-+#include <linux/fs.h>
-+#include <linux/locks.h>
-+#include <linux/init.h>
-+#include <linux/dcache.h>
-+#include <asm/uaccess.h>
-+#include <linux/wait.h>
-+#include <asm/semaphore.h>
-+#include <linux/zlib.h>
-+#include <linux/blkdev.h>
-+#include <linux/vmalloc.h>
-+
-+#ifdef SQUASHFS_TRACE
-+#define TRACE(s, args...)                             printk(KERN_NOTICE "SQUASHFS: "s, ## args)
-+#else
-+#define TRACE(s, args...)                             {}
-+#endif
-+
-+#define ERROR(s, args...)                             printk(KERN_ERR "SQUASHFS error: "s, ## args)
-+
-+#define SERROR(s, args...)                            if(!silent) printk(KERN_ERR "SQUASHFS error: "s, ## args)
-+#define WARNING(s, args...)                           printk(KERN_WARNING "SQUASHFS: "s, ## args)
-+
-+static struct super_block *squashfs_read_super(struct super_block *, void *, int);
-+static void squashfs_put_super(struct super_block *);
-+static int squashfs_statfs(struct super_block *, struct statfs *);
-+static int squashfs_symlink_readpage(struct file *file, struct page *page);
-+static int squashfs_readpage(struct file *file, struct page *page);
-+static int squashfs_readpage4K(struct file *file, struct page *page);
-+static int squashfs_readdir(struct file *, void *, filldir_t);
-+static struct dentry *squashfs_lookup(struct inode *, struct dentry *);
-+static unsigned int read_data(struct super_block *s, char *buffer,
-+              unsigned int index, unsigned int length, int, unsigned int *next_index);
-+static int squashfs_get_cached_block(struct super_block *s, char *buffer,
-+              unsigned int block, unsigned int offset, int length,
-+              unsigned int *next_block, unsigned int *next_offset);
-+static struct inode *squashfs_iget(struct super_block *s, squashfs_inode inode);
-+static unsigned int read_blocklist(struct inode *inode, int index, int readahead_blks,
-+              char *block_list, char **block_p, unsigned int *bsize);
-+static void squashfs_put_super(struct super_block *s);
-+
-+#ifdef SQUASHFS_1_0_COMPATIBILITY
-+static int squashfs_readpage_lessthan4K(struct file *file, struct page *page);
-+static struct inode *squashfs_iget_1(struct super_block *s, squashfs_inode inode);
-+static unsigned int read_blocklist_1(struct inode *inode, int index, int readahead_blks,
-+              char *block_list, char **block_p, unsigned int *bsize);
-+#endif
-+
-+DECLARE_MUTEX(read_data_mutex);
-+
-+static z_stream stream;
-+
-+static DECLARE_FSTYPE_DEV(squashfs_fs_type, "squashfs", squashfs_read_super);
-+
-+static unsigned char squashfs_filetype_table[] = {
-+      DT_UNKNOWN, DT_DIR, DT_REG, DT_LNK, DT_BLK, DT_CHR, DT_FIFO, DT_SOCK
-+};
-+
-+static struct super_operations squashfs_ops = {
-+      statfs: squashfs_statfs,
-+      put_super: squashfs_put_super,
-+};
-+
-+static struct address_space_operations squashfs_symlink_aops = {
-+      readpage: squashfs_symlink_readpage
-+};
-+
-+static struct address_space_operations squashfs_aops = {
-+      readpage: squashfs_readpage
-+};
-+
-+static struct address_space_operations squashfs_aops_4K = {
-+      readpage: squashfs_readpage4K
-+};
-+
-+#ifdef SQUASHFS_1_0_COMPATIBILITY
-+static struct address_space_operations squashfs_aops_lessthan4K = {
-+      readpage: squashfs_readpage_lessthan4K
-+};
-+#endif
-+
-+static struct file_operations squashfs_dir_ops = {
-+      read: generic_read_dir,
-+      readdir: squashfs_readdir
-+};
-+
-+static struct inode_operations squashfs_dir_inode_ops = {
-+      lookup: squashfs_lookup
-+};
-+
-+
-+static unsigned int read_data(struct super_block *s, char *buffer,
-+              unsigned int index, unsigned int length, int datablock, unsigned int *next_index)
-+{
-+      squashfs_sb_info *msBlk = &s->u.squashfs_sb;
-+      struct buffer_head *bh[((SQUASHFS_FILE_MAX_SIZE - 1) >> msBlk->devblksize_log2) + 2];
-+      unsigned int offset = index & ((1 << msBlk->devblksize_log2) - 1);
-+      unsigned int cur_index = index >> msBlk->devblksize_log2;
-+      int bytes, avail_bytes, b, k;
-+      char *c_buffer;
-+      unsigned int compressed;
-+      unsigned int c_byte = length;
-+
-+      if(c_byte) {
-+              bytes = msBlk->devblksize - offset;
-+              if(datablock) {
-+                      c_buffer = (compressed = SQUASHFS_COMPRESSED_BLOCK(c_byte)) ? msBlk->read_data : buffer;
-+                      c_byte = SQUASHFS_COMPRESSED_SIZE_BLOCK(c_byte);
-+              } else {
-+                      c_buffer = (compressed = SQUASHFS_COMPRESSED(c_byte)) ? msBlk->read_data : buffer;
-+                      c_byte = SQUASHFS_COMPRESSED_SIZE(c_byte);
-+              }
-+
-+              TRACE("Block @ 0x%x, %scompressed size %d\n", index, compressed ? "" : "un", (unsigned int) c_byte);
-+
-+              if(!(bh[0] = sb_getblk(s, cur_index)))
-+                      goto block_release;
-+              for(b = 1; bytes < c_byte; b++) {
-+                      if(!(bh[b] = sb_getblk(s, ++cur_index)))
-+                              goto block_release;
-+                      bytes += msBlk->devblksize;
-+              }
-+              ll_rw_block(READ, b, bh);
-+      } else {
-+              unsigned short temp;
-+              if(!(bh[0] = sb_bread(s, cur_index)))
-+                      goto read_failure;
-+
-+              if(msBlk->devblksize - offset == 1) {
-+                      if(msBlk->swap)
-+                              ((unsigned char *) &temp)[1] = *((unsigned char *) (bh[0]->b_data + offset));
-+                      else
-+                              ((unsigned char *) &temp)[0] = *((unsigned char *) (bh[0]->b_data + offset));
-+                      brelse(bh[0]);
-+                      if(!(bh[0] = sb_bread(s, ++cur_index)))
-+                              goto read_failure;
-+                      if(msBlk->swap)
-+                              ((unsigned char *) &temp)[0] = *((unsigned char *) bh[0]->b_data); 
-+                      else
-+                              ((unsigned char *) &temp)[1] = *((unsigned char *) bh[0]->b_data); 
-+                      c_byte = temp;
-+                      offset = 1;
-+              }
-+              else {
-+                      if(msBlk->swap) {
-+                              unsigned short temp;
-+                              ((unsigned char *) &temp)[1] = *((unsigned char *) (bh[0]->b_data + offset));
-+                              ((unsigned char *) &temp)[0] = *((unsigned char *) (bh[0]->b_data + offset + 1)); 
-+                              c_byte = temp;
-+                      } else
-+                              c_byte = *((unsigned short *) (bh[0]->b_data + offset));
-+                      offset += 2;
-+              }
-+              if(SQUASHFS_CHECK_DATA(msBlk->sBlk.flags)) {
-+                      if(offset == msBlk->devblksize) {
-+                              brelse(bh[0]);
-+                              if(!(bh[0] = sb_bread(s, ++cur_index)))
-+                                      goto read_failure;
-+                              offset = 0;
-+                      }
-+                      if(*((unsigned char *) (bh[0]->b_data + offset)) != SQUASHFS_MARKER_BYTE) {
-+                              ERROR("Metadata block marker corrupt @ %x\n", index);
-+                              brelse(bh[0]);
-+                              return 0;
-+                      }
-+                      offset ++;
-+              }
-+
-+              bytes = msBlk->devblksize - offset;
-+              if(datablock) {
-+                      c_buffer = (compressed = SQUASHFS_COMPRESSED_BLOCK(c_byte)) ? msBlk->read_data : buffer;
-+                      c_byte = SQUASHFS_COMPRESSED_SIZE_BLOCK(c_byte);
-+              } else {
-+                      c_buffer = (compressed = SQUASHFS_COMPRESSED(c_byte)) ? msBlk->read_data : buffer;
-+                      c_byte = SQUASHFS_COMPRESSED_SIZE(c_byte);
-+              }
-+
-+              TRACE("Block @ 0x%x, %scompressed size %d\n", index, compressed ? "" : "un", (unsigned int) c_byte);
-+
-+              for(b = 1; bytes < c_byte; b++) {
-+                      if(!(bh[b] = sb_getblk(s, ++cur_index)))
-+                              goto block_release;
-+                      bytes += msBlk->devblksize;
-+              }
-+              ll_rw_block(READ, b - 1, bh + 1);
-+      }
-+
-+      if(compressed)
-+              down(&read_data_mutex);
-+
-+      for(bytes = 0, k = 0; k < b; k++) {
-+              avail_bytes = (c_byte - bytes) > (msBlk->devblksize - offset) ? msBlk->devblksize - offset : c_byte - bytes;
-+              wait_on_buffer(bh[k]);
-+              memcpy(c_buffer + bytes, bh[k]->b_data + offset, avail_bytes);
-+              bytes += avail_bytes;
-+              offset = 0;
-+              brelse(bh[k]);
-+      }
-+
-+      /*
-+       * uncompress block
-+       */
-+      if(compressed) {
-+              int zlib_err;
-+
-+              stream.next_in = c_buffer;
-+              stream.avail_in = c_byte;
-+              stream.next_out = buffer;
-+              stream.avail_out = msBlk->read_size;
-+              if(((zlib_err = zlib_inflateInit(&stream)) != Z_OK) ||
-+                              ((zlib_err = zlib_inflate(&stream, Z_FINISH)) != Z_STREAM_END) ||
-+                              ((zlib_err = zlib_inflateEnd(&stream)) != Z_OK)) {
-+                      ERROR("zlib_fs returned unexpected result 0x%x\n", zlib_err);
-+                      bytes = 0;
-+              } else
-+                      bytes = stream.total_out;
-+              up(&read_data_mutex);
-+      }
-+
-+      if(next_index)
-+              *next_index = index + c_byte + (length ? 0 : (SQUASHFS_CHECK_DATA(msBlk->sBlk.flags) ? 3 : 2));
-+
-+      return bytes;
-+
-+block_release:
-+      while(--b >= 0) brelse(bh[b]);
-+
-+read_failure:
-+      ERROR("sb_bread failed reading block 0x%x\n", cur_index);
-+      return 0;
-+}
-+
-+
-+static int squashfs_get_cached_block(struct super_block *s, char *buffer,
-+              unsigned int block, unsigned int offset, int length,
-+              unsigned int *next_block, unsigned int *next_offset)
-+{
-+      squashfs_sb_info *msBlk = &s->u.squashfs_sb;
-+      int n, i, bytes, return_length = length;
-+      unsigned int next_index;
-+
-+      TRACE("Entered squashfs_get_cached_block [%x:%x]\n", block, offset);
-+
-+      for(;;) {
-+              for(i = 0; i < SQUASHFS_CACHED_BLKS; i++) 
-+                      if(msBlk->block_cache[i].block == block)
-+                              break; 
-+              
-+              down(&msBlk->block_cache_mutex);
-+              if(i == SQUASHFS_CACHED_BLKS) {
-+                      /* read inode header block */
-+                      for(i = msBlk->next_cache, n = SQUASHFS_CACHED_BLKS; n ; n --, i = (i + 1) % SQUASHFS_CACHED_BLKS)
-+                              if(msBlk->block_cache[i].block != SQUASHFS_USED_BLK)
-+                                      break;
-+                      if(n == 0) {
-+                              up(&msBlk->block_cache_mutex);
-+                              sleep_on(&msBlk->waitq);
-+                              continue;
-+                      }
-+                      msBlk->next_cache = (i + 1) % SQUASHFS_CACHED_BLKS;
-+
-+                      if(msBlk->block_cache[i].block == SQUASHFS_INVALID_BLK) {
-+                              if(!(msBlk->block_cache[i].data = (unsigned char *)
-+                                                      kmalloc(SQUASHFS_METADATA_SIZE, GFP_KERNEL))) {
-+                                      ERROR("Failed to allocate cache block\n");
-+                                      up(&msBlk->block_cache_mutex);
-+                                      return 0;
-+                              }
-+                      }
-+      
-+                      msBlk->block_cache[i].block = SQUASHFS_USED_BLK;
-+                      up(&msBlk->block_cache_mutex);
-+                      if(!(msBlk->block_cache[i].length = read_data(s, msBlk->block_cache[i].data, block, 0, 0,
-+                                                      &next_index))) {
-+                              ERROR("Unable to read cache block [%x:%x]\n", block, offset);
-+                              return 0;
-+                      }
-+                      down(&msBlk->block_cache_mutex);
-+                      wake_up(&msBlk->waitq);
-+                      msBlk->block_cache[i].block = block;
-+                      msBlk->block_cache[i].next_index = next_index;
-+                      TRACE("Read cache block [%x:%x]\n", block, offset);
-+              }
-+
-+              if(msBlk->block_cache[i].block != block) {
-+                      up(&msBlk->block_cache_mutex);
-+                      continue;
-+              }
-+
-+              if((bytes = msBlk->block_cache[i].length - offset) >= length) {
-+                      if(buffer)
-+                              memcpy(buffer, msBlk->block_cache[i].data + offset, length);
-+                      if(msBlk->block_cache[i].length - offset == length) {
-+                              *next_block = msBlk->block_cache[i].next_index;
-+                              *next_offset = 0;
-+                      } else {
-+                              *next_block = block;
-+                              *next_offset = offset + length;
-+                      }
-+      
-+                      up(&msBlk->block_cache_mutex);
-+                      return return_length;
-+              } else {
-+                      if(buffer) {
-+                              memcpy(buffer, msBlk->block_cache[i].data + offset, bytes);
-+                              buffer += bytes;
-+                      }
-+                      block = msBlk->block_cache[i].next_index;
-+                      up(&msBlk->block_cache_mutex);
-+                      length -= bytes;
-+                      offset = 0;
-+              }
-+      }
-+}
-+
-+
-+static int get_fragment_location(struct super_block *s, unsigned int fragment, unsigned int *fragment_start_block, unsigned int *fragment_size)
-+{
-+      squashfs_sb_info *msBlk = &s->u.squashfs_sb;
-+      unsigned int start_block = msBlk->fragment_index[SQUASHFS_FRAGMENT_INDEX(fragment)];
-+      int offset = SQUASHFS_FRAGMENT_INDEX_OFFSET(fragment);
-+      squashfs_fragment_entry fragment_entry;
-+
-+      if(msBlk->swap) {
-+              squashfs_fragment_entry sfragment_entry;
-+
-+              if(!squashfs_get_cached_block(s, (char *) &sfragment_entry, start_block, offset,
-+                                      sizeof(sfragment_entry), &start_block, &offset))
-+                      return 0;
-+              SQUASHFS_SWAP_FRAGMENT_ENTRY(&fragment_entry, &sfragment_entry);
-+      } else
-+              if(!squashfs_get_cached_block(s, (char *) &fragment_entry, start_block, offset,
-+                                      sizeof(fragment_entry), &start_block, &offset))
-+                      return 0;
-+
-+      *fragment_start_block = fragment_entry.start_block;
-+      *fragment_size = fragment_entry.size;
-+
-+      return 1;
-+}
-+
-+
-+void release_cached_fragment(squashfs_sb_info *msBlk, struct squashfs_fragment_cache *fragment)
-+{
-+      down(&msBlk->fragment_mutex);
-+      fragment->locked --;
-+      wake_up(&msBlk->fragment_wait_queue);
-+      up(&msBlk->fragment_mutex);
-+}
-+
-+
-+struct squashfs_fragment_cache *get_cached_fragment(struct super_block *s, unsigned int start_block, int length)
-+{
-+      int i, n;
-+      squashfs_sb_info *msBlk = &s->u.squashfs_sb;
-+
-+      for(;;) {
-+              down(&msBlk->fragment_mutex);
-+              for(i = 0; i < SQUASHFS_CACHED_FRAGMENTS && msBlk->fragment[i].block != start_block; i++);
-+              if(i == SQUASHFS_CACHED_FRAGMENTS) {
-+                      for(i = msBlk->next_fragment, n = SQUASHFS_CACHED_FRAGMENTS;
-+                              n && msBlk->fragment[i].locked; n--, i = (i + 1) % SQUASHFS_CACHED_FRAGMENTS);
-+
-+                      if(n == 0) {
-+                              up(&msBlk->fragment_mutex);
-+                              sleep_on(&msBlk->fragment_wait_queue);
-+                              continue;
-+                      }
-+                      msBlk->next_fragment = (msBlk->next_fragment + 1) % SQUASHFS_CACHED_FRAGMENTS;
-+                      
-+                      if(msBlk->fragment[i].data == NULL)
-+                              if(!(msBlk->fragment[i].data = (unsigned char *)
-+                                                      kmalloc(SQUASHFS_FILE_MAX_SIZE, GFP_KERNEL))) {
-+                                      ERROR("Failed to allocate fragment cache block\n");
-+                                      up(&msBlk->fragment_mutex);
-+                                      return NULL;
-+                              }
-+
-+                      msBlk->fragment[i].block = SQUASHFS_INVALID_BLK;
-+                      msBlk->fragment[i].locked = 1;
-+                      up(&msBlk->fragment_mutex);
-+                      if(!(msBlk->fragment[i].length = read_data(s, msBlk->fragment[i].data, start_block, length,
-+                                                      1, NULL))) {
-+                              ERROR("Unable to read fragment cache block [%x]\n", start_block);
-+                              msBlk->fragment[i].locked = 0;
-+                              return NULL;
-+                      }
-+                      msBlk->fragment[i].block = start_block;
-+                      TRACE("New fragment %d, start block %d, locked %d\n", i, msBlk->fragment[i].block, msBlk->fragment[i].locked);
-+                      return &msBlk->fragment[i];
-+              }
-+
-+              msBlk->fragment[i].locked ++;
-+              up(&msBlk->fragment_mutex);
-+              
-+              TRACE("Got fragment %d, start block %d, locked %d\n", i, msBlk->fragment[i].block, msBlk->fragment[i].locked);
-+              return &msBlk->fragment[i];
-+      }
-+}
-+
-+
-+#ifdef SQUASHFS_1_0_COMPATIBILITY
-+static struct inode *squashfs_iget_1(struct super_block *s, squashfs_inode inode)
-+{
-+      struct inode *i = new_inode(s);
-+      squashfs_sb_info *msBlk = &s->u.squashfs_sb;
-+      squashfs_super_block *sBlk = &msBlk->sBlk;
-+      unsigned int block = SQUASHFS_INODE_BLK(inode) + sBlk->inode_table_start;
-+      unsigned int offset = SQUASHFS_INODE_OFFSET(inode);
-+      unsigned int next_block, next_offset;
-+      squashfs_base_inode_header_1 inodeb;
-+
-+      TRACE("Entered squashfs_iget_1\n");
-+
-+      if(msBlk->swap) {
-+              squashfs_base_inode_header_1 sinodeb;
-+
-+              if(!squashfs_get_cached_block(s, (char *) &sinodeb, block,  offset,
-+                                      sizeof(sinodeb), &next_block, &next_offset))
-+                      goto failed_read;
-+              SQUASHFS_SWAP_BASE_INODE_HEADER_1(&inodeb, &sinodeb, sizeof(sinodeb));
-+      } else
-+              if(!squashfs_get_cached_block(s, (char *) &inodeb, block,  offset,
-+                                      sizeof(inodeb), &next_block, &next_offset))
-+                      goto failed_read;
-+
-+      i->i_nlink = 1;
-+
-+      i->i_mtime = sBlk->mkfs_time;
-+      i->i_atime = sBlk->mkfs_time;
-+      i->i_ctime = sBlk->mkfs_time;
-+
-+      if(inodeb.inode_type != SQUASHFS_IPC_TYPE)
-+              i->i_uid = msBlk->uid[((inodeb.inode_type - 1) / SQUASHFS_TYPES) * 16 + inodeb.uid];
-+      i->i_ino = SQUASHFS_MK_VFS_INODE(block - sBlk->inode_table_start, offset);
-+
-+      i->i_mode = inodeb.mode;
-+
-+      switch(inodeb.inode_type == SQUASHFS_IPC_TYPE ? SQUASHFS_IPC_TYPE : (inodeb.inode_type - 1) % SQUASHFS_TYPES + 1) {
-+              case SQUASHFS_FILE_TYPE: {
-+                      squashfs_reg_inode_header_1 inodep;
-+
-+                      if(msBlk->swap) {
-+                              squashfs_reg_inode_header_1 sinodep;
-+
-+                              if(!squashfs_get_cached_block(s, (char *) &sinodep, block,  offset, sizeof(sinodep),
-+                                                      &next_block, &next_offset))
-+                                      goto failed_read;
-+                              SQUASHFS_SWAP_REG_INODE_HEADER_1(&inodep, &sinodep);
-+                      } else
-+                              if(!squashfs_get_cached_block(s, (char *) &inodep, block,  offset, sizeof(inodep),
-+                                                      &next_block, &next_offset))
-+                                      goto failed_read;
-+
-+                      i->i_size = inodep.file_size;
-+                      i->i_fop = &generic_ro_fops;
-+                      if(sBlk->block_size > 4096)
-+                              i->i_data.a_ops = &squashfs_aops;
-+                      else if(sBlk->block_size == 4096)
-+                              i->i_data.a_ops = &squashfs_aops_4K;
-+                      else
-+                              i->i_data.a_ops = &squashfs_aops_lessthan4K;
-+                      i->i_mode |= S_IFREG;
-+                      i->i_mtime = inodep.mtime;
-+                      i->i_atime = inodep.mtime;
-+                      i->i_ctime = inodep.mtime;
-+                      i->i_blocks = ((i->i_size - 1) >> 9) + 1;
-+                      i->i_blksize = PAGE_CACHE_SIZE;
-+                      i->u.squashfs_i.fragment_start_block = SQUASHFS_INVALID_BLK;
-+                      i->u.squashfs_i.fragment_offset = 0;
-+                      i->u.squashfs_i.start_block = inodep.start_block;
-+                      i->u.squashfs_i.block_list_start = next_block;
-+                      i->u.squashfs_i.offset = next_offset;
-+                      TRACE("File inode %x:%x, start_block %x, block_list_start %x, offset %x\n",
-+                                      SQUASHFS_INODE_BLK(inode), offset, inodep.start_block, next_block, next_offset);
-+                      break;
-+              }
-+              case SQUASHFS_DIR_TYPE: {
-+                      squashfs_dir_inode_header_1 inodep;
-+
-+                      if(msBlk->swap) {
-+                              squashfs_dir_inode_header_1 sinodep;
-+
-+                              if(!squashfs_get_cached_block(s, (char *) &sinodep, block,  offset, sizeof(sinodep),
-+                                                      &next_block, &next_offset))
-+                                      goto failed_read;
-+                              SQUASHFS_SWAP_DIR_INODE_HEADER_1(&inodep, &sinodep);
-+                      } else
-+                              if(!squashfs_get_cached_block(s, (char *) &inodep, block,  offset, sizeof(inodep),
-+                                                      &next_block, &next_offset))
-+                                      goto failed_read;
-+
-+                      i->i_size = inodep.file_size;
-+                      i->i_op = &squashfs_dir_inode_ops;
-+                      i->i_fop = &squashfs_dir_ops;
-+                      i->i_mode |= S_IFDIR;
-+                      i->i_mtime = inodep.mtime;
-+                      i->i_atime = inodep.mtime;
-+                      i->i_ctime = inodep.mtime;
-+                      i->u.squashfs_i.start_block = inodep.start_block;
-+                      i->u.squashfs_i.offset = inodep.offset;
-+                      TRACE("Directory inode %x:%x, start_block %x, offset %x\n", SQUASHFS_INODE_BLK(inode), offset,
-+                                      inodep.start_block, inodep.offset);
-+                      break;
-+              }
-+              case SQUASHFS_SYMLINK_TYPE: {
-+                      squashfs_symlink_inode_header_1 inodep;
-+      
-+                      if(msBlk->swap) {
-+                              squashfs_symlink_inode_header_1 sinodep;
-+
-+                              if(!squashfs_get_cached_block(s, (char *) &sinodep, block,  offset, sizeof(sinodep),
-+                                                      &next_block, &next_offset))
-+                                      goto failed_read;
-+                              SQUASHFS_SWAP_SYMLINK_INODE_HEADER_1(&inodep, &sinodep);
-+                      } else
-+                              if(!squashfs_get_cached_block(s, (char *) &inodep, block,  offset, sizeof(inodep),
-+                                                      &next_block, &next_offset))
-+                                      goto failed_read;
-+
-+                      i->i_size = inodep.symlink_size;
-+                      i->i_op = &page_symlink_inode_operations;
-+                      i->i_data.a_ops = &squashfs_symlink_aops;
-+                      i->i_mode |= S_IFLNK;
-+                      i->u.squashfs_i.start_block = next_block;
-+                      i->u.squashfs_i.offset = next_offset;
-+                      TRACE("Symbolic link inode %x:%x, start_block %x, offset %x\n",
-+                              SQUASHFS_INODE_BLK(inode), offset, next_block, next_offset);
-+                      break;
-+               }
-+               case SQUASHFS_BLKDEV_TYPE:
-+               case SQUASHFS_CHRDEV_TYPE: {
-+                      squashfs_dev_inode_header_1 inodep;
-+
-+                      if(msBlk->swap) {
-+                              squashfs_dev_inode_header_1 sinodep;
-+
-+                              if(!squashfs_get_cached_block(s, (char *) &sinodep, block,  offset, sizeof(sinodep),
-+                                                      &next_block, &next_offset))
-+                                      goto failed_read;
-+                              SQUASHFS_SWAP_DEV_INODE_HEADER_1(&inodep, &sinodep);
-+                      } else  
-+                              if(!squashfs_get_cached_block(s, (char *) &inodep, block,  offset, sizeof(inodep),
-+                                                      &next_block, &next_offset))
-+                                      goto failed_read;
-+
-+                      i->i_size = 0;
-+                      i->i_mode |= (inodeb.inode_type == SQUASHFS_CHRDEV_TYPE) ? S_IFCHR : S_IFBLK;
-+                      init_special_inode(i, i->i_mode, inodep.rdev);
-+                      TRACE("Device inode %x:%x, rdev %x\n", SQUASHFS_INODE_BLK(inode), offset, inodep.rdev);
-+                      break;
-+               }
-+               case SQUASHFS_IPC_TYPE: {
-+                      squashfs_ipc_inode_header_1 inodep;
-+
-+                      if(msBlk->swap) {
-+                              squashfs_ipc_inode_header_1 sinodep;
-+
-+                              if(!squashfs_get_cached_block(s, (char *) &sinodep, block,  offset, sizeof(sinodep),
-+                                                      &next_block, &next_offset))
-+                                      goto failed_read;
-+                              SQUASHFS_SWAP_IPC_INODE_HEADER_1(&inodep, &sinodep);
-+                      } else  
-+                              if(!squashfs_get_cached_block(s, (char *) &inodep, block,  offset, sizeof(inodep),
-+                                                      &next_block, &next_offset))
-+                                      goto failed_read;
-+
-+                      i->i_size = 0;
-+                      i->i_mode |= (inodep.type == SQUASHFS_FIFO_TYPE) ? S_IFIFO : S_IFSOCK;
-+                      i->i_uid = msBlk->uid[inodep.offset * 16 + inodeb.uid];
-+                      init_special_inode(i, i->i_mode, 0);
-+                      break;
-+               }
-+               default:
-+                      ERROR("Unknown inode type %d in squashfs_iget!\n", inodeb.inode_type);
-+                              goto failed_read1;
-+      }
-+      
-+      if(inodeb.guid == SQUASHFS_GUIDS)
-+              i->i_gid = i->i_uid;
-+      else
-+              i->i_gid = msBlk->guid[inodeb.guid];
-+
-+      return i;
-+
-+failed_read:
-+      ERROR("Unable to read inode [%x:%x]\n", block, offset);
-+
-+failed_read1:
-+      return NULL;
-+}
-+#endif
-+
-+
-+static struct inode *squashfs_iget(struct super_block *s, squashfs_inode inode)
-+{
-+      struct inode *i = new_inode(s);
-+      squashfs_sb_info *msBlk = &s->u.squashfs_sb;
-+      squashfs_super_block *sBlk = &msBlk->sBlk;
-+      unsigned int block = SQUASHFS_INODE_BLK(inode) + sBlk->inode_table_start;
-+      unsigned int offset = SQUASHFS_INODE_OFFSET(inode);
-+      unsigned int next_block, next_offset;
-+      squashfs_base_inode_header inodeb;
-+
-+      TRACE("Entered squashfs_iget\n");
-+
-+      if(msBlk->swap) {
-+              squashfs_base_inode_header sinodeb;
-+
-+              if(!squashfs_get_cached_block(s, (char *) &sinodeb, block,  offset,
-+                                      sizeof(sinodeb), &next_block, &next_offset))
-+                      goto failed_read;
-+              SQUASHFS_SWAP_BASE_INODE_HEADER(&inodeb, &sinodeb, sizeof(sinodeb));
-+      } else
-+              if(!squashfs_get_cached_block(s, (char *) &inodeb, block,  offset,
-+                                      sizeof(inodeb), &next_block, &next_offset))
-+                      goto failed_read;
-+
-+      i->i_nlink = 1;
-+
-+      i->i_mtime = sBlk->mkfs_time;
-+      i->i_atime = sBlk->mkfs_time;
-+      i->i_ctime = sBlk->mkfs_time;
-+
-+      if(inodeb.inode_type != SQUASHFS_IPC_TYPE)
-+              i->i_uid = msBlk->uid[((inodeb.inode_type - 1) / SQUASHFS_TYPES) * 16 + inodeb.uid];
-+      i->i_ino = SQUASHFS_MK_VFS_INODE(block - sBlk->inode_table_start, offset);
-+
-+      i->i_mode = inodeb.mode;
-+
-+      switch(inodeb.inode_type) {
-+              case SQUASHFS_FILE_TYPE: {
-+                      squashfs_reg_inode_header inodep;
-+
-+                      if(msBlk->swap) {
-+                              squashfs_reg_inode_header sinodep;
-+
-+                              if(!squashfs_get_cached_block(s, (char *) &sinodep, block,  offset, sizeof(sinodep),
-+                                                      &next_block, &next_offset))
-+                                      goto failed_read;
-+                              SQUASHFS_SWAP_REG_INODE_HEADER(&inodep, &sinodep);
-+                      } else
-+                              if(!squashfs_get_cached_block(s, (char *) &inodep, block,  offset, sizeof(inodep),
-+                                                      &next_block, &next_offset))
-+                                      goto failed_read;
-+
-+                      i->u.squashfs_i.fragment_start_block = SQUASHFS_INVALID_BLK;
-+                      if(inodep.fragment != SQUASHFS_INVALID_BLK && !get_fragment_location(s, inodep.fragment,
-+                                                      &i->u.squashfs_i.fragment_start_block, &i->u.squashfs_i.fragment_size))
-+                              goto failed_read;
-+
-+                      i->u.squashfs_i.fragment_offset = inodep.offset;
-+                      i->i_size = inodep.file_size;
-+                      i->i_fop = &generic_ro_fops;
-+                      if(sBlk->block_size > 4096)
-+                              i->i_data.a_ops = &squashfs_aops;
-+                      else
-+                              i->i_data.a_ops = &squashfs_aops_4K;
-+                      i->i_mode |= S_IFREG;
-+                      i->i_mtime = inodep.mtime;
-+                      i->i_atime = inodep.mtime;
-+                      i->i_ctime = inodep.mtime;
-+                      i->i_blocks = ((i->i_size - 1) >> 9) + 1;
-+                      i->i_blksize = PAGE_CACHE_SIZE;
-+                      i->u.squashfs_i.start_block = inodep.start_block;
-+                      i->u.squashfs_i.block_list_start = next_block;
-+                      i->u.squashfs_i.offset = next_offset;
-+                      TRACE("File inode %x:%x, start_block %x, block_list_start %x, offset %x fragment_index %x fragment_offset %x\n",
-+                                      SQUASHFS_INODE_BLK(inode), offset, inodep.start_block, next_block, next_offset, inodep.fragment, inodep.offset);
-+                      break;
-+              }
-+              case SQUASHFS_DIR_TYPE: {
-+                      squashfs_dir_inode_header inodep;
-+
-+                      if(msBlk->swap) {
-+                              squashfs_dir_inode_header sinodep;
-+
-+                              if(!squashfs_get_cached_block(s, (char *) &sinodep, block,  offset, sizeof(sinodep),
-+                                                      &next_block, &next_offset))
-+                                      goto failed_read;
-+                              SQUASHFS_SWAP_DIR_INODE_HEADER(&inodep, &sinodep);
-+                      } else
-+                              if(!squashfs_get_cached_block(s, (char *) &inodep, block,  offset, sizeof(inodep),
-+                                                      &next_block, &next_offset))
-+                                      goto failed_read;
-+
-+                      i->i_size = inodep.file_size;
-+                      i->i_op = &squashfs_dir_inode_ops;
-+                      i->i_fop = &squashfs_dir_ops;
-+                      i->i_mode |= S_IFDIR;
-+                      i->i_mtime = inodep.mtime;
-+                      i->i_atime = inodep.mtime;
-+                      i->i_ctime = inodep.mtime;
-+                      i->u.squashfs_i.start_block = inodep.start_block;
-+                      i->u.squashfs_i.offset = inodep.offset;
-+                      TRACE("Directory inode %x:%x, start_block %x, offset %x\n", SQUASHFS_INODE_BLK(inode), offset,
-+                                      inodep.start_block, inodep.offset);
-+                      break;
-+              }
-+              case SQUASHFS_SYMLINK_TYPE: {
-+                      squashfs_symlink_inode_header inodep;
-+      
-+                      if(msBlk->swap) {
-+                              squashfs_symlink_inode_header sinodep;
-+
-+                              if(!squashfs_get_cached_block(s, (char *) &sinodep, block,  offset, sizeof(sinodep),
-+                                                      &next_block, &next_offset))
-+                                      goto failed_read;
-+                              SQUASHFS_SWAP_SYMLINK_INODE_HEADER(&inodep, &sinodep);
-+                      } else
-+                              if(!squashfs_get_cached_block(s, (char *) &inodep, block,  offset, sizeof(inodep),
-+                                                      &next_block, &next_offset))
-+                                      goto failed_read;
-+
-+                      i->i_size = inodep.symlink_size;
-+                      i->i_op = &page_symlink_inode_operations;
-+                      i->i_data.a_ops = &squashfs_symlink_aops;
-+                      i->i_mode |= S_IFLNK;
-+                      i->u.squashfs_i.start_block = next_block;
-+                      i->u.squashfs_i.offset = next_offset;
-+                      TRACE("Symbolic link inode %x:%x, start_block %x, offset %x\n",
-+                              SQUASHFS_INODE_BLK(inode), offset, next_block, next_offset);
-+                      break;
-+               }
-+               case SQUASHFS_BLKDEV_TYPE:
-+               case SQUASHFS_CHRDEV_TYPE: {
-+                      squashfs_dev_inode_header inodep;
-+
-+                      if(msBlk->swap) {
-+                              squashfs_dev_inode_header sinodep;
-+
-+                              if(!squashfs_get_cached_block(s, (char *) &sinodep, block,  offset, sizeof(sinodep),
-+                                                      &next_block, &next_offset))
-+                                      goto failed_read;
-+                              SQUASHFS_SWAP_DEV_INODE_HEADER(&inodep, &sinodep);
-+                      } else  
-+                              if(!squashfs_get_cached_block(s, (char *) &inodep, block,  offset, sizeof(inodep),
-+                                                      &next_block, &next_offset))
-+                                      goto failed_read;
-+
-+                      i->i_size = 0;
-+                      i->i_mode |= (inodeb.inode_type == SQUASHFS_CHRDEV_TYPE) ? S_IFCHR : S_IFBLK;
-+                      init_special_inode(i, i->i_mode, inodep.rdev);
-+                      TRACE("Device inode %x:%x, rdev %x\n", SQUASHFS_INODE_BLK(inode), offset, inodep.rdev);
-+                      break;
-+               }
-+               case SQUASHFS_FIFO_TYPE:
-+               case SQUASHFS_SOCKET_TYPE: {
-+                      i->i_size = 0;
-+                      i->i_mode |= (inodeb.inode_type == SQUASHFS_FIFO_TYPE) ? S_IFIFO : S_IFSOCK;
-+                      init_special_inode(i, i->i_mode, 0);
-+                      break;
-+               }
-+               default:
-+                      ERROR("Unknown inode type %d in squashfs_iget!\n", inodeb.inode_type);
-+                              goto failed_read1;
-+      }
-+      
-+      if(inodeb.guid == SQUASHFS_GUIDS)
-+              i->i_gid = i->i_uid;
-+      else
-+              i->i_gid = msBlk->guid[inodeb.guid];
-+
-+      return i;
-+
-+failed_read:
-+      ERROR("Unable to read inode [%x:%x]\n", block, offset);
-+
-+failed_read1:
-+      return NULL;
-+}
-+
-+
-+static struct super_block *squashfs_read_super(struct super_block *s,
-+              void *data, int silent)
-+{
-+      kdev_t dev = s->s_dev;
-+      squashfs_sb_info *msBlk = &s->u.squashfs_sb;
-+      squashfs_super_block *sBlk = &msBlk->sBlk;
-+      int i;
-+
-+      TRACE("Entered squashfs_read_superblock\n");
-+
-+      msBlk->devblksize = get_hardsect_size(dev);
-+      if(msBlk->devblksize < BLOCK_SIZE)
-+              msBlk->devblksize = BLOCK_SIZE;
-+      msBlk->devblksize_log2 = ffz(~msBlk->devblksize);
-+      set_blocksize(dev, msBlk->devblksize);
-+      s->s_blocksize = msBlk->devblksize;
-+      s->s_blocksize_bits = msBlk->devblksize_log2;
-+
-+      init_MUTEX(&msBlk->read_page_mutex);
-+      init_MUTEX(&msBlk->block_cache_mutex);
-+      init_MUTEX(&msBlk->fragment_mutex);
-+      
-+      init_waitqueue_head(&msBlk->waitq);
-+      init_waitqueue_head(&msBlk->fragment_wait_queue);
-+
-+      if(!read_data(s, (char *) sBlk, SQUASHFS_START, sizeof(squashfs_super_block) | SQUASHFS_COMPRESSED_BIT, 0, NULL)) {
-+              SERROR("unable to read superblock\n");
-+              goto failed_mount;
-+      }
-+
-+      /* Check it is a SQUASHFS superblock */
-+      msBlk->swap = 0;
-+      if((s->s_magic = sBlk->s_magic) != SQUASHFS_MAGIC) {
-+              if(sBlk->s_magic == SQUASHFS_MAGIC_SWAP) {
-+                      squashfs_super_block sblk;
-+                      WARNING("Mounting a different endian SQUASHFS filesystem on %s\n", bdevname(dev));
-+                      SQUASHFS_SWAP_SUPER_BLOCK(&sblk, sBlk);
-+                      memcpy(sBlk, &sblk, sizeof(squashfs_super_block));
-+                      msBlk->swap = 1;
-+              } else  {
-+                      SERROR("Can't find a SQUASHFS superblock on %s\n", bdevname(dev));
-+                      goto failed_mount;
-+              }
-+      }
-+
-+      /* Check the MAJOR & MINOR versions */
-+#ifdef SQUASHFS_1_0_COMPATIBILITY
-+      if((sBlk->s_major != 1) && (sBlk->s_major != 2 || sBlk->s_minor > SQUASHFS_MINOR)) {
-+              SERROR("Major/Minor mismatch, filesystem is (%d:%d), I support (1 : x) or (2 : <= %d)\n",
-+                              sBlk->s_major, sBlk->s_minor, SQUASHFS_MINOR);
-+              goto failed_mount;
-+      }
-+      if(sBlk->s_major == 1)
-+              sBlk->block_size = sBlk->block_size_1;
-+#else
-+      if(sBlk->s_major != SQUASHFS_MAJOR || sBlk->s_minor > SQUASHFS_MINOR) {
-+              SERROR("Major/Minor mismatch, filesystem is (%d:%d), I support (%d: <= %d)\n",
-+                              sBlk->s_major, sBlk->s_minor, SQUASHFS_MAJOR, SQUASHFS_MINOR);
-+              goto failed_mount;
-+      }
-+#endif
-+
-+      TRACE("Found valid superblock on %s\n", bdevname(dev));
-+      TRACE("Inodes are %scompressed\n", SQUASHFS_UNCOMPRESSED_INODES(sBlk->flags) ? "un" : "");
-+      TRACE("Data is %scompressed\n", SQUASHFS_UNCOMPRESSED_DATA(sBlk->flags) ? "un" : "");
-+      TRACE("Check data is %s present in the filesystem\n", SQUASHFS_CHECK_DATA(sBlk->flags) ? "" : "not");
-+      TRACE("Filesystem size %d bytes\n", sBlk->bytes_used);
-+      TRACE("Block size %d\n", sBlk->block_size);
-+      TRACE("Number of inodes %d\n", sBlk->inodes);
-+      if(sBlk->s_major > 1)
-+              TRACE("Number of fragments %d\n", sBlk->fragments);
-+      TRACE("Number of uids %d\n", sBlk->no_uids);
-+      TRACE("Number of gids %d\n", sBlk->no_guids);
-+      TRACE("sBlk->inode_table_start %x\n", sBlk->inode_table_start);
-+      TRACE("sBlk->directory_table_start %x\n", sBlk->directory_table_start);
-+              if(sBlk->s_major > 1)
-+      TRACE("sBlk->fragment_table_start %x\n", sBlk->fragment_table_start);
-+      TRACE("sBlk->uid_start %x\n", sBlk->uid_start);
-+
-+      s->s_flags |= MS_RDONLY;
-+      s->s_op = &squashfs_ops;
-+
-+      /* Init inode_table block pointer array */
-+      if(!(msBlk->block_cache = (squashfs_cache *) kmalloc(sizeof(squashfs_cache) * SQUASHFS_CACHED_BLKS, GFP_KERNEL))) {
-+              ERROR("Failed to allocate block cache\n");
-+              goto failed_mount;
-+      }
-+
-+      for(i = 0; i < SQUASHFS_CACHED_BLKS; i++)
-+              msBlk->block_cache[i].block = SQUASHFS_INVALID_BLK;
-+
-+      msBlk->next_cache = 0;
-+
-+      /* Allocate read_data block */
-+      msBlk->read_size = (sBlk->block_size < SQUASHFS_METADATA_SIZE) ? SQUASHFS_METADATA_SIZE : sBlk->block_size;
-+      if(!(msBlk->read_data = (char *) kmalloc(msBlk->read_size, GFP_KERNEL))) {
-+              ERROR("Failed to allocate read_data block\n");
-+              goto failed_mount1;
-+      }
-+
-+      /* Allocate read_page block */
-+      if(sBlk->block_size > PAGE_CACHE_SIZE && 
-+         !(msBlk->read_page = (char *) kmalloc(sBlk->block_size, GFP_KERNEL))) {
-+              ERROR("Failed to allocate read_page block\n");
-+              goto failed_mount2;
-+      }
-+
-+      /* Allocate uid and gid tables */
-+      if(!(msBlk->uid = (squashfs_uid *) kmalloc((sBlk->no_uids +
-+              sBlk->no_guids) * sizeof(squashfs_uid), GFP_KERNEL))) {
-+              ERROR("Failed to allocate uid/gid table\n");
-+              goto failed_mount3;
-+      }
-+      msBlk->guid = msBlk->uid + sBlk->no_uids;
-+   
-+      if(msBlk->swap) {
-+              squashfs_uid suid[sBlk->no_uids + sBlk->no_guids];
-+
-+              if(!read_data(s, (char *) &suid, sBlk->uid_start, ((sBlk->no_uids + sBlk->no_guids) *
-+                              sizeof(squashfs_uid)) | SQUASHFS_COMPRESSED_BIT, 0, NULL)) {
-+                      SERROR("unable to read uid/gid table\n");
-+                      goto failed_mount4;
-+              }
-+              SQUASHFS_SWAP_DATA(msBlk->uid, suid, (sBlk->no_uids + sBlk->no_guids), (sizeof(squashfs_uid) * 8));
-+      } else
-+              if(!read_data(s, (char *) msBlk->uid, sBlk->uid_start, ((sBlk->no_uids + sBlk->no_guids) *
-+                              sizeof(squashfs_uid)) | SQUASHFS_COMPRESSED_BIT, 0, NULL)) {
-+                      SERROR("unable to read uid/gid table\n");
-+                      goto failed_mount4;
-+              }
-+
-+
-+#ifdef SQUASHFS_1_0_COMPATIBILITY
-+      if(sBlk->s_major == 1) {
-+              msBlk->iget = squashfs_iget_1;
-+              msBlk->read_blocklist = read_blocklist_1;
-+              msBlk->fragment = (struct squashfs_fragment_cache *) msBlk->fragment_index = NULL;
-+              goto allocate_root;
-+      }
-+#endif
-+      msBlk->iget = squashfs_iget;
-+      msBlk->read_blocklist = read_blocklist;
-+
-+      if(!(msBlk->fragment = (struct squashfs_fragment_cache *) kmalloc(sizeof(struct squashfs_fragment_cache) * SQUASHFS_CACHED_FRAGMENTS, GFP_KERNEL))) {
-+              ERROR("Failed to allocate fragment block cache\n");
-+              goto failed_mount4;
-+      }
-+
-+      for(i = 0; i < SQUASHFS_CACHED_FRAGMENTS; i++) {
-+              msBlk->fragment[i].locked = 0;
-+              msBlk->fragment[i].block = SQUASHFS_INVALID_BLK;
-+              msBlk->fragment[i].data = NULL;
-+      }
-+
-+      msBlk->next_fragment = 0;
-+
-+      /* Allocate fragment index table */
-+      if(!(msBlk->fragment_index = (squashfs_fragment_index *) kmalloc(SQUASHFS_FRAGMENT_INDEX_BYTES(sBlk->fragments), GFP_KERNEL))) {
-+              ERROR("Failed to allocate uid/gid table\n");
-+              goto failed_mount5;
-+      }
-+   
-+      if(SQUASHFS_FRAGMENT_INDEX_BYTES(sBlk->fragments) &&
-+              !read_data(s, (char *) msBlk->fragment_index, sBlk->fragment_table_start,
-+              SQUASHFS_FRAGMENT_INDEX_BYTES(sBlk->fragments) | SQUASHFS_COMPRESSED_BIT, 0, NULL)) {
-+                      SERROR("unable to read fragment index table\n");
-+                      goto failed_mount6;
-+      }
-+
-+      if(msBlk->swap) {
-+              int i;
-+              squashfs_fragment_index fragment;
-+
-+              for(i = 0; i < SQUASHFS_FRAGMENT_INDEXES(sBlk->fragments); i++) {
-+                      SQUASHFS_SWAP_FRAGMENT_INDEXES((&fragment), &msBlk->fragment_index[i], 1);
-+                      msBlk->fragment_index[i] = fragment;
-+              }
-+      }
-+
-+#ifdef SQUASHFS_1_0_COMPATIBILITY
-+allocate_root:
-+#endif
-+      if(!(s->s_root = d_alloc_root((msBlk->iget)(s, sBlk->root_inode)))) {
-+              ERROR("Root inode create failed\n");
-+              goto failed_mount5;
-+      }
-+
-+      TRACE("Leaving squashfs_read_super\n");
-+      return s;
-+
-+failed_mount6:
-+      kfree(msBlk->fragment_index);
-+failed_mount5:
-+      kfree(msBlk->fragment);
-+failed_mount4:
-+      kfree(msBlk->uid);
-+failed_mount3:
-+      kfree(msBlk->read_page);
-+failed_mount2:
-+      kfree(msBlk->read_data);
-+failed_mount1:
-+      kfree(msBlk->block_cache);
-+failed_mount:
-+      return NULL;
-+}
-+
-+
-+static int squashfs_statfs(struct super_block *s, struct statfs *buf)
-+{
-+      squashfs_super_block *sBlk = &s->u.squashfs_sb.sBlk;
-+
-+      TRACE("Entered squashfs_statfs\n");
-+      buf->f_type = SQUASHFS_MAGIC;
-+      buf->f_bsize = sBlk->block_size;
-+      buf->f_blocks = ((sBlk->bytes_used - 1) >> sBlk->block_log) + 1;
-+      buf->f_bfree = buf->f_bavail = 0;
-+      buf->f_files = sBlk->inodes;
-+      buf->f_ffree = 0;
-+      buf->f_namelen = SQUASHFS_NAME_LEN;
-+      return 0;
-+}
-+
-+
-+static int squashfs_symlink_readpage(struct file *file, struct page *page)
-+{
-+      struct inode *inode = page->mapping->host;
-+      int index = page->index << PAGE_CACHE_SHIFT, length, bytes;
-+      int block = inode->u.squashfs_i.start_block;
-+      int offset = inode->u.squashfs_i.offset;
-+      void *pageaddr = kmap(page);
-+
-+      TRACE("Entered squashfs_symlink_readpage, page index %x, start block %x, offset %x\n",
-+              (unsigned int) page->index, inode->u.squashfs_i.start_block, inode->u.squashfs_i.offset);
-+
-+      for(length = 0; length < index; length += bytes) {
-+              if(!(bytes = squashfs_get_cached_block(inode->i_sb, NULL, block, offset,
-+                                      PAGE_CACHE_SIZE, &block, &offset))) {
-+                      ERROR("Unable to read symbolic link [%x:%x]\n", block, offset);
-+                      goto skip_read;
-+              }
-+      }
-+
-+      if(length != index) {
-+              ERROR("(squashfs_symlink_readpage) length != index\n");
-+              bytes = 0;
-+              goto skip_read;
-+      }
-+
-+      bytes = (inode->i_size - length) > PAGE_CACHE_SIZE ? PAGE_CACHE_SIZE : inode->i_size - length;
-+      if(!(bytes = squashfs_get_cached_block(inode->i_sb, pageaddr, block, offset, bytes, &block, &offset)))
-+              ERROR("Unable to read symbolic link [%x:%x]\n", block, offset);
-+
-+skip_read:
-+      memset(pageaddr + bytes, 0, PAGE_CACHE_SIZE - bytes);
-+      kunmap(page);
-+      flush_dcache_page(page);
-+      SetPageUptodate(page);
-+      UnlockPage(page);
-+
-+      return 0;
-+}
-+
-+
-+#define SIZE 256
-+
-+#ifdef SQUASHFS_1_0_COMPATIBILITY
-+static unsigned int read_blocklist_1(struct inode *inode, int index, int readahead_blks,
-+              char *block_list, char **block_p, unsigned int *bsize)
-+{
-+      squashfs_sb_info *msBlk = &inode->i_sb->u.squashfs_sb;
-+      unsigned short *block_listp;
-+      int i = 0;
-+      int block_ptr = inode->u.squashfs_i.block_list_start;
-+      int offset = inode->u.squashfs_i.offset;
-+      int block = inode->u.squashfs_i.start_block;
-+
-+      for(;;) {
-+              int blocks = (index + readahead_blks - i);
-+              if(blocks > (SIZE >> 1)) {
-+                      if((index - i) <= (SIZE >> 1))
-+                              blocks = index - i;
-+                      else
-+                              blocks = SIZE >> 1;
-+              }
-+
-+              if(msBlk->swap) {
-+                      unsigned char sblock_list[SIZE];
-+                      if(!squashfs_get_cached_block(inode->i_sb, (char *) sblock_list, block_ptr, offset, blocks << 1, &block_ptr, &offset)) {
-+                              ERROR("Unable to read block list [%d:%x]\n", block_ptr, offset);
-+                              return 0;
-+                      }
-+                      SQUASHFS_SWAP_SHORTS(((unsigned short *)block_list), ((unsigned short *)sblock_list), blocks);
-+              } else
-+                      if(!squashfs_get_cached_block(inode->i_sb, (char *) block_list, block_ptr, offset, blocks << 1, &block_ptr, &offset)) {
-+                              ERROR("Unable to read block list [%d:%x]\n", block_ptr, offset);
-+                              return 0;
-+                      }
-+              for(block_listp = (unsigned short *) block_list; i < index && blocks; i ++, block_listp ++, blocks --)
-+                      block += SQUASHFS_COMPRESSED_SIZE(*block_listp);
-+              if(blocks >= readahead_blks)
-+                      break;
-+      }
-+
-+      if(bsize)
-+              *bsize = SQUASHFS_COMPRESSED_SIZE(*block_listp) | (!SQUASHFS_COMPRESSED(*block_listp) ? SQUASHFS_COMPRESSED_BIT_BLOCK : 0);
-+      else
-+              (unsigned short *) *block_p = block_listp;
-+      return block;
-+}
-+#endif
-+
-+
-+
-+static unsigned int read_blocklist(struct inode *inode, int index, int readahead_blks,
-+              char *block_list, char **block_p, unsigned int *bsize)
-+{
-+      squashfs_sb_info *msBlk = &inode->i_sb->u.squashfs_sb;
-+      unsigned int *block_listp;
-+      int i = 0;
-+      int block_ptr = inode->u.squashfs_i.block_list_start;
-+      int offset = inode->u.squashfs_i.offset;
-+      int block = inode->u.squashfs_i.start_block;
-+
-+      for(;;) {
-+              int blocks = (index + readahead_blks - i);
-+              if(blocks > (SIZE >> 2)) {
-+                      if((index - i) <= (SIZE >> 2))
-+                              blocks = index - i;
-+                      else
-+                              blocks = SIZE >> 2;
-+              }
-+
-+              if(msBlk->swap) {
-+                      unsigned char sblock_list[SIZE];
-+                      if(!squashfs_get_cached_block(inode->i_sb, (char *) sblock_list, block_ptr, offset, blocks << 2, &block_ptr, &offset)) {
-+                              ERROR("Unable to read block list [%d:%x]\n", block_ptr, offset);
-+                              return 0;
-+                      }
-+                      SQUASHFS_SWAP_INTS(((unsigned int *)block_list), ((unsigned int *)sblock_list), blocks);
-+              } else
-+                      if(!squashfs_get_cached_block(inode->i_sb, (char *) block_list, block_ptr, offset, blocks << 2, &block_ptr, &offset)) {
-+                              ERROR("Unable to read block list [%d:%x]\n", block_ptr, offset);
-+                              return 0;
-+                      }
-+              for(block_listp = (unsigned int *) block_list; i < index && blocks; i ++, block_listp ++, blocks --)
-+                      block += SQUASHFS_COMPRESSED_SIZE_BLOCK(*block_listp);
-+              if(blocks >= readahead_blks)
-+                      break;
-+      }
-+
-+      *bsize = *block_listp;
-+      return block;
-+}
-+
-+
-+static int squashfs_readpage(struct file *file, struct page *page)
-+{
-+      struct inode *inode = page->mapping->host;
-+      squashfs_sb_info *msBlk = &inode->i_sb->u.squashfs_sb;
-+      squashfs_super_block *sBlk = &msBlk->sBlk;
-+      unsigned char block_list[SIZE];
-+      unsigned int bsize, block, i = 0, bytes = 0, byte_offset = 0;
-+      int index = page->index >> (sBlk->block_log - PAGE_CACHE_SHIFT);
-+      void *pageaddr = kmap(page);
-+      struct squashfs_fragment_cache *fragment;
-+      char *data_ptr = msBlk->read_page;
-+      
-+      int mask = (1 << (sBlk->block_log - PAGE_CACHE_SHIFT)) - 1;
-+      int start_index = page->index & ~mask;
-+      int end_index = start_index | mask;
-+
-+      TRACE("Entered squashfs_readpage, page index %x, start block %x\n", (unsigned int) page->index,
-+              inode->u.squashfs_i.start_block);
-+
-+      if(inode->u.squashfs_i.fragment_start_block == SQUASHFS_INVALID_BLK || index < (inode->i_size >> sBlk->block_log)) {
-+              if((block = (msBlk->read_blocklist)(inode, index, 1, block_list, NULL, &bsize)) == 0)
-+                      goto skip_read;
-+
-+              down(&msBlk->read_page_mutex);
-+              if(!(bytes = read_data(inode->i_sb, msBlk->read_page, block, bsize, 1, NULL))) {
-+                      ERROR("Unable to read page, block %x, size %x\n", block, bsize);
-+                      up(&msBlk->read_page_mutex);
-+                      goto skip_read;
-+              }
-+      } else {
-+              if((fragment = get_cached_fragment(inode->i_sb, inode->u.squashfs_i.fragment_start_block, inode->u.squashfs_i.fragment_size)) == NULL) {
-+                      ERROR("Unable to read page, block %x, size %x\n", inode->u.squashfs_i.fragment_start_block, (int) inode->u.squashfs_i.fragment_size);
-+                      goto skip_read;
-+              }
-+              bytes = inode->u.squashfs_i.fragment_offset + (inode->i_size & (sBlk->block_size - 1));
-+              byte_offset = inode->u.squashfs_i.fragment_offset;
-+              data_ptr = fragment->data;
-+      }
-+
-+      for(i = start_index; i <= end_index && byte_offset < bytes; i++, byte_offset += PAGE_CACHE_SIZE) {
-+              struct page *push_page;
-+              int available_bytes = (bytes - byte_offset) > PAGE_CACHE_SIZE ? PAGE_CACHE_SIZE : bytes - byte_offset;
-+
-+              TRACE("bytes %d, i %d, byte_offset %d, available_bytes %d\n", bytes, i, byte_offset, available_bytes);
-+
-+              if(i == page->index)  {
-+                      memcpy(pageaddr, data_ptr + byte_offset, available_bytes);
-+                      memset(pageaddr + available_bytes, 0, PAGE_CACHE_SIZE - available_bytes);
-+                      kunmap(page);
-+                      flush_dcache_page(page);
-+                      SetPageUptodate(page);
-+                      UnlockPage(page);
-+              } else if((push_page = grab_cache_page_nowait(page->mapping, i))) {
-+                      void *pageaddr = kmap(push_page);
-+                      memcpy(pageaddr, data_ptr + byte_offset, available_bytes);
-+                      memset(pageaddr + available_bytes, 0, PAGE_CACHE_SIZE - available_bytes);
-+                      kunmap(push_page);
-+                      flush_dcache_page(push_page);
-+                      SetPageUptodate(push_page);
-+                      UnlockPage(push_page);
-+                      page_cache_release(push_page);
-+              }
-+      }
-+
-+      if(inode->u.squashfs_i.fragment_start_block == SQUASHFS_INVALID_BLK || index < (inode->i_size >> sBlk->block_log))
-+              up(&msBlk->read_page_mutex);
-+      else
-+              release_cached_fragment(msBlk, fragment);
-+
-+      return 0;
-+
-+skip_read:
-+      memset(pageaddr + bytes, 0, PAGE_CACHE_SIZE - bytes);
-+      kunmap(page);
-+      flush_dcache_page(page);
-+      SetPageUptodate(page);
-+      UnlockPage(page);
-+
-+      return 0;
-+}
-+
-+
-+static int squashfs_readpage4K(struct file *file, struct page *page)
-+{
-+      struct inode *inode = page->mapping->host;
-+      squashfs_sb_info *msBlk = &inode->i_sb->u.squashfs_sb;
-+      squashfs_super_block *sBlk = &msBlk->sBlk;
-+      unsigned char block_list[SIZE];
-+      unsigned int bsize, block, bytes = 0;
-+      void *pageaddr = kmap(page);
-+      
-+      TRACE("Entered squashfs_readpage4K, page index %x, start block %x\n", (unsigned int) page->index,
-+              inode->u.squashfs_i.start_block);
-+
-+      if(page->index < (inode->i_size >> sBlk->block_log)) {
-+              block = (msBlk->read_blocklist)(inode, page->index, 1, block_list, NULL, &bsize);
-+
-+              if(!(bytes = read_data(inode->i_sb, pageaddr, block, bsize, 1, NULL)))
-+                      ERROR("Unable to read page, block %x, size %x\n", block, bsize);
-+      } else {
-+              struct squashfs_fragment_cache *fragment;
-+
-+              if((fragment = get_cached_fragment(inode->i_sb, inode->u.squashfs_i.fragment_start_block, inode->u.squashfs_i.fragment_size)) == NULL)
-+                      ERROR("Unable to read page, block %x, size %x\n", inode->u.squashfs_i.fragment_start_block, (int) inode->u.squashfs_i.fragment_size);
-+              else {
-+                      bytes = inode->i_size & (sBlk->block_size - 1);
-+                      memcpy(pageaddr, fragment->data + inode->u.squashfs_i.fragment_offset, bytes);
-+                      release_cached_fragment(msBlk, fragment);
-+              }
-+      }
-+
-+      memset(pageaddr + bytes, 0, PAGE_CACHE_SIZE - bytes);
-+      kunmap(page);
-+      flush_dcache_page(page);
-+      SetPageUptodate(page);
-+      UnlockPage(page);
-+
-+      return 0;
-+}
-+
-+
-+#ifdef SQUASHFS_1_0_COMPATIBILITY
-+static int squashfs_readpage_lessthan4K(struct file *file, struct page *page)
-+{
-+      struct inode *inode = page->mapping->host;
-+      squashfs_sb_info *msBlk = &inode->i_sb->u.squashfs_sb;
-+      squashfs_super_block *sBlk = &msBlk->sBlk;
-+      unsigned char block_list[SIZE];
-+      unsigned short *block_listp, block, bytes = 0;
-+      int index = page->index << (PAGE_CACHE_SHIFT - sBlk->block_log);
-+      int file_blocks = ((inode->i_size - 1) >> sBlk->block_log) + 1;
-+      int readahead_blks = 1 << (PAGE_CACHE_SHIFT - sBlk->block_log);
-+      void *pageaddr = kmap(page);
-+      
-+      int i_end = index + (1 << (PAGE_CACHE_SHIFT - sBlk->block_log));
-+      int byte;
-+
-+      TRACE("Entered squashfs_readpage_lessthan4K, page index %x, start block %x\n", (unsigned int) page->index,
-+              inode->u.squashfs_i.start_block);
-+
-+      block = read_blocklist_1(inode, index, readahead_blks, block_list, (char **) &block_listp, NULL);
-+
-+      if(i_end > file_blocks)
-+              i_end = file_blocks;
-+
-+      while(index < i_end) {
-+              if(!(byte = read_data(inode->i_sb, pageaddr, block, *block_listp, 0, NULL))) {
-+                      ERROR("Unable to read page, block %x, size %x\n", block, *block_listp);
-+                      goto skip_read;
-+              }
-+              block += SQUASHFS_COMPRESSED_SIZE(*block_listp);
-+              pageaddr += byte;
-+              bytes += byte;
-+              index ++;
-+              block_listp ++;
-+      }
-+
-+skip_read:
-+      memset(pageaddr, 0, PAGE_CACHE_SIZE - bytes);
-+      kunmap(page);
-+      flush_dcache_page(page);
-+      SetPageUptodate(page);
-+      UnlockPage(page);
-+
-+      return 0;
-+}
-+#endif
-+
-+
-+static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir)
-+{
-+      struct inode *i = file->f_dentry->d_inode;
-+      squashfs_sb_info *msBlk = &i->i_sb->u.squashfs_sb;
-+      squashfs_super_block *sBlk = &msBlk->sBlk;
-+      int next_block = i->u.squashfs_i.start_block + sBlk->directory_table_start, next_offset =
-+              i->u.squashfs_i.offset, length = 0, dirs_read = 0, dir_count;
-+      squashfs_dir_header dirh;
-+      char buffer[sizeof(squashfs_dir_entry) + SQUASHFS_NAME_LEN + 1];
-+      squashfs_dir_entry *dire = (squashfs_dir_entry *) buffer;
-+
-+      TRACE("Entered squashfs_readdir [%x:%x]\n", next_block, next_offset);
-+
-+      while(length < i->i_size) {
-+              /* read directory header */
-+              if(msBlk->swap) {
-+                      squashfs_dir_header sdirh;
-+                      if(!squashfs_get_cached_block(i->i_sb, (char *) &sdirh, next_block,
-+                                              next_offset, sizeof(sdirh), &next_block, &next_offset))
-+                              goto failed_read;
-+                      length += sizeof(sdirh);
-+                      SQUASHFS_SWAP_DIR_HEADER(&dirh, &sdirh);
-+              } else {
-+                      if(!squashfs_get_cached_block(i->i_sb, (char *) &dirh, next_block,
-+                                              next_offset, sizeof(dirh), &next_block, &next_offset))
-+                              goto failed_read;
-+                      length += sizeof(dirh);
-+              }
-+
-+              dir_count = dirh.count + 1;
-+              while(dir_count--) {
-+                      if(msBlk->swap) {
-+                              squashfs_dir_entry sdire;
-+                              if(!squashfs_get_cached_block(i->i_sb, (char *) &sdire, next_block,
-+                                                      next_offset, sizeof(sdire), &next_block, &next_offset))
-+                                      goto failed_read;
-+                              length += sizeof(sdire);
-+                              SQUASHFS_SWAP_DIR_ENTRY(dire, &sdire);
-+                      } else {
-+                              if(!squashfs_get_cached_block(i->i_sb, (char *) dire, next_block,
-+                                                      next_offset, sizeof(*dire), &next_block, &next_offset))
-+                                      goto failed_read;
-+                              length += sizeof(*dire);
-+                      }
-+
-+                      if(!squashfs_get_cached_block(i->i_sb, dire->name, next_block,
-+                                              next_offset, dire->size + 1, &next_block, &next_offset))
-+                              goto failed_read;
-+                      length += dire->size + 1;
-+
-+                      if(file->f_pos >= length)
-+                              continue;
-+
-+                      dire->name[dire->size + 1] = '\0';
-+
-+                      TRACE("Calling filldir(%x, %s, %d, %d, %x:%x, %d)\n", (unsigned int) dirent,
-+                      dire->name, dire->size + 1, (int) file->f_pos,
-+                      dirh.start_block, dire->offset, squashfs_filetype_table[dire->type]);
-+
-+                      if(filldir(dirent, dire->name, dire->size + 1, file->f_pos, SQUASHFS_MK_VFS_INODE(dirh.start_block,
-+                                                      dire->offset), squashfs_filetype_table[dire->type]) < 0) {
-+                              TRACE("Filldir returned less than 0\n");
-+                              return dirs_read;
-+                      }
-+
-+                      file->f_pos = length;
-+                      dirs_read ++;
-+              }
-+      }
-+
-+      return dirs_read;
-+
-+failed_read:
-+      ERROR("Unable to read directory block [%x:%x]\n", next_block, next_offset);
-+      return 0;
-+}
-+
-+
-+static struct dentry *squashfs_lookup(struct inode *i, struct dentry *dentry)
-+{
-+      const char *name =dentry->d_name.name;
-+      int len = dentry->d_name.len;
-+      struct inode *inode = NULL;
-+      squashfs_sb_info *msBlk = &i->i_sb->u.squashfs_sb;
-+      squashfs_super_block *sBlk = &msBlk->sBlk;
-+      int next_block = i->u.squashfs_i.start_block + sBlk->directory_table_start, next_offset =
-+              i->u.squashfs_i.offset, length = 0, dir_count;
-+      squashfs_dir_header dirh;
-+      char buffer[sizeof(squashfs_dir_entry) + SQUASHFS_NAME_LEN];
-+      squashfs_dir_entry *dire = (squashfs_dir_entry *) buffer;
-+
-+      TRACE("Entered squashfs_lookup [%x:%x]\n", next_block, next_offset);
-+
-+      while(length < i->i_size) {
-+              /* read directory header */
-+              if(msBlk->swap) {
-+                      squashfs_dir_header sdirh;
-+                      if(!squashfs_get_cached_block(i->i_sb, (char *) &sdirh, next_block, next_offset,
-+                                              sizeof(sdirh), &next_block, &next_offset))
-+                              goto failed_read;
-+                      length += sizeof(sdirh);
-+                      SQUASHFS_SWAP_DIR_HEADER(&dirh, &sdirh);
-+              } else {
-+                      if(!squashfs_get_cached_block(i->i_sb, (char *) &dirh, next_block, next_offset,
-+                                              sizeof(dirh), &next_block, &next_offset))
-+                              goto failed_read;
-+                      length += sizeof(dirh);
-+              }
-+
-+              dir_count = dirh.count + 1;
-+              while(dir_count--) {
-+                      if(msBlk->swap) {
-+                              squashfs_dir_entry sdire;
-+                              if(!squashfs_get_cached_block(i->i_sb, (char *) &sdire,
-+                                                      next_block,next_offset, sizeof(sdire), &next_block, &next_offset))
-+                                      goto failed_read;
-+                              length += sizeof(sdire);
-+                              SQUASHFS_SWAP_DIR_ENTRY(dire, &sdire);
-+                      } else {
-+                              if(!squashfs_get_cached_block(i->i_sb, (char *) dire,
-+                                                      next_block,next_offset, sizeof(*dire), &next_block, &next_offset))
-+                                      goto failed_read;
-+                              length += sizeof(*dire);
-+                      }
-+
-+                      if(!squashfs_get_cached_block(i->i_sb, dire->name,
-+                                              next_block, next_offset, dire->size + 1, &next_block, &next_offset))
-+                              goto failed_read;
-+                      length += dire->size + 1;
-+
-+                      if((len == dire->size + 1) && !strncmp(name, dire->name, len)) {
-+                              squashfs_inode ino = SQUASHFS_MKINODE(dirh.start_block, dire->offset);
-+
-+                              TRACE("calling squashfs_iget for directory entry %s, inode %x:%x\n",
-+                                              name, dirh.start_block, dire->offset);
-+
-+                              inode = (msBlk->iget)(i->i_sb, ino);
-+
-+                              goto exit_loop;
-+                      }
-+              }
-+      }
-+
-+exit_loop:
-+      d_add(dentry, inode);
-+      return ERR_PTR(0);
-+
-+failed_read:
-+      ERROR("Unable to read directory block [%x:%x]\n", next_block, next_offset);
-+      goto exit_loop;
-+}
-+
-+
-+static void squashfs_put_super(struct super_block *s)
-+{
-+      if(s->u.squashfs_sb.block_cache) kfree(s->u.squashfs_sb.block_cache);
-+      if(s->u.squashfs_sb.read_data) kfree(s->u.squashfs_sb.read_data);
-+      if(s->u.squashfs_sb.read_page) kfree(s->u.squashfs_sb.read_page);
-+      if(s->u.squashfs_sb.uid) kfree(s->u.squashfs_sb.uid);
-+      s->u.squashfs_sb.block_cache = (void *) s->u.squashfs_sb.uid =
-+              s->u.squashfs_sb.read_data = s->u.squashfs_sb.read_page = NULL;
-+}
-+
-+
-+static int __init init_squashfs_fs(void)
-+{
-+
-+      if(!(stream.workspace = (char *) vmalloc(zlib_inflate_workspacesize()))) {
-+              ERROR("Failed to allocate zlib workspace\n");
-+              return -ENOMEM;
-+      }
-+      return register_filesystem(&squashfs_fs_type);
-+}
-+
-+
-+static void __exit exit_squashfs_fs(void)
-+{
-+      vfree(stream.workspace);
-+      unregister_filesystem(&squashfs_fs_type);
-+}
-+
-+
-+EXPORT_NO_SYMBOLS;
-+
-+module_init(init_squashfs_fs);
-+module_exit(exit_squashfs_fs);
-+MODULE_DESCRIPTION("squashfs, a compressed read-only filesystem");
-+MODULE_AUTHOR("Phillip Lougher <plougher@users.sourceforge.net>");
-+MODULE_LICENSE("GPL");
-diff -Nurb linux.orig/include/linux/fs.h linux/include/linux/fs.h
---- linux.orig/include/linux/fs.h      2003-07-04 04:12:25.000000000 -0400
-+++ linux/include/linux/fs.h   2004-05-25 21:13:03.000000000 -0400
-@@ -313,6 +313,7 @@
- #include <linux/usbdev_fs_i.h>
- #include <linux/jffs2_fs_i.h>
- #include <linux/cramfs_fs_sb.h>
-+#include <linux/squashfs_fs_i.h>
- /*
-  * Attribute flags.  These should be or-ed together to figure out what
-@@ -503,6 +504,7 @@
-               struct socket                   socket_i;
-               struct usbdev_inode_info        usbdev_i;
-               struct jffs2_inode_info         jffs2_i;
-+              struct squashfs_inode_info      squashfs_i;
-               void                            *generic_ip;
-       } u;
- };
-@@ -697,6 +699,7 @@
- #include <linux/usbdev_fs_sb.h>
- #include <linux/cramfs_fs_sb.h>
- #include <linux/jffs2_fs_sb.h>
-+#include <linux/squashfs_fs_sb.h>
- extern struct list_head super_blocks;
- extern spinlock_t sb_lock;
-@@ -755,6 +758,7 @@
-               struct usbdev_sb_info   usbdevfs_sb;
-               struct jffs2_sb_info    jffs2_sb;
-               struct cramfs_sb_info   cramfs_sb;
-+              struct squashfs_sb_info squashfs_sb;
-               void                    *generic_sbp;
-       } u;
-       /*
-diff -Nurb linux.orig/include/linux/squashfs_fs.h linux/include/linux/squashfs_fs.h
---- linux.orig/include/linux/squashfs_fs.h     1969-12-31 19:00:00.000000000 -0500
-+++ linux/include/linux/squashfs_fs.h  2004-05-25 21:13:03.000000000 -0400
-@@ -0,0 +1,474 @@
-+#ifndef SQUASHFS_FS
-+#define SQUASHFS_FS
-+/*
-+ * Squashfs
-+ *
-+ * Copyright (c) 2002, 2003, 2004 Phillip Lougher <plougher@users.sourceforge.net>
-+ *
-+ * 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,
-+ * or (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+ *
-+ * squashfs_fs.h
-+ */
-+
-+#define SQUASHFS_MAJOR                        2
-+#define SQUASHFS_MINOR                        0
-+#define SQUASHFS_MAGIC                        0x73717368
-+#define SQUASHFS_MAGIC_SWAP           0x68737173
-+#define SQUASHFS_START                        0
-+
-+/* size of metadata (inode and directory) blocks */
-+#define SQUASHFS_METADATA_SIZE                8192
-+#define SQUASHFS_METADATA_LOG         13
-+
-+/* default size of data blocks */
-+#define SQUASHFS_FILE_SIZE            65536
-+#define SQUASHFS_FILE_LOG             16
-+
-+#define SQUASHFS_FILE_MAX_SIZE                65536
-+
-+/* Max number of uids and gids */
-+#define SQUASHFS_UIDS                 256
-+#define SQUASHFS_GUIDS                        255
-+
-+/* Max length of filename (not 255) */
-+#define SQUASHFS_NAME_LEN             256
-+
-+#define SQUASHFS_INVALID              ((long long) 0xffffffffffff)
-+#define SQUASHFS_INVALID_BLK          ((long long) 0xffffffff)
-+#define SQUASHFS_USED_BLK             ((long long) 0xfffffffe)
-+
-+/* Filesystem flags */
-+#define SQUASHFS_NOI                  0
-+#define SQUASHFS_NOD                  1
-+#define SQUASHFS_CHECK                        2
-+#define SQUASHFS_NOF                  3
-+#define SQUASHFS_NO_FRAG              4
-+#define SQUASHFS_ALWAYS_FRAG          5
-+#define SQUASHFS_DUPLICATE            6
-+#define SQUASHFS_BIT(flag, bit)               ((flag >> bit) & 1)
-+#define SQUASHFS_UNCOMPRESSED_INODES(flags)   SQUASHFS_BIT(flags, SQUASHFS_NOI)
-+#define SQUASHFS_UNCOMPRESSED_DATA(flags)     SQUASHFS_BIT(flags, SQUASHFS_NOD)
-+#define SQUASHFS_UNCOMPRESSED_FRAGMENTS(flags)        SQUASHFS_BIT(flags, SQUASHFS_NOF)
-+#define SQUASHFS_NO_FRAGMENTS(flags)          SQUASHFS_BIT(flags, SQUASHFS_NO_FRAG)
-+#define SQUASHFS_ALWAYS_FRAGMENTS(flags)      SQUASHFS_BIT(flags, SQUASHFS_ALWAYS_FRAG)
-+#define SQUASHFS_DUPLICATES(flags)            SQUASHFS_BIT(flags, SQUASHFS_DUPLICATE)
-+#define SQUASHFS_CHECK_DATA(flags)            SQUASHFS_BIT(flags, SQUASHFS_CHECK)
-+#define SQUASHFS_MKFLAGS(noi, nod, check_data, nof, no_frag, always_frag, duplicate_checking) (noi | (nod << 1) | (check_data << 2) | (nof << 3) | (no_frag << 4) | (always_frag << 5) | (duplicate_checking << 6))
-+
-+/* Max number of types and file types */
-+#define SQUASHFS_DIR_TYPE             1
-+#define SQUASHFS_FILE_TYPE            2
-+#define SQUASHFS_SYMLINK_TYPE         3
-+#define SQUASHFS_BLKDEV_TYPE          4
-+#define SQUASHFS_CHRDEV_TYPE          5
-+#define SQUASHFS_FIFO_TYPE            6
-+#define SQUASHFS_SOCKET_TYPE          7
-+
-+/* 1.0 filesystem type definitions */
-+#define SQUASHFS_TYPES                        5
-+#define SQUASHFS_IPC_TYPE             0
-+
-+/* Flag whether block is compressed or uncompressed, bit is set if block is uncompressed */
-+#define SQUASHFS_COMPRESSED_BIT               (1 << 15)
-+#define SQUASHFS_COMPRESSED_SIZE(B)   (((B) & ~SQUASHFS_COMPRESSED_BIT) ? \
-+                                      (B) & ~SQUASHFS_COMPRESSED_BIT : SQUASHFS_COMPRESSED_BIT)
-+
-+#define SQUASHFS_COMPRESSED(B)                (!((B) & SQUASHFS_COMPRESSED_BIT))
-+
-+#define SQUASHFS_COMPRESSED_BIT_BLOCK         (1 << 24)
-+#define SQUASHFS_COMPRESSED_SIZE_BLOCK(B)     (((B) & ~SQUASHFS_COMPRESSED_BIT_BLOCK) ? \
-+                                      (B) & ~SQUASHFS_COMPRESSED_BIT_BLOCK : SQUASHFS_COMPRESSED_BIT_BLOCK)
-+
-+#define SQUASHFS_COMPRESSED_BLOCK(B)          (!((B) & SQUASHFS_COMPRESSED_BIT_BLOCK))
-+
-+/*
-+ * Inode number ops.  Inodes consist of a compressed block number, and an uncompressed
-+ * offset within that block
-+ */
-+#define SQUASHFS_INODE_BLK(a)         ((unsigned int) ((a) >> 16))
-+#define SQUASHFS_INODE_OFFSET(a)      ((unsigned int) ((a) & 0xffff))
-+#define SQUASHFS_MKINODE(A, B)                ((squashfs_inode)(((squashfs_inode) (A) << 16)\
-+                                      + (B)))
-+
-+/* Compute 32 bit VFS inode number from squashfs inode number */
-+#define SQUASHFS_MK_VFS_INODE(a, b)   ((unsigned int) (((a) << 8) + ((b) >> 2) + 1))
-+
-+/* Translate between VFS mode and squashfs mode */
-+#define SQUASHFS_MODE(a)              ((a) & 0xfff)
-+
-+/* fragment and fragment table defines */
-+typedef unsigned int                  squashfs_fragment_index;
-+#define SQUASHFS_FRAGMENT_BYTES(A)    (A * sizeof(squashfs_fragment_entry))
-+#define SQUASHFS_FRAGMENT_INDEX(A)    (SQUASHFS_FRAGMENT_BYTES(A) / SQUASHFS_METADATA_SIZE)
-+#define SQUASHFS_FRAGMENT_INDEX_OFFSET(A)     (SQUASHFS_FRAGMENT_BYTES(A) % SQUASHFS_METADATA_SIZE)
-+#define SQUASHFS_FRAGMENT_INDEXES(A)  ((SQUASHFS_FRAGMENT_BYTES(A) + SQUASHFS_METADATA_SIZE - 1) / SQUASHFS_METADATA_SIZE)
-+#define SQUASHFS_FRAGMENT_INDEX_BYTES(A)      (SQUASHFS_FRAGMENT_INDEXES(A) * sizeof(squashfs_fragment_index))
-+#define SQUASHFS_CACHED_FRAGMENTS     3
-+
-+/* cached data constants for filesystem */
-+#define SQUASHFS_CACHED_BLKS          8
-+
-+#define SQUASHFS_MAX_FILE_SIZE_LOG    32
-+#define SQUASHFS_MAX_FILE_SIZE                ((long long) 1 << (SQUASHFS_MAX_FILE_SIZE_LOG - 1))
-+
-+#define SQUASHFS_MARKER_BYTE          0xff
-+
-+/*
-+ * definitions for structures on disk
-+ */
-+
-+typedef unsigned int          squashfs_block;
-+typedef long long             squashfs_inode;
-+
-+typedef unsigned int          squashfs_uid;
-+
-+typedef struct squashfs_super_block {
-+      unsigned int            s_magic;
-+      unsigned int            inodes;
-+      unsigned int            bytes_used;
-+      unsigned int            uid_start;
-+      unsigned int            guid_start;
-+      unsigned int            inode_table_start;
-+      unsigned int            directory_table_start;
-+      unsigned int            s_major:16;
-+      unsigned int            s_minor:16;
-+      unsigned int            block_size_1:16;
-+      unsigned int            block_log:16;
-+      unsigned int            flags:8;
-+      unsigned int            no_uids:8;
-+      unsigned int            no_guids:8;
-+      time_t                  mkfs_time /* time of filesystem creation */;
-+      squashfs_inode          root_inode;
-+      unsigned int            block_size;
-+      unsigned int            fragments;
-+      unsigned int            fragment_table_start;
-+} __attribute__ ((packed)) squashfs_super_block;
-+
-+typedef struct {
-+      unsigned int            inode_type:4;
-+      unsigned int            mode:12; /* protection */
-+      unsigned int            uid:8; /* index into uid table */
-+      unsigned int            guid:8; /* index into guid table */
-+} __attribute__ ((packed)) squashfs_base_inode_header;
-+
-+typedef squashfs_base_inode_header squashfs_ipc_inode_header;
-+
-+typedef struct {
-+      unsigned int            inode_type:4;
-+      unsigned int            mode:12; /* protection */
-+      unsigned int            uid:8; /* index into uid table */
-+      unsigned int            guid:8; /* index into guid table */
-+      unsigned short          rdev;
-+} __attribute__ ((packed)) squashfs_dev_inode_header;
-+      
-+typedef struct {
-+      unsigned int            inode_type:4;
-+      unsigned int            mode:12; /* protection */
-+      unsigned int            uid:8; /* index into uid table */
-+      unsigned int            guid:8; /* index into guid table */
-+      unsigned short          symlink_size;
-+      char                    symlink[0];
-+} __attribute__ ((packed)) squashfs_symlink_inode_header;
-+
-+typedef struct {
-+      unsigned int            inode_type:4;
-+      unsigned int            mode:12; /* protection */
-+      unsigned int            uid:8; /* index into uid table */
-+      unsigned int            guid:8; /* index into guid table */
-+      time_t                  mtime;
-+      squashfs_block          start_block;
-+      unsigned int            fragment;
-+      unsigned int            offset;
-+      unsigned int            file_size:SQUASHFS_MAX_FILE_SIZE_LOG;
-+      unsigned short          block_list[0];
-+} __attribute__ ((packed)) squashfs_reg_inode_header;
-+
-+typedef struct {
-+      unsigned int            inode_type:4;
-+      unsigned int            mode:12; /* protection */
-+      unsigned int            uid:8; /* index into uid table */
-+      unsigned int            guid:8; /* index into guid table */
-+      unsigned int            file_size:19;
-+      unsigned int            offset:13;
-+      time_t                  mtime;
-+      unsigned int            start_block:24;
-+} __attribute__  ((packed)) squashfs_dir_inode_header;
-+
-+typedef union {
-+      squashfs_base_inode_header      base;
-+      squashfs_dev_inode_header       dev;
-+      squashfs_symlink_inode_header   symlink;
-+      squashfs_reg_inode_header       reg;
-+      squashfs_dir_inode_header       dir;
-+      squashfs_ipc_inode_header       ipc;
-+} squashfs_inode_header;
-+      
-+typedef struct {
-+      unsigned int            offset:13;
-+      unsigned int            type:3;
-+      unsigned int            size:8;
-+      char                    name[0];
-+} __attribute__ ((packed)) squashfs_dir_entry;
-+
-+typedef struct {
-+      unsigned int            count:8;
-+      unsigned int            start_block:24;
-+} __attribute__ ((packed)) squashfs_dir_header;
-+
-+
-+typedef struct {
-+      unsigned int            start_block;
-+      unsigned int            size;
-+} __attribute__ ((packed)) squashfs_fragment_entry;
-+
-+extern int squashfs_uncompress_block(void *d, int dstlen, void *s, int srclen);
-+extern int squashfs_uncompress_init(void);
-+extern int squashfs_uncompress_exit(void);
-+
-+/*
-+ * macros to convert each packed bitfield structure from little endian to big
-+ * endian and vice versa.  These are needed when creating or using a filesystem on a
-+ * machine with different byte ordering to the target architecture.
-+ *
-+ */
-+
-+#define SQUASHFS_SWAP_SUPER_BLOCK(s, d) {\
-+      SQUASHFS_MEMSET(s, d, sizeof(squashfs_super_block));\
-+      SQUASHFS_SWAP((s)->s_magic, d, 0, 32);\
-+      SQUASHFS_SWAP((s)->inodes, d, 32, 32);\
-+      SQUASHFS_SWAP((s)->bytes_used, d, 64, 32);\
-+      SQUASHFS_SWAP((s)->uid_start, d, 96, 32);\
-+      SQUASHFS_SWAP((s)->guid_start, d, 128, 32);\
-+      SQUASHFS_SWAP((s)->inode_table_start, d, 160, 32);\
-+      SQUASHFS_SWAP((s)->directory_table_start, d, 192, 32);\
-+      SQUASHFS_SWAP((s)->s_major, d, 224, 16);\
-+      SQUASHFS_SWAP((s)->s_minor, d, 240, 16);\
-+      SQUASHFS_SWAP((s)->block_size_1, d, 256, 16);\
-+      SQUASHFS_SWAP((s)->block_log, d, 272, 16);\
-+      SQUASHFS_SWAP((s)->flags, d, 288, 8);\
-+      SQUASHFS_SWAP((s)->no_uids, d, 296, 8);\
-+      SQUASHFS_SWAP((s)->no_guids, d, 304, 8);\
-+      SQUASHFS_SWAP((s)->mkfs_time, d, 312, 32);\
-+      SQUASHFS_SWAP((s)->root_inode, d, 344, 64);\
-+      SQUASHFS_SWAP((s)->block_size, d, 408, 32);\
-+      SQUASHFS_SWAP((s)->fragments, d, 440, 32);\
-+      SQUASHFS_SWAP((s)->fragment_table_start, d, 472, 32);\
-+}
-+
-+#define SQUASHFS_SWAP_BASE_INODE_HEADER(s, d, n) {\
-+      SQUASHFS_MEMSET(s, d, n);\
-+      SQUASHFS_SWAP((s)->inode_type, d, 0, 4);\
-+      SQUASHFS_SWAP((s)->mode, d, 4, 12);\
-+      SQUASHFS_SWAP((s)->uid, d, 16, 8);\
-+      SQUASHFS_SWAP((s)->guid, d, 24, 8);\
-+}
-+
-+#define SQUASHFS_SWAP_IPC_INODE_HEADER(s, d) SQUASHFS_SWAP_BASE_INODE_HEADER(s, d, sizeof(squashfs_ipc_inode_header))
-+
-+#define SQUASHFS_SWAP_DEV_INODE_HEADER(s, d) {\
-+      SQUASHFS_SWAP_BASE_INODE_HEADER(s, d, sizeof(squashfs_dev_inode_header));\
-+      SQUASHFS_SWAP((s)->rdev, d, 32, 16);\
-+}
-+
-+#define SQUASHFS_SWAP_SYMLINK_INODE_HEADER(s, d) {\
-+      SQUASHFS_SWAP_BASE_INODE_HEADER(s, d, sizeof(squashfs_symlink_inode_header));\
-+      SQUASHFS_SWAP((s)->symlink_size, d, 32, 16);\
-+}
-+
-+#define SQUASHFS_SWAP_REG_INODE_HEADER(s, d) {\
-+      SQUASHFS_SWAP_BASE_INODE_HEADER(s, d, sizeof(squashfs_reg_inode_header));\
-+      SQUASHFS_SWAP((s)->mtime, d, 32, 32);\
-+      SQUASHFS_SWAP((s)->start_block, d, 64, 32);\
-+      SQUASHFS_SWAP((s)->fragment, d, 96, 32);\
-+      SQUASHFS_SWAP((s)->offset, d, 128, 32);\
-+      SQUASHFS_SWAP((s)->file_size, d, 160, SQUASHFS_MAX_FILE_SIZE_LOG);\
-+}
-+
-+#define SQUASHFS_SWAP_DIR_INODE_HEADER(s, d) {\
-+      SQUASHFS_SWAP_BASE_INODE_HEADER(s, d, sizeof(squashfs_dir_inode_header));\
-+      SQUASHFS_SWAP((s)->file_size, d, 32, 19);\
-+      SQUASHFS_SWAP((s)->offset, d, 51, 13);\
-+      SQUASHFS_SWAP((s)->mtime, d, 64, 32);\
-+      SQUASHFS_SWAP((s)->start_block, d, 96, 24);\
-+}
-+
-+#define SQUASHFS_SWAP_DIR_HEADER(s, d) {\
-+      SQUASHFS_MEMSET(s, d, sizeof(squashfs_dir_header));\
-+      SQUASHFS_SWAP((s)->count, d, 0, 8);\
-+      SQUASHFS_SWAP((s)->start_block, d, 8, 24);\
-+}
-+
-+#define SQUASHFS_SWAP_DIR_ENTRY(s, d) {\
-+      SQUASHFS_MEMSET(s, d, sizeof(squashfs_dir_entry));\
-+      SQUASHFS_SWAP((s)->offset, d, 0, 13);\
-+      SQUASHFS_SWAP((s)->type, d, 13, 3);\
-+      SQUASHFS_SWAP((s)->size, d, 16, 8);\
-+}
-+
-+#define SQUASHFS_SWAP_FRAGMENT_ENTRY(s, d) {\
-+      SQUASHFS_MEMSET(s, d, sizeof(squashfs_fragment_entry));\
-+      SQUASHFS_SWAP((s)->start_block, d, 0, 32);\
-+      SQUASHFS_SWAP((s)->size, d, 32, 32);\
-+}
-+
-+#define SQUASHFS_SWAP_SHORTS(s, d, n) {\
-+      int entry;\
-+      int bit_position;\
-+      SQUASHFS_MEMSET(s, d, n * 2);\
-+      for(entry = 0, bit_position = 0; entry < n; entry++, bit_position += 16)\
-+              SQUASHFS_SWAP(s[entry], d, bit_position, 16);\
-+}
-+
-+#define SQUASHFS_SWAP_INTS(s, d, n) {\
-+      int entry;\
-+      int bit_position;\
-+      SQUASHFS_MEMSET(s, d, n * 4);\
-+      for(entry = 0, bit_position = 0; entry < n; entry++, bit_position += 32)\
-+              SQUASHFS_SWAP(s[entry], d, bit_position, 32);\
-+}
-+
-+#define SQUASHFS_SWAP_DATA(s, d, n, bits) {\
-+      int entry;\
-+      int bit_position;\
-+      SQUASHFS_MEMSET(s, d, n * bits / 8);\
-+      for(entry = 0, bit_position = 0; entry < n; entry++, bit_position += bits)\
-+              SQUASHFS_SWAP(s[entry], d, bit_position, bits);\
-+}
-+
-+#define SQUASHFS_SWAP_FRAGMENT_INDEXES(s, d, n) SQUASHFS_SWAP_INTS(s, d, n)
-+
-+#ifdef SQUASHFS_1_0_COMPATIBILITY
-+typedef struct {
-+      unsigned int            inode_type:4;
-+      unsigned int            mode:12; /* protection */
-+      unsigned int            uid:4; /* index into uid table */
-+      unsigned int            guid:4; /* index into guid table */
-+} __attribute__ ((packed)) squashfs_base_inode_header_1;
-+
-+typedef struct {
-+      unsigned int            inode_type:4;
-+      unsigned int            mode:12; /* protection */
-+      unsigned int            uid:4; /* index into uid table */
-+      unsigned int            guid:4; /* index into guid table */
-+      unsigned int            type:4;
-+      unsigned int            offset:4;
-+} __attribute__ ((packed)) squashfs_ipc_inode_header_1;
-+
-+typedef struct {
-+      unsigned int            inode_type:4;
-+      unsigned int            mode:12; /* protection */
-+      unsigned int            uid:4; /* index into uid table */
-+      unsigned int            guid:4; /* index into guid table */
-+      unsigned short          rdev;
-+} __attribute__ ((packed)) squashfs_dev_inode_header_1;
-+      
-+typedef struct {
-+      unsigned int            inode_type:4;
-+      unsigned int            mode:12; /* protection */
-+      unsigned int            uid:4; /* index into uid table */
-+      unsigned int            guid:4; /* index into guid table */
-+      unsigned short          symlink_size;
-+      char                    symlink[0];
-+} __attribute__ ((packed)) squashfs_symlink_inode_header_1;
-+
-+typedef struct {
-+      unsigned int            inode_type:4;
-+      unsigned int            mode:12; /* protection */
-+      unsigned int            uid:4; /* index into uid table */
-+      unsigned int            guid:4; /* index into guid table */
-+      time_t                  mtime;
-+      squashfs_block          start_block;
-+      unsigned int            file_size:SQUASHFS_MAX_FILE_SIZE_LOG;
-+      unsigned short          block_list[0];
-+} __attribute__ ((packed)) squashfs_reg_inode_header_1;
-+
-+typedef struct {
-+      unsigned int            inode_type:4;
-+      unsigned int            mode:12; /* protection */
-+      unsigned int            uid:4; /* index into uid table */
-+      unsigned int            guid:4; /* index into guid table */
-+      unsigned int            file_size:19;
-+      unsigned int            offset:13;
-+      time_t                  mtime;
-+      unsigned int            start_block:24;
-+} __attribute__  ((packed)) squashfs_dir_inode_header_1;
-+
-+#define SQUASHFS_SWAP_BASE_INODE_HEADER_1(s, d, n) {\
-+      SQUASHFS_MEMSET(s, d, n);\
-+      SQUASHFS_SWAP((s)->inode_type, d, 0, 4);\
-+      SQUASHFS_SWAP((s)->mode, d, 4, 12);\
-+      SQUASHFS_SWAP((s)->uid, d, 16, 4);\
-+      SQUASHFS_SWAP((s)->guid, d, 20, 4);\
-+}
-+
-+#define SQUASHFS_SWAP_IPC_INODE_HEADER_1(s, d) {\
-+      SQUASHFS_SWAP_BASE_INODE_HEADER_1(s, d, sizeof(squashfs_ipc_inode_header_1));\
-+      SQUASHFS_SWAP((s)->type, d, 24, 4);\
-+      SQUASHFS_SWAP((s)->offset, d, 28, 4);\
-+}
-+
-+#define SQUASHFS_SWAP_DEV_INODE_HEADER_1(s, d) {\
-+      SQUASHFS_SWAP_BASE_INODE_HEADER_1(s, d, sizeof(squashfs_dev_inode_header_1));\
-+      SQUASHFS_SWAP((s)->rdev, d, 24, 16);\
-+}
-+
-+#define SQUASHFS_SWAP_SYMLINK_INODE_HEADER_1(s, d) {\
-+      SQUASHFS_SWAP_BASE_INODE_HEADER(s, d, sizeof(squashfs_symlink_inode_header_1));\
-+      SQUASHFS_SWAP((s)->symlink_size, d, 24, 16);\
-+}
-+
-+#define SQUASHFS_SWAP_REG_INODE_HEADER_1(s, d) {\
-+      SQUASHFS_SWAP_BASE_INODE_HEADER(s, d, sizeof(squashfs_reg_inode_header_1));\
-+      SQUASHFS_SWAP((s)->mtime, d, 24, 32);\
-+      SQUASHFS_SWAP((s)->start_block, d, 56, 32);\
-+      SQUASHFS_SWAP((s)->file_size, d, 88, SQUASHFS_MAX_FILE_SIZE_LOG);\
-+}
-+
-+#define SQUASHFS_SWAP_DIR_INODE_HEADER_1(s, d) {\
-+      SQUASHFS_SWAP_BASE_INODE_HEADER(s, d, sizeof(squashfs_dir_inode_header_1));\
-+      SQUASHFS_SWAP((s)->file_size, d, 24, 19);\
-+      SQUASHFS_SWAP((s)->offset, d, 43, 13);\
-+      SQUASHFS_SWAP((s)->mtime, d, 56, 32);\
-+      SQUASHFS_SWAP((s)->start_block, d, 88, 24);\
-+}
-+#endif
-+
-+#ifdef __KERNEL__
-+/*
-+ * macros used to swap each structure entry, taking into account
-+ * bitfields and different bitfield placing conventions on differing architectures
-+ */
-+#include <asm/byteorder.h>
-+#ifdef __BIG_ENDIAN
-+      /* convert from little endian to big endian */
-+#define SQUASHFS_SWAP(value, p, pos, tbits) _SQUASHFS_SWAP(value, p, pos, tbits, b_pos)
-+#else
-+      /* convert from big endian to little endian */ 
-+#define SQUASHFS_SWAP(value, p, pos, tbits) _SQUASHFS_SWAP(value, p, pos, tbits, 64 - tbits - b_pos)
-+#endif
-+
-+#define _SQUASHFS_SWAP(value, p, pos, tbits, SHIFT) {\
-+      int bits;\
-+      int b_pos = pos % 8;\
-+      unsigned long long val = 0;\
-+      unsigned char *s = (unsigned char *)p + (pos / 8);\
-+      unsigned char *d = ((unsigned char *) &val) + 7;\
-+      for(bits = 0; bits < (tbits + b_pos); bits += 8) \
-+              *d-- = *s++;\
-+      value = (val >> (SHIFT))/* & ((1 << tbits) - 1)*/;\
-+}
-+#define SQUASHFS_MEMSET(s, d, n)      memset(s, 0, n);
-+#endif
-+#endif
-diff -Nurb linux.orig/include/linux/squashfs_fs_i.h linux/include/linux/squashfs_fs_i.h
---- linux.orig/include/linux/squashfs_fs_i.h   1969-12-31 19:00:00.000000000 -0500
-+++ linux/include/linux/squashfs_fs_i.h        2004-05-25 21:13:03.000000000 -0400
-@@ -0,0 +1,33 @@
-+#ifndef SQUASHFS_FS_I
-+#define SQUASHFS_FS_I
-+/*
-+ * Squashfs
-+ *
-+ * Copyright (c) 2002, 2003, 2004 Phillip Lougher <plougher@users.sourceforge.net>
-+ *
-+ * 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,
-+ * or (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+ *
-+ * squashfs_fs_i.h
-+ */
-+
-+typedef struct squashfs_inode_info {
-+      unsigned int    start_block;
-+      unsigned int    block_list_start;
-+      unsigned int    offset;
-+      unsigned int    fragment_start_block;
-+      unsigned int    fragment_size;
-+      unsigned int    fragment_offset;
-+      } squashfs_inode_info;
-+#endif
-diff -Nurb linux.orig/include/linux/squashfs_fs_sb.h linux/include/linux/squashfs_fs_sb.h
---- linux.orig/include/linux/squashfs_fs_sb.h  1969-12-31 19:00:00.000000000 -0500
-+++ linux/include/linux/squashfs_fs_sb.h       2004-05-25 21:13:03.000000000 -0400
-@@ -0,0 +1,65 @@
-+#ifndef SQUASHFS_FS_SB
-+#define SQUASHFS_FS_SB
-+/*
-+ * Squashfs
-+ *
-+ * Copyright (c) 2002, 2003, 2004 Phillip Lougher <plougher@users.sourceforge.net>
-+ *
-+ * 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,
-+ * or (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+ *
-+ * squashfs_fs_sb.h
-+ */
-+
-+#include <linux/squashfs_fs.h>
-+
-+typedef struct {
-+      unsigned int    block;
-+      int             length;
-+      unsigned int    next_index;
-+      char            *data;
-+      } squashfs_cache;
-+
-+struct squashfs_fragment_cache {
-+      unsigned int    block;
-+      int             length;
-+      unsigned int    locked;
-+      char            *data;
-+      };
-+
-+typedef struct squashfs_sb_info {
-+      squashfs_super_block    sBlk;
-+      int                     devblksize;
-+      int                     devblksize_log2;
-+      int                     swap;
-+      squashfs_cache          *block_cache;
-+      struct squashfs_fragment_cache  *fragment;
-+      int                     next_cache;
-+      int                     next_fragment;
-+      squashfs_uid            *uid;
-+      squashfs_uid            *guid;
-+      squashfs_fragment_index         *fragment_index;
-+      unsigned int            read_size;
-+      char                    *read_data;
-+      char                    *read_page;
-+      struct semaphore        read_page_mutex;
-+      struct semaphore        block_cache_mutex;
-+      struct semaphore        fragment_mutex;
-+      wait_queue_head_t       waitq;
-+      wait_queue_head_t       fragment_wait_queue;
-+      struct inode            *(*iget)(struct super_block *s, squashfs_inode inode);
-+      unsigned int            (*read_blocklist)(struct inode *inode, int index, int readahead_blks,
-+                                      char *block_list, char **block_p, unsigned int *bsize);
-+      } squashfs_sb_info;
-+#endif
-diff -Nurb linux.orig/init/do_mounts.c linux/init/do_mounts.c
---- linux.orig/init/do_mounts.c        2003-11-08 03:13:20.000000000 -0500
-+++ linux/init/do_mounts.c     2004-05-25 21:13:03.000000000 -0400
-@@ -16,6 +16,7 @@
- #include <linux/ext2_fs.h>
- #include <linux/romfs_fs.h>
- #include <linux/cramfs_fs.h>
-+#include <linux/squashfs_fs.h>
- #undef BUILD_CRAMDISK
-@@ -470,6 +471,7 @@
-  *    ext2
-  *    romfs
-  *    gzip
-+ *    squashfs
-  */
- static int __init 
- identify_ramdisk_image(int fd, int start_block)
-@@ -479,6 +481,7 @@
-       struct ext2_super_block *ext2sb;
-       struct romfs_super_block *romfsb;
-       struct cramfs_super *cramfsb;
-+      struct squashfs_super_block *squashfsb;
-       int nblocks = -1;
-       unsigned char *buf;
-@@ -490,6 +493,7 @@
-       ext2sb = (struct ext2_super_block *) buf;
-       romfsb = (struct romfs_super_block *) buf;
-       cramfsb = (struct cramfs_super *) buf;
-+      squashfsb = (struct squashfs_super_block *) buf;
-       memset(buf, 0xe5, size);
-       /*
-@@ -536,6 +540,15 @@
-               goto done;
-       }
-+      /* squashfs is at block zero too */
-+      if (squashfsb->s_magic == SQUASHFS_MAGIC) {
-+              printk(KERN_NOTICE
-+                     "RAMDISK: squashfs filesystem found at block %d\n",
-+                     start_block);
-+              nblocks = (squashfsb->bytes_used+BLOCK_SIZE-1)>>BLOCK_SIZE_BITS;
-+              goto done;
-+      }
-+
-       /*
-        * Read block 1 to test for minix and ext2 superblock
-        */
-diff -Nurb linux.orig/kernel/ksyms.c linux/kernel/ksyms.c
---- linux.orig/kernel/ksyms.c  2003-07-04 04:12:28.000000000 -0400
-+++ linux/kernel/ksyms.c       2004-05-25 21:12:24.000000000 -0400
-@@ -482,9 +482,9 @@
- EXPORT_SYMBOL(simple_strtoull);
- EXPORT_SYMBOL(system_utsname);        /* UTS data */
- EXPORT_SYMBOL(uts_sem);               /* UTS semaphore */
--#ifndef __mips__
-+//#ifndef __mips__ //bite me. -mbm.
- EXPORT_SYMBOL(sys_call_table);
--#endif
-+//#endif
- EXPORT_SYMBOL(machine_restart);
- EXPORT_SYMBOL(machine_halt);
- EXPORT_SYMBOL(machine_power_off);
-diff -Nurb linux.orig/lib/Config.in linux/lib/Config.in
---- linux.orig/lib/Config.in   2003-07-04 04:12:29.000000000 -0400
-+++ linux/lib/Config.in        2004-05-25 21:13:03.000000000 -0400
-@@ -8,12 +8,14 @@
- # Do we need the compression support?
- #
- if [ "$CONFIG_CRAMFS" = "y" -o \
-+     "$CONFIG_SQUASHFS" = "y" -o \
-      "$CONFIG_PPP_DEFLATE" = "y" -o \
-      "$CONFIG_JFFS2_FS" = "y" -o \
-      "$CONFIG_ZISOFS_FS" = "y" ]; then
-    define_tristate CONFIG_ZLIB_INFLATE y
- else
-   if [ "$CONFIG_CRAMFS" = "m" -o \
-+       "$CONFIG_SQUASHFS" = "m" -o \
-        "$CONFIG_PPP_DEFLATE" = "m" -o \
-        "$CONFIG_JFFS2_FS" = "m" -o \
-        "$CONFIG_ZISOFS_FS" = "m" ]; then
diff --git a/obsolete-buildroot/sources/openwrt/kernel/patches/130-nfsswap.patch b/obsolete-buildroot/sources/openwrt/kernel/patches/130-nfsswap.patch
deleted file mode 100644 (file)
index d2f8e7a..0000000
+++ /dev/null
@@ -1,2362 +0,0 @@
-diff -Nurb linux.orig/Documentation/netswap.txt linux/Documentation/netswap.txt
---- linux.orig/Documentation/netswap.txt       1969-12-31 19:00:00.000000000 -0500
-+++ linux/Documentation/netswap.txt    2004-05-31 02:18:03.000000000 -0400
-@@ -0,0 +1,51 @@
-+                     Swapping over network
-+
-+Support for this is enabled via the CONFIG_NETSWAP option, which is
-+automatically enabled when enabling swap files located on NFS volumes
-+(CONFIG_SWAP_VIA_NFS).
-+
-+When swapping to files located on a network file system like NFS or
-+CODA or others or to nbd (network block device, see `nbd.txt')
-+partitions there is the problem that this requires additional memory,
-+besides the page which is currently swapped in or out, probably at
-+least two more pages for each page in question.
-+
-+This means that not only there needs to be free space left in the swap
-+file or the swap partition, but in addition there must be enough free
-+memory left in the system to perform the swap out of pages.
-+
-+This is particularly painful as receiving data over the network itself
-+consumes memory, and this memory is allocated from an interrupt
-+context (i.e. in the interrupt handler of the network card). That
-+means that on a congested network there are chances that the machine
-+runs out of memory, simply because the network device's interrupt
-+routines allocate memory faster that it is freed by swapping via
-+network.
-+
-+To cope with this problem, there is a new socket option `SO_SWAPPING'
-+which has to be set on the `SOL_SOCKET' level with setsockopt() (see
-+setsockopt(2)). When this option is set on any network socket, then
-+the system will start to drop network packets it receives on any other
-+socket when the number of free pages falls below a certain threshold.
-+
-+This threshold initially is 4 pages less than `freepages.min' (see
-+`Documentation/sysctl/vm.txt') but can be tuned using the sysctl
-+interface by writing to the file `/proc/sys/net/swapping/threshold'
-+
-+There are two other files:
-+
-+`/proc/sys/net/swapping/dropped':
-+    how many network packets have been dropped so far. This file is
-+    writable, writing to it simply sets the counter to the given value
-+    (useful for resetting the counter).
-+
-+`/proc/sys/net/swapping/sock_count':
-+    How many network sockets have the `SO_SWAPPING' option set (read
-+    only, of course).
-+
-+When using swap-files on NFS volumes, then the `SO_SWAPPING' option is
-+set or cleared by swapon/swapoff system calls, so the user need not
-+care about it.
-+
-+Swapping over the network is insecure unless the data would be
-+encrypted, which is not the case with NFS. It is also very slow.
-diff -Nurb linux.orig/Documentation/nfsswap.txt linux/Documentation/nfsswap.txt
---- linux.orig/Documentation/nfsswap.txt       1969-12-31 19:00:00.000000000 -0500
-+++ linux/Documentation/nfsswap.txt    2004-05-31 02:18:03.000000000 -0400
-@@ -0,0 +1,41 @@
-+                   Swapping to files on NFS volumes
-+
-+To  do  this you have to  say  `Y' or  `M'  to the CONFIG_SWAP_VIA_NFS
-+configuration  option. When compling support  for this as a module you
-+should  read  `Documentation/modules.txt'.  For  auto-loading  of  the
-+module during the `swapon' system call you have to place a line like
-+
-+alias swapfile-mod nfsswap
-+
-+in   `/etc/modules.conf'  (or `/etc/conf.modules',  depending  on your
-+setup). NFS volumes  holding swapfile should  be mounted  with `rsize'
-+and `wsize' set to something  less than the size  of a page, otherwise
-+deadlocks  caused by memory fragmentation can  happen,  i.e. mount the
-+volume which is to hold the swapfiles with
-+
-+mount -t nfs -o rsize=2048,wsize=2048 NFS_SERVER_IP:/server_volume /mount_point
-+
-+or set the option in `/etc/fstab'. Read `Documentation/nfsroot.txt' to
-+learn how to set mount options for the root file  system, if your swap
-+files are to be located on the root file system.
-+
-+Setting the  `rsize' and `wsize' to  anything less than PAGE_SIZE is a
-+performance hit, so  you probably want to  have  at least two  volumes
-+mounted, one for the swapfiles, one for the rest.
-+
-+You may want to read `Documentation/netswap.txt' as well.
-+
-+Swapfiles on NFS volumes can be treated like any other swapfile,
-+i.e.
-+
-+dd if=/dev/zero of=/swapfiles/SWAPFILE bs=1k count=20480
-+mkswap /swapfiles/SWAPFILE
-+swapon /swapfiles/SWAPFILE
-+
-+will  create a 20M swapfile and  tell the system  to use it. Actually,
-+one could use lseek(2) to create  an empty swapfile. This is different
-+from swapfiles located on local harddisk.
-+
-+Swapping  over  the network is   insecure   unless the data  would  be
-+encrypted, which is not the case with NFS. It is also very slow.
-+
-diff -Nurb linux.orig/drivers/block/blkpg.c linux/drivers/block/blkpg.c
---- linux.orig/drivers/block/blkpg.c   2003-07-04 04:11:31.000000000 -0400
-+++ linux/drivers/block/blkpg.c        2004-05-31 02:18:03.000000000 -0400
-@@ -34,7 +34,7 @@
- #include <linux/blk.h>                        /* for set_device_ro() */
- #include <linux/blkpg.h>
- #include <linux/genhd.h>
--#include <linux/swap.h>                       /* for is_swap_partition() */
-+#include <linux/swap.h>                       /* for swap_run_test() */
- #include <linux/module.h>               /* for EXPORT_SYMBOL */
- #include <asm/uaccess.h>
-@@ -114,6 +114,29 @@
-       return 0;
- }
-+/* swap_run_test() applies this hook to all swapfiles until it returns
-+ * "1".  If it never returns "1", the result of swap_run_test() is "0",
-+ * otherwise "1".
-+ */
-+static int is_swap_partition_hook(unsigned int flags, struct file *swap_file,
-+                                void *testdata)
-+{
-+      kdev_t swap_dev = S_ISBLK(swap_file->f_dentry->d_inode->i_mode)
-+              ? swap_file->f_dentry->d_inode->i_rdev : 0;
-+      kdev_t dev = *((kdev_t *)testdata);
-+      
-+      if (flags & SWP_USED && dev == swap_dev) {
-+              return 1;
-+      } else {
-+              return 0;
-+      }
-+}
-+
-+static inline int is_swap_partition(kdev_t dev)
-+{
-+      return swap_run_test(is_swap_partition_hook, &dev);
-+}
-+
- /*
-  * Delete a partition given by partition number
-  *
-diff -Nurb linux.orig/fs/Config.in linux/fs/Config.in
---- linux.orig/fs/Config.in    2004-05-31 02:02:43.000000000 -0400
-+++ linux/fs/Config.in 2004-05-31 02:18:03.000000000 -0400
-@@ -4,6 +4,12 @@
- mainmenu_option next_comment
- comment 'File systems'
-+if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-+   tristate 'Swapping to block devices' CONFIG_BLKDEV_SWAP
-+else
-+   define_bool CONFIG_BLKDEV_SWAP y
-+fi
-+
- bool 'Quota support' CONFIG_QUOTA
- tristate 'Kernel automounter support' CONFIG_AUTOFS_FS
- tristate 'Kernel automounter version 4 support (also supports v3)' CONFIG_AUTOFS4_FS
-@@ -110,6 +116,12 @@
-    dep_tristate 'NFS file system support' CONFIG_NFS_FS $CONFIG_INET
-    dep_mbool '  Provide NFSv3 client support' CONFIG_NFS_V3 $CONFIG_NFS_FS
-    dep_bool '  Root file system on NFS' CONFIG_ROOT_NFS $CONFIG_NFS_FS $CONFIG_IP_PNP
-+   if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-+      dep_tristate '  Swapping via NFS (EXPERIMENTAL)' CONFIG_SWAP_VIA_NFS $CONFIG_NFS_FS
-+      if [ "$CONFIG_SWAP_VIA_NFS" = "y" -o "$CONFIG_SWAP_VIA_NFS" = "m" ]; then
-+         define_bool CONFIG_NETSWAP  y
-+      fi
-+   fi
-    dep_tristate 'NFS server support' CONFIG_NFSD $CONFIG_INET
-    dep_mbool '  Provide NFSv3 server support' CONFIG_NFSD_V3 $CONFIG_NFSD
-diff -Nurb linux.orig/fs/Makefile linux/fs/Makefile
---- linux.orig/fs/Makefile     2004-05-31 02:02:42.000000000 -0400
-+++ linux/fs/Makefile  2004-05-31 02:18:03.000000000 -0400
-@@ -8,7 +8,7 @@
- O_TARGET := fs.o
- export-objs :=        filesystems.o open.o dcache.o buffer.o
--mod-subdirs :=        nls
-+mod-subdirs :=        nls nfs
- obj-y :=      open.o read_write.o devices.o file_table.o buffer.o \
-               super.o block_dev.o char_dev.o stat.o exec.o pipe.o namei.o \
-@@ -70,6 +70,7 @@
- subdir-$(CONFIG_JFS_FS)               += jfs
- subdir-$(CONFIG_SQUASHFS)     += squashfs
-+obj-$(CONFIG_BLKDEV_SWAP)       += blkdev_swap.o
- obj-$(CONFIG_BINFMT_AOUT)     += binfmt_aout.o
- obj-$(CONFIG_BINFMT_EM86)     += binfmt_em86.o
-diff -Nurb linux.orig/fs/blkdev_swap.c linux/fs/blkdev_swap.c
---- linux.orig/fs/blkdev_swap.c        1969-12-31 19:00:00.000000000 -0500
-+++ linux/fs/blkdev_swap.c     2004-05-31 02:18:03.000000000 -0400
-@@ -0,0 +1,309 @@
-+/*
-+ * Swapping to partitions or files located on partitions.
-+ */
-+
-+#include <linux/config.h>
-+#include <linux/module.h>
-+#include <linux/init.h>
-+#include <linux/slab.h>
-+#include <linux/locks.h>
-+#include <linux/blkdev.h>
-+#include <linux/pagemap.h>
-+#include <linux/swap.h>
-+#include <linux/fs.h>
-+
-+#ifdef DEBUG_BLKDEV_SWAP
-+# define dprintk(fmt...) printk(##fmt)
-+#else
-+# define dprintk(fmt...) do { /* */ } while (0)
-+#endif
-+
-+#define BLKDEV_SWAP_ID      "blkdev"
-+#define BLKDEV_FILE_SWAP_ID "blkdev file"
-+
-+/*
-+ * Helper function, copied here from buffer.c
-+ */
-+
-+/*
-+ * Start I/O on a page.
-+ * This function expects the page to be locked and may return
-+ * before I/O is complete. You then have to check page->locked
-+ * and page->uptodate.
-+ *
-+ * brw_page() is SMP-safe, although it's being called with the
-+ * kernel lock held - but the code is ready.
-+ *
-+ * FIXME: we need a swapper_inode->get_block function to remove
-+ *        some of the bmap kludges and interface ugliness here.
-+ */
-+int brw_page(int rw, struct page *page, kdev_t dev, int b[], int size)
-+{
-+      struct buffer_head *head, *bh;
-+
-+      if (!PageLocked(page))
-+              panic("brw_page: page not locked for I/O");
-+
-+      if (!page->buffers)
-+              create_empty_buffers(page, dev, size);
-+      head = bh = page->buffers;
-+
-+      /* Stage 1: lock all the buffers */
-+      do {
-+              lock_buffer(bh);
-+              bh->b_blocknr = *(b++);
-+              set_bit(BH_Mapped, &bh->b_state);
-+              set_buffer_async_io(bh);
-+              bh = bh->b_this_page;
-+      } while (bh != head);
-+
-+      /* Stage 2: start the IO */
-+      do {
-+              struct buffer_head *next = bh->b_this_page;
-+              submit_bh(rw, bh);
-+              bh = next;
-+      } while (bh != head);
-+      return 0;
-+}
-+
-+/*
-+ * We implement to methods: swapping to partitions, and swapping to files
-+ * located on partitions.
-+ */
-+
-+struct blkdev_swap_data {
-+      kdev_t dev;
-+};
-+
-+struct test_data {
-+      struct file * filp;
-+      kdev_t dev;
-+};
-+
-+static int is_blkdev_swapping(unsigned int flags,
-+                            struct file * swapf,
-+                            void *data)
-+{
-+      struct test_data *testdata = (struct test_data *) data;
-+      struct file * filp = testdata->filp;
-+      kdev_t dev = testdata->dev;
-+
-+      /* Only check filp's that don't match the one already opened
-+       * for us by sys_swapon(). Otherwise, we will always flag a
-+       * busy swap file.
-+       */
-+
-+      if (swapf != filp) {
-+              if (dev == swapf->f_dentry->d_inode->i_rdev)
-+                      return 1;
-+      }
-+      return 0;
-+}
-+
-+static int blkdev_swap_open(struct file * filp, void **dptr)
-+{
-+      int swapfilesize;
-+      kdev_t dev;
-+      struct blkdev_swap_data *data;
-+      int error;
-+      struct test_data testdata;
-+
-+      MOD_INC_USE_COUNT;
-+
-+      if (!S_ISBLK(filp->f_dentry->d_inode->i_mode)) {
-+              dprintk(__FUNCTION__": can't handle this swap file: %s\n",
-+                     swapf->d_name.name);
-+              error = 0; /* not for us */
-+              goto bad_swap;
-+      }
-+      
-+      dev = filp->f_dentry->d_inode->i_rdev;
-+      set_blocksize(dev, PAGE_SIZE);
-+      error = -ENODEV;
-+      if (!dev ||
-+          (blk_size[MAJOR(dev)] && !blk_size[MAJOR(dev)][MINOR(dev)])) {
-+              printk("blkdev_swap_open: blkdev weirdness for %s\n",
-+                     filp->f_dentry->d_name.name);
-+              goto bad_swap;
-+      }
-+              
-+      /* Check to make sure that we aren't already swapping. */
-+      error = -EBUSY;
-+      testdata.filp = filp;
-+      testdata.dev = dev;
-+      if (swap_run_test(is_blkdev_swapping, &testdata)) {
-+              printk("blkdev_swap_open: already swapping to %s\n",
-+                     filp->f_dentry->d_name.name);
-+              goto bad_swap;
-+      }
-+
-+      swapfilesize = 0;
-+      if (blk_size[MAJOR(dev)])
-+              swapfilesize = blk_size[MAJOR(dev)][MINOR(dev)]
-+                      >> (PAGE_SHIFT - 10);
-+
-+      if ((data = kmalloc(sizeof(*data), GFP_KERNEL)) == NULL) {
-+              printk("blkdev_swap_open: can't allocate data for %s\n",
-+                     filp->f_dentry->d_name.name);
-+              error = -ENOMEM;
-+              goto bad_swap;
-+      }
-+      data->dev = dev;
-+      *dptr = data;
-+
-+      dprintk("blkdev_swap_open: returning %d\n", swapfilesize);
-+      return swapfilesize;
-+
-+ bad_swap:
-+      MOD_DEC_USE_COUNT;
-+      return error; /* this swap thing is not for us */       
-+}
-+
-+static int blkdev_swap_release(struct file * filp, void *data)
-+{
-+      dprintk("blkdev_swap_release: releasing swap device %s\n",
-+              filp->f_dentry->d_name.name);
-+      kfree(data);
-+      MOD_DEC_USE_COUNT;
-+      return 0;
-+}
-+
-+static int blkdev_rw_page(int rw, struct page *page, unsigned long offset,
-+                        void *ptr)
-+{
-+      struct blkdev_swap_data *data = (struct blkdev_swap_data *)ptr;
-+      brw_page(rw, page, data->dev, (int *)&offset, PAGE_SIZE);
-+      return 1;
-+}
-+
-+static struct swap_ops blkdev_swap_ops = {
-+      blkdev_swap_open,
-+      blkdev_swap_release,
-+      blkdev_rw_page
-+};
-+
-+struct blkdevfile_swap_data {
-+      struct inode *swapf;
-+};
-+
-+static int is_blkdevfile_swapping(unsigned int flags,
-+                                struct file * swapf,
-+                                void * data)
-+{
-+      struct file * filp = (struct file *) data;
-+
-+      /* Only check filp's that don't match the one already opened
-+       * for us by sys_swapon(). Otherwise, we will always flag a
-+       * busy swap file.
-+       */
-+
-+      if (swapf != filp) {
-+              if (filp->f_dentry->d_inode == swapf->f_dentry->d_inode)
-+                      return 1;
-+      }
-+      return 0;
-+}
-+
-+static int blkdevfile_swap_open(struct file *swapf, void **dptr)
-+{
-+      int error = 0;
-+      int swapfilesize;
-+      struct blkdevfile_swap_data *data;
-+
-+      MOD_INC_USE_COUNT;
-+
-+      /* first check whether this is a regular file located on a local 
-+       * hard disk
-+       */
-+      if (!S_ISREG(swapf->f_dentry->d_inode->i_mode)) {
-+              dprintk("blkdevfile_swap_open: "
-+                      "can't handle this swap file: %s\n",
-+                      swapf->d_name.name);
-+              error = 0; /* not for us */
-+              goto bad_swap;
-+      }
-+      if (!swapf->f_dentry->d_inode->i_mapping->a_ops->bmap) {
-+              dprintk("blkdevfile_swap_open: no bmap for file: %s\n",
-+                      swapf->d_name.name);
-+              error = 0; /* not for us */
-+              goto bad_swap;
-+      }
-+
-+      if (swap_run_test(is_blkdevfile_swapping, swapf)) {
-+              dprintk("blkdevfile_swap_open: already swapping to %s\n",
-+                      swapf->d_name.name);
-+              error = -EBUSY;
-+              goto bad_swap;
-+      }
-+      swapfilesize = swapf->f_dentry->d_inode->i_size >> PAGE_SHIFT;
-+      if ((data = kmalloc(sizeof(*data), GFP_KERNEL)) == NULL) {
-+              error = -ENOMEM;
-+              goto bad_swap;
-+      }
-+      data->swapf = swapf->f_dentry->d_inode;
-+      *dptr = data;
-+      return swapfilesize;
-+
-+ bad_swap:
-+      MOD_DEC_USE_COUNT;
-+      return error;
-+}
-+
-+static int blkdevfile_swap_release(struct file *swapf, void *data)
-+{
-+      kfree(data);
-+      MOD_DEC_USE_COUNT;
-+      return 0;
-+}
-+
-+static int blkdevfile_rw_page(int rw, struct page *page, unsigned long offset,
-+                            void *ptr)
-+{
-+      struct blkdevfile_swap_data *data = (struct blkdevfile_swap_data *)ptr;
-+      struct inode * swapf = data->swapf;
-+      int i, j;
-+      unsigned int block = offset
-+              << (PAGE_SHIFT - swapf->i_sb->s_blocksize_bits);
-+      kdev_t dev = swapf->i_dev;
-+      int block_size;
-+      int zones[PAGE_SIZE/512];
-+      int zones_used;
-+
-+      block_size = swapf->i_sb->s_blocksize;
-+      for (i=0, j=0; j< PAGE_SIZE ; i++, j += block_size)
-+              if (!(zones[i] = bmap(swapf,block++))) {
-+                      printk("blkdevfile_rw_page: bad swap file\n");
-+                      return 0;
-+                      }
-+      zones_used = i;
-+      
-+      /* block_size == PAGE_SIZE/zones_used */
-+      brw_page(rw, page, dev, zones, block_size);
-+      return 1;
-+}
-+
-+static struct swap_ops blkdevfile_swap_ops = {
-+      blkdevfile_swap_open,
-+      blkdevfile_swap_release,
-+      blkdevfile_rw_page
-+ };
-+
-+int __init blkdev_swap_init(void)
-+{
-+      (void)register_swap_method(BLKDEV_SWAP_ID, &blkdev_swap_ops);
-+      (void)register_swap_method(BLKDEV_FILE_SWAP_ID, &blkdevfile_swap_ops);
-+      return 0;
-+}
-+
-+void __exit blkdev_swap_exit(void)
-+{
-+      unregister_swap_method(BLKDEV_SWAP_ID);
-+      unregister_swap_method(BLKDEV_FILE_SWAP_ID);
-+}
-+
-+module_init(blkdev_swap_init)
-+module_exit(blkdev_swap_exit)
-+
-+MODULE_LICENSE("GPL");
-+MODULE_AUTHOR("Many. Stuffed into a module by cH (Claus-Justus Heine)");
-+MODULE_DESCRIPTION("Swapping to partitions and files on local hard-disks");
-diff -Nurb linux.orig/fs/buffer.c linux/fs/buffer.c
---- linux.orig/fs/buffer.c     2003-07-04 04:12:05.000000000 -0400
-+++ linux/fs/buffer.c  2004-05-31 02:21:05.000000000 -0400
-@@ -743,7 +743,7 @@
-       bh->b_private = private;
- }
--static void end_buffer_io_async(struct buffer_head * bh, int uptodate)
-+void end_buffer_io_async(struct buffer_head * bh, int uptodate)
- {
-       static spinlock_t page_uptodate_lock = SPIN_LOCK_UNLOCKED;
-       unsigned long flags;
-@@ -2344,35 +2344,6 @@
-       return err;
- }
--int brw_page(int rw, struct page *page, kdev_t dev, int b[], int size)
--{
--      struct buffer_head *head, *bh;
--
--      if (!PageLocked(page))
--              panic("brw_page: page not locked for I/O");
--
--      if (!page->buffers)
--              create_empty_buffers(page, dev, size);
--      head = bh = page->buffers;
--
--      /* Stage 1: lock all the buffers */
--      do {
--              lock_buffer(bh);
--              bh->b_blocknr = *(b++);
--              set_bit(BH_Mapped, &bh->b_state);
--              set_buffer_async_io(bh);
--              bh = bh->b_this_page;
--      } while (bh != head);
--
--      /* Stage 2: start the IO */
--      do {
--              struct buffer_head *next = bh->b_this_page;
--              submit_bh(rw, bh);
--              bh = next;
--      } while (bh != head);
--      return 0;
--}
--
- int block_symlink(struct inode *inode, const char *symname, int len)
- {
-       struct address_space *mapping = inode->i_mapping;
-diff -Nurb linux.orig/fs/nfs/Makefile linux/fs/nfs/Makefile
---- linux.orig/fs/nfs/Makefile 2003-07-04 04:12:07.000000000 -0400
-+++ linux/fs/nfs/Makefile      2004-05-31 02:18:03.000000000 -0400
-@@ -15,6 +15,14 @@
- obj-$(CONFIG_ROOT_NFS) += nfsroot.o mount_clnt.o      
- obj-$(CONFIG_NFS_V3) += nfs3proc.o nfs3xdr.o
--obj-m   := $(O_TARGET)
-+obj-$(CONFIG_SWAP_VIA_NFS) += nfsswap.o
-+ifeq ($(CONFIG_SWAP_VIA_NFS),m)
-+export-objs := nfs_syms.o
-+obj-y += nfs_syms.o
-+endif
-+
-+ifeq ($(CONFIG_NFS_FS),m)
-+obj-m   += $(O_TARGET)
-+endif
- include $(TOPDIR)/Rules.make
-diff -Nurb linux.orig/fs/nfs/file.c linux/fs/nfs/file.c
---- linux.orig/fs/nfs/file.c   2003-07-04 04:12:07.000000000 -0400
-+++ linux/fs/nfs/file.c        2004-05-31 02:18:03.000000000 -0400
-@@ -58,11 +58,6 @@
-       setattr:        nfs_notify_change,
- };
--/* Hack for future NFS swap support */
--#ifndef IS_SWAPFILE
--# define IS_SWAPFILE(inode)   (0)
--#endif
--
- /*
-  * Flush all dirty pages, and check for write errors.
-  *
-@@ -217,8 +212,6 @@
-               inode->i_ino, (unsigned long) count, (unsigned long) *ppos);
-       result = -EBUSY;
--      if (IS_SWAPFILE(inode))
--              goto out_swapfile;
-       result = nfs_revalidate_inode(NFS_SERVER(inode), inode);
-       if (result)
-               goto out;
-@@ -230,10 +223,6 @@
-       result = generic_file_write(file, buf, count, ppos);
- out:
-       return result;
--
--out_swapfile:
--      printk(KERN_INFO "NFS: attempt to write to active swap file!\n");
--      goto out;
- }
- /*
-diff -Nurb linux.orig/fs/nfs/nfs_syms.c linux/fs/nfs/nfs_syms.c
---- linux.orig/fs/nfs/nfs_syms.c       1969-12-31 19:00:00.000000000 -0500
-+++ linux/fs/nfs/nfs_syms.c    2004-05-31 02:18:03.000000000 -0400
-@@ -0,0 +1,10 @@
-+#include <linux/config.h>
-+#define __NO_VERSION__
-+#include <linux/module.h>
-+#include <linux/types.h>
-+#include <linux/sunrpc/clnt.h>
-+#include <linux/nfs_fs.h>
-+
-+EXPORT_SYMBOL(__nfs_refresh_inode);
-+EXPORT_SYMBOL(nfs_write_attributes);
-+
-diff -Nurb linux.orig/fs/nfs/nfsswap.c linux/fs/nfs/nfsswap.c
---- linux.orig/fs/nfs/nfsswap.c        1969-12-31 19:00:00.000000000 -0500
-+++ linux/fs/nfs/nfsswap.c     2004-05-31 02:18:03.000000000 -0400
-@@ -0,0 +1,350 @@
-+/*
-+ * Swapping to files located on NFS mounted volumes
-+ * Copyright (c) 2000 Claus-Justus Heine
-+ *
-+ */
-+
-+#include <linux/config.h>
-+#include <linux/module.h>
-+#include <linux/init.h>
-+#include <linux/types.h>
-+#include <linux/slab.h>
-+#include <linux/swap.h>
-+#include <linux/pagemap.h>
-+#include <linux/file.h>
-+#include <linux/fs.h>
-+#include <linux/socket.h>
-+#include <linux/smp_lock.h>
-+#include <net/netswapping.h>
-+#include <net/sock.h>
-+
-+#include <linux/sunrpc/clnt.h>
-+#include <linux/nfs_fs.h>
-+#include <linux/nfs_fs_sb.h>
-+#include <asm/uaccess.h>
-+
-+#define NFSDBG_FACILITY               NFSDBG_SWAP
-+
-+#define NFS_SWAP_ID "nfs file"
-+
-+/* we cache some values here. In principle, we only need the file.
-+ */
-+struct nfs_swap_data {
-+      struct file       *file;
-+      struct inode      *inode;
-+      struct nfs_server *server;
-+      struct socket     *socket;
-+};
-+
-+/* Nearly a clone of nfs_readpage_sync() in read.c, but "struct page" does not
-+ * contain information about the file offset when swapping. So.
-+ */
-+static int nfs_read_swap_page(struct page *page,
-+                            struct nfs_server *server,
-+                            struct inode *inode,
-+                            struct file  *file)
-+{
-+      unsigned int     rsize   = server->rsize;
-+      unsigned int     count   = PAGE_SIZE;
-+      unsigned int     offset  = 0; /* always at start of page */
-+      int              result, eof;
-+      struct rpc_cred  *cred;
-+      struct nfs_fattr fattr;
-+
-+      cred = nfs_file_cred(file);
-+
-+      do {
-+              if (count < rsize)
-+                      rsize = count;
-+
-+              lock_kernel();
-+              result = NFS_PROTO(inode)->read(inode, cred,
-+                                              &fattr,
-+                                              NFS_RPC_SWAPFLAGS,
-+                                              offset, rsize, page, &eof);
-+              nfs_refresh_inode(inode, &fattr);
-+              unlock_kernel();
-+
-+              /*
-+               * Even if we had a partial success we can't mark the page
-+               * cache valid.
-+               */
-+              if (result < 0) {
-+                      if (result == -EISDIR)
-+                              result = -EINVAL;
-+                      goto io_error;
-+              }
-+              count  -= result;
-+              offset += result;
-+              if (result < rsize)     /* NFSv2ism */
-+                      break;
-+      } while (count);
-+
-+      if (count) {
-+              char *kaddr = kmap(page);
-+              memset(kaddr + offset, 0, count);
-+              kunmap(page);
-+      }
-+      flush_dcache_page(page);
-+      result = 0;
-+
-+io_error:
-+      return result;
-+}
-+
-+/* Like nfs_writepage_sync(), but when swapping page->index does not encode
-+ * the offset in the swap file alone.
-+ *
-+ */
-+static int nfs_write_swap_page(struct page *page,
-+                             struct nfs_server *server,
-+                             struct inode *inode,
-+                             struct file *file)
-+{
-+      struct rpc_cred  *cred;
-+      unsigned int     wsize   = server->wsize;
-+      unsigned int     count   = PAGE_SIZE;
-+      unsigned int     offset  = 0;
-+      int              result;
-+      struct nfs_writeverf verf;
-+      struct nfs_fattr fattr;
-+
-+      cred = nfs_file_cred(file);
-+
-+      do {
-+              if (count < wsize)
-+                      wsize = count;
-+              
-+              lock_kernel();
-+              result = NFS_PROTO(inode)->write(inode, cred, &fattr,
-+                                               NFS_RW_SWAP|NFS_RW_SYNC, 
-+                                               offset, wsize, page, &verf);
-+              nfs_write_attributes(inode, &fattr);
-+              unlock_kernel();
-+
-+              if (result < 0) {
-+                      goto io_error;
-+              }
-+              if (result != wsize)
-+                      printk("NFS: short write, wsize=%u, result=%d\n",
-+                      wsize, result);
-+              offset  += wsize;
-+              count   -= wsize;
-+              /*
-+               * If we've extended the file, update the inode
-+               * now so we don't invalidate the cache.
-+               */
-+              if (offset > inode->i_size)
-+                      inode->i_size = offset;
-+      } while (count);
-+
-+      result = 0;
-+
-+io_error:
-+
-+      return result;
-+}
-+
-+/* Unluckily (for us) form 2.4.19 -> 2.4.20 the nfs-proc's where
-+ * changed and expect now a proper file-mapping page, where index
-+ * encodes the offset alone.
-+ * 
-+ * What we do: we save the original value of page->index, initialize
-+ * page->index to what the NFS/sun-rpc subsystem expects and restore
-+ * the index later.
-+ */
-+static int nfs_rw_swap_page(int rw, struct page *page,
-+                          unsigned long offset, void *dptr)
-+{
-+      int error;
-+      struct nfs_swap_data *data = dptr;
-+      unsigned long alloc_flag = current->flags & PF_MEMALLOC;
-+      unsigned long page_index;
-+
-+      if (!PageLocked(page))
-+              panic("nfs_rw_swap_page: page not locked for I/O");
-+
-+      /* prevent memory deadlocks */
-+      if (!(current->flags & PF_MEMALLOC)) {
-+              dprintk("nfs_rw_swap_page: Setting PF_MEMALLOC\n");
-+      }
-+      current->flags |= PF_MEMALLOC;
-+
-+      /* now tweak the page->index field ... */
-+      page_index  = page->index;
-+      page->index = ((loff_t)offset*(loff_t)PAGE_SIZE) >> PAGE_CACHE_SHIFT;
-+
-+      if (rw == WRITE) {
-+              error = nfs_write_swap_page(page,
-+                                          data->server,
-+                                          data->inode,
-+                                          data->file);
-+      } else {
-+              error = nfs_read_swap_page(page,
-+                                         data->server,
-+                                         data->inode,
-+                                         data->file);
-+      }
-+      
-+      if (!alloc_flag) {
-+              current->flags &= ~PF_MEMALLOC;
-+      }
-+
-+      /* now restore the page->index field ... */
-+      page->index = page_index;
-+
-+      if (error) {
-+              /* Must mark the page invalid after I/O error */
-+              SetPageError(page);
-+              ClearPageUptodate(page);
-+      } else {
-+              ClearPageError(page);
-+              SetPageUptodate(page);
-+      }
-+
-+      if (!error) { /* in case of an error rw_swap_page() likes to unlock
-+                     * itself.
-+                     */
-+              UnlockPage(page);
-+      }
-+
-+      return error < 0 ? 0 : 1;
-+}
-+
-+static int is_nfsfile_swapping(unsigned int flags,
-+                             struct file * swapf,
-+                             void * data)
-+{
-+      struct file * filp = (struct file *) data;
-+
-+      /* Only check filp's that don't match the one already opened
-+       * for us by sys_swapon(). Otherwise, we will always flag a
-+       * busy swap file.
-+       */
-+
-+      if (swapf != filp) {
-+              if (filp->f_dentry->d_inode == swapf->f_dentry->d_inode)
-+                      return 1;
-+      }
-+      return 0;
-+}
-+
-+static int nfs_swap_open(struct file *swapf, void **dptr)
-+{
-+      int error = 0;
-+      int swapfilesize;
-+      struct nfs_swap_data *data;
-+      int on = 1;
-+      mm_segment_t fs;
-+      struct inode *inode = swapf->f_dentry->d_inode;
-+
-+      MOD_INC_USE_COUNT;
-+
-+      if (!S_ISREG(inode->i_mode)) {
-+              dprintk("nfs_swap_open: can't handle this swap file: %s\n",
-+                      swapf->f_dentry->d_name.name);
-+              error = 0; /* not for us */
-+              goto bad_swap;
-+      }
-+      /* determine whether this file really is located on an NFS mounted
-+       * volume
-+       */
-+      if (!inode->i_sb || inode->i_sb->s_magic != NFS_SUPER_MAGIC) {
-+              dprintk("nfs_swap_open: %s is not an NFS file.\n",
-+                      swapf->f_dentry->d_name.name);
-+              error = 0; /* not for us */
-+              goto bad_swap;
-+      }
-+
-+      if (swap_run_test(is_nfsfile_swapping, swapf)) {
-+              dprintk("nfs_swap_open: already swapping to %s\n",
-+                      swapf->f_dentry->d_name.name);
-+              error = -EBUSY;
-+              goto bad_swap;
-+      }
-+      swapfilesize = inode->i_size >> PAGE_SHIFT;
-+      if ((data = kmalloc(sizeof(*data), GFP_KERNEL)) == NULL) {
-+              error = -ENOMEM;
-+              goto bad_swap;
-+      }
-+      data->file   = swapf;
-+      data->inode  = inode;
-+      data->server = NFS_SERVER(inode);
-+      data->socket = data->server->client->cl_xprt->sock;
-+      
-+      /* set socket option SO_SWAPPING */
-+      fs = get_fs();
-+      set_fs(KERNEL_DS);
-+      error = sock_setsockopt(data->socket, SOL_SOCKET, SO_SWAPPING,
-+                              (char *)&on, sizeof(on));
-+      set_fs(fs);
-+      if (error) {
-+              dprintk("nfs_swap_open: error setting SO_SWAPPING\n");
-+              goto bad_swap_2;
-+      }
-+
-+      *dptr = data;
-+      return swapfilesize;
-+
-+ bad_swap_2:
-+      kfree(data);
-+ bad_swap:
-+      MOD_DEC_USE_COUNT;
-+      return error;
-+}
-+
-+static int nfs_swap_release(struct file *swapf, void *dptr)
-+{
-+      struct nfs_swap_data *data = (struct nfs_swap_data *)dptr;
-+      int off = 0;
-+      mm_segment_t fs;
-+      int error;
-+
-+#if 1
-+      if (swapf != data->file ||
-+          swapf->f_dentry->d_inode != data->inode ||
-+          !swapf->f_dentry->d_inode->i_sb ||
-+          swapf->f_dentry->d_inode->i_sb->s_magic != NFS_SUPER_MAGIC ||
-+          NFS_SERVER(swapf->f_dentry->d_inode) != data->server ||
-+          data->socket != data->server->client->cl_xprt->sock) {
-+              panic("nfs_swap_release: nfs swap data messed up");
-+      }
-+#endif
-+
-+      /* remove socket option SO_SWAPPING */
-+      fs = get_fs();
-+      set_fs(KERNEL_DS);
-+      error = sock_setsockopt(data->socket, SOL_SOCKET, SO_SWAPPING,
-+                              (char *)&off, sizeof(off));
-+      set_fs(fs);
-+      if (error) {
-+              dprintk("nfs_swap_open: error clearing SO_SWAPPING\n");
-+      }
-+      kfree(data);
-+      MOD_DEC_USE_COUNT;
-+      return error;
-+}
-+
-+static struct swap_ops nfs_swap_ops = {
-+      open: nfs_swap_open,
-+      release: nfs_swap_release,
-+      rw_page: nfs_rw_swap_page
-+};
-+
-+int __init nfs_swap_init(void)
-+{
-+      (void)register_swap_method(NFS_SWAP_ID, &nfs_swap_ops);
-+      return 0;
-+}
-+
-+void __exit nfs_swap_exit(void)
-+{
-+      unregister_swap_method(NFS_SWAP_ID);
-+}
-+
-+module_init(nfs_swap_init)
-+module_exit(nfs_swap_exit)
-+
-+MODULE_LICENSE("GPL");
-+MODULE_AUTHOR("(c) 1996-2002 cH (Claus-Justus Heine)");
-+MODULE_DESCRIPTION("Swapping to files located on volumes mounted via NFS");
-diff -Nurb linux.orig/fs/nfs/read.c linux/fs/nfs/read.c
---- linux.orig/fs/nfs/read.c   2003-07-04 04:12:08.000000000 -0400
-+++ linux/fs/nfs/read.c        2004-05-31 02:18:03.000000000 -0400
-@@ -50,11 +50,6 @@
-  */
- static void   nfs_readpage_result(struct rpc_task *task);
--/* Hack for future NFS swap support */
--#ifndef IS_SWAPFILE
--# define IS_SWAPFILE(inode)   (0)
--#endif
--
- static kmem_cache_t *nfs_rdata_cachep;
- static __inline__ struct nfs_read_data *nfs_readdata_alloc(void)
-@@ -92,7 +87,6 @@
-       int             rsize = NFS_SERVER(inode)->rsize;
-       int             result;
-       int             count = PAGE_CACHE_SIZE;
--      int             flags = IS_SWAPFILE(inode)? NFS_RPC_SWAPFLAGS : 0;
-       int             eof;
-       dprintk("NFS: nfs_readpage_sync(%p)\n", page);
-@@ -114,7 +108,7 @@
-                       offset, rsize, page);
-               lock_kernel();
--              result = NFS_PROTO(inode)->read(inode, cred, &fattr, flags,
-+              result = NFS_PROTO(inode)->read(inode, cred, &fattr, 0,
-                                               offset, rsize, page, &eof);
-               nfs_refresh_inode(inode, &fattr);
-               unlock_kernel();
-@@ -246,7 +240,7 @@
-       task = &data->task;
-       /* N.B. Do we need to test? Never called for swapfile inode */
--      flags = RPC_TASK_ASYNC | (IS_SWAPFILE(inode)? NFS_RPC_SWAPFLAGS : 0);
-+      flags = RPC_TASK_ASYNC;
-       nfs_read_rpcsetup(head, data);
-@@ -476,8 +470,6 @@
-       }
-       error = nfs_readpage_sync(file, inode, page);
--      if (error < 0 && IS_SWAPFILE(inode))
--              printk("Aiee.. nfs swap-in of page failed!\n");
- out:
-       return error;
-diff -Nurb linux.orig/fs/nfs/write.c linux/fs/nfs/write.c
---- linux.orig/fs/nfs/write.c  2003-07-04 04:12:08.000000000 -0400
-+++ linux/fs/nfs/write.c       2004-05-31 02:20:47.000000000 -0400
-@@ -3,7 +3,6 @@
- #include <linux/config.h>
- #include <linux/types.h>
- #include <linux/slab.h>
--#include <linux/swap.h>
- #include <linux/pagemap.h>
- #include <linux/file.h>
-@@ -46,11 +45,6 @@
- static void   nfs_commit_done(struct rpc_task *);
- #endif
--/* Hack for future NFS swap support */
--#ifndef IS_SWAPFILE
--# define IS_SWAPFILE(inode)   (0)
--#endif
--
- static kmem_cache_t *nfs_wdata_cachep;
- static __inline__ struct nfs_write_data *nfs_writedata_alloc(void)
-@@ -82,7 +76,7 @@
-  * For the moment, we just call nfs_refresh_inode().
-  */
- static __inline__ int
--nfs_write_attributes(struct inode *inode, struct nfs_fattr *fattr)
-+__nfs_write_attributes(struct inode *inode, struct nfs_fattr *fattr)
- {
-       if ((fattr->valid & NFS_ATTR_FATTR) && !(fattr->valid & NFS_ATTR_WCC)) {
-               fattr->pre_size  = NFS_CACHE_ISIZE(inode);
-@@ -93,6 +87,11 @@
-       return nfs_refresh_inode(inode, fattr);
- }
-+int nfs_write_attributes(struct inode *inode, struct nfs_fattr *fattr)
-+{
-+      return __nfs_write_attributes(inode, fattr);
-+}
-+
- /*
-  * Write a page synchronously.
-  * Offset is the data offset within the page.
-@@ -104,8 +103,7 @@
-       struct rpc_cred *cred = NULL;
-       loff_t          base;
-       unsigned int    wsize = NFS_SERVER(inode)->wsize;
--      int             result, refresh = 0, written = 0, flags;
--      u8              *buffer;
-+      int             result, refresh = 0, written = 0;
-       struct nfs_fattr fattr;
-       struct nfs_writeverf verf;
-@@ -121,15 +119,14 @@
-       base = page_offset(page) + offset;
--      flags = ((IS_SWAPFILE(inode)) ? NFS_RW_SWAP : 0) | NFS_RW_SYNC;
--
-       do {
--              if (count < wsize && !IS_SWAPFILE(inode))
-+              if (count < wsize)
-                       wsize = count;
--              result = NFS_PROTO(inode)->write(inode, cred, &fattr, flags,
-+              result = NFS_PROTO(inode)->write(inode, cred, &fattr,
-+                                               NFS_RW_SYNC,
-                                                offset, wsize, page, &verf);
--              nfs_write_attributes(inode, &fattr);
-+              __nfs_write_attributes(inode, &fattr);
-               if (result < 0) {
-                       /* Must mark the page invalid after I/O error */
-@@ -140,7 +137,6 @@
-                       printk("NFS: short write, wsize=%u, result=%d\n",
-                       wsize, result);
-               refresh = 1;
--              buffer  += wsize;
-               base    += wsize;
-               offset  += wsize;
-               written += wsize;
-@@ -979,7 +975,7 @@
-       }
- #endif
--      nfs_write_attributes(inode, resp->fattr);
-+      __nfs_write_attributes(inode, resp->fattr);
-       while (!list_empty(&data->pages)) {
-               req = nfs_list_entry(data->pages.next);
-               nfs_list_remove_request(req);
-@@ -1133,7 +1129,7 @@
-       if (nfs_async_handle_jukebox(task))
-               return;
--      nfs_write_attributes(inode, resp->fattr);
-+      __nfs_write_attributes(inode, resp->fattr);
-       while (!list_empty(&data->pages)) {
-               req = nfs_list_entry(data->pages.next);
-               nfs_list_remove_request(req);
-diff -Nurb linux.orig/include/linux/fs.h linux/include/linux/fs.h
---- linux.orig/include/linux/fs.h      2004-05-31 02:06:19.000000000 -0400
-+++ linux/include/linux/fs.h   2004-05-31 02:18:03.000000000 -0400
-@@ -1500,6 +1500,10 @@
- extern int inode_change_ok(struct inode *, struct iattr *);
- extern int inode_setattr(struct inode *, struct iattr *);
-+/* for swapping to block devices */
-+void create_empty_buffers(struct page *page, kdev_t dev, unsigned long blocksize);
-+void end_buffer_io_async(struct buffer_head * bh, int uptodate);
-+
- /*
-  * Common dentry functions for inclusion in the VFS
-  * or in other stackable file systems.  Some of these
-diff -Nurb linux.orig/include/linux/nfs_fs.h linux/include/linux/nfs_fs.h
---- linux.orig/include/linux/nfs_fs.h  2004-05-31 02:06:28.000000000 -0400
-+++ linux/include/linux/nfs_fs.h       2004-05-31 02:18:03.000000000 -0400
-@@ -40,8 +40,8 @@
-  */
- #define NFS_MAX_DIRCACHE              16
--#define NFS_MAX_FILE_IO_BUFFER_SIZE   32768
--#define NFS_DEF_FILE_IO_BUFFER_SIZE   4096
-+#define NFS_MAX_FILE_IO_BUFFER_SIZE   (8*PAGE_SIZE)
-+#define NFS_DEF_FILE_IO_BUFFER_SIZE   PAGE_SIZE
- /*
-  * The upper limit on timeouts for the exponential backoff algorithm.
-@@ -205,6 +205,8 @@
- extern int  nfs_writepage(struct page *);
- extern int  nfs_flush_incompatible(struct file *file, struct page *page);
- extern int  nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int);
-+extern int nfs_write_attributes(struct inode *inode, struct nfs_fattr *fattr);
-+
- /*
-  * Try to write back everything synchronously (but check the
-  * return value!)
-@@ -375,6 +377,7 @@
- #define NFSDBG_XDR            0x0020
- #define NFSDBG_FILE           0x0040
- #define NFSDBG_ROOT           0x0080
-+#define NFSDBG_SWAP             0x0100
- #define NFSDBG_ALL            0xFFFF
- #ifdef __KERNEL__
-diff -Nurb linux.orig/include/linux/slab.h linux/include/linux/slab.h
---- linux.orig/include/linux/slab.h    2004-05-31 02:06:19.000000000 -0400
-+++ linux/include/linux/slab.h 2004-05-31 02:18:03.000000000 -0400
-@@ -39,6 +39,7 @@
- #define       SLAB_HWCACHE_ALIGN      0x00002000UL    /* align objs on a h/w cache lines */
- #define SLAB_CACHE_DMA                0x00004000UL    /* use GFP_DMA memory */
- #define SLAB_MUST_HWCACHE_ALIGN       0x00008000UL    /* force alignment */
-+#define SLAB_LOW_GFP_ORDER    0x00010000UL    /* use as low a gfp order as possible */
- /* flags passed to a constructor func */
- #define       SLAB_CTOR_CONSTRUCTOR   0x001UL         /* if not set, then deconstructor */
-diff -Nurb linux.orig/include/linux/swap.h linux/include/linux/swap.h
---- linux.orig/include/linux/swap.h    2004-05-31 02:06:19.000000000 -0400
-+++ linux/include/linux/swap.h 2004-05-31 02:18:03.000000000 -0400
-@@ -58,15 +58,29 @@
- #define SWAP_MAP_MAX  0x7fff
- #define SWAP_MAP_BAD  0x8000
-+struct swap_ops {
-+      int (*open)(struct file *swapf, void **data);
-+      int (*release)(struct file *swapf, void *data);
-+      int (*rw_page)(int rw,
-+                     struct page *page, unsigned long offset, void *data);
-+};
-+
-+struct swap_method {
-+      struct swap_method *next;
-+      char * name;
-+      struct swap_ops *ops;
-+      int use_count;
-+};
-+
- /*
-  * The in-memory structure used to track swap areas.
-  */
- struct swap_info_struct {
-       unsigned int flags;
--      kdev_t swap_device;
-+      struct file *swap_file;
-+      struct swap_method *method;
-+      void *data;
-       spinlock_t sdev_lock;
--      struct dentry * swap_file;
--      struct vfsmount *swap_vfsmnt;
-       unsigned short * swap_map;
-       unsigned int lowest_bit;
-       unsigned int highest_bit;
-@@ -141,11 +155,15 @@
- extern int total_swap_pages;
- extern unsigned int nr_swapfiles;
- extern struct swap_info_struct swap_info[];
--extern int is_swap_partition(kdev_t);
-+extern int register_swap_method(char *name, struct swap_ops *ops);
-+extern int unregister_swap_method(char *name);
-+extern int swap_run_test(int (*test_fct)(unsigned int flags,
-+                                       struct file *swap_file,
-+                                       void *testdata), void *testdata);
- extern void si_swapinfo(struct sysinfo *);
- extern swp_entry_t get_swap_page(void);
--extern void get_swaphandle_info(swp_entry_t, unsigned long *, kdev_t *, 
--                                      struct inode **);
-+struct swap_method *get_swaphandle_info(swp_entry_t entry,
-+                                      unsigned long *offset, void **data);
- extern int swap_duplicate(swp_entry_t);
- extern int swap_count(struct page *);
- extern int valid_swaphandles(swp_entry_t, unsigned long *);
-diff -Nurb linux.orig/include/net/netswapping.h linux/include/net/netswapping.h
---- linux.orig/include/net/netswapping.h       1969-12-31 19:00:00.000000000 -0500
-+++ linux/include/net/netswapping.h    2004-05-31 02:18:03.000000000 -0400
-@@ -0,0 +1,47 @@
-+#ifndef _LINUX_NETSWAPPING_H
-+#define _LINUX_NETSWAPPING_H
-+
-+#include <linux/swap.h>
-+#include <linux/init.h>
-+
-+/* It is a mess. Socket options are defined in asm-ARCH/socket.h */
-+
-+#define SO_SWAPPING 0x00100000 /* hopefully not used by anybody else */
-+
-+#ifdef __KERNEL__
-+
-+#define CTL_NETSWAP 0x00100000
-+
-+enum {
-+      NET_SWAP_DROPPED = 1,
-+      NET_SWAP_DROP_THRESHOLD = 2,
-+      NET_SWAP_SOCK_COUNT = 3
-+};
-+
-+extern unsigned int netswap_free_pages_min;
-+extern int netswap_sock_count;
-+extern unsigned int netswap_dropped;
-+
-+/* this is "#defined" and not inline because sock.h includes us, but we need
-+ * the "struct sock" definition.
-+ */
-+#define netswap_low_memory(sk, skb)                                      \
-+({                                                                       \
-+      int _ret = 0;                                                      \
-+                                                                         \
-+      if (netswap_sock_count > 0 && /* anybody swapping via network? */  \
-+          !(sk)->swapping &&    /* but we are not needed for swapping */ \
-+          nr_free_pages() < netswap_free_pages_min) { /* so drop us */   \
-+              printk("netswap_low_memory: "                              \
-+                     "dropping skb 0x%p@0x%p\n", skb, sk);               \
-+              netswap_dropped ++;                                        \
-+              _ret = 1;                                                  \
-+      }                                                                  \
-+      _ret;                                                              \
-+})
-+
-+extern int __init netswap_init(void);
-+
-+#endif
-+
-+#endif
-diff -Nurb linux.orig/include/net/sock.h linux/include/net/sock.h
---- linux.orig/include/net/sock.h      2004-05-31 02:07:17.000000000 -0400
-+++ linux/include/net/sock.h   2004-05-31 02:18:03.000000000 -0400
-@@ -103,6 +103,10 @@
- #include <linux/filter.h>
- #endif
-+#ifdef CONFIG_NETSWAP
-+#include <net/netswapping.h>
-+#endif
-+
- #include <asm/atomic.h>
- #include <net/dst.h>
-@@ -536,6 +540,12 @@
-                               no_check,
-                               broadcast,
-                               bsdism;
-+#ifdef CONFIG_NETSWAP
-+      /* Increased by SO_SWAPPING with arg != 0, decreased by
-+       * SO_SWAPPING with arg 0
-+       */
-+      int                     swapping;
-+#endif
-       unsigned char           debug;
-       unsigned char           rcvtstamp;
-       unsigned char           use_write_queue;
-@@ -1165,6 +1175,11 @@
-                       return err;     /* Toss packet */
-       }
- #endif /* CONFIG_FILTER */
-+#ifdef CONFIG_NETSWAP
-+      /* an inline function defined in net/netswapping.h */
-+      if (netswap_low_memory(sk, skb))
-+              return -ENOMEM;
-+#endif /* CONFIG_NETSWAP */
-       skb->dev = NULL;
-       skb_set_owner_r(skb, sk);
-diff -Nurb linux.orig/kernel/ksyms.c linux/kernel/ksyms.c
---- linux.orig/kernel/ksyms.c  2004-05-31 02:02:43.000000000 -0400
-+++ linux/kernel/ksyms.c       2004-05-31 02:18:03.000000000 -0400
-@@ -41,6 +41,7 @@
- #include <linux/mm.h>
- #include <linux/capability.h>
- #include <linux/highuid.h>
-+#include <linux/swapctl.h>
- #include <linux/brlock.h>
- #include <linux/fs.h>
- #include <linux/tty.h>
-@@ -127,6 +128,11 @@
- EXPORT_SYMBOL(kmap_prot);
- EXPORT_SYMBOL(kmap_pte);
- #endif
-+EXPORT_SYMBOL(nr_free_pages);
-+/* EXPORT_SYMBOL(freepages); */
-+EXPORT_SYMBOL(register_swap_method);
-+EXPORT_SYMBOL(unregister_swap_method);
-+EXPORT_SYMBOL(swap_run_test);
- /* filesystem internal functions */
- EXPORT_SYMBOL(def_blk_fops);
-@@ -531,7 +537,7 @@
- EXPORT_SYMBOL(make_bad_inode);
- EXPORT_SYMBOL(is_bad_inode);
- EXPORT_SYMBOL(event);
--EXPORT_SYMBOL(brw_page);
-+EXPORT_SYMBOL(end_buffer_io_async);
- EXPORT_SYMBOL(__inode_dir_notify);
- #ifdef CONFIG_UID16
-diff -Nurb linux.orig/mm/page_io.c linux/mm/page_io.c
---- linux.orig/mm/page_io.c    2003-07-04 04:12:29.000000000 -0400
-+++ linux/mm/page_io.c 2004-05-31 02:18:03.000000000 -0400
-@@ -36,11 +36,8 @@
- static int rw_swap_page_base(int rw, swp_entry_t entry, struct page *page)
- {
-       unsigned long offset;
--      int zones[PAGE_SIZE/512];
--      int zones_used;
--      kdev_t dev = 0;
--      int block_size;
--      struct inode *swapf = 0;
-+      struct swap_method *method;
-+      void *data;
-       if (rw == READ) {
-               ClearPageUptodate(page);
-@@ -48,30 +45,11 @@
-       } else
-               kstat.pswpout++;
--      get_swaphandle_info(entry, &offset, &dev, &swapf);
--      if (dev) {
--              zones[0] = offset;
--              zones_used = 1;
--              block_size = PAGE_SIZE;
--      } else if (swapf) {
--              int i, j;
--              unsigned int block = offset
--                      << (PAGE_SHIFT - swapf->i_sb->s_blocksize_bits);
--
--              block_size = swapf->i_sb->s_blocksize;
--              for (i=0, j=0; j< PAGE_SIZE ; i++, j += block_size)
--                      if (!(zones[i] = bmap(swapf,block++))) {
--                              printk("rw_swap_page: bad swap file\n");
--                              return 0;
--                      }
--              zones_used = i;
--              dev = swapf->i_dev;
--      } else {
-+      method = get_swaphandle_info(entry, &offset, &data);
-+      if (!method || !method->ops->rw_page(rw, page, offset, data)) {
-               return 0;
-       }
--      /* block_size == PAGE_SIZE/zones_used */
--      brw_page(rw, page, dev, zones, block_size);
-       return 1;
- }
-diff -Nurb linux.orig/mm/slab.c linux/mm/slab.c
---- linux.orig/mm/slab.c       2003-07-04 04:12:29.000000000 -0400
-+++ linux/mm/slab.c    2004-05-31 02:18:03.000000000 -0400
-@@ -111,10 +111,12 @@
- # define CREATE_MASK  (SLAB_DEBUG_INITIAL | SLAB_RED_ZONE | \
-                        SLAB_POISON | SLAB_HWCACHE_ALIGN | \
-                        SLAB_NO_REAP | SLAB_CACHE_DMA | \
--                       SLAB_MUST_HWCACHE_ALIGN)
-+                       SLAB_MUST_HWCACHE_ALIGN | \
-+                       SLAB_LOW_GFP_ORDER)
- #else
- # define CREATE_MASK  (SLAB_HWCACHE_ALIGN | SLAB_NO_REAP | \
--                       SLAB_CACHE_DMA | SLAB_MUST_HWCACHE_ALIGN)
-+                       SLAB_CACHE_DMA | SLAB_MUST_HWCACHE_ALIGN | \
-+                       SLAB_LOW_GFP_ORDER)
- #endif
- /*
-@@ -247,8 +249,13 @@
- };
- /* internal c_flags */
--#define       CFLGS_OFF_SLAB  0x010000UL      /* slab management in own cache */
--#define       CFLGS_OPTIMIZE  0x020000UL      /* optimized slab lookup */
-+#define       CFLGS_OFF_SLAB  0x020000UL      /* slab management in own cache */
-+#define       CFLGS_OPTIMIZE  0x040000UL      /* optimized slab lookup */
-+#define CFLGS_MASK (CFLGS_OFF_SLAB | CFLGS_OPTIMIZE)
-+
-+#if (CFLGS_MASK & CREATE_MASK)
-+# error BUG: internal and external SLAB flags overlap
-+#endif
- /* c_dflags (dynamic flags). Need to hold the spinlock to access this member */
- #define       DFLGS_GROWN     0x000001UL      /* don't reap a recently grown */
-@@ -452,7 +459,12 @@
-               snprintf(name, sizeof(name), "size-%Zd",sizes->cs_size);
-               if (!(sizes->cs_cachep =
-                       kmem_cache_create(name, sizes->cs_size,
--                                      0, SLAB_HWCACHE_ALIGN, NULL, NULL))) {
-+                                        0,
-+#if CONFIG_NETSWAP
-+                                        SLAB_LOW_GFP_ORDER|  /* sorry */
-+#endif
-+                                        SLAB_HWCACHE_ALIGN,
-+                                        NULL, NULL))) {
-                       BUG();
-               }
-@@ -731,6 +743,8 @@
-                       break;
-               if (!cachep->num)
-                       goto next;
-+              if (cachep->gfporder == 0 && (flags & SLAB_LOW_GFP_ORDER))
-+                      break;
-               if (flags & CFLGS_OFF_SLAB && cachep->num > offslab_limit) {
-                       /* Oops, this num of objs will cause problems. */
-                       cachep->gfporder--;
-diff -Nurb linux.orig/mm/swapfile.c linux/mm/swapfile.c
---- linux.orig/mm/swapfile.c   2003-07-04 04:12:29.000000000 -0400
-+++ linux/mm/swapfile.c        2004-05-31 02:18:03.000000000 -0400
-@@ -11,12 +11,17 @@
- #include <linux/swap.h>
- #include <linux/swapctl.h>
- #include <linux/blkdev.h> /* for blk_size */
-+#include <linux/file.h>
- #include <linux/vmalloc.h>
- #include <linux/pagemap.h>
- #include <linux/shm.h>
- #include <asm/pgtable.h>
-+#ifdef CONFIG_KMOD
-+#include <linux/kmod.h>
-+#endif
-+
- spinlock_t swaplock = SPIN_LOCK_UNLOCKED;
- unsigned int nr_swapfiles;
- int total_swap_pages;
-@@ -31,8 +36,78 @@
- struct swap_info_struct swap_info[MAX_SWAPFILES];
-+static struct swap_method *swap_methods = NULL;
-+
- #define SWAPFILE_CLUSTER 256
-+int register_swap_method(char *name, struct swap_ops *ops)
-+{
-+      struct swap_method *pos;
-+      struct swap_method *new;
-+      int result = 0;
-+
-+      lock_kernel();
-+
-+      for (pos = swap_methods; pos; pos = pos->next) {
-+              if (strcmp(pos->name, name) == 0) {
-+                      printk(KERN_ERR "register_swap_method: "
-+                             "method %s already registered\n", name);
-+                      result = -EBUSY;
-+                      goto out;
-+              }
-+      }
-+
-+      if (!(new = kmalloc(sizeof(*new), GFP_KERNEL))) {
-+              printk(KERN_ERR "register_swap_method: "
-+                     "no memory for new method \"%s\"\n", name);
-+              result = -ENOMEM;
-+              goto out;
-+      }
-+
-+      new->name      = name;
-+      new->ops       = ops;
-+      new->use_count = 0;
-+
-+      /* ok, insert at top of list */
-+      printk("register_swap_method: method %s\n", name);
-+      new->next    = swap_methods;
-+      swap_methods = new;
-+ out:
-+      unlock_kernel();
-+      return result;
-+}
-+
-+int unregister_swap_method(char *name)
-+{
-+      struct swap_method **method, *next;
-+      int result = 0;
-+
-+      lock_kernel();
-+
-+      for (method = &swap_methods; *method; method = &(*method)->next) {
-+              if (strcmp((*method)->name, name) == 0) {
-+                      if ((*method)->use_count > 0) {
-+                              printk(KERN_ERR "unregister_swap_method: "
-+                                     "method \"%s\" is in use\n", name);
-+                              result = -EBUSY;
-+                              goto out;
-+                      }
-+
-+                      next = (*method)->next;
-+                      kfree(*method);
-+                      *method = next;                 
-+                      printk("unregister_swap_method: method %s\n", name);
-+                      goto out;
-+              }
-+      }
-+      /* not found */
-+      printk("unregister_swap_method: no such method %s\n", name);
-+      result = -ENOENT;
-+ out:
-+      unlock_kernel();
-+      return result;
-+}
-+
- static inline int scan_swap_map(struct swap_info_struct *si)
- {
-       unsigned long offset;
-@@ -711,13 +786,14 @@
-       struct nameidata nd;
-       int i, type, prev;
-       int err;
-+      struct file *swap_file;
-       
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
-       err = user_path_walk(specialfile, &nd);
-       if (err)
--              goto out;
-+              return err;
-       lock_kernel();
-       prev = -1;
-@@ -725,15 +801,20 @@
-       for (type = swap_list.head; type >= 0; type = swap_info[type].next) {
-               p = swap_info + type;
-               if ((p->flags & SWP_WRITEOK) == SWP_WRITEOK) {
--                      if (p->swap_file == nd.dentry)
-+                      if (p->swap_file &&
-+                          p->swap_file->f_dentry == nd.dentry)
-                         break;
-               }
-               prev = type;
-       }
-       err = -EINVAL;
-+      /* p->swap_file contains all needed info, no need to keep nd, so
-+       * release it now.
-+       */
-+      path_release(&nd);
-       if (type < 0) {
-               swap_list_unlock();
--              goto out_dput;
-+              goto out;
-       }
-       if (prev < 0) {
-@@ -767,32 +848,30 @@
-               total_swap_pages += p->pages;
-               p->flags = SWP_WRITEOK;
-               swap_list_unlock();
--              goto out_dput;
-+              goto out;
-       }
--      if (p->swap_device)
--              blkdev_put(p->swap_file->d_inode->i_bdev, BDEV_SWAP);
--      path_release(&nd);
-+      if (p->method->ops->release)
-+              p->method->ops->release(p->swap_file, p->data);
-       swap_list_lock();
-       swap_device_lock(p);
--      nd.mnt = p->swap_vfsmnt;
--      nd.dentry = p->swap_file;
--      p->swap_vfsmnt = NULL;
-+      p->method->use_count --;
-+      p->method = NULL;
-+      p->data   = NULL;
-+      swap_file = p->swap_file;
-       p->swap_file = NULL;
--      p->swap_device = 0;
-       p->max = 0;
-       swap_map = p->swap_map;
-       p->swap_map = NULL;
-       p->flags = 0;
-       swap_device_unlock(p);
-       swap_list_unlock();
-+      filp_close(swap_file, NULL);
-       vfree(swap_map);
-       err = 0;
--out_dput:
--      unlock_kernel();
--      path_release(&nd);
- out:
-+      unlock_kernel();
-       return err;
- }
-@@ -805,18 +884,17 @@
-       if (!page)
-               return -ENOMEM;
--      len += sprintf(buf, "Filename\t\t\tType\t\tSize\tUsed\tPriority\n");
-+      len += sprintf(buf, "%-32s%-16s%-8s%-8sPriority\n",
-+                     "Filename", "Type", "Size", "Used");
-       for (i = 0 ; i < nr_swapfiles ; i++, ptr++) {
-               if ((ptr->flags & SWP_USED) && ptr->swap_map) {
--                      char * path = d_path(ptr->swap_file, ptr->swap_vfsmnt,
-+                      char * path = d_path(ptr->swap_file->f_dentry,
-+                                           ptr->swap_file->f_vfsmnt,
-                                               page, PAGE_SIZE);
-                       len += sprintf(buf + len, "%-31s ", path);
--                      if (!ptr->swap_device)
--                              len += sprintf(buf + len, "file\t\t");
--                      else
--                              len += sprintf(buf + len, "partition\t");
-+                      len += sprintf(buf + len, "%-15s ", ptr->method->name);
-                       usedswap = 0;
-                       for (j = 0; j < ptr->max; ++j)
-@@ -827,7 +905,7 @@
-                                       default:
-                                               usedswap++;
-                               }
--                      len += sprintf(buf + len, "%d\t%d\t%d\n", ptr->pages << (PAGE_SHIFT - 10), 
-+                      len += sprintf(buf + len, "%-8d%-8d%d\n", ptr->pages << (PAGE_SHIFT - 10), 
-                               usedswap << (PAGE_SHIFT - 10), ptr->prio);
-               }
-       }
-@@ -835,18 +913,55 @@
-       return len;
- }
--int is_swap_partition(kdev_t dev) {
-+/* apply a test function to all active swap objects. E.g. for checking
-+ * whether a partition is used for swapping
-+ */
-+int swap_run_test(int (*test_fct)(unsigned int flags,
-+                                struct file * swap_file,
-+                                void *testdata), void *testdata)
-+{
-       struct swap_info_struct *ptr = swap_info;
-       int i;
-       for (i = 0 ; i < nr_swapfiles ; i++, ptr++) {
--              if (ptr->flags & SWP_USED)
--                      if (ptr->swap_device == dev)
-+              if (ptr->swap_file && 
-+                  test_fct(ptr->flags, ptr->swap_file, testdata))
-                               return 1;
-       }
-       return 0;
- }
-+/* Walk through the list of known swap method until somebody wants to
-+ * handle this file. Pick the first one which claims to be able to
-+ * swap to this kind of file.
-+ *
-+ * return value: < 0: error, 0: not found, > 0: swapfilesize
-+ */
-+int find_swap_method(struct file *swap_file,
-+                   struct swap_info_struct *p)
-+{
-+      int swapfilesize = 0;
-+      struct swap_method *method;
-+
-+      p->method = NULL;
-+      for (method = swap_methods; method; method = method->next) {
-+              swapfilesize = method->ops->open(swap_file, &p->data);
-+              if (swapfilesize == 0) {
-+                      continue;
-+              }
-+              if (swapfilesize > 0) {
-+                      p->method = method;
-+                      p->method->use_count ++;
-+                      p->swap_file = swap_file;
-+                      break;
-+              }
-+              if (swapfilesize < 0) {
-+                      break;
-+              }
-+      }
-+      return swapfilesize;
-+}
-+
- /*
-  * Written 01/25/92 by Simmule Turner, heavily changed by Linus.
-  *
-@@ -855,8 +970,6 @@
- asmlinkage long sys_swapon(const char * specialfile, int swap_flags)
- {
-       struct swap_info_struct * p;
--      struct nameidata nd;
--      struct inode * swap_inode;
-       unsigned int type;
-       int i, j, prev;
-       int error;
-@@ -866,8 +979,9 @@
-       int nr_good_pages = 0;
-       unsigned long maxpages = 1;
-       int swapfilesize;
--      struct block_device *bdev = NULL;
-       unsigned short *swap_map;
-+      char * tmp_specialfile;
-+      struct file *swap_file;
-       
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
-@@ -886,8 +1000,7 @@
-               nr_swapfiles = type+1;
-       p->flags = SWP_USED;
-       p->swap_file = NULL;
--      p->swap_vfsmnt = NULL;
--      p->swap_device = 0;
-+      p->method = NULL;
-       p->swap_map = NULL;
-       p->lowest_bit = 0;
-       p->highest_bit = 0;
-@@ -901,53 +1014,56 @@
-               p->prio = --least_priority;
-       }
-       swap_list_unlock();
--      error = user_path_walk(specialfile, &nd);
--      if (error)
-+
-+      /* Open the swap using filp_open. Bail out on any errors. */
-+      tmp_specialfile = getname(specialfile);
-+      if (IS_ERR(tmp_specialfile)) {
-+              error = PTR_ERR(tmp_specialfile);
-               goto bad_swap_2;
-+      }
-+      p->swap_file = filp_open(tmp_specialfile, O_RDWR, 0600);
-+      putname(tmp_specialfile);
-+      if (IS_ERR(p->swap_file)) {
-+              error = PTR_ERR(p->swap_file);
-+              goto bad_swap_1;
-+      }
--      p->swap_file = nd.dentry;
--      p->swap_vfsmnt = nd.mnt;
--      swap_inode = nd.dentry->d_inode;
-       error = -EINVAL;
--      if (S_ISBLK(swap_inode->i_mode)) {
--              kdev_t dev = swap_inode->i_rdev;
--              struct block_device_operations *bdops;
--              devfs_handle_t de;
--
--              p->swap_device = dev;
--              set_blocksize(dev, PAGE_SIZE);
--              
--              bd_acquire(swap_inode);
--              bdev = swap_inode->i_bdev;
--              de = devfs_get_handle_from_inode(swap_inode);
--              bdops = devfs_get_ops(de);  /*  Increments module use count  */
--              if (bdops) bdev->bd_op = bdops;
--
--              error = blkdev_get(bdev, FMODE_READ|FMODE_WRITE, 0, BDEV_SWAP);
--              devfs_put_ops(de);/*Decrement module use count now we're safe*/
--              if (error)
--                      goto bad_swap_2;
--              set_blocksize(dev, PAGE_SIZE);
--              error = -ENODEV;
--              if (!dev || (blk_size[MAJOR(dev)] &&
--                   !blk_size[MAJOR(dev)][MINOR(dev)]))
--                      goto bad_swap;
--              swapfilesize = 0;
--              if (blk_size[MAJOR(dev)])
--                      swapfilesize = blk_size[MAJOR(dev)][MINOR(dev)]
--                              >> (PAGE_SHIFT - 10);
--      } else if (S_ISREG(swap_inode->i_mode))
--              swapfilesize = swap_inode->i_size >> PAGE_SHIFT;
--      else
--              goto bad_swap;
-+      swapfilesize = find_swap_method(p->swap_file, p);
-+      if (swapfilesize < 0) {
-+              error = swapfilesize;
-+              goto bad_swap_1;
-+      }
-+#ifdef CONFIG_KMOD
-+      if (swapfilesize == 0) {
-+              (void)request_module("swapfile-mod");
-+
-+              swapfilesize = find_swap_method(p->swap_file, p);
-+              if (swapfilesize < 0) {
-+                      error = swapfilesize;
-+                      goto bad_swap_1;
-+              }
-+      }
-+#endif                
-+      if (swapfilesize == 0) {
-+              printk("Don't know how to swap to this kind of file\n");
-+              goto bad_swap_1; /* free swap map */
-+      }
-+  
-+      /* After this point, the swap-file has been opened by the swap
-+       * method. We must make sure to use the bad_swap label for any
-+       * errors.
-+       */
-       error = -EBUSY;
-       for (i = 0 ; i < nr_swapfiles ; i++) {
-               struct swap_info_struct *q = &swap_info[i];
-               if (i == type || !q->swap_file)
-                       continue;
--              if (swap_inode->i_mapping == q->swap_file->d_inode->i_mapping)
-+              if (p->swap_file->f_dentry->d_inode->i_mapping
-+                  ==
-+                  q->swap_file->f_dentry->d_inode->i_mapping)
-                       goto bad_swap;
-       }
-@@ -1083,17 +1199,27 @@
-       swap_list_unlock();
-       error = 0;
-       goto out;
-+
- bad_swap:
--      if (bdev)
--              blkdev_put(bdev, BDEV_SWAP);
-+      if (p->method->ops->release)
-+              p->method->ops->release(p->swap_file, p->data);
-+      swap_list_lock();
-+      p->method->use_count --;
-+      p->method = NULL;
-+      p->data = NULL;
-+      swap_list_unlock();
-+
-+bad_swap_1:
-+      swap_list_lock();
-+      swap_file = p->swap_file;
-+      p->swap_file = NULL;
-+      swap_list_unlock();
-+      filp_close(swap_file, NULL);
-+      
- bad_swap_2:
-+
-       swap_list_lock();
-       swap_map = p->swap_map;
--      nd.mnt = p->swap_vfsmnt;
--      nd.dentry = p->swap_file;
--      p->swap_device = 0;
--      p->swap_file = NULL;
--      p->swap_vfsmnt = NULL;
-       p->swap_map = NULL;
-       p->flags = 0;
-       if (!(swap_flags & SWAP_FLAG_PREFER))
-@@ -1101,7 +1227,7 @@
-       swap_list_unlock();
-       if (swap_map)
-               vfree(swap_map);
--      path_release(&nd);
-+
- out:
-       if (swap_header)
-               free_page((long) swap_header);
-@@ -1217,8 +1343,8 @@
- /*
-  * Prior swap_duplicate protects against swap device deletion.
-  */
--void get_swaphandle_info(swp_entry_t entry, unsigned long *offset, 
--                      kdev_t *dev, struct inode **swapf)
-+struct swap_method *get_swaphandle_info(swp_entry_t entry,
-+                                      unsigned long *offset, void **data)
- {
-       unsigned long type;
-       struct swap_info_struct *p;
-@@ -1226,32 +1352,26 @@
-       type = SWP_TYPE(entry);
-       if (type >= nr_swapfiles) {
-               printk(KERN_ERR "rw_swap_page: %s%08lx\n", Bad_file, entry.val);
--              return;
-+              return NULL;
-       }
-       p = &swap_info[type];
-       *offset = SWP_OFFSET(entry);
-       if (*offset >= p->max && *offset != 0) {
-               printk(KERN_ERR "rw_swap_page: %s%08lx\n", Bad_offset, entry.val);
--              return;
-+              return NULL;
-       }
-       if (p->swap_map && !p->swap_map[*offset]) {
-               printk(KERN_ERR "rw_swap_page: %s%08lx\n", Unused_offset, entry.val);
--              return;
-+              return NULL;
-       }
-       if (!(p->flags & SWP_USED)) {
-               printk(KERN_ERR "rw_swap_page: %s%08lx\n", Unused_file, entry.val);
--              return;
-+              return NULL;
-       }
--      if (p->swap_device) {
--              *dev = p->swap_device;
--      } else if (p->swap_file) {
--              *swapf = p->swap_file->d_inode;
--      } else {
--              printk(KERN_ERR "rw_swap_page: no swap file or device\n");
--      }
--      return;
-+      *data = p->data;
-+      return p->method;
- }
- /*
-diff -Nurb linux.orig/net/Config.in linux/net/Config.in
---- linux.orig/net/Config.in   2003-07-04 04:12:29.000000000 -0400
-+++ linux/net/Config.in        2004-05-31 02:18:03.000000000 -0400
-@@ -16,6 +16,9 @@
- fi
- bool 'Socket Filtering'  CONFIG_FILTER
- tristate 'Unix domain sockets' CONFIG_UNIX
-+if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-+    bool 'Swapping via network sockets (EXPERIMENTAL)' CONFIG_NETSWAP
-+fi
- bool 'TCP/IP networking' CONFIG_INET
- if [ "$CONFIG_INET" = "y" ]; then
-    source net/ipv4/Config.in
-diff -Nurb linux.orig/net/Makefile linux/net/Makefile
---- linux.orig/net/Makefile    2003-07-04 04:12:29.000000000 -0400
-+++ linux/net/Makefile 2004-05-31 02:18:03.000000000 -0400
-@@ -51,6 +51,7 @@
- ifeq ($(CONFIG_NET),y)
- obj-$(CONFIG_MODULES)         += netsyms.o
- obj-$(CONFIG_SYSCTL)          += sysctl_net.o
-+obj-$(CONFIG_NETSWAP)           += netswapping.o
- endif
- include $(TOPDIR)/Rules.make
-diff -Nurb linux.orig/net/core/sock.c linux/net/core/sock.c
---- linux.orig/net/core/sock.c 2003-10-14 04:09:32.000000000 -0400
-+++ linux/net/core/sock.c      2004-05-31 02:18:03.000000000 -0400
-@@ -402,6 +402,21 @@
-                       ret = -ENONET;
-                       break;
- #endif
-+#ifdef CONFIG_NETSWAP
-+              case SO_SWAPPING:
-+                      if (valbool) {
-+                              if (!sk->swapping) {
-+                                      netswap_sock_count ++;
-+                              }
-+                              sk->swapping ++;
-+                      } else if (sk->swapping > 0) {
-+                              sk->swapping --;
-+                              if (!sk->swapping) {
-+                                      netswap_sock_count --;
-+                              }
-+                      }
-+                      break;
-+#endif
-               /* We implement the SO_SNDLOWAT etc to
-                  not be settable (1003.1g 5.3) */
-               default:
-@@ -552,6 +567,12 @@
-                       goto lenout;
-               }
-+#ifdef CONFIG_NETSWAP
-+              case SO_SWAPPING:
-+                      v.val = sk->swapping;
-+                      break;
-+#endif
-+
-               /* Dubious BSD thing... Probably nobody even uses it, but
-                * the UNIX standard wants it for whatever reason... -DaveM
-                */
-diff -Nurb linux.orig/net/ipv4/tcp_ipv4.c linux/net/ipv4/tcp_ipv4.c
---- linux.orig/net/ipv4/tcp_ipv4.c     2003-10-14 04:09:33.000000000 -0400
-+++ linux/net/ipv4/tcp_ipv4.c  2004-05-31 02:18:03.000000000 -0400
-@@ -1657,6 +1657,12 @@
-       if (filter && sk_filter(skb, filter))
-               goto discard;
- #endif /* CONFIG_FILTER */
-+#ifdef CONFIG_NETSWAP
-+      /* tcp doesn't use sock_queue_rcv_skb() ... */
-+      /* an inline function defined in net/netswapping.h */
-+      if (netswap_low_memory(sk, skb))
-+              goto discard;
-+#endif /* CONFIG_NETSWAP */
-       IP_INC_STATS_BH(IpInDelivers);
-diff -Nurb linux.orig/net/ipv6/tcp_ipv6.c linux/net/ipv6/tcp_ipv6.c
---- linux.orig/net/ipv6/tcp_ipv6.c     2003-10-14 04:09:34.000000000 -0400
-+++ linux/net/ipv6/tcp_ipv6.c  2004-05-31 02:18:03.000000000 -0400
-@@ -1424,6 +1424,12 @@
-       if (filter && sk_filter(skb, filter))
-               goto discard;
- #endif /* CONFIG_FILTER */
-+#ifdef CONFIG_NETSWAP
-+      /* tcp doesn't use sock_queue_rcv_skb() ... */
-+      /* an inline function defined in net/netswapping.h */
-+      if (netswap_low_memory(sk, skb))
-+              goto discard;
-+#endif /* CONFIG_NETSWAP */
-       /*
-        *      socket locking is here for SMP purposes as backlog rcv
-diff -Nurb linux.orig/net/netswapping.c linux/net/netswapping.c
---- linux.orig/net/netswapping.c       1969-12-31 19:00:00.000000000 -0500
-+++ linux/net/netswapping.c    2004-05-31 02:18:03.000000000 -0400
-@@ -0,0 +1,76 @@
-+/*
-+ * linux/net/swapping.c
-+ *
-+ * Support paging over network connections (inet only)
-+ *
-+ * (c) 2000 Claus-Justus Heine <heine@instmath.rwth-aachen.de>
-+ */
-+
-+#include <linux/slab.h>
-+#include <linux/swap.h>
-+#include <linux/swapctl.h>
-+#include <linux/skbuff.h>
-+#include <linux/module.h>
-+#include <linux/sysctl.h>
-+#include <linux/init.h>
-+#include <net/netswapping.h>
-+#include <net/sock.h>
-+#include <asm/uaccess.h>
-+
-+unsigned int netswap_dropped; /* statistics */
-+unsigned int netswap_free_pages_min;
-+int netswap_sock_count;   /* how many sockets have swapping option set */
-+
-+#ifdef CONFIG_SYSCTL
-+
-+static ctl_table netswap_table[] = {
-+      {NET_SWAP_DROPPED, "dropped",
-+       &netswap_dropped, sizeof(int), 0644, NULL, &proc_dointvec },
-+      {NET_SWAP_DROP_THRESHOLD, "threshold",
-+       &netswap_free_pages_min, sizeof(int), 0644, NULL, &proc_dointvec },
-+      {NET_SWAP_SOCK_COUNT, "sock_count",
-+       &netswap_sock_count, sizeof(int), 0444, NULL, &proc_dointvec },
-+      {0},
-+};
-+
-+static struct ctl_table_header *netswap_sysctl_header;
-+
-+static ctl_table netswap_net_table[] = {
-+      {CTL_NETSWAP, "swapping", NULL, 0, 0555, netswap_table},
-+      {0}
-+};
-+
-+static ctl_table netswap_root_table[] = {
-+      {CTL_NET, "net", NULL, 0, 0555, netswap_net_table},
-+      {0}
-+};
-+
-+#endif
-+
-+int __init netswap_init(void)
-+{
-+      /* drop packets when below this threshold */
-+      netswap_free_pages_min = 32 /* freepages.min */;
-+#ifdef CONFIG_SYSCTL
-+      netswap_sysctl_header = register_sysctl_table(netswap_root_table, 0);
-+#endif
-+      return 0;
-+}
-+
-+void __exit netswap_exit(void)
-+{
-+#ifdef CONFIG_SYSCTL
-+      unregister_sysctl_table(netswap_sysctl_header);
-+#endif
-+}
-+
-+/* linux/init.h -- VERY nice :-)
-+ *
-+ * On the other hand, we have no control over the order the initcalls
-+ * are performed ...
-+ *
-+ * Actually, we are not compiled as module ...
-+ */
-+
-+module_init(netswap_init)
-+module_exit(netswap_exit)
-diff -Nurb linux.orig/net/netsyms.c linux/net/netsyms.c
---- linux.orig/net/netsyms.c   2004-05-31 02:02:49.000000000 -0400
-+++ linux/net/netsyms.c        2004-05-31 02:18:03.000000000 -0400
-@@ -601,4 +601,10 @@
- EXPORT_SYMBOL(wireless_send_event);
- #endif /* CONFIG_NET_RADIO || CONFIG_NET_PCMCIA_RADIO */
-+#ifdef CONFIG_NETSWAP
-+EXPORT_SYMBOL(netswap_sock_count);
-+EXPORT_SYMBOL(netswap_free_pages_min);
-+EXPORT_SYMBOL(netswap_dropped);
-+#endif
-+
- #endif  /* CONFIG_NET */
-diff -Nurb linux.orig/net/packet/af_packet.c linux/net/packet/af_packet.c
---- linux.orig/net/packet/af_packet.c  2003-10-14 04:09:35.000000000 -0400
-+++ linux/net/packet/af_packet.c       2004-05-31 02:18:03.000000000 -0400
-@@ -449,6 +449,12 @@
-                       snaplen = res;
-       }
- #endif /* CONFIG_FILTER */
-+#ifdef CONFIG_NETSWAP
-+      /* packet doesn't use sock_queue_rcv_skb() ... */
-+      /* an inline function defined in net/netswapping.h */
-+      if (netswap_low_memory(sk, skb))
-+              goto drop_n_restore;
-+#endif /* CONFIG_NETSWAP */
-       if (atomic_read(&sk->rmem_alloc) + skb->truesize >= (unsigned)sk->rcvbuf)
-               goto drop_n_acct;
-@@ -496,7 +502,7 @@
-       po->stats.tp_drops++;
-       spin_unlock(&sk->receive_queue.lock);
--#ifdef CONFIG_FILTER
-+#if defined(CONFIG_FILTER) || defined(CONFIG_NETSWAP)
- drop_n_restore:
- #endif
-       if (skb_head != skb->data && skb_shared(skb)) {
-@@ -557,6 +563,12 @@
-                       snaplen = res;
-       }
- #endif
-+#ifdef CONFIG_NETSWAP
-+      /* packet doesn't use sock_queue_rcv_skb() ... */
-+      /* an inline function defined in net/netswapping.h */
-+      if (netswap_low_memory(sk, skb))
-+              goto drop_n_restore;
-+#endif /* CONFIG_NETSWAP */
-       if (sk->type == SOCK_DGRAM) {
-               macoff = netoff = TPACKET_ALIGN(TPACKET_HDRLEN) + 16;
-diff -Nurb linux.orig/net/sunrpc/sched.c linux/net/sunrpc/sched.c
---- linux.orig/net/sunrpc/sched.c      2003-07-04 04:12:33.000000000 -0400
-+++ linux/net/sunrpc/sched.c   2004-05-31 02:18:03.000000000 -0400
-@@ -79,10 +79,11 @@
-  */
- static spinlock_t rpc_sched_lock = SPIN_LOCK_UNLOCKED;
-+#if CONFIG_SWAP_VIA_NFS || CONFIG_SWAP_VIA_NFS_MODULE
- /*
-  * This is the last-ditch buffer for NFS swap requests
-  */
--static u32                    swap_buffer[PAGE_SIZE >> 2];
-+static u32                    swap_buffer[2*PAGE_SIZE >> 2];
- static long                   swap_buffer_used;
- /*
-@@ -96,6 +97,7 @@
- {
-       clear_bit(1, &swap_buffer_used);
- }
-+#endif
- /*
-  * Disable the timer for a given RPC task. Should be called with
-@@ -501,6 +503,7 @@
- __rpc_execute(struct rpc_task *task)
- {
-       int             status = 0;
-+      unsigned long alloc_flag = current->flags & PF_MEMALLOC;
-       dprintk("RPC: %4d rpc_execute flgs %x\n",
-                               task->tk_pid, task->tk_flags);
-@@ -510,6 +513,13 @@
-               return 0;
-       }
-+      if (task->tk_flags & RPC_TASK_SWAPPER) {
-+              if (!current->flags & PF_MEMALLOC) {
-+                      dprintk("__rpc_execute: Setting PF_MEMALLOC\n");
-+              }
-+              current->flags |= PF_MEMALLOC;
-+      }
-+
-  restarted:
-       while (1) {
-               /*
-@@ -554,7 +564,8 @@
-                       rpc_set_sleeping(task);
-                       if (RPC_IS_ASYNC(task)) {
-                               spin_unlock_bh(&rpc_queue_lock);
--                              return 0;
-+                              status = 0;
-+                              goto out;
-                       }
-               }
-               spin_unlock_bh(&rpc_queue_lock);
-@@ -563,7 +574,12 @@
-                       /* sync task: sleep here */
-                       dprintk("RPC: %4d sync task going to sleep\n",
-                                                       task->tk_pid);
--                      if (current->pid == rpciod_pid)
-+                      /* it's ok to wait for rpciod when swapping,
-+                       * because this means it needed memory and is
-+                       * doing the swap-out itself.
-+                       */
-+                      if (current->pid == rpciod_pid &&
-+                          !(task->tk_flags & RPC_TASK_SWAPPER))
-                               printk(KERN_ERR "RPC: rpciod waiting on sync task!\n");
-                       __wait_event(task->tk_wait, !RPC_IS_SLEEPING(task));
-@@ -608,6 +624,10 @@
-       /* Release all resources associated with the task */
-       rpc_release_task(task);
-+ out:
-+      if (!alloc_flag) {
-+              current->flags &= ~PF_MEMALLOC;
-+      }       
-       return status;
- }
-@@ -699,10 +719,16 @@
- {
-       u32     *buffer;
-       int     gfp;
-+      unsigned long alloc_flag = current->flags & PF_MEMALLOC;
-+      void    *ret = NULL;
--      if (flags & RPC_TASK_SWAPPER)
-+      if (flags & RPC_TASK_SWAPPER) {
-               gfp = GFP_ATOMIC;
--      else if (flags & RPC_TASK_ASYNC)
-+              if (!(current->flags & PF_MEMALLOC)) {
-+                      dprintk("rpc_allocate: Setting PF_MEMALLOC\n");
-+              }
-+              current->flags |= PF_MEMALLOC;
-+      } else if (flags & RPC_TASK_ASYNC)
-               gfp = GFP_RPC;
-       else
-               gfp = GFP_KERNEL;
-@@ -710,29 +736,44 @@
-       do {
-               if ((buffer = (u32 *) kmalloc(size, gfp)) != NULL) {
-                       dprintk("RPC:      allocated buffer %p\n", buffer);
--                      return buffer;
-+                      ret = buffer;
-+                      goto out;
-               }
-+#if CONFIG_SWAP_VIA_NFS || CONFIG_SWAP_VIA_NFS_MODULE
-               if ((flags & RPC_TASK_SWAPPER) && size <= sizeof(swap_buffer)
-                   && rpc_lock_swapbuf()) {
-                       dprintk("RPC:      used last-ditch swap buffer\n");
--                      return swap_buffer;
-+                      ret = swap_buffer;
-+                      goto out;
-+#endif
-+              }
-+              if (flags & RPC_TASK_ASYNC) {
-+                      ret = NULL;
-+                      goto out;
-               }
--              if (flags & RPC_TASK_ASYNC)
--                      return NULL;
-               yield();
-       } while (!signalled());
--      return NULL;
-+ out:
-+      if (!alloc_flag) {
-+              current->flags &= ~PF_MEMALLOC;
-+      }
-+      return ret;
- }
- void
- rpc_free(void *buffer)
- {
-+#if CONFIG_SWAP_VIA_NFS || CONFIG_SWAP_VIA_NFS_MODULE
-       if (buffer != swap_buffer) {
-+#endif
-               kfree(buffer);
-               return;
-+#if CONFIG_SWAP_VIA_NFS || CONFIG_SWAP_VIA_NFS_MODULE
-       }
-       rpc_unlock_swapbuf();
-+      printk("RPC:      Released swap buffer\n");
-+#endif
- }
- /*
-diff -Nurb linux.orig/net/sunrpc/xprt.c linux/net/sunrpc/xprt.c
---- linux.orig/net/sunrpc/xprt.c       2003-07-04 04:12:33.000000000 -0400
-+++ linux/net/sunrpc/xprt.c    2004-05-31 02:18:03.000000000 -0400
-@@ -139,7 +139,7 @@
- __xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task)
- {
-       if (!xprt->snd_task) {
--              if (xprt->nocong || __xprt_get_cong(xprt, task))
-+              if (__xprt_get_cong(xprt, task))
-                       xprt->snd_task = task;
-       }
-       if (xprt->snd_task != task) {
-@@ -179,7 +179,7 @@
-               if (!task)
-                       return;
-       }
--      if (xprt->nocong || __xprt_get_cong(xprt, task))
-+      if (__xprt_get_cong(xprt, task))
-               xprt->snd_task = task;
- }
-@@ -276,6 +276,9 @@
- {
-       struct rpc_rqst *req = task->tk_rqstp;
-+      if (xprt->nocong || RPC_IS_SWAPPER(task))
-+              return 1;
-+
-       if (req->rq_cong)
-               return 1;
-       dprintk("RPC: %4d xprt_cwnd_limited cong = %ld cwnd = %ld\n",
diff --git a/obsolete-buildroot/sources/openwrt/kernel/patches/140-ebtables-brnf-5.patch b/obsolete-buildroot/sources/openwrt/kernel/patches/140-ebtables-brnf-5.patch
deleted file mode 100644 (file)
index 60de305..0000000
+++ /dev/null
@@ -1,5552 +0,0 @@
---- linux-2.4.21/net/bridge/br_private.h       Mon Feb 25 20:38:14 2002
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/br_private.h    Fri Aug  8 01:09:06 2003
-@@ -144,8 +144,10 @@ extern void br_fdb_insert(struct net_bri
- /* br_forward.c */
- extern void br_deliver(struct net_bridge_port *to,
-               struct sk_buff *skb);
-+extern int br_dev_queue_push_xmit(struct sk_buff *skb);
- extern void br_forward(struct net_bridge_port *to,
-               struct sk_buff *skb);
-+extern int br_forward_finish(struct sk_buff *skb);
- extern void br_flood_deliver(struct net_bridge *br,
-                     struct sk_buff *skb,
-                     int clone);
-@@ -166,7 +168,8 @@ extern void br_get_port_ifindices(struct
-                          int *ifindices);
- /* br_input.c */
--extern void br_handle_frame(struct sk_buff *skb);
-+extern int br_handle_frame_finish(struct sk_buff *skb);
-+extern int br_handle_frame(struct sk_buff *skb);
- /* br_ioctl.c */
- extern void br_call_ioctl_atomic(void (*fn)(void));
-@@ -176,6 +179,10 @@ extern int br_ioctl(struct net_bridge *b
-            unsigned long arg1,
-            unsigned long arg2);
- extern int br_ioctl_deviceless_stub(unsigned long arg);
-+
-+/* br_netfilter.c */
-+extern int br_netfilter_init(void);
-+extern void br_netfilter_fini(void);
- /* br_stp.c */
- extern int br_is_root_bridge(struct net_bridge *br);
---- linux-2.4.21/include/linux/if_bridge.h     Thu Nov 22 20:47:12 2001
-+++ linux-2.4.21-ebt-brnf-3/include/linux/if_bridge.h  Fri Aug  8 01:09:06 2003
-@@ -102,7 +102,8 @@ struct net_bridge;
- struct net_bridge_port;
- extern int (*br_ioctl_hook)(unsigned long arg);
--extern void (*br_handle_frame_hook)(struct sk_buff *skb);
-+extern int (*br_handle_frame_hook)(struct sk_buff *skb);
-+extern int (*br_should_route_hook)(struct sk_buff **pskb);
- #endif
---- linux-2.4.21/net/core/dev.c        Fri Jun 13 16:51:39 2003
-+++ linux-2.4.21-ebt-brnf-3/net/core/dev.c     Fri Aug  8 01:10:03 2003
-@@ -1424,7 +1424,7 @@ static void net_tx_action(struct softirq
- #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
--void (*br_handle_frame_hook)(struct sk_buff *skb) = NULL;
-+int (*br_handle_frame_hook)(struct sk_buff *skb) = NULL;
- #endif
- static __inline__ int handle_bridge(struct sk_buff *skb,
-@@ -1441,7 +1441,6 @@ static __inline__ int handle_bridge(stru
-               }
-       }
--      br_handle_frame_hook(skb);
-       return ret;
- }
-@@ -1497,11 +1496,16 @@ int netif_receive_skb(struct sk_buff *sk
-       if (skb->dev->divert && skb->dev->divert->divert)
-               ret = handle_diverter(skb);
- #endif /* CONFIG_NET_DIVERT */
--                      
-+
- #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-       if (skb->dev->br_port != NULL &&
--          br_handle_frame_hook != NULL) {
--              return handle_bridge(skb, pt_prev);
-+        br_handle_frame_hook != NULL) {
-+              int ret;
-+
-+              ret = handle_bridge(skb, pt_prev);
-+              if (br_handle_frame_hook(skb) == 0)
-+                      return ret;
-+              pt_prev = NULL;
-       }
- #endif
-@@ -1897,7 +1901,7 @@ static int dev_proc_stats(char *buffer, 
-  *    are adjusted, %RTM_NEWLINK is sent to the routing socket and the
-  *    function returns zero.
-  */
-- 
-+
- int netdev_set_master(struct net_device *slave, struct net_device *master)
- {
-       struct net_device *old = slave->master;
---- linux-2.4.21/net/bridge/br_input.c Sat Aug  3 02:39:46 2002
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/br_input.c      Fri Aug  8 01:09:06 2003
-@@ -24,6 +24,9 @@ unsigned char bridge_ula[6] = { 0x01, 0x
- static int br_pass_frame_up_finish(struct sk_buff *skb)
- {
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug = 0;
-+#endif
-       netif_rx(skb);
-       return 0;
-@@ -46,7 +49,7 @@ static void br_pass_frame_up(struct net_
-                       br_pass_frame_up_finish);
- }
--static int br_handle_frame_finish(struct sk_buff *skb)
-+int br_handle_frame_finish(struct sk_buff *skb)
- {
-       struct net_bridge *br;
-       unsigned char *dest;
-@@ -112,7 +115,7 @@ err_nolock:
-       return 0;
- }
--void br_handle_frame(struct sk_buff *skb)
-+int br_handle_frame(struct sk_buff *skb)
- {
-       struct net_bridge *br;
-       unsigned char *dest;
-@@ -146,25 +149,35 @@ void br_handle_frame(struct sk_buff *skb
-               goto handle_special_frame;
-       if (p->state == BR_STATE_FORWARDING) {
-+
-+              if (br_should_route_hook && br_should_route_hook(&skb)) {
-+                      read_unlock(&br->lock);
-+                      return -1;
-+              }
-+
-+              if (!memcmp(p->br->dev.dev_addr, dest, ETH_ALEN))
-+                      skb->pkt_type = PACKET_HOST;
-+
-               NF_HOOK(PF_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL,
-                       br_handle_frame_finish);
-               read_unlock(&br->lock);
--              return;
-+              return 0;
-       }
- err:
-       read_unlock(&br->lock);
- err_nolock:
-       kfree_skb(skb);
--      return;
-+      return 0;
- handle_special_frame:
-       if (!dest[5]) {
-               br_stp_handle_bpdu(skb);
-               read_unlock(&br->lock);
--              return;
-+              return 0;
-       }
-       read_unlock(&br->lock);
-       kfree_skb(skb);
-+      return 0;
- }
---- linux-2.4.21/net/bridge/br_forward.c       Sat Aug  3 02:39:46 2002
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/br_forward.c    Fri Aug  8 01:09:06 2003
-@@ -30,18 +30,22 @@ static inline int should_deliver(struct 
-       return 1;
- }
--static int __dev_queue_push_xmit(struct sk_buff *skb)
-+int br_dev_queue_push_xmit(struct sk_buff *skb)
- {
-+#ifdef CONFIG_NETFILTER
-+      if (skb->nf_bridge)
-+              memcpy(skb->data - 16, skb->nf_bridge->hh, 16);
-+#endif
-       skb_push(skb, ETH_HLEN);
-       dev_queue_xmit(skb);
-       return 0;
- }
--static int __br_forward_finish(struct sk_buff *skb)
-+int br_forward_finish(struct sk_buff *skb)
- {
-       NF_HOOK(PF_BRIDGE, NF_BR_POST_ROUTING, skb, NULL, skb->dev,
--                      __dev_queue_push_xmit);
-+                      br_dev_queue_push_xmit);
-       return 0;
- }
-@@ -49,8 +53,11 @@ static int __br_forward_finish(struct sk
- static void __br_deliver(struct net_bridge_port *to, struct sk_buff *skb)
- {
-       skb->dev = to->dev;
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug = 0;
-+#endif
-       NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev,
--                      __br_forward_finish);
-+                      br_forward_finish);
- }
- static void __br_forward(struct net_bridge_port *to, struct sk_buff *skb)
-@@ -61,7 +68,7 @@ static void __br_forward(struct net_brid
-       skb->dev = to->dev;
-       NF_HOOK(PF_BRIDGE, NF_BR_FORWARD, skb, indev, skb->dev,
--                      __br_forward_finish);
-+                      br_forward_finish);
- }
- /* called under bridge lock */
---- linux-2.4.21/net/bridge/br.c       Fri Nov 29 00:53:15 2002
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/br.c    Fri Aug  8 01:09:06 2003
-@@ -29,6 +29,8 @@
- #include "../atm/lec.h"
- #endif
-+int (*br_should_route_hook) (struct sk_buff **pskb) = NULL;
-+
- void br_dec_use_count()
- {
-       MOD_DEC_USE_COUNT;
-@@ -43,6 +45,10 @@ static int __init br_init(void)
- {
-       printk(KERN_INFO "NET4: Ethernet Bridge 008 for NET4.0\n");
-+#ifdef CONFIG_NETFILTER
-+      if (br_netfilter_init())
-+              return 1;
-+#endif
-       br_handle_frame_hook = br_handle_frame;
-       br_ioctl_hook = br_ioctl_deviceless_stub;
- #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE)
-@@ -61,6 +67,9 @@ static void __br_clear_ioctl_hook(void)
- static void __exit br_deinit(void)
- {
-+#ifdef CONFIG_NETFILTER
-+      br_netfilter_fini();
-+#endif
-       unregister_netdevice_notifier(&br_device_notifier);
-       br_call_ioctl_atomic(__br_clear_ioctl_hook);
-@@ -74,7 +83,7 @@ static void __exit br_deinit(void)
- #endif
- }
--EXPORT_NO_SYMBOLS;
-+EXPORT_SYMBOL(br_should_route_hook);
- module_init(br_init)
- module_exit(br_deinit)
---- linux-2.4.21/net/bridge/Makefile   Fri Dec 29 23:07:24 2000
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/Makefile        Fri Aug  8 01:09:06 2003
-@@ -7,10 +7,17 @@
- #
- # Note 2! The CFLAGS definition is now in the main makefile...
-+export-objs := br.o
-+
- O_TARGET      := bridge.o
- obj-y         := br.o br_device.o br_fdb.o br_forward.o br_if.o br_input.o \
-                       br_ioctl.o br_notify.o br_stp.o br_stp_bpdu.o \
-                       br_stp_if.o br_stp_timer.o
-+
-+ifeq ($(CONFIG_NETFILTER),y)
-+obj-y         += br_netfilter.o
-+endif
-+
- obj-m         := $(O_TARGET)
- include $(TOPDIR)/Rules.make
---- linux-2.4.21/include/linux/netfilter_bridge.h      Tue Jun 12 04:15:27 2001
-+++ linux-2.4.21-ebt-brnf-3/include/linux/netfilter_bridge.h   Fri Aug  8 01:09:06 2003
-@@ -1,11 +1,14 @@
- #ifndef __LINUX_BRIDGE_NETFILTER_H
- #define __LINUX_BRIDGE_NETFILTER_H
--/* bridge-specific defines for netfilter. 
-+/* bridge-specific defines for netfilter.
-  */
- #include <linux/config.h>
- #include <linux/netfilter.h>
-+#if defined(__KERNEL__) && defined(CONFIG_NETFILTER)
-+#include <asm/atomic.h>
-+#endif
- /* Bridge Hooks */
- /* After promisc drops, checksum checks. */
-@@ -18,7 +21,49 @@
- #define NF_BR_LOCAL_OUT               3
- /* Packets about to hit the wire. */
- #define NF_BR_POST_ROUTING    4
--#define NF_BR_NUMHOOKS                5
-+/* Not really a hook, but used for the ebtables broute table */
-+#define NF_BR_BROUTING                5
-+#define NF_BR_NUMHOOKS                6
-+#ifdef __KERNEL__
-+#define BRNF_PKT_TYPE                 0x01
-+#define BRNF_BRIDGED_DNAT             0x02
-+#define BRNF_DONT_TAKE_PARENT         0x04
-+#define BRNF_BRIDGED                  0x08
-+
-+enum nf_br_hook_priorities {
-+      NF_BR_PRI_FIRST = INT_MIN,
-+      NF_BR_PRI_NAT_DST_BRIDGED = -300,
-+      NF_BR_PRI_FILTER_BRIDGED = -200,
-+      NF_BR_PRI_BRNF = 0,
-+      NF_BR_PRI_NAT_DST_OTHER = 100,
-+      NF_BR_PRI_FILTER_OTHER = 200,
-+      NF_BR_PRI_NAT_SRC = 300,
-+      NF_BR_PRI_LAST = INT_MAX,
-+};
-+
-+#ifdef CONFIG_NETFILTER
-+static inline
-+struct nf_bridge_info *nf_bridge_alloc(struct sk_buff *skb)
-+{
-+      struct nf_bridge_info **nf_bridge = &(skb->nf_bridge);
-+
-+      if ((*nf_bridge = kmalloc(sizeof(**nf_bridge), GFP_ATOMIC)) != NULL) {
-+              atomic_set(&(*nf_bridge)->use, 1);
-+              (*nf_bridge)->mask = 0;
-+              (*nf_bridge)->physindev = (*nf_bridge)->physoutdev = NULL;
-+      }
-+
-+      return *nf_bridge;
-+}
-+
-+struct bridge_skb_cb {
-+      union {
-+              __u32 ipv4;
-+      } daddr;
-+};
-+#endif /* CONFIG_NETFILTER */
-+
-+#endif /* __KERNEL__ */
- #endif
---- linux-2.4.21/net/Makefile  Sat Aug  3 02:39:46 2002
-+++ linux-2.4.21-ebt-brnf-3/net/Makefile       Fri Aug  8 01:09:06 2003
-@@ -7,7 +7,8 @@
- O_TARGET :=   network.o
--mod-subdirs :=        ipv4/netfilter ipv6/netfilter ipx irda bluetooth atm netlink sched core
-+mod-subdirs :=        ipv4/netfilter ipv6/netfilter bridge/netfilter ipx irda \
-+      bluetooth atm netlink sched core
- export-objs :=        netsyms.o
- subdir-y :=   core ethernet
-@@ -23,6 +24,12 @@ subdir-$(CONFIG_IPV6)               += ipv6
- ifneq ($(CONFIG_IPV6),n)
- ifneq ($(CONFIG_IPV6),)
- subdir-$(CONFIG_NETFILTER)    += ipv6/netfilter
-+endif
-+endif
-+
-+ifneq ($(CONFIG_BRIDGE),n)
-+ifneq ($(CONFIG_BRIDGE),)
-+subdir-$(CONFIG_BRIDGE)               += bridge/netfilter
- endif
- endif
---- linux-2.4.21/net/Config.in Sat Aug  3 02:39:46 2002
-+++ linux-2.4.21-ebt-brnf-3/net/Config.in      Fri Aug  8 01:09:06 2003
-@@ -65,6 +65,9 @@ if [ "$CONFIG_DECNET" != "n" ]; then
-    source net/decnet/Config.in
- fi
- dep_tristate '802.1d Ethernet Bridging' CONFIG_BRIDGE $CONFIG_INET
-+if [ "$CONFIG_BRIDGE" != "n" -a "$CONFIG_NETFILTER" != "n" ]; then
-+   source net/bridge/netfilter/Config.in
-+fi
- if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-    tristate 'CCITT X.25 Packet Layer (EXPERIMENTAL)' CONFIG_X25
-    tristate 'LAPB Data Link Driver (EXPERIMENTAL)' CONFIG_LAPB
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/netfilter/Makefile      Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,30 @@
-+#
-+# Makefile for the netfilter modules on top of bridging.
-+#
-+# Note! Dependencies are done automagically by 'make dep', which also
-+# removes any old dependencies. DON'T put your own dependencies here
-+# unless it's something special (ie not a .c file).
-+#
-+# Note 2! The CFLAGS definition is now in the main makefile...
-+
-+O_TARGET      := netfilter.o
-+
-+export-objs := ebtables.o
-+
-+obj-$(CONFIG_BRIDGE_NF_EBTABLES) += ebtables.o
-+obj-$(CONFIG_BRIDGE_EBT_T_FILTER) += ebtable_filter.o
-+obj-$(CONFIG_BRIDGE_EBT_T_NAT) += ebtable_nat.o
-+obj-$(CONFIG_BRIDGE_EBT_BROUTE) += ebtable_broute.o
-+obj-$(CONFIG_BRIDGE_EBT_IPF) += ebt_ip.o
-+obj-$(CONFIG_BRIDGE_EBT_ARPF) += ebt_arp.o
-+obj-$(CONFIG_BRIDGE_EBT_VLANF) += ebt_vlan.o
-+obj-$(CONFIG_BRIDGE_EBT_MARKF) += ebt_mark_m.o
-+obj-$(CONFIG_BRIDGE_EBT_802_3) += ebt_802_3.o
-+obj-$(CONFIG_BRIDGE_EBT_PKTTYPE) += ebt_pkttype.o
-+obj-$(CONFIG_BRIDGE_EBT_PKTTYPE) += ebt_stp.o
-+obj-$(CONFIG_BRIDGE_EBT_LOG) += ebt_log.o
-+obj-$(CONFIG_BRIDGE_EBT_SNAT) += ebt_snat.o
-+obj-$(CONFIG_BRIDGE_EBT_DNAT) += ebt_dnat.o
-+obj-$(CONFIG_BRIDGE_EBT_REDIRECT) += ebt_redirect.o
-+obj-$(CONFIG_BRIDGE_EBT_MARK_T) += ebt_mark.o
-+include $(TOPDIR)/Rules.make
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/netfilter/Config.in     Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,19 @@
-+#
-+# Bridge netfilter configuration
-+#
-+dep_tristate '  Bridge: ebtables' CONFIG_BRIDGE_NF_EBTABLES $CONFIG_BRIDGE
-+dep_tristate '    ebt: filter table support' CONFIG_BRIDGE_EBT_T_FILTER $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: nat table support' CONFIG_BRIDGE_EBT_T_NAT $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: broute table support' CONFIG_BRIDGE_EBT_BROUTE $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: log support' CONFIG_BRIDGE_EBT_LOG $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: IP filter support' CONFIG_BRIDGE_EBT_IPF $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: ARP filter support' CONFIG_BRIDGE_EBT_ARPF $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: 802.1Q VLAN filter support' CONFIG_BRIDGE_EBT_VLANF $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: 802.3 filter support' CONFIG_BRIDGE_EBT_802_3 $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: packet type filter support' CONFIG_BRIDGE_EBT_PKTTYPE $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: STP filter support' CONFIG_BRIDGE_EBT_STP $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: mark filter support' CONFIG_BRIDGE_EBT_MARKF $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: snat target support' CONFIG_BRIDGE_EBT_SNAT $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: dnat target support' CONFIG_BRIDGE_EBT_DNAT $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: redirect target support' CONFIG_BRIDGE_EBT_REDIRECT $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: mark target support' CONFIG_BRIDGE_EBT_MARK_T $CONFIG_BRIDGE_NF_EBTABLES
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/netfilter/ebtable_filter.c      Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,90 @@
-+/*
-+ *  ebtable_filter
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  April, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/module.h>
-+
-+#define FILTER_VALID_HOOKS ((1 << NF_BR_LOCAL_IN) | (1 << NF_BR_FORWARD) | \
-+   (1 << NF_BR_LOCAL_OUT))
-+
-+static struct ebt_entries initial_chains[] =
-+{
-+  {0, "INPUT", 0, EBT_ACCEPT, 0},
-+  {0, "FORWARD", 0, EBT_ACCEPT, 0},
-+  {0, "OUTPUT", 0, EBT_ACCEPT, 0}
-+};
-+
-+static struct ebt_replace initial_table =
-+{
-+  "filter", FILTER_VALID_HOOKS, 0, 3 * sizeof(struct ebt_entries),
-+  { [NF_BR_LOCAL_IN]&initial_chains[0], [NF_BR_FORWARD]&initial_chains[1],
-+    [NF_BR_LOCAL_OUT]&initial_chains[2] }, 0, NULL, (char *)initial_chains
-+};
-+
-+static int check(const struct ebt_table_info *info, unsigned int valid_hooks)
-+{
-+      if (valid_hooks & ~FILTER_VALID_HOOKS)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_table frame_filter =
-+{ 
-+  {NULL, NULL}, "filter", &initial_table, FILTER_VALID_HOOKS, 
-+  RW_LOCK_UNLOCKED, check, NULL
-+};
-+
-+static unsigned int
-+ebt_hook (unsigned int hook, struct sk_buff **pskb, const struct net_device *in,
-+   const struct net_device *out, int (*okfn)(struct sk_buff *))
-+{
-+      return ebt_do_table(hook, pskb, in, out, &frame_filter);
-+}
-+
-+static struct nf_hook_ops ebt_ops_filter[] = {
-+      { { NULL, NULL }, ebt_hook, PF_BRIDGE, NF_BR_LOCAL_IN,
-+         NF_BR_PRI_FILTER_BRIDGED},
-+      { { NULL, NULL }, ebt_hook, PF_BRIDGE, NF_BR_FORWARD,
-+         NF_BR_PRI_FILTER_BRIDGED},
-+      { { NULL, NULL }, ebt_hook, PF_BRIDGE, NF_BR_LOCAL_OUT,
-+         NF_BR_PRI_FILTER_OTHER}
-+};
-+
-+static int __init init(void)
-+{
-+      int i, j, ret;
-+
-+      ret = ebt_register_table(&frame_filter);
-+      if (ret < 0)
-+              return ret;
-+      for (i = 0; i < sizeof(ebt_ops_filter) / sizeof(ebt_ops_filter[0]); i++)
-+              if ((ret = nf_register_hook(&ebt_ops_filter[i])) < 0)
-+                      goto cleanup;
-+      return ret;
-+cleanup:
-+      for (j = 0; j < i; j++)
-+              nf_unregister_hook(&ebt_ops_filter[j]);
-+      ebt_unregister_table(&frame_filter);
-+      return ret;
-+}
-+
-+static void __exit fini(void)
-+{
-+      int i;
-+
-+      for (i = 0; i < sizeof(ebt_ops_filter) / sizeof(ebt_ops_filter[0]); i++)
-+              nf_unregister_hook(&ebt_ops_filter[i]);
-+      ebt_unregister_table(&frame_filter);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/netfilter/ebtable_nat.c Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,96 @@
-+/*
-+ *  ebtable_nat
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  April, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/module.h>
-+#define NAT_VALID_HOOKS ((1 << NF_BR_PRE_ROUTING) | (1 << NF_BR_LOCAL_OUT) | \
-+   (1 << NF_BR_POST_ROUTING))
-+
-+static struct ebt_entries initial_chains[] =
-+{
-+  {0, "PREROUTING", 0, EBT_ACCEPT, 0},
-+  {0, "OUTPUT", 0, EBT_ACCEPT, 0},
-+  {0, "POSTROUTING", 0, EBT_ACCEPT, 0}
-+};
-+
-+static struct ebt_replace initial_table =
-+{
-+  "nat", NAT_VALID_HOOKS, 0, 3 * sizeof(struct ebt_entries),
-+  { [NF_BR_PRE_ROUTING]&initial_chains[0], [NF_BR_LOCAL_OUT]&initial_chains[1],
-+    [NF_BR_POST_ROUTING]&initial_chains[2] }, 0, NULL, (char *)initial_chains
-+};
-+
-+static int check(const struct ebt_table_info *info, unsigned int valid_hooks)
-+{
-+      if (valid_hooks & ~NAT_VALID_HOOKS)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_table frame_nat =
-+{
-+  {NULL, NULL}, "nat", &initial_table, NAT_VALID_HOOKS,
-+  RW_LOCK_UNLOCKED, check, NULL
-+};
-+
-+static unsigned int
-+ebt_nat_dst(unsigned int hook, struct sk_buff **pskb, const struct net_device *in
-+   , const struct net_device *out, int (*okfn)(struct sk_buff *))
-+{
-+      return ebt_do_table(hook, pskb, in, out, &frame_nat);
-+}
-+
-+static unsigned int
-+ebt_nat_src(unsigned int hook, struct sk_buff **pskb, const struct net_device *in
-+   , const struct net_device *out, int (*okfn)(struct sk_buff *))
-+{
-+      return ebt_do_table(hook, pskb, in, out, &frame_nat);
-+}
-+
-+static struct nf_hook_ops ebt_ops_nat[] = {
-+      { { NULL, NULL }, ebt_nat_dst, PF_BRIDGE, NF_BR_LOCAL_OUT,
-+         NF_BR_PRI_NAT_DST_OTHER},
-+      { { NULL, NULL }, ebt_nat_src, PF_BRIDGE, NF_BR_POST_ROUTING,
-+         NF_BR_PRI_NAT_SRC},
-+      { { NULL, NULL }, ebt_nat_dst, PF_BRIDGE, NF_BR_PRE_ROUTING,
-+         NF_BR_PRI_NAT_DST_BRIDGED},
-+};
-+
-+static int __init init(void)
-+{
-+      int i, ret, j;
-+
-+      ret = ebt_register_table(&frame_nat);
-+      if (ret < 0)
-+              return ret;
-+      for (i = 0; i < sizeof(ebt_ops_nat) / sizeof(ebt_ops_nat[0]); i++)
-+              if ((ret = nf_register_hook(&ebt_ops_nat[i])) < 0)
-+                      goto cleanup;
-+      return ret;
-+cleanup:
-+      for (j = 0; j < i; j++)
-+              nf_unregister_hook(&ebt_ops_nat[j]);
-+      ebt_unregister_table(&frame_nat);
-+      return ret;
-+}
-+
-+static void __exit fini(void)
-+{
-+      int i;
-+
-+      for (i = 0; i < sizeof(ebt_ops_nat) / sizeof(ebt_ops_nat[0]); i++)
-+              nf_unregister_hook(&ebt_ops_nat[i]);
-+      ebt_unregister_table(&frame_nat);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/netfilter/ebtable_broute.c      Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,79 @@
-+/*
-+ *  ebtable_broute
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  April, 2002
-+ *
-+ *  This table lets you choose between routing and bridging for frames
-+ *  entering on a bridge enslaved nic. This table is traversed before any
-+ *  other ebtables table. See net/bridge/br_input.c.
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/module.h>
-+#include <linux/if_bridge.h>
-+#include <linux/brlock.h>
-+
-+// EBT_ACCEPT means the frame will be bridged
-+// EBT_DROP means the frame will be routed
-+static struct ebt_entries initial_chain =
-+  {0, "BROUTING", 0, EBT_ACCEPT, 0};
-+
-+static struct ebt_replace initial_table =
-+{
-+  "broute", 1 << NF_BR_BROUTING, 0, sizeof(struct ebt_entries),
-+  { [NF_BR_BROUTING]&initial_chain}, 0, NULL, (char *)&initial_chain
-+};
-+
-+static int check(const struct ebt_table_info *info, unsigned int valid_hooks)
-+{
-+      if (valid_hooks & ~(1 << NF_BR_BROUTING))
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_table broute_table =
-+{
-+  {NULL, NULL}, "broute", &initial_table, 1 << NF_BR_BROUTING,
-+  RW_LOCK_UNLOCKED, check, NULL
-+};
-+
-+static int ebt_broute(struct sk_buff **pskb)
-+{
-+      int ret;
-+
-+      ret = ebt_do_table(NF_BR_BROUTING, pskb, (*pskb)->dev, NULL,
-+         &broute_table);
-+      if (ret == NF_DROP)
-+              return 1; // route it
-+      return 0; // bridge it
-+}
-+
-+static int __init init(void)
-+{
-+      int ret;
-+
-+      ret = ebt_register_table(&broute_table);
-+      if (ret < 0)
-+              return ret;
-+      br_write_lock_bh(BR_NETPROTO_LOCK);
-+      // see br_input.c
-+      br_should_route_hook = ebt_broute;
-+      br_write_unlock_bh(BR_NETPROTO_LOCK);
-+      return ret;
-+}
-+
-+static void __exit fini(void)
-+{
-+      br_write_lock_bh(BR_NETPROTO_LOCK);
-+      br_should_route_hook = NULL;
-+      br_write_unlock_bh(BR_NETPROTO_LOCK);
-+      ebt_unregister_table(&broute_table);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/netfilter/ebt_802_3.c   Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,74 @@
-+/*
-+ * 802_3
-+ *
-+ * Author:
-+ * Chris Vitale csv@bluetail.com
-+ *
-+ * May 2003
-+ * 
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_802_3.h>
-+#include <linux/module.h>
-+
-+static int ebt_filter_802_3(const struct sk_buff *skb, const struct net_device *in,
-+   const struct net_device *out, const void *data, unsigned int datalen)
-+{
-+      struct ebt_802_3_info *info = (struct ebt_802_3_info *)data;
-+      struct ebt_802_3_hdr *hdr = (struct ebt_802_3_hdr *)skb->mac.ethernet;
-+      uint16_t type = hdr->llc.ui.ctrl & IS_UI ? hdr->llc.ui.type : hdr->llc.ni.type;
-+
-+      if (info->bitmask & EBT_802_3_SAP) {
-+              if (FWINV(info->sap != hdr->llc.ui.ssap, EBT_802_3_SAP)) 
-+                              return EBT_NOMATCH;
-+              if (FWINV(info->sap != hdr->llc.ui.dsap, EBT_802_3_SAP))
-+                              return EBT_NOMATCH;
-+      }
-+
-+      if (info->bitmask & EBT_802_3_TYPE) {
-+              if (!(hdr->llc.ui.dsap == CHECK_TYPE && hdr->llc.ui.ssap == CHECK_TYPE))
-+                      return EBT_NOMATCH;
-+              if (FWINV(info->type != type, EBT_802_3_TYPE)) 
-+                      return EBT_NOMATCH;
-+      }
-+
-+      return EBT_MATCH;
-+}
-+
-+static struct ebt_match filter_802_3;
-+static int ebt_802_3_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_802_3_info *info = (struct ebt_802_3_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_802_3_info)))
-+              return -EINVAL;
-+      if (info->bitmask & ~EBT_802_3_MASK || info->invflags & ~EBT_802_3_MASK)
-+              return -EINVAL;
-+
-+      return 0;
-+}
-+
-+static struct ebt_match filter_802_3 =
-+{
-+      .name           = EBT_802_3_MATCH,
-+      .match          = ebt_filter_802_3,
-+      .check          = ebt_802_3_check,
-+      .me             = THIS_MODULE,
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_match(&filter_802_3);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&filter_802_3);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/netfilter/ebt_mark.c    Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,66 @@
-+/*
-+ *  ebt_mark
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  July, 2002
-+ *
-+ */
-+
-+// The mark target can be used in any chain
-+// I believe adding a mangle table just for marking is total overkill
-+// Marking a frame doesn't really change anything in the frame anyway
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_mark_t.h>
-+#include <linux/module.h>
-+
-+static int ebt_target_mark(struct sk_buff **pskb, unsigned int hooknr,
-+   const struct net_device *in, const struct net_device *out,
-+   const void *data, unsigned int datalen)
-+{
-+      struct ebt_mark_t_info *info = (struct ebt_mark_t_info *)data;
-+
-+      if ((*pskb)->nfmark != info->mark) {
-+              (*pskb)->nfmark = info->mark;
-+              (*pskb)->nfcache |= NFC_ALTERED;
-+      }
-+      return info->target;
-+}
-+
-+static int ebt_target_mark_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_mark_t_info *info = (struct ebt_mark_t_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_mark_t_info)))
-+              return -EINVAL;
-+      if (BASE_CHAIN && info->target == EBT_RETURN)
-+              return -EINVAL;
-+      CLEAR_BASE_CHAIN_BIT;
-+      if (INVALID_TARGET)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_target mark_target =
-+{
-+      {NULL, NULL}, EBT_MARK_TARGET, ebt_target_mark,
-+      ebt_target_mark_check, NULL, THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_target(&mark_target);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_target(&mark_target);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/netfilter/ebt_mark_m.c  Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,61 @@
-+/*
-+ *  ebt_mark_m
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  July, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_mark_m.h>
-+#include <linux/module.h>
-+
-+static int ebt_filter_mark(const struct sk_buff *skb,
-+   const struct net_device *in, const struct net_device *out, const void *data,
-+   unsigned int datalen)
-+{
-+      struct ebt_mark_m_info *info = (struct ebt_mark_m_info *) data;
-+
-+      if (info->bitmask & EBT_MARK_OR)
-+              return !(!!(skb->nfmark & info->mask) ^ info->invert);
-+      return !(((skb->nfmark & info->mask) == info->mark) ^ info->invert);
-+}
-+
-+static int ebt_mark_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+        struct ebt_mark_m_info *info = (struct ebt_mark_m_info *) data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_mark_m_info)))
-+              return -EINVAL;
-+      if (info->bitmask & ~EBT_MARK_MASK)
-+              return -EINVAL;
-+      if ((info->bitmask & EBT_MARK_OR) && (info->bitmask & EBT_MARK_AND))
-+              return -EINVAL;
-+      if (!info->bitmask)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_match filter_mark =
-+{
-+      {NULL, NULL}, EBT_MARK_MATCH, ebt_filter_mark, ebt_mark_check, NULL,
-+      THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_match(&filter_mark);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&filter_mark);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/netfilter/ebt_pkttype.c Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,60 @@
-+/*
-+ *  ebt_pkttype
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bdschuym@pandora.be>
-+ *
-+ *  April, 2003
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_pkttype.h>
-+#include <linux/module.h>
-+
-+static int ebt_filter_pkttype(const struct sk_buff *skb,
-+   const struct net_device *in,
-+   const struct net_device *out,
-+   const void *data,
-+   unsigned int datalen)
-+{
-+      struct ebt_pkttype_info *info = (struct ebt_pkttype_info *)data;
-+
-+      return (skb->pkt_type != info->pkt_type) ^ info->invert;
-+}
-+
-+static int ebt_pkttype_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_pkttype_info *info = (struct ebt_pkttype_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_pkttype_info)))
-+              return -EINVAL;
-+      if (info->invert != 0 && info->invert != 1)
-+              return -EINVAL;
-+      /* Allow any pkt_type value */
-+      return 0;
-+}
-+
-+static struct ebt_match filter_pkttype =
-+{
-+      .name           = EBT_PKTTYPE_MATCH,
-+      .match          = ebt_filter_pkttype,
-+      .check          = ebt_pkttype_check,
-+      .me             = THIS_MODULE,
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_match(&filter_pkttype);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&filter_pkttype);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/netfilter/ebt_stp.c     Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,191 @@
-+/*
-+ *  ebt_stp
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bdschuym@pandora.be>
-+ *    Stephen Hemminger <shemminger@osdl.org>
-+ *
-+ *  June, 2003
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_stp.h>
-+#include <linux/module.h>
-+
-+#define BPDU_TYPE_CONFIG 0
-+#define BPDU_TYPE_TCN 0x80
-+
-+struct stp_header {
-+      uint8_t dsap;
-+      uint8_t ssap;
-+      uint8_t ctrl;
-+      uint8_t pid;
-+      uint8_t vers;
-+      uint8_t type;
-+};
-+
-+struct stp_config_pdu {
-+      uint8_t flags;
-+      uint8_t root[8];
-+      uint8_t root_cost[4];
-+      uint8_t sender[8];
-+      uint8_t port[2];
-+      uint8_t msg_age[2];
-+      uint8_t max_age[2];
-+      uint8_t hello_time[2];
-+      uint8_t forward_delay[2];
-+};
-+
-+#define NR16(p) (p[0] << 8 | p[1])
-+#define NR32(p) ((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3])
-+
-+static int ebt_filter_config(struct ebt_stp_info *info,
-+   struct stp_config_pdu *stpc)
-+{
-+      struct ebt_stp_config_info *c;
-+      uint16_t v16;
-+      uint32_t v32;
-+      int verdict, i;
-+
-+      c = &info->config;
-+      if ((info->bitmask & EBT_STP_FLAGS) &&
-+          FWINV(c->flags != stpc->flags, EBT_STP_FLAGS))
-+              return EBT_NOMATCH;
-+      if (info->bitmask & EBT_STP_ROOTPRIO) {
-+              v16 = NR16(stpc->root);
-+              if (FWINV(v16 < c->root_priol ||
-+                  v16 > c->root_priou, EBT_STP_ROOTPRIO))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_ROOTADDR) {
-+              verdict = 0;
-+              for (i = 0; i < 6; i++)
-+                      verdict |= (stpc->root[2+i] ^ c->root_addr[i]) &
-+                                 c->root_addrmsk[i];
-+              if (FWINV(verdict != 0, EBT_STP_ROOTADDR))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_ROOTCOST) {
-+              v32 = NR32(stpc->root_cost);
-+              if (FWINV(v32 < c->root_costl ||
-+                  v32 > c->root_costu, EBT_STP_ROOTCOST))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_SENDERPRIO) {
-+              v16 = NR16(stpc->sender);
-+              if (FWINV(v16 < c->sender_priol ||
-+                  v16 > c->sender_priou, EBT_STP_SENDERPRIO))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_SENDERADDR) {
-+              verdict = 0;
-+              for (i = 0; i < 6; i++)
-+                      verdict |= (stpc->sender[2+i] ^ c->sender_addr[i]) &
-+                                 c->sender_addrmsk[i];
-+              if (FWINV(verdict != 0, EBT_STP_SENDERADDR))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_PORT) {
-+              v16 = NR16(stpc->port);
-+              if (FWINV(v16 < c->portl ||
-+                  v16 > c->portu, EBT_STP_PORT))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_MSGAGE) {
-+              v16 = NR16(stpc->msg_age);
-+              if (FWINV(v16 < c->msg_agel ||
-+                  v16 > c->msg_ageu, EBT_STP_MSGAGE))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_MAXAGE) {
-+              v16 = NR16(stpc->max_age);
-+              if (FWINV(v16 < c->max_agel ||
-+                  v16 > c->max_ageu, EBT_STP_MAXAGE))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_HELLOTIME) {
-+              v16 = NR16(stpc->hello_time);
-+              if (FWINV(v16 < c->hello_timel ||
-+                  v16 > c->hello_timeu, EBT_STP_HELLOTIME))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_FWDD) {
-+              v16 = NR16(stpc->forward_delay);
-+              if (FWINV(v16 < c->forward_delayl ||
-+                  v16 > c->forward_delayu, EBT_STP_FWDD))
-+                      return EBT_NOMATCH;
-+      }
-+      return EBT_MATCH;
-+}
-+
-+static int ebt_filter_stp(const struct sk_buff *skb, const struct net_device *in,
-+   const struct net_device *out, const void *data, unsigned int datalen)
-+{
-+      struct ebt_stp_info *info = (struct ebt_stp_info *)data;
-+      struct stp_header stph;
-+      uint8_t header[6] = {0x42, 0x42, 0x03, 0x00, 0x00, 0x00};
-+      if (skb_copy_bits(skb, 0, &stph, sizeof(stph)))
-+              return EBT_NOMATCH;
-+
-+      /* The stp code only considers these */
-+      if (memcmp(&stph, header, sizeof(header)))
-+              return EBT_NOMATCH;
-+
-+      if (info->bitmask & EBT_STP_TYPE
-+          && FWINV(info->type != stph.type, EBT_STP_TYPE))
-+              return EBT_NOMATCH;
-+
-+      if (stph.type == BPDU_TYPE_CONFIG &&
-+          info->bitmask & EBT_STP_CONFIG_MASK) {
-+              struct stp_config_pdu stpc;
-+
-+              if (skb_copy_bits(skb, sizeof(stph), &stpc, sizeof(stpc)))
-+                  return EBT_NOMATCH;
-+              return ebt_filter_config(info, &stpc);
-+      }
-+      return EBT_MATCH;
-+}
-+
-+static int ebt_stp_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_stp_info *info = (struct ebt_stp_info *)data;
-+      int len = EBT_ALIGN(sizeof(struct ebt_stp_info));
-+      uint8_t bridge_ula[6] = { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 };
-+      uint8_t msk[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
-+
-+      if (info->bitmask & ~EBT_STP_MASK || info->invflags & ~EBT_STP_MASK ||
-+          !(info->bitmask & EBT_STP_MASK))
-+              return -EINVAL;
-+      if (datalen != len)
-+              return -EINVAL;
-+      /* Make sure the match only receives stp frames */
-+      if (memcmp(e->destmac, bridge_ula, ETH_ALEN) ||
-+          memcmp(e->destmsk, msk, ETH_ALEN) || !(e->bitmask & EBT_DESTMAC))
-+              return -EINVAL;
-+
-+      return 0;
-+}
-+
-+static struct ebt_match filter_stp =
-+{
-+      .name           = EBT_STP_MATCH,
-+      .match          = ebt_filter_stp,
-+      .check          = ebt_stp_check,
-+      .me             = THIS_MODULE,
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_match(&filter_stp);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&filter_stp);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/netfilter/ebt_redirect.c        Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,71 @@
-+/*
-+ *  ebt_redirect
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  April, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_redirect.h>
-+#include <linux/module.h>
-+#include <net/sock.h>
-+#include "../br_private.h"
-+
-+static int ebt_target_redirect(struct sk_buff **pskb, unsigned int hooknr,
-+   const struct net_device *in, const struct net_device *out,
-+   const void *data, unsigned int datalen)
-+{
-+      struct ebt_redirect_info *info = (struct ebt_redirect_info *)data;
-+
-+      if (hooknr != NF_BR_BROUTING)
-+              memcpy((**pskb).mac.ethernet->h_dest,
-+                 in->br_port->br->dev.dev_addr, ETH_ALEN);
-+      else {
-+              memcpy((**pskb).mac.ethernet->h_dest,
-+                 in->dev_addr, ETH_ALEN);
-+              (*pskb)->pkt_type = PACKET_HOST;
-+      }
-+      return info->target;
-+}
-+
-+static int ebt_target_redirect_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_redirect_info *info = (struct ebt_redirect_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_redirect_info)))
-+              return -EINVAL;
-+      if (BASE_CHAIN && info->target == EBT_RETURN)
-+              return -EINVAL;
-+      CLEAR_BASE_CHAIN_BIT;
-+      if ( (strcmp(tablename, "nat") || hookmask & ~(1 << NF_BR_PRE_ROUTING)) &&
-+           (strcmp(tablename, "broute") || hookmask & ~(1 << NF_BR_BROUTING)) )
-+              return -EINVAL;
-+      if (INVALID_TARGET)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_target redirect_target =
-+{
-+      {NULL, NULL}, EBT_REDIRECT_TARGET, ebt_target_redirect,
-+      ebt_target_redirect_check, NULL, THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_target(&redirect_target);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_target(&redirect_target);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/netfilter/ebt_arp.c     Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,149 @@
-+/*
-+ *  ebt_arp
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *    Tim Gardner <timg@tpi.com>
-+ *
-+ *  April, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_arp.h>
-+#include <linux/if_arp.h>
-+#include <linux/if_ether.h>
-+#include <linux/module.h>
-+
-+static int ebt_filter_arp(const struct sk_buff *skb, const struct net_device *in,
-+   const struct net_device *out, const void *data, unsigned int datalen)
-+{
-+      struct ebt_arp_info *info = (struct ebt_arp_info *)data;
-+
-+      if (info->bitmask & EBT_ARP_OPCODE && FWINV(info->opcode !=
-+         ((*skb).nh.arph)->ar_op, EBT_ARP_OPCODE))
-+              return EBT_NOMATCH;
-+      if (info->bitmask & EBT_ARP_HTYPE && FWINV(info->htype !=
-+         ((*skb).nh.arph)->ar_hrd, EBT_ARP_HTYPE))
-+              return EBT_NOMATCH;
-+      if (info->bitmask & EBT_ARP_PTYPE && FWINV(info->ptype !=
-+         ((*skb).nh.arph)->ar_pro, EBT_ARP_PTYPE))
-+              return EBT_NOMATCH;
-+
-+      if (info->bitmask & (EBT_ARP_SRC_IP | EBT_ARP_DST_IP))
-+      {
-+              uint32_t arp_len = sizeof(struct arphdr) +
-+                 (2 * (((*skb).nh.arph)->ar_hln)) +
-+                 (2 * (((*skb).nh.arph)->ar_pln));
-+              uint32_t dst;
-+              uint32_t src;
-+
-+              // Make sure the packet is long enough.
-+              if ((((*skb).nh.raw) + arp_len) > (*skb).tail)
-+                      return EBT_NOMATCH;
-+              // IPv4 addresses are always 4 bytes.
-+              if (((*skb).nh.arph)->ar_pln != sizeof(uint32_t))
-+                      return EBT_NOMATCH;
-+
-+              if (info->bitmask & EBT_ARP_SRC_IP) {
-+                      memcpy(&src, ((*skb).nh.raw) + sizeof(struct arphdr) +
-+                         ((*skb).nh.arph)->ar_hln, sizeof(uint32_t));
-+                      if (FWINV(info->saddr != (src & info->smsk),
-+                         EBT_ARP_SRC_IP))
-+                              return EBT_NOMATCH;
-+              }
-+
-+              if (info->bitmask & EBT_ARP_DST_IP) {
-+                      memcpy(&dst, ((*skb).nh.raw)+sizeof(struct arphdr) +
-+                         (2*(((*skb).nh.arph)->ar_hln)) +
-+                         (((*skb).nh.arph)->ar_pln), sizeof(uint32_t));
-+                      if (FWINV(info->daddr != (dst & info->dmsk),
-+                         EBT_ARP_DST_IP))
-+                              return EBT_NOMATCH;
-+              }
-+      }
-+
-+      if (info->bitmask & (EBT_ARP_SRC_MAC | EBT_ARP_DST_MAC))
-+      {
-+              uint32_t arp_len = sizeof(struct arphdr) +
-+                 (2 * (((*skb).nh.arph)->ar_hln)) +
-+                 (2 * (((*skb).nh.arph)->ar_pln));
-+              unsigned char dst[ETH_ALEN];
-+              unsigned char src[ETH_ALEN];
-+
-+              // Make sure the packet is long enough.
-+              if ((((*skb).nh.raw) + arp_len) > (*skb).tail)
-+                      return EBT_NOMATCH;
-+              // MAC addresses are 6 bytes.
-+              if (((*skb).nh.arph)->ar_hln != ETH_ALEN)
-+                      return EBT_NOMATCH;
-+              if (info->bitmask & EBT_ARP_SRC_MAC) {
-+                      uint8_t verdict, i;
-+
-+                      memcpy(&src, ((*skb).nh.raw) +
-+                                      sizeof(struct arphdr),
-+                                      ETH_ALEN);
-+                      verdict = 0;
-+                      for (i = 0; i < 6; i++)
-+                              verdict |= (src[i] ^ info->smaddr[i]) &
-+                                     info->smmsk[i];  
-+                      if (FWINV(verdict != 0, EBT_ARP_SRC_MAC))
-+                              return EBT_NOMATCH;
-+              }
-+
-+              if (info->bitmask & EBT_ARP_DST_MAC) { 
-+                      uint8_t verdict, i;
-+
-+                      memcpy(&dst, ((*skb).nh.raw) +
-+                                      sizeof(struct arphdr) +
-+                                      (((*skb).nh.arph)->ar_hln) +
-+                                      (((*skb).nh.arph)->ar_pln),
-+                                      ETH_ALEN);
-+                      verdict = 0;
-+                      for (i = 0; i < 6; i++)
-+                              verdict |= (dst[i] ^ info->dmaddr[i]) &
-+                                      info->dmmsk[i];
-+                      if (FWINV(verdict != 0, EBT_ARP_DST_MAC))
-+                              return EBT_NOMATCH;
-+              }
-+      }
-+
-+      return EBT_MATCH;
-+}
-+
-+static int ebt_arp_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_arp_info *info = (struct ebt_arp_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_arp_info)))
-+              return -EINVAL;
-+      if ((e->ethproto != __constant_htons(ETH_P_ARP) &&
-+         e->ethproto != __constant_htons(ETH_P_RARP)) ||
-+         e->invflags & EBT_IPROTO)
-+              return -EINVAL;
-+      if (info->bitmask & ~EBT_ARP_MASK || info->invflags & ~EBT_ARP_MASK)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_match filter_arp =
-+{
-+      {NULL, NULL}, EBT_ARP_MATCH, ebt_filter_arp, ebt_arp_check, NULL,
-+      THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_match(&filter_arp);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&filter_arp);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/netfilter/ebt_ip.c      Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,121 @@
-+/*
-+ *  ebt_ip
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  April, 2002
-+ *
-+ *  Changes:
-+ *    added ip-sport and ip-dport
-+ *    Innominate Security Technologies AG <mhopf@innominate.com>
-+ *    September, 2002
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_ip.h>
-+#include <linux/ip.h>
-+#include <linux/in.h>
-+#include <linux/module.h>
-+
-+struct tcpudphdr {
-+      uint16_t src;
-+      uint16_t dst;
-+};
-+
-+union h_u {
-+      unsigned char *raw;
-+      struct tcpudphdr *tuh;
-+};
-+
-+static int ebt_filter_ip(const struct sk_buff *skb, const struct net_device *in,
-+   const struct net_device *out, const void *data,
-+   unsigned int datalen)
-+{
-+      struct ebt_ip_info *info = (struct ebt_ip_info *)data;
-+
-+      if (info->bitmask & EBT_IP_TOS &&
-+         FWINV(info->tos != ((*skb).nh.iph)->tos, EBT_IP_TOS))
-+              return EBT_NOMATCH;
-+      if (info->bitmask & EBT_IP_PROTO) {
-+              if (FWINV(info->protocol != ((*skb).nh.iph)->protocol,
-+                        EBT_IP_PROTO))
-+                      return EBT_NOMATCH;
-+              if ( info->protocol == IPPROTO_TCP ||
-+                   info->protocol == IPPROTO_UDP )
-+              {
-+                      union h_u h;
-+                      h.raw = skb->data + skb->nh.iph->ihl*4;
-+                      if (info->bitmask & EBT_IP_DPORT) {
-+                              uint16_t port = ntohs(h.tuh->dst);
-+                              if (FWINV(port < info->dport[0] ||
-+                                        port > info->dport[1],
-+                                        EBT_IP_DPORT))
-+                              return EBT_NOMATCH;
-+                      }
-+                      if (info->bitmask & EBT_IP_SPORT) {
-+                              uint16_t port = ntohs(h.tuh->src);
-+                              if (FWINV(port < info->sport[0] ||
-+                                        port > info->sport[1],
-+                                        EBT_IP_SPORT))
-+                              return EBT_NOMATCH;
-+                      }
-+              }
-+      }
-+      if (info->bitmask & EBT_IP_SOURCE &&
-+         FWINV((((*skb).nh.iph)->saddr & info->smsk) !=
-+         info->saddr, EBT_IP_SOURCE))
-+              return EBT_NOMATCH;
-+      if ((info->bitmask & EBT_IP_DEST) &&
-+         FWINV((((*skb).nh.iph)->daddr & info->dmsk) !=
-+         info->daddr, EBT_IP_DEST))
-+              return EBT_NOMATCH;
-+      return EBT_MATCH;
-+}
-+
-+static int ebt_ip_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_ip_info *info = (struct ebt_ip_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_ip_info)))
-+              return -EINVAL;
-+      if (e->ethproto != __constant_htons(ETH_P_IP) ||
-+         e->invflags & EBT_IPROTO)
-+              return -EINVAL;
-+      if (info->bitmask & ~EBT_IP_MASK || info->invflags & ~EBT_IP_MASK)
-+              return -EINVAL;
-+      if (info->bitmask & (EBT_IP_DPORT | EBT_IP_SPORT)) {
-+              if (!info->bitmask & EBT_IPROTO)
-+                      return -EINVAL;
-+              if (info->protocol != IPPROTO_TCP &&
-+                  info->protocol != IPPROTO_UDP)
-+                       return -EINVAL;
-+      }
-+      if (info->bitmask & EBT_IP_DPORT && info->dport[0] > info->dport[1])
-+              return -EINVAL;
-+      if (info->bitmask & EBT_IP_SPORT && info->sport[0] > info->sport[1])
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_match filter_ip =
-+{
-+      {NULL, NULL}, EBT_IP_MATCH, ebt_filter_ip, ebt_ip_check, NULL,
-+      THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_match(&filter_ip);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&filter_ip);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/netfilter/ebt_vlan.c    Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,259 @@
-+/*
-+ * Description: EBTables 802.1Q match extension kernelspace module.
-+ * Authors: Nick Fedchik <nick@fedchik.org.ua>
-+ *          Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *    
-+ * 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, or
-+ * (at your option) any later version.
-+ * 
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *  
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-+ */
-+
-+#include <linux/if_ether.h>
-+#include <linux/if_vlan.h>
-+#include <linux/module.h>
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_vlan.h>
-+
-+static unsigned char debug;
-+#define MODULE_VERSION "0.6"
-+
-+MODULE_PARM(debug, "0-1b");
-+MODULE_PARM_DESC(debug, "debug=1 is turn on debug messages");
-+MODULE_AUTHOR("Nick Fedchik <nick@fedchik.org.ua>");
-+MODULE_DESCRIPTION("802.1Q match module (ebtables extension), v"
-+                 MODULE_VERSION);
-+MODULE_LICENSE("GPL");
-+
-+
-+#define DEBUG_MSG(args...) if (debug) printk (KERN_DEBUG "ebt_vlan: " args)
-+#define INV_FLAG(_inv_flag_) (info->invflags & _inv_flag_) ? "!" : ""
-+#define GET_BITMASK(_BIT_MASK_) info->bitmask & _BIT_MASK_
-+#define SET_BITMASK(_BIT_MASK_) info->bitmask |= _BIT_MASK_
-+#define EXIT_ON_MISMATCH(_MATCH_,_MASK_) if (!((info->_MATCH_ == _MATCH_)^!!(info->invflags & _MASK_))) return 1;
-+
-+/*
-+ * Function description: ebt_filter_vlan() is main engine for 
-+ * checking passed 802.1Q frame according to 
-+ * the passed extension parameters (in the *data buffer)
-+ * ebt_filter_vlan() is called after successfull check the rule params
-+ * by ebt_check_vlan() function.
-+ * Parameters:
-+ * const struct sk_buff *skb - pointer to passed ethernet frame buffer
-+ * const void *data - pointer to passed extension parameters
-+ * unsigned int datalen - length of passed *data buffer
-+ * const struct net_device *in  -
-+ * const struct net_device *out -
-+ * const struct ebt_counter *c -
-+ * Returned values:
-+ * 0 - ok (all rule params matched)
-+ * 1 - miss (rule params not acceptable to the parsed frame)
-+ */
-+static int
-+ebt_filter_vlan(const struct sk_buff *skb,
-+              const struct net_device *in,
-+              const struct net_device *out,
-+              const void *data, unsigned int datalen)
-+{
-+      struct ebt_vlan_info *info = (struct ebt_vlan_info *) data;     /* userspace data */
-+      struct vlan_ethhdr *frame = (struct vlan_ethhdr *) skb->mac.raw;        /* Passed tagged frame */
-+
-+      unsigned short TCI;     /* Whole TCI, given from parsed frame */
-+      unsigned short id;      /* VLAN ID, given from frame TCI */
-+      unsigned char prio;     /* user_priority, given from frame TCI */
-+      unsigned short encap;   /* VLAN encapsulated Type/Length field, given from orig frame */
-+
-+      /*
-+       * Tag Control Information (TCI) consists of the following elements:
-+       * - User_priority. The user_priority field is three bits in length, 
-+       * interpreted as a binary number. 
-+       * - Canonical Format Indicator (CFI). The Canonical Format Indicator 
-+       * (CFI) is a single bit flag value. Currently ignored.
-+       * - VLAN Identifier (VID). The VID is encoded as 
-+       * an unsigned binary number. 
-+       */
-+      TCI = ntohs(frame->h_vlan_TCI);
-+      id = TCI & VLAN_VID_MASK;
-+      prio = (TCI >> 13) & 0x7;
-+      encap = frame->h_vlan_encapsulated_proto;
-+
-+      /*
-+       * Checking VLAN Identifier (VID)
-+       */
-+      if (GET_BITMASK(EBT_VLAN_ID)) { /* Is VLAN ID parsed? */
-+              EXIT_ON_MISMATCH(id, EBT_VLAN_ID);
-+      }
-+      /*
-+       * Checking user_priority
-+       */
-+      if (GET_BITMASK(EBT_VLAN_PRIO)) {       /* Is VLAN user_priority parsed? */
-+              EXIT_ON_MISMATCH(prio, EBT_VLAN_PRIO);
-+      }
-+      /*
-+       * Checking Encapsulated Proto (Length/Type) field
-+       */
-+      if (GET_BITMASK(EBT_VLAN_ENCAP)) {      /* Is VLAN Encap parsed? */
-+              EXIT_ON_MISMATCH(encap, EBT_VLAN_ENCAP);
-+      }
-+      /*
-+       * All possible extension parameters was parsed.
-+       * If rule never returned by missmatch, then all ok.
-+       */
-+      return 0;
-+}
-+
-+/*
-+ * Function description: ebt_vlan_check() is called when userspace 
-+ * delivers the table entry to the kernel, 
-+ * and to check that userspace doesn't give a bad table.
-+ * Parameters:
-+ * const char *tablename - table name string
-+ * unsigned int hooknr - hook number
-+ * const struct ebt_entry *e - ebtables entry basic set
-+ * const void *data - pointer to passed extension parameters
-+ * unsigned int datalen - length of passed *data buffer
-+ * Returned values:
-+ * 0 - ok (all delivered rule params are correct)
-+ * 1 - miss (rule params is out of range, invalid, incompatible, etc.)
-+ */
-+static int
-+ebt_check_vlan(const char *tablename,
-+             unsigned int hooknr,
-+             const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_vlan_info *info = (struct ebt_vlan_info *) data;
-+
-+      /*
-+       * Parameters buffer overflow check 
-+       */
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_vlan_info))) {
-+              DEBUG_MSG
-+                  ("passed size %d is not eq to ebt_vlan_info (%d)\n",
-+                   datalen, sizeof(struct ebt_vlan_info));
-+              return -EINVAL;
-+      }
-+
-+      /*
-+       * Is it 802.1Q frame checked?
-+       */
-+      if (e->ethproto != __constant_htons(ETH_P_8021Q)) {
-+              DEBUG_MSG
-+                  ("passed entry proto %2.4X is not 802.1Q (8100)\n",
-+                   (unsigned short) ntohs(e->ethproto));
-+              return -EINVAL;
-+      }
-+
-+      /*
-+       * Check for bitmask range 
-+       * True if even one bit is out of mask
-+       */
-+      if (info->bitmask & ~EBT_VLAN_MASK) {
-+              DEBUG_MSG("bitmask %2X is out of mask (%2X)\n",
-+                        info->bitmask, EBT_VLAN_MASK);
-+              return -EINVAL;
-+      }
-+
-+      /*
-+       * Check for inversion flags range 
-+       */
-+      if (info->invflags & ~EBT_VLAN_MASK) {
-+              DEBUG_MSG("inversion flags %2X is out of mask (%2X)\n",
-+                        info->invflags, EBT_VLAN_MASK);
-+              return -EINVAL;
-+      }
-+
-+      /*
-+       * Reserved VLAN ID (VID) values
-+       * -----------------------------
-+       * 0 - The null VLAN ID. 
-+       * 1 - The default Port VID (PVID)
-+       * 0x0FFF - Reserved for implementation use. 
-+       * if_vlan.h: VLAN_GROUP_ARRAY_LEN 4096.
-+       */
-+      if (GET_BITMASK(EBT_VLAN_ID)) { /* when vlan-id param was spec-ed */
-+              if (!!info->id) {       /* if id!=0 => check vid range */
-+                      if (info->id > VLAN_GROUP_ARRAY_LEN) {
-+                              DEBUG_MSG
-+                                  ("id %d is out of range (1-4096)\n",
-+                                   info->id);
-+                              return -EINVAL;
-+                      }
-+                      /*
-+                       * Note: This is valid VLAN-tagged frame point.
-+                       * Any value of user_priority are acceptable, 
-+                       * but should be ignored according to 802.1Q Std.
-+                       * So we just drop the prio flag. 
-+                       */
-+                      info->bitmask &= ~EBT_VLAN_PRIO;
-+              }
-+              /*
-+               * Else, id=0 (null VLAN ID)  => user_priority range (any?)
-+               */
-+      }
-+
-+      if (GET_BITMASK(EBT_VLAN_PRIO)) {
-+              if ((unsigned char) info->prio > 7) {
-+                      DEBUG_MSG
-+                          ("prio %d is out of range (0-7)\n",
-+                           info->prio);
-+                      return -EINVAL;
-+              }
-+      }
-+      /*
-+       * Check for encapsulated proto range - it is possible to be 
-+       * any value for u_short range.
-+       * if_ether.h:  ETH_ZLEN        60   -  Min. octets in frame sans FCS
-+       */
-+      if (GET_BITMASK(EBT_VLAN_ENCAP)) {
-+              if ((unsigned short) ntohs(info->encap) < ETH_ZLEN) {
-+                      DEBUG_MSG
-+                          ("encap frame length %d is less than minimal\n",
-+                           ntohs(info->encap));
-+                      return -EINVAL;
-+              }
-+      }
-+
-+      return 0;
-+}
-+
-+static struct ebt_match filter_vlan = {
-+      {NULL, NULL},
-+      EBT_VLAN_MATCH,
-+      ebt_filter_vlan,
-+      ebt_check_vlan,
-+      NULL,
-+      THIS_MODULE
-+};
-+
-+/*
-+ * Module initialization function.
-+ */
-+static int __init init(void)
-+{
-+      DEBUG_MSG("ebtables 802.1Q extension module v"
-+                MODULE_VERSION "\n");
-+      DEBUG_MSG("module debug=%d\n", !!debug);
-+      return ebt_register_match(&filter_vlan);
-+}
-+
-+/*
-+ * Module "finalization" function
-+ */
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&filter_vlan);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+
-+EXPORT_NO_SYMBOLS;
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/netfilter/ebt_log.c     Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,152 @@
-+/*
-+ *  ebt_log
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  April, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_log.h>
-+#include <linux/module.h>
-+#include <linux/ip.h>
-+#include <linux/in.h>
-+#include <linux/if_arp.h>
-+#include <linux/spinlock.h>
-+
-+static spinlock_t ebt_log_lock = SPIN_LOCK_UNLOCKED;
-+
-+static int ebt_log_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_log_info *info = (struct ebt_log_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_log_info)))
-+              return -EINVAL;
-+      if (info->bitmask & ~EBT_LOG_MASK)
-+              return -EINVAL;
-+      if (info->loglevel >= 8)
-+              return -EINVAL;
-+      info->prefix[EBT_LOG_PREFIX_SIZE - 1] = '\0';
-+      return 0;
-+}
-+
-+struct tcpudphdr
-+{
-+      uint16_t src;
-+      uint16_t dst;
-+};
-+
-+struct arppayload
-+{
-+      unsigned char mac_src[ETH_ALEN];
-+      unsigned char ip_src[4];
-+      unsigned char mac_dst[ETH_ALEN];
-+      unsigned char ip_dst[4];
-+};
-+
-+static void print_MAC(unsigned char *p)
-+{
-+      int i;
-+
-+      for (i = 0; i < ETH_ALEN; i++, p++)
-+              printk("%02x%c", *p, i == ETH_ALEN - 1 ? ' ':':');
-+}
-+
-+#define myNIPQUAD(a) a[0], a[1], a[2], a[3]
-+static void ebt_log(const struct sk_buff *skb, const struct net_device *in,
-+   const struct net_device *out, const void *data, unsigned int datalen)
-+{
-+      struct ebt_log_info *info = (struct ebt_log_info *)data;
-+      char level_string[4] = "< >";
-+      level_string[1] = '0' + info->loglevel;
-+
-+      spin_lock_bh(&ebt_log_lock);
-+      printk(level_string);
-+      printk("%s IN=%s OUT=%s ", info->prefix, in ? in->name : "",
-+         out ? out->name : "");
-+
-+      printk("MAC source = ");
-+      print_MAC((skb->mac.ethernet)->h_source);
-+      printk("MAC dest = ");
-+      print_MAC((skb->mac.ethernet)->h_dest);
-+
-+      printk("proto = 0x%04x", ntohs(((*skb).mac.ethernet)->h_proto));
-+
-+      if ((info->bitmask & EBT_LOG_IP) && skb->mac.ethernet->h_proto ==
-+         htons(ETH_P_IP)){
-+              struct iphdr *iph = skb->nh.iph;
-+              printk(" IP SRC=%u.%u.%u.%u IP DST=%u.%u.%u.%u,",
-+                 NIPQUAD(iph->saddr), NIPQUAD(iph->daddr));
-+              printk(" IP tos=0x%02X, IP proto=%d", iph->tos, iph->protocol);
-+              if (iph->protocol == IPPROTO_TCP ||
-+                  iph->protocol == IPPROTO_UDP) {
-+                      struct tcpudphdr *ports = (struct tcpudphdr *)(skb->data + iph->ihl*4);
-+
-+                      if (skb->data + iph->ihl*4 > skb->tail) {
-+                              printk(" INCOMPLETE TCP/UDP header");
-+                              goto out;
-+                      }
-+                      printk(" SPT=%u DPT=%u", ntohs(ports->src),
-+                         ntohs(ports->dst));
-+              }
-+              goto out;
-+      }
-+
-+      if ((info->bitmask & EBT_LOG_ARP) &&
-+          ((skb->mac.ethernet->h_proto == __constant_htons(ETH_P_ARP)) ||
-+          (skb->mac.ethernet->h_proto == __constant_htons(ETH_P_RARP)))) {
-+              struct arphdr * arph = skb->nh.arph;
-+              printk(" ARP HTYPE=%d, PTYPE=0x%04x, OPCODE=%d",
-+                 ntohs(arph->ar_hrd), ntohs(arph->ar_pro),
-+                 ntohs(arph->ar_op));
-+              /* If it's for Ethernet and the lengths are OK,
-+               * then log the ARP payload */
-+              if (arph->ar_hrd == __constant_htons(1) &&
-+                  arph->ar_hln == ETH_ALEN &&
-+                  arph->ar_pln == sizeof(uint32_t)) {
-+                      struct arppayload *arpp = (struct arppayload *)(skb->data + sizeof(*arph));
-+
-+                      if (skb->data + sizeof(*arph) > skb->tail) {
-+                              printk(" INCOMPLETE ARP header");
-+                              goto out;
-+                      }
-+
-+                      printk(" ARP MAC SRC=");
-+                      print_MAC(arpp->mac_src);
-+                      printk(" ARP IP SRC=%u.%u.%u.%u",
-+                             myNIPQUAD(arpp->ip_src));
-+                      printk(" ARP MAC DST=");
-+                      print_MAC(arpp->mac_dst);
-+                      printk(" ARP IP DST=%u.%u.%u.%u",
-+                             myNIPQUAD(arpp->ip_dst));
-+              }
-+
-+      }
-+out:
-+      printk("\n");
-+      spin_unlock_bh(&ebt_log_lock);
-+}
-+
-+static struct ebt_watcher log =
-+{
-+      {NULL, NULL}, EBT_LOG_WATCHER, ebt_log, ebt_log_check, NULL,
-+      THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_watcher(&log);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_watcher(&log);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/netfilter/ebt_snat.c    Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,64 @@
-+/*
-+ *  ebt_snat
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  June, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_nat.h>
-+#include <linux/module.h>
-+
-+static int ebt_target_snat(struct sk_buff **pskb, unsigned int hooknr,
-+   const struct net_device *in, const struct net_device *out,
-+   const void *data, unsigned int datalen)
-+{
-+      struct ebt_nat_info *info = (struct ebt_nat_info *) data;
-+
-+      memcpy(((**pskb).mac.ethernet)->h_source, info->mac,
-+         ETH_ALEN * sizeof(unsigned char));
-+      return info->target;
-+}
-+
-+static int ebt_target_snat_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_nat_info *info = (struct ebt_nat_info *) data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_nat_info)))
-+              return -EINVAL;
-+      if (BASE_CHAIN && info->target == EBT_RETURN)
-+              return -EINVAL;
-+      CLEAR_BASE_CHAIN_BIT;
-+      if (strcmp(tablename, "nat"))
-+              return -EINVAL;
-+      if (hookmask & ~(1 << NF_BR_POST_ROUTING))
-+              return -EINVAL;
-+      if (INVALID_TARGET)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_target snat =
-+{
-+      {NULL, NULL}, EBT_SNAT_TARGET, ebt_target_snat, ebt_target_snat_check,
-+      NULL, THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_target(&snat);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_target(&snat);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/netfilter/ebt_dnat.c    Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,65 @@
-+/*
-+ *  ebt_dnat
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  June, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_nat.h>
-+#include <linux/module.h>
-+#include <net/sock.h>
-+
-+static int ebt_target_dnat(struct sk_buff **pskb, unsigned int hooknr,
-+   const struct net_device *in, const struct net_device *out,
-+   const void *data, unsigned int datalen)
-+{
-+      struct ebt_nat_info *info = (struct ebt_nat_info *)data;
-+
-+      memcpy(((**pskb).mac.ethernet)->h_dest, info->mac,
-+         ETH_ALEN * sizeof(unsigned char));
-+      return info->target;
-+}
-+
-+static int ebt_target_dnat_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_nat_info *info = (struct ebt_nat_info *)data;
-+
-+      if (BASE_CHAIN && info->target == EBT_RETURN)
-+              return -EINVAL;
-+      CLEAR_BASE_CHAIN_BIT;
-+      if ( (strcmp(tablename, "nat") ||
-+         (hookmask & ~((1 << NF_BR_PRE_ROUTING) | (1 << NF_BR_LOCAL_OUT)))) &&
-+         (strcmp(tablename, "broute") || hookmask & ~(1 << NF_BR_BROUTING)) )
-+              return -EINVAL;
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_nat_info)))
-+              return -EINVAL;
-+      if (INVALID_TARGET)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_target dnat =
-+{
-+      {NULL, NULL}, EBT_DNAT_TARGET, ebt_target_dnat, ebt_target_dnat_check,
-+      NULL, THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_target(&dnat);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_target(&dnat);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/netfilter/ebtables.c    Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,1490 @@
-+/*
-+ *  ebtables
-+ *
-+ *  Author:
-+ *  Bart De Schuymer          <bart.de.schuymer@pandora.be>
-+ *
-+ *  ebtables.c,v 2.0, July, 2002
-+ *
-+ *  This code is stongly inspired on the iptables code which is
-+ *  Copyright (C) 1999 Paul `Rusty' Russell & Michael J. Neuling
-+ *
-+ *  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, or (at your option) any later version.
-+ */
-+
-+// used for print_string
-+#include <linux/sched.h>
-+#include <linux/tty.h>
-+
-+#include <linux/kmod.h>
-+#include <linux/module.h>
-+#include <linux/vmalloc.h>
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/spinlock.h>
-+#include <asm/uaccess.h>
-+#include <linux/smp.h>
-+#include <net/sock.h>
-+// needed for logical [in,out]-dev filtering
-+#include "../br_private.h"
-+
-+// list_named_find
-+#define ASSERT_READ_LOCK(x)
-+#define ASSERT_WRITE_LOCK(x)
-+#include <linux/netfilter_ipv4/listhelp.h>
-+
-+#if 0 // use this for remote debugging
-+// Copyright (C) 1998 by Ori Pomerantz
-+// Print the string to the appropriate tty, the one
-+// the current task uses
-+static void print_string(char *str)
-+{
-+      struct tty_struct *my_tty;
-+
-+      /* The tty for the current task */
-+      my_tty = current->tty;
-+      if (my_tty != NULL) {
-+              (*(my_tty->driver).write)(my_tty, 0, str, strlen(str));
-+              (*(my_tty->driver).write)(my_tty, 0, "\015\012", 2);
-+      }
-+}
-+
-+#define BUGPRINT(args) print_string(args);
-+#else
-+#define BUGPRINT(format, args...) printk("kernel msg: ebtables bug: please "\
-+                                         "report to author: "format, ## args)
-+// #define BUGPRINT(format, args...)
-+#endif
-+#define MEMPRINT(format, args...) printk("kernel msg: ebtables "\
-+                                         ": out of memory: "format, ## args)
-+// #define MEMPRINT(format, args...)
-+
-+
-+
-+// Each cpu has its own set of counters, so there is no need for write_lock in
-+// the softirq
-+// For reading or updating the counters, the user context needs to
-+// get a write_lock
-+
-+// The size of each set of counters is altered to get cache alignment
-+#define SMP_ALIGN(x) (((x) + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1))
-+#define COUNTER_OFFSET(n) (SMP_ALIGN(n * sizeof(struct ebt_counter)))
-+#define COUNTER_BASE(c, n, cpu) ((struct ebt_counter *)(((char *)c) + \
-+   COUNTER_OFFSET(n) * cpu))
-+
-+
-+
-+static DECLARE_MUTEX(ebt_mutex);
-+static LIST_HEAD(ebt_tables);
-+static LIST_HEAD(ebt_targets);
-+static LIST_HEAD(ebt_matches);
-+static LIST_HEAD(ebt_watchers);
-+
-+static struct ebt_target ebt_standard_target =
-+{ {NULL, NULL}, EBT_STANDARD_TARGET, NULL, NULL, NULL, NULL};
-+
-+static inline int ebt_do_watcher (struct ebt_entry_watcher *w,
-+   const struct sk_buff *skb, const struct net_device *in,
-+   const struct net_device *out)
-+{
-+      w->u.watcher->watcher(skb, in, out, w->data,
-+         w->watcher_size);
-+      // watchers don't give a verdict
-+      return 0;
-+}
-+
-+static inline int ebt_do_match (struct ebt_entry_match *m,
-+   const struct sk_buff *skb, const struct net_device *in,
-+   const struct net_device *out)
-+{
-+      return m->u.match->match(skb, in, out, m->data,
-+         m->match_size);
-+}
-+
-+static inline int ebt_dev_check(char *entry, const struct net_device *device)
-+{
-+      if (*entry == '\0')
-+              return 0;
-+      if (!device)
-+              return 1;
-+      return !!strcmp(entry, device->name);
-+}
-+
-+#define FWINV2(bool,invflg) ((bool) ^ !!(e->invflags & invflg))
-+// process standard matches
-+static inline int ebt_basic_match(struct ebt_entry *e, struct ethhdr *h,
-+   const struct net_device *in, const struct net_device *out)
-+{
-+      int verdict, i;
-+
-+      if (e->bitmask & EBT_802_3) {
-+              if (FWINV2(ntohs(h->h_proto) >= 1536, EBT_IPROTO))
-+                      return 1;
-+      } else if (!(e->bitmask & EBT_NOPROTO) &&
-+         FWINV2(e->ethproto != h->h_proto, EBT_IPROTO))
-+              return 1;
-+
-+      if (FWINV2(ebt_dev_check(e->in, in), EBT_IIN))
-+              return 1;
-+      if (FWINV2(ebt_dev_check(e->out, out), EBT_IOUT))
-+              return 1;
-+      if ((!in || !in->br_port) ? 0 : FWINV2(ebt_dev_check(
-+         e->logical_in, &in->br_port->br->dev), EBT_ILOGICALIN))
-+              return 1;
-+      if ((!out || !out->br_port) ? 0 : FWINV2(ebt_dev_check(
-+         e->logical_out, &out->br_port->br->dev), EBT_ILOGICALOUT))
-+              return 1;
-+
-+      if (e->bitmask & EBT_SOURCEMAC) {
-+              verdict = 0;
-+              for (i = 0; i < 6; i++)
-+                      verdict |= (h->h_source[i] ^ e->sourcemac[i]) &
-+                         e->sourcemsk[i];
-+              if (FWINV2(verdict != 0, EBT_ISOURCE) )
-+                      return 1;
-+      }
-+      if (e->bitmask & EBT_DESTMAC) {
-+              verdict = 0;
-+              for (i = 0; i < 6; i++)
-+                      verdict |= (h->h_dest[i] ^ e->destmac[i]) &
-+                         e->destmsk[i];
-+              if (FWINV2(verdict != 0, EBT_IDEST) )
-+                      return 1;
-+      }
-+      return 0;
-+}
-+
-+// Do some firewalling
-+unsigned int ebt_do_table (unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   struct ebt_table *table)
-+{
-+      int i, nentries;
-+      struct ebt_entry *point;
-+      struct ebt_counter *counter_base, *cb_base;
-+      struct ebt_entry_target *t;
-+      int verdict, sp = 0;
-+      struct ebt_chainstack *cs;
-+      struct ebt_entries *chaininfo;
-+      char *base;
-+      struct ebt_table_info *private = table->private;
-+
-+      read_lock_bh(&table->lock);
-+      cb_base = COUNTER_BASE(private->counters, private->nentries,
-+         cpu_number_map(smp_processor_id()));
-+      if (private->chainstack)
-+              cs = private->chainstack[cpu_number_map(smp_processor_id())];
-+      else
-+              cs = NULL;
-+      chaininfo = private->hook_entry[hook];
-+      nentries = private->hook_entry[hook]->nentries;
-+      point = (struct ebt_entry *)(private->hook_entry[hook]->data);
-+      counter_base = cb_base + private->hook_entry[hook]->counter_offset;
-+      // base for chain jumps
-+      base = private->entries;
-+      i = 0;
-+      while (i < nentries) {
-+              if (ebt_basic_match(point, (**pskb).mac.ethernet, in, out))
-+                      goto letscontinue;
-+
-+              if (EBT_MATCH_ITERATE(point, ebt_do_match, *pskb, in, out) != 0)
-+                      goto letscontinue;
-+
-+              // increase counter
-+              (*(counter_base + i)).pcnt++;
-+              (*(counter_base + i)).bcnt+=(**pskb).len;
-+
-+              // these should only watch: not modify, nor tell us
-+              // what to do with the packet
-+              EBT_WATCHER_ITERATE(point, ebt_do_watcher, *pskb, in,
-+                 out);
-+
-+              t = (struct ebt_entry_target *)
-+                 (((char *)point) + point->target_offset);
-+              // standard target
-+              if (!t->u.target->target)
-+                      verdict = ((struct ebt_standard_target *)t)->verdict;
-+              else
-+                      verdict = t->u.target->target(pskb, hook,
-+                         in, out, t->data, t->target_size);
-+              if (verdict == EBT_ACCEPT) {
-+                      read_unlock_bh(&table->lock);
-+                      return NF_ACCEPT;
-+              }
-+              if (verdict == EBT_DROP) {
-+                      read_unlock_bh(&table->lock);
-+                      return NF_DROP;
-+              }
-+              if (verdict == EBT_RETURN) {
-+letsreturn:
-+#ifdef CONFIG_NETFILTER_DEBUG
-+                      if (sp == 0) {
-+                              BUGPRINT("RETURN on base chain");
-+                              // act like this is EBT_CONTINUE
-+                              goto letscontinue;
-+                      }
-+#endif
-+                      sp--;
-+                      // put all the local variables right
-+                      i = cs[sp].n;
-+                      chaininfo = cs[sp].chaininfo;
-+                      nentries = chaininfo->nentries;
-+                      point = cs[sp].e;
-+                      counter_base = cb_base +
-+                         chaininfo->counter_offset;
-+                      continue;
-+              }
-+              if (verdict == EBT_CONTINUE)
-+                      goto letscontinue;
-+#ifdef CONFIG_NETFILTER_DEBUG
-+              if (verdict < 0) {
-+                      BUGPRINT("bogus standard verdict\n");
-+                      read_unlock_bh(&table->lock);
-+                      return NF_DROP;
-+              }
-+#endif
-+              // jump to a udc
-+              cs[sp].n = i + 1;
-+              cs[sp].chaininfo = chaininfo;
-+              cs[sp].e = (struct ebt_entry *)
-+                 (((char *)point) + point->next_offset);
-+              i = 0;
-+              chaininfo = (struct ebt_entries *) (base + verdict);
-+#ifdef CONFIG_NETFILTER_DEBUG
-+              if (chaininfo->distinguisher) {
-+                      BUGPRINT("jump to non-chain\n");
-+                      read_unlock_bh(&table->lock);
-+                      return NF_DROP;
-+              }
-+#endif
-+              nentries = chaininfo->nentries;
-+              point = (struct ebt_entry *)chaininfo->data;
-+              counter_base = cb_base + chaininfo->counter_offset;
-+              sp++;
-+              continue;
-+letscontinue:
-+              point = (struct ebt_entry *)
-+                 (((char *)point) + point->next_offset);
-+              i++;
-+      }
-+
-+      // I actually like this :)
-+      if (chaininfo->policy == EBT_RETURN)
-+              goto letsreturn;
-+      if (chaininfo->policy == EBT_ACCEPT) {
-+              read_unlock_bh(&table->lock);
-+              return NF_ACCEPT;
-+      }
-+      read_unlock_bh(&table->lock);
-+      return NF_DROP;
-+}
-+
-+// If it succeeds, returns element and locks mutex
-+static inline void *
-+find_inlist_lock_noload(struct list_head *head, const char *name, int *error,
-+   struct semaphore *mutex)
-+{
-+      void *ret;
-+
-+      *error = down_interruptible(mutex);
-+      if (*error != 0)
-+              return NULL;
-+
-+      ret = list_named_find(head, name);
-+      if (!ret) {
-+              *error = -ENOENT;
-+              up(mutex);
-+      }
-+      return ret;
-+}
-+
-+#ifndef CONFIG_KMOD
-+#define find_inlist_lock(h,n,p,e,m) find_inlist_lock_noload((h),(n),(e),(m))
-+#else
-+static void *
-+find_inlist_lock(struct list_head *head, const char *name, const char *prefix,
-+   int *error, struct semaphore *mutex)
-+{
-+      void *ret;
-+
-+      ret = find_inlist_lock_noload(head, name, error, mutex);
-+      if (!ret) {
-+              char modulename[EBT_FUNCTION_MAXNAMELEN + strlen(prefix) + 1];
-+              strcpy(modulename, prefix);
-+              strcat(modulename, name);
-+              request_module(modulename);
-+              ret = find_inlist_lock_noload(head, name, error, mutex);
-+      }
-+      return ret;
-+}
-+#endif
-+
-+static inline struct ebt_table *
-+find_table_lock(const char *name, int *error, struct semaphore *mutex)
-+{
-+      return find_inlist_lock(&ebt_tables, name, "ebtable_", error, mutex);
-+}
-+
-+static inline struct ebt_match *
-+find_match_lock(const char *name, int *error, struct semaphore *mutex)
-+{
-+      return find_inlist_lock(&ebt_matches, name, "ebt_", error, mutex);
-+}
-+
-+static inline struct ebt_watcher *
-+find_watcher_lock(const char *name, int *error, struct semaphore *mutex)
-+{
-+      return find_inlist_lock(&ebt_watchers, name, "ebt_", error, mutex);
-+}
-+
-+static inline struct ebt_target *
-+find_target_lock(const char *name, int *error, struct semaphore *mutex)
-+{
-+      return find_inlist_lock(&ebt_targets, name, "ebt_", error, mutex);
-+}
-+
-+static inline int
-+ebt_check_match(struct ebt_entry_match *m, struct ebt_entry *e,
-+   const char *name, unsigned int hookmask, unsigned int *cnt)
-+{
-+      struct ebt_match *match;
-+      int ret;
-+
-+      if (((char *)m) + m->match_size + sizeof(struct ebt_entry_match) >
-+         ((char *)e) + e->watchers_offset)
-+              return -EINVAL;
-+      match = find_match_lock(m->u.name, &ret, &ebt_mutex);
-+      if (!match)
-+              return ret;
-+      m->u.match = match;
-+      if (match->me)
-+              __MOD_INC_USE_COUNT(match->me);
-+      up(&ebt_mutex);
-+      if (match->check &&
-+         match->check(name, hookmask, e, m->data, m->match_size) != 0) {
-+              BUGPRINT("match->check failed\n");
-+              if (match->me)
-+                      __MOD_DEC_USE_COUNT(match->me);
-+              return -EINVAL;
-+      }
-+      (*cnt)++;
-+      return 0;
-+}
-+
-+static inline int
-+ebt_check_watcher(struct ebt_entry_watcher *w, struct ebt_entry *e,
-+   const char *name, unsigned int hookmask, unsigned int *cnt)
-+{
-+      struct ebt_watcher *watcher;
-+      int ret;
-+
-+      if (((char *)w) + w->watcher_size + sizeof(struct ebt_entry_watcher) >
-+         ((char *)e) + e->target_offset)
-+              return -EINVAL;
-+      watcher = find_watcher_lock(w->u.name, &ret, &ebt_mutex);
-+      if (!watcher)
-+              return ret;
-+      w->u.watcher = watcher;
-+      if (watcher->me)
-+              __MOD_INC_USE_COUNT(watcher->me);
-+      up(&ebt_mutex);
-+      if (watcher->check &&
-+         watcher->check(name, hookmask, e, w->data, w->watcher_size) != 0) {
-+              BUGPRINT("watcher->check failed\n");
-+              if (watcher->me)
-+                      __MOD_DEC_USE_COUNT(watcher->me);
-+              return -EINVAL;
-+      }
-+      (*cnt)++;
-+      return 0;
-+}
-+
-+// this one is very careful, as it is the first function
-+// to parse the userspace data
-+static inline int
-+ebt_check_entry_size_and_hooks(struct ebt_entry *e,
-+   struct ebt_table_info *newinfo, char *base, char *limit,
-+   struct ebt_entries **hook_entries, unsigned int *n, unsigned int *cnt,
-+   unsigned int *totalcnt, unsigned int *udc_cnt, unsigned int valid_hooks)
-+{
-+      int i;
-+
-+      for (i = 0; i < NF_BR_NUMHOOKS; i++) {
-+              if ((valid_hooks & (1 << i)) == 0)
-+                      continue;
-+              if ( (char *)hook_entries[i] - base ==
-+                 (char *)e - newinfo->entries)
-+                      break;
-+      }
-+      // beginning of a new chain
-+      // if i == NF_BR_NUMHOOKS it must be a user defined chain
-+      if (i != NF_BR_NUMHOOKS || !(e->bitmask & EBT_ENTRY_OR_ENTRIES)) {
-+              if ((e->bitmask & EBT_ENTRY_OR_ENTRIES) != 0) {
-+                      // we make userspace set this right,
-+                      // so there is no misunderstanding
-+                      BUGPRINT("EBT_ENTRY_OR_ENTRIES shouldn't be set "
-+                               "in distinguisher\n");
-+                      return -EINVAL;
-+              }
-+              // this checks if the previous chain has as many entries
-+              // as it said it has
-+              if (*n != *cnt) {
-+                      BUGPRINT("nentries does not equal the nr of entries "
-+                               "in the chain\n");
-+                      return -EINVAL;
-+              }
-+              // before we look at the struct, be sure it is not too big
-+              if ((char *)hook_entries[i] + sizeof(struct ebt_entries)
-+                 > limit) {
-+                      BUGPRINT("entries_size too small\n");
-+                      return -EINVAL;
-+              }
-+              if (((struct ebt_entries *)e)->policy != EBT_DROP &&
-+                 ((struct ebt_entries *)e)->policy != EBT_ACCEPT) {
-+                      // only RETURN from udc
-+                      if (i != NF_BR_NUMHOOKS ||
-+                         ((struct ebt_entries *)e)->policy != EBT_RETURN) {
-+                              BUGPRINT("bad policy\n");
-+                              return -EINVAL;
-+                      }
-+              }
-+              if (i == NF_BR_NUMHOOKS) // it's a user defined chain
-+                      (*udc_cnt)++;
-+              else
-+                      newinfo->hook_entry[i] = (struct ebt_entries *)e;
-+              if (((struct ebt_entries *)e)->counter_offset != *totalcnt) {
-+                      BUGPRINT("counter_offset != totalcnt");
-+                      return -EINVAL;
-+              }
-+              *n = ((struct ebt_entries *)e)->nentries;
-+              *cnt = 0;
-+              return 0;
-+      }
-+      // a plain old entry, heh
-+      if (sizeof(struct ebt_entry) > e->watchers_offset ||
-+         e->watchers_offset > e->target_offset ||
-+         e->target_offset >= e->next_offset) {
-+              BUGPRINT("entry offsets not in right order\n");
-+              return -EINVAL;
-+      }
-+      // this is not checked anywhere else
-+      if (e->next_offset - e->target_offset < sizeof(struct ebt_entry_target)) {
-+              BUGPRINT("target size too small\n");
-+              return -EINVAL;
-+      }
-+
-+      (*cnt)++;
-+      (*totalcnt)++;
-+      return 0;
-+}
-+
-+struct ebt_cl_stack
-+{
-+      struct ebt_chainstack cs;
-+      int from;
-+      unsigned int hookmask;
-+};
-+
-+// we need these positions to check that the jumps to a different part of the
-+// entries is a jump to the beginning of a new chain.
-+static inline int
-+ebt_get_udc_positions(struct ebt_entry *e, struct ebt_table_info *newinfo,
-+   struct ebt_entries **hook_entries, unsigned int *n, unsigned int valid_hooks,
-+   struct ebt_cl_stack *udc)
-+{
-+      int i;
-+
-+      // we're only interested in chain starts
-+      if (e->bitmask & EBT_ENTRY_OR_ENTRIES)
-+              return 0;
-+      for (i = 0; i < NF_BR_NUMHOOKS; i++) {
-+              if ((valid_hooks & (1 << i)) == 0)
-+                      continue;
-+              if (newinfo->hook_entry[i] == (struct ebt_entries *)e)
-+                      break;
-+      }
-+      // only care about udc
-+      if (i != NF_BR_NUMHOOKS)
-+              return 0;
-+
-+      udc[*n].cs.chaininfo = (struct ebt_entries *)e;
-+      // these initialisations are depended on later in check_chainloops()
-+      udc[*n].cs.n = 0;
-+      udc[*n].hookmask = 0;
-+
-+      (*n)++;
-+      return 0;
-+}
-+
-+static inline int
-+ebt_cleanup_match(struct ebt_entry_match *m, unsigned int *i)
-+{
-+      if (i && (*i)-- == 0)
-+              return 1;
-+      if (m->u.match->destroy)
-+              m->u.match->destroy(m->data, m->match_size);
-+      if (m->u.match->me)
-+              __MOD_DEC_USE_COUNT(m->u.match->me);
-+
-+      return 0;
-+}
-+
-+static inline int
-+ebt_cleanup_watcher(struct ebt_entry_watcher *w, unsigned int *i)
-+{
-+      if (i && (*i)-- == 0)
-+              return 1;
-+      if (w->u.watcher->destroy)
-+              w->u.watcher->destroy(w->data, w->watcher_size);
-+      if (w->u.watcher->me)
-+              __MOD_DEC_USE_COUNT(w->u.watcher->me);
-+
-+      return 0;
-+}
-+
-+static inline int
-+ebt_cleanup_entry(struct ebt_entry *e, unsigned int *cnt)
-+{
-+      struct ebt_entry_target *t;
-+
-+      if ((e->bitmask & EBT_ENTRY_OR_ENTRIES) == 0)
-+              return 0;
-+      // we're done
-+      if (cnt && (*cnt)-- == 0)
-+              return 1;
-+      EBT_WATCHER_ITERATE(e, ebt_cleanup_watcher, NULL);
-+      EBT_MATCH_ITERATE(e, ebt_cleanup_match, NULL);
-+      t = (struct ebt_entry_target *)(((char *)e) + e->target_offset);
-+      if (t->u.target->destroy)
-+              t->u.target->destroy(t->data, t->target_size);
-+      if (t->u.target->me)
-+              __MOD_DEC_USE_COUNT(t->u.target->me);
-+
-+      return 0;
-+}
-+
-+static inline int
-+ebt_check_entry(struct ebt_entry *e, struct ebt_table_info *newinfo,
-+   const char *name, unsigned int *cnt, unsigned int valid_hooks,
-+   struct ebt_cl_stack *cl_s, unsigned int udc_cnt)
-+{
-+      struct ebt_entry_target *t;
-+      struct ebt_target *target;
-+      unsigned int i, j, hook = 0, hookmask = 0;
-+      int ret;
-+
-+      // Don't mess with the struct ebt_entries
-+      if ((e->bitmask & EBT_ENTRY_OR_ENTRIES) == 0)
-+              return 0;
-+
-+      if (e->bitmask & ~EBT_F_MASK) {
-+              BUGPRINT("Unknown flag for bitmask\n");
-+              return -EINVAL;
-+      }
-+      if (e->invflags & ~EBT_INV_MASK) {
-+              BUGPRINT("Unknown flag for inv bitmask\n");
-+              return -EINVAL;
-+      }
-+      if ( (e->bitmask & EBT_NOPROTO) && (e->bitmask & EBT_802_3) ) {
-+              BUGPRINT("NOPROTO & 802_3 not allowed\n");
-+              return -EINVAL;
-+      }
-+      // what hook do we belong to?
-+      for (i = 0; i < NF_BR_NUMHOOKS; i++) {
-+              if ((valid_hooks & (1 << i)) == 0)
-+                      continue;
-+              if ((char *)newinfo->hook_entry[i] < (char *)e)
-+                      hook = i;
-+              else
-+                      break;
-+      }
-+      // (1 << NF_BR_NUMHOOKS) tells the check functions the rule is on
-+      // a base chain
-+      if (i < NF_BR_NUMHOOKS)
-+              hookmask = (1 << hook) | (1 << NF_BR_NUMHOOKS);
-+      else {
-+              for (i = 0; i < udc_cnt; i++)
-+                      if ((char *)(cl_s[i].cs.chaininfo) > (char *)e)
-+                              break;
-+              if (i == 0)
-+                      hookmask = (1 << hook) | (1 << NF_BR_NUMHOOKS);
-+              else
-+                      hookmask = cl_s[i - 1].hookmask;
-+      }
-+      i = 0;
-+      ret = EBT_MATCH_ITERATE(e, ebt_check_match, e, name, hookmask, &i);
-+      if (ret != 0)
-+              goto cleanup_matches;
-+      j = 0;
-+      ret = EBT_WATCHER_ITERATE(e, ebt_check_watcher, e, name, hookmask, &j);
-+      if (ret != 0)
-+              goto cleanup_watchers;
-+      t = (struct ebt_entry_target *)(((char *)e) + e->target_offset);
-+      target = find_target_lock(t->u.name, &ret, &ebt_mutex);
-+      if (!target)
-+              goto cleanup_watchers;
-+      if (target->me)
-+              __MOD_INC_USE_COUNT(target->me);
-+      up(&ebt_mutex);
-+
-+      t->u.target = target;
-+      if (t->u.target == &ebt_standard_target) {
-+              if (e->target_offset + sizeof(struct ebt_standard_target) >
-+                 e->next_offset) {
-+                      BUGPRINT("Standard target size too big\n");
-+                      ret = -EFAULT;
-+                      goto cleanup_watchers;
-+              }
-+              if (((struct ebt_standard_target *)t)->verdict <
-+                 -NUM_STANDARD_TARGETS) {
-+                      BUGPRINT("Invalid standard target\n");
-+                      ret = -EFAULT;
-+                      goto cleanup_watchers;
-+              }
-+      } else if ((e->target_offset + t->target_size +
-+         sizeof(struct ebt_entry_target) > e->next_offset) ||
-+         (t->u.target->check &&
-+         t->u.target->check(name, hookmask, e, t->data, t->target_size) != 0)){
-+              if (t->u.target->me)
-+                      __MOD_DEC_USE_COUNT(t->u.target->me);
-+              ret = -EFAULT;
-+              goto cleanup_watchers;
-+      }
-+      (*cnt)++;
-+      return 0;
-+cleanup_watchers:
-+      EBT_WATCHER_ITERATE(e, ebt_cleanup_watcher, &j);
-+cleanup_matches:
-+      EBT_MATCH_ITERATE(e, ebt_cleanup_match, &i);
-+      return ret;
-+}
-+
-+// checks for loops and sets the hook mask for udc
-+// the hook mask for udc tells us from which base chains the udc can be
-+// accessed. This mask is a parameter to the check() functions of the extensions
-+static int check_chainloops(struct ebt_entries *chain,
-+   struct ebt_cl_stack *cl_s, unsigned int udc_cnt, 
-+   unsigned int hooknr, char *base)
-+{
-+      int i, chain_nr = -1, pos = 0, nentries = chain->nentries, verdict;
-+      struct ebt_entry *e = (struct ebt_entry *)chain->data;
-+      struct ebt_entry_target *t;
-+
-+      while (pos < nentries || chain_nr != -1) {
-+              // end of udc, go back one 'recursion' step
-+              if (pos == nentries) {
-+                      // put back values of the time when this chain was called
-+                      e = cl_s[chain_nr].cs.e;
-+                      if (cl_s[chain_nr].from != -1)
-+                              nentries =
-+                              cl_s[cl_s[chain_nr].from].cs.chaininfo->nentries;
-+                      else
-+                              nentries = chain->nentries;
-+                      pos = cl_s[chain_nr].cs.n;
-+                      // make sure we won't see a loop that isn't one
-+                      cl_s[chain_nr].cs.n = 0;
-+                      chain_nr = cl_s[chain_nr].from;
-+                      if (pos == nentries)
-+                              continue;
-+              }
-+              t = (struct ebt_entry_target *)
-+                 (((char *)e) + e->target_offset);
-+              if (strcmp(t->u.name, EBT_STANDARD_TARGET))
-+                      goto letscontinue;
-+              if (e->target_offset + sizeof(struct ebt_standard_target) >
-+                 e->next_offset) {
-+                      BUGPRINT("Standard target size too big\n");
-+                      return -1;
-+              }
-+              verdict = ((struct ebt_standard_target *)t)->verdict;
-+              if (verdict >= 0) { // jump to another chain
-+                      struct ebt_entries *hlp2 =
-+                         (struct ebt_entries *)(base + verdict);
-+                      for (i = 0; i < udc_cnt; i++)
-+                              if (hlp2 == cl_s[i].cs.chaininfo)
-+                                      break;
-+                      // bad destination or loop
-+                      if (i == udc_cnt) {
-+                              BUGPRINT("bad destination\n");
-+                              return -1;
-+                      }
-+                      if (cl_s[i].cs.n) {
-+                              BUGPRINT("loop\n");
-+                              return -1;
-+                      }
-+                      // this can't be 0, so the above test is correct
-+                      cl_s[i].cs.n = pos + 1;
-+                      pos = 0;
-+                      cl_s[i].cs.e = ((void *)e + e->next_offset);
-+                      e = (struct ebt_entry *)(hlp2->data);
-+                      nentries = hlp2->nentries;
-+                      cl_s[i].from = chain_nr;
-+                      chain_nr = i;
-+                      // this udc is accessible from the base chain for hooknr
-+                      cl_s[i].hookmask |= (1 << hooknr);
-+                      continue;
-+              }
-+letscontinue:
-+              e = (void *)e + e->next_offset;
-+              pos++;
-+      }
-+      return 0;
-+}
-+
-+// do the parsing of the table/chains/entries/matches/watchers/targets, heh
-+static int translate_table(struct ebt_replace *repl,
-+   struct ebt_table_info *newinfo)
-+{
-+      unsigned int i, j, k, udc_cnt;
-+      int ret;
-+      struct ebt_cl_stack *cl_s = NULL; // used in the checking for chain loops
-+
-+      i = 0;
-+      while (i < NF_BR_NUMHOOKS && !(repl->valid_hooks & (1 << i)))
-+              i++;
-+      if (i == NF_BR_NUMHOOKS) {
-+              BUGPRINT("No valid hooks specified\n");
-+              return -EINVAL;
-+      }
-+      if (repl->hook_entry[i] != (struct ebt_entries *)repl->entries) {
-+              BUGPRINT("Chains don't start at beginning\n");
-+              return -EINVAL;
-+      }
-+      // make sure chains are ordered after each other in same order
-+      // as their corresponding hooks
-+      for (j = i + 1; j < NF_BR_NUMHOOKS; j++) {
-+              if (!(repl->valid_hooks & (1 << j)))
-+                      continue;
-+              if ( repl->hook_entry[j] <= repl->hook_entry[i] ) {
-+                      BUGPRINT("Hook order must be followed\n");
-+                      return -EINVAL;
-+              }
-+              i = j;
-+      }
-+
-+      for (i = 0; i < NF_BR_NUMHOOKS; i++)
-+              newinfo->hook_entry[i] = NULL;
-+
-+      newinfo->entries_size = repl->entries_size;
-+      newinfo->nentries = repl->nentries;
-+
-+      // do some early checkings and initialize some things
-+      i = 0; // holds the expected nr. of entries for the chain
-+      j = 0; // holds the up to now counted entries for the chain
-+      k = 0; // holds the total nr. of entries, should equal
-+             // newinfo->nentries afterwards
-+      udc_cnt = 0; // will hold the nr. of user defined chains (udc)
-+      ret = EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,
-+         ebt_check_entry_size_and_hooks, newinfo, repl->entries,
-+         repl->entries + repl->entries_size, repl->hook_entry, &i, &j, &k,
-+         &udc_cnt, repl->valid_hooks);
-+
-+      if (ret != 0)
-+              return ret;
-+
-+      if (i != j) {
-+              BUGPRINT("nentries does not equal the nr of entries in the "
-+                       "(last) chain\n");
-+              return -EINVAL;
-+      }
-+      if (k != newinfo->nentries) {
-+              BUGPRINT("Total nentries is wrong\n");
-+              return -EINVAL;
-+      }
-+
-+      // check if all valid hooks have a chain
-+      for (i = 0; i < NF_BR_NUMHOOKS; i++) {
-+              if (newinfo->hook_entry[i] == NULL &&
-+                 (repl->valid_hooks & (1 << i))) {
-+                      BUGPRINT("Valid hook without chain\n");
-+                      return -EINVAL;
-+              }
-+      }
-+
-+      // Get the location of the udc, put them in an array
-+      // While we're at it, allocate the chainstack
-+      if (udc_cnt) {
-+              // this will get free'd in do_replace()/ebt_register_table()
-+              // if an error occurs
-+              newinfo->chainstack = (struct ebt_chainstack **)
-+                 vmalloc(smp_num_cpus * sizeof(struct ebt_chainstack));
-+              if (!newinfo->chainstack)
-+                      return -ENOMEM;
-+              for (i = 0; i < smp_num_cpus; i++) {
-+                      newinfo->chainstack[i] =
-+                         vmalloc(udc_cnt * sizeof(struct ebt_chainstack));
-+                      if (!newinfo->chainstack[i]) {
-+                              while (i)
-+                                      vfree(newinfo->chainstack[--i]);
-+                              vfree(newinfo->chainstack);
-+                              newinfo->chainstack = NULL;
-+                              return -ENOMEM;
-+                      }
-+              }
-+
-+              cl_s = (struct ebt_cl_stack *)
-+                 vmalloc(udc_cnt * sizeof(struct ebt_cl_stack));
-+              if (!cl_s)
-+                      return -ENOMEM;
-+              i = 0; // the i'th udc
-+              EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,
-+                 ebt_get_udc_positions, newinfo, repl->hook_entry, &i,
-+                 repl->valid_hooks, cl_s);
-+              // sanity check
-+              if (i != udc_cnt) {
-+                      BUGPRINT("i != udc_cnt\n");
-+                      vfree(cl_s);
-+                      return -EFAULT;
-+              }
-+      }
-+
-+      // Check for loops
-+      for (i = 0; i < NF_BR_NUMHOOKS; i++)
-+              if (repl->valid_hooks & (1 << i))
-+                      if (check_chainloops(newinfo->hook_entry[i],
-+                         cl_s, udc_cnt, i, newinfo->entries)) {
-+                              if (cl_s)
-+                                      vfree(cl_s);
-+                              return -EINVAL;
-+                      }
-+
-+      // we now know the following (along with E=mc²):
-+      // - the nr of entries in each chain is right
-+      // - the size of the allocated space is right
-+      // - all valid hooks have a corresponding chain
-+      // - there are no loops
-+      // - wrong data can still be on the level of a single entry
-+      // - could be there are jumps to places that are not the
-+      //   beginning of a chain. This can only occur in chains that
-+      //   are not accessible from any base chains, so we don't care.
-+
-+      // used to know what we need to clean up if something goes wrong
-+      i = 0;
-+      ret = EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,
-+         ebt_check_entry, newinfo, repl->name, &i, repl->valid_hooks,
-+         cl_s, udc_cnt);
-+      if (ret != 0) {
-+              EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,
-+                 ebt_cleanup_entry, &i);
-+      }
-+      if (cl_s)
-+              vfree(cl_s);
-+      return ret;
-+}
-+
-+// called under write_lock
-+static void get_counters(struct ebt_counter *oldcounters,
-+   struct ebt_counter *counters, unsigned int nentries)
-+{
-+      int i, cpu;
-+      struct ebt_counter *counter_base;
-+
-+      // counters of cpu 0
-+      memcpy(counters, oldcounters,
-+         sizeof(struct ebt_counter) * nentries);
-+      // add other counters to those of cpu 0
-+      for (cpu = 1; cpu < smp_num_cpus; cpu++) {
-+              counter_base = COUNTER_BASE(oldcounters, nentries, cpu);
-+              for (i = 0; i < nentries; i++) {
-+                      counters[i].pcnt += counter_base[i].pcnt;
-+                      counters[i].bcnt += counter_base[i].bcnt;
-+              }
-+      }
-+}
-+
-+// replace the table
-+static int do_replace(void *user, unsigned int len)
-+{
-+      int ret, i, countersize;
-+      struct ebt_table_info *newinfo;
-+      struct ebt_replace tmp;
-+      struct ebt_table *t;
-+      struct ebt_counter *counterstmp = NULL;
-+      // used to be able to unlock earlier
-+      struct ebt_table_info *table;
-+
-+      if (copy_from_user(&tmp, user, sizeof(tmp)) != 0)
-+              return -EFAULT;
-+
-+      if (len != sizeof(tmp) + tmp.entries_size) {
-+              BUGPRINT("Wrong len argument\n");
-+              return -EINVAL;
-+      }
-+
-+      if (tmp.entries_size == 0) {
-+              BUGPRINT("Entries_size never zero\n");
-+              return -EINVAL;
-+      }
-+      countersize = COUNTER_OFFSET(tmp.nentries) * smp_num_cpus;
-+      newinfo = (struct ebt_table_info *)
-+         vmalloc(sizeof(struct ebt_table_info) + countersize);
-+      if (!newinfo)
-+              return -ENOMEM;
-+
-+      if (countersize)
-+              memset(newinfo->counters, 0, countersize);
-+
-+      newinfo->entries = (char *)vmalloc(tmp.entries_size);
-+      if (!newinfo->entries) {
-+              ret = -ENOMEM;
-+              goto free_newinfo;
-+      }
-+      if (copy_from_user(
-+         newinfo->entries, tmp.entries, tmp.entries_size) != 0) {
-+              BUGPRINT("Couldn't copy entries from userspace\n");
-+              ret = -EFAULT;
-+              goto free_entries;
-+      }
-+
-+      // the user wants counters back
-+      // the check on the size is done later, when we have the lock
-+      if (tmp.num_counters) {
-+              counterstmp = (struct ebt_counter *)
-+                 vmalloc(tmp.num_counters * sizeof(struct ebt_counter));
-+              if (!counterstmp) {
-+                      ret = -ENOMEM;
-+                      goto free_entries;
-+              }
-+      }
-+      else
-+              counterstmp = NULL;
-+
-+      // this can get initialized by translate_table()
-+      newinfo->chainstack = NULL;
-+      ret = translate_table(&tmp, newinfo);
-+
-+      if (ret != 0)
-+              goto free_counterstmp;
-+
-+      t = find_table_lock(tmp.name, &ret, &ebt_mutex);
-+      if (!t)
-+              goto free_iterate;
-+
-+      // the table doesn't like it
-+      if (t->check && (ret = t->check(newinfo, tmp.valid_hooks)))
-+              goto free_unlock;
-+
-+      if (tmp.num_counters && tmp.num_counters != t->private->nentries) {
-+              BUGPRINT("Wrong nr. of counters requested\n");
-+              ret = -EINVAL;
-+              goto free_unlock;
-+      }
-+
-+      // we have the mutex lock, so no danger in reading this pointer
-+      table = t->private;
-+      // we need an atomic snapshot of the counters
-+      write_lock_bh(&t->lock);
-+      if (tmp.num_counters)
-+              get_counters(t->private->counters, counterstmp,
-+                 t->private->nentries);
-+
-+      t->private = newinfo;
-+      write_unlock_bh(&t->lock);
-+      up(&ebt_mutex);
-+      // So, a user can change the chains while having messed up her counter
-+      // allocation. Only reason why this is done is because this way the lock
-+      // is held only once, while this doesn't bring the kernel into a
-+      // dangerous state.
-+      if (tmp.num_counters &&
-+         copy_to_user(tmp.counters, counterstmp,
-+         tmp.num_counters * sizeof(struct ebt_counter))) {
-+              BUGPRINT("Couldn't copy counters to userspace\n");
-+              ret = -EFAULT;
-+      }
-+      else
-+              ret = 0;
-+
-+      // decrease module count and free resources
-+      EBT_ENTRY_ITERATE(table->entries, table->entries_size,
-+         ebt_cleanup_entry, NULL);
-+
-+      vfree(table->entries);
-+      if (table->chainstack) {
-+              for (i = 0; i < smp_num_cpus; i++)
-+                      vfree(table->chainstack[i]);
-+              vfree(table->chainstack);
-+      }
-+      vfree(table);
-+
-+      if (counterstmp)
-+              vfree(counterstmp);
-+      return ret;
-+
-+free_unlock:
-+      up(&ebt_mutex);
-+free_iterate:
-+      EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,
-+         ebt_cleanup_entry, NULL);
-+free_counterstmp:
-+      if (counterstmp)
-+              vfree(counterstmp);
-+      // can be initialized in translate_table()
-+      if (newinfo->chainstack) {
-+              for (i = 0; i < smp_num_cpus; i++)
-+                      vfree(newinfo->chainstack[i]);
-+              vfree(newinfo->chainstack);
-+      }
-+free_entries:
-+      if (newinfo->entries)
-+              vfree(newinfo->entries);
-+free_newinfo:
-+      if (newinfo)
-+              vfree(newinfo);
-+      return ret;
-+}
-+
-+int ebt_register_target(struct ebt_target *target)
-+{
-+      int ret;
-+
-+      ret = down_interruptible(&ebt_mutex);
-+      if (ret != 0)
-+              return ret;
-+      if (!list_named_insert(&ebt_targets, target)) {
-+              up(&ebt_mutex);
-+              return -EEXIST;
-+      }
-+      up(&ebt_mutex);
-+      MOD_INC_USE_COUNT;
-+
-+      return 0;
-+}
-+
-+void ebt_unregister_target(struct ebt_target *target)
-+{
-+      down(&ebt_mutex);
-+      LIST_DELETE(&ebt_targets, target);
-+      up(&ebt_mutex);
-+      MOD_DEC_USE_COUNT;
-+}
-+
-+int ebt_register_match(struct ebt_match *match)
-+{
-+      int ret;
-+
-+      ret = down_interruptible(&ebt_mutex);
-+      if (ret != 0)
-+              return ret;
-+      if (!list_named_insert(&ebt_matches, match)) {
-+              up(&ebt_mutex);
-+              return -EEXIST;
-+      }
-+      up(&ebt_mutex);
-+      MOD_INC_USE_COUNT;
-+
-+      return 0;
-+}
-+
-+void ebt_unregister_match(struct ebt_match *match)
-+{
-+      down(&ebt_mutex);
-+      LIST_DELETE(&ebt_matches, match);
-+      up(&ebt_mutex);
-+      MOD_DEC_USE_COUNT;
-+}
-+
-+int ebt_register_watcher(struct ebt_watcher *watcher)
-+{
-+      int ret;
-+
-+      ret = down_interruptible(&ebt_mutex);
-+      if (ret != 0)
-+              return ret;
-+      if (!list_named_insert(&ebt_watchers, watcher)) {
-+              up(&ebt_mutex);
-+              return -EEXIST;
-+      }
-+      up(&ebt_mutex);
-+      MOD_INC_USE_COUNT;
-+
-+      return 0;
-+}
-+
-+void ebt_unregister_watcher(struct ebt_watcher *watcher)
-+{
-+      down(&ebt_mutex);
-+      LIST_DELETE(&ebt_watchers, watcher);
-+      up(&ebt_mutex);
-+      MOD_DEC_USE_COUNT;
-+}
-+
-+int ebt_register_table(struct ebt_table *table)
-+{
-+      struct ebt_table_info *newinfo;
-+      int ret, i, countersize;
-+
-+      if (!table || !table->table ||!table->table->entries ||
-+          table->table->entries_size == 0 ||
-+          table->table->counters || table->private) {
-+              BUGPRINT("Bad table data for ebt_register_table!!!\n");
-+              return -EINVAL;
-+      }
-+
-+      countersize = COUNTER_OFFSET(table->table->nentries) * smp_num_cpus;
-+      newinfo = (struct ebt_table_info *)
-+         vmalloc(sizeof(struct ebt_table_info) + countersize);
-+      ret = -ENOMEM;
-+      if (!newinfo)
-+              return -ENOMEM;
-+
-+      newinfo->entries = (char *)vmalloc(table->table->entries_size);
-+      if (!(newinfo->entries))
-+              goto free_newinfo;
-+
-+      memcpy(newinfo->entries, table->table->entries,
-+         table->table->entries_size);
-+
-+      if (countersize)
-+              memset(newinfo->counters, 0, countersize);
-+
-+      // fill in newinfo and parse the entries
-+      newinfo->chainstack = NULL;
-+      ret = translate_table(table->table, newinfo);
-+      if (ret != 0) {
-+              BUGPRINT("Translate_table failed\n");
-+              goto free_chainstack;
-+      }
-+
-+      if (table->check && table->check(newinfo, table->valid_hooks)) {
-+              BUGPRINT("The table doesn't like its own initial data, lol\n");
-+              return -EINVAL;
-+      }
-+
-+      table->private = newinfo;
-+      table->lock = RW_LOCK_UNLOCKED;
-+      ret = down_interruptible(&ebt_mutex);
-+      if (ret != 0)
-+              goto free_chainstack;
-+
-+      if (list_named_find(&ebt_tables, table->name)) {
-+              ret = -EEXIST;
-+              BUGPRINT("Table name already exists\n");
-+              goto free_unlock;
-+      }
-+
-+      list_prepend(&ebt_tables, table);
-+      up(&ebt_mutex);
-+      MOD_INC_USE_COUNT;
-+      return 0;
-+free_unlock:
-+      up(&ebt_mutex);
-+free_chainstack:
-+      if (newinfo->chainstack) {
-+              for (i = 0; i < smp_num_cpus; i++)
-+                      vfree(newinfo->chainstack[i]);
-+              vfree(newinfo->chainstack);
-+      }
-+      vfree(newinfo->entries);
-+free_newinfo:
-+      vfree(newinfo);
-+      return ret;
-+}
-+
-+void ebt_unregister_table(struct ebt_table *table)
-+{
-+      int i;
-+
-+      if (!table) {
-+              BUGPRINT("Request to unregister NULL table!!!\n");
-+              return;
-+      }
-+      down(&ebt_mutex);
-+      LIST_DELETE(&ebt_tables, table);
-+      up(&ebt_mutex);
-+      EBT_ENTRY_ITERATE(table->private->entries,
-+         table->private->entries_size, ebt_cleanup_entry, NULL);
-+      if (table->private->entries)
-+              vfree(table->private->entries);
-+      if (table->private->chainstack) {
-+              for (i = 0; i < smp_num_cpus; i++)
-+                      vfree(table->private->chainstack[i]);
-+              vfree(table->private->chainstack);
-+      }
-+      vfree(table->private);
-+      MOD_DEC_USE_COUNT;
-+}
-+
-+// userspace just supplied us with counters
-+static int update_counters(void *user, unsigned int len)
-+{
-+      int i, ret;
-+      struct ebt_counter *tmp;
-+      struct ebt_replace hlp;
-+      struct ebt_table *t;
-+
-+      if (copy_from_user(&hlp, user, sizeof(hlp)))
-+              return -EFAULT;
-+
-+      if (len != sizeof(hlp) + hlp.num_counters * sizeof(struct ebt_counter))
-+              return -EINVAL;
-+      if (hlp.num_counters == 0)
-+              return -EINVAL;
-+
-+      if ( !(tmp = (struct ebt_counter *)
-+         vmalloc(hlp.num_counters * sizeof(struct ebt_counter))) ){
-+              MEMPRINT("Update_counters && nomemory\n");
-+              return -ENOMEM;
-+      }
-+
-+      t = find_table_lock(hlp.name, &ret, &ebt_mutex);
-+      if (!t)
-+              goto free_tmp;
-+
-+      if (hlp.num_counters != t->private->nentries) {
-+              BUGPRINT("Wrong nr of counters\n");
-+              ret = -EINVAL;
-+              goto unlock_mutex;
-+      }
-+
-+      if ( copy_from_user(tmp, hlp.counters,
-+         hlp.num_counters * sizeof(struct ebt_counter)) ) {
-+              BUGPRINT("Updata_counters && !cfu\n");
-+              ret = -EFAULT;
-+              goto unlock_mutex;
-+      }
-+
-+      // we want an atomic add of the counters
-+      write_lock_bh(&t->lock);
-+
-+      // we add to the counters of the first cpu
-+      for (i = 0; i < hlp.num_counters; i++) {
-+              t->private->counters[i].pcnt += tmp[i].pcnt;
-+              t->private->counters[i].bcnt += tmp[i].bcnt;
-+      }
-+
-+      write_unlock_bh(&t->lock);
-+      ret = 0;
-+unlock_mutex:
-+      up(&ebt_mutex);
-+free_tmp:
-+      vfree(tmp);
-+      return ret;
-+}
-+
-+static inline int ebt_make_matchname(struct ebt_entry_match *m,
-+   char *base, char *ubase)
-+{
-+      char *hlp = ubase - base + (char *)m;
-+      if (copy_to_user(hlp, m->u.match->name, EBT_FUNCTION_MAXNAMELEN))
-+              return -EFAULT;
-+      return 0;
-+}
-+
-+static inline int ebt_make_watchername(struct ebt_entry_watcher *w,
-+   char *base, char *ubase)
-+{
-+      char *hlp = ubase - base + (char *)w;
-+      if (copy_to_user(hlp , w->u.watcher->name, EBT_FUNCTION_MAXNAMELEN))
-+              return -EFAULT;
-+      return 0;
-+}
-+
-+static inline int ebt_make_names(struct ebt_entry *e, char *base, char *ubase)
-+{
-+      int ret;
-+      char *hlp;
-+      struct ebt_entry_target *t;
-+
-+      if ((e->bitmask & EBT_ENTRY_OR_ENTRIES) == 0)
-+              return 0;
-+
-+      hlp = ubase - base + (char *)e + e->target_offset;
-+      t = (struct ebt_entry_target *)(((char *)e) + e->target_offset);
-+      
-+      ret = EBT_MATCH_ITERATE(e, ebt_make_matchname, base, ubase);
-+      if (ret != 0)
-+              return ret;
-+      ret = EBT_WATCHER_ITERATE(e, ebt_make_watchername, base, ubase);
-+      if (ret != 0)
-+              return ret;
-+      if (copy_to_user(hlp, t->u.target->name, EBT_FUNCTION_MAXNAMELEN))
-+              return -EFAULT;
-+      return 0;
-+}
-+
-+// called with ebt_mutex down
-+static int copy_everything_to_user(struct ebt_table *t, void *user,
-+   int *len, int cmd)
-+{
-+      struct ebt_replace tmp;
-+      struct ebt_counter *counterstmp, *oldcounters;
-+      unsigned int entries_size, nentries;
-+      char *entries;
-+
-+      if (cmd == EBT_SO_GET_ENTRIES) {
-+              entries_size = t->private->entries_size;
-+              nentries = t->private->nentries;
-+              entries = t->private->entries;
-+              oldcounters = t->private->counters;
-+      } else {
-+              entries_size = t->table->entries_size;
-+              nentries = t->table->nentries;
-+              entries = t->table->entries;
-+              oldcounters = t->table->counters;
-+      }
-+
-+      if (copy_from_user(&tmp, user, sizeof(tmp))) {
-+              BUGPRINT("Cfu didn't work\n");
-+              return -EFAULT;
-+      }
-+
-+      if (*len != sizeof(struct ebt_replace) + entries_size +
-+         (tmp.num_counters? nentries * sizeof(struct ebt_counter): 0)) {
-+              BUGPRINT("Wrong size\n");
-+              return -EINVAL;
-+      }
-+
-+      if (tmp.nentries != nentries) {
-+              BUGPRINT("Nentries wrong\n");
-+              return -EINVAL;
-+      }
-+
-+      if (tmp.entries_size != entries_size) {
-+              BUGPRINT("Wrong size\n");
-+              return -EINVAL;
-+      }
-+
-+      // userspace might not need the counters
-+      if (tmp.num_counters) {
-+              if (tmp.num_counters != nentries) {
-+                      BUGPRINT("Num_counters wrong\n");
-+                      return -EINVAL;
-+              }
-+              counterstmp = (struct ebt_counter *)
-+                 vmalloc(nentries * sizeof(struct ebt_counter));
-+              if (!counterstmp) {
-+                      MEMPRINT("Couldn't copy counters, out of memory\n");
-+                      return -ENOMEM;
-+              }
-+              write_lock_bh(&t->lock);
-+              get_counters(oldcounters, counterstmp, nentries);
-+              write_unlock_bh(&t->lock);
-+
-+              if (copy_to_user(tmp.counters, counterstmp,
-+                 nentries * sizeof(struct ebt_counter))) {
-+                      BUGPRINT("Couldn't copy counters to userspace\n");
-+                      vfree(counterstmp);
-+                      return -EFAULT;
-+              }
-+              vfree(counterstmp);
-+      }
-+
-+      if (copy_to_user(tmp.entries, entries, entries_size)) {
-+              BUGPRINT("Couldn't copy entries to userspace\n");
-+              return -EFAULT;
-+      }
-+      // set the match/watcher/target names right
-+      return EBT_ENTRY_ITERATE(entries, entries_size,
-+         ebt_make_names, entries, tmp.entries);
-+}
-+
-+static int do_ebt_set_ctl(struct sock *sk,
-+      int cmd, void *user, unsigned int len)
-+{
-+      int ret;
-+
-+      switch(cmd) {
-+      case EBT_SO_SET_ENTRIES:
-+              ret = do_replace(user, len);
-+              break;
-+      case EBT_SO_SET_COUNTERS:
-+              ret = update_counters(user, len);
-+              break;
-+      default:
-+              ret = -EINVAL;
-+  }
-+      return ret;
-+}
-+
-+static int do_ebt_get_ctl(struct sock *sk, int cmd, void *user, int *len)
-+{
-+      int ret;
-+      struct ebt_replace tmp;
-+      struct ebt_table *t;
-+
-+      if (copy_from_user(&tmp, user, sizeof(tmp)))
-+              return -EFAULT;
-+
-+      t = find_table_lock(tmp.name, &ret, &ebt_mutex);
-+      if (!t)
-+              return ret;
-+
-+      switch(cmd) {
-+      case EBT_SO_GET_INFO:
-+      case EBT_SO_GET_INIT_INFO:
-+              if (*len != sizeof(struct ebt_replace)){
-+                      ret = -EINVAL;
-+                      up(&ebt_mutex);
-+                      break;
-+              }
-+              if (cmd == EBT_SO_GET_INFO) {
-+                      tmp.nentries = t->private->nentries;
-+                      tmp.entries_size = t->private->entries_size;
-+                      tmp.valid_hooks = t->valid_hooks;
-+              } else {
-+                      tmp.nentries = t->table->nentries;
-+                      tmp.entries_size = t->table->entries_size;
-+                      tmp.valid_hooks = t->table->valid_hooks;
-+              }
-+              up(&ebt_mutex);
-+              if (copy_to_user(user, &tmp, *len) != 0){
-+                      BUGPRINT("c2u Didn't work\n");
-+                      ret = -EFAULT;
-+                      break;
-+              }
-+              ret = 0;
-+              break;
-+
-+      case EBT_SO_GET_ENTRIES:
-+      case EBT_SO_GET_INIT_ENTRIES:
-+              ret = copy_everything_to_user(t, user, len, cmd);
-+              up(&ebt_mutex);
-+              break;
-+
-+      default:
-+              up(&ebt_mutex);
-+              ret = -EINVAL;
-+      }
-+
-+      return ret;
-+}
-+
-+static struct nf_sockopt_ops ebt_sockopts =
-+{ { NULL, NULL }, PF_INET, EBT_BASE_CTL, EBT_SO_SET_MAX + 1, do_ebt_set_ctl,
-+    EBT_BASE_CTL, EBT_SO_GET_MAX + 1, do_ebt_get_ctl, 0, NULL
-+};
-+
-+static int __init init(void)
-+{
-+      int ret;
-+
-+      down(&ebt_mutex);
-+      list_named_insert(&ebt_targets, &ebt_standard_target);
-+      up(&ebt_mutex);
-+      if ((ret = nf_register_sockopt(&ebt_sockopts)) < 0)
-+              return ret;
-+
-+      printk(KERN_NOTICE "Ebtables v2.0 registered\n");
-+      return 0;
-+}
-+
-+static void __exit fini(void)
-+{
-+      nf_unregister_sockopt(&ebt_sockopts);
-+      printk(KERN_NOTICE "Ebtables v2.0 unregistered\n");
-+}
-+
-+EXPORT_SYMBOL(ebt_register_table);
-+EXPORT_SYMBOL(ebt_unregister_table);
-+EXPORT_SYMBOL(ebt_register_match);
-+EXPORT_SYMBOL(ebt_unregister_match);
-+EXPORT_SYMBOL(ebt_register_watcher);
-+EXPORT_SYMBOL(ebt_unregister_watcher);
-+EXPORT_SYMBOL(ebt_register_target);
-+EXPORT_SYMBOL(ebt_unregister_target);
-+EXPORT_SYMBOL(ebt_do_table);
-+module_init(init);
-+module_exit(fini);
-+MODULE_LICENSE("GPL");
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/include/linux/netfilter_bridge/ebtables.h  Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,361 @@
-+/*
-+ *  ebtables
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer                <bart.de.schuymer@pandora.be>
-+ *
-+ *  ebtables.c,v 2.0, September, 2002
-+ *
-+ *  This code is stongly inspired on the iptables code which is
-+ *  Copyright (C) 1999 Paul `Rusty' Russell & Michael J. Neuling
-+ */
-+
-+#ifndef __LINUX_BRIDGE_EFF_H
-+#define __LINUX_BRIDGE_EFF_H
-+#include <linux/if.h>
-+#include <linux/netfilter_bridge.h>
-+#include <linux/if_ether.h>
-+
-+#define EBT_TABLE_MAXNAMELEN 32
-+#define EBT_CHAIN_MAXNAMELEN EBT_TABLE_MAXNAMELEN
-+#define EBT_FUNCTION_MAXNAMELEN EBT_TABLE_MAXNAMELEN
-+
-+// verdicts >0 are "branches"
-+#define EBT_ACCEPT   -1
-+#define EBT_DROP     -2
-+#define EBT_CONTINUE -3
-+#define EBT_RETURN   -4
-+#define NUM_STANDARD_TARGETS   4
-+
-+struct ebt_replace
-+{
-+      char name[EBT_TABLE_MAXNAMELEN];
-+      unsigned int valid_hooks;
-+      // nr of rules in the table
-+      unsigned int nentries;
-+      // total size of the entries
-+      unsigned int entries_size;
-+      // start of the chains
-+      struct ebt_entries *hook_entry[NF_BR_NUMHOOKS];
-+      // nr of counters userspace expects back
-+      unsigned int num_counters;
-+      // where the kernel will put the old counters
-+      struct ebt_counter *counters;
-+      char *entries;
-+};
-+
-+struct ebt_counter
-+{
-+      uint64_t pcnt;
-+      uint64_t bcnt;
-+};
-+
-+struct ebt_entries {
-+      // this field is always set to zero
-+      // See EBT_ENTRY_OR_ENTRIES.
-+      // Must be same size as ebt_entry.bitmask
-+      unsigned int distinguisher;
-+      // the chain name
-+      char name[EBT_CHAIN_MAXNAMELEN];
-+      // counter offset for this chain
-+      unsigned int counter_offset;
-+      // one standard (accept, drop, return) per hook
-+      int policy;
-+      // nr. of entries
-+      unsigned int nentries;
-+      // entry list
-+      char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
-+};
-+
-+// used for the bitmask of struct ebt_entry
-+
-+// This is a hack to make a difference between an ebt_entry struct and an
-+// ebt_entries struct when traversing the entries from start to end.
-+// Using this simplifies the code alot, while still being able to use
-+// ebt_entries.
-+// Contrary, iptables doesn't use something like ebt_entries and therefore uses
-+// different techniques for naming the policy and such. So, iptables doesn't
-+// need a hack like this.
-+#define EBT_ENTRY_OR_ENTRIES 0x01
-+// these are the normal masks
-+#define EBT_NOPROTO 0x02
-+#define EBT_802_3 0x04
-+#define EBT_SOURCEMAC 0x08
-+#define EBT_DESTMAC 0x10
-+#define EBT_F_MASK (EBT_NOPROTO | EBT_802_3 | EBT_SOURCEMAC | EBT_DESTMAC \
-+   | EBT_ENTRY_OR_ENTRIES)
-+
-+#define EBT_IPROTO 0x01
-+#define EBT_IIN 0x02
-+#define EBT_IOUT 0x04
-+#define EBT_ISOURCE 0x8
-+#define EBT_IDEST 0x10
-+#define EBT_ILOGICALIN 0x20
-+#define EBT_ILOGICALOUT 0x40
-+#define EBT_INV_MASK (EBT_IPROTO | EBT_IIN | EBT_IOUT | EBT_ILOGICALIN \
-+   | EBT_ILOGICALOUT | EBT_ISOURCE | EBT_IDEST)
-+
-+struct ebt_entry_match
-+{
-+      union {
-+              char name[EBT_FUNCTION_MAXNAMELEN];
-+              struct ebt_match *match;
-+      } u;
-+      // size of data
-+      unsigned int match_size;
-+      unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
-+};
-+
-+struct ebt_entry_watcher
-+{
-+      union {
-+              char name[EBT_FUNCTION_MAXNAMELEN];
-+              struct ebt_watcher *watcher;
-+      } u;
-+      // size of data
-+      unsigned int watcher_size;
-+      unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
-+};
-+
-+struct ebt_entry_target
-+{
-+      union {
-+              char name[EBT_FUNCTION_MAXNAMELEN];
-+              struct ebt_target *target;
-+      } u;
-+      // size of data
-+      unsigned int target_size;
-+      unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
-+};
-+
-+#define EBT_STANDARD_TARGET "standard"
-+struct ebt_standard_target
-+{
-+      struct ebt_entry_target target;
-+      int verdict;
-+};
-+
-+// one entry
-+struct ebt_entry {
-+      // this needs to be the first field
-+      unsigned int bitmask;
-+      unsigned int invflags;
-+      uint16_t ethproto;
-+      // the physical in-dev
-+      char in[IFNAMSIZ];
-+      // the logical in-dev
-+      char logical_in[IFNAMSIZ];
-+      // the physical out-dev
-+      char out[IFNAMSIZ];
-+      // the logical out-dev
-+      char logical_out[IFNAMSIZ];
-+      unsigned char sourcemac[ETH_ALEN];
-+      unsigned char sourcemsk[ETH_ALEN];
-+      unsigned char destmac[ETH_ALEN];
-+      unsigned char destmsk[ETH_ALEN];
-+      // sizeof ebt_entry + matches
-+      unsigned int watchers_offset;
-+      // sizeof ebt_entry + matches + watchers
-+      unsigned int target_offset;
-+      // sizeof ebt_entry + matches + watchers + target
-+      unsigned int next_offset;
-+      unsigned char elems[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
-+};
-+
-+// [gs]etsockopt numbers
-+#define EBT_BASE_CTL            128
-+
-+#define EBT_SO_SET_ENTRIES      (EBT_BASE_CTL)
-+#define EBT_SO_SET_COUNTERS     (EBT_SO_SET_ENTRIES+1)
-+#define EBT_SO_SET_MAX          (EBT_SO_SET_COUNTERS+1)
-+
-+#define EBT_SO_GET_INFO         (EBT_BASE_CTL)
-+#define EBT_SO_GET_ENTRIES      (EBT_SO_GET_INFO+1)
-+#define EBT_SO_GET_INIT_INFO    (EBT_SO_GET_ENTRIES+1)
-+#define EBT_SO_GET_INIT_ENTRIES (EBT_SO_GET_INIT_INFO+1)
-+#define EBT_SO_GET_MAX          (EBT_SO_GET_INIT_ENTRIES+1)
-+
-+#ifdef __KERNEL__
-+
-+// return values for match() functions
-+#define EBT_MATCH 0
-+#define EBT_NOMATCH 1
-+
-+struct ebt_match
-+{
-+      struct list_head list;
-+      const char name[EBT_FUNCTION_MAXNAMELEN];
-+      // 0 == it matches
-+      int (*match)(const struct sk_buff *skb, const struct net_device *in,
-+         const struct net_device *out, const void *matchdata,
-+         unsigned int datalen);
-+      // 0 == let it in
-+      int (*check)(const char *tablename, unsigned int hookmask,
-+         const struct ebt_entry *e, void *matchdata, unsigned int datalen);
-+      void (*destroy)(void *matchdata, unsigned int datalen);
-+      struct module *me;
-+};
-+
-+struct ebt_watcher
-+{
-+      struct list_head list;
-+      const char name[EBT_FUNCTION_MAXNAMELEN];
-+      void (*watcher)(const struct sk_buff *skb, const struct net_device *in,
-+         const struct net_device *out, const void *watcherdata,
-+         unsigned int datalen);
-+      // 0 == let it in
-+      int (*check)(const char *tablename, unsigned int hookmask,
-+         const struct ebt_entry *e, void *watcherdata, unsigned int datalen);
-+      void (*destroy)(void *watcherdata, unsigned int datalen);
-+      struct module *me;
-+};
-+
-+struct ebt_target
-+{
-+      struct list_head list;
-+      const char name[EBT_FUNCTION_MAXNAMELEN];
-+      // returns one of the standard verdicts
-+      int (*target)(struct sk_buff **pskb, unsigned int hooknr,
-+         const struct net_device *in, const struct net_device *out,
-+         const void *targetdata, unsigned int datalen);
-+      // 0 == let it in
-+      int (*check)(const char *tablename, unsigned int hookmask,
-+         const struct ebt_entry *e, void *targetdata, unsigned int datalen);
-+      void (*destroy)(void *targetdata, unsigned int datalen);
-+      struct module *me;
-+};
-+
-+// used for jumping from and into user defined chains (udc)
-+struct ebt_chainstack
-+{
-+      struct ebt_entries *chaininfo; // pointer to chain data
-+      struct ebt_entry *e; // pointer to entry data
-+      unsigned int n; // n'th entry
-+};
-+
-+struct ebt_table_info
-+{
-+      // total size of the entries
-+      unsigned int entries_size;
-+      unsigned int nentries;
-+      // pointers to the start of the chains
-+      struct ebt_entries *hook_entry[NF_BR_NUMHOOKS];
-+      // room to maintain the stack used for jumping from and into udc
-+      struct ebt_chainstack **chainstack;
-+      char *entries;
-+      struct ebt_counter counters[0] ____cacheline_aligned;
-+};
-+
-+struct ebt_table
-+{
-+      struct list_head list;
-+      char name[EBT_TABLE_MAXNAMELEN];
-+      struct ebt_replace *table;
-+      unsigned int valid_hooks;
-+      rwlock_t lock;
-+      // e.g. could be the table explicitly only allows certain
-+      // matches, targets, ... 0 == let it in
-+      int (*check)(const struct ebt_table_info *info,
-+         unsigned int valid_hooks);
-+      // the data used by the kernel
-+      struct ebt_table_info *private;
-+};
-+
-+#define EBT_ALIGN(s) (((s) + (__alignof__(struct ebt_replace)-1)) & \
-+                   ~(__alignof__(struct ebt_replace)-1))
-+extern int ebt_register_table(struct ebt_table *table);
-+extern void ebt_unregister_table(struct ebt_table *table);
-+extern int ebt_register_match(struct ebt_match *match);
-+extern void ebt_unregister_match(struct ebt_match *match);
-+extern int ebt_register_watcher(struct ebt_watcher *watcher);
-+extern void ebt_unregister_watcher(struct ebt_watcher *watcher);
-+extern int ebt_register_target(struct ebt_target *target);
-+extern void ebt_unregister_target(struct ebt_target *target);
-+extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   struct ebt_table *table);
-+
-+   // Used in the kernel match() functions
-+#define FWINV(bool,invflg) ((bool) ^ !!(info->invflags & invflg))
-+// True if the hook mask denotes that the rule is in a base chain,
-+// used in the check() functions
-+#define BASE_CHAIN (hookmask & (1 << NF_BR_NUMHOOKS))
-+// Clear the bit in the hook mask that tells if the rule is on a base chain
-+#define CLEAR_BASE_CHAIN_BIT (hookmask &= ~(1 << NF_BR_NUMHOOKS))
-+// True if the target is not a standard target
-+#define INVALID_TARGET (info->target < -NUM_STANDARD_TARGETS || info->target >= 0)
-+
-+#endif /* __KERNEL__ */
-+
-+// blatently stolen from ip_tables.h
-+// fn returns 0 to continue iteration
-+#define EBT_MATCH_ITERATE(e, fn, args...)                   \
-+({                                                          \
-+      unsigned int __i;                                   \
-+      int __ret = 0;                                      \
-+      struct ebt_entry_match *__match;                    \
-+                                                          \
-+      for (__i = sizeof(struct ebt_entry);                \
-+           __i < (e)->watchers_offset;                    \
-+           __i += __match->match_size +                   \
-+           sizeof(struct ebt_entry_match)) {              \
-+              __match = (void *)(e) + __i;                \
-+                                                          \
-+              __ret = fn(__match , ## args);              \
-+              if (__ret != 0)                             \
-+                      break;                              \
-+      }                                                   \
-+      if (__ret == 0) {                                   \
-+              if (__i != (e)->watchers_offset)            \
-+                      __ret = -EINVAL;                    \
-+      }                                                   \
-+      __ret;                                              \
-+})
-+
-+#define EBT_WATCHER_ITERATE(e, fn, args...)                 \
-+({                                                          \
-+      unsigned int __i;                                   \
-+      int __ret = 0;                                      \
-+      struct ebt_entry_watcher *__watcher;                \
-+                                                          \
-+      for (__i = e->watchers_offset;                      \
-+           __i < (e)->target_offset;                      \
-+           __i += __watcher->watcher_size +               \
-+           sizeof(struct ebt_entry_watcher)) {            \
-+              __watcher = (void *)(e) + __i;              \
-+                                                          \
-+              __ret = fn(__watcher , ## args);            \
-+              if (__ret != 0)                             \
-+                      break;                              \
-+      }                                                   \
-+      if (__ret == 0) {                                   \
-+              if (__i != (e)->target_offset)              \
-+                      __ret = -EINVAL;                    \
-+      }                                                   \
-+      __ret;                                              \
-+})
-+
-+#define EBT_ENTRY_ITERATE(entries, size, fn, args...)       \
-+({                                                          \
-+      unsigned int __i;                                   \
-+      int __ret = 0;                                      \
-+      struct ebt_entry *__entry;                          \
-+                                                          \
-+      for (__i = 0; __i < (size);) {                      \
-+              __entry = (void *)(entries) + __i;          \
-+              __ret = fn(__entry , ## args);              \
-+              if (__ret != 0)                             \
-+                      break;                              \
-+              if (__entry->bitmask != 0)                  \
-+                      __i += __entry->next_offset;        \
-+              else                                        \
-+                      __i += sizeof(struct ebt_entries);  \
-+      }                                                   \
-+      if (__ret == 0) {                                   \
-+              if (__i != (size))                          \
-+                      __ret = -EINVAL;                    \
-+      }                                                   \
-+      __ret;                                              \
-+})
-+
-+#endif
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/include/linux/netfilter_bridge/ebt_802_3.h Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,60 @@
-+#ifndef __LINUX_BRIDGE_EBT_802_3_H
-+#define __LINUX_BRIDGE_EBT_802_3_H
-+
-+#define EBT_802_3_SAP 0x01
-+#define EBT_802_3_TYPE 0x02
-+
-+#define EBT_802_3_MATCH "802_3"
-+
-+/*
-+ * If frame has DSAP/SSAP value 0xaa you must check the SNAP type
-+ * to discover what kind of packet we're carrying. 
-+ */
-+#define CHECK_TYPE 0xaa
-+
-+/*
-+ * Control field may be one or two bytes.  If the first byte has
-+ * the value 0x03 then the entire length is one byte, otherwise it is two.
-+ * One byte controls are used in Unnumbered Information frames.
-+ * Two byte controls are used in Numbered Information frames.
-+ */
-+#define IS_UI 0x03
-+
-+#define EBT_802_3_MASK (EBT_802_3_SAP | EBT_802_3_TYPE | EBT_802_3)
-+
-+/* ui has one byte ctrl, ni has two */
-+struct hdr_ui {
-+      uint8_t dsap;
-+      uint8_t ssap;
-+      uint8_t ctrl;
-+      uint8_t orig[3];
-+      uint16_t type;
-+};
-+
-+struct hdr_ni {
-+      uint8_t dsap;
-+      uint8_t ssap;
-+      uint16_t ctrl;
-+      uint8_t  orig[3];
-+      uint16_t type;
-+};
-+
-+struct ebt_802_3_hdr {
-+      uint8_t  daddr[6];
-+      uint8_t  saddr[6];
-+      uint16_t len;
-+      union {
-+              struct hdr_ui ui;
-+              struct hdr_ni ni;
-+      } llc;
-+};
-+
-+struct ebt_802_3_info 
-+{
-+      uint8_t  sap;
-+      uint16_t type;
-+      uint8_t  bitmask;
-+      uint8_t  invflags;
-+};
-+
-+#endif
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/include/linux/netfilter_bridge/ebt_arp.h   Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,32 @@
-+#ifndef __LINUX_BRIDGE_EBT_ARP_H
-+#define __LINUX_BRIDGE_EBT_ARP_H
-+
-+#define EBT_ARP_OPCODE 0x01
-+#define EBT_ARP_HTYPE 0x02
-+#define EBT_ARP_PTYPE 0x04
-+#define EBT_ARP_SRC_IP 0x08
-+#define EBT_ARP_DST_IP 0x10
-+#define EBT_ARP_SRC_MAC 0x20
-+#define EBT_ARP_DST_MAC 0x40
-+#define EBT_ARP_MASK (EBT_ARP_OPCODE | EBT_ARP_HTYPE | EBT_ARP_PTYPE | \
-+   EBT_ARP_SRC_IP | EBT_ARP_DST_IP | EBT_ARP_SRC_MAC | EBT_ARP_DST_MAC)
-+#define EBT_ARP_MATCH "arp"
-+
-+struct ebt_arp_info
-+{
-+      uint16_t htype;
-+      uint16_t ptype;
-+      uint16_t opcode;
-+      uint32_t saddr;
-+      uint32_t smsk;
-+      uint32_t daddr;
-+      uint32_t dmsk;
-+      unsigned char smaddr[ETH_ALEN];
-+      unsigned char smmsk[ETH_ALEN];
-+      unsigned char dmaddr[ETH_ALEN];
-+      unsigned char dmmsk[ETH_ALEN];
-+      uint8_t  bitmask;
-+      uint8_t  invflags;
-+};
-+
-+#endif
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/include/linux/netfilter_bridge/ebt_ip.h    Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,43 @@
-+/*
-+ *  ebt_ip
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  April, 2002
-+ *
-+ *  Changes:
-+ *    added ip-sport and ip-dport
-+ *    Innominate Security Technologies AG <mhopf@innominate.com>
-+ *    September, 2002
-+ */
-+
-+#ifndef __LINUX_BRIDGE_EBT_IP_H
-+#define __LINUX_BRIDGE_EBT_IP_H
-+
-+#define EBT_IP_SOURCE 0x01
-+#define EBT_IP_DEST 0x02
-+#define EBT_IP_TOS 0x04
-+#define EBT_IP_PROTO 0x08
-+#define EBT_IP_SPORT 0x10
-+#define EBT_IP_DPORT 0x20
-+#define EBT_IP_MASK (EBT_IP_SOURCE | EBT_IP_DEST | EBT_IP_TOS | EBT_IP_PROTO |\
-+ EBT_IP_SPORT | EBT_IP_DPORT )
-+#define EBT_IP_MATCH "ip"
-+
-+// the same values are used for the invflags
-+struct ebt_ip_info
-+{
-+      uint32_t saddr;
-+      uint32_t daddr;
-+      uint32_t smsk;
-+      uint32_t dmsk;
-+      uint8_t  tos;
-+      uint8_t  protocol;
-+      uint8_t  bitmask;
-+      uint8_t  invflags;
-+      uint16_t sport[2];
-+      uint16_t dport[2];
-+};
-+
-+#endif
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/include/linux/netfilter_bridge/ebt_pkttype.h       Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,11 @@
-+#ifndef __LINUX_BRIDGE_EBT_PKTTYPE_H
-+#define __LINUX_BRIDGE_EBT_PKTTYPE_H
-+
-+struct ebt_pkttype_info
-+{
-+      uint8_t pkt_type;
-+      uint8_t invert;
-+};
-+#define EBT_PKTTYPE_MATCH "pkttype"
-+
-+#endif
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/include/linux/netfilter_bridge/ebt_stp.h   Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,46 @@
-+#ifndef __LINUX_BRIDGE_EBT_STP_H
-+#define __LINUX_BRIDGE_EBT_STP_H
-+
-+#define EBT_STP_TYPE          0x0001
-+
-+#define EBT_STP_FLAGS         0x0002
-+#define EBT_STP_ROOTPRIO      0x0004
-+#define EBT_STP_ROOTADDR      0x0008
-+#define EBT_STP_ROOTCOST      0x0010
-+#define EBT_STP_SENDERPRIO    0x0020
-+#define EBT_STP_SENDERADDR    0x0040
-+#define EBT_STP_PORT          0x0080
-+#define EBT_STP_MSGAGE                0x0100
-+#define EBT_STP_MAXAGE                0x0200
-+#define EBT_STP_HELLOTIME     0x0400
-+#define EBT_STP_FWDD          0x0800
-+
-+#define EBT_STP_MASK          0x0fff
-+#define EBT_STP_CONFIG_MASK   0x0ffe
-+
-+#define EBT_STP_MATCH "stp"
-+
-+struct ebt_stp_config_info
-+{
-+      uint8_t flags;
-+      uint16_t root_priol, root_priou;
-+      char root_addr[6], root_addrmsk[6];
-+      uint32_t root_costl, root_costu;
-+      uint16_t sender_priol, sender_priou;
-+      char sender_addr[6], sender_addrmsk[6];
-+      uint16_t portl, portu;
-+      uint16_t msg_agel, msg_ageu;
-+      uint16_t max_agel, max_ageu;
-+      uint16_t hello_timel, hello_timeu;
-+      uint16_t forward_delayl, forward_delayu;
-+};
-+
-+struct ebt_stp_info
-+{
-+      uint8_t type;
-+      struct ebt_stp_config_info config;
-+      uint16_t bitmask;
-+      uint16_t invflags;
-+};
-+
-+#endif
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/include/linux/netfilter_bridge/ebt_vlan.h  Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,20 @@
-+#ifndef __LINUX_BRIDGE_EBT_VLAN_H
-+#define __LINUX_BRIDGE_EBT_VLAN_H
-+
-+#define EBT_VLAN_ID   0x01
-+#define EBT_VLAN_PRIO 0x02
-+#define EBT_VLAN_ENCAP        0x04
-+#define EBT_VLAN_MASK (EBT_VLAN_ID | EBT_VLAN_PRIO | EBT_VLAN_ENCAP)
-+#define EBT_VLAN_MATCH "vlan"
-+
-+struct ebt_vlan_info {
-+      uint16_t id;            /* VLAN ID {1-4095} */
-+      uint8_t prio;           /* VLAN User Priority {0-7} */
-+      uint16_t encap;         /* VLAN Encapsulated frame code {0-65535} */
-+      uint8_t bitmask;                /* Args bitmask bit 1=1 - ID arg,
-+                                 bit 2=1 User-Priority arg, bit 3=1 encap*/
-+      uint8_t invflags;               /* Inverse bitmask  bit 1=1 - inversed ID arg, 
-+                                 bit 2=1 - inversed Pirority arg */
-+};
-+
-+#endif
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/include/linux/netfilter_bridge/ebt_log.h   Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,17 @@
-+#ifndef __LINUX_BRIDGE_EBT_LOG_H
-+#define __LINUX_BRIDGE_EBT_LOG_H
-+
-+#define EBT_LOG_IP 0x01 // if the frame is made by ip, log the ip information
-+#define EBT_LOG_ARP 0x02
-+#define EBT_LOG_MASK (EBT_LOG_IP | EBT_LOG_ARP)
-+#define EBT_LOG_PREFIX_SIZE 30
-+#define EBT_LOG_WATCHER "log"
-+
-+struct ebt_log_info
-+{
-+      uint8_t loglevel;
-+      uint8_t prefix[EBT_LOG_PREFIX_SIZE];
-+      uint32_t bitmask;
-+};
-+
-+#endif
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/include/linux/netfilter_bridge/ebt_nat.h   Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,13 @@
-+#ifndef __LINUX_BRIDGE_EBT_NAT_H
-+#define __LINUX_BRIDGE_EBT_NAT_H
-+
-+struct ebt_nat_info
-+{
-+      unsigned char mac[ETH_ALEN];
-+      // EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN
-+      int target;
-+};
-+#define EBT_SNAT_TARGET "snat"
-+#define EBT_DNAT_TARGET "dnat"
-+
-+#endif
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/include/linux/netfilter_bridge/ebt_redirect.h      Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,11 @@
-+#ifndef __LINUX_BRIDGE_EBT_REDIRECT_H
-+#define __LINUX_BRIDGE_EBT_REDIRECT_H
-+
-+struct ebt_redirect_info
-+{
-+      // EBT_ACCEPT, EBT_DROP or EBT_CONTINUE or EBT_RETURN
-+      int target;
-+};
-+#define EBT_REDIRECT_TARGET "redirect"
-+
-+#endif
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/include/linux/netfilter_bridge/ebt_mark_m.h        Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,15 @@
-+#ifndef __LINUX_BRIDGE_EBT_MARK_M_H
-+#define __LINUX_BRIDGE_EBT_MARK_M_H
-+
-+#define EBT_MARK_AND 0x01
-+#define EBT_MARK_OR 0x02
-+#define EBT_MARK_MASK (EBT_MARK_AND | EBT_MARK_OR)
-+struct ebt_mark_m_info
-+{
-+      unsigned long mark, mask;
-+      uint8_t invert;
-+      uint8_t bitmask;
-+};
-+#define EBT_MARK_MATCH "mark_m"
-+
-+#endif
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/include/linux/netfilter_bridge/ebt_mark_t.h        Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,12 @@
-+#ifndef __LINUX_BRIDGE_EBT_MARK_T_H
-+#define __LINUX_BRIDGE_EBT_MARK_T_H
-+
-+struct ebt_mark_t_info
-+{
-+      unsigned long mark;
-+      // EBT_ACCEPT, EBT_DROP or EBT_CONTINUE or EBT_RETURN
-+      int target;
-+};
-+#define EBT_MARK_TARGET "mark"
-+
-+#endif
---- linux-2.4.21/include/linux/netfilter.h     Thu Nov 22 20:47:48 2001
-+++ linux-2.4.21-ebt-brnf-3/include/linux/netfilter.h  Fri Aug  8 01:09:06 2003
-@@ -117,28 +117,34 @@ extern struct list_head nf_hooks[NPROTO]
- /* This is gross, but inline doesn't cut it for avoiding the function
-    call in fast path: gcc doesn't inline (needs value tracking?). --RR */
- #ifdef CONFIG_NETFILTER_DEBUG
--#define NF_HOOK nf_hook_slow
-+#define NF_HOOK(pf, hook, skb, indev, outdev, okfn)                   \
-+nf_hook_slow((pf), (hook), (skb), (indev), (outdev), (okfn), INT_MIN)
-+#define NF_HOOK_THRESH nf_hook_slow
- #else
- #define NF_HOOK(pf, hook, skb, indev, outdev, okfn)                   \
- (list_empty(&nf_hooks[(pf)][(hook)])                                  \
-  ? (okfn)(skb)                                                                \
-- : nf_hook_slow((pf), (hook), (skb), (indev), (outdev), (okfn)))
-+ : nf_hook_slow((pf), (hook), (skb), (indev), (outdev), (okfn), INT_MIN))
-+#define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh)    \
-+(list_empty(&nf_hooks[(pf)][(hook)])                                  \
-+ ? (okfn)(skb)                                                                \
-+ : nf_hook_slow((pf), (hook), (skb), (indev), (outdev), (okfn), (thresh)))
- #endif
- int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb,
-                struct net_device *indev, struct net_device *outdev,
--               int (*okfn)(struct sk_buff *));
-+               int (*okfn)(struct sk_buff *), int thresh);
- /* Call setsockopt() */
--int nf_setsockopt(struct sock *sk, int pf, int optval, char *opt, 
-+int nf_setsockopt(struct sock *sk, int pf, int optval, char *opt,
-                 int len);
- int nf_getsockopt(struct sock *sk, int pf, int optval, char *opt,
-                 int *len);
- /* Packet queuing */
--typedef int (*nf_queue_outfn_t)(struct sk_buff *skb, 
-+typedef int (*nf_queue_outfn_t)(struct sk_buff *skb,
-                                 struct nf_info *info, void *data);
--extern int nf_register_queue_handler(int pf, 
-+extern int nf_register_queue_handler(int pf,
-                                      nf_queue_outfn_t outfn, void *data);
- extern int nf_unregister_queue_handler(int pf);
- extern void nf_reinject(struct sk_buff *skb,
---- linux-2.4.21/include/linux/netfilter_ipv4.h        Mon Feb 25 20:38:13 2002
-+++ linux-2.4.21-ebt-brnf-3/include/linux/netfilter_ipv4.h     Fri Aug  8 01:09:06 2003
-@@ -52,8 +52,10 @@
- enum nf_ip_hook_priorities {
-       NF_IP_PRI_FIRST = INT_MIN,
-       NF_IP_PRI_CONNTRACK = -200,
-+      NF_IP_PRI_BRIDGE_SABOTAGE_FORWARD = -175,
-       NF_IP_PRI_MANGLE = -150,
-       NF_IP_PRI_NAT_DST = -100,
-+      NF_IP_PRI_BRIDGE_SABOTAGE_LOCAL_OUT = -50,
-       NF_IP_PRI_FILTER = 0,
-       NF_IP_PRI_NAT_SRC = 100,
-       NF_IP_PRI_LAST = INT_MAX,
---- linux-2.4.21/include/linux/skbuff.h        Fri Jun 13 16:51:39 2003
-+++ linux-2.4.21-ebt-brnf-3/include/linux/skbuff.h     Fri Aug  8 01:09:06 2003
-@@ -92,6 +92,17 @@ struct nf_conntrack {
- struct nf_ct_info {
-       struct nf_conntrack *master;
- };
-+
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+struct nf_bridge_info {
-+      atomic_t use;
-+      struct net_device *physindev;
-+      struct net_device *physoutdev;
-+      unsigned int mask;
-+      unsigned long hh[16 / sizeof(unsigned long)];
-+};
-+#endif
-+
- #endif
- struct sk_buff_head {
-@@ -204,6 +215,9 @@ struct sk_buff {
- #ifdef CONFIG_NETFILTER_DEBUG
-         unsigned int nf_debug;
- #endif
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      struct nf_bridge_info   *nf_bridge;     /* Saved data about a bridged frame - see br_netfilter.c */
-+#endif
- #endif /*CONFIG_NETFILTER*/
- #if defined(CONFIG_HIPPI)
-@@ -278,7 +292,7 @@ static inline struct sk_buff *skb_get(st
-  * If users==1, we are the only owner and are can avoid redundant
-  * atomic change.
-  */
-- 
-+
- /**
-  *    kfree_skb - free an sk_buff
-  *    @skb: buffer to free
-@@ -286,7 +300,7 @@ static inline struct sk_buff *skb_get(st
-  *    Drop a reference to the buffer and free it if the usage count has
-  *    hit zero.
-  */
-- 
-+
- static inline void kfree_skb(struct sk_buff *skb)
- {
-       if (atomic_read(&skb->users) == 1 || atomic_dec_and_test(&skb->users))
-@@ -1165,6 +1179,20 @@ nf_conntrack_get(struct nf_ct_info *nfct
-       if (nfct)
-               atomic_inc(&nfct->master->use);
- }
-+
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+static inline void nf_bridge_put(struct nf_bridge_info *nf_bridge)
-+{
-+      if (nf_bridge && atomic_dec_and_test(&nf_bridge->use))
-+              kfree(nf_bridge);
-+}
-+static inline void nf_bridge_get(struct nf_bridge_info *nf_bridge)
-+{
-+      if (nf_bridge)
-+              atomic_inc(&nf_bridge->use);
-+}
-+#endif
-+
- #endif
- #endif        /* __KERNEL__ */
---- linux-2.4.21/net/core/netfilter.c  Sat Aug  3 02:39:46 2002
-+++ linux-2.4.21-ebt-brnf-3/net/core/netfilter.c       Fri Aug  8 01:09:06 2003
-@@ -1,4 +1,4 @@
--/* netfilter.c: look after the filters for various protocols. 
-+/* netfilter.c: look after the filters for various protocols.
-  * Heavily influenced by the old firewall.c by David Bonn and Alan Cox.
-  *
-  * Thanks to Rob `CmdrTaco' Malda for not influencing this code in any
-@@ -342,10 +342,15 @@ static unsigned int nf_iterate(struct li
-                              const struct net_device *indev,
-                              const struct net_device *outdev,
-                              struct list_head **i,
--                             int (*okfn)(struct sk_buff *))
-+                             int (*okfn)(struct sk_buff *),
-+                             int hook_thresh)
- {
-       for (*i = (*i)->next; *i != head; *i = (*i)->next) {
-               struct nf_hook_ops *elem = (struct nf_hook_ops *)*i;
-+
-+              if (hook_thresh > elem->priority)
-+                      continue;
-+
-               switch (elem->hook(hook, skb, indev, outdev, okfn)) {
-               case NF_QUEUE:
-                       return NF_QUEUE;
-@@ -365,7 +370,7 @@ static unsigned int nf_iterate(struct li
-                       break;
-               default:
--                      NFDEBUG("Evil return from %p(%u).\n", 
-+                      NFDEBUG("Evil return from %p(%u).\n",
-                               elem->hook, hook);
- #endif
-               }
-@@ -374,7 +379,7 @@ static unsigned int nf_iterate(struct li
- }
- int nf_register_queue_handler(int pf, nf_queue_outfn_t outfn, void *data)
--{      
-+{
-       int ret;
-       br_write_lock_bh(BR_NETPROTO_LOCK);
-@@ -400,12 +405,12 @@ int nf_unregister_queue_handler(int pf)
-       return 0;
- }
--/* 
-- * Any packet that leaves via this function must come back 
-+/*
-+ * Any packet that leaves via this function must come back
-  * through nf_reinject().
-  */
--static void nf_queue(struct sk_buff *skb, 
--                   struct list_head *elem, 
-+static void nf_queue(struct sk_buff *skb,
-+                   struct list_head *elem,
-                    int pf, unsigned int hook,
-                    struct net_device *indev,
-                    struct net_device *outdev,
-@@ -413,6 +418,10 @@ static void nf_queue(struct sk_buff *skb
- {
-       int status;
-       struct nf_info *info;
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      struct net_device *physindev = NULL;
-+      struct net_device *physoutdev = NULL;
-+#endif
-       if (!queue_handler[pf].outfn) {
-               kfree_skb(skb);
-@@ -428,18 +437,31 @@ static void nf_queue(struct sk_buff *skb
-               return;
-       }
--      *info = (struct nf_info) { 
-+      *info = (struct nf_info) {
-               (struct nf_hook_ops *)elem, pf, hook, indev, outdev, okfn };
-       /* Bump dev refs so they don't vanish while packet is out */
-       if (indev) dev_hold(indev);
-       if (outdev) dev_hold(outdev);
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      if (skb->nf_bridge) {
-+              physindev = skb->nf_bridge->physindev;
-+              if (physindev) dev_hold(physindev);
-+              physoutdev = skb->nf_bridge->physoutdev;
-+              if (physoutdev) dev_hold(physoutdev);
-+      }
-+#endif
-+
-       status = queue_handler[pf].outfn(skb, info, queue_handler[pf].data);
-       if (status < 0) {
-               /* James M doesn't say fuck enough. */
-               if (indev) dev_put(indev);
-               if (outdev) dev_put(outdev);
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+              if (physindev) dev_put(physindev);
-+              if (physoutdev) dev_put(physoutdev);
-+#endif
-               kfree(info);
-               kfree_skb(skb);
-               return;
-@@ -449,7 +471,8 @@ static void nf_queue(struct sk_buff *skb
- int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb,
-                struct net_device *indev,
-                struct net_device *outdev,
--               int (*okfn)(struct sk_buff *))
-+               int (*okfn)(struct sk_buff *),
-+               int hook_thresh)
- {
-       struct list_head *elem;
-       unsigned int verdict;
-@@ -481,7 +504,7 @@ int nf_hook_slow(int pf, unsigned int ho
-       elem = &nf_hooks[pf][hook];
-       verdict = nf_iterate(&nf_hooks[pf][hook], &skb, hook, indev,
--                           outdev, &elem, okfn);
-+                           outdev, &elem, okfn, hook_thresh);
-       if (verdict == NF_QUEUE) {
-               NFDEBUG("nf_hook: Verdict = QUEUE.\n");
-               nf_queue(skb, elem, pf, hook, indev, outdev, okfn);
-@@ -510,6 +533,14 @@ void nf_reinject(struct sk_buff *skb, st
-       /* We don't have BR_NETPROTO_LOCK here */
-       br_read_lock_bh(BR_NETPROTO_LOCK);
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      if (skb->nf_bridge) {
-+              if (skb->nf_bridge->physindev)
-+                      dev_put(skb->nf_bridge->physindev);
-+              if (skb->nf_bridge->physoutdev)
-+                      dev_put(skb->nf_bridge->physoutdev);
-+      }
-+#endif
-       for (i = nf_hooks[info->pf][info->hook].next; i != elem; i = i->next) {
-               if (i == &nf_hooks[info->pf][info->hook]) {
-                       /* The module which sent it to userspace is gone. */
-@@ -528,9 +559,9 @@ void nf_reinject(struct sk_buff *skb, st
-       if (verdict == NF_ACCEPT) {
-               verdict = nf_iterate(&nf_hooks[info->pf][info->hook],
--                                   &skb, info->hook, 
-+                                   &skb, info->hook,
-                                    info->indev, info->outdev, &elem,
--                                   info->okfn);
-+                                   info->okfn, INT_MIN);
-       }
-       switch (verdict) {
-@@ -539,20 +570,19 @@ void nf_reinject(struct sk_buff *skb, st
-               break;
-       case NF_QUEUE:
--              nf_queue(skb, elem, info->pf, info->hook, 
-+              nf_queue(skb, elem, info->pf, info->hook,
-                        info->indev, info->outdev, info->okfn);
-               break;
--
--      case NF_DROP:
--              kfree_skb(skb);
--              break;
-       }
-       br_read_unlock_bh(BR_NETPROTO_LOCK);
-       /* Release those devices we held, or Alexey will kill me. */
-       if (info->indev) dev_put(info->indev);
-       if (info->outdev) dev_put(info->outdev);
--      
-+
-+      if (verdict == NF_DROP)
-+              kfree_skb(skb);
-+
-       kfree(info);
-       return;
- }
---- linux-2.4.21/net/core/skbuff.c     Fri Jun 13 16:51:39 2003
-+++ linux-2.4.21-ebt-brnf-3/net/core/skbuff.c  Fri Aug  8 01:09:06 2003
-@@ -245,6 +245,9 @@ static inline void skb_headerinit(void *
- #ifdef CONFIG_NETFILTER_DEBUG
-       skb->nf_debug = 0;
- #endif
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      skb->nf_bridge    = NULL;
-+#endif
- #endif
- #ifdef CONFIG_NET_SCHED
-       skb->tc_index = 0;
-@@ -325,6 +328,9 @@ void __kfree_skb(struct sk_buff *skb)
-       }
- #ifdef CONFIG_NETFILTER
-       nf_conntrack_put(skb->nfct);
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      nf_bridge_put(skb->nf_bridge);
-+#endif
- #endif
-       skb_headerinit(skb, NULL, 0);  /* clean state */
-       kfree_skbmem(skb);
-@@ -391,6 +397,9 @@ struct sk_buff *skb_clone(struct sk_buff
- #ifdef CONFIG_NETFILTER_DEBUG
-       C(nf_debug);
- #endif
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      C(nf_bridge);
-+#endif
- #endif /*CONFIG_NETFILTER*/
- #if defined(CONFIG_HIPPI)
-       C(private);
-@@ -403,6 +412,9 @@ struct sk_buff *skb_clone(struct sk_buff
-       skb->cloned = 1;
- #ifdef CONFIG_NETFILTER
-       nf_conntrack_get(skb->nfct);
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      nf_bridge_get(skb->nf_bridge);
-+#endif
- #endif
-       return n;
- }
-@@ -436,6 +448,10 @@ static void copy_skb_header(struct sk_bu
-       nf_conntrack_get(new->nfct);
- #ifdef CONFIG_NETFILTER_DEBUG
-       new->nf_debug=old->nf_debug;
-+#endif
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      new->nf_bridge=old->nf_bridge;
-+      nf_bridge_get(new->nf_bridge);
- #endif
- #endif
- #ifdef CONFIG_NET_SCHED
---- linux-2.4.21/net/ipv4/netfilter/ip_tables.c        Fri Jun 13 16:51:39 2003
-+++ linux-2.4.21-ebt-brnf-3/net/ipv4/netfilter/ip_tables.c     Fri Aug  8 01:09:06 2003
-@@ -121,12 +121,19 @@ static LIST_HEAD(ipt_tables);
- static inline int
- ip_packet_match(const struct iphdr *ip,
-               const char *indev,
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+              const char *physindev,
-+#endif
-               const char *outdev,
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+              const char *physoutdev,
-+#endif
-               const struct ipt_ip *ipinfo,
-               int isfrag)
- {
-       size_t i;
-       unsigned long ret;
-+      unsigned long ret2 = 1;
- #define FWINV(bool,invflg) ((bool) ^ !!(ipinfo->invflags & invflg))
-@@ -156,7 +163,15 @@ ip_packet_match(const struct iphdr *ip,
-                       & ((const unsigned long *)ipinfo->iniface_mask)[i];
-       }
--      if (FWINV(ret != 0, IPT_INV_VIA_IN)) {
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      for (i = 0, ret2 = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) {
-+              ret2 |= (((const unsigned long *)physindev)[i]
-+                      ^ ((const unsigned long *)ipinfo->iniface)[i])
-+                      & ((const unsigned long *)ipinfo->iniface_mask)[i];
-+      }
-+#endif
-+
-+      if (FWINV(ret != 0 && ret2 != 0, IPT_INV_VIA_IN)) {
-               dprintf("VIA in mismatch (%s vs %s).%s\n",
-                       indev, ipinfo->iniface,
-                       ipinfo->invflags&IPT_INV_VIA_IN ?" (INV)":"");
-@@ -169,7 +184,15 @@ ip_packet_match(const struct iphdr *ip,
-                       & ((const unsigned long *)ipinfo->outiface_mask)[i];
-       }
--      if (FWINV(ret != 0, IPT_INV_VIA_OUT)) {
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      for (i = 0, ret2 = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) {
-+              ret2 |= (((const unsigned long *)physoutdev)[i]
-+                      ^ ((const unsigned long *)ipinfo->outiface)[i])
-+                      & ((const unsigned long *)ipinfo->outiface_mask)[i];
-+      }
-+#endif
-+
-+      if (FWINV(ret != 0 && ret2 != 0, IPT_INV_VIA_OUT)) {
-               dprintf("VIA out mismatch (%s vs %s).%s\n",
-                       outdev, ipinfo->outiface,
-                       ipinfo->invflags&IPT_INV_VIA_OUT ?" (INV)":"");
-@@ -268,6 +291,9 @@ ipt_do_table(struct sk_buff **pskb,
-       /* Initializing verdict to NF_DROP keeps gcc happy. */
-       unsigned int verdict = NF_DROP;
-       const char *indev, *outdev;
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      const char *physindev, *physoutdev;
-+#endif
-       void *table_base;
-       struct ipt_entry *e, *back;
-@@ -277,6 +303,13 @@ ipt_do_table(struct sk_buff **pskb,
-       datalen = (*pskb)->len - ip->ihl * 4;
-       indev = in ? in->name : nulldevname;
-       outdev = out ? out->name : nulldevname;
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      physindev = ((*pskb)->nf_bridge && (*pskb)->nf_bridge->physindev) ?
-+              (*pskb)->nf_bridge->physindev->name : nulldevname;
-+      physoutdev = ((*pskb)->nf_bridge && (*pskb)->nf_bridge->physoutdev) ?
-+              (*pskb)->nf_bridge->physoutdev->name : nulldevname;
-+#endif
-+
-       /* We handle fragments by dealing with the first fragment as
-        * if it was a normal packet.  All other fragments are treated
-        * normally, except that they will NEVER match rules that ask
-@@ -312,7 +345,15 @@ ipt_do_table(struct sk_buff **pskb,
-               IP_NF_ASSERT(e);
-               IP_NF_ASSERT(back);
-               (*pskb)->nfcache |= e->nfcache;
--              if (ip_packet_match(ip, indev, outdev, &e->ip, offset)) {
-+              if (ip_packet_match(ip, indev,
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+                  physindev,
-+#endif
-+                  outdev,
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+                  physoutdev,
-+#endif
-+                  &e->ip, offset)) {
-                       struct ipt_entry_target *t;
-                       if (IPT_MATCH_ITERATE(e, do_match,
---- linux-2.4.21/net/ipv4/ip_output.c  Fri Nov 29 00:53:15 2002
-+++ linux-2.4.21-ebt-brnf-3/net/ipv4/ip_output.c       Fri Aug  8 01:09:06 2003
-@@ -879,6 +879,10 @@ int ip_fragment(struct sk_buff *skb, int
-               /* Connection association is same as pre-frag packet */
-               skb2->nfct = skb->nfct;
-               nf_conntrack_get(skb2->nfct);
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+              skb2->nf_bridge = skb->nf_bridge;
-+              nf_bridge_get(skb2->nf_bridge);
-+#endif
- #ifdef CONFIG_NETFILTER_DEBUG
-               skb2->nf_debug = skb->nf_debug;
- #endif
---- linux-2.4.21/net/ipv4/netfilter/ipt_LOG.c  Mon Feb 25 20:38:14 2002
-+++ linux-2.4.21-ebt-brnf-3/net/ipv4/netfilter/ipt_LOG.c       Fri Aug  8 01:09:06 2003
-@@ -289,6 +289,18 @@ ipt_log_target(struct sk_buff **pskb,
-              loginfo->prefix,
-              in ? in->name : "",
-              out ? out->name : "");
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      if ((*pskb)->nf_bridge) {
-+              struct net_device *physindev = (*pskb)->nf_bridge->physindev;
-+              struct net_device *physoutdev = (*pskb)->nf_bridge->physoutdev;
-+
-+              if (physindev && in != physindev)
-+                      printk("PHYSIN=%s ", physindev->name);
-+              if (physoutdev && out != physoutdev)
-+                      printk("PHYSOUT=%s ", physoutdev->name);
-+      }
-+#endif
-+
-       if (in && !out) {
-               /* MAC logging for input chain only. */
-               printk("MAC=");
---- linux-2.4.21/net/ipv4/netfilter/Makefile   Fri Jun 13 16:51:39 2003
-+++ linux-2.4.21-ebt-brnf-3/net/ipv4/netfilter/Makefile        Fri Aug  8 01:09:06 2003
-@@ -84,6 +84,8 @@ obj-$(CONFIG_IP_NF_MATCH_CONNTRACK) += i
- obj-$(CONFIG_IP_NF_MATCH_UNCLEAN) += ipt_unclean.o
- obj-$(CONFIG_IP_NF_MATCH_TCPMSS) += ipt_tcpmss.o
-+obj-$(CONFIG_IP_NF_MATCH_PHYSDEV) += ipt_physdev.o
-+
- # targets
- obj-$(CONFIG_IP_NF_TARGET_REJECT) += ipt_REJECT.o
- obj-$(CONFIG_IP_NF_TARGET_MIRROR) += ipt_MIRROR.o
---- linux-2.4.21/net/ipv4/netfilter/Config.in  Fri Jun 13 16:51:39 2003
-+++ linux-2.4.21-ebt-brnf-3/net/ipv4/netfilter/Config.in       Fri Aug  8 01:09:06 2003
-@@ -43,6 +43,9 @@ if [ "$CONFIG_IP_NF_IPTABLES" != "n" ]; 
-     dep_tristate '  Unclean match support (EXPERIMENTAL)' CONFIG_IP_NF_MATCH_UNCLEAN $CONFIG_IP_NF_IPTABLES
-     dep_tristate '  Owner match support (EXPERIMENTAL)' CONFIG_IP_NF_MATCH_OWNER $CONFIG_IP_NF_IPTABLES
-   fi
-+  if [ "$CONFIG_BRIDGE" != "n" ]; then
-+    dep_tristate '  Physdev match support' CONFIG_IP_NF_MATCH_PHYSDEV
-+  fi
- # The targets
-   dep_tristate '  Packet filtering' CONFIG_IP_NF_FILTER $CONFIG_IP_NF_IPTABLES 
-   if [ "$CONFIG_IP_NF_FILTER" != "n" ]; then
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/net/bridge/br_netfilter.c  Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,636 @@
-+/*
-+ *    Handle firewalling
-+ *    Linux ethernet bridge
-+ *
-+ *    Authors:
-+ *    Lennert Buytenhek               <buytenh@gnu.org>
-+ *    Bart De Schuymer                <bdschuym@pandora.be>
-+ *
-+ *    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, or (at your option) any later version.
-+ *
-+ *    Lennert dedicates this file to Kerstin Wurdinger.
-+ */
-+
-+#include <linux/module.h>
-+#include <linux/kernel.h>
-+#include <linux/ip.h>
-+#include <linux/netdevice.h>
-+#include <linux/skbuff.h>
-+#include <linux/if_ether.h>
-+#include <linux/netfilter_bridge.h>
-+#include <linux/netfilter_ipv4.h>
-+#include <linux/in_route.h>
-+#include <net/ip.h>
-+#include <asm/uaccess.h>
-+#include <asm/checksum.h>
-+#include "br_private.h"
-+
-+
-+#define skb_origaddr(skb)      (((struct bridge_skb_cb *) \
-+                               (skb->cb))->daddr.ipv4)
-+#define store_orig_dstaddr(skb)        (skb_origaddr(skb) = (skb)->nh.iph->daddr)
-+#define dnat_took_place(skb)   (skb_origaddr(skb) != (skb)->nh.iph->daddr)
-+#define clear_cb(skb)          (memset(&skb_origaddr(skb), 0, \
-+                               sizeof(struct bridge_skb_cb)))
-+
-+#define has_bridge_parent(device)     ((device)->br_port != NULL)
-+#define bridge_parent(device)         (&((device)->br_port->br->dev))
-+
-+/* We need these fake structures to make netfilter happy --
-+ * lots of places assume that skb->dst != NULL, which isn't
-+ * all that unreasonable.
-+ *
-+ * Currently, we fill in the PMTU entry because netfilter
-+ * refragmentation needs it, and the rt_flags entry because
-+ * ipt_REJECT needs it.  Future netfilter modules might
-+ * require us to fill additional fields.
-+ */
-+static struct net_device __fake_net_device = {
-+      .hard_header_len        = ETH_HLEN
-+};
-+
-+static struct rtable __fake_rtable = {
-+      u: {
-+              dst: {
-+                      __refcnt:               ATOMIC_INIT(1),
-+                      dev:                    &__fake_net_device,
-+                      pmtu:                   1500
-+              }
-+      },
-+
-+      rt_flags:       0
-+};
-+
-+
-+/* PF_BRIDGE/PRE_ROUTING *********************************************/
-+static void __br_dnat_complain(void)
-+{
-+      static unsigned long last_complaint = 0;
-+
-+      if (jiffies - last_complaint >= 5 * HZ) {
-+              printk(KERN_WARNING "Performing cross-bridge DNAT requires IP "
-+                      "forwarding to be enabled\n");
-+              last_complaint = jiffies;
-+      }
-+}
-+
-+
-+/* This requires some explaining. If DNAT has taken place,
-+ * we will need to fix up the destination Ethernet address,
-+ * and this is a tricky process.
-+ *
-+ * There are two cases to consider:
-+ * 1. The packet was DNAT'ed to a device in the same bridge
-+ *    port group as it was received on. We can still bridge
-+ *    the packet.
-+ * 2. The packet was DNAT'ed to a different device, either
-+ *    a non-bridged device or another bridge port group.
-+ *    The packet will need to be routed.
-+ *
-+ * The correct way of distinguishing between these two cases is to
-+ * call ip_route_input() and to look at skb->dst->dev, which is
-+ * changed to the destination device if ip_route_input() succeeds.
-+ *
-+ * Let us first consider the case that ip_route_input() succeeds:
-+ *
-+ * If skb->dst->dev equals the logical bridge device the packet
-+ * came in on, we can consider this bridging. We then call
-+ * skb->dst->output() which will make the packet enter br_nf_local_out()
-+ * not much later. In that function it is assured that the iptables
-+ * FORWARD chain is traversed for the packet.
-+ *
-+ * Otherwise, the packet is considered to be routed and we just
-+ * change the destination MAC address so that the packet will
-+ * later be passed up to the IP stack to be routed.
-+ *
-+ * Let us now consider the case that ip_route_input() fails:
-+ *
-+ * After a "echo '0' > /proc/sys/net/ipv4/ip_forward" ip_route_input()
-+ * will fail, while __ip_route_output_key() will return success. The source
-+ * address for __ip_route_output_key() is set to zero, so __ip_route_output_key
-+ * thinks we're handling a locally generated packet and won't care
-+ * if IP forwarding is allowed. We send a warning message to the users's
-+ * log telling her to put IP forwarding on.
-+ *
-+ * ip_route_input() will also fail if there is no route available.
-+ * In that case we just drop the packet.
-+ *
-+ * --Lennert, 20020411
-+ * --Bart, 20020416 (updated)
-+ * --Bart, 20021007 (updated)
-+ */
-+
-+static int br_nf_pre_routing_finish_bridge(struct sk_buff *skb)
-+{
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug |= (1 << NF_BR_PRE_ROUTING) | (1 << NF_BR_FORWARD);
-+#endif
-+
-+      if (skb->pkt_type == PACKET_OTHERHOST) {
-+              skb->pkt_type = PACKET_HOST;
-+              skb->nf_bridge->mask |= BRNF_PKT_TYPE;
-+      }
-+
-+      skb->dev = bridge_parent(skb->dev);
-+      skb->dst->output(skb);
-+      return 0;
-+}
-+
-+static int br_nf_pre_routing_finish(struct sk_buff *skb)
-+{
-+      struct net_device *dev = skb->dev;
-+      struct iphdr *iph = skb->nh.iph;
-+      struct nf_bridge_info *nf_bridge = skb->nf_bridge;
-+
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug ^= (1 << NF_BR_PRE_ROUTING);
-+#endif
-+
-+      if (nf_bridge->mask & BRNF_PKT_TYPE) {
-+              skb->pkt_type = PACKET_OTHERHOST;
-+              nf_bridge->mask ^= BRNF_PKT_TYPE;
-+      }
-+
-+      if (dnat_took_place(skb)) {
-+              if (ip_route_input(skb, iph->daddr, iph->saddr, iph->tos,
-+                  dev)) {
-+                      struct rtable *rt;
-+
-+                      if (!ip_route_output(&rt, iph->daddr, 0, iph->tos, 0)) {
-+                              /* Bridged-and-DNAT'ed traffic doesn't
-+                               * require ip_forwarding.
-+                               */
-+                              if (((struct dst_entry *)rt)->dev == dev) {
-+                                      skb->dst = (struct dst_entry *)rt;
-+                                      goto bridged_dnat;
-+                              }
-+                              __br_dnat_complain();
-+                              dst_release((struct dst_entry *)rt);
-+                      }
-+                      kfree_skb(skb);
-+                      return 0;
-+              } else {
-+                      if (skb->dst->dev == dev) {
-+bridged_dnat:
-+                              /* Tell br_nf_local_out this is a
-+                               * bridged frame
-+                               */
-+                              nf_bridge->mask |= BRNF_BRIDGED_DNAT;
-+                              skb->dev = nf_bridge->physindev;
-+                              clear_cb(skb);
-+                              NF_HOOK_THRESH(PF_BRIDGE, NF_BR_PRE_ROUTING,
-+                                             skb, skb->dev, NULL,
-+                                             br_nf_pre_routing_finish_bridge,
-+                                             1);
-+                              return 0;
-+                      }
-+                      memcpy(skb->mac.ethernet->h_dest, dev->dev_addr,
-+                             ETH_ALEN);
-+              }
-+      } else {
-+              skb->dst = (struct dst_entry *)&__fake_rtable;
-+              dst_hold(skb->dst);
-+      }
-+
-+      clear_cb(skb);
-+      skb->dev = nf_bridge->physindev;
-+      NF_HOOK_THRESH(PF_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL,
-+                     br_handle_frame_finish, 1);
-+
-+      return 0;
-+}
-+
-+/* Replicate the checks that IPv4 does on packet reception.
-+ * Set skb->dev to the bridge device (i.e. parent of the
-+ * receiving device) to make netfilter happy, the REDIRECT
-+ * target in particular.  Save the original destination IP
-+ * address to be able to detect DNAT afterwards.
-+ */
-+static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   int (*okfn)(struct sk_buff *))
-+{
-+      struct iphdr *iph;
-+      __u32 len;
-+      struct sk_buff *skb;
-+      struct nf_bridge_info *nf_bridge;
-+
-+      if ((*pskb)->protocol != __constant_htons(ETH_P_IP))
-+              return NF_ACCEPT;
-+
-+      if ((skb = skb_share_check(*pskb, GFP_ATOMIC)) == NULL)
-+              goto out;
-+
-+      if (!pskb_may_pull(skb, sizeof(struct iphdr)))
-+              goto inhdr_error;
-+
-+      iph = skb->nh.iph;
-+      if (iph->ihl < 5 || iph->version != 4)
-+              goto inhdr_error;
-+
-+      if (!pskb_may_pull(skb, 4*iph->ihl))
-+              goto inhdr_error;
-+
-+      iph = skb->nh.iph;
-+      if (ip_fast_csum((__u8 *)iph, iph->ihl) != 0)
-+              goto inhdr_error;
-+
-+      len = ntohs(iph->tot_len);
-+      if (skb->len < len || len < 4*iph->ihl)
-+              goto inhdr_error;
-+
-+      if (skb->len > len) {
-+              __pskb_trim(skb, len);
-+              if (skb->ip_summed == CHECKSUM_HW)
-+                      skb->ip_summed = CHECKSUM_NONE;
-+      }
-+
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug ^= (1 << NF_IP_PRE_ROUTING);
-+#endif
-+      if ((nf_bridge = nf_bridge_alloc(skb)) == NULL)
-+              return NF_DROP;
-+
-+      if (skb->pkt_type == PACKET_OTHERHOST) {
-+              skb->pkt_type = PACKET_HOST;
-+              nf_bridge->mask |= BRNF_PKT_TYPE;
-+      }
-+
-+      nf_bridge->physindev = skb->dev;
-+      skb->dev = bridge_parent(skb->dev);
-+      store_orig_dstaddr(skb);
-+
-+      NF_HOOK(PF_INET, NF_IP_PRE_ROUTING, skb, skb->dev, NULL,
-+              br_nf_pre_routing_finish);
-+
-+      return NF_STOLEN;
-+
-+inhdr_error:
-+//    IP_INC_STATS_BH(IpInHdrErrors);
-+out:
-+      return NF_DROP;
-+}
-+
-+
-+/* PF_BRIDGE/LOCAL_IN ************************************************/
-+/* The packet is locally destined, which requires a real
-+ * dst_entry, so detach the fake one.  On the way up, the
-+ * packet would pass through PRE_ROUTING again (which already
-+ * took place when the packet entered the bridge), but we
-+ * register an IPv4 PRE_ROUTING 'sabotage' hook that will
-+ * prevent this from happening.
-+ */
-+static unsigned int br_nf_local_in(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   int (*okfn)(struct sk_buff *))
-+{
-+      struct sk_buff *skb = *pskb;
-+
-+      if (skb->protocol != __constant_htons(ETH_P_IP))
-+              return NF_ACCEPT;
-+
-+      if (skb->dst == (struct dst_entry *)&__fake_rtable) {
-+              dst_release(skb->dst);
-+              skb->dst = NULL;
-+      }
-+
-+      return NF_ACCEPT;
-+}
-+
-+
-+/* PF_BRIDGE/FORWARD *************************************************/
-+static int br_nf_forward_finish(struct sk_buff *skb)
-+{
-+      struct nf_bridge_info *nf_bridge = skb->nf_bridge;
-+
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug ^= (1 << NF_BR_FORWARD);
-+#endif
-+
-+      if (nf_bridge->mask & BRNF_PKT_TYPE) {
-+              skb->pkt_type = PACKET_OTHERHOST;
-+              nf_bridge->mask ^= BRNF_PKT_TYPE;
-+      }
-+
-+      NF_HOOK_THRESH(PF_BRIDGE, NF_BR_FORWARD, skb, nf_bridge->physindev,
-+                      skb->dev, br_forward_finish, 1);
-+
-+      return 0;
-+}
-+
-+/* This is the 'purely bridged' case.  We pass the packet to
-+ * netfilter with indev and outdev set to the bridge device,
-+ * but we are still able to filter on the 'real' indev/outdev
-+ * because of the ipt_physdev.c module.
-+ */
-+static unsigned int br_nf_forward(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   int (*okfn)(struct sk_buff *))
-+{
-+      struct sk_buff *skb = *pskb;
-+      struct nf_bridge_info *nf_bridge;
-+
-+      if (skb->protocol != __constant_htons(ETH_P_IP))
-+              return NF_ACCEPT;
-+
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug ^= (1 << NF_BR_FORWARD);
-+#endif
-+
-+      nf_bridge = skb->nf_bridge;
-+      if (skb->pkt_type == PACKET_OTHERHOST) {
-+              skb->pkt_type = PACKET_HOST;
-+              nf_bridge->mask |= BRNF_PKT_TYPE;
-+      }
-+
-+      nf_bridge->mask |= BRNF_BRIDGED; /* The physdev module checks on this */
-+      nf_bridge->physoutdev = skb->dev;
-+
-+      NF_HOOK(PF_INET, NF_IP_FORWARD, skb, bridge_parent(nf_bridge->physindev),
-+                      bridge_parent(skb->dev), br_nf_forward_finish);
-+
-+      return NF_STOLEN;
-+}
-+
-+
-+/* PF_BRIDGE/LOCAL_OUT ***********************************************/
-+static int br_nf_local_out_finish(struct sk_buff *skb)
-+{
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug &= ~(1 << NF_BR_LOCAL_OUT);
-+#endif
-+
-+      NF_HOOK_THRESH(PF_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev,
-+                      br_forward_finish, NF_BR_PRI_FIRST + 1);
-+
-+      return 0;
-+}
-+
-+
-+/* This function sees both locally originated IP packets and forwarded
-+ * IP packets (in both cases the destination device is a bridge
-+ * device). It also sees bridged-and-DNAT'ed packets.
-+ * To be able to filter on the physical bridge devices (with the ipt_physdev.c
-+ * module), we steal packets destined to a bridge device away from the
-+ * PF_INET/FORWARD and PF_INET/OUTPUT hook functions, and give them back later,
-+ * when we have determined the real output device. This is done in here.
-+ *
-+ * If (nf_bridge->mask & BRNF_BRIDGED_DNAT) then the packet is bridged
-+ * and we fake the PF_BRIDGE/FORWARD hook. The function br_nf_forward()
-+ * will then fake the PF_INET/FORWARD hook. br_nf_local_out() has priority
-+ * NF_BR_PRI_FIRST, so no relevant PF_BRIDGE/INPUT functions have been nor
-+ * will be executed.
-+ * Otherwise, if nf_bridge->physindev is NULL, the bridge-nf code never touched
-+ * this packet before, and so the packet was locally originated. We fake
-+ * the PF_INET/LOCAL_OUT hook.
-+ * Finally, if nf_bridge->physindev isn't NULL, then the packet was IP routed,
-+ * so we fake the PF_INET/FORWARD hook. ipv4_sabotage_out() makes sure
-+ * even routed packets that didn't arrive on a bridge interface have their
-+ * nf_bridge->physindev set.
-+ */
-+
-+static unsigned int br_nf_local_out(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   int (*_okfn)(struct sk_buff *))
-+{
-+      int (*okfn)(struct sk_buff *skb);
-+      struct net_device *realindev;
-+      struct sk_buff *skb = *pskb;
-+      struct nf_bridge_info *nf_bridge;
-+
-+      if (skb->protocol != __constant_htons(ETH_P_IP))
-+              return NF_ACCEPT;
-+
-+      /* Sometimes we get packets with NULL ->dst here (for example,
-+       * running a dhcp client daemon triggers this).
-+       */
-+      if (skb->dst == NULL)
-+              return NF_ACCEPT;
-+
-+      nf_bridge = skb->nf_bridge;
-+      nf_bridge->physoutdev = skb->dev;
-+
-+      realindev = nf_bridge->physindev;
-+
-+      /* Bridged, take PF_BRIDGE/FORWARD.
-+       * (see big note in front of br_nf_pre_routing_finish)
-+       */
-+      if (nf_bridge->mask & BRNF_BRIDGED_DNAT) {
-+              okfn = br_forward_finish;
-+
-+              if (nf_bridge->mask & BRNF_PKT_TYPE) {
-+                      skb->pkt_type = PACKET_OTHERHOST;
-+                      nf_bridge->mask ^= BRNF_PKT_TYPE;
-+              }
-+
-+              NF_HOOK(PF_BRIDGE, NF_BR_FORWARD, skb, realindev,
-+                      skb->dev, okfn);
-+      } else {
-+              okfn = br_nf_local_out_finish;
-+              /* IP forwarded traffic has a physindev, locally
-+               * generated traffic hasn't.
-+               */
-+              if (realindev != NULL) {
-+                      if (((nf_bridge->mask & BRNF_DONT_TAKE_PARENT) == 0) &&
-+                          has_bridge_parent(realindev))
-+                              realindev = bridge_parent(realindev);
-+
-+                      NF_HOOK_THRESH(PF_INET, NF_IP_FORWARD, skb, realindev,
-+                                     bridge_parent(skb->dev), okfn,
-+                                     NF_IP_PRI_BRIDGE_SABOTAGE_FORWARD + 1);
-+              } else {
-+#ifdef CONFIG_NETFILTER_DEBUG
-+                      skb->nf_debug ^= (1 << NF_IP_LOCAL_OUT);
-+#endif
-+
-+                      NF_HOOK_THRESH(PF_INET, NF_IP_LOCAL_OUT, skb, realindev,
-+                                     bridge_parent(skb->dev), okfn,
-+                                     NF_IP_PRI_BRIDGE_SABOTAGE_LOCAL_OUT + 1);
-+              }
-+      }
-+
-+      return NF_STOLEN;
-+}
-+
-+
-+/* PF_BRIDGE/POST_ROUTING ********************************************/
-+static unsigned int br_nf_post_routing(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   int (*okfn)(struct sk_buff *))
-+{
-+      struct sk_buff *skb = *pskb;
-+      struct nf_bridge_info *nf_bridge = (*pskb)->nf_bridge;
-+
-+      /* Be very paranoid. Must be a device driver bug. */
-+      if (skb->mac.raw < skb->head || skb->mac.raw + ETH_HLEN > skb->data) {
-+              printk(KERN_CRIT "br_netfilter: Argh!! br_nf_post_routing: "
-+                               "bad mac.raw pointer.");
-+              if (skb->dev != NULL) {
-+                      printk("[%s]", skb->dev->name);
-+                      if (has_bridge_parent(skb->dev))
-+                              printk("[%s]", bridge_parent(skb->dev)->name);
-+              }
-+              printk("\n");
-+              return NF_ACCEPT;
-+      }
-+
-+      if (skb->protocol != __constant_htons(ETH_P_IP))
-+              return NF_ACCEPT;
-+
-+      /* Sometimes we get packets with NULL ->dst here (for example,
-+       * running a dhcp client daemon triggers this).
-+       */
-+      if (skb->dst == NULL)
-+              return NF_ACCEPT;
-+
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug ^= (1 << NF_IP_POST_ROUTING);
-+#endif
-+
-+      /* We assume any code from br_dev_queue_push_xmit onwards doesn't care
-+       * about the value of skb->pkt_type.
-+       */
-+      if (skb->pkt_type == PACKET_OTHERHOST) {
-+              skb->pkt_type = PACKET_HOST;
-+              nf_bridge->mask |= BRNF_PKT_TYPE;
-+      }
-+
-+      memcpy(nf_bridge->hh, skb->data - 16, 16);
-+
-+      NF_HOOK(PF_INET, NF_IP_POST_ROUTING, skb, NULL,
-+              bridge_parent(skb->dev), br_dev_queue_push_xmit);
-+
-+      return NF_STOLEN;
-+}
-+
-+
-+/* IPv4/SABOTAGE *****************************************************/
-+
-+/* Don't hand locally destined packets to PF_INET/PRE_ROUTING
-+ * for the second time.
-+ */
-+static unsigned int ipv4_sabotage_in(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   int (*okfn)(struct sk_buff *))
-+{
-+      if (in->hard_start_xmit == br_dev_xmit &&
-+          okfn != br_nf_pre_routing_finish) {
-+              okfn(*pskb);
-+              return NF_STOLEN;
-+      }
-+
-+      return NF_ACCEPT;
-+}
-+
-+/* Postpone execution of PF_INET/FORWARD, PF_INET/LOCAL_OUT
-+ * and PF_INET/POST_ROUTING until we have done the forwarding
-+ * decision in the bridge code and have determined skb->physoutdev.
-+ */
-+static unsigned int ipv4_sabotage_out(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   int (*okfn)(struct sk_buff *))
-+{
-+      if (out->hard_start_xmit == br_dev_xmit &&
-+          okfn != br_nf_forward_finish &&
-+          okfn != br_nf_local_out_finish &&
-+          okfn != br_dev_queue_push_xmit) {
-+              struct sk_buff *skb = *pskb;
-+              struct nf_bridge_info *nf_bridge;
-+
-+              if (!skb->nf_bridge && !nf_bridge_alloc(skb))
-+                      return NF_DROP;
-+
-+              nf_bridge = skb->nf_bridge;
-+
-+              /* This frame will arrive on PF_BRIDGE/LOCAL_OUT and we
-+               * will need the indev then. For a brouter, the real indev
-+               * can be a bridge port, so we make sure br_nf_local_out()
-+               * doesn't use the bridge parent of the indev by using
-+               * the BRNF_DONT_TAKE_PARENT mask.
-+               */
-+              if (hook == NF_IP_FORWARD && nf_bridge->physindev == NULL) {
-+                      nf_bridge->mask &= BRNF_DONT_TAKE_PARENT;
-+                      nf_bridge->physindev = (struct net_device *)in;
-+              }
-+              okfn(skb);
-+              return NF_STOLEN;
-+      }
-+
-+      return NF_ACCEPT;
-+}
-+
-+/* For br_nf_local_out we need (prio = NF_BR_PRI_FIRST), to insure that innocent
-+ * PF_BRIDGE/NF_BR_LOCAL_OUT functions don't get bridged traffic as input.
-+ * For br_nf_post_routing, we need (prio = NF_BR_PRI_LAST), because
-+ * ip_refrag() can return NF_STOLEN.
-+ */
-+static struct nf_hook_ops br_nf_ops[] = {
-+      { .hook = br_nf_pre_routing,
-+        .pf = PF_BRIDGE,
-+        .hooknum = NF_BR_PRE_ROUTING,
-+        .priority = NF_BR_PRI_BRNF, },
-+      { .hook = br_nf_local_in,
-+        .pf = PF_BRIDGE,
-+        .hooknum = NF_BR_LOCAL_IN,
-+        .priority = NF_BR_PRI_BRNF, },
-+      { .hook = br_nf_forward,
-+        .pf = PF_BRIDGE,
-+        .hooknum = NF_BR_FORWARD,
-+        .priority = NF_BR_PRI_BRNF, },
-+      { .hook = br_nf_local_out,
-+        .pf = PF_BRIDGE,
-+        .hooknum = NF_BR_LOCAL_OUT,
-+        .priority = NF_BR_PRI_FIRST, },
-+      { .hook = br_nf_post_routing,
-+        .pf = PF_BRIDGE,
-+        .hooknum = NF_BR_POST_ROUTING,
-+        .priority = NF_BR_PRI_LAST, },
-+      { .hook = ipv4_sabotage_in,
-+        .pf = PF_INET,
-+        .hooknum = NF_IP_PRE_ROUTING,
-+        .priority = NF_IP_PRI_FIRST, },
-+      { .hook = ipv4_sabotage_out,
-+        .pf = PF_INET,
-+        .hooknum = NF_IP_FORWARD,
-+        .priority = NF_IP_PRI_BRIDGE_SABOTAGE_FORWARD, },
-+      { .hook = ipv4_sabotage_out,
-+        .pf = PF_INET,
-+        .hooknum = NF_IP_LOCAL_OUT,
-+        .priority = NF_IP_PRI_BRIDGE_SABOTAGE_LOCAL_OUT, },
-+      { .hook = ipv4_sabotage_out,
-+        .pf = PF_INET,
-+        .hooknum = NF_IP_POST_ROUTING,
-+        .priority = NF_IP_PRI_FIRST, },
-+};
-+
-+int br_netfilter_init(void)
-+{
-+      int i;
-+
-+      for (i = 0; i < ARRAY_SIZE(br_nf_ops); i++) {
-+              int ret;
-+
-+              if ((ret = nf_register_hook(&br_nf_ops[i])) >= 0)
-+                      continue;
-+
-+              while (i--)
-+                      nf_unregister_hook(&br_nf_ops[i]);
-+
-+              return ret;
-+      }
-+
-+      printk(KERN_NOTICE "Bridge firewalling registered\n");
-+
-+      return 0;
-+}
-+
-+void br_netfilter_fini(void)
-+{
-+      int i;
-+
-+      for (i = ARRAY_SIZE(br_nf_ops) - 1; i >= 0; i--)
-+              nf_unregister_hook(&br_nf_ops[i]);
-+}
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/net/ipv4/netfilter/ipt_physdev.c   Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,127 @@
-+/* Kernel module to match the bridge port in and
-+ * out device for IP packets coming into contact with a bridge. */
-+#include <linux/module.h>
-+#include <linux/skbuff.h>
-+#include <linux/netfilter_ipv4/ipt_physdev.h>
-+#include <linux/netfilter_ipv4/ip_tables.h>
-+#include <linux/netfilter_bridge.h>
-+#include <linux/netdevice.h>
-+#define MATCH   1
-+#define NOMATCH 0
-+
-+static int
-+match(const struct sk_buff *skb,
-+      const struct net_device *in,
-+      const struct net_device *out,
-+      const void *matchinfo,
-+      int offset,
-+      const void *hdr,
-+      u_int16_t datalen,
-+      int *hotdrop)
-+{
-+      int i;
-+      static const char nulldevname[IFNAMSIZ] = { 0 };
-+      const struct ipt_physdev_info *info = matchinfo;
-+      unsigned long ret;
-+      const char *indev, *outdev;
-+      struct nf_bridge_info *nf_bridge;
-+
-+      /* Not a bridged IP packet or no info available yet:
-+       * LOCAL_OUT/mangle and LOCAL_OUT/nat don't know if
-+       * the destination device will be a bridge. */
-+      if (!(nf_bridge = skb->nf_bridge)) {
-+              /* Return MATCH if the invert flags of the used options are on */
-+              if ((info->bitmask & IPT_PHYSDEV_OP_BRIDGED) &&
-+                  !(info->invert & IPT_PHYSDEV_OP_BRIDGED))
-+                      return NOMATCH;
-+              if ((info->bitmask & IPT_PHYSDEV_OP_ISIN) &&
-+                  !(info->invert & IPT_PHYSDEV_OP_ISIN))
-+                      return NOMATCH;
-+              if ((info->bitmask & IPT_PHYSDEV_OP_ISOUT) &&
-+                  !(info->invert & IPT_PHYSDEV_OP_ISOUT))
-+                      return NOMATCH;
-+              if ((info->bitmask & IPT_PHYSDEV_OP_IN) &&
-+                  !(info->invert & IPT_PHYSDEV_OP_IN))
-+                      return NOMATCH;
-+              if ((info->bitmask & IPT_PHYSDEV_OP_OUT) &&
-+                  !(info->invert & IPT_PHYSDEV_OP_OUT))
-+                      return NOMATCH;
-+              return MATCH;
-+      }
-+
-+      /* This only makes sense in the FORWARD and POSTROUTING chains */
-+      if ((info->bitmask & IPT_PHYSDEV_OP_BRIDGED) &&
-+          (!!(nf_bridge->mask & BRNF_BRIDGED) ^
-+          !(info->invert & IPT_PHYSDEV_OP_BRIDGED)))
-+              return NOMATCH;
-+
-+      if ((info->bitmask & IPT_PHYSDEV_OP_ISIN &&
-+          (!nf_bridge->physindev ^ !!(info->invert & IPT_PHYSDEV_OP_ISIN))) ||
-+          (info->bitmask & IPT_PHYSDEV_OP_ISOUT &&
-+          (!nf_bridge->physoutdev ^ !!(info->invert & IPT_PHYSDEV_OP_ISOUT))))
-+              return NOMATCH;
-+
-+      if (!(info->bitmask & IPT_PHYSDEV_OP_IN))
-+              goto match_outdev;
-+      indev = nf_bridge->physindev ? nf_bridge->physindev->name : nulldevname;
-+      for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) {
-+              ret |= (((const unsigned long *)indev)[i]
-+                      ^ ((const unsigned long *)info->physindev)[i])
-+                      & ((const unsigned long *)info->in_mask)[i];
-+      }
-+
-+      if ((ret == 0) ^ !(info->invert & IPT_PHYSDEV_OP_IN))
-+              return NOMATCH;
-+
-+match_outdev:
-+      if (!(info->bitmask & IPT_PHYSDEV_OP_OUT))
-+              return MATCH;
-+      outdev = nf_bridge->physoutdev ?
-+               nf_bridge->physoutdev->name : nulldevname;
-+      for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) {
-+              ret |= (((const unsigned long *)outdev)[i]
-+                      ^ ((const unsigned long *)info->physoutdev)[i])
-+                      & ((const unsigned long *)info->out_mask)[i];
-+      }
-+
-+      return (ret != 0) ^ !(info->invert & IPT_PHYSDEV_OP_OUT);
-+}
-+
-+static int
-+checkentry(const char *tablename,
-+                     const struct ipt_ip *ip,
-+                     void *matchinfo,
-+                     unsigned int matchsize,
-+                     unsigned int hook_mask)
-+{
-+      const struct ipt_physdev_info *info = matchinfo;
-+
-+      if (matchsize != IPT_ALIGN(sizeof(struct ipt_physdev_info)))
-+              return 0;
-+      if (!(info->bitmask & IPT_PHYSDEV_OP_MASK) ||
-+          info->bitmask & ~IPT_PHYSDEV_OP_MASK)
-+              return 0;
-+      return 1;
-+}
-+
-+static struct ipt_match physdev_match = {
-+      .name           = "physdev",
-+      .match          = &match,
-+      .checkentry     = &checkentry,
-+      .me             = THIS_MODULE,
-+};
-+
-+static int __init init(void)
-+{
-+      return ipt_register_match(&physdev_match);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ipt_unregister_match(&physdev_match);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+MODULE_LICENSE("GPL");
-+EXPORT_NO_SYMBOLS;
---- /dev/null  Thu Aug 24 11:00:32 2000
-+++ linux-2.4.21-ebt-brnf-3/include/linux/netfilter_ipv4/ipt_physdev.h Fri Aug  8 01:09:06 2003
-@@ -0,0 +1,24 @@
-+#ifndef _IPT_PHYSDEV_H
-+#define _IPT_PHYSDEV_H
-+
-+#ifdef __KERNEL__
-+#include <linux/if.h>
-+#endif
-+
-+#define IPT_PHYSDEV_OP_IN             0x01
-+#define IPT_PHYSDEV_OP_OUT            0x02
-+#define IPT_PHYSDEV_OP_BRIDGED                0x04
-+#define IPT_PHYSDEV_OP_ISIN           0x08
-+#define IPT_PHYSDEV_OP_ISOUT          0x10
-+#define IPT_PHYSDEV_OP_MASK           (0x20 - 1)
-+
-+struct ipt_physdev_info {
-+      u_int8_t invert;
-+      u_int8_t bitmask;
-+      char physindev[IFNAMSIZ];
-+      char in_mask[IFNAMSIZ];
-+      char physoutdev[IFNAMSIZ];
-+      char out_mask[IFNAMSIZ];
-+};
-+
-+#endif /*_IPT_PHYSDEV_H*/
diff --git a/obsolete-buildroot/sources/openwrt/kernel/patches/150-mppe-mppc-0.98.patch b/obsolete-buildroot/sources/openwrt/kernel/patches/150-mppe-mppc-0.98.patch
deleted file mode 100644 (file)
index 24fad5a..0000000
+++ /dev/null
@@ -1,1884 +0,0 @@
-diff -ruN linux-2.4.21.orig/drivers/net/Config.in linux-2.4.21/drivers/net/Config.in
---- linux-2.4.21.orig/drivers/net/Config.in    2003-06-13 16:51:34.000000000 +0200
-+++ linux-2.4.21/drivers/net/Config.in 2003-07-08 07:27:10.000000000 +0200
-@@ -301,6 +301,7 @@
-    dep_tristate '  PPP support for sync tty ports' CONFIG_PPP_SYNC_TTY $CONFIG_PPP
-    dep_tristate '  PPP Deflate compression' CONFIG_PPP_DEFLATE $CONFIG_PPP
-    dep_tristate '  PPP BSD-Compress compression' CONFIG_PPP_BSDCOMP $CONFIG_PPP
-+   dep_tristate '  Microsoft PPP compression/encryption (MPPC/MPPE)' CONFIG_PPP_MPPE $CONFIG_PPP
-    if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-       dep_tristate '  PPP over Ethernet (EXPERIMENTAL)' CONFIG_PPPOE $CONFIG_PPP
-    fi
-diff -ruN linux-2.4.21.orig/drivers/net/Makefile linux-2.4.21/drivers/net/Makefile
---- linux-2.4.21.orig/drivers/net/Makefile     2003-06-13 16:51:34.000000000 +0200
-+++ linux-2.4.21/drivers/net/Makefile  2003-07-14 23:53:15.000000000 +0200
-@@ -18,8 +18,9 @@
- export-objs     :=    8390.o arlan.o aironet4500_core.o aironet4500_card.o \
-                       ppp_async.o ppp_generic.o slhc.o pppox.o auto_irq.o \
-                       net_init.o mii.o
--list-multi    :=      rcpci.o
-+list-multi    :=      rcpci.o ppp_mppe_mppc.o
- rcpci-objs    :=      rcpci45.o rclanmtl.o
-+ppp_mppe_c-objs       :=      ppp_mppe_mppc_comp.o ppp_mppe_crypto.o
- ifeq ($(CONFIG_TULIP),y)
-   obj-y += tulip/tulip.o
-@@ -149,6 +150,15 @@
- obj-$(CONFIG_PPP_SYNC_TTY) += ppp_synctty.o
- obj-$(CONFIG_PPP_DEFLATE) += ppp_deflate.o
- obj-$(CONFIG_PPP_BSDCOMP) += bsd_comp.o
-+
-+ifeq ($(CONFIG_PPP_MPPE),y)
-+  obj-y += $(ppp_mppe_c-objs)
-+else
-+  ifeq ($(CONFIG_PPP_MPPE),m)
-+    obj-m += ppp_mppe_mppc.o
-+  endif
-+endif
-+
- obj-$(CONFIG_PPPOE) += pppox.o pppoe.o
- obj-$(CONFIG_SLIP) += slip.o
-@@ -258,3 +268,5 @@
- rcpci.o: $(rcpci-objs)
-       $(LD) -r -o $@ $(rcpci-objs)
-+ppp_mppe_mppc.o: $(ppp_mppe_c-objs)
-+      $(LD) -r -o $@ $(ppp_mppe_c-objs)
-diff -ruN linux-2.4.21.orig/drivers/net/ppp_generic.c linux-2.4.21/drivers/net/ppp_generic.c
---- linux-2.4.21.orig/drivers/net/ppp_generic.c        2003-06-13 16:51:35.000000000 +0200
-+++ linux-2.4.21/drivers/net/ppp_generic.c     2003-07-12 04:39:03.000000000 +0200
-@@ -19,7 +19,7 @@
-  * PPP driver, written by Michael Callahan and Al Longyear, and
-  * subsequently hacked by Paul Mackerras.
-  *
-- * ==FILEVERSION 20020217==
-+ * ==FILEVERSION 20030706==
-  */
- #include <linux/config.h>
-@@ -102,6 +102,7 @@
-       spinlock_t      rlock;          /* lock for receive side 58 */
-       spinlock_t      wlock;          /* lock for transmit side 5c */
-       int             mru;            /* max receive unit 60 */
-+      int             mru_alloc;      /* MAX(1500,MRU) for dev_alloc_skb() */
-       unsigned int    flags;          /* control bits 64 */
-       unsigned int    xstate;         /* transmit state bits 68 */
-       unsigned int    rstate;         /* receive state bits 6c */
-@@ -129,6 +130,7 @@
-       struct sock_fprog pass_filter;  /* filter for packets to pass */
-       struct sock_fprog active_filter;/* filter for pkts to reset idle */
- #endif /* CONFIG_PPP_FILTER */
-+      int             xpad;           /* ECP or CCP (MPPE) transmit padding */
- };
- /*
-@@ -552,7 +554,9 @@
-       case PPPIOCSMRU:
-               if (get_user(val, (int *) arg))
-                       break;
--              ppp->mru = val;
-+              ppp->mru_alloc = ppp->mru = val;
-+              if (ppp->mru_alloc < PPP_MRU)
-+                  ppp->mru_alloc = PPP_MRU;   /* increase for broken peers */
-               err = 0;
-               break;
-@@ -1023,14 +1027,35 @@
-       case PPP_CCP:
-               /* peek at outbound CCP frames */
-               ppp_ccp_peek(ppp, skb, 0);
-+              /*
-+               * When LZS or MPPE/MPPC is negotiated we don't send
-+               * CCP_RESETACK after receiving CCP_RESETREQ; in fact pppd
-+               * sends such a packet but we silently discard it here
-+               */
-+              if (CCP_CODE(skb->data+2) == CCP_RESETACK
-+                  && (ppp->xcomp->compress_proto == CI_MPPE
-+                      || ppp->xcomp->compress_proto == CI_LZS)) {
-+                  --ppp->stats.tx_packets;
-+                  ppp->stats.tx_bytes -= skb->len - 2;
-+                  kfree_skb(skb);
-+                  return;
-+              }
-               break;
-       }
-       /* try to do packet compression */
-       if ((ppp->xstate & SC_COMP_RUN) && ppp->xc_state != 0
-           && proto != PPP_LCP && proto != PPP_CCP) {
--              new_skb = alloc_skb(ppp->dev->mtu + ppp->dev->hard_header_len,
--                                  GFP_ATOMIC);
-+              int comp_ovhd = 0;
-+              /* because of possible data expansion when MPPC or LZS
-+                 is used, allocate compressor's buffer about 12.5% bigger
-+                 than MTU */
-+              if (ppp->xcomp->compress_proto == CI_MPPE)
-+                  comp_ovhd = (((ppp->dev->mtu * 9) / 8) + 1);
-+              else if (ppp->xcomp->compress_proto == CI_LZS)
-+                  comp_ovhd = (((ppp->dev->mtu * 9) / 8) + 1) + LZS_OVHD;
-+              new_skb = alloc_skb(ppp->dev->mtu + ppp->dev->hard_header_len
-+                                  + ppp->xpad + comp_ovhd, GFP_ATOMIC);
-               if (new_skb == 0) {
-                       printk(KERN_ERR "PPP: no memory (comp pkt)\n");
-                       goto drop;
-@@ -1042,15 +1067,28 @@
-               /* compressor still expects A/C bytes in hdr */
-               len = ppp->xcomp->compress(ppp->xc_state, skb->data - 2,
-                                          new_skb->data, skb->len + 2,
--                                         ppp->dev->mtu + PPP_HDRLEN);
-+                                         ppp->dev->mtu + ppp->xpad
-+                                         + PPP_HDRLEN);
-               if (len > 0 && (ppp->flags & SC_CCP_UP)) {
-                       kfree_skb(skb);
-                       skb = new_skb;
-                       skb_put(skb, len);
-                       skb_pull(skb, 2);       /* pull off A/C bytes */
--              } else {
-+              } else if (len == 0) {
-                       /* didn't compress, or CCP not up yet */
-                       kfree_skb(new_skb);
-+              } else {
-+                      /*
-+                       * (len < 0)
-+                       * MPPE requires that we do not send unencrypted
-+                       * frames.  The compressor will return -1 if we
-+                       * should drop the frame.  We cannot simply test
-+                       * the compress_proto because MPPE and MPPC share
-+                       * the same number.
-+                       */
-+                      printk(KERN_ERR "ppp: compressor dropped pkt\n");
-+                      kfree_skb(new_skb);
-+                      goto drop;
-               }
-       }
-@@ -1538,14 +1576,15 @@
-       int len;
-       if (proto == PPP_COMP) {
--              ns = dev_alloc_skb(ppp->mru + PPP_HDRLEN);
-+              ns = dev_alloc_skb(ppp->mru_alloc + PPP_HDRLEN);
-               if (ns == 0) {
-                       printk(KERN_ERR "ppp_decompress_frame: no memory\n");
-                       goto err;
-               }
-               /* the decompressor still expects the A/C bytes in the hdr */
-               len = ppp->rcomp->decompress(ppp->rc_state, skb->data - 2,
--                              skb->len + 2, ns->data, ppp->mru + PPP_HDRLEN);
-+                              skb->len + 2, ns->data,
-+                              ppp->mru_alloc + PPP_HDRLEN);
-               if (len < 0) {
-                       /* Pass the compressed frame to pppd as an
-                          error indication. */
-@@ -1571,7 +1610,12 @@
-       return skb;
-  err:
--      ppp->rstate |= SC_DC_ERROR;
-+      if (ppp->rcomp->compress_proto != CI_MPPE
-+          && ppp->rcomp->compress_proto != CI_LZS) {
-+          /* If decompression protocol isn't MPPE/MPPC or LZS, we set
-+           SC_DC_ERROR flag and wait for CCP_RESETACK */
-+          ppp->rstate |= SC_DC_ERROR;
-+      }
-       ppp_receive_error(ppp);
-       return skb;
- }
-@@ -1980,6 +2024,20 @@
-                               ocomp->comp_free(ostate);
-                       err = 0;
-               }
-+              if (ccp_option[0] == CI_MPPE)
-+                      /*
-+                       * pppd (userland) has reduced the MTU by MPPE_PAD,
-+                       * to accomodate "compressor" growth.  We must
-+                       * increase the space allocated for compressor
-+                       * output in ppp_send_frame() accordingly.  Note
-+                       * that from a purist's view, it may be more correct
-+                       * to require multilink and fragment large packets,
-+                       * but that seems inefficient compared to this
-+                       * little trick.
-+                       */
-+                      ppp->xpad = MPPE_PAD;
-+              else
-+                      ppp->xpad = 0;
-       } else {
-               state = cp->decomp_alloc(ccp_option, data.length);
-@@ -2251,6 +2309,7 @@
-       /* Initialize the new ppp unit */
-       ppp->file.index = unit;
-       ppp->mru = PPP_MRU;
-+      ppp->mru_alloc = PPP_MRU;
-       init_ppp_file(&ppp->file, INTERFACE);
-       ppp->file.hdrlen = PPP_HDRLEN - 2;      /* don't count proto bytes */
-       for (i = 0; i < NUM_NP; ++i)
-diff -ruN linux-2.4.21.orig/drivers/net/ppp_mppe_crypto.c linux-2.4.21/drivers/net/ppp_mppe_crypto.c
---- linux-2.4.21.orig/drivers/net/ppp_mppe_crypto.c    1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.21/drivers/net/ppp_mppe_crypto.c 2003-07-08 19:07:18.000000000 +0200
-@@ -0,0 +1,257 @@
-+/*
-+ * ppp_mppe_crypto.c - cryptografic funtions for MPPE
-+ *
-+ *  This code is Public Domain. Please see comments below.
-+ *
-+ *  I have just put SHA1 and ARCFOUR implementations into one file
-+ *  in order to not pollute kernel namespace. 
-+ *
-+ *  Jan Dubiec <jdx@slackware.pl>, 2003-07-08
-+ */
-+
-+/*
-+ * ftp://ftp.funet.fi/pub/crypt/hash/sha/sha1.c
-+ * 
-+ * SHA-1 in C
-+ * By Steve Reid <steve@edmweb.com>
-+ * 100% Public Domain
-+ * 
-+ * Test Vectors (from FIPS PUB 180-1)
-+ * "abc"
-+ * A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D
-+ * "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
-+ * 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1
-+ * A million repetitions of "a"
-+ * 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
-+ */
-+
-+/* #define SHA1HANDSOFF * Copies data before messing with it. */
-+
-+#if defined(__linux__)
-+#include <asm/byteorder.h>
-+#include <linux/string.h>
-+#elif defined(__solaris__)
-+#include <sys/isa_defs.h>
-+#include <sys/ddi.h>
-+#include <sys/sunddi.h>
-+#define memcpy(d, s, c) bcopy(s, d, c)
-+#define memset(d, b, c) bzero(d, c)
-+#endif
-+
-+#include "ppp_mppe_crypto.h"
-+
-+static void SHA1_Transform(unsigned long[5], const unsigned char[64]);
-+
-+#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
-+
-+/* blk0() and blk() perform the initial expand. */
-+/* I got the idea of expanding during the round function from SSLeay */
-+#if defined(__LITTLE_ENDIAN) || defined(_LITTLE_ENDIAN)
-+#define blk0(i) (block->l[i] = (rol(block->l[i],24)&0xFF00FF00) \
-+    |(rol(block->l[i],8)&0x00FF00FF))
-+#elif defined(__BIG_ENDIAN) || defined(_BIG_ENDIAN)
-+#define blk0(i) block->l[i]
-+#else
-+#error Endianness not defined
-+#endif
-+#define blk(i) (block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \
-+    ^block->l[(i+2)&15]^block->l[i&15],1))
-+
-+/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */
-+#define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30);
-+#define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30);
-+#define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30);
-+#define R3(v,w,x,y,z,i) z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30);
-+#define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30);
-+
-+/* Hash a single 512-bit block. This is the core of the algorithm. */
-+static void
-+SHA1_Transform(unsigned long state[5], const unsigned char buffer[64])
-+{
-+    unsigned long a, b, c, d, e;
-+    typedef union {
-+      unsigned char c[64];
-+      unsigned long l[16];
-+    } CHAR64LONG16;
-+    CHAR64LONG16 *block;
-+
-+#ifdef SHA1HANDSOFF
-+    static unsigned char workspace[64];
-+    block = (CHAR64LONG16 *) workspace;
-+    memcpy(block, buffer, 64);
-+#else
-+    block = (CHAR64LONG16 *) buffer;
-+#endif
-+    /* Copy context->state[] to working vars */
-+    a = state[0];
-+    b = state[1];
-+    c = state[2];
-+    d = state[3];
-+    e = state[4];
-+    /* 4 rounds of 20 operations each. Loop unrolled. */
-+    R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3);
-+    R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7);
-+    R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11);
-+    R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15);
-+    R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19);
-+    R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23);
-+    R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27);
-+    R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31);
-+    R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35);
-+    R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39);
-+    R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43);
-+    R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47);
-+    R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51);
-+    R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55);
-+    R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59);
-+    R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63);
-+    R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67);
-+    R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71);
-+    R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75);
-+    R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79);
-+    /* Add the working vars back into context.state[] */
-+    state[0] += a;
-+    state[1] += b;
-+    state[2] += c;
-+    state[3] += d;
-+    state[4] += e;
-+    /* Wipe variables */
-+    a = b = c = d = e = 0;
-+}
-+
-+/* SHA1Init - Initialize new context */
-+void
-+SHA1_Init(SHA1_CTX *context)
-+{
-+    /* SHA1 initialization constants */
-+    context->state[0] = 0x67452301;
-+    context->state[1] = 0xEFCDAB89;
-+    context->state[2] = 0x98BADCFE;
-+    context->state[3] = 0x10325476;
-+    context->state[4] = 0xC3D2E1F0;
-+    context->count[0] = context->count[1] = 0;
-+}
-+
-+/* Run your data through this. */
-+void
-+SHA1_Update(SHA1_CTX *context, const unsigned char *data, unsigned int len)
-+{
-+    unsigned int i, j;
-+
-+    j = (context->count[0] >> 3) & 63;
-+    if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++;
-+    context->count[1] += (len >> 29);
-+    if ((j + len) > 63) {
-+      memcpy(&context->buffer[j], data, (i = 64-j));
-+      SHA1_Transform(context->state, context->buffer);
-+      for ( ; i + 63 < len; i += 64) {
-+          SHA1_Transform(context->state, &data[i]);
-+      }
-+      j = 0;
-+    }
-+    else
-+      i = 0;
-+
-+    memcpy(&context->buffer[j], &data[i], len - i);
-+}
-+
-+/* Add padding and return the message digest. */
-+void
-+SHA1_Final(unsigned char digest[20], SHA1_CTX *context)
-+{
-+    unsigned long i, j;
-+    unsigned char finalcount[8];
-+
-+    for (i = 0; i < 8; i++) {
-+        finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)]
-+         >> ((3-(i & 3)) * 8) ) & 255);  /* Endian independent */
-+    }
-+    SHA1_Update(context, (unsigned char *) "\200", 1);
-+    while ((context->count[0] & 504) != 448) {
-+      SHA1_Update(context, (unsigned char *) "\0", 1);
-+    }
-+    SHA1_Update(context, finalcount, 8);  /* Should cause a SHA1Transform() */
-+    for (i = 0; i < 20; i++) {
-+      digest[i] = (unsigned char)
-+                   ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);
-+    }
-+    /* Wipe variables */
-+    i = j = 0;
-+    memset(context->buffer, 0, 64);
-+    memset(context->state, 0, 20);
-+    memset(context->count, 0, 8);
-+    memset(&finalcount, 0, 8);
-+#ifdef SHA1HANDSOFF  /* make SHA1Transform overwrite it's own static vars */
-+    SHA1Transform(context->state, context->buffer);
-+#endif
-+}
-+
-+/*
-+ * arcfour.c
-+ * by Frank Cusack <frank@google.com>
-+ * 100% public domain
-+ *
-+ * Implemented from the description in _Applied Cryptography_, 2nd ed.
-+ *
-+ * ** Distribution ** of this software is unlimited and unrestricted.
-+ *
-+ * ** Use ** of this software is almost certainly legal; however, refer
-+ * to <http://theory.lcs.mit.edu/~rivest/faq.html>.
-+ */
-+
-+#define swap(a, b)            \
-+{                             \
-+    unsigned char t = b;      \
-+    b = a;                    \
-+    a = t;                    \
-+}
-+
-+/*
-+ * Initialize arcfour from a key.
-+ */
-+void
-+arcfour_setkey(arcfour_context *context, const unsigned char *key,
-+             unsigned keylen)
-+{
-+    unsigned i, j;
-+    unsigned char K[256];
-+
-+    context->i = context->j = 0;
-+
-+    for (i = 0; i < 256; i++) {
-+      context->S[i] = i;
-+      K[i] = key[i % keylen];
-+    }
-+
-+    j = 0;
-+    for (i = 0; i < 256; i++) {
-+      j = (j + context->S[i] + K[i]) % 256;
-+      swap(context->S[i], context->S[j]);
-+    }
-+
-+    memset(K, 0, sizeof(K));
-+}
-+
-+/*
-+ * plaintext -> ciphertext (or vice versa)
-+ */
-+void
-+arcfour_encrypt(arcfour_context *context, const unsigned char *in, unsigned len,
-+              unsigned char *out)
-+{
-+    unsigned i = context->i;
-+    unsigned j = context->j;
-+    unsigned char *S = context->S;
-+    unsigned char K;
-+
-+    while (len--) {
-+      i = (i + 1) % 256;
-+      j = (j + S[i]) % 256;
-+      swap(S[i], S[j]);
-+      K = S[(S[i] + S[j]) % 256];
-+      *out++ = *in++ ^ K;
-+    }
-+
-+    context->i = i;
-+    context->j = j;
-+}
-diff -ruN linux-2.4.21.orig/drivers/net/ppp_mppe_crypto.h linux-2.4.21/drivers/net/ppp_mppe_crypto.h
---- linux-2.4.21.orig/drivers/net/ppp_mppe_crypto.h    1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.21/drivers/net/ppp_mppe_crypto.h 2003-07-08 19:07:25.000000000 +0200
-@@ -0,0 +1,40 @@
-+/*
-+ * ppp_mppe_crypto.h - cryptografic funtion prototypes for MPPE
-+ *
-+ *  This code is Public Domain. Please see comments below.
-+ *
-+ *  I have just put SHA1 and ARCFOUR declarations into one file
-+ *  in order to not pollute kernel namespace. 
-+ *
-+ *  Jan Dubiec <jdx@slackware.pl>, 2003-07-08
-+ */
-+
-+#ifndef _PPP_MPPE_CRYPTO_
-+#define _PPP_MPPE_CRYPTO_
-+
-+/* SHA1 definitions and prototypes */
-+typedef struct {
-+    unsigned long state[5];
-+    unsigned long count[2];
-+    unsigned char buffer[64];
-+} SHA1_CTX;
-+
-+#define SHA1_SIGNATURE_SIZE 20
-+
-+extern void SHA1_Init(SHA1_CTX *);
-+extern void SHA1_Update(SHA1_CTX *, const unsigned char *, unsigned int);
-+extern void SHA1_Final(unsigned char[SHA1_SIGNATURE_SIZE], SHA1_CTX *);
-+
-+/* ARCFOUR (aka RC4) definitions and prototypes */
-+typedef struct {
-+    unsigned i;
-+    unsigned j;
-+    unsigned char S[256];
-+} arcfour_context;
-+
-+extern void arcfour_setkey(arcfour_context *, const unsigned char *, unsigned);
-+extern void arcfour_encrypt(arcfour_context *, const unsigned char *, unsigned,
-+                          unsigned char *);
-+#define arcfour_decrypt arcfour_encrypt
-+
-+#endif /* _PPP_MPPE_CRYPTO_ */
-diff -ruN linux-2.4.21.orig/drivers/net/ppp_mppe_mppc_comp.c linux-2.4.21/drivers/net/ppp_mppe_mppc_comp.c
---- linux-2.4.21.orig/drivers/net/ppp_mppe_mppc_comp.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.21/drivers/net/ppp_mppe_mppc_comp.c      2003-08-07 22:36:59.000000000 +0200
-@@ -0,0 +1,1144 @@
-+/*
-+ * ppp_mppe_mppc_comp.c - MPPC/MPPE "compressor/decompressor" module.
-+ *
-+ * Copyright (c) 1994 Árpád Magosányi <mag@bunuel.tii.matav.hu>
-+ * Copyright (c) 1999 Tim Hockin, Cobalt Networks Inc. <thockin@cobaltnet.com>
-+ * Copyright (c) 2002, 2003 Jan Dubiec <jdx@slackware.pl>
-+ * 
-+ * Permission to use, copy, modify, and distribute this software and its
-+ * documentation is hereby granted, provided that the above copyright
-+ * notice appears in all copies. This software is provided without any
-+ * warranty, express or implied.
-+ *
-+ * The code is based on MPPE kernel module written by Árpád Magosányi and
-+ * Tim Hockin which can be found on http://planetmirror.com/pub/mppe/.
-+ * I have added MPPC and 56 bit session keys support in MPPE.
-+ *
-+ * WARNING! Although this is open source code, its usage in some countries
-+ * (in particular in the USA) may violate Stac Inc. patent for MPPC.
-+ *
-+ * Compile command:
-+ * gcc -O2 -Wall -I/usr/src/linux/include -D__KERNEL__ -DMODULE -c ppp_mppe_mppc_comp.c
-+ *
-+ *  ==FILEVERSION 20030807==
-+ *
-+ */
-+
-+#include <linux/module.h>
-+#include <linux/slab.h>
-+#include <linux/vmalloc.h>
-+#include <linux/init.h>
-+
-+#include <linux/ppp_defs.h>
-+#include <linux/ppp-comp.h>
-+
-+#include "ppp_mppe_crypto.h"
-+
-+/*
-+ * State for a mppc/mppe "(de)compressor".
-+ */
-+struct ppp_mppe_state {
-+    arcfour_context arcfour_context;
-+    u8                master_key[MPPE_MAX_KEY_LEN];
-+    u8                session_key[MPPE_MAX_KEY_LEN];
-+    u8                mppc;           /* do we use compression (MPPC)? */
-+    u8                mppe;           /* do we use encryption (MPPE)? */
-+    u8                keylen;         /* key length in bytes */
-+    u8                bitkeylen;      /* key length in bits */
-+    u16               ccount;         /* coherency counter */
-+    u16               bits;           /* MPPC/MPPE control bits */
-+    u8                stateless;      /* do we use stateless mode? */
-+    u8                nextflushed;    /* set A bit in the next outgoing packet;
-+                                 used only by compressor*/
-+    u8                flushexpected;  /* drop packets until A bit is received;
-+                                 used only by decompressor*/
-+    u8                *hist;          /* MPPC history */
-+    u16               *hash;          /* Hash table; used only by compressor */
-+    u16               histptr;        /* history "cursor" */
-+    int               unit;
-+    int               debug;
-+    int               mru;
-+    struct compstat stats;
-+};
-+
-+#define MPPE_OVHD             2       /* MPPE overhead */
-+#define MPPE_HIST_LEN         8192    /* MPPC history size */
-+#define MPPE_MAX_CCOUNT               0x0FFF  /* max. coherency counter value */
-+
-+#define MPPE_BIT_FLUSHED      0x80    /* bit A */
-+#define MPPE_BIT_RESET                0x40    /* bit B */
-+#define MPPE_BIT_COMP         0x20    /* bit C */
-+#define MPPE_BIT_ENCRYPTED    0x10    /* bit D */
-+
-+#define MPPE_SALT0            0xD1    /* values used in MPPE key derivation */
-+#define MPPE_SALT1            0x26    /* according to RFC3079 */
-+#define MPPE_SALT2            0x9E
-+
-+#define MPPE_CCOUNT(x)                ((((x)[4] & 0x0f) << 8) + (x)[5])
-+#define MPPE_BITS(x)          ((x)[4] & 0xf0)
-+#define MPPE_CTRLHI(x)                ((((x)->ccount & 0xf00)>>8)|((x)->bits))
-+#define MPPE_CTRLLO(x)                ((x)->ccount & 0xff)
-+
-+/*
-+ * Key Derivation, from RFC 3078, RFC 3079.
-+ * Equivalent to Get_Key() for MS-CHAP as described in RFC 3079.
-+ */
-+static void
-+GetNewKeyFromSHA(unsigned char *MasterKey, unsigned char *SessionKey,
-+               unsigned long SessionKeyLength, unsigned char *InterimKey)
-+{
-+    /*Pads used in key derivation */
-+    static unsigned char  SHAPad1[40] =
-+    { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-+      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-+      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-+      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
-+
-+    static unsigned char  SHAPad2[40] =
-+    { 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2,
-+      0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2,
-+      0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2,
-+      0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2, 0xF2 };
-+
-+    SHA1_CTX Context;
-+    unsigned char Digest[SHA1_SIGNATURE_SIZE];
-+
-+    SHA1_Init(&Context);
-+    SHA1_Update(&Context, MasterKey, SessionKeyLength);
-+    SHA1_Update(&Context, SHAPad1, sizeof(SHAPad1));
-+    SHA1_Update(&Context, SessionKey, SessionKeyLength);
-+    SHA1_Update(&Context, SHAPad2, sizeof(SHAPad2));
-+    SHA1_Final(Digest,&Context);
-+    memcpy(InterimKey, Digest, SessionKeyLength);
-+}
-+
-+static void
-+mppe_change_key(struct ppp_mppe_state *state, int initialize)
-+{
-+    unsigned char InterimKey[MPPE_MAX_KEY_LEN];
-+
-+    GetNewKeyFromSHA(state->master_key, state->session_key,
-+                   state->keylen, InterimKey);
-+    if (initialize) {
-+      memcpy(state->session_key, InterimKey, state->keylen);
-+    } else {
-+      arcfour_setkey(&state->arcfour_context, InterimKey, state->keylen);
-+      arcfour_encrypt(&state->arcfour_context, InterimKey, state->keylen,
-+                      state->session_key);
-+    }
-+    if (state->keylen == 8) {
-+      if (state->bitkeylen == 40) {
-+          state->session_key[0] = MPPE_SALT0;
-+          state->session_key[1] = MPPE_SALT1;
-+          state->session_key[2] = MPPE_SALT2;
-+      } else {
-+          state->session_key[0] = MPPE_SALT0;
-+      }
-+    }
-+    arcfour_setkey(&state->arcfour_context, state->session_key, state->keylen);
-+}
-+
-+/* increase 12-bit coherency counter */
-+static inline void
-+mppe_increase_ccount(struct ppp_mppe_state *state)
-+{
-+    state->ccount = (state->ccount + 1) & MPPE_MAX_CCOUNT;
-+    if (state->mppe) {
-+      if (state->stateless) {
-+          mppe_change_key(state, 0);
-+          state->nextflushed = 1;
-+      } else {
-+          if ((state->ccount & 0xff) == 0xff) {
-+              mppe_change_key(state, 0);
-+              state->nextflushed = 1;
-+          }
-+      }
-+    }
-+}
-+
-+/* allocate space for a MPPE/MPPC (de)compressor.  */
-+/*   comp != 0 -> init compressor */
-+/*   comp = 0 -> init decompressor */
-+static void *
-+mppe_alloc(unsigned char *options, int opt_len, int comp)
-+{
-+    struct ppp_mppe_state *state;
-+    u8* fname;
-+
-+    fname = comp ? "mppe_comp_alloc" : "mppe_decomp_alloc";
-+
-+    /*  
-+      Hack warning - additionally to the standard MPPC/MPPE configuration
-+      options, pppd passes to the (de)copressor 8 or 16 byte session key.
-+      Therefore options[1] contains MPPC/MPPE configuration option length
-+      (CILEN_MPPE = 6), but the real options length, depending on the key
-+      length, is 6+8 or 6+16.
-+    */
-+    if (opt_len < CILEN_MPPE) {
-+      printk(KERN_WARNING "%s: wrong options length: %u\n", fname, opt_len);
-+      return NULL;
-+    }
-+
-+    if (options[0] != CI_MPPE || options[1] != CILEN_MPPE ||
-+      (options[2] & ~MPPE_STATELESS) != 0 ||
-+      options[3] != 0 || options[4] != 0 ||
-+      (options[5] & ~(MPPE_128BIT|MPPE_56BIT|MPPE_40BIT|MPPE_MPPC)) != 0 ||
-+      (options[5] & (MPPE_128BIT|MPPE_56BIT|MPPE_40BIT|MPPE_MPPC)) == 0) {
-+      printk(KERN_WARNING "%s: options rejected: o[0]=%02x, o[1]=%02x, "
-+             "o[2]=%02x, o[3]=%02x, o[4]=%02x, o[5]=%02x\n", fname, options[0],
-+             options[1], options[2], options[3], options[4], options[5]);
-+      return NULL;
-+    }
-+
-+    state = (struct ppp_mppe_state *)kmalloc(sizeof(*state), GFP_KERNEL);
-+    if (state == NULL) {
-+      printk(KERN_ERR "%s: cannot allocate space for %scompressor\n", fname,
-+             comp ? "" : "de");
-+      return NULL;
-+    }
-+    memset(state, 0, sizeof(struct ppp_mppe_state));
-+
-+    state->mppc = options[5] & MPPE_MPPC;     /* Do we use MPPC? */
-+    state->mppe = options[5] & (MPPE_128BIT | MPPE_56BIT |
-+      MPPE_40BIT);                            /* Do we use MPPE? */
-+
-+    if (state->mppc) {
-+      /* allocate MPPC history */
-+      state->hist = (u8*)vmalloc(2*MPPE_HIST_LEN*sizeof(u8));
-+      if (state->hist == NULL) {
-+          kfree(state);
-+          printk(KERN_ERR "%s: cannot allocate space for MPPC history\n",
-+                 fname);
-+          return NULL;
-+      }
-+
-+      /* allocate hashtable for MPPC compressor */
-+      if (comp) {
-+          state->hash = (u16*)vmalloc(MPPE_HIST_LEN*sizeof(u16));
-+          if (state->hash == NULL) {
-+              vfree(state->hist);
-+              kfree(state);
-+              printk(KERN_ERR "%s: cannot allocate space for MPPC history\n",
-+                     fname);
-+              return NULL;
-+          }
-+      }
-+    }
-+
-+    MOD_INC_USE_COUNT;
-+
-+    if (state->mppe) { /* specific for MPPE */
-+      memcpy(state->master_key, options+CILEN_MPPE, MPPE_MAX_KEY_LEN);
-+      memcpy(state->session_key, state->master_key, MPPE_MAX_KEY_LEN);
-+      /* initial key generation is done in mppe_init() */
-+    }
-+
-+    return (void *) state;
-+}
-+
-+static void *
-+mppe_comp_alloc(unsigned char *options, int opt_len)
-+{
-+    return mppe_alloc(options, opt_len, 1);
-+}
-+
-+static void *
-+mppe_decomp_alloc(unsigned char *options, int opt_len)
-+{
-+    return mppe_alloc(options, opt_len, 0);
-+}
-+
-+/* cleanup the (de)compressor */
-+static void
-+mppe_comp_free(void *arg)
-+{
-+    struct ppp_mppe_state *state = (struct ppp_mppe_state *) arg;
-+
-+    if (state != NULL) {
-+      if (state->hist != NULL)
-+          vfree(state->hist);
-+      if (state->hash != NULL)
-+          vfree(state->hash);
-+      kfree(state);
-+    }
-+    MOD_DEC_USE_COUNT;
-+}
-+
-+/* init MPPC/MPPE (de)compresor */
-+/*   comp != 0 -> init compressor */
-+/*   comp = 0 -> init decompressor */
-+static int
-+mppe_init(void *arg, unsigned char *options, int opt_len, int unit,
-+        int hdrlen, int mru, int debug, int comp)
-+{
-+    struct ppp_mppe_state *state = (struct ppp_mppe_state *) arg;
-+    u8* fname;
-+
-+    fname = comp ? "mppe_comp_init" : "mppe_decomp_init";
-+
-+    if (opt_len < CILEN_MPPE) {
-+      if (debug)
-+          printk(KERN_WARNING "%s: wrong options length: %u\n",
-+                 fname, opt_len);
-+      return 0;
-+    }
-+
-+    if (options[0] != CI_MPPE || options[1] != CILEN_MPPE ||
-+      (options[2] & ~MPPE_STATELESS) != 0 ||
-+      options[3] != 0 || options[4] != 0 ||
-+      (options[5] & ~(MPPE_56BIT|MPPE_128BIT|MPPE_40BIT|MPPE_MPPC)) != 0 ||
-+      (options[5] & (MPPE_56BIT|MPPE_128BIT|MPPE_40BIT|MPPE_MPPC)) == 0) {
-+      if (debug)
-+          printk(KERN_WARNING "%s: options rejected: o[0]=%02x, o[1]=%02x, "
-+                 "o[2]=%02x, o[3]=%02x, o[4]=%02x, o[5]=%02x\n", fname,
-+                 options[0], options[1], options[2], options[3], options[4],
-+                 options[5]);
-+      return 0;
-+    }
-+
-+    if ((options[5] & ~MPPE_MPPC) != MPPE_128BIT &&
-+      (options[5] & ~MPPE_MPPC) != MPPE_56BIT &&
-+      (options[5] & ~MPPE_MPPC) != MPPE_40BIT &&
-+      (options[5] & MPPE_MPPC) != MPPE_MPPC) {
-+      if (debug)
-+          printk(KERN_WARNING "%s: don't know what to do: o[5]=%02x\n",
-+                 fname, options[5]);
-+      return 0;
-+    }
-+
-+    state->mppc = options[5] & MPPE_MPPC;     /* Do we use MPPC? */
-+    state->mppe = options[5] & (MPPE_128BIT | MPPE_56BIT |
-+      MPPE_40BIT);                            /* Do we use MPPE? */
-+    state->stateless = options[2] & MPPE_STATELESS; /* Do we use stateless mode? */
-+
-+    switch (state->mppe) {
-+    case MPPE_40BIT:     /* 40 bit key */
-+      state->keylen = 8;
-+      state->bitkeylen = 40;
-+      break;
-+    case MPPE_56BIT:     /* 56 bit key */
-+      state->keylen = 8;
-+      state->bitkeylen = 56;
-+      break;
-+    case MPPE_128BIT:     /* 128 bit key */
-+      state->keylen = 16;
-+      state->bitkeylen = 128;
-+      break;
-+    default:
-+      state->keylen = 0;
-+      state->bitkeylen = 0;
-+    }
-+
-+    state->ccount = MPPE_MAX_CCOUNT;
-+    state->bits = 0;
-+    state->unit  = unit;
-+    state->debug = debug;
-+    state->histptr = MPPE_HIST_LEN;
-+    if (state->mppc) {        /* reset history if MPPC was negotiated */
-+      memset(state->hist, 0, 2*MPPE_HIST_LEN*sizeof(u8));
-+    }
-+
-+    if (state->mppe) { /* generate initial session keys */
-+      mppe_change_key(state, 1);
-+    }
-+
-+    if (comp) { /* specific for compressor */
-+      state->nextflushed = 1;
-+    } else { /* specific for decompressor */
-+      state->mru = mru;
-+      state->flushexpected = 1;
-+    }
-+
-+    return 1;
-+}
-+
-+static int
-+mppe_comp_init(void *arg, unsigned char *options, int opt_len, int unit,
-+             int hdrlen, int debug)
-+{
-+    return mppe_init(arg, options, opt_len, unit, hdrlen, 0, debug, 1);
-+}
-+
-+
-+static int
-+mppe_decomp_init(void *arg, unsigned char *options, int opt_len, int unit,
-+               int hdrlen, int mru, int debug)
-+{
-+    return mppe_init(arg, options, opt_len, unit, hdrlen, mru, debug, 0);
-+}
-+
-+static void
-+mppe_comp_reset(void *arg)
-+{
-+    struct ppp_mppe_state *state = (struct ppp_mppe_state *)arg;
-+
-+    if (state->debug)
-+      printk(KERN_DEBUG "%s%d: resetting MPPC/MPPE compressor\n",
-+             __FUNCTION__, state->unit);
-+
-+    state->nextflushed = 1;
-+    if (state->mppe)
-+      arcfour_setkey(&state->arcfour_context, state->session_key,
-+                     state->keylen);
-+}
-+
-+static void
-+mppe_decomp_reset(void *arg)
-+{
-+    /* When MPPC/MPPE is in use, we shouldn't receive any CCP Reset-Ack.
-+       But when we receive such a packet, we just ignore it. */
-+    return;
-+}
-+
-+static void
-+mppe_stats(void *arg, struct compstat *stats)
-+{
-+    struct ppp_mppe_state *state = (struct ppp_mppe_state *)arg;
-+
-+    *stats = state->stats;
-+}
-+
-+/***************************/
-+/**** Compression stuff ****/
-+/***************************/
-+/* inserts 1 to max. 8 bits into the output buffer */
-+static inline void putbits8(u8 *buf, u32 val, const u32 n, u32 *i, u32 *l)
-+{
-+    buf += *i;
-+    if (*l >= n) {
-+      *l = (*l) - n;
-+      val <<= *l;
-+      *buf = *buf | (val & 0xff);
-+      if (*l == 0) {
-+          *l = 8;
-+          (*i)++;
-+          *(++buf) = 0;
-+      }
-+    } else {
-+      (*i)++;
-+      *l = 8 - n + (*l);
-+      val <<= *l;
-+      *buf = *buf | ((val >> 8) & 0xff);
-+      *(++buf) = val & 0xff;
-+    }
-+}
-+
-+/* inserts 9 to max. 16 bits into the output buffer */
-+static inline void putbits16(u8 *buf, u32 val, const u32 n, u32 *i, u32 *l)
-+{
-+    buf += *i;
-+    if (*l >= n - 8) {
-+      (*i)++;
-+      *l = 8 - n + (*l);
-+      val <<= *l;
-+      *buf = *buf | ((val >> 8) & 0xff);
-+      *(++buf) = val & 0xff;
-+      if (*l == 0) {
-+          *l = 8;
-+          (*i)++;
-+          *(++buf) = 0;
-+      }
-+    } else {
-+      (*i)++; (*i)++;
-+      *l = 16 - n + (*l);
-+      val <<= *l;
-+      *buf = *buf | ((val >> 16) & 0xff);
-+      *(++buf) = (val >> 8) & 0xff;
-+      *(++buf) = val & 0xff;
-+    }
-+}
-+
-+/* inserts 17 to max. 24 bits into the output buffer */
-+static inline void putbits24(u8 *buf, u32 val, const u32 n, u32 *i, u32 *l)
-+{
-+    buf += *i;
-+    if (*l >= n - 16) {
-+      (*i)++; (*i)++;
-+      *l = 16 - n + (*l);
-+      val <<= *l;
-+      *buf = *buf | ((val >> 16) & 0xff);
-+      *(++buf) = (val >> 8) & 0xff;
-+      *(++buf) = val & 0xff;
-+      if (*l == 0) {
-+          *l = 8;
-+          (*i)++;
-+          *(++buf) = 0;
-+      }
-+    } else {
-+      (*i)++; (*i)++; (*i)++;
-+      *l = 24 - n + (*l);
-+      val <<= *l;
-+      *buf = *buf | ((val >> 24) & 0xff);
-+      *(++buf) = (val >> 16) & 0xff;
-+      *(++buf) = (val >> 8) & 0xff;
-+      *(++buf) = val & 0xff;
-+    }
-+}
-+
-+static int
-+mppc_compress(struct ppp_mppe_state *state, unsigned char *ibuf,
-+            unsigned char *obuf, int isize, int osize)
-+{
-+    u32 olen, off, len, idx, i, l;
-+    u8 *hist, *sbuf, *p, *q, *r, *s;
-+
-+    /*  
-+      At this point, to avoid possible buffer overflow caused by packet
-+      expansion during/after compression,  we should make sure that
-+      osize >= (((isize*9)/8)+1)+2, but we don't do that because in
-+      ppp_generic.c we just allocate bigger obuf.
-+
-+      Maximum MPPC packet expansion is 12.5%. This is the worst case when
-+      all octets in the input buffer are >= 0x80 and we cannot find any
-+      repeated tokens. Additionally we have to reserve 2 bytes for MPPE/MPPC
-+      status bits and coherency counter.
-+    */
-+
-+    hist = state->hist + MPPE_HIST_LEN;
-+    /* check if there is enough room at the end of the history */
-+    if (state->histptr + isize >= 2*MPPE_HIST_LEN) {
-+      state->bits |= MPPE_BIT_RESET;
-+      state->histptr = MPPE_HIST_LEN;
-+      memcpy(state->hist, hist, MPPE_HIST_LEN);
-+    }
-+    /* add packet to the history; isize must be <= MPPE_HIST_LEN */
-+    sbuf = state->hist + state->histptr;
-+    memcpy(sbuf, ibuf, isize);
-+    state->histptr += isize;
-+
-+    /* compress data */
-+    r = sbuf + isize;
-+    *obuf = olen = i = 0;
-+    l = 8;
-+    while (i < isize - 2) {
-+      s = q = sbuf + i;
-+      idx = ((40542*((((s[0]<<4)^s[1])<<4)^s[2]))>>4) & 0x1FFF;
-+      p = hist + state->hash[idx];
-+      state->hash[idx] = (u16) (s - hist);
-+      off = s - p;
-+      if (off > 8191 || off < 1 || *p++ != *s++ || *p++ != *s++ || *p++ != *s++)
-+          goto literal;
-+      if (r - q >= 64) {
-+          *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
-+          *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
-+          *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
-+          *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
-+          *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
-+          *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
-+          *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
-+          *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
-+          *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
-+          *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
-+          *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
-+          *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
-+          *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
-+          *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
-+          *p++ != *s++ || *p++ != *s++ || *p++ != *s++ || *p++ != *s++ ||
-+          *p++ != *s++;
-+          if (s - q == 64) {
-+              p--; s--;
-+              while((*p++ == *s++) && (s < r));
-+          }
-+      } else {
-+          while((*p++ == *s++) && (s < r));
-+      }
-+      len = s - q - 1;
-+      i += len;
-+
-+      /* at least 3 character match found; code data */
-+      /* encode offset */
-+      if (off < 64) {                 /* 10-bit offset; 0 <= offset < 64 */
-+          putbits16(obuf, 0x3c0|off, 10, &olen, &l);
-+      } else if (off < 320) {         /* 12-bit offset; 64 <= offset < 320 */
-+          putbits16(obuf, 0xe00|(off-64), 12, &olen, &l);
-+      } else if (off < 8192) {        /* 16-bit offset; 320 <= offset < 8192 */
-+          putbits16(obuf, 0xc000|(off-320), 16, &olen, &l);
-+      } else {
-+          /* This shouldn't happen; we return 0 what means "packet expands",
-+          and we send packet uncompressed. */
-+          if (state->debug)
-+              printk(KERN_DEBUG "%s%d: wrong offset value: %d\n",
-+                     __FUNCTION__, state->unit, off);
-+          return 0;
-+      }
-+      /* encode length of match */
-+      if (len < 4) {                  /* length = 3 */
-+          putbits8(obuf, 0, 1, &olen, &l);
-+      } else if (len < 8) {           /* 4 <= length < 8 */
-+          putbits8(obuf, 0x08|(len&0x03), 4, &olen, &l);
-+      } else if (len < 16) {          /* 8 <= length < 16 */
-+          putbits8(obuf, 0x30|(len&0x07), 6, &olen, &l);
-+      } else if (len < 32) {          /* 16 <= length < 32 */
-+          putbits8(obuf, 0xe0|(len&0x0f), 8, &olen, &l);
-+      } else if (len < 64) {          /* 32 <= length < 64 */
-+          putbits16(obuf, 0x3c0|(len&0x1f), 10, &olen, &l);
-+      } else if (len < 128) {         /* 64 <= length < 128 */
-+          putbits16(obuf, 0xf80|(len&0x3f), 12, &olen, &l);
-+      } else if (len < 256) {         /* 128 <= length < 256 */
-+          putbits16(obuf, 0x3f00|(len&0x7f), 14, &olen, &l);
-+      } else if (len < 512) {         /* 256 <= length < 512 */
-+          putbits16(obuf, 0xfe00|(len&0xff), 16, &olen, &l);
-+      } else if (len < 1024) {        /* 512 <= length < 1024 */
-+          putbits24(obuf, 0x3fc00|(len&0x1ff), 18, &olen, &l);
-+      } else if (len < 2048) {        /* 1024 <= length < 2048 */
-+          putbits24(obuf, 0xff800|(len&0x3ff), 20, &olen, &l);
-+      } else if (len < 4096) {        /* 2048 <= length < 4096 */
-+          putbits24(obuf, 0x3ff000|(len&0x7ff), 22, &olen, &l);
-+      } else if (len < 8192) {        /* 4096 <= length < 8192 */
-+          putbits24(obuf, 0xffe000|(len&0xfff), 24, &olen, &l);
-+      } else {
-+          /* This shouldn't happen; we return 0 what means "packet expands",
-+          and send packet uncompressed. */
-+          if (state->debug)
-+              printk(KERN_DEBUG "%s%d: wrong length of match value: %d\n",
-+                     __FUNCTION__, state->unit, len);
-+          return 0;
-+      }
-+      continue;
-+
-+    literal:
-+      /* no match found; encode literal byte */
-+      if (ibuf[i] < 0x80) {           /* literal byte < 0x80 */
-+          putbits8(obuf, (u32) ibuf[i++], 8, &olen, &l);
-+      } else {                        /* literal byte >= 0x80 */
-+          putbits16(obuf, (u32) (0x100|(ibuf[i++]&0x7f)), 9, &olen, &l);
-+      }
-+    }
-+
-+    /* Add remaining octets to the output */
-+    while(isize - i > 0) {
-+      if (ibuf[i] < 0x80) {   /* literal byte < 0x80 */
-+          putbits8(obuf, (u32) ibuf[i++], 8, &olen, &l);
-+      } else {                /* literal byte >= 0x80 */
-+          putbits16(obuf, (u32) (0x100|(ibuf[i++]&0x7f)), 9, &olen, &l);
-+      }
-+    }
-+    /* Reset unused bits of the last output octet */
-+    if ((l != 0) && (l != 8)) {
-+      putbits8(obuf, 0, l, &olen, &l);
-+    }
-+
-+    return (int) olen;
-+}
-+
-+int
-+mppe_compress(void *arg, unsigned char *ibuf, unsigned char *obuf,
-+            int isize, int osize)
-+{
-+    struct ppp_mppe_state *state = (struct ppp_mppe_state *) arg;
-+    int proto, olen, complen;
-+    unsigned char *wptr;
-+
-+    /* Check that the protocol is in the range we handle. */
-+    proto = PPP_PROTOCOL(ibuf);
-+    if (proto < 0x0021 || proto > 0x00fa)
-+      return 0;
-+
-+    wptr = obuf;
-+    /* Copy over the PPP header */
-+    wptr[0] = PPP_ADDRESS(ibuf);
-+    wptr[1] = PPP_CONTROL(ibuf);
-+    wptr[2] = PPP_COMP >> 8;
-+    wptr[3] = PPP_COMP;
-+    wptr += PPP_HDRLEN + MPPE_OVHD; /* Leave two octets for MPPE/MPPC bits */
-+
-+    mppe_increase_ccount(state);
-+
-+    if (state->nextflushed) {
-+      if (!state->stateless) {
-+          state->nextflushed = 0;
-+      }
-+      state->bits |= MPPE_BIT_FLUSHED;
-+      if (state->mppc) { /* reset history */
-+          state->bits |= MPPE_BIT_RESET;
-+          state->histptr = MPPE_HIST_LEN;
-+          memset(state->hist + MPPE_HIST_LEN, 0, MPPE_HIST_LEN*sizeof(u8));
-+      }
-+    }
-+
-+    if (state->mppc && !state->mppe) { /* Do only compression */
-+      complen = mppc_compress(state, ibuf+2, wptr, isize-2,
-+                              osize-PPP_HDRLEN-MPPE_OVHD);
-+      if ((complen > isize) || (complen == 0)) {
-+          /* packet expands */
-+          state->nextflushed = 1;
-+          memcpy(wptr, ibuf+2, isize-2);
-+          olen = isize + (PPP_HDRLEN / 2) + MPPE_OVHD;
-+          (state->stats).inc_bytes += olen;
-+          (state->stats).inc_packets++;
-+      } else {
-+          state->bits |= MPPE_BIT_COMP;
-+          olen = complen + PPP_HDRLEN + MPPE_OVHD;
-+          (state->stats).comp_bytes += olen;
-+          (state->stats).comp_packets++;
-+      }
-+    } else {
-+      if (!state->mppc && state->mppe) { /* Do only encryption */
-+          /* read from ibuf, write to wptr, adjust for PPP_HDRLEN */
-+          arcfour_encrypt(&state->arcfour_context, ibuf+2, isize-2, wptr);
-+          state->bits |= MPPE_BIT_ENCRYPTED;
-+          olen = isize + (PPP_HDRLEN / 2) + MPPE_OVHD;
-+          (state->stats).inc_bytes += olen;
-+          (state->stats).inc_packets++;
-+      } else { /* Do compression and then encryption - RFC3078 */
-+          complen = mppc_compress(state, ibuf+2, wptr, isize-2,
-+                                  osize-PPP_HDRLEN-MPPE_OVHD);
-+          if ((complen > isize) || (complen == 0)) {
-+              /* packet expands */
-+              memcpy(wptr, ibuf+2, isize-2);
-+              state->nextflushed = 1;
-+              arcfour_encrypt(&state->arcfour_context, ibuf+2, isize-2, wptr);
-+              olen = isize + (PPP_HDRLEN / 2) + MPPE_OVHD;
-+              (state->stats).inc_bytes += olen;
-+              (state->stats).inc_packets++;
-+          } else {
-+              state->bits |= MPPE_BIT_COMP;
-+              /* Hack warning !!! RC4 implementation which we use does
-+                 encryption "in place" - it means that input and output
-+                 buffers can be *the same* memory area. Therefore we don't
-+                 need to use a temporary buffer. But be careful - other
-+                 implementations don't have to be so nice.
-+                 I used to use ibuf as temporary buffer here, but it led
-+                 packet sniffers into error. Thanks to Wilfried Weissmann
-+                 for pointing that. */
-+              arcfour_encrypt(&state->arcfour_context, wptr, complen, wptr);
-+              olen = complen + PPP_HDRLEN + MPPE_OVHD;
-+              (state->stats).comp_bytes += olen;
-+              (state->stats).comp_packets++;
-+          }
-+          state->bits |= MPPE_BIT_ENCRYPTED;
-+      }
-+    }
-+
-+    /* write status bits and coherency counter into the output buffer */
-+    wptr = obuf + PPP_HDRLEN;
-+    wptr[0] = MPPE_CTRLHI(state);
-+    wptr[1] = MPPE_CTRLLO(state);
-+
-+    state->bits = 0;
-+
-+    (state->stats).unc_bytes += isize;
-+    (state->stats).unc_packets++;
-+
-+    return olen;
-+}
-+
-+/***************************/
-+/*** Decompression stuff ***/
-+/***************************/
-+static inline u32 getbits(const u8 *buf, const u32 n, u32 *i, u32 *l)
-+{
-+    static u32 m[] = {0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff};
-+    u32 res, ol;
-+
-+    ol = *l;
-+    if (*l >= n) {
-+      *l = (*l) - n;
-+      res = (buf[*i] & m[ol]) >> (*l);
-+      if (*l == 0) {
-+          *l = 8;
-+          (*i)++;
-+      }
-+    } else {
-+      *l = 8 - n + (*l);
-+      res = (buf[(*i)++] & m[ol]) << 8;
-+      res = (res | buf[*i]) >> (*l);
-+    }
-+
-+    return res;
-+}
-+
-+static inline u32 getbyte(const u8 *buf, const u32 i, const u32 l)
-+{
-+    if (l == 8) {
-+      return buf[i];
-+    } else {
-+      return (((buf[i] << 8) | buf[i+1]) >> l) & 0xff;
-+    }
-+}
-+
-+static inline void lamecopy(u8 *dst, u8 *src, u32 len)
-+{
-+    while (len--)
-+      *dst++ = *src++;
-+}
-+
-+static int
-+mppc_decompress(struct ppp_mppe_state *state, unsigned char *ibuf,
-+              unsigned char *obuf, int isize, int osize)
-+{
-+    u32 olen, off, len, bits, val, sig, i, l;
-+    u8 *history, *s;
-+
-+    history = state->hist + state->histptr;
-+    olen = len = i = 0;
-+    l = 8;
-+    bits = isize * 8;
-+    while (bits >= 8) {
-+      val = getbyte(ibuf, i++, l);
-+      if (val < 0x80) {               /* literal byte < 0x80 */
-+          if (state->histptr < 2*MPPE_HIST_LEN) {
-+              /* copy uncompressed byte to the history */
-+              (state->hist)[(state->histptr)++] = (u8) val;
-+          } else {
-+              /* buffer overflow; drop packet */
-+              if (state->debug)
-+                  printk(KERN_ERR "%s%d: trying to write outside history "
-+                         "buffer\n", __FUNCTION__, state->unit);
-+              return DECOMP_ERROR;
-+          }
-+          olen++;
-+          bits -= 8;
-+          continue;
-+      }
-+
-+      sig = val & 0xc0;
-+      if (sig == 0x80) {              /* literal byte >= 0x80 */
-+          if (state->histptr < 2*MPPE_HIST_LEN) {
-+              /* copy uncompressed byte to the history */
-+              (state->hist)[(state->histptr)++] = 
-+                  (u8) (0x80|((val&0x3f)<<1)|getbits(ibuf, 1 , &i ,&l));
-+          } else {
-+              /* buffer overflow; drop packet */
-+              if (state->debug)
-+                  printk(KERN_ERR "%s%d: trying to write outside history "
-+                         "buffer\n", __FUNCTION__, state->unit);
-+              return DECOMP_ERROR;
-+          }
-+          olen++;
-+          bits -= 9;
-+          continue;
-+      }
-+
-+      /* Not a literal byte so it must be an (offset,length) pair */
-+      /* decode offset */
-+      sig = val & 0xf0;
-+      if (sig == 0xf0) {              /* 10-bit offset; 0 <= offset < 64 */
-+          off = (((val&0x0f)<<2)|getbits(ibuf, 2 , &i ,&l));
-+          bits -= 10;
-+      } else {
-+          if (sig == 0xe0) {          /* 12-bit offset; 64 <= offset < 320 */
-+              off = ((((val&0x0f)<<4)|getbits(ibuf, 4 , &i ,&l))+64);
-+              bits -= 12;
-+          } else {
-+              if ((sig&0xe0) == 0xc0) {/* 16-bit offset; 320 <= offset < 8192 */
-+                  off = ((((val&0x1f)<<8)|getbyte(ibuf, i++, l))+320);
-+                  bits -= 16;
-+                  if (off > MPPE_HIST_LEN - 1) {
-+                      if (state->debug)
-+                          printk(KERN_DEBUG "%s%d: too big offset value: %d\n",
-+                                 __FUNCTION__, state->unit, off);
-+                      return DECOMP_ERROR;
-+                  }
-+              } else {                /* this shouldn't happen */
-+                  if (state->debug)
-+                      printk(KERN_DEBUG "%s%d: cannot decode offset value\n",
-+                             __FUNCTION__, state->unit);
-+                  return DECOMP_ERROR;
-+              }
-+          }
-+      }
-+      /* decode length of match */
-+      val = getbyte(ibuf, i, l);
-+      if ((val & 0x80) == 0x00) {                     /* len = 3 */
-+          len = 3;
-+          bits--;
-+          getbits(ibuf, 1 , &i ,&l);
-+      } else if ((val & 0xc0) == 0x80) {              /* 4 <= len < 8 */
-+          len = 0x04 | ((val>>4) & 0x03);
-+          bits -= 4;
-+          getbits(ibuf, 4 , &i ,&l);
-+      } else if ((val & 0xe0) == 0xc0) {              /* 8 <= len < 16 */
-+          len = 0x08 | ((val>>2) & 0x07);
-+          bits -= 6;
-+          getbits(ibuf, 6 , &i ,&l);
-+      } else if ((val & 0xf0) == 0xe0) {              /* 16 <= len < 32 */
-+          len = 0x10 | (val & 0x0f);
-+          bits -= 8;
-+          i++;
-+      } else {
-+          bits -= 8;
-+          val = (val << 8) | getbyte(ibuf, ++i, l);
-+          if ((val & 0xf800) == 0xf000) {             /* 32 <= len < 64 */
-+              len = 0x0020 | ((val >> 6) & 0x001f);
-+              bits -= 2;
-+              getbits(ibuf, 2 , &i ,&l);
-+          } else if ((val & 0xfc00) == 0xf800) {      /* 64 <= len < 128 */
-+              len = 0x0040 | ((val >> 4) & 0x003f);
-+              bits -= 4;
-+              getbits(ibuf, 4 , &i ,&l);
-+          } else if ((val & 0xfe00) == 0xfc00) {      /* 128 <= len < 256 */
-+              len = 0x0080 | ((val >> 2) & 0x007f);
-+              bits -= 6;
-+              getbits(ibuf, 6 , &i ,&l);
-+          } else if ((val & 0xff00) == 0xfe00) {      /* 256 <= len < 512 */
-+              len = 0x0100 | (val & 0x00ff);
-+              bits -= 8;
-+              i++;
-+          } else {
-+              bits -= 8;
-+              val = (val << 8) | getbyte(ibuf, ++i, l);
-+              if ((val & 0xff8000) == 0xff0000) {     /* 512 <= len < 1024 */
-+                  len = 0x000200 | ((val >> 6) & 0x0001ff);
-+                  bits -= 2;
-+                  getbits(ibuf, 2 , &i ,&l);
-+              } else if ((val & 0xffc000) == 0xff8000) {/* 1024 <= len < 2048 */
-+                  len = 0x000400 | ((val >> 4) & 0x0003ff);
-+                  bits -= 4;
-+                  getbits(ibuf, 4 , &i ,&l);
-+              } else if ((val & 0xffe000) == 0xffc000) {/* 2048 <= len < 4096 */
-+                  len = 0x000800 | ((val >> 2) & 0x0007ff);
-+                  bits -= 6;
-+                  getbits(ibuf, 6 , &i ,&l);
-+              } else if ((val & 0xfff000) == 0xffe000) {/* 4096 <= len < 8192 */
-+                  len = 0x001000 | (val & 0x000fff);
-+                  bits -= 8;
-+                  i++;
-+              } else {                                /* this shouldn't happen */
-+                  if (state->debug)
-+                      printk(KERN_DEBUG "%s%d: wrong length code: 0x%X\n",
-+                             __FUNCTION__, state->unit, val);
-+                  return DECOMP_ERROR;
-+              }
-+          }
-+      }
-+      s = state->hist + state->histptr;
-+      state->histptr += len;
-+      olen += len;
-+      if (state->histptr < 2*MPPE_HIST_LEN) {
-+          /* copy uncompressed bytes to the history */
-+
-+          /* In some cases len may be greater than off. It means that memory
-+           * areas pointed by s and s-off overlap. I used to use memmove()
-+           * here, because I thought that it acts as libc's version. But
-+           * I was wrong. I got strange errors sometimes. Wilfried suggested
-+           * using of byte by byte copying here and strange errors disappeared.
-+           */
-+          lamecopy(s, s-off, len);
-+      } else {
-+          /* buffer overflow; drop packet */
-+          if (state->debug)
-+              printk(KERN_ERR "%s%d: trying to write outside history "
-+                     "buffer\n", __FUNCTION__, state->unit);
-+          return DECOMP_ERROR;
-+      }
-+    }
-+
-+    if (olen <= osize) {
-+      /* copy uncompressed packet to the output buffer */
-+      memcpy(obuf, history, olen);
-+    } else {
-+      /* buffer overflow; drop packet */
-+      if (state->debug)
-+          printk(KERN_ERR "%s%d: too big uncompressed packet: %d\n",
-+                 __FUNCTION__, state->unit, olen+(PPP_HDRLEN/2));
-+      return DECOMP_ERROR;
-+    }
-+
-+    return (int) olen;
-+}
-+
-+int
-+mppe_decompress(void *arg, unsigned char *ibuf, int isize,
-+              unsigned char *obuf, int osize)
-+{
-+    struct ppp_mppe_state *state = (struct ppp_mppe_state *)arg;
-+    int seq, bits, uncomplen;
-+
-+    if (isize <= PPP_HDRLEN + MPPE_OVHD) {
-+      if (state->debug) {
-+          printk(KERN_DEBUG "%s%d: short packet (len=%d)\n",  __FUNCTION__,
-+                 state->unit, isize);
-+      }
-+      return DECOMP_ERROR;
-+    }
-+
-+    /* Get coherency counter and control bits from input buffer */
-+    seq = MPPE_CCOUNT(ibuf);
-+    bits = MPPE_BITS(ibuf);
-+
-+    if (state->stateless) {
-+      /* RFC 3078, sec 8.1. */
-+      mppe_increase_ccount(state);
-+      if ((seq != state->ccount) && state->debug)
-+          printk(KERN_DEBUG "%s%d: bad sequence number: %d, expected: %d\n",
-+                 __FUNCTION__, state->unit, seq, state->ccount);
-+      while (seq != state->ccount)
-+          mppe_increase_ccount(state);
-+    } else {
-+      /* RFC 3078, sec 8.2. */
-+      if (state->flushexpected) { /* discard state */
-+          if ((bits & MPPE_BIT_FLUSHED)) { /* we received expected FLUSH bit */
-+              while (seq != state->ccount)
-+                  mppe_increase_ccount(state);
-+              state->flushexpected = 0;
-+          } else /* drop packet*/
-+              return DECOMP_ERROR;
-+      } else { /* normal state */
-+          mppe_increase_ccount(state);
-+          if (seq != state->ccount) {
-+              /* Packet loss detected, enter the discard state. */
-+              if (state->debug)
-+                  printk(KERN_DEBUG "%s%d: bad sequence number: %d, expected: %d\n",
-+                         __FUNCTION__, state->unit, seq, state->ccount);
-+              state->flushexpected = 1;
-+              return DECOMP_ERROR;
-+          }
-+      }
-+      if (state->mppe && (bits & MPPE_BIT_FLUSHED)) {
-+          arcfour_setkey(&state->arcfour_context, state->session_key,
-+                         state->keylen);
-+      }
-+    }
-+
-+    if (state->mppc && (bits & (MPPE_BIT_FLUSHED | MPPE_BIT_RESET))) {
-+      state->histptr = MPPE_HIST_LEN;
-+      if ((bits & MPPE_BIT_FLUSHED)) {
-+          memset(state->hist + MPPE_HIST_LEN, 0, MPPE_HIST_LEN*sizeof(u8));
-+      } else
-+          if ((bits & MPPE_BIT_RESET)) {
-+              memcpy(state->hist, state->hist+MPPE_HIST_LEN, MPPE_HIST_LEN);
-+          }
-+    }
-+
-+    /* Fill in the first part of the PPP header. The protocol field
-+       comes from the decompressed data. */
-+    obuf[0] = PPP_ADDRESS(ibuf);
-+    obuf[1] = PPP_CONTROL(ibuf);
-+    obuf += PPP_HDRLEN / 2;
-+
-+    if (state->mppe) { /* process encrypted packet */
-+      if ((bits & MPPE_BIT_ENCRYPTED)) {
-+          /* OK, packet encrypted, so decrypt it */
-+          if (state->mppc && (bits & MPPE_BIT_COMP)) {
-+              /* Hack warning !!! RC4 implementation which we use does
-+                 decryption "in place" - it means that input and output
-+                 buffers can be *the same* memory area. Therefore we don't
-+                 need to use a temporary buffer. But be careful - other
-+                 implementations don't have to be so nice. */
-+              arcfour_decrypt(&state->arcfour_context, ibuf+PPP_HDRLEN+MPPE_OVHD,
-+                              isize-PPP_HDRLEN-MPPE_OVHD, ibuf+PPP_HDRLEN+MPPE_OVHD);
-+              uncomplen = mppc_decompress(state, ibuf+PPP_HDRLEN+MPPE_OVHD,
-+                                          obuf, isize-PPP_HDRLEN-MPPE_OVHD,
-+                                          osize-(PPP_HDRLEN/2));
-+              if (uncomplen == DECOMP_ERROR) {
-+                  state->flushexpected = 1;
-+                  return DECOMP_ERROR;
-+              }
-+              uncomplen += PPP_HDRLEN / 2;
-+              (state->stats).comp_bytes += isize;
-+              (state->stats).comp_packets++;
-+          } else {
-+              arcfour_decrypt(&state->arcfour_context, ibuf+PPP_HDRLEN+MPPE_OVHD,
-+                              isize-PPP_HDRLEN-MPPE_OVHD, obuf);
-+              uncomplen = isize - (PPP_HDRLEN / 2) - MPPE_OVHD;
-+              (state->stats).inc_bytes += isize;
-+              (state->stats).inc_packets++;
-+          }
-+      } else { /* this shouldn't happen */
-+          if (state->debug)
-+              printk(KERN_ERR "%s%d: encryption negotiated but not an "
-+                     "encrypted packet received\n", __FUNCTION__, state->unit);
-+          mppe_change_key(state, 0);
-+          state->flushexpected = 1;
-+          return DECOMP_ERROR;
-+      }
-+    } else {
-+      if (state->mppc) { /* no MPPE, only MPPC */
-+          if ((bits & MPPE_BIT_COMP)) {
-+              uncomplen = mppc_decompress(state, ibuf+PPP_HDRLEN+MPPE_OVHD,
-+                                          obuf, isize-PPP_HDRLEN-MPPE_OVHD,
-+                                          osize-(PPP_HDRLEN/2));
-+              if (uncomplen == DECOMP_ERROR) {
-+                  state->flushexpected = 1;
-+                  return DECOMP_ERROR;
-+              }
-+              uncomplen += PPP_HDRLEN / 2;
-+              (state->stats).comp_bytes += isize;
-+              (state->stats).comp_packets++;
-+          } else {
-+              memcpy(obuf, ibuf+PPP_HDRLEN+MPPE_OVHD,
-+                     isize-PPP_HDRLEN-MPPE_OVHD);
-+              uncomplen = isize - (PPP_HDRLEN / 2) - MPPE_OVHD;
-+              (state->stats).inc_bytes += isize;
-+              (state->stats).inc_packets++;
-+          }
-+      } else { /* this shouldn't happen */
-+          if (state->debug)
-+              printk(KERN_ERR "%s%d: error - no MPPC nor MPPE negotiated\n",
-+                     __FUNCTION__, state->unit);
-+          state->flushexpected = 1;
-+          return DECOMP_ERROR;
-+      }
-+    }
-+
-+    (state->stats).unc_bytes += uncomplen;
-+    (state->stats).unc_packets++;
-+
-+    return uncomplen;
-+}
-+
-+
-+/************************************************************
-+ * Module interface table
-+ ************************************************************/
-+
-+/* These are in ppp_generic.c */
-+extern int  ppp_register_compressor   (struct compressor *cp);
-+extern void ppp_unregister_compressor (struct compressor *cp);
-+
-+/*
-+ * Functions exported to ppp_generic.c.
-+ */
-+struct compressor ppp_mppe = {
-+    CI_MPPE,          /* compress_proto */
-+    mppe_comp_alloc,  /* comp_alloc */
-+    mppe_comp_free,   /* comp_free */
-+    mppe_comp_init,   /* comp_init */
-+    mppe_comp_reset,  /* comp_reset */
-+    mppe_compress,    /* compress */
-+    mppe_stats,               /* comp_stat */
-+    mppe_decomp_alloc,        /* decomp_alloc */
-+    mppe_comp_free,   /* decomp_free */
-+    mppe_decomp_init, /* decomp_init */
-+    mppe_decomp_reset,        /* decomp_reset */
-+    mppe_decompress,  /* decompress */
-+    NULL,             /* incomp */
-+    mppe_stats,               /* decomp_stat */
-+};
-+
-+/*
-+  In case of MPPC/MPPE there is no need to process incompressible data
-+  because such a data is sent in MPPC/MPPE frame. Therefore the (*incomp)
-+  callback function isn't needed.
-+*/
-+
-+/************************************************************
-+ * Module support routines
-+ ************************************************************/
-+
-+int __init mppe_module_init(void)
-+{
-+    int answer = ppp_register_compressor(&ppp_mppe);
-+    if (answer == 0) {
-+      printk(KERN_INFO "MPPE/MPPC encryption/compression module registered\n");
-+    }
-+    return answer;
-+}
-+
-+void __exit mppe_module_cleanup(void)
-+{
-+    if (MOD_IN_USE) {
-+      printk (KERN_INFO "MPPE/MPPC module busy, removing delayed\n");
-+    } else {
-+      ppp_unregister_compressor (&ppp_mppe);
-+      printk(KERN_INFO "MPPE/MPPC encryption/compression module unregistered\n");
-+    }
-+}
-+
-+module_init(mppe_module_init);
-+module_exit(mppe_module_cleanup);
-+
-+MODULE_AUTHOR("Jan Dubiec <jdx@slackware.pl>");
-+MODULE_DESCRIPTION("MPPE/MPPC encryption/compression module for Linux");
-+MODULE_LICENSE("Dual BSD/GPL");
-diff -ruN linux-2.4.21.orig/include/linux/ppp-comp.h linux-2.4.21/include/linux/ppp-comp.h
---- linux-2.4.21.orig/include/linux/ppp-comp.h 1999-08-06 19:44:11.000000000 +0200
-+++ linux-2.4.21/include/linux/ppp-comp.h      2003-07-15 01:45:22.000000000 +0200
-@@ -1,34 +1,42 @@
- /*
-  * ppp-comp.h - Definitions for doing PPP packet compression.
-  *
-- * Copyright (c) 1994 The Australian National University.
-- * All rights reserved.
-+ * Copyright (c) 1984 Paul Mackerras. All rights reserved.
-  *
-- * Permission to use, copy, modify, and distribute this software and its
-- * documentation is hereby granted, provided that the above copyright
-- * notice appears in all copies.  This software is provided without any
-- * warranty, express or implied. The Australian National University
-- * makes no representations about the suitability of this software for
-- * any purpose.
-- *
-- * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
-- * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
-- * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
-- * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
-- * OF SUCH DAMAGE.
-- *
-- * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
-- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
-- * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
-- * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
-- * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
-- * OR MODIFICATIONS.
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-  *
-- * $Id: ppp-comp.h,v 1.6 1997/11/27 06:04:44 paulus Exp $
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions and the following disclaimer.
-+ *
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ *    notice, this list of conditions and the following disclaimer in
-+ *    the documentation and/or other materials provided with the
-+ *    distribution.
-+ *
-+ * 3. The name(s) of the authors of this software must not be used to
-+ *    endorse or promote products derived from this software without
-+ *    prior written permission.
-+ *
-+ * 4. Redistributions of any form whatsoever must retain the following
-+ *    acknowledgment:
-+ *    "This product includes software developed by Paul Mackerras
-+ *     <paulus@samba.org>".
-+ *
-+ * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
-+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-+ * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
-+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
-+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ *
-+ * $Id: ppp-comp.h,v 1.10 2002/12/06 09:49:15 paulus Exp $
-  */
- /*
-- *  ==FILEVERSION 980319==
-+ *  ==FILEVERSION 20020715==
-  *
-  *  NOTE TO MAINTAINERS:
-  *     If you modify this file at all, please set the above date.
-@@ -78,7 +86,7 @@
-       /* Compress a packet */
-       int     (*compress) (void *state, unsigned char *rptr,
--                            unsigned char *obuf, int isize, int osize);
-+                           unsigned char *obuf, int isize, int osize);
-       /* Return compression statistics */
-       void    (*comp_stat) (void *state, struct compstat *stats);
-@@ -99,7 +107,7 @@
-       /* Decompress a packet. */
-       int     (*decompress) (void *state, unsigned char *ibuf, int isize,
--                              unsigned char *obuf, int osize);
-+                             unsigned char *obuf, int osize);
-       /* Update state for an incompressible packet received */
-       void    (*incomp) (void *state, unsigned char *ibuf, int icnt);
-@@ -187,6 +195,127 @@
- #define DEFLATE_CHK_SEQUENCE  0
- /*
-+ * Definitions for MPPE.
-+ */
-+
-+#define CI_MPPE                       18      /* config option for MPPE */
-+#define CILEN_MPPE            6       /* length of config option */
-+
-+#define MPPE_PAD              4       /* MPPE growth per frame */
-+#define MPPE_MAX_KEY_LEN      16      /* largest key length (128-bit) */
-+
-+/* option bits for ccp_options.mppe */
-+#define MPPE_OPT_40           0x01    /* 40 bit */
-+#define MPPE_OPT_128          0x02    /* 128 bit */
-+#define MPPE_OPT_STATEFUL     0x04    /* stateful mode */
-+/* unsupported opts */
-+#define MPPE_OPT_56           0x08    /* 56 bit */
-+#define MPPE_OPT_MPPC         0x10    /* MPPC compression */
-+#define MPPE_OPT_D            0x20    /* Unknown */
-+#define MPPE_OPT_UNSUPPORTED (MPPE_OPT_56|MPPE_OPT_MPPC|MPPE_OPT_D)
-+#define MPPE_OPT_UNKNOWN      0x40    /* Bits !defined in RFC 3078 were set */
-+
-+/*
-+ * This is not nice ... the alternative is a bitfield struct though.
-+ * And unfortunately, we cannot share the same bits for the option
-+ * names above since C and H are the same bit.  We could do a u_int32
-+ * but then we have to do a htonl() all the time and/or we still need
-+ * to know which octet is which.
-+ */
-+#define MPPE_C_BIT            0x01    /* MPPC */
-+#define MPPE_D_BIT            0x10    /* Obsolete, usage unknown */
-+#define MPPE_L_BIT            0x20    /* 40-bit */
-+#define MPPE_S_BIT            0x40    /* 128-bit */
-+#define MPPE_M_BIT            0x80    /* 56-bit, not supported */
-+#define MPPE_H_BIT            0x01    /* Stateless (in a different byte) */
-+
-+/* Does not include H bit; used for least significant octet only. */
-+#define MPPE_ALL_BITS (MPPE_D_BIT|MPPE_L_BIT|MPPE_S_BIT|MPPE_M_BIT|MPPE_H_BIT)
-+
-+/* Build a CI from mppe opts (see RFC 3078) */
-+#define MPPE_OPTS_TO_CI(opts, ci)             \
-+    do {                                      \
-+      u_char *ptr = ci; /* u_char[4] */       \
-+                                              \
-+      /* H bit */                             \
-+      if (opts & MPPE_OPT_STATEFUL)           \
-+          *ptr++ = 0x0;                       \
-+      else                                    \
-+          *ptr++ = MPPE_H_BIT;                \
-+      *ptr++ = 0;                             \
-+      *ptr++ = 0;                             \
-+                                              \
-+      /* S,L bits */                          \
-+      *ptr = 0;                               \
-+      if (opts & MPPE_OPT_128)                \
-+          *ptr |= MPPE_S_BIT;                 \
-+      if (opts & MPPE_OPT_40)                 \
-+          *ptr |= MPPE_L_BIT;                 \
-+      /* M,D,C bits not supported */          \
-+    } while (/* CONSTCOND */ 0)
-+
-+/* The reverse of the above */
-+#define MPPE_CI_TO_OPTS(ci, opts)             \
-+    do {                                      \
-+      u_char *ptr = ci; /* u_char[4] */       \
-+                                              \
-+      opts = 0;                               \
-+                                              \
-+      /* H bit */                             \
-+      if (!(ptr[0] & MPPE_H_BIT))             \
-+          opts |= MPPE_OPT_STATEFUL;          \
-+                                              \
-+      /* S,L bits */                          \
-+      if (ptr[3] & MPPE_S_BIT)                \
-+          opts |= MPPE_OPT_128;               \
-+      if (ptr[3] & MPPE_L_BIT)                \
-+          opts |= MPPE_OPT_40;                \
-+                                              \
-+      /* M,D,C bits */                        \
-+      if (ptr[3] & MPPE_M_BIT)                \
-+          opts |= MPPE_OPT_56;                \
-+      if (ptr[3] & MPPE_D_BIT)                \
-+          opts |= MPPE_OPT_D;                 \
-+      if (ptr[3] & MPPE_C_BIT)                \
-+          opts |= MPPE_OPT_MPPC;              \
-+                                              \
-+      /* Other bits */                        \
-+      if (ptr[0] & ~MPPE_H_BIT)               \
-+          opts |= MPPE_OPT_UNKNOWN;           \
-+      if (ptr[1] || ptr[2])                   \
-+          opts |= MPPE_OPT_UNKNOWN;           \
-+      if (ptr[3] & ~MPPE_ALL_BITS)            \
-+          opts |= MPPE_OPT_UNKNOWN;           \
-+    } while (/* CONSTCOND */ 0)
-+
-+/* MPPE/MPPC definitions by J.D.*/
-+#define MPPE_STATELESS          MPPE_H_BIT    /* configuration bit H */
-+#define MPPE_40BIT              MPPE_L_BIT    /* configuration bit L */
-+#define MPPE_56BIT              MPPE_M_BIT    /* configuration bit M */
-+#define MPPE_128BIT             MPPE_S_BIT    /* configuration bit S */
-+#define MPPE_MPPC               MPPE_C_BIT    /* configuration bit C */
-+
-+/*
-+ * Definitions for Stac LZS.
-+ */
-+
-+#define CI_LZS                        17      /* config option for Stac LZS */
-+#define CILEN_LZS             5       /* length of config option */
-+
-+#define LZS_OVHD              4       /* max. LZS overhead */
-+#define LZS_HIST_LEN          2048    /* LZS history size */
-+#define LZS_MAX_CCOUNT                0x0FFF  /* max. coherency counter value */
-+
-+#define LZS_MODE_NONE         0
-+#define LZS_MODE_LCB          1
-+#define LZS_MODE_CRC          2
-+#define LZS_MODE_SEQ          3
-+#define LZS_MODE_EXT          4
-+
-+#define LZS_EXT_BIT_FLUSHED   0x80    /* bit A */
-+#define LZS_EXT_BIT_COMP      0x20    /* bit C */
-+
-+/*
-  * Definitions for other, as yet unsupported, compression methods.
-  */
diff --git a/obsolete-buildroot/sources/openwrt/kernel/patches/160-expr.patch b/obsolete-buildroot/sources/openwrt/kernel/patches/160-expr.patch
deleted file mode 100644 (file)
index f19fe24..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- linux/Makefile     2004-08-16 21:31:21.850402752 -0400
-+++ linux/Makefile     2004-08-16 21:48:22.372259848 -0400
-@@ -357,7 +357,7 @@
-       @rm -f .ver1
- include/linux/version.h: ./Makefile
--      @expr length "$(KERNELRELEASE)" \<= $(uts_len) > /dev/null || \
-+      @expr "$(KERNELRELEASE)" : '.*' \<= $(uts_len) > /dev/null || \
-         (echo KERNELRELEASE \"$(KERNELRELEASE)\" exceeds $(uts_len) characters >&2; false)
-       @echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" > .ver
-       @echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> .ver
diff --git a/obsolete-buildroot/sources/openwrt/patches/libpcap/00_debian_libpcap0.8_0.8.3-4.diff b/obsolete-buildroot/sources/openwrt/patches/libpcap/00_debian_libpcap0.8_0.8.3-4.diff
deleted file mode 100644 (file)
index 6b42218..0000000
+++ /dev/null
@@ -1,838 +0,0 @@
---- libpcap0.8-0.8.3.orig/debian/compat
-+++ libpcap0.8-0.8.3/debian/compat
-@@ -0,0 +1,2 @@
-+4
-+
---- libpcap0.8-0.8.3.orig/debian/copyright
-+++ libpcap0.8-0.8.3/debian/copyright
-@@ -0,0 +1,115 @@
-+This package was debianized by Romain Francoise <rfrancoise@debian.org>
-+on Fri, 16 Apr 2004 18:41:39 +0200, based on work by:
-+ + Anand Kumria <wildfire@progsoc.org>
-+ + Torsten Landschoff <torsten@debian.org>
-+
-+It was downloaded from http://tcpdump.org/release/libpcap-0.8.3.tar.gz
-+
-+Upstream Authors: tcpdump-workers@tcpdump.org
-+
-+Licensed under the 3-clause BSD license: 
-+
-+  Redistribution and use in source and binary forms, with or without
-+  modification, are permitted provided that the following conditions
-+  are met:
-+
-+    1. Redistributions of source code must retain the above copyright
-+       notice, this list of conditions and the following disclaimer.
-+    2. Redistributions in binary form must reproduce the above copyright
-+       notice, this list of conditions and the following disclaimer in
-+       the documentation and/or other materials provided with the
-+       distribution.
-+    3. The names of the authors may not be used to endorse or promote
-+       products derived from this software without specific prior
-+       written permission.
-+
-+  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-+  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-+
-+Current upstream maintainers:
-+      Bill Fenner                     <fenner@research.att.com>
-+      Fulvio Risso                    <risso@polito.it>
-+      Guy Harris                      <guy@alum.mit.edu>
-+      Hannes Gredler                  <hannes@juniper.net>
-+      Jun-ichiro itojun Hagino        <itojun@iijlab.net>
-+      Michael Richardson              <mcr@sandelman.ottawa.on.ca>
-+
-+Additional people who have contributed patches:
-+
-+      Alan Bawden                     <Alan@LCS.MIT.EDU>
-+      Alexey Kuznetsov                <kuznet@ms2.inr.ac.ru>
-+      Albert Chin                     <china@thewrittenword.com>
-+      Andrew Brown                    <atatat@atatdot.net>
-+      Antti Kantee                    <pooka@netbsd.org>
-+      Arkadiusz Miskiewicz            <misiek@pld.org.pl>
-+      Armando L. Caro Jr.             <acaro@mail.eecis.udel.edu>
-+      Assar Westerlund                <assar@sics.se>
-+      Brian Ginsbach                  <ginsbach@cray.com>
-+      Charles M. Hannum               <mycroft@netbsd.org>
-+      Chris G. Demetriou              <cgd@netbsd.org>
-+      Chris Pepper                    <pepper@mail.reppep.com>
-+      Darren Reed                     <darrenr@reed.wattle.id.au>
-+      David Kaelbling                 <drk@sgi.com>
-+      David Young                     <dyoung@ojctech.com>
-+      Don Ebright                     <Don.Ebright@compuware.com> 
-+      Eric Anderson                   <anderse@hpl.hp.com>
-+      Franz Schaefer                  <schaefer@mond.at>
-+      Gianluca Varenni                <varenni@netgroup-serv.polito.it>
-+      Gisle Vanem                     <giva@bgnett.no>
-+      Graeme Hewson                   <ghewson@cix.compulink.co.uk>
-+      Greg Stark                      <gsstark@mit.edu>
-+      Greg Troxel                     <gdt@ir.bbn.com>
-+      Guillaume Pelat                 <endymion_@users.sourceforge.net>
-+      Hyung Sik Yoon                  <hsyn@kr.ibm.com>
-+      Igor Khristophorov              <igor@atdot.org>
-+      Jan-Philip Velders              <jpv@veldersjes.net>
-+      Jason R. Thorpe                 <thorpej@netbsd.org>
-+      Javier Achirica                 <achirica@ttd.net>
-+      Jean Tourrilhes                 <jt@hpl.hp.com>
-+      Jefferson Ogata                 <jogata@nodc.noaa.gov>
-+      Jesper Peterson                 <jesper@endace.com>
-+      John Bankier                    <jbankier@rainfinity.com>
-+      Jon Lindgren                    <jonl@yubyub.net>
-+      Juergen Schoenwaelder           <schoenw@ibr.cs.tu-bs.de>
-+      Kazushi Sugyo                   <sugyo@pb.jp.nec.com>
-+      Klaus Klein                     <kleink@netbsd.org>
-+      Koryn Grant                     <koryn@endace.com>
-+      Krzysztof Halasa                <khc@pm.waw.pl>
-+      Lorenzo Cavallaro               <sullivan@sikurezza.org>
-+      Loris Degioanni                 <loris@netgroup-serv.polito.it>
-+      Love Hörnquist-Åstrand          <lha@stacken.kth.se>
-+      Maciej W. Rozycki               <macro@ds2.pg.gda.pl>
-+      Marcus Felipe Pereira           <marcus@task.com.br>
-+      Martin Husemann                 <martin@netbsd.org>
-+      Mike Wiacek                     <mike@iroot.net>
-+      Monroe Williams                 <monroe@pobox.com>
-+      Octavian Cerna                  <tavy@ylabs.com>
-+      Olaf Kirch                      <okir@caldera.de>
-+      Onno van der Linden             <onno@simplex.nl>
-+      Paul Mundt                      <lethal@linux-sh.org>
-+      Pavel Kankovsky                 <kan@dcit.cz>
-+      Peter Fales                     <peter@fales-lorenz.net>
-+      Peter Jeremy                    <peter.jeremy@alcatel.com.au>
-+      Phil Wood                       <cpw@lanl.gov>
-+      Rafal Maszkowski                <rzm@icm.edu.pl>
-+      Rick Jones                      <raj@cup.hp.com>
-+      Scott Barron                    <sb125499@ohiou.edu>
-+      Scott Gifford                   <sgifford@tir.com>
-+      Sebastian Krahmer               <krahmer@cs.uni-potsdam.de>
-+      Shaun Clowes                    <delius@progsoc.uts.edu.au>
-+      Solomon Peachy                  <pizza@shaftnet.org>
-+      Stefan Hudson                   <hudson@mbay.net>
-+      Takashi Yamamoto                <yamt@mwd.biglobe.ne.jp>
-+      Tony Li                         <tli@procket.com>
-+      Torsten Landschoff              <torsten@debian.org>
-+      Uns Lider                       <unslider@miranda.org>
-+      Uwe Girlich                     <Uwe.Girlich@philosys.de>
-+      Xianjie Zhang                   <xzhang@cup.hp.com>
-+      Yen Yen Lim
-+      Yoann Vandoorselaere            <yoann@prelude-ids.org>
-+
-+The original LBL crew:
-+      Steve McCanne
-+      Craig Leres
-+      Van Jacobson
---- libpcap0.8-0.8.3.orig/debian/control
-+++ libpcap0.8-0.8.3/debian/control
-@@ -0,0 +1,44 @@
-+Source: libpcap0.8
-+Section: devel
-+Priority: optional
-+Maintainer: Romain Francoise <rfrancoise@debian.org>
-+Uploaders: Torsten Landschoff <torsten@debian.org>
-+Build-Depends: debhelper (>= 4), flex, bison, dpatch, perl
-+Standards-Version: 3.6.1.0
-+
-+Package: libpcap0.8-dev
-+Section: libdevel
-+Architecture: any
-+Depends: libpcap0.8 (= ${Source-Version}), libc6-dev
-+Conflicts: libpcap-dev, libpcap0.7-dev
-+Description: Development library and header files for libpcap 0.8
-+ Headers, static libraries, and documentation for the libpcap library.
-+ .
-+ libpcap (Packet CAPture) provides a portable framework for low-level
-+ network monitoring.  Applications include network statistics
-+ collection, security monitoring, network debugging, etc.
-+ .
-+ Since almost every system vendor provides a different interface for 
-+ packet capture, and since there are several tools that require this 
-+ functionality, we've created this system-independent API to ease in 
-+ porting and to alleviate the need for several system-dependent packet 
-+ capture modules in each application.
-+ .
-+ Further information is available at <URL: http://www.tcpdump.org/>
-+
-+Package: libpcap0.8
-+Section: libs
-+Architecture: any
-+Depends: ${shlibs:Depends}
-+Description: System interface for user-level packet capture
-+ libpcap (Packet CAPture) provides a portable framework for low-level 
-+ network monitoring.  Applications include network statistics collection, 
-+ security monitoring, network debugging, etc.  
-+ .
-+ Since almost every system vendor provides a different interface for 
-+ packet capture, and since there are several tools that require this 
-+ functionality, we've created this system-independent API to ease in 
-+ porting and to alleviate the need for several system-dependent packet 
-+ capture modules in each application.
-+ .
-+ Further information is available at <URL: http://www.tcpdump.org/>
---- libpcap0.8-0.8.3.orig/debian/changelog
-+++ libpcap0.8-0.8.3/debian/changelog
-@@ -0,0 +1,236 @@
-+libpcap0.8 (0.8.3-4) unstable; urgency=low
-+
-+  * debian/patches/30_man_fixes.dpatch: Explicitly mention `pcap_handler'
-+    as routine type for pcap_loop() and pcap_dispatch() callbacks,
-+    suggested by Florian Weimer <fw@deneb.enyo.de> (closes: #255267).
-+
-+ -- Romain Francoise <rfrancoise@debian.org>  Wed, 21 Jul 2004 19:46:07 +0200
-+
-+libpcap0.8 (0.8.3-3) unstable; urgency=low
-+
-+  * debian/control: libpcap0.8-dev conflicts with libpcap0.7-dev.
-+
-+ -- Romain Francoise <rfrancoise@debian.org>  Wed,  9 Jun 2004 11:44:50 +0200
-+
-+libpcap0.8 (0.8.3-2) unstable; urgency=low
-+
-+  * debian/control:
-+    + Put back URL markers in description.
-+    + Switch Maintainer and Uploaders fields to match reality.
-+  * debian/patches/30_man_fixes.dpatch: Patch to fix some inconsistencies 
-+    in the upstream man page (tcpdump is in section 8, not 1).
-+  * debian/patches/00list: Add 30_man_fixes.
-+
-+ -- Romain Francoise <rfrancoise@debian.org>  Fri, 14 May 2004 23:43:02 +0200
-+
-+libpcap0.8 (0.8.3-1) unstable; urgency=low
-+
-+  * New upstream release (closes: #235155).
-+    + bpf_filter.c now has config.h (closes: #171210).
-+    + Does not ship CVS directories anymore (closes: #119750).
-+    + Has improved "truncated file" messages (closes: #207535).
-+  * New source package to ease the 0.7 -> 0.8 transition, each source
-+    package builds corresponding libpcap0.x{,-dev} binary packages.  The
-+    libpcap-dev package is provided by libpcap0.7 for now.
-+  * debian/copyright: Rewrite.  Licensing information is now complete in
-+    the upstream tarball.
-+  * debian/control: 
-+    + Update source and binary package names.
-+    + Build-Depend on dpatch, perl.
-+    + Bump Standards-Version to 3.6.1.0.
-+  * debian/rules:
-+    + Clean up CFLAGS handling.
-+    + Support DEB_BUILD_OPTIONS.
-+    + Use dpatch for patch management.
-+    + Compute major/minor versions from the changelog instead of
-+      hardcoding them.
-+  * debian/patches: New directory.
-+  * debian/patches/10_shared_lib.dpatch: Patch split off the Debian diff 
-+    to build a shared library (upstream does not support it).
-+  * debian/patches/20_mac_syntax.dpatch: Patch split off the Debian diff 
-+    to support more MAC address syntaxes (by Torsten Landschoff).
-+  * debian/patches/00list: New file (patch list).
-+
-+ -- Romain Francoise <rfrancoise@debian.org>  Fri, 30 Apr 2004 16:14:10 +0200
-+
-+libpcap (0.7.2-5) unstable; urgency=low
-+
-+  * debian/rules: Update version variables, this is version 0.7.2.
-+  * Makefile.in: Fix version.
-+
-+ -- Romain Francoise <rfrancoise@debian.org>  Tue, 11 Nov 2003 12:14:28 +0100
-+
-+libpcap (0.7.2-4) unstable; urgency=low
-+
-+  * debian/libpcap-dev.preinst: New file.  Remove old symlink from
-+    /usr/share/doc/libpcap-dev to libpcap0 since we now have a real
-+    libpcap-dev directory.  Closes: #175742.
-+  * debian/rules: Add -A flag to dh_installdocs so that it acts on all
-+    binary packages.
-+
-+ -- Romain Francoise <rfrancoise@debian.org>  Mon, 20 Oct 2003 18:49:22 +0200
-+
-+libpcap (0.7.2-3) unstable; urgency=low
-+
-+  * debian/control: libpcap-dev is in section libdevel, not in section
-+    devel.
-+
-+ -- Romain Francoise <rfrancoise@debian.org>  Sun, 19 Oct 2003 19:22:12 +0200
-+
-+libpcap (0.7.2-2) unstable; urgency=low
-+
-+  * debian/control: 
-+    + Adding myself as co-maintainer, with Torsten's blessing.
-+    + Repeat extended description in libpcap-dev description
-+      (closes: #209728)
-+    + Remove Emacs-style <URL: ...> markers from the descriptions.
-+      (closes: #196727).
-+    + Remove full stops from synopsis as per Policy.
-+    + Add versioned build-dependency on debhelper (>= 4).
-+  * debian/copyright: Remove dh-make boilerplates.
-+  * debian/compat: New file.
-+  * debian/rules: Remove obsolete DH_COMPAT variable.
-+
-+ -- Romain Francoise <rfrancoise@debian.org>  Sun, 19 Oct 2003 18:17:41 +0200
-+
-+libpcap (0.7.2-1) unstable; urgency=low
-+
-+  * New upstream release.
-+
-+ -- Torsten Landschoff <torsten@debian.org>  Sat,  7 Jun 2003 22:57:55 +0200
-+
-+libpcap (0.7.1-1) unstable; urgency=low
-+
-+  * New upstream release (closes: #145538).
-+  * debian/rules: Build the library with _FILE_OFFSET_BITS set to 64
-+    to allow for files bigger than 2GB (closes: #129213).
-+  * Rename the library package to libpcap0.7 and change the SONAME so that we
-+    can account for interface changes (closes: #132359).
-+  * Run ldconfig as appropriate (lintian).
-+  * Remove watch.ex template and the silly symlink from libpcap-dev's 
-+    documentation to libpcap0 (lintian).
-+
-+ -- Torsten Landschoff <torsten@debian.org>  Sat,  3 Aug 2002 23:33:56 +0200
-+
-+libpcap (0.6.2-2) unstable; urgency=low
-+
-+  * debian/control: Change section of libpcap0 from net to libs
-+    (Debian installer message).
-+  * aclocal.m4: Treat the ia64 as a cpu which can't handle unaligned 
-+    memory access (closes: #112152). Thanks for the report go to 
-+    John R. Daily.
-+
-+ -- Torsten Landschoff <torsten@debian.org>  Fri, 14 Sep 2001 10:15:52 +0200
-+
-+libpcap (0.6.2-1) unstable; urgency=medium
-+
-+  * New upstream release.
-+  * debian/control: Removed Build-Depends already satisfied by the
-+    build-essential package.
-+  * gencode.c (gen_scode): Add the missing default branch of the protocol
-+    family switch (closes: 88688).
-+  * debian/libpcap.post{rm,inst}: Run ldconfig (lintian).
-+  * debian/copyright: Fix the "similiar" typo (lintian).
-+
-+ -- Torsten Landschoff <torsten@debian.org>  Tue,  6 Mar 2001 04:27:27 +0100
-+
-+libpcap (0.6.1-2) unstable; urgency=low
-+
-+  * debian/rules: Changed the shlibs info so that only pcap 0.6
-+    is okay for packages linked against this version.
-+
-+ -- Torsten Landschoff <torsten@debian.org>  Thu, 18 Jan 2001 01:13:20 +0100
-+
-+libpcap (0.6.1-1) unstable; urgency=low
-+
-+  * Taking back the package. Kudos to Anand for helping out.
-+  * debian/rules: Pass --enable-ipv6 to configure (closes: #80223).
-+
-+ -- Torsten Landschoff <torsten@debian.org>  Tue, 16 Jan 2001 15:40:37 +0100
-+
-+libpcap (0.5.2-2) unstable; urgency=low
-+
-+  * Update config.guess and config.sub (Closes #26031)
-+  * Source builds would not always work. Fix that.
-+  * Kernel interface problem is really a module not loaded problem. 
-+    Note this in README.Debian. (Closes #21356)
-+
-+ -- Anand Kumria <wildfire@progsoc.org>  Tue, 28 Nov 2000 02:03:25 +1100
-+
-+libpcap (0.5.2-1) unstable; urgency=low
-+
-+  * New upstream release
-+  * New maintainer
-+  * Migrate to Debhelper and insert Build-Depends
-+
-+ -- Anand Kumria <wildfire@progsoc.org>  Sun, 12 Nov 2000 03:19:44 +1100
-+
-+libpcap (0.4a6-3) unstable; urgency=low
-+
-+  * New maintainer.
-+  * scanner.l: Allow a 12 digit hex number as ether address as well as 
-+    BB.BB.BB.BB.BB.BB (closes: #48735)
-+  * nametoaddr.c (pcap_ether_aton): Adjust for change in scanner.l
-+
-+ -- Torsten Landschoff <torsten@debian.org>  Mon, 22 Nov 1999 02:39:45 +0100
-+
-+libpcap (0.4a6-2.1) unstable; urgency=low
-+
-+  * Non maintainer upload.
-+    config.{guess,sub} changed to recognize a Arm architecture.
-+
-+ -- Turbo Fredriksson <turbo@debian.org>  Thu, 20 Aug 1998 23:12:36 -0400
-+
-+libpcap (0.4a6-2) frozen unstable; urgency=low
-+
-+  * renamed /usr/doc/libpcap to /usr/doc/libpcap0 (should fix several
-+    lintian warnings)
-+  * updated standards-version
-+  * rebuild with latest debmake
-+
-+ -- Peter Tobias <tobias@et-inf.fho-emden.de>  Mon, 30 Mar 1998 00:46:44 +0200
-+
-+
-+libpcap (0.4a6-1) unstable; urgency=low
-+
-+  * upgraded to latest upstream version, fixes: Bug#17164
-+  * added patch from Michael Alan Dorman <mdorman@mdorman.law.miami.edu>
-+    for building libpcap on alpha systems, fixes: Bug#15556
-+  * fixed aclocal.m4 script
-+
-+ -- Peter Tobias <tobias@et-inf.fho-emden.de>  Sat, 31 Jan 1998 23:19:42 +0100
-+
-+
-+libpcap (0.4a2-2) unstable; urgency=low
-+
-+  * fixed detection of IFF_LOOPBACK for linux systems
-+  * link shared library with -l
-+
-+ -- Peter Tobias <tobias@et-inf.fho-emden.de>  Wed, 19 Nov 1997 23:44:34 +0100
-+
-+
-+libpcap (0.4a2-1) unstable; urgency=low
-+
-+  * new maintainer
-+  * latest upstream release
-+  * libc6 version
-+  * compiled with _REENTRANT
-+
-+ -- Peter Tobias <tobias@et-inf.fho-emden.de>  Wed, 17 Sep 1997 20:40:01 +0200
-+
-+
-+libpcap (0.3.1a3-1) unstable; urgency=low
-+
-+  * Latest upstream release.  Fixes bug #6670.
-+
-+ -- Karl Sackett <krs@debian.org>  Wed, 2 Apr 1997 10:19:28 -0600
-+
-+
-+libpcap (0.3-1) unstable; urgency=low
-+
-+  * First Debian release.
-+  * Makefile.in: supports libpcap.so target.
-+
-+ -- Karl Sackett <krs@debian.org>  Wed, 8 Jan 1997 09:38:31 -0600
-+
-+
---- libpcap0.8-0.8.3.orig/debian/rules
-+++ libpcap0.8-0.8.3/debian/rules
-@@ -0,0 +1,81 @@
-+#!/usr/bin/make -f
-+
-+include /usr/share/dpatch/dpatch.make
-+
-+version := $(shell head -1 debian/changelog | \
-+      perl -nle 'm/\S+\s+\((\S+)-\S+\)/ and print $$1')
-+major := $(shell head -1 debian/changelog | perl -nle \
-+      'm/\S+\s+\((\d\.\d)\.\d+-\S+\)/ and print $$1')
-+
-+export CFLAGS=-D_FILE_OFFSET_BITS=64
-+
-+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-+        CFLAGS += -O0
-+endif
-+
-+build: patch build-stamp
-+build-stamp:
-+      dh_testdir
-+
-+      ./configure --prefix=/usr \
-+              --mandir=\$${prefix}/share/man \
-+              --enable-ipv6 --infodir=\$${prefix}/share/info
-+      $(MAKE)
-+
-+      touch build-stamp
-+
-+clean: clean-patched unpatch
-+clean-patched:
-+      dh_testdir
-+      dh_testroot
-+      rm -f build-stamp
-+
-+      -$(MAKE) distclean
-+
-+      rm -f net
-+
-+      dh_clean
-+
-+install: build
-+      dh_testdir
-+      dh_testroot
-+      dh_clean -k
-+      dh_installdirs
-+
-+      $(MAKE) install prefix=`pwd`/debian/libpcap0.8-dev/usr
-+
-+binary-indep: build install
-+# We have nothing to do by default.
-+
-+binary-arch: build install
-+#     dh_testversion
-+      dh_testdir
-+      dh_testroot
-+        #
-+        # build libpcap${major} package by moving files from libpcap0.8-dev
-+        #
-+      dh_movefiles -plibpcap$(major) --sourcedir=debian/libpcap0.8-dev \
-+              usr/lib/libpcap.so.$(major)        \
-+              usr/lib/libpcap.so.$(version)
-+
-+#     dh_installdebconf       
-+      dh_installdocs -A debian/README.Debian
-+      dh_installexamples
-+      dh_installmenu
-+      dh_installmanpages -plibpcap0.8-dev
-+      dh_installinfo
-+#     dh_undocumented
-+      dh_installchangelogs CHANGES
-+      dh_link -plibpcap0.8-dev
-+      dh_strip
-+      dh_compress
-+      dh_fixperms
-+      dh_makeshlibs
-+      dh_installdeb
-+      dh_shlibdeps 
-+      dh_gencontrol
-+      dh_md5sums
-+      dh_builddeb
-+
-+binary: binary-indep binary-arch
-+.PHONY: build clean binary-indep binary-arch binary install
---- libpcap0.8-0.8.3.orig/debian/patches/10_shared_lib.dpatch
-+++ libpcap0.8-0.8.3/debian/patches/10_shared_lib.dpatch
-@@ -0,0 +1,144 @@
-+#! /bin/sh -e
-+## 10_shared_lib.dpatch by Romain Francoise <rfrancoise@debian.org>
-+##
-+## All lines beginning with `## DP:' are a description of the patch.
-+## DP: Debian-specific modifications to the upstream Makefile.in to
-+## DP: build a shared library.
-+
-+if [ $# -lt 1 ]; then
-+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-+    exit 1
-+fi
-+
-+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
-+
-+case "$1" in
-+    -patch) patch -p1 ${patch_opts} < $0;;
-+    -unpatch) patch -R -p1 ${patch_opts} < $0;;
-+    *)
-+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-+        exit 1;;
-+esac
-+
-+exit 0
-+
-+@DPATCH@
-+diff -urNad /home/romain/Work/Debian/libpcap/libpcap0.8/libpcap0.8-0.8.3/Makefile.in libpcap0.8-0.8.3/Makefile.in
-+--- /home/romain/Work/Debian/libpcap/libpcap0.8/libpcap0.8-0.8.3/Makefile.in  2004-04-30 16:40:33.000000000 +0200
-++++ libpcap0.8-0.8.3/Makefile.in      2004-04-30 16:41:43.000000000 +0200
-+@@ -37,6 +37,15 @@
-+ srcdir = @srcdir@
-+ VPATH = @srcdir@
-+ 
-++# some defines for shared library compilation
-++MAJ=$(shell head -1 debian/changelog | perl -nle 'm/\S+\s+\((\d\.\d)\.\d+-\S+\)/ and print $$1')
-++MIN=$(shell head -1 debian/changelog | perl -nle 'm/\S+\s+\(\d\.\d\.(\d+)-\S+\)/ and print $$1')
-++VERSION=$(MAJ).$(MIN)
-++LIBNAME=pcap
-++LIBRARY=lib$(LIBNAME).a
-++SOLIBRARY=lib$(LIBNAME).so
-++SHAREDLIB=$(SOLIBRARY).$(VERSION)
-++
-+ #
-+ # You shouldn't need to edit anything below.
-+ #
-+@@ -49,6 +58,7 @@
-+ 
-+ # Standard CFLAGS
-+ CFLAGS = $(CCOPT) $(INCLS) $(DEFS)
-++CFLAGS_SHARED = -shared -Wl,-soname,$(SOLIBRARY).$(MAJ)
-+ 
-+ INSTALL = @INSTALL@
-+ INSTALL_PROGRAM = @INSTALL_PROGRAM@
-+@@ -68,7 +78,11 @@
-+ # problem if you don't own the file but can write to the directory.
-+ .c.o:
-+      @rm -f $@
-+-     $(CC) $(CFLAGS) -c $(srcdir)/$*.c
-++     $(CC) $(CFLAGS) -c -o $@ $(srcdir)/$*.c
-++
-++%_pic.o: %.c
-++     @rm -f $@
-++     $(CC) -fPIC $(CFLAGS) -c -o $@ $(srcdir)/$*.c
-+ 
-+ PSRC =       pcap-@V_PCAP@.c
-+ FSRC =  fad-@V_FINDALLDEVS@.c
-+@@ -83,6 +97,7 @@
-+ # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
-+ # hack the extra indirection
-+ OBJ =        $(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) $(LIBOBJS)
-++OBJ_PIC = $(PSRC:.c=_pic.o) $(FSRC:.c=_pic.o) $(CSRC:.c=_pic.o) $(SSRC:.c=_pic.o) $(GENSRC:.c=_pic.o)
-+ HDR =        pcap.h pcap-int.h pcap-namedb.h pcap-nit.h pcap-pf.h \
-+      ethertype.h gencode.h gnuc.h
-+ GENHDR = \
-+@@ -94,15 +109,22 @@
-+ TAGFILES = \
-+      $(SRC) $(HDR) $(TAGHDR)
-+ 
-+-CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c
-++CLEANFILES = $(OBJ) $(OBJ_PIC) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c libpcap.so*
-+ 
-+-all: libpcap.a
-++all: libpcap.a $(SHAREDLIB)
-+ 
-+ libpcap.a: $(OBJ)
-+      @rm -f $@
-+      ar rc $@ $(OBJ) $(LIBS)
-+      $(RANLIB) $@
-+ 
-++$(SHAREDLIB): $(OBJ_PIC)
-++     -@rm -f $@
-++     -@rm -f $(SOLIBRARY) $(SOLIBRARY).$(MAJ)
-++     $(CC) $(CFLAGS_SHARED) -o $(SHAREDLIB) $(OBJ_PIC) -lc
-++     ln -s $(SHAREDLIB) $(SOLIBRARY).$(MAJ)
-++     ln -s $(SOLIBRARY).$(MAJ) $(SOLIBRARY)
-++
-+ scanner.c: $(srcdir)/scanner.l
-+      @rm -f $@
-+      $(LEX) -t $< > $$$$.$@; mv $$$$.$@ $@
-+@@ -110,6 +132,9 @@
-+ scanner.o: scanner.c tokdefs.h
-+      $(CC) $(CFLAGS) -c scanner.c
-+ 
-++scanner_pic.o: scanner.c tokdefs.h
-++     $(CC) -fPIC $(CFLAGS) -o $@ -c scanner.c
-++
-+ pcap.o: version.h
-+ 
-+ tokdefs.h: grammar.c
-+@@ -123,9 +148,17 @@
-+      @rm -f $@
-+      $(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c
-+ 
-++grammar_pic.o: grammar.c
-++     @rm -f $@
-++     $(CC) -fPIC $(CFLAGS) -Dyylval=pcap_lval -o $@ -c grammar.c 
-++
-+ version.o: version.c
-+      $(CC) $(CFLAGS) -c version.c
-+ 
-++version_pic.o: version.c
-++     $(CC) -fPIC $(CFLAGS) -c version.c -o $@
-++
-++
-+ snprintf.o: $(srcdir)/missing/snprintf.c
-+      $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
-+ 
-+@@ -151,10 +184,16 @@
-+ bpf_filter.o: bpf_filter.c
-+      $(CC) $(CFLAGS) -c bpf_filter.c
-+ 
-++bpf_filter_pic.o: bpf_filter.c
-++     $(CC) -fPIC $(CFLAGS) -c bpf_filter.c -o $@
-++
-+ install:
-+      [ -d $(DESTDIR)$(libdir) ] || \
-+          (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
-+      $(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a
-++     $(INSTALL_DATA) $(SHAREDLIB) $(DESTDIR)$(libdir)/
-++     ln -sf $(SHAREDLIB) $(DESTDIR)$(libdir)/$(SOLIBRARY).$(MAJ)
-++     ln -sf $(SOLIBRARY).$(MAJ) $(DESTDIR)$(libdir)/$(SOLIBRARY)
-+      $(RANLIB) $(DESTDIR)$(libdir)/libpcap.a
-+      [ -d $(DESTDIR)$(includedir) ] || \
-+          (mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir))
---- libpcap0.8-0.8.3.orig/debian/patches/20_mac_syntax.dpatch
-+++ libpcap0.8-0.8.3/debian/patches/20_mac_syntax.dpatch
-@@ -0,0 +1,68 @@
-+#! /bin/sh -e
-+## 20_mac_syntax.dpatch by Torsten Landschoff <torsten@debian.org>
-+##
-+## All lines beginning with `## DP:' are a description of the patch.
-+## DP: Adds more possible syntaxes to input MAC addresses:
-+## DP: - the nn.nn.nn.nn.nn.nn syntax
-+## DP: - the hexadecimal syntax
-+
-+if [ $# -lt 1 ]; then
-+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-+    exit 1
-+fi
-+
-+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
-+
-+case "$1" in
-+    -patch) patch -p1 ${patch_opts} < $0;;
-+    -unpatch) patch -R -p1 ${patch_opts} < $0;;
-+    *)
-+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-+        exit 1;;
-+esac
-+
-+exit 0
-+
-+@DPATCH@
-+diff -urNad /home/romain/Work/Debian/libpcap/libpcap0.8/libpcap0.8-0.8.3/nametoaddr.c libpcap0.8-0.8.3/nametoaddr.c
-+--- /home/romain/Work/Debian/libpcap/libpcap0.8/libpcap0.8-0.8.3/nametoaddr.c 2004-04-30 15:45:14.000000000 +0200
-++++ libpcap0.8-0.8.3/nametoaddr.c     2004-04-30 15:57:54.000000000 +0200
-+@@ -333,7 +333,7 @@
-+      e = ep = (u_char *)malloc(6);
-+ 
-+      while (*s) {
-+-             if (*s == ':')
-++             if (*s == ':' || *s == '.')
-+                      s += 1;
-+              d = xdtoi(*s++);
-+              if (isxdigit((unsigned char)*s)) {
-+diff -urNad /home/romain/Work/Debian/libpcap/libpcap0.8/libpcap0.8-0.8.3/scanner.l libpcap0.8-0.8.3/scanner.l
-+--- /home/romain/Work/Debian/libpcap/libpcap0.8/libpcap0.8-0.8.3/scanner.l    2004-04-30 15:45:14.000000000 +0200
-++++ libpcap0.8-0.8.3/scanner.l        2004-04-30 15:57:54.000000000 +0200
-+@@ -80,6 +80,7 @@
-+ N            ([0-9]+|(0X|0x)[0-9A-Fa-f]+)
-+ B            ([0-9A-Fa-f][0-9A-Fa-f]?)
-+ W            ([0-9A-Fa-f][0-9A-Fa-f]?[0-9A-Fa-f]?[0-9A-Fa-f]?)
-++X            [0-9A-Fa-f]
-+ 
-+ %a 16000
-+ %o 19000
-+@@ -296,7 +297,7 @@
-+ {N}                  { yylval.i = stoi((char *)yytext); return NUM; }
-+ ({N}\.{N})|({N}\.{N}\.{N})|({N}\.{N}\.{N}\.{N})      {
-+                      yylval.s = sdup((char *)yytext); return HID; }
-+-{B}:{B}:{B}:{B}:{B}:{B} { yylval.e = pcap_ether_aton((char *)yytext);
-++({B}:{B}:{B}:{B}:{B}:{B})|({B}\.{B}\.{B}\.{B}\.{B}\.{B}) { yylval.e = pcap_ether_aton((char *)yytext);
-+                        return EID; }
-+ {V6}                 {
-+ #ifdef INET6
-+@@ -314,6 +315,8 @@
-+ #endif /*INET6*/
-+                      }
-+ {B}:+({B}:+)+                { bpf_error("bogus ethernet address %s", yytext); }
-++{X}{12}                      { yylval.e = pcap_ether_aton((char *)yytext); return EID;}
-++
-+ icmptype             { yylval.i = 0; return NUM; }
-+ icmpcode             { yylval.i = 1; return NUM; }
-+ icmp-echoreply               { yylval.i = 0; return NUM; }
---- libpcap0.8-0.8.3.orig/debian/patches/00list
-+++ libpcap0.8-0.8.3/debian/patches/00list
-@@ -0,0 +1,3 @@
-+10_shared_lib
-+20_mac_syntax
-+30_man_fixes
---- libpcap0.8-0.8.3.orig/debian/patches/30_man_fixes.dpatch
-+++ libpcap0.8-0.8.3/debian/patches/30_man_fixes.dpatch
-@@ -0,0 +1,57 @@
-+#! /bin/sh -e
-+## 30_man_fixes.dpatch by Romain Francoise <rfrancoise@debian.org>
-+##
-+## All lines beginning with `## DP:' are a description of the patch.
-+## DP: Misc. fixes to the upstream man page.
-+
-+if [ $# -lt 1 ]; then
-+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-+    exit 1
-+fi
-+
-+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
-+
-+case "$1" in
-+    -patch) patch -p1 ${patch_opts} < $0;;
-+    -unpatch) patch -R -p1 ${patch_opts} < $0;;
-+    *)
-+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-+        exit 1;;
-+esac
-+
-+exit 0
-+
-+@DPATCH@
-+diff -urNad /home/romain/Work/Debian/libpcap0.8/libpcap0.8-0.8.3/pcap.3 libpcap0.8-0.8.3/pcap.3
-+--- /home/romain/Work/Debian/libpcap0.8/libpcap0.8-0.8.3/pcap.3       2004-07-21 19:41:53.000000000 +0200
-++++ libpcap0.8-0.8.3/pcap.3   2004-07-21 19:42:28.000000000 +0200
-+@@ -201,7 +201,7 @@
-+ .I fname
-+ specifies the name of the file to open. The file has
-+ the same format as those used by
-+-.B tcpdump(1)
-++.B tcpdump(8)
-+ and
-+ .BR tcpslice(1) .
-+ The name "-" in a synonym for
-+@@ -404,7 +404,9 @@
-+ live capture, or all the packets in the file when reading a
-+ ``savefile''.
-+ .I callback
-+-specifies a routine to be called with three arguments:
-++specifies a 
-++.I pcap_handler
-++routine to be called with three arguments:
-+ a
-+ .I u_char
-+ pointer which is passed in from
-+@@ -1168,7 +1170,7 @@
-+ closes the ``savefile.''
-+ .PP
-+ .SH SEE ALSO
-+-tcpdump(1), tcpslice(1)
-++tcpdump(8), tcpslice(1)
-+ .SH AUTHORS
-+ The original authors are:
-+ .LP
---- libpcap0.8-0.8.3.orig/debian/README.Debian
-+++ libpcap0.8-0.8.3/debian/README.Debian
-@@ -0,0 +1,13 @@
-+libpcap for Debian
-+------------------
-+
-+ If you receive messages telling you the packet type is not supported
-+ or is deprecated check that CONFIG_PACKET is set to either `Y' or `M'.
-+
-+ You should also check that /etc/modules.conf has the line
-+
-+      alias net-pf-17 af_packet
-+
-+ Feel free to report bugs.
-+
-+ -- Anand Kumria <wildfire@progsoc.org>, Tue, 28 Nov 2000 02:04:28 EST
---- libpcap0.8-0.8.3.orig/debian/libpcap0.8-dev.preinst
-+++ libpcap0.8-0.8.3/debian/libpcap0.8-dev.preinst
-@@ -0,0 +1,9 @@
-+#!/bin/sh
-+set -e
-+
-+# Remove old symlink, if it exists
-+if [ -L /usr/share/doc/libpcap-dev ]; then 
-+      rm -f /usr/share/doc/libpcap-dev ; 
-+fi
-+
-+#DEBHELPER#
---- libpcap0.8-0.8.3.orig/debian/libpcap0.8.postinst
-+++ libpcap0.8-0.8.3/debian/libpcap0.8.postinst
-@@ -0,0 +1,8 @@
-+#! /bin/sh
-+
-+if [ "$1" = "configure" ]; then
-+      ldconfig
-+fi
-+
-+#DEBHELPER#
-+
---- libpcap0.8-0.8.3.orig/debian/libpcap0.8-dev.dirs
-+++ libpcap0.8-0.8.3/debian/libpcap0.8-dev.dirs
-@@ -0,0 +1,3 @@
-+usr/lib
-+usr/include
-+usr/share/man/man3
---- libpcap0.8-0.8.3.orig/debian/libpcap0.8.docs
-+++ libpcap0.8-0.8.3/debian/libpcap0.8.docs
-@@ -0,0 +1,2 @@
-+README
-+CREDITS
---- libpcap0.8-0.8.3.orig/debian/libpcap0.8.postrm
-+++ libpcap0.8-0.8.3/debian/libpcap0.8.postrm
-@@ -0,0 +1,8 @@
-+#! /bin/sh
-+
-+if [ "$1" = "remove" ]; then
-+      ldconfig
-+fi
-+
-+#DEBHELPER#
-+
diff --git a/obsolete-buildroot/sources/openwrt/patches/matrixssl/matrixssl-1.1.2-openwrt.patch b/obsolete-buildroot/sources/openwrt/patches/matrixssl/matrixssl-1.1.2-openwrt.patch
deleted file mode 100644 (file)
index dfd8b5d..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -ruN matrixssl-1.1.2-old/src/Makefile matrixssl-1.1.2-new/src/Makefile
---- matrixssl-1.1.2-old/src/Makefile   2004-06-10 21:03:25.000000000 +0200
-+++ matrixssl-1.1.2-new/src/Makefile   2004-07-09 22:58:06.000000000 +0200
-@@ -46,8 +46,8 @@
- #     Compile options
- #
- SHARED        = -shared
--CFLAGS  = $(DFLAGS) -DLINUX
--LDFLAGS = -nostdlib -lc -lpthread
-+CFLAGS  = $(DFLAGS) -DLINUX -fPIC
-+LDFLAGS = -lc -lpthread -Wl,-soname,libmatrixssl.so.1.2
- #
- #     Override variables for compilation on Mac OS X (Darwin)
diff --git a/obsolete-buildroot/sources/openwrt/patches/matrixssl/matrixssl-1.2.1-examples_fix.patch b/obsolete-buildroot/sources/openwrt/patches/matrixssl/matrixssl-1.2.1-examples_fix.patch
deleted file mode 100644 (file)
index e9980d6..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ruN matrixssl-1.2.1-old/examples/Makefile matrixssl-1.2.1-new/examples/Makefile
---- matrixssl-1.2.1-old/examples/Makefile      2004-06-05 00:45:21.000000000 +0200
-+++ matrixssl-1.2.1-new/examples/Makefile      2004-08-19 04:01:29.000000000 +0200
-@@ -34,7 +34,7 @@
- #     Compile options
- #
- CFLAGS  = $(DFLAGS) -DLINUX
--LDFLAGS = -lc
-+LDFLAGS = -lc -lpthread
- #
- #   Override variables for compilation on Mac OS X (Darwin)
diff --git a/obsolete-buildroot/sources/openwrt/patches/ppp/000_ppp-2.4.2-cvs-20040427.patch b/obsolete-buildroot/sources/openwrt/patches/ppp/000_ppp-2.4.2-cvs-20040427.patch
deleted file mode 100644 (file)
index 7ccc1b4..0000000
+++ /dev/null
@@ -1,3429 +0,0 @@
-diff -ruN ppp-2.4.2/TODO ppp-cvs-20040427/TODO
---- ppp-2.4.2/TODO     1970-01-01 01:00:00.000000000 +0100
-+++ ppp-cvs-20040427/TODO      1999-03-22 07:38:09.000000000 +0100
-@@ -0,0 +1,16 @@
-+* Things to do *
-+
-+- How should we handle the case where MTU > MRU?
-+  Should we reduce the IP MTU to the link MRU (so TCP MSS is correct)?
-+
-+- Provide ways to:
-+  + set the IP address, possibly based on the peer's identity
-+  + have external checking of PAP user/password, CHAP response
-+  + supply the PAP user/password, CHAP secret
-+  + decide which tty to use (locking, DTR issues)
-+
-+- Integrate callback stuff?
-+
-+- Implement link quality monitoring
-+
-+- Implement other network control protocols
-diff -ruN ppp-2.4.2/chat/chat.c ppp-cvs-20040427/chat/chat.c
---- ppp-2.4.2/chat/chat.c      2003-03-30 10:23:48.000000000 +0200
-+++ ppp-cvs-20040427/chat/chat.c       2004-01-17 06:50:11.000000000 +0100
-@@ -87,7 +87,7 @@
- #endif
- #ifndef lint
--static const char rcsid[] = "$Id: chat.c,v 1.29 2003/03/04 06:17:21 fcusack Exp $";
-+static const char rcsid[] = "$Id: chat.c,v 1.30 2004/01/17 05:47:55 carlsonj Exp $";
- #endif
- #include <stdio.h>
-@@ -213,7 +213,7 @@
- void *copy_of __P((char *s));
- char *grow __P((char *s, char **p, size_t len));
- void usage __P((void));
--void logf __P((const char *fmt, ...));
-+void msgf __P((const char *fmt, ...));
- void fatal __P((int code, const char *fmt, ...));
- SIGTYPE sigalrm __P((int signo));
- SIGTYPE sigint __P((int signo));
-@@ -495,7 +495,7 @@
- /*
-  * Send a message to syslog and/or stderr.
-  */
--void logf __V((const char *fmt, ...))
-+void msgf __V((const char *fmt, ...))
- {
-     va_list args;
-@@ -558,7 +558,7 @@
-       fatal(2, "Can't set file mode flags on stdin: %m");
-     if (verbose)
--      logf("alarm");
-+      msgf("alarm");
- }
- void unalarm()
-@@ -1001,9 +1001,9 @@
-  * The expectation did not occur. This is terminal.
-  */
-     if (fail_reason)
--      logf("Failed (%s)", fail_reason);
-+      msgf("Failed (%s)", fail_reason);
-     else
--      logf("Failed");
-+      msgf("Failed");
-     terminate(exit_code);
- }
-@@ -1079,7 +1079,7 @@
-       abort_string[n_aborts++] = s1;
-       if (verbose)
--          logf("abort on (%v)", s);
-+          msgf("abort on (%v)", s);
-       return;
-     }
-@@ -1105,7 +1105,7 @@
-               pack++;
-               n_aborts--;
-               if (verbose)
--                  logf("clear abort on (%v)", s);
-+                  msgf("clear abort on (%v)", s);
-           }
-       }
-         free(s1);
-@@ -1129,7 +1129,7 @@
-       report_string[n_reports++] = s1;
-       
-       if (verbose)
--          logf("report (%v)", s);
-+          msgf("report (%v)", s);
-       return;
-     }
-@@ -1155,7 +1155,7 @@
-               pack++;
-               n_reports--;
-               if (verbose)
--                  logf("clear report (%v)", s);
-+                  msgf("clear report (%v)", s);
-           }
-       }
-         free(s1);
-@@ -1173,7 +1173,7 @@
-           timeout = DEFAULT_CHAT_TIMEOUT;
-       if (verbose)
--          logf("timeout set to %d seconds", timeout);
-+          msgf("timeout set to %d seconds", timeout);
-       return;
-     }
-@@ -1236,7 +1236,7 @@
-       return ((int)c & 0x7F);
-     default:
--      logf("warning: read() on stdin returned %d", status);
-+      msgf("warning: read() on stdin returned %d", status);
-     case -1:
-       if ((status = fcntl(0, F_GETFL, 0)) == -1)
-@@ -1264,7 +1264,7 @@
-       return (0);
-       
-     default:
--      logf("warning: write() on stdout returned %d", status);
-+      msgf("warning: write() on stdout returned %d", status);
-       
-     case -1:
-       if ((status = fcntl(0, F_GETFL, 0)) == -1)
-@@ -1286,9 +1286,9 @@
-       if (verbose) {
-           if (errno == EINTR || errno == EWOULDBLOCK)
--              logf(" -- write timed out");
-+              msgf(" -- write timed out");
-           else
--              logf(" -- write failed: %m");
-+              msgf(" -- write failed: %m");
-       }
-       return (0);
-     }
-@@ -1303,9 +1303,9 @@
-     if (verbose) {
-       if (quiet)
--          logf("send (??????)");
-+          msgf("send (??????)");
-       else
--          logf("send (%v)", s);
-+          msgf("send (%v)", s);
-     }
-     alarm(timeout); alarmed = 0;
-@@ -1392,17 +1392,17 @@
-     minlen = (len > sizeof(fail_buffer)? len: sizeof(fail_buffer)) - 1;
-     if (verbose)
--      logf("expect (%v)", string);
-+      msgf("expect (%v)", string);
-     if (len > STR_LEN) {
--      logf("expect string is too long");
-+      msgf("expect string is too long");
-       exit_code = 1;
-       return 0;
-     }
-     if (len == 0) {
-       if (verbose)
--          logf("got it");
-+          msgf("got it");
-       return (1);
-     }
-@@ -1416,16 +1416,16 @@
-           echo_stderr(c);
-       if (verbose && c == '\n') {
-           if (s == logged)
--              logf("");       /* blank line */
-+              msgf("");       /* blank line */
-           else
--              logf("%0.*v", s - logged, logged);
-+              msgf("%0.*v", s - logged, logged);
-           logged = s + 1;
-       }
-       *s++ = c;
-       if (verbose && s >= logged + 80) {
--          logf("%0.*v", s - logged, logged);
-+          msgf("%0.*v", s - logged, logged);
-           logged = s;
-       }
-@@ -1470,8 +1470,8 @@
-           strncmp(s - len, string, len) == 0) {
-           if (verbose) {
-               if (s > logged)
--                  logf("%0.*v", s - logged, logged);
--              logf(" -- got it\n");
-+                  msgf("%0.*v", s - logged, logged);
-+              msgf(" -- got it\n");
-           }
-           alarm(0);
-@@ -1484,8 +1484,8 @@
-               strncmp(s - abort_len, abort_string[n], abort_len) == 0) {
-               if (verbose) {
-                   if (s > logged)
--                      logf("%0.*v", s - logged, logged);
--                  logf(" -- failed");
-+                      msgf("%0.*v", s - logged, logged);
-+                  msgf(" -- failed");
-               }
-               alarm(0);
-@@ -1499,7 +1499,7 @@
-       if (s >= end) {
-           if (logged < s - minlen) {
-               if (verbose)
--                  logf("%0.*v", s - logged, logged);
-+                  msgf("%0.*v", s - logged, logged);
-               logged = s;
-           }
-           s -= minlen;
-@@ -1509,16 +1509,16 @@
-       }
-       if (alarmed && verbose)
--          logf("warning: alarm synchronization problem");
-+          msgf("warning: alarm synchronization problem");
-     }
-     alarm(0);
-     
-     if (verbose && printed) {
-       if (alarmed)
--          logf(" -- read timed out");
-+          msgf(" -- read timed out");
-       else
--          logf(" -- read failed: %m");
-+          msgf(" -- read failed: %m");
-     }
-     exit_code = 3;
-diff -ruN ppp-2.4.2/configure ppp-cvs-20040427/configure
---- ppp-2.4.2/configure        2002-11-09 12:24:41.000000000 +0100
-+++ ppp-cvs-20040427/configure 2004-01-17 06:50:11.000000000 +0100
-@@ -1,5 +1,5 @@
- #!/bin/sh
--# $Id: configure,v 1.30 2002/11/02 19:48:12 carlsonj Exp $
-+# $Id: configure,v 1.31 2004/01/17 05:47:55 carlsonj Exp $
- #  if [ -d /NextApps ]; then
- #    system="NeXTStep"
-@@ -27,7 +27,7 @@
-             esac;;
-       5.[1-6]*)       state="known"; ksrc="solaris"; makext="sol2";;
-     esac
--    if [ -x /opt/SUNWspro/bin/cc ] &&
-+    if [ -x /opt/SUNWspro/bin/cc -a "$1" != "gcc" ] &&
-        /opt/SUNWspro/bin/cc -flags >/dev/null 2>&1; then
-       : # use Sun WorkShop compiler
-     elif gcc --version >/dev/null 2>&1; then
-diff -ruN ppp-2.4.2/contrib/pppgetpass/Makefile.linux ppp-cvs-20040427/contrib/pppgetpass/Makefile.linux
---- ppp-2.4.2/contrib/pppgetpass/Makefile.linux        1999-11-15 05:08:24.000000000 +0100
-+++ ppp-cvs-20040427/contrib/pppgetpass/Makefile.linux 1970-01-01 01:00:00.000000000 +0100
-@@ -1,16 +0,0 @@
--all: pppgetpass.vt pppgetpass.gtk
--
--pppgetpass.vt: pppgetpass.vt.o
--
--pppgetpass.gtk: pppgetpass.gtk.o
--      $(CC) $(LDFLAGS) pppgetpass.gtk.o `gtk-config --libs` -o pppgetpass.gtk
--pppgetpass.gtk.o: pppgetpass.gtk.c
--      $(CC) $(CFLAGS) -c pppgetpass.gtk.c `gtk-config --cflags`
--
--install: all
--      install -m 755 pppgetpass.sh /usr/bin/pppgetpass
--      install -m 4755 -o root -g root pppgetpass.vt /usr/bin/
--      install -m 755 -o root -g root pppgetpass.gtk /usr/X11/bin/
--
--clean:
--      rm -f *.o pppgetpass.gtk pppgetpass.vt core
-diff -ruN ppp-2.4.2/contrib/pppgetpass/pppgetpass.8 ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.8
---- ppp-2.4.2/contrib/pppgetpass/pppgetpass.8  1999-11-15 05:08:24.000000000 +0100
-+++ ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.8   1970-01-01 01:00:00.000000000 +0100
-@@ -1,18 +0,0 @@
--.TH PPPGETPASS 8 "26 Sep 1999"
--.SH NAME
--pppgetpass \- prompt for PAP password
--.SH SYNOPSIS
--.B pppgetpass
--.I client server fd
--.SH DESCRIPTION
--.B pppgetpass
--the outer half of a plugin for PAP password prompting in pppd.
--If the peer requires PAP, and the
--.B passprompt.so
--plugin is loaded into pppd, it will run
--.B /usr/sbin/pppgetpass
--(or another program specified by the
--.B promptprog
--option) to prompt the user for the password.
--.SH SEE ALSO
--pppd(8)
-diff -ruN ppp-2.4.2/contrib/pppgetpass/pppgetpass.gtk.c ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.gtk.c
---- ppp-2.4.2/contrib/pppgetpass/pppgetpass.gtk.c      1999-11-15 05:08:24.000000000 +0100
-+++ ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.gtk.c       1970-01-01 01:00:00.000000000 +0100
-@@ -1,92 +0,0 @@
--#include <glib.h>
--#include <gdk/gdk.h>
--#include <gtk/gtkwindow.h>
--#include <gtk/gtkmain.h>
--#include <gtk/gtkbutton.h>
--#include <gtk/gtkvbox.h>
--#include <gtk/gtklabel.h>
--#include <gtk/gtkentry.h>
--#include <gtk/gtksignal.h>
--
--#include <stdio.h>
--#include <string.h>
--#include <stdlib.h>
--#include <unistd.h>
--#include <syslog.h>
--
--int outfd;
--int err;
--
--static void okpressed(void *widget, void *clientdata)
--{
--  GtkWidget *answer=clientdata;
--  gchar *pass;
--  int passlen;
--  ssize_t wrote;
--  (void)widget;
--
--  pass=gtk_entry_get_text(GTK_ENTRY(answer));
--
--  passlen=strlen(pass);
--  if(!passlen)
--    return;
--
--  if((wrote=write(outfd, pass, passlen))!=passlen) {
--    if(wrote<0)
--      syslog(LOG_ERR, "write error on outpipe: %m");
--    else
--      syslog(LOG_ERR, "short write on outpipe");
--    err=1;
--  }
--  gtk_main_quit();
--}
--
--int main(int argc, char **argv)
--{
--  GtkWidget *mainwindow, *vbox, *question, *answer, *ok;
--  char buf[1024];
--  gtk_init(&argc, &argv);
--
--  openlog(argv[0], LOG_PID, LOG_DAEMON);
--  if(argc!=4) {
--    syslog(LOG_WARNING, "Usage error");
--    return 1;
--  }
--  outfd=atoi(argv[3]);
--  mainwindow=gtk_window_new(GTK_WINDOW_TOPLEVEL);
--  gtk_window_set_title(GTK_WINDOW(mainwindow), "pppgetpass");
--  gtk_signal_connect(GTK_OBJECT(mainwindow), "destroy",
--                     GTK_SIGNAL_FUNC(gtk_main_quit), 0);
--
--  vbox=gtk_vbox_new(FALSE, 5);
--  gtk_container_add(GTK_CONTAINER(mainwindow), vbox);
--  gtk_widget_show(vbox);
--
--  if(argv[1][0] && argv[2][0])
--    snprintf(buf, sizeof buf, "Password for PPP client %s on server %s: ", argv[1], argv[2]);
--  else if(argv[1][0] && !argv[2][0])
--    snprintf(buf, sizeof buf, "Password for PPP client %s: ", argv[1]);
--  else if(!argv[1][0] && argv[2][0])
--    snprintf(buf, sizeof buf, "Password for PPP on server %s: ", argv[2]);
--  else
--    snprintf(buf, sizeof buf, "Enter PPP password: ");
--  question=gtk_label_new(buf);
--  gtk_box_pack_start(GTK_BOX(vbox), question, FALSE, TRUE, 0);
--  gtk_widget_show(question);
--
--  answer=gtk_entry_new();
--  gtk_entry_set_visibility(GTK_ENTRY(answer), 0);
--  gtk_box_pack_start(GTK_BOX(vbox), answer, FALSE, TRUE, 0);
--  gtk_widget_show(answer);
--
--  ok=gtk_button_new_with_label("OK");
--  gtk_box_pack_start(GTK_BOX(vbox), ok, FALSE, TRUE, 0);
--  gtk_signal_connect(GTK_OBJECT(ok), "clicked",
--                     GTK_SIGNAL_FUNC(okpressed), answer);
--  gtk_widget_show(ok);
--
--  gtk_widget_show(mainwindow);
--  gtk_main();
--
--  return err;
--}
-diff -ruN ppp-2.4.2/contrib/pppgetpass/pppgetpass.sh ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.sh
---- ppp-2.4.2/contrib/pppgetpass/pppgetpass.sh 1999-11-15 05:08:24.000000000 +0100
-+++ ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.sh  1970-01-01 01:00:00.000000000 +0100
-@@ -1,7 +0,0 @@
--#!/bin/sh
--
--if [ -z "$DISPLAY" ]; then
--  exec pppgetpass.vt "$@"
--else
--  exec pppgetpass.gtk "$@"
--fi
-diff -ruN ppp-2.4.2/contrib/pppgetpass/pppgetpass.vt.c ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.vt.c
---- ppp-2.4.2/contrib/pppgetpass/pppgetpass.vt.c       1999-11-15 05:08:24.000000000 +0100
-+++ ppp-cvs-20040427/contrib/pppgetpass/pppgetpass.vt.c        1970-01-01 01:00:00.000000000 +0100
-@@ -1,218 +0,0 @@
--#include <stdio.h>
--#include <string.h>
--#include <stdlib.h>
--#include <errno.h>
--#include <unistd.h>
--#include <fcntl.h>
--#include <sys/stat.h>
--#include <sys/ioctl.h>
--#include <syslog.h>
--#include <termios.h>
--#include <sys/vt.h>
--
--static int console_owner(uid_t, int);
--
--int main(int argc, char **argv)
--{
--  int console;
--  uid_t uid;
--  struct vt_stat origstate;
--  int openvtnum;
--  char openvtname[256];
--  int openvt;
--  gid_t gid;
--  int chowned;
--  FILE *fp;
--  struct termios t;
--  char pass[256], *nl;
--  int outfd, passlen;
--  ssize_t wrote;
--  console=open("/dev/console", O_RDWR);
--
--  uid=getuid();
--  gid=getgid();
--  seteuid(uid);
--
--  openlog(argv[0], LOG_PID, LOG_DAEMON);
--
--  if(argc!=4) {
--    syslog(LOG_WARNING, "Usage error");
--    return 1;
--  }
--
--  if(console<0) {
--    syslog(LOG_ERR, "open(/dev/console): %m");
--    return 1;
--  }
--
--  if(ioctl(console, VT_GETSTATE, &origstate)<0) {
--    syslog(LOG_ERR, "VT_GETSTATE: %m");
--    return 1;
--  }
--
--  if(uid) {
--    if(!console_owner(uid, origstate.v_active)) {
--      int i;
--      for(i=0;i<64;++i) {
--        if(i!=origstate.v_active && console_owner(uid, i))
--          break;
--      }
--      if(i==64) {
--        syslog(LOG_WARNING, "run by uid %lu not at console", (unsigned long)uid);
--        return 1;
--      }
--    }
--  }
--
--  if(ioctl(console, VT_OPENQRY, &openvtnum)<0) {
--    syslog(LOG_ERR, "VT_OPENQRY: %m");
--    return 1;
--  }
--  if(openvtnum==-1) {
--    syslog(LOG_ERR, "No free VTs");
--    return 1;
--  }
--
--  snprintf(openvtname, sizeof openvtname, "/dev/tty%d", openvtnum);
--  seteuid(0);
--  openvt=open(openvtname, O_RDWR);
--  if(openvt<0) {
--    seteuid(uid);
--    syslog(LOG_ERR, "open(%s): %m", openvtname);
--    return 1;
--  }
--
--  chowned=fchown(openvt, uid, gid);
--  if(chowned<0) {
--    seteuid(uid);
--    syslog(LOG_ERR, "fchown(%s): %m", openvtname);
--    return 1;
--  }
--
--  close(console);
--
--  if(ioctl(openvt, VT_ACTIVATE, openvtnum)<0) {
--    seteuid(uid);
--    syslog(LOG_ERR, "VT_ACTIVATE(%d): %m", openvtnum);
--    return 1;
--  }
--
--  while(ioctl(openvt, VT_WAITACTIVE, openvtnum)<0) {
--    if(errno!=EINTR) {
--      ioctl(openvt, VT_ACTIVATE, origstate.v_active);
--      seteuid(uid);
--      syslog(LOG_ERR, "VT_WAITACTIVE(%d): %m", openvtnum);
--      return 1;
--    }
--  }
--
--  seteuid(uid);
--  fp=fdopen(openvt, "r+");
--  if(!fp) {
--    seteuid(0);
--    ioctl(openvt, VT_ACTIVATE, origstate.v_active);
--    seteuid(uid);
--    syslog(LOG_ERR, "fdopen(%s): %m", openvtname);
--    return 1;
--  }
--
--  if(tcgetattr(openvt, &t)<0) {
--    seteuid(0);
--    ioctl(openvt, VT_ACTIVATE, origstate.v_active);
--    seteuid(uid);
--    syslog(LOG_ERR, "tcgetattr(%s): %m", openvtname);
--    return 1;
--  }
--  t.c_lflag &= ~ECHO;
--  if(tcsetattr(openvt, TCSANOW, &t)<0) {
--    seteuid(0);
--    ioctl(openvt, VT_ACTIVATE, origstate.v_active);
--    seteuid(uid);
--    syslog(LOG_ERR, "tcsetattr(%s): %m", openvtname);
--    return 1;
--  }
--
--  if(fprintf(fp, "\033[2J\033[H")<0) {
--    seteuid(0);
--    ioctl(openvt, VT_ACTIVATE, origstate.v_active);
--    seteuid(uid);
--    syslog(LOG_ERR, "write error on %s: %m", openvtname);
--    return 1;
--  }
--  if(argv[1][0] && argv[2][0]) {
--    if(fprintf(fp, "Password for PPP client %s on server %s: ", argv[1], argv[2])<0) {
--      seteuid(0);
--      ioctl(openvt, VT_ACTIVATE, origstate.v_active);
--      seteuid(uid);
--      syslog(LOG_ERR, "write error on %s: %m", openvtname);
--      return 1;
--    }
--  } else if(argv[1][0] && !argv[2][0]) {
--    if(fprintf(fp, "Password for PPP client %s: ", argv[1])<0) {
--      syslog(LOG_ERR, "write error on %s: %m", openvtname);
--      seteuid(0);
--      ioctl(openvt, VT_ACTIVATE, origstate.v_active);
--      seteuid(uid);
--      return 1;
--    }
--  } else if(!argv[1][0] && argv[2][0]) {
--    if(fprintf(fp, "Password for PPP on server %s: ", argv[2])<0) {
--      seteuid(0);
--      ioctl(openvt, VT_ACTIVATE, origstate.v_active);
--      seteuid(uid);
--      syslog(LOG_ERR, "write error on %s: %m", openvtname);
--      return 1;
--    }
--  } else {
--    if(fprintf(fp, "Enter PPP password: ")<0) {
--      seteuid(0);
--      ioctl(openvt, VT_ACTIVATE, origstate.v_active);
--      seteuid(uid);
--      syslog(LOG_ERR, "write error on %s: %m", openvtname);
--      return 1;
--    }
--  }
--
--  if(!fgets(pass, sizeof pass, fp)) {
--    seteuid(0);
--    ioctl(openvt, VT_ACTIVATE, origstate.v_active);
--    seteuid(uid);
--    if(ferror(fp)) {
--      syslog(LOG_ERR, "read error on %s: %m", openvtname);
--    }
--    return 1;
--  }
--  if((nl=strchr(pass, '\n'))) 
--    *nl=0;
--  passlen=strlen(pass);
--  
--  outfd=atoi(argv[3]);
--  if((wrote=write(outfd, pass, passlen))!=passlen) {
--    seteuid(0);
--    ioctl(openvt, VT_ACTIVATE, origstate.v_active);
--    seteuid(uid);
--    if(wrote<0)
--      syslog(LOG_ERR, "write error on outpipe: %m");
--    else
--      syslog(LOG_ERR, "short write on outpipe");
--    return 1;
--  }
--
--  seteuid(0);
--  ioctl(openvt, VT_ACTIVATE, origstate.v_active);
--  seteuid(uid);
--  return 0;
--}
--
--static int console_owner(uid_t uid, int cons)
--{
--  char name[256];
--  struct stat st;
--  snprintf(name, sizeof name, "/dev/tty%d", cons);
--  if(stat(name, &st)<0) {
--    if(errno!=ENOENT)
--      syslog(LOG_ERR, "stat(%s): %m", name);
--    return 0;
--  }
--  return uid==st.st_uid;
--}
-diff -ruN ppp-2.4.2/include/linux/if_ether.h ppp-cvs-20040427/include/linux/if_ether.h
---- ppp-2.4.2/include/linux/if_ether.h 2001-05-21 05:31:50.000000000 +0200
-+++ ppp-cvs-20040427/include/linux/if_ether.h  1970-01-01 01:00:00.000000000 +0100
-@@ -1,99 +0,0 @@
--/*
-- * INET               An implementation of the TCP/IP protocol suite for the LINUX
-- *            operating system.  INET is implemented using the  BSD Socket
-- *            interface as the means of communication with the user level.
-- *
-- *            Global definitions for the Ethernet IEEE 802.3 interface.
-- *
-- * Version:   @(#)if_ether.h  1.0.1a  02/08/94
-- *
-- * Author:    Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
-- *            Donald Becker, <becker@super.org>
-- *            Alan Cox, <alan@redhat.com>
-- *            Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
-- *
-- *            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, or (at your option) any later version.
-- */
-- 
--#ifndef _LINUX_IF_ETHER_H
--#define _LINUX_IF_ETHER_H
--
--/*
-- *    IEEE 802.3 Ethernet magic constants.  The frame sizes omit the preamble
-- *    and FCS/CRC (frame check sequence). 
-- */
--
--#define ETH_ALEN      6               /* Octets in one ethernet addr   */
--#define ETH_HLEN      14              /* Total octets in header.       */
--#define ETH_ZLEN      60              /* Min. octets in frame sans FCS */
--#define ETH_DATA_LEN  1500            /* Max. octets in payload        */
--#define ETH_FRAME_LEN 1514            /* Max. octets in frame sans FCS */
--
--/*
-- *    These are the defined Ethernet Protocol ID's.
-- */
--
--#define ETH_P_LOOP    0x0060          /* Ethernet Loopback packet     */
--#define ETH_P_PUP     0x0200          /* Xerox PUP packet             */
--#define ETH_P_PUPAT   0x0201          /* Xerox PUP Addr Trans packet  */
--#define ETH_P_IP      0x0800          /* Internet Protocol packet     */
--#define ETH_P_X25     0x0805          /* CCITT X.25                   */
--#define ETH_P_ARP     0x0806          /* Address Resolution packet    */
--#define       ETH_P_BPQ       0x08FF          /* G8BPQ AX.25 Ethernet Packet  [ NOT AN OFFICIALLY REGISTERED ID ] */
--#define ETH_P_IEEEPUP 0x0a00          /* Xerox IEEE802.3 PUP packet */
--#define ETH_P_IEEEPUPAT       0x0a01          /* Xerox IEEE802.3 PUP Addr Trans packet */
--#define ETH_P_DEC       0x6000          /* DEC Assigned proto           */
--#define ETH_P_DNA_DL    0x6001          /* DEC DNA Dump/Load            */
--#define ETH_P_DNA_RC    0x6002          /* DEC DNA Remote Console       */
--#define ETH_P_DNA_RT    0x6003          /* DEC DNA Routing              */
--#define ETH_P_LAT       0x6004          /* DEC LAT                      */
--#define ETH_P_DIAG      0x6005          /* DEC Diagnostics              */
--#define ETH_P_CUST      0x6006          /* DEC Customer use             */
--#define ETH_P_SCA       0x6007          /* DEC Systems Comms Arch       */
--#define ETH_P_RARP      0x8035                /* Reverse Addr Res packet      */
--#define ETH_P_ATALK   0x809B          /* Appletalk DDP                */
--#define ETH_P_AARP    0x80F3          /* Appletalk AARP               */
--#define ETH_P_IPX     0x8137          /* IPX over DIX                 */
--#define ETH_P_IPV6    0x86DD          /* IPv6 over bluebook           */
--#define ETH_P_PPP_DISC        0x8863          /* PPPoE discovery messages     */
--#define ETH_P_PPP_SES 0x8864          /* PPPoE session messages       */
--#define ETH_P_ATMMPOA 0x884c          /* MultiProtocol Over ATM       */
--#define ETH_P_ATMFATE 0x8884          /* Frame-based ATM Transport
--                                       * over Ethernet
--                                       */
--
--/*
-- *    Non DIX types. Won't clash for 1500 types.
-- */
-- 
--#define ETH_P_802_3   0x0001          /* Dummy type for 802.3 frames  */
--#define ETH_P_AX25    0x0002          /* Dummy protocol id for AX.25  */
--#define ETH_P_ALL     0x0003          /* Every packet (be careful!!!) */
--#define ETH_P_802_2   0x0004          /* 802.2 frames                 */
--#define ETH_P_SNAP    0x0005          /* Internal only                */
--#define ETH_P_DDCMP     0x0006          /* DEC DDCMP: Internal only     */
--#define ETH_P_WAN_PPP   0x0007          /* Dummy type for WAN PPP frames*/
--#define ETH_P_PPP_MP    0x0008          /* Dummy type for PPP MP frames */
--#define ETH_P_LOCALTALK 0x0009                /* Localtalk pseudo type        */
--#define ETH_P_PPPTALK 0x0010          /* Dummy type for Atalk over PPP*/
--#define ETH_P_TR_802_2        0x0011          /* 802.2 frames                 */
--#define ETH_P_MOBITEX 0x0015          /* Mobitex (kaz@cafe.net)       */
--#define ETH_P_CONTROL 0x0016          /* Card specific control frames */
--#define ETH_P_IRDA    0x0017          /* Linux-IrDA                   */
--#define ETH_P_ECONET  0x0018          /* Acorn Econet                 */
--
--/*
-- *    This is an Ethernet frame header.
-- */
-- 
--struct ethhdr 
--{
--      unsigned char   h_dest[ETH_ALEN];       /* destination eth addr */
--      unsigned char   h_source[ETH_ALEN];     /* source ether addr    */
--      unsigned short  h_proto;                /* packet type ID field */
--};
--
--#endif        /* _LINUX_IF_ETHER_H */
-diff -ruN ppp-2.4.2/include/pcap-int.h ppp-cvs-20040427/include/pcap-int.h
---- ppp-2.4.2/include/pcap-int.h       2000-08-01 03:37:24.000000000 +0200
-+++ ppp-cvs-20040427/include/pcap-int.h        2000-08-01 03:37:24.000000000 +0200
-@@ -30,7 +30,7 @@
-  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-  * SUCH DAMAGE.
-  *
-- * @(#) $Header: /data/cvs/ppp/include/pcap-int.h,v 1.1 2000/08/01 01:37:24 paulus Exp $ (LBL)
-+ * @(#) $Header: /cvsroot/ppp/include/pcap-int.h,v 1.1 2000/08/01 01:37:24 paulus Exp $ (LBL)
-  */
- #ifndef pcap_int_h
-diff -ruN ppp-2.4.2/modules/bsd-comp.c ppp-cvs-20040427/modules/bsd-comp.c
---- ppp-2.4.2/modules/bsd-comp.c       1998-03-19 06:59:01.000000000 +0100
-+++ ppp-cvs-20040427/modules/bsd-comp.c        2004-01-17 06:50:11.000000000 +0100
-@@ -41,7 +41,7 @@
-  * This version is for use with STREAMS under SunOS 4.x,
-  * Digital UNIX, AIX 4.x, and SVR4 systems including Solaris 2.
-  *
-- * $Id: bsd-comp.c,v 1.20 1996/08/28 06:31:57 paulus Exp $
-+ * $Id: bsd-comp.c,v 1.21 2004/01/17 05:47:55 carlsonj Exp $
-  */
- #ifdef AIX4
-@@ -66,6 +66,10 @@
- #define BSD_LITTLE_ENDIAN
- #endif
-+#ifdef SOL2
-+#include <sys/sunddi.h>
-+#endif
-+
- #define PACKETPTR     mblk_t *
- #include <net/ppp-comp.h>
-diff -ruN ppp-2.4.2/modules/deflate.c ppp-cvs-20040427/modules/deflate.c
---- ppp-2.4.2/modules/deflate.c        2002-12-06 10:49:15.000000000 +0100
-+++ ppp-cvs-20040427/modules/deflate.c 2004-01-17 06:50:11.000000000 +0100
-@@ -35,7 +35,7 @@
-  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  *
-- * $Id: deflate.c,v 1.11 2002/12/06 09:49:15 paulus Exp $
-+ * $Id: deflate.c,v 1.12 2004/01/17 05:47:55 carlsonj Exp $
-  */
- #ifdef AIX4
-@@ -56,6 +56,10 @@
- #include "../common/zlib.h"
- #endif
-+#ifdef SOL2
-+#include <sys/sunddi.h>
-+#endif
-+
- #if DO_DEFLATE
- #define DEFLATE_DEBUG 1
-diff -ruN ppp-2.4.2/modules/vjcompress.c ppp-cvs-20040427/modules/vjcompress.c
---- ppp-2.4.2/modules/vjcompress.c     1999-09-17 04:03:56.000000000 +0200
-+++ ppp-cvs-20040427/modules/vjcompress.c      2004-01-17 06:50:11.000000000 +0100
-@@ -29,7 +29,7 @@
-  * This version is used under SunOS 4.x, Digital UNIX, AIX 4.x,
-  * and SVR4 systems including Solaris 2.
-  *
-- * $Id: vjcompress.c,v 1.10 1999/09/15 23:49:06 masputra Exp $
-+ * $Id: vjcompress.c,v 1.11 2004/01/17 05:47:55 carlsonj Exp $
-  */
- #include <sys/types.h>
-@@ -56,6 +56,10 @@
- #include <netinet/in_systm.h>
- #endif
-+#ifdef SOL2
-+#include <sys/sunddi.h>
-+#endif
-+
- #include <netinet/ip.h>
- #include <netinet/tcp.h>
-diff -ruN ppp-2.4.2/ppp.texi ppp-cvs-20040427/ppp.texi
---- ppp-2.4.2/ppp.texi 1970-01-01 01:00:00.000000000 +0100
-+++ ppp-cvs-20040427/ppp.texi  1996-08-28 08:30:33.000000000 +0200
-@@ -0,0 +1,561 @@
-+\input texinfo @c -*-texinfo-*-
-+@setfilename ppp.info
-+@settitle PPP
-+
-+@iftex
-+@finalout
-+@end iftex
-+
-+@ifinfo
-+@format
-+START-INFO-DIR-ENTRY
-+* PPP: (ppp).                   Point-to-Point Protocol.
-+END-INFO-DIR-ENTRY
-+@end format
-+
-+@titlepage
-+@title PPP-2.x Users' Guide
-+@author by Paul Mackerras
-+@end titlepage
-+
-+@node Top, Introduction, (dir), (dir)
-+
-+@ifinfo
-+This file documents how to use the ppp-2.x package to set up network
-+links over serial lines with the Point-to-Point Protocol.
-+
-+@end ifinfo
-+
-+@menu
-+* Introduction::                Basic concepts of the Point-to-Point
-+                                Protocol and the ppp-2.x package.
-+* Installation::                How to compile and install the software.
-+* Configuration::               How to set up your system for
-+                                establishing a link to another system.
-+* Security::                    Avoid creating security holes.
-+* Compression::                 Using compression of various kinds
-+                                to improve throughput.
-+@end menu
-+
-+@node Introduction, Installation, Top, Top
-+@chapter Introduction
-+
-+The Point-to-Point Protocol (PPP) is the protocol of choice for
-+establishing network links over serial lines.  This package (ppp-2.x)
-+provides an implementation of PPP which supports the Internet Protocols
-+(TCP/IP, UDP/IP, etc.) and which runs on a range of Unix workstations.
-+
-+A typical use of PPP is to provide a network connection, via a modem,
-+between a workstation and an Internet Service Provider (ISP).  When this
-+connection is established, the workstation is connected to the internet,
-+and applications running on the workstation can then make connections to
-+other hosts anywhere on the internet.  This package can be used at
-+either or both ends of such a link.
-+
-+Features of PPP include:
-+@itemize @bullet
-+@item
-+Multi-protocol support.  The PPP packet encapsulation includes a
-+protocol field, allowing packets from many different protocols to be
-+multiplexed across a single link.
-+@item
-+Negotiation of link characteristics.  During link establishment, the two
-+systems negotiate about the link configuration parameters, such as the
-+IP addresses of each end of the link.
-+@item
-+Authentication.  Optionally, each system can be configured to require the
-+other system to authenticate itself.  In this way, access can be
-+restricted to authorized systems.
-+@item
-+Transparency.  On asynchronous serial lines, PPP can be configured to
-+transmit certain characters as a two-character escape sequence.
-+@item
-+Compression.  PPP includes support for various kinds of compression to
-+be applied to the packets before they are transmitted.
-+@end itemize
-+
-+The ppp-2.x software consists of two parts:
-+
-+@itemize @bullet
-+
-+@item
-+Kernel code, which establishes a network interface and passes packets
-+between the serial port, the kernel networking code and the PPP daemon
-+(@file{pppd}).  This code is implemented using STREAMS modules on
-+Solaris 2, SunOS 4.x, AIX 4.1 and OSF/1, and as a tty line discipline
-+under Ultrix, NextStep, NetBSD, FreeBSD, and Linux.
-+
-+@item
-+The PPP daemon (@file{pppd}), which negotiates with the peer to
-+establish the link and sets up the ppp network interface.  Pppd includes
-+support for authentication.  It can authenticate itself to the other
-+system and/or require the other system to authenticate itself, so that
-+you can control which other systems may make a PPP connection and what
-+IP addresses they may use.
-+@end itemize
-+
-+@menu
-+* PPP Concepts::                Basic concepts and terms used with PPP.
-+* PPP packet format::           How data is packaged up for transmission.
-+* LCP negotiation::             The parameters which are negotiated
-+                              using the Link Control Protocol.
-+* IPCP negotiation::            The parameters which are negotiated
-+                              using the IP Control Protocol.
-+@end menu
-+
-+@node PPP Concepts, PPP packet format, Introduction, Introduction
-+@section PPP Concepts
-+
-+To use PPP to provide a network connection between two machines, there
-+must be some way that a stream of bytes, or characters, can be passed
-+from one to the other, in both directions independently.  We refer to
-+this as the ``serial link''.  Very often the serial link involves
-+asynchronous communications ports and modems, but other kinds of serial
-+link are possible.
-+
-+The serial link must transmit (at least) 8 bits per character; PPP
-+cannot work over a serial link which transmits only 7 bits per
-+character.  However, it need not transmit all byte values transparently. 
-+PPP has a mechanism to avoid sending certain characters if it is known
-+that the some element of the serial link interprets them specially.  For
-+example, the DC1 and DC3 ASCII characters (control-Q and control-S) may
-+be trapped by a modem if it is set for ``software'' flow control.  PPP
-+can send these characters as a two-character ``escape'' sequence.  The
-+set of characters which are to be transmitted as an escape sequence is
-+represented in an ``async control character map'' (ACCM).  The ``async''
-+part refers to the fact that this facility is used for asynchronous
-+serial links.  For synchronous serial connections, the HDLC bit-stuffing
-+procedure is used instead.
-+
-+The two systems connected by the serial link are called ``peers''.  When
-+we are talking from the point of view of one of the systems, the other
-+is often referred to as ``the peer''.  Sometimes we may refer to one
-+system as a ``client'' and the other as a ``server''.  This distinction
-+refers mainly to the way the serial link is set up; usually the client
-+is the peer that initiates the connection, for example by dialling the
-+server with its modem.
-+
-+During the lifetime of a PPP connection, it proceeds through several
-+phases:
-+
-+@enumerate
-+@item
-+Serial link establishment.  In this phase, the serial link is set up and
-+PPP protocol software is attached to each end of the serial link.  The
-+precise steps involved in doing this vary greatly, depending on the
-+nature of the serial link.  For the common case of modems connected
-+through the telephone network, this involves first sending commands to
-+the modem to cause it to dial the remote system.  When the remote system
-+answers, the local system usually has to supply a username and password,
-+and then issue a command to invoke PPP software on the remote system.
-+The ``chat'' program supplied with ppp-2.x provides a way to automate a
-+dialog with the modem and the remote system.  This phase is not
-+standardized; it is outside the scope of the PPP protocol
-+specifications.
-+
-+@item
-+Link Control Protocol (LCP) negotiation.  In this phase, the peers send
-+LCP packets to each other to negotiate various parameters of the
-+connection, such as the ACCM to be used in each direction, whether
-+authentication is required, and whether or not to use various forms of
-+compression.  When the peers reach agreement on these parameters, LCP is
-+said to be ``up''.
-+
-+@item
-+Authentication.  If one (or both) of the peers requires the other
-+peer to authenticate itself, that occurs next.  If one of the peers
-+cannot successfully authenticate itself, the other peer terminates the
-+link.
-+
-+@item
-+Network Control Protocol (NCP) negotiation.  PPP can potentially support
-+several different network protocols, although IP is the only network
-+protocol (NP) supported by the ppp-2.x package.  Each NP has an
-+associated NCP defined for it, which is used to negotiate the specific
-+parameters which affect that NP.  For example, the IP Control Protocol
-+(IPCP) is used to negotiate the IP addresses for each end of the link,
-+and whether the TCP header compression method described by Van Jacobsen
-+in RFC 1144 (``VJ compression'') is to be used.
-+
-+@item
-+Network communication.  When each NCP has successfully negotiated the
-+parameters for its NP, that NCP is said to be ``up''.  At that point,
-+the PPP link is made available for data traffic from that NP.  For
-+example, when IPCP comes up, the PPP link is then available for carrying
-+IP packets (which of course includes packets from those protocols which
-+are layered above IP, such as TCP, UDP, etc.)
-+
-+@item
-+Termination.  When the link is no longer required, it is terminated.
-+Usually this involves an exchange of LCP packets so that one peer can
-+notify the other that it is shutting down the link, enabling both peers
-+to shut down in an orderly manner.  But of course there are occasions
-+when the link terminates because the serial link is interrupted, for
-+example, when a modem loses carrier and hangs up.
-+
-+@end enumerate
-+
-+The protocols in the PPP family are produced by the Point-to-Point
-+Working Group of the Internet Engineering Task Force, and are specified
-+in RFC (Request for Comments) documents, available by anonymous FTP from
-+several sites.
-+
-+PPP is defined in several RFCs, in
-+particular RFCs 1661, 1662, and 1334.  IPCP is defined in RFC 1332.
-+Other RFCs describe the control protocols for other network protocols
-+(e.g., DECnet, OSI, Appletalk).  RFCs are available by anonymous FTP
-+from several sites including nic.ddn.mil, nnsc.nsf.net, nic.nordu.net,
-+ftp.nisc.sri.com, and munnari.oz.au.
-+
-+@node PPP packet format, LCP negotiation, PPP Concepts, Introduction
-+@section PPP packet format
-+
-+PPP transmits packets over the serial link using a simple encapsulation
-+scheme.  First, a two-byte PPP Protocol field is inserted before the
-+data to be sent.  The value in this field identifies
-+which higher-level protocol (either a network protocol such as IP or a
-+PPP control protocol such as LCP) should receive the data in the packet.
-+By default, a one-byte Address field with the value 0xFF, and a one-byte
-+Control field with the value 0x03, are inserted before the PPP Protocol
-+field (apparently this is supposed to provide compatibility with HDLC,
-+in case there is a synchronous to asynchronous converter in the serial
-+link).
-+
-+On slow serial links, these fields can be compressed down to one byte in
-+most cases.  The PPP Address and Control fields are compressed by simply
-+omitting them (``address/control compression'').  The PPP Protocol field
-+values are chosen so that bit 0 (the least-significant bit) of the first
-+(most significant) byte is always 0, and bit 0 of the second byte is
-+always 1.  The PPP Protocol field can be compressed by omitting the
-+first byte, provided that it is 0 (``protocol compression'').  The
-+values for this field are assigned so that the first byte is zero for
-+all of the commonly-used network protocols.  For example, the PPP
-+Protocol field value for IP is 0x21.
-+
-+For asynchronous serial links, which do not provide any packet framing
-+or transparency, a further encapsulation is used as follows.  First a
-+16-bit Frame Check Sequence (FCS) is computed over the packet to be
-+sent, and appended as two bytes to the end of the packet.
-+
-+Then each byte of the packet is examined, and if it contains one of the
-+characters which are to be escaped, it is replaced by a two byte
-+sequence: the 0x7d character '}', followed by the character with bit 5
-+inverted.  For example, the control-C character (0x03) could be replaced
-+by the two-byte sequence 0x7d, 0x23 ('}#').  The 0x7d and 0x7e ('~')
-+characters are always escaped, and the 0x5e ('^') character may not be
-+escaped.
-+
-+Finally, a ``flag'' character (0x7e, '~') is inserted at the beginning
-+and end of the packet to mark the packet boundaries.  The initial flag
-+may be omitted if this packet immediately follows another packet, as the
-+ending flag for the previous packet can serve as the beginning flag of
-+this packet.
-+
-+@node LCP negotiation, IPCP negotiation, PPP packet format, Introduction
-+@section LCP negotiation
-+
-+The LCP negotiation process actually involves two sets of negotiations,
-+one for each direction of the PPP connection.  Thus A will send B
-+packets (``Configure-Requests'') describing what characteristics A would
-+like to have apply to the B -> A direction of the link, that is, to the
-+packets that A will receive.  Similarly B will send A packets describing
-+the characteristics it would like to have apply to the packets it will
-+be receiving.  These characteristics need not necessarily be the same in
-+both directions.
-+
-+The parameters which are negotiated for each direction of the connection
-+using LCP are:
-+
-+@itemize @bullet
-+@item
-+Maximum Receive Unit (MRU): indicates the maximum packet size which we
-+are prepared to receive (specifically the maximum size of the
-+data portion of the packet).  The default value is 1500, but on
-+slow serial links, smaller values give better response.  The choice of
-+MRU is discussed below (see xxx).
-+
-+@item
-+Async Control Character Map (ACCM): indicates the set of control
-+characters (characters with ASCII values in the range 0 - 31) which we
-+wish to receive in escaped form.  The default is that the sender should
-+escape all characters in the range 0 - 31.
-+
-+@item
-+Authentication Protocol: indicates which protocol we would like the peer
-+to use to authenticate itself.  Common choices are the Password
-+Authentication Protocol (PAP) and the Cryptographic Handshake
-+Authentication Protocol (CHAP).
-+
-+@item
-+Quality Protocol: indicates which protocol which we would like the peer
-+to use to send us link quality reports.  The ppp-2.x package does not
-+currently support link quality reports.
-+
-+@item
-+Magic Number: a randomly-chosen number, different from the peer's magic
-+number.  If we persistently receive our own magic number in the peer's
-+configure-request packets, then we can conclude that the serial link is
-+looped back.
-+
-+@item
-+Protocol Field Compression: indicates that we wish the peer to compress
-+the PPP Protocol field to one byte, where possible, in the packets it
-+sends.
-+
-+@item
-+Address/Control Field Compression: indicates that we wish the peer to
-+compress the PPP Address/Control fields (by simply omitting them) in the
-+packets it sends.
-+@end itemize
-+
-+@node IPCP negotiation,  , LCP negotiation, Introduction
-+@section IPCP negotiation
-+
-+The IPCP negotiation process is very similar to the LCP negotiation
-+process, except that of course different parameters are negotiated.
-+The parameters which are negotiated using IPCP are:
-+
-+@itemize @bullet
-+@item
-+IP Address: the IP address (32-bit host IP number) which we plan to use
-+as the local address for our end of the link.
-+
-+@item
-+TCP header compression: indicates (a) that we wish the peer to compress
-+the TCP/IP headers of TCP/IP packets that it sends, using the Van
-+Jacobson algorithm as described in RFC1144; (b) the maximum slot ID that
-+we wish the peer to use, and (c) whether we are prepared to accept
-+packets with the slot ID field compressed (omitted).
-+
-+With Van Jacobson (VJ) compression, the receiver and transmitter (for
-+one direction of the connection) both keep a table, with a certain
-+number of ``slots'', where each slot holds the TCP/IP header of the most
-+recently transmitted packet for one TCP connection.  If a packet is to
-+be transmitted for a TCP connection which does not have a slot currently
-+allocated, the VJ scheme will allocate one of the slots and send the
-+entire TCP/IP header, together with the slot number.  For many packets,
-+there will be a slot already allocated for the TCP connection, and the
-+VJ scheme will then often be able to replace the entire TCP/IP header
-+with a much smaller compressed header (typically only 3 - 7 bytes)
-+describing which fields of the TCP/IP header have changed, and by how
-+much.  If there are many more active connections than slots, the
-+efficiency of the VJ scheme will drop, because it will not be able to
-+send compressed headers as often.
-+
-+Usually the compressed header includes a one-byte slot index, indicating
-+which TCP connection the packet is for.  It is possible to reduce the
-+header size by omitting the slot index when the packet has the same slot
-+index as the previous packet.  However, this introduces a danger if the
-+lower levels of the PPP software can sometimes drop damaged packets
-+without informing the VJ decompressor, as it may then assume the wrong
-+slot index for packets which have the slot index field omitted.  With
-+the ppp-2.x software, however, the probability of this happening is
-+generally very small (see xxx).
-+
-+@end itemize
-+
-+@node Installation, Configuration, Introduction, Top
-+@chapter Installation
-+
-+Because ppp-2.x includes code which must be incorporated into the
-+kernel, its installation process is necessarily quite heavily
-+system-dependent.  In addition, you will require super-user privileges
-+(root access) to install the code.
-+
-+Some systems provide a ``modload'' facility, which allows you to load
-+new code into a running kernel without relinking the kernel or
-+rebooting.  Under Solaris 2, SunOS 4.x, Linux, OSF/1 and NextStep, this
-+is the recommended (or only) way to install the kernel portion of the
-+ppp-2.x package.
-+
-+Under the remaining supported operating systems (NetBSD, FreeBSD,
-+Ultrix), it is necessary to go through the process of creating a new
-+kernel image and reboot.  (Note that NetBSD and FreeBSD have a modload
-+facility, but ppp-2.x is currently not configured to take advantage of
-+it.)
-+
-+Detailed installation instructions for each operating system are
-+contained in the README files in the ppp-2.x distribution.  In general,
-+the process involves executing the commands @samp{./configure},
-+@samp{make} and (as root) @samp{make install} in the ppp-2.x
-+distribution directory.  (The Linux port requires the installation of
-+some header files before compiling; see README.linux for details.)
-+
-+@node Configuration, Security, Installation, Top
-+@chapter Configuration
-+
-+Once the ppp-2.x software is installed, you need to configure your
-+system for the particular PPP connections you wish to allow.  Typically,
-+the elements you need to configure are:
-+
-+@itemize @bullet
-+@item
-+How the serial link is established and how pppd gets invoked.
-+@item
-+Setting up syslog to log messages from pppd to the console and/or
-+system log files.
-+@item
-+Pppd options to be used.
-+@item
-+Authentication secrets to use in authenticating us to the peer
-+and/or the peer to us.
-+@item
-+The IP addresses for each end of the link.
-+@end itemize
-+
-+In most cases, the system you are configuring will either be a
-+@dfn{client} system, actively initiating a PPP connection on user
-+request, or it will be a @dfn{server} system, passively waiting for
-+connections from client systems.  Other arrangements are possible, but
-+the instructions in this system assume that you are configuring either a
-+client or a server.
-+
-+These instructions also assume that the serial link involves a serial
-+communications port (that is, a tty device), since pppd requires a
-+serial port.
-+
-+@menu
-+* Client machines::  
-+* Server machines::  
-+* Setting up syslog::           
-+* Pppd options::                
-+* Authentication secrets files::  
-+* IP Addresses::                
-+@end menu
-+
-+@node Client machines, Server machines, Configuration, Configuration
-+@section Client machines
-+
-+On a client machine, the way that the user requests that a connection be
-+established is by running pppd, either directly or through a shell
-+script.  Pppd should be given the name of the serial port to use as an
-+option.  In this mode, pppd will fork and detach itself from its
-+controlling terminal, so that the shell will return to its prompt.  (If
-+this behaviour is not desired, use the -detach option.)
-+
-+Usually, the connect option should also be used.  The connect option
-+takes an argument which is a command to run to establish the serial link
-+and invoke PPP software on the remote machine.  This command is run with
-+its standard input and standard output connected to the serial port.
-+Giving the connect option to pppd also has the side-effect of causing
-+pppd to open the serial port without waiting for the modem carrier
-+detect signal.
-+
-+The process of establishing the serial link often involves a dialog.  If
-+the serial port is connected to a modem, we first need to send some
-+commands to the modem to configure it and dial the remote system.  Often
-+there is then a dialog with the remote system to supply a username and
-+password.  The @file{chat} program supplied with the ppp-2.x package is
-+useful for automating such dialogs.  Chat uses a @dfn{script} consisting
-+of alternately strings to expect to receive on the serial port, and
-+strings to send on the serial port.  The script can also specify strings
-+which indicate an error and abort the dialog.
-+
-+@node Server machines, , Client machines, Configuration
-+@section Server machines
-+
-+There are generally three ways in which a server machine can be set up
-+to allow client machines to establish a PPP link:
-+
-+@enumerate
-+@item
-+Client machines log in as regular users (often via a serial port
-+connected to a modem, but possibly through a telnet or rlogin session)
-+and then run pppd as a shell command.
-+@item
-+Client machines log in using a username whose login shell is pppd
-+or a script which runs pppd.
-+@item
-+Client machines connect to a serial port which has a pppd running
-+permanently on it (instead of a "getty" or other program providing a
-+login service).
-+@end enumerate
-+
-+Method 1 is very simple to set up, and is useful where existing users of
-+a system have remote machines (for example at home) from which they want
-+to establish a PPP connection from time to time.  Methods 2 and 3
-+possibly have a security advantage in that they do not allow PPP client
-+systems access to a shell.  Method 2 allows regular logins and PPP
-+connections on the same port, while with method 3, would-be crackers may
-+well be frustrated (unless they speak fluent PPP).
-+
-+With any of these methods, I strongly recommend that you configure PPP
-+to require authentication from the client, by including the `auth'
-+option in the /etc/ppp/options file.
-+
-+@node Setting up syslog, , Server machines, Configuration
-+@section Setting up syslog
-+
-+Pppd uses the @file{syslog} facility to report information about the
-+state of the connection, as does @file{chat}.  It is useful to set up
-+syslog to print some of these messages on the console, and to record
-+most of them to a file.  The messages from pppd are logged with facility
-+@samp{daemon} and one of three levels:
-+@itemize @bullet
-+@item
-+@samp{notice} for messages about important events such as the
-+connection becoming available for IP traffic and the local and remote IP
-+addresses in use.
-+@item
-+@samp{info} for messages about less important events, such as
-+detecting a modem hangup.
-+@item
-+@samp{debug} for messages which are of use in working out why the
-+connection is not working properly.
-+@end itemize
-+
-+The messages from chat are logged with facility @samp{local2} and level
-+@samp{debug}.
-+
-+Syslog is controlled by the syslog configuration file
-+@file{/etc/syslog.conf}.  Generally the standard configuration will log
-+facility @samp{daemon} messages with level @samp{notice} and above to a
-+system log file such as @file{/var/log/syslog} (the name may vary on
-+different systems).  I find it useful to have the notice level messages
-+from pppd displayed on the console, and all messages from pppd and chat
-+logged to a file such as @file{/etc/ppp/log}.  To achieve this,
-+find the line in /etc/syslog.conf which has /dev/console
-+on the right-hand side, and add `daemon.notice' on the left.  This
-+line should end up something like this:
-+
-+@example
-+*.err;kern.debug;auth.notice;mail.crit;daemon.notice    /dev/console
-+@end example
-+
-+And add a line like this:
-+
-+@example
-+daemon,local2.debug                                     /etc/ppp/log
-+@end example
-+
-+The space between the left and right hand sides is one or more tabs, not
-+spaces, and there are no tabs or spaces at the beginning of the line.
-+
-+You will need to create an empty @file{/etc/ppp/log} file; syslogd will
-+not create it.  Once you have modified @file{/etc/syslog.conf}, you need
-+to either reboot or notify syslogd to re-read the file.  On most
-+systems, you notify syslogd by sending it a SIGHUP signal.  Syslogd's
-+process ID is usually stored in a file such as @file{/etc/syslogd.pid}
-+or @file{/var/run/syslog.pid}.  Thus you can notify syslogd to re-read
-+the file by executing a command such as:
-+
-+@example
-+kill -HUP `cat /etc/syslogd.pid`
-+@end example
-+
-+@node Pppd options, , Setting up syslog, Configuration
-+@section Pppd options
-+
-+@node Authentication secrets files, , Pppd options, Configuration
-+@section Authentication secrets files
-+
-+@node IP Addresses,  , Authentication secrets files, Configuration
-+@section IP Addresses
-+
-+@node Security, Compression, Configuration, Top
-+@chapter Security
-+
-+@node Compression,  , Security, Top
-+@chapter Compression
-+
-+@bye
-diff -ruN ppp-2.4.2/pppd/Makefile.sol2 ppp-cvs-20040427/pppd/Makefile.sol2
---- ppp-2.4.2/pppd/Makefile.sol2       2003-11-27 22:25:25.000000000 +0100
-+++ ppp-cvs-20040427/pppd/Makefile.sol2        2002-11-02 20:50:09.000000000 +0100
-@@ -1,6 +1,6 @@
- #
- # Makefile for pppd under Solaris 2.
--# $Id: Makefile.sol2,v 1.24 2003/11/27 21:25:25 paulus Exp $
-+# $Id: Makefile.sol2,v 1.23 2002/11/02 19:48:12 carlsonj Exp $
- #
- include ../Makedefs.com
-@@ -8,8 +8,8 @@
- CFLAGS        =  -I../include -DSVR4 -DSOL2 $(COPTS)
- LIBS  = -lsocket -lnsl
--OBJS  =  main.o magic.o fsm.o lcp.o ipcp.o upap.o chap-new.o eap.o md5.o \
--      tty.o ccp.o ecp.o auth.o options.o demand.o utils.o sys-solaris.o
-+OBJS  =  main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o eap.o md5.o tty.o \
-+      ccp.o ecp.o auth.o options.o demand.o utils.o sys-solaris.o
- #
- # uncomment the following to enable plugins
-diff -ruN ppp-2.4.2/pppd/Makefile.sunos4 ppp-cvs-20040427/pppd/Makefile.sunos4
---- ppp-2.4.2/pppd/Makefile.sunos4     2003-11-27 22:25:25.000000000 +0100
-+++ ppp-cvs-20040427/pppd/Makefile.sunos4      2002-11-02 20:50:09.000000000 +0100
-@@ -1,6 +1,6 @@
- #
- # Makefile for pppd under SunOS 4.
--# $Id: Makefile.sunos4,v 1.14 2003/11/27 21:25:25 paulus Exp $
-+# $Id: Makefile.sunos4,v 1.13 2002/11/02 19:48:12 carlsonj Exp $
- #
- include ../sunos4/Makedefs
-@@ -12,7 +12,7 @@
- all: pppd
--OBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap-new.o md5.o ccp.o ecp.o \
-+OBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o ecp.o \
-       auth.o options.o demand.o utils.o sys-sunos4.o tty.o eap.o
- pppd: $(OBJS)
-diff -ruN ppp-2.4.2/pppd/chap-new.c ppp-cvs-20040427/pppd/chap-new.c
---- ppp-2.4.2/pppd/chap-new.c  2003-11-27 23:22:36.000000000 +0100
-+++ ppp-cvs-20040427/pppd/chap-new.c   2004-01-17 06:50:11.000000000 +0100
-@@ -33,7 +33,7 @@
-  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
--#define RCSID "$Id: chap-new.c,v 1.3 2003/11/27 22:22:36 paulus Exp $"
-+#define RCSID "$Id: chap-new.c,v 1.4 2004/01/17 05:47:55 carlsonj Exp $"
- #include <stdlib.h>
- #include <string.h>
-@@ -49,7 +49,7 @@
- int (*chap_verify_hook)(char *name, char *ourname, int id,
-                       struct chap_digest_type *digest,
-                       unsigned char *challenge, unsigned char *response,
--                      unsigned char *message, int message_space) = NULL;
-+                      char *message, int message_space) = NULL;
- /*
-  * Option variables.
-@@ -119,7 +119,7 @@
- static int chap_verify_response(char *name, char *ourname, int id,
-               struct chap_digest_type *digest,
-               unsigned char *challenge, unsigned char *response,
--              unsigned char *message, int message_space);
-+              char *message, int message_space);
- static void chap_respond(struct chap_client_state *cs, int id,
-               unsigned char *pkt, int len);
- static void chap_handle_status(struct chap_client_state *cs, int code, int id,
-@@ -306,11 +306,11 @@
- {
-       int response_len, ok, mlen;
-       unsigned char *response, *p;
--      unsigned char *name = NULL;     /* initialized to shut gcc up */
-+      char *name = NULL;      /* initialized to shut gcc up */
-       int (*verifier)(char *, char *, int, struct chap_digest_type *,
--              unsigned char *, unsigned char *, unsigned char *, int);
-+              unsigned char *, unsigned char *, char *, int);
-       char rname[MAXNAMELEN+1];
--      unsigned char message[256];
-+      char message[256];
-       if ((ss->flags & LOWERUP) == 0)
-               return;
-@@ -322,7 +322,7 @@
-               response = pkt;
-               GETCHAR(response_len, pkt);
-               len -= response_len + 1;        /* length of name */
--              name = pkt + response_len;
-+              name = (char *)pkt + response_len;
-               if (len < 0)
-                       return;
-@@ -391,14 +391,14 @@
- chap_verify_response(char *name, char *ourname, int id,
-                    struct chap_digest_type *digest,
-                    unsigned char *challenge, unsigned char *response,
--                   unsigned char *message, int message_space)
-+                   char *message, int message_space)
- {
-       int ok;
--      char secret[MAXSECRETLEN];
-+      unsigned char secret[MAXSECRETLEN];
-       int secret_len;
-       /* Get the secret that the peer is supposed to know */
--      if (!get_secret(0, name, ourname, secret, &secret_len, 1)) {
-+      if (!get_secret(0, name, ourname, (char *)secret, &secret_len, 1)) {
-               error("No CHAP secret found for authenticating %q", name);
-               return 0;
-       }
-diff -ruN ppp-2.4.2/pppd/chap-new.h ppp-cvs-20040427/pppd/chap-new.h
---- ppp-2.4.2/pppd/chap-new.h  2003-06-11 14:47:31.000000000 +0200
-+++ ppp-cvs-20040427/pppd/chap-new.h   2004-01-17 06:50:12.000000000 +0100
-@@ -123,7 +123,7 @@
- extern int (*chap_verify_hook)(char *name, char *ourname, int id,
-                       struct chap_digest_type *digest,
-                       unsigned char *challenge, unsigned char *response,
--                      unsigned char *message, int message_space);
-+                      char *message, int message_space);
- /* Called by digest code to register a digest type */
- extern void chap_register_digest(struct chap_digest_type *);
-diff -ruN ppp-2.4.2/pppd/chap_ms.c ppp-cvs-20040427/pppd/chap_ms.c
---- ppp-2.4.2/pppd/chap_ms.c   2003-11-18 11:42:56.000000000 +0100
-+++ ppp-cvs-20040427/pppd/chap_ms.c    2004-04-14 04:40:21.000000000 +0200
-@@ -74,7 +74,7 @@
-  *
-  */
--#define RCSID "$Id: chap_ms.c,v 1.30 2003/07/10 17:59:33 fcusack Exp $"
-+#define RCSID "$Id: chap_ms.c,v 1.31 2004/04/14 02:39:39 carlsonj Exp $"
- #ifdef CHAPMS
-@@ -164,9 +164,11 @@
- chapms_generate_challenge(unsigned char *challenge)
- {
-       *challenge++ = 8;
-+#ifdef DEBUGMPPEKEY
-       if (mschap_challenge && strlen(mschap_challenge) == 8)
-               memcpy(challenge, mschap_challenge, 8);
-       else
-+#endif
-               random_bytes(challenge, 8);
- }
-@@ -174,9 +176,11 @@
- chapms2_generate_challenge(unsigned char *challenge)
- {
-       *challenge++ = 16;
-+#ifdef DEBUGMPPEKEY
-       if (mschap_challenge && strlen(mschap_challenge) == 16)
-               memcpy(challenge, mschap_challenge, 16);
-       else
-+#endif
-               random_bytes(challenge, 16);
- }
-@@ -207,7 +211,7 @@
- #endif
-       /* Generate the expected response. */
--      ChapMS(challenge, secret, secret_len, &md);
-+      ChapMS(challenge, (char *)secret, secret_len, &md);
- #ifdef MSLANMAN
-       /* Determine which part of response to verify against */
-@@ -250,8 +254,8 @@
-       /* Generate the expected response and our mutual auth. */
-       ChapMS2(challenge, rmd->PeerChallenge, name,
--              secret, secret_len, &md,
--              saresponse, MS_CHAP2_AUTHENTICATOR);
-+              (char *)secret, secret_len, &md,
-+              (unsigned char *)saresponse, MS_CHAP2_AUTHENTICATOR);
-       /* compare MDs and send the appropriate status */
-       /*
-@@ -326,8 +330,13 @@
- {
-       challenge++;    /* skip length, should be 16 */
-       *response++ = MS_CHAP2_RESPONSE_LEN;
--      ChapMS2(challenge, mschap2_peer_challenge, our_name,
--              secret, secret_len,
-+      ChapMS2(challenge,
-+#ifdef DEBUGMPPEKEY
-+              mschap2_peer_challenge,
-+#else
-+              NULL,
-+#endif
-+              our_name, secret, secret_len,
-               (MS_Chap2Response *) response, private,
-               MS_CHAP2_AUTHENTICATEE);
- }
-@@ -335,7 +344,8 @@
- static int
- chapms2_check_success(unsigned char *msg, int len, unsigned char *private)
- {
--      if ((len < MS_AUTH_RESPONSE_LENGTH + 2) || strncmp(msg, "S=", 2)) {
-+      if ((len < MS_AUTH_RESPONSE_LENGTH + 2) ||
-+          strncmp((char *)msg, "S=", 2) != 0) {
-               /* Packet does not start with "S=" */
-               error("MS-CHAPv2 Success packet is badly formed.");
-               return 0;
-@@ -351,7 +361,7 @@
-       /* Authenticator Response matches. */
-       msg += MS_AUTH_RESPONSE_LENGTH; /* Eat it */
-       len -= MS_AUTH_RESPONSE_LENGTH;
--      if ((len >= 3) && !strncmp(msg, " M=", 3)) {
-+      if ((len >= 3) && !strncmp((char *)msg, " M=", 3)) {
-               msg += 3; /* Eat the delimiter */
-       } else if (len) {
-               /* Packet has extra text which does not begin " M=" */
-@@ -477,7 +487,7 @@
-     SHA1_Init(&sha1Context);
-     SHA1_Update(&sha1Context, PeerChallenge, 16);
-     SHA1_Update(&sha1Context, rchallenge, 16);
--    SHA1_Update(&sha1Context, user, strlen(user));
-+    SHA1_Update(&sha1Context, (unsigned char *)user, strlen(user));
-     SHA1_Final(sha1Hash, &sha1Context);
-     BCOPY(sha1Hash, Challenge, 8);
-@@ -512,7 +522,7 @@
-     MD4_CTX           md4Context;
-     MD4Init(&md4Context);
--    MD4Update(&md4Context, secret, mdlen);
-+    MD4Update(&md4Context, (unsigned char *)secret, mdlen);
-     MD4Final(hash, &md4Context);
- }
-@@ -526,7 +536,7 @@
-     /* Hash the Unicode version of the secret (== password). */
-     ascii2unicode(secret, secret_len, unicodePassword);
--    NTPasswordHash(unicodePassword, secret_len * 2, PasswordHash);
-+    NTPasswordHash((char *)unicodePassword, secret_len * 2, PasswordHash);
-     ChallengeResponse(rchallenge, PasswordHash, NTResponse);
- }
-@@ -539,11 +549,12 @@
-     u_char    PasswordHash[MD4_SIGNATURE_SIZE];
-     u_char    Challenge[8];
--    ChallengeHash(PeerChallenge, rchallenge, username, Challenge);
-+    ChallengeHash(PeerChallenge, (unsigned char *)rchallenge, username,
-+                Challenge);
-     /* Hash the Unicode version of the secret (== password). */
-     ascii2unicode(secret, secret_len, unicodePassword);
--    NTPasswordHash(unicodePassword, secret_len * 2, PasswordHash);
-+    NTPasswordHash((char *)unicodePassword, secret_len * 2, PasswordHash);
-     ChallengeResponse(Challenge, PasswordHash, NTResponse);
- }
-@@ -603,8 +614,9 @@
-     /* Hash (x2) the Unicode version of the secret (== password). */
-     ascii2unicode(secret, secret_len, unicodePassword);
--    NTPasswordHash(unicodePassword, secret_len * 2, PasswordHash);
--    NTPasswordHash(PasswordHash, sizeof(PasswordHash), PasswordHashHash);
-+    NTPasswordHash((char *)unicodePassword, secret_len * 2, PasswordHash);
-+    NTPasswordHash((char *)PasswordHash, sizeof(PasswordHash),
-+                 PasswordHashHash);
-     SHA1_Init(&sha1Context);
-     SHA1_Update(&sha1Context, PasswordHashHash, sizeof(PasswordHashHash));
-@@ -622,7 +634,7 @@
-     /* Convert to ASCII hex string. */
-     for (i = 0; i < MAX((MS_AUTH_RESPONSE_LENGTH / 2), sizeof(Digest)); i++)
--      sprintf(&authResponse[i * 2], "%02X", Digest[i]);
-+      sprintf((char *)&authResponse[i * 2], "%02X", Digest[i]);
- }
-@@ -825,7 +837,7 @@
-             sizeof(response->PeerChallenge));
-     /* Generate the NT-Response */
--    ChapMS2_NT(rchallenge, response->PeerChallenge, user,
-+    ChapMS2_NT((char *)rchallenge, response->PeerChallenge, user,
-              secret, secret_len, response->NTResp);
-     /* Generate the Authenticator Response. */
-diff -ruN ppp-2.4.2/pppd/fsm.c ppp-cvs-20040427/pppd/fsm.c
---- ppp-2.4.2/pppd/fsm.c       2003-06-29 12:06:14.000000000 +0200
-+++ ppp-cvs-20040427/pppd/fsm.c        2004-02-02 05:00:11.000000000 +0100
-@@ -40,7 +40,7 @@
-  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
--#define RCSID "$Id: fsm.c,v 1.20 2003/06/29 10:06:14 paulus Exp $"
-+#define RCSID "$Id: fsm.c,v 1.22 2004/02/02 03:57:19 carlsonj Exp $"
- /*
-  * TODO:
-@@ -201,6 +201,44 @@
-     }
- }
-+/*
-+ * terminate_layer - Start process of shutting down the FSM
-+ *
-+ * Cancel any timeout running, notify upper layers we're done, and
-+ * send a terminate-request message as configured.
-+ */
-+static void
-+terminate_layer(f, nextstate)
-+    fsm *f;
-+    int nextstate;
-+{
-+    if( f->state != OPENED )
-+      UNTIMEOUT(fsm_timeout, f);      /* Cancel timeout */
-+    else if( f->callbacks->down )
-+      (*f->callbacks->down)(f);       /* Inform upper layers we're down */
-+
-+    /* Init restart counter and send Terminate-Request */
-+    f->retransmits = f->maxtermtransmits;
-+    fsm_sdata(f, TERMREQ, f->reqid = ++f->id,
-+            (u_char *) f->term_reason, f->term_reason_len);
-+
-+    if (f->retransmits == 0) {
-+      /*
-+       * User asked for no terminate requests at all; just close it.
-+       * We've already fired off one Terminate-Request just to be nice
-+       * to the peer, but we're not going to wait for a reply.
-+       */
-+      f->state = nextstate == CLOSING ? CLOSED : STOPPED;
-+      if( f->callbacks->finished )
-+          (*f->callbacks->finished)(f);
-+      return;
-+    }
-+
-+    TIMEOUT(fsm_timeout, f, f->timeouttime);
-+    --f->retransmits;
-+
-+    f->state = nextstate;
-+}
- /*
-  * fsm_close - Start closing connection.
-@@ -230,19 +268,7 @@
-     case ACKRCVD:
-     case ACKSENT:
-     case OPENED:
--      if( f->state != OPENED )
--          UNTIMEOUT(fsm_timeout, f);  /* Cancel timeout */
--      else if( f->callbacks->down )
--          (*f->callbacks->down)(f);   /* Inform upper layers we're down */
--
--      /* Init restart counter, send Terminate-Request */
--      f->retransmits = f->maxtermtransmits;
--      fsm_sdata(f, TERMREQ, f->reqid = ++f->id,
--                (u_char *) f->term_reason, f->term_reason_len);
--      TIMEOUT(fsm_timeout, f, f->timeouttime);
--      --f->retransmits;
--
--      f->state = CLOSING;
-+      terminate_layer(f, CLOSING);
-       break;
-     }
- }
-@@ -689,17 +715,7 @@
-       break;
-     case OPENED:
--      if( f->callbacks->down )
--          (*f->callbacks->down)(f);
--
--      /* Init restart counter, send Terminate-Request */
--      f->retransmits = f->maxtermtransmits;
--      fsm_sdata(f, TERMREQ, f->reqid = ++f->id,
--                (u_char *) f->term_reason, f->term_reason_len);
--      TIMEOUT(fsm_timeout, f, f->timeouttime);
--      --f->retransmits;
--
--      f->state = STOPPING;
-+      terminate_layer(f, STOPPING);
-       break;
-     default:
-diff -ruN ppp-2.4.2/pppd/main.c ppp-cvs-20040427/pppd/main.c
---- ppp-2.4.2/pppd/main.c      2004-01-13 05:00:34.000000000 +0100
-+++ ppp-cvs-20040427/pppd/main.c       2004-04-12 13:25:19.000000000 +0200
-@@ -40,7 +40,7 @@
-  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
--#define RCSID "$Id: main.c,v 1.131 2004/01/13 04:00:34 paulus Exp $"
-+#define RCSID "$Id: main.c,v 1.136 2004/04/12 11:20:19 paulus Exp $"
- #include <stdio.h>
- #include <ctype.h>
-@@ -150,6 +150,7 @@
- int got_sigterm;
- int got_sighup;
-+static sigset_t signals_handled;
- static int waiting;
- static sigjmp_buf sigjmp;
-@@ -648,16 +649,15 @@
- handle_events()
- {
-     struct timeval timo;
--    sigset_t mask;
-     kill_link = open_ccp_flag = 0;
-     if (sigsetjmp(sigjmp, 1) == 0) {
--      sigprocmask(SIG_BLOCK, &mask, NULL);
-+      sigprocmask(SIG_BLOCK, &signals_handled, NULL);
-       if (got_sighup || got_sigterm || got_sigusr2 || got_sigchld) {
--          sigprocmask(SIG_UNBLOCK, &mask, NULL);
-+          sigprocmask(SIG_UNBLOCK, &signals_handled, NULL);
-       } else {
-           waiting = 1;
--          sigprocmask(SIG_UNBLOCK, &mask, NULL);
-+          sigprocmask(SIG_UNBLOCK, &signals_handled, NULL);
-           wait_input(timeleft(&timo));
-       }
-     }
-@@ -692,19 +692,18 @@
- setup_signals()
- {
-     struct sigaction sa;
--    sigset_t mask;
-     /*
-      * Compute mask of all interesting signals and install signal handlers
-      * for each.  Only one signal handler may be active at a time.  Therefore,
-      * all other signals should be masked when any handler is executing.
-      */
--    sigemptyset(&mask);
--    sigaddset(&mask, SIGHUP);
--    sigaddset(&mask, SIGINT);
--    sigaddset(&mask, SIGTERM);
--    sigaddset(&mask, SIGCHLD);
--    sigaddset(&mask, SIGUSR2);
-+    sigemptyset(&signals_handled);
-+    sigaddset(&signals_handled, SIGHUP);
-+    sigaddset(&signals_handled, SIGINT);
-+    sigaddset(&signals_handled, SIGTERM);
-+    sigaddset(&signals_handled, SIGCHLD);
-+    sigaddset(&signals_handled, SIGUSR2);
- #define SIGNAL(s, handler)    do { \
-       sa.sa_handler = handler; \
-@@ -712,7 +711,7 @@
-           fatal("Couldn't establish signal handler (%d): %m", s); \
-     } while (0)
--    sa.sa_mask = mask;
-+    sa.sa_mask = signals_handled;
-     sa.sa_flags = 0;
-     SIGNAL(SIGHUP, hup);              /* Hangup */
-     SIGNAL(SIGINT, term);             /* Interrupt */
-@@ -1173,6 +1172,7 @@
-        info("Connect time %d.%d minutes.", t/10, t%10);
-        info("Sent %u bytes, received %u bytes.",
-           link_stats.bytes_out, link_stats.bytes_in);
-+       link_stats_valid = 0;
-     }
- }
-@@ -1329,6 +1329,7 @@
- /*
-  * kill_my_pg - send a signal to our process group, and ignore it ourselves.
-+ * We assume that sig is currently blocked.
-  */
- static void
- kill_my_pg(sig)
-@@ -1336,10 +1337,22 @@
- {
-     struct sigaction act, oldact;
-+    sigemptyset(&act.sa_mask);                /* unnecessary in fact */
-     act.sa_handler = SIG_IGN;
-     act.sa_flags = 0;
--    sigaction(sig, &act, &oldact);
-     kill(0, sig);
-+    /*
-+     * The kill() above made the signal pending for us, as well as
-+     * the rest of our process group, but we don't want it delivered
-+     * to us.  It is blocked at the moment.  Setting it to be ignored
-+     * will cause the pending signal to be discarded.  If we did the
-+     * kill() after setting the signal to be ignored, it is unspecified
-+     * (by POSIX) whether the signal is immediately discarded or left
-+     * pending, and in fact Linux would leave it pending, and so it
-+     * would be delivered after the current signal handler exits,
-+     * leading to an infinite loop.
-+     */
-+    sigaction(sig, &act, &oldact);
-     sigaction(sig, &oldact, NULL);
- }
-diff -ruN ppp-2.4.2/pppd/plugins/Makefile ppp-cvs-20040427/pppd/plugins/Makefile
---- ppp-2.4.2/pppd/plugins/Makefile    2004-01-13 04:56:24.000000000 +0100
-+++ ppp-cvs-20040427/pppd/plugins/Makefile     1970-01-01 01:00:00.000000000 +0100
-@@ -1,38 +0,0 @@
--CC    = gcc
--COPTS = -O2 -g
--CFLAGS        = $(COPTS) -I.. -I../../include -fPIC
--LDFLAGS       = -shared
--INSTALL       = install -o root
--
--SUBDIRS := rp-pppoe
--# Uncomment the next line to include the radius authentication plugin
--# SUBDIRS += radius
--PLUGINS := minconn.so passprompt.so passwordfd.so
--
--# include dependencies if present
--ifeq (.depend,$(wildcard .depend))
--include .depend
--endif
--
--all:  $(PLUGINS)
--      for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all; done
--
--%.so: %.c
--      $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^
--
--VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h)
--LIBDIR        = $(DESTDIR)/usr/lib/pppd/$(VERSION)
--
--install: $(PLUGINS)
--      $(INSTALL) -d $(LIBDIR)
--      $(INSTALL) $? $(LIBDIR)
--      for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d INSTALL=$(INSTALL) \
--                              LIBDIR=$(LIBDIR) install; done
--
--clean:
--      rm -f *.o *.so *.a
--      for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d clean; done
--
--depend:
--      $(CPP) -M $(CFLAGS) *.c >.depend
--      for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d depend; done
-diff -ruN ppp-2.4.2/pppd/plugins/radius/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/CVS/Entries
---- ppp-2.4.2/pppd/plugins/radius/CVS/Entries  2002-12-04 22:49:09.000000000 +0100
-+++ ppp-cvs-20040427/pppd/plugins/radius/CVS/Entries   1970-01-01 01:00:00.000000000 +0100
-@@ -1,7 +0,0 @@
--/pppd-radattr.8/1.1/Tue Jan 22 16:03:00 2002//
--/pppd-radius.8/1.4/Tue Apr  2 13:55:00 2002//
--/radattr.c/1.1/Tue Jan 22 16:03:00 2002//
--D/radiusclient////
--/Makefile.linux/1.5/Sat Nov  9 11:24:42 2002//
--/radrealms.c/1.1/Sat Oct  5 04:35:24 2002//
--/radius.c/1.18/Wed Dec  4 21:49:09 2002//
-diff -ruN ppp-2.4.2/pppd/plugins/radius/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/CVS/Repository
---- ppp-2.4.2/pppd/plugins/radius/CVS/Repository       2002-09-07 12:37:51.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/CVS/Repository        1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--ppp/pppd/plugins/radius
-diff -ruN ppp-2.4.2/pppd/plugins/radius/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/CVS/Root
---- ppp-2.4.2/pppd/plugins/radius/CVS/Root     2002-09-07 12:37:51.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/CVS/Root      1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--samba.org:/data/cvs
-diff -ruN ppp-2.4.2/pppd/plugins/radius/Makefile ppp-cvs-20040427/pppd/plugins/radius/Makefile
---- ppp-2.4.2/pppd/plugins/radius/Makefile     2002-11-09 12:24:42.000000000 +0100
-+++ ppp-cvs-20040427/pppd/plugins/radius/Makefile      1970-01-01 01:00:00.000000000 +0100
-@@ -1,74 +0,0 @@
--# Makefile for RADIUS plugin
--#
--# Copyright 2002 Roaring Penguin Software Inc.
--#
--
--MANDIR=/usr/man
--PLUGIN=radius.so radattr.so radrealms.so
--CFLAGS=-I../.. -I../../../include -Iradiusclient/include -O2
--
--# Uncomment the next line to include support for Microsoft's
--# MS-CHAP authentication protocol.
--CHAPMS=y
--# Uncomment the next line to include support for MPPE.
--MPPE=y
--# Uncomment the next lint to include support for traffic limiting
--MAXOCTETS=y
--
--ifdef CHAPMS
--CFLAGS += -DCHAPMS=1
--ifdef MPPE
--CFLAGS += -DMPPE=1
--endif
--endif
--ifdef MAXOCTETS
--CFLAGS += -DMAXOCTETS=1
--endif
--
--all: $(PLUGIN)
--
--install: all
--      $(MAKE) $(MFLAGS) -C radiusclient install
--      $(INSTALL) -d -m 755 $(LIBDIR)
--      $(INSTALL) -s -c -m 755 radius.so $(LIBDIR)
--      $(INSTALL) -s -c -m 755 radattr.so $(LIBDIR)
--      $(INSTALL) -s -c -m 755 radrealms.so $(LIBDIR)
--      $(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR)/man8
--      $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)/man8
--
--radius.so: radiusclient/lib/.libs/libradiusclient.a radius.o
--      gcc -o radius.so -shared radius.o radiusclient/lib/.libs/libradiusclient.a
--
--radattr.so: radattr.o
--      gcc -o radattr.so -shared radattr.o
--
--radrealms.so: radrealms.o
--      gcc -o radrealms.so -shared radrealms.o
--
--radius.o: radius.c
--      gcc $(CFLAGS) -c -o radius.o -fPIC radius.c
--
--radattr.o: radattr.c
--      gcc $(CFLAGS) -c -o radattr.o -fPIC radattr.c
--
--radrealms.o: radrealms.c
--      gcc $(CFLAGS) -c -o radrealms.o -fPIC radrealms.c
--
--radiusclient/lib/.libs/libradiusclient.a:
--      test -r radiusclient/Makefile ||           \
--              (cd radiusclient;                  \
--               ./configure --prefix=/usr         \
--                           --sysconfdir=/etc     \
--                           --enable-shared       \
--                           --enable-static)
--      $(MAKE) -C radiusclient
--
--clean:
--      $(MAKE) $(MFLAGS) -C radiusclient clean
--      rm -f *.o *.so
--
--distclean:
--      rm -f *.o *.so
--      $(MAKE) $(MFLAGS) -C radiusclient distclean
--
--dist-clean: distclean
-diff -ruN ppp-2.4.2/pppd/plugins/radius/pppd-radius.8 ppp-cvs-20040427/pppd/plugins/radius/pppd-radius.8
---- ppp-2.4.2/pppd/plugins/radius/pppd-radius.8        2002-04-02 15:55:00.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/pppd-radius.8 2004-03-26 14:30:16.000000000 +0100
-@@ -1,5 +1,5 @@
- .\" manual page [] for RADIUS plugin for pppd 2.4
--.\" $Id: pppd-radius.8,v 1.4 2002/04/02 13:55:00 dfs Exp $
-+.\" $Id: pppd-radius.8,v 1.5 2004/03/26 13:27:17 kad Exp $
- .\" SH section heading
- .\" SS subsection heading
- .\" LP paragraph
-@@ -40,6 +40,15 @@
- used, then the plugin uses
- .I /etc/radiusclient/radiusclient.conf
- as the configuration file.
-+.TP
-+.BI "avpair " attribute=value
-+Adds an Attribute-Value pair to be passed on to the RADIUS server on each request.
-+.TP
-+.BI map-to-ifname
-+Sets Radius NAS-Port attribute to number equal to interface name (Default)
-+.TP
-+.BI map-to-ttyname
-+Sets Radius NAS-Port attribute value via libradiusclient library
- .SH USAGE
- To use the plugin, simply supply the
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radius.c ppp-cvs-20040427/pppd/plugins/radius/radius.c
---- ppp-2.4.2/pppd/plugins/radius/radius.c     2004-01-13 03:26:11.000000000 +0100
-+++ ppp-cvs-20040427/pppd/plugins/radius/radius.c      2004-04-12 07:20:16.000000000 +0200
-@@ -24,7 +24,7 @@
- *
- ***********************************************************************/
- static char const RCSID[] =
--"$Id: radius.c,v 1.22 2004/01/11 08:01:30 paulus Exp $";
-+"$Id: radius.c,v 1.25 2004/04/12 05:16:37 kad Exp $";
- #include "pppd.h"
- #include "chap-new.h"
-@@ -52,10 +52,15 @@
-     char *vpstr;
-     struct avpopt *next;
- } *avpopt = NULL;
-+static bool portnummap = 0;
- static option_t Options[] = {
-     { "radius-config-file", o_string, &config_file },
-     { "avpair", o_special, add_avp },
-+    { "map-to-ttyname", o_bool, &portnummap,
-+      "Set Radius NAS-Port attribute value via libradiusclient library", OPT_PRIO | 1 },
-+    { "map-to-ifname", o_bool, &portnummap,
-+      "Set Radius NAS-Port attribute to number as in interface name (Default)", OPT_PRIOSUB | 0 },
-     { NULL }
- };
-@@ -264,7 +269,7 @@
-     /* Hack... the "port" is the ppp interface number.  Should really be
-        the tty */
--    rstate.client_port = get_client_port(ifname);
-+    rstate.client_port = get_client_port(portnummap ? devnam : ifname);
-     av_type = PW_FRAMED;
-     rc_avpair_add(&send, PW_SERVICE_TYPE, &av_type, 0, VENDOR_NONE);
-@@ -363,7 +368,7 @@
-     /* Put user with potentially realm added in rstate.user */
-     if (!rstate.done_chap_once) {
-       make_username_realm(user);
--      rstate.client_port = get_client_port (ifname);
-+      rstate.client_port = get_client_port (portnummap ? devnam : ifname);
-       if (radius_pre_auth_hook) {
-           radius_pre_auth_hook(rstate.user,
-                                &rstate.authserver,
-@@ -881,7 +886,7 @@
-     rc_avpair_add(&send, PW_ACCT_AUTHENTIC, &av_type, 0, VENDOR_NONE);
--    av_type = PW_ASYNC;
-+    av_type = ( using_pty ? PW_VIRTUAL : ( sync_serial ? PW_SYNC : PW_ASYNC ) );
-     rc_avpair_add(&send, PW_NAS_PORT_TYPE, &av_type, 0, VENDOR_NONE);
-     hisaddr = ho->hisaddr;
-@@ -981,9 +986,56 @@
-                      remote_number, 0, VENDOR_NONE);
-     }
--    av_type = PW_ASYNC;
-+    av_type = ( using_pty ? PW_VIRTUAL : ( sync_serial ? PW_SYNC : PW_ASYNC ) );
-     rc_avpair_add(&send, PW_NAS_PORT_TYPE, &av_type, 0, VENDOR_NONE);
-+    av_type = PW_NAS_ERROR;
-+    switch( status ) {
-+      case EXIT_OK:
-+      case EXIT_USER_REQUEST:
-+          av_type = PW_USER_REQUEST;
-+          break;
-+
-+      case EXIT_HANGUP:
-+      case EXIT_PEER_DEAD:
-+      case EXIT_CONNECT_FAILED:
-+          av_type = PW_LOST_CARRIER;
-+          break;
-+
-+      case EXIT_INIT_FAILED:
-+      case EXIT_OPEN_FAILED:
-+      case EXIT_LOCK_FAILED:
-+      case EXIT_PTYCMD_FAILED:
-+          av_type = PW_PORT_ERROR;
-+          break;
-+
-+      case EXIT_PEER_AUTH_FAILED:
-+      case EXIT_AUTH_TOPEER_FAILED:
-+      case EXIT_NEGOTIATION_FAILED:
-+      case EXIT_CNID_AUTH_FAILED:
-+          av_type = PW_SERVICE_UNAVAILABLE;
-+          break;
-+
-+      case EXIT_IDLE_TIMEOUT:
-+          av_type = PW_ACCT_IDLE_TIMEOUT;
-+          break;
-+
-+      case EXIT_CONNECT_TIME:
-+          av_type = PW_ACCT_SESSION_TIMEOUT;
-+          break;
-+          
-+#ifdef MAXOCTETS
-+      case EXIT_TRAFFIC_LIMIT:
-+          av_type = PW_NAS_REQUEST;
-+          break;
-+#endif
-+
-+      default:
-+          av_type = PW_NAS_ERROR;
-+          break;
-+    }
-+    rc_avpair_add(&send, PW_ACCT_TERMINATE_CAUSE, &av_type, 0, VENDOR_NONE);
-+
-     hisaddr = ho->hisaddr;
-     av_type = htonl(hisaddr);
-     rc_avpair_add(&send, PW_FRAMED_IP_ADDRESS , &av_type , 0, VENDOR_NONE);
-@@ -1077,7 +1129,7 @@
-                      remote_number, 0, VENDOR_NONE);
-     }
--    av_type = PW_ASYNC;
-+    av_type = ( using_pty ? PW_VIRTUAL : ( sync_serial ? PW_SYNC : PW_ASYNC ) );
-     rc_avpair_add(&send, PW_NAS_PORT_TYPE, &av_type, 0, VENDOR_NONE);
-     hisaddr = ho->hisaddr;
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/CVS/Entries
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/CVS/Entries     2002-09-07 12:37:54.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/CVS/Entries      1970-01-01 01:00:00.000000000 +0100
-@@ -1,28 +0,0 @@
--/BUGS/1.1/Tue Jan 22 16:03:00 2002//
--/CHANGES/1.1/Tue Jan 22 16:03:00 2002//
--/COPYRIGHT/1.1/Tue Jan 22 16:03:00 2002//
--/Makefile.am/1.1/Tue Jan 22 16:03:00 2002//
--/Makefile.in/1.1/Tue Jan 22 16:03:00 2002//
--/README/1.1/Tue Jan 22 16:03:00 2002//
--/README.radexample/1.1/Tue Jan 22 16:03:00 2002//
--/acconfig.h/1.1/Tue Jan 22 16:03:00 2002//
--/aclocal.m4/1.2/Mon Jun 24 12:57:15 2002//
--/config.guess/1.1/Tue Jan 22 16:03:00 2002//
--/config.h.in/1.3/Thu Jul 25 16:29:16 2002//
--/config.sub/1.1/Tue Jan 22 16:03:00 2002//
--/configure/1.1/Tue Jan 22 16:03:00 2002//
--/configure.in/1.1/Tue Jan 22 16:03:00 2002//
--/install-sh/1.1/Tue Jan 22 16:03:00 2002//
--/ltconfig/1.1/Tue Jan 22 16:03:00 2002//
--/ltmain.sh/1.1/Tue Jan 22 16:03:00 2002//
--/missing/1.1/Tue Jan 22 16:03:00 2002//
--/mkinstalldirs/1.1/Tue Jan 22 16:03:00 2002//
--/stamp-h.in/1.1/Tue Jan 22 16:03:00 2002//
--D/doc////
--D/etc////
--D/include////
--D/lib////
--D/login.radius////
--D/man////
--D/patches////
--D/src////
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/CVS/Repository
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/CVS/Repository  2002-09-07 12:37:51.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/CVS/Repository   1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--ppp/pppd/plugins/radius/radiusclient
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/CVS/Root
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/CVS/Root        2002-09-07 12:37:51.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/CVS/Root 1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--samba.org:/data/cvs
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/doc/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/doc/CVS/Entries
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/doc/CVS/Entries 2002-09-07 12:37:52.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/doc/CVS/Entries  1970-01-01 01:00:00.000000000 +0100
-@@ -1,4 +0,0 @@
--/Makefile.am/1.1/Tue Jan 22 16:03:01 2002//
--/Makefile.in/1.1/Tue Jan 22 16:03:01 2002//
--/instop.html/1.1/Tue Jan 22 16:03:01 2002//
--D
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/doc/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/doc/CVS/Repository
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/doc/CVS/Repository      2002-09-07 12:37:52.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/doc/CVS/Repository       1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--ppp/pppd/plugins/radius/radiusclient/doc
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/doc/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/doc/CVS/Root
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/doc/CVS/Root    2002-09-07 12:37:52.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/doc/CVS/Root     1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--samba.org:/data/cvs
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/etc/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/etc/CVS/Entries
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/etc/CVS/Entries 2002-11-09 12:24:42.000000000 +0100
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/etc/CVS/Entries  1970-01-01 01:00:00.000000000 +0100
-@@ -1,13 +0,0 @@
--/dictionary.ascend/1.1/Tue Jan 22 16:03:01 2002//
--/dictionary.compat/1.1/Tue Jan 22 16:03:01 2002//
--/dictionary.merit/1.1/Tue Jan 22 16:03:01 2002//
--/dictionary.microsoft/1.1/Wed Mar  6 13:23:09 2002//
--/issue/1.1/Tue Jan 22 16:03:01 2002//
--/port-id-map/1.1/Tue Jan 22 16:03:01 2002//
--/servers/1.1/Tue Jan 22 16:03:01 2002//
--/Makefile.am/1.4/Sat Nov  9 11:24:42 2002//
--/Makefile.in/1.5/Sat Nov  9 11:24:42 2002//
--/dictionary/1.9/Sat Nov  9 11:24:42 2002//
--/radiusclient.conf.in/1.2/Sat Nov  9 11:24:42 2002//
--/realms/1.1/Sat Oct  5 04:35:24 2002//
--D
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/etc/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/etc/CVS/Repository
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/etc/CVS/Repository      2002-09-07 12:37:52.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/etc/CVS/Repository       1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--ppp/pppd/plugins/radius/radiusclient/etc
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/etc/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/etc/CVS/Root
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/etc/CVS/Root    2002-09-07 12:37:52.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/etc/CVS/Root     1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--samba.org:/data/cvs
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/include/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/include/CVS/Entries
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/include/CVS/Entries     2002-12-04 22:49:09.000000000 +0100
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/include/CVS/Entries      1970-01-01 01:00:00.000000000 +0100
-@@ -1,7 +0,0 @@
--/Makefile.am/1.1/Tue Jan 22 16:03:01 2002//
--/Makefile.in/1.1/Tue Jan 22 16:03:01 2002//
--/includes.h/1.2/Wed Feb 27 15:51:19 2002//
--/messages.h/1.2/Wed Feb 27 15:51:19 2002//
--/pathnames.h/1.2/Wed Feb 27 15:51:19 2002//
--/radiusclient.h/1.9/Wed Dec  4 21:49:09 2002//
--D
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/include/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/include/CVS/Repository
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/include/CVS/Repository  2002-09-07 12:37:52.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/include/CVS/Repository   1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--ppp/pppd/plugins/radius/radiusclient/include
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/include/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/include/CVS/Root
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/include/CVS/Root        2002-09-07 12:37:52.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/include/CVS/Root 1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--samba.org:/data/cvs
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/lib/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/lib/CVS/Entries
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/lib/CVS/Entries 2002-12-04 22:49:09.000000000 +0100
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/lib/CVS/Entries  1970-01-01 01:00:00.000000000 +0100
-@@ -1,20 +0,0 @@
--/Makefile.am/1.1/Tue Jan 22 16:03:02 2002//
--/Makefile.in/1.2/Wed Feb 20 02:22:35 2002//
--/clientid.c/1.2/Wed Feb 27 15:51:20 2002//
--/dict.c/1.2/Tue Mar  5 15:14:06 2002//
--/env.c/1.2/Wed Feb 27 15:51:20 2002//
--/ip_util.c/1.2/Wed Feb 27 15:51:20 2002//
--/lock.c/1.2/Wed Feb 27 15:51:20 2002//
--/log.c/1.2/Wed Feb 27 15:51:20 2002//
--/md5.c/1.2/Wed Feb 27 15:51:20 2002//
--/memcmp.c/1.2/Wed Feb 27 15:51:20 2002//
--/sendserver.c/1.4/Tue Apr  2 14:09:35 2002//
--/strcasecmp.c/1.2/Wed Feb 27 15:51:20 2002//
--/strdup.c/1.2/Wed Feb 27 15:51:20 2002//
--/strerror.c/1.2/Wed Feb 27 15:51:20 2002//
--/util.c/1.2/Wed Feb 27 15:51:20 2002//
--/buildreq.c/1.4/Sat Nov  9 11:24:43 2002//
--/config.c/1.3/Sat Nov  9 11:24:43 2002//
--/options.h/1.2/Sat Nov  9 11:24:43 2002//
--/avpair.c/1.3/Wed Dec  4 21:49:09 2002//
--D
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/lib/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/lib/CVS/Repository
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/lib/CVS/Repository      2002-09-07 12:37:53.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/lib/CVS/Repository       1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--ppp/pppd/plugins/radius/radiusclient/lib
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/lib/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/lib/CVS/Root
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/lib/CVS/Root    2002-09-07 12:37:53.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/lib/CVS/Root     1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--samba.org:/data/cvs
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/CVS/Entries
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/CVS/Entries        2002-09-07 12:37:54.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
-@@ -1,5 +0,0 @@
--/Makefile.am/1.1/Tue Jan 22 16:03:02 2002//
--/Makefile.in/1.1/Tue Jan 22 16:03:02 2002//
--/README/1.1/Tue Jan 22 16:03:02 2002//
--/login.radius/1.1/Tue Jan 22 16:03:02 2002//
--D/migs////
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/CVS/Repository
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/CVS/Repository     2002-09-07 12:37:53.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/CVS/Repository      1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--ppp/pppd/plugins/radius/radiusclient/login.radius
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/CVS/Root
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/CVS/Root   2002-09-07 12:37:53.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/CVS/Root    1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--samba.org:/data/cvs
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Entries
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Entries   2002-09-07 12:37:53.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Entries    1970-01-01 01:00:00.000000000 +0100
-@@ -1,7 +0,0 @@
--/Makefile.am/1.1/Tue Jan 22 16:03:02 2002//
--/Makefile.in/1.1/Tue Jan 22 16:03:02 2002//
--/README/1.1/Tue Jan 22 16:03:02 2002//
--/ip-down/1.1/Tue Jan 22 16:03:02 2002//
--/ip-up/1.1/Tue Jan 22 16:03:02 2002//
--/login.radius/1.1/Tue Jan 22 16:03:02 2002//
--D
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Repository
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Repository        2002-09-07 12:37:53.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Repository 1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--ppp/pppd/plugins/radius/radiusclient/login.radius/migs
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Root
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Root      2002-09-07 12:37:53.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/login.radius/migs/CVS/Root       1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--samba.org:/data/cvs
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/man/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/man/CVS/Entries
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/man/CVS/Entries 2002-09-07 12:37:53.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/man/CVS/Entries  1970-01-01 01:00:00.000000000 +0100
-@@ -1,3 +0,0 @@
--/Makefile.am/1.1/Tue Jan 22 16:03:02 2002//
--/Makefile.in/1.1/Tue Jan 22 16:03:02 2002//
--D
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/man/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/man/CVS/Repository
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/man/CVS/Repository      2002-09-07 12:37:53.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/man/CVS/Repository       1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--ppp/pppd/plugins/radius/radiusclient/man
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/man/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/man/CVS/Root
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/man/CVS/Root    2002-09-07 12:37:53.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/man/CVS/Root     1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--samba.org:/data/cvs
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/patches/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/patches/CVS/Entries
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/patches/CVS/Entries     2002-09-07 12:37:53.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/patches/CVS/Entries      1970-01-01 01:00:00.000000000 +0100
-@@ -1,7 +0,0 @@
--/Makefile.am/1.1/Tue Jan 22 16:03:03 2002//
--/Makefile.in/1.1/Tue Jan 22 16:03:03 2002//
--/README/1.1/Tue Jan 22 16:03:03 2002//
--/merit-2.4.21-CHAP.diff/1.1/Tue Jan 22 16:03:04 2002//
--/radiusd-1.16.accounting.diff/1.1/Tue Jan 22 16:03:04 2002//
--/radiusd-1.16.shadow.diff/1.1/Tue Jan 22 16:03:04 2002//
--D
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/patches/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/patches/CVS/Repository
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/patches/CVS/Repository  2002-09-07 12:37:53.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/patches/CVS/Repository   1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--ppp/pppd/plugins/radius/radiusclient/patches
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/patches/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/patches/CVS/Root
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/patches/CVS/Root        2002-09-07 12:37:53.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/patches/CVS/Root 1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--samba.org:/data/cvs
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/src/CVS/Entries ppp-cvs-20040427/pppd/plugins/radius/radiusclient/src/CVS/Entries
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/src/CVS/Entries 2002-09-07 12:37:53.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/src/CVS/Entries  1970-01-01 01:00:00.000000000 +0100
-@@ -1,11 +0,0 @@
--/Makefile.am/1.1/Tue Jan 22 16:03:04 2002//
--/Makefile.in/1.1/Tue Jan 22 16:03:04 2002//
--/local.c/1.1/Tue Jan 22 16:03:04 2002//
--/radacct.c/1.1/Tue Jan 22 16:03:04 2002//
--/radexample-debug/1.1/Tue Jan 22 16:03:04 2002//
--/radexample.c/1.2/Tue Apr  2 14:09:35 2002//
--/radius.c/1.2/Tue Apr  2 14:09:35 2002//
--/radlogin.c/1.1/Tue Jan 22 16:03:04 2002//
--/radlogin.h/1.1/Tue Jan 22 16:03:05 2002//
--/radstatus.c/1.1/Tue Jan 22 16:03:05 2002//
--D
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/src/CVS/Repository ppp-cvs-20040427/pppd/plugins/radius/radiusclient/src/CVS/Repository
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/src/CVS/Repository      2002-09-07 12:37:53.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/src/CVS/Repository       1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--ppp/pppd/plugins/radius/radiusclient/src
-diff -ruN ppp-2.4.2/pppd/plugins/radius/radiusclient/src/CVS/Root ppp-cvs-20040427/pppd/plugins/radius/radiusclient/src/CVS/Root
---- ppp-2.4.2/pppd/plugins/radius/radiusclient/src/CVS/Root    2002-09-07 12:37:53.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/radius/radiusclient/src/CVS/Root     1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--samba.org:/data/cvs
-diff -ruN ppp-2.4.2/pppd/plugins/rp-pppoe/CVS/Entries ppp-cvs-20040427/pppd/plugins/rp-pppoe/CVS/Entries
---- ppp-2.4.2/pppd/plugins/rp-pppoe/CVS/Entries        2002-09-07 12:37:54.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/rp-pppoe/CVS/Entries 1970-01-01 01:00:00.000000000 +0100
-@@ -1,9 +0,0 @@
--/Makefile.linux/1.1/Fri Dec 14 02:55:20 2001//
--/common.c/1.1/Fri Dec 14 02:55:20 2001//
--/config.h/1.1/Fri Dec 14 02:55:20 2001//
--/debug.c/1.1/Fri Dec 14 02:55:20 2001//
--/discovery.c/1.1/Fri Dec 14 02:55:20 2001//
--/if.c/1.1/Fri Dec 14 02:55:20 2001//
--/plugin.c/1.7/Tue Apr  2 13:11:00 2002//
--/pppoe.h/1.1/Fri Dec 14 02:55:20 2001//
--D
-diff -ruN ppp-2.4.2/pppd/plugins/rp-pppoe/CVS/Repository ppp-cvs-20040427/pppd/plugins/rp-pppoe/CVS/Repository
---- ppp-2.4.2/pppd/plugins/rp-pppoe/CVS/Repository     2002-09-07 12:37:53.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/rp-pppoe/CVS/Repository      1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--ppp/pppd/plugins/rp-pppoe
-diff -ruN ppp-2.4.2/pppd/plugins/rp-pppoe/CVS/Root ppp-cvs-20040427/pppd/plugins/rp-pppoe/CVS/Root
---- ppp-2.4.2/pppd/plugins/rp-pppoe/CVS/Root   2002-09-07 12:37:53.000000000 +0200
-+++ ppp-cvs-20040427/pppd/plugins/rp-pppoe/CVS/Root    1970-01-01 01:00:00.000000000 +0100
-@@ -1 +0,0 @@
--samba.org:/data/cvs
-diff -ruN ppp-2.4.2/pppd/plugins/rp-pppoe/Makefile ppp-cvs-20040427/pppd/plugins/rp-pppoe/Makefile
---- ppp-2.4.2/pppd/plugins/rp-pppoe/Makefile   2004-01-13 04:57:55.000000000 +0100
-+++ ppp-cvs-20040427/pppd/plugins/rp-pppoe/Makefile    1970-01-01 01:00:00.000000000 +0100
-@@ -1,50 +0,0 @@
--# Generated automatically from Makefile.in by configure.
--#***********************************************************************
--#
--# Makefile
--#
--# Makefile for Roaring Penguin's Linux PPPoE plugin.
--#
--# Copyright (C) 2001 Roaring Penguin Software Inc.
--#
--# This program may be distributed according to the terms of the GNU
--# General Public License, version 2 or (at your option) any later version.
--#
--# $Id: Makefile.linux,v 1.2 2004/01/13 03:57:55 paulus Exp $
--#***********************************************************************
--
--# Version is set ONLY IN THE MAKEFILE!  Don't delete this!
--VERSION=3.3
--
--COPTS=-O2 -g
--CFLAGS=$(COPTS) -I../../../include/linux
--all: rp-pppoe.so
--
--rp-pppoe.so: libplugin.a plugin.o
--      gcc -o rp-pppoe.so -shared plugin.o libplugin.a
--
--install: all
--      $(INSTALL) -d -m 755 $(LIBDIR)
--      $(INSTALL) -s -c -m 4550 rp-pppoe.so $(LIBDIR)
--
--clean:
--      rm -f *.o *.so
--
--plugin.o: plugin.c
--      gcc '-DRP_VERSION="$(VERSION)"' $(CFLAGS) -I../../..  -c -o plugin.o -fPIC plugin.c
--
--libplugin.a: discovery.o if.o common.o debug.o
--      ar -rc $@ $^
--
--discovery.o: discovery.c
--      gcc $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o discovery.o -fPIC discovery.c
--
--if.o: if.c
--      gcc $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o if.o -fPIC if.c
--
--debug.o: debug.c
--      gcc $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o debug.o -fPIC debug.c
--
--common.o: common.c
--      gcc $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o common.o -fPIC common.c
--
-diff -ruN ppp-2.4.2/pppd/pppd.8 ppp-cvs-20040427/pppd/pppd.8
---- ppp-2.4.2/pppd/pppd.8      2004-01-15 06:09:00.000000000 +0100
-+++ ppp-cvs-20040427/pppd/pppd.8       2004-04-27 20:25:12.000000000 +0200
-@@ -1,5 +1,5 @@
- .\" manual page [] for pppd 2.4
--.\" $Id: pppd.8,v 1.76 2004/01/15 05:09:00 paulus Exp $
-+.\" $Id: pppd.8,v 1.77 2004/04/27 18:22:58 fcusack Exp $
- .\" SH section heading
- .\" SS subsection heading
- .\" LP paragraph
-@@ -955,11 +955,11 @@
- Require the use of MPPE, with 128\-bit encryption.
- .TP
- .B require-mschap
--Require the peer to authenticate itself using MS-CHAP [Microsft Challenge
-+Require the peer to authenticate itself using MS-CHAP [Microsoft Challenge
- Handshake Authentication Protocol] authentication.
- .TP
- .B require-mschap-v2
--Require the peer to authenticate itself using MS-CHAPv2 [Microsft Challenge
-+Require the peer to authenticate itself using MS-CHAPv2 [Microsoft Challenge
- Handshake Authentication Protocol, Version 2] authentication.
- .TP
- .B require-eap
-diff -ruN ppp-2.4.2/pppd/tty.c ppp-cvs-20040427/pppd/tty.c
---- ppp-2.4.2/pppd/tty.c       2004-01-13 05:17:59.000000000 +0100
-+++ ppp-cvs-20040427/pppd/tty.c        2004-01-17 06:50:12.000000000 +0100
-@@ -73,7 +73,7 @@
-  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
--#define RCSID "$Id: tty.c,v 1.13 2004/01/13 04:17:59 paulus Exp $"
-+#define RCSID "$Id: tty.c,v 1.14 2004/01/17 05:47:55 carlsonj Exp $"
- #include <stdio.h>
- #include <ctype.h>
-@@ -512,7 +512,9 @@
- {
-       char *connector;
-       int fdflags;
-+#ifndef __linux__
-       struct stat statbuf;
-+#endif
-       char numbuf[16];
-       /*
-diff -ruN ppp-2.4.2/pppdump/bsd-comp.c ppp-cvs-20040427/pppdump/bsd-comp.c
---- ppp-2.4.2/pppdump/bsd-comp.c       1999-04-16 13:34:42.000000000 +0200
-+++ ppp-cvs-20040427/pppdump/bsd-comp.c        2004-01-17 06:50:12.000000000 +0100
-@@ -38,12 +38,14 @@
-  */
- /*
-- * $Id: bsd-comp.c,v 1.3 1999/04/16 11:35:59 paulus Exp $
-+ * $Id: bsd-comp.c,v 1.4 2004/01/17 05:47:55 carlsonj Exp $
-  */
- #include <sys/types.h>
-+#include <stdio.h>
- #include <stddef.h>
- #include <stdlib.h>
-+#include <string.h>
- #include "ppp_defs.h"
- #include "ppp-comp.h"
-diff -ruN ppp-2.4.2/pppdump/deflate.c ppp-cvs-20040427/pppdump/deflate.c
---- ppp-2.4.2/pppdump/deflate.c        2002-12-06 10:49:16.000000000 +0100
-+++ ppp-cvs-20040427/pppdump/deflate.c 2004-01-17 06:50:12.000000000 +0100
-@@ -33,12 +33,14 @@
-  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  *
-- * $Id: deflate.c,v 1.4 2002/12/06 09:49:16 paulus Exp $
-+ * $Id: deflate.c,v 1.5 2004/01/17 05:47:55 carlsonj Exp $
-  */
- #include <sys/types.h>
-+#include <stdio.h>
- #include <stddef.h>
- #include <stdlib.h>
-+#include <string.h>
- #include "ppp_defs.h"
- #include "ppp-comp.h"
- #include "zlib.h"
-diff -ruN ppp-2.4.2/pppdump/pppdump.c ppp-cvs-20040427/pppdump/pppdump.c
---- ppp-2.4.2/pppdump/pppdump.c        2002-12-06 10:17:02.000000000 +0100
-+++ ppp-cvs-20040427/pppdump/pppdump.c 2004-01-17 06:50:12.000000000 +0100
-@@ -35,6 +35,7 @@
-  */
- #include <stdio.h>
- #include <unistd.h>
-+#include <stdlib.h>
- #include <time.h>
- #include <sys/types.h>
- #include "ppp_defs.h"
-@@ -53,6 +54,12 @@
- extern int optind;
- extern char *optarg;
-+void dumplog();
-+void dumpppp();
-+void show_time();
-+void handle_ccp();
-+
-+int
- main(ac, av)
-     int ac;
-     char **av;
-@@ -105,6 +112,7 @@
-     exit(0);
- }
-+void
- dumplog(f)
-     FILE *f;
- {
-@@ -244,6 +252,7 @@
- unsigned char dbuf[8192];
-+void
- dumpppp(f)
-     FILE *f;
- {
-@@ -429,6 +438,7 @@
-     NULL
- };
-+void
- handle_ccp(cp, dp, len)
-     struct pkt *cp;
-     u_char *dp;
-@@ -485,6 +495,7 @@
-     }
- }
-+void
- show_time(f, c)
-     FILE *f;
-     int c;
-diff -ruN ppp-2.4.2/scripts/callback ppp-cvs-20040427/scripts/callback
---- ppp-2.4.2/scripts/callback 1995-08-09 04:49:51.000000000 +0200
-+++ ppp-cvs-20040427/scripts/callback  2004-04-12 07:30:11.000000000 +0200
-@@ -33,7 +33,7 @@
-       ABORT           '\nNO ANSWER\r'                 \
-       ABORT           '\nRINGING\r\n\r\nRINGING\r'    \
-       ''              AT                              \
--      'OK-+++\c-OK'   'AT&C0&D2S0=0H0                 \
-+      'OK-+++\c-OK'   'AT&C0&D2S0=0H0'                \
-       TIMEOUT         30                              \
-       OK              ATDT$TELEPHONE                  \
-       CONNECT         ''                              \
-diff -ruN ppp-2.4.2/scripts/ipv6-down.sample ppp-cvs-20040427/scripts/ipv6-down.sample
---- ppp-2.4.2/scripts/ipv6-down.sample 1999-08-23 08:07:07.000000000 +0200
-+++ ppp-cvs-20040427/scripts/ipv6-down.sample  2004-04-12 07:45:18.000000000 +0200
-@@ -8,24 +8,24 @@
- # Kill the router advertisement daemon on this interface.
- # The killing procedure is copied from RedHat 6.0 initscripts.
--DEVICE=$1
-+DEVICE="$1"
--PIDFILE=/var/run/radvd-$DEVICE.pid
-+PIDFILE="/var/run/radvd-$DEVICE.pid"
--[ -f $PIDFILE ] || exit 0
-+[ -f "$PIDFILE" ] || exit 0
--PID=`cat $PIDFILE`
-+PID="$(cat "$PIDFILE")"
- if [ "$PID" != "" ]; then
--    if ps h $PID >/dev/null 2>&1; then
--      kill -TERM $PID
-+    if ps h "$PID" >/dev/null 2>&1; then
-+      kill -TERM "$PID"
-       usleep 10000
--      if ps h $PID >/dev/null 2>&1; then
-+      if ps h "$PID" >/dev/null 2>&1; then
-           sleep 1
--          if ps h $PID >/dev/null 2>&1; then
--              kill -KILL $PID
-+          if ps h "$PID" >/dev/null 2>&1; then
-+              kill -KILL "$PID"
-           fi
-       fi
-     fi
- fi
--rm -f $PIDFILE
-+rm -f "$PIDFILE"
-diff -ruN ppp-2.4.2/scripts/ipv6-up.sample ppp-cvs-20040427/scripts/ipv6-up.sample
---- ppp-2.4.2/scripts/ipv6-up.sample   1999-08-23 08:07:07.000000000 +0200
-+++ ppp-cvs-20040427/scripts/ipv6-up.sample    2004-04-12 07:45:18.000000000 +0200
-@@ -8,26 +8,27 @@
- # Start router advertisements on this link.
- # Based on radvd 0.5.0 behaviour
--DEVICE=$1
-+DEVICE="$1"
--CFGFILE=/usr/inet6/etc/radvd.conf-$DEVICE
--PIDFILE=/var/run/radvd-$DEVICE.pid
-+CFGFILE="/etc/radvd.conf-$DEVICE"
-+PIDFILE="/var/run/radvd-$DEVICE.pid"
-+EXEFILE="/usr/sbin/radvd"
--if [ -x /usr/inet6/sbin/radvd && -f $CFGFILE ]; then
--    touch $PIDFILE
--    if [ ! -f $PIDFILE ]; then
-+if [ -x "$EXEFILE" -a -f "$CFGFILE" ]; then
-+    touch "$PIDFILE"
-+    if [ ! -f "$PIDFILE" ]; then
-       echo "error: $PIDFILE is not a regular file. Aborting"
-       exit 0
-     fi
--    PID=`cat $PIDFILE`
--    if [ "$PID" != "" ]; then
--      ps h $PID >/dev/null 2>&1 && exit 0
-+    PID="$(cat "$PIDFILE")"
-+    if [ -n "$PID" ]; then
-+      ps h "$PID" >/dev/null 2>&1 && exit 0
-     fi
-     # radvd 0.5.0 doesn't write a pid-file so we do it here
-     # enabling debugging keeps radvd in foreground, putting it
-     # on background gives us the PID.
--    /usr/inet6/sbin/radvd -d 1 -C $CFGFILE &
--    echo $! >$PIDFILE
-+    "$EXEFILE" -d 1 -C "$CFGFILE" &
-+    echo $! >"$PIDFILE"
- fi
-diff -ruN ppp-2.4.2/scripts/pon ppp-cvs-20040427/scripts/pon
---- ppp-2.4.2/scripts/pon      2002-11-25 00:30:44.000000000 +0100
-+++ ppp-cvs-20040427/scripts/pon       2004-04-12 07:45:18.000000000 +0200
-@@ -1,10 +1,12 @@
- #!/bin/sh
-+PPP_ON_BOOT=/etc/ppp/ppp_on_boot
-+
- case "$1" in
-   -*) echo "
- Usage: pon [provider] [arguments]
--If pon is invoked without arguments, /etc/ppp/ppp_on_boot file will be
-+If pon is invoked without arguments, $PPP_ON_BOOT file will be
- run, presuming it exists and is executable. Otherwise, a PPP connection
- will be started using settings from /etc/ppp/peers/provider.
- If you specify one argument, a PPP connection will be started using
-@@ -16,8 +18,8 @@
-       ;;
- esac
--if [ -z "$1" -a -x /etc/ppp/ppp_on_boot ]; then
--  exec /etc/ppp/ppp_on_boot
-+if [ -z "$1" -a -x "$PPP_ON_BOOT" ]; then
-+  exec "$PPP_ON_BOOT"
- fi
- if [ -z "$1" -a ! -f /etc/ppp/peers/provider ]; then
-diff -ruN ppp-2.4.2/svr4/Makedefs ppp-cvs-20040427/svr4/Makedefs
---- ppp-2.4.2/svr4/Makedefs    1970-01-01 01:00:00.000000000 +0100
-+++ ppp-cvs-20040427/svr4/Makedefs     2000-06-09 03:36:34.000000000 +0200
-@@ -0,0 +1,16 @@
-+#
-+# defines common to several Makefiles
-+#
-+
-+INSTALL= /usr/sbin/install
-+
-+BINDIR = /usr/local/bin
-+MANDIR = /usr/local/man
-+ETCDIR = /etc/ppp
-+
-+COPTS = -O -Xa
-+
-+# For compiling with gcc, comment out the COPTS definition above and
-+# uncomment the next 2 definitions.
-+#CC = gcc
-+#COPTS = -O2
-diff -ruN ppp-2.4.2/svr4/Makedefs.sol2 ppp-cvs-20040427/svr4/Makedefs.sol2
---- ppp-2.4.2/svr4/Makedefs.sol2       1970-01-01 01:00:00.000000000 +0100
-+++ ppp-cvs-20040427/svr4/Makedefs.sol2        1999-09-21 22:50:31.000000000 +0200
-@@ -0,0 +1,59 @@
-+#
-+# Generic make definitions for Solaris 2
-+#
-+# $Id: Makedefs.sol2,v 1.3 1999/09/21 20:37:20 masputra Exp $
-+#
-+
-+include ../svr4/Makedefs
-+
-+CPPFLAGS      = -D_KERNEL -DSVR4 -DSOL2 -DPRIOQ -DDEBUG -I../include
-+CFLAGS                = $(CPPFLAGS) $(COPTS)
-+
-+# lint-specific variables
-+LINT            = lint
-+LINT_OPT_32     =
-+LINT_OPT_64     = -Xarch=v9 -errchk=longptr64
-+
-+LINT_32       =
-+LINT_32       += -erroff=E_BAD_PTR_CAST_ALIGN
-+LINT_32       += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
-+LINT_32       += -erroff=E_SUSPICIOUS_COMPARISON
-+LINT_32       += -erroff=E_CAST_UINT_TO_SIGNED_INT
-+LINT_32       += -erroff=E_PASS_UINT_TO_SIGNED_INT
-+LINT_32       += -erroff=E_INVALID_ANNOTATION_NAME
-+LINT_32       += -erroff=E_FUNC_ARG_UNUSED
-+# This might be needed, but zlib.c and vjcompress.c will squawk 
-+# when not ignored
-+LINT_32               += -erroff=E_CASE_FALLTHRU
-+LINT_32               += -erroff=E_RET_INT_IMPLICITLY
-+LINT_32               += -erroff=E_FUNC_NO_RET_VAL
-+# Some STREAMS macros will be noisy too when this isn't ignored
-+LINT_32               += -erroff=E_CONSTANT_CONDITION
-+LINT_32               += -erroff=E_CONST_EXPR
-+
-+# Extra noise suppressant for 64-bit
-+EXTRA_OFF     =
-+EXTRA_OFF     += -erroff=E_CAST_INT_TO_SMALL_INT
-+EXTRA_OFF     += -erroff=E_CAST_INT_CONST_TO_SMALL_INT
-+EXTRA_OFF     += -erroff=E_CAST_TO_PTR_FROM_INT
-+EXTRA_OFF     += -erroff=E_ASSIGN_INT_TO_SMALL_INT
-+EXTRA_OFF     += -erroff=E_ASSIGN_INT_FROM_BIG_CONST
-+EXTRA_OFF     += -erroff=E_CONST_PROMOTED_UNSIGNED_LL
-+EXTRA_OFF     += -erroff=E_CONST_PROMOTED_LONG_LONG
-+EXTRA_OFF     += -erroff=E_CONST_TRUNCATED_BY_ASSIGN
-+EXTRA_OFF     += -erroff=E_PASS_INT_FROM_BIG_CONST
-+EXTRA_OFF     += -erroff=E_COMP_INT_WITH_LARGE_INT
-+EXTRA_OFF     += -erroff=E_ASSIGN_UINT_TO_SIGNED_INT
-+EXTRA_OFF     += -erroff=E_ASSIGN_NARROW_CONV
-+EXTRA_OFF     += -erroff=E_PASS_INT_TO_SMALL_INT
-+EXTRA_OFF     += -erroff=E_PTR_CONV_LOSES_BITS
-+
-+LINT_64       = $(LINT_32)
-+LINT_64       += $(EXTRA_OFF)
-+
-+LINTFLAGS64     = -Xa -nsxmuF -errtags=yes $(LINT_OPT_64) $(LINT_64)
-+LINT64          = $(LINT) -c $(LINTFLAGS64) $(CPPFLAGS)
-+
-+LINTFLAGS32     = -Xa -nsxmuF -errtags=yes $(LINT_OPT_32) $(LINT_32)
-+LINT32          = $(LINT) -c $(LINTFLAGS32) $(CPPFLAGS)
-+
-diff -ruN ppp-2.4.2/svr4/Makefile.sol2 ppp-cvs-20040427/svr4/Makefile.sol2
---- ppp-2.4.2/svr4/Makefile.sol2       1970-01-01 01:00:00.000000000 +0100
-+++ ppp-cvs-20040427/svr4/Makefile.sol2        1999-09-21 22:50:32.000000000 +0200
-@@ -0,0 +1,66 @@
-+#
-+# Makefile for STREAMS modules for Solaris 2.
-+#
-+# $Id: Makefile.sol2,v 1.18 1999/09/21 20:37:20 masputra Exp $
-+#
-+
-+include Makedefs.sol2
-+
-+COPTS += -xO2 -xspace -W0,-Lt
-+
-+COMP_OBJS = ppp_comp.o bsd-comp.o deflate.o zlib.o vjcompress.o \
-+      ppp_comp_mod.o
-+
-+all:  ppp ppp_ahdl ppp_comp
-+
-+ppp:  ppp.o ppp_mod.o
-+      ld -r -o $@ ppp.o ppp_mod.o
-+      chmod +x $@
-+
-+ppp_ahdl: ppp_ahdlc.o ppp_ahdlc_mod.o
-+      ld -r -o $@ ppp_ahdlc.o ppp_ahdlc_mod.o
-+      chmod +x $@
-+
-+ppp_comp: $(COMP_OBJS)
-+      ld -r -o $@ $(COMP_OBJS)
-+      chmod +x $@
-+
-+bsd-comp.o:   ../modules/bsd-comp.c
-+      $(CC) $(CFLAGS) -c $?
-+deflate.o:    ../modules/deflate.c
-+      $(CC) $(CFLAGS) -c $?
-+ppp.o:        ../modules/ppp.c
-+      $(CC) $(CFLAGS) -c $?
-+ppp_mod.o:    ppp_mod.c
-+      $(CC) $(CFLAGS) -c $?
-+ppp_ahdlc_mod.o: ppp_ahdlc_mod.c
-+      $(CC) $(CFLAGS) -c $?
-+ppp_ahdlc.o: ../modules/ppp_ahdlc.c
-+      $(CC) $(CFLAGS) -c $?
-+ppp_comp.o: ../modules/ppp_comp.c
-+      $(CC) $(CFLAGS) -c $?
-+ppp_comp_mod.o:       ppp_comp_mod.c
-+      $(CC) $(CFLAGS) -c $?
-+vjcompress.o: ../modules/vjcompress.c
-+      $(CC) $(CFLAGS) -c $?
-+zlib.o:       ../common/zlib.c
-+      $(CC) $(CFLAGS) -c $?
-+
-+install:
-+      cp ppp ppp.conf /kernel/drv
-+      cp ppp_comp ppp_ahdl /kernel/strmod
-+      if grep clone:ppp /etc/minor_perm; then :; else \
-+        echo clone:ppp 0644 root sys >>/etc/minor_perm; fi
-+      /usr/sbin/rem_drv ppp 2>/dev/null || true
-+      /usr/sbin/add_drv ppp
-+
-+SRCS  = ../modules/ppp.c ppp_mod.c ../modules/ppp_ahdlc.c ppp_ahdlc_mod.c \
-+      ../modules/ppp_comp.c ../modules/bsd-comp.c ../modules/deflate.c \
-+      ../common/zlib.c ../modules/vjcompress.c ppp_comp_mod.c
-+
-+lint:
-+      $(LINT32) $(SRCS)
-+
-+clean:
-+      rm -f ppp ppp_comp ppp_ahdl *.o *~ core
-+      rm -f *.ln
-diff -ruN ppp-2.4.2/svr4/Makefile.sol2-64 ppp-cvs-20040427/svr4/Makefile.sol2-64
---- ppp-2.4.2/svr4/Makefile.sol2-64    1970-01-01 01:00:00.000000000 +0100
-+++ ppp-cvs-20040427/svr4/Makefile.sol2-64     1999-09-21 22:50:33.000000000 +0200
-@@ -0,0 +1,85 @@
-+#
-+# Makefile for 64-bit STREAMS modules for Solaris 2.
-+#
-+# $Id: Makefile.sol2-64,v 1.3 1999/09/21 20:37:20 masputra Exp $
-+#
-+
-+include Makedefs.sol2
-+
-+# Sun's cc flag for LP64 compilation / linkage
-+COPTS                 += -xchip=ultra -xarch=v9 -Wc,-xcode=abs32 -Wc,-Qiselect-regsym=0 -xO3 -xspace -W0,-Lt
-+
-+# subdirectory where 64-bit objects / binaries will be placed
-+LP64DIR               = sparcv9
-+
-+# Name of legacy Makefile (for 32-bit binaries)
-+STD_MAKE      = Makefile.sol2
-+
-+COMP_OBJS     = $(LP64DIR)/ppp_comp.o $(LP64DIR)/bsd-comp.o \
-+              $(LP64DIR)/deflate.o $(LP64DIR)/zlib.o $(LP64DIR)/vjcompress.o \
-+              $(LP64DIR)/ppp_comp_mod.o
-+
-+all:  std_objs $(LP64DIR) ppp ppp_ahdl ppp_comp
-+
-+std_objs:
-+      $(MAKE) -f $(STD_MAKE) all
-+
-+ppp:  $(LP64DIR)/ppp.o $(LP64DIR)/ppp_mod.o
-+      ld -r -o $(LP64DIR)/$@ $(LP64DIR)/ppp.o $(LP64DIR)/ppp_mod.o
-+      chmod +x $(LP64DIR)/$@
-+
-+ppp_ahdl: $(LP64DIR)/ppp_ahdlc.o $(LP64DIR)/ppp_ahdlc_mod.o
-+      ld -r -o $(LP64DIR)/$@ $(LP64DIR)/ppp_ahdlc.o $(LP64DIR)/ppp_ahdlc_mod.o
-+      chmod +x $(LP64DIR)/$@
-+
-+ppp_comp: $(COMP_OBJS)
-+      ld -r -o $(LP64DIR)/$@ $(COMP_OBJS)
-+      chmod +x $(LP64DIR)/$@
-+
-+$(LP64DIR)/bsd-comp.o: ../modules/bsd-comp.c
-+      $(CC) $(CFLAGS) -c $? -o $@
-+$(LP64DIR)/deflate.o: ../modules/deflate.c
-+      $(CC) $(CFLAGS) -c $? -o $@
-+$(LP64DIR)/ppp.o:     ../modules/ppp.c
-+      $(CC) $(CFLAGS) -c $? -o $@
-+$(LP64DIR)/ppp_mod.o: ppp_mod.c
-+      $(CC) $(CFLAGS) -c $? -o $@
-+$(LP64DIR)/ppp_ahdlc_mod.o: ppp_ahdlc_mod.c
-+      $(CC) $(CFLAGS) -c $? -o $@
-+$(LP64DIR)/ppp_ahdlc.o: ../modules/ppp_ahdlc.c
-+      $(CC) $(CFLAGS) -c $? -o $@
-+$(LP64DIR)/ppp_comp.o: ../modules/ppp_comp.c
-+      $(CC) $(CFLAGS) -c $? -o $@
-+$(LP64DIR)/ppp_comp_mod.o: ppp_comp_mod.c
-+      $(CC) $(CFLAGS) -c $? -o $@
-+$(LP64DIR)/vjcompress.o: ../modules/vjcompress.c
-+      $(CC) $(CFLAGS) -c $? -o $@
-+$(LP64DIR)/zlib.o:    ../common/zlib.c
-+      $(CC) $(CFLAGS) -c $? -o $@
-+
-+$(LP64DIR):
-+      mkdir -m 755 -p $@
-+
-+install:
-+      cp ppp ppp.conf /kernel/drv
-+      cp ppp_comp ppp_ahdl /kernel/strmod
-+      cp $(LP64DIR)/ppp /kernel/drv/$(LP64DIR)
-+      cp $(LP64DIR)/ppp_comp $(LP64DIR)/ppp_ahdl /kernel/strmod/$(LP64DIR)
-+      if grep clone:ppp /etc/minor_perm; then :; else \
-+        echo clone:ppp 0644 root sys >>/etc/minor_perm; fi
-+      /usr/sbin/rem_drv ppp 2>/dev/null || true
-+      /usr/sbin/add_drv ppp
-+
-+SRCS  = ../modules/ppp.c ppp_mod.c ../modules/ppp_ahdlc.c ppp_ahdlc_mod.c \
-+      ../modules/ppp_comp.c ../modules/bsd-comp.c ../modules/deflate.c \
-+      ../common/zlib.c ../modules/vjcompress.c ppp_comp_mod.c
-+
-+lint:
-+      $(LINT64) $(SRCS)
-+
-+lint-32:
-+      $(LINT32) $(SRCS)
-+
-+clean:
-+      $(MAKE) -f $(STD_MAKE) clean
-+      rm -f $(LP64DIR)/ppp $(LP64DIR)/ppp_comp $(LP64DIR)/ppp_ahdl $(LP64DIR)/*.o $(LP64DIR)/*~ $(LP64DIR)/core
-diff -ruN ppp-2.4.2/svr4/Makefile.top ppp-cvs-20040427/svr4/Makefile.top
---- ppp-2.4.2/svr4/Makefile.top        1970-01-01 01:00:00.000000000 +0100
-+++ ppp-cvs-20040427/svr4/Makefile.top 1999-04-01 14:37:44.000000000 +0200
-@@ -0,0 +1,50 @@
-+#
-+# ppp top level makefile for SVR4 and Solaris 2
-+#
-+# $Id: Makefile.top,v 1.8 1999/04/01 11:44:55 paulus Exp $
-+#
-+
-+include svr4/Makedefs
-+
-+all:
-+      cd chat; $(MAKE) all
-+      cd pppd; $(MAKE) all
-+      cd pppstats; $(MAKE) all
-+      cd pppdump; $(MAKE) all
-+      cd svr4; $(MAKE) all
-+
-+install: $(BINDIR) $(MANDIR)/man8 install-progs install-etcppp
-+
-+install-progs:
-+      cd chat; $(MAKE) install
-+      cd pppd; $(MAKE) install
-+      cd pppstats; $(MAKE) install
-+      cd pppdump; $(MAKE) install
-+      cd svr4; $(MAKE) install
-+
-+install-etcppp: $(ETCDIR) $(ETCDIR)/options $(ETCDIR)/pap-secrets \
-+      $(ETCDIR)/chap-secrets
-+
-+$(ETCDIR)/options:
-+      cp etc.ppp/options $@
-+      chmod go-w $@
-+$(ETCDIR)/pap-secrets:
-+      $(INSTALL) -f $(ETCDIR) -m 600 etc.ppp/pap-secrets
-+$(ETCDIR)/chap-secrets:
-+      $(INSTALL) -f $(ETCDIR) -m 600 etc.ppp/chap-secrets
-+
-+$(BINDIR):
-+      mkdir -m 755 -p $@
-+$(MANDIR)/man8:
-+      mkdir -m 755 -p $@
-+$(ETCDIR):
-+      mkdir -m 755 -p $@
-+
-+clean:
-+      rm -f *~
-+      cd chat; $(MAKE) clean
-+      cd pppd; $(MAKE) clean
-+      cd pppstats; $(MAKE) clean
-+      cd pppdump; $(MAKE) clean
-+      cd svr4; $(MAKE) clean
-+
-diff -ruN ppp-2.4.2/svr4/ppp.Master ppp-cvs-20040427/svr4/ppp.Master
---- ppp-2.4.2/svr4/ppp.Master  1970-01-01 01:00:00.000000000 +0100
-+++ ppp-cvs-20040427/svr4/ppp.Master   1995-10-27 04:58:28.000000000 +0100
-@@ -0,0 +1 @@
-+ppp   -       Sciof   ppp     0       0       1       128     -1
-diff -ruN ppp-2.4.2/svr4/ppp.Node ppp-cvs-20040427/svr4/ppp.Node
---- ppp-2.4.2/svr4/ppp.Node    1970-01-01 01:00:00.000000000 +0100
-+++ ppp-cvs-20040427/svr4/ppp.Node     1995-10-27 04:58:36.000000000 +0100
-@@ -0,0 +1 @@
-+clone ppp     c       ppp
-diff -ruN ppp-2.4.2/svr4/ppp.System ppp-cvs-20040427/svr4/ppp.System
---- ppp-2.4.2/svr4/ppp.System  1970-01-01 01:00:00.000000000 +0100
-+++ ppp-cvs-20040427/svr4/ppp.System   1995-10-27 04:58:37.000000000 +0100
-@@ -0,0 +1 @@
-+ppp   Y       1       0       0       0       0       0       0       0
-diff -ruN ppp-2.4.2/svr4/ppp.conf ppp-cvs-20040427/svr4/ppp.conf
---- ppp-2.4.2/svr4/ppp.conf    1970-01-01 01:00:00.000000000 +0100
-+++ ppp-cvs-20040427/svr4/ppp.conf     1995-06-01 06:39:00.000000000 +0200
-@@ -0,0 +1 @@
-+name="ppp" parent="pseudo" instance=0;
-diff -ruN ppp-2.4.2/svr4/ppp_ahdl.Master ppp-cvs-20040427/svr4/ppp_ahdl.Master
---- ppp-2.4.2/svr4/ppp_ahdl.Master     1970-01-01 01:00:00.000000000 +0100
-+++ ppp-cvs-20040427/svr4/ppp_ahdl.Master      1995-10-27 04:58:32.000000000 +0100
-@@ -0,0 +1 @@
-+ppp_ahdl      -       iSf     phdl    0       0       1       1       -1
-diff -ruN ppp-2.4.2/svr4/ppp_ahdl.System ppp-cvs-20040427/svr4/ppp_ahdl.System
---- ppp-2.4.2/svr4/ppp_ahdl.System     1970-01-01 01:00:00.000000000 +0100
-+++ ppp-cvs-20040427/svr4/ppp_ahdl.System      1995-10-27 04:58:38.000000000 +0100
-@@ -0,0 +1 @@
-+ppp_ahdl      Y       1       0       0       0       0       0       0       0
-diff -ruN ppp-2.4.2/svr4/ppp_ahdlc_mod.c ppp-cvs-20040427/svr4/ppp_ahdlc_mod.c
---- ppp-2.4.2/svr4/ppp_ahdlc_mod.c     1970-01-01 01:00:00.000000000 +0100
-+++ ppp-cvs-20040427/svr4/ppp_ahdlc_mod.c      1995-12-11 06:21:02.000000000 +0100
-@@ -0,0 +1,49 @@
-+#include <sys/types.h>
-+#include <sys/param.h>
-+#include <sys/conf.h>
-+#include <sys/modctl.h>
-+#include <sys/sunddi.h>
-+
-+extern struct streamtab ppp_ahdlcinfo;
-+
-+static struct fmodsw fsw = {
-+    "ppp_ahdl",
-+    &ppp_ahdlcinfo,
-+    D_NEW | D_MP | D_MTQPAIR
-+};
-+
-+extern struct mod_ops mod_strmodops;
-+
-+static struct modlstrmod modlstrmod = {
-+    &mod_strmodops,
-+    "PPP async HDLC module",
-+    &fsw
-+};
-+
-+static struct modlinkage modlinkage = {
-+    MODREV_1,
-+    (void *) &modlstrmod,
-+    NULL
-+};
-+
-+/*
-+ * Entry points for modloading.
-+ */
-+int
-+_init(void)
-+{
-+    return mod_install(&modlinkage);
-+}
-+
-+int
-+_fini(void)
-+{
-+    return mod_remove(&modlinkage);
-+}
-+
-+int
-+_info(mip)
-+    struct modinfo *mip;
-+{
-+    return mod_info(&modlinkage, mip);
-+}
-diff -ruN ppp-2.4.2/svr4/ppp_comp.Master ppp-cvs-20040427/svr4/ppp_comp.Master
---- ppp-2.4.2/svr4/ppp_comp.Master     1970-01-01 01:00:00.000000000 +0100
-+++ ppp-cvs-20040427/svr4/ppp_comp.Master      1995-10-27 04:58:34.000000000 +0100
-@@ -0,0 +1 @@
-+ppp_comp      -       iSf     pcmp    0       0       1       1       -1
-diff -ruN ppp-2.4.2/svr4/ppp_comp.System ppp-cvs-20040427/svr4/ppp_comp.System
---- ppp-2.4.2/svr4/ppp_comp.System     1970-01-01 01:00:00.000000000 +0100
-+++ ppp-cvs-20040427/svr4/ppp_comp.System      1995-10-27 04:58:40.000000000 +0100
-@@ -0,0 +1 @@
-+ppp_comp      Y       1       0       0       0       0       0       0       0
-diff -ruN ppp-2.4.2/svr4/ppp_comp_mod.c ppp-cvs-20040427/svr4/ppp_comp_mod.c
---- ppp-2.4.2/svr4/ppp_comp_mod.c      1970-01-01 01:00:00.000000000 +0100
-+++ ppp-cvs-20040427/svr4/ppp_comp_mod.c       2002-12-06 10:50:10.000000000 +0100
-@@ -0,0 +1,89 @@
-+/*
-+ * ppp_comp_mod.c - modload support for PPP compression STREAMS module.
-+ *
-+ * Copyright (c) 1994 Paul Mackerras. All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ *
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions and the following disclaimer.
-+ *
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ *    notice, this list of conditions and the following disclaimer in
-+ *    the documentation and/or other materials provided with the
-+ *    distribution.
-+ *
-+ * 3. The name(s) of the authors of this software must not be used to
-+ *    endorse or promote products derived from this software without
-+ *    prior written permission.
-+ *
-+ * 4. Redistributions of any form whatsoever must retain the following
-+ *    acknowledgment:
-+ *    "This product includes software developed by Paul Mackerras
-+ *     <paulus@samba.org>".
-+ *
-+ * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
-+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-+ * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
-+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
-+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ *
-+ * $Id: ppp_comp_mod.c,v 1.3 2002/12/06 09:49:16 paulus Exp $
-+ */
-+
-+/*
-+ * This file is used under Solaris 2.
-+ */
-+#include <sys/types.h>
-+#include <sys/param.h>
-+#include <sys/conf.h>
-+#include <sys/modctl.h>
-+#include <sys/sunddi.h>
-+
-+extern struct streamtab ppp_compinfo;
-+
-+static struct fmodsw fsw = {
-+    "ppp_comp",
-+    &ppp_compinfo,
-+    D_NEW | D_MP | D_MTQPAIR
-+};
-+
-+extern struct mod_ops mod_strmodops;
-+
-+static struct modlstrmod modlstrmod = {
-+    &mod_strmodops,
-+    "PPP compression module",
-+    &fsw
-+};
-+
-+static struct modlinkage modlinkage = {
-+    MODREV_1,
-+    (void *) &modlstrmod,
-+    NULL
-+};
-+
-+/*
-+ * Entry points for modloading.
-+ */
-+int
-+_init(void)
-+{
-+    return mod_install(&modlinkage);
-+}
-+
-+int
-+_fini(void)
-+{
-+    return mod_remove(&modlinkage);
-+}
-+
-+int
-+_info(mip)
-+    struct modinfo *mip;
-+{
-+    return mod_info(&modlinkage, mip);
-+}
-diff -ruN ppp-2.4.2/svr4/ppp_mod.c ppp-cvs-20040427/svr4/ppp_mod.c
---- ppp-2.4.2/svr4/ppp_mod.c   1970-01-01 01:00:00.000000000 +0100
-+++ ppp-cvs-20040427/svr4/ppp_mod.c    2002-12-06 10:50:10.000000000 +0100
-@@ -0,0 +1,182 @@
-+/*
-+ * ppp_mod.c - modload support for PPP pseudo-device driver.
-+ *
-+ * Copyright (c) 1994 Paul Mackerras. All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ *
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions and the following disclaimer.
-+ *
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ *    notice, this list of conditions and the following disclaimer in
-+ *    the documentation and/or other materials provided with the
-+ *    distribution.
-+ *
-+ * 3. The name(s) of the authors of this software must not be used to
-+ *    endorse or promote products derived from this software without
-+ *    prior written permission.
-+ *
-+ * 4. Redistributions of any form whatsoever must retain the following
-+ *    acknowledgment:
-+ *    "This product includes software developed by Paul Mackerras
-+ *     <paulus@samba.org>".
-+ *
-+ * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
-+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-+ * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
-+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
-+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ *
-+ * $Id: ppp_mod.c,v 1.4 2002/12/06 09:49:16 paulus Exp $
-+ */
-+
-+/*
-+ * This file is used under Solaris 2.
-+ */
-+
-+#include <sys/types.h>
-+#include <sys/param.h>
-+#include <sys/stat.h>
-+#include <sys/conf.h>
-+#include <sys/modctl.h>
-+#include <sys/sunddi.h>
-+#include <sys/ksynch.h>
-+
-+#ifdef __STDC__
-+#define __P(x)        x
-+#else
-+#define __P(x)        ()
-+#endif
-+
-+static int ppp_identify __P((dev_info_t *));
-+static int ppp_attach __P((dev_info_t *, ddi_attach_cmd_t));
-+static int ppp_detach __P((dev_info_t *, ddi_detach_cmd_t));
-+static int ppp_devinfo __P((dev_info_t *, ddi_info_cmd_t, void *, void **));
-+
-+extern struct streamtab pppinfo;
-+extern krwlock_t ppp_lower_lock;
-+
-+static dev_info_t *ppp_dip;
-+
-+static struct cb_ops cb_ppp_ops = {
-+    nulldev, nulldev, nodev, nodev,   /* cb_open, ... */
-+    nodev, nodev, nodev, nodev,               /* cb_dump, ... */
-+    nodev, nodev, nodev, nochpoll,    /* cb_devmap, ... */
-+    ddi_prop_op,                      /* cb_prop_op */
-+    &pppinfo,                         /* cb_stream */
-+    D_NEW|D_MP|D_MTQPAIR|D_MTOUTPERIM|D_MTOCEXCL      /* cb_flag */
-+};
-+
-+static struct dev_ops ppp_ops = {
-+    DEVO_REV,                         /* devo_rev */
-+    0,                                        /* devo_refcnt */
-+    ppp_devinfo,                      /* devo_getinfo */
-+    ppp_identify,                     /* devo_identify */
-+    nulldev,                          /* devo_probe */
-+    ppp_attach,                               /* devo_attach */
-+    ppp_detach,                               /* devo_detach */
-+    nodev,                            /* devo_reset */
-+    &cb_ppp_ops,                      /* devo_cb_ops */
-+    NULL                              /* devo_bus_ops */
-+};
-+
-+/*
-+ * Module linkage information
-+ */
-+
-+static struct modldrv modldrv = {
-+    &mod_driverops,                   /* says this is a pseudo driver */
-+    "PPP-2.3 multiplexing driver",
-+    &ppp_ops                          /* driver ops */
-+};
-+
-+static struct modlinkage modlinkage = {
-+    MODREV_1,
-+    (void *) &modldrv,
-+    NULL
-+};
-+
-+int
-+_init(void)
-+{
-+    return mod_install(&modlinkage);
-+}
-+
-+int
-+_fini(void)
-+{
-+    return mod_remove(&modlinkage);
-+}
-+
-+int
-+_info(mip)
-+    struct modinfo *mip;
-+{
-+    return mod_info(&modlinkage, mip);
-+}
-+
-+static int
-+ppp_identify(dip)
-+    dev_info_t *dip;
-+{
-+    return strcmp(ddi_get_name(dip), "ppp") == 0? DDI_IDENTIFIED:
-+      DDI_NOT_IDENTIFIED;
-+}
-+
-+static int
-+ppp_attach(dip, cmd)
-+    dev_info_t *dip;
-+    ddi_attach_cmd_t cmd;
-+{
-+
-+    if (cmd != DDI_ATTACH)
-+      return DDI_FAILURE;
-+    if (ddi_create_minor_node(dip, "ppp", S_IFCHR, 0, DDI_PSEUDO, CLONE_DEV)
-+      == DDI_FAILURE) {
-+      ddi_remove_minor_node(dip, NULL);
-+      return DDI_FAILURE;
-+    }
-+    rw_init(&ppp_lower_lock, NULL, RW_DRIVER, NULL);
-+    return DDI_SUCCESS;
-+}
-+
-+static int
-+ppp_detach(dip, cmd)
-+    dev_info_t *dip;
-+    ddi_detach_cmd_t cmd;
-+{
-+    rw_destroy(&ppp_lower_lock);
-+    ddi_remove_minor_node(dip, NULL);
-+    return DDI_SUCCESS;
-+}
-+
-+static int
-+ppp_devinfo(dip, cmd, arg, result)
-+    dev_info_t *dip;
-+    ddi_info_cmd_t cmd;
-+    void *arg;
-+    void **result;
-+{
-+    int error;
-+
-+    error = DDI_SUCCESS;
-+    switch (cmd) {
-+    case DDI_INFO_DEVT2DEVINFO:
-+      if (ppp_dip == NULL)
-+          error = DDI_FAILURE;
-+      else
-+          *result = (void *) ppp_dip;
-+      break;
-+    case DDI_INFO_DEVT2INSTANCE:
-+      *result = NULL;
-+      break;
-+    default:
-+      error = DDI_FAILURE;
-+    }
-+    return error;
-+}
diff --git a/obsolete-buildroot/sources/openwrt/patches/ppp/008_pathnames.h.diff b/obsolete-buildroot/sources/openwrt/patches/ppp/008_pathnames.h.diff
deleted file mode 100644 (file)
index dee0a8d..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- ppp-2.4.0b4.orig/pppd/pathnames.h
-+++ ppp-2.4.0b4/pppd/pathnames.h
-@@ -26,7 +26,7 @@
- #define _PATH_AUTHUP   _ROOT_PATH "/etc/ppp/auth-up"
- #define _PATH_AUTHDOWN         _ROOT_PATH "/etc/ppp/auth-down"
- #define _PATH_TTYOPT   _ROOT_PATH "/etc/ppp/options."
--#define _PATH_CONNERRS         _ROOT_PATH "/etc/ppp/connect-errors"
-+#define _PATH_CONNERRS         _ROOT_PATH "/var/log/ppp-connect-errors"
- #define _PATH_PEERFILES        _ROOT_PATH "/etc/ppp/peers/"
- #define _PATH_RESOLV   _ROOT_PATH "/etc/ppp/resolv.conf"
diff --git a/obsolete-buildroot/sources/openwrt/patches/ppp/010_scripts_README.diff b/obsolete-buildroot/sources/openwrt/patches/ppp/010_scripts_README.diff
deleted file mode 100644 (file)
index 0ff2948..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
---- ppp-2.4.0b4.orig/scripts/README
-+++ ppp-2.4.0b4/scripts/README
-@@ -141,3 +141,17 @@
- are escaped. This may need to be modified depending on the ssh (or 
- pseudo-tty) implementation which may differ across platforms, for further 
- optimizations.
-+
-+------------------------------------------------------------------------
-+
-+12. pon, poff and ip-up
-+
-+These are modified version of the pon/poff/ip-up scripts contributed by Yann
-+Dirson <dirson@debian.org>. They allow you to call "pon quick" respectively 
-+"pon quick my-isp" to just call the provider for running you ip-up scripts in
-+/etc/ppp/ip-up.d. This can be useful to check for incoming/flush outgoing    
-+mail, without the necessary delay before hangup introduced by diald or such.
-+
-+These scripts break the possibility to connect to multiple ISPs at once, so
-+they are included only here.
-+
diff --git a/obsolete-buildroot/sources/openwrt/patches/ppp/011_scripts_redialer.diff b/obsolete-buildroot/sources/openwrt/patches/ppp/011_scripts_redialer.diff
deleted file mode 100644 (file)
index 657f566..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
---- ppp-2.4.0b4.orig/scripts/redialer
-+++ ppp-2.4.0b4/scripts/redialer
-@@ -1,96 +1,69 @@
- #!/bin/sh
--###################################################################
- #
--# These parameters control the attack dialing sequence.
-+# A chatscript that will attempt to dial multiple numbers in sequence, until
-+# you get connected.
- #
--# Maximum number of attempts to reach the telephone number(s)
--MAX_ATTEMPTS=10
--
--# Delay between each of the attempts. This is a parameter to sleep
--# so use "15s" for 15 seconds, "1m" for 1 minute, etc.
--SLEEP_DELAY=15s
--
--###################################################################
-+# To use: edit /etc/peers/provider, and change the connect line to read:
-+# connect "/usr/local/bin/redialer"
- #
--# This is a list of telephone numbers. Add new numbers if you wish
--# and see the function 'callall' below for the dial process.
--PHONE1=555-1212
--PHONE2=411
-+# See below for configuration.
--###################################################################
-+# This is a list of chatscripts to use to get connected, and (optional)
-+# telephone numbers to call for each of those chatscripts.
- #
--# If you use the ppp-on script, then these are passed to this routine
--# automatically. There is no need to define them here. If not, then
--# you will need to set the values.
--#
--ACCOUNT=my_account_name
--PASSWORD=my_password
-+# Note that in the chatscripts, you may use #NUMBER#, this will be replaced
-+# with the number it is calling. You might want to use this to only have one
-+# chatscript that is used for all numbers, or you might need multiple
-+# chatscripts.
--###################################################################
--#
--# Function to initialize the modem and ensure that it is in command
--# state. This may not be needed, but it doesn't hurt.
--#
--function initialize
--{
--    chat -v TIMEOUT 3 '' AT 'OK-+++\c-OK'
--    return
--}
-+PHONE1=123456789
-+CHAT1=/etc/chatscripts/provider
--###################################################################
--#
--# Script to dial a telephone
--#
--function callnumber
--{
--chat -v                                                       \
--      ABORT           '\nBUSY\r'                      \
--      ABORT           '\nNO ANSWER\r'                 \
--      ABORT           '\nRINGING\r\n\r\nRINGING\r'    \
--      ''              ATDT$1                          \
--      CONNECT         ''                              \
--      ogin:--ogin:    $ACCOUNT                        \
--      assword:        $PASSWORD
--#
--# If the connection was successful then end the whole script with a
--# success.
--#
--    if [ "$?" = "0" ]; then
--       exit 0
--    fi
-+PHONE2=912345678
-+CHAT2=/etc/chatscripts/provider
--    return
--}
-+PHONE3=891234567
-+CHAT3=/etc/chatscripts/provider
--###################################################################
--#
--# Script to dial any telephone number
--#
--function callall
--{
--#   echo "dialing attempt number: $1" >/dev/console
--    callnumber $PHONE1
--#    callnumber $PHONE2
--}
-+PHONE4=789123456
-+CHAT4=/etc/chatscripts/provider
--###################################################################
--#
--# Initialize the modem to ensure that it is in the command state
--#
--initialize
--if [ ! "$?" = "0" ]; then
--   exit 1
--fi
-+PHONE5=001234567
-+CHAT5=/etc/chatscripts/provider
-+# How long to sleep between retries:
- #
--# Dial telephone numbers until one answers
--#
-+# Note that this is a parameter to sleep so use "15s" for 15 seconds,
-+# "1m" for 1 minute, etc
-+SLEEP_DELAY=1s
-+
-+# The code below does the dialing.
-+
- attempt=0
- while : ; do
--    attempt=`expr $attempt + 1`
--    callall $attempt
--    if [ "$attempt" = "$MAX_ATTEMPTS" ]; then
--      exit 1
--    fi        
--    sleep "$SLEEP_DELAY"
-+        attempt=`expr $attempt + 1`
-+        NUMBER=`eval echo '$PHONE'$attempt`
-+        CHAT=`eval echo '$CHAT'$attempt`
-+        if [ ! "$CHAT" ]; then
-+                attempt=0
-+        else
-+                logger "Dialing attempt number: $attempt"
-+                sed s/#NUMBER#/$NUMBER/ $CHAT >/etc/chatscripts/tmpchat
-+                /usr/sbin/chat -v -f /etc/chatscripts/tmpchat
-+                rm -f /etc/chatscripts/tmpchat
-+                case $? in
-+                        0) logger Connection established ; exit 0;;
-+                        1) logger chat: exit 1, see manpage for details. ; exit 1;;
-+                        2) logger chat: exit 2, see manpage for details. ; exit 2;;
-+                        3) logger chat: exit 3, see manpage for details. ;;
-+                        4) logger Line busy. ;;
-+                        5) logger No Carrier. ;;
-+                        6) logger A call is coming. Exiting! ; exit 1;;
-+                        7) logger No dialtone. ;;
-+                        8) logger An error occured. Exiting! ; exit 1;;
-+                        *) logger chat: exit $?, see manpage for details. ;;
-+                esac
-+                logger "Waiting $SLEEP_DELAY seconds before next try."
-+                sleep $SLEEP_DELAY
-+        fi
- done
diff --git a/obsolete-buildroot/sources/openwrt/patches/ppp/018_ip-up_option.diff b/obsolete-buildroot/sources/openwrt/patches/ppp/018_ip-up_option.diff
deleted file mode 100644 (file)
index 0dee924..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
---- ppp-2.4.1/pppd/ipcp.c      Thu Mar  8 06:11:12 2001
-+++ ppp-2.4.1-new/pppd/ipcp.c  Tue Jun 19 15:35:36 2001
-@@ -1734,7 +1734,7 @@
-      */
-     if (ipcp_script_state == s_down && ipcp_script_pid == 0) {
-       ipcp_script_state = s_up;
--      ipcp_script(_PATH_IPUP);
-+      ipcp_script(path_ipup);
-     }
- }
-@@ -1777,7 +1777,7 @@
-     /* Execute the ip-down script */
-     if (ipcp_script_state == s_up && ipcp_script_pid == 0) {
-       ipcp_script_state = s_down;
--      ipcp_script(_PATH_IPDOWN);
-+      ipcp_script(path_ipdown);
-     }
- }
-@@ -1828,13 +1828,13 @@
-     case s_up:
-       if (ipcp_fsm[0].state != OPENED) {
-           ipcp_script_state = s_down;
--          ipcp_script(_PATH_IPDOWN);
-+          ipcp_script(path_ipdown);
-       }
-       break;
-     case s_down:
-       if (ipcp_fsm[0].state == OPENED) {
-           ipcp_script_state = s_up;
--          ipcp_script(_PATH_IPUP);
-+          ipcp_script(path_ipup);
-       }
-       break;
-     }
-
---- ppp-2.4.1/pppd/main.c      Tue Mar 13 06:56:19 2001
-+++ ppp-2.4.1-new/pppd/main.c  Tue Jun 19 15:35:36 2001
-@@ -233,6 +233,9 @@
-     struct protent *protp;
-     char numbuf[16];
-+    strlcpy(path_ipup, "/etc/ppp/ip-up", sizeof(path_ipup));
-+    strlcpy(path_ipdown, "/etc/ppp/ip-down", sizeof(path_ipdown));
-+
-     link_stats_valid = 0;
-     new_phase(PHASE_INITIALIZE);
-
---- ppp-2.4.1/pppd/options.c   Tue Mar 13 06:56:19 2001
-+++ ppp-2.4.1-new/pppd/options.c       Tue Jun 19 15:38:32 2001
-@@ -85,6 +85,8 @@
- bool  dump_options;           /* print out option values */
- bool  dryrun;                 /* print out option values and exit */
- char  *domain;                /* domain name set by domain option */
-+char  path_ipup[MAXPATHLEN];  /* pathname of ip-up script */
-+char  path_ipdown[MAXPATHLEN];/* pathname of ip-down script */
- extern option_t auth_options[];
- extern struct stat devstat;
-@@ -231,6 +233,12 @@
-       "Print out option values after parsing all options", 1 },
-     { "dryrun", o_bool, &dryrun,
-       "Stop after parsing, printing, and checking options", 1 },
-+    { "ip-up-script", o_string, path_ipup,
-+      "Set pathname of ip-up script",
-+      OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
-+    { "ip-down-script", o_string, path_ipdown,
-+      "Set pathname of ip-down script",
-+      OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
- #ifdef HAVE_MULTILINK
-     { "multilink", o_bool, &multilink,
-
---- ppp-2.4.1/pppd/pathnames.h Thu Mar  8 06:15:37 2001
-+++ ppp-2.4.1-new/pppd/pathnames.h     Tue Jun 19 15:35:36 2001
-@@ -21,8 +21,6 @@
- #define _PATH_UPAPFILE         _ROOT_PATH "/etc/ppp/pap-secrets"
- #define _PATH_CHAPFILE         _ROOT_PATH "/etc/ppp/chap-secrets"
- #define _PATH_SYSOPTIONS _ROOT_PATH "/etc/ppp/options"
--#define _PATH_IPUP     _ROOT_PATH "/etc/ppp/ip-up"
--#define _PATH_IPDOWN   _ROOT_PATH "/etc/ppp/ip-down"
- #define _PATH_AUTHUP   _ROOT_PATH "/etc/ppp/auth-up"
- #define _PATH_AUTHDOWN         _ROOT_PATH "/etc/ppp/auth-down"
- #define _PATH_TTYOPT   _ROOT_PATH "/etc/ppp/options."
-
---- ppp-2.4.1/pppd/pppd.h      Tue Mar 13 06:54:37 2001
-+++ ppp-2.4.1-new/pppd/pppd.h  Tue Jun 19 15:39:39 2001
-@@ -272,6 +272,8 @@
- extern char   *bundle_name;   /* bundle name for multilink */
- extern bool   dump_options;   /* print out option values */
- extern bool   dryrun;         /* check everything, print options, exit */
-+extern char   path_ipup[MAXPATHLEN];  /* pathname of ip-up script */
-+extern char   path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */
- #ifdef PPP_FILTER
- extern struct bpf_program pass_filter;   /* Filter for pkts to pass */
diff --git a/obsolete-buildroot/sources/openwrt/patches/ppp/057_pppoe-interface-change b/obsolete-buildroot/sources/openwrt/patches/ppp/057_pppoe-interface-change
deleted file mode 100644 (file)
index cca5a0e..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
---- ppp/pppd/plugins/rp-pppoe/plugin.c.orig    2003-04-07 02:09:05.000000000 +0200
-+++ ppp/pppd/plugins/rp-pppoe/plugin.c 2003-12-03 22:15:07.000000000 +0100
-@@ -114,6 +114,57 @@
-     return 1;
- }
-+/* from <linux/if.h> */
-+#define IFF_UP          0x1
-+#define IFF_RUNNING     0x40
-+
-+static short ifrflags_old;
-+
-+static int interface_change(const char* ifname, int up)
-+{
-+    int fd;
-+    struct ifreq ifr;
-+
-+    if (!up && ifrflags_old != 0) {
-+        return 0;
-+    }
-+
-+    fd = socket(AF_INET, SOCK_DGRAM, 0);
-+    if (fd < 0) {
-+      warn("socket(AF_INET, SOCK_DGRAM, 0): %s", strerror(errno));
-+      return -1;
-+    }
-+
-+    strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
-+    if (ioctl(fd, SIOCGIFFLAGS, &ifr) < 0) {
-+      warn("%s: unknown interface: %s", ifname, strerror(errno));
-+      return -1;
-+    }
-+    strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
-+    if (up) {
-+        ifrflags_old = ifr.ifr_flags & (IFF_UP | IFF_RUNNING);
-+      ifr.ifr_flags |= (IFF_UP | IFF_RUNNING);
-+    } else {
-+        ifr.ifr_flags &= ~(IFF_UP | IFF_RUNNING);
-+    }
-+    if (ioctl(fd, SIOCSIFFLAGS, &ifr) < 0) {
-+      warn("SIOCSIFFLAGS: %s", strerror(errno));
-+      return -1;
-+    }
-+    close(fd);
-+    return 0;
-+}
-+
-+static int interface_up (const char *ifname)
-+{
-+    return interface_change(ifname,1);
-+}
-+
-+static int interface_down (const char* ifname)
-+{
-+    return interface_change(ifname,0);
-+}
-+
- /**********************************************************************
-  * %FUNCTION: PPPOEConnectDevice
-  * %ARGUMENTS:
-@@ -142,6 +193,8 @@
-           conn->peerEth[i] = (unsigned char) mac[i];
-       }
-     } else {
-+      if (interface_up(conn->ifName) < 0)
-+          return -1;
-       discovery(conn);
-       if (conn->discoveryState != STATE_SESSION) {
-           fatal("Unable to complete PPPoE Discovery");
-@@ -243,6 +296,8 @@
-       return;
-     }
-     close(conn->sessionSocket);
-+    if (interface_down(conn->ifName) < 0)
-+      warn("We brought %s up but failed to take it down",conn->ifName);
- }
- static void
diff --git a/obsolete-buildroot/sources/openwrt/patches/ppp/auth_hook_segfault b/obsolete-buildroot/sources/openwrt/patches/ppp/auth_hook_segfault
deleted file mode 100644 (file)
index 59007ef..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-To: md@linux.it, mjt@corpit.ru
-Subject: pppd-auth-hook.patch
-Message-Id: <20040604231517.3E9AD11DC4@paltus.tls.msk.ru>
-Date: Sat,  5 Jun 2004 03:15:17 +0400 (MSD)
-From: mjt@corpit.ru (Michael Tokarev)
-
-The patch below fixes pppd segfault when using auth_hook that sets
-options for the user (use-after-free problem).
-
-/mjt
-
---- ppp/pppd/auth.c.orig       Mon Jun 23 18:12:04 2003
-+++ ppp/pppd/auth.c    Sat Jun  5 03:11:36 2004
-@@ -1251,14 +1251,14 @@
-     if (pap_auth_hook) {
-       ret = (*pap_auth_hook)(user, passwd, msg, &addrs, &opts);
-       if (ret >= 0) {
-+          /* note: set_allowed_addrs() saves opts (but not addrs): don't free it! */
-           if (ret)
-               set_allowed_addrs(unit, addrs, opts);
--          BZERO(passwd, sizeof(passwd));
-+          else if (opts != 0)
-+              free_wordlist(opts);
-           if (addrs != 0)
-               free_wordlist(addrs);
--          if (opts != 0) {
--              free_wordlist(opts);
--          }
-+          BZERO(passwd, sizeof(passwd));
-           return ret? UPAP_AUTHACK: UPAP_AUTHNAK;
-       }
-     }
-
diff --git a/obsolete-buildroot/sources/openwrt/patches/ppp/cifdefroute.dif b/obsolete-buildroot/sources/openwrt/patches/ppp/cifdefroute.dif
deleted file mode 100644 (file)
index 263b674..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
---- ppp/pppd/ipcp.c    Wed May 31 17:20:41 2000
-+++ ppp/pppd/ipcp.c    Wed May 31 17:27:19 2000
-@@ -145,7 +145,17 @@
-     { "-defaultroute", o_bool, &ipcp_allowoptions[0].default_route,
-       "disable defaultroute option", OPT_A2COPY,
-       &ipcp_wantoptions[0].default_route },
-
-+#ifdef __linux__
-+    { "replacedefaultroute", o_bool,
-+                              &ipcp_wantoptions[0].replace_default_route,
-+      "Replace default route", 1
-+    },
-+    { "noreplacedefaultroute", o_bool,
-+                              &ipcp_allowoptions[0].replace_default_route,
-+      "Never replace default route", OPT_A2COPY,
-+                              &ipcp_wantoptions[0].replace_default_route },
-+#endif
-     { "proxyarp", o_bool, &ipcp_wantoptions[0].proxy_arp,
-       "Add proxy ARP entry", OPT_ENABLE|1, &ipcp_allowoptions[0].proxy_arp },
-     { "noproxyarp", o_bool, &ipcp_allowoptions[0].proxy_arp,
-@@ -195,7 +205,7 @@
-     ip_active_pkt
- };
--static void ipcp_clear_addrs __P((int, u_int32_t, u_int32_t));
-+static void ipcp_clear_addrs __P((int, u_int32_t, u_int32_t, bool));
- static void ipcp_script __P((char *));                /* Run an up/down script */
- static void ipcp_script_done __P((void *));
-@@ -1344,7 +1354,12 @@
-     if (!sifnpmode(u, PPP_IP, NPMODE_QUEUE))
-       return 0;
-     if (wo->default_route)
-+#ifndef __linux__
-       if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr))
-+#else
-+      if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr,
-+                                          wo->replace_default_route))
-+#endif
-           default_route_set[u] = 1;
-     if (wo->proxy_arp)
-       if (sifproxyarp(u, wo->hisaddr))
-@@ -1420,7 +1435,8 @@
-      */
-     if (demand) {
-       if (go->ouraddr != wo->ouraddr || ho->hisaddr != wo->hisaddr) {
--          ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr);
-+          ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr,
-+                                    wo->replace_default_route);
-           if (go->ouraddr != wo->ouraddr) {
-               warn("Local IP address changed to %I", go->ouraddr);
-               script_setenv("OLDIPLOCAL", ip_ntoa(wo->ouraddr));
-@@ -1445,7 +1461,12 @@
-           /* assign a default route through the interface if required */
-           if (ipcp_wantoptions[f->unit].default_route) 
-+#ifndef __linux__
-               if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr))
-+#else
-+              if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr,
-+                                           wo->replace_default_route))
-+#endif
-                   default_route_set[f->unit] = 1;
-           /* Make a proxy ARP entry if requested. */
-@@ -1492,7 +1513,12 @@
-       /* assign a default route through the interface if required */
-       if (ipcp_wantoptions[f->unit].default_route) 
-+#ifndef __linux__
-           if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr))
-+#else
-+          if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr,
-+                                       wo->replace_default_route))
-+#endif
-               default_route_set[f->unit] = 1;
-       /* Make a proxy ARP entry if requested. */
-@@ -1559,7 +1585,7 @@
-       sifnpmode(f->unit, PPP_IP, NPMODE_DROP);
-       sifdown(f->unit);
-       ipcp_clear_addrs(f->unit, ipcp_gotoptions[f->unit].ouraddr,
--                       ipcp_hisoptions[f->unit].hisaddr);
-+                       ipcp_hisoptions[f->unit].hisaddr, 0);
-     }
-     /* Execute the ip-down script */
-@@ -1575,16 +1601,25 @@
-  * proxy arp entries, etc.
-  */
- static void
--ipcp_clear_addrs(unit, ouraddr, hisaddr)
-+ipcp_clear_addrs(unit, ouraddr, hisaddr, replacedefaultroute)
-     int unit;
-     u_int32_t ouraddr;  /* local address */
-     u_int32_t hisaddr;  /* remote address */
-+    bool replacedefaultroute;
- {
-     if (proxy_arp_set[unit]) {
-       cifproxyarp(unit, hisaddr);
-       proxy_arp_set[unit] = 0;
-     }
--    if (default_route_set[unit]) {
-+    /* If replacedefaultroute, sifdefaultroute will be called soon
-+     * with replacedefaultroute set and that will overwrite the current
-+     * default route. This is the case only when doing demand, otherwise
-+     * during demand, this cifdefaultroute would restore the old default
-+     * route which is not what we want in this case. In the non-demand
-+     * case, we'll delete the default route and restore the old if there
-+     * is one saved by an sifdefaultroute with replacedefaultroute.
-+     */
-+    if (!replacedefaultroute && default_route_set[unit]) {
-       cifdefaultroute(unit, ouraddr, hisaddr);
-       default_route_set[unit] = 0;
-     }
---- ppp/pppd/ipcp.h    Wed May 31 17:20:41 2000
-+++ ppp/pppd/ipcp.h    Wed May 31 15:56:17 2000
-@@ -47,6 +47,7 @@
-     bool old_addrs;           /* Use old (IP-Addresses) option? */
-     bool req_addr;            /* Ask peer to send IP address? */
-     bool default_route;               /* Assign default route through interface? */
-+    bool replace_default_route;       /* Replace default route through interface? */
-     bool proxy_arp;           /* Make proxy ARP entry for peer? */
-     bool neg_vj;              /* Van Jacobson Compression? */
-     bool old_vj;              /* use old (short) form of VJ option? */
---- ppp/pppd/pppd.8    Wed May 31 17:20:41 2000
-+++ ppp/pppd/pppd.8    Wed May 31 15:56:17 2000
-@@ -99,6 +99,13 @@
- This entry is removed when the PPP connection is broken.  This option
- is privileged if the \fInodefaultroute\fR option has been specified.
- .TP
-+.B replacedefaultroute
-+This option is a flag to the defaultroute option. If defaultroute is
-+set and this flag is also set, pppd replaces an existing default route
-+with the new default route.
-+
-+
-+.TP
- .B disconnect \fIscript
- Run the executable or shell command specified by \fIscript\fR after
- pppd has terminated the link.  This script could, for example, issue
-@@ -589,7 +596,12 @@
- .TP
- .B nodefaultroute
- Disable the \fIdefaultroute\fR option.  The system administrator who
--wishes to prevent users from creating default routes with pppd
-+wishes to prevent users from adding a default route with pppd
-+can do so by placing this option in the /etc/ppp/options file.
-+.TP
-+.B noreplacedefaultroute
-+Disable the \fIreplacedefaultroute\fR option. The system administrator who
-+wishes to prevent users from replacing a default route with pppd
- can do so by placing this option in the /etc/ppp/options file.
- .TP
- .B nodeflate
---- ppp/pppd/pppd.h    Wed May 31 17:20:41 2000
-+++ ppp/pppd/pppd.h    Wed May 31 15:56:17 2000
-@@ -416,7 +416,11 @@
- int  cif6addr __P((int, eui64_t, eui64_t));
-                               /* Remove an IPv6 address from i/f */
- #endif
-+#ifndef __linux__
- int  sifdefaultroute __P((int, u_int32_t, u_int32_t));
-+#else
-+int  sifdefaultroute __P((int, u_int32_t, u_int32_t, bool replace_default_rt));
-+#endif
-                               /* Create default route through i/f */
- int  cifdefaultroute __P((int, u_int32_t, u_int32_t));
-                               /* Delete default route through i/f */
---- ppp/pppd/sys-linux.c       Wed May 31 17:20:41 2000
-+++ ppp/pppd/sys-linux.c       Wed May 31 17:37:23 2000
-@@ -143,6 +143,8 @@
- static int    if_is_up;       /* Interface has been marked up */
- static u_int32_t default_route_gateway;       /* Gateway for default route added */
-+static struct rtentry old_def_rt;       /* Old default route */
-+static int       default_rt_repl_rest;  /* replace and restore old default rt */
- static u_int32_t proxy_arp_addr;      /* Addr for proxy arp entry added */
- static char proxy_arp_dev[16];                /* Device for proxy arp entry */
- static u_int32_t our_old_addr;                /* for detecting address changes */
-@@ -1209,6 +1211,9 @@
-       p = NULL;
-     }
-+    SET_SA_FAMILY (rt->rt_dst,     AF_INET);
-+    SET_SA_FAMILY (rt->rt_gateway, AF_INET);
-+
-     SIN_ADDR(rt->rt_dst) = strtoul(cols[route_dest_col], NULL, 16);
-     SIN_ADDR(rt->rt_gateway) = strtoul(cols[route_gw_col], NULL, 16);
-     SIN_ADDR(rt->rt_genmask) = strtoul(cols[route_mask_col], NULL, 16);
-@@ -1278,19 +1283,53 @@
- /********************************************************************
-  *
-  * sifdefaultroute - assign a default route through the address given.
-+ *
-+ * If the global default_rt_repl_rest flag is set, then this function
-+ * already replaced the original system defaultroute with some other
-+ * route and it should just replace the current defaultroute with
-+ * another one, without saving the current route. Use: demand mode,
-+ * when pppd sets first a defaultroute it it's temporary ppp0 addresses
-+ * and then changes the temporary addresses to the addresses for the real
-+ * ppp connection when it has come up.
-  */
--int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway)
-+int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway, bool replace)
- {
--    struct rtentry rt;
--
--    if (defaultroute_exists(&rt) && strcmp(rt.rt_dev, ifname) != 0) {
--      u_int32_t old_gateway = SIN_ADDR(rt.rt_gateway);
-+    struct rtentry rt, tmp_rt;
-+    struct rtentry *del_rt = NULL;
--      if (old_gateway != gateway)
--          error("not replacing existing default route to %s [%I]",
--                rt.rt_dev, old_gateway);
--      return 0;
-+    
-+    if (default_rt_repl_rest) {
-+      /* We have already reclaced the original defaultroute, if we
-+         * are called again, we will delete the current default route
-+         * and set the new default route in this function.  
-+         * - this is normally only the case the doing demand: */
-+      if (defaultroute_exists( &tmp_rt ))
-+              del_rt = &tmp_rt;
-+    } else if ( defaultroute_exists( &old_def_rt                ) &&
-+                           strcmp(  old_def_rt.rt_dev, ifname ) != 0) {
-+      /* We did not yet replace an existing default route, let's
-+       * check if we should save and replace a default route:
-+         */
-+      u_int32_t old_gateway = SIN_ADDR(old_def_rt.rt_gateway);
-+
-+      if (old_gateway != gateway) {
-+          if (!replace) {
-+              error("not replacing default route to %s [%I]",
-+                      old_def_rt.rt_dev, old_gateway);
-+              return 0;
-+          } else {
-+              // we need to copy rt_dev because we need it permanent too:
-+              char * tmp_dev = malloc(strlen(old_def_rt.rt_dev)+1);
-+              strcpy(tmp_dev, old_def_rt.rt_dev);
-+              old_def_rt.rt_dev = tmp_dev;
-+
-+              notice("replacing old default route to %s [%I]",
-+                      old_def_rt.rt_dev, old_gateway);
-+              default_rt_repl_rest = 1;
-+              del_rt = &old_def_rt;
-+          }
-+      }
-     }
-     memset (&rt, '\0', sizeof (rt));
-@@ -1310,6 +1349,12 @@
-           error("default route ioctl(SIOCADDRT): %m(%d)", errno);
-       return 0;
-     }
-+    if (default_rt_repl_rest && del_rt)
-+        if (ioctl(sock_fd, SIOCDELRT, del_rt) < 0) {
-+          if ( ! ok_error ( errno ))
-+              error("del old default route ioctl(SIOCDELRT): %m(%d)", errno);
-+          return 0;
-+        }
-     default_route_gateway = gateway;
-     return 1;
-@@ -1344,6 +1389,16 @@
-               error("default route ioctl(SIOCDELRT): %m (%d)", errno);
-           return 0;
-       }
-+    }
-+    if (default_rt_repl_rest) {
-+      notice("restoring old default route to %s [%I]",
-+                      old_def_rt.rt_dev, SIN_ADDR(old_def_rt.rt_gateway));
-+        if (ioctl(sock_fd, SIOCADDRT, &old_def_rt) < 0) {
-+          if ( ! ok_error ( errno ))
-+              error("restore default route ioctl(SIOCADDRT): %m(%d)", errno);
-+          return 0;
-+        }
-+        default_rt_repl_rest = 0;
-     }
-     return 1;
diff --git a/obsolete-buildroot/sources/openwrt/patches/ppp/close_devfd b/obsolete-buildroot/sources/openwrt/patches/ppp/close_devfd
deleted file mode 100644 (file)
index 987d964..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-Ensure that the fd returned by the connect method is closed before
-running external programs.
-
-http://article.gmane.org/gmane.linux.ppp/1371
-
-diff -ruNp ppp.orig/pppd/main.c ppp/pppd/main.c
---- ppp.orig/pppd/main.c       2004-07-12 12:55:30.000000000 +0200
-+++ ppp/pppd/main.c    2004-07-12 12:55:25.000000000 +0200
-@@ -1662,6 +1662,8 @@ run_program(prog, args, must_exist, done
-     closelog();
-     if (the_channel->close)
-       (*the_channel->close)();
-+    else
-+      close(devfd);
-     /* Don't pass handles to the PPP device, even by accident. */
-     dup2(fd_devnull, 0);
diff --git a/obsolete-buildroot/sources/openwrt/patches/ppp/fix_closed_fds b/obsolete-buildroot/sources/openwrt/patches/ppp/fix_closed_fds
deleted file mode 100644 (file)
index 39208ab..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-sys_init() will open a socket and keep it open for the whole like of the
-process. If pppd is started without all standard fds open then the socket
-will get one of their numbers, which will be clobbered later by the
-/dev/null fd duplicated by main().
-
-See Debian bug #235192.
-
-diff -ruN ppp.orig/pppd/main.c ppp/pppd/main.c
---- ppp.orig/pppd/main.c       2004-02-29 18:50:12.000000000 +0100
-+++ ppp/pppd/main.c    2004-02-29 18:48:56.000000000 +0100
-@@ -385,11 +385,6 @@
-     if (dryrun)
-       die(0);
--    /*
--     * Initialize system-dependent stuff.
--     */
--    sys_init();
--
-     /* Make sure fds 0, 1, 2 are open to somewhere. */
-     fd_devnull = open(_PATH_DEVNULL, O_RDWR);
-     if (fd_devnull < 0)
-@@ -401,6 +396,11 @@
-       fd_devnull = i;
-     }
-+    /*
-+     * Initialize system-dependent stuff.
-+     */
-+    sys_init();
-+
- #ifdef USE_TDB
-     pppdb = tdb_open(_PATH_PPPDB, 0, 0, O_RDWR|O_CREAT, 0644);
-     if (pppdb != NULL) {
diff --git a/obsolete-buildroot/sources/openwrt/patches/ppp/no_crypt_hack b/obsolete-buildroot/sources/openwrt/patches/ppp/no_crypt_hack
deleted file mode 100644 (file)
index 501409e..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-diff -ruN ppp.orig/pppd/auth.c ppp/pppd/auth.c
---- ppp.orig/pppd/auth.c       2003-06-12 02:01:21.000000000 +0200
-+++ ppp/pppd/auth.c    2003-12-02 14:48:40.000000000 +0100
-@@ -1292,8 +1292,10 @@
-           }
-           if (secret[0] != 0 && !login_secret) {
-               /* password given in pap-secrets - must match */
-+#ifndef NO_CRYPT_HACK
-               if ((cryptpap || strcmp(passwd, secret) != 0)
-                   && strcmp(crypt(passwd, secret), secret) != 0)
-+#endif
-                   ret = UPAP_AUTHNAK;
-           }
-       }
-@@ -1495,8 +1497,10 @@
-     /*
-      * If no passwd, don't let them login.
-      */
-+#ifndef NO_CRYPT_HACK
-     if (pw->pw_passwd == NULL || strlen(pw->pw_passwd) < 2
-       || strcmp(crypt(passwd, pw->pw_passwd), pw->pw_passwd) != 0)
-+#endif
-       return (UPAP_AUTHNAK);
- #endif /* #ifdef USE_PAM */
-diff -ruN ppp.orig/pppd/Makefile.linux ppp/pppd/Makefile.linux
---- ppp.orig/pppd/Makefile.linux       2003-11-27 23:00:22.000000000 +0100
-+++ ppp/pppd/Makefile.linux    2003-12-02 14:47:53.000000000 +0100
-@@ -116,12 +116,16 @@
- #LIBS     += -lshadow $(LIBS)
- endif
-+ifdef NO_CRYPT_HACK
-+CFLAGS += -DNO_CRYPT_HACK
-+else
- ifneq ($(wildcard /usr/include/crypt.h),)
- CFLAGS   += -DHAVE_CRYPT_H=1
- endif
- ifneq ($(wildcard /usr/lib/libcrypt.*),)
- LIBS  += -lcrypt
- endif
-+endif
- ifdef NEEDDES
- ifndef USE_CRYPT
diff --git a/obsolete-buildroot/sources/openwrt/patches/ppp/ppp-2.3.11-oedod.dif b/obsolete-buildroot/sources/openwrt/patches/ppp/ppp-2.3.11-oedod.dif
deleted file mode 100644 (file)
index e024696..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
---- ppp/pppd/demand.c
-+++ ppp/pppd/demand.c  2000/06/28 14:54:04
-@@ -25,6 +25,8 @@
- #include <errno.h>
- #include <fcntl.h>
- #include <netdb.h>
-+#include <unistd.h>
-+#include <syslog.h>
- #include <sys/param.h>
- #include <sys/types.h>
- #include <sys/wait.h>
-@@ -32,6 +34,8 @@
- #include <sys/resource.h>
- #include <sys/stat.h>
- #include <sys/socket.h>
-+#include <netinet/in.h>
-+#include <arpa/inet.h>
- #ifdef PPP_FILTER
- #include <net/if.h>
- #include <net/bpf.h>
-@@ -210,6 +214,14 @@
-     int c, rv;
-     rv = 0;
-+
-+/* check for synchronous connection... */
-+
-+    if ( (p[0] == 0xFF) && (p[1] == 0x03) ) {
-+        rv = loop_frame(p,n);
-+        return rv;
-+    }
-+
-     for (; n > 0; --n) {
-       c = *p++;
-       if (c == PPP_FLAG) {
-@@ -288,17 +300,102 @@
-  * loopback, now that the real serial link is up.
-  */
- void
--demand_rexmit(proto)
-+demand_rexmit(proto, newip)
-     int proto;
-+    u_int32_t newip;
- {
-     struct packet *pkt, *prev, *nextpkt;
-+    unsigned short checksum;
-+    unsigned short pkt_checksum = 0;
-+    unsigned iphdr;
-+    struct timeval tv;
-+    char cv = 0;
-+    char ipstr[16];
-     prev = NULL;
-     pkt = pend_q;
-     pend_q = NULL;
-+    tv.tv_sec = 1;
-+    tv.tv_usec = 0;
-+    select(0,NULL,NULL,NULL,&tv);     /* Sleep for 1 Seconds */
-     for (; pkt != NULL; pkt = nextpkt) {
-       nextpkt = pkt->next;
-       if (PPP_PROTOCOL(pkt->data) == proto) {
-+            if ( (proto == PPP_IP) && newip ) {
-+              /* Get old checksum */
-+
-+              iphdr = (pkt->data[4] & 15) << 2;
-+              checksum = *((unsigned short *) (pkt->data+14));
-+                if (checksum == 0xFFFF) {
-+                    checksum = 0;
-+                }
-+
-+ 
-+                if (pkt->data[13] == 17) {
-+                    pkt_checksum =  *((unsigned short *) (pkt->data+10+iphdr));
-+                  if (pkt_checksum) {
-+                        cv = 1;
-+                        if (pkt_checksum == 0xFFFF) {
-+                            pkt_checksum = 0;
-+                        }
-+                    }
-+                    else {
-+                       cv = 0;
-+                    }
-+                }
-+
-+              if (pkt->data[13] == 6) {
-+                  pkt_checksum = *((unsigned short *) (pkt->data+20+iphdr));
-+                  cv = 1;
-+                    if (pkt_checksum == 0xFFFF) {
-+                        pkt_checksum = 0;
-+                    }
-+              }
-+
-+              /* Delete old Source-IP-Address */
-+                checksum -= *((unsigned short *) (pkt->data+16)) ^ 0xFFFF;
-+                checksum -= *((unsigned short *) (pkt->data+18)) ^ 0xFFFF;
-+
-+              pkt_checksum -= *((unsigned short *) (pkt->data+16)) ^ 0xFFFF;
-+              pkt_checksum -= *((unsigned short *) (pkt->data+18)) ^ 0xFFFF;
-+
-+              /* Change Source-IP-Address */
-+                * ((u_int32_t *) (pkt->data + 16)) = newip;
-+
-+              /* Add new Source-IP-Address */
-+                checksum += *((unsigned short *) (pkt->data+16)) ^ 0xFFFF;
-+                checksum += *((unsigned short *) (pkt->data+18)) ^ 0xFFFF;
-+
-+                pkt_checksum += *((unsigned short *) (pkt->data+16)) ^ 0xFFFF;
-+                pkt_checksum += *((unsigned short *) (pkt->data+18)) ^ 0xFFFF;
-+
-+              /* Write new checksum */
-+                if (!checksum) {
-+                    checksum = 0xFFFF;
-+                }
-+                *((unsigned short *) (pkt->data+14)) = checksum;
-+              if (pkt->data[13] == 6) {
-+                  *((unsigned short *) (pkt->data+20+iphdr)) = pkt_checksum;
-+              }
-+              if (cv && (pkt->data[13] == 17) ) {
-+                  *((unsigned short *) (pkt->data+10+iphdr)) = pkt_checksum;
-+              }
-+
-+              /* Log Packet */
-+              strcpy(ipstr,inet_ntoa(*( (struct in_addr *) (pkt->data+16))));
-+              if (pkt->data[13] == 1) {
-+                  syslog(LOG_INFO,"Open ICMP %s -> %s\n",
-+                      ipstr,
-+                      inet_ntoa(*( (struct in_addr *) (pkt->data+20))));
-+              } else {
-+                  syslog(LOG_INFO,"Open %s %s:%d -> %s:%d\n",
-+                      pkt->data[13] == 6 ? "TCP" : "UDP",
-+                      ipstr,
-+                      ntohs(*( (short *) (pkt->data+iphdr+4))),
-+                      inet_ntoa(*( (struct in_addr *) (pkt->data+20))),
-+                      ntohs(*( (short *) (pkt->data+iphdr+6))));
-+                }
-+            }
-           output(0, pkt->data, pkt->length);
-           free(pkt);
-       } else {
---- ppp/pppd/ipcp.c
-+++ ppp/pppd/ipcp.c    2000/06/28 12:32:05
-@@ -1454,7 +1454,7 @@
-                   proxy_arp_set[f->unit] = 1;
-       }
--      demand_rexmit(PPP_IP);
-+      demand_rexmit(PPP_IP,go->ouraddr);
-       sifnpmode(f->unit, PPP_IP, NPMODE_PASS);
-     } else {
---- ppp/pppd/ipv6cp.c
-+++ ppp/pppd/ipv6cp.c  2000/06/28 12:32:06
-@@ -1153,7 +1153,7 @@
-           }
-       }
--      demand_rexmit(PPP_IPV6);
-+      demand_rexmit(PPP_IPV6,0);
-       sifnpmode(f->unit, PPP_IPV6, NPMODE_PASS);
-     } else {
---- ppp/pppd/pppd.h
-+++ ppp/pppd/pppd.h    2000/06/28 12:32:06
-@@ -359,7 +359,7 @@
- void demand_block __P((void));        /* set all NPs to queue up packets */
- void demand_unblock __P((void)); /* set all NPs to pass packets */
- void demand_discard __P((void)); /* set all NPs to discard packets */
--void demand_rexmit __P((int));        /* retransmit saved frames for an NP */
-+void demand_rexmit __P((int, u_int32_t)); /* retransmit saved frames for an NP*/
- int  loop_chars __P((unsigned char *, int)); /* process chars from loopback */
- int  loop_frame __P((unsigned char *, int)); /* should we bring link up? */
diff --git a/obsolete-buildroot/sources/openwrt/patches/ppp/ppp-2.4.2-stripMSdomain b/obsolete-buildroot/sources/openwrt/patches/ppp/ppp-2.4.2-stripMSdomain
deleted file mode 100644 (file)
index d52e386..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-diff -ruN ppp.orig/pppd/chap-new.c ppp/pppd/chap-new.c
---- ppp.orig/pppd/chap-new.c   2003-11-27 23:25:17.000000000 +0100
-+++ ppp/pppd/chap-new.c        2003-12-02 12:26:21.000000000 +0100
-@@ -57,6 +57,7 @@
- int chap_timeout_time = 3;
- int chap_max_transmits = 10;
- int chap_rechallenge_time = 0;
-+int chapms_strip_domain = 0;
- /*
-  * Command-line options.
-@@ -68,6 +69,8 @@
-         "Set max #xmits for challenge", OPT_PRIO },
-       { "chap-interval", o_int, &chap_rechallenge_time,
-         "Set interval for rechallenge", OPT_PRIO },
-+      { "chapms-strip-domain", o_bool, &chapms_strip_domain,
-+        "Strip the domain prefix before the Username", 1 },
-       { NULL }
- };
-@@ -338,6 +341,14 @@
-                       /* Null terminate and clean remote name. */
-                       slprintf(rname, sizeof(rname), "%.*v", len, name);
-                       name = rname;
-+
-+                      /* strip the MS domain name */
-+                      if (chapms_strip_domain && strrchr(rname, '\\')) {
-+                              char tmp[MAXNAMELEN+1];
-+
-+                              strcpy(tmp, strrchr(rname, '\\') + 1);
-+                              strcpy(rname, tmp);
-+                      }
-               }
-               if (chap_verify_hook)
diff --git a/obsolete-buildroot/sources/openwrt/patches/ppp/pppdump-no-deflate b/obsolete-buildroot/sources/openwrt/patches/ppp/pppdump-no-deflate
deleted file mode 100644 (file)
index b76b849..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ruN ppp-2.4.1.uus.orig/pppdump/ppp-comp.h ppp-2.4.1.uus/pppdump/ppp-comp.h
---- ppp-2.4.1.uus.orig/pppdump/ppp-comp.h      1999-03-23 04:21:01.000000000 +0100
-+++ ppp-2.4.1.uus/pppdump/ppp-comp.h   2003-08-09 23:54:49.000000000 +0200
-@@ -37,6 +37,8 @@
- #ifndef DO_BSD_COMPRESS
- #define DO_BSD_COMPRESS       1       /* by default, include BSD-Compress */
- #endif
-+#undef DO_DEFLATE
-+#define DO_DEFLATE 0
- #ifndef DO_DEFLATE
- #define DO_DEFLATE    1       /* by default, include Deflate */
- #endif
diff --git a/obsolete-buildroot/sources/openwrt/patches/ppp/setevn_call_file b/obsolete-buildroot/sources/openwrt/patches/ppp/setevn_call_file
deleted file mode 100644 (file)
index 256b703..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -ruN ppp.orig/pppd/options.c ppp/pppd/options.c
---- ppp.orig/pppd/options.c    2004-02-27 19:45:18.000000000 +0100
-+++ ppp/pppd/options.c 2004-02-27 19:44:48.000000000 +0100
-@@ -1448,6 +1448,7 @@
-     if ((fname = (char *) malloc(l)) == NULL)
-       novm("call file name");
-     slprintf(fname, l, "%s%s", _PATH_PEERFILES, arg);
-+    script_setenv("CALL_FILE", arg, 0);
-     ok = options_from_file(fname, 1, 1, 1);
-diff -ruN ppp.orig/pppd/pppd.8 ppp/pppd/pppd.8
---- ppp.orig/pppd/pppd.8       2004-02-27 19:45:18.000000000 +0100
-+++ ppp/pppd/pppd.8    2004-02-27 19:45:13.000000000 +0100
-@@ -1569,6 +1569,9 @@
- .B LINKNAME
- The logical name of the link, set with the \fIlinkname\fR option.
- .TP
-+.B CALL_FILE
-+The value of the \fIcall\fR option.
-+.TP
- .B DNS1
- If the peer supplies DNS server addresses, this variable is set to the
- first DNS server address supplied.
diff --git a/obsolete-buildroot/sources/openwrt/patches/ppp/syslog_local2 b/obsolete-buildroot/sources/openwrt/patches/ppp/syslog_local2
deleted file mode 100644 (file)
index 32a8cea..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ruN ppp.orig/pppd/pppd.h ppp/pppd/pppd.h
---- ppp.orig/pppd/pppd.h       2003-11-28 00:30:27.000000000 +0100
-+++ ppp/pppd/pppd.h    2003-11-28 00:30:20.000000000 +0100
-@@ -812,7 +812,7 @@
-   || defined(DEBUGCHAP) || defined(DEBUG) || defined(DEBUGIPV6CP)
- #define LOG_PPP LOG_LOCAL2
- #else
--#define LOG_PPP LOG_DAEMON
-+#define LOG_PPP LOG_LOCAL2
- #endif
- #endif /* LOG_PPP */
diff --git a/obsolete-buildroot/sources/openwrt/patches/ppp/z01_ppp-2.4.2-openwrt.patch b/obsolete-buildroot/sources/openwrt/patches/ppp/z01_ppp-2.4.2-openwrt.patch
deleted file mode 100644 (file)
index e77b004..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-diff -ruN ppp-2.4.2-old/chat/Makefile.linux ppp-2.4.2-new/chat/Makefile.linux
---- ppp-2.4.2-old/chat/Makefile.linux  2004-01-13 04:57:55.000000000 +0100
-+++ ppp-2.4.2-new/chat/Makefile.linux  2004-08-23 12:48:50.000000000 +0200
-@@ -6,8 +6,9 @@
- CDEF4=        -DFNDELAY=O_NDELAY              # Old name value
- CDEFS=        $(CDEF1) $(CDEF2) $(CDEF3) $(CDEF4)
--COPTS=        -O2 -g -pipe $(CDEFS)
--CFLAGS=       $(COPTS) $(CDEFS)
-+COPTS = -O2
-+COMPILE_FLAGS = $(CDEFS)
-+CFLAGS = $(COPTS) $(COMPILE_FLAGS)
- INSTALL= install
-diff -ruN ppp-2.4.2-old/pppd/Makefile.linux ppp-2.4.2-new/pppd/Makefile.linux
---- ppp-2.4.2-old/pppd/Makefile.linux  2003-11-27 22:55:19.000000000 +0100
-+++ ppp-2.4.2-new/pppd/Makefile.linux  2004-08-23 12:48:50.000000000 +0200
-@@ -47,19 +47,19 @@
- # Uncomment the next line to include support for PPP packet filtering.
- # This requires that the libpcap library and headers be installed
- # and that the kernel driver support PPP packet filtering.
--FILTER=y
-+#FILTER=y
- # Uncomment the next line to enable multilink PPP (enabled by default)
- # Linux distributions: Please leave multilink ENABLED in your builds
- # of pppd!
--HAVE_MULTILINK=y
-+#HAVE_MULTILINK=y
- # Uncomment the next line to enable the TDB database (enabled by default.)
- # If you enable multilink, then TDB is automatically enabled also.
- # Linux distributions: Please leave TDB ENABLED in your builds.
--USE_TDB=y
-+#USE_TDB=y
--HAS_SHADOW=y
-+#HAS_SHADOW=y
- #USE_PAM=y
- #HAVE_INET6=y
-@@ -76,7 +76,7 @@
- INCLUDE_DIRS= -I../include
--COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP
-+COMPILE_FLAGS= -DHAVE_PATHS_H
- CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS)
-@@ -192,7 +192,7 @@
-      CFLAGS += -DMAXOCTETS
- endif
--INSTALL= install -o root
-+INSTALL= install
- all: $(TARGETS)
-diff -ruN ppp-2.4.2-old/pppd/plugins/Makefile.linux ppp-2.4.2-new/pppd/plugins/Makefile.linux
---- ppp-2.4.2-old/pppd/plugins/Makefile.linux  2004-01-13 04:56:24.000000000 +0100
-+++ ppp-2.4.2-new/pppd/plugins/Makefile.linux  2004-08-23 12:48:50.000000000 +0200
-@@ -1,12 +1,16 @@
--CC    = gcc
--COPTS = -O2 -g
--CFLAGS        = $(COPTS) -I.. -I../../include -fPIC
--LDFLAGS       = -shared
--INSTALL       = install -o root
-+#CC = gcc
-+COPTS = -O2
-+COMPILE_FLAGS = -I.. -I../../include -fPIC
-+LIBS =
-+
-+INSTALL = install
-+
-+CFLAGS = $(COPTS) $(COMPILE_FLAGS)
-+LDFLAGS = -shared
- SUBDIRS := rp-pppoe
- # Uncomment the next line to include the radius authentication plugin
--# SUBDIRS += radius
-+SUBDIRS += radius
- PLUGINS := minconn.so passprompt.so passwordfd.so
- # include dependencies if present
-diff -ruN ppp-2.4.2-old/pppd/plugins/radius/Makefile.linux ppp-2.4.2-new/pppd/plugins/radius/Makefile.linux
---- ppp-2.4.2-old/pppd/plugins/radius/Makefile.linux   2002-11-09 12:24:42.000000000 +0100
-+++ ppp-2.4.2-new/pppd/plugins/radius/Makefile.linux   2004-08-23 12:57:38.000000000 +0200
-@@ -5,7 +5,12 @@
- MANDIR=/usr/man
- PLUGIN=radius.so radattr.so radrealms.so
--CFLAGS=-I../.. -I../../../include -Iradiusclient/include -O2
-+COPTS = -O2
-+COMPILE_FLAGS = -I../.. -I../../../include -Iradiusclient/include -fPIC
-+LIBS=
-+
-+CFLAGS=$(COPTS) $(COMPILE_FLAGS)
-+LDFLAGS=-lradiusclient
- # Uncomment the next line to include support for Microsoft's
- # MS-CHAP authentication protocol.
-@@ -37,29 +42,34 @@
-       $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)/man8
- radius.so: radiusclient/lib/.libs/libradiusclient.a radius.o
--      gcc -o radius.so -shared radius.o radiusclient/lib/.libs/libradiusclient.a
-+      $(CC) -o radius.so -shared radius.o radiusclient/lib/.libs/libradiusclient.a
- radattr.so: radattr.o
--      gcc -o radattr.so -shared radattr.o
-+      $(CC) -o radattr.so -shared radattr.o
- radrealms.so: radrealms.o
--      gcc -o radrealms.so -shared radrealms.o
-+      $(CC) -o radrealms.so -shared radrealms.o
- radius.o: radius.c
--      gcc $(CFLAGS) -c -o radius.o -fPIC radius.c
-+      $(CC) -c $(CFLAGS) radius.c -o radius.o
- radattr.o: radattr.c
--      gcc $(CFLAGS) -c -o radattr.o -fPIC radattr.c
-+      $(CC) -c $(CFLAGS) radattr.c -o radattr.o
- radrealms.o: radrealms.c
--      gcc $(CFLAGS) -c -o radrealms.o -fPIC radrealms.c
-+      $(CC) -c $(CFLAGS) radrealms.c -o radrealms.o
- radiusclient/lib/.libs/libradiusclient.a:
-       test -r radiusclient/Makefile ||           \
-               (cd radiusclient;                  \
-+              rm -f config.cache ; \
-+              aclocal ; \
-+              autoconf ; \
-+              ac_cv_func_setvbuf_reversed=no \
-+              ac_cv_func_uname=no \
-                ./configure --prefix=/usr         \
-                            --sysconfdir=/etc     \
--                           --enable-shared       \
-+                           --disable-shared       \
-                            --enable-static)
-       $(MAKE) -C radiusclient
-diff -ruN ppp-2.4.2-old/pppd/plugins/rp-pppoe/Makefile.linux ppp-2.4.2-new/pppd/plugins/rp-pppoe/Makefile.linux
---- ppp-2.4.2-old/pppd/plugins/rp-pppoe/Makefile.linux 2004-01-13 04:57:55.000000000 +0100
-+++ ppp-2.4.2-new/pppd/plugins/rp-pppoe/Makefile.linux 2004-08-23 12:48:50.000000000 +0200
-@@ -16,12 +16,16 @@
- # Version is set ONLY IN THE MAKEFILE!  Don't delete this!
- VERSION=3.3
--COPTS=-O2 -g
--CFLAGS=$(COPTS) -I../../../include/linux
-+#CC = gcc
-+COPTS = -O2
-+COMPILE_FLAGS = -I../../../include/linux -fPIC
-+
-+CFLAGS = $(COPTS) $(COMPILE_FLAGS)
-+
- all: rp-pppoe.so
- rp-pppoe.so: libplugin.a plugin.o
--      gcc -o rp-pppoe.so -shared plugin.o libplugin.a
-+      $(CC) -o rp-pppoe.so -shared plugin.o libplugin.a
- install: all
-       $(INSTALL) -d -m 755 $(LIBDIR)
-@@ -31,20 +35,20 @@
-       rm -f *.o *.so
- plugin.o: plugin.c
--      gcc '-DRP_VERSION="$(VERSION)"' $(CFLAGS) -I../../..  -c -o plugin.o -fPIC plugin.c
-+      $(CC) -c $(CFLAGS) plugin.c '-DRP_VERSION="$(VERSION)"' -I../../..  -o plugin.o
- libplugin.a: discovery.o if.o common.o debug.o
--      ar -rc $@ $^
-+      $(AR) -rc $@ $^
- discovery.o: discovery.c
--      gcc $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o discovery.o -fPIC discovery.c
-+      $(CC) -c $(CFLAGS) discovery.c '-DVERSION="$(VERSION)"' -o discovery.o
- if.o: if.c
--      gcc $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o if.o -fPIC if.c
-+      $(CC) -c $(CFLAGS) if.c '-DVERSION="$(VERSION)"' -o if.o
- debug.o: debug.c
--      gcc $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o debug.o -fPIC debug.c
-+      $(CC) -c $(CFLAGS) debug.c '-DVERSION="$(VERSION)"' -o debug.o
- common.o: common.c
--      gcc $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o common.o -fPIC common.c
-+      $(CC) -c $(CFLAGS) common.c '-DVERSION="$(VERSION)"' -o common.o
-diff -ruN ppp-2.4.2-old/pppdump/Makefile.linux ppp-2.4.2-new/pppdump/Makefile.linux
---- ppp-2.4.2-old/pppdump/Makefile.linux       1999-07-26 13:09:29.000000000 +0200
-+++ ppp-2.4.2-new/pppdump/Makefile.linux       2004-08-23 12:48:50.000000000 +0200
-@@ -1,4 +1,8 @@
--CFLAGS= -O -I../include/net
-+#CC = gcc
-+COPTS = -O
-+COMPILE_FLAGS = -I../include/net
-+CFLAGS= $(COPTS) $(COMPILE_FLAGS)
-+
- OBJS = pppdump.o bsd-comp.o deflate.o zlib.o
- INSTALL= install
-diff -ruN ppp-2.4.2-old/pppstats/Makefile.linux ppp-2.4.2-new/pppstats/Makefile.linux
---- ppp-2.4.2-old/pppstats/Makefile.linux      2002-11-09 12:24:43.000000000 +0100
-+++ ppp-2.4.2-new/pppstats/Makefile.linux      2004-08-23 12:48:50.000000000 +0200
-@@ -7,11 +7,11 @@
- PPPSTATOBJS = pppstats.o
- #CC = gcc
--COPTS = -O
-+COPTS = -O2
- COMPILE_FLAGS = -I../include
- LIBS =
--INSTALL= install -o root -g daemon
-+INSTALL= install
- CFLAGS = $(COPTS) $(COMPILE_FLAGS)
diff --git a/obsolete-buildroot/sources/openwrt/patches/ppp/z02_ppp-2.4.2-stdopt-mppe-mppc-1.1.patch b/obsolete-buildroot/sources/openwrt/patches/ppp/z02_ppp-2.4.2-stdopt-mppe-mppc-1.1.patch
deleted file mode 100644 (file)
index d230534..0000000
+++ /dev/null
@@ -1,1608 +0,0 @@
-diff -ruN ppp-2.4.2.orig/include/linux/ppp-comp.h ppp-2.4.2-stdopt/include/linux/ppp-comp.h
---- ppp-2.4.2.orig/include/linux/ppp-comp.h    2002-12-06 10:49:15.000000000 +0100
-+++ ppp-2.4.2-stdopt/include/linux/ppp-comp.h  2004-01-21 06:51:09.000000000 +0100
-@@ -36,7 +36,7 @@
-  */
- /*
-- *  ==FILEVERSION 20020319==
-+ *  ==FILEVERSION 20020715==
-  *
-  *  NOTE TO MAINTAINERS:
-  *     If you modify this file at all, please set the above date.
-@@ -86,7 +86,7 @@
-       /* Compress a packet */
-       int     (*compress) (void *state, unsigned char *rptr,
--                            unsigned char *obuf, int isize, int osize);
-+                           unsigned char *obuf, int isize, int osize);
-       /* Return compression statistics */
-       void    (*comp_stat) (void *state, struct compstat *stats);
-@@ -107,7 +107,7 @@
-       /* Decompress a packet. */
-       int     (*decompress) (void *state, unsigned char *ibuf, int isize,
--                              unsigned char *obuf, int osize);
-+                             unsigned char *obuf, int osize);
-       /* Update state for an incompressible packet received */
-       void    (*incomp) (void *state, unsigned char *ibuf, int icnt);
-@@ -288,6 +288,33 @@
-           opts |= MPPE_OPT_UNKNOWN;           \
-     } while (/* CONSTCOND */ 0)
-+/* MPPE/MPPC definitions by J.D.*/
-+#define MPPE_STATELESS          MPPE_H_BIT    /* configuration bit H */
-+#define MPPE_40BIT              MPPE_L_BIT    /* configuration bit L */
-+#define MPPE_56BIT              MPPE_M_BIT    /* configuration bit M */
-+#define MPPE_128BIT             MPPE_S_BIT    /* configuration bit S */
-+#define MPPE_MPPC               MPPE_C_BIT    /* configuration bit C */
-+
-+/*
-+ * Definitions for Stac LZS.
-+ */
-+
-+#define CI_LZS                        17      /* config option for Stac LZS */
-+#define CILEN_LZS             5       /* length of config option */
-+
-+#define LZS_OVHD              4       /* max. LZS overhead */
-+#define LZS_HIST_LEN          2048    /* LZS history size */
-+#define LZS_MAX_CCOUNT                0x0FFF  /* max. coherency counter value */
-+
-+#define LZS_MODE_NONE         0
-+#define LZS_MODE_LCB          1
-+#define LZS_MODE_CRC          2
-+#define LZS_MODE_SEQ          3
-+#define LZS_MODE_EXT          4
-+
-+#define LZS_EXT_BIT_FLUSHED   0x80    /* bit A */
-+#define LZS_EXT_BIT_COMP      0x20    /* bit C */
-+
- /*
-  * Definitions for other, as yet unsupported, compression methods.
-  */
-diff -ruN ppp-2.4.2.orig/include/net/ppp-comp.h ppp-2.4.2-stdopt/include/net/ppp-comp.h
---- ppp-2.4.2.orig/include/net/ppp-comp.h      2002-12-06 10:49:15.000000000 +0100
-+++ ppp-2.4.2-stdopt/include/net/ppp-comp.h    2004-01-21 06:51:09.000000000 +0100
-@@ -255,6 +255,33 @@
-           opts |= MPPE_OPT_UNKNOWN;           \
-     } while (/* CONSTCOND */ 0)
-+/* MPPE/MPPC definitions by J.D.*/
-+#define MPPE_STATELESS          MPPE_H_BIT    /* configuration bit H */
-+#define MPPE_40BIT              MPPE_L_BIT    /* configuration bit L */
-+#define MPPE_56BIT              MPPE_M_BIT    /* configuration bit M */
-+#define MPPE_128BIT             MPPE_S_BIT    /* configuration bit S */
-+#define MPPE_MPPC               MPPE_C_BIT    /* configuration bit C */
-+
-+/*
-+ * Definitions for Stac LZS.
-+ */
-+
-+#define CI_LZS                        17      /* config option for Stac LZS */
-+#define CILEN_LZS             5       /* length of config option */
-+
-+#define LZS_OVHD              4       /* max. LZS overhead */
-+#define LZS_HIST_LEN          2048    /* LZS history size */
-+#define LZS_MAX_CCOUNT                0x0FFF  /* max. coherency counter value */
-+
-+#define LZS_MODE_NONE         0
-+#define LZS_MODE_LCB          1
-+#define LZS_MODE_CRC          2
-+#define LZS_MODE_SEQ          3
-+#define LZS_MODE_EXT          4
-+
-+#define LZS_EXT_BIT_FLUSHED   0x80    /* bit A */
-+#define LZS_EXT_BIT_COMP      0x20    /* bit C */
-+
- /*
-  * Definitions for other, as yet unsupported, compression methods.
-  */
-diff -ruN ppp-2.4.2.orig/pppd/ccp.c ppp-2.4.2-stdopt/pppd/ccp.c
---- ppp-2.4.2.orig/pppd/ccp.c  2003-05-01 14:30:28.000000000 +0200
-+++ ppp-2.4.2-stdopt/pppd/ccp.c        2004-05-02 14:10:04.000000000 +0200
-@@ -67,13 +67,6 @@
- static char bsd_value[8];
- static char deflate_value[8];
--/*
-- * Option variables.
-- */
--#ifdef MPPE
--bool refuse_mppe_stateful = 1;                /* Allow stateful mode? */
--#endif
--
- static option_t ccp_option_list[] = {
-     { "noccp", o_bool, &ccp_protent.enabled_flag,
-       "Disable CCP negotiation" },
-@@ -113,54 +106,87 @@
-       "don't allow Predictor-1", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR,
-       &ccp_allowoptions[0].predictor_1 },
-+    { "lzs", o_bool, &ccp_wantoptions[0].lzs,
-+      "request Stac LZS", 1, &ccp_allowoptions[0].lzs, OPT_PRIO },
-+    { "+lzs", o_bool, &ccp_wantoptions[0].lzs,
-+      "request Stac LZS", 1, &ccp_allowoptions[0].lzs, OPT_ALIAS | OPT_PRIO },
-+    { "nolzs", o_bool, &ccp_wantoptions[0].lzs,
-+      "don't allow Stac LZS", OPT_PRIOSUB | OPT_A2CLR,
-+      &ccp_allowoptions[0].lzs },
-+    { "-lzs", o_bool, &ccp_wantoptions[0].lzs,
-+      "don't allow Stac LZS", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR,
-+      &ccp_allowoptions[0].lzs },
-+
- #ifdef MPPE
--    /* MPPE options are symmetrical ... we only set wantoptions here */
-+    { "mppc", o_bool, &ccp_wantoptions[0].mppc,
-+      "request MPPC compression", 1, &ccp_allowoptions[0].mppc, OPT_PRIO },
-+    { "+mppc", o_bool, &ccp_wantoptions[0].mppc,
-+      "request MPPC compression", 1, &ccp_allowoptions[0].mppc,
-+      OPT_ALIAS | OPT_PRIO },
-+    { "nomppc", o_bool, &ccp_wantoptions[0].mppc,
-+      "don't allow MPPC compression", OPT_PRIOSUB | OPT_A2CLR,
-+      &ccp_allowoptions[0].mppc },
-+    { "-mppc", o_bool, &ccp_wantoptions[0].mppc,
-+      "don't allow MPPC compression", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR,
-+      &ccp_allowoptions[0].mppc },
-+
-     { "require-mppe", o_bool, &ccp_wantoptions[0].mppe,
--      "require MPPE encryption",
--      OPT_PRIO | MPPE_OPT_40 | MPPE_OPT_128 },
-+      "require MPPE encryption", 1, &ccp_allowoptions[0].mppe, OPT_PRIO },
-     { "+mppe", o_bool, &ccp_wantoptions[0].mppe,
--      "require MPPE encryption",
--      OPT_ALIAS | OPT_PRIO | MPPE_OPT_40 | MPPE_OPT_128 },
-+      "require MPPE encryption", 1, &ccp_allowoptions[0].mppe,
-+      OPT_ALIAS | OPT_PRIO },
-     { "nomppe", o_bool, &ccp_wantoptions[0].mppe,
--      "don't allow MPPE encryption", OPT_PRIO },
-+      "don't allow MPPE encryption", OPT_PRIOSUB | OPT_A2CLR,
-+      &ccp_allowoptions[0].mppe },
-     { "-mppe", o_bool, &ccp_wantoptions[0].mppe,
--      "don't allow MPPE encryption", OPT_ALIAS | OPT_PRIO },
-+      "don't allow MPPE encryption", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR,
-+      &ccp_allowoptions[0].mppe },
--    /* We use ccp_allowoptions[0].mppe as a junk var ... it is reset later */
--    { "require-mppe-40", o_bool, &ccp_allowoptions[0].mppe,
--      "require MPPE 40-bit encryption", OPT_PRIO | OPT_A2OR | MPPE_OPT_40,
--      &ccp_wantoptions[0].mppe },
--    { "+mppe-40", o_bool, &ccp_allowoptions[0].mppe,
--      "require MPPE 40-bit encryption", OPT_PRIO | OPT_A2OR | MPPE_OPT_40,
--      &ccp_wantoptions[0].mppe },
--    { "nomppe-40", o_bool, &ccp_allowoptions[0].mppe,
--      "don't allow MPPE 40-bit encryption",
--      OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_40, &ccp_wantoptions[0].mppe },
--    { "-mppe-40", o_bool, &ccp_allowoptions[0].mppe,
--      "don't allow MPPE 40-bit encryption",
--      OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_40,
--      &ccp_wantoptions[0].mppe },
--
--    { "require-mppe-128", o_bool, &ccp_allowoptions[0].mppe,
--      "require MPPE 128-bit encryption", OPT_PRIO | OPT_A2OR | MPPE_OPT_128,
--      &ccp_wantoptions[0].mppe },
--    { "+mppe-128", o_bool, &ccp_allowoptions[0].mppe,
--      "require MPPE 128-bit encryption",
--      OPT_ALIAS | OPT_PRIO | OPT_A2OR | MPPE_OPT_128,
--      &ccp_wantoptions[0].mppe },
--    { "nomppe-128", o_bool, &ccp_allowoptions[0].mppe,
--      "don't allow MPPE 128-bit encryption",
--      OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_128, &ccp_wantoptions[0].mppe },
--    { "-mppe-128", o_bool, &ccp_allowoptions[0].mppe,
--      "don't allow MPPE 128-bit encryption",
--      OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_128,
--      &ccp_wantoptions[0].mppe },
--
--    /* strange one; we always request stateless, but will we allow stateful? */
--    { "mppe-stateful", o_bool, &refuse_mppe_stateful,
--      "allow MPPE stateful mode", OPT_PRIO },
--    { "nomppe-stateful", o_bool, &refuse_mppe_stateful,
--      "disallow MPPE stateful mode", OPT_PRIO | 1 },
-+    { "require-mppe-40", o_bool, &ccp_wantoptions[0].mppe_40,
-+      "require MPPE 40-bit encryption", 1, &ccp_allowoptions[0].mppe_40,
-+      OPT_PRIO },
-+    { "+mppe-40", o_bool, &ccp_wantoptions[0].mppe_40,
-+      "require MPPE 40-bit encryption", 1, &ccp_allowoptions[0].mppe_40,
-+      OPT_ALIAS | OPT_PRIO },
-+    { "nomppe-40", o_bool, &ccp_wantoptions[0].mppe_40,
-+      "don't allow MPPE 40-bit encryption", OPT_PRIOSUB | OPT_A2CLR,
-+      &ccp_allowoptions[0].mppe_40 },
-+    { "-mppe-40", o_bool, &ccp_wantoptions[0].mppe_40,
-+      "don't allow MPPE 40-bit encryption", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR,
-+      &ccp_allowoptions[0].mppe_40 },
-+
-+    { "require-mppe-56", o_bool, &ccp_wantoptions[0].mppe_56,
-+      "require MPPE 56-bit encryption", 1, &ccp_allowoptions[0].mppe_56,
-+      OPT_PRIO },
-+    { "+mppe-56", o_bool, &ccp_wantoptions[0].mppe_56,
-+      "require MPPE 56-bit encryption", 1, &ccp_allowoptions[0].mppe_56,
-+      OPT_ALIAS | OPT_PRIO },
-+    { "nomppe-56", o_bool, &ccp_wantoptions[0].mppe_56,
-+      "don't allow MPPE 56-bit encryption", OPT_PRIOSUB | OPT_A2CLR,
-+      &ccp_allowoptions[0].mppe_56 },
-+    { "-mppe-56", o_bool, &ccp_wantoptions[0].mppe_56,
-+      "don't allow MPPE 56-bit encryption", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR,
-+      &ccp_allowoptions[0].mppe_56 },
-+
-+    { "require-mppe-128", o_bool, &ccp_wantoptions[0].mppe_128,
-+      "require MPPE 128-bit encryption", 1, &ccp_allowoptions[0].mppe_128,
-+      OPT_PRIO },
-+    { "+mppe-128", o_bool, &ccp_wantoptions[0].mppe_128,
-+      "require MPPE 128-bit encryption", 1, &ccp_allowoptions[0].mppe_128,
-+      OPT_ALIAS | OPT_PRIO },
-+    { "nomppe-128", o_bool, &ccp_wantoptions[0].mppe_40,
-+      "don't allow MPPE 128-bit encryption", OPT_PRIOSUB | OPT_A2CLR,
-+      &ccp_allowoptions[0].mppe_128 },
-+    { "-mppe-128", o_bool, &ccp_wantoptions[0].mppe_128,
-+      "don't allow MPPE 128-bit encryption", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR,
-+      &ccp_allowoptions[0].mppe_128 },
-+
-+    { "nomppe-stateful", o_bool, &ccp_wantoptions[0].mppe_stateless,
-+      "disallow MPPE stateful mode", 1, &ccp_allowoptions[0].mppe_stateless,
-+      OPT_PRIO },
-+    { "mppe-stateful", o_bool, &ccp_wantoptions[0].mppe_stateless,
-+      "allow MPPE stateful mode", OPT_PRIOSUB | OPT_A2CLR,
-+      &ccp_allowoptions[0].mppe_stateless },
- #endif /* MPPE */
-     { NULL }
-@@ -246,7 +272,7 @@
-  */
- #define ANY_COMPRESS(opt)     ((opt).deflate || (opt).bsd_compress \
-                                || (opt).predictor_1 || (opt).predictor_2 \
--                               || (opt).mppe)
-+                               || (opt).lzs || (opt).mppc || (opt).mppe)
- /*
-  * Local state (mainly for handling reset-reqs and reset-acks).
-@@ -383,6 +409,30 @@
-     ccp_allowoptions[0].bsd_bits = BSD_MAX_BITS;
-     ccp_allowoptions[0].predictor_1 = 1;
-+
-+    ccp_wantoptions[0].lzs = 0; /* Stac LZS  - will be enabled in the future */
-+    ccp_wantoptions[0].lzs_mode = LZS_MODE_SEQ;
-+    ccp_wantoptions[0].lzs_hists = 1;
-+    ccp_allowoptions[0].lzs = 0; /* Stac LZS  - will be enabled in the future */
-+    ccp_allowoptions[0].lzs_mode = LZS_MODE_SEQ;
-+    ccp_allowoptions[0].lzs_hists = 1;
-+
-+#ifdef MPPE
-+    /* by default allow and request MPPC... */
-+    ccp_wantoptions[0].mppc = ccp_allowoptions[0].mppc = 1;
-+
-+    /* ... and allow but don't request MPPE */
-+    ccp_allowoptions[0].mppe = 1;
-+    ccp_allowoptions[0].mppe_40 = 1;
-+    ccp_allowoptions[0].mppe_56 = 1;
-+    ccp_allowoptions[0].mppe_128 = 1;
-+    ccp_allowoptions[0].mppe_stateless = 1;
-+    ccp_wantoptions[0].mppe = 0;
-+    ccp_wantoptions[0].mppe_40 = 0;
-+    ccp_wantoptions[0].mppe_56 = 0;
-+    ccp_wantoptions[0].mppe_128 = 0;
-+    ccp_wantoptions[0].mppe_stateless = 0;
-+#endif /* MPPE */
- }
- /*
-@@ -460,11 +510,11 @@
-     if (oldstate == OPENED && p[0] == TERMREQ && f->state != OPENED) {
-       notice("Compression disabled by peer.");
- #ifdef MPPE
--      if (ccp_gotoptions[unit].mppe) {
-+      if (ccp_wantoptions[unit].mppe) {
-           error("MPPE disabled, closing LCP");
-           lcp_close(unit, "MPPE disabled by peer");
-       }
--#endif
-+#endif /* MPPE */
-     }
-     /*
-@@ -492,6 +542,15 @@
-           break;
-       /* send a reset-ack, which the transmitter will see and
-          reset its compression state. */
-+
-+      /* In case of MPPE/MPPC or LZS we shouldn't send CCP_RESETACK,
-+         but we do it in order to reset compressor; CCP_RESETACK is
-+         then silently discarded. See functions ppp_send_frame and
-+         ppp_ccp_peek in ppp_generic.c (Linux only !!!). All the
-+         confusion is caused by the fact that CCP code is splited
-+         into two parts - one part is handled by pppd, the other one
-+         is handled by kernel. */
-+
-       fsm_sdata(f, CCP_RESETACK, id, NULL, 0);
-       break;
-@@ -520,12 +579,11 @@
-     fsm_lowerdown(&ccp_fsm[unit]);
- #ifdef MPPE
--    if (ccp_gotoptions[unit].mppe) {
-+    if (ccp_wantoptions[unit].mppe) {
-       error("MPPE required but peer negotiation failed");
-       lcp_close(unit, "MPPE required but peer negotiation failed");
-     }
--#endif
--
-+#endif /* MPPE */
- }
- /*
-@@ -542,7 +600,7 @@
-     all_rejected[f->unit] = 0;
- #ifdef MPPE
--    if (go->mppe) {
-+    if (go->mppe || go->mppc) {
-       ccp_options *ao = &ccp_allowoptions[f->unit];
-       int auth_mschap_bits = auth_done[f->unit];
-       int numbits;
-@@ -556,80 +614,109 @@
-        * NB: If MPPE is required, all other compression opts are invalid.
-        *     So, we return right away if we can't do it.
-        */
-+      if (ccp_wantoptions[f->unit].mppe) {
-+          /* Leave only the mschap auth bits set */
-+          auth_mschap_bits &= (CHAP_MS_WITHPEER  | CHAP_MS_PEER |
-+                               CHAP_MS2_WITHPEER | CHAP_MS2_PEER);
-+          /* Count the mschap auths */
-+          auth_mschap_bits >>= CHAP_MS_SHIFT;
-+          numbits = 0;
-+          do {
-+              numbits += auth_mschap_bits & 1;
-+              auth_mschap_bits >>= 1;
-+          } while (auth_mschap_bits);
-+          if (numbits > 1) {
-+              error("MPPE required, but auth done in both directions.");
-+              lcp_close(f->unit, "MPPE required but not available");
-+              return;
-+          }
-+          if (!numbits) {
-+              error("MPPE required, but MS-CHAP[v2] auth not performed.");
-+              lcp_close(f->unit, "MPPE required but not available");
-+              return;
-+          }
--      /* Leave only the mschap auth bits set */
--      auth_mschap_bits &= (CHAP_MS_WITHPEER  | CHAP_MS_PEER |
--                           CHAP_MS2_WITHPEER | CHAP_MS2_PEER);
--      /* Count the mschap auths */
--      auth_mschap_bits >>= CHAP_MS_SHIFT;
--      numbits = 0;
--      do {
--          numbits += auth_mschap_bits & 1;
--          auth_mschap_bits >>= 1;
--      } while (auth_mschap_bits);
--      if (numbits > 1) {
--          error("MPPE required, but auth done in both directions.");
--          lcp_close(f->unit, "MPPE required but not available");
--          return;
--      }
--      if (!numbits) {
--          error("MPPE required, but MS-CHAP[v2] auth not performed.");
--          lcp_close(f->unit, "MPPE required but not available");
--          return;
--      }
--
--      /* A plugin (eg radius) may not have obtained key material. */
--      if (!mppe_keys_set) {
--          error("MPPE required, but keys are not available.  "
--                "Possible plugin problem?");
--          lcp_close(f->unit, "MPPE required but not available");
--          return;
--      }
--
--      /* LM auth not supported for MPPE */
--      if (auth_done[f->unit] & (CHAP_MS_WITHPEER | CHAP_MS_PEER)) {
--          /* This might be noise */
--          if (go->mppe & MPPE_OPT_40) {
--              notice("Disabling 40-bit MPPE; MS-CHAP LM not supported");
--              go->mppe &= ~MPPE_OPT_40;
--              ccp_wantoptions[f->unit].mppe &= ~MPPE_OPT_40;
-+          /* A plugin (eg radius) may not have obtained key material. */
-+          if (!mppe_keys_set) {
-+              error("MPPE required, but keys are not available.  "
-+                    "Possible plugin problem?");
-+              lcp_close(f->unit, "MPPE required but not available");
-+              return;
-           }
-       }
--      /* Last check: can we actually negotiate something? */
--      if (!(go->mppe & (MPPE_OPT_40 | MPPE_OPT_128))) {
--          /* Could be misconfig, could be 40-bit disabled above. */
--          error("MPPE required, but both 40-bit and 128-bit disabled.");
--          lcp_close(f->unit, "MPPE required but not available");
--          return;
-+      /*
-+       * Check whether the kernel knows about the various
-+       * compression methods we might request. Key material
-+       * unimportant here.
-+       */
-+      if (go->mppc) {
-+          opt_buf[0] = CI_MPPE;
-+          opt_buf[1] = CILEN_MPPE;
-+          opt_buf[2] = 0;
-+          opt_buf[3] = 0;
-+          opt_buf[4] = 0;
-+          opt_buf[5] = MPPE_MPPC;
-+          if (ccp_test(f->unit, opt_buf, CILEN_MPPE, 0) <= 0)
-+              go->mppc = 0;
-+      }
-+      if (go->mppe_40) {
-+          opt_buf[0] = CI_MPPE;
-+          opt_buf[1] = CILEN_MPPE;
-+          opt_buf[2] = MPPE_STATELESS;
-+          opt_buf[3] = 0;
-+          opt_buf[4] = 0;
-+          opt_buf[5] = MPPE_40BIT;
-+          if (ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0) <= 0)
-+              go->mppe_40 = 0;
-+      }
-+      if (go->mppe_56) {
-+          opt_buf[0] = CI_MPPE;
-+          opt_buf[1] = CILEN_MPPE;
-+          opt_buf[2] = MPPE_STATELESS;
-+          opt_buf[3] = 0;
-+          opt_buf[4] = 0;
-+          opt_buf[5] = MPPE_56BIT;
-+          if (ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0) <= 0)
-+              go->mppe_56 = 0;
-+      }
-+      if (go->mppe_128) {
-+          opt_buf[0] = CI_MPPE;
-+          opt_buf[1] = CILEN_MPPE;
-+          opt_buf[2] = MPPE_STATELESS;
-+          opt_buf[3] = 0;
-+          opt_buf[4] = 0;
-+          opt_buf[5] = MPPE_128BIT;
-+          if (ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0) <= 0)
-+              go->mppe_128 = 0;
-+      }
-+      if (!go->mppe_40 && !go->mppe_56 && !go->mppe_128) {
-+          if (ccp_wantoptions[f->unit].mppe) {
-+              error("MPPE required, but kernel has no support.");
-+              lcp_close(f->unit, "MPPE required but not available");
-+          }
-+          go->mppe = go->mppe_stateless = 0;
-+      } else {
-+          /* MPPE is not compatible with other compression types */
-+          if (ccp_wantoptions[f->unit].mppe) {
-+              ao->bsd_compress = go->bsd_compress = 0;
-+              ao->predictor_1  = go->predictor_1  = 0;
-+              ao->predictor_2  = go->predictor_2  = 0;
-+              ao->deflate      = go->deflate      = 0;
-+              ao->lzs          = go->lzs          = 0;
-+          }
-       }
--
--      /* sync options */
--      ao->mppe = go->mppe;
--      /* MPPE is not compatible with other compression types */
--      ao->bsd_compress = go->bsd_compress = 0;
--      ao->predictor_1  = go->predictor_1  = 0;
--      ao->predictor_2  = go->predictor_2  = 0;
--      ao->deflate      = go->deflate      = 0;
-     }
- #endif /* MPPE */
--
--    /*
--     * Check whether the kernel knows about the various
--     * compression methods we might request.
--     */
--#ifdef MPPE
--    if (go->mppe) {
--      opt_buf[0] = CI_MPPE;
--      opt_buf[1] = CILEN_MPPE;
--      MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]);
--      /* Key material unimportant here. */
--      if (ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0) <= 0) {
--          error("MPPE required, but kernel has no support.");
--          lcp_close(f->unit, "MPPE required but not available");
--      }
-+    if (go->lzs) {
-+      opt_buf[0] = CI_LZS;
-+      opt_buf[1] = CILEN_LZS;
-+      opt_buf[2] = go->lzs_hists >> 8;
-+      opt_buf[3] = go->lzs_hists & 0xff;
-+      opt_buf[4] = LZS_MODE_SEQ;
-+      if (ccp_test(f->unit, opt_buf, CILEN_LZS, 0) <= 0)
-+          go->lzs = 0;
-     }
--#endif
-     if (go->bsd_compress) {
-       opt_buf[0] = CI_BSD_COMPRESS;
-       opt_buf[1] = CILEN_BSD_COMPRESS;
-@@ -684,7 +771,8 @@
-       + (go->deflate? CILEN_DEFLATE: 0)
-       + (go->predictor_1? CILEN_PREDICTOR_1: 0)
-       + (go->predictor_2? CILEN_PREDICTOR_2: 0)
--      + (go->mppe? CILEN_MPPE: 0);
-+      + (go->lzs? CILEN_LZS: 0)
-+      + ((go->mppe || go->mppc)? CILEN_MPPE: 0);
- }
- /*
-@@ -698,6 +786,8 @@
- {
-     int res;
-     ccp_options *go = &ccp_gotoptions[f->unit];
-+    ccp_options *ao = &ccp_allowoptions[f->unit];
-+    ccp_options *wo = &ccp_wantoptions[f->unit];
-     u_char *p0 = p;
-     /*
-@@ -706,22 +796,43 @@
-      * in case it gets Acked.
-      */
- #ifdef MPPE
--    if (go->mppe) {
-+    if (go->mppe || go->mppc || (!wo->mppe && ao->mppe)) {
-       u_char opt_buf[CILEN_MPPE + MPPE_MAX_KEY_LEN];
--      p[0] = opt_buf[0] = CI_MPPE;
--      p[1] = opt_buf[1] = CILEN_MPPE;
--      MPPE_OPTS_TO_CI(go->mppe, &p[2]);
--      MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]);
-+      p[0] = CI_MPPE;
-+      p[1] = CILEN_MPPE;
-+      p[2] = (go->mppe_stateless ? MPPE_STATELESS : 0);
-+      p[3] = 0;
-+      p[4] = 0;
-+      p[5] = (go->mppe_40 ? MPPE_40BIT : 0) | (go->mppe_56 ? MPPE_56BIT : 0) |
-+          (go->mppe_128 ? MPPE_128BIT : 0) | (go->mppc ? MPPE_MPPC : 0);
-+
-+      BCOPY(p, opt_buf, CILEN_MPPE);
-       BCOPY(mppe_recv_key, &opt_buf[CILEN_MPPE], MPPE_MAX_KEY_LEN);
-       res = ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0);
--      if (res > 0)
-+      if (res > 0) {
-           p += CILEN_MPPE;
--      else
-+      } else {
-           /* This shouldn't happen, we've already tested it! */
--          lcp_close(f->unit, "MPPE required but not available in kernel");
-+          go->mppe = go->mppe_40 = go->mppe_56 = go->mppe_128 =
-+              go->mppe_stateless = go->mppc = 0;
-+          if (ccp_wantoptions[f->unit].mppe)
-+              lcp_close(f->unit, "MPPE required but not available in kernel");
-+      }
-+    }
-+#endif /* MPPE */
-+    if (go->lzs) {
-+      p[0] = CI_LZS;
-+      p[1] = CILEN_LZS;
-+      p[2] = go->lzs_hists >> 8;
-+      p[3] = go->lzs_hists & 0xff;
-+      p[4] = LZS_MODE_SEQ;
-+      res = ccp_test(f->unit, p, CILEN_LZS, 0);
-+      if (res > 0) {
-+          p += CILEN_LZS;
-+      } else
-+          go->lzs = 0;
-     }
--#endif
-     if (go->deflate) {
-       p[0] = go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT;
-       p[1] = CILEN_DEFLATE;
-@@ -807,7 +918,7 @@
- /*
-  * ccp_ackci - process a received configure-ack, and return
-- * 1 iff the packet was OK.
-+ * 1 if the packet was OK.
-  */
- static int
- ccp_ackci(f, p, len)
-@@ -816,24 +927,44 @@
-     int len;
- {
-     ccp_options *go = &ccp_gotoptions[f->unit];
-+    ccp_options *ao = &ccp_allowoptions[f->unit];
-+    ccp_options *wo = &ccp_wantoptions[f->unit];
-     u_char *p0 = p;
- #ifdef MPPE
--    if (go->mppe) {
--      u_char opt_buf[CILEN_MPPE];
--
--      opt_buf[0] = CI_MPPE;
--      opt_buf[1] = CILEN_MPPE;
--      MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]);
--      if (len < CILEN_MPPE || memcmp(opt_buf, p, CILEN_MPPE))
-+    if (go->mppe || go->mppc || (!wo->mppe && ao->mppe)) {
-+      if (len < CILEN_MPPE
-+          || p[1] != CILEN_MPPE || p[0] != CI_MPPE
-+          || p[2] != (go->mppe_stateless ? MPPE_STATELESS : 0)
-+          || p[3] != 0
-+          || p[4] != 0
-+          || (p[5] != ((go->mppe_40 ? MPPE_40BIT : 0) |
-+                       (go->mppc ? MPPE_MPPC : 0))
-+              && p[5] != ((go->mppe_56 ? MPPE_56BIT : 0) |
-+                          (go->mppc ? MPPE_MPPC : 0))
-+              && p[5] != ((go->mppe_128 ? MPPE_128BIT : 0) |
-+                          (go->mppc ? MPPE_MPPC : 0))))
-           return 0;
-+      if (go->mppe_40 || go->mppe_56 || go->mppe_128)
-+          go->mppe = 1;
-       p += CILEN_MPPE;
-       len -= CILEN_MPPE;
-+      /* Cope with first/fast ack */
-+      if (p == p0 && len == 0)
-+          return 1;
-+    }
-+#endif /* MPPE */
-+    if (go->lzs) {
-+      if (len < CILEN_LZS || p[0] != CI_LZS || p[1] != CILEN_LZS
-+          || p[2] != go->lzs_hists>>8 || p[3] != (go->lzs_hists&0xff)
-+          || p[4] != LZS_MODE_SEQ)
-+          return 0;
-+      p += CILEN_LZS;
-+      len -= CILEN_LZS;
-       /* XXX Cope with first/fast ack */
--      if (len == 0)
-+      if (p == p0 && len == 0)
-           return 1;
-     }
--#endif
-     if (go->deflate) {
-       if (len < CILEN_DEFLATE
-           || p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT)
-@@ -896,7 +1027,7 @@
- /*
-  * ccp_nakci - process received configure-nak.
-- * Returns 1 iff the nak was OK.
-+ * Returns 1 if the nak was OK.
-  */
- static int
- ccp_nakci(f, p, len)
-@@ -905,6 +1036,8 @@
-     int len;
- {
-     ccp_options *go = &ccp_gotoptions[f->unit];
-+    ccp_options *ao = &ccp_allowoptions[f->unit];
-+    ccp_options *wo = &ccp_wantoptions[f->unit];
-     ccp_options no;           /* options we've seen already */
-     ccp_options try;          /* options to ask for next time */
-@@ -912,28 +1045,100 @@
-     try = *go;
- #ifdef MPPE
--    if (go->mppe && len >= CILEN_MPPE
--      && p[0] == CI_MPPE && p[1] == CILEN_MPPE) {
--      no.mppe = 1;
--      /*
--       * Peer wants us to use a different strength or other setting.
--       * Fail if we aren't willing to use his suggestion.
--       */
--      MPPE_CI_TO_OPTS(&p[2], try.mppe);
--      if ((try.mppe & MPPE_OPT_STATEFUL) && refuse_mppe_stateful) {
--          error("Refusing MPPE stateful mode offered by peer");
--          try.mppe = 0;
--      } else if (((go->mppe | MPPE_OPT_STATEFUL) & try.mppe) != try.mppe) {
--          /* Peer must have set options we didn't request (suggest) */
--          try.mppe = 0;
--      }
-+    if ((go->mppe || go->mppc || (!wo->mppe && ao->mppe)) &&
-+      len >= CILEN_MPPE && p[0] == CI_MPPE && p[1] == CILEN_MPPE) {
--      if (!try.mppe) {
--          error("MPPE required but peer negotiation failed");
--          lcp_close(f->unit, "MPPE required but peer negotiation failed");
-+      if (go->mppc) {
-+          no.mppc = 1;
-+          if (!(p[5] & MPPE_MPPC))
-+              try.mppc = 0;
-+      }
-+
-+      if (go->mppe)
-+          no.mppe = 1;
-+      if (go->mppe_40)
-+          no.mppe_40 = 1;
-+      if (go->mppe_56)
-+          no.mppe_56 = 1;
-+      if (go->mppe_128)
-+          no.mppe_128 = 1;
-+      if (go->mppe_stateless)
-+          no.mppe_stateless = 1;
-+
-+      if (ao->mppe_40) {
-+          if ((p[5] & MPPE_40BIT))
-+              try.mppe_40 = 1;
-+          else
-+              try.mppe_40 = (p[5] == 0) ? 1 : 0;
-+      }
-+      if (ao->mppe_56) {
-+          if ((p[5] & MPPE_56BIT))
-+              try.mppe_56 = 1;
-+          else
-+              try.mppe_56 = (p[5] == 0) ? 1 : 0;
-+      }
-+      if (ao->mppe_128) {
-+          if ((p[5] & MPPE_128BIT))
-+              try.mppe_128 = 1;
-+          else
-+              try.mppe_128 = (p[5] == 0) ? 1 : 0;
-+      }
-+
-+      if (ao->mppe_stateless) {
-+          if ((p[2] & MPPE_STATELESS) || wo->mppe_stateless)
-+              try.mppe_stateless = 1;
-+          else
-+              try.mppe_stateless = 0;
-+      }
-+
-+      if (!try.mppe_56 && !try.mppe_40 && !try.mppe_128) {
-+          try.mppe = try.mppe_stateless = 0;
-+          if (wo->mppe) {
-+              /* we require encryption, but peer doesn't support it
-+                 so we close connection */
-+              wo->mppc = wo->mppe = wo->mppe_stateless = wo->mppe_40 =
-+                  wo->mppe_56 = wo->mppe_128 = 0;
-+              lcp_close(f->unit, "MPPE required but cannot negotiate MPPE "
-+                        "key length");
-+          }
-+        }
-+      if (wo->mppe && (wo->mppe_40 != try.mppe_40) &&
-+          (wo->mppe_56 != try.mppe_56) && (wo->mppe_128 != try.mppe_128)) {
-+          /* cannot negotiate key length */
-+          wo->mppc = wo->mppe = wo->mppe_stateless = wo->mppe_40 =
-+              wo->mppe_56 = wo->mppe_128 = 0;
-+          lcp_close(f->unit, "Cannot negotiate MPPE key length");
-       }
-+      if (try.mppe_40 && try.mppe_56 && try.mppe_128)
-+          try.mppe_40 = try.mppe_56 = 0;
-+      else
-+          if (try.mppe_56 && try.mppe_128)
-+              try.mppe_56 = 0;
-+          else
-+              if (try.mppe_40 && try.mppe_128)
-+                  try.mppe_40 = 0;
-+              else
-+                  if (try.mppe_40 && try.mppe_56)
-+                      try.mppe_40 = 0;
-+
-+      p += CILEN_MPPE;
-+      len -= CILEN_MPPE;
-     }
- #endif /* MPPE */
-+
-+    if (go->lzs && len >= CILEN_LZS && p[0] == CI_LZS && p[1] == CILEN_LZS) {
-+      no.lzs = 1;
-+      if (((p[2]<<8)|p[3]) > 1 || (p[4] != LZS_MODE_SEQ &&
-+                                   p[4] != LZS_MODE_EXT))
-+          try.lzs = 0;
-+      else {
-+          try.lzs_mode = p[4];
-+          try.lzs_hists = (p[2] << 8) | p[3];
-+      }
-+      p += CILEN_LZS;
-+      len -= CILEN_LZS;
-+    }
-+
-     if (go->deflate && len >= CILEN_DEFLATE
-       && p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT)
-       && p[1] == CILEN_DEFLATE) {
-@@ -1006,14 +1211,50 @@
-       return -1;
- #ifdef MPPE
--    if (go->mppe && len >= CILEN_MPPE
-+    if ((go->mppe || go->mppc) && len >= CILEN_MPPE
-       && p[0] == CI_MPPE && p[1] == CILEN_MPPE) {
--      error("MPPE required but peer refused");
--      lcp_close(f->unit, "MPPE required but peer refused");
-+      ccp_options *wo = &ccp_wantoptions[f->unit];
-+      if (p[2] != (go->mppe_stateless ? MPPE_STATELESS : 0) ||
-+          p[3] != 0 ||
-+          p[4] != 0 ||
-+          p[5] != ((go->mppe_40 ? MPPE_40BIT : 0) |
-+                   (go->mppe_56 ? MPPE_56BIT : 0) |
-+                   (go->mppe_128 ? MPPE_128BIT : 0) |
-+                   (go->mppc ? MPPE_MPPC : 0)))
-+          return 0;
-+      if (go->mppc)
-+          try.mppc = 0;
-+      if (go->mppe) {
-+          try.mppe = 0;
-+          if (go->mppe_40)
-+              try.mppe_40 = 0;
-+          if (go->mppe_56)
-+              try.mppe_56 = 0;
-+          if (go->mppe_128)
-+              try.mppe_128 = 0;
-+          if (go->mppe_stateless)
-+              try.mppe_stateless = 0;
-+          if (!try.mppe_56 && !try.mppe_40 && !try.mppe_128)
-+              try.mppe = try.mppe_stateless = 0;
-+          if (wo->mppe) { /* we want MPPE but cannot negotiate key length */
-+              wo->mppc = wo->mppe = wo->mppe_stateless = wo->mppe_40 =
-+                  wo->mppe_56 = wo->mppe_128 = 0;
-+              lcp_close(f->unit, "MPPE required but cannot negotiate MPPE "
-+                        "key length");
-+          }
-+      }
-       p += CILEN_MPPE;
-       len -= CILEN_MPPE;
-     }
--#endif
-+#endif /* MPPE */
-+    if (go->lzs && len >= CILEN_LZS && p[0] == CI_LZS && p[1] == CILEN_LZS) {
-+      if (p[2] != go->lzs_hists>>8 || p[3] != (go->lzs_hists&0xff) 
-+          || p[4] != go->lzs_mode)
-+          return 0;
-+      try.lzs = 0;
-+      p += CILEN_LZS;
-+      len -= CILEN_LZS;
-+    }
-     if (go->deflate_correct && len >= CILEN_DEFLATE
-       && p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) {
-       if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size)
-@@ -1077,14 +1318,15 @@
-     int dont_nak;
- {
-     int ret, newret, res;
--    u_char *p0, *retp;
-+    u_char *p0, *retp, p2, p5;
-     int len, clen, type, nb;
-     ccp_options *ho = &ccp_hisoptions[f->unit];
-     ccp_options *ao = &ccp_allowoptions[f->unit];
-+    ccp_options *wo = &ccp_wantoptions[f->unit];
- #ifdef MPPE
--    bool rej_for_ci_mppe = 1; /* Are we rejecting based on a bad/missing */
--                              /* CI_MPPE, or due to other options?       */
--#endif
-+    u_char opt_buf[CILEN_MPPE + MPPE_MAX_KEY_LEN];
-+/*     int mtu; */
-+#endif /* MPPE */
-     ret = CONFACK;
-     retp = p0 = p;
-@@ -1107,103 +1349,305 @@
-           switch (type) {
- #ifdef MPPE
-           case CI_MPPE:
--              if (!ao->mppe || clen != CILEN_MPPE) {
-+              if ((!ao->mppc && !ao->mppe) || clen != CILEN_MPPE) {
-                   newret = CONFREJ;
-                   break;
-               }
--              MPPE_CI_TO_OPTS(&p[2], ho->mppe);
--              /* Nak if anything unsupported or unknown are set. */
--              if (ho->mppe & MPPE_OPT_UNSUPPORTED) {
--                  newret = CONFNAK;
--                  ho->mppe &= ~MPPE_OPT_UNSUPPORTED;
--              }
--              if (ho->mppe & MPPE_OPT_UNKNOWN) {
-+              p2 = p[2];
-+              p5 = p[5];
-+              /* not sure what they want, tell 'em what we got */
-+              if (((p[2] & ~MPPE_STATELESS) != 0 || p[3] != 0 || p[4] != 0 ||
-+                   (p[5] & ~(MPPE_40BIT | MPPE_56BIT | MPPE_128BIT |
-+                             MPPE_MPPC)) != 0 || p[5] == 0) ||
-+                  (p[2] == 0 && p[3] == 0 && p[4] == 0 &&  p[5] == 0)) {
-                   newret = CONFNAK;
--                  ho->mppe &= ~MPPE_OPT_UNKNOWN;
-+                  p[2] = (wo->mppe_stateless ? MPPE_STATELESS : 0);
-+                  p[3] = 0;
-+                  p[4] = 0;
-+                  p[5] = (wo->mppe_40 ? MPPE_40BIT : 0) |
-+                      (wo->mppe_56 ? MPPE_56BIT : 0) |
-+                      (wo->mppe_128 ? MPPE_128BIT : 0) |
-+                      (wo->mppc ? MPPE_MPPC : 0);
-+                  break;
-               }
--              /* Check state opt */
--              if (ho->mppe & MPPE_OPT_STATEFUL) {
--                  /*
--                   * We can Nak and request stateless, but it's a
--                   * lot easier to just assume the peer will request
--                   * it if he can do it; stateful mode is bad over
--                   * the Internet -- which is where we expect MPPE.
--                   */
--                 if (refuse_mppe_stateful) {
--                      error("Refusing MPPE stateful mode offered by peer");
-+              if ((p[5] & MPPE_MPPC)) {
-+                  if (ao->mppc) {
-+                      ho->mppc = 1;
-+                      BCOPY(p, opt_buf, CILEN_MPPE);
-+                      opt_buf[2] = opt_buf[3] = opt_buf[4] = 0;
-+                      opt_buf[5] = MPPE_MPPC;
-+                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE, 1) <= 0) {
-+                          ho->mppc = 0;
-+                          p[5] &= ~MPPE_MPPC;
-+                          newret = CONFNAK;
-+                      }
-+                  } else {
-                       newret = CONFREJ;
--                      break;
-+                      if (wo->mppe || ao->mppe) {
-+                          p[5] &= ~MPPE_MPPC;
-+                          newret = CONFNAK;
-+                      }
-+                  }
-+              }
-+
-+              if (ao->mppe)
-+                  ho->mppe = 1;
-+
-+              if ((p[2] & MPPE_STATELESS)) {
-+                  if (ao->mppe_stateless) {
-+                      if (wo->mppe_stateless)
-+                          ho->mppe_stateless = 1;
-+                      else {
-+                          newret = CONFNAK;
-+                          if (!dont_nak)
-+                              p[2] &= ~MPPE_STATELESS;
-+                      }
-+                  } else {
-+                      newret = CONFNAK;
-+                      if (!dont_nak)
-+                          p[2] &= ~MPPE_STATELESS;
-+                  }
-+              } else {
-+                  if (wo->mppe_stateless && !dont_nak) {
-+                      wo->mppe_stateless = 0;
-+                      newret = CONFNAK;
-+                      p[2] |= MPPE_STATELESS;
-                   }
-               }
--              /* Find out which of {S,L} are set. */
--              if ((ho->mppe & MPPE_OPT_128)
--                   && (ho->mppe & MPPE_OPT_40)) {
--                  /* Both are set, negotiate the strongest. */
-+              if ((p[5] & ~MPPE_MPPC) == (MPPE_40BIT|MPPE_56BIT|MPPE_128BIT)) {
-                   newret = CONFNAK;
--                  if (ao->mppe & MPPE_OPT_128)
--                      ho->mppe &= ~MPPE_OPT_40;
--                  else if (ao->mppe & MPPE_OPT_40)
--                      ho->mppe &= ~MPPE_OPT_128;
--                  else {
--                      newret = CONFREJ;
--                      break;
-+                  if (ao->mppe_128) {
-+                      ho->mppe_128 = 1;
-+                      p[5] &= ~(MPPE_40BIT|MPPE_56BIT);
-+                      BCOPY(p, opt_buf, CILEN_MPPE);
-+                      BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
-+                            MPPE_MAX_KEY_LEN);
-+                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
-+                                   MPPE_MAX_KEY_LEN, 1) <= 0) {
-+                          ho->mppe_128 = 0;
-+                          p[5] |= (MPPE_40BIT|MPPE_56BIT);
-+                          p[5] &= ~MPPE_128BIT;
-+                          goto check_mppe_56_40;
-+                      }
-+                      goto check_mppe;
-                   }
--              } else if (ho->mppe & MPPE_OPT_128) {
--                  if (!(ao->mppe & MPPE_OPT_128)) {
--                      newret = CONFREJ;
--                      break;
-+                  p[5] &= ~MPPE_128BIT;
-+                  goto check_mppe_56_40;
-+              }
-+              if ((p[5] & ~MPPE_MPPC) == (MPPE_56BIT|MPPE_128BIT)) {
-+                  newret = CONFNAK;
-+                  if (ao->mppe_128) {
-+                      ho->mppe_128 = 1;
-+                      p[5] &= ~MPPE_56BIT;
-+                      BCOPY(p, opt_buf, CILEN_MPPE);
-+                      BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
-+                            MPPE_MAX_KEY_LEN);
-+                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
-+                                   MPPE_MAX_KEY_LEN, 1) <= 0) {
-+                          ho->mppe_128 = 0;
-+                          p[5] |= MPPE_56BIT;
-+                          p[5] &= ~MPPE_128BIT;
-+                          goto check_mppe_56;
-+                      }
-+                      goto check_mppe;
-                   }
--              } else if (ho->mppe & MPPE_OPT_40) {
--                  if (!(ao->mppe & MPPE_OPT_40)) {
--                      newret = CONFREJ;
--                      break;
-+                  p[5] &= ~MPPE_128BIT;
-+                  goto check_mppe_56;
-+              }
-+              if ((p[5] & ~MPPE_MPPC) == (MPPE_40BIT|MPPE_128BIT)) {
-+                  newret = CONFNAK;
-+                  if (ao->mppe_128) {
-+                      ho->mppe_128 = 1;
-+                      p[5] &= ~MPPE_40BIT;
-+                      BCOPY(p, opt_buf, CILEN_MPPE);
-+                      BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
-+                            MPPE_MAX_KEY_LEN);
-+                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
-+                                   MPPE_MAX_KEY_LEN, 1) <= 0) {
-+                          ho->mppe_128 = 0;
-+                          p[5] |= MPPE_40BIT;
-+                          p[5] &= ~MPPE_128BIT;
-+                          goto check_mppe_40;
-+                      }
-+                      goto check_mppe;
-+                  }
-+                  p[5] &= ~MPPE_128BIT;
-+                  goto check_mppe_40;
-+              }
-+              if ((p[5] & ~MPPE_MPPC) == MPPE_128BIT) {
-+                  if (ao->mppe_128) {
-+                      ho->mppe_128 = 1;
-+                      BCOPY(p, opt_buf, CILEN_MPPE);
-+                      BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
-+                            MPPE_MAX_KEY_LEN);
-+                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
-+                                   MPPE_MAX_KEY_LEN, 1) <= 0) {
-+                          ho->mppe_128 = 0;
-+                          p[5] &= ~MPPE_128BIT;
-+                          newret = CONFNAK;
-+                      }
-+                      goto check_mppe;
-+                  }
-+                  p[5] &= ~MPPE_128BIT;
-+                  newret = CONFNAK;
-+                  goto check_mppe;
-+              }
-+          check_mppe_56_40:
-+              if ((p[5] & ~MPPE_MPPC) == (MPPE_40BIT|MPPE_56BIT)) {
-+                  newret = CONFNAK;
-+                  if (ao->mppe_56) {
-+                      ho->mppe_56 = 1;
-+                      p[5] &= ~MPPE_40BIT;
-+                      BCOPY(p, opt_buf, CILEN_MPPE);
-+                      BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
-+                            MPPE_MAX_KEY_LEN);
-+                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
-+                                   MPPE_MAX_KEY_LEN, 1) <= 0) {
-+                          ho->mppe_56 = 0;
-+                          p[5] |= MPPE_40BIT;
-+                          p[5] &= ~MPPE_56BIT;
-+                          newret = CONFNAK;
-+                          goto check_mppe_40;
-+                      }
-+                      goto check_mppe;
-+                  }
-+                  p[5] &= ~MPPE_56BIT;
-+                  goto check_mppe_40;
-+              }
-+          check_mppe_56:
-+              if ((p[5] & ~MPPE_MPPC) == MPPE_56BIT) {
-+                  if (ao->mppe_56) {
-+                      ho->mppe_56 = 1;
-+                      BCOPY(p, opt_buf, CILEN_MPPE);
-+                      BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
-+                            MPPE_MAX_KEY_LEN);
-+                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
-+                                   MPPE_MAX_KEY_LEN, 1) <= 0) {
-+                          ho->mppe_56 = 0;
-+                          p[5] &= ~MPPE_56BIT;
-+                          newret = CONFNAK;
-+                      }
-+                      goto check_mppe;
-+                  }
-+                  p[5] &= ~MPPE_56BIT;
-+                  newret = CONFNAK;
-+                  goto check_mppe;
-+              }
-+          check_mppe_40:
-+              if ((p[5] & ~MPPE_MPPC) == MPPE_40BIT) {
-+                  if (ao->mppe_40) {
-+                      ho->mppe_40 = 1;
-+                      BCOPY(p, opt_buf, CILEN_MPPE);
-+                      BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
-+                            MPPE_MAX_KEY_LEN);
-+                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
-+                                   MPPE_MAX_KEY_LEN, 1) <= 0) {
-+                          ho->mppe_40 = 0;
-+                          p[5] &= ~MPPE_40BIT;
-+                          newret = CONFNAK;
-+                      }
-+                      goto check_mppe;
-+                  }
-+                  p[5] &= ~MPPE_40BIT;
-+              }
-+
-+          check_mppe:
-+              if (!ho->mppe_40 && !ho->mppe_56 && !ho->mppe_128) {
-+                  if (wo->mppe_40 || wo->mppe_56 || wo->mppe_128) {
-+                      newret = CONFNAK;
-+                      p[2] |= (wo->mppe_stateless ? MPPE_STATELESS : 0);
-+                      p[5] |= (wo->mppe_40 ? MPPE_40BIT : 0) |
-+                          (wo->mppe_56 ? MPPE_56BIT : 0) |
-+                          (wo->mppe_128 ? MPPE_128BIT : 0) |
-+                          (wo->mppc ? MPPE_MPPC : 0);
-+                  } else {
-+                      ho->mppe = ho->mppe_stateless = 0;
-                   }
-               } else {
--                  /* Neither are set. */
-+                  /* MPPE is not compatible with other compression types */
-+                  if (wo->mppe) {
-+                      ao->bsd_compress = 0;
-+                      ao->predictor_1 = 0;
-+                      ao->predictor_2 = 0;
-+                      ao->deflate = 0;
-+                      ao->lzs = 0;
-+                  }
-+              }
-+              if ((!ho->mppc || !ao->mppc) && !ho->mppe) {
-+                  p[2] = p2;
-+                  p[5] = p5;
-                   newret = CONFREJ;
-                   break;
-               }
--              /* rebuild the opts */
--              MPPE_OPTS_TO_CI(ho->mppe, &p[2]);
--              if (newret == CONFACK) {
--                  u_char opt_buf[CILEN_MPPE + MPPE_MAX_KEY_LEN];
--                  int mtu;
--
--                  BCOPY(p, opt_buf, CILEN_MPPE);
--                  BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
--                        MPPE_MAX_KEY_LEN);
--                  if (ccp_test(f->unit, opt_buf,
--                               CILEN_MPPE + MPPE_MAX_KEY_LEN, 1) <= 0) {
--                      /* This shouldn't happen, we've already tested it! */
--                      error("MPPE required, but kernel has no support.");
--                      lcp_close(f->unit, "MPPE required but not available");
--                      newret = CONFREJ;
--                      break;
--                  }
--                  /*
--                   * We need to decrease the interface MTU by MPPE_PAD
--                   * because MPPE frames **grow**.  The kernel [must]
--                   * allocate MPPE_PAD extra bytes in xmit buffers.
--                   */
--                  mtu = netif_get_mtu(f->unit);
--                  if (mtu)
--                      netif_set_mtu(f->unit, mtu - MPPE_PAD);
--                  else
--                      newret = CONFREJ;
--              }
-+              /*
-+               * I have commented the code below because according to RFC1547
-+               * MTU is only information for higher level protocols about
-+               * "the maximum allowable length for a packet (q.v.) transmitted
-+               * over a point-to-point link without incurring network layer
-+               * fragmentation." Of course a PPP implementation should be able
-+               * to handle overhead added by MPPE - in our case apropriate code
-+               * is located in drivers/net/ppp_generic.c in the kernel sources.
-+               *
-+               * According to RFC1661:
-+               * - when negotiated MRU is less than 1500 octets, a PPP
-+               *   implementation must still be able to receive at least 1500
-+               *   octets,
-+               * - when PFC is negotiated, a PPP implementation is still
-+               *   required to receive frames with uncompressed protocol field.
-+               *
-+               * So why not to handle MPPE overhead without changing MTU value?
-+               * I am sure that RFC3078, unfortunately silently, assumes that.
-+               */
-               /*
--               * We have accepted MPPE or are willing to negotiate
--               * MPPE parameters.  A CONFREJ is due to subsequent
--               * (non-MPPE) processing.
-+               * We need to decrease the interface MTU by MPPE_PAD
-+               * because MPPE frames **grow**.  The kernel [must]
-+               * allocate MPPE_PAD extra bytes in xmit buffers.
-                */
--              rej_for_ci_mppe = 0;
-+/*
-+              mtu = netif_get_mtu(f->unit);
-+              if (mtu) {
-+                  netif_set_mtu(f->unit, mtu - MPPE_PAD);
-+              } else {
-+                  newret = CONFREJ;
-+                  if (ccp_wantoptions[f->unit].mppe) {
-+                      error("Cannot adjust MTU needed by MPPE.");
-+                      lcp_close(f->unit, "Cannot adjust MTU needed by MPPE.");
-+                  }
-+              }
-+*/
-               break;
- #endif /* MPPE */
-+
-+          case CI_LZS:
-+              if (!ao->lzs || clen != CILEN_LZS) {
-+                  newret = CONFREJ;
-+                  break;
-+              }
-+
-+              ho->lzs = 1;
-+              ho->lzs_hists = (p[2] << 8) | p[3];
-+              ho->lzs_mode = p[4];
-+              if ((ho->lzs_hists != ao->lzs_hists) ||
-+                  (ho->lzs_mode != ao->lzs_mode)) {
-+                  newret = CONFNAK;
-+                  if (!dont_nak) {
-+                      p[2] = ao->lzs_hists >> 8;
-+                      p[3] = ao->lzs_hists & 0xff;
-+                      p[4] = ao->lzs_mode;
-+                  } else
-+                      break;
-+              }
-+
-+              if (p == p0 && ccp_test(f->unit, p, CILEN_LZS, 1) <= 0) {
-+                  newret = CONFREJ;
-+              }
-+              break;
-+
-           case CI_DEFLATE:
-           case CI_DEFLATE_DRAFT:
-               if (!ao->deflate || clen != CILEN_DEFLATE
-@@ -1345,12 +1789,6 @@
-       else
-           *lenp = retp - p0;
-     }
--#ifdef MPPE
--    if (ret == CONFREJ && ao->mppe && rej_for_ci_mppe) {
--      error("MPPE required but peer negotiation failed");
--      lcp_close(f->unit, "MPPE required but peer negotiation failed");
--    }
--#endif
-     return ret;
- }
-@@ -1372,24 +1810,35 @@
-       char *p = result;
-       char *q = result + sizeof(result); /* 1 past result */
--      slprintf(p, q - p, "MPPE ");
--      p += 5;
--      if (opt->mppe & MPPE_OPT_128) {
--          slprintf(p, q - p, "128-bit ");
--          p += 8;
--      }
--      if (opt->mppe & MPPE_OPT_40) {
--          slprintf(p, q - p, "40-bit ");
--          p += 7;
--      }
--      if (opt->mppe & MPPE_OPT_STATEFUL)
--          slprintf(p, q - p, "stateful");
--      else
--          slprintf(p, q - p, "stateless");
--
-+      if (opt->mppe) {
-+          if (opt->mppc) {
-+              slprintf(p, q - p, "MPPC/MPPE ");
-+              p += 10;
-+          } else {
-+              slprintf(p, q - p, "MPPE ");
-+              p += 5;
-+          }
-+          if (opt->mppe_128) {
-+              slprintf(p, q - p, "128-bit ");
-+              p += 8;
-+          } else if (opt->mppe_56) {
-+              slprintf(p, q - p, "56-bit ");
-+              p += 7;
-+          } else if (opt->mppe_40) {
-+              slprintf(p, q - p, "40-bit ");
-+              p += 7;
-+          }
-+          if (opt->mppe_stateless)
-+              slprintf(p, q - p, "stateless");
-+          else
-+              slprintf(p, q - p, "stateful");
-+      } else if (opt->mppc)
-+          slprintf(p, q - p, "MPPC");
-       break;
-     }
--#endif
-+#endif /* MPPE */
-+    case CI_LZS:
-+      return "Stac LZS";
-     case CI_DEFLATE:
-     case CI_DEFLATE_DRAFT:
-       if (opt2 != NULL && opt2->deflate_size != opt->deflate_size)
-@@ -1445,12 +1894,12 @@
-     } else if (ANY_COMPRESS(*ho))
-       notice("%s transmit compression enabled", method_name(ho, NULL));
- #ifdef MPPE
--    if (go->mppe) {
-+    if (go->mppe || go->mppc) {
-       BZERO(mppe_recv_key, MPPE_MAX_KEY_LEN);
-       BZERO(mppe_send_key, MPPE_MAX_KEY_LEN);
-       continue_networks(f->unit);             /* Bring up IP et al */
-     }
--#endif
-+#endif /* MPPE */
- }
- /*
-@@ -1473,7 +1922,7 @@
-           lcp_close(f->unit, "MPPE disabled");
-       }
-     }
--#endif
-+#endif /* MPPE */
- }
- /*
-@@ -1533,24 +1982,28 @@
- #ifdef MPPE
-           case CI_MPPE:
-               if (optlen >= CILEN_MPPE) {
--                  u_char mppe_opts;
--
--                  MPPE_CI_TO_OPTS(&p[2], mppe_opts);
--                  printer(arg, "mppe %s %s %s %s %s %s%s",
--                          (p[2] & MPPE_H_BIT)? "+H": "-H",
--                          (p[5] & MPPE_M_BIT)? "+M": "-M",
--                          (p[5] & MPPE_S_BIT)? "+S": "-S",
--                          (p[5] & MPPE_L_BIT)? "+L": "-L",
-+                  printer(arg, "mppe %s %s %s %s %s %s",
-+                          (p[2] & MPPE_STATELESS)? "+H": "-H",
-+                          (p[5] & MPPE_56BIT)? "+M": "-M",
-+                          (p[5] & MPPE_128BIT)? "+S": "-S",
-+                          (p[5] & MPPE_40BIT)? "+L": "-L",
-                           (p[5] & MPPE_D_BIT)? "+D": "-D",
--                          (p[5] & MPPE_C_BIT)? "+C": "-C",
--                          (mppe_opts & MPPE_OPT_UNKNOWN)? " +U": "");
--                  if (mppe_opts & MPPE_OPT_UNKNOWN)
-+                          (p[5] & MPPE_MPPC)? "+C": "-C");
-+                  if ((p[5] & ~(MPPE_56BIT | MPPE_128BIT | MPPE_40BIT |
-+                                MPPE_D_BIT | MPPE_MPPC)) ||
-+                      (p[2] & ~MPPE_STATELESS))
-                       printer(arg, " (%.2x %.2x %.2x %.2x)",
-                               p[2], p[3], p[4], p[5]);
-                   p += CILEN_MPPE;
-               }
-               break;
--#endif
-+#endif /* MPPE */
-+          case CI_LZS:
-+              if (optlen >= CILEN_LZS) {
-+                  printer(arg, "lzs %.2x %.2x %.2x", p[2], p[3], p[4]);
-+                  p += CILEN_LZS;
-+              }
-+              break;
-           case CI_DEFLATE:
-           case CI_DEFLATE_DRAFT:
-               if (optlen >= CILEN_DEFLATE) {
-@@ -1636,6 +2089,7 @@
-           error("Lost compression sync: disabling compression");
-           ccp_close(unit, "Lost compression sync");
- #ifdef MPPE
-+          /* My module dosn't need this. J.D., 2003-07-06 */
-           /*
-            * If we were doing MPPE, we must also take the link down.
-            */
-@@ -1643,9 +2097,18 @@
-               error("Too many MPPE errors, closing LCP");
-               lcp_close(unit, "Too many MPPE errors");
-           }
--#endif
-+#endif /* MPPE */
-       } else {
-           /*
-+           * When LZS or MPPE/MPPC is negotiated we just send CCP_RESETREQ
-+           * and don't wait for CCP_RESETACK
-+           */
-+          if ((ccp_gotoptions[f->unit].method == CI_LZS) ||
-+              (ccp_gotoptions[f->unit].method == CI_MPPE)) {
-+              fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0);
-+              return;
-+          }
-+          /*
-            * Send a reset-request to reset the peer's compressor.
-            * We don't do that if we are still waiting for an
-            * acknowledgement to a previous reset-request.
-@@ -1676,4 +2139,3 @@
-     } else
-       ccp_localstate[f->unit] &= ~RACK_PENDING;
- }
--
-diff -ruN ppp-2.4.2.orig/pppd/ccp.h ppp-2.4.2-stdopt/pppd/ccp.h
---- ppp-2.4.2.orig/pppd/ccp.h  2002-12-05 00:03:32.000000000 +0100
-+++ ppp-2.4.2-stdopt/pppd/ccp.h        2004-01-21 06:51:09.000000000 +0100
-@@ -42,9 +42,17 @@
-     bool predictor_2;         /* do Predictor-2? */
-     bool deflate_correct;     /* use correct code for deflate? */
-     bool deflate_draft;               /* use draft RFC code for deflate? */
-+    bool lzs;                 /* do Stac LZS? */
-+    bool mppc;                        /* do MPPC? */
-     bool mppe;                        /* do MPPE? */
-+    bool mppe_40;             /* allow 40 bit encryption? */
-+    bool mppe_56;             /* allow 56 bit encryption? */
-+    bool mppe_128;            /* allow 128 bit encryption? */
-+    bool mppe_stateless;      /* allow stateless encryption */
-     u_short bsd_bits;         /* # bits/code for BSD Compress */
-     u_short deflate_size;     /* lg(window size) for Deflate */
-+    u_short lzs_mode;         /* LZS check mode */
-+    u_short lzs_hists;                /* number of LZS histories */
-     short method;             /* code for chosen compression method */
- } ccp_options;
-diff -ruN ppp-2.4.2.orig/pppd/chap_ms.c ppp-2.4.2-stdopt/pppd/chap_ms.c
---- ppp-2.4.2.orig/pppd/chap_ms.c      2003-11-18 11:42:56.000000000 +0100
-+++ ppp-2.4.2-stdopt/pppd/chap_ms.c    2004-01-21 06:51:09.000000000 +0100
-@@ -858,13 +858,17 @@
-     /*
-      * Disable undesirable encryption types.  Note that we don't ENABLE
-      * any encryption types, to avoid overriding manual configuration.
-+     *
-+     * It seems that 56 bit keys are unsupported in MS-RADIUS (see RFC 2548)
-      */
-     switch(types) {
-       case MPPE_ENC_TYPES_RC4_40:
--          ccp_wantoptions[0].mppe &= ~MPPE_OPT_128;   /* disable 128-bit */
-+          ccp_wantoptions[0].mppe_128 = 0;    /* disable 128-bit */
-+          ccp_wantoptions[0].mppe_56 = 0;     /* disable 56-bit */
-           break;
-       case MPPE_ENC_TYPES_RC4_128:
--          ccp_wantoptions[0].mppe &= ~MPPE_OPT_40;    /* disable 40-bit */
-+          ccp_wantoptions[0].mppe_56 = 0;     /* disable 56-bit */
-+          ccp_wantoptions[0].mppe_40 = 0;     /* disable 40-bit */
-           break;
-       default:
-           break;
-diff -ruN ppp-2.4.2.orig/pppd/pppd.8 ppp-2.4.2-stdopt/pppd/pppd.8
---- ppp-2.4.2.orig/pppd/pppd.8 2004-01-15 06:09:00.000000000 +0100
-+++ ppp-2.4.2-stdopt/pppd/pppd.8       2004-01-21 06:51:09.000000000 +0100
-@@ -614,6 +614,9 @@
- Enables the use of PPP multilink; this is an alias for the `multilink'
- option.  This option is currently only available under Linux.
- .TP
-+.B mppc
-+Enables MPPC (Microsoft Point to Point Compression).  This is the default.
-+.TP
- .B mppe-stateful
- Allow MPPE to use stateful mode.  Stateless mode is still attempted first.
- The default is to disallow stateful mode.  
-@@ -749,12 +752,18 @@
- Disables the use of PPP multilink.  This option is currently only
- available under Linux.
- .TP
-+.B nomppc
-+Diasables MPPC (Microsoft Point to Point Compression).
-+.TP
- .B nomppe
- Disables MPPE (Microsoft Point to Point Encryption).  This is the default.
- .TP
- .B nomppe-40
- Disable 40\-bit encryption with MPPE.
- .TP
-+.B nomppe-56
-+Disable 56\-bit encryption with MPPE.
-+.TP
- .B nomppe-128
- Disable 128\-bit encryption with MPPE.
- .TP
-@@ -951,6 +960,9 @@
- .B require-mppe-40
- Require the use of MPPE, with 40\-bit encryption.
- .TP
-+.B require-mppe-56
-+Require the use of MPPE, with 56\-bit encryption.
-+.TP
- .B require-mppe-128
- Require the use of MPPE, with 128\-bit encryption.
- .TP
-diff -ruN ppp-2.4.2.orig/pppd/sha1.c ppp-2.4.2-stdopt/pppd/sha1.c
---- ppp-2.4.2.orig/pppd/sha1.c 2002-04-02 15:54:59.000000000 +0200
-+++ ppp-2.4.2-stdopt/pppd/sha1.c       2004-08-15 15:00:55.000000000 +0200
-@@ -21,7 +21,7 @@
- #include "sha1.h"
- static void
--SHA1_Transform(unsigned long[5], const unsigned char[64]);
-+SHA1_Transform(u_int32_t state[5], const u_int8_t buffer[64]);
- #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
-@@ -42,17 +42,17 @@
- /* Hash a single 512-bit block. This is the core of the algorithm. */
- static void
--SHA1_Transform(unsigned long state[5], const unsigned char buffer[64])
-+SHA1_Transform(u_int32_t state[5], const u_int8_t buffer[64])
- {
--    unsigned long a, b, c, d, e;
-+    u_int32_t a, b, c, d, e;
-     typedef union {
--      unsigned char c[64];
--      unsigned long l[16];
-+      u_int8_t c[64];
-+      u_int32_t l[16];
-     } CHAR64LONG16;
-     CHAR64LONG16 *block;
- #ifdef SHA1HANDSOFF
--    static unsigned char workspace[64];
-+    static u_int8_t workspace[64];
-     block = (CHAR64LONG16 *) workspace;
-     memcpy(block, buffer, 64);
- #else
-@@ -114,9 +114,9 @@
- /* Run your data through this. */
- void
--SHA1_Update(SHA1_CTX *context, const unsigned char *data, unsigned int len)
-+SHA1_Update(SHA1_CTX *context, const u_int8_t *data, u_int32_t len)
- {
--    unsigned int i, j;
-+    u_int32_t i, j;
-     j = (context->count[0] >> 3) & 63;
-     if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++;
-@@ -139,22 +139,24 @@
- /* Add padding and return the message digest. */
- void
--SHA1_Final(unsigned char digest[20], SHA1_CTX *context)
-+SHA1_Final(u_int8_t digest[SHA1_SIGNATURE_SIZE], SHA1_CTX *context)
- {
--    unsigned long i, j;
--    unsigned char finalcount[8];
-+    u_int32_t i, j;
-+    u_int8_t finalcount[8];
-     for (i = 0; i < 8; i++) {
--        finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)]
-+        finalcount[i] = (u_int8_t) ((context->count[(i >= 4 ? 0 : 1)]
-          >> ((3-(i & 3)) * 8) ) & 255);  /* Endian independent */
-     }
--    SHA1_Update(context, (unsigned char *) "\200", 1);
-+    SHA1_Update(context, (u_int8_t *) "\200", 1);
-     while ((context->count[0] & 504) != 448) {
--      SHA1_Update(context, (unsigned char *) "\0", 1);
-+      SHA1_Update(context, (u_int8_t *) "\0", 1);
-     }
-+      
-     SHA1_Update(context, finalcount, 8);  /* Should cause a SHA1Transform() */
-+      
-     for (i = 0; i < 20; i++) {
--      digest[i] = (unsigned char)
-+      digest[i] = (u_int8_t)
-                    ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);
-     }
-     /* Wipe variables */
-@@ -167,4 +169,3 @@
-     SHA1Transform(context->state, context->buffer);
- #endif
- }
--
-diff -ruN ppp-2.4.2.orig/pppd/sha1.h ppp-2.4.2-stdopt/pppd/sha1.h
---- ppp-2.4.2.orig/pppd/sha1.h 2002-11-09 12:24:42.000000000 +0100
-+++ ppp-2.4.2-stdopt/pppd/sha1.h       2004-08-15 15:00:55.000000000 +0200
-@@ -8,6 +8,8 @@
- #ifndef __SHA1_INCLUDE_
-+#include <sys/types.h>
-+
- #ifndef SHA1_SIGNATURE_SIZE
- #ifdef SHA_DIGESTSIZE
- #define SHA1_SIGNATURE_SIZE SHA_DIGESTSIZE
-@@ -17,14 +19,14 @@
- #endif
- typedef struct {
--    unsigned long state[5];
--    unsigned long count[2];
--    unsigned char buffer[64];
-+    u_int32_t state[5];
-+    u_int32_t count[2];
-+    u_int8_t buffer[64];
- } SHA1_CTX;
- extern void SHA1_Init(SHA1_CTX *);
--extern void SHA1_Update(SHA1_CTX *, const unsigned char *, unsigned int);
--extern void SHA1_Final(unsigned char[SHA1_SIGNATURE_SIZE], SHA1_CTX *);
-+extern void SHA1_Update(SHA1_CTX *, const u_int8_t *, u_int32_t);
-+extern void SHA1_Final(u_int8_t[SHA1_SIGNATURE_SIZE], SHA1_CTX *);
- #define __SHA1_INCLUDE_
- #endif /* __SHA1_INCLUDE_ */
diff --git a/obsolete-buildroot/sources/openwrt/patches/pptp-server/poptop-1.1.3-20030409-CCOPTS.patch b/obsolete-buildroot/sources/openwrt/patches/pptp-server/poptop-1.1.3-20030409-CCOPTS.patch
deleted file mode 100644 (file)
index 017d156..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-diff -ruN poptop-old/Makefile.in poptop-new/Makefile.in
---- poptop-old/Makefile.in     2003-02-06 17:39:45.000000000 +0100
-+++ poptop-new/Makefile.in     2004-04-04 15:50:17.000000000 +0200
-@@ -74,8 +74,9 @@
- AUTOMAKE_OPTIONS = no-dependencies foreign
- INCLUDES = -I.
--CFLAGS = -O2 -fno-builtin -Wall -ansi -DSBINDIR='"$(sbindir)"'
--#CFLAGS = -O2 -fno-builtin -Wall -ansi -pedantic -Wmissing-prototypes -Werror -DSBINDIR='"$(sbindir)"'
-+CCOPTS = -O2 -fno-builtin
-+CFLAGS = $(CCOPTS) -Wall -ansi -DSBINDIR='"$(sbindir)"'
-+#CFLAGS = $(CCOPTS) -Wall -ansi -pedantic -Wmissing-prototypes -Werror -DSBINDIR='"$(sbindir)"'
- man_MANS = pptpctrl.8 pptpd.8 pptpd.conf.5
diff --git a/obsolete-buildroot/sources/openwrt/patches/tcpdump/00_debian_tcpdump_3.8.3-3.diff b/obsolete-buildroot/sources/openwrt/patches/tcpdump/00_debian_tcpdump_3.8.3-3.diff
deleted file mode 100644 (file)
index d15724f..0000000
+++ /dev/null
@@ -1,746 +0,0 @@
---- tcpdump-3.8.3.orig/debian/copyright
-+++ tcpdump-3.8.3/debian/copyright
-@@ -0,0 +1,116 @@
-+This package was debianized by Anand Kumria <wildfire@progsoc.org> on
-+Wed, 22 Nov 2000 13:19:33 +1100.
-+It is now maintained by:
-+ + Torsten Landschoff <torsten@debian.org>
-+ + Romain Francoise <rfrancoise@debian.org>
-+
-+It was downloaded from http://tcpdump.org/release/tcpdump-3.8.3.tar.gz
-+
-+Upstream Authors: tcpdump-workers@tcpdump.org
-+
-+Licensed under the 3-clause BSD license: 
-+
-+  Redistribution and use in source and binary forms, with or without
-+  modification, are permitted provided that the following conditions
-+  are met:
-+
-+    1. Redistributions of source code must retain the above copyright
-+       notice, this list of conditions and the following disclaimer.
-+    2. Redistributions in binary form must reproduce the above copyright
-+       notice, this list of conditions and the following disclaimer in
-+       the documentation and/or other materials provided with the
-+       distribution.
-+    3. The names of the authors may not be used to endorse or promote
-+       products derived from this software without specific prior
-+       written permission.
-+
-+  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-+  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-+
-+Current upstream maintainers:
-+      Bill Fenner                     <fenner@research.att.com>
-+      Fulvio Risso                    <risso@polito.it>
-+      Guy Harris                      <guy@alum.mit.edu>
-+      Hannes Gredler                  <hannes@juniper.net>
-+      Jun-ichiro itojun Hagino        <itojun@iijlab.net>
-+      Michael Richardson              <mcr@sandelman.ottawa.on.ca>
-+
-+Additional people who have contributed patches:
-+
-+      Alan Bawden                     <Alan@LCS.MIT.EDU>
-+      Alexey Kuznetsov                <kuznet@ms2.inr.ac.ru>
-+      Albert Chin                     <china@thewrittenword.com>
-+      Andrew Brown                    <atatat@atatdot.net>
-+      Antti Kantee                    <pooka@netbsd.org>
-+      Arkadiusz Miskiewicz            <misiek@pld.org.pl>
-+      Armando L. Caro Jr.             <acaro@mail.eecis.udel.edu>
-+      Assar Westerlund                <assar@sics.se>
-+      Brian Ginsbach                  <ginsbach@cray.com>
-+      Charles M. Hannum               <mycroft@netbsd.org>
-+      Chris G. Demetriou              <cgd@netbsd.org>
-+      Chris Pepper                    <pepper@mail.reppep.com>
-+      Darren Reed                     <darrenr@reed.wattle.id.au>
-+      David Kaelbling                 <drk@sgi.com>
-+      David Young                     <dyoung@ojctech.com>
-+      Don Ebright                     <Don.Ebright@compuware.com> 
-+      Eric Anderson                   <anderse@hpl.hp.com>
-+      Franz Schaefer                  <schaefer@mond.at>
-+      Gianluca Varenni                <varenni@netgroup-serv.polito.it>
-+      Gisle Vanem                     <giva@bgnett.no>
-+      Graeme Hewson                   <ghewson@cix.compulink.co.uk>
-+      Greg Stark                      <gsstark@mit.edu>
-+      Greg Troxel                     <gdt@ir.bbn.com>
-+      Guillaume Pelat                 <endymion_@users.sourceforge.net>
-+      Hyung Sik Yoon                  <hsyn@kr.ibm.com>
-+      Igor Khristophorov              <igor@atdot.org>
-+      Jan-Philip Velders              <jpv@veldersjes.net>
-+      Jason R. Thorpe                 <thorpej@netbsd.org>
-+      Javier Achirica                 <achirica@ttd.net>
-+      Jean Tourrilhes                 <jt@hpl.hp.com>
-+      Jefferson Ogata                 <jogata@nodc.noaa.gov>
-+      Jesper Peterson                 <jesper@endace.com>
-+      John Bankier                    <jbankier@rainfinity.com>
-+      Jon Lindgren                    <jonl@yubyub.net>
-+      Juergen Schoenwaelder           <schoenw@ibr.cs.tu-bs.de>
-+      Kazushi Sugyo                   <sugyo@pb.jp.nec.com>
-+      Klaus Klein                     <kleink@netbsd.org>
-+      Koryn Grant                     <koryn@endace.com>
-+      Krzysztof Halasa                <khc@pm.waw.pl>
-+      Lorenzo Cavallaro               <sullivan@sikurezza.org>
-+      Loris Degioanni                 <loris@netgroup-serv.polito.it>
-+      Love Hörnquist-Åstrand          <lha@stacken.kth.se>
-+      Maciej W. Rozycki               <macro@ds2.pg.gda.pl>
-+      Marcus Felipe Pereira           <marcus@task.com.br>
-+      Martin Husemann                 <martin@netbsd.org>
-+      Mike Wiacek                     <mike@iroot.net>
-+      Monroe Williams                 <monroe@pobox.com>
-+      Octavian Cerna                  <tavy@ylabs.com>
-+      Olaf Kirch                      <okir@caldera.de>
-+      Onno van der Linden             <onno@simplex.nl>
-+      Paul Mundt                      <lethal@linux-sh.org>
-+      Pavel Kankovsky                 <kan@dcit.cz>
-+      Peter Fales                     <peter@fales-lorenz.net>
-+      Peter Jeremy                    <peter.jeremy@alcatel.com.au>
-+      Phil Wood                       <cpw@lanl.gov>
-+      Rafal Maszkowski                <rzm@icm.edu.pl>
-+      Rick Jones                      <raj@cup.hp.com>
-+      Scott Barron                    <sb125499@ohiou.edu>
-+      Scott Gifford                   <sgifford@tir.com>
-+      Sebastian Krahmer               <krahmer@cs.uni-potsdam.de>
-+      Shaun Clowes                    <delius@progsoc.uts.edu.au>
-+      Solomon Peachy                  <pizza@shaftnet.org>
-+      Stefan Hudson                   <hudson@mbay.net>
-+      Takashi Yamamoto                <yamt@mwd.biglobe.ne.jp>
-+      Tony Li                         <tli@procket.com>
-+      Torsten Landschoff              <torsten@debian.org>
-+      Uns Lider                       <unslider@miranda.org>
-+      Uwe Girlich                     <Uwe.Girlich@philosys.de>
-+      Xianjie Zhang                   <xzhang@cup.hp.com>
-+      Yen Yen Lim
-+      Yoann Vandoorselaere            <yoann@prelude-ids.org>
-+
-+The original LBL crew:
-+      Steve McCanne
-+      Craig Leres
-+      Van Jacobson
---- tcpdump-3.8.3.orig/debian/tcpdump.docs
-+++ tcpdump-3.8.3/debian/tcpdump.docs
-@@ -0,0 +1 @@
-+README
---- tcpdump-3.8.3.orig/debian/changelog
-+++ tcpdump-3.8.3/debian/changelog
-@@ -0,0 +1,272 @@
-+tcpdump (3.8.3-3) unstable; urgency=low
-+
-+  * debian/patches/40_ipv6cp.dpatch: New patch, do not try to print IPV6CP
-+    ppp packets, the dissector doesn't support it (closes: #255179).
-+  * debian/patches/00list: Add 40_ipv6cp.
-+
-+ -- Romain Francoise <rfrancoise@debian.org>  Sat, 19 Jun 2004 15:01:27 +0200
-+
-+tcpdump (3.8.3-2) unstable; urgency=low
-+
-+  * debian/rules: Enable crypto support (closes: #82581, #93428).
-+  * debian/control:
-+    + Build-Depend on libssl-dev.
-+    + Put back URL markers in description.
-+    + Switch Maintainer and Uploaders fields to match reality.
-+  * debian/patches/30_openssl_des.dpatch: Patch to make upstream's
-+    configure script check for DES_cbc_encrypt instead of des_cbc_encrypt,
-+    (the function got renamed in OpenSSL 0.9.7), which saves us the hassle
-+    of re-running autoconf.  Temporary hack since upstream has fixed this
-+    in CVS already.
-+  * debian/patches/00list: Add 30_openssl_des.
-+
-+ -- Romain Francoise <rfrancoise@debian.org>  Fri, 14 May 2004 22:14:08 +0200
-+
-+tcpdump (3.8.3-1) unstable; urgency=low
-+
-+  * New upstream release.
-+  * debian/rules:
-+    + Add -D_FILE_OFFSET_BITS=64 to default CFLAGS to match libpcap 
-+      (closes: #154762).
-+    + Use dpatch for patch management.
-+    + Clean up CFLAGS handling.
-+    + Support DEB_BUILD_OPTIONS.
-+  * debian/control: 
-+    + Build-Depend on libpcap0.8-dev, dpatch.
-+    + Add versioned Build-Depends on debhelper.
-+    + Remove Emacs-style URL markers from description.
-+  * debian/compat: New file.
-+  * debian/copyright: Update.
-+  * debian/tcpdump.docs: Do not install upstream INSTALL file.
-+  * debian/patches: New directory.
-+  * debian/patches/10_man_install.dpatch: Patch split off the Debian diff
-+    to change man install paths in upstream Makefile.in.
-+  * debian/patches/20_man_fixes.dpatch: Patch split off the Debian diff to
-+    fix some inconsistencies in the upstream man page.
-+  * debian/patches/00list: New file (patch list).
-+
-+ -- Romain Francoise <rfrancoise@debian.org>  Tue, 11 May 2004 14:02:09 +0200
-+
-+tcpdump (3.7.2-4) unstable; urgency=high
-+
-+  * Urgency high due to security fixes.
-+  * Backport changes from upstream CVS to fix ISAKMP payload handling
-+    denial-of-service vulnerabilities (CAN-2004-0183, CAN-2004-0184).
-+    Detailed changes (with corresponding upstream revisions):
-+    + Add length checks in isakmp_id_print() (print-isakmp.c, rev. 1.47)
-+    + Add data checks all over the place, change rawprint() prototype and
-+      add corresponding return value checks (print-isakmp.c, rev. 1.46)
-+    + Add missing ntohs() and change length initialization in
-+      isakmp_id_print(), not porting prototype changes (print-isakmp.c,
-+      rev. 1.45)
-+  
-+ -- Romain Francoise <rfrancoise@debian.org>  Tue,  6 Apr 2004 19:39:24 +0200
-+
-+tcpdump (3.7.2-3) unstable; urgency=low
-+
-+  * Backport changes from upstream CVS to fix several vulnerabilities in
-+    ISAKMP, L2TP and Radius parsing (closes: #227844, #227845, #227846).
-+
-+ -- Romain Francoise <rfrancoise@debian.org>  Sat, 17 Jan 2004 14:12:30 +0100
-+
-+tcpdump (3.7.2-2) unstable; urgency=low
-+
-+  * Acknowledge NMU by Romain (closes: #208543).
-+  * Apply man page fixes by Romain:
-+    + networks(4) changed to networks(5) (closes: #194180).
-+    + ethers(3N) changed to ethers(5) (closes: #197888).
-+  * debian/control: Added Romain Francoise as co maintainer. Thanks for 
-+    your help, Romain!
-+
-+ -- Torsten Landschoff <torsten@debian.org>  Sun, 19 Oct 2003 04:12:31 +0200
-+
-+tcpdump (3.7.2-1.1) unstable; urgency=low
-+
-+  * NMU
-+  * Reverse order of #include directives in print-sctp.c so that
-+    IPPROTO_SCTP is defined (closes: #208543).
-+
-+ -- Romain Francoise <rfrancoise@debian.org>  Sun, 12 Oct 2003 17:06:01 +0200
-+
-+tcpdump (3.7.2-1) unstable; urgency=low
-+
-+  * New upstream release (closes: #195816).
-+
-+ -- Torsten Landschoff <torsten@debian.org>  Sun,  8 Jun 2003 00:14:44 +0200
-+
-+tcpdump (3.7.1-1.2) unstable; urgency=high
-+
-+  * Non-maintainer upload
-+  * Apply security fixes from 3.7.2
-+    - Fixed infinite loop when parsing malformed isakmp packets.
-+      (CAN-2003-0108)
-+    - Fixed infinite loop when parsing malformed BGP packets.
-+    - Fixed buffer overflow with certain malformed NFS packets.
-+
-+ -- Matt Zimmerman <mdz@debian.org>  Thu, 27 Feb 2003 11:00:32 -0500
-+
-+tcpdump (3.7.1-1.1) unstable; urgency=low
-+
-+  * NMU
-+  * Simple rebuild to deal with libpcap0->libpcap0.7 transition.
-+    Sourceful NMU so that every arch rebuilds it.
-+ 
-+ -- LaMont Jones <lamont@debian.org>  Wed, 14 Aug 2002 21:25:45 -0600
-+
-+tcpdump (3.7.1-1) unstable; urgency=low
-+
-+  * New upstream release (closes: #138052).
-+
-+ -- Torsten Landschoff <torsten@debian.org>  Sat,  3 Aug 2002 23:54:04 +0200
-+
-+tcpdump (3.6.2-2) unstable; urgency=HIGH
-+
-+  * print-rx.c: Take the version from current CVS fixing the remote 
-+    buffer overflow reported in FreeBSD Security Advisory SA-01:48
-+    yesterday. Thanks to Matt Zimmerman for forwarding the report, 
-+    I might have missed it.
-+  * debian/control: Clean the Build-Depends from build-essential 
-+    packages.
-+
-+ -- Torsten Landschoff <torsten@debian.org>  Thu, 19 Jul 2001 15:03:48 +0200
-+
-+tcpdump (3.6.2-1) unstable; urgency=low
-+
-+  * New upstream release.
-+
-+ -- Torsten Landschoff <torsten@debian.org>  Tue,  6 Mar 2001 04:18:16 +0100
-+
-+tcpdump (3.6.1-2) unstable; urgency=low
-+
-+  * debian/rules: Force support for IPv6 (closes: #82665).
-+  * print-icmp6.c: Removed duplicate definition also in icmp6.h to 
-+    get the package to compile with IPv6.
-+  * Rebuild should fix the missing libpcap0-dependency (closes: #82666).
-+    Additional info: The missing dependency was because the configure 
-+    script found my libpcap sources in the parent directory. Black magic
-+    always works against you :(
-+
-+ -- Torsten Landschoff <torsten@debian.org>  Thu, 18 Jan 2001 00:44:01 +0100
-+
-+tcpdump (3.6.1-1) unstable; urgency=high
-+
-+  * Taking back the package. Kudos to Anand for his help.
-+  * New upstream release. This release fixes a security hole in print-rx.c.
-+  * debian/rules: Disable crypto support (closes: #81969).
-+  * Removed empty README.Debian (closes: #81966).
-+
-+ -- Torsten Landschoff <torsten@debian.org>  Tue, 16 Jan 2001 16:04:03 +0100
-+
-+tcpdump (3.5.2-3) unstable; urgency=low
-+
-+  * Fixup dependancy stuff. Sheesh. (Closes: #78063, #78081, #78082)
-+
-+ -- Anand Kumria <wildfire@progsoc.org>  Tue, 28 Nov 2000 02:16:01 +1100
-+
-+tcpdump (3.5.2-2) unstable; urgency=low
-+
-+  * Update both config.guess and config.sub (Closes: #36692, #53145)
-+  * Opps, make the .diff available. 
-+  * We require a particular libpcap version to work (Closes: #77877)
-+
-+ -- Anand Kumria <wildfire@progsoc.org>  Mon, 27 Nov 2000 01:13:55 +1100
-+
-+tcpdump (3.5.2-1) unstable; urgency=low
-+
-+  * New Maintainer
-+  * New upstream release (Closes: #75889)
-+  * Upstream added hex dump (-x) and ascii dump (-X) Closes: #23514, #29418)
-+  * Acknowledge and incorporate security fixes (Closes: #63708, #77489)
-+  * Appletalk / Ethertalk patches are in (Closes: #67642)
-+
-+ -- Anand Kumria <wildfire@progsoc.org>  Wed, 22 Nov 2000 13:19:33 +1100
-+
-+tcpdump (3.4a6-4.1) frozen unstable; urgency=high
-+
-+  * Non-maintainer upload by security team
-+  * Apply patch from tcpdump-workers mailinglist to fix DNS DoS attack
-+    against tcpdump. Based on patch from Guy Harris <gharris@flashcom.net> as
-+    found on http://www.tcpdump.org/lists/workers/1999/msg00607.html
-+  * Fix Build-Depends entry in debian/control
-+
-+ -- Wichert Akkerman <wakkerma@debian.org>  Sun,  7 May 2000 15:17:33 +0200
-+
-+tcpdump (3.4a6-4) unstable; urgency=low
-+
-+  * New maintainer.
-+  * tcpdump.c (main): Reestablish priviliges before closing the device
-+    (closes: #19959).
-+  * It seems the problem with ppp came from the kernel - I can dump 
-+    packages on ppp0 just fine... (closes: #25757)
-+  * print-tcp.c (tcp_print): Applied patch from David S. Miller submitted 
-+    by Andrea Arcangeli to fix tcpdump sack TCP option interpretation 
-+    (closes: #28530).
-+  * print-bootp.c (rfc1048_print): Interpret timezone offset as signed
-+    (closes: #40376). Fixed byte order problem in printing internet 
-+    addresses (closes: #40375). Thanks to Roderick Schertler for the patch.
-+  * Several files: Applied SMB patch from samba.org (closes: #27653).
-+  * print-ip.c (ip_print): Check for ip headers with less than 5 longs. 
-+    Patch taken from RedHat's source package.
-+  * Redid debian/rules using debhelper.
-+  * Makefile.in: Install the manpage into man8 instead of man1. 
-+  * tcpdump.1: Moved to section 8 (admin commands).
-+  * print-smb.c (print_smb): Disabled anything but printing the command 
-+    info by default. Otherwise we would get flooded with smb information.
-+    You can get all info using -vvv. Two -v's will give you the SMB headers.
-+  * tcpdump.1: Documented the behaviour described above.
-+
-+ -- Torsten Landschoff <torsten@debian.org>  Mon, 22 Nov 1999 01:31:44 +0100
-+
-+tcpdump (3.4a6-3) frozen unstable; urgency=low
-+
-+  * fixed permissions
-+
-+ -- Peter Tobias <tobias@et-inf.fho-emden.de>  Mon, 30 Mar 1998 02:28:39 +0200
-+
-+
-+tcpdump (3.4a6-2) frozen unstable; urgency=low
-+
-+  * rebuild with latest debmake, fixes #19415
-+    (should also fix the lintian warnings)
-+  * updated standards-version
-+
-+ -- Peter Tobias <tobias@et-inf.fho-emden.de>  Mon, 30 Mar 1998 00:28:39 +0200
-+
-+
-+tcpdump (3.4a6-1) unstable; urgency=low
-+
-+  * updated to latest upstream version, fixes: Bug#17163
-+  * install changelog.Debian compressed, fixes: Bug#15417
-+
-+ -- Peter Tobias <tobias@et-inf.fho-emden.de>  Sun,  1 Feb 1998 00:08:31 +0100
-+
-+
-+tcpdump (3.4a4-1) unstable; urgency=low
-+
-+  * updated to latest upstream version
-+  * libc6 version
-+
-+ -- Peter Tobias <tobias@et-inf.fho-emden.de>  Wed, 17 Sep 1997 23:22:54 +0200
-+
-+
-+tcpdump (3.3.1a2-1) frozen stable unstable; urgency=medium
-+
-+  * updated to latest upstream version (works with new libpcap now)
-+
-+ -- Peter Tobias <tobias@et-inf.fho-emden.de>  Sat, 24 May 1997 00:49:17 +0200
-+
-+
-+tcpdump (3.3-2) unstable; urgency=low
-+
-+  * fixed SLIP support
-+
-+ -- Peter Tobias <tobias@et-inf.fho-emden.de>  Sun, 16 Feb 1997 21:06:51 +0100
-+
-+
-+tcpdump (3.3-1) unstable; urgency=low
-+
-+  * updated to latest upstream version
-+
-+ -- Peter Tobias <tobias@et-inf.fho-emden.de>  Thu, 16 Jan 1997 01:34:00 +0100
-+
-+
---- tcpdump-3.8.3.orig/debian/control
-+++ tcpdump-3.8.3/debian/control
-@@ -0,0 +1,23 @@
-+Source: tcpdump
-+Section: net
-+Priority: optional
-+Maintainer: Romain Francoise <rfrancoise@debian.org>
-+Uploaders: Torsten Landschoff <torsten@debian.org>
-+Build-Depends: debhelper (>= 4), libpcap0.8-dev, dpatch, libssl-dev
-+Standards-Version: 3.6.1.0
-+
-+Package: tcpdump
-+Architecture: any
-+Depends: ${shlibs:Depends}
-+Description: A powerful tool for network monitoring and data acquisition
-+ This program allows you to dump the traffic on a network. tcpdump 
-+ is able to examine IPv4, ICMPv4, IPv6, ICMPv6, UDP, TCP, SNMP, AFS
-+ BGP, RIP, PIM, DVMRP, IGMP, SMB, OSPF, NFS and many other packet
-+ types.
-+ .
-+ It can be used to print out the headers of packets on a network 
-+ interface, filter packets that match a certain expression. You can 
-+ use this tool to track down network problems, to detect "ping attacks" 
-+ or to monitor network activities. 
-+ .
-+ Further information is available at <URL: http://www.tcpdump.org/>
---- tcpdump-3.8.3.orig/debian/tcpdump.dirs
-+++ tcpdump-3.8.3/debian/tcpdump.dirs
-@@ -0,0 +1 @@
-+usr/sbin
---- tcpdump-3.8.3.orig/debian/tcpdump.examples
-+++ tcpdump-3.8.3/debian/tcpdump.examples
-@@ -0,0 +1,4 @@
-+atime.awk
-+packetdat.awk
-+send-ack.awk
-+stime.awk
---- tcpdump-3.8.3.orig/debian/rules
-+++ tcpdump-3.8.3/debian/rules
-@@ -0,0 +1,70 @@
-+#!/usr/bin/make -f
-+
-+include /usr/share/dpatch/dpatch.make
-+
-+export DH_VERBOSE=1
-+
-+dstdir := $(shell pwd)/debian/tcpdump
-+
-+export CFLAGS=-D_FILE_OFFSET_BITS=64
-+
-+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-+        CFLAGS += -O0
-+endif
-+
-+build: patch build-stamp
-+build-stamp:
-+      dh_testdir
-+
-+      ./configure --prefix=/usr --mandir=\$${prefix}/share/man        \
-+              --infodir=\$${prefix}/share/info --enable-ipv6
-+      $(MAKE)
-+
-+      touch build-stamp
-+
-+clean: clean-patched unpatch
-+clean-patched:
-+      dh_testdir
-+      dh_testroot
-+      rm -f build-stamp
-+
-+      -$(MAKE) distclean
-+
-+      dh_clean
-+
-+install: build
-+      dh_testdir
-+      dh_testroot
-+      dh_clean -k
-+      dh_installdirs
-+
-+      $(MAKE) install prefix=$(dstdir)/usr
-+
-+
-+# Build architecture-independent files here.
-+binary-indep: build install
-+# We have nothing to do by default.
-+
-+# Build architecture-dependent files here.
-+binary-arch: build install
-+#     dh_testversion
-+      dh_testdir
-+      dh_testroot
-+      dh_installdocs
-+      dh_installexamples
-+      dh_installinfo
-+      dh_installchangelogs CHANGES
-+      dh_link
-+      dh_strip
-+      dh_compress
-+      dh_fixperms
-+#     dh_makeshlibs
-+      dh_installdeb
-+#     dh_perl
-+      dh_shlibdeps
-+      dh_gencontrol
-+      dh_md5sums
-+      dh_builddeb
-+
-+binary: binary-indep binary-arch
-+.PHONY: build clean binary-indep binary-arch binary install
---- tcpdump-3.8.3.orig/debian/patches/10_man_install.dpatch
-+++ tcpdump-3.8.3/debian/patches/10_man_install.dpatch
-@@ -0,0 +1,46 @@
-+#! /bin/sh -e
-+## 10_man_install.dpatch by Romain Francoise <rfrancoise@debian.org>
-+##
-+## All lines beginning with `## DP:' are a description of the patch.
-+## DP: Change man page install paths for Debian.
-+
-+if [ $# -lt 1 ]; then
-+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-+    exit 1
-+fi
-+
-+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
-+
-+case "$1" in
-+    -patch) patch -p1 ${patch_opts} < $0;;
-+    -unpatch) patch -R -p1 ${patch_opts} < $0;;
-+    *)
-+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-+        exit 1;;
-+esac
-+
-+exit 0
-+
-+@DPATCH@
-+diff -urNad /home/romain/Work/Debian/tcpdump/tcpdump-3.8.3/Makefile.in tcpdump-3.8.3/Makefile.in
-+--- /home/romain/Work/Debian/tcpdump/tcpdump-3.8.3/Makefile.in        2004-05-08 09:12:28.000000000 +0200
-++++ tcpdump-3.8.3/Makefile.in 2004-05-08 09:13:23.000000000 +0200
-+@@ -157,13 +157,13 @@
-+      [ -d $(DESTDIR)$(sbindir) ] || \
-+          (mkdir -p $(DESTDIR)$(sbindir); chmod 755 $(DESTDIR)$(sbindir))
-+      $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG)
-+-     [ -d $(DESTDIR)$(mandir)/man1 ] || \
-+-         (mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1)
-+-     $(INSTALL_DATA) $(srcdir)/$(PROG).1 $(DESTDIR)$(mandir)/man1/$(PROG).1
-++     [ -d $(DESTDIR)$(mandir)/man8 ] || \
-++         (mkdir -p $(DESTDIR)$(mandir)/man8; chmod 755 $(DESTDIR)$(mandir)/man8)
-++     $(INSTALL_DATA) $(srcdir)/$(PROG).1 $(DESTDIR)$(mandir)/man8/$(PROG).8
-+ 
-+ uninstall:
-+      rm -f $(DESTDIR)$(sbindir)/$(PROG)
-+-     rm -f $(DESTDIR)$(mandir)/man1/$(PROG).1
-++     rm -f $(DESTDIR)$(mandir)/man8/$(PROG).8
-+ 
-+ lint: $(GENSRC)
-+      lint -hbxn $(SRC) | \
---- tcpdump-3.8.3.orig/debian/patches/00list
-+++ tcpdump-3.8.3/debian/patches/00list
-@@ -0,0 +1,4 @@
-+10_man_install
-+20_man_fixes
-+30_openssl_des
-+40_ipv6cp
---- tcpdump-3.8.3.orig/debian/patches/20_man_fixes.dpatch
-+++ tcpdump-3.8.3/debian/patches/20_man_fixes.dpatch
-@@ -0,0 +1,67 @@
-+#! /bin/sh -e
-+## 20_man_fixes.dpatch by Romain Francoise <rfrancoise@debian.org>
-+##
-+## All lines beginning with `## DP:' are a description of the patch.
-+## DP: Misc. fixes to the upstream man page.
-+
-+if [ $# -lt 1 ]; then
-+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-+    exit 1
-+fi
-+
-+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
-+
-+case "$1" in
-+    -patch) patch -p1 ${patch_opts} < $0;;
-+    -unpatch) patch -R -p1 ${patch_opts} < $0;;
-+    *)
-+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-+        exit 1;;
-+esac
-+
-+exit 0
-+
-+@DPATCH@
-+diff -urNad /home/romain/Work/Debian/tcpdump/tcpdump-3.8.3/tcpdump.1 tcpdump-3.8.3/tcpdump.1
-+--- /home/romain/Work/Debian/tcpdump/tcpdump-3.8.3/tcpdump.1  2004-05-08 09:12:32.000000000 +0200
-++++ tcpdump-3.8.3/tcpdump.1   2004-05-08 09:18:27.000000000 +0200
-+@@ -22,7 +22,7 @@
-+ .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
-+ .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-+ .\"
-+-.TH TCPDUMP 1  "7 January 2004"
-++.TH TCPDUMP 8  "8 May 2004"
-+ .SH NAME
-+ tcpdump \- dump traffic on a network
-+ .SH SYNOPSIS
-+@@ -672,7 +672,7 @@
-+ True if the ethernet destination address is \fIehost\fP.
-+ \fIEhost\fP
-+ may be either a name from /etc/ethers or a number (see
-+-.IR ethers (3N)
-++.IR ethers (5)
-+ for numeric format).
-+ .IP "\fBether src \fIehost\fP
-+ True if the ethernet source address is \fIehost\fP.
-+@@ -699,7 +699,7 @@
-+ True if the IPv4/v6 destination address of the packet has a network
-+ number of \fInet\fP.
-+ \fINet\fP may be either a name from /etc/networks
-+-or a network number (see \fInetworks(4)\fP for details).
-++or a network number (see \fInetworks(5)\fP for details).
-+ .IP "\fBsrc net \fInet\fR"
-+ True if the IPv4/v6 source address of the packet has a network
-+ number of \fInet\fP.
-+@@ -718,9 +718,9 @@
-+ True if the packet is ip/tcp, ip/udp, ip6/tcp or ip6/udp and has a
-+ destination port value of \fIport\fP.
-+ The \fIport\fP can be a number or a name used in /etc/services (see
-+-.IR tcp (4P)
-++.IR tcp (7)
-+ and
-+-.IR udp (4P)).
-++.IR udp (7)).
-+ If a name is used, both the port
-+ number and protocol are checked.
-+ If a number or ambiguous name is used,
---- tcpdump-3.8.3.orig/debian/patches/30_openssl_des.dpatch
-+++ tcpdump-3.8.3/debian/patches/30_openssl_des.dpatch
-@@ -0,0 +1,57 @@
-+#! /bin/sh -e
-+## 30_openssl_des.dpatch by Romain Francoise <rfrancoise@debian.org> 
-+##
-+## All lines beginning with `## DP:' are a description of the patch.
-+## DP: Change "des_cbc_encrypt" check to "DES_cbc_encrypt" since it
-+## DP: got renamed in OpenSSL 0.9.7.  Super-ugly change to configure,
-+## DP: but it's simpler this way (changing configure.in too while we're
-+## DP: at it).
-+
-+if [ $# -lt 1 ]; then
-+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-+    exit 1
-+fi
-+
-+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
-+
-+case "$1" in
-+    -patch) patch -p1 ${patch_opts} < $0;;
-+    -unpatch) patch -R -p1 ${patch_opts} < $0;;
-+    *)
-+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-+        exit 1;;
-+esac
-+
-+exit 0
-+
-+@DPATCH@
-+diff -urNad /home/romain/Work/Debian/tcpdump/tcpdump-3.8.3/configure tcpdump-3.8.3/configure
-+--- /home/romain/Work/Debian/tcpdump/tcpdump-3.8.3/configure  2004-03-28 23:06:09.000000000 +0200
-++++ tcpdump-3.8.3/configure   2004-05-14 21:58:56.000000000 +0200
-+@@ -9760,11 +9760,11 @@
-+ #endif
-+ /* We use char because int might match the return type of a gcc2
-+    builtin and then its argument prototype would still apply.  */
-+-char des_cbc_encrypt ();
-++char DES_cbc_encrypt ();
-+ int
-+ main ()
-+ {
-+-des_cbc_encrypt ();
-++DES_cbc_encrypt ();
-+   ;
-+   return 0;
-+ }
-+diff -urNad /home/romain/Work/Debian/tcpdump/tcpdump-3.8.3/configure.in tcpdump-3.8.3/configure.in
-+--- /home/romain/Work/Debian/tcpdump/tcpdump-3.8.3/configure.in       2004-03-28 23:04:48.000000000 +0200
-++++ tcpdump-3.8.3/configure.in        2004-05-14 21:58:11.000000000 +0200
-+@@ -732,7 +732,7 @@
-+      if test -f $ac_cv_ssleay_path/lib/librsaref.a; then
-+              LIBS="$LIBS -lrsaref"
-+      fi
-+-     AC_CHECK_LIB(crypto, des_cbc_encrypt)
-++     AC_CHECK_LIB(crypto, DES_cbc_encrypt)
-+ 
-+      CPPFLAGS="$CPPFLAGS $V_INCLS"
-+      AC_CHECK_HEADERS(openssl/evp.h)
---- tcpdump-3.8.3.orig/debian/patches/40_ipv6cp.dpatch
-+++ tcpdump-3.8.3/debian/patches/40_ipv6cp.dpatch
-@@ -0,0 +1,45 @@
-+#! /bin/sh -e
-+## 40_ipv6cp.dpatch by Romain Francoise <rfrancoise@debian.org>
-+##
-+## All lines beginning with `## DP:' are a description of the patch.
-+## DP: Do not try to grok IPV6CP packets, the dissector doesn't 
-+## DP: support it.
-+
-+if [ $# -lt 1 ]; then
-+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-+    exit 1
-+fi
-+
-+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
-+
-+case "$1" in
-+    -patch) patch -p1 ${patch_opts} < $0;;
-+    -unpatch) patch -R -p1 ${patch_opts} < $0;;
-+    *)
-+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-+        exit 1;;
-+esac
-+
-+exit 0
-+
-+@DPATCH@
-+diff -urNad /home/romain/Work/Debian/tcpdump/tcpdump-3.8.3/print-ppp.c tcpdump-3.8.3/print-ppp.c
-+--- /home/romain/Work/Debian/tcpdump/tcpdump-3.8.3/print-ppp.c        2004-04-17 00:25:32.000000000 +0200
-++++ tcpdump-3.8.3/print-ppp.c 2004-06-19 14:54:40.000000000 +0200
-+@@ -1056,7 +1056,6 @@
-+      case PPP_IPCP:
-+      case PPP_OSICP:
-+      case PPP_MPLSCP:
-+-     case PPP_IPV6CP:
-+      case PPP_CCP:
-+      case PPP_BACP:
-+              handle_ctrl_proto(proto, p, length);
-+@@ -1077,6 +1076,7 @@
-+ #ifdef INET6
-+      case ETHERTYPE_IPV6:    /*XXX*/
-+      case PPP_IPV6:
-++     case PPP_IPV6CP:
-+              ip6_print(p, length);
-+              break;
-+ #endif
---- tcpdump-3.8.3.orig/debian/compat
-+++ tcpdump-3.8.3/debian/compat
-@@ -0,0 +1 @@
-+4
diff --git a/obsolete-buildroot/sources/openwrt/patches/vsftpd/vsftpd-1.2.2-openwrt.patch b/obsolete-buildroot/sources/openwrt/patches/vsftpd/vsftpd-1.2.2-openwrt.patch
deleted file mode 100644 (file)
index b458f41..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-diff -ruN vsftpd-1.2.2-old/Makefile vsftpd-1.2.2-new/Makefile
---- vsftpd-1.2.2-old/Makefile  2003-09-15 13:41:58.000000000 +0200
-+++ vsftpd-1.2.2-new/Makefile  2004-05-25 00:25:37.000000000 +0200
-@@ -5,8 +5,8 @@
- #CFLAGS = -g
- CFLAGS        =       -O2 -Wall -W -Wshadow #-pedantic -Werror -Wconversion
--LIBS  =       `./vsf_findlibs.sh`
--LINK  =       -Wl,-s
-+LIBS  =       -lcrypt -lnsl
-+LINK  =
- OBJS  =       main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o \
-               tunables.o ftpdataio.o secbuf.o ls.o \
-diff -ruN vsftpd-1.2.2-old/tunables.c vsftpd-1.2.2-new/tunables.c
---- vsftpd-1.2.2-old/tunables.c        2004-04-20 02:25:05.000000000 +0200
-+++ vsftpd-1.2.2-new/tunables.c        2004-05-25 00:07:19.000000000 +0200
-@@ -78,7 +78,7 @@
- unsigned int tunable_max_per_ip = 0;
- unsigned int tunable_trans_chunk_size = 0;
--const char* tunable_secure_chroot_dir = "/usr/share/empty";
-+const char* tunable_secure_chroot_dir = "/var/run/vsftpd";
- const char* tunable_ftp_username = "ftp";
- const char* tunable_chown_username = "root";
- const char* tunable_xferlog_file = "/var/log/xferlog";
diff --git a/obsolete-buildroot/sources/openwrt/patches/wrt54g-router.patch b/obsolete-buildroot/sources/openwrt/patches/wrt54g-router.patch
deleted file mode 100644 (file)
index 5a9b1ea..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-diff -bBurN WRT54G/release/src/router/rc/Makefile-openwrt WRT54G.new/release/src/router/rc/Makefile-openwrt
---- WRT54G/release/src/router/rc/Makefile-openwrt      1969-12-31 18:00:00.000000000 -0600
-+++ WRT54G.new/release/src/router/rc/Makefile-openwrt  2004-03-03 16:23:40.000000000 -0600
-@@ -0,0 +1,44 @@
-+# Copyright 2001-2003, Broadcom Corporation
-+# All Rights Reserved.
-+#
-+#
-+# THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
-+# KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE.  BROADCOM
-+# SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
-+# FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE
-+#
-+
-+#
-+# Router Wireless Interface Configuration Utility Makefile
-+#
-+# Copyright 2003, Broadcom Corporation
-+# All Rights Reserved.                
-+#                                     
-+#
-+# $Id: Makefile,v 1.2 2004/01/13 00:55:58 mbm Exp $
-+#
-+
-+CFLAGS        += -I. -I$(TOP)/shared -I$(SRCBASE)/include -Wall
-+#CFLAGS       += -g -DDEBUG
-+CFLAGS        += -s -Os
-+LDFLAGS       += -L$(TOP)/shared -lshared -L$(TOP)/nvram -lnvram
-+
-+OBJS := mtd.o crc.o #http.o
-+
-+vpath %.c $(TOP)/shared $(SRCBASE)/rts/src
-+
-+all: mtd
-+
-+clean:
-+      rm -f *.o mtd
-+
-+install: all
-+      install -d $(INSTALLDIR)/sbin
-+      install mtd $(INSTALLDIR)/sbin
-+      $(STRIP) $(INSTALLDIR)/sbin/mtd
-+
-+mtd.o: mtd.c
-+      $(CC) -c $^ $(CFLAGS) $(CPPFLAGS) -DOPENWRT_MTD #-DOPENWRT_MTD_HTTP_GET
-+
-+mtd: $(OBJS)
-+      $(CC) -o $@ $^ $(LDFLAGS)
-diff -bBurN WRT54G/release/src/router/rc/mtd.c WRT54G.new/release/src/router/rc/mtd.c
---- WRT54G/release/src/router/rc/mtd.c 2004-01-19 20:34:50.000000000 -0600
-+++ WRT54G.new/release/src/router/rc/mtd.c     2004-03-03 16:24:42.000000000 -0600
-@@ -37,6 +37,86 @@
- #include <cy_conf.h>
- #include <utils.h>
-+
-+#ifdef OPENWRT_MTD
-+
-+extern int
-+mtd_open(const char *mtd, int flags);
-+extern int
-+mtd_erase(const char *mtd);
-+extern int
-+mtd_write(const char *path, const char *mtd);
-+
-+/* Slightly modified version of mtd_erase. */
-+int
-+mtd_unlock(const char *mtd)
-+{
-+      int mtd_fd;
-+      mtd_info_t mtd_info;
-+      erase_info_t erase_info;
-+
-+      /* Open MTD device */
-+      if ((mtd_fd = mtd_open(mtd, O_RDWR)) < 0) {
-+              perror(mtd);
-+              return errno;
-+      }
-+
-+      /* Get sector size */
-+      if (ioctl(mtd_fd, MEMGETINFO, &mtd_info) != 0) {
-+              perror(mtd);
-+              close(mtd_fd);
-+              return errno;
-+      }
-+
-+      erase_info.length = mtd_info.erasesize;
-+
-+      for (erase_info.start = 0;
-+           erase_info.start < mtd_info.size;
-+           erase_info.start += mtd_info.erasesize) {
-+              (void) ioctl(mtd_fd, MEMUNLOCK, &erase_info);
-+/*            if (ioctl(mtd_fd, MEMERASE, &erase_info) != 0) { */
-+/*                    perror(mtd); */
-+/*            close(mtd_fd); */
-+/*                    return errno; */
-+/*            } */
-+      }
-+
-+      close(mtd_fd);
-+      return 0;
-+}
-+
-+int main(int argc, char **argv) {
-+      if(argc == 3 && strcasecmp(argv[1],"unlock")==0) {
-+              printf("Unlocking %s\n",argv[2]);
-+              return mtd_unlock(argv[2]);
-+      }
-+      if(argc == 3 && strcasecmp(argv[1],"erase")==0) {
-+              printf("Erasing %s\n",argv[2]);
-+              return mtd_erase(argv[2]);
-+      }
-+      if(argc == 4 && strcasecmp(argv[1],"write")==0) {
-+              printf("writing %s to %s\n",argv[2],argv[3]);
-+              return mtd_write(argv[2],argv[3]);
-+      }
-+
-+      printf("no valid command given\n");
-+      return -1;
-+}
-+
-+#ifndef OPENWRT_MTD_HTTP_GET
-+/* Dummy routines when no http support. */
-+int
-+http_get(const char *server, char *buf, size_t count, off_t offset)
-+{
-+      printf("error opening %s\n",server);
-+      exit(-1);
-+}
-+#endif
-+
-+#define check_action()                (fp ? ACT_IDLE : ACT_WEBS_UPGRADE)
-+
-+#endif
-+
- /*
-  * Open an MTD device
-  * @param     mtd     path to or partition name of MTD device
-diff -bBurN WRT54G/release/src/router/shared/Makefile-openwrt WRT54G.new/release/src/router/shared/Makefile-openwrt
---- WRT54G/release/src/router/shared/Makefile-openwrt  1969-12-31 18:00:00.000000000 -0600
-+++ WRT54G.new/release/src/router/shared/Makefile-openwrt      2004-03-03 12:39:17.000000000 -0600
-@@ -0,0 +1,41 @@
-+#
-+# Linux router shared code Makefile
-+#
-+# Copyright 2001-2003, Broadcom Corporation
-+# All Rights Reserved.
-+# 
-+# THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
-+# KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
-+# SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
-+# FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
-+#
-+# $Id: Makefile,v 1.3 2004/01/13 00:51:09 mbm Exp $
-+#
-+ifneq ($(wildcard $(SRCBASE)/cy_conf.mak),)
-+  include $(SRCBASE)/cy_conf.mak
-+endif
-+
-+CFLAGS        += -I. -I$(SRCBASE)/include -Wall -I$(SRCBASE)/
-+#CFLAGS       += -g -DDEBUG
-+CFLAGS        += -s -Os
-+LDFLAGS += -L.
-+
-+all: libshared.so
-+
-+install: all
-+      install -d $(INSTALLDIR)/usr/lib
-+      install -m 755 libshared.so $(INSTALLDIR)/usr/lib
-+      $(STRIP) $(INSTALLDIR)/usr/lib/libshared.so
-+
-+clean:
-+      rm -f *.o *.so
-+
-+libshared.so: shutils.o wl.o wl_linux.o defaults.o linux_timer.o
-+      $(LD) -shared -o $@ $^
-+
-+build_date.o: build_date.c
-+
-+build_date:
-+      echo "const char *builddate = \"`date`\";" > build_date.c
-+
-+*.o: $(CY_DEPS)
-diff -bBurN WRT54GS/release/src/router/nvram/nvram_linux.c-dist WRT54GS.new/release/src/router/nvram/nvram_linux.c
---- WRT54GS/release/src/router/nvram/nvram_linux.c-dist        2004-03-30 10:04:10.000000000 -0600
-+++ WRT54GS/release/src/router/nvram/nvram_linux.c     2004-03-30 10:10:09.000000000 -0600
-@@ -27,8 +27,10 @@
- #include <typedefs.h>
- #include <bcmnvram.h>
- #include <nvram_convert.h>
-+#ifndef OPENWRT_NVRAM
- #include <shutils.h>
- #include <utils.h>
-+#endif
- #define PATH_DEV_NVRAM "/dev/nvram"
-@@ -182,6 +184,20 @@
- {
-       int ret;
-       
-+#ifdef OPENWRT_NVRAM
-+      fprintf(stderr, "nvram_commit(): start\n");     
-+      
-+      if (nvram_fd < 0)
-+              if ((ret = nvram_init(NULL)))
-+                      return ret;
-+
-+      ret = ioctl(nvram_fd, NVRAM_MAGIC, NULL);
-+
-+      if (ret < 0)
-+              perror(PATH_DEV_NVRAM);
-+      
-+      fprintf(stderr, "nvram_commit(): end\n");       
-+#else
-       cprintf("nvram_commit(): start\n");     
-       
-       if((check_action() == ACT_IDLE) || 
-@@ -200,6 +216,7 @@
-       }
-       else
-               cprintf("nvram_commit():  nothing to do...\n");
-+#endif
-       return ret;
- }
-@@ -272,6 +289,7 @@
-    return j;
- }  
-+#ifndef OPENWRT_NVRAM
- int
- check_action(void)
- {
-@@ -318,3 +336,5 @@
-       return 0;
- }
-+
-+#endif
diff --git a/obsolete-buildroot/sources/openwrt/patches/wrt54g-shared.patch b/obsolete-buildroot/sources/openwrt/patches/wrt54g-shared.patch
deleted file mode 100644 (file)
index c9af620..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- WRT54G/release/src/shared/sbpci.c-dist     2004-03-15 13:13:37.000000000 -0600
-+++ WRT54G/release/src/shared/sbpci.c  2004-03-15 13:15:38.000000000 -0600
-@@ -269,7 +269,7 @@
-       sb_core_reset(sbh, 0);
-       /* In some board, */ 
--      if(nvram_match("boardtype", "bcm94710dev"))
-+      if(nvram_match("boardtype", "bcm94710dev") || nvram_match("boardtype", "bcm94710ap") || nvram_match("boardtype", "bcm94710r4"))
-               CT4712_WR = 0;
-       else
-               CT4712_WR = 1;
diff --git a/obsolete-buildroot/sources/openwrt/root/bin/firstboot b/obsolete-buildroot/sources/openwrt/root/bin/firstboot
deleted file mode 100755 (executable)
index 5076d1c..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-# $Id$
-
-
-[ -f "/tmp/.firstboot" ] && {
-       echo "firstboot is already running"
-       return
-}
-touch /tmp/.firstboot
-
-jdev=$(mount | awk '/jffs2/ {print $3}')
-
-if [ -z "$jdev" ]; then
-       echo -n "Creating jffs2 partition... "
-       mtd erase OpenWrt >&- 
-       mount -t jffs2 /dev/mtdblock/4 /jffs
-       echo "done"
-       cd /jffs
-else
-       echo "firstboot has already been run"
-       echo "jffs2 partition is mounted, only resetting files"
-       cd $jdev
-fi
-
-exec 2>/dev/null
-
-mount /dev/mtdblock/2 /rom -o ro
-
-echo -n "creating directories... "
-{
-       cd /rom
-       find . -type d
-       cd -
-} | xargs mkdir
-echo "done"
-
-echo -n "setting up symlinks... "
-for file in $(cd /rom; find *  -type f; find *  -type l;)
-do {
-       ln -sf  /rom/$file $file
-} done
-echo "done"
-
-touch /tmp/resolv.conf
-ln -s /tmp/resolv.conf /etc/resolv.conf
-
-umount /rom
-mount none /jffs/proc -t proc
-pivot_root /jffs /jffs/rom
-mount none /dev  -t devfs
-mount none /tmp  -t ramfs
-umount /rom/proc
-umount /rom/tmp
-umount /rom/dev
diff --git a/obsolete-buildroot/sources/openwrt/root/bin/ipkg b/obsolete-buildroot/sources/openwrt/root/bin/ipkg
deleted file mode 100755 (executable)
index bf275d8..0000000
+++ /dev/null
@@ -1,1185 +0,0 @@
-#!/bin/sh
-# ipkg - the itsy package management system
-#
-# Copyright (C) 2001 Carl D. Worth
-#
-# 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, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-set -e
-
-# By default do not do globbing. Any command wanting globbing should
-# explicitly enable it first and disable it afterwards.
-set -o noglob
-
-ipkg_is_upgrade () {
-  local A B a b
-  A=$(echo $1 | sed "s/[0-9]*/ & /g")
-  B=$(echo $2 | sed "s/[0-9]*/ & /g")
-  while [ \! -z "$A" ] && [ \! -z "$B" ]; do {
-    set $A; a=$1; shift; A=$*
-    set $B; b=$1; shift; B=$*
-    { [ "$a" -gt "$b" ] 2>&- || [ "$a" ">" "$b" ]; } && { return 0; }
-  }; done
-  return 1;
-}
-
-ipkg_srcs() {
-       local srcre="$1"
-       sed -ne "s/^src[[:space:]]\+$srcre[[:space:]]\+//p" < $IPKG_CONF
-}
-
-ipkg_src_names() {
-       sed -ne "s/^src[[:space:]]\+\([^[:space:]]\+\).*/\1/p" < $IPKG_CONF
-}
-
-ipkg_src_byname() {
-       local src="$1"
-       ipkg_srcs $src | head -1
-}
-
-ipkg_dests() {
-       local destre="`echo $1 | ipkg_protect_slashes`"
-       sed -ne "/^dest[[:space:]]\+$destre/{
-s/^dest[[:space:]]\+[^[:space:]]\+[[:space:]]\+//
-s/^/`echo $IPKG_OFFLINE_ROOT | ipkg_protect_slashes`/
-p
-}" < $IPKG_CONF
-}
-
-ipkg_dest_names() {
-       sed -ne "s/^dest[[:space:]]\+\([^[:space:]]\+\).*/\1/p" < $IPKG_CONF
-}
-
-ipkg_dests_all() {
-       ipkg_dests '.*'
-}
-
-ipkg_state_dirs() {
-       ipkg_dests_all | sed "s|\$|/$IPKG_DIR_PREFIX|"
-}
-
-ipkg_dest_default() {
-       ipkg_dests_all | head -1
-}
-
-ipkg_dest_default_name() {
-       ipkg_dest_names | head -1
-}
-
-ipkg_dest_byname() {
-       local dest="$1"
-       ipkg_dests $dest | head -1
-}
-
-ipkg_option() {
-       local option="$1"
-       sed -ne "s/^option[[:space:]]\+$option[[:space:]]\+//p" < $IPKG_CONF
-}
-
-ipkg_load_configuration() {
-       if [ -z "$IPKG_CONF_DIR" ]; then
-               IPKG_CONF_DIR=/etc
-       fi
-
-       IPKG_CONF="$IPKG_CONF_DIR/ipkg.conf"
-
-       if [ -z "$IPKG_OFFLINE_ROOT" ]; then
-           IPKG_OFFLINE_ROOT="`ipkg_option offline_root`"
-       fi
-       # Export IPKG_OFFLINE_ROOT for use by update-alternatives
-       export IPKG_OFFLINE_ROOT
-       if [ -n "$DEST_NAME" ]; then
-               IPKG_ROOT="`ipkg_dest_byname $DEST_NAME`"
-               if [ -z "$IPKG_ROOT" ]; then
-                       if [ -d "$IPKG_OFFLINE_ROOT$DEST_NAME" ]; then
-                               IPKG_ROOT="$IPKG_OFFLINE_ROOT$DEST_NAME";
-                       else
-                               echo "ipkg: invalid destination specification: $DEST_NAME
-Valid destinations are directories or one of the dest names from $IPKG_CONF:" >&2
-                               ipkg_dest_names >&2
-                               return 1
-                       fi
-               fi
-       else
-               IPKG_ROOT="`ipkg_dest_default`"
-       fi
-
-       # Global ipkg state directories
-       IPKG_DIR_PREFIX=usr/lib/ipkg
-       IPKG_LISTS_DIR=$IPKG_OFFLINE_ROOT/$IPKG_DIR_PREFIX/lists
-       IPKG_PENDING_DIR=$IPKG_OFFLINE_ROOT/$IPKG_DIR_PREFIX/pending
-       IPKG_TMP=$IPKG_ROOT/tmp/ipkg
-
-       # Destination specific ipkg meta-data directory
-       IPKG_STATE_DIR=$IPKG_ROOT/$IPKG_DIR_PREFIX
-
-       # Proxy Support
-       IPKG_PROXY_USERNAME="`ipkg_option proxy_username`"
-       IPKG_PROXY_PASSWORD="`ipkg_option proxy_password`"
-       IPKG_HTTP_PROXY="`ipkg_option http_proxy`"
-       IPKG_FTP_PROXY="`ipkg_option ftp_proxy`"
-       IPKG_NO_PROXY="`ipkg_option no_proxy`"
-       if [ -n "$IPKG_HTTP_PROXY" ]; then 
-               export http_proxy="$IPKG_HTTP_PROXY"
-       fi
-
-       if [ -n "$IPKG_FTP_PROXY" ]; then 
-               export ftp_proxy="$IPKG_FTP_PROXY"
-       fi
-
-       if [ -n "$IPKG_NO_PROXY" ]; then 
-               export no_proxy="$IPKG_NO_PROXY"
-       fi
-
-       IPKG_STATUS_FIELDS='\(Package\|Status\|Essential\|Version\|Conffiles\|Root\)'
-}
-
-ipkg_usage() {
-       [ $# -gt 0 ] && echo "ipkg: $*"
-       echo "
-usage: ipkg [options...] sub-command [arguments...]
-where sub-command is one of:
-
-Package Manipulation:
-       update                  Update list of available packages
-       upgrade                 Upgrade all installed packages to latest version
-       install <pkg>           Download and install <pkg> (and dependencies)
-       install <file.ipk>      Install package <file.ipk>
-       install <file.deb>      Install package <file.deb>
-       remove <pkg>            Remove package <pkg>
-
-Informational Commands:
-       list                    List available packages and descriptions
-       files <pkg>             List all files belonging to <pkg>
-       search <file>           Search for a packaging providing <file>
-       info [pkg [<field>]]    Display all/some info fields for <pkg> or all
-       status [pkg [<field>]]  Display all/some status fields for <pkg> or all
-       depends <pkg>           Print uninstalled package dependencies for <pkg>
-
-Options:
-       -d <dest_name>          Use <dest_name> as the the root directory for
-       -dest <dest_name>       package installation, removal, upgrading.
-                               <dest_name> should be a defined dest name from the
-                               configuration file, (but can also be a directory
-                               name in a pinch).
-        -o <offline_root>       Use <offline_root> as the root for offline installation.
-        -offline <offline_root>                                
-
-Force Options (use when ipkg is too smart for its own good):
-       -force-depends          Make dependency checks warnings instead of errors
-       -force-defaults         Use default options for questions asked by ipkg.
-                                (no prompts). Note that this will not prevent
-                                package installation scripts from prompting.
-" >&2
-       exit 1
-}
-
-ipkg_dir_part() {
-       local dir="`echo $1 | sed -ne 's/\(.*\/\).*/\1/p'`"
-       if [ -z "$dir" ]; then
-               dir="./"
-       fi
-       echo $dir
-}
-
-ipkg_file_part() {
-       echo $1 | sed 's/.*\///'
-}
-
-ipkg_protect_slashes() {
-       sed -e 's/\//\\\//g'
-}
-
-ipkg_download() {
-       local src="$1"
-       local dest="$2"
-
-       local src_file="`ipkg_file_part $src`"
-       local dest_dir="`ipkg_dir_part $dest`"
-       if [ -z "$dest_dir" ]; then
-               dest_dir="$IPKG_TMP"
-       fi
-
-       local dest_file="`ipkg_file_part $dest`"
-       if [ -z "$dest_file" ]; then
-               dest_file="$src_file"
-       fi
-
-       # Proxy support
-       local proxyuser=""
-       local proxypassword=""
-       local proxyoption=""
-               
-       if [ -n "$IPKG_PROXY_USERNAME" ]; then
-               proxyuser="--proxy-user=\"$IPKG_PROXY_USERNAME\""
-               proxypassword="--proxy-passwd=\"$IPKG_PROXY_PASSWORD\""
-       fi
-
-       if [ -n "$IPKG_PROXY_HTTP" -o -n "$IPKG_PROXY_FTP" ]; then
-               proxyoption="--proxy=on"
-       fi
-
-       echo "Downloading $src ..."
-       rm -f $IPKG_TMP/$src_file
-       case "$src" in
-       http://* | ftp://*)
-               if ! wget --passive-ftp $proxyoption $proxyuser $proxypassword -P $IPKG_TMP $src; then
-                       echo "ipkg_download: ERROR: Failed to retrieve $src, returning $err"
-                       return 1
-               fi
-               mv $IPKG_TMP/$src_file $dest_dir/$dest_file 2>/dev/null
-               ;;
-       file:/* )
-               ln -s `echo $src | sed 's/^file://'` $dest_dir/$dest_file 2>/dev/null
-               ;;
-       *)
-       echo "DEBUG: $src"
-               ;;
-       esac
-
-       echo "Done."
-       return 0
-}
-
-ipkg_update() {
-       if [ ! -e "$IPKG_LISTS_DIR" ]; then
-               mkdir -p $IPKG_LISTS_DIR
-       fi
-
-       local err=
-       for src_name in `ipkg_src_names`; do
-               local src="`ipkg_src_byname $src_name`"
-               if ! ipkg_download $src/Packages $IPKG_LISTS_DIR/$src_name; then
-                       echo "ipkg_update: Error downloading $src/Packages to $IPKG_LISTS_DIR/$src_name" >&2
-                       err=t
-               else
-                       echo "Updated list of available packages in $IPKG_LISTS_DIR/$src_name"
-               fi
-       done
-
-       [ -n "$err" ] && return 1
-
-       return 0
-}
-
-ipkg_list() {
-       for src in `ipkg_src_names`; do
-               if ipkg_require_list $src; then 
-# black magic...
-sed -ne "
-/^Package:/{
-s/^Package:[[:space:]]*\<\([a-z0-9.+-]*$1[a-z0-9.+-]*\).*/\1/
-h
-}
-/^Description:/{
-s/^Description:[[:space:]]*\(.*\)/\1/
-H
-g
-s/\\
-/ - /
-p
-}
-" $IPKG_LISTS_DIR/$src
-               fi
-       done
-}
-
-ipkg_extract_paragraph() {
-       local pkg="$1"
-       sed -ne "/Package:[[:space:]]*$pkg[[:space:]]*\$/,/^\$/p"
-}
-
-ipkg_extract_field() {
-       local field="$1"
-# blacker magic...
-       sed -ne "
-: TOP
-/^$field:/{
-p
-n
-b FIELD
-}
-d
-: FIELD
-/^$/b TOP
-/^[^[:space:]]/b TOP
-p
-n
-b FIELD
-"
-}
-
-ipkg_extract_value() {
-       sed -e "s/^[^:]*:[[:space:]]*//"
-}
-
-ipkg_require_list() {
-       [ $# -lt 1 ] && return 1
-       local src="$1"
-       if [ ! -f "$IPKG_LISTS_DIR/$src" ]; then
-               echo "ERROR: File not found: $IPKG_LISTS_DIR/$src" >&2
-               echo "       You probably want to run \`ipkg update'" >&2
-               return 1
-       fi
-       return 0
-}
-
-ipkg_info() {
-       for src in `ipkg_src_names`; do
-               if ipkg_require_list $src; then
-                       case $# in
-                       0)
-                               cat $IPKG_LISTS_DIR/$src
-                               ;;      
-                       1)
-                               ipkg_extract_paragraph $1 < $IPKG_LISTS_DIR/$src
-                               ;;
-                       *)
-                               ipkg_extract_paragraph $1 < $IPKG_LISTS_DIR/$src | ipkg_extract_field $2
-                               ;;
-                       esac
-               fi
-       done
-}
-
-ipkg_status_sd() {
-       [ $# -lt 1 ] && return 0
-       sd="$1"
-       shift
-       if [ -f $sd/status ]; then
-               case $# in
-               0)
-                       cat $sd/status
-                       ;;
-               1)
-                       ipkg_extract_paragraph $1 < $sd/status
-                       ;;
-               *)
-                       ipkg_extract_paragraph $1 < $sd/status | ipkg_extract_field $2
-                       ;;
-               esac
-       fi
-       return 0
-}
-
-ipkg_status_all() {
-       for sd in `ipkg_state_dirs`; do
-               ipkg_status_sd $sd $*
-       done
-}
-
-ipkg_status() {
-       if [ -n "$DEST_NAME" ]; then
-               ipkg_status_sd $IPKG_STATE_DIR $*
-       else
-               ipkg_status_all $*
-       fi
-}
-
-ipkg_status_matching_sd() {
-       local sd="$1"
-       local re="$2"
-       if [ -f $sd/status ]; then
-               sed -ne "
-: TOP
-/^Package:/{
-s/^Package:[[:space:]]*//
-s/[[:space:]]*$//
-h
-}
-/$re/{
-g
-p
-b NEXT
-}
-d
-: NEXT
-/^$/b TOP
-n
-b NEXT
-" < $sd/status
-       fi
-       return 0
-}
-
-ipkg_status_matching_all() {
-       for sd in `ipkg_state_dirs`; do
-               ipkg_status_matching_sd $sd $*
-       done
-}
-
-ipkg_status_matching() {
-       if [ -n "$DEST_NAME" ]; then
-               ipkg_status_matching_sd $IPKG_STATE_DIR $*
-       else
-               ipkg_status_matching_all $*
-       fi
-}
-
-ipkg_status_installed_sd() {
-       local sd="$1"
-       local pkg="$2"
-       ipkg_status_sd $sd $pkg Status | grep -q "Status: install ok installed"
-}
-
-ipkg_status_installed_all() {
-       local ret=1
-       for sd in `ipkg_state_dirs`; do
-               if `ipkg_status_installed_sd $sd $*`; then
-                       ret=0
-               fi
-       done
-       return $ret
-}
-
-ipkg_status_mentioned_sd() {
-       local sd="$1"
-       local pkg="$2"
-       [ -n "`ipkg_status_sd $sd $pkg Status`" ]
-}
-
-ipkg_files() {
-       local pkg="$1"
-       if [ -n "$DEST_NAME" ]; then
-               dests=$IPKG_ROOT
-       else
-               dests="`ipkg_dests_all`"
-       fi
-       for dest in $dests; do
-               if [ -f $dest/$IPKG_DIR_PREFIX/info/$pkg.list ]; then
-                       dest_sed="`echo $dest | ipkg_protect_slashes`"
-                       sed -e "s/^/$dest_sed/" < $dest/$IPKG_DIR_PREFIX/info/$pkg.list
-               fi
-       done
-}
-
-ipkg_search() {
-       local pattern="$1"
-
-       for dest_name in `ipkg_dest_names`; do
-               dest="`ipkg_dest_byname $dest_name`"
-               dest_sed="`echo $dest | ipkg_protect_slashes`"
-
-               set +o noglob
-               local list_files="`ls -1 $dest/$IPKG_DIR_PREFIX/info/*.list 2>/dev/null`"
-               set -o noglob
-               for file in $list_files; do
-                       if sed "s/^/$dest_sed/" $file | grep -q $pattern; then
-                               local pkg="`echo $file | sed "s/^.*\/\(.*\)\.list/\1/"`"
-                               [ "$dest_name" != `ipkg_dest_default_name` ] && pkg="$pkg ($dest_name)"
-                               sed "s/^/$dest_sed/" $file | grep $pattern | sed "s/^/$pkg: /"
-                       fi
-               done
-       done
-}
-
-ipkg_status_remove_sd() {
-       local sd="$1"
-       local pkg="$2"
-
-       if [ ! -f $sd/status ]; then
-               mkdir -p $sd
-               touch $sd/status
-       fi
-       sed -ne "/Package:[[:space:]]*$pkg[[:space:]]*\$/,/^\$/!p" < $sd/status > $sd/status.new
-       mv $sd/status.new $sd/status
-}
-
-ipkg_status_remove_all() {
-       for sd in `ipkg_state_dirs`; do
-               ipkg_status_remove_sd $sd $*
-       done
-}
-
-ipkg_status_remove() {
-       if [ -n "$DEST_NAME" ]; then
-               ipkg_status_remove_sd $IPKG_STATE_DIR $*
-       else
-               ipkg_status_remove_all $*
-       fi
-}
-
-ipkg_status_update_sd() {
-       local sd="$1"
-       local pkg="$2"
-
-       ipkg_status_remove_sd $sd $pkg
-       ipkg_extract_field "$IPKG_STATUS_FIELDS" >> $sd/status
-       echo "" >> $sd/status
-}
-
-ipkg_status_update() {
-       ipkg_status_update_sd $IPKG_STATE_DIR $*
-}
-
-ipkg_unsatisfied_dependences() {
-    local pkg=$1
-    local deps="`ipkg_get_depends $pkg`"
-    local remaining_deps=
-    for dep in $deps; do
-       local installed="`ipkg_get_installed $dep`"
-       if [ "$installed" != "installed" ] ; then
-           remaining_deps="$remaining_deps $dep"
-       fi
-    done
-    ## echo "ipkg_unsatisfied_dependences pkg=$pkg $remaining_deps" > /dev/console
-    echo $remaining_deps
-}
-
-ipkg_safe_pkg_name() {
-       local pkg=$1
-       local spkg="`echo pkg_$pkg | sed -e y/-+./___/`"
-       echo $spkg
-}
-
-ipkg_set_depends() {
-       local pkg=$1; shift 
-       local new_deps="$*"
-       pkg="`ipkg_safe_pkg_name $pkg`"
-       ## setvar ${pkg}_depends "$new_deps"
-       echo $new_deps > /tmp/ipkg/${pkg}.depends
-}
-
-ipkg_get_depends() {
-       local pkg=$1
-       pkg="`ipkg_safe_pkg_name $pkg`"
-       cat /tmp/ipkg/${pkg}.depends
-       ## eval "echo \$${pkg}_depends"
-}
-
-ipkg_set_installed() {
-       local pkg=$1
-       pkg="`ipkg_safe_pkg_name $pkg`"
-       echo installed > /tmp/ipkg/${pkg}.installed
-       ## setvar ${pkg}_installed "installed"
-}
-
-ipkg_set_uninstalled() {
-       local pkg=$1
-       pkg="`ipkg_safe_pkg_name $pkg`"
-       ### echo ipkg_set_uninstalled $pkg > /dev/console
-       echo uninstalled > /tmp/ipkg/${pkg}.installed
-       ## setvar ${pkg}_installed "uninstalled"
-}
-
-ipkg_get_installed() {
-       local pkg=$1
-       pkg="`ipkg_safe_pkg_name $pkg`"
-       if [ -f /tmp/ipkg/${pkg}.installed ]; then
-               cat /tmp/ipkg/${pkg}.installed
-       fi
-       ## eval "echo \$${pkg}_installed"
-}
-
-ipkg_depends() {
-       local new_pkgs="$*"
-       local all_deps=
-       local installed_pkgs="`ipkg_status_matching_all 'Status:.*[[:space:]]installed'`"
-       for pkg in $installed_pkgs; do
-           ipkg_set_installed $pkg
-       done
-       while [ -n "$new_pkgs" ]; do
-               all_deps="$all_deps $new_pkgs"
-               local new_deps=
-               for pkg in $new_pkgs; do
-                       if echo $pkg | grep -q '[^a-z0-9.+-]'; then
-                               echo "ipkg_depends: ERROR: Package name $pkg contains illegal characters (should be [a-z0-9.+-])" >&2
-                               return 1
-                       fi
-                       # TODO: Fix this. For now I am ignoring versions and alternations in dependencies.
-                       new_deps="$new_deps "`ipkg_info $pkg '\(Pre-\)\?Depends' | ipkg_extract_value | sed -e 's/([^)]*)//g
-s/\(|[[:space:]]*[a-z0-9.+-]\+[[:space:]]*\)\+//g
-s/,/ /g
-s/ \+/ /g'`
-                       ipkg_set_depends $pkg $new_deps
-               done
-
-               new_deps=`echo $new_deps | sed -e 's/[[:space:]]\+/\\
-/g' | sort | uniq`
-
-               local maybe_new_pkgs=
-               for pkg in $new_deps; do
-                       if ! echo $installed_pkgs | grep -q "\<$pkg\>"; then
-                               maybe_new_pkgs="$maybe_new_pkgs $pkg"
-                       fi
-               done
-
-               new_pkgs=
-               for pkg in $maybe_new_pkgs; do
-                       if ! echo $all_deps | grep -q "\<$pkg\>"; then
-                               if [ -z "`ipkg_info $pkg`" ]; then
-                                       echo "ipkg_depends: Warning: $pkg mentioned in dependency but no package found in $IPKG_LISTS_DIR" >&2
-                                       ipkg_set_installed $pkg
-                               else
-                                       new_pkgs="$new_pkgs $pkg"
-                                       ipkg_set_uninstalled $pkg
-                               fi
-                       else
-                               ipkg_set_uninstalled $pkg
-                       fi
-               done
-       done
-
-       echo $all_deps
-}
-
-ipkg_get_install_dest() {
-       local dest="$1"
-       shift
-       local sd=$dest/$IPKG_DIR_PREFIX
-       local info_dir=$sd/info
-
-        local requested_pkgs="$*"
-       local pkgs="`ipkg_depends $*`"
-
-       mkdir -p $info_dir
-       for pkg in $pkgs; do
-               if ! ipkg_status_mentioned_sd $sd $pkg; then
-                       echo "Package: $pkg
-Status: install ok not-installed" | ipkg_status_update_sd $sd $pkg
-               fi
-       done
-        ## mark the packages that we were directly requested to install as uninstalled
-        for pkg in $requested_pkgs; do ipkg_set_uninstalled $pkg; done
-
-       local new_pkgs=
-       local pkgs_installed=0
-       while [ -n "pkgs" ]; do
-               curcheck=0
-               ## echo "pkgs to install: {$pkgs}" > /dev/console
-               for pkg in $pkgs; do
-                       curcheck="`expr $curcheck + 1`"
-                       local is_installed="`ipkg_get_installed $pkg`"
-                       if [ "$is_installed" = "installed" ]; then
-                               echo "$pkg is installed" > /dev/console
-                               continue
-                       fi
-
-                       local remaining_deps="`ipkg_unsatisfied_dependences $pkg`"
-                       if [ -n "$remaining_deps" ]; then
-                               new_pkgs="$new_pkgs $pkg"
-                               ### echo "Dependences not satisfied for $pkg: $remaining_deps"
-                               if [ $curcheck -ne `echo  $pkgs|wc -w` ]; then
-                                       continue
-                               fi
-                       fi
-
-                       local filename=
-                       for src in `ipkg_src_names`; do
-                               if ipkg_require_list $src; then
-                                       filename="`ipkg_extract_paragraph $pkg < $IPKG_LISTS_DIR/$src | ipkg_extract_field Filename | ipkg_extract_value`"
-                                       [ -n "$filename" ] && break
-                               fi
-                       done
-
-                       if [ -z "$filename" ]; then
-                               echo "ipkg_get_install: ERROR: Cannot find package $pkg in $IPKG_LISTS_DIR"
-                               echo "ipkg_get_install:        Check the spelling and maybe run \`ipkg update'."
-                               ipkg_status_remove_sd $sd $pkg
-                               return 1;
-                       fi
-
-                       [ -e "$IPKG_TMP" ] || mkdir -p $IPKG_TMP
-
-                       echo ""
-                       local tmp_pkg_file="$IPKG_TMP/"`ipkg_file_part $filename`
-                       if ! ipkg_download `ipkg_src_byname $src`/$filename $tmp_pkg_file; then
-                               echo "ipkg_get_install: Perhaps you need to run \`ipkg update'?"
-                               return 1
-                       fi
-
-                       if ! ipkg_install_file_dest $dest $tmp_pkg_file; then
-                               echo "ipkg_get_install: ERROR: Failed to install $tmp_pkg_file"
-                               echo "ipkg_get_install: I'll leave it there for you to try a manual installation"
-                               return 1
-                       fi
-
-                       ipkg_set_installed $pkg
-                       pkgs_installed="`expr $pkgs_installed + 1`"
-                       rm $tmp_pkg_file
-               done
-               ### echo "Installed $pkgs_installed package(s) this round"
-               if [ $pkgs_installed -eq 0 ]; then
-                       if [ -z "$new_pkgs" ]; then
-                           break
-                       fi
-               fi
-               pkgs_installed=0
-               pkgs="$new_pkgs"
-               new_pkgs=
-               curcheck=0
-        done
-}
-
-ipkg_get_install() {
-       ipkg_get_install_dest $IPKG_ROOT $*
-}
-
-ipkg_install_file_dest() {
-       local dest="$1"
-       local filename="$2"
-       local sd=$dest/$IPKG_DIR_PREFIX
-       local info_dir=$sd/info
-
-       if [ ! -f "$filename" ]; then
-               echo "ipkg_install_file: ERROR: File $filename not found"
-               return 1
-       fi
-
-       local pkg="`ipkg_file_part $filename | sed 's/\([a-z0-9.+-]\+\)_.*/\1/'`"
-       local ext="`echo $filename | sed 's/.*\.//'`"
-       local pkg_extract_stdout
-       if [ "$ext" = "ipk" ]; then
-               pkg_extract_stdout="tar -xzOf"
-       elif [ "$ext" = "deb" ]; then
-               pkg_extract_stdout="ar p"
-       else
-               echo "ipkg_install_file: ERROR: File $filename has unknown extension $ext (not .ipk or .deb)"
-               return 1
-       fi
-
-       # Check dependencies
-       local depends="`ipkg_depends $pkg | sed -e "s/\<$pkg\>//"`"
-
-       # Don't worry about deps that are scheduled for installation
-       local missing_deps=
-       for dep in $depends; do
-               if ! ipkg_status_all $dep | grep -q 'Status:[[:space:]]install'; then
-                       missing_deps="$missing_deps $dep"
-               fi
-       done
-
-       if [ ! -z "$missing_deps" ]; then
-               if [ -n "$FORCE_DEPENDS" ]; then
-                       echo "ipkg_install_file: Warning: $pkg depends on the following uninstalled programs: $missing_deps"
-               else
-                       echo "ipkg_install_file: ERROR: $pkg depends on the following uninstalled programs:
-       $missing_deps"
-                       echo "ipkg_install_file: You may want to use \`ipkg install' to install these."
-                       return 1
-               fi
-       fi
-
-       mkdir -p $IPKG_TMP/$pkg/control
-       mkdir -p $IPKG_TMP/$pkg/data
-       mkdir -p $info_dir
-
-       if ! $pkg_extract_stdout $filename ./control.tar.gz | (cd $IPKG_TMP/$pkg/control; tar -xzf - ) ; then
-               echo "ipkg_install_file: ERROR unpacking control.tar.gz from $filename"
-               return 1
-       fi
-
-       if [ -n "$IPKG_OFFLINE_ROOT" ]; then
-               if grep -q '^InstallsOffline:[[:space:]]*no' $IPKG_TMP/$pkg/control/control; then
-                       echo "*** Warning: Package $pkg may not be installed in offline mode"
-                       echo "*** Warning: Scheduling $filename for pending installation (installing into $IPKG_PENDING_DIR)"
-                       echo "Package: $pkg
-Status: install ok pending" | ipkg_status_update_sd $sd $pkg
-                       mkdir -p $IPKG_PENDING_DIR
-                       cp $filename $IPKG_PENDING_DIR
-                       rm -r $IPKG_TMP/$pkg/control
-                       rm -r $IPKG_TMP/$pkg/data
-                       rmdir $IPKG_TMP/$pkg
-                       return 0
-               fi
-       fi
-
-
-       echo -n "Unpacking $pkg..."
-       set +o noglob
-       for file in $IPKG_TMP/$pkg/control/*; do
-               local base_file="`ipkg_file_part $file`"
-               mv $file $info_dir/$pkg.$base_file
-       done
-       set -o noglob
-       rm -r $IPKG_TMP/$pkg/control
-
-       if ! $pkg_extract_stdout $filename ./data.tar.gz | (cd $IPKG_TMP/$pkg/data; tar -xzf - ) ; then
-               echo "ipkg_install_file: ERROR unpacking data.tar.gz from $filename"
-               return 1
-       fi
-       echo "Done."
-
-       echo -n "Configuring $pkg..."
-       export PKG_ROOT=$dest
-       if [ -x "$info_dir/$pkg.preinst" ]; then
-               if ! $info_dir/$pkg.preinst install; then
-                       echo "$info_dir/$pkg.preinst failed. Aborting installation of $pkg"
-                       rm -rf $IPKG_TMP/$pkg/data
-                       rmdir $IPKG_TMP/$pkg
-                       return 1
-               fi
-       fi
-
-       local old_conffiles="`ipkg_status_sd $sd $pkg Conffiles | ipkg_extract_value`"
-       local new_conffiles=
-       if [ -f "$info_dir/$pkg.conffiles" ]; then
-               for conffile in `cat $info_dir/$pkg.conffiles`; do
-                       if [ -f "$dest/$conffile" ] && ! echo " $old_conffiles " | grep -q " $conffile "`md5sum $dest/$conffile | sed 's/ .*//'`; then
-                               local use_maintainers_conffile=
-                               if [ -z "$FORCE_DEFAULTS" ]; then
-                                       while true; do
-                                               echo -n "Configuration file \`$conffile'
- ==> File on system created by you or by a script.
- ==> File also in package provided by package maintainer.
-   What would you like to do about it ?  Your options are:
-    Y or I  : install the package maintainer's version
-    N or O  : keep your currently-installed version
-      D     : show the differences between the versions (if diff is installed)
- The default action is to keep your current version.
-*** `ipkg_file_part $conffile` (Y/I/N/O/D) [default=N] ? "
-                                               read response
-                                               case "$response" in
-                                               [YyIi] | [Yy][Ee][Ss])
-                                                       use_maintainers_conffile=t
-                                                       break
-                                               ;;
-                                               [Dd])
-                                                       echo "
-diff -u $dest/$conffile $IPKG_TMP/$pkg/data/$conffile"
-                                                       diff -u $dest/$conffile $IPKG_TMP/$pkg/data/$conffile || true
-                                                       echo "[Press ENTER to continue]"
-                                                       read junk
-                                               ;;
-                                               *)
-                                                       break
-                                               ;;
-                                               esac
-                                       done
-                               fi
-                               if [ -n "$use_maintainers_conffile" ]; then
-                                       local md5sum="`md5sum $IPKG_TMP/$pkg/data/$conffile | sed 's/ .*//'`"
-                                       new_conffiles="$new_conffiles $conffile $md5sum"
-                               else
-                                       new_conffiles="$new_conffiles $conffile <custom>"
-                                       rm $IPKG_TMP/$pkg/data/$conffile
-                               fi
-                       else
-                               md5sum="`md5sum $IPKG_TMP/$pkg/data/$conffile | sed 's/ .*//'`"
-                               new_conffiles="$new_conffiles $conffile $md5sum"
-                       fi
-               done
-       fi
-
-       local owd="`pwd`"
-       (cd $IPKG_TMP/$pkg/data/; tar cf - . | (cd $owd; cd $dest; tar xf -))
-       rm -rf $IPKG_TMP/$pkg/data
-       rmdir $IPKG_TMP/$pkg
-       $pkg_extract_stdout $filename ./data.tar.gz | tar tzf - | sed -e 's/^\.//' > $info_dir/$pkg.list
-
-       if [ -x "$info_dir/$pkg.postinst" ]; then
-               $info_dir/$pkg.postinst configure
-       fi
-
-       if [ -n "$new_conffiles" ]; then
-               new_conffiles='Conffiles: '`echo $new_conffiles | ipkg_protect_slashes`
-       fi
-       local sed_safe_root="`echo $dest | sed -e "s/^${IPKG_OFFLINE_ROOT}//" | ipkg_protect_slashes`"
-       sed -e "s/\(Package:.*\)/\1\\
-Status: install ok installed\\
-Root: ${sed_safe_root}\\
-${new_conffiles}/" $info_dir/$pkg.control | ipkg_status_update_sd $sd $pkg
-
-       rm -f $info_dir/$pkg.control
-       rm -f $info_dir/$pkg.conffiles
-       rm -f $info_dir/$pkg.preinst
-       rm -f $info_dir/$pkg.postinst
-
-       echo "Done."
-}
-
-ipkg_install_file() {
-       ipkg_install_file_dest $IPKG_ROOT $*
-}
-
-ipkg_install() {
-
-       while [ $# -gt 0 ]; do
-               local pkg="$1"
-               shift
-       
-               case "$pkg" in
-               http://* | ftp://*)
-                       local tmp_pkg_file="$IPKG_TMP/"`ipkg_file_part $pkg`
-                       if ipkg_download $pkg $tmp_pkg_file; then
-                               ipkg_install_file $tmp_pkg_file
-                               rm $tmp_pkg_file
-                       fi
-                       ;;
-               file:/*.ipk  | file://*.deb)
-                               local ipkg_filename="`echo $pkg|sed 's/^file://'`"
-                               ipkg_install_file $ipkg_filename
-                       ;;
-               *.ipk  | *.deb)
-                       if [ -f "$pkg" ]; then
-                               ipkg_install_file $pkg
-                       else
-                               echo "File not found $pkg" >&2
-                       fi
-                       ;;
-               *)
-                       ipkg_get_install $pkg || true
-                       ;;
-               esac
-       done
-}
-
-ipkg_install_pending() {
-       [ -n "$IPKG_OFFLINE_ROOT" ] && return 0
-
-       if [ -d "$IPKG_PENDING_DIR" ]; then
-               set +o noglob
-               local pending="`ls -1d $IPKG_PENDING_DIR/*.ipk 2> /dev/null`" || true
-               set -o noglob
-               if [ -n "$pending" ]; then
-                       echo "The following packages in $IPKG_PENDING_DIR will now be installed:"
-                       echo $pending
-                       for filename in $pending; do
-                               if ipkg_install_file $filename; then
-                                       rm $filename
-                               fi
-                       done
-               fi
-       fi
-       return 0
-}
-
-ipkg_install_wanted() {
-       local wanted="`ipkg_status_matching 'Status:[[:space:]]*install.*not-installed'`"
-
-       if [ -n "$wanted" ]; then
-               echo "The following package were previously requested but have not been installed:"
-               echo $wanted
-
-               if [ -n "$FORCE_DEFAULTS" ]; then
-                       echo "Installing them now."
-               else
-                       echo -n "Install them now [Y/n] ? "
-                       read response
-                       case "$response" in
-                       [Nn] | [Nn][Oo])
-                               return 0
-                               ;;
-                       esac
-               fi
-
-               ipkg_install $wanted
-       fi
-
-       return 0
-}
-
-ipkg_upgrade_pkg() {
-       local pkg="$1"
-       local avail_ver="`ipkg_info $pkg Version | ipkg_extract_value | head -1`"
-
-       is_installed=
-       for dest_name in `ipkg_dest_names`; do
-               local dest="`ipkg_dest_byname $dest_name`"
-               local sd=$dest/$IPKG_DIR_PREFIX
-               local inst_ver="`ipkg_status_sd $sd $pkg Version | ipkg_extract_value`"
-               if [ -n "$inst_ver" ]; then
-                       is_installed=t
-
-                       if [ -z "$avail_ver" ]; then
-                               echo "Assuming locally installed package $pkg ($inst_ver) is up to date"
-                               return 0
-                       fi
-
-                       if [ "$avail_ver" = "$inst_ver" ]; then 
-                               echo "Package $pkg ($inst_ver) installed in $dest_name is up to date"
-                       elif ipkg_is_upgrade "$avail_ver" "$inst_ver"; then
-                               echo "Upgrading $pkg ($dest_name) from $inst_ver to $avail_ver"
-                               ipkg_get_install_dest $dest $pkg
-                       else
-                               echo "Not downgrading package $pkg from $inst_ver to $avail_ver"
-                       fi
-               fi
-       done
-
-       if [ -z "$is_installed" ]; then
-               echo "Package $pkg does not appear to be installed"
-               return 0
-       fi
-
-}
-
-ipkg_upgrade() {
-       if [ $# -lt 1 ]; then
-               local pkgs="`ipkg_status_matching 'Status:.*[[:space:]]installed'`"
-       else
-               pkgs="$*"
-       fi
-       
-       for pkg in $pkgs; do
-               ipkg_upgrade_pkg $pkg
-       done
-}
-
-ipkg_remove_pkg_dest() {
-       local dest="$1"
-       local pkg="$2"
-       local sd=$dest/$IPKG_DIR_PREFIX
-       local info_dir=$sd/info
-
-       if ! ipkg_status_installed_sd $sd $pkg; then
-               echo "ipkg_remove: Package $pkg does not appear to be installed in $dest"
-               if ipkg_status_mentioned_sd $sd $pkg; then
-                       echo "Purging mention of $pkg from the ipkg database"
-                       ipkg_status_remove_sd $sd $pkg
-               fi
-               return 1
-       fi
-
-       echo "ipkg_remove: Removing $pkg... "
-
-       local files="`cat $info_dir/$pkg.list`"
-
-       export PKG_ROOT=$dest
-       if [ -x "$info_dir/$pkg.prerm" ]; then
-               $info_dir/$pkg.prerm remove
-       fi
-
-       local conffiles="`ipkg_status_sd $sd $pkg Conffiles | ipkg_extract_value`"
-
-       local dirs_to_remove=
-       for file in $files; do
-               if [ -d "$dest/$file" ]; then
-                       dirs_to_remove="$dirs_to_remove $dest/$file"
-               else
-                       if echo " $conffiles " | grep -q " $file "; then
-                               if echo " $conffiles " | grep -q " $file "`md5sum $dest/$file | sed 's/ .*//'`; then
-                                       rm -f $dest/$file
-                               fi
-                       else
-                               rm -f $dest/$file
-                       fi
-               fi
-       done
-
-       local removed_a_dir=t
-       while [ -n "$removed_a_dir" ]; do
-               removed_a_dir=
-               local new_dirs_to_remove=
-               for dir in $dirs_to_remove; do
-                       if rmdir $dir >/dev/null 2>&1; then
-                               removed_a_dir=t
-                       else
-                               new_dirs_to_remove="$new_dirs_to_remove $dir"
-                       fi
-               done
-               dirs_to_remove="$new_dirs_to_remove"
-       done
-
-       if [ -n "$dirs_to_remove" ]; then
-               echo "ipkg_remove: Warning: Not removing the following directories since they are not empty:" >&2
-               echo "$dirs_to_remove" | sed -e 's/\/[/]\+/\//g' >&2
-       fi
-
-       if [ -x "$info_dir/$pkg.postrm" ]; then
-               $info_dir/$pkg.postrm remove
-       fi
-
-       ipkg_status_remove_sd $sd $pkg
-       set +o noglob
-       rm -f $info_dir/$pkg.*
-       set -o noglob
-
-       echo "Done."
-}
-
-ipkg_remove_pkg() {
-       local pkg="$1"
-       for dest in `ipkg_dests_all`; do
-               local sd=$dest/$IPKG_DIR_PREFIX
-               if ipkg_status_mentioned_sd $sd $pkg; then
-                       ipkg_remove_pkg_dest $dest $pkg
-               fi
-       done
-}
-
-ipkg_remove() {
-       while [ $# -gt 0 ]; do
-               local pkg="$1"
-               shift
-               if [ -n "$DEST_NAME" ]; then
-                       ipkg_remove_pkg_dest $IPKG_ROOT $pkg
-               else
-                       ipkg_remove_pkg $pkg
-               fi
-       done
-}
-
-###########
-# ipkg main
-###########
-
-# Parse options
-while [ $# -gt 0 ]; do
-       arg="$1"
-       case $arg in
-       -d | -dest)
-               [ $# -gt 1 ] || ipkg_usage "option $arg requires an argument"
-               DEST_NAME="$2"
-               shift
-               ;;
-       -o | -offline)
-               [ $# -gt 1 ] || ipkg_usage "option $arg requires an argument"
-               IPKG_OFFLINE_ROOT="$2"
-               shift
-               ;;
-       -force-depends)
-               FORCE_DEPENDS=t
-               ;;
-       -force-defaults)
-               FORCE_DEFAULTS=t
-               ;;
-       -*)
-               ipkg_usage "unknown option $arg"
-               ;;
-       *)
-               break
-               ;;
-       esac
-       shift
-done
-
-[ $# -lt 1 ] && ipkg_usage "ipkg must have one sub-command argument"
-cmd="$1"
-shift
-
-ipkg_load_configuration
-mkdir -p /tmp/ipkg
-
-case "$cmd" in
-update|upgrade|list|info|status|install_pending)
-       ;;
-install|depends|remove|files|search)
-       [ $# -lt 1 ] && ipkg_usage "ERROR: the \`\`$cmd'' command requires an argument"
-       ;;
-*)
-       echo "ERROR: unknown sub-command \`$cmd'"
-       ipkg_usage
-       ;;
-esac
-
-# Only install pending if we have an interactive sub-command
-case "$cmd" in
-upgrade|install)
-       ipkg_install_pending
-       ipkg_install_wanted
-       ;;
-esac
-
-ipkg_$cmd $*
-for a in `ls $IPKG_TMP`; do
-       rm -rf $IPKG_TMP/$a
-done
diff --git a/obsolete-buildroot/sources/openwrt/root/bin/login b/obsolete-buildroot/sources/openwrt/root/bin/login
deleted file mode 100755 (executable)
index 7520824..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-exec ash --login
diff --git a/obsolete-buildroot/sources/openwrt/root/etc/banner b/obsolete-buildroot/sources/openwrt/root/etc/banner
deleted file mode 100644 (file)
index 2b2b2c0..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-  _______                     ________        __
- |       |.-----.-----.-----.|  |  |  |.----.|  |_
- |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
- |_______||   __|_____|__|__||________||__|  |____|
-          |__| W I R E L E S S   F R E E D O M
-          
diff --git a/obsolete-buildroot/sources/openwrt/root/etc/dnsmasq.conf b/obsolete-buildroot/sources/openwrt/root/etc/dnsmasq.conf
deleted file mode 100644 (file)
index 293edc6..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-# filter what we send upstream
-domain-needed
-bogus-priv
-filterwin2k
-
-# allow /etc/hosts and dhcp lookups via *.lan
-local=/lan/
-domain=lan
-
-# no dhcp / dns queries from the wan
-except-interface=vlan1
-
-# enable dhcp (start,end,netmask,leasetime)
-dhcp-authoritative
-dhcp-range=192.168.1.100,192.168.1.250,255.255.255.0,12h
-dhcp-leasefile=/tmp/dhcp.leases
-
-# use /etc/ethers for static hosts; same format as --dhcp-host
-# <hwaddr> [<hostname>] <ipaddr>
-read-ethers
-
-# other useful options:
-# default route(s): dhcp-option=3,192.168.1.1,192.168.1.2
-#    dns server(s): dhcp-option=6,192.168.1.1,192.168.1.2
diff --git a/obsolete-buildroot/sources/openwrt/root/etc/functions.sh b/obsolete-buildroot/sources/openwrt/root/etc/functions.sh
deleted file mode 100755 (executable)
index 75500a2..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/ash
-
-alias debug=${DEBUG:-:}
-
-# allow env to override nvram
-nvram () {
-  case $1 in
-    get) eval "echo \${NVRAM_$2:-\$(command nvram get $2)}";;
-    *) command nvram $*;;
-  esac
-}
-. /etc/nvram.overrides
-
-# valid interface?
-if_valid () {
-  ifconfig "$1" >&- 2>&- ||
-  [ "${1%%[0-9]}" = "br" ] ||
-  {
-    [ "${1%%[0-9]}" = "vlan" ] && ( 
-      i=${1#vlan}
-      hwname=$(nvram get vlan${i}hwname)
-      hwaddr=$(nvram get ${hwname}macaddr)
-      [ -z "$hwaddr" ] && return 1
-
-      vif=$(ifconfig -a | awk '/^eth.*'$hwaddr'/ {print $1; exit}' IGNORECASE=1)
-      debug "# vlan$i => $vif"
-
-      $DEBUG ifconfig $vif up
-      $DEBUG vconfig add $vif $i 2>&-
-    )
-  } ||
-  { echo -e "# $1 ignored: can't find/create"; false; }
-}
diff --git a/obsolete-buildroot/sources/openwrt/root/etc/init.d/S10boot b/obsolete-buildroot/sources/openwrt/root/etc/init.d/S10boot
deleted file mode 100755 (executable)
index 81379be..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-klogd
-syslogd -C 16 
-sysctl -p
-echo "S" > /proc/jffs2_bbc
-
-mkdir -p /var/run
-
-[ "$(nvram get il0macaddr)" = "00:90:4c:5f:00:2a" ] && {
-  # if default wifi mac, set two higher than the lan mac
-  nvram set il0macaddr=$(nvram get et0macaddr|
-  awk '{OFS=FS=":";for(x=7,y=2;--x;){$x=sprintf("%02x",(y+="0x"$x)%256);y/=256}print}')
-}
-
-insmod et
-insmod wl
-
-ifconfig lo 127.0.0.1 up
-ifconfig eth0 promisc
-
-HOSTNAME=$(nvram get wan_hostname)
-HOSTNAME=${HOSTNAME%%.*}
-echo ${HOSTNAME:=OpenWrt} > /proc/sys/kernel/hostname
-
-vconfig set_name_type VLAN_PLUS_VID_NO_PAD
diff --git a/obsolete-buildroot/sources/openwrt/root/etc/init.d/S40network b/obsolete-buildroot/sources/openwrt/root/etc/init.d/S40network
deleted file mode 100755 (executable)
index a8144a8..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-. /etc/functions.sh
-case "$1" in
-  start|restart)
-    ifup lan
-    ifup wan
-    ifup wifi
-    wifi up
-
-    for route in $(nvram get static_route); do {
-      eval "set $(echo $route | sed 's/:/ /g')"
-      $DEBUG route add -net $1 netmask $2 gw $3 metric $4 dev $5
-    } done
-    ;;
-esac
diff --git a/obsolete-buildroot/sources/openwrt/root/etc/init.d/S45firewall b/obsolete-buildroot/sources/openwrt/root/etc/init.d/S45firewall
deleted file mode 100755 (executable)
index 49b9df0..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-. /etc/functions.sh
-
-WAN=$(nvram get wan_ifname)
-
-IPT=/usr/sbin/iptables
-
-for T in filter nat mangle ; do
-  $IPT -t $T -F
-  $IPT -t $T -X
-done
-
-$IPT -t filter -A INPUT -m state --state INVALID -j DROP
-$IPT -t filter -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT 
-$IPT -t filter -A INPUT -p icmp -j ACCEPT 
-$IPT -t filter -A INPUT -i $WAN -p tcp -j REJECT --reject-with tcp-reset 
-$IPT -t filter -A INPUT -i $WAN -j REJECT --reject-with icmp-port-unreachable 
-$IPT -t filter -A FORWARD -m state --state INVALID -j DROP 
-$IPT -t filter -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT 
-$IPT -t filter -A FORWARD -i $WAN -m state --state NEW,INVALID -j DROP
-$IPT -t filter -A FORWARD -o $WAN -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
-
-$IPT -t nat -A POSTROUTING -o $WAN -j MASQUERADE
diff --git a/obsolete-buildroot/sources/openwrt/root/etc/init.d/S50dnsmasq b/obsolete-buildroot/sources/openwrt/root/etc/init.d/S50dnsmasq
deleted file mode 100755 (executable)
index 995c1b6..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-/usr/sbin/dnsmasq
diff --git a/obsolete-buildroot/sources/openwrt/root/etc/init.d/S50httpd b/obsolete-buildroot/sources/openwrt/root/etc/init.d/S50httpd
deleted file mode 100755 (executable)
index fd66f80..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-/usr/sbin/httpd -p 80 -h /www -r WRT54G Router
diff --git a/obsolete-buildroot/sources/openwrt/root/etc/init.d/S50telnet b/obsolete-buildroot/sources/openwrt/root/etc/init.d/S50telnet
deleted file mode 100755 (executable)
index 29af504..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-/usr/sbin/telnetd -l /bin/login
diff --git a/obsolete-buildroot/sources/openwrt/root/etc/init.d/S99done b/obsolete-buildroot/sources/openwrt/root/etc/init.d/S99done
deleted file mode 100755 (executable)
index 8811e99..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-# automagically run firstboot
-[ -z "$FAILSAFE" ] && {
-       { mount | grep jffs2 1>&-; } || firstboot
-}
-# set leds to normal state
-echo "0x00" > /proc/sys/diag
diff --git a/obsolete-buildroot/sources/openwrt/root/etc/init.d/rcS b/obsolete-buildroot/sources/openwrt/root/etc/init.d/rcS
deleted file mode 100755 (executable)
index 9510e94..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-# Start all init scripts in /etc/init.d
-# executing them in numerical order.
-#
-for i in /etc/init.d/S??* ;do
-
-     # Ignore dangling symlinks (if any).
-     [ ! -f "$i" ] && continue
-
-     case "$i" in
-        *.sh)
-            # Source shell script for speed.
-            (
-                trap - INT QUIT TSTP
-                set start
-                . $i
-            )
-            ;;
-        *)
-            # No sh extension, so fork subprocess.
-            $i start
-            ;;
-    esac
-done
diff --git a/obsolete-buildroot/sources/openwrt/root/etc/inittab b/obsolete-buildroot/sources/openwrt/root/etc/inittab
deleted file mode 100644 (file)
index 3b0c14e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-::sysinit:/etc/init.d/rcS
-::shutdown:/sbin/halt
-tts/0::askfirst:/bin/login
diff --git a/obsolete-buildroot/sources/openwrt/root/etc/ipkg.conf b/obsolete-buildroot/sources/openwrt/root/etc/ipkg.conf
deleted file mode 100644 (file)
index 31a5fdf..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-src openwrt http://openwrt.org/ipkg
-dest root /
-dest ram /tmp
diff --git a/obsolete-buildroot/sources/openwrt/root/etc/nvram.overrides b/obsolete-buildroot/sources/openwrt/root/etc/nvram.overrides
deleted file mode 100644 (file)
index acbba30..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-# NVRAM overrides
-#
-# This file handles the NVRAM quirks of various hardware.
-# THIS FILE IS NOT A REPLACEMENT FOR NVRAM
-
-# linksys bug; remove when not using static configuration for lan
-NVRAM_lan_proto="static"
-
-# hacks for wrt54g 1.x hardware
-[ "$(nvram get boardnum)"  = "42" ] && \
-[ "$(nvram get boardtype)" = "bcm94710dev" ] && {
-
-  # remap eth0 => vlan2, eth1 => vlan1
-  # for all *_ifname(s)
-
-  debug "### wrt54g 1.x hack ###"
-  NVRAM_vlan1hwname="et0"
-  NVRAM_vlan2hwname="et0"
-  FAILSAFE_ifnames="vlan1 vlan2 eth2"
-
-  remap () {
-    eval NVRAM_$1=\"$(nvram get $1 | awk 'gsub("eth0","vlan2") gsub("eth1","vlan1")')\"
-  }
-
-  for type in lan wifi wan pppoe
-  do
-    remap ${type}_ifname
-    remap ${type}_ifnames
-  done
-}
-
-# hacks for wap54g hardware
-[ "$(nvram get boardnum)"  = "2" ] || \
-[ "$(nvram get boardnum)"  = "1024" ] && {
-  debug "### wap54g hack ###"
-  NVRAM_wan_ifname="none"
-  FAILSAFE_ifnames="eth0 eth1"
-}
-
-# defaults if lan_ifname is missing
-[ -z "$(nvram get lan_ifname)" ] && {
-  NVRAM_lan_ifname="br0"
-  NVRAM_lan_ifnames="vlan0 vlan2 eth1 eth2 eth3"
-}
-
-# defaults if wan_ifname is missing
-[ -z "$(nvram get wan_ifname)" ] && {
-   NVRAM_wan_ifname="vlan1"
-   NVRAM_wan_proto="dhcp"
-}
-
-# failsafe if reset is held
-[ "$FAILSAFE" = "true" ] && {
-  echo "### YOU ARE IN FAILSAFE MODE ####"
-  NVRAM_lan_ifname="br0"
-  NVRAM_lan_ifnames=${FAILSAFE_ifnames:-"vlan0 vlan1 eth1"}
-  NVRAM_lan_ipaddr="192.168.1.1"
-  NVRAM_lan_netmask="255.255.255.0"
-  NVRAM_lan_hwaddr="00:0B:AD:0A:DD:00"
-  NVRAM_wan_ifname="none"
-  NVRAM_wifi_ifname="none"
-}
diff --git a/obsolete-buildroot/sources/openwrt/root/etc/preinit b/obsolete-buildroot/sources/openwrt/root/etc/preinit
deleted file mode 100755 (executable)
index 6e6a9c9..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-# executed from squashfs before init to 
-# transfer root to the jffs2 partition
-mount none /proc -t proc
-insmod diag
-echo 0x01 > /proc/sys/diag
-sleep 1
-if [ $(cat /proc/sys/reset) = 1 ] ; then
-  export FAILSAFE=true
-  while :; do { echo $(((X=(X+1)%8)%2)) > /proc/sys/diag; sleep $((X==0)); } done &
-else
-  mtd unlock mtd4
-  mount -t jffs2 /dev/mtdblock/4 /jffs
-  pivot_root /jffs /jffs/rom
-  mount none /dev -t devfs
-  mount none /proc -t proc
-  umount rom/proc rom/dev
-fi
-mount none /tmp -t ramfs
-exec /sbin/init
diff --git a/obsolete-buildroot/sources/openwrt/root/etc/profile b/obsolete-buildroot/sources/openwrt/root/etc/profile
deleted file mode 100644 (file)
index 29cd340..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-[ -f /etc/banner ] && cat /etc/banner
-
-export PATH=/bin:/sbin:/usr/bin:/usr/sbin
-export PS1='\u@\h:\w\$ '
-
-alias less=more
-alias vim=vi
-ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
diff --git a/obsolete-buildroot/sources/openwrt/root/etc/sysctl.conf b/obsolete-buildroot/sources/openwrt/root/etc/sysctl.conf
deleted file mode 100644 (file)
index 8552a4b..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-kernel.panic = 3
-net.ipv4.ip_forward = 1
-net.ipv4.icmp_echo_ignore_broadcasts = 1
-net.ipv4.icmp_ignore_bogus_error_responses = 1
-net.ipv4.tcp_fin_timeout = 30
-net.ipv4.tcp_keepalive_time = 120
-net.ipv4.tcp_timestamps = 0
diff --git a/obsolete-buildroot/sources/openwrt/root/rom/note b/obsolete-buildroot/sources/openwrt/root/rom/note
deleted file mode 100644 (file)
index 4d9934e..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-After firstboot has been run, /rom will contain the previous (squashfs) root
-* except when booted failsafe -- echo $FAILSAFE
diff --git a/obsolete-buildroot/sources/openwrt/root/sbin/halt b/obsolete-buildroot/sources/openwrt/root/sbin/halt
deleted file mode 100755 (executable)
index 2aee693..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-/usr/bin/killall5 -9
-umount -ar
diff --git a/obsolete-buildroot/sources/openwrt/root/sbin/hotplug b/obsolete-buildroot/sources/openwrt/root/sbin/hotplug
deleted file mode 100755 (executable)
index 335ee8f..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/ash
-# $Id$
-[ "${INTERFACE%%[0-9]*}" = "wds" ] && { 
-       [ -x "/usr/sbin/nas" ] && /usr/sbin/nas lan $INTERFACE up
-       ifconfig $INTERFACE 0.0.0.0 up
-       /usr/sbin/brctl addif br0 $INTERFACE
-}
diff --git a/obsolete-buildroot/sources/openwrt/root/sbin/ifdown b/obsolete-buildroot/sources/openwrt/root/sbin/ifdown
deleted file mode 100755 (executable)
index e59e057..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/ash
-. /etc/functions.sh
-  type=$1
-  debug "### ifdown $type ###"
-  if=$(nvram get ${type}_ifname)
-  if_valid $if || return
-  kill $(cat /var/run/${if}.pid 2>&-) 2>&-
-  $DEBUG ifconfig $if down
diff --git a/obsolete-buildroot/sources/openwrt/root/sbin/ifup b/obsolete-buildroot/sources/openwrt/root/sbin/ifup
deleted file mode 100755 (executable)
index 6b4a774..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/ash
-. /etc/functions.sh
-  type=$1
-  debug "### ifup $type ###"
-
-  if=$(nvram get ${type}_ifname)
-  if [ "${if%%[0-9]}" = "ppp" ]; then
-    if=$(nvram get pppoe_ifname)
-  fi
-
-  if_valid $if || return
-
-  $DEBUG ifconfig $if down
-  if [ "${if%%[0-9]}" = "br" ]; then
-    stp=$(nvram get ${type}_stp)
-    $DEBUG brctl delbr $if
-    $DEBUG brctl addbr $if
-    $DEBUG brctl setfd $if 0
-    $DEBUG brctl stp $if ${stp:-0}
-    for sif in $(nvram get ${type}_ifnames); do {
-      if_valid $sif || continue
-      $DEBUG ifconfig $sif 0.0.0.0 up
-      $DEBUG brctl addif $if $sif
-    } done
-  fi
-
-  mac=$(nvram get ${type}_hwaddr)
-  ${mac:+$DEBUG ifconfig $if hw ether $mac}
-
-  if_proto=$(nvram get ${type}_proto)
-  case "$if_proto" in
-    static)
-      ip=$(nvram get ${type}_ipaddr)
-      netmask=$(nvram get ${type}_netmask)
-      gateway=$(nvram get ${type}_gateway)
-
-      $DEBUG ifconfig $if $ip ${netmask:+netmask $netmask} broadcast + up
-      ${gateway:+$DEBUG route add default gw $gateway}
-
-      [ -f /etc/resolv.conf ] && return
-
-      debug "# --- creating /etc/resolv.conf ---"
-      for dns in $(nvram get ${type}_dns); do {
-       echo "nameserver $dns" >> /etc/resolv.conf
-      } done
-    ;;
-    dhcp)
-      pidfile=/tmp/dhcp-${type}.pid
-      if [ -f $pidfile ]; then
-        $DEBUG kill $(cat $pidfile)
-      fi
-      ${DEBUG:-eval} "udhcpc -i $if -b -p $pidfile &" 
-    ;;
-    pppoe)
-      username=$(nvram get ppp_username)
-      password=$(nvram get ppp_passwd)
-      redial=$(nvram get ppp_redialperiod)
-      idletime=$(nvram get ppp_idletime)
-      mtu=$(nvram get wan_mtu)
-
-      $DEBUG ifconfig $if 0.0.0.0 up
-
-      $DEBUG /sbin/pppoecd $if -u $username -p $password \
-        -i 0 -I $redial -T $idletime -t $mtu -k
-    ;;
-    none)
-    ;;
-    *)
-      echo "### WARNING $if: $if_proto is not supported"
-    ;;
-  esac
diff --git a/obsolete-buildroot/sources/openwrt/root/sbin/wifi b/obsolete-buildroot/sources/openwrt/root/sbin/wifi
deleted file mode 100755 (executable)
index 6360fff..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/ash
-alias debug=${DEBUG:-:}
-debug "### wifi $1 ###"
-if=$(awk 'sub(":","") {print $1}' /proc/net/wireless)
-$DEBUG wlconf $if $1
diff --git a/obsolete-buildroot/sources/openwrt/root/usr/share/udhcpc/default.script b/obsolete-buildroot/sources/openwrt/root/usr/share/udhcpc/default.script
deleted file mode 100755 (executable)
index 87be32d..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-# udhcpc script edited by Tim Riker <Tim@Rikers.org>
-# (slightly modified)
-
-[ -z "$1" ] && echo "Error: should be run by udhcpc" && exit 1
-
-RESOLV_CONF="/tmp/resolv.conf"
-
-case "$1" in
-        deconfig)
-                ifconfig $interface 0.0.0.0
-                ;;
-
-        renew|bound)
-                ifconfig $interface $ip \
-                ${broadcast:+broadcast $broadcast} \
-                ${subnet:+netmask $subnet}
-
-                if [ -n "$router" ] ; then
-                        echo "deleting routers"
-                        while route del default gw 0.0.0.0 dev $interface ; do
-                                :
-                        done
-
-                        for i in $router ; do
-                                route add default gw $i dev $interface
-                        done
-                fi
-
-                echo -n > $RESOLV_CONF
-                ${domain:+echo search $domain >> $RESOLV_CONF}
-                for i in $dns ; do
-                        echo adding dns $i
-                        echo nameserver $i >> $RESOLV_CONF
-                done
-                ;;
-esac
-exit 0
diff --git a/obsolete-buildroot/sources/openwrt/root/www/index.html b/obsolete-buildroot/sources/openwrt/root/www/index.html
deleted file mode 100644 (file)
index 575d242..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<HTML>
-<HEAD><TITLE>OpenWrt</TITLE></HEAD>
-<BODY>
-No webpages currently available
-<br>- perhaps you need to install a package?
-</BODY>
-</HTML>
diff --git a/obsolete-buildroot/sources/openwrt/tools/addpattern.c b/obsolete-buildroot/sources/openwrt/tools/addpattern.c
deleted file mode 100644 (file)
index b32ab9f..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Copyright (C) 2004  Manuel Novoa III  <mjn3@codepoet.org>
- *
- * 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, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* July 29, 2004
- *
- * This is a hacked replacement for the 'addpattern' utility used to
- * create wrt54g .bin firmware files.  It isn't pretty, but it does
- * the job for me.
- *
- * Extensions:
- *  -v allows setting the version string on the command line.
- *  -{0|1} sets the (currently ignored) hw_ver flag in the header
- *      to 0 or 1 respectively.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
-#include <sys/stat.h>
-
-/**********************************************************************/
-
-#define CODE_ID                "U2ND"          /* from code_pattern.h */
-#define CODE_PATTERN   "W54S"  /* from code_pattern.h */
-
-#define CYBERTAN_VERSION       "v2.07.1" /* from cyutils.h */
-/* #define CYBERTAN_VERSION    "v2.04.3" */
-
-struct code_header {                   /* from cyutils.h */
-       char magic[4];
-       char res1[4];                           /* for extra magic */
-       char fwdate[3];
-       char fwvern[3];
-       char id[4];                                     /* U2ND */
-#if 0
-       unsigned char res2[14];
-#else
-       char hw_ver;                            /* 0: for 4702, 1: for 4712 -- new in 2.04.3 */
-       unsigned char res2[13];
-#endif
-} ;
-
-/**********************************************************************/
-
-void usage(void) __attribute__ (( __noreturn__ ));
-
-void usage(void)
-{
-       fprintf(stderr, "Usage: addpattern [-i trxfile] [-o binfile] [-p pattern] [-g] [-v v#.#.#] [-{0|1}]\n");
-       exit(EXIT_FAILURE);
-}
-
-int main(int argc, char **argv)
-{
-       char buf[1024]; /* keep this at 1k or adjust garbage calc below */
-       struct code_header *hdr;
-       FILE *in = stdin;
-       FILE *out = stdout;
-       char *ifn = NULL;
-       char *ofn = NULL;
-       char *pattern = CODE_PATTERN;
-       char *version = CYBERTAN_VERSION;
-       int gflag = 0;
-       int c;
-       int v0, v1, v2;
-       size_t off, n;
-       time_t t;
-       struct tm *ptm;
-
-       fprintf(stderr, "mjn3's addpattern replacement - v0.81\n");
-
-       hdr = (struct code_header *) buf;
-
-       while ((c = getopt(argc, argv, "i:o:p:gv:01")) != -1) {
-               switch (c) {
-                       case 'i':
-                               ifn = optarg;
-                               break;
-                       case 'o':
-                               ofn = optarg;
-                               break;
-                       case 'p':
-                               pattern = optarg;
-                               break;
-                       case 'g':
-                               gflag = 1;
-                               break;
-                       case 'v':                       /* extension to allow setting version */
-                               version = optarg;
-                               break;
-                       case '0':
-                               hdr->hw_ver = 0;
-                               break;
-                       case '1':
-                               hdr->hw_ver = 1;
-                               break;
-                       default:
-                               usage();
-               }
-       }
-
-       if (optind != argc) {
-               fprintf(stderr, "illegal arg \"%s\"\n", argv[optind]);
-               usage();
-       }
-
-       if (strlen(pattern) != 4) {
-               fprintf(stderr, "illegal pattern \"%s\": length != 4\n", pattern);
-               usage();
-       }
-
-       if (ifn && !(in = fopen(ifn, "r"))) {
-               fprintf(stderr, "can not open \"%s\" for reading\n", ifn);
-               usage();
-       }
-
-       if (ofn && !(out = fopen(ofn, "w"))) {
-               fprintf(stderr, "can not open \"%s\" for writing\n", ofn);
-               usage();
-       }
-
-       if (time(&t) == (time_t)(-1)) {
-               fprintf(stderr, "time call failed\n");
-               return EXIT_FAILURE;
-       }
-
-       ptm = localtime(&t);
-
-       if (3 != sscanf(version, "v%d.%d.%d", &v0, &v1, &v2)) {
-               fprintf(stderr, "bad version string \"%s\"\n", version);
-               return EXIT_FAILURE;
-       }
-
-       memset(hdr, 0, sizeof(struct code_header));
-       memcpy(&hdr->magic, pattern, 4);
-       hdr->fwdate[0] = ptm->tm_year % 100;
-       hdr->fwdate[1] = ptm->tm_mon + 1;
-       hdr->fwdate[2] = ptm->tm_mday;
-       hdr->fwvern[0] = v0;
-       hdr->fwvern[1] = v1;
-       hdr->fwvern[2] = v2;
-       memcpy(&hdr->id, CODE_ID, strlen(CODE_ID));
-
-       off = sizeof(struct code_header);
-
-       fprintf(stderr, "writing firmware v%d.%d.%d on %d/%d/%d (y/m/d)\n",
-                       v0, v1, v2,
-                       hdr->fwdate[0], hdr->fwdate[1], hdr->fwdate[2]);
-
-
-       while ((n = fread(buf + off, 1, sizeof(buf)-off, in) + off) > 0) {
-               off = 0;
-               if (n < sizeof(buf)) {
-                       if (ferror(in)) {
-                       FREAD_ERROR:
-                               fprintf(stderr, "fread error\n");
-                               return EXIT_FAILURE;
-                       }
-                       if (gflag) {
-                               gflag = sizeof(buf) - n;
-                               memset(buf + n, 0xff, gflag);
-                               fprintf(stderr, "adding %d bytes of garbage\n", gflag);
-                               n = sizeof(buf);
-                       }
-               }
-               if (!fwrite(buf, n, 1, out)) {
-               FWRITE_ERROR:
-                       fprintf(stderr, "fwrite error\n");
-                       return EXIT_FAILURE;
-               }
-       }
-       
-       if (ferror(in)) {
-               goto FREAD_ERROR;
-       }
-
-       if (fflush(out)) {
-               goto FWRITE_ERROR;
-       }
-
-       fclose(in);
-       fclose(out);
-
-       return EXIT_SUCCESS;
-}
diff --git a/obsolete-buildroot/sources/openwrt/tools/sstrip.c b/obsolete-buildroot/sources/openwrt/tools/sstrip.c
deleted file mode 100644 (file)
index e820a44..0000000
+++ /dev/null
@@ -1,483 +0,0 @@
-/* http://www.muppetlabs.com/~breadbox/software/elfkickers.html */
-
-/* sstrip: Copyright (C) 1999-2001 by Brian Raiter, under the GNU
- * General Public License. No warranty. See COPYING for details.
- *
- * Aug 23, 2004 Hacked by Manuel Novoa III <mjn3@codepoet.org> to
- * handle targets of different endianness and/or elf class, making
- * it more useful in a cross-devel environment.
- */
-
-/* ============== original README ===================
- *
- * sstrip is a small utility that removes the contents at the end of an
- * ELF file that are not part of the program's memory image.
- * 
- * Most ELF executables are built with both a program header table and a
- * section header table. However, only the former is required in order
- * for the OS to load, link and execute a program. sstrip attempts to
- * extract the ELF header, the program header table, and its contents,
- * leaving everything else in the bit bucket. It can only remove parts of
- * the file that occur at the end, after the parts to be saved. However,
- * this almost always includes the section header table, and occasionally
- * a few random sections that are not used when running a program.
- * 
- * It should be noted that the GNU bfd library is (understandably)
- * dependent on the section header table as an index to the file's
- * contents. Thus, an executable file that has no section header table
- * cannot be used with gdb, objdump, or any other program based upon the
- * bfd library, at all. In fact, the program will not even recognize the
- * file as a valid executable. (This limitation is noted in the source
- * code comments for bfd, and is marked "FIXME", so this may change at
- * some future date. However, I would imagine that it is a pretty
- * low-priority item, as executables without a section header table are
- * rare in the extreme.) This probably also explains why strip doesn't
- * offer the option to do this.
- * 
- * Shared library files may also have their section header table removed.
- * Such a library will still function; however, it will no longer be
- * possible for a compiler to link a new program against it.
- * 
- * As an added bonus, sstrip also tries to removes trailing zero bytes
- * from the end of the file. (This normally cannot be done with an
- * executable that has a section header table.)
- * 
- * sstrip is a very simplistic program. It depends upon the common
- * practice of putting the parts of the file that contribute to the
- * memory image at the front, and the remaining material at the end. This
- * permits it to discard the latter material without affecting file
- * offsets and memory addresses in what remains. Of course, the ELF
- * standard permits files to be organized in almost any order, so if a
- * pathological linker decided to put its section headers at the top,
- * sstrip would be useless on such executables.
- */
-
-#include       <stdio.h>
-#include       <stdlib.h>
-#include       <string.h>
-#include       <errno.h>
-#include       <unistd.h>
-#include       <fcntl.h>
-#include       <elf.h>
-#ifdef __FreeBSD__
-/**
- * This seems to work on FreeBSD 5.3, should
- * work on all newer versions as well. I have
- * no idea if it will work on versions < 5.3
- *
- * Joe Estock (guru) <jestock at nutextonline.com>
- */
-#include <sys/endian.h>
-#define bswap_64 __bswap64
-#define bswap_32 __bswap32
-#define bswap_16 __bswap16
-#else
-#include       <endian.h>
-#include       <byteswap.h>
-#endif /* defined(__FreeBSD__) */
-
-
-#ifndef TRUE
-#define        TRUE            1
-#define        FALSE           0
-#endif
-
-/* The name of the program.
- */
-static char const      *progname;
-
-/* The name of the current file.
- */
-static char const      *filename;
-
-
-/* A simple error-handling function. FALSE is always returned for the
- * convenience of the caller.
- */
-static int err(char const *errmsg)
-{
-       fprintf(stderr, "%s: %s: %s\n", progname, filename, errmsg);
-       return FALSE;
-}
-
-/* A flag to signal the need for endian reversal.
- */
-static int do_reverse_endian;
-
-/* Get a value from the elf header, compensating for endianness.
- */
-#define EGET(X) \
-       (__extension__ ({ \
-               uint64_t __res; \
-               if (!do_reverse_endian) { \
-                       __res = (X); \
-               } else if (sizeof(X) == 1) { \
-                       __res = (X); \
-               } else if (sizeof(X) == 2) { \
-                       __res = bswap_16((X)); \
-               } else if (sizeof(X) == 4) { \
-                       __res = bswap_32((X)); \
-               } else if (sizeof(X) == 8) { \
-                       __res = bswap_64((X)); \
-               } else { \
-                       fprintf(stderr, "%s: %s: EGET failed for size %d\n", \
-                                       progname, filename, sizeof(X)); \
-                       exit(EXIT_FAILURE); \
-               } \
-               __res; \
-       }))
-
-/* Set a value 'Y' in the elf header to 'X', compensating for endianness.
- */
-#define ESET(Y,X) \
-               do if (!do_reverse_endian) { \
-                       Y = (X); \
-               } else if (sizeof(Y) == 1) { \
-                       Y = (X); \
-               } else if (sizeof(Y) == 2) { \
-                       Y = bswap_16((uint16_t)(X)); \
-               } else if (sizeof(Y) == 4) { \
-                       Y = bswap_32((uint32_t)(X)); \
-               } else if (sizeof(Y) == 8) { \
-                       Y = bswap_64((uint64_t)(X)); \
-               } else { \
-                       fprintf(stderr, "%s: %s: ESET failed for size %d\n", \
-                                       progname, filename, sizeof(Y)); \
-                       exit(EXIT_FAILURE); \
-               } while (0)
-
-
-/* A macro for I/O errors: The given error message is used only when
- * errno is not set.
- */
-#define        ferr(msg)       (err(errno ? strerror(errno) : (msg)))
-
-
-
-#define HEADER_FUNCTIONS(CLASS) \
- \
-/* readelfheader() reads the ELF header into our global variable, and \
- * checks to make sure that this is in fact a file that we should be \
- * munging. \
- */ \
-static int readelfheader ## CLASS (int fd, Elf ## CLASS ## _Ehdr *ehdr) \
-{ \
-        if (read(fd, ((char *)ehdr)+EI_NIDENT, sizeof(*ehdr) - EI_NIDENT) \
-               != sizeof(*ehdr) - EI_NIDENT) \
-               return ferr("missing or incomplete ELF header."); \
- \
-       /* Verify the sizes of the ELF header and the program segment \
-        * header table entries. \
-        */ \
-       if (EGET(ehdr->e_ehsize) != sizeof(Elf ## CLASS ## _Ehdr)) \
-               return err("unrecognized ELF header size."); \
-       if (EGET(ehdr->e_phentsize) != sizeof(Elf ## CLASS ## _Phdr)) \
-               return err("unrecognized program segment header size."); \
- \
-       /* Finally, check the file type. \
-        */ \
-       if (EGET(ehdr->e_type) != ET_EXEC && EGET(ehdr->e_type) != ET_DYN) \
-               return err("not an executable or shared-object library."); \
- \
-       return TRUE; \
-} \
- \
-/* readphdrtable() loads the program segment header table into memory. \
- */ \
-static int readphdrtable ## CLASS (int fd, Elf ## CLASS ## _Ehdr const *ehdr, \
-                                                                  Elf ## CLASS ## _Phdr **phdrs) \
-{ \
-       size_t  size; \
- \
-       if (!EGET(ehdr->e_phoff) || !EGET(ehdr->e_phnum) \
-)              return err("ELF file has no program header table."); \
- \
-       size = EGET(ehdr->e_phnum) * sizeof **phdrs; \
-       if (!(*phdrs = malloc(size))) \
-               return err("Out of memory!"); \
- \
-       errno = 0; \
-       if (read(fd, *phdrs, size) != (ssize_t)size) \
-               return ferr("missing or incomplete program segment header table."); \
- \
-       return TRUE; \
-} \
- \
-/* getmemorysize() determines the offset of the last byte of the file \
- * that is referenced by an entry in the program segment header table. \
- * (Anything in the file after that point is not used when the program \
- * is executing, and thus can be safely discarded.) \
- */ \
-static int getmemorysize ## CLASS (Elf ## CLASS ## _Ehdr const *ehdr, \
-                                                                  Elf ## CLASS ## _Phdr const *phdrs, \
-                                                unsigned long *newsize) \
-{ \
-       Elf ## CLASS ## _Phdr const   *phdr; \
-       unsigned long   size, n; \
-       int                     i; \
- \
-       /* Start by setting the size to include the ELF header and the \
-        * complete program segment header table. \
-        */ \
-       size = EGET(ehdr->e_phoff) + EGET(ehdr->e_phnum) * sizeof *phdrs; \
-       if (size < sizeof *ehdr) \
-               size = sizeof *ehdr; \
- \
-       /* Then keep extending the size to include whatever data the \
-        * program segment header table references. \
-        */ \
-       for (i = 0, phdr = phdrs ; i < EGET(ehdr->e_phnum) ; ++i, ++phdr) { \
-               if (EGET(phdr->p_type) != PT_NULL) { \
-                       n = EGET(phdr->p_offset) + EGET(phdr->p_filesz); \
-                       if (n > size) \
-                               size = n; \
-               } \
-       } \
- \
-       *newsize = size; \
-       return TRUE; \
-} \
- \
-/* modifyheaders() removes references to the section header table if \
- * it was stripped, and reduces program header table entries that \
- * included truncated bytes at the end of the file. \
- */ \
-static int modifyheaders ## CLASS (Elf ## CLASS ## _Ehdr *ehdr, \
-                                                                  Elf ## CLASS ## _Phdr *phdrs, \
-                                                                  unsigned long newsize) \
-{ \
-       Elf ## CLASS ## _Phdr *phdr; \
-       int             i; \
- \
-       /* If the section header table is gone, then remove all references \
-        * to it in the ELF header. \
-        */ \
-       if (EGET(ehdr->e_shoff) >= newsize) { \
-               ESET(ehdr->e_shoff,0); \
-               ESET(ehdr->e_shnum,0); \
-               ESET(ehdr->e_shentsize,0); \
-               ESET(ehdr->e_shstrndx,0); \
-       } \
- \
-       /* The program adjusts the file size of any segment that was \
-        * truncated. The case of a segment being completely stripped out \
-        * is handled separately. \
-        */ \
-       for (i = 0, phdr = phdrs ; i < EGET(ehdr->e_phnum) ; ++i, ++phdr) { \
-               if (EGET(phdr->p_offset) >= newsize) { \
-                       ESET(phdr->p_offset,newsize); \
-                       ESET(phdr->p_filesz,0); \
-               } else if (EGET(phdr->p_offset) + EGET(phdr->p_filesz) > newsize) { \
-                       newsize -= EGET(phdr->p_offset); \
-                       ESET(phdr->p_filesz, newsize); \
-               } \
-       } \
- \
-       return TRUE; \
-} \
- \
-/* commitchanges() writes the new headers back to the original file \
- * and sets the file to its new size. \
- */ \
-static int commitchanges ## CLASS (int fd, Elf ## CLASS ## _Ehdr const *ehdr, \
-                                                                  Elf ## CLASS ## _Phdr *phdrs, \
-                                                                  unsigned long newsize) \
-{ \
-       size_t  n; \
- \
-       /* Save the changes to the ELF header, if any. \
-        */ \
-       if (lseek(fd, 0, SEEK_SET)) \
-               return ferr("could not rewind file"); \
-       errno = 0; \
-       if (write(fd, ehdr, sizeof *ehdr) != sizeof *ehdr) \
-               return err("could not modify file"); \
- \
-       /* Save the changes to the program segment header table, if any. \
-        */ \
-       if (lseek(fd, EGET(ehdr->e_phoff), SEEK_SET) == (off_t)-1) { \
-               err("could not seek in file."); \
-               goto warning; \
-       } \
-       n = EGET(ehdr->e_phnum) * sizeof *phdrs; \
-       if (write(fd, phdrs, n) != (ssize_t)n) { \
-               err("could not write to file"); \
-               goto warning; \
-       } \
- \
-       /* Eleventh-hour sanity check: don't truncate before the end of \
-        * the program segment header table. \
-        */ \
-       if (newsize < EGET(ehdr->e_phoff) + n) \
-               newsize = EGET(ehdr->e_phoff) + n; \
- \
-       /* Chop off the end of the file. \
-        */ \
-       if (ftruncate(fd, newsize)) { \
-               err("could not resize file"); \
-               goto warning; \
-       } \
- \
-       return TRUE; \
- \
- warning: \
-       return err("ELF file may have been corrupted!"); \
-}
-
-
-/* First elements of Elf32_Ehdr and Elf64_Ehdr are common.
- */
-static int readelfheaderident(int fd, Elf32_Ehdr *ehdr)
-{
-       errno = 0;
-       if (read(fd, ehdr, EI_NIDENT) != EI_NIDENT)
-               return ferr("missing or incomplete ELF header.");
-
-       /* Check the ELF signature.
-        */
-       if (!(ehdr->e_ident[EI_MAG0] == ELFMAG0 &&
-                 ehdr->e_ident[EI_MAG1] == ELFMAG1 &&
-                 ehdr->e_ident[EI_MAG2] == ELFMAG2 &&
-                 ehdr->e_ident[EI_MAG3] == ELFMAG3))
-       {
-               err("missing ELF signature.");
-               return -1;
-       }
-
-       /* Compare the file's class and endianness with the program's.
-        */
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-       if (ehdr->e_ident[EI_DATA] == ELFDATA2LSB) {
-               do_reverse_endian = 0;
-       } else if (ehdr->e_ident[EI_DATA] == ELFDATA2MSB) {
-/*             fprintf(stderr, "ELF file has different endianness.\n"); */
-               do_reverse_endian = 1;
-       }
-#elif __BYTE_ORDER == __BIG_ENDIAN
-       if (ehdr->e_ident[EI_DATA] == ELFDATA2LSB) {
-/*             fprintf(stderr, "ELF file has different endianness.\n"); */
-               do_reverse_endian = 1;
-       } else if (ehdr->e_ident[EI_DATA] == ELFDATA2MSB) {
-               do_reverse_endian = 0;
-       }
-#else
-#error unkown endianness
-#endif
-       else {
-               err("Unsupported endianness");
-               return -1;
-       }
-
-       /* Check the target architecture.
-        */
-/*      if (EGET(ehdr->e_machine) != ELF_ARCH) { */
-/*             /\* return err("ELF file created for different architecture."); *\/ */
-/*             fprintf(stderr, "ELF file created for different architecture.\n"); */
-/*     } */
-       return ehdr->e_ident[EI_CLASS];
-}
-
-
-HEADER_FUNCTIONS(32)
-
-HEADER_FUNCTIONS(64)
-
-/* truncatezeros() examines the bytes at the end of the file's
- * size-to-be, and reduces the size to exclude any trailing zero
- * bytes.
- */
-static int truncatezeros(int fd, unsigned long *newsize)
-{
-       unsigned char   contents[1024];
-       unsigned long   size, n;
-
-       size = *newsize;
-       do {
-               n = sizeof contents;
-               if (n > size)
-                       n = size;
-               if (lseek(fd, size - n, SEEK_SET) == (off_t)-1)
-                       return ferr("cannot seek in file.");
-               if (read(fd, contents, n) != (ssize_t)n)
-                       return ferr("cannot read file contents");
-               while (n && !contents[--n])
-                       --size;
-       } while (size && !n);
-
-       /* Sanity check.
-        */
-       if (!size)
-               return err("ELF file is completely blank!");
-
-       *newsize = size;
-       return TRUE;
-}
-
-/* main() loops over the cmdline arguments, leaving all the real work
- * to the other functions.
- */
-int main(int argc, char *argv[])
-{
-       int                             fd;
-       union {
-               Elf32_Ehdr      ehdr32;
-               Elf64_Ehdr      ehdr64;
-       } e;
-       union {
-               Elf32_Phdr      *phdrs32;
-               Elf64_Phdr      *phdrs64;
-       } p;
-       unsigned long   newsize;
-       char                    **arg;
-       int                             failures = 0;
-
-       if (argc < 2 || argv[1][0] == '-') {
-               printf("Usage: sstrip FILE...\n"
-                          "sstrip discards all nonessential bytes from an executable.\n\n"
-                          "Version 2.0-X Copyright (C) 2000,2001 Brian Raiter.\n"
-                          "Cross-devel hacks Copyright (C) 2004 Manuel Novoa III.\n"
-                          "This program is free software, licensed under the GNU\n"
-                          "General Public License. There is absolutely no warranty.\n");
-               return EXIT_SUCCESS;
-       }
-
-       progname = argv[0];
-
-       for (arg = argv + 1 ; *arg != NULL ; ++arg) {
-               filename = *arg;
-
-               fd = open(*arg, O_RDWR);
-               if (fd < 0) {
-                       ferr("can't open");
-                       ++failures;
-                       continue;
-               }
-
-               switch (readelfheaderident(fd, &e.ehdr32)) {
-                       case ELFCLASS32:
-                               if (!(readelfheader32(fd, &e.ehdr32)                                    &&
-                                         readphdrtable32(fd, &e.ehdr32, &p.phdrs32)            &&
-                                         getmemorysize32(&e.ehdr32, p.phdrs32, &newsize)       &&
-                                         truncatezeros(fd, &newsize)                                           &&
-                                         modifyheaders32(&e.ehdr32, p.phdrs32, newsize)        &&
-                                         commitchanges32(fd, &e.ehdr32, p.phdrs32, newsize)))
-                                       ++failures;
-                               break;
-                       case ELFCLASS64:
-                               if (!(readelfheader64(fd, &e.ehdr64)                                    &&
-                                         readphdrtable64(fd, &e.ehdr64, &p.phdrs64)            &&
-                                         getmemorysize64(&e.ehdr64, p.phdrs64, &newsize)       &&
-                                         truncatezeros(fd, &newsize)                                           &&
-                                         modifyheaders64(&e.ehdr64, p.phdrs64, newsize)        &&
-                                         commitchanges64(fd, &e.ehdr64, p.phdrs64, newsize)))
-                                       ++failures;
-                               break;
-                       default:
-                               ++failures;
-                               break;
-               }
-               close(fd);
-       }
-
-       return failures ? EXIT_FAILURE : EXIT_SUCCESS;
-}
diff --git a/obsolete-buildroot/sources/openwrt/tools/trx.c b/obsolete-buildroot/sources/openwrt/tools/trx.c
deleted file mode 100644 (file)
index f029dc5..0000000
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * Copyright (C) 2004  Manuel Novoa III  <mjn3@codepoet.org>
- *
- * 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, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* July 29, 2004
- *
- * This is a hacked replacement for the 'trx' utility used to create
- * wrt54g .trx firmware files.  It isn't pretty, but it does the job
- * for me.
- *
- * As an extension, you can specify a larger maximum length for the
- * .trx file using '-m'.  It will be rounded up to be a multiple of 4K.
- * NOTE: This space will be malloc()'d.
- *
- * August 16, 2004
- *
- * Sigh... Make it endian-neutral.
- *
- * TODO: Support '-b' option to specify offsets for each file.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <string.h>
-#include <errno.h>
-#include <unistd.h>
-#include <endian.h>
-#include <byteswap.h>
-
-#if __BYTE_ORDER == __BIG_ENDIAN
-#define STORE32_LE(X)          bswap_32(X)
-#elif __BYTE_ORDER == __LITTLE_ENDIAN
-#define STORE32_LE(X)          (X)
-#else
-#error unkown endianness!
-#endif
-
-uint32_t crc32buf(char *buf, size_t len);
-
-/**********************************************************************/
-/* from trxhdr.h */
-
-#define TRX_MAGIC      0x30524448      /* "HDR0" */
-#define TRX_VERSION    1
-#define TRX_MAX_LEN    0x3A0000
-#define TRX_NO_HEADER  1               /* Do not write TRX header */   
-
-struct trx_header {
-       uint32_t magic;                 /* "HDR0" */
-       uint32_t len;                   /* Length of file including header */
-       uint32_t crc32;                 /* 32-bit CRC from flag_version to end of file */
-       uint32_t flag_version;  /* 0:15 flags, 16:31 version */
-       uint32_t offsets[3];    /* Offsets of partitions from start of header */
-};
-
-/**********************************************************************/
-
-void usage(void) __attribute__ (( __noreturn__ ));
-
-void usage(void)
-{
-       fprintf(stderr, "Usage: trx [-o outfile] [-m maxlen] file [file [file]]\n");
-       exit(EXIT_FAILURE);
-}
-
-int main(int argc, char **argv)
-{
-       FILE *out = stdout;
-       FILE *in;
-       char *ofn = NULL;
-       char *buf;
-       char *e;
-       int c, i;
-       size_t n;
-       uint32_t cur_len;
-       unsigned long maxlen = TRX_MAX_LEN;
-       struct trx_header *p;
-
-       fprintf(stderr, "mjn3's trx replacement - v0.81\n");
-
-       while ((c = getopt(argc, argv, "o:m:")) != -1) {
-               switch (c) {
-                       case 'o':
-                               ofn = optarg;
-                               break;
-                       case 'm':
-                               errno = 0;
-                               maxlen = strtoul(optarg, &e, 0);
-                               if (errno || (e == optarg) || *e) {
-                                       fprintf(stderr, "illegal numeric string\n");
-                                       usage();
-                               }
-#undef  ROUND
-#define ROUND 0x1000
-                               if (maxlen & (ROUND-1)) {
-                                       maxlen += (ROUND - (maxlen & (ROUND-1)));
-                               }
-                               if (maxlen < ROUND) {
-                                       fprintf(stderr, "maxlen too small (or wrapped)\n");
-                                       usage();
-                               }
-                               break;
-                       default:
-                               usage();
-               }
-       }
-
-       if (ofn && !(out = fopen(ofn, "w"))) {
-               fprintf(stderr, "can not open \"%s\" for writing\n", ofn);
-               usage();
-       }
-
-       if (optind == argc) {
-               fprintf(stderr, "we require at least one arg\n");
-               usage();
-       }
-
-       if (argc - optind > 3) {
-               fprintf(stderr, "too many args: %d > 3\n", argc - optind);
-               usage();
-       }
-
-       if (maxlen > TRX_MAX_LEN) {
-               fprintf(stderr, "WARNING: maxlen exceeds default maximum!  Beware of overwriting nvram!\n");
-       }
-
-       if (!(buf = malloc(maxlen))) {
-               fprintf(stderr, "malloc failed\n");
-               return EXIT_FAILURE;
-       }
-
-       p = (struct trx_header *) buf;
-
-       p->magic = STORE32_LE(TRX_MAGIC);
-       cur_len = sizeof(struct trx_header);
-       p->flag_version = STORE32_LE((TRX_VERSION << 16));
-
-       i = 0;
-
-       while (optind < argc) {
-               p->offsets[i++] = STORE32_LE(cur_len);
-
-               if (!(in = fopen(argv[optind], "r"))) {
-                       fprintf(stderr, "can not open \"%s\" for reading\n", argv[optind]);
-                       usage();
-               }
-
-               n = fread(buf + cur_len, 1, maxlen - cur_len, in);
-               if (!feof(in)) {
-                       fprintf(stderr, "fread failure or file \"%s\" too large\n",
-                                       argv[optind]);
-                       fclose(in);
-                       return EXIT_FAILURE;
-               }
-
-               fclose(in);
-
-               ++optind;
-
-               if (optind < argc) {
-#undef  ROUND
-#define ROUND 4
-                       if (n & (ROUND-1)) {
-                               memset(buf + cur_len + n, 0, ROUND - (n & (ROUND-1)));
-                               n += ROUND - (n & (ROUND-1));
-                       }
-               }
-
-               cur_len += n;
-       }
-
-#undef  ROUND
-#define ROUND 0x1000
-       n = cur_len & (ROUND-1);
-       if (n) {
-               memset(buf + cur_len, 0, ROUND - n);
-               cur_len += ROUND - n;
-       }
-
-       p->crc32 = crc32buf((char *) &p->flag_version,
-                                               cur_len - offsetof(struct trx_header, flag_version));
-       p->crc32 = STORE32_LE(p->crc32);
-
-       p->len = STORE32_LE(cur_len);
-
-       if (!fwrite(buf, cur_len, 1, out) || fflush(out)) {
-               fprintf(stderr, "fwrite failed\n");
-               return EXIT_FAILURE;
-       }
-
-       fclose(out);
-
-       return EXIT_SUCCESS;
-}
-
-/**********************************************************************/
-/* The following was grabbed and tweaked from the old snippets collection
- * of public domain C code. */
-
-/**********************************************************************\
-|* Demonstration program to compute the 32-bit CRC used as the frame  *|
-|* check sequence in ADCCP (ANSI X3.66, also known as FIPS PUB 71     *|
-|* and FED-STD-1003, the U.S. versions of CCITT's X.25 link-level     *|
-|* protocol).  The 32-bit FCS was added via the Federal Register,     *|
-|* 1 June 1982, p.23798.  I presume but don't know for certain that   *|
-|* this polynomial is or will be included in CCITT V.41, which        *|
-|* defines the 16-bit CRC (often called CRC-CCITT) polynomial.  FIPS  *|
-|* PUB 78 says that the 32-bit FCS reduces otherwise undetected       *|
-|* errors by a factor of 10^-5 over 16-bit FCS.                       *|
-\**********************************************************************/
-
-/* Copyright (C) 1986 Gary S. Brown.  You may use this program, or
-   code or tables extracted from it, as desired without restriction.*/
-
-/* First, the polynomial itself and its table of feedback terms.  The  */
-/* polynomial is                                                       */
-/* X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 */
-/* Note that we take it "backwards" and put the highest-order term in  */
-/* the lowest-order bit.  The X^32 term is "implied"; the LSB is the   */
-/* X^31 term, etc.  The X^0 term (usually shown as "+1") results in    */
-/* the MSB being 1.                                                    */
-
-/* Note that the usual hardware shift register implementation, which   */
-/* is what we're using (we're merely optimizing it by doing eight-bit  */
-/* chunks at a time) shifts bits into the lowest-order term.  In our   */
-/* implementation, that means shifting towards the right.  Why do we   */
-/* do it this way?  Because the calculated CRC must be transmitted in  */
-/* order from highest-order term to lowest-order term.  UARTs transmit */
-/* characters in order from LSB to MSB.  By storing the CRC this way,  */
-/* we hand it to the UART in the order low-byte to high-byte; the UART */
-/* sends each low-bit to hight-bit; and the result is transmission bit */
-/* by bit from highest- to lowest-order term without requiring any bit */
-/* shuffling on our part.  Reception works similarly.                  */
-
-/* The feedback terms table consists of 256, 32-bit entries.  Notes:   */
-/*                                                                     */
-/*  1. The table can be generated at runtime if desired; code to do so */
-/*     is shown later.  It might not be obvious, but the feedback      */
-/*     terms simply represent the results of eight shift/xor opera-    */
-/*     tions for all combinations of data and CRC register values.     */
-/*                                                                     */
-/*  2. The CRC accumulation logic is the same for all CRC polynomials, */
-/*     be they sixteen or thirty-two bits wide.  You simply choose the */
-/*     appropriate table.  Alternatively, because the table can be     */
-/*     generated at runtime, you can start by generating the table for */
-/*     the polynomial in question and use exactly the same "updcrc",   */
-/*     if your application needn't simultaneously handle two CRC       */
-/*     polynomials.  (Note, however, that XMODEM is strange.)          */
-/*                                                                     */
-/*  3. For 16-bit CRCs, the table entries need be only 16 bits wide;   */
-/*     of course, 32-bit entries work OK if the high 16 bits are zero. */
-/*                                                                     */
-/*  4. The values must be right-shifted by eight bits by the "updcrc"  */
-/*     logic; the shift must be unsigned (bring in zeroes).  On some   */
-/*     hardware you could probably optimize the shift in assembler by  */
-/*     using byte-swap instructions.                                   */
-
-static const uint32_t crc_32_tab[] = { /* CRC polynomial 0xedb88320 */
-0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
-0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
-0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2,
-0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
-0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
-0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
-0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c,
-0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
-0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,
-0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
-0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106,
-0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
-0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,
-0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
-0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
-0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
-0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,
-0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
-0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa,
-0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
-0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,
-0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
-0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84,
-0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
-0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
-0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
-0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e,
-0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
-0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,
-0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
-0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28,
-0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
-0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,
-0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
-0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
-0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
-0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,
-0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
-0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc,
-0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
-0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,
-0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
-0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
-};
-
-#define UPDC32(octet,crc) (crc_32_tab[((crc) ^ (octet)) & 0xff] ^ ((crc) >> 8))
-
-uint32_t crc32buf(char *buf, size_t len)
-{
-      uint32_t crc;
-
-      crc = 0xFFFFFFFF;
-
-      for ( ; len; --len, ++buf)
-      {
-            crc = UPDC32(*buf, crc);
-      }
-
-      return crc;
-}
diff --git a/obsolete-buildroot/sources/patch-kernel.sh b/obsolete-buildroot/sources/patch-kernel.sh
deleted file mode 100755 (executable)
index 79401c2..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#! /bin/sh
-# A little script I whipped up to make it easy to
-# patch source trees and have sane error handling
-# -Erik
-#
-# (c) 2002 Erik Andersen <andersen@codepoet.org>
-
-# Set directories from arguments, or use defaults.
-targetdir=${1-.}
-patchdir=${2-../kernel-patches}
-patchpattern=${3-*}
-
-if [ ! -d "${targetdir}" ] ; then
-    echo "Aborting.  '${targetdir}' is not a directory."
-    exit 1
-fi
-if [ ! -d "${patchdir}" ] ; then
-    echo "Aborting.  '${patchdir}' is not a directory."
-    exit 1
-fi
-    
-for i in ${patchdir}/${patchpattern} ; do 
-    case "$i" in
-       *.gz)
-       type="gzip"; uncomp="gunzip -dc"; ;; 
-       *.bz)
-       type="bzip"; uncomp="bunzip -dc"; ;; 
-       *.bz2)
-       type="bzip2"; uncomp="bunzip2 -dc"; ;; 
-       *.zip)
-       type="zip"; uncomp="unzip -d"; ;; 
-       *.Z)
-       type="compress"; uncomp="uncompress -c"; ;; 
-       *)
-       type="plaintext"; uncomp="cat"; ;; 
-    esac
-    echo ""
-    echo "Applying ${i} using ${type}: " 
-    ${uncomp} ${i} | patch -p1 -E -d ${targetdir} 
-    if [ $? != 0 ] ; then
-        echo "Patch failed!  Please fix $i!"
-       exit 1
-    fi
-done
-
-# Check for rejects...
-if [ "`find $targetdir/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; then
-    echo "Aborting.  Reject files found."
-    exit 1
-fi
-
-# Remove backup files
-find $targetdir/ '(' -name '*.orig' -o -name '.*.orig' ')' -exec rm -f {} \;
diff --git a/obsolete-buildroot/sources/pppoecd.prerm b/obsolete-buildroot/sources/pppoecd.prerm
deleted file mode 100644 (file)
index 092bf00..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-killall pppoecd
-sleep 3
-killall -9 pppoecd
\ No newline at end of file
diff --git a/obsolete-buildroot/sources/sedcheck.sh b/obsolete-buildroot/sources/sedcheck.sh
deleted file mode 100755 (executable)
index 4d645b6..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-if [ -x /usr/bin/sed ]; then 
-    SED="/usr/bin/sed";
-else
-    if [ -x /bin/sed ]; then 
-       SED="/bin/sed";
-    fi;
-fi;
-
-echo "HELLO" > .sedtest
-$SED -i -e "s/HELLO/GOODBYE/" .sedtest >/dev/null 2>&1
-
-if [ $? != 0 ] ; then
-       echo build-sed-host-binary
-else
-       echo use-sed-host-binary
-fi;
-rm -f .sedtest
-
-
diff --git a/obsolete-buildroot/sources/specs-arm-soft-float b/obsolete-buildroot/sources/specs-arm-soft-float
deleted file mode 100644 (file)
index 3f726bd..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-*asm:
-%{mbig-endian:-EB} %{mlittle-endian:-EL} %{mcpu=*:-mcpu=%*} %{march=*:-march=%*} %{mapcs-*:-mapcs-%*} %(subtarget_asm_float_spec) %{mthumb-interwork:-mthumb-interwork} %(subtarget_extra_asm_spec)
-
-*asm_debug:
-%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}
-
-*asm_final:
-
-
-*asm_options:
-%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}
-
-*invoke_as:
-%{!S:-o %{|!pipe:%g.s} |
- as %(asm_options) %{!pipe:%g.s} %A }
-
-*cpp:
-%(cpp_cpu_arch) %(subtarget_cpp_spec)                  %{mapcs-32:%{mapcs-26:                                                          %e-mapcs-26 and -mapcs-32 may not be used together}}            %{msoft-float:%{mhard-float:                                                    %e-msoft-float and -mhard_float may not be used together}}      %{mbig-endian:%{mlittle-endian:                                                 %e-mbig-endian and -mlittle-endian may not be used together}}
-
-*cpp_options:
-%(cpp_unique_options) %1 %{m*} %{std*} %{ansi} %{W*&pedantic*} %{w} %{f*} %{O*} %{undef}
-
-*cpp_debug_options:
-%{d*}
-
-*cpp_unique_options:
-%{C:%{!E:%eGNU C does not support -C without using -E}} %{CC:%{!E:%eGNU C does not support -CC without using -E}} %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}} %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3} %{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{E|M|MM:%W{o*}}
-
-*trad_capable_cpp:
-cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}
-
-*cc1:
-%{profile:-p}
-
-*cc1_options:
-%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} -auxbase%{c|S:%{o*:-strip %*}%{!o*: %b}}%{!c:%{!S: %b}} %{g*} %{O*} %{W*&pedantic*} %{w} %{std*} %{ansi} %{v:-version} %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{--help:--help} %{--target-help:--target-help} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*} %{msoft-float:%{mhard-float: %e-msoft-float and -mhard_float may not be used together}} %{!mhard-float:%{!msoft-float:-msoft-float}}
-
-*cc1plus:
-
-
-*link_gcc_c_sequence:
-%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}
-
-*endfile:
-%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s
-
-*link:
-%{h*} %{version:-v}    %{b} %{Wl,*:%*}    %{static:-Bstatic}    %{shared:-shared}    %{symbolic:-Bsymbolic}    %{rdynamic:-export-dynamic}    %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}    -X    %{mbig-endian:-EB} -m armelf_linux -p
-
-*lib:
-%{pthread:-lpthread}    %{shared:-lc}    %{!shared:%{profile:-lc_p}%{!profile:-lc}}
-
-*libgcc:
-%{!mhard-float:-lfloat} %{static|static-libgcc:-lgcc -lgcc_eh}%{!static:%{!static-libgcc:%{!shared:%{!shared-libgcc:-lgcc -lgcc_eh}%{shared-libgcc:-lgcc_s%M -lgcc}}%{shared:-lgcc_s%M}}}
-
-*startfile:
-%{!shared:      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s}                  %{!p:%{profile:gcrt1.o%s}                         %{!profile:crt1.o%s}}}}    crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}
-
-*switches_need_spaces:
-
-
-*predefines:
-
-
-*cross_compile:
-1
-
-*version:
-3.3.3
-
-*multilib:
-. ;
-
-*multilib_defaults:
-marm mlittle-endian msoft-float mapcs-32 mno-thumb-interwork
-
-*multilib_extra:
-
-
-*multilib_matches:
-
-
-*multilib_exclusions:
-
-
-*multilib_options:
-
-
-*linker:
-collect2
-
-*link_libgcc:
-%D
-
-*md_exec_prefix:
-
-
-*md_startfile_prefix:
-
-
-*md_startfile_prefix_1:
-
-
-*startfile_prefix_spec:
-
-
-*cpp_cpu_arch:
-%{march=arm2:-D__ARM_ARCH_2__} %{march=arm250:-D__ARM_ARCH_2__} %{march=arm3:-D__ARM_ARCH_2__} %{march=arm6:-D__ARM_ARCH_3__} %{march=arm600:-D__ARM_ARCH_3__} %{march=arm610:-D__ARM_ARCH_3__} %{march=arm7:-D__ARM_ARCH_3__} %{march=arm700:-D__ARM_ARCH_3__} %{march=arm710:-D__ARM_ARCH_3__} %{march=arm720:-D__ARM_ARCH_3__} %{march=arm7100:-D__ARM_ARCH_3__} %{march=arm7500:-D__ARM_ARCH_3__} %{march=arm7500fe:-D__ARM_ARCH_3__} %{march=arm7m:-D__ARM_ARCH_3M__} %{march=arm7dm:-D__ARM_ARCH_3M__} %{march=arm7dmi:-D__ARM_ARCH_3M__} %{march=arm7tdmi:-D__ARM_ARCH_4T__} %{march=arm8:-D__ARM_ARCH_4__} %{march=arm810:-D__ARM_ARCH_4__} %{march=arm9:-D__ARM_ARCH_4T__} %{march=arm920:-D__ARM_ARCH_4__} %{march=arm920t:-D__ARM_ARCH_4T__} %{march=arm9tdmi:-D__ARM_ARCH_4T__} %{march=strongarm:-D__ARM_ARCH_4__} %{march=strongarm110:-D__ARM_ARCH_4__} %{march=strongarm1100:-D__ARM_ARCH_4__} %{march=xscale:-D__ARM_ARCH_5TE__} %{march=xscale:-D__XSCALE__} %{march=armv2:-D__ARM_ARCH_2__} %{march=armv2a:-D__ARM_ARCH_2__} %{march=armv3:-D__ARM_ARCH_3__} %{march=armv3m:-D__ARM_ARCH_3M__} %{march=armv4:-D__ARM_ARCH_4__} %{march=armv4t:-D__ARM_ARCH_4T__} %{march=armv5:-D__ARM_ARCH_5__} %{march=armv5t:-D__ARM_ARCH_5T__} %{march=armv5e:-D__ARM_ARCH_5E__} %{march=armv5te:-D__ARM_ARCH_5TE__} %{!march=*:  %{mcpu=arm2:-D__ARM_ARCH_2__}  %{mcpu=arm250:-D__ARM_ARCH_2__}  %{mcpu=arm3:-D__ARM_ARCH_2__}  %{mcpu=arm6:-D__ARM_ARCH_3__}  %{mcpu=arm600:-D__ARM_ARCH_3__}  %{mcpu=arm610:-D__ARM_ARCH_3__}  %{mcpu=arm7:-D__ARM_ARCH_3__}  %{mcpu=arm700:-D__ARM_ARCH_3__}  %{mcpu=arm710:-D__ARM_ARCH_3__}  %{mcpu=arm720:-D__ARM_ARCH_3__}  %{mcpu=arm7100:-D__ARM_ARCH_3__}  %{mcpu=arm7500:-D__ARM_ARCH_3__}  %{mcpu=arm7500fe:-D__ARM_ARCH_3__}  %{mcpu=arm7m:-D__ARM_ARCH_3M__}  %{mcpu=arm7dm:-D__ARM_ARCH_3M__}  %{mcpu=arm7dmi:-D__ARM_ARCH_3M__}  %{mcpu=arm7tdmi:-D__ARM_ARCH_4T__}  %{mcpu=arm8:-D__ARM_ARCH_4__}  %{mcpu=arm810:-D__ARM_ARCH_4__}  %{mcpu=arm9:-D__ARM_ARCH_4T__}  %{mcpu=arm920:-D__ARM_ARCH_4__}  %{mcpu=arm920t:-D__ARM_ARCH_4T__}  %{mcpu=arm9tdmi:-D__ARM_ARCH_4T__}  %{mcpu=strongarm:-D__ARM_ARCH_4__}  %{mcpu=strongarm110:-D__ARM_ARCH_4__}  %{mcpu=strongarm1100:-D__ARM_ARCH_4__}  %{mcpu=xscale:-D__ARM_ARCH_5TE__}  %{mcpu=xscale:-D__XSCALE__}  %{!mcpu*:%(cpp_cpu_arch_default)}} 
-
-*cpp_cpu_arch_default:
--D__ARM_ARCH_4T__
-
-*subtarget_cpp_spec:
-%{posix:-D_POSIX_SOURCE} %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__}
-
-*subtarget_extra_asm_spec:
-
-
-*subtarget_asm_float_spec:
-%{mapcs-float:-mfloat} %{!mhard-float:-mno-fpu}
-
-*link_command:
-%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:    %(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t}    %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}    %{static:} %{L*} %(link_libgcc) %o %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}}    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}
-
diff --git a/obsolete-buildroot/sources/specs-mips-soft-float b/obsolete-buildroot/sources/specs-mips-soft-float
deleted file mode 100644 (file)
index 35fd671..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-*asm:
-%{G*} %(endian_spec) %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips64}%{mips16:%{!mno-mips16:-mips16}} %{mno-mips16:-no-mips16} %(subtarget_asm_optimizing_spec) %(subtarget_asm_debugging_spec) %{membedded-pic} %{mabi=32:-32}%{mabi=n32:-n32}%{mabi=64:-64}%{mabi=n64:-64} %{mabi=eabi} %{mabi=o64} %{!mabi*: %(asm_abi_default_spec)} %{mgp32} %{mgp64} %{march=*} %(target_asm_spec) %(subtarget_asm_spec)
-
-*asm_debug:
-%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}
-
-*asm_final:
-%|
-
-*asm_options:
-%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}
-
-*invoke_as:
-%{!S:-o %{|!pipe:%g.s} |
- as %(asm_options) %{!pipe:%g.s} %A }
-
-*cpp:
-%(subtarget_cpp_spec)
-
-*cpp_options:
-%(cpp_unique_options) %1 %{m*} %{std*} %{ansi} %{W*&pedantic*} %{w} %{f*} %{O*} %{undef}
-
-*cpp_debug_options:
-%{d*}
-
-*cpp_unique_options:
-%{C:%{!E:%eGNU C does not support -C without using -E}} %{CC:%{!E:%eGNU C does not support -CC without using -E}} %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}} %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3} %{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{E|M|MM:%W{o*}}
-
-*trad_capable_cpp:
-cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}
-
-*cc1:
-%{profile:-p}
-
-*cc1_options:
-%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} -auxbase%{c|S:%{o*:-strip %*}%{!o*: %b}}%{!c:%{!S: %b}} %{g*} %{O*} %{W*&pedantic*} %{w} %{std*} %{ansi} %{v:-version} %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{--help:--help} %{--target-help:--target-help} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*} %{msoft-float:%{mhard-float: %e-msoft-float and -mhard_float may not be used together}} %{!mhard-float:%{!msoft-float:-msoft-float}}
-
-*cc1plus:
-
-
-*link_gcc_c_sequence:
-%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}
-
-*endfile:
-%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s
-
-*link:
-%{!static:--eh-frame-hdr} %(endian_spec)   %{shared:-shared}   %{!shared:     %{!ibcs:       %{!static:         %{rdynamic:-export-dynamic}         %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}         %{static:-static}}}
-
-*lib:
-%{pthread:-lpthread}    %{shared:-lc}    %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}
-
-*libgcc:
-%{static|static-libgcc:-lgcc -lgcc_eh}%{!static:%{!static-libgcc:%{!shared:%{!shared-libgcc:-lgcc -lgcc_eh}%{shared-libgcc:-lgcc_s%M -lgcc}}%{shared:%{shared-libgcc:-lgcc_s%M}%{!shared-libgcc:-lgcc}}}}
-
-*startfile:
-%{!shared:      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s}                  %{!p:%{profile:gcrt1.o%s}                         %{!profile:crt1.o%s}}}}    crti.o%s %{static:crtbeginT.o%s}   %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}
-
-*switches_need_spaces:
-
-
-*predefines:
-
-
-*cross_compile:
-1
-
-*version:
-3.3.3
-
-*multilib:
-. ;
-
-*multilib_defaults:
-EB mips1 mabi=32
-
-*multilib_extra:
-
-
-*multilib_matches:
-
-
-*multilib_exclusions:
-
-
-*multilib_options:
-
-
-*linker:
-collect2
-
-*link_libgcc:
-%D
-
-*md_exec_prefix:
-
-
-*md_startfile_prefix:
-
-
-*md_startfile_prefix_1:
-
-
-*startfile_prefix_spec:
-
-
-*subtarget_cc1_spec:
-
-
-*subtarget_cpp_spec:
-%{fno-PIC:-U__PIC__ -U__pic__} %{fno-pic:-U__PIC__ -U__pic__} %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{pthread:-D_REENTRANT}
-
-*mips_as_asm_spec:
-%{!.s:-nocpp} %{.s: %{cpp} %{nocpp}} %{pipe: %e-pipe is not supported} %{K} %(subtarget_mips_as_asm_spec)
-
-*gas_asm_spec:
-%{mtune=*} %{v}
-
-*target_asm_spec:
-%{mmips-as: %(mips_as_asm_spec)} %{!mmips-as: %(gas_asm_spec)}
-
-*subtarget_mips_as_asm_spec:
-%{v}
-
-*subtarget_asm_optimizing_spec:
-%{noasmopt:-O0} %{!noasmopt:%{O:-O2} %{O1:-O2} %{O2:-O2} %{O3:-O3}}
-
-*subtarget_asm_debugging_spec:
--g0
-
-*mdebug_asm_spec:
-%{!gdwarf*:-mdebug} %{gdwarf*:-no-mdebug}
-
-*subtarget_asm_spec:
-%{mabi=64: -64} %{!fno-PIC:%{!fno-pic:-KPIC}} %{fno-PIC:-non_shared} %{fno-pic:-non_shared}
-
-*asm_abi_default_spec:
--32
-
-*endian_spec:
-%{!EL:%{!mel:-EB}} %{EL|mel:-EL}
-
-*link_command:
-%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:    %(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t}    %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}    %{static:} %{L*} %(link_libgcc) %o %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}}    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}
-
diff --git a/obsolete-buildroot/sources/specs-mipsel-soft-float b/obsolete-buildroot/sources/specs-mipsel-soft-float
deleted file mode 100644 (file)
index 72aa2a6..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-*asm:
-%{G*} %(endian_spec) %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips64}%{mips16:%{!mno-mips16:-mips16}} %{mno-mips16:-no-mips16} %(subtarget_asm_optimizing_spec) %(subtarget_asm_debugging_spec) %{membedded-pic} %{mabi=32:-32}%{mabi=n32:-n32}%{mabi=64:-64}%{mabi=n64:-64} %{mabi=eabi} %{mabi=o64} %{!mabi*: %(asm_abi_default_spec)} %{mgp32} %{mgp64} %{march=*} %(target_asm_spec) %(subtarget_asm_spec)
-
-*asm_debug:
-%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}
-
-*asm_final:
-%|
-
-*asm_options:
-%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}
-
-*invoke_as:
-%{!S:-o %{|!pipe:%g.s} |
- as %(asm_options) %{!pipe:%g.s} %A }
-
-*cpp:
-%(subtarget_cpp_spec)
-
-*cpp_options:
-%(cpp_unique_options) %1 %{m*} %{std*} %{ansi} %{W*&pedantic*} %{w} %{f*} %{O*} %{undef}
-
-*cpp_debug_options:
-%{d*}
-
-*cpp_unique_options:
-%{C:%{!E:%eGNU C does not support -C without using -E}} %{CC:%{!E:%eGNU C does not support -CC without using -E}} %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}} %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3} %{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{E|M|MM:%W{o*}}
-
-*trad_capable_cpp:
-cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}
-
-*cc1:
-%{profile:-p}
-
-*cc1_options:
-%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} -auxbase%{c|S:%{o*:-strip %*}%{!o*: %b}}%{!c:%{!S: %b}} %{g*} %{O*} %{W*&pedantic*} %{w} %{std*} %{ansi} %{v:-version} %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{--help:--help} %{--target-help:--target-help} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*} %{msoft-float:%{mhard-float: %e-msoft-float and -mhard_float may not be used together}} %{!mhard-float:%{!msoft-float:-msoft-float}}
-
-*cc1plus:
-
-
-*link_gcc_c_sequence:
-%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}
-
-*endfile:
-%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s
-
-*link:
-%{!static:--eh-frame-hdr} %(endian_spec)   %{shared:-shared}   %{!shared:     %{!ibcs:       %{!static:         %{rdynamic:-export-dynamic}         %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}         %{static:-static}}}
-
-*lib:
-%{pthread:-lpthread}    %{shared:-lc}    %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}
-
-*libgcc:
-%{static|static-libgcc:-lgcc -lgcc_eh}%{!static:%{!static-libgcc:%{!shared:%{!shared-libgcc:-lgcc -lgcc_eh}%{shared-libgcc:-lgcc_s%M -lgcc}}%{shared:%{shared-libgcc:-lgcc_s%M}%{!shared-libgcc:-lgcc}}}}
-
-*startfile:
-%{!shared:      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s}                  %{!p:%{profile:gcrt1.o%s}                         %{!profile:crt1.o%s}}}}    crti.o%s %{static:crtbeginT.o%s}   %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}
-
-*switches_need_spaces:
-
-
-*predefines:
-
-
-*cross_compile:
-1
-
-*version:
-3.3.3
-
-*multilib:
-. ;
-
-*multilib_defaults:
-EL mips1 mabi=32
-
-*multilib_extra:
-
-
-*multilib_matches:
-
-
-*multilib_exclusions:
-
-
-*multilib_options:
-
-
-*linker:
-collect2
-
-*link_libgcc:
-%D
-
-*md_exec_prefix:
-
-
-*md_startfile_prefix:
-
-
-*md_startfile_prefix_1:
-
-
-*startfile_prefix_spec:
-
-
-*subtarget_cc1_spec:
-
-
-*subtarget_cpp_spec:
-%{fno-PIC:-U__PIC__ -U__pic__} %{fno-pic:-U__PIC__ -U__pic__} %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{pthread:-D_REENTRANT}
-
-*mips_as_asm_spec:
-%{!.s:-nocpp} %{.s: %{cpp} %{nocpp}} %{pipe: %e-pipe is not supported} %{K} %(subtarget_mips_as_asm_spec)
-
-*gas_asm_spec:
-%{mtune=*} %{v}
-
-*target_asm_spec:
-%{mmips-as: %(mips_as_asm_spec)} %{!mmips-as: %(gas_asm_spec)}
-
-*subtarget_mips_as_asm_spec:
-%{v}
-
-*subtarget_asm_optimizing_spec:
-%{noasmopt:-O0} %{!noasmopt:%{O:-O2} %{O1:-O2} %{O2:-O2} %{O3:-O3}}
-
-*subtarget_asm_debugging_spec:
--g0
-
-*mdebug_asm_spec:
-%{!gdwarf*:-mdebug} %{gdwarf*:-no-mdebug}
-
-*subtarget_asm_spec:
-%{mabi=64: -64} %{!fno-PIC:%{!fno-pic:-KPIC}} %{fno-PIC:-non_shared} %{fno-pic:-non_shared}
-
-*asm_abi_default_spec:
--32
-
-*endian_spec:
-%{!EB:%{!meb:-EL}} %{EB|meb:-EB}
-
-*link_command:
-%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:    %(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t}    %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}    %{static:} %{L*} %(link_libgcc) %o %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}}    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}
-
diff --git a/obsolete-buildroot/sources/specs-powerpc-soft-float b/obsolete-buildroot/sources/specs-powerpc-soft-float
deleted file mode 100644 (file)
index 0cb9ed3..0000000
+++ /dev/null
@@ -1,352 +0,0 @@
-*asm:
-%(asm_cpu) %{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} %{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} %{memb} %{!memb: %{msdata: -memb} %{msdata=eabi: -memb}} %{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian} %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian:     %{mcall-freebsd: -mbig}     %{mcall-i960-old: -mlittle}     %{mcall-linux: -mbig}     %{mcall-gnu: -mbig}     %{mcall-netbsd: -mbig} }}}}
-
-*asm_debug:
-%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}
-
-*asm_final:
-%|
-
-*asm_options:
-%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}
-
-*invoke_as:
-%{!S:-o %{|!pipe:%g.s} |
- as %(asm_options) %{!pipe:%g.s} %A }
-
-*cpp:
-%{posix: -D_POSIX_SOURCE} %(cpp_sysv) %{mads: %(cpp_os_ads) } %{myellowknife: %(cpp_os_yellowknife) } %{mmvme: %(cpp_os_mvme) } %{msim: %(cpp_os_sim) } %{mwindiss: %(cpp_os_windiss) } %{mcall-freebsd: %(cpp_os_freebsd) } %{mcall-linux: %(cpp_os_linux) } %{mcall-gnu: %(cpp_os_gnu) } %{mcall-netbsd: %(cpp_os_netbsd) } %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss:          %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu:          %{!mcall-netbsd: %(cpp_os_default) }}}}}}}}}
-
-*cpp_options:
-%(cpp_unique_options) %1 %{m*} %{std*} %{ansi} %{W*&pedantic*} %{w} %{f*} %{O*} %{undef}
-
-*cpp_debug_options:
-%{d*}
-
-*cpp_unique_options:
-%{C:%{!E:%eGNU C does not support -C without using -E}} %{CC:%{!E:%eGNU C does not support -CC without using -E}} %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}} %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3} %{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{E|M|MM:%W{o*}}
-
-*trad_capable_cpp:
-cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}
-
-*cc1:
-%{G*} %{mlittle: %(cc1_endian_little)} %{!mlittle: %{mlittle-endian: %(cc1_endian_little)}} %{mbig: %(cc1_endian_big)} %{!mbig: %{mbig-endian: %(cc1_endian_big)}} %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian:     %{mcall-aixdesc: -mbig %(cc1_endian_big) }     %{mcall-freebsd: -mbig %(cc1_endian_big) }     %{mcall-i960-old: -mlittle %(cc1_endian_little) }     %{mcall-linux: -mbig %(cc1_endian_big) }     %{mcall-gnu: -mbig %(cc1_endian_big) }     %{mcall-netbsd: -mbig %(cc1_endian_big) }     %{!mcall-aixdesc: %{!mcall-freebsd: %{!mcall-i960-old: %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd:             %(cc1_endian_default)     }}}}}} }}}} %{mno-sdata: -msdata=none } %{meabi: %{!mcall-*: -mcall-sysv }} %{!meabi: %{!mno-eabi:     %{mrelocatable: -meabi }     %{mcall-freebsd: -mno-eabi }     %{mcall-i960-old: -meabi }     %{mcall-linux: -mno-eabi }     %{mcall-gnu: -mno-eabi }     %{mcall-netbsd: -mno-eabi }}} %{msdata: -msdata=default} %{mno-sdata: -msdata=none} %{profile: -p}
-
-*cc1_options:
-%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} -auxbase%{c|S:%{o*:-strip %*}%{!o*: %b}}%{!c:%{!S: %b}} %{g*} %{O*} %{W*&pedantic*} %{w} %{std*} %{ansi} %{v:-version} %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{--help:--help} %{--target-help:--target-help} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*} %{msoft-float:%{mhard-float: %e-msoft-float and -mhard_float may not be used together}} %{!mhard-float:%{!msoft-float:-msoft-float}}
-
-*cc1plus:
-
-
-*link_gcc_c_sequence:
-%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}
-
-*endfile:
-%{mads: crtsavres.o%s %(endfile_ads)} %{myellowknife: crtsavres.o%s %(endfile_yellowknife)} %{mmvme: crtsavres.o%s %(endfile_mvme)} %{msim: crtsavres.o%s %(endfile_sim)} %{mwindiss: %(endfile_windiss)} %{mcall-freebsd: crtsavres.o%s %(endfile_freebsd) } %{mcall-linux: crtsavres.o%s %(endfile_linux) } %{mcall-gnu: crtsavres.o%s %(endfile_gnu) } %{mcall-netbsd: crtsavres.o%s %(endfile_netbsd) } %{mvxworks: crtsavres.o%s %(endfile_vxworks) } %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss:          %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu:          %{!mcall-netbsd: %{!mvxworks: %(crtsavres_default)                                        %(endfile_default) }}}}}}}}}}
-
-*link:
-%{!static:--eh-frame-hdr} %{h*} %{v:-V} %{!msdata=none:%{G*}} %{msdata=none:-G0} %{YP,*} %{R*} %{Qy:} %{!Qn:-Qy} %(link_shlib) %{!Wl,-T*: %{!T*: %(link_start) }} %(link_target) %(link_os)
-
-*lib:
-%{mads: %(lib_ads) } %{myellowknife: %(lib_yellowknife) } %{mmvme: %(lib_mvme) } %{msim: %(lib_sim) } %{mwindiss: %(lib_windiss) } %{mcall-freebsd: %(lib_freebsd) } %{mcall-linux: %(lib_linux) } %{mcall-gnu: %(lib_gnu) } %{mcall-netbsd: %(lib_netbsd) } %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss:          %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu:          %{!mcall-netbsd: %(lib_default) }}}}}}}}}
-
-*libgcc:
-%{static|static-libgcc:-lgcc -lgcc_eh}%{!static:%{!static-libgcc:%{!shared:%{!shared-libgcc:-lgcc -lgcc_eh}%{shared-libgcc:-lgcc_s%M -lgcc}}%{shared:%{shared-libgcc:-lgcc_s%M}%{!shared-libgcc:-lgcc}}}}
-
-*startfile:
-%{mads: %(startfile_ads) } %{myellowknife: %(startfile_yellowknife) } %{mmvme: %(startfile_mvme) } %{msim: %(startfile_sim) } %{mwindiss: %(startfile_windiss) } %{mcall-freebsd: %(startfile_freebsd) } %{mcall-linux: %(startfile_linux) } %{mcall-gnu: %(startfile_gnu) } %{mcall-netbsd: %(startfile_netbsd) } %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss:          %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu:          %{!mcall-netbsd: %(startfile_default) }}}}}}}}}
-
-*switches_need_spaces:
-
-
-*predefines:
-
-
-*cross_compile:
-1
-
-*version:
-3.3.3
-
-*multilib:
-. mhard-float;nof !mhard-float;
-
-*multilib_defaults:
-mbig mcall-sysv
-
-*multilib_extra:
-fPIC mstrict-align
-
-*multilib_matches:
-mcpu=401 msoft-float;mcpu=403 msoft-float;mcpu=405 msoft-float;mcpu=ec603e msoft-float;mcpu=801 msoft-float;mcpu=821 msoft-float;mcpu=823 msoft-float;mcpu=860 msoft-float;msoft-float msoft-float;
-
-*multilib_exclusions:
-
-
-*multilib_options:
-msoft-float
-
-*linker:
-collect2
-
-*link_libgcc:
-%D
-
-*md_exec_prefix:
-
-
-*md_startfile_prefix:
-
-
-*md_startfile_prefix_1:
-
-
-*startfile_prefix_spec:
-
-
-*cpp_default:
-
-
-*asm_cpu:
-%{!mcpu*:   %{mpower: %{!mpower2: -mpwr}}   %{mpower2: -mpwrx}   %{mpowerpc*: -mppc}   %{mno-power: %{!mpowerpc*: -mcom}}   %{!mno-power: %{!mpower2: %(asm_default)}}} %{mcpu=common: -mcom} %{mcpu=power: -mpwr} %{mcpu=power2: -mpwrx} %{mcpu=power3: -m604} %{mcpu=power4: -mpower4} %{mcpu=powerpc: -mppc} %{mcpu=rios: -mpwr} %{mcpu=rios1: -mpwr} %{mcpu=rios2: -mpwrx} %{mcpu=rsc: -mpwr} %{mcpu=rsc1: -mpwr} %{mcpu=401: -mppc} %{mcpu=403: -m403} %{mcpu=405: -m405} %{mcpu=505: -mppc} %{mcpu=601: -m601} %{mcpu=602: -mppc} %{mcpu=603: -mppc} %{mcpu=603e: -mppc} %{mcpu=ec603e: -mppc} %{mcpu=604: -mppc} %{mcpu=604e: -mppc} %{mcpu=620: -mppc} %{mcpu=630: -m604} %{mcpu=740: -mppc} %{mcpu=7400: -mppc} %{mcpu=7450: -mppc} %{mcpu=750: -mppc} %{mcpu=801: -mppc} %{mcpu=821: -mppc} %{mcpu=823: -mppc} %{mcpu=860: -mppc} %{mcpu=8540: -me500} %{maltivec: -maltivec}
-
-*asm_default:
--mppc
-
-*cpp_sysv:
-%{mrelocatable*: -D_RELOCATABLE} %{fpic: -D__PIC__=1 -D__pic__=1} %{!fpic: %{fPIC: -D__PIC__=2 -D__pic__=2}}
-
-*crtsavres_default:
-crtsavres.o%s
-
-*lib_ads:
---start-group -lads -lc --end-group
-
-*lib_yellowknife:
---start-group -lyk -lc --end-group
-
-*lib_mvme:
---start-group -lmvme -lc --end-group
-
-*lib_sim:
---start-group -lsim -lc --end-group
-
-*lib_freebsd:
-                                                         %{!shared:                                                                %{!pg:                                                                    %{!pthread:-lc}                                                         %{pthread:-lc_r}}                                                     %{pg:                                                                     %{!pthread:-lc_p}                                                       %{pthread:-lc_r_p}}                                                 }
-
-*lib_gnu:
-%{mnewlib: --start-group -lgnu -lc --end-group } %{!mnewlib: %{shared:-lc} %{!shared: %{pthread:-lpthread } %{profile:-lc_p} %{!profile:-lc}}}
-
-*lib_linux:
-%{mnewlib: --start-group -llinux -lc --end-group } %{!mnewlib: %{shared:-lc} %{!shared: %{pthread:-lpthread } %{profile:-lc_p} %{!profile:-lc}}}
-
-*lib_netbsd:
-%{profile:-lgmon -lc_p} %{!profile:-lc}
-
-*lib_vxworks:
-
-
-*lib_windiss:
---start-group -li -lcfp -lwindiss -lram -limpl -limpfp --end-group
-
-*lib_default:
-%(lib_linux)
-
-*startfile_ads:
-ecrti.o%s crt0.o%s crtbegin.o%s
-
-*startfile_yellowknife:
-ecrti.o%s crt0.o%s crtbegin.o%s
-
-*startfile_mvme:
-ecrti.o%s crt0.o%s crtbegin.o%s
-
-*startfile_sim:
-ecrti.o%s sim-crt0.o%s crtbegin.o%s
-
-*startfile_freebsd:
-%{!shared:      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s}                  %{!p:%{profile:gcrt1.o%s}                         %{!profile:crt1.o%s}}}}    crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}
-
-*startfile_gnu:
-%{!shared: %{!static: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}} %{static: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} %{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}
-
-*startfile_linux:
-%{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} %{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} %{static:crtbeginT.o%s} %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}
-
-*startfile_netbsd:
-ncrti.o%s crt0.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}
-
-*startfile_vxworks:
-
-
-*startfile_windiss:
-crt0.o%s crtbegin.o%s
-
-*startfile_default:
-%(startfile_linux)
-
-*endfile_ads:
-crtend.o%s ecrtn.o%s
-
-*endfile_yellowknife:
-crtend.o%s ecrtn.o%s
-
-*endfile_mvme:
-crtend.o%s ecrtn.o%s
-
-*endfile_sim:
-crtend.o%s ecrtn.o%s
-
-*endfile_freebsd:
-%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s
-
-*endfile_gnu:
-%{!shared:crtend.o%s} %{shared:crtendS.o%s} %{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}
-
-*endfile_linux:
-%{!shared:crtend.o%s} %{shared:crtendS.o%s} %{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}
-
-*endfile_netbsd:
-%{!shared:crtend.o%s} %{shared:crtendS.o%s} ncrtn.o%s
-
-*endfile_vxworks:
-
-
-*endfile_windiss:
-crtend.o%s
-
-*endfile_default:
-%(endfile_linux)
-
-*link_path:
-
-
-*link_shlib:
-%{shared:-shared} %{!shared: %{static:-static}}
-
-*link_target:
-%{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian:     %{mcall-i960-old: --oformat elf32-powerpcle}   }}}}
-
-*link_start:
-%{mads: %(link_start_ads) } %{myellowknife: %(link_start_yellowknife) } %{mmvme: %(link_start_mvme) } %{msim: %(link_start_sim) } %{mwindiss: %(link_start_windiss) } %{mcall-freebsd: %(link_start_freebsd) } %{mcall-linux: %(link_start_linux) } %{mcall-gnu: %(link_start_gnu) } %{mcall-netbsd: %(link_start_netbsd) } %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss:          %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd:            %{!mcall-freebsd: %(link_start_default) }}}}}}}}}
-
-*link_start_ads:
--T ads.ld%s
-
-*link_start_yellowknife:
--T yellowknife.ld%s
-
-*link_start_mvme:
--Ttext 0x40000
-
-*link_start_sim:
-
-
-*link_start_freebsd:
-
-
-*link_start_gnu:
-
-
-*link_start_linux:
-
-
-*link_start_netbsd:
-
-
-*link_start_vxworks:
-
-
-*link_start_windiss:
-
-
-*link_start_default:
-%(link_start_linux)
-
-*link_os:
-%{mads: %(link_os_ads) } %{myellowknife: %(link_os_yellowknife) } %{mmvme: %(link_os_mvme) } %{msim: %(link_os_sim) } %{mwindiss: %(link_os_windiss) } %{mcall-freebsd: %(link_os_freebsd) } %{mcall-linux: %(link_os_linux) } %{mcall-gnu: %(link_os_gnu) } %{mcall-netbsd: %(link_os_netbsd) } %{mcall-uclibc: %(link_os_linux_uclibc) } %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss:          %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu:          %{!mcall-netbsd: %{!mcall-uclibc:          %(link_os_default) }}}}}}}}}}
-
-*link_os_ads:
-
-
-*link_os_yellowknife:
-
-
-*link_os_mvme:
-
-
-*link_os_sim:
--m elf32ppcsim
-
-*link_os_freebsd:
-  %{p:%e`-p' not supported; use `-pg' and gprof(1)}     %{Wl,*:%*}     %{v:-V}     %{assert*} %{R*} %{rpath*} %{defsym*}     %{shared:-Bshareable %{h*} %{soname*}}     %{!shared:       %{!static:    %{rdynamic: -export-dynamic}    %{!dynamic-linker: -dynamic-linker /usr/libexec/ld-elf.so.1}}       %{static:-Bstatic}}     %{symbolic:-Bsymbolic}
-
-*link_os_linux:
--m elf32ppclinux %{!shared: %{!static:   %{rdynamic:-export-dynamic}   %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}
-
-*link_os_gnu:
--m elf32ppclinux %{!shared: %{!static:   %{rdynamic:-export-dynamic}   %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}
-
-*link_os_netbsd:
-%{!shared: %{!static:   %{rdynamic:-export-dynamic}   %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}}}
-
-*link_os_vxworks:
--r
-
-*link_os_windiss:
-
-
-*link_os_linux_uclibc:
--m elf32ppclinux %{!shared: %{!static:   %{rdynamic:-export-dynamic}   %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}}
-
-*link_os_default:
-%(link_os_linux_uclibc)
-
-*cc1_endian_big:
-
-
-*cc1_endian_little:
-%{!mstrict-align: %{!mno-strict-align:     %{!mcall-i960-old:  -mstrict-align     } }}
-
-*cc1_endian_default:
-%(cc1_endian_big)
-
-*cpp_os_ads:
-
-
-*cpp_os_yellowknife:
-
-
-*cpp_os_mvme:
-
-
-*cpp_os_sim:
-
-
-*cpp_os_freebsd:
-  -D__ELF__ -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__   -Acpu=powerpc -Amachine=powerpc
-
-*cpp_os_gnu:
--D__unix__ -D__gnu_hurd__ -D__GNU__    %{!undef:                                                         %{!ansi: -Dunix -D__unix}}                                    -Asystem=gnu -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}
-
-*cpp_os_linux:
--D__unix__ -D__gnu_linux__ -D__linux__ %{!undef:                                                           %{!ansi:                                                          %{!std=*:-Dunix -D__unix -Dlinux -D__linux}                             %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}}             -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}
-
-*cpp_os_netbsd:
--D__powerpc__ -D__NetBSD__ -D__ELF__ -D__KPRINTF_ATTRIBUTE__
-
-*cpp_os_rtems:
-%{!mcpu*:  %{!Dppc*: %{!Dmpc*: -Dmpc750} } }%{mcpu=403:  %{!Dppc*: %{!Dmpc*: -Dppc403}  } } %{mcpu=505:  %{!Dppc*: %{!Dmpc*: -Dmpc505}  } } %{mcpu=601:  %{!Dppc*: %{!Dmpc*: -Dppc601}  } } %{mcpu=602:  %{!Dppc*: %{!Dmpc*: -Dppc602}  } } %{mcpu=603:  %{!Dppc*: %{!Dmpc*: -Dppc603}  } } %{mcpu=603e: %{!Dppc*: %{!Dmpc*: -Dppc603e} } } %{mcpu=604:  %{!Dppc*: %{!Dmpc*: -Dmpc604}  } } %{mcpu=750:  %{!Dppc*: %{!Dmpc*: -Dmpc750}  } } %{mcpu=821:  %{!Dppc*: %{!Dmpc*: -Dmpc821}  } } %{mcpu=860:  %{!Dppc*: %{!Dmpc*: -Dmpc860}  } }
-
-*cpp_os_vxworks:
--DCPU_FAMILY=PPC %{!mcpu*:   %{mpowerpc*: -DCPU=PPC603}   %{!mno-powerpc: -DCPU=PPC603}} %{mcpu=powerpc: -DCPU=PPC603} %{mcpu=401: -DCPU=PPC403} %{mcpu=403: -DCPU=PPC403} %{mcpu=405: -DCPU=PPC405} %{mcpu=601: -DCPU=PPC601} %{mcpu=602: -DCPU=PPC603} %{mcpu=603: -DCPU=PPC603} %{mcpu=603e: -DCPU=PPC603} %{mcpu=ec603e: -DCPU=PPC603} %{mcpu=604: -DCPU=PPC604} %{mcpu=604e: -DCPU=PPC604} %{mcpu=620: -DCPU=PPC604} %{mcpu=740: -DCPU=PPC603} %{mcpu=7450: -DCPU=PPC603} %{mcpu=750: -DCPU=PPC603} %{mcpu=801: -DCPU=PPC603} %{mcpu=821: -DCPU=PPC603} %{mcpu=823: -DCPU=PPC603} %{mcpu=860: -DCPU=PPC603}
-
-*cpp_os_windiss:
--D__rtasim -D__EABI__ -D__ppc %{!msoft-float: -D__hardfp} 
-
-*cpp_os_default:
-%(cpp_os_linux)
-
-*link_command:
-%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:    %(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t}    %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}    %{static:} %{L*} %(link_libgcc) %o %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}}    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}
-
diff --git a/obsolete-buildroot/sources/squashfs.patch b/obsolete-buildroot/sources/squashfs.patch
deleted file mode 100644 (file)
index ea75a7f..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-This is a stupid little patch adding an option to change all uid/gid to
-root/root in the generated filesystem.  We really need to teach mksquashfs
-about device tables though...
-
---- squashfs1.3r3/squashfs-tools/mksquashfs.c-dist     2004-03-29 20:35:37.000000000 -0600
-+++ squashfs1.3r3/squashfs-tools/mksquashfs.c  2004-03-29 22:28:51.000000000 -0600
-@@ -136,6 +136,8 @@
-       stotal_bytes, stotal_inode_bytes, stotal_directory_bytes, sinode_count, sfile_count, ssym_count, sdev_count, sdir_count, sdup_files;
- int restore = 0;
-+unsigned int root_owned = 0;
-+
- /*flag whether destination file is a block device */
- int block_device = 0;
-@@ -421,6 +423,11 @@
-               return SQUASHFS_INVALID;
-       }
-+      if (root_owned) {
-+              buf.st_uid = 0;
-+              buf.st_gid = 0;
-+      }
-+
-       base->mode = SQUASHFS_MODE(buf.st_mode);
-       base->uid = get_uid(&file_type, (squashfs_uid) buf.st_uid);
-       base->inode_type = file_type;
-@@ -1268,6 +1275,8 @@
-                       root_name = argv[i];
-               } else if(strcmp(argv[i], "-version") == 0) {
-                       VERSION();
-+              } else if (strcmp(argv[i], "-root-owned") == 0) {
-+                      root_owned = TRUE;
-               } else {
-                       ERROR("%s: invalid option\n\n", argv[0]);
- printOptions:
diff --git a/obsolete-buildroot/sources/tinyx-011010.patch b/obsolete-buildroot/sources/tinyx-011010.patch
deleted file mode 100644 (file)
index 3040b3d..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-diff -Nur --exclude=CVS xc-011010.src/include/extensions/lbxstr.h xc-011010/include/extensions/lbxstr.h
---- xc-011010.src/include/extensions/lbxstr.h  Tue Jul 31 20:44:35 2001
-+++ xc-011010/include/extensions/lbxstr.h      Sun Apr 21 12:35:05 2002
-@@ -25,7 +25,7 @@
- #ifndef _LBXSTR_H_
- #define _LBXSTR_H_
--#include <X11/extensions/XLbx.h>
-+#include "XLbx.h"
- #define LBXNAME "LBX"
-diff -Nur --exclude=CVS xc-011010.src/programs/Xserver/hw/kdrive/fbdev/fbdev.h xc-011010/programs/Xserver/hw/kdrive/fbdev/fbdev.h
---- xc-011010.src/programs/Xserver/hw/kdrive/fbdev/fbdev.h     Sun Jun  3 17:52:45 2001
-+++ xc-011010/programs/Xserver/hw/kdrive/fbdev/fbdev.h Sun Apr 21 12:36:25 2002
-@@ -29,6 +29,7 @@
- #include <linux/fb.h>
- #include <unistd.h>
- #include <sys/mman.h>
-+#include <sys/types.h>
- #include "kdrive.h"
- #include "layer.h"
-
-diff -Nur xc-011010.src2/lib/X11/Xlib.h xc-011010/lib/X11/Xlib.h
---- xc-011010.src/programs/Xserver/hw/kdrive/linux/ts.c        Tue Jul 10 22:58:19 2001
-+++ xc-011010/programs/Xserver/hw/kdrive/linux/ts.c    Tue Apr 23 20:16:23 2002
-@@ -33,65 +33,48 @@
- #include "kdrive.h"
- #include "Xpoll.h"
- #include <sys/ioctl.h>
--#include <linux/h3600_ts.h>   /* touch screen events */
-+
-+typedef struct {
-+  unsigned short          pressure;
-+  unsigned short          x;
-+  unsigned short          y;
-+  unsigned short          pad;
-+  struct timeval  stamp;
-+} TS_EVENT;
- static long lastx = 0, lasty = 0;
- int TsScreen;
- extern int TsFbdev;
--void
--TsRead (int tsPort, void *closure)
--{
--    TS_EVENT      event;
--    long          buf[3];
--    int                   n;
--    long          pressure;
--    long          x, y;
--    unsigned long   flags;
--    unsigned long   buttons;
--
--    n = Ps2ReadBytes (tsPort, (char *) &event, 
--                       sizeof (event), sizeof (event));
--    if (n == sizeof (event))  
--    {
--      if (event.pressure) 
--      {
--          /* 
--           * HACK ATTACK.  (static global variables used !)
--           * Here we test for the touch screen driver actually being on the
--           * touch screen, if it is we send absolute coordinates. If not,
--           * then we send delta's so that we can track the entire vga screen.
--           */
--          if (TsScreen == TsFbdev) {
--              flags = KD_BUTTON_1;
--              x = event.x;
--              y = event.y;
--          } else {
--              flags = /* KD_BUTTON_1 |*/ KD_MOUSE_DELTA;
--              if ((lastx == 0) || (lasty == 0)) {
--                  x = 0;
--                  y = 0;
--              } else {
--                  x = event.x - lastx;
--                  y = event.y - lasty;
--              }
--              lastx = event.x;
--              lasty = event.y;
--          }
--      } else {
--          flags = KD_MOUSE_DELTA;
--          x = 0;
--          y = 0;
--          lastx = 0;
--          lasty = 0;
--      }
--      KdEnqueueMouseEvent (flags, x, y);
-+void TsRead (int tsPort, void *closure) {
-+  TS_EVENT        event;
-+  long            buf[3];
-+  int             n;
-+  long            pressure;
-+  long            x, y;
-+  unsigned long   flags;
-+  unsigned long   buttons;
-+
-+  n = Ps2ReadBytes(tsPort, (char *) &event, sizeof (event), sizeof (event));
-+  if (n >= sizeof (event)) {
-+    if (event.pressure >= 100) {
-+      flags = KD_BUTTON_1;
-+      x = (960 - event.x) * 640 / (920);
-+      y = (960 - event.y) * 480 / (920);
-+      //ErrorF("flags %d x %d y %dn",flags,event.x,event.y);
-+    }
-+    else {
-+      flags = KD_MOUSE_DELTA;
-+      x = lastx;
-+      y = lasty;
-     }
-+    KdEnqueueMouseEvent(flags, x, y);
-+  }
- }
- char  *TsNames[] = {
--  "/dev/ts",  
--  "/dev/h3600_ts" /* temporary name; note this code can try
-+  "/dev/ucb1x00-ts",
-+  "/dev/ts" /* temporary name; note this code can try
-                          to open more than one device */
- };
-@@ -99,9 +82,7 @@
- int TsInputType;
--int
--TsInit (void)
--{
-+int TsInit (void) {
-     int           i;
-     int           TsPort;
-diff -Nur xc-011010.src/startx xc-011010/startx
---- ../../buildroot-tux.Apr25-1/build/xc-011010.src/startx     Thu Apr 25 05:20:35 2002
-+++ xc-011010/startx   Sun Apr 28 05:35:35 2002
-@@ -0,0 +1,11 @@
-+#!/bin/sh
-+killall Xfbdev
-+sleep 1
-+export DISPLAY=":0"
-+/usr/X11R6/bin/Xfbdev -ac &
-+sleep 4
-+/usr/X11R6/bin/matchbox &
-+sleep 1
-+/usr/X11R6/bin/minisys &
-+/usr/X11R6/bin/minitime &
-+/usr/X11R6/bin/rxvt &
-diff -Nur xc-011010.src/lib/Xft/xftgram.y xc-011010/lib/Xft/xftgram.y
---- ../../buildroot-tux.Apr25-1/build/xc-011010/lib/Xft/xftgram.y      Thu Apr 25 05:20:35 2002
-+++ xc-011010/lib/Xft/xftgram.y        Sun Apr 28 05:35:35 2002
-@@ -165,6 +165,7 @@
-                   matrix.yx = $4;
-                   matrix.__REALLY_YY__ = $5;
-               }
-+      ;
- number        :   INTEGER
-               { $$ = (double) $1; }
-       |   DOUBLE
-diff -Nur xc-011010.src/programs/twm/gram.y xc-011010/programs/twm/gram.y
---- ../../buildroot-tux.Apr25-1/build/xc-011010/programs/twm/gram.y    Thu Apr 25 05:20:35 2002
-+++ xc-011010/programs/twm/gram.y      Sun Apr 28 05:35:35 2002
-@@ -650,6 +650,7 @@
-                                         RemoveDQuote(ptr);
-                                         $$ = ptr;
-                                       }
-+              ;
- number                : NUMBER                { $$ = $1; }
-               ;
diff --git a/obsolete-buildroot/sources/uClibc-ldso-0.9.24.patch b/obsolete-buildroot/sources/uClibc-ldso-0.9.24.patch
deleted file mode 100644 (file)
index ee65aa1..0000000
+++ /dev/null
@@ -1,11861 +0,0 @@
-diff -urN uClibc/ldso-0.9.24/COPYRIGHT uClibc.ldso.24/ldso-0.9.24/COPYRIGHT
---- uClibc/ldso-0.9.24/COPYRIGHT       1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/COPYRIGHT       2001-04-23 12:43:53.000000000 -0500
-@@ -0,0 +1,49 @@
-+/*
-+ * Copyright (c) 1994-2000 Eric Youngdale, Peter MacDonald, David Engel,
-+ * Hongjiu Lu and Mitch D'Souza
-+ *
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions and the following disclaimer.
-+ * 2. The name of the above contributors may not be
-+ *    used to endorse or promote products derived from this software
-+ *    without specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE
-+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+ * SUCH DAMAGE.
-+ */
-+
-+/* Notice of general intent:
-+ *
-+ * The linux operating system generally contains large amounts of code
-+ * that fall under the GNU General Public License, or GPL for short.
-+ * This file contains source code that by it's very nature would always
-+ * be linked with an application program, and because of this a GPL
-+ * type of copyright on this file would place restrictions upon the
-+ * distribution of binary-only commercial software.  Since the goal of
-+ * the Linux project as a whole is not to discourage the development and
-+ * distribution of commercial software for Linux, this file has been
-+ * placed under a more relaxed BSD-style of copyright.
-+ *
-+ * It is the general understanding of the above contributors that a
-+ * program executable linked to a library containing code that falls
-+ * under the GPL or GLPL style of license is not subject to the terms of
-+ * the GPL or GLPL license if the program executable(s) that are supplied
-+ * are linked to a shared library form of the GPL or GLPL library, and as
-+ * long as the form of the shared library is such that it is possible for
-+ * the end user to modify and rebuild the library and use it in
-+ * conjunction with the program executable.
-+ */
-diff -urN uClibc/ldso-0.9.24/Makefile uClibc.ldso.24/ldso-0.9.24/Makefile
---- uClibc/ldso-0.9.24/Makefile        1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/Makefile        2003-11-06 16:38:45.000000000 -0600
-@@ -0,0 +1,52 @@
-+# Makefile for uClibc
-+#
-+# Copyright (C) 2000,2001 Erik Andersen <andersen@uclibc.org>
-+#
-+# This program is free software; you can redistribute it and/or modify it under
-+# the terms of the GNU Library General Public License as published by the Free
-+# Software Foundation; either version 2 of the License, or (at your option) any
-+# later version.
-+#
-+# This program is distributed in the hope that it will be useful, but WITHOUT
-+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-+# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
-+# details.
-+#
-+# You should have received a copy of the GNU Library General Public License
-+# along with this program; if not, write to the Free Software Foundation, Inc.,
-+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-+#
-+# Derived in part from the Linux-8086 C library, the GNU C Library, and several
-+# other sundry sources.  Files within this library are copyright by their
-+# respective copyright holders.
-+
-+TOPDIR=../
-+include $(TOPDIR)Rules.mak
-+
-+ALL_SUBDIRS = ldso libdl
-+
-+
-+all: headers
-+ifeq ($(strip $(BUILD_UCLIBC_LDSO)),y)
-+      $(MAKE) -C ldso;
-+else
-+      echo "Not building ld-uClibc"
-+endif
-+
-+shared:
-+ifeq ($(strip $(BUILD_UCLIBC_LDSO)),y)
-+      $(MAKE) -C libdl;
-+else
-+      echo "Not building libdl"
-+endif
-+
-+headers:
-+      $(LN) -fs $(TOPDIR)../include/elf.h include/
-+      $(LN) -fs ../ldso/$(TARGET_ARCH)/boot1_arch.h include/
-+      $(LN) -fs ../ldso/$(TARGET_ARCH)/ld_syscalls.h include/
-+      $(LN) -fs ../ldso/$(TARGET_ARCH)/ld_sysdep.h include/
-+
-+clean:
-+      set -e ; for d in $(ALL_SUBDIRS) ; do $(MAKE) -C $$d $@ ; done
-+      -find . -name '*~' | xargs $(RM)
-+      $(RM) include/elf.h include/boot1_arch.h include/ld_syscalls.h include/ld_sysdep.h
-diff -urN uClibc/ldso-0.9.24/README uClibc.ldso.24/ldso-0.9.24/README
---- uClibc/ldso-0.9.24/README  1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/README  2001-05-31 16:23:20.000000000 -0500
-@@ -0,0 +1,841 @@
-+
-+Apr 20, 2001 -- Manuel Novoa III
-+
-+Inital port for uClibc from debian ld.so_1.9.11-9.tar.gz.
-+
-+Removed a.out support.
-+
-+****************** original ld.so.lsm file **************************
-+Begin3
-+Title:          Linux shared, dynamic linker and utilities.
-+Version:        1.9.11
-+Entered-date:   01MAY99
-+Description:    This package contains ld.so, ld-linux.so, ldconfig,
-+              ldd and libdl.
-+Keywords:       dynamic linker, shared library, ld.so, ld-linux.so,
-+              ldconfig, ldd, libdl
-+Author:         david@ods.com (David Engel)
-+Maintained-by:  david@ods.com (David Engel)
-+Primary-site:   tsx-11.mit.edu /pub/linux/packages/GCC
-+              ld.so-1.9.11.tar.gz
-+Alternate-site: sunsite.unc.edu /pub/Linux/GCC
-+              ld.so-1.9.11.tar.gz
-+Platform:       Linux 2.0.0 or later.
-+Copying-policy: Copyrighted but freely distributable.
-+End
-+*********************************************************************
-+                   Original README starts here
-+*********************************************************************
-+
-+This package contains my ELF dynamic linkers (ld-linux.so.1), dynamic
-+linker library (libdl.so.1) and utilities (ldconfig and ldd) for Linux.
-+
-+You need Linux kernel 2.0.0 or later with ELF support compiled in
-+(i.e. not loaded as a module) to use this package.
-+
-+The dynamic linker is used to bootstrap programs and load shared
-+libraries at startup.  The dynamic linker library is used to
-+dynamically load shared libraries after a program is running.
-+Ldconfig is used to automatically update the symbolic links to shared
-+libraries and build the cache file used by the dynamic linker.  Ldd is
-+used to list the shared libraries used by a program.
-+
-+Please see the included manual pages for further details.
-+
-+To install, simply run "sh instldso.sh" as root.  Ready-to-go versions
-+of all end-products are provided so nothing should need to be compiled
-+or linked.  If you are still using libc5 as your primary development
-+library, you should use the "--devfiles" option when running
-+instldso.sh to install the file needed to compile with libdl.
-+
-+ELF versions of gcc, binutils and libc are now required to compile
-+everything, including the old, unsupported, a.out dynamic linker.
-+Finally, an optimization level of O2 or higher must be used to compile
-+ld-linux.so and libdl.so due the use of inline functions.
-+
-+Notable contributors to this package include Eric Youngdale, Peter
-+MacDonald, Hongjiu Lu, Linus Torvalds, Lars Wirzenius, Mitch D'Souza,
-+Rik Faith, Andreas Schwab and Adam Richter (not necessarily in that
-+order).
-+
-+###################### IMPORTANT NOTICES #############################
-+
-+A.OUT SUPPORT:
-+
-+As of ld.so-1.9.0, the old, a.out dynamic loader is no longer 
-+officially supported.  The code is still included and built, but I 
-+make no promises that it will work.  I will accept patches for it, 
-+but they will not be tested by me.
-+
-+GLIBC (AKA LIBC6) SUPPORT:
-+
-+As of ld.so-1.9.0, the main focus of this package is to ease the
-+transition to libc6.  No significant, new features are expected to be
-+added.  If you need new features, switch to libc6.
-+
-+Except for libpthread.so, the sonames of the core libraries provided
-+with libc6 have been chosen so they do not conflict with those
-+provided by libc5 and ld.so.  However, the current plan is not use
-+new, nonconflicting sonames for other libraries such as ncurses and
-+X11.  This presents two problems.  First, libraries using the same
-+soname for both libc5 and libc6 can not be placed in the same
-+directory.  Second, the dynamic linkers need to make sure not to load
-+a library for the wrong version of libc.
-+
-+The first problem is easy.  Just move the old, libc5-based libraries
-+to new directories (e.g. /lib/libc5-compat, /usr/lib/libc5-compat,
-+etc.) and add those directories to /etc/ld.so.conf.  Then install the
-+new, libc6-based versions in the standard places.
-+
-+The second problem is more difficult.  Ideally, the dynamic linkers
-+would be changed to perform a complete dependency analysis on every
-+library to be loaded to make sure the wrong versions aren't used.
-+This approach doesn't seem worth the added complexity, especially
-+since we now have symbol versioning for ELF libraries.  Instead a
-+simpler approach will be used, at least initially.
-+
-+Ldconfig has been modified to perform a (currently simple) dependency
-+analysis on libraries and to store an indication in /etc/ld.so.cache
-+of whether a library is for libc5, libc6 or an unknown libc.  The
-+dynamic linkers then only need to make a simple check at run-time to
-+make sure they don't load the wrong version of a library.
-+
-+The dynamic linker for libc5 provided in this package, has already
-+been modified to use the new information in /etc/ld.so.cache.  For
-+glibc versions 2.0.1 and earlier, the dynamic linker for libc6 needs
-+the patch contained in glibc.patch.  You should apply the patch and
-+rebuild glibc before using the new ldconfig.
-+
-+As stated above, the dependency analysis currently done by ldconfig is
-+rather simple.  Basically, it looks for the sonames used by the
-+various versions of libc, libm and libdl.  For any approach using a
-+dependency analysis such as this to work, it is very important that
-+shared libraries be built with complete dependency information.  This
-+can be done by using the appropriate -l options when running 'gcc
-+-shared'.  For example, when building libfoo.so which depends on libc
-+and libbar, you should add -lbar and -lc gcc command line.
-+
-+######################################################################
-+
-+Changes in version 1.9.11:
-+
-+      Fixed a bug in ld-linux.so where a reference to an
-+      undefined symbol could cause a segfault.
-+
-+      Added a clarification for LD_PRELOAD to the ld.so manual 
-+      page and added a symlink for ld-linux.so (Bug#33123).
-+
-+      Don't install ldd for Debian except for the m68k arch
-+      because glibc 2.1 now includes it (Bug#35458).
-+
-+Changes in version 1.9.10:
-+
-+      Changed ldconfig to issue a warning and not overwrite a
-+      regular file with a symlink (Bug#30859).
-+
-+      Changed Debian packaging to conflict with and replace the
-+      ldconfig package (Bug#29398).
-+
-+Changes in version 1.9.9:
-+
-+      Changed ld-linux.so and libdl.so to match glibc by not
-+      allowing user preloads of system libraries into setu/gid
-+      binaries unless the library itself is setuid.
-+
-+      Fixed problems in ld-linux.so on the sparc architecture
-+      (Juan Cespedes).
-+
-+Changes in version 1.9.8:
-+
-+      Changed ldconfig to allow the expected type for all
-+      libraries in a directory to be optionally specified
-+      (Mark Phillips).  See the ldconfig man page.
-+
-+      Changed ldconfig to use the same type names used in the
-+      change above when the -p option is used.
-+
-+Changes in version 1.9.7:
-+
-+      Changed ldd for m68k to use /lib/ld.so.1 instead of 
-+      /lib/ld-linux.so.2.
-+
-+      Added support for dladdr to libdl.so (Eduard Gode).
-+
-+      Fixed a small memory leak in libdl.so (Richard Garnish).
-+
-+      Fixed a bug in ldconfig when the -l option was used on a
-+      filename without a '/' in it.
-+
-+      Updated the man pages (Bug#6404, Bug#9721, Bug#10652, 
-+      Bug#13494 and Bug#14127).  They could still use some work.
-+
-+      No longer install the info page since it's way out of date.
-+
-+      Fixed minor Debian packaging problems (Bug#13160, 
-+      Bug#15577 and Bug#19345).
-+
-+Changes in version 1.9.6:
-+
-+      Changed ldd to not use the glibc dynamic linker when run
-+      on a libc5-based shared library.
-+
-+      Added a -q option to ldconfig which causes warnings not
-+      to be printed (Bob Tinsley).
-+
-+      Dropped support for the Debian libdl1-dev package.
-+
-+      Changed ld-linux.so to be compilable with gcc 2.8.0 (Sven 
-+      Verdoolaege)
-+
-+Changes in version 1.9.5:
-+
-+      Fixed a bug in ldd where ld-linux.so.2 was not called
-+      correctly when run on shared libraries.
-+
-+      Fixed a problem in the previous version where some
-+      Makefiles were not architecture independent.
-+
-+Changes in version 1.9.4:
-+
-+      Fixed a bug in ld.so introduced in the previous version
-+      which broke preloads.
-+
-+      Turned a.out support back on by default, at least for the
-+      time being.  There are no promises to keep it.
-+
-+Changes in version 1.9.3:
-+
-+      Fixed buffer overflow bugs in ld-linux.so and ld.so.
-+
-+      Changed the README file a little to clarify a couple of
-+      things.
-+
-+      Changed ldconfig to chroot to the specified directory when
-+      the new -r option is used (Bob Tinsley).
-+
-+Changes in version 1.9.2:
-+
-+      Removed /usr/local/lib from the default /etc/ld.so.conf
-+      for Debian (Bug#8181).
-+
-+      Changed ldconfig to be 64-bit clean (H.J. Lu).
-+
-+Changes in version 1.9.1:
-+
-+      Changed ldconfig to try to determine which libc a
-+      library is for even if it doesn't have an soname.
-+
-+      Fixed a bug in ldconfig where an older library using
-+      the glibc naming convention would be used instead of
-+      a newer library.
-+
-+      Changed to ld-linux.so and libdl.so to not require the 
-+      libc5 headers in order to compile.
-+
-+      Changed ldconfig and ldd to be compilable with either
-+      libc5 or libc6.
-+
-+Changes in version 1.9.0:
-+
-+      Changed to not build the old, a.out dynamic loader by
-+      default.
-+
-+      Changed instldso.sh to require the --force option to
-+      make sure users read the README file.
-+
-+      Changed instldso.sh to not install the libdl.so
-+      development files unless the --devfiles option is used.
-+
-+      Changed instldso.sh to not strip binaries and libraries
-+      if the --no-strip option is used.
-+
-+      Changed the Debian packaging to put the development files 
-+      which conflict with glibc in a new libdl1-dev package.
-+
-+      Changed ldd to use the glibc dynamic linker, if it is
-+      available, when run on a shared library.
-+
-+      Changed ld-linux.so to print the load addresses of
-+      libraries, ala glibc, when run by ldd.
-+
-+      Changed ld-linux.so to allow the libraries listed in 
-+      LD_PRELOAD to be separated by white space in addition to 
-+      colons.
-+
-+      Changed ld-linux.so to load the libraries listed in 
-+      LD_PRELOAD for setu/gid programs as long as they can be 
-+      loaded securely.
-+
-+      Changed ldconfig to update the symlinks for the dynamic
-+      linkers.
-+
-+      Changed ldconfig to try to determine if an ELF library is
-+      intended for libc5 or libc6 and save the infomation in the
-+      cache.  The mechanism used is rather simplistic and may
-+      need to be enhanced.
-+
-+      Changed ldconfig to print the type of ELF library when
-+      printing the cache.
-+
-+      Changed ld-linux.so to only load ELF shared libraries for
-+      use with libc5 or an unknown libc.
-+
-+Changes in version 1.8.10:
-+
-+      Fixed a bug in ldconfig where a symlink could be used
-+      instead of a regular file.
-+
-+      Fixed a Debian packaging problem for the sparc 
-+      architecture.
-+
-+Changes in version 1.8.9:
-+
-+      Changed ldconfig to only cache the symlinks it creates.
-+      This make the behavior of the dynamic linkers consistent
-+      with how they would behave if a cache was not used.
-+
-+      Changed ldconfig to cache the symlinks that it finds but
-+      use the name of the symlink as the soname instead of the 
-+      actual soname.
-+
-+Changes in version 1.8.8:
-+
-+      Minor documentation updates to reflect recent changes.
-+
-+      Changed ld.so and ld-linux.so to perform more complete
-+      validation on ld.so.cache before using it.
-+
-+      Changed ldconfig to accept libraries with inconsistent
-+      sonames since glibc is going to use them.  A warning is
-+      still printed in debug mode.
-+
-+      Changed the install script to not strip _dl_debug_state
-+      from ld-linux.so since gdb needs it.
-+
-+      More sparc fixes (Derrick Brashear).
-+
-+      Changed ldconfig to not issue a warning when a linker
-+      script disguised as a shared library is found.
-+
-+      Fixed a bug in ld-linux.so where some registers were 
-+      not preserved on the first call to a function causing 
-+      problems for non-C-like languages (Tim Renouf).
-+
-+      Fixed a bug in ld-linux.so where global variables were 
-+      not always mapped correctly across dynamically loaded 
-+      libraries (Mikihiko Nakao).
-+
-+      Converted to new Debian source packaging format (Shaya
-+      Potter).
-+
-+Changes in version 1.8.6/7:
-+
-+      Never released as some unofficial patches used these
-+      version numbers.
-+
-+Changes in version 1.8.5:
-+
-+      Fixed a bug in ld.so introduced in the previous changes.
-+
-+Changes in version 1.8.4:
-+
-+      Changed ldconfig to completely ignore symbolic links.
-+
-+      Changed ldconfig to issue the warning concerning an
-+      inconsistent soname in non-verbose mode.
-+
-+      Changed ld-linux.so back to not keep ld.so.cache mapped
-+      at all times.
-+
-+      Changed Debian packaging to compress man pages, strip all
-+      binaries (Bug#5125) and include a shlibs file.
-+
-+Changes in version 1.8.3:
-+
-+      Changed ld-linux.so to process LD_PRELOAD before
-+      /etc/ld.so.preload.
-+
-+      Fixed a Debian packaging problem where libdl might not
-+      be available if other packages were upgraded at the same
-+      time (Debian Bug#4728).
-+
-+      Changed ldd to always exit with status 1 if any errors
-+      occur (Debian Bug#4188).
-+
-+      Fixed some minor problems in instldso.sh (Mike Castle and
-+      Wolfgang Franke).
-+
-+      Changed ldconfig to issue a warning in verbose mode when 
-+      skipping a library because the soname doesn't match.
-+
-+      More sparc fixes (Miguel de Icaza).
-+
-+      Don't link with -N when building ld.so (Alan Modra).
-+
-+      Changed ld-linux.so to better support position-dependant
-+      libraries (NIIBE Yutaka).
-+
-+Changes in version 1.8.2:
-+
-+      Added a texinfo file for ld.so and libdl (Michael 
-+      Deutschmann).
-+
-+      Minor sparc and installation changes (Elliot Lee).
-+
-+      Added multiple architecture support for Debian (Leland
-+      Lucius).
-+
-+      Changed libdl to better support RTLD_NEXT (Eric 
-+      Youngdale).  Note: the exact meaning of ETLD_NEXT is 
-+      still not clear in all cases.
-+
-+      Removed some libc dependencies from libdl.  Still need
-+      to remove malloc and free.
-+
-+Changes in version 1.8.1:
-+
-+      Changed ld.so to be compiled as ELF.  This also means
-+      that ELF support is now required.  A.out support is 
-+      still optional.
-+
-+      Changed ld-linux.so and libdl.so to use the rpath in the 
-+      executable instead of in the invoking shared library.
-+
-+      More m68k fixes (Andreas Schwab).
-+
-+      Various sparc fixes (Miguel de Icaza).
-+
-+      Changed ldcnnfig to ignore libraries ending in '~'.
-+
-+      Changed ldconfig to allow alternative conf and cache 
-+      files to be specified on the command-line.
-+
-+      Changed libdl.so to work when dlsym is passed a NULL
-+      handle pointer.
-+
-+Changes in version 1.8.0:
-+
-+      Changed ld-linux.so to be more liberal when checking to
-+      see if a library is already loaded.  This should avoid
-+      the duplicate loading problem for programs linkeed with
-+      the -rpath option.
-+
-+      Various m68k fixes (Andreas Schwab).
-+
-+      Changed ld.so to only use LD_AOUT_LIBRARY_PATH and
-+      LD_AOUT_PRELOAD and ld-linux.so to only use 
-+      LD_LIBRARY_PATH and LD_PRELOAD.  LD_ELF_LIBRARY_PATH
-+      and LD_ELF_PRELOAD are no longer supported.
-+
-+      Changed ld-linux.so to allow debugging of shared and
-+      dynamically loaded libraries (H.J. Lu, Andreas Schwab).
-+
-+      Changed ld-linux.so to preload ELF shared libraries 
-+      listed in /etc/ld.so.preload.  This allows secure 
-+      preloads, even for setuid/setgid programs.
-+
-+      Changed ld-linux.so to keep ld.so.cache mapped at all
-+      times.
-+
-+      Changed ldconfig to allow #-style comments in ld.so.conf.
-+
-+      Removed various compiler warnings (Richard Sladkey and
-+      David Engel).
-+
-+      Changed ldd to work on ELF shared libraries.  This may
-+      need a little more work.
-+
-+Changes in version 1.7.14:
-+
-+      Changed ldconfig to recognize ELF shared libraries
-+      generated by post-2.6 versions of ld (Andreas Schwab).
-+
-+      Changed ldconfig to not remove stale links that do not
-+      have a version number since they may be needed by ld.
-+
-+Changes in version 1.7.13:
-+
-+      Fixed a problem in ld-linux.so where a program linked
-+      with a shared library that was not used could result in
-+      a segmentation fault (H.J. Lu).
-+
-+Changes in version 1.7.12:
-+
-+      Fixed a problem in libdl.so where the wrong library
-+      could be marked as global when RTLD_GLOBAL was used
-+      (Lars Heete).
-+
-+      Installed dlfcn.h with libdl.so instead of requiring
-+      it to be supplied with libc.
-+
-+      Removed support for libldso.a since it was nearly
-+      impossible to use anyway.
-+
-+      Changed ldd to detect when the program being checked
-+      exited abnormally.
-+
-+Changes in version 1.7.11:
-+
-+      Changed ld.so and ld-linux.so to delete all variations
-+      of LD_PRELOAD and LD_LIBRARY_PATH for set[ug]id programs,
-+      This makes it harder for broken set[ug]id programs to be
-+      compromised.
-+
-+      Fixed a problem in libdl.so where dlsym would not accept
-+      the handle returned from dlopen(0, *).
-+
-+Changes in version 1.7.10:
-+
-+      Changed ld-linux.so and libdl.so to support RTLD_GLOBAL
-+      (Eric Youngdale).
-+
-+Changes in version 1.7.9:
-+
-+      Fixed a problem in ld-linux.so in detecting when the 
-+      new user/group information is provided by the kernel.
-+
-+      Fixed a problem in ld-linux.so where a buffer could be
-+      overflowed if a large number of libraries were loaded
-+      (Thomas Moore).
-+
-+Changes in version 1.7.8:
-+
-+      Changed the Makefiles and install scripts to support 
-+      a.out- and ELF-only configurations.
-+
-+      Changed ld-linux.so to use the user/group information
-+      provided by linux 1.3.23+ instead of making syscalls
-+      to get it.
-+
-+      Changed libdl.so to support RTLD_NEXT (Glenn Fowler).
-+
-+      Changed libdl.so to only execute the fini sections
-+      instead of completely closing libraries at exit (Glenn
-+      Fowler).
-+
-+      Changed ld.so and ld-linux.so to print the required
-+      cache version when a mismatch is detected.
-+
-+      Changed ld-linux.so to not require on /dev/zero (Ralph
-+      Loader).
-+
-+      Minor m68k cleanups (Andreas Schwab).
-+
-+Changes in version 1.7.7:
-+
-+      Fixed problems compiling with recent 1.3.x kernels.
-+
-+      Changed ld-linux.so to not use MAP_DENYWRITE until the
-+      permission issue regarding it is resolved.
-+
-+Changes in version 1.7.6:
-+
-+      Fixed a bug in ld-linux.so dealing with a zero-length
-+      LD_{ELF_}PRELOAD.
-+
-+      Changed ld.so and ld-linux.so to truncate all variations
-+      of LD_PRELOAD and LD_LIBRARY_PATH for set[ug]id programs.
-+
-+Changes in version 1.7.5:
-+
-+      Changed ldconfig to recognize libraries without any
-+      version number (eg. libXYZ.so).
-+
-+      Changed ldconfig to not generate a corrupt cache when
-+      the disk is full or other write errors occur.
-+
-+      Changed ld-linux.so to map files with MAP_DENYWRITE to
-+      keep them from being changed while the file is in use
-+      (Rick Sladkey).
-+
-+      Changed libdl to not overwrite the scope pointer of a 
-+      library if it was already loaded (H.J. Lu).
-+
-+      Changed ld-linux.so so gdb can be used on constructors
-+      (Eric Youngdale).
-+
-+      Changed ldconfig to ignore ELF libraries where the soname
-+      does not match the file name on the assumption that it is
-+      a used at compile-time (eg. libcurses.so -> libncruses.so).
-+
-+Changes in version 1.7.4:
-+
-+      Changed ld-linux.so and libdl to use the appropriate
-+      rpaths when searching for shared libraries (Eric
-+      Youngdale).
-+
-+      Changed ld-linux.so to search rpath before using the
-+      cache.  This more closely conforms to the IBCS standard.
-+
-+Changes in version 1.7.3:
-+
-+      Changed ld-linux.so to only print a library name the
-+      first time it is loaded when run from ldd.
-+
-+      Fixed a bug in ldconfig where an invalid cache could be
-+      generated if a directory was specified multiple times in
-+      ld.so.conf.
-+
-+      Changed ld-linux.so so it will return the address of a
-+      weak symbol when called from dlsym in libdl (Eric 
-+      Youngdale.
-+
-+Changes in version 1.7.2:
-+
-+      Changed libdl.so again to fix the undefined foobar
-+      problem.
-+
-+Changes in version 1.7.1:
-+
-+      Changed libdl so it will compile at optimization level
-+      O3 or higher.
-+
-+      Changed ldconfig to always create the cache file with 
-+      mode 644.
-+
-+      Changed ldconfig to not ingore valid symlinks.
-+
-+      Changed ldconfig to use the library name as the soname 
-+      for ELF libraries that do not have an soname entry.
-+
-+      Changed ld-linux.so to print the actual, requested library
-+      name at the time it is loaded instead of trying to figure
-+      it out after the fact.
-+
-+Changes in version 1.7.0:
-+
-+      Changed ldconfig to read the actual soname from the image
-+      for ELF libraries and make it available to ld-linux.so.  
-+      The soname for DLL libraries is still determined by
-+      truncating the minor numbers from the image file name.
-+
-+      Changed ldconfig to no longer support the undocumented
-+      sort options.
-+
-+      Changed ld.so to require a valid cache to find libraries
-+      in directories specified in ld.so.conf.  /usr/lib and /lib
-+      are still searched as a last resort.  Ld-linux.so already
-+      operated this way.
-+
-+      Fixed a bug in libldso.a where the arguments to
-+      shared_loader were not parsed correctly (Wolfram Gloger).
-+
-+      Added support for RELA-style relocations under Linux/68k
-+      (Andreas Schwab).
-+
-+      Changed ld-linux.so to only map the cache once for all
-+      libraries instead of individually for each library.
-+
-+      Changed ld-linux.so continue searching the cache instead of
-+      giving up when failing to load the first entry found.
-+
-+      Changed ld-linux.so to produce output similar to ld.so when
-+      run from ldd or when errors occur.
-+
-+Changes in version 1.6.7:
-+
-+      Changed the install scripts to make sure that ld.so and
-+      ld-linux.so are always usable.
-+
-+      Added support for Linux/Sparc (Eric Youngdale).
-+
-+      Added support for Linux/68k (Andreas Schwab).
-+
-+      Fixed various bugs in ld-linux.so dealing with closing
-+      files, unmapping memory, dereferencing NULL pointers and 
-+      printing library names (David Engel, Eric Youngdale and 
-+      Andreas Schwab).
-+
-+      Replaced the manual page for libdl with a freely
-+      distributable one (Adam Richter).
-+
-+      Fixed a bug in ld-linux.so where LD_LIBRARY_PATH and
-+      LD_PRELOAD were not cleared for setuid/setgid programs.
-+
-+      Fixed a bug in libdl where dlsym would not return the
-+      correct address of a symbol if it was redefined in another
-+      library (Oleg Kibirev).
-+
-+      Changed ld-linux.so to use the following order to search 
-+      for libraries:  LD_{ELF_}LIBRARY_PATH, ld.so.cache, rpath, 
-+      /usr/lib and /lib.
-+
-+      Changed ld-linux.so to not needlessly allocate memory when
-+      using ld.so.cache.
-+
-+Changes in version 1.6.6:
-+
-+      Changed ldconfig to not warn about removing stale links
-+      unless the -v option is specified.
-+
-+      Added manual pages for libdl (from FreeBSD/Sun)
-+
-+      Fixed a bug in ld.so dealing with preloading of objects
-+      generated by recent versions of ld (Mitch D'Souza).
-+
-+      Fixed bugs in ldd where some errors were either not
-+      detected or not printed.
-+
-+      Fixed a bug in ld-linux.so where the trailing nul in a
-+      library name was not being copied (Owen Taylor).
-+
-+Changes in version 1.6.5:
-+
-+      Changed ldconfig to remove stale symbolic links.
-+
-+      Added debug hooks in ld-linux.so and libdl.so to be used 
-+      by a future version of gdb (Eric Youngdale).
-+
-+Changes in version 1.6.4:
-+
-+      Change ld-linux.so to print on stdout instead of stderr
-+      when run from ldd.
-+
-+      Added support for Debian GNU/Linux packaging.
-+
-+Changes in version 1.6.3:
-+
-+      Fixed a bug in libdl when closing a library (H.J. Lu).
-+
-+Changes in version 1.6.2:
-+
-+      Changed the error message printed by ldd when a file is
-+      not a.out or ELF.  It used to only list a.out formats.
-+
-+      Changed ldconfig to no longer cache and set up links for
-+      ld-linux.so.
-+
-+      Changed ld-linux.so and libdl to not conflict with upcoming
-+      changes in kernel header files.
-+
-+      Changed ld-linux.so to not print preloaded libraries.
-+
-+Changes in version 1.6.1:
-+
-+      Updated the installation script.
-+
-+      Changed ld.so and ld-linux.so to look for LD_AOUT_PRELOAD
-+      and LD_ELF_PRELOAD, respectively, before LD_PRELOAD.
-+
-+      Changed ld.so and ld-linux.so to use LD_AOUT_LIBRARY_PATH
-+      and LD_ELF_LIBRARY_PATH, respectively, instead of
-+      AOUT_LD_LIBRARY_PATH and ELF_LD_LIBRARY_PATH.
-+
-+Changes in version 1.6.0:
-+
-+      Changed ldconfig to process libraries which do not have
-+      a minor version or patch level number.
-+
-+      Incorporated ld-linux.so and libdl.so.
-+
-+      Changed ld.so and ld-linux.so to not miss entries in the
-+      cache when the fully qualified library is requested.
-+
-+      Changed ldconfig to use stdout instead of stderr when
-+      printing the cache.
-+
-+Changes in version 1.5.3:
-+
-+      LD_PRELOAD enhancements (Tristan Gigold).
-+
-+      LD_PRELOAD patch for linux-68k (Andreas Schwab).
-+
-+Changes in version 1.5.2:
-+
-+      More ELF changes (Mitch D'Souza).
-+
-+      Changed ldconfig to also update the link for ld-linux.so.
-+
-+Changes in version 1.5.1:
-+
-+      More ELF and LD_PRELOAD changes (Mitch D'Souza).
-+
-+Changes in version 1.5.0:
-+
-+      Chnaged all executables to QMAGIC (Mitch D'Souza and Rick
-+      Sladkey).
-+
-+      Added preliminary support for ELF to ldd and ldconfig (Eric 
-+      Youndale and H.J. Lu).
-+
-+      Added support for LD_PRELOAD to ld.so (Mitch D'Souza).
-+
-+      Removed the "advertising" clause from the copyright notices
-+      in all source files.
-+
-+Changes in version 1.4.4:
-+
-+      Changed ldconfig to support QMAGIC libraries.
-+
-+      Fixed a bug in ld.so where some of the error messages had
-+      transposed arguments.
-+
-+Changes in version 1.4.3:
-+
-+      Fixed an obscure bug in ld.so where an index was not being
-+      incremented when a library was not found using the cache.
-+
-+Changes in version 1.4.2:
-+
-+      Changed ldconfig to issue a warning and continue instead
-+      of an error and exiting when a link can't be updated.  
-+      This is useful when some libraries are imported on read-
-+      only file systems, such as an NFS mounted /usr.
-+
-+      Changed ld.so to be more robust in searching for libraries.
-+      A library is not considered found unless it can actually be
-+      loaded.  If a library is not found using the cache, the
-+      standard directories are searched as in pre-cache versions.
-+
-+Changes in version 1.4.1:
-+
-+      Fixed minor Makefile problems.
-+
-+      Added support for linux-68k.
-+
-+      Fixed a bug in ld.so where libraries with absolute paths
-+      were not handled correctly.
-+
-+      Changed ld.so to ignore the directory in the names of
-+      shared libraries by default.  This allows older libraries
-+      with absolute paths, such as the XView libraries, to take
-+      advantage of the cache support.
-+
-+      Added a minimal usage message to ldconfig.
-+
-+Changes in version 1.4:
-+
-+      Fixed bug in ld.so where minor version numbers were not
-+      reported correctly when a minor version incompatibility
-+      was found.
-+
-+      Fixed bug in ldconfig where libraries with subversion
-+      numbers greater than 9 were not compared correctly.
-+
-+      Added Mitch D'Souza's support for suppressing warning
-+      messages from ld.so about minor version incompatibilities.
-+
-+      Added Mitch D'Souza's support for using a cache to speed
-+      up searching for libraries in the standard directories.
-+
-+      Added Mitch D'Souza's support for a debugging version of
-+      ld.so.  Link with -lldso if you think you are experiencing
-+      dynamic linker problems.
-+
-+Changes in version 1.3:
-+
-+      Added support for libraries using absolute pathnames.  If I
-+      had known that the XView libraries used them, I would have
-+      added this earlier.
-+
-+      Fixed a bug handling old libraries using a pathname beginning
-+      with '/' or '/lib/'.
-+
-+Changes in version 1.2a:
-+
-+      Fixed a minor bug in ldd which caused all files, specifically
-+      scripts, to be recognized as binaries.  Thanks to Olaf Flebbe
-+      for reporting it.
-+
-+David Engel
-+david@sw.ods.com
-diff -urN uClibc/ldso-0.9.24/include/.cvsignore uClibc.ldso.24/ldso-0.9.24/include/.cvsignore
---- uClibc/ldso-0.9.24/include/.cvsignore      1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/include/.cvsignore      2003-08-19 01:05:30.000000000 -0500
-@@ -0,0 +1,4 @@
-+elf.h
-+ld_syscalls.h
-+ld_sysdep.h
-+boot1_arch.h
-diff -urN uClibc/ldso-0.9.24/include/dlfcn.h uClibc.ldso.24/ldso-0.9.24/include/dlfcn.h
---- uClibc/ldso-0.9.24/include/dlfcn.h 1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/include/dlfcn.h 2003-08-19 01:05:30.000000000 -0500
-@@ -0,0 +1,22 @@
-+/* User functions for run-time dynamic loading.  libdl version */
-+#ifndef       _DLFCN_H
-+#define       _DLFCN_H 1
-+
-+#include <features.h>
-+#include <bits/dlfcn.h>
-+
-+#define RTLD_NEXT     ((void *) -1l)
-+#define RTLD_DEFAULT  ((void *) 0)
-+
-+/* Structure containing information about object searched using
-+   `dladdr'.  */
-+typedef struct
-+{
-+      __const char *dli_fname;        /* File name of defining object.  */
-+      void *dli_fbase;                /* Load address of that object.  */
-+      __const char *dli_sname;        /* Name of nearest symbol.  */
-+      void *dli_saddr;                /* Exact value of nearest symbol.  */
-+} Dl_info;
-+
-+
-+#endif        /* dlfcn.h */
-diff -urN uClibc/ldso-0.9.24/include/ld_elf.h uClibc.ldso.24/ldso-0.9.24/include/ld_elf.h
---- uClibc/ldso-0.9.24/include/ld_elf.h        1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/include/ld_elf.h        2003-11-04 07:07:45.000000000 -0600
-@@ -0,0 +1,93 @@
-+#ifndef LINUXELF_H
-+#define LINUXELF_H
-+
-+#include <ld_sysdep.h> /* before elf.h to get ELF_USES_RELOCA right */
-+#include <elf.h>
-+#include <link.h>
-+
-+#ifdef DEBUG
-+#  define LDSO_CONF  "../util/ld.so.conf"
-+#  define LDSO_CACHE "../util/ld.so.cache"
-+#  define LDSO_PRELOAD "../util/ld.so.preload"
-+#else
-+#  define LDSO_CONF  UCLIBC_RUNTIME_PREFIX "etc/ld.so.conf"
-+#  define LDSO_CACHE UCLIBC_RUNTIME_PREFIX "etc/ld.so.cache"
-+#  define LDSO_PRELOAD UCLIBC_RUNTIME_PREFIX "etc/ld.so.preload"
-+#endif
-+
-+
-+#define LIB_ANY            -1
-+#define LIB_DLL       0
-+#define LIB_ELF       1
-+#define LIB_ELF64     0x80
-+#define LIB_ELF_LIBC5 2
-+#define LIB_ELF_LIBC6 3
-+#define LIB_ELF_LIBC0 4
-+
-+/* Forward declarations for stuff defined in ld_hash.h */
-+struct dyn_elf;
-+struct elf_resolve;
-+
-+
-+/* Definitions and prototypes for cache stuff */
-+#ifdef USE_CACHE
-+extern int _dl_map_cache(void);
-+extern int _dl_unmap_cache(void);
-+
-+#define LDSO_CACHE_MAGIC "ld.so-"
-+#define LDSO_CACHE_MAGIC_LEN (sizeof LDSO_CACHE_MAGIC -1)
-+#define LDSO_CACHE_VER "1.7.0"
-+#define LDSO_CACHE_VER_LEN (sizeof LDSO_CACHE_VER -1)
-+
-+typedef struct {
-+      char magic   [LDSO_CACHE_MAGIC_LEN];
-+      char version [LDSO_CACHE_VER_LEN];
-+      int nlibs;
-+} header_t;
-+
-+typedef struct {
-+      int flags;
-+      int sooffset;
-+      int liboffset;
-+} libentry_t;
-+
-+#else
-+static inline void _dl_map_cache(void) { }
-+static inline void _dl_unmap_cache(void) { }
-+#endif        
-+
-+
-+/* Function prototypes for non-static stuff in readelflib1.c */
-+int _dl_copy_fixups(struct dyn_elf * tpnt);
-+extern int _dl_parse_copy_information(struct dyn_elf *rpnt,
-+      unsigned long rel_addr, unsigned long rel_size, int type);
-+extern void _dl_parse_lazy_relocation_information(struct elf_resolve *tpnt,
-+      unsigned long rel_addr, unsigned long rel_size, int type);
-+extern int _dl_parse_relocation_information(struct elf_resolve *tpnt,
-+      unsigned long rel_addr, unsigned long rel_size, int type);
-+extern struct elf_resolve * _dl_load_shared_library(int secure, 
-+      struct dyn_elf **rpnt, struct elf_resolve *tpnt, char *full_libname);
-+extern struct elf_resolve * _dl_load_elf_shared_library(int secure, 
-+      struct dyn_elf **rpnt, char *libname);
-+extern struct elf_resolve *_dl_check_if_named_library_is_loaded(const char *full_libname);
-+extern int _dl_linux_resolve(void);
-+
-+
-+/*
-+ * Datatype of a relocation on this platform
-+ */
-+#ifdef ELF_USES_RELOCA
-+# define ELF_RELOC    ElfW(Rela)
-+#else
-+# define ELF_RELOC    ElfW(Rel)
-+#endif
-+
-+
-+/* Convert between the Linux flags for page protections and the
-+   ones specified in the ELF standard. */
-+#define LXFLAGS(X) ( (((X) & PF_R) ? PROT_READ : 0) | \
-+                  (((X) & PF_W) ? PROT_WRITE : 0) | \
-+                  (((X) & PF_X) ? PROT_EXEC : 0))
-+
-+
-+#endif        /* LINUXELF_H */
-diff -urN uClibc/ldso-0.9.24/include/ld_hash.h uClibc.ldso.24/ldso-0.9.24/include/ld_hash.h
---- uClibc/ldso-0.9.24/include/ld_hash.h       1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/include/ld_hash.h       2003-08-19 08:11:05.000000000 -0500
-@@ -0,0 +1,103 @@
-+#ifndef _LD_HASH_H_
-+#define _LD_HASH_H_
-+
-+#ifndef RTLD_NEXT
-+#define RTLD_NEXT     ((void*)-1)
-+#endif
-+
-+struct dyn_elf{
-+  unsigned long flags;
-+  struct elf_resolve * dyn;
-+  struct dyn_elf * next_handle;  /* Used by dlopen et al. */
-+  struct dyn_elf * next;
-+  struct dyn_elf * prev;
-+};
-+
-+struct elf_resolve{
-+  /* These entries must be in this order to be compatible with the interface used
-+     by gdb to obtain the list of symbols. */
-+  ElfW(Addr) loadaddr;                /* Base address shared object is loaded at.  */
-+  char *libname;              /* Absolute file name object was found in.  */
-+  ElfW(Dyn) *dynamic_addr;    /* Dynamic section of the shared object.  */
-+  struct elf_resolve * next;
-+  struct elf_resolve * prev;
-+  /* Nothing after this address is used by gdb. */
-+  enum {elf_lib, elf_executable,program_interpreter, loaded_file} libtype;
-+  struct dyn_elf * symbol_scope;
-+  unsigned short usage_count;
-+  unsigned short int init_flag;
-+  unsigned int nbucket;
-+  unsigned long * elf_buckets;
-+  /*
-+   * These are only used with ELF style shared libraries
-+   */
-+  unsigned long nchain;
-+  unsigned long * chains;
-+  unsigned long dynamic_info[24];
-+
-+  unsigned long dynamic_size;
-+  unsigned long n_phent;
-+  Elf32_Phdr * ppnt;
-+
-+#if defined(__mips__)
-+  /* Needed for MIPS relocation */
-+  unsigned long mips_gotsym;
-+  unsigned long mips_local_gotno;
-+  unsigned long mips_symtabno;
-+#endif
-+
-+#ifdef __powerpc__
-+  /* this is used to store the address of relocation data words, so
-+   * we don't have to calculate it every time, which requires a divide */
-+  unsigned long data_words;
-+#endif
-+};
-+
-+#define COPY_RELOCS_DONE    1
-+#define RELOCS_DONE         2
-+#define JMP_RELOCS_DONE     4
-+#define INIT_FUNCS_CALLED   8
-+
-+extern struct dyn_elf     * _dl_symbol_tables;
-+extern struct elf_resolve * _dl_loaded_modules;
-+extern struct dyn_elf           * _dl_handles;
-+
-+extern struct elf_resolve * _dl_check_hashed_files(const char * libname);
-+extern struct elf_resolve * _dl_add_elf_hash_table(const char * libname, 
-+      char * loadaddr, unsigned long * dynamic_info, 
-+      unsigned long dynamic_addr, unsigned long dynamic_size);
-+
-+enum caller_type{symbolrel=0,copyrel=1,resolver=2};
-+extern char * _dl_find_hash(const char * name, struct dyn_elf * rpnt1, 
-+      struct elf_resolve * f_tpnt, enum caller_type);
-+
-+extern int _dl_linux_dynamic_link(void);
-+
-+extern char * _dl_library_path;
-+extern char * _dl_not_lazy;
-+extern unsigned long _dl_elf_hash(const char * name);
-+
-+static inline int _dl_symbol(char * name)
-+{
-+  if(name[0] != '_' || name[1] != 'd' || name[2] != 'l' || name[3] != '_')
-+    return 0;
-+  return 1;
-+}
-+
-+
-+#define LD_ERROR_NOFILE 1
-+#define LD_ERROR_NOZERO 2
-+#define LD_ERROR_NOTELF 3
-+#define LD_ERROR_NOTMAGIC 4
-+#define LD_ERROR_NOTDYN 5
-+#define LD_ERROR_MMAP_FAILED 6
-+#define LD_ERROR_NODYNAMIC 7
-+#define LD_WRONG_RELOCS 8
-+#define LD_BAD_HANDLE 9
-+#define LD_NO_SYMBOL 10
-+
-+
-+
-+#endif /* _LD_HASH_H_ */
-+
-+
-diff -urN uClibc/ldso-0.9.24/include/ld_string.h uClibc.ldso.24/ldso-0.9.24/include/ld_string.h
---- uClibc/ldso-0.9.24/include/ld_string.h     1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/include/ld_string.h     2003-09-29 16:46:00.000000000 -0500
-@@ -0,0 +1,281 @@
-+#ifndef _LINUX_STRING_H_
-+#define _LINUX_STRING_H_
-+
-+extern void *_dl_malloc(int size);
-+extern char *_dl_getenv(const char *symbol, char **envp);
-+extern void _dl_unsetenv(const char *symbol, char **envp);
-+extern char *_dl_strdup(const char *string);
-+extern void _dl_dprintf(int, const char *, ...);
-+
-+
-+static size_t _dl_strlen(const char * str);
-+static char *_dl_strcat(char *dst, const char *src);
-+static char * _dl_strcpy(char * dst,const char *src);
-+static int _dl_strcmp(const char * s1,const char * s2);
-+static int _dl_strncmp(const char * s1,const char * s2,size_t len);
-+static char * _dl_strchr(const char * str,int c);
-+static char *_dl_strrchr(const char *str, int c);
-+static char *_dl_strstr(const char *s1, const char *s2);
-+static void * _dl_memcpy(void * dst, const void * src, size_t len);
-+static int _dl_memcmp(const void * s1,const void * s2,size_t len);
-+static void *_dl_memset(void * str,int c,size_t len);
-+static char *_dl_get_last_path_component(char *path);
-+static char *_dl_simple_ltoa(char * local, unsigned long i);
-+static char *_dl_simple_ltoahex(char * local, unsigned long i);
-+
-+#ifndef NULL
-+#define NULL ((void *) 0)
-+#endif
-+
-+static inline size_t _dl_strlen(const char * str)
-+{
-+      register char *ptr = (char *) str;
-+
-+      while (*ptr)
-+              ptr++;
-+      return (ptr - str);
-+}
-+
-+static inline char *_dl_strcat(char *dst, const char *src)
-+{
-+      register char *ptr = dst;
-+
-+      while (*ptr)
-+              ptr++;
-+
-+      while (*src)
-+              *ptr++ = *src++;
-+      *ptr = '\0';
-+
-+      return dst;
-+}
-+
-+static inline char * _dl_strcpy(char * dst,const char *src)
-+{
-+      register char *ptr = dst;
-+
-+      while (*src)
-+              *dst++ = *src++;
-+      *dst = '\0';
-+
-+      return ptr;
-+}
-+ 
-+static inline int _dl_strcmp(const char * s1,const char * s2)
-+{
-+      register unsigned char c1, c2;
-+
-+      do {
-+              c1 = (unsigned char) *s1++;
-+              c2 = (unsigned char) *s2++;
-+              if (c1 == '\0')
-+                      return c1 - c2;
-+      }
-+      while (c1 == c2);
-+
-+      return c1 - c2;
-+}
-+
-+static inline int _dl_strncmp(const char * s1,const char * s2,size_t len)
-+{
-+      register unsigned char c1 = '\0';
-+      register unsigned char c2 = '\0';
-+
-+      while (len > 0) {
-+              c1 = (unsigned char) *s1++;
-+              c2 = (unsigned char) *s2++;
-+              if (c1 == '\0' || c1 != c2)
-+                      return c1 - c2;
-+              len--;
-+      }
-+
-+      return c1 - c2;
-+}
-+
-+static inline char * _dl_strchr(const char * str,int c)
-+{
-+      register char ch;
-+
-+      do {
-+              if ((ch = *str) == c)
-+                      return (char *) str;
-+              str++;
-+      }
-+      while (ch);
-+
-+      return 0;
-+}
-+
-+static inline char *_dl_strrchr(const char *str, int c)
-+{
-+    register char *prev = 0;
-+    register char *ptr = (char *) str;
-+
-+    while (*ptr != '\0') {
-+      if (*ptr == c)
-+          prev = ptr;
-+      ptr++;  
-+    }   
-+    if (c == '\0')
-+      return(ptr);
-+    return(prev);
-+}
-+
-+
-+static inline char *_dl_strstr(const char *s1, const char *s2)
-+{
-+    register const char *s = s1;
-+    register const char *p = s2;
-+    
-+    do {
-+        if (!*p) {
-+          return (char *) s1;;
-+      }
-+      if (*p == *s) {
-+          ++p;
-+          ++s;
-+      } else {
-+          p = s2;
-+          if (!*s) {
-+            return NULL;
-+          }
-+          s = ++s1;
-+      }
-+    } while (1);
-+}
-+
-+static inline void * _dl_memcpy(void * dst, const void * src, size_t len)
-+{
-+      register char *a = dst;
-+      register const char *b = src;
-+
-+      while (len--)
-+              *a++ = *b++;
-+
-+      return dst;
-+}
-+
-+
-+static inline int _dl_memcmp(const void * s1,const void * s2,size_t len)
-+{
-+      unsigned char *c1 = (unsigned char *)s1;
-+      unsigned char *c2 = (unsigned char *)s2;
-+
-+      while (len--) {
-+              if (*c1 != *c2) 
-+                      return *c1 - *c2;
-+              c1++;
-+              c2++;
-+      }
-+      return 0;
-+}
-+
-+static inline void * _dl_memset(void * str,int c,size_t len)
-+{
-+      register char *a = str;
-+
-+      while (len--)
-+              *a++ = c;
-+
-+      return str;
-+}
-+
-+static inline char *_dl_get_last_path_component(char *path)
-+{
-+      char *s;
-+      register char *ptr = path;
-+      register char *prev = 0;
-+
-+      while (*ptr)
-+              ptr++;
-+      s = ptr - 1;
-+
-+      /* strip trailing slashes */
-+      while (s != path && *s == '/') {
-+              *s-- = '\0';
-+      }
-+
-+      /* find last component */
-+      ptr = path;
-+      while (*ptr != '\0') {
-+          if (*ptr == '/')
-+              prev = ptr;
-+          ptr++;  
-+      }   
-+      s = prev;
-+
-+      if (s == NULL || s[1] == '\0')
-+              return path;
-+      else
-+              return s+1;
-+}
-+
-+/* Early on, we can't call printf, so use this to print out
-+ * numbers using the SEND_STDERR() macro */
-+static inline char *_dl_simple_ltoa(char * local, unsigned long i)
-+{
-+      /* 21 digits plus null terminator, good for 64-bit or smaller ints */
-+      char *p = &local[22];
-+      *p-- = '\0';
-+      do {
-+              *p-- = '0' + i % 10;
-+              i /= 10;
-+      } while (i > 0);
-+      return p + 1;
-+}
-+
-+static inline char *_dl_simple_ltoahex(char * local, unsigned long i)
-+{
-+      /* 21 digits plus null terminator, good for 64-bit or smaller ints */
-+      char *p = &local[22];
-+      *p-- = '\0';
-+      do {
-+              char temp = i % 0x10;
-+              if (temp <= 0x09)
-+                  *p-- = '0' + temp;
-+              else
-+                  *p-- = 'a' - 0x0a + temp;
-+              i /= 0x10;
-+      } while (i > 0);
-+      *p-- = 'x';
-+      *p-- = '0';
-+      return p + 1;
-+}
-+
-+
-+#if defined(mc68000) || defined(__arm__) || defined(__mips__) || defined(__sh__) ||  defined(__powerpc__)
-+/* On some arches constant strings are referenced through the GOT. */
-+/* XXX Requires load_addr to be defined. */
-+#define SEND_STDERR(X)                                \
-+  { const char *__s = (X);                    \
-+    if (__s < (const char *) load_addr) __s += load_addr;     \
-+    _dl_write (2, __s, _dl_strlen (__s));     \
-+  }
-+#else
-+#define SEND_STDERR(X) _dl_write(2, X, _dl_strlen(X));
-+#endif
-+
-+#define SEND_ADDRESS_STDERR(X, add_a_newline) { \
-+    char tmp[22], *tmp1; \
-+    _dl_memset(tmp, 0, sizeof(tmp)); \
-+    tmp1=_dl_simple_ltoahex( tmp, (unsigned long)(X)); \
-+    _dl_write(2, tmp1, _dl_strlen(tmp1)); \
-+    if (add_a_newline) { \
-+      tmp[0]='\n'; \
-+      _dl_write(2, tmp, 1); \
-+    } \
-+};
-+
-+#define SEND_NUMBER_STDERR(X, add_a_newline) { \
-+    char tmp[22], *tmp1; \
-+    _dl_memset(tmp, 0, sizeof(tmp)); \
-+    tmp1=_dl_simple_ltoa( tmp, (unsigned long)(X)); \
-+    _dl_write(2, tmp1, _dl_strlen(tmp1)); \
-+    if (add_a_newline) { \
-+      tmp[0]='\n'; \
-+      _dl_write(2, tmp, 1); \
-+    } \
-+};
-+
-+
-+#endif
-diff -urN uClibc/ldso-0.9.24/include/ld_syscall.h uClibc.ldso.24/ldso-0.9.24/include/ld_syscall.h
---- uClibc/ldso-0.9.24/include/ld_syscall.h    1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/include/ld_syscall.h    2003-08-19 01:05:30.000000000 -0500
-@@ -0,0 +1,157 @@
-+#ifndef _LD_SYSCALL_H_
-+#define _LD_SYSCALL_H_
-+
-+/* Pull in the arch specific syscall implementation */
-+#include <ld_syscalls.h>
-+/*  For MAP_ANONYMOUS -- differs between platforms */
-+#include <asm/mman.h>                 
-+/* Pull in whatever this particular arch's kernel thinks the kernel version of
-+ * struct stat should look like.  It turns out that each arch has a different
-+ * opinion on the subject, and different kernel revs use different names... */
-+#define kernel_stat stat
-+#include <bits/kernel_stat.h>
-+
-+
-+/* Encoding of the file mode.  */
-+#define       S_IFMT          0170000 /* These bits determine file type.  */
-+
-+/* File types.  */
-+#define       S_IFDIR         0040000 /* Directory.  */
-+#define       S_IFCHR         0020000 /* Character device.  */
-+#define       S_IFBLK         0060000 /* Block device.  */
-+#define       S_IFREG         0100000 /* Regular file.  */
-+#define       S_IFIFO         0010000 /* FIFO.  */
-+#define       S_IFLNK         0120000 /* Symbolic link.  */
-+#define       S_IFSOCK        0140000 /* Socket.  */
-+
-+/* Protection bits.  */
-+
-+#define       S_ISUID         04000   /* Set user ID on execution.  */
-+#define       S_ISGID         02000   /* Set group ID on execution.  */
-+#define       S_ISVTX         01000   /* Save swapped text after use (sticky).  */
-+#define       S_IREAD         0400    /* Read by owner.  */
-+#define       S_IWRITE        0200    /* Write by owner.  */
-+#define       S_IEXEC         0100    /* Execute by owner.  */
-+
-+
-+/* Here are the definitions for some syscalls that are used
-+   by the dynamic linker.  The idea is that we want to be able
-+   to call these before the errno symbol is dynamicly linked, so
-+   we use our own version here.  Note that we cannot assume any
-+   dynamic linking at all, so we cannot return any error codes.
-+   We just punt if there is an error. */
-+
-+
-+#define __NR__dl_exit __NR_exit
-+static inline _syscall1(void, _dl_exit, int, status);
-+
-+
-+#define __NR__dl_close __NR_close
-+static inline _syscall1(int, _dl_close, int, fd);
-+
-+
-+#if defined(__powerpc__) || defined(__mips__) || defined(__sh__)
-+/* PowerPC, MIPS and SuperH have a different calling convention for mmap(). */
-+#define __NR__dl_mmap __NR_mmap
-+static inline _syscall6(void *, _dl_mmap, void *, start, size_t, length,
-+              int, prot, int, flags, int, fd, off_t, offset);
-+#else
-+#define __NR__dl_mmap_real __NR_mmap
-+static inline _syscall1(void *, _dl_mmap_real, unsigned long *, buffer);
-+
-+static inline void * _dl_mmap(void * addr, unsigned long size, int prot,
-+              int flags, int fd, unsigned long offset)
-+{
-+      unsigned long buffer[6];
-+
-+      buffer[0] = (unsigned long) addr;
-+      buffer[1] = (unsigned long) size;
-+      buffer[2] = (unsigned long) prot;
-+      buffer[3] = (unsigned long) flags;
-+      buffer[4] = (unsigned long) fd;
-+      buffer[5] = (unsigned long) offset;
-+      return (void *) _dl_mmap_real(buffer);
-+}
-+#endif
-+
-+#ifndef _dl_MAX_ERRNO
-+#define _dl_MAX_ERRNO 4096
-+#endif
-+#define _dl_mmap_check_error(__res)   \
-+      (((int)__res) < 0 && ((int)__res) >= -_dl_MAX_ERRNO)
-+#ifndef MAP_ANONYMOUS
-+#ifdef __sparc__
-+#define MAP_ANONYMOUS 0x20
-+#else
-+#error MAP_ANONYMOUS not defined and suplementary value not known
-+#endif
-+#endif
-+
-+
-+#define __NR__dl_open __NR_open
-+#define O_RDONLY        0x0000
-+#define O_WRONLY           01
-+#define O_RDWR                     02
-+#define O_CREAT                  0100 /* not fcntl */
-+static inline _syscall2(int, _dl_open, const char *, fn, int, flags);
-+
-+#define __NR__dl_write __NR_write
-+static inline _syscall3(unsigned long, _dl_write, int, fd, 
-+          const void *, buf, unsigned long, count);
-+
-+
-+#define __NR__dl_read __NR_read
-+static inline _syscall3(unsigned long, _dl_read, int, fd, 
-+          const void *, buf, unsigned long, count);
-+
-+#define __NR__dl_mprotect __NR_mprotect
-+static inline _syscall3(int, _dl_mprotect, const void *, addr, unsigned long, len, int, prot);
-+
-+
-+
-+#define __NR__dl_stat __NR_stat
-+static inline _syscall2(int, _dl_stat, const char *, file_name, struct stat *, buf);
-+
-+
-+#define __NR__dl_munmap __NR_munmap
-+static inline _syscall2(int, _dl_munmap, void *, start, unsigned long, length);
-+
-+#define __NR__dl_getuid __NR_getuid
-+static inline _syscall0(uid_t, _dl_getuid);
-+
-+#define __NR__dl_geteuid __NR_geteuid
-+static inline _syscall0(uid_t, _dl_geteuid);
-+
-+#define __NR__dl_getgid __NR_getgid
-+static inline _syscall0(gid_t, _dl_getgid);
-+
-+#define __NR__dl_getegid __NR_getegid
-+static inline _syscall0(gid_t, _dl_getegid);
-+
-+#define __NR__dl_getpid __NR_getpid
-+static inline _syscall0(gid_t, _dl_getpid);
-+
-+/*
-+ * Not an actual syscall, but we need something in assembly to say whether
-+ * this is OK or not.
-+ */
-+static inline int _dl_suid_ok(void)
-+{
-+    uid_t uid, euid, gid, egid;
-+
-+    uid = _dl_getuid();
-+    euid = _dl_geteuid();
-+    gid = _dl_getgid();
-+    egid = _dl_getegid();
-+
-+    if(uid == euid && gid == egid)
-+      return 1;
-+    else
-+      return 0;
-+}
-+
-+#define __NR__dl_readlink __NR_readlink
-+static inline _syscall3(int, _dl_readlink, const char *, path, char *, buf, size_t, bufsiz);
-+
-+#endif /* _LD_SYSCALL_H_ */
-+
-diff -urN uClibc/ldso-0.9.24/include/ldso.h uClibc.ldso.24/ldso-0.9.24/include/ldso.h
---- uClibc/ldso-0.9.24/include/ldso.h  1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/include/ldso.h  2003-08-19 01:05:30.000000000 -0500
-@@ -0,0 +1,11 @@
-+#include <features.h>
-+/* Pull in compiler and arch stuff */
-+#include <stdlib.h>
-+#include <stdarg.h>
-+/* Pull in the arch specific type information */
-+#include <sys/types.h>
-+/* Now the ldso specific headers */
-+#include <ld_elf.h>
-+#include <ld_syscall.h>
-+#include <ld_hash.h>
-+#include <ld_string.h>
-diff -urN uClibc/ldso-0.9.24/ldso/.cvsignore uClibc.ldso.24/ldso-0.9.24/ldso/.cvsignore
---- uClibc/ldso-0.9.24/ldso/.cvsignore 1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/.cvsignore 2003-08-19 01:05:31.000000000 -0500
-@@ -0,0 +1,2 @@
-+ld-uclibc.so*
-+_dl_progname.h
-diff -urN uClibc/ldso-0.9.24/ldso/Makefile uClibc.ldso.24/ldso-0.9.24/ldso/Makefile
---- uClibc/ldso-0.9.24/ldso/Makefile   1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/Makefile   2004-03-01 02:58:58.000000000 -0600
-@@ -0,0 +1,101 @@
-+# Makefile for uClibc
-+#
-+# Copyright (C) 2000 by Lineo, inc.
-+# Copyright (C) 2000-2002 Erik Andersen <andersen@uclibc.org>
-+#
-+# This program is free software; you can redistribute it and/or modify it under
-+# the terms of the GNU Library General Public License as published by the Free
-+# Software Foundation; either version 2 of the License, or (at your option) any
-+# later version.
-+#
-+# This program is distributed in the hope that it will be useful, but WITHOUT
-+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-+# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
-+# details.
-+#
-+# You should have received a copy of the GNU Library General Public License
-+# along with this program; if not, write to the Free Software Foundation, Inc.,
-+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-+#
-+# Derived in part from the Linux-8086 C library, the GNU C Library, and several
-+# other sundry sources.  Files within this library are copyright by their
-+# respective copyright holders.
-+
-+
-+TOPDIR=../../
-+include $(TOPDIR)Rules.mak
-+LDSO_FULLNAME=ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
-+
-+
-+XXFLAGS=$(XWARNINGS) $(OPTIMIZATION) $(XARCH_CFLAGS) $(CPU_CFLAGS) $(PICFLAG) \
-+      -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
-+      -fno-builtin -nostdinc -I$(TOPDIR)ldso-0.9.24/include -I. -I$(TOPDIR)include
-+
-+ifeq ($(SUPPORT_LD_DEBUG),y)
-+XXFLAGS=$(XWARNINGS) $(XARCH_CFLAGS) $(CPU_CFLAGS) $(PICFLAG) \
-+      -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
-+      -fno-builtin -nostdinc -I$(TOPDIR)ldso-0.9.24/include -I. -I$(TOPDIR)include
-+# Not really much point in including debugging info, since gdb
-+# can't really debug ldso, since gdb requires help from ldso to
-+# debug things....
-+XXFLAGS+=-Os #-g3
-+endif
-+
-+# BEWARE!!! At least mips* will die if -O0 is used!!!
-+XXFLAGS :=$(XXFLAGS:-O0=-O1)
-+
-+XXFLAGS+=$(shell $(CC) -print-search-dirs | sed -ne "s/install: *\(.*\)/-I\1include/gp")
-+LDFLAGS=$(CPU_LDFLAGS-y) -shared --warn-common --export-dynamic --sort-common \
-+      -z combreloc --discard-locals --discard-all --no-undefined
-+
-+CSRC= ldso.c #hash.c readelflib1.c $(TARGET_ARCH)/elfinterp.c
-+COBJS=$(patsubst %.c,%.o, $(CSRC))
-+ASRC=$(shell ls $(TARGET_ARCH)/*.S)
-+AOBJS=$(patsubst %.S,%.o, $(ASRC))
-+OBJS=$(AOBJS) $(COBJS)
-+
-+ifneq ($(strip $(SUPPORT_LD_DEBUG)),y)
-+LDFLAGS+=-s
-+endif
-+
-+ifeq ($(strip $(SUPPORT_LD_DEBUG)),y)
-+XXFLAGS+=-D__SUPPORT_LD_DEBUG__
-+endif
-+
-+ifeq ($(strip $(SUPPORT_LD_DEBUG_EARLY)),y)
-+XXFLAGS+=-D__SUPPORT_LD_DEBUG_EARLY__
-+endif
-+
-+ifeq ($(strip $(FORCE_SHAREABLE_TEXT_SEGMENTS)),y)
-+XXFLAGS+=-DFORCE_SHAREABLE_TEXT_SEGMENTS
-+endif
-+
-+#This stuff will not work with -fomit-frame-pointer
-+XXFLAGS := $(XXFLAGS:-fomit-frame-pointer=)
-+
-+all: lib
-+
-+lib:: _dl_progname.h $(OBJS) $(DLINK_OBJS)
-+      $(LD) $(LDFLAGS) -e _dl_boot -soname=$(UCLIBC_LDSO) \
-+              -o $(LDSO_FULLNAME) $(OBJS) $(LIBGCC);
-+      $(INSTALL) -d $(TOPDIR)lib
-+      $(INSTALL) -m 755 $(LDSO_FULLNAME) $(TOPDIR)lib
-+      $(LN) -sf $(LDSO_FULLNAME) $(TOPDIR)lib/$(UCLIBC_LDSO)
-+
-+_dl_progname.h: Makefile
-+      echo "const char *_dl_progname=\""$(UCLIBC_LDSO)"\";" > _dl_progname.h
-+      echo "#include \"$(TARGET_ARCH)/elfinterp.c\"" >> _dl_progname.h
-+
-+
-+$(COBJS): %.o : %.c
-+      $(CC) $(XXFLAGS) -I../libdl -c $< -o $@
-+      $(STRIPTOOL) -x -R .note -R .comment $*.o
-+
-+$(AOBJS): %.o : %.S
-+      $(CC) $(XXFLAGS) -I../libdl -c $< -o $@
-+      $(STRIPTOOL) -x -R .note -R .comment $*.o
-+
-+ldso.o: ldso.c hash.c readelflib1.c $(TARGET_ARCH)/elfinterp.c _dl_progname.h
-+
-+clean:
-+      $(RM) $(UCLIBC_LDSO)* $(OBJS) $(LDSO_FULLNAME)* core *.o *.a *.s *.i _dl_progname.h ldso.h *~
-diff -urN uClibc/ldso-0.9.24/ldso/arm/boot1_arch.h uClibc.ldso.24/ldso-0.9.24/ldso/arm/boot1_arch.h
---- uClibc/ldso-0.9.24/ldso/arm/boot1_arch.h   1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/arm/boot1_arch.h   2002-11-13 18:53:49.000000000 -0600
-@@ -0,0 +1,30 @@
-+/* Any assmbly language/system dependent hacks needed to setup boot1.c so it
-+ * will work as expected and cope with whatever platform specific wierdness is
-+ * needed for this architecture.  */
-+
-+/* Overrive the default _dl_boot function, and replace it with a bit of asm.
-+ * Then call the real _dl_boot function, which is now named _dl_boot2. */
-+
-+asm("" \
-+"     .text\n"                        \
-+"     .globl  _dl_boot\n"             \
-+"_dl_boot:\n"                         \
-+"     mov     r7, sp\n"               \
-+"     @ldr    r0, [sp], #4\n"         \
-+"     mov     r0, sp\n"               \
-+"     bl      _dl_boot2\n"            \
-+"     mov     r6, r0\n"               \
-+"     mov     r0, r7\n"               \
-+"     mov     pc, r6\n"               \
-+);
-+
-+#define _dl_boot _dl_boot2
-+#define LD_BOOT(X)   static void *  __attribute__ ((unused)) _dl_boot (X)
-+
-+
-+ /* It seems ARM needs an offset here */
-+#undef ELFMAGIC
-+#define           ELFMAGIC    ELFMAG+load_addr 
-+
-+
-+
-diff -urN uClibc/ldso-0.9.24/ldso/arm/elfinterp.c uClibc.ldso.24/ldso-0.9.24/ldso/arm/elfinterp.c
---- uClibc/ldso-0.9.24/ldso/arm/elfinterp.c    1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/arm/elfinterp.c    2002-11-07 21:20:59.000000000 -0600
-@@ -0,0 +1,462 @@
-+/* vi: set sw=4 ts=4: */
-+/* ARM ELF shared library loader suppport
-+ *
-+ * Copyright (C) 2001-2002, Erik Andersen
-+ *
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions and the following disclaimer.
-+ * 2. The name of the above contributors may not be
-+ *    used to endorse or promote products derived from this software
-+ *    without specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE
-+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+ * SUCH DAMAGE.
-+ */
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+static const char *_dl_reltypes_tab[] =
-+{
-+  [0] "R_ARM_NONE",       "R_ARM_PC24",       "R_ARM_ABS32",          "R_ARM_REL32",
-+  [4] "R_ARM_PC13",       "R_ARM_ABS16",      "R_ARM_ABS12",          "R_ARM_THM_ABS5",
-+  [8] "R_ARM_ABS8",           "R_ARM_SBREL32","R_ARM_THM_PC22",       "R_ARM_THM_PC8",
-+  [12]        "R_ARM_AMP_VCALL9",     "R_ARM_SWI24",  "R_ARM_THM_SWI8",       "R_ARM_XPC25",
-+  [16]        "R_ARM_THM_XPC22",
-+  [20]        "R_ARM_COPY",           "R_ARM_GLOB_DAT","R_ARM_JUMP_SLOT",     "R_ARM_RELATIVE",
-+  [24]        "R_ARM_GOTOFF",         "R_ARM_GOTPC",   "R_ARM_GOT32",         "R_ARM_PLT32",
-+  [32]        "R_ARM_ALU_PCREL_7_0","R_ARM_ALU_PCREL_15_8","R_ARM_ALU_PCREL_23_15","R_ARM_LDR_SBREL_11_0",
-+  [36]        "R_ARM_ALU_SBREL_19_12","R_ARM_ALU_SBREL_27_20",
-+  [100]       "R_ARM_GNU_VTENTRY","R_ARM_GNU_VTINHERIT","R_ARM_THM_PC11","R_ARM_THM_PC9",
-+  [249] "R_ARM_RXPC25", "R_ARM_RSBREL32", "R_ARM_THM_RPC22", "R_ARM_RREL32",
-+  [253] "R_ARM_RABS22", "R_ARM_RPC24", "R_ARM_RBASE",
-+};
-+
-+static const char *
-+_dl_reltypes(int type)
-+{
-+  static char buf[22];  
-+  const char *str;
-+  
-+  if (type >= (sizeof (_dl_reltypes_tab)/sizeof(_dl_reltypes_tab[0])) ||
-+      NULL == (str = _dl_reltypes_tab[type]))
-+  {
-+    str =_dl_simple_ltoa( buf, (unsigned long)(type));
-+  }
-+  return str;
-+}
-+
-+static 
-+void debug_sym(Elf32_Sym *symtab,char *strtab,int symtab_index)
-+{
-+  if(_dl_debug_symbols)
-+  {
-+    if(symtab_index){
-+      _dl_dprintf(_dl_debug_file, "\n%s\tvalue=%x\tsize=%x\tinfo=%x\tother=%x\tshndx=%x",
-+                strtab + symtab[symtab_index].st_name,
-+                symtab[symtab_index].st_value,
-+                symtab[symtab_index].st_size,
-+                symtab[symtab_index].st_info,
-+                symtab[symtab_index].st_other,
-+                symtab[symtab_index].st_shndx);
-+    }
-+  }
-+}
-+
-+static void debug_reloc(Elf32_Sym *symtab,char *strtab, ELF_RELOC *rpnt)
-+{
-+  if(_dl_debug_reloc)
-+  {
-+    int symtab_index;
-+    const char *sym;
-+    symtab_index = ELF32_R_SYM(rpnt->r_info);
-+    sym = symtab_index ? strtab + symtab[symtab_index].st_name : "sym=0x0";
-+    
-+#ifdef ELF_USES_RELOCA
-+    _dl_dprintf(_dl_debug_file, "\n%s\toffset=%x\taddend=%x %s",
-+              _dl_reltypes(ELF32_R_TYPE(rpnt->r_info)),
-+              rpnt->r_offset,
-+              rpnt->r_addend,
-+              sym);
-+#else
-+    _dl_dprintf(_dl_debug_file, "\n%s\toffset=%x %s",
-+              _dl_reltypes(ELF32_R_TYPE(rpnt->r_info)),
-+              rpnt->r_offset,
-+              sym);
-+#endif
-+  }
-+}
-+#endif
-+
-+/* Program to load an ELF binary on a linux system, and run it.
-+   References to symbols in sharable libraries can be resolved by either
-+   an ELF sharable library or a linux style of shared library. */
-+
-+/* Disclaimer:  I have never seen any AT&T source code for SVr4, nor have
-+   I ever taken any courses on internals.  This program was developed using
-+   information available through the book "UNIX SYSTEM V RELEASE 4,
-+   Programmers guide: Ansi C and Programming Support Tools", which did
-+   a more than adequate job of explaining everything required to get this
-+   working. */
-+
-+extern int _dl_linux_resolve(void);
-+
-+unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry)
-+{
-+      int reloc_type;
-+      ELF_RELOC *this_reloc;
-+      char *strtab;
-+      Elf32_Sym *symtab;
-+      ELF_RELOC *rel_addr;
-+      int symtab_index;
-+      char *new_addr;
-+      char **got_addr;
-+      unsigned long instr_addr;
-+
-+      rel_addr = (ELF_RELOC *) (tpnt->dynamic_info[DT_JMPREL] + tpnt->loadaddr);
-+
-+      this_reloc = rel_addr + (reloc_entry >> 3);
-+      reloc_type = ELF32_R_TYPE(this_reloc->r_info);
-+      symtab_index = ELF32_R_SYM(this_reloc->r_info);
-+
-+      symtab = (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
-+      strtab = (char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
-+
-+
-+      if (reloc_type != R_ARM_JUMP_SLOT) {
-+              _dl_dprintf(2, "%s: Incorrect relocation type in jump relocations\n", 
-+                      _dl_progname);
-+              _dl_exit(1);
-+      };
-+
-+      /* Address of jump instruction to fix up */
-+      instr_addr = ((unsigned long) this_reloc->r_offset + 
-+              (unsigned long) tpnt->loadaddr);
-+      got_addr = (char **) instr_addr;
-+
-+      /* Get the address of the GOT entry */
-+      new_addr = _dl_find_hash(strtab + symtab[symtab_index].st_name, 
-+              tpnt->symbol_scope, tpnt, resolver);
-+      if (!new_addr) {
-+              _dl_dprintf(2, "%s: can't resolve symbol '%s'\n", 
-+                      _dl_progname, strtab + symtab[symtab_index].st_name);
-+              _dl_exit(1);
-+      };
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if ((unsigned long) got_addr < 0x40000000)
-+      {
-+              if (_dl_debug_bindings)
-+              {
-+                      _dl_dprintf(_dl_debug_file, "\nresolve function: %s",
-+                                      strtab + symtab[symtab_index].st_name);
-+                      if(_dl_debug_detail) _dl_dprintf(_dl_debug_file, 
-+                                      "\tpatch %x ==> %x @ %x", *got_addr, new_addr, got_addr);
-+              }
-+      }
-+      if (!_dl_debug_nofixups) {
-+              *got_addr = new_addr;
-+      }
-+#else
-+      *got_addr = new_addr;
-+#endif
-+
-+      return (unsigned long) new_addr;
-+}
-+
-+static int
-+_dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope,
-+        unsigned long rel_addr, unsigned long rel_size,
-+        int (*reloc_fnc) (struct elf_resolve *tpnt, struct dyn_elf *scope,
-+                          ELF_RELOC *rpnt, Elf32_Sym *symtab, char *strtab))
-+{
-+      int i;
-+      char *strtab;
-+      int goof = 0;
-+      Elf32_Sym *symtab;
-+      ELF_RELOC *rpnt;
-+      int symtab_index;
-+      /* Now parse the relocation information */
-+
-+      rpnt = (ELF_RELOC *) (rel_addr + tpnt->loadaddr);
-+      rel_size = rel_size / sizeof(ELF_RELOC);
-+
-+      symtab = (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
-+      strtab = (char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
-+
-+        for (i = 0; i < rel_size; i++, rpnt++) {
-+              int res;
-+          
-+              symtab_index = ELF32_R_SYM(rpnt->r_info);
-+              
-+              /* When the dynamic linker bootstrapped itself, it resolved some symbols.
-+                 Make sure we do not do them again */
-+              if (!symtab_index && tpnt->libtype == program_interpreter)
-+                      continue;
-+              if (symtab_index && tpnt->libtype == program_interpreter &&
-+                  _dl_symbol(strtab + symtab[symtab_index].st_name))
-+                      continue;
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+              debug_sym(symtab,strtab,symtab_index);
-+              debug_reloc(symtab,strtab,rpnt);
-+#endif
-+
-+              res = reloc_fnc (tpnt, scope, rpnt, symtab, strtab);
-+
-+              if (res==0) continue;
-+
-+              _dl_dprintf(2, "\n%s: ",_dl_progname);
-+              
-+              if (symtab_index)
-+                _dl_dprintf(2, "symbol '%s': ", strtab + symtab[symtab_index].st_name);
-+                
-+              if (res <0)
-+              {
-+                      int reloc_type = ELF32_R_TYPE(rpnt->r_info);
-+#if defined (__SUPPORT_LD_DEBUG__)
-+                      _dl_dprintf(2, "can't handle reloc type %s\n ", _dl_reltypes(reloc_type));
-+#else
-+                      _dl_dprintf(2, "can't handle reloc type %x\n", reloc_type);
-+#endif                        
-+                      _dl_exit(-res);
-+              }
-+              else if (res >0)
-+              {
-+                      _dl_dprintf(2, "can't resolve symbol\n");
-+                      goof += res;
-+              }
-+        }
-+        return goof;
-+}
-+
-+static unsigned long
-+fix_bad_pc24 (unsigned long *const reloc_addr, unsigned long value)
-+{
-+  static void *fix_page;
-+  static unsigned int fix_offset;
-+  unsigned int *fix_address;
-+  if (! fix_page)
-+    {
-+      fix_page = _dl_mmap (NULL,  4096   , PROT_READ | PROT_WRITE | PROT_EXEC,
-+                       MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-+      fix_offset = 0;
-+    }
-+
-+  fix_address = (unsigned int *)(fix_page + fix_offset);
-+  fix_address[0] = 0xe51ff004;  /* ldr pc, [pc, #-4] */
-+  fix_address[1] = value;
-+
-+  fix_offset += 8;
-+  if (fix_offset >= 4096)
-+    fix_page = NULL;
-+
-+  return (unsigned long)fix_address;
-+}
-+
-+static int
-+_dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope,
-+            ELF_RELOC *rpnt, Elf32_Sym *symtab, char *strtab)
-+{
-+      int reloc_type;
-+      int symtab_index;
-+      unsigned long *reloc_addr;
-+      unsigned long symbol_addr;
-+      int goof = 0;
-+
-+      reloc_addr = (unsigned long *) (tpnt->loadaddr + (unsigned long) rpnt->r_offset);
-+      reloc_type = ELF32_R_TYPE(rpnt->r_info);
-+      symtab_index = ELF32_R_SYM(rpnt->r_info);
-+      symbol_addr = 0;
-+
-+      if (symtab_index) {
-+
-+              symbol_addr = (unsigned long) _dl_find_hash(strtab + symtab[symtab_index].st_name, 
-+                              scope, (reloc_type == R_ARM_JUMP_SLOT ? tpnt : NULL), symbolrel);
-+
-+              /*
-+               * We want to allow undefined references to weak symbols - this might
-+               * have been intentional.  We should not be linking local symbols
-+               * here, so all bases should be covered.
-+               */
-+              if (!symbol_addr && ELF32_ST_BIND(symtab[symtab_index].st_info) == STB_GLOBAL) {
-+                      goof++;
-+              }
-+      }
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      {
-+              unsigned long old_val = *reloc_addr;
-+#endif
-+              switch (reloc_type) {
-+                      case R_ARM_NONE:
-+                              break;
-+                      case R_ARM_ABS32:
-+                              *reloc_addr += symbol_addr;
-+                              break;
-+                      case R_ARM_PC24:
-+                              {
-+                                      unsigned long addend;
-+                                      long newvalue, topbits;
-+
-+                                      addend = *reloc_addr & 0x00ffffff;
-+                                      if (addend & 0x00800000) addend |= 0xff000000;
-+
-+                                      newvalue = symbol_addr - (unsigned long)reloc_addr + (addend << 2);
-+                                      topbits = newvalue & 0xfe000000;
-+                                      if (topbits != 0xfe000000 && topbits != 0x00000000)
-+                                      {
-+                                              newvalue = fix_bad_pc24(reloc_addr, symbol_addr)
-+                                                      - (unsigned long)reloc_addr + (addend << 2);
-+                                              topbits = newvalue & 0xfe000000;
-+                                              if (topbits != 0xfe000000 && topbits != 0x00000000)
-+                                              {
-+                                                      _dl_dprintf(2,"symbol '%s': R_ARM_PC24 relocation out of range.", 
-+                                                              symtab[symtab_index].st_name);
-+                                                      _dl_exit(1);
-+                                              }
-+                                      }
-+                                      newvalue >>= 2;
-+                                      symbol_addr = (*reloc_addr & 0xff000000) | (newvalue & 0x00ffffff);
-+                                      *reloc_addr = symbol_addr;
-+                                      break;
-+                              }
-+                      case R_ARM_GLOB_DAT:
-+                      case R_ARM_JUMP_SLOT:
-+                              *reloc_addr = symbol_addr;
-+                              break;
-+                      case R_ARM_RELATIVE:
-+                              *reloc_addr += (unsigned long) tpnt->loadaddr;
-+                              break;
-+                      case R_ARM_COPY:                                                
-+#if 0                                                 
-+                              /* Do this later */
-+                              _dl_dprintf(2, "Doing copy for symbol ");
-+                              if (symtab_index) _dl_dprintf(2, strtab + symtab[symtab_index].st_name);
-+                              _dl_dprintf(2, "\n");
-+                              _dl_memcpy((void *) symtab[symtab_index].st_value, 
-+                                              (void *) symbol_addr, symtab[symtab_index].st_size);
-+#endif
-+                              break;
-+                      default:
-+                              return -1; /*call _dl_exit(1) */
-+              }
-+#if defined (__SUPPORT_LD_DEBUG__)
-+              if(_dl_debug_reloc && _dl_debug_detail)
-+                      _dl_dprintf(_dl_debug_file, "\tpatch: %x ==> %x @ %x", old_val, *reloc_addr, reloc_addr);
-+      }
-+
-+#endif
-+
-+      return goof;
-+}
-+
-+static int
-+_dl_do_lazy_reloc (struct elf_resolve *tpnt, struct dyn_elf *scope,
-+                 ELF_RELOC *rpnt, Elf32_Sym *symtab, char *strtab)
-+{
-+      int reloc_type;
-+      unsigned long *reloc_addr;
-+
-+      reloc_addr = (unsigned long *) (tpnt->loadaddr + (unsigned long) rpnt->r_offset);
-+      reloc_type = ELF32_R_TYPE(rpnt->r_info);
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      {
-+              unsigned long old_val = *reloc_addr;
-+#endif
-+              switch (reloc_type) {
-+                      case R_ARM_NONE:
-+                              break;
-+                      case R_ARM_JUMP_SLOT:
-+                              *reloc_addr += (unsigned long) tpnt->loadaddr;
-+                              break;
-+                      default:
-+                              return -1; /*call _dl_exit(1) */
-+              }
-+#if defined (__SUPPORT_LD_DEBUG__)
-+              if(_dl_debug_reloc && _dl_debug_detail)
-+                      _dl_dprintf(_dl_debug_file, "\tpatch: %x ==> %x @ %x", old_val, *reloc_addr, reloc_addr);
-+      }
-+
-+#endif
-+      return 0;
-+
-+}
-+
-+/* This is done as a separate step, because there are cases where
-+   information is first copied and later initialized.  This results in
-+   the wrong information being copied.  Someone at Sun was complaining about
-+   a bug in the handling of _COPY by SVr4, and this may in fact be what he
-+   was talking about.  Sigh. */
-+
-+/* No, there are cases where the SVr4 linker fails to emit COPY relocs
-+   at all */
-+static int
-+_dl_do_copy (struct elf_resolve *tpnt, struct dyn_elf *scope,
-+           ELF_RELOC *rpnt, Elf32_Sym *symtab, char *strtab)
-+{
-+        int reloc_type;
-+      int symtab_index;
-+      unsigned long *reloc_addr;
-+      unsigned long symbol_addr;
-+      int goof = 0;
-+        
-+      reloc_addr = (unsigned long *) (tpnt->loadaddr + (unsigned long) rpnt->r_offset);
-+      reloc_type = ELF32_R_TYPE(rpnt->r_info);
-+      if (reloc_type != R_ARM_COPY) 
-+              return 0;
-+      symtab_index = ELF32_R_SYM(rpnt->r_info);
-+      symbol_addr = 0;
-+              
-+      if (symtab_index) {
-+
-+              symbol_addr = (unsigned long) _dl_find_hash(strtab + 
-+                      symtab[symtab_index].st_name, scope, 
-+                      NULL, copyrel);
-+              if (!symbol_addr) goof++;
-+      }
-+      if (!goof) {
-+#if defined (__SUPPORT_LD_DEBUG__)
-+              if(_dl_debug_move)
-+                _dl_dprintf(_dl_debug_file,"\n%s move %x bytes from %x to %x",
-+                           strtab + symtab[symtab_index].st_name,
-+                           symtab[symtab_index].st_size,
-+                           symbol_addr, symtab[symtab_index].st_value);
-+#endif
-+              _dl_memcpy((char *) symtab[symtab_index].st_value, 
-+                      (char *) symbol_addr, symtab[symtab_index].st_size);
-+      }
-+
-+      return goof;
-+}
-+
-+void _dl_parse_lazy_relocation_information(struct elf_resolve *tpnt, 
-+      unsigned long rel_addr, unsigned long rel_size, int type)
-+{
-+  (void)_dl_parse(tpnt, NULL, rel_addr, rel_size, _dl_do_lazy_reloc);
-+}
-+
-+int _dl_parse_relocation_information(struct elf_resolve *tpnt, 
-+      unsigned long rel_addr, unsigned long rel_size, int type)
-+{
-+  return _dl_parse(tpnt, tpnt->symbol_scope, rel_addr, rel_size, _dl_do_reloc);
-+}
-+
-+int _dl_parse_copy_information(struct dyn_elf *xpnt, unsigned long rel_addr, 
-+      unsigned long rel_size, int type)
-+{
-+  return _dl_parse(xpnt->dyn, xpnt->next, rel_addr, rel_size, _dl_do_copy);
-+}
-+
-diff -urN uClibc/ldso-0.9.24/ldso/arm/ld_syscalls.h uClibc.ldso.24/ldso-0.9.24/ldso/arm/ld_syscalls.h
---- uClibc/ldso-0.9.24/ldso/arm/ld_syscalls.h  1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/arm/ld_syscalls.h  2003-09-09 01:11:11.000000000 -0500
-@@ -0,0 +1,19 @@
-+/* Define the __set_errno macro as nothing so that INLINE_SYSCALL
-+ * won't set errno, which is important since we make system calls
-+ * before the errno symbol is dynamicly linked. */
-+
-+#define __set_errno(X) {(void)(X);}
-+
-+/* Prepare for the case that `__builtin_expect' is not available.  */
-+#if __GNUC__ == 2 && __GNUC_MINOR__ < 96
-+#define __builtin_expect(x, expected_value) (x)
-+#endif
-+#ifndef likely
-+# define likely(x)    __builtin_expect((!!(x)),1)
-+#endif
-+#ifndef unlikely
-+# define unlikely(x)  __builtin_expect((!!(x)),0)
-+#endif
-+
-+#include "sys/syscall.h"
-+
-diff -urN uClibc/ldso-0.9.24/ldso/arm/ld_sysdep.h uClibc.ldso.24/ldso-0.9.24/ldso/arm/ld_sysdep.h
---- uClibc/ldso-0.9.24/ldso/arm/ld_sysdep.h    1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/arm/ld_sysdep.h    2002-08-09 09:41:04.000000000 -0500
-@@ -0,0 +1,124 @@
-+/*
-+ * Various assmbly language/system dependent  hacks that are required
-+ * so that we can minimize the amount of platform specific code.
-+ */
-+
-+/* 
-+ * Define this if the system uses RELOCA.
-+ */
-+#undef ELF_USES_RELOCA
-+
-+/*
-+ * Get a pointer to the argv array.  On many platforms this can be just
-+ * the address if the first argument, on other platforms we need to
-+ * do something a little more subtle here.
-+ */
-+#define GET_ARGV(ARGVP, ARGS) ARGVP = ((unsigned long*)   ARGS)
-+
-+/*
-+ * Initialization sequence for a GOT.
-+ */
-+#define INIT_GOT(GOT_BASE,MODULE) \
-+{                             \
-+  GOT_BASE[2] = (unsigned long) _dl_linux_resolve; \
-+  GOT_BASE[1] = (unsigned long) MODULE; \
-+}
-+
-+/*
-+ * Here is a macro to perform a relocation.  This is only used when
-+ * bootstrapping the dynamic loader.  RELP is the relocation that we
-+ * are performing, REL is the pointer to the address we are relocating.
-+ * SYMBOL is the symbol involved in the relocation, and LOAD is the
-+ * load address.
-+ */
-+#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD)         \
-+      switch(ELF32_R_TYPE((RELP)->r_info)){                   \
-+      case R_ARM_ABS32:                                       \
-+        *REL += SYMBOL;                                       \
-+        break;                                                \
-+        case R_ARM_PC24:                                      \
-+          { long newvalue, topbits;                           \
-+          unsigned long addend = *REL & 0x00ffffff;           \
-+          if (addend & 0x00800000) addend |= 0xff000000;      \
-+          newvalue=SYMBOL-(unsigned long)REL+(addend<<2);     \
-+          topbits = newvalue & 0xfe000000;                    \
-+          if (topbits!=0xfe000000&&topbits!=0x00000000){      \
-+          newvalue = fix_bad_pc24(REL, SYMBOL)                \
-+              -(unsigned long)REL+(addend<<2);                \
-+          topbits = newvalue & 0xfe000000;                    \
-+          if (topbits!=0xfe000000&&topbits!=0x00000000){      \
-+          SEND_STDERR("R_ARM_PC24 relocation out of range\n");\
-+          _dl_exit(1); } }                                    \
-+          newvalue>>=2;                                       \
-+          SYMBOL=(*REL&0xff000000)|(newvalue & 0x00ffffff);   \
-+          *REL=SYMBOL;                                        \
-+          }                                                   \
-+        break;                                                \
-+      case R_ARM_GLOB_DAT:                                    \
-+      case R_ARM_JUMP_SLOT:                                   \
-+        *REL = SYMBOL;                                        \
-+        break;                                                \
-+        case R_ARM_RELATIVE:                                  \
-+        *REL += (unsigned long) LOAD;                         \
-+        break;                                                \
-+        case R_ARM_NONE:                                      \
-+        break;                                                \
-+      default:                                                \
-+        SEND_STDERR("Aiieeee!");                              \
-+        _dl_exit(1);                                          \
-+      }
-+
-+
-+/*
-+ * Transfer control to the user's application, once the dynamic loader
-+ * is done.  This routine has to exit the current function, then 
-+ * call the _dl_elf_main function.
-+ */
-+
-+#define START()   return _dl_elf_main;      
-+
-+
-+
-+/* Here we define the magic numbers that this dynamic loader should accept */
-+
-+#define MAGIC1 EM_ARM
-+#undef  MAGIC2
-+/* Used for error messages */
-+#define ELF_TARGET "ARM"
-+
-+struct elf_resolve;
-+unsigned long _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_entry);
-+
-+static inline unsigned long arm_modulus(unsigned long m, unsigned long p) {
-+      unsigned long i,t,inc;
-+        i=p; t=0;
-+        while(!(i&(1<<31))) {
-+                i<<=1;
-+                t++;
-+        }
-+        t--;
-+        for(inc=t;inc>2;inc--) {
-+                i=p<<inc;
-+                if(i&(1<<31))
-+                        break;
-+                while(m>=i) {
-+                        m-=i;
-+                        i<<=1;
-+                        if(i&(1<<31))
-+                                break;
-+                        if(i<p)
-+                                break;
-+                }
-+        }
-+        while(m>=p) {
-+                m-=p;
-+        }
-+        return m;
-+}
-+
-+#define do_rem(result, n, base)  result=arm_modulus(n,base);
-+
-+/* 4096 bytes alignment */
-+#define PAGE_ALIGN 0xfffff000
-+#define ADDR_ALIGN 0xfff
-+#define OFFS_ALIGN 0x7ffff000
-diff -urN uClibc/ldso-0.9.24/ldso/arm/resolve.S uClibc.ldso.24/ldso-0.9.24/ldso/arm/resolve.S
---- uClibc/ldso-0.9.24/ldso/arm/resolve.S      1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/arm/resolve.S      2002-08-12 04:03:30.000000000 -0500
-@@ -0,0 +1,43 @@
-+/*
-+ * This function is _not_ called directly.  It is jumped to (so no return
-+ * address is on the stack) when attempting to use a symbol that has not yet
-+ * been resolved.  The first time a jump symbol (such as a function call inside
-+ * a shared library) is used (before it gets resolved) it will jump here to
-+ * _dl_linux_resolve.  When we get called the stack looks like this:
-+ *    reloc_entry
-+ *    tpnt
-+ *
-+ * This function saves all the registers, puts a copy of reloc_entry and tpnt
-+ * on the stack (as function arguments) then make the function call
-+ * _dl_linux_resolver(tpnt, reloc_entry).  _dl_linux_resolver() figures out
-+ * where the jump symbol is _really_ supposed to have jumped to and returns
-+ * that to us.  Once we have that, we overwrite tpnt with this fixed up
-+ * address. We then clean up after ourselves, put all the registers back how we
-+ * found them, then we jump to the fixed up address, which is where the jump
-+ * symbol that got us here really wanted to jump to in the first place.  
-+ *  -Erik Andersen
-+ */
-+
-+#define sl r10
-+#define fp r11
-+#define ip r12
-+
-+.text
-+.globl _dl_linux_resolve
-+.type _dl_linux_resolve,%function
-+.align 4;
-+
-+_dl_linux_resolve:
-+      stmdb sp!, {r0, r1, r2, r3, sl, fp}
-+      sub r1, ip, lr
-+      sub r1, r1, #4
-+      add r1, r1, r1
-+      ldr r0, [lr, #-4]
-+      mov r3,r0
-+
-+      bl _dl_linux_resolver
-+
-+      mov ip, r0
-+      ldmia sp!, {r0, r1, r2, r3, sl, fp, lr}
-+      mov pc,ip
-+.size _dl_linux_resolve, .-_dl_linux_resolve
-diff -urN uClibc/ldso-0.9.24/ldso/cris/boot1_arch.h uClibc.ldso.24/ldso-0.9.24/ldso/cris/boot1_arch.h
---- uClibc/ldso-0.9.24/ldso/cris/boot1_arch.h  1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/cris/boot1_arch.h  2003-09-19 07:11:43.000000000 -0500
-@@ -0,0 +1,17 @@
-+/*
-+ * This code fix the stack pointer so that the dynamic linker
-+ * can find argc, argv and auxvt (Auxillary Vector Table).
-+ */
-+asm(""                                        \
-+"     .text\n"                        \
-+"     .globl _dl_boot\n"              \
-+"     .type _dl_boot,@function\n"     \
-+"_dl_boot:\n"                         \
-+"     move.d $sp,$r10\n"              \
-+"     move.d $pc,$r9\n"               \
-+"     add.d _dl_boot2 - ., $r9\n"     \
-+"     jsr $r9\n"                      \
-+);
-+
-+#define _dl_boot _dl_boot2
-+#define LD_BOOT(X) static void * __attribute__ ((unused)) _dl_boot(X)
-diff -urN uClibc/ldso-0.9.24/ldso/cris/elfinterp.c uClibc.ldso.24/ldso-0.9.24/ldso/cris/elfinterp.c
---- uClibc/ldso-0.9.24/ldso/cris/elfinterp.c   1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/cris/elfinterp.c   2003-09-30 06:51:11.000000000 -0500
-@@ -0,0 +1,414 @@
-+/*
-+ * CRIS ELF shared library loader support.
-+ *
-+ * Program to load an elf binary on a linux system, and run it.
-+ * References to symbols in sharable libraries can be resolved
-+ * by either an ELF sharable library or a linux style of shared
-+ * library.
-+ *
-+ * Copyright (C) 2002, Axis Communications AB
-+ * All rights reserved
-+ *
-+ * Author: Tobias Anderberg, <tobiasa@axis.com>
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions and the following disclaimer.
-+ * 2. The name of the above contributors may not be
-+ *    used to endorse or promote products derived from this software
-+ *    without specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE
-+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+ * SUCH DAMAGE.
-+ */
-+
-+/* Support for the LD_DEBUG variable. */
-+#if defined (__SUPPORT_LD_DEBUG__)
-+static const char *_dl_reltypes_tab[] = {
-+      [0]             "R_CRIS_NONE", "R_CRIS_8", "R_CRIS_16", "R_CRIS_32",
-+      [4]             "R_CRIS_8_PCREL", "R_CRIS_16_PCREL", "R_CRIS_32_PCREL", "R_CRIS_GNU_VTINHERIT",
-+      [8]             "R_CRIS_GNU_VTENTRY", "R_CRIS_COPY", "R_CRIS_GLOB_DAT", "R_CRIS_JUMP_SLOT",
-+      [16]    "R_CRIS_RELATIVE", "R_CRIS_16_GOT", "R_CRIS_32_GOT", "R_CRIS_16_GOTPLT",
-+      [32]    "R_CRIS_32_GOTPLT", "R_CRIS_32_GOTREL", "R_CRIS_32_PLT_GOTREL", "R_CRIS_32_PLT_PCREL",
-+
-+};
-+
-+
-+static const char *
-+_dl_reltypes(int type)
-+{
-+      const char *str;
-+      static char buf[22];
-+
-+      if (type >= (sizeof(_dl_reltypes_tab)/sizeof(_dl_reltypes_tab[0])) ||
-+              NULL == (str = _dl_reltypes_tab[type]))
-+              str = _dl_simple_ltoa(buf, (unsigned long) (type));
-+      
-+      return str;
-+}
-+
-+static void 
-+debug_sym(Elf32_Sym *symtab, char *strtab, int symtab_index)
-+{ 
-+      if (_dl_debug_symbols) { 
-+              if (symtab_index) {
-+                      _dl_dprintf(_dl_debug_file, 
-+                              "\n%s\tvalue=%x\tsize=%x\tinfo=%x\tother=%x\tshndx=%x",
-+                              strtab + symtab[symtab_index].st_name,
-+                              symtab[symtab_index].st_value,
-+                              symtab[symtab_index].st_size,
-+                              symtab[symtab_index].st_info,
-+                              symtab[symtab_index].st_other,
-+                              symtab[symtab_index].st_shndx);
-+              }
-+      }
-+}
-+
-+static void
-+debug_reloc(Elf32_Sym *symtab, char *strtab, ELF_RELOC *rpnt)
-+{
-+      if (_dl_debug_reloc) {
-+              int symtab_index;
-+              const char *sym;
-+
-+              symtab_index = ELF32_R_SYM(rpnt->r_info);
-+              sym = symtab_index ? strtab + symtab[symtab_index].st_name : "sym=0x0";
-+
-+              if (_dl_debug_symbols)
-+                      _dl_dprintf(_dl_debug_file, "\n\t");
-+              else
-+                      _dl_dprintf(_dl_debug_file, "\n%s\n\t", sym);
-+
-+#ifdef ELF_USES_RELOCA
-+              _dl_dprintf(_dl_debug_file, "%s\toffset=%x\taddend=%x",
-+                      _dl_reltypes(ELF32_R_TYPE(rpnt->r_info)),
-+                      rpnt->r_offset,
-+                      rpnt->r_addend);
-+#else
-+              _dl_dprintf(_dl_debug_file, "%s\toffset%x\n",
-+                      _dl_reltypes(ELF32_R_TYPE(rpnt->r_info)),
-+                      rpnt->r_offset);
-+#endif
-+      }
-+}
-+#endif /* __SUPPORT_LD_DEBUG__ */
-+
-+/* Defined in resolve.S. */
-+extern int _dl_linux_resolv(void);
-+
-+unsigned long
-+_dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry)
-+{
-+      int reloc_type;
-+      int symtab_index;
-+      char *strtab;
-+      char *symname;
-+      char *new_addr;
-+      char *rel_addr;
-+      char **got_addr;
-+      Elf32_Sym *symtab;
-+      ELF_RELOC *this_reloc;
-+      unsigned long instr_addr;
-+
-+      rel_addr = (char *) (tpnt->dynamic_info[DT_JMPREL] + tpnt->loadaddr);
-+
-+      this_reloc = (ELF_RELOC *) (intptr_t)(rel_addr + reloc_entry);
-+      reloc_type = ELF32_R_TYPE(this_reloc->r_info);
-+      symtab_index = ELF32_R_SYM(this_reloc->r_info);
-+
-+      symtab = (Elf32_Sym *) (intptr_t)(tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
-+      strtab = (char *)(tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
-+      symname = strtab + symtab[symtab_index].st_name;
-+
-+      if (reloc_type != R_CRIS_JUMP_SLOT) {
-+              _dl_dprintf(2, "%s: Incorrect relocation type for jump relocations.\n",
-+                      _dl_progname);
-+              _dl_exit(1);
-+      }
-+
-+      /* Fetch the address of the jump instruction to fix up. */
-+      instr_addr = ((unsigned long) this_reloc->r_offset + (unsigned long) tpnt->loadaddr);
-+      got_addr = (char **) instr_addr;
-+
-+      /* Fetch the address of the GOT entry. */
-+      new_addr = _dl_find_hash(symname, tpnt->symbol_scope, tpnt, resolver);
-+
-+      if (!new_addr) {
-+              new_addr = _dl_find_hash(symname, NULL, NULL, resolver);
-+
-+              if (new_addr)
-+                      return (unsigned long) new_addr;
-+
-+              _dl_dprintf(2, "%s: Can't resolv symbol '%s'\n", _dl_progname, symname);
-+              _dl_exit(1);
-+      }
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if (_dl_debug_bindings) {
-+              _dl_dprintf(_dl_debug_file, "\nresolve function: %s", symname);
-+              
-+              if (_dl_debug_detail)
-+                      _dl_dprintf(_dl_debug_file, "\tpatch %x ==> %x @ %x", *got_addr, new_addr, got_addr);
-+      }
-+#endif
-+
-+      *got_addr = new_addr;
-+      return (unsigned long) new_addr;
-+}
-+
-+static int
-+_dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope, unsigned long rel_addr,
-+      unsigned long rel_size, int (*reloc_fnc)(struct elf_resolve *tpnt, struct dyn_elf *scope, 
-+                                  ELF_RELOC *rpnt, Elf32_Sym *symtab, char *strtab))
-+{
-+      int symtab_index;
-+      int res;
-+      unsigned int i;
-+      char *strtab;
-+      Elf32_Sym *symtab;
-+      ELF_RELOC *rpnt;
-+
-+      /* Parse the relocation information. */
-+      rpnt = (ELF_RELOC *) (intptr_t) (rel_addr + tpnt->loadaddr);
-+      rel_size /= sizeof(ELF_RELOC);
-+
-+      symtab = (Elf32_Sym *) (intptr_t) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
-+      strtab = (char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
-+
-+      for (i = 0; i < rel_size; i++, rpnt++) {
-+              symtab_index = ELF32_R_SYM(rpnt->r_info);
-+
-+              /* 
-+               * Make sure the same symbols that the linker resolved when it
-+               * bootstapped itself isn't resolved again.
-+               */
-+              if (!symtab_index && tpnt->libtype == program_interpreter)
-+                      continue;
-+
-+              if (symtab_index && tpnt->libtype == program_interpreter &&
-+                      _dl_symbol(strtab + symtab[symtab_index].st_name))
-+                      continue;
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+              debug_sym(symtab, strtab, symtab_index);
-+              debug_reloc(symtab, strtab, rpnt);
-+#endif
-+
-+              /* Pass over to actual relocation function. */
-+              res = reloc_fnc(tpnt, scope, rpnt, symtab, strtab);
-+
-+              if (res == 0)
-+                      continue;
-+
-+              _dl_dprintf(2, "\n%s: ", _dl_progname);
-+
-+              if (symtab_index)
-+                      _dl_dprintf(2, "symbol '%s': ", strtab + symtab[symtab_index].st_name);
-+
-+              if (res < 0) {
-+                      int reloc_type = ELF32_R_TYPE(rpnt->r_info);
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+                      _dl_dprintf(2, "can't handle relocation type '%s'\n", _dl_reltypes(reloc_type));
-+#else
-+                      _dl_dprintf(2, "can't handle relocation type %x\n", reloc_type);
-+#endif
-+                      _dl_exit(-res);
-+              }
-+              else if (res > 0) {
-+                      _dl_dprintf(2, "can't resolv symbol\n");
-+                      return res;
-+              }
-+      }
-+
-+      return 0;
-+}
-+
-+static int
-+_dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, ELF_RELOC *rpnt,
-+      Elf32_Sym *symtab, char *strtab)
-+{
-+      int reloc_type;
-+      int symtab_index;
-+      char *symname;
-+      unsigned long *reloc_addr;
-+      unsigned symbol_addr;
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      unsigned long old_val;
-+#endif
-+
-+      reloc_addr = (unsigned long *)(intptr_t)(tpnt->loadaddr + (unsigned long) rpnt->r_offset);
-+      reloc_type = ELF32_R_TYPE(rpnt->r_info);
-+      symtab_index = ELF32_R_SYM(rpnt->r_info);
-+      symbol_addr = 0;
-+      symname = strtab + symtab[symtab_index].st_name;
-+
-+      if (symtab_index) {
-+              if (symtab[symtab_index].st_shndx != SHN_UNDEF && 
-+                      ELF32_ST_BIND(symtab[symtab_index].st_info) == STB_LOCAL) {
-+                      symbol_addr = (unsigned long) tpnt->loadaddr;
-+              }
-+              else {
-+                      symbol_addr = (unsigned long) _dl_find_hash(symname, scope,
-+                              (reloc_type == R_CRIS_JUMP_SLOT ? tpnt : NULL), symbolrel);
-+              }
-+
-+              if (!symbol_addr && ELF32_ST_BIND(symtab[symtab_index].st_info) == STB_GLOBAL) {
-+#if defined (__SUPPORT_LD_DEBUG__)
-+                      _dl_dprintf(2, "\tglobal symbol '%s' already defined in '%s'\n",
-+                              symname, tpnt->libname);
-+#endif
-+                      return 0;
-+              }
-+
-+              symbol_addr += rpnt->r_addend;
-+      }
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      old_val = *reloc_addr;
-+#endif
-+
-+      switch (reloc_type) {
-+              case R_CRIS_NONE:
-+                      break;
-+              case R_CRIS_GLOB_DAT:
-+              case R_CRIS_JUMP_SLOT:
-+              case R_CRIS_32:
-+              case R_CRIS_COPY:
-+                      *reloc_addr = symbol_addr;
-+                      break;
-+              case R_CRIS_RELATIVE:
-+                      *reloc_addr = (unsigned long) tpnt->loadaddr + rpnt->r_addend;
-+                      break;
-+              default:
-+                      return -1;      /* Call _dl_exit(1). */
-+      }
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if (_dl_debug_reloc && _dl_debug_detail)
-+              _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x", old_val, *reloc_addr, reloc_addr);
-+#endif
-+
-+      return 0;
-+}
-+
-+static int
-+_dl_do_lazy_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, ELF_RELOC *rpnt,
-+      Elf32_Sym *symtab, char *strtab)
-+{
-+      int reloc_type;
-+      unsigned long *reloc_addr;
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      unsigned long old_val;
-+#endif
-+
-+      /* Don't care about these, just keep the compiler happy. */
-+      (void) scope;
-+      (void) symtab;
-+      (void) strtab;
-+
-+      reloc_addr = (unsigned long *)(intptr_t)(tpnt->loadaddr + (unsigned long) rpnt->r_offset);
-+      reloc_type = ELF32_R_TYPE(rpnt->r_info);
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      old_val = *reloc_addr;
-+#endif
-+
-+      switch (reloc_type) {
-+              case R_CRIS_NONE:
-+                      break;
-+              case R_CRIS_JUMP_SLOT:
-+                      *reloc_addr += (unsigned long) tpnt->loadaddr;
-+                      break;
-+              default:
-+                      return -1;      /* Calls _dl_exit(1). */
-+      }
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if (_dl_debug_reloc && _dl_debug_detail)
-+              _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x", old_val, *reloc_addr, reloc_addr);
-+#endif
-+
-+      return 0;
-+}
-+
-+static int
-+_dl_do_copy_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, ELF_RELOC *rpnt,
-+      Elf32_Sym *symtab, char *strtab)
-+{
-+      int goof;
-+      int reloc_type;
-+      int symtab_index;
-+      char *symname;
-+      unsigned long *reloc_addr;
-+      unsigned long symbol_addr;
-+
-+      reloc_addr = (unsigned long *)(intptr_t) (tpnt->loadaddr + (unsigned long) rpnt->r_offset);
-+      reloc_type = ELF32_R_TYPE(rpnt->r_info);
-+
-+      if (reloc_type != R_CRIS_COPY)
-+              return 0;
-+      
-+      symtab_index = ELF32_R_SYM(rpnt->r_info);
-+      symbol_addr = 0;
-+      symname = strtab + symtab[symtab_index].st_name;
-+      goof = 0;
-+
-+      if (symtab_index) {
-+              symbol_addr = (unsigned long) _dl_find_hash(symname, scope, NULL, copyrel);
-+
-+              if (!symbol_addr)
-+                      goof++;
-+      }
-+
-+      if (!goof) {
-+#if defined (__SUPPORT_LD_DEBUG__)
-+              if (_dl_debug_move)
-+                      _dl_dprintf(_dl_debug_file, "\n%s move %x bytes from %x to %x",
-+                              symname, symtab[symtab_index].st_size, symbol_addr, symtab[symtab_index].st_value);
-+#endif
-+                      _dl_memcpy((char *) symtab[symtab_index].st_value,
-+                              (char *) symbol_addr, symtab[symtab_index].st_size);
-+      }
-+
-+      return goof;
-+}
-+
-+/* External interface to the generic part of the dynamic linker. */
-+
-+int
-+_dl_parse_relocation_information(struct elf_resolve *tpnt, unsigned long rel_addr,
-+      unsigned long rel_size, int type)
-+{
-+      /* Keep the compiler happy. */
-+      (void) type;
-+      return _dl_parse(tpnt, tpnt->symbol_scope, rel_addr, rel_size, _dl_do_reloc);
-+}
-+void
-+_dl_parse_lazy_relocation_information(struct elf_resolve *tpnt, unsigned long rel_addr,
-+      unsigned long rel_size, int type)
-+{
-+      /* Keep the compiler happy. */
-+      (void) type;
-+      _dl_parse(tpnt, NULL, rel_addr, rel_size, _dl_do_lazy_reloc);
-+}
-+
-+int
-+_dl_parse_copy_information(struct dyn_elf *xpnt, unsigned long rel_addr,
-+      unsigned long rel_size, int type)
-+{
-+      /* Keep the compiler happy. */
-+      (void) type;
-+      return _dl_parse(xpnt->dyn, xpnt->next, rel_addr, rel_size, _dl_do_copy_reloc);
-+}
-diff -urN uClibc/ldso-0.9.24/ldso/cris/ld_syscalls.h uClibc.ldso.24/ldso-0.9.24/ldso/cris/ld_syscalls.h
---- uClibc/ldso-0.9.24/ldso/cris/ld_syscalls.h 1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/cris/ld_syscalls.h 2002-09-23 05:37:16.000000000 -0500
-@@ -0,0 +1,7 @@
-+/* 
-+ * Define the __set_errno macro as nothing so that INLINE_SYSCALL
-+ * won't set errno, which is important since we make system calls
-+ * before the errno symbol is dynamicly linked. 
-+ */
-+#define __set_errno(X) {(void)(X);}
-+#include "sys/syscall.h"
-diff -urN uClibc/ldso-0.9.24/ldso/cris/ld_sysdep.h uClibc.ldso.24/ldso-0.9.24/ldso/cris/ld_sysdep.h
---- uClibc/ldso-0.9.24/ldso/cris/ld_sysdep.h   1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/cris/ld_sysdep.h   2003-08-27 07:59:23.000000000 -0500
-@@ -0,0 +1,112 @@
-+/* CRIS can never use Elf32_Rel relocations. */
-+#define ELF_USES_RELOCA
-+
-+/*
-+ * Get a pointer to the argv array.  On many platforms this can be just
-+ * the address if the first argument, on other platforms we need to
-+ * do something a little more subtle here.
-+ */
-+#define GET_ARGV(ARGVP, ARGS) ARGVP = ((unsigned long *) ARGS)
-+
-+/*
-+ * Initialization sequence for a GOT.
-+ */
-+#define INIT_GOT(GOT_BASE,MODULE)                             \
-+{                                                             \
-+      GOT_BASE[1] = (unsigned long) MODULE;                   \
-+      GOT_BASE[2] = (unsigned long) _dl_linux_resolve;        \
-+}
-+
-+/*
-+ * Here is a macro to perform a relocation.  This is only used when
-+ * bootstrapping the dynamic loader.  RELP is the relocation that we
-+ * are performing, REL is the pointer to the address we are relocating.
-+ * SYMBOL is the symbol involved in the relocation, and LOAD is the
-+ * load address.
-+ */
-+#define PERFORM_BOOTSTRAP_RELOC(RELP, REL, SYMBOL, LOAD)              \
-+      switch (ELF32_R_TYPE((RELP)->r_info)) {                         \
-+              case R_CRIS_GLOB_DAT:                                   \
-+              case R_CRIS_JUMP_SLOT:                                  \
-+              case R_CRIS_32:                                         \
-+                      *REL = SYMBOL;                                  \
-+                      break;                                          \
-+              case R_CRIS_16_PCREL:                                   \
-+                      *(short *) *REL = SYMBOL + (RELP)->r_addend - *REL - 2; \
-+                      break;                                          \
-+              case R_CRIS_32_PCREL:                                   \
-+                      *REL = SYMBOL + (RELP)->r_addend - *REL - 4;    \
-+                      break;                                          \
-+              case R_CRIS_NONE:                                       \
-+                      break;                                          \
-+              case R_CRIS_RELATIVE:                                   \
-+                      *REL = (unsigned long) LOAD + (RELP)->r_addend; \
-+                      break;                                          \
-+              default:                                                \
-+                      _dl_exit(1);                                    \
-+                      break;                                          \
-+      }
-+
-+/*
-+ * Transfer control to the user's application once the dynamic loader
-+ * is done. This routine has to exit the current function, then call
-+ * _dl_elf_main.
-+ */
-+#define START() __asm__ volatile ("moveq 0,$r8\n\t" \
-+                                "move $r8,$srp\n\t" \
-+                                "move.d %1,$sp\n\t" \
-+                                "jump %0\n\t" \
-+                                : : "r" (_dl_elf_main), "r" (args))
-+
-+/* Defined some magic numbers that this ld.so should accept. */
-+#define MAGIC1 EM_CRIS
-+#undef MAGIC2
-+#define ELF_TARGET "CRIS"
-+
-+struct elf_resolve;
-+extern unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry);
-+
-+/* Cheap modulo implementation, taken from arm/ld_sysdep.h. */
-+static inline unsigned long
-+cris_mod(unsigned long m, unsigned long p)
-+{
-+      unsigned long i, t, inc;
-+
-+      i = p;
-+      t = 0;
-+
-+      while (!(i & (1 << 31))) {
-+              i <<= 1;
-+              t++;
-+      }
-+
-+      t--;
-+
-+      for (inc = t; inc > 2; inc--) {
-+              i = p << inc;
-+
-+              if (i & (1 << 31))
-+                      break;
-+
-+              while (m >= i) {
-+                      m -= i;
-+                      i <<= 1;
-+                      if (i & (1 << 31))
-+                              break;
-+                      if (i < p)
-+                              break;
-+              }
-+      }
-+
-+      while (m >= p)
-+              m -= p;
-+
-+      return m;
-+}
-+
-+#define do_rem(result, n, base) result = cris_mod(n, base);
-+
-+/* 8192 bytes alignment */
-+#define PAGE_ALIGN 0xffffe000
-+#define ADDR_ALIGN 0x1fff
-+#define OFFS_ALIGN 0xffffe000
-diff -urN uClibc/ldso-0.9.24/ldso/cris/resolve.S uClibc.ldso.24/ldso-0.9.24/ldso/cris/resolve.S
---- uClibc/ldso-0.9.24/ldso/cris/resolve.S     1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/cris/resolve.S     2002-09-16 03:11:43.000000000 -0500
-@@ -0,0 +1,48 @@
-+/*
-+ * This function is _not_ called directly.  It is jumped to from PLT when 
-+ * attempting to use a symbol that has not yet been resolved.  The first 
-+ * time a jump symbol (such as a function call inside a shared library) 
-+ * is used (before it gets resolved) it will jump here.  When we get called 
-+ * the stack contains reloc_offset and tpnt is in MOF.
-+ *
-+ * We save all the registers, setup R10 and R11 with the right arguments 
-+ * then call _dl_linux_resolver(tpnt, reloc_offset). _dl_linux_resolver() 
-+ * figures out where the jump symbol is _really_ supposed to have jumped to 
-+ * and returns that to us.  Once we have that, we overwrite tpnt with this 
-+ * fixed up address. We then clean up after ourselves, put all the registers 
-+ * back how we found them, then we jump to where the fixed up address, which 
-+ * is where the jump symbol that got us here really wanted to jump to in the 
-+ * first place.
-+ */             
-+
-+.globl _dl_linux_resolve
-+.type _dl_linux_resolve,@function
-+
-+_dl_linux_resolve:
-+      push $r13
-+      push $r12
-+      push $r11
-+      push $r10
-+      push $r9
-+      push $srp
-+      move.d [$sp+6*4],$r11
-+      move $mof,$r10
-+#ifdef __PIC__
-+      move.d $pc,$r0
-+      sub.d .:GOTOFF,$r0
-+      move.d _dl_linux_resolver:PLTG,$r9
-+      add.d $r0,$r9
-+      jsr $r9
-+#else
-+      jsr _dl_linux_resolver
-+#endif
-+      move.d $r10,[$sp+6*4]
-+      pop $srp
-+      pop $r9
-+      pop $r10
-+      pop $r11
-+      pop $r12
-+      pop $r13
-+      jump [$sp+]
-+
-+      .size _dl_linux_resolve, . - _dl_linux_resolve
-diff -urN uClibc/ldso-0.9.24/ldso/hash.c uClibc.ldso.24/ldso-0.9.24/ldso/hash.c
---- uClibc/ldso-0.9.24/ldso/hash.c     1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/hash.c     2003-08-19 08:11:06.000000000 -0500
-@@ -0,0 +1,327 @@
-+/* vi: set sw=4 ts=4: */
-+/* Program to load an ELF binary on a linux system, and run it
-+ * after resolving ELF shared library symbols
-+ *
-+ * Copyright (c) 1994-2000 Eric Youngdale, Peter MacDonald, 
-+ *                            David Engel, Hongjiu Lu and Mitch D'Souza
-+ * Copyright (C) 2001-2002, Erik Andersen
-+ *
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions and the following disclaimer.
-+ * 2. The name of the above contributors may not be
-+ *    used to endorse or promote products derived from this software
-+ *    without specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE
-+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+ * SUCH DAMAGE.
-+ */
-+
-+
-+/* Various symbol table handling functions, including symbol lookup */
-+
-+/*
-+ * This is the start of the linked list that describes all of the files present
-+ * in the system with pointers to all of the symbol, string, and hash tables, 
-+ * as well as all of the other good stuff in the binary.
-+ */
-+
-+struct elf_resolve *_dl_loaded_modules = NULL;
-+
-+/*
-+ * This is the list of modules that are loaded when the image is first
-+ * started.  As we add more via dlopen, they get added into other
-+ * chains.
-+ */
-+struct dyn_elf *_dl_symbol_tables = NULL;
-+
-+/*
-+ * This is the list of modules that are loaded via dlopen.  We may need
-+ * to search these for RTLD_GLOBAL files.
-+ */
-+struct dyn_elf *_dl_handles = NULL;
-+
-+
-+/*
-+ * This is the hash function that is used by the ELF linker to generate
-+ * the hash table that each executable and library is required to
-+ * have.  We need it to decode the hash table.
-+ */
-+
-+unsigned long _dl_elf_hash(const char *name)
-+{
-+      unsigned long hash = 0;
-+      unsigned long tmp;
-+
-+      while (*name) {
-+              hash = (hash << 4) + *name++;
-+              if ((tmp = hash & 0xf0000000))
-+                      hash ^= tmp >> 24;
-+              hash &= ~tmp;
-+      };
-+      return hash;
-+}
-+
-+/*
-+ * Check to see if a library has already been added to the hash chain.
-+ */
-+struct elf_resolve *_dl_check_hashed_files(const char *libname)
-+{
-+      struct elf_resolve *tpnt;
-+      int len = _dl_strlen(libname);
-+
-+      for (tpnt = _dl_loaded_modules; tpnt; tpnt = tpnt->next) {
-+              if (_dl_strncmp(tpnt->libname, libname, len) == 0 &&
-+                      (tpnt->libname[len] == '\0' || tpnt->libname[len] == '.'))
-+                      return tpnt;
-+      }
-+
-+      return NULL;
-+}
-+
-+/*
-+ * We call this function when we have just read an ELF library or executable.
-+ * We add the relevant info to the symbol chain, so that we can resolve all
-+ * externals properly.
-+ */
-+
-+struct elf_resolve *_dl_add_elf_hash_table(const char *libname, 
-+      char *loadaddr, unsigned long *dynamic_info, unsigned long dynamic_addr, 
-+      unsigned long dynamic_size)
-+{
-+      unsigned long *hash_addr;
-+      struct elf_resolve *tpnt;
-+      int i;
-+
-+      if (!_dl_loaded_modules) {
-+              tpnt = _dl_loaded_modules = 
-+                  (struct elf_resolve *) _dl_malloc(sizeof(struct elf_resolve));
-+              _dl_memset(tpnt, 0, sizeof(struct elf_resolve));
-+      } else {
-+              tpnt = _dl_loaded_modules;
-+              while (tpnt->next)
-+                      tpnt = tpnt->next;
-+              tpnt->next = (struct elf_resolve *) _dl_malloc(sizeof(struct elf_resolve));
-+              _dl_memset(tpnt->next, 0, sizeof(struct elf_resolve));
-+              tpnt->next->prev = tpnt;
-+              tpnt = tpnt->next;
-+      };
-+
-+      tpnt->next = NULL;
-+      tpnt->init_flag = 0;
-+      tpnt->libname = _dl_strdup(libname);
-+      tpnt->dynamic_addr = (ElfW(Dyn) *)dynamic_addr;
-+      tpnt->dynamic_size = dynamic_size;
-+      tpnt->libtype = loaded_file;
-+
-+      if (dynamic_info[DT_HASH] != 0) {
-+              hash_addr = (unsigned long *) (intptr_t)(dynamic_info[DT_HASH] + loadaddr);
-+              tpnt->nbucket = *hash_addr++;
-+              tpnt->nchain = *hash_addr++;
-+              tpnt->elf_buckets = hash_addr;
-+              hash_addr += tpnt->nbucket;
-+              tpnt->chains = hash_addr;
-+      }
-+      tpnt->loadaddr = (ElfW(Addr))loadaddr;
-+      for (i = 0; i < 24; i++)
-+              tpnt->dynamic_info[i] = dynamic_info[i];
-+#ifdef __mips__
-+      {
-+              Elf32_Dyn *dpnt = (Elf32_Dyn *) dynamic_addr;
-+
-+              while(dpnt->d_tag) {
-+                      if (dpnt->d_tag == DT_MIPS_GOTSYM)
-+                              tpnt->mips_gotsym = dpnt->d_un.d_val;
-+                      if (dpnt->d_tag == DT_MIPS_LOCAL_GOTNO)
-+                              tpnt->mips_local_gotno = dpnt->d_un.d_val;
-+                      if (dpnt->d_tag == DT_MIPS_SYMTABNO)
-+                              tpnt->mips_symtabno = dpnt->d_un.d_val;
-+                      dpnt++;
-+              }
-+      }
-+#endif
-+      return tpnt;
-+}
-+
-+
-+/*
-+ * This function resolves externals, and this is either called when we process
-+ * relocations or when we call an entry in the PLT table for the first time.
-+ */
-+
-+char *_dl_find_hash(const char *name, struct dyn_elf *rpnt1, 
-+      struct elf_resolve *f_tpnt, enum caller_type caller_type)
-+{
-+      struct elf_resolve *tpnt;
-+      int si;
-+      char *pnt;
-+      int pass;
-+      char *strtab;
-+      Elf32_Sym *symtab;
-+      unsigned long elf_hash_number, hn;
-+      char *weak_result;
-+      struct elf_resolve *first_def;
-+      struct dyn_elf *rpnt, first;
-+      char *data_result = 0;          /* nakao */
-+
-+      weak_result = 0;
-+      elf_hash_number = _dl_elf_hash(name);
-+
-+      /* A quick little hack to make sure that any symbol in the executable
-+         will be preferred to one in a shared library.  This is necessary so
-+         that any shared library data symbols referenced in the executable
-+         will be seen at the same address by the executable, shared libraries
-+         and dynamically loaded code. -Rob Ryan (robr@cmu.edu) */
-+      if (_dl_symbol_tables && !caller_type && rpnt1) {
-+              first = (*_dl_symbol_tables);
-+              first.next = rpnt1;
-+              rpnt1 = (&first);
-+      }
-+
-+      /*
-+       * The passes are so that we can first search the regular symbols
-+       * for whatever module was specified, and then search anything
-+       * loaded with RTLD_GLOBAL.  When pass is 1, it means we are just
-+       * starting the first dlopened module, and anything above that
-+       * is just the next one in the chain.
-+       */
-+      for (pass = 0; (1 == 1); pass++) {
-+
-+              /*
-+               * If we are just starting to search for RTLD_GLOBAL, setup
-+               * the pointer for the start of the search.
-+               */
-+              if (pass == 1) {
-+                      rpnt1 = _dl_handles;
-+              }
-+
-+              /*
-+               * Anything after this, we need to skip to the next module.
-+               */
-+              else if (pass >= 2) {
-+                      rpnt1 = rpnt1->next_handle;
-+              }
-+
-+              /*
-+               * Make sure we still have a module, and make sure that this
-+               * module was loaded with RTLD_GLOBAL.
-+               */
-+              if (pass != 0) {
-+                      if (rpnt1 == NULL)
-+                              break;
-+                      if ((rpnt1->flags & RTLD_GLOBAL) == 0)
-+                              continue;
-+              }
-+
-+              for (rpnt = (rpnt1 ? rpnt1 : _dl_symbol_tables); rpnt; rpnt = rpnt->next) {
-+                      tpnt = rpnt->dyn;
-+
-+                      /*
-+                       * The idea here is that if we are using dlsym, we want to
-+                       * first search the entire chain loaded from dlopen, and
-+                       * return a result from that if we found anything.  If this
-+                       * fails, then we continue the search into the stuff loaded
-+                       * when the image was activated.  For normal lookups, we start
-+                       * with rpnt == NULL, so we should never hit this.  
-+                       */
-+                      if (tpnt->libtype == elf_executable && weak_result != 0) {
-+                              break;
-+                      }
-+
-+                      /*
-+                       * Avoid calling .urem here.
-+                       */
-+                      do_rem(hn, elf_hash_number, tpnt->nbucket);
-+                      symtab = (Elf32_Sym *) (intptr_t) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
-+                      strtab = (char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
-+                      /*
-+                       * This crap is required because the first instance of a
-+                       * symbol on the chain will be used for all symbol references.
-+                       * Thus this instance must be resolved to an address that
-+                       * contains the actual function, 
-+                       */
-+
-+                      first_def = NULL;
-+
-+                      for (si = tpnt->elf_buckets[hn]; si; si = tpnt->chains[si]) {
-+                              pnt = strtab + symtab[si].st_name;
-+
-+                              if (_dl_strcmp(pnt, name) == 0 &&
-+                                  symtab[si].st_value != 0)
-+                              {
-+                                if ((ELF32_ST_TYPE(symtab[si].st_info) == STT_FUNC ||
-+                                     ELF32_ST_TYPE(symtab[si].st_info) == STT_NOTYPE ||
-+                                     ELF32_ST_TYPE(symtab[si].st_info) == STT_OBJECT) &&
-+                                    symtab[si].st_shndx != SHN_UNDEF) {
-+
-+                                      /* Here we make sure that we find a module where the symbol is
-+                                       * actually defined.
-+                                       */
-+
-+                                      if (f_tpnt) {
-+                                              if (!first_def)
-+                                                      first_def = tpnt;
-+                                              if (first_def == f_tpnt
-+                                                      && symtab[si].st_shndx == 0)
-+                                                      continue;
-+                                      }
-+
-+                                      switch (ELF32_ST_BIND(symtab[si].st_info)) {
-+                                      case STB_GLOBAL:
-+                                              if (tpnt->libtype != elf_executable && 
-+                                                      ELF32_ST_TYPE(symtab[si].st_info) 
-+                                                      == STT_NOTYPE) 
-+                                              {       /* nakao */
-+                                                      data_result = (char *)tpnt->loadaddr + 
-+                                                          symtab[si].st_value;        /* nakao */
-+                                                      break;  /* nakao */
-+                                              } else  /* nakao */
-+                                                      return (char*)tpnt->loadaddr + symtab[si].st_value;
-+                                      case STB_WEAK:
-+                                              if (!weak_result)
-+                                                      weak_result = (char *)tpnt->loadaddr + symtab[si].st_value;
-+                                              break;
-+                                      default:        /* Do local symbols need to be examined? */
-+                                              break;
-+                                      }
-+                                }
-+#ifndef __mips__
-+                                /*
-+                                 * References to the address of a function from an executable file and
-+                                 * the shared objects associated with it might not resolve to the same
-+                                 * value. To allow comparisons of function addresses we must resolve
-+                                 * to the address of the plt entry of the executable instead of the
-+                                 * real function address.
-+                                 * see "TIS ELF Specification Version 1.2, Book 3, A-11 (Function
-+                                 * Adresses) 
-+                                 */                            
-+                                if (resolver != caller_type &&
-+                                    NULL==f_tpnt && /*trick: don't  handle R_??_JMP_SLOT reloc type*/
-+                                    tpnt->libtype == elf_executable &&
-+                                    ELF32_ST_TYPE(symtab[si].st_info) == STT_FUNC &&
-+                                    symtab[si].st_shndx == SHN_UNDEF)
-+                                {
-+                                    return (char*)symtab[si].st_value;
-+                                }
-+#endif
-+                              }
-+                      }
-+              }
-+      }
-+      if (data_result)
-+              return data_result;             /* nakao */
-+      return weak_result;
-+}
-diff -urN uClibc/ldso-0.9.24/ldso/i386/boot1_arch.h uClibc.ldso.24/ldso-0.9.24/ldso/i386/boot1_arch.h
---- uClibc/ldso-0.9.24/ldso/i386/boot1_arch.h  1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/i386/boot1_arch.h  2002-08-08 09:35:31.000000000 -0500
-@@ -0,0 +1,7 @@
-+/* Any assmbly language/system dependent hacks needed to setup boot1.c so it
-+ * will work as expected and cope with whatever platform specific wierdness is
-+ * needed for this architecture.  See arm/boot1_arch.h for an example of what
-+ * can be done.
-+ */
-+
-+#define LD_BOOT(X)   void _dl_boot (X)
-diff -urN uClibc/ldso-0.9.24/ldso/i386/elfinterp.c uClibc.ldso.24/ldso-0.9.24/ldso/i386/elfinterp.c
---- uClibc/ldso-0.9.24/ldso/i386/elfinterp.c   1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/i386/elfinterp.c   2003-11-06 16:09:38.000000000 -0600
-@@ -0,0 +1,415 @@
-+/* vi: set sw=4 ts=4: */
-+/* i386 ELF shared library loader suppport
-+ *
-+ * Copyright (c) 1994-2000 Eric Youngdale, Peter MacDonald, 
-+ *                            David Engel, Hongjiu Lu and Mitch D'Souza
-+ * Copyright (C) 2001-2002, Erik Andersen
-+ *
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions and the following disclaimer.
-+ * 2. The name of the above contributors may not be
-+ *    used to endorse or promote products derived from this software
-+ *    without specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE
-+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+ * SUCH DAMAGE.
-+ */
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+static const char *_dl_reltypes_tab[] =
-+{
-+  [0] "R_386_NONE",       "R_386_32",     "R_386_PC32",       "R_386_GOT32",
-+  [4] "R_386_PLT32",      "R_386_COPY",   "R_386_GLOB_DAT",   "R_386_JMP_SLOT",
-+  [8] "R_386_RELATIVE",   "R_386_GOTOFF", "R_386_GOTPC",
-+};
-+
-+static const char *
-+_dl_reltypes(int type)
-+{
-+  static char buf[22];  
-+  const char *str;
-+  
-+  if (type >= (int)(sizeof (_dl_reltypes_tab)/sizeof(_dl_reltypes_tab[0])) ||
-+      NULL == (str = _dl_reltypes_tab[type]))
-+  {
-+    str =_dl_simple_ltoa( buf, (unsigned long)(type));
-+  }
-+  return str;
-+}
-+
-+static 
-+void debug_sym(Elf32_Sym *symtab,char *strtab,int symtab_index)
-+{
-+  if(_dl_debug_symbols)
-+  {
-+    if(symtab_index){
-+      _dl_dprintf(_dl_debug_file, "\n%s\n\tvalue=%x\tsize=%x\tinfo=%x\tother=%x\tshndx=%x",
-+                strtab + symtab[symtab_index].st_name,
-+                symtab[symtab_index].st_value,
-+                symtab[symtab_index].st_size,
-+                symtab[symtab_index].st_info,
-+                symtab[symtab_index].st_other,
-+                symtab[symtab_index].st_shndx);
-+    }
-+  }
-+}
-+
-+static void debug_reloc(Elf32_Sym *symtab,char *strtab, ELF_RELOC *rpnt)
-+{
-+  if(_dl_debug_reloc)
-+  {
-+    int symtab_index;
-+    const char *sym;
-+    symtab_index = ELF32_R_SYM(rpnt->r_info);
-+    sym = symtab_index ? strtab + symtab[symtab_index].st_name : "sym=0x0";
-+    
-+  if(_dl_debug_symbols)
-+        _dl_dprintf(_dl_debug_file, "\n\t");
-+  else
-+        _dl_dprintf(_dl_debug_file, "\n%s\n\t", sym);
-+#ifdef ELF_USES_RELOCA
-+    _dl_dprintf(_dl_debug_file, "%s\toffset=%x\taddend=%x",
-+              _dl_reltypes(ELF32_R_TYPE(rpnt->r_info)),
-+              rpnt->r_offset,
-+              rpnt->r_addend);
-+#else
-+    _dl_dprintf(_dl_debug_file, "%s\toffset=%x\n",
-+              _dl_reltypes(ELF32_R_TYPE(rpnt->r_info)),
-+              rpnt->r_offset);
-+#endif
-+  }
-+}
-+#endif
-+
-+/* Program to load an ELF binary on a linux system, and run it.
-+   References to symbols in sharable libraries can be resolved by either
-+   an ELF sharable library or a linux style of shared library. */
-+
-+/* Disclaimer:  I have never seen any AT&T source code for SVr4, nor have
-+   I ever taken any courses on internals.  This program was developed using
-+   information available through the book "UNIX SYSTEM V RELEASE 4,
-+   Programmers guide: Ansi C and Programming Support Tools", which did
-+   a more than adequate job of explaining everything required to get this
-+   working. */
-+
-+extern int _dl_linux_resolve(void);
-+
-+unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry)
-+{
-+      int reloc_type;
-+      ELF_RELOC *this_reloc;
-+      char *strtab;
-+      Elf32_Sym *symtab;
-+      int symtab_index;
-+      char *rel_addr;
-+      char *new_addr;
-+      char **got_addr;
-+      unsigned long instr_addr;
-+      char *symname;
-+
-+      rel_addr = (char *) (tpnt->dynamic_info[DT_JMPREL] + tpnt->loadaddr);
-+
-+      this_reloc = (ELF_RELOC *)(intptr_t)(rel_addr + reloc_entry);
-+      reloc_type = ELF32_R_TYPE(this_reloc->r_info);
-+      symtab_index = ELF32_R_SYM(this_reloc->r_info);
-+
-+      symtab = (Elf32_Sym *)(intptr_t) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
-+      strtab = (char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
-+      symname= strtab + symtab[symtab_index].st_name;
-+
-+      if (reloc_type != R_386_JMP_SLOT) {
-+              _dl_dprintf(2, "%s: Incorrect relocation type in jump relocations\n", 
-+                              _dl_progname);
-+              _dl_exit(1);
-+      }
-+
-+      /* Address of jump instruction to fix up */
-+      instr_addr = ((unsigned long) this_reloc->r_offset + 
-+                      (unsigned long) tpnt->loadaddr);
-+      got_addr = (char **) instr_addr;
-+
-+      /* Get the address of the GOT entry */
-+      new_addr = _dl_find_hash(symname, tpnt->symbol_scope, tpnt, resolver);
-+      if (!new_addr) {
-+              new_addr = _dl_find_hash(symname, NULL, NULL, resolver);
-+              if (new_addr) {
-+                      return (unsigned long) new_addr;
-+              }
-+              _dl_dprintf(2, "%s: can't resolve symbol '%s'\n", _dl_progname, symname);
-+              _dl_exit(1);
-+      }
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if ((unsigned long) got_addr < 0x40000000)
-+      {
-+              if (_dl_debug_bindings)
-+              {
-+                      _dl_dprintf(_dl_debug_file, "\nresolve function: %s", symname);
-+                      if(_dl_debug_detail) _dl_dprintf(_dl_debug_file, 
-+                                      "\n\tpatched %x ==> %x @ %x\n", *got_addr, new_addr, got_addr);
-+              }
-+      }
-+      if (!_dl_debug_nofixups) {
-+              *got_addr = new_addr;
-+      }
-+#else
-+      *got_addr = new_addr;
-+#endif
-+
-+      return (unsigned long) new_addr;
-+}
-+
-+static int
-+_dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope,
-+        unsigned long rel_addr, unsigned long rel_size,
-+        int (*reloc_fnc) (struct elf_resolve *tpnt, struct dyn_elf *scope,
-+                          ELF_RELOC *rpnt, Elf32_Sym *symtab, char *strtab))
-+{
-+      unsigned int i;
-+      char *strtab;
-+      Elf32_Sym *symtab;
-+      ELF_RELOC *rpnt;
-+      int symtab_index;
-+
-+      /* Now parse the relocation information */
-+      rpnt = (ELF_RELOC *)(intptr_t) (rel_addr + tpnt->loadaddr);
-+      rel_size = rel_size / sizeof(ELF_RELOC);
-+
-+      symtab = (Elf32_Sym *)(intptr_t) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
-+      strtab = (char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
-+
-+        for (i = 0; i < rel_size; i++, rpnt++) {
-+              int res;
-+          
-+              symtab_index = ELF32_R_SYM(rpnt->r_info);
-+              
-+              /* When the dynamic linker bootstrapped itself, it resolved some symbols.
-+                 Make sure we do not do them again */
-+              if (!symtab_index && tpnt->libtype == program_interpreter)
-+                      continue;
-+              if (symtab_index && tpnt->libtype == program_interpreter &&
-+                  _dl_symbol(strtab + symtab[symtab_index].st_name))
-+                      continue;
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+              debug_sym(symtab,strtab,symtab_index);
-+              debug_reloc(symtab,strtab,rpnt);
-+#endif
-+
-+              res = reloc_fnc (tpnt, scope, rpnt, symtab, strtab);
-+
-+              if (res==0) continue;
-+
-+              _dl_dprintf(2, "\n%s: ",_dl_progname);
-+              
-+              if (symtab_index)
-+                _dl_dprintf(2, "symbol '%s': ", strtab + symtab[symtab_index].st_name);
-+                
-+              if (res <0)
-+              {
-+                      int reloc_type = ELF32_R_TYPE(rpnt->r_info);
-+#if defined (__SUPPORT_LD_DEBUG__)
-+                      _dl_dprintf(2, "can't handle reloc type %s\n ", _dl_reltypes(reloc_type));
-+#else
-+                      _dl_dprintf(2, "can't handle reloc type %x\n", reloc_type);
-+#endif                        
-+                      _dl_exit(-res);
-+              }
-+              else if (res >0)
-+              {
-+                      _dl_dprintf(2, "can't resolve symbol\n");
-+                      return res;
-+              }
-+        }
-+        return 0;
-+}
-+
-+
-+static int
-+_dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope,
-+            ELF_RELOC *rpnt, Elf32_Sym *symtab, char *strtab)
-+{
-+      int reloc_type;
-+      int symtab_index;
-+      char *symname;
-+      unsigned long *reloc_addr;
-+      unsigned long symbol_addr;
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      unsigned long old_val;
-+#endif
-+
-+      reloc_addr   = (unsigned long *)(intptr_t) (tpnt->loadaddr + (unsigned long) rpnt->r_offset);
-+      reloc_type   = ELF32_R_TYPE(rpnt->r_info);
-+      symtab_index = ELF32_R_SYM(rpnt->r_info);
-+      symbol_addr  = 0;
-+      symname      = strtab + symtab[symtab_index].st_name;
-+
-+      if (symtab_index) {
-+
-+              symbol_addr = (unsigned long) _dl_find_hash(symname, scope, 
-+                              (reloc_type == R_386_JMP_SLOT ? tpnt : NULL), symbolrel);
-+
-+              /*
-+               * We want to allow undefined references to weak symbols - this might
-+               * have been intentional.  We should not be linking local symbols
-+               * here, so all bases should be covered.
-+               */
-+
-+              if (!symbol_addr && ELF32_ST_BIND(symtab[symtab_index].st_info) == STB_GLOBAL) {
-+#if defined (__SUPPORT_LD_DEBUG__)
-+                      _dl_dprintf(2, "\tglobal symbol '%s' already defined in '%s'\n",
-+                                      symname, tpnt->libname);
-+#endif
-+                      return 0;
-+              }
-+      }
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      old_val = *reloc_addr;
-+#endif
-+              switch (reloc_type) {
-+                      case R_386_NONE:
-+                              break;
-+                      case R_386_32:
-+                              *reloc_addr += symbol_addr;
-+                              break;
-+                      case R_386_PC32:
-+                              *reloc_addr += symbol_addr - (unsigned long) reloc_addr;
-+                              break;
-+                      case R_386_GLOB_DAT:
-+                      case R_386_JMP_SLOT:
-+                              *reloc_addr = symbol_addr;
-+                              break;
-+                      case R_386_RELATIVE:
-+                              *reloc_addr += (unsigned long) tpnt->loadaddr;
-+                              break;
-+                      case R_386_COPY:
-+                              /* handled later on */
-+                              break;
-+                      default:
-+                              return -1; /*call _dl_exit(1) */
-+              }
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if(_dl_debug_reloc && _dl_debug_detail)
-+              _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x", old_val, *reloc_addr, reloc_addr);
-+#endif
-+
-+      return 0;
-+}
-+
-+static int
-+_dl_do_lazy_reloc (struct elf_resolve *tpnt, struct dyn_elf *scope,
-+                 ELF_RELOC *rpnt, Elf32_Sym *symtab, char *strtab)
-+{
-+      int reloc_type;
-+      unsigned long *reloc_addr;
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      unsigned long old_val;
-+#endif
-+      (void)scope;
-+      (void)symtab;
-+      (void)strtab;
-+
-+      reloc_addr = (unsigned long *)(intptr_t) (tpnt->loadaddr + (unsigned long) rpnt->r_offset);
-+      reloc_type = ELF32_R_TYPE(rpnt->r_info);
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      old_val = *reloc_addr;
-+#endif
-+              switch (reloc_type) {
-+                      case R_386_NONE:
-+                              break;
-+                      case R_386_JMP_SLOT:
-+                              *reloc_addr += (unsigned long) tpnt->loadaddr;
-+                              break;
-+                      default:
-+                              return -1; /*call _dl_exit(1) */
-+              }
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if(_dl_debug_reloc && _dl_debug_detail)
-+              _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x", old_val, *reloc_addr, reloc_addr);
-+#endif
-+      return 0;
-+
-+}
-+
-+/* This is done as a separate step, because there are cases where
-+   information is first copied and later initialized.  This results in
-+   the wrong information being copied.  Someone at Sun was complaining about
-+   a bug in the handling of _COPY by SVr4, and this may in fact be what he
-+   was talking about.  Sigh. */
-+
-+/* No, there are cases where the SVr4 linker fails to emit COPY relocs
-+   at all */
-+static int
-+_dl_do_copy (struct elf_resolve *tpnt, struct dyn_elf *scope,
-+           ELF_RELOC *rpnt, Elf32_Sym *symtab, char *strtab)
-+{
-+      int reloc_type;
-+      int symtab_index;
-+      unsigned long *reloc_addr;
-+      unsigned long symbol_addr;
-+      int goof = 0;
-+      char *symname;
-+        
-+      reloc_addr = (unsigned long *)(intptr_t) (tpnt->loadaddr + (unsigned long) rpnt->r_offset);
-+      reloc_type = ELF32_R_TYPE(rpnt->r_info);
-+      if (reloc_type != R_386_COPY) 
-+              return 0;
-+      symtab_index = ELF32_R_SYM(rpnt->r_info);
-+      symbol_addr = 0;
-+      symname      = strtab + symtab[symtab_index].st_name;
-+              
-+      if (symtab_index) {
-+              symbol_addr = (unsigned long) _dl_find_hash(symname, scope, NULL, copyrel);
-+              if (!symbol_addr) goof++;
-+      }
-+      if (!goof) {
-+#if defined (__SUPPORT_LD_DEBUG__)
-+              if(_dl_debug_move)
-+                _dl_dprintf(_dl_debug_file,"\n%s move %x bytes from %x to %x",
-+                           symname, symtab[symtab_index].st_size,
-+                           symbol_addr, symtab[symtab_index].st_value);
-+#endif
-+              _dl_memcpy((char *) symtab[symtab_index].st_value, 
-+                      (char *) symbol_addr, symtab[symtab_index].st_size);
-+      }
-+
-+      return goof;
-+}
-+
-+void _dl_parse_lazy_relocation_information(struct elf_resolve *tpnt, 
-+      unsigned long rel_addr, unsigned long rel_size, int type)
-+{
-+      (void) type;
-+      (void)_dl_parse(tpnt, NULL, rel_addr, rel_size, _dl_do_lazy_reloc);
-+}
-+
-+int _dl_parse_relocation_information(struct elf_resolve *tpnt, 
-+      unsigned long rel_addr, unsigned long rel_size, int type)
-+{
-+      (void) type;
-+      return _dl_parse(tpnt, tpnt->symbol_scope, rel_addr, rel_size, _dl_do_reloc);
-+}
-+
-+int _dl_parse_copy_information(struct dyn_elf *xpnt, unsigned long rel_addr, 
-+      unsigned long rel_size, int type)
-+{
-+      (void) type;
-+      return _dl_parse(xpnt->dyn, xpnt->next, rel_addr, rel_size, _dl_do_copy);
-+}
-+
-diff -urN uClibc/ldso-0.9.24/ldso/i386/ld_syscalls.h uClibc.ldso.24/ldso-0.9.24/ldso/i386/ld_syscalls.h
---- uClibc/ldso-0.9.24/ldso/i386/ld_syscalls.h 1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/i386/ld_syscalls.h 2002-08-09 07:20:21.000000000 -0500
-@@ -0,0 +1,7 @@
-+/* Define the __set_errno macro as nothing so that INLINE_SYSCALL
-+ * won't set errno, which is important since we make system calls
-+ * before the errno symbol is dynamicly linked. */
-+
-+#define __set_errno(X) {(void)(X);}
-+#include "sys/syscall.h"
-+
-diff -urN uClibc/ldso-0.9.24/ldso/i386/ld_sysdep.h uClibc.ldso.24/ldso-0.9.24/ldso/i386/ld_sysdep.h
---- uClibc/ldso-0.9.24/ldso/i386/ld_sysdep.h   1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/i386/ld_sysdep.h   2002-05-28 16:33:32.000000000 -0500
-@@ -0,0 +1,81 @@
-+/*
-+ * Various assmbly language/system dependent  hacks that are required
-+ * so that we can minimize the amount of platform specific code.
-+ */
-+
-+/*
-+ * Define this if the system uses RELOCA.
-+ */
-+#undef ELF_USES_RELOCA
-+
-+/*
-+ * Get a pointer to the argv array.  On many platforms this can be just
-+ * the address if the first argument, on other platforms we need to
-+ * do something a little more subtle here.
-+ */
-+#define GET_ARGV(ARGVP, ARGS) ARGVP = ((unsigned long*) & ARGS)
-+
-+/*
-+ * Initialization sequence for a GOT.
-+ */
-+#define INIT_GOT(GOT_BASE,MODULE) \
-+{                             \
-+  GOT_BASE[2] = (unsigned long) _dl_linux_resolve; \
-+  GOT_BASE[1] = (unsigned long) MODULE; \
-+}
-+
-+/*
-+ * Here is a macro to perform a relocation.  This is only used when
-+ * bootstrapping the dynamic loader.  RELP is the relocation that we
-+ * are performing, REL is the pointer to the address we are relocating.
-+ * SYMBOL is the symbol involved in the relocation, and LOAD is the
-+ * load address.
-+ */
-+#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD) \
-+      switch(ELF32_R_TYPE((RELP)->r_info)){           \
-+      case R_386_32:          \
-+        *REL += SYMBOL;               \
-+        break;                \
-+      case R_386_PC32:                \
-+        *REL += SYMBOL - (unsigned long) REL;         \
-+        break;                \
-+      case R_386_GLOB_DAT:            \
-+      case R_386_JMP_SLOT:            \
-+        *REL = SYMBOL;                \
-+        break;                \
-+      case R_386_RELATIVE:            \
-+        *REL += (unsigned long) LOAD;         \
-+        break;                \
-+      default:                \
-+        _dl_exit(1);          \
-+      }
-+
-+
-+/*
-+ * Transfer control to the user's application, once the dynamic loader
-+ * is done.  This routine has to exit the current function, then 
-+ * call the _dl_elf_main function.
-+ */
-+#define START()               \
-+      __asm__ volatile ("leave\n\t" \
-+                  "jmp *%%eax\n\t"    \
-+                  : "=a" (status) :   "a" (_dl_elf_main))
-+
-+
-+
-+/* Here we define the magic numbers that this dynamic loader should accept */
-+
-+#define MAGIC1 EM_386
-+#undef  MAGIC2
-+/* Used for error messages */
-+#define ELF_TARGET "386"
-+
-+struct elf_resolve;
-+extern unsigned long _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_entry);
-+
-+#define do_rem(result, n, base)  result = (n % base)
-+
-+/* 4096 bytes alignment */
-+#define PAGE_ALIGN 0xfffff000
-+#define ADDR_ALIGN 0xfff
-+#define OFFS_ALIGN 0x7ffff000
-diff -urN uClibc/ldso-0.9.24/ldso/i386/resolve.S uClibc.ldso.24/ldso-0.9.24/ldso/i386/resolve.S
---- uClibc/ldso-0.9.24/ldso/i386/resolve.S     1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/i386/resolve.S     2001-06-14 16:51:51.000000000 -0500
-@@ -0,0 +1,52 @@
-+/*
-+ * This function is _not_ called directly.  It is jumped to (so no return
-+ * address is on the stack) when attempting to use a symbol that has not yet
-+ * been resolved.  The first time a jump symbol (such as a function call inside
-+ * a shared library) is used (before it gets resolved) it will jump here to
-+ * _dl_linux_resolve.  When we get called the stack looks like this:
-+ *    reloc_entry
-+ *    tpnt
-+ *
-+ * This function saves all the registers, puts a copy of reloc_entry and tpnt
-+ * on the stack (as function arguments) then make the function call
-+ * _dl_linux_resolver(tpnt, reloc_entry).  _dl_linux_resolver() figures out
-+ * where the jump symbol is _really_ supposed to have jumped to and returns
-+ * that to us.  Once we have that, we overwrite tpnt with this fixed up
-+ * address. We then clean up after ourselves, put all the registers back how we
-+ * found them, then we jump to where the fixed up address, which is where the
-+ * jump symbol that got us here really wanted to jump to in the first place.
-+ * found them, then we jump to the fixed up address, which is where the jump
-+ * symbol that got us here really wanted to jump to in the first place.  
-+ *  -Erik Andersen
-+ */
-+
-+.text
-+.align 4
-+
-+.globl _dl_linux_resolve
-+.type _dl_linux_resolve,@function
-+
-+_dl_linux_resolve:
-+      pusha                           /* preserve all regs */
-+      lea     0x20(%esp),%eax         /* eax = tpnt and reloc_entry params */
-+      pushl   4(%eax)                 /* push copy of reloc_entry param */
-+      pushl   (%eax)                  /* push copy of tpnt param */
-+                                       
-+#ifdef __PIC__
-+      call    .L24
-+.L24:
-+      popl    %ebx
-+      addl    $_GLOBAL_OFFSET_TABLE_+[.-.L24],%ebx
-+      movl _dl_linux_resolver@GOT(%ebx),%ebx  /* eax = resolved func */
-+      call *%ebx
-+#else
-+      call _dl_linux_resolver
-+#endif
-+      movl    %eax,0x28(%esp)         /* store func addr over original
-+                                       * tpnt param */
-+      addl    $0x8,%esp               /* remove copy parameters */
-+      popa                            /* restore regs */
-+      ret     $4                      /* jump to func removing original
-+                                       * reloc_entry param from stack */
-+.LFE2:
-+      .size _dl_linux_resolve,.LFE2-_dl_linux_resolve
-diff -urN uClibc/ldso-0.9.24/ldso/ldso.c uClibc.ldso.24/ldso-0.9.24/ldso/ldso.c
---- uClibc/ldso-0.9.24/ldso/ldso.c     1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/ldso.c     2003-12-05 14:24:26.000000000 -0600
-@@ -0,0 +1,1296 @@
-+/* vi: set sw=4 ts=4: */
-+/* Program to load an ELF binary on a linux system, and run it
-+ * after resolving ELF shared library symbols
-+ *
-+ * Copyright (c) 1994-2000 Eric Youngdale, Peter MacDonald, 
-+ *                            David Engel, Hongjiu Lu and Mitch D'Souza
-+ * Copyright (C) 2001-2002, Erik Andersen
-+ *
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions and the following disclaimer.
-+ * 2. The name of the above contributors may not be
-+ *    used to endorse or promote products derived from this software
-+ *    without specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE
-+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+ * SUCH DAMAGE.
-+ */
-+
-+// Support a list of library preloads in /etc/ld.so.preload
-+//#define SUPPORT_LDSO_PRELOAD_FILE
-+
-+
-+/* Disclaimer:  I have never seen any AT&T source code for SVr4, nor have
-+   I ever taken any courses on internals.  This program was developed using
-+   information available through the book "UNIX SYSTEM V RELEASE 4,
-+   Programmers guide: Ansi C and Programming Support Tools", which did
-+   a more than adequate job of explaining everything required to get this
-+   working. */
-+
-+/*
-+ * The main trick with this program is that initially, we ourselves are
-+ * not dynamicly linked.  This means that we cannot access any global
-+ * variables or call any functions.  No globals initially, since the
-+ * Global Offset Table (GOT) is initialized by the linker assuming a
-+ * virtual address of 0, and no function calls initially since the
-+ * Procedure Linkage Table (PLT) is not yet initialized.
-+ *
-+ * There are additional initial restrictions - we cannot use large
-+ * switch statements, since the compiler generates tables of addresses
-+ * and jumps through them.  We can use inline functions, because these
-+ * do not transfer control to a new address, but they must be static so
-+ * that they are not exported from the modules.  We cannot use normal
-+ * syscall stubs, because these all reference the errno global variable
-+ * which is not yet initialized.  We can use all of the local stack
-+ * variables that we want.
-+ *
-+ * Life is further complicated by the fact that initially we do not
-+ * want to do a complete dynamic linking.  We want to allow the user to
-+ * supply new functions to override symbols (i.e. weak symbols and/or
-+ * LD_PRELOAD).  So initially, we only perform relocations for
-+ * variables that start with "_dl_" since ANSI specifies that the user
-+ * is not supposed to redefine any of these variables.
-+ *
-+ * Fortunately, the linker itself leaves a few clues lying around, and
-+ * when the kernel starts the image, there are a few further clues.
-+ * First of all, there is Auxiliary Vector Table information sitting on
-+ * which is provided to us by the kernel, and which includes
-+ * information about the load address that the program interpreter was
-+ * loaded at, the number of sections, the address the application was
-+ * loaded at and so forth.  Here this information is stored in the
-+ * array auxvt.  For details see linux/fs/binfmt_elf.c where it calls
-+ * NEW_AUX_ENT() a bunch of time....
-+ *
-+ * Next, we need to find the GOT.  On most arches there is a register
-+ * pointing to the GOT, but just in case (and for new ports) I've added
-+ * some (slow) C code to locate the GOT for you. 
-+ *
-+ * This code was originally written for SVr4, and there the kernel
-+ * would load all text pages R/O, so they needed to call mprotect a
-+ * zillion times to mark all text pages as writable so dynamic linking
-+ * would succeed.  Then when they were done, they would change the
-+ * protections for all the pages back again.  Well, under Linux
-+ * everything is loaded writable (since Linux does copy on write
-+ * anyways) so all the mprotect stuff has been disabled.
-+ *
-+ * Initially, we do not have access to _dl_malloc since we can't yet
-+ * make function calls, so we mmap one page to use as scratch space.
-+ * Later on, when we can call _dl_malloc we reuse this this memory.
-+ * This is also beneficial, since we do not want to use the same memory
-+ * pool as malloc anyway - esp if the user redefines malloc to do
-+ * something funky.
-+ *
-+ * Our first task is to perform a minimal linking so that we can call
-+ * other portions of the dynamic linker.  Once we have done this, we
-+ * then build the list of modules that the application requires, using
-+ * LD_LIBRARY_PATH if this is not a suid program (/usr/lib otherwise).
-+ * Once this is done, we can do the dynamic linking as required, and we
-+ * must omit the things we did to get the dynamic linker up and running
-+ * in the first place.  After we have done this, we just have a few
-+ * housekeeping chores and we can transfer control to the user's
-+ * application.
-+ */
-+
-+#include "ldso.h"
-+
-+
-+#define ALLOW_ZERO_PLTGOT
-+
-+/*  Some arches may need to override this in boot1_arch.h */
-+#define           ELFMAGIC    ELFMAG
-+
-+/* This is a poor man's malloc, used prior to resolving our internal poor man's malloc */
-+#define LD_MALLOC(SIZE) ((void *) (malloc_buffer += SIZE, malloc_buffer - SIZE)) ;  REALIGN();
-+/*
-+ * Make sure that the malloc buffer is aligned on 4 byte boundary.  For 64 bit
-+ * platforms we may need to increase this to 8, but this is good enough for
-+ * now.  This is typically called after LD_MALLOC.
-+ */
-+#define REALIGN() malloc_buffer = (char *) (((unsigned long) malloc_buffer + 3) & ~(3))
-+
-+char *_dl_library_path = 0;           /* Where we look for libraries */
-+char *_dl_preload = 0;                        /* Things to be loaded before the libs. */
-+char *_dl_ldsopath = 0;
-+static int _dl_be_lazy = RTLD_LAZY;
-+#ifdef __SUPPORT_LD_DEBUG__
-+char *_dl_debug  = 0;
-+char *_dl_debug_symbols = 0;
-+char *_dl_debug_move    = 0;
-+char *_dl_debug_reloc   = 0;
-+char *_dl_debug_detail  = 0;
-+char *_dl_debug_nofixups  = 0;
-+char *_dl_debug_bindings  = 0;
-+int   _dl_debug_file = 2;
-+#else
-+#define _dl_debug_file 2
-+#endif
-+static char *_dl_malloc_addr, *_dl_mmap_zero;
-+
-+static char *_dl_trace_loaded_objects = 0;
-+static int (*_dl_elf_main) (int, char **, char **);
-+struct r_debug *_dl_debug_addr = NULL;
-+unsigned long *_dl_brkp;
-+unsigned long *_dl_envp;
-+int _dl_fixup(struct elf_resolve *tpnt, int lazy);
-+void _dl_debug_state(void);
-+char *_dl_get_last_path_component(char *path);
-+static void _dl_get_ready_to_run(struct elf_resolve *tpnt, struct elf_resolve *app_tpnt, 
-+              unsigned long load_addr, unsigned long *hash_addr, Elf32_auxv_t auxvt[AT_EGID + 1], 
-+              char **envp, struct r_debug *debug_addr);
-+
-+#include "boot1_arch.h"
-+#include "_dl_progname.h"                             /* Pull in the value of _dl_progname */
-+
-+/* When we enter this piece of code, the program stack looks like this:
-+        argc            argument counter (integer)
-+        argv[0]         program name (pointer)
-+        argv[1...N]     program args (pointers)
-+        argv[argc-1]    end of args (integer)
-+              NULL
-+        env[0...N]      environment variables (pointers)
-+        NULL
-+              auxvt[0...N]   Auxiliary Vector Table elements (mixed types)
-+*/
-+
-+#ifdef __SUPPORT_LD_DEBUG_EARLY__
-+/* Debugging is especially tricky on PowerPC, since string literals
-+ * require relocations.  Thus, you can't use _dl_dprintf() for
-+ * anything until the bootstrap relocations are finished. */
-+static inline void hexprint(unsigned long x)
-+{
-+      int i;
-+      char c;
-+
-+      for (i = 0; i < 8; i++) {
-+              c = ((x >> 28) + '0');
-+              if (c > '9')
-+                      c += 'a' - '9' - 1;
-+              _dl_write(1, &c, 1);
-+              x <<= 4;
-+      }
-+      c = '\n';
-+      _dl_write(1, &c, 1);
-+}
-+#endif
-+
-+LD_BOOT(unsigned long args) __attribute__ ((unused));
-+
-+LD_BOOT(unsigned long args)
-+{
-+      unsigned int argc;
-+      char **argv, **envp;
-+      unsigned long load_addr;
-+      unsigned long *got;
-+      unsigned long *aux_dat;
-+      int goof = 0;
-+      ElfW(Ehdr) *header;
-+      struct elf_resolve *tpnt;
-+      struct elf_resolve *app_tpnt;
-+      Elf32_auxv_t auxvt[AT_EGID + 1];
-+      unsigned char *malloc_buffer, *mmap_zero;
-+      Elf32_Dyn *dpnt;
-+      unsigned long *hash_addr;
-+      struct r_debug *debug_addr = NULL;
-+      int indx;
-+      int status;
-+
-+
-+      /* WARNING! -- we cannot make _any_ funtion calls until we have
-+       * taken care of fixing up our own relocations.  Making static
-+       * inline calls is ok, but _no_ function calls.  Not yet
-+       * anyways. */
-+
-+      /* First obtain the information on the stack that tells us more about
-+         what binary is loaded, where it is loaded, etc, etc */
-+      GET_ARGV(aux_dat, args);
-+#if defined (__arm__) || defined (__mips__) || defined (__cris__)
-+      aux_dat += 1;
-+#endif
-+      argc = *(aux_dat - 1);
-+      argv = (char **) aux_dat;
-+      aux_dat += argc;                        /* Skip over the argv pointers */
-+      aux_dat++;                                      /* Skip over NULL at end of argv */
-+      envp = (char **) aux_dat;
-+      while (*aux_dat)
-+              aux_dat++;                              /* Skip over the envp pointers */
-+      aux_dat++;                                      /* Skip over NULL at end of envp */
-+
-+      /* Place -1 here as a checkpoint.  We later check if it was changed
-+       * when we read in the auxvt */
-+      auxvt[AT_UID].a_type = -1;
-+
-+      /* The junk on the stack immediately following the environment is  
-+       * the Auxiliary Vector Table.  Read out the elements of the auxvt,
-+       * sort and store them in auxvt for later use. */
-+      while (*aux_dat) {
-+              Elf32_auxv_t *auxv_entry = (Elf32_auxv_t *) aux_dat;
-+
-+              if (auxv_entry->a_type <= AT_EGID) {
-+                      _dl_memcpy(&(auxvt[auxv_entry->a_type]), auxv_entry, sizeof(Elf32_auxv_t));
-+              }
-+              aux_dat += 2;
-+      }
-+
-+      /* locate the ELF header.   We need this done as soon as possible 
-+       * (esp since SEND_STDERR() needs this on some platforms... */
-+      load_addr = auxvt[AT_BASE].a_un.a_val;
-+      header = (ElfW(Ehdr) *) auxvt[AT_BASE].a_un.a_ptr;
-+
-+      /* Check the ELF header to make sure everything looks ok.  */
-+      if (!header || header->e_ident[EI_CLASS] != ELFCLASS32 ||
-+              header->e_ident[EI_VERSION] != EV_CURRENT
-+#if !defined(__powerpc__) && !defined(__mips__) && !defined(__sh__)
-+              || _dl_strncmp((void *) header, ELFMAGIC, SELFMAG) != 0
-+#else
-+              || header->e_ident[EI_MAG0] != ELFMAG0
-+              || header->e_ident[EI_MAG1] != ELFMAG1
-+              || header->e_ident[EI_MAG2] != ELFMAG2
-+              || header->e_ident[EI_MAG3] != ELFMAG3
-+#endif
-+              ) {
-+              SEND_STDERR("Invalid ELF header\n");
-+              _dl_exit(0);
-+      }
-+#ifdef __SUPPORT_LD_DEBUG_EARLY__
-+      SEND_STDERR("ELF header=");
-+      SEND_ADDRESS_STDERR(load_addr, 1);
-+#endif
-+
-+
-+      /* Locate the global offset table.  Since this code must be PIC  
-+       * we can take advantage of the magic offset register, if we
-+       * happen to know what that is for this architecture.  If not,
-+       * we can always read stuff out of the ELF file to find it... */
-+#if defined(__i386__)
-+  __asm__("\tmovl %%ebx,%0\n\t":"=a"(got));
-+#elif defined(__m68k__)
-+  __asm__("movel %%a5,%0":"=g"(got))
-+#elif defined(__sparc__)
-+  __asm__("\tmov %%l7,%0\n\t":"=r"(got))
-+#elif defined(__arm__)
-+  __asm__("\tmov %0, r10\n\t":"=r"(got));
-+#elif defined(__powerpc__)
-+  __asm__("\tbl _GLOBAL_OFFSET_TABLE_-4@local\n\t":"=l"(got));
-+#elif defined(__mips__)
-+  __asm__("\tmove %0, $28\n\tsubu %0,%0,0x7ff0\n\t":"=r"(got));
-+#elif defined(__sh__)
-+  __asm__(
-+"       mov.l    1f, %0\n"
-+"       mova     1f, r0\n"
-+"       bra      2f\n"
-+"       add r0,  %0\n"
-+"       .balign  4\n"
-+"1:     .long    _GLOBAL_OFFSET_TABLE_\n"
-+"2:" : "=r" (got) : : "r0");
-+#elif defined(__cris__)
-+  __asm__("\tmove.d $pc,%0\n\tsub.d .:GOTOFF,%0\n\t":"=r"(got));
-+#else
-+      /* Do things the slow way in C */
-+      {
-+              unsigned long tx_reloc;
-+              Elf32_Dyn *dynamic = NULL;
-+              Elf32_Shdr *shdr;
-+              Elf32_Phdr *pt_load;
-+
-+#ifdef __SUPPORT_LD_DEBUG_EARLY__
-+              SEND_STDERR("Finding the GOT using C code to read the ELF file\n");
-+#endif
-+              /* Find where the dynamic linking information section is hiding */
-+              shdr = (Elf32_Shdr *) (header->e_shoff + (char *) header);
-+              for (indx = header->e_shnum; --indx >= 0; ++shdr) {
-+                      if (shdr->sh_type == SHT_DYNAMIC) {
-+                              goto found_dynamic;
-+                      }
-+              }
-+              SEND_STDERR("missing dynamic linking information section \n");
-+              _dl_exit(0);
-+
-+        found_dynamic:
-+              dynamic = (Elf32_Dyn *) (shdr->sh_offset + (char *) header);
-+
-+              /* Find where PT_LOAD is hiding */
-+              pt_load = (Elf32_Phdr *) (header->e_phoff + (char *) header);
-+              for (indx = header->e_phnum; --indx >= 0; ++pt_load) {
-+                      if (pt_load->p_type == PT_LOAD) {
-+                              goto found_pt_load;
-+                      }
-+              }
-+              SEND_STDERR("missing loadable program segment\n");
-+              _dl_exit(0);
-+
-+        found_pt_load:
-+              /* Now (finally) find where DT_PLTGOT is hiding */
-+              tx_reloc = pt_load->p_vaddr - pt_load->p_offset;
-+              for (; DT_NULL != dynamic->d_tag; ++dynamic) {
-+                      if (dynamic->d_tag == DT_PLTGOT) {
-+                              goto found_got;
-+                      }
-+              }
-+              SEND_STDERR("missing global offset table\n");
-+              _dl_exit(0);
-+
-+        found_got:
-+              got = (unsigned long *) (dynamic->d_un.d_val - tx_reloc +
-+                              (char *) header);
-+      }
-+#endif
-+
-+      /* Now, finally, fix up the location of the dynamic stuff */
-+      dpnt = (Elf32_Dyn *) (*got + load_addr);
-+#ifdef __SUPPORT_LD_DEBUG_EARLY__
-+      SEND_STDERR("First Dynamic section entry=");
-+      SEND_ADDRESS_STDERR(dpnt, 1);
-+#endif
-+
-+
-+      /* Call mmap to get a page of writable memory that can be used 
-+       * for _dl_malloc throughout the shared lib loader. */
-+      mmap_zero = malloc_buffer = _dl_mmap((void *) 0, 4096, 
-+                      PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
-+      if (_dl_mmap_check_error(mmap_zero)) {
-+              SEND_STDERR("dl_boot: mmap of a spare page failed!\n");
-+              _dl_exit(13);
-+      }
-+
-+      tpnt = LD_MALLOC(sizeof(struct elf_resolve));
-+      _dl_memset(tpnt, 0, sizeof(struct elf_resolve));
-+      app_tpnt = LD_MALLOC(sizeof(struct elf_resolve));
-+      _dl_memset(app_tpnt, 0, sizeof(struct elf_resolve));
-+
-+      /*
-+       * This is used by gdb to locate the chain of shared libraries that are currently loaded.
-+       */
-+      debug_addr = LD_MALLOC(sizeof(struct r_debug));
-+      _dl_memset(debug_addr, 0, sizeof(struct r_debug));
-+
-+      /* OK, that was easy.  Next scan the DYNAMIC section of the image.
-+         We are only doing ourself right now - we will have to do the rest later */
-+#ifdef __SUPPORT_LD_DEBUG_EARLY__
-+      SEND_STDERR("scanning DYNAMIC section\n");
-+#endif
-+      while (dpnt->d_tag) {
-+#if defined(__mips__)
-+              if (dpnt->d_tag == DT_MIPS_GOTSYM)
-+                      tpnt->mips_gotsym = (unsigned long) dpnt->d_un.d_val;
-+              if (dpnt->d_tag == DT_MIPS_LOCAL_GOTNO)
-+                      tpnt->mips_local_gotno = (unsigned long) dpnt->d_un.d_val;
-+              if (dpnt->d_tag == DT_MIPS_SYMTABNO)
-+                      tpnt->mips_symtabno = (unsigned long) dpnt->d_un.d_val;
-+#endif
-+              if (dpnt->d_tag < 24) {
-+                      tpnt->dynamic_info[dpnt->d_tag] = dpnt->d_un.d_val;
-+                      if (dpnt->d_tag == DT_TEXTREL) {
-+                              tpnt->dynamic_info[DT_TEXTREL] = 1;
-+                      }
-+              }
-+              dpnt++;
-+      }
-+
-+      {
-+              ElfW(Phdr) *ppnt;
-+              int i;
-+
-+              ppnt = (ElfW(Phdr) *) auxvt[AT_PHDR].a_un.a_ptr;
-+              for (i = 0; i < auxvt[AT_PHNUM].a_un.a_val; i++, ppnt++)
-+                      if (ppnt->p_type == PT_DYNAMIC) {
-+                              dpnt = (Elf32_Dyn *) ppnt->p_vaddr;
-+                              while (dpnt->d_tag) {
-+#if defined(__mips__)
-+                                      if (dpnt->d_tag == DT_MIPS_GOTSYM)
-+                                              app_tpnt->mips_gotsym =
-+                                                      (unsigned long) dpnt->d_un.d_val;
-+                                      if (dpnt->d_tag == DT_MIPS_LOCAL_GOTNO)
-+                                              app_tpnt->mips_local_gotno =
-+                                                      (unsigned long) dpnt->d_un.d_val;
-+                                      if (dpnt->d_tag == DT_MIPS_SYMTABNO)
-+                                              app_tpnt->mips_symtabno =
-+                                                      (unsigned long) dpnt->d_un.d_val;
-+                                      if (dpnt->d_tag > DT_JMPREL) {
-+                                              dpnt++;
-+                                              continue;
-+                                      }
-+                                      app_tpnt->dynamic_info[dpnt->d_tag] = dpnt->d_un.d_val;
-+
-+#warning "Debugging threads on mips won't work till someone fixes this..."
-+#if 0
-+                                      if (dpnt->d_tag == DT_DEBUG) {
-+                                              dpnt->d_un.d_val = (unsigned long) debug_addr;
-+                                      }
-+#endif
-+
-+#else
-+                                      if (dpnt->d_tag > DT_JMPREL) {
-+                                              dpnt++;
-+                                              continue;
-+                                      }
-+                                      app_tpnt->dynamic_info[dpnt->d_tag] = dpnt->d_un.d_val;
-+                                      if (dpnt->d_tag == DT_DEBUG) {
-+                                              dpnt->d_un.d_val = (unsigned long) debug_addr;
-+                                      }
-+#endif
-+                                      if (dpnt->d_tag == DT_TEXTREL)
-+                                              app_tpnt->dynamic_info[DT_TEXTREL] = 1;
-+                                      dpnt++;
-+                              }
-+                      }
-+      }
-+
-+#ifdef __SUPPORT_LD_DEBUG_EARLY__
-+      SEND_STDERR("done scanning DYNAMIC section\n");
-+#endif
-+
-+      /* Get some more of the information that we will need to dynamicly link
-+         this module to itself */
-+
-+      hash_addr = (unsigned long *) (tpnt->dynamic_info[DT_HASH] + load_addr);
-+      tpnt->nbucket = *hash_addr++;
-+      tpnt->nchain = *hash_addr++;
-+      tpnt->elf_buckets = hash_addr;
-+      hash_addr += tpnt->nbucket;
-+
-+#ifdef __SUPPORT_LD_DEBUG_EARLY__
-+      SEND_STDERR("done grabbing link information\n");
-+#endif
-+
-+#ifndef FORCE_SHAREABLE_TEXT_SEGMENTS
-+      /* Ugly, ugly.  We need to call mprotect to change the protection of
-+         the text pages so that we can do the dynamic linking.  We can set the
-+         protection back again once we are done */
-+
-+      {
-+              ElfW(Phdr) *ppnt;
-+              int i;
-+
-+#ifdef __SUPPORT_LD_DEBUG_EARLY__
-+              SEND_STDERR("calling mprotect on the shared library/dynamic linker\n");
-+#endif
-+
-+              /* First cover the shared library/dynamic linker. */
-+              if (tpnt->dynamic_info[DT_TEXTREL]) {
-+                      header = (ElfW(Ehdr) *) auxvt[AT_BASE].a_un.a_ptr;
-+                      ppnt = (ElfW(Phdr) *) ((int)auxvt[AT_BASE].a_un.a_ptr + 
-+                                      header->e_phoff);
-+                      for (i = 0; i < header->e_phnum; i++, ppnt++) {
-+                              if (ppnt->p_type == PT_LOAD && !(ppnt->p_flags & PF_W)) {
-+                                      _dl_mprotect((void *) (load_addr + (ppnt->p_vaddr & PAGE_ALIGN)), 
-+                                                      (ppnt->p_vaddr & ADDR_ALIGN) + (unsigned long) ppnt->p_filesz, 
-+                                                      PROT_READ | PROT_WRITE | PROT_EXEC);
-+                              }
-+                      }
-+              }
-+
-+#ifdef __SUPPORT_LD_DEBUG_EARLY__
-+              SEND_STDERR("calling mprotect on the application program\n");
-+#endif
-+              /* Now cover the application program. */
-+              if (app_tpnt->dynamic_info[DT_TEXTREL]) {
-+                      ppnt = (ElfW(Phdr) *) auxvt[AT_PHDR].a_un.a_ptr;
-+                      for (i = 0; i < auxvt[AT_PHNUM].a_un.a_val; i++, ppnt++) {
-+                              if (ppnt->p_type == PT_LOAD && !(ppnt->p_flags & PF_W))
-+                                      _dl_mprotect((void *) (ppnt->p_vaddr & PAGE_ALIGN),
-+                                                               (ppnt->p_vaddr & ADDR_ALIGN) +
-+                                                               (unsigned long) ppnt->p_filesz,
-+                                                               PROT_READ | PROT_WRITE | PROT_EXEC);
-+                      }
-+              }
-+      }
-+#endif
-+      
-+#if defined(__mips__)
-+#ifdef __SUPPORT_LD_DEBUG_EARLY__
-+      SEND_STDERR("About to do MIPS specific GOT bootstrap\n");
-+#endif
-+      /* For MIPS we have to do stuff to the GOT before we do relocations.  */
-+      PERFORM_BOOTSTRAP_GOT(got);
-+#endif
-+
-+      /* OK, now do the relocations.  We do not do a lazy binding here, so
-+         that once we are done, we have considerably more flexibility. */
-+#ifdef __SUPPORT_LD_DEBUG_EARLY__
-+      SEND_STDERR("About to do library loader relocations\n");
-+#endif
-+
-+      goof = 0;
-+      for (indx = 0; indx < 2; indx++) {
-+              unsigned int i;
-+              ELF_RELOC *rpnt;
-+              unsigned long *reloc_addr;
-+              unsigned long symbol_addr;
-+              int symtab_index;
-+              unsigned long rel_addr, rel_size;
-+
-+
-+#ifdef ELF_USES_RELOCA
-+              rel_addr = (indx ? tpnt->dynamic_info[DT_JMPREL] : tpnt->
-+                       dynamic_info[DT_RELA]);
-+              rel_size = (indx ? tpnt->dynamic_info[DT_PLTRELSZ] : tpnt->
-+                       dynamic_info[DT_RELASZ]);
-+#else
-+              rel_addr = (indx ? tpnt->dynamic_info[DT_JMPREL] : tpnt->
-+                       dynamic_info[DT_REL]);
-+              rel_size = (indx ? tpnt->dynamic_info[DT_PLTRELSZ] : tpnt->
-+                       dynamic_info[DT_RELSZ]);
-+#endif
-+
-+              if (!rel_addr)
-+                      continue;
-+
-+              /* Now parse the relocation information */
-+              rpnt = (ELF_RELOC *) (rel_addr + load_addr);
-+              for (i = 0; i < rel_size; i += sizeof(ELF_RELOC), rpnt++) {
-+                      reloc_addr = (unsigned long *) (load_addr + (unsigned long) rpnt->r_offset);
-+                      symtab_index = ELF32_R_SYM(rpnt->r_info);
-+                      symbol_addr = 0;
-+                      if (symtab_index) {
-+                              char *strtab;
-+                              Elf32_Sym *symtab;
-+
-+                              symtab = (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB] + load_addr);
-+                              strtab = (char *) (tpnt->dynamic_info[DT_STRTAB] + load_addr);
-+
-+                              /* We only do a partial dynamic linking right now.  The user
-+                                 is not supposed to redefine any symbols that start with
-+                                 a '_', so we can do this with confidence. */
-+                              if (!_dl_symbol(strtab + symtab[symtab_index].st_name))
-+                                      continue;
-+                              symbol_addr = load_addr + symtab[symtab_index].st_value;
-+
-+                              if (!symbol_addr) {
-+                                      /* This will segfault - you cannot call a function until
-+                                       * we have finished the relocations.
-+                                       */
-+                                      SEND_STDERR("ELF dynamic loader - unable to self-bootstrap - symbol ");
-+                                      SEND_STDERR(strtab + symtab[symtab_index].st_name);
-+                                      SEND_STDERR(" undefined.\n");
-+                                      goof++;
-+                              }
-+#ifdef __SUPPORT_LD_DEBUG_EARLY__
-+                              SEND_STDERR("About to fixup symbol: ");
-+                              SEND_STDERR(strtab + symtab[symtab_index].st_name);
-+                              SEND_STDERR("\n");
-+#endif  
-+                      }
-+                      /*
-+                       * Use this machine-specific macro to perform the actual relocation.
-+                       */
-+                      PERFORM_BOOTSTRAP_RELOC(rpnt, reloc_addr, symbol_addr, load_addr);
-+              }
-+      }
-+
-+      if (goof) {
-+              _dl_exit(14);
-+      }
-+#ifdef __SUPPORT_LD_DEBUG_EARLY__
-+      /* Wahoo!!! */
-+      _dl_dprintf(_dl_debug_file, "Done relocating library loader, so we can now\n\tuse globals and make function calls!\n");
-+#endif
-+
-+      if (argv[0]) {
-+              _dl_progname = argv[0];
-+      }
-+
-+      /* Start to build the tables of the modules that are required for
-+       * this beast to run.  We start with the basic executable, and then
-+       * go from there.  Eventually we will run across ourself, and we
-+       * will need to properly deal with that as well. */
-+
-+      /* Make it so _dl_malloc can use the page of memory we have already
-+       * allocated, so we shouldn't need to grab any more memory */
-+      _dl_malloc_addr = malloc_buffer;
-+      _dl_mmap_zero = mmap_zero;
-+
-+
-+
-+      /* Now we have done the mandatory linking of some things.  We are now
-+         free to start using global variables, since these things have all been
-+         fixed up by now.  Still no function calls outside of this library ,
-+         since the dynamic resolver is not yet ready. */
-+      _dl_get_ready_to_run(tpnt, app_tpnt, load_addr, hash_addr, auxvt, envp, debug_addr);
-+
-+
-+      /* Notify the debugger that all objects are now mapped in.  */
-+      _dl_debug_addr->r_state = RT_CONSISTENT;
-+      _dl_debug_state();
-+
-+
-+      /* OK we are done here.  Turn out the lights, and lock up. */
-+      _dl_elf_main = (int (*)(int, char **, char **)) auxvt[AT_ENTRY].a_un.a_fcn;
-+
-+      /*
-+       * Transfer control to the application.
-+       */
-+      status = 0;                                     /* Used on x86, but not on other arches */
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if(_dl_debug) _dl_dprintf(_dl_debug_file,"\ntransfering control: %s\n\n", _dl_progname);        
-+#endif    
-+      START();
-+}
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+static void debug_fini (int status, void *arg)
-+{
-+      (void)status;
-+      _dl_dprintf(_dl_debug_file,"\ncalling fini: %s\n\n", (const char*)arg);
-+}
-+#endif    
-+
-+static void _dl_get_ready_to_run(struct elf_resolve *tpnt, struct elf_resolve *app_tpnt, 
-+              unsigned long load_addr, unsigned long *hash_addr, Elf32_auxv_t auxvt[AT_EGID + 1], 
-+              char **envp, struct r_debug *debug_addr)
-+{
-+      ElfW(Phdr) *ppnt;
-+      char *lpntstr;
-+      int i, _dl_secure, goof = 0;
-+      struct dyn_elf *rpnt;
-+      struct elf_resolve *tcurr;
-+      struct elf_resolve *tpnt1;
-+      unsigned long brk_addr, *lpnt;
-+      int (*_dl_atexit) (void *);
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      int (*_dl_on_exit) (void (*FUNCTION)(int STATUS, void *ARG),void*);
-+#endif
-+
-+      /* Now we have done the mandatory linking of some things.  We are now
-+         free to start using global variables, since these things have all been
-+         fixed up by now.  Still no function calls outside of this library ,
-+         since the dynamic resolver is not yet ready. */
-+      lpnt = (unsigned long *) (tpnt->dynamic_info[DT_PLTGOT] + load_addr);
-+
-+      tpnt->chains = hash_addr;
-+      tpnt->next = 0;
-+      tpnt->libname = 0;
-+      tpnt->libtype = program_interpreter;
-+      tpnt->loadaddr = (ElfW(Addr)) load_addr;
-+
-+#ifdef ALLOW_ZERO_PLTGOT
-+      if (tpnt->dynamic_info[DT_PLTGOT])
-+#endif
-+      {
-+              INIT_GOT(lpnt, tpnt);
-+#ifdef __SUPPORT_LD_DEBUG_EARLY__
-+              _dl_dprintf(_dl_debug_file, "GOT found at %x\n", lpnt);
-+#endif
-+      }
-+
-+      /* OK, this was a big step, now we need to scan all of the user images
-+         and load them properly. */
-+
-+      {
-+              ElfW(Ehdr) *epnt;
-+              ElfW(Phdr) *myppnt;
-+              int j;
-+
-+              epnt = (ElfW(Ehdr) *) auxvt[AT_BASE].a_un.a_ptr;
-+              tpnt->n_phent = epnt->e_phnum;
-+              tpnt->ppnt = myppnt = (ElfW(Phdr) *) (load_addr + epnt->e_phoff);
-+              for (j = 0; j < epnt->e_phnum; j++, myppnt++) {
-+                      if (myppnt->p_type == PT_DYNAMIC) {
-+                              tpnt->dynamic_addr = (ElfW(Dyn) *)myppnt->p_vaddr + load_addr;
-+                              tpnt->dynamic_size = myppnt->p_filesz;
-+                      }
-+              }
-+      }
-+
-+      brk_addr = 0;
-+      rpnt = NULL;
-+
-+      /* At this point we are now free to examine the user application,
-+         and figure out which libraries are supposed to be called.  Until
-+         we have this list, we will not be completely ready for dynamic linking */
-+
-+      ppnt = (ElfW(Phdr) *) auxvt[AT_PHDR].a_un.a_ptr;
-+      for (i = 0; i < auxvt[AT_PHNUM].a_un.a_val; i++, ppnt++) {
-+              if (ppnt->p_type == PT_LOAD) {
-+                      if (ppnt->p_vaddr + ppnt->p_memsz > brk_addr)
-+                              brk_addr = ppnt->p_vaddr + ppnt->p_memsz;
-+              }
-+              if (ppnt->p_type == PT_DYNAMIC) {
-+#ifndef ALLOW_ZERO_PLTGOT
-+                      /* make sure it's really there. */
-+                      if (app_tpnt->dynamic_info[DT_PLTGOT] == 0)
-+                              continue;
-+#endif
-+                      /* OK, we have what we need - slip this one into the list. */
-+                      app_tpnt = _dl_add_elf_hash_table("", 0, 
-+                                      app_tpnt->dynamic_info, ppnt->p_vaddr, ppnt->p_filesz);
-+                      _dl_loaded_modules->libtype = elf_executable;
-+                      _dl_loaded_modules->ppnt = (ElfW(Phdr) *) auxvt[AT_PHDR].a_un.a_ptr;
-+                      _dl_loaded_modules->n_phent = auxvt[AT_PHNUM].a_un.a_val;
-+                      _dl_symbol_tables = rpnt = (struct dyn_elf *) _dl_malloc(sizeof(struct dyn_elf));
-+                      _dl_memset(rpnt, 0, sizeof(struct dyn_elf));
-+                      rpnt->dyn = _dl_loaded_modules;
-+                      app_tpnt->usage_count++;
-+                      app_tpnt->symbol_scope = _dl_symbol_tables;
-+                      lpnt = (unsigned long *) (app_tpnt->dynamic_info[DT_PLTGOT]);
-+#ifdef ALLOW_ZERO_PLTGOT
-+                      if (lpnt)
-+#endif
-+                              INIT_GOT(lpnt, _dl_loaded_modules);
-+              }
-+
-+              /* OK, fill this in - we did not have this before */
-+              if (ppnt->p_type == PT_INTERP) {        
-+                      int readsize = 0;
-+                      char *pnt, *pnt1, buf[1024];
-+                      tpnt->libname = _dl_strdup((char *) ppnt->p_offset +
-+                                      (auxvt[AT_PHDR].a_un.a_val & PAGE_ALIGN));
-+                      
-+                      /* Determine if the shared lib loader is a symlink */
-+                      _dl_memset(buf, 0, sizeof(buf));
-+                      readsize = _dl_readlink(tpnt->libname, buf, sizeof(buf));
-+                      if (readsize > 0 && readsize < (int)(sizeof(buf)-1)) {
-+                              pnt1 = _dl_strrchr(buf, '/');
-+                              if (pnt1 && buf != pnt1) {
-+#ifdef __SUPPORT_LD_DEBUG_EARLY__
-+                                      _dl_dprintf(_dl_debug_file, "changing tpnt->libname from '%s' to '%s'\n", tpnt->libname, buf);
-+#endif
-+                                      tpnt->libname = _dl_strdup(buf);
-+                              }
-+                      }
-+
-+                      /* Store the path where the shared lib loader was found for 
-+                       * later use */
-+                      pnt = _dl_strdup(tpnt->libname);
-+                      pnt1 = _dl_strrchr(pnt, '/');
-+                      if (pnt != pnt1) {
-+                              *pnt1 = '\0';
-+                              _dl_ldsopath = pnt;
-+                      } else {
-+                              _dl_ldsopath = tpnt->libname;
-+                      }
-+#ifdef __SUPPORT_LD_DEBUG_EARLY__
-+                      _dl_dprintf(_dl_debug_file, "Lib Loader:\t(%x) %s\n", tpnt->loadaddr, tpnt->libname);
-+#endif
-+              }
-+      }
-+
-+
-+      /* Now we need to figure out what kind of options are selected.
-+         Note that for SUID programs we ignore the settings in LD_LIBRARY_PATH */
-+      {
-+              if (_dl_getenv("LD_BIND_NOW", envp))
-+                      _dl_be_lazy = 0;
-+
-+              if ((auxvt[AT_UID].a_un.a_val == -1 && _dl_suid_ok()) ||
-+                              (auxvt[AT_UID].a_un.a_val != -1 && 
-+                               auxvt[AT_UID].a_un.a_val == auxvt[AT_EUID].a_un.a_val
-+                               && auxvt[AT_GID].a_un.a_val== auxvt[AT_EGID].a_un.a_val)) {
-+                      _dl_secure = 0;
-+                      _dl_preload = _dl_getenv("LD_PRELOAD", envp);
-+                      _dl_library_path = _dl_getenv("LD_LIBRARY_PATH", envp);
-+              } else {
-+                      _dl_secure = 1;
-+                      _dl_preload = _dl_getenv("LD_PRELOAD", envp);
-+                      _dl_unsetenv("LD_AOUT_PRELOAD", envp);
-+                      _dl_unsetenv("LD_LIBRARY_PATH", envp);
-+                      _dl_unsetenv("LD_AOUT_LIBRARY_PATH", envp);
-+                      _dl_library_path = NULL;
-+              }
-+      }
-+
-+#ifdef __SUPPORT_LD_DEBUG__
-+      _dl_debug    = _dl_getenv("LD_DEBUG", envp);
-+      if (_dl_debug)
-+      {
-+        if (_dl_strstr(_dl_debug, "all")) {
-+              _dl_debug_detail = _dl_debug_move = _dl_debug_symbols
-+                      = _dl_debug_reloc = _dl_debug_bindings = _dl_debug_nofixups = _dl_strstr(_dl_debug, "all");
-+        }
-+        else {
-+              _dl_debug_detail   = _dl_strstr(_dl_debug, "detail");
-+              _dl_debug_move     = _dl_strstr(_dl_debug, "move");
-+              _dl_debug_symbols  = _dl_strstr(_dl_debug, "sym");
-+              _dl_debug_reloc    = _dl_strstr(_dl_debug, "reloc");
-+              _dl_debug_nofixups = _dl_strstr(_dl_debug, "nofix");
-+              _dl_debug_bindings = _dl_strstr(_dl_debug, "bind");
-+        }
-+      }
-+      {
-+        const char *dl_debug_output;
-+        
-+        dl_debug_output = _dl_getenv("LD_DEBUG_OUTPUT", envp);
-+
-+        if (dl_debug_output)
-+        {
-+          char tmp[22], *tmp1, *filename;
-+          int len1, len2;
-+          
-+          _dl_memset(tmp, 0, sizeof(tmp));
-+          tmp1=_dl_simple_ltoa( tmp, (unsigned long)_dl_getpid());
-+
-+          len1 = _dl_strlen(dl_debug_output);
-+          len2 = _dl_strlen(tmp1);
-+
-+          filename = _dl_malloc(len1+len2+2);
-+
-+          if (filename)
-+          {
-+            _dl_strcpy (filename, dl_debug_output);
-+            filename[len1] = '.';
-+            _dl_strcpy (&filename[len1+1], tmp1);
-+
-+            _dl_debug_file= _dl_open (filename, O_WRONLY|O_CREAT);
-+            if (_dl_debug_file<0)
-+            {
-+              _dl_debug_file = 2;
-+              _dl_dprintf (2, "can't open file: '%s'\n",filename);
-+            }
-+          }
-+        }
-+      }
-+      
-+      
-+#endif        
-+      _dl_trace_loaded_objects = _dl_getenv("LD_TRACE_LOADED_OBJECTS", envp);
-+#ifndef __LDSO_LDD_SUPPORT__
-+      if (_dl_trace_loaded_objects) {
-+              _dl_dprintf(_dl_debug_file, "Use the ldd provided by uClibc\n");
-+              _dl_exit(1);
-+      }
-+#endif
-+
-+      /*
-+       * OK, fix one more thing - set up debug_addr so it will point
-+       * to our chain.  Later we may need to fill in more fields, but this
-+       * should be enough for now.
-+       */
-+      debug_addr->r_map = (struct link_map *) _dl_loaded_modules;
-+      debug_addr->r_version = 1;
-+      debug_addr->r_ldbase = load_addr;
-+      debug_addr->r_brk = (unsigned long) &_dl_debug_state;
-+      _dl_debug_addr = debug_addr;
-+
-+      /* Notify the debugger we are in a consistant state */
-+      _dl_debug_addr->r_state = RT_CONSISTENT;
-+      _dl_debug_state();
-+
-+      /* OK, we now have the application in the list, and we have some
-+         basic stuff in place.  Now search through the list for other shared
-+         libraries that should be loaded, and insert them on the list in the
-+         correct order. */
-+
-+      _dl_map_cache();
-+
-+
-+      if (_dl_preload) 
-+      {
-+              char c, *str, *str2;
-+
-+              str = _dl_preload;
-+              while (*str == ':' || *str == ' ' || *str == '\t')
-+                      str++;
-+              while (*str) 
-+              {
-+                      str2 = str;
-+                      while (*str2 && *str2 != ':' && *str2 != ' ' && *str2 != '\t')
-+                              str2++;
-+                      c = *str2;
-+                      *str2 = '\0';
-+                      if (!_dl_secure || _dl_strchr(str, '/') == NULL) 
-+                      {
-+                              if ((tpnt1 = _dl_check_if_named_library_is_loaded(str))) 
-+                              {
-+                                      continue;
-+                              }
-+#if defined (__SUPPORT_LD_DEBUG__)
-+                              if(_dl_debug) _dl_dprintf(_dl_debug_file, "\tfile='%s';  needed by '%s'\n", 
-+                                              str, _dl_progname);
-+#endif
-+                              tpnt1 = _dl_load_shared_library(_dl_secure, &rpnt, NULL, str);
-+                              if (!tpnt1) {
-+#ifdef __LDSO_LDD_SUPPORT__
-+                                      if (_dl_trace_loaded_objects)
-+                                              _dl_dprintf(1, "\t%s => not found\n", str);
-+                                      else 
-+#endif
-+                                      {
-+                                              _dl_dprintf(2, "%s: can't load " "library '%s'\n", _dl_progname, str);
-+                                              _dl_exit(15);
-+                                      }
-+                              } else {
-+#ifdef __SUPPORT_LD_DEBUG_EARLY__
-+                                      _dl_dprintf(_dl_debug_file, "Loading:\t(%x) %s\n", tpnt1->loadaddr, tpnt1->libname);
-+#endif
-+#ifdef __LDSO_LDD_SUPPORT__
-+                                      if (_dl_trace_loaded_objects && tpnt1->usage_count==1) {
-+                                              /* this is a real hack to make ldd not print 
-+                                               * the library itself when run on a library. */
-+                                              if (_dl_strcmp(_dl_progname, str) != 0)
-+                                                      _dl_dprintf(1, "\t%s => %s (%x)\n", str, tpnt1->libname, 
-+                                                                      (unsigned) tpnt1->loadaddr);
-+                                      }
-+#endif
-+                              }
-+                      }
-+                      *str2 = c;
-+                      str = str2;
-+                      while (*str == ':' || *str == ' ' || *str == '\t')
-+                              str++;
-+              }
-+      }
-+
-+#ifdef SUPPORT_LDSO_PRELOAD_FILE
-+      {
-+              int fd;
-+              struct stat st;
-+              char *preload;
-+              if (!_dl_stat(LDSO_PRELOAD, &st) && st.st_size > 0) {
-+                      if ((fd = _dl_open(LDSO_PRELOAD, O_RDONLY)) < 0) {
-+                              _dl_dprintf(2, "%s: can't open file '%s'\n", 
-+                                              _dl_progname, LDSO_PRELOAD);
-+                      } else {
-+                              preload = (caddr_t) _dl_mmap(0, st.st_size + 1, 
-+                                              PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
-+                              _dl_close(fd);
-+                              if (preload == (caddr_t) - 1) {
-+                                      _dl_dprintf(2, "%s: can't map file '%s'\n", 
-+                                                      _dl_progname, LDSO_PRELOAD);
-+                              } else {
-+                                      char c, *cp, *cp2;
-+
-+                                      /* convert all separators and comments to spaces */
-+                                      for (cp = preload; *cp; /*nada */ ) {
-+                                              if (*cp == ':' || *cp == '\t' || *cp == '\n') {
-+                                                      *cp++ = ' ';
-+                                              } else if (*cp == '#') {
-+                                                      do
-+                                                              *cp++ = ' ';
-+                                                      while (*cp != '\n' && *cp != '\0');
-+                                              } else {
-+                                                      cp++;
-+                                              }
-+                                      }
-+
-+                                      /* find start of first library */
-+                                      for (cp = preload; *cp && *cp == ' '; cp++)
-+                                              /*nada */ ;
-+
-+                                      while (*cp) {
-+                                              /* find end of library */
-+                                              for (cp2 = cp; *cp && *cp != ' '; cp++)
-+                                                      /*nada */ ;
-+                                              c = *cp;
-+                                              *cp = '\0';
-+
-+                                              if ((tpnt1 = _dl_check_if_named_library_is_loaded(cp2))) 
-+                                              {
-+                                                      continue;
-+                                              }
-+#if defined (__SUPPORT_LD_DEBUG__)
-+                                              if(_dl_debug) _dl_dprintf(_dl_debug_file, "\tfile='%s';  needed by '%s'\n", 
-+                                                              cp2, _dl_progname);
-+#endif
-+                                              tpnt1 = _dl_load_shared_library(0, &rpnt, NULL, cp2);
-+                                              if (!tpnt1) {
-+#ifdef __LDSO_LDD_SUPPORT__
-+                                                      if (_dl_trace_loaded_objects)
-+                                                              _dl_dprintf(1, "\t%s => not found\n", cp2);
-+                                                      else 
-+#endif
-+                                                      {
-+                                                              _dl_dprintf(2, "%s: can't load library '%s'\n", _dl_progname, cp2);
-+                                                              _dl_exit(15);
-+                                                      }
-+                                              } else {
-+#ifdef __SUPPORT_LD_DEBUG_EARLY__
-+                                                      _dl_dprintf(_dl_debug_file, "Loading:\t(%x) %s\n", tpnt1->loadaddr, tpnt1->libname);
-+#endif
-+#ifdef __LDSO_LDD_SUPPORT__
-+                                                      if (_dl_trace_loaded_objects && tpnt1->usage_count==1) {
-+                                                              _dl_dprintf(1, "\t%s => %s (%x)\n", cp2, 
-+                                                                              tpnt1->libname, (unsigned) tpnt1->loadaddr);
-+                                                      }
-+#endif
-+                                              }
-+
-+                                              /* find start of next library */
-+                                              *cp = c;
-+                                              for ( /*nada */ ; *cp && *cp == ' '; cp++)
-+                                                      /*nada */ ;
-+                                      }
-+
-+                                      _dl_munmap(preload, st.st_size + 1);
-+                              }
-+                      }
-+              }
-+      }
-+#endif
-+
-+      for (tcurr = _dl_loaded_modules; tcurr; tcurr = tcurr->next) 
-+      {
-+              Elf32_Dyn *dpnt;
-+              for (dpnt = (Elf32_Dyn *) tcurr->dynamic_addr; dpnt->d_tag; dpnt++) 
-+              {
-+                      if (dpnt->d_tag == DT_NEEDED) 
-+                      {
-+                              char *name;
-+                              lpntstr = (char*) (tcurr->loadaddr + tcurr->dynamic_info[DT_STRTAB] + dpnt->d_un.d_val);
-+                              name = _dl_get_last_path_component(lpntstr);
-+
-+                              if ((tpnt1 = _dl_check_if_named_library_is_loaded(name))) 
-+                              {
-+                                      continue;
-+                              }
-+#if defined (__SUPPORT_LD_DEBUG__)
-+                              if(_dl_debug) _dl_dprintf(_dl_debug_file, "\tfile='%s';  needed by '%s'\n", 
-+                                              lpntstr, _dl_progname);
-+#endif
-+                              if (!(tpnt1 = _dl_load_shared_library(0, &rpnt, tcurr, lpntstr)))
-+                              {
-+#ifdef __LDSO_LDD_SUPPORT__
-+                                      if (_dl_trace_loaded_objects) {
-+                                              _dl_dprintf(1, "\t%s => not found\n", lpntstr);
-+                                              continue;
-+                                      } else 
-+#endif
-+                                      {
-+                                              _dl_dprintf(2, "%s: can't load library '%s'\n", _dl_progname, lpntstr);
-+                                              _dl_exit(16);
-+                                      }
-+                              } else {
-+#ifdef __SUPPORT_LD_DEBUG_EARLY__
-+                                      _dl_dprintf(_dl_debug_file, "Loading:\t(%x) %s\n", tpnt1->loadaddr, tpnt1->libname);
-+#endif
-+#ifdef __LDSO_LDD_SUPPORT__
-+                                      if (_dl_trace_loaded_objects && tpnt1->usage_count==1) {
-+                                              _dl_dprintf(1, "\t%s => %s (%x)\n", lpntstr, tpnt1->libname, 
-+                                                              (unsigned) tpnt1->loadaddr);
-+                                      }
-+#endif
-+                              }
-+                      }
-+              }
-+      }
-+
-+
-+      _dl_unmap_cache();
-+
-+      /*
-+       * If the program interpreter is not in the module chain, add it.  This will
-+       * be required for dlopen to be able to access the internal functions in the 
-+       * dynamic linker.
-+       */
-+      if (tpnt) {
-+              tcurr = _dl_loaded_modules;
-+              if (tcurr)
-+                      while (tcurr->next)
-+                              tcurr = tcurr->next;
-+              tpnt->next = NULL;
-+              tpnt->usage_count++;
-+
-+              if (tcurr) {
-+                      tcurr->next = tpnt;
-+                      tpnt->prev = tcurr;
-+              } else {
-+                      _dl_loaded_modules = tpnt;
-+                      tpnt->prev = NULL;
-+              }
-+              if (rpnt) {
-+                      rpnt->next = (struct dyn_elf *) _dl_malloc(sizeof(struct dyn_elf));
-+                      _dl_memset(rpnt->next, 0, sizeof(struct dyn_elf));
-+                      rpnt->next->prev = rpnt;
-+                      rpnt = rpnt->next;
-+              } else {
-+                      rpnt = (struct dyn_elf *) _dl_malloc(sizeof(struct dyn_elf));
-+                      _dl_memset(rpnt, 0, sizeof(struct dyn_elf));
-+              }
-+              rpnt->dyn = tpnt;
-+              tpnt = NULL;
-+      }
-+
-+#ifdef __LDSO_LDD_SUPPORT__
-+      /* End of the line for ldd.... */
-+      if (_dl_trace_loaded_objects) {
-+              _dl_dprintf(1, "\t%s => %s (%x)\n", rpnt->dyn->libname + (_dl_strlen(_dl_ldsopath)) + 1, 
-+                              rpnt->dyn->libname, rpnt->dyn->loadaddr);  
-+              _dl_exit(0);
-+      }
-+#endif
-+
-+
-+#ifdef __mips__
-+      /*
-+       * Relocation of the GOT entries for MIPS have to be done
-+       * after all the libraries have been loaded.
-+       */
-+      _dl_perform_mips_global_got_relocations(_dl_loaded_modules);
-+#endif
-+
-+#ifdef __SUPPORT_LD_DEBUG_EARLY__
-+      _dl_dprintf(_dl_debug_file, "Beginning relocation fixups\n");
-+#endif
-+      /*
-+       * OK, now all of the kids are tucked into bed in their proper addresses.
-+       * Now we go through and look for REL and RELA records that indicate fixups
-+       * to the GOT tables.  We need to do this in reverse order so that COPY
-+       * directives work correctly */
-+      goof = _dl_loaded_modules ? _dl_fixup(_dl_loaded_modules, _dl_be_lazy) : 0;
-+
-+
-+      /* Some flavors of SVr4 do not generate the R_*_COPY directive,
-+         and we have to manually search for entries that require fixups. 
-+         Solaris gets this one right, from what I understand.  */
-+
-+#ifdef __SUPPORT_LD_DEBUG_EARLY__
-+      _dl_dprintf(_dl_debug_file, "Beginning copy fixups\n");
-+#endif
-+      if (_dl_symbol_tables)
-+              goof += _dl_copy_fixups(_dl_symbol_tables);
-+
-+      /* OK, at this point things are pretty much ready to run.  Now we
-+         need to touch up a few items that are required, and then
-+         we can let the user application have at it.  Note that
-+         the dynamic linker itself is not guaranteed to be fully
-+         dynamicly linked if we are using ld.so.1, so we have to look
-+         up each symbol individually. */
-+
-+
-+      _dl_brkp = (unsigned long *) (intptr_t) _dl_find_hash("___brk_addr", NULL, NULL, symbolrel);
-+      
-+      if (_dl_brkp) {
-+              *_dl_brkp = brk_addr;
-+      }
-+      _dl_envp = (unsigned long *) (intptr_t) _dl_find_hash("__environ", NULL, NULL, symbolrel);
-+
-+      if (_dl_envp) {
-+              *_dl_envp = (unsigned long) envp;
-+      }
-+
-+#ifndef FORCE_SHAREABLE_TEXT_SEGMENTS
-+      {
-+              unsigned int j;
-+              ElfW(Phdr) *myppnt;
-+
-+              /* We had to set the protections of all pages to R/W for dynamic linking.
-+                 Set text pages back to R/O */
-+              for (tpnt = _dl_loaded_modules; tpnt; tpnt = tpnt->next) {
-+                      for (myppnt = tpnt->ppnt, j = 0; j < tpnt->n_phent; j++, myppnt++) {
-+                              if (myppnt->p_type == PT_LOAD && !(myppnt->p_flags & PF_W) && tpnt->dynamic_info[DT_TEXTREL]) {
-+                                      _dl_mprotect((void *) (tpnt->loadaddr + (myppnt->p_vaddr & PAGE_ALIGN)), 
-+                                                      (myppnt->p_vaddr & ADDR_ALIGN) + (unsigned long) myppnt->p_filesz, LXFLAGS(myppnt->p_flags));
-+                              }
-+                      }
-+              }
-+
-+      }
-+#endif
-+      _dl_atexit = (int (*)(void *)) (intptr_t) _dl_find_hash("atexit", NULL, NULL, symbolrel);
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      _dl_on_exit = (int (*)(void (*)(int, void *),void*)) 
-+              (intptr_t) _dl_find_hash("on_exit", NULL, NULL, symbolrel);
-+#endif
-+
-+      /* Notify the debugger we have added some objects. */
-+      _dl_debug_addr->r_state = RT_ADD;
-+      _dl_debug_state();
-+
-+      for (rpnt = _dl_symbol_tables; rpnt!=NULL&& rpnt->next!=NULL; rpnt=rpnt->next)
-+        ;
-+        
-+      for (;rpnt!=NULL; rpnt=rpnt->prev)
-+      {
-+              tpnt = rpnt->dyn;
-+
-+              if (tpnt->libtype == program_interpreter)
-+                      continue;
-+
-+              /* Apparently crt0/1 for the application is responsible for handling this.
-+               * We only need to run the init/fini for shared libraries
-+               */
-+              if (tpnt->libtype == elf_executable)
-+                      break;      /* at this point all shared libs are initialized !! */
-+
-+              if (tpnt->init_flag & INIT_FUNCS_CALLED)
-+                      continue;
-+              tpnt->init_flag |= INIT_FUNCS_CALLED;
-+
-+              if (tpnt->dynamic_info[DT_INIT]) {
-+                      void (*dl_elf_func) (void);
-+                      dl_elf_func = (void (*)(void)) (intptr_t) (tpnt->loadaddr + tpnt->dynamic_info[DT_INIT]);
-+#if defined (__SUPPORT_LD_DEBUG__)
-+                      if(_dl_debug) _dl_dprintf(_dl_debug_file,"\ncalling init: %s\n\n", tpnt->libname);      
-+#endif    
-+                      (*dl_elf_func) ();
-+              }
-+              if (_dl_atexit && tpnt->dynamic_info[DT_FINI]) {
-+                      void (*dl_elf_func) (void);
-+                      dl_elf_func = (void (*)(void)) (intptr_t) (tpnt->loadaddr + tpnt->dynamic_info[DT_FINI]);
-+                      (*_dl_atexit) (dl_elf_func);
-+#if defined (__SUPPORT_LD_DEBUG__)
-+                      if(_dl_debug && _dl_on_exit)
-+                      {
-+                              (*_dl_on_exit)(debug_fini, tpnt->libname);
-+                      }
-+#endif
-+              }
-+#if defined (__SUPPORT_LD_DEBUG__)
-+              else {
-+                      if (!_dl_atexit)
-+                              _dl_dprintf(_dl_debug_file, "%s: The address of atexit () is 0x0.\n", tpnt->libname);
-+#if 0
-+                      if (!tpnt->dynamic_info[DT_FINI])
-+                              _dl_dprintf(_dl_debug_file, "%s: Invalid .fini section.\n", tpnt->libname);
-+#endif
-+              }
-+#endif
-+      }
-+}
-+
-+/*
-+ * This stub function is used by some debuggers.  The idea is that they
-+ * can set an internal breakpoint on it, so that we are notified when the
-+ * address mapping is changed in some way.
-+ */
-+void _dl_debug_state(void)
-+{
-+}
-+
-+char *_dl_getenv(const char *symbol, char **envp)
-+{
-+      char *pnt;
-+      const char *pnt1;
-+
-+      while ((pnt = *envp++)) {
-+              pnt1 = symbol;
-+              while (*pnt && *pnt == *pnt1)
-+                      pnt1++, pnt++;
-+              if (!*pnt || *pnt != '=' || *pnt1)
-+                      continue;
-+              return pnt + 1;
-+      }
-+      return 0;
-+}
-+
-+void _dl_unsetenv(const char *symbol, char **envp)
-+{
-+      char *pnt;
-+      const char *pnt1;
-+      char **newenvp = envp;
-+
-+      for (pnt = *envp; pnt; pnt = *++envp) {
-+              pnt1 = symbol;
-+              while (*pnt && *pnt == *pnt1)
-+                      pnt1++, pnt++;
-+              if (!*pnt || *pnt != '=' || *pnt1)
-+                      *newenvp++ = *envp;
-+      }
-+      *newenvp++ = *envp;
-+      return;
-+}
-+
-+#include "hash.c"
-+#include "readelflib1.c"
-diff -urN uClibc/ldso-0.9.24/ldso/m68k/boot1_arch.h uClibc.ldso.24/ldso-0.9.24/ldso/m68k/boot1_arch.h
---- uClibc/ldso-0.9.24/ldso/m68k/boot1_arch.h  1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/m68k/boot1_arch.h  2002-08-08 09:35:37.000000000 -0500
-@@ -0,0 +1,7 @@
-+/* Any assmbly language/system dependent hacks needed to setup boot1.c so it
-+ * will work as expected and cope with whatever platform specific wierdness is
-+ * needed for this architecture.  See arm/boot1_arch.h for an example of what
-+ * can be done.
-+ */
-+
-+#define LD_BOOT(X)   void _dl_boot (X)
-diff -urN uClibc/ldso-0.9.24/ldso/m68k/elfinterp.c uClibc.ldso.24/ldso-0.9.24/ldso/m68k/elfinterp.c
---- uClibc/ldso-0.9.24/ldso/m68k/elfinterp.c   1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/m68k/elfinterp.c   2002-11-05 12:21:04.000000000 -0600
-@@ -0,0 +1,359 @@
-+/* vi: set sw=4 ts=4: */
-+/* m68k ELF shared library loader suppport
-+ *
-+ * Copyright (c) 1994-2000 Eric Youngdale, Peter MacDonald, 
-+ *                            David Engel, Hongjiu Lu and Mitch D'Souza
-+ * Adapted to ELF/68k by Andreas Schwab.
-+ *
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions and the following disclaimer.
-+ * 2. The name of the above contributors may not be
-+ *    used to endorse or promote products derived from this software
-+ *    without specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE
-+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+ * SUCH DAMAGE.
-+ */
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+static const char *_dl_reltypes[] =
-+{
-+  "R_68K_NONE",
-+  "R_68K_32", "R_68K_16", "R_68K_8",
-+  "R_68K_PC32", "R_68K_PC16", "R_68K_PC8",
-+  "R_68K_GOT32", "R_68K_GOT16", "R_68K_GOT8",
-+  "R_68K_GOT32O", "R_68K_GOT16O", "R_68K_GOT8O",
-+  "R_68K_PLT32", "R_68K_PLT16", "R_68K_PLT8",
-+  "R_68K_PLT32O", "R_68K_PLT16O", "R_68K_PLT8O",
-+  "R_68K_COPY", "R_68K_GLOB_DAT", "R_68K_JMP_SLOT", "R_68K_RELATIVE",
-+  "R_68K_NUM"
-+};
-+#endif
-+
-+/* Program to load an ELF binary on a linux system, and run it.
-+   References to symbols in sharable libraries can be resolved by either
-+   an ELF sharable library or a linux style of shared library. */
-+
-+/* Disclaimer:  I have never seen any AT&T source code for SVr4, nor have
-+   I ever taken any courses on internals.  This program was developed using
-+   information available through the book "UNIX SYSTEM V RELEASE 4,
-+   Programmers guide: Ansi C and Programming Support Tools", which did
-+   a more than adequate job of explaining everything required to get this
-+   working. */
-+
-+
-+unsigned int _dl_linux_resolver (int dummy1, int dummy2, 
-+      struct elf_resolve *tpnt, int reloc_entry)
-+{
-+  int reloc_type;
-+  Elf32_Rela *this_reloc;
-+  char *strtab;
-+  Elf32_Sym *symtab;
-+  char *rel_addr;
-+  int symtab_index;
-+  char *new_addr;
-+  char **got_addr;
-+  unsigned int instr_addr;
-+
-+  rel_addr = tpnt->loadaddr + tpnt->dynamic_info[DT_JMPREL];
-+  this_reloc = (Elf32_Rela *) (rel_addr + reloc_entry);
-+  reloc_type = ELF32_R_TYPE (this_reloc->r_info);
-+  symtab_index = ELF32_R_SYM (this_reloc->r_info);
-+
-+  symtab = (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB]
-+                               + tpnt->loadaddr);
-+  strtab = (char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
-+
-+
-+  if (reloc_type != R_68K_JMP_SLOT)
-+    {
-+      _dl_dprintf (2, "%s: incorrect relocation type in jump relocations\n",
-+                  _dl_progname);
-+      _dl_exit (1);
-+    }
-+
-+  /* Address of jump instruction to fix up.  */
-+  instr_addr = (int) this_reloc->r_offset + (int) tpnt->loadaddr;
-+  got_addr = (char **) instr_addr;
-+
-+#ifdef __SUPPORT_LD_DEBUG__
-+  if (_dl_debug_symbols) {
-+        _dl_dprintf (2, "Resolving symbol %s\n", strtab + symtab[symtab_index].st_name);
-+  }
-+#endif
-+
-+  /* Get the address of the GOT entry.  */
-+  new_addr = _dl_find_hash (strtab + symtab[symtab_index].st_name,
-+                          tpnt->symbol_scope, tpnt, resolver);
-+  if (!new_addr)
-+    {
-+      _dl_dprintf (2, "%s: can't resolve symbol '%s'\n",
-+                  _dl_progname, strtab + symtab[symtab_index].st_name);
-+      _dl_exit (1);
-+    }
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if ((unsigned long) got_addr < 0x40000000)
-+      {
-+              if (_dl_debug_bindings)
-+              {
-+                      _dl_dprintf(_dl_debug_file, "\nresolve function: %s",
-+                                      strtab + symtab[symtab_index].st_name);
-+                      if(_dl_debug_detail) _dl_dprintf(_dl_debug_file, 
-+                                      "\tpatch %x ==> %x @ %x", *got_addr, new_addr, got_addr);
-+              }
-+      }
-+      if (!_dl_debug_nofixups) {
-+              *got_addr = new_addr;
-+      }
-+#else
-+      *got_addr = new_addr;
-+#endif
-+
-+  return (unsigned int) new_addr;
-+}
-+
-+void
-+_dl_parse_lazy_relocation_information (struct elf_resolve *tpnt,
-+                       unsigned long rel_addr, unsigned long rel_size, int type)
-+{
-+  int i;
-+  char *strtab;
-+  int reloc_type;
-+  int symtab_index;
-+  Elf32_Sym *symtab;
-+  Elf32_Rela *rpnt;
-+  unsigned int *reloc_addr;
-+
-+  /* Now parse the relocation information.  */
-+  rpnt = (Elf32_Rela *) (rel_addr + tpnt->loadaddr);
-+  rel_size = rel_size / sizeof (Elf32_Rela);
-+
-+  symtab = (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB]
-+                               + tpnt->loadaddr);
-+  strtab = (char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
-+
-+  for (i = 0; i < rel_size; i++, rpnt++)
-+    {
-+      reloc_addr = (int *) (tpnt->loadaddr + (int) rpnt->r_offset);
-+      reloc_type = ELF32_R_TYPE (rpnt->r_info);
-+      symtab_index = ELF32_R_SYM (rpnt->r_info);
-+
-+      /* When the dynamic linker bootstrapped itself, it resolved some symbols.
-+         Make sure we do not do them again.  */
-+      if (tpnt->libtype == program_interpreter
-+        && (!symtab_index
-+            || _dl_symbol (strtab + symtab[symtab_index].st_name)))
-+      continue;
-+
-+      switch (reloc_type)
-+      {
-+      case R_68K_NONE:
-+        break;
-+      case R_68K_JMP_SLOT:
-+        *reloc_addr += (unsigned int) tpnt->loadaddr;
-+        break;
-+      default:
-+        _dl_dprintf (2, "%s: (LAZY) can't handle reloc type ", _dl_progname);
-+#if defined (__SUPPORT_LD_DEBUG__)
-+        _dl_dprintf (2, "%s ", _dl_reltypes[reloc_type]);
-+#endif
-+        if (symtab_index)
-+          _dl_dprintf (2, "'%s'", strtab + symtab[symtab_index].st_name);
-+        _dl_dprintf (2, "\n");
-+        _dl_exit (1);
-+      }
-+    }
-+}
-+
-+int 
-+_dl_parse_relocation_information (struct elf_resolve *tpnt,
-+                  unsigned long rel_addr, unsigned long rel_size, int type)
-+{
-+  int i;
-+  char *strtab;
-+  int reloc_type;
-+  int goof = 0;
-+  Elf32_Sym *symtab;
-+  Elf32_Rela *rpnt;
-+  unsigned int *reloc_addr;
-+  unsigned int symbol_addr;
-+  int symtab_index;
-+  /* Now parse the relocation information */
-+
-+  rpnt = (Elf32_Rela *) (rel_addr + tpnt->loadaddr);
-+  rel_size = rel_size / sizeof (Elf32_Rela);
-+
-+  symtab = (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB]
-+                               + tpnt->loadaddr);
-+  strtab = (char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
-+
-+  for (i = 0; i < rel_size; i++, rpnt++)
-+    {
-+      reloc_addr = (int *) (tpnt->loadaddr + (int) rpnt->r_offset);
-+      reloc_type = ELF32_R_TYPE (rpnt->r_info);
-+      symtab_index = ELF32_R_SYM (rpnt->r_info);
-+      symbol_addr = 0;
-+
-+      if (tpnt->libtype == program_interpreter
-+        && (!symtab_index
-+            || _dl_symbol (strtab + symtab[symtab_index].st_name)))
-+      continue;
-+
-+      if (symtab_index)
-+      {
-+        symbol_addr = (unsigned int)
-+          _dl_find_hash (strtab + symtab[symtab_index].st_name,
-+                         tpnt->symbol_scope,
-+                         reloc_type == R_68K_JMP_SLOT ? tpnt : NULL, symbolrel);
-+
-+        /* We want to allow undefined references to weak symbols -
-+           this might have been intentional.  We should not be
-+           linking local symbols here, so all bases should be
-+           covered.  */
-+        if (!symbol_addr
-+            && ELF32_ST_BIND (symtab[symtab_index].st_info) == STB_GLOBAL)
-+          {
-+            _dl_dprintf (2, "%s: can't resolve symbol '%s'\n",
-+                          _dl_progname, strtab + symtab[symtab_index].st_name);
-+            goof++;
-+          }
-+      }
-+      switch (reloc_type)
-+      {
-+      case R_68K_NONE:
-+        break;
-+      case R_68K_8:
-+        *(char *) reloc_addr = symbol_addr + rpnt->r_addend;
-+        break;
-+      case R_68K_16:
-+        *(short *) reloc_addr = symbol_addr + rpnt->r_addend;
-+        break;
-+      case R_68K_32:
-+        *reloc_addr = symbol_addr + rpnt->r_addend;
-+        break;
-+      case R_68K_PC8:
-+        *(char *) reloc_addr = (symbol_addr + rpnt->r_addend
-+                                - (unsigned int) reloc_addr);
-+        break;
-+      case R_68K_PC16:
-+        *(short *) reloc_addr = (symbol_addr + rpnt->r_addend
-+                                 - (unsigned int) reloc_addr);
-+        break;
-+      case R_68K_PC32:
-+        *reloc_addr = (symbol_addr + rpnt->r_addend
-+                       - (unsigned int) reloc_addr);
-+        break;
-+      case R_68K_GLOB_DAT:
-+      case R_68K_JMP_SLOT:
-+        *reloc_addr = symbol_addr;
-+        break;
-+      case R_68K_RELATIVE:
-+        *reloc_addr = ((unsigned int) tpnt->loadaddr
-+                       /* Compatibility kludge.  */
-+                       + (rpnt->r_addend ? : *reloc_addr));
-+        break;
-+      case R_68K_COPY:
-+#if 0 /* Do this later.  */
-+        _dl_dprintf (2, "Doing copy");
-+        if (symtab_index)
-+          _dl_dprintf (2, " for symbol %s",
-+                        strtab + symtab[symtab_index].st_name);
-+        _dl_dprintf (2, "\n");
-+        _dl_memcpy ((void *) symtab[symtab_index].st_value,
-+                    (void *) symbol_addr,
-+                    symtab[symtab_index].st_size);
-+#endif
-+        break;
-+      default:
-+        _dl_dprintf (2, "%s: can't handle reloc type ", _dl_progname);
-+#if defined (__SUPPORT_LD_DEBUG__)
-+        _dl_dprintf (2, "%s ", _dl_reltypes[reloc_type]);
-+#endif
-+        if (symtab_index)
-+          _dl_dprintf (2, "'%s'", strtab + symtab[symtab_index].st_name);
-+        _dl_dprintf (2, "\n");
-+        _dl_exit (1);
-+      }
-+
-+    }
-+  return goof;
-+}
-+
-+/* This is done as a separate step, because there are cases where
-+   information is first copied and later initialized.  This results in
-+   the wrong information being copied.  Someone at Sun was complaining about
-+   a bug in the handling of _COPY by SVr4, and this may in fact be what he
-+   was talking about.  Sigh.  */
-+
-+/* No, there are cases where the SVr4 linker fails to emit COPY relocs
-+   at all.  */
-+
-+int 
-+_dl_parse_copy_information (struct dyn_elf *xpnt, unsigned long rel_addr,
-+                          unsigned long rel_size, int type)
-+{
-+  int i;
-+  char *strtab;
-+  int reloc_type;
-+  int goof = 0;
-+  Elf32_Sym *symtab;
-+  Elf32_Rela *rpnt;
-+  unsigned int *reloc_addr;
-+  unsigned int symbol_addr;
-+  struct elf_resolve *tpnt;
-+  int symtab_index;
-+  /* Now parse the relocation information */
-+
-+  tpnt = xpnt->dyn;
-+
-+  rpnt = (Elf32_Rela *) (rel_addr + tpnt->loadaddr);
-+  rel_size = rel_size / sizeof (Elf32_Rela);
-+
-+  symtab = (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB]
-+                               + tpnt->loadaddr);
-+  strtab = (char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
-+
-+  for (i = 0; i < rel_size; i++, rpnt++)
-+    {
-+      reloc_addr = (int *) (tpnt->loadaddr + (int) rpnt->r_offset);
-+      reloc_type = ELF32_R_TYPE (rpnt->r_info);
-+      if (reloc_type != R_68K_COPY)
-+      continue;
-+      symtab_index = ELF32_R_SYM (rpnt->r_info);
-+      symbol_addr = 0;
-+      if (tpnt->libtype == program_interpreter
-+        && (!symtab_index
-+            || _dl_symbol (strtab + symtab[symtab_index].st_name)))
-+      continue;
-+      if (symtab_index)
-+      {
-+        symbol_addr = (unsigned int)
-+          _dl_find_hash (strtab + symtab[symtab_index].st_name,
-+                         xpnt->next, NULL, copyrel);
-+        if (!symbol_addr)
-+          {
-+            _dl_dprintf (2, "%s: can't resolve symbol '%s'\n",
-+                          _dl_progname, strtab + symtab[symtab_index].st_name);
-+            goof++;
-+          }
-+      }
-+      if (!goof)
-+      _dl_memcpy ((void *) symtab[symtab_index].st_value, (void *) symbol_addr,
-+                symtab[symtab_index].st_size);
-+    }
-+  return goof;
-+}
-diff -urN uClibc/ldso-0.9.24/ldso/m68k/ld_syscalls.h uClibc.ldso.24/ldso-0.9.24/ldso/m68k/ld_syscalls.h
---- uClibc/ldso-0.9.24/ldso/m68k/ld_syscalls.h 1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/m68k/ld_syscalls.h 2002-03-19 04:43:32.000000000 -0600
-@@ -0,0 +1,174 @@
-+/*
-+ * This file contains the system call macros and syscall 
-+ * numbers used by the shared library loader.
-+ */
-+
-+#define __NR_exit               1
-+#define __NR_read               3
-+#define __NR_write              4
-+#define __NR_open               5
-+#define __NR_close              6
-+#define __NR_getuid            24
-+#define __NR_geteuid           49
-+#define __NR_getgid            47
-+#define __NR_getegid           50
-+#define __NR_readlink          85
-+#define __NR_mmap              90
-+#define __NR_munmap            91
-+#define __NR_stat             106
-+#define __NR_mprotect         125
-+
-+
-+/* Here are the macros which define how this platform makes
-+ * system calls.  This particular variant does _not_ set 
-+ * errno (note how it is disabled in __syscall_return) since
-+ * these will get called before the errno symbol is dynamicly 
-+ * linked. */
-+
-+
-+#define __syscall_return(type, res) \
-+do { \
-+      if ((unsigned long)(res) >= (unsigned long)(-125)) { \
-+      /* avoid using res which is declared to be in register d0; \
-+         errno might expand to a function call and clobber it.  */ \
-+              /* int __err = -(res); \
-+              errno = __err; */ \
-+              res = -1; \
-+      } \
-+      return (type) (res); \
-+} while (0)
-+
-+#define _syscall0(type, name)                                         \
-+type name(void)                                                               \
-+{                                                                     \
-+  long __res;                                                         \
-+  __asm__ __volatile__ ("movel        %1, %%d0\n\t"                           \
-+                      "trap   #0\n\t"                                 \
-+                      "movel  %%d0, %0"                               \
-+                      : "=g" (__res)                                  \
-+                      : "i" (__NR_##name)                             \
-+                      : "cc", "%d0");                                 \
-+  if ((unsigned long)(__res) >= (unsigned long)(-125)) {                      \
-+    /* errno = -__res; */                                                     \
-+    __res = -1;                                                               \
-+  }                                                                   \
-+  return (type)__res;                                                 \
-+}
-+
-+#define _syscall1(type, name, atype, a)                                       \
-+type name(atype a)                                                    \
-+{                                                                     \
-+  long __res;                                                         \
-+  __asm__ __volatile__ ("movel        %2, %%d1\n\t"                           \
-+                      "movel  %1, %%d0\n\t"                           \
-+                      "trap   #0\n\t"                                 \
-+                      "movel  %%d0, %0"                               \
-+                      : "=g" (__res)                                  \
-+                      : "i" (__NR_##name),                            \
-+                        "g" ((long)a)                                 \
-+                      : "cc", "%d0", "%d1");                          \
-+  if ((unsigned long)(__res) >= (unsigned long)(-125)) {                      \
-+    /* errno = -__res; */                                                     \
-+    __res = -1;                                                               \
-+  }                                                                   \
-+  return (type)__res;                                                 \
-+}
-+
-+#define _syscall2(type, name, atype, a, btype, b)                     \
-+type name(atype a, btype b)                                           \
-+{                                                                     \
-+  long __res;                                                         \
-+  __asm__ __volatile__ ("movel        %3, %%d2\n\t"                           \
-+                      "movel  %2, %%d1\n\t"                           \
-+                      "movel  %1, %%d0\n\t"                           \
-+                      "trap   #0\n\t"                                 \
-+                      "movel  %%d0, %0"                               \
-+                      : "=g" (__res)                                  \
-+                      : "i" (__NR_##name),                            \
-+                        "a" ((long)a),                                \
-+                        "g" ((long)b)                                 \
-+                      : "cc", "%d0", "%d1", "%d2");                   \
-+  if ((unsigned long)(__res) >= (unsigned long)(-125)) {                      \
-+    /* errno = -__res; */                                                     \
-+    __res = -1;                                                               \
-+  }                                                                   \
-+  return (type)__res;                                                 \
-+}
-+
-+#define _syscall3(type, name, atype, a, btype, b, ctype, c)           \
-+type name(atype a, btype b, ctype c)                                  \
-+{                                                                     \
-+  long __res;                                                         \
-+  __asm__ __volatile__ ("movel        %4, %%d3\n\t"                           \
-+                      "movel  %3, %%d2\n\t"                           \
-+                      "movel  %2, %%d1\n\t"                           \
-+                      "movel  %1, %%d0\n\t"                           \
-+                      "trap   #0\n\t"                                 \
-+                      "movel  %%d0, %0"                               \
-+                      : "=g" (__res)                                  \
-+                      : "i" (__NR_##name),                            \
-+                        "a" ((long)a),                                \
-+                        "a" ((long)b),                                \
-+                        "g" ((long)c)                                 \
-+                      : "cc", "%d0", "%d1", "%d2", "%d3");            \
-+  if ((unsigned long)(__res) >= (unsigned long)(-125)) {                      \
-+    /* errno = -__res; */                                                     \
-+    __res = -1;                                                               \
-+  }                                                                   \
-+  return (type)__res;                                                 \
-+}
-+
-+#define _syscall4(type, name, atype, a, btype, b, ctype, c, dtype, d) \
-+type name(atype a, btype b, ctype c, dtype d)                         \
-+{                                                                     \
-+  long __res;                                                         \
-+  __asm__ __volatile__ ("movel        %5, %%d4\n\t"                           \
-+                      "movel  %4, %%d3\n\t"                           \
-+                      "movel  %3, %%d2\n\t"                           \
-+                      "movel  %2, %%d1\n\t"                           \
-+                      "movel  %1, %%d0\n\t"                           \
-+                      "trap   #0\n\t"                                 \
-+                      "movel  %%d0, %0"                               \
-+                      : "=g" (__res)                                  \
-+                      : "i" (__NR_##name),                            \
-+                        "a" ((long)a),                                \
-+                        "a" ((long)b),                                \
-+                        "a" ((long)c),                                \
-+                        "g" ((long)d)                                 \
-+                      : "cc", "%d0", "%d1", "%d2", "%d3",             \
-+                        "%d4");                                       \
-+  if ((unsigned long)(__res) >= (unsigned long)(-125)) {                      \
-+    /* errno = -__res; */                                                     \
-+    __res = -1;                                                               \
-+  }                                                                   \
-+  return (type)__res;                                                 \
-+}
-+
-+#define _syscall5(type, name, atype, a, btype, b, ctype, c, dtype, d, etype, e)\
-+type name(atype a, btype b, ctype c, dtype d, etype e)                        \
-+{                                                                     \
-+  long __res;                                                         \
-+  __asm__ __volatile__ ("movel        %6, %%d5\n\t"                           \
-+                      "movel  %5, %%d4\n\t"                           \
-+                      "movel  %4, %%d3\n\t"                           \
-+                      "movel  %3, %%d2\n\t"                           \
-+                      "movel  %2, %%d1\n\t"                           \
-+                      "movel  %1, %%d0\n\t"                           \
-+                      "trap   #0\n\t"                                 \
-+                      "movel  %%d0, %0"                               \
-+                      : "=g" (__res)                                  \
-+                      : "i" (__NR_##name),                            \
-+                        "a" ((long)a),                                \
-+                        "a" ((long)b),                                \
-+                        "a" ((long)c),                                \
-+                        "a" ((long)d),                                \
-+                        "g" ((long)e)                                 \
-+                      : "cc", "%d0", "%d1", "%d2", "%d3",             \
-+                        "%d4", "%d5");                                \
-+  if ((unsigned long)(__res) >= (unsigned long)(-125)) {                      \
-+    /* errno = -__res; */                                                     \
-+    __res = -1;                                                               \
-+  }                                                                   \
-+  return (type)__res;                                                 \
-+}
-+
-diff -urN uClibc/ldso-0.9.24/ldso/m68k/ld_sysdep.h uClibc.ldso.24/ldso-0.9.24/ldso/m68k/ld_sysdep.h
---- uClibc/ldso-0.9.24/ldso/m68k/ld_sysdep.h   1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/m68k/ld_sysdep.h   2002-05-28 16:33:34.000000000 -0500
-@@ -0,0 +1,88 @@
-+
-+/* Various assmbly language/system dependent hacks that are required
-+   so that we can minimize the amount of platform specific code. */
-+
-+/* Define this if the system uses RELOCA.  */
-+#define ELF_USES_RELOCA
-+
-+/* Get a pointer to the argv array.  On many platforms this can be
-+   just the address if the first argument, on other platforms we need
-+   to do something a little more subtle here.  */
-+#define GET_ARGV(ARGVP, ARGS) ((ARGVP) = ((unsigned int *) &(ARGS)))
-+
-+/* Initialization sequence for a GOT.  */
-+#define INIT_GOT(GOT_BASE,MODULE)             \
-+{                                             \
-+  GOT_BASE[2] = (int) _dl_linux_resolve;      \
-+  GOT_BASE[1] = (int) (MODULE);                       \
-+}
-+
-+/* Here is a macro to perform a relocation.  This is only used when
-+   bootstrapping the dynamic loader.  RELP is the relocation that we
-+   are performing, REL is the pointer to the address we are
-+   relocating.  SYMBOL is the symbol involved in the relocation, and
-+   LOAD is the load address. */
-+#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD)         \
-+  switch (ELF32_R_TYPE ((RELP)->r_info))                      \
-+    {                                                         \
-+    case R_68K_8:                                             \
-+      *(char *) (REL) = (SYMBOL) + (RELP)->r_addend;          \
-+      break;                                                  \
-+    case R_68K_16:                                            \
-+      *(short *) (REL) = (SYMBOL) + (RELP)->r_addend;         \
-+      break;                                                  \
-+    case R_68K_32:                                            \
-+      *(REL) = (SYMBOL) + (RELP)->r_addend;                   \
-+      break;                                                  \
-+    case R_68K_PC8:                                           \
-+      *(char *) (REL) = ((SYMBOL) + (RELP)->r_addend          \
-+                       - (unsigned int) (REL));               \
-+      break;                                                  \
-+    case R_68K_PC16:                                          \
-+      *(short *) (REL) = ((SYMBOL) + (RELP)->r_addend         \
-+                        - (unsigned int) (REL));              \
-+      break;                                                  \
-+    case R_68K_PC32:                                          \
-+      *(REL) = ((SYMBOL) + (RELP)->r_addend                   \
-+              - (unsigned int) (REL));                        \
-+      break;                                                  \
-+    case R_68K_GLOB_DAT:                                      \
-+    case R_68K_JMP_SLOT:                                      \
-+      *(REL) = (SYMBOL);                                      \
-+      break;                                                  \
-+    case R_68K_RELATIVE:              /* Compatibility kludge */ \
-+      *(REL) = ((unsigned int) (LOAD) + ((RELP)->r_addend ? : *(REL))); \
-+      break;                                                  \
-+    default:                                                  \
-+      _dl_exit (1);                                           \
-+    }
-+
-+
-+/* Transfer control to the user's application, once the dynamic loader
-+   is done.  */
-+
-+#define START()                                       \
-+  __asm__ volatile ("unlk %%a6\n\t"           \
-+                  "jmp %0@"                   \
-+                  : : "a" (_dl_elf_main));
-+
-+
-+
-+/* Here we define the magic numbers that this dynamic loader should accept */
-+
-+#define MAGIC1 EM_68K
-+#undef MAGIC2
-+/* Used for error messages */
-+#define ELF_TARGET "m68k"
-+
-+struct elf_resolve;
-+extern unsigned int _dl_linux_resolver (int, int, struct elf_resolve *, int);
-+
-+/* Define this because we do not want to call .udiv in the library.
-+   Not needed for m68k.  */
-+#define do_rem(result, n, base)  ((result) = (n) % (base))
-+
-+/* 4096 bytes alignment */
-+#define PAGE_ALIGN 0xfffff000
-+#define ADDR_ALIGN 0xfff
-+#define OFFS_ALIGN 0x7ffff000
-diff -urN uClibc/ldso-0.9.24/ldso/m68k/resolve.S uClibc.ldso.24/ldso-0.9.24/ldso/m68k/resolve.S
---- uClibc/ldso-0.9.24/ldso/m68k/resolve.S     1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/m68k/resolve.S     2001-04-27 12:23:26.000000000 -0500
-@@ -0,0 +1,21 @@
-+/*
-+ * These are various helper routines that are needed to run an ELF image.
-+ */
-+
-+.text
-+.even
-+
-+.globl _dl_linux_resolve
-+      .type   _dl_linux_resolve,@function
-+_dl_linux_resolve:
-+      moveml  %a0/%a1,%sp@-
-+#ifdef __PIC__
-+      bsrl    _dl_linux_resolver@PLTPC
-+#else
-+      jbsr    _dl_linux_resolver
-+#endif
-+      moveml  %sp@+,%a0/%a1
-+      addql   #8,%sp
-+      jmp     @(%d0)
-+.LFE2:
-+      .size _dl_linux_resolve,.LFE2-_dl_linux_resolve
-diff -urN uClibc/ldso-0.9.24/ldso/mips/README uClibc.ldso.24/ldso-0.9.24/ldso/mips/README
---- uClibc/ldso-0.9.24/ldso/mips/README        1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/mips/README        2002-07-25 16:15:59.000000000 -0500
-@@ -0,0 +1,52 @@
-+Almost all of the code present in these source files was taken
-+from GLIBC. In the descriptions below, all files mentioned are
-+with respect to the top level GLIBC source directory accept for
-+code taken from the Linux kernel.
-+
-+boot1_arch.h
-+------------
-+Contains code to fix up the stack pointer so that the dynamic
-+linker can find argc, argv and Auxillary Vector Table (AVT).
-+The code is taken from the function 'RTLD_START' in the file
-+'sysdeps/mips/dl-machine.h'.
-+
-+elfinterp.c
-+-----------
-+Contains the runtime resolver code taken from the function
-+'__dl_runtime_resolve' in 'sysdeps/mips/dl-machine.h'. Also
-+contains the function to perform relocations for objects
-+other than the linker itself. The code was taken from the
-+function 'elf_machine_rel' in 'sysdeps/mips/dl-machine.h'.
-+
-+ld_syscalls.h
-+-------------
-+Used to contain all the macro functions for the system calls
-+as well as the list of system calls supported. We now include
-+<sys/syscall.h> but with the __set_errno macro defined empty
-+so we can use the same file for the linker as well as userspace.
-+Original code was taken from the Linux kernel source 2.4.17 and
-+can be found in the file 'include/asm-mips/unistd.h'.
-+
-+ld_sysdep.h
-+-----------
-+Contains bootstrap code for the dynamic linker, magic numbers
-+for detecting MIPS target types and some macros. The macro
-+function 'PERFORM_BOOTSTRAP_GOT' is used to relocate the dynamic
-+linker's GOT so that function calls can be made. The code is
-+taken from the function 'ELF_MACHINE_BEFORE_RTLD_RELOC' in the
-+file 'sysdeps/mips/dl-machine.h'. The other macro function
-+'PERFORM_BOOTSTRAP_RELOC' is used to do the relocations for
-+the dynamic loader. The code is taken from the function
-+'elf_machine_rel' in the file 'sysdeps/mips/dl-machine.h'. The
-+final macro function is 'INIT_GOT' which initializes the GOT
-+for the application being dynamically linked and loaded. The
-+code is taken from the functions 'elf_machine_runtime_setup'
-+and 'elf_machine_got_rel' in 'sysdeps/mips/dl-machine.h'.
-+
-+resolve.S
-+---------
-+Contains the low-level assembly code for the dynamic runtime
-+resolver. The code is taken from the assembly code function
-+'_dl_runtime_resolve' in the file 'sysdeps/mips/dl-machine.h'.
-+The code looks a bit different since we only need to pass the
-+symbol index and the old GP register.
-diff -urN uClibc/ldso-0.9.24/ldso/mips/boot1_arch.h uClibc.ldso.24/ldso-0.9.24/ldso/mips/boot1_arch.h
---- uClibc/ldso-0.9.24/ldso/mips/boot1_arch.h  1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/mips/boot1_arch.h  2003-06-12 16:39:10.000000000 -0500
-@@ -0,0 +1,38 @@
-+/* Any assmbly language/system dependent hacks needed to setup boot1.c so it
-+ * will work as expected and cope with whatever platform specific wierdness is
-+ * needed for this architecture.
-+ */
-+
-+asm("" \
-+"     .text\n"                        \
-+"     .globl  _dl_boot\n"             \
-+"_dl_boot:\n"                         \
-+"     .set noreorder\n"               \
-+"     bltzal $0, 0f\n"                \
-+"     nop\n"                          \
-+"0:   .cpload $31\n"                  \
-+"     .set reorder\n"                 \
-+"     la $4, _DYNAMIC\n"              \
-+"     sw $4, -0x7ff0($28)\n"          \
-+"     move $4, $29\n"                 \
-+"     la $8, coff\n"                  \
-+"     .set noreorder\n"               \
-+"     bltzal $0, coff\n"              \
-+"     nop\n"                          \
-+"coff:        subu $8, $31, $8\n"             \
-+"     .set reorder\n"                 \
-+"     la $25, _dl_boot2\n"            \
-+"     addu $25, $8\n"                 \
-+"     jalr $25\n"                     \
-+"     lw $4, 0($29)\n"                \
-+"     la $5, 4($29)\n"                \
-+"     sll $6, $4, 2\n"                \
-+"     addu $6, $6, $5\n"              \
-+"     addu $6, $6, 4\n"               \
-+"     la $7, _dl_elf_main\n"          \
-+"     lw $25, 0($7)\n"                \
-+"     jr $25\n"                       \
-+);
-+
-+#define _dl_boot _dl_boot2
-+#define LD_BOOT(X)   static void __attribute__ ((unused)) _dl_boot (X)
-diff -urN uClibc/ldso-0.9.24/ldso/mips/elfinterp.c uClibc.ldso.24/ldso-0.9.24/ldso/mips/elfinterp.c
---- uClibc/ldso-0.9.24/ldso/mips/elfinterp.c   1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/mips/elfinterp.c   2003-08-22 02:04:16.000000000 -0500
-@@ -0,0 +1,301 @@
-+/* vi: set sw=4 ts=4: */
-+/* mips/mipsel ELF shared library loader suppport
-+ *
-+   Copyright (C) 2002, Steven J. Hill (sjhill@realitydiluted.com)
-+ *
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions and the following disclaimer.
-+ * 2. The name of the above contributors may not be
-+ *    used to endorse or promote products derived from this software
-+ *    without specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE
-+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+ * SUCH DAMAGE.
-+ */
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+static const char *_dl_reltypes_tab[] =
-+{
-+              [0]             "R_MIPS_NONE",  "R_MIPS_16",    "R_MIPS_32",
-+              [3]             "R_MIPS_REL32", "R_MIPS_26",    "R_MIPS_HI16",
-+              [6]             "R_MIPS_LO16",  "R_MIPS_GPREL16",       "R_MIPS_LITERAL",
-+              [9]             "R_MIPS_GOT16", "R_MIPS_PC16",  "R_MIPS_CALL16",
-+              [12]    "R_MIPS_GPREL32",
-+              [16]    "R_MIPS_SHIFT5",        "R_MIPS_SHIFT6",        "R_MIPS_64",
-+              [19]    "R_MIPS_GOT_DISP",      "R_MIPS_GOT_PAGE",      "R_MIPS_GOT_OFST",
-+              [22]    "R_MIPS_GOT_HI16",      "R_MIPS_GOT_LO16",      "R_MIPS_SUB",
-+              [25]    "R_MIPS_INSERT_A",      "R_MIPS_INSERT_B",      "R_MIPS_DELETE",
-+              [28]    "R_MIPS_HIGHER",        "R_MIPS_HIGHEST",       "R_MIPS_CALL_HI16",
-+              [31]    "R_MIPS_CALL_LO16",     "R_MIPS_SCN_DISP",      "R_MIPS_REL16",
-+              [34]    "R_MIPS_ADD_IMMEDIATE", "R_MIPS_PJUMP", "R_MIPS_RELGOT",
-+              [37]    "R_MIPS_JALR",
-+};
-+
-+static const char *
-+_dl_reltypes(int type)
-+{
-+  static char buf[22];  
-+  const char *str;
-+  
-+  if (type >= (int)(sizeof (_dl_reltypes_tab)/sizeof(_dl_reltypes_tab[0])) ||
-+      NULL == (str = _dl_reltypes_tab[type]))
-+  {
-+    str =_dl_simple_ltoa( buf, (unsigned long)(type));
-+  }
-+  return str;
-+}
-+
-+static 
-+void debug_sym(Elf32_Sym *symtab,char *strtab,int symtab_index)
-+{
-+  if(_dl_debug_symbols)
-+  {
-+    if(symtab_index){
-+      _dl_dprintf(_dl_debug_file, "\n%s\n\tvalue=%x\tsize=%x\tinfo=%x\tother=%x\tshndx=%x",
-+                strtab + symtab[symtab_index].st_name,
-+                symtab[symtab_index].st_value,
-+                symtab[symtab_index].st_size,
-+                symtab[symtab_index].st_info,
-+                symtab[symtab_index].st_other,
-+                symtab[symtab_index].st_shndx);
-+    }
-+  }
-+}
-+
-+static void debug_reloc(Elf32_Sym *symtab,char *strtab, ELF_RELOC *rpnt)
-+{
-+  if(_dl_debug_reloc)
-+  {
-+    int symtab_index;
-+    const char *sym;
-+    symtab_index = ELF32_R_SYM(rpnt->r_info);
-+    sym = symtab_index ? strtab + symtab[symtab_index].st_name : "sym=0x0";
-+    
-+  if(_dl_debug_symbols)
-+        _dl_dprintf(_dl_debug_file, "\n\t");
-+  else
-+        _dl_dprintf(_dl_debug_file, "\n%s\n\t", sym);
-+#ifdef ELF_USES_RELOCA
-+    _dl_dprintf(_dl_debug_file, "%s\toffset=%x\taddend=%x",
-+              _dl_reltypes(ELF32_R_TYPE(rpnt->r_info)),
-+              rpnt->r_offset,
-+              rpnt->r_addend);
-+#else
-+    _dl_dprintf(_dl_debug_file, "%s\toffset=%x\n",
-+              _dl_reltypes(ELF32_R_TYPE(rpnt->r_info)),
-+              rpnt->r_offset);
-+#endif
-+  }
-+}
-+#endif
-+
-+extern int _dl_linux_resolve(void);
-+
-+#define OFFSET_GP_GOT 0x7ff0
-+
-+unsigned long _dl_linux_resolver(unsigned long sym_index,
-+      unsigned long old_gpreg)
-+{
-+      unsigned long *got = (unsigned long *) (old_gpreg - OFFSET_GP_GOT);
-+      struct elf_resolve *tpnt = (struct elf_resolve *) got[1];
-+      Elf32_Sym *sym;
-+      char *strtab;
-+      unsigned long local_gotno;
-+      unsigned long gotsym;
-+      unsigned long new_addr;
-+      unsigned long instr_addr;
-+      char **got_addr;
-+      char *symname;
-+
-+      gotsym = tpnt->mips_gotsym;
-+      local_gotno = tpnt->mips_local_gotno;
-+
-+      sym = ((Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr)) + sym_index;
-+      strtab = (char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
-+      symname = strtab + sym->st_name;
-+
-+      new_addr = (unsigned long) _dl_find_hash(strtab + sym->st_name,
-+               tpnt->symbol_scope, tpnt, resolver);
-+       
-+      /* Address of jump instruction to fix up */
-+      instr_addr = (unsigned long) (got + local_gotno + sym_index - gotsym); 
-+      got_addr = (char **) instr_addr;
-+       
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if (_dl_debug_bindings)
-+      {
-+              _dl_dprintf(_dl_debug_file, "\nresolve function: %s", symname);
-+              if(_dl_debug_detail) _dl_dprintf(_dl_debug_file, 
-+                              "\n\tpatched %x ==> %x @ %x\n", *got_addr, new_addr, got_addr);
-+      }
-+      if (!_dl_debug_nofixups) {
-+              *got_addr = (char*)new_addr;
-+      }
-+#else
-+      *got_addr = (char*)new_addr;
-+#endif
-+
-+      return new_addr;
-+}
-+
-+void _dl_parse_lazy_relocation_information(struct elf_resolve *tpnt, 
-+      unsigned long rel_addr, unsigned long rel_size, int type)
-+{
-+      /* Nothing to do */
-+      return;
-+}
-+
-+int _dl_parse_copy_information(struct dyn_elf *xpnt, unsigned long rel_addr, 
-+      unsigned long rel_size, int type)
-+{
-+      /* Nothing to do */
-+      return 0;
-+}
-+
-+
-+int _dl_parse_relocation_information(struct elf_resolve *tpnt, 
-+      unsigned long rel_addr, unsigned long rel_size, int type)
-+{
-+      Elf32_Sym *symtab;
-+      Elf32_Rel *rpnt;
-+      char *strtab;
-+      unsigned long *got;
-+      unsigned long *reloc_addr=NULL, old_val=0;
-+      unsigned long symbol_addr;
-+      int i, reloc_type, symtab_index;
-+
-+      /* Now parse the relocation information */
-+      rel_size = rel_size / sizeof(Elf32_Rel);
-+      rpnt = (Elf32_Rel *) (rel_addr + tpnt->loadaddr);
-+
-+      symtab = (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
-+      strtab = (char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
-+      got = (unsigned long *) (tpnt->dynamic_info[DT_PLTGOT] + tpnt->loadaddr);
-+
-+      for (i = 0; i < rel_size; i++, rpnt++) {
-+              reloc_addr = (unsigned long *) (tpnt->loadaddr +
-+                      (unsigned long) rpnt->r_offset);
-+              reloc_type = ELF32_R_TYPE(rpnt->r_info);
-+              symtab_index = ELF32_R_SYM(rpnt->r_info);
-+              symbol_addr = 0;
-+
-+              if (!symtab_index && tpnt->libtype == program_interpreter)
-+                      continue;
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+              debug_sym(symtab,strtab,symtab_index);
-+              debug_reloc(symtab,strtab,rpnt);
-+              old_val = *reloc_addr;
-+#endif
-+
-+              switch (reloc_type) {
-+              case R_MIPS_REL32:
-+                      if (symtab_index) {
-+                              if (symtab_index < tpnt->mips_gotsym)
-+                                      *reloc_addr +=
-+                                              symtab[symtab_index].st_value +
-+                                              (unsigned long) tpnt->loadaddr;
-+                              else {
-+                                      *reloc_addr += got[symtab_index + tpnt->mips_local_gotno -
-+                                              tpnt->mips_gotsym];
-+                              }
-+                      }
-+                      else {
-+                              *reloc_addr += (unsigned long) tpnt->loadaddr;
-+                      }
-+                      break;
-+              case R_MIPS_NONE:
-+                      break;
-+              default:
-+                      {
-+                              int reloc_type = ELF32_R_TYPE(rpnt->r_info);
-+                              _dl_dprintf(2, "\n%s: ",_dl_progname);
-+
-+                              if (symtab_index)
-+                                      _dl_dprintf(2, "symbol '%s': ", strtab + symtab[symtab_index].st_name);
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+                              _dl_dprintf(2, "can't handle reloc type %s\n ", _dl_reltypes(reloc_type));
-+#else
-+                              _dl_dprintf(2, "can't handle reloc type %x\n", reloc_type);
-+#endif                        
-+                              _dl_exit(1);
-+                      }
-+              };
-+
-+      };
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if(_dl_debug_reloc && _dl_debug_detail)
-+              _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x\n", old_val, *reloc_addr, reloc_addr);
-+#endif
-+
-+      return 0;
-+}
-+
-+void _dl_perform_mips_global_got_relocations(struct elf_resolve *tpnt)
-+{
-+      Elf32_Sym *sym;
-+      char *strtab;
-+      unsigned long i;
-+      unsigned long *got_entry;
-+
-+      for (; tpnt ; tpnt = tpnt->next) {
-+
-+              /* We don't touch the dynamic linker */
-+              if (tpnt->libtype == program_interpreter)
-+                      continue;
-+
-+              /* Setup the loop variables */
-+              got_entry = (unsigned long *) (tpnt->loadaddr +
-+                      tpnt->dynamic_info[DT_PLTGOT]) + tpnt->mips_local_gotno;
-+              sym = (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB] +
-+                      (unsigned long) tpnt->loadaddr) + tpnt->mips_gotsym;
-+              strtab = (char *) (tpnt->dynamic_info[DT_STRTAB] +
-+                      (unsigned long) tpnt->loadaddr);
-+              i = tpnt->mips_symtabno - tpnt->mips_gotsym;
-+
-+              /* Relocate the global GOT entries for the object */
-+              while(i--) {
-+                      if (sym->st_shndx == SHN_UNDEF) {
-+                              if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC && sym->st_value)
-+                                      *got_entry = sym->st_value + (unsigned long) tpnt->loadaddr;
-+                              else {
-+                                      *got_entry = (unsigned long) _dl_find_hash(strtab +
-+                                              sym->st_name, tpnt->symbol_scope, NULL, copyrel);
-+                              }
-+                      }
-+                      else if (sym->st_shndx == SHN_COMMON) {
-+                              *got_entry = (unsigned long) _dl_find_hash(strtab +
-+                                      sym->st_name, tpnt->symbol_scope, NULL, copyrel);
-+                      }
-+                      else if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC &&
-+                              *got_entry != sym->st_value)
-+                              *got_entry += (unsigned long) tpnt->loadaddr;
-+                      else if (ELF32_ST_TYPE(sym->st_info) == STT_SECTION) {
-+                              if (sym->st_other == 0)
-+                                      *got_entry += (unsigned long) tpnt->loadaddr;
-+                      }
-+                      else {
-+                              *got_entry = (unsigned long) _dl_find_hash(strtab +
-+                                      sym->st_name, tpnt->symbol_scope, NULL, copyrel);
-+                      }
-+
-+                      got_entry++;
-+                      sym++;
-+              }
-+      }
-+}
-diff -urN uClibc/ldso-0.9.24/ldso/mips/ld_syscalls.h uClibc.ldso.24/ldso-0.9.24/ldso/mips/ld_syscalls.h
---- uClibc/ldso-0.9.24/ldso/mips/ld_syscalls.h 1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/mips/ld_syscalls.h 2002-08-09 07:20:20.000000000 -0500
-@@ -0,0 +1,7 @@
-+/* Define the __set_errno macro as nothing so that we don't bother
-+ * setting errno, which is important since we make system calls
-+ * before the errno symbol is dynamicly linked. */
-+
-+#define __set_errno(X) {(void)(X);}
-+#include "sys/syscall.h"
-+
-diff -urN uClibc/ldso-0.9.24/ldso/mips/ld_sysdep.h uClibc.ldso.24/ldso-0.9.24/ldso/mips/ld_sysdep.h
---- uClibc/ldso-0.9.24/ldso/mips/ld_sysdep.h   1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/mips/ld_sysdep.h   2002-05-28 16:33:36.000000000 -0500
-@@ -0,0 +1,136 @@
-+/* vi: set sw=4 ts=4: */
-+
-+/*
-+ * Various assmbly language/system dependent hacks that are required
-+ * so that we can minimize the amount of platform specific code.
-+ */
-+
-+/* 
-+ * Define this if the system uses RELOCA.
-+ */
-+#undef ELF_USES_RELOCA
-+
-+
-+/*
-+ * Get a pointer to the argv array.  On many platforms this can be just
-+ * the address if the first argument, on other platforms we need to
-+ * do something a little more subtle here.
-+ */
-+#define GET_ARGV(ARGVP, ARGS) ARGVP = ((unsigned long *) ARGS)
-+
-+
-+/*
-+ * Initialization sequence for the application/library GOT.
-+ */
-+#define INIT_GOT(GOT_BASE,MODULE)                                                                             \
-+do {                                                                                                                                  \
-+      unsigned long i;                                                                                                        \
-+                                                                                                                                              \
-+      /* Check if this is the dynamic linker itself */                                        \
-+      if (MODULE->libtype == program_interpreter)                                                     \
-+              continue;                                                                                                               \
-+                                                                                                                                              \
-+      /* Fill in first two GOT entries according to the ABI */                        \
-+      GOT_BASE[0] = (unsigned long) _dl_linux_resolve;                                        \
-+      GOT_BASE[1] = (unsigned long) MODULE;                                                           \
-+                                                                                                                                              \
-+      /* Add load address displacement to all local GOT entries */            \
-+      i = 2;                                                                                                                          \
-+      while (i < MODULE->mips_local_gotno)                                                            \
-+              GOT_BASE[i++] += (unsigned long) MODULE->loadaddr;                              \
-+                                                                                                                                              \
-+} while (0)
-+
-+
-+/*
-+ * Here is a macro to perform the GOT relocation. This is only
-+ * used when bootstrapping the dynamic loader.
-+ */
-+#define PERFORM_BOOTSTRAP_GOT(got)                                                                            \
-+do {                                                                                                                                  \
-+      Elf32_Sym *sym;                                                                                                         \
-+      unsigned long i;                                                                                                        \
-+                                                                                                                                              \
-+      /* Add load address displacement to all local GOT entries */            \
-+      i = 2;                                                                                                                          \
-+      while (i < tpnt->mips_local_gotno)                                                                      \
-+              got[i++] += load_addr;                                                                                  \
-+                                                                                                                                              \
-+      /* Handle global GOT entries */                                                                         \
-+      got += tpnt->mips_local_gotno;                                                                          \
-+      sym = (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB] +                            \
-+               load_addr) + tpnt->mips_gotsym;                                                                \
-+      i = tpnt->mips_symtabno - tpnt->mips_gotsym;                                            \
-+                                                                                                                                              \
-+      while (i--) {                                                                                                           \
-+              if (sym->st_shndx == SHN_UNDEF ||                                                               \
-+                      sym->st_shndx == SHN_COMMON)                                                            \
-+                      *got = load_addr + sym->st_value;                                                       \
-+              else if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC &&                             \
-+                      *got != sym->st_value)                                                                          \
-+                      *got += load_addr;                                                                                      \
-+              else if (ELF32_ST_TYPE(sym->st_info) == STT_SECTION) {                  \
-+                      if (sym->st_other == 0)                                                                         \
-+                              *got += load_addr;                                                                              \
-+              }                                                                                                                               \
-+              else                                                                                                                    \
-+                      *got = load_addr + sym->st_value;                                                       \
-+                                                                                                                                              \
-+              got++;                                                                                                                  \
-+              sym++;                                                                                                                  \
-+      }                                                                                                                                       \
-+} while (0)
-+
-+
-+/*
-+ * Here is a macro to perform a relocation.  This is only used when
-+ * bootstrapping the dynamic loader.
-+ */
-+#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD)                                 \
-+      switch(ELF32_R_TYPE((RELP)->r_info)) {                                                          \
-+      case R_MIPS_REL32:                                                                                                      \
-+              if (symtab_index) {                                                                                             \
-+                      if (symtab_index < tpnt->mips_gotsym)                                           \
-+                              *REL += SYMBOL;                                                                                 \
-+              }                                                                                                                               \
-+              else {                                                                                                                  \
-+                      *REL += LOAD;                                                                                           \
-+              }                                                                                                                               \
-+              break;                                                                                                                  \
-+      case R_MIPS_NONE:                                                                                                       \
-+              break;                                                                                                                  \
-+      default:                                                                                                                        \
-+              SEND_STDERR("Aiieeee!");                                                                                \
-+              _dl_exit(1);                                                                                                    \
-+      }
-+
-+
-+/*
-+ * Transfer control to the user's application, once the dynamic loader
-+ * is done.  This routine has to exit the current function, then 
-+ * call the _dl_elf_main function. For MIPS, we do it in assembly
-+ * because the stack doesn't get properly restored otherwise. Got look
-+ * at boot1_arch.h
-+ */
-+#define START()
-+
-+
-+/* Here we define the magic numbers that this dynamic loader should accept */
-+#define MAGIC1 EM_MIPS
-+#define MAGIC2 EM_MIPS_RS3_LE
-+
-+
-+/* Used for error messages */
-+#define ELF_TARGET "MIPS"
-+
-+
-+unsigned long _dl_linux_resolver(unsigned long sym_index,
-+      unsigned long old_gpreg);
-+
-+
-+#define do_rem(result, n, base)  result = (n % base)
-+
-+/* 4096 bytes alignment */
-+#define PAGE_ALIGN 0xfffff000
-+#define ADDR_ALIGN 0xfff
-+#define OFFS_ALIGN 0x7ffff000
-diff -urN uClibc/ldso-0.9.24/ldso/mips/resolve.S uClibc.ldso.24/ldso-0.9.24/ldso/mips/resolve.S
---- uClibc/ldso-0.9.24/ldso/mips/resolve.S     1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/mips/resolve.S     2003-01-30 10:40:26.000000000 -0600
-@@ -0,0 +1,45 @@
-+      /*
-+ * Linux dynamic resolving code for MIPS. Fixes up the GOT entry as
-+ * indicated in register t8 and jumps to the resolved address. Shamelessly
-+ * ripped from 'sysdeps/mips/dl-machine.h' in glibc-2.2.5.
-+ *
-+ * This file is subject to the terms and conditions of the GNU Lesser General
-+ * Public License.  See the file "COPYING.LIB" in the main directory of this
-+ * archive for more details.
-+ *
-+ * Copyright (C) 1996-2001 Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>
-+ * Copyright (C) 2002 Steven J. Hill <sjhill@realitydiluted.com>
-+ *
-+ */
-+.text
-+.align        2
-+.globl        _dl_linux_resolve
-+.type _dl_linux_resolve,@function
-+.ent  _dl_linux_resolve
-+_dl_linux_resolve:
-+      .frame  $29, 40, $31
-+      .set noreorder
-+      move    $3, $28         # Save GP
-+      addu    $25, 8          # t9 ($25) now points at .cpload instruction
-+      .cpload $25             # Compute GP
-+      .set reorder
-+      subu    $29, 40
-+      .cprestore 32
-+      sw      $15, 36($29)
-+      sw      $4, 16($29)
-+      sw      $5, 20($29)
-+      sw      $6, 24($29)
-+      sw      $7, 28($29)
-+      move    $4, $24
-+      move    $5, $3
-+      jal     _dl_linux_resolver
-+      lw      $31, 36($29)
-+      lw      $4, 16($29)
-+      lw      $5, 20($29)
-+      lw      $6, 24($29)
-+      lw      $7, 28($29)
-+      addu    $29, 40
-+      move    $25, $2
-+      jr      $25
-+.size _dl_linux_resolve,.-_dl_linux_resolve
-+.end _dl_linux_resolve
-diff -urN uClibc/ldso-0.9.24/ldso/powerpc/boot1_arch.h uClibc.ldso.24/ldso-0.9.24/ldso/powerpc/boot1_arch.h
---- uClibc/ldso-0.9.24/ldso/powerpc/boot1_arch.h       1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/powerpc/boot1_arch.h       2003-02-15 19:22:41.000000000 -0600
-@@ -0,0 +1,20 @@
-+/* Any assmbly language/system dependent hacks needed to setup boot1.c so it
-+ * will work as expected and cope with whatever platform specific wierdness is
-+ * needed for this architecture.  */
-+
-+/* Overrive the default _dl_boot function, and replace it with a bit of asm.
-+ * Then call the real _dl_boot function, which is now named _dl_boot2. */
-+
-+asm("" \
-+"     .text\n"                        \
-+"     .globl  _dl_boot\n"             \
-+"_dl_boot:\n"                         \
-+"     mr      3,1\n"                  \
-+"     addi    1,1,-16\n"              \
-+"     bl      _dl_boot2\n"            \
-+".previous\n"                         \
-+);
-+
-+#define _dl_boot _dl_boot2
-+#define LD_BOOT(X)   static void *  __attribute__ ((unused)) _dl_boot (X)
-+
-diff -urN uClibc/ldso-0.9.24/ldso/powerpc/elfinterp.c uClibc.ldso.24/ldso-0.9.24/ldso/powerpc/elfinterp.c
---- uClibc/ldso-0.9.24/ldso/powerpc/elfinterp.c        1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/powerpc/elfinterp.c        2003-12-03 17:28:33.000000000 -0600
-@@ -0,0 +1,621 @@
-+/* vi: set sw=4 ts=4: */
-+/* powerpc shared library loader suppport
-+ *
-+ * Copyright (C) 2001-2002,  David A. Schleef
-+ * Copyright (C) 2003, Erik Andersen
-+ *
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions and the following disclaimer.
-+ * 2. The name of the above contributors may not be
-+ *    used to endorse or promote products derived from this software
-+ *    without specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE
-+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+ * SUCH DAMAGE.
-+ */
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+static const char *_dl_reltypes_tab[] =
-+      { "R_PPC_NONE", "R_PPC_ADDR32", "R_PPC_ADDR24", "R_PPC_ADDR16",
-+      "R_PPC_ADDR16_LO", "R_PPC_ADDR16_HI", "R_PPC_ADDR16_HA",
-+      "R_PPC_ADDR14", "R_PPC_ADDR14_BRTAKEN", "R_PPC_ADDR14_BRNTAKEN",
-+      "R_PPC_REL24", "R_PPC_REL14", "R_PPC_REL14_BRTAKEN",
-+      "R_PPC_REL14_BRNTAKEN", "R_PPC_GOT16", "R_PPC_GOT16_LO",
-+      "R_PPC_GOT16_HI", "R_PPC_GOT16_HA", "R_PPC_PLTREL24",
-+      "R_PPC_COPY", "R_PPC_GLOB_DAT", "R_PPC_JMP_SLOT", "R_PPC_RELATIVE",
-+      "R_PPC_LOCAL24PC", "R_PPC_UADDR32", "R_PPC_UADDR16", "R_PPC_REL32",
-+      "R_PPC_PLT32", "R_PPC_PLTREL32", "R_PPC_PLT16_LO", "R_PPC_PLT16_HI",
-+      "R_PPC_PLT16_HA", "R_PPC_SDAREL16", "R_PPC_SECTOFF",
-+      "R_PPC_SECTOFF_LO", "R_PPC_SECTOFF_HI", "R_PPC_SECTOFF_HA",
-+};
-+
-+static const char *
-+_dl_reltypes(int type)
-+{
-+  static char buf[22];  
-+  const char *str;
-+  
-+  if (type >= (int)(sizeof (_dl_reltypes_tab)/sizeof(_dl_reltypes_tab[0])) ||
-+      NULL == (str = _dl_reltypes_tab[type]))
-+  {
-+    str =_dl_simple_ltoa( buf, (unsigned long)(type));
-+  }
-+  return str;
-+}
-+
-+static 
-+void debug_sym(Elf32_Sym *symtab,char *strtab,int symtab_index)
-+{
-+  if(_dl_debug_symbols)
-+  {
-+    if(symtab_index){
-+      _dl_dprintf(_dl_debug_file, "\n%s\n\tvalue=%x\tsize=%x\tinfo=%x\tother=%x\tshndx=%x",
-+                strtab + symtab[symtab_index].st_name,
-+                symtab[symtab_index].st_value,
-+                symtab[symtab_index].st_size,
-+                symtab[symtab_index].st_info,
-+                symtab[symtab_index].st_other,
-+                symtab[symtab_index].st_shndx);
-+    }
-+  }
-+}
-+
-+static 
-+void debug_reloc(Elf32_Sym *symtab,char *strtab, ELF_RELOC *rpnt)
-+{
-+  if(_dl_debug_reloc)
-+  {
-+    int symtab_index;
-+    const char *sym;
-+    symtab_index = ELF32_R_SYM(rpnt->r_info);
-+    sym = symtab_index ? strtab + symtab[symtab_index].st_name : "sym=0x0";
-+    
-+  if(_dl_debug_symbols)
-+        _dl_dprintf(_dl_debug_file, "\n\t");
-+  else
-+        _dl_dprintf(_dl_debug_file, "\n%s\n\t", sym);
-+#ifdef ELF_USES_RELOCA
-+    _dl_dprintf(_dl_debug_file, "%s\toffset=%x\taddend=%x",
-+              _dl_reltypes(ELF32_R_TYPE(rpnt->r_info)),
-+              rpnt->r_offset,
-+              rpnt->r_addend);
-+#else
-+    _dl_dprintf(_dl_debug_file, "%s\toffset=%x\n",
-+              _dl_reltypes(ELF32_R_TYPE(rpnt->r_info)),
-+              rpnt->r_offset);
-+#endif
-+  }
-+}
-+#endif
-+
-+extern int _dl_linux_resolve(void);
-+
-+void _dl_init_got(unsigned long *plt,struct elf_resolve *tpnt)
-+{
-+      unsigned long target_addr = (unsigned long)_dl_linux_resolve;
-+      unsigned int n_plt_entries;
-+      unsigned long *tramp;
-+      unsigned long data_words;
-+      unsigned int rel_offset_words;
-+
-+      //DPRINTF("init_got plt=%x, tpnt=%x\n", (unsigned long)plt,(unsigned long)tpnt);
-+
-+      n_plt_entries = tpnt->dynamic_info[DT_PLTRELSZ] / sizeof(ELF_RELOC);
-+      //DPRINTF("n_plt_entries %d\n",n_plt_entries);
-+
-+      rel_offset_words = PLT_DATA_START_WORDS(n_plt_entries);
-+      //DPRINTF("rel_offset_words %x\n",rel_offset_words);
-+      data_words = (unsigned long)(plt + rel_offset_words);
-+      //DPRINTF("data_words %x\n",data_words);
-+
-+      tpnt->data_words = data_words;
-+
-+      plt[PLT_LONGBRANCH_ENTRY_WORDS] = OPCODE_ADDIS_HI(11, 11, data_words);
-+      plt[PLT_LONGBRANCH_ENTRY_WORDS+1] = OPCODE_LWZ(11,data_words,11);
-+
-+      plt[PLT_LONGBRANCH_ENTRY_WORDS+2] = OPCODE_MTCTR(11);
-+      plt[PLT_LONGBRANCH_ENTRY_WORDS+3] = OPCODE_BCTR();
-+
-+      /* [4] */
-+      /* [5] */
-+
-+      tramp = plt + PLT_TRAMPOLINE_ENTRY_WORDS;
-+      tramp[0] = OPCODE_ADDIS_HI(11,11,-data_words);
-+      tramp[1] = OPCODE_ADDI(11,11,-data_words);
-+      tramp[2] = OPCODE_SLWI(12,11,1);
-+      tramp[3] = OPCODE_ADD(11,12,11);
-+      tramp[4] = OPCODE_LI(12,target_addr);
-+      tramp[5] = OPCODE_ADDIS_HI(12,12,target_addr);
-+      tramp[6] = OPCODE_MTCTR(12);
-+      tramp[7] = OPCODE_LI(12,(unsigned long)tpnt);
-+      tramp[8] = OPCODE_ADDIS_HI(12,12,(unsigned long)tpnt);
-+      tramp[9] = OPCODE_BCTR();
-+
-+      /* [16] unused */
-+      /* [17] unused */
-+
-+      /* instructions were modified */
-+      PPC_DCBST(plt);
-+      PPC_DCBST(plt+4);
-+      PPC_DCBST(plt+8);
-+      PPC_DCBST(plt+12);
-+      PPC_DCBST(plt+16-1);
-+      PPC_SYNC;
-+      PPC_ICBI(plt);
-+      PPC_ICBI(plt+4); /* glibc thinks this is not needed */
-+      PPC_ICBI(plt+8); /* glibc thinks this is not needed */
-+      PPC_ICBI(plt+12); /* glibc thinks this is not needed */
-+      PPC_ICBI(plt+16-1);
-+      PPC_ISYNC;
-+}
-+
-+unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry)
-+{
-+      int reloc_type;
-+      ELF_RELOC *this_reloc;
-+      char *strtab;
-+      Elf32_Sym *symtab;
-+      ELF_RELOC *rel_addr;
-+      int symtab_index;
-+      char *symname;
-+      unsigned long insn_addr;
-+      unsigned long *insns;
-+      unsigned long new_addr;
-+      unsigned long delta;
-+
-+      rel_addr = (ELF_RELOC *) (tpnt->dynamic_info[DT_JMPREL] + tpnt->loadaddr);
-+
-+      this_reloc = (void *)rel_addr + reloc_entry;
-+      reloc_type = ELF32_R_TYPE(this_reloc->r_info);
-+      symtab_index = ELF32_R_SYM(this_reloc->r_info);
-+
-+      symtab = (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
-+      strtab = (char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
-+      symname      = strtab + symtab[symtab_index].st_name;
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      debug_sym(symtab,strtab,symtab_index);
-+      debug_reloc(symtab,strtab,this_reloc);
-+#endif
-+
-+      if (reloc_type != R_PPC_JMP_SLOT) {
-+              _dl_dprintf(2, "%s: Incorrect relocation type in jump relocation\n", _dl_progname);
-+              _dl_exit(1);
-+      };
-+
-+      /* Address of dump instruction to fix up */
-+      insn_addr = (unsigned long) tpnt->loadaddr +
-+              (unsigned long) this_reloc->r_offset;
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if(_dl_debug_reloc && _dl_debug_detail)
-+              _dl_dprintf(_dl_debug_file, "\n\tResolving symbol %s %x --> ", symname, insn_addr);
-+#endif
-+
-+      /* Get the address of the GOT entry */
-+      new_addr = (unsigned long) _dl_find_hash(
-+              strtab + symtab[symtab_index].st_name, 
-+              tpnt->symbol_scope, tpnt, resolver);
-+      if (!new_addr) {
-+              _dl_dprintf(2, "%s: can't resolve symbol '%s'\n", 
-+                      _dl_progname, symname);
-+              _dl_exit(1);
-+      };
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if(_dl_debug_reloc && _dl_debug_detail)
-+              _dl_dprintf(_dl_debug_file, "%x\n", new_addr);
-+#endif
-+
-+      insns = (unsigned long *)insn_addr;
-+      delta = new_addr - insn_addr;
-+
-+      if(delta<<6>>6 == delta){
-+              insns[0] = OPCODE_B(delta);
-+      }else if (new_addr <= 0x01fffffc || new_addr >= 0xfe000000){
-+              insns[0] = OPCODE_BA (new_addr);
-+      }else{
-+              /* Warning: we don't handle double-sized PLT entries */
-+              unsigned long plt_addr;
-+              unsigned long *ptr;
-+              int index;
-+
-+              plt_addr = (unsigned long)tpnt->dynamic_info[DT_PLTGOT] + 
-+                      (unsigned long)tpnt->loadaddr;
-+
-+              delta = PLT_LONGBRANCH_ENTRY_WORDS*4 - (insn_addr-plt_addr+4);
-+
-+              index = (insn_addr - plt_addr - PLT_INITIAL_ENTRY_WORDS*4)/8;
-+
-+              ptr = (unsigned long *)tpnt->data_words;
-+              //DPRINTF("plt_addr=%x delta=%x index=%x ptr=%x\n", plt_addr, delta, index, ptr);
-+              insns += 1;
-+
-+              ptr[index] = new_addr;
-+              PPC_SYNC;
-+              /* icache sync is not necessary, since this will be a data load */
-+              //PPC_DCBST(ptr+index);
-+              //PPC_SYNC;
-+              //PPC_ICBI(ptr+index);
-+              //PPC_ISYNC;
-+
-+              insns[0] = OPCODE_B(delta);
-+
-+      }
-+
-+      /* instructions were modified */
-+      PPC_DCBST(insns);
-+      PPC_SYNC;
-+      PPC_ICBI(insns);
-+      PPC_ISYNC;
-+
-+      return new_addr;
-+}
-+
-+static int
-+_dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope,
-+        unsigned long rel_addr, unsigned long rel_size,
-+        int (*reloc_fnc) (struct elf_resolve *tpnt, struct dyn_elf *scope,
-+                          ELF_RELOC *rpnt, Elf32_Sym *symtab, char *strtab))
-+{
-+      unsigned int i;
-+      char *strtab;
-+      Elf32_Sym *symtab;
-+      ELF_RELOC *rpnt;
-+      int symtab_index;
-+
-+      /* Now parse the relocation information */
-+      rpnt = (ELF_RELOC *)(intptr_t) (rel_addr + tpnt->loadaddr);
-+      rel_size = rel_size / sizeof(ELF_RELOC);
-+
-+      symtab = (Elf32_Sym *)(intptr_t) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
-+      strtab = (char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
-+
-+        for (i = 0; i < rel_size; i++, rpnt++) {
-+              int res;
-+          
-+              symtab_index = ELF32_R_SYM(rpnt->r_info);
-+              
-+              /* When the dynamic linker bootstrapped itself, it resolved some symbols.
-+                 Make sure we do not do them again */
-+              if (!symtab_index && tpnt->libtype == program_interpreter)
-+                      continue;
-+              if (symtab_index && tpnt->libtype == program_interpreter &&
-+                  _dl_symbol(strtab + symtab[symtab_index].st_name))
-+                      continue;
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+              debug_sym(symtab,strtab,symtab_index);
-+              debug_reloc(symtab,strtab,rpnt);
-+#endif
-+
-+              res = reloc_fnc (tpnt, scope, rpnt, symtab, strtab);
-+
-+              if (res==0) continue;
-+
-+              _dl_dprintf(2, "\n%s: ",_dl_progname);
-+              
-+              if (symtab_index)
-+                _dl_dprintf(2, "symbol '%s': ", strtab + symtab[symtab_index].st_name);
-+                
-+              if (res <0)
-+              {
-+                      int reloc_type = ELF32_R_TYPE(rpnt->r_info);
-+#if defined (__SUPPORT_LD_DEBUG__)
-+                      _dl_dprintf(2, "can't handle reloc type %s\n ", _dl_reltypes(reloc_type));
-+#else
-+                      _dl_dprintf(2, "can't handle reloc type %x\n", reloc_type);
-+#endif                        
-+                      _dl_exit(-res);
-+              }
-+              else if (res >0)
-+              {
-+                      _dl_dprintf(2, "can't resolve symbol\n");
-+                      return res;
-+              }
-+        }
-+        return 0;
-+}
-+
-+static int
-+_dl_do_lazy_reloc (struct elf_resolve *tpnt, struct dyn_elf *scope,
-+                 ELF_RELOC *rpnt, Elf32_Sym *symtab, char *strtab)
-+{
-+      int reloc_type;
-+      unsigned long reloc_addr;
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      unsigned long old_val;
-+#endif
-+      (void)scope;
-+      (void)symtab;
-+      (void)strtab;
-+
-+      reloc_addr = (unsigned long)tpnt->loadaddr + (unsigned long) rpnt->r_offset;
-+      reloc_type = ELF32_R_TYPE(rpnt->r_info);
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      old_val = reloc_addr;
-+#endif
-+
-+      switch (reloc_type) {
-+              case R_PPC_NONE:
-+                      return 0;
-+                      break;
-+              case R_PPC_JMP_SLOT:
-+                      {
-+                              int index;
-+                              unsigned long delta;
-+                              unsigned long *plt;
-+                              unsigned long *insns;
-+
-+                              plt = (unsigned long *)(tpnt->dynamic_info[DT_PLTGOT] + tpnt->loadaddr);
-+
-+                              delta = (unsigned long)(plt+PLT_TRAMPOLINE_ENTRY_WORDS+2) - (reloc_addr+4);
-+
-+                              index = (reloc_addr - (unsigned long)(plt+PLT_INITIAL_ENTRY_WORDS)) 
-+                                              /sizeof(unsigned long);
-+                              index /= 2;
-+                              //DPRINTF("        index %x delta %x\n",index,delta);
-+                              insns = (unsigned long *)reloc_addr;
-+                              insns[0] = OPCODE_LI(11,index*4);
-+                              insns[1] = OPCODE_B(delta);
-+                              break;
-+                      }
-+              default:
-+#if 0
-+                      _dl_dprintf(2, "%s: (LAZY) can't handle reloc type ", 
-+                                      _dl_progname);
-+#if defined (__SUPPORT_LD_DEBUG__)
-+                      _dl_dprintf(2, "%s ", _dl_reltypes[reloc_type]);
-+#endif
-+                      if (symtab_index)
-+                              _dl_dprintf(2, "'%s'\n", strtab + symtab[symtab_index].st_name);
-+#endif
-+                      //_dl_exit(1);
-+                      return -1;
-+      };
-+
-+      /* instructions were modified */
-+      PPC_DCBST(reloc_addr);
-+      PPC_DCBST(reloc_addr+4);
-+      PPC_SYNC;
-+      PPC_ICBI(reloc_addr);
-+      PPC_ICBI(reloc_addr+4);
-+      PPC_ISYNC;
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if(_dl_debug_reloc && _dl_debug_detail)
-+              _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x", old_val, reloc_addr);
-+#endif
-+      return 0;
-+
-+}
-+
-+static int
-+_dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope,
-+            ELF_RELOC *rpnt, Elf32_Sym *symtab, char *strtab)
-+{
-+      int reloc_type;
-+      int symtab_index;
-+      char *symname;
-+      unsigned long *reloc_addr;
-+      unsigned long symbol_addr;
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      unsigned long old_val;
-+#endif
-+
-+      reloc_addr   = (unsigned long *)(intptr_t) (tpnt->loadaddr + (unsigned long) rpnt->r_offset);
-+      reloc_type   = ELF32_R_TYPE(rpnt->r_info);
-+      symtab_index = ELF32_R_SYM(rpnt->r_info);
-+      symbol_addr  = 0;
-+      symname      = strtab + symtab[symtab_index].st_name;
-+
-+      if (symtab_index) {
-+
-+              symbol_addr = (unsigned long) _dl_find_hash(symname, scope, 
-+                              (reloc_type == R_PPC_JMP_SLOT ? tpnt : NULL), symbolrel);
-+
-+              /*
-+               * We want to allow undefined references to weak symbols - this might
-+               * have been intentional.  We should not be linking local symbols
-+               * here, so all bases should be covered.
-+               */
-+
-+              if (!symbol_addr && ELF32_ST_BIND(symtab[symtab_index].st_info) == STB_GLOBAL) {
-+#if defined (__SUPPORT_LD_DEBUG__)
-+                      _dl_dprintf(2, "\tglobal symbol '%s' already defined in '%s'\n",
-+                                      symname, tpnt->libname);
-+#endif
-+                      return 0;
-+              }
-+      }
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      old_val = *reloc_addr;
-+#endif
-+              switch (reloc_type) {
-+                      case R_PPC_NONE:
-+                              return 0;
-+                              break;
-+                      case R_PPC_REL24:
-+#if 0
-+                              {
-+                                      unsigned long delta = symbol_addr - (unsigned long)reloc_addr;
-+                                      if(delta<<6>>6 != delta){
-+                                              _dl_dprintf(2,"R_PPC_REL24: Reloc out of range\n");
-+                                              _dl_exit(1);
-+                                      }
-+                                      *reloc_addr &= 0xfc000003;
-+                                      *reloc_addr |= delta&0x03fffffc;
-+                              }
-+                              break;
-+#else
-+                              _dl_dprintf(2, "%s: symbol '%s' is type R_PPC_REL24\n\tCompile shared libraries with -fPIC!\n",
-+                                              _dl_progname, symname);
-+                              _dl_exit(1);
-+#endif
-+                      case R_PPC_RELATIVE:
-+                              *reloc_addr = (unsigned long)tpnt->loadaddr + (unsigned long)rpnt->r_addend;
-+                              break;
-+                      case R_PPC_ADDR32:
-+                              *reloc_addr += symbol_addr;
-+                              break;
-+                      case R_PPC_ADDR16_HA:
-+                              /* XXX is this correct? */
-+                              *(short *)reloc_addr += (symbol_addr+0x8000)>>16;
-+                              break;
-+                      case R_PPC_ADDR16_HI:
-+                              *(short *)reloc_addr += symbol_addr>>16;
-+                              break;
-+                      case R_PPC_ADDR16_LO:
-+                              *(short *)reloc_addr += symbol_addr;
-+                              break;
-+                      case R_PPC_JMP_SLOT:
-+                              {
-+                                      unsigned long targ_addr = (unsigned long)*reloc_addr;
-+                                      unsigned long delta = targ_addr - (unsigned long)reloc_addr;
-+                                      if(delta<<6>>6 == delta){
-+                                              *reloc_addr = OPCODE_B(delta);
-+                                      }else if (targ_addr <= 0x01fffffc || targ_addr >= 0xfe000000){
-+                                              *reloc_addr = OPCODE_BA (targ_addr);
-+                                      }else{
-+                                              {
-+                                                      int index;
-+                                                      unsigned long delta2;
-+                                                      unsigned long *plt, *ptr;
-+                                                      plt = (unsigned long *)(tpnt->dynamic_info[DT_PLTGOT] + tpnt->loadaddr);
-+
-+                                                      delta2 = (unsigned long)(plt+PLT_LONGBRANCH_ENTRY_WORDS)
-+                                                              - (unsigned long)(reloc_addr+1);
-+
-+                                                      index = ((unsigned long)reloc_addr -
-+                                                                      (unsigned long)(plt+PLT_INITIAL_ENTRY_WORDS))
-+                                                              /sizeof(unsigned long);
-+                                                      index /= 2;
-+                                                      //DPRINTF("        index %x delta %x\n",index,delta2);
-+                                                      ptr = (unsigned long *)tpnt->data_words;
-+                                                      ptr[index] = targ_addr;
-+                                                      reloc_addr[0] = OPCODE_LI(11,index*4);
-+                                                      reloc_addr[1] = OPCODE_B(delta2);
-+
-+                                                      /* instructions were modified */
-+                                                      PPC_DCBST(reloc_addr+1);
-+                                                      PPC_SYNC;
-+                                                      PPC_ICBI(reloc_addr+1);
-+                                              }
-+                                      }
-+                                      break;
-+                              }
-+                      case R_PPC_GLOB_DAT:
-+                              *reloc_addr += symbol_addr;
-+                              break;
-+                      case R_PPC_COPY:
-+                              // handled later
-+                              return 0;
-+                              break;
-+                      default:
-+#if 0
-+                              _dl_dprintf(2, "%s: can't handle reloc type ", _dl_progname);
-+#if defined (__SUPPORT_LD_DEBUG__)
-+                              _dl_dprintf(2, "%s ", _dl_reltypes[reloc_type]);
-+#endif
-+                              if (symtab_index)
-+                                      _dl_dprintf(2, "'%s'\n", strtab + symtab[symtab_index].st_name);
-+#endif
-+                              //_dl_exit(1);
-+                              return -1;
-+              };
-+
-+              /* instructions were modified */
-+              PPC_DCBST(reloc_addr);
-+              PPC_SYNC;
-+              PPC_ICBI(reloc_addr);
-+              PPC_ISYNC;
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if(_dl_debug_reloc && _dl_debug_detail)
-+              _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x", old_val, *reloc_addr, reloc_addr);
-+#endif
-+
-+      return 0;
-+}
-+
-+
-+/* This is done as a separate step, because there are cases where
-+   information is first copied and later initialized.  This results in
-+   the wrong information being copied.  Someone at Sun was complaining about
-+   a bug in the handling of _COPY by SVr4, and this may in fact be what he
-+   was talking about.  Sigh. */
-+static int
-+_dl_do_copy (struct elf_resolve *tpnt, struct dyn_elf *scope,
-+           ELF_RELOC *rpnt, Elf32_Sym *symtab, char *strtab)
-+{
-+      int reloc_type;
-+      int symtab_index;
-+      unsigned long *reloc_addr;
-+      unsigned long symbol_addr;
-+      int goof = 0;
-+      char *symname;
-+        
-+      reloc_addr = (unsigned long *)(intptr_t) (tpnt->loadaddr + (unsigned long) rpnt->r_offset);
-+      reloc_type = ELF32_R_TYPE(rpnt->r_info);
-+      if (reloc_type != R_PPC_COPY) 
-+              return 0;
-+      symtab_index = ELF32_R_SYM(rpnt->r_info);
-+      symbol_addr = 0;
-+      symname      = strtab + symtab[symtab_index].st_name;
-+              
-+      if (symtab_index) {
-+              symbol_addr = (unsigned long) _dl_find_hash(symname, scope, NULL, copyrel);
-+              if (!symbol_addr) goof++;
-+      }
-+      if (!goof) {
-+#if defined (__SUPPORT_LD_DEBUG__)
-+              if(_dl_debug_move)
-+                _dl_dprintf(_dl_debug_file,"\n%s move %x bytes from %x to %x",
-+                           symname, symtab[symtab_index].st_size,
-+                           symbol_addr, symtab[symtab_index].st_value);
-+#endif
-+                      _dl_memcpy((char *) reloc_addr,
-+                                      (char *) symbol_addr, symtab[symtab_index].st_size);
-+      }
-+
-+      return goof;
-+}
-+
-+void _dl_parse_lazy_relocation_information(struct elf_resolve *tpnt, 
-+      unsigned long rel_addr, unsigned long rel_size, int type)
-+{
-+      (void) type;
-+      (void)_dl_parse(tpnt, NULL, rel_addr, rel_size, _dl_do_lazy_reloc);
-+}
-+
-+int _dl_parse_relocation_information(struct elf_resolve *tpnt, 
-+      unsigned long rel_addr, unsigned long rel_size, int type)
-+{
-+      (void) type;
-+      return _dl_parse(tpnt, tpnt->symbol_scope, rel_addr, rel_size, _dl_do_reloc);
-+}
-+
-+int _dl_parse_copy_information(struct dyn_elf *xpnt, unsigned long rel_addr, 
-+      unsigned long rel_size, int type)
-+{
-+      (void) type;
-+      return _dl_parse(xpnt->dyn, xpnt->next, rel_addr, rel_size, _dl_do_copy);
-+}
-+
-+
-diff -urN uClibc/ldso-0.9.24/ldso/powerpc/ld_syscalls.h uClibc.ldso.24/ldso-0.9.24/ldso/powerpc/ld_syscalls.h
---- uClibc/ldso-0.9.24/ldso/powerpc/ld_syscalls.h      1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/powerpc/ld_syscalls.h      2003-06-14 20:08:43.000000000 -0500
-@@ -0,0 +1,244 @@
-+/*
-+ * This file contains the system call macros and syscall 
-+ * numbers used by the shared library loader.
-+ */
-+
-+#define __NR_exit               1
-+#define __NR_read               3
-+#define __NR_write              4
-+#define __NR_open               5
-+#define __NR_close              6
-+#define __NR_getpid            20
-+#define __NR_getuid            24
-+#define __NR_geteuid           49
-+#define __NR_getgid            47
-+#define __NR_getegid           50
-+#define __NR_readlink          85
-+#define __NR_mmap              90
-+#define __NR_munmap            91
-+#define __NR_stat             106
-+#define __NR_mprotect         125
-+
-+/* Here are the macros which define how this platform makes
-+ * system calls.  This particular variant does _not_ set 
-+ * errno (note how it is disabled in __syscall_return) since
-+ * these will get called before the errno symbol is dynamicly 
-+ * linked. */
-+
-+#undef __syscall_return
-+#define __syscall_return(type) \
-+      return (__sc_err & 0x10000000 ? /*errno = __sc_ret,*/ __sc_ret = -1 : 0), \
-+             (type) __sc_ret
-+
-+#undef __syscall_clobbers
-+#define __syscall_clobbers \
-+      "r9", "r10", "r11", "r12"
-+      //"r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12"
-+
-+#undef _syscall0
-+#define _syscall0(type,name)                                          \
-+type name(void)                                                               \
-+{                                                                     \
-+      unsigned long __sc_ret, __sc_err;                               \
-+      {                                                               \
-+              register unsigned long __sc_0 __asm__ ("r0");           \
-+              register unsigned long __sc_3 __asm__ ("r3");           \
-+                                                                      \
-+              __sc_0 = __NR_##name;                                   \
-+              __asm__ __volatile__                                    \
-+                      ("sc           \n\t"                            \
-+                       "mfcr %1      "                                \
-+                      : "=&r" (__sc_3), "=&r" (__sc_0)                \
-+                      : "0"   (__sc_3), "1"   (__sc_0)                \
-+                      : "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12" ); \
-+              __sc_ret = __sc_3;                                      \
-+              __sc_err = __sc_0;                                      \
-+      }                                                               \
-+      __syscall_return (type);                                        \
-+}
-+
-+#undef _syscall1
-+#define _syscall1(type,name,type1,arg1)                                       \
-+type name(type1 arg1)                                                 \
-+{                                                                     \
-+      unsigned long __sc_ret, __sc_err;                               \
-+      {                                                               \
-+              register unsigned long __sc_0 __asm__ ("r0");           \
-+              register unsigned long __sc_3 __asm__ ("r3");           \
-+                                                                      \
-+              __sc_3 = (unsigned long) (arg1);                        \
-+              __sc_0 = __NR_##name;                                   \
-+              __asm__ __volatile__                                    \
-+                      ("sc           \n\t"                            \
-+                       "mfcr %1      "                                \
-+                      : "=&r" (__sc_3), "=&r" (__sc_0)                \
-+                      : "0"   (__sc_3), "1"   (__sc_0)                \
-+                      : "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12" ); \
-+              __sc_ret = __sc_3;                                      \
-+              __sc_err = __sc_0;                                      \
-+      }                                                               \
-+      __syscall_return (type);                                        \
-+}
-+
-+#undef _syscall2
-+#define _syscall2(type,name,type1,arg1,type2,arg2)                    \
-+type name(type1 arg1, type2 arg2)                                     \
-+{                                                                     \
-+      unsigned long __sc_ret, __sc_err;                               \
-+      {                                                               \
-+              register unsigned long __sc_0 __asm__ ("r0");           \
-+              register unsigned long __sc_3 __asm__ ("r3");           \
-+              register unsigned long __sc_4 __asm__ ("r4");           \
-+                                                                      \
-+              __sc_3 = (unsigned long) (arg1);                        \
-+              __sc_4 = (unsigned long) (arg2);                        \
-+              __sc_0 = __NR_##name;                                   \
-+              __asm__ __volatile__                                    \
-+                      ("sc           \n\t"                            \
-+                       "mfcr %1      "                                \
-+                      : "=&r" (__sc_3), "=&r" (__sc_0)                \
-+                      : "0"   (__sc_3), "1"   (__sc_0),               \
-+                        "r"   (__sc_4)                                \
-+                      : "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12" ); \
-+              __sc_ret = __sc_3;                                      \
-+              __sc_err = __sc_0;                                      \
-+      }                                                               \
-+      __syscall_return (type);                                        \
-+}
-+
-+#undef _syscall3
-+#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3)         \
-+type name(type1 arg1, type2 arg2, type3 arg3)                         \
-+{                                                                     \
-+      unsigned long __sc_ret, __sc_err;                               \
-+      {                                                               \
-+              register unsigned long __sc_0 __asm__ ("r0");           \
-+              register unsigned long __sc_3 __asm__ ("r3");           \
-+              register unsigned long __sc_4 __asm__ ("r4");           \
-+              register unsigned long __sc_5 __asm__ ("r5");           \
-+                                                                      \
-+              __sc_3 = (unsigned long) (arg1);                        \
-+              __sc_4 = (unsigned long) (arg2);                        \
-+              __sc_5 = (unsigned long) (arg3);                        \
-+              __sc_0 = __NR_##name;                                   \
-+              __asm__ __volatile__                                    \
-+                      ("sc           \n\t"                            \
-+                       "mfcr %1      "                                \
-+                      : "=&r" (__sc_3), "=&r" (__sc_0)                \
-+                      : "0"   (__sc_3), "1"   (__sc_0),               \
-+                        "r"   (__sc_4),                               \
-+                        "r"   (__sc_5)                                \
-+                      : "r6", "r7", "r8", "r9", "r10", "r11", "r12" ); \
-+              __sc_ret = __sc_3;                                      \
-+              __sc_err = __sc_0;                                      \
-+      }                                                               \
-+      __syscall_return (type);                                        \
-+}
-+
-+#undef _syscall4
-+#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
-+type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4)             \
-+{                                                                     \
-+      unsigned long __sc_ret, __sc_err;                               \
-+      {                                                               \
-+              register unsigned long __sc_0 __asm__ ("r0");           \
-+              register unsigned long __sc_3 __asm__ ("r3");           \
-+              register unsigned long __sc_4 __asm__ ("r4");           \
-+              register unsigned long __sc_5 __asm__ ("r5");           \
-+              register unsigned long __sc_6 __asm__ ("r6");           \
-+                                                                      \
-+              __sc_3 = (unsigned long) (arg1);                        \
-+              __sc_4 = (unsigned long) (arg2);                        \
-+              __sc_5 = (unsigned long) (arg3);                        \
-+              __sc_6 = (unsigned long) (arg4);                        \
-+              __sc_0 = __NR_##name;                                   \
-+              __asm__ __volatile__                                    \
-+                      ("sc           \n\t"                            \
-+                       "mfcr %1      "                                \
-+                      : "=&r" (__sc_3), "=&r" (__sc_0)                \
-+                      : "0"   (__sc_3), "1"   (__sc_0),               \
-+                        "r"   (__sc_4),                               \
-+                        "r"   (__sc_5),                               \
-+                        "r"   (__sc_6)                                \
-+                      : "r7", "r8", "r9", "r10", "r11", "r12" );      \
-+              __sc_ret = __sc_3;                                      \
-+              __sc_err = __sc_0;                                      \
-+      }                                                               \
-+      __syscall_return (type);                                        \
-+}
-+
-+#undef _syscall5
-+#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
-+type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
-+{                                                                     \
-+      unsigned long __sc_ret, __sc_err;                               \
-+      {                                                               \
-+              register unsigned long __sc_0 __asm__ ("r0");           \
-+              register unsigned long __sc_3 __asm__ ("r3");           \
-+              register unsigned long __sc_4 __asm__ ("r4");           \
-+              register unsigned long __sc_5 __asm__ ("r5");           \
-+              register unsigned long __sc_6 __asm__ ("r6");           \
-+              register unsigned long __sc_7 __asm__ ("r7");           \
-+                                                                      \
-+              __sc_3 = (unsigned long) (arg1);                        \
-+              __sc_4 = (unsigned long) (arg2);                        \
-+              __sc_5 = (unsigned long) (arg3);                        \
-+              __sc_6 = (unsigned long) (arg4);                        \
-+              __sc_7 = (unsigned long) (arg5);                        \
-+              __sc_0 = __NR_##name;                                   \
-+              __asm__ __volatile__                                    \
-+                      ("sc           \n\t"                            \
-+                       "mfcr %1      "                                \
-+                      : "=&r" (__sc_3), "=&r" (__sc_0)                \
-+                      : "0"   (__sc_3), "1"   (__sc_0),               \
-+                        "r"   (__sc_4),                               \
-+                        "r"   (__sc_5),                               \
-+                        "r"   (__sc_6),                               \
-+                        "r"   (__sc_7)                                \
-+                      : "r8", "r9", "r10", "r11", "r12" );            \
-+              __sc_ret = __sc_3;                                      \
-+              __sc_err = __sc_0;                                      \
-+      }                                                               \
-+      __syscall_return (type);                                        \
-+}
-+
-+
-+#undef _syscall6
-+#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \
-+type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6)     \
-+{                                                                     \
-+      unsigned long __sc_ret, __sc_err;                               \
-+      {                                                               \
-+              register unsigned long __sc_0 __asm__ ("r0");           \
-+              register unsigned long __sc_3 __asm__ ("r3");           \
-+              register unsigned long __sc_4 __asm__ ("r4");           \
-+              register unsigned long __sc_5 __asm__ ("r5");           \
-+              register unsigned long __sc_6 __asm__ ("r6");           \
-+              register unsigned long __sc_7 __asm__ ("r7");           \
-+              register unsigned long __sc_8 __asm__ ("r8");           \
-+                                                                      \
-+              __sc_3 = (unsigned long) (arg1);                        \
-+              __sc_4 = (unsigned long) (arg2);                        \
-+              __sc_5 = (unsigned long) (arg3);                        \
-+              __sc_6 = (unsigned long) (arg4);                        \
-+              __sc_7 = (unsigned long) (arg5);                        \
-+              __sc_8 = (unsigned long) (arg6);                        \
-+              __sc_0 = __NR_##name;                                   \
-+              __asm__ __volatile__                                    \
-+                      ("sc           \n\t"                            \
-+                       "mfcr %1      "                                \
-+                      : "=&r" (__sc_3), "=&r" (__sc_0)                \
-+                      : "0"   (__sc_3), "1"   (__sc_0),               \
-+                        "r"   (__sc_4),                               \
-+                        "r"   (__sc_5),                               \
-+                        "r"   (__sc_6),                               \
-+                        "r"   (__sc_7),                               \
-+                        "r"   (__sc_8)                                \
-+                      : "r9", "r10", "r11", "r12" );                  \
-+              __sc_ret = __sc_3;                                      \
-+              __sc_err = __sc_0;                                      \
-+      }                                                               \
-+      __syscall_return (type);                                        \
-+}
-+
-+
-diff -urN uClibc/ldso-0.9.24/ldso/powerpc/ld_sysdep.h uClibc.ldso.24/ldso-0.9.24/ldso/powerpc/ld_sysdep.h
---- uClibc/ldso-0.9.24/ldso/powerpc/ld_sysdep.h        1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/powerpc/ld_sysdep.h        2003-12-03 17:38:43.000000000 -0600
-@@ -0,0 +1,136 @@
-+/*
-+ * Various assmbly language/system dependent  hacks that are required
-+ * so that we can minimize the amount of platform specific code.
-+ */
-+
-+/*
-+ * Define this if the system uses RELOCA.
-+ */
-+#define ELF_USES_RELOCA
-+
-+/*
-+ * Get a pointer to the argv array.  On many platforms this can be just
-+ * the address if the first argument, on other platforms we need to
-+ * do something a little more subtle here.
-+ */
-+#define GET_ARGV(ARGVP, ARGS) ARGVP = (((unsigned long*) ARGS)+1)
-+
-+/*
-+ * Initialization sequence for a GOT.
-+ */
-+#define INIT_GOT(GOT_BASE,MODULE)  _dl_init_got(GOT_BASE,MODULE)
-+
-+/* Stuff for the PLT.  */
-+#define PLT_INITIAL_ENTRY_WORDS 18
-+#define PLT_LONGBRANCH_ENTRY_WORDS 0
-+#define PLT_TRAMPOLINE_ENTRY_WORDS 6
-+#define PLT_DOUBLE_SIZE (1<<13)
-+#define PLT_ENTRY_START_WORDS(entry_number) \
-+  (PLT_INITIAL_ENTRY_WORDS + (entry_number)*2                         \
-+   + ((entry_number) > PLT_DOUBLE_SIZE                                        \
-+      ? ((entry_number) - PLT_DOUBLE_SIZE)*2                          \
-+      : 0))
-+#define PLT_DATA_START_WORDS(num_entries) PLT_ENTRY_START_WORDS(num_entries)
-+
-+/* Macros to build PowerPC opcode words.  */
-+#define OPCODE_ADDI(rd,ra,simm) \
-+  (0x38000000 | (rd) << 21 | (ra) << 16 | ((simm) & 0xffff))
-+#define OPCODE_ADDIS(rd,ra,simm) \
-+  (0x3c000000 | (rd) << 21 | (ra) << 16 | ((simm) & 0xffff))
-+#define OPCODE_ADD(rd,ra,rb) \
-+  (0x7c000214 | (rd) << 21 | (ra) << 16 | (rb) << 11)
-+#define OPCODE_B(target) (0x48000000 | ((target) & 0x03fffffc))
-+#define OPCODE_BA(target) (0x48000002 | ((target) & 0x03fffffc))
-+#define OPCODE_BCTR() 0x4e800420
-+#define OPCODE_LWZ(rd,d,ra) \
-+  (0x80000000 | (rd) << 21 | (ra) << 16 | ((d) & 0xffff))
-+#define OPCODE_LWZU(rd,d,ra) \
-+  (0x84000000 | (rd) << 21 | (ra) << 16 | ((d) & 0xffff))
-+#define OPCODE_MTCTR(rd) (0x7C0903A6 | (rd) << 21)
-+#define OPCODE_RLWINM(ra,rs,sh,mb,me) \
-+  (0x54000000 | (rs) << 21 | (ra) << 16 | (sh) << 11 | (mb) << 6 | (me) << 1)
-+
-+#define OPCODE_LI(rd,simm)    OPCODE_ADDI(rd,0,simm)
-+#define OPCODE_ADDIS_HI(rd,ra,value) \
-+  OPCODE_ADDIS(rd,ra,((value) + 0x8000) >> 16)
-+#define OPCODE_LIS_HI(rd,value) OPCODE_ADDIS_HI(rd,0,value)
-+#define OPCODE_SLWI(ra,rs,sh) OPCODE_RLWINM(ra,rs,sh,0,31-sh)
-+
-+
-+#define PPC_DCBST(where) asm volatile ("dcbst 0,%0" : : "r"(where) : "memory")
-+#define PPC_SYNC asm volatile ("sync" : : : "memory")
-+#define PPC_ISYNC asm volatile ("sync; isync" : : : "memory")
-+#define PPC_ICBI(where) asm volatile ("icbi 0,%0" : : "r"(where) : "memory")
-+#define PPC_DIE asm volatile ("tweq 0,0")
-+
-+/*
-+ * Here is a macro to perform a relocation.  This is only used when
-+ * bootstrapping the dynamic loader.  RELP is the relocation that we
-+ * are performing, REL is the pointer to the address we are relocating.
-+ * SYMBOL is the symbol involved in the relocation, and LOAD is the
-+ * load address.
-+ */
-+// finaladdr = LOAD ?
-+#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD) \
-+      {int type=ELF32_R_TYPE((RELP)->r_info);         \
-+      if(type==R_PPC_NONE){                           \
-+      }else if(type==R_PPC_ADDR32){                   \
-+              *REL += (SYMBOL);                       \
-+      }else if(type==R_PPC_RELATIVE){                 \
-+              *REL = (Elf32_Word)(LOAD) + (RELP)->r_addend;           \
-+      }else if(type==R_PPC_REL24){                    \
-+              Elf32_Sword delta = (Elf32_Word)(SYMBOL) - (Elf32_Word)(REL);   \
-+              *REL &= 0xfc000003;                     \
-+              *REL |= (delta & 0x03fffffc);           \
-+      }else if(type==R_PPC_JMP_SLOT){                 \
-+              Elf32_Sword delta = (Elf32_Word)(SYMBOL) - (Elf32_Word)(REL);   \
-+              /*if (delta << 6 >> 6 != delta)_dl_exit(99);*/  \
-+              *REL = OPCODE_B(delta);                 \
-+      }else{                                          \
-+        _dl_exit(100+ELF32_R_TYPE((RELP)->r_info));   \
-+      }                                               \
-+      if(type!=R_PPC_NONE){                           \
-+              PPC_DCBST(REL); PPC_SYNC; PPC_ICBI(REL);\
-+      }                                               \
-+      }
-+
-+/*
-+ * Transfer control to the user's application, once the dynamic loader
-+ * is done.  This routine has to exit the current function, then 
-+ * call the _dl_elf_main function.
-+ */
-+
-+/* hgb@ifi.uio.no:
-+ * Adding a clobber list consisting of r0 for %1.  addi on PowerPC
-+ * takes a register as the second argument, but if the register is
-+ * r0, the value 0 is used instead.  If r0 is used here, the stack
-+ * pointer (r1) will be zeroed, and the dynamically linked
-+ * application will seg.fault immediatly when receiving control.
-+ */
-+#define START()               \
-+      __asm__ volatile ( \
-+                  "addi 1,%1,0\n\t" \
-+                  "mtlr %0\n\t" \
-+                  "blrl\n\t"  \
-+                  : : "r" (_dl_elf_main), "r" (args) \
-+                  : "r0")
-+
-+
-+/* Here we define the magic numbers that this dynamic loader should accept */
-+
-+#define MAGIC1 EM_PPC
-+#undef  MAGIC2
-+/* Used for error messages */
-+#define ELF_TARGET "powerpc"
-+
-+struct elf_resolve;
-+extern unsigned long _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_entry);
-+void _dl_init_got(unsigned long *lpnt,struct elf_resolve *tpnt);
-+
-+
-+#define do_rem(result, n, base)  result = (n % base)
-+
-+/* 4096 bytes alignment */
-+#define PAGE_ALIGN 0xfffff000
-+#define ADDR_ALIGN 0xfff
-+#define OFFS_ALIGN 0x7ffff000
-diff -urN uClibc/ldso-0.9.24/ldso/powerpc/resolve.S uClibc.ldso.24/ldso-0.9.24/ldso/powerpc/resolve.S
---- uClibc/ldso-0.9.24/ldso/powerpc/resolve.S  1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/powerpc/resolve.S  2001-07-12 05:14:09.000000000 -0500
-@@ -0,0 +1,82 @@
-+/*
-+ * Stolen from glibc-2.2.2 by David Schleef <ds@schleef.org>
-+ */
-+
-+.text
-+.align 4
-+
-+.globl _dl_linux_resolver
-+
-+.globl _dl_linux_resolve
-+.type _dl_linux_resolve,@function
-+
-+_dl_linux_resolve:
-+// We need to save the registers used to pass parameters, and register 0,
-+// which is used by _mcount; the registers are saved in a stack frame.
-+      stwu 1,-64(1)
-+      stw 0,12(1)
-+      stw 3,16(1)
-+      stw 4,20(1)
-+// The code that calls this has put parameters for 'fixup' in r12 and r11.
-+      mr 3,12
-+      stw 5,24(1)
-+      mr 4,11
-+      stw 6,28(1)
-+      mflr 0
-+// We also need to save some of the condition register fields.
-+      stw 7,32(1)
-+      stw 0,48(1)
-+      stw 8,36(1)
-+      mfcr 0
-+      stw 9,40(1)
-+      stw 10,44(1)
-+      stw 0,8(1)
-+      bl _dl_linux_resolver@local
-+// 'fixup' returns the address we want to branch to.
-+      mtctr 3
-+// Put the registers back...
-+      lwz 0,48(1)
-+      lwz 10,44(1)
-+      lwz 9,40(1)
-+      mtlr 0
-+      lwz 8,36(1)
-+      lwz 0,8(1)
-+      lwz 7,32(1)
-+      lwz 6,28(1)
-+      mtcrf 0xFF,0
-+      lwz 5,24(1)
-+      lwz 4,20(1)
-+      lwz 3,16(1)
-+      lwz 0,12(1)
-+// ...unwind the stack frame, and jump to the PLT entry we updated.
-+      addi 1,1,64
-+      bctr
-+
-+.LFE2:
-+      .size _dl_linux_resolve,.LFE2-_dl_linux_resolve
-+
-+#if 0
-+
-+      pusha                           /* preserve all regs */
-+      lea     0x20(%esp),%eax         /* eax = tpnt and reloc_entry params */
-+      pushl   4(%eax)                 /* push copy of reloc_entry param */
-+      pushl   (%eax)                  /* push copy of tpnt param */
-+                                       
-+#ifdef __PIC__
-+      call    .L24
-+.L24:
-+      popl    %ebx
-+      addl    $_GLOBAL_OFFSET_TABLE_+[.-.L24],%ebx
-+      movl _dl_linux_resolver@GOT(%ebx),%ebx  /* eax = resolved func */
-+      call *%ebx
-+#else
-+      call _dl_linux_resolver
-+#endif
-+      movl    %eax,0x28(%esp)         /* store func addr over original
-+                                       * tpnt param */
-+      addl    $0x8,%esp               /* remove copy parameters */
-+      popa                            /* restore regs */
-+      ret     $4                      /* jump to func removing original
-+                                       * reloc_entry param from stack */
-+#endif
-+
-diff -urN uClibc/ldso-0.9.24/ldso/readelflib1.c uClibc.ldso.24/ldso-0.9.24/ldso/readelflib1.c
---- uClibc/ldso-0.9.24/ldso/readelflib1.c      1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/readelflib1.c      2003-12-05 14:24:26.000000000 -0600
-@@ -0,0 +1,971 @@
-+/* vi: set sw=4 ts=4: */
-+/* Program to load an ELF binary on a linux system, and run it
-+ * after resolving ELF shared library symbols
-+ *
-+ * Copyright (c) 1994-2000 Eric Youngdale, Peter MacDonald, 
-+ *                            David Engel, Hongjiu Lu and Mitch D'Souza
-+ * Copyright (C) 2001-2003, Erik Andersen
-+ *
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions and the following disclaimer.
-+ * 2. The name of the above contributors may not be
-+ *    used to endorse or promote products derived from this software
-+ *    without specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE
-+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+ * SUCH DAMAGE.
-+ */
-+
-+
-+/* This file contains the helper routines to load an ELF sharable
-+   library into memory and add the symbol table info to the chain. */
-+
-+#ifdef USE_CACHE
-+
-+static caddr_t _dl_cache_addr = NULL;
-+static size_t _dl_cache_size = 0;
-+
-+int _dl_map_cache(void)
-+{
-+      int fd;
-+      struct stat st;
-+      header_t *header;
-+      libentry_t *libent;
-+      int i, strtabsize;
-+
-+      if (_dl_cache_addr == (caddr_t) - 1)
-+              return -1;
-+      else if (_dl_cache_addr != NULL)
-+              return 0;
-+
-+      if (_dl_stat(LDSO_CACHE, &st)
-+              || (fd = _dl_open(LDSO_CACHE, O_RDONLY)) < 0) {
-+              _dl_dprintf(2, "%s: can't open cache '%s'\n", _dl_progname, LDSO_CACHE);
-+              _dl_cache_addr = (caddr_t) - 1; /* so we won't try again */
-+              return -1;
-+      }
-+
-+      _dl_cache_size = st.st_size;
-+      _dl_cache_addr = (caddr_t) _dl_mmap(0, _dl_cache_size, PROT_READ, MAP_SHARED, fd, 0);
-+      _dl_close(fd);
-+      if (_dl_mmap_check_error(_dl_cache_addr)) {
-+              _dl_dprintf(2, "%s: can't map cache '%s'\n", 
-+                      _dl_progname, LDSO_CACHE);
-+              return -1;
-+      }
-+
-+      header = (header_t *) _dl_cache_addr;
-+
-+      if (_dl_cache_size < sizeof(header_t) ||
-+              _dl_memcmp(header->magic, LDSO_CACHE_MAGIC, LDSO_CACHE_MAGIC_LEN)
-+              || _dl_memcmp(header->version, LDSO_CACHE_VER, LDSO_CACHE_VER_LEN)
-+              || _dl_cache_size <
-+              (sizeof(header_t) + header->nlibs * sizeof(libentry_t))
-+              || _dl_cache_addr[_dl_cache_size - 1] != '\0') 
-+      {
-+              _dl_dprintf(2, "%s: cache '%s' is corrupt\n", _dl_progname, 
-+                      LDSO_CACHE);
-+              goto fail;
-+      }
-+
-+      strtabsize = _dl_cache_size - sizeof(header_t) -
-+              header->nlibs * sizeof(libentry_t);
-+      libent = (libentry_t *) & header[1];
-+
-+      for (i = 0; i < header->nlibs; i++) {
-+              if (libent[i].sooffset >= strtabsize || 
-+                      libent[i].liboffset >= strtabsize) 
-+              {
-+                      _dl_dprintf(2, "%s: cache '%s' is corrupt\n", _dl_progname, LDSO_CACHE);
-+                      goto fail;
-+              }
-+      }
-+
-+      return 0;
-+
-+  fail:
-+      _dl_munmap(_dl_cache_addr, _dl_cache_size);
-+      _dl_cache_addr = (caddr_t) - 1;
-+      return -1;
-+}
-+
-+int _dl_unmap_cache(void)
-+{
-+      if (_dl_cache_addr == NULL || _dl_cache_addr == (caddr_t) - 1)
-+              return -1;
-+
-+#if 1
-+      _dl_munmap(_dl_cache_addr, _dl_cache_size);
-+      _dl_cache_addr = NULL;
-+#endif
-+
-+      return 0;
-+}
-+
-+#endif
-+
-+/* This function's behavior must exactly match that 
-+ * in uClibc/ldso/util/ldd.c */
-+static struct elf_resolve * 
-+search_for_named_library(const char *name, int secure, const char *path_list,
-+      struct dyn_elf **rpnt)
-+{
-+      int i, count = 1;
-+      char *path, *path_n;
-+      char mylibname[2050];
-+      struct elf_resolve *tpnt1;
-+      
-+      if (path_list==NULL)
-+              return NULL;
-+
-+      /* We need a writable copy of this string */
-+      path = _dl_strdup(path_list);
-+      if (!path) {
-+              _dl_dprintf(2, "Out of memory!\n");
-+              _dl_exit(0);
-+      }
-+      
-+
-+      /* Unlike ldd.c, don't bother to eliminate double //s */
-+
-+
-+      /* Replace colons with zeros in path_list and count them */
-+      for(i=_dl_strlen(path); i > 0; i--) {
-+              if (path[i]==':') {
-+                      path[i]=0;
-+                      count++;
-+              }
-+      }
-+
-+      path_n = path;
-+      for (i = 0; i < count; i++) {
-+              _dl_strcpy(mylibname, path_n); 
-+              _dl_strcat(mylibname, "/"); 
-+              _dl_strcat(mylibname, name);
-+              if ((tpnt1 = _dl_load_elf_shared_library(secure, rpnt, mylibname)) != NULL)
-+              {
-+                      return tpnt1;
-+              }
-+              path_n += (_dl_strlen(path_n) + 1);
-+      }
-+      return NULL;
-+}
-+
-+/* Check if the named library is already loaded... */
-+struct elf_resolve *_dl_check_if_named_library_is_loaded(const char *full_libname)
-+{
-+      const char *pnt, *pnt1;
-+      struct elf_resolve *tpnt1;
-+      const char *libname, *libname2;
-+      static const char *libc = "libc.so.";
-+      static const char *aborted_wrong_lib = "%s: aborted attempt to load %s!\n";
-+
-+      pnt = libname = full_libname;
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if(_dl_debug) 
-+              _dl_dprintf(_dl_debug_file, "Checking if '%s' is already loaded\n", full_libname);
-+#endif
-+      /* quick hack to ensure mylibname buffer doesn't overflow.  don't 
-+         allow full_libname or any directory to be longer than 1024. */
-+      if (_dl_strlen(full_libname) > 1024)
-+              return NULL;
-+
-+      /* Skip over any initial initial './' and '/' stuff to 
-+       * get the short form libname with no path garbage */ 
-+      pnt1 = _dl_strrchr(pnt, '/');
-+      if (pnt1) {
-+              libname = pnt1 + 1;
-+      }
-+
-+      /* Make sure they are not trying to load the wrong C library!
-+       * This sometimes happens esp with shared libraries when the
-+       * library path is somehow wrong! */
-+#define isdigit(c)  (c >= '0' && c <= '9')
-+      if ((_dl_strncmp(libname, libc, 8) == 0) &&  _dl_strlen(libname) >=8 &&
-+                      isdigit(libname[8]))
-+      {
-+              /* Abort attempts to load glibc, libc5, etc */
-+              if ( libname[8]!='0') {
-+                      if (!_dl_trace_loaded_objects) {
-+                              _dl_dprintf(2, aborted_wrong_lib, libname, _dl_progname);
-+                              _dl_exit(1);
-+                      }
-+                      return NULL;
-+              }
-+      }
-+
-+      /* Critical step!  Weed out duplicates early to avoid
-+       * function aliasing, which wastes memory, and causes
-+       * really bad things to happen with weaks and globals. */
-+      for (tpnt1 = _dl_loaded_modules; tpnt1; tpnt1 = tpnt1->next) {
-+
-+              /* Skip over any initial initial './' and '/' stuff to 
-+               * get the short form libname with no path garbage */ 
-+              libname2 = tpnt1->libname;
-+              pnt1 = _dl_strrchr(libname2, '/');
-+              if (pnt1) {
-+                      libname2 = pnt1 + 1;
-+              }
-+
-+              if (_dl_strcmp(libname2, libname) == 0) {
-+                      /* Well, that was certainly easy */
-+                      return tpnt1;
-+              }
-+      }
-+
-+      return NULL;
-+}
-+      
-+
-+
-+/*
-+ * Used to return error codes back to dlopen et. al.
-+ */
-+
-+unsigned long _dl_error_number;
-+unsigned long _dl_internal_error_number;
-+extern char *_dl_ldsopath;
-+
-+struct elf_resolve *_dl_load_shared_library(int secure, struct dyn_elf **rpnt,
-+      struct elf_resolve *tpnt, char *full_libname)
-+{
-+      char *pnt, *pnt1;
-+      struct elf_resolve *tpnt1;
-+      char *libname;
-+
-+      _dl_internal_error_number = 0;
-+      libname = full_libname;
-+
-+      /* quick hack to ensure mylibname buffer doesn't overflow.  don't 
-+         allow full_libname or any directory to be longer than 1024. */
-+      if (_dl_strlen(full_libname) > 1024)
-+              goto goof;
-+
-+      /* Skip over any initial initial './' and '/' stuff to 
-+       * get the short form libname with no path garbage */ 
-+      pnt1 = _dl_strrchr(libname, '/');
-+      if (pnt1) {
-+              libname = pnt1 + 1;
-+      }
-+
-+      /* Critical step!  Weed out duplicates early to avoid
-+       * function aliasing, which wastes memory, and causes
-+       * really bad things to happen with weaks and globals. */
-+      if ((tpnt1=_dl_check_if_named_library_is_loaded(libname))!=NULL)
-+              return tpnt1;
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if(_dl_debug) _dl_dprintf(_dl_debug_file, "\tfind library='%s'; searching\n", libname);
-+#endif
-+      /* If the filename has any '/', try it straight and leave it at that.
-+         For IBCS2 compatibility under linux, we substitute the string 
-+         /usr/i486-sysv4/lib for /usr/lib in library names. */
-+
-+      if (libname != full_libname) {
-+#if defined (__SUPPORT_LD_DEBUG__)
-+              if(_dl_debug) _dl_dprintf(_dl_debug_file, "\ttrying file='%s'\n", full_libname);
-+#endif
-+              tpnt1 = _dl_load_elf_shared_library(secure, rpnt, full_libname);
-+              if (tpnt1) {
-+                      return tpnt1;
-+              }
-+              //goto goof;
-+      }
-+
-+      /*
-+       * The ABI specifies that RPATH is searched before LD_*_PATH or
-+       * the default path of /usr/lib.  Check in rpath directories.
-+       */
-+      for (tpnt = _dl_loaded_modules; tpnt; tpnt = tpnt->next) {
-+              if (tpnt->libtype == elf_executable) {
-+                      pnt = (char *) tpnt->dynamic_info[DT_RPATH];
-+                      if (pnt) {
-+                              pnt += (unsigned long) tpnt->loadaddr + tpnt->dynamic_info[DT_STRTAB];
-+#if defined (__SUPPORT_LD_DEBUG__)
-+                              if(_dl_debug) _dl_dprintf(_dl_debug_file, "\tsearching RPATH='%s'\n", pnt);
-+#endif
-+                              if ((tpnt1 = search_for_named_library(libname, secure, pnt, rpnt)) != NULL) 
-+                              {
-+                                  return tpnt1;
-+                              }
-+                      }
-+              }
-+      }
-+
-+      /* Check in LD_{ELF_}LIBRARY_PATH, if specified and allowed */
-+      if (_dl_library_path) {
-+#if defined (__SUPPORT_LD_DEBUG__)
-+              if(_dl_debug) _dl_dprintf(_dl_debug_file, "\tsearching LD_LIBRARY_PATH='%s'\n", _dl_library_path);
-+#endif
-+          if ((tpnt1 = search_for_named_library(libname, secure, _dl_library_path, rpnt)) != NULL) 
-+          {
-+              return tpnt1;
-+          }
-+      }
-+
-+      /*
-+       * Where should the cache be searched?  There is no such concept in the
-+       * ABI, so we have some flexibility here.  For now, search it before
-+       * the hard coded paths that follow (i.e before /lib and /usr/lib).
-+       */
-+#ifdef USE_CACHE
-+      if (_dl_cache_addr != NULL && _dl_cache_addr != (caddr_t) - 1) {
-+              int i;
-+              header_t *header = (header_t *) _dl_cache_addr;
-+              libentry_t *libent = (libentry_t *) & header[1];
-+              char *strs = (char *) &libent[header->nlibs];
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+              if(_dl_debug) _dl_dprintf(_dl_debug_file, "\tsearching cache='%s'\n", LDSO_CACHE);
-+#endif
-+              for (i = 0; i < header->nlibs; i++) {
-+                      if ((libent[i].flags == LIB_ELF ||
-+                               libent[i].flags == LIB_ELF_LIBC5) &&
-+                              _dl_strcmp(libname, strs + libent[i].sooffset) == 0 &&
-+                              (tpnt1 = _dl_load_elf_shared_library(secure, 
-+                                   rpnt, strs + libent[i].liboffset)))
-+                              return tpnt1;
-+              }
-+      }
-+#endif
-+
-+      /* Look for libraries wherever the shared library loader
-+       * was installed */
-+#if defined (__SUPPORT_LD_DEBUG__)
-+              if(_dl_debug) _dl_dprintf(_dl_debug_file, "\tsearching ldso dir='%s'\n", _dl_ldsopath);
-+#endif
-+      if ((tpnt1 = search_for_named_library(libname, secure, _dl_ldsopath, rpnt)) != NULL) 
-+      {
-+          return tpnt1;
-+      }
-+
-+
-+      /* Lastly, search the standard list of paths for the library.
-+         This list must exactly match the list in uClibc/ldso/util/ldd.c */
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if(_dl_debug) _dl_dprintf(_dl_debug_file, "\tsearching full lib path list\n");
-+#endif
-+      if ((tpnt1 = search_for_named_library(libname, secure, 
-+                      UCLIBC_RUNTIME_PREFIX "usr/X11R6/lib:"
-+                      UCLIBC_RUNTIME_PREFIX "usr/lib:"
-+                      UCLIBC_RUNTIME_PREFIX "lib:"
-+                      "/usr/lib:"
-+                      "/lib", rpnt)
-+                  ) != NULL) 
-+      {
-+          return tpnt1;
-+      }
-+
-+goof:
-+      /* Well, we shot our wad on that one.  All we can do now is punt */
-+      if (_dl_internal_error_number)
-+              _dl_error_number = _dl_internal_error_number;
-+      else
-+              _dl_error_number = LD_ERROR_NOFILE;
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if(_dl_debug) _dl_dprintf(2, "Bummer: could not find '%s'!\n", libname);
-+#endif
-+      return NULL;
-+}
-+
-+
-+/*
-+ * Read one ELF library into memory, mmap it into the correct locations and
-+ * add the symbol info to the symbol chain.  Perform any relocations that
-+ * are required.
-+ */
-+
-+struct elf_resolve *_dl_load_elf_shared_library(int secure,
-+      struct dyn_elf **rpnt, char *libname)
-+{
-+      ElfW(Ehdr) *epnt;
-+      unsigned long dynamic_addr = 0;
-+      unsigned long dynamic_size = 0;
-+      Elf32_Dyn *dpnt;
-+      struct elf_resolve *tpnt;
-+      ElfW(Phdr) *ppnt;
-+      char *status, *header;
-+      unsigned long dynamic_info[24];
-+      unsigned long *lpnt;
-+      unsigned long libaddr;
-+      unsigned long minvma = 0xffffffff, maxvma = 0;
-+      int i, flags, piclib, infile;
-+
-+      /* If this file is already loaded, skip this step */
-+      tpnt = _dl_check_hashed_files(libname);
-+      if (tpnt) {
-+              if (*rpnt) {
-+                      (*rpnt)->next = (struct dyn_elf *) _dl_malloc(sizeof(struct dyn_elf));
-+                      _dl_memset((*rpnt)->next, 0, sizeof(struct dyn_elf));
-+                      (*rpnt)->next->prev = (*rpnt);
-+                      *rpnt = (*rpnt)->next;
-+                      (*rpnt)->dyn = tpnt;
-+                      tpnt->symbol_scope = _dl_symbol_tables;
-+              }
-+              tpnt->usage_count++;
-+              tpnt->libtype = elf_lib;
-+#if defined (__SUPPORT_LD_DEBUG__)
-+              if(_dl_debug) _dl_dprintf(2, "file='%s';  already loaded\n", libname);
-+#endif
-+              return tpnt;
-+      }
-+
-+      /* If we are in secure mode (i.e. a setu/gid binary using LD_PRELOAD),
-+         we don't load the library if it isn't setuid. */
-+
-+      if (secure) {
-+              struct stat st;
-+
-+              if (_dl_stat(libname, &st) || !(st.st_mode & S_ISUID))
-+                      return NULL;
-+      }
-+
-+      libaddr = 0;
-+      infile = _dl_open(libname, O_RDONLY);
-+      if (infile < 0) {
-+#if 0
-+              /*
-+               * NO!  When we open shared libraries we may search several paths.
-+               * it is inappropriate to generate an error here.
-+               */
-+              _dl_dprintf(2, "%s: can't open '%s'\n", _dl_progname, libname);
-+#endif
-+              _dl_internal_error_number = LD_ERROR_NOFILE;
-+              return NULL;
-+      }
-+
-+       header = _dl_mmap((void *) 0, 4096, PROT_READ | PROT_WRITE,
-+              MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
-+      if (_dl_mmap_check_error(header)) {
-+              _dl_dprintf(2, "%s: can't map '%s'\n", _dl_progname, libname);
-+              _dl_internal_error_number = LD_ERROR_MMAP_FAILED;
-+              _dl_close(infile);
-+              return NULL;
-+      };
-+        
-+      _dl_read(infile, header, 4096);
-+      epnt = (ElfW(Ehdr) *) (intptr_t) header;
-+      if (epnt->e_ident[0] != 0x7f ||
-+              epnt->e_ident[1] != 'E' || 
-+              epnt->e_ident[2] != 'L' || 
-+              epnt->e_ident[3] != 'F') 
-+      {
-+              _dl_dprintf(2, "%s: '%s' is not an ELF file\n", _dl_progname,
-+                                       libname);
-+              _dl_internal_error_number = LD_ERROR_NOTELF;
-+              _dl_close(infile);
-+              _dl_munmap(header, 4096);
-+              return NULL;
-+      };
-+
-+      if ((epnt->e_type != ET_DYN) || (epnt->e_machine != MAGIC1 
-+#ifdef MAGIC2
-+                  && epnt->e_machine != MAGIC2
-+#endif
-+              )) 
-+      {
-+              _dl_internal_error_number = 
-+                  (epnt->e_type != ET_DYN ? LD_ERROR_NOTDYN : LD_ERROR_NOTMAGIC);
-+              _dl_dprintf(2, "%s: '%s' is not an ELF executable for " ELF_TARGET 
-+                      "\n", _dl_progname, libname);
-+              _dl_close(infile);
-+              _dl_munmap(header, 4096);
-+              return NULL;
-+      };
-+
-+      ppnt = (ElfW(Phdr) *)(intptr_t) & header[epnt->e_phoff];
-+
-+      piclib = 1;
-+      for (i = 0; i < epnt->e_phnum; i++) {
-+
-+              if (ppnt->p_type == PT_DYNAMIC) {
-+                      if (dynamic_addr)
-+                              _dl_dprintf(2, "%s: '%s' has more than one dynamic section\n", 
-+                                      _dl_progname, libname);
-+                      dynamic_addr = ppnt->p_vaddr;
-+                      dynamic_size = ppnt->p_filesz;
-+              };
-+
-+              if (ppnt->p_type == PT_LOAD) {
-+                      /* See if this is a PIC library. */
-+                      if (i == 0 && ppnt->p_vaddr > 0x1000000) {
-+                              piclib = 0;
-+                              minvma = ppnt->p_vaddr;
-+                      }
-+                      if (piclib && ppnt->p_vaddr < minvma) {
-+                              minvma = ppnt->p_vaddr;
-+                      }
-+                      if (((unsigned long) ppnt->p_vaddr + ppnt->p_memsz) > maxvma) {
-+                              maxvma = ppnt->p_vaddr + ppnt->p_memsz;
-+                      }
-+              }
-+              ppnt++;
-+      };
-+
-+      maxvma = (maxvma + ADDR_ALIGN) & ~ADDR_ALIGN;
-+      minvma = minvma & ~0xffffU;
-+
-+      flags = MAP_PRIVATE /*| MAP_DENYWRITE */ ;
-+      if (!piclib)
-+              flags |= MAP_FIXED;
-+
-+      status = (char *) _dl_mmap((char *) (piclib ? 0 : minvma), 
-+              maxvma - minvma, PROT_NONE, flags | MAP_ANONYMOUS, -1, 0);
-+      if (_dl_mmap_check_error(status)) {
-+              _dl_dprintf(2, "%s: can't map %s\n", _dl_progname, libname);
-+              _dl_internal_error_number = LD_ERROR_MMAP_FAILED;
-+              _dl_close(infile);
-+              _dl_munmap(header, 4096);
-+              return NULL;
-+      };
-+      libaddr = (unsigned long) status;
-+      flags |= MAP_FIXED;
-+
-+      /* Get the memory to store the library */
-+      ppnt = (ElfW(Phdr) *)(intptr_t) & header[epnt->e_phoff];
-+
-+      for (i = 0; i < epnt->e_phnum; i++) {
-+              if (ppnt->p_type == PT_LOAD) {
-+
-+                      /* See if this is a PIC library. */
-+                      if (i == 0 && ppnt->p_vaddr > 0x1000000) {
-+                              piclib = 0;
-+                              /* flags |= MAP_FIXED; */
-+                      }
-+
-+
-+
-+                      if (ppnt->p_flags & PF_W) {
-+                              unsigned long map_size;
-+                              char *cpnt;
-+
-+                              status = (char *) _dl_mmap((char *) ((piclib ? libaddr : 0) + 
-+                                      (ppnt->p_vaddr & PAGE_ALIGN)), (ppnt->p_vaddr & ADDR_ALIGN) 
-+                                      + ppnt->p_filesz, LXFLAGS(ppnt->p_flags), flags, infile, 
-+                                      ppnt->p_offset & OFFS_ALIGN);
-+
-+                              if (_dl_mmap_check_error(status)) {
-+                                      _dl_dprintf(2, "%s: can't map '%s'\n", 
-+                                              _dl_progname, libname);
-+                                      _dl_internal_error_number = LD_ERROR_MMAP_FAILED;
-+                                      _dl_munmap((char *) libaddr, maxvma - minvma);
-+                                      _dl_close(infile);
-+                                      _dl_munmap(header, 4096);
-+                                      return NULL;
-+                              };
-+
-+                              /* Pad the last page with zeroes. */
-+                              cpnt = (char *) (status + (ppnt->p_vaddr & ADDR_ALIGN) +
-+                                                        ppnt->p_filesz);
-+                              while (((unsigned long) cpnt) & ADDR_ALIGN)
-+                                      *cpnt++ = 0;
-+
-+                              /* I am not quite sure if this is completely
-+                               * correct to do or not, but the basic way that
-+                               * we handle bss segments is that we mmap
-+                               * /dev/zero if there are any pages left over
-+                               * that are not mapped as part of the file */
-+
-+                              map_size = (ppnt->p_vaddr + ppnt->p_filesz + ADDR_ALIGN) & PAGE_ALIGN;
-+
-+                              if (map_size < ppnt->p_vaddr + ppnt->p_memsz)
-+                                      status = (char *) _dl_mmap((char *) map_size + 
-+                                              (piclib ? libaddr : 0), 
-+                                              ppnt->p_vaddr + ppnt->p_memsz - map_size, 
-+                                              LXFLAGS(ppnt->p_flags), flags | MAP_ANONYMOUS, -1, 0);
-+                      } else
-+                              status = (char *) _dl_mmap((char *) (ppnt->p_vaddr & PAGE_ALIGN) 
-+                                      + (piclib ? libaddr : 0), (ppnt->p_vaddr & ADDR_ALIGN) + 
-+                                      ppnt->p_filesz, LXFLAGS(ppnt->p_flags), flags, 
-+                                      infile, ppnt->p_offset & OFFS_ALIGN);
-+                      if (_dl_mmap_check_error(status)) {
-+                              _dl_dprintf(2, "%s: can't map '%s'\n", _dl_progname, libname);
-+                              _dl_internal_error_number = LD_ERROR_MMAP_FAILED;
-+                              _dl_munmap((char *) libaddr, maxvma - minvma);
-+                              _dl_close(infile);
-+                              _dl_munmap(header, 4096);
-+                              return NULL;
-+                      };
-+
-+                      /* if(libaddr == 0 && piclib) {
-+                         libaddr = (unsigned long) status;
-+                         flags |= MAP_FIXED;
-+                         }; */
-+              };
-+              ppnt++;
-+      };
-+      _dl_close(infile);
-+
-+      /* For a non-PIC library, the addresses are all absolute */
-+      if (piclib) {
-+              dynamic_addr += (unsigned long) libaddr;
-+      }
-+
-+      /* 
-+       * OK, the ELF library is now loaded into VM in the correct locations
-+       * The next step is to go through and do the dynamic linking (if needed).
-+       */
-+
-+      /* Start by scanning the dynamic section to get all of the pointers */
-+
-+      if (!dynamic_addr) {
-+              _dl_internal_error_number = LD_ERROR_NODYNAMIC;
-+              _dl_dprintf(2, "%s: '%s' is missing a dynamic section\n", 
-+                      _dl_progname, libname);
-+                      _dl_munmap(header, 4096);
-+              return NULL;
-+      }
-+
-+      dpnt = (Elf32_Dyn *) dynamic_addr;
-+
-+      dynamic_size = dynamic_size / sizeof(Elf32_Dyn);
-+      _dl_memset(dynamic_info, 0, sizeof(dynamic_info));
-+
-+#if defined(__mips__)
-+      {
-+              
-+              int indx = 1;
-+              Elf32_Dyn *dpnt = (Elf32_Dyn *) dynamic_addr;
-+
-+              while(dpnt->d_tag) {
-+                      dpnt++;
-+                      indx++;
-+              }
-+              dynamic_size = indx;
-+      }
-+#endif
-+
-+      {
-+              unsigned long indx;
-+
-+              for (indx = 0; indx < dynamic_size; indx++) 
-+              {
-+                      if (dpnt->d_tag > DT_JMPREL) {
-+                              dpnt++;
-+                              continue;
-+                      }
-+                      dynamic_info[dpnt->d_tag] = dpnt->d_un.d_val;
-+                      if (dpnt->d_tag == DT_TEXTREL)
-+                              dynamic_info[DT_TEXTREL] = 1;
-+                      dpnt++;
-+              };
-+      }
-+
-+      /* If the TEXTREL is set, this means that we need to make the pages
-+         writable before we perform relocations.  Do this now. They get set
-+         back again later. */
-+
-+      if (dynamic_info[DT_TEXTREL]) {
-+#ifndef FORCE_SHAREABLE_TEXT_SEGMENTS
-+              ppnt = (ElfW(Phdr) *)(intptr_t) & header[epnt->e_phoff];
-+              for (i = 0; i < epnt->e_phnum; i++, ppnt++) {
-+                      if (ppnt->p_type == PT_LOAD && !(ppnt->p_flags & PF_W))
-+                              _dl_mprotect((void *) ((piclib ? libaddr : 0) + 
-+                                          (ppnt->p_vaddr & PAGE_ALIGN)), 
-+                                      (ppnt->p_vaddr & ADDR_ALIGN) + (unsigned long) ppnt->p_filesz, 
-+                                      PROT_READ | PROT_WRITE | PROT_EXEC);
-+              }
-+#else
-+              _dl_dprintf(_dl_debug_file, "Can't modify %s's text section. Use GCC option -fPIC for shared objects, please.\n",libname);
-+              _dl_exit(1);
-+#endif                
-+      }
-+
-+      tpnt = _dl_add_elf_hash_table(libname, (char *) libaddr, dynamic_info, 
-+              dynamic_addr, dynamic_size);
-+
-+      tpnt->ppnt = (ElfW(Phdr) *)(intptr_t) (tpnt->loadaddr + epnt->e_phoff);
-+      tpnt->n_phent = epnt->e_phnum;
-+
-+      /*
-+       * Add this object into the symbol chain
-+       */
-+      if (*rpnt) {
-+              (*rpnt)->next = (struct dyn_elf *) _dl_malloc(sizeof(struct dyn_elf));
-+              _dl_memset((*rpnt)->next, 0, sizeof(struct dyn_elf));
-+              (*rpnt)->next->prev = (*rpnt);
-+              *rpnt = (*rpnt)->next;
-+              (*rpnt)->dyn = tpnt;
-+              tpnt->symbol_scope = _dl_symbol_tables;
-+      }
-+      tpnt->usage_count++;
-+      tpnt->libtype = elf_lib;
-+
-+      /*
-+       * OK, the next thing we need to do is to insert the dynamic linker into
-+       * the proper entry in the GOT so that the PLT symbols can be properly
-+       * resolved. 
-+       */
-+
-+      lpnt = (unsigned long *) dynamic_info[DT_PLTGOT];
-+
-+      if (lpnt) {
-+              lpnt = (unsigned long *) (dynamic_info[DT_PLTGOT] +
-+                      ((int) libaddr));
-+              INIT_GOT(lpnt, tpnt);
-+      };
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if(_dl_debug) {
-+              _dl_dprintf(2, "\n\tfile='%s';  generating link map\n", libname);
-+              _dl_dprintf(2, "\t\tdynamic: %x  base: %x   size: %x\n", 
-+                              dynamic_addr, libaddr, dynamic_size);
-+              _dl_dprintf(2, "\t\t  entry: %x  phdr: %x  phnum: %d\n\n", 
-+                              epnt->e_entry + libaddr, tpnt->ppnt, tpnt->n_phent);
-+
-+      }
-+#endif
-+      _dl_munmap(header, 4096);
-+
-+      return tpnt;
-+}
-+
-+/* Ugly, ugly.  Some versions of the SVr4 linker fail to generate COPY
-+   relocations for global variables that are present both in the image and
-+   the shared library.  Go through and do it manually.  If the images
-+   are guaranteed to be generated by a trustworthy linker, then this
-+   step can be skipped. */
-+
-+int _dl_copy_fixups(struct dyn_elf *rpnt)
-+{
-+      int goof = 0;
-+      struct elf_resolve *tpnt;
-+
-+      if (rpnt->next)
-+              goof += _dl_copy_fixups(rpnt->next);
-+      else
-+              return 0;
-+
-+      tpnt = rpnt->dyn;
-+
-+      if (tpnt->init_flag & COPY_RELOCS_DONE)
-+              return goof;
-+      tpnt->init_flag |= COPY_RELOCS_DONE;
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if(_dl_debug) _dl_dprintf(_dl_debug_file,"\nrelocation copy fixups: %s", tpnt->libname);        
-+#endif    
-+
-+#ifdef ELF_USES_RELOCA
-+      goof += _dl_parse_copy_information(rpnt, 
-+              tpnt->dynamic_info[DT_RELA], tpnt->dynamic_info[DT_RELASZ], 0);
-+
-+#else
-+      goof += _dl_parse_copy_information(rpnt, tpnt->dynamic_info[DT_REL], 
-+              tpnt->dynamic_info[DT_RELSZ], 0);
-+
-+#endif
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if(_dl_debug) _dl_dprintf(_dl_debug_file,"\nrelocation copy fixups: %s; finished\n\n", tpnt->libname);  
-+#endif    
-+      return goof;
-+}
-+
-+/* Minimal printf which handles only %s, %d, and %x */
-+void _dl_dprintf(int fd, const char *fmt, ...)
-+{
-+      int num;
-+      va_list args;
-+      char *start, *ptr, *string;
-+      static char *buf;
-+
-+      buf = _dl_mmap((void *) 0, 4096, PROT_READ | PROT_WRITE,
-+              MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
-+      if (_dl_mmap_check_error(buf)) {
-+                      _dl_dprintf(2, "%s: mmap of a spare page failed!\n", _dl_progname);
-+                      _dl_exit(20);
-+      }
-+
-+      start = ptr = buf;
-+
-+      if (!fmt)
-+              return;
-+
-+      if (_dl_strlen(fmt) >= (sizeof(buf) - 1))
-+              _dl_write(fd, "(overflow)\n", 10);
-+
-+      _dl_strcpy(buf, fmt);
-+      va_start(args, fmt);
-+
-+      while (start) {
-+              while (*ptr != '%' && *ptr) {
-+                      ptr++;
-+              }
-+
-+              if (*ptr == '%') {
-+                      *ptr++ = '\0';
-+                      _dl_write(fd, start, _dl_strlen(start));
-+
-+                      switch (*ptr++) {
-+                      case 's':
-+                              string = va_arg(args, char *);
-+
-+                              if (!string)
-+                                      _dl_write(fd, "(null)", 6);
-+                              else
-+                                      _dl_write(fd, string, _dl_strlen(string));
-+                              break;
-+
-+                      case 'i':
-+                      case 'd':
-+                      {
-+                              char tmp[22];
-+                              num = va_arg(args, int);
-+
-+                              string = _dl_simple_ltoa(tmp, num);
-+                              _dl_write(fd, string, _dl_strlen(string));
-+                              break;
-+                      }
-+                      case 'x':
-+                      case 'X':
-+                      {
-+                              char tmp[22];
-+                              num = va_arg(args, int);
-+
-+                              string = _dl_simple_ltoahex(tmp, num);
-+                              _dl_write(fd, string, _dl_strlen(string));
-+                              break;
-+                      }
-+                      default:
-+                              _dl_write(fd, "(null)", 6);
-+                              break;
-+                      }
-+
-+                      start = ptr;
-+              } else {
-+                      _dl_write(fd, start, _dl_strlen(start));
-+                      start = NULL;
-+              }
-+      }
-+      _dl_munmap(buf, 4096);
-+      return;
-+}
-+
-+char *_dl_strdup(const char *string)
-+{
-+      char *retval;
-+      int len;
-+
-+      len = _dl_strlen(string);
-+      retval = _dl_malloc(len + 1);
-+      _dl_strcpy(retval, string);
-+      return retval;
-+}
-+
-+void *(*_dl_malloc_function) (size_t size) = NULL;
-+void *_dl_malloc(int size)
-+{
-+      void *retval;
-+
-+#if 0
-+#ifdef __SUPPORT_LD_DEBUG_EARLY__
-+      _dl_dprintf(2, "malloc: request for %d bytes\n", size);
-+#endif
-+#endif
-+
-+      if (_dl_malloc_function)
-+              return (*_dl_malloc_function) (size);
-+
-+      if (_dl_malloc_addr - _dl_mmap_zero + size > 4096) {
-+#ifdef __SUPPORT_LD_DEBUG_EARLY__
-+              _dl_dprintf(2, "malloc: mmapping more memory\n");
-+#endif
-+              _dl_mmap_zero = _dl_malloc_addr = _dl_mmap((void *) 0, size, 
-+                              PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
-+              if (_dl_mmap_check_error(_dl_mmap_zero)) {
-+                      _dl_dprintf(2, "%s: mmap of a spare page failed!\n", _dl_progname);
-+                      _dl_exit(20);
-+              }
-+      }
-+      retval = _dl_malloc_addr;
-+      _dl_malloc_addr += size;
-+
-+      /*
-+       * Align memory to 4 byte boundary.  Some platforms require this, others
-+       * simply get better performance.
-+       */
-+      _dl_malloc_addr = (char *) (((unsigned long) _dl_malloc_addr + 3) & ~(3));
-+      return retval;
-+}
-+
-+int _dl_fixup(struct elf_resolve *tpnt, int flag)
-+{
-+      int goof = 0;
-+
-+      if (tpnt->next)
-+              goof += _dl_fixup(tpnt->next, flag);
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if(_dl_debug) _dl_dprintf(_dl_debug_file,"\nrelocation processing: %s", tpnt->libname); 
-+#endif    
-+      
-+      if (tpnt->dynamic_info[DT_REL]) {
-+#ifdef ELF_USES_RELOCA
-+#if defined (__SUPPORT_LD_DEBUG__)
-+              if(_dl_debug) _dl_dprintf(2, "%s: can't handle REL relocation records\n", _dl_progname);
-+#endif    
-+              goof++;
-+              return goof;
-+#else
-+              if (tpnt->init_flag & RELOCS_DONE)
-+                      return goof;
-+              tpnt->init_flag |= RELOCS_DONE;
-+              goof += _dl_parse_relocation_information(tpnt, 
-+                              tpnt->dynamic_info[DT_REL], 
-+                              tpnt->dynamic_info[DT_RELSZ], 0);
-+#endif
-+      }
-+      if (tpnt->dynamic_info[DT_RELA]) {
-+#ifndef ELF_USES_RELOCA
-+#if defined (__SUPPORT_LD_DEBUG__)
-+              if(_dl_debug) _dl_dprintf(2, "%s: can't handle RELA relocation records\n", _dl_progname);
-+#endif    
-+              goof++;
-+              return goof;
-+#else
-+              if (tpnt->init_flag & RELOCS_DONE)
-+                      return goof;
-+              tpnt->init_flag |= RELOCS_DONE;
-+              goof += _dl_parse_relocation_information(tpnt, 
-+                              tpnt->dynamic_info[DT_RELA], 
-+                              tpnt->dynamic_info[DT_RELASZ], 0);
-+#endif
-+      }
-+      if (tpnt->dynamic_info[DT_JMPREL]) {
-+              if (tpnt->init_flag & JMP_RELOCS_DONE)
-+                      return goof;
-+              tpnt->init_flag |= JMP_RELOCS_DONE;
-+              if (flag & RTLD_LAZY) {
-+                      _dl_parse_lazy_relocation_information(tpnt, 
-+                                      tpnt->dynamic_info[DT_JMPREL], 
-+                                      tpnt->dynamic_info [DT_PLTRELSZ], 0);
-+              } else {
-+                      goof += _dl_parse_relocation_information(tpnt, 
-+                                      tpnt->dynamic_info[DT_JMPREL], 
-+                                      tpnt->dynamic_info[DT_PLTRELSZ], 0);
-+              }
-+      }
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if(_dl_debug) {
-+              _dl_dprintf(_dl_debug_file,"\nrelocation processing: %s", tpnt->libname);     
-+              _dl_dprintf(_dl_debug_file,"; finished\n\n");
-+      }
-+#endif    
-+      return goof;
-+}
-+
-+
-diff -urN uClibc/ldso-0.9.24/ldso/sh/boot1_arch.h uClibc.ldso.24/ldso-0.9.24/ldso/sh/boot1_arch.h
---- uClibc/ldso-0.9.24/ldso/sh/boot1_arch.h    1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/sh/boot1_arch.h    2002-11-03 08:12:29.000000000 -0600
-@@ -0,0 +1,22 @@
-+/* Any assmbly language/system dependent hacks needed to setup boot1.c so it
-+ * will work as expected and cope with whatever platform specific wierdness is
-+ * needed for this architecture.  */
-+
-+asm("" \
-+"     .text\n"                        \
-+"     .globl  _dl_boot\n"             \
-+"_dl_boot:\n"                         \
-+"     mov     r15, r4\n"              \
-+"     mov.l   .L_dl_boot2, r0\n"      \
-+"     bsrf    r0\n"                   \
-+"     add     #4, r4\n"               \
-+".jmp_loc:\n"                         \
-+"     jmp     @r0\n"                  \
-+"      mov    #0, r4  !call _start with arg == 0\n" \
-+".L_dl_boot2:\n"                      \
-+"     .long   _dl_boot2-.jmp_loc\n"   \
-+"     .previous\n"                    \
-+);
-+
-+#define _dl_boot _dl_boot2
-+#define LD_BOOT(X)   static void *  __attribute__ ((unused)) _dl_boot (X)
-diff -urN uClibc/ldso-0.9.24/ldso/sh/elfinterp.c uClibc.ldso.24/ldso-0.9.24/ldso/sh/elfinterp.c
---- uClibc/ldso-0.9.24/ldso/sh/elfinterp.c     1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/sh/elfinterp.c     2003-09-11 05:26:16.000000000 -0500
-@@ -0,0 +1,427 @@
-+/* vi: set sw=4 ts=4: */
-+/* SuperH ELF shared library loader suppport
-+ *
-+ * Copyright (C) 2002, Stefan Allius <allius@atecom.com> and 
-+ *                     Eddie C. Dost <ecd@atecom.com>
-+ *
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions and the following disclaimer.
-+ * 2. The name of the above contributors may not be
-+ *    used to endorse or promote products derived from this software
-+ *    without specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE
-+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+ * SUCH DAMAGE.
-+ */
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+static const char *_dl_reltypes_tab[] =
-+{
-+  [0] "R_SH_NONE",    "R_SH_DIR32",   "R_SH_REL32",   "R_SH_DIR8WPN",
-+  [4] "R_SH_IND12W",  "R_SH_DIR8WPL", "R_SH_DIR8WPZ", "R_SH_DIR8BP",
-+  [8] "R_SH_DIR8W",   "R_SH_DIR8L",
-+ [25] "R_SH_SWITCH16","R_SH_SWITCH32","R_SH_USES",
-+ [28] "R_SH_COUNT",   "R_SH_ALIGN",   "R_SH_CODE",    "R_SH_DATA",
-+ [32] "R_SH_LABEL",   "R_SH_SWITCH8", "R_SH_GNU_VTINHERIT","R_SH_GNU_VTENTRY",
-+[160] "R_SH_GOT32",   "R_SH_PLT32",   "R_SH_COPY",    "R_SH_GLOB_DAT",
-+[164] "R_SH_JMP_SLOT","R_SH_RELATIVE","R_SH_GOTOFF",  "R_SH_GOTPC",
-+};
-+
-+static const char *
-+_dl_reltypes(int type)
-+{
-+  static char buf[22];  
-+  const char *str;
-+  
-+  if (type >= (int)(sizeof (_dl_reltypes_tab)/sizeof(_dl_reltypes_tab[0])) ||
-+      NULL == (str = _dl_reltypes_tab[type]))
-+  {
-+    str =_dl_simple_ltoa( buf, (unsigned long)(type));
-+  }
-+  return str;
-+}
-+
-+static 
-+void debug_sym(Elf32_Sym *symtab,char *strtab,int symtab_index)
-+{
-+  if(_dl_debug_symbols)
-+  {
-+    if(symtab_index){
-+      _dl_dprintf(_dl_debug_file, "\n%s\tvalue=%x\tsize=%x\tinfo=%x\tother=%x\tshndx=%x",
-+                strtab + symtab[symtab_index].st_name,
-+                symtab[symtab_index].st_value,
-+                symtab[symtab_index].st_size,
-+                symtab[symtab_index].st_info,
-+                symtab[symtab_index].st_other,
-+                symtab[symtab_index].st_shndx);
-+    }
-+  }
-+}
-+
-+static void debug_reloc(Elf32_Sym *symtab,char *strtab, ELF_RELOC *rpnt)
-+{
-+  if(_dl_debug_reloc)
-+  {
-+    int symtab_index;
-+    const char *sym;
-+    symtab_index = ELF32_R_SYM(rpnt->r_info);
-+    sym = symtab_index ? strtab + symtab[symtab_index].st_name : "sym=0x0";
-+    
-+  if(_dl_debug_symbols)
-+        _dl_dprintf(_dl_debug_file, "\n\t");
-+  else
-+        _dl_dprintf(_dl_debug_file, "\n%s\n\t", sym);
-+    
-+#ifdef ELF_USES_RELOCA
-+    _dl_dprintf(_dl_debug_file, "%s\toffset=%x\taddend=%x",
-+              _dl_reltypes(ELF32_R_TYPE(rpnt->r_info)),
-+              rpnt->r_offset,
-+              rpnt->r_addend);
-+#else
-+    _dl_dprintf(_dl_debug_file, "%s\toffset=%x\n",
-+              _dl_reltypes(ELF32_R_TYPE(rpnt->r_info)),
-+              rpnt->r_offset);
-+#endif
-+  }
-+}
-+#endif
-+
-+/* Program to load an ELF binary on a linux system, and run it.
-+   References to symbols in sharable libraries can be resolved by either
-+   an ELF sharable library or a linux style of shared library. */
-+
-+/* Disclaimer:  I have never seen any AT&T source code for SVr4, nor have
-+   I ever taken any courses on internals.  This program was developed using
-+   information available through the book "UNIX SYSTEM V RELEASE 4,
-+   Programmers guide: Ansi C and Programming Support Tools", which did
-+   a more than adequate job of explaining everything required to get this
-+   working. */
-+
-+extern int _dl_linux_resolve(void);
-+
-+unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry)
-+{
-+      int reloc_type;
-+      ELF_RELOC *this_reloc;
-+      char *strtab;
-+      Elf32_Sym *symtab;
-+      int symtab_index;
-+      char *rel_addr;
-+      char *new_addr;
-+      char **got_addr;
-+      unsigned long instr_addr;
-+      char *symname;
-+
-+      rel_addr = (char *) (tpnt->dynamic_info[DT_JMPREL] + tpnt->loadaddr);
-+
-+      this_reloc = (ELF_RELOC *)(intptr_t)(rel_addr + reloc_entry);
-+      reloc_type = ELF32_R_TYPE(this_reloc->r_info);
-+      symtab_index = ELF32_R_SYM(this_reloc->r_info);
-+
-+      symtab = (Elf32_Sym *)(intptr_t) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
-+      strtab = (char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
-+      symname = strtab + symtab[symtab_index].st_name;
-+
-+      if (reloc_type != R_SH_JMP_SLOT) {
-+        _dl_dprintf(2, "%s: Incorrect relocation type in jump relocations\n", 
-+                     _dl_progname);
-+        _dl_exit(1);
-+      }
-+      
-+      /* Address of jump instruction to fix up */
-+      instr_addr = ((unsigned long) this_reloc->r_offset + 
-+                      (unsigned long) tpnt->loadaddr);
-+      got_addr = (char **) instr_addr;
-+
-+
-+      /* Get the address of the GOT entry */
-+      new_addr = _dl_find_hash(symname, tpnt->symbol_scope, tpnt, resolver);
-+      if (!new_addr) {
-+              new_addr = _dl_find_hash(symname, NULL, NULL, resolver);
-+              if (new_addr) {
-+                      return (unsigned long) new_addr;
-+              }
-+              
-+              _dl_dprintf(2, "%s: can't resolve symbol '%s'\n", _dl_progname, symname);
-+              _dl_exit(1);
-+      }
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if ((unsigned long) got_addr < 0x20000000)
-+      {
-+              if (_dl_debug_bindings)
-+              {
-+                      _dl_dprintf(_dl_debug_file, "\nresolve function: %s", symname);
-+                      if(_dl_debug_detail) _dl_dprintf(_dl_debug_file, 
-+                                      "\n\tpatched %x ==> %x @ %x\n", *got_addr, new_addr, got_addr);
-+              }
-+      }
-+      if (!_dl_debug_nofixups) {
-+              *got_addr = new_addr;
-+      }
-+#else
-+      *got_addr = new_addr;
-+#endif
-+
-+      return (unsigned long) new_addr;
-+}
-+
-+
-+static int
-+_dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope,
-+        unsigned long rel_addr, unsigned long rel_size,
-+        int (*reloc_fnc) (struct elf_resolve *tpnt, struct dyn_elf *scope,
-+                          ELF_RELOC *rpnt, Elf32_Sym *symtab, char *strtab))
-+{
-+      unsigned int i;
-+      char *strtab;
-+      Elf32_Sym *symtab;
-+      ELF_RELOC *rpnt;
-+      int symtab_index;
-+      /* Now parse the relocation information */
-+
-+      rpnt = (ELF_RELOC *)(intptr_t) (rel_addr + tpnt->loadaddr);
-+      rel_size = rel_size / sizeof(ELF_RELOC);
-+
-+      symtab = (Elf32_Sym *)(intptr_t) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
-+      strtab = (char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
-+
-+        for (i = 0; i < rel_size; i++, rpnt++) {
-+              int res;
-+          
-+              symtab_index = ELF32_R_SYM(rpnt->r_info);
-+              
-+              /* When the dynamic linker bootstrapped itself, it resolved some symbols.
-+                 Make sure we do not do them again */
-+              if (!symtab_index && tpnt->libtype == program_interpreter)
-+                      continue;
-+              if (symtab_index && tpnt->libtype == program_interpreter &&
-+                  _dl_symbol(strtab + symtab[symtab_index].st_name))
-+                      continue;
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+              debug_sym(symtab,strtab,symtab_index);
-+              debug_reloc(symtab,strtab,rpnt);
-+#endif
-+
-+              res = reloc_fnc (tpnt, scope, rpnt, symtab, strtab);
-+
-+              if (res==0) continue;
-+
-+              _dl_dprintf(2, "\n%s: ",_dl_progname);
-+              
-+              if (symtab_index)
-+                _dl_dprintf(2, "symbol '%s': ", strtab + symtab[symtab_index].st_name);
-+                
-+              if (res <0)
-+              {
-+                      int reloc_type = ELF32_R_TYPE(rpnt->r_info);
-+#if defined (__SUPPORT_LD_DEBUG__)
-+                      _dl_dprintf(2, "can't handle reloc type %s\n ", _dl_reltypes(reloc_type));
-+#else
-+                      _dl_dprintf(2, "can't handle reloc type %x\n", reloc_type);
-+#endif                        
-+                      _dl_exit(-res);
-+              }
-+              else if (res >0)
-+              {
-+                      _dl_dprintf(2, "can't resolve symbol\n");
-+                      return res;
-+              }
-+        }
-+        return 0;
-+}
-+
-+
-+static int
-+_dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope,
-+            ELF_RELOC *rpnt, Elf32_Sym *symtab, char *strtab)
-+{
-+        int reloc_type;
-+      int symtab_index;
-+      char *symname;
-+      unsigned long *reloc_addr;
-+      unsigned long symbol_addr;
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      unsigned long old_val;
-+#endif
-+  
-+      reloc_addr = (unsigned long *)(intptr_t) (tpnt->loadaddr + (unsigned long) rpnt->r_offset);
-+      reloc_type = ELF32_R_TYPE(rpnt->r_info);
-+      symtab_index = ELF32_R_SYM(rpnt->r_info);
-+      symbol_addr = 0;
-+      symname      = strtab + symtab[symtab_index].st_name;
-+
-+      if (symtab_index) {
-+
-+
-+              symbol_addr = (unsigned long) _dl_find_hash(symname, scope, 
-+                              (reloc_type == R_SH_JMP_SLOT ? tpnt : NULL), symbolrel);
-+
-+              /*
-+               * We want to allow undefined references to weak symbols - this might
-+               * have been intentional.  We should not be linking local symbols
-+               * here, so all bases should be covered.
-+               */
-+              if (!symbol_addr && ELF32_ST_BIND(symtab[symtab_index].st_info) == STB_GLOBAL) {
-+#if defined (__SUPPORT_LD_DEBUG__)
-+                      _dl_dprintf(2, "\tglobal symbol '%s' already defined in '%s'\n",
-+                                      symname, tpnt->libname);
-+#endif
-+                      return 0;
-+              }
-+      }
-+
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      old_val = *reloc_addr;
-+#endif
-+          switch (reloc_type) {
-+              case R_SH_NONE:
-+                      break;
-+              case R_SH_COPY:
-+                      /* handled later on */
-+                      break;
-+              case R_SH_DIR32:
-+              case R_SH_GLOB_DAT:
-+              case R_SH_JMP_SLOT:
-+                      *reloc_addr = symbol_addr + rpnt->r_addend;
-+                      break;
-+              case R_SH_REL32:
-+                      *reloc_addr = symbol_addr + rpnt->r_addend -
-+                                      (unsigned long) reloc_addr;
-+                      break;
-+              case R_SH_RELATIVE:
-+                      *reloc_addr = (unsigned long) tpnt->loadaddr + rpnt->r_addend;
-+                      break;
-+              default:
-+                      return -1; /*call _dl_exit(1) */
-+          }
-+#if defined (__SUPPORT_LD_DEBUG__)
-+          if(_dl_debug_reloc && _dl_debug_detail)
-+              _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x", old_val, *reloc_addr, reloc_addr);
-+#endif
-+
-+      return 0;
-+}
-+ 
-+        
-+static int
-+_dl_do_lazy_reloc (struct elf_resolve *tpnt, struct dyn_elf *scope,
-+                 ELF_RELOC *rpnt, Elf32_Sym *symtab, char *strtab)
-+{
-+      int reloc_type;
-+      unsigned long *reloc_addr;
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      unsigned long old_val;
-+#endif
-+      (void)scope;
-+      (void)symtab;
-+      (void)strtab;
-+
-+      reloc_addr = (unsigned long *)(intptr_t) (tpnt->loadaddr + (unsigned long) rpnt->r_offset);
-+      reloc_type = ELF32_R_TYPE(rpnt->r_info);
-+  
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      old_val = *reloc_addr;
-+#endif
-+          switch (reloc_type) {
-+            case R_SH_NONE:
-+              break;
-+            case R_SH_JMP_SLOT:
-+              *reloc_addr += (unsigned long) tpnt->loadaddr;
-+              break;
-+            default:
-+              return -1; /*call _dl_exit(1) */
-+          }
-+#if defined (__SUPPORT_LD_DEBUG__)
-+          if(_dl_debug_reloc && _dl_debug_detail)
-+              _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x", old_val, *reloc_addr, reloc_addr);
-+#endif
-+      return 0;
-+      
-+}
-+
-+/* This is done as a separate step, because there are cases where
-+   information is first copied and later initialized.  This results in
-+   the wrong information being copied.  Someone at Sun was complaining about
-+   a bug in the handling of _COPY by SVr4, and this may in fact be what he
-+   was talking about.  Sigh. */
-+
-+/* No, there are cases where the SVr4 linker fails to emit COPY relocs
-+   at all */
-+static int
-+_dl_do_copy (struct elf_resolve *tpnt, struct dyn_elf *scope,
-+           ELF_RELOC *rpnt, Elf32_Sym *symtab, char *strtab)
-+{
-+        int reloc_type;
-+      int symtab_index;
-+      unsigned long *reloc_addr;
-+      unsigned long symbol_addr;
-+      int goof = 0;
-+      char*symname;
-+        
-+      reloc_addr = (unsigned long *)(intptr_t) (tpnt->loadaddr + (unsigned long) rpnt->r_offset);
-+      reloc_type = ELF32_R_TYPE(rpnt->r_info);
-+      if (reloc_type != R_SH_COPY) 
-+          return 0;
-+      symtab_index = ELF32_R_SYM(rpnt->r_info);
-+      symbol_addr = 0;
-+      symname      = strtab + symtab[symtab_index].st_name;
-+              
-+      if (symtab_index) {
-+
-+              symbol_addr = (unsigned long) _dl_find_hash(symname, scope, NULL, copyrel);
-+              if (!symbol_addr) goof++;
-+      }
-+      if (!goof) {
-+#if defined (__SUPPORT_LD_DEBUG__)
-+              if(_dl_debug_move)
-+                _dl_dprintf(_dl_debug_file,"\n%s move %x bytes from %x to %x",
-+                           symname, symtab[symtab_index].st_size,
-+                           symbol_addr, symtab[symtab_index].st_value);
-+#endif
-+              _dl_memcpy((char *) symtab[symtab_index].st_value, 
-+                      (char *) symbol_addr, symtab[symtab_index].st_size);
-+      }
-+
-+      return goof;
-+}
-+
-+
-+void _dl_parse_lazy_relocation_information(struct elf_resolve *tpnt, 
-+      unsigned long rel_addr, unsigned long rel_size, int type)
-+{
-+      (void) type;
-+      (void)_dl_parse(tpnt, NULL, rel_addr, rel_size, _dl_do_lazy_reloc);
-+}
-+
-+int _dl_parse_relocation_information(struct elf_resolve *tpnt, 
-+      unsigned long rel_addr, unsigned long rel_size, int type)
-+{
-+      (void) type;
-+      return _dl_parse(tpnt, tpnt->symbol_scope, rel_addr, rel_size, _dl_do_reloc);
-+}
-+
-+int _dl_parse_copy_information(struct dyn_elf *xpnt, unsigned long rel_addr, 
-+      unsigned long rel_size, int type)
-+{
-+      (void) type;
-+      return _dl_parse(xpnt->dyn, xpnt->next, rel_addr, rel_size, _dl_do_copy);
-+}
-+
-+
-diff -urN uClibc/ldso-0.9.24/ldso/sh/ld_syscalls.h uClibc.ldso.24/ldso-0.9.24/ldso/sh/ld_syscalls.h
---- uClibc/ldso-0.9.24/ldso/sh/ld_syscalls.h   1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/sh/ld_syscalls.h   2002-08-09 07:20:19.000000000 -0500
-@@ -0,0 +1,7 @@
-+/* Define the __set_errno macro as nothing so that we don't bother
-+ * setting errno, which is important since we make system calls
-+ * before the errno symbol is dynamicly linked. */
-+
-+#define __set_errno(X) {(void)(X);}
-+#include "sys/syscall.h"
-+
-diff -urN uClibc/ldso-0.9.24/ldso/sh/ld_sysdep.h uClibc.ldso.24/ldso-0.9.24/ldso/sh/ld_sysdep.h
---- uClibc/ldso-0.9.24/ldso/sh/ld_sysdep.h     1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/sh/ld_sysdep.h     2002-11-07 20:18:16.000000000 -0600
-@@ -0,0 +1,144 @@
-+/*
-+ * Various assmbly language/system dependent  hacks that are required
-+ * so that we can minimize the amount of platform specific code.
-+ */
-+
-+/* 
-+ * Define this if the system uses RELOCA.
-+ */
-+#define ELF_USES_RELOCA
-+
-+/*
-+ * Get a pointer to the argv array.  On many platforms this can be just
-+ * the address if the first argument, on other platforms we need to
-+ * do something a little more subtle here.
-+ */
-+#define GET_ARGV(ARGVP, ARGS) ARGVP = ((unsigned long*)   ARGS)
-+
-+/*
-+ * Initialization sequence for a GOT.
-+ */
-+#define INIT_GOT(GOT_BASE,MODULE) \
-+{                             \
-+  GOT_BASE[2] = (unsigned long) _dl_linux_resolve; \
-+  GOT_BASE[1] = (unsigned long) (MODULE); \
-+}
-+
-+/*
-+ * Here is a macro to perform a relocation.  This is only used when
-+ * bootstrapping the dynamic loader.  RELP is the relocation that we
-+ * are performing, REL is the pointer to the address we are relocating.
-+ * SYMBOL is the symbol involved in the relocation, and LOAD is the
-+ * load address.
-+ */
-+#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD)         \
-+      switch(ELF32_R_TYPE((RELP)->r_info)){                   \
-+      case R_SH_REL32:                                        \
-+              *(REL)  = (SYMBOL) + (RELP)->r_addend           \
-+                          - (unsigned long)(REL);             \
-+              break;                                          \
-+      case R_SH_DIR32:                                        \
-+      case R_SH_GLOB_DAT:                                     \
-+      case R_SH_JMP_SLOT:                                     \
-+              *(REL)  = (SYMBOL) + (RELP)->r_addend;          \
-+              break;                                          \
-+      case R_SH_RELATIVE:                                     \
-+              *(REL)  = (LOAD) + (RELP)->r_addend;            \
-+              break;                                          \
-+      case R_SH_NONE:                                         \
-+              break;                                          \
-+      default:                                                \
-+              SEND_STDERR("BOOTSTRAP_RELOC: unhandled reloc type "); \
-+              SEND_NUMBER_STDERR(ELF32_R_TYPE((RELP)->r_info), 1); \
-+              SEND_STDERR("REL, SYMBOL, LOAD: ");             \
-+              SEND_ADDRESS_STDERR(REL, 0);                    \
-+              SEND_STDERR(", ");                              \
-+              SEND_ADDRESS_STDERR(SYMBOL, 0);                 \
-+              SEND_STDERR(", ");                              \
-+              SEND_ADDRESS_STDERR(LOAD, 1);                   \
-+              _dl_exit(1);                                    \
-+      }
-+
-+
-+/*
-+ * Transfer control to the user's application, once the dynamic loader
-+ * is done.  This routine has to exit the current function, then 
-+ * call the _dl_elf_main function.
-+ */
-+
-+#define START()   return _dl_elf_main;
-+
-+
-+
-+/* Here we define the magic numbers that this dynamic loader should accept */
-+
-+#define MAGIC1 EM_SH
-+#undef  MAGIC2
-+/* Used for error messages */
-+#define ELF_TARGET "sh"
-+
-+struct elf_resolve;
-+extern unsigned long _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_entry);
-+
-+static __inline__ unsigned int
-+_dl_urem(unsigned int n, unsigned int base)
-+{
-+  int res;
-+  
-+      __asm__ (""\
-+              "mov    #0, r0\n\t" \
-+              "div0u\n\t" \
-+              "" \
-+              "! get one bit from the msb of the numerator into the T\n\t" \
-+              "! bit and divide it by whats in %2.  Put the answer bit\n\t" \
-+              "! into the T bit so it can come out again at the bottom\n\t" \
-+              ""                              \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              ""                              \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              ""                              \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              ""                              \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1 ; div1 %2, r0\n\t"   \
-+              "rotcl  %1\n\t"
-+              : "=r" (res)
-+              : "0" (n), "r" (base)
-+              : "r0","cc");
-+
-+      return n - (base * res);
-+}
-+
-+#define do_rem(result, n, base)     ((result) = _dl_urem((n), (base)))
-+
-+/* 4096 bytes alignment */
-+#define PAGE_ALIGN 0xfffff000
-+#define ADDR_ALIGN 0xfff
-+#define OFFS_ALIGN 0x7ffff000
-diff -urN uClibc/ldso-0.9.24/ldso/sh/resolve.S uClibc.ldso.24/ldso-0.9.24/ldso/sh/resolve.S
---- uClibc/ldso-0.9.24/ldso/sh/resolve.S       1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/sh/resolve.S       2002-11-07 20:18:16.000000000 -0600
-@@ -0,0 +1,91 @@
-+/*
-+ * Stolen from glibc-2.2.2 by Eddie C. Dost <ecd@atecom.com>
-+ */
-+
-+      .text
-+      .globl  _dl_linux_resolver
-+      .globl  _dl_linux_resolve
-+      .type   _dl_linux_resolve, @function
-+      .balign 16
-+_dl_linux_resolve:
-+      mov.l   r3, @-r15
-+      mov.l   r4, @-r15
-+      mov.l   r5, @-r15
-+      mov.l   r6, @-r15
-+      mov.l   r7, @-r15
-+      mov.l   r12, @-r15
-+      movt    r3              ! Save T flag
-+      mov.l   r3, @-r15
-+
-+#ifdef HAVE_FPU
-+      sts.l   fpscr, @-r15
-+      mov     #8,r3
-+      swap.w  r3, r3
-+      lds     r3, fpscr
-+      fmov.s  fr11, @-r15
-+      fmov.s  fr10, @-r15
-+      fmov.s  fr9, @-r15
-+      fmov.s  fr8, @-r15
-+      fmov.s  fr7, @-r15
-+      fmov.s  fr6, @-r15
-+      fmov.s  fr5, @-r15
-+      fmov.s  fr4, @-r15
-+#endif
-+      sts.l   pr, @-r15
-+/* Note - The PLT entries have been "optimised" not to use r2.  r2 is used by
-+   GCC to return the address of large structures, so it should not be
-+   corrupted here.  This does mean however, that those PLTs does not conform
-+   to the SH PIC ABI.  That spec says that r0 contains the type of the PLT
-+   and r2 contains the GOT id.  The GNU Plt version stores the GOT id in r0 and
-+   ignores the type.  We can easily detect this difference however,
-+   since the type will always be 0 or 8, and the GOT ids will always be
-+   greater than or equal to 12.
-+
-+   Found in binutils/bfd/elf32-sh.c by Stefan Allius <allius@atecom.com>
-+ */
-+      mov     #8 ,r5
-+      cmp/gt  r5, r0
-+      bt      1f
-+      mov     r2, r0          ! link map address in r2 (SH PIC ABI)
-+1:
-+      mov     r0, r4          ! link map address in r0 (GNUs PLT)
-+      mova    .LG, r0
-+      mov.l   .LG, r5
-+      add     r5, r0
-+      mov.l   3f, r5
-+      mov.l   @(r0, r5),r5
-+      jsr     @r5
-+       mov    r1, r5          ! Reloc offset
-+
-+      lds.l   @r15+, pr       ! Get register content back
-+
-+#ifdef HAVE_FPU
-+      fmov.s  @r15+, fr4
-+      fmov.s  @r15+, fr5
-+      fmov.s  @r15+, fr6
-+      fmov.s  @r15+, fr7
-+      fmov.s  @r15+, fr8
-+      fmov.s  @r15+, fr9
-+      fmov.s  @r15+, fr10
-+      fmov.s  @r15+, fr11
-+      lds.l   @r15+, fpscr
-+#endif
-+
-+      mov.l   @r15+, r3
-+      shal    r3              ! Load T flag
-+      mov.l   @r15+, r12
-+      mov.l   @r15+, r7
-+      mov.l   @r15+, r6
-+      mov.l   @r15+, r5
-+      mov.l   @r15+, r4
-+      jmp     @r0             ! Jump to function address
-+       mov.l  @r15+, r3
-+
-+      .balign 4
-+
-+3:
-+      .long   _dl_linux_resolver@GOT
-+.LG:
-+      .long   _GLOBAL_OFFSET_TABLE_
-+      .size   _dl_linux_resolve, . - _dl_linux_resolve
-+
-diff -urN uClibc/ldso-0.9.24/ldso/sparc/boot1_arch.h uClibc.ldso.24/ldso-0.9.24/ldso/sparc/boot1_arch.h
---- uClibc/ldso-0.9.24/ldso/sparc/boot1_arch.h 1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/sparc/boot1_arch.h 2002-08-08 09:35:49.000000000 -0500
-@@ -0,0 +1,7 @@
-+/* Any assmbly language/system dependent hacks needed to setup boot1.c so it
-+ * will work as expected and cope with whatever platform specific wierdness is
-+ * needed for this architecture.  See arm/boot1_arch.h for an example of what
-+ * can be done.
-+ */
-+
-+#define LD_BOOT(X)   void _dl_boot (X)
-diff -urN uClibc/ldso-0.9.24/ldso/sparc/elfinterp.c uClibc.ldso.24/ldso-0.9.24/ldso/sparc/elfinterp.c
---- uClibc/ldso-0.9.24/ldso/sparc/elfinterp.c  1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/sparc/elfinterp.c  2002-11-05 12:21:12.000000000 -0600
-@@ -0,0 +1,357 @@
-+/* vi: set sw=4 ts=4: */
-+/* sparc ELF shared library loader suppport
-+ *
-+ * Copyright (c) 1994-2000 Eric Youngdale, Peter MacDonald, 
-+ *                            David Engel, Hongjiu Lu and Mitch D'Souza
-+ *
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions and the following disclaimer.
-+ * 2. The name of the above contributors may not be
-+ *    used to endorse or promote products derived from this software
-+ *    without specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE
-+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+ * SUCH DAMAGE.
-+ */
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+static const char * _dl_reltypes[] = { "R_SPARC_NONE", "R_SPARC_8",
-+  "R_SPARC_16", "R_SPARC_32", "R_SPARC_DISP8", "R_SPARC_DISP16",
-+  "R_SPARC_DISP32", "R_SPARC_WDISP30", "R_SPARC_WDISP22",
-+  "R_SPARC_HI22", "R_SPARC_22", "R_SPARC_13", "R_SPARC_LO10",
-+  "R_SPARC_GOT10", "R_SPARC_GOT13", "R_SPARC_GOT22", "R_SPARC_PC10",
-+  "R_SPARC_PC22", "R_SPARC_WPLT30", "R_SPARC_COPY",
-+  "R_SPARC_GLOB_DAT", "R_SPARC_JMP_SLOT", "R_SPARC_RELATIVE",
-+  "R_SPARC_UA32"};
-+#endif
-+
-+/* Program to load an ELF binary on a linux system, and run it.
-+References to symbols in sharable libraries can be resolved by either
-+an ELF sharable library or a linux style of shared library. */
-+
-+/* Disclaimer:  I have never seen any AT&T source code for SVr4, nor have
-+   I ever taken any courses on internals.  This program was developed using
-+   information available through the book "UNIX SYSTEM V RELEASE 4,
-+   Programmers guide: Ansi C and Programming Support Tools", which did
-+   a more than adequate job of explaining everything required to get this
-+   working. */
-+
-+extern _dl_linux_resolve(void);
-+
-+unsigned int _dl_linux_resolver(unsigned int reloc_entry, unsigned int * plt)
-+{
-+  int reloc_type;
-+  Elf32_Rela * this_reloc;
-+  char * strtab;
-+  Elf32_Sym * symtab; 
-+  Elf32_Rela * rel_addr;
-+  struct elf_resolve * tpnt;
-+  int symtab_index;
-+  char * new_addr;
-+  char ** got_addr;
-+  unsigned int instr_addr;
-+  tpnt = (struct elf_resolve *) plt[2];
-+
-+  rel_addr = (Elf32_Rela *) (tpnt->dynamic_info[DT_JMPREL] + 
-+                                 tpnt->loadaddr);
-+
-+  /*
-+   * Generate the correct relocation index into the .rela.plt section.
-+   */
-+  reloc_entry = (reloc_entry >> 12) - 0xc;
-+
-+  this_reloc = (Elf32_Rela *) ((char *) rel_addr + reloc_entry);
-+
-+  reloc_type = ELF32_R_TYPE(this_reloc->r_info);
-+  symtab_index = ELF32_R_SYM(this_reloc->r_info);
-+
-+  symtab =  (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
-+  strtab = (char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
-+
-+  _dl_dprintf(2, "tpnt = %x\n", tpnt);
-+  _dl_dprintf(2, "reloc = %x\n", this_reloc);
-+  _dl_dprintf(2, "symtab = %x\n", symtab);
-+  _dl_dprintf(2, "strtab = %x\n", strtab);
-+
-+
-+  if (reloc_type != R_SPARC_JMP_SLOT) {
-+    _dl_dprintf(2, "%s: incorrect relocation type in jump relocations (%d)\n",
-+                _dl_progname, reloc_type);
-+    _dl_exit(30);
-+  };
-+
-+  /* Address of jump instruction to fix up */
-+  instr_addr  = ((int)this_reloc->r_offset  + (int)tpnt->loadaddr);
-+  got_addr = (char **) instr_addr;
-+
-+  _dl_dprintf(2, "symtab_index %d\n", symtab_index);
-+
-+#ifdef __SUPPORT_LD_DEBUG__
-+  if (_dl_debug_symbols) {
-+        _dl_dprintf(2, "Resolving symbol %s\n",
-+                        strtab + symtab[symtab_index].st_name);
-+  }
-+#endif
-+
-+  /* Get the address of the GOT entry */
-+  new_addr = _dl_find_hash(strtab + symtab[symtab_index].st_name, 
-+                      tpnt->symbol_scope, tpnt, resolver);
-+  if(!new_addr) {
-+    _dl_dprintf(2, "%s: can't resolve symbol '%s'\n",
-+             _dl_progname, strtab + symtab[symtab_index].st_name);
-+    _dl_exit(31);
-+  };
-+
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      if ((unsigned long) got_addr < 0x40000000)
-+      {
-+              if (_dl_debug_bindings)
-+              {
-+                      _dl_dprintf(_dl_debug_file, "\nresolve function: %s",
-+                                      strtab + symtab[symtab_index].st_name);
-+                      if(_dl_debug_detail) _dl_dprintf(_dl_debug_file, 
-+                                      "\tpatch %x ==> %x @ %x", *got_addr, new_addr, got_addr);
-+              }
-+      }
-+      if (!_dl_debug_nofixups) {
-+              got_addr[1] = (char *) (0x03000000 | (((unsigned int) new_addr >> 10) & 0x3fffff));
-+              got_addr[2] = (char *) (0x81c06000 | ((unsigned int) new_addr & 0x3ff));
-+      }
-+#else
-+      got_addr[1] = (char *) (0x03000000 | (((unsigned int) new_addr >> 10) & 0x3fffff));
-+      got_addr[2] = (char *) (0x81c06000 | ((unsigned int) new_addr & 0x3ff));
-+#endif
-+
-+      _dl_dprintf(2, "Address = %x\n",new_addr);
-+      _dl_exit(32);
-+
-+  return (unsigned int) new_addr;
-+}
-+
-+void _dl_parse_lazy_relocation_information(struct elf_resolve * tpnt, int rel_addr,
-+       int rel_size, int type){
-+  int i;
-+  char * strtab;
-+  int reloc_type;
-+  int symtab_index;
-+  Elf32_Sym * symtab; 
-+  Elf32_Rela * rpnt;
-+  unsigned int * reloc_addr;
-+
-+  /* Now parse the relocation information */
-+  rpnt = (Elf32_Rela *) (rel_addr + tpnt->loadaddr);
-+
-+  symtab =  (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
-+  strtab = ( char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
-+
-+  for(i=0; i< rel_size; i += sizeof(Elf32_Rela), rpnt++){
-+    reloc_addr = (int *) (tpnt->loadaddr + (int)rpnt->r_offset);
-+    reloc_type = ELF32_R_TYPE(rpnt->r_info);
-+    symtab_index = ELF32_R_SYM(rpnt->r_info);
-+
-+    /* When the dynamic linker bootstrapped itself, it resolved some symbols.
-+       Make sure we do not do them again */
-+    if(!symtab_index && tpnt->libtype == program_interpreter) continue;
-+    if(symtab_index && tpnt->libtype == program_interpreter &&
-+       _dl_symbol(strtab + symtab[symtab_index].st_name))
-+      continue;
-+
-+    switch(reloc_type){
-+    case R_SPARC_NONE:
-+      break;
-+    case R_SPARC_JMP_SLOT:
-+      break;
-+    default:
-+      _dl_dprintf(2, "%s: (LAZY) can't handle reloc type ", _dl_progname);
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      _dl_dprintf(2, "%s ", _dl_reltypes[reloc_type]);
-+#endif
-+      if(symtab_index) _dl_dprintf(2, "'%s'\n",
-+                                strtab + symtab[symtab_index].st_name);
-+      _dl_exit(33);
-+    };
-+  };
-+}
-+
-+int _dl_parse_relocation_information(struct elf_resolve * tpnt, int rel_addr,
-+       int rel_size, int type){
-+  int i;
-+  char * strtab;
-+  int reloc_type;
-+  int goof = 0;
-+  Elf32_Sym * symtab; 
-+  Elf32_Rela * rpnt;
-+  unsigned int * reloc_addr;
-+  unsigned int symbol_addr;
-+  int symtab_index;
-+  /* Now parse the relocation information */
-+
-+  rpnt = (Elf32_Rela *) (rel_addr + tpnt->loadaddr);
-+
-+  symtab =  (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
-+  strtab = ( char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
-+
-+  for(i=0; i< rel_size; i+= sizeof(Elf32_Rela), rpnt++){
-+    reloc_addr = (int *) (tpnt->loadaddr + (int)rpnt->r_offset);
-+    reloc_type = ELF32_R_TYPE(rpnt->r_info);
-+    symtab_index = ELF32_R_SYM(rpnt->r_info);
-+    symbol_addr = 0;
-+
-+    if(!symtab_index && tpnt->libtype == program_interpreter) continue;
-+
-+    if(symtab_index) {
-+
-+      if(tpnt->libtype == program_interpreter && 
-+       _dl_symbol(strtab + symtab[symtab_index].st_name))
-+      continue;
-+
-+      symbol_addr = (unsigned int) 
-+      _dl_find_hash(strtab + symtab[symtab_index].st_name,
-+                            tpnt->symbol_scope,
-+                    (reloc_type == R_SPARC_JMP_SLOT ? tpnt : NULL), symbolrel);
-+
-+      if(!symbol_addr &&
-+       ELF32_ST_BIND(symtab [symtab_index].st_info) == STB_GLOBAL) {
-+      _dl_dprintf(2, "%s: can't resolve symbol '%s'\n",
-+                   _dl_progname, strtab + symtab[symtab_index].st_name);
-+      goof++;
-+      };
-+    };
-+    switch(reloc_type){
-+    case R_SPARC_NONE:
-+      break;
-+    case R_SPARC_32:
-+      *reloc_addr = symbol_addr + rpnt->r_addend;
-+      break;
-+    case R_SPARC_DISP32:
-+      *reloc_addr = symbol_addr + rpnt->r_addend - (unsigned int) reloc_addr;
-+      break;
-+    case R_SPARC_GLOB_DAT:
-+      *reloc_addr = symbol_addr + rpnt->r_addend;
-+      break;
-+    case R_SPARC_JMP_SLOT:
-+      reloc_addr[1] = 0x03000000 | ((symbol_addr >> 10) & 0x3fffff);
-+      reloc_addr[2] = 0x81c06000 | (symbol_addr & 0x3ff);
-+      break;
-+    case R_SPARC_RELATIVE:
-+      *reloc_addr += (unsigned int) tpnt->loadaddr + rpnt->r_addend;
-+      break;
-+    case R_SPARC_HI22:
-+      if (!symbol_addr)
-+        symbol_addr = tpnt->loadaddr + rpnt->r_addend;
-+      else
-+      symbol_addr += rpnt->r_addend;
-+      *reloc_addr = (*reloc_addr & 0xffc00000)|(symbol_addr >> 10);
-+      break;
-+    case R_SPARC_LO10:
-+      if (!symbol_addr)
-+        symbol_addr = tpnt->loadaddr + rpnt->r_addend;
-+      else
-+      symbol_addr += rpnt->r_addend;
-+      *reloc_addr = (*reloc_addr & ~0x3ff)|(symbol_addr & 0x3ff);
-+      break;
-+    case R_SPARC_WDISP30:
-+      *reloc_addr = (*reloc_addr & 0xc0000000)|
-+      ((symbol_addr - (unsigned int) reloc_addr) >> 2);
-+      break;
-+    case R_SPARC_COPY:
-+#if 0 /* This one is done later */
-+      _dl_dprintf(2, "Doing copy for symbol ");
-+      if(symtab_index) _dl_dprintf(2, strtab + symtab[symtab_index].st_name);
-+      _dl_dprintf(2, "\n");
-+      _dl_memcpy((void *) symtab[symtab_index].st_value,
-+               (void *) symbol_addr, 
-+               symtab[symtab_index].st_size);
-+#endif
-+      break;
-+    default:
-+      _dl_dprintf(2, "%s: can't handle reloc type ", _dl_progname);
-+#if defined (__SUPPORT_LD_DEBUG__)
-+      _dl_dprintf(2, "%s ", _dl_reltypes[reloc_type]);
-+#endif
-+      if (symtab_index)
-+      _dl_dprintf(2, "'%s'\n", strtab + symtab[symtab_index].st_name);
-+      _dl_exit(34);
-+    };
-+
-+  };
-+  return goof;
-+}
-+
-+
-+/* This is done as a separate step, because there are cases where
-+   information is first copied and later initialized.  This results in
-+   the wrong information being copied.  Someone at Sun was complaining about
-+   a bug in the handling of _COPY by SVr4, and this may in fact be what he
-+   was talking about.  Sigh. */
-+
-+/* No, there are cases where the SVr4 linker fails to emit COPY relocs
-+   at all */
-+
-+int _dl_parse_copy_information(struct dyn_elf * xpnt, int rel_addr,
-+       int rel_size, int type)
-+{
-+  int i;
-+  char * strtab;
-+  int reloc_type;
-+  int goof = 0;
-+  Elf32_Sym * symtab; 
-+  Elf32_Rela * rpnt;
-+  unsigned int * reloc_addr;
-+  unsigned int symbol_addr;
-+  struct elf_resolve *tpnt;
-+  int symtab_index;
-+  /* Now parse the relocation information */
-+
-+  tpnt = xpnt->dyn;
-+  
-+  rpnt = (Elf32_Rela *) (rel_addr + tpnt->loadaddr);
-+
-+  symtab =  (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
-+  strtab = ( char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
-+
-+  for(i=0; i< rel_size; i+= sizeof(Elf32_Rela), rpnt++){
-+    reloc_addr = (int *) (tpnt->loadaddr + (int)rpnt->r_offset);
-+    reloc_type = ELF32_R_TYPE(rpnt->r_info);
-+    if(reloc_type != R_SPARC_COPY) continue;
-+    symtab_index = ELF32_R_SYM(rpnt->r_info);
-+    symbol_addr = 0;
-+    if(!symtab_index && tpnt->libtype == program_interpreter) continue;
-+    if(symtab_index) {
-+
-+      if(tpnt->libtype == program_interpreter && 
-+       _dl_symbol(strtab + symtab[symtab_index].st_name))
-+      continue;
-+
-+      symbol_addr = (unsigned int) 
-+      _dl_find_hash(strtab + symtab[symtab_index].st_name,
-+                            xpnt->next, NULL, copyrel);
-+      if(!symbol_addr) {
-+      _dl_dprintf(2, "%s: can't resolve symbol '%s'\n",
-+                 _dl_progname, strtab + symtab[symtab_index].st_name);
-+      goof++;
-+      };
-+    };
-+    if (!goof)
-+      _dl_memcpy((char *) symtab[symtab_index].st_value, 
-+                (char *) symbol_addr, 
-+                symtab[symtab_index].st_size);
-+  };
-+  return goof;
-+}
-+
-+
-diff -urN uClibc/ldso-0.9.24/ldso/sparc/ld_syscalls.h uClibc.ldso.24/ldso-0.9.24/ldso/sparc/ld_syscalls.h
---- uClibc/ldso-0.9.24/ldso/sparc/ld_syscalls.h        1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/sparc/ld_syscalls.h        2002-03-19 04:43:35.000000000 -0600
-@@ -0,0 +1,155 @@
-+/*
-+ * This file contains the system call macros and syscall 
-+ * numbers used by the shared library loader.
-+ */
-+
-+#define __NR_exit               1
-+#define __NR_read               3
-+#define __NR_write              4
-+#define __NR_open               5
-+#define __NR_close              6
-+#define __NR_getuid            24
-+#define __NR_getgid            47
-+#define __NR_geteuid           49
-+#define __NR_getegid           50
-+#define __NR_readlink            58
-+#define __NR_mmap              71
-+#define __NR_munmap            73
-+#define __NR_stat              38
-+#define __NR_mprotect          74
-+
-+/* Here are the macros which define how this platform makes
-+ * system calls.  This particular variant does _not_ set 
-+ * errno (note how it is disabled in __syscall_return) since
-+ * these will get called before the errno symbol is dynamicly 
-+ * linked. */
-+
-+#define _syscall0(type,name) \
-+type name(void) \
-+{ \
-+long __res; \
-+register long __g1 __asm__ ("g1") = __NR_##name; \
-+__asm__ __volatile__ ("t 0x10\n\t" \
-+                    "bcc 1f\n\t" \
-+                    "mov %%o0, %0\n\t" \
-+                    "sub %%g0, %%o0, %0\n\t" \
-+                    "1:\n\t" \
-+                    : "=r" (__res)\
-+                    : "r" (__g1) \
-+                    : "o0", "cc"); \
-+if (__res < -255 || __res >= 0) \
-+    return (type) __res; \
-+/*errno = -__res; */\
-+return -1; \
-+}
-+
-+#define _syscall1(type,name,type1,arg1) \
-+type name(type1 arg1) \
-+{ \
-+long __res; \
-+register long __g1 __asm__ ("g1") = __NR_##name; \
-+register long __o0 __asm__ ("o0") = (long)(arg1); \
-+__asm__ __volatile__ ("t 0x10\n\t" \
-+                    "bcc 1f\n\t" \
-+                    "mov %%o0, %0\n\t" \
-+                    "sub %%g0, %%o0, %0\n\t" \
-+                    "1:\n\t" \
-+                    : "=r" (__res), "=&r" (__o0) \
-+                    : "1" (__o0), "r" (__g1) \
-+                    : "cc"); \
-+if (__res < -255 || __res >= 0) \
-+      return (type) __res; \
-+/*errno = -__res;*/ \
-+return -1; \
-+}
-+
-+#define _syscall2(type,name,type1,arg1,type2,arg2) \
-+type name(type1 arg1,type2 arg2) \
-+{ \
-+long __res; \
-+register long __g1 __asm__ ("g1") = __NR_##name; \
-+register long __o0 __asm__ ("o0") = (long)(arg1); \
-+register long __o1 __asm__ ("o1") = (long)(arg2); \
-+__asm__ __volatile__ ("t 0x10\n\t" \
-+                    "bcc 1f\n\t" \
-+                    "mov %%o0, %0\n\t" \
-+                    "sub %%g0, %%o0, %0\n\t" \
-+                    "1:\n\t" \
-+                    : "=r" (__res), "=&r" (__o0) \
-+                    : "1" (__o0), "r" (__o1), "r" (__g1) \
-+                    : "cc"); \
-+if (__res < -255 || __res >= 0) \
-+      return (type) __res; \
-+/*errno = -__res;*/ \
-+return -1; \
-+}
-+
-+#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
-+type name(type1 arg1,type2 arg2,type3 arg3) \
-+{ \
-+long __res; \
-+register long __g1 __asm__ ("g1") = __NR_##name; \
-+register long __o0 __asm__ ("o0") = (long)(arg1); \
-+register long __o1 __asm__ ("o1") = (long)(arg2); \
-+register long __o2 __asm__ ("o2") = (long)(arg3); \
-+__asm__ __volatile__ ("t 0x10\n\t" \
-+                    "bcc 1f\n\t" \
-+                    "mov %%o0, %0\n\t" \
-+                    "sub %%g0, %%o0, %0\n\t" \
-+                    "1:\n\t" \
-+                    : "=r" (__res), "=&r" (__o0) \
-+                    : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__g1) \
-+                    : "cc"); \
-+if (__res < -255 || __res>=0) \
-+      return (type) __res; \
-+/*errno = -__res;*/ \
-+return -1; \
-+}
-+
-+#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
-+type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
-+{ \
-+long __res; \
-+register long __g1 __asm__ ("g1") = __NR_##name; \
-+register long __o0 __asm__ ("o0") = (long)(arg1); \
-+register long __o1 __asm__ ("o1") = (long)(arg2); \
-+register long __o2 __asm__ ("o2") = (long)(arg3); \
-+register long __o3 __asm__ ("o3") = (long)(arg4); \
-+__asm__ __volatile__ ("t 0x10\n\t" \
-+                    "bcc 1f\n\t" \
-+                    "mov %%o0, %0\n\t" \
-+                    "sub %%g0, %%o0, %0\n\t" \
-+                    "1:\n\t" \
-+                    : "=r" (__res), "=&r" (__o0) \
-+                    : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__o3), "r" (__g1) \
-+                    : "cc"); \
-+if (__res < -255 || __res>=0) \
-+      return (type) __res; \
-+/*errno = -__res;*/ \
-+return -1; \
-+} 
-+
-+#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
-+        type5,arg5) \
-+type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
-+{ \
-+long __res; \
-+register long __g1 __asm__ ("g1") = __NR_##name; \
-+register long __o0 __asm__ ("o0") = (long)(arg1); \
-+register long __o1 __asm__ ("o1") = (long)(arg2); \
-+register long __o2 __asm__ ("o2") = (long)(arg3); \
-+register long __o3 __asm__ ("o3") = (long)(arg4); \
-+register long __o4 __asm__ ("o4") = (long)(arg5); \
-+__asm__ __volatile__ ("t 0x10\n\t" \
-+                    "bcc 1f\n\t" \
-+                    "mov %%o0, %0\n\t" \
-+                    "sub %%g0, %%o0, %0\n\t" \
-+                    "1:\n\t" \
-+                    : "=r" (__res), "=&r" (__o0) \
-+                    : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__o3), "r" (__o4), "r" (__g1) \
-+                    : "cc"); \
-+if (__res < -255 || __res>=0) \
-+      return (type) __res; \
-+/*errno = -__res; */\
-+return -1; \
-+}
-diff -urN uClibc/ldso-0.9.24/ldso/sparc/ld_sysdep.h uClibc.ldso.24/ldso-0.9.24/ldso/sparc/ld_sysdep.h
---- uClibc/ldso-0.9.24/ldso/sparc/ld_sysdep.h  1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/sparc/ld_sysdep.h  2002-08-09 08:05:29.000000000 -0500
-@@ -0,0 +1,112 @@
-+
-+/*
-+ * Various assmbly language/system dependent  hacks that are required
-+ * so that we can minimize the amount of platform specific code.
-+ */
-+#define LINUXBIN
-+
-+/*
-+ * Define this if the system uses RELOCA.
-+ */
-+#define ELF_USES_RELOCA
-+
-+/*
-+ * Get a pointer to the argv array.  On many platforms this can be just
-+ * the address if the first argument, on other platforms we need to
-+ * do something a little more subtle here.  We assume that argc is stored
-+ * at the word just below the argvp that we return here.
-+ */
-+#define GET_ARGV(ARGVP, ARGS) __asm__("\tadd %%fp,68,%0\n" : "=r" (ARGVP));
-+
-+/*
-+ * Initialization sequence for a GOT.  For the Sparc, this points to the
-+ * PLT, and we need to initialize a couple of the slots.  The PLT should
-+ * look like:
-+ *
-+ *            save %sp, -64, %sp
-+ *            call _dl_linux_resolve
-+ *            nop
-+ *            .word implementation_dependent
-+ */
-+#define INIT_GOT(GOT_BASE,MODULE) \
-+{                             \
-+   GOT_BASE[0] = 0x9de3bfc0;  /* save %sp, -64, %sp */        \
-+   GOT_BASE[1] = 0x40000000 | (((unsigned int) _dl_linux_resolve - (unsigned int) GOT_BASE - 4) >> 2);        \
-+   GOT_BASE[2] = 0x01000000; /* nop */                        \
-+   GOT_BASE[3] = (int) MODULE;                                        \
-+}
-+
-+/*
-+ * Here is a macro to perform a relocation.  This is only used when
-+ * bootstrapping the dynamic loader.
-+ */
-+#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD) \
-+      switch(ELF32_R_TYPE((RELP)->r_info)) {          \
-+      case R_SPARC_32:                                \
-+        *REL = SYMBOL + (RELP)->r_addend;             \
-+        break;                                        \
-+      case R_SPARC_GLOB_DAT:                          \
-+        *REL = SYMBOL + (RELP)->r_addend;             \
-+        break;                                        \
-+      case R_SPARC_JMP_SLOT:                          \
-+        REL[1] = 0x03000000 | ((SYMBOL >> 10) & 0x3fffff);    \
-+        REL[2] = 0x81c06000 | (SYMBOL & 0x3ff);       \
-+        break;                                        \
-+      case R_SPARC_NONE:                              \
-+        break;                                        \
-+        case R_SPARC_WDISP30:                         \
-+          break;                                        \
-+      case R_SPARC_RELATIVE:                          \
-+        *REL += (unsigned int) LOAD + (RELP)->r_addend; \
-+        break;                                        \
-+      default:                                        \
-+        _dl_exit(1);                                  \
-+      }
-+
-+
-+/*
-+ * Transfer control to the user's application, once the dynamic loader
-+ * is done.  The crt calls atexit with $g1 if not null, so we need to
-+ * ensure that it contains NULL.
-+ */
-+
-+#define START()               \
-+      __asm__ volatile ( \
-+                         "add %%g0,%%g0,%%g1\n\t" \
-+                         "jmpl %0, %%o7\n\t"  \
-+                         "restore %%g0,%%g0,%%g0\n\t" \
-+                      : /*"=r" (status) */ :  \
-+                        "r" (_dl_elf_main): "g1", "o0", "o1")
-+
-+
-+
-+/* Here we define the magic numbers that this dynamic loader should accept */
-+
-+#define MAGIC1 EM_SPARC
-+#undef  MAGIC2
-+/* Used for error messages */
-+#define ELF_TARGET "Sparc"
-+
-+#ifndef COMPILE_ASM
-+extern unsigned int _dl_linux_resolver(unsigned int reloc_entry,
-+                                      unsigned int * i);
-+#endif
-+
-+/*
-+ * Define this if you want a dynamic loader that works on Solaris.
-+ */
-+#define SOLARIS_COMPATIBLE
-+
-+#define do_rem(result, n, base)           result = (n % base)
-+
-+/*
-+ * dbx wants the binder to have a specific name.  Mustn't disappoint it.
-+ */
-+#ifdef SOLARIS_COMPATIBLE
-+#define _dl_linux_resolve _elf_rtbndr
-+#endif
-+
-+/* 4096 bytes alignment */
-+#define PAGE_ALIGN 0xfffff000
-+#define ADDR_ALIGN 0xfff
-+#define OFFS_ALIGN 0x7ffff000
-diff -urN uClibc/ldso-0.9.24/ldso/sparc/resolve.S uClibc.ldso.24/ldso-0.9.24/ldso/sparc/resolve.S
---- uClibc/ldso-0.9.24/ldso/sparc/resolve.S    1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/ldso/sparc/resolve.S    2002-01-11 13:57:41.000000000 -0600
-@@ -0,0 +1,25 @@
-+/*
-+ * These are various helper routines that are needed to run an ELF image.
-+ */
-+#define COMPILE_ASM
-+#include "ld_sysdep.h"
-+
-+.text
-+      .align 16
-+
-+.globl _dl_linux_resolve
-+_dl_linux_resolve:
-+      /*
-+       * Call the resolver - pass the address of the PLT so that we can
-+       * figure out which module we are in.
-+       */
-+      mov %o7,%o1
-+      call  _dl_linux_resolver
-+      mov %g1,%o0
-+
-+      jmpl %o0,%o7
-+      restore
-+.LFE2:
-+
-+      .type   _dl_linux_resolve,#function
-+      .size _dl_linux_resolve,.LFE2-_dl_linux_resolve
-diff -urN uClibc/ldso-0.9.24/libdl/.cvsignore uClibc.ldso.24/ldso-0.9.24/libdl/.cvsignore
---- uClibc/ldso-0.9.24/libdl/.cvsignore        1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/libdl/.cvsignore        2001-04-26 11:12:47.000000000 -0500
-@@ -0,0 +1,2 @@
-+libdl.so*
-+
-diff -urN uClibc/ldso-0.9.24/libdl/Makefile uClibc.ldso.24/ldso-0.9.24/libdl/Makefile
---- uClibc/ldso-0.9.24/libdl/Makefile  1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/libdl/Makefile  2004-03-01 03:05:53.000000000 -0600
-@@ -0,0 +1,86 @@
-+# Makefile for uClibc
-+#
-+# Copyright (C) 2000 by Lineo, inc.
-+# Copyright (C) 2000-2002 Erik Andersen <andersen@uclibc.org>
-+#
-+# This program is free software; you can redistribute it and/or modify it under
-+# the terms of the GNU Library General Public License as published by the Free
-+# Software Foundation; either version 2 of the License, or (at your option) any
-+# later version.
-+#
-+# This program is distributed in the hope that it will be useful, but WITHOUT
-+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-+# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
-+# details.
-+#
-+# You should have received a copy of the GNU Library General Public License
-+# along with this program; if not, write to the Free Software Foundation, Inc.,
-+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-+
-+
-+TOPDIR=../../
-+include $(TOPDIR)Rules.mak
-+
-+XXFLAGS=$(XWARNINGS) $(OPTIMIZATION) $(XARCH_CFLAGS) $(CPU_CFLAGS) \
-+      -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
-+      -fno-builtin -nostdinc -D_LIBC -I$(TOPDIR)ldso-0.9.24/include -I. -I$(TOPDIR)include
-+
-+ifeq ($(DODEBUG),y)
-+XXFLAGS=$(XWARNINGS) -O0 -g3 $(XARCH_CFLAGS) $(CPU_CFLAGS) \
-+      -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
-+      -fno-builtin -nostdinc -D_LIBC -I$(TOPDIR)ldso-0.9.24/include -I. -I$(TOPDIR)include
-+endif
-+
-+XXFLAGS+=$(shell $(CC) -print-search-dirs | sed -ne "s/install: *\(.*\)/-I\1include/gp")
-+XXFLAGS_NOPIC:=$(XXFLAGS)
-+ifeq ($(DOPIC),y)
-+    XXFLAGS += $(PICFLAG) -D__LIBDL_SHARED__
-+endif
-+ifeq ($(strip $(SUPPORT_LD_DEBUG)),y)
-+XXFLAGS+=-D__SUPPORT_LD_DEBUG__
-+endif
-+
-+LIBDL=libdl.a
-+LIBDL_PIC=libdl_pic.a
-+LIBDL_SHARED=libdl.so
-+LIBDL_SHARED_FULLNAME=libdl-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
-+
-+CSRC=dlib.c
-+OBJS=dlib.o
-+PIC_OBJS=dlib_pic.o
-+
-+all: $(OBJS) $(LIBDL) shared
-+
-+$(LIBDL): ar-target
-+
-+ar-target: $(OBJS) $(PIC_OBJS)
-+      $(AR) $(ARFLAGS) $(LIBDL) ../ldso/$(TARGET_ARCH)/resolve.o $(OBJS)
-+      $(AR) $(ARFLAGS) $(LIBDL_PIC) $(PIC_OBJS)
-+      $(INSTALL) -d $(TOPDIR)lib
-+      $(RM) $(TOPDIR)lib/$(LIBDL)
-+      $(INSTALL) -m 644 $(LIBDL) $(TOPDIR)lib
-+
-+
-+dlib.o: dlib.c
-+      $(CC) $(XXFLAGS_NOPIC) -c dlib.c -o dlib.o
-+      $(STRIPTOOL) -x -R .note -R .comment $*.o
-+
-+dlib_pic.o: dlib.c
-+      $(CC) $(XXFLAGS) -c dlib.c -o dlib_pic.o
-+      $(STRIPTOOL) -x -R .note -R .comment $*.o
-+
-+$(OBJ): Makefile
-+
-+shared:
-+      $(LD) $(LDFLAGS) -soname=$(LIBDL_SHARED).$(MAJOR_VERSION) \
-+              -o $(LIBDL_SHARED_FULLNAME) --whole-archive $(LIBDL_PIC) \
-+              --no-whole-archive $(TOPDIR)/libc/misc/internals/interp.o \
-+              -L$(TOPDIR)/lib -lc $(LDADD_LIBFLOAT) $(LIBGCC);
-+      $(INSTALL) -d $(TOPDIR)lib
-+      $(RM) $(TOPDIR)lib/$(LIBDL_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBDL_SHARED).$(MAJOR_VERSION)
-+      $(INSTALL) -m 644 $(LIBDL_SHARED_FULLNAME) $(TOPDIR)lib
-+      $(LN) -sf $(LIBDL_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBDL_SHARED)
-+      $(LN) -sf $(LIBDL_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBDL_SHARED).$(MAJOR_VERSION)
-+
-+clean:
-+      $(RM) .depend $(LIBDL_SHARED)* $(LIBDL_SHARED_FULLNAME) core *.o *.a *.s *.i tmp_make foo *~
-diff -urN uClibc/ldso-0.9.24/libdl/dlib.c uClibc.ldso.24/ldso-0.9.24/libdl/dlib.c
---- uClibc/ldso-0.9.24/libdl/dlib.c    1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/libdl/dlib.c    2004-03-01 03:04:42.000000000 -0600
-@@ -0,0 +1,664 @@
-+/*
-+ * libdl.c
-+ * 
-+ * Functions required for dlopen et. al.
-+ */
-+
-+#include <ldso.h>
-+
-+
-+/* The public interfaces */
-+void *dlopen(const char *, int) __attribute__ ((__weak__, __alias__ ("_dlopen")));
-+int dlclose(void *) __attribute__ ((__weak__, __alias__ ("_dlclose")));
-+void *dlsym(void *, const char *) __attribute__ ((__weak__, __alias__ ("_dlsym")));
-+const char *dlerror(void) __attribute__ ((__weak__, __alias__ ("_dlerror")));
-+int dladdr(void *, Dl_info *) __attribute__ ((__weak__, __alias__ ("_dladdr")));
-+void _dlinfo(void);
-+
-+
-+#ifdef __LIBDL_SHARED__
-+/* This is a real hack.  We need access to the dynamic linker, but we
-+also need to make it possible to link against this library without any
-+unresolved externals.  We provide these weak symbols to make the link
-+possible, but at run time the normal symbols are accessed. */
-+static void __attribute__ ((unused)) foobar(void)
-+{
-+      const char msg[]="libdl library not correctly linked\n";
-+      _dl_write(2, msg, _dl_strlen(msg));
-+      _dl_exit(1);
-+}
-+
-+static int __attribute__ ((unused)) foobar1 = (int) foobar;   /* Use as pointer */
-+extern void _dl_dprintf(int, const char *, ...) __attribute__ ((__weak__, __alias__ ("foobar")));
-+extern char *_dl_find_hash(const char *, struct dyn_elf *, struct elf_resolve *, enum caller_type)
-+      __attribute__ ((__weak__, __alias__ ("foobar")));
-+extern struct elf_resolve * _dl_load_shared_library(int, struct dyn_elf **, struct elf_resolve *, char *)
-+      __attribute__ ((__weak__, __alias__ ("foobar")));
-+extern struct elf_resolve * _dl_check_if_named_library_is_loaded(const char *full_libname)
-+      __attribute__ ((__weak__, __alias__ ("foobar")));
-+extern int _dl_fixup(struct elf_resolve *tpnt, int lazy)
-+       __attribute__ ((__weak__, __alias__ ("foobar")));
-+extern int _dl_copy_fixups(struct dyn_elf * tpnt)
-+       __attribute__ ((__weak__, __alias__ ("foobar")));
-+#ifdef __mips__
-+extern void _dl_perform_mips_global_got_relocations(struct elf_resolve *tpnt)
-+      __attribute__ ((__weak__, __alias__ ("foobar")));
-+#endif
-+#ifdef USE_CACHE
-+int _dl_map_cache(void) __attribute__ ((__weak__, __alias__ ("foobar")));
-+int _dl_unmap_cache(void) __attribute__ ((__weak__, __alias__ ("foobar")));
-+#endif        
-+
-+extern struct dyn_elf *_dl_symbol_tables __attribute__ ((__weak__, __alias__ ("foobar1")));
-+extern struct dyn_elf *_dl_handles __attribute__ ((__weak__, __alias__ ("foobar1")));
-+extern struct elf_resolve *_dl_loaded_modules __attribute__ ((__weak__, __alias__ ("foobar1")));
-+extern struct r_debug *_dl_debug_addr __attribute__ ((__weak__, __alias__ ("foobar1")));
-+extern unsigned long _dl_error_number __attribute__ ((__weak__, __alias__ ("foobar1")));
-+extern void *(*_dl_malloc_function)(size_t) __attribute__ ((__weak__, __alias__ ("foobar1")));
-+#ifdef __SUPPORT_LD_DEBUG__
-+extern char *_dl_debug __attribute__ ((__weak__, __alias__ ("foobar1")));
-+extern char *_dl_debug_symbols __attribute__ ((__weak__, __alias__ ("foobar1")));
-+extern char *_dl_debug_move __attribute__ ((__weak__, __alias__ ("foobar1")));
-+extern char *_dl_debug_reloc __attribute__ ((__weak__, __alias__ ("foobar1")));
-+extern char *_dl_debug_detail __attribute__ ((__weak__, __alias__ ("foobar1")));
-+extern char *_dl_debug_nofixups __attribute__ ((__weak__, __alias__ ("foobar1")));
-+extern char *_dl_debug_bindings __attribute__ ((__weak__, __alias__ ("foobar1")));
-+extern int   _dl_debug_file __attribute__ ((__weak__, __alias__ ("foobar1")));
-+#endif
-+
-+#else /* __LIBDL_SHARED__ */
-+
-+#ifdef __SUPPORT_LD_DEBUG__
-+char *_dl_debug  = 0;
-+char *_dl_debug_symbols = 0;
-+char *_dl_debug_move    = 0;
-+char *_dl_debug_reloc   = 0;
-+char *_dl_debug_detail  = 0;
-+char *_dl_debug_nofixups  = 0;
-+char *_dl_debug_bindings  = 0;
-+int   _dl_debug_file = 2;
-+#endif
-+char *_dl_library_path = 0;
-+char *_dl_ldsopath = 0;
-+struct r_debug *_dl_debug_addr = NULL;
-+static char *_dl_malloc_addr, *_dl_mmap_zero;
-+#include "../ldso/_dl_progname.h"               /* Pull in the name of ld.so */
-+#include "../ldso/hash.c"
-+#define _dl_trace_loaded_objects    0
-+#include "../ldso/readelflib1.c"
-+void *(*_dl_malloc_function) (size_t size);
-+int _dl_fixup(struct elf_resolve *tpnt, int lazy);
-+#endif
-+
-+static int do_dlclose(void *, int need_fini);
-+
-+
-+static const char *dl_error_names[] = {
-+      "",
-+      "File not found",
-+      "Unable to open /dev/zero",
-+      "Not an ELF file",
-+#if defined (__i386__)
-+      "Not i386 binary",
-+#elif defined (__sparc__)
-+      "Not sparc binary",
-+#elif defined (__mc68000__)
-+      "Not m68k binary",
-+#else
-+      "Unrecognized binary type",
-+#endif
-+      "Not an ELF shared library",
-+      "Unable to mmap file",
-+      "No dynamic section",
-+#ifdef ELF_USES_RELOCA
-+      "Unable to process REL relocs",
-+#else
-+      "Unable to process RELA relocs",
-+#endif
-+      "Bad handle",
-+      "Unable to resolve symbol"
-+};
-+
-+static void __attribute__ ((destructor)) dl_cleanup(void)
-+{
-+      struct dyn_elf *d;
-+
-+      for (d = _dl_handles; d; d = d->next_handle)
-+              if (d->dyn->libtype == loaded_file && d->dyn->dynamic_info[DT_FINI]) {
-+                      (* ((int (*)(void)) (d->dyn->loadaddr + d->dyn->dynamic_info[DT_FINI]))) ();
-+                      d->dyn->dynamic_info[DT_FINI] = 0;
-+              }
-+}
-+
-+void *_dlopen(const char *libname, int flag)
-+{
-+      struct elf_resolve *tpnt, *tfrom, *tcurr;
-+      struct dyn_elf *dyn_chain, *rpnt = NULL;
-+      struct dyn_elf *dpnt;
-+      static int dl_init = 0;
-+      ElfW(Addr) from;
-+      struct elf_resolve *tpnt1;
-+      void (*dl_brk) (void);
-+
-+      /* A bit of sanity checking... */
-+      if (!(flag & (RTLD_LAZY|RTLD_NOW))) {
-+              _dl_error_number = LD_BAD_HANDLE;
-+              return NULL;
-+      }
-+
-+      from = (ElfW(Addr)) __builtin_return_address(0);
-+
-+      /* Have the dynamic linker use the regular malloc function now */
-+      if (!dl_init) {
-+              dl_init++;
-+              _dl_malloc_function = malloc;
-+      }
-+
-+      /* Cover the trivial case first */
-+      if (!libname)
-+              return _dl_symbol_tables;
-+
-+      _dl_map_cache();
-+
-+      /*
-+       * Try and locate the module we were called from - we
-+       * need this so that we get the correct RPATH.  Note that
-+       * this is the current behavior under Solaris, but the
-+       * ABI+ specifies that we should only use the RPATH from
-+       * the application.  Thus this may go away at some time
-+       * in the future.
-+       */
-+      tfrom = NULL;
-+      for (dpnt = _dl_symbol_tables; dpnt; dpnt = dpnt->next) {
-+              tpnt = dpnt->dyn;
-+              if (tpnt->loadaddr < from
-+                              && (tfrom == NULL || tfrom->loadaddr < tpnt->loadaddr))
-+                      tfrom = tpnt;
-+      }
-+
-+      /* Try to load the specified library */
-+#ifdef __SUPPORT_LD_DEBUG__
-+      if(_dl_debug) 
-+      _dl_dprintf(_dl_debug_file, "Trying to dlopen '%s'\n", (char*)libname);
-+#endif
-+      tpnt = _dl_load_shared_library(0, &rpnt, tfrom, (char*)libname);
-+      if (tpnt == NULL) {
-+              _dl_unmap_cache();
-+              return NULL;
-+      }
-+
-+      dyn_chain = (struct dyn_elf *) malloc(sizeof(struct dyn_elf));
-+      _dl_memset(dyn_chain, 0, sizeof(struct dyn_elf));
-+      dyn_chain->dyn = tpnt;
-+      dyn_chain->flags = flag;
-+      if (!tpnt->symbol_scope)
-+              tpnt->symbol_scope = dyn_chain;
-+
-+      dyn_chain->next_handle = _dl_handles;
-+      _dl_handles = rpnt = dyn_chain;
-+
-+      if (tpnt->init_flag & INIT_FUNCS_CALLED) {
-+          /* If the init and fini stuff has already been run, that means
-+           * the dlopen'd library has already been loaded, and nothing
-+           * further needs to be done. */
-+          return (void *) dyn_chain;
-+      }
-+
-+
-+#ifdef __SUPPORT_LD_DEBUG__
-+      if(_dl_debug) 
-+      _dl_dprintf(_dl_debug_file, "Looking for needed libraries\n");
-+#endif
-+
-+      for (tcurr = tpnt; tcurr; tcurr = tcurr->next)
-+      {
-+              Elf32_Dyn *dpnt;
-+              char *lpntstr;
-+              for (dpnt = (Elf32_Dyn *) tcurr->dynamic_addr; dpnt->d_tag; dpnt++) {
-+                      if (dpnt->d_tag == DT_NEEDED) {
-+
-+                              char *name;
-+                              lpntstr = (char*) (tcurr->loadaddr + tcurr->dynamic_info[DT_STRTAB] + 
-+                                      dpnt->d_un.d_val);
-+                              name = _dl_get_last_path_component(lpntstr);
-+
-+#ifdef __SUPPORT_LD_DEBUG__
-+                              if(_dl_debug) 
-+                              _dl_dprintf(_dl_debug_file, "Trying to load '%s', needed by '%s'\n", 
-+                                              lpntstr, tcurr->libname);
-+#endif
-+
-+                              if (!(tpnt1 = _dl_load_shared_library(0, &rpnt, tcurr, lpntstr))) {
-+                                      goto oops;
-+                              }
-+
-+#if 1
-+//FIXME:  Enabling this is _so_ wrong....
-+                              /* We need global symbol resolution for everything
-+                               * in the dependent chain */
-+                              dyn_chain->flags |= RTLD_GLOBAL;
-+#endif
-+
-+                              rpnt->next = (struct dyn_elf *) malloc(sizeof(struct dyn_elf));
-+                              _dl_memset (rpnt->next, 0, sizeof (struct dyn_elf));
-+                              rpnt = rpnt->next;
-+                              if (!tpnt1->symbol_scope) tpnt1->symbol_scope = rpnt;
-+                              rpnt->dyn = tpnt1;
-+
-+                      }
-+              }
-+      }
-+
-+      /*
-+       * OK, now attach the entire chain at the end
-+       */
-+      rpnt->next = _dl_symbol_tables;
-+
-+#ifdef __mips__
-+      /*
-+       * Relocation of the GOT entries for MIPS have to be done
-+       * after all the libraries have been loaded.
-+       */
-+      _dl_perform_mips_global_got_relocations(tpnt);
-+#endif
-+
-+#ifdef __SUPPORT_LD_DEBUG__
-+      if(_dl_debug) 
-+      _dl_dprintf(_dl_debug_file, "Beginning dlopen relocation fixups\n");
-+#endif
-+      /*
-+       * OK, now all of the kids are tucked into bed in their proper addresses.
-+       * Now we go through and look for REL and RELA records that indicate fixups
-+       * to the GOT tables.  We need to do this in reverse order so that COPY
-+       * directives work correctly */
-+      if (_dl_fixup(dyn_chain->dyn, dyn_chain->flags))
-+              goto oops;
-+
-+#ifdef __SUPPORT_LD_DEBUG__
-+      if(_dl_debug) 
-+      _dl_dprintf(_dl_debug_file, "Beginning dlopen copy fixups\n");
-+#endif
-+      if (_dl_symbol_tables) {
-+              if (_dl_copy_fixups(dyn_chain))
-+                      goto oops;
-+      }
-+
-+
-+      /* TODO:  Should we set the protections of all pages back to R/O now ? */
-+      
-+
-+      /* Notify the debugger we have added some objects. */
-+      _dl_debug_addr->r_state = RT_ADD;
-+      if (_dl_debug_addr) {
-+              dl_brk = (void (*)(void)) _dl_debug_addr->r_brk;
-+              if (dl_brk != NULL) {
-+                      _dl_debug_addr->r_state = RT_ADD;
-+                      (*dl_brk) ();
-+
-+                      _dl_debug_addr->r_state = RT_CONSISTENT;
-+                      (*dl_brk) ();
-+              }
-+      }
-+
-+#if 0 //def __SUPPORT_LD_DEBUG__
-+      if(_dl_debug) 
-+      _dlinfo();
-+#endif
-+
-+#ifdef __LIBDL_SHARED__
-+      /* Find the last library so we can run things in the right order */
-+      for (tpnt = dyn_chain->dyn; tpnt->next!=NULL; tpnt = tpnt->next)
-+          ;
-+
-+      /* Run the ctors and set up the dtors */
-+      for (; tpnt != dyn_chain->dyn->prev; tpnt=tpnt->prev)
-+      {
-+              /* Apparently crt1 for the application is responsible for handling this.
-+               * We only need to run the init/fini for shared libraries
-+               */
-+              if (tpnt->libtype == program_interpreter)
-+                      continue;
-+              if (tpnt->libtype == elf_executable)
-+                      continue;
-+              if (tpnt->init_flag & INIT_FUNCS_CALLED)
-+                      continue;
-+              tpnt->init_flag |= INIT_FUNCS_CALLED;
-+
-+              if (tpnt->dynamic_info[DT_INIT]) {
-+                  void (*dl_elf_func) (void);
-+                  dl_elf_func = (void (*)(void)) (tpnt->loadaddr + tpnt->dynamic_info[DT_INIT]);
-+                  if (dl_elf_func && *dl_elf_func != NULL) {
-+#ifdef __SUPPORT_LD_DEBUG__
-+                      if(_dl_debug) 
-+                      _dl_dprintf(2, "running ctors for library %s at '%x'\n", tpnt->libname, dl_elf_func);
-+#endif
-+                      (*dl_elf_func) ();
-+                  }
-+              }
-+              if (tpnt->dynamic_info[DT_FINI]) {
-+                  void (*dl_elf_func) (void);
-+                  dl_elf_func = (void (*)(void)) (tpnt->loadaddr + tpnt->dynamic_info[DT_FINI]);
-+                  if (dl_elf_func && *dl_elf_func != NULL) {
-+#ifdef __SUPPORT_LD_DEBUG__
-+                      if(_dl_debug) 
-+                      _dl_dprintf(2, "setting up dtors for library %s at '%x'\n", tpnt->libname, dl_elf_func);
-+#endif
-+                      atexit(dl_elf_func);
-+                  }
-+              }
-+      }
-+#endif
-+      return (void *) dyn_chain;
-+
-+oops:
-+      /* Something went wrong.  Clean up and return NULL. */
-+      _dl_unmap_cache();
-+      do_dlclose(dyn_chain, 0);
-+      return NULL;
-+}
-+
-+void *_dlsym(void *vhandle, const char *name)
-+{
-+      struct elf_resolve *tpnt, *tfrom;
-+      struct dyn_elf *handle;
-+      ElfW(Addr) from;
-+      struct dyn_elf *rpnt;
-+      void *ret;
-+
-+      handle = (struct dyn_elf *) vhandle;
-+
-+      /* First of all verify that we have a real handle
-+         of some kind.  Return NULL if not a valid handle. */
-+
-+      if (handle == NULL)
-+              handle = _dl_symbol_tables;
-+      else if (handle != RTLD_NEXT && handle != _dl_symbol_tables) {
-+              for (rpnt = _dl_handles; rpnt; rpnt = rpnt->next_handle)
-+                      if (rpnt == handle)
-+                              break;
-+              if (!rpnt) {
-+                      _dl_error_number = LD_BAD_HANDLE;
-+                      return NULL;
-+              }
-+      } else if (handle == RTLD_NEXT) {
-+              /*
-+               * Try and locate the module we were called from - we
-+               * need this so that we know where to start searching
-+               * from.  We never pass RTLD_NEXT down into the actual
-+               * dynamic loader itself, as it doesn't know
-+               * how to properly treat it.
-+               */
-+              from = (ElfW(Addr)) __builtin_return_address(0);
-+
-+              tfrom = NULL;
-+              for (rpnt = _dl_symbol_tables; rpnt; rpnt = rpnt->next) {
-+                      tpnt = rpnt->dyn;
-+                      if (tpnt->loadaddr < from
-+                              && (tfrom == NULL || tfrom->loadaddr < tpnt->loadaddr)) {
-+                              tfrom = tpnt;
-+                              handle = rpnt->next;
-+                      }
-+              }
-+      }
-+
-+      ret = _dl_find_hash((char*)name, handle, NULL, copyrel);
-+
-+      /*
-+       * Nothing found.
-+       */
-+      if (!ret)
-+              _dl_error_number = LD_NO_SYMBOL;
-+      return ret;
-+}
-+
-+int _dlclose(void *vhandle)
-+{
-+      return do_dlclose(vhandle, 1);
-+}
-+
-+static int do_dlclose(void *vhandle, int need_fini)
-+{
-+      struct dyn_elf *rpnt, *rpnt1;
-+      struct dyn_elf *spnt, *spnt1;
-+      ElfW(Phdr) *ppnt;
-+      struct elf_resolve *tpnt;
-+      int (*dl_elf_fini) (void);
-+      void (*dl_brk) (void);
-+      struct dyn_elf *handle;
-+      unsigned int end;
-+      int i = 0;
-+
-+      handle = (struct dyn_elf *) vhandle;
-+      rpnt1 = NULL;
-+      for (rpnt = _dl_handles; rpnt; rpnt = rpnt->next_handle) {
-+              if (rpnt == handle) {
-+                      break;
-+              }
-+              rpnt1 = rpnt;
-+      }
-+
-+      if (!rpnt) {
-+              _dl_error_number = LD_BAD_HANDLE;
-+              return 1;
-+      }
-+
-+      /* OK, this is a valid handle - now close out the file.
-+       * We check if we need to call fini () on the handle. */
-+      spnt = need_fini ? handle : handle->next;
-+      for (; spnt; spnt = spnt1) {
-+              spnt1 = spnt->next;
-+
-+              /* We appended the module list to the end - when we get back here, 
-+                 quit. The access counts were not adjusted to account for being here. */
-+              if (spnt == _dl_symbol_tables)
-+                      break;
-+              if (spnt->dyn->usage_count == 1
-+                      && spnt->dyn->libtype == loaded_file) {
-+                      tpnt = spnt->dyn;
-+                      /* Apparently crt1 for the application is responsible for handling this.
-+                       * We only need to run the init/fini for shared libraries
-+                       */
-+
-+                      if (tpnt->dynamic_info[DT_FINI]) {
-+                              dl_elf_fini = (int (*)(void)) (tpnt->loadaddr + 
-+                                      tpnt->dynamic_info[DT_FINI]);
-+                              (*dl_elf_fini) ();
-+                      }
-+              }
-+      }
-+      if (rpnt1)
-+              rpnt1->next_handle = rpnt->next_handle;
-+      else
-+              _dl_handles = rpnt->next_handle;
-+
-+      /* OK, this is a valid handle - now close out the file */
-+      for (rpnt = handle; rpnt; rpnt = rpnt1) {
-+              rpnt1 = rpnt->next;
-+
-+              /* We appended the module list to the end - when we get back here, 
-+                 quit. The access counts were not adjusted to account for being here. */
-+              if (rpnt == _dl_symbol_tables)
-+                      break;
-+
-+              rpnt->dyn->usage_count--;
-+              if (rpnt->dyn->usage_count == 0
-+                      && rpnt->dyn->libtype == loaded_file) {
-+                      tpnt = rpnt->dyn;
-+                      /* Apparently crt1 for the application is responsible for handling this.
-+                       * We only need to run the init/fini for shared libraries
-+                       */
-+#if 0
-+
-+                      /* We have to do this above, before we start closing objects.  
-+                       * Otherwise when the needed symbols for _fini handling are 
-+                       * resolved a coredump would occur. Rob Ryan (robr@cmu.edu)*/ 
-+                      if (tpnt->dynamic_info[DT_FINI]) { 
-+                          dl_elf_fini = (int (*)(void)) (tpnt->loadaddr + tpnt->dynamic_info[DT_FINI]);
-+                              (*dl_elf_fini) ();
-+                      }
-+#endif
-+                      end = 0;
-+                      for (i = 0, ppnt = rpnt->dyn->ppnt;
-+                               i < rpnt->dyn->n_phent; ppnt++, i++) {
-+                              if (ppnt->p_type != PT_LOAD)
-+                                      continue;
-+                              if (end < ppnt->p_vaddr + ppnt->p_memsz)
-+                                      end = ppnt->p_vaddr + ppnt->p_memsz;
-+                      }
-+                      _dl_munmap((void*)rpnt->dyn->loadaddr, end);
-+                      /* Next, remove rpnt->dyn from the loaded_module list */
-+                      if (_dl_loaded_modules == rpnt->dyn) {
-+                              _dl_loaded_modules = rpnt->dyn->next;
-+                              if (_dl_loaded_modules)
-+                                      _dl_loaded_modules->prev = 0;
-+                      } else
-+                              for (tpnt = _dl_loaded_modules; tpnt; tpnt = tpnt->next)
-+                                      if (tpnt->next == rpnt->dyn) {
-+                                              tpnt->next = tpnt->next->next;
-+                                              if (tpnt->next)
-+                                                      tpnt->next->prev = tpnt;
-+                                              break;
-+                                      }
-+                      free(rpnt->dyn->libname);
-+                      free(rpnt->dyn);
-+              }
-+              free(rpnt);
-+      }
-+
-+
-+      if (_dl_debug_addr) {
-+          dl_brk = (void (*)(void)) _dl_debug_addr->r_brk;
-+          if (dl_brk != NULL) {
-+              _dl_debug_addr->r_state = RT_DELETE;
-+              (*dl_brk) ();
-+
-+              _dl_debug_addr->r_state = RT_CONSISTENT;
-+              (*dl_brk) ();
-+          }
-+      }
-+
-+      return 0;
-+}
-+
-+const char *_dlerror(void)
-+{
-+      const char *retval;
-+
-+      if (!_dl_error_number)
-+              return NULL;
-+      retval = dl_error_names[_dl_error_number];
-+      _dl_error_number = 0;
-+      return retval;
-+}
-+
-+/*
-+ * Dump information to stderrr about the current loaded modules
-+ */
-+static char *type[] = { "Lib", "Exe", "Int", "Mod" };
-+
-+void _dlinfo(void)
-+{
-+      struct elf_resolve *tpnt;
-+      struct dyn_elf *rpnt, *hpnt;
-+
-+      _dl_dprintf(2, "List of loaded modules\n");
-+      /* First start with a complete list of all of the loaded files. */
-+      for (tpnt = _dl_loaded_modules; tpnt; tpnt = tpnt->next) { 
-+              _dl_dprintf(2, "\t%x %x %x %s %d %s\n", 
-+                      (unsigned) tpnt->loadaddr, (unsigned) tpnt,
-+                      (unsigned) tpnt->symbol_scope,
-+                      type[tpnt->libtype],
-+                      tpnt->usage_count, tpnt->libname);
-+      }
-+
-+      /* Next dump the module list for the application itself */
-+      _dl_dprintf(2, "\nModules for application (%x):\n",
-+                               (unsigned) _dl_symbol_tables);
-+      for (rpnt = _dl_symbol_tables; rpnt; rpnt = rpnt->next)
-+              _dl_dprintf(2, "\t%x %s\n", (unsigned) rpnt->dyn, rpnt->dyn->libname);
-+
-+      for (hpnt = _dl_handles; hpnt; hpnt = hpnt->next_handle) {
-+              _dl_dprintf(2, "Modules for handle %x\n", (unsigned) hpnt);
-+              for (rpnt = hpnt; rpnt; rpnt = rpnt->next)
-+                      _dl_dprintf(2, "\t%x %s\n", (unsigned) rpnt->dyn, 
-+                              rpnt->dyn->libname);
-+      }
-+}
-+
-+int _dladdr(void *__address, Dl_info * __dlip)
-+{
-+      struct elf_resolve *pelf;
-+      struct elf_resolve *rpnt;
-+
-+      _dl_map_cache();
-+
-+      /*
-+       * Try and locate the module address is in
-+       */
-+      pelf = NULL;
-+
-+#if 0
-+      _dl_dprintf(2, "dladdr( %x, %x )\n", __address, __dlip);
-+#endif
-+
-+      for (rpnt = _dl_loaded_modules; rpnt; rpnt = rpnt->next) {
-+              struct elf_resolve *tpnt;
-+
-+              tpnt = rpnt;
-+#if 0
-+              _dl_dprintf(2, "Module \"%s\" at %x\n", 
-+                      tpnt->libname, tpnt->loadaddr);
-+#endif
-+              if (tpnt->loadaddr < (ElfW(Addr)) __address
-+                      && (pelf == NULL || pelf->loadaddr < tpnt->loadaddr)) {
-+                  pelf = tpnt;
-+              }
-+      }
-+
-+      if (!pelf) {
-+              return 0;
-+      }
-+
-+      /*
-+       * Try and locate the symbol of address
-+       */
-+
-+      {
-+              char *strtab;
-+              Elf32_Sym *symtab;
-+              int hn, si;
-+              int sf;
-+              int sn = 0;
-+              ElfW(Addr) sa;
-+
-+              sa = 0;
-+              symtab = (Elf32_Sym *) (pelf->dynamic_info[DT_SYMTAB] + pelf->loadaddr);
-+              strtab = (char *) (pelf->dynamic_info[DT_STRTAB] + pelf->loadaddr);
-+
-+              sf = 0;
-+              for (hn = 0; hn < pelf->nbucket; hn++) {
-+                      for (si = pelf->elf_buckets[hn]; si; si = pelf->chains[si]) {
-+                              ElfW(Addr) symbol_addr;
-+
-+                              symbol_addr = pelf->loadaddr + symtab[si].st_value;
-+                              if (symbol_addr <= (ElfW(Addr))__address && (!sf || sa < symbol_addr)) {
-+                                      sa = symbol_addr;
-+                                      sn = si;
-+                                      sf = 1;
-+                              }
-+#if 0
-+                              _dl_dprintf(2, "Symbol \"%s\" at %x\n", 
-+                                      strtab + symtab[si].st_name, symbol_addr);
-+#endif
-+                      }
-+              }
-+
-+              if (sf) {
-+                      __dlip->dli_fname = pelf->libname;
-+                      __dlip->dli_fbase = (void *)pelf->loadaddr;
-+                      __dlip->dli_sname = strtab + symtab[sn].st_name;
-+                      __dlip->dli_saddr = (void *)sa;
-+              }
-+              return 1;
-+      }
-+}
-diff -urN uClibc/ldso-0.9.24/man/Makefile uClibc.ldso.24/ldso-0.9.24/man/Makefile
---- uClibc/ldso-0.9.24/man/Makefile    1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/man/Makefile    2003-10-18 05:18:37.000000000 -0500
-@@ -0,0 +1,33 @@
-+# Makefile for uClibc
-+#
-+# Copyright (C) 2000,2001 Erik Andersen <andersen@uclibc.org>
-+#
-+# This program is free software; you can redistribute it and/or modify it under
-+# the terms of the GNU Library General Public License as published by the Free
-+# Software Foundation; either version 2 of the License, or (at your option) any
-+# later version.
-+#
-+# This program is distributed in the hope that it will be useful, but WITHOUT
-+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-+# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
-+# details.
-+#
-+# You should have received a copy of the GNU Library General Public License
-+# along with this program; if not, write to the Free Software Foundation, Inc.,
-+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-+#
-+# Derived in part from the Linux-8086 C library, the GNU C Library, and several
-+# other sundry sources.  Files within this library are copyright by their
-+# respective copyright holders.
-+
-+include ../Config.mk
-+
-+ALL = #ld.so.info
-+
-+all:  $(ALL)
-+
-+ld.so.info: ld.so.texi
-+      makeinfo $<
-+
-+clean:
-+      $(RM) $(ALL) *~
-diff -urN uClibc/ldso-0.9.24/man/dlopen.3 uClibc.ldso.24/ldso-0.9.24/man/dlopen.3
---- uClibc/ldso-0.9.24/man/dlopen.3    1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/man/dlopen.3    2001-04-23 12:43:54.000000000 -0500
-@@ -0,0 +1,218 @@
-+.\" -*- nroff -*-
-+.\" Copyright 1995 Yggdrasil Computing, Incorporated.
-+.\" written by Adam J. Richter (adam@yggdrasil.com),
-+.\" with typesetting help from Daniel Quinlan (quinlan@yggdrasil.com).
-+.\"
-+.\" This is free documentation; 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, or (at your option) any later version.
-+.\"
-+.\" The GNU General Public License's references to "object code"
-+.\" and "executables" are to be interpreted as the output of any
-+.\" document formatting or typesetting system, including
-+.\" intermediate and printed output.
-+.\"
-+.\" This manual is distributed in the hope that it will be useful,
-+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
-+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+.\" GNU General Public License for more details.
-+.\"
-+.\" You should have received a copy of the GNU General Public
-+.\" License along with this manual; if not, write to the Free
-+.\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
-+.\" USA.
-+.\"
-+.TH DLOPEN 3 "16 May 1995" "Linux" "Linux Programmer's Manual"
-+.SH NAME
-+dlclose, dlerror, dlopen, dlsym \- Programming interface to dynamic linking loader.
-+.SH SYNOPSIS
-+.B #include <dlfcn.h>
-+.sp
-+.BI "void *dlopen (const char *" "filename" ", int " flag ");
-+.br
-+.BI "const char *dlerror(void);"
-+.br
-+.BI "void *dlsym(void *"handle ", char *"symbol ");"
-+.br
-+.BI "int dladdr(void *"address ", Dl_info *"dlip ");"
-+.br
-+.BI "int dlclose (void *"handle ");
-+.sp
-+Special symbols:
-+.BR "_init" ", " "_fini" ". "
-+.SH DESCRIPTION
-+.B dlopen
-+loads a dynamic library from the file named by the null terminated
-+string
-+.I filename
-+and returns an opaque "handle" for the dynamic library.
-+If
-+.I filename
-+is not an absolute path (i.e., it does not begin with a "/"), then the
-+file is searched for in the following locations:
-+.RS
-+.PP
-+A colon-separated list of directories in the user's
-+\fBLD_LIBRARY\fP path environment variable.
-+.PP
-+The list of libraries specified in \fI/etc/ld.so.cache\fP.
-+.PP
-+\fI/usr/lib\fP, followed by \fI/lib\fP.
-+.RE
-+.PP
-+If
-+.I filename
-+is a NULL pointer, then the returned handle is for the main program.
-+.PP
-+External references in the library are resolved using the libraries
-+in that library's dependency list and any other libraries previously
-+opened with the 
-+.B RTLD_GLOBAL
-+flag.
-+If the executable was linked
-+with the flag "-rdynamic", then the global symbols in the executable
-+will also be used to resolve references in a dynamically loaded
-+library.
-+.PP
-+.I flag
-+must be either
-+.BR RTLD_LAZY ,
-+meaning resolve undefined symbols as code from the dynamic library is
-+executed, or
-+.BR RTLD_NOW ,
-+meaning resolve all undefined symbols before
-+.B dlopen
-+returns, and fail if this cannot be done.
-+Optionally,
-+.B RTLD_GLOBAL
-+may be or'ed with
-+.IR flag,
-+in which case the external symbols defined in the library will be
-+made available to subsequently loaded libraries.
-+.PP
-+If the library exports a routine named
-+.BR _init ,
-+then that code is executed before dlopen returns.
-+If the same library is loaded twice with
-+.BR dlopen() ,
-+the same file handle is returned.  The dl library maintains link
-+counts for dynamic file handles, so a dynamic library is not
-+deallocated until
-+.B dlclose
-+has been called on it as many times as
-+.B dlopen
-+has succeeded on it.
-+.PP
-+If
-+.B dlopen
-+fails for any reason, it returns NULL.
-+A human readable string describing the most recent error that occurred
-+from any of the dl routines (dlopen, dlsym or dlclose) can be
-+extracted with
-+.BR dlerror() .
-+.B dlerror
-+returns NULL if no errors have occurred since initialization or since
-+it was last called.  (Calling
-+.B dlerror()
-+twice consecutively, will always result in the second call returning
-+NULL.)
-+
-+.B dlsym
-+takes a "handle" of a dynamic library returned by dlopen and the null
-+terminated symbol name, returning the address where that symbol is
-+loaded.  If the symbol is not found,
-+.B dlsym
-+returns NULL; however, the correct way to test for an error from
-+.B dlsym
-+is to save the result of
-+.B dlerror
-+into a variable, and then check if saved value is not NULL.
-+This is because the value of the symbol could actually be NULL.
-+It is also necessary to save the results of
-+.B dlerror
-+into a variable because if
-+.B dlerror
-+is called again, it will return NULL.
-+.PP
-+.B dladdr
-+returns information about the shared library containing the memory 
-+location specified by
-+.IR address .
-+.B dladdr
-+returns zero on success and non-zero on error.
-+.PP
-+.B dlclose
-+decrements the reference count on the dynamic library handle
-+.IR handle .
-+If the reference count drops to zero and no other loaded libraries use
-+symbols in it, then the dynamic library is unloaded.  If the dynamic
-+library exports a routine named
-+.BR _fini ,
-+then that routine is called just before the library is unloaded.
-+.SH EXAMPLES
-+.B Load the math library, and print the cosine of 2.0:
-+.RS
-+.nf
-+.if t .ft CW
-+#include <dlfcn.h>
-+
-+int main(int argc, char **argv) {
-+    void *handle = dlopen ("/lib/libm.so", RTLD_LAZY);
-+    double (*cosine)(double) = dlsym(handle, "cos");
-+    printf ("%f\\n", (*cosine)(2.0));
-+    dlclose(handle);
-+}
-+.if t .ft P
-+.fi
-+.PP
-+If this program were in a file named "foo.c", you would build the program
-+with the following command:
-+.RS
-+.LP
-+gcc -rdynamic -o foo foo.c -ldl
-+.RE
-+.RE
-+.LP
-+.B Do the same thing, but check for errors at every step:
-+.RS
-+.nf
-+.if t .ft CW
-+#include <stdio.h>
-+#include <dlfcn.h>
-+
-+int main(int argc, char **argv) {
-+    void *handle;
-+    double (*cosine)(double);
-+    char *error;
-+
-+    handle = dlopen ("/lib/libm.so", RTLD_LAZY);
-+    if (!handle) {
-+        fputs (dlerror(), stderr);
-+        exit(1);
-+    }
-+
-+    cosine = dlsym(handle, "cos");
-+    if ((error = dlerror()) != NULL)  {
-+        fputs(error, stderr);
-+        exit(1);
-+    }
-+
-+    printf ("%f\\n", (*cosine)(2.0));
-+    dlclose(handle);
-+}
-+.if t .ft P
-+.fi
-+.RE
-+.SH ACKNOWLEDGEMENTS
-+The dlopen interface standard comes from Solaris.
-+The Linux dlopen implementation was primarily written by
-+Eric Youngdale with help from Mitch D'Souza, David Engel,
-+Hongjiu Lu, Andreas Schwab and others.
-+The manual page was written by Adam Richter.
-+.SH SEE ALSO
-+.BR ld(1) ,
-+.BR ld.so(8) ,
-+.BR ldconfig(8) ,
-+.BR ldd(1) ,
-+.BR ld.so.info .
-diff -urN uClibc/ldso-0.9.24/man/ld.so.8 uClibc.ldso.24/ldso-0.9.24/man/ld.so.8
---- uClibc/ldso-0.9.24/man/ld.so.8     1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/man/ld.so.8     2001-04-23 12:43:54.000000000 -0500
-@@ -0,0 +1,113 @@
-+.TH ld.so 8 "14 March 1998"
-+.SH NAME
-+ld.so/ld-linux.so \- dynamic linker/loader
-+.SH DESCRIPTION
-+.B ld.so
-+loads the shared libraries needed by a program, prepares the program
-+to run, and then runs it.
-+Unless explicitly specified via the
-+.B \-static
-+option to
-+.B ld
-+during compilation, all Linux programs are incomplete and require 
-+further linking at run time.
-+.PP
-+The necessary shared libraries needed by the program are searched for 
-+in the following order
-+.IP o
-+Using the environment variable
-+.B LD_LIBRARY_PATH
-+.RB ( LD_AOUT_LIBRARY_PATH
-+for a.out programs).
-+Except if the executable is a setuid/setgid binary, in which case it
-+is ignored.
-+.IP o
-+From the cache file
-+.BR /etc/ld.so.cache
-+which contains a compiled list of candidate libraries previously found
-+in the augmented library path.
-+.IP o
-+In the default path
-+.BR /usr/lib ,
-+and then
-+.BR /lib .
-+.SH ENVIRONMENT
-+.TP
-+.B LD_LIBRARY_PATH
-+A colon-separated list of directories in which to search for
-+ELF libraries at execution-time.
-+Similar to the 
-+.B PATH
-+environment variable.
-+.TP
-+.B LD_PRELOAD
-+A whitespace-separated list of additional, user-specified, ELF shared 
-+libraries to be loaded before all others.
-+This can be used to selectively override functions in other shared libraries.
-+For setuid/setgid ELF binaries, only libraries in the standard search
-+directories that are also setgid will be loaded.
-+.TP
-+.B LD_TRACE_LOADED_OBJECTS
-+If present, causes the program to list its dynamic library dependencies,
-+as if run by ldd, instead of running normally.
-+.TP
-+.B LD_BIND_NOW
-+If present, causes the dynamic linker to resolve all symbols at program
-+startup instead of when they are first referenced.
-+.TP
-+.B LD_AOUT_LIBRARY_PATH
-+A colon-separated list of directories in which to search for
-+a.out libraries at execution-time.
-+Similar to the 
-+.B PATH
-+environment variable.
-+.TP
-+.B LD_AOUT_PRELOAD
-+The name of an additional, user-specified, a.out shared library to be loaded 
-+after all others.
-+This can be used to selectively override functions in other shared libraries.
-+.TP
-+.B LD_NOWARN
-+Suppress warnings about a.out libraries with incompatible minor 
-+version numbers.
-+.TP
-+.B LD_KEEPDIR
-+Don't ignore the directory in the names of a.out libraries to be loaded.
-+Use of this option is strongly discouraged.
-+.SH FILES
-+.PD 0
-+.TP 20
-+.B /lib/ld.so
-+a.out dynamic linker/loader
-+.TP 20
-+.B /lib/ld-linux.so.*
-+ELF dynamic linker/loader
-+.TP
-+.B /etc/ld.so.cache
-+File containing a compiled list of directories in which to search for
-+libraries and an ordered list of candidate libraries.
-+.TP
-+.B /etc/ld.so.preload
-+File containing a whitespace separated list of ELF shared libraries to
-+be loaded before the program.
-+libraries and an ordered list of candidate libraries.
-+.TP
-+.B lib*.so*
-+shared libraries
-+.PD
-+.SH SEE ALSO
-+.BR ldd (1),
-+.BR ldconfig (8).
-+.SH BUGS
-+.LP
-+Currently
-+.B ld.so
-+has no means of unloading and searching for compatible or newer version of
-+libraries.
-+.PP
-+.B ld.so
-+functionality is only available for executables compiled using libc version
-+4.4.3 or greater.
-+.SH AUTHORS
-+David Engel, Eric Youngdale, Peter MacDonald, Hongjiu Lu, Linus
-+Torvalds, Lars Wirzenius and Mitch D'Souza (not necessarily in that order).
-diff -urN uClibc/ldso-0.9.24/man/ld.so.texi uClibc.ldso.24/ldso-0.9.24/man/ld.so.texi
---- uClibc/ldso-0.9.24/man/ld.so.texi  1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/man/ld.so.texi  2001-04-23 12:43:54.000000000 -0500
-@@ -0,0 +1,411 @@
-+\input texinfo @c -*-texinfo-*-
-+@c %**start of header
-+@setfilename ld.so.info
-+@settitle ld.so : Dynamic-Link Library support
-+@c %**end of header
-+
-+@ifinfo
-+This file documents the dynamic-link support libraries and utilities for the
-+Linux OS, version 1.8.1.
-+
-+Copyright 1996 Michael Deutschmann
-+
-+This document is subject to the GNU General Public License as published by 
-+the Free Software foundation, version 2 or later (your choice).
-+
-+Note: The software described in this document is under a different copyright
-+and license.
-+
-+@end ifinfo
-+
-+@titlepage 
-+@title ld.so
-+@subtitle Dynamic Link library support for the Linux OS.
-+@author David Engel
-+@author Eric Youngdale
-+@author Peter Macdonald 
-+@author Hongjiu Lu 
-+@author Mitch D'Souza
-+@author Michael Deutschmann (this documentation)
-+
-+@page
-+Copyright @copyright{} 1996 Michael Deutschmann
-+
-+This document is subject to the GNU General Public License as published by 
-+the Free Software foundation, version 2 or later (your choice).
-+
-+Note: The software described in this document is under a different copyright
-+and license.
-+@end titlepage
-+
-+@ifinfo
-+@node Top
-+@top
-+
-+The @code{ld.so} module provides dynamic linked library support in Linux.
-+This file documents @code{ld.so} and its companion software.
-+
-+@menu
-+* intro::     Introduction
-+
-+* ld.so::     The dynamic linker core program
-+* ldd::               A utility to print out dependencies
-+* ldconfig::  A utility to maintain the cache and symlinks
-+* libdl::     Manual dynamic linking library
-+@end menu
-+
-+@end ifinfo
-+
-+@node intro
-+@unnumbered Introduction
-+
-+The @code{ld.so} suite contains special files and utilities needed for linux
-+to handle @dfn{dynamic libraries}.
-+
-+Ordinary static libraries (@file{lib*.a} files) are included into executables
-+that use their functions. A file that only uses static libraries needs less
-+intelligence to load, but takes up more space. If many executables use the
-+same library, there can be much wastage of storage space, since multiple
-+copies of the library functions are scattered across the executables.
-+However, static libraries are easier to make.
-+
-+Dynamic libraries (@file{lib*.so*} files) are not copied into executables ---
-+the executable is written in such a way that it will automatically load the
-+libraries. In linux, the executable will first load the special library 
-+@code{ld.so} or @code{ld-linux.so}, which contains the intelligence
-+to load further dynamic libraries. Since multiple files end up getting
-+executable data from the same file, dynamic libraries are also known as
-+shared libraries.
-+
-+Linux executables come in two flavors, @sc{elf} and a.out.
-+
-+a.out is the original executable format used by Linux. It has somewhat less 
-+overhead than @sc{elf}. However creating shared libraries for a.out is
-+@emph{very} involved, and each a.out shared library must be explicitly 
-+registered.
-+ 
-+@sc{elf} is a more recent format, which supports a much simpler method of
-+creating libraries. @sc{elf} libraries may also be linked manually
-+(@pxref{libdl}).
-+
-+Since many library authors prefer @sc{elf} and no longer release shared a.out 
-+libraries, a.out is moribund on Linux. This version of the @code{ld.so} can
-+be compiled to support only @sc{elf}, or to support both formats. (The last
-+release of ld.so to support a.out alone was 1.8.0.)
-+
-+@node ld.so
-+@chapter @code{ld.so}: Dynamic linker core
-+
-+@code{ld.so} works behind the scenes to handle dynamic libraries in Linux.
-+Users will almost never have to deal with it directly, but in special cases
-+one can send instructions to it through environment variables. Also, if
-+something is wrong with your libraries (usually an incorrect version) ld.so
-+will give error messages.
-+
-+Actually @code{ld.so} is the a.out linker. The new @sc{elf} executables are
-+handled by a related program @code{ld-linux.so}.
-+
-+@menu
-+* files::     Configuration files used by the suite
-+* environment::       Environment settings that tweak @code{ld.so}
-+* errors::    Complaints @code{ld.so} might make
-+@end menu
-+
-+@node files
-+@section Configuration Files
-+
-+@table @file
-+@item /etc/ld.so.cache
-+A file created by @code{ldconfig} and used to speed linking. It's structure
-+is private to the suite.
-+
-+@item /etc/ld.so.conf
-+A simple list of directories to scan for libraries, in addition to
-+@file{/usr/lib} and @file{/lib}, which are hardwired. It may contain
-+comments started with a @samp{#}.
-+
-+@item /etc/ld.so.preload
-+A list of libraries to preload. This allows preloading libraries for
-+setuid/setgid executables securely. It may contain comments. 
-+@end table
-+
-+@node environment
-+@section Environment Variables
-+
-+@table @code
-+@item LD_AOUT_LIBRARY_PATH
-+@itemx LD_LIBRARY_PATH
-+These variables supply a library path for finding dynamic libraries, in the
-+standard colon seperated format. These variables are ignored when executing 
-+setuid/setgid programs, because otherwise they would be a security hazard. 
-+@code{ld.so} will use @code{LD_AOUT_LIBRARY_PATH} and @code{ld-linux.so} will 
-+use @code{LD_LIBRARY_PATH}.
-+
-+@item LD_AOUT_PRELOAD
-+@itemx LD_PRELOAD
-+These variables allow an extra library not specified in the executable to be
-+loaded. Generally this is only useful if you want to override a function. 
-+These are also ignored when running setuid/setgid executables. @code{ld.so} 
-+will use @code{LD_AOUT_PRELOAD} and @code{ld-linux.so} will use 
-+@code{LD_PRELOAD}.
-+
-+@item LD_NOWARN
-+If non-empty, errors about incompatible minor revisions are suppressed.
-+
-+@item LD_KEEPDIR
-+If non-empty, allow executables to specify absolute library names. This
-+option is deprecated.
-+@c FIXME:
-+@c The following are things I noticed in the ld-linux.so source.
-+@c I don't really understand 'em. Could someone help me?
-+@c
-+@c @item LD_BIND_NOW
-+@c This option is used by the @code{ld-linux.so} only. I don't know 
-+@c what it does. (I suspect, looking at the code, that it specifies
-+@c "RTLD_NOW" rather than "RTLD_LAZY" mode for the shared libraries.)
-+@c 
-+@c @item LD_TRACE_LOADED_OBJECTS
-+@c @itemx LD_WARN
-+@c These seem to have something to do with the communication between the
-+@c @code{ld-linux.so} and @code{ldd}. I don't know more.
-+@end table
-+
-+@node errors
-+@section Errors
-+
-+@table @samp
-+@item Can't find library @var{library}
-+The executable required a dynamically linked library that ld.so cannot find.
-+Your symbolic links may be not set right, or you may have not installed a 
-+library needed by the program.
-+
-+@item Can't load library @var{library}
-+The library is corrupt. 
-+
-+@item Incompatible library @var{library}
-+@itemx   Require major version @var{x} and found @var{y}
-+Your version of the library is incompatible with the executable. Recompiling
-+the executable, or upgrading the library will fix the problem.
-+
-+@item using incompatible library @var{library}
-+@itemx   Desire minor version >= @var{x} and found @var{y}.
-+Your version of the library is older than that expected by the executable,
-+but not so old that the library interface has radically changed, so the
-+linker will attempt to run anyway. There is a chance that it will work, but 
-+you should upgrade the library or recompile the software. The environment 
-+variable @code{LD_NOWARN} can be used to supress this message.
-+
-+@item too many directories in library path
-+The linker only supports up to 32 library directories. You have too many.
-+
-+@item dynamic linker error in @var{blah}
-+The linker is having trouble handling a binary - it is probably corrupt.
-+
-+@item can't map cache file @var{cache-file}
-+@itemx cache file @var{cache-file} @var{blah}
-+The linker cache file (generally @file{/etc/ld.so.cache}) is corrupt or
-+non-existent. These errors can be ignored, and can be prevented by 
-+regenerating the cache file with @code{ldconfig}.
-+@end table
-+
-+@node ldd
-+@chapter @code{ldd}: Dependency scanner
-+
-+@code{ldd} is a utility that prints out the dynamic libraries that an
-+executable is linked to. 
-+
-+Actually @code{ldd} works by signalling ld.so to print the dependencies. 
-+For a.out executables this is done by starting the executable with 
-+@code{argc} equal to 0. The linker detects this and prints the dependencies. 
-+(This can cause problems with @emph{very} old binaries, which would run as 
-+normal only with an inappropriate @code{argc}.)
-+
-+For @sc{elf} executables, special environment variables are used to tell the
-+linker to print the dependencies.
-+
-+@code{ldd} has a few options:
-+
-+@table @samp
-+@item -v
-+Print the version number of @code{ldd} itself
-+
-+@item -V
-+Print the version number of the dynamic linker
-+
-+@item -d
-+Report missing functions. This is only supported for @sc{elf} executables.
-+
-+@item -r
-+Report missing objects. This is also only available for @sc{elf}
-+executables.
-+@end table
-+
-+@node ldconfig
-+@chapter @code{ldconfig}: Setup program 
-+
-+This utility is used by the system administrator to automatically set up
-+symbolic links needed by the libraries, and also to set up the cache file.
-+
-+@code{ldconfig} is run after new dynamic libraries are installed, and if the 
-+cache file or links are damaged. It is also run when upgrading the
-+@code{ld.so} suite itself.
-+
-+The @file{/lib} and @file{/usr/lib} directories, and any listed in the file 
-+@file{/etc/ld.so.conf} are scanned by default unless @samp{-n} is used.
-+Additional directories may be specified on the command line.
-+
-+It has the following options:
-+
-+@table @samp
-+@item -D
-+Enter debug mode. Implies @samp{-N} and @samp{-X}.
-+
-+@item -v
-+Verbose. Print out links created and directories scanned.
-+
-+@item -n 
-+Check directories specified on the commandline @emph{only}.
-+
-+@item -N
-+Do not regenerate the cache.
-+
-+@item -X
-+Do not rebuild symbolic links.
-+
-+@item -l
-+Set up symbolic links for only libraries presented on the command line.
-+
-+@item -p
-+Print out the library pathnames in the cache file (@file{/etc/ld.so.cache})
-+@end table
-+
-+@node libdl
-+@chapter User dynamic linking library
-+
-+The @code{ld.so} package includes a small library of functions
-+(@code{libdl}) to allow manual dynamic linking. Normally programs are linked 
-+so that dynamic functions and objects are automagically available. These 
-+functions allow one to manually load and access a symbol from a library. 
-+They are only available for @sc{elf} executables.
-+
-+@menu
-+* using libdl::       General points
-+* functions:: How to use the functions
-+* example::   A sample program
-+@end menu
-+
-+@node using libdl
-+@section Overview
-+
-+To access this library, add the flag @samp{-ldl} to your compile command when
-+linking the executable. You also must include the header file
-+@code{dlfcn.h}. You may also need the flag @samp{-rdynamic}, which enables
-+resolving references in the loaded libraries against your executable.
-+
-+Generally, you will first use @code{dlopen} to open a library. Then you use
-+@code{dlsym} one or more times to access symbols. Finally you use
-+@code{dlclose} to close the library.
-+
-+These facilities are most useful for language interpreters that provide
-+access to external libraries. Without @code{libdl}, it would be neccessary
-+to link the interpreter executable with any and all external libraries
-+needed by the programs it runs. With @code{libdl}, the interpreter only 
-+needs to be linked with the libraries it uses itself, and can dynamically 
-+load in additional ones if programs need it.
-+
-+@node functions
-+@section Functions
-+
-+@deftypefun void *dlopen ( const char @var{filename}, int @var{flags} )
-+
-+This function opens the dynamic library specified by @var{filename}
-+and returns an abstract handle, which can be used in subsequent calls to 
-+@code{dlsym}. The function will respect the @code{LD_ELF_LIBRARY_PATH} and
-+@code{LD_LIBRARY_PATH} environment variables.
-+
-+@end deftypefun
-+
-+The following flags can be used with @code{dlopen}:
-+
-+@deftypevr Macro int RTLD_LAZY
-+Resolve symbols in the library as they are needed.
-+@end deftypevr
-+
-+@deftypevr Macro int RTLD_NOW
-+Resolve all symbols in the library before returning, and fail if not all can
-+be resolved. This is mutually exclusive with @code{RTLD_LAZY}.
-+@end deftypevr
-+
-+@deftypevr Macro int RTLD_GLOBAL
-+Make symbols in this library available for resolving symbols in other
-+libraries loaded with @code{dlopen}.
-+@end deftypevr
-+
-+@deftypefun int dlclose ( void *@var{handle} )
-+
-+This function releases a library handle.
-+
-+Note that if a library opened twice, the handle will be the same. However,
-+a reference count is used, so you should still close the library as many 
-+times as you open it.
-+
-+@end deftypefun
-+
-+@deftypefun void *dlsym (void *@var{handle},char *@var{symbol-name})
-+
-+This function looks up the name @var{symbol-name} in the library and returns
-+it in the void pointer.
-+
-+If there is an error, a null pointer will be returned. However, it is
-+possible for a valid name in the library to have a null value, so
-+@code{dlerror} should be used to check if there was an error.
-+
-+@end deftypefun
-+
-+@deftypefun {libdl function} {const char} *dlerror( void )
-+
-+This function is used to read the error state. It returns a human-readable
-+string describing the last error, or null, meaning no error.
-+
-+The function resets the error value each time it is called, so the result
-+should be copied into a variable. If the function is called more than once
-+after an error, the second and subsequent calls will return null.
-+
-+@end deftypefun
-+
-+@node example
-+@section Example program
-+
-+Here is an example program that prints the cosine of two by manually linking
-+to the math library:
-+ 
-+@example
-+@c The following was snarfed verbatim from the dlopen.3 man file.
-+#include <stdio.h>
-+#include <dlfcn.h>
-+
-+int main(int argc, char **argv) @{
-+    void *handle;
-+    double (*cosine)(double);
-+    char *error;
-+
-+    handle = dlopen ("/lib/libm.so", RTLD_LAZY);
-+    if (!handle) @{
-+        fputs (dlerror(), stderr);
-+        exit(1);
-+    @}
-+
-+    cosine = dlsym(handle, "cos");
-+    if ((error = dlerror()) != NULL)  @{
-+        fputs(error, stderr);
-+        exit(1);
-+    @}
-+
-+    printf ("%f\\n", (*cosine)(2.0));
-+    dlclose(handle);
-+@}
-+@end example
-+
-+@contents
-+
-+@bye
-diff -urN uClibc/ldso-0.9.24/man/ldconfig.8 uClibc.ldso.24/ldso-0.9.24/man/ldconfig.8
---- uClibc/ldso-0.9.24/man/ldconfig.8  1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/man/ldconfig.8  2001-04-23 12:43:54.000000000 -0500
-@@ -0,0 +1,189 @@
-+.TH ldconfig 8 "14 March 1998"
-+.SH NAME
-+ldconfig \- determine run-time link bindings
-+.SH SYNOPSIS
-+ldconfig
-+.RB [ \-DvqnNX ]
-+.RB [ \-f\ conf ]
-+.RB [ \-C\ cache ]
-+.RB [ \-r\ root ]
-+.IR directory \ ...
-+.PD 0
-+.PP
-+.PD
-+ldconfig
-+.B \-l
-+.RB [ \-Dvq ]
-+.IR library \ ...
-+.PD 0
-+.PP
-+.PD
-+ldconfig
-+.B \-p
-+.SH DESCRIPTION
-+.B ldconfig
-+creates the necessary links and cache (for use by the run-time linker,
-+.IR ld.so )
-+to the most recent shared libraries found in the directories specified
-+on the command line, in the file
-+.IR /etc/ld.so.conf ,
-+and in the trusted directories
-+.RI ( /usr/lib
-+and
-+.IR /lib ).
-+.B ldconfig
-+checks the header and file names of the libraries it encounters when
-+determining which versions should have their links updated.
-+.B ldconfig
-+ignores symbolic links when scanning for libraries. 
-+.PP
-+.B ldconfig
-+will attempt to deduce the type of ELF libs (ie. libc5 or libc6/glibc)
-+based on what C libs if any the library was linked against, therefore when
-+making dynamic libraries, it is wise to explicitly link against libc (use -lc).
-+.PP
-+Some existing libs do not contain enough information to allow the deduction of 
-+their type, therefore the 
-+.IR /etc/ld.so.conf 
-+file format allows the specification of an expected type.  This is 
-+.B only
-+used for those ELF libs which we can not work out. The format 
-+is like this "dirname=TYPE", where type can be libc4, libc5 or libc6.
-+(This syntax also works on the command line).  Spaces are 
-+.B not 
-+allowed.  Also see the 
-+.B -p 
-+option.
-+.PP 
-+Directory names containing an
-+.B = are no longer legal
-+unless they also have an expected type specifier.
-+.PP
-+.B ldconfig
-+should normally be run by the super-user as it may require write 
-+permission on some root owned directories and files.
-+It is normally run automatically at bootup, from /etc/rc, or manually
-+whenever new DLL's are installed.
-+.SH OPTIONS
-+.TP
-+.B \-D
-+Debug mode.
-+Implies
-+.B \-N
-+and
-+.BR \-X .
-+.TP
-+.B \-v
-+Verbose mode.
-+Print current version number, the name of each directory as it
-+is scanned and any links that are created.
-+Overrides quiet mode.
-+.TP
-+.B \-q
-+Quiet mode.
-+Don't print warnings.
-+.TP
-+.B \-n
-+Only process directories specified on the command line.
-+Don't process the trusted directories
-+.RI ( /usr/lib
-+and
-+.IR /lib )
-+nor those specified in
-+.IR /etc/ld.so.conf .
-+Implies
-+.BR \-N .
-+.TP
-+.B \-N
-+Don't rebuild the cache.
-+Unless
-+.B \-X
-+is also specified, links are still updated.
-+.TP
-+.B \-X
-+Don't update links.
-+Unless
-+.B \-N
-+is also specified, the cache is still rebuilt.
-+.TP
-+.B \-f conf
-+Use
-+.B conf
-+instead of
-+.IR /etc/ld.so.conf .
-+.TP
-+.B \-C cache
-+Use
-+.B cache
-+instead of
-+.IR /etc/ld.so.cache .
-+.TP
-+.B \-r root
-+Change to and use
-+.B root
-+as the root directory.
-+.TP
-+.B \-l
-+Library mode.
-+Manually link individual libraries.
-+Intended for use by experts only.
-+.TP
-+.B \-p
-+Print the lists of directories and candidate libraries stored in
-+the current cache.
-+.SH EXAMPLES
-+In the bootup file
-+.I /etc/rc
-+having the line
-+.RS
-+
-+/sbin/ldconfig -v
-+
-+.RE
-+will set up the correct links for the shared binaries and rebuild
-+the cache.
-+.TP
-+On the command line
-+.RS
-+
-+# /sbin/ldconfig -n /lib
-+
-+.RE
-+as root after the installation of a new DLL, will properly update the
-+shared library symbolic links in /lib.
-+
-+.SH FILES
-+.PD 0
-+.TP 20
-+.B /lib/ld.so
-+execution time linker/loader
-+.TP 20
-+.B /etc/ld.so.conf
-+File containing a list of colon, space, tab, newline, or comma spearated
-+directories in which to search for libraries.
-+.TP 20
-+.B /etc/ld.so.cache
-+File containing an ordered list of libraries found in the directories
-+specified in
-+.BR /etc/ld.so.conf .
-+.TP
-+.B lib*.so.version
-+shared libraries
-+.PD
-+.SH SEE ALSO
-+.BR ldd (1),
-+.BR ld.so (8).
-+.SH BUGS
-+.LP
-+.BR ldconfig 's
-+functionality, in conjunction with
-+.BR ld.so ,
-+is only available for executables compiled using libc version 4.4.3 or greater.
-+.PP
-+.BR ldconfig ,
-+being a user process, must be run manually and has no means of dynamically
-+determining and relinking shared libraries for use by
-+.BR ld.so
-+when a new DLL is installed.
-+.SH AUTHORS
-+David Engel and Mitch D'Souza.
-diff -urN uClibc/ldso-0.9.24/man/ldd.1 uClibc.ldso.24/ldso-0.9.24/man/ldd.1
---- uClibc/ldso-0.9.24/man/ldd.1       1969-12-31 18:00:00.000000000 -0600
-+++ uClibc.ldso.24/ldso-0.9.24/man/ldd.1       2001-04-23 12:43:54.000000000 -0500
-@@ -0,0 +1,59 @@
-+.\" Copyright 1995-2000 David Engel (david@ods.com)
-+.\" Copyright 1995 Rickard E. Faith (faith@cs.unc.edu)
-+.\" Most of this was copied from the README file.  Do not restrict distribution.
-+.\" May be distributed under the GNU General Public License
-+.TH LDD 1 "14 March 1998"
-+.SH NAME
-+ldd \- print shared library dependencies
-+.SH SYNOPSIS
-+.B ldd
-+.RB [ \-vVdr ]
-+program|library ...
-+.SH DESCRIPTION
-+.B ldd
-+prints the shared libraries required by each program or shared library
-+specified on the command line.
-+If a shared library name does not contain a '/',
-+.B ldd
-+attempts to locate the library in the standard locations.
-+To run
-+.B ldd
-+on a shared library in the current directory, a "./" must be prepended
-+to its name.
-+.SH OPTIONS
-+.TP
-+.B \-v
-+Print the version number of
-+.BR ldd .
-+.TP
-+.B \-V
-+Print the version number of the dynamic linker,
-+.BR ld.so .
-+.TP
-+.B \-d
-+Perform relocations and report any missing functions (ELF only).
-+.TP
-+.B \-r
-+Perform relocations for both data objects and functions, and
-+report any missing objects (ELF only).
-+.SH BUGS
-+.B ldd
-+does not work very well on libc.so.5 itself.
-+.PP
-+.B ldd
-+does not work on a.out shared libraries.
-+.PP
-+.B ldd
-+does not work with some extremely old a.out programs which were 
-+built before
-+.B ldd
-+support was added to the compiler releases.
-+If you use
-+.B ldd
-+on one of these programs, the program will attempt to run with argc = 0 and
-+the results will be unpredictable.
-+.SH AUTHOR
-+David Engel.
-+.SH SEE ALSO
-+.BR ldconfig (8),
-+.BR ld.so (8).
diff --git a/obsolete-buildroot/sources/uClibc.config b/obsolete-buildroot/sources/uClibc.config
deleted file mode 100644 (file)
index 509a3dd..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-#
-# Automatically generated make config: don't edit
-#
-# TARGET_alpha is not set
-# TARGET_arm is not set
-# TARGET_bfin is not set
-# TARGET_cris is not set
-# TARGET_e1 is not set
-# TARGET_frv is not set
-# TARGET_h8300 is not set
-# TARGET_i386 is not set
-# TARGET_i960 is not set
-# TARGET_m68k is not set
-# TARGET_microblaze is not set
-TARGET_mips=y
-# TARGET_nios is not set
-# TARGET_nios2 is not set
-# TARGET_powerpc is not set
-# TARGET_sh is not set
-# TARGET_sparc is not set
-# TARGET_v850 is not set
-
-#
-# Target Architecture Features and Options
-#
-HAVE_ELF=y
-ARCH_SUPPORTS_LITTLE_ENDIAN=y
-TARGET_ARCH="mips"
-ARCH_CFLAGS="-mno-split-addresses"
-ARCH_SUPPORTS_BIG_ENDIAN=y
-# CONFIG_MIPS_ISA_1 is not set
-CONFIG_MIPS_ISA_2=y
-# CONFIG_MIPS_ISA_3 is not set
-# CONFIG_MIPS_ISA_4 is not set
-# CONFIG_MIPS_ISA_MIPS32 is not set
-# CONFIG_MIPS_ISA_MIPS64 is not set
-ARCH_LITTLE_ENDIAN=y
-# ARCH_BIG_ENDIAN is not set
-# ARCH_HAS_NO_MMU is not set
-ARCH_HAS_MMU=y
-UCLIBC_HAS_FLOATS=y
-HAS_FPU=y
-DO_C99_MATH=y
-WARNINGS="-Wall"
-KERNEL_SOURCE="/usr/src/cvs/buildroot/build_mipsel/WRT54GS/release/src/linux/linux"
-C_SYMBOL_PREFIX=""
-HAVE_DOT_CONFIG=y
-
-#
-# General Library Settings
-#
-# HAVE_NO_PIC is not set
-DOPIC=y
-# HAVE_NO_SHARED is not set
-HAVE_SHARED=y
-# ARCH_HAS_NO_LDSO is not set
-BUILD_UCLIBC_LDSO=y
-# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
-LDSO_LDD_SUPPORT=y
-LDSO_CACHE_SUPPORT=y
-# LDSO_PRELOAD_FILE_SUPPORT is not set
-LDSO_BASE_FILENAME="ld.so"
-UCLIBC_CTOR_DTOR=y
-# HAS_NO_THREADS is not set
-UCLIBC_HAS_THREADS=y
-PTHREADS_DEBUG_SUPPORT=y
-UCLIBC_HAS_LFS=y
-# MALLOC is not set
-# MALLOC_SIMPLE is not set
-MALLOC_STANDARD=y
-MALLOC_GLIBC_COMPAT=y
-UCLIBC_DYNAMIC_ATEXIT=y
-HAS_SHADOW=y
-# UNIX98PTY_ONLY is not set
-ASSUME_DEVPTS=y
-UCLIBC_HAS_TM_EXTENSIONS=y
-UCLIBC_HAS_TZ_CACHING=y
-UCLIBC_HAS_TZ_FILE=y
-UCLIBC_HAS_TZ_FILE_READ_MANY=y
-UCLIBC_TZ_FILE_PATH="/etc/TZ"
-
-#
-# Networking Support
-#
-UCLIBC_HAS_IPV6=y
-UCLIBC_HAS_RPC=y
-UCLIBC_HAS_FULL_RPC=y
-
-#
-# String and Stdio Support
-#
-# UCLIBC_HAS_STRING_GENERIC_OPT is not set
-UCLIBC_HAS_STRING_ARCH_OPT=y
-UCLIBC_HAS_CTYPE_TABLES=y
-UCLIBC_HAS_CTYPE_SIGNED=y
-# UCLIBC_HAS_CTYPE_UNSAFE is not set
-UCLIBC_HAS_CTYPE_CHECKED=y
-# UCLIBC_HAS_CTYPE_ENFORCED is not set
-UCLIBC_HAS_WCHAR=y
-# UCLIBC_HAS_LOCALE is not set
-UCLIBC_HAS_HEXADECIMAL_FLOATS=y
-UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
-UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
-UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
-# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
-UCLIBC_HAS_STDIO_BUFSIZ_4096=y
-# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
-UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
-UCLIBC_HAS_STDIO_GETC_MACRO=y
-UCLIBC_HAS_STDIO_PUTC_MACRO=y
-UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
-# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
-UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
-UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
-UCLIBC_HAS_PRINTF_M_SPEC=y
-UCLIBC_HAS_ERRNO_MESSAGES=y
-# UCLIBC_HAS_SYS_ERRLIST is not set
-UCLIBC_HAS_SIGNUM_MESSAGES=y
-# UCLIBC_HAS_SYS_SIGLIST is not set
-UCLIBC_HAS_GNU_GETOPT=y
-
-#
-# Big and Tall
-#
-UCLIBC_HAS_REGEX=y
-# UCLIBC_HAS_WORDEXP is not set
-UCLIBC_HAS_FTW=y
-UCLIBC_HAS_GLOB=y
-
-#
-# Library Installation Options
-#
-SHARED_LIB_LOADER_PREFIX="/lib"
-RUNTIME_PREFIX="/"
-DEVEL_PREFIX="/usr/"
-
-#
-# uClibc security related options
-#
-# UCLIBC_SECURITY is not set
-
-#
-# uClibc development/debugging options
-#
-# DODEBUG is not set
-# DOASSERTS is not set
-# SUPPORT_LD_DEBUG is not set
-# SUPPORT_LD_DEBUG_EARLY is not set
-# UCLIBC_MJN3_ONLY is not set
diff --git a/obsolete-buildroot/sources/uClibc.config-locale b/obsolete-buildroot/sources/uClibc.config-locale
deleted file mode 100644 (file)
index b8b7fc8..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-#
-# Automatically generated make config: don't edit
-#
-# TARGET_alpha is not set
-# TARGET_arm is not set
-# TARGET_cris is not set
-# TARGET_e1 is not set
-# TARGET_h8300 is not set
-# TARGET_i386 is not set
-# TARGET_i960 is not set
-# TARGET_m68k is not set
-# TARGET_microblaze is not set
-# TARGET_mips is not set
-# TARGET_powerpc is not set
-# TARGET_sh is not set
-# TARGET_sparc is not set
-# TARGET_v850 is not set
-
-#
-# Target Architecture Features and Options
-#
-HAVE_ELF=y
-TARGET_ARCH="none"
-# ARCH_LITTLE_ENDIAN is not set
-# ARCH_BIG_ENDIAN is not set
-# ARCH_HAS_NO_MMU is not set
-UCLIBC_HAS_FLOATS=y
-HAS_FPU=y
-DO_C99_MATH=y
-WARNINGS="-Wall"
-KERNEL_SOURCE="/usr/src/linux"
-HAVE_DOT_CONFIG=y
-
-#
-# General Library Settings
-#
-# HAVE_NO_PIC is not set
-DOPIC=y
-HAVE_SHARED=y
-BUILD_UCLIBC_LDSO=y
-# UCLIBC_PIE_SUPPORT is not set
-LDSO_LDD_SUPPORT=y
-UCLIBC_CTOR_DTOR=y
-# UCLIBC_PROPOLICE is not set
-# UCLIBC_PROFILING is not set
-UCLIBC_HAS_THREADS=y
-PTHREADS_DEBUG_SUPPORT=y
-UCLIBC_HAS_LFS=y
-# MALLOC is not set
-MALLOC_STANDARD=y
-MALLOC_GLIBC_COMPAT=y
-UCLIBC_DYNAMIC_ATEXIT=y
-HAS_SHADOW=y
-# UNIX98PTY_ONLY is not set
-ASSUME_DEVPTS=y
-UCLIBC_HAS_TM_EXTENSIONS=y
-UCLIBC_HAS_TZ_CACHING=y
-UCLIBC_HAS_TZ_FILE=y
-UCLIBC_HAS_TZ_FILE_READ_MANY=y
-UCLIBC_TZ_FILE_PATH="/etc/TZ"
-
-#
-# Networking Support
-#
-UCLIBC_HAS_IPV6=y
-UCLIBC_HAS_RPC=y
-UCLIBC_HAS_FULL_RPC=y
-
-#
-# String and Stdio Support
-#
-UCLIBC_HAS_CTYPE_TABLES=y
-UCLIBC_HAS_CTYPE_SIGNED=y
-# UCLIBC_HAS_CTYPE_UNSAFE is not set
-UCLIBC_HAS_CTYPE_CHECKED=y
-# UCLIBC_HAS_CTYPE_ENFORCED is not set
-UCLIBC_HAS_WCHAR=y
-UCLIBC_HAS_LOCALE=y
-UCLIBC_PREGENERATED_LOCALE_DATA=y
-UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA=y
-UCLIBC_HAS_XLOCALE=y
-UCLIBC_HAS_HEXADECIMAL_FLOATS=y
-UCLIBC_HAS_GLIBC_DIGIT_GROUPING=y
-UCLIBC_HAS_SCANF_LENIENT_DIGIT_GROUPING=y
-UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
-UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
-UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
-# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
-UCLIBC_HAS_STDIO_BUFSIZ_4096=y
-# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
-UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
-UCLIBC_HAS_STDIO_GETC_MACRO=y
-UCLIBC_HAS_STDIO_PUTC_MACRO=y
-UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
-# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
-UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
-UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
-UCLIBC_HAS_PRINTF_M_SPEC=y
-UCLIBC_HAS_ERRNO_MESSAGES=y
-# UCLIBC_HAS_SYS_ERRLIST is not set
-UCLIBC_HAS_SIGNUM_MESSAGES=y
-# UCLIBC_HAS_SYS_SIGLIST is not set
-UCLIBC_HAS_GETTEXT_AWARENESS=y
-UCLIBC_HAS_GNU_GETOPT=y
-
-#
-# Big and Tall
-#
-UCLIBC_HAS_REGEX=y
-UCLIBC_HAS_WORDEXP=y
-UCLIBC_HAS_FTW=y
-UCLIBC_HAS_GLOB=y
-
-#
-# Library Installation Options
-#
-SHARED_LIB_LOADER_PREFIX="/lib"
-RUNTIME_PREFIX="/usr/$(TARGET_ARCH)-linux-uclibc"
-DEVEL_PREFIX="/usr/$(TARGET_ARCH)-linux-uclibc"
-
-#
-# uClibc development/debugging options
-#
-# DODEBUG is not set
-# DOASSERTS is not set
-# SUPPORT_LD_DEBUG is not set
-# SUPPORT_LD_DEBUG_EARLY is not set
-# UCLIBC_MJN3_ONLY is not set
diff --git a/obsolete-buildroot/sources/uClibc.config-openwrt b/obsolete-buildroot/sources/uClibc.config-openwrt
deleted file mode 100644 (file)
index 985f76d..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-#
-# Automatically generated make config: don't edit
-#
-# TARGET_alpha is not set
-# TARGET_arm is not set
-# TARGET_cris is not set
-# TARGET_e1 is not set
-# TARGET_frv is not set
-# TARGET_h8300 is not set
-# TARGET_i386 is not set
-# TARGET_i960 is not set
-# TARGET_m68k is not set
-# TARGET_microblaze is not set
-TARGET_mips=y
-# TARGET_powerpc is not set
-# TARGET_sh is not set
-# TARGET_sparc is not set
-# TARGET_v850 is not set
-
-#
-# Target Architecture Features and Options
-#
-HAVE_ELF=y
-ARCH_SUPPORTS_LITTLE_ENDIAN=y
-TARGET_ARCH="mips"
-ARCH_CFLAGS="-mno-split-addresses"
-ARCH_SUPPORTS_BIG_ENDIAN=y
-# CONFIG_MIPS_ISA_1 is not set
-CONFIG_MIPS_ISA_2=y
-# CONFIG_MIPS_ISA_3 is not set
-# CONFIG_MIPS_ISA_4 is not set
-# CONFIG_MIPS_ISA_MIPS32 is not set
-# CONFIG_MIPS_ISA_MIPS64 is not set
-ARCH_LITTLE_ENDIAN=y
-# ARCH_BIG_ENDIAN is not set
-# ARCH_HAS_NO_MMU is not set
-ARCH_HAS_MMU=y
-UCLIBC_HAS_FLOATS=y
-HAS_FPU=y
-DO_C99_MATH=y
-WARNINGS="-Wall"
-KERNEL_SOURCE="/usr/src/linux"
-HAVE_DOT_CONFIG=y
-
-#
-# General Library Settings
-#
-# HAVE_NO_PIC is not set
-DOPIC=y
-# HAVE_NO_SHARED is not set
-HAVE_SHARED=y
-# ARCH_HAS_NO_LDSO is not set
-BUILD_UCLIBC_LDSO=y
-# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
-# UCLIBC_PIE_SUPPORT is not set
-LDSO_LDD_SUPPORT=y
-UCLIBC_CTOR_DTOR=y
-# UCLIBC_PROPOLICE is not set
-# UCLIBC_PROFILING is not set
-# HAS_NO_THREADS is not set
-UCLIBC_HAS_THREADS=y
-PTHREADS_DEBUG_SUPPORT=y
-UCLIBC_HAS_LFS=y
-# MALLOC is not set
-# MALLOC_SIMPLE is not set
-MALLOC_STANDARD=y
-MALLOC_GLIBC_COMPAT=y
-UCLIBC_DYNAMIC_ATEXIT=y
-HAS_SHADOW=y
-# UNIX98PTY_ONLY is not set
-ASSUME_DEVPTS=y
-UCLIBC_HAS_TM_EXTENSIONS=y
-UCLIBC_HAS_TZ_CACHING=y
-UCLIBC_HAS_TZ_FILE=y
-UCLIBC_HAS_TZ_FILE_READ_MANY=y
-UCLIBC_TZ_FILE_PATH="/etc/TZ"
-
-#
-# Networking Support
-#
-UCLIBC_HAS_IPV6=y
-UCLIBC_HAS_RPC=y
-UCLIBC_HAS_FULL_RPC=y
-
-#
-# String and Stdio Support
-#
-UCLIBC_HAS_CTYPE_TABLES=y
-UCLIBC_HAS_CTYPE_SIGNED=y
-# UCLIBC_HAS_CTYPE_UNSAFE is not set
-UCLIBC_HAS_CTYPE_CHECKED=y
-# UCLIBC_HAS_CTYPE_ENFORCED is not set
-UCLIBC_HAS_WCHAR=y
-# UCLIBC_HAS_LOCALE is not set
-UCLIBC_HAS_HEXADECIMAL_FLOATS=y
-UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
-UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
-UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
-# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
-UCLIBC_HAS_STDIO_BUFSIZ_4096=y
-# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
-UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
-UCLIBC_HAS_STDIO_GETC_MACRO=y
-UCLIBC_HAS_STDIO_PUTC_MACRO=y
-UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
-# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
-UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
-UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
-UCLIBC_HAS_PRINTF_M_SPEC=y
-UCLIBC_HAS_ERRNO_MESSAGES=y
-# UCLIBC_HAS_SYS_ERRLIST is not set
-UCLIBC_HAS_SIGNUM_MESSAGES=y
-# UCLIBC_HAS_SYS_SIGLIST is not set
-UCLIBC_HAS_GNU_GETOPT=y
-
-#
-# Big and Tall
-#
-UCLIBC_HAS_REGEX=y
-# UCLIBC_HAS_WORDEXP is not set
-UCLIBC_HAS_FTW=y
-UCLIBC_HAS_GLOB=y
-
-#
-# Library Installation Options
-#
-SHARED_LIB_LOADER_PREFIX="/lib"
-RUNTIME_PREFIX="/usr/$(TARGET_ARCH)-linux-uclibc"
-DEVEL_PREFIX="/usr/$(TARGET_ARCH)-linux-uclibc"
-
-#
-# uClibc development/debugging options
-#
-# DODEBUG is not set
-# DOASSERTS is not set
-# SUPPORT_LD_DEBUG is not set
-# SUPPORT_LD_DEBUG_EARLY is not set
-# UCLIBC_MJN3_ONLY is not set
diff --git a/obsolete-buildroot/sources/util-linux.patch b/obsolete-buildroot/sources/util-linux.patch
deleted file mode 100644 (file)
index 601e7dc..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
---- util-linux-2.11z/mount/fstab.c.orig        2003-12-03 15:28:22.000000000 -0700
-+++ util-linux-2.11z/mount/fstab.c     2003-12-03 15:28:41.000000000 -0700
-@@ -342,7 +342,7 @@
- /* Ensure that the lock is released if we are interrupted.  */
- static void
- handler (int sig) {
--     die (EX_USER, "%s", sys_siglist[sig]);
-+     die (EX_USER, "%s", strsignal(sig));
- }
- static void
---- /dev/null  2003-09-07 01:55:59.000000000 -0600
-+++ util-linux-2.11z/mount/swapargs.h  2003-12-03 15:44:50.000000000 -0700
-@@ -0,0 +1,3 @@
-+#define SWAPON_HAS_TWO_ARGS
-+#include <asm/page.h>
-+#include <sys/swap.h>
---- util-linux-2.11z/mount/swap.configure.orig 2003-12-03 15:43:24.000000000 -0700
-+++ util-linux-2.11z/mount/swap.configure      2003-12-03 15:45:33.000000000 -0700
-@@ -1,6 +1,8 @@
- # Find out whether we can include <sys/swap.h>
- # and whether libc thinks that swapon() has two arguments.
-+exit 0
-+
- # Prepare test
- CC=${CC-cc}
- compile="$CC -o conftest conftest.c >/dev/null 2>&1"
diff --git a/obsolete-buildroot/sources/valgrind.patch b/obsolete-buildroot/sources/valgrind.patch
deleted file mode 100644 (file)
index d0946bd..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
---- valgrind-2.1.1.orig/coregrind/vg_syscalls.c        2004-02-24 17:07:10.000000000 -0700
-+++ valgrind-2.1.1/coregrind/vg_syscalls.c     2004-04-16 18:13:11.000000000 -0600
-@@ -3231,6 +3245,93 @@
-    case CDROM_CLEAR_OPTIONS: /* 0x5321 */
-       break;
-+      /* Stuff added by Erik Andersen for general device probing/handling */
-+#define BLKSSZGET  _IO(0x12,104)
-+   case BLKSSZGET:
-+      SYSCALL_TRACK( pre_mem_write, tid, "ioctl(BLKSSZGET)", arg3,
-+            sizeof(int));
-+      break;
-+#undef _IOR
-+#define _IOR(type,nr,size)      _IOC(_IOC_READ,(type),(nr),sizeof(size))
-+#define BLKGETSIZE64 _IOR(0x12,114,sizeof(uint64_t))
-+   case BLKGETSIZE64:
-+      SYSCALL_TRACK( pre_mem_write, tid, "ioctl(BLKGETSIZE64)", arg3,
-+            sizeof(uint64_t));
-+      break;
-+#define HDIO_GETGEO             0x0301  /* get device geometry */
-+   case HDIO_GETGEO:
-+      {
-+        struct hd_geometry {
-+            unsigned char heads;
-+            unsigned char sectors;
-+            unsigned short cylinders;
-+            unsigned long start;
-+        };
-+
-+        SYSCALL_TRACK( pre_mem_write, tid, "ioctl(HDIO_GETGEO)", arg3,
-+                sizeof(struct hd_geometry));
-+      }
-+      break;
-+#define HDIO_GET_IDENTITY     0x030d  /* get IDE identification info */
-+#define struct_hd_driveid_size        256     /* ATA6 specifies words 0-255 */
-+   case HDIO_GET_IDENTITY:
-+      SYSCALL_TRACK( pre_mem_write, tid, "ioctl(HDIO_GET_IDENTITY)", arg3,
-+            struct_hd_driveid_size);
-+      break;
-+#define SCSI_IOCTL_GET_IDLUN 0x5382
-+   case SCSI_IOCTL_GET_IDLUN:
-+      {
-+        struct scsi_idlun
-+        {
-+            int mux4;
-+            int host_unique_id;
-+
-+        };
-+
-+        SYSCALL_TRACK( pre_mem_write, tid, "ioctl(SCSI_IOCTL_GET_IDLUN)", arg3,
-+                sizeof(struct scsi_idlun));
-+      }
-+      break;
-+#define SCSI_IOCTL_SEND_COMMAND 1
-+   case SCSI_IOCTL_SEND_COMMAND:
-+      SYSCALL_TRACK( pre_mem_write, tid, "ioctl(SCSI_IOCTL_SEND_COMMAND)", arg3,
-+            ((2 * sizeof(unsigned int)) + 6 + 512));
-+      break;
-+#define SCSI_IOCTL_GET_BUS_NUMBER 0x5386
-+   case SCSI_IOCTL_GET_BUS_NUMBER:
-+      SYSCALL_TRACK( pre_mem_write, tid, "ioctl(SCSI_IOCTL_GET_BUS_NUMBER)", arg3,
-+            sizeof(int));
-+      break;
-+#define SCSI_IOCTL_PROBE_HOST 0x5385
-+   case SCSI_IOCTL_PROBE_HOST:
-+      {
-+        int xxxx;
-+        char *array = (char*)arg3;
-+        xxxx = array[0] + (array[1]<<8) + (array[2]<<16) + (array[3]<<24);
-+        SYSCALL_TRACK( pre_mem_write, tid, "ioctl(SCSI_IOCTL_PROBE_HOST)", arg3,
-+                sizeof(int));
-+      }
-+      break;
-+#define BLKFLSBUF  _IO(0x12,97)
-+   case BLKFLSBUF:
-+      break;
-+#define BLKRRPART  _IO(0x12,95)
-+   case BLKRRPART:
-+      break;
-+#define MTIOCTOP  _IO(0x6d,0x1)
-+   case MTIOCTOP:
-+      {
-+        struct mtop
-+        {
-+            short int mt_op;          /* Operations defined below.  */
-+            int mt_count;             /* How many of them.  */
-+        };
-+        SYSCALL_TRACK( pre_mem_write, tid, "ioctl(MTIOCTOP)", arg3, 
-+                sizeof(struct mtop));
-+      }
-+      break;
-+
-+
-       /* We don't have any specific information on it, so
-        try to do something reasonable based on direction and
-        size bits.  The encoding scheme is described in
---- valgrind-2.1.1.orig/coregrind/vg_libpthread.c      2004-03-08 08:57:17.000000000 -0700
-+++ valgrind-2.1.1/coregrind/vg_libpthread.c   2004-04-16 17:58:31.000000000 -0600
-@@ -3175,6 +3175,8 @@
-    pthread_mutex).  So basically, this is completely broken on recent
-    glibcs. */
-+#ifndef __UCLIBC__
-+
- #undef _IO_flockfile
- void _IO_flockfile ( _IO_FILE * file )
- {
-@@ -3192,6 +3194,7 @@
- weak_alias(_IO_funlockfile, funlockfile);
- #endif
-+#endif
- /* This doesn't seem to be needed to simulate libpthread.so's external
-    interface, but many people complain about its absence. */
diff --git a/obsolete-buildroot/sources/vtun.patch b/obsolete-buildroot/sources/vtun.patch
deleted file mode 100644 (file)
index 00a1245..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-diff -urN vtun/Makefile.in vtun-2.6/Makefile.in
---- vtun/Makefile.in   2002-12-20 09:55:47.000000000 -0700
-+++ vtun-2.6/Makefile.in       2003-06-05 12:38:31.000000000 -0600
-@@ -28,7 +28,7 @@
- LEXFLAGS = -t 
- INSTALL = @INSTALL@
--INSTALL_OWNER = -o root -g 0
-+INSTALL_OWNER =
- prefix = @prefix@
- exec_prefix = @exec_prefix@
-@@ -86,15 +86,15 @@
- install_config: 
-       $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(ETC_DIR)
--      if [ ! -f $(ETC_DIR)/vtund.conf ]; then \
--        $(INSTALL) -m 600 $(INSTALL_OWNER) vtund.conf $(DESTDIR)$(ETC_DIR); \
--      fi
-+      $(INSTALL) -m 600 $(INSTALL_OWNER) vtund.conf $(DESTDIR)$(ETC_DIR);
-+      $(INSTALL) -m 600 $(INSTALL_OWNER) scripts/vtund-start.conf $(DESTDIR)$(ETC_DIR);
- install: vtund install_config install_man
--      $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(VAR_DIR)/run
-       $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(STAT_DIR)
-       $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(LOCK_DIR)
-       $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(SBIN_DIR)
-       $(INSTALL) -m 755 $(INSTALL_OWNER) vtund $(DESTDIR)$(SBIN_DIR)
-+      $(INSTALL) -m 755 $(INSTALL_OWNER) scripts/vtund.rc.debian \
-+              $(DESTDIR)$(ETC_DIR)/init.d/S90vtun
- # DO NOT DELETE THIS LINE -- make depend depends on it.
-diff -urN vtun/scripts/vtund.rc.debian vtun-2.6/scripts/vtund.rc.debian
---- vtun/scripts/vtund.rc.debian       2000-03-26 10:06:37.000000000 -0700
-+++ vtun-2.6/scripts/vtund.rc.debian   2003-06-05 12:38:46.000000000 -0600
-@@ -1,92 +1,48 @@
--#! /usr/bin/perl -w
-+#! /bin/sh
-+#
--### vtund-start
--###
--### script to start vtund as either a server or a client, according to
--### the config file /etc/vtund-start.conf
--###
--### Copyright 1999 Craig Sanders <cas@taz.net.au>
--###
--### Written for the Debian GNU/Linux distribution.  This script is free
--### software licensed under the terms of the GNU General Public License.
--
--$DAEMON="/usr/sbin/vtund" ;
--
--$do_what = shift ;
--$args="start|stop|reload|force-reload|restart" ;
--if ( $do_what !~ /^($args)$/i ) {
--    print "Usage: /etc/init.d/vtun {$args}\n" ;
--        exit 0 ;
--}
--
--$SSD="/sbin/start-stop-daemon" ;
--$SSDARGS="--verbose --exec $DAEMON" ;
--
--$sconf="/etc/vtund-start.conf" ;
--open(SCONF,"<$sconf") || die "couldn't open $sconf: $!\n" ;
--while (<SCONF>) {
--        chomp ;
--        s/#.*//;
--        s/^ +| +$//;
--        next if (/^$/) ;
--
--        @line = split ;
--        $host = shift(@line) ;
--        $server = shift(@line) ;
--        $args = "" ;
--        foreach (@line) { $args .= " $_" } ;
--
--        $host='' if ($host =~ /--server--/i ) ;
--
--        if ( $do_what eq 'start' ) {
--                &start($host,$server,$args) ;
--        } elsif ( $do_what eq 'stop' ) {
--                &stop($host,$server,$args) ;
--        } elsif ( $do_what eq 'restart' ) {
--                &stop($pidfile) ;
--                &start($host,$server,$args) ;
--        } elsif ( $do_what =~ /^(reload|force-reload)$/ ) {
--                &reload($host,$server) ;
--        }
--}
--close (SCONF);
--
--
--sub start {
--        my($host,$server,$args) = @_ ;
--    print "  Starting vtun " ;
--        if ($host eq '') {
--                print "server\n" ;
--        system "$SSD --start $SSDARGS -- $args -s -P $server" ;
--        } else {
--                print "client $host to $server\n" ;
--                $pidfile="/var/run/vtun.$host.$server" ;
--        system "$SSD --start $SSDARGS --pidfile $pidfile -- $args $host $server" ;
--        }
--} ;
--
--sub stop {
--        my($host,$server,$args) = @_ ;
--    print "  Stopping vtun " ;
--        if ($host eq '') {
--                print "server\n" ;
--        system "$SSD --stop $SSDARGS" ;
--        } else {
--                print "client $host to $server\n" ;
--                $pidfile="/var/run/vtun.$host.$server" ;
--        system "$SSD --stop $SSDARGS --pidfile $pidfile" ;
--        }
--} ;
--
--sub reload {
--        my($host,$server) = @_ ;
--    print "  Reloading vtun " ;
--        if ($host eq '') {
--                print "server\n" ;
--        system "$SSD --stop $SSDARGS --signal 1" ;
--        } else {
--                print "client $host to $server\n" ;
--                $pidfile="/var/run/vtun.$host.$server" ;
--        system "$SSD --stop $SSDARGS --signal 1 --pidfile $pidfile" ;
--        }
--}
-+PATH=/bin:/usr/bin:/sbin:/usr/sbin
-+DAEMON=/usr/sbin/vtund
-+CONFFILE=/etc/vtund-start.conf
-+PIDPREFIX=/var/run/vtund
-+  
-+test -f $DAEMON || exit 0
-+  
-+case "$1" in 
-+       start)
-+      # find all the defined tunnels
-+      egrep -v '^[:space:]*(#.*)?$' $CONFFILE | while true;
-+      do
-+          read i
-+          # no more lines available? done, then.
-+          if [ $? != 0 ] ; then break; fi
-+              SARGS=`echo $i|sed -ne 's/--server--\s*/-s -P /p'`;
-+              if [ -n "$SARGS" ];
-+              then
-+                 echo "Starting vtund server."
-+                  start-stop-daemon -S -x $DAEMON -- $SARGS;
-+              else
-+                  # split args into host and rest
-+                  HOST=`echo $i|cut -f 1 -d " "`;
-+                  TARGET=`echo $i|cut -f 2 -d " "`;
-+                  echo  "Starting vtund client $HOST to $TARGET.";
-+                  start-stop-daemon -S -x $DAEMON -- $i;
-+              fi
-+          done
-+              ;;
-+       stop) 
-+         echo "Stopping vtund.";
-+         start-stop-daemon -K -x vtund;
-+         ;;
-+
-+       restart|reload|force-reload) 
-+         $0 stop
-+         sleep 1;
-+         $0 start
-+         ;;
-+   *)
-+      echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
-+       exit 1
-+               ;;
-+esac
-+exit 0
---- vtun-2.6/configure.dist    2004-03-11 10:39:10.000000000 -0600
-+++ vtun-2.6/configure 2004-03-11 10:45:52.000000000 -0600
-@@ -2112,7 +2112,7 @@
-     echo $ac_n "checking "for blowfish.h"""... $ac_c" 1>&6
- echo "configure:2114: checking "for blowfish.h"" >&5 
-     ac_hdr_found=no
--    for p in $BLOWFISH_HDR_DIR /usr/include/ssl /usr/include/openssl /usr/include /usr/local/include /usr/local/ssl/include  /usr/include/crypto; do
-+    for p in $BLOWFISH_HDR_DIR $SSL_HDR_DIR /usr/include/ssl /usr/include/openssl /usr/include /usr/local/include /usr/local/ssl/include  /usr/include/crypto; do
-       if test -n "$p"; then
-         dir="$p"
-       else
diff --git a/obsolete-buildroot/sources/yacc b/obsolete-buildroot/sources/yacc
deleted file mode 100755 (executable)
index aed120e..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-exec /usr/bin/bison -y "$@"
diff --git a/openwrt/LICENSE b/openwrt/LICENSE
new file mode 100644 (file)
index 0000000..d60c31a
--- /dev/null
@@ -0,0 +1,340 @@
+                   GNU GENERAL PUBLIC LICENSE
+                      Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                           Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+\f
+                   GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+\f
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+\f
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+\f
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                           NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                    END OF TERMS AND CONDITIONS
+\f
+           How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    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, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year  name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
index 1b8d968a0995a291cdb0fd549542daf81c5c5ff7..d478227523d633749219e26b68318d23f25e7fe4 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for OpenWRT
 #
-# Copyright (C) 2005 by Felix Fietkau <nbd@vd-s.ath.cx>
+# Copyright (C) 2005 by Felix Fietkau <openwrt@nbd.name>
 # Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
 #
 # This program is free software; you can redistribute it and/or modify
@@ -47,26 +47,6 @@ all: world
 
 .NOTPARALLEL:
 
-##############################################################
-#
-# Build the toolchain
-#
-##############################################################
-toolchain_install:
-       $(MAKE) -C toolchain install
-
-##############################################################
-#
-# Make all packages
-#
-##############################################################
-
-package_compile: target_compile
-       $(MAKE) -C package compile
-
-package_install: package_compile toolchain
-       $(MAKE) -C package install
-
 #############################################################
 #
 # You should probably leave this stuff alone unless you know
@@ -77,9 +57,9 @@ package_install: package_compile toolchain
 # In this section, we need .config
 include .config.cmd
 
-world: $(DL_DIR) $(BUILD_DIR) configtest target_prepare $(TARGET_DIR) toolchain_install package_install target_install package_index
+world: $(DL_DIR) $(BUILD_DIR) configtest toolchain/install target/compile package/compile target/install package_index
 
-.PHONY: all world clean dirclean distclean image_clean target_clean source target_prepare target_install toolchain_install package_install configtest
+.PHONY: all world clean dirclean distclean image_clean target_clean source configtest
 
 configtest:
        -cp .config .config.test
@@ -90,15 +70,6 @@ package_index:
                $(STAGING_DIR)/usr/bin/ipkg-make-index . > Packages \
        )
 
-target_prepare:
-       $(MAKE) -C target prepare
-
-target_compile:
-       $(MAKE) -C target compile
-
-target_install:
-       $(MAKE) -C target install
-
 $(DL_DIR):
        @mkdir -p $(DL_DIR)
 
@@ -128,7 +99,6 @@ image_clean:
        rm -rf $(BIN_DIR)
        
 target_clean: image_clean
-       rm -rf $(TARGET_DIR)
        rm -rf $(BUILD_DIR)/linux-*/root
 
 clean: target_clean
@@ -191,8 +161,6 @@ randconfig: $(CONFIG)/conf
        -./scripts/configtest.pl
 
 allyesconfig: $(CONFIG)/conf
-       #@$(CONFIG)/conf -y $(CONFIG_CONFIG_IN)
-       #sed -i -e "s/^CONFIG_DEBUG.*/# CONFIG_DEBUG is not set/" .config
        -touch .config
        -cp .config .config.test
        @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
index a1d783538ab58aa73e77d17f555004ef5f39842e..03d4ebb9db0c5569dde8a6b5ec32807bd230cd06 100644 (file)
@@ -3,7 +3,7 @@ This is the buildsystem for the OpenWrt Linux distribution
 Please use "make menuconfig" to configure your appreciated
 configuration for the toolchain and firmware.
 
-You need to have installed gcc, binutils, patch, bzip2, flex, bison,
+You need to have installed gcc, g++, binutils, patch, bzip2, flex, bison,
 make, gettext, unzip, libz-dev and libc headers.
 
 Simply running 'make' will build your firmware.
diff --git a/openwrt/docs/CHANGES b/openwrt/docs/CHANGES
deleted file mode 100644 (file)
index 56fd703..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-
- OpenWRT CHANGES
- ---------------
-
- Changes between official and experimental
-
-  *) new buildroot (based on uClib buildroot2)
-     *) makefiles are no longer included but executed instead 
-        => easier to create packages
-
-  *) enhanced configuration system
-     *) busybox fully configurable from menuconfig
-     *) enabled tristate for some packages
-        => < > disabled, <M> compile as .ipk, <*> compile as .ipk and embed
-
-  *) new kernel (updated to 2.4.30)
-
-  *) jffs2 root partition support
-
-  *) lzma compression (kernel and squashfs root partition)
-  
-  *) newest ebtables support
-
-  *) better support for Asus WL-500g / WL-500g deluxe 
-       (kernel modules for usb,scsi,vfat build)
-  
-  *) all free kernel source added to cvs for better maintainence
-
-  *) free replacements for mtd and wl tool (wl is renamed to wlc)
diff --git a/openwrt/docs/README b/openwrt/docs/README
deleted file mode 100644 (file)
index 0c7fb4c..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-To build and use the buildroot stuff, do the following:
-
-1) run 'make'
-2) select which packages you wish to compile
-3) run 'make'
-4) wait while it compiles
-5) Use your shiney new root filesystem.  Depending on which sortof
-    root filesystem you selecter, you may want to loop mount it,
-    chroot into it, loop mount it and then nfs mount that on your
-    target device, burn it to flash, or whatever is appropriate
-    for your target system.
-
-You do not need to be root to build or run buildroot.  Have fun!
-
- -Erik
-
-Please feed suggestions, bug reports, insults, and bribes back to:
-       Erik Andersen <andersen@codepoet.org>
index 48b05728e58ae628ec2ac23f2e0049350297de30..9dd42c1c2ff53e2565365a913f5199e52282a9fb 100644 (file)
@@ -15,9 +15,9 @@
       <h1>OpenWrt Buildroot</h1>
     </div>
 
-    <p>Usage and documentation by Felix Fietkau, based on uClibc Buildroot
+    <p>Usage and documentation by Felix Fietkau and Waldemar Brodkorb, based on uClibc Buildroot
     documentation by Thomas Petazzoni. Contributions from Karsten Kruse,
-    Ned Ludd, Martin Herren.</p>
+    Ned Ludd, Martin Herren. OpenWrt Kernel Module Creation Howto by Markus Becker.</p>
 
     <p><small>Last modification : $Id$</small></p>
 
       <li><a href="#downloaded_packages">Location of downloaded packages</a></li>
       <li><a href="#add_software">Extending OpenWrt with more Software</a></li>
       <li><a href="#links">Ressources</a></li>
+<br>
+      <li><a href="#about_module">About OpenWrt Kernel Module Compilation</a></li>
+      <li><a href="#kernel">Enable the kernel options</a></li>
+      <li><a href="#buildroot_option">Create a buildroot option</a></li>
+      <li><a href="#binary">Define the binary files for the kernel module</a></li>
+      <li><a href="#control">Specify the ipkg control file</a></li>
+      <li><a href="#compile">Compile the kernel module</a></li>
     </ul>
 
     <h2><a name="about" id="about"></a>About OpenWrt Buildroot</h2>
     <code>gcc</code>, <code>binutils</code>, uClibc and all the tools by hand.
     Of course, doing so is possible. But dealing with all configure options,
     with all problems of every <code>gcc</code> or <code>binutils</code>
-    version it very time-consuming and uninteresting. OpenWrt Buildroot automates this
+    version is very time-consuming and uninteresting. OpenWrt Buildroot automates this
     process through the use of Makefiles, and has a collection of patches for
     each <code>gcc</code> and <code>binutils</code> version to make them work
-    on the MIPS architecture of most Broadcom based Wireless Routers.</p>
+    on the MIPS architecture of most Wireless Routers.</p>
 
     <h2><a name="download" id="download"></a>Obtaining OpenWrt Buildroot</h2>
 
-    <p>OpenWrt Buildroot is currently available as experimental snapshots</p>
-
-    <p>The latest snapshot is always available at <a
-    href="http://openwrt.org/downloads/experimental/">http://openwrt.org/downloads/experimental/</a>,
+    <p>OpenWrt Buildroot is available via CVS - Concurrent Version System.
+    For any kind of development you should get the latest version from cvs via:</p>
+<pre>
+ $ cvs -d:pserver:anonymous@openwrt.org:/openwrt co openwrt
+</pre>
 
     <h2><a name="using" id="using"></a>Using OpenWrt Buildroot</h2>
 
         <li>squashfs</li>
     </ul>
     <p><code>jffs2</code> contains a writable root filesystem, which will expand to
-    the size of your flash image. Note that you if you use the generic firmware
-    Image, you need to pick the right image for your Flash size, because of different
+    the size of your flash image. Note: if you use the generic firmware image, you 
+    need to pick the right image for your flash size, because of different
     eraseblock sizes.</p>
     
     <p><code>squashfs</code> contains a read-only root filesystem using a modified 
       configuration, and the latter is used if you have selected
       locale support.</li>
 
-      <li>Run the compilation again</li>
+      <li>Run the compilation again.</li>
 
     </ol>
 
 
       <li><b>target</b> (in the <code>target</code> directory) contains the
       Makefiles and associated files for software related to the generation of
-      the target root filesystem image. Two types of filesystems are supported
+      the target root filesystem image and the linux kernel for the different 
+      system on a chip boards, used in the Wireless Routers. 
+      Two types of filesystems are supported
       : jffs2 and squashfs. 
     </ul>
 
 
       <li>Create the target directory (<code>build_ARCH/root/</code> by
       default) and the target filesystem skeleton. This directory will contain
-      the final root filesystem. To setup it up, it first deletes it, then it
+      the final root filesystem. To set it up, it first deletes it, then it
       copies the skeleton available in  <code>target/default/target_skeleton</code>
       and then removes useless <code>CVS/</code> directories.</li>
 
     <p>For example, you may add the following to your
     <code>.bashrc</code> (considering you're building for the MIPS
     architecture and that Buildroot is located in
-    <code>~/buildroot/</code>) :</p>
+    <code>~/openwrt/</code>) :</p>
 
 <pre>
-export PATH=$PATH:~/buildroot/staging_dir_mipsel/bin/
+export PATH=$PATH:~/openwrt/staging_dir_mipsel/bin/
 </pre>
 
     <p>Then you can simply do :</p>
@@ -343,7 +354,7 @@ mipsel-linux-uclibc-gcc -o foo foo.c
     downloaded by the <i>Makefiles</i> are all stored in the
     <code>DL_DIR</code> which by default is the <code>dl</code>
     directory. It's useful for example if you want to keep a complete
-    version of Buildroot which is know to be working with the
+    version of Buildroot which is known to be working with the
     associated tarballs. This will allow you to regenerate the
     toolchain and the target filesystem with exactly the same
     versions.</p>
@@ -368,15 +379,39 @@ mipsel-linux-uclibc-gcc -o foo foo.c
 
 <pre>
 config BR2_PACKAGE_FOO
-        tristate "foo"
-        default n
+        tristate "foo - some nice tool"
+        default m if CONFIG_DEVEL
         help
             This is a comment that explains what foo is.
 </pre>
 
+    <p>If you depend on other software or library inside the Buildroot, it
+    is important that you automatically select these packages in your 
+    <code>Config.in</code>. Example if foo depends on bar library:
+    </p>
+<pre>
+config BR2_PACKAGE_FOO
+        tristate "foo - some nice tool"
+        default m if CONFIG_DEVEL
+       select BR2_PACKAGE_LIBBAR
+        help
+        This is a comment that explains what foo is.
+</pre>
+
     <p>Of course, you can add other options to configure particular
     things in your software.</p>
 
+    <h3><code>Config.in</code> in the package directory</h3>
+       
+    <p>To add your package to the configuration tool, you need
+    to add the following line to <code>package/Config.in</code>,
+    please add it to a section, which fits the purpose of foo:
+
+<pre>
+comment "Networking"
+source "package/foo/Config.in"
+</pre>
+
     <h3><code>Makefile</code> in the package directory</h3>
 
     <p>To add your package to the build process, you need to edit
@@ -390,18 +425,18 @@ package-$(BR2_PACKAGE_FOO) += foo
    <p>As you can see, this short line simply adds the target 
    <code>foo</code> to the list of targets handled by OpenWrt Buildroot.</p>
 
-
-    <p>In addition to the default dependencies, you make your package
-    depend on another package (e.g. a library) by adding a line:
+   <p>In addition to the default dependencies, you make your package
+   depend on another package (e.g. a library) by adding a line:
     
 <pre>
 foo-compile: bar-compile
 </pre>
 
-   <h3>The <i>.control</i> file</h3>
+   <h3>The ipkg control file</h3>
    <p>Additionally, you need to create a control file which contains
    information about your package, readable by the <i>ipkg</i> package
-   utility.</p>
+   utility. It should be created as file:
+   <code>package/foo/ipkg/foo.control</code></p>
    
    <p>The file looks like this</p>
 
@@ -411,44 +446,45 @@ foo-compile: bar-compile
      3  Section: net
      4  Maintainer: Foo Software &lt;foo@foosoftware.com&gt;
      5  Source: http://foosoftware.com
-     6  Description: Your Package Description
+     6  Depends: libbar
+     7  Description: Package Description
 </pre>
    
    <p>You can skip the usual <code>Version:</code> and <code>Architecture</code>
    fields, as they will be generated by the <code>make-ipkg-dir.sh</code> script
-   called from your Makefile</p>
+   called from your Makefile. The Depends field is important, so that ipkg will
+   automatically fetch all dependend software on your target system.</p>
 
    <h3>The real <i>Makefile</i></h3>
 
    <p>Finally, here's the hardest part. Create a file named
    <code>Makefile</code>. It will contain the <i>Makefile</i> rules that
    are in charge of downloading, configuring, compiling and installing
-   the software. Below is an example that we will comment
-   afterwards.</p>
+   the software. Below is an example that we will comment afterwards.</p>
 
 <pre>
      1  # $Id$
-     2  include $(TOPDIR)/rules.mk
-     3  PKG_NAME:=foo
-     4  PKG_VERSION:=1.0
-     5  PKG_RELEASE:=1
-     6  PKG_MD5SUM:=4584f226523776a3cdd2fb6f8212ba8d
-     7
-     8  PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-     9  PKG_SOURCE_URL:=http://www.foosoftware.org/downloads
-    10  PKG_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
-    11  PKG_IPK:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
-    12  PKG_IPK_DIR:=$(PKG_DIR)/ipkg
-    13
-    14  $(DL_DIR)/$(PKG_SOURCE):
-    15          $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
+     2 
+     3  include $(TOPDIR)/rules.mk
+     4
+     5  PKG_NAME:=foo
+     6  PKG_VERSION:=1.0
+     7  PKG_RELEASE:=1
+     8  PKG_MD5SUM:=4584f226523776a3cdd2fb6f8212ba8d
+     9 
+    10  PKG_SOURCE_URL:=http://www.foosoftware.org/downloads
+    11  PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+    12         PKG_CAT:=zcat
+    13 
+    14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+    15 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
     16
-    17  $(PKG_DIR)/.source: $(DL_DIR)/$(PKG_SOURCE)
-    18          zcat $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
-    19          touch $(PKG_DIR)/.source
+    17 include $(TOPDIR)/package/rules.mk
+    18
+    19 $(eval $(call PKG_template,FOO,foo,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
     20
-    21  $(PKG_DIR)/.configured: $(PKG_DIR)/.source
-    22          (cd $(PKG_DIR); \
+    21  $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
+    22          (cd $(PKG_BUILD_DIR); \
     23                  $(TARGET_CONFIGURE_OPTS) \
     24                  CFLAGS="$(TARGET_CFLAGS)" \
     25                  ./configure \
@@ -457,36 +493,37 @@ foo-compile: bar-compile
     28                  --build=$(GNU_HOST_NAME) \
     29                  --prefix=/usr \
     30                  --sysconfdir=/etc \
-    31          );
-    32          touch $(PKG_DIR)/.configured;
-    33
-    34  $(PKG_DIR)/$(PKG_NAME): $(PKG_DIR)/.configured
-    35          $(MAKE) CC=$(TARGET_CC) -C $(PKG_DIR)
-    36
-    37  $(PKG_IPK): $(PKG_DIR)/$(PKG_NAME)
-    38         $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_IPK_DIR) $(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
-    39          $(MAKE) prefix=$(PKG_IPK_DIR)/usr -C $(PKG_DIR) install
-    40          rm -Rf $(PKG_IPK_DIR)/usr/man
-    41         $(IPKG_BUILD) $(PKG_IPK_DIR) $(PACKAGE_DIR)
-    42
-    43  $(IPKG_STATE_DIR)/info/$(PKG_NAME).list: $(PKG_IPK)  
-    44         $(IPKG) install $(PKG_IPK) 
-    45  
-    46  prepare: $(PKG_DIR)/.source
-    47  compile: $(PKG_IPK)
-    48  install: $(IPKG_STATE_DIR)/info/$(PKG_NAME).list
-    49  clean:
-    50         rm -rf $(PKG_DIR)
-    51         rm -f $(PKG_IPK)
+    31                         --with-bar="$(STAGING_DIR)/usr" \
+    32          );
+    33          touch $@
+    34
+    35  $(PKG_BUILD_DIR)/.built:
+    36         rm -rf $(PKG_INSTALL_DIR)
+    37         mkdir -p $(PKG_INSTALL_DIR)
+    38         $(MAKE) -C $(PKG_BUILD_DIR) \
+    39                   $(TARGET_CONFIGURE_OPTS) \
+    40            install_prefix="$(PKG_INSTALL_DIR)" \
+    41                   all install
+    42         touch $@
+    43 
+    44  $(IPKG_FOO):
+    46         install -d -m0755 $(IDIR_FOO)/usr/sbin
+    47         cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/foo $(IDIR_FOO)/usr/sbin
+    49         $(RSTRIP) $(IDIR_FOO)
+    50         $(IPKG_BUILD) $(IDIR_FOO) $(PACKAGE_DIR)
+    51 
+    52 mostlyclean:
+    53         make -C $(PKG_BUILD_DIR) clean
+    54         rm $(PKG_BUILD_DIR)/.built
 </pre>
 
     <p>First of all, this <i>Makefile</i> example works for a single
     binary software. For other software such as libraries or more
     complex stuff with multiple binaries, it should be adapted. Look at
-    the other <code>Makefile</code> files in the <code>package</code>
+    the other <code>Makefile</code> files in the <code>package/</code>
     directory.</p>
 
-    <p>At lines 3-12, a couple of useful variables are defined :</p>
+    <p>At lines 5-15, a couple of useful variables are defined:</p>
 
     <ul>
      <li><code>PKG_NAME</code> : The package name, e.g. <i>foo</i>.</li>
@@ -495,45 +532,42 @@ foo-compile: bar-compile
      should be downloaded.</li>
 
      <li><code>PKG_RELEASE</code> : The release number that will be
-     appended to the version number of your <i>ipkg</i> package.
+     appended to the version number of your <i>ipkg</i> package.</li>
 
-     <li><code>PKG_MD5SUM</code> : The md5sum of the software archive.
-
-     <li><code>PKG_SOURCE</code> : The name of the tarball of
-     your package on the download website of FTP site. As you can see
-     <code>PKG_NAME</code> and <code>PKG_VERSION</code> are used.</li>
+     <li><code>PKG_MD5SUM</code> : The md5sum of the software archive.</li>
 
      <li><code>PKG_SOURCE_URL</code> : Space separated list of the HTTP
      or FTP sites from which the archive is downloaded. It must include the complete
      path to the directory where <code>FOO_SOURCE</code> can be
      found.</li>
 
-     <li><code>PKG_DIR</code> : The directory into which the software
+     <li><code>PKG_SOURCE</code> : The name of the tarball of
+     your package on the download website of FTP site. As you can see
+     <code>PKG_NAME</code> and <code>PKG_VERSION</code> are used.</li>
+
+     <li><code>PKG_CAT</code> : The tool needed for extraction of the 
+       software archive.</li>
+
+     <li><code>PKG_BUILD_DIR</code> : The directory into which the software
      will be configured and compiled. Basically, it's a subdirectory
-     of <code>BUILD_DIR</code> which is created upon decompression of
+     of <code>BUILD_DIR</code> which is created upon extraction of
      the tarball.</li>
 
-     <li><code>PKG_IPK</code> : The resulting <i>ipkg</i> package
+     <li><code>PKG_INSTALL_DIR</code> : The directory into the software 
+     will be installed. It is a subdirectory of <code>PKG_BUILD_DIR</code>.</li>
 
     </ul>
 
-    <p>Lines 14-15 defines a target that downloads the tarball from
-    the remote site to the download directory
-    (<code>DL_DIR</code>).</p>
-
-    <p>Lines 17-19 defines a target and associated rules that
-    uncompress the downloaded tarball. As you can see, this target
-    depends on the tarball file, so that the previous target (line
-    14-15) is called before executing the rules of the current
-    target. Uncompressing is followed by <i>touching</i> a hidden file
-    to mark the software has having been uncompressed. This trick is
-    used everywhere in Buildroot <i>Makefile</i> to split steps
-    (download, uncompress, configure, compile, install) while still
-    having correct dependencies.</p>
-
-    <p>Lines 21-32 defines a target and associated rules that
+    <p>In Line 3 and 17 we include common variables and routines to simplify
+       the process of ipkg creation. It includes routines to download, verify
+        and extract the software package archives.</p>
+
+    <p>Line 19 contains the magic line which automatically creates the 
+       ipkg for us.</p>
+
+    <p>Lines 21-33 defines a target and associated rules that
     configures the software. It depends on the previous target (the
-    hidden <code>.source</code> file) so that we are sure the software has
+    hidden <code>.prepared</code> file) so that we are sure the software has
     been uncompressed. In order to configure it, it basically runs the
     well-known <code>./configure</code>script. As we may be doing
     cross-compilation, <code>target</code>, <code>host</code> and
@@ -543,41 +577,21 @@ foo-compile: bar-compile
     filesystem. Finally it creates a <code>.configured</code> file to
     mark the software as configured.</p>
 
-    <p>Lines 34-35 defines a target and a rule that compiles the
+    <p>Lines 35-42 defines a target and a rule that compiles the
     software. This target will create the binary file in the
     compilation directory, and depends on the software being already
     configured (hence the reference to the <code>.configured</code>
-    file). It basically runs <code>make</code> inside the source
-    directory.</p>
-
-    <p>Lines 37-41 defines a target and associated rules that create
-    the <i>ipkg</i> package which can optionally be embedded into
-    the resulting firmware image. It depends on the binary file in 
-    the source directory, to make sure the software has been compiled.
-    It uses the make-ipkg-dir.sh script, which will create the ipkg
-    build directory for your package, copy your control file into 
-    that directory and add version and architecture information.
-    Then it calls the <code>install</code> target of the
-    software <code>Makefile</code> by passing a <code>prefix</code>
-    argument, so that the <code>Makefile</code> doesn't try to install
-    the software inside host <code>/usr</code> but inside target
-    <code>/usr</code>. After the installation, the
-    <code>/usr/man</code> directory inside the target filesystem is
-    removed to save space.
+    file). Afterwards it installs the resulting binary into the 
+    <code>PKG_INSTALL_DIR</code>. It basically runs 
+    <code>make install</code> inside the source directory.</p>
+
+    <p>Lines 44-50 defines a target and associated rules that create
+    the <i>ipkg</i> package, which can optionally be embedded into
+    the resulting firmware image. It manually installs all files you
+    want to integrate in your resulting ipkg. <code>RSTRIP</code> will
+    recursevily strip all binaries and libraries. 
     Finally <code>IPKG_BUILD</code> is called to create the package.</p>
 
-    <p>Line 43 and 44 define the installation target of your package,
-    which will embed the software into the target filesystem.</p>
-
-    <p>Lines 46-51 define the main targets that the Makefile in the
-    <code>package</code> dir calls.
-    <ul>
-      <li><code>prepare</code> : Download and unpack the source</li>
-      <li><code>compile</code> : Compile the source and create the package</li>
-      <li><code>install</code> : Embed the package into the target filesystem</li>
-      <li><code>clean</code> : Remove all the files created by the build process</li>
-    </ul></p>
-
     <h3>Conclusion</h3>
 
     <p>As you can see, adding a software to buildroot is simply a
@@ -586,13 +600,104 @@ foo-compile: bar-compile
     the software.</p>
 
     <p>If you package software that might be useful for other persons,
-    don't forget to send a patch to OpenWrt developers !</p>
+    don't forget to send a patch to OpenWrt developers! 
+    Use the mail address: openwrt-devel@openwrt.org   
+    </p>
 
      <h2><a name="links" id="links"></a>Resources</h2>
 
-    <p>To learn more about OpenWrt Buildroot you can visit this
-    website: <a href="http://openwrt.org/">http://openwrt.org/</a></p>
+    <p>To learn more about OpenWrt you can visit this website: 
+     <a href="http://openwrt.org/">http://openwrt.org/</a></p>
 
   </div>
+
+  <div class="main">
+    <div class="titre">
+      <h1>OpenWrt Kernel Module Creation Howto</h1>
+    </div>
+
+    <h2><a name="about_module" id="about_module"></a>About OpenWrt Kernel Module Compilation</h2>
+
+       <p>You are planning to compile a kernel module? This howto will
+explain what you have to do, to have your kernel module installable as
+an ipkg.</p>
+
+    <h2><a name="kernel" id="kernel"></a>Enable the kernel options</h2>
+
+       <p>Enable the kernel options you want by modifying
+build_mipsel/linux/.config. We are assuming, that you already had your
+kernel compiled once here. You can do the modification by hand or by 
+
+<pre>
+$ cd build_mipsel/linux
+$ make menuconfig
+</pre>
+
+And copy it, so your changes are not getting lost, when doing a 'make
+dirclean'. Here we assume that you are compiling for Broadcom chipset
+based devices:
+
+<pre> $ cp .config ../../../target/linux/linux-2.4/config/brcm </pre>
+
+</p>
+    <h2><a name="buildroot_option" id="buildroot_option"></a>Create a buildroot option</h2>
+
+       <p>Create a buildroot option by modifying/inserting into
+target/linux/Config.in, e.g.
+
+<pre>
+config BR2_PACKAGE_KMOD_USB_KEYBOARD
+        tristate "Support for USB keyboards"
+        default m
+        depends BR2_PACKAGE_KMOD_USB_CONTROLLER
+</pre>
+</p>
+
+    <h2><a name="binary" id="binary"></a>Define the binary files for the kernel module</h2>
+
+       <p>Define the binary files for the kernel module by modifying/inserting into
+target/linux/linux-2.4/Makefile, e.g.
+
+<pre>
+$(eval $(call KMOD_template,USB_KEYBOARD,usb-kbd,\
+       $(MODULES_DIR)/kernel/drivers/input/input.o \
+       $(MODULES_DIR)/kernel/drivers/input/keybdev.o \
+       $(MODULES_DIR)/kernel/drivers/usb/usbkbd.o \
+,CONFIG_USB_KEYB,kmod-usb-core,60,input keybdev usbkbd))
+</pre>
+
+Where CONFIG_USB_KEYB is the kernel option, USB_KEYBOARD is the last
+part of BR2_PACKAGE_KMOD_USB_KEYBOARD and usb-kbd is part of the
+filename of the created ipkg.</p>
+
+    <h2><a name="control" id="control"></a>Specify the ipkg control file</h2>
+
+       <p>Create e.g. target/linux/control/kmod-usb-kbd.control with content similar to this:
+
+<pre>
+Package: kmod-usb-kbd
+Priority: optional
+Section: sys
+Maintainer: Markus Becker &lt;mab@comnets.uni-bremen.de&gt;
+Source: buildroot internal
+Description: Kernel Support for USB Keyboards
+</pre>
+       </p>
+
+    <h2><a name="compile" id="compile"></a>Compile the kernel module</h2>
+
+       <p>Enable the kernel module with
+<pre>
+$ make menuconfig
+</pre>
+       in TOPDIR and selecting it.<br>
+
+       Compile with
+<pre>
+$ make dirclean && make
+</pre>
+       </p>
+  </div>
+
 </body>
 </html>
index ba9c05f064cc60326cf467e5ff32373121f0fca9..11f504d1672e53d0a69c841d6738645bd81be894 100644 (file)
@@ -8,6 +8,7 @@ source "package/bridge/Config.in"
 source "package/dnsmasq/Config.in"
 source "package/ipkg/Config.in"
 source "package/iptables/Config.in"
+source "package/mtd/Config.in"
 
 comment "Applications"
 source "package/haserl/Config.in"
@@ -125,9 +126,9 @@ source "package/picocom/Config.in"
 source "package/setserial/Config.in"
 
 comment "Utilities ---"
+source "package/madwifi-tools/Config.in"
 source "package/usbutils/Config.in"  # lsusb
 source "package/strace/Config.in"
-source "package/gdb/Config.in"
 
 # what are we going to do with both of you
 comment "Kernel related ---"
@@ -137,6 +138,15 @@ source "package/shfs/Config.in"  # kmod-shfs
 comment "Extra stuff"
 source "package/sdk/Config.in"
 
+config BR2_PACKAGE_IMAGEBUILDER
+       bool "OpenWrt Image Builder"
+       default y if CONFIG_DEVEL
+       help
+         Build an OpenWrt Image Builder.
+         This package contains the necessary (precompiled) tools and all packages to generate
+         firmware images from package lists, without having to use the full buildroot.
+         Useful for building images with custom scripts or extra packages.
+
 endmenu
 
 source "package/Sysconf.in"
index c3f4a484962efcc160fd42ca73fd42d342707f79..d8f06fa566712fc44da30db991b7a92034971840 100644 (file)
@@ -2,7 +2,7 @@
 include $(TOPDIR)/rules.mk
 
 package-:=tcp_wrappers
-package-y:=openwrt
+package-y:=nvram
 package-$(BR2_PACKAGE_AICCU) += aiccu
 package-$(BR2_PACKAGE_ARPTABLES) += arptables
 package-$(BR2_PACKAGE_ARPWATCH) += arpwatch
@@ -56,9 +56,11 @@ package-$(BR2_PACKAGE_LUA) += lua
 package-$(BR2_PACKAGE_LZO) += lzo
 package-$(BR2_PACKAGE_MARADNS) += maradns
 package-$(BR2_PACKAGE_MATRIXSSL) += matrixssl
+package-$(BR2_PACKAGE_MADWIFI_TOOLS) += madwifi-tools
 package-$(BR2_PACKAGE_MICROCOM) += microcom
 package-$(BR2_PACKAGE_MICROPERL) += microperl
 package-$(BR2_PACKAGE_MONIT) += monit
+package-$(BR2_PACKAGE_MTD) += mtd
 package-$(BR2_PACKAGE_MYSQL) += mysql
 package-$(BR2_PACKAGE_NCURSES) += ncurses
 package-$(BR2_PACKAGE_NDISC) += ndisc
@@ -120,17 +122,21 @@ package-$(BR2_PACKAGE_WPUT) += wput
 package-$(BR2_PACKAGE_XINETD) += xinetd
 package-$(BR2_PACKAGE_ZLIB) += zlib
 
-DEV_LIBS:=tcp_wrappers glib ncurses openssl pcre popt zlib libnet libpcap mysql postgresql iptables matrixssl lzo gmp fuse portmap libelf uclibc++ speex libpng libgd wireless-tools
+DEV_LIBS:=tcp_wrappers glib ncurses openssl pcre popt zlib libnet libpcap mysql postgresql iptables matrixssl lzo gmp fuse portmap libelf uclibc++ speex libpng libgd wireless-tools nvram
 DEV_LIBS_COMPILE:=$(patsubst %,%-compile,$(DEV_LIBS))
 SDK_DEFAULT_PACKAGES:=busybox dnsmasq iptables wireless-tools dropbear bridge ipkg ppp
 SDK_DEFAULT_COMPILE:=$(patsubst %,%-compile,$(SDK_DEFAULT_PACKAGES))
+COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m))
+INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y))
 
-all: compile install
+all: compile
 clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m))
-compile: $(patsubst %,%-compile,$(package-y) $(package-m))
-install: $(patsubst %,%-install,$(package-y))
+compile: $(COMPILE_PACKAGES)
+install: base-files-install $(INSTALL_PACKAGES)
+
+$(COMPILE_PACKAGES): base-files-compile
+$(INSTALL_PACKAGES): base-files-install
 
-wificonf-compile: openwrt-compile wireless-tools-compile
 arpwatch-compile: libpcap-compile
 cyrus-sasl-compile: openssl-compile
 dropbear-compile: zlib-compile
@@ -155,6 +161,7 @@ openswan-compile: gmp-compile
 osiris-compile: openssl-compile
 portmap-compile: tcp_wrappers-compile
 postgresql-compile: zlib-compile
+quagga-compile: readline-compile ncurses-compile
 rsync-compile: popt-compile
 screen-compile: ncurses-compile
 siproxd-compile: libosip2-compile
@@ -162,11 +169,13 @@ sipsak-compile: openssl-compile
 sqlite-compile: ncurses-compile readline-compile
 tcpdump-compile: libpcap-compile
 tinc-compile: zlib-compile openssl-compile lzo-compile
-vtun-compile: zlib-compile openssl-compile lzo-compile
 tor-compile: libevent-compile openssl-compile zlib-compile
+usbutils-compile: libusb-compile
+vtun-compile: zlib-compile openssl-compile lzo-compile
+wificonf-compile: wireless-tools-compile nvram-compile
 wpa_supplicant-compile: openssl-compile
 
-asterisk-compile: openssl-compile
+asterisk-compile: ncurses-compile openssl-compile
 ifneq ($(BR2_PACKAGE_ASTERISK_CODEC_SPEEX),)
 asterisk-compile: speex-compile
 endif
@@ -220,9 +229,12 @@ ifneq ($(BR2_PACKAGE_ULOGD_PGSQL),)
 ulogd-compile: postgresql-compile
 endif
 
-sdk-compile: $(DEV_LIBS_COMPILE) $(SDK_DEFAULT_COMPILE) openwrt-install
+sdk-compile: $(DEV_LIBS_COMPILE) $(SDK_DEFAULT_COMPILE)
 
-%-prepare:
+$(STAMP_DIR):
+       mkdir -p $@
+
+%-prepare: $(STAMP_DIR)
        @[ -f $(STAMP_DIR)/.$@ ] || $(MAKE) -C $(patsubst %-prepare,%,$@) prepare
        @touch $(STAMP_DIR)/.$@
 
@@ -231,8 +243,11 @@ sdk-compile: $(DEV_LIBS_COMPILE) $(SDK_DEFAULT_COMPILE) openwrt-install
        @touch $(STAMP_DIR)/.$@
 
 %-install: %-compile
-       @[ -f $(STAMP_DIR)/.$@ ] || $(MAKE) -C $(patsubst %-install,%,$@) install
-       @touch $(STAMP_DIR)/.$@
+       @$(MAKE) -C $(patsubst %-install,%,$@) \
+               TARGET_DIR="$(TARGET_DIR)" \
+               IPKG_CONF="$(IPKG_CONF)" \
+               BOARD="$(BOARD)" \
+               install
 
 %-rebuild: 
        @rm -f $(STAMP_DIR)/.$(patsubst %-rebuild,%,$@)-*
index ceb745040b7255a57f2353107b054a45da21b385..348c93c98055f77fd16a74fbd0c2c5cfbcd84e26 100644 (file)
@@ -15,16 +15,15 @@ include $(TOPDIR)/package/rules.mk
 
 $(eval $(call PKG_template,ARPTABLES,arptables,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
 
-$(PKG_BUILD_DIR)/.configured:
-       touch $@
-
 $(PKG_BUILD_DIR)/.built: 
        $(MAKE) -C $(PKG_BUILD_DIR) \
                CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld \
-               CFLAGS="$(TARGET_CFLAGS) -Wall -I$(PKG_BUILD_DIR)/include/linux/include -I$(PKG_BUILD_DIR)/include -DARPTABLES_VERSION=\\\"$(PKG_VERSION)\\\" "
+               COPT_FLAGS="$(TARGET_CFLAGS)" \
+               KERNEL_DIR="./include/linux"
        touch $@
 
 $(IPKG_ARPTABLES):
        mkdir -p $(IDIR_ARPTABLES)/usr/sbin
-       cp $(PKG_BUILD_DIR)/arptables $(IDIR_ARPTABLES)/usr/sbin/
+       install -m0755 $(PKG_BUILD_DIR)/arptables $(IDIR_ARPTABLES)/usr/sbin/
+       $(RSTRIP) $(IDIR_ARPTABLES)
        $(IPKG_BUILD) $(IDIR_ARPTABLES) $(PACKAGE_DIR)
diff --git a/openwrt/package/asterisk/patches/asterisk-1.0.7-no_gtk.patch b/openwrt/package/asterisk/patches/asterisk-1.0.7-no_gtk.patch
new file mode 100644 (file)
index 0000000..9b99e8d
--- /dev/null
@@ -0,0 +1,20 @@
+diff -ruN asterisk-1.0.7-old/pbx/Makefile asterisk-1.0.7-new/pbx/Makefile
+--- asterisk-1.0.7-old/pbx/Makefile    2003-10-26 19:50:49.000000000 +0100
++++ asterisk-1.0.7-new/pbx/Makefile    2005-07-04 15:42:52.000000000 +0200
+@@ -16,13 +16,13 @@
+ PBX_LIBS=pbx_config.so pbx_wilcalu.so pbx_spool.so     # pbx_gtkconsole.so pbx_kdeconsole.so
+ # Add GTK console if appropriate
+-PBX_LIBS+=$(shell gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
++#PBX_LIBS+=$(shell gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
+ # Add KDE Console if appropriate
+ #PBX_LIBS+=$(shell [ "$$QTDIR" != "" ] && echo "pbx_kdeconsole.so")
+-GTK_FLAGS=`gtk-config --cflags gthread`
+-GTK_LIBS=`gtk-config --libs gthread`
++#GTK_FLAGS=`gtk-config --cflags gthread`
++#GTK_LIBS=`gtk-config --libs gthread`
+ #CXX=egcs
+ MOC=$(QTDIR)/bin/moc
+ KDE_FLAGS=-I$(KDEDIR)/include -I$(KDEDIR)/include/kde -I$(QTDIR)/include
diff --git a/openwrt/package/base-files/Makefile b/openwrt/package/base-files/Makefile
new file mode 100644 (file)
index 0000000..63decb3
--- /dev/null
@@ -0,0 +1,85 @@
+# $Id$
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=base-files
+PKG_RELEASE:=2
+PKG_BUILD_DIR:=$(BUILD_DIR)/base-files
+
+include $(TOPDIR)/package/rules.mk
+
+IDIR_BASE:=$(PKG_BUILD_DIR)/base-files
+IPKG_BASE:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_RELEASE)_$(ARCH).ipk
+
+IDIR_HOTPLUG:=$(PKG_BUILD_DIR)/hotplug
+IPKG_HOTPLUG:=$(PACKAGE_DIR)/hotplug_$(PKG_RELEASE)_$(ARCH).ipk
+
+LIBC_VERSION:=${shell cat $(STAGING_DIR)/uclibc_version}
+IDIR_LIBC:=$(PKG_BUILD_DIR)/uclibc
+IPKG_LIBC:=$(PACKAGE_DIR)/uclibc_$(LIBC_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
+
+GCC_VERSION:=${shell cat $(STAGING_DIR)/gcc_version}
+IDIR_GCC:=$(PKG_BUILD_DIR)/libgcc
+IPKG_GCC:=$(PACKAGE_DIR)/libgcc_$(GCC_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
+
+PACKAGES:=$(IPKG_BASE) $(IPKG_LIBC) $(IPKG_GCC) $(IPKG_HOTPLUG)
+
+$(PKG_BUILD_DIR)/.prepared:
+       mkdir -p $(PKG_BUILD_DIR) $(PACKAGE_DIR)
+       touch $@
+
+$(PKG_BUILD_DIR)/.built:
+       touch $@
+
+$(IPKG_BASE):
+       $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_BASE) ipkg/$(PKG_NAME).control $(PKG_RELEASE) $(ARCH)
+       cp -a ./default/* $(IDIR_BASE)
+       mkdir -p $(IDIR_BASE)/jffs
+       mkdir -p $(IDIR_BASE)/dev
+       mkdir -p $(IDIR_BASE)/proc
+       mkdir -p $(IDIR_BASE)/tmp
+       mkdir -p $(IDIR_BASE)/lib
+       mkdir -p $(IDIR_BASE)/usr/lib
+       mkdir -p $(IDIR_BASE)/usr/bin
+       mkdir -p $(IDIR_BASE)/www
+       ln -sf /tmp/resolv.conf $(IDIR_BASE)/etc/resolv.conf
+       rm -rf $(IDIR_BASE)/var
+       ln -sf /tmp $(IDIR_BASE)/var
+       -find $(IDIR_BASE) -type d -name CVS | xargs rm -rf
+       -find $(IDIR_BASE) -type d -name .svn | xargs rm -rf
+       -find $(IDIR_BASE) -name '.#*' | xargs rm -f
+       mkdir -p $(IDIR_BASE)/etc
+       -grep \^BR2_SYSCONF $(TOPDIR)/.config > $(IDIR_BASE)/etc/sysconf
+       $(IPKG_BUILD) $(IDIR_BASE) $(PACKAGE_DIR)
+
+$(IPKG_LIBC):
+       $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_LIBC) ipkg/uclibc.control $(LIBC_VERSION)-$(PKG_RELEASE) $(ARCH)
+       mkdir -p $(IDIR_LIBC)/lib
+       cp $(STAGING_DIR)/lib/ld-uClibc*.so.* $(IDIR_LIBC)/lib/
+       for file in c crypt dl m nsl resolv rt uClibc util; do \
+               cp $(STAGING_DIR)/lib/lib$$file*.so.* $(IDIR_LIBC)/lib/; \
+       done
+       -$(STRIP) $(IDIR_LIBC)/lib/*
+       $(IPKG_BUILD) $(IDIR_LIBC) $(PACKAGE_DIR)
+
+$(IPKG_GCC):
+       $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_GCC) ipkg/libgcc.control $(GCC_VERSION)-$(PKG_RELEASE) $(ARCH)
+       mkdir -p $(IDIR_GCC)/lib
+       cp -fpR $(STAGING_DIR)/lib/libgcc*.so.* $(IDIR_GCC)/lib/
+       -$(STRIP) $(IDIR_GCC)/lib/*
+       $(IPKG_BUILD) $(IDIR_GCC) $(PACKAGE_DIR)
+
+$(IPKG_HOTPLUG):
+       $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_HOTPLUG) ipkg/hotplug.control $(PKG_RELEASE) $(ARCH)
+       mkdir -p $(IDIR_HOTPLUG)/sbin
+       install -m0755 files/hotplug $(IDIR_HOTPLUG)/sbin
+       $(IPKG_BUILD) $(IDIR_HOTPLUG) $(PACKAGE_DIR)
+       
+package-clean:
+       rm -f $(PACKAGES)
+clean: package-clean
+prepare:
+compile: $(PACKAGES)
+install: compile
+       mkdir -p $(TARGET_DIR)
+       $(IPKG) install $(PACKAGES)
diff --git a/openwrt/package/base-files/default/bin/firstboot b/openwrt/package/base-files/default/bin/firstboot
new file mode 100755 (executable)
index 0000000..cef258c
--- /dev/null
@@ -0,0 +1,63 @@
+#!/bin/sh
+# $Id$
+
+mount | grep squashfs >&- || {
+       echo "You do not have a squashfs partition; aborting"
+       echo "(firstboot cannot be run on jffs2 based firmwares)"
+       return
+}
+
+[ -f "/tmp/.firstboot" ] && {
+       echo "firstboot is already running"
+       return
+}
+touch /tmp/.firstboot
+
+jdev=$(mount | awk '/jffs2/ {print $3}')
+
+if [ -z "$jdev" ]; then
+       echo -n "Creating jffs2 partition... "
+       mtd erase OpenWrt >&- 
+       mount -t jffs2 /dev/mtdblock/4 /jffs
+       echo "done"
+       cd /jffs
+else
+       echo "firstboot has already been run"
+       echo "jffs2 partition is mounted, only resetting files"
+       cd $jdev
+fi
+
+exec 2>/dev/null
+
+mount /dev/mtdblock/2 /rom -o ro
+
+echo -n "creating directories... "
+{
+       cd /rom
+       find . -type d
+       cd -
+} | xargs mkdir
+echo "done"
+
+echo -n "setting up symlinks... "
+for file in $(cd /rom; find *  -type f; find *  -type l;)
+do {
+  [ "${file%/*}" = "usr/lib/ipkg/info" ] && {
+    cp -f /rom/$file $file
+  } || {
+    ln -sf /rom/$file $file
+  }
+} done
+echo "done"
+
+touch /tmp/resolv.conf
+ln -s /tmp/resolv.conf /etc/resolv.conf
+
+umount /rom
+mount none /jffs/proc -t proc
+pivot_root /jffs /jffs/rom
+mount none /dev  -t devfs
+mount none /tmp  -t ramfs
+umount /rom/proc
+umount /rom/tmp
+umount /rom/dev
diff --git a/openwrt/package/base-files/default/bin/login b/openwrt/package/base-files/default/bin/login
new file mode 100755 (executable)
index 0000000..bb065e5
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+. /etc/sysconf 2>&-
+
+[ "$FAILSAFE" != "true" ] &&
+[ "$BR2_SYSCONF_TELNET_FAILSAFE_ONLY" = "y" ] &&
+{
+  grep '^root:[^!]' /etc/passwd >&- 2>&- &&
+  {
+    echo "Login failed."
+    exit 0
+  } || {
+cat << EOF
+ === IMPORTANT ============================
+  Use 'passwd' to set your login password
+  this will disable telnet and enable SSH
+ ------------------------------------------
+EOF
+  }
+}
+exec /bin/ash --login
diff --git a/openwrt/package/base-files/default/etc/banner b/openwrt/package/base-files/default/etc/banner
new file mode 100644 (file)
index 0000000..e40fbca
--- /dev/null
@@ -0,0 +1,10 @@
+  _______                     ________        __
+ |       |.-----.-----.-----.|  |  |  |.----.|  |_
+ |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
+ |_______||   __|_____|__|__||________||__|  |____|
+          |__| W I R E L E S S   F R E E D O M
+ WHITE RUSSIAN (RC2) -------------------------------
+  * 2 oz Vodka   Mix the Vodka and Kahlua together
+  * 1 oz Kahlua  over ice, then float the cream or
+  * 1/2oz cream  milk on the top.
+ ---------------------------------------------------
diff --git a/openwrt/package/base-files/default/etc/firewall.user b/openwrt/package/base-files/default/etc/firewall.user
new file mode 100755 (executable)
index 0000000..7a13141
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+. /etc/functions.sh
+
+WAN=$(nvram get wan_ifname)
+LAN=$(nvram get lan_ifname)
+
+iptables -F input_rule
+iptables -F output_rule
+iptables -F forwarding_rule
+iptables -t nat -F prerouting_rule
+iptables -t nat -F postrouting_rule
+
+### BIG FAT DISCLAIMER
+### The "-i $WAN" literally means packets that came in over the $WAN interface;
+### this WILL NOT MATCH packets sent from the LAN to the WAN address.
+
+### Allow SSH on the WAN interface
+# iptables -t nat -A prerouting_rule -i $WAN -p tcp --dport 22 -j ACCEPT 
+# iptables        -A input_rule      -i $WAN -p tcp --dport 22 -j ACCEPT
+
+### Port forwarding
+# iptables -t nat -A prerouting_rule -i $WAN -p tcp --dport 22 -j DNAT --to 192.168.1.2
+# iptables        -A forwarding_rule -i $WAN -p tcp --dport 22 -d 192.168.1.2 -j ACCEPT
+
+### DMZ (should be placed after port forwarding / accept rules)
+# iptables -t nat -A prerouting_rule -i $WAN -j DNAT --to 192.168.1.2
+# iptables        -A forwarding_rule -i $WAN -d 192.168.1.2 -j ACCEPT
diff --git a/openwrt/package/base-files/default/etc/functions.sh b/openwrt/package/base-files/default/etc/functions.sh
new file mode 100755 (executable)
index 0000000..2bf4a8d
--- /dev/null
@@ -0,0 +1,107 @@
+#!/bin/ash
+
+alias debug=${DEBUG:-:}
+
+# allow env to override nvram
+nvram () {
+  case $1 in
+    get) eval "echo \${NVRAM_$2:-\$(command nvram get $2)}";;
+    *) command nvram $*;;
+  esac
+}
+[ "$FAILSAFE" = "true" ] && . /etc/nvram.overrides
+
+# valid interface?
+if_valid () (
+  ifconfig "$1" >&- 2>&- ||
+  [ "${1%%[0-9]}" = "br" ] ||
+  {
+    [ "${1%%[0-9]}" = "vlan" ] && ( 
+      i=${1#vlan}
+      hwname=$(nvram get vlan${i}hwname)
+      hwaddr=$(nvram get ${hwname}macaddr)
+      [ -z "$hwaddr" ] && return 1
+
+      vif=$(ifconfig -a | awk '/^eth.*'$hwaddr'/ {print $1; exit}' IGNORECASE=1)
+      debug "# vlan$i => $vif"
+
+      $DEBUG ifconfig $vif up
+      $DEBUG vconfig add $vif $i 2>&-
+    )
+  } ||
+  { debug "# missing interface '$1' ignored"; false; }
+)
+
+do_ifup() {
+       if_proto=$(nvram get ${2}_proto)
+       if=$(nvram get ${2}_ifname)
+       [ "${if%%[0-9]}" = "ppp" ] && if=$(nvram get ${if_proto}_ifname)
+       
+       pidfile=/var/run/${if}.pid
+       [ -f $pidfile ] && $DEBUG kill $(cat $pidfile)
+
+       case "$1" in
+       static)
+               ip=$(nvram get ${2}_ipaddr)
+               netmask=$(nvram get ${2}_netmask)
+               gateway=$(nvram get ${2}_gateway)
+
+               $DEBUG ifconfig $if $ip ${netmask:+netmask $netmask} broadcast + up
+               ${gateway:+$DEBUG route add default gw $gateway}
+
+               [ -f /etc/resolv.conf ] && return
+
+               debug "# --- creating /etc/resolv.conf ---"
+               for dns in $(nvram get ${2}_dns); do
+                       echo "nameserver $dns" >> /etc/resolv.conf
+               done
+       ;;
+       dhcp)
+               DHCP_IP=$(nvram get ${2}_ipaddr)
+               DHCP_NETMASK=$(nvram get ${2}_netmask)
+               $DEBUG ifconfig $if $ip ${netmask:+netmask $netmask} broadcast + up
+
+               DHCP_ARGS="-i $if ${DHCP_IP:+-r $DHCP_IP} -b -p $pidfile"
+               DHCP_HOSTNAME=$(nvram get ${2}_hostname)
+               DHCP_HOSTNAME=${DHCP_HOSTNAME%%.*}
+               [ -z $DHCP_HOSTNAME ] || DHCP_ARGS="$DHCP_ARGS -H $DHCP_HOSTNAME"
+               [ "$if_proto" = "pptp" ] && DHCP_ARGS="$DHCP_ARGS -n -q" || DHCP_ARGS="$DHCP_ARGS -R &"
+               oldpid=$(cat $pidfile)
+               ${DEBUG:-eval} "udhcpc $DHCP_ARGS"
+               pidof udhcpc | grep "$oldpid" >&- 2>&- && {
+                       sleep 1
+                       kill -9 $oldpid
+               }
+       ;;
+       none|"")
+       ;;
+       *)
+               [ -x "/sbin/ifup.$1" ] && { $DEBUG /sbin/ifup.$1 ${2}; exit; }
+               echo "### ifup ${2}: ignored ${2}_proto=\"$1\" (not supported)"
+       ;;
+       esac
+}
+
+bitcount () {
+  local c=$1
+  echo $((
+  c=((c>> 1)&0x55555555)+(c&0x55555555),
+  c=((c>> 2)&0x33333333)+(c&0x33333333),
+  c=((c>> 4)&0x0f0f0f0f)+(c&0x0f0f0f0f),
+  c=((c>> 8)&0x00ff00ff)+(c&0x00ff00ff),
+  c=((c>>16)&0x0000ffff)+(c&0x0000ffff)
+  ))
+}
+
+valid_netmask () {
+  return $((-($1)&~$1))
+}
+
+ip2int () (
+  set $(echo $1 | tr '\.' ' ')
+  echo $(($1<<24|$2<<16|$3<<8|$4))
+)
+
+int2ip () {
+  echo $(($1>>24&255)).$(($1>>16&255)).$(($1>>8&255)).$(($1&255))
+}
diff --git a/openwrt/package/base-files/default/etc/group b/openwrt/package/base-files/default/etc/group
new file mode 100644 (file)
index 0000000..c4e77f3
--- /dev/null
@@ -0,0 +1,2 @@
+root:x:0:
+nogroup:x:65534:
diff --git a/openwrt/package/base-files/default/etc/hosts b/openwrt/package/base-files/default/etc/hosts
new file mode 100644 (file)
index 0000000..ce138ec
--- /dev/null
@@ -0,0 +1 @@
+127.0.0.1 localhost OpenWrt
diff --git a/openwrt/package/base-files/default/etc/init.d/S05nvram b/openwrt/package/base-files/default/etc/init.d/S05nvram
new file mode 100755 (executable)
index 0000000..15e564f
--- /dev/null
@@ -0,0 +1,112 @@
+# NVRAM setup
+#
+# This file handles the NVRAM quirks of various hardware.
+
+. /etc/nvram.overrides
+alias debug=${DEBUG:-:}
+
+remap () {
+  for type in lan wifi wan pppoe
+  do
+    for s in '' s
+    do
+      eval nvram set ${type}_ifname$s=\"$(nvram get ${type}_ifname$s|sed s/$1/$2/g)\" 
+    done
+  done
+}
+
+nvram_default() {
+  [ -z "$(nvram get $1)" ] && nvram set "$1=$2"
+}
+
+# linksys bug; remove when not using static configuration for lan
+nvram set lan_proto="static"
+
+# hacks for wrt54g 1.x hardware
+[  "$(nvram get boardnum)"  = "42" \
+-a "$(nvram get boardtype)" = "bcm94710dev" ] && {
+  debug "### wrt54g 1.x hack ###"
+  nvram set vlan1hwname="et0"
+  nvram set vlan2hwname="et0"
+  remap eth0 vlan2
+  remap eth1 vlan1
+}
+
+# hacks for asus wl-500g deluxe
+[  "$(nvram get boardtype)" = "bcm95365r" \
+-a "$(nvram get boardnum)" = "45" ] && {
+  debug "### wl-500g deluxe hacks ###"
+  nvram set vlan0hwname="et0"
+  nvram set vlan1hwname="et0"
+  remap eth0.1 vlan0
+  remap eth0 vlan1
+
+  # set up the vlan*ports variables for the asus wl-500g deluxe
+  # if they don't already exist 
+  nvram_default vlan0ports "1 2 3 4 5*"
+  nvram_default vlan1ports "0 5"
+}
+
+# hacks for asus wl-300g
+[ "$(nvram get productid)" = "WL300g" ] && {
+  debug "### wl-300g hacks ###"
+  nvram set lan_ifnames="eth0 eth2"
+  nvram set wan_ifname="none"
+}
+
+# hacks for asus wl-hdd
+[ "$(nvram get productid)" = "WLHDD" ] && {
+  debug "### wl-hdd hacks ###"
+  nvram set lan_ifnames="eth1 eth2"
+  nvram set wan_ifname="none"
+}
+
+# hacks for wap54g hardware
+[  "$(nvram get boardnum)" = "2" \
+-o "$(nvram get boardnum)" = "1024" ] && {
+  debug "### wap54g hack ###"
+  nvram set wan_ifname="none"
+}
+
+# hacks for buffalo wla2-g54l
+[  "$(nvram get boardnum)" = "00" \
+-a "$(nvram get product_name)" = "Product_name" \
+-o "$(nvram get product_name)" = "WLA2-G54L" ] && {
+  debug "### wla2-g54l hacks ###"
+  nvram set wan_ifname="none"
+  nvram set lan_ifnames="vlan0"
+}
+
+# needed at least for wrt54gs v1.1 and wrt54g v2.0, v2.2
+[ \! -z "$(nvram get boardrev)" ] && {
+  nvram set wl0id=0x4320
+}
+
+WAN_PROTO="$(nvram get wan_proto)"
+[  "$WAN_PROTO" = "pptp" \
+-o "$WAN_PROTO" = "pppoe" ] && {
+       WAN_IFNAME="$(nvram get wan_ifname)"
+       [ "${WAN_IFNAME%%[0-9]*}" = "ppp" ] || {
+               nvram set wan_ifname=ppp0
+               nvram set ${WAN_PROTO}_ifname="$WAN_IFNAME"
+       }
+}
+
+# defaults
+nvram_default lan_ifname "br0"
+nvram_default lan_ifnames "$FAILSAFE_ifnames"
+
+nvram_default wan_ifname "vlan1"
+nvram_default wan_proto "dhcp"
+
+nvram_default wl0_ssid OpenWrt
+nvram_default wl0_mode ap
+nvram_default wl0_infra 1
+nvram_default wl0_radio 1
+
+[ "$(nvram get il0macaddr)" = "00:90:4c:5f:00:2a" ] && {
+  # if default wifi mac, set two higher than the lan mac
+  nvram set il0macaddr=$(nvram get et0macaddr|
+  awk '{OFS=FS=":";for(x=7,y=2;--x;){$x=sprintf("%02x",(y+="0x"$x)%256);y/=256}print}')
+}
+
diff --git a/openwrt/package/base-files/default/etc/init.d/S10boot b/openwrt/package/base-files/default/etc/init.d/S10boot
new file mode 100755 (executable)
index 0000000..86d514d
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+echo "S" > /proc/jffs2_bbc
+
+mkdir -p /var/run
+mkdir -p /var/log
+touch /var/log/wtmp
+touch /var/log/lastlog
+
+sed 's/^[^#]/insmod &/' /etc/modules /etc/modules.d/* 2>&-|ash
+
+ifconfig lo 127.0.0.1 up
+ifconfig eth0 promisc
+
+HOSTNAME=$(nvram get wan_hostname)
+HOSTNAME=${HOSTNAME%%.*}
+echo ${HOSTNAME:=OpenWrt}>/proc/sys/kernel/hostname
+
+vconfig set_name_type VLAN_PLUS_VID_NO_PAD
+
+# automagically run firstboot
+[ -z "$FAILSAFE" -a -z "$(nvram get no_root_swap)" ] && {
+       { mount|grep "on / type jffs2" 1>&-; } || firstboot
+}
diff --git a/openwrt/package/base-files/default/etc/init.d/S40network b/openwrt/package/base-files/default/etc/init.d/S40network
new file mode 100755 (executable)
index 0000000..d8b4e41
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+case "$1" in
+  start|restart)
+    ifup lan
+    ifup wan
+    ifup wifi
+    wifi up
+
+    for route in $(nvram get static_route); do {
+      eval "set $(echo $route | sed 's/:/ /g')"
+      $DEBUG route add -net $1 netmask $2 gw $3 metric $4 dev $5
+    } done
+    ;;
+esac
diff --git a/openwrt/package/base-files/default/etc/init.d/S45firewall b/openwrt/package/base-files/default/etc/init.d/S45firewall
new file mode 100755 (executable)
index 0000000..cb77979
--- /dev/null
@@ -0,0 +1,93 @@
+#!/bin/sh
+
+## Please make changes in /etc/firewall.user
+${FAILSAFE:+exit}
+
+. /etc/functions.sh
+WAN=$(nvram get wan_ifname)
+LAN=$(nvram get lan_ifname)
+
+## CLEAR TABLES
+for T in filter nat mangle; do
+  iptables -t $T -F
+  iptables -t $T -X
+done
+
+iptables -N input_rule
+iptables -N output_rule
+iptables -N forwarding_rule
+
+iptables -t nat -N prerouting_rule
+iptables -t nat -N postrouting_rule
+
+### INPUT
+###  (connections with the router as destination)
+
+  # base case
+  iptables -P INPUT DROP
+  iptables -A INPUT -m state --state INVALID -j DROP
+  iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
+  iptables -A INPUT -p tcp --tcp-flags SYN SYN --tcp-option \! 2 -j  DROP
+
+  #
+  # insert accept rule or to jump to new accept-check table here
+  #
+  iptables -A INPUT -j input_rule
+
+  # allow
+  iptables -A INPUT -i \! $WAN -j ACCEPT       # allow from lan/wifi interfaces 
+  iptables -A INPUT -p icmp    -j ACCEPT       # allow ICMP
+  iptables -A INPUT -p gre     -j ACCEPT       # allow GRE
+
+  # reject (what to do with anything not allowed earlier)
+  iptables -A INPUT -p tcp -j REJECT --reject-with tcp-reset
+  iptables -A INPUT -j REJECT --reject-with icmp-port-unreachable
+
+### OUTPUT
+### (connections with the router as source)
+
+  # base case
+  iptables -P OUTPUT DROP
+  iptables -A OUTPUT -m state --state INVALID -j DROP
+  iptables -A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
+
+  #
+  # insert accept rule or to jump to new accept-check table here
+  #
+  iptables -A OUTPUT -j output_rule
+
+  # allow
+  iptables -A OUTPUT -j ACCEPT         #allow everything out
+
+  # reject (what to do with anything not allowed earlier)
+  iptables -A OUTPUT -p tcp -j REJECT --reject-with tcp-reset
+  iptables -A OUTPUT -j REJECT --reject-with icmp-port-unreachable
+
+### FORWARDING
+### (connections routed through the router)
+
+  # base case
+  iptables -P FORWARD DROP 
+  iptables -A FORWARD -m state --state INVALID -j DROP
+  iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
+  iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
+
+  #
+  # insert accept rule or to jump to new accept-check table here
+  #
+  iptables -A FORWARD -j forwarding_rule
+
+  # allow
+  iptables -A FORWARD -i br0 -o br0 -j ACCEPT
+  iptables -A FORWARD -i $LAN -o $WAN -j ACCEPT
+
+  # reject (what to do with anything not allowed earlier)
+  # uses the default -P DROP
+
+### MASQ
+  iptables -t nat -A PREROUTING -j prerouting_rule
+  iptables -t nat -A POSTROUTING -j postrouting_rule
+  iptables -t nat -A POSTROUTING -o $WAN -j MASQUERADE
+
+## USER RULES
+[ -f /etc/firewall.user ] && . /etc/firewall.user
diff --git a/openwrt/package/base-files/default/etc/init.d/S50httpd b/openwrt/package/base-files/default/etc/init.d/S50httpd
new file mode 100755 (executable)
index 0000000..9cf551e
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+httpd -p 80 -h /www -r WRT54G Router
diff --git a/openwrt/package/base-files/default/etc/init.d/S50telnet b/openwrt/package/base-files/default/etc/init.d/S50telnet
new file mode 100755 (executable)
index 0000000..599c354
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+telnetd -l /bin/login
diff --git a/openwrt/package/base-files/default/etc/init.d/S99done b/openwrt/package/base-files/default/etc/init.d/S99done
new file mode 100755 (executable)
index 0000000..ce60337
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+# set leds to normal state
+echo "0x00" > /proc/sys/diag
+sysctl -p >&-
diff --git a/openwrt/package/base-files/default/etc/init.d/rcS b/openwrt/package/base-files/default/etc/init.d/rcS
new file mode 100755 (executable)
index 0000000..7065858
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+syslog_ip=$(nvram get log_ipaddr)
+ipcalc -s "$syslog_ip" || syslog_ip=""
+syslogd -C 16 ${syslog_ip:+-L -R $syslog_ip}
+klogd
+#${FAILSAFE:+telnetd -l /bin/login; ifup lan; exit}
+for i in /etc/init.d/S*; do
+  $i start 2>&1
+done | logger -s -p 6 -t '' &
diff --git a/openwrt/package/base-files/default/etc/inittab b/openwrt/package/base-files/default/etc/inittab
new file mode 100644 (file)
index 0000000..aab2df9
--- /dev/null
@@ -0,0 +1,3 @@
+::sysinit:/etc/init.d/rcS
+::shutdown:/sbin/halt
+tts/0::askfirst:/bin/ash --login
diff --git a/openwrt/package/base-files/default/etc/ipkg.conf b/openwrt/package/base-files/default/etc/ipkg.conf
new file mode 100644 (file)
index 0000000..c9df695
--- /dev/null
@@ -0,0 +1,4 @@
+src whiterussian http://downloads.openwrt.org/whiterussian/packages
+src non-free http://downloads.openwrt.org/whiterussian/packages/non-free
+dest root /
+dest ram /tmp
diff --git a/openwrt/package/base-files/default/etc/nvram.overrides b/openwrt/package/base-files/default/etc/nvram.overrides
new file mode 100644 (file)
index 0000000..8c04d54
--- /dev/null
@@ -0,0 +1,37 @@
+# NVRAM overrides
+#
+# This file handles the NVRAM quirks of various hardware.
+# THIS FILE IS NOT A REPLACEMENT FOR NVRAM
+
+# Load sysconf defaults
+[ -f /etc/sysconf ] && . /etc/sysconf
+
+# hacks for wrt54g 1.x hardware
+[  "$(nvram get boardnum)"  = "42" \
+-a "$(nvram get boardtype)" = "bcm94710dev" ] && FAILSAFE_ifnames="vlan1 vlan2 eth2"
+
+# hacks for asus wl-500g deluxe
+[  "$(nvram get boardtype)" = "bcm95365r" \
+-a "$(nvram get boardnum)" = "45" ] && FAILSAFE_ifnames="vlan0 eth1"
+
+# hacks for wap54g hardware
+[  "$(nvram get boardnum)" = "2" \
+-o "$(nvram get boardnum)" = "1024" ] && FAILSAFE_ifnames="eth0 eth1"
+
+# hack for asus wl-500g hardware
+[ "$(nvram get boardnum)" = "asusX" \
+-a "$(nvram get boardtype)" = "bcm94710dev" ] && FAILSAFE_ifnames="eth0 eth1 eth2"
+  
+FAILSAFE_ifnames=${FAILSAFE_ifnames:-"vlan0 eth1 eth2"}
+
+# failsafe if reset is held
+[ "$FAILSAFE" = "true" ] && {
+  echo "### YOU ARE IN FAILSAFE MODE ####"
+  NVRAM_lan_ifname="br0"
+  NVRAM_lan_ifnames=$FAILSAFE_ifnames
+  NVRAM_lan_ipaddr=${BR2_SYSCONF_FAILSAFE_IP:-"192.168.1.1"}
+  NVRAM_lan_netmask=${BR2_SYSCONF_FAILSAFE_NETMASK:-"255.255.255.0"}
+  NVRAM_lan_hwaddr=${BR2_SYSCONF_FAILSAFE_MAC:-"00:0B:AD:0A:DD:00"}
+  NVRAM_wan_ifname="none"
+  NVRAM_wifi_ifname="none"
+}
diff --git a/openwrt/package/base-files/default/etc/passwd b/openwrt/package/base-files/default/etc/passwd
new file mode 100644 (file)
index 0000000..3b660a0
--- /dev/null
@@ -0,0 +1,2 @@
+root:!:0:0:root:/tmp:/bin/ash
+nobody:*:65534:65534:nobody:/var:/bin/false
diff --git a/openwrt/package/base-files/default/etc/preinit b/openwrt/package/base-files/default/etc/preinit
new file mode 100755 (executable)
index 0000000..b23f883
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+export PATH=/bin:/sbin:/usr/bin:/usr/sbin
+mount none /proc -t proc
+insmod diag
+echo 0x01 > /proc/sys/diag
+sleep 1
+if [ $(cat /proc/sys/reset) = 1 -o "$(nvram get failsafe)" = 1 ]; then
+       export FAILSAFE=true
+       [ "$(nvram get boot_wait)" != "on" ] && {
+               nvram set boot_wait=on
+               nvram commit
+       }
+       while :; do { echo $(((X=(X+1)%8)%2)) > /proc/sys/diag; sleep $((X==0)); } done &
+fi
+
+mount_root ${FAILSAFE:+failsafe}
+
+exec /sbin/init
diff --git a/openwrt/package/base-files/default/etc/profile b/openwrt/package/base-files/default/etc/profile
new file mode 100644 (file)
index 0000000..cf7c5bd
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+[ -f /etc/banner ] && cat /etc/banner
+
+export PATH=/bin:/sbin:/usr/bin:/usr/sbin
+export PS1='\u@\h:\w\$ '
+
+alias less=more
+alias vim=vi
+
+arp() { cat /proc/net/arp; }
+ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
+reboot() { ifdown wan; /sbin/reboot; }
diff --git a/openwrt/package/base-files/default/etc/protocols b/openwrt/package/base-files/default/etc/protocols
new file mode 100644 (file)
index 0000000..53fecb6
--- /dev/null
@@ -0,0 +1,56 @@
+# Internet (IP) protocols
+#
+# Updated from http://www.iana.org/assignments/protocol-numbers and other
+# sources.
+# New protocols will be added on request if they have been officially
+# assigned by IANA and are not historical.
+# If you need a huge list of used numbers please install the nmap package.
+
+ip     0       IP              # internet protocol, pseudo protocol number
+#hopopt        0       HOPOPT          # IPv6 Hop-by-Hop Option [RFC1883]
+icmp   1       ICMP            # internet control message protocol
+igmp   2       IGMP            # Internet Group Management
+ggp    3       GGP             # gateway-gateway protocol
+ipencap        4       IP-ENCAP        # IP encapsulated in IP (officially ``IP'')
+st     5       ST              # ST datagram mode
+tcp    6       TCP             # transmission control protocol
+egp    8       EGP             # exterior gateway protocol
+igp    9       IGP             # any private interior gateway (Cisco)
+pup    12      PUP             # PARC universal packet protocol
+udp    17      UDP             # user datagram protocol
+hmp    20      HMP             # host monitoring protocol
+xns-idp        22      XNS-IDP         # Xerox NS IDP
+rdp    27      RDP             # "reliable datagram" protocol
+iso-tp4        29      ISO-TP4         # ISO Transport Protocol class 4 [RFC905]
+xtp    36      XTP             # Xpress Transfer Protocol
+ddp    37      DDP             # Datagram Delivery Protocol
+idpr-cmtp 38   IDPR-CMTP       # IDPR Control Message Transport
+ipv6   41      IPv6            # Internet Protocol, version 6
+ipv6-route 43  IPv6-Route      # Routing Header for IPv6
+ipv6-frag 44   IPv6-Frag       # Fragment Header for IPv6
+idrp   45      IDRP            # Inter-Domain Routing Protocol
+rsvp   46      RSVP            # Reservation Protocol
+gre    47      GRE             # General Routing Encapsulation
+esp    50      IPSEC-ESP       # Encap Security Payload [RFC2046]
+ah     51      IPSEC-AH        # Authentication Header [RFC2402]
+skip   57      SKIP            # SKIP
+ipv6-icmp 58   IPv6-ICMP       # ICMP for IPv6
+ipv6-nonxt 59  IPv6-NoNxt      # No Next Header for IPv6
+ipv6-opts 60   IPv6-Opts       # Destination Options for IPv6
+rspf   73      RSPF CPHB       # Radio Shortest Path First (officially CPHB)
+vmtp   81      VMTP            # Versatile Message Transport
+eigrp  88      EIGRP           # Enhanced Interior Routing Protocol (Cisco)
+ospf   89      OSPFIGP         # Open Shortest Path First IGP
+ax.25  93      AX.25           # AX.25 frames
+ipip   94      IPIP            # IP-within-IP Encapsulation Protocol
+etherip        97      ETHERIP         # Ethernet-within-IP Encapsulation [RFC3378]
+encap  98      ENCAP           # Yet Another IP encapsulation [RFC1241]
+#      99                      # any private encryption scheme
+pim    103     PIM             # Protocol Independent Multicast
+ipcomp 108     IPCOMP          # IP Payload Compression Protocol
+vrrp   112     VRRP            # Virtual Router Redundancy Protocol
+l2tp   115     L2TP            # Layer Two Tunneling Protocol [RFC2661]
+isis   124     ISIS            # IS-IS over IPv4
+sctp   132     SCTP            # Stream Control Transmission Protocol
+fc     133     FC              # Fibre Channel
+
diff --git a/openwrt/package/base-files/default/etc/shells b/openwrt/package/base-files/default/etc/shells
new file mode 100644 (file)
index 0000000..006aa38
--- /dev/null
@@ -0,0 +1 @@
+/bin/ash
diff --git a/openwrt/package/base-files/default/etc/sysctl.conf b/openwrt/package/base-files/default/etc/sysctl.conf
new file mode 100644 (file)
index 0000000..2050b0c
--- /dev/null
@@ -0,0 +1,7 @@
+kernel.panic=3
+net.ipv4.ip_forward=1
+net.ipv4.icmp_echo_ignore_broadcasts=1
+net.ipv4.icmp_ignore_bogus_error_responses=1
+net.ipv4.tcp_fin_timeout=30
+net.ipv4.tcp_keepalive_time=120
+net.ipv4.tcp_timestamps=0
diff --git a/openwrt/package/base-files/default/rom/note b/openwrt/package/base-files/default/rom/note
new file mode 100644 (file)
index 0000000..1746eb0
--- /dev/null
@@ -0,0 +1,3 @@
+SQUASHFS USERS:
+After firstboot has been run, / will be jffs2 and /rom will be squashfs
+(* except when in failsafe)
diff --git a/openwrt/package/base-files/default/sbin/backup b/openwrt/package/base-files/default/sbin/backup
new file mode 100755 (executable)
index 0000000..33bad53
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+for param in $*; do
+       case "$param" in
+               *)
+                       OUTPUT_FILE="$param"
+                       ;;
+       esac
+done
+
+if [ "$OUTPUT_FILE" = "-" ]; then
+       echo "Writing backup to stdout.." >&2
+elif [ "$OUTPUT_FILE" = "" ]; then
+       echo "No output file."
+       exit 1
+else
+       echo "Writing backup to $OUTPUT_FILE" >&2
+       exec > "$OUTPUT_FILE"
+fi
+
+echo __FILELIST__
+find /etc -type f > /tmp/.wlbackup_files
+cat /tmp/.wlbackup_files
+
+echo __IPKG__
+cat /etc/ipkg.conf
+
+echo __PACKAGES__
+grep '^Package:' /usr/lib/ipkg/status | cut -d' ' -f2
+
+echo __FILES__
+tar -T /tmp/.wlbackup_files -cz 2>/dev/null
+rm -f /tmp/.wlbackup_files
diff --git a/openwrt/package/base-files/default/sbin/halt b/openwrt/package/base-files/default/sbin/halt
new file mode 100755 (executable)
index 0000000..39eed26
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+/usr/bin/killall5 -9
+#umount -ar
diff --git a/openwrt/package/base-files/default/sbin/ifdown b/openwrt/package/base-files/default/sbin/ifdown
new file mode 100755 (executable)
index 0000000..617ac3c
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/ash
+[ $# = 0 ] && { echo "  $0 <group>"; exit; }
+. /etc/functions.sh
+type=$1
+debug "### ifdown $type ###"
+if=$(nvram get ${type}_ifname)
+proto=$(nvram get ${type}_proto)
+if_valid $if && $DEBUG ifconfig $if down
+kill $(cat /var/run/${if}.pid 2>&-) 2>&-
+[ "$if" = "ppp0" ] && killall pppd
+killall ifup.$proto >&- 2>&-
diff --git a/openwrt/package/base-files/default/sbin/ifup b/openwrt/package/base-files/default/sbin/ifup
new file mode 100755 (executable)
index 0000000..3e01f31
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/ash
+[ $# = 0 ] && { echo "  $0 <group>"; exit; }
+. /etc/functions.sh
+type=$1
+debug "### ifup $type ###"
+
+if_proto=$(nvram get ${type}_proto)
+if=$(nvram get ${type}_ifname)
+[ "${if%%[0-9]}" = "ppp" ] && if=$(nvram get ${if_proto}_ifname)
+
+if_valid $if || [ "$if_proto" = "pptp" ] || exit 
+mac=$(nvram get ${type}_hwaddr)
+$DEBUG ifconfig $if down 2>&-
+
+if [ "${if%%[0-9]}" = "br" ]; then
+       stp=$(nvram get ${type}_stp)
+       $DEBUG brctl delbr $if 2>&-
+       $DEBUG brctl addbr $if
+       $DEBUG brctl setfd $if 0
+       $DEBUG brctl stp $if ${stp:-0}
+
+       for sif in $(nvram get ${type}_ifnames); do
+               if_valid $sif || continue
+               ${mac:+$DEBUG ifconfig $sif down hw ether $mac}
+               $DEBUG ifconfig $sif 0.0.0.0 up
+               $DEBUG brctl addif $if $sif
+       done
+else
+       ${mac:+$DEBUG ifconfig $if down hw ether $mac}
+fi
+
+do_ifup $if_proto $type
diff --git a/openwrt/package/base-files/default/sbin/mount_root b/openwrt/package/base-files/default/sbin/mount_root
new file mode 100755 (executable)
index 0000000..29c5126
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+if [ "$1" != "failsafe" ]; then 
+       mount | grep jffs2 >&-
+       if [ $? = 0 ] ; then
+               if [ $(cat /proc/mtd | wc -l) = 6 ]; then
+                       echo 5 > /proc/sys/diag
+                       mtd unlock linux
+                       mtd erase OpenWrt
+                       jffs2root --move
+               else
+                       mtd unlock rootfs
+                       mount -o remount,rw /dev/root /
+               fi
+       else
+               if [ -z "$(nvram get no_root_swap)" ]; then
+                       mtd unlock OpenWrt
+                       mount -t jffs2 /dev/mtdblock/4 /jffs
+                       pivot_root /jffs /jffs/rom
+                       mount none /proc -t proc
+                       mount none /dev -t devfs
+                       umount /rom/proc rom/dev >&-
+               fi
+       fi
+fi
+mount none /tmp -t tmpfs -o nosuid,nodev,mode=1777,size=50%
+mkdir -p /dev/pts
+mount none /dev/pts -t devpts
diff --git a/openwrt/package/base-files/default/sbin/restore b/openwrt/package/base-files/default/sbin/restore
new file mode 100755 (executable)
index 0000000..6b5876c
--- /dev/null
@@ -0,0 +1,71 @@
+#!/bin/sh
+for param in $*; do
+       case "$param" in
+               *)
+                       INPUT_FILE="$param"
+       esac
+done
+
+if [ "$INPUT_FILE" = "-" ]; then
+       echo "Reading backup from stdin..." >&2
+elif [ "$INPUT_FILE" = "" ]; then
+       echo "No input file."
+else
+       echo "Reading backup from $INPUT_FILE" >&2
+       exec < "$INPUT_FILE"
+fi
+
+process_line () {
+       case "$SECTION" in
+               ipkg)
+                       echo "$line" >> /etc/ipkg.conf
+                       ;;
+               nvram)
+                       echo nvram set "$line"
+                       ;;
+               package)
+                       if grep "^Package: $line" /usr/lib/ipkg/status 2>&1 > /dev/null; then
+                               echo Package "$line" already installed.
+                       else
+                               ipkg install "$line"
+                       fi
+                       ;;
+               file)
+                       rm -f "$line"
+                       ;;
+       esac
+}
+
+while true; do
+       read line
+       case "$line" in
+               __IPKG__)
+                       SECTION=ipkg
+                       echo "Restoring /etc/ipkg.conf"
+                       rm -f /etc/ipkg.conf
+                       ;;
+               __NVRAM__)
+                       SECTION=nvram
+                       echo "Restoring nvram"
+                       ;;
+               __PACKAGES__)
+                       SECTION=package
+                       echo "Restoring packages"
+                       ipkg update
+                       ;;
+               __FILELIST__)
+                       SECTION=file
+                       echo "Deleting old files"
+                       ;;
+               __FILES__)
+                       echo "Restoring /etc"
+                       tar -C / -xvz
+                       echo "Restore complete."
+                       exit 0
+                       ;;
+               *)
+                       process_line;
+                       ;;
+       esac
+done
+
diff --git a/openwrt/package/base-files/default/usr/share/udhcpc/default.script b/openwrt/package/base-files/default/usr/share/udhcpc/default.script
new file mode 100755 (executable)
index 0000000..0c08985
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/sh
+# udhcpc script edited by Tim Riker <Tim@Rikers.org>
+# (slightly modified for OpenWrt)
+
+[ -z "$1" ] && echo "Error: should be run by udhcpc" && exit 1
+
+RESOLV_CONF="/tmp/resolv.conf"
+
+case "$1" in
+        deconfig)
+                ifconfig $interface 0.0.0.0
+                ;;
+
+        renew|bound)
+                ifconfig $interface $ip \
+                netmask ${subnet:-255.255.255.0} \
+                broadcast ${broadcast:-+}
+
+                if [ -n "$router" ] ; then
+                        echo "deleting routers"
+                        while route del default gw 0.0.0.0 dev $interface ; do
+                                :
+                        done
+
+                        for i in $router ; do
+                                route add default gw $i dev $interface
+                        done
+                fi
+
+                echo -n > $RESOLV_CONF
+                ${domain:+echo search $domain} >> $RESOLV_CONF
+                for i in $dns ; do
+                        echo adding dns $i
+                        echo nameserver $i >> $RESOLV_CONF
+
+               # user rules
+               [ -f /etc/udhcpc.user ] && . /etc/udhcpc.user
+
+                done
+                ;;
+esac
+exit 0
diff --git a/openwrt/package/base-files/files/hotplug b/openwrt/package/base-files/files/hotplug
new file mode 100755 (executable)
index 0000000..74134e8
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/ash
+# $Id$
+[ "${INTERFACE%%[0-9]*}" = "wds" ] && { 
+       ifconfig $INTERFACE 0.0.0.0 up
+       /usr/sbin/brctl addif br0 $INTERFACE
+}
diff --git a/openwrt/package/base-files/ipkg/base-files.conffiles b/openwrt/package/base-files/ipkg/base-files.conffiles
new file mode 100644 (file)
index 0000000..be064d8
--- /dev/null
@@ -0,0 +1,9 @@
+/etc/firewall.user
+/etc/group
+/etc/hosts
+/etc/ipkg.conf
+/etc/modules
+/etc/passwd
+/etc/profile
+/etc/protocols
+/etc/sysctl.conf
diff --git a/openwrt/package/base-files/ipkg/base-files.control b/openwrt/package/base-files/ipkg/base-files.control
new file mode 100644 (file)
index 0000000..acaa6c5
--- /dev/null
@@ -0,0 +1,6 @@
+Package: base-files
+Priority: optional
+Section: net
+Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
+Source: buildroot internal
+Description: OpenWrt filesystem structure and scripts
diff --git a/openwrt/package/base-files/ipkg/hotplug.control b/openwrt/package/base-files/ipkg/hotplug.control
new file mode 100644 (file)
index 0000000..8d6f785
--- /dev/null
@@ -0,0 +1,6 @@
+Package: hotplug
+Priority: optional
+Section: net
+Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
+Source: buildroot internal
+Description: Hotplug script for WDS
diff --git a/openwrt/package/base-files/ipkg/libgcc.control b/openwrt/package/base-files/ipkg/libgcc.control
new file mode 100644 (file)
index 0000000..141d88c
--- /dev/null
@@ -0,0 +1,7 @@
+Package: libgcc
+Priority: optional
+Section: net
+Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
+Source: buildroot internal
+Depends: base-files
+Description: GCC support library
diff --git a/openwrt/package/base-files/ipkg/uclibc.control b/openwrt/package/base-files/ipkg/uclibc.control
new file mode 100644 (file)
index 0000000..360a3b5
--- /dev/null
@@ -0,0 +1,7 @@
+Package: uclibc
+Priority: optional
+Section: net
+Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
+Source: buildroot internal
+Depends: base-files, libgcc
+Description: Standard C library for embedded Linux systems
diff --git a/openwrt/package/busybox/patches/160-tar_fix.patch b/openwrt/package/busybox/patches/160-tar_fix.patch
new file mode 100644 (file)
index 0000000..32358cf
--- /dev/null
@@ -0,0 +1,11 @@
+--- busybox-1.00/archival/tar.c.orig   2005-08-13 12:41:09.000000000 +0200
++++ busybox-1.00/archival/tar.c        2005-08-13 12:39:50.000000000 +0200
+@@ -798,7 +798,7 @@
+       /* TODO: This is the same as in ar, separate function ? */
+       while (optind < argc) {
+               char *filename_ptr = last_char_is(argv[optind], '/');
+-              if (filename_ptr) {
++              if (argv[optind] != filename_ptr && filename_ptr) {
+                       *filename_ptr = '\0';
+               }
+               tar_handle->accept = llist_add_to(tar_handle->accept, argv[optind]);
diff --git a/openwrt/package/busybox/patches/170-udhcp-options.patch b/openwrt/package/busybox/patches/170-udhcp-options.patch
new file mode 100644 (file)
index 0000000..b03810a
--- /dev/null
@@ -0,0 +1,15 @@
+diff -Nur busybox-1.00.orig/networking/udhcp/options.c busybox-1.00/networking/udhcp/options.c
+--- busybox-1.00.orig/networking/udhcp/options.c       2004-03-15 09:29:01.000000000 +0100
++++ busybox-1.00/networking/udhcp/options.c    2005-09-14 13:27:23.792609800 +0200
+@@ -39,8 +39,11 @@
+       {"dhcptype",    OPTION_U8,                              0x35},
+       {"serverid",    OPTION_IP,                              0x36},
+       {"message",     OPTION_STRING,                          0x38},
++      {"vendorclass", OPTION_STRING,                          0x3C},
++      {"clientid",    OPTION_STRING,                          0x3D},
+       {"tftp",        OPTION_STRING,                          0x42},
+       {"bootfile",    OPTION_STRING,                          0x43},
++      {"userclass",   OPTION_STRING,                          0x4D},
+       {"",            0x00,                           0x00}
+ };
index 1d615ec12ff33114a325e951e581c9097b32e587..09ff160fdd43b99fccb343fdc57c74c02daf1941 100644 (file)
@@ -1,3 +1,5 @@
+# $Id$
+
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=bwm
index f92107c7f044e609e96119ecf91df4a1ca0aebfa..3478fa0929710472f2b1d239becb4960015f609b 100644 (file)
@@ -43,6 +43,7 @@ $(PKG_BUILD_DIR)/.configured:
                  --sysconfdir=/etc \
                  $(DISABLE_LARGEFILE) \
                  $(DISABLE_NLS) \
+                 --disable-dietlibc \
        )
        touch $@
 
index 5d7133fd1e920d1b4be1302680818505df86a3ad..73a9061353c15a21ee39193688169d670e60af03 100644 (file)
@@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dnsmasq
 PKG_VERSION:=2.22
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_MD5SUM:=b38f33cd0703fa664a37a4595d918189
 
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
@@ -26,8 +26,11 @@ $(PKG_BUILD_DIR)/.built:
        touch $@
 
 $(IPKG_DNSMASQ):
-       mkdir -p $(IDIR_DNSMASQ)/usr/sbin
+       install -d -m0755 $(IDIR_DNSMASQ)/usr/sbin
        cp $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(IDIR_DNSMASQ)/usr/sbin/
        $(STRIP) $(IDIR_DNSMASQ)/usr/sbin/*
+       install -d -m0755 $(IDIR_DNSMASQ)/etc/init.d/
+       install -m0644 ./files/dnsmasq.conf $(IDIR_DNSMASQ)/etc/dnsmasq.conf
+       install -m0755 ./files/S50dnsmasq $(IDIR_DNSMASQ)/etc/init.d/S50dnsmasq
        $(IPKG_BUILD) $(IDIR_DNSMASQ) $(PACKAGE_DIR)
 
diff --git a/openwrt/package/dnsmasq/files/S50dnsmasq b/openwrt/package/dnsmasq/files/S50dnsmasq
new file mode 100755 (executable)
index 0000000..c970960
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+. /etc/functions.sh
+
+# interface to use for DHCP
+iface=lan
+
+ifname=$(nvram get ${iface}_ifname)
+ipaddr=$(nvram get ${iface}_ipaddr)
+netmask=$(nvram get ${iface}_netmask)
+
+# check for existing DHCP server
+udhcpc -n -q -R -s /bin/true -i $ifname >&- || {
+
+  ipaddr=$(ip2int $ipaddr)
+  netmask=$(ip2int ${netmask:-255.255.255.0})
+  network=$((ipaddr&netmask))
+  
+  start=$(nvram get dhcp_start)
+  start=$((network+${start:-100}))
+  end=$(nvram get dhcp_num)
+  end=$((start+${end:-150}))
+  
+  wanproto=$(nvram get wan_proto)
+  [ -z "$wanproto" -o "$wanproto" = "none" ] || wanif=$(nvram get wan_ifname)
+  
+  args="-l /tmp/dhcp.leases -K -F $(int2ip $start),$(int2ip $end),$(int2ip $netmask),12h ${wanif:+-I ${wanif} }"
+}
+dnsmasq ${args}
diff --git a/openwrt/package/dnsmasq/files/dnsmasq.conf b/openwrt/package/dnsmasq/files/dnsmasq.conf
new file mode 100644 (file)
index 0000000..c770d53
--- /dev/null
@@ -0,0 +1,22 @@
+# filter what we send upstream
+domain-needed
+bogus-priv
+filterwin2k
+localise-queries
+
+# allow /etc/hosts and dhcp lookups via *.lan
+local=/lan/
+domain=lan
+
+# enable dhcp (start,end,netmask,leasetime)
+dhcp-authoritative
+#dhcp-range=192.168.1.100,192.168.1.250,255.255.255.0,12h
+#dhcp-leasefile=/tmp/dhcp.leases
+
+# use /etc/ethers for static hosts; same format as --dhcp-host
+# <hwaddr> [<hostname>] <ipaddr>
+read-ethers
+
+# other useful options:
+# default route(s): dhcp-option=3,192.168.1.1,192.168.1.2
+#    dns server(s): dhcp-option=6,192.168.1.1,192.168.1.2
diff --git a/openwrt/package/dnsmasq/ipkg/dnsmasq.conffiles b/openwrt/package/dnsmasq/ipkg/dnsmasq.conffiles
new file mode 100644 (file)
index 0000000..e30eba8
--- /dev/null
@@ -0,0 +1 @@
+/etc/dnsmasq.conf
index b165d72f22a417a97627140e4c8e48c712c5c186..88fc28849183a542024c52342eeb8e797dfb1d02 100755 (executable)
@@ -13,5 +13,4 @@ for type in rsa dss; do {
   }
 }; done
 
-umask 077
 /usr/sbin/dropbear
index 58caa2379ca832e981f1e3dbd3264ebb1ee443cd..f68eced1eb646f9d4e56f32c03ca6c4c918c8c5d 100644 (file)
@@ -1,5 +1,5 @@
 config BR2_PACKAGE_DSNIFF
-       tristate "dsniff"
+       tristate "dsniff - network auditing and penetration testing"
        select BR2_PACKAGE_LIBPCAP
        select BR2_PACKAGE_LIBNIDS
        select BR2_PACKAGE_LIBNET
index 3355eb88d9bdc0360ae67c028fbbd5a2a5bee6ab..35dea6f0773f0cff9f5860d46179f996cc913625 100644 (file)
@@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dsniff
 PKG_VERSION:=2.3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_MD5SUM:=183e336a45e38013f3af840bddec44b4
 
 PKG_SOURCE_URL:=http://www.monkey.org/~dugsong/dsniff/
diff --git a/openwrt/package/dsniff/patches/arpspoof-fix.patch b/openwrt/package/dsniff/patches/arpspoof-fix.patch
new file mode 100644 (file)
index 0000000..7c20db5
--- /dev/null
@@ -0,0 +1,51 @@
+diff -Nur dsniff-2.3.orig/arp.c dsniff-2.3/arp.c
+--- dsniff-2.3.orig/arp.c      2000-11-14 16:51:03.000000000 +0100
++++ dsniff-2.3/arp.c   2005-09-12 16:13:44.101915800 +0200
+@@ -37,7 +37,7 @@
+ #ifdef BSD
+ int
+-arp_cache_lookup(in_addr_t ip, struct ether_addr *ether)
++arp_cache_lookup(in_addr_t ip, struct ether_addr *ether, const char* linf)
+ {
+       int mib[6];
+       size_t len;
+@@ -89,7 +89,7 @@
+ #endif
+ int
+-arp_cache_lookup(in_addr_t ip, struct ether_addr *ether)
++arp_cache_lookup(in_addr_t ip, struct ether_addr *ether, const char* lif)
+ {
+       int sock;
+       struct arpreq ar;
+@@ -97,7 +97,7 @@
+       
+       memset((char *)&ar, 0, sizeof(ar));
+ #ifdef __linux__
+-      strncpy(ar.arp_dev, "eth0", sizeof(ar.arp_dev));   /* XXX - *sigh* */
++      strncpy(ar.arp_dev, lif, strlen(lif));
+ #endif
+       sin = (struct sockaddr_in *)&ar.arp_pa;
+       sin->sin_family = AF_INET;
+diff -Nur dsniff-2.3.orig/arpspoof.c dsniff-2.3/arpspoof.c
+--- dsniff-2.3.orig/arpspoof.c 2000-11-28 08:43:43.000000000 +0100
++++ dsniff-2.3/arpspoof.c      2005-09-12 16:16:49.244769808 +0200
+@@ -23,7 +23,7 @@
+ #include "version.h"
+ extern char *ether_ntoa(struct ether_addr *);
+-extern int arp_cache_lookup(in_addr_t, struct ether_addr *);
++extern int arp_cache_lookup(in_addr_t, struct ether_addr *, const char* intf);
+ static struct libnet_link_int *llif;
+ static struct ether_addr spoof_mac, target_mac;
+@@ -111,7 +111,7 @@
+       int i = 0;
+       do {
+-              if (arp_cache_lookup(ip, mac) == 0)
++              if (arp_cache_lookup(ip, mac, intf) == 0)
+                       return (1);
+ #ifdef __linux__
+               /* XXX - force the kernel to arp. feh. */
index 0a80d417ddc3b1f27be681c412c0b349f0178a86..e07a0945b687e6417fe96f04dca83bc43d3ed1ca 100644 (file)
@@ -6,7 +6,7 @@ DEFAULT=/etc/default/$BIN
 
 case $1 in
  start)
-  $BIN $OPTIONS
+  $BIN $OPTIONS &
   ;;
  *)
   echo "usage: $0 (start)"
index 60fb4bec50ec1eedc511886bbd80f39f309df332..30b03a8d974e4f7d0638ab86951c7b05a4f78ea1 100644 (file)
@@ -51,7 +51,7 @@ $(PKG_BUILD_DIR)/.configured:
                  $(DISABLE_NLS) \
                  --enable-shared \
                  --enable-static \
-                 --enable-kernel-module \
+                 --disable-kernel-module \
                  --enable-lib \
                  --enable-util \
                  --disable-example \
index 840f57c238ab6658e530d9c133875ec44e20d6e0..975c4452d415f73840c5d697f3b868027709c2bb 100644 (file)
@@ -67,7 +67,7 @@ $(IPKG_LIBGMP):
 $(STAGING_DIR)/usr/lib/libgmp.so: $(PKG_BUILD_DIR)/.built
        mkdir -p $(STAGING_DIR)/usr/include
        cp -fpR $(PKG_INSTALL_DIR)/usr/include/gmp* $(STAGING_DIR)/usr/include/
-       mkdir -p $(I_LIBPCAP_DEV)/usr/lib
+       mkdir -p $(STAGING_DIR)/usr/lib
        cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libgmp.{a,so*} $(STAGING_DIR)/usr/lib/
        touch $@
 
index 69d3d35f577f8890c6a1ceab96a6f7bbed31cc12..97a413f774265dc17adf9069a70dbde347649225 100644 (file)
@@ -9,7 +9,7 @@ PID_F=$RUN_D/$BIN.pid
 case $1 in
  start)
   mkdir -p $RUN_D
-  $BIN -C 0 -l -s $OPTIONS && $BIN -D $OPTIONS
+  $BIN -l -s -t $OPTIONS && $BIN -D $OPTIONS
   ;;
  stop)
   [ -f $PID_F ] && kill $(cat $PID_F)
index 4abe38a3a881a2158a7ec82a32d9833a4a8cde57..9904cd86e6090df5866800bada93016608ff659f 100644 (file)
@@ -1,5 +1,5 @@
 config BR2_PACKAGE_IPKG
-       tristate "ipkg"
+       tristate "ipkg - itsy package management system"
        default y
        help
         Lightweight package management system
index 185c5f81cc66554126731c0cf9a2a1ce6af27900..cdae220cba311c8ddf6d964b151528001d52d56a 100644 (file)
@@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ipkg
 PKG_VERSION:=0.99.149
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_MD5SUM:=975cc419d6db5fb279dc58177c68373b
 
 PKG_SOURCE_URL:=http://www.handhelds.org/packages/ipkg
diff --git a/openwrt/package/ipkg/patches/no-diff.patch b/openwrt/package/ipkg/patches/no-diff.patch
new file mode 100644 (file)
index 0000000..60c5860
--- /dev/null
@@ -0,0 +1,35 @@
+diff -Nur ipkg-0.99.149.orig/ipkg_install.c ipkg-0.99.149/ipkg_install.c
+--- ipkg-0.99.149.orig/ipkg_install.c  2005-03-30 14:08:13.000000000 +0200
++++ ipkg-0.99.149/ipkg_install.c       2005-09-12 17:37:53.287558000 +0200
+@@ -1416,9 +1416,8 @@
+                                      "       What would you like to do about it ?  Your options are:\n"
+                                      "        Y or I  : install the package maintainer's version\n"
+                                      "        N or O  : keep your currently-installed version\n"
+-                                     "          D     : show the differences between the versions (if diff is installed)\n"
+                                      "     The default action is to keep your current version.\n"
+-                                     "    *** %s (Y/I/N/O/D) [default=N] ? ", file_name, short_file_name);
++                                     "    *** %s (Y/I/N/O) [default=N] ? ", file_name, short_file_name);
+         if (strcmp(response, "y") == 0
+             || strcmp(response, "i") == 0
+             || strcmp(response, "yes") == 0) {
+@@ -1426,20 +1425,6 @@
+              return 0;
+         }
+-        if (strcmp(response, "d") == 0) {
+-             char *cmd;
+-
+-             free(response);
+-             /* XXX: BUG rewrite to use exec or busybox's internal diff */
+-             sprintf_alloc(&cmd, "diff -u %s %s", backup, file_name);
+-             xsystem(cmd);
+-             free(cmd);
+-             printf("    [Press ENTER to continue]\n");
+-             response = file_read_line_alloc(stdin);
+-             free(response);
+-             continue;
+-        }
+-
+         free(response);
+         return 1;
+      }
index a0b420f1982f637a1f6aaa986d4f26ff6a87f78b..b965db600bac7e752eeaa777c653fcc28950ddd9 100644 (file)
@@ -17,6 +17,7 @@ ext-$(CONFIG_IP_NF_MATCH_LENGTH) += length
 ext-$(CONFIG_IP_NF_MATCH_TTL) += ttl
 ext-$(CONFIG_IP_NF_MATCH_TCPMSS) += tcpmss
 ext-$(CONFIG_IP_NF_MATCH_HELPER) += helper
+ext-$(CONFIG_IP_NF_MATCH_CONNMARK) += connmark
 #ext-$(CONFIG_IP_NF_MATCH_STATE) += state
 #ext-$(CONFIG_IP_NF_MATCH_CONNTRACK) += conntrack
 ext-$(CONFIG_IP_NF_MATCH_UNCLEAN) += unclean
@@ -33,6 +34,7 @@ ext-$(CONFIG_IP_NF_TARGET_MARK) += MARK
 #ext-$(CONFIG_IP_NF_TARGET_LOG) += LOG
 ext-$(CONFIG_IP_NF_TARGET_ULOG) += ULOG
 #ext-$(CONFIG_IP_NF_TARGET_TCPMSS) += TCPMSS
+ext-$(CONFIG_IP_NF_TARGET_CONNMARK) += CONNMARK
 
 # add extensions that don't depend on kernel config
 ext-m += TTL
index 5650ad669afbe38a80743e456353982ed2bc466b..d3708d78e1e17b87043e94458b5b6072b3d97fa6 100644 (file)
@@ -1,7 +1,7 @@
 menu "kismet - an 802.11 layer2 wireless network detector, sniffer, and intrusion detection system"
 
 config BR2_PACKAGE_KISMET
-       bool
+       tristate
        default n
        depends BR2_PACKAGE_KISMET_CLIENT || BR2_PACKAGE_KISMET_DRONE || BR2_PACKAGE_KISMET_SERVER
 
index 971c40e73fc7f33f8be00b293a57a54065f18e83..dab9e02781b122edea5da96de8a2c5e1eb22821c 100644 (file)
@@ -3,9 +3,9 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=kismet
-PKG_VERSION:=2005-04-R1
+PKG_VERSION:=2005-08-R1
 PKG_RELEASE:=1
-PKG_MD5SUM:=19b4f192eb11a418ed3f6bf65c1226af
+PKG_MD5SUM:=17edb7688e04dd28028d5268a77d0ce7
 
 PKG_SOURCE_URL:=http://www.kismetwireless.net/code
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
@@ -16,6 +16,7 @@ PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
 include $(TOPDIR)/package/rules.mk
 
+$(eval $(call PKG_template,KISMET,kismet,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
 $(eval $(call PKG_template,KISMET_CLIENT,kismet-client,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
 $(eval $(call PKG_template,KISMET_DRONE,kismet-drone,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
 $(eval $(call PKG_template,KISMET_SERVER,kismet-server,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
@@ -44,11 +45,13 @@ $(PKG_BUILD_DIR)/.configured:
                  --localstatedir=/var \
                  --mandir=/usr/share/man \
                  --sbindir=/usr/sbin \
-                 --sysconfdir=/etc \
+                 --sysconfdir=/etc/kismet \
                  $(DISABLE_LARGEFILE) \
                  $(DISABLE_NLS) \
                  --enable-syspcap=yes \
+                 --disable-setuid \
                  --disable-wsp100 \
+                 --disable-gpsmap \
        );
        touch $@
 
@@ -59,35 +62,40 @@ $(PKG_BUILD_DIR)/.built:
                CPPFLAGS="-I$(STAGING_DIR)/include -I$(STAGING_DIR)/usr/include -I$(LINUX_DIR)/include" 
        touch $@
 
+$(IPKG_KISMET):
+       install -d -m0755 $(IDIR_KISMET)/usr/bin/
+       install -m0755 $(PKG_BUILD_DIR)/scripts/kismet $(IDIR_KISMET)/usr/bin/kismet
+       $(IPKG_BUILD) $(IDIR_KISMET) $(PACKAGE_DIR)
+
 $(IPKG_KISMET_CLIENT):
-       install -d -m0755 $(IDIR_KISMET_CLIENT)/etc
-       install -m0644 ./files/ap_manuf $(IDIR_KISMET_CLIENT)/etc/
-       install -m0644 ./files/client_manuf $(IDIR_KISMET_CLIENT)/etc/
-       install -m0644 ./files/kismet.conf $(IDIR_KISMET_CLIENT)/etc/
-       install -m0644 ./files/kismet_ui.conf $(IDIR_KISMET_CLIENT)/etc/
-       install -d -m0755 $(IDIR_KISMET_CLIENT)/usr/sbin
-       cp -fpR $(PKG_BUILD_DIR)/kismet_client $(IDIR_KISMET_CLIENT)/usr/sbin/
+       install -d -m0755 $(IDIR_KISMET_CLIENT)/etc/kismet/
+       install -m0644 ./files/ap_manuf $(IDIR_KISMET_CLIENT)/etc/kismet/
+       install -m0644 ./files/client_manuf $(IDIR_KISMET_CLIENT)/etc/kismet/
+       install -m0644 ./files/kismet.conf $(IDIR_KISMET_CLIENT)/etc/kismet/
+       install -m0644 ./files/kismet_ui.conf $(IDIR_KISMET_CLIENT)/etc/kismet/
+       install -d -m0755 $(IDIR_KISMET_CLIENT)/usr/bin
+       cp -fpR $(PKG_BUILD_DIR)/kismet_client $(IDIR_KISMET_CLIENT)/usr/bin/
        $(RSTRIP) $(IDIR_KISMET_CLIENT)
        $(IPKG_BUILD) $(IDIR_KISMET_CLIENT) $(PACKAGE_DIR)
 
 $(IPKG_KISMET_DRONE):
-       install -d -m0755 $(IDIR_KISMET_DRONE)/etc
-       install -m0644 ./files/kismet_drone.conf $(IDIR_KISMET_DRONE)/etc/
-       install -d -m0755 $(IDIR_KISMET_DRONE)/usr/sbin
-       cp -fpR $(PKG_BUILD_DIR)/kismet_drone $(IDIR_KISMET_DRONE)/usr/sbin/
+       install -d -m0755 $(IDIR_KISMET_DRONE)/etc/kismet/
+       install -m0644 ./files/kismet_drone.conf $(IDIR_KISMET_DRONE)/etc/kismet/
+       install -d -m0755 $(IDIR_KISMET_DRONE)/usr/bin
+       cp -fpR $(PKG_BUILD_DIR)/kismet_drone $(IDIR_KISMET_DRONE)/usr/bin/
        $(RSTRIP) $(IDIR_KISMET_DRONE)
        $(IPKG_BUILD) $(IDIR_KISMET_DRONE) $(PACKAGE_DIR)
 
 $(IPKG_KISMET_SERVER):
-       install -d -m0755 $(IDIR_KISMET_SERVER)/etc
-       install -m0644 ./files/ap_manuf $(IDIR_KISMET_SERVER)/etc/
-       install -m0644 ./files/client_manuf $(IDIR_KISMET_SERVER)/etc/
-       install -m0644 ./files/kismet.conf $(IDIR_KISMET_SERVER)/etc/
-       mkdir -p $(IDIR_KISMET_SERVER)/usr/sbin
-       cp -fpR  $(PKG_BUILD_DIR)/kismet_server $(IDIR_KISMET_SERVER)/usr/sbin/
+       install -d -m0755 $(IDIR_KISMET_SERVER)/etc/kismet/
+       install -m0644 ./files/ap_manuf $(IDIR_KISMET_SERVER)/etc/kismet/
+       install -m0644 ./files/client_manuf $(IDIR_KISMET_SERVER)/etc/kismet/
+       install -m0644 ./files/kismet.conf $(IDIR_KISMET_SERVER)/etc/kismet/
+       mkdir -p $(IDIR_KISMET_SERVER)/usr/bin
+       cp -fpR  $(PKG_BUILD_DIR)/kismet_server $(IDIR_KISMET_SERVER)/usr/bin/
        $(RSTRIP) $(IDIR_KISMET_SERVER)
        $(IPKG_BUILD) $(IDIR_KISMET_SERVER) $(PACKAGE_DIR)
 
 mostlyclean:
-       $(MAKE) -C $(PKG_BUILD_DIR) clean
+#      $(MAKE) -C $(PKG_BUILD_DIR) clean
        rm -f $(PKG_BUILD_DIR)/.built
index 1f750a60c96c6b6da86d9167ef4f43763b6b5acf..a417d2885b4b8029ce4ee7ee9d4d7ab8af473cd7 100644 (file)
@@ -18,7 +18,9 @@ suiduser=nobody
 # The initial channel is optional, if hopping is not enabled it can be used
 # to set the channel the interface listens on.
 # YOU MUST CHANGE THIS TO BE THE SOURCE YOU WANT TO USE
-source=wrt54g,prism0,wireless
+source=wrt54g,eth1,wireless
+# For v1 hardware uncomment this:
+# source=wrt54g,eth2,wireless
 
 # Comma-separated list of sources to enable.  This is only needed if you defined
 # multiple sources and only want to enable some of them.  By default, all defined
index a4854713396b5519e9e94dd06c779674c57e14c0..901b5b83e1afbda292b0ceedbcb369f859b06faa 100644 (file)
@@ -48,7 +48,9 @@ maxclients=5
 # enablesources line to enable them.  For example:
 # source=prism2,wlan0,prism
 # source=cisco,eth0,cisco
-source=wrt54g,prism0,wireless
+source=wrt54g,eth1,wireless
+# For v1 hardware uncomment this:
+# source=wrt54g,eth2,wireless
 
 # Comma-separated list of sources to enable.  This is only needed if you wish 
 # to selectively enable multiple sources.
index 5973f3401c518d0a3deb4bc46d72d94a540142b8..b849ce1ce3aa563a9386867751e6b274eb30aaca 100644 (file)
@@ -1,4 +1,4 @@
-/etc/ap_manuf
-/etc/client_manuf
-/etc/kismet.conf
-/etc/kismet_ui.conf
\ No newline at end of file
+/etc/kismet/ap_manuf
+/etc/kismet/client_manuf
+/etc/kismet/kismet.conf
+/etc/kismet/kismet_ui.conf
\ No newline at end of file
index 2814f81b7bab86435947c90b65a0dde352ec7f26..744e244732056681b199cab0789fbfdbfda2e4ce 100644 (file)
@@ -1 +1 @@
-/etc/kismet_drone.conf
+/etc/kismet/kismet_drone.conf
index e2c46e536f3f000df784f53540b94036f3ece7fa..0fdf437639c9873db38c2edd1ad2f75105f6ba0c 100644 (file)
@@ -1,3 +1,3 @@
-/etc/ap_manuf
-/etc/client_manuf
-/etc/kismet.conf
+/etc/kismet/ap_manuf
+/etc/kismet/client_manuf
+/etc/kismet/kismet.conf
diff --git a/openwrt/package/kismet/ipkg/kismet.control b/openwrt/package/kismet/ipkg/kismet.control
new file mode 100644 (file)
index 0000000..dc0676f
--- /dev/null
@@ -0,0 +1,11 @@
+Package: kismet
+Priority: optional
+Section: net
+Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
+Source: buildroot internal
+Depends: kismet-client, kismet-server 
+Description: kismet
+ Kismet is an 802.11 layer2 wireless network detector,
+ sniffer, and intrusion detection system. Kismet will work with any
+ wireless card which supports raw monitoring (rfmon) mode, and can
+ sniff 802.11b, 802.11a, and 802.11g traffic. 
diff --git a/openwrt/package/kismet/patches/100-remove_sources.patch b/openwrt/package/kismet/patches/100-remove_sources.patch
deleted file mode 100644 (file)
index 8bae67b..0000000
+++ /dev/null
@@ -1,347 +0,0 @@
-diff -urN kismet-2005-04-R1.old/kismet_drone.cc kismet-2005-04-R1.dev/kismet_drone.cc
---- kismet-2005-04-R1.old/kismet_drone.cc      2005-04-03 07:33:42.000000000 +0200
-+++ kismet-2005-04-R1.dev/kismet_drone.cc      2005-04-27 17:10:22.000000000 +0200
-@@ -32,11 +32,8 @@
- #include "packet.h"
- #include "packetsource.h"
--#include "prism2source.h"
- #include "pcapsource.h"
- #include "wtapfilesource.h"
--#include "wsp100source.h"
--#include "vihasource.h"
- #include "dronesource.h"
- #include "packetsourcetracker.h"
- #include "kis_packsources.h"
-diff -urN kismet-2005-04-R1.old/kismet_server.cc kismet-2005-04-R1.dev/kismet_server.cc
---- kismet-2005-04-R1.old/kismet_server.cc     2005-04-03 07:33:42.000000000 +0200
-+++ kismet-2005-04-R1.dev/kismet_server.cc     2005-04-27 17:10:35.000000000 +0200
-@@ -37,11 +37,8 @@
- #include "packet.h"
- #include "packetsource.h"
--#include "prism2source.h"
- #include "pcapsource.h"
- #include "wtapfilesource.h"
--#include "wsp100source.h"
--#include "vihasource.h"
- #include "dronesource.h"
- #include "packetsourcetracker.h"
- #include "kis_packsources.h"
-diff -urN kismet-2005-04-R1.old/kis_packsources.cc kismet-2005-04-R1.dev/kis_packsources.cc
---- kismet-2005-04-R1.old/kis_packsources.cc   2005-04-03 07:33:42.000000000 +0200
-+++ kismet-2005-04-R1.dev/kis_packsources.cc   2005-04-27 17:11:22.000000000 +0200
-@@ -58,15 +58,10 @@
-     REG_EMPTY_CARD(sourcetracker, "pcapfile");
- #endif
-+    REG_EMPTY_CARD(sourcetracker, "cisco");
-+    REG_EMPTY_CARD(sourcetracker, "cisco_wifix");
- #if defined(HAVE_LIBPCAP) && defined(HAVE_LINUX_WIRELESS)
-     // Linux wext-driven cards
--    sourcetracker->RegisterPacketsource("cisco", 1, "IEEE80211b", 6,
--                                       pcapsource_wext_registrant,
--                                       monitor_cisco, unmonitor_cisco, 
--                                       chancontrol_wext, 1);
--    sourcetracker->RegisterPacketsource("cisco_wifix", 1, "IEEE80211b", 6,
--                                       pcapsource_ciscowifix_registrant,
--                                       monitor_cisco_wifix, NULL, NULL, 1);
-     sourcetracker->RegisterPacketsource("hostap", 1, "IEEE80211b", 6,
-                                        pcapsource_wext_registrant,
-                                        monitor_hostap, unmonitor_hostap, 
-@@ -142,8 +137,6 @@
- #else
-     // Register the linuxwireless pcap stuff as null
--    REG_EMPTY_CARD(sourcetracker, "cisco");
--    REG_EMPTY_CARD(sourcetracker, "cisco_wifix");
-     REG_EMPTY_CARD(sourcetracker, "hostap");
-     REG_EMPTY_CARD(sourcetracker, "orinoco");
-     REG_EMPTY_CARD(sourcetracker, "acx100");
-@@ -179,14 +172,7 @@
-     REG_EMPTY_CARD(sourcetracker, "wrt54g");
- #endif
--#if defined(SYS_LINUX) && defined(HAVE_LINUX_NETLINK)
--    sourcetracker->RegisterPacketsource("wlanng_legacy", 1, "IEEE80211b", 6,
--                                        prism2source_registrant,
--                                        monitor_wlanng_legacy, NULL,
--                                        chancontrol_wlanng_legacy, 1);
--#else
-     REG_EMPTY_CARD(sourcetracker, "wlanng_legacy");
--#endif
- #if defined(HAVE_LIBPCAP) && defined(SYS_OPENBSD)
-     sourcetracker->RegisterPacketsource("cisco_openbsd", 1, "IEEE80211b", 6,
-@@ -228,21 +214,8 @@
-     REG_EMPTY_CARD(sourcetracker, "wtapfile");
- #endif
--#if defined(HAVE_WSP100)
--    sourcetracker->RegisterPacketsource("wsp100", 0, "IEEE80211b", 6,
--                                        wsp100source_registrant,
--                                        monitor_wsp100, NULL, chancontrol_wsp100, 0);
--#else
-     REG_EMPTY_CARD(sourcetracker, "wsp100");
--#endif
--
--#if defined(HAVE_VIHAHEADERS)
--    sourcetracker->RegisterPacketsource("viha", 1, "IEEE80211b", 6,
--                                        vihasource_registrant,
--                                        NULL, NULL, chancontrol_viha, 0);
--#else
-     REG_EMPTY_CARD(sourcetracker, "viha");
--#endif
-     return 1;
- }
-diff -urN kismet-2005-04-R1.old/kis_packsources.h kismet-2005-04-R1.dev/kis_packsources.h
---- kismet-2005-04-R1.old/kis_packsources.h    2005-04-03 07:33:42.000000000 +0200
-+++ kismet-2005-04-R1.dev/kis_packsources.h    2005-04-27 17:10:43.000000000 +0200
-@@ -22,11 +22,8 @@
- #include "config.h"
- #include "packetsource.h"
--#include "prism2source.h"
- #include "pcapsource.h"
- #include "wtapfilesource.h"
--#include "wsp100source.h"
--#include "vihasource.h"
- #include "dronesource.h"
- #include "packetsourcetracker.h"
-diff -urN kismet-2005-04-R1.old/Makefile.in kismet-2005-04-R1.dev/Makefile.in
---- kismet-2005-04-R1.old/Makefile.in  2005-04-03 07:33:42.000000000 +0200
-+++ kismet-2005-04-R1.dev/Makefile.in  2005-04-27 17:10:09.000000000 +0200
-@@ -40,8 +40,8 @@
- # Objects
- PSO   = util.o ringbuf.o configfile.o speech.o ifcontrol.o iwcontrol.o packet.o \
--              pcapsource.o prism2source.o wtapfilesource.o wsp100source.o \
--              dronesource.o vihasource.o packetsourcetracker.o kis_packsources.o \
-+              pcapsource.o wtapfilesource.o \
-+              dronesource.o packetsourcetracker.o kis_packsources.o \
-               wtapdump.o wtaplocaldump.o gpsdump.o airsnortdump.o fifodump.o \
-               gpsd.o manuf.o \
-               packetracker.o timetracker.o alertracker.o finitestate.o \
-@@ -50,8 +50,8 @@
- PS    = kismet_server
- DRONEO = util.o ringbuf.o configfile.o getopt.o ifcontrol.o iwcontrol.o packet.o \
--              tcpstreamer.o prism2source.o pcapsource.o wtapfilesource.o wsp100source.o \
--              dronesource.o vihasource.o packetsourcetracker.o kis_packsources.o \
-+              tcpstreamer.o pcapsource.o wtapfilesource.o \
-+              dronesource.o packetsourcetracker.o kis_packsources.o \
-               timetracker.o gpsd.o server_globals.o kismet_drone.o
- DRONE = kismet_drone
-diff -urN kismet-2005-04-R1.old/pcapsource.cc kismet-2005-04-R1.dev/pcapsource.cc
---- kismet-2005-04-R1.old/pcapsource.cc        2005-04-03 07:33:42.000000000 +0200
-+++ kismet-2005-04-R1.dev/pcapsource.cc        2005-04-27 16:58:10.000000000 +0200
-@@ -282,8 +282,6 @@
-     if (datalink_type == DLT_PRISM_HEADER) {
-         ret = Prism2KisPack(packet, data, moddata);
--    } else if (datalink_type == KDLT_BSD802_11) {
--        ret = BSD2KisPack(packet, data, moddata);
- #ifdef HAVE_RADIOTAP
-     } else if (datalink_type == DLT_IEEE802_11_RADIO) {
-         ret = Radiotap2KisPack(packet, data, moddata);
-@@ -418,46 +416,6 @@
- }
--int PcapSource::BSD2KisPack(kis_packet *packet, uint8_t *data, uint8_t *moddata) {
--    int callback_offset = 0;
--
--    // Process our hacked in BSD type
--    if (callback_header.caplen < sizeof(bsd_80211_header)) {
--        snprintf(errstr, 1024, "pcap bsd converter saw undersized capture frame for bsd header.");
--        packet->len = 0;
--        packet->caplen = 0;
--        return 0;
--    }
--
--    packet->caplen = kismin(callback_header.caplen - sizeof(bsd_80211_header), 
--                            (uint32_t) MAX_PACKET_LEN);
--    packet->len = packet->caplen;
--
--    bsd_80211_header *bsdhead = (bsd_80211_header *) callback_data;
--
--    packet->signal = bsdhead->wi_signal;
--    packet->noise = bsdhead->wi_silence;
--
--    // Set our offset
--    callback_offset = sizeof(bsd_80211_header);
--    memcpy(packet->data, callback_data + callback_offset, 24);
--
--    // Adjust for driver appended headers
--    if (packet->data[0] > 0x08) {
--        packet->len -= 22;
--        packet->caplen -= 22;
--        memcpy(packet->data + 24, callback_data + callback_offset + 46, 
--               packet->caplen - 2);
--    } else {
--        packet->len -= 30;
--        packet->caplen -= 30;
--        memcpy(packet->data + 24, callback_data + callback_offset + 46, 
--               packet->caplen - 2);
--    }
--
--    return 1;
--}
--
- #ifdef HAVE_RADIOTAP
- /*
-  * Convert MHz frequency to IEEE channel number.
-@@ -949,17 +907,6 @@
-     return new PcapSourceWextFCS(in_name, in_device);
- }
--KisPacketSource *pcapsource_ciscowifix_registrant(string in_name, string in_device, char *in_err) {
--    vector<string> devbits = StrTokenize(in_device, ":");
--
--    if (devbits.size() < 2) {
--        snprintf(in_err, STATUS_MAX, "Invalid device pair '%s'", in_device.c_str());
--        return NULL;
--    }
--
--    return new PcapSourceWext(in_name, devbits[1]);
--}
--
- KisPacketSource *pcapsource_11g_registrant(string in_name, string in_device,
-                                            char *in_err) {
-     return new PcapSource11G(in_name, in_device);
-@@ -1004,132 +951,6 @@
- // Monitor commands
- #ifdef HAVE_LINUX_WIRELESS
--// Cisco uses its own config file in /proc to control modes
--int monitor_cisco(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
--    FILE *cisco_config;
--    char cisco_path[128];
--
--    linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
--    (*in_if) = ifparm;
--
--    if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
--        return -1;
--    }
--
--    if (Iwconfig_Get_SSID(in_dev, in_err, ifparm->essid) < 0)
--        return -1;
--
--    if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
--        return -1;
--
--    if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
--        return -1;
--
--    if (Ifconfig_Delta_Flags(in_dev, in_err, IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
--        return -1;
--
--    // Try the iwpriv
--    if (Iwconfig_Set_IntPriv(in_dev, "setRFMonitor", 1, 0, in_err) >= 0) {
--        return 0;
--    }
--
--    // Zero the ssid - nonfatal
--    Iwconfig_Set_SSID(in_dev, in_err, NULL);
--   
--    // Build the proc control path
--    snprintf(cisco_path, 128, "/proc/driver/aironet/%s/Config", in_dev);
--
--    if ((cisco_config = fopen(cisco_path, "w")) == NULL) {
--        snprintf(in_err, STATUS_MAX, "Unable to open cisco control file '%s' %d:%s",
--                 cisco_path, errno, strerror(errno));
--        return -1;
--    }
--
--    fprintf(cisco_config, "Mode: r\n");
--    fprintf(cisco_config, "Mode: y\n");
--    fprintf(cisco_config, "XmitPower: 1\n");
--
--    fclose(cisco_config);
--
--    // Channel can't be set on cisco with these drivers.
--
--    return 0;
--}
--
--int unmonitor_cisco(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
--    linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
--    int ret = -1;
--
--    // Try the iwpriv
--    if (Iwconfig_Set_IntPriv(in_dev, "setRFMonitor", 0, 0, in_err) >= 0) {
--        // If we're the new drivers, unmonitor
--        if (Ifconfig_Set_Flags(in_dev, in_err, ifparm->flags) < 0) {
--            return -1;
--        }
--
--        // Reset the SSID since monitor mode nukes it
--        if (Iwconfig_Set_SSID(in_dev, in_err, ifparm->essid) < 0)
--            return -1;
--
--        if (ifparm->channel > 0) {
--            if (Iwconfig_Set_Channel(in_dev, ifparm->channel, in_err) < 0)
--                return -1;
--        }
--
--        ret = 1;
--    }
--
--    free(ifparm);
--
--    return ret;
--}
--
--// Cisco uses its own config file in /proc to control modes
--//
--// I was doing this with ioctls but that seems to cause lockups while
--// this method doesn't.  I don't think I like these drivers.
--int monitor_cisco_wifix(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
--    FILE *cisco_config;
--    char cisco_path[128];
--    vector<string> devbits = StrTokenize(in_dev, ":");
--
--    if (devbits.size() < 2) {
--        snprintf(in_err, STATUS_MAX, "Invalid device pair '%s'", in_dev);
--        return -1;
--    }
--
--    // Bring the device up, zero its ip, and set promisc
--    if (Ifconfig_Delta_Flags(devbits[0].c_str(), in_err, 
--                             IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
--        return -1;
--    if (Ifconfig_Delta_Flags(devbits[1].c_str(), in_err, 
--                             IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
--        return -1;
--
--    // Zero the ssid, nonfatally
--    Iwconfig_Set_SSID(devbits[0].c_str(), in_err, NULL);
--    Iwconfig_Set_SSID(devbits[1].c_str(), in_err, NULL);
--    
--    // Build the proc control path
--    snprintf(cisco_path, 128, "/proc/driver/aironet/%s/Config", devbits[0].c_str());
--
--    if ((cisco_config = fopen(cisco_path, "w")) == NULL) {
--        snprintf(in_err, STATUS_MAX, "Unable to open cisco control file '%s' %d:%s",
--                 cisco_path, errno, strerror(errno));
--        return -1;
--    }
--
--    fprintf(cisco_config, "Mode: r\n");
--    fprintf(cisco_config, "Mode: y\n");
--    fprintf(cisco_config, "XmitPower: 1\n");
--
--    fclose(cisco_config);
--
--    // Channel can't be set on cisco with these drivers.
--
--    return 0;
--}
--
- // Hostap uses iwpriv and iwcontrol settings to control monitor mode
- int monitor_hostap(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
-     int ret;
diff --git a/openwrt/package/kismet/patches/100-wrt54g_source.patch b/openwrt/package/kismet/patches/100-wrt54g_source.patch
new file mode 100644 (file)
index 0000000..3336a8f
--- /dev/null
@@ -0,0 +1,189 @@
+diff -urN kismet.old/kis_packsources.cc kismet.dev/kis_packsources.cc
+--- kismet.old/kis_packsources.cc      2005-08-16 03:22:51.000000000 +0200
++++ kismet.dev/kis_packsources.cc      2005-08-23 00:59:04.465379568 +0200
+@@ -192,7 +192,7 @@
+                                        chancontrol_wlanng_avs, 1);
+     sourcetracker->RegisterPacketsource("wrt54g", 1, "na", 0,
+                                         pcapsource_wrt54g_registrant,
+-                                        monitor_wrt54g, NULL, NULL, 0);
++                                                                              monitor_wrt54g, unmonitor_wrt54g, chancontrol_wext, 0);
+ #else
+     REG_EMPTY_CARD(sourcetracker, "wlanng");
+     REG_EMPTY_CARD(sourcetracker, "wlanng_avs");
+diff -urN kismet.old/packetsourcetracker.cc kismet.dev/packetsourcetracker.cc
+--- kismet.old/packetsourcetracker.cc  2005-08-16 03:22:51.000000000 +0200
++++ kismet.dev/packetsourcetracker.cc  2005-08-23 00:59:39.969982048 +0200
+@@ -986,6 +986,7 @@
+                     (meta_packsources[chanpak.meta_num]->device.c_str(), 
+                      chanpak.channel, errstr, 
+                      (void *) (meta_packsources[chanpak.meta_num]->capsource)) < 0) {
++#if 0
+                                       meta_packsources[chanpak.meta_num]->consec_errors++;
+@@ -1007,6 +1008,7 @@
+                                                                                                                                        CHANFLAG_FATAL));
+                                               continue;
+                                       }
++#endif
+                 } else {
+                                       // Otherwise reset the error count
+                                       meta_packsources[chanpak.meta_num]->consec_errors = 0;
+diff -urN kismet.old/pcapsource.cc kismet.dev/pcapsource.cc
+--- kismet.old/pcapsource.cc   2005-08-16 03:22:51.000000000 +0200
++++ kismet.dev/pcapsource.cc   2005-08-23 01:03:45.652632608 +0200
+@@ -115,6 +115,53 @@
+ u_char callback_data[MAX_PACKET_LEN];
+ // Open a source
++int PcapSourceWrt54g::OpenSource() {
++    channel = 0;
++
++    errstr[0] = '\0';
++
++    char *unconst = strdup("prism0");
++
++    pd = pcap_open_live(unconst, MAX_PACKET_LEN, 1, 1000, errstr);
++
++    #if defined (SYS_OPENBSD) || defined(SYS_NETBSD) && defined(HAVE_RADIOTAP)
++    /* Request desired DLT on multi-DLT systems that default to EN10MB. We do this
++       later anyway but doing it here ensures we have the desired DLT from the get go. */
++     pcap_set_datalink(pd, DLT_IEEE802_11_RADIO);
++    #endif
++
++    free(unconst);
++
++    if (strlen(errstr) > 0)
++        return -1; // Error is already in errstr
++
++    paused = 0;
++
++    errstr[0] = '\0';
++
++    num_packets = 0;
++
++    if (DatalinkType() < 0)
++        return -1;
++
++#ifdef HAVE_PCAP_NONBLOCK
++    pcap_setnonblock(pd, 1, errstr);
++#elif !defined(SYS_OPENBSD)
++    // do something clever  (Thanks to Guy Harris for suggesting this).
++    int save_mode = fcntl(pcap_get_selectable_fd(pd), F_GETFL, 0);
++    if (fcntl(pcap_get_selectable_fd(pd), F_SETFL, save_mode | O_NONBLOCK) < 0) {
++        snprintf(errstr, 1024, "fcntl failed, errno %d (%s)",
++                 errno, strerror(errno));
++    }
++#endif
++
++    if (strlen(errstr) > 0)
++        return -1; // Ditto
++    
++    return 1;
++}
++
++// Open a source
+ int PcapSource::OpenSource() {
+     channel = 0;
+@@ -1928,63 +1975,32 @@
+ int monitor_wrt54g(const char *in_dev, int initch, char *in_err, void **in_if, 
+                                  void *in_ext) {
+     char cmdline[2048];
+-      int mode;
+-      int wlmode = 0;
+-
+-#ifdef HAVE_LINUX_WIRELESS
+-    vector<string> devbits = StrTokenize(in_dev, ":");
+-    if (devbits.size() < 2) {
+-              snprintf(cmdline, 2048, "/usr/sbin/wl monitor 1");
++              snprintf(cmdline, 2048, "/usr/sbin/iwpriv %s set_monitor 1", in_dev);
+               if (RunSysCmd(cmdline) < 0) {
+-                      snprintf(in_err, 1024, "Unable to set mode using 'wl monitor 1'.  Some "
+-                                       "custom firmware images require you to specify the origial "
++                      snprintf(in_err, 1024, "Unable to set mode using 'iwpriv %s set_monitor 1'. "
++                                       "Some custom firmware images require you to specify the origial "
+                                        "device and a new dynamic device and use the iwconfig controls. "
+                                        "see the README for how to configure your capture source.");
+                       return -1;
+               }
+-    } else {
+-              // Get the mode ... If this doesn't work, try the old wl method.
+-              if (Iwconfig_Get_Mode(devbits[0].c_str(), in_err, &mode) < 0) {
+-                      fprintf(stderr, "WARNING:  Getting wireless mode via ioctls failed, "
+-                                      "defaulting to trying the 'wl' command.\n");
+-                      wlmode = 1;
+-              }
+-              if (wlmode == 1) {
+-                      snprintf(cmdline, 2048, "/usr/sbin/wl monitor 1");
+-                      if (RunSysCmd(cmdline) < 0) {
+-                              snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
+-                              return -1;
+-                      }
+-              } else if (mode != LINUX_WLEXT_MONITOR) {
+-                      // Set it
+-                      if (Iwconfig_Set_Mode(devbits[0].c_str(), in_err, 
+-                                                                LINUX_WLEXT_MONITOR) < 0) {
+-                              snprintf(in_err, STATUS_MAX, "Unable to set iwconfig monitor "
+-                                               "mode.  If you are using an older wrt54g, try specifying "
+-                                               "only the ethernet device, not ethX:prismX");
+-                              return -1;
+-                      }
++      return 1;
++}
++
++
++int unmonitor_wrt54g(const char *in_dev, int initch, char *in_err, void **in_if, 
++                                 void *in_ext) {
++    char cmdline[2048];
++
++              snprintf(cmdline, 2048, "/usr/sbin/iwpriv %s set_monitor 0", in_dev);
++              if (RunSysCmd(cmdline) < 0) {
++                      snprintf(in_err, 1024, "Unable to set mode using 'iwpriv %s set_monitor 0'. "
++                                       "Some custom firmware images require you to specify the origial "
++                                       "device and a new dynamic device and use the iwconfig controls. "
++                                       "see the README for how to configure your capture source.");
++                      return -1;
+               }
+-      }
+-#else
+-      snprintf(cmdline, 2048, "/usr/sbin/wl monitor 1");
+-      if (RunSysCmd(cmdline) < 0) {
+-              snprintf(in_err, 1024, "Unable to set mode using 'wl monitor 1'.  Some "
+-                               "custom firmware images require you to specify the origial "
+-                               "device and a new dynamic device and use the iwconfig controls. "
+-                               "see the README for how to configure your capture source. "
+-                               "Support for wireless extensions was not compiled in, so more "
+-                               "advanced modes of setting monitor mode are not available.");
+-              return -1;
+-      }
+-      fprintf(stderr, "WARNING:  Support for wireless extensions was not compiled "
+-                      "into this binary.  Using the iw* tools to set monitor mode will not "
+-                      "be available.  This may cause opening the source to fail on some "
+-                      "firmware versions.  To fix this, make sure wireless extensions are "
+-                      "available and found by the configure script when building Kismet.");
+-#endif
+       return 1;
+ }
+diff -urN kismet.old/pcapsource.h kismet.dev/pcapsource.h
+--- kismet.old/pcapsource.h    2005-08-16 03:22:51.000000000 +0200
++++ kismet.dev/pcapsource.h    2005-08-23 01:04:26.057490136 +0200
+@@ -265,6 +265,7 @@
+     PcapSourceWrt54g(string in_name, string in_dev) : PcapSource(in_name, in_dev) { 
+         fcsbytes = 4;
+     }
++      int OpenSource();
+     int FetchPacket(kis_packet *packet, uint8_t *data, uint8_t *moddata);
+ protected:
+     carrier_type IEEE80211Carrier();
+@@ -412,6 +413,7 @@
+ int monitor_wlanng_avs(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext);
+ // linksys wrt54g monitoring
+ int monitor_wrt54g(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext);
++int unmonitor_wrt54g(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext);
+ #endif
+ // This should be expanded to handle BSD...
index 66fc77e077664b4d463317f031d5db65a73df6dd..4cf5a7b5b53a1d7cabfb18365e8d676835c83659 100644 (file)
@@ -27,15 +27,3 @@ diff -urN kismet-2005-04-R1.old/macaddr.h kismet-2005-04-R1.dev/macaddr.h
              return (singleton_itr != op.singleton_itr) || (vector_itr != op.vector_itr);
          }
  
-diff -urN kismet-2005-04-R1.old/tcpserver.cc kismet-2005-04-R1.dev/tcpserver.cc
---- kismet-2005-04-R1.old/tcpserver.cc 2005-04-03 07:33:42.000000000 +0200
-+++ kismet-2005-04-R1.dev/tcpserver.cc 2005-06-08 23:17:34.000000000 +0200
-@@ -373,7 +373,7 @@
-                 return 0;
-             }
-         } else {
--            copt->wrbuf.erase(0, res);
-+            copt->wrbuf = "";
-       }
-     }
diff --git a/openwrt/package/kismet/patches/120-cleanup.patch b/openwrt/package/kismet/patches/120-cleanup.patch
new file mode 100644 (file)
index 0000000..1743080
--- /dev/null
@@ -0,0 +1,3113 @@
+diff -urN kismet.dev/Makefile.in kismet.dev2/Makefile.in
+--- kismet.dev/Makefile.in     2005-08-16 03:22:51.000000000 +0200
++++ kismet.dev2/Makefile.in    2005-08-23 01:59:25.643220248 +0200
+@@ -39,26 +39,25 @@
+ DEPEND        = .depend
+ # Objects
+-PSO   = util.o ringbuf.o configfile.o speech.o ifcontrol.o iwcontrol.o packet.o \
+-              pcapsource.o prism2source.o wtapfilesource.o wsp100source.o \
+-              dronesource.o vihasource.o packetsourcetracker.o kis_packsources.o \
+-              wtapdump.o wtaplocaldump.o gpsdump.o airsnortdump.o fifodump.o \
+-              gpsd.o manuf.o \
++PSO   = util.o ringbuf.o configfile.o ifcontrol.o iwcontrol.o packet.o \
++              pcapsource.o manuf.o \
++              dronesource.o packetsourcetracker.o kis_packsources.o \
++              wtapdump.o wtaplocaldump.o airsnortdump.o fifodump.o \
+               packetracker.o timetracker.o alertracker.o finitestate.o \
+               getopt.o \
+               tcpserver.o server_protocols.o server_globals.o kismet_server.o 
+ PS    = kismet_server
+ DRONEO = util.o ringbuf.o configfile.o getopt.o ifcontrol.o iwcontrol.o packet.o \
+-              tcpstreamer.o prism2source.o pcapsource.o wtapfilesource.o wsp100source.o \
+-              dronesource.o vihasource.o packetsourcetracker.o kis_packsources.o \
+-              timetracker.o gpsd.o server_globals.o kismet_drone.o
++              tcpstreamer.o pcapsource.o \
++              dronesource.o packetsourcetracker.o kis_packsources.o \
++              timetracker.o server_globals.o kismet_drone.o
+ DRONE = kismet_drone
+-NCO   = util.o configfile.o speech.o manuf.o tcpclient.o \
++NCO   = util.o configfile.o manuf.o tcpclient.o \
+               frontend.o cursesfront.o \
+               panelfront.o panelfront_display.o panelfront_input.o \
+-              gpsd.o getopt.o kismet_client.o 
++              getopt.o kismet_client.o 
+ NC    = kismet_client
+ GPSLO = getopt.o util.o configfile.o expat.o manuf.o \
+diff -urN kismet.dev/cursesfront.cc kismet.dev2/cursesfront.cc
+--- kismet.dev/cursesfront.cc  2005-08-16 03:22:51.000000000 +0200
++++ kismet.dev2/cursesfront.cc 2005-08-23 01:59:25.643220248 +0200
+@@ -30,7 +30,6 @@
+ // Enable the protocols we can use
+ void NCurseFront::AddClient(TcpClient *in_client) {
+     client = in_client;
+-    client->EnableProtocol("GPS");
+     client->EnableProtocol("INFO");
+     client->EnableProtocol("REMOVE");
+     client->EnableProtocol("NETWORK");
+@@ -88,32 +87,8 @@
+         mvwaddstr(netborder, 1, 2, "  SSID                        T W Ch  Data   LLC  Crypt  Wk Flags");
+     }
+-    char gpsdata[1024];
+-    float lat, lon, alt, spd, heading;
+     int mode;
+-    client->FetchLoc(&lat, &lon, &alt, &spd, &heading, &mode);
+-
+-    if (!(lat == 0 && lon == 0 && alt == 0 && spd == 0 && mode == 0)) {
+-
+-        char fix[16];
+-
+-        if (mode == -1)
+-            snprintf(fix, 16, "No signal");
+-        else if (mode == 2)
+-            snprintf(fix, 5, "2D");
+-        else if (mode == 3)
+-            snprintf(fix, 5, "3D");
+-        else
+-            snprintf(fix, 5, "NONE");
+-
+-        snprintf(gpsdata, 1024, "Lat %.3f Lon %.3f Alt %.3f Spd %.3f Fix %s",
+-                 lat, lon, alt, spd, fix);
+-
+-        mvwaddstr(netborder, LINES-statheight-1, 2, gpsdata);
+-
+-    }
+-
+     box(infoborder, '|', '-');
+     mvwaddstr(infoborder, 0, 2, "Info");
+diff -urN kismet.dev/dronesource.cc kismet.dev2/dronesource.cc
+--- kismet.dev/dronesource.cc  2005-08-16 03:22:51.000000000 +0200
++++ kismet.dev2/dronesource.cc 2005-08-23 01:59:25.644220096 +0200
+@@ -201,9 +201,6 @@
+             return -1;
+         }
+-              // Grab the GPS info
+-              gps_enabled = vpkt.gps_enabled;
+-
+         stream_recv_bytes = 0;
+         // printf("debug - version packet valid\n\n");
+@@ -336,25 +333,6 @@
+     packet->encoding = (encoding_type) phdr.encoding;
+     packet->datarate = (uint32_t) ntohl(phdr.datarate);
+-      if (gps_enabled) {
+-              // If the drone is sending us GPS data, use it
+-              packet->gps_lat = Pair2Float((int16_t) ntohs(phdr.gps_lat),
+-                                                                       (int64_t) kis_ntoh64(phdr.gps_lat_mant));
+-              packet->gps_lon = Pair2Float((int16_t) ntohs(phdr.gps_lon),
+-                                                                       (int64_t) kis_ntoh64(phdr.gps_lon_mant));
+-              packet->gps_alt = Pair2Float((int16_t) ntohs(phdr.gps_alt),
+-                                                                       (int64_t) kis_ntoh64(phdr.gps_alt_mant));
+-              packet->gps_spd = Pair2Float((int16_t) ntohs(phdr.gps_spd),
+-                                                                       (int64_t) kis_ntoh64(phdr.gps_spd_mant));
+-              packet->gps_heading = Pair2Float((int16_t) ntohs(phdr.gps_heading),
+-                                                                               (int64_t) kis_ntoh64(phdr.gps_heading_mant));
+-              packet->gps_fix = phdr.gps_fix;
+-      } else if (gpsd != NULL) {
+-              // Otherwise, no
+-              gpsd->FetchLoc(&packet->gps_lat, &packet->gps_lon, &packet->gps_alt,
+-                                         &packet->gps_spd, &packet->gps_heading, &packet->gps_fix);
+-      }
+-
+     packet->data = data;
+     packet->moddata = moddata;
+     packet->modified = 0;
+diff -urN kismet.dev/dronesource.h kismet.dev2/dronesource.h
+--- kismet.dev/dronesource.h   2005-08-16 03:22:51.000000000 +0200
++++ kismet.dev2/dronesource.h  2005-08-23 01:59:25.644220096 +0200
+@@ -79,9 +79,6 @@
+     uint8_t databuf[MAX_PACKET_LEN];
+     unsigned int resyncing;
+-
+-      // Is the drone pushing GPS data to us?
+-      int gps_enabled;
+ };
+ // Nothing but a registrant for us
+diff -urN kismet.dev/frontend.cc kismet.dev2/frontend.cc
+--- kismet.dev/frontend.cc     2005-08-16 03:22:51.000000000 +0200
++++ kismet.dev2/frontend.cc    2005-08-23 01:59:25.645219944 +0200
+@@ -248,33 +248,6 @@
+             }
+-            // Aggregate the GPS data
+-            if (wnet->aggregate_points > 0) {
+-                dnet->virtnet->aggregate_lat += wnet->aggregate_lat;
+-                dnet->virtnet->aggregate_lon += wnet->aggregate_lon;
+-                dnet->virtnet->aggregate_alt += wnet->aggregate_alt;
+-                dnet->virtnet->aggregate_points += wnet->aggregate_points;
+-            }
+-
+-            if (wnet->gps_fixed > dnet->virtnet->gps_fixed)
+-                dnet->virtnet->gps_fixed = wnet->gps_fixed;
+-            if (wnet->min_lat < dnet->virtnet->min_lat || dnet->virtnet->min_lat == 0)
+-                dnet->virtnet->min_lat = wnet->min_lat;
+-            if (wnet->min_lon < dnet->virtnet->min_lon || dnet->virtnet->min_lon == 0)
+-                dnet->virtnet->min_lon = wnet->min_lon;
+-            if (wnet->min_alt < dnet->virtnet->min_alt || dnet->virtnet->min_alt == 0)
+-                dnet->virtnet->min_alt = wnet->min_alt;
+-            if (wnet->min_spd < dnet->virtnet->min_spd || dnet->virtnet->min_spd == 0)
+-                dnet->virtnet->min_spd = wnet->min_spd;
+-            if (wnet->max_lat > dnet->virtnet->max_lat || dnet->virtnet->max_lat == 0)
+-                dnet->virtnet->max_lat = wnet->max_lat;
+-            if (wnet->max_lon > dnet->virtnet->max_lon || dnet->virtnet->max_lon == 0)
+-                dnet->virtnet->max_lon = wnet->max_lon;
+-            if (wnet->max_alt > dnet->virtnet->max_alt || dnet->virtnet->max_alt == 0)
+-                dnet->virtnet->max_alt = wnet->max_alt;
+-            if (wnet->max_spd > dnet->virtnet->max_spd || dnet->virtnet->max_spd == 0)
+-                dnet->virtnet->max_spd = wnet->max_spd;
+-
+             // Aggregate the carriers and encodings
+             dnet->virtnet->carrier_set |= wnet->carrier_set;
+             dnet->virtnet->encoding_set |= wnet->encoding_set;
+diff -urN kismet.dev/kis_packsources.cc kismet.dev2/kis_packsources.cc
+--- kismet.dev/kis_packsources.cc      2005-08-23 00:59:04.465379568 +0200
++++ kismet.dev2/kis_packsources.cc     2005-08-23 02:01:08.585570632 +0200
+@@ -60,13 +60,8 @@
+ #if defined(HAVE_LIBPCAP) && defined(HAVE_LINUX_WIRELESS)
+     // Linux wext-driven cards
+-    sourcetracker->RegisterPacketsource("cisco", 1, "IEEE80211b", 6,
+-                                       pcapsource_wext_registrant,
+-                                       monitor_cisco, unmonitor_cisco, 
+-                                       chancontrol_wext, 1);
+-    sourcetracker->RegisterPacketsource("cisco_wifix", 1, "IEEE80211b", 6,
+-                                       pcapsource_ciscowifix_registrant,
+-                                       monitor_cisco_wifix, NULL, NULL, 1);
++      REG_EMPTY_CARD(sourcetracker, "cisco");
++      REG_EMPTY_CARD(sourcetracker, "cisco_wifix");
+     sourcetracker->RegisterPacketsource("hostap", 1, "IEEE80211b", 6,
+                                        pcapsource_wext_registrant,
+                                        monitor_hostap, unmonitor_hostap, 
+@@ -79,21 +74,9 @@
+                                         pcapsource_wext_registrant,
+                                         monitor_orinoco, unmonitor_orinoco,
+                                         chancontrol_orinoco, 1);
+-    sourcetracker->RegisterPacketsource("acx100", 1, "IEEE80211b", 6,
+-                                       pcapsource_wextfcs_registrant,
+-                                       monitor_acx100, unmonitor_acx100, 
+-                                       chancontrol_wext, 1);
+-    sourcetracker->RegisterPacketsource("admtek", 1, "IEEE80211b", 6,
+-                                        pcapsource_wext_registrant,
+-                                        monitor_admtek, unmonitor_admtek,
+-                                        chancontrol_wext, 1);
+-    sourcetracker->RegisterPacketsource("vtar5k", 1, "IEEE80211a", 36,
+-                                       pcapsource_wext_registrant,
+-                                       monitor_vtar5k, NULL, chancontrol_wext, 1);
+-    sourcetracker->RegisterPacketsource("atmel_usb", 1, "IEEE80211b", 6,
+-                                       pcapsource_wext_registrant,
+-                                       monitor_wext, unmonitor_wext, 
+-                                       chancontrol_wext, 1);
++      REG_EMPTY_CARD(sourcetracker, "acx100");
++      REG_EMPTY_CARD(sourcetracker, "admtek");
++      REG_EMPTY_CARD(sourcetracker, "vtar5k");
+     sourcetracker->RegisterPacketsource("madwifi_a", 1, "IEEE80211a", 36,
+                                         pcapsource_wextfcs_registrant,
+@@ -121,38 +104,14 @@
+                                         monitor_prism54g, unmonitor_prism54g,
+                                         chancontrol_prism54g, 1);
+-    sourcetracker->RegisterPacketsource("wlanng_wext", 1, "IEEE80211b", 6,
+-                                        pcapsource_wlanng_registrant,
+-                                        monitor_wlanng_avs, NULL,
+-                                        chancontrol_wext, 1);
+-
+-    sourcetracker->RegisterPacketsource("ipw2100", 1, "IEEE80211b", 6,
+-                                        pcapsource_wext_registrant,
+-                                        monitor_ipw2100, unmonitor_ipw2100,
+-                                        chancontrol_ipw2100, 1);
+-
+-    sourcetracker->RegisterPacketsource("ipw2200", 1, "IEEE80211g", 6,
+-                                        pcapsource_wext_registrant,
+-                                        monitor_ipw2200, unmonitor_ipw2200,
+-                                        chancontrol_ipw2200, 1);
+-
+-    sourcetracker->RegisterPacketsource("ipw2915", 1, "IEEE80211ab", 6,
+-                                        pcapsource_wext_registrant,
+-                                        monitor_ipw2200, unmonitor_ipw2200,
+-                                        chancontrol_ipw2200, 1);
++      REG_EMPTY_CARD(sourcetracker, "wlanng_wext");
++      REG_EMPTY_CARD(sourcetracker, "ipw2100");
++      REG_EMPTY_CARD(sourcetracker, "ipw2200");
++      REG_EMPTY_CARD(sourcetracker, "ipw2915");
++    REG_EMPTY_CARD(sourcetracker, "rt2400");
++    REG_EMPTY_CARD(sourcetracker, "rt2500");
++    REG_EMPTY_CARD(sourcetracker, "rt8180");
+-    sourcetracker->RegisterPacketsource("rt2400", 1, "IEEE80211b", 6,
+-                                        pcapsource_wext_registrant,
+-                                        monitor_wext, unmonitor_wext,
+-                                        chancontrol_wext, 1);
+-    sourcetracker->RegisterPacketsource("rt2500", 1, "IEEE80211g", 6,
+-                                        pcapsource_11g_registrant,
+-                                        monitor_wext, unmonitor_wext,
+-                                        chancontrol_wext, 1);
+-    sourcetracker->RegisterPacketsource("rt8180", 1, "IEEE80211b", 6,
+-                                        pcapsource_wext_registrant,
+-                                        monitor_wext, unmonitor_wext,
+-                                        chancontrol_wext, 1);
+ #else
+     // Register the linuxwireless pcap stuff as null
+@@ -182,31 +141,13 @@
+     REG_EMPTY_CARD(sourcetracker, "wlanng_wext");
+ #endif
+-#if defined(HAVE_LIBPCAP) && defined(SYS_LINUX)
+-    sourcetracker->RegisterPacketsource("wlanng", 1, "IEEE80211b", 6,
+-                                       pcapsource_wlanng_registrant,
+-                                       monitor_wlanng, NULL, chancontrol_wlanng, 1);
+-    sourcetracker->RegisterPacketsource("wlanng_avs", 1, "IEEE80211b", 6,
+-                                       pcapsource_wlanng_registrant,
+-                                       monitor_wlanng_avs, NULL,
+-                                       chancontrol_wlanng_avs, 1);
+     sourcetracker->RegisterPacketsource("wrt54g", 1, "na", 0,
+                                         pcapsource_wrt54g_registrant,
+-                                                                              monitor_wrt54g, unmonitor_wrt54g, chancontrol_wext, 0);
+-#else
++                                        monitor_wrt54g, unmonitor_wrt54g, chancontrol_wext, 0);
++
+     REG_EMPTY_CARD(sourcetracker, "wlanng");
+     REG_EMPTY_CARD(sourcetracker, "wlanng_avs");
+-    REG_EMPTY_CARD(sourcetracker, "wrt54g");
+-#endif
+-
+-#if defined(SYS_LINUX) && defined(HAVE_LINUX_NETLINK)
+-    sourcetracker->RegisterPacketsource("wlanng_legacy", 1, "IEEE80211b", 6,
+-                                        prism2source_registrant,
+-                                        monitor_wlanng_legacy, NULL,
+-                                        chancontrol_wlanng_legacy, 1);
+-#else
+     REG_EMPTY_CARD(sourcetracker, "wlanng_legacy");
+-#endif
+ #if defined(HAVE_LIBPCAP) && defined(SYS_OPENBSD)
+     sourcetracker->RegisterPacketsource("cisco_openbsd", 1, "IEEE80211b", 6,
+@@ -240,29 +181,11 @@
+     REG_EMPTY_CARD(sourcetracker, "radiotap_bsd_b");
+ #endif
+-#if defined(HAVE_LIBWIRETAP)
+-    sourcetracker->RegisterPacketsource("wtapfile", 0, "na", 0,
+-                                       wtapfilesource_registrant,
+-                                       NULL, NULL, NULL, 0);
+-#else
+     REG_EMPTY_CARD(sourcetracker, "wtapfile");
+-#endif
+-#if defined(HAVE_WSP100)
+-    sourcetracker->RegisterPacketsource("wsp100", 0, "IEEE80211b", 6,
+-                                        wsp100source_registrant,
+-                                        monitor_wsp100, NULL, chancontrol_wsp100, 0);
+-#else
+     REG_EMPTY_CARD(sourcetracker, "wsp100");
+-#endif
+-#if defined(HAVE_VIHAHEADERS)
+-    sourcetracker->RegisterPacketsource("viha", 1, "IEEE80211b", 6,
+-                                        vihasource_registrant,
+-                                        NULL, NULL, chancontrol_viha, 0);
+-#else
+     REG_EMPTY_CARD(sourcetracker, "viha");
+-#endif
+     return 1;
+ }
+diff -urN kismet.dev/kis_packsources.h kismet.dev2/kis_packsources.h
+--- kismet.dev/kis_packsources.h       2005-08-16 03:22:51.000000000 +0200
++++ kismet.dev2/kis_packsources.h      2005-08-23 01:59:25.646219792 +0200
+@@ -22,11 +22,7 @@
+ #include "config.h"
+ #include "packetsource.h"
+-#include "prism2source.h"
+ #include "pcapsource.h"
+-#include "wtapfilesource.h"
+-#include "wsp100source.h"
+-#include "vihasource.h"
+ #include "dronesource.h"
+ #include "packetsourcetracker.h"
+diff -urN kismet.dev/kismet_client.cc kismet.dev2/kismet_client.cc
+--- kismet.dev/kismet_client.cc        2005-08-16 03:22:51.000000000 +0200
++++ kismet.dev2/kismet_client.cc       2005-08-23 01:59:25.648219488 +0200
+@@ -28,7 +28,6 @@
+ #include "cursesfront.h"
+ #include "panelfront.h"
+ #include "configfile.h"
+-#include "speech.h"
+ #ifndef exec_name
+ char *exec_name;
+@@ -47,11 +46,7 @@
+ char *configfile;
+ char *uiconfigfile;
+ char *server = NULL;
+-int sound = -1;
+-int speech = -1;
+ int flite = 0;
+-int speech_encoding = 0;
+-string speech_sentence_encrypted, speech_sentence_unencrypted;
+ unsigned int metric = 0;
+ unsigned int reconnect = 0;
+@@ -59,20 +54,9 @@
+ string configdir, groupfile;
+ FILE *group_file = NULL;
+-// Pipe file descriptor pairs and fd's
+-int soundpair[2];
+-int speechpair[2];
+-pid_t soundpid = -1, speechpid = -1;
+-
+ // Catch our interrupt
+ void CatchShutdown(int sig) {
+-    // Kill our sound players
+-    if (soundpid > 0)
+-        kill(soundpid, 9);
+-    if (speechpid > 0)
+-        kill(speechpid, 9);
+-
+     if (group_track) {
+         if ((group_file = fopen(groupfile.c_str(), "w")) == NULL) {
+             fprintf(stderr, "WARNING: Unable to open '%s' for writing, groups will not be saved.\n",
+@@ -116,215 +100,6 @@
+     exit(0);
+ }
+-// Subprocess sound handler
+-void SoundHandler(int *fds, const char *player, map<string, string> soundmap) {
+-    int read_sock = fds[0];
+-
+-    close(fds[1]);
+-
+-    signal(SIGPIPE, PipeHandler);
+-
+-    fd_set rset;
+-
+-    char data[1024];
+-
+-    pid_t sndpid = -1;
+-    int harvested = 1;
+-
+-    while (1) {
+-        FD_ZERO(&rset);
+-        FD_SET(read_sock, &rset);
+-        char *end;
+-
+-        memset(data, 0, 1024);
+-
+-        if (harvested == 0) {
+-            // We consider a wait error to be a sign that the child pid died
+-            // so we flag it as harvested and keep on going
+-            pid_t harvestpid = waitpid(sndpid, NULL, WNOHANG);
+-            if (harvestpid == -1 || harvestpid == sndpid)
+-                harvested = 1;
+-        }
+-
+-        struct timeval tim;
+-        tim.tv_sec = 1;
+-        tim.tv_usec = 0;
+-
+-        if (select(read_sock + 1, &rset, NULL, NULL, &tim) < 0) {
+-            if (errno != EINTR) {
+-                exit(1);
+-            }
+-        }
+-
+-        if (FD_ISSET(read_sock, &rset)) {
+-            int ret;
+-            ret = read(read_sock, data, 1024);
+-
+-            // We'll die off if we get a read error, and we'll let kismet on the
+-            // other side detact that it died
+-            if (ret <= 0 && (errno != EAGAIN && errno != EPIPE))
+-                exit(1);
+-
+-            if ((end = strstr(data, "\n")) == NULL)
+-                continue;
+-
+-            end[0] = '\0';
+-        }
+-
+-        if (data[0] == '\0')
+-            continue;
+-
+-        // If we've harvested the process, spawn a new one and watch it
+-        // instead.  Otherwise, we just let go of the data we read
+-        if (harvested == 1) {
+-            // Only take the first line
+-            char *nl;
+-            if ((nl = strchr(data, '\n')) != NULL)
+-                *nl = '\0';
+-
+-            char snd[1024];
+-
+-            if (soundmap.size() == 0)
+-                snprintf(snd, 1024, "%s", data);
+-            if (soundmap.find(data) != soundmap.end())
+-                snprintf(snd, 1024, "%s", soundmap[data].c_str());
+-            else
+-                continue;
+-
+-            char plr[1024];
+-            snprintf(plr, 1024, "%s", player);
+-
+-            harvested = 0;
+-            if ((sndpid = fork()) == 0) {
+-                // Suppress errors
+-                int nulfd = open("/dev/null", O_RDWR);
+-                dup2(nulfd, 1);
+-                dup2(nulfd, 2);
+-
+-                char * const echoarg[] = { plr, snd, NULL };
+-                execve(echoarg[0], echoarg, NULL);
+-            }
+-        }
+-
+-        data[0] = '\0';
+-    }
+-}
+-
+-// Subprocess speech handler
+-void SpeechHandler(int *fds, const char *player) {
+-    int read_sock = fds[0];
+-    close(fds[1]);
+-
+-    fd_set rset;
+-
+-    char data[1024];
+-
+-    pid_t sndpid = -1;
+-    int harvested = 1;
+-
+-    while (1) {
+-        FD_ZERO(&rset);
+-        FD_SET(read_sock, &rset);
+-        //char *end;
+-
+-        memset(data, 0, 1024);
+-
+-        struct timeval tim;
+-        tim.tv_sec = 1;
+-        tim.tv_usec = 0;
+-
+-        if (select(read_sock + 1, &rset, NULL, NULL, &tim) < 0) {
+-            if (errno != EINTR) {
+-                exit(1);
+-            }
+-        }
+-
+-        if (harvested == 0) {
+-            // We consider a wait error to be a sign that the child pid died
+-            // so we flag it as harvested and keep on going
+-            pid_t harvestpid = waitpid(sndpid, NULL, WNOHANG);
+-            if (harvestpid == -1 || harvestpid == sndpid)
+-                harvested = 1;
+-        }
+-
+-        if (FD_ISSET(read_sock, &rset)) {
+-            int ret;
+-            ret = read(read_sock, data, 1024);
+-
+-            // We'll die off if we get a read error, and we'll let kismet on the
+-            // other side detact that it died
+-            if (ret <= 0 && (errno != EAGAIN && errno != EPIPE))
+-                exit(1);
+-
+-            data[ret] = '\0';
+-
+-        }
+-
+-        if (data[0] == '\0')
+-            continue;
+-
+-        // If we've harvested the process, spawn a new one and watch it
+-        // instead.  Otherwise, we just let go of the data we read
+-        if (harvested == 1) {
+-            harvested = 0;
+-            if ((sndpid = fork()) == 0) {
+-                // Only take the first line
+-                char *nl;
+-                if ((nl = strchr(data, '\n')) != NULL)
+-                    *nl = '\0';
+-
+-                // Make sure it's shell-clean
+-                MungeToShell(data, strlen(data));
+-                char spk_call[1024];
+-                snprintf(spk_call, 1024, "echo \"(%s\\\"%s\\\")\" | %s "
+-                                               ">/dev/null 2>/dev/null",
+-                                               flite ? "": "SayText ", data, player);
+-
+-                system(spk_call);
+-
+-                exit(0);
+-            }
+-        }
+-
+-        data[0] = '\0';
+-    }
+-}
+-
+-
+-int PlaySound(string in_sound) {
+-
+-    char snd[1024];
+-
+-    snprintf(snd, 1024, "%s\n", in_sound.c_str());
+-
+-    if (write(soundpair[1], snd, strlen(snd)) < 0) {
+-        char status[STATUS_MAX];
+-        snprintf(status, STATUS_MAX,
+-                 "ERROR: Could not write to sound pipe.  Stopping sound.");
+-        gui->WriteStatus(status);
+-
+-        return 0;
+-    }
+-
+-    return 1;
+-}
+-
+-int SayText(string in_text) {
+-    char snd[1024];
+-
+-    snprintf(snd, 1024, "%s\n", in_text.c_str());
+-
+-    if (write(speechpair[1], snd, strlen(snd)) < 0) {
+-        char status[STATUS_MAX];
+-        snprintf(status, STATUS_MAX,
+-                 "ERROR: Could not write to speech pipe.  Stopping speech.");
+-        gui->WriteStatus(status);
+-
+-        return 0;
+-    }
+-
+-    return 1;
+-}
+ int main(int argc, char *argv[]) {
+     exec_name = argv[0];
+@@ -345,8 +120,6 @@
+     char guihost[1024];
+     int guiport = -1;
+-    int gpsmode = -1;
+-
+     configfile = NULL;
+     uiconfigfile = NULL;
+@@ -391,7 +164,6 @@
+             fprintf(stderr, "Using alternate UI config file: %s\n", uiconfigfile);
+             break;
+         case 'q':
+-            sound = 0;
+             break;
+         case 'g':
+             reqgui = strdup(optarg);
+@@ -515,70 +287,6 @@
+         server = strdup(gui_conf->FetchOpt("host").c_str());
+     }
+-    if (gui_conf->FetchOpt("sound") == "true" && sound == -1) {
+-        if (gui_conf->FetchOpt("soundplay") != "") {
+-            sndplay = gui_conf->FetchOpt("soundplay");
+-            sound = 1;
+-
+-            if (gui_conf->FetchOpt("soundopts") != "")
+-                sndplay += " " + gui_conf->FetchOpt("soundopts");
+-
+-            if (gui_conf->FetchOpt("sound_new") != "")
+-                wav_map["new"] = gui_conf->FetchOpt("sound_new");
+-            if (gui_conf->FetchOpt("sound_new_wep") != "")
+-                wav_map["new_wep"] = gui_conf->FetchOpt("sound_new_wep");
+-            if (gui_conf->FetchOpt("sound_traffic") != "")
+-                wav_map["traffic"] = gui_conf->FetchOpt("sound_traffic");
+-            if (gui_conf->FetchOpt("sound_junktraffic") != "")
+-                wav_map["junktraffic"] = gui_conf->FetchOpt("sound_junktraffic");
+-            if (gui_conf->FetchOpt("sound_gpslock") != "")
+-                wav_map["gpslock"] = gui_conf->FetchOpt("sound_gpslock");
+-            if (gui_conf->FetchOpt("sound_gpslost") != "")
+-                wav_map["gpslost"] = gui_conf->FetchOpt("sound_gpslost");
+-            if (gui_conf->FetchOpt("sound_alert") != "")
+-                wav_map["alert"] = gui_conf->FetchOpt("sound_alert");
+-
+-        } else {
+-            fprintf(stderr, "ERROR:  Sound alerts enabled but no sound playing binary specified.\n");
+-            sound = 0;
+-        }
+-    } else if (sound == -1)
+-        sound = 0;
+-
+-    /* Added by Shaw Innes 17/2/02 */
+-    if (gui_conf->FetchOpt("speech") == "true" && speech == -1) {
+-        if (gui_conf->FetchOpt("festival") != "") {
+-            festival = strdup(gui_conf->FetchOpt("festival").c_str());
+-            speech = 1;
+-
+-                      if (gui_conf->FetchOpt("flite") == "true")
+-                              flite = 1;
+-
+-            string speechtype = gui_conf->FetchOpt("speech_type");
+-
+-            if (!strcasecmp(speechtype.c_str(), "nato"))
+-                speech_encoding = SPEECH_ENCODING_NATO;
+-            else if (!strcasecmp(speechtype.c_str(), "spell"))
+-                speech_encoding = SPEECH_ENCODING_SPELL;
+-            else
+-                speech_encoding = SPEECH_ENCODING_NORMAL;
+-
+-            // Make sure we have encrypted text lines
+-            if (gui_conf->FetchOpt("speech_encrypted") == "" || gui_conf->FetchOpt("speech_unencrypted") == "") {
+-                fprintf(stderr, "ERROR:  Speech request but speech_encrypted or speech_unencrypted line missing.\n");
+-                speech = 0;
+-            }
+-
+-            speech_sentence_encrypted = gui_conf->FetchOpt("speech_encrypted");
+-            speech_sentence_unencrypted = gui_conf->FetchOpt("speech_unencrypted");
+-
+-        } else {
+-            fprintf(stderr, "ERROR: Speech alerts enabled but no path to festival has been specified.\n");
+-            speech = 0;
+-        }
+-    } else if (speech == -1)
+-        speech = 0;
+-
+     if (gui_conf->FetchOpt("decay") != "") {
+         if (sscanf(gui_conf->FetchOpt("decay").c_str(), "%d", &decay) != 1) {
+             fprintf(stderr, "FATAL:  Illegal config file value for decay.\n");
+@@ -636,45 +344,6 @@
+         }
+     }
+-    // Fork and find the sound options
+-    if (sound) {
+-        if (pipe(soundpair) == -1) {
+-            fprintf(stderr, "WARNING:  Unable to create pipe for audio.  Disabling sound.\n");
+-            sound = 0;
+-        } else {
+-            soundpid = fork();
+-
+-            if (soundpid < 0) {
+-                fprintf(stderr, "WARNING:  Unable to fork for audio.  Disabling sound.\n");
+-                sound = 0;
+-            } else if (soundpid == 0) {
+-                SoundHandler(soundpair, sndplay.c_str(), wav_map);
+-                exit(0);
+-            }
+-
+-            close(soundpair[0]);
+-        }
+-    }
+-
+-    if (speech) {
+-        if (pipe(speechpair) == -1) {
+-            fprintf(stderr, "WARNING:  Unable to create pipe for speech.  Disabling speech.\n");
+-            speech = 0;
+-        } else {
+-            speechpid = fork();
+-
+-            if (speechpid < 0) {
+-                fprintf(stderr, "WARNING:  Unable to fork for speech.  Disabling speech.\n");
+-                speech = 0;
+-            } else if (speechpid == 0) {
+-                SpeechHandler(speechpair, festival);
+-                exit(0);
+-            }
+-
+-            close(speechpair[0]);
+-        }
+-    }
+-
+     if (kismet_serv.Connect(guiport, guihost) < 0) {
+         fprintf(stderr, "FATAL:  Could not connect to %s:%d.\n", guihost, guiport);
+         CatchShutdown(-1);
+@@ -884,53 +553,13 @@
+                     }
+                     if (pollret != 0) {
+-                        if (pollret == CLIENT_ALERT)
+-                            if (sound == 1)
+-                                sound = PlaySound("alert");
+-
+                         if (strlen(tcpcli->FetchStatus()) != 0) {
+                             gui->WriteStatus(tcpcli->FetchStatus());
+                             // gui->DrawDisplay();
+                         }
+-                        // The GPS only gets updated for the primary client
+-                        if (tcpcli == primary_client) {
+-                            if (tcpcli->FetchMode() == 0 && gpsmode != 0) {
+-                                if (sound == 1 && gpsmode != -1)
+-                                    sound = PlaySound("gpslost");
+-                                gpsmode = 0;
+-                            } else if (tcpcli->FetchMode() != 0 && gpsmode == 0) {
+-                                if (sound == 1 && gpsmode != -1)
+-                                    sound = PlaySound("gpslock");
+-                                gpsmode = 1;
+-                            }
+-                        }
+-
+                         if (tcpcli->FetchDeltaNumNetworks() > 0) {
+                             wireless_network *newnet = tcpcli->FetchLastNewNetwork();
+-
+-                            if (sound == 1 && newnet != lastspoken) {
+-                                if (newnet->crypt_set && 
+-                                    wav_map.find("new_wep") != wav_map.end())
+-                                    sound = PlaySound("new_wep");
+-                                else
+-                                    sound = PlaySound("new");
+-                            }
+-
+-                            if (speech == 1 && newnet != lastspoken) {
+-                                string text;
+-
+-                                if (newnet != NULL) {
+-                                    if (newnet->crypt_set)
+-                                        text = ExpandSpeechString(speech_sentence_encrypted, newnet, speech_encoding);
+-                                    else
+-                                        text = ExpandSpeechString(speech_sentence_unencrypted, newnet, speech_encoding);
+-
+-                                    speech = SayText(text.c_str());
+-                                }
+-                            }
+-
+-                            lastspoken = newnet;
+                         }
+                         num_networks += tcpcli->FetchNumNetworks();
+@@ -938,17 +567,7 @@
+                         num_noise += tcpcli->FetchNumNoise();
+                         num_dropped += tcpcli->FetchNumDropped();
+-                        if (tcpcli->FetchDeltaNumPackets() != 0) {
+-                            if (time(0) - last_click >= decay && sound == 1) {
+-                                if (tcpcli->FetchDeltaNumPackets() > tcpcli->FetchDeltaNumDropped()) {
+-                                    sound = PlaySound("traffic");
+-                                } else {
+-                                    sound = PlaySound("junktraffic");
+-                                }
+-
+-                                last_click = time(0);
+-                            }
+-                        }
++                                              tcpcli->FetchDeltaNumPackets();
+                     }
+                 }
+             } else {
+diff -urN kismet.dev/kismet_drone.cc kismet.dev2/kismet_drone.cc
+--- kismet.dev/kismet_drone.cc 2005-08-16 03:22:51.000000000 +0200
++++ kismet.dev2/kismet_drone.cc        2005-08-23 01:59:25.649219336 +0200
+@@ -32,16 +32,11 @@
+ #include "packet.h"
+ #include "packetsource.h"
+-#include "prism2source.h"
+ #include "pcapsource.h"
+-#include "wtapfilesource.h"
+-#include "wsp100source.h"
+-#include "vihasource.h"
+ #include "dronesource.h"
+ #include "packetsourcetracker.h"
+ #include "kis_packsources.h"
+-#include "gpsd.h"
+ #include "tcpstreamer.h"
+ #include "configfile.h"
+@@ -53,10 +48,6 @@
+ const char *config_base = "kismet_drone.conf";
+-GPSD *gps = NULL;
+-int gpsmode = 0;
+-int gps_enable = 0;
+-
+ // Timetracker
+ Timetracker timetracker;
+@@ -81,26 +72,6 @@
+     exit(0);
+ }
+-int GpsEvent(Timetracker::timer_event *evt, void *parm) {
+-    // The GPS only provides us a new update once per second we might
+-    // as well only update it here once a second
+-    if (gps_enable) {
+-        int gpsret;
+-        gpsret = gps->Scan();
+-        if (gpsret < 0) {
+-            if (!silent)
+-                fprintf(stderr, "GPS error fetching data: %s\n",
+-                        gps->FetchError());
+-
+-            gps_enable = 0;
+-        }
+-
+-    }
+-
+-    // We want to be rescheduled
+-    return 1;
+-}
+-
+ // Handle channel hopping... this is actually really simple.
+ int ChannelHopEvent(Timetracker::timer_event *evt, void *parm) {
+     sourcetracker.AdvanceChannel();
+@@ -148,9 +119,6 @@
+     TcpStreamer streamer;
+-    char gpshost[1024];
+-    int gpsport = -1;
+-
+     int channel_hop = -1;
+     int channel_velocity = 1;
+     int channel_dwell = 0;
+@@ -351,46 +319,6 @@
+         exit(1);
+     }
+-    if (conf->FetchOpt("gps") == "true") {
+-        if (sscanf(conf->FetchOpt("gpshost").c_str(), "%1023[^:]:%d", gpshost, &gpsport) != 2) {
+-            fprintf(stderr, "Invalid GPS host in config (host:port required)\n");
+-            exit(1);
+-        }
+-
+-        gps_enable = 1;
+-    } else {
+-            gps_enable = 0;
+-    }
+-
+-    if (gps_enable == 1) {
+-        // Open the GPS
+-        gps = new GPSD(gpshost, gpsport);
+-
+-        // Lock GPS position
+-        if (conf->FetchOpt("gpsmodelock") == "true") {
+-            fprintf(stderr, "Enabling GPS position lock override (broken GPS unit reports 0 always)\n");
+-            gps->SetOptions(GPSD_OPT_FORCEMODE);
+-        }
+-
+-        if (gps->OpenGPSD() < 0) {
+-            fprintf(stderr, "%s\n", gps->FetchError());
+-
+-            gps_enable = 0;
+-        } else {
+-            fprintf(stderr, "Opened GPS connection to %s port %d\n",
+-                    gpshost, gpsport);
+-
+-        }
+-    }
+-
+-    // Update GPS coordinates and handle signal loss if defined
+-    timetracker.RegisterTimer(SERVER_TIMESLICES_SEC, NULL, 1, &GpsEvent, NULL);
+-
+-      // Add the GPS to the tcpstreamer
+-      streamer.AddGpstracker(gps);
+-
+-    // Register the gps and timetracker with the sourcetracker
+-    sourcetracker.AddGpstracker(gps);
+     sourcetracker.AddTimetracker(&timetracker);
+     // Register the sources
+diff -urN kismet.dev/kismet_server.cc kismet.dev2/kismet_server.cc
+--- kismet.dev/kismet_server.cc        2005-08-16 03:22:51.000000000 +0200
++++ kismet.dev2/kismet_server.cc       2005-08-23 01:59:25.653218728 +0200
+@@ -37,11 +37,7 @@
+ #include "packet.h"
+ #include "packetsource.h"
+-#include "prism2source.h"
+ #include "pcapsource.h"
+-#include "wtapfilesource.h"
+-#include "wsp100source.h"
+-#include "vihasource.h"
+ #include "dronesource.h"
+ #include "packetsourcetracker.h"
+ #include "kis_packsources.h"
+@@ -51,15 +47,11 @@
+ #include "wtaplocaldump.h"
+ #include "airsnortdump.h"
+ #include "fifodump.h"
+-#include "gpsdump.h"
+-
+-#include "gpsd.h"
+ #include "packetracker.h"
+ #include "timetracker.h"
+ #include "alertracker.h"
+-#include "speech.h"
+ #include "tcpserver.h"
+ #include "server_globals.h"
+ #include "kismet_server.h"
+@@ -89,17 +81,8 @@
+ Alertracker alertracker;
+ Timetracker timetracker;
+-GPSD *gps = NULL;
+-int gpsmode = 0;
+-GPSDump gpsdump;
+-
+-// Last time we tried to reconnect to the gps
+-time_t last_gpsd_reconnect = 0;
+-int gpsd_reconnect_attempt = 0;
+-
+ FifoDumpFile fifodump;
+ TcpServer ui_server;
+-int sound = -1;
+ packet_info last_info;
+ int decay;
+ channel_power channel_graph[CHANNEL_MAX];
+@@ -112,11 +95,8 @@
+ // Wep keys
+ macmap<wep_key_info *> bssid_wep_map;
+-// Pipe file descriptor pairs and fd's
+-int soundpair[2];
+-int speechpair[2];
+ int chanpair[2];
+-pid_t soundpid = -1, speechpid = -1, chanpid = -1;
++pid_t chanpid = -1;
+ // Past alerts
+ unsigned int max_alerts = 50;
+@@ -177,17 +157,6 @@
+ int tcpport = -1;
+ int tcpmax;
+-//const char *sndplay = NULL;
+-string sndplay;
+-
+-const char *festival = NULL;
+-int speech = -1;
+-int flite = 0;
+-int speech_encoding = 0;
+-string speech_sentence_encrypted, speech_sentence_unencrypted;
+-
+-map<string, string> wav_map;
+-
+ int beacon_log = 1;
+ int phy_log = 1;
+ int mangle_log = 0;
+@@ -347,17 +316,6 @@
+         // delete cryptfile;
+     }
+-    if (gps_log == 1) {
+-        if (gpsdump.CloseDump(1) < 0)
+-            fprintf(stderr, "Didn't log any GPS coordinates, unlinking gps file\n");
+-    }
+-
+-    // Kill our sound players
+-    if (soundpid > 0)
+-        kill(soundpid, 9);
+-    if (speechpid > 0)
+-        kill(speechpid, 9);
+-
+     // Shut down the packet sources
+     sourcetracker.CloseSources();
+@@ -368,228 +326,10 @@
+     exit(0);
+ }
+-// Subprocess sound handler
+-void SoundHandler(int *fds, const char *player, map<string, string> soundmap) {
+-    int read_sock = fds[0];
+-    close(fds[1]);
+-
+-    fd_set rset;
+-
+-    char data[1024];
+-
+-    pid_t sndpid = -1;
+-    int harvested = 1;
+-
+-    while (1) {
+-        FD_ZERO(&rset);
+-        FD_SET(read_sock, &rset);
+-        char *end;
+-
+-        memset(data, 0, 1024);
+-
+-        struct timeval tm;
+-        tm.tv_sec = 1;
+-        tm.tv_usec = 0;
+-
+-        if (select(read_sock + 1, &rset, NULL, NULL, &tm) < 0) {
+-            if (errno != EINTR) {
+-                exit(1);
+-            }
+-        }
+-
+-        if (harvested == 0) {
+-            // We consider a wait error to be a sign that the child pid died
+-            // so we flag it as harvested and keep on going
+-            pid_t harvestpid = waitpid(sndpid, NULL, WNOHANG);
+-            if (harvestpid == -1 || harvestpid == sndpid)
+-                harvested = 1;
+-        }
+-
+-        if (FD_ISSET(read_sock, &rset)) {
+-            int ret;
+-            ret = read(read_sock, data, 1024);
+-
+-            // We'll die off if we get a read error, and we'll let kismet on the
+-            // other side detact that it died
+-            if (ret <= 0 && (errno != EAGAIN && errno != EPIPE))
+-                exit(1);
+-
+-            if ((end = strstr(data, "\n")) == NULL)
+-                continue;
+-
+-            end[0] = '\0';
+-        }
+-
+-        if (data[0] == '\0')
+-            continue;
+-
+-
+-        // If we've harvested the process, spawn a new one and watch it
+-        // instead.  Otherwise, we just let go of the data we read
+-        if (harvested == 1) {
+-            // Only take the first line
+-            char *nl;
+-            if ((nl = strchr(data, '\n')) != NULL)
+-                *nl = '\0';
+-
+-            // Make sure it's shell-clean
+-
+-            char snd[1024];
+-
+-            if (soundmap.size() == 0)
+-                snprintf(snd, 1024, "%s", data);
+-            if (soundmap.find(data) != soundmap.end())
+-                snprintf(snd, 1024, "%s", soundmap[data].c_str());
+-            else
+-                continue;
+-
+-            char plr[1024];
+-            snprintf(plr, 1024, "%s", player);
+-
+-            harvested = 0;
+-            if ((sndpid = fork()) == 0) {
+-                // Suppress errors
+-                if (silent) {
+-                    int nulfd = open("/dev/null", O_RDWR);
+-                    dup2(nulfd, 1);
+-                    dup2(nulfd, 2);
+-                }
+-
+-                char * const echoarg[] = { plr, snd, NULL };
+-                execve(echoarg[0], echoarg, NULL);
+-            }
+-        }
+-        data[0] = '\0';
+-    }
+-}
+-
+-// Subprocess speech handler
+-void SpeechHandler(int *fds, const char *player) {
+-    int read_sock = fds[0];
+-    close(fds[1]);
+-
+-    fd_set rset;
+-
+-    char data[1024];
+-
+-    pid_t sndpid = -1;
+-    int harvested = 1;
+-
+-    while (1) {
+-        FD_ZERO(&rset);
+-        FD_SET(read_sock, &rset);
+-        //char *end;
+-
+-        memset(data, 0, 1024);
+-
+-        if (harvested == 0) {
+-            // We consider a wait error to be a sign that the child pid died
+-            // so we flag it as harvested and keep on going
+-            pid_t harvestpid = waitpid(sndpid, NULL, WNOHANG);
+-            if (harvestpid == -1 || harvestpid == sndpid)
+-                harvested = 1;
+-        }
+-
+-        struct timeval tm;
+-        tm.tv_sec = 1;
+-        tm.tv_usec = 0;
+-
+-        if (select(read_sock + 1, &rset, NULL, NULL, &tm) < 0) {
+-            if (errno != EINTR) {
+-                exit(1);
+-            }
+-        }
+-
+-        if (FD_ISSET(read_sock, &rset)) {
+-            int ret;
+-            ret = read(read_sock, data, 1024);
+-
+-            // We'll die off if we get a read error, and we'll let kismet on the
+-            // other side detact that it died
+-            if (ret <= 0 && (errno != EAGAIN && errno != EPIPE))
+-                exit(1);
+-
+-            data[ret] = '\0';
+-        }
+-
+-        if (data[0] == '\0')
+-            continue;
+-
+-        // If we've harvested the process, spawn a new one and watch it
+-        // instead.  Otherwise, we just let go of the data we read
+-        if (harvested == 1) {
+-            harvested = 0;
+-            if ((sndpid = fork()) == 0) {
+-                // Only take the first line
+-                char *nl;
+-                if ((nl = strchr(data, '\n')) != NULL)
+-                    *nl = '\0';
+-
+-                // Make sure it's shell-clean
+-                MungeToShell(data, strlen(data));
+-                char spk_call[1024];
+-                snprintf(spk_call, 1024, "echo \"(%s\\\"%s\\\")\" | %s "
+-                                               ">/dev/null 2>/dev/null",
+-                                               flite ? "" : "SayText ", data, player);
+-                system(spk_call);
+-
+-                exit(0);
+-            }
+-        }
+-
+-        data[0] = '\0';
+-    }
+-}
+-
+-
+-// Fork and run a system call to play a sound
+-int PlaySound(string in_sound) {
+-
+-    char snd[1024];
+-
+-    snprintf(snd, 1024, "%s\n", in_sound.c_str());
+-
+-    if (write(soundpair[1], snd, strlen(snd)) < 0) {
+-        char status[STATUS_MAX];
+-        if (!silent)
+-            fprintf(stderr, "ERROR:  Write error, closing sound pipe.\n");
+-        snprintf(status, STATUS_MAX, "ERROR:  Write error on sound pipe, closing sound connection");
+-        NetWriteStatus(status);
+-
+-        return 0;
+-    }
+-
+-    return 1;
+-}
+-
+-int SayText(string in_text) {
+-
+-    char snd[1024];
+-
+-    snprintf(snd, 1024, "%s\n", in_text.c_str());
+-    MungeToShell(snd, 1024);
+-
+-    if (write(speechpair[1], snd, strlen(snd)) < 0) {
+-        char status[STATUS_MAX];
+-        if (!silent)
+-            fprintf(stderr, "ERROR:  Write error, closing speech pipe.\n");
+-        snprintf(status, STATUS_MAX, "ERROR:  Write error on speech pipe, closing speech connection");
+-        NetWriteStatus(status);
+-
+-        return 0;
+-    }
+-
+-    return 1;
+-}
+-
+ void KisLocalAlert(const char *in_text) {
+     time_t now = time(0);
+     if (!silent)
+         fprintf(stderr, "ALERT %.24s %s\n", ctime(&now), in_text);
+-
+-    if (sound == 1)
+-        sound = PlaySound("alert");
+-
+ }
+ void KisLocalStatus(const char *in_status) {
+@@ -638,37 +378,6 @@
+     char tmpstr[32];
+-    GPS_data gdata;
+-
+-    if (gps_enable) {
+-        float lat, lon, alt, spd, hed;
+-        int mode;
+-
+-        gps->FetchLoc(&lat, &lon, &alt, &spd, &hed, &mode);
+-
+-        snprintf(tmpstr, 32, "%f", lat);
+-        gdata.lat = tmpstr;
+-        snprintf(tmpstr, 32, "%f", lon);
+-        gdata.lon = tmpstr;
+-        snprintf(tmpstr, 32, "%f", alt);
+-        gdata.alt = tmpstr;
+-        snprintf(tmpstr, 32, "%f", spd);
+-        gdata.spd = tmpstr;
+-        snprintf(tmpstr, 32, "%f", hed);
+-        gdata.heading = tmpstr;
+-        snprintf(tmpstr, 32, "%d", mode);
+-        gdata.mode = tmpstr;
+-    } else {
+-        gdata.lat = "0.0";
+-        gdata.lon = "0.0";
+-        gdata.alt = "0.0";
+-        gdata.spd = "0.0";
+-        gdata.heading = "0.0";
+-        gdata.mode = "0";
+-    }
+-
+-    ui_server.SendToAll(gps_ref, (void *) &gdata);
+-
+     INFO_data idata;
+     snprintf(tmpstr, 32, "%d", tracker.FetchNumNetworks());
+     idata.networks = tmpstr;
+@@ -789,81 +498,6 @@
+     }
+ }
+-int GpsEvent(Timetracker::timer_event *evt, void *parm) {
+-    char status[STATUS_MAX];
+-
+-    // The GPS only provides us a new update once per second we might
+-    // as well only update it here once a second
+-
+-    // If we're disconnected, try to reconnect.
+-    if (gpsd_reconnect_attempt > 0) {
+-        // Increment the time between connection attempts
+-        if (last_gpsd_reconnect + ((gpsd_reconnect_attempt - 1) * 2) < time(0)) {
+-            if (gps->OpenGPSD() < 0) {
+-                last_gpsd_reconnect = time(0);
+-
+-                if (gpsd_reconnect_attempt < 20)
+-                    gpsd_reconnect_attempt++;
+-
+-                snprintf(status, STATUS_MAX, "Unable to reconnect to GPSD, trying "
+-                         "again in %d seconds.", ((gpsd_reconnect_attempt - 1) * 2));
+-
+-                if (!silent || NetWriteStatus(status) == 0)
+-                    fprintf(stderr, "WARNING: %s\n", status);
+-
+-                return 1;
+-            } else {
+-                gpsd_reconnect_attempt = 0;
+-
+-                snprintf(status, STATUS_MAX, "Reopened connection to GPSD");
+-                if (!silent || NetWriteStatus(status) == 0)
+-                    fprintf(stderr, "NOTICE: %s\n", status);
+-            }
+-        } else {
+-            // Don't process more if we haven't woken up yet
+-            return 1;
+-        }
+-
+-    }
+-    
+-    if (gps_enable) {
+-        int gpsret;
+-        gpsret = gps->Scan();
+-
+-        if (gpsret < 0) {
+-            snprintf(status, STATUS_MAX, "GPS error requesting data: %s",
+-                     gps->FetchError());
+-
+-            if (!silent || NetWriteStatus(status) == 0)
+-                fprintf(stderr, "WARNING: %s\n", status);
+-
+-            gpsd_reconnect_attempt = 1;
+-        }
+-
+-        if (gpsret == 0 && gpsmode != 0) {
+-            if (!silent || NetWriteStatus("Lost GPS signal.") == 0)
+-                fprintf(stderr, "Lost GPS signal.\n");
+-            if (sound == 1)
+-                sound = PlaySound("gpslost");
+-
+-            gpsmode = 0;
+-        } else if (gpsret != 0 && gpsmode == 0) {
+-            if (!silent || NetWriteStatus("Acquired GPS signal.") == 0)
+-                fprintf(stderr, "Acquired GPS signal.\n");
+-            if (sound == 1)
+-                sound = PlaySound("gpslock");
+-
+-            gpsmode = 1;
+-        }
+-    }
+-
+-    if (gps_log == 1 && gpsmode != 0 && gps != NULL) {
+-        gpsdump.DumpTrack(gps);
+-    }
+-
+-    // We want to be rescheduled
+-    return 1;
+-}
+ // Simple redirect to the network info drawer.  We don't want to change netwriteinfo to a
+ // timer event since we call it un-timed too
+@@ -884,13 +518,6 @@
+     return 1;
+ }
+-// Write the waypoints for gpsdrive
+-int WaypointSyncEvent(Timetracker::timer_event *evt, void *parm) {
+-    tracker.WriteGpsdriveWaypt(waypoint_file);
+-
+-    return 1;
+-}
+-
+ // Handle tracker maintenance
+ int TrackerTickEvent(Timetracker::timer_event *evt, void *parm) {
+     tracker.Tick();
+@@ -1159,11 +786,9 @@
+            "  -c, --capture-source <src>   Packet capture source line (type,interface,name)\n"
+            "  -C, --enable-capture-sources Comma separated list of named packet sources to use.\n"
+            "  -l, --log-types <types>      Comma separated list of types to log,\n"
+-           "                                (ie, dump,cisco,weak,network,gps)\n"
++           "                                (ie, dump,cisco,weak,network)\n"
+            "  -d, --dump-type <type>       Dumpfile type (wiretap)\n"
+            "  -m, --max-packets <num>      Maximum number of packets before starting new dump\n"
+-           "  -q, --quiet                  Don't play sounds\n"
+-           "  -g, --gps <host:port>        GPS server (host:port or off)\n"
+            "  -p, --port <port>            TCPIP server port for GUI connections\n"
+            "  -a, --allowed-hosts <hosts>  Comma separated list of hosts allowed to connect\n"
+            "  -b, --bind-address <address>    Bind to this address. Default INADDR_ANY\n."
+@@ -1287,23 +912,6 @@
+         ip_track = 1;
+     }
+-
+-    if (conf->FetchOpt("waypoints") == "true") {
+-        if(conf->FetchOpt("waypointdata") == "") {
+-            fprintf(stderr, "WARNING:  Waypoint logging requested but no waypoint data file given.\n"
+-                    "Waypoint logging will be disabled.\n");
+-            waypoint = 0;
+-        } else {
+-            waypointfile = conf->ExpandLogPath(conf->FetchOpt("waypointdata"), "", "", 0, 1);
+-            waypoint = 1;
+-        }
+-        if(conf->FetchOpt("waypoint_essid") == "true") {
+-            waypointformat = 1;
+-        } else {
+-          waypointformat = 0;
+-        }
+-    }
+-
+     if (conf->FetchOpt("metric") == "true") {
+         fprintf(stderr, "Using metric measurements.\n");
+         metric = 1;
+@@ -1421,26 +1029,6 @@
+             }
+         }
+-
+-        if (strstr(logtypes, "gps")) {
+-            if (gps_log == 0) {
+-                fprintf(stderr, "WARNING:  Disabling GPS logging.\n");
+-            } else {
+-                gps_log = 1;
+-
+-                if (conf->FetchOpt("logtemplate") == "") {
+-                    fprintf(stderr, "FATAL:  Logging (gps coordinates) enabled but no logtemplate given in config.\n");
+-                    ErrorShutdown();
+-                }
+-            }
+-
+-        }
+-
+-        if (gps_log == 1 && !net_log) {
+-            fprintf(stderr, "WARNING:  Logging (gps coordinates) enabled but XML logging (networks) was not.\n"
+-                    "It will be enabled now.\n");
+-            xml_log = 1;
+-        }
+     }
+     if (conf->FetchOpt("decay") != "") {
+@@ -1561,72 +1149,6 @@
+         legal_ipblock_vec.push_back(ipb);
+     }
+-    // Process sound stuff
+-    if (conf->FetchOpt("sound") == "true" && sound == -1) {
+-        if (conf->FetchOpt("soundplay") != "") {
+-            sndplay = conf->FetchOpt("soundplay");
+-
+-            if (conf->FetchOpt("soundopts") != "")
+-                sndplay += " " + conf->FetchOpt("soundopts");
+-
+-            sound = 1;
+-
+-            if (conf->FetchOpt("sound_new") != "")
+-                wav_map["new"] = conf->FetchOpt("sound_new");
+-            if (conf->FetchOpt("sound_new_wep") != "")
+-                wav_map["new_wep"] = conf->FetchOpt("sound_new_wep");
+-            if (conf->FetchOpt("sound_traffic") != "")
+-                wav_map["traffic"] = conf->FetchOpt("sound_traffic");
+-            if (conf->FetchOpt("sound_junktraffic") != "")
+-                wav_map["junktraffic"] = conf->FetchOpt("sound_traffic");
+-            if (conf->FetchOpt("sound_gpslock") != "")
+-                wav_map["gpslock"] = conf->FetchOpt("sound_gpslock");
+-            if (conf->FetchOpt("sound_gpslost") != "")
+-                wav_map["gpslost"] = conf->FetchOpt("sound_gpslost");
+-            if (conf->FetchOpt("sound_alert") != "")
+-                wav_map["alert"] = conf->FetchOpt("sound_alert");
+-
+-        } else {
+-            fprintf(stderr, "ERROR:  Sound alerts enabled but no sound playing binary specified.\n");
+-            sound = 0;
+-        }
+-    } else if (sound == -1)
+-        sound = 0;
+-
+-    /* Added by Shaw Innes 17/2/02 */
+-    /* Modified by Andrew Etter 15/9/02 */
+-    if (conf->FetchOpt("speech") == "true" && speech == -1) {
+-        if (conf->FetchOpt("festival") != "") {
+-            festival = strdup(conf->FetchOpt("festival").c_str());
+-            speech = 1;
+-              
+-                      if (conf->FetchOpt("flite") == "true")
+-                              flite = 1;
+-
+-            string speechtype = conf->FetchOpt("speech_type");
+-
+-            if (!strcasecmp(speechtype.c_str(), "nato"))
+-                speech_encoding = SPEECH_ENCODING_NATO;
+-            else if (!strcasecmp(speechtype.c_str(), "spell"))
+-                speech_encoding = SPEECH_ENCODING_SPELL;
+-            else
+-                speech_encoding = SPEECH_ENCODING_NORMAL;
+-
+-            // Make sure we have encrypted text lines
+-            if (conf->FetchOpt("speech_encrypted") == "" || conf->FetchOpt("speech_unencrypted") == "") {
+-                fprintf(stderr, "ERROR:  Speech request but speech_encrypted or speech_unencrypted line missing.\n");
+-                speech = 0;
+-            }
+-
+-            speech_sentence_encrypted = conf->FetchOpt("speech_encrypted");
+-            speech_sentence_unencrypted = conf->FetchOpt("speech_unencrypted");
+-        } else {
+-            fprintf(stderr, "ERROR: Speech alerts enabled but no path to festival has been specified.\n");
+-            speech = 0;
+-        }
+-    } else if (speech == -1)
+-        speech = 0;
+-
+     if (conf->FetchOpt("writeinterval") != "") {
+         if (sscanf(conf->FetchOpt("writeinterval").c_str(), "%d", &datainterval) != 1) {
+             fprintf(stderr, "FATAL:  Illegal config file value for data interval.\n");
+@@ -1646,45 +1168,6 @@
+         fprintf(stderr, "WARNING:  No client_manuf file specified.  Client manufacturers will not be detected.\n");
+     }
+-    // Fork and find the sound options
+-    if (sound) {
+-        if (pipe(soundpair) == -1) {
+-            fprintf(stderr, "WARNING:  Unable to create pipe for audio.  Disabling sound.\n");
+-            sound = 0;
+-        } else {
+-            soundpid = fork();
+-
+-            if (soundpid < 0) {
+-                fprintf(stderr, "WARNING:  Unable to fork for audio.  Disabling sound.\n");
+-                sound = 0;
+-            } else if (soundpid == 0) {
+-                SoundHandler(soundpair, sndplay.c_str(), wav_map);
+-                exit(0);
+-            }
+-
+-            close(soundpair[0]);
+-        }
+-    }
+-
+-    if (speech) {
+-        if (pipe(speechpair) == -1) {
+-            fprintf(stderr, "WARNING:  Unable to create pipe for speech.  Disabling speech.\n");
+-            speech = 0;
+-        } else {
+-            speechpid = fork();
+-
+-            if (speechpid < 0) {
+-                fprintf(stderr, "WARNING:  Unable to fork for speech.  Disabling speech.\n");
+-                speech = 0;
+-            } else if (speechpid == 0) {
+-                SpeechHandler(speechpair, festival);
+-                exit(0);
+-            }
+-
+-            close(speechpair[0]);
+-        }
+-    }
+-
+     // Grab the filtering
+     string filter_bit;
+@@ -1710,7 +1193,7 @@
+     }
+     if ((filter_bit = conf->FetchOpt("filter_export")) != "") {
+-        fprintf(stderr, "Enabling filtering on exported (csv, xml, network, gps) files.\n");
++        fprintf(stderr, "Enabling filtering on exported (csv, xml, network) files.\n");
+         filter_export = 1;
+         if (ConfigFile::ParseFilterLine(filter_bit, &filter_export_bssid, &filter_export_source,
+                                         &filter_export_dest, &filter_export_bssid_invert,
+@@ -1816,14 +1299,6 @@
+     }
+-    if (waypoint) {
+-        if ((waypoint_file = fopen(waypointfile.c_str(), "a")) == NULL) {
+-            fprintf(stderr, "WARNING:  Could not open waypoint file '%s' for writing: %s\n",
+-                    waypointfile.c_str(), strerror(errno));
+-            waypoint = 0;
+-        }
+-    }
+-
+     // Create all the logs and title/number them appropriately
+     // We need to save this for after we toast the conf record
+     int logfile_matched = 0;
+@@ -1871,13 +1346,6 @@
+                 continue;
+         }
+-        if (gps_log == 1) {
+-            gpslogfile = conf->ExpandLogPath(conf->FetchOpt("logtemplate"), logname, "gps", run_num);
+-
+-            if (gpslogfile == "")
+-                continue;
+-        }
+-
+         // if we made it this far we're cool -- all the logfiles we're writing to matched
+         // this number
+         logfile_matched = 1;
+@@ -1906,9 +1374,6 @@
+     if (cisco_log)
+         fprintf(stderr, "Logging cisco product information to %s\n", ciscologfile.c_str());
+-    if (gps_log == 1)
+-        fprintf(stderr, "Logging gps coordinates to %s\n", gpslogfile.c_str());
+-
+     if (data_log)
+         fprintf(stderr, "Logging data to %s\n", dumplogfile.c_str());
+@@ -2055,7 +1520,6 @@
+         { "dump-type", required_argument, 0, 'd' },
+         { "max-packets", required_argument, 0, 'm' },
+         { "quiet", no_argument, 0, 'q' },
+-        { "gps", required_argument, 0, 'g' },
+         { "port", required_argument, 0, 'p' },
+         { "allowed-hosts", required_argument, 0, 'a' },
+         { "bind-address", required_argument, 0, 'b'},
+@@ -2136,18 +1600,6 @@
+                 Usage(argv[0]);
+             }
+             break;
+-        case 'g':
+-            // GPS
+-            if (strcmp(optarg, "off") == 0) {
+-                gps_enable = 0;
+-            }
+-            else if (sscanf(optarg, "%1023[^:]:%d", gpshost, &gpsport) < 2) {
+-                fprintf(stderr, "Invalid GPS host '%s' (host:port or off required)\n",
+-                       optarg);
+-                gps_enable = 1;
+-                Usage(argv[0]);
+-            }
+-            break;
+         case 'p':
+             // Port
+             if (sscanf(optarg, "%d", &tcpport) != 1) {
+@@ -2169,7 +1621,6 @@
+             break;
+         case 'q':
+             // Quiet
+-            sound = 0;
+             break;
+         case 'v':
+             // version
+@@ -2323,39 +1774,6 @@
+     // And we're done
+     fclose(pid_file);
+             
+-
+-    // Set up the GPS object to give to the children
+-    if (gpsport == -1 && gps_enable) {
+-        if (conf->FetchOpt("gps") == "true") {
+-            if (sscanf(conf->FetchOpt("gpshost").c_str(), "%1023[^:]:%d", gpshost, 
+-                       &gpsport) != 2) {
+-                fprintf(stderr, "Invalid GPS host in config (host:port required)\n");
+-                exit(1);
+-            }
+-
+-            gps_enable = 1;
+-        } else {
+-            gps_enable = 0;
+-            gps_log = 0;
+-        }
+-    }
+-
+-    if (gps_enable == 1) {
+-        gps = new GPSD(gpshost, gpsport);
+-
+-        // Lock GPS position
+-        if (conf->FetchOpt("gpsmodelock") == "true") {
+-            fprintf(stderr, "Enabling GPS position lock override (broken GPS unit "
+-                    "reports 0 always)\n");
+-            gps->SetOptions(GPSD_OPT_FORCEMODE);
+-        }
+-
+-    } else {
+-        gps_log = 0;
+-    }
+-
+-    // Register the gps and timetracker with the sourcetracker
+-    sourcetracker.AddGpstracker(gps);
+     sourcetracker.AddTimetracker(&timetracker);
+     // Handle errors here maybe in the future
+@@ -2522,13 +1940,6 @@
+         fprintf(stderr, "Dump file format: %s\n", dumpfile->FetchType());
+     }
+-    if (gps_enable && gps_log == 1) {
+-        if (gpsdump.OpenDump(gpslogfile.c_str(), xmllogfile.c_str()) < 0) {
+-            fprintf(stderr, "FATAL: GPS dump error: %s\n", gpsdump.FetchError());
+-            ErrorShutdown();
+-        }
+-    }
+-
+     // Open our files first to make sure we can, we'll unlink the empties later.
+     FILE *testfile = NULL;
+     if (net_log) {
+@@ -2600,14 +2011,13 @@
+     */
+     if (data_log || net_log || crypt_log) {
+-        snprintf(status, STATUS_MAX, "Logging%s%s%s%s%s%s%s",
++        snprintf(status, STATUS_MAX, "Logging%s%s%s%s%s%s",
+                  data_log ? " data" : "" ,
+                  net_log ? " networks" : "" ,
+                  csv_log ? " CSV" : "" ,
+                  xml_log ? " XML" : "" ,
+                  crypt_log ? " weak" : "",
+-                 cisco_log ? " cisco" : "",
+-                 gps_log == 1 ? " gps" : "");
++                 cisco_log ? " cisco" : "");
+         fprintf(stderr, "%s\n", status);
+     } else if (no_log) {
+         snprintf(status, STATUS_MAX, "Not logging any data.");
+@@ -2625,23 +2035,6 @@
+         }
+     }
+-    if (gps_enable) {
+-        // Open the GPS
+-        if (gps->OpenGPSD() < 0) {
+-            fprintf(stderr, "%s\n", gps->FetchError());
+-
+-            gps_enable = 0;
+-            gps_log = 0;
+-        } else {
+-            fprintf(stderr, "Opened GPS connection to %s port %d\n",
+-                    gpshost, gpsport);
+-
+-            gpsmode = gps->FetchMode();
+-
+-            last_gpsd_reconnect = time(0);
+-        }
+-    }
+-
+     fprintf(stderr, "Listening on port %d.\n", tcpport);
+     for (unsigned int ipvi = 0; ipvi < legal_ipblock_vec.size(); ipvi++) {
+         char *netaddr = strdup(inet_ntoa(legal_ipblock_vec[ipvi]->network));
+@@ -2682,8 +2075,6 @@
+                                              &Protocol_NETWORK, &ProtocolNetworkEnable);
+     client_ref = ui_server.RegisterProtocol("CLIENT", 0, CLIENT_fields_text,
+                                             &Protocol_CLIENT, &ProtocolClientEnable);
+-    gps_ref = ui_server.RegisterProtocol("GPS", 0, GPS_fields_text,
+-                                         &Protocol_GPS, NULL);
+     info_ref = ui_server.RegisterProtocol("INFO", 0, INFO_fields_text,
+                                           &Protocol_INFO, NULL);
+     remove_ref = ui_server.RegisterProtocol("REMOVE", 0, REMOVE_fields_text,
+@@ -2738,14 +2129,9 @@
+     // Write network info and tick the tracker once per second
+     timetracker.RegisterTimer(SERVER_TIMESLICES_SEC, NULL, 1, &NetWriteEvent, NULL);
+     timetracker.RegisterTimer(SERVER_TIMESLICES_SEC, NULL, 1, &TrackerTickEvent, NULL);
+-    // Update GPS coordinates and handle signal loss if defined
+-    timetracker.RegisterTimer(SERVER_TIMESLICES_SEC, NULL, 1, &GpsEvent, NULL);
+     // Sync the data files if requested
+     if (datainterval > 0 && no_log == 0)
+         timetracker.RegisterTimer(datainterval * SERVER_TIMESLICES_SEC, NULL, 1, &ExportSyncEvent, NULL);
+-    // Write waypoints if requested
+-    if (waypoint)
+-        timetracker.RegisterTimer(decay * SERVER_TIMESLICES_SEC, NULL, 1, &WaypointSyncEvent, NULL);
+     // Channel hop if requested
+     if (channel_hop) {
+         if (channel_dwell)
+@@ -2769,7 +2155,6 @@
+     snprintf(status, 1024, "%s", TIMESTAMP);
+     kdata.timestamp = status;
+-    time_t last_click = 0;
+     int num_networks = 0, num_packets = 0, num_noise = 0, num_dropped = 0;
+@@ -2918,54 +2303,13 @@
+                     }
+-                    if (gps_log == 1 && info.type != packet_noise && 
+-                        info.type != packet_unknown && info.type != packet_phy && 
+-                        info.corrupt == 0) {
+-                        if (gpsdump.DumpPacket(&info) < 0) {
+-                            snprintf(status, STATUS_MAX, "%s", gpsdump.FetchError());
+-                            if (!silent || NetWriteStatus(status) == 0)
+-                                fprintf(stderr, "%s\n", status);
+-                        }
+-                    }
+-
+                     // tracker.ProcessPacket(info);
+                     tracker.ProcessPacket(&packet, &info, &bssid_wep_map, 
+                                                                                 wep_identity);
+-                    if (tracker.FetchNumNetworks() > num_networks) {
+-                        if (sound == 1)
+-                            if (info.crypt_set && 
+-                                                              wav_map.find("new_wep") != wav_map.end())
+-                                sound = PlaySound("new_wep");
+-                            else
+-                                sound = PlaySound("new");
+-                        if (speech == 1) {
+-                            string text;
+-
+-                            if (info.crypt_set)
+-                                text = ExpandSpeechString(speech_sentence_encrypted, &info, 
+-                                                          speech_encoding);
+-                            else
+-                                text = ExpandSpeechString(speech_sentence_unencrypted, 
+-                                                          &info, speech_encoding);
+-
+-                            speech = SayText(MungeToShell(text).c_str());
+-                        }
+-                    }
+                     num_networks = tracker.FetchNumNetworks();
+                     if (tracker.FetchNumPackets() != num_packets) {
+-                        if (cur_time - last_click >= decay && sound == 1) {
+-                            if (tracker.FetchNumPackets() - num_packets >
+-                                tracker.FetchNumDropped() + localdropnum - num_dropped) {
+-                                sound = PlaySound("traffic");
+-                            } else {
+-                                sound = PlaySound("junktraffic");
+-                            }
+-
+-                            last_click = cur_time;
+-                        }
+-
+                         num_packets = tracker.FetchNumPackets();
+                         num_noise = tracker.FetchNumNoise();
+                         num_dropped = tracker.FetchNumDropped() + localdropnum;
+diff -urN kismet.dev/kismet_server.h kismet.dev2/kismet_server.h
+--- kismet.dev/kismet_server.h 2005-08-16 03:22:51.000000000 +0200
++++ kismet.dev2/kismet_server.h        2005-08-23 01:59:25.653218728 +0200
+@@ -33,10 +33,6 @@
+ void handle_command(TcpServer *tcps, client_command *cc);
+ int NetWriteStatus(const char *in_status);
+ void NetWriteInfo();
+-int SayText(string in_text);
+-int PlaySound(string in_sound);
+-void SpeechHandler(int *fds, const char *player);
+-void SoundHandler(int *fds, const char *player, map<string, string> soundmap);
+ void ProtocolAlertEnable(int in_fd);
+ void ProtocolNetworkEnable(int in_fd);
+ void ProtocolClientEnable(int in_fd);
+diff -urN kismet.dev/packetracker.cc kismet.dev2/packetracker.cc
+--- kismet.dev/packetracker.cc 2005-08-16 03:22:51.000000000 +0200
++++ kismet.dev2/packetracker.cc        2005-08-23 01:59:25.656218272 +0200
+@@ -2439,23 +2439,3 @@
+ }
+-// Write a gpsdrive compatable waypoint file
+-int Packetracker::WriteGpsdriveWaypt(FILE *in_file) {
+-    fseek(in_file, 0L, SEEK_SET);
+-    ftruncate(fileno(in_file), 0);
+-
+-    // Convert the map to a vector and sort it
+-    for (map<mac_addr, wireless_network *>::const_iterator i = bssid_map.begin();
+-         i != bssid_map.end(); ++i) {
+-        wireless_network *net = i->second;
+-
+-        float lat, lon;
+-        lat = (net->min_lat + net->max_lat) / 2;
+-        lon = (net->min_lon + net->max_lon) / 2;
+-        fprintf(in_file, "%s\t%f  %f\n", waypointformat == 1 ? net->ssid.c_str() : net->bssid.Mac2String().c_str(), lat, lon);
+-    }
+-
+-    fflush(in_file);
+-
+-    return 1;
+-}
+diff -urN kismet.dev/packetracker.h kismet.dev2/packetracker.h
+--- kismet.dev/packetracker.h  2005-08-16 03:22:51.000000000 +0200
++++ kismet.dev2/packetracker.h 2005-08-23 01:59:25.656218272 +0200
+@@ -30,7 +30,6 @@
+ #include <string>
+ #include "util.h"
+-#include "gpsd.h"
+ #include "packet.h"
+ #include "tracktypes.h"
+ #include "manuf.h"
+@@ -85,8 +84,6 @@
+     int WriteXMLNetworks(string in_fname);
+     int WriteCisco(string in_fname);
+-    int WriteGpsdriveWaypt(FILE *in_file);
+-
+     void WriteSSIDMap(FILE *in_file);
+     void ReadSSIDMap(FILE *in_file);
+diff -urN kismet.dev/packetsourcetracker.cc kismet.dev2/packetsourcetracker.cc
+--- kismet.dev/packetsourcetracker.cc  2005-08-23 00:59:39.969982048 +0200
++++ kismet.dev2/packetsourcetracker.cc 2005-08-23 01:59:25.657218120 +0200
+@@ -24,7 +24,6 @@
+ Packetsourcetracker::Packetsourcetracker() {
+     next_packsource_id = 0;
+     next_meta_id = 0;
+-    gpsd = NULL;
+     timetracker = NULL;
+     chanchild_pid = 0;
+     sockpair[0] = sockpair[1] = 0;
+@@ -691,7 +690,6 @@
+         
+         // Register the trackers with it
+         meta->capsource->AddTimetracker(timetracker);
+-        meta->capsource->AddGpstracker(gpsd);
+        
+         // Open it
+         fprintf(stderr, "Source %d (%s): Opening %s source interface %s...\n",
+diff -urN kismet.dev/packetsourcetracker.h kismet.dev2/packetsourcetracker.h
+--- kismet.dev/packetsourcetracker.h   2005-08-16 03:22:51.000000000 +0200
++++ kismet.dev2/packetsourcetracker.h  2005-08-23 01:59:25.658217968 +0200
+@@ -30,7 +30,6 @@
+ #include <string>
+ #include "timetracker.h"
+-#include "gpsd.h"
+ #include "packetsource.h"
+ // Sentinel for starting a new packet
+@@ -144,9 +143,6 @@
+     // Register a timer event handler for us to use
+     void AddTimetracker(Timetracker *in_tracker) { timetracker = in_tracker; }
+-    // Register the GPS server for us to use
+-    void AddGpstracker(GPSD *in_gpsd) { gpsd = in_gpsd; }
+-    
+     // Register a packet prototype source...  Card type string, root binding requirement,
+     // function to generate an instance of the source, and function to change channel 
+     // for this card type.  This fills out the prototype. Sources that don't hop 
+@@ -221,7 +217,6 @@
+         uint16_t channel;
+     } chanchild_changepacket;
+-    GPSD *gpsd;
+     Timetracker *timetracker;
+     
+     char errstr[1024];
+diff -urN kismet.dev/panelfront.cc kismet.dev2/panelfront.cc
+--- kismet.dev/panelfront.cc   2005-08-16 03:22:51.000000000 +0200
++++ kismet.dev2/panelfront.cc  2005-08-23 01:59:25.659217816 +0200
+@@ -37,7 +37,6 @@
+     "  Key  Action",
+     "   e   List Kismet servers",
+     "   z   Toggle fullscreen zoom of network view",
+-    "   m   Toggle muting of sound and speech",
+     "   t   Tag (or untag) selected network",
+     "   g   Group tagged networks",
+     "   u   Ungroup current group",
+@@ -121,7 +120,6 @@
+     "Key Action",
+     " e  List Kismet servers",
+     " z  Toggle fullscreen net list",
+-    " m  Toggle muting",
+     " t  Tag (or untag) selected",
+     " g  Group tagged networks",
+     " u  Ungroup current group",
+@@ -237,19 +235,6 @@
+ };
+-char *KismetHelpGps[] = {
+-    "KISMET NETWORK FOLLOW",
+-    "This panel estimates the center of a network, the current",
+-    "direction of travel, and the direction of the network center",
+-    "and distance relative to the current direction of movement.",
+-    " Key   Action",
+-    "  s    Follow location of strongest packet",
+-    "  c    Follow location of estimated network center",
+-    "  q    Close popup",
+-    NULL
+-};
+-
+-
+ char *KismetHelpStats[] = {
+     "KISMET NETWORK STATISTICS",
+     "This panel displays overall statistics about the wireless",
+@@ -678,7 +663,6 @@
+     }
+     // Enable all the protocols we handle
+-    in_client->EnableProtocol("GPS");
+     in_client->EnableProtocol("INFO");
+     in_client->EnableProtocol("REMOVE");
+     in_client->EnableProtocol("NETWORK");
+@@ -1282,27 +1266,6 @@
+         if (con->client == NULL)
+             continue;
+-        // Update GPS
+-        float newlat, newlon, newalt, newspd, newheading;
+-        int newfix;
+-        con->client->FetchLoc(&newlat, &newlon, &newalt, &newspd, &newheading, &newfix);
+-
+-        if (GPSD::EarthDistance(newlat, newlon, last_lat, last_lon) > 10) {
+-            con->last_lat = con->lat;
+-            con->last_lon = con->lon;
+-            con->last_spd = con->spd;
+-            con->last_alt = con->alt;
+-            con->last_fix = con->fix;
+-            con->last_heading = con->heading;
+-        }
+-
+-        con->lat = newlat;
+-        con->lon = newlon;
+-        con->alt = newalt;
+-        con->spd = newspd;
+-        con->heading = newheading;
+-        con->fix = newfix;
+-
+         // Update quality
+         con->quality = con->client->FetchQuality();
+         con->power = con->client->FetchPower();
+diff -urN kismet.dev/panelfront.h kismet.dev2/panelfront.h
+--- kismet.dev/panelfront.h    2005-08-16 03:22:51.000000000 +0200
++++ kismet.dev2/panelfront.h   2005-08-23 01:59:25.660217664 +0200
+@@ -65,7 +65,6 @@
+ #define SORT_SIZE 10
+ extern char *KismetHelpPower[];
+ extern char *KismetHelpRate[];
+-extern char *KismetHelpGps[];
+ extern char *KismetHelpStats[];
+ extern char *KismetHelpDump[];
+ extern char *KismetHelpPack[];
+@@ -269,7 +268,6 @@
+     int RatePrinter(void *in_window);
+     int StatsPrinter(void *in_window);
+     int PackPrinter(void *in_window);
+-    int GpsPrinter(void *in_window);
+     int AlertPrinter(void *in_window);
+     int MainClientPrinter(void *in_window);
+@@ -298,7 +296,6 @@
+     int PackInput(void *in_window, int in_chr);
+     // Help has a generic handler
+     int TextInput(void *in_window, int in_chr);
+-    int GpsInput(void *in_window, int in_chr);
+     int AlertInput(void *in_window, int in_chr);
+     int MainClientInput(void *in_window, int in_chr);
+diff -urN kismet.dev/panelfront_display.cc kismet.dev2/panelfront_display.cc
+--- kismet.dev/panelfront_display.cc   2005-08-16 03:22:51.000000000 +0200
++++ kismet.dev2/panelfront_display.cc  2005-08-23 01:59:25.663217208 +0200
+@@ -727,7 +727,7 @@
+         mvwaddstr(netwin, netwin->_maxy, netwin->_maxx - 14, ptxt);
+     }
+-#ifdef HAVE_GPS
++#if 0
+     if (!(lat == 0 && lon == 0 && alt == 0 && spd == 0 && fix == 0)) {
+@@ -1496,51 +1496,6 @@
+         snprintf(output, print_width, "Networks: %d", (int) details_network->networks.size());
+         kwin->text.push_back(output);
+-        if (details_network->virtnet->gps_fixed != -1) {
+-            if ((details_network->virtnet->min_lat == 90) && (details_network->virtnet->min_lon == 180) &&
+-                (details_network->virtnet->max_lat == -90) && (details_network->virtnet->max_lon == -180)) {
+-                   snprintf(output, print_width, "Min Loc : N/A");
+-                   kwin->text.push_back(output);
+-                   snprintf(output, print_width, "Max Loc : N/A");
+-                   kwin->text.push_back(output);
+-                   snprintf(output, print_width, "Range   : N/A");
+-                   kwin->text.push_back(output);
+-            }
+-          else {
+-                snprintf(output, print_width, "Min Loc : Lat %f Lon %f Alt %f Spd %f",
+-                         details_network->virtnet->min_lat, details_network->virtnet->min_lon,
+-                         metric ? details_network->virtnet->min_alt / 3.3 : details_network->virtnet->min_alt,
+-                         metric ? details_network->virtnet->min_spd * 1.6093 : details_network->virtnet->min_spd);
+-                kwin->text.push_back(output);
+-                snprintf(output, print_width, "Max Loc : Lat %f Lon %f Alt %f Spd %f",
+-                         details_network->virtnet->max_lat, details_network->virtnet->max_lon,
+-                         metric ? details_network->virtnet->max_alt / 3.3 : details_network->virtnet->max_alt,
+-                         metric ? details_network->virtnet->max_spd * 1.6093 : details_network->virtnet->max_spd);
+-                kwin->text.push_back(output);
+-
+-                double diagdist = GPSD::EarthDistance(details_network->virtnet->min_lat,
+-                                                      details_network->virtnet->min_lon,
+-                                                      details_network->virtnet->max_lat,
+-                                                      details_network->virtnet->max_lon);
+-
+-                if (finite(diagdist)) {
+-                    if (metric) {
+-                        if (diagdist < 1000)
+-                            snprintf(output, print_width, "Range    : %.3f meters", diagdist);
+-                        else
+-                            snprintf(output, print_width, "Range   : %.3f kilometers", diagdist / 1000);
+-                    } else {
+-                        diagdist *= 3.3;
+-                        if (diagdist < 5280)
+-                            snprintf(output, print_width, "Range   : %.3f feet", diagdist);
+-                        else
+-                            snprintf(output, print_width, "Range   : %.3f miles", diagdist / 5280);
+-                    }
+-                    kwin->text.push_back(output);
+-                }
+-          }
+-        }
+-
+         if (details_network->virtnet->carrier_set & (1 << (int) carrier_80211b)) {
+             snprintf(output, print_width, "Carrier : IEEE 802.11b");
+             kwin->text.push_back(output);
+@@ -1853,49 +1808,6 @@
+                      dnet->ipdata.range_ip[2], dnet->ipdata.range_ip[3]);
+             kwin->text.push_back(output);
+         }
+-    
+-        if (dnet->gps_fixed != -1) {
+-            if ((dnet->min_lat == 90) && (dnet->min_lon == 180) &&
+-              (dnet->max_lat == -90) && (dnet->max_lon == -180)) {
+-                   snprintf(output, print_width, "Min Loc : N/A");
+-                   kwin->text.push_back(output);
+-                   snprintf(output, print_width, "Max Loc : N/A");
+-                   kwin->text.push_back(output);
+-                   snprintf(output, print_width, "Range   : N/A");
+-                   kwin->text.push_back(output);
+-          }
+-          else {
+-                snprintf(output, print_width, "Min Loc : Lat %f Lon %f Alt %f Spd %f",
+-                         dnet->min_lat, dnet->min_lon,
+-                         metric ? dnet->min_alt / 3.3 : dnet->min_alt,
+-                         metric ? dnet->min_spd * 1.6093 : dnet->min_spd);
+-                kwin->text.push_back(output);
+-                snprintf(output, print_width, "Max Loc : Lat %f Lon %f Alt %f Spd %f",
+-                         dnet->max_lat, dnet->max_lon,
+-                         metric ? dnet->max_alt / 3.3 : dnet->max_alt,
+-                         metric ? dnet->max_spd * 1.6093 : dnet->max_spd);
+-                kwin->text.push_back(output);
+-
+-                double diagdist = GPSD::EarthDistance(dnet->min_lat, dnet->min_lon,
+-                                                  dnet->max_lat, dnet->max_lon);
+-
+-                if (finite(diagdist)) {
+-                    if (metric) {
+-                        if (diagdist < 1000)
+-                            snprintf(output, print_width, "Range    : %f meters", diagdist);
+-                        else
+-                            snprintf(output, print_width, "Range   : %f kilometers", diagdist / 1000);
+-                    } else {
+-                        diagdist *= 3.3;
+-                        if (diagdist < 5280)
+-                            snprintf(output, print_width, "Range   : %f feet", diagdist);
+-                        else
+-                            snprintf(output, print_width, "Range   : %f miles", diagdist / 5280);
+-                    }
+-                    kwin->text.push_back(output);
+-                }
+-          }
+-        }
+     }
+     // Now we just use the text printer to handle the rest for us
+@@ -1903,184 +1815,6 @@
+     return TextPrinter(in_window);
+ }
+-int PanelFront::GpsPrinter(void *in_window) {
+-    kis_window *kwin = (kis_window *) in_window;
+-
+-    char output[1024];
+-    kwin->text.clear();
+-
+-      if (details_network == NULL) {
+-              kwin->text.push_back("The network or group being displayed");
+-              kwin->text.push_back("has been deleted.  Please select a ");
+-              kwin->text.push_back("different network.");
+-              return TextPrinter(in_window);
+-      }
+-
+-    wireless_network *dnet = details_network->virtnet;
+-
+-    int print_width = kwin->print_width;
+-    if (print_width > 1024)
+-        print_width = 1023;
+-
+-    if (print_width < 32) {
+-        kwin->text.push_back("Display not wide enough");
+-        return TextPrinter(in_window);
+-    }
+-
+-    if (dnet->aggregate_points == 0) {
+-        kwin->text.push_back("No GPS data.");
+-        return TextPrinter(in_window);
+-    }
+-
+-    float center_lat, center_lon;
+-
+-    // We hijack the "selected" field as a toggle
+-    if (kwin->selected == 1) {
+-        center_lat = dnet->best_lat;
+-        center_lon = dnet->best_lon;
+-    } else {
+-        center_lat = dnet->aggregate_lat / dnet->aggregate_points;
+-        center_lon = dnet->aggregate_lon / dnet->aggregate_points;
+-    }
+-
+-    // Get bearing to the center
+-    float center_angle = GPSD::CalcHeading(center_lat, center_lon, lat, lon);
+-
+-    float difference_angle = heading - center_angle;
+-    if (difference_angle < 0)
+-        difference_angle += 360;
+-
+-    double diagdist = GPSD::EarthDistance(lat, lon, center_lat, center_lon);
+-
+-    // Now we know everything - where we are, where we are headed, where we SHOULD be headed
+-    // to get to the supposed center of the network, how far it is, and the orientation on our
+-    // compass to get to it.  Time to start drawing our output.
+-
+-    char compass[5][10];
+-    memset(compass, 0, sizeof(char) * 5 * 10);
+-
+-    // |  41.12345x-74.12345     .-|-/    |
+-    // | Bearing:               /  |/ \   |
+-    // |  123.23 degrees       |   O   |  |
+-    // |                        \   \ /   |
+-    // | Estimated center:       '---\    |
+-
+-
+-    // Find the orientation on our compass:
+-    if (difference_angle > 330 || difference_angle <= 22) {
+-        snprintf(compass[0], 10, "  .-|-.  ");
+-        snprintf(compass[1], 10, " /  |  \\ ");
+-        snprintf(compass[2], 10, "|   O   |");
+-        snprintf(compass[3], 10, " \\     / ");
+-        snprintf(compass[4], 10, "  '---'  ");
+-    } else if (difference_angle > 22 && difference_angle <= 66) {
+-        snprintf(compass[0], 10, "  .---/  ");
+-        snprintf(compass[1], 10, " /   / \\ ");
+-        snprintf(compass[2], 10, "|   O   |");
+-        snprintf(compass[3], 10, " \\     / ");
+-        snprintf(compass[4], 10, "  '---'  ");
+-    } else if (difference_angle > 66 && difference_angle <= 110) {
+-        snprintf(compass[0], 10, "  .---.  ");
+-        snprintf(compass[1], 10, " /     \\ ");
+-        snprintf(compass[2], 10, "|   O----");
+-        snprintf(compass[3], 10, " \\     / ");
+-        snprintf(compass[4], 10, "  '---'  ");
+-    } else if (difference_angle > 110 && difference_angle <= 154) {
+-        snprintf(compass[0], 10, "  .---.  ");
+-        snprintf(compass[1], 10, " /     \\ ");
+-        snprintf(compass[2], 10, "|   O   |");
+-        snprintf(compass[3], 10, " \\   \\ / ");
+-        snprintf(compass[4], 10, "  '---\\  ");
+-    } else if (difference_angle > 154 && difference_angle <= 198) {
+-        snprintf(compass[0], 10, "  .---.  ");
+-        snprintf(compass[1], 10, " /     \\ ");
+-        snprintf(compass[2], 10, "|   O   |");
+-        snprintf(compass[3], 10, " \\  |  / ");
+-        snprintf(compass[4], 10, "  '-|-'  ");
+-    } else if (difference_angle > 198 && difference_angle <= 242) {
+-        snprintf(compass[0], 10, "  .---.  ");
+-        snprintf(compass[1], 10, " /     \\ ");
+-        snprintf(compass[2], 10, "|   O   |");
+-        snprintf(compass[3], 10, " \\ /   / ");
+-        snprintf(compass[4], 10, "  /---'  ");
+-    } else if (difference_angle > 242 && difference_angle <= 286) {
+-        snprintf(compass[0], 10, "  .---.  ");
+-        snprintf(compass[1], 10, " /     \\ ");
+-        snprintf(compass[2], 10, "----O   |");
+-        snprintf(compass[3], 10, " \\     / ");
+-        snprintf(compass[4], 10, "  '---'  ");
+-    } else if (difference_angle > 286 && difference_angle <= 330) {
+-        snprintf(compass[0], 10, "  \\---.  ");
+-        snprintf(compass[1], 10, " / \\   \\ ");
+-        snprintf(compass[2], 10, "|   O   |");
+-        snprintf(compass[3], 10, " \\     / ");
+-        snprintf(compass[4], 10, "  '---'  ");
+-    } else {
+-        snprintf(compass[0], 10, "%f\n", difference_angle);
+-    }
+-
+-
+-    // - Network GPS ---------------------|
+-    // | Current:                         |
+-    // |  41.12345x-74.12345     .-|-.    |
+-    // | Bearing:               /  |  \   |
+-    // |  123.23 degrees       |   O   |  |
+-    // |                        \   \ /   |
+-    // | Estimated center:       '---\    |
+-    // | -73.12345x43.12345               |
+-    // |                        120 feet  |
+-    // ------------------------------------
+-    char textfrag[23];
+-
+-    snprintf(output, print_width, "Current:");
+-    kwin->text.push_back(output);
+-
+-    snprintf(textfrag, 23, "%.3f x %.3f", lat, lon);
+-    snprintf(output, print_width, "%-22s%s", textfrag, compass[0]);
+-    kwin->text.push_back(output);
+-
+-    snprintf(textfrag, 23, " Bearing:");
+-    snprintf(output, print_width, "%-22s%s", textfrag, compass[1]);
+-    kwin->text.push_back(output);
+-
+-    snprintf(textfrag, 23, " %.2f*", heading);
+-    snprintf(output, print_width, "%-22s%s", textfrag, compass[2]);
+-    kwin->text.push_back(output);
+-
+-    snprintf(textfrag, 23, " ");
+-    snprintf(output, print_width, "%-22s%s", textfrag, compass[3]);
+-    kwin->text.push_back(output);
+-
+-    if (kwin->selected == 1)
+-        snprintf(textfrag, 23, "Strongest signal:");
+-    else
+-        snprintf(textfrag, 23, "Estimated Center:");
+-    snprintf(output, print_width, "%-22s%s", textfrag, compass[4]);
+-    kwin->text.push_back(output);
+-
+-    snprintf(textfrag, 23, "%.3f x %.3f", center_lat, center_lon);
+-    snprintf(output, print_width, "%-22s%.2f*", textfrag, difference_angle);
+-    kwin->text.push_back(output);
+-
+-    if (metric) {
+-        if (diagdist < 1000)
+-            snprintf(textfrag, 23, "%.2f m", diagdist);
+-        else
+-            snprintf(textfrag, 23, "%.2f km", diagdist / 1000);
+-    } else {
+-        diagdist *= 3.3;
+-        if (diagdist < 5280)
+-            snprintf(textfrag, 23, "%.2f ft", diagdist);
+-        else
+-            snprintf(textfrag, 23, "%.2f mi", diagdist / 5280);
+-    }
+-
+-    snprintf(output, print_width, "%-22s%s", "", textfrag);
+-    kwin->text.push_back(output);
+-
+-    return TextPrinter(in_window);
+-}
+-
+ int PanelFront::PackPrinter(void *in_window) {
+     kis_window *kwin = (kis_window *) in_window;
+@@ -3049,53 +2783,6 @@
+              details_client->ipdata.ip[2], details_client->ipdata.ip[3]);
+     kwin->text.push_back(output);
+-    if (details_client->gps_fixed != -1) {
+-        kwin->text.push_back("");
+-
+-        if ((details_client->min_lat == 90) && (details_client->min_lon == 180) &&
+-            (details_client->max_lat == -90) && (details_client->max_lon == -180)) {
+-               snprintf(output, print_width, "Min Loc : N/A");
+-               kwin->text.push_back(output);
+-               snprintf(output, print_width, "Max Loc : N/A");
+-               kwin->text.push_back(output);
+-               snprintf(output, print_width, "Range   : N/A");
+-               kwin->text.push_back(output);
+-        }
+-      else {
+-            snprintf(output, print_width, "Min Loc : Lat %f Lon %f Alt %f Spd %f",
+-                     details_client->min_lat, details_client->min_lon,
+-                     metric ? details_client->min_alt / 3.3 : details_client->min_alt,
+-                     metric ? details_client->min_spd * 1.6093 : details_client->min_spd);
+-            kwin->text.push_back(output);
+-            snprintf(output, print_width, "Max Loc : Lat %f Lon %f Alt %f Spd %f",
+-                     details_client->max_lat, details_client->max_lon,
+-                     metric ? details_client->max_alt / 3.3 : details_client->max_alt,
+-                     metric ? details_client->max_spd * 1.6093 : details_client->max_spd);
+-            kwin->text.push_back(output);
+-
+-            double diagdist = GPSD::EarthDistance(details_client->min_lat,
+-                                                  details_client->min_lon,
+-                                                  details_client->max_lat,
+-                                                  details_client->max_lon);
+-
+-            if (finite(diagdist)) {
+-                if (metric) {
+-                    if (diagdist < 1000)
+-                        snprintf(output, print_width, "Range    : %f meters", diagdist);
+-                    else
+-                        snprintf(output, print_width, "Range    : %f kilometers", diagdist / 1000);
+-                } else {
+-                    diagdist *= 3.3;
+-                    if (diagdist < 5280)
+-                        snprintf(output, print_width, "Range   : %f feet", diagdist);
+-                    else
+-                        snprintf(output, print_width, "Range   : %f miles", diagdist / 5280);
+-                }
+-                kwin->text.push_back(output);
+-            }
+-        }
+-        kwin->text.push_back("");
+-    }
+     snprintf(output, print_width, "Packets :");
+     kwin->text.push_back(output);
+diff -urN kismet.dev/panelfront_input.cc kismet.dev2/panelfront_input.cc
+--- kismet.dev/panelfront_input.cc     2005-08-16 03:22:51.000000000 +0200
++++ kismet.dev2/panelfront_input.cc    2005-08-23 01:59:25.665216904 +0200
+@@ -300,16 +300,9 @@
+         break;
+     case 'f':
+     case 'F':
+-        if (sortby != sort_auto && last_displayed.size() > 0) {
+-            details_network = last_displayed[kwin->selected];
+-            SpawnWindow("Network Location", &PanelFront::GpsPrinter, &PanelFront::GpsInput, 8, 34);
+-        } else {
+-            WriteStatus("Cannot view network GPS info in autofit sort mode.  Sort by a different method.");
+-        }
+         break;
+     case 'm':
+     case 'M':
+-        MuteToggle();
+         break;
+     case 'e':
+     case 'E':
+@@ -447,7 +440,6 @@
+     switch(in_chr) {
+     case 'm':
+     case 'M':
+-        MuteToggle();
+         break;
+     case 'p':
+     case 'P':
+@@ -546,33 +538,6 @@
+     return 1;
+ }
+-int PanelFront::GpsInput(void *in_window, int in_chr) {
+-    kis_window *kwin = (kis_window *) in_window;
+-
+-    switch (in_chr) {
+-    case 's':
+-    case 'S':
+-        kwin->selected = 1;
+-        break;
+-    case 'c':
+-    case 'C':
+-        kwin->selected = 0;
+-        break;
+-    case 'h':
+-    case 'H':
+-        SpawnHelp(KismetHelpGps);
+-        break;
+-    case 'x':
+-    case 'X':
+-    case 'q':
+-    case 'Q':
+-        return 0;
+-        break;
+-    }
+-
+-    return 1;
+-}
+-
+ int PanelFront::RateInput(void *in_window, int in_chr) {
+     switch (in_chr) {
+     case 'h':
+@@ -645,24 +610,6 @@
+     return 1;
+ }
+-void PanelFront::MuteToggle() {
+-    if (muted) {
+-        speech = old_speech;
+-        sound = old_sound;
+-        muted = 0;
+-        WriteStatus("Restoring sound");
+-    } else if (sound != 0 || speech != 0) {
+-        old_speech = speech;
+-        old_sound = sound;
+-        sound = 0;
+-        speech = 0;
+-        muted = 1;
+-        WriteStatus("Muting sound");
+-    } else if (sound == 0 && speech == 0) {
+-        WriteStatus("Sound not enabled.");
+-    }
+-}
+-
+ int PanelFront::AlertInput(void *in_window, int in_chr) {
+     kis_window *kwin = (kis_window *) in_window;
+diff -urN kismet.dev/pcapsource.cc kismet.dev2/pcapsource.cc
+--- kismet.dev/pcapsource.cc   2005-08-23 01:03:45.652632608 +0200
++++ kismet.dev2/pcapsource.cc  2005-08-23 01:59:25.667216600 +0200
+@@ -343,11 +343,6 @@
+     packet->moddata = moddata;
+     packet->modified = 0;
+-    if (gpsd != NULL) {
+-        gpsd->FetchLoc(&packet->gps_lat, &packet->gps_lon, &packet->gps_alt,
+-                       &packet->gps_spd, &packet->gps_heading, &packet->gps_fix);
+-    }
+-
+     if (datalink_type == DLT_PRISM_HEADER) {
+         ret = Prism2KisPack(packet, data, moddata);
+     } else if (datalink_type == KDLT_BSD802_11) {
+@@ -1146,133 +1141,6 @@
+ // Monitor commands
+ #ifdef HAVE_LINUX_WIRELESS
+-// Cisco uses its own config file in /proc to control modes
+-int monitor_cisco(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
+-    FILE *cisco_config;
+-    char cisco_path[128];
+-
+-    linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
+-    (*in_if) = ifparm;
+-
+-    if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
+-        return -1;
+-    }
+-
+-    if (Iwconfig_Get_SSID(in_dev, in_err, ifparm->essid) < 0)
+-        return -1;
+-
+-    if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
+-        return -1;
+-
+-    if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
+-        return -1;
+-
+-    if (Ifconfig_Delta_Flags(in_dev, in_err, IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
+-        return -1;
+-
+-    // Try the iwpriv
+-    if (Iwconfig_Set_IntPriv(in_dev, "setRFMonitor", 1, 0, in_err) >= 0) {
+-        return 0;
+-    }
+-
+-    // Zero the ssid - nonfatal
+-    Iwconfig_Set_SSID(in_dev, in_err, NULL);
+-   
+-    // Build the proc control path
+-    snprintf(cisco_path, 128, "/proc/driver/aironet/%s/Config", in_dev);
+-
+-    if ((cisco_config = fopen(cisco_path, "w")) == NULL) {
+-        snprintf(in_err, STATUS_MAX, "Unable to open cisco control file '%s' %d:%s",
+-                 cisco_path, errno, strerror(errno));
+-        return -1;
+-    }
+-
+-    fprintf(cisco_config, "Mode: r\n");
+-    fprintf(cisco_config, "Mode: y\n");
+-    fprintf(cisco_config, "XmitPower: 1\n");
+-
+-    fclose(cisco_config);
+-
+-    // Channel can't be set on cisco with these drivers.
+-
+-    return 0;
+-}
+-
+-int unmonitor_cisco(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
+-    linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
+-    int ret = -1;
+-
+-    // Try the iwpriv
+-    if (Iwconfig_Set_IntPriv(in_dev, "setRFMonitor", 0, 0, in_err) >= 0) {
+-        // If we're the new drivers, unmonitor
+-        if (Ifconfig_Set_Flags(in_dev, in_err, ifparm->flags) < 0) {
+-            return -1;
+-        }
+-
+-        // Reset the SSID since monitor mode nukes it
+-        if (Iwconfig_Set_SSID(in_dev, in_err, ifparm->essid) < 0)
+-            return -1;
+-
+-        if (ifparm->channel > 0) {
+-            if (Iwconfig_Set_Channel(in_dev, ifparm->channel, in_err) < 0)
+-                return -1;
+-        }
+-
+-        ret = 1;
+-    }
+-
+-    free(ifparm);
+-
+-    return ret;
+-}
+-
+-// Cisco uses its own config file in /proc to control modes
+-//
+-// I was doing this with ioctls but that seems to cause lockups while
+-// this method doesn't.  I don't think I like these drivers.
+-int monitor_cisco_wifix(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
+-    FILE *cisco_config;
+-    char cisco_path[128];
+-    vector<string> devbits = StrTokenize(in_dev, ":");
+-
+-    if (devbits.size() < 2) {
+-        snprintf(in_err, STATUS_MAX, "Invalid device pair '%s'.  Proper device "
+-                               "for cisco_wifix is eth?:wifi?.", in_dev);
+-        return -1;
+-    }
+-
+-    // Bring the device up, zero its ip, and set promisc
+-    if (Ifconfig_Delta_Flags(devbits[0].c_str(), in_err, 
+-                             IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
+-        return -1;
+-    if (Ifconfig_Delta_Flags(devbits[1].c_str(), in_err, 
+-                             IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
+-        return -1;
+-
+-    // Zero the ssid, nonfatally
+-    Iwconfig_Set_SSID(devbits[0].c_str(), in_err, NULL);
+-    Iwconfig_Set_SSID(devbits[1].c_str(), in_err, NULL);
+-    
+-    // Build the proc control path
+-    snprintf(cisco_path, 128, "/proc/driver/aironet/%s/Config", devbits[0].c_str());
+-
+-    if ((cisco_config = fopen(cisco_path, "w")) == NULL) {
+-        snprintf(in_err, STATUS_MAX, "Unable to open cisco control file '%s' %d:%s",
+-                 cisco_path, errno, strerror(errno));
+-        return -1;
+-    }
+-
+-    fprintf(cisco_config, "Mode: r\n");
+-    fprintf(cisco_config, "Mode: y\n");
+-    fprintf(cisco_config, "XmitPower: 1\n");
+-
+-    fclose(cisco_config);
+-
+-    // Channel can't be set on cisco with these drivers.
+-
+-    return 0;
+-}
+-
+ // Hostap uses iwpriv and iwcontrol settings to control monitor mode
+ int monitor_hostap(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
+     int ret;
+@@ -1421,134 +1289,6 @@
+     return 1;
+ }
+-
+-// Acx100 uses the packhdr iwpriv control to set link state, rest is normal
+-int monitor_acx100(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
+-    int ret;
+-
+-    // Allocate a tracking record for the interface settings and remember our
+-    // setup
+-    linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
+-    (*in_if) = ifparm;
+-
+-    if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
+-        return -1;
+-    }
+-
+-    if (Iwconfig_Get_SSID(in_dev, in_err, ifparm->essid) < 0)
+-        return -1;
+-
+-    if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
+-        return -1;
+-
+-    if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
+-        return -1;
+-
+-    // it looks like an orinoco now, apparently
+-    if ((ret = Iwconfig_Set_IntPriv(in_dev, "monitor", 1, initch, in_err)) < 0) {
+-        if (ret == -2)
+-            snprintf(in_err, 1024, "Could not find 'monitor' private ioctl "
+-                     "Make sure you have the latest ACX100 development release.");
+-        return -1;
+-    }
+-
+-    if (chancontrol_wext(in_dev, initch, in_err, NULL) < 0)
+-        return -1;
+-
+-    return 0;
+-}
+-
+-int unmonitor_acx100(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
+-    // Restore the IP settings
+-    linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
+-
+-    if (Ifconfig_Set_Flags(in_dev, in_err, ifparm->flags) < 0) {
+-        return -1;
+-    }
+-
+-    Iwconfig_Set_IntPriv(in_dev, "monitor", 0, ifparm->channel, in_err);
+-    Iwconfig_Set_Mode(in_dev, in_err, ifparm->mode);
+-
+-    if (Iwconfig_Set_SSID(in_dev, in_err, ifparm->essid) < 0)
+-        return -1;
+-    
+-    free(ifparm);
+-
+-    return 1;
+-}
+-
+-int monitor_admtek(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
+-    // Allocate a tracking record for the interface settings and remember our
+-    // setup
+-    linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
+-    (*in_if) = ifparm;
+-
+-    // Try to figure out the name so we know if we have fcs bytes or not
+-    char iwname[IFNAMSIZ+1];
+-    if (Iwconfig_Get_Name(in_dev, in_err, iwname) < 0)
+-        return -1;
+-
+-    if (strncmp(iwname, "IEEE 802.11b", IFNAMSIZ) == 0) {
+-        // Looks like the GPL driver, we need to adjust the fcsbytes
+-        PcapSource *psrc = (PcapSource *) in_ext;
+-        psrc->fcsbytes = 4;
+-    }
+-
+-    if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
+-        return -1;
+-    }
+-
+-    if ((ifparm->flags & IFF_UP)) {
+-        if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
+-            return -1;
+-
+-        if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
+-            return -1;
+-
+-        if (Iwconfig_Get_SSID(in_dev, in_err, ifparm->essid) < 0)
+-            return -1;
+-    
+-    } else {
+-        ifparm->channel = -1;
+-        ifparm->mode = -1;
+-    }
+-
+-    int ret = monitor_wext(in_dev, initch, in_err, in_if, in_ext);
+-
+-    if (ret < 0 && ret != -2)
+-        return ret;
+-
+-    if (Iwconfig_Set_SSID(in_dev, in_err, "") < 0)
+-        return -1;
+-    
+-    return 0;
+-}
+-
+-int unmonitor_admtek(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
+-    linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
+-
+-    if (unmonitor_wext(in_dev, initch, in_err, in_if, in_ext))
+-        return -1;
+-
+-    if (Iwconfig_Set_SSID(in_dev, in_err, ifparm->essid) < 0)
+-        return -1;
+-   
+-    return 1;
+-}
+-// vtar5k iwpriv control to set link state, rest is normal
+-int monitor_vtar5k(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
+-    // Set the prism iwpriv control to 1
+-    if (Iwconfig_Set_IntPriv(in_dev, "prism", 1, 0, in_err) < 0) {
+-        return -1;
+-    }
+-    
+-    // The rest is standard wireless extensions
+-    if (monitor_wext(in_dev, initch, in_err, in_if, in_ext) < 0)
+-        return -1;
+-
+-    return 0;
+-}
+-
+ // Madwifi stuff uses iwpriv mode
+ int monitor_madwifi_a(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
+     // Allocate a tracking record for the interface settings and remember our
+@@ -1726,89 +1466,6 @@
+     return unmonitor_wext(in_dev, initch, in_err, in_if, in_ext);
+ }
+-
+-int monitor_ipw2100(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
+-    // Allocate a tracking record for the interface settings and remember our
+-    // setup
+-    linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
+-    (*in_if) = ifparm;
+-
+-    if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
+-        return -1;
+-    }
+-
+-    if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
+-        return -1;
+-
+-    if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
+-        return -1;
+-
+-    // Call the normal monitor mode
+-    return (monitor_wext(in_dev, initch, in_err, in_if, in_ext));
+-}
+-
+-int unmonitor_ipw2100(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
+-    // Restore initial monitor header
+-    // linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
+-
+-    linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
+-
+-    if (Ifconfig_Set_Flags(in_dev, in_err, ifparm->flags) < 0) {
+-        return -1;
+-    }
+-
+-    if (Iwconfig_Set_Mode(in_dev, in_err, ifparm->mode) < 0)
+-        return -1;
+-
+-    free(ifparm);
+-
+-    return 1;
+-}
+-
+-int monitor_ipw2200(const char *in_dev, int initch, char *in_err, 
+-                                      void **in_if, void *in_ext) {
+-    // Allocate a tracking record for the interface settings and remember our
+-    // setup
+-    linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
+-    (*in_if) = ifparm;
+-
+-    if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
+-        return -1;
+-    }
+-
+-    if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
+-        return -1;
+-
+-    if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
+-        return -1;
+-
+-    // Call the normal monitor mode
+-    return (monitor_wext(in_dev, initch, in_err, in_if, in_ext));
+-}
+-
+-int unmonitor_ipw2200(const char *in_dev, int initch, char *in_err, 
+-                                        void **in_if, void *in_ext) {
+-    // Restore initial monitor header
+-    // linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
+-
+-    linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
+-
+-    if (Ifconfig_Set_Flags(in_dev, in_err, ifparm->flags) < 0) {
+-        return -1;
+-    }
+-
+-    if (Iwconfig_Set_Mode(in_dev, in_err, ifparm->mode) < 0)
+-        return -1;
+-
+-      // James says this wants to be set to channel 0 for proper scanning operation
+-      if (Iwconfig_Set_Channel(in_dev, 0, in_err) < 0)
+-              return -1;
+-
+-    free(ifparm);
+-
+-    return 1;
+-}
+-
+ // "standard" wireless extension monitor mode
+ int monitor_wext(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
+     int mode;
+@@ -1870,108 +1527,6 @@
+ #endif
+ #ifdef SYS_LINUX
+-// wlan-ng modern standard
+-int monitor_wlanng(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
+-    // I really didn't want to do this...
+-    char cmdline[2048];
+-
+-    // Sanitize the device just to be safe.  The ifconfig should fail if
+-    // the device is invalid, but why take risks
+-    for (unsigned int x = 0; x < strlen(in_dev); x++) {
+-        if (!isalnum(in_dev[x])) {
+-            snprintf(in_err, STATUS_MAX, "Invalid device '%s'", in_dev);
+-            return -1;
+-        }
+-    }
+-    
+-    if (Ifconfig_Delta_Flags(in_dev, in_err, IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
+-        return -1;
+-
+-    // Enable the interface
+-    snprintf(cmdline, 2048, "wlanctl-ng %s lnxreq_ifstate ifstate=enable >/dev/null 2>/dev/null", in_dev);
+-    if (RunSysCmd(cmdline) < 0) {
+-        snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
+-        return -1;
+-    }
+-
+-    // Turn off WEP
+-    snprintf(cmdline, 2048, "wlanctl-ng %s dot11req_mibset "
+-             "mibattribute=dot11PrivacyInvoked=false >/dev/null 2>/dev/null", in_dev);
+-    if (RunSysCmd(cmdline) < 0) {
+-        snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
+-        return -1;
+-    }
+-
+-    // Don't exclude packets
+-    snprintf(cmdline, 2048, "wlanctl-ng %s dot11req_mibset "
+-             "mibattribute=dot11ExcludeUnencrypted=false >/dev/null 2>/dev/null", in_dev);
+-    if (RunSysCmd(cmdline) < 0) {
+-        snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
+-        return -1;
+-    }
+-
+-    // Turn on rfmon on the initial channel
+-    snprintf(cmdline, 2048, "wlanctl-ng %s lnxreq_wlansniff channel=%d "
+-             "enable=true prismheader=true >/dev/null 2>/dev/null", in_dev, initch);
+-    if (RunSysCmd(cmdline) < 0) {
+-        snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
+-        return -1;
+-    }
+-    
+-    return 0;
+-}
+-
+-// wlan-ng avs
+-int monitor_wlanng_avs(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
+-    // I really didn't want to do this...
+-    char cmdline[2048];
+-
+-    // Sanitize the device just to be safe.  The ifconfig should fail if
+-    // the device is invalid, but why take risks
+-    for (unsigned int x = 0; x < strlen(in_dev); x++) {
+-        if (!isalnum(in_dev[x])) {
+-            snprintf(in_err, STATUS_MAX, "Invalid device '%s'", in_dev);
+-            return -1;
+-        }
+-    }
+-
+-    if (Ifconfig_Delta_Flags(in_dev, in_err, IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
+-        return -1;
+-
+-    // Enable the interface
+-    snprintf(cmdline, 2048, "wlanctl-ng %s lnxreq_ifstate ifstate=enable >/dev/null 2>/dev/null", in_dev);
+-    if (RunSysCmd(cmdline) < 0) {
+-        snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
+-        return -1;
+-    }
+-
+-    // Turn off WEP
+-    snprintf(cmdline, 2048, "wlanctl-ng %s dot11req_mibset "
+-             "mibattribute=dot11PrivacyInvoked=false >/dev/null 2>/dev/null", in_dev);
+-    if (RunSysCmd(cmdline) < 0) {
+-        snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
+-        return -1;
+-    }
+-
+-    // Don't exclude packets
+-    snprintf(cmdline, 2048, "wlanctl-ng %s dot11req_mibset "
+-             "mibattribute=dot11ExcludeUnencrypted=false >/dev/null 2>/dev/null", in_dev);
+-    if (RunSysCmd(cmdline) < 0) {
+-        snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
+-        return -1;
+-    }
+-
+-    // Turn on rfmon on the initial channel
+-    snprintf(cmdline, 2048, "wlanctl-ng %s lnxreq_wlansniff channel=%d prismheader=false "
+-             "wlanheader=true stripfcs=false keepwepflags=false enable=true >/dev/null 2>/dev/null", in_dev, initch);
+-    if (RunSysCmd(cmdline) < 0) {
+-        snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
+-        return -1;
+-    }
+-    
+-    return 0;
+-}
+-
+ int monitor_wrt54g(const char *in_dev, int initch, char *in_err, void **in_if, 
+                                  void *in_ext) {
+     char cmdline[2048];
+@@ -1981,7 +1536,7 @@
+                       snprintf(in_err, 1024, "Unable to set mode using 'iwpriv %s set_monitor 1'. "
+                                        "Some custom firmware images require you to specify the origial "
+                                        "device and a new dynamic device and use the iwconfig controls. "
+-                                       "see the README for how to configure your capture source.");
++                                       "see the README for how to configure your capture source.", in_dev);
+                       return -1;
+               }
+@@ -1998,7 +1553,7 @@
+                       snprintf(in_err, 1024, "Unable to set mode using 'iwpriv %s set_monitor 0'. "
+                                        "Some custom firmware images require you to specify the origial "
+                                        "device and a new dynamic device and use the iwconfig controls. "
+-                                       "see the README for how to configure your capture source.");
++                                       "see the README for how to configure your capture source.", in_dev);
+                       return -1;
+               }
+@@ -2244,75 +1799,6 @@
+     return 0;
+ }
+-int chancontrol_ipw2100(const char *in_dev, int in_ch, char *in_err, void *in_ext) {
+-    // Introduce a slight delay to let the driver settle, a la orinoco.  I don't
+-    // like doing this at all since it introduces hiccups into the channel control
+-    // process, but....
+-
+-    int ret = 0;
+-
+-    ret = chancontrol_wext(in_dev, in_ch, in_err, in_ext);
+-    usleep(5000);
+-
+-    return ret;
+-}
+-
+-int chancontrol_ipw2200(const char *in_dev, int in_ch, char *in_err, void *in_ext) {
+-      // Lets see if this really needs the channel change delay like the 2100 did
+-    int ret = 0;
+-
+-    ret = chancontrol_wext(in_dev, in_ch, in_err, in_ext);
+-      // Drop a tiny sleep in here to let the channel set settle, otherwise we
+-      // run the risk of the card freaking out
+-      usleep(7000);
+-
+-    return ret;
+-}
+-
+-#endif
+-
+-#ifdef SYS_LINUX
+-int chancontrol_wlanng(const char *in_dev, int in_ch, char *in_err, void *in_ext) {
+-    // I really didn't want to do this...
+-    char cmdline[2048];
+-
+-    // Turn on rfmon on the initial channel
+-    snprintf(cmdline, 2048, "wlanctl-ng %s lnxreq_wlansniff channel=%d enable=true "
+-             "prismheader=true >/dev/null 2>&1", in_dev, in_ch);
+-    if (RunSysCmd(cmdline) < 0) {
+-        snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
+-        return -1;
+-    }
+-
+-    if (in_ext != NULL) {
+-        PcapSourceWlanng *src = (PcapSourceWlanng *) in_ext;
+-        src->last_channel = in_ch;
+-    }
+-    
+-    return 0;
+-}
+-
+-int chancontrol_wlanng_avs(const char *in_dev, int in_ch, char *in_err, void *in_ext) {
+-    // I really didn't want to do this...
+-    char cmdline[2048];
+-
+-    // Turn on rfmon on the initial channel
+-    snprintf(cmdline, 2048, "wlanctl-ng %s lnxreq_wlansniff channel=%d "
+-             "prismheader=false wlanheader=true stripfcs=false keepwepflags=false "
+-             "enable=true >/dev/null 2>&1", in_dev, in_ch);
+-
+-    if (RunSysCmd(cmdline) < 0) {
+-        snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
+-        return -1;
+-    }
+-
+-    if (in_ext != NULL) {
+-        PcapSourceWlanng *src = (PcapSourceWlanng *) in_ext;
+-        src->last_channel = in_ch;
+-    }
+-    
+-    return 0;
+-}
+ #endif
+ #ifdef SYS_OPENBSD
+diff -urN kismet.dev/tcpstreamer.cc kismet.dev2/tcpstreamer.cc
+--- kismet.dev/tcpstreamer.cc  2005-08-16 03:22:51.000000000 +0200
++++ kismet.dev2/tcpstreamer.cc 2005-08-23 01:59:25.668216448 +0200
+@@ -30,8 +30,6 @@
+     serv_fd = 0;
+     max_fd = 0;
+-
+-      gpsd = NULL;
+ }
+ TcpStreamer::~TcpStreamer()
+@@ -287,10 +285,6 @@
+     hdr.frame_len = (uint32_t) htonl(sizeof(struct stream_version_packet));
+     vpkt.drone_version = (uint16_t) htons(STREAM_DRONE_VERSION);
+-      if (gpsd != NULL)
+-              vpkt.gps_enabled = 1;
+-      else
+-              vpkt.gps_enabled = 0;
+     if (!FD_ISSET(in_fd, &client_fds))
+         return -1;
+diff -urN kismet.dev/tcpstreamer.h kismet.dev2/tcpstreamer.h
+--- kismet.dev/tcpstreamer.h   2005-08-16 03:22:51.000000000 +0200
++++ kismet.dev2/tcpstreamer.h  2005-08-23 01:59:25.669216296 +0200
+@@ -42,7 +42,6 @@
+ #include "ringbuf.h"
+ #include "packet.h"
+ #include "packetstream.h"
+-#include "gpsd.h"
+ // Global in kismet_drone.cc
+ extern int silent;
+@@ -76,9 +75,6 @@
+     int FetchDescriptor() { return serv_fd; }
+-    // Register the GPS server for us to use
+-    void AddGpstracker(GPSD *in_gpsd) { gpsd = in_gpsd; }
+-
+     void Kill(int in_fd);
+     int Poll(fd_set& in_rset, fd_set& in_wset);
+@@ -124,8 +120,6 @@
+     fd_set client_fds;
+     unsigned int max_fd;
+-
+-      GPSD *gpsd;
+ };
+ #endif
diff --git a/openwrt/package/kismet/patches/120-remove_sound.patch b/openwrt/package/kismet/patches/120-remove_sound.patch
deleted file mode 100644 (file)
index ca2737c..0000000
+++ /dev/null
@@ -1,1051 +0,0 @@
-diff -urN kismet-2005-04-R1.old/Makefile.in kismet-2005-04-R1.dev/Makefile.in
---- kismet-2005-04-R1.old/Makefile.in  2005-05-04 21:09:18.000000000 +0200
-+++ kismet-2005-04-R1.dev/Makefile.in  2005-05-04 21:19:26.000000000 +0200
-@@ -39,7 +39,7 @@
- DEPEND        = .depend
- # Objects
--PSO   = util.o ringbuf.o configfile.o speech.o ifcontrol.o iwcontrol.o packet.o \
-+PSO   = util.o ringbuf.o configfile.o ifcontrol.o iwcontrol.o packet.o \
-               pcapsource.o wtapfilesource.o \
-               dronesource.o packetsourcetracker.o kis_packsources.o \
-               wtapdump.o wtaplocaldump.o gpsdump.o airsnortdump.o fifodump.o \
-@@ -55,7 +55,7 @@
-               timetracker.o gpsd.o server_globals.o kismet_drone.o
- DRONE = kismet_drone
--NCO   = util.o configfile.o speech.o manuf.o tcpclient.o \
-+NCO   = util.o configfile.o manuf.o tcpclient.o \
-               frontend.o cursesfront.o \
-               panelfront.o panelfront_display.o panelfront_input.o \
-               gpsd.o getopt.o kismet_client.o 
-diff -urN kismet-2005-04-R1.old/kismet_client.cc kismet-2005-04-R1.dev/kismet_client.cc
---- kismet-2005-04-R1.old/kismet_client.cc     2005-04-03 07:33:42.000000000 +0200
-+++ kismet-2005-04-R1.dev/kismet_client.cc     2005-05-04 21:23:14.000000000 +0200
-@@ -28,7 +28,6 @@
- #include "cursesfront.h"
- #include "panelfront.h"
- #include "configfile.h"
--#include "speech.h"
- #ifndef exec_name
- char *exec_name;
-@@ -47,10 +46,6 @@
- char *configfile;
- char *uiconfigfile;
- char *server = NULL;
--int sound = -1;
--int speech = -1;
--int speech_encoding = 0;
--string speech_sentence_encrypted, speech_sentence_unencrypted;
- unsigned int metric = 0;
- unsigned int reconnect = 0;
-@@ -58,20 +53,9 @@
- string configdir, groupfile;
- FILE *group_file = NULL;
--// Pipe file descriptor pairs and fd's
--int soundpair[2];
--int speechpair[2];
--pid_t soundpid = -1, speechpid = -1;
--
- // Catch our interrupt
- void CatchShutdown(int sig) {
--    // Kill our sound players
--    if (soundpid > 0)
--        kill(soundpid, 9);
--    if (speechpid > 0)
--        kill(speechpid, 9);
--
-     if (group_track) {
-         if ((group_file = fopen(groupfile.c_str(), "w")) == NULL) {
-             fprintf(stderr, "WARNING: Unable to open '%s' for writing, groups will not be saved.\n",
-@@ -115,215 +99,6 @@
-     exit(0);
- }
--// Subprocess sound handler
--void SoundHandler(int *fds, const char *player, map<string, string> soundmap) {
--    int read_sock = fds[0];
--
--    close(fds[1]);
--
--    signal(SIGPIPE, PipeHandler);
--
--    fd_set rset;
--
--    char data[1024];
--
--    pid_t sndpid = -1;
--    int harvested = 1;
--
--    while (1) {
--        FD_ZERO(&rset);
--        FD_SET(read_sock, &rset);
--        char *end;
--
--        memset(data, 0, 1024);
--
--        if (harvested == 0) {
--            // We consider a wait error to be a sign that the child pid died
--            // so we flag it as harvested and keep on going
--            pid_t harvestpid = waitpid(sndpid, NULL, WNOHANG);
--            if (harvestpid == -1 || harvestpid == sndpid)
--                harvested = 1;
--        }
--
--        struct timeval tim;
--        tim.tv_sec = 1;
--        tim.tv_usec = 0;
--
--        if (select(read_sock + 1, &rset, NULL, NULL, &tim) < 0) {
--            if (errno != EINTR) {
--                exit(1);
--            }
--        }
--
--        if (FD_ISSET(read_sock, &rset)) {
--            int ret;
--            ret = read(read_sock, data, 1024);
--
--            // We'll die off if we get a read error, and we'll let kismet on the
--            // other side detact that it died
--            if (ret <= 0 && (errno != EAGAIN && errno != EPIPE))
--                exit(1);
--
--            if ((end = strstr(data, "\n")) == NULL)
--                continue;
--
--            end[0] = '\0';
--        }
--
--        if (data[0] == '\0')
--            continue;
--
--        // If we've harvested the process, spawn a new one and watch it
--        // instead.  Otherwise, we just let go of the data we read
--        if (harvested == 1) {
--            // Only take the first line
--            char *nl;
--            if ((nl = strchr(data, '\n')) != NULL)
--                *nl = '\0';
--
--            char snd[1024];
--
--            if (soundmap.size() == 0)
--                snprintf(snd, 1024, "%s", data);
--            if (soundmap.find(data) != soundmap.end())
--                snprintf(snd, 1024, "%s", soundmap[data].c_str());
--            else
--                continue;
--
--            char plr[1024];
--            snprintf(plr, 1024, "%s", player);
--
--            harvested = 0;
--            if ((sndpid = fork()) == 0) {
--                // Suppress errors
--                int nulfd = open("/dev/null", O_RDWR);
--                dup2(nulfd, 1);
--                dup2(nulfd, 2);
--
--                char * const echoarg[] = { plr, snd, NULL };
--                execve(echoarg[0], echoarg, NULL);
--            }
--        }
--
--        data[0] = '\0';
--    }
--}
--
--// Subprocess speech handler
--void SpeechHandler(int *fds, const char *player) {
--    int read_sock = fds[0];
--    close(fds[1]);
--
--    fd_set rset;
--
--    char data[1024];
--
--    pid_t sndpid = -1;
--    int harvested = 1;
--
--    while (1) {
--        FD_ZERO(&rset);
--        FD_SET(read_sock, &rset);
--        //char *end;
--
--        memset(data, 0, 1024);
--
--        struct timeval tim;
--        tim.tv_sec = 1;
--        tim.tv_usec = 0;
--
--        if (select(read_sock + 1, &rset, NULL, NULL, &tim) < 0) {
--            if (errno != EINTR) {
--                exit(1);
--            }
--        }
--
--        if (harvested == 0) {
--            // We consider a wait error to be a sign that the child pid died
--            // so we flag it as harvested and keep on going
--            pid_t harvestpid = waitpid(sndpid, NULL, WNOHANG);
--            if (harvestpid == -1 || harvestpid == sndpid)
--                harvested = 1;
--        }
--
--        if (FD_ISSET(read_sock, &rset)) {
--            int ret;
--            ret = read(read_sock, data, 1024);
--
--            // We'll die off if we get a read error, and we'll let kismet on the
--            // other side detact that it died
--            if (ret <= 0 && (errno != EAGAIN && errno != EPIPE))
--                exit(1);
--
--            data[ret] = '\0';
--
--        }
--
--        if (data[0] == '\0')
--            continue;
--
--        // If we've harvested the process, spawn a new one and watch it
--        // instead.  Otherwise, we just let go of the data we read
--        if (harvested == 1) {
--            harvested = 0;
--            if ((sndpid = fork()) == 0) {
--                // Only take the first line
--                char *nl;
--                if ((nl = strchr(data, '\n')) != NULL)
--                    *nl = '\0';
--
--                // Make sure it's shell-clean
--                MungeToShell(data, strlen(data));
--                char spk_call[1024];
--                snprintf(spk_call, 1024, "echo \"(SayText \\\"%s\\\")\" | %s >/dev/null 2>/dev/null",
--                         data, player);
--
--                system(spk_call);
--
--                exit(0);
--            }
--        }
--
--        data[0] = '\0';
--    }
--}
--
--
--int PlaySound(string in_sound) {
--
--    char snd[1024];
--
--    snprintf(snd, 1024, "%s\n", in_sound.c_str());
--
--    if (write(soundpair[1], snd, strlen(snd)) < 0) {
--        char status[STATUS_MAX];
--        snprintf(status, STATUS_MAX,
--                 "ERROR: Could not write to sound pipe.  Stopping sound.");
--        gui->WriteStatus(status);
--
--        return 0;
--    }
--
--    return 1;
--}
--
--int SayText(string in_text) {
--    char snd[1024];
--
--    snprintf(snd, 1024, "%s\n", in_text.c_str());
--
--    if (write(speechpair[1], snd, strlen(snd)) < 0) {
--        char status[STATUS_MAX];
--        snprintf(status, STATUS_MAX,
--                 "ERROR: Could not write to speech pipe.  Stopping speech.");
--        gui->WriteStatus(status);
--
--        return 0;
--    }
--
--    return 1;
--}
--
- int main(int argc, char *argv[]) {
-     exec_name = argv[0];
-@@ -332,9 +107,6 @@
-     char *reqgui = NULL;
--    string sndplay;
--    const char *festival = NULL;
--
-     char *columns = NULL;
-     char *clientcolumns = NULL;
-@@ -389,7 +161,6 @@
-             fprintf(stderr, "Using alternate UI config file: %s\n", uiconfigfile);
-             break;
-         case 'q':
--            sound = 0;
-             break;
-         case 'g':
-             reqgui = strdup(optarg);
-@@ -513,67 +284,6 @@
-         server = strdup(gui_conf->FetchOpt("host").c_str());
-     }
--    if (gui_conf->FetchOpt("sound") == "true" && sound == -1) {
--        if (gui_conf->FetchOpt("soundplay") != "") {
--            sndplay = gui_conf->FetchOpt("soundplay");
--            sound = 1;
--
--            if (gui_conf->FetchOpt("soundopts") != "")
--                sndplay += " " + gui_conf->FetchOpt("soundopts");
--
--            if (gui_conf->FetchOpt("sound_new") != "")
--                wav_map["new"] = gui_conf->FetchOpt("sound_new");
--            if (gui_conf->FetchOpt("sound_new_wep") != "")
--                wav_map["new_wep"] = gui_conf->FetchOpt("sound_new_wep");
--            if (gui_conf->FetchOpt("sound_traffic") != "")
--                wav_map["traffic"] = gui_conf->FetchOpt("sound_traffic");
--            if (gui_conf->FetchOpt("sound_junktraffic") != "")
--                wav_map["junktraffic"] = gui_conf->FetchOpt("sound_junktraffic");
--            if (gui_conf->FetchOpt("sound_gpslock") != "")
--                wav_map["gpslock"] = gui_conf->FetchOpt("sound_gpslock");
--            if (gui_conf->FetchOpt("sound_gpslost") != "")
--                wav_map["gpslost"] = gui_conf->FetchOpt("sound_gpslost");
--            if (gui_conf->FetchOpt("sound_alert") != "")
--                wav_map["alert"] = gui_conf->FetchOpt("sound_alert");
--
--        } else {
--            fprintf(stderr, "ERROR:  Sound alerts enabled but no sound playing binary specified.\n");
--            sound = 0;
--        }
--    } else if (sound == -1)
--        sound = 0;
--
--    /* Added by Shaw Innes 17/2/02 */
--    if (gui_conf->FetchOpt("speech") == "true" && speech == -1) {
--        if (gui_conf->FetchOpt("festival") != "") {
--            festival = strdup(gui_conf->FetchOpt("festival").c_str());
--            speech = 1;
--
--            string speechtype = gui_conf->FetchOpt("speech_type");
--
--            if (!strcasecmp(speechtype.c_str(), "nato"))
--                speech_encoding = SPEECH_ENCODING_NATO;
--            else if (!strcasecmp(speechtype.c_str(), "spell"))
--                speech_encoding = SPEECH_ENCODING_SPELL;
--            else
--                speech_encoding = SPEECH_ENCODING_NORMAL;
--
--            // Make sure we have encrypted text lines
--            if (gui_conf->FetchOpt("speech_encrypted") == "" || gui_conf->FetchOpt("speech_unencrypted") == "") {
--                fprintf(stderr, "ERROR:  Speech request but speech_encrypted or speech_unencrypted line missing.\n");
--                speech = 0;
--            }
--
--            speech_sentence_encrypted = gui_conf->FetchOpt("speech_encrypted");
--            speech_sentence_unencrypted = gui_conf->FetchOpt("speech_unencrypted");
--
--        } else {
--            fprintf(stderr, "ERROR: Speech alerts enabled but no path to festival has been specified.\n");
--            speech = 0;
--        }
--    } else if (speech == -1)
--        speech = 0;
--
-     if (gui_conf->FetchOpt("decay") != "") {
-         if (sscanf(gui_conf->FetchOpt("decay").c_str(), "%d", &decay) != 1) {
-             fprintf(stderr, "FATAL:  Illegal config file value for decay.\n");
-@@ -631,45 +341,6 @@
-         }
-     }
--    // Fork and find the sound options
--    if (sound) {
--        if (pipe(soundpair) == -1) {
--            fprintf(stderr, "WARNING:  Unable to create pipe for audio.  Disabling sound.\n");
--            sound = 0;
--        } else {
--            soundpid = fork();
--
--            if (soundpid < 0) {
--                fprintf(stderr, "WARNING:  Unable to fork for audio.  Disabling sound.\n");
--                sound = 0;
--            } else if (soundpid == 0) {
--                SoundHandler(soundpair, sndplay.c_str(), wav_map);
--                exit(0);
--            }
--
--            close(soundpair[0]);
--        }
--    }
--
--    if (speech) {
--        if (pipe(speechpair) == -1) {
--            fprintf(stderr, "WARNING:  Unable to create pipe for speech.  Disabling speech.\n");
--            speech = 0;
--        } else {
--            speechpid = fork();
--
--            if (speechpid < 0) {
--                fprintf(stderr, "WARNING:  Unable to fork for speech.  Disabling speech.\n");
--                speech = 0;
--            } else if (speechpid == 0) {
--                SpeechHandler(speechpair, festival);
--                exit(0);
--            }
--
--            close(speechpair[0]);
--        }
--    }
--
-     if (kismet_serv.Connect(guiport, guihost) < 0) {
-         fprintf(stderr, "FATAL:  Could not connect to %s:%d.\n", guihost, guiport);
-         CatchShutdown(-1);
-@@ -793,8 +464,6 @@
-     int num_networks = 0, num_packets = 0, num_noise = 0, num_dropped = 0;
--    time_t last_click = time(0);
--
-     fd_set read_set;
-     FD_ZERO(&read_set);
-@@ -876,10 +545,6 @@
-                     }
-                     if (pollret != 0) {
--                        if (pollret == CLIENT_ALERT)
--                            if (sound == 1)
--                                sound = PlaySound("alert");
--
-                         if (strlen(tcpcli->FetchStatus()) != 0) {
-                             gui->WriteStatus(tcpcli->FetchStatus());
-                             // gui->DrawDisplay();
-@@ -888,12 +553,8 @@
-                         // The GPS only gets updated for the primary client
-                         if (tcpcli == primary_client) {
-                             if (tcpcli->FetchMode() == 0 && gpsmode != 0) {
--                                if (sound == 1 && gpsmode != -1)
--                                    sound = PlaySound("gpslost");
-                                 gpsmode = 0;
-                             } else if (tcpcli->FetchMode() != 0 && gpsmode == 0) {
--                                if (sound == 1 && gpsmode != -1)
--                                    sound = PlaySound("gpslock");
-                                 gpsmode = 1;
-                             }
-                         }
-@@ -901,28 +562,6 @@
-                         if (tcpcli->FetchDeltaNumNetworks() > 0) {
-                             wireless_network *newnet = tcpcli->FetchLastNewNetwork();
--                            if (sound == 1 && newnet != lastspoken) {
--                                if (newnet->crypt_set && 
--                                    wav_map.find("new_wep") != wav_map.end())
--                                    sound = PlaySound("new_wep");
--                                else
--                                    sound = PlaySound("new");
--                            }
--
--                            if (speech == 1 && newnet != lastspoken) {
--                                string text;
--
--                                if (newnet != NULL) {
--                                    if (newnet->crypt_set)
--                                        text = ExpandSpeechString(speech_sentence_encrypted, newnet, speech_encoding);
--                                    else
--                                        text = ExpandSpeechString(speech_sentence_unencrypted, newnet, speech_encoding);
--
--                                    speech = SayText(text.c_str());
--                                }
--                            }
--
--                            lastspoken = newnet;
-                         }
-                         num_networks += tcpcli->FetchNumNetworks();
-@@ -930,17 +569,6 @@
-                         num_noise += tcpcli->FetchNumNoise();
-                         num_dropped += tcpcli->FetchNumDropped();
--                        if (tcpcli->FetchDeltaNumPackets() != 0) {
--                            if (time(0) - last_click >= decay && sound == 1) {
--                                if (tcpcli->FetchDeltaNumPackets() > tcpcli->FetchDeltaNumDropped()) {
--                                    sound = PlaySound("traffic");
--                                } else {
--                                    sound = PlaySound("junktraffic");
--                                }
--
--                                last_click = time(0);
--                            }
--                        }
-                     }
-                 }
-             } else {
-diff -urN kismet-2005-04-R1.old/kismet_server.cc kismet-2005-04-R1.dev/kismet_server.cc
---- kismet-2005-04-R1.old/kismet_server.cc     2005-05-04 21:09:18.000000000 +0200
-+++ kismet-2005-04-R1.dev/kismet_server.cc     2005-05-04 21:23:01.000000000 +0200
-@@ -56,7 +56,6 @@
- #include "timetracker.h"
- #include "alertracker.h"
--#include "speech.h"
- #include "tcpserver.h"
- #include "server_globals.h"
- #include "kismet_server.h"
-@@ -98,7 +97,6 @@
- FifoDumpFile fifodump;
- TcpServer ui_server;
--int sound = -1;
- packet_info last_info;
- int decay;
- channel_power channel_graph[CHANNEL_MAX];
-@@ -112,10 +110,8 @@
- macmap<wep_key_info *> bssid_wep_map;
- // Pipe file descriptor pairs and fd's
--int soundpair[2];
--int speechpair[2];
- int chanpair[2];
--pid_t soundpid = -1, speechpid = -1, chanpid = -1;
-+pid_t chanpid = -1;
- // Past alerts
- unsigned int max_alerts = 50;
-@@ -177,16 +173,6 @@
- int tcpport = -1;
- int tcpmax;
--//const char *sndplay = NULL;
--string sndplay;
--
--const char *festival = NULL;
--int speech = -1;
--int speech_encoding = 0;
--string speech_sentence_encrypted, speech_sentence_unencrypted;
--
--map<string, string> wav_map;
--
- int beacon_log = 1;
- int phy_log = 1;
- int mangle_log = 0;
-@@ -349,12 +335,6 @@
- #endif
--    // Kill our sound players
--    if (soundpid > 0)
--        kill(soundpid, 9);
--    if (speechpid > 0)
--        kill(speechpid, 9);
--
-     // Shut down the packet sources
-     sourcetracker.CloseSources();
-@@ -365,227 +345,10 @@
-     exit(0);
- }
--// Subprocess sound handler
--void SoundHandler(int *fds, const char *player, map<string, string> soundmap) {
--    int read_sock = fds[0];
--    close(fds[1]);
--
--    fd_set rset;
--
--    char data[1024];
--
--    pid_t sndpid = -1;
--    int harvested = 1;
--
--    while (1) {
--        FD_ZERO(&rset);
--        FD_SET(read_sock, &rset);
--        char *end;
--
--        memset(data, 0, 1024);
--
--        struct timeval tm;
--        tm.tv_sec = 1;
--        tm.tv_usec = 0;
--
--        if (select(read_sock + 1, &rset, NULL, NULL, &tm) < 0) {
--            if (errno != EINTR) {
--                exit(1);
--            }
--        }
--
--        if (harvested == 0) {
--            // We consider a wait error to be a sign that the child pid died
--            // so we flag it as harvested and keep on going
--            pid_t harvestpid = waitpid(sndpid, NULL, WNOHANG);
--            if (harvestpid == -1 || harvestpid == sndpid)
--                harvested = 1;
--        }
--
--        if (FD_ISSET(read_sock, &rset)) {
--            int ret;
--            ret = read(read_sock, data, 1024);
--
--            // We'll die off if we get a read error, and we'll let kismet on the
--            // other side detact that it died
--            if (ret <= 0 && (errno != EAGAIN && errno != EPIPE))
--                exit(1);
--
--            if ((end = strstr(data, "\n")) == NULL)
--                continue;
--
--            end[0] = '\0';
--        }
--
--        if (data[0] == '\0')
--            continue;
--
--
--        // If we've harvested the process, spawn a new one and watch it
--        // instead.  Otherwise, we just let go of the data we read
--        if (harvested == 1) {
--            // Only take the first line
--            char *nl;
--            if ((nl = strchr(data, '\n')) != NULL)
--                *nl = '\0';
--
--            // Make sure it's shell-clean
--
--            char snd[1024];
--
--            if (soundmap.size() == 0)
--                snprintf(snd, 1024, "%s", data);
--            if (soundmap.find(data) != soundmap.end())
--                snprintf(snd, 1024, "%s", soundmap[data].c_str());
--            else
--                continue;
--
--            char plr[1024];
--            snprintf(plr, 1024, "%s", player);
--
--            harvested = 0;
--            if ((sndpid = fork()) == 0) {
--                // Suppress errors
--                if (silent) {
--                    int nulfd = open("/dev/null", O_RDWR);
--                    dup2(nulfd, 1);
--                    dup2(nulfd, 2);
--                }
--
--                char * const echoarg[] = { plr, snd, NULL };
--                execve(echoarg[0], echoarg, NULL);
--            }
--        }
--        data[0] = '\0';
--    }
--}
--
--// Subprocess speech handler
--void SpeechHandler(int *fds, const char *player) {
--    int read_sock = fds[0];
--    close(fds[1]);
--
--    fd_set rset;
--
--    char data[1024];
--
--    pid_t sndpid = -1;
--    int harvested = 1;
--
--    while (1) {
--        FD_ZERO(&rset);
--        FD_SET(read_sock, &rset);
--        //char *end;
--
--        memset(data, 0, 1024);
--
--        if (harvested == 0) {
--            // We consider a wait error to be a sign that the child pid died
--            // so we flag it as harvested and keep on going
--            pid_t harvestpid = waitpid(sndpid, NULL, WNOHANG);
--            if (harvestpid == -1 || harvestpid == sndpid)
--                harvested = 1;
--        }
--
--        struct timeval tm;
--        tm.tv_sec = 1;
--        tm.tv_usec = 0;
--
--        if (select(read_sock + 1, &rset, NULL, NULL, &tm) < 0) {
--            if (errno != EINTR) {
--                exit(1);
--            }
--        }
--
--        if (FD_ISSET(read_sock, &rset)) {
--            int ret;
--            ret = read(read_sock, data, 1024);
--
--            // We'll die off if we get a read error, and we'll let kismet on the
--            // other side detact that it died
--            if (ret <= 0 && (errno != EAGAIN && errno != EPIPE))
--                exit(1);
--
--            data[ret] = '\0';
--        }
--
--        if (data[0] == '\0')
--            continue;
--
--        // If we've harvested the process, spawn a new one and watch it
--        // instead.  Otherwise, we just let go of the data we read
--        if (harvested == 1) {
--            harvested = 0;
--            if ((sndpid = fork()) == 0) {
--                // Only take the first line
--                char *nl;
--                if ((nl = strchr(data, '\n')) != NULL)
--                    *nl = '\0';
--
--                // Make sure it's shell-clean
--                MungeToShell(data, strlen(data));
--                char spk_call[1024];
--                snprintf(spk_call, 1024, "echo \"(SayText \\\"%s\\\")\" | %s >/dev/null 2>/dev/null",
--                         data, player);
--                system(spk_call);
--
--                exit(0);
--            }
--        }
--
--        data[0] = '\0';
--    }
--}
--
--
--// Fork and run a system call to play a sound
--int PlaySound(string in_sound) {
--
--    char snd[1024];
--
--    snprintf(snd, 1024, "%s\n", in_sound.c_str());
--
--    if (write(soundpair[1], snd, strlen(snd)) < 0) {
--        char status[STATUS_MAX];
--        if (!silent)
--            fprintf(stderr, "ERROR:  Write error, closing sound pipe.\n");
--        snprintf(status, STATUS_MAX, "ERROR:  Write error on sound pipe, closing sound connection");
--        NetWriteStatus(status);
--
--        return 0;
--    }
--
--    return 1;
--}
--
--int SayText(string in_text) {
--
--    char snd[1024];
--
--    snprintf(snd, 1024, "%s\n", in_text.c_str());
--    MungeToShell(snd, 1024);
--
--    if (write(speechpair[1], snd, strlen(snd)) < 0) {
--        char status[STATUS_MAX];
--        if (!silent)
--            fprintf(stderr, "ERROR:  Write error, closing speech pipe.\n");
--        snprintf(status, STATUS_MAX, "ERROR:  Write error on speech pipe, closing speech connection");
--        NetWriteStatus(status);
--
--        return 0;
--    }
--
--    return 1;
--}
--
- void KisLocalAlert(const char *in_text) {
-     time_t now = time(0);
-     if (!silent)
-         fprintf(stderr, "ALERT %.24s %s\n", ctime(&now), in_text);
--
--    if (sound == 1)
--        sound = PlaySound("alert");
--
- }
- void KisLocalStatus(const char *in_status) {
-@@ -842,15 +605,11 @@
-         if (gpsret == 0 && gpsmode != 0) {
-             if (!silent || NetWriteStatus("Lost GPS signal.") == 0)
-                 fprintf(stderr, "Lost GPS signal.\n");
--            if (sound == 1)
--                sound = PlaySound("gpslost");
-             gpsmode = 0;
-         } else if (gpsret != 0 && gpsmode == 0) {
-             if (!silent || NetWriteStatus("Acquired GPS signal.") == 0)
-                 fprintf(stderr, "Acquired GPS signal.\n");
--            if (sound == 1)
--                sound = PlaySound("gpslock");
-             gpsmode = 1;
-         }
-@@ -1533,69 +1292,6 @@
-         legal_ipblock_vec.push_back(ipb);
-     }
--    // Process sound stuff
--    if (conf->FetchOpt("sound") == "true" && sound == -1) {
--        if (conf->FetchOpt("soundplay") != "") {
--            sndplay = conf->FetchOpt("soundplay");
--
--            if (conf->FetchOpt("soundopts") != "")
--                sndplay += " " + conf->FetchOpt("soundopts");
--
--            sound = 1;
--
--            if (conf->FetchOpt("sound_new") != "")
--                wav_map["new"] = conf->FetchOpt("sound_new");
--            if (conf->FetchOpt("sound_new_wep") != "")
--                wav_map["new_wep"] = conf->FetchOpt("sound_new_wep");
--            if (conf->FetchOpt("sound_traffic") != "")
--                wav_map["traffic"] = conf->FetchOpt("sound_traffic");
--            if (conf->FetchOpt("sound_junktraffic") != "")
--                wav_map["junktraffic"] = conf->FetchOpt("sound_traffic");
--            if (conf->FetchOpt("sound_gpslock") != "")
--                wav_map["gpslock"] = conf->FetchOpt("sound_gpslock");
--            if (conf->FetchOpt("sound_gpslost") != "")
--                wav_map["gpslost"] = conf->FetchOpt("sound_gpslost");
--            if (conf->FetchOpt("sound_alert") != "")
--                wav_map["alert"] = conf->FetchOpt("sound_alert");
--
--        } else {
--            fprintf(stderr, "ERROR:  Sound alerts enabled but no sound playing binary specified.\n");
--            sound = 0;
--        }
--    } else if (sound == -1)
--        sound = 0;
--
--    /* Added by Shaw Innes 17/2/02 */
--    /* Modified by Andrew Etter 15/9/02 */
--    if (conf->FetchOpt("speech") == "true" && speech == -1) {
--        if (conf->FetchOpt("festival") != "") {
--            festival = strdup(conf->FetchOpt("festival").c_str());
--            speech = 1;
--
--            string speechtype = conf->FetchOpt("speech_type");
--
--            if (!strcasecmp(speechtype.c_str(), "nato"))
--                speech_encoding = SPEECH_ENCODING_NATO;
--            else if (!strcasecmp(speechtype.c_str(), "spell"))
--                speech_encoding = SPEECH_ENCODING_SPELL;
--            else
--                speech_encoding = SPEECH_ENCODING_NORMAL;
--
--            // Make sure we have encrypted text lines
--            if (conf->FetchOpt("speech_encrypted") == "" || conf->FetchOpt("speech_unencrypted") == "") {
--                fprintf(stderr, "ERROR:  Speech request but speech_encrypted or speech_unencrypted line missing.\n");
--                speech = 0;
--            }
--
--            speech_sentence_encrypted = conf->FetchOpt("speech_encrypted");
--            speech_sentence_unencrypted = conf->FetchOpt("speech_unencrypted");
--        } else {
--            fprintf(stderr, "ERROR: Speech alerts enabled but no path to festival has been specified.\n");
--            speech = 0;
--        }
--    } else if (speech == -1)
--        speech = 0;
--
-     if (conf->FetchOpt("writeinterval") != "") {
-         if (sscanf(conf->FetchOpt("writeinterval").c_str(), "%d", &datainterval) != 1) {
-             fprintf(stderr, "FATAL:  Illegal config file value for data interval.\n");
-@@ -1615,45 +1311,6 @@
-         fprintf(stderr, "WARNING:  No client_manuf file specified.  Client manufacturers will not be detected.\n");
-     }
--    // Fork and find the sound options
--    if (sound) {
--        if (pipe(soundpair) == -1) {
--            fprintf(stderr, "WARNING:  Unable to create pipe for audio.  Disabling sound.\n");
--            sound = 0;
--        } else {
--            soundpid = fork();
--
--            if (soundpid < 0) {
--                fprintf(stderr, "WARNING:  Unable to fork for audio.  Disabling sound.\n");
--                sound = 0;
--            } else if (soundpid == 0) {
--                SoundHandler(soundpair, sndplay.c_str(), wav_map);
--                exit(0);
--            }
--
--            close(soundpair[0]);
--        }
--    }
--
--    if (speech) {
--        if (pipe(speechpair) == -1) {
--            fprintf(stderr, "WARNING:  Unable to create pipe for speech.  Disabling speech.\n");
--            speech = 0;
--        } else {
--            speechpid = fork();
--
--            if (speechpid < 0) {
--                fprintf(stderr, "WARNING:  Unable to fork for speech.  Disabling speech.\n");
--                speech = 0;
--            } else if (speechpid == 0) {
--                SpeechHandler(speechpair, festival);
--                exit(0);
--            }
--
--            close(speechpair[0]);
--        }
--    }
--
-     // Grab the filtering
-     string filter_bit;
-@@ -2172,7 +1829,6 @@
-             break;
-         case 'q':
-             // Quiet
--            sound = 0;
-             break;
-         case 'v':
-             // version
-@@ -2781,7 +2437,6 @@
-     snprintf(status, 1024, "%s", TIMESTAMP);
-     kdata.timestamp = status;
--    time_t last_click = 0;
-     int num_networks = 0, num_packets = 0, num_noise = 0, num_dropped = 0;
-@@ -2944,38 +2599,9 @@
-                     tracker.ProcessPacket(info);
--                    if (tracker.FetchNumNetworks() > num_networks) {
--                        if (sound == 1)
--                            if (info.wep && wav_map.find("new_wep") != wav_map.end())
--                                sound = PlaySound("new_wep");
--                            else
--                                sound = PlaySound("new");
--                        if (speech == 1) {
--                            string text;
--
--                            if (info.wep)
--                                text = ExpandSpeechString(speech_sentence_encrypted, &info, 
--                                                          speech_encoding);
--                            else
--                                text = ExpandSpeechString(speech_sentence_unencrypted, 
--                                                          &info, speech_encoding);
--
--                            speech = SayText(MungeToShell(text).c_str());
--                        }
--                    }
-                     num_networks = tracker.FetchNumNetworks();
-                     if (tracker.FetchNumPackets() != num_packets) {
--                        if (cur_time - last_click >= decay && sound == 1) {
--                            if (tracker.FetchNumPackets() - num_packets >
--                                tracker.FetchNumDropped() + localdropnum - num_dropped) {
--                                sound = PlaySound("traffic");
--                            } else {
--                                sound = PlaySound("junktraffic");
--                            }
--
--                            last_click = cur_time;
--                        }
-                         num_packets = tracker.FetchNumPackets();
-                         num_noise = tracker.FetchNumNoise();
-diff -urN kismet-2005-04-R1.old/kismet_server.h kismet-2005-04-R1.dev/kismet_server.h
---- kismet-2005-04-R1.old/kismet_server.h      2005-04-03 07:33:42.000000000 +0200
-+++ kismet-2005-04-R1.dev/kismet_server.h      2005-05-04 21:17:50.000000000 +0200
-@@ -33,10 +33,6 @@
- void handle_command(TcpServer *tcps, client_command *cc);
- int NetWriteStatus(const char *in_status);
- void NetWriteInfo();
--int SayText(string in_text);
--int PlaySound(string in_sound);
--void SpeechHandler(int *fds, const char *player);
--void SoundHandler(int *fds, const char *player, map<string, string> soundmap);
- void ProtocolAlertEnable(int in_fd);
- void ProtocolNetworkEnable(int in_fd);
- void ProtocolClientEnable(int in_fd);
-diff -urN kismet-2005-04-R1.old/panelfront.cc kismet-2005-04-R1.dev/panelfront.cc
---- kismet-2005-04-R1.old/panelfront.cc        2005-04-03 07:33:42.000000000 +0200
-+++ kismet-2005-04-R1.dev/panelfront.cc        2005-05-04 21:19:03.000000000 +0200
-@@ -420,8 +420,6 @@
-     //cutoff = 0;
--    muted = 0;
--
-     // Push blanks into the RRD history vector
-     packet_history.reserve(60 * 5);
-     for (unsigned int x = 0; x < (60 * 5); x++)
-@@ -678,8 +676,6 @@
-     zoomed = 0;
--    muted = 0;
--
-       if (colorkilled)
-         WriteStatus("Terminal cannot support colors, turning off color options.");
-diff -urN kismet-2005-04-R1.old/panelfront.h kismet-2005-04-R1.dev/panelfront.h
---- kismet-2005-04-R1.old/panelfront.h 2005-04-03 07:33:42.000000000 +0200
-+++ kismet-2005-04-R1.dev/panelfront.h 2005-05-04 21:18:48.000000000 +0200
-@@ -81,8 +81,6 @@
- extern char *KismetIntroText[];
- // These are in the kismet_curses.cc main code
--extern int sound;
--extern int speech;
- extern unsigned int metric;
- class PanelFront : public Frontend {
-@@ -383,10 +381,6 @@
-     int hsize, vsize;
--    int old_sound;
--    int old_speech;
--    int muted;
--
-     vector<int> packet_history;
-     float lat, lon, spd, alt, heading;
-diff -urN kismet-2005-04-R1.old/panelfront_input.cc kismet-2005-04-R1.dev/panelfront_input.cc
---- kismet-2005-04-R1.old/panelfront_input.cc  2005-04-03 07:33:42.000000000 +0200
-+++ kismet-2005-04-R1.dev/panelfront_input.cc  2005-05-04 21:18:19.000000000 +0200
-@@ -639,21 +639,6 @@
- }
- void PanelFront::MuteToggle() {
--    if (muted) {
--        speech = old_speech;
--        sound = old_sound;
--        muted = 0;
--        WriteStatus("Restoring sound");
--    } else if (sound != 0 || speech != 0) {
--        old_speech = speech;
--        old_sound = sound;
--        sound = 0;
--        speech = 0;
--        muted = 1;
--        WriteStatus("Muting sound");
--    } else if (sound == 0 && speech == 0) {
--        WriteStatus("Sound not enabled.");
--    }
- }
- int PanelFront::AlertInput(void *in_window, int in_chr) {
index 4d5e131792a76e28532513f7eb5052a0e9f9f0cd..7eef5789e7322afde6735af9d63bc7931340c204 100644 (file)
@@ -4,4 +4,4 @@ Section: apps
 Maintainer: Waldemar Brodkorb <wbx@dass-it.de>
 Source: buildroot internal
 Description: lcd software
-Depends: ncurses
+Depends: libncurses
index fd87fcac5d848c43ba16169bee88f64748a7ceaf..a8fa33c16892975f1d9c25bd5c41ffccfc1c2149 100644 (file)
@@ -1,5 +1,5 @@
 config BR2_PACKAGE_LIBNIDS
-       tristate "libnids"
+       tristate "libnids - network intrusion library"
        select BR2_PACKAGE_LIBPCAP
        select BR2_PACKAGE_LIBNET
        default m if CONFIG_DEVEL
index 92ba78f908243efc736333f654c43f7a0852600f..254a29dcbc1b55c70c3b93178be3331dc73ffcfa 100644 (file)
@@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lighttpd
 PKG_VERSION:=1.3.13
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_MD5SUM:=2f017b936be376ad6f6c2ee26db93467
 
 PKG_SOURCE_URL:=http://www.lighttpd.net/download/
diff --git a/openwrt/package/lighttpd/patches/500-configure_cross.patch b/openwrt/package/lighttpd/patches/500-configure_cross.patch
new file mode 100644 (file)
index 0000000..cf24343
--- /dev/null
@@ -0,0 +1,42 @@
+diff -ruN lighttpd-1.3.13-old/configure lighttpd-1.3.13-new/configure
+--- lighttpd-1.3.13-old/configure      2005-03-06 11:53:51.000000000 +0100
++++ lighttpd-1.3.13-new/configure      2005-09-01 09:10:36.000000000 +0200
+@@ -22623,7 +22623,7 @@
+ fi
+-if test "x$cross_compiling" = xno; then
++#if test "x$cross_compiling" = xno; then
+   # Extract the first word of "pcre-config", so it can be a program name with args.
+ set dummy pcre-config; ac_word=$2
+ echo "$as_me:$LINENO: checking for $ac_word" >&5
+@@ -22882,7 +22882,7 @@
+     LIBS="$OLDLIBS"
+   fi
+-fi
++#fi
+diff -ruN lighttpd-1.3.13-old/configure.in lighttpd-1.3.13-new/configure.in
+--- lighttpd-1.3.13-old/configure.in   2005-03-06 11:53:39.000000000 +0100
++++ lighttpd-1.3.13-new/configure.in   2005-09-01 08:44:12.000000000 +0200
+@@ -207,7 +207,7 @@
+     AC_SUBST(SSL_LIB)
+ fi
+-if test "x$cross_compiling" = xno; then
++#if test "x$cross_compiling" = xno; then
+   AC_PATH_PROG(PCRECONFIG, pcre-config)
+   if test x"$PCRECONFIG" != x; then 
+@@ -223,7 +223,7 @@
+     ])
+     LIBS="$OLDLIBS"
+   fi
+-fi
++#fi
+ AC_SUBST(PCRE_LIB)
diff --git a/openwrt/package/madwifi-tools/Config.in b/openwrt/package/madwifi-tools/Config.in
new file mode 100644 (file)
index 0000000..30f3563
--- /dev/null
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_MADWIFI_TOOLS
+       prompt "madwifi-tools - utilities for configuring the Atheros Wifi driver"
+       tristate
+       default m if CONFIG_DEVEL
+       help
+         Driver utilities for Atheros 802.11a/b/g MiniPCI cards
diff --git a/openwrt/package/madwifi-tools/Makefile b/openwrt/package/madwifi-tools/Makefile
new file mode 100644 (file)
index 0000000..a7afde1
--- /dev/null
@@ -0,0 +1,38 @@
+# $Id$
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=madwifi
+PKG_VERSION:=2005-08-13
+PKG_RELEASE:=1
+PKG_MD5SUM:=188127127aebd8815595c025a787d729
+
+PKG_SOURCE_URL:=http://madwifi.otaku42.de/2005/08/
+PKG_SOURCE:=$(PKG_NAME)-cvs-snapshot-$(PKG_VERSION).tar.bz2
+PKG_CAT:=bzcat
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+
+include $(TOPDIR)/package/rules.mk
+
+$(eval $(call PKG_template,MADWIFI_TOOLS,madwifi-tools,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH),kmod-madwifi))
+
+$(PKG_BUILD_DIR)/.configured:
+       touch $@
+
+$(PKG_BUILD_DIR)/.built:
+       $(MAKE) -C $(PKG_BUILD_DIR)/tools \
+               $(TARGET_CONFIGURE_OPTS)
+       touch $@
+
+$(IPKG_MADWIFI_TOOLS):
+       mkdir -p $(IDIR_MADWIFI_TOOLS)/usr/sbin
+       cp -fpR $(PKG_BUILD_DIR)/tools/athstats \
+               $(PKG_BUILD_DIR)/tools/athdebug \
+               $(PKG_BUILD_DIR)/tools/80211stats \
+               $(PKG_BUILD_DIR)/tools/80211debug \
+               $(PKG_BUILD_DIR)/tools/athctrl \
+               $(PKG_BUILD_DIR)/tools/athkey \
+               $(IDIR_MADWIFI_TOOLS)/usr/sbin
+       $(RSTRIP) $(IDIR_MADWIFI_TOOLS)
+       $(IPKG_BUILD) $(IDIR_MADWIFI_TOOLS) $(PACKAGE_DIR)
diff --git a/openwrt/package/madwifi-tools/ipkg/madwifi-tools.control b/openwrt/package/madwifi-tools/ipkg/madwifi-tools.control
new file mode 100644 (file)
index 0000000..de46b73
--- /dev/null
@@ -0,0 +1,6 @@
+Package: madwifi-tools
+Priority: optional
+Section: net
+Maintainer: Felix Fietkau <openwrt@nbd.name>
+Source: buildroot internal
+Description: Driver utilities for Atheros 802.11a/b/g MiniPCI cards
diff --git a/openwrt/package/madwifi-tools/patches/001-no_kerneldir.patch b/openwrt/package/madwifi-tools/patches/001-no_kerneldir.patch
new file mode 100644 (file)
index 0000000..d8603e5
--- /dev/null
@@ -0,0 +1,75 @@
+diff -urN madwifi.old/Makefile.inc madwifi.dev/Makefile.inc
+--- madwifi.old/Makefile.inc   2005-07-14 02:35:49.000000000 +0200
++++ madwifi.dev/Makefile.inc   2005-09-06 20:10:18.801794992 +0200
+@@ -74,71 +74,6 @@
+ # TOOLPATH is the path which contains the crosscompile toolchain (?)
+-ifeq ($(strip ${BUS}),AHB)
+-# Bus type AHB forces the target platform to be mipsisa32.
+-TARGET :=     mipsisa32-be-elf
+-
+-# Bus type AHB requires KERNELPATH and TOOLPATH to be set manually.
+-ifndef KERNELPATH
+-$(error KERNELPATH must be defined for bus type AHB.)
+-endif
+-ifndef TOOLPATH
+-$(error TOOLPATH must be defined for bus type AHB.)
+-endif
+-
+-else
+-
+-KERNELPATH ?= $(firstword $(wildcard $(DESTDIR)/lib/modules/$(shell uname -r)/build /usr/src/linux))
+-
+-ifeq ($(KERNELPATH),)
+-$(error KERNELPATH must be defined)
+-endif
+-
+-endif
+-
+-# sanity check: does KERNELPATH exist?
+-ifeq ($(wildcard $(KERNELPATH)),)
+-$(error KERNELPATH: $(KERNELPATH) does not exist)
+-endif
+-
+-# KERNELRELEASE is the target kernel's version.  If KERNELRELEASE
+-# is not set in the environment then it is taken from the running
+-# system.
+-# To determine the correct version a mini-Makefile is piped to make
+-# which includes the Makefile in KERNELPATH and prints out the version.
+-# This is done to come by problems recently introduced with some distros
+-# and newer kernel releases.
+-#
+-# Note: '\044' used instead of '$' in order to avoid make complaining like
+-# "Recursive variable `KERNELRELEASE' references itself (eventually)."
+-KERNELRELEASE ?= $(shell echo -e 'madwifi_$$_`date +%s`:\n\t@echo \044(KERNELRELEASE)\ninclude Makefile' | make -C $(KERNELPATH) -s -f-)
+-
+-# KERNELCONF is the name of the file that holds the configuration
+-# of the target kernel.
+-KERNELCONF ?= ${KERNELPATH}/.config
+-
+-# sanity check: does KERNELCONF exist?
+-ifeq ($(wildcard $(KERNELCONF)),)
+-$(error KERNELCONF: $(KERNELCONF) does not exist.)
+-endif
+-
+-# SYSTEMMAP is the name of the System.map file for the target
+-# kernel. This will be needed when DESTDIR is defined in order
+-# to run depmod properly.
+-SYSTEMMAP ?=  ${KERNELPATH}/System.map
+-
+-# MODULEPATH nominates the directory where the modules will be
+-# installed to
+-ifeq ($(strip ${BUS}),AHB)
+-MODULEPATH :=         ${KERNELPATH}/arch/mips/ar531x/RAMDISK/rootdir/lib/modules/${KERNELRELEASE}/net
+-else
+-MODULEPATH ?= /lib/modules/${KERNELRELEASE}/net
+-endif
+-
+-# WIRELESSEXT contains information about the version of the wireless
+-# extensions that are available in the target kernel
+-WIRELESSEXT ?=        $(shell cat $(KERNELPATH)/include/linux/wireless.h | grep "\#define WIRELESS_EXT" | cut -f2)
+-
+ # Some settings that depend on actual kernel release
+ ifneq ($(findstring 2.6,$(KERNELRELEASE)),)
+ export-objs   :=
diff --git a/openwrt/package/mtd/Config.in b/openwrt/package/mtd/Config.in
new file mode 100644 (file)
index 0000000..a1b24a9
--- /dev/null
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_MTD
+       tristate "mtd - update utility for trx firmware images"
+       default y
+       help
+        update utility for trx firmware images.
+
+config BR2_PACKAGE_MTD_STATIC
+       tristate "mtd - update utility for trx firmware images (statically linked)"
+       default n
+       help
+        update utility for trx firmware images (statically linked). To update
+        from other firmware or older OpenWrt releases.
diff --git a/openwrt/package/mtd/Makefile b/openwrt/package/mtd/Makefile
new file mode 100644 (file)
index 0000000..18ebc90
--- /dev/null
@@ -0,0 +1,34 @@
+# $Id$
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME := mtd
+PKG_RELEASE := 2
+
+PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
+
+include $(TOPDIR)/package/rules.mk
+
+$(eval $(call PKG_template,MTD,$(PKG_NAME),$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,MTD_STATIC,mtd-static,$(PKG_RELEASE),$(ARCH)))
+
+$(PKG_BUILD_DIR)/.prepared:
+       mkdir -p $@
+       touch $@
+
+$(PKG_BUILD_DIR)/.built:
+       $(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/mtd mtd.c
+       $(TARGET_CC) -static $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/mtd-static mtd.c
+       touch $@
+
+$(IPKG_MTD): 
+       install -d -m0755 $(IDIR_MTD)/sbin
+       install -m0755 $(PKG_BUILD_DIR)/mtd $(IDIR_MTD)/sbin
+       $(RSTRIP) $(IDIR_MTD)/sbin/*
+       $(IPKG_BUILD) $(IDIR_MTD) $(PACKAGE_DIR)
+
+$(IPKG_MTD_STATIC): 
+       install -d -m0755 $(IDIR_MTD_STATIC)/sbin
+       install -m0755 $(PKG_BUILD_DIR)/mtd-static $(IDIR_MTD_STATIC)/sbin
+       $(RSTRIP) $(IDIR_MTD_STATIC)/sbin/*
+       $(IPKG_BUILD) $(IDIR_MTD_STATIC) $(PACKAGE_DIR)
diff --git a/openwrt/package/mtd/ipkg/mtd-static.control b/openwrt/package/mtd/ipkg/mtd-static.control
new file mode 100644 (file)
index 0000000..5c73808
--- /dev/null
@@ -0,0 +1,6 @@
+Package: mtd-static
+Priority: optional
+Section: sys
+Maintainer: OpenWrt Developer <openwrt-devel@openwrt.org>
+Source: buildroot internal
+Description: Tool for modifying the flash chip (statically linked)
diff --git a/openwrt/package/mtd/ipkg/mtd.control b/openwrt/package/mtd/ipkg/mtd.control
new file mode 100644 (file)
index 0000000..d75e5d9
--- /dev/null
@@ -0,0 +1,6 @@
+Package: mtd
+Priority: optional
+Section: sys
+Maintainer: OpenWrt Developer <openwrt-devel@openwrt.org>
+Source: buildroot internal
+Description: Tool for modifying the flash chip
diff --git a/openwrt/package/mtd/mtd.c b/openwrt/package/mtd/mtd.c
new file mode 100644 (file)
index 0000000..69ef064
--- /dev/null
@@ -0,0 +1,377 @@
+/*
+ * mtd - simple memory technology device manipulation tool
+ *
+ * Copyright (C) 2005 Waldemar Brodkorb <wbx@dass-it.de>,
+ *                   Felix Fietkau <nbd@vd-s.ath.cx>
+ *
+ * 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, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * $Id$
+ *
+ * code is based on linux-mtd example code
+ */
+
+#include <limits.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <error.h>
+#include <time.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/mount.h>
+#include <sys/stat.h>
+#include <sys/reboot.h>
+#include <string.h>
+
+#include <linux/mtd/mtd.h>
+
+#define TRX_MAGIC       0x30524448      /* "HDR0" */
+#define BUFSIZE (10 * 1024)
+#define MAX_ARGS 8
+
+struct trx_header {
+       uint32_t magic;         /* "HDR0" */
+       uint32_t len;           /* Length of file including header */
+       uint32_t crc32;         /* 32-bit CRC from flag_version to end of file */
+       uint32_t flag_version;  /* 0:15 flags, 16:31 version */
+       uint32_t offsets[3];    /* Offsets of partitions from start of header */
+};
+
+int
+trx_check(const char *trxfile, const char *mtd, int force)
+{
+       struct mtd_info_user mtdInfo;
+       int trxfd, fd;
+       size_t count;
+       struct trx_header trx;
+       struct stat trxstat;
+
+       trxfd = open(trxfile,O_RDONLY); 
+       if(trxfd < 0) {
+               fprintf(stderr, "Could not open image: %s\n", trxfile);
+               exit(1);
+       }
+
+       if (fstat(trxfd,&trxstat) < 0) {
+               fprintf(stderr, "Could not get image file status: %s\n", trxfile);
+               close(trxfd);
+               exit(1);
+       }
+
+       if (force == 0) {
+               count = read(trxfd, &trx, sizeof(struct trx_header));
+               if (count < sizeof(struct trx_header)) {
+                       fprintf(stderr, "Could not get trx header, file too small (%ld bytes)\n", count);
+                       close(trxfd);
+                       exit(1);
+               }
+
+               if (trx.magic != TRX_MAGIC || trx.len < sizeof(struct trx_header)) {
+                       fprintf(stderr, "Bad trx header\n");
+                       fprintf(stderr, "If this is a firmware in bin format, like some of the\n"
+                                       "original firmware files are, use following command to convert to trx:\n"
+                                       "dd if=firmware.bin of=firmware.trx bs=32 skip=1\n");
+                       close(trxfd);
+                       exit(1);
+               }
+       
+               lseek(trxfd, 0, SEEK_SET);
+       }
+
+       /* check if image fits to mtd device */
+
+       fd = mtd_open(mtd, O_RDWR);
+       if(fd < 0) {
+               fprintf(stderr, "Could not open mtd device: %s\n", mtd);
+               exit(1);
+       }
+
+       if(ioctl(fd, MEMGETINFO, &mtdInfo)) {
+               fprintf(stderr, "Could not get MTD device info from %s\n", mtd);
+               close(fd);
+               exit(1);
+       }
+               
+       if(mtdInfo.size < trxstat.st_size) {
+               fprintf(stderr, "Image too big for partition: %s\n", mtd);
+               close(trxfd);
+               close(fd);
+               exit(1);
+       }       
+       
+       printf("Writing %s to %s ...\n", trxfile, mtd);
+
+       close(fd);
+
+       return(trxfd);
+}
+
+int
+mtd_unlock(const char *mtd)
+{
+       int fd;
+       struct mtd_info_user mtdInfo;
+       struct erase_info_user mtdLockInfo;
+
+       fd = mtd_open(mtd, O_RDWR);
+       if(fd < 0) {
+               fprintf(stderr, "Could not open mtd device: %s\n", mtd);
+               exit(1);
+       }
+
+       if(ioctl(fd, MEMGETINFO, &mtdInfo)) {
+               fprintf(stderr, "Could not get MTD device info from %s\n", mtd);
+               close(fd);
+               exit(1);
+       }
+
+       printf("Unlocking %s ...\n", mtd);
+       mtdLockInfo.start = 0;
+       mtdLockInfo.length = mtdInfo.size;
+       if(ioctl(fd, MEMUNLOCK, &mtdLockInfo)) {
+               close(fd);
+               return 0;
+       }
+               
+       close(fd);
+       return 0;
+}
+
+int
+mtd_open(const char *mtd, int flags)
+{
+       FILE *fp;
+       char dev[PATH_MAX];
+       int i;
+
+       if ((fp = fopen("/proc/mtd", "r"))) {
+               while (fgets(dev, sizeof(dev), fp)) {
+                       if (sscanf(dev, "mtd%d:", &i) && strstr(dev, mtd)) {
+                               snprintf(dev, sizeof(dev), "/dev/mtd/%d", i);
+                               fclose(fp);
+                               return open(dev, flags);
+                       }
+               }
+               fclose(fp);
+       }
+
+       return open(mtd, flags);
+}
+
+int
+mtd_erase(const char *mtd)
+{
+       int fd;
+       struct mtd_info_user mtdInfo;
+       struct erase_info_user mtdEraseInfo;
+
+       fd = mtd_open(mtd, O_RDWR);
+       if(fd < 0) {
+               fprintf(stderr, "Could not open mtd device: %s\n", mtd);
+               exit(1);
+       }
+
+       if(ioctl(fd, MEMGETINFO, &mtdInfo)) {
+               fprintf(stderr, "Could not get MTD device info from %s\n", mtd);
+               close(fd);
+               exit(1);
+       }
+
+       printf("Erasing %s ...\n", mtd);
+       mtdEraseInfo.length = mtdInfo.erasesize;
+
+       for (mtdEraseInfo.start = 0;
+                mtdEraseInfo.start < mtdInfo.size;
+                mtdEraseInfo.start += mtdInfo.erasesize) {
+               
+               ioctl(fd, MEMUNLOCK, &mtdEraseInfo);
+               if(ioctl(fd, MEMERASE, &mtdEraseInfo)) {
+                       fprintf(stderr, "Could not erase MTD device: %s\n", mtd);
+                       close(fd);
+                       exit(1);
+               }
+       }               
+
+       close(fd);
+       return 0;
+
+}
+
+int
+mtd_write(int trxfd, const char *mtd)
+{
+       int fd,i;
+       size_t result,size,written;
+       struct mtd_info_user mtdInfo;
+       struct erase_info_user mtdEraseInfo;
+       unsigned char src[BUFSIZE],dest[BUFSIZE];
+       struct stat trxstat;
+
+       if (fstat(trxfd,&trxstat) < 0) {
+               fprintf(stderr, "Could not get trx image file status\n");
+               close(trxfd);
+               exit(1);
+       }
+
+       fd = mtd_open(mtd, O_RDWR);
+       if(fd < 0) {
+               fprintf(stderr, "Could not open mtd device: %s\n", mtd);
+               exit(1);
+       }
+
+       if(ioctl(fd, MEMGETINFO, &mtdInfo)) {
+               fprintf(stderr, "Could not get MTD device info from %s\n", mtd);
+               close(fd);
+               exit(1);
+       }
+               
+       mtdEraseInfo.start = 0;
+       mtdEraseInfo.length = trxstat.st_size & ~(mtdInfo.erasesize -1);
+       if(trxstat.st_size % mtdInfo.erasesize) mtdEraseInfo.length += mtdInfo.erasesize;
+
+       /* erase the chunk */
+       if (ioctl (fd,MEMERASE,&mtdEraseInfo) < 0) {
+               fprintf(stderr, "Erasing mtd failed: %s\n", mtd);
+               exit(1);
+       }
+       
+       size = trxstat.st_size;
+       i = BUFSIZE;
+       written = 0;
+
+       while (size) {
+               if (size < BUFSIZE) i = size;
+               read(trxfd,src,i);
+               result = write(fd,src,i);
+               if (i != result) {
+                       if (result < 0) {
+                               fprintf(stderr,"Error while writing image");
+                               exit(1);
+                       }
+                       fprintf(stderr,"Error writing image");
+                       exit(1);
+               }
+               written += i;
+               size -= i;
+       }
+       
+       return 0;
+}
+
+void usage(void)
+{
+       printf("Usage: mtd [<options> ...] <command> [<arguments> ...] <device>\n\n"
+       "The device is in the format of mtdX (eg: mtd4) or its label.\n"
+       "mtd recognizes these commands:\n"
+       "       unlock                  unlock the device\n"
+       "       erase                   erase all data on device\n"
+       "       write <imagefile>       write imagefile to device\n"
+       "Following options are available:\n"
+       "       -r                      reboot after successful command\n"
+       "       -f                      force write without trx checks\n"
+       "       -e <device>             erase <device> before executing the command\n\n"
+       "Example: To write linux.trx to mtd4 labeled as linux and reboot afterwards\n"
+       "         mtd -r write linux.trx linux\n\n");
+       exit(1);
+}
+
+int main (int argc, char **argv)
+{
+       int ch, i, boot, unlock, trxfd, force;
+       char *erase[MAX_ARGS], *device;
+       enum {
+               CMD_ERASE,
+               CMD_WRITE,
+               CMD_UNLOCK
+       } cmd;
+       
+       erase[0] = NULL;
+       boot = 0;
+       force = 0;
+
+       while ((ch = getopt(argc, argv, "fre:")) != -1)
+               switch (ch) {
+                       case 'f':
+                               force = 1;
+                               break;
+                       case 'r':
+                               boot = 1;
+                               break;
+                       case 'e':
+                               i = 0;
+                               while ((erase[i] != NULL) && ((i + 1) < MAX_ARGS))
+                                       i++;
+                                       
+                               erase[i++] = optarg;
+                               erase[i] = NULL;
+                               break;
+                       
+                       case '?':
+                       default:
+                               usage();
+               }
+       argc -= optind;
+       argv += optind;
+       
+       if (argc < 2)
+               usage();
+
+       if ((strcmp(argv[0], "unlock") == 0) && (argc == 2)) {
+               cmd = CMD_UNLOCK;
+               device = argv[1];
+       } else if ((strcmp(argv[0], "erase") == 0) && (argc == 2)) {
+               cmd = CMD_ERASE;
+               device = argv[1];
+       } else if ((strcmp(argv[0], "write") == 0) && (argc == 3)) {
+               cmd = CMD_WRITE;
+               device = argv[2];
+               /* check trx file before erasing or writing anything */
+               trxfd = trx_check(argv[1], device, force);
+       } else {
+               usage();
+       }
+
+       sync();
+
+       i = 0;
+       while (erase[i] != NULL) {
+               mtd_unlock(erase[i]);
+               mtd_erase(erase[i]);
+               i++;
+       }
+       
+       mtd_unlock(device);
+
+       switch (cmd) {
+               case CMD_UNLOCK:
+                       break;
+               case CMD_ERASE:
+                       mtd_erase(device);
+                       break;
+               case CMD_WRITE:
+                       mtd_write(trxfd, device);
+                       break;
+       }
+
+       if (boot)
+               kill(1, 15); // send SIGTERM to init for reboot
+
+       return 0;
+}
index 5139a5a4ac0f9b486c65a2c35085a75182f1aa5d..1b9e3566ad37bd56f3f26dd5ee33b886ab425db3 100644 (file)
@@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ncurses
 PKG_VERSION:=5.2
-PKG_RELEASE:=6
+PKG_RELEASE:=7
 PKG_MD5SUM:=464d6a49010cf2a6eb9ce59a264d4d47
 
 PKG_SOURCE_URL:=\
@@ -26,6 +26,50 @@ include $(TOPDIR)/package/rules.mk
 $(eval $(call PKG_template,LIBNCURSES,libncurses,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
 
 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
+       touch $@
+
+$(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
+       rm -rf $(PKG_INSTALL_DIR)
+       mkdir -p $(PKG_INSTALL_DIR)
+       (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
+               ./configure \
+               --target=$(GNU_HOST_NAME) \
+               --host=$(GNU_HOST_NAME) \
+               --build=$(GNU_HOST_NAME) \
+               --program-prefix="" \
+               --program-suffix="" \
+               --prefix=/usr \
+               --exec-prefix=/usr \
+               --bindir=/usr/bin \
+               --datadir=/usr/share \
+               --includedir=/usr/include \
+               --infodir=/usr/share/info \
+               --libdir=/usr/lib \
+               --libexecdir=/usr/lib \
+               --localstatedir=/var \
+               --mandir=/usr/share/man \
+               --sbindir=/usr/sbin \
+               --sysconfdir=/etc \
+               $(DISABLE_NLS) \
+               $(DISABLE_LARGEFILE) \
+               --enable-echo \
+               --enable-const \
+               --enable-overwrite \
+               --disable-rpath \
+               --without-ada \
+               --without-cxx \
+               --without-cxx-binding \
+               --without-debug \
+               --without-profile \
+               --with-progs \
+               --with-normal \
+               --without-shared \
+               --with-terminfo-dirs=/usr/share/terminfo \
+               --with-default-terminfo-dir=/usr/share/terminfo \
+       );
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               libs install.progs
        (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
                $(TARGET_CONFIGURE_OPTS) \
                CFLAGS="$(TARGET_CFLAGS)" \
@@ -52,38 +96,33 @@ $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
                --sysconfdir=/etc \
                $(DISABLE_NLS) \
                $(DISABLE_LARGEFILE) \
-               --with-terminfo-dirs=/usr/share/terminfo \
-               --with-default-terminfo-dir=/usr/share/terminfo \
+               --enable-echo \
+               --enable-const \
+               --enable-overwrite \
+               --disable-rpath \
                --without-ada \
                --without-cxx \
                --without-cxx-binding \
-               --without-progs \
-               --without-profile \
                --without-debug \
-               --disable-rpath \
-               --enable-echo \
-               --enable-const \
-               --enable-overwrite \
-               --with-shared \
+               --without-profile \
+               --without-progs \
                --with-normal \
+               --with-shared \
+               --with-terminfo-dirs=/usr/share/terminfo \
+               --with-default-terminfo-dir=/usr/share/terminfo \
        );
-       touch $@
-
-$(PKG_BUILD_DIR)/.built:
-       rm -rf $(PKG_INSTALL_DIR)
-       mkdir -p $(PKG_INSTALL_DIR)
        $(MAKE) -C $(PKG_BUILD_DIR) \
                $(TARGET_CONFIGURE_OPTS) \
                BUILD_CC="$(TARGET_CC)" \
                HOSTCC="$(HOSTCC)" \
                HOSTCCFLAGS="\$$(CPPFLAGS)" \
                DESTDIR="$(PKG_INSTALL_DIR)" \
-               all install
+               libs install.libs install.data
        touch $@
-       
+
 $(IPKG_LIBNCURSES):
        install -d -m0755 $(IDIR_LIBNCURSES)/usr/lib
-       cp -fpR $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel}*.so.* $(IDIR_LIBNCURSES)/usr/lib/
+       cp -fpR $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu}*.so.* $(IDIR_LIBNCURSES)/usr/lib/
        install -d -m0755 $(IDIR_LIBNCURSES)/usr/share/terminfo
        for f in a/ansi d/dumb l/linux s/screen v/vt100 v/vt102 x/xterm x/xterm-color; do \
                install -d -m0755 $(IDIR_LIBNCURSES)/usr/share/terminfo/`dirname $${f}`; \
@@ -100,9 +139,10 @@ $(STAGING_DIR)/usr/lib/libncurses.so: $(PKG_BUILD_DIR)/.built
        cp -fpR $(PKG_INSTALL_DIR)/usr/include/panel.h $(STAGING_DIR)/usr/include/
        cp -fpR $(PKG_INSTALL_DIR)/usr/include/term{,cap}.h $(STAGING_DIR)/usr/include/
        cp -fpR $(PKG_INSTALL_DIR)/usr/include/unctrl.h $(STAGING_DIR)/usr/include/
+       cp -fpR $(PKG_INSTALL_DIR)/usr/include/menu.h $(STAGING_DIR)/usr/include/
        mkdir -p $(STAGING_DIR)/usr/lib
        cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libcurses.so $(STAGING_DIR)/usr/lib/
-       cp -fpR $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel}.{a,so*} $(STAGING_DIR)/usr/lib/
+       cp -fpR $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu}.{a,so*} $(STAGING_DIR)/usr/lib/
        touch $@
 
 install-dev: $(STAGING_DIR)/usr/lib/libncurses.so
@@ -111,6 +151,7 @@ uninstall-dev:
        rm -rf \
                $(STAGING_DIR)/usr/include/curses.h \
                $(STAGING_DIR)/usr/include/{ncurses,panel}.h \
+               $(STAGING_DIR)/usr/include/menu.h \
                $(STAGING_DIR)/usr/include/panel.h \
                $(STAGING_DIR)/usr/include/term{,cap}.h \
                $(STAGING_DIR)/usr/include/unctrl.h \
diff --git a/openwrt/package/net-snmp/patches/901-ipsec-interfaces.patch b/openwrt/package/net-snmp/patches/901-ipsec-interfaces.patch
new file mode 100644 (file)
index 0000000..886f37a
--- /dev/null
@@ -0,0 +1,44 @@
+Date: Tue, 14 Jun 2005 00:39:54 +0200
+From: Alexander Holler <aholler@ahsoftware.de>
+To: nthill@free.fr
+Subject: Patch for libsnmp (openwrt) to work with ipsec-if
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 7bit
+
+Hello,
+
+I've a small patch for net-snmp (5.1.2) which is needed to work with
+ipsec-interfaces. Otherwise snmpd will segfault which means snmp is not
+really usable.
+
+The patch is from me, but the source for the fault is from:
+
+http://lists.openswan.org/pipermail/users/2004-August/001773.html
+
+It works, because this  email is going out over ipsec using a
+snmp-monitored wrt54g. ;)
+
+
+--- net-snmp-5.1.2/agent/mibgroup/mibII/interfaces.c.orig      2005-06-14 00:41:16.000000000 +0200
++++ net-snmp-5.1.2/agent/mibgroup/mibII/interfaces.c   2005-06-14 03:21:35.000000000 +0200
+@@ -1438,8 +1438,10 @@
+       if (ioctl(fd, 0x8947, &ifr) >= 0) {
+               new_ioctl_nums = 1;
++/*
+       } else if (ioctl(fd, SIOCDEVPRIVATE, &ifr) >= 0) {
+               new_ioctl_nums = 0;
++*/
+       } else {
+               DEBUGMSGTL(("mibII/interfaces", "SIOCGMIIPHY on %s failed\n", ifr.ifr_name));
+               return retspeed;
+@@ -1449,7 +1451,8 @@
+       for (mii_reg = 0; mii_reg < 8; mii_reg++){
+               data[0] = phy_id;
+               data[1] = mii_reg;
+-              if(ioctl(fd, new_ioctl_nums ? 0x8948 : SIOCDEVPRIVATE+1, &ifr) <0){
++/*            if(ioctl(fd, new_ioctl_nums ? 0x8948 : SIOCDEVPRIVATE+1, &ifr) <0){ */
++              if(ioctl(fd, 0x8948, &ifr) <0){
+                       DEBUGMSGTL(("mibII/interfaces", "SIOCGMIIREG on %s failed\n", ifr.ifr_name));
+               }
+               mii_val[mii_reg] = data[3];             
index 29b6f08ba5d7e0111c303edb4bc6e4971f084415..ef0e7bf5b7f9ee25224ff3830eb990e58312d3e9 100644 (file)
@@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nfs-server
 PKG_VERSION:=2.2beta47
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_MD5SUM:=79a29fe9f79b2f3241d4915767b8c511
 
 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/n/nfs-user-server
@@ -55,7 +55,7 @@ $(IPKG_NFS_SERVER):
        install -d -m0755 $(IDIR_NFS_SERVER)/etc
        install -m0644 ./files/nfsd.exports $(IDIR_NFS_SERVER)/etc/exports
        install -d -m0755 $(IDIR_NFS_SERVER)/etc/init.d
-       install -m0644 ./files/nfsd.init $(IDIR_NFS_SERVER)/etc/init.d/S60nfsd
+       install -m0755 ./files/nfsd.init $(IDIR_NFS_SERVER)/etc/init.d/S60nfsd
        install -d -m0755 $(IDIR_NFS_SERVER)/usr/sbin
        install -m0755 $(PKG_BUILD_DIR)/rpc.* $(IDIR_NFS_SERVER)/usr/sbin/
        $(RSTRIP) $(IDIR_NFS_SERVER)
index 8c010840bdcf5fa353d1be49bec014e1b7df86da..3c28caa399ff286b7c1f9cf5611b0be2a629d519 100644 (file)
@@ -25,7 +25,7 @@ $(PKG_BUILD_DIR)/.configured:
                CFLAGS="$(TARGET_CFLAGS)" \
                CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -nostdinc++ -nodefaultlibs " \
                CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
-               LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib  -fno-builtin -nostdinc++ -nodefaultlibs -luClibc++ -lc -lm" \
+               LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib  -fno-builtin -nostdinc++ -nodefaultlibs -luClibc++ -lc -lm -lgcc_s" \
                ac_cv_prog_CXX="$(TARGET_CXX)" \
                ./configure \
                  --target=$(GNU_TARGET_NAME) \
diff --git a/openwrt/package/nvram/Makefile b/openwrt/package/nvram/Makefile
new file mode 100644 (file)
index 0000000..9885f99
--- /dev/null
@@ -0,0 +1,46 @@
+# $Id$
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=nvram
+PKG_RELEASE:=1
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+
+include $(TOPDIR)/package/rules.mk
+
+# does not depend on menuconfig
+ifneq ($(BOARD),brcm)
+BR2_PACKAGE_NVRAM:=m
+else
+BR2_PACKAGE_NVRAM:=y
+endif
+
+$(eval $(call PKG_template,NVRAM,nvram,$(PKG_RELEASE),$(ARCH)))
+
+$(PKG_BUILD_DIR)/.prepared:
+       mkdir -p $(PKG_BUILD_DIR)
+       cp -a ./src/* $(PKG_BUILD_DIR)
+       touch $@
+
+$(PKG_BUILD_DIR)/.built:
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               $(TARGET_CONFIGURE_OPTS) \
+               CFLAGS="$(TARGET_CFLAGS) -I $(STAGING_DIR)/usr/include"
+       touch $@
+
+$(IPKG_NVRAM):
+       mkdir -p $(IDIR_NVRAM)/usr/lib
+       cp $(PKG_BUILD_DIR)/*.so $(IDIR_NVRAM)/usr/lib
+       mkdir -p $(IDIR_NVRAM)/usr/sbin
+       cp $(PKG_BUILD_DIR)/nvram $(IDIR_NVRAM)/usr/sbin
+       $(RSTRIP) $(IDIR_NVRAM)
+       $(IPKG_BUILD) $(IDIR_NVRAM) $(PACKAGE_DIR)
+
+
+compile: install-dev
+install-dev:
+       mkdir -p $(STAGING_DIR)/usr/lib
+       cp $(PKG_BUILD_DIR)/*.so $(STAGING_DIR)/usr/lib
+       
+
diff --git a/openwrt/package/nvram/ipkg/nvram.control b/openwrt/package/nvram/ipkg/nvram.control
new file mode 100644 (file)
index 0000000..bb25813
--- /dev/null
@@ -0,0 +1,7 @@
+Package: nvram
+Priority: optional
+Section: sys
+Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
+Source: buildroot internal
+Description: NVRAM utility and libraries for Broadcom hardware
+
diff --git a/openwrt/package/nvram/src/Makefile b/openwrt/package/nvram/src/Makefile
new file mode 100644 (file)
index 0000000..376c2b7
--- /dev/null
@@ -0,0 +1,22 @@
+# $Id$
+
+EXTRA_CFLAGS := -c -I. -I../include
+LIBSHARED_OBJS := shutils.o wl.o wl_linux.o defaults.o linux_timer.o
+LIBNVRAM_OBJS := nvram_linux.o nvram_convert.o
+
+all: libshared.so libnvram.so nvram
+
+%.o: %.c
+       $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ $^
+
+libshared.so: $(LIBSHARED_OBJS)
+       $(CC) -shared -o $@ $^
+
+libnvram.so: $(LIBNVRAM_OBJS)
+       $(CC) -shared -o $@ $^
+
+nvram: main.o
+       $(CC) -o $@ $^ -L. -lnvram
+
+clean:
+       rm -f *.o *.so nvram
diff --git a/openwrt/package/nvram/src/bcmtimer.h b/openwrt/package/nvram/src/bcmtimer.h
new file mode 100644 (file)
index 0000000..3db9e62
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2004, Broadcom Corporation
+ * All Rights Reserved.
+ * 
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
+ *
+ * Low resolution timer interface. Timer handlers may be called 
+ * in a deferred manner in a different task context after the 
+ * timer expires or in the task context from which the timer
+ * was created, depending on the implementation.
+ *
+ * $Id$
+ */
+#ifndef __bcmtimer_h__
+#define __bcmtimer_h__
+
+/* ANSI headers */
+#include <time.h>
+
+/* timer ID */
+typedef unsigned int bcm_timer_module_id;
+typedef unsigned int bcm_timer_id;
+
+/* timer callback */
+typedef void (*bcm_timer_cb)(bcm_timer_id id, int data);
+
+/* OS-independant interfaces, applications should call these functions only */
+int bcm_timer_module_init(int timer_entries, bcm_timer_module_id *module_id);
+int bcm_timer_module_cleanup(bcm_timer_module_id module_id);
+int bcm_timer_module_enable(bcm_timer_module_id module_id, int enable);
+int bcm_timer_create(bcm_timer_module_id module_id, bcm_timer_id *timer_id);
+int bcm_timer_delete(bcm_timer_id timer_id);
+int bcm_timer_gettime(bcm_timer_id timer_id, struct itimerspec *value);
+int bcm_timer_settime(bcm_timer_id timer_id, const struct itimerspec *value);
+int bcm_timer_connect(bcm_timer_id timer_id, bcm_timer_cb func, int data);
+int bcm_timer_cancel(bcm_timer_id timer_id);
+int bcm_timer_change_expirytime(bcm_timer_id timer_id, const struct itimerspec *timer_spec);
+
+#endif /* #ifndef __bcmtimer_h__ */
diff --git a/openwrt/package/nvram/src/defaults.c b/openwrt/package/nvram/src/defaults.c
new file mode 100644 (file)
index 0000000..119eaac
--- /dev/null
@@ -0,0 +1,179 @@
+/*
+ * Router default NVRAM values
+ *
+ * Copyright 2004, Broadcom Corporation
+ * All Rights Reserved.
+ * 
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
+ *
+ * $Id$
+ */
+
+#include <epivers.h>
+#include <string.h>
+#include <bcmnvram.h>
+#include <typedefs.h>
+#include <wlioctl.h>
+
+#define XSTR(s) STR(s)
+#define STR(s) #s
+
+struct nvram_tuple router_defaults[] = {
+       /* OS parameters */
+       { "os_name", "", 0 },                   /* OS name string */
+       { "os_version", EPI_VERSION_STR, 0 },   /* OS revision */
+       { "os_date", __DATE__, 0 },             /* OS date */
+
+       /* Miscellaneous parameters */
+       { "timer_interval", "3600", 0 },        /* Timer interval in seconds */
+       { "ntp_server", "192.5.41.40 192.5.41.41 133.100.9.2", 0 },             /* NTP server */
+       { "time_zone", "PST8PDT", 0 },          /* Time zone (GNU TZ format) */
+       { "log_level", "0", 0 },                /* Bitmask 0:off 1:denied 2:accepted */
+       { "upnp_enable", "0", 0 },              /* Start UPnP */
+       { "ezc_enable", "1", 0 },               /* Enable EZConfig updates */
+       { "ezc_version", "1", 0 },              /* EZConfig version */
+       { "is_default", "1", 0 },               /* is it default setting: 1:yes 0:no*/
+       { "os_server", "", 0 },                 /* URL for getting upgrades */
+       { "stats_server", "", 0 },              /* URL for posting stats */
+       { "console_loglevel", "1", 0 },         /* Kernel panics only */
+
+       /* Big switches */
+       { "router_disable", "0", 0 },           /* lan_proto=static lan_stp=0 wan_proto=disabled */
+       { "fw_disable", "0", 0 },               /* Disable firewall (allow new connections from the WAN) */
+
+       { "log_ipaddr", "", 0 },                /* syslog recipient */
+       
+       /* LAN H/W parameters */
+       { "lan_ifname", "", 0 },                /* LAN interface name */
+       { "lan_ifnames", "", 0 },               /* Enslaved LAN interfaces */
+       { "lan_hwnames", "", 0 },               /* LAN driver names (e.g. et0) */
+       { "lan_hwaddr", "", 0 },                /* LAN interface MAC address */
+       
+       /* LAN TCP/IP parameters */
+       { "lan_proto", "dhcp", 0 },             /* [static|dhcp] */
+       { "lan_ipaddr", "192.168.1.1", 0 },     /* LAN IP address */
+       { "lan_netmask", "255.255.255.0", 0 },  /* LAN netmask */
+       { "lan_stp", "0", 0 },                  /* LAN spanning tree protocol */
+       { "lan_wins", "", 0 },                  /* x.x.x.x x.x.x.x ... */
+       { "lan_domain", "", 0 },                /* LAN domain name */
+       { "lan_lease", "86400", 0 },            /* LAN lease time in seconds */
+
+       /* WAN H/W parameters */
+       { "wan_ifname", "", 0 },                /* WAN interface name */
+       { "wan_ifnames", "", 0 },               /* WAN interface names */
+       { "wan_hwname", "", 0 },                /* WAN driver name (e.g. et1) */
+       { "wan_hwaddr", "", 0 },                /* WAN interface MAC address */
+       
+       /* WAN TCP/IP parameters */
+       { "wan_proto", "dhcp", 0 },             /* [static|dhcp|pppoe|disabled] */
+       { "wan_ipaddr", "0.0.0.0", 0 },         /* WAN IP address */
+       { "wan_netmask", "0.0.0.0", 0 },        /* WAN netmask */
+       { "wan_gateway", "0.0.0.0", 0 },        /* WAN gateway */
+       { "wan_dns", "", 0 },                   /* x.x.x.x x.x.x.x ... */
+       { "wan_wins", "", 0 },                  /* x.x.x.x x.x.x.x ... */
+       { "wan_hostname", "", 0 },              /* WAN hostname */
+       { "wan_domain", "", 0 },                /* WAN domain name */
+       { "wan_lease", "86400", 0 },            /* WAN lease time in seconds */
+       
+       /* PPPoE parameters */
+       { "wan_pppoe_ifname", "", 0 },          /* PPPoE enslaved interface */
+       { "wan_pppoe_username", "", 0 },        /* PPP username */
+       { "wan_pppoe_passwd", "", 0 },          /* PPP password */
+       { "wan_pppoe_idletime", "60", 0 },      /* Dial on demand max idle time (seconds) */
+       { "wan_pppoe_keepalive", "0", 0 },      /* Restore link automatically */
+       { "wan_pppoe_demand", "0", 0 },         /* Dial on demand */
+       { "wan_pppoe_mru", "1492", 0 },         /* Negotiate MRU to this value */
+       { "wan_pppoe_mtu", "1492", 0 },         /* Negotiate MTU to the smaller of this value or the peer MRU */
+       { "wan_pppoe_service", "", 0 },         /* PPPoE service name */
+       { "wan_pppoe_ac", "", 0 },              /* PPPoE access concentrator name */
+
+       /* Misc WAN parameters */
+       { "wan_desc", "", 0 },                  /* WAN connection description */
+       { "wan_route", "", 0 },                 /* Static routes (ipaddr:netmask:gateway:metric:ifname ...) */
+       { "wan_primary", "0", 0 },              /* Primary wan connection */
+
+       { "wan_unit", "0", 0 },                 /* Last configured connection */
+       
+       /* Filters */
+       { "filter_maclist", "", 0 },            /* xx:xx:xx:xx:xx:xx ... */
+       { "filter_macmode", "deny", 0 },        /* "allow" only, "deny" only, or "disabled" (allow all) */
+       { "filter_client0", "", 0 },            /* [lan_ipaddr0-lan_ipaddr1|*]:lan_port0-lan_port1,proto,enable,day_start-day_end,sec_start-sec_end,desc */
+
+       /* Port forwards */
+       { "dmz_ipaddr", "", 0 },                /* x.x.x.x (equivalent to 0-60999>dmz_ipaddr:0-60999) */
+       { "forward_port0", "", 0 },             /* wan_port0-wan_port1>lan_ipaddr:lan_port0-lan_port1[:,]proto[:,]enable[:,]desc */
+       { "autofw_port0", "", 0 },              /* out_proto:out_port,in_proto:in_port0-in_port1>to_port0-to_port1,enable,desc */
+
+       /* DHCP server parameters */
+       { "dhcp_start", "192.168.1.100", 0 },   /* First assignable DHCP address */
+       { "dhcp_end", "192.168.1.150", 0 },     /* Last assignable DHCP address */
+       { "dhcp_domain", "wan", 0 },            /* Use WAN domain name first if available (wan|lan) */
+       { "dhcp_wins", "wan", 0 },              /* Use WAN WINS first if available (wan|lan) */
+
+       /* Web server parameters */
+       { "http_username", "", 0 },             /* Username */
+       { "http_passwd", "admin", 0 },          /* Password */
+       { "http_wanport", "", 0 },              /* WAN port to listen on */
+       { "http_lanport", "80", 0 },            /* LAN port to listen on */
+
+       /* Wireless parameters */
+       { "wl_ifname", "", 0 },                 /* Interface name */
+       { "wl_hwaddr", "", 0 },                 /* MAC address */
+       { "wl_phytype", "g", 0 },               /* Current wireless band ("a" (5 GHz), "b" (2.4 GHz), or "g" (2.4 GHz)) */
+       { "wl_corerev", "", 0 },                /* Current core revision */
+       { "wl_phytypes", "", 0 },               /* List of supported wireless bands (e.g. "ga") */
+       { "wl_radioids", "", 0 },               /* List of radio IDs */
+       { "wl_ssid", "OpenWrt", 0 },            /* Service set ID (network name) */
+       { "wl_country", "", 0 },                /* Country (default obtained from driver) */
+       { "wl_radio", "1", 0 },                 /* Enable (1) or disable (0) radio */
+       { "wl_closed", "0", 0 },                /* Closed (hidden) network */
+        { "wl_ap_isolate", "0", 0 },            /* AP isolate mode */
+       { "wl_mode", "ap", 0 },                 /* AP mode (ap|sta|wds) */
+       { "wl_lazywds", "0", 0 },               /* Enable "lazy" WDS mode (0|1) */
+       { "wl_wds", "", 0 },                    /* xx:xx:xx:xx:xx:xx ... */
+       { "wl_wep", "disabled", 0 },            /* WEP data encryption (enabled|disabled) */
+       { "wl_auth", "0", 0 },                  /* Shared key authentication optional (0) or required (1) */
+       { "wl_key", "1", 0 },                   /* Current WEP key */
+       { "wl_key1", "", 0 },                   /* 5/13 char ASCII or 10/26 char hex */
+       { "wl_key2", "", 0 },                   /* 5/13 char ASCII or 10/26 char hex */
+       { "wl_key3", "", 0 },                   /* 5/13 char ASCII or 10/26 char hex */
+       { "wl_key4", "", 0 },                   /* 5/13 char ASCII or 10/26 char hex */
+       { "wl_maclist", "", 0 },                /* xx:xx:xx:xx:xx:xx ... */
+       { "wl_macmode", "disabled", 0 },        /* "allow" only, "deny" only, or "disabled" (allow all) */
+       { "wl_channel", "11", 0 },              /* Channel number */
+       { "wl_rate", "0", 0 },                  /* Rate (bps, 0 for auto) */
+       { "wl_rateset", "default", 0 },         /* "default" or "all" or "12" */
+       { "wl_frag", "2346", 0 },               /* Fragmentation threshold */
+       { "wl_rts", "2347", 0 },                /* RTS threshold */
+       { "wl_dtim", "1", 0 },                  /* DTIM period */
+       { "wl_bcn", "100", 0 },                 /* Beacon interval */
+       { "wl_plcphdr", "long", 0 },            /* 802.11b PLCP preamble type */
+       { "wl_net_mode", "mixed", 0 },          /* 54g mode */
+       { "wl_gmode", "6", 0 },                 /* 54g mode */
+       { "wl_gmode_protection", "auto", 0 },   /* 802.11g RTS/CTS protection (off|auto) */
+       { "wl_afterburner", "auto", 0 },        /* AfterBurner */
+       { "wl_frameburst", "off", 0 },          /* BRCM Frambursting mode (off|on) */
+       { "wl_antdiv", "-1", 0 },               /* Antenna Diversity (-1|0|1|3) */
+       { "wl_infra", "1", 0 },                 /* Network Type (BSS/IBSS) */
+
+       /* WPA parameters */
+       { "security_mode", "open", 0 },
+       { "wl_auth_mode", "open", 0 },          /* Network authentication mode (open|shared|radius|wpa|psk) */
+       { "wl_wpa_psk", "", 0 },                /* WPA pre-shared key */
+       { "wl_wpa_gtk_rekey", "3600", 0 },      /* GTK rotation interval */
+       { "wl_radius_ipaddr", "", 0 },          /* RADIUS server IP address */
+       { "wl_radius_key", "", 0 },             /* RADIUS shared secret */
+       { "wl_radius_port", "1812", 0 },        /* RADIUS server UDP port */
+       { "wl_crypto", "tkip", 0 },             /* WPA data encryption */
+
+
+       { "wl_unit", "0", 0 },                  /* Last configured interface */
+               
+       /* Restore defaults */
+       { "restore_defaults", "0", 0 },         /* Set to 0 to not restore defaults on boot */
+
+       { 0, 0, 0 }
+};
diff --git a/openwrt/package/nvram/src/linux_timer.c b/openwrt/package/nvram/src/linux_timer.c
new file mode 100644 (file)
index 0000000..0402e44
--- /dev/null
@@ -0,0 +1,738 @@
+/*
+ * Copyright 2004, Broadcom Corporation
+ * All Rights Reserved.
+ * 
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
+ *
+ * Low resolution timer interface linux specific implementation.
+ *
+ * $Id$
+ */
+
+/*
+* debug facilities
+*/
+#define TIMER_DEBUG    0
+#if TIMER_DEBUG
+#define TIMERDBG(fmt, args...) printf("%s: " fmt "\n" , __FUNCTION__ , ## args)
+#else
+#define TIMERDBG(fmt, args...)
+#endif
+
+
+/*
+ * POSIX timer support for Linux. Taken from linux_timer.c in upnp
+ */
+
+#define __USE_GNU
+
+
+#include <stdlib.h>        // for malloc, free, etc.
+#include <string.h>        // for memset, strncasecmp, etc.
+#include <assert.h>        // for assert, of course.
+#include <signal.h>        // for sigemptyset, etc.
+#include <stdio.h>         // for printf, etc.
+#include <sys/time.h>
+#include <time.h>
+
+/* define TIMER_PROFILE to enable code which guages how accurate the timer functions are.
+   For each expiring timer the code will print the expected time interval and the actual time interval.
+#define TIMER_PROFILE
+*/
+#undef TIMER_PROFILE
+
+/*
+timer_cancel( ) - cancel a timer
+timer_connect( ) - connect a user routine to the timer signal
+timer_create( ) - allocate a timer using the specified clock for a timing base (POSIX)
+timer_delete( ) - remove a previously created timer (POSIX)
+timer_gettime( ) - get the remaining time before expiration and the reload value (POSIX)
+timer_getoverrun( ) - return the timer expiration overrun (POSIX)
+timer_settime( ) - set the time until the next expiration and arm timer (POSIX)
+nanosleep( ) - suspend the current task until the time interval elapses (POSIX)
+*/
+
+#define MS_PER_SEC 1000
+#define US_PER_SEC 1000000
+#define US_PER_MS  1000
+#define UCLOCKS_PER_SEC 1000000
+
+typedef void (*event_callback_t)(timer_t, int);
+
+#ifndef TIMESPEC_TO_TIMEVAL
+# define TIMESPEC_TO_TIMEVAL(tv, ts) {                                   \
+        (tv)->tv_sec = (ts)->tv_sec;                                    \
+        (tv)->tv_usec = (ts)->tv_nsec / 1000;                           \
+}
+#endif
+
+#ifndef TIMEVAL_TO_TIMESPEC
+# define TIMEVAL_TO_TIMESPEC(tv, ts) {                                   \
+        (ts)->tv_sec = (tv)->tv_sec;                                    \
+        (ts)->tv_nsec = (tv)->tv_usec * 1000;                           \
+}
+#endif
+
+#define ROUNDUP(x,y) ((((x)+(y)-1)/(y))*(y))
+
+#define timerroundup(t,g) \
+    do { \
+       if (!timerisset(t)) (t)->tv_usec=1; \
+       if ((t)->tv_sec == 0) (t)->tv_usec=ROUNDUP((t)->tv_usec, g); \
+    } while (0)
+
+typedef long uclock_t;
+
+#define TFLAG_NONE     0
+#define TFLAG_CANCELLED        (1<<0)
+#define TFLAG_DELETED  (1<<1)
+
+struct event {
+    struct timeval it_interval;
+    struct timeval it_value;
+    event_callback_t func;
+    int arg;
+    unsigned short flags;
+    struct event *next;
+#ifdef TIMER_PROFILE
+    uint expected_ms;
+    uclock_t start;
+#endif
+};
+
+void timer_cancel(timer_t timerid);
+
+static void alarm_handler(int i);
+static void check_event_queue();
+static void print_event_queue();
+static void check_timer();
+#if THIS_FINDS_USE
+static int count_queue(struct event *);
+#endif
+static int timer_change_settime(timer_t timer_id, const struct itimerspec *timer_spec);
+void block_timer();
+void unblock_timer();
+
+static struct event *event_queue = NULL;
+static struct event *event_freelist;
+static uint g_granularity;
+static int g_maxevents = 0;
+
+uclock_t uclock()
+{
+    struct timeval tv;
+
+    gettimeofday(&tv, NULL);
+    return ((tv.tv_sec * US_PER_SEC) + tv.tv_usec);
+}
+
+
+void init_event_queue(int n)
+{
+    int i;
+    struct itimerval tv;
+    
+    g_maxevents = n;
+    event_freelist = (struct event *) malloc(n * sizeof(struct event));
+    memset(event_freelist, 0, n * sizeof(struct event));
+
+    for (i = 0; i < (n-1); i++) 
+       event_freelist[i].next = &event_freelist[i+1];
+
+    event_freelist[i].next = NULL;
+
+    tv.it_interval.tv_sec = 0;
+    tv.it_interval.tv_usec = 1;
+    tv.it_value.tv_sec = 0;
+    tv.it_value.tv_usec = 0;
+    setitimer (ITIMER_REAL, &tv, 0);
+    setitimer (ITIMER_REAL, 0, &tv);
+    g_granularity = tv.it_interval.tv_usec;
+
+    signal(SIGALRM, alarm_handler);
+}
+
+
+int clock_gettime(
+    clockid_t         clock_id, /* clock ID (always CLOCK_REALTIME) */
+    struct timespec * tp        /* where to store current time */
+)
+{
+    struct timeval tv;
+    int n;
+
+
+    n = gettimeofday(&tv, NULL);
+    TIMEVAL_TO_TIMESPEC(&tv, tp);
+    
+    return n;
+}
+
+
+int timer_create(
+    clockid_t         clock_id, /* clock ID (always CLOCK_REALTIME) */
+    struct sigevent * evp,      /* user event handler */
+    timer_t *         pTimer    /* ptr to return value */
+)
+{
+    struct event *event;
+
+    if (clock_id != CLOCK_REALTIME) {
+       TIMERDBG("timer_create can only support clock id CLOCK_REALTIME");
+       exit(1);
+    }
+
+    if (evp != NULL) {
+       if (evp->sigev_notify != SIGEV_SIGNAL || evp->sigev_signo != SIGALRM) {
+           TIMERDBG("timer_create can only support signalled alarms using SIGALRM");
+           exit(1);
+       }
+    }
+
+    event = event_freelist;
+    if (event == NULL) {
+       print_event_queue();
+    }
+    assert(event != NULL);
+
+    event->flags = TFLAG_NONE;
+    
+    event_freelist = event->next;
+    event->next = NULL;
+
+    check_event_queue();
+
+    *pTimer = (timer_t) event;
+
+    return 0;
+}
+
+int timer_delete(
+    timer_t timerid /* timer ID */
+)
+{
+    struct event *event = (struct event *) timerid;
+    
+    if (event->flags & TFLAG_DELETED) {
+       TIMERDBG("Cannot delete a deleted event");
+       return 1;
+    }
+
+    timer_cancel(timerid);
+    
+    event->flags |= TFLAG_DELETED;
+
+    event->next = event_freelist;
+    event_freelist = event;
+
+    return 0;
+}
+
+int timer_connect
+(
+    timer_t     timerid, /* timer ID */
+    void (*routine)(timer_t, int), /* user routine */
+    int         arg      /* user argument */
+)
+{
+    struct event *event = (struct event *) timerid;
+
+    assert(routine != NULL);
+    event->func = routine;
+    event->arg = arg;
+    
+    return 0;
+}    
+
+/* 
+ * Please Call this function only from the call back functions of the alarm_handler.
+ * This is just a hack 
+*/
+int timer_change_settime
+(
+    timer_t                   timerid, /* timer ID */
+    const struct itimerspec * value   /* time to be set */
+)
+{
+    struct event *event = (struct event *) timerid;
+
+    TIMESPEC_TO_TIMEVAL(&event->it_interval, &value->it_interval);
+    TIMESPEC_TO_TIMEVAL(&event->it_value, &value->it_value);
+
+    return 1;  
+}
+
+int timer_settime
+(
+    timer_t                   timerid, /* timer ID */
+    int                       flags,   /* absolute or relative */
+    const struct itimerspec * value,   /* time to be set */
+    struct itimerspec *       ovalue   /* previous time set (NULL=no result) */
+)
+{
+    struct itimerval itimer;
+    struct event *event = (struct event *) timerid;
+    struct event **ppevent;
+
+    TIMESPEC_TO_TIMEVAL(&event->it_interval, &value->it_interval);
+    TIMESPEC_TO_TIMEVAL(&event->it_value, &value->it_value);
+
+    /* if .it_value is zero, the timer is disarmed */
+    if (!timerisset(&event->it_value)) {
+       timer_cancel(timerid);
+       return 0;
+    }
+
+    block_timer();
+
+#ifdef TIMER_PROFILE
+    event->expected_ms = (event->it_value.tv_sec * MS_PER_SEC) + (event->it_value.tv_usec / US_PER_MS);
+    event->start = uclock();
+#endif
+    if (event->next) {
+       TIMERDBG("calling timer_settime with a timer that is already on the queue.");
+    }
+
+
+    /* We always want to make sure that the event at the head of the
+       queue has a timeout greater than the itimer granularity.
+       Otherwise we end up with the situation that the time remaining
+       on an itimer is greater than the time at the head of the queue
+       in the first place. */
+    timerroundup(&event->it_value, g_granularity);
+
+    timerclear(&itimer.it_value);
+    getitimer(ITIMER_REAL, &itimer);
+    if (timerisset(&itimer.it_value)) {
+       // reset the top timer to have an interval equal to the remaining interval 
+       // when the timer was cancelled.
+       if (event_queue) {
+           if (timercmp(&(itimer.it_value), &(event_queue->it_value), >)) {
+               // it is an error if the amount of time remaining is more than the amount of time 
+               // requested by the top event.
+               //
+               TIMERDBG("timer_settime: TIMER ERROR!");
+
+           } else {
+               // some portion of the top event has already expired.
+               // Reset the interval of the top event to remaining
+               // time left in that interval.
+               //
+               event_queue->it_value = itimer.it_value;
+
+               // if we were the earliest timer before now, we are still the earliest timer now.
+               // we do not need to reorder the list.
+           }
+       }
+    }
+
+    // Now, march down the list, decrementing the new timer by the
+    // current it_value of each event on the queue.
+    ppevent = &event_queue;
+    while (*ppevent) {
+       if ( timercmp(&(event->it_value), &((*ppevent)->it_value), <) ) {
+           // if the proposed event will trigger sooner than the next event
+           // in the queue, we will insert the new event just before the next one.
+           //
+           // we also need to adjust the delta value to the next event.
+           timersub(&((*ppevent)->it_value), &(event->it_value), &((*ppevent)->it_value));
+           break;
+       }
+       // subtract the interval of the next event from the proposed interval.
+       timersub(&(event->it_value), &((*ppevent)->it_value), &(event->it_value));
+
+       ppevent = &((*ppevent)->next);
+    }
+    
+    // we have found our proper place in the queue, 
+    // link our new event into the pending event queue.
+    event->next = *ppevent;
+    *ppevent = event;
+
+    check_event_queue();
+
+    // if our new event ended up at the front of the queue, reissue the timer.
+    if (event == event_queue) {
+       timerroundup(&event_queue->it_value, g_granularity);
+       timerclear(&itimer.it_interval);
+       itimer.it_value = event_queue->it_value;
+       
+       // we want to be sure to never turn off the timer completely, 
+       // so if the next interval is zero, set it to some small value.
+       if (!timerisset(&(itimer.it_value)))
+           itimer.it_value = (struct timeval) { 0, 1 };
+       
+       assert(!timerisset(&itimer.it_interval));
+       assert(itimer.it_value.tv_sec > 0 || itimer.it_value.tv_usec >= g_granularity);
+       assert(event_queue->it_value.tv_sec > 0 || event_queue->it_value.tv_usec >= g_granularity);
+       setitimer(ITIMER_REAL, &itimer, NULL);
+       check_timer();
+    }
+
+    event->flags &= ~TFLAG_CANCELLED;
+    
+    unblock_timer();
+
+    return 0;
+}
+
+static void check_timer()
+{
+    struct itimerval itimer;
+    
+    getitimer(ITIMER_REAL, &itimer);
+    if (timerisset(&itimer.it_interval)) {
+       TIMERDBG("ERROR timer interval is set.");
+    }
+    if (timercmp(&(itimer.it_value), &(event_queue->it_value), >)) {
+       TIMERDBG("ERROR timer expires later than top event.");
+    }
+}
+
+
+static void check_event_queue()
+{
+    struct timeval sum;
+    struct event *event;
+    int i = 0;
+
+#ifdef notdef
+    int nfree = 0;
+    struct event *p;
+    for (p = event_freelist; p; p = p->next)
+       nfree++;
+    printf("%d free events\n", nfree);
+#endif
+    
+    timerclear(&sum);
+    for (event = event_queue; event; event = event->next) {
+       if (i > g_maxevents) {
+           TIMERDBG("timer queue looks like it loops back on itself!");
+           print_event_queue();
+           exit(1);
+       }
+       i++;
+    }
+}
+
+#if THIS_FINDS_USE
+/* The original upnp version has this unused function, so I left it in
+   to maintain the resemblance. */
+static int count_queue(struct event *event_queue)
+{
+    struct event *event;
+    int i = 0;
+    for (event = event_queue; event; event = event->next) 
+       i++;
+    return i;
+}
+#endif
+
+static void print_event_queue()
+{
+    struct event *event;
+    int i = 0;
+
+    for (event = event_queue; event; event = event->next) {
+       printf("#%d (0x%x)->0x%x: \t%d sec %d usec\t%p\n", 
+              i++, (unsigned int) event, (unsigned int) event->next, (int) event->it_value.tv_sec, (int) event->it_value.tv_usec, event->func);
+       if (i > g_maxevents) {
+           printf("...(giving up)\n");
+           break;
+       }
+    }
+}
+
+// The top element of the event queue must have expired.
+// Remove that element, run its function, and reset the timer.
+// if there is no interval, recycle the event structure.
+static void alarm_handler(int i)
+{
+    struct event *event, **ppevent;
+    struct itimerval itimer;
+    struct timeval small_interval = { 0, g_granularity/2 };
+#ifdef TIMER_PROFILE
+    uint junk;
+    uclock_t end;
+    uint actual;
+#endif
+
+    block_timer();
+
+    // Loop through the event queue and remove the first event plus any 
+    // subsequent events that will expire very soon thereafter (within 'small_interval'}.
+    //
+    do {
+       // remove the top event.
+       event = event_queue;
+       event_queue = event_queue->next;
+       event->next = NULL;
+
+#ifdef TIMER_PROFILE
+       end = uclock();
+       actual = ((end-event->start)/((uclock_t)UCLOCKS_PER_SEC/1000));
+       if (actual < 0)
+           junk = end;
+       TIMERDBG("expected %d ms  actual %d ms", event->expected_ms, ((end-event->start)/((uclock_t)UCLOCKS_PER_SEC/1000)));
+#endif
+       
+           // call the event callback function
+           (*(event->func))((timer_t) event, (int)event->arg);
+
+       /* If the event has been cancelled, do NOT put it back on the queue. */
+       if ( !(event->flags & TFLAG_CANCELLED) ) {
+
+           // if the event is a recurring event, reset the timer and
+           // find its correct place in the sorted list of events.
+           //
+           if (timerisset(&event->it_interval)) {
+               // event is recurring...
+               //
+               event->it_value = event->it_interval;
+#ifdef TIMER_PROFILE
+               event->expected_ms = (event->it_value.tv_sec * MS_PER_SEC) + (event->it_value.tv_usec / US_PER_MS);
+               event->start = uclock();
+#endif
+               timerroundup(&event->it_value, g_granularity);
+
+               // Now, march down the list, decrementing the new timer by the
+               // current delta of each event on the queue.
+               ppevent = &event_queue;
+               while (*ppevent) {
+                   if ( timercmp(&(event->it_value), &((*ppevent)->it_value), <) ) {
+                       // if the proposed event will trigger sooner than the next event
+                       // in the queue, we will insert the new event just before the next one.
+                       //
+                       // we also need to adjust the delta value to the next event.
+                       timersub(&((*ppevent)->it_value), &(event->it_value), &((*ppevent)->it_value));
+                       break;
+                   }
+                   timersub(&(event->it_value), &((*ppevent)->it_value), &(event->it_value));
+                   ppevent = &((*ppevent)->next);
+               }
+
+               // we have found our proper place in the queue, 
+               // link our new event into the pending event queue.
+               event->next = *ppevent;
+               *ppevent = event;
+           } else {
+               // there is no interval, so recycle the event structure.
+               //timer_delete((timer_t) event);
+           }
+       }
+
+       check_event_queue();
+       
+    } while (event_queue && timercmp(&event_queue->it_value, &small_interval, <));
+    
+    // re-issue the timer...
+    if (event_queue) {
+       timerroundup(&event_queue->it_value, g_granularity);
+
+       timerclear(&itimer.it_interval);
+       itimer.it_value = event_queue->it_value;
+       // we want to be sure to never turn off the timer completely, 
+       // so if the next interval is zero, set it to some small value.
+       if (!timerisset(&(itimer.it_value)))
+           itimer.it_value = (struct timeval) { 0, 1 };
+
+       setitimer(ITIMER_REAL, &itimer, NULL);
+       check_timer();
+    } else {
+       TIMERDBG("There are no events in the queue - timer not reset.");
+    }
+
+    unblock_timer();
+}
+
+static int block_count = 0;
+
+void block_timer()
+{
+    sigset_t set;
+
+    if (block_count++ == 0) {
+       sigemptyset(&set);
+       sigaddset(&set, SIGALRM);
+       sigprocmask(SIG_BLOCK, &set, NULL);
+    }
+}
+
+void unblock_timer()
+{
+    sigset_t set;
+
+    if (--block_count == 0) {
+       sigemptyset(&set);
+       sigaddset(&set, SIGALRM);
+       sigprocmask(SIG_UNBLOCK, &set, NULL);
+    }
+}
+
+void timer_cancel_all()
+{
+    struct itimerval timeroff = { { 0, 0 }, { 0, 0} };
+    struct event *event;
+    struct event **ppevent;
+
+    setitimer(ITIMER_REAL, &timeroff, NULL);
+
+    ppevent = &event_queue;
+    while (*ppevent) {
+       event = *ppevent;
+       *ppevent = event->next;
+       event->next = NULL;
+    }
+}
+
+
+
+void timer_cancel(timer_t timerid)
+{
+    struct itimerval itimer;
+    struct itimerval timeroff = { { 0, 0 }, { 0, 0} };
+    struct event *event = (struct event *) timerid;
+    struct event **ppevent;
+
+    if (event->flags & TFLAG_CANCELLED) {
+       TIMERDBG("Cannot cancel a cancelled event");
+       return;
+    }
+
+    block_timer();
+    
+    ppevent = &event_queue;
+    while (*ppevent) {
+       if ( *ppevent == event ) {
+
+           /* RACE CONDITION - if the alarm goes off while we are in
+              this loop, and if the timer we want to cancel is the
+              next to expire, the alarm will end up firing
+              after this routine is complete, causing it to go off early. */
+
+           /* If the cancelled timer is the next to expire, 
+              we need to do something special to clean up correctly. */
+           if (event == event_queue && event->next != NULL) {
+               timerclear(&itimer.it_value);
+               getitimer(ITIMER_REAL, &itimer);
+               
+               /* subtract the time that has already passed while waiting for this timer... */
+               timersub(&(event->it_value), &(itimer.it_value), &(event->it_value));
+
+               /* and add any remainder to the next timer in the list */
+               timeradd(&(event->next->it_value), &(event->it_value), &(event->next->it_value));
+           }
+
+           *ppevent = event->next;
+           event->next = NULL;
+
+           if (event_queue) {
+               timerroundup(&event_queue->it_value, g_granularity);
+               timerclear(&itimer.it_interval);
+               itimer.it_value = event_queue->it_value;
+               
+               /* We want to be sure to never turn off the timer
+                  completely if there are more events on the queue,
+                  so if the next interval is zero, set it to some
+                  small value.  */
+
+               if (!timerisset(&(itimer.it_value)))
+                   itimer.it_value = (struct timeval) { 0, 1 };
+               
+               assert(itimer.it_value.tv_sec > 0 || itimer.it_value.tv_usec >= g_granularity);
+               assert(event_queue->it_value.tv_sec > 0 || event_queue->it_value.tv_usec >= g_granularity);
+               setitimer(ITIMER_REAL, &itimer, NULL);
+               check_timer();
+           } else {
+               setitimer(ITIMER_REAL, &timeroff, NULL);
+           }
+           break;
+       }
+       ppevent = &((*ppevent)->next);
+    }
+
+    event->flags |= TFLAG_CANCELLED;
+
+    unblock_timer();
+}
+
+/*
+* timer related headers
+*/
+#include "bcmtimer.h"
+
+/*
+* locally used global variables and constants
+*/
+
+/*
+* Initialize internal resources used in the timer module. It must be called
+* before any other timer function calls. The param 'timer_entries' is used
+* to pre-allocate fixed number of timer entries.
+*/
+int bcm_timer_module_init(int timer_entries, bcm_timer_module_id *module_id)
+{
+       init_event_queue(timer_entries);
+       *module_id = (bcm_timer_module_id)event_freelist;
+       return 0;
+}
+
+/*
+* Cleanup internal resources used by this timer module. It deletes all
+* pending timer entries from the backend timer system as well.
+*/
+int bcm_timer_module_cleanup(bcm_timer_module_id module_id)
+{
+       module_id = 0;
+       return 0;
+}
+
+/* Enable/Disable timer module */
+int bcm_timer_module_enable(bcm_timer_module_id module_id, int enable)
+{
+       if (enable)
+               unblock_timer();
+       else
+               block_timer();
+       return 0;
+}
+
+int bcm_timer_create(bcm_timer_module_id module_id, bcm_timer_id *timer_id)
+{
+       module_id = 0;
+       return timer_create(CLOCK_REALTIME, NULL, (timer_t *)timer_id);
+}
+
+int bcm_timer_delete(bcm_timer_id timer_id)
+{
+       return timer_delete((timer_t)timer_id);
+}
+
+int bcm_timer_gettime(bcm_timer_id timer_id, struct itimerspec *timer_spec)
+{
+       return -1;
+}
+
+int bcm_timer_settime(bcm_timer_id timer_id, const struct itimerspec *timer_spec)
+{
+       return timer_settime((timer_t)timer_id, 0, timer_spec, NULL);
+}
+
+int bcm_timer_connect(bcm_timer_id timer_id, bcm_timer_cb func, int data)
+{
+       return timer_connect((timer_t)timer_id, (void *)func, data);
+}
+
+int bcm_timer_cancel(bcm_timer_id timer_id)
+{
+       timer_cancel((timer_t)timer_id);
+       return 0;
+}
+int bcm_timer_change_expirytime(bcm_timer_id timer_id, const struct itimerspec *timer_spec)
+{
+       timer_change_settime((timer_t)timer_id, timer_spec);
+       return 1;
+}
diff --git a/openwrt/package/nvram/src/main.c b/openwrt/package/nvram/src/main.c
new file mode 100644 (file)
index 0000000..a64430f
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Frontend command-line utility for Linux NVRAM layer
+ *
+ * Copyright 2004, Broadcom Corporation
+ * All Rights Reserved.
+ * 
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
+ *
+ * $Id$
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <typedefs.h>
+#include <bcmnvram.h>
+
+static void
+usage(void)
+{
+       fprintf(stderr, "usage: nvram [get name] [set name=value] [unset name] [show]\n");
+       exit(0);
+}
+
+/* NVRAM utility */
+int
+main(int argc, char **argv)
+{
+       char *name, *value, buf[NVRAM_SPACE];
+       int size;
+
+       /* Skip program name */
+       --argc;
+       ++argv;
+
+       if (!*argv) 
+               usage();
+
+       /* Process the remaining arguments. */
+       for (; *argv; argv++) {
+               if (!strncmp(*argv, "get", 3)) {
+                       if (*++argv) {
+                               if ((value = nvram_get(*argv)))
+                                       puts(value);
+                       }
+               }
+               else if (!strncmp(*argv, "set", 3)) {
+                       if (*++argv) {
+                               strncpy(value = buf, *argv, sizeof(buf));
+                               name = strsep(&value, "=");
+                               nvram_set(name, value);
+                       }
+               }
+               else if (!strncmp(*argv, "unset", 5)) {
+                       if (*++argv)
+                               nvram_unset(*argv);
+               }
+               else if (!strncmp(*argv, "commit", 5)) {
+                       nvram_commit();
+               }
+               else if (!strncmp(*argv, "show", 4) ||
+                          !strncmp(*argv, "getall", 6)) {
+                       nvram_getall(buf, sizeof(buf));
+                       for (name = buf; *name; name += strlen(name) + 1)
+                               puts(name);
+                       size = sizeof(struct nvram_header) + (int) name - (int) buf;
+                       fprintf(stderr, "size: %d bytes (%d left)\n", size, NVRAM_SPACE - size);
+               }
+               if (!*argv)
+                       break;
+       }
+
+       return 0;
+}      
diff --git a/openwrt/package/nvram/src/nvram_convert.c b/openwrt/package/nvram/src/nvram_convert.c
new file mode 100644 (file)
index 0000000..4859090
--- /dev/null
@@ -0,0 +1,77 @@
+
+#define WL(a)  "wl_"a  
+#define WL0(a) "wl0_"a 
+#define D11G(a)        "d11g_"a
+
+#define PPP(a)         "ppp_"a
+#define PPPOE(a)       "pppoe_"a
+
+struct nvram_convert {
+        char *name;            // for WEB
+       char *wl0_name;         // for driver
+        char *d11g_name;       // for old nv name
+};
+
+struct nvram_convert nvram_converts[] = {
+       // Bellow change from 3.11.48.7
+       { WL("ssid"),           WL0("ssid"),    ""},
+       { WL("radio"),          WL0("mode"),    ""},
+       { WL("mode"),           WL0("mode"),    ""},
+       { WL("wds"),            WL0("wds"),     ""},
+       { WL("auth"),           WL0("auth"),    ""},
+       { WL("key"),            WL0("key"),     ""},
+       { WL("key1"),           WL0("key1"),    ""},
+       { WL("key2"),           WL0("key2"),    ""},
+       { WL("key3"),           WL0("key3"),    ""},
+       { WL("key4"),           WL0("key4"),    ""},
+       { WL("maclist"),        WL0("maclist"), ""},
+       { WL("channel"),        WL0("channel"), D11G("channel")},
+       { WL("rateset"),        WL0("rateset"), D11G("rateset")},
+       { WL("rts"),            WL0("rts"),     D11G("rts")},
+       { WL("bcn"),            WL0("bcn"),     D11G("bcn")},
+       { WL("gmode"),          WL0("gmode"),   "d11g_mode"},
+       { WL("unit"),           WL0("unit"),    ""},
+       { WL("ifname"),         WL0("ifname"),  ""},
+       { WL("phytype"),        WL0("phytype"), ""},
+       { WL("country"),        WL0("country"), ""},
+       { WL("closed"),         WL0("closed"),  ""},
+       { WL("lazywds"),        WL0("lazywds"), ""},
+       { WL("wep"),            WL0("wep"),     ""},
+       { WL("macmode"),        WL0("macmode"), ""},
+       { WL("rate"),           WL0("rate"),    D11G("rate")},
+       { WL("frag"),           WL0("frag"),    D11G("frag")},
+       { WL("dtim"),           WL0("dtim"),    D11G("dtim")},
+       { WL("plcphdr"),        WL0("plcphdr"), ""},
+       { WL("gmode_protection"),       WL0("gmode_protection"),        ""},
+       { WL("radio"),          WL0("radio"),   ""},
+       // Bellow change from 3.21.9.0
+       { WL("auth_mode"),      WL0("auth_mode"),       ""},
+       { WL("radius_ipaddr"),  WL0("radius_ipaddr"),   ""},
+       { WL("radius_port"),    WL0("radius_port"),     ""},
+       { WL("radius_key"),     WL0("radius_key"),      ""},
+       { WL("wpa_psk"),        WL0("wpa_psk"),         ""},
+       { WL("wpa_gtk_rekey"),  WL0("wpa_gtk_rekey"),   ""},
+       { WL("frameburst"),     WL0("frameburst"),      ""},
+       { WL("crypto"),         WL0("crypto"),          ""},
+       { WL("ap_isolate"),     WL0("ap_isolate"),      ""},
+       { WL("afterburner"),    WL0("afterburner"),     ""},
+       // for PPPoE
+       { PPP("username"),      PPPOE("username"),      ""},
+       { PPP("passwd"),        PPPOE("passwd"),        ""},
+       { PPP("idletime"),      PPPOE("idletime"),      ""},
+       { PPP("keepalive"),     PPPOE("keepalive"),     ""},
+       { PPP("demand"),        PPPOE("demand"),        ""},
+       { PPP("service"),       PPPOE("service"),       ""},
+       { PPP("ac"),            PPPOE("ac"),            ""},
+       { PPP("static"),        PPPOE("static"),        ""},
+       { PPP("static_ip"),     PPPOE("static_ip"),     ""},
+       { PPP("username_1"),    PPPOE("username_1"),    ""},
+       { PPP("passwd_1"),      PPPOE("passwd_1"),      ""},
+       { PPP("idletime_1"),    PPPOE("idletime_1"),    ""},
+       { PPP("keepalive_1"),   PPPOE("keepalive_1"),   ""},
+       { PPP("demand_1"),      PPPOE("demand_1"),      ""},
+       { PPP("service_1"),     PPPOE("service_1"),     ""},
+       { PPP("ac_1"),          PPPOE("ac_1"),          ""},
+       
+       { 0, 0, 0},
+};
diff --git a/openwrt/package/nvram/src/nvram_convert.h b/openwrt/package/nvram/src/nvram_convert.h
new file mode 100644 (file)
index 0000000..70e1232
--- /dev/null
@@ -0,0 +1,7 @@
+
+struct nvram_convert {
+        char *name;
+       char *wl0_name;
+        char *d11g_name;
+};
+
diff --git a/openwrt/package/nvram/src/nvram_linux.c b/openwrt/package/nvram/src/nvram_linux.c
new file mode 100644 (file)
index 0000000..c41e321
--- /dev/null
@@ -0,0 +1,320 @@
+/*
+ * NVRAM variable manipulation (Linux user mode half)
+ *
+ * Copyright 2004, Broadcom Corporation
+ * All Rights Reserved.
+ * 
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
+ *
+ * $Id$
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+#include <error.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+
+#include <typedefs.h>
+#include <bcmnvram.h>
+#include <nvram_convert.h>
+#include <shutils.h>
+#include <utils.h>
+
+#define PATH_DEV_NVRAM "/dev/nvram"
+
+/* Globals */
+static int nvram_fd = -1;
+static char *nvram_buf = NULL;
+int check_action(void);
+int file_to_buf(char *path, char *buf, int len);
+
+int
+nvram_init(void *unused)
+{
+       if ((nvram_fd = open(PATH_DEV_NVRAM, O_RDWR)) < 0)
+               goto err;
+
+       /* Map kernel string buffer into user space */
+       if ((nvram_buf = mmap(NULL, NVRAM_SPACE, PROT_READ, MAP_SHARED, nvram_fd, 0)) == MAP_FAILED) {
+               close(nvram_fd);
+               nvram_fd = -1;
+               goto err;
+       }
+
+       return 0;
+
+ err:
+       perror(PATH_DEV_NVRAM);
+       return errno;
+}
+
+char *
+nvram_get(const char *name)
+{
+       size_t count = strlen(name) + 1;
+       char tmp[100], *value;
+       unsigned long *off = (unsigned long *) tmp;
+
+       if (nvram_fd < 0)
+               if (nvram_init(NULL))
+                       return NULL;
+
+       if (count > sizeof(tmp)) {
+               if (!(off = malloc(count)))
+                       return NULL;
+       }
+
+       /* Get offset into mmap() space */
+       strcpy((char *) off, name);
+
+       count = read(nvram_fd, off, count);
+
+       if (count == sizeof(unsigned long))
+               value = &nvram_buf[*off];
+       else
+               value = NULL;
+
+       if (count < 0)
+               perror(PATH_DEV_NVRAM);
+
+       if (off != (unsigned long *) tmp)
+               free(off);
+
+       return value;
+}
+
+int
+nvram_getall(char *buf, int count)
+{
+       int ret;
+
+       if (nvram_fd < 0)
+               if ((ret = nvram_init(NULL)))
+                       return ret;
+
+       if (count == 0)
+               return 0;
+
+       /* Get all variables */
+       *buf = '\0';
+
+       ret = read(nvram_fd, buf, count);
+
+       if (ret < 0)
+               perror(PATH_DEV_NVRAM);
+
+       return (ret == count) ? 0 : ret;
+}
+
+static int
+_nvram_set(const char *name, const char *value)
+{
+       size_t count = strlen(name) + 1;
+       char tmp[100], *buf = tmp;
+       int ret;
+
+       if (nvram_fd < 0)
+               if ((ret = nvram_init(NULL)))
+                       return ret;
+
+       /* Unset if value is NULL */
+       if (value)
+               count += strlen(value) + 1;
+
+       if (count > sizeof(tmp)) {
+               if (!(buf = malloc(count)))
+                       return -ENOMEM;
+       }
+
+       if (value)
+               sprintf(buf, "%s=%s", name, value);
+       else
+               strcpy(buf, name);
+
+       ret = write(nvram_fd, buf, count);
+
+       if (ret < 0)
+               perror(PATH_DEV_NVRAM);
+
+       if (buf != tmp)
+               free(buf);
+
+       return (ret == count) ? 0 : ret;
+}
+
+int
+nvram_set(const char *name, const char *value)
+{
+        extern struct nvram_convert nvram_converts[];
+         struct nvram_convert *v;
+         int ret;
+
+         ret = _nvram_set(name, value);
+
+         for(v = nvram_converts ; v->name ; v++) {
+                 if(!strcmp(v->name, name)){
+                         if(strcmp(v->wl0_name,""))      _nvram_set(v->wl0_name, value);
+                         if(strcmp(v->d11g_name,""))     _nvram_set(v->d11g_name, value);
+                 }
+         }
+
+         return ret;
+}
+
+int
+nvram_unset(const char *name)
+{
+       return _nvram_set(name, NULL);
+}
+
+int
+nvram_commit(void)
+{
+       int ret;
+       
+       cprintf("nvram_commit(): start\n");     
+       
+       if((check_action() == ACT_IDLE) || 
+          (check_action() == ACT_SW_RESTORE) || 
+          (check_action() == ACT_HW_RESTORE)){
+               if (nvram_fd < 0)
+                       if ((ret = nvram_init(NULL)))
+                               return ret;
+
+               ret = ioctl(nvram_fd, NVRAM_MAGIC, NULL);
+
+               if (ret < 0)
+                       perror(PATH_DEV_NVRAM);
+       
+               cprintf("nvram_commit(): end\n");       
+       }
+       else
+               cprintf("nvram_commit():  nothing to do...\n");
+
+       return ret;
+}
+
+int file2nvram(char *filename, char *varname) {
+   FILE *fp;
+   int c,count;
+   int i=0,j=0;
+   char mem[10000],buf[30000];
+
+   if ( !(fp=fopen(filename,"rb") ))
+        return 0;
+
+   count=fread(mem,1,sizeof(mem),fp);
+   fclose(fp);
+   for (j=0;j<count;j++) {
+        if  (i > sizeof(buf)-3 )
+                break;
+        c=mem[j];
+        if (c >= 32 && c <= 126 && c != '\\' && c != '~')  {
+                buf[i++]=(unsigned char) c;
+        } else if (c==0) {
+               buf[i++]='~';
+        } else {
+                buf[i++]='\\';
+                sprintf(buf+i,"%02X",c);
+                i+=2;
+        }
+   }
+   if (i==0) return 0;
+   buf[i]=0;
+   //fprintf(stderr,"================ > file2nvram %s = [%s] \n",varname,buf); 
+   nvram_set(varname,buf);
+   //nvram_commit(); //Barry adds for test
+}
+
+int nvram2file(char *varname, char *filename) {
+   FILE *fp;
+   int c,tmp;
+   int i=0,j=0;
+   char *buf;
+   char mem[10000];
+   
+   if ( !(fp=fopen(filename,"wb") ))
+        return 0;
+        
+   buf=strdup(nvram_safe_get(varname));
+   //fprintf(stderr,"=================> nvram2file %s = [%s] \n",varname,buf);
+   while (  buf[i] && j < sizeof(mem)-3 ) {
+        if (buf[i] == '\\')  {
+                i++;
+                tmp=buf[i+2];
+                buf[i+2]=0;
+                sscanf(buf+i,"%02X",&c);
+                buf[i+2]=tmp;
+                i+=2;
+                mem[j]=c;j++;
+        } else if (buf[i] == '~') {
+               mem[j]=0;j++;
+               i++;
+        } else {
+                mem[j]=buf[i];j++;
+                i++;
+        }       
+   }
+   if (j<=0) return j;
+   j=fwrite(mem,1,j,fp);
+   fclose(fp);
+   free(buf);
+   return j;
+}  
+
+int
+check_action(void)
+{
+       char buf[80] = "";
+       
+       if(file_to_buf(ACTION_FILE, buf, sizeof(buf))){
+               if(!strcmp(buf, "ACT_TFTP_UPGRADE")){
+                       cprintf("Upgrading from tftp now, quiet exit....\n");
+                       return ACT_TFTP_UPGRADE;
+               }
+               else if(!strcmp(buf, "ACT_WEBS_UPGRADE")){
+                       cprintf("Upgrading from web (https) now, quiet exit....\n");
+                       return ACT_WEBS_UPGRADE;
+               }
+               else if(!strcmp(buf, "ACT_WEB_UPGRADE")){
+                       cprintf("Upgrading from web (http) now, quiet exit....\n");
+                       return ACT_WEB_UPGRADE;
+               }
+               else if(!strcmp(buf, "ACT_SW_RESTORE")){
+                       cprintf("Receive restore command from web, quiet exit....\n");
+                       return ACT_SW_RESTORE;
+               }
+               else if(!strcmp(buf, "ACT_HW_RESTORE")){
+                       cprintf("Receive restore commond from resetbutton, quiet exit....\n");
+                       return ACT_HW_RESTORE;
+               }
+       }
+       //fprintf(stderr, "Waiting for upgrading....\n");
+       return ACT_IDLE;
+}
+
+int
+file_to_buf(char *path, char *buf, int len)
+{
+       FILE *fp;
+
+       memset(buf, 0 , len);
+
+       if ((fp = fopen(path, "r"))) {
+               fgets(buf, len, fp);
+               fclose(fp);
+               return 1;
+       }
+
+       return 0;
+}
diff --git a/openwrt/package/nvram/src/shutils.c b/openwrt/package/nvram/src/shutils.c
new file mode 100644 (file)
index 0000000..49ad41a
--- /dev/null
@@ -0,0 +1,329 @@
+/*
+ * Shell-like utility functions
+ *
+ * Copyright 2004, Broadcom Corporation
+ * All Rights Reserved.
+ * 
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
+ *
+ * $Id$
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <errno.h>
+#include <error.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <unistd.h>
+#include <signal.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <termios.h>
+#include <sys/ioctl.h>
+#include <sys/time.h>
+#include <net/ethernet.h>
+
+#include <shutils.h>
+
+/*
+ * Reads file and returns contents
+ * @param      fd      file descriptor
+ * @return     contents of file or NULL if an error occurred
+ */
+char *
+fd2str(int fd)
+{
+       char *buf = NULL;
+       size_t count = 0, n;
+
+       do {
+               buf = realloc(buf, count + 512);
+               n = read(fd, buf + count, 512);
+               if (n < 0) {
+                       free(buf);
+                       buf = NULL;
+               }
+               count += n;
+       } while (n == 512);
+
+       close(fd);
+       if (buf)
+               buf[count] = '\0';
+       return buf;
+}
+
+/*
+ * Reads file and returns contents
+ * @param      path    path to file
+ * @return     contents of file or NULL if an error occurred
+ */
+char *
+file2str(const char *path)
+{
+       int fd;
+
+       if ((fd = open(path, O_RDONLY)) == -1) {
+               perror(path);
+               return NULL;
+       }
+
+       return fd2str(fd);
+}
+
+/* 
+ * Waits for a file descriptor to change status or unblocked signal
+ * @param      fd      file descriptor
+ * @param      timeout seconds to wait before timing out or 0 for no timeout
+ * @return     1 if descriptor changed status or 0 if timed out or -1 on error
+ */
+int
+waitfor(int fd, int timeout)
+{
+       fd_set rfds;
+       struct timeval tv = { timeout, 0 };
+
+       FD_ZERO(&rfds);
+       FD_SET(fd, &rfds);
+       return select(fd + 1, &rfds, NULL, NULL, (timeout > 0) ? &tv : NULL);
+}
+
+/* 
+ * Concatenates NULL-terminated list of arguments into a single
+ * commmand and executes it
+ * @param      argv    argument list
+ * @param      path    NULL, ">output", or ">>output"
+ * @param      timeout seconds to wait before timing out or 0 for no timeout
+ * @param      ppid    NULL to wait for child termination or pointer to pid
+ * @return     return value of executed command or errno
+ */
+int
+_eval(char *const argv[], char *path, int timeout, int *ppid)
+{
+       pid_t pid;
+       int status;
+       int fd;
+       int flags;
+       int sig;
+       char buf[254]="";
+       int i;
+
+       switch (pid = fork()) {
+       case -1:        /* error */
+               perror("fork");
+               return errno;
+       case 0:         /* child */
+               /* Reset signal handlers set for parent process */
+               for (sig = 0; sig < (_NSIG-1); sig++)
+                       signal(sig, SIG_DFL);
+
+               /* Clean up */
+               ioctl(0, TIOCNOTTY, 0);
+               close(STDIN_FILENO);
+               close(STDOUT_FILENO);
+               close(STDERR_FILENO);
+               setsid();
+
+               /* We want to check the board if exist UART? , add by honor 2003-12-04 */
+               if ((fd = open("/dev/console", O_RDWR)) < 0) {
+                        (void) open("/dev/null", O_RDONLY);
+                        (void) open("/dev/null", O_WRONLY);
+                        (void) open("/dev/null", O_WRONLY);
+               }
+               else{
+                       close(fd);
+                        (void) open("/dev/console", O_RDONLY);
+                        (void) open("/dev/console", O_WRONLY);
+                        (void) open("/dev/console", O_WRONLY);
+               }
+
+               /* Redirect stdout to <path> */
+               if (path) {
+                       flags = O_WRONLY | O_CREAT;
+                       if (!strncmp(path, ">>", 2)) {
+                               /* append to <path> */
+                               flags |= O_APPEND;
+                               path += 2;
+                       } else if (!strncmp(path, ">", 1)) {
+                               /* overwrite <path> */
+                               flags |= O_TRUNC;
+                               path += 1;
+                       }
+                       if ((fd = open(path, flags, 0644)) < 0)
+                               perror(path);
+                       else {
+                               dup2(fd, STDOUT_FILENO);
+                               close(fd);
+                       }
+               }
+
+               /* execute command */
+               for(i=0 ; argv[i] ; i++)
+                       snprintf(buf+strlen(buf), sizeof(buf), "%s ", argv[i]);
+               dprintf("cmd=[%s]\n", buf);
+               setenv("PATH", "/sbin:/bin:/usr/sbin:/usr/bin", 1);
+               alarm(timeout);
+               execvp(argv[0], argv);
+               perror(argv[0]);
+               exit(errno);
+       default:        /* parent */
+               if (ppid) {
+                       *ppid = pid;
+                       return 0;
+               } else {
+                       waitpid(pid, &status, 0);
+                       if (WIFEXITED(status))
+                               return WEXITSTATUS(status);
+                       else
+                               return status;
+               }
+       }
+}
+
+/* 
+ * Concatenates NULL-terminated list of arguments into a single
+ * commmand and executes it
+ * @param      argv    argument list
+ * @return     stdout of executed command or NULL if an error occurred
+ */
+char *
+_backtick(char *const argv[])
+{
+       int filedes[2];
+       pid_t pid;
+       int status;
+       char *buf = NULL;
+
+       /* create pipe */
+       if (pipe(filedes) == -1) {
+               perror(argv[0]);
+               return NULL;
+       }
+
+       switch (pid = fork()) {
+       case -1:        /* error */
+               return NULL;
+       case 0:         /* child */
+               close(filedes[0]);      /* close read end of pipe */
+               dup2(filedes[1], 1);    /* redirect stdout to write end of pipe */
+               close(filedes[1]);      /* close write end of pipe */
+               execvp(argv[0], argv);
+               exit(errno);
+               break;
+       default:        /* parent */
+               close(filedes[1]);      /* close write end of pipe */
+               buf = fd2str(filedes[0]);
+               waitpid(pid, &status, 0);
+               break;
+       }
+       
+       return buf;
+}
+
+/* 
+ * Kills process whose PID is stored in plaintext in pidfile
+ * @param      pidfile PID file
+ * @return     0 on success and errno on failure
+ */
+int
+kill_pidfile(char *pidfile)
+{
+       FILE *fp = fopen(pidfile, "r");
+       char buf[256];
+
+       if (fp && fgets(buf, sizeof(buf), fp)) {
+               pid_t pid = strtoul(buf, NULL, 0);
+               fclose(fp);
+               return kill(pid, SIGTERM);
+       } else
+               return errno;
+}
+
+/*
+ * fread() with automatic retry on syscall interrupt
+ * @param      ptr     location to store to
+ * @param      size    size of each element of data
+ * @param      nmemb   number of elements
+ * @param      stream  file stream
+ * @return     number of items successfully read
+ */
+int
+safe_fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
+{
+       size_t ret = 0;
+
+       do {
+               clearerr(stream);
+               ret += fread((char *)ptr + (ret * size), size, nmemb - ret, stream);
+       } while (ret < nmemb && ferror(stream) && errno == EINTR);
+
+       return ret;
+}
+
+/*
+ * fwrite() with automatic retry on syscall interrupt
+ * @param      ptr     location to read from
+ * @param      size    size of each element of data
+ * @param      nmemb   number of elements
+ * @param      stream  file stream
+ * @return     number of items successfully written
+ */
+int
+safe_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
+{
+       size_t ret = 0;
+
+       do {
+               clearerr(stream);
+               ret += fwrite((char *)ptr + (ret * size), size, nmemb - ret, stream);
+       } while (ret < nmemb && ferror(stream) && errno == EINTR);
+
+       return ret;
+}
+
+/*
+ * Convert Ethernet address string representation to binary data
+ * @param      a       string in xx:xx:xx:xx:xx:xx notation
+ * @param      e       binary data
+ * @return     TRUE if conversion was successful and FALSE otherwise
+ */
+int
+ether_atoe(const char *a, unsigned char *e)
+{
+       char *c = (char *) a;
+       int i = 0;
+
+       memset(e, 0, ETHER_ADDR_LEN);
+       for (;;) {
+               e[i++] = (unsigned char) strtoul(c, &c, 16);
+               if (!*c++ || i == ETHER_ADDR_LEN)
+                       break;
+       }
+       return (i == ETHER_ADDR_LEN);
+}
+
+/*
+ * Convert Ethernet address binary data to string representation
+ * @param      e       binary data
+ * @param      a       string in xx:xx:xx:xx:xx:xx notation
+ * @return     a
+ */
+char *
+ether_etoa(const unsigned char *e, char *a)
+{
+       char *c = a;
+       int i;
+
+       for (i = 0; i < ETHER_ADDR_LEN; i++) {
+               if (i)
+                       *c++ = ':';
+               c += sprintf(c, "%02X", e[i] & 0xff);
+       }
+       return a;
+}
diff --git a/openwrt/package/nvram/src/wl.c b/openwrt/package/nvram/src/wl.c
new file mode 100644 (file)
index 0000000..f09317a
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Wireless network adapter utilities
+ *
+ * Copyright 2004, Broadcom Corporation
+ * All Rights Reserved.
+ * 
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
+ *
+ * $Id$
+ */
+#include <string.h>
+
+#include <typedefs.h>
+#include <wlutils.h>
+
+int
+wl_probe(char *name)
+{
+       int ret, val;
+
+       /* Check interface */
+       if ((ret = wl_ioctl(name, WLC_GET_MAGIC, &val, sizeof(val))))
+               return ret;
+       if (val != WLC_IOCTL_MAGIC)
+               return -1;
+       if ((ret = wl_ioctl(name, WLC_GET_VERSION, &val, sizeof(val))))
+               return ret;
+       if (val > WLC_IOCTL_VERSION)
+               return -1;
+
+       return ret;
+}
+
+int
+wl_set_val(char *name, char *var, void *val, int len)
+{
+       char buf[128];
+       int buf_len;
+
+       /* check for overflow */
+       if ((buf_len = strlen(var)) + 1 + len > sizeof(buf))
+               return -1;
+       
+       strcpy(buf, var);
+       buf_len += 1;
+
+       /* append int value onto the end of the name string */
+       memcpy(&buf[buf_len], val, len);
+       buf_len += len;
+
+       return wl_ioctl(name, WLC_SET_VAR, buf, buf_len);
+}
+
+int
+wl_get_val(char *name, char *var, void *val, int len)
+{
+       char buf[128];
+       int ret;
+
+       /* check for overflow */
+       if (strlen(var) + 1 > sizeof(buf) || len > sizeof(buf))
+               return -1;
+       
+       strcpy(buf, var);
+       if ((ret = wl_ioctl(name, WLC_GET_VAR, buf, sizeof(buf))))
+               return ret;
+
+       memcpy(val, buf, len);
+       return 0;
+}
+
+int
+wl_set_int(char *name, char *var, int val)
+{
+       return wl_set_val(name, var, &val, sizeof(val));
+}
+
+int
+wl_get_int(char *name, char *var, int *val)
+{
+       return wl_get_val(name, var, val, sizeof(*val));
+}
+
diff --git a/openwrt/package/nvram/src/wl_linux.c b/openwrt/package/nvram/src/wl_linux.c
new file mode 100644 (file)
index 0000000..126a40b
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Wireless network adapter utilities (linux-specific)
+ *
+ * Copyright 2004, Broadcom Corporation
+ * All Rights Reserved.
+ * 
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
+ *
+ * $Id$
+ */
+
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/ioctl.h>
+#include <net/if.h>
+
+#include <typedefs.h>
+#include <wlioctl.h>
+#include <wlutils.h>
+
+int
+wl_ioctl(char *name, int cmd, void *buf, int len)
+{
+       struct ifreq ifr;
+       wl_ioctl_t ioc;
+       int ret = 0;
+       int s;
+
+       /* open socket to kernel */
+       if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+               perror("socket");
+               return errno;
+       }
+
+       /* do it */
+       ioc.cmd = cmd;
+       ioc.buf = buf;
+       ioc.len = len;
+       strncpy(ifr.ifr_name, name, IFNAMSIZ);
+       ifr.ifr_data = (caddr_t) &ioc;
+       if ((ret = ioctl(s, SIOCDEVPRIVATE, &ifr)) < 0)
+               if (cmd != WLC_GET_MAGIC)
+                       perror(ifr.ifr_name);
+
+       /* cleanup */
+       close(s);
+       return ret;
+}
+
+int
+wl_hwaddr(char *name, unsigned char *hwaddr)
+{
+       struct ifreq ifr;
+       int ret = 0;
+       int s;
+
+       /* open socket to kernel */
+       if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+               perror("socket");
+               return errno;
+       }
+
+       /* do it */
+       strncpy(ifr.ifr_name, name, IFNAMSIZ);
+       if ((ret = ioctl(s, SIOCGIFHWADDR, &ifr)) == 0)
+               memcpy(hwaddr, ifr.ifr_hwaddr.sa_data, ETHER_ADDR_LEN);
+
+       /* cleanup */
+       close(s);
+       return ret;
+}      
+
index 10c7bec74cbbd92af21f505307c0995b55deefb1..35a15b37e29c980f6cd7e081f23a938ff357638a 100644 (file)
@@ -7,7 +7,10 @@ PKG_VERSION:=2.2.26
 PKG_RELEASE:=1
 PKG_MD5SUM:=afc8700b5738da863b30208e1d3e9de8
 
-PKG_SOURCE_URL:=ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/
+PKG_SOURCE_URL:=ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/ \
+       ftp://sunsite.cnlab-switch.ch/mirror/OpenLDAP/openldap-release/ \
+       ftp://ftp.nl.uu.net/pub/unix/db/openldap/openldap-release/ \
+       ftp://ftp.plig.org/pub/OpenLDAP/openldap-release/
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
 PKG_CAT:=zcat
 
index 4b2ffe9df611fd18719b0b0c360a22c60ded786a..bb485e788c49acec44ad5ff4a71d7b85e4a813b0 100644 (file)
@@ -32,4 +32,4 @@ if [ -z "$(grep ^\\${name}: ${IPKG_INSTROOT}/etc/passwd)" ]; then
 fi
 
 grep -q '^ntp[[:space:]]*123/udp' ${IPKG_INSTROOT}/etc/services 2>/dev/null
-[ $? -ne 0 ] && echo "ntp      123/udp" >>${IPKG_INSTROOT}/etc/services
+[ $? -eq 0 ] || echo "ntp      123/udp" >>${IPKG_INSTROOT}/etc/services
index 01bd2d12d2a6d41dc777ae201e6519d34a16e9bf..4e902adb4e8ed0e9f5e8a290ef13ed16ec1ebf6c 100644 (file)
@@ -24,29 +24,34 @@ config BR2_PACKAGE_OPENSSH_CLIENT
        default m if CONFIG_DEVEL
        depends BR2_PACKAGE_OPENSSH
        select BR2_PACKAGE_LIBOPENSSL
+       select BR2_PACKAGE_ZLIB
 
 config BR2_PACKAGE_OPENSSH_CLIENT_UTILS
        tristate "openssh-client-utils - OpenSSH client utilities"
        default m if CONFIG_DEVEL
        depends BR2_PACKAGE_OPENSSH_CLIENT
+       select BR2_PACKAGE_ZLIB
 
 config BR2_PACKAGE_OPENSSH_SERVER
        tristate "openssh-server - OpenSSH server"
        default m if CONFIG_DEVEL
        depends BR2_PACKAGE_OPENSSH
        select BR2_PACKAGE_LIBOPENSSL
+       select BR2_PACKAGE_ZLIB
 
 config BR2_PACKAGE_OPENSSH_SFTP_CLIENT
        tristate "openssh-sftp-client - OpenSSH SFTP client"
        default m if CONFIG_DEVEL
        depends BR2_PACKAGE_OPENSSH
        select BR2_PACKAGE_LIBOPENSSL
+       select BR2_PACKAGE_ZLIB
 
 config BR2_PACKAGE_OPENSSH_SFTP_SERVER
        tristate "openssh-sftp-server - OpenSSH SFTP server"
        default m if CONFIG_DEVEL
        depends BR2_PACKAGE_OPENSSH
        select BR2_PACKAGE_LIBOPENSSL
+       select BR2_PACKAGE_ZLIB
 
 endmenu
 
index bb23691954958944974d09d2264a8de5e1aaee68..ed615b4ea619189f22dfb96db1301557efb680a1 100755 (executable)
@@ -2,7 +2,7 @@
 
 for type in rsa dsa; do {
   # check for keys
-  key=/etc/ssh/ssh_${type}_host_key
+  key=/etc/ssh/ssh_host_${type}_key
   [ ! -f $key ] && {
     # generate missing keys
     [ -x /usr/bin/ssh-keygen ] && {
index 9db240276a133cbd6cb3c92862f130f7f760a708..f3c6d35b2e1b03a1b4c257cffe693db29f702b8d 100644 (file)
@@ -1,5 +1,5 @@
 config BR2_PACKAGE_OPENSWAN
-       tristate "Openswan"
+       tristate "Openswan - ipsec implementation"
        select BR2_PACKAGE_LIBGMP
        select BR2_PACKAGE_KMOD_OPENSWAN
        default m if CONFIG_DEVEL
index e84dccb94febbb0c2e503ead2d34e98052425d69..12c35ba79ec986a8933d1fa294e865af96bf8980 100644 (file)
@@ -16,6 +16,11 @@ config BR2_PACKAGE_OPENVPN_SERVER
        default y
        depends BR2_PACKAGE_OPENVPN
 
+config BR2_PACKAGE_OPENVPN_HTTP
+       bool "Enable http proxy support"
+       default y
+       depends BR2_PACKAGE_OPENVPN
+
 config BR2_PACKAGE_OPENVPN_LZO
        bool "Enable transparent compression (lzo)"
        default y
index ceca469a0d9033fc4340debc4ecad2667c1085f1..bf0ada2c431ca6d11955eff2c98ce393ca37ca0c 100644 (file)
@@ -3,9 +3,9 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openvpn
-PKG_VERSION:=2.0
+PKG_VERSION:=2.0.2
 PKG_RELEASE:=1
-PKG_MD5SUM:=7401faebc6baee9add32608709c54eec
+PKG_MD5SUM:=862f8788f080f669b1ae00a74ef68001
 
 PKG_SOURCE_URL:=http://openvpn.net/release @SF/openvpn
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
@@ -28,6 +28,9 @@ endif
 ifneq ($(BR2_PACKAGE_OPENVPN_SERVER),y)
 DISABLE_SERVER:=--disable-server
 endif
+ifneq ($(BR2_PACKAGE_OPENVPN_HTTP),y)
+DISABLE_HTTP:=--disable-http
+endif
 
 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
        (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
@@ -62,9 +65,9 @@ $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
                  --disable-plugins \
                  --disable-management \
                  --disable-socks \
-                 --disable-http \
                  $(DISABLE_LZO) \
                  $(DISABLE_SERVER) \
+                 $(DISABLE_HTTP) \
        );
        touch $(PKG_BUILD_DIR)/.configured
 
diff --git a/openwrt/package/openwrt/Makefile b/openwrt/package/openwrt/Makefile
deleted file mode 100644 (file)
index 7e7b954..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-# $Id$
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME := openwrt-utils
-PKG_RELEASE := 1
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-PKG_IPK:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_RELEASE)_$(ARCH).ipk
-PKG_IPK_DIR:=$(PKG_BUILD_DIR)/ipkg
-
-SHARED_INCLUDE:=${shell pwd}/include
-
-libshared-compile libnvram-compile:
-       @$(MAKE) -C $(patsubst %-compile,%,$@) compile
-       
-libshared-install libnvram-install: libshared-compile libnvram-compile
-       @$(MAKE) -C $(patsubst %-install,%,$@) install
-
-libshared-clean libnvram-clean wlc-clean:
-       @$(MAKE) -C $(patsubst %-clean,%,$@) clean
-
-$(PKG_IPK_DIR)/sbin/mtd: mtd.c
-       mkdir -p $(PKG_IPK_DIR)/sbin
-       $(TARGET_CC) -o $@ $<
-
-$(PKG_IPK_DIR)/sbin/jffs2root: jffs2root.c
-       mkdir -p $(PKG_IPK_DIR)/sbin
-       $(TARGET_CC) -o $@ $<
-
-$(PKG_IPK_DIR)/usr/sbin/wlc: wlc.c libshared-install
-       mkdir -p $(PKG_IPK_DIR)/usr/sbin
-       $(TARGET_CC) -o $@ $< -lshared -L./libshared -I$(SHARED_INCLUDE)
-
-$(PKG_IPK): $(PKG_IPK_DIR)/sbin/mtd $(PKG_IPK_DIR)/sbin/jffs2root $(PKG_IPK_DIR)/usr/sbin/wlc
-       $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_IPK_DIR) $(PKG_NAME).control $(PKG_RELEASE) $(ARCH)
-       $(STRIP) $(PKG_IPK_DIR)/usr/sbin/*
-       $(STRIP) $(PKG_IPK_DIR)/sbin/*
-       mkdir -p $(PACKAGE_DIR)
-       $(IPKG_BUILD) $(PKG_IPK_DIR) $(PACKAGE_DIR)
-
-$(IPKG_STATE_DIR)/info/$(PKG_NAME).list: $(PKG_IPK)
-       $(IPKG) install $<
-
-source: 
-prepare: 
-compile: prepare libnvram-compile libshared-compile $(PKG_IPK) $(PKG_WLCOMPAT)
-       mkdir -p $(STAGING_DIR)/usr/include
-       cp -a ./include/* $(STAGING_DIR)/usr/include/
-install: libnvram-install libshared-install \
-        $(IPKG_STATE_DIR)/info/$(PKG_NAME).list \
-
-clean: libshared-clean libnvram-clean
-       rm -rf $(PKG_BUILD_DIR)
-       rm -f $(PKG_IPK)
diff --git a/openwrt/package/openwrt/include/bcmnvram.h b/openwrt/package/openwrt/include/bcmnvram.h
deleted file mode 100644 (file)
index 3c45263..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * NVRAM variable manipulation
- *
- * Copyright 2004, Broadcom Corporation
- * All Rights Reserved.
- * 
- * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
- * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
- * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
- *
- * $Id$
- */
-
-#ifndef _bcmnvram_h_
-#define _bcmnvram_h_
-
-#ifndef _LANGUAGE_ASSEMBLY
-
-#include <typedefs.h>
-
-struct nvram_header {
-       uint32 magic;
-       uint32 len;
-       uint32 crc_ver_init;    /* 0:7 crc, 8:15 ver, 16:27 init, mem. test 28, 29-31 reserved */
-       uint32 config_refresh;  /* 0:15 config, 16:31 refresh */
-       uint32 config_ncdl;     /* ncdl values for memc */
-};
-
-struct nvram_tuple {
-       char *name;
-       char *value;
-       struct nvram_tuple *next;
-};
-
-/*
- * Initialize NVRAM access. May be unnecessary or undefined on certain
- * platforms.
- */
-extern int nvram_init(void *sbh);
-
-/*
- * Disable NVRAM access. May be unnecessary or undefined on certain
- * platforms.
- */
-extern void nvram_exit(void);
-
-/*
- * Get the value of an NVRAM variable. The pointer returned may be
- * invalid after a set.
- * @param      name    name of variable to get
- * @return     value of variable or NULL if undefined
- */
-extern char * nvram_get(const char *name);
-
-/* 
- * Get the value of an NVRAM variable.
- * @param      name    name of variable to get
- * @return     value of variable or NUL if undefined
- */
-#define nvram_safe_get(name) (nvram_get(name) ? : "")
-
-#define nvram_safe_unset(name) ({ \
-       if(nvram_get(name)) \
-               nvram_unset(name); \
-})
-
-#define nvram_safe_set(name, value) ({ \
-       if(!nvram_get(name) || strcmp(nvram_get(name), value)) \
-               nvram_set(name, value); \
-})
-
-/*
- * Match an NVRAM variable.
- * @param      name    name of variable to match
- * @param      match   value to compare against value of variable
- * @return     TRUE if variable is defined and its value is string equal
- *             to match or FALSE otherwise
- */
-static INLINE int
-nvram_match(char *name, char *match) {
-       const char *value = nvram_get(name);
-       return (value && !strcmp(value, match));
-}
-
-/*
- * Inversely match an NVRAM variable.
- * @param      name    name of variable to match
- * @param      match   value to compare against value of variable
- * @return     TRUE if variable is defined and its value is not string
- *             equal to invmatch or FALSE otherwise
- */
-static INLINE int
-nvram_invmatch(char *name, char *invmatch) {
-       const char *value = nvram_get(name);
-       return (value && strcmp(value, invmatch));
-}
-
-/*
- * Set the value of an NVRAM variable. The name and value strings are
- * copied into private storage. Pointers to previously set values
- * may become invalid. The new value may be immediately
- * retrieved but will not be permanently stored until a commit.
- * @param      name    name of variable to set
- * @param      value   value of variable
- * @return     0 on success and errno on failure
- */
-extern int nvram_set(const char *name, const char *value);
-
-/*
- * Unset an NVRAM variable. Pointers to previously set values
- * remain valid until a set.
- * @param      name    name of variable to unset
- * @return     0 on success and errno on failure
- * NOTE: use nvram_commit to commit this change to flash.
- */
-extern int nvram_unset(const char *name);
-
-/*
- * Commit NVRAM variables to permanent storage. All pointers to values
- * may be invalid after a commit.
- * NVRAM values are undefined after a commit.
- * @return     0 on success and errno on failure
- */
-extern int nvram_commit(void);
-
-/*
- * Get all NVRAM variables (format name=value\0 ... \0\0).
- * @param      buf     buffer to store variables
- * @param      count   size of buffer in bytes
- * @return     0 on success and errno on failure
- */
-extern int nvram_getall(char *buf, int count);
-
-extern int file2nvram(char *filename, char *varname);
-extern int nvram2file(char *varname, char *filename);
-
-#endif /* _LANGUAGE_ASSEMBLY */
-
-#define NVRAM_MAGIC            0x48534C46      /* 'FLSH' */
-#define NVRAM_VERSION          1
-#define NVRAM_HEADER_SIZE      20
-#define NVRAM_SPACE            0x8000
-#define FLASH_BASE             0xbfc00000      /* Extif core */
-#define FLASH_MIN              0x00100000      /* Minimum flash size */
-#define FLASH_MAX              0x00400000      /* Maximum flash size with extif */
-
-#endif /* _bcmnvram_h_ */
diff --git a/openwrt/package/openwrt/include/bcmutils.h b/openwrt/package/openwrt/include/bcmutils.h
deleted file mode 100644 (file)
index 05ad41d..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Misc useful os-independent macros and functions.
- *
- * Copyright 2004, Broadcom Corporation
- * All Rights Reserved.
- * 
- * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
- * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
- * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
- * $Id$
- */
-
-#ifndef        _bcmutils_h_
-#define        _bcmutils_h_
-
-#ifndef MIN
-#define        MIN(a, b)               (((a)<(b))?(a):(b))
-#endif
-
-#ifndef MAX
-#define        MAX(a, b)               (((a)>(b))?(a):(b))
-#endif
-
-#define CEIL(x, y)             (((x) + ((y)-1)) / (y))
-#define        ROUNDUP(x, y)           ((((ulong)(x)+((y)-1))/(y))*(y))
-#define        ISALIGNED(a, x)         (((uint)(a) & ((x)-1)) == 0)
-#define        ISPOWEROF2(x)           ((((x)-1)&(x))==0)
-#define        OFFSETOF(type, member)  ((uint) &((type *)0)->member)
-#define ARRAYSIZE(a)           (sizeof(a)/sizeof(a[0]))
-
-/* bit map related macros */
-#ifndef setbit
-#define        NBBY    8       /* 8 bits per byte */
-#define        setbit(a,i)     ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
-#define        clrbit(a,i)     ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
-#define        isset(a,i)      ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
-#define        isclr(a,i)      (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
-#endif
-
-#define        NBITS(type)     (sizeof (type) * 8)
-
-#define _BCM_U 0x01    /* upper */
-#define _BCM_L 0x02    /* lower */
-#define _BCM_D 0x04    /* digit */
-#define _BCM_C 0x08    /* cntrl */
-#define _BCM_P 0x10    /* punct */
-#define _BCM_S 0x20    /* white space (space/lf/tab) */
-#define _BCM_X 0x40    /* hex digit */
-#define _BCM_SP        0x80    /* hard space (0x20) */
-
-extern unsigned char bcm_ctype[];
-#define bcm_ismask(x) (bcm_ctype[(int)(unsigned char)(x)])
-
-#define bcm_isalnum(c) ((bcm_ismask(c)&(_BCM_U|_BCM_L|_BCM_D)) != 0)
-#define bcm_isalpha(c) ((bcm_ismask(c)&(_BCM_U|_BCM_L)) != 0)
-#define bcm_iscntrl(c) ((bcm_ismask(c)&(_BCM_C)) != 0)
-#define bcm_isdigit(c) ((bcm_ismask(c)&(_BCM_D)) != 0)
-#define bcm_isgraph(c) ((bcm_ismask(c)&(_BCM_P|_BCM_U|_BCM_L|_BCM_D)) != 0)
-#define bcm_islower(c) ((bcm_ismask(c)&(_BCM_L)) != 0)
-#define bcm_isprint(c) ((bcm_ismask(c)&(_BCM_P|_BCM_U|_BCM_L|_BCM_D|_BCM_SP)) != 0)
-#define bcm_ispunct(c) ((bcm_ismask(c)&(_BCM_P)) != 0)
-#define bcm_isspace(c) ((bcm_ismask(c)&(_BCM_S)) != 0)
-#define bcm_isupper(c) ((bcm_ismask(c)&(_BCM_U)) != 0)
-#define bcm_isxdigit(c)        ((bcm_ismask(c)&(_BCM_D|_BCM_X)) != 0)
-
-/*
- * Spin at most 'us' microseconds while 'exp' is true.
- * Caller should explicitly test 'exp' when this completes
- * and take appropriate error action if 'exp' is still true.
- */
-#define SPINWAIT(exp, us) { \
-       uint countdown = (us) + 9; \
-       while ((exp) && (countdown >= 10)) {\
-               OSL_DELAY(10); \
-               countdown -= 10; \
-       } \
-}
-
-/* generic osl packet queue */
-struct pktq {
-       void *head;     /* first packet to dequeue */
-       void *tail;     /* last packet to dequeue */
-       uint len;       /* number of queued packets */
-       uint maxlen;    /* maximum number of queued packets */
-       bool priority;  /* enqueue by packet priority */
-};
-#define DEFAULT_QLEN   128
-
-#define        pktq_len(q)     ((q)->len)
-#define        pktq_avail(q)   ((q)->maxlen - (q)->len)
-#define        pktq_head(q)    ((q)->head)
-#define        pktq_full(q)    ((q)->len >= (q)->maxlen)
-
-/* crc defines */
-#define CRC8_INIT_VALUE  0xff          /* Initial CRC8 checksum value */
-#define CRC8_GOOD_VALUE  0x9f          /* Good final CRC8 checksum value */
-#define CRC16_INIT_VALUE 0xffff                /* Initial CRC16 checksum value */
-#define CRC16_GOOD_VALUE 0xf0b8                /* Good final CRC16 checksum value */
-#define CRC32_INIT_VALUE 0xffffffff    /* Initial CRC32 checksum value */
-#define CRC32_GOOD_VALUE 0xdebb20e3    /* Good final CRC32 checksum value */
-
-/* tag_ID/length/value_buffer tuple */
-typedef struct bcm_tlv {
-       uint8   id;
-       uint8   len;
-       uint8   data[1];
-} bcm_tlv_t;
-
-/* Check that bcm_tlv_t fits into the given buflen */
-#define bcm_valid_tlv(elt, buflen) ((buflen) >= 2 && (buflen) >= 2 + (elt)->len)
-
-/* buffer length for ethernet address from bcm_ether_ntoa() */
-#define ETHER_ADDR_STR_LEN     18
-
-/*
-* load 32-bit value from unaligned byte array
-*/
-#ifdef IL_BIGENDIAN
-#define load32_ua(a)   ((((uint8 *)(a))[0] << 24) + (((uint8 *)(a))[1] << 16) + \
-                       (((uint8 *)(a))[2] << 8) + ((uint8 *)(a))[3])
-#else
-#define load32_ua(a)   ((((uint8 *)(a))[3] << 24) + (((uint8 *)(a))[2] << 16) + \
-                       (((uint8 *)(a))[1] << 8) + ((uint8 *)(a))[0])
-#endif
-
-/* externs */
-extern uint bcm_atoi(char *s);
-extern uchar bcm_toupper(uchar c);
-extern ulong bcm_strtoul(char *cp, char **endp, uint base);
-extern void deadbeef(char *p, uint len);
-extern void prhex(char *msg, uchar *buf, uint len);
-extern void prpkt(char *msg, void *drv, void *p0);
-extern uint pktcopy(void *drv, void *p, uint offset, int len, uchar *buf);
-extern uint pkttotlen(void *drv, void *);
-extern uchar *bcm_ether_ntoa(char *ea, char *buf);
-extern int bcm_ether_atoe(char *p, char *ea);
-extern void bcm_mdelay(uint ms);
-extern char *getvar(char *vars, char *name);
-extern int getintvar(char *vars, char *name);
-extern char *bcmstrstr(char *haystack, char *needle);
-
-extern uint8 crc8(uint8 *p, uint nbytes, uint8 crc);
-extern uint16 crc16(uint8 *p, uint nbytes, uint16 crc);
-extern uint32 crc32(uint8 *p, uint nbytes, uint32 crc);
-extern bcm_tlv_t *bcm_next_tlv(bcm_tlv_t *elt, int *buflen);
-extern bcm_tlv_t *bcm_parse_tlvs(void *buf, int buflen, uint key);
-extern bcm_tlv_t *bcm_parse_ordered_tlvs(void *buf, int buflen, uint key);
-extern void pktq_init(struct pktq *q, uint maxlen, bool priority);
-extern bool pktenq(struct pktq *q, void *p, bool lifo);
-extern void *pktdeq(struct pktq *q);
-
-#define        bcmlog(fmt, a1, a2)
-#define        bcmdumplog(buf, size)   *buf = '\0'
-#define        bcmdumplogent(buf, idx) -1
-
-#endif /* _bcmutils_h_ */
diff --git a/openwrt/package/openwrt/include/cy_conf.h b/openwrt/package/openwrt/include/cy_conf.h
deleted file mode 100644 (file)
index dbe387b..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-
-#define        DNSMASQ_SUPPORT 1
-#define        CONFIG_DNSMASQ  y
-#define        UDHCPD_SUPPORT  1
-#define        CONFIG_UDHCPD   y
-#define        UDHCPC_SUPPORT  1
-#define        CONFIG_UDHCPC   y
-#define        PPPOE_SUPPORT   1
-#define        CONFIG_PPPOE    y
-#define        PPTP_SUPPORT    1
-#define        CONFIG_PPTP     y
-#define        L2TP_SUPPORT    1
-#define        CONFIG_L2TP     y
-#define        PPPD_SUPPORT    1
-#define        CONFIG_PPPD     y
-#define        ZEBRA_SUPPORT   1
-#define        CONFIG_ZEBRA    y
-#define        TFTPD_SUPPORT   1
-#define        CONFIG_TFTPD    y
-#define        DDNS_SUPPORT    1
-#define        CONFIG_DDNS     y
-#define        CRON_SUPPORT    1
-#define        CONFIG_CRON     y
-#define        HTTPD_SUPPORT   1
-#define        CONFIG_HTTPD    y
-#define        GET_POST_SUPPORT        1
-#define        CONFIG_GET_POST y
-
-#if 1
-#define        HEARTBEAT_SUPPORT       1
-#define        CONFIG_HEARTBEAT        y
-#define        MULTICAST_SUPPORT       1
-#define        CONFIG_MULTICAST        y
-#define        SETUP_WIZARD_SUPPORT    1
-#define        CONFIG_SETUP_WIZARD     y
-#define        PARENTAL_CONTROL_SUPPORT        1
-#define        CONFIG_PARENTAL_CONTROL y
-#define        HTTPS_SUPPORT   1
-#define        CONFIG_HTTPS    y
-#define        EOU_SUPPORT     1
-#define        CONFIG_EOU      y
-#define        EZC_SUPPORT     1
-#define        CONFIG_EZC      y
-#define        WRITE_MAC_SUPPORT       1
-#define        CONFIG_WRITE_MAC        y
-#define        DIAG_SUPPORT    1
-#define        CONFIG_DIAG     y
-#endif
-
-#define        SPEED_BOOSTER_SUPPORT   1
-#define        CONFIG_SPEED_BOOSTER    y
-#define        XBOX_SUPPORT    1
-#define        CONFIG_XBOX     y
-
-#if 0
-#define        MPPPOE_SUPPORT  1
-#define        CONFIG_MPPPOE   y
-#define        UNNUMBERIP_SUPPORT      1
-#define        CONFIG_UNNUMBERIP       y
-#endif
-
-#define        WL_STA_SUPPORT  1
-#define        CONFIG_WL_STA   y
-#define        BACKUP_RESTORE_SUPPORT  1
-#define        CONFIG_BACKUP_RESTORE   y
-#define        PORT_TRIGGER_SUPPORT    1
-#define        CONFIG_PORT_TRIGGER     y
-#define        HW_QOS_SUPPORT  1
-#define        CONFIG_HW_QOS   y
diff --git a/openwrt/package/openwrt/include/epivers.h b/openwrt/package/openwrt/include/epivers.h
deleted file mode 100644 (file)
index e174fb5..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2004, Broadcom Corporation
- * All Rights Reserved.
- * 
- * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
- * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
- * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
- *
- * $Id$
- *
-*/
-
-#ifndef _epivers_h_
-#define _epivers_h_
-
-#ifdef linux
-#include <linux/config.h>
-#endif
-
-/* Vendor Name, ASCII, 32 chars max */
-#ifdef COMPANYNAME
-#define        HPNA_VENDOR             COMPANYNAME
-#else
-#define        HPNA_VENDOR             "Broadcom Corporation"
-#endif
-
-/* Driver Date, ASCII, 32 chars max */
-#define HPNA_DRV_BUILD_DATE    __DATE__
-
-/* Hardware Manufacture Date, ASCII, 32 chars max */
-#define HPNA_HW_MFG_DATE       "Not Specified"
-
-/* See documentation for Device Type values, 32 values max */
-#ifndef        HPNA_DEV_TYPE
-
-#if    defined(CONFIG_BRCM_VJ)
-#define HPNA_DEV_TYPE          { CDCF_V0_DEVICE_DISPLAY }
-
-#elif  defined(CONFIG_BCRM_93725)
-#define HPNA_DEV_TYPE          { CDCF_V0_DEVICE_CM_BRIDGE, CDCF_V0_DEVICE_DISPLAY }
-
-#else
-#define HPNA_DEV_TYPE          { CDCF_V0_DEVICE_PCINIC }
-
-#endif
-
-#endif /* !HPNA_DEV_TYPE */
-
-
-#define        EPI_MAJOR_VERSION       3
-
-#define        EPI_MINOR_VERSION       60
-
-#define        EPI_RC_NUMBER           13
-
-#define        EPI_INCREMENTAL_NUMBER  0
-
-#define        EPI_BUILD_NUMBER        0
-
-#define        EPI_VERSION             3,60,13,0
-
-#define        EPI_VERSION_NUM         0x033c0d00
-
-/* Driver Version String, ASCII, 32 chars max */
-#define        EPI_VERSION_STR         "3.60.13.0"
-#define        EPI_ROUTER_VERSION_STR  "3.61.13.0"
-
-#endif /* _epivers_h_ */
diff --git a/openwrt/package/openwrt/include/proto/802.11.h b/openwrt/package/openwrt/include/proto/802.11.h
deleted file mode 100644 (file)
index ea57850..0000000
+++ /dev/null
@@ -1,852 +0,0 @@
-/*
- * Copyright 2004, Broadcom Corporation      
- * All Rights Reserved.      
- *       
- * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY      
- * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM      
- * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS      
- * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.      
- *
- * Fundamental types and constants relating to 802.11 
- *
- * $Id$
- */
-
-#ifndef _802_11_H_
-#define _802_11_H_
-
-#ifndef _TYPEDEFS_H_
-#include <typedefs.h>
-#endif
-
-#ifndef _NET_ETHERNET_H_
-#include <proto/ethernet.h>
-#endif
-
-/* enable structure packing */
-#if !defined(__GNUC__)
-#pragma pack(1)
-#endif
-
-/* some platforms require stronger medicine */
-#if defined(__GNUC__)
-#define        PACKED  __attribute__((packed))
-#else
-#define        PACKED
-#endif
-
-
-#define DOT11_TU_TO_US                 1024    /* 802.11 Time Unit is 1024 microseconds */
-
-/* Generic 802.11 frame constants */
-#define DOT11_A3_HDR_LEN               24
-#define DOT11_A4_HDR_LEN               30
-#define DOT11_MAC_HDR_LEN              DOT11_A3_HDR_LEN
-#define DOT11_FCS_LEN                  4
-#define DOT11_ICV_LEN                  4
-#define DOT11_ICV_AES_LEN              8
-#define DOT11_QOS_LEN                  2
-
-#define DOT11_KEY_INDEX_SHIFT          6
-#define DOT11_IV_LEN                   4
-#define DOT11_IV_TKIP_LEN              8
-#define DOT11_IV_AES_OCB_LEN           4
-#define DOT11_IV_AES_CCM_LEN           8
-
-/* Includes MIC */
-#define DOT11_MAX_MPDU_BODY_LEN                2304
-/* A4 header + QoS + CCMP + PDU + ICV + FCS = 2352 */
-#define DOT11_MAX_MPDU_LEN             (DOT11_A4_HDR_LEN + \
-                                        DOT11_QOS_LEN + \
-                                        DOT11_IV_AES_CCM_LEN + \
-                                        DOT11_MAX_MPDU_BODY_LEN + \
-                                        DOT11_ICV_LEN + \
-                                        DOT11_FCS_LEN)
-
-#define DOT11_MAX_SSID_LEN             32
-
-/* dot11RTSThreshold */
-#define DOT11_DEFAULT_RTS_LEN          2347
-#define DOT11_MAX_RTS_LEN              2347
-
-/* dot11FragmentationThreshold */
-#define DOT11_MIN_FRAG_LEN             256
-#define DOT11_MAX_FRAG_LEN             2346    /* Max frag is also limited by aMPDUMaxLength of the attached PHY */
-#define DOT11_DEFAULT_FRAG_LEN         2346
-
-/* dot11BeaconPeriod */
-#define DOT11_MIN_BEACON_PERIOD                1
-#define DOT11_MAX_BEACON_PERIOD                0xFFFF
-
-/* dot11DTIMPeriod */
-#define DOT11_MIN_DTIM_PERIOD          1
-#define DOT11_MAX_DTIM_PERIOD          0xFF
-
-/* 802.2 LLC/SNAP header used by 802.11 per 802.1H */
-#define DOT11_LLC_SNAP_HDR_LEN 8
-#define DOT11_OUI_LEN                  3
-struct dot11_llc_snap_header {
-       uint8   dsap;                           /* always 0xAA */
-       uint8   ssap;                           /* always 0xAA */
-       uint8   ctl;                            /* always 0x03 */
-       uint8   oui[DOT11_OUI_LEN];             /* RFC1042: 0x00 0x00 0x00
-                                                  Bridge-Tunnel: 0x00 0x00 0xF8 */
-       uint16  type;                           /* ethertype */
-} PACKED;
-
-/* RFC1042 header used by 802.11 per 802.1H */
-#define RFC1042_HDR_LEN                        (ETHER_HDR_LEN + DOT11_LLC_SNAP_HDR_LEN)
-
-/* Generic 802.11 MAC header */
-/*
- * N.B.: This struct reflects the full 4 address 802.11 MAC header.
- *              The fields are defined such that the shorter 1, 2, and 3
- *              address headers just use the first k fields.
- */
-struct dot11_header {
-       uint16                  fc;             /* frame control */
-       uint16                  durid;          /* duration/ID */
-       struct ether_addr       a1;             /* address 1 */
-       struct ether_addr       a2;             /* address 2 */
-       struct ether_addr       a3;             /* address 3 */
-       uint16                  seq;            /* sequence control */
-       struct ether_addr       a4;             /* address 4 */
-} PACKED;
-
-/* Control frames */
-
-struct dot11_rts_frame {
-       uint16                  fc;             /* frame control */
-       uint16                  durid;          /* duration/ID */
-       struct ether_addr       ra;             /* receiver address */
-       struct ether_addr       ta;             /* transmitter address */
-} PACKED;
-#define        DOT11_RTS_LEN           16
-
-struct dot11_cts_frame {
-       uint16                  fc;             /* frame control */
-       uint16                  durid;          /* duration/ID */
-       struct ether_addr       ra;             /* receiver address */
-} PACKED;
-#define        DOT11_CTS_LEN           10
-
-struct dot11_ack_frame {
-       uint16                  fc;             /* frame control */
-       uint16                  durid;          /* duration/ID */
-       struct ether_addr       ra;             /* receiver address */
-} PACKED;
-#define        DOT11_ACK_LEN           10
-
-struct dot11_ps_poll_frame {
-       uint16                  fc;             /* frame control */
-       uint16                  durid;          /* AID */
-       struct ether_addr       bssid;          /* receiver address, STA in AP */
-       struct ether_addr       ta;             /* transmitter address */
-} PACKED;
-#define        DOT11_PS_POLL_LEN       16
-
-struct dot11_cf_end_frame {
-       uint16                  fc;             /* frame control */
-       uint16                  durid;          /* duration/ID */
-       struct ether_addr       ra;             /* receiver address */
-       struct ether_addr       bssid;          /* transmitter address, STA in AP */
-} PACKED;
-#define        DOT11_CS_END_LEN        16
-
-/* Management frame header */
-struct dot11_management_header {
-       uint16                  fc;             /* frame control */
-       uint16                  durid;          /* duration/ID */
-       struct ether_addr       da;             /* receiver address */
-       struct ether_addr       sa;             /* transmitter address */
-       struct ether_addr       bssid;          /* BSS ID */
-       uint16                  seq;            /* sequence control */
-} PACKED;
-#define        DOT11_MGMT_HDR_LEN      24
-
-/* Management frame payloads */
-
-struct dot11_bcn_prb {
-       uint32                  timestamp[2];
-       uint16                  beacon_interval;
-       uint16                  capability;
-} PACKED;
-#define        DOT11_BCN_PRB_LEN       12
-
-struct dot11_auth {
-       uint16                  alg;            /* algorithm */
-       uint16                  seq;            /* sequence control */
-       uint16                  status;         /* status code */
-} PACKED;
-#define DOT11_AUTH_FIXED_LEN   6               /* length of auth frame without challenge info elt */
-
-struct dot11_assoc_req {
-       uint16                  capability;     /* capability information */
-       uint16                  listen;         /* listen interval */
-} PACKED;
-
-struct dot11_assoc_resp {
-       uint16                  capability;     /* capability information */
-       uint16                  status;         /* status code */
-       uint16                  aid;            /* association ID */
-} PACKED;
-
-struct dot11_action_measure {
-       uint8   category;
-       uint8   action;
-       uint8   token;
-       uint8   data[1];
-} PACKED;
-#define DOT11_ACTION_MEASURE_LEN       3
-
-/**************
-  802.11h related definitions.
-**************/
-typedef struct {
-       uint8 id;
-       uint8 len;
-       uint8 power;
-} dot11_power_cnst_t;
-
-typedef struct {
-       uint8 min;
-       uint8 max;
-} dot11_power_cap_t;
-
-typedef struct {
-       uint8 id;
-       uint8 len;
-       uint8 tx_pwr;
-       uint8 margin;
-} dot11_tpc_rep_t;
-#define DOT11_MNG_IE_TPC_REPORT_LEN    2       /* length of IE data, not including 2 byte header */
-
-typedef struct {
-       uint8 id;
-       uint8 len;
-       uint8 first_channel;
-       uint8 num_channels;
-} dot11_supp_channels_t;
-
-struct dot11_channel_switch {
-       uint8 id;
-       uint8 len;
-       uint8 mode;
-       uint8 channel;
-       uint8 count;
-}  PACKED;
-typedef struct dot11_channel_switch dot11_channel_switch_t;
-
-/* 802.11h Measurement Request/Report IEs */
-/* Measurement Type field */
-#define DOT11_MEASURE_TYPE_BASIC       0
-#define DOT11_MEASURE_TYPE_CCA                 1
-#define DOT11_MEASURE_TYPE_RPI         2
-
-/* Measurement Mode field */
-
-/* Measurement Request Modes */
-#define DOT11_MEASURE_MODE_ENABLE      (1<<1)
-#define DOT11_MEASURE_MODE_REQUEST     (1<<2)
-#define DOT11_MEASURE_MODE_REPORT      (1<<3)
-/* Measurement Report Modes */
-#define DOT11_MEASURE_MODE_LATE        (1<<0)
-#define DOT11_MEASURE_MODE_INCAPABLE   (1<<1)
-#define DOT11_MEASURE_MODE_REFUSED     (1<<2)
-/* Basic Measurement Map bits */
-#define DOT11_MEASURE_BASIC_MAP_BSS    ((uint8)(1<<0))
-#define DOT11_MEASURE_BASIC_MAP_OFDM   ((uint8)(1<<1))
-#define DOT11_MEASURE_BASIC_MAP_UKNOWN ((uint8)(1<<2))
-#define DOT11_MEASURE_BASIC_MAP_RADAR  ((uint8)(1<<3))
-#define DOT11_MEASURE_BASIC_MAP_UNMEAS ((uint8)(1<<4))
-
-typedef struct {
-       uint8 id;
-       uint8 len;
-       uint8 token;
-       uint8 mode;
-       uint8 type;
-       uint8 channel;
-       uint8 start_time[8];
-       uint16 duration;
-} dot11_meas_req_t;
-#define DOT11_MNG_IE_MREQ_LEN 14
-/* length of Measure Request IE data not including variable len */
-#define DOT11_MNG_IE_MREQ_FIXED_LEN 3
-
-struct dot11_meas_rep {
-       uint8 id;
-       uint8 len;
-       uint8 token;
-       uint8 mode;
-       uint8 type;
-       union 
-       {
-               struct {
-                       uint8 channel;
-                       uint8 start_time[8];
-                       uint16 duration;
-                       uint8 map;
-               } PACKED basic;
-               uint8 data[1];
-       } PACKED rep;
-} PACKED;
-typedef struct dot11_meas_rep dot11_meas_rep_t;
-
-/* length of Measure Report IE data not including variable len */
-#define DOT11_MNG_IE_MREP_FIXED_LEN    3
-
-struct dot11_meas_rep_basic {
-       uint8 channel;
-       uint8 start_time[8];
-       uint16 duration;
-       uint8 map;
-} PACKED;
-typedef struct dot11_meas_rep_basic dot11_meas_rep_basic_t;
-#define DOT11_MEASURE_BASIC_REP_LEN    12
-
-struct dot11_quiet {
-       uint8 id;
-       uint8 len;
-       uint8 count;    /* TBTTs until beacon interval in quiet starts */
-       uint8 period;   /* Beacon intervals between periodic quiet periods ? */
-       uint16 duration;/* Length of quiet period, in TU's */
-       uint16 offset;  /* TU's offset from TBTT in Count field */
-} PACKED;
-typedef struct dot11_quiet dot11_quiet_t;
-
-typedef struct {
-       uint8 channel;
-       uint8 map;
-} chan_map_tuple_t;
-
-typedef struct {
-       uint8 id;
-       uint8 len;
-       uint8 eaddr[ETHER_ADDR_LEN];
-       uint8 interval;
-       chan_map_tuple_t map[1];
-} dot11_ibss_dfs_t;
-
-/* WME Elements */
-#define WME_OUI                        "\x00\x50\xf2"
-#define WME_VER                        1
-#define WME_TYPE               2
-#define WME_SUBTYPE_IE         0       /* Information Element */
-#define WME_SUBTYPE_PARAM_IE   1       /* Parameter Element */
-#define WME_SUBTYPE_TSPEC      2       /* Traffic Specification */
-
-/* WME Access Category Indices (ACIs) */
-#define AC_BE                  0       /* Best Effort */
-#define AC_BK                  1       /* Background */
-#define AC_VI                  2       /* Video */
-#define AC_VO                  3       /* Voice */
-#define AC_MAX                 4
-
-/* WME Information Element (IE) */
-struct wme_ie {
-       uint8 oui[3];
-       uint8 type;
-       uint8 subtype;
-       uint8 version;
-       uint8 acinfo;
-} PACKED;
-typedef struct wme_ie wme_ie_t;
-#define WME_IE_LEN 7
-
-struct wme_acparam {
-       uint8   ACI;
-       uint8   ECW;
-       uint16  TXOP;           /* stored in network order (ls octet first) */
-} PACKED;
-typedef struct wme_acparam wme_acparam_t;
-
-/* WME Parameter Element (PE) */
-struct wme_params {
-       uint8 oui[3];
-       uint8 type;
-       uint8 subtype;
-       uint8 version;
-       uint8 acinfo;
-       uint8 rsvd;
-       wme_acparam_t acparam[4];
-} PACKED;
-typedef struct wme_params wme_params_t;
-#define WME_PARAMS_IE_LEN      24
-
-/* acinfo */
-#define WME_COUNT_MASK         0x0f
-/* ACI */
-#define WME_AIFS_MASK  0x0f
-#define WME_ACM_MASK   0x10
-#define WME_ACI_MASK   0x60
-#define WME_ACI_SHIFT  5
-/* ECW */
-#define WME_CWMIN_MASK 0x0f
-#define WME_CWMAX_MASK 0xf0
-#define WME_CWMAX_SHIFT        4
-
-#define WME_TXOP_UNITS 32
-
-/* WME Traffic Specification (TSPEC) element */
-#define WME_SUBTYPE_TSPEC 2
-#define WME_TSPEC_HDR_LEN              2
-#define WME_TSPEC_BODY_OFF             2
-struct wme_tspec {
-       uint8 oui[DOT11_OUI_LEN];       /* WME_OUI */
-       uint8 type;                     /* WME_TYPE */
-       uint8 subtype;                  /* WME_SUBTYPE_TSPEC */
-       uint8 version;                  /* WME_VERSION */
-       uint16 ts_info;                 /* TS Info */
-       uint16 nom_msdu_size;           /* (Nominal or fixed) MSDU Size (bytes) */
-       uint16 max_msdu_size;           /* Maximum MSDU Size (bytes) */
-       uint32 min_service_interval;    /* Minimum Service Interval (us) */
-       uint32 max_service_interval;    /* Maximum Service Interval (us) */
-       uint32 inactivity_interval;     /* Inactivity Interval (us) */
-       uint32 service_start;           /* Service Start Time (us) */
-       uint32 min_rate;                /* Minimum Data Rate (bps) */
-       uint32 mean_rate;               /* Mean Data Rate (bps) */
-       uint32 max_burst_size;          /* Maximum Burst Size (bytes) */
-       uint32 min_phy_rate;            /* Minimum PHY Rate (bps) */
-       uint32 peak_rate;               /* Peak Data Rate (bps) */
-       uint32 delay_bound;             /* Delay Bound (us) */
-       uint16 surplus_bandwidth;       /* Surplus Bandwidth Allowance Factor */
-       uint16 medium_time;             /* Medium Time (32 us/s periods) */
-} PACKED;
-typedef struct wme_tspec wme_tspec_t;
-#define WME_TSPEC_LEN 56               /* not including 2-byte header */
-
-/* ts_info */
-/* 802.1D priority is duplicated - bits 13-11 AND bits 3-1 */
-#define TS_INFO_PRIO_SHIFT_HI          11
-#define TS_INFO_PRIO_MASK_HI           (0x7 << TS_INFO_PRIO_SHIFT_HI)
-#define TS_INFO_PRIO_SHIFT_LO          1
-#define TS_INFO_PRIO_MASK_LO           (0x7 << TS_INFO_PRIO_SHIFT_LO)
-#define TS_INFO_CONTENTION_SHIFT       7
-#define TS_INFO_CONTENTION_MASK                (0x1 << TS_INFO_CONTENTION_SHIFT)
-#define TS_INFO_DIRECTION_SHIFT                5
-#define TS_INFO_DIRECTION_MASK         (0x3 << TS_INFO_DIRECTION_SHIFT)
-#define TS_INFO_UPLINK                 (0 << TS_INFO_DIRECTION_SHIFT)
-#define TS_INFO_DOWNLINK               (1 << TS_INFO_DIRECTION_SHIFT)
-#define TS_INFO_BIDIRECTIONAL          (3 << TS_INFO_DIRECTION_SHIFT)
-
-/* nom_msdu_size */
-#define FIXED_MSDU_SIZE 0x8000         /* MSDU size is fixed */
-#define MSDU_SIZE_MASK 0x7fff          /* (Nominal or fixed) MSDU size */
-
-/* surplus_bandwidth */
-/* Represented as 3 bits of integer, binary point, 13 bits fraction */
-#define        INTEGER_SHIFT   13
-#define FRACTION_MASK  0x1FFF
-
-/* Management Notification Frame */
-struct dot11_management_notification {
-       uint8 category;                 /* DOT11_ACTION_NOTIFICATION */
-       uint8 action;
-       uint8 token;
-       uint8 status;
-       uint8 data[1];                  /* Elements */
-} PACKED;
-#define DOT11_MGMT_NOTIFICATION_LEN 4  /* Fixed length */
-
-/* WME Action Codes */
-#define WME_SETUP_REQUEST      0
-#define WME_SETUP_RESPONSE     1
-#define WME_TEARDOWN           2
-
-/* WME Setup Response Status Codes */
-#define WME_ADMISSION_ACCEPTED 0
-#define WME_INVALID_PARAMETERS 1
-#define WME_ADMISSION_REFUSED  3
-
-/* Macro to take a pointer to a beacon or probe response
- * header and return the char* pointer to the SSID info element
- */
-#define BCN_PRB_SSID(hdr) ((char*)(hdr) + DOT11_MGMT_HDR_LEN + DOT11_BCN_PRB_LEN)
-
-/* Authentication frame payload constants */
-#define DOT11_OPEN_SYSTEM      0
-#define DOT11_SHARED_KEY       1
-#define DOT11_CHALLENGE_LEN    128
-
-/* Frame control macros */
-#define FC_PVER_MASK           0x3
-#define FC_PVER_SHIFT          0
-#define FC_TYPE_MASK           0xC
-#define FC_TYPE_SHIFT          2
-#define FC_SUBTYPE_MASK                0xF0
-#define FC_SUBTYPE_SHIFT       4
-#define FC_TODS                        0x100
-#define FC_TODS_SHIFT          8
-#define FC_FROMDS              0x200
-#define FC_FROMDS_SHIFT                9
-#define FC_MOREFRAG            0x400
-#define FC_MOREFRAG_SHIFT      10
-#define FC_RETRY               0x800
-#define FC_RETRY_SHIFT         11
-#define FC_PM                  0x1000
-#define FC_PM_SHIFT            12
-#define FC_MOREDATA            0x2000
-#define FC_MOREDATA_SHIFT      13
-#define FC_WEP                 0x4000
-#define FC_WEP_SHIFT           14
-#define FC_ORDER               0x8000
-#define FC_ORDER_SHIFT         15
-
-/* sequence control macros */
-#define SEQNUM_SHIFT           4
-#define FRAGNUM_MASK           0xF
-
-/* Frame Control type/subtype defs */
-
-/* FC Types */
-#define FC_TYPE_MNG            0
-#define FC_TYPE_CTL            1
-#define FC_TYPE_DATA           2
-
-/* Management Subtypes */
-#define FC_SUBTYPE_ASSOC_REQ           0
-#define FC_SUBTYPE_ASSOC_RESP          1
-#define FC_SUBTYPE_REASSOC_REQ         2
-#define FC_SUBTYPE_REASSOC_RESP                3
-#define FC_SUBTYPE_PROBE_REQ           4
-#define FC_SUBTYPE_PROBE_RESP          5
-#define FC_SUBTYPE_BEACON              8
-#define FC_SUBTYPE_ATIM                        9
-#define FC_SUBTYPE_DISASSOC            10
-#define FC_SUBTYPE_AUTH                        11
-#define FC_SUBTYPE_DEAUTH              12
-#define FC_SUBTYPE_ACTION              13
-
-/* Control Subtypes */
-#define FC_SUBTYPE_PS_POLL             10
-#define FC_SUBTYPE_RTS                 11
-#define FC_SUBTYPE_CTS                 12
-#define FC_SUBTYPE_ACK                 13
-#define FC_SUBTYPE_CF_END              14
-#define FC_SUBTYPE_CF_END_ACK          15
-
-/* Data Subtypes */
-#define FC_SUBTYPE_DATA                        0
-#define FC_SUBTYPE_DATA_CF_ACK         1
-#define FC_SUBTYPE_DATA_CF_POLL                2
-#define FC_SUBTYPE_DATA_CF_ACK_POLL    3
-#define FC_SUBTYPE_NULL                        4
-#define FC_SUBTYPE_CF_ACK              5
-#define FC_SUBTYPE_CF_POLL             6
-#define FC_SUBTYPE_CF_ACK_POLL         7
-#define FC_SUBTYPE_QOS_DATA            8
-#define FC_SUBTYPE_QOS_NULL            12
-
-/* type-subtype combos */
-#define FC_KIND_MASK           (FC_TYPE_MASK | FC_SUBTYPE_MASK)
-
-#define FC_KIND(t, s) (((t) << FC_TYPE_SHIFT) | ((s) << FC_SUBTYPE_SHIFT))
-
-#define FC_ASSOC_REQ   FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ASSOC_REQ)
-#define FC_ASSOC_RESP  FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ASSOC_RESP)
-#define FC_REASSOC_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_REASSOC_REQ)
-#define FC_REASSOC_RESP        FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_REASSOC_RESP)
-#define FC_PROBE_REQ   FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_PROBE_REQ)
-#define FC_PROBE_RESP  FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_PROBE_RESP)
-#define FC_BEACON      FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_BEACON)
-#define FC_DISASSOC    FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_DISASSOC)
-#define FC_AUTH                FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_AUTH)
-#define FC_DEAUTH      FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_DEAUTH)
-#define FC_ACTION      FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ACTION)
-
-#define FC_PS_POLL     FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_PS_POLL)
-#define FC_RTS         FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_RTS)
-#define FC_CTS         FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CTS)
-#define FC_ACK         FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_ACK)
-#define FC_CF_END      FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CF_END)
-#define FC_CF_END_ACK  FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CF_END_ACK)
-
-#define FC_DATA                FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_DATA)
-#define FC_NULL_DATA   FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_NULL)
-#define FC_DATA_CF_ACK FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_DATA_CF_ACK)
-#define FC_QOS_DATA    FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_QOS_DATA)
-#define FC_QOS_NULL    FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_QOS_NULL)
-
-/* QoS Control Field */
-
-/* 802.1D Tag */
-#define QOS_PRIO_SHIFT         0
-#define QOS_PRIO_MASK          0x0007
-#define QOS_PRIO(qos)          (((qos) & QOS_PRIO_MASK) >> QOS_PRIO_SHIFT)
-
-/* Ack Policy (0 means Acknowledge) */
-#define QOS_ACK_SHIFT          5
-#define QOS_ACK_MASK           0x0060
-#define QOS_ACK(qos)           (((qos) & QOS_ACK_MASK) >> QOS_ACK_SHIFT)
-
-/* Management Frames */
-
-/* Management Frame Constants */
-
-/* Fixed fields */
-#define DOT11_MNG_AUTH_ALGO_LEN                2
-#define DOT11_MNG_AUTH_SEQ_LEN         2
-#define DOT11_MNG_BEACON_INT_LEN       2
-#define DOT11_MNG_CAP_LEN              2
-#define DOT11_MNG_AP_ADDR_LEN          6
-#define DOT11_MNG_LISTEN_INT_LEN       2
-#define DOT11_MNG_REASON_LEN           2
-#define DOT11_MNG_AID_LEN              2
-#define DOT11_MNG_STATUS_LEN           2
-#define DOT11_MNG_TIMESTAMP_LEN                8
-
-/* DUR/ID field in assoc resp is 0xc000 | AID */
-#define DOT11_AID_MASK                 0x3fff
-
-/* Reason Codes */
-#define DOT11_RC_RESERVED                      0
-#define DOT11_RC_UNSPECIFIED                   1       /* Unspecified reason */
-#define DOT11_RC_AUTH_INVAL                    2       /* Previous authentication no longer valid */
-#define DOT11_RC_DEAUTH_LEAVING                        3       /* Deauthenticated because sending station is
-                                                          leaving (or has left) IBSS or ESS */
-#define DOT11_RC_INACTIVITY                    4       /* Disassociated due to inactivity */
-#define DOT11_RC_BUSY                          5       /* Disassociated because AP is unable to handle
-                                                          all currently associated stations */
-#define DOT11_RC_INVAL_CLASS_2                 6       /* Class 2 frame received from
-                                                          nonauthenticated station */
-#define DOT11_RC_INVAL_CLASS_3                 7       /* Class 3 frame received from
-                                                          nonassociated station */
-#define DOT11_RC_DISASSOC_LEAVING              8       /* Disassociated because sending station is
-                                                          leaving (or has left) BSS */
-#define DOT11_RC_NOT_AUTH                      9       /* Station requesting (re)association is
-                                                          not authenticated with responding station */
-#define DOT11_RC_MAX                           23      /* Reason codes > 23 are reserved */
-
-/* Status Codes */
-#define DOT11_STATUS_SUCCESS                   0       /* Successful */
-#define DOT11_STATUS_FAILURE                   1       /* Unspecified failure */
-#define DOT11_STATUS_CAP_MISMATCH              10      /* Cannot support all requested capabilities
-                                                          in the Capability Information field */
-#define DOT11_STATUS_REASSOC_FAIL              11      /* Reassociation denied due to inability to
-                                                          confirm that association exists */
-#define DOT11_STATUS_ASSOC_FAIL                        12      /* Association denied due to reason outside
-                                                          the scope of this standard */
-#define DOT11_STATUS_AUTH_MISMATCH             13      /* Responding station does not support the
-                                                          specified authentication algorithm */
-#define DOT11_STATUS_AUTH_SEQ                  14      /* Received an Authentication frame with
-                                                          authentication transaction sequence number
-                                                          out of expected sequence */
-#define DOT11_STATUS_AUTH_CHALLENGE_FAIL       15      /* Authentication rejected because of challenge failure */
-#define DOT11_STATUS_AUTH_TIMEOUT              16      /* Authentication rejected due to timeout waiting
-                                                          for next frame in sequence */
-#define DOT11_STATUS_ASSOC_BUSY_FAIL           17      /* Association denied because AP is unable to
-                                                          handle additional associated stations */
-#define DOT11_STATUS_ASSOC_RATE_MISMATCH       18      /* Association denied due to requesting station
-                                                          not supporting all of the data rates in the
-                                                          BSSBasicRateSet parameter */
-#define DOT11_STATUS_ASSOC_SHORT_REQUIRED      19      /* Association denied due to requesting station
-                                                          not supporting the Short Preamble option */
-#define DOT11_STATUS_ASSOC_PBCC_REQUIRED       20      /* Association denied due to requesting station
-                                                          not supporting the PBCC Modulation option */
-#define DOT11_STATUS_ASSOC_AGILITY_REQUIRED    21      /* Association denied due to requesting station
-                                                          not supporting the Channel Agility option */
-#define DOT11_STATUS_ASSOC_SPECTRUM_REQUIRED   22      /* Association denied because Spectrum Management 
-                                                          capability is required. */
-#define DOT11_STATUS_ASSOC_BAD_POWER_CAP       23      /* Association denied because the info in the 
-                                                          Power Cap element is unacceptable. */
-#define DOT11_STATUS_ASSOC_BAD_SUP_CHANNELS    24      /* Association denied because the info in the 
-                                                          Supported Channel element is unacceptable */
-#define DOT11_STATUS_ASSOC_SHORTSLOT_REQUIRED  25      /* Association denied due to requesting station
-                                                          not supporting the Short Slot Time option */
-#define DOT11_STATUS_ASSOC_ERPBCC_REQUIRED     26      /* Association denied due to requesting station
-                                                          not supporting the ER-PBCC Modulation option */
-#define DOT11_STATUS_ASSOC_DSSOFDM_REQUIRED    27      /* Association denied due to requesting station
-                                                          not supporting the DSS-OFDM option */
-
-/* Info Elts, length of INFORMATION portion of Info Elts */
-#define DOT11_MNG_DS_PARAM_LEN                 1
-#define DOT11_MNG_IBSS_PARAM_LEN               2
-
-/* TIM Info element has 3 bytes fixed info in INFORMATION field,
- * followed by 1 to 251 bytes of Partial Virtual Bitmap */
-#define DOT11_MNG_TIM_FIXED_LEN                        3
-#define DOT11_MNG_TIM_DTIM_COUNT               0
-#define DOT11_MNG_TIM_DTIM_PERIOD              1
-#define DOT11_MNG_TIM_BITMAP_CTL               2
-#define DOT11_MNG_TIM_PVB                      3
-
-/* TLV defines */
-#define TLV_TAG_OFF            0
-#define TLV_LEN_OFF            1
-#define TLV_HDR_LEN            2
-#define TLV_BODY_OFF           2
-
-/* Management Frame Information Element IDs */
-#define DOT11_MNG_SSID_ID                      0
-#define DOT11_MNG_RATES_ID                     1
-#define DOT11_MNG_FH_PARMS_ID                  2
-#define DOT11_MNG_DS_PARMS_ID                  3
-#define DOT11_MNG_CF_PARMS_ID                  4
-#define DOT11_MNG_TIM_ID                       5
-#define DOT11_MNG_IBSS_PARMS_ID                        6
-#define DOT11_MNG_COUNTRY_ID                   7
-#define DOT11_MNG_HOPPING_PARMS_ID             8
-#define DOT11_MNG_HOPPING_TABLE_ID             9
-#define DOT11_MNG_REQUEST_ID                   10
-#define DOT11_MNG_CHALLENGE_ID                 16
-#define DOT11_MNG_PWR_CONSTRAINT_ID            32    /* 11H PowerConstraint    */
-#define DOT11_MNG_PWR_CAP_ID                   33    /* 11H PowerCapability    */
-#define DOT11_MNG_TPC_REQUEST_ID               34    /* 11H TPC Request        */
-#define DOT11_MNG_TPC_REPORT_ID                        35    /* 11H TPC Report         */
-#define DOT11_MNG_SUPP_CHANNELS_ID             36    /* 11H Supported Channels */
-#define DOT11_MNG_CHANNEL_SWITCH_ID            37    /* 11H ChannelSwitch Announcement*/
-#define DOT11_MNG_MEASURE_REQUEST_ID           38    /* 11H MeasurementRequest */
-#define DOT11_MNG_MEASURE_REPORT_ID            39    /* 11H MeasurementReport  */
-#define DOT11_MNG_QUIET_ID                     40    /* 11H Quiet              */
-#define DOT11_MNG_IBSS_DFS_ID                  41    /* 11H IBSS_DFS           */
-#define DOT11_MNG_ERP_ID                       42
-#define DOT11_MNG_NONERP_ID                    47
-#define DOT11_MNG_EXT_RATES_ID                 50
-#define DOT11_MNG_WPA_ID                       221
-#define DOT11_MNG_PROPR_ID                     221
-
-/* ERP info element bit values */
-#define DOT11_MNG_ERP_LEN                      1       /* ERP is currently 1 byte long */
-#define DOT11_MNG_NONERP_PRESENT               0x01    /* NonERP (802.11b) STAs are present in the BSS */
-#define DOT11_MNG_USE_PROTECTION               0x02    /* Use protection mechanisms for ERP-OFDM frames */
-#define DOT11_MNG_BARKER_PREAMBLE              0x04    /* Short Preambles: 0 == allowed, 1 == not allowed */
-
-/* Capability Information Field */
-#define DOT11_CAP_ESS                          0x0001
-#define DOT11_CAP_IBSS                         0x0002
-#define DOT11_CAP_POLLABLE                     0x0004
-#define DOT11_CAP_POLL_RQ                      0x0008
-#define DOT11_CAP_PRIVACY                      0x0010
-#define DOT11_CAP_SHORT                                0x0020
-#define DOT11_CAP_PBCC                         0x0040
-#define DOT11_CAP_AGILITY                      0x0080
-#define DOT11_CAP_SPECTRUM                     0x0100
-#define DOT11_CAP_SHORTSLOT                    0x0400
-#define DOT11_CAP_CCK_OFDM                     0x2000
-
-/* Action Frame Constants */
-#define DOT11_ACTION_CAT_ERR_MASK      0x80
-#define DOT11_ACTION_CAT_SPECT_MNG     0x00
-#define DOT11_ACTION_NOTIFICATION      0x11    /* 17 */
-
-#define DOT11_ACTION_ID_M_REQ          0
-#define DOT11_ACTION_ID_M_REP          1
-#define DOT11_ACTION_ID_TPC_REQ                2
-#define DOT11_ACTION_ID_TPC_REP                3
-#define DOT11_ACTION_ID_CHANNEL_SWITCH 4
-
-/* MLME Enumerations */
-#define DOT11_BSSTYPE_INFRASTRUCTURE           0
-#define DOT11_BSSTYPE_INDEPENDENT              1
-#define DOT11_BSSTYPE_ANY                      2
-#define DOT11_SCANTYPE_ACTIVE                  0
-#define DOT11_SCANTYPE_PASSIVE                 1
-
-/* 802.11 A PHY constants */
-#define APHY_SLOT_TIME         9
-#define APHY_SIFS_TIME         16
-#define APHY_DIFS_TIME         (APHY_SIFS_TIME + (2 * APHY_SLOT_TIME))
-#define APHY_PREAMBLE_TIME     16
-#define APHY_SIGNAL_TIME       4
-#define APHY_SYMBOL_TIME       4
-#define APHY_SERVICE_NBITS     16
-#define APHY_TAIL_NBITS                6
-#define        APHY_CWMIN              15
-
-/* 802.11 B PHY constants */
-#define BPHY_SLOT_TIME         20
-#define BPHY_SIFS_TIME         10
-#define BPHY_DIFS_TIME         50
-#define BPHY_PLCP_TIME         192
-#define BPHY_PLCP_SHORT_TIME   96
-#define        BPHY_CWMIN              31
-
-/* 802.11 G constants */
-#define DOT11_OFDM_SIGNAL_EXTENSION    6
-
-#define PHY_CWMAX              1023
-
-#define        DOT11_MAXNUMFRAGS       16      /* max # fragments per MSDU */
-
-/* dot11Counters Table - 802.11 spec., Annex D */
-typedef struct d11cnt {
-       uint32          txfrag;         /* dot11TransmittedFragmentCount */
-       uint32          txmulti;        /* dot11MulticastTransmittedFrameCount */
-       uint32          txfail;         /* dot11FailedCount */
-       uint32          txretry;        /* dot11RetryCount */
-       uint32          txretrie;       /* dot11MultipleRetryCount */
-       uint32          rxdup;          /* dot11FrameduplicateCount */
-       uint32          txrts;          /* dot11RTSSuccessCount */
-       uint32          txnocts;        /* dot11RTSFailureCount */
-       uint32          txnoack;        /* dot11ACKFailureCount */
-       uint32          rxfrag;         /* dot11ReceivedFragmentCount */
-       uint32          rxmulti;        /* dot11MulticastReceivedFrameCount */
-       uint32          rxcrc;          /* dot11FCSErrorCount */
-       uint32          txfrmsnt;       /* dot11TransmittedFrameCount */
-       uint32          rxundec;        /* dot11WEPUndecryptableCount */
-} d11cnt_t;
-
-/* BRCM OUI */
-#define BRCM_OUI               "\x00\x10\x18"
-
-/* BRCM info element */
-struct brcm_ie {
-       uchar   id;             
-       uchar   len;   
-       uchar   oui[3];
-       uchar   ver;
-       uchar   assoc;          /*  # of assoc STAs */
-       uchar   flags;          /* misc flags */
-} PACKED;
-#define BRCM_IE_LEN            8
-typedef        struct brcm_ie brcm_ie_t;
-#define BRCM_IE_VER            1
-
-/* brcm_ie flags */
-#define        BRF_ABCAP               0x1     /* afterburner capable */
-#define        BRF_ABRQRD              0x2     /* afterburner requested */
-
-/* WPA definitions */
-#define WPA_VERSION            1
-#define WPA_OUI                        "\x00\x50\xF2"
-
-#define WPA_OUI_LEN    3
-
-/* WPA authentication modes */
-#define WPA_AUTH_NONE          0       /* None */
-#define WPA_AUTH_UNSPECIFIED   1       /* Unspecified authentication over 802.1X: default for WPA */
-#define WPA_AUTH_PSK           2       /* Pre-shared Key over 802.1X */
-#define WPA_AUTH_DISABLED      255     /* Legacy (i.e., non-WPA) */
-                                
-#define IS_WPA_AUTH(auth)      ((auth) == WPA_AUTH_NONE || \
-                                (auth) == WPA_AUTH_UNSPECIFIED || \
-                                (auth) == WPA_AUTH_PSK)
-
-
-/* Key related defines */
-#define DOT11_MAX_DEFAULT_KEYS 4       /* number of default keys */
-#define DOT11_MAX_KEY_SIZE     32      /* max size of any key */
-#define DOT11_MAX_IV_SIZE      16      /* max size of any IV */
-#define DOT11_EXT_IV_FLAG      (1<<5)  /* flag to indicate IV is > 4 bytes */
-
-#define WEP1_KEY_SIZE          5       /* max size of any WEP key */
-#define WEP1_KEY_HEX_SIZE      10      /* size of WEP key in hex. */
-#define WEP128_KEY_SIZE                13      /* max size of any WEP key */
-#define WEP128_KEY_HEX_SIZE    26      /* size of WEP key in hex. */
-#define TKIP_MIC_SIZE          8       /* size of TKIP MIC */
-#define TKIP_EOM_SIZE          7       /* max size of TKIP EOM */
-#define TKIP_EOM_FLAG          0x5a    /* TKIP EOM flag byte */
-#define TKIP_KEY_SIZE          32      /* size of any TKIP key */
-#define TKIP_MIC_AUTH_TX       16      /* offset to Authenticator MIC TX key */
-#define TKIP_MIC_AUTH_RX       24      /* offset to Authenticator MIC RX key */
-#define TKIP_MIC_SUP_RX                16      /* offset to Supplicant MIC RX key */
-#define TKIP_MIC_SUP_TX                24      /* offset to Supplicant MIC TX key */
-#define AES_KEY_SIZE           16      /* size of AES key */
-
-#undef PACKED
-#if !defined(__GNUC__)
-#pragma pack()
-#endif
-
-#endif /* _802_11_H_ */
diff --git a/openwrt/package/openwrt/include/proto/ethernet.h b/openwrt/package/openwrt/include/proto/ethernet.h
deleted file mode 100644 (file)
index 173464a..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * $Id$
- * Copyright 2004, Broadcom Corporation      
- * All Rights Reserved.      
- *       
- * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY      
- * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM      
- * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS      
- * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.      
- * From FreeBSD 2.2.7: Fundamental constants relating to ethernet.
- ******************************************************************************/
-
-#ifndef _NET_ETHERNET_H_           /* use native BSD ethernet.h when available */
-#define _NET_ETHERNET_H_
-
-#ifndef _TYPEDEFS_H_
-#include "typedefs.h"
-#endif
-
-#if defined(__GNUC__)
-#define        PACKED  __attribute__((packed))
-#else
-#define        PACKED
-#endif
-
-/*
- * The number of bytes in an ethernet (MAC) address.
- */
-#ifndef ETHER_ADDR_LEN
-#define        ETHER_ADDR_LEN          6
-#endif
-
-/*
- * The number of bytes in the type field.
- */
-#ifndef        ETHER_TYPE_LEN
-#define        ETHER_TYPE_LEN          2
-#endif
-
-/*
- * The number of bytes in the trailing CRC field.
- */
-#ifndef        ETHER_CRC_LEN
-#define        ETHER_CRC_LEN           4
-#endif
-
-/*
- * The length of the combined header.
- */
-#ifndef        ETHER_HDR_LEN
-#define        ETHER_HDR_LEN           (ETHER_ADDR_LEN*2+ETHER_TYPE_LEN)
-#endif
-
-/*
- * The minimum packet length.
- */
-#ifndef ETHER_MIN_LEN
-#define        ETHER_MIN_LEN           64
-#endif
-
-/*
- * The minimum packet user data length.
- */
-#ifndef ETHER_MIN_DATA
-#define        ETHER_MIN_DATA          46
-#endif
-
-/*
- * The maximum packet length.
- */
-#ifndef ETHER_MAX_LEN
-#define        ETHER_MAX_LEN           1518
-#endif
-
-/*
- * The maximum packet user data length.
- */
-#define        ETHER_MAX_DATA          1500
-
-/*
- * Used to uniquely identify a 802.1q VLAN-tagged header.
- */
-#define        VLAN_TAG                        0x8100
-
-/*
- * Located after dest & src address in ether header.
- */
-#define VLAN_FIELDS_OFFSET             (ETHER_ADDR_LEN * 2)
-
-/*
- * 4 bytes of vlan field info.
- */
-#define VLAN_FIELDS_SIZE               4
-
-/* location of bits in 16-bit vlan fields */
-#define VLAN_PRI_SHIFT         13      /* user priority */
-#define VLAN_CFI_SHIFT         12      /* canonical format indicator bit */
-
-/* 3 bits of priority */
-#define VLAN_PRI_MASK                  7
-/* 12 bits of vlan identfier (VID) */
-#define VLAN_VID_MASK          0xFFF   /* VLAN identifier (VID) field */
-
-struct  vlan_tags {
-       uint16  tag_type;       /* 0x8100 for VLAN */
-       uint16  tag_control;    /* prio | cfi | vid */
-} PACKED ;
-
-/* 802.1X ethertype */
-
-#define        ETHER_TYPE_IP           0x0800          /* IP */
-#define        ETHER_TYPE_BRCM         0x886c          /* Broadcom Corp. */
-#define        ETHER_TYPE_802_1X       0x888e          /* 802.1x */
-
-#define        ETHER_BRCM_SUBTYPE_LEN  4               /* Broadcom 4byte subtype follows ethertype */
-#define        ETHER_BRCM_CRAM         0x1             /* Broadcom subtype cram protocol */
-
-/*
- * A macro to validate a length with
- */
-#define        ETHER_IS_VALID_LEN(foo) \
-       ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
-
-#ifndef __NET_ETHERNET_H
-#ifndef __INCif_etherh     /* Quick and ugly hack for VxWorks */
-/*
- * Structure of a 10Mb/s Ethernet header.
- */
-struct ether_header {
-       uint8   ether_dhost[ETHER_ADDR_LEN];
-       uint8   ether_shost[ETHER_ADDR_LEN];
-       uint16  ether_type;
-} PACKED ;
-
-/*
- * Structure of a 48-bit Ethernet address.
- */
-struct ether_addr {
-       uint8 octet[ETHER_ADDR_LEN];
-} PACKED ;
-#endif
-#endif
-
-/*
- * Takes a pointer, returns true if a 48-bit multicast address
- * (including broadcast, since it is all ones)
- */
-#define ETHER_ISMULTI(ea) (((uint8 *)(ea))[0] & 1)
-
-/*
- * Takes a pointer, returns true if a 48-bit broadcast (all ones)
- */
-#define ETHER_ISBCAST(ea) ((((uint8 *)(ea))[0] &               \
-                           ((uint8 *)(ea))[1] &                \
-                           ((uint8 *)(ea))[2] &                \
-                           ((uint8 *)(ea))[3] &                \
-                           ((uint8 *)(ea))[4] &                \
-                           ((uint8 *)(ea))[5]) == 0xff)
-
-static const struct ether_addr ether_bcast = {{255, 255, 255, 255, 255, 255}};
-
-/*
- * Takes a pointer, returns true if a 48-bit null address (all zeros)
- */
-#define ETHER_ISNULLADDR(ea) ((((uint8 *)(ea))[0] |            \
-                           ((uint8 *)(ea))[1] |                \
-                           ((uint8 *)(ea))[2] |                \
-                           ((uint8 *)(ea))[3] |                \
-                           ((uint8 *)(ea))[4] |                \
-                           ((uint8 *)(ea))[5]) == 0)
-
-/* Differentiated Services Codepoint - lower 6 bits of tos in iphdr */
-#define        DSCP_PRI_MASK           0x3F            /* bits 0-6 */
-#define        DSCP_WME_PRI_MASK       0x38            /* bits 3-6 */
-#define        DSCP_WME_PRI_SHIFT      3
-
-#undef PACKED
-
-#endif /* _NET_ETHERNET_H_ */
diff --git a/openwrt/package/openwrt/include/shutils.h b/openwrt/package/openwrt/include/shutils.h
deleted file mode 100644 (file)
index 783ee9e..0000000
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Shell-like utility functions
- *
- * Copyright 2004, Broadcom Corporation
- * All Rights Reserved.
- * 
- * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
- * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
- * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
- *
- * $Id$
- */
-
-#ifndef _shutils_h_
-#define _shutils_h_
-#include <string.h>
-/*
- * Reads file and returns contents
- * @param      fd      file descriptor
- * @return     contents of file or NULL if an error occurred
- */
-extern char * fd2str(int fd);
-
-/*
- * Reads file and returns contents
- * @param      path    path to file
- * @return     contents of file or NULL if an error occurred
- */
-extern char * file2str(const char *path);
-
-/* 
- * Waits for a file descriptor to become available for reading or unblocked signal
- * @param      fd      file descriptor
- * @param      timeout seconds to wait before timing out or 0 for no timeout
- * @return     1 if descriptor changed status or 0 if timed out or -1 on error
- */
-extern int waitfor(int fd, int timeout);
-
-/* 
- * Concatenates NULL-terminated list of arguments into a single
- * commmand and executes it
- * @param      argv    argument list
- * @param      path    NULL, ">output", or ">>output"
- * @param      timeout seconds to wait before timing out or 0 for no timeout
- * @param      ppid    NULL to wait for child termination or pointer to pid
- * @return     return value of executed command or errno
- */
-extern int _eval(char *const argv[], char *path, int timeout, pid_t *ppid);
-
-/* 
- * Concatenates NULL-terminated list of arguments into a single
- * commmand and executes it
- * @param      argv    argument list
- * @return     stdout of executed command or NULL if an error occurred
- */
-extern char * _backtick(char *const argv[]);
-
-/* 
- * Kills process whose PID is stored in plaintext in pidfile
- * @param      pidfile PID file
- * @return     0 on success and errno on failure
- */
-extern int kill_pidfile(char *pidfile);
-
-/*
- * fread() with automatic retry on syscall interrupt
- * @param      ptr     location to store to
- * @param      size    size of each element of data
- * @param      nmemb   number of elements
- * @param      stream  file stream
- * @return     number of items successfully read
- */
-extern int safe_fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
-
-/*
- * fwrite() with automatic retry on syscall interrupt
- * @param      ptr     location to read from
- * @param      size    size of each element of data
- * @param      nmemb   number of elements
- * @param      stream  file stream
- * @return     number of items successfully written
- */
-extern int safe_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
-
-/*
- * Convert Ethernet address string representation to binary data
- * @param      a       string in xx:xx:xx:xx:xx:xx notation
- * @param      e       binary data
- * @return     TRUE if conversion was successful and FALSE otherwise
- */
-extern int ether_atoe(const char *a, unsigned char *e);
-
-/*
- * Convert Ethernet address binary data to string representation
- * @param      e       binary data
- * @param      a       string in xx:xx:xx:xx:xx:xx notation
- * @return     a
- */
-extern char * ether_etoa(const unsigned char *e, char *a);
-
-/*
- * Concatenate two strings together into a caller supplied buffer
- * @param      s1      first string
- * @param      s2      second string
- * @param      buf     buffer large enough to hold both strings
- * @return     buf
- */
-static inline char * strcat_r(const char *s1, const char *s2, char *buf)
-{
-       strcpy(buf, s1);
-       strcat(buf, s2);
-       return buf;
-}      
-
-/* Check for a blank character; that is, a space or a tab */
-#define isblank(c) ((c) == ' ' || (c) == '\t')
-
-/* Strip trailing CR/NL from string <s> */
-#define chomp(s) ({ \
-       char *c = (s) + strlen((s)) - 1; \
-       while ((c > (s)) && (*c == '\n' || *c == '\r' || *c == ' ')) \
-               *c-- = '\0'; \
-       s; \
-})
-
-/* Simple version of _backtick() */
-#define backtick(cmd, args...) ({ \
-       char *argv[] = { cmd, ## args, NULL }; \
-       _backtick(argv); \
-})
-
-/* Simple version of _eval() (no timeout and wait for child termination) */
-#define eval(cmd, args...) ({ \
-       char *argv[] = { cmd, ## args, NULL }; \
-       _eval(argv, ">/dev/console", 0, NULL); \
-})
-
-/* Copy each token in wordlist delimited by space into word */
-#define foreach(word, wordlist, next) \
-       for (next = &wordlist[strspn(wordlist, " ")], \
-            strncpy(word, next, sizeof(word)), \
-            word[strcspn(word, " ")] = '\0', \
-            word[sizeof(word) - 1] = '\0', \
-            next = strchr(next, ' '); \
-            strlen(word); \
-            next = next ? &next[strspn(next, " ")] : "", \
-            strncpy(word, next, sizeof(word)), \
-            word[strcspn(word, " ")] = '\0', \
-            word[sizeof(word) - 1] = '\0', \
-            next = strchr(next, ' '))
-
-/* Return NUL instead of NULL if undefined */
-#define safe_getenv(s) (getenv(s) ? : "")
-
-/* Print directly to the console */
-#define cprintf(fmt, args...) do { \
-       FILE *fp = fopen("/dev/console", "w"); \
-       if (fp) { \
-               fprintf(fp, fmt, ## args); \
-               fclose(fp); \
-       } \
-} while (0)
-
-/* Debug print */
-#ifdef DEBUG
-#define dprintf(fmt, args...) cprintf("%s: " fmt, __FUNCTION__, ## args)
-#else
-#define dprintf(fmt, args...)
-#endif
-
-#ifdef vxworks
-
-#include <inetLib.h>
-#define inet_aton(a, n) ((inet_aton((a), (n)) == ERROR) ? 0 : 1)
-#define inet_ntoa(n) ({ char a[INET_ADDR_LEN]; inet_ntoa_b ((n), a); a; })
-
-#include <typedefs.h>
-#include <bcmutils.h>
-#define ether_atoe(a, e) bcm_ether_atoe((a), (e))
-#define ether_etoa(e, a) bcm_ether_ntoa((e), (a))
-
-/* These declarations are not available where you would expect them */
-extern int vsnprintf (char *, size_t, const char *, va_list);
-extern int snprintf(char *str, size_t count, const char *fmt, ...);
-extern char *strdup(const char *);
-extern char *strsep(char **stringp, char *delim);
-extern int strcasecmp(const char *s1, const char *s2); 
-extern int strncasecmp(const char *s1, const char *s2, size_t n); 
-
-/* Neither are socket() and connect() */
-#include <sockLib.h>
-
-#ifdef DEBUG
-#undef dprintf
-#define dprintf printf
-#endif
-#endif
-
-#endif /* _shutils_h_ */
diff --git a/openwrt/package/openwrt/include/typedefs.h b/openwrt/package/openwrt/include/typedefs.h
deleted file mode 100644 (file)
index 6b0c25e..0000000
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * Copyright 2004, Broadcom Corporation      
- * All Rights Reserved.      
- *       
- * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY      
- * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM      
- * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS      
- * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.      
- * $Id$
- */
-
-#ifndef _TYPEDEFS_H_
-#define _TYPEDEFS_H_
-
-
-/* Define 'SITE_TYPEDEFS' in the compile to include a site specific
- * typedef file "site_typedefs.h".
- *
- * If 'SITE_TYPEDEFS' is not defined, then the "Inferred Typedefs"
- * section of this file makes inferences about the compile environment
- * based on defined symbols and possibly compiler pragmas.
- *
- * Following these two sections is the "Default Typedefs"
- * section. This section is only prcessed if 'USE_TYPEDEF_DEFAULTS' is
- * defined. This section has a default set of typedefs and a few
- * proprocessor symbols (TRUE, FALSE, NULL, ...).
- */
-
-#ifdef SITE_TYPEDEFS
-
-/*******************************************************************************
- * Site Specific Typedefs
- *******************************************************************************/
-
-#include "site_typedefs.h"
-
-#else
-
-/*******************************************************************************
- * Inferred Typedefs
- *******************************************************************************/
-
-/* Infer the compile environment based on preprocessor symbols and pramas.
- * Override type definitions as needed, and include configuration dependent
- * header files to define types.
- */
-
-#ifdef __cplusplus
-
-#define TYPEDEF_BOOL
-#ifndef FALSE
-#define FALSE  false
-#endif
-#ifndef TRUE
-#define TRUE   true
-#endif
-
-#else  /* ! __cplusplus */
-
-/* for Windows build, define bool as a uchar instead of the default int */
-#if defined(_WIN32)
-
-#define TYPEDEF_BOOL
-typedef        unsigned char   bool;
-
-#endif /* _WIN32 */
-
-#endif /* ! __cplusplus */
-
-#ifdef _MSC_VER            /* Microsoft C */
-#define TYPEDEF_INT64
-#define TYPEDEF_UINT64
-typedef signed __int64 int64;
-typedef unsigned __int64 uint64;
-#endif
-
-#if defined(MACOSX) && defined(KERNEL)
-#define TYPEDEF_BOOL
-#endif
-
-
-#if defined(linux)
-#define TYPEDEF_UINT
-#define TYPEDEF_USHORT
-#define TYPEDEF_ULONG
-#endif
-
-#if !defined(linux) && !defined(_WIN32) && !defined(PMON) && !defined(_CFE_)
-#define TYPEDEF_UINT
-#define TYPEDEF_USHORT
-#endif
-
-
-/* Do not support the (u)int64 types with strict ansi for GNU C */
-#if defined(__GNUC__) && defined(__STRICT_ANSI__)
-#define TYPEDEF_INT64
-#define TYPEDEF_UINT64
-#endif
-
-/* ICL accepts unsigned 64 bit type only, and complains in ANSI mode
- * for singned or unsigned */
-#if defined(__ICL)
-
-#define TYPEDEF_INT64
-
-#if defined(__STDC__)
-#define TYPEDEF_UINT64
-#endif
-
-#endif /* __ICL */
-
-
-#if !defined(_WIN32) && !defined(PMON) && !defined(_CFE_)
-
-/* pick up ushort & uint from standard types.h */
-#if defined(linux) && defined(__KERNEL__)
-
-#include <linux/types.h>       /* sys/types.h and linux/types.h are oil and water */
-
-#else
-
-#include <sys/types.h> 
-
-#endif
-
-#endif /* !_WIN32 && !PMON && !_CFE_ */
-
-#if defined(MACOSX) && defined(KERNEL)
-#include <IOKit/IOTypes.h>
-#endif
-
-
-/* use the default typedefs in the next section of this file */
-#define USE_TYPEDEF_DEFAULTS
-
-#endif /* SITE_TYPEDEFS */
-
-
-/*******************************************************************************
- * Default Typedefs
- *******************************************************************************/
-
-#ifdef USE_TYPEDEF_DEFAULTS
-#undef USE_TYPEDEF_DEFAULTS
-
-#ifndef TYPEDEF_BOOL
-typedef        int     bool;
-#endif
-
-/*----------------------- define uchar, ushort, uint, ulong ----------------*/
-
-#ifndef TYPEDEF_UCHAR
-typedef unsigned char  uchar;
-#endif
-
-#ifndef TYPEDEF_USHORT
-typedef unsigned short ushort;
-#endif
-
-#ifndef TYPEDEF_UINT
-typedef unsigned int   uint;
-#endif
-
-#ifndef TYPEDEF_ULONG
-typedef unsigned long  ulong;
-#endif
-
-/*----------------------- define [u]int8/16/32/64 --------------------------*/
-
-#ifndef TYPEDEF_UINT8
-typedef unsigned char  uint8;
-#endif
-
-#ifndef TYPEDEF_UINT16
-typedef unsigned short uint16;
-#endif
-
-#ifndef TYPEDEF_UINT32
-typedef unsigned int   uint32;
-#endif
-
-#ifndef TYPEDEF_UINT64
-typedef unsigned long long uint64;
-#endif
-
-#ifndef TYPEDEF_INT8
-typedef signed char    int8;
-#endif
-
-#ifndef TYPEDEF_INT16
-typedef signed short   int16;
-#endif
-
-#ifndef TYPEDEF_INT32
-typedef signed int     int32;
-#endif
-
-#ifndef TYPEDEF_INT64
-typedef signed long long int64;
-#endif
-
-/*----------------------- define float32/64, float_t -----------------------*/
-
-#ifndef TYPEDEF_FLOAT32
-typedef float          float32;
-#endif
-
-#ifndef TYPEDEF_FLOAT64
-typedef double         float64;
-#endif
-
-/*
- * abstracted floating point type allows for compile time selection of
- * single or double precision arithmetic.  Compiling with -DFLOAT32
- * selects single precision; the default is double precision.
- */
-
-#ifndef TYPEDEF_FLOAT_T
-
-#if defined(FLOAT32)
-typedef float32 float_t;
-#else /* default to double precision floating point */
-typedef float64 float_t;
-#endif
-
-#endif /* TYPEDEF_FLOAT_T */
-
-/*----------------------- define macro values -----------------------------*/
-
-#ifndef FALSE
-#define FALSE  0
-#endif
-
-#ifndef TRUE
-#define TRUE   1
-#endif
-
-#ifndef NULL
-#define        NULL    0
-#endif
-
-#ifndef OFF
-#define        OFF     0
-#endif
-
-#ifndef ON
-#define        ON      1
-#endif
-
-/*----------------------- define PTRSZ, INLINE ----------------------------*/
-
-#ifndef PTRSZ
-#define        PTRSZ   sizeof (char*)
-#endif
-
-#ifndef INLINE
-
-#ifdef _MSC_VER
-
-#define INLINE __inline
-
-#elif __GNUC__
-
-#define INLINE __inline__
-
-#else
-
-#define INLINE
-
-#endif /* _MSC_VER */
-
-#endif /* INLINE */
-
-#undef TYPEDEF_BOOL
-#undef TYPEDEF_UCHAR
-#undef TYPEDEF_USHORT
-#undef TYPEDEF_UINT
-#undef TYPEDEF_ULONG
-#undef TYPEDEF_UINT8
-#undef TYPEDEF_UINT16
-#undef TYPEDEF_UINT32
-#undef TYPEDEF_UINT64
-#undef TYPEDEF_INT8
-#undef TYPEDEF_INT16
-#undef TYPEDEF_INT32
-#undef TYPEDEF_INT64
-#undef TYPEDEF_FLOAT32
-#undef TYPEDEF_FLOAT64
-#undef TYPEDEF_FLOAT_T
-
-#endif /* USE_TYPEDEF_DEFAULTS */
-
-#endif /* _TYPEDEFS_H_ */
diff --git a/openwrt/package/openwrt/include/utils.h b/openwrt/package/openwrt/include/utils.h
deleted file mode 100644 (file)
index b8d1cdb..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-#include <cy_conf.h>
-
-extern int diag_led(int type, int act);
-extern int C_led(int i);
-extern int get_single_ip(char *ipaddr, int which);
-extern char *get_mac_from_ip(char *ip);
-extern struct dns_lists *get_dns_list(int no);
-extern int dns_to_resolv(void);
-extern char *get_wan_face(void);
-extern int check_wan_link(int num);
-extern char *get_complete_lan_ip(char *ip);
-extern int get_int_len(int num);
-extern int file_to_buf(char *path, char *buf, int len);
-extern int buf_to_file(char *path, char *buf);
-extern pid_t* find_pid_by_name( char* pidName);
-extern int find_pid_by_ps(char* pidName);
-extern int *find_all_pid_by_ps(char* pidName);
-extern char *find_name_by_proc(int pid);
-extern int get_ppp_pid(char *file);
-extern long convert_ver(char *ver);
-extern int check_flash(void);
-extern int check_action(void);
-extern int check_now_boot(void);
-extern int check_hw_type(void);
-extern int is_exist(char *filename);
-extern void set_ip_forward(char c);
-struct mtu_lists *get_mtu(char *proto);
-extern void set_host_domain_name(void);
-
-extern void encode(char *buf, int len);
-extern void decode(char *buf, int len);
-
-extern int sys_netdev_ioctl(int family, int socket, char *if_name, int cmd, struct ifreq *ifr);
-
-int ct_openlog(const char *ident, int option, int facility, char *log_name);
-void ct_syslog(int level, int enable, const char *fmt,...);
-void ct_logger(int level, const char *fmt,...);
-struct wl_assoc_mac * get_wl_assoc_mac(int *c);
-       
-
-
-enum { DMZ, SESSION, DIAG , WL};
-
-enum { START_LED, STOP_LED };
-
-typedef enum { ACT_IDLE, 
-              ACT_TFTP_UPGRADE, 
-              ACT_WEB_UPGRADE, 
-              ACT_WEBS_UPGRADE, 
-              ACT_SW_RESTORE, 
-              ACT_HW_RESTORE } ACTION;
-
-enum { UNKNOWN_BOOT = -1, PMON_BOOT, CFE_BOOT };
-
-enum { BCM4702_CHIP, BCM4712_CHIP, BCM5325E_CHIP };
-
-enum { FIRST, SECOND };
-
-enum { SYSLOG_LOG=1, SYSLOG_DEBUG, CONSOLE_ONLY, LOG_CONSOLE, DEBUG_CONSOLE };
-
-#define ACTION(cmd)    buf_to_file(ACTION_FILE, cmd)
-
-struct dns_lists {
-        int num_servers;
-        char dns_server[4][16];
-};
-
-#define NOT_USING      0
-#define USING          1
-
-struct wl_assoc_mac
-{
-       char mac[18];
-};
-
-struct mtu_lists {
-        char   *proto; /* protocol */
-        char   *min;   /* min mtu */
-        char   *max;   /* max mtu */
-};
-
-
-#define PPP_PSEUDO_IP  "10.64.64.64"
-#define PPP_PSEUDO_NM  "255.255.255.255"
-#define PPP_PSEUDO_GW  "10.112.112.112"
-
-#define PING_TMP       "/tmp/ping.log"
-#define TRACEROUTE_TMP "/tmp/traceroute.log"
-#define MAX_BUF_LEN    254
-
-#define RESOLV_FILE    "/tmp/resolv.conf"
-#define HOSTS_FILE     "/tmp/hosts"
-
-#define LOG_FILE       "/var/log/mess"
-
-#define ACTION_FILE    "/tmp/action"
-
-
-#define split(word, wordlist, next, delim) \
-       for (next = wordlist, \
-            strncpy(word, next, sizeof(word)), \
-            word[(next=strstr(next, delim)) ? strstr(word, delim) - word : sizeof(word) - 1] = '\0', \
-            next = next ? next + sizeof(delim) - 1 : NULL ; \
-            strlen(word); \
-            next = next ? : "", \
-            strncpy(word, next, sizeof(word)), \
-            word[(next=strstr(next, delim)) ? strstr(word, delim) - word : sizeof(word) - 1] = '\0', \
-            next = next ? next + sizeof(delim) - 1 : NULL)
-
-#define STRUCT_LEN(name)    sizeof(name)/sizeof(name[0])
-
-#define printHEX(str,len) { \
-       int i; \
-       for (i=0 ; i<len ; i++) { \
-               printf("%02X ", (unsigned char)*(str+i)); \
-               if(((i+1)%16) == 0) printf("- "); \
-               if(((i+1)%32) == 0) printf("\n"); \
-       } \
-       printf("\n\n"); \
-}
-
-
-#define printASC(str,len) { \
-       int i; \
-       for (i=0 ; i<len ; i++) { \
-               printf("%c", (unsigned char)*(str+i)); \
-               if(((i+1)%16) == 0) printf("- "); \
-               if(((i+1)%32) == 0) printf("\n"); \
-       } \
-       printf("\n\n"); \
-}
diff --git a/openwrt/package/openwrt/include/wlcompat.h b/openwrt/package/openwrt/include/wlcompat.h
deleted file mode 100644 (file)
index a4fc134..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * wlcompat.h
- *
- * Copyright (C) 2005 Felix Fietkau <nbd@vd-s.ath.cx>
- *
- * 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, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * $Id$
- */
-#include <linux/wireless.h>
-
-#ifndef WLCOMPAT_H
-#define WLCOMPAT_H
-
-#define WLCOMPAT_SET_MONITOR           SIOCIWFIRSTPRIV + 0
-#define WLCOMPAT_GET_MONITOR           SIOCIWFIRSTPRIV + 1
-#define WLCOMPAT_SET_TXPWR_LIMIT       SIOCIWFIRSTPRIV + 2
-#define WLCOMPAT_GET_TXPWR_LIMIT       SIOCIWFIRSTPRIV + 3
-#define WLCOMPAT_SET_ANTDIV            SIOCIWFIRSTPRIV + 4
-#define WLCOMPAT_GET_ANTDIV            SIOCIWFIRSTPRIV + 5
-#define WLCOMPAT_SET_TXANT             SIOCIWFIRSTPRIV + 6
-#define WLCOMPAT_GET_TXANT             SIOCIWFIRSTPRIV + 7
-
-#endif
diff --git a/openwrt/package/openwrt/include/wlioctl.h b/openwrt/package/openwrt/include/wlioctl.h
deleted file mode 100644 (file)
index d5ef11f..0000000
+++ /dev/null
@@ -1,1094 +0,0 @@
-/*
- * Custom OID/ioctl definitions for
- * Broadcom 802.11abg Networking Device Driver
- *
- * Definitions subject to change without notice.
- *
- * Copyright 2004, Broadcom Corporation
- * All Rights Reserved.
- * 
- * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
- * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
- * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
- *
- * $Id$
- */
-
-#ifndef _wlioctl_h_
-#define        _wlioctl_h_
-
-#include <typedefs.h>
-#include <proto/ethernet.h>
-#include <proto/802.11.h>
-
-#if defined(__GNUC__)
-#define        PACKED  __attribute__((packed))
-#else
-#define        PACKED
-#endif
-
-#define WLC_ESSID_MAX_SIZE     32
-
-#define WL_NUMRATES            255     /* max # of rates in a rateset */
-
-typedef struct wl_rateset {
-       uint32  count;                  /* # rates in this set */
-       uint8   rates[WL_NUMRATES];     /* rates in 500kbps units w/hi bit set if basic */
-} wl_rateset_t;
-
-#define WL_CHANSPEC_CHAN_MASK  0x0fff
-#define WL_CHANSPEC_BAND_MASK  0xf000
-#define WL_CHANSPEC_BAND_SHIFT 12
-#define WL_CHANSPEC_BAND_A     0x1000
-#define WL_CHANSPEC_BAND_B     0x2000
-
-/*
- * Per-bss information structure.
- */
-
-#define        WL_LEGACY_BSS_INFO_VERSION      106     /* an older supported version of wl_bss_info struct */
-#define        WL_BSS_INFO_VERSION             107     /* current version of wl_bss_info struct */
-
-typedef struct wl_bss_info106 {
-       uint            version;        /* version field */
-       struct ether_addr BSSID;
-       uint8           SSID_len;
-       uint8           SSID[32];
-       uint8           Privacy;        /* 0=No WEP, 1=Use WEP */
-       int16           RSSI;           /* receive signal strength (in dBm) */
-       uint16          beacon_period;  /* units are Kusec */
-       uint16          atim_window;    /* units are Kusec */
-       uint8           channel;        /* Channel no. */
-       int8            infra;          /* 0=IBSS, 1=infrastructure, 2=unknown */
-       struct {
-               uint    count;          /* # rates in this set */
-               uint8   rates[12];      /* rates in 500kbps units w/hi bit set if basic */
-       } rateset;                      /* supported rates */
-        uint8           dtim_period;    /* DTIM period */
-       int8            phy_noise;      /* noise right after tx (in dBm) */
-       uint16          capability;     /* Capability information */
-       struct dot11_bcn_prb *prb;      /* probe response frame (ioctl na) */
-       uint16          prb_len;        /* probe response frame length (ioctl na) */
-       struct {
-               uint8 supported;        /* wpa supported */
-               uint8 multicast;        /* multicast cipher */
-               uint8 ucount;           /* count of unicast ciphers */
-               uint8 unicast[4];       /* unicast ciphers */
-               uint8 acount;           /* count of auth modes */
-               uint8 auth[4];          /* Authentication modes */
-       } wpa;
-} wl_bss_info106_t;
-
-typedef struct wl_bss_info {
-       uint32          version;        /* version field */
-       uint32          length;         /* byte length of data in this record, starting at version and including IEs */
-       struct ether_addr BSSID;
-       uint16          beacon_period;  /* units are Kusec */
-       uint16          capability;     /* Capability information */
-       uint8           SSID_len;
-       uint8           SSID[32];
-       struct {
-               uint    count;          /* # rates in this set */
-               uint8   rates[16];      /* rates in 500kbps units w/hi bit set if basic */
-       } rateset;                      /* supported rates */
-       uint8           channel;        /* Channel no. */
-       uint16          atim_window;    /* units are Kusec */
-        uint8           dtim_period;    /* DTIM period */
-       int16           RSSI;           /* receive signal strength (in dBm) */
-       int8            phy_noise;      /* noise (in dBm) */
-       uint32          ie_length;      /* byte length of Information Elements */
-       /* variable length Information Elements */
-} wl_bss_info_t;
-
-typedef struct wlc_ssid {
-       uint32          SSID_len;
-       uchar           SSID[32];
-} wlc_ssid_t;
-
-typedef struct wl_scan_params {
-       wlc_ssid_t ssid;        /* default is {0, ""} */
-       struct ether_addr bssid;/* default is bcast */
-       int8 bss_type;          /* default is any, DOT11_BSSTYPE_ANY/INFRASTRUCTURE/INDEPENDENT */
-       int8 scan_type;         /* -1 use default, DOT11_SCANTYPE_ACTIVE/PASSIVE */
-       int32 nprobes;          /* -1 use default, number of probes per channel */
-       int32 active_time;      /* -1 use default, dwell time per channel for active scanning */
-       int32 passive_time;     /* -1 use default, dwell time per channel for passive scanning */
-       int32 home_time;        /* -1 use default, dwell time for the home channel between channel scans */
-       int32 channel_num;      /* 0 use default (all available channels), count of channels in channel_list */
-       uint16 channel_list[1]; /* list of chanspecs */
-} wl_scan_params_t;
-/* size of wl_scan_params not including variable length array */
-#define WL_SCAN_PARAMS_FIXED_SIZE 64
-
-typedef struct wl_scan_results {
-       uint32 buflen;
-       uint32 version;
-       uint32 count;
-       wl_bss_info_t bss_info[1];
-} wl_scan_results_t;
-/* size of wl_scan_results not including variable length array */
-#define WL_SCAN_RESULTS_FIXED_SIZE 12
-
-/* uint32 list */
-typedef struct wl_uint32_list {
-       /* in - # of elements, out - # of entries */
-       uint32 count;
-       /* variable length uint32 list */
-       uint32 element[1];
-} wl_uint32_list_t;
-
-#define WLC_CNTRY_BUF_SZ        4       /* Country string is 3 bytes + NULL */
-
-typedef struct wl_channels_in_country {
-       uint32 buflen;
-       uint32 band;
-       char country_abbrev[WLC_CNTRY_BUF_SZ];
-       uint32 count;
-       uint32 channel[1];
-} wl_channels_in_country_t;
-
-typedef struct wl_country_list {
-       uint32 buflen;
-       uint32 band_set;
-       uint32 band;
-       uint32 count;
-       char country_abbrev[1];
-} wl_country_list_t;
-
-#define WL_RM_TYPE_BASIC       1
-#define WL_RM_TYPE_CCA         2
-#define WL_RM_TYPE_RPI         3
-
-#define WL_RM_FLAG_PARALLEL    (1<<0)
-
-#define WL_RM_FLAG_LATE                (1<<1)
-#define WL_RM_FLAG_INCAPABLE   (1<<2)
-#define WL_RM_FLAG_REFUSED     (1<<3)
-
-typedef struct wl_rm_req_elt {
-       int8    type;
-       int8    flags;
-       uint16  chanspec;
-       uint32  token;          /* token for this measurement */
-       uint32  tsf_h;          /* TSF high 32-bits of Measurement start time */
-       uint32  tsf_l;          /* TSF low 32-bits */
-       uint32  dur;            /* TUs */
-} wl_rm_req_elt_t;
-
-typedef struct wl_rm_req {
-       uint32  token;          /* overall measurement set token */
-       uint32  count;          /* number of measurement reqests */
-       wl_rm_req_elt_t req[1]; /* variable length block of requests */
-} wl_rm_req_t;
-#define WL_RM_REQ_FIXED_LEN    8
-
-typedef struct wl_rm_rep_elt {
-       int8    type;
-       int8    flags;
-       uint16  chanspec;
-       uint32  token;          /* token for this measurement */
-       uint32  tsf_h;          /* TSF high 32-bits of Measurement start time */
-       uint32  tsf_l;          /* TSF low 32-bits */
-       uint32  dur;            /* TUs */
-       uint32  len;            /* byte length of data block */
-       uint8   data[1];        /* variable length data block */
-} wl_rm_rep_elt_t;
-#define WL_RM_REP_ELT_FIXED_LEN        24      /* length excluding data block */
-
-#define WL_RPI_REP_BIN_NUM 8
-typedef struct wl_rm_rpi_rep {
-       uint8   rpi[WL_RPI_REP_BIN_NUM];
-       int8    rpi_max[WL_RPI_REP_BIN_NUM];
-} wl_rm_rpi_rep_t;
-
-typedef struct wl_rm_rep {
-       uint32  token;          /* overall measurement set token */
-       uint32  len;            /* length of measurement report block */
-       wl_rm_rep_elt_t rep[1]; /* variable length block of reports */
-} wl_rm_rep_t;
-#define WL_RM_REP_FIXED_LEN    8
-
-
-#define WLC_MAX_KEY_SIZE       32      /* max size of any key */
-#define WLC_MAX_IV_SIZE                16      /* max size of any IV */
-#define WLC_EXT_IV_FLAG                (1<<5)  /* flag to indicate IV is > 4 bytes */
-#define WLC_MAX_DEFAULT_KEYS   4       /* # of default WEP keys */
-#define WLC_MAX_KEYS           54      /* Max # of WEP keys */
-#define WLC_WEP1_KEY_SIZE      5       /* max size of any WEP key */
-#define WLC_WEP1_KEY_HEX_SIZE  10      /* size of WEP key in hex. */
-#define WLC_WEP128_KEY_SIZE    13      /* max size of any WEP key */
-#define WLC_WEP128_KEY_HEX_SIZE        26      /* size of WEP key in hex. */
-#define WLC_TKIP_MIC_SIZE      8       /* size of TKIP MIC */
-#define WLC_TKIP_EOM_SIZE      7       /* max size of TKIP EOM */
-#define WLC_TKIP_EOM_FLAG      0x5a    /* TKIP EOM flag byte */
-#define WLC_TKIP_KEY_SIZE      32      /* size of any TKIP key */
-#define WLC_TKIP_MIC_AUTH_TX   16      /* offset to Authenticator MIC TX key */
-#define WLC_TKIP_MIC_AUTH_RX   24      /* offset to Authenticator MIC RX key */
-#define WLC_TKIP_MIC_SUP_RX    16      /* offset to Supplicant MIC RX key */
-#define WLC_TKIP_MIC_SUP_TX    24      /* offset to Supplicant MIC TX key */
-#define WLC_TKIP_P1_KEY_SIZE   10      /* size of TKHash Phase1 output, in bytes */
-#define WLC_TKIP_P2_KEY_SIZE   16      /* size of TKHash Phase2 output */
-#define WLC_AES_KEY_SIZE       16      /* size of AES key */
-
-
-typedef enum sup_auth_status {
-       WLC_SUP_DISCONNECTED = 0,
-       WLC_SUP_CONNECTING,
-       WLC_SUP_IDREQUIRED,
-       WLC_SUP_AUTHENTICATING,
-       WLC_SUP_AUTHENTICATED,
-       WLC_SUP_KEYXCHANGE,
-       WLC_SUP_KEYED
-} sup_auth_status_t;
-
-/* Enumerate crypto algorithms */
-#define        CRYPTO_ALGO_OFF                 0
-#define        CRYPTO_ALGO_WEP1                1
-#define        CRYPTO_ALGO_TKIP                2
-#define        CRYPTO_ALGO_WEP128              3
-#define CRYPTO_ALGO_AES_CCM            4
-#define CRYPTO_ALGO_AES_OCB_MSDU       5
-#define CRYPTO_ALGO_AES_OCB_MPDU       6
-#define CRYPTO_ALGO_NALG               7
-
-#define WSEC_GEN_MIC_ERROR     0x0001
-#define WSEC_GEN_REPLAY                0x0002
-
-#define WL_SOFT_KEY    (1 << 0)        /* Indicates this key is using soft encrypt */
-#define WL_PRIMARY_KEY (1 << 1)        /* Indicates this key is the primary (ie tx) key */
-#define WL_KF_RES_4    (1 << 4)        /* Reserved for backward compat */
-#define WL_KF_RES_5    (1 << 5)        /* Reserved for backward compat */
-
-
-typedef struct wlc_tkip_info {
-       uint16          phase1[WLC_TKIP_P1_KEY_SIZE/sizeof(uint16)];    /* tkhash phase1 result */
-       uint8           phase2[WLC_TKIP_P2_KEY_SIZE];   /* tkhash phase2 result */
-       uint32          micl;
-       uint32          micr;
-} tkip_info_t;
-
-typedef struct _wsec_iv {
-       uint32          hi;     /* upper 32 bits of IV */
-       uint16          lo;     /* lower 16 bits of IV */
-} wsec_iv_t;
-
-typedef struct wsec_key {
-       uint32          index;          /* key index */
-       uint32          len;            /* key length */
-       uint8           data[WLC_MAX_KEY_SIZE]; /* key data */
-       tkip_info_t     tkip_tx;        /* tkip transmit state */
-       tkip_info_t     tkip_rx;        /* tkip receive state */
-       uint32          algo;           /* CRYPTO_ALGO_AES_CCM, CRYPTO_ALGO_WEP128, etc */
-       uint32          flags;          /* misc flags */
-       uint32          algo_hw;        /* cache for hw register*/
-       uint32          aes_mode;       /* cache for hw register*/
-       int             iv_len;         /* IV length */         
-       int             iv_initialized; /* has IV been initialized already? */          
-       int             icv_len;        /* ICV length */
-       wsec_iv_t       rxiv;           /* Rx IV */
-       wsec_iv_t       txiv;           /* Tx IV */
-       struct ether_addr ea;           /* per station */
-} wsec_key_t;
-
-
-
-typedef struct wl_wsec_key {
-       uint32          index;          /* key index */
-       uint32          len;            /* key length */
-       uint8           data[DOT11_MAX_KEY_SIZE];       /* key data */
-       uint32          pad_1[18];
-       uint32          algo;           /* CRYPTO_ALGO_AES_CCM, CRYPTO_ALGO_WEP128, etc */
-       uint32          flags;          /* misc flags */
-       uint32          pad_2[2];
-       int             pad_3;
-       int             iv_initialized; /* has IV been initialized already? */          
-       int             pad_4;
-       /* Rx IV */
-       struct {
-               uint32  hi;             /* upper 32 bits of IV */
-               uint16  lo;             /* lower 16 bits of IV */
-       } rxiv;
-       uint32          pad_5[2];
-       struct ether_addr ea;           /* per station */
-} wl_wsec_key_t;
-
-/* For use with wlc_wep_key.flags */
-#define WSEC_PRIMARY_KEY       (1 << 1)        /* Indicates this key is the primary (ie tx) key */
-#define WSEC_TKIP_ERROR                (1 << 2)        /* Provoke deliberate error */
-
-#define WSEC_MIN_PSK_LEN       8
-#define WSEC_MAX_PSK_LEN       64
-
-/* Flag for key material needing passhash'ing */
-#define WSEC_PASSPHRASE                (1<<0)
-
-/* recepticle for WLC_SET_WSEC_PMK parameter */
-typedef struct {
-       ushort  key_len;                /* octets in key material */
-       ushort  flags;                  /* key handling qualification */
-       uint8   key[WSEC_MAX_PSK_LEN];  /* PMK material */
-} wsec_pmk_t;
-
-/* wireless security bitvec */
-#define WEP_ENABLED            1
-#define TKIP_ENABLED           2
-#define AES_ENABLED            4
-#define WSEC_SWFLAG            8
-
-#define WSEC_SW(wsec)          ((wsec) & WSEC_SWFLAG)
-#define WSEC_HW(wsec)          (!WSEC_SW(wsec))
-#define WSEC_WEP_ENABLED(wsec) ((wsec) & WEP_ENABLED)
-#define WSEC_TKIP_ENABLED(wsec)        ((wsec) & TKIP_ENABLED)
-#define WSEC_AES_ENABLED(wsec) ((wsec) & AES_ENABLED)
-#define WSEC_ENABLED(wsec)     ((wsec) & (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED))
-
-
-/* wireless authentication bit vector */
-#define WPA_ENABLED    1
-#define PSK_ENABLED    2
-
-#define WAUTH_WPA_ENABLED(wauth)       ((wauth) & WPA_ENABLED)
-#define WAUTH_PSK_ENABLED(wauth)       ((wauth) & PSK_ENABLED)
-#define WAUTH_ENABLED(wauth)           ((wauth) & (WPA_ENABLED | PSK_ENABLED))
-
-/* group/mcast cipher */
-#define WPA_MCAST_CIPHER(wsec) (((wsec) & TKIP_ENABLED) ? WPA_CIPHER_TKIP : \
-                               ((wsec) & AES_ENABLED) ? WPA_CIPHER_AES_CCM : \
-                               WPA_CIPHER_NONE)
-
-
-typedef struct wl_led_info {
-       uint32          index;          /* led index */
-       uint32          behavior;
-       bool            activehi;
-} wl_led_info_t;
-
-/*
- * definitions for driver messages passed from WL to NAS.
- */
-/* Use this to recognize wpa and 802.1x driver messages. */
-static const uint8 wl_wpa_snap_template[] =
-       { 0xaa, 0xaa, 0x03, 0x00, 0x90, 0x4c };
-
-#define WL_WPA_MSG_IFNAME_MAX  16
-
-/* WPA driver message */
-typedef struct wl_wpa_header {
-       struct ether_header eth;
-       struct dot11_llc_snap_header snap;
-       uint8 version;
-       uint8 type;
-       /* version 2 additions */
-       char ifname[WL_WPA_MSG_IFNAME_MAX];
-       /* version specific data */
-       /* uint8 data[1]; */
-} wl_wpa_header_t PACKED;
-
-/*
- * definitions for 802.2 messages passed from WL to NAS.
- */
-/* This seems not to be defined outside the kernel on linux. */
-#ifndef ETH_P_802_2
-#define ETH_P_802_2            4
-#endif
-
-#define WL_WPA_HEADER_LEN      (ETHER_HDR_LEN + DOT11_LLC_SNAP_HDR_LEN + 2 + WL_WPA_MSG_IFNAME_MAX)
-
-/* WPA driver message ethertype - private between wlc and nas */
-#define WL_WPA_ETHER_TYPE      0x9999
-
-/* WPA driver message current version */
-#define WL_WPA_MSG_VERSION     2
-
-/* Type field values for the 802.2 driver messages for WPA. */
-#define WLC_ASSOC_MSG          1
-#define WLC_DISASSOC_MSG       2
-#define WLC_PTK_MIC_MSG                3
-#define WLC_GTK_MIC_MSG                4
-
-/* Use this to recognize 802.2 driver messages. */
-static const uint8 wpa_snap_template[] =
-       { 0xaa, 0xaa, 0x03, 0x00, 0x90, 0x4c };
-
-
-/* 802.1x driver message */
-typedef struct wl_eapol_header {
-       struct ether_header eth;
-       struct dot11_llc_snap_header snap;
-       uint8 version;
-       uint8 reserved;
-       char ifname[WL_WPA_MSG_IFNAME_MAX];
-       /* version specific data */
-       /* uint8 802_1x_msg[1]; */
-} wl_eapol_header_t PACKED;
-
-#define WL_EAPOL_HEADER_LEN    (ETHER_HDR_LEN + DOT11_LLC_SNAP_HDR_LEN + 2 + WL_WPA_MSG_IFNAME_MAX)
-
-/* 802.1x driver message ethertype - private between wlc and nas */
-#define WL_EAPOL_ETHER_TYPE    0x999A
-
-/* 802.1x driver message current version */
-#define WL_EAPOL_MSG_VERSION   1
-
-/* srom read/write struct passed through ioctl */
-typedef struct {
-       uint   byteoff;         /* byte offset */
-       uint   nbytes;          /* number of bytes */
-       uint16 buf[1];
-} srom_rw_t;
-
-/* R_REG and W_REG struct passed through ioctl */
-typedef struct {
-       uint32  byteoff;        /* byte offset of the field in d11regs_t */
-       uint32  val;            /* read/write value of the field */
-       uint32  size;           /* sizeof the field */
-} rw_reg_t;
-
-/* Structure used by GET/SET_ATTEN ioctls */
-typedef struct {
-       uint16  auto_ctrl;      /* 1: Automatic control, 0: overriden */
-       uint16  bb;             /* Baseband attenuation */
-       uint16  radio;          /* Radio attenuation */
-       uint16  txctl1;         /* Radio TX_CTL1 value */
-} atten_t;
-
-/* Used to get specific STA parameters */ 
-typedef struct {
-       uint32  val;
-       struct ether_addr ea;
-} scb_val_t;
-
-/* callback registration data types */
-
-typedef struct _mac_event_params {
-       uint msg;
-       struct ether_addr *addr;
-       uint result;
-       uint status; 
-       uint auth_type;
-} mac_event_params_t;
-
-typedef struct _mic_error_params {
-       struct ether_addr *ea;
-       bool group;
-       bool flush_txq;
-} mic_error_params_t;
-
-typedef enum _wl_callback {
-       WL_MAC_EVENT_CALLBACK = 0,
-       WL_LINK_UP_CALLBACK,
-       WL_LINK_DOWN_CALLBACK,
-       WL_MIC_ERROR_CALLBACK,
-       WL_LAST_CALLBACK
-} wl_callback_t;
-
-typedef struct _callback {
-       void (*fn)(void *, void *);
-       void *context;
-} callback_t;
-
-typedef struct _scan_callback {
-       void (*fn)(void *);
-       void *context;
-} scan_callback_t;
-
-/* used to register an arbitrary callback via the IOCTL interface */
-typedef struct _set_callback {
-       int index;
-       callback_t callback;
-} set_callback_t;
-
-
-
-/* Event data type */
-typedef struct {
-       uint msg;                       /* Message (see below) */
-       struct ether_addr *addr;        /* Station address (if applicable) */
-       uint status;                    /* Status code (see below) */
-       uint reason;                    /* Reason code (if applicable) */
-       uint auth_type;                 /* WLC_E_AUTH */
-       bool link;                      /* WLC_E_LINK */
-       bool group;                     /* WLC_E_MIC_ERROR */
-       bool flush_txq;                 /* WLC_E_MIC_ERROR */
-} wlc_event_t;
-
-typedef struct {
-       uint16          ver;    /* version of this struct */
-       uint16          cap;    /* sta's advertized capabilities */
-       uint32          flags;  /* flags defined below */
-       uint32          idle;   /* time since data pkt rx'd from sta */
-       struct ether_addr       ea;     /* Station address */
-       wl_rateset_t    rateset;        /* rateset in use */
-} sta_info_t;
-
-#define WL_STA_INFO_LEN        300
-#define WL_STA_VER     1
-
-/* flags fields */
-#define WL_STA_BRCM    0x01
-#define WL_STA_WME     0x02
-#define WL_STA_ABCAP   0x04
-#define WL_STA_AUTHE   0x08 
-#define WL_STA_ASSOC   0x10 
-#define WL_STA_AUTHO   0x20 
-
-/* Event messages */
-#define WLC_E_SET_SSID         1
-#define WLC_E_JOIN             2
-#define WLC_E_START            3
-#define WLC_E_AUTH             4
-#define WLC_E_AUTH_IND         5
-#define WLC_E_DEAUTH           6
-#define WLC_E_DEAUTH_IND       7
-#define WLC_E_ASSOC            8
-#define WLC_E_ASSOC_IND                9
-#define WLC_E_REASSOC          10
-#define WLC_E_REASSOC_IND      11
-#define WLC_E_DISASSOC         12
-#define WLC_E_DISASSOC_IND     13
-#define WLC_E_QUIET_START      14      /* 802.11h Quiet period started */
-#define WLC_E_QUIET_END                15      /* 802.11h Quiet period ended */
-#define WLC_E_GOT_BEACONS      16      
-#define WLC_E_LINK             17      /* Link indication */
-#define WLC_E_MIC_ERROR                18      /* TKIP MIC error occurred */
-#define WLC_E_NDIS_LINK                19      /* NDIS style link indication */
-#define WLC_E_ROAM             20
-#define WLC_E_LAST             21
-
-/* Event status codes */
-#define WLC_E_STATUS_SUCCESS           0
-#define WLC_E_STATUS_FAIL              1
-#define WLC_E_STATUS_TIMEOUT           2
-#define WLC_E_STATUS_NO_NETWORKS       3
-#define WLC_E_STATUS_ABORT             4
-
-typedef struct wlc_event_cb {
-       uint msg;                               /* Event message or 0 for all */
-       void (*fn)(void *, wlc_event_t *);      /* Callback function */
-       void *context;                          /* Passed to callback function */
-       struct wlc_event_cb *next;              /* Next in the chain */
-} wlc_event_cb_t;
-
-/*
- * Country locale determines which channels are available to us.
- */
-typedef enum _wlc_locale {
-       WLC_WW = 0,     /* Worldwide */
-       WLC_THA,        /* Thailand */
-       WLC_ISR,        /* Israel */
-       WLC_JDN,        /* Jordan */
-       WLC_PRC,        /* China */
-       WLC_JPN,        /* Japan */
-       WLC_FCC,        /* USA */
-       WLC_EUR,        /* Europe */
-       WLC_USL,        /* US Low Band only */
-       WLC_JPH,        /* Japan High Band only */
-       WLC_ALL,        /* All the channels in this band */
-       WLC_11D,        /* Represents locale recieved by 11d beacons */
-       WLC_LAST_LOCALE,
-       WLC_UNDEFINED_LOCALE = 0xf
-} wlc_locale_t;
-
-/* channel encoding */
-typedef struct channel_info {
-       int hw_channel;
-       int target_channel;
-       int scan_channel;
-} channel_info_t;
-
-/* For ioctls that take a list of MAC addresses */
-struct maclist {
-       uint count;                     /* number of MAC addresses */
-       struct ether_addr ea[1];        /* variable length array of MAC addresses */
-};
-
-/* get pkt count struct passed through ioctl */
-typedef struct get_pktcnt {
-       uint rx_good_pkt;
-       uint rx_bad_pkt;
-       uint tx_good_pkt;
-       uint tx_bad_pkt;
-} get_pktcnt_t;
-
-/* Linux network driver ioctl encoding */
-typedef struct wl_ioctl {
-       uint cmd;       /* common ioctl definition */
-       void *buf;      /* pointer to user buffer */
-       uint len;       /* length of user buffer */
-       bool set;       /* get or set request (optional) */
-       uint used;      /* bytes read or written (optional) */
-       uint needed;    /* bytes needed (optional) */
-} wl_ioctl_t;
-
-/* 
- * Structure for passing hardware and software 
- * revision info up from the driver. 
- */
-typedef struct wlc_rev_info {
-       uint            vendorid;       /* PCI vendor id */
-       uint            deviceid;       /* device id of chip */
-       uint            radiorev;       /* radio revision */
-       uint            chiprev;        /* chip revision */
-       uint            corerev;        /* core revision */
-       uint            boardid;        /* board identifier (usu. PCI sub-device id) */
-       uint            boardvendor;    /* board vendor (usu. PCI sub-vendor id) */
-       uint            boardrev;       /* board revision */
-       uint            driverrev;      /* driver version */
-       uint            ucoderev;       /* microcode version */
-       uint            bus;            /* bus type */
-       uint        chipnum;    /* chip number */
-} wlc_rev_info_t;
-
-/* check this magic number */
-#define WLC_IOCTL_MAGIC                0x14e46c77
-
-/* bump this number if you change the ioctl interface */
-#define WLC_IOCTL_VERSION      1
-
-/* maximum length buffer required */
-#define WLC_IOCTL_MAXLEN       8192
-
-/* common ioctl definitions */
-#define WLC_GET_MAGIC                          0
-#define WLC_GET_VERSION                                1
-#define WLC_UP                                 2
-#define WLC_DOWN                               3
-#define WLC_GET_LOOP                           4
-#define WLC_SET_LOOP                           5
-#define WLC_DUMP                               6
-#define WLC_GET_MSGLEVEL                       7
-#define WLC_SET_MSGLEVEL                       8
-#define WLC_GET_PROMISC                                9
-#define WLC_SET_PROMISC                                10
-#define WLC_OBSOLETE                           11 
-#define WLC_GET_RATE                           12
-#define WLC_SET_RATE                           13
-#define WLC_GET_INSTANCE                       14
-#define WLC_GET_FRAG                           15
-#define WLC_SET_FRAG                           16
-#define WLC_GET_RTS                            17
-#define WLC_SET_RTS                            18
-#define WLC_GET_INFRA                          19
-#define WLC_SET_INFRA                          20
-#define WLC_GET_AUTH                           21
-#define WLC_SET_AUTH                           22
-#define WLC_GET_BSSID                          23
-#define WLC_SET_BSSID                          24
-#define WLC_GET_SSID                           25
-#define WLC_SET_SSID                           26
-#define WLC_RESTART                            27
-#define WLC_DUMP_SCB                           28 
-#define WLC_GET_CHANNEL                                29
-#define WLC_SET_CHANNEL                                30
-#define WLC_GET_SRL                            31
-#define WLC_SET_SRL                            32
-#define WLC_GET_LRL                            33
-#define WLC_SET_LRL                            34
-#define WLC_GET_PLCPHDR                                35
-#define WLC_SET_PLCPHDR                                36
-#define WLC_GET_RADIO                          37
-#define WLC_SET_RADIO                          38
-#define WLC_GET_PHYTYPE                                39
-#define WLC_DUMP_RATE                          40
-#define WLC_SET_RATE_PARAMS                    41
-#define WLC_GET_WEP                            42
-#define WLC_SET_WEP                            43
-#define WLC_GET_KEY                            44
-#define WLC_SET_KEY                            45
-#define WLC_GET_REGULATORY                     46
-#define WLC_SET_REGULATORY                     47
-#define WLC_GET_PASSIVE                                48      /* added by nbd */
-#define WLC_SET_PASSIVE                                49      /* added by nbd */
-#define WLC_SCAN                               50
-#define WLC_SCAN_RESULTS                       51
-#define WLC_DISASSOC                           52
-#define WLC_REASSOC                            53
-#define WLC_GET_ROAM_TRIGGER                   54
-#define WLC_SET_ROAM_TRIGGER                   55
-#define WLC_GET_ROAM_DELTA                     56
-#define WLC_SET_ROAM_DELTA                     57
-#define WLC_GET_ROAM_SCAN_PERIOD               58
-#define WLC_SET_ROAM_SCAN_PERIOD               59
-#define WLC_EVM                                        60
-#define WLC_GET_TXANT                          61
-#define WLC_SET_TXANT                          62
-#define WLC_GET_ANTDIV                         63
-#define WLC_SET_ANTDIV                         64
-#define WLC_GET_TXPWR                          65
-#define WLC_SET_TXPWR                          66
-#define WLC_GET_CLOSED                         67
-#define WLC_SET_CLOSED                         68
-#define WLC_GET_MACLIST                                69
-#define WLC_SET_MACLIST                                70
-#define WLC_GET_RATESET                                71
-#define WLC_SET_RATESET                                72
-#define WLC_GET_LOCALE                         73
-#define WLC_SET_LOCALE                         74
-#define WLC_GET_BCNPRD                         75
-#define WLC_SET_BCNPRD                         76
-#define WLC_GET_DTIMPRD                                77
-#define WLC_SET_DTIMPRD                                78
-#define WLC_GET_SROM                           79
-#define WLC_SET_SROM                           80
-#define WLC_GET_WEP_RESTRICT                   81
-#define WLC_SET_WEP_RESTRICT                   82
-#define WLC_GET_COUNTRY                                83
-#define WLC_SET_COUNTRY                                84
-#define WLC_GET_PM                             85
-#define WLC_SET_PM                             86
-#define WLC_GET_WAKE                           87
-#define WLC_SET_WAKE                           88
-#define        WLC_GET_D11CNTS                         89
-#define WLC_GET_FORCELINK                      90      /* ndis only */
-#define WLC_SET_FORCELINK                      91      /* ndis only */
-#define WLC_FREQ_ACCURACY                      92
-#define WLC_CARRIER_SUPPRESS                   93
-#define WLC_GET_PHYREG                         94
-#define WLC_SET_PHYREG                         95
-#define WLC_GET_RADIOREG                       96
-#define WLC_SET_RADIOREG                       97
-#define WLC_GET_REVINFO                                98
-#define WLC_GET_UCANTDIV                       99
-#define WLC_SET_UCANTDIV                       100
-#define WLC_R_REG                              101
-#define WLC_W_REG                              102
-#define WLC_DIAG_LOOPBACK                      103
-#define WLC_RESET_D11CNTS                      104
-#define WLC_GET_MACMODE                                105
-#define WLC_SET_MACMODE                                106
-#define WLC_GET_MONITOR                                107     /* added by nbd */
-#define WLC_SET_MONITOR                                108     /* added by nbd */
-#define WLC_GET_GMODE                          109
-#define WLC_SET_GMODE                          110
-#define WLC_GET_LEGACY_ERP                     111
-#define WLC_SET_LEGACY_ERP                     112
-#define WLC_GET_RX_ANT                         113
-#define WLC_GET_CURR_RATESET                   114     /* current rateset */
-#define WLC_GET_SCANSUPPRESS                   115
-#define WLC_SET_SCANSUPPRESS                   116
-#define WLC_GET_AP                             117
-#define WLC_SET_AP                             118
-#define WLC_GET_EAP_RESTRICT                   119
-#define WLC_SET_EAP_RESTRICT                   120
-#define WLC_SCB_AUTHORIZE                      121
-#define WLC_SCB_DEAUTHORIZE                    122
-#define WLC_GET_WDSLIST                                123
-#define WLC_SET_WDSLIST                                124
-#define WLC_GET_ATIM                           125
-#define WLC_SET_ATIM                           126
-#define WLC_GET_RSSI                           127
-#define WLC_GET_PHYANTDIV                      128
-#define WLC_SET_PHYANTDIV                      129
-#define WLC_AP_RX_ONLY                         130
-#define WLC_GET_TX_PATH_PWR                    131
-#define WLC_SET_TX_PATH_PWR                    132
-#define WLC_GET_WSEC                           133
-#define WLC_SET_WSEC                           134
-#define WLC_GET_PHY_NOISE                      135
-#define WLC_GET_BSS_INFO                       136
-#define WLC_GET_PKTCNTS                                137
-#define WLC_GET_LAZYWDS                                138
-#define WLC_SET_LAZYWDS                                139
-#define WLC_GET_BANDLIST                       140
-#define WLC_GET_BAND                           141
-#define WLC_SET_BAND                           142
-#define WLC_SCB_DEAUTHENTICATE                 143
-#define WLC_GET_SHORTSLOT                      144
-#define WLC_GET_SHORTSLOT_OVERRIDE             145
-#define WLC_SET_SHORTSLOT_OVERRIDE             146
-#define WLC_GET_SHORTSLOT_RESTRICT             147
-#define WLC_SET_SHORTSLOT_RESTRICT             148
-#define WLC_GET_GMODE_PROTECTION               149
-#define WLC_GET_GMODE_PROTECTION_OVERRIDE      150
-#define WLC_SET_GMODE_PROTECTION_OVERRIDE      151
-#define WLC_UPGRADE                            152
-#define WLC_GET_MRATE                          153
-#define WLC_SET_MRATE                          154
-#define WLC_GET_IGNORE_BCNS                    155
-#define WLC_SET_IGNORE_BCNS                    156
-#define WLC_GET_SCB_TIMEOUT                    157
-#define WLC_SET_SCB_TIMEOUT                    158
-#define WLC_GET_ASSOCLIST                      159
-#define WLC_GET_CLK                            160
-#define WLC_SET_CLK                            161
-#define WLC_GET_UP                             162
-#define WLC_OUT                                        163
-#define WLC_GET_WPA_AUTH                       164
-#define WLC_SET_WPA_AUTH                       165
-#define WLC_GET_UCFLAGS                                166
-#define WLC_SET_UCFLAGS                                167
-#define WLC_GET_PWRIDX                         168
-#define WLC_SET_PWRIDX                         169
-#define WLC_GET_TSSI                           170
-#define WLC_GET_SUP_RATESET_OVERRIDE           171
-#define WLC_SET_SUP_RATESET_OVERRIDE           172
-#define WLC_SET_FAST_TIMER                     173
-#define WLC_GET_FAST_TIMER                     174
-#define WLC_SET_SLOW_TIMER                     175
-#define WLC_GET_SLOW_TIMER                     176
-#define WLC_DUMP_PHYREGS                       177
-#define WLC_GET_GMODE_PROTECTION_CONTROL       178
-#define WLC_SET_GMODE_PROTECTION_CONTROL       179
-#define WLC_GET_PHYLIST                                180
-#define WLC_ENCRYPT_STRENGTH                   181     /* ndis only */
-#define WLC_DECRYPT_STATUS                     182     /* ndis only */
-#define WLC_GET_KEY_SEQ                                183
-#define WLC_GET_SCAN_CHANNEL_TIME              184
-#define WLC_SET_SCAN_CHANNEL_TIME              185
-#define WLC_GET_SCAN_UNASSOC_TIME              186
-#define WLC_SET_SCAN_UNASSOC_TIME              187
-#define WLC_GET_SCAN_HOME_TIME                 188
-#define WLC_SET_SCAN_HOME_TIME                 189
-#define WLC_GET_SCAN_PASSES                    190
-#define WLC_SET_SCAN_PASSES                    191
-#define WLC_GET_PRB_RESP_TIMEOUT               192
-#define WLC_SET_PRB_RESP_TIMEOUT               193
-#define WLC_GET_ATTEN                          194
-#define WLC_SET_ATTEN                          195
-#define WLC_GET_SHMEM                          196     /* diag */
-#define WLC_SET_SHMEM                          197     /* diag */
-#define WLC_GET_GMODE_PROTECTION_CTS           198
-#define WLC_SET_GMODE_PROTECTION_CTS           199
-#define WLC_SET_TKIP_MIC_FLAG                  200
-#define WLC_SCB_DEAUTHENTICATE_FOR_REASON      201
-#define WLC_TKIP_COUNTERMEASURES               202
-#define WLC_GET_PIOMODE                                203
-#define WLC_SET_PIOMODE                                204
-#define WLC_SET_LED                            209
-#define WLC_GET_LED                            210
-#define WLC_GET_INTERFERENCE_MODE              211
-#define WLC_SET_INTERFERENCE_MODE              212
-#define WLC_GET_CHANNEL_QA                     213
-#define WLC_START_CHANNEL_QA                   214
-#define WLC_GET_CHANNEL_SEL                    215
-#define WLC_START_CHANNEL_SEL                  216
-#define WLC_GET_VALID_CHANNELS                 217
-#define WLC_GET_FAKEFRAG                       218
-#define WLC_SET_FAKEFRAG                       219
-#define WLC_GET_PWROUT_PERCENTAGE              220
-#define WLC_SET_PWROUT_PERCENTAGE              221
-#define WLC_SET_BAD_FRAME_PREEMPT              222
-#define WLC_GET_BAD_FRAME_PREEMPT              223
-#define WLC_SET_LEAP_LIST                      224
-#define WLC_GET_LEAP_LIST                      225
-#define WLC_GET_CWMIN                          226
-#define WLC_SET_CWMIN                          227
-#define WLC_GET_CWMAX                          228
-#define WLC_SET_CWMAX                          229
-#define WLC_GET_WET                            230
-#define WLC_SET_WET                            231
-#define WLC_GET_KEY_PRIMARY                    235
-#define WLC_SET_KEY_PRIMARY                    236
-#define WLC_SCAN_WITH_CALLBACK                 240
-#define WLC_WDS_GET_REMOTE_HWADDR              246     /* currently handled in wl_linux.c/wl_vx.c */
-#define WLC_SET_CS_SCAN_TIMER                  248
-#define WLC_GET_CS_SCAN_TIMER                  249
-#define WLC_CURRENT_PWR                                256
-#define WLC_GET_CHANNELS_IN_COUNTRY            260
-#define WLC_GET_COUNTRY_LIST                   261
-#define WLC_GET_VAR                            262     /* get value of named variable */
-#define WLC_SET_VAR                            263     /* set named variable to value */
-#define WLC_NVRAM_GET                          264
-#define WLC_NVRAM_SET                          265
-#define WLC_SET_WSEC_PMK                       268
-#define WLC_GET_AUTH_MODE                      269
-#define WLC_SET_AUTH_MODE                      270
-#define WLC_LAST                               273     /* do not change - use get_var/set_var */
-
-/*
- * Minor kludge alert:
- * Duplicate a few definitions that irelay requires from epiioctl.h here
- * so caller doesn't have to include this file and epiioctl.h .
- * If this grows any more, it would be time to move these irelay-specific
- * definitions out of the epiioctl.h and into a separate driver common file.
- */
-#ifndef EPICTRL_COOKIE
-#define EPICTRL_COOKIE         0xABADCEDE
-#endif
-
-/* vx wlc ioctl's offset */
-#define CMN_IOCTL_OFF 0x180
-
-/*
- * custom OID support
- *
- * 0xFF - implementation specific OID
- * 0xE4 - first byte of Broadcom PCI vendor ID
- * 0x14 - second byte of Broadcom PCI vendor ID
- * 0xXX - the custom OID number
- */
-
-/* begin 0x1f values beyond the start of the ET driver range. */
-#define WL_OID_BASE            0xFFE41420
-
-/* NDIS overrides */
-#define OID_WL_GETINSTANCE     (WL_OID_BASE + WLC_GET_INSTANCE)
-#define OID_WL_GET_FORCELINK   (WL_OID_BASE + WLC_GET_FORCELINK)
-#define OID_WL_SET_FORCELINK   (WL_OID_BASE + WLC_SET_FORCELINK)
-#define        OID_WL_ENCRYPT_STRENGTH (WL_OID_BASE + WLC_ENCRYPT_STRENGTH)
-#define OID_WL_DECRYPT_STATUS  (WL_OID_BASE + WLC_DECRYPT_STATUS)
-
-#define WL_DECRYPT_STATUS_SUCCESS      1
-#define WL_DECRYPT_STATUS_FAILURE      2
-#define WL_DECRYPT_STATUS_UNKNOWN      3
-
-/* allows user-mode app to poll the status of USB image upgrade */
-#define WLC_UPGRADE_SUCCESS                    0
-#define WLC_UPGRADE_PENDING                    1
-
-/* Bit masks for radio disabled status - returned by WL_GET_RADIO */
-#define WL_RADIO_SW_DISABLE    (1<<0)
-#define WL_RADIO_HW_DISABLE    (1<<1)
-
-/* Override bit for WLC_SET_TXPWR.  if set, ignore other level limits */
-#define WL_TXPWR_OVERRIDE      (1<<31)
-
-
-/* Bus types */
-#define WL_SB_BUS      0       /* Silicon Backplane */
-#define WL_PCI_BUS     1       /* PCI target */
-#define WL_PCMCIA_BUS  2       /* PCMCIA target */
-
-/* band types */
-#define        WLC_BAND_AUTO           0       /* auto-select */
-#define        WLC_BAND_A              1       /* "a" band (5   Ghz) */
-#define        WLC_BAND_B              2       /* "b" band (2.4 Ghz) */
-
-/* MAC list modes */
-#define WLC_MACMODE_DISABLED   0       /* MAC list disabled */
-#define WLC_MACMODE_DENY       1       /* Deny specified (i.e. allow unspecified) */
-#define WLC_MACMODE_ALLOW      2       /* Allow specified (i.e. deny unspecified) */   
-
-
-/* 54g modes (basic bits may still be overridden) */
-#define GMODE_LEGACY_B         0       /* Rateset: 1b, 2b, 5.5, 11 */
-                                       /* Preamble: Long */
-                                       /* Shortslot: Off */
-#define GMODE_AUTO             1       /* Rateset: 1b, 2b, 5.5b, 11b, 18, 24, 36, 54 */
-                                       /* Extended Rateset: 6, 9, 12, 48 */
-                                       /* Preamble: Long */
-                                       /* Shortslot: Auto */
-#define GMODE_ONLY             2       /* Rateset: 1b, 2b, 5.5b, 11b, 18, 24b, 36, 54 */
-                                       /* Extended Rateset: 6b, 9, 12b, 48 */
-                                       /* Preamble: Short required */
-                                       /* Shortslot: Auto */
-#define GMODE_B_DEFERRED       3       /* Rateset: 1b, 2b, 5.5b, 11b, 18, 24, 36, 54 */
-                                       /* Extended Rateset: 6, 9, 12, 48 */
-                                       /* Preamble: Long */
-                                       /* Shortslot: On */
-#define GMODE_PERFORMANCE      4       /* Rateset: 1b, 2b, 5.5b, 6b, 9, 11b, 12b, 18, 24b, 36, 48, 54 */
-                                       /* Preamble: Short required */
-                                       /* Shortslot: On and required */
-#define GMODE_LRS              5       /* Rateset: 1b, 2b, 5.5b, 11b */
-                                       /* Extended Rateset: 6, 9, 12, 18, 24, 36, 48, 54 */
-                                       /* Preamble: Long */
-                                       /* Shortslot: Auto */
-#define GMODE_MAX              6
-
-
-/* values for PLCPHdr_override */
-#define WLC_PLCP_AUTO  -1
-#define WLC_PLCP_SHORT 0
-#define WLC_PLCP_LONG  1
-
-/* values for g_protection_override */
-#define WLC_G_PROTECTION_AUTO  -1
-#define WLC_G_PROTECTION_OFF   0
-#define WLC_G_PROTECTION_ON    1
-
-/* values for g_protection_control */
-#define WLC_G_PROTECTION_CTL_OFF       0
-#define WLC_G_PROTECTION_CTL_LOCAL     1
-#define WLC_G_PROTECTION_CTL_OVERLAP   2
-
-/* Values for PM */
-#define PM_OFF 0
-#define PM_MAX 1
-#define PM_FAST 2
-
-/* interference mitigation options */
-#define        INTERFERE_NONE  0       /* off */
-#define        NON_WLAN        1       /* foreign/non 802.11 interference, no auto detect */
-#define        WLAN_MANUAL     2       /* ACI: no auto detection */
-#define        WLAN_AUTO       3       /* ACI: auto - detact */
-
-/* Message levels */
-#define WL_ERROR_VAL           0x0001
-#define WL_TRACE_VAL           0x0002
-#define WL_PRHDRS_VAL          0x0004
-#define WL_PRPKT_VAL           0x0008
-#define WL_INFORM_VAL          0x0010
-#define WL_TMP_VAL             0x0020
-#define WL_OID_VAL             0x0040
-#define WL_RATE_VAL            0x0080
-#define WL_ASSOC_VAL           0x0100
-#define WL_PRUSR_VAL           0x0200
-#define WL_PS_VAL              0x0400
-#define WL_TXPWR_VAL           0x0800
-#define WL_GMODE_VAL           0x1000
-#define WL_DUAL_VAL            0x2000
-#define WL_WSEC_VAL            0x4000
-#define WL_WSEC_DUMP_VAL       0x8000
-#define WL_LOG_VAL             0x10000
-#define WL_NRSSI_VAL           0x20000
-#define WL_LOFT_VAL            0x40000
-#define WL_REGULATORY_VAL      0x80000
-#define WL_ACI_VAL             0x100000
-
-
-/* 802.11h enforcement levels */
-#define SPECT_MNGMT_OFF         0   /* 11h disabled */
-#define SPECT_MNGMT_LOOSE       1   /* Allow scan lists to contain non-11h AP */
-                                   /* when 11h is enabled */
-#define SPECT_MNGMT_STRICT      2   /* Prine out non-11h APs from scan list */
-
-
-
-/* max # of leds supported by GPIO (gpio pin# == led index#) */
-#define        WL_LED_NUMGPIO          16      /* gpio 0-15 */
-
-/* led per-pin behaviors */
-#define        WL_LED_OFF              0               /* always off */
-#define        WL_LED_ON               1               /* always on */
-#define        WL_LED_ACTIVITY         2               /* activity */
-#define        WL_LED_RADIO            3               /* radio enabled */
-#define        WL_LED_ARADIO           4               /* 5  Ghz radio enabled */
-#define        WL_LED_BRADIO           5               /* 2.4Ghz radio enabled */
-#define        WL_LED_BGMODE           6               /* on if gmode, off if bmode */
-#define        WL_LED_WI1              7               
-#define        WL_LED_WI2              8               
-#define        WL_LED_WI3              9               
-#define        WL_LED_ASSOC            10              /* associated state indicator */
-#define        WL_LED_INACTIVE         11              /* null behavior (clears default behavior) */
-#define        WL_LED_NUMBEHAVIOR      12
-
-/* led behavior numeric value format */
-#define        WL_LED_BEH_MASK         0x7f            /* behavior mask */
-#define        WL_LED_AL_MASK          0x80            /* activelow (polarity) bit */
-
-
-/* maximum channels */
-#define WL_NUMCHANNELS 64      /* max # of channels in the band */
-
-/* rate check */
-#define WL_RATE_OFDM(r)                (((r) & 0x7f) == 12 || ((r) & 0x7f) == 18 || \
-                                ((r) & 0x7f) == 24 || ((r) & 0x7f) == 36 || \
-                                ((r) & 0x7f) == 48 || ((r) & 0x7f) == 72 || \
-                                ((r) & 0x7f) == 96 || ((r) & 0x7f) == 108)
-
-/* WDS link local endpoint WPA role */
-#define WL_WDS_WPA_ROLE_AUTH   0       /* authenticator */
-#define WL_WDS_WPA_ROLE_SUP    1       /* supplicant */
-#define WL_WDS_WPA_ROLE_AUTO   255     /* auto, based on mac addr value */
-
-/* afterburner_override */
-#define        ABO_AUTO                -1      /* auto - no override */
-#define        ABO_OFF                 0       /* force afterburner off */
-#define        ABO_ON                  1       /* force afterburner on */
-
-#define GMODE_AFTERBURNER 6
-
-#undef PACKED
-
-#endif /* _wlioctl_h_ */
diff --git a/openwrt/package/openwrt/include/wlutils.h b/openwrt/package/openwrt/include/wlutils.h
deleted file mode 100644 (file)
index 07e2536..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Broadcom wireless network adapter utility functions
- *
- * Copyright 2004, Broadcom Corporation
- * All Rights Reserved.
- * 
- * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
- * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
- * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
- *
- * $Id$
- */
-
-#ifndef _wlutils_h_
-#define _wlutils_h_
-
-#include <typedefs.h>
-#include <wlioctl.h>
-
-/*
- * Pass a wlioctl request to the specified interface.
- * @param      name    interface name
- * @param      cmd     WLC_GET_MAGIC <= cmd < WLC_LAST
- * @param      buf     buffer for passing in and/or receiving data
- * @param      len     length of buf
- * @return     >= 0 if successful or < 0 otherwise
- */
-extern int wl_ioctl(char *name, int cmd, void *buf, int len);
-
-/*
- * Get the MAC (hardware) address of the specified interface.
- * @param      name    interface name
- * @param      hwaddr  6-byte buffer for receiving address
- * @return     >= 0 if successful or < 0 otherwise
- */
-extern int wl_hwaddr(char *name, unsigned char *hwaddr);
-
-/*
- * Probe the specified interface.
- * @param      name    interface name
- * @return     >= 0 if a Broadcom wireless device or < 0 otherwise
- */
-extern int wl_probe(char *name);
-
-/*
- * Set/Get named variable.
- * @param      name    interface name
- * @param      var     variable name
- * @param      val     variable value/buffer
- * @param      len     variable value/buffer length
- * @return     success == 0, failure != 0
- */
-extern int wl_set_val(char *name, char *var, void *val, int len);
-extern int wl_get_val(char *name, char *var, void *val, int len);
-extern int wl_set_int(char *name, char *var, int val);
-extern int wl_get_int(char *name, char *var, int *val);
-
-#endif /* _wlutils_h_ */
diff --git a/openwrt/package/openwrt/jffs2root.c b/openwrt/package/openwrt/jffs2root.c
deleted file mode 100644 (file)
index 36b928f..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * jffs2root.c
- *
- * Copyright (C) 2005 Mike Baker 
- *
- * 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, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * $Id$
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <string.h>
-
-#include <sys/ioctl.h>
-#include <linux/mtd/mtd.h>
-
-#define FILENAME "/dev/mtdblock/1"
-
-struct trx_header {
-    unsigned magic;            /* "HDR0" */
-    unsigned len;              /* Length of file including header */
-    unsigned crc32;            /* 32-bit CRC from flag_version to end of file */
-    unsigned flag_version;     /* 0:15 flags, 16:31 version */
-    unsigned offsets[3];       /* Offsets of partitions from start of header */
-};
-
-unsigned long *crc32;
-
-void init_crc32()
-{
-    unsigned long crc;
-    unsigned long poly = 0xEDB88320L;
-    int n, bit;
-    if ((crc32 = (unsigned long *) malloc(256 * sizeof(unsigned long))) == (void *)-1) {
-           perror("malloc");
-           exit(1);
-    }
-    for (n = 0; n < 256; n++) {
-       crc = (unsigned long) n;
-       for (bit = 0; bit < 8; bit++)
-           crc = (crc & 1) ? (poly ^ (crc >> 1)) : (crc >> 1);
-       crc32[n] = crc;
-    }
-}
-
-unsigned int crc32buf(char *buf, size_t len)
-{
-    unsigned int crc = 0xFFFFFFFF;
-    for (; len; len--, buf++)
-       crc = crc32[(crc ^ *buf) & 0xff] ^ (crc >> 8);
-    return crc;
-}
-
-int main(int argc, char **argv)
-{
-    int fd;
-    struct mtd_info_user mtdInfo;
-    unsigned long len;
-    struct trx_header *ptr;
-       
-    if (((fd = open(FILENAME, O_RDWR))  < 0)
-    || ((len = lseek(fd, 0, SEEK_END)) < 0)
-    || ((ptr = (struct trx_header *) mmap(0, len, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0)) == (void *) (-1))
-    || (ptr->magic != 0x30524448)) {
-       printf("Error reading trx info\n");
-       exit(-1);
-    }
-    close (fd);
-
-    if (((fd = open("/dev/mtd/1", O_RDWR))  < 0)
-    || (ioctl(fd, MEMGETINFO, &mtdInfo))) {
-      fprintf(stderr, "Could not get MTD device info from %s\n", FILENAME);
-      close(fd);
-      exit(1);
-    }
-    close(fd);
-
-    if (argc > 1 && !strcmp(argv[1],"--move")) {
-      if (ptr->offsets[2] >= ptr->len) {
-        printf("Partition already moved outside trx\n");
-      } else {
-       init_crc32();
-       ptr->offsets[2] +=  (mtdInfo.erasesize - 1);
-       ptr->offsets[2] &= ~(mtdInfo.erasesize - 1);
-        ptr->len = ptr->offsets[2];
-        ptr->crc32 = crc32buf((void *) &(ptr->flag_version), ptr->len - offsetof(struct trx_header, flag_version));
-       msync(ptr,sizeof(struct trx_header),MS_SYNC|MS_INVALIDATE);
-       printf("Partition moved; please reboot\n");
-      }
-    } else {
-      int x;
-      printf(" erase: 0x%08x\n",mtdInfo.erasesize);
-      printf("=== trx ===\n");
-      printf("mapped: 0x%08x\n", (unsigned)ptr);
-      printf(" magic: 0x%08x\n", ptr->magic);
-      printf("   len: 0x%08x\n", ptr->len);
-      printf("   crc: 0x%08x\n", ptr->crc32);
-      for (x = 0; x < 3; x++)
-       printf(" offset[%d]: 0x%08x\n", x, ptr->offsets[x]);
-    }
-
-    munmap((void *) ptr, len);
-    return 0;
-}
diff --git a/openwrt/package/openwrt/libnvram/Makefile b/openwrt/package/openwrt/libnvram/Makefile
deleted file mode 100644 (file)
index a5b6284..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-# $Id$
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=libnvram
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
-
-EXTRA_CFLAGS := -c -I. -I../include
-
-all: compile
-
-define OBJ_template
-$(PKG_BUILD_DIR)/$(1): $(PKG_BUILD_DIR)
-       $(TARGET_CC) $(TARGET_CFLAGS) $(EXTRA_CFLAGS) -o $$@ $$(patsubst %.o,%.c,$(1))
-endef
-
-OBJS := nvram_linux.o nvram_convert.o main.o
-LIBNVRAM_OBJS:= $(PKG_BUILD_DIR)/nvram_linux.o $(PKG_BUILD_DIR)/nvram_convert.o
-$(foreach obj,$(OBJS),$(eval $(call OBJ_template,$(obj))))
-
-$(PKG_BUILD_DIR):
-       mkdir -p $(PKG_BUILD_DIR)
-
-$(PKG_BUILD_DIR)/nvram: $(PKG_BUILD_DIR)/main.o $(PKG_BUILD_DIR)/libnvram.so
-       $(TARGET_CC) $(TARGET_CFLAGS) -o $@ $< -L$(PKG_BUILD_DIR) -lnvram 
-
-$(PKG_BUILD_DIR)/libnvram.so: $(LIBNVRAM_OBJS)
-       $(TARGET_CC) -shared -o $@ $^
-       
-$(STAGING_DIR)/lib/libnvram.so: $(PKG_BUILD_DIR)/libnvram.so
-       install -m 644 $< $@
-
-$(TARGET_DIR)/usr/lib/libnvram.so: $(PKG_BUILD_DIR)/libnvram.so
-       install -m 644 $< $@
-       $(STRIP) $@
-
-$(TARGET_DIR)/usr/sbin/nvram: $(PKG_BUILD_DIR)/nvram
-       mkdir -p $(TARGET_DIR)/usr/sbin
-       install -m 755 $< $@
-       $(STRIP) $@
-
-compile: $(PKG_BUILD_DIR)/libnvram.so $(STAGING_DIR)/lib/libnvram.so $(PKG_BUILD_DIR)/nvram
-install: $(TARGET_DIR)/usr/lib/libnvram.so $(TARGET_DIR)/usr/sbin/nvram
-
-clean:
-       rm -rf $(PKG_BUILD_DIR)
diff --git a/openwrt/package/openwrt/libnvram/main.c b/openwrt/package/openwrt/libnvram/main.c
deleted file mode 100644 (file)
index a64430f..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Frontend command-line utility for Linux NVRAM layer
- *
- * Copyright 2004, Broadcom Corporation
- * All Rights Reserved.
- * 
- * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
- * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
- * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
- *
- * $Id$
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <typedefs.h>
-#include <bcmnvram.h>
-
-static void
-usage(void)
-{
-       fprintf(stderr, "usage: nvram [get name] [set name=value] [unset name] [show]\n");
-       exit(0);
-}
-
-/* NVRAM utility */
-int
-main(int argc, char **argv)
-{
-       char *name, *value, buf[NVRAM_SPACE];
-       int size;
-
-       /* Skip program name */
-       --argc;
-       ++argv;
-
-       if (!*argv) 
-               usage();
-
-       /* Process the remaining arguments. */
-       for (; *argv; argv++) {
-               if (!strncmp(*argv, "get", 3)) {
-                       if (*++argv) {
-                               if ((value = nvram_get(*argv)))
-                                       puts(value);
-                       }
-               }
-               else if (!strncmp(*argv, "set", 3)) {
-                       if (*++argv) {
-                               strncpy(value = buf, *argv, sizeof(buf));
-                               name = strsep(&value, "=");
-                               nvram_set(name, value);
-                       }
-               }
-               else if (!strncmp(*argv, "unset", 5)) {
-                       if (*++argv)
-                               nvram_unset(*argv);
-               }
-               else if (!strncmp(*argv, "commit", 5)) {
-                       nvram_commit();
-               }
-               else if (!strncmp(*argv, "show", 4) ||
-                          !strncmp(*argv, "getall", 6)) {
-                       nvram_getall(buf, sizeof(buf));
-                       for (name = buf; *name; name += strlen(name) + 1)
-                               puts(name);
-                       size = sizeof(struct nvram_header) + (int) name - (int) buf;
-                       fprintf(stderr, "size: %d bytes (%d left)\n", size, NVRAM_SPACE - size);
-               }
-               if (!*argv)
-                       break;
-       }
-
-       return 0;
-}      
diff --git a/openwrt/package/openwrt/libnvram/nvram_convert.c b/openwrt/package/openwrt/libnvram/nvram_convert.c
deleted file mode 100644 (file)
index 4859090..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-
-#define WL(a)  "wl_"a  
-#define WL0(a) "wl0_"a 
-#define D11G(a)        "d11g_"a
-
-#define PPP(a)         "ppp_"a
-#define PPPOE(a)       "pppoe_"a
-
-struct nvram_convert {
-        char *name;            // for WEB
-       char *wl0_name;         // for driver
-        char *d11g_name;       // for old nv name
-};
-
-struct nvram_convert nvram_converts[] = {
-       // Bellow change from 3.11.48.7
-       { WL("ssid"),           WL0("ssid"),    ""},
-       { WL("radio"),          WL0("mode"),    ""},
-       { WL("mode"),           WL0("mode"),    ""},
-       { WL("wds"),            WL0("wds"),     ""},
-       { WL("auth"),           WL0("auth"),    ""},
-       { WL("key"),            WL0("key"),     ""},
-       { WL("key1"),           WL0("key1"),    ""},
-       { WL("key2"),           WL0("key2"),    ""},
-       { WL("key3"),           WL0("key3"),    ""},
-       { WL("key4"),           WL0("key4"),    ""},
-       { WL("maclist"),        WL0("maclist"), ""},
-       { WL("channel"),        WL0("channel"), D11G("channel")},
-       { WL("rateset"),        WL0("rateset"), D11G("rateset")},
-       { WL("rts"),            WL0("rts"),     D11G("rts")},
-       { WL("bcn"),            WL0("bcn"),     D11G("bcn")},
-       { WL("gmode"),          WL0("gmode"),   "d11g_mode"},
-       { WL("unit"),           WL0("unit"),    ""},
-       { WL("ifname"),         WL0("ifname"),  ""},
-       { WL("phytype"),        WL0("phytype"), ""},
-       { WL("country"),        WL0("country"), ""},
-       { WL("closed"),         WL0("closed"),  ""},
-       { WL("lazywds"),        WL0("lazywds"), ""},
-       { WL("wep"),            WL0("wep"),     ""},
-       { WL("macmode"),        WL0("macmode"), ""},
-       { WL("rate"),           WL0("rate"),    D11G("rate")},
-       { WL("frag"),           WL0("frag"),    D11G("frag")},
-       { WL("dtim"),           WL0("dtim"),    D11G("dtim")},
-       { WL("plcphdr"),        WL0("plcphdr"), ""},
-       { WL("gmode_protection"),       WL0("gmode_protection"),        ""},
-       { WL("radio"),          WL0("radio"),   ""},
-       // Bellow change from 3.21.9.0
-       { WL("auth_mode"),      WL0("auth_mode"),       ""},
-       { WL("radius_ipaddr"),  WL0("radius_ipaddr"),   ""},
-       { WL("radius_port"),    WL0("radius_port"),     ""},
-       { WL("radius_key"),     WL0("radius_key"),      ""},
-       { WL("wpa_psk"),        WL0("wpa_psk"),         ""},
-       { WL("wpa_gtk_rekey"),  WL0("wpa_gtk_rekey"),   ""},
-       { WL("frameburst"),     WL0("frameburst"),      ""},
-       { WL("crypto"),         WL0("crypto"),          ""},
-       { WL("ap_isolate"),     WL0("ap_isolate"),      ""},
-       { WL("afterburner"),    WL0("afterburner"),     ""},
-       // for PPPoE
-       { PPP("username"),      PPPOE("username"),      ""},
-       { PPP("passwd"),        PPPOE("passwd"),        ""},
-       { PPP("idletime"),      PPPOE("idletime"),      ""},
-       { PPP("keepalive"),     PPPOE("keepalive"),     ""},
-       { PPP("demand"),        PPPOE("demand"),        ""},
-       { PPP("service"),       PPPOE("service"),       ""},
-       { PPP("ac"),            PPPOE("ac"),            ""},
-       { PPP("static"),        PPPOE("static"),        ""},
-       { PPP("static_ip"),     PPPOE("static_ip"),     ""},
-       { PPP("username_1"),    PPPOE("username_1"),    ""},
-       { PPP("passwd_1"),      PPPOE("passwd_1"),      ""},
-       { PPP("idletime_1"),    PPPOE("idletime_1"),    ""},
-       { PPP("keepalive_1"),   PPPOE("keepalive_1"),   ""},
-       { PPP("demand_1"),      PPPOE("demand_1"),      ""},
-       { PPP("service_1"),     PPPOE("service_1"),     ""},
-       { PPP("ac_1"),          PPPOE("ac_1"),          ""},
-       
-       { 0, 0, 0},
-};
diff --git a/openwrt/package/openwrt/libnvram/nvram_convert.h b/openwrt/package/openwrt/libnvram/nvram_convert.h
deleted file mode 100644 (file)
index 70e1232..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-struct nvram_convert {
-        char *name;
-       char *wl0_name;
-        char *d11g_name;
-};
-
diff --git a/openwrt/package/openwrt/libnvram/nvram_linux.c b/openwrt/package/openwrt/libnvram/nvram_linux.c
deleted file mode 100644 (file)
index c41e321..0000000
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- * NVRAM variable manipulation (Linux user mode half)
- *
- * Copyright 2004, Broadcom Corporation
- * All Rights Reserved.
- * 
- * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
- * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
- * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
- *
- * $Id$
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <error.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-
-#include <typedefs.h>
-#include <bcmnvram.h>
-#include <nvram_convert.h>
-#include <shutils.h>
-#include <utils.h>
-
-#define PATH_DEV_NVRAM "/dev/nvram"
-
-/* Globals */
-static int nvram_fd = -1;
-static char *nvram_buf = NULL;
-int check_action(void);
-int file_to_buf(char *path, char *buf, int len);
-
-int
-nvram_init(void *unused)
-{
-       if ((nvram_fd = open(PATH_DEV_NVRAM, O_RDWR)) < 0)
-               goto err;
-
-       /* Map kernel string buffer into user space */
-       if ((nvram_buf = mmap(NULL, NVRAM_SPACE, PROT_READ, MAP_SHARED, nvram_fd, 0)) == MAP_FAILED) {
-               close(nvram_fd);
-               nvram_fd = -1;
-               goto err;
-       }
-
-       return 0;
-
- err:
-       perror(PATH_DEV_NVRAM);
-       return errno;
-}
-
-char *
-nvram_get(const char *name)
-{
-       size_t count = strlen(name) + 1;
-       char tmp[100], *value;
-       unsigned long *off = (unsigned long *) tmp;
-
-       if (nvram_fd < 0)
-               if (nvram_init(NULL))
-                       return NULL;
-
-       if (count > sizeof(tmp)) {
-               if (!(off = malloc(count)))
-                       return NULL;
-       }
-
-       /* Get offset into mmap() space */
-       strcpy((char *) off, name);
-
-       count = read(nvram_fd, off, count);
-
-       if (count == sizeof(unsigned long))
-               value = &nvram_buf[*off];
-       else
-               value = NULL;
-
-       if (count < 0)
-               perror(PATH_DEV_NVRAM);
-
-       if (off != (unsigned long *) tmp)
-               free(off);
-
-       return value;
-}
-
-int
-nvram_getall(char *buf, int count)
-{
-       int ret;
-
-       if (nvram_fd < 0)
-               if ((ret = nvram_init(NULL)))
-                       return ret;
-
-       if (count == 0)
-               return 0;
-
-       /* Get all variables */
-       *buf = '\0';
-
-       ret = read(nvram_fd, buf, count);
-
-       if (ret < 0)
-               perror(PATH_DEV_NVRAM);
-
-       return (ret == count) ? 0 : ret;
-}
-
-static int
-_nvram_set(const char *name, const char *value)
-{
-       size_t count = strlen(name) + 1;
-       char tmp[100], *buf = tmp;
-       int ret;
-
-       if (nvram_fd < 0)
-               if ((ret = nvram_init(NULL)))
-                       return ret;
-
-       /* Unset if value is NULL */
-       if (value)
-               count += strlen(value) + 1;
-
-       if (count > sizeof(tmp)) {
-               if (!(buf = malloc(count)))
-                       return -ENOMEM;
-       }
-
-       if (value)
-               sprintf(buf, "%s=%s", name, value);
-       else
-               strcpy(buf, name);
-
-       ret = write(nvram_fd, buf, count);
-
-       if (ret < 0)
-               perror(PATH_DEV_NVRAM);
-
-       if (buf != tmp)
-               free(buf);
-
-       return (ret == count) ? 0 : ret;
-}
-
-int
-nvram_set(const char *name, const char *value)
-{
-        extern struct nvram_convert nvram_converts[];
-         struct nvram_convert *v;
-         int ret;
-
-         ret = _nvram_set(name, value);
-
-         for(v = nvram_converts ; v->name ; v++) {
-                 if(!strcmp(v->name, name)){
-                         if(strcmp(v->wl0_name,""))      _nvram_set(v->wl0_name, value);
-                         if(strcmp(v->d11g_name,""))     _nvram_set(v->d11g_name, value);
-                 }
-         }
-
-         return ret;
-}
-
-int
-nvram_unset(const char *name)
-{
-       return _nvram_set(name, NULL);
-}
-
-int
-nvram_commit(void)
-{
-       int ret;
-       
-       cprintf("nvram_commit(): start\n");     
-       
-       if((check_action() == ACT_IDLE) || 
-          (check_action() == ACT_SW_RESTORE) || 
-          (check_action() == ACT_HW_RESTORE)){
-               if (nvram_fd < 0)
-                       if ((ret = nvram_init(NULL)))
-                               return ret;
-
-               ret = ioctl(nvram_fd, NVRAM_MAGIC, NULL);
-
-               if (ret < 0)
-                       perror(PATH_DEV_NVRAM);
-       
-               cprintf("nvram_commit(): end\n");       
-       }
-       else
-               cprintf("nvram_commit():  nothing to do...\n");
-
-       return ret;
-}
-
-int file2nvram(char *filename, char *varname) {
-   FILE *fp;
-   int c,count;
-   int i=0,j=0;
-   char mem[10000],buf[30000];
-
-   if ( !(fp=fopen(filename,"rb") ))
-        return 0;
-
-   count=fread(mem,1,sizeof(mem),fp);
-   fclose(fp);
-   for (j=0;j<count;j++) {
-        if  (i > sizeof(buf)-3 )
-                break;
-        c=mem[j];
-        if (c >= 32 && c <= 126 && c != '\\' && c != '~')  {
-                buf[i++]=(unsigned char) c;
-        } else if (c==0) {
-               buf[i++]='~';
-        } else {
-                buf[i++]='\\';
-                sprintf(buf+i,"%02X",c);
-                i+=2;
-        }
-   }
-   if (i==0) return 0;
-   buf[i]=0;
-   //fprintf(stderr,"================ > file2nvram %s = [%s] \n",varname,buf); 
-   nvram_set(varname,buf);
-   //nvram_commit(); //Barry adds for test
-}
-
-int nvram2file(char *varname, char *filename) {
-   FILE *fp;
-   int c,tmp;
-   int i=0,j=0;
-   char *buf;
-   char mem[10000];
-   
-   if ( !(fp=fopen(filename,"wb") ))
-        return 0;
-        
-   buf=strdup(nvram_safe_get(varname));
-   //fprintf(stderr,"=================> nvram2file %s = [%s] \n",varname,buf);
-   while (  buf[i] && j < sizeof(mem)-3 ) {
-        if (buf[i] == '\\')  {
-                i++;
-                tmp=buf[i+2];
-                buf[i+2]=0;
-                sscanf(buf+i,"%02X",&c);
-                buf[i+2]=tmp;
-                i+=2;
-                mem[j]=c;j++;
-        } else if (buf[i] == '~') {
-               mem[j]=0;j++;
-               i++;
-        } else {
-                mem[j]=buf[i];j++;
-                i++;
-        }       
-   }
-   if (j<=0) return j;
-   j=fwrite(mem,1,j,fp);
-   fclose(fp);
-   free(buf);
-   return j;
-}  
-
-int
-check_action(void)
-{
-       char buf[80] = "";
-       
-       if(file_to_buf(ACTION_FILE, buf, sizeof(buf))){
-               if(!strcmp(buf, "ACT_TFTP_UPGRADE")){
-                       cprintf("Upgrading from tftp now, quiet exit....\n");
-                       return ACT_TFTP_UPGRADE;
-               }
-               else if(!strcmp(buf, "ACT_WEBS_UPGRADE")){
-                       cprintf("Upgrading from web (https) now, quiet exit....\n");
-                       return ACT_WEBS_UPGRADE;
-               }
-               else if(!strcmp(buf, "ACT_WEB_UPGRADE")){
-                       cprintf("Upgrading from web (http) now, quiet exit....\n");
-                       return ACT_WEB_UPGRADE;
-               }
-               else if(!strcmp(buf, "ACT_SW_RESTORE")){
-                       cprintf("Receive restore command from web, quiet exit....\n");
-                       return ACT_SW_RESTORE;
-               }
-               else if(!strcmp(buf, "ACT_HW_RESTORE")){
-                       cprintf("Receive restore commond from resetbutton, quiet exit....\n");
-                       return ACT_HW_RESTORE;
-               }
-       }
-       //fprintf(stderr, "Waiting for upgrading....\n");
-       return ACT_IDLE;
-}
-
-int
-file_to_buf(char *path, char *buf, int len)
-{
-       FILE *fp;
-
-       memset(buf, 0 , len);
-
-       if ((fp = fopen(path, "r"))) {
-               fgets(buf, len, fp);
-               fclose(fp);
-               return 1;
-       }
-
-       return 0;
-}
diff --git a/openwrt/package/openwrt/libshared/Makefile b/openwrt/package/openwrt/libshared/Makefile
deleted file mode 100644 (file)
index 4309c8c..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-# $Id$
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=libshared
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
-
-EXTRA_CFLAGS := -c -I. -I../include
-
-all: compile
-
-LIBSHARED_OBJS:=
-define OBJ_template
-$(PKG_BUILD_DIR)/$(1): $(PKG_BUILD_DIR)
-       $(TARGET_CC) $(TARGET_CFLAGS) $(EXTRA_CFLAGS) -o $$@ $$(patsubst %.o,%.c,$(1))
-LIBSHARED_OBJS += $(PKG_BUILD_DIR)/$(1)
-endef
-
-OBJS := shutils.o wl.o wl_linux.o defaults.o linux_timer.o
-$(foreach obj,$(OBJS),$(eval $(call OBJ_template,$(obj))))
-
-
-$(PKG_BUILD_DIR):
-       mkdir -p $(PKG_BUILD_DIR)
-
-$(PKG_BUILD_DIR)/libshared.so: $(LIBSHARED_OBJS)
-       $(TARGET_CC) -shared -o $@ $^
-
-$(STAGING_DIR)/lib/libshared.so: $(PKG_BUILD_DIR)/libshared.so
-       install -m 644 $< $@ 
-
-$(TARGET_DIR)/usr/lib/libshared.so: $(PKG_BUILD_DIR)/libshared.so
-       install -m 644 $^ $@
-       $(STRIP) $@
-
-compile: $(PKG_BUILD_DIR)/libshared.so $(STAGING_DIR)/lib/libshared.so
-install: $(TARGET_DIR)/usr/lib/libshared.so
-
-clean:
-       rm -rf $(PKG_BUILD_DIR)
diff --git a/openwrt/package/openwrt/libshared/bcmtimer.h b/openwrt/package/openwrt/libshared/bcmtimer.h
deleted file mode 100644 (file)
index 3db9e62..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2004, Broadcom Corporation
- * All Rights Reserved.
- * 
- * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
- * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
- * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
- *
- * Low resolution timer interface. Timer handlers may be called 
- * in a deferred manner in a different task context after the 
- * timer expires or in the task context from which the timer
- * was created, depending on the implementation.
- *
- * $Id$
- */
-#ifndef __bcmtimer_h__
-#define __bcmtimer_h__
-
-/* ANSI headers */
-#include <time.h>
-
-/* timer ID */
-typedef unsigned int bcm_timer_module_id;
-typedef unsigned int bcm_timer_id;
-
-/* timer callback */
-typedef void (*bcm_timer_cb)(bcm_timer_id id, int data);
-
-/* OS-independant interfaces, applications should call these functions only */
-int bcm_timer_module_init(int timer_entries, bcm_timer_module_id *module_id);
-int bcm_timer_module_cleanup(bcm_timer_module_id module_id);
-int bcm_timer_module_enable(bcm_timer_module_id module_id, int enable);
-int bcm_timer_create(bcm_timer_module_id module_id, bcm_timer_id *timer_id);
-int bcm_timer_delete(bcm_timer_id timer_id);
-int bcm_timer_gettime(bcm_timer_id timer_id, struct itimerspec *value);
-int bcm_timer_settime(bcm_timer_id timer_id, const struct itimerspec *value);
-int bcm_timer_connect(bcm_timer_id timer_id, bcm_timer_cb func, int data);
-int bcm_timer_cancel(bcm_timer_id timer_id);
-int bcm_timer_change_expirytime(bcm_timer_id timer_id, const struct itimerspec *timer_spec);
-
-#endif /* #ifndef __bcmtimer_h__ */
diff --git a/openwrt/package/openwrt/libshared/defaults.c b/openwrt/package/openwrt/libshared/defaults.c
deleted file mode 100644 (file)
index 119eaac..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Router default NVRAM values
- *
- * Copyright 2004, Broadcom Corporation
- * All Rights Reserved.
- * 
- * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
- * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
- * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
- *
- * $Id$
- */
-
-#include <epivers.h>
-#include <string.h>
-#include <bcmnvram.h>
-#include <typedefs.h>
-#include <wlioctl.h>
-
-#define XSTR(s) STR(s)
-#define STR(s) #s
-
-struct nvram_tuple router_defaults[] = {
-       /* OS parameters */
-       { "os_name", "", 0 },                   /* OS name string */
-       { "os_version", EPI_VERSION_STR, 0 },   /* OS revision */
-       { "os_date", __DATE__, 0 },             /* OS date */
-
-       /* Miscellaneous parameters */
-       { "timer_interval", "3600", 0 },        /* Timer interval in seconds */
-       { "ntp_server", "192.5.41.40 192.5.41.41 133.100.9.2", 0 },             /* NTP server */
-       { "time_zone", "PST8PDT", 0 },          /* Time zone (GNU TZ format) */
-       { "log_level", "0", 0 },                /* Bitmask 0:off 1:denied 2:accepted */
-       { "upnp_enable", "0", 0 },              /* Start UPnP */
-       { "ezc_enable", "1", 0 },               /* Enable EZConfig updates */
-       { "ezc_version", "1", 0 },              /* EZConfig version */
-       { "is_default", "1", 0 },               /* is it default setting: 1:yes 0:no*/
-       { "os_server", "", 0 },                 /* URL for getting upgrades */
-       { "stats_server", "", 0 },              /* URL for posting stats */
-       { "console_loglevel", "1", 0 },         /* Kernel panics only */
-
-       /* Big switches */
-       { "router_disable", "0", 0 },           /* lan_proto=static lan_stp=0 wan_proto=disabled */
-       { "fw_disable", "0", 0 },               /* Disable firewall (allow new connections from the WAN) */
-
-       { "log_ipaddr", "", 0 },                /* syslog recipient */
-       
-       /* LAN H/W parameters */
-       { "lan_ifname", "", 0 },                /* LAN interface name */
-       { "lan_ifnames", "", 0 },               /* Enslaved LAN interfaces */
-       { "lan_hwnames", "", 0 },               /* LAN driver names (e.g. et0) */
-       { "lan_hwaddr", "", 0 },                /* LAN interface MAC address */
-       
-       /* LAN TCP/IP parameters */
-       { "lan_proto", "dhcp", 0 },             /* [static|dhcp] */
-       { "lan_ipaddr", "192.168.1.1", 0 },     /* LAN IP address */
-       { "lan_netmask", "255.255.255.0", 0 },  /* LAN netmask */
-       { "lan_stp", "0", 0 },                  /* LAN spanning tree protocol */
-       { "lan_wins", "", 0 },                  /* x.x.x.x x.x.x.x ... */
-       { "lan_domain", "", 0 },                /* LAN domain name */
-       { "lan_lease", "86400", 0 },            /* LAN lease time in seconds */
-
-       /* WAN H/W parameters */
-       { "wan_ifname", "", 0 },                /* WAN interface name */
-       { "wan_ifnames", "", 0 },               /* WAN interface names */
-       { "wan_hwname", "", 0 },                /* WAN driver name (e.g. et1) */
-       { "wan_hwaddr", "", 0 },                /* WAN interface MAC address */
-       
-       /* WAN TCP/IP parameters */
-       { "wan_proto", "dhcp", 0 },             /* [static|dhcp|pppoe|disabled] */
-       { "wan_ipaddr", "0.0.0.0", 0 },         /* WAN IP address */
-       { "wan_netmask", "0.0.0.0", 0 },        /* WAN netmask */
-       { "wan_gateway", "0.0.0.0", 0 },        /* WAN gateway */
-       { "wan_dns", "", 0 },                   /* x.x.x.x x.x.x.x ... */
-       { "wan_wins", "", 0 },                  /* x.x.x.x x.x.x.x ... */
-       { "wan_hostname", "", 0 },              /* WAN hostname */
-       { "wan_domain", "", 0 },                /* WAN domain name */
-       { "wan_lease", "86400", 0 },            /* WAN lease time in seconds */
-       
-       /* PPPoE parameters */
-       { "wan_pppoe_ifname", "", 0 },          /* PPPoE enslaved interface */
-       { "wan_pppoe_username", "", 0 },        /* PPP username */
-       { "wan_pppoe_passwd", "", 0 },          /* PPP password */
-       { "wan_pppoe_idletime", "60", 0 },      /* Dial on demand max idle time (seconds) */
-       { "wan_pppoe_keepalive", "0", 0 },      /* Restore link automatically */
-       { "wan_pppoe_demand", "0", 0 },         /* Dial on demand */
-       { "wan_pppoe_mru", "1492", 0 },         /* Negotiate MRU to this value */
-       { "wan_pppoe_mtu", "1492", 0 },         /* Negotiate MTU to the smaller of this value or the peer MRU */
-       { "wan_pppoe_service", "", 0 },         /* PPPoE service name */
-       { "wan_pppoe_ac", "", 0 },              /* PPPoE access concentrator name */
-
-       /* Misc WAN parameters */
-       { "wan_desc", "", 0 },                  /* WAN connection description */
-       { "wan_route", "", 0 },                 /* Static routes (ipaddr:netmask:gateway:metric:ifname ...) */
-       { "wan_primary", "0", 0 },              /* Primary wan connection */
-
-       { "wan_unit", "0", 0 },                 /* Last configured connection */
-       
-       /* Filters */
-       { "filter_maclist", "", 0 },            /* xx:xx:xx:xx:xx:xx ... */
-       { "filter_macmode", "deny", 0 },        /* "allow" only, "deny" only, or "disabled" (allow all) */
-       { "filter_client0", "", 0 },            /* [lan_ipaddr0-lan_ipaddr1|*]:lan_port0-lan_port1,proto,enable,day_start-day_end,sec_start-sec_end,desc */
-
-       /* Port forwards */
-       { "dmz_ipaddr", "", 0 },                /* x.x.x.x (equivalent to 0-60999>dmz_ipaddr:0-60999) */
-       { "forward_port0", "", 0 },             /* wan_port0-wan_port1>lan_ipaddr:lan_port0-lan_port1[:,]proto[:,]enable[:,]desc */
-       { "autofw_port0", "", 0 },              /* out_proto:out_port,in_proto:in_port0-in_port1>to_port0-to_port1,enable,desc */
-
-       /* DHCP server parameters */
-       { "dhcp_start", "192.168.1.100", 0 },   /* First assignable DHCP address */
-       { "dhcp_end", "192.168.1.150", 0 },     /* Last assignable DHCP address */
-       { "dhcp_domain", "wan", 0 },            /* Use WAN domain name first if available (wan|lan) */
-       { "dhcp_wins", "wan", 0 },              /* Use WAN WINS first if available (wan|lan) */
-
-       /* Web server parameters */
-       { "http_username", "", 0 },             /* Username */
-       { "http_passwd", "admin", 0 },          /* Password */
-       { "http_wanport", "", 0 },              /* WAN port to listen on */
-       { "http_lanport", "80", 0 },            /* LAN port to listen on */
-
-       /* Wireless parameters */
-       { "wl_ifname", "", 0 },                 /* Interface name */
-       { "wl_hwaddr", "", 0 },                 /* MAC address */
-       { "wl_phytype", "g", 0 },               /* Current wireless band ("a" (5 GHz), "b" (2.4 GHz), or "g" (2.4 GHz)) */
-       { "wl_corerev", "", 0 },                /* Current core revision */
-       { "wl_phytypes", "", 0 },               /* List of supported wireless bands (e.g. "ga") */
-       { "wl_radioids", "", 0 },               /* List of radio IDs */
-       { "wl_ssid", "OpenWrt", 0 },            /* Service set ID (network name) */
-       { "wl_country", "", 0 },                /* Country (default obtained from driver) */
-       { "wl_radio", "1", 0 },                 /* Enable (1) or disable (0) radio */
-       { "wl_closed", "0", 0 },                /* Closed (hidden) network */
-        { "wl_ap_isolate", "0", 0 },            /* AP isolate mode */
-       { "wl_mode", "ap", 0 },                 /* AP mode (ap|sta|wds) */
-       { "wl_lazywds", "0", 0 },               /* Enable "lazy" WDS mode (0|1) */
-       { "wl_wds", "", 0 },                    /* xx:xx:xx:xx:xx:xx ... */
-       { "wl_wep", "disabled", 0 },            /* WEP data encryption (enabled|disabled) */
-       { "wl_auth", "0", 0 },                  /* Shared key authentication optional (0) or required (1) */
-       { "wl_key", "1", 0 },                   /* Current WEP key */
-       { "wl_key1", "", 0 },                   /* 5/13 char ASCII or 10/26 char hex */
-       { "wl_key2", "", 0 },                   /* 5/13 char ASCII or 10/26 char hex */
-       { "wl_key3", "", 0 },                   /* 5/13 char ASCII or 10/26 char hex */
-       { "wl_key4", "", 0 },                   /* 5/13 char ASCII or 10/26 char hex */
-       { "wl_maclist", "", 0 },                /* xx:xx:xx:xx:xx:xx ... */
-       { "wl_macmode", "disabled", 0 },        /* "allow" only, "deny" only, or "disabled" (allow all) */
-       { "wl_channel", "11", 0 },              /* Channel number */
-       { "wl_rate", "0", 0 },                  /* Rate (bps, 0 for auto) */
-       { "wl_rateset", "default", 0 },         /* "default" or "all" or "12" */
-       { "wl_frag", "2346", 0 },               /* Fragmentation threshold */
-       { "wl_rts", "2347", 0 },                /* RTS threshold */
-       { "wl_dtim", "1", 0 },                  /* DTIM period */
-       { "wl_bcn", "100", 0 },                 /* Beacon interval */
-       { "wl_plcphdr", "long", 0 },            /* 802.11b PLCP preamble type */
-       { "wl_net_mode", "mixed", 0 },          /* 54g mode */
-       { "wl_gmode", "6", 0 },                 /* 54g mode */
-       { "wl_gmode_protection", "auto", 0 },   /* 802.11g RTS/CTS protection (off|auto) */
-       { "wl_afterburner", "auto", 0 },        /* AfterBurner */
-       { "wl_frameburst", "off", 0 },          /* BRCM Frambursting mode (off|on) */
-       { "wl_antdiv", "-1", 0 },               /* Antenna Diversity (-1|0|1|3) */
-       { "wl_infra", "1", 0 },                 /* Network Type (BSS/IBSS) */
-
-       /* WPA parameters */
-       { "security_mode", "open", 0 },
-       { "wl_auth_mode", "open", 0 },          /* Network authentication mode (open|shared|radius|wpa|psk) */
-       { "wl_wpa_psk", "", 0 },                /* WPA pre-shared key */
-       { "wl_wpa_gtk_rekey", "3600", 0 },      /* GTK rotation interval */
-       { "wl_radius_ipaddr", "", 0 },          /* RADIUS server IP address */
-       { "wl_radius_key", "", 0 },             /* RADIUS shared secret */
-       { "wl_radius_port", "1812", 0 },        /* RADIUS server UDP port */
-       { "wl_crypto", "tkip", 0 },             /* WPA data encryption */
-
-
-       { "wl_unit", "0", 0 },                  /* Last configured interface */
-               
-       /* Restore defaults */
-       { "restore_defaults", "0", 0 },         /* Set to 0 to not restore defaults on boot */
-
-       { 0, 0, 0 }
-};
diff --git a/openwrt/package/openwrt/libshared/linux_timer.c b/openwrt/package/openwrt/libshared/linux_timer.c
deleted file mode 100644 (file)
index 0402e44..0000000
+++ /dev/null
@@ -1,738 +0,0 @@
-/*
- * Copyright 2004, Broadcom Corporation
- * All Rights Reserved.
- * 
- * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
- * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
- * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
- *
- * Low resolution timer interface linux specific implementation.
- *
- * $Id$
- */
-
-/*
-* debug facilities
-*/
-#define TIMER_DEBUG    0
-#if TIMER_DEBUG
-#define TIMERDBG(fmt, args...) printf("%s: " fmt "\n" , __FUNCTION__ , ## args)
-#else
-#define TIMERDBG(fmt, args...)
-#endif
-
-
-/*
- * POSIX timer support for Linux. Taken from linux_timer.c in upnp
- */
-
-#define __USE_GNU
-
-
-#include <stdlib.h>        // for malloc, free, etc.
-#include <string.h>        // for memset, strncasecmp, etc.
-#include <assert.h>        // for assert, of course.
-#include <signal.h>        // for sigemptyset, etc.
-#include <stdio.h>         // for printf, etc.
-#include <sys/time.h>
-#include <time.h>
-
-/* define TIMER_PROFILE to enable code which guages how accurate the timer functions are.
-   For each expiring timer the code will print the expected time interval and the actual time interval.
-#define TIMER_PROFILE
-*/
-#undef TIMER_PROFILE
-
-/*
-timer_cancel( ) - cancel a timer
-timer_connect( ) - connect a user routine to the timer signal
-timer_create( ) - allocate a timer using the specified clock for a timing base (POSIX)
-timer_delete( ) - remove a previously created timer (POSIX)
-timer_gettime( ) - get the remaining time before expiration and the reload value (POSIX)
-timer_getoverrun( ) - return the timer expiration overrun (POSIX)
-timer_settime( ) - set the time until the next expiration and arm timer (POSIX)
-nanosleep( ) - suspend the current task until the time interval elapses (POSIX)
-*/
-
-#define MS_PER_SEC 1000
-#define US_PER_SEC 1000000
-#define US_PER_MS  1000
-#define UCLOCKS_PER_SEC 1000000
-
-typedef void (*event_callback_t)(timer_t, int);
-
-#ifndef TIMESPEC_TO_TIMEVAL
-# define TIMESPEC_TO_TIMEVAL(tv, ts) {                                   \
-        (tv)->tv_sec = (ts)->tv_sec;                                    \
-        (tv)->tv_usec = (ts)->tv_nsec / 1000;                           \
-}
-#endif
-
-#ifndef TIMEVAL_TO_TIMESPEC
-# define TIMEVAL_TO_TIMESPEC(tv, ts) {                                   \
-        (ts)->tv_sec = (tv)->tv_sec;                                    \
-        (ts)->tv_nsec = (tv)->tv_usec * 1000;                           \
-}
-#endif
-
-#define ROUNDUP(x,y) ((((x)+(y)-1)/(y))*(y))
-
-#define timerroundup(t,g) \
-    do { \
-       if (!timerisset(t)) (t)->tv_usec=1; \
-       if ((t)->tv_sec == 0) (t)->tv_usec=ROUNDUP((t)->tv_usec, g); \
-    } while (0)
-
-typedef long uclock_t;
-
-#define TFLAG_NONE     0
-#define TFLAG_CANCELLED        (1<<0)
-#define TFLAG_DELETED  (1<<1)
-
-struct event {
-    struct timeval it_interval;
-    struct timeval it_value;
-    event_callback_t func;
-    int arg;
-    unsigned short flags;
-    struct event *next;
-#ifdef TIMER_PROFILE
-    uint expected_ms;
-    uclock_t start;
-#endif
-};
-
-void timer_cancel(timer_t timerid);
-
-static void alarm_handler(int i);
-static void check_event_queue();
-static void print_event_queue();
-static void check_timer();
-#if THIS_FINDS_USE
-static int count_queue(struct event *);
-#endif
-static int timer_change_settime(timer_t timer_id, const struct itimerspec *timer_spec);
-void block_timer();
-void unblock_timer();
-
-static struct event *event_queue = NULL;
-static struct event *event_freelist;
-static uint g_granularity;
-static int g_maxevents = 0;
-
-uclock_t uclock()
-{
-    struct timeval tv;
-
-    gettimeofday(&tv, NULL);
-    return ((tv.tv_sec * US_PER_SEC) + tv.tv_usec);
-}
-
-
-void init_event_queue(int n)
-{
-    int i;
-    struct itimerval tv;
-    
-    g_maxevents = n;
-    event_freelist = (struct event *) malloc(n * sizeof(struct event));
-    memset(event_freelist, 0, n * sizeof(struct event));
-
-    for (i = 0; i < (n-1); i++) 
-       event_freelist[i].next = &event_freelist[i+1];
-
-    event_freelist[i].next = NULL;
-
-    tv.it_interval.tv_sec = 0;
-    tv.it_interval.tv_usec = 1;
-    tv.it_value.tv_sec = 0;
-    tv.it_value.tv_usec = 0;
-    setitimer (ITIMER_REAL, &tv, 0);
-    setitimer (ITIMER_REAL, 0, &tv);
-    g_granularity = tv.it_interval.tv_usec;
-
-    signal(SIGALRM, alarm_handler);
-}
-
-
-int clock_gettime(
-    clockid_t         clock_id, /* clock ID (always CLOCK_REALTIME) */
-    struct timespec * tp        /* where to store current time */
-)
-{
-    struct timeval tv;
-    int n;
-
-
-    n = gettimeofday(&tv, NULL);
-    TIMEVAL_TO_TIMESPEC(&tv, tp);
-    
-    return n;
-}
-
-
-int timer_create(
-    clockid_t         clock_id, /* clock ID (always CLOCK_REALTIME) */
-    struct sigevent * evp,      /* user event handler */
-    timer_t *         pTimer    /* ptr to return value */
-)
-{
-    struct event *event;
-
-    if (clock_id != CLOCK_REALTIME) {
-       TIMERDBG("timer_create can only support clock id CLOCK_REALTIME");
-       exit(1);
-    }
-
-    if (evp != NULL) {
-       if (evp->sigev_notify != SIGEV_SIGNAL || evp->sigev_signo != SIGALRM) {
-           TIMERDBG("timer_create can only support signalled alarms using SIGALRM");
-           exit(1);
-       }
-    }
-
-    event = event_freelist;
-    if (event == NULL) {
-       print_event_queue();
-    }
-    assert(event != NULL);
-
-    event->flags = TFLAG_NONE;
-    
-    event_freelist = event->next;
-    event->next = NULL;
-
-    check_event_queue();
-
-    *pTimer = (timer_t) event;
-
-    return 0;
-}
-
-int timer_delete(
-    timer_t timerid /* timer ID */
-)
-{
-    struct event *event = (struct event *) timerid;
-    
-    if (event->flags & TFLAG_DELETED) {
-       TIMERDBG("Cannot delete a deleted event");
-       return 1;
-    }
-
-    timer_cancel(timerid);
-    
-    event->flags |= TFLAG_DELETED;
-
-    event->next = event_freelist;
-    event_freelist = event;
-
-    return 0;
-}
-
-int timer_connect
-(
-    timer_t     timerid, /* timer ID */
-    void (*routine)(timer_t, int), /* user routine */
-    int         arg      /* user argument */
-)
-{
-    struct event *event = (struct event *) timerid;
-
-    assert(routine != NULL);
-    event->func = routine;
-    event->arg = arg;
-    
-    return 0;
-}    
-
-/* 
- * Please Call this function only from the call back functions of the alarm_handler.
- * This is just a hack 
-*/
-int timer_change_settime
-(
-    timer_t                   timerid, /* timer ID */
-    const struct itimerspec * value   /* time to be set */
-)
-{
-    struct event *event = (struct event *) timerid;
-
-    TIMESPEC_TO_TIMEVAL(&event->it_interval, &value->it_interval);
-    TIMESPEC_TO_TIMEVAL(&event->it_value, &value->it_value);
-
-    return 1;  
-}
-
-int timer_settime
-(
-    timer_t                   timerid, /* timer ID */
-    int                       flags,   /* absolute or relative */
-    const struct itimerspec * value,   /* time to be set */
-    struct itimerspec *       ovalue   /* previous time set (NULL=no result) */
-)
-{
-    struct itimerval itimer;
-    struct event *event = (struct event *) timerid;
-    struct event **ppevent;
-
-    TIMESPEC_TO_TIMEVAL(&event->it_interval, &value->it_interval);
-    TIMESPEC_TO_TIMEVAL(&event->it_value, &value->it_value);
-
-    /* if .it_value is zero, the timer is disarmed */
-    if (!timerisset(&event->it_value)) {
-       timer_cancel(timerid);
-       return 0;
-    }
-
-    block_timer();
-
-#ifdef TIMER_PROFILE
-    event->expected_ms = (event->it_value.tv_sec * MS_PER_SEC) + (event->it_value.tv_usec / US_PER_MS);
-    event->start = uclock();
-#endif
-    if (event->next) {
-       TIMERDBG("calling timer_settime with a timer that is already on the queue.");
-    }
-
-
-    /* We always want to make sure that the event at the head of the
-       queue has a timeout greater than the itimer granularity.
-       Otherwise we end up with the situation that the time remaining
-       on an itimer is greater than the time at the head of the queue
-       in the first place. */
-    timerroundup(&event->it_value, g_granularity);
-
-    timerclear(&itimer.it_value);
-    getitimer(ITIMER_REAL, &itimer);
-    if (timerisset(&itimer.it_value)) {
-       // reset the top timer to have an interval equal to the remaining interval 
-       // when the timer was cancelled.
-       if (event_queue) {
-           if (timercmp(&(itimer.it_value), &(event_queue->it_value), >)) {
-               // it is an error if the amount of time remaining is more than the amount of time 
-               // requested by the top event.
-               //
-               TIMERDBG("timer_settime: TIMER ERROR!");
-
-           } else {
-               // some portion of the top event has already expired.
-               // Reset the interval of the top event to remaining
-               // time left in that interval.
-               //
-               event_queue->it_value = itimer.it_value;
-
-               // if we were the earliest timer before now, we are still the earliest timer now.
-               // we do not need to reorder the list.
-           }
-       }
-    }
-
-    // Now, march down the list, decrementing the new timer by the
-    // current it_value of each event on the queue.
-    ppevent = &event_queue;
-    while (*ppevent) {
-       if ( timercmp(&(event->it_value), &((*ppevent)->it_value), <) ) {
-           // if the proposed event will trigger sooner than the next event
-           // in the queue, we will insert the new event just before the next one.
-           //
-           // we also need to adjust the delta value to the next event.
-           timersub(&((*ppevent)->it_value), &(event->it_value), &((*ppevent)->it_value));
-           break;
-       }
-       // subtract the interval of the next event from the proposed interval.
-       timersub(&(event->it_value), &((*ppevent)->it_value), &(event->it_value));
-
-       ppevent = &((*ppevent)->next);
-    }
-    
-    // we have found our proper place in the queue, 
-    // link our new event into the pending event queue.
-    event->next = *ppevent;
-    *ppevent = event;
-
-    check_event_queue();
-
-    // if our new event ended up at the front of the queue, reissue the timer.
-    if (event == event_queue) {
-       timerroundup(&event_queue->it_value, g_granularity);
-       timerclear(&itimer.it_interval);
-       itimer.it_value = event_queue->it_value;
-       
-       // we want to be sure to never turn off the timer completely, 
-       // so if the next interval is zero, set it to some small value.
-       if (!timerisset(&(itimer.it_value)))
-           itimer.it_value = (struct timeval) { 0, 1 };
-       
-       assert(!timerisset(&itimer.it_interval));
-       assert(itimer.it_value.tv_sec > 0 || itimer.it_value.tv_usec >= g_granularity);
-       assert(event_queue->it_value.tv_sec > 0 || event_queue->it_value.tv_usec >= g_granularity);
-       setitimer(ITIMER_REAL, &itimer, NULL);
-       check_timer();
-    }
-
-    event->flags &= ~TFLAG_CANCELLED;
-    
-    unblock_timer();
-
-    return 0;
-}
-
-static void check_timer()
-{
-    struct itimerval itimer;
-    
-    getitimer(ITIMER_REAL, &itimer);
-    if (timerisset(&itimer.it_interval)) {
-       TIMERDBG("ERROR timer interval is set.");
-    }
-    if (timercmp(&(itimer.it_value), &(event_queue->it_value), >)) {
-       TIMERDBG("ERROR timer expires later than top event.");
-    }
-}
-
-
-static void check_event_queue()
-{
-    struct timeval sum;
-    struct event *event;
-    int i = 0;
-
-#ifdef notdef
-    int nfree = 0;
-    struct event *p;
-    for (p = event_freelist; p; p = p->next)
-       nfree++;
-    printf("%d free events\n", nfree);
-#endif
-    
-    timerclear(&sum);
-    for (event = event_queue; event; event = event->next) {
-       if (i > g_maxevents) {
-           TIMERDBG("timer queue looks like it loops back on itself!");
-           print_event_queue();
-           exit(1);
-       }
-       i++;
-    }
-}
-
-#if THIS_FINDS_USE
-/* The original upnp version has this unused function, so I left it in
-   to maintain the resemblance. */
-static int count_queue(struct event *event_queue)
-{
-    struct event *event;
-    int i = 0;
-    for (event = event_queue; event; event = event->next) 
-       i++;
-    return i;
-}
-#endif
-
-static void print_event_queue()
-{
-    struct event *event;
-    int i = 0;
-
-    for (event = event_queue; event; event = event->next) {
-       printf("#%d (0x%x)->0x%x: \t%d sec %d usec\t%p\n", 
-              i++, (unsigned int) event, (unsigned int) event->next, (int) event->it_value.tv_sec, (int) event->it_value.tv_usec, event->func);
-       if (i > g_maxevents) {
-           printf("...(giving up)\n");
-           break;
-       }
-    }
-}
-
-// The top element of the event queue must have expired.
-// Remove that element, run its function, and reset the timer.
-// if there is no interval, recycle the event structure.
-static void alarm_handler(int i)
-{
-    struct event *event, **ppevent;
-    struct itimerval itimer;
-    struct timeval small_interval = { 0, g_granularity/2 };
-#ifdef TIMER_PROFILE
-    uint junk;
-    uclock_t end;
-    uint actual;
-#endif
-
-    block_timer();
-
-    // Loop through the event queue and remove the first event plus any 
-    // subsequent events that will expire very soon thereafter (within 'small_interval'}.
-    //
-    do {
-       // remove the top event.
-       event = event_queue;
-       event_queue = event_queue->next;
-       event->next = NULL;
-
-#ifdef TIMER_PROFILE
-       end = uclock();
-       actual = ((end-event->start)/((uclock_t)UCLOCKS_PER_SEC/1000));
-       if (actual < 0)
-           junk = end;
-       TIMERDBG("expected %d ms  actual %d ms", event->expected_ms, ((end-event->start)/((uclock_t)UCLOCKS_PER_SEC/1000)));
-#endif
-       
-           // call the event callback function
-           (*(event->func))((timer_t) event, (int)event->arg);
-
-       /* If the event has been cancelled, do NOT put it back on the queue. */
-       if ( !(event->flags & TFLAG_CANCELLED) ) {
-
-           // if the event is a recurring event, reset the timer and
-           // find its correct place in the sorted list of events.
-           //
-           if (timerisset(&event->it_interval)) {
-               // event is recurring...
-               //
-               event->it_value = event->it_interval;
-#ifdef TIMER_PROFILE
-               event->expected_ms = (event->it_value.tv_sec * MS_PER_SEC) + (event->it_value.tv_usec / US_PER_MS);
-               event->start = uclock();
-#endif
-               timerroundup(&event->it_value, g_granularity);
-
-               // Now, march down the list, decrementing the new timer by the
-               // current delta of each event on the queue.
-               ppevent = &event_queue;
-               while (*ppevent) {
-                   if ( timercmp(&(event->it_value), &((*ppevent)->it_value), <) ) {
-                       // if the proposed event will trigger sooner than the next event
-                       // in the queue, we will insert the new event just before the next one.
-                       //
-                       // we also need to adjust the delta value to the next event.
-                       timersub(&((*ppevent)->it_value), &(event->it_value), &((*ppevent)->it_value));
-                       break;
-                   }
-                   timersub(&(event->it_value), &((*ppevent)->it_value), &(event->it_value));
-                   ppevent = &((*ppevent)->next);
-               }
-
-               // we have found our proper place in the queue, 
-               // link our new event into the pending event queue.
-               event->next = *ppevent;
-               *ppevent = event;
-           } else {
-               // there is no interval, so recycle the event structure.
-               //timer_delete((timer_t) event);
-           }
-       }
-
-       check_event_queue();
-       
-    } while (event_queue && timercmp(&event_queue->it_value, &small_interval, <));
-    
-    // re-issue the timer...
-    if (event_queue) {
-       timerroundup(&event_queue->it_value, g_granularity);
-
-       timerclear(&itimer.it_interval);
-       itimer.it_value = event_queue->it_value;
-       // we want to be sure to never turn off the timer completely, 
-       // so if the next interval is zero, set it to some small value.
-       if (!timerisset(&(itimer.it_value)))
-           itimer.it_value = (struct timeval) { 0, 1 };
-
-       setitimer(ITIMER_REAL, &itimer, NULL);
-       check_timer();
-    } else {
-       TIMERDBG("There are no events in the queue - timer not reset.");
-    }
-
-    unblock_timer();
-}
-
-static int block_count = 0;
-
-void block_timer()
-{
-    sigset_t set;
-
-    if (block_count++ == 0) {
-       sigemptyset(&set);
-       sigaddset(&set, SIGALRM);
-       sigprocmask(SIG_BLOCK, &set, NULL);
-    }
-}
-
-void unblock_timer()
-{
-    sigset_t set;
-
-    if (--block_count == 0) {
-       sigemptyset(&set);
-       sigaddset(&set, SIGALRM);
-       sigprocmask(SIG_UNBLOCK, &set, NULL);
-    }
-}
-
-void timer_cancel_all()
-{
-    struct itimerval timeroff = { { 0, 0 }, { 0, 0} };
-    struct event *event;
-    struct event **ppevent;
-
-    setitimer(ITIMER_REAL, &timeroff, NULL);
-
-    ppevent = &event_queue;
-    while (*ppevent) {
-       event = *ppevent;
-       *ppevent = event->next;
-       event->next = NULL;
-    }
-}
-
-
-
-void timer_cancel(timer_t timerid)
-{
-    struct itimerval itimer;
-    struct itimerval timeroff = { { 0, 0 }, { 0, 0} };
-    struct event *event = (struct event *) timerid;
-    struct event **ppevent;
-
-    if (event->flags & TFLAG_CANCELLED) {
-       TIMERDBG("Cannot cancel a cancelled event");
-       return;
-    }
-
-    block_timer();
-    
-    ppevent = &event_queue;
-    while (*ppevent) {
-       if ( *ppevent == event ) {
-
-           /* RACE CONDITION - if the alarm goes off while we are in
-              this loop, and if the timer we want to cancel is the
-              next to expire, the alarm will end up firing
-              after this routine is complete, causing it to go off early. */
-
-           /* If the cancelled timer is the next to expire, 
-              we need to do something special to clean up correctly. */
-           if (event == event_queue && event->next != NULL) {
-               timerclear(&itimer.it_value);
-               getitimer(ITIMER_REAL, &itimer);
-               
-               /* subtract the time that has already passed while waiting for this timer... */
-               timersub(&(event->it_value), &(itimer.it_value), &(event->it_value));
-
-               /* and add any remainder to the next timer in the list */
-               timeradd(&(event->next->it_value), &(event->it_value), &(event->next->it_value));
-           }
-
-           *ppevent = event->next;
-           event->next = NULL;
-
-           if (event_queue) {
-               timerroundup(&event_queue->it_value, g_granularity);
-               timerclear(&itimer.it_interval);
-               itimer.it_value = event_queue->it_value;
-               
-               /* We want to be sure to never turn off the timer
-                  completely if there are more events on the queue,
-                  so if the next interval is zero, set it to some
-                  small value.  */
-
-               if (!timerisset(&(itimer.it_value)))
-                   itimer.it_value = (struct timeval) { 0, 1 };
-               
-               assert(itimer.it_value.tv_sec > 0 || itimer.it_value.tv_usec >= g_granularity);
-               assert(event_queue->it_value.tv_sec > 0 || event_queue->it_value.tv_usec >= g_granularity);
-               setitimer(ITIMER_REAL, &itimer, NULL);
-               check_timer();
-           } else {
-               setitimer(ITIMER_REAL, &timeroff, NULL);
-           }
-           break;
-       }
-       ppevent = &((*ppevent)->next);
-    }
-
-    event->flags |= TFLAG_CANCELLED;
-
-    unblock_timer();
-}
-
-/*
-* timer related headers
-*/
-#include "bcmtimer.h"
-
-/*
-* locally used global variables and constants
-*/
-
-/*
-* Initialize internal resources used in the timer module. It must be called
-* before any other timer function calls. The param 'timer_entries' is used
-* to pre-allocate fixed number of timer entries.
-*/
-int bcm_timer_module_init(int timer_entries, bcm_timer_module_id *module_id)
-{
-       init_event_queue(timer_entries);
-       *module_id = (bcm_timer_module_id)event_freelist;
-       return 0;
-}
-
-/*
-* Cleanup internal resources used by this timer module. It deletes all
-* pending timer entries from the backend timer system as well.
-*/
-int bcm_timer_module_cleanup(bcm_timer_module_id module_id)
-{
-       module_id = 0;
-       return 0;
-}
-
-/* Enable/Disable timer module */
-int bcm_timer_module_enable(bcm_timer_module_id module_id, int enable)
-{
-       if (enable)
-               unblock_timer();
-       else
-               block_timer();
-       return 0;
-}
-
-int bcm_timer_create(bcm_timer_module_id module_id, bcm_timer_id *timer_id)
-{
-       module_id = 0;
-       return timer_create(CLOCK_REALTIME, NULL, (timer_t *)timer_id);
-}
-
-int bcm_timer_delete(bcm_timer_id timer_id)
-{
-       return timer_delete((timer_t)timer_id);
-}
-
-int bcm_timer_gettime(bcm_timer_id timer_id, struct itimerspec *timer_spec)
-{
-       return -1;
-}
-
-int bcm_timer_settime(bcm_timer_id timer_id, const struct itimerspec *timer_spec)
-{
-       return timer_settime((timer_t)timer_id, 0, timer_spec, NULL);
-}
-
-int bcm_timer_connect(bcm_timer_id timer_id, bcm_timer_cb func, int data)
-{
-       return timer_connect((timer_t)timer_id, (void *)func, data);
-}
-
-int bcm_timer_cancel(bcm_timer_id timer_id)
-{
-       timer_cancel((timer_t)timer_id);
-       return 0;
-}
-int bcm_timer_change_expirytime(bcm_timer_id timer_id, const struct itimerspec *timer_spec)
-{
-       timer_change_settime((timer_t)timer_id, timer_spec);
-       return 1;
-}
diff --git a/openwrt/package/openwrt/libshared/shutils.c b/openwrt/package/openwrt/libshared/shutils.c
deleted file mode 100644 (file)
index 49ad41a..0000000
+++ /dev/null
@@ -1,329 +0,0 @@
-/*
- * Shell-like utility functions
- *
- * Copyright 2004, Broadcom Corporation
- * All Rights Reserved.
- * 
- * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
- * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
- * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
- *
- * $Id$
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <errno.h>
-#include <error.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <unistd.h>
-#include <signal.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <termios.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
-#include <net/ethernet.h>
-
-#include <shutils.h>
-
-/*
- * Reads file and returns contents
- * @param      fd      file descriptor
- * @return     contents of file or NULL if an error occurred
- */
-char *
-fd2str(int fd)
-{
-       char *buf = NULL;
-       size_t count = 0, n;
-
-       do {
-               buf = realloc(buf, count + 512);
-               n = read(fd, buf + count, 512);
-               if (n < 0) {
-                       free(buf);
-                       buf = NULL;
-               }
-               count += n;
-       } while (n == 512);
-
-       close(fd);
-       if (buf)
-               buf[count] = '\0';
-       return buf;
-}
-
-/*
- * Reads file and returns contents
- * @param      path    path to file
- * @return     contents of file or NULL if an error occurred
- */
-char *
-file2str(const char *path)
-{
-       int fd;
-
-       if ((fd = open(path, O_RDONLY)) == -1) {
-               perror(path);
-               return NULL;
-       }
-
-       return fd2str(fd);
-}
-
-/* 
- * Waits for a file descriptor to change status or unblocked signal
- * @param      fd      file descriptor
- * @param      timeout seconds to wait before timing out or 0 for no timeout
- * @return     1 if descriptor changed status or 0 if timed out or -1 on error
- */
-int
-waitfor(int fd, int timeout)
-{
-       fd_set rfds;
-       struct timeval tv = { timeout, 0 };
-
-       FD_ZERO(&rfds);
-       FD_SET(fd, &rfds);
-       return select(fd + 1, &rfds, NULL, NULL, (timeout > 0) ? &tv : NULL);
-}
-
-/* 
- * Concatenates NULL-terminated list of arguments into a single
- * commmand and executes it
- * @param      argv    argument list
- * @param      path    NULL, ">output", or ">>output"
- * @param      timeout seconds to wait before timing out or 0 for no timeout
- * @param      ppid    NULL to wait for child termination or pointer to pid
- * @return     return value of executed command or errno
- */
-int
-_eval(char *const argv[], char *path, int timeout, int *ppid)
-{
-       pid_t pid;
-       int status;
-       int fd;
-       int flags;
-       int sig;
-       char buf[254]="";
-       int i;
-
-       switch (pid = fork()) {
-       case -1:        /* error */
-               perror("fork");
-               return errno;
-       case 0:         /* child */
-               /* Reset signal handlers set for parent process */
-               for (sig = 0; sig < (_NSIG-1); sig++)
-                       signal(sig, SIG_DFL);
-
-               /* Clean up */
-               ioctl(0, TIOCNOTTY, 0);
-               close(STDIN_FILENO);
-               close(STDOUT_FILENO);
-               close(STDERR_FILENO);
-               setsid();
-
-               /* We want to check the board if exist UART? , add by honor 2003-12-04 */
-               if ((fd = open("/dev/console", O_RDWR)) < 0) {
-                        (void) open("/dev/null", O_RDONLY);
-                        (void) open("/dev/null", O_WRONLY);
-                        (void) open("/dev/null", O_WRONLY);
-               }
-               else{
-                       close(fd);
-                        (void) open("/dev/console", O_RDONLY);
-                        (void) open("/dev/console", O_WRONLY);
-                        (void) open("/dev/console", O_WRONLY);
-               }
-
-               /* Redirect stdout to <path> */
-               if (path) {
-                       flags = O_WRONLY | O_CREAT;
-                       if (!strncmp(path, ">>", 2)) {
-                               /* append to <path> */
-                               flags |= O_APPEND;
-                               path += 2;
-                       } else if (!strncmp(path, ">", 1)) {
-                               /* overwrite <path> */
-                               flags |= O_TRUNC;
-                               path += 1;
-                       }
-                       if ((fd = open(path, flags, 0644)) < 0)
-                               perror(path);
-                       else {
-                               dup2(fd, STDOUT_FILENO);
-                               close(fd);
-                       }
-               }
-
-               /* execute command */
-               for(i=0 ; argv[i] ; i++)
-                       snprintf(buf+strlen(buf), sizeof(buf), "%s ", argv[i]);
-               dprintf("cmd=[%s]\n", buf);
-               setenv("PATH", "/sbin:/bin:/usr/sbin:/usr/bin", 1);
-               alarm(timeout);
-               execvp(argv[0], argv);
-               perror(argv[0]);
-               exit(errno);
-       default:        /* parent */
-               if (ppid) {
-                       *ppid = pid;
-                       return 0;
-               } else {
-                       waitpid(pid, &status, 0);
-                       if (WIFEXITED(status))
-                               return WEXITSTATUS(status);
-                       else
-                               return status;
-               }
-       }
-}
-
-/* 
- * Concatenates NULL-terminated list of arguments into a single
- * commmand and executes it
- * @param      argv    argument list
- * @return     stdout of executed command or NULL if an error occurred
- */
-char *
-_backtick(char *const argv[])
-{
-       int filedes[2];
-       pid_t pid;
-       int status;
-       char *buf = NULL;
-
-       /* create pipe */
-       if (pipe(filedes) == -1) {
-               perror(argv[0]);
-               return NULL;
-       }
-
-       switch (pid = fork()) {
-       case -1:        /* error */
-               return NULL;
-       case 0:         /* child */
-               close(filedes[0]);      /* close read end of pipe */
-               dup2(filedes[1], 1);    /* redirect stdout to write end of pipe */
-               close(filedes[1]);      /* close write end of pipe */
-               execvp(argv[0], argv);
-               exit(errno);
-               break;
-       default:        /* parent */
-               close(filedes[1]);      /* close write end of pipe */
-               buf = fd2str(filedes[0]);
-               waitpid(pid, &status, 0);
-               break;
-       }
-       
-       return buf;
-}
-
-/* 
- * Kills process whose PID is stored in plaintext in pidfile
- * @param      pidfile PID file
- * @return     0 on success and errno on failure
- */
-int
-kill_pidfile(char *pidfile)
-{
-       FILE *fp = fopen(pidfile, "r");
-       char buf[256];
-
-       if (fp && fgets(buf, sizeof(buf), fp)) {
-               pid_t pid = strtoul(buf, NULL, 0);
-               fclose(fp);
-               return kill(pid, SIGTERM);
-       } else
-               return errno;
-}
-
-/*
- * fread() with automatic retry on syscall interrupt
- * @param      ptr     location to store to
- * @param      size    size of each element of data
- * @param      nmemb   number of elements
- * @param      stream  file stream
- * @return     number of items successfully read
- */
-int
-safe_fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
-{
-       size_t ret = 0;
-
-       do {
-               clearerr(stream);
-               ret += fread((char *)ptr + (ret * size), size, nmemb - ret, stream);
-       } while (ret < nmemb && ferror(stream) && errno == EINTR);
-
-       return ret;
-}
-
-/*
- * fwrite() with automatic retry on syscall interrupt
- * @param      ptr     location to read from
- * @param      size    size of each element of data
- * @param      nmemb   number of elements
- * @param      stream  file stream
- * @return     number of items successfully written
- */
-int
-safe_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
-{
-       size_t ret = 0;
-
-       do {
-               clearerr(stream);
-               ret += fwrite((char *)ptr + (ret * size), size, nmemb - ret, stream);
-       } while (ret < nmemb && ferror(stream) && errno == EINTR);
-
-       return ret;
-}
-
-/*
- * Convert Ethernet address string representation to binary data
- * @param      a       string in xx:xx:xx:xx:xx:xx notation
- * @param      e       binary data
- * @return     TRUE if conversion was successful and FALSE otherwise
- */
-int
-ether_atoe(const char *a, unsigned char *e)
-{
-       char *c = (char *) a;
-       int i = 0;
-
-       memset(e, 0, ETHER_ADDR_LEN);
-       for (;;) {
-               e[i++] = (unsigned char) strtoul(c, &c, 16);
-               if (!*c++ || i == ETHER_ADDR_LEN)
-                       break;
-       }
-       return (i == ETHER_ADDR_LEN);
-}
-
-/*
- * Convert Ethernet address binary data to string representation
- * @param      e       binary data
- * @param      a       string in xx:xx:xx:xx:xx:xx notation
- * @return     a
- */
-char *
-ether_etoa(const unsigned char *e, char *a)
-{
-       char *c = a;
-       int i;
-
-       for (i = 0; i < ETHER_ADDR_LEN; i++) {
-               if (i)
-                       *c++ = ':';
-               c += sprintf(c, "%02X", e[i] & 0xff);
-       }
-       return a;
-}
diff --git a/openwrt/package/openwrt/libshared/wl.c b/openwrt/package/openwrt/libshared/wl.c
deleted file mode 100644 (file)
index f09317a..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Wireless network adapter utilities
- *
- * Copyright 2004, Broadcom Corporation
- * All Rights Reserved.
- * 
- * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
- * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
- * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
- *
- * $Id$
- */
-#include <string.h>
-
-#include <typedefs.h>
-#include <wlutils.h>
-
-int
-wl_probe(char *name)
-{
-       int ret, val;
-
-       /* Check interface */
-       if ((ret = wl_ioctl(name, WLC_GET_MAGIC, &val, sizeof(val))))
-               return ret;
-       if (val != WLC_IOCTL_MAGIC)
-               return -1;
-       if ((ret = wl_ioctl(name, WLC_GET_VERSION, &val, sizeof(val))))
-               return ret;
-       if (val > WLC_IOCTL_VERSION)
-               return -1;
-
-       return ret;
-}
-
-int
-wl_set_val(char *name, char *var, void *val, int len)
-{
-       char buf[128];
-       int buf_len;
-
-       /* check for overflow */
-       if ((buf_len = strlen(var)) + 1 + len > sizeof(buf))
-               return -1;
-       
-       strcpy(buf, var);
-       buf_len += 1;
-
-       /* append int value onto the end of the name string */
-       memcpy(&buf[buf_len], val, len);
-       buf_len += len;
-
-       return wl_ioctl(name, WLC_SET_VAR, buf, buf_len);
-}
-
-int
-wl_get_val(char *name, char *var, void *val, int len)
-{
-       char buf[128];
-       int ret;
-
-       /* check for overflow */
-       if (strlen(var) + 1 > sizeof(buf) || len > sizeof(buf))
-               return -1;
-       
-       strcpy(buf, var);
-       if ((ret = wl_ioctl(name, WLC_GET_VAR, buf, sizeof(buf))))
-               return ret;
-
-       memcpy(val, buf, len);
-       return 0;
-}
-
-int
-wl_set_int(char *name, char *var, int val)
-{
-       return wl_set_val(name, var, &val, sizeof(val));
-}
-
-int
-wl_get_int(char *name, char *var, int *val)
-{
-       return wl_get_val(name, var, val, sizeof(*val));
-}
-
diff --git a/openwrt/package/openwrt/libshared/wl_linux.c b/openwrt/package/openwrt/libshared/wl_linux.c
deleted file mode 100644 (file)
index 126a40b..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Wireless network adapter utilities (linux-specific)
- *
- * Copyright 2004, Broadcom Corporation
- * All Rights Reserved.
- * 
- * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
- * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
- * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
- *
- * $Id$
- */
-
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-
-#include <typedefs.h>
-#include <wlioctl.h>
-#include <wlutils.h>
-
-int
-wl_ioctl(char *name, int cmd, void *buf, int len)
-{
-       struct ifreq ifr;
-       wl_ioctl_t ioc;
-       int ret = 0;
-       int s;
-
-       /* open socket to kernel */
-       if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
-               perror("socket");
-               return errno;
-       }
-
-       /* do it */
-       ioc.cmd = cmd;
-       ioc.buf = buf;
-       ioc.len = len;
-       strncpy(ifr.ifr_name, name, IFNAMSIZ);
-       ifr.ifr_data = (caddr_t) &ioc;
-       if ((ret = ioctl(s, SIOCDEVPRIVATE, &ifr)) < 0)
-               if (cmd != WLC_GET_MAGIC)
-                       perror(ifr.ifr_name);
-
-       /* cleanup */
-       close(s);
-       return ret;
-}
-
-int
-wl_hwaddr(char *name, unsigned char *hwaddr)
-{
-       struct ifreq ifr;
-       int ret = 0;
-       int s;
-
-       /* open socket to kernel */
-       if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
-               perror("socket");
-               return errno;
-       }
-
-       /* do it */
-       strncpy(ifr.ifr_name, name, IFNAMSIZ);
-       if ((ret = ioctl(s, SIOCGIFHWADDR, &ifr)) == 0)
-               memcpy(hwaddr, ifr.ifr_hwaddr.sa_data, ETHER_ADDR_LEN);
-
-       /* cleanup */
-       close(s);
-       return ret;
-}      
-
diff --git a/openwrt/package/openwrt/mtd.c b/openwrt/package/openwrt/mtd.c
deleted file mode 100644 (file)
index f0c127b..0000000
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- * mtd - simple memory technology device manipulation tool
- *
- * Copyright (C) 2005 Waldemar Brodkorb <wbx@dass-it.de>,
- *                   Felix Fietkau <nbd@vd-s.ath.cx>
- *
- * 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, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * $Id$
- *
- * code is based on linux-mtd example code
- */
-
-#include <limits.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <error.h>
-#include <time.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/mount.h>
-#include <sys/stat.h>
-#include <sys/reboot.h>
-#include <string.h>
-
-#include <linux/mtd/mtd.h>
-
-/* trx header */
-#define TRX_MAGIC       0x30524448      /* "HDR0" */
-#define TRX_VERSION     1
-#define TRX_MAX_LEN     0x3A0000
-#define TRX_NO_HEADER   1               /* Do not write TRX header */
-
-#define MAX_ARGS 8
-
-struct trx_header {
-       uint32_t magic;                 /* "HDR0" */
-       uint32_t len;                   /* Length of file including header */
-       uint32_t crc32;                 /* 32-bit CRC from flag_version to end of file */
-       uint32_t flag_version;  /* 0:15 flags, 16:31 version */
-       uint32_t offsets[3];    /* Offsets of partitions from start of header */
-};
-
-#define BUFSIZE (10 * 1024)
-
-
-int
-mtd_unlock(const char *mtd)
-{
-       int fd;
-       struct mtd_info_user mtdInfo;
-       struct erase_info_user mtdLockInfo;
-
-       fd = mtd_open(mtd, O_RDWR);
-       if(fd < 0) {
-               fprintf(stderr, "Could not open mtd device: %s\n", mtd);
-               exit(1);
-       }
-
-       if(ioctl(fd, MEMGETINFO, &mtdInfo)) {
-               fprintf(stderr, "Could not get MTD device info from %s\n", mtd);
-               close(fd);
-               exit(1);
-       }
-
-       printf("Unlocking %s ...\n", mtd);
-       mtdLockInfo.start = 0;
-       mtdLockInfo.length = mtdInfo.size;
-       if(ioctl(fd, MEMUNLOCK, &mtdLockInfo)) {
-               fprintf(stderr, "Could not unlock MTD device: %s\n", mtd);
-               close(fd);
-               return 0;
-       }
-               
-       close(fd);
-       return 0;
-}
-
-int
-mtd_open(const char *mtd, int flags)
-{
-       FILE *fp;
-       char dev[PATH_MAX];
-       int i;
-
-       if ((fp = fopen("/proc/mtd", "r"))) {
-               while (fgets(dev, sizeof(dev), fp)) {
-                       if (sscanf(dev, "mtd%d:", &i) && strstr(dev, mtd)) {
-                               snprintf(dev, sizeof(dev), "/dev/mtd/%d", i);
-                               fclose(fp);
-                               return open(dev, flags);
-                       }
-               }
-               fclose(fp);
-       }
-
-       return open(mtd, flags);
-}
-
-int
-mtd_erase(const char *mtd)
-{
-       int fd;
-       struct mtd_info_user mtdInfo;
-       struct erase_info_user mtdEraseInfo;
-
-       fd = mtd_open(mtd, O_RDWR);
-       if(fd < 0) {
-               fprintf(stderr, "Could not open mtd device: %s\n", mtd);
-               exit(1);
-       }
-
-       if(ioctl(fd, MEMGETINFO, &mtdInfo)) {
-               fprintf(stderr, "Could not get MTD device info from %s\n", mtd);
-               close(fd);
-               exit(1);
-       }
-
-       printf("Erasing %s ...\n", mtd);
-       mtdEraseInfo.length = mtdInfo.erasesize;
-
-       for (mtdEraseInfo.start = 0;
-                mtdEraseInfo.start < mtdInfo.size;
-                mtdEraseInfo.start += mtdInfo.erasesize) {
-               
-               ioctl(fd, MEMUNLOCK, &mtdEraseInfo);
-               if(ioctl(fd, MEMERASE, &mtdEraseInfo)) {
-                       fprintf(stderr, "Could not erase MTD device: %s\n", mtd);
-                       close(fd);
-                       exit(1);
-               }
-       }               
-
-       close(fd);
-       return 0;
-
-}
-
-int
-mtd_write(const char *trxfile, const char *mtd)
-{
-       int fd;
-       int trxfd;
-       int i;
-       size_t result,size,written;
-       struct mtd_info_user mtdInfo;
-       struct erase_info_user mtdEraseInfo;
-       struct stat trxstat;
-       unsigned char src[BUFSIZE],dest[BUFSIZE];
-
-       fd = mtd_open(mtd, O_RDWR);
-       if(fd < 0) {
-               fprintf(stderr, "Could not open mtd device: %s\n", mtd);
-               exit(1);
-       }
-
-       if(ioctl(fd, MEMGETINFO, &mtdInfo)) {
-               fprintf(stderr, "Could not get MTD device info from %s\n", mtd);
-               close(fd);
-               exit(1);
-       }
-
-       trxfd = open(trxfile,O_RDONLY); 
-       if(trxfd < 0) {
-               fprintf(stderr, "Could not open trx image: %s\n", trxfile);
-               exit(1);
-       }
-
-       if (fstat (trxfd,&trxstat) < 0) {
-               fprintf(stderr, "Could not get trx image file status: %s\n", trxfile);
-               close(trxfd);
-               exit(1);
-       }
-               
-       if(mtdInfo.size < trxstat.st_size) {
-               fprintf(stderr, "Image too big for partition: %s\n", mtd);
-               close(trxfd);
-               exit(1);
-       }       
-       
-       printf("Writing %s to %s ...\n", trxfile, mtd);
-
-       mtdEraseInfo.start = 0;
-       mtdEraseInfo.length = trxstat.st_size & ~(mtdInfo.erasesize -1);
-       if(trxstat.st_size % mtdInfo.erasesize) mtdEraseInfo.length += mtdInfo.erasesize;
-
-       /* erase the chunk */
-       if (ioctl (fd,MEMERASE,&mtdEraseInfo) < 0) {
-               fprintf(stderr, "Erasing mtd failed: %s\n", mtd);
-               exit(1);
-       }
-       
-       size = trxstat.st_size;
-       i = BUFSIZE;
-       written = 0;
-
-       while (size) {
-               if (size < BUFSIZE) i = size;
-               read(trxfd,src,i);
-               result = write(fd,src,i);
-               if (i != result) {
-                       if (result < 0) {
-                               fprintf(stderr,"Error while writing image");
-                               exit(1);
-                       }
-                       fprintf(stderr,"Error writing image");
-                       exit(1);
-               }
-               written += i;
-               size -= i;
-       }
-       
-       return 0;
-}
-
-void usage(void)
-{
-       printf("Usage: mtd [<options> ...] <command> [<arguments> ...] <device>\n\n"
-       "The device is in the format of mtdX (eg: mtd4) or its label.\n"
-       "mtd recognizes these commands:\n"
-       "       unlock                  unlock the device\n"
-       "       erase                   erase all data on device\n"
-       "       write <imagefile>       write imagefile to device\n"
-       "Following options are available:\n"
-       "       -r                      reboot after successful command\n"
-       "       -e <device>             erase <device> before executing the command\n\n"
-       "Example: To write linux.trx to mtd4 labeled as linux and reboot afterwards\n"
-       "         mtd -r write linux.trx linux\n\n");
-       exit(1);
-}
-
-int main (int argc, char **argv)
-{
-       int ch, i, boot, unlock;
-       char *erase[MAX_ARGS], *device;
-       enum {
-               CMD_ERASE,
-               CMD_WRITE,
-               CMD_UNLOCK
-       } cmd;
-       
-       erase[0] = NULL;
-       boot = 0;
-
-       while ((ch = getopt(argc, argv, "re:")) != -1)
-               switch (ch) {
-                       case 'r':
-                               boot = 1;
-                               break;
-                       case 'e':
-                               i = 0;
-                               while ((erase[i] != NULL) && ((i + 1) < MAX_ARGS))
-                                       i++;
-                                       
-                               erase[i++] = optarg;
-                               erase[i] = NULL;
-                               break;
-                       
-                       case '?':
-                       default:
-                               usage();
-               }
-       argc -= optind;
-       argv += optind;
-       
-       if (argc < 2)
-               usage();
-
-       if ((strcmp(argv[0], "unlock") == 0) && (argc == 2)) {
-               cmd = CMD_UNLOCK;
-               device = argv[1];
-       } else if ((strcmp(argv[0], "erase") == 0) && (argc == 2)) {
-               cmd = CMD_ERASE;
-               device = argv[1];
-       } else if ((strcmp(argv[0], "write") == 0) && (argc == 3)) {
-               cmd = CMD_WRITE;
-               device = argv[2];
-       } else {
-               usage();
-       }
-
-       sync();
-
-       i = 0;
-       while (erase[i] != NULL) {
-               mtd_unlock(erase[i]);
-               mtd_erase(erase[i]);
-               i++;
-       }
-       
-       mtd_unlock(device);
-
-       switch (cmd) {
-               case CMD_UNLOCK:
-                       break;
-               case CMD_ERASE:
-                       mtd_erase(device);
-                       break;
-               case CMD_WRITE:
-                       mtd_write(argv[1], device);
-                       break;
-       }
-
-       if (boot)
-               kill(1, 15); // send SIGTERM to init for reboot
-
-       return 0;
-}
diff --git a/openwrt/package/openwrt/openwrt-utils.control b/openwrt/package/openwrt/openwrt-utils.control
deleted file mode 100644 (file)
index b42669b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-Package: openwrt-utils
-Priority: optional
-Section: sys
-Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
-Source: buildroot internal
-Description: Basic OpenWrt utilities
- This package contains:
-   mtd: Tool for modifying the flash chip
-   jffs2root: Expands the jffs2 root partition
-   wlc: Tool for setting various broadcom driver options
diff --git a/openwrt/package/openwrt/wlc.c b/openwrt/package/openwrt/wlc.c
deleted file mode 100644 (file)
index 8cb6dd3..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * wlc - tool for configuring the Broadcom Wireless Network Adapter
- * Copyright (C) 2005 Felix Fietkau <nbd@vd-s.ath.cx>
- *
- * 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, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * $Id$
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <typedefs.h>
-#include <wlutils.h>
-
-int _argc;
-char **_argv;
-
-void qtxpwr() {
-       int i = 0;
-               
-       if (_argc > 3) {
-               if (_argv[3][0] == '@') {
-                       i = atoi(_argv[3] + 1);
-                       i |= 0x80000000;
-               } else {
-                       i = atoi(_argv[3]);
-               }
-               wl_set_val(_argv[1], "qtxpower", &i, sizeof(i));
-       } else {
-               wl_get_val(_argv[1], "qtxpower", &i, sizeof(i));
-               if ((i & 0x80000000) == 0x80000000)
-                       printf("@");
-               printf("%d\n", i & 0x7ffffff);
-       }
-}
-
-
-struct wl_config {
-       char *name, *desc;
-       enum {
-               INT,
-               BOOL,
-               OTHER
-       } type;
-       int get, set;
-       int r1, r2;
-       void *handler;
-};
-
-struct wl_config commands[] = {
-       {"txpwr", "transmit power (in mW)", INT, WLC_GET_TXPWR, WLC_SET_TXPWR, 0, 255, NULL},
-       {"qtxpwr", "\ttransmit power (in qdbm)\n\t\t\t\"@\" before value means regulatory override", OTHER, 0, 0, 0, 0, qtxpwr},
-       {"promisc", "promiscuous mode", BOOL, WLC_GET_PROMISC, WLC_SET_PROMISC, 0, 0, NULL},
-       {"monitor", "monitor mode", BOOL, WLC_GET_MONITOR, WLC_SET_MONITOR, 0, 0, NULL},
-       {"passive", "passive mode", BOOL, WLC_GET_PASSIVE, WLC_SET_PASSIVE, 0, 0, NULL},
-       {"ap", "access point mode (0 = STA, 1 = AP)", BOOL, WLC_GET_AP, WLC_SET_AP, 0, 0, NULL},
-       {"infra", "infrastructure mode (0 = IBSS, 1 = Infra BSS)", BOOL, WLC_GET_INFRA, WLC_SET_INFRA, 0, 0, NULL},
-       {"antdiv", "rx antenna diversity (0 = antenna 0, 1 = antenna 1, 3 = auto select)", INT, WLC_GET_ANTDIV, WLC_SET_ANTDIV, 0, 3, NULL},
-       {"txant", "set tx antenna (0 = antenna 0, 1 = antenna 1, 3 = rx antenna)", INT, WLC_GET_TXANT, WLC_SET_TXANT, 0, 3, NULL},
-       {"wet", "wireless ethernet bridging mode", BOOL, WLC_GET_WET, WLC_SET_WET, 0, 0, NULL},
-       {"channel", "set channel", INT, WLC_GET_CHANNEL, WLC_SET_CHANNEL, 1, 14, NULL},
-       {NULL, NULL, 0, 0, 0, 0, 0, NULL}
-};
-
-void set_int(char *name, int ioctl, int value, int r1, int r2)
-{
-       if ((value >= r1) || (value <= r2)) {
-               wl_ioctl(name, ioctl, &value, sizeof(value));
-       } else
-               fprintf(stderr, "invalid value.\n");
-}
-
-void get_int(char *name, int ioctl)
-{
-       int value = 0;
-       wl_ioctl(name, ioctl, &value, sizeof(value));
-       printf("%d\n", value);
-}
-
-int main(int argc, char **argv)
-{
-       struct wl_config *cmd; 
-       int i;
-
-       _argc = argc;
-       _argv = argv;
-
-       if (argc < 3) {
-               fprintf(stderr, "Usage: %s <interface> <command> [...]\n\n", argv[0]);
-               fprintf(stderr, "Commands:\n\n");
-               
-               cmd = commands;
-               while (cmd->name != NULL) {
-                       fprintf(stderr, "\t%s", cmd->name);
-                       switch (cmd->type) {
-                               case INT:
-                                       fprintf(stderr, " [%d-%d]", cmd->r1, cmd->r2);
-                                       break;
-                               case BOOL:
-                                       fprintf(stderr, " [0|1]");
-                                       cmd->r1 = 0;
-                                       cmd->r2 = 1;
-                                       
-                       }
-                       fprintf(stderr, "\t%s\n", cmd->desc);
-                       cmd++;
-               }
-               fprintf(stderr, "\n");
-               
-               return -1;
-       }
-
-       if (wl_probe(argv[1]) < 0) {
-               fprintf(stderr, "No broadcom extensions detected on interface %s\n", argv[1]);
-               return -1;
-       }
-
-       if ((argc > 4) && (strcmp(argv[2], "ioctl") == 0)) {
-               if (strcmp(argv[3], "int") == 0) {
-                       int ioctl = atoi(argv[4]);
-                       if (argc > 5)
-                               i = atoi(argv[5]);
-                       else
-                               i = 0;
-                       fprintf(stderr, "ioctl = 0x%x (%d)\nold value = 0x%x (%d)\n", ioctl, ioctl, i, i);
-                       wl_ioctl(argv[1], ioctl, &i, sizeof(i));
-                       fprintf(stderr, "new value = 0x%x (%d)\n", i, i);
-               } else if (strcmp(argv[3], "intval") == 0) {
-                       i = 0;
-                       fprintf(stderr, "var = \"%s\"\nold value = 0x%x (%d)\n", argv[4], i, i);
-                       if (argc > 5) {
-                               i = atoi(argv[5]);
-                               wl_set_val(argv[1], argv[4], &i, sizeof(i));
-                       } else {
-                               wl_get_val(argv[1], argv[4], &i, sizeof(i));
-                       }
-                       fprintf(stderr, "new value = 0x%x (%d)\n", i, i);
-               }
-               return 0;
-       }
-       cmd = commands;
-       while (cmd->name != NULL) {
-               if (strcmp(argv[2], cmd->name) == 0) {
-                       switch (cmd->type) {
-                               case INT:
-                               case BOOL:
-                                       if (argc < 4) {
-                                               get_int(argv[1], cmd->get);
-                                       } else {
-                                               set_int(argv[1], cmd->set, atoi(argv[3]), cmd->r1, cmd->r2);
-                                       }
-                               break;
-                               case OTHER: {
-                                       void (*handler)(void) = cmd->handler;
-                                       handler();
-                               }
-                               break;
-                       }
-               }
-               cmd++;
-       }
-       
-       
-       return 0;
-}
index e7de504f30575b3f6612aa8cd3cf8cfca844f590..d2036e6d1aaa073ee3b03d73ef03863275d54a48 100644 (file)
@@ -1,6 +1,12 @@
+config BR2_PACKAGE_OSIRIS
+       bool
+       default n
+       depends BR2_PACKAGE_OSIRISD
+
 config BR2_PACKAGE_OSIRISD
        tristate "osirisd - Host integrity monitoring system (scanning agent)"
        default m if CONFIG_DEVEL
+       select BR2_PACKAGE_OSIRIS
        select BR2_PACKAGE_LIBOPENSSL
        help
          An host integrity monitoring system (scanning agent)
@@ -10,6 +16,3 @@ config BR2_PACKAGE_OSIRISD
          Depends: openssl
          
 
-config BR_PACKAGE_OSIRIS
-       tristate
-       default BR2_PACKAGE_OSIRISD
diff --git a/openwrt/package/osiris/patches/install-non-interactive.patch b/openwrt/package/osiris/patches/install-non-interactive.patch
deleted file mode 100644 (file)
index ac5a177..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-diff -ruN osiris-4.1.8-orig/Makefile.am osiris-4.1.8-1/Makefile.am
---- osiris-4.1.8-orig/Makefile.am      2005-01-13 06:49:15.000000000 +0100
-+++ osiris-4.1.8-1/Makefile.am 2005-04-22 23:11:32.000000000 +0200
-@@ -72,5 +72,5 @@
- # everything.
- install-data-local:
--      @cd ./src/install;./install.sh
-+      @cd ./src/install;./install.sh non-interactive
-       @rm ./src/osirisd/modules/libmodules.a
-diff -ruN osiris-4.1.8-orig/Makefile.in osiris-4.1.8-1/Makefile.in
---- osiris-4.1.8-orig/Makefile.in      2005-04-04 14:51:19.000000000 +0200
-+++ osiris-4.1.8-1/Makefile.in 2005-04-22 23:11:32.000000000 +0200
-@@ -505,7 +505,7 @@
- # everything.
- install-data-local:
--      @cd ./src/install;./install.sh
-+      @cd ./src/install;./install.sh non-interactive
-       @rm ./src/osirisd/modules/libmodules.a
- # Tell versions [3.59,3.63) of GNU make to not export all variables.
- # Otherwise a system limit (for SysV at least) may be exceeded.
-diff -ruN osiris-4.1.8-orig/configure osiris-4.1.8-1/configure
-diff -ruN osiris-4.1.8-orig/configure.ac osiris-4.1.8-1/configure.ac
-diff -ruN osiris-4.1.8-orig/ipkg/osirisd/CONTROL/control osiris-4.1.8-1/ipkg/osirisd/CONTROL/control
-diff -ruN osiris-4.1.8-orig/ipkg/osirisd/etc/init.d/osirisd osiris-4.1.8-1/ipkg/osirisd/etc/init.d/osirisd
-diff -ruN osiris-4.1.8-orig/ipkg/osirisd-static/CONTROL/control osiris-4.1.8-1/ipkg/osirisd-static/CONTROL/control
-diff -ruN osiris-4.1.8-orig/ipkg/rules osiris-4.1.8-1/ipkg/rules
-diff -ruN osiris-4.1.8-orig/ipkg/version osiris-4.1.8-1/ipkg/version
-diff -ruN osiris-4.1.8-orig/src/install/install.sh.in osiris-4.1.8-1/src/install/install.sh.in
---- osiris-4.1.8-orig/src/install/install.sh.in        2005-04-15 22:38:31.000000000 +0200
-+++ osiris-4.1.8-1/src/install/install.sh.in   2005-04-22 23:41:21.000000000 +0200
-@@ -14,7 +14,9 @@
- SERVICE_DESC="Osiris Host Integrity Monitor"
--INTERACTIVE=1
-+if [ -z "${INTERACTIVE}" ]; then
-+    INTERACTIVE=1
-+fi
- PACKAGE_MODE=0
- NO_USER_ADDED=0
-@@ -1117,18 +1119,6 @@
-  # look for interactive mode argument.
--if [ -z "${1}" ] ; then
--    INTERACTIVE=1
--else
--    INTERACTIVE=0
--fi
--
--# Change behaviour if we are creating packages.
--if [ -n "$DESTDIR" ]; then
--    PACKAGE_MODE=1
--    INTERACTIVE=0
--fi
--
- pre_install
- create_users_and_groups
- prompts
-diff -ruN osiris-4.1.8-orig/src/osirisd/modules/mod_nvram/Makefile osiris-4.1.8-1/src/osirisd/modules/mod_nvram/Makefile
-diff -ruN osiris-4.1.8-orig/src/osirisd/modules/mod_nvram/README osiris-4.1.8-1/src/osirisd/modules/mod_nvram/README
-diff -ruN osiris-4.1.8-orig/src/osirisd/modules/mod_nvram/mod_nvram.c osiris-4.1.8-1/src/osirisd/modules/mod_nvram/mod_nvram.c
-diff -ruN osiris-4.1.8-orig/src/osirisd/modules/mod_uptime/Makefile osiris-4.1.8-1/src/osirisd/modules/mod_uptime/Makefile
-diff -ruN osiris-4.1.8-orig/src/osirisd/modules/mod_uptime/README osiris-4.1.8-1/src/osirisd/modules/mod_uptime/README
-diff -ruN osiris-4.1.8-orig/src/osirisd/modules/mod_uptime/mod_uptime.c osiris-4.1.8-1/src/osirisd/modules/mod_uptime/mod_uptime.c
-diff -ruN osiris-4.1.8-orig/src/osirisd/osirisd.c osiris-4.1.8-1/src/osirisd/osirisd.c
-diff -ruN osiris-4.1.8-orig/src/osirisd/rootpriv.c osiris-4.1.8-1/src/osirisd/rootpriv.c
index 5dd79f9a50ec557781a5a86dd4a177702cf6f573..20bba966dcb3b16eaf529839142af56512e6c8e6 100644 (file)
@@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=portmap
 PKG_VERSION:=5beta
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_MD5SUM:=781e16ed4487c4caa082c6fef09ead4f
 
 # space separated list or special @SF for sourceforge projects
@@ -31,6 +31,9 @@ $(PKG_BUILD_DIR)/.built:
        touch $@
 
 $(IPKG_PORTMAP):
+       install -d -m0755 $(IDIR_PORTMAP)/etc/init.d 
+       install -m0755 ./files/portmap.init $(IDIR_PORTMAP)/etc/init.d/portmap
+       ln -sf portmap $(IDIR_PORTMAP)/etc/init.d/S59portmap
        install -d -m0755 $(IDIR_PORTMAP)/usr/sbin 
        install -m0755 $(PKG_BUILD_DIR)/portmap $(IDIR_PORTMAP)/usr/sbin/
        $(RSTRIP) $(IDIR_PORTMAP)
diff --git a/openwrt/package/portmap/files/portmap.init b/openwrt/package/portmap/files/portmap.init
new file mode 100644 (file)
index 0000000..e1ed89a
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+BIN=portmap
+DEFAULT=/etc/default/$BIN
+[ -f $DEFAULT ] && . $DEFAULT
+
+case $1 in
+ start)
+  $BIN $OPTIONS
+  ;;
+ *)
+  echo "usage: $0 (start)"
+  exit 1
+esac
+
+exit $?
index e83aa7ba50486e0e9c6d79d687d860cd31620b05..2982462815e13484c188bd2d9508ed476c5ff7e9 100644 (file)
@@ -6,3 +6,4 @@ Architecture: [TBDL]
 Maintainer: Nico <nthill@free.fr>
 Source: http://nthill.free.fr/openwrt/sources/postgresql/
 Description: Command Line Interface (CLI) to PostgreSQL databases
+Depends: libpq
index e1c3907ceead514218e27b970cf56b47ff8d2117..0fed25c91e98b9045e88ab2847f171b290475f01 100644 (file)
@@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ppp
 PKG_VERSION:=2.4.3
-PKG_RELEASE:=4
+PKG_RELEASE:=6
 PKG_MD5SUM:=848f6c3cafeb6074ffeb293c3af79b7c
 
 PKG_SOURCE_URL:=ftp://ftp.samba.org/pub/ppp/
@@ -70,6 +70,7 @@ $(PKG_BUILD_DIR)/.built:
        $(MAKE) -C $(PKG_BUILD_DIR) \
                CC=$(TARGET_CC) \
                COPTS="$(TARGET_CFLAGS)" \
+               HAVE_INET6="1" \
                DESTDIR="$(PKG_INSTALL_DIR)/usr" \
                all install
        touch $@
@@ -87,11 +88,11 @@ $(IPKG_PPP):
        $(RSTRIP) $(IDIR_PPP)
        $(IPKG_BUILD) $(IDIR_PPP) $(PACKAGE_DIR)
        
-$(IDIR_PPP_MOD_PPPOE)/etc/init.d/S50pppoe:
-       install -d -m0755 $(IDIR_PPP_MOD_PPPOE)/etc/init.d
-       install -m0755 ./files/pppoe.init $(IDIR_PPP_MOD_PPPOE)/etc/init.d/S50pppoe
+$(IDIR_PPP_MOD_PPPOE)/sbin/ifup.pppoe:
+       install -d -m0755 $(IDIR_PPP_MOD_PPPOE)/sbin
+       install -m0755 ./files/ifup.pppoe $(IDIR_PPP_MOD_PPPOE)/sbin/
 
-$(IPKG_PPP_MOD_PPPOE): $(IDIR_PPP_MOD_PPPOE)/etc/init.d/S50pppoe
+$(IPKG_PPP_MOD_PPPOE): $(IDIR_PPP_MOD_PPPOE)/sbin/ifup.pppoe
 
 $(IDIR_PPP_MOD_RADIUS)/etc/ppp/radius.conf:
 
diff --git a/openwrt/package/ppp/files/ifup.pppoe b/openwrt/package/ppp/files/ifup.pppoe
new file mode 100644 (file)
index 0000000..fcf06ae
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/sh
+[ $# = 0 ] && { echo "  $0 <group>"; exit; }
+. /etc/functions.sh
+type=$1
+
+[ "$(nvram get ${type}_proto)" = "pppoe" ] || {
+       echo "$0: ${type}_proto isn't pppoe"
+       exit
+}
+
+for module in slhc ppp_generic pppox pppoe; do
+       /sbin/insmod $module 2>&- >&-
+done
+
+while :; do
+       IFNAME=$(nvram get pppoe_ifname)
+       USERNAME=$(nvram get ppp_username)
+       PASSWORD=$(nvram get ppp_passwd)
+       REDIAL=$(nvram get ppp_redialperiod)
+       REDIAL=${REDIAL:+lcp-echo-interval $REDIAL}
+       IDLETIME=$(nvram get ppp_idletime)
+       IDLETIME=${IDLETIME:+lcp-echo-failure $IDLETIME}
+       MTU=$(nvram get ppp_mtu)
+       MTU=${MTU:-1492}
+       MTU=${MTU:+ mtu $MTU mru $MTU}
+
+       ifconfig $IFNAME up
+       /usr/sbin/pppd nodetach \
+               plugin rp-pppoe.so \
+               connect /bin/true \
+               usepeerdns \
+               defaultroute \
+               replacedefaultroute \
+               linkname $type \
+               user "$USERNAME" \
+               password "$PASSWORD" \
+               $MTU \
+               $IDLETIME \
+               $REDIAL \
+               nic-$IFNAME
+done &
diff --git a/openwrt/package/ppp/files/pppoe.init b/openwrt/package/ppp/files/pppoe.init
deleted file mode 100644 (file)
index d0cfa26..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-
-. /etc/functions.sh
-
-WAN_PROTO=$(nvram get wan_proto)
-[ "$WAN_PROTO" = "pppoe" ] || exit 0
-
-for module in slhc ppp_generic pppox pppoe; do
-       /sbin/insmod $module 2>/dev/null >/dev/null
-done
-
-(
-       while true; do
-               IFNAME=$(nvram get pppoe_ifname)
-               USERNAME=$(nvram get ppp_username)
-               PASSWORD=$(nvram get ppp_passwd)
-               REDIAL=$(nvram get ppp_redialperiod)
-               REDIAL=${REDIAL:+lcp-echo-interval $REDIAL}
-               IDLETIME=$(nvram get ppp_idletime)
-               IDLETIME=${IDLETIME:+lcp-echo-failure $IDLETIME}
-               MTUV=$(nvram get ppp_mtu)
-               MTU=${MTUV:+mtu $MTUV}
-               MRU=${MTUV:+mru $MTUV}
-
-               ifconfig $IFNAME up
-               echo -e "plugin rp-pppoe.so\nconnect /bin/true\nusepeerdns\ndefaultroute\nuser \"$USERNAME\"\npassword \"$PASSWORD\"\n$MTU\n$MRU\n$IDLETIME\n$REDIAL" > /tmp/.pppoe-data
-               /usr/sbin/pppd nodetach file /tmp/.pppoe-data $IFNAME
-       done
-) &
diff --git a/openwrt/package/ppp/patches/100-debian_close_dev_ppp.patch b/openwrt/package/ppp/patches/100-debian_close_dev_ppp.patch
new file mode 100644 (file)
index 0000000..4e50118
--- /dev/null
@@ -0,0 +1,34 @@
+From: Simon Peter <dn.tlp@gmx.net>
+Subject: Bug#306261: pppd does not properly close /dev/ppp on persist
+
+When using the kernel PPPoE driver, pppd never
+closes /dev/ppp when the link has come down.
+
+It opens superfluous fds to the device each time it re-opens the
+connection, with the unclosed ones falsely reported always ready for
+data by select().
+
+This makes pppd eat up 100% CPU time after the first persist because of
+the always instantly returning select() on the unclosed fds.
+
+The problem also occurs with the upstream version, but does not occur
+when a pty/tty device is used for the ppp connection.
+
+
+diff -u -r ppp-2.4.3/pppd/sys-linux.c ppp-2.4.3/pppd/sys-linux.c
+--- ppp-2.4.3/pppd/sys-linux.c 2005-04-29 20:08:37.000000000 +0200
++++ ppp-2.4.3/pppd/sys-linux.c 2005-04-29 20:07:03.000000000 +0200
+@@ -455,6 +455,13 @@
+     if (new_style_driver) {
+       int flags;
++        /* if a ppp_fd is already open, close it first */
++        if(ppp_fd > 0) {
++          close(ppp_fd);
++          remove_fd(ppp_fd);
++          ppp_fd = -1;
++        }
++
+       /* Open an instance of /dev/ppp and connect the channel to it */
+       if (ioctl(fd, PPPIOCGCHAN, &chindex) == -1) {
+           error("Couldn't get channel number: %m");
diff --git a/openwrt/package/ppp/patches/101-debian_ip-up_option.patch b/openwrt/package/ppp/patches/101-debian_ip-up_option.patch
new file mode 100644 (file)
index 0000000..6033fda
--- /dev/null
@@ -0,0 +1,88 @@
+diff -ruNp ppp-2.4.3.orig/pppd/ipcp.c ppp-2.4.3/pppd/ipcp.c
+--- ppp-2.4.3.orig/pppd/ipcp.c 2004-11-13 13:03:26.000000000 +0100
++++ ppp-2.4.3/pppd/ipcp.c      2005-02-20 18:45:22.241810136 +0100
+@@ -1846,7 +1846,7 @@ ipcp_up(f)
+      */
+     if (ipcp_script_state == s_down && ipcp_script_pid == 0) {
+       ipcp_script_state = s_up;
+-      ipcp_script(_PATH_IPUP);
++      ipcp_script(path_ipup);
+     }
+ }
+@@ -1896,7 +1896,7 @@ ipcp_down(f)
+     /* Execute the ip-down script */
+     if (ipcp_script_state == s_up && ipcp_script_pid == 0) {
+       ipcp_script_state = s_down;
+-      ipcp_script(_PATH_IPDOWN);
++      ipcp_script(path_ipdown);
+     }
+ }
+@@ -1950,13 +1950,13 @@ ipcp_script_done(arg)
+     case s_up:
+       if (ipcp_fsm[0].state != OPENED) {
+           ipcp_script_state = s_down;
+-          ipcp_script(_PATH_IPDOWN);
++          ipcp_script(path_ipdown);
+       }
+       break;
+     case s_down:
+       if (ipcp_fsm[0].state == OPENED) {
+           ipcp_script_state = s_up;
+-          ipcp_script(_PATH_IPUP);
++          ipcp_script(path_ipup);
+       }
+       break;
+     }
+diff -ruNp ppp-2.4.3.orig/pppd/main.c ppp-2.4.3/pppd/main.c
+--- ppp-2.4.3.orig/pppd/main.c 2005-02-20 18:46:14.409879384 +0100
++++ ppp-2.4.3/pppd/main.c      2005-02-20 18:45:22.243809832 +0100
+@@ -314,6 +314,9 @@ main(argc, argv)
+     struct protent *protp;
+     char numbuf[16];
++    strlcpy(path_ipup, _PATH_IPUP, sizeof(path_ipup));
++    strlcpy(path_ipdown, _PATH_IPDOWN, sizeof(path_ipdown));
++
+     link_stats_valid = 0;
+     new_phase(PHASE_INITIALIZE);
+diff -ruNp ppp-2.4.3.orig/pppd/options.c ppp-2.4.3/pppd/options.c
+--- ppp-2.4.3.orig/pppd/options.c      2005-02-20 18:46:14.410879232 +0100
++++ ppp-2.4.3/pppd/options.c   2005-02-20 18:46:02.154742448 +0100
+@@ -108,6 +108,8 @@ char       linkname[MAXPATHLEN];   /* logical na
+ bool  tune_kernel;            /* may alter kernel settings */
+ int   connect_delay = 1000;   /* wait this many ms after connect script */
+ int   req_unit = -1;          /* requested interface unit */
++char  path_ipup[MAXPATHLEN];  /* pathname of ip-up script */
++char  path_ipdown[MAXPATHLEN];/* pathname of ip-down script */
+ bool  multilink = 0;          /* Enable multilink operation */
+ char  *bundle_name = NULL;    /* bundle name for multilink */
+ bool  dump_options;           /* print out option values */
+@@ -276,6 +278,13 @@ option_t general_options[] = {
+       "Number of seconds to wait for child processes at exit",
+       OPT_PRIO },
++    { "ip-up-script", o_string, path_ipup,
++      "Set pathname of ip-up script",
++      OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
++    { "ip-down-script", o_string, path_ipdown,
++      "Set pathname of ip-down script",
++      OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
++
+ #ifdef HAVE_MULTILINK
+     { "multilink", o_bool, &multilink,
+       "Enable multilink operation", OPT_PRIO | 1 },
+diff -ruNp ppp-2.4.3.orig/pppd/pppd.h ppp-2.4.3/pppd/pppd.h
+--- ppp-2.4.3.orig/pppd/pppd.h 2005-02-20 18:46:14.414878624 +0100
++++ ppp-2.4.3/pppd/pppd.h      2005-02-20 18:45:22.247809224 +0100
+@@ -312,6 +312,8 @@ extern bool        tune_kernel;    /* May alter ke
+ extern int    connect_delay;  /* Time to delay after connect script */
+ extern int    max_data_rate;  /* max bytes/sec through charshunt */
+ extern int    req_unit;       /* interface unit number to use */
++extern char   path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
++extern char   path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */
+ extern bool   multilink;      /* enable multilink operation */
+ extern bool   noendpoint;     /* don't send or accept endpt. discrim. */
+ extern char   *bundle_name;   /* bundle name for multilink */
diff --git a/openwrt/package/ppp/patches/102-debian_pppoe_multicast_pado.patch b/openwrt/package/ppp/patches/102-debian_pppoe_multicast_pado.patch
new file mode 100644 (file)
index 0000000..ea5275c
--- /dev/null
@@ -0,0 +1,14 @@
+diff -ruNp ppp-2.4.3.orig/pppd/plugins/rp-pppoe/discovery.c ppp-2.4.3/pppd/plugins/rp-pppoe/discovery.c
+--- ppp-2.4.3.orig/pppd/plugins/rp-pppoe/discovery.c   2004-11-04 11:07:37.000000000 +0100
++++ ppp-2.4.3/pppd/plugins/rp-pppoe/discovery.c        2005-02-24 21:00:11.586697752 +0100
+@@ -365,8 +365,8 @@ waitForPADO(PPPoEConnection *conn, int t
+       if (!packetIsForMe(conn, &packet)) continue;
+       if (packet.code == CODE_PADO) {
+-          if (NOT_UNICAST(packet.ethHdr.h_source)) {
+-              printErr("Ignoring PADO packet from non-unicast MAC address");
++          if (BROADCAST(packet.ethHdr.h_source)) {
++              printErr("Ignoring PADO packet from broadcast MAC address");
+               continue;
+           }
+           parsePacket(&packet, parsePADOTags, &pc);
diff --git a/openwrt/package/ppp/patches/103-debian_pppoe_cleanup.patch b/openwrt/package/ppp/patches/103-debian_pppoe_cleanup.patch
new file mode 100644 (file)
index 0000000..8a97a0b
--- /dev/null
@@ -0,0 +1,1079 @@
+diff -ruNp ppp-2.4.3.orig/pppd/plugins/rp-pppoe/common.c ppp-2.4.3/pppd/plugins/rp-pppoe/common.c
+--- ppp-2.4.3.orig/pppd/plugins/rp-pppoe/common.c      2004-02-02 04:36:46.000000000 +0100
++++ ppp-2.4.3/pppd/plugins/rp-pppoe/common.c   2005-03-11 02:09:19.000000000 +0100
+@@ -18,10 +18,6 @@ static char const RCSID[] =
+ #include "pppoe.h"
+-#ifdef HAVE_SYSLOG_H
+-#include <syslog.h>
+-#endif
+-
+ #include <string.h>
+ #include <errno.h>
+ #include <stdlib.h>
+@@ -50,17 +46,17 @@ parsePacket(PPPoEPacket *packet, ParseFu
+     UINT16_t tagType, tagLen;
+     if (packet->ver != 1) {
+-      syslog(LOG_ERR, "Invalid PPPoE version (%d)", (int) packet->ver);
++      error("Invalid PPPoE version (%u)", packet->ver);
+       return -1;
+     }
+     if (packet->type != 1) {
+-      syslog(LOG_ERR, "Invalid PPPoE type (%d)", (int) packet->type);
++      error("Invalid PPPoE type (%u)", packet->type);
+       return -1;
+     }
+     /* Do some sanity checks on packet */
+     if (len > ETH_DATA_LEN - 6) { /* 6-byte overhead for PPPoE header */
+-      syslog(LOG_ERR, "Invalid PPPoE packet length (%u)", len);
++      error("Invalid PPPoE packet length (%u)", len);
+       return -1;
+     }
+@@ -76,7 +72,7 @@ parsePacket(PPPoEPacket *packet, ParseFu
+           return 0;
+       }
+       if ((curTag - packet->payload) + tagLen + TAG_HDR_SIZE > len) {
+-          syslog(LOG_ERR, "Invalid PPPoE tag length (%u)", tagLen);
++          error("Invalid PPPoE tag length (%u)", tagLen);
+           return -1;
+       }
+       func(tagType, tagLen, curTag+TAG_HDR_SIZE, extra);
+@@ -105,17 +101,17 @@ findTag(PPPoEPacket *packet, UINT16_t ty
+     UINT16_t tagType, tagLen;
+     if (packet->ver != 1) {
+-      syslog(LOG_ERR, "Invalid PPPoE version (%d)", (int) packet->ver);
++      error("Invalid PPPoE version (%u)", packet->ver);
+       return NULL;
+     }
+     if (packet->type != 1) {
+-      syslog(LOG_ERR, "Invalid PPPoE type (%d)", (int) packet->type);
++      error("Invalid PPPoE type (%u)", packet->type);
+       return NULL;
+     }
+     /* Do some sanity checks on packet */
+     if (len > ETH_DATA_LEN - 6) { /* 6-byte overhead for PPPoE header */
+-      syslog(LOG_ERR, "Invalid PPPoE packet length (%u)", len);
++      error("Invalid PPPoE packet length (%u)", len);
+       return NULL;
+     }
+@@ -131,7 +127,7 @@ findTag(PPPoEPacket *packet, UINT16_t ty
+           return NULL;
+       }
+       if ((curTag - packet->payload) + tagLen + TAG_HDR_SIZE > len) {
+-          syslog(LOG_ERR, "Invalid PPPoE tag length (%u)", tagLen);
++          error("Invalid PPPoE tag length (%u)", tagLen);
+           return NULL;
+       }
+       if (tagType == type) {
+@@ -143,6 +139,7 @@ findTag(PPPoEPacket *packet, UINT16_t ty
+     return NULL;
+ }
++#ifdef unused
+ /**********************************************************************
+ *%FUNCTION: printErr
+ *%ARGUMENTS:
+@@ -158,6 +155,7 @@ printErr(char const *str)
+     fprintf(stderr, "pppoe: %s\n", str);
+     syslog(LOG_ERR, "%s", str);
+ }
++#endif
+ /**********************************************************************
+@@ -172,7 +170,7 @@ strDup(char const *str)
+ {
+     char *copy = malloc(strlen(str)+1);
+     if (!copy) {
+-      rp_fatal("strdup failed");
++      fatal("strdup failed");
+     }
+     strcpy(copy, str);
+     return copy;
+@@ -467,9 +465,10 @@ sendPADT(PPPoEConnection *conn, char con
+       fprintf(conn->debugFile, "\n");
+       fflush(conn->debugFile);
+     }
+-    syslog(LOG_INFO,"Sent PADT");
++    info("Sent PADT");
+ }
++#ifdef unused
+ /**********************************************************************
+ *%FUNCTION: parseLogErrs
+ *%ARGUMENTS:
+@@ -501,4 +500,5 @@ parseLogErrs(UINT16_t type, UINT16_t len
+       break;
+     }
+ }
++#endif
+diff -ruNp ppp-2.4.3.orig/pppd/plugins/rp-pppoe/discovery.c ppp-2.4.3/pppd/plugins/rp-pppoe/discovery.c
+--- ppp-2.4.3.orig/pppd/plugins/rp-pppoe/discovery.c   2005-03-11 02:12:52.000000000 +0100
++++ ppp-2.4.3/pppd/plugins/rp-pppoe/discovery.c        2005-03-10 12:24:19.000000000 +0100
+@@ -13,10 +13,6 @@ static char const RCSID[] =
+ #include "pppoe.h"
+-#ifdef HAVE_SYSLOG_H
+-#include <syslog.h>
+-#endif
+-
+ #include <string.h>
+ #include <stdlib.h>
+ #include <errno.h>
+@@ -167,24 +163,21 @@ parsePADOTags(UINT16_t type, UINT16_t le
+       if (conn->printACNames) {
+           printf("Got a Service-Name-Error tag: %.*s\n", (int) len, data);
+       } else {
+-          syslog(LOG_ERR, "PADO: Service-Name-Error: %.*s", (int) len, data);
+-          exit(1);
++          fatal("PADO: Service-Name-Error: %.*s", (int) len, data);
+       }
+       break;
+     case TAG_AC_SYSTEM_ERROR:
+       if (conn->printACNames) {
+           printf("Got a System-Error tag: %.*s\n", (int) len, data);
+       } else {
+-          syslog(LOG_ERR, "PADO: System-Error: %.*s", (int) len, data);
+-          exit(1);
++          fatal("PADO: System-Error: %.*s", (int) len, data);
+       }
+       break;
+     case TAG_GENERIC_ERROR:
+       if (conn->printACNames) {
+           printf("Got a Generic-Error tag: %.*s\n", (int) len, data);
+       } else {
+-          syslog(LOG_ERR, "PADO: Generic-Error: %.*s", (int) len, data);
+-          exit(1);
++          fatal("PADO: Generic-Error: %.*s", (int) len, data);
+       }
+       break;
+     }
+@@ -209,20 +202,14 @@ parsePADSTags(UINT16_t type, UINT16_t le
+     PPPoEConnection *conn = (PPPoEConnection *) extra;
+     switch(type) {
+     case TAG_SERVICE_NAME:
+-      syslog(LOG_DEBUG, "PADS: Service-Name: '%.*s'", (int) len, data);
++      dbglog("PADS: Service-Name: '%.*s'", (int) len, data);
+       break;
+     case TAG_SERVICE_NAME_ERROR:
+-      syslog(LOG_ERR, "PADS: Service-Name-Error: %.*s", (int) len, data);
+-      fprintf(stderr, "PADS: Service-Name-Error: %.*s\n", (int) len, data);
+-      exit(1);
++      fatal("PADS: Service-Name-Error: %.*s", (int) len, data);
+     case TAG_AC_SYSTEM_ERROR:
+-      syslog(LOG_ERR, "PADS: System-Error: %.*s", (int) len, data);
+-      fprintf(stderr, "PADS: System-Error: %.*s\n", (int) len, data);
+-      exit(1);
++      fatal("PADS: System-Error: %.*s", (int) len, data);
+     case TAG_GENERIC_ERROR:
+-      syslog(LOG_ERR, "PADS: Generic-Error: %.*s", (int) len, data);
+-      fprintf(stderr, "PADS: Generic-Error: %.*s\n", (int) len, data);
+-      exit(1);
++      fatal("PADS: Generic-Error: %.*s", (int) len, data);
+     case TAG_RELAY_SESSION_ID:
+       conn->relayId.type = htons(type);
+       conn->relayId.length = htons(len);
+@@ -336,7 +323,7 @@ waitForPADO(PPPoEConnection *conn, int t
+               if (r >= 0 || errno != EINTR) break;
+           }
+           if (r < 0) {
+-              fatalSys("select (waitForPADO)");
++              fatal("waitForPADO: select: %m");
+           }
+           if (r == 0) return;        /* Timed out */
+       }
+@@ -346,8 +333,7 @@ waitForPADO(PPPoEConnection *conn, int t
+       /* Check length */
+       if (ntohs(packet.length) + HDR_SIZE > len) {
+-          syslog(LOG_ERR, "Bogus PPPoE length field (%u)",
+-                 (unsigned int) ntohs(packet.length));
++          error("Bogus PPPoE length field (%u)", ntohs(packet.length));
+           continue;
+       }
+@@ -366,16 +352,16 @@ waitForPADO(PPPoEConnection *conn, int t
+       if (packet.code == CODE_PADO) {
+           if (BROADCAST(packet.ethHdr.h_source)) {
+-              printErr("Ignoring PADO packet from broadcast MAC address");
++              error("Ignoring PADO packet from broadcast MAC address");
+               continue;
+           }
+           parsePacket(&packet, parsePADOTags, &pc);
+           if (!pc.seenACName) {
+-              printErr("Ignoring PADO packet with no AC-Name tag");
++              error("Ignoring PADO packet with no AC-Name tag");
+               continue;
+           }
+           if (!pc.seenServiceName) {
+-              printErr("Ignoring PADO packet with no Service-Name tag");
++              error("Ignoring PADO packet with no Service-Name tag");
+               continue;
+           }
+           conn->numPADOs++;
+@@ -513,7 +499,7 @@ waitForPADS(PPPoEConnection *conn, int t
+               if (r >= 0 || errno != EINTR) break;
+           }
+           if (r < 0) {
+-              fatalSys("select (waitForPADS)");
++              fatal("waitForPADS: select: %m");
+           }
+           if (r == 0) return;
+       }
+@@ -523,8 +509,7 @@ waitForPADS(PPPoEConnection *conn, int t
+       /* Check length */
+       if (ntohs(packet.length) + HDR_SIZE > len) {
+-          syslog(LOG_ERR, "Bogus PPPoE length field (%u)",
+-                 (unsigned int) ntohs(packet.length));
++          error("Bogus PPPoE length field (%u)", ntohs(packet.length));
+           continue;
+       }
+@@ -556,11 +541,12 @@ waitForPADS(PPPoEConnection *conn, int t
+     /* Don't bother with ntohs; we'll just end up converting it back... */
+     conn->session = packet.session;
+-    syslog(LOG_INFO, "PPP session is %d", (int) ntohs(conn->session));
++    info("PPP session is %d", ntohs(conn->session));
+     /* RFC 2516 says session id MUST NOT be zero or 0xFFFF */
+     if (ntohs(conn->session) == 0 || ntohs(conn->session) == 0xFFFF) {
+-      syslog(LOG_ERR, "Access concentrator used a session value of %x -- the AC is violating RFC 2516", (unsigned int) ntohs(conn->session));
++      error("Access concentrator used a session value of 0x%x"
++          " -- the AC is violating RFC 2516", ntohs(conn->session));
+     }
+ }
+@@ -620,7 +606,7 @@ discovery(PPPoEConnection *conn)
+     /* If we're only printing access concentrator names, we're done */
+     if (conn->printACNames) {
+-      die(0);
++      exit(0);
+     }
+     timeout = PADI_TIMEOUT;
+diff -ruNp ppp-2.4.3.orig/pppd/plugins/rp-pppoe/if.c ppp-2.4.3/pppd/plugins/rp-pppoe/if.c
+--- ppp-2.4.3.orig/pppd/plugins/rp-pppoe/if.c  2001-12-14 03:55:20.000000000 +0100
++++ ppp-2.4.3/pppd/plugins/rp-pppoe/if.c       2005-03-10 13:32:43.000000000 +0100
+@@ -40,10 +40,6 @@ static char const RCSID[] =
+ #include <sys/ioctl.h>
+ #endif
+-#ifdef HAVE_SYSLOG_H
+-#include <syslog.h>
+-#endif
+-
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -127,7 +123,7 @@ etherType(PPPoEPacket *packet)
+ {
+     UINT16_t type = (UINT16_t) ntohs(packet->ethHdr.h_proto);
+     if (type != Eth_PPPOE_Discovery && type != Eth_PPPOE_Session) {
+-      syslog(LOG_ERR, "Invalid ether type 0x%x", type);
++      error("Invalid ethernet type 0x%x", type);
+     }
+     return type;
+ }
+@@ -156,7 +152,7 @@ getHWaddr(int sock, char const *ifname, 
+     ifc.ifc_len = sizeof(inbuf);
+     ifc.ifc_buf = inbuf;
+     if (ioctl(sock, SIOCGIFCONF, &ifc) < 0) {
+-      fatalSys("SIOCGIFCONF");
++      fatal("SIOCGIFCONF: %m");
+     }
+     ifr = ifc.ifc_req;
+     ifreq.ifr_name[0] = '\0';
+@@ -172,9 +168,7 @@ getHWaddr(int sock, char const *ifname, 
+               (sdl->sdl_alen == ETH_ALEN) &&
+               !strncmp(ifname, ifr->ifr_name, sizeof(ifr->ifr_name))) {
+               if (found) {
+-                  char buffer[256];
+-                  sprintf(buffer, "interface %.16s has more than one ethernet address", ifname);
+-                  rp_fatal(buffer);
++                  fatal("interface %s has more than one ethernet address", ifname);
+               } else {
+                   found = 1;
+                   memcpy(hwaddr, LLADDR(sdl), ETH_ALEN);
+@@ -183,9 +177,7 @@ getHWaddr(int sock, char const *ifname, 
+       }
+     }
+     if (!found) {
+-      char buffer[256];
+-        sprintf(buffer, "interface %.16s has no ethernet address", ifname);
+-      rp_fatal(buffer);
++        fatal("interface %s has no ethernet address", ifname);
+     }
+ }
+@@ -252,7 +244,7 @@ initFilter(int fd, UINT16_t type, unsign
+       
+       /* Apply the filter */
+       if (ioctl(fd, BIOCSETF, &bpfProgram) < 0) {
+-      fatalSys("ioctl(BIOCSETF)");
++      fatal("ioctl(BIOCSETF): %m");
+       }
+     }
+ }
+@@ -298,42 +290,36 @@ openInterface(char const *ifname, UINT16
+     if (fd < 0) {
+       switch (errno) {
+       case EACCES:            /* permission denied */
+-          {
+-              char buffer[256];
+-              sprintf(buffer, "Cannot open %.32s -- pppoe must be run as root.", bpfName);
+-              rp_fatal(buffer);
+-          }
++          fatal("Cannot open %s -- pppoe must be run as root.", bpfName);
+           break;
+       case EBUSY:
+       case ENOENT:            /* no such file */
+           if (i == 0) {
+-              rp_fatal("No /dev/bpf* devices (check your kernel configuration for BPF support)");
++              fatal("No /dev/bpf* devices (check your kernel configuration for BPF support)");
+           } else {
+-              rp_fatal("All /dev/bpf* devices are in use");
++              fatal("All /dev/bpf* devices are in use");
+           }
+           break;
+       }
+-      fatalSys(bpfName);
++      fatal("%s: %m", bpfName);
+     }
+     if ((sock = socket(AF_LOCAL, SOCK_DGRAM, 0)) < 0) {
+-      fatalSys("socket");
++      fatal("socket: %m");
+     }
+     /* Check that the interface is up */
+     strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+     if (ioctl(sock, SIOCGIFFLAGS, &ifr) < 0) {
+-      fatalSys("ioctl(SIOCGIFFLAGS)");
++      fatal("ioctl(SIOCGIFFLAGS): %m");
+     }
+     if ((ifr.ifr_flags & IFF_UP) == 0) {
+-      char buffer[256];
+-      sprintf(buffer, "Interface %.16s is not up\n", ifname);
+-      rp_fatal(buffer);
++      fatal("Interface %s is not up", ifname);
+     }
+     /* Fill in hardware address and initialize the packet filter rules */
+     if (hwaddr == NULL) {
+-      rp_fatal("openInterface: no hwaddr arg.");
++      fatal("openInterface: no hwaddr arg.");
+     }
+     getHWaddr(sock, ifname, hwaddr);
+     initFilter(fd, type, hwaddr);
+@@ -342,58 +328,52 @@ openInterface(char const *ifname, UINT16
+ #if !defined(__OpenBSD__)
+     strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+     if (ioctl(sock, SIOCGIFMTU, &ifr) < 0) {
+-      fatalSys("ioctl(SIOCGIFMTU)");
++      fatal("ioctl(SIOCGIFMTU): %m");
+     }
+     if (ifr.ifr_mtu < ETH_DATA_LEN) {
+-      char buffer[256];
+-      sprintf(buffer, "Interface %.16s has MTU of %d -- should be %d.  You may have serious connection problems.",
++      error("Interface %s has MTU of %d -- should be %d."
++              "  You may have serious connection problems.",
+               ifname, ifr.ifr_mtu, ETH_DATA_LEN);
+-      printErr(buffer);
+     }
+ #endif
+     /* done with the socket */
+     if (close(sock) < 0) {
+-      fatalSys("close");
++      fatal("close: %m");
+     }
+     /* Check the BPF version number */
+     if (ioctl(fd, BIOCVERSION, &bpf_ver) < 0) {
+-      fatalSys("ioctl(BIOCVERSION)");
++      fatal("ioctl(BIOCVERSION): %m");
+     }
+     if ((bpf_ver.bv_major != BPF_MAJOR_VERSION) ||
+         (bpf_ver.bv_minor < BPF_MINOR_VERSION)) {
+-      char buffer[256];
+-      sprintf(buffer, "Unsupported BPF version: %d.%d (kernel: %d.%d)", 
++      fatal("Unsupported BPF version: %d.%d (kernel: %d.%d)",
+                       BPF_MAJOR_VERSION, BPF_MINOR_VERSION,
+                       bpf_ver.bv_major, bpf_ver.bv_minor);
+-      rp_fatal(buffer);
+     }
+     /* allocate a receive packet buffer */
+     if (ioctl(fd, BIOCGBLEN, &bpfLength) < 0) {
+-      fatalSys("ioctl(BIOCGBLEN)");
++      fatal("ioctl(BIOCGBLEN): %m");
+     }
+     if (!(bpfBuffer = (unsigned char *) malloc(bpfLength))) {
+-      rp_fatal("malloc");
++      fatal("malloc");
+     }
+     /* reads should return as soon as there is a packet available */
+     optval = 1;
+     if (ioctl(fd, BIOCIMMEDIATE, &optval) < 0) {
+-      fatalSys("ioctl(BIOCIMMEDIATE)");
++      fatal("ioctl(BIOCIMMEDIATE): %m");
+     }
+     /* Bind the interface to the filter */
+     strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+     if (ioctl(fd, BIOCSETIF, &ifr) < 0) {
+-      char buffer[256];
+-      sprintf(buffer, "ioctl(BIOCSETIF) can't select interface %.16s",
+-              ifname);
+-      rp_fatal(buffer);
++      fatal("ioctl(BIOCSETIF) can't select interface %s: %m", ifname);
+     }
+-    syslog(LOG_INFO, "Interface=%.16s HWaddr=%02X:%02X:%02X:%02X:%02X:%02X Device=%.32s Buffer size=%d",
++    info("Interface=%s HWaddr=%02X:%02X:%02X:%02X:%02X:%02X Device=%s Buffer size=%d",
+          ifname, 
+          hwaddr[0], hwaddr[1], hwaddr[2],
+          hwaddr[3], hwaddr[4], hwaddr[5],
+@@ -442,48 +422,41 @@ openInterface(char const *ifname, UINT16
+     if ((fd = socket(domain, stype, htons(type))) < 0) {
+       /* Give a more helpful message for the common error case */
+       if (errno == EPERM) {
+-          rp_fatal("Cannot create raw socket -- pppoe must be run as root.");
++          fatal("Cannot create raw socket -- pppoe must be run as root.");
+       }
+-      fatalSys("socket");
++      fatal("cannot create the raw socket: %m");
+     }
+     if (setsockopt(fd, SOL_SOCKET, SO_BROADCAST, &optval, sizeof(optval)) < 0) {
+-      fatalSys("setsockopt");
++      fatal("setsockopt(SOL_SOCKET, SO_BROADCAST): %m");
+     }
+     /* Fill in hardware address */
+     if (hwaddr) {
+       strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+-      if (ioctl(fd, SIOCGIFHWADDR, &ifr) < 0) {
+-          fatalSys("ioctl(SIOCGIFHWADDR)");
+-      }
++      if (ioctl(fd, SIOCGIFHWADDR, &ifr) < 0)
++          fatal("ioctl(SIOCGIFHWADDR): %m");
+       memcpy(hwaddr, ifr.ifr_hwaddr.sa_data, ETH_ALEN);
+ #ifdef ARPHRD_ETHER
+       if (ifr.ifr_hwaddr.sa_family != ARPHRD_ETHER) {
+-          char buffer[256];
+-          sprintf(buffer, "Interface %.16s is not Ethernet", ifname);
+-          rp_fatal(buffer);
++          fatal("Interface %s is not Ethernet", ifname);
+       }
+ #endif
+       if (NOT_UNICAST(hwaddr)) {
+-          char buffer[256];
+-          sprintf(buffer,
+-                  "Interface %.16s has broadcast/multicast MAC address??",
++          fatal("Interface %s has broadcast/multicast MAC address",
+                   ifname);
+-          rp_fatal(buffer);
+       }
+     }
+     /* Sanity check on MTU */
+     strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+     if (ioctl(fd, SIOCGIFMTU, &ifr) < 0) {
+-      fatalSys("ioctl(SIOCGIFMTU)");
++      fatal("ioctl(SIOCGIFMTU): %m");
+     }
+     if (ifr.ifr_mtu < ETH_DATA_LEN) {
+-      char buffer[256];
+-      sprintf(buffer, "Interface %.16s has MTU of %d -- should be %d.  You may have serious connection problems.",
++      error("Interface %s has MTU of %d -- should be %d."
++              "  You may have serious connection problems.",
+               ifname, ifr.ifr_mtu, ETH_DATA_LEN);
+-      printErr(buffer);
+     }
+ #ifdef HAVE_STRUCT_SOCKADDR_LL
+@@ -493,7 +466,7 @@ openInterface(char const *ifname, UINT16
+     strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+     if (ioctl(fd, SIOCGIFINDEX, &ifr) < 0) {
+-      fatalSys("ioctl(SIOCFIGINDEX): Could not get interface index");
++      fatal("ioctl(SIOCFIGINDEX): Could not get interface index: %m");
+     }
+     sa.sll_ifindex = ifr.ifr_ifindex;
+@@ -503,7 +476,7 @@ openInterface(char const *ifname, UINT16
+     /* We're only interested in packets on specified interface */
+     if (bind(fd, (struct sockaddr *) &sa, sizeof(sa)) < 0) {
+-      fatalSys("bind");
++      fatal("bind: %m");
+     }
+     return fd;
+@@ -527,13 +500,11 @@ sendPacket(PPPoEConnection *conn, int so
+ {
+ #if defined(USE_BPF)
+     if (write(sock, pkt, size) < 0) {
+-      sysErr("write (sendPacket)");
+-      return -1;
++      fatal("sendPacket: write: %m");
+     }
+ #elif defined(HAVE_STRUCT_SOCKADDR_LL)
+     if (send(sock, pkt, size, 0) < 0) {
+-      sysErr("send (sendPacket)");
+-      return -1;
++      fatal("sendPacket: send: %m");
+     }
+ #else
+ #ifdef USE_DLPI
+@@ -577,12 +548,11 @@ sendPacket(PPPoEConnection *conn, int so
+     struct sockaddr sa;
+     if (!conn) {
+-      rp_fatal("relay and server not supported on Linux 2.0 kernels");
++      fatal("relay and server not supported on Linux 2.0 kernels");
+     }
+     strcpy(sa.sa_data, conn->ifName);
+     if (sendto(sock, pkt, size, 0, &sa, sizeof(sa)) < 0) {
+-      sysErr("sendto (sendPacket)");
+-      return -1;
++      fatal("sendPacket: sendto: %m");
+     }
+ #endif
+ #endif
+@@ -632,26 +602,24 @@ receivePacket(int sock, PPPoEPacket *pkt
+     if (bpfSize <= 0) {
+       bpfOffset = 0;
+       if ((bpfSize = read(sock, bpfBuffer, bpfLength)) < 0) {
+-          sysErr("read (receivePacket)");
+-          return -1;
++          fatal("receivePacket: read: %m");
+       }
+     }
+     if (bpfSize < sizeof(hdr)) {
+-      syslog(LOG_ERR, "Truncated bpf packet header: len=%d", bpfSize);
++      error("Truncated bpf packet header: len=%d", bpfSize);
+       clearPacketHeader(pkt);         /* resets bpfSize and bpfOffset */
+       return 0;
+     }
+     memcpy(&hdr, bpfBuffer + bpfOffset, sizeof(hdr));
+     if (hdr.bh_caplen != hdr.bh_datalen) {
+-      syslog(LOG_ERR, "Truncated bpf packet: caplen=%d, datalen=%d",
++      error("Truncated bpf packet: caplen=%d, datalen=%d",
+              hdr.bh_caplen, hdr.bh_datalen);
+       clearPacketHeader(pkt);         /* resets bpfSize and bpfOffset */
+       return 0;
+     }
+     seglen = hdr.bh_hdrlen + hdr.bh_caplen;
+     if (seglen > bpfSize) {
+-      syslog(LOG_ERR, "Truncated bpf packet: seglen=%d, bpfSize=%d",
+-             seglen, bpfSize);
++      error("Truncated bpf packet: seglen=%d, bpfSize=%d", seglen, bpfSize);
+       clearPacketHeader(pkt);         /* resets bpfSize and bpfOffset */
+       return 0;
+     }
+@@ -676,16 +644,14 @@ receivePacket(int sock, PPPoEPacket *pkt
+       data.len = 0; 
+       
+       if ((retval = getmsg(sock, NULL, &data, &flags)) < 0) {
+-          sysErr("read (receivePacket)");
+-          return -1;
++          fatal("receivePacket: getmsg: %m");
+       }
+       *size = data.len; 
+ #else
+     if ((*size = recv(sock, pkt, sizeof(PPPoEPacket), 0)) < 0) {
+-      sysErr("recv (receivePacket)");
+-      return -1;
++      fatal("receivePacket: recv: %m");
+     }
+ #endif
+ #endif
+@@ -716,7 +682,7 @@ openInterface(char const *ifname, UINT16
+     int ppa; 
+     if(strlen(ifname) > PATH_MAX) {
+-      rp_fatal("socket: string to long"); 
++      fatal("openInterface: interface name too long");
+     }
+     ppa = atoi(&ifname[strlen(ifname)-1]);
+@@ -729,9 +695,9 @@ openInterface(char const *ifname, UINT16
+     if (( fd = open(base_dev, O_RDWR)) < 0) {
+       /* Give a more helpful message for the common error case */
+       if (errno == EPERM) {
+-          rp_fatal("Cannot create raw socket -- pppoe must be run as root.");
++          fatal("Cannot create raw socket -- pppoe must be run as root.");
+       }
+-      fatalSys("socket");
++      fatal("open(%s): %m", base_dev);
+     }
+ /* rearranged order of DLPI code - delphys 20010803 */
+@@ -747,17 +713,18 @@ openInterface(char const *ifname, UINT16
+     dl_abssaplen = ABS(dlp->info_ack.dl_sap_length);
+     dl_saplen = dlp->info_ack.dl_sap_length;
+     if (ETHERADDRL != (dlp->info_ack.dl_addr_length - dl_abssaplen))
+-      fatalSys("invalid destination physical address length");
++      fatal("invalid destination physical address length");
+     dl_addrlen = dl_abssaplen + ETHERADDRL;
+ /* ethernet address retrieved as part of DL_INFO_ACK - delphys 20010803 */
+     memcpy(hwaddr, (u_char*)((char*)(dlp) + (int)(dlp->info_ack.dl_addr_offset)), ETHERADDRL);
+     if ( strioctl(fd, DLIOCRAW, -1, 0, NULL) < 0 ) { 
+-      fatalSys("DLIOCRAW"); 
++      fatal("DLIOCRAW: %m");
+     }
+-    if (ioctl(fd, I_FLUSH, FLUSHR) < 0) fatalSys("I_FLUSH");
++    if (ioctl(fd, I_FLUSH, FLUSHR) < 0)
++      fatal("I_FLUSH: %m");
+     return fd;
+ }
+@@ -780,7 +747,7 @@ void dlpromisconreq(int fd, u_long level
+         flags = 0;
+         if (putmsg(fd, &ctl, (struct strbuf*) NULL, flags) < 0)
+-                fatalSys("dlpromiscon:  putmsg");
++                fatal("dlpromiscon: putmsg: %m");
+ }
+@@ -799,7 +766,7 @@ void dlinforeq(int fd)
+         flags = RS_HIPRI;
+         if (putmsg(fd, &ctl, (struct strbuf*) NULL, flags) < 0)
+-                fatalSys("dlinforeq:  putmsg");
++                fatal("dlinforeq: putmsg: %m");
+ }
+ void dlunitdatareq(int fd, u_char *addrp, int addrlen, u_long minpri, u_long maxpri, u_char *datap, int datalen)
+@@ -827,7 +794,7 @@ void dlunitdatareq(int fd, u_char *addrp
+         data.buf = (char *) datap;
+         if (putmsg(fd, &ctl, &data, 0) < 0)
+-                fatalSys("dlunitdatareq:  putmsg");
++                fatal("dlunitdatareq: putmsg: %m");
+ }
+ void dlinfoack(int fd, char *bufp)
+@@ -847,18 +814,14 @@ void dlinfoack(int fd, char *bufp)
+         expecting(DL_INFO_ACK, dlp);
+         if (ctl.len < sizeof (dl_info_ack_t)) {
+-              char buffer[256];
+-              sprintf(buffer, "dlinfoack:  response ctl.len too short:  %d", ctl.len); 
+-                rp_fatal(buffer); 
++              fatal("dlinfoack: response ctl.len too short: %d", ctl.len);
+       }
+         if (flags != RS_HIPRI)
+-                rp_fatal("dlinfoack:  DL_INFO_ACK was not M_PCPROTO");
++                fatal("dlinfoack: DL_INFO_ACK was not M_PCPROTO");
+         if (ctl.len < sizeof (dl_info_ack_t)) {
+-              char buffer[256];
+-              sprintf(buffer, "dlinfoack:  short response ctl.len:  %d", ctl.len); 
+-              rp_fatal(buffer); 
++              fatal("dlinfoack: short response ctl.len: %d", ctl.len);
+       }
+ }
+@@ -882,7 +845,7 @@ void dlbindreq(int fd, u_long sap, u_lon
+         flags = 0;
+         if (putmsg(fd, &ctl, (struct strbuf*) NULL, flags) < 0)
+-                fatalSys("dlbindreq:  putmsg");
++                fatal("dlbindreq: putmsg: %m");
+ }
+ void dlattachreq(int fd, u_long ppa)
+@@ -901,7 +864,7 @@ void dlattachreq(int fd, u_long ppa)
+         flags = 0;
+         if (putmsg(fd, &ctl, (struct strbuf*) NULL, flags) < 0)
+-                fatalSys("dlattachreq:  putmsg");
++                fatal("dlattachreq: putmsg: %m");
+ }
+ void dlokack(int fd, char *bufp)
+@@ -921,18 +884,14 @@ void dlokack(int fd, char *bufp)
+         expecting(DL_OK_ACK, dlp);
+         if (ctl.len < sizeof (dl_ok_ack_t)) { 
+-              char buffer[256];
+-              sprintf(buffer, "dlokack:  response ctl.len too short:  %d", ctl.len);
+-              rp_fatal(buffer); 
++              fatal("dlokack: response ctl.len too short: %d", ctl.len);
+       }
+         if (flags != RS_HIPRI)
+-                rp_fatal("dlokack:  DL_OK_ACK was not M_PCPROTO");
++                fatal("dlokack: DL_OK_ACK was not M_PCPROTO");
+         if (ctl.len < sizeof (dl_ok_ack_t)) {
+-              char buffer[256]; 
+-              sprintf(buffer, "dlokack:  short response ctl.len:  %d", ctl.len);
+-              rp_fatal(buffer); 
++              fatal("dlokack: short response ctl.len: %d", ctl.len);
+       }
+ }
+@@ -953,12 +912,10 @@ void dlbindack(int fd, char *bufp)
+         expecting(DL_BIND_ACK, dlp);
+         if (flags != RS_HIPRI)
+-                rp_fatal("dlbindack:  DL_OK_ACK was not M_PCPROTO");
++                fatal("dlbindack: DL_OK_ACK was not M_PCPROTO");
+         if (ctl.len < sizeof (dl_bind_ack_t)) {
+-              char buffer[256];
+-              sprintf(buffer, "dlbindack:  short response ctl.len:  %d", ctl.len);
+-              rp_fatal(buffer); 
++              fatal("dlbindack: short response ctl.len: %d", ctl.len);
+       }
+ }
+@@ -989,8 +946,7 @@ void strgetmsg(int fd, struct strbuf *ct
+          */
+         (void) signal(SIGALRM, sigalrm);
+         if (alarm(MAXWAIT) < 0) {
+-                (void) sprintf(errmsg, "%s:  alarm", caller);
+-                fatalSys(errmsg);
++                fatal("%s: alarm", caller);
+         }
+         /*
+@@ -998,61 +954,48 @@ void strgetmsg(int fd, struct strbuf *ct
+          */
+         *flagsp = 0;
+         if ((rc = getmsg(fd, ctlp, datap, flagsp)) < 0) {
+-                (void) sprintf(errmsg, "%s:  getmsg", caller);
+-                fatalSys(errmsg);
++                fatal(errmsg, "%s: getmsg: %m", caller);
+         }
+         /*
+          * Stop timer.
+          */
+         if (alarm(0) < 0) {
+-                (void) sprintf(errmsg, "%s:  alarm", caller);
+-                fatalSys(errmsg);
++                fatal("%s: alarm", caller);
+         }
+         /*
+          * Check for MOREDATA and/or MORECTL.
+          */
+         if ((rc & (MORECTL | MOREDATA)) == (MORECTL | MOREDATA)) {
+-              char buffer[256]; 
+-              sprintf(buffer, "%s:  MORECTL|MOREDATA", caller);
+-              rp_fatal(buffer);
++              fatal("%s: MORECTL|MOREDATA", caller);
+       }
+                 
+         if (rc & MORECTL) {
+-              char buffer[256];
+-              sprintf(buffer, "%s:  MORECTL", caller);
+-              rp_fatal(buffer); 
++              fatal("%s: MORECTL", caller);
+       }
+         
+         if (rc & MOREDATA) {
+-              char buffer[256]; 
+-              sprintf(buffer, "%s:  MOREDATA", caller);
+-              rp_fatal(buffer);
++              fatal("%s: MOREDATA", caller);
+       }
+         /*
+          * Check for at least sizeof (long) control data portion.
+          */
+         if (ctlp->len < sizeof (long)) {
+-              char buffer[256]; 
+-              sprintf(buffer, "getmsg:  control portion length < sizeof (long):  %d", ctlp->len);
+-              rp_fatal(buffer); 
++              fatal("getmsg: control portion length < sizeof (long): %d", ctlp->len);
+       }
+ }
+ void sigalrm(int sig)
+ {
+-        (void) rp_fatal("sigalrm:  TIMEOUT");
++        fatal("sigalrm: TIMEOUT");
+ }
+ void expecting(int prim, union DL_primitives *dlp)
+ {
+         if (dlp->dl_primitive != (u_long)prim) {
+-              char buffer[256]; 
+-              sprintf(buffer, "expected %s got %s", dlprim(prim), dlprim(dlp->dl_primitive));
+-              rp_fatal(buffer); 
+-              exit(1); 
++              fatal("expected %s got %s", dlprim(prim), dlprim(dlp->dl_primitive));
+       }
+ }
+diff -ruNp ppp-2.4.3.orig/pppd/plugins/rp-pppoe/Makefile.linux ppp-2.4.3/pppd/plugins/rp-pppoe/Makefile.linux
+--- ppp-2.4.3.orig/pppd/plugins/rp-pppoe/Makefile.linux        2004-11-14 08:58:37.000000000 +0100
++++ ppp-2.4.3/pppd/plugins/rp-pppoe/Makefile.linux     2005-03-11 01:48:27.000000000 +0100
+@@ -28,8 +28,8 @@ COPTS=-O2 -g
+ CFLAGS=$(COPTS) -I../../../include/linux
+ all: rp-pppoe.so pppoe-discovery
+-pppoe-discovery: libplugin.a pppoe-discovery.o
+-      $(CC) -o pppoe-discovery pppoe-discovery.o libplugin.a
++pppoe-discovery: pppoe-discovery.o utils.o libplugin.a
++      $(CC) -o pppoe-discovery pppoe-discovery.o utils.o libplugin.a
+ pppoe-discovery.o: pppoe-discovery.c
+       $(CC) $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o pppoe-discovery.o pppoe-discovery.c
+diff -ruNp ppp-2.4.3.orig/pppd/plugins/rp-pppoe/plugin.c ppp-2.4.3/pppd/plugins/rp-pppoe/plugin.c
+--- ppp-2.4.3.orig/pppd/plugins/rp-pppoe/plugin.c      2004-11-04 11:07:37.000000000 +0100
++++ ppp-2.4.3/pppd/plugins/rp-pppoe/plugin.c   2005-03-11 02:12:39.000000000 +0100
+@@ -35,7 +35,6 @@ static char const RCSID[] =
+ #include "pppd/pathnames.h"
+ #include <linux/types.h>
+-#include <syslog.h>
+ #include <sys/ioctl.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
+@@ -173,10 +172,8 @@ PPPOEConnectDevice(void)
+           (unsigned) conn->peerEth[5]);
+     if (connect(conn->sessionSocket, (struct sockaddr *) &sp,
+-              sizeof(struct sockaddr_pppox)) < 0) {
++              sizeof(struct sockaddr_pppox)) < 0)
+       fatal("Failed to connect PPPoE socket: %d %m", errno);
+-      return -1;
+-    }
+     return conn->sessionSocket;
+ }
+@@ -365,11 +362,9 @@ plugin_init(void)
+     }
+     add_options(Options);
+-
+-    info("RP-PPPoE plugin version %s compiled against pppd %s",
+-       RP_VERSION, VERSION);
+ }
++#ifdef unused
+ /**********************************************************************
+ *%FUNCTION: fatalSys
+ *%ARGUMENTS:
+@@ -423,6 +418,7 @@ sysErr(char const *str)
+ {
+     rp_fatal(str);
+ }
++#endif
+ struct channel pppoe_channel = {
+diff -ruNp ppp-2.4.3.orig/pppd/plugins/rp-pppoe/pppoe-discovery.c ppp-2.4.3/pppd/plugins/rp-pppoe/pppoe-discovery.c
+--- ppp-2.4.3.orig/pppd/plugins/rp-pppoe/pppoe-discovery.c     2004-11-13 13:12:05.000000000 +0100
++++ ppp-2.4.3/pppd/plugins/rp-pppoe/pppoe-discovery.c  2005-03-11 02:06:13.000000000 +0100
+@@ -17,14 +17,8 @@
+ #include "pppoe.h"
+-char *xstrdup(const char *s);
+ void usage(void);
+-void die(int status)
+-{
+-      exit(status);
+-}
+-
+ int main(int argc, char *argv[])
+ {
+     int opt;
+@@ -32,17 +26,17 @@ int main(int argc, char *argv[])
+     conn = malloc(sizeof(PPPoEConnection));
+     if (!conn)
+-      fatalSys("malloc");
++      fatal("malloc");
+     memset(conn, 0, sizeof(PPPoEConnection));
+     while ((opt = getopt(argc, argv, "I:D:VUAS:C:h")) > 0) {
+       switch(opt) {
+       case 'S':
+-          conn->serviceName = xstrdup(optarg);
++          conn->serviceName = strDup(optarg);
+           break;
+       case 'C':
+-          conn->acName = xstrdup(optarg);
++          conn->acName = strDup(optarg);
+           break;
+       case 'U':
+           conn->useHostUniq = 1;
+@@ -57,7 +51,7 @@ int main(int argc, char *argv[])
+           fprintf(conn->debugFile, "pppoe-discovery %s\n", VERSION);
+           break;
+       case 'I':
+-          conn->ifName = xstrdup(optarg);
++          conn->ifName = strDup(optarg);
+           break;
+       case 'A':
+           /* this is the default */
+@@ -74,7 +68,7 @@ int main(int argc, char *argv[])
+     /* default interface name */
+     if (!conn->ifName)
+-      conn->ifName = strdup("eth0");
++      conn->ifName = strDup("eth0");
+     conn->discoverySocket = -1;
+     conn->sessionSocket = -1;
+@@ -84,39 +78,6 @@ int main(int argc, char *argv[])
+     exit(0);
+ }
+-void rp_fatal(char const *str)
+-{
+-    char buf[1024];
+-
+-    printErr(str);
+-    sprintf(buf, "pppoe-discovery: %.256s", str);
+-    exit(1);
+-}
+-
+-void fatalSys(char const *str)
+-{
+-    char buf[1024];
+-    int i = errno;
+-
+-    sprintf(buf, "%.256s: %.256s", str, strerror(i));
+-    printErr(buf);
+-    sprintf(buf, "pppoe-discovery: %.256s: %.256s", str, strerror(i));
+-    exit(1);
+-}
+-
+-void sysErr(char const *str)
+-{
+-    rp_fatal(str);
+-}
+-
+-char *xstrdup(const char *s)
+-{
+-    register char *ret = strdup(s);
+-    if (!ret)
+-      sysErr("strdup");
+-    return ret;
+-}
+-
+ void usage(void)
+ {
+     fprintf(stderr, "Usage: pppoe-discovery [options]\n");
+diff -ruNp ppp-2.4.3.orig/pppd/plugins/rp-pppoe/pppoe.h ppp-2.4.3/pppd/plugins/rp-pppoe/pppoe.h
+--- ppp-2.4.3.orig/pppd/plugins/rp-pppoe/pppoe.h       2004-11-04 11:07:37.000000000 +0100
++++ ppp-2.4.3/pppd/plugins/rp-pppoe/pppoe.h    2005-03-11 02:08:00.000000000 +0100
+@@ -307,12 +307,18 @@ void discovery(PPPoEConnection *conn);
+ unsigned char *findTag(PPPoEPacket *packet, UINT16_t tagType,
+                      PPPoETag *tag);
++void dbglog(char *, ...);     /* log a debug message */
++void info(char *, ...);               /* log an informational message */
++void warn(char *, ...);               /* log a warning message */
++void error(char *, ...);      /* log an error message */
++void fatal(char *, ...);      /* log an error message and die(1) */
++
+ #define SET_STRING(var, val) do { if (var) free(var); var = strDup(val); } while(0);
+ #define CHECK_ROOM(cursor, start, len) \
+ do {\
+     if (((cursor)-(start))+(len) > MAX_PPPOE_PAYLOAD) { \
+-        syslog(LOG_ERR, "Would create too-long packet"); \
++        error("Would create too-long packet"); \
+         return; \
+     } \
+ } while(0)
+diff -ruNp ppp-2.4.3.orig/pppd/plugins/rp-pppoe/utils.c ppp-2.4.3/pppd/plugins/rp-pppoe/utils.c
+--- ppp-2.4.3.orig/pppd/plugins/rp-pppoe/utils.c       1970-01-01 01:00:00.000000000 +0100
++++ ppp-2.4.3/pppd/plugins/rp-pppoe/utils.c    2005-03-11 02:07:57.000000000 +0100
+@@ -0,0 +1,62 @@
++#include <stdio.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <stdarg.h>
++#include <syslog.h>
++
++void dbglog(const char *fmt, ...)
++{
++    va_list ap;
++
++    va_start(ap, fmt);
++    vsyslog(LOG_DEBUG, fmt, ap);
++    vfprintf(stderr, fmt, ap);
++    fputs("\n", stderr);
++    va_end(ap);
++}
++
++void info(const char *fmt, ...)
++{
++    va_list ap;
++
++    va_start(ap, fmt);
++    vsyslog(LOG_INFO, fmt, ap);
++    vfprintf(stderr, fmt, ap);
++    fputs("\n", stderr);
++    va_end(ap);
++}
++
++void warn(const char *fmt, ...)
++{
++    va_list ap;
++
++    va_start(ap, fmt);
++    vsyslog(LOG_WARNING, fmt, ap);
++    vfprintf(stderr, fmt, ap);
++    fputs("\n", stderr);
++    va_end(ap);
++}
++
++void error(const char *fmt, ...)
++{
++    va_list ap;
++
++    va_start(ap, fmt);
++    vsyslog(LOG_ERR, fmt, ap);
++    vfprintf(stderr, fmt, ap);
++    fputs("\n", stderr);
++    va_end(ap);
++}
++
++void fatal(const char *fmt, ...)
++{
++    va_list ap;
++
++    va_start(ap, fmt);
++    vsyslog(LOG_ERR, fmt, ap);
++    vfprintf(stderr, fmt, ap);
++    fputs("\n", stderr);
++    va_end(ap);
++    exit(1);
++}
++
diff --git a/openwrt/package/ppp/patches/104-debian_fix_linkpidfile.patch b/openwrt/package/ppp/patches/104-debian_fix_linkpidfile.patch
new file mode 100644 (file)
index 0000000..9e32adc
--- /dev/null
@@ -0,0 +1,43 @@
+Subject: Bug#284382: ppp: linkpidfile is not created upon detachment
+From: <herbert@gondor.apana.org.au>
+
+Package: ppp
+Version: 2.4.2+20040428-2
+Severity: wishlist
+
+When pppd detaches from the parent normally, that is, without nodetach
+or updetach set, the linkpidfile is not created even when linkname is
+set.
+
+This is because the create_linkpidfile call in detach() is only made
+if the linkpidfile is filled in.  However, linkpidfile is never filled
+in until create_linkpidfile has been called.
+
+IMHO the call should be made uncondtionally in detach() since
+create_linkpidfile does its own check on linkname anyway.
+
+Please note that the version of pppd in woody always wrote the
+linkpidfile after detaching.  It did so in main() however.  That
+call has now been removed which is why I'm seeing this problem.
+
+[...]
+
+--
+Index: pppd/main.c
+===================================================================
+RCS file: /var/cvs/snwb/packages/ppp/pppd/main.c,v
+retrieving revision 1.11
+diff -u -r1.11 main.c
+--- ppp/pppd/main.c    29 Nov 2004 22:49:23 -0000      1.11
++++ ppp/pppd/main.c    5 Dec 2004 23:59:58 -0000
+@@ -819,8 +819,7 @@
+       /* update pid files if they have been written already */
+       if (pidfilename[0])
+           create_pidfile(pid);
+-      if (linkpidfile[0])
+-          create_linkpidfile(pid);
++      create_linkpidfile(pid);
+       exit(0);                /* parent dies */
+     }
+     setsid();
+
diff --git a/openwrt/package/ppp/patches/105-debian_pppoatm_cleanup.patch b/openwrt/package/ppp/patches/105-debian_pppoatm_cleanup.patch
new file mode 100644 (file)
index 0000000..2437a12
--- /dev/null
@@ -0,0 +1,95 @@
+diff -ruNp ppp-2.4.3.orig/pppd/plugins/pppoatm/pppoatm.c ppp-2.4.3/pppd/plugins/pppoatm/pppoatm.c
+--- ppp-2.4.3.orig/pppd/plugins/pppoatm/pppoatm.c      2005-03-22 14:44:18.000000000 +0100
++++ ppp-2.4.3/pppd/plugins/pppoatm/pppoatm.c   2005-03-22 14:44:02.000000000 +0100
+@@ -70,18 +70,20 @@ static int setdevname_pppoatm(const char
+ {
+       struct sockaddr_atmpvc addr;
+       extern struct stat devstat;
++
+       if (device_got_set)
+               return 0;
+-      //info("PPPoATM setdevname_pppoatm: '%s'", cp);
++
+       memset(&addr, 0, sizeof addr);
+       if (text2atm(cp, (struct sockaddr *) &addr, sizeof(addr),
+           T2A_PVC | T2A_NAME) < 0) {
+-               if(doit)
+-                   info("atm does not recognize: %s", cp);
++              if (doit)
++                      info("cannot parse the ATM address: %s", cp);
+               return 0;
+-           }
+-      if (!doit) return 1;
+-      //if (!dev_set_ok()) return -1;
++      }
++      if (!doit)
++              return 1;
++
+       memcpy(&pvcaddr, &addr, sizeof pvcaddr);
+       strlcpy(devnam, cp, sizeof devnam);
+       devstat.st_mode = S_IFSOCK;
+@@ -93,7 +95,6 @@ static int setdevname_pppoatm(const char
+               lcp_allowoptions[0].neg_asyncmap = 0;
+               lcp_wantoptions[0].neg_pcompression = 0;
+       }
+-      info("PPPoATM setdevname_pppoatm - SUCCESS:%s", cp);
+       device_got_set = 1;
+       return 1;
+ }
+@@ -108,6 +109,7 @@ static void no_device_given_pppoatm(void
+ static void set_line_discipline_pppoatm(int fd)
+ {
+       struct atm_backend_ppp be;
++
+       be.backend_num = ATM_BACKEND_PPP;
+       if (!llc_encaps)
+               be.encaps = PPPOATM_ENCAPS_VC;
+@@ -115,6 +117,7 @@ static void set_line_discipline_pppoatm(
+               be.encaps = PPPOATM_ENCAPS_LLC;
+       else
+               be.encaps = PPPOATM_ENCAPS_AUTODETECT;
++
+       if (ioctl(fd, ATM_SETBACKEND, &be) < 0)
+               fatal("ioctl(ATM_SETBACKEND): %m");
+ }
+@@ -179,16 +182,19 @@ static void send_config_pppoa(int mtu,
+ {
+       int sock;
+       struct ifreq ifr;
++
+       if (mtu > pppoatm_max_mtu)
+               error("Couldn't increase MTU to %d", mtu);
++
+       sock = socket(AF_INET, SOCK_DGRAM, 0);
+       if (sock < 0)
+               fatal("Couldn't create IP socket: %m");
++
+       strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+       ifr.ifr_mtu = mtu;
+       if (ioctl(sock, SIOCSIFMTU, (caddr_t) &ifr) < 0)
+               fatal("ioctl(SIOCSIFMTU): %m");
+-      (void) close (sock);
++      close(sock);
+ }
+ static void recv_config_pppoa(int mru,
+@@ -202,7 +208,7 @@ static void recv_config_pppoa(int mru,
+ void plugin_init(void)
+ {
+-#if defined(__linux__)
++#ifdef linux
+       extern int new_style_driver;    /* From sys-linux.c */
+       if (!ppp_available() && !new_style_driver)
+               fatal("Kernel doesn't support ppp_generic - "
+@@ -210,9 +216,9 @@ void plugin_init(void)
+ #else
+       fatal("No PPPoATM support on this OS");
+ #endif
+-      info("PPPoATM plugin_init");
+       add_options(pppoa_options);
+ }
++
+ struct channel pppoa_channel = {
+     options: pppoa_options,
+     process_extra_options: NULL,
diff --git a/openwrt/package/ppp/patches/106-debian_pppoatm_fix_mtu.patch b/openwrt/package/ppp/patches/106-debian_pppoatm_fix_mtu.patch
new file mode 100644 (file)
index 0000000..ef28b5c
--- /dev/null
@@ -0,0 +1,31 @@
+diff -ruNp ppp-2.4.3.orig/pppd/plugins/pppoatm/pppoatm.c ppp-2.4.3/pppd/plugins/pppoatm/pppoatm.c
+--- ppp-2.4.3.orig/pppd/plugins/pppoatm/pppoatm.c      2005-05-04 02:00:28.000000000 +0200
++++ ppp-2.4.3/pppd/plugins/pppoatm/pppoatm.c   2005-05-04 01:59:11.000000000 +0200
+@@ -183,8 +183,11 @@ static void send_config_pppoa(int mtu,
+       int sock;
+       struct ifreq ifr;
+-      if (mtu > pppoatm_max_mtu)
+-              error("Couldn't increase MTU to %d", mtu);
++      if (pppoatm_max_mtu && mtu > pppoatm_max_mtu) {
++              warn("Couldn't increase MTU to %d. Using %d",
++                      mtu, pppoatm_max_mtu);
++              mtu = pppoatm_max_mtu;
++      }
+       sock = socket(AF_INET, SOCK_DGRAM, 0);
+       if (sock < 0)
+@@ -202,8 +205,11 @@ static void recv_config_pppoa(int mru,
+                             int pcomp,
+                             int accomp)
+ {
+-      if (mru > pppoatm_max_mru)
+-              error("Couldn't increase MRU to %d", mru);
++      if (pppoatm_max_mru && mru > pppoatm_max_mru) {
++              warn("Couldn't increase MRU to %d. Using %d",
++                      mru, pppoatm_max_mru);
++              mru = pppoatm_max_mru;
++      }
+ }
+ void plugin_init(void)
diff --git a/openwrt/package/ppp/patches/107-debian_stripMSdomain.patch b/openwrt/package/ppp/patches/107-debian_stripMSdomain.patch
new file mode 100644 (file)
index 0000000..d52e386
--- /dev/null
@@ -0,0 +1,35 @@
+diff -ruN ppp.orig/pppd/chap-new.c ppp/pppd/chap-new.c
+--- ppp.orig/pppd/chap-new.c   2003-11-27 23:25:17.000000000 +0100
++++ ppp/pppd/chap-new.c        2003-12-02 12:26:21.000000000 +0100
+@@ -57,6 +57,7 @@
+ int chap_timeout_time = 3;
+ int chap_max_transmits = 10;
+ int chap_rechallenge_time = 0;
++int chapms_strip_domain = 0;
+ /*
+  * Command-line options.
+@@ -68,6 +69,8 @@
+         "Set max #xmits for challenge", OPT_PRIO },
+       { "chap-interval", o_int, &chap_rechallenge_time,
+         "Set interval for rechallenge", OPT_PRIO },
++      { "chapms-strip-domain", o_bool, &chapms_strip_domain,
++        "Strip the domain prefix before the Username", 1 },
+       { NULL }
+ };
+@@ -338,6 +341,14 @@
+                       /* Null terminate and clean remote name. */
+                       slprintf(rname, sizeof(rname), "%.*v", len, name);
+                       name = rname;
++
++                      /* strip the MS domain name */
++                      if (chapms_strip_domain && strrchr(rname, '\\')) {
++                              char tmp[MAXNAMELEN+1];
++
++                              strcpy(tmp, strrchr(rname, '\\') + 1);
++                              strcpy(rname, tmp);
++                      }
+               }
+               if (chap_verify_hook)
diff --git a/openwrt/package/ppp/patches/108-debian_defaultroute.patch b/openwrt/package/ppp/patches/108-debian_defaultroute.patch
new file mode 100644 (file)
index 0000000..76b444e
--- /dev/null
@@ -0,0 +1,253 @@
+--- ppp/pppd/ipcp.c    Wed May 31 17:20:41 2000
++++ ppp/pppd/ipcp.c    Wed May 31 17:27:19 2000
+@@ -145,7 +145,17 @@
+     { "-defaultroute", o_bool, &ipcp_allowoptions[0].default_route,
+       "disable defaultroute option", OPT_A2COPY,
+       &ipcp_wantoptions[0].default_route },
+
++#ifdef __linux__
++    { "replacedefaultroute", o_bool,
++                              &ipcp_wantoptions[0].replace_default_route,
++      "Replace default route", 1
++    },
++    { "noreplacedefaultroute", o_bool,
++                              &ipcp_allowoptions[0].replace_default_route,
++      "Never replace default route", OPT_A2COPY,
++                              &ipcp_wantoptions[0].replace_default_route },
++#endif
+     { "proxyarp", o_bool, &ipcp_wantoptions[0].proxy_arp,
+       "Add proxy ARP entry", OPT_ENABLE|1, &ipcp_allowoptions[0].proxy_arp },
+     { "noproxyarp", o_bool, &ipcp_allowoptions[0].proxy_arp,
+@@ -195,7 +205,7 @@
+     ip_active_pkt
+ };
+-static void ipcp_clear_addrs __P((int, u_int32_t, u_int32_t));
++static void ipcp_clear_addrs __P((int, u_int32_t, u_int32_t, bool));
+ static void ipcp_script __P((char *));                /* Run an up/down script */
+ static void ipcp_script_done __P((void *));
+@@ -1344,7 +1354,12 @@
+     if (!sifnpmode(u, PPP_IP, NPMODE_QUEUE))
+       return 0;
+     if (wo->default_route)
++#ifndef __linux__
+       if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr))
++#else
++      if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr,
++                                          wo->replace_default_route))
++#endif
+           default_route_set[u] = 1;
+     if (wo->proxy_arp)
+       if (sifproxyarp(u, wo->hisaddr))
+@@ -1420,7 +1435,8 @@
+      */
+     if (demand) {
+       if (go->ouraddr != wo->ouraddr || ho->hisaddr != wo->hisaddr) {
+-          ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr);
++          ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr,
++                                    wo->replace_default_route);
+           if (go->ouraddr != wo->ouraddr) {
+               warn("Local IP address changed to %I", go->ouraddr);
+               script_setenv("OLDIPLOCAL", ip_ntoa(wo->ouraddr));
+@@ -1445,7 +1461,12 @@
+           /* assign a default route through the interface if required */
+           if (ipcp_wantoptions[f->unit].default_route) 
++#ifndef __linux__
+               if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr))
++#else
++              if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr,
++                                           wo->replace_default_route))
++#endif
+                   default_route_set[f->unit] = 1;
+           /* Make a proxy ARP entry if requested. */
+@@ -1492,7 +1513,12 @@
+       /* assign a default route through the interface if required */
+       if (ipcp_wantoptions[f->unit].default_route) 
++#ifndef __linux__
+           if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr))
++#else
++          if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr,
++                                       wo->replace_default_route))
++#endif
+               default_route_set[f->unit] = 1;
+       /* Make a proxy ARP entry if requested. */
+@@ -1559,7 +1585,7 @@
+       sifnpmode(f->unit, PPP_IP, NPMODE_DROP);
+       sifdown(f->unit);
+       ipcp_clear_addrs(f->unit, ipcp_gotoptions[f->unit].ouraddr,
+-                       ipcp_hisoptions[f->unit].hisaddr);
++                       ipcp_hisoptions[f->unit].hisaddr, 0);
+     }
+     /* Execute the ip-down script */
+@@ -1575,16 +1601,25 @@
+  * proxy arp entries, etc.
+  */
+ static void
+-ipcp_clear_addrs(unit, ouraddr, hisaddr)
++ipcp_clear_addrs(unit, ouraddr, hisaddr, replacedefaultroute)
+     int unit;
+     u_int32_t ouraddr;  /* local address */
+     u_int32_t hisaddr;  /* remote address */
++    bool replacedefaultroute;
+ {
+     if (proxy_arp_set[unit]) {
+       cifproxyarp(unit, hisaddr);
+       proxy_arp_set[unit] = 0;
+     }
+-    if (default_route_set[unit]) {
++    /* If replacedefaultroute, sifdefaultroute will be called soon
++     * with replacedefaultroute set and that will overwrite the current
++     * default route. This is the case only when doing demand, otherwise
++     * during demand, this cifdefaultroute would restore the old default
++     * route which is not what we want in this case. In the non-demand
++     * case, we'll delete the default route and restore the old if there
++     * is one saved by an sifdefaultroute with replacedefaultroute.
++     */
++    if (!replacedefaultroute && default_route_set[unit]) {
+       cifdefaultroute(unit, ouraddr, hisaddr);
+       default_route_set[unit] = 0;
+     }
+--- ppp/pppd/ipcp.h    Wed May 31 17:20:41 2000
++++ ppp/pppd/ipcp.h    Wed May 31 15:56:17 2000
+@@ -47,6 +47,7 @@
+     bool old_addrs;           /* Use old (IP-Addresses) option? */
+     bool req_addr;            /* Ask peer to send IP address? */
+     bool default_route;               /* Assign default route through interface? */
++    bool replace_default_route;       /* Replace default route through interface? */
+     bool proxy_arp;           /* Make proxy ARP entry for peer? */
+     bool neg_vj;              /* Van Jacobson Compression? */
+     bool old_vj;              /* use old (short) form of VJ option? */
+--- ppp/pppd/pppd.h    Wed May 31 17:20:41 2000
++++ ppp/pppd/pppd.h    Wed May 31 15:56:17 2000
+@@ -416,7 +416,11 @@
+ int  cif6addr __P((int, eui64_t, eui64_t));
+                               /* Remove an IPv6 address from i/f */
+ #endif
++#ifndef __linux__
+ int  sifdefaultroute __P((int, u_int32_t, u_int32_t));
++#else
++int  sifdefaultroute __P((int, u_int32_t, u_int32_t, bool replace_default_rt));
++#endif
+                               /* Create default route through i/f */
+ int  cifdefaultroute __P((int, u_int32_t, u_int32_t));
+                               /* Delete default route through i/f */
+--- ppp/pppd/sys-linux.c       Wed May 31 17:20:41 2000
++++ ppp/pppd/sys-linux.c       Wed May 31 17:37:23 2000
+@@ -143,6 +143,8 @@
+ static int    if_is_up;       /* Interface has been marked up */
+ static u_int32_t default_route_gateway;       /* Gateway for default route added */
++static struct rtentry old_def_rt;       /* Old default route */
++static int       default_rt_repl_rest;  /* replace and restore old default rt */
+ static u_int32_t proxy_arp_addr;      /* Addr for proxy arp entry added */
+ static char proxy_arp_dev[16];                /* Device for proxy arp entry */
+ static u_int32_t our_old_addr;                /* for detecting address changes */
+@@ -1209,6 +1211,9 @@
+       p = NULL;
+     }
++    SET_SA_FAMILY (rt->rt_dst,     AF_INET);
++    SET_SA_FAMILY (rt->rt_gateway, AF_INET);
++
+     SIN_ADDR(rt->rt_dst) = strtoul(cols[route_dest_col], NULL, 16);
+     SIN_ADDR(rt->rt_gateway) = strtoul(cols[route_gw_col], NULL, 16);
+     SIN_ADDR(rt->rt_genmask) = strtoul(cols[route_mask_col], NULL, 16);
+@@ -1278,19 +1283,53 @@
+ /********************************************************************
+  *
+  * sifdefaultroute - assign a default route through the address given.
++ *
++ * If the global default_rt_repl_rest flag is set, then this function
++ * already replaced the original system defaultroute with some other
++ * route and it should just replace the current defaultroute with
++ * another one, without saving the current route. Use: demand mode,
++ * when pppd sets first a defaultroute it it's temporary ppp0 addresses
++ * and then changes the temporary addresses to the addresses for the real
++ * ppp connection when it has come up.
+  */
+-int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway)
++int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway, bool replace)
+ {
+-    struct rtentry rt;
+-
+-    if (defaultroute_exists(&rt) && strcmp(rt.rt_dev, ifname) != 0) {
+-      u_int32_t old_gateway = SIN_ADDR(rt.rt_gateway);
++    struct rtentry rt, tmp_rt;
++    struct rtentry *del_rt = NULL;
+-      if (old_gateway != gateway)
+-          error("not replacing existing default route to %s [%I]",
+-                rt.rt_dev, old_gateway);
+-      return 0;
++    
++    if (default_rt_repl_rest) {
++      /* We have already reclaced the original defaultroute, if we
++         * are called again, we will delete the current default route
++         * and set the new default route in this function.  
++         * - this is normally only the case the doing demand: */
++      if (defaultroute_exists( &tmp_rt ))
++              del_rt = &tmp_rt;
++    } else if ( defaultroute_exists( &old_def_rt                ) &&
++                           strcmp(  old_def_rt.rt_dev, ifname ) != 0) {
++      /* We did not yet replace an existing default route, let's
++       * check if we should save and replace a default route:
++         */
++      u_int32_t old_gateway = SIN_ADDR(old_def_rt.rt_gateway);
++
++      if (old_gateway != gateway) {
++          if (!replace) {
++              error("not replacing default route to %s [%I]",
++                      old_def_rt.rt_dev, old_gateway);
++              return 0;
++          } else {
++              // we need to copy rt_dev because we need it permanent too:
++              char * tmp_dev = malloc(strlen(old_def_rt.rt_dev)+1);
++              strcpy(tmp_dev, old_def_rt.rt_dev);
++              old_def_rt.rt_dev = tmp_dev;
++
++              notice("replacing old default route to %s [%I]",
++                      old_def_rt.rt_dev, old_gateway);
++              default_rt_repl_rest = 1;
++              del_rt = &old_def_rt;
++          }
++      }
+     }
+     memset (&rt, '\0', sizeof (rt));
+@@ -1310,6 +1349,12 @@
+           error("default route ioctl(SIOCADDRT): %m(%d)", errno);
+       return 0;
+     }
++    if (default_rt_repl_rest && del_rt)
++        if (ioctl(sock_fd, SIOCDELRT, del_rt) < 0) {
++          if ( ! ok_error ( errno ))
++              error("del old default route ioctl(SIOCDELRT): %m(%d)", errno);
++          return 0;
++        }
+     default_route_gateway = gateway;
+     return 1;
+@@ -1344,6 +1389,16 @@
+               error("default route ioctl(SIOCDELRT): %m (%d)", errno);
+           return 0;
+       }
++    }
++    if (default_rt_repl_rest) {
++      notice("restoring old default route to %s [%I]",
++                      old_def_rt.rt_dev, SIN_ADDR(old_def_rt.rt_gateway));
++        if (ioctl(sock_fd, SIOCADDRT, &old_def_rt) < 0) {
++          if ( ! ok_error ( errno ))
++              error("restore default route ioctl(SIOCADDRT): %m(%d)", errno);
++          return 0;
++        }
++        default_rt_repl_rest = 0;
+     }
+     return 1;
diff --git a/openwrt/package/ppp/patches/109-debian_demand.patch b/openwrt/package/ppp/patches/109-debian_demand.patch
new file mode 100644 (file)
index 0000000..e024696
--- /dev/null
@@ -0,0 +1,172 @@
+--- ppp/pppd/demand.c
++++ ppp/pppd/demand.c  2000/06/28 14:54:04
+@@ -25,6 +25,8 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <netdb.h>
++#include <unistd.h>
++#include <syslog.h>
+ #include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+@@ -32,6 +34,8 @@
+ #include <sys/resource.h>
+ #include <sys/stat.h>
+ #include <sys/socket.h>
++#include <netinet/in.h>
++#include <arpa/inet.h>
+ #ifdef PPP_FILTER
+ #include <net/if.h>
+ #include <net/bpf.h>
+@@ -210,6 +214,14 @@
+     int c, rv;
+     rv = 0;
++
++/* check for synchronous connection... */
++
++    if ( (p[0] == 0xFF) && (p[1] == 0x03) ) {
++        rv = loop_frame(p,n);
++        return rv;
++    }
++
+     for (; n > 0; --n) {
+       c = *p++;
+       if (c == PPP_FLAG) {
+@@ -288,17 +300,102 @@
+  * loopback, now that the real serial link is up.
+  */
+ void
+-demand_rexmit(proto)
++demand_rexmit(proto, newip)
+     int proto;
++    u_int32_t newip;
+ {
+     struct packet *pkt, *prev, *nextpkt;
++    unsigned short checksum;
++    unsigned short pkt_checksum = 0;
++    unsigned iphdr;
++    struct timeval tv;
++    char cv = 0;
++    char ipstr[16];
+     prev = NULL;
+     pkt = pend_q;
+     pend_q = NULL;
++    tv.tv_sec = 1;
++    tv.tv_usec = 0;
++    select(0,NULL,NULL,NULL,&tv);     /* Sleep for 1 Seconds */
+     for (; pkt != NULL; pkt = nextpkt) {
+       nextpkt = pkt->next;
+       if (PPP_PROTOCOL(pkt->data) == proto) {
++            if ( (proto == PPP_IP) && newip ) {
++              /* Get old checksum */
++
++              iphdr = (pkt->data[4] & 15) << 2;
++              checksum = *((unsigned short *) (pkt->data+14));
++                if (checksum == 0xFFFF) {
++                    checksum = 0;
++                }
++
++ 
++                if (pkt->data[13] == 17) {
++                    pkt_checksum =  *((unsigned short *) (pkt->data+10+iphdr));
++                  if (pkt_checksum) {
++                        cv = 1;
++                        if (pkt_checksum == 0xFFFF) {
++                            pkt_checksum = 0;
++                        }
++                    }
++                    else {
++                       cv = 0;
++                    }
++                }
++
++              if (pkt->data[13] == 6) {
++                  pkt_checksum = *((unsigned short *) (pkt->data+20+iphdr));
++                  cv = 1;
++                    if (pkt_checksum == 0xFFFF) {
++                        pkt_checksum = 0;
++                    }
++              }
++
++              /* Delete old Source-IP-Address */
++                checksum -= *((unsigned short *) (pkt->data+16)) ^ 0xFFFF;
++                checksum -= *((unsigned short *) (pkt->data+18)) ^ 0xFFFF;
++
++              pkt_checksum -= *((unsigned short *) (pkt->data+16)) ^ 0xFFFF;
++              pkt_checksum -= *((unsigned short *) (pkt->data+18)) ^ 0xFFFF;
++
++              /* Change Source-IP-Address */
++                * ((u_int32_t *) (pkt->data + 16)) = newip;
++
++              /* Add new Source-IP-Address */
++                checksum += *((unsigned short *) (pkt->data+16)) ^ 0xFFFF;
++                checksum += *((unsigned short *) (pkt->data+18)) ^ 0xFFFF;
++
++                pkt_checksum += *((unsigned short *) (pkt->data+16)) ^ 0xFFFF;
++                pkt_checksum += *((unsigned short *) (pkt->data+18)) ^ 0xFFFF;
++
++              /* Write new checksum */
++                if (!checksum) {
++                    checksum = 0xFFFF;
++                }
++                *((unsigned short *) (pkt->data+14)) = checksum;
++              if (pkt->data[13] == 6) {
++                  *((unsigned short *) (pkt->data+20+iphdr)) = pkt_checksum;
++              }
++              if (cv && (pkt->data[13] == 17) ) {
++                  *((unsigned short *) (pkt->data+10+iphdr)) = pkt_checksum;
++              }
++
++              /* Log Packet */
++              strcpy(ipstr,inet_ntoa(*( (struct in_addr *) (pkt->data+16))));
++              if (pkt->data[13] == 1) {
++                  syslog(LOG_INFO,"Open ICMP %s -> %s\n",
++                      ipstr,
++                      inet_ntoa(*( (struct in_addr *) (pkt->data+20))));
++              } else {
++                  syslog(LOG_INFO,"Open %s %s:%d -> %s:%d\n",
++                      pkt->data[13] == 6 ? "TCP" : "UDP",
++                      ipstr,
++                      ntohs(*( (short *) (pkt->data+iphdr+4))),
++                      inet_ntoa(*( (struct in_addr *) (pkt->data+20))),
++                      ntohs(*( (short *) (pkt->data+iphdr+6))));
++                }
++            }
+           output(0, pkt->data, pkt->length);
+           free(pkt);
+       } else {
+--- ppp/pppd/ipcp.c
++++ ppp/pppd/ipcp.c    2000/06/28 12:32:05
+@@ -1454,7 +1454,7 @@
+                   proxy_arp_set[f->unit] = 1;
+       }
+-      demand_rexmit(PPP_IP);
++      demand_rexmit(PPP_IP,go->ouraddr);
+       sifnpmode(f->unit, PPP_IP, NPMODE_PASS);
+     } else {
+--- ppp/pppd/ipv6cp.c
++++ ppp/pppd/ipv6cp.c  2000/06/28 12:32:06
+@@ -1153,7 +1153,7 @@
+           }
+       }
+-      demand_rexmit(PPP_IPV6);
++      demand_rexmit(PPP_IPV6,0);
+       sifnpmode(f->unit, PPP_IPV6, NPMODE_PASS);
+     } else {
+--- ppp/pppd/pppd.h
++++ ppp/pppd/pppd.h    2000/06/28 12:32:06
+@@ -359,7 +359,7 @@
+ void demand_block __P((void));        /* set all NPs to queue up packets */
+ void demand_unblock __P((void)); /* set all NPs to pass packets */
+ void demand_discard __P((void)); /* set all NPs to discard packets */
+-void demand_rexmit __P((int));        /* retransmit saved frames for an NP */
++void demand_rexmit __P((int, u_int32_t)); /* retransmit saved frames for an NP*/
+ int  loop_chars __P((unsigned char *, int)); /* process chars from loopback */
+ int  loop_frame __P((unsigned char *, int)); /* should we bring link up? */
diff --git a/openwrt/package/ppp/patches/200-makefile.patch b/openwrt/package/ppp/patches/200-makefile.patch
new file mode 100644 (file)
index 0000000..5bbf860
--- /dev/null
@@ -0,0 +1,53 @@
+diff -ruN ppp-2.4.3-orig/pppd/Makefile.linux ppp-2.4.3-3/pppd/Makefile.linux
+--- ppp-2.4.3-orig/pppd/Makefile.linux 2004-11-13 13:02:22.000000000 +0100
++++ ppp-2.4.3-3/pppd/Makefile.linux    2004-12-16 04:43:41.000000000 +0100
+@@ -48,19 +48,19 @@
+ # Uncomment the next line to include support for PPP packet filtering.
+ # This requires that the libpcap library and headers be installed
+ # and that the kernel driver support PPP packet filtering.
+-FILTER=y
++#FILTER=y
+ # Uncomment the next line to enable multilink PPP (enabled by default)
+ # Linux distributions: Please leave multilink ENABLED in your builds
+ # of pppd!
+-HAVE_MULTILINK=y
++#HAVE_MULTILINK=y
+ # Uncomment the next line to enable the TDB database (enabled by default.)
+ # If you enable multilink, then TDB is automatically enabled also.
+ # Linux distributions: Please leave TDB ENABLED in your builds.
+-USE_TDB=y
++#USE_TDB=y
+-HAS_SHADOW=y
++#HAS_SHADOW=y
+ #USE_PAM=y
+ #HAVE_INET6=y
+@@ -77,7 +77,7 @@
+ INCLUDE_DIRS= -I../include
+-COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP
++COMPILE_FLAGS= -DHAVE_PATHS_H -DHAVE_MMAP
+ CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS)
+@@ -117,12 +117,12 @@
+ #LIBS     += -lshadow $(LIBS)
+ endif
+-ifneq ($(wildcard /usr/include/crypt.h),)
++#ifneq ($(wildcard /usr/include/crypt.h),)
+ CFLAGS   += -DHAVE_CRYPT_H=1
+-endif
+-ifneq ($(wildcard /usr/lib/libcrypt.*),)
++#endif
++#ifneq ($(wildcard /usr/lib/libcrypt.*),)
+ LIBS  += -lcrypt
+-endif
++#endif
+ ifdef NEEDDES
+ ifndef USE_CRYPT
diff --git a/openwrt/package/ppp/patches/201-mppe_mppc_1.1.patch b/openwrt/package/ppp/patches/201-mppe_mppc_1.1.patch
new file mode 100644 (file)
index 0000000..7e09f1a
--- /dev/null
@@ -0,0 +1,1585 @@
+diff -ruN ppp-2.4.3.orig/include/linux/ppp-comp.h ppp-2.4.3/include/linux/ppp-comp.h
+--- ppp-2.4.3.orig/include/linux/ppp-comp.h    2002-12-06 10:49:15.000000000 +0100
++++ ppp-2.4.3/include/linux/ppp-comp.h 2004-11-21 13:54:09.000000000 +0100
+@@ -36,7 +36,7 @@
+  */
+ /*
+- *  ==FILEVERSION 20020319==
++ *  ==FILEVERSION 20020715==
+  *
+  *  NOTE TO MAINTAINERS:
+  *     If you modify this file at all, please set the above date.
+@@ -86,7 +86,7 @@
+       /* Compress a packet */
+       int     (*compress) (void *state, unsigned char *rptr,
+-                            unsigned char *obuf, int isize, int osize);
++                           unsigned char *obuf, int isize, int osize);
+       /* Return compression statistics */
+       void    (*comp_stat) (void *state, struct compstat *stats);
+@@ -107,7 +107,7 @@
+       /* Decompress a packet. */
+       int     (*decompress) (void *state, unsigned char *ibuf, int isize,
+-                              unsigned char *obuf, int osize);
++                             unsigned char *obuf, int osize);
+       /* Update state for an incompressible packet received */
+       void    (*incomp) (void *state, unsigned char *ibuf, int icnt);
+@@ -288,6 +288,33 @@
+           opts |= MPPE_OPT_UNKNOWN;           \
+     } while (/* CONSTCOND */ 0)
++/* MPPE/MPPC definitions by J.D.*/
++#define MPPE_STATELESS          MPPE_H_BIT    /* configuration bit H */
++#define MPPE_40BIT              MPPE_L_BIT    /* configuration bit L */
++#define MPPE_56BIT              MPPE_M_BIT    /* configuration bit M */
++#define MPPE_128BIT             MPPE_S_BIT    /* configuration bit S */
++#define MPPE_MPPC               MPPE_C_BIT    /* configuration bit C */
++
++/*
++ * Definitions for Stac LZS.
++ */
++
++#define CI_LZS                        17      /* config option for Stac LZS */
++#define CILEN_LZS             5       /* length of config option */
++
++#define LZS_OVHD              4       /* max. LZS overhead */
++#define LZS_HIST_LEN          2048    /* LZS history size */
++#define LZS_MAX_CCOUNT                0x0FFF  /* max. coherency counter value */
++
++#define LZS_MODE_NONE         0
++#define LZS_MODE_LCB          1
++#define LZS_MODE_CRC          2
++#define LZS_MODE_SEQ          3
++#define LZS_MODE_EXT          4
++
++#define LZS_EXT_BIT_FLUSHED   0x80    /* bit A */
++#define LZS_EXT_BIT_COMP      0x20    /* bit C */
++
+ /*
+  * Definitions for other, as yet unsupported, compression methods.
+  */
+diff -ruN ppp-2.4.3.orig/include/net/ppp-comp.h ppp-2.4.3/include/net/ppp-comp.h
+--- ppp-2.4.3.orig/include/net/ppp-comp.h      2002-12-06 10:49:15.000000000 +0100
++++ ppp-2.4.3/include/net/ppp-comp.h   2004-11-21 13:54:09.000000000 +0100
+@@ -255,6 +255,33 @@
+           opts |= MPPE_OPT_UNKNOWN;           \
+     } while (/* CONSTCOND */ 0)
++/* MPPE/MPPC definitions by J.D.*/
++#define MPPE_STATELESS          MPPE_H_BIT    /* configuration bit H */
++#define MPPE_40BIT              MPPE_L_BIT    /* configuration bit L */
++#define MPPE_56BIT              MPPE_M_BIT    /* configuration bit M */
++#define MPPE_128BIT             MPPE_S_BIT    /* configuration bit S */
++#define MPPE_MPPC               MPPE_C_BIT    /* configuration bit C */
++
++/*
++ * Definitions for Stac LZS.
++ */
++
++#define CI_LZS                        17      /* config option for Stac LZS */
++#define CILEN_LZS             5       /* length of config option */
++
++#define LZS_OVHD              4       /* max. LZS overhead */
++#define LZS_HIST_LEN          2048    /* LZS history size */
++#define LZS_MAX_CCOUNT                0x0FFF  /* max. coherency counter value */
++
++#define LZS_MODE_NONE         0
++#define LZS_MODE_LCB          1
++#define LZS_MODE_CRC          2
++#define LZS_MODE_SEQ          3
++#define LZS_MODE_EXT          4
++
++#define LZS_EXT_BIT_FLUSHED   0x80    /* bit A */
++#define LZS_EXT_BIT_COMP      0x20    /* bit C */
++
+ /*
+  * Definitions for other, as yet unsupported, compression methods.
+  */
+diff -ruN ppp-2.4.3.orig/pppd/ccp.c ppp-2.4.3/pppd/ccp.c
+--- ppp-2.4.3.orig/pppd/ccp.c  2004-11-13 03:28:15.000000000 +0100
++++ ppp-2.4.3/pppd/ccp.c       2004-11-21 13:54:09.000000000 +0100
+@@ -62,12 +62,10 @@
+ static char bsd_value[8];
+ static char deflate_value[8];
+-/*
+- * Option variables.
+- */
+ #ifdef MPPE
+-bool refuse_mppe_stateful = 1;                /* Allow stateful mode? */
+-#endif
++static int setmppe(char **);
++static int setnomppe(void);
++#endif /* MPPE */
+ static option_t ccp_option_list[] = {
+     { "noccp", o_bool, &ccp_protent.enabled_flag,
+@@ -108,54 +106,36 @@
+       "don't allow Predictor-1", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR,
+       &ccp_allowoptions[0].predictor_1 },
++    { "lzs", o_bool, &ccp_wantoptions[0].lzs,
++      "request Stac LZS", 1, &ccp_allowoptions[0].lzs, OPT_PRIO },
++    { "+lzs", o_bool, &ccp_wantoptions[0].lzs,
++      "request Stac LZS", 1, &ccp_allowoptions[0].lzs, OPT_ALIAS | OPT_PRIO },
++    { "nolzs", o_bool, &ccp_wantoptions[0].lzs,
++      "don't allow Stac LZS", OPT_PRIOSUB | OPT_A2CLR,
++      &ccp_allowoptions[0].lzs },
++    { "-lzs", o_bool, &ccp_wantoptions[0].lzs,
++      "don't allow Stac LZS", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR,
++      &ccp_allowoptions[0].lzs },
++
+ #ifdef MPPE
+-    /* MPPE options are symmetrical ... we only set wantoptions here */
+-    { "require-mppe", o_bool, &ccp_wantoptions[0].mppe,
+-      "require MPPE encryption",
+-      OPT_PRIO | MPPE_OPT_40 | MPPE_OPT_128 },
+-    { "+mppe", o_bool, &ccp_wantoptions[0].mppe,
+-      "require MPPE encryption",
+-      OPT_ALIAS | OPT_PRIO | MPPE_OPT_40 | MPPE_OPT_128 },
+-    { "nomppe", o_bool, &ccp_wantoptions[0].mppe,
+-      "don't allow MPPE encryption", OPT_PRIO },
+-    { "-mppe", o_bool, &ccp_wantoptions[0].mppe,
+-      "don't allow MPPE encryption", OPT_ALIAS | OPT_PRIO },
+-
+-    /* We use ccp_allowoptions[0].mppe as a junk var ... it is reset later */
+-    { "require-mppe-40", o_bool, &ccp_allowoptions[0].mppe,
+-      "require MPPE 40-bit encryption", OPT_PRIO | OPT_A2OR | MPPE_OPT_40,
+-      &ccp_wantoptions[0].mppe },
+-    { "+mppe-40", o_bool, &ccp_allowoptions[0].mppe,
+-      "require MPPE 40-bit encryption", OPT_PRIO | OPT_A2OR | MPPE_OPT_40,
+-      &ccp_wantoptions[0].mppe },
+-    { "nomppe-40", o_bool, &ccp_allowoptions[0].mppe,
+-      "don't allow MPPE 40-bit encryption",
+-      OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_40, &ccp_wantoptions[0].mppe },
+-    { "-mppe-40", o_bool, &ccp_allowoptions[0].mppe,
+-      "don't allow MPPE 40-bit encryption",
+-      OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_40,
+-      &ccp_wantoptions[0].mppe },
+-
+-    { "require-mppe-128", o_bool, &ccp_allowoptions[0].mppe,
+-      "require MPPE 128-bit encryption", OPT_PRIO | OPT_A2OR | MPPE_OPT_128,
+-      &ccp_wantoptions[0].mppe },
+-    { "+mppe-128", o_bool, &ccp_allowoptions[0].mppe,
+-      "require MPPE 128-bit encryption",
+-      OPT_ALIAS | OPT_PRIO | OPT_A2OR | MPPE_OPT_128,
+-      &ccp_wantoptions[0].mppe },
+-    { "nomppe-128", o_bool, &ccp_allowoptions[0].mppe,
+-      "don't allow MPPE 128-bit encryption",
+-      OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_128, &ccp_wantoptions[0].mppe },
+-    { "-mppe-128", o_bool, &ccp_allowoptions[0].mppe,
+-      "don't allow MPPE 128-bit encryption",
+-      OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_128,
+-      &ccp_wantoptions[0].mppe },
+-
+-    /* strange one; we always request stateless, but will we allow stateful? */
+-    { "mppe-stateful", o_bool, &refuse_mppe_stateful,
+-      "allow MPPE stateful mode", OPT_PRIO },
+-    { "nomppe-stateful", o_bool, &refuse_mppe_stateful,
+-      "disallow MPPE stateful mode", OPT_PRIO | 1 },
++    { "mppc", o_bool, &ccp_wantoptions[0].mppc,
++      "request MPPC compression", 1, &ccp_allowoptions[0].mppc },
++    { "+mppc", o_bool, &ccp_wantoptions[0].mppc,
++      "request MPPC compression", 1, &ccp_allowoptions[0].mppc, OPT_ALIAS },
++    { "nomppc", o_bool, &ccp_wantoptions[0].mppc,
++      "don't allow MPPC compression", OPT_PRIOSUB | OPT_A2CLR,
++      &ccp_allowoptions[0].mppc },
++    { "-mppc", o_bool, &ccp_wantoptions[0].mppc,
++      "don't allow MPPC compression", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR,
++      &ccp_allowoptions[0].mppc },
++    { "mppe", o_special, (void *)setmppe,
++      "request MPPE encryption" },
++    { "+mppe", o_special, (void *)setmppe,
++      "request MPPE encryption" },
++    { "nomppe", o_special_noarg, (void *)setnomppe,
++      "don't allow MPPE encryption" },
++    { "-mppe", o_special_noarg, (void *)setnomppe,
++      "don't allow MPPE encryption" },
+ #endif /* MPPE */
+     { NULL }
+@@ -241,7 +221,7 @@
+  */
+ #define ANY_COMPRESS(opt)     ((opt).deflate || (opt).bsd_compress \
+                                || (opt).predictor_1 || (opt).predictor_2 \
+-                               || (opt).mppe)
++                               || (opt).lzs || (opt).mppc || (opt).mppe)
+ /*
+  * Local state (mainly for handling reset-reqs and reset-acks).
+@@ -344,6 +324,100 @@
+     return 1;
+ }
++#ifdef MPPE
++/*
++ * Functions called from config options
++ */
++/* 
++   MPPE suboptions:
++      required - require MPPE; disconnect if peer doesn't support it
++      stateless - use stateless mode
++      no40 - disable 40 bit keys
++      no56 - disable 56 bit keys
++      no128 - disable 128 bit keys
++*/
++int setmppe(char **argv)
++{
++    int i;
++    char *str, cmdbuf[16];
++
++    ccp_allowoptions[0].mppe = 1;
++    ccp_allowoptions[0].mppe_40 = 1;
++    ccp_allowoptions[0].mppe_56 = 1;
++    ccp_allowoptions[0].mppe_128 = 1;
++    ccp_allowoptions[0].mppe_stateless = 0;
++    ccp_wantoptions[0].mppe = 0;
++
++    str = *argv;
++
++    while (1) {
++      i = 0;
++      memset(cmdbuf, '\0', 16);
++      while ((i < 16) && (*str != ',') && (*str != '\0'))
++          cmdbuf[i++] = *str++;
++      cmdbuf[i] = '\0';
++      if (!strncasecmp(cmdbuf, "no40", strlen("no40"))) {
++          ccp_allowoptions[0].mppe_40 = 0;
++          goto next_param;
++      } else if (!strncasecmp(cmdbuf, "no56", strlen("no56"))) {
++          ccp_allowoptions[0].mppe_56 = 0;
++          goto next_param;
++      } else if (!strncasecmp(cmdbuf, "no128", strlen("no128"))) {
++          ccp_allowoptions[0].mppe_128 = 0;
++          goto next_param;
++      } else if (!strncasecmp(cmdbuf, "stateless", strlen("stateless"))) {
++          ccp_allowoptions[0].mppe_stateless = 1;
++          goto next_param;
++      } else if (!strncasecmp(cmdbuf, "required", strlen("required"))) {
++          ccp_wantoptions[0].mppe = 1;
++          goto next_param;
++      } else {
++          option_error("invalid parameter '%s' for mppe option", cmdbuf);
++          return 0;
++      }
++
++    next_param:
++      if (*str == ',') {
++          str++;
++          continue;
++      }
++      if (*str == '\0') {
++          if (!(ccp_allowoptions[0].mppe_40 || ccp_allowoptions[0].mppe_56 ||
++                ccp_allowoptions[0].mppe_128)) {
++              if (ccp_wantoptions[0].mppe == 1) {
++                  option_error("You require MPPE but you have switched off "
++                               "all encryption key lengths.");
++                  return 0;
++              }
++              ccp_wantoptions[0].mppe = ccp_allowoptions[0].mppe = 0;
++              ccp_wantoptions[0].mppe_stateless =
++                  ccp_allowoptions[0].mppe_stateless = 0;
++          } else {
++              ccp_allowoptions[0].mppe = 1;
++              ccp_wantoptions[0].mppe_stateless =
++                  ccp_allowoptions[0].mppe_stateless;
++              if (ccp_wantoptions[0].mppe == 1) {
++                  ccp_wantoptions[0].mppe_40 = ccp_allowoptions[0].mppe_40;
++                  ccp_wantoptions[0].mppe_56 = ccp_allowoptions[0].mppe_56;
++                  ccp_wantoptions[0].mppe_128 = ccp_allowoptions[0].mppe_128;
++              }
++          }
++          return 1;
++      }
++    }
++}
++
++int setnomppe(void)
++{
++    ccp_wantoptions[0].mppe = ccp_allowoptions[0].mppe = 0;
++    ccp_wantoptions[0].mppe_40 = ccp_allowoptions[0].mppe_40 = 0;
++    ccp_wantoptions[0].mppe_56 = ccp_allowoptions[0].mppe_56 = 0;
++    ccp_wantoptions[0].mppe_128 = ccp_allowoptions[0].mppe_128 = 0;
++    ccp_wantoptions[0].mppe_stateless = ccp_allowoptions[0].mppe_stateless = 0;
++    return 1;
++}
++#endif /* MPPE */
++
+ /*
+  * ccp_init - initialize CCP.
+  */
+@@ -378,6 +452,30 @@
+     ccp_allowoptions[0].bsd_bits = BSD_MAX_BITS;
+     ccp_allowoptions[0].predictor_1 = 1;
++
++    ccp_wantoptions[0].lzs = 0; /* Stac LZS  - will be enabled in the future */
++    ccp_wantoptions[0].lzs_mode = LZS_MODE_SEQ;
++    ccp_wantoptions[0].lzs_hists = 1;
++    ccp_allowoptions[0].lzs = 0; /* Stac LZS  - will be enabled in the future */
++    ccp_allowoptions[0].lzs_mode = LZS_MODE_SEQ;
++    ccp_allowoptions[0].lzs_hists = 1;
++
++#ifdef MPPE
++    /* by default allow and request MPPC... */
++    ccp_wantoptions[0].mppc = ccp_allowoptions[0].mppc = 1;
++
++    /* ... and allow but don't request MPPE */
++    ccp_allowoptions[0].mppe = 1;
++    ccp_allowoptions[0].mppe_40 = 1;
++    ccp_allowoptions[0].mppe_56 = 1;
++    ccp_allowoptions[0].mppe_128 = 1;
++    ccp_allowoptions[0].mppe_stateless = 1;
++    ccp_wantoptions[0].mppe = 0;
++    ccp_wantoptions[0].mppe_40 = 0;
++    ccp_wantoptions[0].mppe_56 = 0;
++    ccp_wantoptions[0].mppe_128 = 0;
++    ccp_wantoptions[0].mppe_stateless = 0;
++#endif /* MPPE */
+ }
+ /*
+@@ -455,11 +553,11 @@
+     if (oldstate == OPENED && p[0] == TERMREQ && f->state != OPENED) {
+       notice("Compression disabled by peer.");
+ #ifdef MPPE
+-      if (ccp_gotoptions[unit].mppe) {
++      if (ccp_wantoptions[unit].mppe) {
+           error("MPPE disabled, closing LCP");
+           lcp_close(unit, "MPPE disabled by peer");
+       }
+-#endif
++#endif /* MPPE */
+     }
+     /*
+@@ -487,6 +585,15 @@
+           break;
+       /* send a reset-ack, which the transmitter will see and
+          reset its compression state. */
++
++      /* In case of MPPE/MPPC or LZS we shouldn't send CCP_RESETACK,
++         but we do it in order to reset compressor; CCP_RESETACK is
++         then silently discarded. See functions ppp_send_frame and
++         ppp_ccp_peek in ppp_generic.c (Linux only !!!). All the
++         confusion is caused by the fact that CCP code is splited
++         into two parts - one part is handled by pppd, the other one
++         is handled by kernel. */
++
+       fsm_sdata(f, CCP_RESETACK, id, NULL, 0);
+       break;
+@@ -515,12 +622,11 @@
+     fsm_lowerdown(&ccp_fsm[unit]);
+ #ifdef MPPE
+-    if (ccp_gotoptions[unit].mppe) {
++    if (ccp_wantoptions[unit].mppe) {
+       error("MPPE required but peer negotiation failed");
+       lcp_close(unit, "MPPE required but peer negotiation failed");
+     }
+-#endif
+-
++#endif /* MPPE */
+ }
+ /*
+@@ -537,7 +643,7 @@
+     all_rejected[f->unit] = 0;
+ #ifdef MPPE
+-    if (go->mppe) {
++    if (go->mppe || go->mppc) {
+       ccp_options *ao = &ccp_allowoptions[f->unit];
+       int auth_mschap_bits = auth_done[f->unit];
+       int numbits;
+@@ -551,80 +657,109 @@
+        * NB: If MPPE is required, all other compression opts are invalid.
+        *     So, we return right away if we can't do it.
+        */
++      if (ccp_wantoptions[f->unit].mppe) {
++          /* Leave only the mschap auth bits set */
++          auth_mschap_bits &= (CHAP_MS_WITHPEER  | CHAP_MS_PEER |
++                               CHAP_MS2_WITHPEER | CHAP_MS2_PEER);
++          /* Count the mschap auths */
++          auth_mschap_bits >>= CHAP_MS_SHIFT;
++          numbits = 0;
++          do {
++              numbits += auth_mschap_bits & 1;
++              auth_mschap_bits >>= 1;
++          } while (auth_mschap_bits);
++          if (numbits > 1) {
++              error("MPPE required, but auth done in both directions.");
++              lcp_close(f->unit, "MPPE required but not available");
++              return;
++          }
++          if (!numbits) {
++              error("MPPE required, but MS-CHAP[v2] auth not performed.");
++              lcp_close(f->unit, "MPPE required but not available");
++              return;
++          }
+-      /* Leave only the mschap auth bits set */
+-      auth_mschap_bits &= (CHAP_MS_WITHPEER  | CHAP_MS_PEER |
+-                           CHAP_MS2_WITHPEER | CHAP_MS2_PEER);
+-      /* Count the mschap auths */
+-      auth_mschap_bits >>= CHAP_MS_SHIFT;
+-      numbits = 0;
+-      do {
+-          numbits += auth_mschap_bits & 1;
+-          auth_mschap_bits >>= 1;
+-      } while (auth_mschap_bits);
+-      if (numbits > 1) {
+-          error("MPPE required, but auth done in both directions.");
+-          lcp_close(f->unit, "MPPE required but not available");
+-          return;
+-      }
+-      if (!numbits) {
+-          error("MPPE required, but MS-CHAP[v2] auth not performed.");
+-          lcp_close(f->unit, "MPPE required but not available");
+-          return;
+-      }
+-
+-      /* A plugin (eg radius) may not have obtained key material. */
+-      if (!mppe_keys_set) {
+-          error("MPPE required, but keys are not available.  "
+-                "Possible plugin problem?");
+-          lcp_close(f->unit, "MPPE required but not available");
+-          return;
+-      }
+-
+-      /* LM auth not supported for MPPE */
+-      if (auth_done[f->unit] & (CHAP_MS_WITHPEER | CHAP_MS_PEER)) {
+-          /* This might be noise */
+-          if (go->mppe & MPPE_OPT_40) {
+-              notice("Disabling 40-bit MPPE; MS-CHAP LM not supported");
+-              go->mppe &= ~MPPE_OPT_40;
+-              ccp_wantoptions[f->unit].mppe &= ~MPPE_OPT_40;
++          /* A plugin (eg radius) may not have obtained key material. */
++          if (!mppe_keys_set) {
++              error("MPPE required, but keys are not available.  "
++                    "Possible plugin problem?");
++              lcp_close(f->unit, "MPPE required but not available");
++              return;
+           }
+       }
+-      /* Last check: can we actually negotiate something? */
+-      if (!(go->mppe & (MPPE_OPT_40 | MPPE_OPT_128))) {
+-          /* Could be misconfig, could be 40-bit disabled above. */
+-          error("MPPE required, but both 40-bit and 128-bit disabled.");
+-          lcp_close(f->unit, "MPPE required but not available");
+-          return;
++      /*
++       * Check whether the kernel knows about the various
++       * compression methods we might request. Key material
++       * unimportant here.
++       */
++      if (go->mppc) {
++          opt_buf[0] = CI_MPPE;
++          opt_buf[1] = CILEN_MPPE;
++          opt_buf[2] = 0;
++          opt_buf[3] = 0;
++          opt_buf[4] = 0;
++          opt_buf[5] = MPPE_MPPC;
++          if (ccp_test(f->unit, opt_buf, CILEN_MPPE, 0) <= 0)
++              go->mppc = 0;
++      }
++      if (go->mppe_40) {
++          opt_buf[0] = CI_MPPE;
++          opt_buf[1] = CILEN_MPPE;
++          opt_buf[2] = MPPE_STATELESS;
++          opt_buf[3] = 0;
++          opt_buf[4] = 0;
++          opt_buf[5] = MPPE_40BIT;
++          if (ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0) <= 0)
++              go->mppe_40 = 0;
++      }
++      if (go->mppe_56) {
++          opt_buf[0] = CI_MPPE;
++          opt_buf[1] = CILEN_MPPE;
++          opt_buf[2] = MPPE_STATELESS;
++          opt_buf[3] = 0;
++          opt_buf[4] = 0;
++          opt_buf[5] = MPPE_56BIT;
++          if (ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0) <= 0)
++              go->mppe_56 = 0;
++      }
++      if (go->mppe_128) {
++          opt_buf[0] = CI_MPPE;
++          opt_buf[1] = CILEN_MPPE;
++          opt_buf[2] = MPPE_STATELESS;
++          opt_buf[3] = 0;
++          opt_buf[4] = 0;
++          opt_buf[5] = MPPE_128BIT;
++          if (ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0) <= 0)
++              go->mppe_128 = 0;
++      }
++      if (!go->mppe_40 && !go->mppe_56 && !go->mppe_128) {
++          if (ccp_wantoptions[f->unit].mppe) {
++              error("MPPE required, but kernel has no support.");
++              lcp_close(f->unit, "MPPE required but not available");
++          }
++          go->mppe = go->mppe_stateless = 0;
++      } else {
++          /* MPPE is not compatible with other compression types */
++          if (ccp_wantoptions[f->unit].mppe) {
++              ao->bsd_compress = go->bsd_compress = 0;
++              ao->predictor_1  = go->predictor_1  = 0;
++              ao->predictor_2  = go->predictor_2  = 0;
++              ao->deflate      = go->deflate      = 0;
++              ao->lzs          = go->lzs          = 0;
++          }
+       }
+-
+-      /* sync options */
+-      ao->mppe = go->mppe;
+-      /* MPPE is not compatible with other compression types */
+-      ao->bsd_compress = go->bsd_compress = 0;
+-      ao->predictor_1  = go->predictor_1  = 0;
+-      ao->predictor_2  = go->predictor_2  = 0;
+-      ao->deflate      = go->deflate      = 0;
+     }
+ #endif /* MPPE */
+-
+-    /*
+-     * Check whether the kernel knows about the various
+-     * compression methods we might request.
+-     */
+-#ifdef MPPE
+-    if (go->mppe) {
+-      opt_buf[0] = CI_MPPE;
+-      opt_buf[1] = CILEN_MPPE;
+-      MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]);
+-      /* Key material unimportant here. */
+-      if (ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0) <= 0) {
+-          error("MPPE required, but kernel has no support.");
+-          lcp_close(f->unit, "MPPE required but not available");
+-      }
++    if (go->lzs) {
++      opt_buf[0] = CI_LZS;
++      opt_buf[1] = CILEN_LZS;
++      opt_buf[2] = go->lzs_hists >> 8;
++      opt_buf[3] = go->lzs_hists & 0xff;
++      opt_buf[4] = LZS_MODE_SEQ;
++      if (ccp_test(f->unit, opt_buf, CILEN_LZS, 0) <= 0)
++          go->lzs = 0;
+     }
+-#endif
+     if (go->bsd_compress) {
+       opt_buf[0] = CI_BSD_COMPRESS;
+       opt_buf[1] = CILEN_BSD_COMPRESS;
+@@ -679,7 +814,8 @@
+       + (go->deflate? CILEN_DEFLATE: 0)
+       + (go->predictor_1? CILEN_PREDICTOR_1: 0)
+       + (go->predictor_2? CILEN_PREDICTOR_2: 0)
+-      + (go->mppe? CILEN_MPPE: 0);
++      + (go->lzs? CILEN_LZS: 0)
++      + ((go->mppe || go->mppc)? CILEN_MPPE: 0);
+ }
+ /*
+@@ -693,6 +829,8 @@
+ {
+     int res;
+     ccp_options *go = &ccp_gotoptions[f->unit];
++    ccp_options *ao = &ccp_allowoptions[f->unit];
++    ccp_options *wo = &ccp_wantoptions[f->unit];
+     u_char *p0 = p;
+     /*
+@@ -701,22 +839,43 @@
+      * in case it gets Acked.
+      */
+ #ifdef MPPE
+-    if (go->mppe) {
++    if (go->mppe || go->mppc || (!wo->mppe && ao->mppe)) {
+       u_char opt_buf[CILEN_MPPE + MPPE_MAX_KEY_LEN];
+-      p[0] = opt_buf[0] = CI_MPPE;
+-      p[1] = opt_buf[1] = CILEN_MPPE;
+-      MPPE_OPTS_TO_CI(go->mppe, &p[2]);
+-      MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]);
++      p[0] = CI_MPPE;
++      p[1] = CILEN_MPPE;
++      p[2] = (go->mppe_stateless ? MPPE_STATELESS : 0);
++      p[3] = 0;
++      p[4] = 0;
++      p[5] = (go->mppe_40 ? MPPE_40BIT : 0) | (go->mppe_56 ? MPPE_56BIT : 0) |
++          (go->mppe_128 ? MPPE_128BIT : 0) | (go->mppc ? MPPE_MPPC : 0);
++
++      BCOPY(p, opt_buf, CILEN_MPPE);
+       BCOPY(mppe_recv_key, &opt_buf[CILEN_MPPE], MPPE_MAX_KEY_LEN);
+       res = ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0);
+-      if (res > 0)
++      if (res > 0) {
+           p += CILEN_MPPE;
+-      else
++      } else {
+           /* This shouldn't happen, we've already tested it! */
+-          lcp_close(f->unit, "MPPE required but not available in kernel");
++          go->mppe = go->mppe_40 = go->mppe_56 = go->mppe_128 =
++              go->mppe_stateless = go->mppc = 0;
++          if (ccp_wantoptions[f->unit].mppe)
++              lcp_close(f->unit, "MPPE required but not available in kernel");
++      }
++    }
++#endif /* MPPE */
++    if (go->lzs) {
++      p[0] = CI_LZS;
++      p[1] = CILEN_LZS;
++      p[2] = go->lzs_hists >> 8;
++      p[3] = go->lzs_hists & 0xff;
++      p[4] = LZS_MODE_SEQ;
++      res = ccp_test(f->unit, p, CILEN_LZS, 0);
++      if (res > 0) {
++          p += CILEN_LZS;
++      } else
++          go->lzs = 0;
+     }
+-#endif
+     if (go->deflate) {
+       p[0] = go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT;
+       p[1] = CILEN_DEFLATE;
+@@ -802,7 +961,7 @@
+ /*
+  * ccp_ackci - process a received configure-ack, and return
+- * 1 iff the packet was OK.
++ * 1 if the packet was OK.
+  */
+ static int
+ ccp_ackci(f, p, len)
+@@ -811,24 +970,44 @@
+     int len;
+ {
+     ccp_options *go = &ccp_gotoptions[f->unit];
++    ccp_options *ao = &ccp_allowoptions[f->unit];
++    ccp_options *wo = &ccp_wantoptions[f->unit];
+     u_char *p0 = p;
+ #ifdef MPPE
+-    if (go->mppe) {
+-      u_char opt_buf[CILEN_MPPE];
+-
+-      opt_buf[0] = CI_MPPE;
+-      opt_buf[1] = CILEN_MPPE;
+-      MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]);
+-      if (len < CILEN_MPPE || memcmp(opt_buf, p, CILEN_MPPE))
++    if (go->mppe || go->mppc || (!wo->mppe && ao->mppe)) {
++      if (len < CILEN_MPPE
++          || p[1] != CILEN_MPPE || p[0] != CI_MPPE
++          || p[2] != (go->mppe_stateless ? MPPE_STATELESS : 0)
++          || p[3] != 0
++          || p[4] != 0
++          || (p[5] != ((go->mppe_40 ? MPPE_40BIT : 0) |
++                       (go->mppc ? MPPE_MPPC : 0))
++              && p[5] != ((go->mppe_56 ? MPPE_56BIT : 0) |
++                          (go->mppc ? MPPE_MPPC : 0))
++              && p[5] != ((go->mppe_128 ? MPPE_128BIT : 0) |
++                          (go->mppc ? MPPE_MPPC : 0))))
+           return 0;
++      if (go->mppe_40 || go->mppe_56 || go->mppe_128)
++          go->mppe = 1;
+       p += CILEN_MPPE;
+       len -= CILEN_MPPE;
++      /* Cope with first/fast ack */
++      if (p == p0 && len == 0)
++          return 1;
++    }
++#endif /* MPPE */
++    if (go->lzs) {
++      if (len < CILEN_LZS || p[0] != CI_LZS || p[1] != CILEN_LZS
++          || p[2] != go->lzs_hists>>8 || p[3] != (go->lzs_hists&0xff)
++          || p[4] != LZS_MODE_SEQ)
++          return 0;
++      p += CILEN_LZS;
++      len -= CILEN_LZS;
+       /* XXX Cope with first/fast ack */
+-      if (len == 0)
++      if (p == p0 && len == 0)
+           return 1;
+     }
+-#endif
+     if (go->deflate) {
+       if (len < CILEN_DEFLATE
+           || p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT)
+@@ -891,7 +1070,7 @@
+ /*
+  * ccp_nakci - process received configure-nak.
+- * Returns 1 iff the nak was OK.
++ * Returns 1 if the nak was OK.
+  */
+ static int
+ ccp_nakci(f, p, len, treat_as_reject)
+@@ -900,6 +1079,8 @@
+     int len;
+ {
+     ccp_options *go = &ccp_gotoptions[f->unit];
++    ccp_options *ao = &ccp_allowoptions[f->unit];
++    ccp_options *wo = &ccp_wantoptions[f->unit];
+     ccp_options no;           /* options we've seen already */
+     ccp_options try;          /* options to ask for next time */
+@@ -907,28 +1088,100 @@
+     try = *go;
+ #ifdef MPPE
+-    if (go->mppe && len >= CILEN_MPPE
+-      && p[0] == CI_MPPE && p[1] == CILEN_MPPE) {
+-      no.mppe = 1;
+-      /*
+-       * Peer wants us to use a different strength or other setting.
+-       * Fail if we aren't willing to use his suggestion.
+-       */
+-      MPPE_CI_TO_OPTS(&p[2], try.mppe);
+-      if ((try.mppe & MPPE_OPT_STATEFUL) && refuse_mppe_stateful) {
+-          error("Refusing MPPE stateful mode offered by peer");
+-          try.mppe = 0;
+-      } else if (((go->mppe | MPPE_OPT_STATEFUL) & try.mppe) != try.mppe) {
+-          /* Peer must have set options we didn't request (suggest) */
+-          try.mppe = 0;
+-      }
++    if ((go->mppe || go->mppc || (!wo->mppe && ao->mppe)) &&
++      len >= CILEN_MPPE && p[0] == CI_MPPE && p[1] == CILEN_MPPE) {
+-      if (!try.mppe) {
+-          error("MPPE required but peer negotiation failed");
+-          lcp_close(f->unit, "MPPE required but peer negotiation failed");
++      if (go->mppc) {
++          no.mppc = 1;
++          if (!(p[5] & MPPE_MPPC))
++              try.mppc = 0;
++      }
++
++      if (go->mppe)
++          no.mppe = 1;
++      if (go->mppe_40)
++          no.mppe_40 = 1;
++      if (go->mppe_56)
++          no.mppe_56 = 1;
++      if (go->mppe_128)
++          no.mppe_128 = 1;
++      if (go->mppe_stateless)
++          no.mppe_stateless = 1;
++
++      if (ao->mppe_40) {
++          if ((p[5] & MPPE_40BIT))
++              try.mppe_40 = 1;
++          else
++              try.mppe_40 = (p[5] == 0) ? 1 : 0;
++      }
++      if (ao->mppe_56) {
++          if ((p[5] & MPPE_56BIT))
++              try.mppe_56 = 1;
++          else
++              try.mppe_56 = (p[5] == 0) ? 1 : 0;
++      }
++      if (ao->mppe_128) {
++          if ((p[5] & MPPE_128BIT))
++              try.mppe_128 = 1;
++          else
++              try.mppe_128 = (p[5] == 0) ? 1 : 0;
++      }
++
++      if (ao->mppe_stateless) {
++          if ((p[2] & MPPE_STATELESS) || wo->mppe_stateless)
++              try.mppe_stateless = 1;
++          else
++              try.mppe_stateless = 0;
++      }
++
++      if (!try.mppe_56 && !try.mppe_40 && !try.mppe_128) {
++          try.mppe = try.mppe_stateless = 0;
++          if (wo->mppe) {
++              /* we require encryption, but peer doesn't support it
++                 so we close connection */
++              wo->mppc = wo->mppe = wo->mppe_stateless = wo->mppe_40 =
++                  wo->mppe_56 = wo->mppe_128 = 0;
++              lcp_close(f->unit, "MPPE required but cannot negotiate MPPE "
++                        "key length");
++          }
++        }
++      if (wo->mppe && (wo->mppe_40 != try.mppe_40) &&
++          (wo->mppe_56 != try.mppe_56) && (wo->mppe_128 != try.mppe_128)) {
++          /* cannot negotiate key length */
++          wo->mppc = wo->mppe = wo->mppe_stateless = wo->mppe_40 =
++              wo->mppe_56 = wo->mppe_128 = 0;
++          lcp_close(f->unit, "Cannot negotiate MPPE key length");
+       }
++      if (try.mppe_40 && try.mppe_56 && try.mppe_128)
++          try.mppe_40 = try.mppe_56 = 0;
++      else
++          if (try.mppe_56 && try.mppe_128)
++              try.mppe_56 = 0;
++          else
++              if (try.mppe_40 && try.mppe_128)
++                  try.mppe_40 = 0;
++              else
++                  if (try.mppe_40 && try.mppe_56)
++                      try.mppe_40 = 0;
++
++      p += CILEN_MPPE;
++      len -= CILEN_MPPE;
+     }
+ #endif /* MPPE */
++
++    if (go->lzs && len >= CILEN_LZS && p[0] == CI_LZS && p[1] == CILEN_LZS) {
++      no.lzs = 1;
++      if (((p[2]<<8)|p[3]) > 1 || (p[4] != LZS_MODE_SEQ &&
++                                   p[4] != LZS_MODE_EXT))
++          try.lzs = 0;
++      else {
++          try.lzs_mode = p[4];
++          try.lzs_hists = (p[2] << 8) | p[3];
++      }
++      p += CILEN_LZS;
++      len -= CILEN_LZS;
++    }
++
+     if (go->deflate && len >= CILEN_DEFLATE
+       && p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT)
+       && p[1] == CILEN_DEFLATE) {
+@@ -1001,14 +1254,50 @@
+       return -1;
+ #ifdef MPPE
+-    if (go->mppe && len >= CILEN_MPPE
++    if ((go->mppe || go->mppc) && len >= CILEN_MPPE
+       && p[0] == CI_MPPE && p[1] == CILEN_MPPE) {
+-      error("MPPE required but peer refused");
+-      lcp_close(f->unit, "MPPE required but peer refused");
++      ccp_options *wo = &ccp_wantoptions[f->unit];
++      if (p[2] != (go->mppe_stateless ? MPPE_STATELESS : 0) ||
++          p[3] != 0 ||
++          p[4] != 0 ||
++          p[5] != ((go->mppe_40 ? MPPE_40BIT : 0) |
++                   (go->mppe_56 ? MPPE_56BIT : 0) |
++                   (go->mppe_128 ? MPPE_128BIT : 0) |
++                   (go->mppc ? MPPE_MPPC : 0)))
++          return 0;
++      if (go->mppc)
++          try.mppc = 0;
++      if (go->mppe) {
++          try.mppe = 0;
++          if (go->mppe_40)
++              try.mppe_40 = 0;
++          if (go->mppe_56)
++              try.mppe_56 = 0;
++          if (go->mppe_128)
++              try.mppe_128 = 0;
++          if (go->mppe_stateless)
++              try.mppe_stateless = 0;
++          if (!try.mppe_56 && !try.mppe_40 && !try.mppe_128)
++              try.mppe = try.mppe_stateless = 0;
++          if (wo->mppe) { /* we want MPPE but cannot negotiate key length */
++              wo->mppc = wo->mppe = wo->mppe_stateless = wo->mppe_40 =
++                  wo->mppe_56 = wo->mppe_128 = 0;
++              lcp_close(f->unit, "MPPE required but cannot negotiate MPPE "
++                        "key length");
++          }
++      }
+       p += CILEN_MPPE;
+       len -= CILEN_MPPE;
+     }
+-#endif
++#endif /* MPPE */
++    if (go->lzs && len >= CILEN_LZS && p[0] == CI_LZS && p[1] == CILEN_LZS) {
++      if (p[2] != go->lzs_hists>>8 || p[3] != (go->lzs_hists&0xff) 
++          || p[4] != go->lzs_mode)
++          return 0;
++      try.lzs = 0;
++      p += CILEN_LZS;
++      len -= CILEN_LZS;
++    }
+     if (go->deflate_correct && len >= CILEN_DEFLATE
+       && p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) {
+       if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size)
+@@ -1072,14 +1361,15 @@
+     int dont_nak;
+ {
+     int ret, newret, res;
+-    u_char *p0, *retp;
++    u_char *p0, *retp, p2, p5;
+     int len, clen, type, nb;
+     ccp_options *ho = &ccp_hisoptions[f->unit];
+     ccp_options *ao = &ccp_allowoptions[f->unit];
++    ccp_options *wo = &ccp_wantoptions[f->unit];
+ #ifdef MPPE
+-    bool rej_for_ci_mppe = 1; /* Are we rejecting based on a bad/missing */
+-                              /* CI_MPPE, or due to other options?       */
+-#endif
++    u_char opt_buf[CILEN_MPPE + MPPE_MAX_KEY_LEN];
++/*     int mtu; */
++#endif /* MPPE */
+     ret = CONFACK;
+     retp = p0 = p;
+@@ -1102,103 +1392,305 @@
+           switch (type) {
+ #ifdef MPPE
+           case CI_MPPE:
+-              if (!ao->mppe || clen != CILEN_MPPE) {
++              if ((!ao->mppc && !ao->mppe) || clen != CILEN_MPPE) {
+                   newret = CONFREJ;
+                   break;
+               }
+-              MPPE_CI_TO_OPTS(&p[2], ho->mppe);
+-              /* Nak if anything unsupported or unknown are set. */
+-              if (ho->mppe & MPPE_OPT_UNSUPPORTED) {
+-                  newret = CONFNAK;
+-                  ho->mppe &= ~MPPE_OPT_UNSUPPORTED;
+-              }
+-              if (ho->mppe & MPPE_OPT_UNKNOWN) {
++              p2 = p[2];
++              p5 = p[5];
++              /* not sure what they want, tell 'em what we got */
++              if (((p[2] & ~MPPE_STATELESS) != 0 || p[3] != 0 || p[4] != 0 ||
++                   (p[5] & ~(MPPE_40BIT | MPPE_56BIT | MPPE_128BIT |
++                             MPPE_MPPC)) != 0 || p[5] == 0) ||
++                  (p[2] == 0 && p[3] == 0 && p[4] == 0 &&  p[5] == 0)) {
+                   newret = CONFNAK;
+-                  ho->mppe &= ~MPPE_OPT_UNKNOWN;
++                  p[2] = (wo->mppe_stateless ? MPPE_STATELESS : 0);
++                  p[3] = 0;
++                  p[4] = 0;
++                  p[5] = (wo->mppe_40 ? MPPE_40BIT : 0) |
++                      (wo->mppe_56 ? MPPE_56BIT : 0) |
++                      (wo->mppe_128 ? MPPE_128BIT : 0) |
++                      (wo->mppc ? MPPE_MPPC : 0);
++                  break;
+               }
+-              /* Check state opt */
+-              if (ho->mppe & MPPE_OPT_STATEFUL) {
+-                  /*
+-                   * We can Nak and request stateless, but it's a
+-                   * lot easier to just assume the peer will request
+-                   * it if he can do it; stateful mode is bad over
+-                   * the Internet -- which is where we expect MPPE.
+-                   */
+-                 if (refuse_mppe_stateful) {
+-                      error("Refusing MPPE stateful mode offered by peer");
++              if ((p[5] & MPPE_MPPC)) {
++                  if (ao->mppc) {
++                      ho->mppc = 1;
++                      BCOPY(p, opt_buf, CILEN_MPPE);
++                      opt_buf[2] = opt_buf[3] = opt_buf[4] = 0;
++                      opt_buf[5] = MPPE_MPPC;
++                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE, 1) <= 0) {
++                          ho->mppc = 0;
++                          p[5] &= ~MPPE_MPPC;
++                          newret = CONFNAK;
++                      }
++                  } else {
+                       newret = CONFREJ;
+-                      break;
++                      if (wo->mppe || ao->mppe) {
++                          p[5] &= ~MPPE_MPPC;
++                          newret = CONFNAK;
++                      }
++                  }
++              }
++
++              if (ao->mppe)
++                  ho->mppe = 1;
++
++              if ((p[2] & MPPE_STATELESS)) {
++                  if (ao->mppe_stateless) {
++                      if (wo->mppe_stateless)
++                          ho->mppe_stateless = 1;
++                      else {
++                          newret = CONFNAK;
++                          if (!dont_nak)
++                              p[2] &= ~MPPE_STATELESS;
++                      }
++                  } else {
++                      newret = CONFNAK;
++                      if (!dont_nak)
++                          p[2] &= ~MPPE_STATELESS;
++                  }
++              } else {
++                  if (wo->mppe_stateless && !dont_nak) {
++                      wo->mppe_stateless = 0;
++                      newret = CONFNAK;
++                      p[2] |= MPPE_STATELESS;
+                   }
+               }
+-              /* Find out which of {S,L} are set. */
+-              if ((ho->mppe & MPPE_OPT_128)
+-                   && (ho->mppe & MPPE_OPT_40)) {
+-                  /* Both are set, negotiate the strongest. */
++              if ((p[5] & ~MPPE_MPPC) == (MPPE_40BIT|MPPE_56BIT|MPPE_128BIT)) {
+                   newret = CONFNAK;
+-                  if (ao->mppe & MPPE_OPT_128)
+-                      ho->mppe &= ~MPPE_OPT_40;
+-                  else if (ao->mppe & MPPE_OPT_40)
+-                      ho->mppe &= ~MPPE_OPT_128;
+-                  else {
+-                      newret = CONFREJ;
+-                      break;
++                  if (ao->mppe_128) {
++                      ho->mppe_128 = 1;
++                      p[5] &= ~(MPPE_40BIT|MPPE_56BIT);
++                      BCOPY(p, opt_buf, CILEN_MPPE);
++                      BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
++                            MPPE_MAX_KEY_LEN);
++                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
++                                   MPPE_MAX_KEY_LEN, 1) <= 0) {
++                          ho->mppe_128 = 0;
++                          p[5] |= (MPPE_40BIT|MPPE_56BIT);
++                          p[5] &= ~MPPE_128BIT;
++                          goto check_mppe_56_40;
++                      }
++                      goto check_mppe;
+                   }
+-              } else if (ho->mppe & MPPE_OPT_128) {
+-                  if (!(ao->mppe & MPPE_OPT_128)) {
+-                      newret = CONFREJ;
+-                      break;
++                  p[5] &= ~MPPE_128BIT;
++                  goto check_mppe_56_40;
++              }
++              if ((p[5] & ~MPPE_MPPC) == (MPPE_56BIT|MPPE_128BIT)) {
++                  newret = CONFNAK;
++                  if (ao->mppe_128) {
++                      ho->mppe_128 = 1;
++                      p[5] &= ~MPPE_56BIT;
++                      BCOPY(p, opt_buf, CILEN_MPPE);
++                      BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
++                            MPPE_MAX_KEY_LEN);
++                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
++                                   MPPE_MAX_KEY_LEN, 1) <= 0) {
++                          ho->mppe_128 = 0;
++                          p[5] |= MPPE_56BIT;
++                          p[5] &= ~MPPE_128BIT;
++                          goto check_mppe_56;
++                      }
++                      goto check_mppe;
+                   }
+-              } else if (ho->mppe & MPPE_OPT_40) {
+-                  if (!(ao->mppe & MPPE_OPT_40)) {
+-                      newret = CONFREJ;
+-                      break;
++                  p[5] &= ~MPPE_128BIT;
++                  goto check_mppe_56;
++              }
++              if ((p[5] & ~MPPE_MPPC) == (MPPE_40BIT|MPPE_128BIT)) {
++                  newret = CONFNAK;
++                  if (ao->mppe_128) {
++                      ho->mppe_128 = 1;
++                      p[5] &= ~MPPE_40BIT;
++                      BCOPY(p, opt_buf, CILEN_MPPE);
++                      BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
++                            MPPE_MAX_KEY_LEN);
++                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
++                                   MPPE_MAX_KEY_LEN, 1) <= 0) {
++                          ho->mppe_128 = 0;
++                          p[5] |= MPPE_40BIT;
++                          p[5] &= ~MPPE_128BIT;
++                          goto check_mppe_40;
++                      }
++                      goto check_mppe;
++                  }
++                  p[5] &= ~MPPE_128BIT;
++                  goto check_mppe_40;
++              }
++              if ((p[5] & ~MPPE_MPPC) == MPPE_128BIT) {
++                  if (ao->mppe_128) {
++                      ho->mppe_128 = 1;
++                      BCOPY(p, opt_buf, CILEN_MPPE);
++                      BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
++                            MPPE_MAX_KEY_LEN);
++                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
++                                   MPPE_MAX_KEY_LEN, 1) <= 0) {
++                          ho->mppe_128 = 0;
++                          p[5] &= ~MPPE_128BIT;
++                          newret = CONFNAK;
++                      }
++                      goto check_mppe;
++                  }
++                  p[5] &= ~MPPE_128BIT;
++                  newret = CONFNAK;
++                  goto check_mppe;
++              }
++          check_mppe_56_40:
++              if ((p[5] & ~MPPE_MPPC) == (MPPE_40BIT|MPPE_56BIT)) {
++                  newret = CONFNAK;
++                  if (ao->mppe_56) {
++                      ho->mppe_56 = 1;
++                      p[5] &= ~MPPE_40BIT;
++                      BCOPY(p, opt_buf, CILEN_MPPE);
++                      BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
++                            MPPE_MAX_KEY_LEN);
++                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
++                                   MPPE_MAX_KEY_LEN, 1) <= 0) {
++                          ho->mppe_56 = 0;
++                          p[5] |= MPPE_40BIT;
++                          p[5] &= ~MPPE_56BIT;
++                          newret = CONFNAK;
++                          goto check_mppe_40;
++                      }
++                      goto check_mppe;
++                  }
++                  p[5] &= ~MPPE_56BIT;
++                  goto check_mppe_40;
++              }
++          check_mppe_56:
++              if ((p[5] & ~MPPE_MPPC) == MPPE_56BIT) {
++                  if (ao->mppe_56) {
++                      ho->mppe_56 = 1;
++                      BCOPY(p, opt_buf, CILEN_MPPE);
++                      BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
++                            MPPE_MAX_KEY_LEN);
++                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
++                                   MPPE_MAX_KEY_LEN, 1) <= 0) {
++                          ho->mppe_56 = 0;
++                          p[5] &= ~MPPE_56BIT;
++                          newret = CONFNAK;
++                      }
++                      goto check_mppe;
++                  }
++                  p[5] &= ~MPPE_56BIT;
++                  newret = CONFNAK;
++                  goto check_mppe;
++              }
++          check_mppe_40:
++              if ((p[5] & ~MPPE_MPPC) == MPPE_40BIT) {
++                  if (ao->mppe_40) {
++                      ho->mppe_40 = 1;
++                      BCOPY(p, opt_buf, CILEN_MPPE);
++                      BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
++                            MPPE_MAX_KEY_LEN);
++                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
++                                   MPPE_MAX_KEY_LEN, 1) <= 0) {
++                          ho->mppe_40 = 0;
++                          p[5] &= ~MPPE_40BIT;
++                          newret = CONFNAK;
++                      }
++                      goto check_mppe;
++                  }
++                  p[5] &= ~MPPE_40BIT;
++              }
++
++          check_mppe:
++              if (!ho->mppe_40 && !ho->mppe_56 && !ho->mppe_128) {
++                  if (wo->mppe_40 || wo->mppe_56 || wo->mppe_128) {
++                      newret = CONFNAK;
++                      p[2] |= (wo->mppe_stateless ? MPPE_STATELESS : 0);
++                      p[5] |= (wo->mppe_40 ? MPPE_40BIT : 0) |
++                          (wo->mppe_56 ? MPPE_56BIT : 0) |
++                          (wo->mppe_128 ? MPPE_128BIT : 0) |
++                          (wo->mppc ? MPPE_MPPC : 0);
++                  } else {
++                      ho->mppe = ho->mppe_stateless = 0;
+                   }
+               } else {
+-                  /* Neither are set. */
++                  /* MPPE is not compatible with other compression types */
++                  if (wo->mppe) {
++                      ao->bsd_compress = 0;
++                      ao->predictor_1 = 0;
++                      ao->predictor_2 = 0;
++                      ao->deflate = 0;
++                      ao->lzs = 0;
++                  }
++              }
++              if ((!ho->mppc || !ao->mppc) && !ho->mppe) {
++                  p[2] = p2;
++                  p[5] = p5;
+                   newret = CONFREJ;
+                   break;
+               }
+-              /* rebuild the opts */
+-              MPPE_OPTS_TO_CI(ho->mppe, &p[2]);
+-              if (newret == CONFACK) {
+-                  u_char opt_buf[CILEN_MPPE + MPPE_MAX_KEY_LEN];
+-                  int mtu;
+-
+-                  BCOPY(p, opt_buf, CILEN_MPPE);
+-                  BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
+-                        MPPE_MAX_KEY_LEN);
+-                  if (ccp_test(f->unit, opt_buf,
+-                               CILEN_MPPE + MPPE_MAX_KEY_LEN, 1) <= 0) {
+-                      /* This shouldn't happen, we've already tested it! */
+-                      error("MPPE required, but kernel has no support.");
+-                      lcp_close(f->unit, "MPPE required but not available");
+-                      newret = CONFREJ;
+-                      break;
+-                  }
+-                  /*
+-                   * We need to decrease the interface MTU by MPPE_PAD
+-                   * because MPPE frames **grow**.  The kernel [must]
+-                   * allocate MPPE_PAD extra bytes in xmit buffers.
+-                   */
+-                  mtu = netif_get_mtu(f->unit);
+-                  if (mtu)
+-                      netif_set_mtu(f->unit, mtu - MPPE_PAD);
+-                  else
+-                      newret = CONFREJ;
+-              }
++              /*
++               * I have commented the code below because according to RFC1547
++               * MTU is only information for higher level protocols about
++               * "the maximum allowable length for a packet (q.v.) transmitted
++               * over a point-to-point link without incurring network layer
++               * fragmentation." Of course a PPP implementation should be able
++               * to handle overhead added by MPPE - in our case apropriate code
++               * is located in drivers/net/ppp_generic.c in the kernel sources.
++               *
++               * According to RFC1661:
++               * - when negotiated MRU is less than 1500 octets, a PPP
++               *   implementation must still be able to receive at least 1500
++               *   octets,
++               * - when PFC is negotiated, a PPP implementation is still
++               *   required to receive frames with uncompressed protocol field.
++               *
++               * So why not to handle MPPE overhead without changing MTU value?
++               * I am sure that RFC3078, unfortunately silently, assumes that.
++               */
+               /*
+-               * We have accepted MPPE or are willing to negotiate
+-               * MPPE parameters.  A CONFREJ is due to subsequent
+-               * (non-MPPE) processing.
++               * We need to decrease the interface MTU by MPPE_PAD
++               * because MPPE frames **grow**.  The kernel [must]
++               * allocate MPPE_PAD extra bytes in xmit buffers.
+                */
+-              rej_for_ci_mppe = 0;
++/*
++              mtu = netif_get_mtu(f->unit);
++              if (mtu) {
++                  netif_set_mtu(f->unit, mtu - MPPE_PAD);
++              } else {
++                  newret = CONFREJ;
++                  if (ccp_wantoptions[f->unit].mppe) {
++                      error("Cannot adjust MTU needed by MPPE.");
++                      lcp_close(f->unit, "Cannot adjust MTU needed by MPPE.");
++                  }
++              }
++*/
+               break;
+ #endif /* MPPE */
++
++          case CI_LZS:
++              if (!ao->lzs || clen != CILEN_LZS) {
++                  newret = CONFREJ;
++                  break;
++              }
++
++              ho->lzs = 1;
++              ho->lzs_hists = (p[2] << 8) | p[3];
++              ho->lzs_mode = p[4];
++              if ((ho->lzs_hists != ao->lzs_hists) ||
++                  (ho->lzs_mode != ao->lzs_mode)) {
++                  newret = CONFNAK;
++                  if (!dont_nak) {
++                      p[2] = ao->lzs_hists >> 8;
++                      p[3] = ao->lzs_hists & 0xff;
++                      p[4] = ao->lzs_mode;
++                  } else
++                      break;
++              }
++
++              if (p == p0 && ccp_test(f->unit, p, CILEN_LZS, 1) <= 0) {
++                  newret = CONFREJ;
++              }
++              break;
++
+           case CI_DEFLATE:
+           case CI_DEFLATE_DRAFT:
+               if (!ao->deflate || clen != CILEN_DEFLATE
+@@ -1340,12 +1832,6 @@
+       else
+           *lenp = retp - p0;
+     }
+-#ifdef MPPE
+-    if (ret == CONFREJ && ao->mppe && rej_for_ci_mppe) {
+-      error("MPPE required but peer negotiation failed");
+-      lcp_close(f->unit, "MPPE required but peer negotiation failed");
+-    }
+-#endif
+     return ret;
+ }
+@@ -1367,24 +1853,35 @@
+       char *p = result;
+       char *q = result + sizeof(result); /* 1 past result */
+-      slprintf(p, q - p, "MPPE ");
+-      p += 5;
+-      if (opt->mppe & MPPE_OPT_128) {
+-          slprintf(p, q - p, "128-bit ");
+-          p += 8;
+-      }
+-      if (opt->mppe & MPPE_OPT_40) {
+-          slprintf(p, q - p, "40-bit ");
+-          p += 7;
+-      }
+-      if (opt->mppe & MPPE_OPT_STATEFUL)
+-          slprintf(p, q - p, "stateful");
+-      else
+-          slprintf(p, q - p, "stateless");
+-
++      if (opt->mppe) {
++          if (opt->mppc) {
++              slprintf(p, q - p, "MPPC/MPPE ");
++              p += 10;
++          } else {
++              slprintf(p, q - p, "MPPE ");
++              p += 5;
++          }
++          if (opt->mppe_128) {
++              slprintf(p, q - p, "128-bit ");
++              p += 8;
++          } else if (opt->mppe_56) {
++              slprintf(p, q - p, "56-bit ");
++              p += 7;
++          } else if (opt->mppe_40) {
++              slprintf(p, q - p, "40-bit ");
++              p += 7;
++          }
++          if (opt->mppe_stateless)
++              slprintf(p, q - p, "stateless");
++          else
++              slprintf(p, q - p, "stateful");
++      } else if (opt->mppc)
++          slprintf(p, q - p, "MPPC");
+       break;
+     }
+-#endif
++#endif /* MPPE */
++    case CI_LZS:
++      return "Stac LZS";
+     case CI_DEFLATE:
+     case CI_DEFLATE_DRAFT:
+       if (opt2 != NULL && opt2->deflate_size != opt->deflate_size)
+@@ -1440,12 +1937,12 @@
+     } else if (ANY_COMPRESS(*ho))
+       notice("%s transmit compression enabled", method_name(ho, NULL));
+ #ifdef MPPE
+-    if (go->mppe) {
++    if (go->mppe || go->mppc) {
+       BZERO(mppe_recv_key, MPPE_MAX_KEY_LEN);
+       BZERO(mppe_send_key, MPPE_MAX_KEY_LEN);
+       continue_networks(f->unit);             /* Bring up IP et al */
+     }
+-#endif
++#endif /* MPPE */
+ }
+ /*
+@@ -1468,7 +1965,7 @@
+           lcp_close(f->unit, "MPPE disabled");
+       }
+     }
+-#endif
++#endif /* MPPE */
+ }
+ /*
+@@ -1528,24 +2025,28 @@
+ #ifdef MPPE
+           case CI_MPPE:
+               if (optlen >= CILEN_MPPE) {
+-                  u_char mppe_opts;
+-
+-                  MPPE_CI_TO_OPTS(&p[2], mppe_opts);
+-                  printer(arg, "mppe %s %s %s %s %s %s%s",
+-                          (p[2] & MPPE_H_BIT)? "+H": "-H",
+-                          (p[5] & MPPE_M_BIT)? "+M": "-M",
+-                          (p[5] & MPPE_S_BIT)? "+S": "-S",
+-                          (p[5] & MPPE_L_BIT)? "+L": "-L",
++                  printer(arg, "mppe %s %s %s %s %s %s",
++                          (p[2] & MPPE_STATELESS)? "+H": "-H",
++                          (p[5] & MPPE_56BIT)? "+M": "-M",
++                          (p[5] & MPPE_128BIT)? "+S": "-S",
++                          (p[5] & MPPE_40BIT)? "+L": "-L",
+                           (p[5] & MPPE_D_BIT)? "+D": "-D",
+-                          (p[5] & MPPE_C_BIT)? "+C": "-C",
+-                          (mppe_opts & MPPE_OPT_UNKNOWN)? " +U": "");
+-                  if (mppe_opts & MPPE_OPT_UNKNOWN)
++                          (p[5] & MPPE_MPPC)? "+C": "-C");
++                  if ((p[5] & ~(MPPE_56BIT | MPPE_128BIT | MPPE_40BIT |
++                                MPPE_D_BIT | MPPE_MPPC)) ||
++                      (p[2] & ~MPPE_STATELESS))
+                       printer(arg, " (%.2x %.2x %.2x %.2x)",
+                               p[2], p[3], p[4], p[5]);
+                   p += CILEN_MPPE;
+               }
+               break;
+-#endif
++#endif /* MPPE */
++          case CI_LZS:
++              if (optlen >= CILEN_LZS) {
++                  printer(arg, "lzs %.2x %.2x %.2x", p[2], p[3], p[4]);
++                  p += CILEN_LZS;
++              }
++              break;
+           case CI_DEFLATE:
+           case CI_DEFLATE_DRAFT:
+               if (optlen >= CILEN_DEFLATE) {
+@@ -1631,6 +2132,7 @@
+           error("Lost compression sync: disabling compression");
+           ccp_close(unit, "Lost compression sync");
+ #ifdef MPPE
++          /* My module dosn't need this. J.D., 2003-07-06 */
+           /*
+            * If we were doing MPPE, we must also take the link down.
+            */
+@@ -1638,9 +2140,18 @@
+               error("Too many MPPE errors, closing LCP");
+               lcp_close(unit, "Too many MPPE errors");
+           }
+-#endif
++#endif /* MPPE */
+       } else {
+           /*
++           * When LZS or MPPE/MPPC is negotiated we just send CCP_RESETREQ
++           * and don't wait for CCP_RESETACK
++           */
++          if ((ccp_gotoptions[f->unit].method == CI_LZS) ||
++              (ccp_gotoptions[f->unit].method == CI_MPPE)) {
++              fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0);
++              return;
++          }
++          /*
+            * Send a reset-request to reset the peer's compressor.
+            * We don't do that if we are still waiting for an
+            * acknowledgement to a previous reset-request.
+@@ -1671,4 +2182,3 @@
+     } else
+       ccp_localstate[f->unit] &= ~RACK_PENDING;
+ }
+-
+diff -ruN ppp-2.4.3.orig/pppd/ccp.h ppp-2.4.3/pppd/ccp.h
+--- ppp-2.4.3.orig/pppd/ccp.h  2004-11-04 11:02:26.000000000 +0100
++++ ppp-2.4.3/pppd/ccp.h       2004-11-21 13:54:09.000000000 +0100
+@@ -37,9 +37,17 @@
+     bool predictor_2;         /* do Predictor-2? */
+     bool deflate_correct;     /* use correct code for deflate? */
+     bool deflate_draft;               /* use draft RFC code for deflate? */
++    bool lzs;                 /* do Stac LZS? */
++    bool mppc;                        /* do MPPC? */
+     bool mppe;                        /* do MPPE? */
++    bool mppe_40;             /* allow 40 bit encryption? */
++    bool mppe_56;             /* allow 56 bit encryption? */
++    bool mppe_128;            /* allow 128 bit encryption? */
++    bool mppe_stateless;      /* allow stateless encryption */
+     u_short bsd_bits;         /* # bits/code for BSD Compress */
+     u_short deflate_size;     /* lg(window size) for Deflate */
++    u_short lzs_mode;         /* LZS check mode */
++    u_short lzs_hists;                /* number of LZS histories */
+     short method;             /* code for chosen compression method */
+ } ccp_options;
+diff -ruN ppp-2.4.3.orig/pppd/chap_ms.c ppp-2.4.3/pppd/chap_ms.c
+--- ppp-2.4.3.orig/pppd/chap_ms.c      2004-11-12 10:57:43.000000000 +0100
++++ ppp-2.4.3/pppd/chap_ms.c   2004-11-21 13:54:09.000000000 +0100
+@@ -895,13 +895,17 @@
+     /*
+      * Disable undesirable encryption types.  Note that we don't ENABLE
+      * any encryption types, to avoid overriding manual configuration.
++     *
++     * It seems that 56 bit keys are unsupported in MS-RADIUS (see RFC 2548)
+      */
+     switch(types) {
+       case MPPE_ENC_TYPES_RC4_40:
+-          ccp_wantoptions[0].mppe &= ~MPPE_OPT_128;   /* disable 128-bit */
++          ccp_wantoptions[0].mppe_128 = 0;    /* disable 128-bit */
++          ccp_wantoptions[0].mppe_56 = 0;     /* disable 56-bit */
+           break;
+       case MPPE_ENC_TYPES_RC4_128:
+-          ccp_wantoptions[0].mppe &= ~MPPE_OPT_40;    /* disable 40-bit */
++          ccp_wantoptions[0].mppe_56 = 0;     /* disable 56-bit */
++          ccp_wantoptions[0].mppe_40 = 0;     /* disable 40-bit */
+           break;
+       default:
+           break;
+diff -ruN ppp-2.4.3.orig/pppd/pppd.8 ppp-2.4.3/pppd/pppd.8
+--- ppp-2.4.3.orig/pppd/pppd.8 2004-11-13 13:22:49.000000000 +0100
++++ ppp-2.4.3/pppd/pppd.8      2004-11-21 14:24:47.000000000 +0100
+@@ -622,9 +622,29 @@
+ Enables the use of PPP multilink; this is an alias for the `multilink'
+ option.  This option is currently only available under Linux.
+ .TP
+-.B mppe\-stateful
+-Allow MPPE to use stateful mode.  Stateless mode is still attempted first.
+-The default is to disallow stateful mode.  
++.B mppc
++Enables MPPC (Microsoft Point to Point Compression).  This is the default.
++.TP
++.B mppe \fIsubopt1[,subopt2[,subopt3[..]]]
++Modify MPPE (Microsoft Point to Point Encryption) parameters. In order
++for MPPE to successfully come up, you must have authenticated with either
++MS-CHAP or MS-CHAPv2. By default MPPE is optional, it means that pppd will
++not propose MPPE to the peer, but will negotiate MPPE if peer wants that.
++You can change this using \fIrequired\fR suboption.
++This option is presently only supported under Linux, and only if your
++kernel has been configured to include MPPE support.
++.IP
++MPPE suboptions:
++.br
++\fIrequired\fR - require MPPE; disconnect if peer doesn't support it,
++.br
++\fIstateless\fR - try to negotiate stateless mode; default is stateful,
++.br
++\fIno40\fR - disable 40 bit keys,
++.br
++\fIno56\fR - disable 56 bit keys,
++.br
++\fIno128\fR - disable 128 bit keys
+ .TP
+ .B mpshortseq
+ Enables the use of short (12-bit) sequence numbers in multilink
+@@ -757,17 +777,11 @@
+ Disables the use of PPP multilink.  This option is currently only
+ available under Linux.
+ .TP
+-.B nomppe
+-Disables MPPE (Microsoft Point to Point Encryption).  This is the default.
+-.TP
+-.B nomppe\-40
+-Disable 40-bit encryption with MPPE.
++.B nomppc
++Disables MPPC (Microsoft Point to Point Compression).
+ .TP
+-.B nomppe\-128
+-Disable 128-bit encryption with MPPE.
+-.TP
+-.B nomppe\-stateful
+-Disable MPPE stateful mode.  This is the default.
++.B nomppe
++Disables MPPE (Microsoft Point to Point Encryption).
+ .TP
+ .B nompshortseq
+ Disables the use of short (12-bit) sequence numbers in the PPP
+@@ -948,19 +962,6 @@
+ Require the peer to authenticate itself using CHAP [Challenge
+ Handshake Authentication Protocol] authentication.
+ .TP
+-.B require\-mppe
+-Require the use of MPPE (Microsoft Point to Point Encryption).  This
+-option disables all other compression types.  This option enables
+-both 40-bit and 128-bit encryption.  In order for MPPE to successfully
+-come up, you must have authenticated with either MS\-CHAP or MS\-CHAPv2.
+-This option is presently only supported under Linux, and only if your
+-kernel has been configured to include MPPE support.
+-.TP
+-.B require\-mppe\-40
+-Require the use of MPPE, with 40-bit encryption.
+-.TP
+-.B require\-mppe\-128
+-Require the use of MPPE, with 128-bit encryption.
+ .TP
+ .B require\-mschap
+ Require the peer to authenticate itself using MS\-CHAP [Microsoft Challenge
diff --git a/openwrt/package/ppp/patches/202-no_atm.patch b/openwrt/package/ppp/patches/202-no_atm.patch
new file mode 100644 (file)
index 0000000..a737cfa
--- /dev/null
@@ -0,0 +1,12 @@
+diff -ruN ppp-2.4.3-orig/pppd/plugins/Makefile.linux ppp-2.4.3-3/pppd/plugins/Makefile.linux
+--- ppp-2.4.3-orig/pppd/plugins/Makefile.linux 2004-11-14 08:57:35.000000000 +0100
++++ ppp-2.4.3-3/pppd/plugins/Makefile.linux    2004-12-05 17:03:59.000000000 +0100
+@@ -9,7 +9,7 @@
+ MANDIR = $(DESTDIR)/share/man/man8
+ LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION)
+-SUBDIRS := rp-pppoe pppoatm radius
++SUBDIRS := rp-pppoe radius
+ # Uncomment the next line to include the radius authentication plugin
+ # SUBDIRS += radius
+ PLUGINS := minconn.so passprompt.so passwordfd.so winbind.so
diff --git a/openwrt/package/ppp/patches/203-no_strip.patch b/openwrt/package/ppp/patches/203-no_strip.patch
new file mode 100644 (file)
index 0000000..216973c
--- /dev/null
@@ -0,0 +1,86 @@
+diff -ruN ppp-2.4.3-orig/chat/Makefile.linux ppp-2.4.3-3/chat/Makefile.linux
+--- ppp-2.4.3-orig/chat/Makefile.linux 2004-11-03 12:51:47.000000000 +0100
++++ ppp-2.4.3-3/chat/Makefile.linux    2004-12-05 17:42:43.000000000 +0100
+@@ -25,7 +25,7 @@
+ install: chat
+       mkdir -p $(BINDIR)
+-      $(INSTALL) -s -c chat $(BINDIR)
++      $(INSTALL) -c chat $(BINDIR)
+       $(INSTALL) -c -m 644 chat.8 $(MANDIR)
+ clean:
+diff -ruN ppp-2.4.3-orig/pppd/Makefile.linux ppp-2.4.3-3/pppd/Makefile.linux
+--- ppp-2.4.3-orig/pppd/Makefile.linux 2004-11-13 13:02:22.000000000 +0100
++++ ppp-2.4.3-3/pppd/Makefile.linux    2004-12-16 04:43:41.000000000 +0100
+@@ -99,7 +99,7 @@
+ CFLAGS        += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
+ LIBS  += -lsrp -L/usr/local/ssl/lib -lcrypto
+ TARGETS       += srp-entry
+-EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry
++EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry
+ MANPAGES += srp-entry.8
+ EXTRACLEAN += srp-entry.o
+ NEEDDES=y
+@@ -202,7 +202,7 @@
+ install: pppd
+       mkdir -p $(BINDIR) $(MANDIR)
+       $(EXTRAINSTALL)
+-      $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd
++      $(INSTALL) -c -m 555 pppd $(BINDIR)/pppd
+       if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
+         chmod o-rx,u+s $(BINDIR)/pppd; fi
+       $(INSTALL) -c -m 444 pppd.8 $(MANDIR)
+diff -ruN ppp-2.4.3-orig/pppd/plugins/radius/Makefile.linux ppp-2.4.3-3/pppd/plugins/radius/Makefile.linux
+--- ppp-2.4.3-orig/pppd/plugins/radius/Makefile.linux  2004-11-14 08:02:31.000000000 +0100
++++ ppp-2.4.3-3/pppd/plugins/radius/Makefile.linux     2004-12-05 17:43:17.000000000 +0100
+@@ -36,9 +37,9 @@
+ install: all
+       $(INSTALL) -d -m 755 $(LIBDIR)
+-      $(INSTALL) -s -c -m 755 radius.so $(LIBDIR)
+-      $(INSTALL) -s -c -m 755 radattr.so $(LIBDIR)
+-      $(INSTALL) -s -c -m 755 radrealms.so $(LIBDIR)
++      $(INSTALL) -c -m 755 radius.so $(LIBDIR)
++      $(INSTALL) -c -m 755 radattr.so $(LIBDIR)
++      $(INSTALL) -c -m 755 radrealms.so $(LIBDIR)
+       $(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR)
+       $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)
+diff -ruN ppp-2.4.3-orig/pppd/plugins/rp-pppoe/Makefile.linux ppp-2.4.3-3/pppd/plugins/rp-pppoe/Makefile.linux
+--- ppp-2.4.3-orig/pppd/plugins/rp-pppoe/Makefile.linux        2004-11-14 08:58:37.000000000 +0100
++++ ppp-2.4.3-3/pppd/plugins/rp-pppoe/Makefile.linux   2004-12-05 17:43:23.000000000 +0100
+@@ -39,9 +39,9 @@
+ install: all
+       $(INSTALL) -d -m 755 $(LIBDIR)
+-      $(INSTALL) -s -c -m 4550 rp-pppoe.so $(LIBDIR)
++      $(INSTALL) -c -m 4550 rp-pppoe.so $(LIBDIR)
+       $(INSTALL) -d -m 755 $(BINDIR)
+-      $(INSTALL) -s -c -m 555 pppoe-discovery $(BINDIR)
++      $(INSTALL) -c -m 555 pppoe-discovery $(BINDIR)
+ clean:
+       rm -f *.o *.so
+diff -ruN ppp-2.4.3-orig/pppdump/Makefile.linux ppp-2.4.3-3/pppdump/Makefile.linux
+--- ppp-2.4.3-orig/pppdump/Makefile.linux      2004-10-31 02:36:52.000000000 +0200
++++ ppp-2.4.3-3/pppdump/Makefile.linux 2004-12-05 17:50:34.000000000 +0100
+@@ -17,5 +18,5 @@
+ install:
+       mkdir -p $(BINDIR) $(MANDIR)
+-      $(INSTALL) -s -c pppdump $(BINDIR)
++      $(INSTALL) -c pppdump $(BINDIR)
+       $(INSTALL) -c -m 444 pppdump.8 $(MANDIR)
+diff -ruN ppp-2.4.3-orig/pppstats/Makefile.linux ppp-2.4.3-3/pppstats/Makefile.linux
+--- ppp-2.4.3-orig/pppstats/Makefile.linux     2004-10-31 23:09:03.000000000 +0100
++++ ppp-2.4.3-3/pppstats/Makefile.linux        2004-12-05 17:43:38.000000000 +0100
+@@ -22,7 +22,7 @@
+ install: pppstats
+       -mkdir -p $(MANDIR)
+-      $(INSTALL) -s -c pppstats $(BINDIR)
++      $(INSTALL) -c pppstats $(BINDIR)
+       $(INSTALL) -c -m 444 pppstats.8 $(MANDIR)
+ pppstats: $(PPPSTATSRCS)
diff --git a/openwrt/package/ppp/patches/204-opt_flags.patch b/openwrt/package/ppp/patches/204-opt_flags.patch
new file mode 100644 (file)
index 0000000..200e76b
--- /dev/null
@@ -0,0 +1,26 @@
+diff -ruN ppp-2.4.3-orig/pppd/plugins/radius/Makefile.linux ppp-2.4.3-3/pppd/plugins/radius/Makefile.linux
+--- ppp-2.4.3-orig/pppd/plugins/radius/Makefile.linux  2004-11-14 08:02:31.000000000 +0100
++++ ppp-2.4.3-3/pppd/plugins/radius/Makefile.linux     2004-12-05 17:43:17.000000000 +0100
+@@ -12,7 +12,8 @@
+ INSTALL       = install
+ PLUGIN=radius.so radattr.so radrealms.so
+-CFLAGS=-I. -I../.. -I../../../include -O2 -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
++COPTS = -O2
++CFLAGS=-I. -I../.. -I../../../include $(COPTS) -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
+ # Uncomment the next line to include support for Microsoft's
+ # MS-CHAP authentication protocol.
+diff -ruN ppp-2.4.3-orig/pppdump/Makefile.linux ppp-2.4.3-3/pppdump/Makefile.linux
+--- ppp-2.4.3-orig/pppdump/Makefile.linux      2004-10-31 02:36:52.000000000 +0200
++++ ppp-2.4.3-3/pppdump/Makefile.linux 2004-12-05 17:50:34.000000000 +0100
+@@ -2,7 +2,8 @@
+ BINDIR = $(DESTDIR)/sbin
+ MANDIR = $(DESTDIR)/share/man/man8
+-CFLAGS= -O -I../include/net
++COPTS = -O
++CFLAGS= $(COPTS) -I../include/net
+ OBJS = pppdump.o bsd-comp.o deflate.o zlib.o
+ INSTALL= install
diff --git a/openwrt/package/ppp/patches/205-pppoe_iface_name.patch b/openwrt/package/ppp/patches/205-pppoe_iface_name.patch
new file mode 100644 (file)
index 0000000..0961eca
--- /dev/null
@@ -0,0 +1,12 @@
+diff -ruN ppp-2.4.3-orig/pppd/plugins/rp-pppoe/plugin.c ppp-2.4.3-3/pppd/plugins/rp-pppoe/plugin.c
+--- ppp-2.4.3-orig/pppd/plugins/rp-pppoe/plugin.c      2004-11-04 11:07:37.000000000 +0100
++++ ppp-2.4.3-3/pppd/plugins/rp-pppoe/plugin.c 2004-12-16 01:07:22.000000000 +0100
+@@ -286,7 +286,7 @@
+       /* Strip off "nic-" */
+       cmd += 4;
+     } else if (strlen(cmd) < 4
+-             || (strncmp(cmd, "eth", 3) && strncmp(cmd, "nas", 3)
++             || (strncmp(cmd, "eth", 3) && strncmp(cmd, "nas", 3) && strncmp(cmd, "vlan", 4) && strncmp(cmd, "ath", 3)
+                  && strncmp(cmd, "tap", 3) && strncmp(cmd, "br", 2))) {
+       return 0;
+     }
diff --git a/openwrt/package/ppp/patches/206-radius_config.patch b/openwrt/package/ppp/patches/206-radius_config.patch
new file mode 100644 (file)
index 0000000..90c02af
--- /dev/null
@@ -0,0 +1,74 @@
+diff -ruN ppp-2.4.3-orig/pppd/plugins/radius/config.c ppp-2.4.3-3/pppd/plugins/radius/config.c
+--- ppp-2.4.3-orig/pppd/plugins/radius/config.c        2004-11-14 08:26:26.000000000 +0100
++++ ppp-2.4.3-3/pppd/plugins/radius/config.c   2004-12-16 04:03:46.000000000 +0100
+@@ -369,31 +369,37 @@
+       }
+ #endif
++#if 0
+       if (rc_conf_int("login_tries") <= 0)
+       {
+               error("%s: login_tries <= 0 is illegal", filename);
+               return (-1);
+       }
++#endif
+       if (rc_conf_str("seqfile") == NULL)
+       {
+               error("%s: seqfile not specified", filename);
+               return (-1);
+       }
++#if 0
+       if (rc_conf_int("login_timeout") <= 0)
+       {
+               error("%s: login_timeout <= 0 is illegal", filename);
+               return (-1);
+       }
++#endif
+       if (rc_conf_str("mapfile") == NULL)
+       {
+               error("%s: mapfile not specified", filename);
+               return (-1);
+       }
++#if 0
+       if (rc_conf_str("nologin") == NULL)
+       {
+               error("%s: nologin not specified", filename);
+               return (-1);
+       }
++#endif
+       return 0;
+ }
+diff -ruN ppp-2.4.3-orig/pppd/plugins/radius/options.h ppp-2.4.3-3/pppd/plugins/radius/options.h
+--- ppp-2.4.3-orig/pppd/plugins/radius/options.h       2004-11-14 08:26:26.000000000 +0100
++++ ppp-2.4.3-3/pppd/plugins/radius/options.h  2004-12-16 04:09:16.000000000 +0100
+@@ -31,24 +31,21 @@
+ static SERVER acctserver = {0};
+ static SERVER authserver = {0};
+-int default_tries = 4;
+-int default_timeout = 60;
+-
+ static OPTION config_options[] = {
+ /* internally used options */
+ {"config_file",               OT_STR, ST_UNDEF, NULL},
+ /* General options */
+ {"auth_order",                OT_AUO, ST_UNDEF, NULL},
+-{"login_tries",               OT_INT, ST_UNDEF, &default_tries},
+-{"login_timeout",     OT_INT, ST_UNDEF, &default_timeout},
+-{"nologin",           OT_STR, ST_UNDEF, "/etc/nologin"},
+-{"issue",             OT_STR, ST_UNDEF, "/etc/radiusclient/issue"},
++{"login_tries",               OT_INT, ST_UNDEF, NULL},
++{"login_timeout",     OT_INT, ST_UNDEF, NULL},
++{"nologin",           OT_STR, ST_UNDEF, NULL},
++{"issue",             OT_STR, ST_UNDEF, NULL},
+ /* RADIUS specific options */
+ {"authserver",                OT_SRV, ST_UNDEF, &authserver},
+ {"acctserver",                OT_SRV, ST_UNDEF, &acctserver},
+ {"servers",           OT_STR, ST_UNDEF, NULL},
+ {"dictionary",                OT_STR, ST_UNDEF, NULL},
+-{"login_radius",      OT_STR, ST_UNDEF, "/usr/sbin/login.radius"},
++{"login_radius",      OT_STR, ST_UNDEF, NULL},
+ {"seqfile",           OT_STR, ST_UNDEF, NULL},
+ {"mapfile",           OT_STR, ST_UNDEF, NULL},
+ {"default_realm",     OT_STR, ST_UNDEF, NULL},
diff --git a/openwrt/package/ppp/patches/207-ppp_reconnect.patch b/openwrt/package/ppp/patches/207-ppp_reconnect.patch
new file mode 100644 (file)
index 0000000..9311c9e
--- /dev/null
@@ -0,0 +1,129 @@
+diff -urN -x'*.swp' ppp.old/pppd/auth.c ppp.dev/pppd/auth.c
+--- ppp.old/pppd/auth.c        2004-11-12 11:30:51.000000000 +0100
++++ ppp.dev/pppd/auth.c        2005-07-13 14:54:23.000000000 +0200
+@@ -532,6 +532,12 @@
+ link_required(unit)
+     int unit;
+ {
++}
++
++void
++start_link(unit)
++    int unit;
++{
+     new_phase(PHASE_SERIALCONN);
+     devfd = the_channel->connect();
+@@ -984,10 +990,12 @@
+     int unit, protocol, prot_flavor;
+ {
+     int bit;
++    const char *prot = "";
+     switch (protocol) {
+     case PPP_CHAP:
+       bit = CHAP_WITHPEER;
++      prot = "CHAP";
+       switch (prot_flavor) {
+       case CHAP_MD5:
+           bit |= CHAP_MD5_WITHPEER;
+@@ -1006,15 +1014,19 @@
+       if (passwd_from_file)
+           BZERO(passwd, MAXSECRETLEN);
+       bit = PAP_WITHPEER;
++      prot = "PAP";
+       break;
+     case PPP_EAP:
+       bit = EAP_WITHPEER;
++      prot = "EAP";
+       break;
+     default:
+       warn("auth_withpeer_success: unknown protocol %x", protocol);
+       bit = 0;
+     }
++    notice("%s authentication succeeded", prot);
++
+     /* Save the authentication method for later. */
+     auth_done[unit] |= bit;
+@@ -1648,6 +1660,7 @@
+ static void
+ plogout()
+ {
++    char *tty;
+ #ifdef USE_PAM
+     int pam_error;
+@@ -1658,14 +1671,12 @@
+     }
+     /* Apparently the pam stuff does closelog(). */
+     reopen_log();
+-#else /* ! USE_PAM */   
+-    char *tty;
++#endif /* USE_PAM */
+     tty = devnam;
+     if (strncmp(tty, "/dev/", 5) == 0)
+       tty += 5;
+     logwtmp(tty, "", "");             /* Wipe out utmp logout entry */
+-#endif /* ! USE_PAM */
+     logged_in = 0;
+ }
+diff -urN -x'*.swp' ppp.old/pppd/main.c ppp.dev/pppd/main.c
+--- ppp.old/pppd/main.c        2005-07-13 11:34:28.000000000 +0200
++++ ppp.dev/pppd/main.c        2005-07-13 14:49:06.000000000 +0200
+@@ -537,6 +537,7 @@
+       script_unsetenv("BYTES_RCVD");
+       lcp_open(0);            /* Start protocol */
++      start_link(0);
+       while (phase != PHASE_DEAD) {
+           handle_events();
+           get_input();
+diff -urN -x'*.swp' ppp.old/pppd/pppd.h ppp.dev/pppd/pppd.h
+--- ppp.old/pppd/pppd.h        2005-07-13 11:34:28.000000000 +0200
++++ ppp.dev/pppd/pppd.h        2005-07-13 14:48:56.000000000 +0200
+@@ -526,6 +526,7 @@
+ /* Procedures exported from auth.c */
+ void link_required __P((int));          /* we are starting to use the link */
++void start_link __P((int));     /* bring the link up now */
+ void link_terminated __P((int));  /* we are finished with the link */
+ void link_down __P((int));      /* the LCP layer has left the Opened state */
+ void upper_layers_down __P((int));/* take all NCPs down */
+diff -urN -x'*.swp' ppp.old/pppd/tty.c ppp.dev/pppd/tty.c
+--- ppp.old/pppd/tty.c 2004-11-13 13:07:29.000000000 +0100
++++ ppp.dev/pppd/tty.c 2005-07-13 14:46:57.000000000 +0200
+@@ -755,14 +755,6 @@
+               close(pty_master);
+               pty_master = -1;
+       }
+-      if (pty_slave >= 0) {
+-              close(pty_slave);
+-              pty_slave = -1;
+-      }
+-      if (real_ttyfd >= 0) {
+-              close(real_ttyfd);
+-              real_ttyfd = -1;
+-      }
+       ttyfd = -1;
+       if (got_sigterm)
+               asked_to_quit = 1;
+@@ -781,6 +773,7 @@
+       } else {
+               info("Serial link disconnected.");
+       }
++      stop_charshunt(NULL, 0);
+ }
+ void tty_close_fds()
+@@ -944,7 +937,6 @@
+       exit(0);
+     }
+     charshunt_pid = cpid;
+-    add_notifier(&sigreceived, stop_charshunt, 0);
+     record_child(cpid, "pppd (charshunt)", charshunt_done, NULL);
+     return 1;
+ }
diff --git a/openwrt/package/ppp/patches/208-no_exponential_timeout.patch b/openwrt/package/ppp/patches/208-no_exponential_timeout.patch
new file mode 100644 (file)
index 0000000..d6c986a
--- /dev/null
@@ -0,0 +1,28 @@
+diff -urN ppp.old/pppd/plugins/rp-pppoe/discovery.c ppp.dev/pppd/plugins/rp-pppoe/discovery.c
+--- ppp.old/pppd/plugins/rp-pppoe/discovery.c  2005-09-05 15:25:35.917232000 +0200
++++ ppp.dev/pppd/plugins/rp-pppoe/discovery.c  2005-09-05 15:29:17.233586872 +0200
+@@ -593,12 +593,14 @@
+       conn->discoveryState = STATE_SENT_PADI;
+       waitForPADO(conn, timeout);
++#if 0
+       /* If we're just probing for access concentrators, don't do
+          exponential backoff.  This reduces the time for an unsuccessful
+          probe to 15 seconds. */
+       if (!conn->printACNames) {
+           timeout *= 2;
+       }
++#endif
+       if (conn->printACNames && conn->numPADOs) {
+           break;
+       }
+@@ -621,7 +623,9 @@
+       sendPADR(conn);
+       conn->discoveryState = STATE_SENT_PADR;
+       waitForPADS(conn, timeout);
++#if 0
+       timeout *= 2;
++#endif
+     } while (conn->discoveryState == STATE_SENT_PADR);
+     /* We're done. */
diff --git a/openwrt/package/ppp/patches/ppp-2.4.3-makefile.patch b/openwrt/package/ppp/patches/ppp-2.4.3-makefile.patch
deleted file mode 100644 (file)
index 5bbf860..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-diff -ruN ppp-2.4.3-orig/pppd/Makefile.linux ppp-2.4.3-3/pppd/Makefile.linux
---- ppp-2.4.3-orig/pppd/Makefile.linux 2004-11-13 13:02:22.000000000 +0100
-+++ ppp-2.4.3-3/pppd/Makefile.linux    2004-12-16 04:43:41.000000000 +0100
-@@ -48,19 +48,19 @@
- # Uncomment the next line to include support for PPP packet filtering.
- # This requires that the libpcap library and headers be installed
- # and that the kernel driver support PPP packet filtering.
--FILTER=y
-+#FILTER=y
- # Uncomment the next line to enable multilink PPP (enabled by default)
- # Linux distributions: Please leave multilink ENABLED in your builds
- # of pppd!
--HAVE_MULTILINK=y
-+#HAVE_MULTILINK=y
- # Uncomment the next line to enable the TDB database (enabled by default.)
- # If you enable multilink, then TDB is automatically enabled also.
- # Linux distributions: Please leave TDB ENABLED in your builds.
--USE_TDB=y
-+#USE_TDB=y
--HAS_SHADOW=y
-+#HAS_SHADOW=y
- #USE_PAM=y
- #HAVE_INET6=y
-@@ -77,7 +77,7 @@
- INCLUDE_DIRS= -I../include
--COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP
-+COMPILE_FLAGS= -DHAVE_PATHS_H -DHAVE_MMAP
- CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS)
-@@ -117,12 +117,12 @@
- #LIBS     += -lshadow $(LIBS)
- endif
--ifneq ($(wildcard /usr/include/crypt.h),)
-+#ifneq ($(wildcard /usr/include/crypt.h),)
- CFLAGS   += -DHAVE_CRYPT_H=1
--endif
--ifneq ($(wildcard /usr/lib/libcrypt.*),)
-+#endif
-+#ifneq ($(wildcard /usr/lib/libcrypt.*),)
- LIBS  += -lcrypt
--endif
-+#endif
- ifdef NEEDDES
- ifndef USE_CRYPT
diff --git a/openwrt/package/ppp/patches/ppp-2.4.3-mppe-mppc-1.1.patch b/openwrt/package/ppp/patches/ppp-2.4.3-mppe-mppc-1.1.patch
deleted file mode 100644 (file)
index 7e09f1a..0000000
+++ /dev/null
@@ -1,1585 +0,0 @@
-diff -ruN ppp-2.4.3.orig/include/linux/ppp-comp.h ppp-2.4.3/include/linux/ppp-comp.h
---- ppp-2.4.3.orig/include/linux/ppp-comp.h    2002-12-06 10:49:15.000000000 +0100
-+++ ppp-2.4.3/include/linux/ppp-comp.h 2004-11-21 13:54:09.000000000 +0100
-@@ -36,7 +36,7 @@
-  */
- /*
-- *  ==FILEVERSION 20020319==
-+ *  ==FILEVERSION 20020715==
-  *
-  *  NOTE TO MAINTAINERS:
-  *     If you modify this file at all, please set the above date.
-@@ -86,7 +86,7 @@
-       /* Compress a packet */
-       int     (*compress) (void *state, unsigned char *rptr,
--                            unsigned char *obuf, int isize, int osize);
-+                           unsigned char *obuf, int isize, int osize);
-       /* Return compression statistics */
-       void    (*comp_stat) (void *state, struct compstat *stats);
-@@ -107,7 +107,7 @@
-       /* Decompress a packet. */
-       int     (*decompress) (void *state, unsigned char *ibuf, int isize,
--                              unsigned char *obuf, int osize);
-+                             unsigned char *obuf, int osize);
-       /* Update state for an incompressible packet received */
-       void    (*incomp) (void *state, unsigned char *ibuf, int icnt);
-@@ -288,6 +288,33 @@
-           opts |= MPPE_OPT_UNKNOWN;           \
-     } while (/* CONSTCOND */ 0)
-+/* MPPE/MPPC definitions by J.D.*/
-+#define MPPE_STATELESS          MPPE_H_BIT    /* configuration bit H */
-+#define MPPE_40BIT              MPPE_L_BIT    /* configuration bit L */
-+#define MPPE_56BIT              MPPE_M_BIT    /* configuration bit M */
-+#define MPPE_128BIT             MPPE_S_BIT    /* configuration bit S */
-+#define MPPE_MPPC               MPPE_C_BIT    /* configuration bit C */
-+
-+/*
-+ * Definitions for Stac LZS.
-+ */
-+
-+#define CI_LZS                        17      /* config option for Stac LZS */
-+#define CILEN_LZS             5       /* length of config option */
-+
-+#define LZS_OVHD              4       /* max. LZS overhead */
-+#define LZS_HIST_LEN          2048    /* LZS history size */
-+#define LZS_MAX_CCOUNT                0x0FFF  /* max. coherency counter value */
-+
-+#define LZS_MODE_NONE         0
-+#define LZS_MODE_LCB          1
-+#define LZS_MODE_CRC          2
-+#define LZS_MODE_SEQ          3
-+#define LZS_MODE_EXT          4
-+
-+#define LZS_EXT_BIT_FLUSHED   0x80    /* bit A */
-+#define LZS_EXT_BIT_COMP      0x20    /* bit C */
-+
- /*
-  * Definitions for other, as yet unsupported, compression methods.
-  */
-diff -ruN ppp-2.4.3.orig/include/net/ppp-comp.h ppp-2.4.3/include/net/ppp-comp.h
---- ppp-2.4.3.orig/include/net/ppp-comp.h      2002-12-06 10:49:15.000000000 +0100
-+++ ppp-2.4.3/include/net/ppp-comp.h   2004-11-21 13:54:09.000000000 +0100
-@@ -255,6 +255,33 @@
-           opts |= MPPE_OPT_UNKNOWN;           \
-     } while (/* CONSTCOND */ 0)
-+/* MPPE/MPPC definitions by J.D.*/
-+#define MPPE_STATELESS          MPPE_H_BIT    /* configuration bit H */
-+#define MPPE_40BIT              MPPE_L_BIT    /* configuration bit L */
-+#define MPPE_56BIT              MPPE_M_BIT    /* configuration bit M */
-+#define MPPE_128BIT             MPPE_S_BIT    /* configuration bit S */
-+#define MPPE_MPPC               MPPE_C_BIT    /* configuration bit C */
-+
-+/*
-+ * Definitions for Stac LZS.
-+ */
-+
-+#define CI_LZS                        17      /* config option for Stac LZS */
-+#define CILEN_LZS             5       /* length of config option */
-+
-+#define LZS_OVHD              4       /* max. LZS overhead */
-+#define LZS_HIST_LEN          2048    /* LZS history size */
-+#define LZS_MAX_CCOUNT                0x0FFF  /* max. coherency counter value */
-+
-+#define LZS_MODE_NONE         0
-+#define LZS_MODE_LCB          1
-+#define LZS_MODE_CRC          2
-+#define LZS_MODE_SEQ          3
-+#define LZS_MODE_EXT          4
-+
-+#define LZS_EXT_BIT_FLUSHED   0x80    /* bit A */
-+#define LZS_EXT_BIT_COMP      0x20    /* bit C */
-+
- /*
-  * Definitions for other, as yet unsupported, compression methods.
-  */
-diff -ruN ppp-2.4.3.orig/pppd/ccp.c ppp-2.4.3/pppd/ccp.c
---- ppp-2.4.3.orig/pppd/ccp.c  2004-11-13 03:28:15.000000000 +0100
-+++ ppp-2.4.3/pppd/ccp.c       2004-11-21 13:54:09.000000000 +0100
-@@ -62,12 +62,10 @@
- static char bsd_value[8];
- static char deflate_value[8];
--/*
-- * Option variables.
-- */
- #ifdef MPPE
--bool refuse_mppe_stateful = 1;                /* Allow stateful mode? */
--#endif
-+static int setmppe(char **);
-+static int setnomppe(void);
-+#endif /* MPPE */
- static option_t ccp_option_list[] = {
-     { "noccp", o_bool, &ccp_protent.enabled_flag,
-@@ -108,54 +106,36 @@
-       "don't allow Predictor-1", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR,
-       &ccp_allowoptions[0].predictor_1 },
-+    { "lzs", o_bool, &ccp_wantoptions[0].lzs,
-+      "request Stac LZS", 1, &ccp_allowoptions[0].lzs, OPT_PRIO },
-+    { "+lzs", o_bool, &ccp_wantoptions[0].lzs,
-+      "request Stac LZS", 1, &ccp_allowoptions[0].lzs, OPT_ALIAS | OPT_PRIO },
-+    { "nolzs", o_bool, &ccp_wantoptions[0].lzs,
-+      "don't allow Stac LZS", OPT_PRIOSUB | OPT_A2CLR,
-+      &ccp_allowoptions[0].lzs },
-+    { "-lzs", o_bool, &ccp_wantoptions[0].lzs,
-+      "don't allow Stac LZS", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR,
-+      &ccp_allowoptions[0].lzs },
-+
- #ifdef MPPE
--    /* MPPE options are symmetrical ... we only set wantoptions here */
--    { "require-mppe", o_bool, &ccp_wantoptions[0].mppe,
--      "require MPPE encryption",
--      OPT_PRIO | MPPE_OPT_40 | MPPE_OPT_128 },
--    { "+mppe", o_bool, &ccp_wantoptions[0].mppe,
--      "require MPPE encryption",
--      OPT_ALIAS | OPT_PRIO | MPPE_OPT_40 | MPPE_OPT_128 },
--    { "nomppe", o_bool, &ccp_wantoptions[0].mppe,
--      "don't allow MPPE encryption", OPT_PRIO },
--    { "-mppe", o_bool, &ccp_wantoptions[0].mppe,
--      "don't allow MPPE encryption", OPT_ALIAS | OPT_PRIO },
--
--    /* We use ccp_allowoptions[0].mppe as a junk var ... it is reset later */
--    { "require-mppe-40", o_bool, &ccp_allowoptions[0].mppe,
--      "require MPPE 40-bit encryption", OPT_PRIO | OPT_A2OR | MPPE_OPT_40,
--      &ccp_wantoptions[0].mppe },
--    { "+mppe-40", o_bool, &ccp_allowoptions[0].mppe,
--      "require MPPE 40-bit encryption", OPT_PRIO | OPT_A2OR | MPPE_OPT_40,
--      &ccp_wantoptions[0].mppe },
--    { "nomppe-40", o_bool, &ccp_allowoptions[0].mppe,
--      "don't allow MPPE 40-bit encryption",
--      OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_40, &ccp_wantoptions[0].mppe },
--    { "-mppe-40", o_bool, &ccp_allowoptions[0].mppe,
--      "don't allow MPPE 40-bit encryption",
--      OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_40,
--      &ccp_wantoptions[0].mppe },
--
--    { "require-mppe-128", o_bool, &ccp_allowoptions[0].mppe,
--      "require MPPE 128-bit encryption", OPT_PRIO | OPT_A2OR | MPPE_OPT_128,
--      &ccp_wantoptions[0].mppe },
--    { "+mppe-128", o_bool, &ccp_allowoptions[0].mppe,
--      "require MPPE 128-bit encryption",
--      OPT_ALIAS | OPT_PRIO | OPT_A2OR | MPPE_OPT_128,
--      &ccp_wantoptions[0].mppe },
--    { "nomppe-128", o_bool, &ccp_allowoptions[0].mppe,
--      "don't allow MPPE 128-bit encryption",
--      OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_128, &ccp_wantoptions[0].mppe },
--    { "-mppe-128", o_bool, &ccp_allowoptions[0].mppe,
--      "don't allow MPPE 128-bit encryption",
--      OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_128,
--      &ccp_wantoptions[0].mppe },
--
--    /* strange one; we always request stateless, but will we allow stateful? */
--    { "mppe-stateful", o_bool, &refuse_mppe_stateful,
--      "allow MPPE stateful mode", OPT_PRIO },
--    { "nomppe-stateful", o_bool, &refuse_mppe_stateful,
--      "disallow MPPE stateful mode", OPT_PRIO | 1 },
-+    { "mppc", o_bool, &ccp_wantoptions[0].mppc,
-+      "request MPPC compression", 1, &ccp_allowoptions[0].mppc },
-+    { "+mppc", o_bool, &ccp_wantoptions[0].mppc,
-+      "request MPPC compression", 1, &ccp_allowoptions[0].mppc, OPT_ALIAS },
-+    { "nomppc", o_bool, &ccp_wantoptions[0].mppc,
-+      "don't allow MPPC compression", OPT_PRIOSUB | OPT_A2CLR,
-+      &ccp_allowoptions[0].mppc },
-+    { "-mppc", o_bool, &ccp_wantoptions[0].mppc,
-+      "don't allow MPPC compression", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR,
-+      &ccp_allowoptions[0].mppc },
-+    { "mppe", o_special, (void *)setmppe,
-+      "request MPPE encryption" },
-+    { "+mppe", o_special, (void *)setmppe,
-+      "request MPPE encryption" },
-+    { "nomppe", o_special_noarg, (void *)setnomppe,
-+      "don't allow MPPE encryption" },
-+    { "-mppe", o_special_noarg, (void *)setnomppe,
-+      "don't allow MPPE encryption" },
- #endif /* MPPE */
-     { NULL }
-@@ -241,7 +221,7 @@
-  */
- #define ANY_COMPRESS(opt)     ((opt).deflate || (opt).bsd_compress \
-                                || (opt).predictor_1 || (opt).predictor_2 \
--                               || (opt).mppe)
-+                               || (opt).lzs || (opt).mppc || (opt).mppe)
- /*
-  * Local state (mainly for handling reset-reqs and reset-acks).
-@@ -344,6 +324,100 @@
-     return 1;
- }
-+#ifdef MPPE
-+/*
-+ * Functions called from config options
-+ */
-+/* 
-+   MPPE suboptions:
-+      required - require MPPE; disconnect if peer doesn't support it
-+      stateless - use stateless mode
-+      no40 - disable 40 bit keys
-+      no56 - disable 56 bit keys
-+      no128 - disable 128 bit keys
-+*/
-+int setmppe(char **argv)
-+{
-+    int i;
-+    char *str, cmdbuf[16];
-+
-+    ccp_allowoptions[0].mppe = 1;
-+    ccp_allowoptions[0].mppe_40 = 1;
-+    ccp_allowoptions[0].mppe_56 = 1;
-+    ccp_allowoptions[0].mppe_128 = 1;
-+    ccp_allowoptions[0].mppe_stateless = 0;
-+    ccp_wantoptions[0].mppe = 0;
-+
-+    str = *argv;
-+
-+    while (1) {
-+      i = 0;
-+      memset(cmdbuf, '\0', 16);
-+      while ((i < 16) && (*str != ',') && (*str != '\0'))
-+          cmdbuf[i++] = *str++;
-+      cmdbuf[i] = '\0';
-+      if (!strncasecmp(cmdbuf, "no40", strlen("no40"))) {
-+          ccp_allowoptions[0].mppe_40 = 0;
-+          goto next_param;
-+      } else if (!strncasecmp(cmdbuf, "no56", strlen("no56"))) {
-+          ccp_allowoptions[0].mppe_56 = 0;
-+          goto next_param;
-+      } else if (!strncasecmp(cmdbuf, "no128", strlen("no128"))) {
-+          ccp_allowoptions[0].mppe_128 = 0;
-+          goto next_param;
-+      } else if (!strncasecmp(cmdbuf, "stateless", strlen("stateless"))) {
-+          ccp_allowoptions[0].mppe_stateless = 1;
-+          goto next_param;
-+      } else if (!strncasecmp(cmdbuf, "required", strlen("required"))) {
-+          ccp_wantoptions[0].mppe = 1;
-+          goto next_param;
-+      } else {
-+          option_error("invalid parameter '%s' for mppe option", cmdbuf);
-+          return 0;
-+      }
-+
-+    next_param:
-+      if (*str == ',') {
-+          str++;
-+          continue;
-+      }
-+      if (*str == '\0') {
-+          if (!(ccp_allowoptions[0].mppe_40 || ccp_allowoptions[0].mppe_56 ||
-+                ccp_allowoptions[0].mppe_128)) {
-+              if (ccp_wantoptions[0].mppe == 1) {
-+                  option_error("You require MPPE but you have switched off "
-+                               "all encryption key lengths.");
-+                  return 0;
-+              }
-+              ccp_wantoptions[0].mppe = ccp_allowoptions[0].mppe = 0;
-+              ccp_wantoptions[0].mppe_stateless =
-+                  ccp_allowoptions[0].mppe_stateless = 0;
-+          } else {
-+              ccp_allowoptions[0].mppe = 1;
-+              ccp_wantoptions[0].mppe_stateless =
-+                  ccp_allowoptions[0].mppe_stateless;
-+              if (ccp_wantoptions[0].mppe == 1) {
-+                  ccp_wantoptions[0].mppe_40 = ccp_allowoptions[0].mppe_40;
-+                  ccp_wantoptions[0].mppe_56 = ccp_allowoptions[0].mppe_56;
-+                  ccp_wantoptions[0].mppe_128 = ccp_allowoptions[0].mppe_128;
-+              }
-+          }
-+          return 1;
-+      }
-+    }
-+}
-+
-+int setnomppe(void)
-+{
-+    ccp_wantoptions[0].mppe = ccp_allowoptions[0].mppe = 0;
-+    ccp_wantoptions[0].mppe_40 = ccp_allowoptions[0].mppe_40 = 0;
-+    ccp_wantoptions[0].mppe_56 = ccp_allowoptions[0].mppe_56 = 0;
-+    ccp_wantoptions[0].mppe_128 = ccp_allowoptions[0].mppe_128 = 0;
-+    ccp_wantoptions[0].mppe_stateless = ccp_allowoptions[0].mppe_stateless = 0;
-+    return 1;
-+}
-+#endif /* MPPE */
-+
- /*
-  * ccp_init - initialize CCP.
-  */
-@@ -378,6 +452,30 @@
-     ccp_allowoptions[0].bsd_bits = BSD_MAX_BITS;
-     ccp_allowoptions[0].predictor_1 = 1;
-+
-+    ccp_wantoptions[0].lzs = 0; /* Stac LZS  - will be enabled in the future */
-+    ccp_wantoptions[0].lzs_mode = LZS_MODE_SEQ;
-+    ccp_wantoptions[0].lzs_hists = 1;
-+    ccp_allowoptions[0].lzs = 0; /* Stac LZS  - will be enabled in the future */
-+    ccp_allowoptions[0].lzs_mode = LZS_MODE_SEQ;
-+    ccp_allowoptions[0].lzs_hists = 1;
-+
-+#ifdef MPPE
-+    /* by default allow and request MPPC... */
-+    ccp_wantoptions[0].mppc = ccp_allowoptions[0].mppc = 1;
-+
-+    /* ... and allow but don't request MPPE */
-+    ccp_allowoptions[0].mppe = 1;
-+    ccp_allowoptions[0].mppe_40 = 1;
-+    ccp_allowoptions[0].mppe_56 = 1;
-+    ccp_allowoptions[0].mppe_128 = 1;
-+    ccp_allowoptions[0].mppe_stateless = 1;
-+    ccp_wantoptions[0].mppe = 0;
-+    ccp_wantoptions[0].mppe_40 = 0;
-+    ccp_wantoptions[0].mppe_56 = 0;
-+    ccp_wantoptions[0].mppe_128 = 0;
-+    ccp_wantoptions[0].mppe_stateless = 0;
-+#endif /* MPPE */
- }
- /*
-@@ -455,11 +553,11 @@
-     if (oldstate == OPENED && p[0] == TERMREQ && f->state != OPENED) {
-       notice("Compression disabled by peer.");
- #ifdef MPPE
--      if (ccp_gotoptions[unit].mppe) {
-+      if (ccp_wantoptions[unit].mppe) {
-           error("MPPE disabled, closing LCP");
-           lcp_close(unit, "MPPE disabled by peer");
-       }
--#endif
-+#endif /* MPPE */
-     }
-     /*
-@@ -487,6 +585,15 @@
-           break;
-       /* send a reset-ack, which the transmitter will see and
-          reset its compression state. */
-+
-+      /* In case of MPPE/MPPC or LZS we shouldn't send CCP_RESETACK,
-+         but we do it in order to reset compressor; CCP_RESETACK is
-+         then silently discarded. See functions ppp_send_frame and
-+         ppp_ccp_peek in ppp_generic.c (Linux only !!!). All the
-+         confusion is caused by the fact that CCP code is splited
-+         into two parts - one part is handled by pppd, the other one
-+         is handled by kernel. */
-+
-       fsm_sdata(f, CCP_RESETACK, id, NULL, 0);
-       break;
-@@ -515,12 +622,11 @@
-     fsm_lowerdown(&ccp_fsm[unit]);
- #ifdef MPPE
--    if (ccp_gotoptions[unit].mppe) {
-+    if (ccp_wantoptions[unit].mppe) {
-       error("MPPE required but peer negotiation failed");
-       lcp_close(unit, "MPPE required but peer negotiation failed");
-     }
--#endif
--
-+#endif /* MPPE */
- }
- /*
-@@ -537,7 +643,7 @@
-     all_rejected[f->unit] = 0;
- #ifdef MPPE
--    if (go->mppe) {
-+    if (go->mppe || go->mppc) {
-       ccp_options *ao = &ccp_allowoptions[f->unit];
-       int auth_mschap_bits = auth_done[f->unit];
-       int numbits;
-@@ -551,80 +657,109 @@
-        * NB: If MPPE is required, all other compression opts are invalid.
-        *     So, we return right away if we can't do it.
-        */
-+      if (ccp_wantoptions[f->unit].mppe) {
-+          /* Leave only the mschap auth bits set */
-+          auth_mschap_bits &= (CHAP_MS_WITHPEER  | CHAP_MS_PEER |
-+                               CHAP_MS2_WITHPEER | CHAP_MS2_PEER);
-+          /* Count the mschap auths */
-+          auth_mschap_bits >>= CHAP_MS_SHIFT;
-+          numbits = 0;
-+          do {
-+              numbits += auth_mschap_bits & 1;
-+              auth_mschap_bits >>= 1;
-+          } while (auth_mschap_bits);
-+          if (numbits > 1) {
-+              error("MPPE required, but auth done in both directions.");
-+              lcp_close(f->unit, "MPPE required but not available");
-+              return;
-+          }
-+          if (!numbits) {
-+              error("MPPE required, but MS-CHAP[v2] auth not performed.");
-+              lcp_close(f->unit, "MPPE required but not available");
-+              return;
-+          }
--      /* Leave only the mschap auth bits set */
--      auth_mschap_bits &= (CHAP_MS_WITHPEER  | CHAP_MS_PEER |
--                           CHAP_MS2_WITHPEER | CHAP_MS2_PEER);
--      /* Count the mschap auths */
--      auth_mschap_bits >>= CHAP_MS_SHIFT;
--      numbits = 0;
--      do {
--          numbits += auth_mschap_bits & 1;
--          auth_mschap_bits >>= 1;
--      } while (auth_mschap_bits);
--      if (numbits > 1) {
--          error("MPPE required, but auth done in both directions.");
--          lcp_close(f->unit, "MPPE required but not available");
--          return;
--      }
--      if (!numbits) {
--          error("MPPE required, but MS-CHAP[v2] auth not performed.");
--          lcp_close(f->unit, "MPPE required but not available");
--          return;
--      }
--
--      /* A plugin (eg radius) may not have obtained key material. */
--      if (!mppe_keys_set) {
--          error("MPPE required, but keys are not available.  "
--                "Possible plugin problem?");
--          lcp_close(f->unit, "MPPE required but not available");
--          return;
--      }
--
--      /* LM auth not supported for MPPE */
--      if (auth_done[f->unit] & (CHAP_MS_WITHPEER | CHAP_MS_PEER)) {
--          /* This might be noise */
--          if (go->mppe & MPPE_OPT_40) {
--              notice("Disabling 40-bit MPPE; MS-CHAP LM not supported");
--              go->mppe &= ~MPPE_OPT_40;
--              ccp_wantoptions[f->unit].mppe &= ~MPPE_OPT_40;
-+          /* A plugin (eg radius) may not have obtained key material. */
-+          if (!mppe_keys_set) {
-+              error("MPPE required, but keys are not available.  "
-+                    "Possible plugin problem?");
-+              lcp_close(f->unit, "MPPE required but not available");
-+              return;
-           }
-       }
--      /* Last check: can we actually negotiate something? */
--      if (!(go->mppe & (MPPE_OPT_40 | MPPE_OPT_128))) {
--          /* Could be misconfig, could be 40-bit disabled above. */
--          error("MPPE required, but both 40-bit and 128-bit disabled.");
--          lcp_close(f->unit, "MPPE required but not available");
--          return;
-+      /*
-+       * Check whether the kernel knows about the various
-+       * compression methods we might request. Key material
-+       * unimportant here.
-+       */
-+      if (go->mppc) {
-+          opt_buf[0] = CI_MPPE;
-+          opt_buf[1] = CILEN_MPPE;
-+          opt_buf[2] = 0;
-+          opt_buf[3] = 0;
-+          opt_buf[4] = 0;
-+          opt_buf[5] = MPPE_MPPC;
-+          if (ccp_test(f->unit, opt_buf, CILEN_MPPE, 0) <= 0)
-+              go->mppc = 0;
-+      }
-+      if (go->mppe_40) {
-+          opt_buf[0] = CI_MPPE;
-+          opt_buf[1] = CILEN_MPPE;
-+          opt_buf[2] = MPPE_STATELESS;
-+          opt_buf[3] = 0;
-+          opt_buf[4] = 0;
-+          opt_buf[5] = MPPE_40BIT;
-+          if (ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0) <= 0)
-+              go->mppe_40 = 0;
-+      }
-+      if (go->mppe_56) {
-+          opt_buf[0] = CI_MPPE;
-+          opt_buf[1] = CILEN_MPPE;
-+          opt_buf[2] = MPPE_STATELESS;
-+          opt_buf[3] = 0;
-+          opt_buf[4] = 0;
-+          opt_buf[5] = MPPE_56BIT;
-+          if (ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0) <= 0)
-+              go->mppe_56 = 0;
-+      }
-+      if (go->mppe_128) {
-+          opt_buf[0] = CI_MPPE;
-+          opt_buf[1] = CILEN_MPPE;
-+          opt_buf[2] = MPPE_STATELESS;
-+          opt_buf[3] = 0;
-+          opt_buf[4] = 0;
-+          opt_buf[5] = MPPE_128BIT;
-+          if (ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0) <= 0)
-+              go->mppe_128 = 0;
-+      }
-+      if (!go->mppe_40 && !go->mppe_56 && !go->mppe_128) {
-+          if (ccp_wantoptions[f->unit].mppe) {
-+              error("MPPE required, but kernel has no support.");
-+              lcp_close(f->unit, "MPPE required but not available");
-+          }
-+          go->mppe = go->mppe_stateless = 0;
-+      } else {
-+          /* MPPE is not compatible with other compression types */
-+          if (ccp_wantoptions[f->unit].mppe) {
-+              ao->bsd_compress = go->bsd_compress = 0;
-+              ao->predictor_1  = go->predictor_1  = 0;
-+              ao->predictor_2  = go->predictor_2  = 0;
-+              ao->deflate      = go->deflate      = 0;
-+              ao->lzs          = go->lzs          = 0;
-+          }
-       }
--
--      /* sync options */
--      ao->mppe = go->mppe;
--      /* MPPE is not compatible with other compression types */
--      ao->bsd_compress = go->bsd_compress = 0;
--      ao->predictor_1  = go->predictor_1  = 0;
--      ao->predictor_2  = go->predictor_2  = 0;
--      ao->deflate      = go->deflate      = 0;
-     }
- #endif /* MPPE */
--
--    /*
--     * Check whether the kernel knows about the various
--     * compression methods we might request.
--     */
--#ifdef MPPE
--    if (go->mppe) {
--      opt_buf[0] = CI_MPPE;
--      opt_buf[1] = CILEN_MPPE;
--      MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]);
--      /* Key material unimportant here. */
--      if (ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0) <= 0) {
--          error("MPPE required, but kernel has no support.");
--          lcp_close(f->unit, "MPPE required but not available");
--      }
-+    if (go->lzs) {
-+      opt_buf[0] = CI_LZS;
-+      opt_buf[1] = CILEN_LZS;
-+      opt_buf[2] = go->lzs_hists >> 8;
-+      opt_buf[3] = go->lzs_hists & 0xff;
-+      opt_buf[4] = LZS_MODE_SEQ;
-+      if (ccp_test(f->unit, opt_buf, CILEN_LZS, 0) <= 0)
-+          go->lzs = 0;
-     }
--#endif
-     if (go->bsd_compress) {
-       opt_buf[0] = CI_BSD_COMPRESS;
-       opt_buf[1] = CILEN_BSD_COMPRESS;
-@@ -679,7 +814,8 @@
-       + (go->deflate? CILEN_DEFLATE: 0)
-       + (go->predictor_1? CILEN_PREDICTOR_1: 0)
-       + (go->predictor_2? CILEN_PREDICTOR_2: 0)
--      + (go->mppe? CILEN_MPPE: 0);
-+      + (go->lzs? CILEN_LZS: 0)
-+      + ((go->mppe || go->mppc)? CILEN_MPPE: 0);
- }
- /*
-@@ -693,6 +829,8 @@
- {
-     int res;
-     ccp_options *go = &ccp_gotoptions[f->unit];
-+    ccp_options *ao = &ccp_allowoptions[f->unit];
-+    ccp_options *wo = &ccp_wantoptions[f->unit];
-     u_char *p0 = p;
-     /*
-@@ -701,22 +839,43 @@
-      * in case it gets Acked.
-      */
- #ifdef MPPE
--    if (go->mppe) {
-+    if (go->mppe || go->mppc || (!wo->mppe && ao->mppe)) {
-       u_char opt_buf[CILEN_MPPE + MPPE_MAX_KEY_LEN];
--      p[0] = opt_buf[0] = CI_MPPE;
--      p[1] = opt_buf[1] = CILEN_MPPE;
--      MPPE_OPTS_TO_CI(go->mppe, &p[2]);
--      MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]);
-+      p[0] = CI_MPPE;
-+      p[1] = CILEN_MPPE;
-+      p[2] = (go->mppe_stateless ? MPPE_STATELESS : 0);
-+      p[3] = 0;
-+      p[4] = 0;
-+      p[5] = (go->mppe_40 ? MPPE_40BIT : 0) | (go->mppe_56 ? MPPE_56BIT : 0) |
-+          (go->mppe_128 ? MPPE_128BIT : 0) | (go->mppc ? MPPE_MPPC : 0);
-+
-+      BCOPY(p, opt_buf, CILEN_MPPE);
-       BCOPY(mppe_recv_key, &opt_buf[CILEN_MPPE], MPPE_MAX_KEY_LEN);
-       res = ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0);
--      if (res > 0)
-+      if (res > 0) {
-           p += CILEN_MPPE;
--      else
-+      } else {
-           /* This shouldn't happen, we've already tested it! */
--          lcp_close(f->unit, "MPPE required but not available in kernel");
-+          go->mppe = go->mppe_40 = go->mppe_56 = go->mppe_128 =
-+              go->mppe_stateless = go->mppc = 0;
-+          if (ccp_wantoptions[f->unit].mppe)
-+              lcp_close(f->unit, "MPPE required but not available in kernel");
-+      }
-+    }
-+#endif /* MPPE */
-+    if (go->lzs) {
-+      p[0] = CI_LZS;
-+      p[1] = CILEN_LZS;
-+      p[2] = go->lzs_hists >> 8;
-+      p[3] = go->lzs_hists & 0xff;
-+      p[4] = LZS_MODE_SEQ;
-+      res = ccp_test(f->unit, p, CILEN_LZS, 0);
-+      if (res > 0) {
-+          p += CILEN_LZS;
-+      } else
-+          go->lzs = 0;
-     }
--#endif
-     if (go->deflate) {
-       p[0] = go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT;
-       p[1] = CILEN_DEFLATE;
-@@ -802,7 +961,7 @@
- /*
-  * ccp_ackci - process a received configure-ack, and return
-- * 1 iff the packet was OK.
-+ * 1 if the packet was OK.
-  */
- static int
- ccp_ackci(f, p, len)
-@@ -811,24 +970,44 @@
-     int len;
- {
-     ccp_options *go = &ccp_gotoptions[f->unit];
-+    ccp_options *ao = &ccp_allowoptions[f->unit];
-+    ccp_options *wo = &ccp_wantoptions[f->unit];
-     u_char *p0 = p;
- #ifdef MPPE
--    if (go->mppe) {
--      u_char opt_buf[CILEN_MPPE];
--
--      opt_buf[0] = CI_MPPE;
--      opt_buf[1] = CILEN_MPPE;
--      MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]);
--      if (len < CILEN_MPPE || memcmp(opt_buf, p, CILEN_MPPE))
-+    if (go->mppe || go->mppc || (!wo->mppe && ao->mppe)) {
-+      if (len < CILEN_MPPE
-+          || p[1] != CILEN_MPPE || p[0] != CI_MPPE
-+          || p[2] != (go->mppe_stateless ? MPPE_STATELESS : 0)
-+          || p[3] != 0
-+          || p[4] != 0
-+          || (p[5] != ((go->mppe_40 ? MPPE_40BIT : 0) |
-+                       (go->mppc ? MPPE_MPPC : 0))
-+              && p[5] != ((go->mppe_56 ? MPPE_56BIT : 0) |
-+                          (go->mppc ? MPPE_MPPC : 0))
-+              && p[5] != ((go->mppe_128 ? MPPE_128BIT : 0) |
-+                          (go->mppc ? MPPE_MPPC : 0))))
-           return 0;
-+      if (go->mppe_40 || go->mppe_56 || go->mppe_128)
-+          go->mppe = 1;
-       p += CILEN_MPPE;
-       len -= CILEN_MPPE;
-+      /* Cope with first/fast ack */
-+      if (p == p0 && len == 0)
-+          return 1;
-+    }
-+#endif /* MPPE */
-+    if (go->lzs) {
-+      if (len < CILEN_LZS || p[0] != CI_LZS || p[1] != CILEN_LZS
-+          || p[2] != go->lzs_hists>>8 || p[3] != (go->lzs_hists&0xff)
-+          || p[4] != LZS_MODE_SEQ)
-+          return 0;
-+      p += CILEN_LZS;
-+      len -= CILEN_LZS;
-       /* XXX Cope with first/fast ack */
--      if (len == 0)
-+      if (p == p0 && len == 0)
-           return 1;
-     }
--#endif
-     if (go->deflate) {
-       if (len < CILEN_DEFLATE
-           || p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT)
-@@ -891,7 +1070,7 @@
- /*
-  * ccp_nakci - process received configure-nak.
-- * Returns 1 iff the nak was OK.
-+ * Returns 1 if the nak was OK.
-  */
- static int
- ccp_nakci(f, p, len, treat_as_reject)
-@@ -900,6 +1079,8 @@
-     int len;
- {
-     ccp_options *go = &ccp_gotoptions[f->unit];
-+    ccp_options *ao = &ccp_allowoptions[f->unit];
-+    ccp_options *wo = &ccp_wantoptions[f->unit];
-     ccp_options no;           /* options we've seen already */
-     ccp_options try;          /* options to ask for next time */
-@@ -907,28 +1088,100 @@
-     try = *go;
- #ifdef MPPE
--    if (go->mppe && len >= CILEN_MPPE
--      && p[0] == CI_MPPE && p[1] == CILEN_MPPE) {
--      no.mppe = 1;
--      /*
--       * Peer wants us to use a different strength or other setting.
--       * Fail if we aren't willing to use his suggestion.
--       */
--      MPPE_CI_TO_OPTS(&p[2], try.mppe);
--      if ((try.mppe & MPPE_OPT_STATEFUL) && refuse_mppe_stateful) {
--          error("Refusing MPPE stateful mode offered by peer");
--          try.mppe = 0;
--      } else if (((go->mppe | MPPE_OPT_STATEFUL) & try.mppe) != try.mppe) {
--          /* Peer must have set options we didn't request (suggest) */
--          try.mppe = 0;
--      }
-+    if ((go->mppe || go->mppc || (!wo->mppe && ao->mppe)) &&
-+      len >= CILEN_MPPE && p[0] == CI_MPPE && p[1] == CILEN_MPPE) {
--      if (!try.mppe) {
--          error("MPPE required but peer negotiation failed");
--          lcp_close(f->unit, "MPPE required but peer negotiation failed");
-+      if (go->mppc) {
-+          no.mppc = 1;
-+          if (!(p[5] & MPPE_MPPC))
-+              try.mppc = 0;
-+      }
-+
-+      if (go->mppe)
-+          no.mppe = 1;
-+      if (go->mppe_40)
-+          no.mppe_40 = 1;
-+      if (go->mppe_56)
-+          no.mppe_56 = 1;
-+      if (go->mppe_128)
-+          no.mppe_128 = 1;
-+      if (go->mppe_stateless)
-+          no.mppe_stateless = 1;
-+
-+      if (ao->mppe_40) {
-+          if ((p[5] & MPPE_40BIT))
-+              try.mppe_40 = 1;
-+          else
-+              try.mppe_40 = (p[5] == 0) ? 1 : 0;
-+      }
-+      if (ao->mppe_56) {
-+          if ((p[5] & MPPE_56BIT))
-+              try.mppe_56 = 1;
-+          else
-+              try.mppe_56 = (p[5] == 0) ? 1 : 0;
-+      }
-+      if (ao->mppe_128) {
-+          if ((p[5] & MPPE_128BIT))
-+              try.mppe_128 = 1;
-+          else
-+              try.mppe_128 = (p[5] == 0) ? 1 : 0;
-+      }
-+
-+      if (ao->mppe_stateless) {
-+          if ((p[2] & MPPE_STATELESS) || wo->mppe_stateless)
-+              try.mppe_stateless = 1;
-+          else
-+              try.mppe_stateless = 0;
-+      }
-+
-+      if (!try.mppe_56 && !try.mppe_40 && !try.mppe_128) {
-+          try.mppe = try.mppe_stateless = 0;
-+          if (wo->mppe) {
-+              /* we require encryption, but peer doesn't support it
-+                 so we close connection */
-+              wo->mppc = wo->mppe = wo->mppe_stateless = wo->mppe_40 =
-+                  wo->mppe_56 = wo->mppe_128 = 0;
-+              lcp_close(f->unit, "MPPE required but cannot negotiate MPPE "
-+                        "key length");
-+          }
-+        }
-+      if (wo->mppe && (wo->mppe_40 != try.mppe_40) &&
-+          (wo->mppe_56 != try.mppe_56) && (wo->mppe_128 != try.mppe_128)) {
-+          /* cannot negotiate key length */
-+          wo->mppc = wo->mppe = wo->mppe_stateless = wo->mppe_40 =
-+              wo->mppe_56 = wo->mppe_128 = 0;
-+          lcp_close(f->unit, "Cannot negotiate MPPE key length");
-       }
-+      if (try.mppe_40 && try.mppe_56 && try.mppe_128)
-+          try.mppe_40 = try.mppe_56 = 0;
-+      else
-+          if (try.mppe_56 && try.mppe_128)
-+              try.mppe_56 = 0;
-+          else
-+              if (try.mppe_40 && try.mppe_128)
-+                  try.mppe_40 = 0;
-+              else
-+                  if (try.mppe_40 && try.mppe_56)
-+                      try.mppe_40 = 0;
-+
-+      p += CILEN_MPPE;
-+      len -= CILEN_MPPE;
-     }
- #endif /* MPPE */
-+
-+    if (go->lzs && len >= CILEN_LZS && p[0] == CI_LZS && p[1] == CILEN_LZS) {
-+      no.lzs = 1;
-+      if (((p[2]<<8)|p[3]) > 1 || (p[4] != LZS_MODE_SEQ &&
-+                                   p[4] != LZS_MODE_EXT))
-+          try.lzs = 0;
-+      else {
-+          try.lzs_mode = p[4];
-+          try.lzs_hists = (p[2] << 8) | p[3];
-+      }
-+      p += CILEN_LZS;
-+      len -= CILEN_LZS;
-+    }
-+
-     if (go->deflate && len >= CILEN_DEFLATE
-       && p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT)
-       && p[1] == CILEN_DEFLATE) {
-@@ -1001,14 +1254,50 @@
-       return -1;
- #ifdef MPPE
--    if (go->mppe && len >= CILEN_MPPE
-+    if ((go->mppe || go->mppc) && len >= CILEN_MPPE
-       && p[0] == CI_MPPE && p[1] == CILEN_MPPE) {
--      error("MPPE required but peer refused");
--      lcp_close(f->unit, "MPPE required but peer refused");
-+      ccp_options *wo = &ccp_wantoptions[f->unit];
-+      if (p[2] != (go->mppe_stateless ? MPPE_STATELESS : 0) ||
-+          p[3] != 0 ||
-+          p[4] != 0 ||
-+          p[5] != ((go->mppe_40 ? MPPE_40BIT : 0) |
-+                   (go->mppe_56 ? MPPE_56BIT : 0) |
-+                   (go->mppe_128 ? MPPE_128BIT : 0) |
-+                   (go->mppc ? MPPE_MPPC : 0)))
-+          return 0;
-+      if (go->mppc)
-+          try.mppc = 0;
-+      if (go->mppe) {
-+          try.mppe = 0;
-+          if (go->mppe_40)
-+              try.mppe_40 = 0;
-+          if (go->mppe_56)
-+              try.mppe_56 = 0;
-+          if (go->mppe_128)
-+              try.mppe_128 = 0;
-+          if (go->mppe_stateless)
-+              try.mppe_stateless = 0;
-+          if (!try.mppe_56 && !try.mppe_40 && !try.mppe_128)
-+              try.mppe = try.mppe_stateless = 0;
-+          if (wo->mppe) { /* we want MPPE but cannot negotiate key length */
-+              wo->mppc = wo->mppe = wo->mppe_stateless = wo->mppe_40 =
-+                  wo->mppe_56 = wo->mppe_128 = 0;
-+              lcp_close(f->unit, "MPPE required but cannot negotiate MPPE "
-+                        "key length");
-+          }
-+      }
-       p += CILEN_MPPE;
-       len -= CILEN_MPPE;
-     }
--#endif
-+#endif /* MPPE */
-+    if (go->lzs && len >= CILEN_LZS && p[0] == CI_LZS && p[1] == CILEN_LZS) {
-+      if (p[2] != go->lzs_hists>>8 || p[3] != (go->lzs_hists&0xff) 
-+          || p[4] != go->lzs_mode)
-+          return 0;
-+      try.lzs = 0;
-+      p += CILEN_LZS;
-+      len -= CILEN_LZS;
-+    }
-     if (go->deflate_correct && len >= CILEN_DEFLATE
-       && p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) {
-       if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size)
-@@ -1072,14 +1361,15 @@
-     int dont_nak;
- {
-     int ret, newret, res;
--    u_char *p0, *retp;
-+    u_char *p0, *retp, p2, p5;
-     int len, clen, type, nb;
-     ccp_options *ho = &ccp_hisoptions[f->unit];
-     ccp_options *ao = &ccp_allowoptions[f->unit];
-+    ccp_options *wo = &ccp_wantoptions[f->unit];
- #ifdef MPPE
--    bool rej_for_ci_mppe = 1; /* Are we rejecting based on a bad/missing */
--                              /* CI_MPPE, or due to other options?       */
--#endif
-+    u_char opt_buf[CILEN_MPPE + MPPE_MAX_KEY_LEN];
-+/*     int mtu; */
-+#endif /* MPPE */
-     ret = CONFACK;
-     retp = p0 = p;
-@@ -1102,103 +1392,305 @@
-           switch (type) {
- #ifdef MPPE
-           case CI_MPPE:
--              if (!ao->mppe || clen != CILEN_MPPE) {
-+              if ((!ao->mppc && !ao->mppe) || clen != CILEN_MPPE) {
-                   newret = CONFREJ;
-                   break;
-               }
--              MPPE_CI_TO_OPTS(&p[2], ho->mppe);
--              /* Nak if anything unsupported or unknown are set. */
--              if (ho->mppe & MPPE_OPT_UNSUPPORTED) {
--                  newret = CONFNAK;
--                  ho->mppe &= ~MPPE_OPT_UNSUPPORTED;
--              }
--              if (ho->mppe & MPPE_OPT_UNKNOWN) {
-+              p2 = p[2];
-+              p5 = p[5];
-+              /* not sure what they want, tell 'em what we got */
-+              if (((p[2] & ~MPPE_STATELESS) != 0 || p[3] != 0 || p[4] != 0 ||
-+                   (p[5] & ~(MPPE_40BIT | MPPE_56BIT | MPPE_128BIT |
-+                             MPPE_MPPC)) != 0 || p[5] == 0) ||
-+                  (p[2] == 0 && p[3] == 0 && p[4] == 0 &&  p[5] == 0)) {
-                   newret = CONFNAK;
--                  ho->mppe &= ~MPPE_OPT_UNKNOWN;
-+                  p[2] = (wo->mppe_stateless ? MPPE_STATELESS : 0);
-+                  p[3] = 0;
-+                  p[4] = 0;
-+                  p[5] = (wo->mppe_40 ? MPPE_40BIT : 0) |
-+                      (wo->mppe_56 ? MPPE_56BIT : 0) |
-+                      (wo->mppe_128 ? MPPE_128BIT : 0) |
-+                      (wo->mppc ? MPPE_MPPC : 0);
-+                  break;
-               }
--              /* Check state opt */
--              if (ho->mppe & MPPE_OPT_STATEFUL) {
--                  /*
--                   * We can Nak and request stateless, but it's a
--                   * lot easier to just assume the peer will request
--                   * it if he can do it; stateful mode is bad over
--                   * the Internet -- which is where we expect MPPE.
--                   */
--                 if (refuse_mppe_stateful) {
--                      error("Refusing MPPE stateful mode offered by peer");
-+              if ((p[5] & MPPE_MPPC)) {
-+                  if (ao->mppc) {
-+                      ho->mppc = 1;
-+                      BCOPY(p, opt_buf, CILEN_MPPE);
-+                      opt_buf[2] = opt_buf[3] = opt_buf[4] = 0;
-+                      opt_buf[5] = MPPE_MPPC;
-+                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE, 1) <= 0) {
-+                          ho->mppc = 0;
-+                          p[5] &= ~MPPE_MPPC;
-+                          newret = CONFNAK;
-+                      }
-+                  } else {
-                       newret = CONFREJ;
--                      break;
-+                      if (wo->mppe || ao->mppe) {
-+                          p[5] &= ~MPPE_MPPC;
-+                          newret = CONFNAK;
-+                      }
-+                  }
-+              }
-+
-+              if (ao->mppe)
-+                  ho->mppe = 1;
-+
-+              if ((p[2] & MPPE_STATELESS)) {
-+                  if (ao->mppe_stateless) {
-+                      if (wo->mppe_stateless)
-+                          ho->mppe_stateless = 1;
-+                      else {
-+                          newret = CONFNAK;
-+                          if (!dont_nak)
-+                              p[2] &= ~MPPE_STATELESS;
-+                      }
-+                  } else {
-+                      newret = CONFNAK;
-+                      if (!dont_nak)
-+                          p[2] &= ~MPPE_STATELESS;
-+                  }
-+              } else {
-+                  if (wo->mppe_stateless && !dont_nak) {
-+                      wo->mppe_stateless = 0;
-+                      newret = CONFNAK;
-+                      p[2] |= MPPE_STATELESS;
-                   }
-               }
--              /* Find out which of {S,L} are set. */
--              if ((ho->mppe & MPPE_OPT_128)
--                   && (ho->mppe & MPPE_OPT_40)) {
--                  /* Both are set, negotiate the strongest. */
-+              if ((p[5] & ~MPPE_MPPC) == (MPPE_40BIT|MPPE_56BIT|MPPE_128BIT)) {
-                   newret = CONFNAK;
--                  if (ao->mppe & MPPE_OPT_128)
--                      ho->mppe &= ~MPPE_OPT_40;
--                  else if (ao->mppe & MPPE_OPT_40)
--                      ho->mppe &= ~MPPE_OPT_128;
--                  else {
--                      newret = CONFREJ;
--                      break;
-+                  if (ao->mppe_128) {
-+                      ho->mppe_128 = 1;
-+                      p[5] &= ~(MPPE_40BIT|MPPE_56BIT);
-+                      BCOPY(p, opt_buf, CILEN_MPPE);
-+                      BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
-+                            MPPE_MAX_KEY_LEN);
-+                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
-+                                   MPPE_MAX_KEY_LEN, 1) <= 0) {
-+                          ho->mppe_128 = 0;
-+                          p[5] |= (MPPE_40BIT|MPPE_56BIT);
-+                          p[5] &= ~MPPE_128BIT;
-+                          goto check_mppe_56_40;
-+                      }
-+                      goto check_mppe;
-                   }
--              } else if (ho->mppe & MPPE_OPT_128) {
--                  if (!(ao->mppe & MPPE_OPT_128)) {
--                      newret = CONFREJ;
--                      break;
-+                  p[5] &= ~MPPE_128BIT;
-+                  goto check_mppe_56_40;
-+              }
-+              if ((p[5] & ~MPPE_MPPC) == (MPPE_56BIT|MPPE_128BIT)) {
-+                  newret = CONFNAK;
-+                  if (ao->mppe_128) {
-+                      ho->mppe_128 = 1;
-+                      p[5] &= ~MPPE_56BIT;
-+                      BCOPY(p, opt_buf, CILEN_MPPE);
-+                      BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
-+                            MPPE_MAX_KEY_LEN);
-+                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
-+                                   MPPE_MAX_KEY_LEN, 1) <= 0) {
-+                          ho->mppe_128 = 0;
-+                          p[5] |= MPPE_56BIT;
-+                          p[5] &= ~MPPE_128BIT;
-+                          goto check_mppe_56;
-+                      }
-+                      goto check_mppe;
-                   }
--              } else if (ho->mppe & MPPE_OPT_40) {
--                  if (!(ao->mppe & MPPE_OPT_40)) {
--                      newret = CONFREJ;
--                      break;
-+                  p[5] &= ~MPPE_128BIT;
-+                  goto check_mppe_56;
-+              }
-+              if ((p[5] & ~MPPE_MPPC) == (MPPE_40BIT|MPPE_128BIT)) {
-+                  newret = CONFNAK;
-+                  if (ao->mppe_128) {
-+                      ho->mppe_128 = 1;
-+                      p[5] &= ~MPPE_40BIT;
-+                      BCOPY(p, opt_buf, CILEN_MPPE);
-+                      BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
-+                            MPPE_MAX_KEY_LEN);
-+                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
-+                                   MPPE_MAX_KEY_LEN, 1) <= 0) {
-+                          ho->mppe_128 = 0;
-+                          p[5] |= MPPE_40BIT;
-+                          p[5] &= ~MPPE_128BIT;
-+                          goto check_mppe_40;
-+                      }
-+                      goto check_mppe;
-+                  }
-+                  p[5] &= ~MPPE_128BIT;
-+                  goto check_mppe_40;
-+              }
-+              if ((p[5] & ~MPPE_MPPC) == MPPE_128BIT) {
-+                  if (ao->mppe_128) {
-+                      ho->mppe_128 = 1;
-+                      BCOPY(p, opt_buf, CILEN_MPPE);
-+                      BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
-+                            MPPE_MAX_KEY_LEN);
-+                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
-+                                   MPPE_MAX_KEY_LEN, 1) <= 0) {
-+                          ho->mppe_128 = 0;
-+                          p[5] &= ~MPPE_128BIT;
-+                          newret = CONFNAK;
-+                      }
-+                      goto check_mppe;
-+                  }
-+                  p[5] &= ~MPPE_128BIT;
-+                  newret = CONFNAK;
-+                  goto check_mppe;
-+              }
-+          check_mppe_56_40:
-+              if ((p[5] & ~MPPE_MPPC) == (MPPE_40BIT|MPPE_56BIT)) {
-+                  newret = CONFNAK;
-+                  if (ao->mppe_56) {
-+                      ho->mppe_56 = 1;
-+                      p[5] &= ~MPPE_40BIT;
-+                      BCOPY(p, opt_buf, CILEN_MPPE);
-+                      BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
-+                            MPPE_MAX_KEY_LEN);
-+                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
-+                                   MPPE_MAX_KEY_LEN, 1) <= 0) {
-+                          ho->mppe_56 = 0;
-+                          p[5] |= MPPE_40BIT;
-+                          p[5] &= ~MPPE_56BIT;
-+                          newret = CONFNAK;
-+                          goto check_mppe_40;
-+                      }
-+                      goto check_mppe;
-+                  }
-+                  p[5] &= ~MPPE_56BIT;
-+                  goto check_mppe_40;
-+              }
-+          check_mppe_56:
-+              if ((p[5] & ~MPPE_MPPC) == MPPE_56BIT) {
-+                  if (ao->mppe_56) {
-+                      ho->mppe_56 = 1;
-+                      BCOPY(p, opt_buf, CILEN_MPPE);
-+                      BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
-+                            MPPE_MAX_KEY_LEN);
-+                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
-+                                   MPPE_MAX_KEY_LEN, 1) <= 0) {
-+                          ho->mppe_56 = 0;
-+                          p[5] &= ~MPPE_56BIT;
-+                          newret = CONFNAK;
-+                      }
-+                      goto check_mppe;
-+                  }
-+                  p[5] &= ~MPPE_56BIT;
-+                  newret = CONFNAK;
-+                  goto check_mppe;
-+              }
-+          check_mppe_40:
-+              if ((p[5] & ~MPPE_MPPC) == MPPE_40BIT) {
-+                  if (ao->mppe_40) {
-+                      ho->mppe_40 = 1;
-+                      BCOPY(p, opt_buf, CILEN_MPPE);
-+                      BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
-+                            MPPE_MAX_KEY_LEN);
-+                      if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
-+                                   MPPE_MAX_KEY_LEN, 1) <= 0) {
-+                          ho->mppe_40 = 0;
-+                          p[5] &= ~MPPE_40BIT;
-+                          newret = CONFNAK;
-+                      }
-+                      goto check_mppe;
-+                  }
-+                  p[5] &= ~MPPE_40BIT;
-+              }
-+
-+          check_mppe:
-+              if (!ho->mppe_40 && !ho->mppe_56 && !ho->mppe_128) {
-+                  if (wo->mppe_40 || wo->mppe_56 || wo->mppe_128) {
-+                      newret = CONFNAK;
-+                      p[2] |= (wo->mppe_stateless ? MPPE_STATELESS : 0);
-+                      p[5] |= (wo->mppe_40 ? MPPE_40BIT : 0) |
-+                          (wo->mppe_56 ? MPPE_56BIT : 0) |
-+                          (wo->mppe_128 ? MPPE_128BIT : 0) |
-+                          (wo->mppc ? MPPE_MPPC : 0);
-+                  } else {
-+                      ho->mppe = ho->mppe_stateless = 0;
-                   }
-               } else {
--                  /* Neither are set. */
-+                  /* MPPE is not compatible with other compression types */
-+                  if (wo->mppe) {
-+                      ao->bsd_compress = 0;
-+                      ao->predictor_1 = 0;
-+                      ao->predictor_2 = 0;
-+                      ao->deflate = 0;
-+                      ao->lzs = 0;
-+                  }
-+              }
-+              if ((!ho->mppc || !ao->mppc) && !ho->mppe) {
-+                  p[2] = p2;
-+                  p[5] = p5;
-                   newret = CONFREJ;
-                   break;
-               }
--              /* rebuild the opts */
--              MPPE_OPTS_TO_CI(ho->mppe, &p[2]);
--              if (newret == CONFACK) {
--                  u_char opt_buf[CILEN_MPPE + MPPE_MAX_KEY_LEN];
--                  int mtu;
--
--                  BCOPY(p, opt_buf, CILEN_MPPE);
--                  BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
--                        MPPE_MAX_KEY_LEN);
--                  if (ccp_test(f->unit, opt_buf,
--                               CILEN_MPPE + MPPE_MAX_KEY_LEN, 1) <= 0) {
--                      /* This shouldn't happen, we've already tested it! */
--                      error("MPPE required, but kernel has no support.");
--                      lcp_close(f->unit, "MPPE required but not available");
--                      newret = CONFREJ;
--                      break;
--                  }
--                  /*
--                   * We need to decrease the interface MTU by MPPE_PAD
--                   * because MPPE frames **grow**.  The kernel [must]
--                   * allocate MPPE_PAD extra bytes in xmit buffers.
--                   */
--                  mtu = netif_get_mtu(f->unit);
--                  if (mtu)
--                      netif_set_mtu(f->unit, mtu - MPPE_PAD);
--                  else
--                      newret = CONFREJ;
--              }
-+              /*
-+               * I have commented the code below because according to RFC1547
-+               * MTU is only information for higher level protocols about
-+               * "the maximum allowable length for a packet (q.v.) transmitted
-+               * over a point-to-point link without incurring network layer
-+               * fragmentation." Of course a PPP implementation should be able
-+               * to handle overhead added by MPPE - in our case apropriate code
-+               * is located in drivers/net/ppp_generic.c in the kernel sources.
-+               *
-+               * According to RFC1661:
-+               * - when negotiated MRU is less than 1500 octets, a PPP
-+               *   implementation must still be able to receive at least 1500
-+               *   octets,
-+               * - when PFC is negotiated, a PPP implementation is still
-+               *   required to receive frames with uncompressed protocol field.
-+               *
-+               * So why not to handle MPPE overhead without changing MTU value?
-+               * I am sure that RFC3078, unfortunately silently, assumes that.
-+               */
-               /*
--               * We have accepted MPPE or are willing to negotiate
--               * MPPE parameters.  A CONFREJ is due to subsequent
--               * (non-MPPE) processing.
-+               * We need to decrease the interface MTU by MPPE_PAD
-+               * because MPPE frames **grow**.  The kernel [must]
-+               * allocate MPPE_PAD extra bytes in xmit buffers.
-                */
--              rej_for_ci_mppe = 0;
-+/*
-+              mtu = netif_get_mtu(f->unit);
-+              if (mtu) {
-+                  netif_set_mtu(f->unit, mtu - MPPE_PAD);
-+              } else {
-+                  newret = CONFREJ;
-+                  if (ccp_wantoptions[f->unit].mppe) {
-+                      error("Cannot adjust MTU needed by MPPE.");
-+                      lcp_close(f->unit, "Cannot adjust MTU needed by MPPE.");
-+                  }
-+              }
-+*/
-               break;
- #endif /* MPPE */
-+
-+          case CI_LZS:
-+              if (!ao->lzs || clen != CILEN_LZS) {
-+                  newret = CONFREJ;
-+                  break;
-+              }
-+
-+              ho->lzs = 1;
-+              ho->lzs_hists = (p[2] << 8) | p[3];
-+              ho->lzs_mode = p[4];
-+              if ((ho->lzs_hists != ao->lzs_hists) ||
-+                  (ho->lzs_mode != ao->lzs_mode)) {
-+                  newret = CONFNAK;
-+                  if (!dont_nak) {
-+                      p[2] = ao->lzs_hists >> 8;
-+                      p[3] = ao->lzs_hists & 0xff;
-+                      p[4] = ao->lzs_mode;
-+                  } else
-+                      break;
-+              }
-+
-+              if (p == p0 && ccp_test(f->unit, p, CILEN_LZS, 1) <= 0) {
-+                  newret = CONFREJ;
-+              }
-+              break;
-+
-           case CI_DEFLATE:
-           case CI_DEFLATE_DRAFT:
-               if (!ao->deflate || clen != CILEN_DEFLATE
-@@ -1340,12 +1832,6 @@
-       else
-           *lenp = retp - p0;
-     }
--#ifdef MPPE
--    if (ret == CONFREJ && ao->mppe && rej_for_ci_mppe) {
--      error("MPPE required but peer negotiation failed");
--      lcp_close(f->unit, "MPPE required but peer negotiation failed");
--    }
--#endif
-     return ret;
- }
-@@ -1367,24 +1853,35 @@
-       char *p = result;
-       char *q = result + sizeof(result); /* 1 past result */
--      slprintf(p, q - p, "MPPE ");
--      p += 5;
--      if (opt->mppe & MPPE_OPT_128) {
--          slprintf(p, q - p, "128-bit ");
--          p += 8;
--      }
--      if (opt->mppe & MPPE_OPT_40) {
--          slprintf(p, q - p, "40-bit ");
--          p += 7;
--      }
--      if (opt->mppe & MPPE_OPT_STATEFUL)
--          slprintf(p, q - p, "stateful");
--      else
--          slprintf(p, q - p, "stateless");
--
-+      if (opt->mppe) {
-+          if (opt->mppc) {
-+              slprintf(p, q - p, "MPPC/MPPE ");
-+              p += 10;
-+          } else {
-+              slprintf(p, q - p, "MPPE ");
-+              p += 5;
-+          }
-+          if (opt->mppe_128) {
-+              slprintf(p, q - p, "128-bit ");
-+              p += 8;
-+          } else if (opt->mppe_56) {
-+              slprintf(p, q - p, "56-bit ");
-+              p += 7;
-+          } else if (opt->mppe_40) {
-+              slprintf(p, q - p, "40-bit ");
-+              p += 7;
-+          }
-+          if (opt->mppe_stateless)
-+              slprintf(p, q - p, "stateless");
-+          else
-+              slprintf(p, q - p, "stateful");
-+      } else if (opt->mppc)
-+          slprintf(p, q - p, "MPPC");
-       break;
-     }
--#endif
-+#endif /* MPPE */
-+    case CI_LZS:
-+      return "Stac LZS";
-     case CI_DEFLATE:
-     case CI_DEFLATE_DRAFT:
-       if (opt2 != NULL && opt2->deflate_size != opt->deflate_size)
-@@ -1440,12 +1937,12 @@
-     } else if (ANY_COMPRESS(*ho))
-       notice("%s transmit compression enabled", method_name(ho, NULL));
- #ifdef MPPE
--    if (go->mppe) {
-+    if (go->mppe || go->mppc) {
-       BZERO(mppe_recv_key, MPPE_MAX_KEY_LEN);
-       BZERO(mppe_send_key, MPPE_MAX_KEY_LEN);
-       continue_networks(f->unit);             /* Bring up IP et al */
-     }
--#endif
-+#endif /* MPPE */
- }
- /*
-@@ -1468,7 +1965,7 @@
-           lcp_close(f->unit, "MPPE disabled");
-       }
-     }
--#endif
-+#endif /* MPPE */
- }
- /*
-@@ -1528,24 +2025,28 @@
- #ifdef MPPE
-           case CI_MPPE:
-               if (optlen >= CILEN_MPPE) {
--                  u_char mppe_opts;
--
--                  MPPE_CI_TO_OPTS(&p[2], mppe_opts);
--                  printer(arg, "mppe %s %s %s %s %s %s%s",
--                          (p[2] & MPPE_H_BIT)? "+H": "-H",
--                          (p[5] & MPPE_M_BIT)? "+M": "-M",
--                          (p[5] & MPPE_S_BIT)? "+S": "-S",
--                          (p[5] & MPPE_L_BIT)? "+L": "-L",
-+                  printer(arg, "mppe %s %s %s %s %s %s",
-+                          (p[2] & MPPE_STATELESS)? "+H": "-H",
-+                          (p[5] & MPPE_56BIT)? "+M": "-M",
-+                          (p[5] & MPPE_128BIT)? "+S": "-S",
-+                          (p[5] & MPPE_40BIT)? "+L": "-L",
-                           (p[5] & MPPE_D_BIT)? "+D": "-D",
--                          (p[5] & MPPE_C_BIT)? "+C": "-C",
--                          (mppe_opts & MPPE_OPT_UNKNOWN)? " +U": "");
--                  if (mppe_opts & MPPE_OPT_UNKNOWN)
-+                          (p[5] & MPPE_MPPC)? "+C": "-C");
-+                  if ((p[5] & ~(MPPE_56BIT | MPPE_128BIT | MPPE_40BIT |
-+                                MPPE_D_BIT | MPPE_MPPC)) ||
-+                      (p[2] & ~MPPE_STATELESS))
-                       printer(arg, " (%.2x %.2x %.2x %.2x)",
-                               p[2], p[3], p[4], p[5]);
-                   p += CILEN_MPPE;
-               }
-               break;
--#endif
-+#endif /* MPPE */
-+          case CI_LZS:
-+              if (optlen >= CILEN_LZS) {
-+                  printer(arg, "lzs %.2x %.2x %.2x", p[2], p[3], p[4]);
-+                  p += CILEN_LZS;
-+              }
-+              break;
-           case CI_DEFLATE:
-           case CI_DEFLATE_DRAFT:
-               if (optlen >= CILEN_DEFLATE) {
-@@ -1631,6 +2132,7 @@
-           error("Lost compression sync: disabling compression");
-           ccp_close(unit, "Lost compression sync");
- #ifdef MPPE
-+          /* My module dosn't need this. J.D., 2003-07-06 */
-           /*
-            * If we were doing MPPE, we must also take the link down.
-            */
-@@ -1638,9 +2140,18 @@
-               error("Too many MPPE errors, closing LCP");
-               lcp_close(unit, "Too many MPPE errors");
-           }
--#endif
-+#endif /* MPPE */
-       } else {
-           /*
-+           * When LZS or MPPE/MPPC is negotiated we just send CCP_RESETREQ
-+           * and don't wait for CCP_RESETACK
-+           */
-+          if ((ccp_gotoptions[f->unit].method == CI_LZS) ||
-+              (ccp_gotoptions[f->unit].method == CI_MPPE)) {
-+              fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0);
-+              return;
-+          }
-+          /*
-            * Send a reset-request to reset the peer's compressor.
-            * We don't do that if we are still waiting for an
-            * acknowledgement to a previous reset-request.
-@@ -1671,4 +2182,3 @@
-     } else
-       ccp_localstate[f->unit] &= ~RACK_PENDING;
- }
--
-diff -ruN ppp-2.4.3.orig/pppd/ccp.h ppp-2.4.3/pppd/ccp.h
---- ppp-2.4.3.orig/pppd/ccp.h  2004-11-04 11:02:26.000000000 +0100
-+++ ppp-2.4.3/pppd/ccp.h       2004-11-21 13:54:09.000000000 +0100
-@@ -37,9 +37,17 @@
-     bool predictor_2;         /* do Predictor-2? */
-     bool deflate_correct;     /* use correct code for deflate? */
-     bool deflate_draft;               /* use draft RFC code for deflate? */
-+    bool lzs;                 /* do Stac LZS? */
-+    bool mppc;                        /* do MPPC? */
-     bool mppe;                        /* do MPPE? */
-+    bool mppe_40;             /* allow 40 bit encryption? */
-+    bool mppe_56;             /* allow 56 bit encryption? */
-+    bool mppe_128;            /* allow 128 bit encryption? */
-+    bool mppe_stateless;      /* allow stateless encryption */
-     u_short bsd_bits;         /* # bits/code for BSD Compress */
-     u_short deflate_size;     /* lg(window size) for Deflate */
-+    u_short lzs_mode;         /* LZS check mode */
-+    u_short lzs_hists;                /* number of LZS histories */
-     short method;             /* code for chosen compression method */
- } ccp_options;
-diff -ruN ppp-2.4.3.orig/pppd/chap_ms.c ppp-2.4.3/pppd/chap_ms.c
---- ppp-2.4.3.orig/pppd/chap_ms.c      2004-11-12 10:57:43.000000000 +0100
-+++ ppp-2.4.3/pppd/chap_ms.c   2004-11-21 13:54:09.000000000 +0100
-@@ -895,13 +895,17 @@
-     /*
-      * Disable undesirable encryption types.  Note that we don't ENABLE
-      * any encryption types, to avoid overriding manual configuration.
-+     *
-+     * It seems that 56 bit keys are unsupported in MS-RADIUS (see RFC 2548)
-      */
-     switch(types) {
-       case MPPE_ENC_TYPES_RC4_40:
--          ccp_wantoptions[0].mppe &= ~MPPE_OPT_128;   /* disable 128-bit */
-+          ccp_wantoptions[0].mppe_128 = 0;    /* disable 128-bit */
-+          ccp_wantoptions[0].mppe_56 = 0;     /* disable 56-bit */
-           break;
-       case MPPE_ENC_TYPES_RC4_128:
--          ccp_wantoptions[0].mppe &= ~MPPE_OPT_40;    /* disable 40-bit */
-+          ccp_wantoptions[0].mppe_56 = 0;     /* disable 56-bit */
-+          ccp_wantoptions[0].mppe_40 = 0;     /* disable 40-bit */
-           break;
-       default:
-           break;
-diff -ruN ppp-2.4.3.orig/pppd/pppd.8 ppp-2.4.3/pppd/pppd.8
---- ppp-2.4.3.orig/pppd/pppd.8 2004-11-13 13:22:49.000000000 +0100
-+++ ppp-2.4.3/pppd/pppd.8      2004-11-21 14:24:47.000000000 +0100
-@@ -622,9 +622,29 @@
- Enables the use of PPP multilink; this is an alias for the `multilink'
- option.  This option is currently only available under Linux.
- .TP
--.B mppe\-stateful
--Allow MPPE to use stateful mode.  Stateless mode is still attempted first.
--The default is to disallow stateful mode.  
-+.B mppc
-+Enables MPPC (Microsoft Point to Point Compression).  This is the default.
-+.TP
-+.B mppe \fIsubopt1[,subopt2[,subopt3[..]]]
-+Modify MPPE (Microsoft Point to Point Encryption) parameters. In order
-+for MPPE to successfully come up, you must have authenticated with either
-+MS-CHAP or MS-CHAPv2. By default MPPE is optional, it means that pppd will
-+not propose MPPE to the peer, but will negotiate MPPE if peer wants that.
-+You can change this using \fIrequired\fR suboption.
-+This option is presently only supported under Linux, and only if your
-+kernel has been configured to include MPPE support.
-+.IP
-+MPPE suboptions:
-+.br
-+\fIrequired\fR - require MPPE; disconnect if peer doesn't support it,
-+.br
-+\fIstateless\fR - try to negotiate stateless mode; default is stateful,
-+.br
-+\fIno40\fR - disable 40 bit keys,
-+.br
-+\fIno56\fR - disable 56 bit keys,
-+.br
-+\fIno128\fR - disable 128 bit keys
- .TP
- .B mpshortseq
- Enables the use of short (12-bit) sequence numbers in multilink
-@@ -757,17 +777,11 @@
- Disables the use of PPP multilink.  This option is currently only
- available under Linux.
- .TP
--.B nomppe
--Disables MPPE (Microsoft Point to Point Encryption).  This is the default.
--.TP
--.B nomppe\-40
--Disable 40-bit encryption with MPPE.
-+.B nomppc
-+Disables MPPC (Microsoft Point to Point Compression).
- .TP
--.B nomppe\-128
--Disable 128-bit encryption with MPPE.
--.TP
--.B nomppe\-stateful
--Disable MPPE stateful mode.  This is the default.
-+.B nomppe
-+Disables MPPE (Microsoft Point to Point Encryption).
- .TP
- .B nompshortseq
- Disables the use of short (12-bit) sequence numbers in the PPP
-@@ -948,19 +962,6 @@
- Require the peer to authenticate itself using CHAP [Challenge
- Handshake Authentication Protocol] authentication.
- .TP
--.B require\-mppe
--Require the use of MPPE (Microsoft Point to Point Encryption).  This
--option disables all other compression types.  This option enables
--both 40-bit and 128-bit encryption.  In order for MPPE to successfully
--come up, you must have authenticated with either MS\-CHAP or MS\-CHAPv2.
--This option is presently only supported under Linux, and only if your
--kernel has been configured to include MPPE support.
--.TP
--.B require\-mppe\-40
--Require the use of MPPE, with 40-bit encryption.
--.TP
--.B require\-mppe\-128
--Require the use of MPPE, with 128-bit encryption.
- .TP
- .B require\-mschap
- Require the peer to authenticate itself using MS\-CHAP [Microsoft Challenge
diff --git a/openwrt/package/ppp/patches/ppp-2.4.3-no-atm.patch b/openwrt/package/ppp/patches/ppp-2.4.3-no-atm.patch
deleted file mode 100644 (file)
index a737cfa..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ruN ppp-2.4.3-orig/pppd/plugins/Makefile.linux ppp-2.4.3-3/pppd/plugins/Makefile.linux
---- ppp-2.4.3-orig/pppd/plugins/Makefile.linux 2004-11-14 08:57:35.000000000 +0100
-+++ ppp-2.4.3-3/pppd/plugins/Makefile.linux    2004-12-05 17:03:59.000000000 +0100
-@@ -9,7 +9,7 @@
- MANDIR = $(DESTDIR)/share/man/man8
- LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION)
--SUBDIRS := rp-pppoe pppoatm radius
-+SUBDIRS := rp-pppoe radius
- # Uncomment the next line to include the radius authentication plugin
- # SUBDIRS += radius
- PLUGINS := minconn.so passprompt.so passwordfd.so winbind.so
diff --git a/openwrt/package/ppp/patches/ppp-2.4.3-no-strip.patch b/openwrt/package/ppp/patches/ppp-2.4.3-no-strip.patch
deleted file mode 100644 (file)
index 216973c..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-diff -ruN ppp-2.4.3-orig/chat/Makefile.linux ppp-2.4.3-3/chat/Makefile.linux
---- ppp-2.4.3-orig/chat/Makefile.linux 2004-11-03 12:51:47.000000000 +0100
-+++ ppp-2.4.3-3/chat/Makefile.linux    2004-12-05 17:42:43.000000000 +0100
-@@ -25,7 +25,7 @@
- install: chat
-       mkdir -p $(BINDIR)
--      $(INSTALL) -s -c chat $(BINDIR)
-+      $(INSTALL) -c chat $(BINDIR)
-       $(INSTALL) -c -m 644 chat.8 $(MANDIR)
- clean:
-diff -ruN ppp-2.4.3-orig/pppd/Makefile.linux ppp-2.4.3-3/pppd/Makefile.linux
---- ppp-2.4.3-orig/pppd/Makefile.linux 2004-11-13 13:02:22.000000000 +0100
-+++ ppp-2.4.3-3/pppd/Makefile.linux    2004-12-16 04:43:41.000000000 +0100
-@@ -99,7 +99,7 @@
- CFLAGS        += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
- LIBS  += -lsrp -L/usr/local/ssl/lib -lcrypto
- TARGETS       += srp-entry
--EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry
-+EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry
- MANPAGES += srp-entry.8
- EXTRACLEAN += srp-entry.o
- NEEDDES=y
-@@ -202,7 +202,7 @@
- install: pppd
-       mkdir -p $(BINDIR) $(MANDIR)
-       $(EXTRAINSTALL)
--      $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd
-+      $(INSTALL) -c -m 555 pppd $(BINDIR)/pppd
-       if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
-         chmod o-rx,u+s $(BINDIR)/pppd; fi
-       $(INSTALL) -c -m 444 pppd.8 $(MANDIR)
-diff -ruN ppp-2.4.3-orig/pppd/plugins/radius/Makefile.linux ppp-2.4.3-3/pppd/plugins/radius/Makefile.linux
---- ppp-2.4.3-orig/pppd/plugins/radius/Makefile.linux  2004-11-14 08:02:31.000000000 +0100
-+++ ppp-2.4.3-3/pppd/plugins/radius/Makefile.linux     2004-12-05 17:43:17.000000000 +0100
-@@ -36,9 +37,9 @@
- install: all
-       $(INSTALL) -d -m 755 $(LIBDIR)
--      $(INSTALL) -s -c -m 755 radius.so $(LIBDIR)
--      $(INSTALL) -s -c -m 755 radattr.so $(LIBDIR)
--      $(INSTALL) -s -c -m 755 radrealms.so $(LIBDIR)
-+      $(INSTALL) -c -m 755 radius.so $(LIBDIR)
-+      $(INSTALL) -c -m 755 radattr.so $(LIBDIR)
-+      $(INSTALL) -c -m 755 radrealms.so $(LIBDIR)
-       $(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR)
-       $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)
-diff -ruN ppp-2.4.3-orig/pppd/plugins/rp-pppoe/Makefile.linux ppp-2.4.3-3/pppd/plugins/rp-pppoe/Makefile.linux
---- ppp-2.4.3-orig/pppd/plugins/rp-pppoe/Makefile.linux        2004-11-14 08:58:37.000000000 +0100
-+++ ppp-2.4.3-3/pppd/plugins/rp-pppoe/Makefile.linux   2004-12-05 17:43:23.000000000 +0100
-@@ -39,9 +39,9 @@
- install: all
-       $(INSTALL) -d -m 755 $(LIBDIR)
--      $(INSTALL) -s -c -m 4550 rp-pppoe.so $(LIBDIR)
-+      $(INSTALL) -c -m 4550 rp-pppoe.so $(LIBDIR)
-       $(INSTALL) -d -m 755 $(BINDIR)
--      $(INSTALL) -s -c -m 555 pppoe-discovery $(BINDIR)
-+      $(INSTALL) -c -m 555 pppoe-discovery $(BINDIR)
- clean:
-       rm -f *.o *.so
-diff -ruN ppp-2.4.3-orig/pppdump/Makefile.linux ppp-2.4.3-3/pppdump/Makefile.linux
---- ppp-2.4.3-orig/pppdump/Makefile.linux      2004-10-31 02:36:52.000000000 +0200
-+++ ppp-2.4.3-3/pppdump/Makefile.linux 2004-12-05 17:50:34.000000000 +0100
-@@ -17,5 +18,5 @@
- install:
-       mkdir -p $(BINDIR) $(MANDIR)
--      $(INSTALL) -s -c pppdump $(BINDIR)
-+      $(INSTALL) -c pppdump $(BINDIR)
-       $(INSTALL) -c -m 444 pppdump.8 $(MANDIR)
-diff -ruN ppp-2.4.3-orig/pppstats/Makefile.linux ppp-2.4.3-3/pppstats/Makefile.linux
---- ppp-2.4.3-orig/pppstats/Makefile.linux     2004-10-31 23:09:03.000000000 +0100
-+++ ppp-2.4.3-3/pppstats/Makefile.linux        2004-12-05 17:43:38.000000000 +0100
-@@ -22,7 +22,7 @@
- install: pppstats
-       -mkdir -p $(MANDIR)
--      $(INSTALL) -s -c pppstats $(BINDIR)
-+      $(INSTALL) -c pppstats $(BINDIR)
-       $(INSTALL) -c -m 444 pppstats.8 $(MANDIR)
- pppstats: $(PPPSTATSRCS)
diff --git a/openwrt/package/ppp/patches/ppp-2.4.3-opt-flags.patch b/openwrt/package/ppp/patches/ppp-2.4.3-opt-flags.patch
deleted file mode 100644 (file)
index 200e76b..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-diff -ruN ppp-2.4.3-orig/pppd/plugins/radius/Makefile.linux ppp-2.4.3-3/pppd/plugins/radius/Makefile.linux
---- ppp-2.4.3-orig/pppd/plugins/radius/Makefile.linux  2004-11-14 08:02:31.000000000 +0100
-+++ ppp-2.4.3-3/pppd/plugins/radius/Makefile.linux     2004-12-05 17:43:17.000000000 +0100
-@@ -12,7 +12,8 @@
- INSTALL       = install
- PLUGIN=radius.so radattr.so radrealms.so
--CFLAGS=-I. -I../.. -I../../../include -O2 -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
-+COPTS = -O2
-+CFLAGS=-I. -I../.. -I../../../include $(COPTS) -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
- # Uncomment the next line to include support for Microsoft's
- # MS-CHAP authentication protocol.
-diff -ruN ppp-2.4.3-orig/pppdump/Makefile.linux ppp-2.4.3-3/pppdump/Makefile.linux
---- ppp-2.4.3-orig/pppdump/Makefile.linux      2004-10-31 02:36:52.000000000 +0200
-+++ ppp-2.4.3-3/pppdump/Makefile.linux 2004-12-05 17:50:34.000000000 +0100
-@@ -2,7 +2,8 @@
- BINDIR = $(DESTDIR)/sbin
- MANDIR = $(DESTDIR)/share/man/man8
--CFLAGS= -O -I../include/net
-+COPTS = -O
-+CFLAGS= $(COPTS) -I../include/net
- OBJS = pppdump.o bsd-comp.o deflate.o zlib.o
- INSTALL= install
diff --git a/openwrt/package/ppp/patches/ppp-2.4.3-pppoe-iface-name.patch b/openwrt/package/ppp/patches/ppp-2.4.3-pppoe-iface-name.patch
deleted file mode 100644 (file)
index 522d587..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ruN ppp-2.4.3-orig/pppd/plugins/rp-pppoe/plugin.c ppp-2.4.3-3/pppd/plugins/rp-pppoe/plugin.c
---- ppp-2.4.3-orig/pppd/plugins/rp-pppoe/plugin.c      2004-11-04 11:07:37.000000000 +0100
-+++ ppp-2.4.3-3/pppd/plugins/rp-pppoe/plugin.c 2004-12-16 01:07:22.000000000 +0100
-@@ -286,7 +286,7 @@
-       /* Strip off "nic-" */
-       cmd += 4;
-     } else if (strlen(cmd) < 4
--             || (strncmp(cmd, "eth", 3) && strncmp(cmd, "nas", 3)
-+             || (strncmp(cmd, "eth", 3) && strncmp(cmd, "nas", 3) && strncmp(cmd, "vlan", 4)
-                  && strncmp(cmd, "tap", 3) && strncmp(cmd, "br", 2))) {
-       return 0;
-     }
diff --git a/openwrt/package/ppp/patches/ppp-2.4.3-radius-config.patch b/openwrt/package/ppp/patches/ppp-2.4.3-radius-config.patch
deleted file mode 100644 (file)
index 90c02af..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-diff -ruN ppp-2.4.3-orig/pppd/plugins/radius/config.c ppp-2.4.3-3/pppd/plugins/radius/config.c
---- ppp-2.4.3-orig/pppd/plugins/radius/config.c        2004-11-14 08:26:26.000000000 +0100
-+++ ppp-2.4.3-3/pppd/plugins/radius/config.c   2004-12-16 04:03:46.000000000 +0100
-@@ -369,31 +369,37 @@
-       }
- #endif
-+#if 0
-       if (rc_conf_int("login_tries") <= 0)
-       {
-               error("%s: login_tries <= 0 is illegal", filename);
-               return (-1);
-       }
-+#endif
-       if (rc_conf_str("seqfile") == NULL)
-       {
-               error("%s: seqfile not specified", filename);
-               return (-1);
-       }
-+#if 0
-       if (rc_conf_int("login_timeout") <= 0)
-       {
-               error("%s: login_timeout <= 0 is illegal", filename);
-               return (-1);
-       }
-+#endif
-       if (rc_conf_str("mapfile") == NULL)
-       {
-               error("%s: mapfile not specified", filename);
-               return (-1);
-       }
-+#if 0
-       if (rc_conf_str("nologin") == NULL)
-       {
-               error("%s: nologin not specified", filename);
-               return (-1);
-       }
-+#endif
-       return 0;
- }
-diff -ruN ppp-2.4.3-orig/pppd/plugins/radius/options.h ppp-2.4.3-3/pppd/plugins/radius/options.h
---- ppp-2.4.3-orig/pppd/plugins/radius/options.h       2004-11-14 08:26:26.000000000 +0100
-+++ ppp-2.4.3-3/pppd/plugins/radius/options.h  2004-12-16 04:09:16.000000000 +0100
-@@ -31,24 +31,21 @@
- static SERVER acctserver = {0};
- static SERVER authserver = {0};
--int default_tries = 4;
--int default_timeout = 60;
--
- static OPTION config_options[] = {
- /* internally used options */
- {"config_file",               OT_STR, ST_UNDEF, NULL},
- /* General options */
- {"auth_order",                OT_AUO, ST_UNDEF, NULL},
--{"login_tries",               OT_INT, ST_UNDEF, &default_tries},
--{"login_timeout",     OT_INT, ST_UNDEF, &default_timeout},
--{"nologin",           OT_STR, ST_UNDEF, "/etc/nologin"},
--{"issue",             OT_STR, ST_UNDEF, "/etc/radiusclient/issue"},
-+{"login_tries",               OT_INT, ST_UNDEF, NULL},
-+{"login_timeout",     OT_INT, ST_UNDEF, NULL},
-+{"nologin",           OT_STR, ST_UNDEF, NULL},
-+{"issue",             OT_STR, ST_UNDEF, NULL},
- /* RADIUS specific options */
- {"authserver",                OT_SRV, ST_UNDEF, &authserver},
- {"acctserver",                OT_SRV, ST_UNDEF, &acctserver},
- {"servers",           OT_STR, ST_UNDEF, NULL},
- {"dictionary",                OT_STR, ST_UNDEF, NULL},
--{"login_radius",      OT_STR, ST_UNDEF, "/usr/sbin/login.radius"},
-+{"login_radius",      OT_STR, ST_UNDEF, NULL},
- {"seqfile",           OT_STR, ST_UNDEF, NULL},
- {"mapfile",           OT_STR, ST_UNDEF, NULL},
- {"default_realm",     OT_STR, ST_UNDEF, NULL},
index 6c9f5150d92e1a89c77fca2ea3d21d8e5ef10179..3334f23114204f7e4a82e609d31159d5eae7f3c7 100644 (file)
@@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pptp
 PKG_VERSION:=1.6.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_MD5SUM:=9a706327fb9827541d7c86d48ceb9631
 
 PKG_SOURCE_URL:=@SF/pptpclient
@@ -28,8 +28,8 @@ $(PKG_BUILD_DIR)/.built:
        touch $@
 
 $(IPKG_PPTP):
-       install -d -m0755 $(IDIR_PPTP)/etc/init.d
-       install -m0755 ./files/pptp.init $(IDIR_PPTP)/etc/init.d/S50pptp
+       install -d -m0755 $(IDIR_PPTP)/sbin
+       install -m0755 ./files/ifup.pptp $(IDIR_PPTP)/sbin/ifup.pptp
        install -d -m0755 $(IDIR_PPTP)/etc/ppp
        install -m0644 ./files/options.pptp $(IDIR_PPTP)/etc/ppp/
        install -d -m0755 $(IDIR_PPTP)/usr/sbin
diff --git a/openwrt/package/pptp/files/ifup.pptp b/openwrt/package/pptp/files/ifup.pptp
new file mode 100644 (file)
index 0000000..15178fe
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/sh
+. /etc/functions.sh
+type=$1
+
+[ "$(nvram get ${type}_proto)" = "pptp" ] || exit
+
+[ -d "/var/lock" ] || mkdir -p /var/lock || exit 1
+
+for module in slhc ppp_generic ppp_async ip_gre; do
+       /sbin/insmod $module 2>&- >&-
+done
+
+while :; do
+       PPTP_PROTO="$(nvram get pptp_proto)"
+       [ "$PPTP_PROTO" = "static" ] || PPTP_PROTO=""
+       PPTP_PROTO="${PPTP_PROTO:-dhcp}"
+       IP=$(nvram get pptp_server_ip)
+       USERNAME=$(nvram get ppp_username)
+       PASSWORD=$(nvram get ppp_passwd)
+       REDIAL=$(nvram get ppp_redialperiod)
+       REDIAL=${REDIAL:+lcp-echo-interval $REDIAL}
+       IDLETIME=$(nvram get ppp_idletime)
+       IDLETIME=${IDLETIME:+lcp-echo-failure $IDLETIME}
+       MTU=$(nvram get ppp_mtu)
+       MTU=${MTU:+ mtu $MTU mru $MTU}
+
+       do_ifup $PPTP_PROTO $type
+       
+       # hack for some buggy ISPs
+       NETMASK=$(nvram get ${type}_netmask)
+       IFNAME=$(nvram get pptp_ifname)
+       [ -z "$NETMASK" -o -z "$IFNAME" ] || ifconfig $IFNAME netmask $NETMASK
+
+       /usr/sbin/pppd nodetach \
+               pty "/usr/sbin/pptp $IP --loglevel 0 --nolaunchpppd" \
+               file /etc/ppp/options.pptp \
+               connect /bin/true \
+               usepeerdns \
+               defaultroute \
+               replacedefaultroute \
+               linkname $type \
+               user "$USERNAME" \
+               password "$PASSWORD" \
+               $MTU \
+               $IDLETIME \
+               $REDIAL
+done &
+
index 0eb1e87e833e39a67c7d8a6916c52b585efe0e59..c520de74b7b2ce1660c1446d46544e174a11cbed 100644 (file)
@@ -2,11 +2,5 @@ lock
 noauth 
 nobsdcomp 
 nodeflate
-mtu 1490
-mru 1490
-lcp-echo-failure 5
-lcp-echo-interval 120
 idle 0
 defaultroute
-name xxxx
-remotename xxxx
diff --git a/openwrt/package/pptp/files/pptp.init b/openwrt/package/pptp/files/pptp.init
deleted file mode 100644 (file)
index 34ff8a6..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-. /etc/functions.sh
-
-WAN_PROTO=$(nvram get wan_proto)
-[ "$WAN_PROTO" = "pptp" ] || exit 0
-
-for module in ip_gre slhc ppp_generic ppp_async ppp_deflate ; do
-   /sbin/insmod $module 2>/dev/null >/dev/null
-done
-               
-if test -d "/var/lock"; then
-  mkdir -p /var/lock || exit 1
-fi
-
-/usr/sbin/pppd pty "pptp x.x.x.x --loglevel 0 --nolaunchpppd" file /etc/ppp/options.pptp
-                   
-
index df13bb84487a0c083131229e696bcfca04ecd727..7e893e2053a293c0e339bdc2810e7157a0329cb8 100644 (file)
@@ -10,15 +10,14 @@ config BR2_PACKAGE_QUAGGA
          OSPFv3, BGP-4, and BGP-4+
          
          http://www.quagga.net/
-         
 
 config BR2_PACKAGE_QUAGGA_BGPD
        depends BR2_PACKAGE_QUAGGA
-       prompt "...-bgpd - BGPv4, BGPv4\+, BGPv4\- routing engine"
+       prompt "...-bgpd - BGPv4, BGPv4+, BGPv4- routing engine"
        tristate
        default m if CONFIG_DEVEL
        help
-         A BGPv4, BGPv4\+, BGPv4\- routing engine for use with Quagga routing
+         A BGPv4, BGPv4+, BGPv4- routing engine for use with Quagga routing
          software.
 
 config BR2_PACKAGE_QUAGGA_OSPFD
@@ -27,7 +26,7 @@ config BR2_PACKAGE_QUAGGA_OSPFD
        tristate
        default m if CONFIG_DEVEL
        help
-         An OSPFv2 routing engine for use with Quagga routing software.
+         An OSPFv2 (IPv4) routing engine for use with Quagga routing software.
 
 config BR2_PACKAGE_QUAGGA_OSPF6D
        depends BR2_PACKAGE_QUAGGA
@@ -35,7 +34,7 @@ config BR2_PACKAGE_QUAGGA_OSPF6D
        tristate
        default m if CONFIG_DEVEL
        help
-         An OSPFv3 routing engine for use with Quagga routing software.
+         An OSPFv3 (IPv6) routing engine for use with Quagga routing software.
 
 config BR2_PACKAGE_QUAGGA_RIPD
        depends BR2_PACKAGE_QUAGGA
@@ -43,22 +42,25 @@ config BR2_PACKAGE_QUAGGA_RIPD
        tristate
        default m if CONFIG_DEVEL
        help
-         A RIP routing engine for use with Quagga routing software.
+         A RIP (IPv4) routing engine for use with Quagga routing software.
 
-config BR2_PACKAGE_QUAGGA_RIPD
+config BR2_PACKAGE_QUAGGA_RIPNGD
        depends BR2_PACKAGE_QUAGGA
        prompt "...-ripngd - RIPNG routing engine"
        tristate
        default m if CONFIG_DEVEL
        help
-         A RIPNG routing engine for use with Quagga routing software.
+         A RIPNG (IPv6) routing engine for use with Quagga routing software.
 
-config BR2_PACKAGE_QUAGGA_ZEBRA
+config BR2_PACKAGE_QUAGGA_VTYSH
        depends BR2_PACKAGE_QUAGGA
-       prompt "...-zebra - Routing manager"
+       select BR2_PACKAGE_LIBREADLINE
+       select BR2_PACKAGE_LIBNCURSES
+       prompt "...-vtysh - integrated shell for Quagga routing software"
        tristate
        default m if CONFIG_DEVEL
        help
-         A routing manager for use with associated Quagga components.
+         vtysh lets you interact with all the Quagga routing daemons
+         at once in an integrated shell.
 
 endmenu
index 6fdc38f1d0a7cd530e4039d36e78e71ac8b3ae05..32d6d6603e41f1a6448a332c99696ef4c46e8c32 100644 (file)
@@ -3,9 +3,9 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=quagga
-PKG_VERSION:=0.98.3
+PKG_VERSION:=0.98.4
 PKG_RELEASE:=1
-PKG_MD5SUM:=68be5e911e4d604c0f5959338263356e
+PKG_MD5SUM:=c68e409931449afc5730289d3105f502
 
 PKG_SOURCE_URL:=http://www.quagga.net/download/ \
                 http://www.de.quagga.net/download/ \
@@ -25,12 +25,13 @@ $(eval $(call PKG_template,QUAGGA_OSPFD,quagga-ospfd,$(PKG_VERSION)-$(PKG_RELEAS
 $(eval $(call PKG_template,QUAGGA_OSPF6D,quagga-ospf6d,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
 $(eval $(call PKG_template,QUAGGA_RIPD,quagga-ripd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
 $(eval $(call PKG_template,QUAGGA_RIPNGD,quagga-ripngd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
-$(eval $(call PKG_template,QUAGGA_ZEBRA,quagga-zebra,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,QUAGGA_VTYSH,quagga-vtysh,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
 
 $(PKG_BUILD_DIR)/.configured:
        (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \
                $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
+               CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
+               LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib" \
                ./configure \
                --target=$(GNU_TARGET_NAME) \
                --host=$(GNU_TARGET_NAME) \
@@ -47,19 +48,18 @@ $(PKG_BUILD_DIR)/.configured:
                --infodir=/usr/share/info \
                --libdir=/usr/lib \
                --libexecdir=/usr/lib \
-               --localstatedir=/var \
+               --localstatedir=/var/run/quagga \
                --mandir=/usr/share/man \
                --sbindir=/usr/sbin \
-               --sysconfdir=/etc \
+               --sysconfdir=/etc/quagga \
                $(DISABLE_NLS) \
                $(DISABLE_LARGEFILE) \
                --enable-shared \
                --disable-static \
                --enable-ipv6 \
-               --disable-vtysh \
+               --enable-vtysh \
                --enable-user=quagga \
                --enable-group=quagga \
-               --sysconfdir=/etc/quagga \
        );
        touch $@
 
@@ -72,6 +72,15 @@ $(PKG_BUILD_DIR)/.built:
 $(IPKG_QUAGGA):
        install -d -m0755 $(IDIR_QUAGGA)/usr/lib
        cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libzebra.so.* $(IDIR_QUAGGA)/usr/lib/
+       install -d -m0755 $(IDIR_QUAGGA)/usr/sbin
+       cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/zebra $(IDIR_QUAGGA)/usr/sbin/
+       cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/watchquagga $(IDIR_QUAGGA)/usr/sbin/
+       # avoid /etc being set to 0750
+       install -d -m0755 $(IDIR_QUAGGA)/etc/quagga/
+       chmod 0750 $(IDIR_QUAGGA)/etc/quagga/
+       install -d -m0755 $(IDIR_QUAGGA)/etc/init.d/
+       install -m0755 ./files/quagga.init $(IDIR_QUAGGA)/etc/init.d/quagga
+       ln -sf quagga $(IDIR_QUAGGA)/etc/init.d/S49quagga
        $(RSTRIP) $(IDIR_QUAGGA)
        $(IPKG_BUILD) $(IDIR_QUAGGA) $(PACKAGE_DIR)
 
@@ -90,10 +99,8 @@ $(IPKG_QUAGGA_OSPFD):
        $(IPKG_BUILD) $(IDIR_QUAGGA_OSPFD) $(PACKAGE_DIR)
 
 $(IPKG_QUAGGA_OSPF6D):
-       install -d -m0755 $(IDIR_QUAGGA_OSPF6D)/usr/lib
-       cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libospf.so.* $(IDIR_QUAGGA_OSPF6D)/usr/lib/
        install -d -m0755 $(IDIR_QUAGGA_OSPF6D)/usr/sbin
-       cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/ospfd $(IDIR_QUAGGA_OSPF6D)/usr/sbin/
+       cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/ospf6d $(IDIR_QUAGGA_OSPF6D)/usr/sbin/
        $(RSTRIP) $(IDIR_QUAGGA_OSPF6D)
        $(IPKG_BUILD) $(IDIR_QUAGGA_OSPF6D) $(PACKAGE_DIR)
 
@@ -109,9 +116,8 @@ $(IPKG_QUAGGA_RIPNGD):
        $(RSTRIP) $(IDIR_QUAGGA_RIPNGD)
        $(IPKG_BUILD) $(IDIR_QUAGGA_RIPNGD) $(PACKAGE_DIR)
 
-$(IPKG_QUAGGA_ZEBRA):
-       install -d -m0755 $(IDIR_QUAGGA_ZEBRA)/usr/sbin
-       cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/zebra $(IDIR_QUAGGA_ZEBRA)/usr/sbin/
-       $(RSTRIP) $(IDIR_QUAGGA_ZEBRA)
-       $(IPKG_BUILD) $(IDIR_QUAGGA_ZEBRA) $(PACKAGE_DIR)
-
+$(IPKG_QUAGGA_VTYSH):
+       install -d -m0755 $(IDIR_QUAGGA_VTYSH)/usr/bin
+       cp -fpR $(PKG_INSTALL_DIR)/usr/bin/vtysh $(IDIR_QUAGGA_VTYSH)/usr/bin/
+       $(RSTRIP) $(IDIR_QUAGGA_VTYSH)
+       $(IPKG_BUILD) $(IDIR_QUAGGA_VTYSH) $(PACKAGE_DIR)
diff --git a/openwrt/package/quagga/files/quagga.init b/openwrt/package/quagga/files/quagga.init
new file mode 100644 (file)
index 0000000..01f8d71
--- /dev/null
@@ -0,0 +1,333 @@
+#!/bin/sh
+#
+# quagga       Starts/stops quagga daemons and watchquagga.
+#              Create a daemon.conf file to have that routing daemon
+#              started/stopped automagically when using this script
+#              without any daemon names as args.
+#              If watchquagga is available, it will also be
+#              started/stopped if the script is called without
+#              any daemon names.
+#
+
+ME=$(basename $0)
+
+usage() {
+       echo "Usage: ${ME} {start|stop|restart} [daemon ...]"
+       exit 2
+}
+
+if [ -z "$1" ]
+then
+       usage
+else
+       COMMAND=$1
+fi
+shift
+ARG_DAEMONS=$*
+BINDIR=/usr/sbin
+CONFDIR=/etc/quagga
+STATEDIR=/var/run/quagga
+DAEMONS="zebra ripd ripngd ospfd ospf6d bgpd"
+DAEMON_FLAGS=-d
+WATCHQUAGGA_FLAGS="-d -z -T 60 -R"
+WATCHQUAGGA_CMD="$0 watchrestart"
+if [ ${COMMAND} != "watchrestart" ]
+then
+       DAEMONS="${DAEMONS} watchquagga"
+fi
+DAEMONS_STARTSEQ=${DAEMONS}
+
+reverse()
+{
+       local revlist r
+        revlist=
+        for r
+       do
+                revlist="$r $revlist"
+        done
+        echo $revlist
+}
+
+DAEMONS_STOPSEQ=$(reverse ${DAEMONS_STARTSEQ})
+
+#pidof() {
+#      ps ax | awk 'match($5, "(^|/)'"$1"'$") > 0 { printf " %s", $1 }'
+#}
+
+quit() {
+       echo "${ME}: $1"
+       exit 0
+}
+
+die() {
+       echo "${ME}: $1"
+       exit 1
+}
+
+is_in() {
+       local i
+       for i in $2
+       do
+               [ "$1" = "$i" ] && return 0
+       done
+       return 1
+}
+
+select_subset() {
+       local unknown i j
+       unknown=
+       RESULT=
+       for i in $1
+       do
+               is_in $i "$2" || unknown="$unknown $i"
+       done
+       if [ -n "$unknown" ]
+       then
+               RESULT=$unknown
+               return 1
+       else
+               for j in $2
+               do
+                       is_in $j "$1" && RESULT="$RESULT $j"
+               done
+               return 0
+       fi
+}
+
+# check command
+
+case ${COMMAND}
+in
+       start|stop|restart)
+               ;;
+       watchrestart)
+               if [ -n "$ARG_DAEMONS" ]
+               then
+                       echo "${ME}: watchrestart mode is only for use by watchquagga"
+                       exit 2
+               fi
+               ;;
+       *)
+               usage
+               ;;
+esac
+
+# select daemons to start
+
+case ${COMMAND}
+in
+       start|restart|watchrestart)
+               START_DAEMONS=
+               for d in ${DAEMONS_STARTSEQ}
+               do
+                       [ -x "${BINDIR}/${d}" -a -f "${CONFDIR}/${d}.conf" ] \
+                       && START_DAEMONS="${START_DAEMONS}${d} "
+               done
+               WATCHQUAGGA_DAEMONS=${START_DAEMONS}
+               if is_in watchquagga "${DAEMONS_STARTSEQ}"
+               then
+                       START_DAEMONS="${START_DAEMONS} watchquagga"
+               fi
+               if [ -n "${ARG_DAEMONS}" ]
+               then
+                       if select_subset "${ARG_DAEMONS}" "${DAEMONS}"
+                       then
+                               if select_subset "${ARG_DAEMONS}" "${START_DAEMONS}"
+                               then
+                                       START_DAEMONS=${RESULT}
+                               else
+                                       die "these daemons are not startable:${RESULT}."
+                               fi
+                       else
+                               die "unknown daemons:${RESULT}; choose from: ${DAEMONS}."
+                       fi
+               fi
+               ;;
+esac
+
+# select daemons to stop
+
+case ${COMMAND}
+in
+       stop|restart|watchrestart)
+               STOP_DAEMONS=${DAEMONS_STOPSEQ}
+               if [ -n "${ARG_DAEMONS}" ]
+               then
+                       if select_subset "${ARG_DAEMONS}" "${STOP_DAEMONS}"
+                       then
+                               STOP_DAEMONS=${RESULT}
+                       else
+                               die "unknown daemons:${RESULT}; choose from: ${DAEMONS}."
+                       fi
+               fi
+               stop_daemons=
+               for d in ${STOP_DAEMONS}
+               do
+                       pidfile=${STATEDIR}/${d}.pid
+                       if [ -f "${pidfile}" -o -n "$(pidof ${d})" ]
+                       then
+                               stop_daemons="${stop_daemons}${d} "
+                       elif [ -n "${ARG_DAEMONS}" ]
+                       then
+                               echo "${ME}: found no ${d} process running."
+                       fi
+               done
+               STOP_DAEMONS=${stop_daemons}
+               ;;
+esac
+
+# stop daemons
+
+for d in $STOP_DAEMONS
+do
+       echo -n "${ME}: Stopping ${d} ... "
+       pidfile=${STATEDIR}/${d}.pid
+       if [ -f "${pidfile}" ]
+       then
+               file_pid=$(cat ${pidfile})
+               if [ -z "${file_pid}" ]
+               then
+                       echo -n "no pid file entry found ... "
+               fi
+       else
+               file_pid=
+               echo -n "no pid file found ... "
+       fi
+       proc_pid=$(pidof ${d})
+       if [ -z "${proc_pid}" ]
+       then
+               echo -n "found no ${d} process running ... "
+       else
+               count=0
+               notinpidfile=
+               for p in ${proc_pid}
+               do
+                       count=$((${count}+1))
+                       if kill ${p}
+                       then
+                               echo -n "killed ${p} ... "
+                       else
+                               echo -n "failed to kill ${p} ... "
+                       fi
+                       [ "${p}" = "${file_pid}" ] \
+                       || notinpidfile="${notinpidfile} ${p}"
+               done
+               [ ${count} -le 1 ] \
+               || echo -n "WARNING: ${count} ${d} processes were found running ... "
+               for n in ${notinpidfile}
+               do
+                       echo -n "WARNING: process ${n} was not in pid file ... "
+               done
+       fi
+       count=0
+       survivors=$(pidof ${d})
+       while [ -n "${survivors}" ]
+       do
+               sleep 1
+               count=$((${count}+1))
+               survivors=$(pidof ${d})
+               [ -z "${survivors}" -o ${count} -gt 5 ] && break
+               for p in ${survivors}
+               do
+                       sleep 1
+                       echo -n "${p} "
+                       kill ${p}
+               done
+       done
+       survivors=$(pidof ${d})
+       [ -n "${survivors}" ] && \
+       if kill -KILL ${survivors}
+       then
+               echo -n "KILLed ${survivors} ... "
+       else
+               echo -n "failed to KILL ${survivors} ... "
+       fi
+       sleep 1
+       survivors=$(pidof ${d})
+       if [ -z "${survivors}" ]
+       then
+               echo -n "done."
+               if [ -f "${pidfile}" ]
+               then
+                       rm -f ${pidfile} \
+                       || echo -n " Failed to remove pidfile."
+               fi
+       else
+               echo -n "failed to stop ${survivors} - giving up."
+               if [ "${survivors}" != "${file_pid}" ]
+               then
+                       if echo "${survivors}" > ${pidfile}
+                       then
+                               chown quagga:quagga ${pidfile}
+                               echo -n " Wrote ${survivors} to pidfile."
+                       else
+                               echo -n " Failed to write ${survivors} to pidfile."
+                       fi
+               fi
+       fi
+       echo
+done
+
+# start daemons
+
+if [ -n "$START_DAEMONS" ]
+then
+       [ -d ${CONFDIR} ] \
+       || quit "${ME}: no config directory ${CONFDIR} - exiting."
+       chown -R quagga:quagga ${CONFDIR}
+       [ -d ${STATEDIR} ] || mkdir -p ${STATEDIR} \
+       || die "${ME}: could not create state directory ${STATEDIR} - exiting."
+       chown -R quagga:quagga ${STATEDIR}
+
+       for d in $START_DAEMONS
+       do
+               echo -n "${ME}: Starting ${d} ... "
+               proc_pid=$(pidof ${d})
+               pidfile=${STATEDIR}/${d}.pid
+               file_pid=
+               if [ -f "${pidfile}" ]
+               then
+                       file_pid=$(cat ${pidfile})
+                       if [ -n "${file_pid}" ]
+                       then
+                               echo -n "found old pid file entry ${file_pid} ... "
+                       fi
+               fi
+               if [ -n "${proc_pid}" ]
+               then
+                       echo -n "found ${d} running (${proc_pid}) - skipping ${d}."
+                       if [ "${proc_pid}" != "${file_pid}" ]
+                       then
+                               if echo "${proc_pid}" > ${pidfile}
+                               then
+                                       chown quagga:quagga ${pidfile}
+                                       echo -n " Wrote ${proc_pid} to pidfile."
+                               else
+                                       echo -n " Failed to write ${proc_pid} to pidfile."
+                               fi
+                       fi
+               elif rm -f "${pidfile}"
+               then
+                       if [ "${d}" = "watchquagga" ]
+                       then
+                               $("${BINDIR}/${d}" \
+                                       ${WATCHQUAGGA_FLAGS} \
+                                       "${WATCHQUAGGA_CMD}" \
+                                       ${WATCHQUAGGA_DAEMONS})
+                               status=$?
+                       else
+                               $("${BINDIR}/${d}" ${DAEMON_FLAGS})
+                               status=$?
+                       fi
+                       if [ $status -eq 0 ]
+                       then
+                               echo -n "done."
+                       else
+                               echo -n "failed."
+                       fi
+               else
+                       echo -n " failed to remove pidfile."
+               fi
+               echo
+       done
+fi
index 0c2c401c00cfce9101bbf1406c324d8263fb9e48..dab6c33f1cab74a42c474bfacca4bff1c3e48728 100644 (file)
@@ -3,5 +3,6 @@ Priority: optional
 Section: net
 Maintainer: Johannes 5 Joemann <joemann@beefree.free.de>
 Source: buildroot internal
-Description: A BGPv4, BGPv4\+, BGPv4\- routing engine for use
- with Quagga routing software
+Depends: quagga
+Description: A BGPv4, BGPv4+, BGPv4- routing engine for use with Quagga
+ routing software
index 2345ef127d01a35c09854acb6cb84e60a4c23bec..65e324b6ae73df6e819306256d6206555363e66a 100644 (file)
@@ -3,5 +3,6 @@ Priority: optional
 Section: net
 Maintainer: Johannes 5 Joemann <joemann@beefree.free.de>
 Source: buildroot internal
-Description: An OSPFv3 routing engine for use
- with Quagga routing software
+Depends: quagga
+Description: An OSPFv3 routing engine for use with Quagga
+ routing software
index eeab13acb859697532ae36a21bd8249d2f9a6645..9ebca493a9854ad6a9dbfbe7f16faa1214273784 100644 (file)
@@ -3,5 +3,6 @@ Priority: optional
 Section: net
 Maintainer: Johannes 5 Joemann <joemann@beefree.free.de>
 Source: buildroot internal
-Description: An OSPFv2 routing engine for use
- with Quagga routing software
+Depends: quagga
+Description: An OSPFv2 routing engine for use with Quagga
+ routing software
index b9362d907a579d3b7da99d183a765b90b5c7a878..adee8b5e4c17dff0fa04465ea26f848d388f4771 100644 (file)
@@ -3,5 +3,6 @@ Priority: optional
 Section: net
 Maintainer: Johannes 5 Joemann <joemann@beefree.free.de>
 Source: buildroot internal
-Description: A RIP routing engine for use
- with Quagga routing software
+Depends: quagga
+Description: A RIP routing engine for use with Quagga
+ routing software
index 8c6e5b59d2dbd8f1a103b9f21178a93f2d379853..7fc15f285d08bdb8449939a33471e6fb9aa1e441 100644 (file)
@@ -3,5 +3,6 @@ Priority: optional
 Section: net
 Maintainer: Johannes 5 Joemann <joemann@beefree.free.de>
 Source: buildroot internal
-Description: A RIPNG routing engine for use
- with Quagga routing software
+Depends: quagga
+Description: A RIPNG routing engine for use with Quagga
+ routing software
diff --git a/openwrt/package/quagga/ipkg/quagga-vtysh.control b/openwrt/package/quagga/ipkg/quagga-vtysh.control
new file mode 100644 (file)
index 0000000..1022106
--- /dev/null
@@ -0,0 +1,8 @@
+Package: quagga-vtysh
+Priority: optional
+Section: net
+Maintainer: Johannes 5 Joemann <joemann@beefree.free.de>
+Source: buildroot internal
+Depends: quagga, libncurses, libreadline
+Description: integrated shell for interacting with Quagga
+ routing software
diff --git a/openwrt/package/quagga/ipkg/quagga-zebra.control b/openwrt/package/quagga/ipkg/quagga-zebra.control
deleted file mode 100644 (file)
index b42fc56..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-Package: quagga-zebra
-Priority: optional
-Section: net
-Maintainer: Johannes 5 Joemann <joemann@beefree.free.de>
-Source: buildroot internal
-Description: A routing manager for use
- with associated Quagga components
index 69b83283bfce7be3265861b1d239bab603bc0a51..5b8276bcc12f09ea9bbef5a77f24d514b8b0b439 100644 (file)
@@ -1,17 +1,14 @@
---- quagga-0.98.2/configure.orig       Thu Feb  3 17:39:29 2005
-+++ quagga-0.98.2/configure    Sat Feb 12 06:47:14 2005
-@@ -12491,72 +12491,6 @@
+--- quagga-0.98.4/configure.orig       Mon Jun 27 19:05:31 2005
++++ quagga-0.98.4/configure    Mon Jul 11 20:32:07 2005
+@@ -12623,69 +12623,6 @@
  
  
  
 -echo "$as_me:$LINENO: checking for broken CMSG_FIRSTHDR" >&5
 -echo $ECHO_N "checking for broken CMSG_FIRSTHDR... $ECHO_C" >&6
 -if test "$cross_compiling" = yes; then
--  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
--See \`config.log' for more details." >&5
--echo "$as_me: error: cannot run test program while cross compiling
--See \`config.log' for more details." >&2;}
--   { (exit 1); exit 1; }; }
+-  echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6
 -else
 -  cat >conftest.$ac_ext <<_ACEOF
 -/* confdefs.h.  */
@@ -73,7 +70,7 @@
  echo "$as_me:$LINENO: checking route read method check" >&5
  echo $ECHO_N "checking route read method check... $ECHO_C" >&6
  if test "${zebra_rtread+set}" = set; then
-@@ -12654,10 +12588,7 @@
+@@ -12783,10 +12720,7 @@
  if test "${zebra_ipforward_path+set}" = set; then
    echo $ECHO_N "(cached) $ECHO_C" >&6
  else
diff --git a/openwrt/package/quagga/patches/quagga-readline.patch b/openwrt/package/quagga/patches/quagga-readline.patch
new file mode 100644 (file)
index 0000000..8e3b805
--- /dev/null
@@ -0,0 +1,58 @@
+--- quagga-0.98.4/configure.orig       Mon Jun 27 19:05:31 2005
++++ quagga-0.98.4/configure    Thu Jul 28 07:02:12 2005
+@@ -10937,7 +10937,7 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lcurses  $LIBS"
++#LIBS="-lcurses  $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+ _ACEOF
+@@ -11071,7 +11071,8 @@
+ #define HAVE_LIBNCURSES 1
+ _ACEOF
+-  LIBS="-lncurses $LIBS"
++#  LIBS="-lncurses $LIBS"
++CURSES=-lncurses
+ fi
+@@ -11088,7 +11089,7 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lreadline  $LIBS"
++LIBS="-lreadline $CURSES $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+ _ACEOF
+@@ -11144,7 +11145,8 @@
+ #define HAVE_LIBREADLINE 1
+ _ACEOF
+-  LIBS="-lreadline $LIBS"
++#  LIBS="-lreadline $LIBS"
++CURSES="$CURSES -lreadline"
+ fi
+@@ -11303,7 +11305,7 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lreadline  $LIBS"
++LIBS="-lreadline $CURSES $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+ _ACEOF
+@@ -11365,7 +11367,7 @@
+ #define HAVE_LIBREADLINE 1
+ _ACEOF
+-  LIBS="-lreadline $LIBS"
++#  LIBS="-lreadline $LIBS"
+ fi
index f2849533bc7affaea06517a71825aecdafe1a7c0..09e8babb33f2152b3d1e07ab961c605a03b75908 100644 (file)
@@ -1,5 +1,5 @@
 config BR2_PACKAGE_RSYNC
-       tristate "rsync"
+       tristate "rsync - file transfer utility"
        select BR2_PACKAGE_LIBPOPT
        default m if CONFIG_DEVEL
        help
index 6f2573e9c771faa9d46f1741f4162c930449a515..f7b81c62aff242465134abce78b454412db91850 100644 (file)
@@ -1,3 +1,7 @@
+# invoke ipkg with configuration in $(STAGING_DIR)/etc/ipkg.conf 
+IPKG := IPKG_INSTROOT=$(TARGET_DIR) IPKG_CONF_DIR=$(IPKG_CONF) $(SCRIPT_DIR)/ipkg -force-defaults -force-depends
+IPKG_STATE_DIR := $(TARGET_DIR)/usr/lib/ipkg
+
 define PKG_template
 IPKG_$(1):=$(PACKAGE_DIR)/$(2)_$(3)_$(4).ipk
 IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg/$(2)
@@ -13,8 +17,11 @@ ifeq ($(BR2_PACKAGE_$(1)),y)
 install: $$(INFO_$(1))
 endif
 
+IDEPEND_$(1):=$$(strip $(5))
+
 $$(IDIR_$(1))/CONTROL/control: $(PKG_BUILD_DIR)/.prepared
        $(SCRIPT_DIR)/make-ipkg-dir.sh $$(IDIR_$(1)) ./ipkg/$(2).control $(3) $(4)
+       if [ "$$(IDEPEND_$(1))" != "" ]; then echo "Depends: $$(IDEPEND_$(1))" >> $$(IDIR_$(1))/CONTROL/control; fi
        for file in conffiles preinst postinst prerm postrm; do \
                [ -f ./ipkg/$(2).$$$$file ] && cp ./ipkg/$(2).$$$$file $$(IDIR_$(1))/CONTROL/$$$$file || true; \
        done
index 1e4a7c17852b157f2eca5d401f0955c41f42b3c7..81cb347dcc1534c472e6e8de5d6433889dff410e 100644 (file)
@@ -32,7 +32,7 @@ $(PKG_BUILD_DIR)/$(PKG_NAME): $(PKG_BUILD_DIR)/.patched
                extra_defs="-DUSE_PTHREAD_MUTEX "  \
                CC="$(TARGET_CC)" \
                ARCH="$(ARCH)" \
-               COPTS="$(TARGET_CFLAGS)" \
+               CFLAGS="$(TARGET_CFLAGS)" \
                modules all
 
 $(PKG_IPK): $(PKG_BUILD_DIR)/$(PKG_NAME)
index 27b4c9224c04cb714887cc63d580a7aeec9f47f2..fc0f695f6f1674d3a006857f6b9f2e9775f1b2ed 100644 (file)
@@ -4,4 +4,4 @@ Section: libs
 Maintainer: Nico <nthill@free.fr>
 Source: http://openwrt.org/cgi-bin/viewcvs.cgi/openwrt/package/sqlite/
 Description: Command Line Interface (CLI) for SQLite
-Depends: libsqlite
+Depends: libsqlite, libncurses, libreadline
index 41dcf9f3699ca33d3e72cf1f94c669c6800ae701..a8376a16da07e22de37e7c30dbbbfe542846db53 100644 (file)
@@ -1,5 +1,5 @@
 config BR2_PACKAGE_UCLIBCXX
-       tristate "uClibc++"
+       tristate "uClibc++ - C++ library for embedded systems"
        default m if CONFIG_DEVEL
        help
          A standard C++ library for embedded systems
index 6cc0ceb596931623569f22e4c93a5c4e66442465..2dac7a7ff1bb09e07a17c0096e6250bbe236935b 100644 (file)
@@ -3,9 +3,9 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=uClibc++
-PKG_VERSION:=0.1.9
+PKG_VERSION:=0.1.11
 PKG_RELEASE:=1
-PKG_MD5SUM:=ebf58e04d72eab5c131c2c9118737024
+PKG_MD5SUM:=8a8e0ee8fefef150c08a649fd7da04aa
 
 PKG_SOURCE_URL:=http://cxx.uclibc.org/src/
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tbz2
@@ -13,9 +13,9 @@ PKG_CAT:=bzcat
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 
-IPKG_LIBCXX:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
-IDIR_LIBCXX:=$(PKG_BUILD_DIR)/ipkg/$(PKG_NAME)
-INFO_LIBCXX:=$(IPKG_STATE_DIR)/info/$(PKG_NAME).list
+include $(TOPDIR)/package/rules.mk
+
+$(eval $(call PKG_template,UCLIBCXX,uclibc++,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
 
 UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \
                -e 's/i.86/i386/' \
@@ -31,47 +31,29 @@ UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \
                -e 's/cris.*/cris/' \
 )
 
-
-$(DL_DIR)/$(PKG_SOURCE):
-       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
-
-$(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
-       $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
-       $(PATCH) $(PKG_BUILD_DIR) ./patches
-       touch $(PKG_BUILD_DIR)/.prepared
-
-$(PKG_BUILD_DIR)/.config: $(PKG_BUILD_DIR)/.prepared
+$(PKG_BUILD_DIR)/.configured:
        cp ./uclibc++.config $(PKG_BUILD_DIR)/.config
        $(SED) 's,^.*TARGET_ARCH.*,TARGET_ARCH="$(UCLIBC_TARGET_ARCH)",g' $(PKG_BUILD_DIR)/.config
        $(SED) 's,^.*ARCH_CFLAGS.*,ARCH_CFLAGS="-mno-split-addresses $(TARGET_CFLAGS)",g' $(PKG_BUILD_DIR)/.config
-       
+       touch $@
 
-$(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.config
+$(PKG_BUILD_DIR)/.built:
        $(MAKE) -C $(PKG_BUILD_DIR) \
-               $(TARGET_CONFIGURE_OPTS)
-       touch $(PKG_BUILD_DIR)/.built
+               $(TARGET_CONFIGURE_OPTS) \
+               CROSS="$(TARGET_CROSS)" \
+               all
+       touch $@
+
+$(IPKG_UCLIBCXX):
+       install -d -m0755 $(IDIR_UCLIBCXX)/usr/lib
+       cp -fpR $(PKG_BUILD_DIR)/src/libuClibc++*.so* $(IDIR_UCLIBCXX)/usr/lib/
+       $(STRIP) $(IDIR_UCLIBCXX)/usr/lib/*.so*
+       mkdir -p $(PACKAGE_DIR)
+       $(IPKG_BUILD) $(IDIR_UCLIBCXX) $(PACKAGE_DIR)
 
-$(STAGING_DIR)/lib/libuClibc++.so: $(PKG_BUILD_DIR)/.built
+compile: install-dev
+install-dev: $(PKG_BUILD_DIR)/.built
        $(MAKE) -C $(PKG_BUILD_DIR) \
+               $(TARGET_CONFIGURE_OPTS) CROSS="$(TARGET_CROSS)" \
                DESTDIR="$(STAGING_DIR)" \
                install
-
-$(IPKG_LIBCXX): $(STAGING_DIR)/lib/libuClibc++.so
-       $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_LIBCXX) ./$(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
-       mkdir -p $(IDIR_LIBCXX)/usr/lib
-       cp -fpR $(STAGING_DIR)/lib/libuClibc++.so* $(IDIR_LIBCXX)/usr/lib/
-       $(STRIP) $(IDIR_LIBCXX)/usr/lib/*.so*
-       mkdir -p $(PACKAGE_DIR)
-       $(IPKG_BUILD) $(IDIR_LIBCXX) $(PACKAGE_DIR)
-
-$(INFO_LIBCXX): $(IPKG_LIBCXX)
-       $(IPKG) install $(IPKG_LIBCXX)
-
-source: $(DL_DIR)/$(PKG_SOURCE)
-prepare: $(PKG_BUILD_DIR)/.prepared
-compile: $(IPKG_LIBCXX)
-install: $(INFO_LIBCXX)
-
-clean:
-       rm -rf $(PKG_BUILD_DIR) $(IPKG_LIBCXX)
-       rm -f $(STAGING_DIR)/lib/libuClibc++.so* 
diff --git a/openwrt/package/uclibc++/ipkg/uclibc++.control b/openwrt/package/uclibc++/ipkg/uclibc++.control
new file mode 100644 (file)
index 0000000..2e37df8
--- /dev/null
@@ -0,0 +1,6 @@
+Package: uclibc++
+Priority: optional
+Section: libs
+Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
+Source: buildroot internal
+Description: A standard c++ library for embedded systems
diff --git a/openwrt/package/uclibc++/uClibc++.control b/openwrt/package/uclibc++/uClibc++.control
deleted file mode 100644 (file)
index 2e37df8..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-Package: uclibc++
-Priority: optional
-Section: libs
-Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
-Source: buildroot internal
-Description: A standard c++ library for embedded systems
index 91229cd14f80902fd5615e9e0a4476ec8ff7d4d9..cc9eb49fc48c0ee02647a074089f5ec7898f48b1 100644 (file)
@@ -12,20 +12,6 @@ TARGET_mips=y
 HAVE_ELF=y
 TARGET_ARCH="mips"
 ARCH_CFLAGS="-mno-split-addresses"
-# CONFIG_GENERIC_386 is not set
-# CONFIG_386 is not set
-# CONFIG_486 is not set
-# CONFIG_586 is not set
-# CONFIG_586MMX is not set
-# CONFIG_686 is not set
-# CONFIG_PENTIUMIII is not set
-# CONFIG_PENTIUM4 is not set
-# CONFIG_K6 is not set
-# CONFIG_K7 is not set
-# CONFIG_CRUSOE is not set
-# CONFIG_WINCHIPC6 is not set
-# CONFIG_WINCHIP2 is not set
-# CONFIG_CYRIXIII is not set
 # CONFIG_MIPS_ISA_1 is not set
 # CONFIG_MIPS_ISA_2 is not set
 # CONFIG_MIPS_ISA_3 is not set
@@ -48,17 +34,26 @@ UCLIBCXX_SUPPORT_CDIR=y
 UCLIBCXX_SUPPORT_CIN=y
 UCLIBCXX_SUPPORT_COUT=y
 UCLIBCXX_SUPPORT_CERR=y
+# UCLIBCXX_SUPPORT_CLOG is not set
+# UCLIBCXX_SUPPORT_WCIN is not set
+# UCLIBCXX_SUPPORT_WCOUT is not set
+# UCLIBCXX_SUPPORT_WCERR is not set
+# UCLIBCXX_SUPPORT_WCLOG is not set
 
 #
 # STL and Code Expansion
 #
 UCLIBCXX_STL_BUFFER_SIZE=32
 UCLIBCXX_CODE_EXPANSION=y
+# UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS is not set
 UCLIBCXX_EXPAND_STRING_CHAR=y
 UCLIBCXX_EXPAND_VECTOR_BASIC=y
+# UCLIBCXX_EXPAND_IOS_CHAR is not set
+# UCLIBCXX_EXPAND_STREAMBUF_CHAR is not set
 UCLIBCXX_EXPAND_ISTREAM_CHAR=y
 UCLIBCXX_EXPAND_OSTREAM_CHAR=y
 UCLIBCXX_EXPAND_FSTREAM_CHAR=y
+# UCLIBCXX_EXPAND_SSTREAM_CHAR is not set
 
 #
 # Library Installation Options
@@ -69,4 +64,6 @@ UCLIBCXX_RUNTIME_LIB_SUBDIR="/lib"
 UCLIBCXX_RUNTIME_BIN_SUBDIR="/bin"
 UCLIBCXX_EXCEPTION_SUPPORT=y
 IMPORT_LIBSUP=y
+# IMPORT_LIBGCC_EH is not set
+# BUILD_STATIC_LIB is not set
 # DODEBUG is not set
index 666492e310e9d7c4f8a78c3d6b2ccee4ea33cd49..67ccbd4f14909499e56553697076ff631b14772b 100644 (file)
@@ -1,5 +1,5 @@
 config BR2_PACKAGE_VTUN
-       tristate "vtun"
+       tristate "vtun - VPN tunneling daemon"
        default m if CONFIG_DEVEL
        select BR2_PACKAGE_ZLIB
        select BR2_PACKAGE_LZO
index 49daaa3a215a3a39618dd30a30c32d718cc2d2e4..306c25d3fe03b300a6750c8c28b0e9a306fde0b4 100644 (file)
@@ -2,60 +2,62 @@
 
 include $(TOPDIR)/rules.mk
 
-PKG_NAME := vtun
-PKG_VERSION := 2.6
-PKG_RELEASE := 1
-PKG_MD5SUM := 309534fd03c5d13a19c43916f61f4bbf
+PKG_NAME:=vtun
+PKG_VERSION:=2.6
+PKG_RELEASE:=1
+PKG_MD5SUM:=309534fd03c5d13a19c43916f61f4bbf
 
-PKG_SOURCE_URL := @SF/vtun
-PKG_SOURCE := $(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-PKG_CAT := zcat
+PKG_SOURCE_URL:=@SF/vtun
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_CAT:=zcat
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 
 include $(TOPDIR)/package/rules.mk
 
 $(eval $(call PKG_template,VTUN,vtun,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
 
 $(PKG_BUILD_DIR)/.configured:
-       (cd $(PKG_BUILD_DIR) ; \
-       $(TARGET_CONFIGURE_OPTS) \
-       CFLAGS="$(TARGET_CFLAGS) \
-       -I$(STAGING_DIR)/usr/include" \
-       LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
-       ./configure \
-       --target=$(GNU_TARGET_NAME) \
-       --host=$(GNU_TARGET_NAME) \
-       --build=$(GNU_HOST_NAME) \
-       --prefix=/usr \
-       --exec-prefix=/usr \
-       --bindir=/usr/bin \
-       --sbindir=/usr/sbin \
-       --libexecdir=/usr/lib \
-       --datadir=/usr/share \
-       --infodir=/usr/share/info \
-       --mandir=/usr/share/man \
-       --localstatedir=/var \
-       --sysconfdir=/etc \
-       --with-kernel=$(LINUX_DIR) \
-       --with-zlib=$(STAGING_DIR)/usr/ \
-       --with-lzo-headers=$(STAGING_DIR)/usr/include \
-       --with-lzo-libs=$(STAGING_DIR)/usr/lib \
-       $(DISABLE_NLS) )
-       touch $(PKG_BUILD_DIR)/.configured
+       (cd $(PKG_BUILD_DIR) ; rm -rf config.{cache,status} ; \
+               $(TARGET_CONFIGURE_OPTS) \
+               CFLAGS="$(TARGET_CFLAGS)" \
+               CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
+               LIBS="-L$(STAGING_DIR)/usr/lib" \
+               BLOWFISH_HDR_DIR="$(STAGING_DIR)/usr/include/openssl" \
+               LZO_HDR_DIR="$(STAGING_DIR)/usr/include" \
+               SSL_HDR_DIR="$(STAGING_DIR)/usr/include/openssl" \
+               ./configure \
+               --target=$(GNU_TARGET_NAME) \
+               --host=$(GNU_TARGET_NAME) \
+               --build=$(GNU_HOST_NAME) \
+               --program-prefix="" \
+               --program-suffix="" \
+               --prefix=/usr \
+               --exec-prefix=/usr \
+               --bindir=/usr/bin \
+               --datadir=/usr/share \
+               --includedir=/usr/include \
+               --infodir=/usr/share/info \
+               --libdir=/usr/lib \
+               --libexecdir=/usr/lib \
+               --localstatedir=/var \
+               --mandir=/usr/share/man \
+               --sbindir=/usr/sbin \
+               --sysconfdir=/etc \
+               $(DISABLE_LARGEFILE) \
+               $(DISABLE_NLS) \
+       )
+       touch $@
 
 $(PKG_BUILD_DIR)/.built:
        $(MAKE) -C $(PKG_BUILD_DIR) \
-       CC=$(TARGET_CC) \
-       CFLAGS="$(TARGET_CFLAGS) \
-       -I$(STAGING_DIR)/usr/include" \
-       LDFLAGS="-L$(STAGING_DIR)/usr/lib -lssl -lz -llzo -lcrypto" \
-       vtund
+               vtund
        touch $@
 
 $(IPKG_VTUN):
-       mkdir -p $(IDIR_VTUN)/usr/sbin
-       cp $(PKG_BUILD_DIR)/vtund $(IDIR_VTUN)/usr/sbin/
-       $(STRIP) $(IDIR_VTUN)/usr/sbin/*
-       mkdir -p $(IDIR_VTUN)/etc
-       cp $(PKG_BUILD_DIR)/vtund.conf $(IDIR_VTUN)/etc
+       install -m0755 -d $(IDIR_VTUN)/etc
+       install -m0600 $(PKG_BUILD_DIR)/vtund.conf $(IDIR_VTUN)/etc/
+       install -m0755 -d $(IDIR_VTUN)/usr/sbin
+       install -m0755 $(PKG_BUILD_DIR)/vtund $(IDIR_VTUN)/usr/sbin/
+       $(RSTRIP) $(IDIR_VTUN)
        $(IPKG_BUILD) $(IDIR_VTUN) $(PACKAGE_DIR)
index 1d7ad928c508f51c606d3a7b03ad782dc71cf4fb..c4760fdfec24a0c244b1eecca306a91cfa40a457 100644 (file)
@@ -5,4 +5,4 @@ Architecture: mipsel
 Maintainer: marcel@slowthinkers.net
 Source: buildroot internal
 Description: A VPN tunnel daemon
-Depends: openssl, liblzo, zlib, kmod-tun
+Depends: libopenssl, liblzo, zlib, kmod-tun
index aa03683a10ed3b26ce8033cd1b3b40bc8568a71f..2edab748f4bf856abffc472cc6540749bb463cf5 100644 (file)
@@ -3,15 +3,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=wificonf
-PKG_RELEASE:=1
+PKG_RELEASE:=4
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/wificonf
 
 include $(TOPDIR)/package/rules.mk
 
-
-
-
 $(eval $(call PKG_template,WIFICONF,$(PKG_NAME),$(PKG_RELEASE),$(ARCH)))
 
 $(PKG_BUILD_DIR)/.prepared:
index f96ef1524bf002e2257c1ba12c9adcd99abdc716..61e0910f623bf2e9961e77aaa4272ecef9795d99 100644 (file)
        do { \
                ERR_SET_EXT(rname, request); \
                fprintf(stderr, "    too few arguments.\n"); \
-               return; \
        } while(0)
 
 #define ABORT_ARG_TYPE(rname, request, arg) \
        do { \
                ERR_SET_EXT(rname, request); \
                fprintf(stderr, "    invalid argument \"%s\".\n", arg); \
-               return; \
        } while(0)
 
 #define ABORT_ARG_SIZE(rname, request, max) \
        do { \
                ERR_SET_EXT(rname, request); \
                fprintf(stderr, "    argument too big (max %d)\n", max); \
-               return; \
        } while(0)
 
 /*------------------------------------------------------------------*/
@@ -64,7 +61,6 @@
                ERR_SET_EXT(rname, request); \
                fprintf(stderr, "    SET failed on device %-1.16s ; %s.\n", \
                        ifname, strerror(errno)); \
-               return; \
        } } while(0)
 
 /*------------------------------------------------------------------*/
                ERR_SET_EXT(rname, request); \
                fprintf(stderr, "    GET failed on device %-1.16s ; %s.\n", \
                        ifname, strerror(errno)); \
-               return; \
        } } while(0)
 
+void set_wext_ssid(int skfd, char *ifname);
+
 char *prefix;
 char buffer[128];
+int wpa_enc = 0;
 
 char *wl_var(char *name)
 {
@@ -92,12 +90,12 @@ char *wl_var(char *name)
 
 int nvram_enabled(char *name)
 {
-       return (nvram_match(name, "1") || nvram_match(name, "on") || nvram_match(name, "enabled") ? 1 : 0);
+       return (nvram_match(name, "1") || nvram_match(name, "on") || nvram_match(name, "enabled") || nvram_match(name, "true") || nvram_match(name, "yes") ? 1 : 0);
 }
 
 int nvram_disabled(char *name)
 {
-       return (nvram_match(name, "0") || nvram_match(name, "off") || nvram_match(name, "disabled") ? 1 : 0);
+       return (nvram_match(name, "0") || nvram_match(name, "off") || nvram_match(name, "disabled") || nvram_match(name, "false") || nvram_match(name, "no") ? 1 : 0);
 }
 
 
@@ -115,8 +113,6 @@ int bcom_ioctl(int skfd, char *ifname, int cmd, void *buf, int len)
        strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
 
        ret = ioctl(skfd, SIOCDEVPRIVATE, &ifr);
-       if (ret < 0)
-               fprintf(stderr, "bcom_ioctl [cmd=%d, buf=%08x, len=%d] failed: %d\n", cmd, buf, len, ret);
 
        return ret;
 }
@@ -131,7 +127,7 @@ int bcom_set_val(int skfd, char *ifname, char *var, void *val, int len)
 
        strcpy(buf, var);
        
-       if ((ret = bcom_ioctl(skfd, ifname, WLC_GET_VAR, buf, sizeof(buf))))
+       if ((ret = bcom_ioctl(skfd, ifname, WLC_SET_VAR, buf, sizeof(buf))))
                return ret;
 
        memcpy(val, buf, len);
@@ -143,32 +139,52 @@ int bcom_set_int(int skfd, char *ifname, char *var, int val)
        return bcom_set_val(skfd, ifname, var, &val, sizeof(val));
 }
 
-void setup_bcom(int skfd, char *ifname)
+void stop_bcom(int skfd, char *ifname)
 {
        int val = 0;
-       char *v;
+       wlc_ssid_t ssid;
        
        if (bcom_ioctl(skfd, ifname, WLC_GET_MAGIC, &val, sizeof(val)) < 0)
                return;
-
+       
+       ssid.SSID_len = 0;
+       ssid.SSID[0] = 0;
+       bcom_ioctl(skfd, ifname, WLC_SET_SSID, &ssid, sizeof(ssid));
        bcom_ioctl(skfd, ifname, WLC_DOWN, NULL, 0);
+
+}
+
+void start_bcom(int skfd, char *ifname)
+{
+       int val = 0;
        
-       /* Set up WPA */
-       if (nvram_match(wl_var("crypto"), "tkip"))
-               val = TKIP_ENABLED;
-       else if (nvram_match(wl_var("crypto"), "aes"))
-               val = AES_ENABLED;
-       else if (nvram_match(wl_var("crypto"), "tkip+aes"))
-               val = TKIP_ENABLED | AES_ENABLED;
-       else
-               val = 0;
-       bcom_ioctl(skfd, ifname, WLC_SET_WSEC, &val, sizeof(val));
+       if (bcom_ioctl(skfd, ifname, WLC_GET_MAGIC, &val, sizeof(val)) < 0)
+               return;
 
-       if (val && nvram_get(wl_var("wpa_psk"))) {
-               val = 1;
-               bcom_ioctl(skfd, ifname, WLC_SET_EAP_RESTRICT, &val, sizeof(val));
-       }
+       bcom_ioctl(skfd, ifname, WLC_UP, &val, sizeof(val));
+       set_wext_ssid(skfd, ifname);
+}
+
+
+void setup_bcom(int skfd, char *ifname)
+{
+       int val = 0;
+       char buf[8192];
+       char wbuf[80];
+       char *v;
+       
+       if (bcom_ioctl(skfd, ifname, WLC_GET_MAGIC, &val, sizeof(val)) < 0)
+               return;
+       
+       nvram_set(wl_var("ifname"), ifname);
+       
+       stop_bcom(skfd, ifname);
 
+       /* Set Country */
+       strncpy(buf, nvram_safe_get(wl_var("country_code")), 4);
+       buf[3] = 0;
+       bcom_ioctl(skfd, ifname, WLC_SET_COUNTRY, buf, 4);
+       
        /* Set up afterburner */
        val = ABO_AUTO;
        if (nvram_enabled(wl_var("afterburner")))
@@ -178,23 +194,40 @@ void setup_bcom(int skfd, char *ifname)
        bcom_set_val(skfd, ifname, "afterburner_override", &val, sizeof(val));
        
        /* Set other options */
-       val = atoi(nvram_safe_get(wl_var("lazywds")));
+       val = nvram_enabled(wl_var("lazywds"));
        bcom_ioctl(skfd, ifname, WLC_SET_LAZYWDS, &val, sizeof(val));
-       val = atoi(nvram_safe_get(wl_var("frag")));
-       bcom_ioctl(skfd, ifname, WLC_SET_FRAG, &val, sizeof(val));
-       val = atoi(nvram_safe_get(wl_var("dtim")));
-       bcom_ioctl(skfd, ifname, WLC_SET_DTIMPRD, &val, sizeof(val));
-       val = atoi(nvram_safe_get(wl_var("bcn")));
-       bcom_ioctl(skfd, ifname, WLC_SET_BCNPRD, &val, sizeof(val));
-       val = atoi(nvram_safe_get(wl_var("rts")));
-       bcom_ioctl(skfd, ifname, WLC_SET_RTS, &val, sizeof(val));
-       val = atoi(nvram_safe_get(wl_var("antdiv")));
-       bcom_ioctl(skfd, ifname, WLC_SET_ANTDIV, &val, sizeof(val));
-       val = atoi(nvram_safe_get(wl_var("txant")));
-       bcom_ioctl(skfd, ifname, WLC_SET_TXANT, &val, sizeof(val));
+       
+       if (v = nvram_get(wl_var("frag"))) {
+               val = atoi(v);
+               bcom_ioctl(skfd, ifname, WLC_SET_FRAG, &val, sizeof(val));
+       }
+       if (v = nvram_get(wl_var("dtim"))) {
+               val = atoi(v);
+               bcom_ioctl(skfd, ifname, WLC_SET_DTIMPRD, &val, sizeof(val));
+       }
+       if (v = nvram_get(wl_var("bcn"))) {
+               val = atoi(v);
+               bcom_ioctl(skfd, ifname, WLC_SET_BCNPRD, &val, sizeof(val));
+       }
+       if (v = nvram_get(wl_var("rts"))) {
+               val = atoi(v);
+               bcom_ioctl(skfd, ifname, WLC_SET_RTS, &val, sizeof(val));
+       }
+       if (v = nvram_get(wl_var("antdiv"))) {
+               val = atoi(v);
+               bcom_ioctl(skfd, ifname, WLC_SET_ANTDIV, &val, sizeof(val));
+       }
+       if (v = nvram_get(wl_var("txant"))) {
+               val = atoi(v);
+               bcom_ioctl(skfd, ifname, WLC_SET_TXANT, &val, sizeof(val));
+       }
+       
+       val = nvram_enabled(wl_var("closed"));
+       bcom_ioctl(skfd, ifname, WLC_SET_CLOSED, &val, sizeof(val));
 
        val = nvram_enabled(wl_var("ap_isolate"));
        bcom_set_int(skfd, ifname, "ap_isolate", val);
+
        val = nvram_enabled(wl_var("frameburst"));
        bcom_ioctl(skfd, ifname, WLC_SET_FAKEFRAG, &val, sizeof(val));
 
@@ -207,7 +240,6 @@ void setup_bcom(int skfd, char *ifname)
                val = WLC_MACMODE_DISABLED;
 
        if ((val != WLC_MACMODE_DISABLED) && (v = nvram_get(wl_var("maclist")))) {
-               char buf[8192];
                struct maclist *mac_list;
                struct ether_addr *addr;
                char *next;
@@ -215,9 +247,9 @@ void setup_bcom(int skfd, char *ifname)
                memset(buf, 0, 8192);
                mac_list = (struct maclist *) buf;
                addr = mac_list->ea;
-
-               foreach(v, nvram_safe_get(wl_var("maclist")), next) {
-                       if (ether_atoe(v, addr->ether_addr_octet)) {
+               
+               foreach(wbuf, v, next) {
+                       if (ether_atoe(wbuf, addr->ether_addr_octet)) {
                                mac_list->count++;
                                addr++;
                        }
@@ -227,6 +259,21 @@ void setup_bcom(int skfd, char *ifname)
                val = WLC_MACMODE_DISABLED;
        }
        bcom_ioctl(skfd, ifname, WLC_SET_MACMODE, &val, sizeof(val));
+
+       if (v = nvram_get(wl_var("wds"))) {
+               struct maclist *wdslist = (struct maclist *) buf;
+               struct ether_addr *addr = wdslist->ea;
+               char *next;
+
+               memset(buf, 0, 8192);
+               foreach(wbuf, v, next) {
+                       if (ether_atoe(wbuf, addr->ether_addr_octet)) {
+                               wdslist->count++;
+                               addr++;
+                       }
+               }
+               bcom_ioctl(skfd, ifname, WLC_SET_WDSLIST, buf, sizeof(buf));
+       }
        
        /* Set up G mode */
        bcom_ioctl(skfd, ifname, WLC_GET_PHYTYPE, &val, sizeof(val));
@@ -234,9 +281,14 @@ void setup_bcom(int skfd, char *ifname)
                int override = WLC_G_PROTECTION_OFF;
                int control = WLC_G_PROTECTION_CTL_OFF;
                
-               val = atoi(nvram_safe_get(wl_var("gmode")));
+               if (v = nvram_get(wl_var("gmode"))) 
+                       val = atoi(v);
+               else
+                       val = 1;
+
                if (val > 5)
                        val = 1;
+
                bcom_ioctl(skfd, ifname, WLC_SET_GMODE, &val, sizeof(val));
                
                if (nvram_match(wl_var("gmode_protection"), "auto")) {
@@ -249,40 +301,85 @@ void setup_bcom(int skfd, char *ifname)
                }
                bcom_ioctl(skfd, ifname, WLC_SET_GMODE_PROTECTION_CONTROL, &override, sizeof(control));
                bcom_ioctl(skfd, ifname, WLC_SET_GMODE_PROTECTION_OVERRIDE, &override, sizeof(override));
+
+               if (val = 0) {
+                       if (nvram_match(wl_var("plcphdr"), "long"))
+                               val = WLC_PLCP_AUTO;
+                       else
+                               val = WLC_PLCP_SHORT;
+
+                       bcom_ioctl(skfd, ifname, WLC_SET_PLCPHDR, &val, sizeof(val));
+               }
        }
-}
 
-void set_wext_ssid(int skfd, char *ifname)
-{
-       char *buffer;
-       struct iwreq wrq;
+       start_bcom(skfd, ifname);
 
-       if (buffer = nvram_get(wl_var("ssid"))) {
-               if (strlen(buffer) > IW_ESSID_MAX_SIZE) {
-                       ABORT_ARG_SIZE("Set ESSID", SIOCSIWESSID, IW_ESSID_MAX_SIZE);
-               } else {
-                       char essid[IW_ESSID_MAX_SIZE + 1];
-
-                       wrq.u.essid.flags = 1;
-                       strcpy(essid, buffer);
-                       wrq.u.essid.pointer = (caddr_t) essid;
-                       wrq.u.essid.length = strlen(essid) + 1;
-                       IW_SET_EXT_ERR(skfd, ifname, SIOCSIWESSID, &wrq, "Set ESSID");
+       if (!(v = nvram_get(wl_var("akm"))))
+               v = nvram_safe_get(wl_var("auth_mode"));
+       
+       if (strstr(v, "wpa") || strstr(v, "psk")) {
+               wpa_enc = 1;
+
+               /* Set up WPA */
+               if (nvram_match(wl_var("crypto"), "tkip"))
+                       val = TKIP_ENABLED;
+               else if (nvram_match(wl_var("crypto"), "aes"))
+                       val = AES_ENABLED;
+               else if (nvram_match(wl_var("crypto"), "tkip+aes"))
+                       val = TKIP_ENABLED | AES_ENABLED;
+               else
+                       val = 0;
+               bcom_ioctl(skfd, ifname, WLC_SET_WSEC, &val, sizeof(val));
+
+               if (val && strstr(v, "psk")) {
+                       v = nvram_safe_get(wl_var("wpa_psk"));
+
+                       if ((strlen(v) >= 8) && (strlen(v) < 63)) {
+                               val = 4;
+                               bcom_ioctl(skfd, ifname, WLC_SET_WPA_AUTH, &val, sizeof(val));
+                               
+                               bcom_ioctl(skfd, ifname, WLC_GET_AP, &val, sizeof(val));
+                               if (!val) {
+                                       /* Enable in-driver WPA supplicant */
+                                       wsec_pmk_t pmk;
+                                       
+                                       pmk.key_len = (unsigned short) strlen(v);
+                                       pmk.flags = WSEC_PASSPHRASE;
+                                       strcpy(pmk.key, v);
+                                       bcom_ioctl(skfd, ifname, WLC_SET_WSEC_PMK, &pmk, sizeof(pmk));
+                                       bcom_set_int(skfd, ifname, "sup_wpa", 1);
+                               }
+                       }
+               } else  {
+                       val = 1;
+                       bcom_ioctl(skfd, ifname, WLC_SET_EAP_RESTRICT, &val, sizeof(val));
                }
+       } else {
+               val = 0;
+
+               bcom_ioctl(skfd, ifname, WLC_SET_WSEC, &val, sizeof(val));
+               bcom_ioctl(skfd, ifname, WLC_SET_WPA_AUTH, &val, sizeof(val));
+               bcom_ioctl(skfd, ifname, WLC_SET_EAP_RESTRICT, &val, sizeof(val));
+               bcom_set_int(skfd, ifname, "sup_wpa", 0);
        }
 }
 
-void start_bcom(int skfd, char *ifname)
+void set_wext_ssid(int skfd, char *ifname)
 {
-       int val = 0;
-       
-       if (bcom_ioctl(skfd, ifname, WLC_GET_MAGIC, &val, sizeof(val)) < 0)
-               return;
+       char *buffer;
+       char essid[IW_ESSID_MAX_SIZE + 1];
+       struct iwreq wrq;
 
-       bcom_ioctl(skfd, ifname, WLC_UP, &val, sizeof(val));
+       buffer = nvram_get(wl_var("ssid"));
        
-       /* Need to re-set SSID after WLC_UP */
-       set_wext_ssid(skfd, ifname);
+       if (!buffer || (strlen(buffer) > IW_ESSID_MAX_SIZE)) 
+               buffer = "OpenWrt";
+
+       wrq.u.essid.flags = 1;
+       strcpy(essid, buffer);
+       wrq.u.essid.pointer = (caddr_t) essid;
+       wrq.u.essid.length = strlen(essid) + 1;
+       IW_SET_EXT_ERR(skfd, ifname, SIOCSIWESSID, &wrq, "Set ESSID");
 }
 
 void setup_wext_wep(int skfd, char *ifname)
@@ -292,7 +389,8 @@ void setup_wext_wep(int skfd, char *ifname)
        char keystr[5];
        char *keyval;
        unsigned char key[IW_ENCODING_TOKEN_MAX];
-
+       
+       memset(&wrq, 0, sizeof(wrq));
        strcpy(keystr, "key1");
        for (i = 1; i <= 4; i++) {
                if (keyval = nvram_get(wl_var(keystr))) {
@@ -308,7 +406,7 @@ void setup_wext_wep(int skfd, char *ifname)
                keystr[3]++;
        }
        
-       
+       memset(&wrq, 0, sizeof(wrq));
        i = atoi(nvram_safe_get(wl_var("key")));
        if (i > 0 && i < 4) {
                wrq.u.data.flags = i | IW_ENCODE_RESTRICTED;
@@ -316,14 +414,25 @@ void setup_wext_wep(int skfd, char *ifname)
        }
 }
 
+void set_wext_mode(skfd, ifname)
+{
+       struct iwreq wrq;
+       int ap = 0, infra = 0, wet = 0;
+       
+       /* Set operation mode */
+       ap = !nvram_match(wl_var("mode"), "sta") && !nvram_match(wl_var("mode"), "wet");
+       infra = !nvram_disabled(wl_var("infra"));
+       wet = nvram_enabled(wl_var("wet")) || !nvram_match(wl_var("mode"), "wet");
+
+       wrq.u.mode = (!infra ? IW_MODE_ADHOC : (ap ? IW_MODE_MASTER : (wet ? IW_MODE_REPEAT : IW_MODE_INFRA)));
+       IW_SET_EXT_ERR(skfd, ifname, SIOCSIWMODE, &wrq, "Set Mode");
+}
+
 void setup_wext(int skfd, char *ifname)
 {
        char *buffer;
        struct iwreq wrq;
 
-       /* Set ESSID */
-       set_wext_ssid(skfd, ifname);
-       
        /* Set channel */
        int channel = atoi(nvram_safe_get(wl_var("channel")));
        
@@ -334,33 +443,24 @@ void setup_wext(int skfd, char *ifname)
        if (channel > 0) {
                wrq.u.freq.flags = IW_FREQ_FIXED;
                wrq.u.freq.m = channel;
+               IW_SET_EXT_ERR(skfd, ifname, SIOCSIWFREQ, &wrq, "Set Frequency");
        }
-       IW_SET_EXT_ERR(skfd, ifname, SIOCSIWFREQ, &wrq, "Set Frequency");
-       
-       /* Set operation mode */
-       int ap = 0, infra = 0, wet = 0;
-       
-       ap = (nvram_match(wl_var("mode"), "ap") || nvram_match(wl_var("mode"), "wds"));
-       infra = nvram_enabled(wl_var("infra"));
-       wet = nvram_enabled(wl_var("wet"));
 
-       wrq.u.mode = (!infra ? IW_MODE_ADHOC : (ap ? IW_MODE_MASTER : (wet ? IW_MODE_REPEAT : IW_MODE_INFRA)));
-       IW_SET_EXT_ERR(skfd, ifname, SIOCSIWMODE, &wrq, "Set Mode");
 
        /* Disable radio if wlX_radio is set and not enabled */
-       if (nvram_disabled(wl_var("radio")))
-               wrq.u.txpower.disabled = 1;
-       else 
-               wrq.u.txpower.disabled = 0;
+       wrq.u.txpower.disabled = nvram_disabled(wl_var("radio"));
 
        wrq.u.txpower.value = -1;
        wrq.u.txpower.fixed = 1;
-       wrq.u.txpower.flags = IW_TXPOW_MWATT;
+       wrq.u.txpower.flags = IW_TXPOW_DBM;
        IW_SET_EXT_ERR(skfd, ifname, SIOCSIWTXPOW, &wrq, "Set Tx Power");
 
        /* Set up WEP */
-       if (nvram_enabled(wl_var("wep")))
+       if (nvram_enabled(wl_var("wep")) && !wpa_enc)
                setup_wext_wep(skfd, ifname);
+       
+       /* Set ESSID */
+       set_wext_ssid(skfd, ifname);
 
 }
 
@@ -376,16 +476,22 @@ static int setup_interfaces(int skfd, char *ifname, char *args[], int count)
        if(iw_get_ext(skfd, ifname, SIOCGIWNAME, &wrq) < 0)
                return 0;
 
-       setup_bcom(skfd, ifname);
-       setup_wext(skfd, ifname);
-       start_bcom(skfd, ifname);
+       if (strncmp(ifname, "ath", 3) == 0) {
+               set_wext_mode(skfd, ifname);
+               setup_wext(skfd, ifname);
+       } else {
+               stop_bcom(skfd, ifname);
+               set_wext_mode(skfd, ifname);
+               setup_bcom(skfd, ifname);
+               setup_wext(skfd, ifname);
+       }
+       
        prefix[2]++;
 }
 
 int main(int argc, char **argv)
 {
        int skfd;
-
        if((skfd = iw_sockets_open()) < 0) {
                perror("socket");
                exit(-1);
index ec78d71b83ec2d00d08f5516007907d2c18498e4..76b91def10049f8dbd4c82f9ec91ed92d6b77ccd 100644 (file)
@@ -4,3 +4,4 @@ Section: net
 Maintainer: Nico <nthill@free.fr>
 Source: http://openwrt.org/cgi-bin/viewcvs.cgi/openwrt/package/wpa_supplicant
 Description: WPA Supplicant with support for WPA and WPA2
+Depends: libopenssl
index 7dcb20e83ead87cb78877e93e208662f3cf19f3b..3b22beceb92de6f6a891166ff24d3a585532be42 100644 (file)
@@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=xinetd
 PKG_VERSION:=2.3.13
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_MD5SUM:=4295b5fe12350f09b5892b363348ac8b
 
 PKG_SOURCE_URL:=http://www.xinetd.org/
@@ -62,6 +62,7 @@ $(PKG_BUILD_DIR)/.built:
 $(IPKG_XINETD):
        install -d -m0755 $(IDIR_XINETD)/etc
        install -m0644 ./files/xinetd.conf $(IDIR_XINETD)/etc/xinetd.conf
+       install -d -m0755 $(IDIR_XINETD)/etc/xinetd.d
        install -d -m0755 $(IDIR_XINETD)/etc/init.d
        install -m0755 ./files/xinetd.init $(IDIR_XINETD)/etc/init.d/xinetd
        install -d -m0755 $(IDIR_XINETD)/usr/sbin
index 95f6ce997e0d8e4dba56ecbd91f2d4c562ce7a82..2d88d51a25e6172339fd105a04bfa549eb46466b 100644 (file)
@@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zlib
 PKG_VERSION:=1.2.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_MD5SUM:=1b8aab042d40979e456194c468fd72c5
 
 PKG_SOURCE_URL:=@SF/zlib
@@ -21,6 +21,8 @@ $(eval $(call PKG_template,ZLIB,zlib,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
        (cd $(PKG_BUILD_DIR); \
                $(TARGET_CONFIGURE_OPTS) \
+               LDSHARED="$(TARGET_CC) -shared -Wl,-soname,libz.so.1" \
+               CFLAGS="$(TARGET_CFLAGS) $(CFLAGS_LARGEFILE)" \
                ./configure \
                --prefix=/usr \
                --shared \
@@ -46,16 +48,17 @@ $(IPKG_ZLIB):
 
 $(STAGING_DIR)/usr/lib/libz.so: $(PKG_BUILD_DIR)/.built
        mkdir -p $(STAGING_DIR)/usr/include
-       cp -fpR $(PKG_INSTALL_DIR)/usr/include/z{conf,lib}.h $(STAGING_DIR)/usr/include
+       cp -fpR $(PKG_INSTALL_DIR)/usr/include/*.h $(STAGING_DIR)/usr/include
        mkdir -p $(STAGING_DIR)/usr/lib
-       cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libz.{a,so*} $(STAGING_DIR)/usr/lib
+       cp -fpR $(PKG_INSTALL_DIR)/usr/lib/* $(STAGING_DIR)/usr/lib
        touch $(STAGING_DIR)/usr/lib/libz.so
        
 install-dev: $(STAGING_DIR)/usr/lib/libz.so
 
 uninstall-dev:
-       rm -rf $(STAGING_DIR)/usr/include/z{conf,lib}.h
-       rm -rf $(STAGING_DIR)/usr/lib/libz.{a,so*}
+       rm -rf $(STAGING_DIR)/usr/include/zconf.h
+       rm -rf $(STAGING_DIR)/usr/include/zlib.h
+       rm -rf $(STAGING_DIR)/usr/lib/libz.*
 
 compile: install-dev
 clean: uninstall-dev
diff --git a/openwrt/package/zlib/patches/zlib-1.2.2-CAN-2005-2096.patch b/openwrt/package/zlib/patches/zlib-1.2.2-CAN-2005-2096.patch
new file mode 100644 (file)
index 0000000..b09ae6b
--- /dev/null
@@ -0,0 +1,26 @@
+Name: CAN-2005-2096 (under review)
+Description:
+  Buffer overflow in zlib 1.2 and later versions allows remote attackers 
+  to cause a denial of service (crash) via a crafted compressed stream, as 
+  demonstrated using a crafted PNG file.
+  
+References:
+  * DEBIAN:DSA-740
+    http://www.debian.org/security/2005/dsa-740
+  * REDHAT:RHSA-2005:569
+    http://www.redhat.com/support/errata/RHSA-2005-569.html 
+
+  http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-2096
+
+diff -ruN zlib-1.2.2-old/inftrees.c zlib-1.2.2-new/inftrees.c
+--- zlib-1.2.2-old/inftrees.c  2004-09-15 16:30:06.000000000 +0200
++++ zlib-1.2.2-new/inftrees.c  2005-07-08 21:18:58.000000000 +0200
+@@ -134,7 +134,7 @@
+         left -= count[len];
+         if (left < 0) return -1;        /* over-subscribed */
+     }
+-    if (left > 0 && (type == CODES || (codes - count[0] != 1)))
++    if (left > 0 && (type == CODES || max != 1))
+         return -1;                      /* incomplete set */
+     /* generate offsets into symbol table for each length for sorting */
index df55b8f12e37a57b0b01119a11c9be4655aa6553..a59ffe6ba6c285008fe715752da5ec5eda2def99 100755 (executable)
@@ -57,7 +57,7 @@ sub cleanup
 foreach my $mirror (@ARGV) {
        if ($mirror =~ /^\@SF\/(.+)$/) {
                my $sfpath = $1;
-               open SF, "wget -t1 -q -O- 'http://prdownloads.sf.net/$sfpath/$filename' |";
+               open SF, "wget -t1 -q -O- 'http://prdownloads.sourceforge.net/$sfpath/$filename' |";
                while (<SF>) {
                        /RADIO NAME=use_default VALUE=(\w+) OnClick="form\.submit\(\)">/ and do {
                                push @mirrors, "http://$1.dl.sourceforge.net/sourceforge/$sfpath";
@@ -77,7 +77,7 @@ foreach my $mirror (@ARGV) {
 
 push @mirrors, 'http://mirror1.openwrt.org/';
 push @mirrors, 'http://mirror2.openwrt.org/';
-push @mirrors, 'http://openwrt.org/download/sources/';
+push @mirrors, 'http://downloads.openwrt.org/sources/';
 
 while (!$ok) {
        my $mirror = shift @mirrors;
index efbeb7dd585f2ae7c3e4aa4f38b6626e452878e2..6cd1cb440ae05f18eda675639b919cdea210299d 100755 (executable)
@@ -121,6 +121,8 @@ Valid destinations are directories or one of the dest names from $IPKG_CONF:" >&
                IPKG_TMP=$IPKG_ROOT/tmp/ipkg
        fi
 
+       [ -e "$IPKG_TMP" ] || mkdir -p $IPKG_TMP
+
        # Destination specific ipkg meta-data directory
        IPKG_STATE_DIR=$IPKG_ROOT/$IPKG_DIR_PREFIX
 
@@ -690,8 +692,6 @@ Status: install ok not-installed" | ipkg_status_update_sd $sd $pkg
                                return 1;
                        fi
 
-                       [ -e "$IPKG_TMP" ] || mkdir -p $IPKG_TMP
-
                        echo ""
                        local tmp_pkg_file="$IPKG_TMP/"`ipkg_file_part $filename`
                        if ! ipkg_download `ipkg_src_byname $src`/$filename $tmp_pkg_file; then
index 4f9c54144a8ee692496d26eb2b11433fb56cb8bc..e6156b48bf034474cbc056a824dbcff01b78760c 100644 (file)
@@ -1,42 +1,14 @@
 include $(TOPDIR)/rules.mk
 
-# Default target skeleton stuff, may be overridden
-TARGET_SKEL_DIR=default/target_skeleton
-
 all: install
 
-$(TARGET_DIR):
-       mkdir -p $(TARGET_DIR)
-       if [ -f "$(TARGET_SKELETON)" ] ; then \
-       zcat $(TARGET_SKELETON) | tar -C $(BUILD_DIR) -xf -; \
-       fi;
-       if [ -d "$(TARGET_SKEL_DIR)" ] ; then \
-               cp -a $(TARGET_SKEL_DIR)/* $(TARGET_DIR)/; \
-       fi;
-       mkdir -p $(TARGET_DIR)/jffs
-       mkdir -p $(TARGET_DIR)/dev
-       mkdir -p $(TARGET_DIR)/proc
-       mkdir -p $(TARGET_DIR)/tmp
-       mkdir -p $(TARGET_DIR)/lib
-       mkdir -p $(TARGET_DIR)/usr/lib
-       mkdir -p $(TARGET_DIR)/usr/bin
-       ln -sf /tmp/resolv.conf $(TARGET_DIR)/etc/resolv.conf
-       rm -rf $(TARGET_DIR)/var
-       ln -sf /tmp $(TARGET_DIR)/var
-       -find $(TARGET_DIR) -type d -name CVS | xargs rm -rf
-       -find $(TARGET_DIR) -type d -name .svn | xargs rm -rf
-
 $(BIN_DIR):
        mkdir -p $(BIN_DIR)
 
-$(TARGET_DIR)/etc/sysconf:
-       mkdir -p $(TARGET_DIR)/etc
-       -grep \^BR2_SYSCONF $(TOPDIR)/.config > $(TARGET_DIR)/etc/sysconf
-
 linux-compile: utils-install lzma-install
-linux-install: $(TARGET_DIR)/etc/sysconf $(BIN_DIR)
+linux-install: $(BIN_DIR)
 
-prepare: $(TARGET_DIR)
+prepare: 
 compile: linux-compile
 install: image_clean linux-install
 clean: linux-clean utils-clean lzma-clean image_clean
@@ -54,5 +26,6 @@ image_clean:
        $(MAKE) -C $(patsubst %-rebuild,%,$@) rebuild
 %-install: %-compile
        $(MAKE) -C $(patsubst %-install,%,$@) install
-
+linux-imagebuilder:
+       $(MAKE) -C linux imagebuilder
 
diff --git a/openwrt/target/default/target_skeleton/bin/firstboot b/openwrt/target/default/target_skeleton/bin/firstboot
deleted file mode 100755 (executable)
index cef258c..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/sh
-# $Id$
-
-mount | grep squashfs >&- || {
-       echo "You do not have a squashfs partition; aborting"
-       echo "(firstboot cannot be run on jffs2 based firmwares)"
-       return
-}
-
-[ -f "/tmp/.firstboot" ] && {
-       echo "firstboot is already running"
-       return
-}
-touch /tmp/.firstboot
-
-jdev=$(mount | awk '/jffs2/ {print $3}')
-
-if [ -z "$jdev" ]; then
-       echo -n "Creating jffs2 partition... "
-       mtd erase OpenWrt >&- 
-       mount -t jffs2 /dev/mtdblock/4 /jffs
-       echo "done"
-       cd /jffs
-else
-       echo "firstboot has already been run"
-       echo "jffs2 partition is mounted, only resetting files"
-       cd $jdev
-fi
-
-exec 2>/dev/null
-
-mount /dev/mtdblock/2 /rom -o ro
-
-echo -n "creating directories... "
-{
-       cd /rom
-       find . -type d
-       cd -
-} | xargs mkdir
-echo "done"
-
-echo -n "setting up symlinks... "
-for file in $(cd /rom; find *  -type f; find *  -type l;)
-do {
-  [ "${file%/*}" = "usr/lib/ipkg/info" ] && {
-    cp -f /rom/$file $file
-  } || {
-    ln -sf /rom/$file $file
-  }
-} done
-echo "done"
-
-touch /tmp/resolv.conf
-ln -s /tmp/resolv.conf /etc/resolv.conf
-
-umount /rom
-mount none /jffs/proc -t proc
-pivot_root /jffs /jffs/rom
-mount none /dev  -t devfs
-mount none /tmp  -t ramfs
-umount /rom/proc
-umount /rom/tmp
-umount /rom/dev
diff --git a/openwrt/target/default/target_skeleton/bin/ipkg b/openwrt/target/default/target_skeleton/bin/ipkg
deleted file mode 100755 (executable)
index dd44dd6..0000000
+++ /dev/null
@@ -1,1188 +0,0 @@
-#!/bin/sh
-# ipkg - the itsy package management system
-#
-# Copyright (C) 2001 Carl D. Worth
-#
-# 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, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-set -e
-
-# By default do not do globbing. Any command wanting globbing should
-# explicitly enable it first and disable it afterwards.
-set -o noglob
-
-ipkg_is_upgrade () {
-  local A B a b     
-  A=$(echo $1 | sed -r "s/([0-9]+)[^[:alnum:]]*/ \1 /g").
-  B=$(echo $2 | sed -r "s/([0-9]+)[^[:alnum:]]*/ \1 /g").
-  while [ \! -z "$A" ] && [ \! -z "$B" ]; do {        
-    set $A; a=$1; shift; A=$*
-    set $B; b=$1; shift; B=$*
-      [ "$a" -lt "$b" ] 2>&- && return 1
-    { [ "$a" -gt "$b" ] 2>&- || [ "$a" ">" "$b" ]; } && return
-  }; done                                                     
-  return 1
-}         
-
-ipkg_srcs() {
-       local srcre="$1"
-       sed -ne "s/^src[[:space:]]\+$srcre[[:space:]]\+//p" < $IPKG_CONF
-}
-
-ipkg_src_names() {
-       sed -ne "s/^src[[:space:]]\+\([^[:space:]]\+\).*/\1/p" < $IPKG_CONF
-}
-
-ipkg_src_byname() {
-       local src="$1"
-       ipkg_srcs $src | head -1
-}
-
-ipkg_dests() {
-       local destre="`echo $1 | ipkg_protect_slashes`"
-       sed -ne "/^dest[[:space:]]\+$destre/{
-s/^dest[[:space:]]\+[^[:space:]]\+[[:space:]]\+//
-s/^/`echo $IPKG_OFFLINE_ROOT | ipkg_protect_slashes`/
-p
-}" < $IPKG_CONF
-}
-
-ipkg_dest_names() {
-       sed -ne "s/^dest[[:space:]]\+\([^[:space:]]\+\).*/\1/p" < $IPKG_CONF
-}
-
-ipkg_dests_all() {
-       ipkg_dests '.*'
-}
-
-ipkg_state_dirs() {
-       ipkg_dests_all | sed "s|\$|/$IPKG_DIR_PREFIX|"
-}
-
-ipkg_dest_default() {
-       ipkg_dests_all | head -1
-}
-
-ipkg_dest_default_name() {
-       ipkg_dest_names | head -1
-}
-
-ipkg_dest_byname() {
-       local dest="$1"
-       ipkg_dests $dest | head -1
-}
-
-ipkg_option() {
-       local option="$1"
-       sed -ne "s/^option[[:space:]]\+$option[[:space:]]\+//p" < $IPKG_CONF
-}
-
-ipkg_load_configuration() {
-       if [ -z "$IPKG_CONF_DIR" ]; then
-               IPKG_CONF_DIR=/etc
-       fi
-
-       IPKG_CONF="$IPKG_CONF_DIR/ipkg.conf"
-
-       if [ -z "$IPKG_OFFLINE_ROOT" ]; then
-           IPKG_OFFLINE_ROOT="`ipkg_option offline_root`"
-       fi
-       # Export IPKG_OFFLINE_ROOT for use by update-alternatives
-       export IPKG_OFFLINE_ROOT
-       if [ -n "$DEST_NAME" ]; then
-               IPKG_ROOT="`ipkg_dest_byname $DEST_NAME`"
-               if [ -z "$IPKG_ROOT" ]; then
-                       if [ -d "$IPKG_OFFLINE_ROOT$DEST_NAME" ]; then
-                               IPKG_ROOT="$IPKG_OFFLINE_ROOT$DEST_NAME";
-                       else
-                               echo "ipkg: invalid destination specification: $DEST_NAME
-Valid destinations are directories or one of the dest names from $IPKG_CONF:" >&2
-                               ipkg_dest_names >&2
-                               return 1
-                       fi
-               fi
-       else
-               IPKG_ROOT="`ipkg_dest_default`"
-       fi
-
-       # Global ipkg state directories
-       IPKG_DIR_PREFIX=usr/lib/ipkg
-       IPKG_LISTS_DIR=$IPKG_OFFLINE_ROOT/$IPKG_DIR_PREFIX/lists
-       IPKG_PENDING_DIR=$IPKG_OFFLINE_ROOT/$IPKG_DIR_PREFIX/pending
-       IPKG_TMP=$IPKG_ROOT/tmp/ipkg
-
-       # Destination specific ipkg meta-data directory
-       IPKG_STATE_DIR=$IPKG_ROOT/$IPKG_DIR_PREFIX
-
-       # Proxy Support
-       IPKG_PROXY_USERNAME="`ipkg_option proxy_username`"
-       IPKG_PROXY_PASSWORD="`ipkg_option proxy_password`"
-       IPKG_HTTP_PROXY="`ipkg_option http_proxy`"
-       IPKG_FTP_PROXY="`ipkg_option ftp_proxy`"
-       IPKG_NO_PROXY="`ipkg_option no_proxy`"
-       if [ -n "$IPKG_HTTP_PROXY" ]; then 
-               export http_proxy="$IPKG_HTTP_PROXY"
-       fi
-
-       if [ -n "$IPKG_FTP_PROXY" ]; then 
-               export ftp_proxy="$IPKG_FTP_PROXY"
-       fi
-
-       if [ -n "$IPKG_NO_PROXY" ]; then 
-               export no_proxy="$IPKG_NO_PROXY"
-       fi
-
-       IPKG_STATUS_FIELDS='\(Package\|Status\|Essential\|Version\|Conffiles\|Root\)'
-}
-
-ipkg_usage() {
-       [ $# -gt 0 ] && echo "ipkg: $*"
-       echo "
-usage: ipkg [options...] sub-command [arguments...]
-where sub-command is one of:
-
-Package Manipulation:
-       update                  Update list of available packages
-       upgrade                 Upgrade all installed packages to latest version
-       install <pkg>           Download and install <pkg> (and dependencies)
-       install <file.ipk>      Install package <file.ipk>
-       install <file.deb>      Install package <file.deb>
-       remove <pkg>            Remove package <pkg>
-
-Informational Commands:
-       list                    List available packages and descriptions
-       files <pkg>             List all files belonging to <pkg>
-       search <file>           Search for a packaging providing <file>
-       info [pkg [<field>]]    Display all/some info fields for <pkg> or all
-       status [pkg [<field>]]  Display all/some status fields for <pkg> or all
-       depends <pkg>           Print uninstalled package dependencies for <pkg>
-
-Options:
-       -d <dest_name>          Use <dest_name> as the the root directory for
-       -dest <dest_name>       package installation, removal, upgrading.
-                               <dest_name> should be a defined dest name from the
-                               configuration file, (but can also be a directory
-                               name in a pinch).
-        -o <offline_root>       Use <offline_root> as the root for offline installation.
-        -offline <offline_root>                                
-
-Force Options (use when ipkg is too smart for its own good):
-       -force-depends          Make dependency checks warnings instead of errors
-       -force-defaults         Use default options for questions asked by ipkg.
-                                (no prompts). Note that this will not prevent
-                                package installation scripts from prompting.
-" >&2
-       exit 1
-}
-
-ipkg_dir_part() {
-       local dir="`echo $1 | sed -ne 's/\(.*\/\).*/\1/p'`"
-       if [ -z "$dir" ]; then
-               dir="./"
-       fi
-       echo $dir
-}
-
-ipkg_file_part() {
-       echo $1 | sed 's/.*\///'
-}
-
-ipkg_protect_slashes() {
-       sed -e 's/\//\\\//g'
-}
-
-ipkg_download() {
-       local src="$1"
-       local dest="$2"
-
-       local src_file="`ipkg_file_part $src`"
-       local dest_dir="`ipkg_dir_part $dest`"
-       if [ -z "$dest_dir" ]; then
-               dest_dir="$IPKG_TMP"
-       fi
-
-       local dest_file="`ipkg_file_part $dest`"
-       if [ -z "$dest_file" ]; then
-               dest_file="$src_file"
-       fi
-
-       # Proxy support
-       local proxyuser=""
-       local proxypassword=""
-       local proxyoption=""
-               
-       if [ -n "$IPKG_PROXY_USERNAME" ]; then
-               proxyuser="--proxy-user=\"$IPKG_PROXY_USERNAME\""
-               proxypassword="--proxy-passwd=\"$IPKG_PROXY_PASSWORD\""
-       fi
-
-       if [ -n "$IPKG_PROXY_HTTP" -o -n "$IPKG_PROXY_FTP" ]; then
-               proxyoption="--proxy=on"
-       fi
-
-       echo "Downloading $src ..."
-       rm -f $IPKG_TMP/$src_file
-       case "$src" in
-       http://* | ftp://*)
-               if ! wget --passive-ftp $proxyoption $proxyuser $proxypassword -P $IPKG_TMP $src; then
-                       echo "ipkg_download: ERROR: Failed to retrieve $src, returning $err"
-                       return 1
-               fi
-               mv $IPKG_TMP/$src_file $dest_dir/$dest_file 2>/dev/null
-               ;;
-       file:/* )
-               ln -s `echo $src | sed 's/^file://'` $dest_dir/$dest_file 2>/dev/null
-               ;;
-       *)
-       echo "DEBUG: $src"
-               ;;
-       esac
-
-       echo "Done."
-       return 0
-}
-
-ipkg_update() {
-       if [ ! -e "$IPKG_LISTS_DIR" ]; then
-               mkdir -p $IPKG_LISTS_DIR
-       fi
-
-       local err=
-       for src_name in `ipkg_src_names`; do
-               local src="`ipkg_src_byname $src_name`"
-               if ! ipkg_download $src/Packages $IPKG_LISTS_DIR/$src_name; then
-                       echo "ipkg_update: Error downloading $src/Packages to $IPKG_LISTS_DIR/$src_name" >&2
-                       err=t
-               else
-                       echo "Updated list of available packages in $IPKG_LISTS_DIR/$src_name"
-               fi
-       done
-
-       [ -n "$err" ] && return 1
-
-       return 0
-}
-
-ipkg_list() {
-       for src in `ipkg_src_names`; do
-               if ipkg_require_list $src; then 
-# black magic...
-sed -ne "
-/^Package:/{
-s/^Package:[[:space:]]*\<\([a-z0-9.+-]*$1[a-z0-9.+-]*\).*/\1/
-h
-}
-/^Description:/{
-s/^Description:[[:space:]]*\(.*\)/\1/
-H
-g
-s/\\
-/ - /
-p
-}
-" $IPKG_LISTS_DIR/$src
-               fi
-       done
-}
-
-ipkg_extract_paragraph() {
-       local pkg="$1"
-       sed -ne "/Package:[[:space:]]*$pkg[[:space:]]*\$/,/^\$/p"
-}
-
-ipkg_extract_field() {
-       local field="$1"
-# blacker magic...
-       sed -ne "
-: TOP
-/^$field:/{
-p
-n
-b FIELD
-}
-d
-: FIELD
-/^$/b TOP
-/^[^[:space:]]/b TOP
-p
-n
-b FIELD
-"
-}
-
-ipkg_extract_value() {
-       sed -e "s/^[^:]*:[[:space:]]*//"
-}
-
-ipkg_require_list() {
-       [ $# -lt 1 ] && return 1
-       local src="$1"
-       if [ ! -f "$IPKG_LISTS_DIR/$src" ]; then
-               echo "ERROR: File not found: $IPKG_LISTS_DIR/$src" >&2
-               echo "       You probably want to run \`ipkg update'" >&2
-               return 1
-       fi
-       return 0
-}
-
-ipkg_info() {
-       for src in `ipkg_src_names`; do
-               if ipkg_require_list $src; then
-                       case $# in
-                       0)
-                               cat $IPKG_LISTS_DIR/$src
-                               ;;      
-                       1)
-                               ipkg_extract_paragraph $1 < $IPKG_LISTS_DIR/$src
-                               ;;
-                       *)
-                               ipkg_extract_paragraph $1 < $IPKG_LISTS_DIR/$src | ipkg_extract_field $2
-                               ;;
-                       esac
-               fi
-       done
-}
-
-ipkg_status_sd() {
-       [ $# -lt 1 ] && return 0
-       sd="$1"
-       shift
-       if [ -f $sd/status ]; then
-               case $# in
-               0)
-                       cat $sd/status
-                       ;;
-               1)
-                       ipkg_extract_paragraph $1 < $sd/status
-                       ;;
-               *)
-                       ipkg_extract_paragraph $1 < $sd/status | ipkg_extract_field $2
-                       ;;
-               esac
-       fi
-       return 0
-}
-
-ipkg_status_all() {
-       for sd in `ipkg_state_dirs`; do
-               ipkg_status_sd $sd $*
-       done
-}
-
-ipkg_status() {
-       if [ -n "$DEST_NAME" ]; then
-               ipkg_status_sd $IPKG_STATE_DIR $*
-       else
-               ipkg_status_all $*
-       fi
-}
-
-ipkg_status_matching_sd() {
-       local sd="$1"
-       local re="$2"
-       if [ -f $sd/status ]; then
-               sed -ne "
-: TOP
-/^Package:/{
-s/^Package:[[:space:]]*//
-s/[[:space:]]*$//
-h
-}
-/$re/{
-g
-p
-b NEXT
-}
-d
-: NEXT
-/^$/b TOP
-n
-b NEXT
-" < $sd/status
-       fi
-       return 0
-}
-
-ipkg_status_matching_all() {
-       for sd in `ipkg_state_dirs`; do
-               ipkg_status_matching_sd $sd $*
-       done
-}
-
-ipkg_status_matching() {
-       if [ -n "$DEST_NAME" ]; then
-               ipkg_status_matching_sd $IPKG_STATE_DIR $*
-       else
-               ipkg_status_matching_all $*
-       fi
-}
-
-ipkg_status_installed_sd() {
-       local sd="$1"
-       local pkg="$2"
-       ipkg_status_sd $sd $pkg Status | grep -q "Status: install ok installed"
-}
-
-ipkg_status_installed_all() {
-       local ret=1
-       for sd in `ipkg_state_dirs`; do
-               if `ipkg_status_installed_sd $sd $*`; then
-                       ret=0
-               fi
-       done
-       return $ret
-}
-
-ipkg_status_mentioned_sd() {
-       local sd="$1"
-       local pkg="$2"
-       [ -n "`ipkg_status_sd $sd $pkg Status`" ]
-}
-
-ipkg_files() {
-       local pkg="$1"
-       if [ -n "$DEST_NAME" ]; then
-               dests=$IPKG_ROOT
-       else
-               dests="`ipkg_dests_all`"
-       fi
-       for dest in $dests; do
-               if [ -f $dest/$IPKG_DIR_PREFIX/info/$pkg.list ]; then
-                       dest_sed="`echo $dest | ipkg_protect_slashes`"
-                       sed -e "s/^/$dest_sed/" < $dest/$IPKG_DIR_PREFIX/info/$pkg.list
-               fi
-       done
-}
-
-ipkg_search() {
-       local pattern="$1"
-
-       for dest_name in `ipkg_dest_names`; do
-               dest="`ipkg_dest_byname $dest_name`"
-               dest_sed="`echo $dest | ipkg_protect_slashes`"
-
-               set +o noglob
-               local list_files="`ls -1 $dest/$IPKG_DIR_PREFIX/info/*.list 2>/dev/null`"
-               set -o noglob
-               for file in $list_files; do
-                       if sed "s/^/$dest_sed/" $file | grep -q $pattern; then
-                               local pkg="`echo $file | sed "s/^.*\/\(.*\)\.list/\1/"`"
-                               [ "$dest_name" != `ipkg_dest_default_name` ] && pkg="$pkg ($dest_name)"
-                               sed "s/^/$dest_sed/" $file | grep $pattern | sed "s/^/$pkg: /"
-                       fi
-               done
-       done
-}
-
-ipkg_status_remove_sd() {
-       local sd="$1"
-       local pkg="$2"
-
-       if [ ! -f $sd/status ]; then
-               mkdir -p $sd
-               touch $sd/status
-       fi
-       sed -ne "/Package:[[:space:]]*$pkg[[:space:]]*\$/,/^\$/!p" < $sd/status > $sd/status.new
-       mv $sd/status.new $sd/status
-}
-
-ipkg_status_remove_all() {
-       for sd in `ipkg_state_dirs`; do
-               ipkg_status_remove_sd $sd $*
-       done
-}
-
-ipkg_status_remove() {
-       if [ -n "$DEST_NAME" ]; then
-               ipkg_status_remove_sd $IPKG_STATE_DIR $*
-       else
-               ipkg_status_remove_all $*
-       fi
-}
-
-ipkg_status_update_sd() {
-       local sd="$1"
-       local pkg="$2"
-
-       ipkg_status_remove_sd $sd $pkg
-       ipkg_extract_field "$IPKG_STATUS_FIELDS" >> $sd/status
-       echo "" >> $sd/status
-}
-
-ipkg_status_update() {
-       ipkg_status_update_sd $IPKG_STATE_DIR $*
-}
-
-ipkg_unsatisfied_dependences() {
-    local pkg=$1
-    local deps="`ipkg_get_depends $pkg`"
-    local remaining_deps=
-    for dep in $deps; do
-       local installed="`ipkg_get_installed $dep`"
-       if [ "$installed" != "installed" ] ; then
-           remaining_deps="$remaining_deps $dep"
-       fi
-    done
-    ## echo "ipkg_unsatisfied_dependences pkg=$pkg $remaining_deps" > /dev/console
-    echo $remaining_deps
-}
-
-ipkg_safe_pkg_name() {
-       local pkg=$1
-       local spkg="`echo pkg_$pkg | sed -e y/-+./___/`"
-       echo $spkg
-}
-
-ipkg_set_depends() {
-       local pkg=$1; shift 
-       local new_deps="$*"
-       pkg="`ipkg_safe_pkg_name $pkg`"
-       ## setvar ${pkg}_depends "$new_deps"
-       echo $new_deps > /tmp/ipkg/${pkg}.depends
-}
-
-ipkg_get_depends() {
-       local pkg=$1
-       pkg="`ipkg_safe_pkg_name $pkg`"
-       cat /tmp/ipkg/${pkg}.depends
-       ## eval "echo \$${pkg}_depends"
-}
-
-ipkg_set_installed() {
-       local pkg=$1
-       pkg="`ipkg_safe_pkg_name $pkg`"
-       echo installed > /tmp/ipkg/${pkg}.installed
-       ## setvar ${pkg}_installed "installed"
-}
-
-ipkg_set_uninstalled() {
-       local pkg=$1
-       pkg="`ipkg_safe_pkg_name $pkg`"
-       ### echo ipkg_set_uninstalled $pkg > /dev/console
-       echo uninstalled > /tmp/ipkg/${pkg}.installed
-       ## setvar ${pkg}_installed "uninstalled"
-}
-
-ipkg_get_installed() {
-       local pkg=$1
-       pkg="`ipkg_safe_pkg_name $pkg`"
-       if [ -f /tmp/ipkg/${pkg}.installed ]; then
-               cat /tmp/ipkg/${pkg}.installed
-       fi
-       ## eval "echo \$${pkg}_installed"
-}
-
-ipkg_depends() {
-       local new_pkgs="$*"
-       local all_deps=
-       local installed_pkgs="`ipkg_status_matching_all 'Status:.*[[:space:]]installed'`"
-       for pkg in $installed_pkgs; do
-           ipkg_set_installed $pkg
-       done
-       while [ -n "$new_pkgs" ]; do
-               all_deps="$all_deps $new_pkgs"
-               local new_deps=
-               for pkg in $new_pkgs; do
-                       if echo $pkg | grep -q '[^a-z0-9.+-]'; then
-                               echo "ipkg_depends: ERROR: Package name $pkg contains illegal characters (should be [a-z0-9.+-])" >&2
-                               return 1
-                       fi
-                       # TODO: Fix this. For now I am ignoring versions and alternations in dependencies.
-                       new_deps="$new_deps "`ipkg_info $pkg '\(Pre-\)\?Depends' | ipkg_extract_value | sed -e 's/([^)]*)//g
-s/\(|[[:space:]]*[a-z0-9.+-]\+[[:space:]]*\)\+//g
-s/,/ /g
-s/ \+/ /g'`
-                       ipkg_set_depends $pkg $new_deps
-               done
-
-               new_deps=`echo $new_deps | sed -e 's/[[:space:]]\+/\\
-/g' | sort | uniq`
-
-               local maybe_new_pkgs=
-               for pkg in $new_deps; do
-                       if ! echo $installed_pkgs | grep -q "\<$pkg\>"; then
-                               maybe_new_pkgs="$maybe_new_pkgs $pkg"
-                       fi
-               done
-
-               new_pkgs=
-               for pkg in $maybe_new_pkgs; do
-                       if ! echo $all_deps | grep -q "\<$pkg\>"; then
-                               if [ -z "`ipkg_info $pkg`" ]; then
-                                       echo "ipkg_depends: Warning: $pkg mentioned in dependency but no package found in $IPKG_LISTS_DIR" >&2
-                                       ipkg_set_installed $pkg
-                               else
-                                       new_pkgs="$new_pkgs $pkg"
-                                       ipkg_set_uninstalled $pkg
-                               fi
-                       else
-                               ipkg_set_uninstalled $pkg
-                       fi
-               done
-       done
-
-       echo $all_deps
-}
-
-ipkg_get_install_dest() {
-       local dest="$1"
-       shift
-       local sd=$dest/$IPKG_DIR_PREFIX
-       local info_dir=$sd/info
-
-        local requested_pkgs="$*"
-       local pkgs="`ipkg_depends $*`"
-
-       mkdir -p $info_dir
-       for pkg in $pkgs; do
-               if ! ipkg_status_mentioned_sd $sd $pkg; then
-                       echo "Package: $pkg
-Status: install ok not-installed" | ipkg_status_update_sd $sd $pkg
-               fi
-       done
-        ## mark the packages that we were directly requested to install as uninstalled
-        for pkg in $requested_pkgs; do ipkg_set_uninstalled $pkg; done
-
-       local new_pkgs=
-       local pkgs_installed=0
-       while [ -n "pkgs" ]; do
-               curcheck=0
-               ## echo "pkgs to install: {$pkgs}" > /dev/console
-               for pkg in $pkgs; do
-                       curcheck="`expr $curcheck + 1`"
-                       local is_installed="`ipkg_get_installed $pkg`"
-                       if [ "$is_installed" = "installed" ]; then
-                               echo "$pkg is installed" > /dev/console
-                               continue
-                       fi
-
-                       local remaining_deps="`ipkg_unsatisfied_dependences $pkg`"
-                       if [ -n "$remaining_deps" ]; then
-                               new_pkgs="$new_pkgs $pkg"
-                               ### echo "Dependences not satisfied for $pkg: $remaining_deps"
-                               if [ $curcheck -ne `echo  $pkgs|wc -w` ]; then
-                                       continue
-                               fi
-                       fi
-
-                       local filename=
-                       for src in `ipkg_src_names`; do
-                               if ipkg_require_list $src; then
-                                       filename="`ipkg_extract_paragraph $pkg < $IPKG_LISTS_DIR/$src | ipkg_extract_field Filename | ipkg_extract_value`"
-                                       [ -n "$filename" ] && break
-                               fi
-                       done
-
-                       if [ -z "$filename" ]; then
-                               echo "ipkg_get_install: ERROR: Cannot find package $pkg in $IPKG_LISTS_DIR"
-                               echo "ipkg_get_install:        Check the spelling and maybe run \`ipkg update'."
-                               ipkg_status_remove_sd $sd $pkg
-                               return 1;
-                       fi
-
-                       [ -e "$IPKG_TMP" ] || mkdir -p $IPKG_TMP
-
-                       echo ""
-                       local tmp_pkg_file="$IPKG_TMP/"`ipkg_file_part $filename`
-                       if ! ipkg_download `ipkg_src_byname $src`/$filename $tmp_pkg_file; then
-                               echo "ipkg_get_install: Perhaps you need to run \`ipkg update'?"
-                               return 1
-                       fi
-
-                       if ! ipkg_install_file_dest $dest $tmp_pkg_file; then
-                               echo "ipkg_get_install: ERROR: Failed to install $tmp_pkg_file"
-                               echo "ipkg_get_install: I'll leave it there for you to try a manual installation"
-                               return 1
-                       fi
-
-                       ipkg_set_installed $pkg
-                       pkgs_installed="`expr $pkgs_installed + 1`"
-                       rm $tmp_pkg_file
-               done
-               ### echo "Installed $pkgs_installed package(s) this round"
-               if [ $pkgs_installed -eq 0 ]; then
-                       if [ -z "$new_pkgs" ]; then
-                           break
-                       fi
-               fi
-               pkgs_installed=0
-               pkgs="$new_pkgs"
-               new_pkgs=
-               curcheck=0
-        done
-}
-
-ipkg_get_install() {
-       ipkg_get_install_dest $IPKG_ROOT $*
-}
-
-ipkg_install_file_dest() {
-       local dest="$1"
-       local filename="$2"
-       local sd=$dest/$IPKG_DIR_PREFIX
-       local info_dir=$sd/info
-
-       if [ ! -f "$filename" ]; then
-               echo "ipkg_install_file: ERROR: File $filename not found"
-               return 1
-       fi
-
-       local pkg="`ipkg_file_part $filename | sed 's/\([a-z0-9.+-]\+\)_.*/\1/'`"
-       local ext="`echo $filename | sed 's/.*\.//'`"
-       local pkg_extract_stdout
-       if [ "$ext" = "ipk" ]; then
-               pkg_extract_stdout="tar -xzOf"
-       elif [ "$ext" = "deb" ]; then
-               pkg_extract_stdout="ar p"
-       else
-               echo "ipkg_install_file: ERROR: File $filename has unknown extension $ext (not .ipk or .deb)"
-               return 1
-       fi
-
-       # Check dependencies
-       local depends="`ipkg_depends $pkg | sed -e "s/\<$pkg\>//"`"
-
-       # Don't worry about deps that are scheduled for installation
-       local missing_deps=
-       for dep in $depends; do
-               if ! ipkg_status_all $dep | grep -q 'Status:[[:space:]]install'; then
-                       missing_deps="$missing_deps $dep"
-               fi
-       done
-
-       if [ ! -z "$missing_deps" ]; then
-               if [ -n "$FORCE_DEPENDS" ]; then
-                       echo "ipkg_install_file: Warning: $pkg depends on the following uninstalled programs: $missing_deps"
-               else
-                       echo "ipkg_install_file: ERROR: $pkg depends on the following uninstalled programs:
-       $missing_deps"
-                       echo "ipkg_install_file: You may want to use \`ipkg install' to install these."
-                       return 1
-               fi
-       fi
-
-       mkdir -p $IPKG_TMP/$pkg/control
-       mkdir -p $IPKG_TMP/$pkg/data
-       mkdir -p $info_dir
-
-       if ! $pkg_extract_stdout $filename ./control.tar.gz | (cd $IPKG_TMP/$pkg/control; tar -xzf - ) ; then
-               echo "ipkg_install_file: ERROR unpacking control.tar.gz from $filename"
-               return 1
-       fi
-
-       if [ -n "$IPKG_OFFLINE_ROOT" ]; then
-               if grep -q '^InstallsOffline:[[:space:]]*no' $IPKG_TMP/$pkg/control/control; then
-                       echo "*** Warning: Package $pkg may not be installed in offline mode"
-                       echo "*** Warning: Scheduling $filename for pending installation (installing into $IPKG_PENDING_DIR)"
-                       echo "Package: $pkg
-Status: install ok pending" | ipkg_status_update_sd $sd $pkg
-                       mkdir -p $IPKG_PENDING_DIR
-                       cp $filename $IPKG_PENDING_DIR
-                       rm -r $IPKG_TMP/$pkg/control
-                       rm -r $IPKG_TMP/$pkg/data
-                       rmdir $IPKG_TMP/$pkg
-                       return 0
-               fi
-       fi
-
-
-       echo -n "Unpacking $pkg..."
-       set +o noglob
-       for file in $IPKG_TMP/$pkg/control/*; do
-               local base_file="`ipkg_file_part $file`"
-               mv $file $info_dir/$pkg.$base_file
-       done
-       set -o noglob
-       rm -r $IPKG_TMP/$pkg/control
-
-       if ! $pkg_extract_stdout $filename ./data.tar.gz | (cd $IPKG_TMP/$pkg/data; tar -xzf - ) ; then
-               echo "ipkg_install_file: ERROR unpacking data.tar.gz from $filename"
-               return 1
-       fi
-       echo "Done."
-
-       echo -n "Configuring $pkg..."
-       export PKG_ROOT=$dest
-       if [ -x "$info_dir/$pkg.preinst" ]; then
-               if ! $info_dir/$pkg.preinst install; then
-                       echo "$info_dir/$pkg.preinst failed. Aborting installation of $pkg"
-                       rm -rf $IPKG_TMP/$pkg/data
-                       rmdir $IPKG_TMP/$pkg
-                       return 1
-               fi
-       fi
-
-       local old_conffiles="`ipkg_status_sd $sd $pkg Conffiles | ipkg_extract_value`"
-       local new_conffiles=
-       if [ -f "$info_dir/$pkg.conffiles" ]; then
-               for conffile in `cat $info_dir/$pkg.conffiles`; do
-                       if [ -f "$dest/$conffile" ] && ! echo " $old_conffiles " | grep -q " $conffile "`md5sum $dest/$conffile | sed 's/ .*//'`; then
-                               local use_maintainers_conffile=
-                               if [ -z "$FORCE_DEFAULTS" ]; then
-                                       while true; do
-                                               echo -n "Configuration file \`$conffile'
- ==> File on system created by you or by a script.
- ==> File also in package provided by package maintainer.
-   What would you like to do about it ?  Your options are:
-    Y or I  : install the package maintainer's version
-    N or O  : keep your currently-installed version
-      D     : show the differences between the versions (if diff is installed)
- The default action is to keep your current version.
-*** `ipkg_file_part $conffile` (Y/I/N/O/D) [default=N] ? "
-                                               read response
-                                               case "$response" in
-                                               [YyIi] | [Yy][Ee][Ss])
-                                                       use_maintainers_conffile=t
-                                                       break
-                                               ;;
-                                               [Dd])
-                                                       echo "
-diff -u $dest/$conffile $IPKG_TMP/$pkg/data/$conffile"
-                                                       diff -u $dest/$conffile $IPKG_TMP/$pkg/data/$conffile || true
-                                                       echo "[Press ENTER to continue]"
-                                                       read junk
-                                               ;;
-                                               *)
-                                                       break
-                                               ;;
-                                               esac
-                                       done
-                               fi
-                               if [ -n "$use_maintainers_conffile" ]; then
-                                       local md5sum="`md5sum $IPKG_TMP/$pkg/data/$conffile | sed 's/ .*//'`"
-                                       new_conffiles="$new_conffiles $conffile $md5sum"
-                               else
-                                       new_conffiles="$new_conffiles $conffile <custom>"
-                                       rm $IPKG_TMP/$pkg/data/$conffile
-                               fi
-                       else
-                               md5sum="`md5sum $IPKG_TMP/$pkg/data/$conffile | sed 's/ .*//'`"
-                               new_conffiles="$new_conffiles $conffile $md5sum"
-                       fi
-               done
-       fi
-
-       local owd="`pwd`"
-       (cd $IPKG_TMP/$pkg/data/; tar cf - . | (cd $owd; cd $dest; tar xf -))
-       rm -rf $IPKG_TMP/$pkg/data
-       rmdir $IPKG_TMP/$pkg
-       rm -f $info_dir/$pkg.list
-       $pkg_extract_stdout $filename ./data.tar.gz | tar tzf - | sed -e 's/^\.//' > $info_dir/$pkg.list
-
-       if [ -x "$info_dir/$pkg.postinst" ]; then
-               $info_dir/$pkg.postinst configure
-       fi
-
-       if [ -n "$new_conffiles" ]; then
-               new_conffiles='Conffiles: '`echo $new_conffiles | ipkg_protect_slashes`
-       fi
-       local sed_safe_offline_root="`echo ${IPKG_OFFLINE_ROOT} | ipkg_protect_slashes`"
-       local sed_safe_root="`echo $dest | sed -e "s/^${sed_safe_offline_root}//" | ipkg_protect_slashes`"
-       sed -e "s/\(Package:.*\)/\1\\
-Status: install ok installed\\
-Root: ${sed_safe_root}\\
-${new_conffiles}/" $info_dir/$pkg.control | ipkg_status_update_sd $sd $pkg
-
-       rm -f $info_dir/$pkg.control
-       rm -f $info_dir/$pkg.conffiles
-       rm -f $info_dir/$pkg.preinst
-       rm -f $info_dir/$pkg.postinst
-
-       echo "Done."
-}
-
-ipkg_install_file() {
-       ipkg_install_file_dest $IPKG_ROOT $*
-}
-
-ipkg_install() {
-
-       while [ $# -gt 0 ]; do
-               local pkg="$1"
-               shift
-       
-               case "$pkg" in
-               http://* | ftp://*)
-                       local tmp_pkg_file="$IPKG_TMP/"`ipkg_file_part $pkg`
-                       if ipkg_download $pkg $tmp_pkg_file; then
-                               ipkg_install_file $tmp_pkg_file
-                               rm $tmp_pkg_file
-                       fi
-                       ;;
-               file:/*.ipk  | file://*.deb)
-                               local ipkg_filename="`echo $pkg|sed 's/^file://'`"
-                               ipkg_install_file $ipkg_filename
-                       ;;
-               *.ipk  | *.deb)
-                       if [ -f "$pkg" ]; then
-                               ipkg_install_file $pkg
-                       else
-                               echo "File not found $pkg" >&2
-                       fi
-                       ;;
-               *)
-                       ipkg_get_install $pkg || true
-                       ;;
-               esac
-       done
-}
-
-ipkg_install_pending() {
-       [ -n "$IPKG_OFFLINE_ROOT" ] && return 0
-
-       if [ -d "$IPKG_PENDING_DIR" ]; then
-               set +o noglob
-               local pending="`ls -1d $IPKG_PENDING_DIR/*.ipk 2> /dev/null`" || true
-               set -o noglob
-               if [ -n "$pending" ]; then
-                       echo "The following packages in $IPKG_PENDING_DIR will now be installed:"
-                       echo $pending
-                       for filename in $pending; do
-                               if ipkg_install_file $filename; then
-                                       rm $filename
-                               fi
-                       done
-               fi
-       fi
-       return 0
-}
-
-ipkg_install_wanted() {
-       local wanted="`ipkg_status_matching 'Status:[[:space:]]*install.*not-installed'`"
-
-       if [ -n "$wanted" ]; then
-               echo "The following package were previously requested but have not been installed:"
-               echo $wanted
-
-               if [ -n "$FORCE_DEFAULTS" ]; then
-                       echo "Installing them now."
-               else
-                       echo -n "Install them now [Y/n] ? "
-                       read response
-                       case "$response" in
-                       [Nn] | [Nn][Oo])
-                               return 0
-                               ;;
-                       esac
-               fi
-
-               ipkg_install $wanted
-       fi
-
-       return 0
-}
-
-ipkg_upgrade_pkg() {
-       local pkg="$1"
-       local avail_ver="`ipkg_info $pkg Version | ipkg_extract_value | head -1`"
-
-       is_installed=
-       for dest_name in `ipkg_dest_names`; do
-               local dest="`ipkg_dest_byname $dest_name`"
-               local sd=$dest/$IPKG_DIR_PREFIX
-               local inst_ver="`ipkg_status_sd $sd $pkg Version | ipkg_extract_value`"
-               if [ -n "$inst_ver" ]; then
-                       is_installed=t
-
-                       if [ -z "$avail_ver" ]; then
-                               echo "Assuming locally installed package $pkg ($inst_ver) is up to date"
-                               return 0
-                       fi
-
-                       if [ "$avail_ver" = "$inst_ver" ]; then 
-                               echo "Package $pkg ($inst_ver) installed in $dest_name is up to date"
-                       elif ipkg_is_upgrade "$avail_ver" "$inst_ver"; then
-                               echo "Upgrading $pkg ($dest_name) from $inst_ver to $avail_ver"
-                               ipkg_get_install_dest $dest $pkg
-                       else
-                               echo "Not downgrading package $pkg from $inst_ver to $avail_ver"
-                       fi
-               fi
-       done
-
-       if [ -z "$is_installed" ]; then
-               echo "Package $pkg does not appear to be installed"
-               return 0
-       fi
-
-}
-
-ipkg_upgrade() {
-       if [ $# -lt 1 ]; then
-               local pkgs="`ipkg_status_matching 'Status:.*[[:space:]]installed'`"
-       else
-               pkgs="$*"
-       fi
-       
-       for pkg in $pkgs; do
-               ipkg_upgrade_pkg $pkg
-       done
-}
-
-ipkg_remove_pkg_dest() {
-       local dest="$1"
-       local pkg="$2"
-       local sd=$dest/$IPKG_DIR_PREFIX
-       local info_dir=$sd/info
-
-       if ! ipkg_status_installed_sd $sd $pkg; then
-               echo "ipkg_remove: Package $pkg does not appear to be installed in $dest"
-               if ipkg_status_mentioned_sd $sd $pkg; then
-                       echo "Purging mention of $pkg from the ipkg database"
-                       ipkg_status_remove_sd $sd $pkg
-               fi
-               return 1
-       fi
-
-       echo "ipkg_remove: Removing $pkg... "
-
-       local files="`cat $info_dir/$pkg.list`"
-
-       export PKG_ROOT=$dest
-       if [ -x "$info_dir/$pkg.prerm" ]; then
-               $info_dir/$pkg.prerm remove
-       fi
-
-       local conffiles="`ipkg_status_sd $sd $pkg Conffiles | ipkg_extract_value`"
-
-       local dirs_to_remove=
-       for file in $files; do
-               if [ -d "$dest/$file" ]; then
-                       dirs_to_remove="$dirs_to_remove $dest/$file"
-               else
-                       if echo " $conffiles " | grep -q " $file "; then
-                               if echo " $conffiles " | grep -q " $file "`md5sum $dest/$file | sed 's/ .*//'`; then
-                                       rm -f $dest/$file
-                               fi
-                       else
-                               rm -f $dest/$file
-                       fi
-               fi
-       done
-
-       local removed_a_dir=t
-       while [ -n "$removed_a_dir" ]; do
-               removed_a_dir=
-               local new_dirs_to_remove=
-               for dir in $dirs_to_remove; do
-                       if rmdir $dir >/dev/null 2>&1; then
-                               removed_a_dir=t
-                       else
-                               new_dirs_to_remove="$new_dirs_to_remove $dir"
-                       fi
-               done
-               dirs_to_remove="$new_dirs_to_remove"
-       done
-
-       if [ -n "$dirs_to_remove" ]; then
-               echo "ipkg_remove: Warning: Not removing the following directories since they are not empty:" >&2
-               echo "$dirs_to_remove" | sed -e 's/\/[/]\+/\//g' >&2
-       fi
-
-       if [ -x "$info_dir/$pkg.postrm" ]; then
-               $info_dir/$pkg.postrm remove
-       fi
-
-       ipkg_status_remove_sd $sd $pkg
-       set +o noglob
-       rm -f $info_dir/$pkg.*
-       set -o noglob
-
-       echo "Done."
-}
-
-ipkg_remove_pkg() {
-       local pkg="$1"
-       for dest in `ipkg_dests_all`; do
-               local sd=$dest/$IPKG_DIR_PREFIX
-               if ipkg_status_mentioned_sd $sd $pkg; then
-                       ipkg_remove_pkg_dest $dest $pkg
-               fi
-       done
-}
-
-ipkg_remove() {
-       while [ $# -gt 0 ]; do
-               local pkg="$1"
-               shift
-               if [ -n "$DEST_NAME" ]; then
-                       ipkg_remove_pkg_dest $IPKG_ROOT $pkg
-               else
-                       ipkg_remove_pkg $pkg
-               fi
-       done
-}
-
-###########
-# ipkg main
-###########
-
-# Parse options
-while [ $# -gt 0 ]; do
-       arg="$1"
-       case $arg in
-       -d | -dest)
-               [ $# -gt 1 ] || ipkg_usage "option $arg requires an argument"
-               DEST_NAME="$2"
-               shift
-               ;;
-       -o | -offline)
-               [ $# -gt 1 ] || ipkg_usage "option $arg requires an argument"
-               IPKG_OFFLINE_ROOT="$2"
-               shift
-               ;;
-       -force-depends)
-               FORCE_DEPENDS=t
-               ;;
-       -force-defaults)
-               FORCE_DEFAULTS=t
-               ;;
-       -*)
-               ipkg_usage "unknown option $arg"
-               ;;
-       *)
-               break
-               ;;
-       esac
-       shift
-done
-
-[ $# -lt 1 ] && ipkg_usage "ipkg must have one sub-command argument"
-cmd="$1"
-shift
-
-ipkg_load_configuration
-mkdir -p /tmp/ipkg
-
-case "$cmd" in
-update|upgrade|list|info|status|install_pending)
-       ;;
-install|depends|remove|files|search)
-       [ $# -lt 1 ] && ipkg_usage "ERROR: the \`\`$cmd'' command requires an argument"
-       ;;
-*)
-       echo "ERROR: unknown sub-command \`$cmd'"
-       ipkg_usage
-       ;;
-esac
-
-# Only install pending if we have an interactive sub-command
-case "$cmd" in
-upgrade|install)
-       ipkg_install_pending
-       ipkg_install_wanted
-       ;;
-esac
-
-ipkg_$cmd $*
-for a in `ls $IPKG_TMP`; do
-       rm -rf $IPKG_TMP/$a
-done
diff --git a/openwrt/target/default/target_skeleton/bin/login b/openwrt/target/default/target_skeleton/bin/login
deleted file mode 100755 (executable)
index bb065e5..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-. /etc/sysconf 2>&-
-
-[ "$FAILSAFE" != "true" ] &&
-[ "$BR2_SYSCONF_TELNET_FAILSAFE_ONLY" = "y" ] &&
-{
-  grep '^root:[^!]' /etc/passwd >&- 2>&- &&
-  {
-    echo "Login failed."
-    exit 0
-  } || {
-cat << EOF
- === IMPORTANT ============================
-  Use 'passwd' to set your login password
-  this will disable telnet and enable SSH
- ------------------------------------------
-EOF
-  }
-}
-exec /bin/ash --login
diff --git a/openwrt/target/default/target_skeleton/etc/banner b/openwrt/target/default/target_skeleton/etc/banner
deleted file mode 100644 (file)
index 2b2b2c0..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-  _______                     ________        __
- |       |.-----.-----.-----.|  |  |  |.----.|  |_
- |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
- |_______||   __|_____|__|__||________||__|  |____|
-          |__| W I R E L E S S   F R E E D O M
-          
diff --git a/openwrt/target/default/target_skeleton/etc/dnsmasq.conf b/openwrt/target/default/target_skeleton/etc/dnsmasq.conf
deleted file mode 100644 (file)
index 4ef9680..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# filter what we send upstream
-domain-needed
-bogus-priv
-filterwin2k
-localise-queries
-
-# allow /etc/hosts and dhcp lookups via *.lan
-local=/lan/
-domain=lan
-
-# no dhcp / dns queries from the wan
-except-interface=vlan1
-
-# enable dhcp (start,end,netmask,leasetime)
-dhcp-authoritative
-#dhcp-range=192.168.1.100,192.168.1.250,255.255.255.0,12h
-#dhcp-leasefile=/tmp/dhcp.leases
-
-# use /etc/ethers for static hosts; same format as --dhcp-host
-# <hwaddr> [<hostname>] <ipaddr>
-read-ethers
-
-# other useful options:
-# default route(s): dhcp-option=3,192.168.1.1,192.168.1.2
-#    dns server(s): dhcp-option=6,192.168.1.1,192.168.1.2
diff --git a/openwrt/target/default/target_skeleton/etc/functions.sh b/openwrt/target/default/target_skeleton/etc/functions.sh
deleted file mode 100755 (executable)
index 60d6231..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/bin/ash
-
-alias debug=${DEBUG:-:}
-
-# allow env to override nvram
-nvram () {
-  case $1 in
-    get) eval "echo \${NVRAM_$2:-\$(command nvram get $2)}";;
-    *) command nvram $*;;
-  esac
-}
-. /etc/nvram.overrides
-
-# valid interface?
-if_valid () (
-  ifconfig "$1" >&- 2>&- ||
-  [ "${1%%[0-9]}" = "br" ] ||
-  {
-    [ "${1%%[0-9]}" = "vlan" ] && ( 
-      i=${1#vlan}
-      hwname=$(nvram get vlan${i}hwname)
-      hwaddr=$(nvram get ${hwname}macaddr)
-      [ -z "$hwaddr" ] && return 1
-
-      vif=$(ifconfig -a | awk '/^eth.*'$hwaddr'/ {print $1; exit}' IGNORECASE=1)
-      debug "# vlan$i => $vif"
-
-      $DEBUG ifconfig $vif up
-      $DEBUG vconfig add $vif $i 2>&-
-    )
-  } ||
-  { debug "# missing interface '$1' ignored"; false; }
-)
-
-bitcount () {
-  local c=$1
-  echo $((
-  c=((c>> 1)&0x55555555)+(c&0x55555555),
-  c=((c>> 2)&0x33333333)+(c&0x33333333),
-  c=((c>> 4)&0x0f0f0f0f)+(c&0x0f0f0f0f),
-  c=((c>> 8)&0x00ff00ff)+(c&0x00ff00ff),
-  c=((c>>16)&0x0000ffff)+(c&0x0000ffff)
-  ))
-}
-
-valid_netmask () {
-  return $((-($1)&~$1))
-}
-
-ip2int () (
-  set $(echo $1 | tr '\.' ' ')
-  echo $(($1<<24|$2<<16|$3<<8|$4))
-)
-
-int2ip () {
-  echo $(($1>>24&255)).$(($1>>16&255)).$(($1>>8&255)).$(($1&255))
-}
diff --git a/openwrt/target/default/target_skeleton/etc/group b/openwrt/target/default/target_skeleton/etc/group
deleted file mode 100644 (file)
index c4e77f3..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-root:x:0:
-nogroup:x:65534:
diff --git a/openwrt/target/default/target_skeleton/etc/hosts b/openwrt/target/default/target_skeleton/etc/hosts
deleted file mode 100644 (file)
index ce138ec..0000000
+++ /dev/null
@@ -1 +0,0 @@
-127.0.0.1 localhost OpenWrt
diff --git a/openwrt/target/default/target_skeleton/etc/init.d/S10boot b/openwrt/target/default/target_skeleton/etc/init.d/S10boot
deleted file mode 100755 (executable)
index f45eafb..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/sh
-echo "S" > /proc/jffs2_bbc
-
-mkdir -p /var/run
-mkdir -p /var/log
-touch /var/log/wtmp
-touch /var/log/lastlog
-
-[ "$(nvram get il0macaddr)" = "00:90:4c:5f:00:2a" ] && {
-  # if default wifi mac, set two higher than the lan mac
-  nvram set il0macaddr=$(nvram get et0macaddr|
-  awk '{OFS=FS=":";for(x=7,y=2;--x;){$x=sprintf("%02x",(y+="0x"$x)%256);y/=256}print}')
-}
-
-# set up the vlan*ports variables for the asus wl-500g deluxe
-# if they don't already exist 
-[ "$(nvram get boardtype)" = "bcm95365r" ] && \
-[ "$(nvram get boardnum)" = "45" ] && {
-  [ -z "$(nvram get vlan0ports)" ] && \
-  [ -z "$(nvram get vlan1ports)" ] && {
-    nvram set vlan0ports="1 2 3 4 5*"
-    nvram set vlan1ports="0 5"
-  }
-}
-
-cat /etc/modules /etc/modules.d/*|sed 's/^[^#]/insmod &/' 2>&-|ash
-
-ifconfig lo 127.0.0.1 up
-ifconfig eth0 promisc
-
-HOSTNAME=$(nvram get wan_hostname)
-HOSTNAME=${HOSTNAME%%.*}
-echo ${HOSTNAME:=OpenWrt}>/proc/sys/kernel/hostname
-
-vconfig set_name_type VLAN_PLUS_VID_NO_PAD
-
-# automagically run firstboot
-[ -z "$FAILSAFE" ] && {
-       { mount|grep "on / type jffs2" 1>&-; } || firstboot
-}
diff --git a/openwrt/target/default/target_skeleton/etc/init.d/S40network b/openwrt/target/default/target_skeleton/etc/init.d/S40network
deleted file mode 100755 (executable)
index d8b4e41..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-case "$1" in
-  start|restart)
-    ifup lan
-    ifup wan
-    ifup wifi
-    wifi up
-
-    for route in $(nvram get static_route); do {
-      eval "set $(echo $route | sed 's/:/ /g')"
-      $DEBUG route add -net $1 netmask $2 gw $3 metric $4 dev $5
-    } done
-    ;;
-esac
diff --git a/openwrt/target/default/target_skeleton/etc/init.d/S45firewall b/openwrt/target/default/target_skeleton/etc/init.d/S45firewall
deleted file mode 100755 (executable)
index 8f9b940..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/bin/sh
-. /etc/functions.sh
-WAN=$(nvram get wan_ifname)
-LAN=$(nvram get lan_ifname)
-
-## CLEAR TABLES
-for T in filter nat mangle; do
-  iptables -t $T -F
-  iptables -t $T -X
-done
-
-iptables -N input_rule
-iptables -N output_rule
-iptables -N forwarding_rule
-
-iptables -t nat -N prerouting_rule
-iptables -t nat -N postrouting_rule
-
-### INPUT
-###  (connections with the router as destination)
-
-  # base case
-  iptables -P INPUT DROP
-  iptables -A INPUT -m state --state INVALID -j DROP
-  iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-  iptables -A INPUT -p tcp --syn --tcp-option \! 2 -j  DROP
-
-  # allow
-  iptables -A INPUT -i \! $WAN -j ACCEPT       # allow from lan/wifi interfaces 
-  iptables -A INPUT -p icmp    -j ACCEPT       # allow ICMP
-  iptables -A INPUT -p gre     -j ACCEPT       # allow GRE
-  #
-  # insert accept rule or to jump to new accept-check table here
-  #
-  iptables -A INPUT -j input_rule
-
-  # reject (what to do with anything not allowed earlier)
-  iptables -A INPUT -p tcp -j REJECT --reject-with tcp-reset
-  iptables -A INPUT -j REJECT --reject-with icmp-port-unreachable
-
-### OUTPUT
-### (connections with the router as source)
-
-  # base case
-  iptables -P OUTPUT DROP
-  iptables -A OUTPUT -m state --state INVALID -j DROP
-  iptables -A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-
-  # allow
-  iptables -A OUTPUT -j ACCEPT         #allow everything out
-  #
-  # insert accept rule or to jump to new accept-check table here
-  #
-  iptables -A OUTPUT -j output_rule
-
-  # reject (what to do with anything not allowed earlier)
-  iptables -A OUTPUT -p tcp -j REJECT --reject-with tcp-reset
-  iptables -A OUTPUT -j REJECT --reject-with icmp-port-unreachable
-
-### FORWARDING
-### (connections routed through the router)
-
-  # base case
-  iptables -P FORWARD DROP 
-  iptables -A FORWARD -m state --state INVALID -j DROP
-  iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
-  iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
-
-  # allow
-  iptables -A FORWARD -i br0 -o br0 -j ACCEPT
-  iptables -A FORWARD -i $LAN -o $WAN -j ACCEPT
-  #
-  # insert accept rule or to jump to new accept-check table here
-  #
-  iptables -A FORWARD -j forwarding_rule
-
-  # reject (what to do with anything not allowed earlier)
-  # uses the default -P DROP
-
-### MASQ
-  iptables -t nat -A PREROUTING -j prerouting_rule
-  iptables -t nat -A POSTROUTING -j postrouting_rule
-  iptables -t nat -A POSTROUTING -o $WAN -j MASQUERADE
-
-## USER RULES
-. /etc/firewall.user
diff --git a/openwrt/target/default/target_skeleton/etc/init.d/S50dnsmasq b/openwrt/target/default/target_skeleton/etc/init.d/S50dnsmasq
deleted file mode 100755 (executable)
index 6a5af0f..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-. /etc/functions.sh
-
-# interface to use for DHCP
-iface=lan
-
-ifname=$(nvram get ${iface}_ifname)
-ipaddr=$(nvram get ${iface}_ipaddr)
-netmask=$(nvram get ${iface}_netmask)
-
-(
-       # check for existing DHCP server
-       udhcpc -n -q -R -s /dev/zero -i $ifname >&- || {
-
-         ipaddr=$(ip2int $ipaddr)
-         netmask=$(ip2int ${netmask:-255.255.255.0})
-         network=$((ipaddr&netmask))
-         
-         start=$(nvram get dhcp_start)
-         start=$((network+${start:-100}))
-         end=$(nvram get dhcp_num)
-         end=$((start+${end:-150}))
-         
-         args="-l /tmp/dhcp.leases -K -F $(int2ip $start),$(int2ip $end),$(int2ip $netmask),12h"
-       }
-       dnsmasq ${args}
-) &
diff --git a/openwrt/target/default/target_skeleton/etc/init.d/S50httpd b/openwrt/target/default/target_skeleton/etc/init.d/S50httpd
deleted file mode 100755 (executable)
index 9cf551e..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-httpd -p 80 -h /www -r WRT54G Router
diff --git a/openwrt/target/default/target_skeleton/etc/init.d/S50telnet b/openwrt/target/default/target_skeleton/etc/init.d/S50telnet
deleted file mode 100755 (executable)
index 599c354..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-telnetd -l /bin/login
diff --git a/openwrt/target/default/target_skeleton/etc/init.d/S99done b/openwrt/target/default/target_skeleton/etc/init.d/S99done
deleted file mode 100755 (executable)
index ce60337..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-# set leds to normal state
-echo "0x00" > /proc/sys/diag
-sysctl -p >&-
diff --git a/openwrt/target/default/target_skeleton/etc/init.d/rcS b/openwrt/target/default/target_skeleton/etc/init.d/rcS
deleted file mode 100755 (executable)
index e6daddc..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-syslogd -C 16
-klogd
-${FAILSAFE:+telnetd -l /bin/login; ifup lan; exit}
-
-for i in /etc/init.d/S*; do
-  $i start 2>&1
-done | logger -s -p 6 -t '' &
diff --git a/openwrt/target/default/target_skeleton/etc/inittab b/openwrt/target/default/target_skeleton/etc/inittab
deleted file mode 100644 (file)
index aab2df9..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-::sysinit:/etc/init.d/rcS
-::shutdown:/sbin/halt
-tts/0::askfirst:/bin/ash --login
diff --git a/openwrt/target/default/target_skeleton/etc/ipkg.conf b/openwrt/target/default/target_skeleton/etc/ipkg.conf
deleted file mode 100644 (file)
index 3867213..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-src experimental http://openwrt.org/downloads/experimental/bin/packages
-dest root /
-dest ram /tmp
diff --git a/openwrt/target/default/target_skeleton/etc/modules b/openwrt/target/default/target_skeleton/etc/modules
deleted file mode 100644 (file)
index e717eae..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-et
-wl
diff --git a/openwrt/target/default/target_skeleton/etc/nvram.overrides b/openwrt/target/default/target_skeleton/etc/nvram.overrides
deleted file mode 100644 (file)
index f58f7ed..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-# NVRAM overrides
-#
-# This file handles the NVRAM quirks of various hardware.
-# THIS FILE IS NOT A REPLACEMENT FOR NVRAM
-
-# Load sysconf defaults
-[ -f /etc/sysconf ] && . /etc/sysconf
-
-# linksys bug; remove when not using static configuration for lan
-NVRAM_lan_proto="static"
-
-remap () {
-  for type in lan wifi wan pppoe
-  do
-    for s in '' s
-    do
-      eval NVRAM_${type}_ifname$s=\"$(nvram get ${type}_ifname$s|sed s/$1/$2/g)\" 
-    done
-  done
-}
-
-# hacks for wrt54g 1.x hardware
-[ "$(nvram get boardnum)"  = "42" ] && \
-[ "$(nvram get boardtype)" = "bcm94710dev" ] && {
-  debug "### wrt54g 1.x hack ###"
-  NVRAM_vlan1hwname="et0"
-  NVRAM_vlan2hwname="et0"
-  FAILSAFE_ifnames="vlan1 vlan2 eth2"
-  remap eth0 vlan2
-  remap eth1 vlan1
-}
-
-# hacks for asus wl-500g deluxe
-[ "$(nvram get boardtype)" = "bcm95365r" ] && \
-[ "$(nvram get boardnum)" = "45" ] && {
-  debug "### wl-500g deluxe hacks ###"
-  NVRAM_vlan0hwname="et0"
-  NVRAM_vlan1hwname="et0"
-  FAILSAFE_ifnames="vlan0 eth1"
-  remap eth0.1 vlan0
-  remap eth0 vlan1
-}
-
-# hacks for wap54g hardware
-[ "$(nvram get boardnum)"  = "2" ] || \
-[ "$(nvram get boardnum)"  = "1024" ] && {
-  debug "### wap54g hack ###"
-  NVRAM_wan_ifname="none"
-  FAILSAFE_ifnames="eth0 eth1"
-}
-
-# hacks for buffalo wla2-g54l
-[ "$(nvram get boardnum)" = "00" ] && \
-[ "$(nvram get product_name)" = "Product_name" ] || \
-[ "$(nvram get product_name)" = "WLA2-G54L" ] && {
-  debug "### wla2-g54l hacks ###"
-  NVRAM_wan_ifname="none"
-  NVRAM_lan_ifnames="vlan0"
-}
-
-# hack for asus wl-500g hardware
-[ "$(nvram get boardnum)"  = "asusX" ] && \
-[ "$(nvram get boardtype)"  = "bcm94710dev" ] && {
-  FAILSAFE_ifnames="eth0 eth2"
-}
-
-# defaults if lan_ifname is missing
-[ -z "$(nvram get lan_ifname)" ] && {
-  NVRAM_lan_ifname="br0"
-  NVRAM_lan_ifnames=${FAILSAFE_ifnames:-"vlan0 vlan2 eth1 eth2 eth3"}
-}
-
-# defaults if wan_ifname is missing
-[ -z "$(nvram get wan_ifname)" ] && {
-   NVRAM_wan_ifname="vlan1"
-   NVRAM_wan_proto="dhcp"
-}
-
-# failsafe if reset is held
-[ "$FAILSAFE" = "true" ] && {
-  echo "### YOU ARE IN FAILSAFE MODE ####"
-  NVRAM_lan_ifname="br0"
-  NVRAM_lan_ifnames=${FAILSAFE_ifnames:-"vlan0 vlan1 eth1 eth2 eth3"}
-  NVRAM_lan_ipaddr=${BR2_SYSCONF_FAILSAFE_IP:-"192.168.1.1"}
-  NVRAM_lan_netmask=${BR2_SYSCONF_FAILSAFE_NETMASK:-"255.255.255.0"}
-  NVRAM_lan_hwaddr=${BR2_SYSCONF_FAILSAFE_MAC:-"00:0B:AD:0A:DD:00"}
-  NVRAM_wan_ifname="none"
-  NVRAM_wifi_ifname="none"
-}
diff --git a/openwrt/target/default/target_skeleton/etc/passwd b/openwrt/target/default/target_skeleton/etc/passwd
deleted file mode 100644 (file)
index 3b660a0..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-root:!:0:0:root:/tmp:/bin/ash
-nobody:*:65534:65534:nobody:/var:/bin/false
diff --git a/openwrt/target/default/target_skeleton/etc/preinit b/openwrt/target/default/target_skeleton/etc/preinit
deleted file mode 100755 (executable)
index 7a02e31..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-mount none /proc -t proc
-insmod diag
-echo 0x01 > /proc/sys/diag
-sleep 1
-if [ $(cat /proc/sys/reset) = 1 ] || [ "$(/usr/sbin/nvram get failsafe)" = 1 ]; then
-  export FAILSAFE=true
-  while :; do { echo $(((X=(X+1)%8)%2)) > /proc/sys/diag; sleep $((X==0)); } done &
-fi
-/sbin/mount_root ${FAILSAFE:+failsafe}
-
-exec /sbin/init
diff --git a/openwrt/target/default/target_skeleton/etc/profile b/openwrt/target/default/target_skeleton/etc/profile
deleted file mode 100644 (file)
index b63dc8e..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-[ -f /etc/banner ] && cat /etc/banner
-
-export PATH=/bin:/sbin:/usr/bin:/usr/sbin
-export PS1='\u@\h:\w\$ '
-
-alias less=more
-alias vim=vi
-
-arp() { cat /proc/net/arp; }
-ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
diff --git a/openwrt/target/default/target_skeleton/etc/protocols b/openwrt/target/default/target_skeleton/etc/protocols
deleted file mode 100644 (file)
index 53fecb6..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-# Internet (IP) protocols
-#
-# Updated from http://www.iana.org/assignments/protocol-numbers and other
-# sources.
-# New protocols will be added on request if they have been officially
-# assigned by IANA and are not historical.
-# If you need a huge list of used numbers please install the nmap package.
-
-ip     0       IP              # internet protocol, pseudo protocol number
-#hopopt        0       HOPOPT          # IPv6 Hop-by-Hop Option [RFC1883]
-icmp   1       ICMP            # internet control message protocol
-igmp   2       IGMP            # Internet Group Management
-ggp    3       GGP             # gateway-gateway protocol
-ipencap        4       IP-ENCAP        # IP encapsulated in IP (officially ``IP'')
-st     5       ST              # ST datagram mode
-tcp    6       TCP             # transmission control protocol
-egp    8       EGP             # exterior gateway protocol
-igp    9       IGP             # any private interior gateway (Cisco)
-pup    12      PUP             # PARC universal packet protocol
-udp    17      UDP             # user datagram protocol
-hmp    20      HMP             # host monitoring protocol
-xns-idp        22      XNS-IDP         # Xerox NS IDP
-rdp    27      RDP             # "reliable datagram" protocol
-iso-tp4        29      ISO-TP4         # ISO Transport Protocol class 4 [RFC905]
-xtp    36      XTP             # Xpress Transfer Protocol
-ddp    37      DDP             # Datagram Delivery Protocol
-idpr-cmtp 38   IDPR-CMTP       # IDPR Control Message Transport
-ipv6   41      IPv6            # Internet Protocol, version 6
-ipv6-route 43  IPv6-Route      # Routing Header for IPv6
-ipv6-frag 44   IPv6-Frag       # Fragment Header for IPv6
-idrp   45      IDRP            # Inter-Domain Routing Protocol
-rsvp   46      RSVP            # Reservation Protocol
-gre    47      GRE             # General Routing Encapsulation
-esp    50      IPSEC-ESP       # Encap Security Payload [RFC2046]
-ah     51      IPSEC-AH        # Authentication Header [RFC2402]
-skip   57      SKIP            # SKIP
-ipv6-icmp 58   IPv6-ICMP       # ICMP for IPv6
-ipv6-nonxt 59  IPv6-NoNxt      # No Next Header for IPv6
-ipv6-opts 60   IPv6-Opts       # Destination Options for IPv6
-rspf   73      RSPF CPHB       # Radio Shortest Path First (officially CPHB)
-vmtp   81      VMTP            # Versatile Message Transport
-eigrp  88      EIGRP           # Enhanced Interior Routing Protocol (Cisco)
-ospf   89      OSPFIGP         # Open Shortest Path First IGP
-ax.25  93      AX.25           # AX.25 frames
-ipip   94      IPIP            # IP-within-IP Encapsulation Protocol
-etherip        97      ETHERIP         # Ethernet-within-IP Encapsulation [RFC3378]
-encap  98      ENCAP           # Yet Another IP encapsulation [RFC1241]
-#      99                      # any private encryption scheme
-pim    103     PIM             # Protocol Independent Multicast
-ipcomp 108     IPCOMP          # IP Payload Compression Protocol
-vrrp   112     VRRP            # Virtual Router Redundancy Protocol
-l2tp   115     L2TP            # Layer Two Tunneling Protocol [RFC2661]
-isis   124     ISIS            # IS-IS over IPv4
-sctp   132     SCTP            # Stream Control Transmission Protocol
-fc     133     FC              # Fibre Channel
-
diff --git a/openwrt/target/default/target_skeleton/etc/shells b/openwrt/target/default/target_skeleton/etc/shells
deleted file mode 100644 (file)
index 006aa38..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/bin/ash
diff --git a/openwrt/target/default/target_skeleton/etc/sysctl.conf b/openwrt/target/default/target_skeleton/etc/sysctl.conf
deleted file mode 100644 (file)
index 2050b0c..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-kernel.panic=3
-net.ipv4.ip_forward=1
-net.ipv4.icmp_echo_ignore_broadcasts=1
-net.ipv4.icmp_ignore_bogus_error_responses=1
-net.ipv4.tcp_fin_timeout=30
-net.ipv4.tcp_keepalive_time=120
-net.ipv4.tcp_timestamps=0
diff --git a/openwrt/target/default/target_skeleton/rom/note b/openwrt/target/default/target_skeleton/rom/note
deleted file mode 100644 (file)
index 1746eb0..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-SQUASHFS USERS:
-After firstboot has been run, / will be jffs2 and /rom will be squashfs
-(* except when in failsafe)
diff --git a/openwrt/target/default/target_skeleton/sbin/backup b/openwrt/target/default/target_skeleton/sbin/backup
deleted file mode 100755 (executable)
index 33bad53..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-for param in $*; do
-       case "$param" in
-               *)
-                       OUTPUT_FILE="$param"
-                       ;;
-       esac
-done
-
-if [ "$OUTPUT_FILE" = "-" ]; then
-       echo "Writing backup to stdout.." >&2
-elif [ "$OUTPUT_FILE" = "" ]; then
-       echo "No output file."
-       exit 1
-else
-       echo "Writing backup to $OUTPUT_FILE" >&2
-       exec > "$OUTPUT_FILE"
-fi
-
-echo __FILELIST__
-find /etc -type f > /tmp/.wlbackup_files
-cat /tmp/.wlbackup_files
-
-echo __IPKG__
-cat /etc/ipkg.conf
-
-echo __PACKAGES__
-grep '^Package:' /usr/lib/ipkg/status | cut -d' ' -f2
-
-echo __FILES__
-tar -T /tmp/.wlbackup_files -cz 2>/dev/null
-rm -f /tmp/.wlbackup_files
diff --git a/openwrt/target/default/target_skeleton/sbin/halt b/openwrt/target/default/target_skeleton/sbin/halt
deleted file mode 100755 (executable)
index 39eed26..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-/usr/bin/killall5 -9
-#umount -ar
diff --git a/openwrt/target/default/target_skeleton/sbin/hotplug b/openwrt/target/default/target_skeleton/sbin/hotplug
deleted file mode 100755 (executable)
index b16f9f7..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/ash
-# $Id$
-[ "${INTERFACE%%[0-9]*}" = "wds" ] && { 
-       [ -x "/usr/sbin/nas4not" ] && /usr/sbin/nas4not lan $INTERFACE up
-       ifconfig $INTERFACE 0.0.0.0 up
-       /usr/sbin/brctl addif br0 $INTERFACE
-}
diff --git a/openwrt/target/default/target_skeleton/sbin/ifdown b/openwrt/target/default/target_skeleton/sbin/ifdown
deleted file mode 100755 (executable)
index e59e057..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/ash
-. /etc/functions.sh
-  type=$1
-  debug "### ifdown $type ###"
-  if=$(nvram get ${type}_ifname)
-  if_valid $if || return
-  kill $(cat /var/run/${if}.pid 2>&-) 2>&-
-  $DEBUG ifconfig $if down
diff --git a/openwrt/target/default/target_skeleton/sbin/ifup b/openwrt/target/default/target_skeleton/sbin/ifup
deleted file mode 100755 (executable)
index 3748d76..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/ash
-. /etc/functions.sh
-type=$1
-debug "### ifup $type ###"
-
-if=$(nvram get ${type}_ifname)
-if [ "${if%%[0-9]}" = "ppp" ]; then
-  if=$(nvram get pppoe_ifname)
-fi
-
-if_valid $if || return
-
-mac=$(nvram get ${type}_hwaddr)
-$DEBUG ifconfig $if down 2>&-
-if [ "${if%%[0-9]}" = "br" ]; then
-  stp=$(nvram get ${type}_stp)
-  $DEBUG brctl delbr $if 2>&-
-  $DEBUG brctl addbr $if
-  $DEBUG brctl setfd $if 0
-  $DEBUG brctl stp $if ${stp:-0}
-  for sif in $(nvram get ${type}_ifnames); do {
-    if_valid $sif || continue
-    ${mac:+$DEBUG ifconfig $sif down hw ether $mac}
-    $DEBUG ifconfig $sif 0.0.0.0 up
-    $DEBUG brctl addif $if $sif
-  } done
-else
-  ${mac:+$DEBUG ifconfig $if down hw ether $mac}
-fi
-
-
-if_proto=$(nvram get ${type}_proto)
-case "$if_proto" in
-  static)
-    ip=$(nvram get ${type}_ipaddr)
-    netmask=$(nvram get ${type}_netmask)
-    gateway=$(nvram get ${type}_gateway)
-
-    $DEBUG ifconfig $if $ip ${netmask:+netmask $netmask} broadcast + up
-    ${gateway:+$DEBUG route add default gw $gateway}
-
-    [ -f /etc/resolv.conf ] && return
-
-    debug "# --- creating /etc/resolv.conf ---"
-    for dns in $(nvram get ${type}_dns); do {
-       echo "nameserver $dns" >> /etc/resolv.conf
-    } done
-  ;;
-  dhcp)
-    ip=$(nvram get ${type}_ipaddr)
-    pidfile=/tmp/dhcp-${type}.pid
-    if [ -f $pidfile ]; then
-      $DEBUG kill $(cat $pidfile)
-    fi
-    ${DEBUG:-eval} "udhcpc -R -i $if ${ip:+-r $ip} -b -p $pidfile &" 
-  ;;
-  none|"")
-  ;;
-  *)
-    [ -x "/sbin/ifup.${if_proto}" ] && { $DEBUG /sbin/ifup.${if_proto} $*; exit; }
-    echo "### ifup $type: ignored ${type}_proto=\"$if_proto\" (not supported)"
-  ;;
-esac
diff --git a/openwrt/target/default/target_skeleton/sbin/mount_root b/openwrt/target/default/target_skeleton/sbin/mount_root
deleted file mode 100755 (executable)
index eef55b4..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-if [ "$1" != "failsafe" ]; then 
-       mount | grep jffs2 >&-
-       if [ $? = 0 ] ; then
-               if [ $(cat /proc/mtd | wc -l) = 6 ]; then
-                       echo 5 > /proc/sys/diag
-                       mtd unlock linux
-                       mtd erase OpenWrt
-                       jffs2root --move
-               else
-                       mtd unlock rootfs
-                       mount -o remount,rw /dev/root /
-               fi
-       else
-               mtd unlock OpenWrt
-               mount -t jffs2 /dev/mtdblock/4 /jffs
-               pivot_root /jffs /jffs/rom
-               mount none /proc -t proc
-               mount none /dev -t devfs
-               umount /rom/proc rom/dev >&-
-       fi
-fi
-mount none /tmp -t tmpfs size=50%
-mkdir -p /dev/pts
-mount none /dev/pts -t devpts
diff --git a/openwrt/target/default/target_skeleton/sbin/restore b/openwrt/target/default/target_skeleton/sbin/restore
deleted file mode 100755 (executable)
index 6b5876c..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/sh
-for param in $*; do
-       case "$param" in
-               *)
-                       INPUT_FILE="$param"
-       esac
-done
-
-if [ "$INPUT_FILE" = "-" ]; then
-       echo "Reading backup from stdin..." >&2
-elif [ "$INPUT_FILE" = "" ]; then
-       echo "No input file."
-else
-       echo "Reading backup from $INPUT_FILE" >&2
-       exec < "$INPUT_FILE"
-fi
-
-process_line () {
-       case "$SECTION" in
-               ipkg)
-                       echo "$line" >> /etc/ipkg.conf
-                       ;;
-               nvram)
-                       echo nvram set "$line"
-                       ;;
-               package)
-                       if grep "^Package: $line" /usr/lib/ipkg/status 2>&1 > /dev/null; then
-                               echo Package "$line" already installed.
-                       else
-                               ipkg install "$line"
-                       fi
-                       ;;
-               file)
-                       rm -f "$line"
-                       ;;
-       esac
-}
-
-while true; do
-       read line
-       case "$line" in
-               __IPKG__)
-                       SECTION=ipkg
-                       echo "Restoring /etc/ipkg.conf"
-                       rm -f /etc/ipkg.conf
-                       ;;
-               __NVRAM__)
-                       SECTION=nvram
-                       echo "Restoring nvram"
-                       ;;
-               __PACKAGES__)
-                       SECTION=package
-                       echo "Restoring packages"
-                       ipkg update
-                       ;;
-               __FILELIST__)
-                       SECTION=file
-                       echo "Deleting old files"
-                       ;;
-               __FILES__)
-                       echo "Restoring /etc"
-                       tar -C / -xvz
-                       echo "Restore complete."
-                       exit 0
-                       ;;
-               *)
-                       process_line;
-                       ;;
-       esac
-done
-
diff --git a/openwrt/target/default/target_skeleton/usr/share/udhcpc/default.script b/openwrt/target/default/target_skeleton/usr/share/udhcpc/default.script
deleted file mode 100755 (executable)
index cc94a79..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-# udhcpc script edited by Tim Riker <Tim@Rikers.org>
-# (slightly modified for openwrt)
-
-[ -z "$1" ] && echo "Error: should be run by udhcpc" && exit 1
-
-RESOLV_CONF="/tmp/resolv.conf"
-
-case "$1" in
-        deconfig)
-                ifconfig $interface 0.0.0.0
-                ;;
-
-        renew|bound)
-                ifconfig $interface $ip \
-                netmask ${subnet:-255.255.255.0} \
-                broadcast ${broadcast:-+}
-
-                if [ -n "$router" ] ; then
-                        echo "deleting routers"
-                        while route del default gw 0.0.0.0 dev $interface ; do
-                                :
-                        done
-
-                        for i in $router ; do
-                                route add default gw $i dev $interface
-                        done
-                fi
-
-                echo -n > $RESOLV_CONF
-                ${domain:+echo search $domain >> $RESOLV_CONF}
-                for i in $dns ; do
-                        echo adding dns $i
-                        echo nameserver $i >> $RESOLV_CONF
-                done
-                ;;
-esac
-exit 0
diff --git a/openwrt/target/default/target_skeleton/www/index.html b/openwrt/target/default/target_skeleton/www/index.html
deleted file mode 100644 (file)
index 575d242..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<HTML>
-<HEAD><TITLE>OpenWrt</TITLE></HEAD>
-<BODY>
-No webpages currently available
-<br>- perhaps you need to install a package?
-</BODY>
-</HTML>
index a4cb68e9dc9b5b0b777fb884a4354d766b98e0e8..8bf12b9fb653a1047713a47572c8efe18328eebf 100644 (file)
@@ -7,22 +7,12 @@ config BR2_LINUX_2_4_BRCM
        bool "Support for Broadcom based routers"
        default y
        help
-         Build firmware images for Broadcom based routers (e.g. Linksys WRT54G(S), Asus WL-500g)
-         
-       config BR2_TARGET_WRT54G
-               default y
-               depends BR2_LINUX_2_4_BRCM
-               bool "Linksys WRT54G"
-
-       config BR2_TARGET_WRT54GS
-               default y
-               depends BR2_LINUX_2_4_BRCM
-               bool "Linksys WRT54GS"
-       
-       config BR2_TARGET_MOTOROLA
-               default y
-               depends BR2_LINUX_2_4_BRCM
-               bool "Motorola"
+         Build firmware images for Broadcom based routers
+          (e.g. Linksys WRT54G(S), Asus WL-500g, Motorola WR850G)
+                              
+         This one builds the generic .trx images, activate one of the
+         options below for creating device specific files for use 
+         with TFTP client too. 
 
 comment "Kernel Modules"
 
@@ -240,4 +230,12 @@ config BR2_PACKAGE_KMOD_SCHED
        help
          Kernel schedulers for IP traffic
 
+config BR2_PACKAGE_KMOD_VIDEODEV
+       tristate "Video (For Linux) kernel support"
+       default m
+
+config BR2_PACKAGE_KMOD_PWC
+       tristate "Kernel driver for USB Philips Cameras"
+       default m
+
 source "target/linux/package/Config.in"
index 604c739b599191a78d5ae4516180ad643f2be627..04f83e648cab6c7787bbaba28669e82de9566c18 100644 (file)
@@ -1,5 +1,11 @@
 include $(TOPDIR)/rules.mk
 
+PKG_OS:=$(shell uname -s)
+PKG_CPU:=$(shell uname -m)
+
+IB_NAME:=OpenWrt-ImageBuilder-$(PKG_OS)-$(PKG_CPU)
+IB_DIR:=$(BUILD_DIR)/$(IB_NAME)
+
 define kernel_template
 
 $(1)/$(2)-clean:
@@ -20,22 +26,50 @@ $(1)/$(2)-install:
 $(1)/$(2)-image: $(1)/$(2)-install
        $(MAKE) -C image KERNEL="$(1)" BOARD="$(2)" install
 
+$(1)/$(2)-install-ib:
+       $(MAKE) -C image KERNEL="$(1)" BOARD="$(2)" IB_DIR="$(IB_DIR)" install-ib
+       echo '$$$$(eval $$$$(call image_template,$(2),$(1)))' >> $(IB_DIR)/kernel.mk
+
+
 ifeq ($(BR2_LINUX_$(3)),y)
 clean: $(1)/$(2)-clean
 prepare: $(1)/$(2)-prepare
 compile: $(1)/$(2)-compile
 rebuild: $(1)/$(2)-rebuild
-install: $(1)/$(2)-image
+kernel-install: $(1)/$(2)-image
+install-ib: $(1)/$(2)-install-ib
 endif
 
-.PHONY: $(1)/$(2)-clean $(1)/$(2)-prepare $(1)/$(2)-compile $(1)/$(2)-rebuild $(1)/$(2)-install
+.PHONY: $(1)/$(2)-clean $(1)/$(2)-prepare $(1)/$(2)-compile $(1)/$(2)-rebuild $(1)/$(2)-install $(1)/$(2)-image $(1)/$(2)-install-ib
 endef
 
+.PHONY: clean prepare compile rebuild install imagebuilder install-ib kernel-install
+
+install-ib:
+
+$(BIN_DIR)/$(IB_NAME).tar.bz2: kernel-install
+       rm -rf $(IB_DIR)
+       mkdir -p $(IB_DIR)/packages
+       mkdir -p $(IB_DIR)/scripts
+       cp -fpR ./imagebuilder/* $(IB_DIR)/
+       cp -fpR $(TOPDIR)/bin/packages/*.ipk $(IB_DIR)/packages/
+       cp $(TOPDIR)/scripts/ipkg $(IB_DIR)/scripts/
+       $(MAKE) install-ib
+       cp $(TOPDIR)/rules.mk $(IB_DIR)
+       cp -fpR ./image $(IB_DIR)/
+       cp $(TOPDIR)/.config $(IB_DIR)/
+       find $(IB_DIR) -name CVS | xargs rm -rf
+       (cd $(BUILD_DIR); tar c $(IB_NAME) | bzip2 -c > $(BIN_DIR)/$(IB_NAME).tar.bz2)
+
+ifeq ($(BR2_PACKAGE_IMAGEBUILDER),y)
+install: $(BIN_DIR)/$(IB_NAME).tar.bz2
+endif
+
 prepare:
        $(MAKE) -C image prepare
 compile:
        $(MAKE) -C image compile
-install:
+install: kernel-install
 rebuild:
 clean:
 
diff --git a/openwrt/target/linux/control/kmod-pwc.control b/openwrt/target/linux/control/kmod-pwc.control
new file mode 100644 (file)
index 0000000..ecd5485
--- /dev/null
@@ -0,0 +1,6 @@
+Package: kmod-pwc
+Priority: optional
+Section: sys
+Maintainer: Nicolas Thill <nico@openwrt.org>
+Source: http://openwrt.org/cgi-bin/viewcvs.cgi/openwrt/target/linux/linux-2.4/
+Description: Kernel driver for USB Philips Cameras
diff --git a/openwrt/target/linux/control/kmod-videodev.control b/openwrt/target/linux/control/kmod-videodev.control
new file mode 100644 (file)
index 0000000..c852683
--- /dev/null
@@ -0,0 +1,6 @@
+Package: kmod-videodev
+Priority: optional
+Section: sys
+Maintainer: Nicolas Thill <nico@openwrt.org>
+Source: http://openwrt.org/cgi-bin/viewcvs.cgi/openwrt/target/linux/linux-2.4/
+Description: Video For Linux kernel support
index 73e67a3d1caef3bdb93845f20f26b3b13c0d7849..c0ff70929bae8cc63534945b611c370baece3bda 100644 (file)
@@ -1,9 +1,5 @@
 include $(TOPDIR)/rules.mk
 
-ifeq ($(BOARD),)
-BOARD:=brcm
-endif
-
 KDIR:=$(BUILD_DIR)/linux-$(KERNEL)-$(BOARD)
 
 ifeq ($(BR2_TARGET_ROOTFS_JFFS2),y)
@@ -19,6 +15,12 @@ compile:
 install:
        $(MAKE) -C $(BOARD) prepare
        $(MAKE) -C $(BOARD) compile
+
+install-ib:
+       -$(MAKE) -C $(BOARD) IB_DIR="$(IB_DIR)" install-ib
+       mkdir -p $(IB_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD)
+       cp $(BUILD_DIR)/linux-$(KERNEL)-$(BOARD)/kernel[-_]*.ipk $(IB_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD)/      
+
 rebuild: clean prepare compile install
 clean:
 
index 25f4ea9740201cbd2bbbf65b95d73edd18e5e96b..67ea3e2f508dd4cdd47db0a0e3b75c877a06f93d 100644 (file)
@@ -1,6 +1,6 @@
 include $(TOPDIR)/rules.mk
 
-KDIR:=$(BUILD_DIR)/linux-$(KERNEL)-brcm
+KDIR:=$(BUILD_DIR)/linux-$(KERNEL)-$(BOARD)
 
 lzma-loader-clean:
        $(MAKE) -C lzma-loader clean
@@ -11,37 +11,61 @@ lzma-loader-prepare:
 lzma-loader-compile: lzma-loader-prepare
        $(MAKE) -C lzma-loader compile
 
+ifeq ($(IB),)
 $(KDIR)/vmlinux.lzma: $(KDIR)/vmlinux
        cat $^ | $(STAGING_DIR)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $@ || (rm -f $@ && false)
 
-$(BIN_DIR)/openwrt-brcm-$(KERNEL)-$(FS).trx: $(KDIR)/vmlinux.lzma
-       $(STAGING_DIR)/bin/trx -o $@ $(BUILD_DIR)/loader.gz $(KDIR)/vmlinux.lzma $(KDIR)/root.$(FS)
+$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx: $(KDIR)/vmlinux.lzma compile
+endif
+
+ifeq ($(FS),jffs2-8MB)
+TRXALIGN:=-a 0x20000
+endif
+ifeq ($(FS),jffs2-4MB)
+TRXALIGN:=-a 0x10000
+endif
+$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx:
+       $(STAGING_DIR)/bin/trx -o $@ $(BUILD_DIR)/loader.gz $(KDIR)/vmlinux.lzma $(TRXALIGN) $(KDIR)/root.$(FS)
+
 
 ifeq ($(KERNEL),2.4)
 FSNAME:=$(patsubst jffs2-%,jffs2,$(FS))
 
 ifneq ($(FS),jffs2-8MB)
-$(BIN_DIR)/openwrt-wrt54g-$(FSNAME).bin: $(BIN_DIR)/openwrt-brcm-$(KERNEL)-$(FS).trx
-       $(STAGING_DIR)/bin/addpattern -2 -i $< -o $@ -g
-       $(SED) "1s,^W54S,W54G," $@
+$(BIN_DIR)/openwrt-wrt54g-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
+       $(STAGING_DIR)/bin/addpattern -4 -p W54G -v v4.20.6 -i $< -o $@ -g
+
+$(BIN_DIR)/openwrt-wrt54gs_v4-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
+       $(STAGING_DIR)/bin/addpattern -4 -p W54s -v v1.05.0 -i $< -o $@ -g
 
-install: $(BIN_DIR)/openwrt-wrt54g-$(FSNAME).bin
+install: $(BIN_DIR)/openwrt-wrt54g-$(FSNAME).bin $(BIN_DIR)/openwrt-wrt54gs_v4-$(FSNAME).bin
 endif
 
 ifneq ($(FS),jffs2-4MB)
-$(BIN_DIR)/openwrt-wrt54gs-$(FSNAME).bin: $(BIN_DIR)/openwrt-brcm-$(KERNEL)-$(FS).trx
-       $(STAGING_DIR)/bin/addpattern -2 -i $< -o $@ -g
+$(BIN_DIR)/openwrt-wrt54gs-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
+       $(STAGING_DIR)/bin/addpattern -4 -p W54S -v v4.70.6 -i $< -o $@ -g
 
 install: $(BIN_DIR)/openwrt-wrt54gs-$(FSNAME).bin
 endif
 
-$(BIN_DIR)/openwrt-motorola-$(FS).bin: $(BIN_DIR)/openwrt-brcm-$(KERNEL)-$(FS).trx
+$(BIN_DIR)/openwrt-motorola-$(FS).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
        $(STAGING_DIR)/bin/motorola-bin $< $@
 install: $(BIN_DIR)/openwrt-motorola-$(FS).bin
 endif
 
+ifeq ($(IB),)
 clean: lzma-loader-clean
 prepare: lzma-loader-prepare
 compile: lzma-loader-compile
-install: compile $(BIN_DIR)/openwrt-brcm-$(KERNEL)-$(FS).trx
-       
+else
+clean:
+prepare:
+compile:
+endif
+install: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
+install-ib:
+       mkdir -p $(IB_DIR)/staging_dir_$(ARCH)/bin
+       cp -fpR $(STAGING_DIR)/bin/addpattern $(STAGING_DIR)/bin/trx $(STAGING_DIR)/bin/motorola-bin $(IB_DIR)/staging_dir_$(ARCH)/bin
+       mkdir -p $(IB_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD)
+       cp -fpR $(BUILD_DIR)/loader.gz $(IB_DIR)/build_$(ARCH)/
+       cp -fpR $(KDIR)/vmlinux.lzma $(IB_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD)/
index 02c56817b31fc1052e345976b5850943b61570b1..a2c47e4dcd60b20a1e5c26a7743f38fb9c42f864 100644 (file)
@@ -23,8 +23,13 @@ jffs2-install: $(KDIR)/root.jffs2-4MB $(KDIR)/root.jffs2-8MB
        $(MAKE) -C $(BOARD) install KERNEL="$(KERNEL)" FS="jffs2-4MB"
        $(MAKE) -C $(BOARD) install KERNEL="$(KERNEL)" FS="jffs2-8MB"
 
+jffs2-install-ib:
+       mkdir -p $(IB_DIR)/staging_dir_$(ARCH)/bin
+       cp $(STAGING_DIR)/bin/mkfs.jffs2 $(IB_DIR)/staging_dir_$(ARCH)/bin
+
 prepare: jffs2-prepare
 compile: jffs2-compile
 install: jffs2-install
+install-ib: jffs2-install-ib
 clean: jffs2-clean
 
index 8734ee22517f6fb503534415e24560ad396153a5..d5f03bef4add669adaed8bb4df855228cf292752 100644 (file)
@@ -11,6 +11,7 @@ $(DL_DIR)/$(MTD_SOURCE):
 
 $(MTD_DIR)/.unpacked: $(DL_DIR)/$(MTD_SOURCE)
        zcat $(DL_DIR)/$(MTD_SOURCE) | tar -C $(BUILD_DIR) -xvf -
+       $(PATCH) $(MTD_DIR) ./patches
        touch $(MTD_DIR)/.unpacked
 
 $(MTD_DIR)/util/mkfs.jffs2: $(MTD_DIR)/.unpacked
diff --git a/openwrt/target/linux/image/jffs2/patches/gcc4-fix.patch b/openwrt/target/linux/image/jffs2/patches/gcc4-fix.patch
new file mode 100644 (file)
index 0000000..50c8edb
--- /dev/null
@@ -0,0 +1,24 @@
+diff -urN mtd-20050122.orig.old/include/mtd/jffs2-user.h mtd-20050122.orig.dev/include/mtd/jffs2-user.h
+--- mtd-20050122.orig.old/include/mtd/jffs2-user.h     2004-05-05 13:57:54.000000000 +0200
++++ mtd-20050122.orig.dev/include/mtd/jffs2-user.h     2005-07-02 10:03:09.000000000 +0200
+@@ -19,8 +19,6 @@
+ #undef je32_to_cpu
+ #undef jemode_to_cpu
+-extern int target_endian;
+-
+ #define t16(x) ({ uint16_t __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_16(__b); })
+ #define t32(x) ({ uint32_t __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_32(__b); })
+diff -urN mtd.old/util/jffs3.h mtd.dev/util/jffs3.h
+--- mtd.old/util/jffs3.h       2005-01-22 00:00:13.000000000 +0100
++++ mtd.dev/util/jffs3.h       2005-07-17 17:48:24.000000000 +0200
+@@ -177,8 +177,6 @@
+ #undef je32_to_cpu
+ #undef jemode_to_cpu
+-extern int target_endian;
+-
+ #define t16(x) ({ uint16_t __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_16(__b); })
+ #define t32(x) ({ uint32_t __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_32(__b); })
index 917a69ab8a1bbc5f652b83ce687b0b31db1b0f3c..42ff77db6455e6643932fa8fea34d50eb8411f62 100644 (file)
@@ -10,11 +10,17 @@ squashfs-clean:
 
 $(KDIR)/root.squashfs:
        @mkdir -p $(KDIR)/root/jffs
-       $(STAGING_DIR)/bin/mksquashfs-lzma $(KDIR)/root $@ -noappend -root-owned -le
+       $(STAGING_DIR)/bin/mksquashfs-lzma $(KDIR)/root $@ -nopad -noappend -root-owned -le
 
 squashfs-install: $(KDIR)/root.squashfs
        $(MAKE) -C $(BOARD) install KERNEL="$(KERNEL)" FS="squashfs"
+
+squashfs-install-ib:
+       mkdir -p $(IB_DIR)/staging_dir_$(ARCH)/bin
+       cp $(STAGING_DIR)/bin/mksquashfs-lzma $(IB_DIR)/staging_dir_$(ARCH)/bin
        
 prepare: squashfs-prepare
 compile: squashfs-compile
 install: squashfs-install
+install-ib: squashfs-install-ib
+clean: squashfs-clean
diff --git a/openwrt/target/linux/imagebuilder/Makefile b/openwrt/target/linux/imagebuilder/Makefile
new file mode 100644 (file)
index 0000000..c70fb11
--- /dev/null
@@ -0,0 +1,48 @@
+default: clean all
+
+TOPDIR:=${shell pwd}
+export TOPDIR
+IB:=1
+export IB
+include ./rules.mk
+
+LINUX_BUILD_DIR:=$(BUILD_DIR)/linux-$(KERNEL)-$(BOARD)
+IPKG_KERNEL:=IPKG_TMP=$(BUILD_DIR)/tmp IPKG_INSTROOT=$(LINUX_BUILD_DIR)/root IPKG_CONF_DIR=$(LINUX_BUILD_DIR) $(SCRIPT_DIR)/ipkg -force-defaults -force-depends
+
+define image_template
+
+all: all-$(1)-$(2)
+
+all-$(1)-$(2):
+       @for listfile in ./lists/*.$(1)-$(2); do \
+               $(MAKE) -s `echo $$$$listfile | sed 's,.*lists/\(.*\).$(1)-$(2),BOARD=$(1) KERNEL=$(2) LIST=\1,'` build; \
+       done
+endef
+
+include ./kernel.mk
+
+clean:
+       @rm -rf $(LINUX_BUILD_DIR)/root*
+       @rm -rf $(BIN_DIR)
+all:
+
+build:
+       echo
+       echo '### BUILDING IMAGE FROM lists/$(LIST).$(BOARD)-$(KERNEL)'
+       echo
+       rm -rf $(LINUX_BUILD_DIR)/root*
+       mkdir -p $(BIN_DIR)/$(LIST)
+       mkdir -p $(LINUX_BUILD_DIR)/tmp
+       mkdir -p $(LINUX_BUILD_DIR)/root
+       echo -e 'dest root /\noption offline_root $(LINUX_BUILD_DIR)/root' > $(LINUX_BUILD_DIR)/ipkg.conf
+       $(IPKG_KERNEL) install $(BUILD_DIR)/linux-$(KERNEL)-$(BOARD)/kernel[-_]*.ipk
+       for package in `cat lists/$(LIST).$(BOARD)-$(KERNEL)`; do \
+               $(IPKG_KERNEL) install `ls packages/$${package}_*`; \
+       done
+       if [ -d ./files ]; then \
+               cp -a --remove-destination ./files/* $(LINUX_BUILD_DIR)/root; \
+       fi
+       if [ -d ./files.$(LIST) ]; then \
+               cp -a --remove-destination ./files.$(LIST)/* $(LINUX_BUILD_DIR)/root; \
+       fi
+       $(MAKE) -S -C image KERNEL="$(KERNEL)" BOARD="$(BOARD)" BIN_DIR="$(BIN_DIR)/$(LIST)" install
diff --git a/openwrt/target/linux/imagebuilder/lists/default.brcm-2.4 b/openwrt/target/linux/imagebuilder/lists/default.brcm-2.4
new file mode 100644 (file)
index 0000000..91236cb
--- /dev/null
@@ -0,0 +1,23 @@
+base-files
+base-files-brcm
+bridge
+busybox
+dnsmasq
+dropbear
+ipkg
+iptables
+kmod-brcm-et
+kmod-brcm-wl
+kmod-diag
+kmod-ppp
+kmod-pppoe
+kmod-wlcompat
+libgcc
+mtd
+nvram
+ppp
+ppp-mod-pppoe
+uclibc
+wireless-tools
+wificonf
+zlib
diff --git a/openwrt/target/linux/imagebuilder/lists/micro.brcm-2.4 b/openwrt/target/linux/imagebuilder/lists/micro.brcm-2.4
new file mode 100644 (file)
index 0000000..0788843
--- /dev/null
@@ -0,0 +1,19 @@
+base-files
+base-files-brcm
+bridge
+busybox
+dnsmasq
+dropbear
+ipkg
+iptables
+kmod-brcm-et
+kmod-brcm-wl
+kmod-diag
+kmod-wlcompat
+libgcc
+mtd
+nvram
+uclibc
+wireless-tools
+wificonf
+zlib
diff --git a/openwrt/target/linux/imagebuilder/lists/pptp.brcm-2.4 b/openwrt/target/linux/imagebuilder/lists/pptp.brcm-2.4
new file mode 100644 (file)
index 0000000..280b21e
--- /dev/null
@@ -0,0 +1,23 @@
+base-files
+base-files-brcm
+bridge
+busybox
+dnsmasq
+dropbear
+ipkg
+iptables
+kmod-brcm-et
+kmod-brcm-wl
+kmod-diag
+kmod-ppp
+kmod-gre
+kmod-wlcompat
+libgcc
+mtd
+nvram
+ppp
+pptp
+uclibc
+wireless-tools
+wificonf
+zlib
index 869ed066d97cdf988c0f08c2ed40609b364be258..687069fe07aaae6f26d60b960174904e1d7262d6 100644 (file)
 include $(TOPDIR)/rules.mk
 include ../rules.mk
 
-# for testing
-ifeq ($(BOARD),)
-BOARD:=brcm
-endif
-
 LINUX_VERSION:=2.4.30
 MODULES_SUBDIR:=lib/modules/$(LINUX_VERSION)
 LINUX_KCONFIG:=./config/$(BOARD)
@@ -38,11 +33,19 @@ TARGET_MODULES_DIR := $(TARGET_DIR)/lib/modules/$(LINUX_VERSION)
 IPKG_KERNEL:=IPKG_TMP=$(BUILD_DIR)/tmp IPKG_INSTROOT=$(LINUX_TARGET_DIR) IPKG_CONF_DIR=$(LINUX_BUILD_DIR) $(SCRIPT_DIR)/ipkg -force-defaults -force-depends
 
 PKG_BUILD_DIR := $(LINUX_BUILD_DIR)/linux-modules
-PKG_RELEASE := 1
+PKG_RELEASE := 2
 
 KERNEL_IPKG:=$(LINUX_BUILD_DIR)/kernel_$(LINUX_VERSION)-$(BOARD)-$(PKG_RELEASE)_$(ARCH).ipk
 KERNEL_IDIR:=$(LINUX_BUILD_DIR)/kernel-ipkg
 
+KPKG_MAKEOPTS:=        IPKG="$(IPKG_KERNEL)" \
+               BOARD="$(BOARD)" \
+               TARGET_DIR="$(LINUX_TARGET_DIR)" \
+               BUILD_DIR="$(LINUX_BUILD_DIR)" \
+               KERNEL_DIR="$(LINUX_SOURCE_DIR)" \
+               LINUX_VERSION="$(LINUX_VERSION)" \
+               KERNEL_RELEASE="$(PKG_RELEASE)"
+
 include $(LINUX_KCONFIG)
 
 INSTALL_TARGETS := $(KERNEL_IPKG)
@@ -69,55 +72,58 @@ $(eval $(call KMOD_template,IPTABLES_V6,ip6tables,\
 ,CONFIG_IP6_NF_IPTABLES,kmod-ipv6))
 $(eval $(call KMOD_template,IPV6,ipv6,\
        $(MODULES_DIR)/kernel/net/ipv6/ipv6.o \
-,CONFIG_IPV6))
+,CONFIG_IPV6,,20,ipv6))
 $(eval $(call KMOD_template,CIFS,cifs,\
        $(MODULES_DIR)/kernel/fs/cifs/cifs.o \
-,CONFIG_CIFS))
+,CONFIG_CIFS,,30,cifs))
 $(eval $(call KMOD_template,NFS,nfs,\
        $(MODULES_DIR)/kernel/fs/lockd/*.o \
        $(MODULES_DIR)/kernel/fs/nfs/*.o \
        $(MODULES_DIR)/kernel/net/sunrpc/*.o \
-,CONFIG_NFS_FS))
+,CONFIG_NFS_FS,,30,sunrpc lockd nfs))
 $(eval $(call KMOD_template,USB,usb-core,\
        $(MODULES_DIR)/kernel/drivers/usb/usbcore.o \
-,CONFIG_USB))
+,CONFIG_USB,,50,usbcore))
 $(eval $(call KMOD_template,USB_UHCI,usb-uhci,\
        $(MODULES_DIR)/kernel/drivers/usb/host/uhci.o \
-,CONFIG_USB_UHCI_ALT,kmod-usb-core))
+,CONFIG_USB_UHCI_ALT,kmod-usb-core,60,uhci))
 $(eval $(call KMOD_template,USB_OHCI,usb-ohci,\
        $(MODULES_DIR)/kernel/drivers/usb/host/usb-ohci.o \
-,CONFIG_USB_OHCI,kmod-usb-core))
+,CONFIG_USB_OHCI,kmod-usb-core,60,usb-ohci))
 $(eval $(call KMOD_template,USB2,usb2,\
        $(MODULES_DIR)/kernel/drivers/usb/host/ehci-hcd.o \
-,CONFIG_USB_EHCI_HCD,kmod-usb-core))
+,CONFIG_USB_EHCI_HCD,kmod-usb-core,60,ehci-hcd))
 $(eval $(call KMOD_template,USB_STORAGE,usb-storage,\
        $(MODULES_DIR)/kernel/drivers/scsi/*.o \
        $(MODULES_DIR)/kernel/drivers/usb/storage/*.o \
-,CONFIG_USB_STORAGE))
+,CONFIG_USB_STORAGE,kmod-usb-core,60,scsi_mod sd_mod usb-storage))
 $(eval $(call KMOD_template,USB_PRINTER,usb-printer,\
        $(MODULES_DIR)/kernel/drivers/usb/printer.o \
-,CONFIG_USB_PRINTER))
+,CONFIG_USB_PRINTER,kmod-usb-core,60,printer))
 $(eval $(call KMOD_template,IDE,ide,\
        $(MODULES_DIR)/kernel/drivers/ide/*.o \
        $(MODULES_DIR)/kernel/drivers/ide/*/*.o \
 ,CONFIG_IDE))
+$(eval $(call KMOD_template,LOOP,loop,\
+    $(MODULES_DIR)/kernel/drivers/block/loop.o \
+,CONFIG_BLK_DEV_LOOP,,20,loop))
 $(eval $(call KMOD_template,EXT2,ext2,\
        $(MODULES_DIR)/kernel/fs/ext2/*.o \
-,CONFIG_EXT2_FS))
+,CONFIG_EXT2_FS,,30,ext2))
 $(eval $(call KMOD_template,EXT3,ext3,\
        $(MODULES_DIR)/kernel/fs/ext3/*.o \
        $(MODULES_DIR)/kernel/fs/jbd/*.o \
-,CONFIG_EXT3_FS))
+,CONFIG_EXT3_FS,,30,jbd ext3))
 $(eval $(call KMOD_template,XFS,xfs,\
        $(MODULES_DIR)/kernel/fs/xfs/*.o \
-,CONFIG_XFS_FS))
+,CONFIG_XFS_FS,,30,xfs))
 $(eval $(call KMOD_template,HFSPLUS,hfsplus,\
        $(MODULES_DIR)/kernel/fs/hfsplus/*.o \
-,CONFIG_HFSPLUS_FS))
+,CONFIG_HFSPLUS_FS,,30,hfsplus))
 $(eval $(call KMOD_template,VFAT,vfat,\
        $(MODULES_DIR)/kernel/fs/vfat/vfat.o \
        $(MODULES_DIR)/kernel/fs/fat/fat.o \
-,CONFIG_VFAT_FS))
+,CONFIG_VFAT_FS,,30,fat vfat))
 $(eval $(call KMOD_template,CRYPTO,crypto,\
        $(MODULES_DIR)/kernel/crypto/*.o \
 ))
@@ -135,20 +141,26 @@ $(eval $(call KMOD_template,PPPOE,pppoe,\
 ,CONFIG_PPPOE))
 $(eval $(call KMOD_template,TUN,tun,\
        $(MODULES_DIR)/kernel/drivers/net/tun.o \
-,CONFIG_TUN))
+,CONFIG_TUN,,20,tun))
 $(eval $(call KMOD_template,GRE,gre,\
        $(MODULES_DIR)/kernel/net/ipv4/ip_gre.o \
 ,CONFIG_NET_IPGRE))
 $(eval $(call KMOD_template,SCHED,sched,\
        $(MODULES_DIR)/kernel/net/sched/*.o \
 ))
+$(eval $(call KMOD_template,VIDEODEV,videodev,\
+       $(MODULES_DIR)/kernel/drivers/media/video/videodev.o \
+))
+$(eval $(call KMOD_template,PWC,pwc,\
+       $(MODULES_DIR)/kernel/drivers/usb/pwc.o \
+))
 
 $(TARGETS): $(PACKAGE_DIR)
 
 $(PACKAGE_DIR):
        mkdir -p $(PACKAGE_DIR)
 
-$(LINUX_DIR)/.unpacked: $(DL_DIR)/$(LINUX_SOURCE) $(DL_DIR)/$(LINUX_BINARY_WL_DRIVER) $(DL_DIR)/$(LINUX_ET_DRIVER)
+$(LINUX_DIR)/.unpacked: $(DL_DIR)/$(LINUX_SOURCE)
        -mkdir -p $(LINUX_BUILD_DIR)
        bzcat $(DL_DIR)/$(LINUX_SOURCE) | tar -C $(LINUX_BUILD_DIR) $(TAR_OPTIONS) -
        rm -f $(LINUX_DIR)
@@ -156,15 +168,15 @@ $(LINUX_DIR)/.unpacked: $(DL_DIR)/$(LINUX_SOURCE) $(DL_DIR)/$(LINUX_BINARY_WL_DR
        touch $(LINUX_DIR)/.unpacked
 
 $(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
-       [ -d ./patches/$(BOARD) ] && $(PATCH) $(LINUX_DIR) ./patches/$(BOARD)
        $(PATCH) $(LINUX_DIR) ./patches/generic
+       [ -d ./patches/$(BOARD) ] && $(PATCH) $(LINUX_DIR) ./patches/$(BOARD)
        touch $(LINUX_DIR)/.patched
 
 $(LINUX_DIR)/.configured: $(LINUX_DIR)/.patched
        -cp $(LINUX_KCONFIG) $(LINUX_DIR)/.config
        $(SED) "s,^CROSS_COMPILE.*,CROSS_COMPILE=$(KERNEL_CROSS),g;" \
          $(LINUX_DIR)/Makefile  \
-         $(LINUX_DIR)/arch/mips/Makefile
+         $(LINUX_DIR)/arch/*/Makefile
        $(SED) "s,\-mcpu=,\-mtune=,g;" $(LINUX_DIR)/arch/mips/Makefile
        $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_KARCH) oldconfig include/linux/version.h
        touch $(LINUX_DIR)/.configured
@@ -191,6 +203,15 @@ $(STAGING_DIR)/include/linux/version.h: $(LINUX_DIR)/.configured
        tar -ch -C $(LINUX_DIR)/include -f - linux | tar -xf - -C $(STAGING_DIR)/include/
        tar -ch -C $(LINUX_DIR)/include -f - asm | tar -xf - -C $(STAGING_DIR)/include/
 
+$(STAMP_DIR)/.linux-compile: $(LINUX_DIR)/.modules_done
+       @mkdir -p $(STAMP_DIR)
+       @$(MAKE) $(TARGETS)
+       ln -sf $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION) $(LINUX_DIR)
+       $(MAKE) -C $(TOPDIR)/target/linux/package \
+               $(KPKG_MAKEOPTS) \
+               compile
+       touch $@
+
 $(TARGET_MODULES_DIR): 
        -mkdir -p $(TARGET_MODULES_DIR)
 
@@ -205,24 +226,25 @@ $(KERNEL_IPKG):
 
 source: $(DL_DIR)/$(LINUX_SOURCE)
 prepare: $(LINUX_DIR)/.configured
-compile: $(LINUX_DIR)/.modules_done $(TARGETS)
-       ln -sf $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION) $(LINUX_DIR)
-       $(MAKE) -C $(TOPDIR)/target/linux/package \
-               BOARD="$(BOARD)" \
-               TARGET_DIR="$(LINUX_TARGET_DIR)" \
-               BUILD_DIR="$(LINUX_BUILD_DIR)" \
-               KERNEL_DIR="$(LINUX_SOURCE_DIR)" \
-               LINUX_VERSION="$(LINUX_VERSION)" \
-               KERNEL_RELEASE="$(PKG_RELEASE)"
+compile: $(STAMP_DIR)/.linux-compile
 
 install: compile $(TARGET_MODULES_DIR) $(KERNEL_IPKG)
        rm -rf $(LINUX_BUILD_DIR)/root*
-       cp -a $(BUILD_DIR)/root $(LINUX_BUILD_DIR)/
        echo -e 'dest root /\noption offline_root $(LINUX_BUILD_DIR)/root' > $(LINUX_BUILD_DIR)/ipkg.conf
+       $(MAKE) -C $(TOPDIR)/package \
+               TARGET_DIR="$(LINUX_TARGET_DIR)" \
+               IPKG_CONF="$(LINUX_BUILD_DIR)" \
+               BOARD="$(BOARD)" \
+               install
+       $(MAKE) -C $(TOPDIR)/target/linux/package \
+               $(KPKG_MAKEOPTS) \
+               install
        [ "$(INSTALL_TARGETS)" != "" ] && $(IPKG_KERNEL) install $(INSTALL_TARGETS) || true
 
 mostlyclean:
-       rm -f $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION)/.{drivers-unpacked,modules_done}
+       rm -f $(STAMP_DIR)/.linux-compile
+       rm -f $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION)/.modules_done
+       rm -f $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION)/.drivers-unpacked
        $(MAKE) -C $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION) clean
        rm -f $(LINUX_KERNEL) $(LINUX_IMAGE)
 
@@ -234,5 +256,6 @@ rebuild:
        $(MAKE) compile
 
 clean:
+       rm -f $(STAMP_DIR)/.linux-compile
        rm -rf $(LINUX_BUILD_DIR)
        rm -f $(TARGETS)
index 203262a6a11f8514d5dd4be5a62e92daeecf2f2e..0c379ec960647ac0e0e71764f1d609eab2f4cbb7 100644 (file)
@@ -19,14 +19,15 @@ $(eval $(call KMOD_template,LP,lp,\
        $(MODULES_DIR)/kernel/drivers/parport/parport.o \
        $(MODULES_DIR)/kernel/drivers/parport/parport_splink.o \
        $(MODULES_DIR)/kernel/drivers/char/lp.o \
-,CONFIG_PARPORT))
+       $(MODULES_DIR)/kernel/drivers/char/ppdev.o \
+,CONFIG_PARPORT,,50,parport parport_splink lp))
 
 LINUX_BINARY_DRIVER_SITE=http://openwrt.org/downloads/sources
-# proprietary driver, extracted from asus GPL sourcetree GPL_1941.zip
-LINUX_BINARY_WL_DRIVER=kernel-binary-wl-0.3.tar.gz
-LINUX_BINARY_WL_MD5SUM=cc45df670bcfb4e74a709b9d7beba636
-LINUX_ET_DRIVER=kernel-source-et-0.10.tar.gz
-LINUX_ET_MD5SUM=408901f0b3c672ea0f353795391f07f6
+# proprietary driver, extracted from Linksys GPL sourcetree WRT54GS 4.70.6
+LINUX_BINARY_WL_DRIVER=kernel-binary-wl-0.4.tar.gz
+LINUX_BINARY_WL_MD5SUM=0659fa8f1805be6ec03188ef8e1216cc
+LINUX_ET_DRIVER=kernel-source-et-0.11.tar.gz
+LINUX_ET_MD5SUM=bdc23ab59440793e35cab039457f6358
 
 $(DL_DIR)/$(LINUX_BINARY_WL_DRIVER):
        $(SCRIPT_DIR)/download.pl $(DL_DIR) $(LINUX_BINARY_WL_DRIVER) $(LINUX_BINARY_WL_MD5SUM) $(LINUX_BINARY_DRIVER_SITE)
@@ -37,7 +38,7 @@ $(DL_DIR)/$(LINUX_ET_DRIVER):
 $(LINUX_DIR)/.depend_done: $(LINUX_DIR)/.drivers-unpacked
 $(LINUX_DIR)/.modules_done: $(LINUX_DIR)/.drivers-unpacked
 
-$(LINUX_DIR)/.drivers-unpacked: $(LINUX_DIR)/.unpacked
+$(LINUX_DIR)/.drivers-unpacked: $(LINUX_DIR)/.unpacked $(DL_DIR)/$(LINUX_BINARY_WL_DRIVER) $(DL_DIR)/$(LINUX_ET_DRIVER)
        -mkdir -p $(BUILD_DIR)
        zcat $(DL_DIR)/$(LINUX_BINARY_WL_DRIVER) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
        zcat $(DL_DIR)/$(LINUX_ET_DRIVER) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
index a27a0758c5e237eec39197a58acfb15b4fed9cb1..b3842487c9d517cbf4bb6b48b5816e306d7e29da 100644 (file)
@@ -316,7 +316,7 @@ CONFIG_PACKET_MMAP=y
 CONFIG_NETLINK_DEV=m
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
-# CONFIG_FILTER is not set
+CONFIG_FILTER=y
 CONFIG_UNIX=y
 CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
@@ -340,6 +340,7 @@ CONFIG_NET_IPGRE=m
 #   IP: Netfilter Configuration
 #
 CONFIG_IP_NF_CONNTRACK=y
+CONFIG_IP_NF_CONNTRACK_MARK=y
 CONFIG_IP_NF_FTP=y
 CONFIG_IP_NF_AMANDA=m
 CONFIG_IP_NF_TFTP=m
@@ -365,12 +366,12 @@ CONFIG_IP_NF_MATCH_TCPMSS=y
 CONFIG_IP_NF_MATCH_HELPER=m
 CONFIG_IP_NF_MATCH_STATE=y
 CONFIG_IP_NF_MATCH_CONNTRACK=m
+CONFIG_IP_NF_MATCH_CONNMARK=m
 CONFIG_IP_NF_MATCH_UNCLEAN=m
 CONFIG_IP_NF_MATCH_OWNER=m
 CONFIG_IP_NF_MATCH_LAYER7=m
 # CONFIG_IP_NF_MATCH_LAYER7_DEBUG is not set
 CONFIG_IP_NF_MATCH_LAYER7_MAXDATALEN=2048
-# CONFIG_IP_NF_MATCH_PHYSDEV is not set
 CONFIG_IP_NF_FILTER=y
 CONFIG_IP_NF_TARGET_REJECT=y
 CONFIG_IP_NF_TARGET_MIRROR=m
@@ -390,6 +391,7 @@ CONFIG_IP_NF_TARGET_TOS=m
 CONFIG_IP_NF_TARGET_ECN=m
 CONFIG_IP_NF_TARGET_DSCP=m
 CONFIG_IP_NF_TARGET_MARK=y
+CONFIG_IP_NF_TARGET_CONNMARK=m
 CONFIG_IP_NF_TARGET_LOG=y
 CONFIG_IP_NF_TARGET_TTL=m
 CONFIG_IP_NF_TARGET_ULOG=m
@@ -438,26 +440,6 @@ CONFIG_VLAN_8021Q=y
 # CONFIG_ATALK is not set
 # CONFIG_DECNET is not set
 CONFIG_BRIDGE=y
-CONFIG_BRIDGE_NF_EBTABLES=m
-CONFIG_BRIDGE_EBT_T_FILTER=m
-CONFIG_BRIDGE_EBT_T_NAT=m
-CONFIG_BRIDGE_EBT_BROUTE=m
-CONFIG_BRIDGE_EBT_LOG=m
-CONFIG_BRIDGE_EBT_LOG=m
-CONFIG_BRIDGE_EBT_IPF=m
-CONFIG_BRIDGE_EBT_ARPF=m
-CONFIG_BRIDGE_EBT_AMONG=m
-CONFIG_BRIDGE_EBT_LIMIT=m
-CONFIG_BRIDGE_EBT_VLANF=m
-CONFIG_BRIDGE_EBT_802_3=m
-CONFIG_BRIDGE_EBT_PKTTYPE=m
-CONFIG_BRIDGE_EBT_STP=m
-CONFIG_BRIDGE_EBT_MARKF=m
-CONFIG_BRIDGE_EBT_ARPREPLY=m
-CONFIG_BRIDGE_EBT_SNAT=m
-CONFIG_BRIDGE_EBT_DNAT=m
-CONFIG_BRIDGE_EBT_REDIRECT=m
-CONFIG_BRIDGE_EBT_MARK_T=m
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
 # CONFIG_LLC is not set
@@ -595,7 +577,7 @@ CONFIG_SD_EXTRA_DEVS=5
 # CONFIG_BLK_DEV_SR is not set
 CONFIG_CHR_DEV_SG=m
 # CONFIG_SCSI_DEBUG_QUEUES is not set
-# CONFIG_SCSI_MULTI_LUN is not set
+CONFIG_SCSI_MULTI_LUN=y
 # CONFIG_SCSI_CONSTANTS is not set
 # CONFIG_SCSI_LOGGING is not set
 
@@ -857,7 +839,7 @@ CONFIG_UNIX98_PTYS=y
 CONFIG_UNIX98_PTY_COUNT=128
 CONFIG_PRINTER=m
 # CONFIG_LP_CONSOLE is not set
-# CONFIG_PPDEV is not set
+CONFIG_PPDEV=m
 # CONFIG_TIPAR is not set
 
 #
@@ -1092,7 +1074,35 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 #
 # Multimedia devices
 #
-# CONFIG_VIDEO_DEV is not set
+CONFIG_VIDEO_DEV=m
+
+#
+# Video For Linux
+#
+CONFIG_VIDEO_PROC_FS=y
+# CONFIG_I2C_PARPORT is not set
+# CONFIG_VIDEO_BT848 is not set
+# CONFIG_VIDEO_PMS is not set
+# CONFIG_VIDEO_BWQCAM is not set
+# CONFIG_VIDEO_CQCAM is not set
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_SAA5249 is not set
+# CONFIG_TUNER_3036 is not set
+# CONFIG_VIDEO_STRADIS is not set
+# CONFIG_VIDEO_ZORAN is not set
+# CONFIG_VIDEO_ZORAN_BUZ is not set
+# CONFIG_VIDEO_ZORAN_DC10 is not set
+# CONFIG_VIDEO_ZORAN_LML33 is not set
+# CONFIG_VIDEO_ZR36120 is not set
+# CONFIG_VIDEO_MEYE is not set
+
+#
+# Radio Adapters
+#
+# CONFIG_RADIO_GEMTEK_PCI is not set
+# CONFIG_RADIO_MAXIRADIO is not set
+# CONFIG_RADIO_MAESTRO is not set
+# CONFIG_RADIO_MIROPCM20 is not set
 
 #
 # Sound
@@ -1140,6 +1150,16 @@ CONFIG_USB_PRINTER=m
 # CONFIG_USB_SCANNER is not set
 # CONFIG_USB_MICROTEK is not set
 # CONFIG_USB_HPUSBSCSI is not set
+# CONFIG_USB_IBMCAM is not set
+# CONFIG_USB_KONICAWC is not set
+# CONFIG_USB_OV511 is not set
+CONFIG_USB_PWC=m
+# CONFIG_USB_SE401 is not set
+# CONFIG_USB_STV680 is not set
+# CONFIG_USB_W9968CF is not set
+# CONFIG_USB_VICAM is not set
+# CONFIG_USB_DSBR is not set
+# CONFIG_USB_DABUSB is not set
 # CONFIG_USB_PEGASUS is not set
 # CONFIG_USB_RTL8150 is not set
 # CONFIG_USB_KAWETH is not set
index 5e3fc34fe6457e6bec628f3877b2a2d33b8c42f6..26f51d794954f1b4b5379849438c7339a48ac2f6 100644 (file)
@@ -1,6 +1,167 @@
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/compressed/Makefile linux-2.4.30-brcm/arch/mips/bcm947xx/compressed/Makefile
---- linux-2.4.30/arch/mips/bcm947xx/compressed/Makefile        1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/compressed/Makefile   2005-05-26 03:29:22.000000000 +0200
+diff -urN linux.old/Makefile linux.dev/Makefile
+--- linux.old/Makefile 2005-08-26 13:41:41.689634168 +0200
++++ linux.dev/Makefile 2005-08-26 13:44:34.233403528 +0200
+@@ -17,9 +17,9 @@
+ FINDHPATH     = $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net $(HPATH)/math-emu
+ HOSTCC        = gcc
+-HOSTCFLAGS    = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
++HOSTCFLAGS    = -Wall -Wstrict-prototypes -Os -fomit-frame-pointer
+-CROSS_COMPILE         =
++CROSS_COMPILE=
+ #
+ # Include the make variables (CC, etc...)
+@@ -91,8 +91,10 @@
+ CPPFLAGS := -D__KERNEL__ -I$(HPATH)
+-CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
++CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -Os \
+         -fno-strict-aliasing -fno-common
++
++
+ ifndef CONFIG_FRAME_POINTER
+ CFLAGS += -fomit-frame-pointer
+ endif
+@@ -354,7 +356,7 @@
+       @rm -f .ver1
+ include/linux/version.h: ./Makefile
+-      @expr length "$(KERNELRELEASE)" \<= $(uts_len) > /dev/null || \
++      @-expr length "$(KERNELRELEASE)" \<= $(uts_len) > /dev/null || \
+         (echo KERNELRELEASE \"$(KERNELRELEASE)\" exceeds $(uts_len) characters >&2; false)
+       @echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" > .ver
+       @echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> .ver
+@@ -501,7 +503,7 @@
+ ifdef CONFIG_MODVERSIONS
+       $(MAKE) update-modverfile
+ endif
+-      scripts/mkdep -- `find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend
++      (find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print | xargs -r scripts/mkdep -- ) > .hdepend
+       scripts/mkdep -- init/*.c > .depend
+ ifdef CONFIG_MODVERSIONS
+diff -urN linux.old/Rules.make linux.dev/Rules.make
+--- linux.old/Rules.make       2004-02-18 14:36:30.000000000 +0100
++++ linux.dev/Rules.make       2005-08-26 13:44:34.252400640 +0200
+@@ -176,7 +176,14 @@
+ _modinst__: dummy
+ ifneq "$(strip $(ALL_MOBJS))" ""
+       mkdir -p $(MODLIB)/kernel/$(MOD_DESTDIR)
+-      cp $(sort $(ALL_MOBJS)) $(MODLIB)/kernel/$(MOD_DESTDIR)
++      #@cp $(sort $(ALL_MOBJS)) $(MODLIB)/kernel/$(MOD_DESTDIR)
++      for f in $(ALL_MOBJS) ; do \
++              $(OBJCOPY) -R __ksymtab -R .comment -R .note -x \
++              `$(NM) $$f | cut -f3- -d' ' | sed -n \
++                      -e 's/__module_parm_\(.*\)/-K \1/p' \
++                      -e 's/__ks..tab_\(.*\)/-K \1/p'` \
++              $$f $(MODLIB)/kernel/$(MOD_DESTDIR)$(MOD_TARGET)$$f; \
++      done
+ endif
+ .PHONY: modules_install
+diff -urN linux.old/arch/mips/Makefile linux.dev/arch/mips/Makefile
+--- linux.old/arch/mips/Makefile       2005-08-26 13:41:41.690634016 +0200
++++ linux.dev/arch/mips/Makefile       2005-08-26 13:44:34.253400488 +0200
+@@ -46,10 +46,10 @@
+ GCCFLAGS      := -I $(TOPDIR)/include/asm/gcc
+ GCCFLAGS      += -G 0 -mno-abicalls -fno-pic -pipe
+ GCCFLAGS      += $(call check_gcc, -finline-limit=100000,)
+-LINKFLAGS     += -G 0 -static -n
+-MODFLAGS      += -mlong-calls
++LINKFLAGS     += -G 0 -static -n -nostdlib
++MODFLAGS      += -mlong-calls -fno-common
+-ifdef CONFIG_DEBUG_INFO
++ifdef CONFIG_REMOTE_DEBUG
+ GCCFLAGS      += -g
+ ifdef CONFIG_SB1XXX_CORELIS
+ GCCFLAGS      += -mno-sched-prolog -fno-omit-frame-pointer
+@@ -71,13 +71,13 @@
+ set_gccflags = $(shell \
+ while :; do \
+       cpu=$(1); isa=-$(2); \
+-      for gcc_opt in -march= -mcpu=; do \
++      for gcc_opt in -march= -mtune=; do \
+               $(CC) $$gcc_opt$$cpu $$isa -S -o /dev/null \
+                       -xc /dev/null > /dev/null 2>&1 && \
+                       break 2; \
+       done; \
+       cpu=$(3); isa=-$(4); \
+-      for gcc_opt in -march= -mcpu=; do \
++      for gcc_opt in -march= -mtune=; do \
+               $(CC) $$gcc_opt$$cpu $$isa -S -o /dev/null \
+                       -xc /dev/null > /dev/null 2>&1 && \
+                       break 2; \
+@@ -92,7 +92,7 @@
+ fi; \
+ gas_abi=-Wa,-32; gas_cpu=$$cpu; gas_isa=-Wa,$$isa; \
+ while :; do \
+-      for gas_opt in -Wa,-march= -Wa,-mcpu=; do \
++      for gas_opt in -Wa,-march= -Wa,-mtune=; do \
+               $(CC) $$gas_abi $$gas_opt$$cpu $$gas_isa -Wa,-Z -c \
+                       -o /dev/null -xassembler /dev/null > /dev/null 2>&1 && \
+                       break 2; \
+@@ -174,6 +174,7 @@
+ endif
+ AFLAGS                += $(GCCFLAGS)
++ASFLAGS               += $(GCCFLAGS)
+ CFLAGS                += $(GCCFLAGS)
+ LD            += -m $(ld-emul)
+@@ -727,6 +728,19 @@
+ endif
+ #
++# Broadcom BCM947XX variants
++#
++ifdef CONFIG_BCM947XX
++LIBS          += arch/mips/bcm947xx/generic/brcm.o arch/mips/bcm947xx/bcm947xx.o 
++SUBDIRS               += arch/mips/bcm947xx/generic arch/mips/bcm947xx 
++LOADADDR      := 0x80001000
++
++zImage: vmlinux
++      $(MAKE) -C arch/$(ARCH)/bcm947xx/compressed
++export LOADADDR
++endif
++
++#
+ # Choosing incompatible machines durings configuration will result in
+ # error messages during linking.  Select a default linkscript if
+ # none has been choosen above.
+@@ -779,6 +793,7 @@
+       $(MAKE) -C arch/$(ARCH)/tools clean
+       $(MAKE) -C arch/mips/baget clean
+       $(MAKE) -C arch/mips/lasat clean
++      $(MAKE) -C arch/mips/bcm947xx/compressed clean
+ archmrproper:
+       @$(MAKEBOOT) mrproper
+diff -urN linux.old/arch/mips/bcm947xx/Makefile linux.dev/arch/mips/bcm947xx/Makefile
+--- linux.old/arch/mips/bcm947xx/Makefile      1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/Makefile      2005-08-26 13:44:34.262399120 +0200
+@@ -0,0 +1,15 @@
++#
++# Makefile for the BCM947xx specific kernel interface routines
++# under Linux.
++#
++
++EXTRA_CFLAGS+=-I$(TOPDIR)/arch/mips/bcm947xx/include -DBCMDRIVER
++
++O_TARGET        := bcm947xx.o
++
++export-objs     := nvram_linux.o setup.o
++obj-y         := prom.o setup.o time.o sbmips.o gpio.o
++obj-y         += nvram.o nvram_linux.o
++obj-$(CONFIG_PCI) += sbpci.o pcibios.o
++
++include $(TOPDIR)/Rules.make
+diff -urN linux.old/arch/mips/bcm947xx/compressed/Makefile linux.dev/arch/mips/bcm947xx/compressed/Makefile
+--- linux.old/arch/mips/bcm947xx/compressed/Makefile   1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/compressed/Makefile   2005-08-26 13:44:34.262399120 +0200
 @@ -0,0 +1,33 @@
 +#
 +# Makefile for Broadcom BCM947XX boards
@@ -35,9 +196,28 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/compressed/Makefile linux-2.4.30-brcm/
 +
 +clean:
 +      rm -f vmlinuz piggy
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/generic/int-handler.S linux-2.4.30-brcm/arch/mips/bcm947xx/generic/int-handler.S
---- linux-2.4.30/arch/mips/bcm947xx/generic/int-handler.S      1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/generic/int-handler.S 2005-05-22 22:55:51.000000000 +0200
+diff -urN linux.old/arch/mips/bcm947xx/generic/Makefile linux.dev/arch/mips/bcm947xx/generic/Makefile
+--- linux.old/arch/mips/bcm947xx/generic/Makefile      1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/generic/Makefile      2005-08-26 13:44:34.263398968 +0200
+@@ -0,0 +1,15 @@
++#
++# Makefile for the BCM947xx specific kernel interface routines
++# under Linux.
++#
++
++.S.s:
++      $(CPP) $(AFLAGS) $< -o $*.s
++.S.o:
++      $(CC) $(AFLAGS) -c $< -o $*.o
++
++O_TARGET        := brcm.o
++
++obj-y := int-handler.o irq.o
++
++include $(TOPDIR)/Rules.make
+diff -urN linux.old/arch/mips/bcm947xx/generic/int-handler.S linux.dev/arch/mips/bcm947xx/generic/int-handler.S
+--- linux.old/arch/mips/bcm947xx/generic/int-handler.S 1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/generic/int-handler.S 2005-08-26 13:44:34.263398968 +0200
 @@ -0,0 +1,51 @@
 +/*
 + * Generic interrupt handler for Broadcom MIPS boards
@@ -90,9 +270,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/generic/int-handler.S linux-2.4.30-brc
 +       nop
 +              
 +      END(brcmIRQ)
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/generic/irq.c linux-2.4.30-brcm/arch/mips/bcm947xx/generic/irq.c
---- linux-2.4.30/arch/mips/bcm947xx/generic/irq.c      1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/generic/irq.c 2005-05-22 22:55:51.000000000 +0200
+diff -urN linux.old/arch/mips/bcm947xx/generic/irq.c linux.dev/arch/mips/bcm947xx/generic/irq.c
+--- linux.old/arch/mips/bcm947xx/generic/irq.c 1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/generic/irq.c 2005-08-26 13:44:34.263398968 +0200
 @@ -0,0 +1,130 @@
 +/*
 + * Generic interrupt control functions for Broadcom MIPS boards
@@ -224,28 +404,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/generic/irq.c linux-2.4.30-brcm/arch/m
 +      breakpoint(); 
 +#endif
 +}
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/generic/Makefile linux-2.4.30-brcm/arch/mips/bcm947xx/generic/Makefile
---- linux-2.4.30/arch/mips/bcm947xx/generic/Makefile   1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/generic/Makefile      2005-05-25 18:53:41.000000000 +0200
-@@ -0,0 +1,15 @@
-+#
-+# Makefile for the BCM947xx specific kernel interface routines
-+# under Linux.
-+#
-+
-+.S.s:
-+      $(CPP) $(AFLAGS) $< -o $*.s
-+.S.o:
-+      $(CC) $(AFLAGS) -c $< -o $*.o
-+
-+O_TARGET        := brcm.o
-+
-+obj-y := int-handler.o irq.o
-+
-+include $(TOPDIR)/Rules.make
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/gpio.c linux-2.4.30-brcm/arch/mips/bcm947xx/gpio.c
---- linux-2.4.30/arch/mips/bcm947xx/gpio.c     1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/gpio.c        2005-05-22 22:55:51.000000000 +0200
+diff -urN linux.old/arch/mips/bcm947xx/gpio.c linux.dev/arch/mips/bcm947xx/gpio.c
+--- linux.old/arch/mips/bcm947xx/gpio.c        1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/gpio.c        2005-08-26 13:44:34.264398816 +0200
 @@ -0,0 +1,158 @@
 +/*
 + * GPIO char driver
@@ -405,9 +566,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/gpio.c linux-2.4.30-brcm/arch/mips/bcm
 +
 +module_init(gpio_init);
 +module_exit(gpio_exit);
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/bcmdevs.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/bcmdevs.h
---- linux-2.4.30/arch/mips/bcm947xx/include/bcmdevs.h  1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/bcmdevs.h     2005-05-25 20:30:26.000000000 +0200
+diff -urN linux.old/arch/mips/bcm947xx/include/bcmdevs.h linux.dev/arch/mips/bcm947xx/include/bcmdevs.h
+--- linux.old/arch/mips/bcm947xx/include/bcmdevs.h     1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/bcmdevs.h     2005-08-26 13:44:34.265398664 +0200
 @@ -0,0 +1,369 @@
 +/*
 + * Broadcom device-specific manifest constants.
@@ -778,9 +939,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/bcmdevs.h linux-2.4.30-brcm/ar
 +#define GPIO_NUMPINS          16
 +
 +#endif /* _BCMDEVS_H */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/bcmendian.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/bcmendian.h
---- linux-2.4.30/arch/mips/bcm947xx/include/bcmendian.h        1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/bcmendian.h   2005-02-02 23:16:39.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/bcmendian.h linux.dev/arch/mips/bcm947xx/include/bcmendian.h
+--- linux.old/arch/mips/bcm947xx/include/bcmendian.h   1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/bcmendian.h   2005-08-26 13:44:34.269398056 +0200
 @@ -0,0 +1,168 @@
 +/*
 + * local version of endian.h - byte order defines
@@ -950,9 +1111,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/bcmendian.h linux-2.4.30-brcm/
 +#endif
 +
 +#endif /* _BCMENDIAN_H_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/bcmenet47xx.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/bcmenet47xx.h
---- linux-2.4.30/arch/mips/bcm947xx/include/bcmenet47xx.h      1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/bcmenet47xx.h 2005-02-02 23:16:39.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/bcmenet47xx.h linux.dev/arch/mips/bcm947xx/include/bcmenet47xx.h
+--- linux.old/arch/mips/bcm947xx/include/bcmenet47xx.h 1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/bcmenet47xx.h 2005-08-26 13:44:34.270397904 +0200
 @@ -0,0 +1,229 @@
 +/*
 + * Hardware-specific definitions for
@@ -1183,9 +1344,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/bcmenet47xx.h linux-2.4.30-brc
 +#define       EMC_RZ          ((uint32)1 << 0)        /* autoclear on read */
 +
 +#endif        /* _bcmenet_47xx_h_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/bcmenetmib.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/bcmenetmib.h
---- linux-2.4.30/arch/mips/bcm947xx/include/bcmenetmib.h       1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/bcmenetmib.h  2005-02-02 23:16:39.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/bcmenetmib.h linux.dev/arch/mips/bcm947xx/include/bcmenetmib.h
+--- linux.old/arch/mips/bcm947xx/include/bcmenetmib.h  1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/bcmenetmib.h  2005-08-26 13:44:34.278396688 +0200
 @@ -0,0 +1,81 @@
 +/*
 + * Hardware-specific MIB definition for
@@ -1268,9 +1429,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/bcmenetmib.h linux-2.4.30-brcm
 +} bcmenetmib_t;
 +
 +#endif        /* _bcmenetmib_h_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/bcmenetphy.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/bcmenetphy.h
---- linux-2.4.30/arch/mips/bcm947xx/include/bcmenetphy.h       1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/bcmenetphy.h  2005-02-02 23:16:39.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/bcmenetphy.h linux.dev/arch/mips/bcm947xx/include/bcmenetphy.h
+--- linux.old/arch/mips/bcm947xx/include/bcmenetphy.h  1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/bcmenetphy.h  2005-08-26 13:44:34.278396688 +0200
 @@ -0,0 +1,58 @@
 +/*
 + * Misc Broadcom BCM47XX MDC/MDIO enet phy definitions.
@@ -1330,9 +1491,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/bcmenetphy.h linux-2.4.30-brcm
 +#define       AUX_DUPLEX      (1 << 0)                /* duplex 0=half 1=full */
 +
 +#endif        /* _bcmenetphy_h_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/bcmenetrxh.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/bcmenetrxh.h
---- linux-2.4.30/arch/mips/bcm947xx/include/bcmenetrxh.h       1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/bcmenetrxh.h  2005-02-02 23:16:39.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/bcmenetrxh.h linux.dev/arch/mips/bcm947xx/include/bcmenetrxh.h
+--- linux.old/arch/mips/bcm947xx/include/bcmenetrxh.h  1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/bcmenetrxh.h  2005-08-26 13:44:34.278396688 +0200
 @@ -0,0 +1,43 @@
 +/*
 + * Hardware-specific Receive Data Header for the
@@ -1377,9 +1538,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/bcmenetrxh.h linux-2.4.30-brcm
 +#define       RXF_OV          ((uint16)1 << 0)        /* fifo overflow */
 +
 +#endif        /* _bcmenetrxh_h_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/bcmnvram.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/bcmnvram.h
---- linux-2.4.30/arch/mips/bcm947xx/include/bcmnvram.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/bcmnvram.h    2005-02-02 23:16:39.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/bcmnvram.h linux.dev/arch/mips/bcm947xx/include/bcmnvram.h
+--- linux.old/arch/mips/bcm947xx/include/bcmnvram.h    1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/bcmnvram.h    2005-08-26 13:44:34.279396536 +0200
 @@ -0,0 +1,132 @@
 +/*
 + * NVRAM variable manipulation
@@ -1513,9 +1674,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/bcmnvram.h linux-2.4.30-brcm/a
 +#define NVRAM_SPACE           0x8000
 +
 +#endif /* _bcmnvram_h_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/bcmparams.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/bcmparams.h
---- linux-2.4.30/arch/mips/bcm947xx/include/bcmparams.h        1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/bcmparams.h   2005-02-02 23:16:39.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/bcmparams.h linux.dev/arch/mips/bcm947xx/include/bcmparams.h
+--- linux.old/arch/mips/bcm947xx/include/bcmparams.h   1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/bcmparams.h   2005-08-26 13:44:34.279396536 +0200
 @@ -0,0 +1,23 @@
 +/*
 + * Misc system wide parameters.
@@ -1540,9 +1701,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/bcmparams.h linux-2.4.30-brcm/
 +#define DEV_NUMIFS    16      /* Max. # of devices/interfaces supported */
 +
 +#endif
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/bcmsrom.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/bcmsrom.h
---- linux-2.4.30/arch/mips/bcm947xx/include/bcmsrom.h  1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/bcmsrom.h     2005-02-02 23:16:39.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/bcmsrom.h linux.dev/arch/mips/bcm947xx/include/bcmsrom.h
+--- linux.old/arch/mips/bcm947xx/include/bcmsrom.h     1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/bcmsrom.h     2005-08-26 13:44:34.280396384 +0200
 @@ -0,0 +1,22 @@
 +/*
 + * Misc useful routines to access NIC local SROM/OTP .
@@ -1566,9 +1727,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/bcmsrom.h linux-2.4.30-brcm/ar
 +extern int srom_write(uint bus, void *curmap, void *osh, uint byteoff, uint nbytes, uint16 *buf);
 +         
 +#endif        /* _bcmsrom_h_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/bcmutils.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/bcmutils.h
---- linux-2.4.30/arch/mips/bcm947xx/include/bcmutils.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/bcmutils.h    2005-02-02 23:16:39.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/bcmutils.h linux.dev/arch/mips/bcm947xx/include/bcmutils.h
+--- linux.old/arch/mips/bcm947xx/include/bcmutils.h    1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/bcmutils.h    2005-08-26 13:44:34.280396384 +0200
 @@ -0,0 +1,239 @@
 +/*
 + * Misc useful os-independent macros and functions.
@@ -1809,9 +1970,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/bcmutils.h linux-2.4.30-brcm/a
 +#define       mboolmaskset(mb, mask, val)     ((mb) = (((mb) & ~(mask)) | (val)))
 +
 +#endif        /* _bcmutils_h_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/bitfuncs.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/bitfuncs.h
---- linux-2.4.30/arch/mips/bcm947xx/include/bitfuncs.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/bitfuncs.h    2005-02-02 23:16:39.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/bitfuncs.h linux.dev/arch/mips/bcm947xx/include/bitfuncs.h
+--- linux.old/arch/mips/bcm947xx/include/bitfuncs.h    1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/bitfuncs.h    2005-08-26 13:44:34.281396232 +0200
 @@ -0,0 +1,85 @@
 +/*
 + * bit manipulation utility functions
@@ -1898,9 +2059,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/bitfuncs.h linux-2.4.30-brcm/a
 +#endif
 +
 +#endif /* _BITFUNCS_H */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/cfe_osl.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/cfe_osl.h
---- linux-2.4.30/arch/mips/bcm947xx/include/cfe_osl.h  1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/cfe_osl.h     2005-02-02 23:16:39.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/cfe_osl.h linux.dev/arch/mips/bcm947xx/include/cfe_osl.h
+--- linux.old/arch/mips/bcm947xx/include/cfe_osl.h     1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/cfe_osl.h     2005-08-26 13:44:34.281396232 +0200
 @@ -0,0 +1,184 @@
 +/*
 + * CFE boot loader OS Abstraction Layer.
@@ -2086,9 +2247,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/cfe_osl.h linux-2.4.30-brcm/ar
 +extern struct lbuf *osl_pktdup(struct lbuf *lb);
 +
 +#endif        /* _cfe_osl_h_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/epivers.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/epivers.h
---- linux-2.4.30/arch/mips/bcm947xx/include/epivers.h  1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/epivers.h     2005-02-02 23:16:39.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/epivers.h linux.dev/arch/mips/bcm947xx/include/epivers.h
+--- linux.old/arch/mips/bcm947xx/include/epivers.h     1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/epivers.h     2005-08-26 13:44:34.282396080 +0200
 @@ -0,0 +1,69 @@
 +/*
 + * Copyright 2005, Broadcom Corporation
@@ -2159,9 +2320,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/epivers.h linux-2.4.30-brcm/ar
 +#define       EPI_ROUTER_VERSION_STR  "3.91.23.0"
 +
 +#endif /* _epivers_h_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/epivers.h.in linux-2.4.30-brcm/arch/mips/bcm947xx/include/epivers.h.in
---- linux-2.4.30/arch/mips/bcm947xx/include/epivers.h.in       1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/epivers.h.in  2005-02-02 23:16:39.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/epivers.h.in linux.dev/arch/mips/bcm947xx/include/epivers.h.in
+--- linux.old/arch/mips/bcm947xx/include/epivers.h.in  1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/epivers.h.in  2005-08-26 13:44:34.282396080 +0200
 @@ -0,0 +1,69 @@
 +/*
 + * Copyright 2005, Broadcom Corporation
@@ -2232,9 +2393,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/epivers.h.in linux-2.4.30-brcm
 +#define       EPI_ROUTER_VERSION_STR  "@EPI_ROUTER_VERSION_STR@"
 +
 +#endif /* _epivers_h_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/etsockio.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/etsockio.h
---- linux-2.4.30/arch/mips/bcm947xx/include/etsockio.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/etsockio.h    2005-02-02 23:16:39.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/etsockio.h linux.dev/arch/mips/bcm947xx/include/etsockio.h
+--- linux.old/arch/mips/bcm947xx/include/etsockio.h    1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/etsockio.h    2005-08-26 13:44:34.283395928 +0200
 @@ -0,0 +1,59 @@
 +/*
 + * Driver-specific socket ioctls
@@ -2295,9 +2456,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/etsockio.h linux-2.4.30-brcm/a
 +};
 +
 +#endif
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/flash.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/flash.h
---- linux-2.4.30/arch/mips/bcm947xx/include/flash.h    1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/flash.h       2005-02-02 23:16:39.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/flash.h linux.dev/arch/mips/bcm947xx/include/flash.h
+--- linux.old/arch/mips/bcm947xx/include/flash.h       1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/flash.h       2005-08-27 02:56:56.458670688 +0200
 @@ -0,0 +1,188 @@
 +/*
 + * flash.h: Common definitions for flash access.
@@ -2464,7 +2625,7 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/flash.h linux-2.4.30-brcm/arch
 +      { 0x0001, 0x2249, 0x0200000, 2, AMD, 0x10000, 32,  1, 31,  4, amd4112, "AMD 29lv160DB 1Mx16 BotB" },
 +      { 0x0001, 0x22f6, 0x0400000, 2, AMD, 0x10000, 64,  0, 62,  8, blk8x8k, "AMD 29lv320DT 2Mx16 TopB" },
 +      { 0x0001, 0x22f9, 0x0400000, 2, AMD, 0x10000, 64,  1, 63,  8, blk8x8k, "AMD 29lv320DB 2Mx16 BotB" },
-+      { 0x0001, 0x2201, 0x0400000, 2, AMD, 0x10000, 64,  0, 62,  8, blk8x8k, "AMD 29lv320MT 2Mx16 TopB" },
++      { 0x0001, 0x227e, 0x0400000, 2, AMD, 0x10000, 64,  0, 62,  8, blk8x8k, "AMD 29lv320MT 2Mx16 TopB" },
 +      { 0x0001, 0x2200, 0x0400000, 2, AMD, 0x10000, 64,  1, 63,  8, blk8x8k, "AMD 29lv320MB 2Mx16 BotB" },
 +      { 0x0020, 0x22CA, 0x0400000, 2, AMD, 0x10000, 64,  0, 62,  4, amd4112, "ST 29w320DT 2Mx16 TopB" },
 +      { 0x0020, 0x22CB, 0x0400000, 2, AMD, 0x10000, 64,  1, 63,  4, amd2114, "ST 29w320DB 2Mx16 BotB" },
@@ -2487,9 +2648,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/flash.h linux-2.4.30-brcm/arch
 +extern flash_desc_t flashes[];
 +
 +#endif
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/flashutl.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/flashutl.h
---- linux-2.4.30/arch/mips/bcm947xx/include/flashutl.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/flashutl.h    2005-02-02 23:16:39.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/flashutl.h linux.dev/arch/mips/bcm947xx/include/flashutl.h
+--- linux.old/arch/mips/bcm947xx/include/flashutl.h    1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/flashutl.h    2005-08-26 13:44:34.284395776 +0200
 @@ -0,0 +1,27 @@
 +/*
 + * BCM47XX FLASH driver interface
@@ -2518,9 +2679,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/flashutl.h linux-2.4.30-brcm/a
 +#endif        /* _LANGUAGE_ASSEMBLY */
 +
 +#endif /* _flashutl_h_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/hnddma.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/hnddma.h
---- linux-2.4.30/arch/mips/bcm947xx/include/hnddma.h   1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/hnddma.h      2005-02-02 23:16:39.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/hnddma.h linux.dev/arch/mips/bcm947xx/include/hnddma.h
+--- linux.old/arch/mips/bcm947xx/include/hnddma.h      1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/hnddma.h      2005-08-26 13:44:34.284395776 +0200
 @@ -0,0 +1,184 @@
 +/*
 + * Generic Broadcom Home Networking Division (HND) DMA engine definitions.
@@ -2706,9 +2867,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/hnddma.h linux-2.4.30-brcm/arc
 +
 +
 +#endif        /* _hnddma_h_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/hndmips.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/hndmips.h
---- linux-2.4.30/arch/mips/bcm947xx/include/hndmips.h  1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/hndmips.h     2005-02-02 23:16:39.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/hndmips.h linux.dev/arch/mips/bcm947xx/include/hndmips.h
+--- linux.old/arch/mips/bcm947xx/include/hndmips.h     1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/hndmips.h     2005-08-26 13:44:34.285395624 +0200
 @@ -0,0 +1,16 @@
 +/*
 + * Alternate include file for HND sbmips.h since CFE also ships with
@@ -2726,9 +2887,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/hndmips.h linux-2.4.30-brcm/ar
 + */
 +
 +#include "sbmips.h"
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/linux_osl.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/linux_osl.h
---- linux-2.4.30/arch/mips/bcm947xx/include/linux_osl.h        1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/linux_osl.h   2005-02-02 23:16:39.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/linux_osl.h linux.dev/arch/mips/bcm947xx/include/linux_osl.h
+--- linux.old/arch/mips/bcm947xx/include/linux_osl.h   1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/linux_osl.h   2005-08-26 13:44:34.286395472 +0200
 @@ -0,0 +1,341 @@
 +/*
 + * Linux OS Independent Layer
@@ -3071,9 +3232,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/linux_osl.h linux-2.4.30-brcm/
 +#define       PKTBUFSZ        2048
 +
 +#endif        /* _linux_osl_h_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/linuxver.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/linuxver.h
---- linux-2.4.30/arch/mips/bcm947xx/include/linuxver.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/linuxver.h    2005-02-02 23:16:39.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/linuxver.h linux.dev/arch/mips/bcm947xx/include/linuxver.h
+--- linux.old/arch/mips/bcm947xx/include/linuxver.h    1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/linuxver.h    2005-08-26 13:44:34.287395320 +0200
 @@ -0,0 +1,399 @@
 +/*
 + * Linux-specific abstractions to gain some independence from linux kernel versions.
@@ -3474,9 +3635,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/linuxver.h linux-2.4.30-brcm/a
 +#endif
 +
 +#endif /* _linuxver_h_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/min_osl.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/min_osl.h
---- linux-2.4.30/arch/mips/bcm947xx/include/min_osl.h  1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/min_osl.h     2005-05-25 03:31:09.000000000 +0200
+diff -urN linux.old/arch/mips/bcm947xx/include/min_osl.h linux.dev/arch/mips/bcm947xx/include/min_osl.h
+--- linux.old/arch/mips/bcm947xx/include/min_osl.h     1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/min_osl.h     2005-08-26 13:44:34.287395320 +0200
 @@ -0,0 +1,120 @@
 +/*
 + * HND Minimal OS Abstraction Layer.
@@ -3598,9 +3759,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/min_osl.h linux-2.4.30-brcm/ar
 +extern int getintvar(char *vars, char *name);
 +
 +#endif        /* _min_osl_h_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/mipsinc.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/mipsinc.h
---- linux-2.4.30/arch/mips/bcm947xx/include/mipsinc.h  1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/mipsinc.h     2005-05-26 02:34:15.000000000 +0200
+diff -urN linux.old/arch/mips/bcm947xx/include/mipsinc.h linux.dev/arch/mips/bcm947xx/include/mipsinc.h
+--- linux.old/arch/mips/bcm947xx/include/mipsinc.h     1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/mipsinc.h     2005-08-26 13:44:34.288395168 +0200
 @@ -0,0 +1,524 @@
 +/*
 + * HND Run Time Environment for standalone MIPS programs.
@@ -4126,9 +4287,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/mipsinc.h linux-2.4.30-brcm/ar
 +
 +
 +#endif        /* _MISPINC_H */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/nvports.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/nvports.h
---- linux-2.4.30/arch/mips/bcm947xx/include/nvports.h  1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/nvports.h     2005-02-02 23:41:24.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/nvports.h linux.dev/arch/mips/bcm947xx/include/nvports.h
+--- linux.old/arch/mips/bcm947xx/include/nvports.h     1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/nvports.h     2005-08-26 13:44:34.291394712 +0200
 @@ -0,0 +1,55 @@
 +/*
 + * BCM53xx RoboSwitch utility functions
@@ -4185,9 +4346,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/nvports.h linux-2.4.30-brcm/ar
 +
 +
 +
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/osl.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/osl.h
---- linux-2.4.30/arch/mips/bcm947xx/include/osl.h      1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/osl.h 2005-02-02 23:16:39.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/osl.h linux.dev/arch/mips/bcm947xx/include/osl.h
+--- linux.old/arch/mips/bcm947xx/include/osl.h 1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/osl.h 2005-08-26 13:44:34.291394712 +0200
 @@ -0,0 +1,39 @@
 +/*
 + * OS Independent Layer
@@ -4228,9 +4389,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/osl.h linux-2.4.30-brcm/arch/m
 +#define       MAXPRIO         7       /* 0-7 */
 +
 +#endif        /* _osl_h_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/pcicfg.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/pcicfg.h
---- linux-2.4.30/arch/mips/bcm947xx/include/pcicfg.h   1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/pcicfg.h      2005-02-02 23:16:39.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/pcicfg.h linux.dev/arch/mips/bcm947xx/include/pcicfg.h
+--- linux.old/arch/mips/bcm947xx/include/pcicfg.h      1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/pcicfg.h      2005-08-26 13:44:34.292394560 +0200
 @@ -0,0 +1,369 @@
 +/*
 + * pcicfg.h: PCI configuration  constants and structures.
@@ -4601,9 +4762,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/pcicfg.h linux-2.4.30-brcm/arc
 +#define PCI_CFG_CMD_STAT_TA   0x08000000      /* target abort status */
 +
 +#endif
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/pmon_osl.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/pmon_osl.h
---- linux-2.4.30/arch/mips/bcm947xx/include/pmon_osl.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/pmon_osl.h    2005-02-02 23:16:39.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/pmon_osl.h linux.dev/arch/mips/bcm947xx/include/pmon_osl.h
+--- linux.old/arch/mips/bcm947xx/include/pmon_osl.h    1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/pmon_osl.h    2005-08-26 13:44:34.293394408 +0200
 @@ -0,0 +1,126 @@
 +/*
 + * MIPS PMON boot loader OS Abstraction Layer.
@@ -4731,9 +4892,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/pmon_osl.h linux-2.4.30-brcm/a
 +extern void et_pktfree(void *drv, struct lbuf *lb, bool send);
 +
 +#endif        /* _pmon_osl_h_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/proto/802.11.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/proto/802.11.h
---- linux-2.4.30/arch/mips/bcm947xx/include/proto/802.11.h     1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/proto/802.11.h        2005-02-02 23:16:40.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/proto/802.11.h linux.dev/arch/mips/bcm947xx/include/proto/802.11.h
+--- linux.old/arch/mips/bcm947xx/include/proto/802.11.h        1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/proto/802.11.h        2005-08-26 13:44:34.295394104 +0200
 @@ -0,0 +1,897 @@
 +/*
 + * Copyright 2005, Broadcom Corporation      
@@ -5632,9 +5793,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/proto/802.11.h linux-2.4.30-br
 +#endif
 +
 +#endif /* _802_11_H_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/proto/bcmeth.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/proto/bcmeth.h
---- linux-2.4.30/arch/mips/bcm947xx/include/proto/bcmeth.h     1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/proto/bcmeth.h        2005-02-02 23:16:40.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/proto/bcmeth.h linux.dev/arch/mips/bcm947xx/include/proto/bcmeth.h
+--- linux.old/arch/mips/bcm947xx/include/proto/bcmeth.h        1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/proto/bcmeth.h        2005-08-26 13:44:34.295394104 +0200
 @@ -0,0 +1,97 @@
 +/*
 + * Broadcom Ethernettype  protocol definitions
@@ -5733,9 +5894,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/proto/bcmeth.h linux-2.4.30-br
 +#endif
 +
 +#endif
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/proto/ethernet.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/proto/ethernet.h
---- linux-2.4.30/arch/mips/bcm947xx/include/proto/ethernet.h   1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/proto/ethernet.h      2005-02-02 23:16:40.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/proto/ethernet.h linux.dev/arch/mips/bcm947xx/include/proto/ethernet.h
+--- linux.old/arch/mips/bcm947xx/include/proto/ethernet.h      1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/proto/ethernet.h      2005-08-26 13:44:34.296393952 +0200
 @@ -0,0 +1,161 @@
 +/*******************************************************************************
 + * $Id$
@@ -5898,9 +6059,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/proto/ethernet.h linux-2.4.30-
 +#endif
 +
 +#endif /* _NET_ETHERNET_H_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/proto/vlan.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/proto/vlan.h
---- linux-2.4.30/arch/mips/bcm947xx/include/proto/vlan.h       1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/proto/vlan.h  2005-02-02 23:16:40.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/proto/vlan.h linux.dev/arch/mips/bcm947xx/include/proto/vlan.h
+--- linux.old/arch/mips/bcm947xx/include/proto/vlan.h  1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/proto/vlan.h  2005-08-26 13:44:34.296393952 +0200
 @@ -0,0 +1,50 @@
 +/*
 + * 802.1Q VLAN protocol definitions
@@ -5952,9 +6113,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/proto/vlan.h linux-2.4.30-brcm
 +#endif
 +
 +#endif /* _vlan_h_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/proto/wpa.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/proto/wpa.h
---- linux-2.4.30/arch/mips/bcm947xx/include/proto/wpa.h        1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/proto/wpa.h   2005-02-02 23:16:40.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/proto/wpa.h linux.dev/arch/mips/bcm947xx/include/proto/wpa.h
+--- linux.old/arch/mips/bcm947xx/include/proto/wpa.h   1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/proto/wpa.h   2005-08-26 13:44:34.297393800 +0200
 @@ -0,0 +1,140 @@
 +/*
 + * Fundamental types and constants relating to WPA
@@ -6096,9 +6257,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/proto/wpa.h linux-2.4.30-brcm/
 +#endif
 +
 +#endif /* _proto_wpa_h_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/rts/crc.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/rts/crc.h
---- linux-2.4.30/arch/mips/bcm947xx/include/rts/crc.h  1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/rts/crc.h     2005-02-02 23:16:40.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/rts/crc.h linux.dev/arch/mips/bcm947xx/include/rts/crc.h
+--- linux.old/arch/mips/bcm947xx/include/rts/crc.h     1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/rts/crc.h     2005-08-26 13:44:34.297393800 +0200
 @@ -0,0 +1,69 @@
 +/*******************************************************************************
 + * $Id$
@@ -6169,9 +6330,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/rts/crc.h linux-2.4.30-brcm/ar
 +#endif
 +
 +#endif /* _RTS_CRC_H_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/sbchipc.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/sbchipc.h
---- linux-2.4.30/arch/mips/bcm947xx/include/sbchipc.h  1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/sbchipc.h     2005-02-02 23:16:40.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/sbchipc.h linux.dev/arch/mips/bcm947xx/include/sbchipc.h
+--- linux.old/arch/mips/bcm947xx/include/sbchipc.h     1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/sbchipc.h     2005-08-26 13:44:34.298393648 +0200
 @@ -0,0 +1,394 @@
 +/*
 + * SiliconBackplane Chipcommon core hardware definitions.
@@ -6567,9 +6728,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/sbchipc.h linux-2.4.30-brcm/ar
 +#define       OTP_MAGIC       0x4e56
 +
 +#endif        /* _SBCHIPC_H */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/sbconfig.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/sbconfig.h
---- linux-2.4.30/arch/mips/bcm947xx/include/sbconfig.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/sbconfig.h    2005-02-02 23:16:40.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/sbconfig.h linux.dev/arch/mips/bcm947xx/include/sbconfig.h
+--- linux.old/arch/mips/bcm947xx/include/sbconfig.h    1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/sbconfig.h    2005-08-26 13:44:34.299393496 +0200
 @@ -0,0 +1,324 @@
 +/*
 + * Broadcom SiliconBackplane hardware register definitions.
@@ -6895,9 +7056,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/sbconfig.h linux-2.4.30-brcm/a
 +#define       BISZ_BSSEND_IDX         6               /*      6: text start */
 +
 +#endif        /* _SBCONFIG_H */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/sbextif.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/sbextif.h
---- linux-2.4.30/arch/mips/bcm947xx/include/sbextif.h  1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/sbextif.h     2005-02-02 23:16:40.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/sbextif.h linux.dev/arch/mips/bcm947xx/include/sbextif.h
+--- linux.old/arch/mips/bcm947xx/include/sbextif.h     1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/sbextif.h     2005-08-26 13:44:34.300393344 +0200
 @@ -0,0 +1,242 @@
 +/*
 + * Hardware-specific External Interface I/O core definitions
@@ -7141,9 +7302,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/sbextif.h linux-2.4.30-brcm/ar
 +#define       CC_CLOCK_BASE   24000000        /* Half the clock freq. in the 4710 */
 +
 +#endif        /* _SBEXTIF_H */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/sbmemc.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/sbmemc.h
---- linux-2.4.30/arch/mips/bcm947xx/include/sbmemc.h   1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/sbmemc.h      2005-02-02 23:16:40.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/sbmemc.h linux.dev/arch/mips/bcm947xx/include/sbmemc.h
+--- linux.old/arch/mips/bcm947xx/include/sbmemc.h      1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/sbmemc.h      2005-08-26 13:44:34.300393344 +0200
 @@ -0,0 +1,147 @@
 +/*
 + * BCM47XX Sonics SiliconBackplane DDR/SDRAM controller core hardware definitions.
@@ -7292,9 +7453,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/sbmemc.h linux-2.4.30-brcm/arc
 +#define MEMC_CONFIG_DDR               0x00000001
 +
 +#endif        /* _SBMEMC_H */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/sbmips.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/sbmips.h
---- linux-2.4.30/arch/mips/bcm947xx/include/sbmips.h   1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/sbmips.h      2005-02-02 23:16:40.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/sbmips.h linux.dev/arch/mips/bcm947xx/include/sbmips.h
+--- linux.old/arch/mips/bcm947xx/include/sbmips.h      1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/sbmips.h      2005-08-26 13:44:34.301393192 +0200
 @@ -0,0 +1,60 @@
 +/*
 + * Broadcom SiliconBackplane MIPS definitions
@@ -7356,9 +7517,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/sbmips.h linux-2.4.30-brcm/arc
 +#endif /* _LANGUAGE_ASSEMBLY */
 +
 +#endif        /* _SBMIPS_H */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/sbpci.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/sbpci.h
---- linux-2.4.30/arch/mips/bcm947xx/include/sbpci.h    1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/sbpci.h       2005-02-02 23:16:40.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/sbpci.h linux.dev/arch/mips/bcm947xx/include/sbpci.h
+--- linux.old/arch/mips/bcm947xx/include/sbpci.h       1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/sbpci.h       2005-08-26 13:44:34.301393192 +0200
 @@ -0,0 +1,117 @@
 +/*
 + * BCM47XX Sonics SiliconBackplane PCI core hardware definitions.
@@ -7477,9 +7638,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/sbpci.h linux-2.4.30-brcm/arch
 +#endif /* !_LANGUAGE_ASSEMBLY */
 +
 +#endif        /* _SBPCI_H */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/sbpcmcia.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/sbpcmcia.h
---- linux-2.4.30/arch/mips/bcm947xx/include/sbpcmcia.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/sbpcmcia.h    2005-02-02 23:16:40.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/sbpcmcia.h linux.dev/arch/mips/bcm947xx/include/sbpcmcia.h
+--- linux.old/arch/mips/bcm947xx/include/sbpcmcia.h    1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/sbpcmcia.h    2005-08-26 13:44:34.302393040 +0200
 @@ -0,0 +1,139 @@
 +/*
 + * BCM43XX Sonics SiliconBackplane PCMCIA core hardware definitions.
@@ -7620,9 +7781,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/sbpcmcia.h linux-2.4.30-brcm/a
 +#define SBTMH_INT_STATUS      0x40000         /* sb interrupt status */
 +
 +#endif        /* _SBPCMCIA_H */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/sbsdram.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/sbsdram.h
---- linux-2.4.30/arch/mips/bcm947xx/include/sbsdram.h  1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/sbsdram.h     2005-02-02 23:16:40.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/sbsdram.h linux.dev/arch/mips/bcm947xx/include/sbsdram.h
+--- linux.old/arch/mips/bcm947xx/include/sbsdram.h     1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/sbsdram.h     2005-08-26 13:44:34.302393040 +0200
 @@ -0,0 +1,75 @@
 +/*
 + * BCM47XX Sonics SiliconBackplane SDRAM controller core hardware definitions.
@@ -7699,9 +7860,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/sbsdram.h linux-2.4.30-brcm/ar
 +#define MEM8MX16X2    0xc29   /* 32 MB */
 +
 +#endif        /* _SBSDRAM_H */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/sbsocram.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/sbsocram.h
---- linux-2.4.30/arch/mips/bcm947xx/include/sbsocram.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/sbsocram.h    2005-02-02 23:16:40.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/sbsocram.h linux.dev/arch/mips/bcm947xx/include/sbsocram.h
+--- linux.old/arch/mips/bcm947xx/include/sbsocram.h    1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/sbsocram.h    2005-08-26 13:44:34.303392888 +0200
 @@ -0,0 +1,37 @@
 +/*
 + * BCM47XX Sonics SiliconBackplane embedded ram core
@@ -7740,9 +7901,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/sbsocram.h linux-2.4.30-brcm/a
 +#define SOCRAM_MEMSIZE_BASESHIFT 16
 +
 +#endif        /* _SBSOCRAM_H */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/sbutils.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/sbutils.h
---- linux-2.4.30/arch/mips/bcm947xx/include/sbutils.h  1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/sbutils.h     2005-02-02 23:16:40.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/sbutils.h linux.dev/arch/mips/bcm947xx/include/sbutils.h
+--- linux.old/arch/mips/bcm947xx/include/sbutils.h     1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/sbutils.h     2005-08-26 13:44:34.303392888 +0200
 @@ -0,0 +1,87 @@
 +/*
 + * Misc utility routines for accessing chip-specific features
@@ -7831,9 +7992,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/sbutils.h linux-2.4.30-brcm/ar
 +#define       CLK_DYNAMIC     2                       /* enable dynamic power control */
 +
 +#endif        /* _sbutils_h_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/sflash.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/sflash.h
---- linux-2.4.30/arch/mips/bcm947xx/include/sflash.h   1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/sflash.h      2005-02-02 23:16:40.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/sflash.h linux.dev/arch/mips/bcm947xx/include/sflash.h
+--- linux.old/arch/mips/bcm947xx/include/sflash.h      1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/sflash.h      2005-08-26 13:44:34.304392736 +0200
 @@ -0,0 +1,36 @@
 +/*
 + * Broadcom SiliconBackplane chipcommon serial flash interface
@@ -7871,9 +8032,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/sflash.h linux-2.4.30-brcm/arc
 +extern struct sflash * sflash_init(chipcregs_t *cc);
 +
 +#endif /* _sflash_h_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/trxhdr.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/trxhdr.h
---- linux-2.4.30/arch/mips/bcm947xx/include/trxhdr.h   1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/trxhdr.h      2005-02-02 23:16:40.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/trxhdr.h linux.dev/arch/mips/bcm947xx/include/trxhdr.h
+--- linux.old/arch/mips/bcm947xx/include/trxhdr.h      1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/trxhdr.h      2005-08-26 13:44:34.304392736 +0200
 @@ -0,0 +1,33 @@
 +/*
 + * TRX image file header format.
@@ -7908,9 +8069,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/trxhdr.h linux-2.4.30-brcm/arc
 +
 +/* Compatibility */
 +typedef struct trx_header TRXHDR, *PTRXHDR;
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/typedefs.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/typedefs.h
---- linux-2.4.30/arch/mips/bcm947xx/include/typedefs.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/typedefs.h    2005-02-02 23:16:40.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/typedefs.h linux.dev/arch/mips/bcm947xx/include/typedefs.h
+--- linux.old/arch/mips/bcm947xx/include/typedefs.h    1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/typedefs.h    2005-08-26 13:44:34.305392584 +0200
 @@ -0,0 +1,322 @@
 +/*
 + * Copyright 2005, Broadcom Corporation      
@@ -8234,9 +8395,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/typedefs.h linux-2.4.30-brcm/a
 +#endif /* USE_TYPEDEF_DEFAULTS */
 +
 +#endif /* _TYPEDEFS_H_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/wlioctl.h linux-2.4.30-brcm/arch/mips/bcm947xx/include/wlioctl.h
---- linux-2.4.30/arch/mips/bcm947xx/include/wlioctl.h  1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/include/wlioctl.h     2005-02-02 23:16:40.000000000 +0100
+diff -urN linux.old/arch/mips/bcm947xx/include/wlioctl.h linux.dev/arch/mips/bcm947xx/include/wlioctl.h
+--- linux.old/arch/mips/bcm947xx/include/wlioctl.h     1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/wlioctl.h     2005-08-26 13:44:34.307392280 +0200
 @@ -0,0 +1,825 @@
 +/*
 + * Custom OID/ioctl definitions for
@@ -9063,28 +9224,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/include/wlioctl.h linux-2.4.30-brcm/ar
 +#endif
 +
 +#endif /* _wlioctl_h_ */
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/Makefile linux-2.4.30-brcm/arch/mips/bcm947xx/Makefile
---- linux-2.4.30/arch/mips/bcm947xx/Makefile   1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/Makefile      2005-05-26 15:07:37.000000000 +0200
-@@ -0,0 +1,15 @@
-+#
-+# Makefile for the BCM947xx specific kernel interface routines
-+# under Linux.
-+#
-+
-+EXTRA_CFLAGS+=-I$(TOPDIR)/arch/mips/bcm947xx/include -DBCMDRIVER
-+
-+O_TARGET        := bcm947xx.o
-+
-+export-objs     := nvram_linux.o setup.o
-+obj-y         := prom.o setup.o time.o sbmips.o gpio.o
-+obj-y         += nvram.o nvram_linux.o
-+obj-$(CONFIG_PCI) += sbpci.o pcibios.o
-+
-+include $(TOPDIR)/Rules.make
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/nvram.c linux-2.4.30-brcm/arch/mips/bcm947xx/nvram.c
---- linux-2.4.30/arch/mips/bcm947xx/nvram.c    1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/nvram.c       2005-05-24 17:58:29.000000000 +0200
+diff -urN linux.old/arch/mips/bcm947xx/nvram.c linux.dev/arch/mips/bcm947xx/nvram.c
+--- linux.old/arch/mips/bcm947xx/nvram.c       1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/nvram.c       2005-08-26 13:44:34.307392280 +0200
 @@ -0,0 +1,321 @@
 +/*
 + * NVRAM variable manipulation (common)
@@ -9407,9 +9549,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/nvram.c linux-2.4.30-brcm/arch/mips/bc
 +{
 +      BCMINIT(nvram_free)();
 +}
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/nvram_linux.c linux-2.4.30-brcm/arch/mips/bcm947xx/nvram_linux.c
---- linux-2.4.30/arch/mips/bcm947xx/nvram_linux.c      1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/nvram_linux.c 2005-05-25 20:02:50.000000000 +0200
+diff -urN linux.old/arch/mips/bcm947xx/nvram_linux.c linux.dev/arch/mips/bcm947xx/nvram_linux.c
+--- linux.old/arch/mips/bcm947xx/nvram_linux.c 1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/nvram_linux.c 2005-08-26 13:44:34.308392128 +0200
 @@ -0,0 +1,617 @@
 +/*
 + * NVRAM variable manipulation (Linux kernel half)
@@ -10028,9 +10170,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/nvram_linux.c linux-2.4.30-brcm/arch/m
 +
 +module_init(dev_nvram_init);
 +module_exit(dev_nvram_exit);
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/pcibios.c linux-2.4.30-brcm/arch/mips/bcm947xx/pcibios.c
---- linux-2.4.30/arch/mips/bcm947xx/pcibios.c  1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/pcibios.c     2005-05-26 01:15:53.000000000 +0200
+diff -urN linux.old/arch/mips/bcm947xx/pcibios.c linux.dev/arch/mips/bcm947xx/pcibios.c
+--- linux.old/arch/mips/bcm947xx/pcibios.c     1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/pcibios.c     2005-08-26 13:44:34.309391976 +0200
 @@ -0,0 +1,355 @@
 +/*
 + * Low-Level PCI and SB support for BCM47xx (Linux support code)
@@ -10387,9 +10529,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/pcibios.c linux-2.4.30-brcm/arch/mips/
 +      pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat);
 +}
 +
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/prom.c linux-2.4.30-brcm/arch/mips/bcm947xx/prom.c
---- linux-2.4.30/arch/mips/bcm947xx/prom.c     1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/prom.c        2005-05-22 22:55:51.000000000 +0200
+diff -urN linux.old/arch/mips/bcm947xx/prom.c linux.dev/arch/mips/bcm947xx/prom.c
+--- linux.old/arch/mips/bcm947xx/prom.c        1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/prom.c        2005-08-26 13:44:34.310391824 +0200
 @@ -0,0 +1,41 @@
 +/*
 + * Early initialization code for BCM94710 boards
@@ -10432,14 +10574,14 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/prom.c linux-2.4.30-brcm/arch/mips/bcm
 +prom_free_prom_memory(void)
 +{
 +}
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/sbmips.c linux-2.4.30-brcm/arch/mips/bcm947xx/sbmips.c
---- linux-2.4.30/arch/mips/bcm947xx/sbmips.c   1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/sbmips.c      2005-05-25 05:06:08.000000000 +0200
-@@ -0,0 +1,982 @@
+diff -urN linux.old/arch/mips/bcm947xx/sbmips.c linux.dev/arch/mips/bcm947xx/sbmips.c
+--- linux.old/arch/mips/bcm947xx/sbmips.c      1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/sbmips.c      2005-09-01 01:30:26.074176728 +0200
+@@ -0,0 +1,1033 @@
 +/*
 + * BCM47XX Sonics SiliconBackplane MIPS core routines
 + *
-+ * Copyright 2004, Broadcom Corporation
++ * Copyright 2005, Broadcom Corporation
 + * All Rights Reserved.
 + * 
 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
@@ -10447,7 +10589,7 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/sbmips.c linux-2.4.30-brcm/arch/mips/b
 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
 + *
-+ * $Id$
++ * $Id: sbmips.c,v 1.3 2005/03/07 08:35:32 kanki Exp $
 + */
 +
 +#include <typedefs.h>
@@ -10541,32 +10683,34 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/sbmips.c linux-2.4.30-brcm/arch/mips/b
 +                                                R_REG(&cc->clockcontrol_n),
 +                                                R_REG(&cc->clockcontrol_m2));
 +                      div = 1;
-+              } else if (rev >= 3) {
-+                      if (pll == PLL_TYPE6) {
-+                              /* Fixed ALP clock on 4320 */
++              } else {
++                      if (rev >= 11) {
++                              /* Fixed ALP clock */
 +                              baud_base = 20000000;
++                              div = 1;
 +                              /* Set the override bit so we don't divide it */
 +                              W_REG(&cc->corecontrol, CC_UARTCLKO);
-+                      } else {
++                      } else if (rev >= 3) {
 +                              /* Internal backplane clock */
 +                              baud_base = sb_clock(sbh);
++                              div = 2;        /* Minimum divisor */
++                              W_REG(&cc->clkdiv, ((R_REG(&cc->clkdiv) & ~CLKD_UART) | div));
++                      } else {
++                              /* Fixed internal backplane clock */
++                              baud_base = 88000000;
++                              div = 48;
 +                      }
-+                      div = 2;        /* Minimum divisor */
-+                      W_REG(&cc->clkdiv, ((R_REG(&cc->clkdiv) & ~CLKD_UART) | div));
-+              } else {
-+                      /* Fixed internal backplane clock */
-+                      baud_base = 88000000;
-+                      div = 48;
-+              }
 +
-+              /* Clock source depends on strapping if UartClkOverride is unset */
-+              if ((rev > 0) && ((R_REG(&cc->corecontrol) & CC_UARTCLKO) == 0)) {
-+                      if ((cap & CAP_UCLKSEL) == CAP_UINTCLK) {
-+                              /* Internal divided backplane clock */
-+                              baud_base /= div;
-+                      } else {
-+                              /* Assume external clock of 1.8432 MHz */
-+                              baud_base = 1843200;
++                      /* Clock source depends on strapping if UartClkOverride is unset */
++                      if ((rev > 0) &&
++                          ((R_REG(&cc->corecontrol) & CC_UARTCLKO) == 0)) {
++                              if ((cap & CAP_UCLKSEL) == CAP_UINTCLK) {
++                                      /* Internal divided backplane clock */
++                                      baud_base /= div;
++                              } else {
++                                      /* Assume external clock of 1.8432 MHz */
++                                      baud_base = 1843200;
++                              }
 +                      }
 +              }
 +
@@ -10815,6 +10959,14 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/sbmips.c linux-2.4.30-brcm/arch/mips/b
 +              tmp = tmp | CEIL(120, ns);              /* W0 = 120nS */
 +              W_REG(&eir->prog_waitcount, tmp);       /* 0x01020a0c for a 100Mhz clock */
 +      } else if ((cc = sb_setcore(sbh, SB_CC, 0))) {
++//==================================tallest===============================================
++              /* set register for external IO to control LED. */
++                W_REG(&cc->prog_config, 0x11);
++                tmp = CEIL(10, ns) << FW_W3_SHIFT;      /* W3 = 10nS */
++                tmp = tmp | (CEIL(40, ns) << FW_W1_SHIFT); /* W1 = 40nS */
++                tmp = tmp | CEIL(240, ns);              /* W0 = 120nS */
++                W_REG(&cc->prog_waitcount, tmp);        /* 0x01020a0c for a 100Mhz clock */
++//========================================================================================
 +              /* Set timing for the flash */
 +              tmp = CEIL(10, ns) << FW_W3_SHIFT;      /* W3 = 10nS */
 +              tmp |= CEIL(10, ns) << FW_W1_SHIFT;     /* W1 = 10nS */
@@ -10917,7 +11069,8 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/sbmips.c linux-2.4.30-brcm/arch/mips/b
 +              n = R_REG(&cc->clockcontrol_n);
 +              if ((pll_type == PLL_TYPE2) ||
 +                  (pll_type == PLL_TYPE4) ||
-+                  (pll_type == PLL_TYPE6))
++                  (pll_type == PLL_TYPE6) ||
++                  (pll_type == PLL_TYPE7))
 +                      m = R_REG(&cc->clockcontrol_mips);
 +              else if (pll_type == PLL_TYPE5) {
 +                      rate = 200000000;
@@ -10991,7 +11144,7 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/sbmips.c linux-2.4.30-brcm/arch/mips/b
 +      chipcregs_t *cc = NULL;
 +      mipsregs_t *mipsr = NULL;
 +      volatile uint32 *clockcontrol_n, *clockcontrol_sb, *clockcontrol_pci, *clockcontrol_m2;
-+      uint32 orig_n, orig_sb, orig_pci, orig_m2, orig_mips, orig_ratio_parm, new_ratio;
++      uint32 orig_n, orig_sb, orig_pci, orig_m2, orig_mips, orig_ratio_parm, orig_ratio_cfg;
 +      uint32 pll_type, sync_mode;
 +      uint ic_size, ic_lsize;
 +      uint idx, i;
@@ -11031,7 +11184,6 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/sbmips.c linux-2.4.30-brcm/arch/mips/b
 +      } type3_table_t;
 +      static type3_table_t type3_table[] = { /* for 5350, mips clock is always double sb clock */
 +              { 150000000, 0x311, 0x4020005 }, 
-+//            { 180000000, 0x, 0x },  /* later we may want this frequency */
 +              { 200000000, 0x311, 0x4020003 }, 
 +      };
 +      typedef struct {
@@ -11042,44 +11194,70 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/sbmips.c linux-2.4.30-brcm/arch/mips/b
 +              uint32 pci33;
 +              uint32 m2;
 +              uint32 m3;
-+              uint32 ratio;
++              uint32 ratio_cfg;
 +              uint32 ratio_parm;
 +      } n4m_table_t;
 +
 +      static n4m_table_t BCMINITDATA(type2_table)[] = {
-+              { 180000000,  80000000, 0x0403, 0x01010000, 0x01020300, 0x01020600, 0x05000100, 0x94, 0x012a00a9 },
-+              { 180000000,  90000000, 0x0403, 0x01000100, 0x01020300, 0x01000100, 0x05000100, 0x21, 0x0aaa0555 },
-+              { 200000000, 100000000, 0x0303, 0x01000000, 0x01000600, 0x01000000, 0x05000000, 0x21, 0x0aaa0555 },
-+              { 211200000, 105600000, 0x0902, 0x01000200, 0x01030400, 0x01000200, 0x05000200, 0x21, 0x0aaa0555 },
-+              { 220800000, 110400000, 0x1500, 0x01000200, 0x01030400, 0x01000200, 0x05000200, 0x21, 0x0aaa0555 },
-+              { 230400000, 115200000, 0x0604, 0x01000200, 0x01020600, 0x01000200, 0x05000200, 0x21, 0x0aaa0555 },
-+              { 234000000, 104000000, 0x0b01, 0x01010000, 0x01010700, 0x01020600, 0x05000100, 0x94, 0x012a00a9 },
-+              { 240000000, 120000000, 0x0803, 0x01000200, 0x01020600, 0x01000200, 0x05000200, 0x21, 0x0aaa0555 },
-+              { 252000000, 126000000, 0x0504, 0x01000100, 0x01020500, 0x01000100, 0x05000100, 0x21, 0x0aaa0555 },
-+              { 264000000, 132000000, 0x0903, 0x01000200, 0x01020700, 0x01000200, 0x05000200, 0x21, 0x0aaa0555 },
-+              { 270000000, 120000000, 0x0703, 0x01010000, 0x01030400, 0x01020600, 0x05000100, 0x94, 0x012a00a9 },
-+              { 276000000, 122666666, 0x1500, 0x01010000, 0x01030400, 0x01020600, 0x05000100, 0x94, 0x012a00a9 },
-+              { 280000000, 140000000, 0x0503, 0x01000000, 0x01010600, 0x01000000, 0x05000000, 0x21, 0x0aaa0555 },
-+              { 288000000, 128000000, 0x0604, 0x01010000, 0x01030400, 0x01020600, 0x05000100, 0x94, 0x012a00a9 },
-+              { 288000000, 144000000, 0x0404, 0x01000000, 0x01010600, 0x01000000, 0x05000000, 0x21, 0x0aaa0555 },
-+              { 300000000, 133333333, 0x0803, 0x01010000, 0x01020600, 0x01020600, 0x05000100, 0x94, 0x012a00a9 },
-+              { 300000000, 150000000, 0x0803, 0x01000100, 0x01020600, 0x01000100, 0x05000100, 0x21, 0x0aaa0555 }
++              { 180000000,  80000000, 0x0403, 0x01010000, 0x01020300, 0x01020600, 0x05000100,  8, 0x012a00a9 },
++              { 180000000,  90000000, 0x0403, 0x01000100, 0x01020300, 0x01000100, 0x05000100, 11, 0x0aaa0555 },
++              { 200000000, 100000000, 0x0303, 0x02010000, 0x02040001, 0x02010000, 0x06000001, 11, 0x0aaa0555 },
++              { 211200000, 105600000, 0x0902, 0x01000200, 0x01030400, 0x01000200, 0x05000200, 11, 0x0aaa0555 },
++              { 220800000, 110400000, 0x1500, 0x01000200, 0x01030400, 0x01000200, 0x05000200, 11, 0x0aaa0555 },
++              { 230400000, 115200000, 0x0604, 0x01000200, 0x01020600, 0x01000200, 0x05000200, 11, 0x0aaa0555 },
++              { 234000000, 104000000, 0x0b01, 0x01010000, 0x01010700, 0x01020600, 0x05000100,  8, 0x012a00a9 },
++              { 240000000, 120000000, 0x0803, 0x01000200, 0x01020600, 0x01000200, 0x05000200, 11, 0x0aaa0555 },
++              { 252000000, 126000000, 0x0504, 0x01000100, 0x01020500, 0x01000100, 0x05000100, 11, 0x0aaa0555 },
++              { 264000000, 132000000, 0x0903, 0x01000200, 0x01020700, 0x01000200, 0x05000200, 11, 0x0aaa0555 },
++              { 270000000, 120000000, 0x0703, 0x01010000, 0x01030400, 0x01020600, 0x05000100,  8, 0x012a00a9 },
++              { 276000000, 122666666, 0x1500, 0x01010000, 0x01030400, 0x01020600, 0x05000100,  8, 0x012a00a9 },
++              { 280000000, 140000000, 0x0503, 0x01000000, 0x01010600, 0x01000000, 0x05000000, 11, 0x0aaa0555 },
++              { 288000000, 128000000, 0x0604, 0x01010000, 0x01030400, 0x01020600, 0x05000100,  8, 0x012a00a9 },
++              { 288000000, 144000000, 0x0404, 0x01000000, 0x01010600, 0x01000000, 0x05000000, 11, 0x0aaa0555 },
++              { 300000000, 133333333, 0x0803, 0x01010000, 0x01020600, 0x01020600, 0x05000100,  8, 0x012a00a9 },
++              { 300000000, 150000000, 0x0803, 0x01000100, 0x01020600, 0x01000100, 0x05000100, 11, 0x0aaa0555 }
 +      };
 +
 +      static n4m_table_t BCMINITDATA(type4_table)[] = {
-+              { 192000000,  96000000, 0x0702, 0x04020011, 0x11030011, 0x04020011, 0x04020003, 0x21, 0x0aaa0555 },
-+              { 200000000, 100000000, 0x0009, 0x04020011, 0x11030011, 0x04020011, 0x04020003, 0x21, 0x0aaa0555 },
-+              { 216000000, 108000000, 0x0111, 0x11020005, 0x01030303, 0x11020005, 0x04000005, 0x21, 0x0aaa0555 },
-+              { 228000000, 101333333, 0x0e02, 0x11030003, 0x11210005, 0x11030305, 0x04000005, 0x94, 0x012a00a9 },
-+              { 228000000, 114000000, 0x0e02, 0x11020005, 0x11210005, 0x11020005, 0x04000005, 0x21, 0x0aaa0555 },
-+              { 240000000, 120000000, 0x0109, 0x11030002, 0x01050203, 0x11030002, 0x04000003, 0x21, 0x0aaa0555 },
-+              { 252000000, 126000000, 0x0203, 0x04000005, 0x11050005, 0x04000005, 0x04000002, 0x21, 0x0aaa0555 },
-+              { 264000000, 132000000, 0x0602, 0x04000005, 0x11050005, 0x04000005, 0x04000002, 0x21, 0x0aaa0555 },
-+              { 272000000, 116571428, 0x0c02, 0x04000021, 0x02000909, 0x02000221, 0x04000003, 0x73, 0x254a14a9 },
-+              { 280000000, 120000000, 0x0209, 0x04000021, 0x01030303, 0x02000221, 0x04000003, 0x73, 0x254a14a9 },
-+              { 288000000, 123428571, 0x0111, 0x04000021, 0x01030303, 0x02000221, 0x04000003, 0x73, 0x254a14a9 },
-+              { 300000000, 120000000, 0x0009, 0x04000009, 0x01030203, 0x02000902, 0x04000002, 0x52, 0x02520129 }
++              { 192000000,  96000000, 0x0702, 0x04000011, 0x11030011, 0x04000011, 0x04000003, 11, 0x0aaa0555 },
++              { 198000000,  99000000, 0x0603, 0x11020005, 0x11030011, 0x11020005, 0x04000005, 11, 0x0aaa0555 },
++              { 200000000, 100000000, 0x0009, 0x04020011, 0x11030011, 0x04020011, 0x04020003, 11, 0x0aaa0555 },
++              { 204000000, 102000000, 0x0c02, 0x11020005, 0x01030303, 0x11020005, 0x04000005, 11, 0x0aaa0555 },
++              { 208000000, 104000000, 0x0802, 0x11030002, 0x11090005, 0x11030002, 0x04000003, 11, 0x0aaa0555 },
++              { 210000000, 105000000, 0x0209, 0x11020005, 0x01030303, 0x11020005, 0x04000005, 11, 0x0aaa0555 },
++              { 216000000, 108000000, 0x0111, 0x11020005, 0x01030303, 0x11020005, 0x04000005, 11, 0x0aaa0555 },
++              { 224000000, 112000000, 0x0205, 0x11030002, 0x02002103, 0x11030002, 0x04000003, 11, 0x0aaa0555 },
++              { 228000000, 101333333, 0x0e02, 0x11030003, 0x11210005, 0x01030305, 0x04000005,  8, 0x012a00a9 },
++              { 228000000, 114000000, 0x0e02, 0x11020005, 0x11210005, 0x11020005, 0x04000005, 11, 0x0aaa0555 },
++              { 240000000, 102857143, 0x0109, 0x04000021, 0x01050203, 0x11030021, 0x04000003, 13, 0x254a14a9 },
++              { 240000000, 120000000, 0x0109, 0x11030002, 0x01050203, 0x11030002, 0x04000003, 11, 0x0aaa0555 },
++              { 252000000, 100800000, 0x0203, 0x04000009, 0x11050005, 0x02000209, 0x04000002,  9, 0x02520129 },
++              { 252000000, 126000000, 0x0203, 0x04000005, 0x11050005, 0x04000005, 0x04000002, 11, 0x0aaa0555 },
++              { 264000000, 132000000, 0x0602, 0x04000005, 0x11050005, 0x04000005, 0x04000002, 11, 0x0aaa0555 },
++              { 272000000, 116571428, 0x0c02, 0x04000021, 0x02000909, 0x02000221, 0x04000003, 13, 0x254a14a9 },
++              { 280000000, 120000000, 0x0209, 0x04000021, 0x01030303, 0x02000221, 0x04000003, 13, 0x254a14a9 },
++              { 288000000, 123428571, 0x0111, 0x04000021, 0x01030303, 0x02000221, 0x04000003, 13, 0x254a14a9 },
++              { 300000000, 120000000, 0x0009, 0x04000009, 0x01030203, 0x02000902, 0x04000002,  9, 0x02520129 },
++              { 300000000, 150000000, 0x0009, 0x04000005, 0x01030203, 0x04000005, 0x04000002, 11, 0x0aaa0555 }
++      };
++
++      static n4m_table_t BCMINITDATA(type7_table)[] = {
++              { 183333333,  91666666, 0x0605, 0x04000011, 0x11030011, 0x04000011, 0x04000003, 11, 0x0aaa0555 },
++              { 187500000,  93750000, 0x0a03, 0x04000011, 0x11030011, 0x04000011, 0x04000003, 11, 0x0aaa0555 },
++              { 196875000,  98437500, 0x1003, 0x11020005, 0x11050011, 0x11020005, 0x04000005, 11, 0x0aaa0555 },
++              { 200000000, 100000000, 0x0311, 0x04000011, 0x11030011, 0x04000009, 0x04000003, 11, 0x0aaa0555 },
++              { 200000000, 100000000, 0x0311, 0x04020011, 0x11030011, 0x04020011, 0x04020003, 11, 0x0aaa0555 },
++              { 206250000, 103125000, 0x1103, 0x11020005, 0x11050011, 0x11020005, 0x04000005, 11, 0x0aaa0555 },
++              { 212500000, 106250000, 0x0c05, 0x11020005, 0x01030303, 0x11020005, 0x04000005, 11, 0x0aaa0555 },
++              { 215625000, 107812500, 0x1203, 0x11090009, 0x11050005, 0x11020005, 0x04000005, 11, 0x0aaa0555 },
++              { 216666666, 108333333, 0x0805, 0x11020003, 0x11030011, 0x11020003, 0x04000003, 11, 0x0aaa0555 },
++              { 225000000, 112500000, 0x0d03, 0x11020003, 0x11030011, 0x11020003, 0x04000003, 11, 0x0aaa0555 },
++              { 233333333, 116666666, 0x0905, 0x11020003, 0x11030011, 0x11020003, 0x04000003, 11, 0x0aaa0555 },
++              { 237500000, 118750000, 0x0e05, 0x11020005, 0x11210005, 0x11020005, 0x04000005, 11, 0x0aaa0555 },
++              { 240000000, 120000000, 0x0b11, 0x11020009, 0x11210009, 0x11020009, 0x04000009, 11, 0x0aaa0555 },
++              { 250000000, 125000000, 0x0f03, 0x11020003, 0x11210003, 0x11020003, 0x04000003, 11, 0x0aaa0555 }
 +      };
++
 +      ulong start, end, dst;
 +      bool ret = FALSE;
 +      
@@ -11194,8 +11372,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/sbmips.c linux-2.4.30-brcm/arch/mips/b
 +              while (1);
 +      } else if ((pll_type == PLL_TYPE2) ||
 +                 (pll_type == PLL_TYPE4) ||
-+                 (pll_type == PLL_TYPE6)) {
-+              n4m_table_t *table = NULL;
++                 (pll_type == PLL_TYPE6) ||
++                 (pll_type == PLL_TYPE7)) {
++              n4m_table_t *table = NULL, *te;
 +              uint tabsz = 0;
 +
 +              ASSERT(cc);
@@ -11216,13 +11395,22 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/sbmips.c linux-2.4.30-brcm/arch/mips/b
 +                      goto end_fill;
 +              }
 +
-+              table = (pll_type == PLL_TYPE2) ? BCMINIT(type2_table) : BCMINIT(type4_table);
-+              tabsz = (pll_type == PLL_TYPE2) ? ARRAYSIZE(BCMINIT(type2_table)) :
-+                      ARRAYSIZE(BCMINIT(type4_table));
++              if (pll_type == PLL_TYPE2) {
++                      table = BCMINIT(type2_table);
++                      tabsz = ARRAYSIZE(BCMINIT(type2_table));
++              } else if (pll_type == PLL_TYPE4) {
++                      table = BCMINIT(type4_table);
++                      tabsz = ARRAYSIZE(BCMINIT(type4_table));
++              } else if (pll_type == PLL_TYPE7) {
++                      table = BCMINIT(type7_table);
++                      tabsz = ARRAYSIZE(BCMINIT(type7_table));
++              } else
++                      ASSERT((char *)"No table for plltype" == NULL);
 +
 +              /* Store the current clock register values */
 +              orig_m2 = R_REG(&cc->clockcontrol_m2);
 +              orig_ratio_parm = 0;
++              orig_ratio_cfg = 0;
 +
 +              /* Look up current ratio */
 +              for (i = 0; i < tabsz; i++) {
@@ -11232,6 +11420,7 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/sbmips.c linux-2.4.30-brcm/arch/mips/b
 +                          (orig_m2 == table[i].m2) &&
 +                          (orig_mips == table[i].m3)) {
 +                              orig_ratio_parm = table[i].ratio_parm;
++                              orig_ratio_cfg = table[i].ratio_cfg;
 +                              break;
 +                      }
 +              }
@@ -11248,30 +11437,35 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/sbmips.c linux-2.4.30-brcm/arch/mips/b
 +                      ret = FALSE;
 +                      goto done;
 +              } else {
++                      te = &table[i];
 +                      ret = TRUE;
 +              }
 +
 +              /* No PLL change */
-+              if ((orig_n == table[i].n) &&
-+                  (orig_sb == table[i].sb) &&
-+                  (orig_pci == table[i].pci33) &&
-+                  (orig_m2 == table[i].m2) &&
-+                  (orig_mips == table[i].m3))
++              if ((orig_n == te->n) &&
++                  (orig_sb == te->sb) &&
++                  (orig_pci == te->pci33) &&
++                  (orig_m2 == te->m2) &&
++                  (orig_mips == te->m3))
 +                      goto done;
 +
 +              /* Set the PLL controls */
-+              W_REG(clockcontrol_n, table[i].n);
-+              W_REG(clockcontrol_sb, table[i].sb);
-+              W_REG(clockcontrol_pci, table[i].pci33);
-+              W_REG(&cc->clockcontrol_m2, table[i].m2);
-+              W_REG(&cc->clockcontrol_mips, table[i].m3);
++              W_REG(clockcontrol_n, te->n);
++              W_REG(clockcontrol_sb, te->sb);
++              W_REG(clockcontrol_pci, te->pci33);
++              W_REG(&cc->clockcontrol_m2, te->m2);
++              W_REG(&cc->clockcontrol_mips, te->m3);
++
++              /* Set the chipcontrol bit to change mipsref to the backplane divider if needed */
++              if ((pll_type == PLL_TYPE7) &&
++                  (te->sb != te->m2) &&
++                  (sb_clock_rate(pll_type, te->n, te->m2) == 120000000))
++                      W_REG(&cc->chipcontrol, R_REG(&cc->chipcontrol) | 0x100);
 +
 +              /* No ratio change */
-+              if (orig_ratio_parm == table[i].ratio_parm)
++              if (orig_ratio_parm == te->ratio_parm)
 +                      goto end_fill;
 +
-+              new_ratio = table[i].ratio_parm;
-+
 +              icache_probe(MFC0(C0_CONFIG, 1), &ic_size, &ic_lsize);
 +
 +              /* Preload the code into the cache */
@@ -11307,8 +11501,8 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/sbmips.c linux-2.4.30-brcm/arch/mips/b
 +
 +      start_fill:
 +              /* step 1, set clock ratios */
-+              MTC0(C0_BROADCOM, 3, new_ratio);
-+              MTC0(C0_BROADCOM, 1, 8);
++              MTC0(C0_BROADCOM, 3, te->ratio_parm);
++              MTC0(C0_BROADCOM, 1, te->ratio_cfg);
 +
 +              /* step 2: program timer intr */
 +              W_REG(&mipsr->timer, 100);
@@ -11391,8 +11585,7 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/sbmips.c linux-2.4.30-brcm/arch/mips/b
 +      if (config & MEMC_CONFIG_DDR) {
 +              ret = (wr << 16) | (rd << 8) | dqsg;
 +      } else {
-+              if ( (rev > 0)  || (sb_chip(sbh) == BCM5365_DEVICE_ID))
-+
++              if ((rev > 0) || (sb_chip(sbh) == BCM5365_DEVICE_ID))
 +                      cd = rd;
 +              else
 +                      cd = (rd == MEMC_CD_THRESHOLD) ? rd : (wr + MEMC_CD_THRESHOLD);
@@ -11418,14 +11611,14 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/sbmips.c linux-2.4.30-brcm/arch/mips/b
 +      else 
 +              return 0x15;
 +}
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/sbpci.c linux-2.4.30-brcm/arch/mips/bcm947xx/sbpci.c
---- linux-2.4.30/arch/mips/bcm947xx/sbpci.c    1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/sbpci.c       2005-05-26 21:56:08.000000000 +0200
-@@ -0,0 +1,569 @@
+diff -urN linux.old/arch/mips/bcm947xx/sbpci.c linux.dev/arch/mips/bcm947xx/sbpci.c
+--- linux.old/arch/mips/bcm947xx/sbpci.c       1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/sbpci.c       2005-08-26 13:44:34.313391368 +0200
+@@ -0,0 +1,588 @@
 +/*
 + * Low-Level PCI and SB support for BCM47xx
 + *
-+ * Copyright 2004, Broadcom Corporation
++ * Copyright 2005, Broadcom Corporation
 + * All Rights Reserved.
 + * 
 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
@@ -11433,7 +11626,7 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/sbpci.c linux-2.4.30-brcm/arch/mips/bc
 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
 + *
-+ * $Id$
++ * $Id: sbpci.c,v 1.7 2005/03/07 08:35:32 kanki Exp $
 + */
 +
 +#include <typedefs.h>
@@ -11670,40 +11863,27 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/sbpci.c linux-2.4.30-brcm/arch/mips/bc
 +              pci_ban[pci_banned++] = core;
 +}
 +
-+int __init
-+sbpci_init(void *sbh)
++static int
++sbpci_init_pci(void *sbh)
 +{
-+      uint chip, chiprev, chippkg, coreidx, host, i;
++      uint chip, chiprev, chippkg, host;
 +      uint32 boardflags;
 +      sbpciregs_t *pci;
 +      sbconfig_t *sb;
-+      pci_config_regs *cfg;
-+      void *regs;
-+      char varname[8];
 +      int CT4712_WR;
-+      uint wlidx = 0;
-+      uint16 vendor, core;
-+      uint8 class, subclass, progif;
 +      uint32 val;
-+      uint32 sbips_int_mask[] = { 0, SBIPS_INT1_MASK, SBIPS_INT2_MASK, SBIPS_INT3_MASK, SBIPS_INT4_MASK };
-+      uint32 sbips_int_shift[] = { 0, 0, SBIPS_INT2_SHIFT, SBIPS_INT3_SHIFT, SBIPS_INT4_SHIFT };
 +
 +      chip = sb_chip(sbh);
 +      chiprev = sb_chiprev(sbh);
 +      chippkg = sb_chippkg(sbh);
-+      coreidx = sb_coreidx(sbh);
 +
-+      if (!(pci = (sbpciregs_t *) sb_setcore(sbh, SB_PCI, 0)))
++      if (!(pci = (sbpciregs_t *) sb_setcore(sbh, SB_PCI, 0))) {
++              printf("PCI: no core\n");
++              pci_disabled = TRUE;
 +              return -1;
++      }
 +      sb_core_reset(sbh, 0);
 +
-+      /* In some board,
-+      if(nvram_match("boardtype", "bcm94710dev"))
-+              CT4712_WR = 0;
-+      else
-+              CT4712_WR = 1;
-+      */
-+
 +      boardflags = (uint32) getintvar(NULL, "boardflags");
 +
 +      if ((chip == BCM4310_DEVICE_ID) && (chiprev == 0))
@@ -11716,7 +11896,8 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/sbpci.c linux-2.4.30-brcm/arch/mips/bc
 +       */
 +      if (((chip == BCM4712_DEVICE_ID) &&
 +           ((chippkg == BCM4712SMALL_PKG_ID) ||
-+            (chippkg == BCM4712MID_PKG_ID))) )
++            (chippkg == BCM4712MID_PKG_ID))) ||
++          (boardflags & BFL_NOPCI))
 +              pci_disabled = TRUE;
 +
 +      /*
@@ -11771,6 +11952,29 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/sbpci.c linux-2.4.30-brcm/arch/mips/bc
 +              /* Enable PCI interrupts */
 +              W_REG(&pci->intmask, PCI_INTA);
 +      }
++      
++      return 0;
++}
++
++static int
++sbpci_init_cores(void *sbh)
++{
++      uint chip, chiprev, chippkg, coreidx, i;
++      sbconfig_t *sb;
++      pci_config_regs *cfg;
++      void *regs;
++      char varname[8];
++      uint wlidx = 0;
++      uint16 vendor, core;
++      uint8 class, subclass, progif;
++      uint32 val;
++      uint32 sbips_int_mask[] = { 0, SBIPS_INT1_MASK, SBIPS_INT2_MASK, SBIPS_INT3_MASK, SBIPS_INT4_MASK };
++      uint32 sbips_int_shift[] = { 0, 0, SBIPS_INT2_SHIFT, SBIPS_INT3_SHIFT, SBIPS_INT4_SHIFT };
++
++      chip = sb_chip(sbh);
++      chiprev = sb_chiprev(sbh);
++      chippkg = sb_chippkg(sbh);
++      coreidx = sb_coreidx(sbh);
 +
 +      /* Scan the SB bus */
 +      bzero(sb_config_regs, sizeof(sb_config_regs));
@@ -11933,8 +12137,16 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/sbpci.c linux-2.4.30-brcm/arch/mips/bc
 +      return 0;
 +}
 +
-+void
-+sbpci_check(void *sbh)
++int __init
++sbpci_init(void *sbh)
++{
++      sbpci_init_pci(sbh);
++      sbpci_init_cores(sbh);
++      return 0;
++}
++
++void
++sbpci_check(void *sbh)
 +{
 +      uint coreidx;
 +      sbpciregs_t *pci;
@@ -11991,9 +12203,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/sbpci.c linux-2.4.30-brcm/arch/mips/bc
 +
 +      sb_setcoreidx(sbh, coreidx);
 +}
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/setup.c linux-2.4.30-brcm/arch/mips/bcm947xx/setup.c
---- linux-2.4.30/arch/mips/bcm947xx/setup.c    1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/setup.c       2005-05-25 17:50:08.000000000 +0200
+diff -urN linux.old/arch/mips/bcm947xx/setup.c linux.dev/arch/mips/bcm947xx/setup.c
+--- linux.old/arch/mips/bcm947xx/setup.c       1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/setup.c       2005-08-26 13:44:34.313391368 +0200
 @@ -0,0 +1,261 @@
 +/*
 + * Generic setup routines for Broadcom MIPS boards
@@ -12143,7 +12355,7 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/setup.c linux-2.4.30-brcm/arch/mips/bc
 +#endif
 +
 +      /* Override default command line arguments */
-+      value = nvram_get("kernel_args");
++      value = nvram_get("kernel_cmdline");
 +      if (value && strlen(value) && strncmp(value, "empty", 5))
 +              strncpy(arcs_cmdline, value, sizeof(arcs_cmdline));
 +
@@ -12256,9 +12468,9 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/setup.c linux-2.4.30-brcm/arch/mips/bc
 +EXPORT_SYMBOL(init_mtd_partitions);
 +
 +#endif
-diff -Nur linux-2.4.30/arch/mips/bcm947xx/time.c linux-2.4.30-brcm/arch/mips/bcm947xx/time.c
---- linux-2.4.30/arch/mips/bcm947xx/time.c     1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/bcm947xx/time.c        2005-05-22 22:55:51.000000000 +0200
+diff -urN linux.old/arch/mips/bcm947xx/time.c linux.dev/arch/mips/bcm947xx/time.c
+--- linux.old/arch/mips/bcm947xx/time.c        1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/arch/mips/bcm947xx/time.c        2005-08-26 13:44:34.314391216 +0200
 @@ -0,0 +1,117 @@
 +/*
 + * Copyright 2004, Broadcom Corporation
@@ -12377,10 +12589,10 @@ diff -Nur linux-2.4.30/arch/mips/bcm947xx/time.c linux-2.4.30-brcm/arch/mips/bcm
 +      /* Enable the timer interrupt */
 +      setup_irq(7, &bcm947xx_timer_irqaction);
 +}
-diff -Nur linux-2.4.30/arch/mips/config-shared.in linux-2.4.30-brcm/arch/mips/config-shared.in
---- linux-2.4.30/arch/mips/config-shared.in    2005-01-19 15:09:27.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/config-shared.in       2005-05-26 16:34:10.000000000 +0200
-@@ -205,6 +205,14 @@
+diff -urN linux.old/arch/mips/config-shared.in linux.dev/arch/mips/config-shared.in
+--- linux.old/arch/mips/config-shared.in       2005-08-26 13:41:43.371378504 +0200
++++ linux.dev/arch/mips/config-shared.in       2005-08-26 13:44:34.315391064 +0200
+@@ -208,6 +208,14 @@
     fi
     define_bool CONFIG_MIPS_RTC y
  fi
@@ -12395,7 +12607,7 @@ diff -Nur linux-2.4.30/arch/mips/config-shared.in linux-2.4.30-brcm/arch/mips/co
  bool 'Support for SNI RM200 PCI' CONFIG_SNI_RM200_PCI
  bool 'Support for TANBAC TB0226 (Mbase)' CONFIG_TANBAC_TB0226
  bool 'Support for TANBAC TB0229 (VR4131DIMM)' CONFIG_TANBAC_TB0229
-@@ -226,6 +234,11 @@
+@@ -229,6 +237,11 @@
  define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM n
  
  #
@@ -12407,7 +12619,7 @@ diff -Nur linux-2.4.30/arch/mips/config-shared.in linux-2.4.30-brcm/arch/mips/co
  # Select some configuration options automatically based on user selections.
  #
  if [ "$CONFIG_ACER_PICA_61" = "y" ]; then
-@@ -533,6 +546,13 @@
+@@ -554,6 +567,13 @@
     define_bool CONFIG_SWAP_IO_SPACE_L y
     define_bool CONFIG_BOOT_ELF32 y
  fi
@@ -12421,7 +12633,7 @@ diff -Nur linux-2.4.30/arch/mips/config-shared.in linux-2.4.30-brcm/arch/mips/co
  if [ "$CONFIG_SNI_RM200_PCI" = "y" ]; then
     define_bool CONFIG_ARC32 y
     define_bool CONFIG_ARC_MEMORY y
-@@ -1011,7 +1031,11 @@
+@@ -1042,7 +1062,11 @@
  
  bool 'Are you using a crosscompiler' CONFIG_CROSSCOMPILE
  bool 'Enable run-time debugging' CONFIG_RUNTIME_DEBUG
@@ -12434,10 +12646,10 @@ diff -Nur linux-2.4.30/arch/mips/config-shared.in linux-2.4.30-brcm/arch/mips/co
  dep_bool '  Console output to GDB' CONFIG_GDB_CONSOLE $CONFIG_KGDB
  if [ "$CONFIG_KGDB" = "y" ]; then
     define_bool CONFIG_DEBUG_INFO y
-diff -Nur linux-2.4.30/arch/mips/kernel/cpu-probe.c linux-2.4.30-brcm/arch/mips/kernel/cpu-probe.c
---- linux-2.4.30/arch/mips/kernel/cpu-probe.c  2005-01-19 15:09:29.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/kernel/cpu-probe.c     2005-05-22 22:55:51.000000000 +0200
-@@ -174,7 +174,7 @@
+diff -urN linux.old/arch/mips/kernel/cpu-probe.c linux.dev/arch/mips/kernel/cpu-probe.c
+--- linux.old/arch/mips/kernel/cpu-probe.c     2005-08-26 13:41:41.803616840 +0200
++++ linux.dev/arch/mips/kernel/cpu-probe.c     2005-08-26 13:44:34.316390912 +0200
+@@ -163,7 +163,7 @@
  
  static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
  {
@@ -12446,7 +12658,7 @@ diff -Nur linux-2.4.30/arch/mips/kernel/cpu-probe.c linux-2.4.30-brcm/arch/mips/
        case PRID_IMP_R2000:
                c->cputype = CPU_R2000;
                c->isa_level = MIPS_CPU_ISA_I;
-@@ -184,7 +184,7 @@
+@@ -173,7 +173,7 @@
                c->tlbsize = 64;
                break;
        case PRID_IMP_R3000:
@@ -12455,7 +12667,7 @@ diff -Nur linux-2.4.30/arch/mips/kernel/cpu-probe.c linux-2.4.30-brcm/arch/mips/
                        if (cpu_has_confreg())
                                c->cputype = CPU_R3081E;
                        else
-@@ -199,12 +199,12 @@
+@@ -188,12 +188,12 @@
                break;
        case PRID_IMP_R4000:
                if (read_c0_config() & CONF_SC) {
@@ -12470,7 +12682,7 @@ diff -Nur linux-2.4.30/arch/mips/kernel/cpu-probe.c linux-2.4.30-brcm/arch/mips/
                                c->cputype = CPU_R4400SC;
                        else
                                c->cputype = CPU_R4000SC;
-@@ -450,7 +450,7 @@
+@@ -439,7 +439,7 @@
  static inline void cpu_probe_mips(struct cpuinfo_mips *c)
  {
        decode_config1(c);
@@ -12479,7 +12691,7 @@ diff -Nur linux-2.4.30/arch/mips/kernel/cpu-probe.c linux-2.4.30-brcm/arch/mips/
        case PRID_IMP_4KC:
                c->cputype = CPU_4KC;
                c->isa_level = MIPS_CPU_ISA_M32;
-@@ -491,10 +491,10 @@
+@@ -480,10 +480,10 @@
  {
        decode_config1(c);
        c->options |= MIPS_CPU_PREFETCH;
@@ -12492,7 +12704,7 @@ diff -Nur linux-2.4.30/arch/mips/kernel/cpu-probe.c linux-2.4.30-brcm/arch/mips/
                case 0:
                        c->cputype = CPU_AU1000;
                        break;
-@@ -522,10 +522,34 @@
+@@ -511,10 +511,34 @@
        }
  }
  
@@ -12528,7 +12740,7 @@ diff -Nur linux-2.4.30/arch/mips/kernel/cpu-probe.c linux-2.4.30-brcm/arch/mips/
        case PRID_IMP_SB1:
                c->cputype = CPU_SB1;
                c->isa_level = MIPS_CPU_ISA_M64;
-@@ -547,7 +571,7 @@
+@@ -536,7 +560,7 @@
  static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c)
  {
        decode_config1(c);
@@ -12537,7 +12749,7 @@ diff -Nur linux-2.4.30/arch/mips/kernel/cpu-probe.c linux-2.4.30-brcm/arch/mips/
        case PRID_IMP_SR71000:
                c->cputype = CPU_SR71000;
                c->isa_level = MIPS_CPU_ISA_M64;
-@@ -572,7 +596,7 @@
+@@ -561,7 +585,7 @@
        c->cputype      = CPU_UNKNOWN;
  
        c->processor_id = read_c0_prid();
@@ -12546,7 +12758,7 @@ diff -Nur linux-2.4.30/arch/mips/kernel/cpu-probe.c linux-2.4.30-brcm/arch/mips/
  
        case PRID_COMP_LEGACY:
                cpu_probe_legacy(c);
-@@ -583,6 +607,9 @@
+@@ -572,6 +596,9 @@
        case PRID_COMP_ALCHEMY:
                cpu_probe_alchemy(c);
                break;
@@ -12556,9 +12768,9 @@ diff -Nur linux-2.4.30/arch/mips/kernel/cpu-probe.c linux-2.4.30-brcm/arch/mips/
        case PRID_COMP_SIBYTE:
                cpu_probe_sibyte(c);
                break;
-diff -Nur linux-2.4.30/arch/mips/kernel/head.S linux-2.4.30-brcm/arch/mips/kernel/head.S
---- linux-2.4.30/arch/mips/kernel/head.S       2005-01-19 15:09:29.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/kernel/head.S  2005-05-22 22:55:51.000000000 +0200
+diff -urN linux.old/arch/mips/kernel/head.S linux.dev/arch/mips/kernel/head.S
+--- linux.old/arch/mips/kernel/head.S  2005-08-26 13:41:41.804616688 +0200
++++ linux.dev/arch/mips/kernel/head.S  2005-08-26 13:44:34.317390760 +0200
 @@ -28,12 +28,20 @@
  #include <asm/mipsregs.h>
  #include <asm/stackframe.h>
@@ -12581,9 +12793,9 @@ diff -Nur linux-2.4.30/arch/mips/kernel/head.S linux-2.4.30-brcm/arch/mips/kerne
  
                /* The following two symbols are used for kernel profiling. */
                EXPORT(stext)
-diff -Nur linux-2.4.30/arch/mips/kernel/proc.c linux-2.4.30-brcm/arch/mips/kernel/proc.c
---- linux-2.4.30/arch/mips/kernel/proc.c       2005-01-19 15:09:29.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/kernel/proc.c  2005-05-22 22:55:51.000000000 +0200
+diff -urN linux.old/arch/mips/kernel/proc.c linux.dev/arch/mips/kernel/proc.c
+--- linux.old/arch/mips/kernel/proc.c  2005-01-19 15:09:29.000000000 +0100
++++ linux.dev/arch/mips/kernel/proc.c  2005-08-26 13:44:34.318390608 +0200
 @@ -78,9 +78,10 @@
        [CPU_AU1550]    "Au1550",
        [CPU_24K]       "MIPS 24K",
@@ -12596,10 +12808,10 @@ diff -Nur linux-2.4.30/arch/mips/kernel/proc.c linux-2.4.30-brcm/arch/mips/kerne
  static int show_cpuinfo(struct seq_file *m, void *v)
  {
        unsigned int version = current_cpu_data.processor_id;
-diff -Nur linux-2.4.30/arch/mips/kernel/setup.c linux-2.4.30-brcm/arch/mips/kernel/setup.c
---- linux-2.4.30/arch/mips/kernel/setup.c      2005-01-19 15:09:29.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/kernel/setup.c 2005-05-25 19:00:43.000000000 +0200
-@@ -495,6 +495,7 @@
+diff -urN linux.old/arch/mips/kernel/setup.c linux.dev/arch/mips/kernel/setup.c
+--- linux.old/arch/mips/kernel/setup.c 2005-08-26 13:41:41.805616536 +0200
++++ linux.dev/arch/mips/kernel/setup.c 2005-08-26 13:44:34.318390608 +0200
+@@ -493,6 +493,7 @@
        void swarm_setup(void);
        void hp_setup(void);
        void au1x00_setup(void);
@@ -12607,7 +12819,7 @@ diff -Nur linux-2.4.30/arch/mips/kernel/setup.c linux-2.4.30-brcm/arch/mips/kern
        void frame_info_init(void);
  
        frame_info_init();
-@@ -693,6 +694,11 @@
+@@ -691,6 +692,11 @@
                  pmc_yosemite_setup();
                  break;
  #endif
@@ -12619,10 +12831,10 @@ diff -Nur linux-2.4.30/arch/mips/kernel/setup.c linux-2.4.30-brcm/arch/mips/kern
        default:
                panic("Unsupported architecture");
        }
-diff -Nur linux-2.4.30/arch/mips/kernel/traps.c linux-2.4.30-brcm/arch/mips/kernel/traps.c
---- linux-2.4.30/arch/mips/kernel/traps.c      2005-01-19 15:09:29.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/kernel/traps.c 2005-05-22 22:55:51.000000000 +0200
-@@ -913,6 +913,7 @@
+diff -urN linux.old/arch/mips/kernel/traps.c linux.dev/arch/mips/kernel/traps.c
+--- linux.old/arch/mips/kernel/traps.c 2005-08-26 13:41:41.806616384 +0200
++++ linux.dev/arch/mips/kernel/traps.c 2005-08-26 13:44:34.321390152 +0200
+@@ -920,6 +920,7 @@
  void __init trap_init(void)
  {
        extern char except_vec1_generic;
@@ -12630,7 +12842,7 @@ diff -Nur linux-2.4.30/arch/mips/kernel/traps.c linux-2.4.30-brcm/arch/mips/kern
        extern char except_vec3_generic, except_vec3_r4000;
        extern char except_vec_ejtag_debug;
        extern char except_vec4;
-@@ -922,6 +923,7 @@
+@@ -927,6 +928,7 @@
  
        /* Copy the generic exception handler code to it's final destination. */
        memcpy((void *)(KSEG0 + 0x80), &except_vec1_generic, 0x80);
@@ -12638,7 +12850,7 @@ diff -Nur linux-2.4.30/arch/mips/kernel/traps.c linux-2.4.30-brcm/arch/mips/kern
  
        /*
         * Setup default vectors
-@@ -980,6 +982,12 @@
+@@ -985,6 +987,12 @@
        set_except_vector(13, handle_tr);
        set_except_vector(22, handle_mdmx);
  
@@ -12651,88 +12863,10 @@ diff -Nur linux-2.4.30/arch/mips/kernel/traps.c linux-2.4.30-brcm/arch/mips/kern
        if (cpu_has_fpu && !cpu_has_nofpuex)
                set_except_vector(15, handle_fpe);
  
-diff -Nur linux-2.4.30/arch/mips/Makefile linux-2.4.30-brcm/arch/mips/Makefile
---- linux-2.4.30/arch/mips/Makefile    2005-01-19 15:09:26.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/Makefile       2005-05-25 18:53:09.000000000 +0200
-@@ -46,10 +46,10 @@
- GCCFLAGS      := -I $(TOPDIR)/include/asm/gcc
- GCCFLAGS      += -G 0 -mno-abicalls -fno-pic -pipe
- GCCFLAGS      += $(call check_gcc, -finline-limit=100000,)
--LINKFLAGS     += -G 0 -static -n
--MODFLAGS      += -mlong-calls
-+LINKFLAGS     += -G 0 -static -n -nostdlib
-+MODFLAGS      += -mlong-calls -fno-common
--ifdef CONFIG_DEBUG_INFO
-+ifdef CONFIG_REMOTE_DEBUG
- GCCFLAGS      += -g
- ifdef CONFIG_SB1XXX_CORELIS
- GCCFLAGS      += -mno-sched-prolog -fno-omit-frame-pointer
-@@ -71,13 +71,13 @@
- set_gccflags = $(shell \
- while :; do \
-       cpu=$(1); isa=-$(2); \
--      for gcc_opt in -march= -mcpu=; do \
-+      for gcc_opt in -march= -mtune=; do \
-               $(CC) $$gcc_opt$$cpu $$isa -S -o /dev/null \
-                       -xc /dev/null > /dev/null 2>&1 && \
-                       break 2; \
-       done; \
-       cpu=$(3); isa=-$(4); \
--      for gcc_opt in -march= -mcpu=; do \
-+      for gcc_opt in -march= -mtune=; do \
-               $(CC) $$gcc_opt$$cpu $$isa -S -o /dev/null \
-                       -xc /dev/null > /dev/null 2>&1 && \
-                       break 2; \
-@@ -92,7 +92,7 @@
- fi; \
- gas_abi=-Wa,-32; gas_cpu=$$cpu; gas_isa=-Wa,$$isa; \
- while :; do \
--      for gas_opt in -Wa,-march= -Wa,-mcpu=; do \
-+      for gas_opt in -Wa,-march= -Wa,-mtune=; do \
-               $(CC) $$gas_abi $$gas_opt$$cpu $$gas_isa -Wa,-Z -c \
-                       -o /dev/null -xassembler /dev/null > /dev/null 2>&1 && \
-                       break 2; \
-@@ -174,6 +174,7 @@
- endif
- AFLAGS                += $(GCCFLAGS)
-+ASFLAGS               += $(GCCFLAGS)
- CFLAGS                += $(GCCFLAGS)
- LD            += -m $(ld-emul)
-@@ -715,6 +716,19 @@
- endif
- #
-+# Broadcom BCM947XX variants
-+#
-+ifdef CONFIG_BCM947XX
-+LIBS          += arch/mips/bcm947xx/generic/brcm.o arch/mips/bcm947xx/bcm947xx.o 
-+SUBDIRS               += arch/mips/bcm947xx/generic arch/mips/bcm947xx 
-+LOADADDR      := 0x80001000
-+
-+zImage: vmlinux
-+      $(MAKE) -C arch/$(ARCH)/bcm947xx/compressed
-+export LOADADDR
-+endif
-+
-+#
- # Choosing incompatible machines durings configuration will result in
- # error messages during linking.  Select a default linkscript if
- # none has been choosen above.
-@@ -767,6 +781,7 @@
-       $(MAKE) -C arch/$(ARCH)/tools clean
-       $(MAKE) -C arch/mips/baget clean
-       $(MAKE) -C arch/mips/lasat clean
-+      $(MAKE) -C arch/mips/bcm947xx/compressed clean
- archmrproper:
-       @$(MAKEBOOT) mrproper
-diff -Nur linux-2.4.30/arch/mips/mm/c-r4k.c linux-2.4.30-brcm/arch/mips/mm/c-r4k.c
---- linux-2.4.30/arch/mips/mm/c-r4k.c  2005-01-19 15:09:29.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/mm/c-r4k.c     2005-05-26 08:53:48.000000000 +0200
-@@ -1114,3 +1114,47 @@
+diff -urN linux.old/arch/mips/mm/c-r4k.c linux.dev/arch/mips/mm/c-r4k.c
+--- linux.old/arch/mips/mm/c-r4k.c     2005-08-26 13:41:41.825613496 +0200
++++ linux.dev/arch/mips/mm/c-r4k.c     2005-08-26 13:44:34.322390000 +0200
+@@ -1118,3 +1118,47 @@
        build_clear_page();
        build_copy_page();
  }
@@ -12780,9 +12914,9 @@ diff -Nur linux-2.4.30/arch/mips/mm/c-r4k.c linux-2.4.30-brcm/arch/mips/mm/c-r4k
 +}
 +
 +
-diff -Nur linux-2.4.30/arch/mips/pci/Makefile linux-2.4.30-brcm/arch/mips/pci/Makefile
---- linux-2.4.30/arch/mips/pci/Makefile        2005-01-19 15:09:29.000000000 +0100
-+++ linux-2.4.30-brcm/arch/mips/pci/Makefile   2005-05-26 01:02:53.000000000 +0200
+diff -urN linux.old/arch/mips/pci/Makefile linux.dev/arch/mips/pci/Makefile
+--- linux.old/arch/mips/pci/Makefile   2005-01-19 15:09:29.000000000 +0100
++++ linux.dev/arch/mips/pci/Makefile   2005-08-26 13:44:34.323389848 +0200
 @@ -13,7 +13,9 @@
  obj-$(CONFIG_MIPS_MSC)                += ops-msc.o
  obj-$(CONFIG_MIPS_NILE4)      += ops-nile4.o
@@ -12793,10 +12927,10 @@ diff -Nur linux-2.4.30/arch/mips/pci/Makefile linux-2.4.30-brcm/arch/mips/pci/Ma
  obj-$(CONFIG_PCI_AUTO)                += pci_auto.o
  
  include $(TOPDIR)/Rules.make
-diff -Nur linux-2.4.30/drivers/char/serial.c linux-2.4.30-brcm/drivers/char/serial.c
---- linux-2.4.30/drivers/char/serial.c 2005-01-19 15:09:50.000000000 +0100
-+++ linux-2.4.30-brcm/drivers/char/serial.c    2005-05-22 22:55:52.000000000 +0200
-@@ -422,6 +422,10 @@
+diff -urN linux.old/drivers/char/serial.c linux.dev/drivers/char/serial.c
+--- linux.old/drivers/char/serial.c    2005-08-26 13:41:41.952594192 +0200
++++ linux.dev/drivers/char/serial.c    2005-09-01 02:33:38.312794792 +0200
+@@ -444,6 +444,10 @@
                return inb(info->port+1);
  #endif
        case SERIAL_IO_MEM:
@@ -12807,7 +12941,7 @@ diff -Nur linux-2.4.30/drivers/char/serial.c linux-2.4.30-brcm/drivers/char/seri
                return readb((unsigned long) info->iomem_base +
                             (offset<<info->iomem_reg_shift));
        default:
-@@ -442,6 +446,9 @@
+@@ -464,6 +468,9 @@
        case SERIAL_IO_MEM:
                writeb(value, (unsigned long) info->iomem_base +
                              (offset<<info->iomem_reg_shift));
@@ -12817,7 +12951,31 @@ diff -Nur linux-2.4.30/drivers/char/serial.c linux-2.4.30-brcm/drivers/char/seri
                break;
        default:
                outb(value, info->port+offset);
-@@ -5972,6 +5979,13 @@
+@@ -1728,7 +1735,7 @@
+                       /* Special case since 134 is really 134.5 */
+                       quot = (2*baud_base / 269);
+               else if (baud)
+-                      quot = baud_base / baud;
++                      quot = (baud_base + (baud / 2)) / baud;
+       }
+       /* If the quotient is zero refuse the change */
+       if (!quot && old_termios) {
+@@ -1745,12 +1752,12 @@
+                               /* Special case since 134 is really 134.5 */
+                               quot = (2*baud_base / 269);
+                       else if (baud)
+-                              quot = baud_base / baud;
++                              quot = (baud_base + (baud / 2)) / baud;
+               }
+       }
+       /* As a last resort, if the quotient is zero, default to 9600 bps */
+       if (!quot)
+-              quot = baud_base / 9600;
++              quot = (baud_base + 4800) / 9600;
+       /*
+        * Work around a bug in the Oxford Semiconductor 952 rev B
+        * chip which causes it to seriously miscalculate baud rates
+@@ -5996,6 +6003,13 @@
         *      Divisor, bytesize and parity
         */
        state = rs_table + co->index;
@@ -12831,9 +12989,40 @@ diff -Nur linux-2.4.30/drivers/char/serial.c linux-2.4.30-brcm/drivers/char/seri
        if (doflow)
                state->flags |= ASYNC_CONS_FLOW;
        info = &async_sercons;
-diff -Nur linux-2.4.30/drivers/mtd/chips/cfi_cmdset_0701.c linux-2.4.30-brcm/drivers/mtd/chips/cfi_cmdset_0701.c
---- linux-2.4.30/drivers/mtd/chips/cfi_cmdset_0701.c   1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/drivers/mtd/chips/cfi_cmdset_0701.c      2005-05-22 22:55:52.000000000 +0200
+@@ -6009,7 +6023,7 @@
+       info->io_type = state->io_type;
+       info->iomem_base = state->iomem_base;
+       info->iomem_reg_shift = state->iomem_reg_shift;
+-      quot = state->baud_base / baud;
++      quot = (state->baud_base + (baud / 2)) / baud;
+       cval = cflag & (CSIZE | CSTOPB);
+ #if defined(__powerpc__) || defined(__alpha__)
+       cval >>= 8;
+diff -urN linux.old/drivers/mtd/chips/Config.in linux.dev/drivers/mtd/chips/Config.in
+--- linux.old/drivers/mtd/chips/Config.in      2003-06-13 16:51:34.000000000 +0200
++++ linux.dev/drivers/mtd/chips/Config.in      2005-08-26 13:44:34.341387112 +0200
+@@ -45,6 +45,7 @@
+ dep_tristate '  Support for Intel/Sharp flash chips' CONFIG_MTD_CFI_INTELEXT $CONFIG_MTD_GEN_PROBE
+ dep_tristate '  Support for AMD/Fujitsu flash chips' CONFIG_MTD_CFI_AMDSTD $CONFIG_MTD_GEN_PROBE
+ dep_tristate '  Support for ST (Advanced Architecture) flash chips' CONFIG_MTD_CFI_STAA $CONFIG_MTD_GEN_PROBE
++dep_tristate '  Support for SST flash chips' CONFIG_MTD_CFI_SSTSTD $CONFIG_MTD_GEN_PROBE
+ dep_tristate '  Support for RAM chips in bus mapping' CONFIG_MTD_RAM $CONFIG_MTD
+ dep_tristate '  Support for ROM chips in bus mapping' CONFIG_MTD_ROM $CONFIG_MTD
+diff -urN linux.old/drivers/mtd/chips/Makefile linux.dev/drivers/mtd/chips/Makefile
+--- linux.old/drivers/mtd/chips/Makefile       2003-06-13 16:51:34.000000000 +0200
++++ linux.dev/drivers/mtd/chips/Makefile       2005-08-26 13:44:34.342386960 +0200
+@@ -18,6 +18,7 @@
+ obj-$(CONFIG_MTD_AMDSTD)      += amd_flash.o 
+ obj-$(CONFIG_MTD_CFI)         += cfi_probe.o
+ obj-$(CONFIG_MTD_CFI_STAA)    += cfi_cmdset_0020.o
++obj-$(CONFIG_MTD_CFI_SSTSTD)   += cfi_cmdset_0701.o
+ obj-$(CONFIG_MTD_CFI_AMDSTD)  += cfi_cmdset_0002.o
+ obj-$(CONFIG_MTD_CFI_INTELEXT)        += cfi_cmdset_0001.o
+ obj-$(CONFIG_MTD_GEN_PROBE)   += gen_probe.o
+diff -urN linux.old/drivers/mtd/chips/cfi_cmdset_0701.c linux.dev/drivers/mtd/chips/cfi_cmdset_0701.c
+--- linux.old/drivers/mtd/chips/cfi_cmdset_0701.c      1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/drivers/mtd/chips/cfi_cmdset_0701.c      2005-08-26 13:44:34.343386808 +0200
 @@ -0,0 +1,855 @@
 +/*
 + * Common Flash Interface support:
@@ -13690,9 +13879,9 @@ diff -Nur linux-2.4.30/drivers/mtd/chips/cfi_cmdset_0701.c linux-2.4.30-brcm/dri
 +module_init(cfi_sststd_init);
 +module_exit(cfi_sststd_exit);
 +
-diff -Nur linux-2.4.30/drivers/mtd/chips/cfi_probe.c linux-2.4.30-brcm/drivers/mtd/chips/cfi_probe.c
---- linux-2.4.30/drivers/mtd/chips/cfi_probe.c 2003-06-13 16:51:34.000000000 +0200
-+++ linux-2.4.30-brcm/drivers/mtd/chips/cfi_probe.c    2005-05-22 22:55:52.000000000 +0200
+diff -urN linux.old/drivers/mtd/chips/cfi_probe.c linux.dev/drivers/mtd/chips/cfi_probe.c
+--- linux.old/drivers/mtd/chips/cfi_probe.c    2003-06-13 16:51:34.000000000 +0200
++++ linux.dev/drivers/mtd/chips/cfi_probe.c    2005-08-26 13:44:34.344386656 +0200
 @@ -67,8 +67,15 @@
        cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
        cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL);
@@ -13711,20 +13900,9 @@ diff -Nur linux-2.4.30/drivers/mtd/chips/cfi_probe.c linux-2.4.30-brcm/drivers/m
  
        if (!cfi->numchips) {
                /* This is the first time we're called. Set up the CFI 
-diff -Nur linux-2.4.30/drivers/mtd/chips/Config.in linux-2.4.30-brcm/drivers/mtd/chips/Config.in
---- linux-2.4.30/drivers/mtd/chips/Config.in   2003-06-13 16:51:34.000000000 +0200
-+++ linux-2.4.30-brcm/drivers/mtd/chips/Config.in      2005-05-22 22:55:52.000000000 +0200
-@@ -45,6 +45,7 @@
- dep_tristate '  Support for Intel/Sharp flash chips' CONFIG_MTD_CFI_INTELEXT $CONFIG_MTD_GEN_PROBE
- dep_tristate '  Support for AMD/Fujitsu flash chips' CONFIG_MTD_CFI_AMDSTD $CONFIG_MTD_GEN_PROBE
- dep_tristate '  Support for ST (Advanced Architecture) flash chips' CONFIG_MTD_CFI_STAA $CONFIG_MTD_GEN_PROBE
-+dep_tristate '  Support for SST flash chips' CONFIG_MTD_CFI_SSTSTD $CONFIG_MTD_GEN_PROBE
- dep_tristate '  Support for RAM chips in bus mapping' CONFIG_MTD_RAM $CONFIG_MTD
- dep_tristate '  Support for ROM chips in bus mapping' CONFIG_MTD_ROM $CONFIG_MTD
-diff -Nur linux-2.4.30/drivers/mtd/chips/gen_probe.c linux-2.4.30-brcm/drivers/mtd/chips/gen_probe.c
---- linux-2.4.30/drivers/mtd/chips/gen_probe.c 2003-08-25 13:44:42.000000000 +0200
-+++ linux-2.4.30-brcm/drivers/mtd/chips/gen_probe.c    2005-05-22 22:55:52.000000000 +0200
+diff -urN linux.old/drivers/mtd/chips/gen_probe.c linux.dev/drivers/mtd/chips/gen_probe.c
+--- linux.old/drivers/mtd/chips/gen_probe.c    2003-08-25 13:44:42.000000000 +0200
++++ linux.dev/drivers/mtd/chips/gen_probe.c    2005-08-26 13:44:34.345386504 +0200
 @@ -332,9 +332,13 @@
                return cfi_cmdset_0002(map, primary);
  #endif
@@ -13740,20 +13918,40 @@ diff -Nur linux-2.4.30/drivers/mtd/chips/gen_probe.c linux-2.4.30-brcm/drivers/m
        }
  
        return cfi_cmdset_unknown(map, primary);
-diff -Nur linux-2.4.30/drivers/mtd/chips/Makefile linux-2.4.30-brcm/drivers/mtd/chips/Makefile
---- linux-2.4.30/drivers/mtd/chips/Makefile    2003-06-13 16:51:34.000000000 +0200
-+++ linux-2.4.30-brcm/drivers/mtd/chips/Makefile       2005-05-22 22:55:52.000000000 +0200
-@@ -18,6 +18,7 @@
- obj-$(CONFIG_MTD_AMDSTD)      += amd_flash.o 
- obj-$(CONFIG_MTD_CFI)         += cfi_probe.o
- obj-$(CONFIG_MTD_CFI_STAA)    += cfi_cmdset_0020.o
-+obj-$(CONFIG_MTD_CFI_SSTSTD)   += cfi_cmdset_0701.o
- obj-$(CONFIG_MTD_CFI_AMDSTD)  += cfi_cmdset_0002.o
- obj-$(CONFIG_MTD_CFI_INTELEXT)        += cfi_cmdset_0001.o
- obj-$(CONFIG_MTD_GEN_PROBE)   += gen_probe.o
-diff -Nur linux-2.4.30/drivers/mtd/maps/bcm947xx-flash.c linux-2.4.30-brcm/drivers/mtd/maps/bcm947xx-flash.c
---- linux-2.4.30/drivers/mtd/maps/bcm947xx-flash.c     1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/drivers/mtd/maps/bcm947xx-flash.c        2005-05-22 22:55:52.000000000 +0200
+diff -urN linux.old/drivers/mtd/maps/Config.in linux.dev/drivers/mtd/maps/Config.in
+--- linux.old/drivers/mtd/maps/Config.in       2005-08-26 13:41:41.963592520 +0200
++++ linux.dev/drivers/mtd/maps/Config.in       2005-08-26 13:44:34.345386504 +0200
+@@ -48,6 +48,7 @@
+ fi
+ if [ "$CONFIG_MIPS" = "y" ]; then
++   dep_tristate '  CFI Flash device mapped on Broadcom BCM947XX boards' CONFIG_MTD_BCM947XX $CONFIG_MTD_CFI
+    dep_tristate '  Pb1000 MTD support' CONFIG_MTD_PB1000 $CONFIG_MIPS_PB1000
+    dep_tristate '  Pb1500 MTD support' CONFIG_MTD_PB1500 $CONFIG_MIPS_PB1500
+    dep_tristate '  Pb1100 MTD support' CONFIG_MTD_PB1100 $CONFIG_MIPS_PB1100
+diff -urN linux.old/drivers/mtd/maps/Makefile linux.dev/drivers/mtd/maps/Makefile
+--- linux.old/drivers/mtd/maps/Makefile        2005-08-26 13:41:41.963592520 +0200
++++ linux.dev/drivers/mtd/maps/Makefile        2005-08-26 13:44:34.346386352 +0200
+@@ -3,6 +3,8 @@
+ #
+ # $Id: Makefile,v 1.37 2003/01/24 14:26:38 dwmw2 Exp $
++EXTRA_CFLAGS := -I$(TOPDIR)/arch/mips/bcm947xx/include
++
+ BELOW25               := $(shell echo $(PATCHLEVEL) | sed s/[1234]/y/)
+ ifeq ($(BELOW25),y)
+@@ -10,6 +12,7 @@
+ endif
+ # Chip mappings
++obj-$(CONFIG_MTD_BCM947XX)    += bcm947xx-flash.o
+ obj-$(CONFIG_MTD_CDB89712)    += cdb89712.o
+ obj-$(CONFIG_MTD_ARM_INTEGRATOR)+= integrator-flash.o
+ obj-$(CONFIG_MTD_CFI_FLAGADM) += cfi_flagadm.o
+diff -urN linux.old/drivers/mtd/maps/bcm947xx-flash.c linux.dev/drivers/mtd/maps/bcm947xx-flash.c
+--- linux.old/drivers/mtd/maps/bcm947xx-flash.c        1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/drivers/mtd/maps/bcm947xx-flash.c        2005-08-26 13:44:34.346386352 +0200
 @@ -0,0 +1,236 @@
 +/*
 + * Flash mapping for BCM947XX boards
@@ -13991,40 +14189,9 @@ diff -Nur linux-2.4.30/drivers/mtd/maps/bcm947xx-flash.c linux-2.4.30-brcm/drive
 +
 +module_init(init_bcm947xx_map);
 +module_exit(cleanup_bcm947xx_map);
-diff -Nur linux-2.4.30/drivers/mtd/maps/Config.in linux-2.4.30-brcm/drivers/mtd/maps/Config.in
---- linux-2.4.30/drivers/mtd/maps/Config.in    2003-06-13 16:51:34.000000000 +0200
-+++ linux-2.4.30-brcm/drivers/mtd/maps/Config.in       2005-05-25 18:58:03.000000000 +0200
-@@ -48,6 +48,7 @@
- fi
- if [ "$CONFIG_MIPS" = "y" ]; then
-+   dep_tristate '  CFI Flash device mapped on Broadcom BCM947XX boards' CONFIG_MTD_BCM947XX $CONFIG_MTD_CFI
-    dep_tristate '  Pb1000 MTD support' CONFIG_MTD_PB1000 $CONFIG_MIPS_PB1000
-    dep_tristate '  Pb1500 MTD support' CONFIG_MTD_PB1500 $CONFIG_MIPS_PB1500
-    dep_tristate '  Pb1100 MTD support' CONFIG_MTD_PB1100 $CONFIG_MIPS_PB1100
-diff -Nur linux-2.4.30/drivers/mtd/maps/Makefile linux-2.4.30-brcm/drivers/mtd/maps/Makefile
---- linux-2.4.30/drivers/mtd/maps/Makefile     2003-06-13 16:51:34.000000000 +0200
-+++ linux-2.4.30-brcm/drivers/mtd/maps/Makefile        2005-05-25 18:57:31.000000000 +0200
-@@ -3,6 +3,8 @@
- #
- # $Id: Makefile,v 1.37 2003/01/24 14:26:38 dwmw2 Exp $
-+EXTRA_CFLAGS := -I$(TOPDIR)/arch/mips/bcm947xx/include
-+
- BELOW25               := $(shell echo $(PATCHLEVEL) | sed s/[1234]/y/)
- ifeq ($(BELOW25),y)
-@@ -10,6 +12,7 @@
- endif
- # Chip mappings
-+obj-$(CONFIG_MTD_BCM947XX)    += bcm947xx-flash.o
- obj-$(CONFIG_MTD_CDB89712)    += cdb89712.o
- obj-$(CONFIG_MTD_ARM_INTEGRATOR)+= integrator-flash.o
- obj-$(CONFIG_MTD_CFI_FLAGADM) += cfi_flagadm.o
-diff -Nur linux-2.4.30/drivers/net/Config.in linux-2.4.30-brcm/drivers/net/Config.in
---- linux-2.4.30/drivers/net/Config.in 2005-01-19 15:09:56.000000000 +0100
-+++ linux-2.4.30-brcm/drivers/net/Config.in    2005-05-25 04:34:51.000000000 +0200
+diff -urN linux.old/drivers/net/Config.in linux.dev/drivers/net/Config.in
+--- linux.old/drivers/net/Config.in    2005-08-26 13:41:43.481361784 +0200
++++ linux.dev/drivers/net/Config.in    2005-08-26 13:44:34.358384528 +0200
 @@ -2,6 +2,8 @@
  # Network device configuration
  #
@@ -14034,7 +14201,7 @@ diff -Nur linux-2.4.30/drivers/net/Config.in linux-2.4.30-brcm/drivers/net/Confi
  source drivers/net/arcnet/Config.in
  
  tristate 'Dummy net driver support' CONFIG_DUMMY
-@@ -173,6 +175,7 @@
+@@ -174,6 +176,7 @@
  
        dep_tristate '    Apricot Xen-II on board Ethernet' CONFIG_APRICOT $CONFIG_ISA
        dep_tristate '    Broadcom 4400 ethernet support (EXPERIMENTAL)' CONFIG_B44 $CONFIG_PCI $CONFIG_EXPERIMENTAL
@@ -14042,274 +14209,56 @@ diff -Nur linux-2.4.30/drivers/net/Config.in linux-2.4.30-brcm/drivers/net/Confi
        dep_tristate '    CS89x0 support' CONFIG_CS89x0 $CONFIG_ISA
        dep_tristate '    DECchip Tulip (dc21x4x) PCI support' CONFIG_TULIP $CONFIG_PCI
        if [ "$CONFIG_TULIP" = "y" -o "$CONFIG_TULIP" = "m" ]; then
-diff -Nur linux-2.4.30/drivers/net/diag/diag_led.c linux-2.4.30-brcm/drivers/net/diag/diag_led.c
---- linux-2.4.30/drivers/net/diag/diag_led.c   1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/drivers/net/diag/diag_led.c      2005-05-25 20:41:19.000000000 +0200
-@@ -0,0 +1,244 @@
-+/*
-+ * diag_led.c - replacement diag module
-+ *
-+ * Copyright (C) 2004 Mike Baker,
-+ *                    Imre Kaloz <kaloz@dune.hu>
-+ *
-+ * 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, or (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-+ *
-+ * $Id: diag_led.c,v 1.5 2005/04/18 09:05:24 mbm Exp $
-+ */
-+
-+/*
-+ * ChangeLog:
-+ * 2004/03/28 initial release 
-+ * 2004/08/26 asus & buffalo support added
-+ * 2005/03/14 asus wl-500g deluxe and buffalo v2 support added
-+ * 2005/04/13 added licensing informations
-+ * 2005/04/18 base reset polarity off initial readings
-+ */
-+
-+#include <linux/module.h>
-+#include <linux/init.h>
-+#include <linux/kernel.h>
-+#include <linux/sysctl.h>
-+#include <asm/io.h>
-+#include <typedefs.h>
-+#include <bcmdevs.h>
-+#include <sbutils.h>
-+
-+extern char * nvram_get(const char *name);
-+static void *sbh;
-+
-+// v2.x - - - - -
-+#define DIAG_GPIO (1<<1)
-+#define DMZ_GPIO  (1<<7)
-+
-+static void set_gpio(uint32 mask, uint32 value) {
-+      sb_gpiocontrol(sbh,mask,0);
-+      sb_gpioouten(sbh,mask,mask);
-+      sb_gpioout(sbh,mask,value);
-+}
-+
-+static void v2_set_diag(u8 state) {
-+      set_gpio(DIAG_GPIO,state);
-+}
-+static void v2_set_dmz(u8 state) {
-+      set_gpio(DMZ_GPIO,state);
-+}
-+
-+// v1.x - - - - -
-+#define LED_DIAG   0x13
-+#define LED_DMZ    0x12
-+
-+static void v1_set_diag(u8 state) {
-+      if (!state) {
-+              *(volatile u8*)(KSEG1ADDR(BCM4710_EUART)+LED_DIAG)=0xFF;
-+      } else {
-+              *(volatile u8*)(KSEG1ADDR(BCM4710_EUART)+LED_DIAG);
-+      }
-+}
-+static void v1_set_dmz(u8 state) {
-+      if (!state) {
-+              *(volatile u8*)(KSEG1ADDR(BCM4710_EUART)+LED_DMZ)=0xFF;
-+      } else {
-+              *(volatile u8*)(KSEG1ADDR(BCM4710_EUART)+LED_DMZ);
-+      }
-+}
-+
-+// - - - - -
-+static void ignore(u8 ignored) {};
-+
-+// - - - - -
-+#define BIT_DMZ         0x01
-+#define BIT_DIAG        0x04
-+
-+void (*set_diag)(u8 state);
-+void (*set_dmz)(u8 state);
-+
-+static unsigned int diag = 0;
-+
-+static void diag_change()
-+{
-+      set_diag(0xFF); // off
-+      set_dmz(0xFF); // off
-+
-+      if(diag & BIT_DIAG)
-+              set_diag(0x00); // on
-+      if(diag & BIT_DMZ)
-+              set_dmz(0x00); // on
-+}
-+
-+static int proc_diag(ctl_table *table, int write, struct file *filp,
-+              void *buffer, size_t *lenp)
-+{
-+      int r;
-+      r = proc_dointvec(table, write, filp, buffer, lenp);
-+      if (write && !r) {
-+              diag_change();
-+      }
-+      return r;
-+}
-+
-+// - - - - -
-+static unsigned char reset_gpio = 0;
-+static unsigned char reset_polarity = 0;
-+static unsigned int reset = 0;
-+
-+static int proc_reset(ctl_table *table, int write, struct file *filp,
-+              void *buffer, size_t *lenp)
-+{
-+
-+      if (reset_gpio) {
-+              sb_gpiocontrol(sbh,reset_gpio,reset_gpio);
-+              sb_gpioouten(sbh,reset_gpio,0);
-+              reset=!(sb_gpioin(sbh)&reset_gpio);
-+
-+              if (reset_polarity) reset=!reset;
-+      } else {
-+              reset=0;
-+      }
-+
-+      return proc_dointvec(table, write, filp, buffer, lenp);
-+}
-+
-+// - - - - -
-+static struct ctl_table_header *diag_sysctl_header;
-+
-+static ctl_table sys_diag[] = {
-+         { 
-+         ctl_name: 2000,
-+         procname: "diag", 
-+         data: &diag,
-+         maxlen: sizeof(diag), 
-+         mode: 0644,
-+         proc_handler: proc_diag
-+       },
-+       {
-+         ctl_name: 2001,
-+         procname: "reset",
-+         data: &reset,
-+         maxlen: sizeof(reset),
-+         mode: 0444,
-+         proc_handler: proc_reset 
-+       },
-+         { 0 }
-+};
-+
-+static int __init diag_init()
-+{
-+      char *buf;
-+      u32 board_type;
-+      sbh = sb_kattach();
-+      sb_gpiosetcore(sbh);
-+
-+      board_type = sb_boardtype(sbh);
-+      printk(KERN_INFO "diag boardtype: %08x\n",board_type);
-+
-+      set_diag=ignore;
-+      set_dmz=ignore;
-+      
-+      if ((board_type & 0xf00) == 0x400) {
-+              buf=nvram_get("boardtype")?:"";
-+              if (!strcmp(buf,"bcm94710dev")) {
-+                      buf=nvram_get("boardnum")?:"";
-+                      if (!strcmp(buf,"42")) {
-+                              // wrt54g v1.x
-+                              set_diag=v1_set_diag;
-+                              set_dmz=v1_set_dmz;
-+                              reset_gpio=(1<<6);
-+                      }
-+                      if (!strcmp(buf,"asusX")) {
-+                              //asus wl-500g
-+                              reset_gpio=(1<<6);
-+                      }
-+              }
-+              if (!strcmp(buf,"bcm94710ap")) {
-+                      buf=nvram_get("boardnum")?:"";
-+                      if (!strcmp(buf,"42")) {
-+                              // buffalo
-+                              set_dmz=v2_set_dmz;
-+                              reset_gpio=(1<<4);
-+                      }
-+                      if (!strcmp(buf,"44")) {
-+                              //dell truemobile
-+                              set_dmz=v2_set_dmz;
-+                              reset_gpio=(1<<0);
-+                      }
-+              }
-+      } else {
-+              buf=nvram_get("boardnum")?:"";
-+              if (!strcmp(buf,"42")) {
-+                      //linksys
-+                      set_diag=v2_set_diag;
-+                      set_dmz=v2_set_dmz;
-+                      reset_gpio=(1<<6);
-+              }
-+              if (!strcmp(buf,"44")) {
-+                      //motorola
-+                      reset_gpio=(1<<5);
-+              }
-+              if (!strcmp(buf,"00")) {
-+                      //buffalo
-+                      reset_gpio=(1<<7);
-+              }
-+              if (!strcmp(buf,"45")) {
-+                      //wl-500g deluxe
-+                      reset_gpio=(1<<6);
-+              }
-+      }
-+
-+      
-+      sb_gpiocontrol(sbh,reset_gpio,reset_gpio);
-+      sb_gpioouten(sbh,reset_gpio,0);
-+      reset_polarity=!(sb_gpioin(sbh)&reset_gpio);
-+
-+      diag_sysctl_header = register_sysctl_table(sys_diag, 0);
-+      diag_change();
-+
-+      return 0;
-+}
-+
-+static void __exit diag_exit()
-+{
-+      unregister_sysctl_table(diag_sysctl_header);
-+}
-+
-+EXPORT_NO_SYMBOLS;
-+MODULE_AUTHOR("openwrt.org");
-+MODULE_LICENSE("GPL");
-+
-+module_init(diag_init);
-+module_exit(diag_exit);
-diff -Nur linux-2.4.30/drivers/net/diag/Makefile linux-2.4.30-brcm/drivers/net/diag/Makefile
---- linux-2.4.30/drivers/net/diag/Makefile     1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/drivers/net/diag/Makefile        2005-05-26 17:13:16.000000000 +0200
-@@ -0,0 +1,13 @@
-+#$Id$
-+
-+EXTRA_CFLAGS := -I$(TOPDIR)/arch/mips/bcm947xx/include -DBCMDRIVER
-+
-+O_TARGET       := diag.o
+diff -urN linux.old/drivers/net/Makefile linux.dev/drivers/net/Makefile
+--- linux.old/drivers/net/Makefile     2005-08-26 13:41:43.082422432 +0200
++++ linux.dev/drivers/net/Makefile     2005-08-26 13:44:34.370382704 +0200
+@@ -3,6 +3,8 @@
+ # Makefile for the Linux network (ethercard) device drivers.
+ #
++EXTRA_CFLAGS := -I$(TOPDIR)/arch/mips/bcm947xx/include
 +
-+MAC_OBJS       := diag_led.o
+ obj-y           :=
+ obj-m           :=
+ obj-n           :=
+@@ -39,6 +41,9 @@
+   obj-$(CONFIG_ISDN) += slhc.o
+ endif
++subdir-$(CONFIG_HND) += hnd
++subdir-$(CONFIG_ET) += et
++subdir-$(CONFIG_WL) += wl
+ subdir-$(CONFIG_NET_PCMCIA) += pcmcia
+ subdir-$(CONFIG_NET_WIRELESS) += wireless
+ subdir-$(CONFIG_TULIP) += tulip
+@@ -69,6 +74,16 @@
+ obj-$(CONFIG_MYRI_SBUS) += myri_sbus.o
+ obj-$(CONFIG_SUNGEM) += sungem.o
++ifeq ($(CONFIG_HND),y)
++  obj-y += hnd/hnd.o
++endif
++ifeq ($(CONFIG_ET),y)
++  obj-y += et/et.o
++endif
++ifeq ($(CONFIG_WL),y)
++  obj-y += wl/wl.o
++endif
 +
-+export-objs    := 
-+obj-y          := $(MAC_OBJS)
-+obj-m          := $(O_TARGET)
+ obj-$(CONFIG_MACE) += mace.o
+ obj-$(CONFIG_BMAC) += bmac.o
+ obj-$(CONFIG_GMAC) += gmac.o
+@@ -266,6 +281,7 @@
+ endif
+ endif
 +
-+include $(TOPDIR)/Rules.make
-diff -Nur linux-2.4.30/drivers/net/et/Makefile linux-2.4.30-brcm/drivers/net/et/Makefile
---- linux-2.4.30/drivers/net/et/Makefile       1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/drivers/net/et/Makefile  2005-05-26 02:37:05.000000000 +0200
+ include $(TOPDIR)/Rules.make
+ clean:
+diff -urN linux.old/drivers/net/et/Makefile linux.dev/drivers/net/et/Makefile
+--- linux.old/drivers/net/et/Makefile  1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/drivers/net/et/Makefile  2005-08-26 13:44:34.371382552 +0200
 @@ -0,0 +1,21 @@
 +#
 +# Makefile for the Broadcom et driver
@@ -14332,9 +14281,32 @@ diff -Nur linux-2.4.30/drivers/net/et/Makefile linux-2.4.30-brcm/drivers/net/et/
 +obj-m         := $(O_TARGET)
 +
 +include $(TOPDIR)/Rules.make
-diff -Nur linux-2.4.30/drivers/net/hnd/bcmsrom.c linux-2.4.30-brcm/drivers/net/hnd/bcmsrom.c
---- linux-2.4.30/drivers/net/hnd/bcmsrom.c     1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/drivers/net/hnd/bcmsrom.c        2005-05-22 23:00:53.000000000 +0200
+diff -urN linux.old/drivers/net/hnd/Makefile linux.dev/drivers/net/hnd/Makefile
+--- linux.old/drivers/net/hnd/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/drivers/net/hnd/Makefile 2005-08-26 13:44:34.371382552 +0200
+@@ -0,0 +1,19 @@
++#
++# Makefile for the BCM47xx specific kernel interface routines
++# under Linux.
++#
++
++EXTRA_CFLAGS  += -I$(TOPDIR)/arch/mips/bcm947xx/include -DBCMDRIVER
++
++O_TARGET      := hnd.o
++
++HND_OBJS      := bcmutils.o hnddma.o linux_osl.o sbutils.o bcmsrom.o
++
++export-objs   := shared_ksyms.o
++obj-y         := shared_ksyms.o $(HND_OBJS)
++obj-m           := $(O_TARGET)
++
++include $(TOPDIR)/Rules.make
++
++shared_ksyms.c: shared_ksyms.sh $(HND_OBJS)
++      sh -e $< $(HND_OBJS) > $@
+diff -urN linux.old/drivers/net/hnd/bcmsrom.c linux.dev/drivers/net/hnd/bcmsrom.c
+--- linux.old/drivers/net/hnd/bcmsrom.c        1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/drivers/net/hnd/bcmsrom.c        2005-08-26 13:44:34.372382400 +0200
 @@ -0,0 +1,714 @@
 +/*
 + *  Misc useful routines to access NIC SROM/OTP .
@@ -15050,9 +15022,9 @@ diff -Nur linux-2.4.30/drivers/net/hnd/bcmsrom.c linux-2.4.30-brcm/drivers/net/h
 +      return (rc);
 +}
 +
-diff -Nur linux-2.4.30/drivers/net/hnd/bcmutils.c linux-2.4.30-brcm/drivers/net/hnd/bcmutils.c
---- linux-2.4.30/drivers/net/hnd/bcmutils.c    1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/drivers/net/hnd/bcmutils.c       2005-05-24 20:26:25.000000000 +0200
+diff -urN linux.old/drivers/net/hnd/bcmutils.c linux.dev/drivers/net/hnd/bcmutils.c
+--- linux.old/drivers/net/hnd/bcmutils.c       1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/drivers/net/hnd/bcmutils.c       2005-08-26 13:44:34.374382096 +0200
 @@ -0,0 +1,862 @@
 +/*
 + * Misc useful OS-independent routines.
@@ -15916,9 +15888,9 @@ diff -Nur linux-2.4.30/drivers/net/hnd/bcmutils.c linux-2.4.30-brcm/drivers/net/
 +}
 +
 +
-diff -Nur linux-2.4.30/drivers/net/hnd/hnddma.c linux-2.4.30-brcm/drivers/net/hnd/hnddma.c
---- linux-2.4.30/drivers/net/hnd/hnddma.c      1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/drivers/net/hnd/hnddma.c 2005-05-25 01:12:49.000000000 +0200
+diff -urN linux.old/drivers/net/hnd/hnddma.c linux.dev/drivers/net/hnd/hnddma.c
+--- linux.old/drivers/net/hnd/hnddma.c 1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/drivers/net/hnd/hnddma.c 2005-08-26 13:44:34.375381944 +0200
 @@ -0,0 +1,865 @@
 +/*
 + * Generic Broadcom Home Networking Division (HND) DMA module.
@@ -16785,9 +16757,9 @@ diff -Nur linux-2.4.30/drivers/net/hnd/hnddma.c linux-2.4.30-brcm/drivers/net/hn
 +      /* kick the chip */
 +      W_REG(&di->regs->xmtptr, I2B(di->txout));
 +}
-diff -Nur linux-2.4.30/drivers/net/hnd/linux_osl.c linux-2.4.30-brcm/drivers/net/hnd/linux_osl.c
---- linux-2.4.30/drivers/net/hnd/linux_osl.c   1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/drivers/net/hnd/linux_osl.c      2005-05-22 23:01:31.000000000 +0200
+diff -urN linux.old/drivers/net/hnd/linux_osl.c linux.dev/drivers/net/hnd/linux_osl.c
+--- linux.old/drivers/net/hnd/linux_osl.c      1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/drivers/net/hnd/linux_osl.c      2005-08-26 13:44:34.376381792 +0200
 @@ -0,0 +1,640 @@
 +/*
 + * Linux OS Independent Layer
@@ -17429,45 +17401,22 @@ diff -Nur linux-2.4.30/drivers/net/hnd/linux_osl.c linux-2.4.30-brcm/drivers/net
 +}
 +
 +#endif        /* BINOSL */
-diff -Nur linux-2.4.30/drivers/net/hnd/Makefile linux-2.4.30-brcm/drivers/net/hnd/Makefile
---- linux-2.4.30/drivers/net/hnd/Makefile      1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/drivers/net/hnd/Makefile 2005-05-25 18:54:08.000000000 +0200
-@@ -0,0 +1,19 @@
-+#
-+# Makefile for the BCM47xx specific kernel interface routines
-+# under Linux.
-+#
-+
-+EXTRA_CFLAGS  += -I$(TOPDIR)/arch/mips/bcm947xx/include -DBCMDRIVER
-+
-+O_TARGET      := hnd.o
-+
-+HND_OBJS      := bcmutils.o hnddma.o linux_osl.o sbutils.o bcmsrom.o
-+
-+export-objs   := shared_ksyms.o
-+obj-y         := shared_ksyms.o $(HND_OBJS)
-+obj-m           := $(O_TARGET)
-+
-+include $(TOPDIR)/Rules.make
-+
-+shared_ksyms.c: shared_ksyms.sh $(HND_OBJS)
-+      sh -e $< $(HND_OBJS) > $@
-diff -Nur linux-2.4.30/drivers/net/hnd/sbutils.c linux-2.4.30-brcm/drivers/net/hnd/sbutils.c
---- linux-2.4.30/drivers/net/hnd/sbutils.c     1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/drivers/net/hnd/sbutils.c        2005-05-22 23:01:41.000000000 +0200
-@@ -0,0 +1,2063 @@
+diff -urN linux.old/drivers/net/hnd/sbutils.c linux.dev/drivers/net/hnd/sbutils.c
+--- linux.old/drivers/net/hnd/sbutils.c        1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/drivers/net/hnd/sbutils.c        2005-09-01 01:33:48.212447040 +0200
+@@ -0,0 +1,2061 @@
 +/*
 + * Misc utility routines for accessing chip-specific features
 + * of the SiliconBackplane-based Broadcom chips.
 + *
-+ * Copyright 2004, Broadcom Corporation
++ * Copyright 2005, Broadcom Corporation
 + * All Rights Reserved.
 + * 
 + * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
 + * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
 + * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
 + * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
-+ * $Id$
++ * $Id: sbutils.c,v 1.6 2005/03/07 08:35:32 kanki Exp $
 + */
 +
 +#include <typedefs.h>
@@ -17487,8 +17436,6 @@ diff -Nur linux-2.4.30/drivers/net/hnd/sbutils.c linux-2.4.30-brcm/drivers/net/h
 +#define       SB_ERROR(args)
 +
 +
-+#define CLOCK_BASE_5350               12500000 /* Specific to 5350*/
-+
 +typedef uint32 (*sb_intrsoff_t)(void *intr_arg);
 +typedef void (*sb_intrsrestore_t)(void *intr_arg, uint32 arg);
 +typedef bool (*sb_intrsenabled_t)(void *intr_arg);
@@ -17705,7 +17652,7 @@ diff -Nur linux-2.4.30/drivers/net/hnd/sbutils.c linux-2.4.30-brcm/drivers/net/h
 +              cid = R_REG((uint32 *)regs);
 +              if (((cid & CID_ID_MASK) == BCM4712_DEVICE_ID) &&
 +                  ((cid & CID_PKG_MASK) != BCM4712LARGE_PKG_ID) &&
-+                  ((cid & CID_REV_MASK) <= 0x00020000)) {
++                  ((cid & CID_REV_MASK) <= (3 << CID_REV_SHIFT))) {
 +                      uint32 *scc, val;
 +
 +                      scc = (uint32 *)((uchar*)regs + OFFSETOF(chipcregs_t, slow_clk_ctl));
@@ -18840,7 +18787,10 @@ diff -Nur linux-2.4.30/drivers/net/hnd/sbutils.c linux-2.4.30-brcm/drivers/net/h
 +                      return CC_T6_M1;
 +              else
 +                      return CC_T6_M0;
-+      } else if ((pll_type == PLL_TYPE1) || (pll_type == PLL_TYPE4)|| (pll_type == PLL_TYPE3)) {
++      } else if ((pll_type == PLL_TYPE1) ||
++                 (pll_type == PLL_TYPE3) ||
++                 (pll_type == PLL_TYPE4) ||
++                 (pll_type == PLL_TYPE7)) {
 +              n1 = factor6(n1);
 +              n2 += CC_F5_BIAS;
 +      } else if (pll_type == PLL_TYPE2) {
@@ -18852,12 +18802,13 @@ diff -Nur linux-2.4.30/drivers/net/hnd/sbutils.c linux-2.4.30-brcm/drivers/net/h
 +              return (100000000);
 +      } else
 +              ASSERT((pll_type >= PLL_TYPE1) && (pll_type <= PLL_TYPE4));
-+
-+      /* Special case for 5350 */
-+      if (pll_type == PLL_TYPE3) 
-+              clock =  CLOCK_BASE_5350 * n1 * n2;
++      /* PLL types 3 and 7 use BASE2 (25Mhz) */
++      if ((pll_type == PLL_TYPE3) ||
++          (pll_type == PLL_TYPE7)) { 
++              clock =  CC_CLOCK_BASE2 * n1 * n2;
++      }
 +      else 
-+              clock = CC_CLOCK_BASE * n1 * n2;
++              clock = CC_CLOCK_BASE1 * n1 * n2;
 +
 +      if (clock == 0)
 +              return 0;
@@ -18867,7 +18818,10 @@ diff -Nur linux-2.4.30/drivers/net/hnd/sbutils.c linux-2.4.30-brcm/drivers/net/h
 +      m3 = (m & CC_M3_MASK) >> CC_M3_SHIFT;
 +      mc = (m & CC_MC_MASK) >> CC_MC_SHIFT;
 +
-+      if ((pll_type == PLL_TYPE1) || (pll_type == PLL_TYPE4) || (pll_type == PLL_TYPE3)) {
++      if ((pll_type == PLL_TYPE1) ||
++          (pll_type == PLL_TYPE3) ||
++          (pll_type == PLL_TYPE4) ||
++          (pll_type == PLL_TYPE7)) {
 +              m1 = factor6(m1);
 +              if ((pll_type == PLL_TYPE1) || (pll_type == PLL_TYPE3))
 +                      m2 += CC_F5_BIAS;
@@ -18931,13 +18885,8 @@ diff -Nur linux-2.4.30/drivers/net/hnd/sbutils.c linux-2.4.30-brcm/drivers/net/h
 +              n = R_REG(&cc->clockcontrol_n);
 +              if (pll_type == PLL_TYPE6)
 +                      m = R_REG(&cc->clockcontrol_mips);
-+              else if (pll_type == PLL_TYPE3)
-+              {
-+                      // Added by Chen-I for 5365 
-+                      if (BCMINIT(sb_chip)(sbh) == BCM5365_DEVICE_ID)         
-+                              m = R_REG(&cc->clockcontrol_sb);
-+                      else m = R_REG(&cc->clockcontrol_m2);
-+              }
++              else if ((pll_type == PLL_TYPE3) && (BCMINIT(sb_chip)(sbh) != BCM5365_DEVICE_ID))
++                      m = R_REG(&cc->clockcontrol_m2);
 +              else
 +                      m = R_REG(&cc->clockcontrol_sb);
 +      } else {
@@ -18945,18 +18894,16 @@ diff -Nur linux-2.4.30/drivers/net/hnd/sbutils.c linux-2.4.30-brcm/drivers/net/h
 +              return 0;
 +      }
 +
-+      // Added by Chen-I for 5365 
-+      if (BCMINIT(sb_chip)(sbh) == BCM5365_DEVICE_ID)
-+      {
-+              rate = 100000000;       
-+      }
-+      else
-+      {
++      if (BCMINIT(sb_chip)(sbh) == BCM5365_DEVICE_ID) {
++              rate = 100000000;
++      } else {
 +              /* calculate rate */
 +              rate = sb_clock_rate(pll_type, n, m);
-+              if (pll_type == PLL_TYPE3) rate = rate / 2;
++              if (pll_type == PLL_TYPE3)
++                      rate = rate / 2;
 +      }
 +
++
 +      /* switch back to previous core */
 +      sb_setcoreidx(sbh, idx);
 +
@@ -19519,9 +19466,9 @@ diff -Nur linux-2.4.30/drivers/net/hnd/sbutils.c linux-2.4.30-brcm/drivers/net/h
 +}
 +
 +
-diff -Nur linux-2.4.30/drivers/net/hnd/shared_ksyms.sh linux-2.4.30-brcm/drivers/net/hnd/shared_ksyms.sh
---- linux-2.4.30/drivers/net/hnd/shared_ksyms.sh       1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/drivers/net/hnd/shared_ksyms.sh  2005-05-22 22:55:51.000000000 +0200
+diff -urN linux.old/drivers/net/hnd/shared_ksyms.sh linux.dev/drivers/net/hnd/shared_ksyms.sh
+--- linux.old/drivers/net/hnd/shared_ksyms.sh  1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/drivers/net/hnd/shared_ksyms.sh  2005-08-26 13:44:34.406377232 +0200
 @@ -0,0 +1,21 @@
 +#!/bin/sh
 +#
@@ -19544,65 +19491,9 @@ diff -Nur linux-2.4.30/drivers/net/hnd/shared_ksyms.sh linux-2.4.30-brcm/drivers
 +for file in $* ; do
 +    ${NM} $file | sed -ne 's/[0-9A-Fa-f]* [DT] \([^ ]*\)/extern void \1; EXPORT_SYMBOL(\1);/p'
 +done
-diff -Nur linux-2.4.30/drivers/net/Makefile linux-2.4.30-brcm/drivers/net/Makefile
---- linux-2.4.30/drivers/net/Makefile  2005-01-19 15:09:56.000000000 +0100
-+++ linux-2.4.30-brcm/drivers/net/Makefile     2005-05-25 19:07:52.000000000 +0200
-@@ -3,6 +3,8 @@
- # Makefile for the Linux network (ethercard) device drivers.
- #
-+EXTRA_CFLAGS := -I$(TOPDIR)/arch/mips/bcm947xx/include
-+
- obj-y           :=
- obj-m           :=
- obj-n           :=
-@@ -21,6 +23,8 @@
- list-multi    :=      rcpci.o
- rcpci-objs    :=      rcpci45.o rclanmtl.o
-+subdir-m += diag
-+
- ifeq ($(CONFIG_TULIP),y)
-   obj-y += tulip/tulip.o
- endif
-@@ -39,6 +43,9 @@
-   obj-$(CONFIG_ISDN) += slhc.o
- endif
-+subdir-$(CONFIG_HND) += hnd
-+subdir-$(CONFIG_ET) += et
-+subdir-$(CONFIG_WL) += wl
- subdir-$(CONFIG_NET_PCMCIA) += pcmcia
- subdir-$(CONFIG_NET_WIRELESS) += wireless
- subdir-$(CONFIG_TULIP) += tulip
-@@ -69,6 +76,16 @@
- obj-$(CONFIG_MYRI_SBUS) += myri_sbus.o
- obj-$(CONFIG_SUNGEM) += sungem.o
-+ifeq ($(CONFIG_HND),y)
-+  obj-y += hnd/hnd.o
-+endif
-+ifeq ($(CONFIG_ET),y)
-+  obj-y += et/et.o
-+endif
-+ifeq ($(CONFIG_WL),y)
-+  obj-y += wl/wl.o
-+endif
-+
- obj-$(CONFIG_MACE) += mace.o
- obj-$(CONFIG_BMAC) += bmac.o
- obj-$(CONFIG_GMAC) += gmac.o
-@@ -265,6 +282,7 @@
- endif
- endif
-+
- include $(TOPDIR)/Rules.make
- clean:
-diff -Nur linux-2.4.30/drivers/net/wireless/Config.in linux-2.4.30-brcm/drivers/net/wireless/Config.in
---- linux-2.4.30/drivers/net/wireless/Config.in        2004-11-17 12:54:21.000000000 +0100
-+++ linux-2.4.30-brcm/drivers/net/wireless/Config.in   2005-05-22 22:55:52.000000000 +0200
+diff -urN linux.old/drivers/net/wireless/Config.in linux.dev/drivers/net/wireless/Config.in
+--- linux.old/drivers/net/wireless/Config.in   2004-11-17 12:54:21.000000000 +0100
++++ linux.dev/drivers/net/wireless/Config.in   2005-08-26 13:44:34.427374040 +0200
 @@ -13,6 +13,7 @@
  fi
  
@@ -19611,9 +19502,9 @@ diff -Nur linux-2.4.30/drivers/net/wireless/Config.in linux-2.4.30-brcm/drivers/
     dep_tristate '    Hermes in PLX9052 based PCI adaptor support (Netgear MA301 etc.) (EXPERIMENTAL)' CONFIG_PLX_HERMES $CONFIG_HERMES $CONFIG_EXPERIMENTAL
     dep_tristate '    Hermes in TMD7160/NCP130 based PCI adaptor support (Pheecom WL-PCI etc.) (EXPERIMENTAL)' CONFIG_TMD_HERMES $CONFIG_HERMES $CONFIG_EXPERIMENTAL
     dep_tristate '    Prism 2.5 PCI 802.11b adaptor support (EXPERIMENTAL)' CONFIG_PCI_HERMES $CONFIG_HERMES $CONFIG_EXPERIMENTAL
-diff -Nur linux-2.4.30/drivers/net/wl/Makefile linux-2.4.30-brcm/drivers/net/wl/Makefile
---- linux-2.4.30/drivers/net/wl/Makefile       1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/drivers/net/wl/Makefile  2005-05-26 12:04:50.000000000 +0200
+diff -urN linux.old/drivers/net/wl/Makefile linux.dev/drivers/net/wl/Makefile
+--- linux.old/drivers/net/wl/Makefile  1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/drivers/net/wl/Makefile  2005-08-26 13:44:34.427374040 +0200
 @@ -0,0 +1,26 @@
 +#
 +# Makefile for the Broadcom wl driver
@@ -19641,9 +19532,9 @@ diff -Nur linux-2.4.30/drivers/net/wl/Makefile linux-2.4.30-brcm/drivers/net/wl/
 +obj-m         := $(O_TARGET)
 +
 +include $(TOPDIR)/Rules.make
-diff -Nur linux-2.4.30/drivers/parport/Config.in linux-2.4.30-brcm/drivers/parport/Config.in
---- linux-2.4.30/drivers/parport/Config.in     2004-02-18 14:36:31.000000000 +0100
-+++ linux-2.4.30-brcm/drivers/parport/Config.in        2005-05-22 22:55:52.000000000 +0200
+diff -urN linux.old/drivers/parport/Config.in linux.dev/drivers/parport/Config.in
+--- linux.old/drivers/parport/Config.in        2004-02-18 14:36:31.000000000 +0100
++++ linux.dev/drivers/parport/Config.in        2005-08-26 13:44:34.428373888 +0200
 @@ -11,6 +11,7 @@
  tristate 'Parallel port support' CONFIG_PARPORT
  if [ "$CONFIG_PARPORT" != "n" ]; then
@@ -19652,9 +19543,9 @@ diff -Nur linux-2.4.30/drivers/parport/Config.in linux-2.4.30-brcm/drivers/parpo
     if [ "$CONFIG_PARPORT_PC" != "n" -a "$CONFIG_SERIAL" != "n" ]; then
        if [ "$CONFIG_SERIAL" = "m" ]; then
           define_tristate CONFIG_PARPORT_PC_CML1 m
-diff -Nur linux-2.4.30/drivers/parport/Makefile linux-2.4.30-brcm/drivers/parport/Makefile
---- linux-2.4.30/drivers/parport/Makefile      2004-08-08 01:26:05.000000000 +0200
-+++ linux-2.4.30-brcm/drivers/parport/Makefile 2005-05-22 22:55:52.000000000 +0200
+diff -urN linux.old/drivers/parport/Makefile linux.dev/drivers/parport/Makefile
+--- linux.old/drivers/parport/Makefile 2004-08-08 01:26:05.000000000 +0200
++++ linux.dev/drivers/parport/Makefile 2005-08-26 13:44:34.428373888 +0200
 @@ -22,6 +22,7 @@
  
  obj-$(CONFIG_PARPORT)         += parport.o
@@ -19663,9 +19554,9 @@ diff -Nur linux-2.4.30/drivers/parport/Makefile linux-2.4.30-brcm/drivers/parpor
  obj-$(CONFIG_PARPORT_PC_PCMCIA)       += parport_cs.o
  obj-$(CONFIG_PARPORT_AMIGA)   += parport_amiga.o
  obj-$(CONFIG_PARPORT_MFC3)    += parport_mfc3.o
-diff -Nur linux-2.4.30/drivers/parport/parport_splink.c linux-2.4.30-brcm/drivers/parport/parport_splink.c
---- linux-2.4.30/drivers/parport/parport_splink.c      1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/drivers/parport/parport_splink.c 2005-05-22 22:55:52.000000000 +0200
+diff -urN linux.old/drivers/parport/parport_splink.c linux.dev/drivers/parport/parport_splink.c
+--- linux.old/drivers/parport/parport_splink.c 1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/drivers/parport/parport_splink.c 2005-08-26 13:44:34.429373736 +0200
 @@ -0,0 +1,345 @@
 +/* Low-level parallel port routines for the ASUS WL-500g built-in port
 + *
@@ -20012,9 +19903,32 @@ diff -Nur linux-2.4.30/drivers/parport/parport_splink.c linux-2.4.30-brcm/driver
 +module_init(parport_splink_init)
 +module_exit(parport_splink_cleanup)
 +
-diff -Nur linux-2.4.30/drivers/pcmcia/bcm4710_generic.c linux-2.4.30-brcm/drivers/pcmcia/bcm4710_generic.c
---- linux-2.4.30/drivers/pcmcia/bcm4710_generic.c      1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/drivers/pcmcia/bcm4710_generic.c 2005-05-22 22:55:52.000000000 +0200
+diff -urN linux.old/drivers/pcmcia/Makefile linux.dev/drivers/pcmcia/Makefile
+--- linux.old/drivers/pcmcia/Makefile  2005-08-26 13:41:42.048579600 +0200
++++ linux.dev/drivers/pcmcia/Makefile  2005-08-26 13:44:34.430373584 +0200
+@@ -74,6 +74,10 @@
+ au1000_ss-objs-$(CONFIG_MIPS_HYDROGEN3)               += au1000_hydrogen3.o
+ au1000_ss-objs-$(CONFIG_MIPS_XXS1500)                 += au1000_xxs1500.o
++obj-$(CONFIG_PCMCIA_BCM4710)  += bcm4710_ss.o
++bcm4710_ss-objs                                       := bcm4710_generic.o
++bcm4710_ss-objs                                       += bcm4710_pcmcia.o
++
+ obj-$(CONFIG_PCMCIA_SA1100)   += sa1100_cs.o
+ obj-$(CONFIG_PCMCIA_M8XX)     += m8xx_pcmcia.o
+ obj-$(CONFIG_PCMCIA_SIBYTE)   += sibyte_generic.o
+@@ -112,5 +116,8 @@
+ au1x00_ss.o: $(au1000_ss-objs-y)
+       $(LD) -r -o $@ $(au1000_ss-objs-y)
++bcm4710_ss.o: $(bcm4710_ss-objs)
++      $(LD) -r -o $@ $(bcm4710_ss-objs)
++
+ yenta_socket.o: $(yenta_socket-objs)
+       $(LD) $(LD_RFLAG) -r -o $@ $(yenta_socket-objs)
+diff -urN linux.old/drivers/pcmcia/bcm4710_generic.c linux.dev/drivers/pcmcia/bcm4710_generic.c
+--- linux.old/drivers/pcmcia/bcm4710_generic.c 1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/drivers/pcmcia/bcm4710_generic.c 2005-08-26 13:44:34.432373280 +0200
 @@ -0,0 +1,912 @@
 +/*
 + *
@@ -20928,9 +20842,9 @@ diff -Nur linux-2.4.30/drivers/pcmcia/bcm4710_generic.c linux-2.4.30-brcm/driver
 +
 +
 +#endif  /* defined(CONFIG_PROC_FS) */
-diff -Nur linux-2.4.30/drivers/pcmcia/bcm4710_pcmcia.c linux-2.4.30-brcm/drivers/pcmcia/bcm4710_pcmcia.c
---- linux-2.4.30/drivers/pcmcia/bcm4710_pcmcia.c       1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/drivers/pcmcia/bcm4710_pcmcia.c  2005-05-22 22:55:52.000000000 +0200
+diff -urN linux.old/drivers/pcmcia/bcm4710_pcmcia.c linux.dev/drivers/pcmcia/bcm4710_pcmcia.c
+--- linux.old/drivers/pcmcia/bcm4710_pcmcia.c  1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/drivers/pcmcia/bcm4710_pcmcia.c  2005-08-26 13:44:34.433373128 +0200
 @@ -0,0 +1,266 @@
 +/*
 + * BCM4710 specific pcmcia routines.
@@ -21198,9 +21112,9 @@ diff -Nur linux-2.4.30/drivers/pcmcia/bcm4710_pcmcia.c linux-2.4.30-brcm/drivers
 +      bcm4710_pcmcia_configure_socket
 +};
 +
-diff -Nur linux-2.4.30/drivers/pcmcia/bcm4710pcmcia.h linux-2.4.30-brcm/drivers/pcmcia/bcm4710pcmcia.h
---- linux-2.4.30/drivers/pcmcia/bcm4710pcmcia.h        1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.30-brcm/drivers/pcmcia/bcm4710pcmcia.h   2005-05-22 22:55:52.000000000 +0200
+diff -urN linux.old/drivers/pcmcia/bcm4710pcmcia.h linux.dev/drivers/pcmcia/bcm4710pcmcia.h
+--- linux.old/drivers/pcmcia/bcm4710pcmcia.h   1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/drivers/pcmcia/bcm4710pcmcia.h   2005-08-26 13:44:34.433373128 +0200
 @@ -0,0 +1,118 @@
 +/*
 + *
@@ -21320,32 +21234,9 @@ diff -Nur linux-2.4.30/drivers/pcmcia/bcm4710pcmcia.h linux-2.4.30-brcm/drivers/
 +extern struct pcmcia_low_level bcm4710_pcmcia_ops;
 +
 +#endif  /* !defined(_BCM4710PCMCIA_H) */
-diff -Nur linux-2.4.30/drivers/pcmcia/Makefile linux-2.4.30-brcm/drivers/pcmcia/Makefile
---- linux-2.4.30/drivers/pcmcia/Makefile       2004-02-18 14:36:31.000000000 +0100
-+++ linux-2.4.30-brcm/drivers/pcmcia/Makefile  2005-05-22 22:55:52.000000000 +0200
-@@ -65,6 +65,10 @@
- au1000_ss-objs-$(CONFIG_PCMCIA_DB1X00)                += au1000_db1x00.o
- au1000_ss-objs-$(CONFIG_PCMCIA_XXS1500)       += au1000_xxs1500.o
-+obj-$(CONFIG_PCMCIA_BCM4710)  += bcm4710_ss.o
-+bcm4710_ss-objs                                       := bcm4710_generic.o
-+bcm4710_ss-objs                                       += bcm4710_pcmcia.o
-+
- obj-$(CONFIG_PCMCIA_SA1100)   += sa1100_cs.o
- obj-$(CONFIG_PCMCIA_M8XX)     += m8xx_pcmcia.o
- obj-$(CONFIG_PCMCIA_SIBYTE)   += sibyte_generic.o
-@@ -102,5 +106,8 @@
- au1x00_ss.o: $(au1000_ss-objs-y)
-       $(LD) -r -o $@ $(au1000_ss-objs-y)
-+bcm4710_ss.o: $(bcm4710_ss-objs)
-+      $(LD) -r -o $@ $(bcm4710_ss-objs)
-+
- yenta_socket.o: $(yenta_socket-objs)
-       $(LD) $(LD_RFLAG) -r -o $@ $(yenta_socket-objs)
-diff -Nur linux-2.4.30/include/asm-mips/bootinfo.h linux-2.4.30-brcm/include/asm-mips/bootinfo.h
---- linux-2.4.30/include/asm-mips/bootinfo.h   2004-02-18 14:36:32.000000000 +0100
-+++ linux-2.4.30-brcm/include/asm-mips/bootinfo.h      2005-05-22 22:55:53.000000000 +0200
+diff -urN linux.old/include/asm-mips/bootinfo.h linux.dev/include/asm-mips/bootinfo.h
+--- linux.old/include/asm-mips/bootinfo.h      2005-08-26 13:41:42.329536888 +0200
++++ linux.dev/include/asm-mips/bootinfo.h      2005-08-26 13:44:34.447371000 +0200
 @@ -37,6 +37,7 @@
  #define MACH_GROUP_HP_LJ       20 /* Hewlett Packard LaserJet               */
  #define MACH_GROUP_LASAT       21
@@ -21354,7 +21245,7 @@ diff -Nur linux-2.4.30/include/asm-mips/bootinfo.h linux-2.4.30-brcm/include/asm
  
  /*
   * Valid machtype values for group unknown (low order halfword of mips_machtype)
-@@ -194,6 +195,15 @@
+@@ -197,6 +198,15 @@
  #define MACH_TANBAC_TB0229    7       /* TANBAC TB0229 (VR4131DIMM) */
  
  /*
@@ -21370,9 +21261,9 @@ diff -Nur linux-2.4.30/include/asm-mips/bootinfo.h linux-2.4.30-brcm/include/asm
   * Valid machtype for group TITAN
   */
  #define       MACH_TITAN_YOSEMITE     1       /* PMC-Sierra Yosemite */
-diff -Nur linux-2.4.30/include/asm-mips/cpu.h linux-2.4.30-brcm/include/asm-mips/cpu.h
---- linux-2.4.30/include/asm-mips/cpu.h        2005-01-19 15:10:11.000000000 +0100
-+++ linux-2.4.30-brcm/include/asm-mips/cpu.h   2005-05-22 22:55:53.000000000 +0200
+diff -urN linux.old/include/asm-mips/cpu.h linux.dev/include/asm-mips/cpu.h
+--- linux.old/include/asm-mips/cpu.h   2005-01-19 15:10:11.000000000 +0100
++++ linux.dev/include/asm-mips/cpu.h   2005-08-26 13:44:34.455369784 +0200
 @@ -22,6 +22,11 @@
     spec.
  */
@@ -21421,9 +21312,9 @@ diff -Nur linux-2.4.30/include/asm-mips/cpu.h linux-2.4.30-brcm/include/asm-mips
  
  /*
   * ISA Level encodings
-diff -Nur linux-2.4.30/include/asm-mips/r4kcache.h linux-2.4.30-brcm/include/asm-mips/r4kcache.h
---- linux-2.4.30/include/asm-mips/r4kcache.h   2004-02-18 14:36:32.000000000 +0100
-+++ linux-2.4.30-brcm/include/asm-mips/r4kcache.h      2005-05-25 18:01:08.000000000 +0200
+diff -urN linux.old/include/asm-mips/r4kcache.h linux.dev/include/asm-mips/r4kcache.h
+--- linux.old/include/asm-mips/r4kcache.h      2004-02-18 14:36:32.000000000 +0100
++++ linux.dev/include/asm-mips/r4kcache.h      2005-08-26 13:44:34.457369480 +0200
 @@ -567,4 +567,17 @@
                        cache128_unroll32(addr|ws,Index_Writeback_Inv_SD);
  }
@@ -21442,9 +21333,9 @@ diff -Nur linux-2.4.30/include/asm-mips/r4kcache.h linux-2.4.30-brcm/include/asm
 +}      
 +
  #endif /* __ASM_R4KCACHE_H */
-diff -Nur linux-2.4.30/include/asm-mips/serial.h linux-2.4.30-brcm/include/asm-mips/serial.h
---- linux-2.4.30/include/asm-mips/serial.h     2005-01-19 15:10:12.000000000 +0100
-+++ linux-2.4.30-brcm/include/asm-mips/serial.h        2005-05-22 22:55:53.000000000 +0200
+diff -urN linux.old/include/asm-mips/serial.h linux.dev/include/asm-mips/serial.h
+--- linux.old/include/asm-mips/serial.h        2005-01-19 15:10:12.000000000 +0100
++++ linux.dev/include/asm-mips/serial.h        2005-08-26 13:44:34.459369176 +0200
 @@ -223,6 +223,13 @@
  #define TXX927_SERIAL_PORT_DEFNS
  #endif
@@ -21467,10 +21358,10 @@ diff -Nur linux-2.4.30/include/asm-mips/serial.h linux-2.4.30-brcm/include/asm-m
        COBALT_SERIAL_PORT_DEFNS                \
        DDB5477_SERIAL_PORT_DEFNS               \
        EV96100_SERIAL_PORT_DEFNS               \
-diff -Nur linux-2.4.30/init/do_mounts.c linux-2.4.30-brcm/init/do_mounts.c
---- linux-2.4.30/init/do_mounts.c      2003-11-28 19:26:21.000000000 +0100
-+++ linux-2.4.30-brcm/init/do_mounts.c 2005-05-22 22:55:53.000000000 +0200
-@@ -253,7 +253,13 @@
+diff -urN linux.old/init/do_mounts.c linux.dev/init/do_mounts.c
+--- linux.old/init/do_mounts.c 2005-08-26 13:41:42.608494480 +0200
++++ linux.dev/init/do_mounts.c 2005-08-26 13:44:34.481365832 +0200
+@@ -254,7 +254,13 @@
        { "ftlb", 0x2c08 },
        { "ftlc", 0x2c10 },
        { "ftld", 0x2c18 },
@@ -21484,67 +21375,3 @@ diff -Nur linux-2.4.30/init/do_mounts.c linux-2.4.30-brcm/init/do_mounts.c
        { "nb", 0x2b00 },
        { NULL, 0 }
  };
-diff -Nur linux-2.4.30/Makefile linux-2.4.30-brcm/Makefile
---- linux-2.4.30/Makefile      2005-04-04 03:42:20.000000000 +0200
-+++ linux-2.4.30-brcm/Makefile 2005-05-22 22:55:53.000000000 +0200
-@@ -17,9 +17,9 @@
- FINDHPATH     = $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net $(HPATH)/math-emu
- HOSTCC        = gcc
--HOSTCFLAGS    = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
-+HOSTCFLAGS    = -Wall -Wstrict-prototypes -Os -fomit-frame-pointer
--CROSS_COMPILE         =
-+CROSS_COMPILE=
- #
- # Include the make variables (CC, etc...)
-@@ -91,8 +91,10 @@
- CPPFLAGS := -D__KERNEL__ -I$(HPATH)
--CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
-+CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -Os \
-         -fno-strict-aliasing -fno-common
-+
-+
- ifndef CONFIG_FRAME_POINTER
- CFLAGS += -fomit-frame-pointer
- endif
-@@ -354,7 +356,7 @@
-       @rm -f .ver1
- include/linux/version.h: ./Makefile
--      @expr length "$(KERNELRELEASE)" \<= $(uts_len) > /dev/null || \
-+      @-expr length "$(KERNELRELEASE)" \<= $(uts_len) > /dev/null || \
-         (echo KERNELRELEASE \"$(KERNELRELEASE)\" exceeds $(uts_len) characters >&2; false)
-       @echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" > .ver
-       @echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> .ver
-@@ -500,7 +502,7 @@
- ifdef CONFIG_MODVERSIONS
-       $(MAKE) update-modverfile
- endif
--      scripts/mkdep -- `find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend
-+      (find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print | xargs -r scripts/mkdep -- ) > .hdepend
-       scripts/mkdep -- init/*.c > .depend
- ifdef CONFIG_MODVERSIONS
-diff -Nur linux-2.4.30/Rules.make linux-2.4.30-brcm/Rules.make
---- linux-2.4.30/Rules.make    2004-02-18 14:36:30.000000000 +0100
-+++ linux-2.4.30-brcm/Rules.make       2005-05-26 17:11:14.000000000 +0200
-@@ -176,7 +176,14 @@
- _modinst__: dummy
- ifneq "$(strip $(ALL_MOBJS))" ""
-       mkdir -p $(MODLIB)/kernel/$(MOD_DESTDIR)
--      cp $(sort $(ALL_MOBJS)) $(MODLIB)/kernel/$(MOD_DESTDIR)
-+      #@cp $(sort $(ALL_MOBJS)) $(MODLIB)/kernel/$(MOD_DESTDIR)
-+      for f in $(ALL_MOBJS) ; do \
-+              $(OBJCOPY) -R __ksymtab -R .comment -R .note -x \
-+              `$(NM) $$f | cut -f3- -d' ' | sed -n \
-+                      -e 's/__module_parm_\(.*\)/-K \1/p' \
-+                      -e 's/__ks..tab_\(.*\)/-K \1/p'` \
-+              $$f $(MODLIB)/kernel/$(MOD_DESTDIR)$(MOD_TARGET)$$f; \
-+      done
- endif
- .PHONY: modules_install
diff --git a/openwrt/target/linux/linux-2.4/patches/brcm/003-bcm47xx_cache_fixes.patch b/openwrt/target/linux/linux-2.4/patches/brcm/003-bcm47xx_cache_fixes.patch
new file mode 100644 (file)
index 0000000..e971e7f
--- /dev/null
@@ -0,0 +1,498 @@
+diff -urN linux.old/arch/mips/kernel/entry.S linux.dev/arch/mips/kernel/entry.S
+--- linux.old/arch/mips/kernel/entry.S 2005-07-05 16:46:49.000000000 +0200
++++ linux.dev/arch/mips/kernel/entry.S 2005-07-06 11:23:55.000000000 +0200
+@@ -100,6 +100,10 @@
+                * and R4400 SC and MC versions.
+                */
+ NESTED(except_vec3_generic, 0, sp)
++#ifdef CONFIG_BCM4710
++              nop
++              nop
++#endif
+ #if R5432_CP0_INTERRUPT_WAR
+               mfc0    k0, CP0_INDEX
+ #endif
+diff -urN linux.old/arch/mips/mm/c-r4k.c linux.dev/arch/mips/mm/c-r4k.c
+--- linux.old/arch/mips/mm/c-r4k.c     2005-07-05 16:46:49.000000000 +0200
++++ linux.dev/arch/mips/mm/c-r4k.c     2005-07-06 11:23:55.000000000 +0200
+@@ -14,6 +14,12 @@
+ #include <linux/mm.h>
+ #include <linux/bitops.h>
++#ifdef CONFIG_BCM4710
++#include "../bcm947xx/include/typedefs.h"
++#include "../bcm947xx/include/sbconfig.h"
++#include <asm/paccess.h>
++#endif
++
+ #include <asm/bcache.h>
+ #include <asm/bootinfo.h>
+ #include <asm/cacheops.h>
+@@ -40,6 +46,8 @@
+       .bc_inv = (void *)no_sc_noop
+ };
++int bcm4710 = 0;
++EXPORT_SYMBOL(bcm4710);
+ struct bcache_ops *bcops = &no_sc_ops;
+ #define cpu_is_r4600_v1_x()   ((read_c0_prid() & 0xfffffff0) == 0x2010)
+@@ -64,8 +72,10 @@
+ static inline void r4k_blast_dcache_page_setup(void)
+ {
+       unsigned long dc_lsize = current_cpu_data.dcache.linesz;
+-
+-      if (dc_lsize == 16)
++      
++      if (bcm4710)
++              r4k_blast_dcache_page = blast_dcache_page;
++      else if (dc_lsize == 16)
+               r4k_blast_dcache_page = blast_dcache16_page;
+       else if (dc_lsize == 32)
+               r4k_blast_dcache_page = r4k_blast_dcache_page_dc32;
+@@ -77,7 +87,9 @@
+ {
+       unsigned long dc_lsize = current_cpu_data.dcache.linesz;
+-      if (dc_lsize == 16)
++      if (bcm4710)
++              r4k_blast_dcache_page_indexed = blast_dcache_page_indexed;
++      else if (dc_lsize == 16)
+               r4k_blast_dcache_page_indexed = blast_dcache16_page_indexed;
+       else if (dc_lsize == 32)
+               r4k_blast_dcache_page_indexed = blast_dcache32_page_indexed;
+@@ -89,7 +101,9 @@
+ {
+       unsigned long dc_lsize = current_cpu_data.dcache.linesz;
+-      if (dc_lsize == 16)
++      if (bcm4710)
++              r4k_blast_dcache = blast_dcache;
++      else if (dc_lsize == 16)
+               r4k_blast_dcache = blast_dcache16;
+       else if (dc_lsize == 32)
+               r4k_blast_dcache = blast_dcache32;
+@@ -266,6 +280,7 @@
+       r4k_blast_dcache();
+       r4k_blast_icache();
++      if (!bcm4710)
+       switch (current_cpu_data.cputype) {
+       case CPU_R4000SC:
+       case CPU_R4000MC:
+@@ -304,10 +319,10 @@
+        * Kludge alert.  For obscure reasons R4000SC and R4400SC go nuts if we
+        * only flush the primary caches but R10000 and R12000 behave sane ...
+        */
+-      if (current_cpu_data.cputype == CPU_R4000SC ||
++      if (!bcm4710 && (current_cpu_data.cputype == CPU_R4000SC ||
+           current_cpu_data.cputype == CPU_R4000MC ||
+           current_cpu_data.cputype == CPU_R4400SC ||
+-          current_cpu_data.cputype == CPU_R4400MC)
++          current_cpu_data.cputype == CPU_R4400MC))
+               r4k_blast_scache();
+ }
+@@ -383,12 +398,15 @@
+       unsigned long ic_lsize = current_cpu_data.icache.linesz;
+       unsigned long addr, aend;
++      addr = start & ~(dc_lsize - 1);
++      aend = (end - 1) & ~(dc_lsize - 1);
++
+       if (!cpu_has_ic_fills_f_dc) {
+               if (end - start > dcache_size)
+                       r4k_blast_dcache();
+               else {
+-                      addr = start & ~(dc_lsize - 1);
+-                      aend = (end - 1) & ~(dc_lsize - 1);
++                      BCM4710_PROTECTED_FILL_TLB(addr);
++                      BCM4710_PROTECTED_FILL_TLB(aend);
+                       while (1) {
+                               /* Hit_Writeback_Inv_D */
+@@ -403,8 +421,6 @@
+       if (end - start > icache_size)
+               r4k_blast_icache();
+       else {
+-              addr = start & ~(ic_lsize - 1);
+-              aend = (end - 1) & ~(ic_lsize - 1);
+               while (1) {
+                       /* Hit_Invalidate_I */
+                       protected_flush_icache_line(addr);
+@@ -413,6 +429,9 @@
+                       addr += ic_lsize;
+               }
+       }
++
++      if (bcm4710)
++              flush_cache_all();
+ }
+ /*
+@@ -443,7 +462,8 @@
+       if (cpu_has_subset_pcaches) {
+               unsigned long addr = (unsigned long) page_address(page);
+-              r4k_blast_scache_page(addr);
++              if (!bcm4710)
++                      r4k_blast_scache_page(addr);
+               ClearPageDcacheDirty(page);
+               return;
+@@ -451,6 +471,7 @@
+       if (!cpu_has_ic_fills_f_dc) {
+               unsigned long addr = (unsigned long) page_address(page);
++
+               r4k_blast_dcache_page(addr);
+               ClearPageDcacheDirty(page);
+       }
+@@ -477,7 +498,7 @@
+       /* Catch bad driver code */
+       BUG_ON(size == 0);
+-      if (cpu_has_subset_pcaches) {
++      if (!bcm4710 && cpu_has_subset_pcaches) {
+               unsigned long sc_lsize = current_cpu_data.scache.linesz;
+               if (size >= scache_size) {
+@@ -509,6 +530,8 @@
+               R4600_HIT_CACHEOP_WAR_IMPL;
+               a = addr & ~(dc_lsize - 1);
+               end = (addr + size - 1) & ~(dc_lsize - 1);
++              BCM4710_FILL_TLB(a);
++              BCM4710_FILL_TLB(end);
+               while (1) {
+                       flush_dcache_line(a);   /* Hit_Writeback_Inv_D */
+                       if (a == end)
+@@ -527,7 +550,7 @@
+       /* Catch bad driver code */
+       BUG_ON(size == 0);
+-      if (cpu_has_subset_pcaches) {
++      if (!bcm4710 && (cpu_has_subset_pcaches)) {
+               unsigned long sc_lsize = current_cpu_data.scache.linesz;
+               if (size >= scache_size) {
+@@ -554,6 +577,8 @@
+               R4600_HIT_CACHEOP_WAR_IMPL;
+               a = addr & ~(dc_lsize - 1);
+               end = (addr + size - 1) & ~(dc_lsize - 1);
++              BCM4710_FILL_TLB(a);
++              BCM4710_FILL_TLB(end);
+               while (1) {
+                       flush_dcache_line(a);   /* Hit_Writeback_Inv_D */
+                       if (a == end)
+@@ -577,6 +602,8 @@
+       unsigned long dc_lsize = current_cpu_data.dcache.linesz;
+       R4600_HIT_CACHEOP_WAR_IMPL;
++      BCM4710_PROTECTED_FILL_TLB(addr);
++      BCM4710_PROTECTED_FILL_TLB(addr + 4);
+       protected_writeback_dcache_line(addr & ~(dc_lsize - 1));
+       protected_flush_icache_line(addr & ~(ic_lsize - 1));
+       if (MIPS4K_ICACHE_REFILL_WAR) {
+@@ -986,10 +1013,12 @@
+       case CPU_R4000MC:
+       case CPU_R4400SC:
+       case CPU_R4400MC:
+-              probe_scache_kseg1 = (probe_func_t) (KSEG1ADDR(&probe_scache));
+-              sc_present = probe_scache_kseg1(config);
+-              if (sc_present)
+-                      c->options |= MIPS_CPU_CACHE_CDEX_S;
++              if (!bcm4710) {
++                      probe_scache_kseg1 = (probe_func_t) (KSEG1ADDR(&probe_scache));
++                      sc_present = probe_scache_kseg1(config);
++                      if (sc_present)
++                              c->options |= MIPS_CPU_CACHE_CDEX_S;
++              }
+               break;
+       case CPU_R10000:
+@@ -1041,6 +1070,19 @@
+ static inline void coherency_setup(void)
+ {
+       change_c0_config(CONF_CM_CMASK, CONF_CM_DEFAULT);
++      
++#if defined(CONFIG_BCM4310) || defined(CONFIG_BCM4704) || defined(CONFIG_BCM5365)
++      if (BCM330X(current_cpu_data.processor_id)) {
++              uint32 cm;
++
++              cm = read_c0_diag();
++              /* Enable icache */
++              cm |= (1 << 31);
++              /* Enable dcache */
++              cm |= (1 << 30);
++              write_c0_diag(cm);
++      }
++#endif
+       /*
+        * c0_status.cu=0 specifies that updates by the sc instruction use
+@@ -1073,6 +1115,12 @@
+       memcpy((void *)(KSEG0 + 0x100), &except_vec2_generic, 0x80);
+       memcpy((void *)(KSEG1 + 0x100), &except_vec2_generic, 0x80);
++      if (current_cpu_data.cputype == CPU_BCM4710 && (current_cpu_data.processor_id & PRID_REV_MASK) == 0) {
++              printk("Enabling BCM4710A0 cache workarounds.\n");
++              bcm4710 = 1;
++      } else
++              bcm4710 = 0;
++      
+       probe_pcache();
+       setup_scache();
+diff -urN linux.old/arch/mips/mm/tlbex-mips32.S linux.dev/arch/mips/mm/tlbex-mips32.S
+--- linux.old/arch/mips/mm/tlbex-mips32.S      2005-07-05 16:46:49.000000000 +0200
++++ linux.dev/arch/mips/mm/tlbex-mips32.S      2005-07-06 11:23:56.000000000 +0200
+@@ -90,6 +90,9 @@
+       .set    noat
+       LEAF(except_vec0_r4000)
+       .set    mips3
++#ifdef CONFIG_BCM4704
++      nop
++#endif
+ #ifdef CONFIG_SMP
+       mfc0    k1, CP0_CONTEXT
+       la      k0, pgd_current
+diff -urN linux.old/include/asm-mips/r4kcache.h linux.dev/include/asm-mips/r4kcache.h
+--- linux.old/include/asm-mips/r4kcache.h      2005-07-05 16:46:49.000000000 +0200
++++ linux.dev/include/asm-mips/r4kcache.h      2005-07-06 12:52:57.000000000 +0200
+@@ -15,6 +15,18 @@
+ #include <asm/asm.h>
+ #include <asm/cacheops.h>
++#ifdef CONFIG_BCM4710
++#define BCM4710_DUMMY_RREG() (((sbconfig_t *)(KSEG1ADDR(SB_ENUM_BASE + SBCONFIGOFF)))->sbimstate)
++
++#define BCM4710_FILL_TLB(addr) (*(volatile unsigned long *)(addr))
++#define BCM4710_PROTECTED_FILL_TLB(addr) ({ unsigned long x; get_dbe(x, (volatile unsigned long *)(addr)); })
++#else
++#define BCM4710_DUMMY_RREG()
++
++#define BCM4710_FILL_TLB(addr)
++#define BCM4710_PROTECTED_FILL_TLB(addr)
++#endif
++
+ #define cache_op(op,addr)                                             \
+       __asm__ __volatile__(                                           \
+       "       .set    noreorder                               \n"     \
+@@ -27,12 +39,25 @@
+ static inline void flush_icache_line_indexed(unsigned long addr)
+ {
+-      cache_op(Index_Invalidate_I, addr);
++      unsigned int way;
++      unsigned long ws_inc = 1UL << current_cpu_data.dcache.waybit;
++      
++      for (way = 0; way < current_cpu_data.dcache.ways; way++) {
++              cache_op(Index_Invalidate_I, addr);
++              addr += ws_inc;
++      }
+ }
+ static inline void flush_dcache_line_indexed(unsigned long addr)
+ {
+-      cache_op(Index_Writeback_Inv_D, addr);
++      unsigned int way;
++      unsigned long ws_inc = 1UL << current_cpu_data.dcache.waybit;
++      
++      for (way = 0; way < current_cpu_data.dcache.ways; way++) {
++              BCM4710_DUMMY_RREG();
++              cache_op(Index_Writeback_Inv_D, addr);
++              addr += ws_inc;
++      }
+ }
+ static inline void flush_scache_line_indexed(unsigned long addr)
+@@ -47,6 +72,7 @@
+ static inline void flush_dcache_line(unsigned long addr)
+ {
++      BCM4710_DUMMY_RREG();
+       cache_op(Hit_Writeback_Inv_D, addr);
+ }
+@@ -91,6 +117,7 @@
+  */
+ static inline void protected_writeback_dcache_line(unsigned long addr)
+ {
++      BCM4710_DUMMY_RREG();
+       __asm__ __volatile__(
+               ".set noreorder\n\t"
+               ".set mips3\n"
+@@ -138,6 +165,62 @@
+               : "r" (base),                                           \
+                 "i" (op));
++#define cache_unroll(base,op)                   \
++      __asm__ __volatile__("                  \
++              .set noreorder;                 \
++              .set mips3;                     \
++              cache %1, (%0);                 \
++              .set mips0;                     \
++              .set reorder"                   \
++              :                               \
++              : "r" (base),                   \
++                "i" (op));
++
++
++static inline void blast_dcache(void)
++{
++      unsigned long start = KSEG0;
++      unsigned long dcache_size = current_cpu_data.dcache.waysize * current_cpu_data.dcache.ways;
++      unsigned long end = (start + dcache_size);
++
++      while(start < end) {
++              BCM4710_DUMMY_RREG();
++              cache_unroll(start,Index_Writeback_Inv_D);
++              start += current_cpu_data.dcache.linesz;
++      }
++}
++
++static inline void blast_dcache_page(unsigned long page)
++{
++      unsigned long start = page;
++      unsigned long end = start + PAGE_SIZE;
++
++      BCM4710_FILL_TLB(start);
++      do {
++              BCM4710_DUMMY_RREG();
++              cache_unroll(start,Hit_Writeback_Inv_D);
++              start += current_cpu_data.dcache.linesz;
++      } while (start < end);
++}
++
++static inline void blast_dcache_page_indexed(unsigned long page)
++{
++      unsigned long start = page;
++      unsigned long end = start + PAGE_SIZE;
++      unsigned long ws_inc = 1UL << current_cpu_data.dcache.waybit;
++      unsigned long ws_end = current_cpu_data.dcache.ways <<
++                             current_cpu_data.dcache.waybit;
++      unsigned long ws, addr;
++
++      for (ws = 0; ws < ws_end; ws += ws_inc) {
++              start = page + ws;
++              for (addr = start; addr < end; addr += current_cpu_data.dcache.linesz) {
++                      BCM4710_DUMMY_RREG();
++                      cache_unroll(addr,Index_Writeback_Inv_D);
++              }
++      }       
++}
++
+ static inline void blast_dcache16(void)
+ {
+       unsigned long start = KSEG0;
+@@ -148,8 +231,9 @@
+       unsigned long ws, addr;
+       for (ws = 0; ws < ws_end; ws += ws_inc) 
+-              for (addr = start; addr < end; addr += 0x200)
++              for (addr = start; addr < end; addr += 0x200) {
+                       cache16_unroll32(addr|ws,Index_Writeback_Inv_D);
++              }
+ }
+ static inline void blast_dcache16_page(unsigned long page)
+@@ -173,8 +257,9 @@
+       unsigned long ws, addr;
+       for (ws = 0; ws < ws_end; ws += ws_inc) 
+-              for (addr = start; addr < end; addr += 0x200) 
++              for (addr = start; addr < end; addr += 0x200) {
+                       cache16_unroll32(addr|ws,Index_Writeback_Inv_D);
++              }
+ }
+ static inline void blast_icache16(void)
+@@ -196,6 +281,7 @@
+       unsigned long start = page;
+       unsigned long end = start + PAGE_SIZE;
++      BCM4710_FILL_TLB(start);
+       do {
+               cache16_unroll32(start,Hit_Invalidate_I);
+               start += 0x200;
+@@ -281,6 +367,7 @@
+               : "r" (base),                                           \
+                 "i" (op));
++
+ static inline void blast_dcache32(void)
+ {
+       unsigned long start = KSEG0;
+@@ -291,8 +378,9 @@
+       unsigned long ws, addr;
+       for (ws = 0; ws < ws_end; ws += ws_inc) 
+-              for (addr = start; addr < end; addr += 0x400) 
++              for (addr = start; addr < end; addr += 0x400) {
+                       cache32_unroll32(addr|ws,Index_Writeback_Inv_D);
++              }
+ }
+ static inline void blast_dcache32_page(unsigned long page)
+@@ -316,8 +404,9 @@
+       unsigned long ws, addr;
+       for (ws = 0; ws < ws_end; ws += ws_inc) 
+-              for (addr = start; addr < end; addr += 0x400) 
++              for (addr = start; addr < end; addr += 0x400) {
+                       cache32_unroll32(addr|ws,Index_Writeback_Inv_D);
++              }
+ }
+ static inline void blast_icache32(void)
+@@ -339,6 +428,7 @@
+       unsigned long start = page;
+       unsigned long end = start + PAGE_SIZE;
++      BCM4710_FILL_TLB(start);
+       do {
+               cache32_unroll32(start,Hit_Invalidate_I);
+               start += 0x400;
+@@ -443,6 +533,7 @@
+       unsigned long start = page;
+       unsigned long end = start + PAGE_SIZE;
++      BCM4710_FILL_TLB(start);
+       do {
+               cache64_unroll32(start,Hit_Invalidate_I);
+               start += 0x800;
+diff -urN linux.old/include/asm-mips/stackframe.h linux.dev/include/asm-mips/stackframe.h
+--- linux.old/include/asm-mips/stackframe.h    2005-07-05 16:46:49.000000000 +0200
++++ linux.dev/include/asm-mips/stackframe.h    2005-07-06 11:23:56.000000000 +0200
+@@ -209,6 +209,20 @@
+ #endif
++#if defined(CONFIG_BCM4710) || defined(CONFIG_BCM4704)
++
++#undef RESTORE_SP_AND_RET
++#define RESTORE_SP_AND_RET                               \
++              lw      sp,  PT_R29(sp);                 \
++              .set    mips3;                           \
++              nop;                                     \
++              nop;                                     \
++              eret;                                    \
++              .set    mips0
++
++#endif
++
++
+ #define RESTORE_SP                                       \
+               lw      sp,  PT_R29(sp);                 \
+diff -urN linux.old/mm/memory.c linux.dev/mm/memory.c
+--- linux.old/mm/memory.c      2005-04-04 03:42:20.000000000 +0200
++++ linux.dev/mm/memory.c      2005-07-06 11:23:56.000000000 +0200
+@@ -925,6 +925,7 @@
+       flush_page_to_ram(new_page);
+       flush_cache_page(vma, address);
+       establish_pte(vma, address, page_table, pte_mkwrite(pte_mkdirty(mk_pte(new_page, vma->vm_page_prot))));
++      flush_icache_page(vma, new_page);
+ }
+ /*
diff --git a/openwrt/target/linux/linux-2.4/patches/brcm/003-bcm47xx_workarounds.patch b/openwrt/target/linux/linux-2.4/patches/brcm/003-bcm47xx_workarounds.patch
deleted file mode 100644 (file)
index 73afd60..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-diff -urN linux.old/arch/mips/mm/tlbex-mips32.S linux.dev/arch/mips/mm/tlbex-mips32.S
---- linux.old/arch/mips/mm/tlbex-mips32.S      2005-05-28 17:42:03.000000000 +0200
-+++ linux.dev/arch/mips/mm/tlbex-mips32.S      2005-05-28 21:48:55.000000000 +0200
-@@ -90,6 +90,9 @@
-       .set    noat
-       LEAF(except_vec0_r4000)
-       .set    mips3
-+#ifdef CONFIG_BCM4704
-+      nop
-+#endif
- #ifdef CONFIG_SMP
-       mfc0    k1, CP0_CONTEXT
-       la      k0, pgd_current
-diff -urN linux.old/arch/mips/mm/pg-r4k.c linux.dev/arch/mips/mm/pg-r4k.c
---- linux.old/arch/mips/mm/pg-r4k.c    2005-01-19 15:09:29.000000000 +0100
-+++ linux.dev/arch/mips/mm/pg-r4k.c    2005-05-28 21:57:52.000000000 +0200
-@@ -180,6 +180,7 @@
- static inline void build_cdex_s(void)
- {
-+#if !defined(CONFIG_BCM4704) && !defined(CONFIG_BCM4710)
-       union mips_instruction mi;
-       if ((store_offset & (cpu_scache_line_size() - 1)))
-@@ -192,10 +193,12 @@
-       mi.c_format.simmediate = store_offset;
-       emit_instruction(mi);
-+#endif
- }
- static inline void build_cdex_p(void)
- {
-+#if !defined(CONFIG_BCM4704) && !defined(CONFIG_BCM4710)
-       union mips_instruction mi;
-       if (store_offset & (cpu_dcache_line_size() - 1))
-@@ -218,6 +221,7 @@
-       mi.c_format.simmediate = store_offset;
-       emit_instruction(mi);
-+#endif
- }
- static void __build_store_reg(int reg)
-diff -urN linux.old/include/asm-mips/stackframe.h linux.dev/include/asm-mips/stackframe.h
---- linux.old/include/asm-mips/stackframe.h    2002-11-29 00:53:15.000000000 +0100
-+++ linux.dev/include/asm-mips/stackframe.h    2005-05-28 21:53:03.000000000 +0200
-@@ -172,6 +172,46 @@
-                rfe;                                    \
-               .set    pop
-+#elif defined(CONFIG_BCM4710) || defined(CONFIG_BCM4704)
-+
-+#define RESTORE_SOME                                     \
-+              .set    push;                            \
-+              .set    reorder;                         \
-+              mfc0    t0, CP0_STATUS;                  \
-+              .set    pop;                             \
-+              ori     t0, 0x1f;                        \
-+              xori    t0, 0x1f;                        \
-+              mtc0    t0, CP0_STATUS;                  \
-+              li      v1, 0xff00;                      \
-+              and     t0, v1;                          \
-+              lw      v0, PT_STATUS(sp);               \
-+              nor     v1, $0, v1;                      \
-+              and     v0, v1;                          \
-+              or      v0, t0;                          \
-+              ori     v1, v0, ST0_IE;                  \
-+              xori    v1, v1, ST0_IE;                  \
-+              mtc0    v1, CP0_STATUS;                  \
-+              mtc0    v0, CP0_STATUS;                  \
-+              lw      v1, PT_EPC(sp);                  \
-+              mtc0    v1, CP0_EPC;                     \
-+              lw      $31, PT_R31(sp);                 \
-+              lw      $28, PT_R28(sp);                 \
-+              lw      $25, PT_R25(sp);                 \
-+              lw      $7,  PT_R7(sp);                  \
-+              lw      $6,  PT_R6(sp);                  \
-+              lw      $5,  PT_R5(sp);                  \
-+              lw      $4,  PT_R4(sp);                  \
-+              lw      $3,  PT_R3(sp);                  \
-+              lw      $2,  PT_R2(sp)
-+
-+#define RESTORE_SP_AND_RET                               \
-+              lw      sp,  PT_R29(sp);                 \
-+              nop;                                     \
-+              nop;                                     \
-+              .set    mips3;                           \
-+              eret;                                    \
-+              .set    mips0
-+
- #else
- #define RESTORE_SOME                                     \
-diff -urN linux.old/arch/mips/mm/tlbex-r4k.S linux.dev/arch/mips/mm/tlbex-r4k.S
---- linux.old/arch/mips/mm/tlbex-r4k.S 2005-05-28 17:42:03.000000000 +0200
-+++ linux.dev/arch/mips/mm/tlbex-r4k.S 2005-05-29 15:04:43.000000000 +0200
-@@ -168,6 +168,9 @@
-       .set    noat
-       LEAF(except_vec0_r4000)
-       .set    mips3
-+#ifdef CONFIG_BCM4704
-+      nop
-+#endif
-       GET_PGD(k0, k1)                         # get pgd pointer
-       mfc0    k0, CP0_BADVADDR                # Get faulting address
-       srl     k0, k0, _PGDIR_SHIFT            # get pgd only bits
-diff -urN linux.old/arch/mips/kernel/entry.S linux.dev/arch/mips/kernel/entry.S
---- linux.old/arch/mips/kernel/entry.S 2003-08-25 13:44:40.000000000 +0200
-+++ linux.dev/arch/mips/kernel/entry.S 2005-06-01 20:10:36.000000000 +0200
-@@ -100,6 +100,10 @@
-                * and R4400 SC and MC versions.
-                */
- NESTED(except_vec3_generic, 0, sp)
-+#ifdef CONFIG_BCM4710
-+              nop
-+              nop
-+#endif
- #if R5432_CP0_INTERRUPT_WAR
-               mfc0    k0, CP0_INDEX
- #endif
diff --git a/openwrt/target/linux/linux-2.4/patches/brcm/004-bcm94710_mmu.patch b/openwrt/target/linux/linux-2.4/patches/brcm/004-bcm94710_mmu.patch
deleted file mode 100644 (file)
index 5151092..0000000
+++ /dev/null
@@ -1,282 +0,0 @@
-diff -urN linux.old/arch/mips/mm/c-r4k.c linux.dev/arch/mips/mm/c-r4k.c
---- linux.old/arch/mips/mm/c-r4k.c     2005-06-01 18:42:44.000000000 +0200
-+++ linux.dev/arch/mips/mm/c-r4k.c     2005-06-01 18:49:07.000000000 +0200
-@@ -14,6 +14,12 @@
- #include <linux/mm.h>
- #include <linux/bitops.h>
-+#ifdef CONFIG_BCM4710
-+#include "../bcm947xx/include/typedefs.h"
-+#include "../bcm947xx/include/sbconfig.h"
-+#include <asm/paccess.h>
-+#endif
-+
- #include <asm/bcache.h>
- #include <asm/bootinfo.h>
- #include <asm/cacheops.h>
-@@ -390,6 +396,11 @@
-                       addr = start & ~(dc_lsize - 1);
-                       aend = (end - 1) & ~(dc_lsize - 1);
-+#ifdef CONFIG_BCM4710
-+                      BCM4710_FILL_TLB(addr);
-+                      BCM4710_FILL_TLB(aend);
-+#endif
-+
-                       while (1) {
-                               /* Hit_Writeback_Inv_D */
-                               protected_writeback_dcache_line(addr);
-@@ -405,6 +416,10 @@
-       else {
-               addr = start & ~(ic_lsize - 1);
-               aend = (end - 1) & ~(ic_lsize - 1);
-+#ifdef CONFIG_BCM4710
-+              BCM4710_FILL_TLB(addr);
-+              BCM4710_FILL_TLB(aend);
-+#endif
-               while (1) {
-                       /* Hit_Invalidate_I */
-                       protected_flush_icache_line(addr);
-@@ -487,6 +502,10 @@
-               a = addr & ~(sc_lsize - 1);
-               end = (addr + size - 1) & ~(sc_lsize - 1);
-+#ifdef CONFIG_BCM4710
-+              BCM4710_FILL_TLB(a);
-+              BCM4710_FILL_TLB(end);
-+#endif
-               while (1) {
-                       flush_scache_line(a);   /* Hit_Writeback_Inv_SD */
-                       if (a == end)
-@@ -509,6 +528,10 @@
-               R4600_HIT_CACHEOP_WAR_IMPL;
-               a = addr & ~(dc_lsize - 1);
-               end = (addr + size - 1) & ~(dc_lsize - 1);
-+#ifdef CONFIG_BCM4710
-+              BCM4710_FILL_TLB(a);
-+              BCM4710_FILL_TLB(end);
-+#endif
-               while (1) {
-                       flush_dcache_line(a);   /* Hit_Writeback_Inv_D */
-                       if (a == end)
-@@ -537,6 +560,10 @@
-               a = addr & ~(sc_lsize - 1);
-               end = (addr + size - 1) & ~(sc_lsize - 1);
-+#ifdef CONFIG_BCM4710
-+              BCM4710_FILL_TLB(a);
-+              BCM4710_FILL_TLB(end);
-+#endif
-               while (1) {
-                       flush_scache_line(a);   /* Hit_Writeback_Inv_SD */
-                       if (a == end)
-@@ -576,6 +603,10 @@
-       unsigned long ic_lsize = current_cpu_data.icache.linesz;
-       unsigned long dc_lsize = current_cpu_data.dcache.linesz;
-+#ifdef CONFIG_BCM4710
-+      BCM4710_PROTECTED_FILL_TLB(addr);
-+      BCM4710_PROTECTED_FILL_TLB(addr + 4);
-+#endif
-       R4600_HIT_CACHEOP_WAR_IMPL;
-       protected_writeback_dcache_line(addr & ~(dc_lsize - 1));
-       protected_flush_icache_line(addr & ~(ic_lsize - 1));
-diff -urN linux.old/include/asm-mips/r4kcache.h linux.dev/include/asm-mips/r4kcache.h
---- linux.old/include/asm-mips/r4kcache.h      2005-06-01 18:42:43.000000000 +0200
-+++ linux.dev/include/asm-mips/r4kcache.h      2005-06-01 19:07:11.000000000 +0200
-@@ -15,6 +15,25 @@
- #include <asm/asm.h>
- #include <asm/cacheops.h>
-+#ifdef CONFIG_BCM4710
-+#define BCM4710_DUMMY_RREG() (((sbconfig_t *)(KSEG1ADDR(SB_ENUM_BASE + SBCONFIGOFF)))->sbimstate)
-+
-+#define BCM4710_FILL_TLB(addr) (*(volatile unsigned long *)(addr))
-+#define BCM4710_PROTECTED_FILL_TLB(addr) ({ unsigned long x; get_dbe(x, (volatile unsigned long *)(addr)); })
-+
-+#define cache_op(op,addr)                                             \
-+      BCM4710_DUMMY_RREG();                                           \
-+      __asm__ __volatile__(                                           \
-+      "       .set    noreorder                               \n"     \
-+      "       .set    mips3\n\t                               \n"     \
-+      "       cache   %0, %1                                  \n"     \
-+      "       .set    mips0                                   \n"     \
-+      "       .set    reorder"                                        \
-+      :                                                               \
-+      : "i" (op), "m" (*(unsigned char *)(addr)))
-+
-+#else
-+
- #define cache_op(op,addr)                                             \
-       __asm__ __volatile__(                                           \
-       "       .set    noreorder                               \n"     \
-@@ -24,6 +43,8 @@
-       "       .set    reorder"                                        \
-       :                                                               \
-       : "i" (op), "m" (*(unsigned char *)(addr)))
-+#endif
-+
- static inline void flush_icache_line_indexed(unsigned long addr)
- {
-@@ -32,6 +53,9 @@
- static inline void flush_dcache_line_indexed(unsigned long addr)
- {
-+#ifdef CONFIG_BCM4710 
-+      BCM4710_DUMMY_RREG();
-+#endif
-       cache_op(Index_Writeback_Inv_D, addr);
- }
-@@ -47,6 +71,10 @@
- static inline void flush_dcache_line(unsigned long addr)
- {
-+
-+#ifdef CONFIG_BCM4710 
-+      BCM4710_DUMMY_RREG();
-+#endif
-       cache_op(Hit_Writeback_Inv_D, addr);
- }
-@@ -91,6 +119,9 @@
-  */
- static inline void protected_writeback_dcache_line(unsigned long addr)
- {
-+#ifdef CONFIG_BCM4710 
-+      BCM4710_DUMMY_RREG();
-+#endif
-       __asm__ __volatile__(
-               ".set noreorder\n\t"
-               ".set mips3\n"
-@@ -148,8 +179,12 @@
-       unsigned long ws, addr;
-       for (ws = 0; ws < ws_end; ws += ws_inc) 
--              for (addr = start; addr < end; addr += 0x200)
-+              for (addr = start; addr < end; addr += 0x200) {
-+#ifdef CONFIG_BCM4710 
-+                      BCM4710_DUMMY_RREG();
-+#endif
-                       cache16_unroll32(addr|ws,Index_Writeback_Inv_D);
-+              }
- }
- static inline void blast_dcache16_page(unsigned long page)
-@@ -158,6 +193,9 @@
-       unsigned long end = start + PAGE_SIZE;
-       do {
-+#ifdef CONFIG_BCM4710 
-+              BCM4710_DUMMY_RREG();
-+#endif
-               cache16_unroll32(start,Hit_Writeback_Inv_D);
-               start += 0x200;
-       } while (start < end);
-@@ -173,8 +211,12 @@
-       unsigned long ws, addr;
-       for (ws = 0; ws < ws_end; ws += ws_inc) 
--              for (addr = start; addr < end; addr += 0x200) 
-+              for (addr = start; addr < end; addr += 0x200) {
-+#ifdef CONFIG_BCM4710 
-+                      BCM4710_DUMMY_RREG();
-+#endif
-                       cache16_unroll32(addr|ws,Index_Writeback_Inv_D);
-+              }
- }
- static inline void blast_icache16(void)
-@@ -196,7 +238,13 @@
-       unsigned long start = page;
-       unsigned long end = start + PAGE_SIZE;
-+#ifdef CONFIG_BCM4710 
-+      BCM4710_FILL_TLB(start);
-+#endif
-       do {
-+#ifdef CONFIG_BCM4710 
-+              BCM4710_DUMMY_RREG();
-+#endif
-               cache16_unroll32(start,Hit_Invalidate_I);
-               start += 0x200;
-       } while (start < end);
-@@ -291,8 +339,12 @@
-       unsigned long ws, addr;
-       for (ws = 0; ws < ws_end; ws += ws_inc) 
--              for (addr = start; addr < end; addr += 0x400) 
-+              for (addr = start; addr < end; addr += 0x400) {
-+#ifdef CONFIG_BCM4710 
-+                      BCM4710_DUMMY_RREG();
-+#endif
-                       cache32_unroll32(addr|ws,Index_Writeback_Inv_D);
-+              }
- }
- static inline void blast_dcache32_page(unsigned long page)
-@@ -300,7 +352,13 @@
-       unsigned long start = page;
-       unsigned long end = start + PAGE_SIZE;
-+#ifdef CONFIG_BCM4710 
-+      __asm__ __volatile__("nop;nop;nop;nop");
-+#endif
-       do {
-+#ifdef CONFIG_BCM4710 
-+              BCM4710_DUMMY_RREG();
-+#endif
-               cache32_unroll32(start,Hit_Writeback_Inv_D);
-               start += 0x400;
-       } while (start < end);
-@@ -339,6 +397,9 @@
-       unsigned long start = page;
-       unsigned long end = start + PAGE_SIZE;
-+#ifdef CONFIG_BCM4710 
-+      BCM4710_FILL_TLB(start);
-+#endif
-       do {
-               cache32_unroll32(start,Hit_Invalidate_I);
-               start += 0x400;
-diff -urN linux.old/arch/mips/mm/c-r4k.c linux.dev/arch/mips/mm/c-r4k.c
---- linux.old/arch/mips/mm/c-r4k.c     2005-06-01 18:49:07.000000000 +0200
-+++ linux.dev/arch/mips/mm/c-r4k.c     2005-06-03 12:11:13.000000000 +0200
-@@ -51,6 +51,7 @@
- #define cpu_is_r4600_v1_x()   ((read_c0_prid() & 0xfffffff0) == 0x2010)
- #define cpu_is_r4600_v2_x()   ((read_c0_prid() & 0xfffffff0) == 0x2020)
-+#ifndef CONFIG_BCM4710
- #define R4600_HIT_CACHEOP_WAR_IMPL                                    \
- do {                                                                  \
-       if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())            \
-@@ -58,11 +59,17 @@
-       if (R4600_V1_HIT_CACHEOP_WAR)                                   \
-               __asm__ __volatile__("nop;nop;nop;nop");                \
- } while (0)
-+#else
-+#define R4600_HIT_CACHEOP_WAR_IMPL
-+#endif
- static void (* r4k_blast_dcache_page)(unsigned long addr);
- static inline void r4k_blast_dcache_page_dc32(unsigned long addr)
- {
-+#ifdef CONFIG_BCM4710
-+      BCM4710_FILL_TLB(addr);
-+#endif
-       R4600_HIT_CACHEOP_WAR_IMPL;
-       blast_dcache32_page(addr);
- }
-@@ -581,6 +588,10 @@
-               R4600_HIT_CACHEOP_WAR_IMPL;
-               a = addr & ~(dc_lsize - 1);
-               end = (addr + size - 1) & ~(dc_lsize - 1);
-+#ifdef CONFIG_BCM4710
-+              BCM4710_FILL_TLB(a);
-+              BCM4710_FILL_TLB(end);
-+#endif
-               while (1) {
-                       flush_dcache_line(a);   /* Hit_Writeback_Inv_D */
-                       if (a == end)
diff --git a/openwrt/target/linux/linux-2.4/patches/brcm/004-ide_workaround.patch b/openwrt/target/linux/linux-2.4/patches/brcm/004-ide_workaround.patch
new file mode 100644 (file)
index 0000000..9f8d2ee
--- /dev/null
@@ -0,0 +1,18 @@
+diff -urN linux.old/arch/mips/lib/ide-std.c linux.dev/arch/mips/lib/ide-std.c
+--- linux.old/arch/mips/lib/ide-std.c  2003-08-25 13:44:40.000000000 +0200
++++ linux.dev/arch/mips/lib/ide-std.c  2005-08-12 23:55:23.886963936 +0200
+@@ -31,12 +31,14 @@
+ static ide_ioreg_t std_ide_default_io_base(int index)
+ {
+       switch (index) {
++#if 0
+               case 0: return 0x1f0;
+               case 1: return 0x170;
+               case 2: return 0x1e8;
+               case 3: return 0x168;
+               case 4: return 0x1e0;
+               case 5: return 0x160;
++#endif
+               default:
+                       return 0;
+       }
diff --git a/openwrt/target/linux/linux-2.4/patches/brcm/005-diag_led.patch b/openwrt/target/linux/linux-2.4/patches/brcm/005-diag_led.patch
new file mode 100644 (file)
index 0000000..e827906
--- /dev/null
@@ -0,0 +1,278 @@
+diff -urN linux-2.4.30.dev/drivers/net/Makefile linux-2.4.30.dev2/drivers/net/Makefile
+--- linux-2.4.30.dev/drivers/net/Makefile      2005-08-22 01:41:45.930653216 +0200
++++ linux-2.4.30.dev2/drivers/net/Makefile     2005-08-22 01:58:04.162939304 +0200
+@@ -41,6 +41,8 @@
+   obj-$(CONFIG_ISDN) += slhc.o
+ endif
++subdir-m += diag
++
+ subdir-$(CONFIG_HND) += hnd
+ subdir-$(CONFIG_ET) += et
+ subdir-$(CONFIG_WL) += wl
+diff -urN linux-2.4.30.dev/drivers/net/diag/Makefile linux-2.4.30.dev2/drivers/net/diag/Makefile
+--- linux-2.4.30.dev/drivers/net/diag/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.4.30.dev2/drivers/net/diag/Makefile        2005-08-22 00:12:23.655170000 +0200
+@@ -0,0 +1,13 @@
++#$Id$
++
++EXTRA_CFLAGS := -I$(TOPDIR)/arch/mips/bcm947xx/include -DBCMDRIVER
++
++O_TARGET       := diag.o
++
++MAC_OBJS       := diag_led.o
++
++export-objs    := 
++obj-y          := $(MAC_OBJS)
++obj-m          := $(O_TARGET)
++
++include $(TOPDIR)/Rules.make
+diff -urN linux-2.4.30.dev/drivers/net/diag/diag_led.c linux-2.4.30.dev2/drivers/net/diag/diag_led.c
+--- linux-2.4.30.dev/drivers/net/diag/diag_led.c       1970-01-01 01:00:00.000000000 +0100
++++ linux-2.4.30.dev2/drivers/net/diag/diag_led.c      2005-08-22 03:37:58.112053448 +0200
+@@ -0,0 +1,245 @@
++/*
++ * diag_led.c - replacement diag module
++ *
++ * Copyright (C) 2004 Mike Baker,
++ *                    Imre Kaloz <kaloz@dune.hu>
++ *
++ * 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, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
++ *
++ * $Id$
++ */
++
++/*
++ * ChangeLog:
++ * 2004/03/28 initial release 
++ * 2004/08/26 asus & buffalo support added
++ * 2005/03/14 asus wl-500g deluxe and buffalo v2 support added
++ * 2005/04/13 added licensing informations
++ * 2005/04/18 base reset polarity off initial readings
++ */
++
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/kernel.h>
++#include <linux/sysctl.h>
++#include <asm/io.h>
++#include <typedefs.h>
++#include <bcmdevs.h>
++#include <sbutils.h>
++
++extern char * nvram_get(const char *name);
++static void *sbh;
++
++// v2.x - - - - -
++#define DIAG_GPIO (1<<1)
++#define DMZ_GPIO  (1<<7)
++
++static void set_gpio(uint32 mask, uint32 value) {
++      sb_gpiocontrol(sbh,mask,0);
++      sb_gpioouten(sbh,mask,mask);
++      sb_gpioout(sbh,mask,value);
++}
++
++static void v2_set_diag(u8 state) {
++      set_gpio(DIAG_GPIO,state);
++}
++static void v2_set_dmz(u8 state) {
++      set_gpio(DMZ_GPIO,state);
++}
++
++// v1.x - - - - -
++#define LED_DIAG   0x13
++#define LED_DMZ    0x12
++
++static void v1_set_diag(u8 state) {
++      if (!state) {
++              *(volatile u8*)(KSEG1ADDR(BCM4710_EUART)+LED_DIAG)=0xFF;
++      } else {
++              *(volatile u8*)(KSEG1ADDR(BCM4710_EUART)+LED_DIAG);
++      }
++}
++static void v1_set_dmz(u8 state) {
++      if (!state) {
++              *(volatile u8*)(KSEG1ADDR(BCM4710_EUART)+LED_DMZ)=0xFF;
++      } else {
++              *(volatile u8*)(KSEG1ADDR(BCM4710_EUART)+LED_DMZ);
++      }
++}
++
++// - - - - -
++static void ignore(u8 ignored) {};
++
++// - - - - -
++#define BIT_DMZ         0x01
++#define BIT_DIAG        0x04
++
++void (*set_diag)(u8 state);
++void (*set_dmz)(u8 state);
++
++static unsigned int diag = 0;
++
++static void diag_change()
++{
++      set_diag(0xFF); // off
++      set_dmz(0xFF); // off
++
++      if(diag & BIT_DIAG)
++              set_diag(0x00); // on
++      if(diag & BIT_DMZ)
++              set_dmz(0x00); // on
++}
++
++static int proc_diag(ctl_table *table, int write, struct file *filp,
++              void *buffer, size_t *lenp)
++{
++      int r;
++      r = proc_dointvec(table, write, filp, buffer, lenp);
++      if (write && !r) {
++              diag_change();
++      }
++      return r;
++}
++
++// - - - - -
++static unsigned char reset_gpio = 0;
++static unsigned char reset_polarity = 0;
++static unsigned int reset = 0;
++
++static int proc_reset(ctl_table *table, int write, struct file *filp,
++              void *buffer, size_t *lenp)
++{
++
++      if (reset_gpio) {
++              sb_gpiocontrol(sbh,reset_gpio,reset_gpio);
++              sb_gpioouten(sbh,reset_gpio,0);
++              reset=!(sb_gpioin(sbh)&reset_gpio);
++
++              if (reset_polarity) reset=!reset;
++      } else {
++              reset=0;
++      }
++
++      return proc_dointvec(table, write, filp, buffer, lenp);
++}
++
++// - - - - -
++static struct ctl_table_header *diag_sysctl_header;
++
++static ctl_table sys_diag[] = {
++         { 
++         ctl_name: 2000,
++         procname: "diag", 
++         data: &diag,
++         maxlen: sizeof(diag), 
++         mode: 0644,
++         proc_handler: proc_diag
++       },
++       {
++         ctl_name: 2001,
++         procname: "reset",
++         data: &reset,
++         maxlen: sizeof(reset),
++         mode: 0444,
++         proc_handler: proc_reset 
++       },
++         { 0 }
++};
++
++static int __init diag_init()
++{
++      char *buf;
++      u32 board_type;
++      sbh = sb_kattach();
++      sb_gpiosetcore(sbh);
++
++      board_type = sb_boardtype(sbh);
++      printk(KERN_INFO "diag boardtype: %08x\n",board_type);
++
++      set_diag=ignore;
++      set_dmz=ignore;
++      
++      buf=nvram_get("boardrev");
++      if (((board_type & 0xf00) == 0x400) && strcmp(buf,"0x10")) {
++              buf=nvram_get("boardtype")?:"";
++              if (!strcmp(buf,"bcm94710dev")) {
++                      buf=nvram_get("boardnum")?:"";
++                      if (!strcmp(buf,"42")) {
++                              // wrt54g v1.x
++                              set_diag=v1_set_diag;
++                              set_dmz=v1_set_dmz;
++                              reset_gpio=(1<<6);
++                      }
++                      if (!strcmp(buf,"asusX")) {
++                              //asus wl-500g
++                              reset_gpio=(1<<6);
++                      }
++              }
++              if (!strcmp(buf,"bcm94710ap")) {
++                      buf=nvram_get("boardnum")?:"";
++                      if (!strcmp(buf,"42")) {
++                              // buffalo
++                              set_dmz=v2_set_dmz;
++                              reset_gpio=(1<<4);
++                      }
++                      if (!strcmp(buf,"44")) {
++                              //dell truemobile
++                              set_dmz=v2_set_dmz;
++                              reset_gpio=(1<<0);
++                      }
++              }
++      } else {
++              buf=nvram_get("boardnum")?:"";
++              if (!strcmp(buf,"42")) {
++                      //linksys
++                      set_diag=v2_set_diag;
++                      set_dmz=v2_set_dmz;
++                      reset_gpio=(1<<6);
++              }
++              if (!strcmp(buf,"44")) {
++                      //motorola
++                      reset_gpio=(1<<5);
++              }
++              if (!strcmp(buf,"00")) {
++                      //buffalo
++                      reset_gpio=(1<<7);
++              }
++              if (!strcmp(buf,"45")) {
++                      //wl-500g deluxe
++                      reset_gpio=(1<<6);
++              }
++      }
++
++      
++      sb_gpiocontrol(sbh,reset_gpio,reset_gpio);
++      sb_gpioouten(sbh,reset_gpio,0);
++      reset_polarity=!(sb_gpioin(sbh)&reset_gpio);
++
++      diag_sysctl_header = register_sysctl_table(sys_diag, 0);
++      diag_change();
++
++      return 0;
++}
++
++static void __exit diag_exit()
++{
++      unregister_sysctl_table(diag_sysctl_header);
++}
++
++EXPORT_NO_SYMBOLS;
++MODULE_AUTHOR("openwrt.org");
++MODULE_LICENSE("GPL");
++
++module_init(diag_init);
++module_exit(diag_exit);
diff --git a/openwrt/target/linux/linux-2.4/patches/generic/100-ebtables.patch b/openwrt/target/linux/linux-2.4/patches/generic/100-ebtables.patch
deleted file mode 100644 (file)
index b1c34ab..0000000
+++ /dev/null
@@ -1,7012 +0,0 @@
---- linux-2.4.29/net/bridge/br_private.h       2004-08-08 01:26:06.000000000 +0200
-+++ linux-2.4.29-ebt-brnf/net/bridge/br_private.h      2005-03-14 21:24:04.000000000 +0100
-@@ -143,8 +143,10 @@ extern void br_fdb_insert(struct net_bri
- /* br_forward.c */
- extern void br_deliver(struct net_bridge_port *to,
-               struct sk_buff *skb);
-+extern int br_dev_queue_push_xmit(struct sk_buff *skb);
- extern void br_forward(struct net_bridge_port *to,
-               struct sk_buff *skb);
-+extern int br_forward_finish(struct sk_buff *skb);
- extern void br_flood_deliver(struct net_bridge *br,
-                     struct sk_buff *skb,
-                     int clone);
-@@ -165,7 +167,8 @@ extern void br_get_port_ifindices(struct
-                          int *ifindices);
- /* br_input.c */
--extern void br_handle_frame(struct sk_buff *skb);
-+extern int br_handle_frame_finish(struct sk_buff *skb);
-+extern int br_handle_frame(struct sk_buff *skb);
- /* br_ioctl.c */
- extern int br_ioctl(struct net_bridge *br,
-@@ -175,6 +178,10 @@ extern int br_ioctl(struct net_bridge *b
-            unsigned long arg2);
- extern int br_ioctl_deviceless_stub(unsigned long arg);
-+/* br_netfilter.c */
-+extern int br_netfilter_init(void);
-+extern void br_netfilter_fini(void);
-+
- /* br_stp.c */
- extern int br_is_root_bridge(struct net_bridge *br);
- extern struct net_bridge_port *br_get_port(struct net_bridge *br,
---- linux-2.4.29/include/linux/if_bridge.h     2001-11-22 20:47:12.000000000 +0100
-+++ linux-2.4.29-ebt-brnf/include/linux/if_bridge.h    2005-03-14 21:11:28.000000000 +0100
-@@ -102,7 +102,8 @@ struct net_bridge;
- struct net_bridge_port;
- extern int (*br_ioctl_hook)(unsigned long arg);
--extern void (*br_handle_frame_hook)(struct sk_buff *skb);
-+extern int (*br_handle_frame_hook)(struct sk_buff *skb);
-+extern int (*br_should_route_hook)(struct sk_buff **pskb);
- #endif
---- linux-2.4.29/net/core/dev.c        2004-04-14 15:05:41.000000000 +0200
-+++ linux-2.4.29-ebt-brnf/net/core/dev.c       2005-03-14 00:00:29.000000000 +0100
-@@ -1426,7 +1426,7 @@ static void net_tx_action(struct softirq
- #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
--void (*br_handle_frame_hook)(struct sk_buff *skb) = NULL;
-+int (*br_handle_frame_hook)(struct sk_buff *skb) = NULL;
- #endif
- static __inline__ int handle_bridge(struct sk_buff *skb,
-@@ -1443,7 +1443,6 @@ static __inline__ int handle_bridge(stru
-               }
-       }
--      br_handle_frame_hook(skb);
-       return ret;
- }
-@@ -1503,7 +1502,12 @@ int netif_receive_skb(struct sk_buff *sk
- #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-       if (skb->dev->br_port != NULL && br_handle_frame_hook != NULL &&
-           skb->pkt_type != PACKET_LOOPBACK) {
--              return handle_bridge(skb, pt_prev);
-+              int ret;
-+
-+              ret = handle_bridge(skb, pt_prev);
-+              if (br_handle_frame_hook(skb) == 0)
-+                      return ret;
-+              pt_prev = NULL;
-       }
- #endif
---- linux-2.4.29/net/bridge/br_input.c 2003-08-25 13:44:44.000000000 +0200
-+++ linux-2.4.29-ebt-brnf/net/bridge/br_input.c        2005-03-14 00:00:29.000000000 +0100
-@@ -24,6 +24,9 @@ unsigned char bridge_ula[6] = { 0x01, 0x
- static int br_pass_frame_up_finish(struct sk_buff *skb)
- {
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug = 0;
-+#endif
-       netif_rx(skb);
-       return 0;
-@@ -46,7 +49,7 @@ static void br_pass_frame_up(struct net_
-                       br_pass_frame_up_finish);
- }
--static int br_handle_frame_finish(struct sk_buff *skb)
-+int br_handle_frame_finish(struct sk_buff *skb)
- {
-       struct net_bridge *br;
-       unsigned char *dest;
-@@ -112,7 +115,7 @@ err_nolock:
-       return 0;
- }
--void br_handle_frame(struct sk_buff *skb)
-+int br_handle_frame(struct sk_buff *skb)
- {
-       struct net_bridge *br;
-       unsigned char *dest;
-@@ -146,26 +149,35 @@ void br_handle_frame(struct sk_buff *skb
-               goto handle_special_frame;
-       if (p->state == BR_STATE_FORWARDING) {
-+              if (br_should_route_hook && br_should_route_hook(&skb)) {
-+                      read_unlock(&br->lock);
-+                      return -1;
-+              }
-+
-+              if (!memcmp(p->br->dev.dev_addr, dest, ETH_ALEN))
-+                      skb->pkt_type = PACKET_HOST;
-+
-               NF_HOOK(PF_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL,
-                       br_handle_frame_finish);
-               read_unlock(&br->lock);
--              return;
-+              return 0;
-       }
- err:
-       read_unlock(&br->lock);
- err_nolock:
-       kfree_skb(skb);
--      return;
-+      return 0;
- handle_special_frame:
-       if (!dest[5]) {
-               NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_IN, skb, skb->dev,NULL,
-                       br_stp_handle_bpdu);
-               read_unlock(&br->lock);
--              return;
-+              return 0;
-       }
-       read_unlock(&br->lock);
-       kfree_skb(skb);
-+      return 0;
- }
---- linux-2.4.29/net/bridge/br_forward.c       2003-11-28 19:26:21.000000000 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/br_forward.c      2005-03-14 00:00:29.000000000 +0100
-@@ -30,18 +30,21 @@ static inline int should_deliver(struct 
-       return 1;
- }
--static int __dev_queue_push_xmit(struct sk_buff *skb)
-+int br_dev_queue_push_xmit(struct sk_buff *skb)
- {
-+#ifdef CONFIG_NETFILTER
-+      nf_bridge_maybe_copy_header(skb);
-+#endif
-       skb_push(skb, ETH_HLEN);
-       dev_queue_xmit(skb);
-       return 0;
- }
--static int __br_forward_finish(struct sk_buff *skb)
-+int br_forward_finish(struct sk_buff *skb)
- {
-       NF_HOOK(PF_BRIDGE, NF_BR_POST_ROUTING, skb, NULL, skb->dev,
--                      __dev_queue_push_xmit);
-+                      br_dev_queue_push_xmit);
-       return 0;
- }
-@@ -49,8 +52,11 @@ static int __br_forward_finish(struct sk
- static void __br_deliver(struct net_bridge_port *to, struct sk_buff *skb)
- {
-       skb->dev = to->dev;
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug = 0;
-+#endif
-       NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev,
--                      __br_forward_finish);
-+                      br_forward_finish);
- }
- static void __br_forward(struct net_bridge_port *to, struct sk_buff *skb)
-@@ -62,7 +68,7 @@ static void __br_forward(struct net_brid
-       skb->ip_summed = CHECKSUM_NONE;
-       NF_HOOK(PF_BRIDGE, NF_BR_FORWARD, skb, indev, skb->dev,
--                      __br_forward_finish);
-+                      br_forward_finish);
- }
- /* called under bridge lock */
---- linux-2.4.29/net/bridge/br.c       2004-08-08 01:26:06.000000000 +0200
-+++ linux-2.4.29-ebt-brnf/net/bridge/br.c      2005-03-14 00:00:29.000000000 +0100
-@@ -30,6 +30,8 @@
- #include "../atm/lec.h"
- #endif
-+int (*br_should_route_hook) (struct sk_buff **pskb) = NULL;
-+
- void br_dec_use_count()
- {
-       MOD_DEC_USE_COUNT;
-@@ -44,6 +46,10 @@ static int __init br_init(void)
- {
-       printk(KERN_INFO "NET4: Ethernet Bridge 008 for NET4.0\n");
-+#ifdef CONFIG_NETFILTER
-+      if (br_netfilter_init())
-+              return 1;
-+#endif
-       br_handle_frame_hook = br_handle_frame;
-       br_ioctl_hook = br_ioctl_deviceless_stub;
- #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE)
-@@ -57,6 +63,9 @@ static int __init br_init(void)
- static void __exit br_deinit(void)
- {
-+#ifdef CONFIG_NETFILTER
-+      br_netfilter_fini();
-+#endif
-       unregister_netdevice_notifier(&br_device_notifier);
-       rtnl_lock();
-@@ -73,7 +82,7 @@ static void __exit br_deinit(void)
- #endif
- }
--EXPORT_NO_SYMBOLS;
-+EXPORT_SYMBOL(br_should_route_hook);
- module_init(br_init)
- module_exit(br_deinit)
---- linux-2.4.29/net/bridge/Makefile   2000-12-29 23:07:24.000000000 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/Makefile  2005-03-14 00:00:29.000000000 +0100
-@@ -7,10 +7,17 @@
- #
- # Note 2! The CFLAGS definition is now in the main makefile...
-+export-objs := br.o
-+
- O_TARGET      := bridge.o
- obj-y         := br.o br_device.o br_fdb.o br_forward.o br_if.o br_input.o \
-                       br_ioctl.o br_notify.o br_stp.o br_stp_bpdu.o \
-                       br_stp_if.o br_stp_timer.o
-+
-+ifeq ($(CONFIG_NETFILTER),y)
-+obj-y         += br_netfilter.o
-+endif
-+
- obj-m         := $(O_TARGET)
- include $(TOPDIR)/Rules.make
---- linux-2.4.29/include/linux/netfilter_bridge.h      2001-06-12 04:15:27.000000000 +0200
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter_bridge.h     2005-03-14 21:24:06.000000000 +0100
-@@ -6,6 +6,10 @@
- #include <linux/config.h>
- #include <linux/netfilter.h>
-+#if defined(__KERNEL__) && defined(CONFIG_NETFILTER)
-+#include <asm/atomic.h>
-+#include <linux/if_ether.h>
-+#endif
- /* Bridge Hooks */
- /* After promisc drops, checksum checks. */
-@@ -18,7 +22,76 @@
- #define NF_BR_LOCAL_OUT               3
- /* Packets about to hit the wire. */
- #define NF_BR_POST_ROUTING    4
--#define NF_BR_NUMHOOKS                5
-+/* Not really a hook, but used for the ebtables broute table */
-+#define NF_BR_BROUTING                5
-+#define NF_BR_NUMHOOKS                6
-+
-+#ifdef __KERNEL__
-+
-+#define BRNF_PKT_TYPE                 0x01
-+#define BRNF_BRIDGED_DNAT             0x02
-+#define BRNF_DONT_TAKE_PARENT         0x04
-+#define BRNF_BRIDGED                  0x08
-+#define BRNF_NF_BRIDGE_PREROUTING     0x10
-+
-+enum nf_br_hook_priorities {
-+      NF_BR_PRI_FIRST = INT_MIN,
-+      NF_BR_PRI_NAT_DST_BRIDGED = -300,
-+      NF_BR_PRI_FILTER_BRIDGED = -200,
-+      NF_BR_PRI_BRNF = 0,
-+      NF_BR_PRI_NAT_DST_OTHER = 100,
-+      NF_BR_PRI_FILTER_OTHER = 200,
-+      NF_BR_PRI_NAT_SRC = 300,
-+      NF_BR_PRI_LAST = INT_MAX,
-+};
-+
-+#ifdef CONFIG_NETFILTER
-+static inline
-+struct nf_bridge_info *nf_bridge_alloc(struct sk_buff *skb)
-+{
-+      struct nf_bridge_info **nf_bridge = &(skb->nf_bridge);
-+
-+      if ((*nf_bridge = kmalloc(sizeof(**nf_bridge), GFP_ATOMIC)) != NULL) {
-+              atomic_set(&(*nf_bridge)->use, 1);
-+              (*nf_bridge)->mask = 0;
-+              (*nf_bridge)->physindev = (*nf_bridge)->physoutdev = NULL;
-+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
-+              (*nf_bridge)->netoutdev = NULL;
-+#endif
-+      }
-+
-+      return *nf_bridge;
-+}
-+
-+/* Only used in br_forward.c */
-+static inline
-+void nf_bridge_maybe_copy_header(struct sk_buff *skb)
-+{
-+      if (skb->nf_bridge) {
-+              if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
-+                      memcpy(skb->data - 18, skb->nf_bridge->data, 18);
-+                      skb_push(skb, 4);
-+              } else
-+                      memcpy(skb->data - 16, skb->nf_bridge->data, 16);
-+      }
-+}
-+
-+static inline
-+void nf_bridge_save_header(struct sk_buff *skb)
-+{
-+        int header_size = 16;
-+
-+      if (skb->protocol == __constant_htons(ETH_P_8021Q))
-+              header_size = 18;
-+      memcpy(skb->nf_bridge->data, skb->data - header_size, header_size);
-+}
-+struct bridge_skb_cb {
-+      union {
-+              __u32 ipv4;
-+      } daddr;
-+};
-+#endif /* CONFIG_NETFILTER */
-+#endif /* __KERNEL__ */
- #endif
---- linux-2.4.29/include/linux/netfilter_ipv4/ip_tables.h      2004-08-08 01:26:06.000000000 +0200
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter_ipv4/ip_tables.h     2005-03-14 21:24:28.000000000 +0100
-@@ -159,7 +159,7 @@ struct ipt_entry
- #define IPT_CONTINUE 0xFFFFFFFF
- /* For standard target */
--#define IPT_RETURN (-NF_MAX_VERDICT - 1)
-+#define IPT_RETURN (-NF_REPEAT - 1)
- /* TCP matching stuff */
- struct ipt_tcp
---- linux-2.4.29/include/linux/netfilter_ipv6/ip6_tables.h     2004-08-08 01:26:06.000000000 +0200
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter_ipv6/ip6_tables.h    2005-03-14 00:00:29.000000000 +0100
-@@ -167,7 +167,7 @@ struct ip6t_entry
- #define IP6T_CONTINUE 0xFFFFFFFF
- /* For standard target */
--#define IP6T_RETURN (-NF_MAX_VERDICT - 1)
-+#define IP6T_RETURN (-NF_REPEAT - 1)
- /* TCP matching stuff */
- struct ip6t_tcp
---- linux-2.4.29/include/linux/netfilter_arp/arp_tables.h      2003-08-25 13:44:44.000000000 +0200
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter_arp/arp_tables.h     2005-03-14 21:24:31.000000000 +0100
-@@ -154,7 +154,7 @@ struct arpt_entry
- #define ARPT_CONTINUE 0xFFFFFFFF
- /* For standard target */
--#define ARPT_RETURN (-NF_MAX_VERDICT - 1)
-+#define ARPT_RETURN (-NF_REPEAT - 1)
- /* The argument to ARPT_SO_GET_INFO */
- struct arpt_getinfo
---- linux-2.4.29/net/Makefile  2004-08-08 01:26:06.000000000 +0200
-+++ linux-2.4.29-ebt-brnf/net/Makefile 2005-03-14 00:00:29.000000000 +0100
-@@ -7,7 +7,8 @@
- O_TARGET :=   network.o
--mod-subdirs :=        ipv4/netfilter ipv6/netfilter ipx irda bluetooth atm netlink sched core sctp 802
-+mod-subdirs :=        ipv4/netfilter ipv6/netfilter bridge/netfilter ipx irda \
-+      bluetooth atm netlink sched core sctp 802
- export-objs :=        netsyms.o
- subdir-y :=   core ethernet
-@@ -27,6 +28,12 @@ subdir-$(CONFIG_NETFILTER)  += ipv6/netfi
- endif
- endif
-+ifneq ($(CONFIG_BRIDGE),n)
-+ifneq ($(CONFIG_BRIDGE),)
-+subdir-$(CONFIG_BRIDGE)               += bridge/netfilter
-+endif
-+endif
-+
- subdir-$(CONFIG_KHTTPD)               += khttpd
- subdir-$(CONFIG_PACKET)               += packet
- subdir-$(CONFIG_NET_SCHED)    += sched
---- linux-2.4.29/net/Config.in 2005-01-19 15:10:13.000000000 +0100
-+++ linux-2.4.29-ebt-brnf/net/Config.in        2005-03-14 00:00:29.000000000 +0100
-@@ -70,6 +70,9 @@ if [ "$CONFIG_DECNET" != "n" ]; then
-    source net/decnet/Config.in
- fi
- dep_tristate '802.1d Ethernet Bridging' CONFIG_BRIDGE $CONFIG_INET
-+if [ "$CONFIG_BRIDGE" != "n" -a "$CONFIG_NETFILTER" != "n" ]; then
-+   source net/bridge/netfilter/Config.in
-+fi
- if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-    tristate 'CCITT X.25 Packet Layer (EXPERIMENTAL)' CONFIG_X25
-    tristate 'LAPB Data Link Driver (EXPERIMENTAL)' CONFIG_LAPB
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/netfilter/Makefile        2005-03-14 00:00:29.000000000 +0100
-@@ -0,0 +1,34 @@
-+#
-+# Makefile for the netfilter modules on top of bridging.
-+#
-+# Note! Dependencies are done automagically by 'make dep', which also
-+# removes any old dependencies. DON'T put your own dependencies here
-+# unless it's something special (ie not a .c file).
-+#
-+# Note 2! The CFLAGS definition is now in the main makefile...
-+
-+O_TARGET      := netfilter.o
-+
-+export-objs := ebtables.o
-+
-+obj-$(CONFIG_BRIDGE_NF_EBTABLES) += ebtables.o
-+obj-$(CONFIG_BRIDGE_EBT_T_FILTER) += ebtable_filter.o
-+obj-$(CONFIG_BRIDGE_EBT_T_NAT) += ebtable_nat.o
-+obj-$(CONFIG_BRIDGE_EBT_BROUTE) += ebtable_broute.o
-+obj-$(CONFIG_BRIDGE_EBT_802_3) += ebt_802_3.o
-+obj-$(CONFIG_BRIDGE_EBT_ARPF) += ebt_arp.o
-+obj-$(CONFIG_BRIDGE_EBT_AMONG) += ebt_among.o
-+obj-$(CONFIG_BRIDGE_EBT_IPF) += ebt_ip.o
-+obj-$(CONFIG_BRIDGE_EBT_LIMIT) += ebt_limit.o
-+obj-$(CONFIG_BRIDGE_EBT_MARKF) += ebt_mark_m.o
-+obj-$(CONFIG_BRIDGE_EBT_PKTTYPE) += ebt_pkttype.o
-+obj-$(CONFIG_BRIDGE_EBT_STP) += ebt_stp.o
-+obj-$(CONFIG_BRIDGE_EBT_VLANF) += ebt_vlan.o
-+obj-$(CONFIG_BRIDGE_EBT_LOG) += ebt_log.o
-+obj-$(CONFIG_BRIDGE_EBT_LOG) += ebt_ulog.o
-+obj-$(CONFIG_BRIDGE_EBT_ARPREPLY) += ebt_arpreply.o
-+obj-$(CONFIG_BRIDGE_EBT_DNAT) += ebt_dnat.o
-+obj-$(CONFIG_BRIDGE_EBT_MARK_T) += ebt_mark.o
-+obj-$(CONFIG_BRIDGE_EBT_REDIRECT) += ebt_redirect.o
-+obj-$(CONFIG_BRIDGE_EBT_SNAT) += ebt_snat.o
-+include $(TOPDIR)/Rules.make
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/netfilter/Config.in       2005-03-14 00:00:29.000000000 +0100
-@@ -0,0 +1,23 @@
-+#
-+# Bridge netfilter configuration
-+#
-+dep_tristate '  Bridge: ebtables' CONFIG_BRIDGE_NF_EBTABLES $CONFIG_BRIDGE
-+dep_tristate '    ebt: filter table support' CONFIG_BRIDGE_EBT_T_FILTER $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: nat table support' CONFIG_BRIDGE_EBT_T_NAT $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: broute table support' CONFIG_BRIDGE_EBT_BROUTE $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: log support' CONFIG_BRIDGE_EBT_LOG $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: ulog support' CONFIG_BRIDGE_EBT_LOG $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: IP filter support' CONFIG_BRIDGE_EBT_IPF $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: ARP filter support' CONFIG_BRIDGE_EBT_ARPF $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: among filter support' CONFIG_BRIDGE_EBT_AMONG $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: limit filter support' CONFIG_BRIDGE_EBT_LIMIT $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: 802.1Q VLAN filter support' CONFIG_BRIDGE_EBT_VLANF $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: 802.3 filter support' CONFIG_BRIDGE_EBT_802_3 $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: packet type filter support' CONFIG_BRIDGE_EBT_PKTTYPE $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: STP filter support' CONFIG_BRIDGE_EBT_STP $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: mark filter support' CONFIG_BRIDGE_EBT_MARKF $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: arp reply target support' CONFIG_BRIDGE_EBT_ARPREPLY $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: snat target support' CONFIG_BRIDGE_EBT_SNAT $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: dnat target support' CONFIG_BRIDGE_EBT_DNAT $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: redirect target support' CONFIG_BRIDGE_EBT_REDIRECT $CONFIG_BRIDGE_NF_EBTABLES
-+dep_tristate '    ebt: mark target support' CONFIG_BRIDGE_EBT_MARK_T $CONFIG_BRIDGE_NF_EBTABLES
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/netfilter/ebtable_filter.c        2005-03-14 00:00:29.000000000 +0100
-@@ -0,0 +1,90 @@
-+/*
-+ *  ebtable_filter
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  April, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/module.h>
-+
-+#define FILTER_VALID_HOOKS ((1 << NF_BR_LOCAL_IN) | (1 << NF_BR_FORWARD) | \
-+   (1 << NF_BR_LOCAL_OUT))
-+
-+static struct ebt_entries initial_chains[] =
-+{
-+  {0, "INPUT", 0, EBT_ACCEPT, 0},
-+  {0, "FORWARD", 0, EBT_ACCEPT, 0},
-+  {0, "OUTPUT", 0, EBT_ACCEPT, 0}
-+};
-+
-+static struct ebt_replace initial_table =
-+{
-+  "filter", FILTER_VALID_HOOKS, 0, 3 * sizeof(struct ebt_entries),
-+  { [NF_BR_LOCAL_IN]&initial_chains[0], [NF_BR_FORWARD]&initial_chains[1],
-+    [NF_BR_LOCAL_OUT]&initial_chains[2] }, 0, NULL, (char *)initial_chains
-+};
-+
-+static int check(const struct ebt_table_info *info, unsigned int valid_hooks)
-+{
-+      if (valid_hooks & ~FILTER_VALID_HOOKS)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_table frame_filter =
-+{ 
-+  {NULL, NULL}, "filter", &initial_table, FILTER_VALID_HOOKS, 
-+  RW_LOCK_UNLOCKED, check, NULL
-+};
-+
-+static unsigned int
-+ebt_hook (unsigned int hook, struct sk_buff **pskb, const struct net_device *in,
-+   const struct net_device *out, int (*okfn)(struct sk_buff *))
-+{
-+      return ebt_do_table(hook, pskb, in, out, &frame_filter);
-+}
-+
-+static struct nf_hook_ops ebt_ops_filter[] = {
-+      { { NULL, NULL }, ebt_hook, PF_BRIDGE, NF_BR_LOCAL_IN,
-+         NF_BR_PRI_FILTER_BRIDGED},
-+      { { NULL, NULL }, ebt_hook, PF_BRIDGE, NF_BR_FORWARD,
-+         NF_BR_PRI_FILTER_BRIDGED},
-+      { { NULL, NULL }, ebt_hook, PF_BRIDGE, NF_BR_LOCAL_OUT,
-+         NF_BR_PRI_FILTER_OTHER}
-+};
-+
-+static int __init init(void)
-+{
-+      int i, j, ret;
-+
-+      ret = ebt_register_table(&frame_filter);
-+      if (ret < 0)
-+              return ret;
-+      for (i = 0; i < sizeof(ebt_ops_filter) / sizeof(ebt_ops_filter[0]); i++)
-+              if ((ret = nf_register_hook(&ebt_ops_filter[i])) < 0)
-+                      goto cleanup;
-+      return ret;
-+cleanup:
-+      for (j = 0; j < i; j++)
-+              nf_unregister_hook(&ebt_ops_filter[j]);
-+      ebt_unregister_table(&frame_filter);
-+      return ret;
-+}
-+
-+static void __exit fini(void)
-+{
-+      int i;
-+
-+      for (i = 0; i < sizeof(ebt_ops_filter) / sizeof(ebt_ops_filter[0]); i++)
-+              nf_unregister_hook(&ebt_ops_filter[i]);
-+      ebt_unregister_table(&frame_filter);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/netfilter/ebtable_nat.c   2005-03-14 00:00:29.000000000 +0100
-@@ -0,0 +1,96 @@
-+/*
-+ *  ebtable_nat
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  April, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/module.h>
-+#define NAT_VALID_HOOKS ((1 << NF_BR_PRE_ROUTING) | (1 << NF_BR_LOCAL_OUT) | \
-+   (1 << NF_BR_POST_ROUTING))
-+
-+static struct ebt_entries initial_chains[] =
-+{
-+  {0, "PREROUTING", 0, EBT_ACCEPT, 0},
-+  {0, "OUTPUT", 0, EBT_ACCEPT, 0},
-+  {0, "POSTROUTING", 0, EBT_ACCEPT, 0}
-+};
-+
-+static struct ebt_replace initial_table =
-+{
-+  "nat", NAT_VALID_HOOKS, 0, 3 * sizeof(struct ebt_entries),
-+  { [NF_BR_PRE_ROUTING]&initial_chains[0], [NF_BR_LOCAL_OUT]&initial_chains[1],
-+    [NF_BR_POST_ROUTING]&initial_chains[2] }, 0, NULL, (char *)initial_chains
-+};
-+
-+static int check(const struct ebt_table_info *info, unsigned int valid_hooks)
-+{
-+      if (valid_hooks & ~NAT_VALID_HOOKS)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_table frame_nat =
-+{
-+  {NULL, NULL}, "nat", &initial_table, NAT_VALID_HOOKS,
-+  RW_LOCK_UNLOCKED, check, NULL
-+};
-+
-+static unsigned int
-+ebt_nat_dst(unsigned int hook, struct sk_buff **pskb, const struct net_device *in
-+   , const struct net_device *out, int (*okfn)(struct sk_buff *))
-+{
-+      return ebt_do_table(hook, pskb, in, out, &frame_nat);
-+}
-+
-+static unsigned int
-+ebt_nat_src(unsigned int hook, struct sk_buff **pskb, const struct net_device *in
-+   , const struct net_device *out, int (*okfn)(struct sk_buff *))
-+{
-+      return ebt_do_table(hook, pskb, in, out, &frame_nat);
-+}
-+
-+static struct nf_hook_ops ebt_ops_nat[] = {
-+      { { NULL, NULL }, ebt_nat_dst, PF_BRIDGE, NF_BR_LOCAL_OUT,
-+         NF_BR_PRI_NAT_DST_OTHER},
-+      { { NULL, NULL }, ebt_nat_src, PF_BRIDGE, NF_BR_POST_ROUTING,
-+         NF_BR_PRI_NAT_SRC},
-+      { { NULL, NULL }, ebt_nat_dst, PF_BRIDGE, NF_BR_PRE_ROUTING,
-+         NF_BR_PRI_NAT_DST_BRIDGED},
-+};
-+
-+static int __init init(void)
-+{
-+      int i, ret, j;
-+
-+      ret = ebt_register_table(&frame_nat);
-+      if (ret < 0)
-+              return ret;
-+      for (i = 0; i < sizeof(ebt_ops_nat) / sizeof(ebt_ops_nat[0]); i++)
-+              if ((ret = nf_register_hook(&ebt_ops_nat[i])) < 0)
-+                      goto cleanup;
-+      return ret;
-+cleanup:
-+      for (j = 0; j < i; j++)
-+              nf_unregister_hook(&ebt_ops_nat[j]);
-+      ebt_unregister_table(&frame_nat);
-+      return ret;
-+}
-+
-+static void __exit fini(void)
-+{
-+      int i;
-+
-+      for (i = 0; i < sizeof(ebt_ops_nat) / sizeof(ebt_ops_nat[0]); i++)
-+              nf_unregister_hook(&ebt_ops_nat[i]);
-+      ebt_unregister_table(&frame_nat);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/netfilter/ebtable_broute.c        2005-03-14 00:00:29.000000000 +0100
-@@ -0,0 +1,79 @@
-+/*
-+ *  ebtable_broute
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  April, 2002
-+ *
-+ *  This table lets you choose between routing and bridging for frames
-+ *  entering on a bridge enslaved nic. This table is traversed before any
-+ *  other ebtables table. See net/bridge/br_input.c.
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/module.h>
-+#include <linux/if_bridge.h>
-+#include <linux/brlock.h>
-+
-+// EBT_ACCEPT means the frame will be bridged
-+// EBT_DROP means the frame will be routed
-+static struct ebt_entries initial_chain =
-+  {0, "BROUTING", 0, EBT_ACCEPT, 0};
-+
-+static struct ebt_replace initial_table =
-+{
-+  "broute", 1 << NF_BR_BROUTING, 0, sizeof(struct ebt_entries),
-+  { [NF_BR_BROUTING]&initial_chain}, 0, NULL, (char *)&initial_chain
-+};
-+
-+static int check(const struct ebt_table_info *info, unsigned int valid_hooks)
-+{
-+      if (valid_hooks & ~(1 << NF_BR_BROUTING))
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_table broute_table =
-+{
-+  {NULL, NULL}, "broute", &initial_table, 1 << NF_BR_BROUTING,
-+  RW_LOCK_UNLOCKED, check, NULL
-+};
-+
-+static int ebt_broute(struct sk_buff **pskb)
-+{
-+      int ret;
-+
-+      ret = ebt_do_table(NF_BR_BROUTING, pskb, (*pskb)->dev, NULL,
-+         &broute_table);
-+      if (ret == NF_DROP)
-+              return 1; // route it
-+      return 0; // bridge it
-+}
-+
-+static int __init init(void)
-+{
-+      int ret;
-+
-+      ret = ebt_register_table(&broute_table);
-+      if (ret < 0)
-+              return ret;
-+      br_write_lock_bh(BR_NETPROTO_LOCK);
-+      // see br_input.c
-+      br_should_route_hook = ebt_broute;
-+      br_write_unlock_bh(BR_NETPROTO_LOCK);
-+      return ret;
-+}
-+
-+static void __exit fini(void)
-+{
-+      br_write_lock_bh(BR_NETPROTO_LOCK);
-+      br_should_route_hook = NULL;
-+      br_write_unlock_bh(BR_NETPROTO_LOCK);
-+      ebt_unregister_table(&broute_table);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/netfilter/ebt_among.c     2005-03-14 00:00:29.000000000 +0100
-@@ -0,0 +1,223 @@
-+/*
-+ *  ebt_among
-+ *
-+ *    Authors:
-+ *    Grzegorz Borowiak <grzes@gnu.univ.gda.pl>
-+ *
-+ *  August, 2003
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_among.h>
-+#include <linux/ip.h>
-+#include <linux/if_arp.h>
-+#include <linux/module.h>
-+
-+static int ebt_mac_wormhash_contains(const struct ebt_mac_wormhash *wh,
-+                                   const char *mac, uint32_t ip)
-+{
-+      /* You may be puzzled as to how this code works.
-+       * Some tricks were used, refer to 
-+       *      include/linux/netfilter_bridge/ebt_among.h
-+       * as there you can find a solution of this mystery.
-+       */
-+      const struct ebt_mac_wormhash_tuple *p;
-+      int start, limit, i;
-+      uint32_t cmp[2] = { 0, 0 };
-+      int key = (const unsigned char) mac[5];
-+
-+      memcpy(((char *) cmp) + 2, mac, 6);
-+      start = wh->table[key];
-+      limit = wh->table[key + 1];
-+      if (ip) {
-+              for (i = start; i < limit; i++) {
-+                      p = &wh->pool[i];
-+                      if (cmp[1] == p->cmp[1] && cmp[0] == p->cmp[0]) {
-+                              if (p->ip == 0 || p->ip == ip) {
-+                                      return 1;
-+                              }
-+                      }
-+              }
-+      } else {
-+              for (i = start; i < limit; i++) {
-+                      p = &wh->pool[i];
-+                      if (cmp[1] == p->cmp[1] && cmp[0] == p->cmp[0]) {
-+                              if (p->ip == 0) {
-+                                      return 1;
-+                              }
-+                      }
-+              }
-+      }
-+      return 0;
-+}
-+
-+static int ebt_mac_wormhash_check_integrity(const struct ebt_mac_wormhash
-+                                          *wh)
-+{
-+      int i;
-+
-+      for (i = 0; i < 256; i++) {
-+              if (wh->table[i] > wh->table[i + 1])
-+                      return -0x100 - i;
-+              if (wh->table[i] < 0)
-+                      return -0x200 - i;
-+              if (wh->table[i] > wh->poolsize)
-+                      return -0x300 - i;
-+      }
-+      if (wh->table[256] > wh->poolsize)
-+              return -0xc00;
-+      return 0;
-+}
-+
-+static int get_ip_dst(const struct sk_buff *skb, uint32_t * addr)
-+{
-+      if (skb->mac.ethernet->h_proto == __constant_htons(ETH_P_IP))
-+              *addr = skb->nh.iph->daddr;
-+      else if (skb->mac.ethernet->h_proto == __constant_htons(ETH_P_ARP)) {
-+              uint32_t arp_len = sizeof(struct arphdr) +
-+                  (2 * (((*skb).nh.arph)->ar_hln)) +
-+                  (2 * (((*skb).nh.arph)->ar_pln));
-+
-+              /* Make sure the packet is long enough. */
-+              if ((((*skb).nh.raw) + arp_len) > (*skb).tail)
-+                      return -1;
-+              /* IPv4 addresses are always 4 bytes. */
-+              if (((*skb).nh.arph)->ar_pln != sizeof(uint32_t))
-+                      return -1;
-+
-+              memcpy(addr, ((*skb).nh.raw) + sizeof(struct arphdr) +
-+                     (2 * (((*skb).nh.arph)->ar_hln)) +
-+                     (((*skb).nh.arph)->ar_pln), sizeof(uint32_t));
-+
-+      }
-+      return 0;
-+}
-+
-+static int get_ip_src(const struct sk_buff *skb, uint32_t * addr)
-+{
-+      if (skb->mac.ethernet->h_proto == __constant_htons(ETH_P_IP))
-+              *addr = skb->nh.iph->saddr;
-+      else if (skb->mac.ethernet->h_proto == __constant_htons(ETH_P_ARP)) {
-+              uint32_t arp_len = sizeof(struct arphdr) +
-+                  (2 * (((*skb).nh.arph)->ar_hln)) +
-+                  (2 * (((*skb).nh.arph)->ar_pln));
-+
-+              /* Make sure the packet is long enough. */
-+              if ((((*skb).nh.raw) + arp_len) > (*skb).tail)
-+                      return -1;
-+              /* IPv4 addresses are always 4 bytes. */
-+              if (((*skb).nh.arph)->ar_pln != sizeof(uint32_t))
-+                      return -1;
-+
-+              memcpy(addr, ((*skb).nh.raw) + sizeof(struct arphdr) +
-+                     ((((*skb).nh.arph)->ar_hln)), sizeof(uint32_t));
-+
-+      }
-+      return 0;
-+}
-+
-+static int ebt_filter_among(const struct sk_buff *skb,
-+                          const struct net_device *in,
-+                          const struct net_device *out, const void *data,
-+                          unsigned int datalen)
-+{
-+      struct ebt_among_info *info = (struct ebt_among_info *) data;
-+      const char *dmac, *smac;
-+      const struct ebt_mac_wormhash *wh_dst, *wh_src;
-+      uint32_t dip = 0, sip = 0;
-+
-+      wh_dst = ebt_among_wh_dst(info);
-+      wh_src = ebt_among_wh_src(info);
-+
-+      if (wh_src) {
-+              smac = skb->mac.ethernet->h_source;
-+              if (get_ip_src(skb, &sip))
-+                      return EBT_NOMATCH;
-+              if (!(info->bitmask & EBT_AMONG_SRC_NEG)) {
-+                      /* we match only if it contains */
-+                      if (!ebt_mac_wormhash_contains(wh_src, smac, sip))
-+                              return EBT_NOMATCH;
-+              } else {
-+                      /* we match only if it DOES NOT contain */
-+                      if (ebt_mac_wormhash_contains(wh_src, smac, sip))
-+                              return EBT_NOMATCH;
-+              }
-+      }
-+
-+      if (wh_dst) {
-+              dmac = skb->mac.ethernet->h_dest;
-+              if (get_ip_dst(skb, &dip))
-+                      return EBT_NOMATCH;
-+              if (!(info->bitmask & EBT_AMONG_DST_NEG)) {
-+                      /* we match only if it contains */
-+                      if (!ebt_mac_wormhash_contains(wh_dst, dmac, dip))
-+                              return EBT_NOMATCH;
-+              } else {
-+                      /* we match only if it DOES NOT contain */
-+                      if (ebt_mac_wormhash_contains(wh_dst, dmac, dip))
-+                              return EBT_NOMATCH;
-+              }
-+      }
-+
-+      return EBT_MATCH;
-+}
-+
-+static int ebt_among_check(const char *tablename, unsigned int hookmask,
-+                         const struct ebt_entry *e, void *data,
-+                         unsigned int datalen)
-+{
-+      struct ebt_among_info *info = (struct ebt_among_info *) data;
-+      int expected_length = sizeof(struct ebt_among_info);
-+      const struct ebt_mac_wormhash *wh_dst, *wh_src;
-+      int err;
-+
-+      wh_dst = ebt_among_wh_dst(info);
-+      wh_src = ebt_among_wh_src(info);
-+      expected_length += ebt_mac_wormhash_size(wh_dst);
-+      expected_length += ebt_mac_wormhash_size(wh_src);
-+
-+      if (datalen != EBT_ALIGN(expected_length)) {
-+              printk(KERN_WARNING
-+                     "ebtables: among: wrong size: %d"
-+                     "against expected %d, rounded to %d\n",
-+                     datalen, expected_length,
-+                     EBT_ALIGN(expected_length));
-+              return -EINVAL;
-+      }
-+      if (wh_dst && (err = ebt_mac_wormhash_check_integrity(wh_dst))) {
-+              printk(KERN_WARNING
-+                     "ebtables: among: dst integrity fail: %x\n", -err);
-+              return -EINVAL;
-+      }
-+      if (wh_src && (err = ebt_mac_wormhash_check_integrity(wh_src))) {
-+              printk(KERN_WARNING
-+                     "ebtables: among: src integrity fail: %x\n", -err);
-+              return -EINVAL;
-+      }
-+      return 0;
-+}
-+
-+static struct ebt_match filter_among = {
-+      {NULL, NULL}, 
-+      EBT_AMONG_MATCH, 
-+      ebt_filter_among, 
-+      ebt_among_check,
-+      NULL,
-+      THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_match(&filter_among);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&filter_among);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/netfilter/ebt_limit.c     2005-03-14 00:00:29.000000000 +0100
-@@ -0,0 +1,101 @@
-+/*
-+ *  ebt_limit
-+ *
-+ *    Authors:
-+ *    Tom Marshall <tommy@home.tig-grr.com>
-+ *
-+ *    Mostly copied from netfilter's ipt_limit.c, see that file for explanation
-+ *
-+ *  September, 2003
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_limit.h>
-+#include <linux/module.h>
-+
-+#include <linux/netdevice.h>
-+#include <linux/spinlock.h>
-+
-+static spinlock_t limit_lock = SPIN_LOCK_UNLOCKED;
-+
-+#define CREDITS_PER_JIFFY 128
-+
-+static int ebt_limit_match(const struct sk_buff *skb, const struct net_device *in,
-+   const struct net_device *out, const void *data, unsigned int datalen)
-+{
-+      struct ebt_limit_info *info = (struct ebt_limit_info *)data;
-+      unsigned long now = jiffies;
-+
-+      spin_lock_bh(&limit_lock);
-+      info->credit += (now - xchg(&info->prev, now)) * CREDITS_PER_JIFFY;
-+      if (info->credit > info->credit_cap)
-+              info->credit = info->credit_cap;
-+
-+      if (info->credit >= info->cost) {
-+              /* We're not limited. */
-+              info->credit -= info->cost;
-+              spin_unlock_bh(&limit_lock);
-+              return EBT_MATCH;
-+      }
-+
-+      spin_unlock_bh(&limit_lock);
-+      return EBT_NOMATCH;
-+}
-+
-+/* Precision saver. */
-+static u_int32_t
-+user2credits(u_int32_t user)
-+{
-+      /* If multiplying would overflow... */
-+      if (user > 0xFFFFFFFF / (HZ*CREDITS_PER_JIFFY))
-+              /* Divide first. */
-+              return (user / EBT_LIMIT_SCALE) * HZ * CREDITS_PER_JIFFY;
-+
-+      return (user * HZ * CREDITS_PER_JIFFY) / EBT_LIMIT_SCALE;
-+}
-+
-+static int ebt_limit_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_limit_info *info = (struct ebt_limit_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_limit_info)))
-+              return -EINVAL;
-+
-+      /* Check for overflow. */
-+      if (info->burst == 0
-+          || user2credits(info->avg * info->burst) < user2credits(info->avg)) {
-+              printk("Overflow in ebt_limit: %u/%u\n",
-+                      info->avg, info->burst);
-+              return -EINVAL;
-+      }
-+
-+      /* User avg in seconds * EBT_LIMIT_SCALE: convert to jiffies * 128. */
-+      info->prev = jiffies;
-+      info->credit = user2credits(info->avg * info->burst);
-+      info->credit_cap = user2credits(info->avg * info->burst);
-+      info->cost = user2credits(info->avg);
-+      return 0;
-+}
-+
-+static struct ebt_match ebt_limit_reg =
-+{
-+      {NULL, NULL}, EBT_LIMIT_MATCH, ebt_limit_match, ebt_limit_check, NULL,
-+      THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_match(&ebt_limit_reg);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&ebt_limit_reg);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/netfilter/ebt_arpreply.c  2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,86 @@
-+/*
-+ *  ebt_arpreply
-+ *
-+ *    Authors:
-+ *    Grzegorz Borowiak <grzes@gnu.univ.gda.pl>
-+ *    Bart De Schuymer <bdschuym@pandora.be>
-+ *
-+ *  August, 2003
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_arpreply.h>
-+#include <linux/if_arp.h>
-+#include <net/arp.h>
-+#include <linux/module.h>
-+
-+static int ebt_target_reply(struct sk_buff **pskb, unsigned int hooknr,
-+   const struct net_device *in, const struct net_device *out,
-+   const void *data, unsigned int datalen)
-+{
-+      struct ebt_arpreply_info *info = (struct ebt_arpreply_info *)data;
-+      struct arphdr *ah;
-+      unsigned char *sha, *arp_ptr;
-+      u32 sip, tip;
-+
-+      ah = (**pskb).nh.arph;
-+      if (ah->ar_op != __constant_htons(ARPOP_REQUEST) ||
-+          ah->ar_hln != ETH_ALEN || ah->ar_pro != htons(ETH_P_IP) ||
-+          ah->ar_pln != 4)
-+              return EBT_CONTINUE;
-+
-+      arp_ptr = (unsigned char *)(ah + 1);
-+
-+      /* get source and target IP */
-+      sha = arp_ptr;
-+      arp_ptr += ETH_ALEN;
-+      memcpy(&sip, arp_ptr, 4);
-+      arp_ptr += 4 + ETH_ALEN;
-+      memcpy(&tip, arp_ptr, 4);
-+
-+      arp_send(ARPOP_REPLY, ETH_P_ARP, sip, in, tip, sha, info->mac, sha);
-+
-+      return info->target;
-+}
-+
-+static int ebt_target_reply_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_arpreply_info *info = (struct ebt_arpreply_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_arpreply_info)))
-+              return -EINVAL;
-+      if (BASE_CHAIN && info->target == EBT_RETURN)
-+              return -EINVAL;
-+      if (e->ethproto != __constant_htons(ETH_P_ARP) ||
-+          e->invflags & EBT_IPROTO)
-+              return -EINVAL;
-+      CLEAR_BASE_CHAIN_BIT;
-+      if (strcmp(tablename, "nat") || hookmask & ~(1 << NF_BR_PRE_ROUTING))
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_target reply_target =
-+{
-+      .name           = EBT_ARPREPLY_TARGET,
-+      .target         = ebt_target_reply,
-+      .check          = ebt_target_reply_check,
-+      .me             = THIS_MODULE,
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_target(&reply_target);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_target(&reply_target);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/netfilter/ebt_802_3.c     2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,74 @@
-+/*
-+ * 802_3
-+ *
-+ * Author:
-+ * Chris Vitale csv@bluetail.com
-+ *
-+ * May 2003
-+ * 
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_802_3.h>
-+#include <linux/module.h>
-+
-+static int ebt_filter_802_3(const struct sk_buff *skb, const struct net_device *in,
-+   const struct net_device *out, const void *data, unsigned int datalen)
-+{
-+      struct ebt_802_3_info *info = (struct ebt_802_3_info *)data;
-+      struct ebt_802_3_hdr *hdr = (struct ebt_802_3_hdr *)skb->mac.ethernet;
-+      uint16_t type = hdr->llc.ui.ctrl & IS_UI ? hdr->llc.ui.type : hdr->llc.ni.type;
-+
-+      if (info->bitmask & EBT_802_3_SAP) {
-+              if (FWINV(info->sap != hdr->llc.ui.ssap, EBT_802_3_SAP)) 
-+                              return EBT_NOMATCH;
-+              if (FWINV(info->sap != hdr->llc.ui.dsap, EBT_802_3_SAP))
-+                              return EBT_NOMATCH;
-+      }
-+
-+      if (info->bitmask & EBT_802_3_TYPE) {
-+              if (!(hdr->llc.ui.dsap == CHECK_TYPE && hdr->llc.ui.ssap == CHECK_TYPE))
-+                      return EBT_NOMATCH;
-+              if (FWINV(info->type != type, EBT_802_3_TYPE)) 
-+                      return EBT_NOMATCH;
-+      }
-+
-+      return EBT_MATCH;
-+}
-+
-+static struct ebt_match filter_802_3;
-+static int ebt_802_3_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_802_3_info *info = (struct ebt_802_3_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_802_3_info)))
-+              return -EINVAL;
-+      if (info->bitmask & ~EBT_802_3_MASK || info->invflags & ~EBT_802_3_MASK)
-+              return -EINVAL;
-+
-+      return 0;
-+}
-+
-+static struct ebt_match filter_802_3 =
-+{
-+      .name           = EBT_802_3_MATCH,
-+      .match          = ebt_filter_802_3,
-+      .check          = ebt_802_3_check,
-+      .me             = THIS_MODULE,
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_match(&filter_802_3);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&filter_802_3);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/netfilter/ebt_mark.c      2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,66 @@
-+/*
-+ *  ebt_mark
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  July, 2002
-+ *
-+ */
-+
-+// The mark target can be used in any chain
-+// I believe adding a mangle table just for marking is total overkill
-+// Marking a frame doesn't really change anything in the frame anyway
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_mark_t.h>
-+#include <linux/module.h>
-+
-+static int ebt_target_mark(struct sk_buff **pskb, unsigned int hooknr,
-+   const struct net_device *in, const struct net_device *out,
-+   const void *data, unsigned int datalen)
-+{
-+      struct ebt_mark_t_info *info = (struct ebt_mark_t_info *)data;
-+
-+      if ((*pskb)->nfmark != info->mark) {
-+              (*pskb)->nfmark = info->mark;
-+              (*pskb)->nfcache |= NFC_ALTERED;
-+      }
-+      return info->target;
-+}
-+
-+static int ebt_target_mark_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_mark_t_info *info = (struct ebt_mark_t_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_mark_t_info)))
-+              return -EINVAL;
-+      if (BASE_CHAIN && info->target == EBT_RETURN)
-+              return -EINVAL;
-+      CLEAR_BASE_CHAIN_BIT;
-+      if (INVALID_TARGET)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_target mark_target =
-+{
-+      {NULL, NULL}, EBT_MARK_TARGET, ebt_target_mark,
-+      ebt_target_mark_check, NULL, THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_target(&mark_target);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_target(&mark_target);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/netfilter/ebt_mark_m.c    2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,61 @@
-+/*
-+ *  ebt_mark_m
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  July, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_mark_m.h>
-+#include <linux/module.h>
-+
-+static int ebt_filter_mark(const struct sk_buff *skb,
-+   const struct net_device *in, const struct net_device *out, const void *data,
-+   unsigned int datalen)
-+{
-+      struct ebt_mark_m_info *info = (struct ebt_mark_m_info *) data;
-+
-+      if (info->bitmask & EBT_MARK_OR)
-+              return !(!!(skb->nfmark & info->mask) ^ info->invert);
-+      return !(((skb->nfmark & info->mask) == info->mark) ^ info->invert);
-+}
-+
-+static int ebt_mark_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+        struct ebt_mark_m_info *info = (struct ebt_mark_m_info *) data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_mark_m_info)))
-+              return -EINVAL;
-+      if (info->bitmask & ~EBT_MARK_MASK)
-+              return -EINVAL;
-+      if ((info->bitmask & EBT_MARK_OR) && (info->bitmask & EBT_MARK_AND))
-+              return -EINVAL;
-+      if (!info->bitmask)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_match filter_mark =
-+{
-+      {NULL, NULL}, EBT_MARK_MATCH, ebt_filter_mark, ebt_mark_check, NULL,
-+      THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_match(&filter_mark);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&filter_mark);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/netfilter/ebt_pkttype.c   2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,60 @@
-+/*
-+ *  ebt_pkttype
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bdschuym@pandora.be>
-+ *
-+ *  April, 2003
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_pkttype.h>
-+#include <linux/module.h>
-+
-+static int ebt_filter_pkttype(const struct sk_buff *skb,
-+   const struct net_device *in,
-+   const struct net_device *out,
-+   const void *data,
-+   unsigned int datalen)
-+{
-+      struct ebt_pkttype_info *info = (struct ebt_pkttype_info *)data;
-+
-+      return (skb->pkt_type != info->pkt_type) ^ info->invert;
-+}
-+
-+static int ebt_pkttype_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_pkttype_info *info = (struct ebt_pkttype_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_pkttype_info)))
-+              return -EINVAL;
-+      if (info->invert != 0 && info->invert != 1)
-+              return -EINVAL;
-+      /* Allow any pkt_type value */
-+      return 0;
-+}
-+
-+static struct ebt_match filter_pkttype =
-+{
-+      .name           = EBT_PKTTYPE_MATCH,
-+      .match          = ebt_filter_pkttype,
-+      .check          = ebt_pkttype_check,
-+      .me             = THIS_MODULE,
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_match(&filter_pkttype);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&filter_pkttype);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/netfilter/ebt_stp.c       2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,191 @@
-+/*
-+ *  ebt_stp
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bdschuym@pandora.be>
-+ *    Stephen Hemminger <shemminger@osdl.org>
-+ *
-+ *  June, 2003
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_stp.h>
-+#include <linux/module.h>
-+
-+#define BPDU_TYPE_CONFIG 0
-+#define BPDU_TYPE_TCN 0x80
-+
-+struct stp_header {
-+      uint8_t dsap;
-+      uint8_t ssap;
-+      uint8_t ctrl;
-+      uint8_t pid;
-+      uint8_t vers;
-+      uint8_t type;
-+};
-+
-+struct stp_config_pdu {
-+      uint8_t flags;
-+      uint8_t root[8];
-+      uint8_t root_cost[4];
-+      uint8_t sender[8];
-+      uint8_t port[2];
-+      uint8_t msg_age[2];
-+      uint8_t max_age[2];
-+      uint8_t hello_time[2];
-+      uint8_t forward_delay[2];
-+};
-+
-+#define NR16(p) (p[0] << 8 | p[1])
-+#define NR32(p) ((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3])
-+
-+static int ebt_filter_config(struct ebt_stp_info *info,
-+   struct stp_config_pdu *stpc)
-+{
-+      struct ebt_stp_config_info *c;
-+      uint16_t v16;
-+      uint32_t v32;
-+      int verdict, i;
-+
-+      c = &info->config;
-+      if ((info->bitmask & EBT_STP_FLAGS) &&
-+          FWINV(c->flags != stpc->flags, EBT_STP_FLAGS))
-+              return EBT_NOMATCH;
-+      if (info->bitmask & EBT_STP_ROOTPRIO) {
-+              v16 = NR16(stpc->root);
-+              if (FWINV(v16 < c->root_priol ||
-+                  v16 > c->root_priou, EBT_STP_ROOTPRIO))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_ROOTADDR) {
-+              verdict = 0;
-+              for (i = 0; i < 6; i++)
-+                      verdict |= (stpc->root[2+i] ^ c->root_addr[i]) &
-+                                 c->root_addrmsk[i];
-+              if (FWINV(verdict != 0, EBT_STP_ROOTADDR))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_ROOTCOST) {
-+              v32 = NR32(stpc->root_cost);
-+              if (FWINV(v32 < c->root_costl ||
-+                  v32 > c->root_costu, EBT_STP_ROOTCOST))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_SENDERPRIO) {
-+              v16 = NR16(stpc->sender);
-+              if (FWINV(v16 < c->sender_priol ||
-+                  v16 > c->sender_priou, EBT_STP_SENDERPRIO))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_SENDERADDR) {
-+              verdict = 0;
-+              for (i = 0; i < 6; i++)
-+                      verdict |= (stpc->sender[2+i] ^ c->sender_addr[i]) &
-+                                 c->sender_addrmsk[i];
-+              if (FWINV(verdict != 0, EBT_STP_SENDERADDR))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_PORT) {
-+              v16 = NR16(stpc->port);
-+              if (FWINV(v16 < c->portl ||
-+                  v16 > c->portu, EBT_STP_PORT))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_MSGAGE) {
-+              v16 = NR16(stpc->msg_age);
-+              if (FWINV(v16 < c->msg_agel ||
-+                  v16 > c->msg_ageu, EBT_STP_MSGAGE))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_MAXAGE) {
-+              v16 = NR16(stpc->max_age);
-+              if (FWINV(v16 < c->max_agel ||
-+                  v16 > c->max_ageu, EBT_STP_MAXAGE))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_HELLOTIME) {
-+              v16 = NR16(stpc->hello_time);
-+              if (FWINV(v16 < c->hello_timel ||
-+                  v16 > c->hello_timeu, EBT_STP_HELLOTIME))
-+                      return EBT_NOMATCH;
-+      }
-+      if (info->bitmask & EBT_STP_FWDD) {
-+              v16 = NR16(stpc->forward_delay);
-+              if (FWINV(v16 < c->forward_delayl ||
-+                  v16 > c->forward_delayu, EBT_STP_FWDD))
-+                      return EBT_NOMATCH;
-+      }
-+      return EBT_MATCH;
-+}
-+
-+static int ebt_filter_stp(const struct sk_buff *skb, const struct net_device *in,
-+   const struct net_device *out, const void *data, unsigned int datalen)
-+{
-+      struct ebt_stp_info *info = (struct ebt_stp_info *)data;
-+      struct stp_header stph;
-+      uint8_t header[6] = {0x42, 0x42, 0x03, 0x00, 0x00, 0x00};
-+      if (skb_copy_bits(skb, 0, &stph, sizeof(stph)))
-+              return EBT_NOMATCH;
-+
-+      /* The stp code only considers these */
-+      if (memcmp(&stph, header, sizeof(header)))
-+              return EBT_NOMATCH;
-+
-+      if (info->bitmask & EBT_STP_TYPE
-+          && FWINV(info->type != stph.type, EBT_STP_TYPE))
-+              return EBT_NOMATCH;
-+
-+      if (stph.type == BPDU_TYPE_CONFIG &&
-+          info->bitmask & EBT_STP_CONFIG_MASK) {
-+              struct stp_config_pdu stpc;
-+
-+              if (skb_copy_bits(skb, sizeof(stph), &stpc, sizeof(stpc)))
-+                  return EBT_NOMATCH;
-+              return ebt_filter_config(info, &stpc);
-+      }
-+      return EBT_MATCH;
-+}
-+
-+static int ebt_stp_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_stp_info *info = (struct ebt_stp_info *)data;
-+      int len = EBT_ALIGN(sizeof(struct ebt_stp_info));
-+      uint8_t bridge_ula[6] = { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 };
-+      uint8_t msk[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
-+
-+      if (info->bitmask & ~EBT_STP_MASK || info->invflags & ~EBT_STP_MASK ||
-+          !(info->bitmask & EBT_STP_MASK))
-+              return -EINVAL;
-+      if (datalen != len)
-+              return -EINVAL;
-+      /* Make sure the match only receives stp frames */
-+      if (memcmp(e->destmac, bridge_ula, ETH_ALEN) ||
-+          memcmp(e->destmsk, msk, ETH_ALEN) || !(e->bitmask & EBT_DESTMAC))
-+              return -EINVAL;
-+
-+      return 0;
-+}
-+
-+static struct ebt_match filter_stp =
-+{
-+      .name           = EBT_STP_MATCH,
-+      .match          = ebt_filter_stp,
-+      .check          = ebt_stp_check,
-+      .me             = THIS_MODULE,
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_match(&filter_stp);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&filter_stp);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/netfilter/ebt_redirect.c  2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,71 @@
-+/*
-+ *  ebt_redirect
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  April, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_redirect.h>
-+#include <linux/module.h>
-+#include <net/sock.h>
-+#include "../br_private.h"
-+
-+static int ebt_target_redirect(struct sk_buff **pskb, unsigned int hooknr,
-+   const struct net_device *in, const struct net_device *out,
-+   const void *data, unsigned int datalen)
-+{
-+      struct ebt_redirect_info *info = (struct ebt_redirect_info *)data;
-+
-+      if (hooknr != NF_BR_BROUTING)
-+              memcpy((**pskb).mac.ethernet->h_dest,
-+                 in->br_port->br->dev.dev_addr, ETH_ALEN);
-+      else {
-+              memcpy((**pskb).mac.ethernet->h_dest,
-+                 in->dev_addr, ETH_ALEN);
-+              (*pskb)->pkt_type = PACKET_HOST;
-+      }
-+      return info->target;
-+}
-+
-+static int ebt_target_redirect_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_redirect_info *info = (struct ebt_redirect_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_redirect_info)))
-+              return -EINVAL;
-+      if (BASE_CHAIN && info->target == EBT_RETURN)
-+              return -EINVAL;
-+      CLEAR_BASE_CHAIN_BIT;
-+      if ( (strcmp(tablename, "nat") || hookmask & ~(1 << NF_BR_PRE_ROUTING)) &&
-+           (strcmp(tablename, "broute") || hookmask & ~(1 << NF_BR_BROUTING)) )
-+              return -EINVAL;
-+      if (INVALID_TARGET)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_target redirect_target =
-+{
-+      {NULL, NULL}, EBT_REDIRECT_TARGET, ebt_target_redirect,
-+      ebt_target_redirect_check, NULL, THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_target(&redirect_target);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_target(&redirect_target);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/netfilter/ebt_arp.c       2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,149 @@
-+/*
-+ *  ebt_arp
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *    Tim Gardner <timg@tpi.com>
-+ *
-+ *  April, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_arp.h>
-+#include <linux/if_arp.h>
-+#include <linux/if_ether.h>
-+#include <linux/module.h>
-+
-+static int ebt_filter_arp(const struct sk_buff *skb, const struct net_device *in,
-+   const struct net_device *out, const void *data, unsigned int datalen)
-+{
-+      struct ebt_arp_info *info = (struct ebt_arp_info *)data;
-+
-+      if (info->bitmask & EBT_ARP_OPCODE && FWINV(info->opcode !=
-+         ((*skb).nh.arph)->ar_op, EBT_ARP_OPCODE))
-+              return EBT_NOMATCH;
-+      if (info->bitmask & EBT_ARP_HTYPE && FWINV(info->htype !=
-+         ((*skb).nh.arph)->ar_hrd, EBT_ARP_HTYPE))
-+              return EBT_NOMATCH;
-+      if (info->bitmask & EBT_ARP_PTYPE && FWINV(info->ptype !=
-+         ((*skb).nh.arph)->ar_pro, EBT_ARP_PTYPE))
-+              return EBT_NOMATCH;
-+
-+      if (info->bitmask & (EBT_ARP_SRC_IP | EBT_ARP_DST_IP))
-+      {
-+              uint32_t arp_len = sizeof(struct arphdr) +
-+                 (2 * (((*skb).nh.arph)->ar_hln)) +
-+                 (2 * (((*skb).nh.arph)->ar_pln));
-+              uint32_t dst;
-+              uint32_t src;
-+
-+              // Make sure the packet is long enough.
-+              if ((((*skb).nh.raw) + arp_len) > (*skb).tail)
-+                      return EBT_NOMATCH;
-+              // IPv4 addresses are always 4 bytes.
-+              if (((*skb).nh.arph)->ar_pln != sizeof(uint32_t))
-+                      return EBT_NOMATCH;
-+
-+              if (info->bitmask & EBT_ARP_SRC_IP) {
-+                      memcpy(&src, ((*skb).nh.raw) + sizeof(struct arphdr) +
-+                         ((*skb).nh.arph)->ar_hln, sizeof(uint32_t));
-+                      if (FWINV(info->saddr != (src & info->smsk),
-+                         EBT_ARP_SRC_IP))
-+                              return EBT_NOMATCH;
-+              }
-+
-+              if (info->bitmask & EBT_ARP_DST_IP) {
-+                      memcpy(&dst, ((*skb).nh.raw)+sizeof(struct arphdr) +
-+                         (2*(((*skb).nh.arph)->ar_hln)) +
-+                         (((*skb).nh.arph)->ar_pln), sizeof(uint32_t));
-+                      if (FWINV(info->daddr != (dst & info->dmsk),
-+                         EBT_ARP_DST_IP))
-+                              return EBT_NOMATCH;
-+              }
-+      }
-+
-+      if (info->bitmask & (EBT_ARP_SRC_MAC | EBT_ARP_DST_MAC))
-+      {
-+              uint32_t arp_len = sizeof(struct arphdr) +
-+                 (2 * (((*skb).nh.arph)->ar_hln)) +
-+                 (2 * (((*skb).nh.arph)->ar_pln));
-+              unsigned char dst[ETH_ALEN];
-+              unsigned char src[ETH_ALEN];
-+
-+              // Make sure the packet is long enough.
-+              if ((((*skb).nh.raw) + arp_len) > (*skb).tail)
-+                      return EBT_NOMATCH;
-+              // MAC addresses are 6 bytes.
-+              if (((*skb).nh.arph)->ar_hln != ETH_ALEN)
-+                      return EBT_NOMATCH;
-+              if (info->bitmask & EBT_ARP_SRC_MAC) {
-+                      uint8_t verdict, i;
-+
-+                      memcpy(&src, ((*skb).nh.raw) +
-+                                      sizeof(struct arphdr),
-+                                      ETH_ALEN);
-+                      verdict = 0;
-+                      for (i = 0; i < 6; i++)
-+                              verdict |= (src[i] ^ info->smaddr[i]) &
-+                                     info->smmsk[i];  
-+                      if (FWINV(verdict != 0, EBT_ARP_SRC_MAC))
-+                              return EBT_NOMATCH;
-+              }
-+
-+              if (info->bitmask & EBT_ARP_DST_MAC) { 
-+                      uint8_t verdict, i;
-+
-+                      memcpy(&dst, ((*skb).nh.raw) +
-+                                      sizeof(struct arphdr) +
-+                                      (((*skb).nh.arph)->ar_hln) +
-+                                      (((*skb).nh.arph)->ar_pln),
-+                                      ETH_ALEN);
-+                      verdict = 0;
-+                      for (i = 0; i < 6; i++)
-+                              verdict |= (dst[i] ^ info->dmaddr[i]) &
-+                                      info->dmmsk[i];
-+                      if (FWINV(verdict != 0, EBT_ARP_DST_MAC))
-+                              return EBT_NOMATCH;
-+              }
-+      }
-+
-+      return EBT_MATCH;
-+}
-+
-+static int ebt_arp_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_arp_info *info = (struct ebt_arp_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_arp_info)))
-+              return -EINVAL;
-+      if ((e->ethproto != __constant_htons(ETH_P_ARP) &&
-+         e->ethproto != __constant_htons(ETH_P_RARP)) ||
-+         e->invflags & EBT_IPROTO)
-+              return -EINVAL;
-+      if (info->bitmask & ~EBT_ARP_MASK || info->invflags & ~EBT_ARP_MASK)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_match filter_arp =
-+{
-+      {NULL, NULL}, EBT_ARP_MATCH, ebt_filter_arp, ebt_arp_check, NULL,
-+      THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_match(&filter_arp);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&filter_arp);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/netfilter/ebt_ip.c        2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,121 @@
-+/*
-+ *  ebt_ip
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  April, 2002
-+ *
-+ *  Changes:
-+ *    added ip-sport and ip-dport
-+ *    Innominate Security Technologies AG <mhopf@innominate.com>
-+ *    September, 2002
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_ip.h>
-+#include <linux/ip.h>
-+#include <linux/in.h>
-+#include <linux/module.h>
-+
-+struct tcpudphdr {
-+      uint16_t src;
-+      uint16_t dst;
-+};
-+
-+union h_u {
-+      unsigned char *raw;
-+      struct tcpudphdr *tuh;
-+};
-+
-+static int ebt_filter_ip(const struct sk_buff *skb, const struct net_device *in,
-+   const struct net_device *out, const void *data,
-+   unsigned int datalen)
-+{
-+      struct ebt_ip_info *info = (struct ebt_ip_info *)data;
-+
-+      if (info->bitmask & EBT_IP_TOS &&
-+         FWINV(info->tos != ((*skb).nh.iph)->tos, EBT_IP_TOS))
-+              return EBT_NOMATCH;
-+      if (info->bitmask & EBT_IP_PROTO) {
-+              if (FWINV(info->protocol != ((*skb).nh.iph)->protocol,
-+                        EBT_IP_PROTO))
-+                      return EBT_NOMATCH;
-+              if ( info->protocol == IPPROTO_TCP ||
-+                   info->protocol == IPPROTO_UDP )
-+              {
-+                      union h_u h;
-+                      h.raw = skb->data + skb->nh.iph->ihl*4;
-+                      if (info->bitmask & EBT_IP_DPORT) {
-+                              uint16_t port = ntohs(h.tuh->dst);
-+                              if (FWINV(port < info->dport[0] ||
-+                                        port > info->dport[1],
-+                                        EBT_IP_DPORT))
-+                              return EBT_NOMATCH;
-+                      }
-+                      if (info->bitmask & EBT_IP_SPORT) {
-+                              uint16_t port = ntohs(h.tuh->src);
-+                              if (FWINV(port < info->sport[0] ||
-+                                        port > info->sport[1],
-+                                        EBT_IP_SPORT))
-+                              return EBT_NOMATCH;
-+                      }
-+              }
-+      }
-+      if (info->bitmask & EBT_IP_SOURCE &&
-+         FWINV((((*skb).nh.iph)->saddr & info->smsk) !=
-+         info->saddr, EBT_IP_SOURCE))
-+              return EBT_NOMATCH;
-+      if ((info->bitmask & EBT_IP_DEST) &&
-+         FWINV((((*skb).nh.iph)->daddr & info->dmsk) !=
-+         info->daddr, EBT_IP_DEST))
-+              return EBT_NOMATCH;
-+      return EBT_MATCH;
-+}
-+
-+static int ebt_ip_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_ip_info *info = (struct ebt_ip_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_ip_info)))
-+              return -EINVAL;
-+      if (e->ethproto != __constant_htons(ETH_P_IP) ||
-+         e->invflags & EBT_IPROTO)
-+              return -EINVAL;
-+      if (info->bitmask & ~EBT_IP_MASK || info->invflags & ~EBT_IP_MASK)
-+              return -EINVAL;
-+      if (info->bitmask & (EBT_IP_DPORT | EBT_IP_SPORT)) {
-+              if (!info->bitmask & EBT_IPROTO)
-+                      return -EINVAL;
-+              if (info->protocol != IPPROTO_TCP &&
-+                  info->protocol != IPPROTO_UDP)
-+                       return -EINVAL;
-+      }
-+      if (info->bitmask & EBT_IP_DPORT && info->dport[0] > info->dport[1])
-+              return -EINVAL;
-+      if (info->bitmask & EBT_IP_SPORT && info->sport[0] > info->sport[1])
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_match filter_ip =
-+{
-+      {NULL, NULL}, EBT_IP_MATCH, ebt_filter_ip, ebt_ip_check, NULL,
-+      THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_match(&filter_ip);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&filter_ip);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/netfilter/ebt_vlan.c      2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,259 @@
-+/*
-+ * Description: EBTables 802.1Q match extension kernelspace module.
-+ * Authors: Nick Fedchik <nick@fedchik.org.ua>
-+ *          Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *    
-+ * 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, or
-+ * (at your option) any later version.
-+ * 
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *  
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-+ */
-+
-+#include <linux/if_ether.h>
-+#include <linux/if_vlan.h>
-+#include <linux/module.h>
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_vlan.h>
-+
-+static unsigned char debug;
-+#define MODULE_VERSION "0.6"
-+
-+MODULE_PARM(debug, "0-1b");
-+MODULE_PARM_DESC(debug, "debug=1 is turn on debug messages");
-+MODULE_AUTHOR("Nick Fedchik <nick@fedchik.org.ua>");
-+MODULE_DESCRIPTION("802.1Q match module (ebtables extension), v"
-+                 MODULE_VERSION);
-+MODULE_LICENSE("GPL");
-+
-+
-+#define DEBUG_MSG(args...) if (debug) printk (KERN_DEBUG "ebt_vlan: " args)
-+#define INV_FLAG(_inv_flag_) (info->invflags & _inv_flag_) ? "!" : ""
-+#define GET_BITMASK(_BIT_MASK_) info->bitmask & _BIT_MASK_
-+#define SET_BITMASK(_BIT_MASK_) info->bitmask |= _BIT_MASK_
-+#define EXIT_ON_MISMATCH(_MATCH_,_MASK_) if (!((info->_MATCH_ == _MATCH_)^!!(info->invflags & _MASK_))) return 1;
-+
-+/*
-+ * Function description: ebt_filter_vlan() is main engine for 
-+ * checking passed 802.1Q frame according to 
-+ * the passed extension parameters (in the *data buffer)
-+ * ebt_filter_vlan() is called after successfull check the rule params
-+ * by ebt_check_vlan() function.
-+ * Parameters:
-+ * const struct sk_buff *skb - pointer to passed ethernet frame buffer
-+ * const void *data - pointer to passed extension parameters
-+ * unsigned int datalen - length of passed *data buffer
-+ * const struct net_device *in  -
-+ * const struct net_device *out -
-+ * const struct ebt_counter *c -
-+ * Returned values:
-+ * 0 - ok (all rule params matched)
-+ * 1 - miss (rule params not acceptable to the parsed frame)
-+ */
-+static int
-+ebt_filter_vlan(const struct sk_buff *skb,
-+              const struct net_device *in,
-+              const struct net_device *out,
-+              const void *data, unsigned int datalen)
-+{
-+      struct ebt_vlan_info *info = (struct ebt_vlan_info *) data;     /* userspace data */
-+      struct vlan_ethhdr *frame = (struct vlan_ethhdr *) skb->mac.raw;        /* Passed tagged frame */
-+
-+      unsigned short TCI;     /* Whole TCI, given from parsed frame */
-+      unsigned short id;      /* VLAN ID, given from frame TCI */
-+      unsigned char prio;     /* user_priority, given from frame TCI */
-+      unsigned short encap;   /* VLAN encapsulated Type/Length field, given from orig frame */
-+
-+      /*
-+       * Tag Control Information (TCI) consists of the following elements:
-+       * - User_priority. The user_priority field is three bits in length, 
-+       * interpreted as a binary number. 
-+       * - Canonical Format Indicator (CFI). The Canonical Format Indicator 
-+       * (CFI) is a single bit flag value. Currently ignored.
-+       * - VLAN Identifier (VID). The VID is encoded as 
-+       * an unsigned binary number. 
-+       */
-+      TCI = ntohs(frame->h_vlan_TCI);
-+      id = TCI & VLAN_VID_MASK;
-+      prio = (TCI >> 13) & 0x7;
-+      encap = frame->h_vlan_encapsulated_proto;
-+
-+      /*
-+       * Checking VLAN Identifier (VID)
-+       */
-+      if (GET_BITMASK(EBT_VLAN_ID)) { /* Is VLAN ID parsed? */
-+              EXIT_ON_MISMATCH(id, EBT_VLAN_ID);
-+      }
-+      /*
-+       * Checking user_priority
-+       */
-+      if (GET_BITMASK(EBT_VLAN_PRIO)) {       /* Is VLAN user_priority parsed? */
-+              EXIT_ON_MISMATCH(prio, EBT_VLAN_PRIO);
-+      }
-+      /*
-+       * Checking Encapsulated Proto (Length/Type) field
-+       */
-+      if (GET_BITMASK(EBT_VLAN_ENCAP)) {      /* Is VLAN Encap parsed? */
-+              EXIT_ON_MISMATCH(encap, EBT_VLAN_ENCAP);
-+      }
-+      /*
-+       * All possible extension parameters was parsed.
-+       * If rule never returned by missmatch, then all ok.
-+       */
-+      return 0;
-+}
-+
-+/*
-+ * Function description: ebt_vlan_check() is called when userspace 
-+ * delivers the table entry to the kernel, 
-+ * and to check that userspace doesn't give a bad table.
-+ * Parameters:
-+ * const char *tablename - table name string
-+ * unsigned int hooknr - hook number
-+ * const struct ebt_entry *e - ebtables entry basic set
-+ * const void *data - pointer to passed extension parameters
-+ * unsigned int datalen - length of passed *data buffer
-+ * Returned values:
-+ * 0 - ok (all delivered rule params are correct)
-+ * 1 - miss (rule params is out of range, invalid, incompatible, etc.)
-+ */
-+static int
-+ebt_check_vlan(const char *tablename,
-+             unsigned int hooknr,
-+             const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_vlan_info *info = (struct ebt_vlan_info *) data;
-+
-+      /*
-+       * Parameters buffer overflow check 
-+       */
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_vlan_info))) {
-+              DEBUG_MSG
-+                  ("passed size %d is not eq to ebt_vlan_info (%d)\n",
-+                   datalen, sizeof(struct ebt_vlan_info));
-+              return -EINVAL;
-+      }
-+
-+      /*
-+       * Is it 802.1Q frame checked?
-+       */
-+      if (e->ethproto != __constant_htons(ETH_P_8021Q)) {
-+              DEBUG_MSG
-+                  ("passed entry proto %2.4X is not 802.1Q (8100)\n",
-+                   (unsigned short) ntohs(e->ethproto));
-+              return -EINVAL;
-+      }
-+
-+      /*
-+       * Check for bitmask range 
-+       * True if even one bit is out of mask
-+       */
-+      if (info->bitmask & ~EBT_VLAN_MASK) {
-+              DEBUG_MSG("bitmask %2X is out of mask (%2X)\n",
-+                        info->bitmask, EBT_VLAN_MASK);
-+              return -EINVAL;
-+      }
-+
-+      /*
-+       * Check for inversion flags range 
-+       */
-+      if (info->invflags & ~EBT_VLAN_MASK) {
-+              DEBUG_MSG("inversion flags %2X is out of mask (%2X)\n",
-+                        info->invflags, EBT_VLAN_MASK);
-+              return -EINVAL;
-+      }
-+
-+      /*
-+       * Reserved VLAN ID (VID) values
-+       * -----------------------------
-+       * 0 - The null VLAN ID. 
-+       * 1 - The default Port VID (PVID)
-+       * 0x0FFF - Reserved for implementation use. 
-+       * if_vlan.h: VLAN_GROUP_ARRAY_LEN 4096.
-+       */
-+      if (GET_BITMASK(EBT_VLAN_ID)) { /* when vlan-id param was spec-ed */
-+              if (!!info->id) {       /* if id!=0 => check vid range */
-+                      if (info->id > VLAN_GROUP_ARRAY_LEN) {
-+                              DEBUG_MSG
-+                                  ("id %d is out of range (1-4096)\n",
-+                                   info->id);
-+                              return -EINVAL;
-+                      }
-+                      /*
-+                       * Note: This is valid VLAN-tagged frame point.
-+                       * Any value of user_priority are acceptable, 
-+                       * but should be ignored according to 802.1Q Std.
-+                       * So we just drop the prio flag. 
-+                       */
-+                      info->bitmask &= ~EBT_VLAN_PRIO;
-+              }
-+              /*
-+               * Else, id=0 (null VLAN ID)  => user_priority range (any?)
-+               */
-+      }
-+
-+      if (GET_BITMASK(EBT_VLAN_PRIO)) {
-+              if ((unsigned char) info->prio > 7) {
-+                      DEBUG_MSG
-+                          ("prio %d is out of range (0-7)\n",
-+                           info->prio);
-+                      return -EINVAL;
-+              }
-+      }
-+      /*
-+       * Check for encapsulated proto range - it is possible to be 
-+       * any value for u_short range.
-+       * if_ether.h:  ETH_ZLEN        60   -  Min. octets in frame sans FCS
-+       */
-+      if (GET_BITMASK(EBT_VLAN_ENCAP)) {
-+              if ((unsigned short) ntohs(info->encap) < ETH_ZLEN) {
-+                      DEBUG_MSG
-+                          ("encap frame length %d is less than minimal\n",
-+                           ntohs(info->encap));
-+                      return -EINVAL;
-+              }
-+      }
-+
-+      return 0;
-+}
-+
-+static struct ebt_match filter_vlan = {
-+      {NULL, NULL},
-+      EBT_VLAN_MATCH,
-+      ebt_filter_vlan,
-+      ebt_check_vlan,
-+      NULL,
-+      THIS_MODULE
-+};
-+
-+/*
-+ * Module initialization function.
-+ */
-+static int __init init(void)
-+{
-+      DEBUG_MSG("ebtables 802.1Q extension module v"
-+                MODULE_VERSION "\n");
-+      DEBUG_MSG("module debug=%d\n", !!debug);
-+      return ebt_register_match(&filter_vlan);
-+}
-+
-+/*
-+ * Module "finalization" function
-+ */
-+static void __exit fini(void)
-+{
-+      ebt_unregister_match(&filter_vlan);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+
-+EXPORT_NO_SYMBOLS;
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/netfilter/ebt_log.c       2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,153 @@
-+/*
-+ *  ebt_log
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  April, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_log.h>
-+#include <linux/module.h>
-+#include <linux/ip.h>
-+#include <linux/in.h>
-+#include <linux/if_arp.h>
-+#include <linux/spinlock.h>
-+
-+static spinlock_t ebt_log_lock = SPIN_LOCK_UNLOCKED;
-+
-+static int ebt_log_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_log_info *info = (struct ebt_log_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_log_info)))
-+              return -EINVAL;
-+      if (info->bitmask & ~EBT_LOG_MASK)
-+              return -EINVAL;
-+      if (info->loglevel >= 8)
-+              return -EINVAL;
-+      info->prefix[EBT_LOG_PREFIX_SIZE - 1] = '\0';
-+      return 0;
-+}
-+
-+struct tcpudphdr
-+{
-+      uint16_t src;
-+      uint16_t dst;
-+};
-+
-+struct arppayload
-+{
-+      unsigned char mac_src[ETH_ALEN];
-+      unsigned char ip_src[4];
-+      unsigned char mac_dst[ETH_ALEN];
-+      unsigned char ip_dst[4];
-+};
-+
-+static void print_MAC(unsigned char *p)
-+{
-+      int i;
-+
-+      for (i = 0; i < ETH_ALEN; i++, p++)
-+              printk("%02x%c", *p, i == ETH_ALEN - 1 ? ' ':':');
-+}
-+
-+#define myNIPQUAD(a) a[0], a[1], a[2], a[3]
-+static void ebt_log(const struct sk_buff *skb, unsigned int hooknr,
-+   const struct net_device *in, const struct net_device *out,
-+   const void *data, unsigned int datalen)
-+{
-+      struct ebt_log_info *info = (struct ebt_log_info *)data;
-+      char level_string[4] = "< >";
-+      level_string[1] = '0' + info->loglevel;
-+
-+      spin_lock_bh(&ebt_log_lock);
-+      printk(level_string);
-+      printk("%s IN=%s OUT=%s ", info->prefix, in ? in->name : "",
-+         out ? out->name : "");
-+
-+      printk("MAC source = ");
-+      print_MAC((skb->mac.ethernet)->h_source);
-+      printk("MAC dest = ");
-+      print_MAC((skb->mac.ethernet)->h_dest);
-+
-+      printk("proto = 0x%04x", ntohs(((*skb).mac.ethernet)->h_proto));
-+
-+      if ((info->bitmask & EBT_LOG_IP) && skb->mac.ethernet->h_proto ==
-+         htons(ETH_P_IP)){
-+              struct iphdr *iph = skb->nh.iph;
-+              printk(" IP SRC=%u.%u.%u.%u IP DST=%u.%u.%u.%u,",
-+                 NIPQUAD(iph->saddr), NIPQUAD(iph->daddr));
-+              printk(" IP tos=0x%02X, IP proto=%d", iph->tos, iph->protocol);
-+              if (iph->protocol == IPPROTO_TCP ||
-+                  iph->protocol == IPPROTO_UDP) {
-+                      struct tcpudphdr *ports = (struct tcpudphdr *)(skb->data + iph->ihl*4);
-+
-+                      if (skb->data + iph->ihl*4 > skb->tail) {
-+                              printk(" INCOMPLETE TCP/UDP header");
-+                              goto out;
-+                      }
-+                      printk(" SPT=%u DPT=%u", ntohs(ports->src),
-+                         ntohs(ports->dst));
-+              }
-+              goto out;
-+      }
-+
-+      if ((info->bitmask & EBT_LOG_ARP) &&
-+          ((skb->mac.ethernet->h_proto == __constant_htons(ETH_P_ARP)) ||
-+          (skb->mac.ethernet->h_proto == __constant_htons(ETH_P_RARP)))) {
-+              struct arphdr * arph = skb->nh.arph;
-+              printk(" ARP HTYPE=%d, PTYPE=0x%04x, OPCODE=%d",
-+                 ntohs(arph->ar_hrd), ntohs(arph->ar_pro),
-+                 ntohs(arph->ar_op));
-+              /* If it's for Ethernet and the lengths are OK,
-+               * then log the ARP payload */
-+              if (arph->ar_hrd == __constant_htons(1) &&
-+                  arph->ar_hln == ETH_ALEN &&
-+                  arph->ar_pln == sizeof(uint32_t)) {
-+                      struct arppayload *arpp = (struct arppayload *)(skb->data + sizeof(*arph));
-+
-+                      if (skb->data + sizeof(*arph) > skb->tail) {
-+                              printk(" INCOMPLETE ARP header");
-+                              goto out;
-+                      }
-+
-+                      printk(" ARP MAC SRC=");
-+                      print_MAC(arpp->mac_src);
-+                      printk(" ARP IP SRC=%u.%u.%u.%u",
-+                             myNIPQUAD(arpp->ip_src));
-+                      printk(" ARP MAC DST=");
-+                      print_MAC(arpp->mac_dst);
-+                      printk(" ARP IP DST=%u.%u.%u.%u",
-+                             myNIPQUAD(arpp->ip_dst));
-+              }
-+
-+      }
-+out:
-+      printk("\n");
-+      spin_unlock_bh(&ebt_log_lock);
-+}
-+
-+static struct ebt_watcher log =
-+{
-+      {NULL, NULL}, EBT_LOG_WATCHER, ebt_log, ebt_log_check, NULL,
-+      THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_watcher(&log);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_watcher(&log);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/netfilter/ebt_ulog.c      2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,281 @@
-+/*
-+ * netfilter module for userspace bridged Ethernet frames logging daemons
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bdschuym@pandora.be>
-+ *
-+ *  November, 2004
-+ *
-+ * Based on ipt_ULOG.c, which is
-+ * (C) 2000-2002 by Harald Welte <laforge@netfilter.org>
-+ *
-+ * This module accepts two parameters: 
-+ * 
-+ * nlbufsiz:
-+ *   The parameter specifies how big the buffer for each netlink multicast
-+ * group is. e.g. If you say nlbufsiz=8192, up to eight kb of packets will
-+ * get accumulated in the kernel until they are sent to userspace. It is
-+ * NOT possible to allocate more than 128kB, and it is strongly discouraged,
-+ * because atomically allocating 128kB inside the network rx softirq is not
-+ * reliable. Please also keep in mind that this buffer size is allocated for
-+ * each nlgroup you are using, so the total kernel memory usage increases
-+ * by that factor.
-+ *
-+ * flushtimeout:
-+ *   Specify, after how many hundredths of a second the queue should be
-+ *   flushed even if it is not full yet.
-+ *
-+ */
-+
-+#include <linux/module.h>
-+#include <linux/config.h>
-+#include <linux/spinlock.h>
-+#include <linux/socket.h>
-+#include <linux/skbuff.h>
-+#include <linux/kernel.h>
-+#include <linux/timer.h>
-+#include <linux/netlink.h>
-+#include <linux/netdevice.h>
-+#include <linux/module.h>
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_ulog.h>
-+#include <net/sock.h>
-+#include "../br_private.h"
-+
-+#define PRINTR(format, args...)       do { if (net_ratelimit()) \
-+                                              printk(format , ## args); } while (0)
-+
-+static unsigned int nlbufsiz = 4096;
-+MODULE_PARM(nlbufsiz, "i");
-+MODULE_PARM_DESC(nlbufsiz, "netlink buffer size (number of bytes) "
-+                           "(defaults to 4096)");
-+
-+static unsigned int flushtimeout = 10;
-+MODULE_PARM(flushtimeout, "i");
-+MODULE_PARM_DESC(flushtimeout, "buffer flush timeout (hundredths of a second) "
-+                               "(defaults to 10)");
-+
-+typedef struct {
-+      unsigned int qlen;              /* number of nlmsgs' in the skb */
-+      struct nlmsghdr *lastnlh;       /* netlink header of last msg in skb */
-+      struct sk_buff *skb;            /* the pre-allocated skb */
-+      struct timer_list timer;        /* the timer function */
-+      spinlock_t lock;                /* the per-queue lock */
-+} ebt_ulog_buff_t;
-+
-+static ebt_ulog_buff_t ulog_buffers[EBT_ULOG_MAXNLGROUPS];
-+static struct sock *ebtlognl;
-+
-+/* send one ulog_buff_t to userspace */
-+static void ulog_send(unsigned int nlgroup)
-+{
-+      ebt_ulog_buff_t *ub = &ulog_buffers[nlgroup];
-+
-+      if (timer_pending(&ub->timer))
-+              del_timer(&ub->timer);
-+
-+      /* last nlmsg needs NLMSG_DONE */
-+      if (ub->qlen > 1)
-+              ub->lastnlh->nlmsg_type = NLMSG_DONE;
-+
-+      NETLINK_CB(ub->skb).dst_groups = 1 << nlgroup;
-+      netlink_broadcast(ebtlognl, ub->skb, 0, 1 << nlgroup, GFP_ATOMIC);
-+
-+      ub->qlen = 0;
-+      ub->skb = NULL;
-+}
-+
-+/* timer function to flush queue in flushtimeout time */
-+static void ulog_timer(unsigned long data)
-+{
-+      spin_lock_bh(&ulog_buffers[data].lock);
-+      if (ulog_buffers[data].skb)
-+              ulog_send(data);
-+      spin_unlock_bh(&ulog_buffers[data].lock);
-+}
-+
-+static struct sk_buff *ulog_alloc_skb(unsigned int size)
-+{
-+      struct sk_buff *skb;
-+
-+      skb = alloc_skb(nlbufsiz, GFP_ATOMIC);
-+      if (!skb) {
-+              PRINTR(KERN_ERR "ebt_ulog: can't alloc whole buffer "
-+                     "of size %ub!\n", nlbufsiz);
-+              if (size < nlbufsiz) {
-+                      /* try to allocate only as much as we need for
-+                       * current packet */
-+                      skb = alloc_skb(size, GFP_ATOMIC);
-+                      if (!skb)
-+                              PRINTR(KERN_ERR "ebt_ulog: can't even allocate "
-+                                     "buffer of size %ub\n", size);
-+              }
-+      }
-+
-+      return skb;
-+}
-+
-+static void ebt_ulog(const struct sk_buff *skb, unsigned int hooknr,
-+   const struct net_device *in, const struct net_device *out,
-+   const void *data, unsigned int datalen)
-+{
-+      ebt_ulog_packet_msg_t *pm;
-+      size_t size, copy_len;
-+      struct nlmsghdr *nlh;
-+      struct ebt_ulog_info *loginfo = (struct ebt_ulog_info *)data;
-+      unsigned int group = loginfo->nlgroup;
-+      ebt_ulog_buff_t *ub = &ulog_buffers[group];
-+      spinlock_t *lock = &ub->lock;
-+
-+      if ((loginfo->cprange == 0) ||
-+          (loginfo->cprange > skb->len + ETH_HLEN))
-+              copy_len = skb->len + ETH_HLEN;
-+      else
-+              copy_len = loginfo->cprange;
-+
-+      size = NLMSG_SPACE(sizeof(*pm) + copy_len);
-+
-+      spin_lock_bh(lock);
-+
-+      if (!ub->skb) {
-+              if (!(ub->skb = ulog_alloc_skb(size)))
-+                      goto alloc_failure;
-+      } else if (size > skb_tailroom(ub->skb)) {
-+              ulog_send(group);
-+
-+              if (!(ub->skb = ulog_alloc_skb(size)))
-+                      goto alloc_failure;
-+      }
-+
-+      nlh = NLMSG_PUT(ub->skb, 0, ub->qlen, 0,
-+                      size - NLMSG_ALIGN(sizeof(*nlh)));
-+      ub->qlen++;
-+
-+      pm = NLMSG_DATA(nlh);
-+
-+      /* Fill in the ulog data */
-+      do_gettimeofday(&pm->stamp);
-+      if (ub->qlen == 1)
-+              ub->skb->stamp = pm->stamp;
-+      pm->data_len = copy_len;
-+      pm->mark = skb->nfmark;
-+      pm->hook = hooknr;
-+      if (loginfo->prefix != NULL)
-+              strcpy(pm->prefix, loginfo->prefix);
-+      else
-+              *(pm->prefix) = '\0';
-+
-+      if (in) {
-+              strcpy(pm->physindev, in->name);
-+              strcpy(pm->indev, in->br_port->br->dev.name);
-+      } else
-+              pm->indev[0] = pm->physindev[0] = '\0';
-+
-+      if (out) {
-+              strcpy(pm->physoutdev, out->name);
-+              strcpy(pm->outdev, out->br_port->br->dev.name);
-+      } else
-+              pm->outdev[0] = pm->physoutdev[0] = '\0';
-+
-+      if (skb_copy_bits(skb, -ETH_HLEN, pm->data, copy_len) < 0)
-+              BUG();
-+
-+      if (ub->qlen > 1)
-+              ub->lastnlh->nlmsg_flags |= NLM_F_MULTI;
-+
-+      ub->lastnlh = nlh;
-+
-+      if (ub->qlen >= loginfo->qthreshold)
-+              ulog_send(group);
-+      else if (!timer_pending(&ub->timer)) {
-+              ub->timer.expires = jiffies + flushtimeout * HZ / 100;
-+              add_timer(&ub->timer);
-+      }
-+
-+unlock:
-+      spin_unlock_bh(lock);
-+
-+      return;
-+
-+nlmsg_failure:
-+      PRINTR(KERN_ERR "ebt_ULOG: error during NLMSG_PUT.\n");
-+      goto unlock;
-+alloc_failure:
-+      goto unlock;
-+}
-+
-+static int ebt_ulog_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_ulog_info *loginfo = (struct ebt_ulog_info *)data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_ulog_info)) ||
-+          loginfo->nlgroup > 31)
-+              return -EINVAL;
-+
-+      loginfo->prefix[EBT_ULOG_PREFIX_LEN - 1] = '\0';
-+
-+      if (loginfo->qthreshold > EBT_ULOG_MAX_QLEN)
-+              loginfo->qthreshold = EBT_ULOG_MAX_QLEN;
-+
-+      return 0;
-+}
-+
-+static struct ebt_watcher ulog = {
-+      {NULL, NULL}, EBT_ULOG_WATCHER, ebt_ulog, ebt_ulog_check, NULL,
-+      THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      int i, ret = 0;
-+
-+      if (nlbufsiz >= 128*1024) {
-+              printk(KERN_NOTICE "ebt_ulog: Netlink buffer has to be <= 128kB,"
-+                     " please try a smaller nlbufsiz parameter.\n");
-+              return -EINVAL;
-+      }
-+
-+      /* initialize ulog_buffers */
-+      for (i = 0; i < EBT_ULOG_MAXNLGROUPS; i++) {
-+              init_timer(&ulog_buffers[i].timer);
-+              ulog_buffers[i].timer.function = ulog_timer;
-+              ulog_buffers[i].timer.data = i;
-+              ulog_buffers[i].lock = SPIN_LOCK_UNLOCKED;
-+      }
-+
-+      ebtlognl = netlink_kernel_create(NETLINK_NFLOG, NULL);
-+      if (!ebtlognl)
-+              ret = -ENOMEM;
-+      else if ((ret = ebt_register_watcher(&ulog)))
-+              sock_release(ebtlognl->socket);
-+
-+      return ret;
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_ulog_buff_t *ub;
-+      int i;
-+
-+      ebt_unregister_watcher(&ulog);
-+      for (i = 0; i < EBT_ULOG_MAXNLGROUPS; i++) {
-+              ub = &ulog_buffers[i];
-+              if (timer_pending(&ub->timer))
-+                      del_timer(&ub->timer);
-+              spin_lock_bh(&ub->lock);
-+              if (ub->skb) {
-+                      kfree_skb(ub->skb);
-+                      ub->skb = NULL;
-+              }
-+              spin_unlock_bh(&ub->lock);
-+      }
-+      sock_release(ebtlognl->socket);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+MODULE_LICENSE("GPL");
-+MODULE_AUTHOR("Bart De Schuymer <bdschuym@pandora.be>");
-+MODULE_DESCRIPTION("ebtables userspace logging module for bridged Ethernet"
-+                   " frames");
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/netfilter/ebt_snat.c      2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,64 @@
-+/*
-+ *  ebt_snat
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  June, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_nat.h>
-+#include <linux/module.h>
-+
-+static int ebt_target_snat(struct sk_buff **pskb, unsigned int hooknr,
-+   const struct net_device *in, const struct net_device *out,
-+   const void *data, unsigned int datalen)
-+{
-+      struct ebt_nat_info *info = (struct ebt_nat_info *) data;
-+
-+      memcpy(((**pskb).mac.ethernet)->h_source, info->mac,
-+         ETH_ALEN * sizeof(unsigned char));
-+      return info->target;
-+}
-+
-+static int ebt_target_snat_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_nat_info *info = (struct ebt_nat_info *) data;
-+
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_nat_info)))
-+              return -EINVAL;
-+      if (BASE_CHAIN && info->target == EBT_RETURN)
-+              return -EINVAL;
-+      CLEAR_BASE_CHAIN_BIT;
-+      if (strcmp(tablename, "nat"))
-+              return -EINVAL;
-+      if (hookmask & ~(1 << NF_BR_POST_ROUTING))
-+              return -EINVAL;
-+      if (INVALID_TARGET)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_target snat =
-+{
-+      {NULL, NULL}, EBT_SNAT_TARGET, ebt_target_snat, ebt_target_snat_check,
-+      NULL, THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_target(&snat);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_target(&snat);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/netfilter/ebt_dnat.c      2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,65 @@
-+/*
-+ *  ebt_dnat
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  June, 2002
-+ *
-+ */
-+
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/netfilter_bridge/ebt_nat.h>
-+#include <linux/module.h>
-+#include <net/sock.h>
-+
-+static int ebt_target_dnat(struct sk_buff **pskb, unsigned int hooknr,
-+   const struct net_device *in, const struct net_device *out,
-+   const void *data, unsigned int datalen)
-+{
-+      struct ebt_nat_info *info = (struct ebt_nat_info *)data;
-+
-+      memcpy(((**pskb).mac.ethernet)->h_dest, info->mac,
-+         ETH_ALEN * sizeof(unsigned char));
-+      return info->target;
-+}
-+
-+static int ebt_target_dnat_check(const char *tablename, unsigned int hookmask,
-+   const struct ebt_entry *e, void *data, unsigned int datalen)
-+{
-+      struct ebt_nat_info *info = (struct ebt_nat_info *)data;
-+
-+      if (BASE_CHAIN && info->target == EBT_RETURN)
-+              return -EINVAL;
-+      CLEAR_BASE_CHAIN_BIT;
-+      if ( (strcmp(tablename, "nat") ||
-+         (hookmask & ~((1 << NF_BR_PRE_ROUTING) | (1 << NF_BR_LOCAL_OUT)))) &&
-+         (strcmp(tablename, "broute") || hookmask & ~(1 << NF_BR_BROUTING)) )
-+              return -EINVAL;
-+      if (datalen != EBT_ALIGN(sizeof(struct ebt_nat_info)))
-+              return -EINVAL;
-+      if (INVALID_TARGET)
-+              return -EINVAL;
-+      return 0;
-+}
-+
-+static struct ebt_target dnat =
-+{
-+      {NULL, NULL}, EBT_DNAT_TARGET, ebt_target_dnat, ebt_target_dnat_check,
-+      NULL, THIS_MODULE
-+};
-+
-+static int __init init(void)
-+{
-+      return ebt_register_target(&dnat);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ebt_unregister_target(&dnat);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+EXPORT_NO_SYMBOLS;
-+MODULE_LICENSE("GPL");
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/netfilter/ebtables.c      2005-03-14 21:04:05.155913576 +0100
-@@ -0,0 +1,1497 @@
-+/*
-+ *  ebtables
-+ *
-+ *  Author:
-+ *  Bart De Schuymer          <bart.de.schuymer@pandora.be>
-+ *
-+ *  ebtables.c,v 2.0, July, 2002
-+ *
-+ *  This code is stongly inspired on the iptables code which is
-+ *  Copyright (C) 1999 Paul `Rusty' Russell & Michael J. Neuling
-+ *
-+ *  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, or (at your option) any later version.
-+ */
-+
-+// used for print_string
-+#include <linux/sched.h>
-+#include <linux/tty.h>
-+
-+#include <linux/kmod.h>
-+#include <linux/module.h>
-+#include <linux/vmalloc.h>
-+#include <linux/netfilter_bridge/ebtables.h>
-+#include <linux/spinlock.h>
-+#include <asm/uaccess.h>
-+#include <linux/smp.h>
-+#include <net/sock.h>
-+// needed for logical [in,out]-dev filtering
-+#include "../br_private.h"
-+
-+// list_named_find
-+#define ASSERT_READ_LOCK(x)
-+#define ASSERT_WRITE_LOCK(x)
-+#include <linux/netfilter_ipv4/listhelp.h>
-+
-+#if 0 // use this for remote debugging
-+// Copyright (C) 1998 by Ori Pomerantz
-+// Print the string to the appropriate tty, the one
-+// the current task uses
-+static void print_string(char *str)
-+{
-+      struct tty_struct *my_tty;
-+
-+      /* The tty for the current task */
-+      my_tty = current->tty;
-+      if (my_tty != NULL) {
-+              (*(my_tty->driver).write)(my_tty, 0, str, strlen(str));
-+              (*(my_tty->driver).write)(my_tty, 0, "\015\012", 2);
-+      }
-+}
-+
-+#define BUGPRINT(args) print_string(args);
-+#else
-+#define BUGPRINT(format, args...) printk("kernel msg: ebtables bug: please "\
-+                                         "report to author: "format, ## args)
-+// #define BUGPRINT(format, args...)
-+#endif
-+#define MEMPRINT(format, args...) printk("kernel msg: ebtables "\
-+                                         ": out of memory: "format, ## args)
-+// #define MEMPRINT(format, args...)
-+
-+
-+
-+// Each cpu has its own set of counters, so there is no need for write_lock in
-+// the softirq
-+// For reading or updating the counters, the user context needs to
-+// get a write_lock
-+
-+// The size of each set of counters is altered to get cache alignment
-+#define SMP_ALIGN(x) (((x) + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1))
-+#define COUNTER_OFFSET(n) (SMP_ALIGN(n * sizeof(struct ebt_counter)))
-+#define COUNTER_BASE(c, n, cpu) ((struct ebt_counter *)(((char *)c) + \
-+   COUNTER_OFFSET(n) * cpu))
-+
-+
-+
-+static DECLARE_MUTEX(ebt_mutex);
-+static LIST_HEAD(ebt_tables);
-+static LIST_HEAD(ebt_targets);
-+static LIST_HEAD(ebt_matches);
-+static LIST_HEAD(ebt_watchers);
-+
-+static struct ebt_target ebt_standard_target =
-+{ {NULL, NULL}, EBT_STANDARD_TARGET, NULL, NULL, NULL, NULL};
-+
-+static inline int ebt_do_watcher (struct ebt_entry_watcher *w,
-+   const struct sk_buff *skb, unsigned int hooknr, const struct net_device *in,
-+   const struct net_device *out)
-+{
-+      w->u.watcher->watcher(skb, hooknr, in, out, w->data,
-+         w->watcher_size);
-+      // watchers don't give a verdict
-+      return 0;
-+}
-+
-+static inline int ebt_do_match (struct ebt_entry_match *m,
-+   const struct sk_buff *skb, const struct net_device *in,
-+   const struct net_device *out)
-+{
-+      return m->u.match->match(skb, in, out, m->data,
-+         m->match_size);
-+}
-+
-+static inline int ebt_dev_check(char *entry, const struct net_device *device)
-+{
-+      int i = 0;
-+      char *devname = device->name;
-+
-+      if (*entry == '\0')
-+              return 0;
-+      if (!device)
-+              return 1;
-+      /* 1 is the wildcard token */
-+      while (entry[i] != '\0' && entry[i] != 1 && entry[i] == devname[i])
-+              i++;
-+      return (devname[i] != entry[i] && entry[i] != 1);
-+}
-+
-+#define FWINV2(bool,invflg) ((bool) ^ !!(e->invflags & invflg))
-+// process standard matches
-+static inline int ebt_basic_match(struct ebt_entry *e, struct ethhdr *h,
-+   const struct net_device *in, const struct net_device *out)
-+{
-+      int verdict, i;
-+
-+      if (e->bitmask & EBT_802_3) {
-+              if (FWINV2(ntohs(h->h_proto) >= 1536, EBT_IPROTO))
-+                      return 1;
-+      } else if (!(e->bitmask & EBT_NOPROTO) &&
-+         FWINV2(e->ethproto != h->h_proto, EBT_IPROTO))
-+              return 1;
-+
-+      if (FWINV2(ebt_dev_check(e->in, in), EBT_IIN))
-+              return 1;
-+      if (FWINV2(ebt_dev_check(e->out, out), EBT_IOUT))
-+              return 1;
-+      if ((!in || !in->br_port) ? 0 : FWINV2(ebt_dev_check(
-+         e->logical_in, &in->br_port->br->dev), EBT_ILOGICALIN))
-+              return 1;
-+      if ((!out || !out->br_port) ? 0 : FWINV2(ebt_dev_check(
-+         e->logical_out, &out->br_port->br->dev), EBT_ILOGICALOUT))
-+              return 1;
-+
-+      if (e->bitmask & EBT_SOURCEMAC) {
-+              verdict = 0;
-+              for (i = 0; i < 6; i++)
-+                      verdict |= (h->h_source[i] ^ e->sourcemac[i]) &
-+                         e->sourcemsk[i];
-+              if (FWINV2(verdict != 0, EBT_ISOURCE) )
-+                      return 1;
-+      }
-+      if (e->bitmask & EBT_DESTMAC) {
-+              verdict = 0;
-+              for (i = 0; i < 6; i++)
-+                      verdict |= (h->h_dest[i] ^ e->destmac[i]) &
-+                         e->destmsk[i];
-+              if (FWINV2(verdict != 0, EBT_IDEST) )
-+                      return 1;
-+      }
-+      return 0;
-+}
-+
-+// Do some firewalling
-+unsigned int ebt_do_table (unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   struct ebt_table *table)
-+{
-+      int i, nentries;
-+      struct ebt_entry *point;
-+      struct ebt_counter *counter_base, *cb_base;
-+      struct ebt_entry_target *t;
-+      int verdict, sp = 0;
-+      struct ebt_chainstack *cs;
-+      struct ebt_entries *chaininfo;
-+      char *base;
-+      struct ebt_table_info *private;
-+
-+      read_lock_bh(&table->lock);
-+      private = table->private;
-+      cb_base = COUNTER_BASE(private->counters, private->nentries,
-+         cpu_number_map(smp_processor_id()));
-+      if (private->chainstack)
-+              cs = private->chainstack[cpu_number_map(smp_processor_id())];
-+      else
-+              cs = NULL;
-+      chaininfo = private->hook_entry[hook];
-+      nentries = private->hook_entry[hook]->nentries;
-+      point = (struct ebt_entry *)(private->hook_entry[hook]->data);
-+      counter_base = cb_base + private->hook_entry[hook]->counter_offset;
-+      // base for chain jumps
-+      base = private->entries;
-+      i = 0;
-+      while (i < nentries) {
-+              if (ebt_basic_match(point, (**pskb).mac.ethernet, in, out))
-+                      goto letscontinue;
-+
-+              if (EBT_MATCH_ITERATE(point, ebt_do_match, *pskb, in, out) != 0)
-+                      goto letscontinue;
-+
-+              // increase counter
-+              (*(counter_base + i)).pcnt++;
-+              (*(counter_base + i)).bcnt+=(**pskb).len;
-+
-+              // these should only watch: not modify, nor tell us
-+              // what to do with the packet
-+              EBT_WATCHER_ITERATE(point, ebt_do_watcher, *pskb, hook, in,
-+                 out);
-+
-+              t = (struct ebt_entry_target *)
-+                 (((char *)point) + point->target_offset);
-+              // standard target
-+              if (!t->u.target->target)
-+                      verdict = ((struct ebt_standard_target *)t)->verdict;
-+              else
-+                      verdict = t->u.target->target(pskb, hook,
-+                         in, out, t->data, t->target_size);
-+              if (verdict == EBT_ACCEPT) {
-+                      read_unlock_bh(&table->lock);
-+                      return NF_ACCEPT;
-+              }
-+              if (verdict == EBT_DROP) {
-+                      read_unlock_bh(&table->lock);
-+                      return NF_DROP;
-+              }
-+              if (verdict == EBT_RETURN) {
-+letsreturn:
-+#ifdef CONFIG_NETFILTER_DEBUG
-+                      if (sp == 0) {
-+                              BUGPRINT("RETURN on base chain");
-+                              // act like this is EBT_CONTINUE
-+                              goto letscontinue;
-+                      }
-+#endif
-+                      sp--;
-+                      // put all the local variables right
-+                      i = cs[sp].n;
-+                      chaininfo = cs[sp].chaininfo;
-+                      nentries = chaininfo->nentries;
-+                      point = cs[sp].e;
-+                      counter_base = cb_base +
-+                         chaininfo->counter_offset;
-+                      continue;
-+              }
-+              if (verdict == EBT_CONTINUE)
-+                      goto letscontinue;
-+#ifdef CONFIG_NETFILTER_DEBUG
-+              if (verdict < 0) {
-+                      BUGPRINT("bogus standard verdict\n");
-+                      read_unlock_bh(&table->lock);
-+                      return NF_DROP;
-+              }
-+#endif
-+              // jump to a udc
-+              cs[sp].n = i + 1;
-+              cs[sp].chaininfo = chaininfo;
-+              cs[sp].e = (struct ebt_entry *)
-+                 (((char *)point) + point->next_offset);
-+              i = 0;
-+              chaininfo = (struct ebt_entries *) (base + verdict);
-+#ifdef CONFIG_NETFILTER_DEBUG
-+              if (chaininfo->distinguisher) {
-+                      BUGPRINT("jump to non-chain\n");
-+                      read_unlock_bh(&table->lock);
-+                      return NF_DROP;
-+              }
-+#endif
-+              nentries = chaininfo->nentries;
-+              point = (struct ebt_entry *)chaininfo->data;
-+              counter_base = cb_base + chaininfo->counter_offset;
-+              sp++;
-+              continue;
-+letscontinue:
-+              point = (struct ebt_entry *)
-+                 (((char *)point) + point->next_offset);
-+              i++;
-+      }
-+
-+      // I actually like this :)
-+      if (chaininfo->policy == EBT_RETURN)
-+              goto letsreturn;
-+      if (chaininfo->policy == EBT_ACCEPT) {
-+              read_unlock_bh(&table->lock);
-+              return NF_ACCEPT;
-+      }
-+      read_unlock_bh(&table->lock);
-+      return NF_DROP;
-+}
-+
-+// If it succeeds, returns element and locks mutex
-+static inline void *
-+find_inlist_lock_noload(struct list_head *head, const char *name, int *error,
-+   struct semaphore *mutex)
-+{
-+      void *ret;
-+
-+      *error = down_interruptible(mutex);
-+      if (*error != 0)
-+              return NULL;
-+
-+      ret = list_named_find(head, name);
-+      if (!ret) {
-+              *error = -ENOENT;
-+              up(mutex);
-+      }
-+      return ret;
-+}
-+
-+#ifndef CONFIG_KMOD
-+#define find_inlist_lock(h,n,p,e,m) find_inlist_lock_noload((h),(n),(e),(m))
-+#else
-+static void *
-+find_inlist_lock(struct list_head *head, const char *name, const char *prefix,
-+   int *error, struct semaphore *mutex)
-+{
-+      void *ret;
-+
-+      ret = find_inlist_lock_noload(head, name, error, mutex);
-+      if (!ret) {
-+              char modulename[EBT_FUNCTION_MAXNAMELEN + strlen(prefix) + 1];
-+              strcpy(modulename, prefix);
-+              strcat(modulename, name);
-+              request_module(modulename);
-+              ret = find_inlist_lock_noload(head, name, error, mutex);
-+      }
-+      return ret;
-+}
-+#endif
-+
-+static inline struct ebt_table *
-+find_table_lock(const char *name, int *error, struct semaphore *mutex)
-+{
-+      return find_inlist_lock(&ebt_tables, name, "ebtable_", error, mutex);
-+}
-+
-+static inline struct ebt_match *
-+find_match_lock(const char *name, int *error, struct semaphore *mutex)
-+{
-+      return find_inlist_lock(&ebt_matches, name, "ebt_", error, mutex);
-+}
-+
-+static inline struct ebt_watcher *
-+find_watcher_lock(const char *name, int *error, struct semaphore *mutex)
-+{
-+      return find_inlist_lock(&ebt_watchers, name, "ebt_", error, mutex);
-+}
-+
-+static inline struct ebt_target *
-+find_target_lock(const char *name, int *error, struct semaphore *mutex)
-+{
-+      return find_inlist_lock(&ebt_targets, name, "ebt_", error, mutex);
-+}
-+
-+static inline int
-+ebt_check_match(struct ebt_entry_match *m, struct ebt_entry *e,
-+   const char *name, unsigned int hookmask, unsigned int *cnt)
-+{
-+      struct ebt_match *match;
-+      int ret;
-+
-+      if (((char *)m) + m->match_size + sizeof(struct ebt_entry_match) >
-+         ((char *)e) + e->watchers_offset)
-+              return -EINVAL;
-+      match = find_match_lock(m->u.name, &ret, &ebt_mutex);
-+      if (!match)
-+              return ret;
-+      m->u.match = match;
-+      if (match->me)
-+              __MOD_INC_USE_COUNT(match->me);
-+      up(&ebt_mutex);
-+      if (match->check &&
-+         match->check(name, hookmask, e, m->data, m->match_size) != 0) {
-+              BUGPRINT("match->check failed\n");
-+              if (match->me)
-+                      __MOD_DEC_USE_COUNT(match->me);
-+              return -EINVAL;
-+      }
-+      (*cnt)++;
-+      return 0;
-+}
-+
-+static inline int
-+ebt_check_watcher(struct ebt_entry_watcher *w, struct ebt_entry *e,
-+   const char *name, unsigned int hookmask, unsigned int *cnt)
-+{
-+      struct ebt_watcher *watcher;
-+      int ret;
-+
-+      if (((char *)w) + w->watcher_size + sizeof(struct ebt_entry_watcher) >
-+         ((char *)e) + e->target_offset)
-+              return -EINVAL;
-+      watcher = find_watcher_lock(w->u.name, &ret, &ebt_mutex);
-+      if (!watcher)
-+              return ret;
-+      w->u.watcher = watcher;
-+      if (watcher->me)
-+              __MOD_INC_USE_COUNT(watcher->me);
-+      up(&ebt_mutex);
-+      if (watcher->check &&
-+         watcher->check(name, hookmask, e, w->data, w->watcher_size) != 0) {
-+              BUGPRINT("watcher->check failed\n");
-+              if (watcher->me)
-+                      __MOD_DEC_USE_COUNT(watcher->me);
-+              return -EINVAL;
-+      }
-+      (*cnt)++;
-+      return 0;
-+}
-+
-+// this one is very careful, as it is the first function
-+// to parse the userspace data
-+static inline int
-+ebt_check_entry_size_and_hooks(struct ebt_entry *e,
-+   struct ebt_table_info *newinfo, char *base, char *limit,
-+   struct ebt_entries **hook_entries, unsigned int *n, unsigned int *cnt,
-+   unsigned int *totalcnt, unsigned int *udc_cnt, unsigned int valid_hooks)
-+{
-+      int i;
-+
-+      for (i = 0; i < NF_BR_NUMHOOKS; i++) {
-+              if ((valid_hooks & (1 << i)) == 0)
-+                      continue;
-+              if ( (char *)hook_entries[i] - base ==
-+                 (char *)e - newinfo->entries)
-+                      break;
-+      }
-+      // beginning of a new chain
-+      // if i == NF_BR_NUMHOOKS it must be a user defined chain
-+      if (i != NF_BR_NUMHOOKS || !(e->bitmask & EBT_ENTRY_OR_ENTRIES)) {
-+              if ((e->bitmask & EBT_ENTRY_OR_ENTRIES) != 0) {
-+                      // we make userspace set this right,
-+                      // so there is no misunderstanding
-+                      BUGPRINT("EBT_ENTRY_OR_ENTRIES shouldn't be set "
-+                               "in distinguisher\n");
-+                      return -EINVAL;
-+              }
-+              // this checks if the previous chain has as many entries
-+              // as it said it has
-+              if (*n != *cnt) {
-+                      BUGPRINT("nentries does not equal the nr of entries "
-+                               "in the chain\n");
-+                      return -EINVAL;
-+              }
-+              // before we look at the struct, be sure it is not too big
-+              if ((char *)hook_entries[i] + sizeof(struct ebt_entries)
-+                 > limit) {
-+                      BUGPRINT("entries_size too small\n");
-+                      return -EINVAL;
-+              }
-+              if (((struct ebt_entries *)e)->policy != EBT_DROP &&
-+                 ((struct ebt_entries *)e)->policy != EBT_ACCEPT) {
-+                      // only RETURN from udc
-+                      if (i != NF_BR_NUMHOOKS ||
-+                         ((struct ebt_entries *)e)->policy != EBT_RETURN) {
-+                              BUGPRINT("bad policy\n");
-+                              return -EINVAL;
-+                      }
-+              }
-+              if (i == NF_BR_NUMHOOKS) // it's a user defined chain
-+                      (*udc_cnt)++;
-+              else
-+                      newinfo->hook_entry[i] = (struct ebt_entries *)e;
-+              if (((struct ebt_entries *)e)->counter_offset != *totalcnt) {
-+                      BUGPRINT("counter_offset != totalcnt");
-+                      return -EINVAL;
-+              }
-+              *n = ((struct ebt_entries *)e)->nentries;
-+              *cnt = 0;
-+              return 0;
-+      }
-+      // a plain old entry, heh
-+      if (sizeof(struct ebt_entry) > e->watchers_offset ||
-+         e->watchers_offset > e->target_offset ||
-+         e->target_offset >= e->next_offset) {
-+              BUGPRINT("entry offsets not in right order\n");
-+              return -EINVAL;
-+      }
-+      // this is not checked anywhere else
-+      if (e->next_offset - e->target_offset < sizeof(struct ebt_entry_target)) {
-+              BUGPRINT("target size too small\n");
-+              return -EINVAL;
-+      }
-+
-+      (*cnt)++;
-+      (*totalcnt)++;
-+      return 0;
-+}
-+
-+struct ebt_cl_stack
-+{
-+      struct ebt_chainstack cs;
-+      int from;
-+      unsigned int hookmask;
-+};
-+
-+// we need these positions to check that the jumps to a different part of the
-+// entries is a jump to the beginning of a new chain.
-+static inline int
-+ebt_get_udc_positions(struct ebt_entry *e, struct ebt_table_info *newinfo,
-+   struct ebt_entries **hook_entries, unsigned int *n, unsigned int valid_hooks,
-+   struct ebt_cl_stack *udc)
-+{
-+      int i;
-+
-+      // we're only interested in chain starts
-+      if (e->bitmask & EBT_ENTRY_OR_ENTRIES)
-+              return 0;
-+      for (i = 0; i < NF_BR_NUMHOOKS; i++) {
-+              if ((valid_hooks & (1 << i)) == 0)
-+                      continue;
-+              if (newinfo->hook_entry[i] == (struct ebt_entries *)e)
-+                      break;
-+      }
-+      // only care about udc
-+      if (i != NF_BR_NUMHOOKS)
-+              return 0;
-+
-+      udc[*n].cs.chaininfo = (struct ebt_entries *)e;
-+      // these initialisations are depended on later in check_chainloops()
-+      udc[*n].cs.n = 0;
-+      udc[*n].hookmask = 0;
-+
-+      (*n)++;
-+      return 0;
-+}
-+
-+static inline int
-+ebt_cleanup_match(struct ebt_entry_match *m, unsigned int *i)
-+{
-+      if (i && (*i)-- == 0)
-+              return 1;
-+      if (m->u.match->destroy)
-+              m->u.match->destroy(m->data, m->match_size);
-+      if (m->u.match->me)
-+              __MOD_DEC_USE_COUNT(m->u.match->me);
-+
-+      return 0;
-+}
-+
-+static inline int
-+ebt_cleanup_watcher(struct ebt_entry_watcher *w, unsigned int *i)
-+{
-+      if (i && (*i)-- == 0)
-+              return 1;
-+      if (w->u.watcher->destroy)
-+              w->u.watcher->destroy(w->data, w->watcher_size);
-+      if (w->u.watcher->me)
-+              __MOD_DEC_USE_COUNT(w->u.watcher->me);
-+
-+      return 0;
-+}
-+
-+static inline int
-+ebt_cleanup_entry(struct ebt_entry *e, unsigned int *cnt)
-+{
-+      struct ebt_entry_target *t;
-+
-+      if ((e->bitmask & EBT_ENTRY_OR_ENTRIES) == 0)
-+              return 0;
-+      // we're done
-+      if (cnt && (*cnt)-- == 0)
-+              return 1;
-+      EBT_WATCHER_ITERATE(e, ebt_cleanup_watcher, NULL);
-+      EBT_MATCH_ITERATE(e, ebt_cleanup_match, NULL);
-+      t = (struct ebt_entry_target *)(((char *)e) + e->target_offset);
-+      if (t->u.target->destroy)
-+              t->u.target->destroy(t->data, t->target_size);
-+      if (t->u.target->me)
-+              __MOD_DEC_USE_COUNT(t->u.target->me);
-+
-+      return 0;
-+}
-+
-+static inline int
-+ebt_check_entry(struct ebt_entry *e, struct ebt_table_info *newinfo,
-+   const char *name, unsigned int *cnt, unsigned int valid_hooks,
-+   struct ebt_cl_stack *cl_s, unsigned int udc_cnt)
-+{
-+      struct ebt_entry_target *t;
-+      struct ebt_target *target;
-+      unsigned int i, j, hook = 0, hookmask = 0;
-+      int ret;
-+
-+      // Don't mess with the struct ebt_entries
-+      if ((e->bitmask & EBT_ENTRY_OR_ENTRIES) == 0)
-+              return 0;
-+
-+      if (e->bitmask & ~EBT_F_MASK) {
-+              BUGPRINT("Unknown flag for bitmask\n");
-+              return -EINVAL;
-+      }
-+      if (e->invflags & ~EBT_INV_MASK) {
-+              BUGPRINT("Unknown flag for inv bitmask\n");
-+              return -EINVAL;
-+      }
-+      if ( (e->bitmask & EBT_NOPROTO) && (e->bitmask & EBT_802_3) ) {
-+              BUGPRINT("NOPROTO & 802_3 not allowed\n");
-+              return -EINVAL;
-+      }
-+      // what hook do we belong to?
-+      for (i = 0; i < NF_BR_NUMHOOKS; i++) {
-+              if ((valid_hooks & (1 << i)) == 0)
-+                      continue;
-+              if ((char *)newinfo->hook_entry[i] < (char *)e)
-+                      hook = i;
-+              else
-+                      break;
-+      }
-+      // (1 << NF_BR_NUMHOOKS) tells the check functions the rule is on
-+      // a base chain
-+      if (i < NF_BR_NUMHOOKS)
-+              hookmask = (1 << hook) | (1 << NF_BR_NUMHOOKS);
-+      else {
-+              for (i = 0; i < udc_cnt; i++)
-+                      if ((char *)(cl_s[i].cs.chaininfo) > (char *)e)
-+                              break;
-+              if (i == 0)
-+                      hookmask = (1 << hook) | (1 << NF_BR_NUMHOOKS);
-+              else
-+                      hookmask = cl_s[i - 1].hookmask;
-+      }
-+      i = 0;
-+      ret = EBT_MATCH_ITERATE(e, ebt_check_match, e, name, hookmask, &i);
-+      if (ret != 0)
-+              goto cleanup_matches;
-+      j = 0;
-+      ret = EBT_WATCHER_ITERATE(e, ebt_check_watcher, e, name, hookmask, &j);
-+      if (ret != 0)
-+              goto cleanup_watchers;
-+      t = (struct ebt_entry_target *)(((char *)e) + e->target_offset);
-+      target = find_target_lock(t->u.name, &ret, &ebt_mutex);
-+      if (!target)
-+              goto cleanup_watchers;
-+      if (target->me)
-+              __MOD_INC_USE_COUNT(target->me);
-+      up(&ebt_mutex);
-+
-+      t->u.target = target;
-+      if (t->u.target == &ebt_standard_target) {
-+              if (e->target_offset + sizeof(struct ebt_standard_target) >
-+                 e->next_offset) {
-+                      BUGPRINT("Standard target size too big\n");
-+                      ret = -EFAULT;
-+                      goto cleanup_watchers;
-+              }
-+              if (((struct ebt_standard_target *)t)->verdict <
-+                 -NUM_STANDARD_TARGETS) {
-+                      BUGPRINT("Invalid standard target\n");
-+                      ret = -EFAULT;
-+                      goto cleanup_watchers;
-+              }
-+      } else if ((e->target_offset + t->target_size +
-+         sizeof(struct ebt_entry_target) > e->next_offset) ||
-+         (t->u.target->check &&
-+         t->u.target->check(name, hookmask, e, t->data, t->target_size) != 0)){
-+              if (t->u.target->me)
-+                      __MOD_DEC_USE_COUNT(t->u.target->me);
-+              ret = -EFAULT;
-+              goto cleanup_watchers;
-+      }
-+      (*cnt)++;
-+      return 0;
-+cleanup_watchers:
-+      EBT_WATCHER_ITERATE(e, ebt_cleanup_watcher, &j);
-+cleanup_matches:
-+      EBT_MATCH_ITERATE(e, ebt_cleanup_match, &i);
-+      return ret;
-+}
-+
-+// checks for loops and sets the hook mask for udc
-+// the hook mask for udc tells us from which base chains the udc can be
-+// accessed. This mask is a parameter to the check() functions of the extensions
-+static int check_chainloops(struct ebt_entries *chain,
-+   struct ebt_cl_stack *cl_s, unsigned int udc_cnt, 
-+   unsigned int hooknr, char *base)
-+{
-+      int i, chain_nr = -1, pos = 0, nentries = chain->nentries, verdict;
-+      struct ebt_entry *e = (struct ebt_entry *)chain->data;
-+      struct ebt_entry_target *t;
-+
-+      while (pos < nentries || chain_nr != -1) {
-+              // end of udc, go back one 'recursion' step
-+              if (pos == nentries) {
-+                      // put back values of the time when this chain was called
-+                      e = cl_s[chain_nr].cs.e;
-+                      if (cl_s[chain_nr].from != -1)
-+                              nentries =
-+                              cl_s[cl_s[chain_nr].from].cs.chaininfo->nentries;
-+                      else
-+                              nentries = chain->nentries;
-+                      pos = cl_s[chain_nr].cs.n;
-+                      // make sure we won't see a loop that isn't one
-+                      cl_s[chain_nr].cs.n = 0;
-+                      chain_nr = cl_s[chain_nr].from;
-+                      if (pos == nentries)
-+                              continue;
-+              }
-+              t = (struct ebt_entry_target *)
-+                 (((char *)e) + e->target_offset);
-+              if (strcmp(t->u.name, EBT_STANDARD_TARGET))
-+                      goto letscontinue;
-+              if (e->target_offset + sizeof(struct ebt_standard_target) >
-+                 e->next_offset) {
-+                      BUGPRINT("Standard target size too big\n");
-+                      return -1;
-+              }
-+              verdict = ((struct ebt_standard_target *)t)->verdict;
-+              if (verdict >= 0) { // jump to another chain
-+                      struct ebt_entries *hlp2 =
-+                         (struct ebt_entries *)(base + verdict);
-+                      for (i = 0; i < udc_cnt; i++)
-+                              if (hlp2 == cl_s[i].cs.chaininfo)
-+                                      break;
-+                      // bad destination or loop
-+                      if (i == udc_cnt) {
-+                              BUGPRINT("bad destination\n");
-+                              return -1;
-+                      }
-+                      if (cl_s[i].cs.n) {
-+                              BUGPRINT("loop\n");
-+                              return -1;
-+                      }
-+                      // this can't be 0, so the above test is correct
-+                      cl_s[i].cs.n = pos + 1;
-+                      pos = 0;
-+                      cl_s[i].cs.e = ((void *)e + e->next_offset);
-+                      e = (struct ebt_entry *)(hlp2->data);
-+                      nentries = hlp2->nentries;
-+                      cl_s[i].from = chain_nr;
-+                      chain_nr = i;
-+                      // this udc is accessible from the base chain for hooknr
-+                      cl_s[i].hookmask |= (1 << hooknr);
-+                      continue;
-+              }
-+letscontinue:
-+              e = (void *)e + e->next_offset;
-+              pos++;
-+      }
-+      return 0;
-+}
-+
-+// do the parsing of the table/chains/entries/matches/watchers/targets, heh
-+static int translate_table(struct ebt_replace *repl,
-+   struct ebt_table_info *newinfo)
-+{
-+      unsigned int i, j, k, udc_cnt;
-+      int ret;
-+      struct ebt_cl_stack *cl_s = NULL; // used in the checking for chain loops
-+
-+      i = 0;
-+      while (i < NF_BR_NUMHOOKS && !(repl->valid_hooks & (1 << i)))
-+              i++;
-+      if (i == NF_BR_NUMHOOKS) {
-+              BUGPRINT("No valid hooks specified\n");
-+              return -EINVAL;
-+      }
-+      if (repl->hook_entry[i] != (struct ebt_entries *)repl->entries) {
-+              BUGPRINT("Chains don't start at beginning\n");
-+              return -EINVAL;
-+      }
-+      // make sure chains are ordered after each other in same order
-+      // as their corresponding hooks
-+      for (j = i + 1; j < NF_BR_NUMHOOKS; j++) {
-+              if (!(repl->valid_hooks & (1 << j)))
-+                      continue;
-+              if ( repl->hook_entry[j] <= repl->hook_entry[i] ) {
-+                      BUGPRINT("Hook order must be followed\n");
-+                      return -EINVAL;
-+              }
-+              i = j;
-+      }
-+
-+      for (i = 0; i < NF_BR_NUMHOOKS; i++)
-+              newinfo->hook_entry[i] = NULL;
-+
-+      newinfo->entries_size = repl->entries_size;
-+      newinfo->nentries = repl->nentries;
-+
-+      // do some early checkings and initialize some things
-+      i = 0; // holds the expected nr. of entries for the chain
-+      j = 0; // holds the up to now counted entries for the chain
-+      k = 0; // holds the total nr. of entries, should equal
-+             // newinfo->nentries afterwards
-+      udc_cnt = 0; // will hold the nr. of user defined chains (udc)
-+      ret = EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,
-+         ebt_check_entry_size_and_hooks, newinfo, repl->entries,
-+         repl->entries + repl->entries_size, repl->hook_entry, &i, &j, &k,
-+         &udc_cnt, repl->valid_hooks);
-+
-+      if (ret != 0)
-+              return ret;
-+
-+      if (i != j) {
-+              BUGPRINT("nentries does not equal the nr of entries in the "
-+                       "(last) chain\n");
-+              return -EINVAL;
-+      }
-+      if (k != newinfo->nentries) {
-+              BUGPRINT("Total nentries is wrong\n");
-+              return -EINVAL;
-+      }
-+
-+      // check if all valid hooks have a chain
-+      for (i = 0; i < NF_BR_NUMHOOKS; i++) {
-+              if (newinfo->hook_entry[i] == NULL &&
-+                 (repl->valid_hooks & (1 << i))) {
-+                      BUGPRINT("Valid hook without chain\n");
-+                      return -EINVAL;
-+              }
-+      }
-+
-+      // Get the location of the udc, put them in an array
-+      // While we're at it, allocate the chainstack
-+      if (udc_cnt) {
-+              // this will get free'd in do_replace()/ebt_register_table()
-+              // if an error occurs
-+              newinfo->chainstack = (struct ebt_chainstack **)
-+                 vmalloc(smp_num_cpus * sizeof(struct ebt_chainstack));
-+              if (!newinfo->chainstack)
-+                      return -ENOMEM;
-+              for (i = 0; i < smp_num_cpus; i++) {
-+                      newinfo->chainstack[i] =
-+                         vmalloc(udc_cnt * sizeof(struct ebt_chainstack));
-+                      if (!newinfo->chainstack[i]) {
-+                              while (i)
-+                                      vfree(newinfo->chainstack[--i]);
-+                              vfree(newinfo->chainstack);
-+                              newinfo->chainstack = NULL;
-+                              return -ENOMEM;
-+                      }
-+              }
-+
-+              cl_s = (struct ebt_cl_stack *)
-+                 vmalloc(udc_cnt * sizeof(struct ebt_cl_stack));
-+              if (!cl_s)
-+                      return -ENOMEM;
-+              i = 0; // the i'th udc
-+              EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,
-+                 ebt_get_udc_positions, newinfo, repl->hook_entry, &i,
-+                 repl->valid_hooks, cl_s);
-+              // sanity check
-+              if (i != udc_cnt) {
-+                      BUGPRINT("i != udc_cnt\n");
-+                      vfree(cl_s);
-+                      return -EFAULT;
-+              }
-+      }
-+
-+      // Check for loops
-+      for (i = 0; i < NF_BR_NUMHOOKS; i++)
-+              if (repl->valid_hooks & (1 << i))
-+                      if (check_chainloops(newinfo->hook_entry[i],
-+                         cl_s, udc_cnt, i, newinfo->entries)) {
-+                              if (cl_s)
-+                                      vfree(cl_s);
-+                              return -EINVAL;
-+                      }
-+
-+      // we now know the following (along with E=mc):
-+      // - the nr of entries in each chain is right
-+      // - the size of the allocated space is right
-+      // - all valid hooks have a corresponding chain
-+      // - there are no loops
-+      // - wrong data can still be on the level of a single entry
-+      // - could be there are jumps to places that are not the
-+      //   beginning of a chain. This can only occur in chains that
-+      //   are not accessible from any base chains, so we don't care.
-+
-+      // used to know what we need to clean up if something goes wrong
-+      i = 0;
-+      ret = EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,
-+         ebt_check_entry, newinfo, repl->name, &i, repl->valid_hooks,
-+         cl_s, udc_cnt);
-+      if (ret != 0) {
-+              EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,
-+                 ebt_cleanup_entry, &i);
-+      }
-+      if (cl_s)
-+              vfree(cl_s);
-+      return ret;
-+}
-+
-+// called under write_lock
-+static void get_counters(struct ebt_counter *oldcounters,
-+   struct ebt_counter *counters, unsigned int nentries)
-+{
-+      int i, cpu;
-+      struct ebt_counter *counter_base;
-+
-+      // counters of cpu 0
-+      memcpy(counters, oldcounters,
-+         sizeof(struct ebt_counter) * nentries);
-+      // add other counters to those of cpu 0
-+      for (cpu = 1; cpu < smp_num_cpus; cpu++) {
-+              counter_base = COUNTER_BASE(oldcounters, nentries, cpu);
-+              for (i = 0; i < nentries; i++) {
-+                      counters[i].pcnt += counter_base[i].pcnt;
-+                      counters[i].bcnt += counter_base[i].bcnt;
-+              }
-+      }
-+}
-+
-+// replace the table
-+static int do_replace(void *user, unsigned int len)
-+{
-+      int ret, i, countersize;
-+      struct ebt_table_info *newinfo;
-+      struct ebt_replace tmp;
-+      struct ebt_table *t;
-+      struct ebt_counter *counterstmp = NULL;
-+      // used to be able to unlock earlier
-+      struct ebt_table_info *table;
-+
-+      if (copy_from_user(&tmp, user, sizeof(tmp)) != 0)
-+              return -EFAULT;
-+
-+      if (len != sizeof(tmp) + tmp.entries_size) {
-+              BUGPRINT("Wrong len argument\n");
-+              return -EINVAL;
-+      }
-+
-+      if (tmp.entries_size == 0) {
-+              BUGPRINT("Entries_size never zero\n");
-+              return -EINVAL;
-+      }
-+      countersize = COUNTER_OFFSET(tmp.nentries) * smp_num_cpus;
-+      newinfo = (struct ebt_table_info *)
-+         vmalloc(sizeof(struct ebt_table_info) + countersize);
-+      if (!newinfo)
-+              return -ENOMEM;
-+
-+      if (countersize)
-+              memset(newinfo->counters, 0, countersize);
-+
-+      newinfo->entries = (char *)vmalloc(tmp.entries_size);
-+      if (!newinfo->entries) {
-+              ret = -ENOMEM;
-+              goto free_newinfo;
-+      }
-+      if (copy_from_user(
-+         newinfo->entries, tmp.entries, tmp.entries_size) != 0) {
-+              BUGPRINT("Couldn't copy entries from userspace\n");
-+              ret = -EFAULT;
-+              goto free_entries;
-+      }
-+
-+      // the user wants counters back
-+      // the check on the size is done later, when we have the lock
-+      if (tmp.num_counters) {
-+              counterstmp = (struct ebt_counter *)
-+                 vmalloc(tmp.num_counters * sizeof(struct ebt_counter));
-+              if (!counterstmp) {
-+                      ret = -ENOMEM;
-+                      goto free_entries;
-+              }
-+      }
-+      else
-+              counterstmp = NULL;
-+
-+      // this can get initialized by translate_table()
-+      newinfo->chainstack = NULL;
-+      ret = translate_table(&tmp, newinfo);
-+
-+      if (ret != 0)
-+              goto free_counterstmp;
-+
-+      t = find_table_lock(tmp.name, &ret, &ebt_mutex);
-+      if (!t)
-+              goto free_iterate;
-+
-+      // the table doesn't like it
-+      if (t->check && (ret = t->check(newinfo, tmp.valid_hooks)))
-+              goto free_unlock;
-+
-+      if (tmp.num_counters && tmp.num_counters != t->private->nentries) {
-+              BUGPRINT("Wrong nr. of counters requested\n");
-+              ret = -EINVAL;
-+              goto free_unlock;
-+      }
-+
-+      // we have the mutex lock, so no danger in reading this pointer
-+      table = t->private;
-+      // we need an atomic snapshot of the counters
-+      write_lock_bh(&t->lock);
-+      if (tmp.num_counters)
-+              get_counters(t->private->counters, counterstmp,
-+                 t->private->nentries);
-+
-+      t->private = newinfo;
-+      write_unlock_bh(&t->lock);
-+      up(&ebt_mutex);
-+      // So, a user can change the chains while having messed up her counter
-+      // allocation. Only reason why this is done is because this way the lock
-+      // is held only once, while this doesn't bring the kernel into a
-+      // dangerous state.
-+      if (tmp.num_counters &&
-+         copy_to_user(tmp.counters, counterstmp,
-+         tmp.num_counters * sizeof(struct ebt_counter))) {
-+              BUGPRINT("Couldn't copy counters to userspace\n");
-+              ret = -EFAULT;
-+      }
-+      else
-+              ret = 0;
-+
-+      // decrease module count and free resources
-+      EBT_ENTRY_ITERATE(table->entries, table->entries_size,
-+         ebt_cleanup_entry, NULL);
-+
-+      vfree(table->entries);
-+      if (table->chainstack) {
-+              for (i = 0; i < smp_num_cpus; i++)
-+                      vfree(table->chainstack[i]);
-+              vfree(table->chainstack);
-+      }
-+      vfree(table);
-+
-+      if (counterstmp)
-+              vfree(counterstmp);
-+      return ret;
-+
-+free_unlock:
-+      up(&ebt_mutex);
-+free_iterate:
-+      EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,
-+         ebt_cleanup_entry, NULL);
-+free_counterstmp:
-+      if (counterstmp)
-+              vfree(counterstmp);
-+      // can be initialized in translate_table()
-+      if (newinfo->chainstack) {
-+              for (i = 0; i < smp_num_cpus; i++)
-+                      vfree(newinfo->chainstack[i]);
-+              vfree(newinfo->chainstack);
-+      }
-+free_entries:
-+      if (newinfo->entries)
-+              vfree(newinfo->entries);
-+free_newinfo:
-+      if (newinfo)
-+              vfree(newinfo);
-+      return ret;
-+}
-+
-+int ebt_register_target(struct ebt_target *target)
-+{
-+      int ret;
-+
-+      ret = down_interruptible(&ebt_mutex);
-+      if (ret != 0)
-+              return ret;
-+      if (!list_named_insert(&ebt_targets, target)) {
-+              up(&ebt_mutex);
-+              return -EEXIST;
-+      }
-+      up(&ebt_mutex);
-+      MOD_INC_USE_COUNT;
-+
-+      return 0;
-+}
-+
-+void ebt_unregister_target(struct ebt_target *target)
-+{
-+      down(&ebt_mutex);
-+      LIST_DELETE(&ebt_targets, target);
-+      up(&ebt_mutex);
-+      MOD_DEC_USE_COUNT;
-+}
-+
-+int ebt_register_match(struct ebt_match *match)
-+{
-+      int ret;
-+
-+      ret = down_interruptible(&ebt_mutex);
-+      if (ret != 0)
-+              return ret;
-+      if (!list_named_insert(&ebt_matches, match)) {
-+              up(&ebt_mutex);
-+              return -EEXIST;
-+      }
-+      up(&ebt_mutex);
-+      MOD_INC_USE_COUNT;
-+
-+      return 0;
-+}
-+
-+void ebt_unregister_match(struct ebt_match *match)
-+{
-+      down(&ebt_mutex);
-+      LIST_DELETE(&ebt_matches, match);
-+      up(&ebt_mutex);
-+      MOD_DEC_USE_COUNT;
-+}
-+
-+int ebt_register_watcher(struct ebt_watcher *watcher)
-+{
-+      int ret;
-+
-+      ret = down_interruptible(&ebt_mutex);
-+      if (ret != 0)
-+              return ret;
-+      if (!list_named_insert(&ebt_watchers, watcher)) {
-+              up(&ebt_mutex);
-+              return -EEXIST;
-+      }
-+      up(&ebt_mutex);
-+      MOD_INC_USE_COUNT;
-+
-+      return 0;
-+}
-+
-+void ebt_unregister_watcher(struct ebt_watcher *watcher)
-+{
-+      down(&ebt_mutex);
-+      LIST_DELETE(&ebt_watchers, watcher);
-+      up(&ebt_mutex);
-+      MOD_DEC_USE_COUNT;
-+}
-+
-+int ebt_register_table(struct ebt_table *table)
-+{
-+      struct ebt_table_info *newinfo;
-+      int ret, i, countersize;
-+
-+      if (!table || !table->table ||!table->table->entries ||
-+          table->table->entries_size == 0 ||
-+          table->table->counters || table->private) {
-+              BUGPRINT("Bad table data for ebt_register_table!!!\n");
-+              return -EINVAL;
-+      }
-+
-+      countersize = COUNTER_OFFSET(table->table->nentries) * smp_num_cpus;
-+      newinfo = (struct ebt_table_info *)
-+         vmalloc(sizeof(struct ebt_table_info) + countersize);
-+      ret = -ENOMEM;
-+      if (!newinfo)
-+              return -ENOMEM;
-+
-+      newinfo->entries = (char *)vmalloc(table->table->entries_size);
-+      if (!(newinfo->entries))
-+              goto free_newinfo;
-+
-+      memcpy(newinfo->entries, table->table->entries,
-+         table->table->entries_size);
-+
-+      if (countersize)
-+              memset(newinfo->counters, 0, countersize);
-+
-+      // fill in newinfo and parse the entries
-+      newinfo->chainstack = NULL;
-+      ret = translate_table(table->table, newinfo);
-+      if (ret != 0) {
-+              BUGPRINT("Translate_table failed\n");
-+              goto free_chainstack;
-+      }
-+
-+      if (table->check && table->check(newinfo, table->valid_hooks)) {
-+              BUGPRINT("The table doesn't like its own initial data, lol\n");
-+              return -EINVAL;
-+      }
-+
-+      table->private = newinfo;
-+      table->lock = RW_LOCK_UNLOCKED;
-+      ret = down_interruptible(&ebt_mutex);
-+      if (ret != 0)
-+              goto free_chainstack;
-+
-+      if (list_named_find(&ebt_tables, table->name)) {
-+              ret = -EEXIST;
-+              BUGPRINT("Table name already exists\n");
-+              goto free_unlock;
-+      }
-+
-+      list_prepend(&ebt_tables, table);
-+      up(&ebt_mutex);
-+      MOD_INC_USE_COUNT;
-+      return 0;
-+free_unlock:
-+      up(&ebt_mutex);
-+free_chainstack:
-+      if (newinfo->chainstack) {
-+              for (i = 0; i < smp_num_cpus; i++)
-+                      vfree(newinfo->chainstack[i]);
-+              vfree(newinfo->chainstack);
-+      }
-+      vfree(newinfo->entries);
-+free_newinfo:
-+      vfree(newinfo);
-+      return ret;
-+}
-+
-+void ebt_unregister_table(struct ebt_table *table)
-+{
-+      int i;
-+
-+      if (!table) {
-+              BUGPRINT("Request to unregister NULL table!!!\n");
-+              return;
-+      }
-+      down(&ebt_mutex);
-+      LIST_DELETE(&ebt_tables, table);
-+      up(&ebt_mutex);
-+      EBT_ENTRY_ITERATE(table->private->entries,
-+         table->private->entries_size, ebt_cleanup_entry, NULL);
-+      if (table->private->entries)
-+              vfree(table->private->entries);
-+      if (table->private->chainstack) {
-+              for (i = 0; i < smp_num_cpus; i++)
-+                      vfree(table->private->chainstack[i]);
-+              vfree(table->private->chainstack);
-+      }
-+      vfree(table->private);
-+      MOD_DEC_USE_COUNT;
-+}
-+
-+// userspace just supplied us with counters
-+static int update_counters(void *user, unsigned int len)
-+{
-+      int i, ret;
-+      struct ebt_counter *tmp;
-+      struct ebt_replace hlp;
-+      struct ebt_table *t;
-+
-+      if (copy_from_user(&hlp, user, sizeof(hlp)))
-+              return -EFAULT;
-+
-+      if (len != sizeof(hlp) + hlp.num_counters * sizeof(struct ebt_counter))
-+              return -EINVAL;
-+      if (hlp.num_counters == 0)
-+              return -EINVAL;
-+
-+      if ( !(tmp = (struct ebt_counter *)
-+         vmalloc(hlp.num_counters * sizeof(struct ebt_counter))) ){
-+              MEMPRINT("Update_counters && nomemory\n");
-+              return -ENOMEM;
-+      }
-+
-+      t = find_table_lock(hlp.name, &ret, &ebt_mutex);
-+      if (!t)
-+              goto free_tmp;
-+
-+      if (hlp.num_counters != t->private->nentries) {
-+              BUGPRINT("Wrong nr of counters\n");
-+              ret = -EINVAL;
-+              goto unlock_mutex;
-+      }
-+
-+      if ( copy_from_user(tmp, hlp.counters,
-+         hlp.num_counters * sizeof(struct ebt_counter)) ) {
-+              BUGPRINT("Updata_counters && !cfu\n");
-+              ret = -EFAULT;
-+              goto unlock_mutex;
-+      }
-+
-+      // we want an atomic add of the counters
-+      write_lock_bh(&t->lock);
-+
-+      // we add to the counters of the first cpu
-+      for (i = 0; i < hlp.num_counters; i++) {
-+              t->private->counters[i].pcnt += tmp[i].pcnt;
-+              t->private->counters[i].bcnt += tmp[i].bcnt;
-+      }
-+
-+      write_unlock_bh(&t->lock);
-+      ret = 0;
-+unlock_mutex:
-+      up(&ebt_mutex);
-+free_tmp:
-+      vfree(tmp);
-+      return ret;
-+}
-+
-+static inline int ebt_make_matchname(struct ebt_entry_match *m,
-+   char *base, char *ubase)
-+{
-+      char *hlp = ubase - base + (char *)m;
-+      if (copy_to_user(hlp, m->u.match->name, EBT_FUNCTION_MAXNAMELEN))
-+              return -EFAULT;
-+      return 0;
-+}
-+
-+static inline int ebt_make_watchername(struct ebt_entry_watcher *w,
-+   char *base, char *ubase)
-+{
-+      char *hlp = ubase - base + (char *)w;
-+      if (copy_to_user(hlp , w->u.watcher->name, EBT_FUNCTION_MAXNAMELEN))
-+              return -EFAULT;
-+      return 0;
-+}
-+
-+static inline int ebt_make_names(struct ebt_entry *e, char *base, char *ubase)
-+{
-+      int ret;
-+      char *hlp;
-+      struct ebt_entry_target *t;
-+
-+      if ((e->bitmask & EBT_ENTRY_OR_ENTRIES) == 0)
-+              return 0;
-+
-+      hlp = ubase - base + (char *)e + e->target_offset;
-+      t = (struct ebt_entry_target *)(((char *)e) + e->target_offset);
-+      
-+      ret = EBT_MATCH_ITERATE(e, ebt_make_matchname, base, ubase);
-+      if (ret != 0)
-+              return ret;
-+      ret = EBT_WATCHER_ITERATE(e, ebt_make_watchername, base, ubase);
-+      if (ret != 0)
-+              return ret;
-+      if (copy_to_user(hlp, t->u.target->name, EBT_FUNCTION_MAXNAMELEN))
-+              return -EFAULT;
-+      return 0;
-+}
-+
-+// called with ebt_mutex down
-+static int copy_everything_to_user(struct ebt_table *t, void *user,
-+   int *len, int cmd)
-+{
-+      struct ebt_replace tmp;
-+      struct ebt_counter *counterstmp, *oldcounters;
-+      unsigned int entries_size, nentries;
-+      char *entries;
-+
-+      if (cmd == EBT_SO_GET_ENTRIES) {
-+              entries_size = t->private->entries_size;
-+              nentries = t->private->nentries;
-+              entries = t->private->entries;
-+              oldcounters = t->private->counters;
-+      } else {
-+              entries_size = t->table->entries_size;
-+              nentries = t->table->nentries;
-+              entries = t->table->entries;
-+              oldcounters = t->table->counters;
-+      }
-+
-+      if (copy_from_user(&tmp, user, sizeof(tmp))) {
-+              BUGPRINT("Cfu didn't work\n");
-+              return -EFAULT;
-+      }
-+
-+      if (*len != sizeof(struct ebt_replace) + entries_size +
-+         (tmp.num_counters? nentries * sizeof(struct ebt_counter): 0)) {
-+              BUGPRINT("Wrong size\n");
-+              return -EINVAL;
-+      }
-+
-+      if (tmp.nentries != nentries) {
-+              BUGPRINT("Nentries wrong\n");
-+              return -EINVAL;
-+      }
-+
-+      if (tmp.entries_size != entries_size) {
-+              BUGPRINT("Wrong size\n");
-+              return -EINVAL;
-+      }
-+
-+      // userspace might not need the counters
-+      if (tmp.num_counters) {
-+              if (tmp.num_counters != nentries) {
-+                      BUGPRINT("Num_counters wrong\n");
-+                      return -EINVAL;
-+              }
-+              counterstmp = (struct ebt_counter *)
-+                 vmalloc(nentries * sizeof(struct ebt_counter));
-+              if (!counterstmp) {
-+                      MEMPRINT("Couldn't copy counters, out of memory\n");
-+                      return -ENOMEM;
-+              }
-+              write_lock_bh(&t->lock);
-+              get_counters(oldcounters, counterstmp, nentries);
-+              write_unlock_bh(&t->lock);
-+
-+              if (copy_to_user(tmp.counters, counterstmp,
-+                 nentries * sizeof(struct ebt_counter))) {
-+                      BUGPRINT("Couldn't copy counters to userspace\n");
-+                      vfree(counterstmp);
-+                      return -EFAULT;
-+              }
-+              vfree(counterstmp);
-+      }
-+
-+      if (copy_to_user(tmp.entries, entries, entries_size)) {
-+              BUGPRINT("Couldn't copy entries to userspace\n");
-+              return -EFAULT;
-+      }
-+      // set the match/watcher/target names right
-+      return EBT_ENTRY_ITERATE(entries, entries_size,
-+         ebt_make_names, entries, tmp.entries);
-+}
-+
-+static int do_ebt_set_ctl(struct sock *sk,
-+      int cmd, void *user, unsigned int len)
-+{
-+      int ret;
-+
-+      switch(cmd) {
-+      case EBT_SO_SET_ENTRIES:
-+              ret = do_replace(user, len);
-+              break;
-+      case EBT_SO_SET_COUNTERS:
-+              ret = update_counters(user, len);
-+              break;
-+      default:
-+              ret = -EINVAL;
-+  }
-+      return ret;
-+}
-+
-+static int do_ebt_get_ctl(struct sock *sk, int cmd, void *user, int *len)
-+{
-+      int ret;
-+      struct ebt_replace tmp;
-+      struct ebt_table *t;
-+
-+      if (copy_from_user(&tmp, user, sizeof(tmp)))
-+              return -EFAULT;
-+
-+      t = find_table_lock(tmp.name, &ret, &ebt_mutex);
-+      if (!t)
-+              return ret;
-+
-+      switch(cmd) {
-+      case EBT_SO_GET_INFO:
-+      case EBT_SO_GET_INIT_INFO:
-+              if (*len != sizeof(struct ebt_replace)){
-+                      ret = -EINVAL;
-+                      up(&ebt_mutex);
-+                      break;
-+              }
-+              if (cmd == EBT_SO_GET_INFO) {
-+                      tmp.nentries = t->private->nentries;
-+                      tmp.entries_size = t->private->entries_size;
-+                      tmp.valid_hooks = t->valid_hooks;
-+              } else {
-+                      tmp.nentries = t->table->nentries;
-+                      tmp.entries_size = t->table->entries_size;
-+                      tmp.valid_hooks = t->table->valid_hooks;
-+              }
-+              up(&ebt_mutex);
-+              if (copy_to_user(user, &tmp, *len) != 0){
-+                      BUGPRINT("c2u Didn't work\n");
-+                      ret = -EFAULT;
-+                      break;
-+              }
-+              ret = 0;
-+              break;
-+
-+      case EBT_SO_GET_ENTRIES:
-+      case EBT_SO_GET_INIT_ENTRIES:
-+              ret = copy_everything_to_user(t, user, len, cmd);
-+              up(&ebt_mutex);
-+              break;
-+
-+      default:
-+              up(&ebt_mutex);
-+              ret = -EINVAL;
-+      }
-+
-+      return ret;
-+}
-+
-+static struct nf_sockopt_ops ebt_sockopts =
-+{ { NULL, NULL }, PF_INET, EBT_BASE_CTL, EBT_SO_SET_MAX + 1, do_ebt_set_ctl,
-+    EBT_BASE_CTL, EBT_SO_GET_MAX + 1, do_ebt_get_ctl, 0, NULL
-+};
-+
-+static int __init init(void)
-+{
-+      int ret;
-+
-+      down(&ebt_mutex);
-+      list_named_insert(&ebt_targets, &ebt_standard_target);
-+      up(&ebt_mutex);
-+      if ((ret = nf_register_sockopt(&ebt_sockopts)) < 0)
-+              return ret;
-+
-+      printk(KERN_NOTICE "Ebtables v2.0 registered\n");
-+      return 0;
-+}
-+
-+static void __exit fini(void)
-+{
-+      nf_unregister_sockopt(&ebt_sockopts);
-+      printk(KERN_NOTICE "Ebtables v2.0 unregistered\n");
-+}
-+
-+EXPORT_SYMBOL(ebt_register_table);
-+EXPORT_SYMBOL(ebt_unregister_table);
-+EXPORT_SYMBOL(ebt_register_match);
-+EXPORT_SYMBOL(ebt_unregister_match);
-+EXPORT_SYMBOL(ebt_register_watcher);
-+EXPORT_SYMBOL(ebt_unregister_watcher);
-+EXPORT_SYMBOL(ebt_register_target);
-+EXPORT_SYMBOL(ebt_unregister_target);
-+EXPORT_SYMBOL(ebt_do_table);
-+module_init(init);
-+module_exit(fini);
-+MODULE_LICENSE("GPL");
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter_bridge/ebtables.h    2005-03-14 21:24:12.000000000 +0100
-@@ -0,0 +1,361 @@
-+/*
-+ *  ebtables
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer                <bart.de.schuymer@pandora.be>
-+ *
-+ *  ebtables.c,v 2.0, September, 2002
-+ *
-+ *  This code is stongly inspired on the iptables code which is
-+ *  Copyright (C) 1999 Paul `Rusty' Russell & Michael J. Neuling
-+ */
-+
-+#ifndef __LINUX_BRIDGE_EFF_H
-+#define __LINUX_BRIDGE_EFF_H
-+#include <linux/if.h>
-+#include <linux/netfilter_bridge.h>
-+#include <linux/if_ether.h>
-+
-+#define EBT_TABLE_MAXNAMELEN 32
-+#define EBT_CHAIN_MAXNAMELEN EBT_TABLE_MAXNAMELEN
-+#define EBT_FUNCTION_MAXNAMELEN EBT_TABLE_MAXNAMELEN
-+
-+// verdicts >0 are "branches"
-+#define EBT_ACCEPT   -1
-+#define EBT_DROP     -2
-+#define EBT_CONTINUE -3
-+#define EBT_RETURN   -4
-+#define NUM_STANDARD_TARGETS   4
-+
-+struct ebt_counter
-+{
-+      uint64_t pcnt;
-+      uint64_t bcnt;
-+};
-+
-+struct ebt_entries {
-+      // this field is always set to zero
-+      // See EBT_ENTRY_OR_ENTRIES.
-+      // Must be same size as ebt_entry.bitmask
-+      unsigned int distinguisher;
-+      // the chain name
-+      char name[EBT_CHAIN_MAXNAMELEN];
-+      // counter offset for this chain
-+      unsigned int counter_offset;
-+      // one standard (accept, drop, return) per hook
-+      int policy;
-+      // nr. of entries
-+      unsigned int nentries;
-+      // entry list
-+      char data[0];
-+};
-+
-+// used for the bitmask of struct ebt_entry
-+
-+// This is a hack to make a difference between an ebt_entry struct and an
-+// ebt_entries struct when traversing the entries from start to end.
-+// Using this simplifies the code alot, while still being able to use
-+// ebt_entries.
-+// Contrary, iptables doesn't use something like ebt_entries and therefore uses
-+// different techniques for naming the policy and such. So, iptables doesn't
-+// need a hack like this.
-+#define EBT_ENTRY_OR_ENTRIES 0x01
-+// these are the normal masks
-+#define EBT_NOPROTO 0x02
-+#define EBT_802_3 0x04
-+#define EBT_SOURCEMAC 0x08
-+#define EBT_DESTMAC 0x10
-+#define EBT_F_MASK (EBT_NOPROTO | EBT_802_3 | EBT_SOURCEMAC | EBT_DESTMAC \
-+   | EBT_ENTRY_OR_ENTRIES)
-+
-+#define EBT_IPROTO 0x01
-+#define EBT_IIN 0x02
-+#define EBT_IOUT 0x04
-+#define EBT_ISOURCE 0x8
-+#define EBT_IDEST 0x10
-+#define EBT_ILOGICALIN 0x20
-+#define EBT_ILOGICALOUT 0x40
-+#define EBT_INV_MASK (EBT_IPROTO | EBT_IIN | EBT_IOUT | EBT_ILOGICALIN \
-+   | EBT_ILOGICALOUT | EBT_ISOURCE | EBT_IDEST)
-+
-+struct ebt_entry_match
-+{
-+      union {
-+              char name[EBT_FUNCTION_MAXNAMELEN];
-+              struct ebt_match *match;
-+      } u;
-+      // size of data
-+      unsigned int match_size;
-+      unsigned char data[0];
-+};
-+
-+struct ebt_entry_watcher
-+{
-+      union {
-+              char name[EBT_FUNCTION_MAXNAMELEN];
-+              struct ebt_watcher *watcher;
-+      } u;
-+      // size of data
-+      unsigned int watcher_size;
-+      unsigned char data[0];
-+};
-+
-+struct ebt_entry_target
-+{
-+      union {
-+              char name[EBT_FUNCTION_MAXNAMELEN];
-+              struct ebt_target *target;
-+      } u;
-+      // size of data
-+      unsigned int target_size;
-+      unsigned char data[0];
-+};
-+
-+#define EBT_STANDARD_TARGET "standard"
-+struct ebt_standard_target
-+{
-+      struct ebt_entry_target target;
-+      int verdict;
-+};
-+
-+// one entry
-+struct ebt_entry {
-+      // this needs to be the first field
-+      unsigned int bitmask;
-+      unsigned int invflags;
-+      uint16_t ethproto;
-+      // the physical in-dev
-+      char in[IFNAMSIZ];
-+      // the logical in-dev
-+      char logical_in[IFNAMSIZ];
-+      // the physical out-dev
-+      char out[IFNAMSIZ];
-+      // the logical out-dev
-+      char logical_out[IFNAMSIZ];
-+      unsigned char sourcemac[ETH_ALEN];
-+      unsigned char sourcemsk[ETH_ALEN];
-+      unsigned char destmac[ETH_ALEN];
-+      unsigned char destmsk[ETH_ALEN];
-+      // sizeof ebt_entry + matches
-+      unsigned int watchers_offset;
-+      // sizeof ebt_entry + matches + watchers
-+      unsigned int target_offset;
-+      // sizeof ebt_entry + matches + watchers + target
-+      unsigned int next_offset;
-+      unsigned char elems[0];
-+};
-+
-+struct ebt_replace
-+{
-+      char name[EBT_TABLE_MAXNAMELEN];
-+      unsigned int valid_hooks;
-+      // nr of rules in the table
-+      unsigned int nentries;
-+      // total size of the entries
-+      unsigned int entries_size;
-+      // start of the chains
-+      struct ebt_entries *hook_entry[NF_BR_NUMHOOKS];
-+      // nr of counters userspace expects back
-+      unsigned int num_counters;
-+      // where the kernel will put the old counters
-+      struct ebt_counter *counters;
-+      char *entries;
-+};
-+
-+// [gs]etsockopt numbers
-+#define EBT_BASE_CTL            128
-+
-+#define EBT_SO_SET_ENTRIES      (EBT_BASE_CTL)
-+#define EBT_SO_SET_COUNTERS     (EBT_SO_SET_ENTRIES+1)
-+#define EBT_SO_SET_MAX          (EBT_SO_SET_COUNTERS+1)
-+
-+#define EBT_SO_GET_INFO         (EBT_BASE_CTL)
-+#define EBT_SO_GET_ENTRIES      (EBT_SO_GET_INFO+1)
-+#define EBT_SO_GET_INIT_INFO    (EBT_SO_GET_ENTRIES+1)
-+#define EBT_SO_GET_INIT_ENTRIES (EBT_SO_GET_INIT_INFO+1)
-+#define EBT_SO_GET_MAX          (EBT_SO_GET_INIT_ENTRIES+1)
-+
-+#ifdef __KERNEL__
-+
-+// return values for match() functions
-+#define EBT_MATCH 0
-+#define EBT_NOMATCH 1
-+
-+struct ebt_match
-+{
-+      struct list_head list;
-+      const char name[EBT_FUNCTION_MAXNAMELEN];
-+      // 0 == it matches
-+      int (*match)(const struct sk_buff *skb, const struct net_device *in,
-+         const struct net_device *out, const void *matchdata,
-+         unsigned int datalen);
-+      // 0 == let it in
-+      int (*check)(const char *tablename, unsigned int hookmask,
-+         const struct ebt_entry *e, void *matchdata, unsigned int datalen);
-+      void (*destroy)(void *matchdata, unsigned int datalen);
-+      struct module *me;
-+};
-+
-+struct ebt_watcher
-+{
-+      struct list_head list;
-+      const char name[EBT_FUNCTION_MAXNAMELEN];
-+      void (*watcher)(const struct sk_buff *skb, unsigned int hooknr,
-+         const struct net_device *in, const struct net_device *out,
-+         const void *watcherdata, unsigned int datalen);
-+      // 0 == let it in
-+      int (*check)(const char *tablename, unsigned int hookmask,
-+         const struct ebt_entry *e, void *watcherdata, unsigned int datalen);
-+      void (*destroy)(void *watcherdata, unsigned int datalen);
-+      struct module *me;
-+};
-+
-+struct ebt_target
-+{
-+      struct list_head list;
-+      const char name[EBT_FUNCTION_MAXNAMELEN];
-+      // returns one of the standard verdicts
-+      int (*target)(struct sk_buff **pskb, unsigned int hooknr,
-+         const struct net_device *in, const struct net_device *out,
-+         const void *targetdata, unsigned int datalen);
-+      // 0 == let it in
-+      int (*check)(const char *tablename, unsigned int hookmask,
-+         const struct ebt_entry *e, void *targetdata, unsigned int datalen);
-+      void (*destroy)(void *targetdata, unsigned int datalen);
-+      struct module *me;
-+};
-+
-+// used for jumping from and into user defined chains (udc)
-+struct ebt_chainstack
-+{
-+      struct ebt_entries *chaininfo; // pointer to chain data
-+      struct ebt_entry *e; // pointer to entry data
-+      unsigned int n; // n'th entry
-+};
-+
-+struct ebt_table_info
-+{
-+      // total size of the entries
-+      unsigned int entries_size;
-+      unsigned int nentries;
-+      // pointers to the start of the chains
-+      struct ebt_entries *hook_entry[NF_BR_NUMHOOKS];
-+      // room to maintain the stack used for jumping from and into udc
-+      struct ebt_chainstack **chainstack;
-+      char *entries;
-+      struct ebt_counter counters[0] ____cacheline_aligned;
-+};
-+
-+struct ebt_table
-+{
-+      struct list_head list;
-+      char name[EBT_TABLE_MAXNAMELEN];
-+      struct ebt_replace *table;
-+      unsigned int valid_hooks;
-+      rwlock_t lock;
-+      // e.g. could be the table explicitly only allows certain
-+      // matches, targets, ... 0 == let it in
-+      int (*check)(const struct ebt_table_info *info,
-+         unsigned int valid_hooks);
-+      // the data used by the kernel
-+      struct ebt_table_info *private;
-+};
-+
-+#define EBT_ALIGN(s) (((s) + (__alignof__(struct ebt_entry_target)-1)) & \
-+                   ~(__alignof__(struct ebt_entry_target)-1))
-+extern int ebt_register_table(struct ebt_table *table);
-+extern void ebt_unregister_table(struct ebt_table *table);
-+extern int ebt_register_match(struct ebt_match *match);
-+extern void ebt_unregister_match(struct ebt_match *match);
-+extern int ebt_register_watcher(struct ebt_watcher *watcher);
-+extern void ebt_unregister_watcher(struct ebt_watcher *watcher);
-+extern int ebt_register_target(struct ebt_target *target);
-+extern void ebt_unregister_target(struct ebt_target *target);
-+extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   struct ebt_table *table);
-+
-+   // Used in the kernel match() functions
-+#define FWINV(bool,invflg) ((bool) ^ !!(info->invflags & invflg))
-+// True if the hook mask denotes that the rule is in a base chain,
-+// used in the check() functions
-+#define BASE_CHAIN (hookmask & (1 << NF_BR_NUMHOOKS))
-+// Clear the bit in the hook mask that tells if the rule is on a base chain
-+#define CLEAR_BASE_CHAIN_BIT (hookmask &= ~(1 << NF_BR_NUMHOOKS))
-+// True if the target is not a standard target
-+#define INVALID_TARGET (info->target < -NUM_STANDARD_TARGETS || info->target >= 0)
-+
-+#endif /* __KERNEL__ */
-+
-+// blatently stolen from ip_tables.h
-+// fn returns 0 to continue iteration
-+#define EBT_MATCH_ITERATE(e, fn, args...)                   \
-+({                                                          \
-+      unsigned int __i;                                   \
-+      int __ret = 0;                                      \
-+      struct ebt_entry_match *__match;                    \
-+                                                          \
-+      for (__i = sizeof(struct ebt_entry);                \
-+           __i < (e)->watchers_offset;                    \
-+           __i += __match->match_size +                   \
-+           sizeof(struct ebt_entry_match)) {              \
-+              __match = (void *)(e) + __i;                \
-+                                                          \
-+              __ret = fn(__match , ## args);              \
-+              if (__ret != 0)                             \
-+                      break;                              \
-+      }                                                   \
-+      if (__ret == 0) {                                   \
-+              if (__i != (e)->watchers_offset)            \
-+                      __ret = -EINVAL;                    \
-+      }                                                   \
-+      __ret;                                              \
-+})
-+
-+#define EBT_WATCHER_ITERATE(e, fn, args...)                 \
-+({                                                          \
-+      unsigned int __i;                                   \
-+      int __ret = 0;                                      \
-+      struct ebt_entry_watcher *__watcher;                \
-+                                                          \
-+      for (__i = e->watchers_offset;                      \
-+           __i < (e)->target_offset;                      \
-+           __i += __watcher->watcher_size +               \
-+           sizeof(struct ebt_entry_watcher)) {            \
-+              __watcher = (void *)(e) + __i;              \
-+                                                          \
-+              __ret = fn(__watcher , ## args);            \
-+              if (__ret != 0)                             \
-+                      break;                              \
-+      }                                                   \
-+      if (__ret == 0) {                                   \
-+              if (__i != (e)->target_offset)              \
-+                      __ret = -EINVAL;                    \
-+      }                                                   \
-+      __ret;                                              \
-+})
-+
-+#define EBT_ENTRY_ITERATE(entries, size, fn, args...)       \
-+({                                                          \
-+      unsigned int __i;                                   \
-+      int __ret = 0;                                      \
-+      struct ebt_entry *__entry;                          \
-+                                                          \
-+      for (__i = 0; __i < (size);) {                      \
-+              __entry = (void *)(entries) + __i;          \
-+              __ret = fn(__entry , ## args);              \
-+              if (__ret != 0)                             \
-+                      break;                              \
-+              if (__entry->bitmask != 0)                  \
-+                      __i += __entry->next_offset;        \
-+              else                                        \
-+                      __i += sizeof(struct ebt_entries);  \
-+      }                                                   \
-+      if (__ret == 0) {                                   \
-+              if (__i != (size))                          \
-+                      __ret = -EINVAL;                    \
-+      }                                                   \
-+      __ret;                                              \
-+})
-+
-+#endif
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter_bridge/ebt_among.h   2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,65 @@
-+#ifndef __LINUX_BRIDGE_EBT_AMONG_H
-+#define __LINUX_BRIDGE_EBT_AMONG_H
-+
-+#define EBT_AMONG_DST 0x01
-+#define EBT_AMONG_SRC 0x02
-+
-+/* Grzegorz Borowiak <grzes@gnu.univ.gda.pl> 2003
-+ * 
-+ * Write-once-read-many hash table, used for checking if a given
-+ * MAC address belongs to a set or not and possibly for checking
-+ * if it is related with a given IPv4 address.
-+ *
-+ * The hash value of an address is its last byte.
-+ * 
-+ * In real-world ethernet addresses, values of the last byte are
-+ * evenly distributed and there is no need to consider other bytes.
-+ * It would only slow the routines down.
-+ *
-+ * For MAC address comparison speedup reasons, we introduce a trick.
-+ * MAC address is mapped onto an array of two 32-bit integers.
-+ * This pair of integers is compared with MAC addresses in the
-+ * hash table, which are stored also in form of pairs of integers
-+ * (in `cmp' array). This is quick as it requires only two elementary
-+ * number comparisons in worst case. Further, we take advantage of
-+ * fact that entropy of 3 last bytes of address is larger than entropy
-+ * of 3 first bytes. So first we compare 4 last bytes of addresses and
-+ * if they are the same we compare 2 first.
-+ *
-+ * Yes, it is a memory overhead, but in 2003 AD, who cares?
-+ */
-+
-+struct ebt_mac_wormhash_tuple
-+{
-+      uint32_t cmp[2];
-+      uint32_t ip;
-+};
-+
-+struct ebt_mac_wormhash
-+{
-+      int table[257];
-+      int poolsize;
-+      struct ebt_mac_wormhash_tuple pool[0];
-+};
-+
-+#define ebt_mac_wormhash_size(x) ((x) ? sizeof(struct ebt_mac_wormhash) \
-+              + (x)->poolsize * sizeof(struct ebt_mac_wormhash_tuple) : 0)
-+
-+struct ebt_among_info
-+{
-+      int wh_dst_ofs;
-+      int wh_src_ofs;
-+      int bitmask;
-+};
-+
-+#define EBT_AMONG_DST_NEG 0x1
-+#define EBT_AMONG_SRC_NEG 0x2
-+
-+#define ebt_among_wh_dst(x) ((x)->wh_dst_ofs ? \
-+      (struct ebt_mac_wormhash*)((char*)(x) + (x)->wh_dst_ofs) : NULL)
-+#define ebt_among_wh_src(x) ((x)->wh_src_ofs ? \
-+      (struct ebt_mac_wormhash*)((char*)(x) + (x)->wh_src_ofs) : NULL)
-+
-+#define EBT_AMONG_MATCH "among"
-+
-+#endif
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter_bridge/ebt_limit.h   2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,23 @@
-+#ifndef __LINUX_BRIDGE_EBT_LIMIT_H
-+#define __LINUX_BRIDGE_EBT_LIMIT_H
-+
-+#define EBT_LIMIT_MATCH "limit"
-+
-+/* timings are in milliseconds. */
-+#define EBT_LIMIT_SCALE 10000
-+
-+/* 1/10,000 sec period => max of 10,000/sec.  Min rate is then 429490
-+   seconds, or one every 59 hours. */
-+
-+struct ebt_limit_info
-+{
-+      u_int32_t avg;    /* Average secs between packets * scale */
-+      u_int32_t burst;  /* Period multiplier for upper limit. */
-+
-+      /* Used internally by the kernel */
-+      unsigned long prev;
-+      u_int32_t credit;
-+      u_int32_t credit_cap, cost;
-+};
-+
-+#endif
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter_bridge/ebt_arpreply.h        2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,11 @@
-+#ifndef __LINUX_BRIDGE_EBT_ARPREPLY_H
-+#define __LINUX_BRIDGE_EBT_ARPREPLY_H
-+
-+struct ebt_arpreply_info
-+{
-+      unsigned char mac[ETH_ALEN];
-+      int target;
-+};
-+#define EBT_ARPREPLY_TARGET "arpreply"
-+
-+#endif
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter_bridge/ebt_802_3.h   2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,60 @@
-+#ifndef __LINUX_BRIDGE_EBT_802_3_H
-+#define __LINUX_BRIDGE_EBT_802_3_H
-+
-+#define EBT_802_3_SAP 0x01
-+#define EBT_802_3_TYPE 0x02
-+
-+#define EBT_802_3_MATCH "802_3"
-+
-+/*
-+ * If frame has DSAP/SSAP value 0xaa you must check the SNAP type
-+ * to discover what kind of packet we're carrying. 
-+ */
-+#define CHECK_TYPE 0xaa
-+
-+/*
-+ * Control field may be one or two bytes.  If the first byte has
-+ * the value 0x03 then the entire length is one byte, otherwise it is two.
-+ * One byte controls are used in Unnumbered Information frames.
-+ * Two byte controls are used in Numbered Information frames.
-+ */
-+#define IS_UI 0x03
-+
-+#define EBT_802_3_MASK (EBT_802_3_SAP | EBT_802_3_TYPE | EBT_802_3)
-+
-+/* ui has one byte ctrl, ni has two */
-+struct hdr_ui {
-+      uint8_t dsap;
-+      uint8_t ssap;
-+      uint8_t ctrl;
-+      uint8_t orig[3];
-+      uint16_t type;
-+};
-+
-+struct hdr_ni {
-+      uint8_t dsap;
-+      uint8_t ssap;
-+      uint16_t ctrl;
-+      uint8_t  orig[3];
-+      uint16_t type;
-+};
-+
-+struct ebt_802_3_hdr {
-+      uint8_t  daddr[6];
-+      uint8_t  saddr[6];
-+      uint16_t len;
-+      union {
-+              struct hdr_ui ui;
-+              struct hdr_ni ni;
-+      } llc;
-+};
-+
-+struct ebt_802_3_info 
-+{
-+      uint8_t  sap;
-+      uint16_t type;
-+      uint8_t  bitmask;
-+      uint8_t  invflags;
-+};
-+
-+#endif
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter_bridge/ebt_arp.h     2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,32 @@
-+#ifndef __LINUX_BRIDGE_EBT_ARP_H
-+#define __LINUX_BRIDGE_EBT_ARP_H
-+
-+#define EBT_ARP_OPCODE 0x01
-+#define EBT_ARP_HTYPE 0x02
-+#define EBT_ARP_PTYPE 0x04
-+#define EBT_ARP_SRC_IP 0x08
-+#define EBT_ARP_DST_IP 0x10
-+#define EBT_ARP_SRC_MAC 0x20
-+#define EBT_ARP_DST_MAC 0x40
-+#define EBT_ARP_MASK (EBT_ARP_OPCODE | EBT_ARP_HTYPE | EBT_ARP_PTYPE | \
-+   EBT_ARP_SRC_IP | EBT_ARP_DST_IP | EBT_ARP_SRC_MAC | EBT_ARP_DST_MAC)
-+#define EBT_ARP_MATCH "arp"
-+
-+struct ebt_arp_info
-+{
-+      uint16_t htype;
-+      uint16_t ptype;
-+      uint16_t opcode;
-+      uint32_t saddr;
-+      uint32_t smsk;
-+      uint32_t daddr;
-+      uint32_t dmsk;
-+      unsigned char smaddr[ETH_ALEN];
-+      unsigned char smmsk[ETH_ALEN];
-+      unsigned char dmaddr[ETH_ALEN];
-+      unsigned char dmmsk[ETH_ALEN];
-+      uint8_t  bitmask;
-+      uint8_t  invflags;
-+};
-+
-+#endif
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter_bridge/ebt_ip.h      2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,43 @@
-+/*
-+ *  ebt_ip
-+ *
-+ *    Authors:
-+ *    Bart De Schuymer <bart.de.schuymer@pandora.be>
-+ *
-+ *  April, 2002
-+ *
-+ *  Changes:
-+ *    added ip-sport and ip-dport
-+ *    Innominate Security Technologies AG <mhopf@innominate.com>
-+ *    September, 2002
-+ */
-+
-+#ifndef __LINUX_BRIDGE_EBT_IP_H
-+#define __LINUX_BRIDGE_EBT_IP_H
-+
-+#define EBT_IP_SOURCE 0x01
-+#define EBT_IP_DEST 0x02
-+#define EBT_IP_TOS 0x04
-+#define EBT_IP_PROTO 0x08
-+#define EBT_IP_SPORT 0x10
-+#define EBT_IP_DPORT 0x20
-+#define EBT_IP_MASK (EBT_IP_SOURCE | EBT_IP_DEST | EBT_IP_TOS | EBT_IP_PROTO |\
-+ EBT_IP_SPORT | EBT_IP_DPORT )
-+#define EBT_IP_MATCH "ip"
-+
-+// the same values are used for the invflags
-+struct ebt_ip_info
-+{
-+      uint32_t saddr;
-+      uint32_t daddr;
-+      uint32_t smsk;
-+      uint32_t dmsk;
-+      uint8_t  tos;
-+      uint8_t  protocol;
-+      uint8_t  bitmask;
-+      uint8_t  invflags;
-+      uint16_t sport[2];
-+      uint16_t dport[2];
-+};
-+
-+#endif
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter_bridge/ebt_pkttype.h 2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,11 @@
-+#ifndef __LINUX_BRIDGE_EBT_PKTTYPE_H
-+#define __LINUX_BRIDGE_EBT_PKTTYPE_H
-+
-+struct ebt_pkttype_info
-+{
-+      uint8_t pkt_type;
-+      uint8_t invert;
-+};
-+#define EBT_PKTTYPE_MATCH "pkttype"
-+
-+#endif
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter_bridge/ebt_stp.h     2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,46 @@
-+#ifndef __LINUX_BRIDGE_EBT_STP_H
-+#define __LINUX_BRIDGE_EBT_STP_H
-+
-+#define EBT_STP_TYPE          0x0001
-+
-+#define EBT_STP_FLAGS         0x0002
-+#define EBT_STP_ROOTPRIO      0x0004
-+#define EBT_STP_ROOTADDR      0x0008
-+#define EBT_STP_ROOTCOST      0x0010
-+#define EBT_STP_SENDERPRIO    0x0020
-+#define EBT_STP_SENDERADDR    0x0040
-+#define EBT_STP_PORT          0x0080
-+#define EBT_STP_MSGAGE                0x0100
-+#define EBT_STP_MAXAGE                0x0200
-+#define EBT_STP_HELLOTIME     0x0400
-+#define EBT_STP_FWDD          0x0800
-+
-+#define EBT_STP_MASK          0x0fff
-+#define EBT_STP_CONFIG_MASK   0x0ffe
-+
-+#define EBT_STP_MATCH "stp"
-+
-+struct ebt_stp_config_info
-+{
-+      uint8_t flags;
-+      uint16_t root_priol, root_priou;
-+      char root_addr[6], root_addrmsk[6];
-+      uint32_t root_costl, root_costu;
-+      uint16_t sender_priol, sender_priou;
-+      char sender_addr[6], sender_addrmsk[6];
-+      uint16_t portl, portu;
-+      uint16_t msg_agel, msg_ageu;
-+      uint16_t max_agel, max_ageu;
-+      uint16_t hello_timel, hello_timeu;
-+      uint16_t forward_delayl, forward_delayu;
-+};
-+
-+struct ebt_stp_info
-+{
-+      uint8_t type;
-+      struct ebt_stp_config_info config;
-+      uint16_t bitmask;
-+      uint16_t invflags;
-+};
-+
-+#endif
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter_bridge/ebt_vlan.h    2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,20 @@
-+#ifndef __LINUX_BRIDGE_EBT_VLAN_H
-+#define __LINUX_BRIDGE_EBT_VLAN_H
-+
-+#define EBT_VLAN_ID   0x01
-+#define EBT_VLAN_PRIO 0x02
-+#define EBT_VLAN_ENCAP        0x04
-+#define EBT_VLAN_MASK (EBT_VLAN_ID | EBT_VLAN_PRIO | EBT_VLAN_ENCAP)
-+#define EBT_VLAN_MATCH "vlan"
-+
-+struct ebt_vlan_info {
-+      uint16_t id;            /* VLAN ID {1-4095} */
-+      uint8_t prio;           /* VLAN User Priority {0-7} */
-+      uint16_t encap;         /* VLAN Encapsulated frame code {0-65535} */
-+      uint8_t bitmask;                /* Args bitmask bit 1=1 - ID arg,
-+                                 bit 2=1 User-Priority arg, bit 3=1 encap*/
-+      uint8_t invflags;               /* Inverse bitmask  bit 1=1 - inversed ID arg, 
-+                                 bit 2=1 - inversed Pirority arg */
-+};
-+
-+#endif
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter_bridge/ebt_log.h     2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,17 @@
-+#ifndef __LINUX_BRIDGE_EBT_LOG_H
-+#define __LINUX_BRIDGE_EBT_LOG_H
-+
-+#define EBT_LOG_IP 0x01 // if the frame is made by ip, log the ip information
-+#define EBT_LOG_ARP 0x02
-+#define EBT_LOG_MASK (EBT_LOG_IP | EBT_LOG_ARP)
-+#define EBT_LOG_PREFIX_SIZE 30
-+#define EBT_LOG_WATCHER "log"
-+
-+struct ebt_log_info
-+{
-+      uint8_t loglevel;
-+      uint8_t prefix[EBT_LOG_PREFIX_SIZE];
-+      uint32_t bitmask;
-+};
-+
-+#endif
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter_bridge/ebt_ulog.h    2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,33 @@
-+#ifndef _EBT_ULOG_H
-+#define _EBT_ULOG_H
-+
-+#define EBT_ULOG_DEFAULT_NLGROUP 0
-+#define EBT_ULOG_DEFAULT_QTHRESHOLD 1
-+#define EBT_ULOG_MAXNLGROUPS 32 /* hardcoded netlink max */
-+#define EBT_ULOG_PREFIX_LEN 32
-+#define EBT_ULOG_MAX_QLEN 50
-+#define EBT_ULOG_WATCHER "ulog"
-+
-+struct ebt_ulog_info {
-+      uint32_t nlgroup;
-+      unsigned int cprange;
-+      unsigned int qthreshold;
-+      char prefix[EBT_ULOG_PREFIX_LEN];
-+};
-+
-+typedef struct ebt_ulog_packet_msg {
-+      char indev[IFNAMSIZ];
-+      char outdev[IFNAMSIZ];
-+      char physindev[IFNAMSIZ];
-+      char physoutdev[IFNAMSIZ];
-+      char prefix[EBT_ULOG_PREFIX_LEN];
-+      struct timeval stamp;
-+      unsigned long mark;
-+      unsigned int hook;
-+      size_t data_len;
-+      /* The complete packet, including Ethernet header and perhaps
-+       * the VLAN header is appended */
-+      unsigned char data[0] __attribute__ ((aligned (__alignof__(int))));
-+} ebt_ulog_packet_msg_t;
-+
-+#endif /* _EBT_ULOG_H */
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter_bridge/ebt_nat.h     2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,13 @@
-+#ifndef __LINUX_BRIDGE_EBT_NAT_H
-+#define __LINUX_BRIDGE_EBT_NAT_H
-+
-+struct ebt_nat_info
-+{
-+      unsigned char mac[ETH_ALEN];
-+      // EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN
-+      int target;
-+};
-+#define EBT_SNAT_TARGET "snat"
-+#define EBT_DNAT_TARGET "dnat"
-+
-+#endif
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter_bridge/ebt_redirect.h        2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,11 @@
-+#ifndef __LINUX_BRIDGE_EBT_REDIRECT_H
-+#define __LINUX_BRIDGE_EBT_REDIRECT_H
-+
-+struct ebt_redirect_info
-+{
-+      // EBT_ACCEPT, EBT_DROP or EBT_CONTINUE or EBT_RETURN
-+      int target;
-+};
-+#define EBT_REDIRECT_TARGET "redirect"
-+
-+#endif
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter_bridge/ebt_mark_m.h  2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,15 @@
-+#ifndef __LINUX_BRIDGE_EBT_MARK_M_H
-+#define __LINUX_BRIDGE_EBT_MARK_M_H
-+
-+#define EBT_MARK_AND 0x01
-+#define EBT_MARK_OR 0x02
-+#define EBT_MARK_MASK (EBT_MARK_AND | EBT_MARK_OR)
-+struct ebt_mark_m_info
-+{
-+      unsigned long mark, mask;
-+      uint8_t invert;
-+      uint8_t bitmask;
-+};
-+#define EBT_MARK_MATCH "mark_m"
-+
-+#endif
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter_bridge/ebt_mark_t.h  2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,12 @@
-+#ifndef __LINUX_BRIDGE_EBT_MARK_T_H
-+#define __LINUX_BRIDGE_EBT_MARK_T_H
-+
-+struct ebt_mark_t_info
-+{
-+      unsigned long mark;
-+      // EBT_ACCEPT, EBT_DROP or EBT_CONTINUE or EBT_RETURN
-+      int target;
-+};
-+#define EBT_MARK_TARGET "mark"
-+
-+#endif
---- linux-2.4.29/include/linux/netfilter.h     2005-01-19 15:10:12.000000000 +0100
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter.h    2005-03-14 21:11:36.000000000 +0100
-@@ -17,7 +17,8 @@
- #define NF_STOLEN 2
- #define NF_QUEUE 3
- #define NF_REPEAT 4
--#define NF_MAX_VERDICT NF_REPEAT
-+#define NF_STOP 5
-+#define NF_MAX_VERDICT NF_STOP
- /* Generic cache responses from hook functions.
-    <= 0x2000 is used for protocol-flags. */
-@@ -118,17 +119,34 @@ extern struct list_head nf_hooks[NPROTO]
- /* This is gross, but inline doesn't cut it for avoiding the function
-    call in fast path: gcc doesn't inline (needs value tracking?). --RR */
- #ifdef CONFIG_NETFILTER_DEBUG
--#define NF_HOOK nf_hook_slow
-+#define NF_HOOK(pf, hook, skb, indev, outdev, okfn)                           \
-+({int __ret;                                                                  \
-+if ((__ret=nf_hook_slow(pf, hook, &(skb), indev, outdev, okfn, INT_MIN)) == 1) \
-+       __ret = (okfn)(skb);                                                   \
-+__ret;})
-+#define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh)            \
-+({int __ret;                                                                  \
-+if ((__ret=nf_hook_slow(pf, hook, &(skb), indev, outdev, okfn, thresh)) == 1)  \
-+       __ret = (okfn)(skb);                                                   \
-+__ret;})
- #else
--#define NF_HOOK(pf, hook, skb, indev, outdev, okfn)                   \
--(list_empty(&nf_hooks[(pf)][(hook)])                                  \
-- ? (okfn)(skb)                                                                \
-- : nf_hook_slow((pf), (hook), (skb), (indev), (outdev), (okfn)))
-+#define NF_HOOK(pf, hook, skb, indev, outdev, okfn)                           \
-+({int __ret;                                                                  \
-+if (list_empty(&nf_hooks[pf][hook]) ||                                        \
-+    (__ret=nf_hook_slow(pf, hook, &(skb), indev, outdev, okfn, INT_MIN)) == 1) \
-+       __ret = (okfn)(skb);                                                   \
-+__ret;})
-+#define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh)            \
-+({int __ret;                                                                  \
-+if (list_empty(&nf_hooks[pf][hook]) ||                                        \
-+    (__ret=nf_hook_slow(pf, hook, &(skb), indev, outdev, okfn, thresh)) == 1)  \
-+       __ret = (okfn)(skb);                                                   \
-+__ret;})
- #endif
--int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb,
-+int nf_hook_slow(int pf, unsigned int hook, struct sk_buff **pskb,
-                struct net_device *indev, struct net_device *outdev,
--               int (*okfn)(struct sk_buff *));
-+               int (*okfn)(struct sk_buff *), int thresh);
- /* Call setsockopt() */
- int nf_setsockopt(struct sock *sk, int pf, int optval, char *opt, 
---- linux-2.4.29/include/linux/netfilter_ipv4.h        2002-02-25 20:38:13.000000000 +0100
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter_ipv4.h       2005-03-14 21:11:36.000000000 +0100
-@@ -52,8 +52,10 @@
- enum nf_ip_hook_priorities {
-       NF_IP_PRI_FIRST = INT_MIN,
-       NF_IP_PRI_CONNTRACK = -200,
-+      NF_IP_PRI_BRIDGE_SABOTAGE_FORWARD = -175,
-       NF_IP_PRI_MANGLE = -150,
-       NF_IP_PRI_NAT_DST = -100,
-+      NF_IP_PRI_BRIDGE_SABOTAGE_LOCAL_OUT = -50,
-       NF_IP_PRI_FILTER = 0,
-       NF_IP_PRI_NAT_SRC = 100,
-       NF_IP_PRI_LAST = INT_MAX,
---- linux-2.4.29/include/linux/netfilter_ipv6.h        2001-01-02 01:17:54.000000000 +0100
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter_ipv6.h       2005-03-14 21:24:11.000000000 +0100
-@@ -57,8 +57,10 @@
- enum nf_ip6_hook_priorities {
-       NF_IP6_PRI_FIRST = INT_MIN,
-       NF_IP6_PRI_CONNTRACK = -200,
-+      NF_IP6_PRI_BRIDGE_SABOTAGE_FORWARD = -175,
-       NF_IP6_PRI_MANGLE = -150,
-       NF_IP6_PRI_NAT_DST = -100,
-+      NF_IP6_PRI_BRIDGE_SABOTAGE_LOCAL_OUT = -50,
-       NF_IP6_PRI_FILTER = 0,
-       NF_IP6_PRI_NAT_SRC = 100,
-       NF_IP6_PRI_LAST = INT_MAX,
---- linux-2.4.29/include/linux/skbuff.h        2004-08-08 01:26:06.000000000 +0200
-+++ linux-2.4.29-ebt-brnf/include/linux/skbuff.h       2005-03-14 21:07:31.000000000 +0100
-@@ -92,6 +92,20 @@ struct nf_conntrack {
- struct nf_ct_info {
-       struct nf_conntrack *master;
- };
-+
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+struct nf_bridge_info {
-+      atomic_t use;
-+      struct net_device *physindev;
-+      struct net_device *physoutdev;
-+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
-+      struct net_device *netoutdev;
-+#endif
-+      unsigned int mask;
-+      unsigned long data[32 / sizeof(unsigned long)];
-+};
-+#endif
-+
- #endif
- struct sk_buff_head {
-@@ -208,6 +222,9 @@ struct sk_buff {
- #ifdef CONFIG_NETFILTER_DEBUG
-         unsigned int nf_debug;
- #endif
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      struct nf_bridge_info   *nf_bridge;     /* Saved data about a bridged frame - see br_netfilter.c */
-+#endif
- #endif /*CONFIG_NETFILTER*/
- #if defined(CONFIG_HIPPI)
-@@ -1175,6 +1192,20 @@ nf_reset(struct sk_buff *skb)
-       skb->nf_debug = 0;
- #endif
- }
-+
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+static inline void nf_bridge_put(struct nf_bridge_info *nf_bridge)
-+{
-+      if (nf_bridge && atomic_dec_and_test(&nf_bridge->use))
-+              kfree(nf_bridge);
-+}
-+static inline void nf_bridge_get(struct nf_bridge_info *nf_bridge)
-+{
-+      if (nf_bridge)
-+              atomic_inc(&nf_bridge->use);
-+}
-+#endif
-+
- #else /* CONFIG_NETFILTER */
- static inline void nf_reset(struct sk_buff *skb) {}
- #endif /* CONFIG_NETFILTER */
---- linux-2.4.29/net/core/netfilter.c  2005-01-19 15:10:13.000000000 +0100
-+++ linux-2.4.29-ebt-brnf/net/core/netfilter.c 2005-03-14 21:21:41.825275416 +0100
-@@ -342,32 +342,29 @@ static unsigned int nf_iterate(struct li
-                              const struct net_device *indev,
-                              const struct net_device *outdev,
-                              struct list_head **i,
--                             int (*okfn)(struct sk_buff *))
-+                             int (*okfn)(struct sk_buff *),
-+                             int hook_thresh)
- {
-+      unsigned int verdict;
-+
-       for (*i = (*i)->next; *i != head; *i = (*i)->next) {
-               struct nf_hook_ops *elem = (struct nf_hook_ops *)*i;
--              switch (elem->hook(hook, skb, indev, outdev, okfn)) {
--              case NF_QUEUE:
--                      return NF_QUEUE;
--
--              case NF_STOLEN:
--                      return NF_STOLEN;
--
--              case NF_DROP:
--                      return NF_DROP;
--              case NF_REPEAT:
--                      *i = (*i)->prev;
--                      break;
-+              if (hook_thresh > elem->priority)
-+                      continue;
-+              verdict = elem->hook(hook, skb, indev, outdev, okfn);
-+              if (verdict != NF_ACCEPT) {
- #ifdef CONFIG_NETFILTER_DEBUG
--              case NF_ACCEPT:
--                      break;
--
--              default:
--                      NFDEBUG("Evil return from %p(%u).\n", 
--                              elem->hook, hook);
-+                      if (unlikely(verdict > NF_MAX_VERDICT)) {
-+                              NFDEBUG("Evil return from %p(%u).\n",
-+                                      elem->hook, hook);
-+                              continue;
-+                      }
- #endif
-+                      if (verdict != NF_REPEAT)
-+                              return verdict;
-+                      *i = (*i)->prev;
-               }
-       }
-       return NF_ACCEPT;
-@@ -413,6 +410,10 @@ static void nf_queue(struct sk_buff *skb
- {
-       int status;
-       struct nf_info *info;
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      struct net_device *physindev = NULL;
-+      struct net_device *physoutdev = NULL;
-+#endif
-       if (!queue_handler[pf].outfn) {
-               kfree_skb(skb);
-@@ -435,36 +436,52 @@ static void nf_queue(struct sk_buff *skb
-       if (indev) dev_hold(indev);
-       if (outdev) dev_hold(outdev);
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      if (skb->nf_bridge) {
-+              physindev = skb->nf_bridge->physindev;
-+              if (physindev) dev_hold(physindev);
-+              physoutdev = skb->nf_bridge->physoutdev;
-+              if (physoutdev) dev_hold(physoutdev);
-+      }
-+#endif
-+
-       status = queue_handler[pf].outfn(skb, info, queue_handler[pf].data);
-       if (status < 0) {
-               /* James M doesn't say fuck enough. */
-               if (indev) dev_put(indev);
-               if (outdev) dev_put(outdev);
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+              if (physindev) dev_put(physindev);
-+              if (physoutdev) dev_put(physoutdev);
-+#endif
-               kfree(info);
-               kfree_skb(skb);
-               return;
-       }
- }
--int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb,
-+/* Returns 1 if okfn() needs to be executed by the caller,
-+ * -EPERM for NF_DROP, 0 otherwise. */
-+int nf_hook_slow(int pf, unsigned int hook, struct sk_buff **pskb,
-                struct net_device *indev,
-                struct net_device *outdev,
--               int (*okfn)(struct sk_buff *))
-+               int (*okfn)(struct sk_buff *),
-+               int hook_thresh)
- {
-       struct list_head *elem;
-       unsigned int verdict;
-       int ret = 0;
-       /* This stopgap cannot be removed until all the hooks are audited. */
--      if (skb_is_nonlinear(skb) && skb_linearize(skb, GFP_ATOMIC) != 0) {
--              kfree_skb(skb);
-+      if (skb_is_nonlinear(*pskb) && skb_linearize(*pskb, GFP_ATOMIC) != 0) {
-+              kfree_skb(*pskb);
-               return -ENOMEM;
-       }
--      if (skb->ip_summed == CHECKSUM_HW) {
-+      if ((*pskb)->ip_summed == CHECKSUM_HW) {
-               if (outdev == NULL) {
--                      skb->ip_summed = CHECKSUM_NONE;
-+                      (*pskb)->ip_summed = CHECKSUM_NONE;
-               } else {
--                      skb_checksum_help(skb);
-+                      skb_checksum_help(*pskb);
-               }
-       }
-@@ -472,30 +489,24 @@ int nf_hook_slow(int pf, unsigned int ho
-       br_read_lock_bh(BR_NETPROTO_LOCK);
- #ifdef CONFIG_NETFILTER_DEBUG
--      if (skb->nf_debug & (1 << hook)) {
-+      if (unlikely((*pskb)->nf_debug & (1 << hook))) {
-               printk("nf_hook: hook %i already set.\n", hook);
--              nf_dump_skb(pf, skb);
-+              nf_dump_skb(pf, *pskb);
-       }
--      skb->nf_debug |= (1 << hook);
-+      (*pskb)->nf_debug |= (1 << hook);
- #endif
-       elem = &nf_hooks[pf][hook];
--      verdict = nf_iterate(&nf_hooks[pf][hook], &skb, hook, indev,
--                           outdev, &elem, okfn);
--      if (verdict == NF_QUEUE) {
--              NFDEBUG("nf_hook: Verdict = QUEUE.\n");
--              nf_queue(skb, elem, pf, hook, indev, outdev, okfn);
--      }
--
--      switch (verdict) {
--      case NF_ACCEPT:
--              ret = okfn(skb);
--              break;
--
--      case NF_DROP:
--              kfree_skb(skb);
-+      verdict = nf_iterate(&nf_hooks[pf][hook], pskb, hook, indev,
-+                           outdev, &elem, okfn, hook_thresh);
-+      if (verdict == NF_ACCEPT || verdict == NF_STOP)
-+              ret = 1;
-+      else if (verdict == NF_DROP) {
-+              kfree_skb(*pskb);
-               ret = -EPERM;
--              break;
-+      } else if (verdict == NF_QUEUE) {
-+              NFDEBUG("nf_hook: Verdict = QUEUE.\n");
-+              nf_queue(*pskb, elem, pf, hook, indev, outdev, okfn);
-       }
-       br_read_unlock_bh(BR_NETPROTO_LOCK);
-@@ -510,6 +521,14 @@ void nf_reinject(struct sk_buff *skb, st
-       /* We don't have BR_NETPROTO_LOCK here */
-       br_read_lock_bh(BR_NETPROTO_LOCK);
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      if (skb->nf_bridge) {
-+              if (skb->nf_bridge->physindev)
-+                      dev_put(skb->nf_bridge->physindev);
-+              if (skb->nf_bridge->physoutdev)
-+                      dev_put(skb->nf_bridge->physoutdev);
-+      }
-+#endif
-       for (i = nf_hooks[info->pf][info->hook].next; i != elem; i = i->next) {
-               if (i == &nf_hooks[info->pf][info->hook]) {
-                       /* The module which sent it to userspace is gone. */
-@@ -530,7 +549,7 @@ void nf_reinject(struct sk_buff *skb, st
-               verdict = nf_iterate(&nf_hooks[info->pf][info->hook],
-                                    &skb, info->hook, 
-                                    info->indev, info->outdev, &elem,
--                                   info->okfn);
-+                                   info->okfn, INT_MIN);
-       }
-       switch (verdict) {
---- linux-2.4.29/net/core/skbuff.c     2003-08-25 13:44:44.000000000 +0200
-+++ linux-2.4.29-ebt-brnf/net/core/skbuff.c    2005-03-14 00:00:30.000000000 +0100
-@@ -246,6 +246,9 @@ static inline void skb_headerinit(void *
- #ifdef CONFIG_NETFILTER_DEBUG
-       skb->nf_debug = 0;
- #endif
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      skb->nf_bridge    = NULL;
-+#endif
- #endif
- #ifdef CONFIG_NET_SCHED
-       skb->tc_index = 0;
-@@ -326,6 +329,9 @@ void __kfree_skb(struct sk_buff *skb)
-       }
- #ifdef CONFIG_NETFILTER
-       nf_conntrack_put(skb->nfct);
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      nf_bridge_put(skb->nf_bridge);
-+#endif
- #endif
-       skb_headerinit(skb, NULL, 0);  /* clean state */
-       kfree_skbmem(skb);
-@@ -393,6 +399,9 @@ struct sk_buff *skb_clone(struct sk_buff
- #ifdef CONFIG_NETFILTER_DEBUG
-       C(nf_debug);
- #endif
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      C(nf_bridge);
-+#endif
- #endif /*CONFIG_NETFILTER*/
- #if defined(CONFIG_HIPPI)
-       C(private);
-@@ -405,6 +414,9 @@ struct sk_buff *skb_clone(struct sk_buff
-       skb->cloned = 1;
- #ifdef CONFIG_NETFILTER
-       nf_conntrack_get(skb->nfct);
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      nf_bridge_get(skb->nf_bridge);
-+#endif
- #endif
-       return n;
- }
-@@ -440,6 +452,10 @@ static void copy_skb_header(struct sk_bu
- #ifdef CONFIG_NETFILTER_DEBUG
-       new->nf_debug=old->nf_debug;
- #endif
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      new->nf_bridge=old->nf_bridge;
-+      nf_bridge_get(new->nf_bridge);
-+#endif
- #endif
- #ifdef CONFIG_NET_SCHED
-       new->tc_index = old->tc_index;
-@@ -726,9 +742,9 @@ struct sk_buff *skb_copy_expand(const st
-       /* Set the tail pointer and length */
-       skb_put(n,skb->len);
--      /* Copy the data only. */
--      if (skb_copy_bits(skb, 0, n->data, skb->len))
--              BUG();
-+       /* Copy the linear data and header. */
-+       if (skb_copy_bits(skb, -newheadroom, n->head, newheadroom + skb->len))
-+                BUG();
-       copy_skb_header(n, skb);
-       return n;
---- linux-2.4.29/net/ipv4/netfilter/ip_tables.c        2005-01-19 15:10:13.000000000 +0100
-+++ linux-2.4.29-ebt-brnf/net/ipv4/netfilter/ip_tables.c       2005-03-14 00:00:30.000000000 +0100
-@@ -118,12 +118,19 @@ static LIST_HEAD(ipt_tables);
- static inline int
- ip_packet_match(const struct iphdr *ip,
-               const char *indev,
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+              const char *physindev,
-+#endif
-               const char *outdev,
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+              const char *physoutdev,
-+#endif
-               const struct ipt_ip *ipinfo,
-               int isfrag)
- {
-       size_t i;
-       unsigned long ret;
-+      unsigned long ret2 = 1;
- #define FWINV(bool,invflg) ((bool) ^ !!(ipinfo->invflags & invflg))
-@@ -153,7 +160,15 @@ ip_packet_match(const struct iphdr *ip,
-                       & ((const unsigned long *)ipinfo->iniface_mask)[i];
-       }
--      if (FWINV(ret != 0, IPT_INV_VIA_IN)) {
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      for (i = 0, ret2 = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) {
-+              ret2 |= (((const unsigned long *)physindev)[i]
-+                      ^ ((const unsigned long *)ipinfo->iniface)[i])
-+                      & ((const unsigned long *)ipinfo->iniface_mask)[i];
-+      }
-+#endif
-+
-+      if (FWINV(ret != 0 && ret2 != 0, IPT_INV_VIA_IN)) {
-               dprintf("VIA in mismatch (%s vs %s).%s\n",
-                       indev, ipinfo->iniface,
-                       ipinfo->invflags&IPT_INV_VIA_IN ?" (INV)":"");
-@@ -166,7 +181,15 @@ ip_packet_match(const struct iphdr *ip,
-                       & ((const unsigned long *)ipinfo->outiface_mask)[i];
-       }
--      if (FWINV(ret != 0, IPT_INV_VIA_OUT)) {
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      for (i = 0, ret2 = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) {
-+              ret2 |= (((const unsigned long *)physoutdev)[i]
-+                      ^ ((const unsigned long *)ipinfo->outiface)[i])
-+                      & ((const unsigned long *)ipinfo->outiface_mask)[i];
-+      }
-+#endif
-+
-+      if (FWINV(ret != 0 && ret2 != 0, IPT_INV_VIA_OUT)) {
-               dprintf("VIA out mismatch (%s vs %s).%s\n",
-                       outdev, ipinfo->outiface,
-                       ipinfo->invflags&IPT_INV_VIA_OUT ?" (INV)":"");
-@@ -265,6 +288,9 @@ ipt_do_table(struct sk_buff **pskb,
-       /* Initializing verdict to NF_DROP keeps gcc happy. */
-       unsigned int verdict = NF_DROP;
-       const char *indev, *outdev;
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      const char *physindev, *physoutdev;
-+#endif
-       void *table_base;
-       struct ipt_entry *e, *back;
-@@ -274,6 +300,13 @@ ipt_do_table(struct sk_buff **pskb,
-       datalen = (*pskb)->len - ip->ihl * 4;
-       indev = in ? in->name : nulldevname;
-       outdev = out ? out->name : nulldevname;
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      physindev = ((*pskb)->nf_bridge && (*pskb)->nf_bridge->physindev) ?
-+              (*pskb)->nf_bridge->physindev->name : nulldevname;
-+      physoutdev = ((*pskb)->nf_bridge && (*pskb)->nf_bridge->physoutdev) ?
-+              (*pskb)->nf_bridge->physoutdev->name : nulldevname;
-+#endif
-+
-       /* We handle fragments by dealing with the first fragment as
-        * if it was a normal packet.  All other fragments are treated
-        * normally, except that they will NEVER match rules that ask
-@@ -309,7 +342,15 @@ ipt_do_table(struct sk_buff **pskb,
-               IP_NF_ASSERT(e);
-               IP_NF_ASSERT(back);
-               (*pskb)->nfcache |= e->nfcache;
--              if (ip_packet_match(ip, indev, outdev, &e->ip, offset)) {
-+              if (ip_packet_match(ip, indev,
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+                  physindev,
-+#endif
-+                  outdev,
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+                  physoutdev,
-+#endif
-+                  &e->ip, offset)) {
-                       struct ipt_entry_target *t;
-                       if (IPT_MATCH_ITERATE(e, do_match,
---- linux-2.4.29/net/ipv4/ip_output.c  2005-01-19 15:10:13.000000000 +0100
-+++ linux-2.4.29-ebt-brnf/net/ipv4/ip_output.c 2005-03-14 00:00:30.000000000 +0100
-@@ -890,6 +890,10 @@ int ip_fragment(struct sk_buff *skb, int
-               /* Connection association is same as pre-frag packet */
-               skb2->nfct = skb->nfct;
-               nf_conntrack_get(skb2->nfct);
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+              skb2->nf_bridge = skb->nf_bridge;
-+              nf_bridge_get(skb2->nf_bridge);
-+#endif
- #ifdef CONFIG_NETFILTER_DEBUG
-               skb2->nf_debug = skb->nf_debug;
- #endif
---- linux-2.4.29/net/ipv4/netfilter/ipt_LOG.c  2003-11-28 19:26:21.000000000 +0100
-+++ linux-2.4.29-ebt-brnf/net/ipv4/netfilter/ipt_LOG.c 2005-03-14 00:00:30.000000000 +0100
-@@ -316,6 +316,18 @@ ipt_log_target(struct sk_buff **pskb,
-              loginfo->prefix,
-              in ? in->name : "",
-              out ? out->name : "");
-+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-+      if ((*pskb)->nf_bridge) {
-+              struct net_device *physindev = (*pskb)->nf_bridge->physindev;
-+              struct net_device *physoutdev = (*pskb)->nf_bridge->physoutdev;
-+
-+              if (physindev && in != physindev)
-+                      printk("PHYSIN=%s ", physindev->name);
-+              if (physoutdev && out != physoutdev)
-+                      printk("PHYSOUT=%s ", physoutdev->name);
-+      }
-+#endif
-+
-       if (in && !out) {
-               /* MAC logging for input chain only. */
-               printk("MAC=");
---- linux-2.4.29/net/ipv4/netfilter/Makefile   2003-08-25 13:44:44.000000000 +0200
-+++ linux-2.4.29-ebt-brnf/net/ipv4/netfilter/Makefile  2005-03-14 00:00:30.000000000 +0100
-@@ -87,6 +87,8 @@ obj-$(CONFIG_IP_NF_MATCH_CONNTRACK) += i
- obj-$(CONFIG_IP_NF_MATCH_UNCLEAN) += ipt_unclean.o
- obj-$(CONFIG_IP_NF_MATCH_TCPMSS) += ipt_tcpmss.o
-+obj-$(CONFIG_IP_NF_MATCH_PHYSDEV) += ipt_physdev.o
-+
- # targets
- obj-$(CONFIG_IP_NF_TARGET_REJECT) += ipt_REJECT.o
- obj-$(CONFIG_IP_NF_TARGET_MIRROR) += ipt_MIRROR.o
---- linux-2.4.29/net/ipv4/netfilter/Config.in  2005-01-19 15:10:13.000000000 +0100
-+++ linux-2.4.29-ebt-brnf/net/ipv4/netfilter/Config.in 2005-03-14 00:00:30.000000000 +0100
-@@ -44,6 +44,9 @@ if [ "$CONFIG_IP_NF_IPTABLES" != "n" ]; 
-     dep_tristate '  Unclean match support (EXPERIMENTAL)' CONFIG_IP_NF_MATCH_UNCLEAN $CONFIG_IP_NF_IPTABLES
-     dep_tristate '  Owner match support (EXPERIMENTAL)' CONFIG_IP_NF_MATCH_OWNER $CONFIG_IP_NF_IPTABLES
-   fi
-+  if [ "$CONFIG_BRIDGE" != "n" ]; then
-+    dep_tristate '  Physdev match support' CONFIG_IP_NF_MATCH_PHYSDEV $CONFIG_IP_NF_IPTABLES
-+  fi
- # The targets
-   dep_tristate '  Packet filtering' CONFIG_IP_NF_FILTER $CONFIG_IP_NF_IPTABLES 
-   if [ "$CONFIG_IP_NF_FILTER" != "n" ]; then
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/bridge/br_netfilter.c    2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,1101 @@
-+/*
-+ *    Handle firewalling
-+ *    Linux ethernet bridge
-+ *
-+ *    Authors:
-+ *    Lennert Buytenhek               <buytenh@gnu.org>
-+ *    Bart De Schuymer (maintainer)   <bdschuym@pandora.be>
-+ *
-+ *    Changes:
-+ *    Apr 29 2003: physdev module support (bdschuym)
-+ *    Jun 19 2003: let arptables see bridged ARP traffic (bdschuym)
-+ *    Oct 06 2003: filter encapsulated IP/ARP VLAN traffic on untagged bridge
-+ *                 (bdschuym)
-+ *    Aug 28 2004: add IPv6 filtering (bdschuym)
-+ *
-+ *    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, or (at your option) any later version.
-+ *
-+ *    Lennert dedicates this file to Kerstin Wurdinger.
-+ */
-+
-+#include <linux/module.h>
-+#include <linux/kernel.h>
-+#include <linux/ip.h>
-+#include <linux/netdevice.h>
-+#include <linux/skbuff.h>
-+#include <linux/if_ether.h>
-+#include <linux/if_vlan.h>
-+#include <linux/netfilter_bridge.h>
-+#include <linux/netfilter_ipv4.h>
-+#include <linux/netfilter_ipv6.h>
-+#include <linux/in_route.h>
-+#include <net/ip.h>
-+#include <net/ipv6.h>
-+#include <asm/uaccess.h>
-+#include <asm/checksum.h>
-+#include "br_private.h"
-+#ifdef CONFIG_SYSCTL
-+#include <linux/sysctl.h>
-+#endif
-+
-+#define skb_origaddr(skb)      (((struct bridge_skb_cb *) \
-+                               (skb->nf_bridge->data))->daddr.ipv4)
-+#define store_orig_dstaddr(skb)        (skb_origaddr(skb) = (skb)->nh.iph->daddr)
-+#define dnat_took_place(skb)   (skb_origaddr(skb) != (skb)->nh.iph->daddr)
-+
-+#define has_bridge_parent(device)     ((device)->br_port != NULL)
-+#define bridge_parent(device)         (&((device)->br_port->br->dev))
-+
-+#ifdef CONFIG_SYSCTL
-+static struct ctl_table_header *brnf_sysctl_header;
-+static int brnf_call_iptables = 1;
-+static int brnf_call_ip6tables = 1;
-+static int brnf_call_arptables = 1;
-+static int brnf_filter_vlan_tagged = 1;
-+#else
-+#define brnf_filter_vlan_tagged 1
-+#endif
-+
-+#define IS_VLAN_IP (skb->protocol == __constant_htons(ETH_P_8021Q) &&    \
-+      hdr->h_vlan_encapsulated_proto == __constant_htons(ETH_P_IP) &&  \
-+      brnf_filter_vlan_tagged)
-+#define IS_VLAN_IPV6 (skb->protocol == __constant_htons(ETH_P_8021Q) &&    \
-+      hdr->h_vlan_encapsulated_proto == __constant_htons(ETH_P_IPV6) &&  \
-+      brnf_filter_vlan_tagged)
-+/*
-+#define IS_VLAN_ARP (skb->protocol == __constant_htons(ETH_P_8021Q) &&   \
-+      hdr->h_vlan_encapsulated_proto == __constant_htons(ETH_P_ARP) && \
-+      brnf_filter_vlan_tagged)
-+*/
-+
-+/* We need these fake structures to make netfilter happy --
-+ * lots of places assume that skb->dst != NULL, which isn't
-+ * all that unreasonable.
-+ *
-+ * Currently, we fill in the PMTU entry because netfilter
-+ * refragmentation needs it, and the rt_flags entry because
-+ * ipt_REJECT needs it.  Future netfilter modules might
-+ * require us to fill additional fields.
-+ */
-+static struct net_device __fake_net_device = {
-+      .hard_header_len        = ETH_HLEN
-+};
-+
-+static struct rtable __fake_rtable = {
-+      u: {
-+              dst: {
-+                      __refcnt:               ATOMIC_INIT(1),
-+                      dev:                    &__fake_net_device,
-+                      pmtu:                   1500
-+              }
-+      },
-+
-+      rt_flags:       0
-+};
-+
-+
-+/* PF_BRIDGE/PRE_ROUTING *********************************************/
-+/* Undo the changes made for ip6tables PREROUTING and continue the
-+ * bridge PRE_ROUTING hook. */
-+static int br_nf_pre_routing_finish_ipv6(struct sk_buff *skb)
-+{
-+      struct nf_bridge_info *nf_bridge = skb->nf_bridge;
-+
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug ^= (1 << NF_BR_PRE_ROUTING);
-+#endif
-+
-+      if (nf_bridge->mask & BRNF_PKT_TYPE) {
-+              skb->pkt_type = PACKET_OTHERHOST;
-+              nf_bridge->mask ^= BRNF_PKT_TYPE;
-+      }
-+      nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING;
-+
-+      skb->dst = (struct dst_entry *)&__fake_rtable;
-+      dst_hold(skb->dst);
-+
-+      skb->dev = nf_bridge->physindev;
-+      if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
-+              skb_push(skb, VLAN_HLEN);
-+              skb->nh.raw -= VLAN_HLEN;
-+      }
-+      NF_HOOK_THRESH(PF_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL,
-+                     br_handle_frame_finish, 1);
-+
-+      return 0;
-+}
-+
-+static void __br_dnat_complain(void)
-+{
-+      static unsigned long last_complaint;
-+
-+      if (jiffies - last_complaint >= 5 * HZ) {
-+              printk(KERN_WARNING "Performing cross-bridge DNAT requires IP "
-+                      "forwarding to be enabled\n");
-+              last_complaint = jiffies;
-+      }
-+}
-+
-+
-+/* This requires some explaining. If DNAT has taken place,
-+ * we will need to fix up the destination Ethernet address,
-+ * and this is a tricky process.
-+ *
-+ * There are two cases to consider:
-+ * 1. The packet was DNAT'ed to a device in the same bridge
-+ *    port group as it was received on. We can still bridge
-+ *    the packet.
-+ * 2. The packet was DNAT'ed to a different device, either
-+ *    a non-bridged device or another bridge port group.
-+ *    The packet will need to be routed.
-+ *
-+ * The correct way of distinguishing between these two cases is to
-+ * call ip_route_input() and to look at skb->dst->dev, which is
-+ * changed to the destination device if ip_route_input() succeeds.
-+ *
-+ * Let us first consider the case that ip_route_input() succeeds:
-+ *
-+ * If skb->dst->dev equals the logical bridge device the packet
-+ * came in on, we can consider this bridging. We then call
-+ * skb->dst->output() which will make the packet enter br_nf_local_out()
-+ * not much later. In that function it is assured that the iptables
-+ * FORWARD chain is traversed for the packet.
-+ *
-+ * Otherwise, the packet is considered to be routed and we just
-+ * change the destination MAC address so that the packet will
-+ * later be passed up to the IP stack to be routed.
-+ *
-+ * Let us now consider the case that ip_route_input() fails:
-+ *
-+ * After a "echo '0' > /proc/sys/net/ipv4/ip_forward" ip_route_input()
-+ * will fail, while __ip_route_output_key() will return success. The source
-+ * address for __ip_route_output_key() is set to zero, so __ip_route_output_key
-+ * thinks we're handling a locally generated packet and won't care
-+ * if IP forwarding is allowed. We send a warning message to the users's
-+ * log telling her to put IP forwarding on.
-+ *
-+ * ip_route_input() will also fail if there is no route available.
-+ * In that case we just drop the packet.
-+ *
-+ * --Lennert, 20020411
-+ * --Bart, 20020416 (updated)
-+ * --Bart, 20021007 (updated)
-+ */
-+
-+static int br_nf_pre_routing_finish_bridge(struct sk_buff *skb)
-+{
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug |= (1 << NF_BR_PRE_ROUTING) | (1 << NF_BR_FORWARD);
-+#endif
-+
-+      if (skb->pkt_type == PACKET_OTHERHOST) {
-+              skb->pkt_type = PACKET_HOST;
-+              skb->nf_bridge->mask |= BRNF_PKT_TYPE;
-+      }
-+      skb->nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING;
-+
-+      skb->dev = bridge_parent(skb->dev);
-+      if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
-+              skb_pull(skb, VLAN_HLEN);
-+              skb->nh.raw += VLAN_HLEN;
-+      }
-+      skb->dst->output(skb);
-+      return 0;
-+}
-+
-+static int br_nf_pre_routing_finish(struct sk_buff *skb)
-+{
-+      struct net_device *dev = skb->dev;
-+      struct iphdr *iph = skb->nh.iph;
-+      struct nf_bridge_info *nf_bridge = skb->nf_bridge;
-+
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug ^= (1 << NF_BR_PRE_ROUTING);
-+#endif
-+
-+      if (nf_bridge->mask & BRNF_PKT_TYPE) {
-+              skb->pkt_type = PACKET_OTHERHOST;
-+              nf_bridge->mask ^= BRNF_PKT_TYPE;
-+      }
-+      nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING;
-+
-+      if (dnat_took_place(skb)) {
-+              if (ip_route_input(skb, iph->daddr, iph->saddr, iph->tos,
-+                  dev)) {
-+                      struct rtable *rt;
-+
-+                      if (!ip_route_output(&rt, iph->daddr, 0, iph->tos, 0)) {
-+                              /* Bridged-and-DNAT'ed traffic doesn't
-+                               * require ip_forwarding.
-+                               */
-+                              if (((struct dst_entry *)rt)->dev == dev) {
-+                                      skb->dst = (struct dst_entry *)rt;
-+                                      goto bridged_dnat;
-+                              }
-+                              __br_dnat_complain();
-+                              dst_release((struct dst_entry *)rt);
-+                      }
-+                      kfree_skb(skb);
-+                      return 0;
-+              } else {
-+                      if (skb->dst->dev == dev) {
-+bridged_dnat:
-+                              /* Tell br_nf_local_out this is a
-+                               * bridged frame
-+                               */
-+                              nf_bridge->mask |= BRNF_BRIDGED_DNAT;
-+                              skb->dev = nf_bridge->physindev;
-+                              if (skb->protocol ==
-+                                  __constant_htons(ETH_P_8021Q)) {
-+                                      skb_push(skb, VLAN_HLEN);
-+                                      skb->nh.raw -= VLAN_HLEN;
-+                              }
-+                              NF_HOOK_THRESH(PF_BRIDGE, NF_BR_PRE_ROUTING,
-+                                             skb, skb->dev, NULL,
-+                                             br_nf_pre_routing_finish_bridge,
-+                                             1);
-+                              return 0;
-+                      }
-+                      memcpy(skb->mac.ethernet->h_dest, dev->dev_addr,
-+                             ETH_ALEN);
-+                      skb->pkt_type = PACKET_HOST;
-+              }
-+      } else {
-+              skb->dst = (struct dst_entry *)&__fake_rtable;
-+              dst_hold(skb->dst);
-+      }
-+
-+      skb->dev = nf_bridge->physindev;
-+      if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
-+              skb_push(skb, VLAN_HLEN);
-+              skb->nh.raw -= VLAN_HLEN;
-+      }
-+      NF_HOOK_THRESH(PF_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL,
-+                     br_handle_frame_finish, 1);
-+
-+      return 0;
-+}
-+
-+/* Some common code for IPv4/IPv6 */
-+static void setup_pre_routing(struct sk_buff *skb)
-+{
-+      struct nf_bridge_info *nf_bridge = skb->nf_bridge;
-+
-+      if (skb->pkt_type == PACKET_OTHERHOST) {
-+              skb->pkt_type = PACKET_HOST;
-+              nf_bridge->mask |= BRNF_PKT_TYPE;
-+      }
-+
-+      nf_bridge->mask |= BRNF_NF_BRIDGE_PREROUTING;
-+      nf_bridge->physindev = skb->dev;
-+      skb->dev = bridge_parent(skb->dev);
-+}
-+
-+/* We only check the length. A bridge shouldn't do any hop-by-hop stuff anyway */
-+static int check_hbh_len(struct sk_buff *skb)
-+{
-+      unsigned char *raw = (u8*)(skb->nh.ipv6h+1);
-+      u32 pkt_len;
-+      int off = raw - skb->nh.raw;
-+      int len = (raw[1]+1)<<3;
-+
-+      if ((raw + len) - skb->data > skb_headlen(skb))
-+              goto bad;
-+
-+      off += 2;
-+      len -= 2;
-+
-+      while (len > 0) {
-+              int optlen = raw[off+1]+2;
-+
-+              switch (skb->nh.raw[off]) {
-+              case IPV6_TLV_PAD0:
-+                      optlen = 1;
-+                      break;
-+
-+              case IPV6_TLV_PADN:
-+                      break;
-+
-+              case IPV6_TLV_JUMBO:
-+                      if (skb->nh.raw[off+1] != 4 || (off&3) != 2)
-+                              goto bad;
-+
-+                      pkt_len = ntohl(*(u32*)(skb->nh.raw+off+2));
-+
-+                      if (pkt_len > skb->len - sizeof(struct ipv6hdr))
-+                              goto bad;
-+                      if (pkt_len + sizeof(struct ipv6hdr) < skb->len) {
-+                              if (__pskb_trim(skb,
-+                                  pkt_len + sizeof(struct ipv6hdr)))
-+                                      goto bad;
-+                              if (skb->ip_summed == CHECKSUM_HW)
-+                                      skb->ip_summed = CHECKSUM_NONE;
-+                      }
-+                      break;
-+              default:
-+                      if (optlen > len)
-+                              goto bad;
-+                      break;
-+              }
-+              off += optlen;
-+              len -= optlen;
-+      }
-+      if (len == 0)
-+              return 0;
-+bad:
-+      return -1;
-+
-+}
-+
-+/* Replicate the checks that IPv6 does on packet reception and pass the packet
-+ * to ip6tables, which doesn't support NAT, so things are fairly simple. */
-+static unsigned int br_nf_pre_routing_ipv6(unsigned int hook,
-+   struct sk_buff *skb, const struct net_device *in,
-+   const struct net_device *out, int (*okfn)(struct sk_buff *))
-+{
-+      struct ipv6hdr *hdr;
-+      u32 pkt_len;
-+      struct nf_bridge_info *nf_bridge;
-+
-+      if (skb->len < sizeof(struct ipv6hdr))
-+              goto inhdr_error;
-+
-+      if (!pskb_may_pull(skb, sizeof(struct ipv6hdr)))
-+              goto inhdr_error;
-+
-+      hdr = skb->nh.ipv6h;
-+
-+      if (hdr->version != 6)
-+              goto inhdr_error;
-+
-+      pkt_len = ntohs(hdr->payload_len);
-+
-+      if (pkt_len || hdr->nexthdr != NEXTHDR_HOP) {
-+              if (pkt_len + sizeof(struct ipv6hdr) > skb->len)
-+                      goto inhdr_error;
-+              if (pkt_len + sizeof(struct ipv6hdr) < skb->len) {
-+                      if (__pskb_trim(skb, pkt_len + sizeof(struct ipv6hdr)))
-+                              goto inhdr_error;
-+                      if (skb->ip_summed == CHECKSUM_HW)
-+                              skb->ip_summed = CHECKSUM_NONE;
-+              }
-+      }
-+      if (hdr->nexthdr == NEXTHDR_HOP && check_hbh_len(skb))
-+              goto inhdr_error;
-+
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug ^= (1 << NF_IP6_PRE_ROUTING);
-+#endif
-+      if ((nf_bridge = nf_bridge_alloc(skb)) == NULL)
-+              return NF_DROP;
-+      setup_pre_routing(skb);
-+
-+      NF_HOOK(PF_INET6, NF_IP6_PRE_ROUTING, skb, skb->dev, NULL,
-+              br_nf_pre_routing_finish_ipv6);
-+
-+      return NF_STOLEN;
-+
-+inhdr_error:
-+      return NF_DROP;
-+}
-+
-+/* Direct IPv6 traffic to br_nf_pre_routing_ipv6.
-+ * Replicate the checks that IPv4 does on packet reception.
-+ * Set skb->dev to the bridge device (i.e. parent of the
-+ * receiving device) to make netfilter happy, the REDIRECT
-+ * target in particular.  Save the original destination IP
-+ * address to be able to detect DNAT afterwards.
-+ */
-+static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   int (*okfn)(struct sk_buff *))
-+{
-+      struct iphdr *iph;
-+      __u32 len;
-+      struct sk_buff *skb = *pskb;
-+      struct nf_bridge_info *nf_bridge;
-+      struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)
-+                                 ((*pskb)->mac.ethernet);
-+ 
-+      if (skb->protocol == __constant_htons(ETH_P_IPV6) || IS_VLAN_IPV6) {
-+#ifdef CONFIG_SYSCTL
-+              if (!brnf_call_ip6tables)
-+                      return NF_ACCEPT;
-+#endif
-+              if ((skb = skb_share_check(*pskb, GFP_ATOMIC)) == NULL)
-+                      goto out;
-+
-+              if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
-+                      skb_pull(skb, VLAN_HLEN);
-+                      (skb)->nh.raw += VLAN_HLEN;
-+              }
-+              return br_nf_pre_routing_ipv6(hook, skb, in, out, okfn);
-+      }
-+
-+#ifdef CONFIG_SYSCTL
-+      if (!brnf_call_iptables)
-+              return NF_ACCEPT;
-+#endif
-+
-+      if (skb->protocol != __constant_htons(ETH_P_IP) && !IS_VLAN_IP)
-+              return NF_ACCEPT;
-+      if ((skb = skb_share_check(*pskb, GFP_ATOMIC)) == NULL)
-+              goto out;
-+ 
-+      if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
-+              skb_pull(skb, VLAN_HLEN);
-+              (skb)->nh.raw += VLAN_HLEN;
-+      }
-+
-+      if (!pskb_may_pull(skb, sizeof(struct iphdr)))
-+              goto inhdr_error;
-+
-+      iph = skb->nh.iph;
-+      if (iph->ihl < 5 || iph->version != 4)
-+              goto inhdr_error;
-+
-+      if (!pskb_may_pull(skb, 4*iph->ihl))
-+              goto inhdr_error;
-+
-+      iph = skb->nh.iph;
-+      if (ip_fast_csum((__u8 *)iph, iph->ihl) != 0)
-+              goto inhdr_error;
-+
-+      len = ntohs(iph->tot_len);
-+      if (skb->len < len || len < 4*iph->ihl)
-+              goto inhdr_error;
-+
-+      if (skb->len > len) {
-+              __pskb_trim(skb, len);
-+              if (skb->ip_summed == CHECKSUM_HW)
-+                      skb->ip_summed = CHECKSUM_NONE;
-+      }
-+
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug ^= (1 << NF_IP_PRE_ROUTING);
-+#endif
-+      if ((nf_bridge = nf_bridge_alloc(skb)) == NULL)
-+              return NF_DROP;
-+
-+      setup_pre_routing(skb);
-+      store_orig_dstaddr(skb);
-+
-+      NF_HOOK(PF_INET, NF_IP_PRE_ROUTING, skb, skb->dev, NULL,
-+              br_nf_pre_routing_finish);
-+
-+      return NF_STOLEN;
-+
-+inhdr_error:
-+//    IP_INC_STATS_BH(IpInHdrErrors);
-+out:
-+      return NF_DROP;
-+}
-+
-+
-+/* PF_BRIDGE/LOCAL_IN ************************************************/
-+/* The packet is locally destined, which requires a real
-+ * dst_entry, so detach the fake one.  On the way up, the
-+ * packet would pass through PRE_ROUTING again (which already
-+ * took place when the packet entered the bridge), but we
-+ * register an IPv4 PRE_ROUTING 'sabotage' hook that will
-+ * prevent this from happening.
-+ */
-+static unsigned int br_nf_local_in(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   int (*okfn)(struct sk_buff *))
-+{
-+      struct sk_buff *skb = *pskb;
-+
-+      if (skb->dst == (struct dst_entry *)&__fake_rtable) {
-+              dst_release(skb->dst);
-+              skb->dst = NULL;
-+      }
-+
-+      return NF_ACCEPT;
-+}
-+
-+/* PF_BRIDGE/FORWARD *************************************************/
-+static int br_nf_forward_finish(struct sk_buff *skb)
-+{
-+      struct nf_bridge_info *nf_bridge = skb->nf_bridge;
-+      struct net_device *in;
-+/*    struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)(skb->mac.ethernet);*/
-+
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug ^= (1 << NF_BR_FORWARD);
-+#endif
-+
-+/*    if (skb->protocol != __constant_htons(ETH_P_ARP) && !IS_VLAN_ARP) {*/
-+              in = nf_bridge->physindev;
-+              if (nf_bridge->mask & BRNF_PKT_TYPE) {
-+                      skb->pkt_type = PACKET_OTHERHOST;
-+                      nf_bridge->mask ^= BRNF_PKT_TYPE;
-+              }
-+/*    } else {
-+              in = *((struct net_device **)(skb->cb));
-+      }*/
-+      if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
-+              skb_push(skb, VLAN_HLEN);
-+              skb->nh.raw -= VLAN_HLEN;
-+      }
-+      NF_HOOK_THRESH(PF_BRIDGE, NF_BR_FORWARD, skb, in,
-+                      skb->dev, br_forward_finish, 1);
-+      return 0;
-+}
-+
-+/* This is the 'purely bridged' case.  For IP, we pass the packet to
-+ * netfilter with indev and outdev set to the bridge device,
-+ * but we are still able to filter on the 'real' indev/outdev
-+ * because of the ipt_physdev.c module. For ARP, indev and outdev are the
-+ * bridge ports.
-+ */
-+static unsigned int br_nf_forward_ip(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   int (*okfn)(struct sk_buff *))
-+{
-+      struct sk_buff *skb = *pskb;
-+      struct nf_bridge_info *nf_bridge;
-+      struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)(skb->mac.ethernet);
-+      int pf;
-+
-+      if (!skb->nf_bridge)
-+              return NF_ACCEPT;
-+
-+      if (skb->protocol == __constant_htons(ETH_P_IP) || IS_VLAN_IP)
-+              pf = PF_INET;
-+      else
-+              pf = PF_INET6;
-+
-+      if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
-+              skb_pull(*pskb, VLAN_HLEN);
-+              (*pskb)->nh.raw += VLAN_HLEN;
-+      }
-+
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug ^= (1 << NF_BR_FORWARD);
-+#endif
-+      nf_bridge = skb->nf_bridge;
-+      if (skb->pkt_type == PACKET_OTHERHOST) {
-+              skb->pkt_type = PACKET_HOST;
-+              nf_bridge->mask |= BRNF_PKT_TYPE;
-+      }
-+
-+      /* The physdev module checks on this */
-+      nf_bridge->mask |= BRNF_BRIDGED;
-+      nf_bridge->physoutdev = skb->dev;
-+
-+      NF_HOOK(pf, NF_IP_FORWARD, skb, bridge_parent(in),
-+              bridge_parent(out), br_nf_forward_finish);
-+
-+      return NF_STOLEN;
-+}
-+
-+/*
-+static unsigned int br_nf_forward_arp(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   int (*okfn)(struct sk_buff *))
-+{
-+      struct sk_buff *skb = *pskb;
-+      struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)(skb->mac.ethernet);
-+      struct net_device **d = (struct net_device **)(skb->cb);
-+
-+      if (!brnf_call_arptables)
-+              return NF_ACCEPT;
-+
-+      if (skb->protocol != __constant_htons(ETH_P_ARP)) {
-+              if (!IS_VLAN_ARP)
-+                      return NF_ACCEPT;
-+              skb_pull(*pskb, VLAN_HLEN);
-+              (*pskb)->nh.raw += VLAN_HLEN;
-+      }
-+
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug ^= (1 << NF_BR_FORWARD);
-+#endif
-+
-+      if (skb->nh.arph->ar_pln != 4) {
-+              if (IS_VLAN_ARP) {
-+                      skb_push(*pskb, VLAN_HLEN);
-+                      (*pskb)->nh.raw -= VLAN_HLEN;
-+              }
-+              return NF_ACCEPT;
-+      }
-+      *d = (struct net_device *)in;
-+      NF_HOOK(NF_ARP, NF_ARP_FORWARD, skb, (struct net_device *)in,
-+              (struct net_device *)out, br_nf_forward_finish);
-+
-+      return NF_STOLEN;
-+}
-+*/
-+
-+/* PF_BRIDGE/LOCAL_OUT ***********************************************/
-+static int br_nf_local_out_finish(struct sk_buff *skb)
-+{
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      skb->nf_debug &= ~(1 << NF_BR_LOCAL_OUT);
-+#endif
-+      if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
-+              skb_push(skb, VLAN_HLEN);
-+              skb->nh.raw -= VLAN_HLEN;
-+      }
-+
-+      NF_HOOK_THRESH(PF_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev,
-+                      br_forward_finish, NF_BR_PRI_FIRST + 1);
-+
-+      return 0;
-+}
-+
-+
-+/* This function sees both locally originated IP packets and forwarded
-+ * IP packets (in both cases the destination device is a bridge
-+ * device). It also sees bridged-and-DNAT'ed packets.
-+ * To be able to filter on the physical bridge devices (with the ipt_physdev.c
-+ * module), we steal packets destined to a bridge device away from the
-+ * PF_INET/FORWARD and PF_INET/OUTPUT hook functions, and give them back later,
-+ * when we have determined the real output device. This is done in here.
-+ *
-+ * If (nf_bridge->mask & BRNF_BRIDGED_DNAT) then the packet is bridged
-+ * and we fake the PF_BRIDGE/FORWARD hook. The function br_nf_forward()
-+ * will then fake the PF_INET/FORWARD hook. br_nf_local_out() has priority
-+ * NF_BR_PRI_FIRST, so no relevant PF_BRIDGE/INPUT functions have been nor
-+ * will be executed.
-+ * Otherwise, if nf_bridge->physindev is NULL, the bridge-nf code never touched
-+ * this packet before, and so the packet was locally originated. We fake
-+ * the PF_INET/LOCAL_OUT hook.
-+ * Finally, if nf_bridge->physindev isn't NULL, then the packet was IP routed,
-+ * so we fake the PF_INET/FORWARD hook. ipv4_sabotage_out() makes sure
-+ * even routed packets that didn't arrive on a bridge interface have their
-+ * nf_bridge->physindev set.
-+ */
-+
-+static unsigned int br_nf_local_out(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   int (*okfn)(struct sk_buff *))
-+{
-+      struct net_device *realindev, *realoutdev;
-+      struct sk_buff *skb = *pskb;
-+      struct nf_bridge_info *nf_bridge;
-+      struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)(skb->mac.ethernet);
-+      int pf;
-+
-+      if (!skb->nf_bridge)
-+              return NF_ACCEPT;
-+
-+      if (skb->protocol == __constant_htons(ETH_P_IP) || IS_VLAN_IP)
-+              pf = PF_INET;
-+      else
-+              pf = PF_INET6;
-+ 
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      /* Sometimes we get packets with NULL ->dst here (for example,
-+       * running a dhcp client daemon triggers this). This should now
-+       * be fixed, but let's keep the check around. */
-+      if (skb->dst == NULL) {
-+              printk(KERN_CRIT "br_netfilter: skb->dst == NULL.");
-+              return NF_ACCEPT;
-+      }
-+#endif
-+
-+      nf_bridge = skb->nf_bridge;
-+      nf_bridge->physoutdev = skb->dev;
-+      realindev = nf_bridge->physindev;
-+
-+      /* Bridged, take PF_BRIDGE/FORWARD.
-+       * (see big note in front of br_nf_pre_routing_finish)
-+       */
-+      if (nf_bridge->mask & BRNF_BRIDGED_DNAT) {
-+              if (nf_bridge->mask & BRNF_PKT_TYPE) {
-+                      skb->pkt_type = PACKET_OTHERHOST;
-+                      nf_bridge->mask ^= BRNF_PKT_TYPE;
-+              }
-+              if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
-+                      skb_push(skb, VLAN_HLEN);
-+                      skb->nh.raw -= VLAN_HLEN;
-+              }
-+
-+              NF_HOOK(PF_BRIDGE, NF_BR_FORWARD, skb, realindev,
-+                      skb->dev, br_forward_finish);
-+              goto out;
-+      }
-+      realoutdev = bridge_parent(skb->dev);
-+
-+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
-+      /* iptables should match -o br0.x */
-+      if (nf_bridge->netoutdev)
-+              realoutdev = nf_bridge->netoutdev;
-+#endif
-+      if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
-+              skb_pull(skb, VLAN_HLEN);
-+              (*pskb)->nh.raw += VLAN_HLEN;
-+      }
-+      /* IP forwarded traffic has a physindev, locally
-+       * generated traffic hasn't.
-+       */
-+      if (realindev != NULL) {
-+              if (((nf_bridge->mask & BRNF_DONT_TAKE_PARENT) == 0) &&
-+                  has_bridge_parent(realindev))
-+                      realindev = bridge_parent(realindev);
-+              NF_HOOK_THRESH(pf, NF_IP_FORWARD, skb, realindev,
-+                             realoutdev, okfn,
-+                             NF_IP_PRI_BRIDGE_SABOTAGE_FORWARD + 1);
-+      } else {
-+#ifdef CONFIG_NETFILTER_DEBUG
-+              skb->nf_debug ^= (1 << NF_IP_LOCAL_OUT);
-+#endif
-+
-+              NF_HOOK_THRESH(pf, NF_IP_LOCAL_OUT, skb, realindev,
-+                             realoutdev, okfn,
-+                             NF_IP_PRI_BRIDGE_SABOTAGE_LOCAL_OUT + 1);
-+      }
-+
-+out:
-+      return NF_STOLEN;
-+}
-+
-+
-+/* PF_BRIDGE/POST_ROUTING ********************************************/
-+static unsigned int br_nf_post_routing(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   int (*okfn)(struct sk_buff *))
-+{
-+      struct sk_buff *skb = *pskb;
-+      struct nf_bridge_info *nf_bridge = (*pskb)->nf_bridge;
-+      struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)(skb->mac.ethernet);
-+      struct net_device *realoutdev = bridge_parent(skb->dev);
-+      int pf;
-+
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      /* Be very paranoid. This probably won't happen anymore, but let's
-+       * keep the check just to be sure... */
-+      if (skb->mac.raw < skb->head || skb->mac.raw + ETH_HLEN > skb->data) {
-+              printk(KERN_CRIT "br_netfilter: Argh!! br_nf_post_routing: "
-+                               "bad mac.raw pointer.");
-+              goto print_error;
-+      }
-+#endif
-+
-+      if (!nf_bridge)
-+              return NF_ACCEPT;
-+
-+      if (skb->protocol == __constant_htons(ETH_P_IP) || IS_VLAN_IP)
-+              pf = PF_INET;
-+      else
-+              pf = PF_INET6;
-+
-+      /* Sometimes we get packets with NULL ->dst here (for example,
-+       * running a dhcp client daemon triggers this).
-+       */
-+      if (skb->dst == NULL)
-+              return NF_ACCEPT;
-+
-+#ifdef CONFIG_NETFILTER_DEBUG
-+      /* Sometimes we get packets with NULL ->dst here (for example,
-+       * running a dhcp client daemon triggers this). This should now
-+       * be fixed, but let's keep the check around.
-+       */
-+      if (skb->dst == NULL) {
-+              printk(KERN_CRIT "br_netfilter: skb->dst == NULL.");
-+              goto print_error;
-+      }
-+
-+      skb->nf_debug ^= (1 << NF_IP_POST_ROUTING);
-+#endif
-+
-+      /* We assume any code from br_dev_queue_push_xmit onwards doesn't care
-+       * about the value of skb->pkt_type.
-+       */
-+      if (skb->pkt_type == PACKET_OTHERHOST) {
-+              skb->pkt_type = PACKET_HOST;
-+              nf_bridge->mask |= BRNF_PKT_TYPE;
-+      }
-+
-+      if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
-+              skb_pull(skb, VLAN_HLEN);
-+              skb->nh.raw += VLAN_HLEN;
-+      }
-+
-+      nf_bridge_save_header(skb);
-+
-+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
-+      if (nf_bridge->netoutdev)
-+              realoutdev = nf_bridge->netoutdev;
-+#endif
-+      NF_HOOK(pf, NF_IP_POST_ROUTING, skb, NULL,
-+              realoutdev, br_dev_queue_push_xmit);
-+
-+      return NF_STOLEN;
-+
-+#ifdef CONFIG_NETFILTER_DEBUG
-+print_error:
-+      if (skb->dev != NULL) {
-+              printk("[%s]", skb->dev->name);
-+              if (has_bridge_parent(skb->dev))
-+                      printk("[%s]", bridge_parent(skb->dev)->name);
-+      }
-+      printk(" head:%p, raw:%p, data:%p\n", skb->head, skb->mac.raw,
-+                                            skb->data);
-+      return NF_ACCEPT;
-+#endif
-+}
-+
-+
-+/* IPv4/SABOTAGE *****************************************************/
-+
-+/* Don't hand locally destined packets to PF_INET/PRE_ROUTING
-+ * for the second time.
-+ */
-+static unsigned int ip_sabotage_in(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   int (*okfn)(struct sk_buff *))
-+{
-+      if ((*pskb)->nf_bridge &&
-+          !((*pskb)->nf_bridge->mask & BRNF_NF_BRIDGE_PREROUTING)) {
-+              return NF_STOP;
-+      }
-+
-+      return NF_ACCEPT;
-+}
-+
-+/* Postpone execution of PF_INET/FORWARD, PF_INET/LOCAL_OUT
-+ * and PF_INET/POST_ROUTING until we have done the forwarding
-+ * decision in the bridge code and have determined skb->physoutdev.
-+ */
-+static unsigned int ip_sabotage_out(unsigned int hook, struct sk_buff **pskb,
-+   const struct net_device *in, const struct net_device *out,
-+   int (*okfn)(struct sk_buff *))
-+{
-+      struct sk_buff *skb = *pskb;
-+
-+      if ((out->hard_start_xmit == br_dev_xmit &&
-+          okfn != br_nf_forward_finish &&
-+          okfn != br_nf_local_out_finish &&
-+          okfn != br_dev_queue_push_xmit)
-+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
-+          || ((out->priv_flags & IFF_802_1Q_VLAN) &&
-+          VLAN_DEV_INFO(out)->real_dev->hard_start_xmit == br_dev_xmit)
-+#endif
-+          ) {
-+              struct nf_bridge_info *nf_bridge;
-+
-+              if (!skb->nf_bridge) {
-+#ifdef CONFIG_SYSCTL
-+                      /* This code is executed while in the IP(v6) stack,
-+                         the version should be 4 or 6. We can't use
-+                         skb->protocol because that isn't set on
-+                         PF_INET(6)/LOCAL_OUT. */
-+                      struct iphdr *ip = skb->nh.iph;
-+
-+                      if (ip->version == 4 && !brnf_call_iptables)
-+                              return NF_ACCEPT;
-+                      else if (ip->version == 6 && !brnf_call_ip6tables)
-+                              return NF_ACCEPT;
-+#endif
-+                      if (hook == NF_IP_POST_ROUTING)
-+                              return NF_ACCEPT;
-+                      if (!nf_bridge_alloc(skb))
-+                              return NF_DROP;
-+              }
-+
-+              nf_bridge = skb->nf_bridge;
-+
-+              /* This frame will arrive on PF_BRIDGE/LOCAL_OUT and we
-+               * will need the indev then. For a brouter, the real indev
-+               * can be a bridge port, so we make sure br_nf_local_out()
-+               * doesn't use the bridge parent of the indev by using
-+               * the BRNF_DONT_TAKE_PARENT mask.
-+               */
-+              if (hook == NF_IP_FORWARD && nf_bridge->physindev == NULL) {
-+                      nf_bridge->mask &= BRNF_DONT_TAKE_PARENT;
-+                      nf_bridge->physindev = (struct net_device *)in;
-+              }
-+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
-+              /* the iptables outdev is br0.x, not br0 */
-+              if (out->priv_flags & IFF_802_1Q_VLAN)
-+                      nf_bridge->netoutdev = (struct net_device *)out;
-+#endif
-+              return NF_STOP;
-+      }
-+
-+      return NF_ACCEPT;
-+}
-+
-+/* For br_nf_local_out we need (prio = NF_BR_PRI_FIRST), to insure that innocent
-+ * PF_BRIDGE/NF_BR_LOCAL_OUT functions don't get bridged traffic as input.
-+ * For br_nf_post_routing, we need (prio = NF_BR_PRI_LAST), because
-+ * ip_refrag() can return NF_STOLEN.
-+ */
-+static struct nf_hook_ops br_nf_ops[] = {
-+      { .hook = br_nf_pre_routing, 
-+        .pf = PF_BRIDGE, 
-+        .hooknum = NF_BR_PRE_ROUTING, 
-+        .priority = NF_BR_PRI_BRNF, },
-+      { .hook = br_nf_local_in,
-+        .pf = PF_BRIDGE,
-+        .hooknum = NF_BR_LOCAL_IN,
-+        .priority = NF_BR_PRI_BRNF, },
-+      { .hook = br_nf_forward_ip,
-+        .pf = PF_BRIDGE,
-+        .hooknum = NF_BR_FORWARD,
-+        .priority = NF_BR_PRI_BRNF /*- 1*/, },
-+/*    { .hook = br_nf_forward_arp,
-+        .pf = PF_BRIDGE,
-+        .hooknum = NF_BR_FORWARD,
-+        .priority = NF_BR_PRI_BRNF, },*/
-+      { .hook = br_nf_local_out,
-+        .pf = PF_BRIDGE,
-+        .hooknum = NF_BR_LOCAL_OUT,
-+        .priority = NF_BR_PRI_FIRST, },
-+      { .hook = br_nf_post_routing,
-+        .pf = PF_BRIDGE,
-+        .hooknum = NF_BR_POST_ROUTING,
-+        .priority = NF_BR_PRI_LAST, },
-+      { .hook = ip_sabotage_in,
-+        .pf = PF_INET,
-+        .hooknum = NF_IP_PRE_ROUTING,
-+        .priority = NF_IP_PRI_FIRST, },
-+      { .hook = ip_sabotage_in,
-+        .pf = PF_INET6,
-+        .hooknum = NF_IP6_PRE_ROUTING,
-+        .priority = NF_IP6_PRI_FIRST, },
-+      { .hook = ip_sabotage_out,
-+        .pf = PF_INET,
-+        .hooknum = NF_IP_FORWARD,
-+        .priority = NF_IP_PRI_BRIDGE_SABOTAGE_FORWARD, },
-+      { .hook = ip_sabotage_out,
-+        .pf = PF_INET6,
-+        .hooknum = NF_IP6_FORWARD,
-+        .priority = NF_IP6_PRI_BRIDGE_SABOTAGE_FORWARD, },
-+      { .hook = ip_sabotage_out,
-+        .pf = PF_INET,
-+        .hooknum = NF_IP_LOCAL_OUT,
-+        .priority = NF_IP_PRI_BRIDGE_SABOTAGE_LOCAL_OUT, },
-+      { .hook = ip_sabotage_out,
-+        .pf = PF_INET6,
-+        .hooknum = NF_IP6_LOCAL_OUT,
-+        .priority = NF_IP6_PRI_BRIDGE_SABOTAGE_LOCAL_OUT, },
-+      { .hook = ip_sabotage_out,
-+        .pf = PF_INET,
-+        .hooknum = NF_IP_POST_ROUTING,
-+        .priority = NF_IP_PRI_FIRST, },
-+      { .hook = ip_sabotage_out,
-+        .pf = PF_INET6,
-+        .hooknum = NF_IP6_POST_ROUTING,
-+        .priority = NF_IP6_PRI_FIRST, },
-+};
-+
-+#ifdef CONFIG_SYSCTL
-+static
-+int brnf_sysctl_call_tables(ctl_table *ctl, int write, struct file * filp,
-+                      void *buffer, size_t *lenp)
-+{
-+      int ret;
-+
-+      ret = proc_dointvec(ctl, write, filp, buffer, lenp);
-+
-+      if (write && *(int *)(ctl->data))
-+              *(int *)(ctl->data) = 1;
-+      return ret;
-+}
-+
-+static ctl_table brnf_table[] = {
-+      {
-+              .ctl_name       = NET_BRIDGE_NF_CALL_ARPTABLES,
-+              .procname       = "bridge-nf-call-arptables",
-+              .data           = &brnf_call_arptables,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0644,
-+              .proc_handler   = &brnf_sysctl_call_tables,
-+      },
-+      {
-+              .ctl_name       = NET_BRIDGE_NF_CALL_IPTABLES,
-+              .procname       = "bridge-nf-call-iptables",
-+              .data           = &brnf_call_iptables,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0644,
-+              .proc_handler   = &brnf_sysctl_call_tables,
-+      },
-+      {
-+              .ctl_name       = NET_BRIDGE_NF_CALL_IP6TABLES,
-+              .procname       = "bridge-nf-call-ip6tables",
-+              .data           = &brnf_call_ip6tables,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0644,
-+              .proc_handler   = &brnf_sysctl_call_tables,
-+      },
-+      {
-+              .ctl_name       = NET_BRIDGE_NF_FILTER_VLAN_TAGGED,
-+              .procname       = "bridge-nf-filter-vlan-tagged",
-+              .data           = &brnf_filter_vlan_tagged,
-+              .maxlen         = sizeof(int),
-+              .mode           = 0644,
-+              .proc_handler   = &brnf_sysctl_call_tables,
-+      },
-+      { .ctl_name = 0 }
-+};
-+
-+static ctl_table brnf_bridge_table[] = {
-+      {
-+              .ctl_name       = NET_BRIDGE,
-+              .procname       = "bridge",
-+              .mode           = 0555,
-+              .child          = brnf_table,
-+      },
-+      { .ctl_name = 0 }
-+};
-+
-+static ctl_table brnf_net_table[] = {
-+      {
-+              .ctl_name       = CTL_NET,
-+              .procname       = "net",
-+              .mode           = 0555,
-+              .child          = brnf_bridge_table,
-+      },
-+      { .ctl_name = 0 }
-+};
-+#endif
-+
-+int br_netfilter_init(void)
-+{
-+      int i;
-+
-+      for (i = 0; i < ARRAY_SIZE(br_nf_ops); i++) {
-+              int ret;
-+
-+              if ((ret = nf_register_hook(&br_nf_ops[i])) >= 0)
-+                      continue;
-+
-+              while (i--)
-+                      nf_unregister_hook(&br_nf_ops[i]);
-+
-+              return ret;
-+      }
-+
-+#ifdef CONFIG_SYSCTL
-+      brnf_sysctl_header = register_sysctl_table(brnf_net_table, 0);
-+      if (brnf_sysctl_header == NULL) {
-+              printk(KERN_WARNING "br_netfilter: can't register to sysctl.\n");
-+              for (i = 0; i < ARRAY_SIZE(br_nf_ops); i++)
-+                      nf_unregister_hook(&br_nf_ops[i]);
-+              return -EFAULT;
-+      }
-+#endif
-+
-+      printk(KERN_NOTICE "Bridge firewalling registered\n");
-+
-+      return 0;
-+}
-+
-+void br_netfilter_fini(void)
-+{
-+      int i;
-+
-+      for (i = ARRAY_SIZE(br_nf_ops) - 1; i >= 0; i--)
-+              nf_unregister_hook(&br_nf_ops[i]);
-+#ifdef CONFIG_SYSCTL
-+      unregister_sysctl_table(brnf_sysctl_header);
-+#endif
-+
-+}
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/net/ipv4/netfilter/ipt_physdev.c     2005-03-14 00:00:30.000000000 +0100
-@@ -0,0 +1,127 @@
-+/* Kernel module to match the bridge port in and
-+ * out device for IP packets coming into contact with a bridge. */
-+#include <linux/module.h>
-+#include <linux/skbuff.h>
-+#include <linux/netfilter_ipv4/ipt_physdev.h>
-+#include <linux/netfilter_ipv4/ip_tables.h>
-+#include <linux/netfilter_bridge.h>
-+#include <linux/netdevice.h>
-+#define MATCH   1
-+#define NOMATCH 0
-+
-+static int
-+match(const struct sk_buff *skb,
-+      const struct net_device *in,
-+      const struct net_device *out,
-+      const void *matchinfo,
-+      int offset,
-+      const void *hdr,
-+      u_int16_t datalen,
-+      int *hotdrop)
-+{
-+      int i;
-+      static const char nulldevname[IFNAMSIZ] = { 0 };
-+      const struct ipt_physdev_info *info = matchinfo;
-+      unsigned long ret;
-+      const char *indev, *outdev;
-+      struct nf_bridge_info *nf_bridge;
-+
-+      /* Not a bridged IP packet or no info available yet:
-+       * LOCAL_OUT/mangle and LOCAL_OUT/nat don't know if
-+       * the destination device will be a bridge. */
-+      if (!(nf_bridge = skb->nf_bridge)) {
-+              /* Return MATCH if the invert flags of the used options are on */
-+              if ((info->bitmask & IPT_PHYSDEV_OP_BRIDGED) &&
-+                  !(info->invert & IPT_PHYSDEV_OP_BRIDGED))
-+                      return NOMATCH;
-+              if ((info->bitmask & IPT_PHYSDEV_OP_ISIN) &&
-+                  !(info->invert & IPT_PHYSDEV_OP_ISIN))
-+                      return NOMATCH;
-+              if ((info->bitmask & IPT_PHYSDEV_OP_ISOUT) &&
-+                  !(info->invert & IPT_PHYSDEV_OP_ISOUT))
-+                      return NOMATCH;
-+              if ((info->bitmask & IPT_PHYSDEV_OP_IN) &&
-+                  !(info->invert & IPT_PHYSDEV_OP_IN))
-+                      return NOMATCH;
-+              if ((info->bitmask & IPT_PHYSDEV_OP_OUT) &&
-+                  !(info->invert & IPT_PHYSDEV_OP_OUT))
-+                      return NOMATCH;
-+              return MATCH;
-+      }
-+
-+      /* This only makes sense in the FORWARD and POSTROUTING chains */
-+      if ((info->bitmask & IPT_PHYSDEV_OP_BRIDGED) &&
-+          (!!(nf_bridge->mask & BRNF_BRIDGED) ^
-+          !(info->invert & IPT_PHYSDEV_OP_BRIDGED)))
-+              return NOMATCH;
-+
-+      if ((info->bitmask & IPT_PHYSDEV_OP_ISIN &&
-+          (!nf_bridge->physindev ^ !!(info->invert & IPT_PHYSDEV_OP_ISIN))) ||
-+          (info->bitmask & IPT_PHYSDEV_OP_ISOUT &&
-+          (!nf_bridge->physoutdev ^ !!(info->invert & IPT_PHYSDEV_OP_ISOUT))))
-+              return NOMATCH;
-+
-+      if (!(info->bitmask & IPT_PHYSDEV_OP_IN))
-+              goto match_outdev;
-+      indev = nf_bridge->physindev ? nf_bridge->physindev->name : nulldevname;
-+      for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) {
-+              ret |= (((const unsigned long *)indev)[i]
-+                      ^ ((const unsigned long *)info->physindev)[i])
-+                      & ((const unsigned long *)info->in_mask)[i];
-+      }
-+
-+      if ((ret == 0) ^ !(info->invert & IPT_PHYSDEV_OP_IN))
-+              return NOMATCH;
-+
-+match_outdev:
-+      if (!(info->bitmask & IPT_PHYSDEV_OP_OUT))
-+              return MATCH;
-+      outdev = nf_bridge->physoutdev ?
-+               nf_bridge->physoutdev->name : nulldevname;
-+      for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) {
-+              ret |= (((const unsigned long *)outdev)[i]
-+                      ^ ((const unsigned long *)info->physoutdev)[i])
-+                      & ((const unsigned long *)info->out_mask)[i];
-+      }
-+
-+      return (ret != 0) ^ !(info->invert & IPT_PHYSDEV_OP_OUT);
-+}
-+
-+static int
-+checkentry(const char *tablename,
-+                     const struct ipt_ip *ip,
-+                     void *matchinfo,
-+                     unsigned int matchsize,
-+                     unsigned int hook_mask)
-+{
-+      const struct ipt_physdev_info *info = matchinfo;
-+
-+      if (matchsize != IPT_ALIGN(sizeof(struct ipt_physdev_info)))
-+              return 0;
-+      if (!(info->bitmask & IPT_PHYSDEV_OP_MASK) ||
-+          info->bitmask & ~IPT_PHYSDEV_OP_MASK)
-+              return 0;
-+      return 1;
-+}
-+
-+static struct ipt_match physdev_match = {
-+      .name           = "physdev",
-+      .match          = &match,
-+      .checkentry     = &checkentry,
-+      .me             = THIS_MODULE,
-+};
-+
-+static int __init init(void)
-+{
-+      return ipt_register_match(&physdev_match);
-+}
-+
-+static void __exit fini(void)
-+{
-+      ipt_unregister_match(&physdev_match);
-+}
-+
-+module_init(init);
-+module_exit(fini);
-+MODULE_LICENSE("GPL");
-+EXPORT_NO_SYMBOLS;
---- /dev/null  2005-03-14 20:10:29.001600248 +0100
-+++ linux-2.4.29-ebt-brnf/include/linux/netfilter_ipv4/ipt_physdev.h   2005-03-14 21:24:30.000000000 +0100
-@@ -0,0 +1,24 @@
-+#ifndef _IPT_PHYSDEV_H
-+#define _IPT_PHYSDEV_H
-+
-+#ifdef __KERNEL__
-+#include <linux/if.h>
-+#endif
-+
-+#define IPT_PHYSDEV_OP_IN             0x01
-+#define IPT_PHYSDEV_OP_OUT            0x02
-+#define IPT_PHYSDEV_OP_BRIDGED                0x04
-+#define IPT_PHYSDEV_OP_ISIN           0x08
-+#define IPT_PHYSDEV_OP_ISOUT          0x10
-+#define IPT_PHYSDEV_OP_MASK           (0x20 - 1)
-+
-+struct ipt_physdev_info {
-+      char physindev[IFNAMSIZ];
-+      char in_mask[IFNAMSIZ];
-+      char physoutdev[IFNAMSIZ];
-+      char out_mask[IFNAMSIZ];
-+      u_int8_t invert;
-+      u_int8_t bitmask;
-+};
-+
-+#endif /*_IPT_PHYSDEV_H*/
---- linux-2.4.29/net/8021q/vlan_dev.c  2005-01-19 15:10:13.000000000 +0100
-+++ linux-2.4.29-ebt-brnf/net/8021q/vlan_dev.c 2005-03-14 00:00:30.000000000 +0100
-@@ -488,6 +488,10 @@ int vlan_dev_hard_start_xmit(struct sk_b
-       stats->tx_packets++; /* for statics only */
-       stats->tx_bytes += skb->len;
-+      skb->protocol = __constant_htons(ETH_P_8021Q);
-+      skb->mac.raw -= VLAN_HLEN;
-+      skb->nh.raw -= VLAN_HLEN;
-+
-       skb->dev = VLAN_DEV_INFO(dev)->real_dev;
-       dev_queue_xmit(skb);
---- linux-2.4.29/include/linux/sysctl.h        2005-01-19 15:10:13.000000000 +0100
-+++ linux-2.4.29-ebt-brnf/include/linux/sysctl.h       2005-03-14 21:07:18.000000000 +0100
-@@ -608,6 +608,15 @@ enum {
-       NET_DECNET_CONF_DEV_STATE = 7
- };
-+/* /proc/sys/net/bridge */
-+enum {
-+      NET_BRIDGE_NF_CALL_ARPTABLES = 1,
-+      NET_BRIDGE_NF_CALL_IPTABLES = 2,
-+      NET_BRIDGE_NF_CALL_IP6TABLES = 3,
-+      NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4,
-+};
-+
-+
- /* CTL_PROC names: */
- /* CTL_FS names: */
---- linux-2.4.29/net/ipv4/netfilter/ipt_REJECT.c       2005-01-19 15:10:13.000000000 +0100
-+++ linux-2.4.29-ebt-brnf/net/ipv4/netfilter/ipt_REJECT.c      2005-03-14 00:00:30.000000000 +0100
-@@ -15,6 +15,9 @@
- #include <net/route.h>
- #include <linux/netfilter_ipv4/ip_tables.h>
- #include <linux/netfilter_ipv4/ipt_REJECT.h>
-+#ifdef CONFIG_BRIDGE_NETFILTER
-+#include <linux/netfilter_bridge.h>
-+#endif
- #if 0
- #define DEBUGP printk
-@@ -29,7 +32,13 @@ static inline struct rtable *route_rever
-       struct rt_key key = {};
-       struct rtable *rt;
--      if (hook != NF_IP_FORWARD) {
-+      /* We don't require ip forwarding to be enabled to be able to
-+       * send a RST reply for bridged traffic. */
-+      if (hook != NF_IP_FORWARD
-+#ifdef CONFIG_BRIDGE_NETFILTER
-+          || (skb->nf_bridge && skb->nf_bridge->mask & BRNF_BRIDGED)
-+#endif
-+         ) {
-               key.dst = iph->saddr;
-               if (hook == NF_IP_LOCAL_IN)
-                       key.src = iph->daddr;
diff --git a/openwrt/target/linux/linux-2.4/patches/generic/111-bridging_performance.patch b/openwrt/target/linux/linux-2.4/patches/generic/111-bridging_performance.patch
new file mode 100644 (file)
index 0000000..c5d8634
--- /dev/null
@@ -0,0 +1,22 @@
+--- linux.old/net/core/dev.c   2005-07-05 16:42:36.000000000 +0200
++++ linux.dev/net/core/dev.c   2005-07-08 19:32:46.000000000 +0200
+@@ -1289,6 +1289,19 @@
+       local_irq_save(flags);
+       netdev_rx_stat[this_cpu].total++;
++
++#ifdef CONFIG_BRIDGE
++      /* Optimisation for framebursting (allow interleaving of pkts by
++       * immediately processing the rx pkt instead of Qing the pkt and deferring
++       * the processing). Only optimise for bridging and guard against non
++       * TASKLET based netif_rx calls.
++       */
++      if (!in_irq() && (skb->dev->br_port != NULL) && br_handle_frame_hook != NULL) {
++              local_irq_restore(flags);
++              return netif_receive_skb(skb);
++      }
++#endif                
++      
+       if (queue->input_pkt_queue.qlen <= netdev_max_backlog) {
+               if (queue->input_pkt_queue.qlen) {
+                       if (queue->throttle)
diff --git a/openwrt/target/linux/linux-2.4/patches/generic/112-netfilter_connmark.patch b/openwrt/target/linux/linux-2.4/patches/generic/112-netfilter_connmark.patch
new file mode 100644 (file)
index 0000000..154314d
--- /dev/null
@@ -0,0 +1,351 @@
+diff -urN linux.old/include/linux/netfilter_ipv4/ip_conntrack.h linux.dev/include/linux/netfilter_ipv4/ip_conntrack.h
+--- linux.old/include/linux/netfilter_ipv4/ip_conntrack.h      2005-08-20 20:02:06.619827000 +0200
++++ linux.dev/include/linux/netfilter_ipv4/ip_conntrack.h      2005-08-20 20:19:23.302029232 +0200
+@@ -226,6 +226,9 @@
+               unsigned int app_data_len;
+       } layer7;
+ #endif
++#if defined(CONFIG_IP_NF_CONNTRACK_MARK)
++      unsigned long mark;
++#endif
+ };
+ /* get master conntrack via master expectation */
+diff -urN linux.old/include/linux/netfilter_ipv4/ipt_CONNMARK.h linux.dev/include/linux/netfilter_ipv4/ipt_CONNMARK.h
+--- linux.old/include/linux/netfilter_ipv4/ipt_CONNMARK.h      1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/include/linux/netfilter_ipv4/ipt_CONNMARK.h      2005-08-20 20:19:41.058329864 +0200
+@@ -0,0 +1,25 @@
++#ifndef _IPT_CONNMARK_H_target
++#define _IPT_CONNMARK_H_target
++
++/* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com>
++ * by Henrik Nordstrom <hno@marasystems.com>
++ *
++ * 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, or
++ * (at your option) any later version.
++ */
++
++enum {
++      IPT_CONNMARK_SET = 0,
++      IPT_CONNMARK_SAVE,
++      IPT_CONNMARK_RESTORE
++};
++
++struct ipt_connmark_target_info {
++      unsigned long mark;
++      unsigned long mask;
++      u_int8_t mode;
++};
++
++#endif /*_IPT_CONNMARK_H_target*/
+diff -urN linux.old/include/linux/netfilter_ipv4/ipt_connmark.h linux.dev/include/linux/netfilter_ipv4/ipt_connmark.h
+--- linux.old/include/linux/netfilter_ipv4/ipt_connmark.h      1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/include/linux/netfilter_ipv4/ipt_connmark.h      2005-08-20 20:19:41.058329864 +0200
+@@ -0,0 +1,18 @@
++#ifndef _IPT_CONNMARK_H
++#define _IPT_CONNMARK_H
++
++/* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com>
++ * by Henrik Nordstrom <hno@marasystems.com>
++ *
++ * 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, or
++ * (at your option) any later version.
++ */
++
++struct ipt_connmark_info {
++      unsigned long mark, mask;
++      u_int8_t invert;
++};
++
++#endif /*_IPT_CONNMARK_H*/
+diff -urN linux.old/net/ipv4/netfilter/Config.in linux.dev/net/ipv4/netfilter/Config.in
+--- linux.old/net/ipv4/netfilter/Config.in     2005-08-20 20:02:09.325416000 +0200
++++ linux.dev/net/ipv4/netfilter/Config.in     2005-08-20 20:29:11.546602464 +0200
+@@ -6,7 +6,8 @@
+ tristate 'Connection tracking (required for masq/NAT)' CONFIG_IP_NF_CONNTRACK
+ if [ "$CONFIG_IP_NF_CONNTRACK" != "n" ]; then
+-  dep_tristate '  FTP protocol support' CONFIG_IP_NF_FTP $CONFIG_IP_NF_CONNTRACK
++  bool '  Connection mark tracking support' CONFIG_IP_NF_CONNTRACK_MARK
++  dep_tristate '  FTP protocol support' CONFIG_IP_NF_FTP $CONFIG_IP_NF_CONNTRACKa
+   dep_tristate '  Amanda protocol support' CONFIG_IP_NF_AMANDA $CONFIG_IP_NF_CONNTRACK
+   dep_tristate '  TFTP protocol support' CONFIG_IP_NF_TFTP $CONFIG_IP_NF_CONNTRACK
+   dep_tristate '  IRC protocol support' CONFIG_IP_NF_IRC $CONFIG_IP_NF_CONNTRACK
+@@ -42,6 +43,9 @@
+   if [ "$CONFIG_IP_NF_CONNTRACK" != "n" ]; then
+     dep_tristate '  Connection state match support' CONFIG_IP_NF_MATCH_STATE $CONFIG_IP_NF_CONNTRACK $CONFIG_IP_NF_IPTABLES 
+     dep_tristate '  Connection tracking match support' CONFIG_IP_NF_MATCH_CONNTRACK $CONFIG_IP_NF_CONNTRACK $CONFIG_IP_NF_IPTABLES 
++      if [ "$CONFIG_IP_NF_CONNTRACK_MARK" != "n" ]; then
++        dep_tristate '  Connection mark match support' CONFIG_IP_NF_MATCH_CONNMARK $CONFIG_IP_NF_IPTABLES
++      fi
+   fi
+   if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+     dep_tristate '  Unclean match support (EXPERIMENTAL)' CONFIG_IP_NF_MATCH_UNCLEAN $CONFIG_IP_NF_IPTABLES
+@@ -125,6 +129,9 @@
+  
+     dep_tristate '    MARK target support' CONFIG_IP_NF_TARGET_MARK $CONFIG_IP_NF_MANGLE
+   fi
++  if [ "$CONFIG_IP_NF_CONNTRACK_MARK" != "n" ]; then
++    dep_tristate '  CONNMARK target support' CONFIG_IP_NF_TARGET_CONNMARK $CONFIG_IP_NF_IPTABLES
++  fi
+   dep_tristate '  LOG target support' CONFIG_IP_NF_TARGET_LOG $CONFIG_IP_NF_IPTABLES
+   dep_tristate '  TTL target support' CONFIG_IP_NF_TARGET_TTL $CONFIG_IP_NF_IPTABLES
+   dep_tristate '  ULOG target support' CONFIG_IP_NF_TARGET_ULOG $CONFIG_IP_NF_IPTABLES
+diff -urN linux.old/net/ipv4/netfilter/Makefile linux.dev/net/ipv4/netfilter/Makefile
+--- linux.old/net/ipv4/netfilter/Makefile      2005-08-20 20:02:09.326416000 +0200
++++ linux.dev/net/ipv4/netfilter/Makefile      2005-08-20 20:29:54.081136232 +0200
+@@ -93,6 +93,7 @@
+ obj-$(CONFIG_IP_NF_MATCH_TTL) += ipt_ttl.o
+ obj-$(CONFIG_IP_NF_MATCH_STATE) += ipt_state.o
++obj-$(CONFIG_IP_NF_MATCH_CONNMARK) += ipt_connmark.o
+ obj-$(CONFIG_IP_NF_MATCH_CONNTRACK) += ipt_conntrack.o
+ obj-$(CONFIG_IP_NF_MATCH_UNCLEAN) += ipt_unclean.o
+ obj-$(CONFIG_IP_NF_MATCH_TCPMSS) += ipt_tcpmss.o
+@@ -110,6 +111,7 @@
+ obj-$(CONFIG_IP_NF_TARGET_REDIRECT) += ipt_REDIRECT.o
+ obj-$(CONFIG_IP_NF_NAT_SNMP_BASIC) += ip_nat_snmp_basic.o
+ obj-$(CONFIG_IP_NF_TARGET_LOG) += ipt_LOG.o
++obj-$(CONFIG_IP_NF_TARGET_CONNMARK) += ipt_CONNMARK.o
+ obj-$(CONFIG_IP_NF_TARGET_TTL) += ipt_TTL.o
+ obj-$(CONFIG_IP_NF_TARGET_ULOG) += ipt_ULOG.o
+ obj-$(CONFIG_IP_NF_TARGET_TCPMSS) += ipt_TCPMSS.o
+diff -urN linux.old/net/ipv4/netfilter/ip_conntrack_core.c linux.dev/net/ipv4/netfilter/ip_conntrack_core.c
+--- linux.old/net/ipv4/netfilter/ip_conntrack_core.c   2005-08-20 20:02:06.828795000 +0200
++++ linux.dev/net/ipv4/netfilter/ip_conntrack_core.c   2005-08-20 20:33:23.308328864 +0200
+@@ -755,6 +755,9 @@
+               __set_bit(IPS_EXPECTED_BIT, &conntrack->status);
+               conntrack->master = expected;
+               expected->sibling = conntrack;
++#ifdef CONFIG_IP_NF_CONNTRACK_MARK
++              conntrack->mark = expected->expectant->mark;
++#endif
+               LIST_DELETE(&ip_conntrack_expect_list, expected);
+               expected->expectant->expecting--;
+               nf_conntrack_get(&master_ct(conntrack)->infos[0]);
+diff -urN linux.old/net/ipv4/netfilter/ip_conntrack_standalone.c linux.dev/net/ipv4/netfilter/ip_conntrack_standalone.c
+--- linux.old/net/ipv4/netfilter/ip_conntrack_standalone.c     2005-08-20 20:02:06.583833000 +0200
++++ linux.dev/net/ipv4/netfilter/ip_conntrack_standalone.c     2005-08-20 20:32:15.364657872 +0200
+@@ -107,6 +107,9 @@
+               len += sprintf(buffer + len, "[ASSURED] ");
+       len += sprintf(buffer + len, "use=%u ",
+                      atomic_read(&conntrack->ct_general.use));
++      #if defined(CONFIG_IP_NF_CONNTRACK_MARK)
++      len += sprintf(buffer + len, "mark=%ld ", conntrack->mark);
++      #endif
+       #if defined(CONFIG_IP_NF_MATCH_LAYER7) || defined(CONFIG_IP_NF_MATCH_LAYER7_MODULE)
+       if(conntrack->layer7.app_proto)
+diff -urN linux.old/net/ipv4/netfilter/ipt_CONNMARK.c linux.dev/net/ipv4/netfilter/ipt_CONNMARK.c
+--- linux.old/net/ipv4/netfilter/ipt_CONNMARK.c        1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/net/ipv4/netfilter/ipt_CONNMARK.c        2005-08-20 20:21:28.666970864 +0200
+@@ -0,0 +1,118 @@
++/* This kernel module is used to modify the connection mark values, or
++ * to optionally restore the skb nfmark from the connection mark
++ *
++ * Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com>
++ * by Henrik Nordstrom <hno@marasystems.com>
++ *
++ * 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, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
++ */
++#include <linux/module.h>
++#include <linux/skbuff.h>
++#include <linux/ip.h>
++#include <net/checksum.h>
++
++MODULE_AUTHOR("Henrik Nordstrom <hno@marasytems.com>");
++MODULE_DESCRIPTION("IP tables CONNMARK matching module");
++MODULE_LICENSE("GPL");
++
++#include <linux/netfilter_ipv4/ip_tables.h>
++#include <linux/netfilter_ipv4/ipt_CONNMARK.h>
++#include <linux/netfilter_ipv4/ip_conntrack.h>
++
++static unsigned int
++target(struct sk_buff **pskb,
++       unsigned int hooknum,
++       const struct net_device *in,
++       const struct net_device *out,
++       const void *targinfo,
++       void *userinfo)
++{
++      const struct ipt_connmark_target_info *markinfo = targinfo;
++      unsigned long diff;
++      unsigned long nfmark;
++      unsigned long newmark;
++
++      enum ip_conntrack_info ctinfo;
++      struct ip_conntrack *ct = ip_conntrack_get((*pskb), &ctinfo);
++      if (ct) {
++          switch(markinfo->mode) {
++          case IPT_CONNMARK_SET:
++              newmark = (ct->mark & ~markinfo->mask) | markinfo->mark;
++              if (newmark != ct->mark)
++                  ct->mark = newmark;
++              break;
++          case IPT_CONNMARK_SAVE:
++              newmark = (ct->mark & ~markinfo->mask) | ((*pskb)->nfmark & markinfo->mask);
++              if (ct->mark != newmark)
++                  ct->mark = newmark;
++              break;
++          case IPT_CONNMARK_RESTORE:
++              nfmark = (*pskb)->nfmark;
++              diff = (ct->mark ^ nfmark & markinfo->mask);
++              if (diff != 0) {
++                  (*pskb)->nfmark = nfmark ^ diff;
++                  (*pskb)->nfcache |= NFC_ALTERED;
++              }
++              break;
++          }
++      }
++
++      return IPT_CONTINUE;
++}
++
++static int
++checkentry(const char *tablename,
++         const struct ipt_entry *e,
++         void *targinfo,
++         unsigned int targinfosize,
++         unsigned int hook_mask)
++{
++      struct ipt_connmark_target_info *matchinfo = targinfo;
++      if (targinfosize != IPT_ALIGN(sizeof(struct ipt_connmark_target_info))) {
++              printk(KERN_WARNING "CONNMARK: targinfosize %u != %Zu\n",
++                     targinfosize,
++                     IPT_ALIGN(sizeof(struct ipt_connmark_target_info)));
++              return 0;
++      }
++
++      if (matchinfo->mode == IPT_CONNMARK_RESTORE) {
++          if (strcmp(tablename, "mangle") != 0) {
++                  printk(KERN_WARNING "CONNMARK: restore can only be called from \"mangle\" table, not \"%s\"\n", tablename);
++                  return 0;
++          }
++      }
++
++      return 1;
++}
++
++static struct ipt_target ipt_connmark_reg = {
++      .name = "CONNMARK",
++      .target = &target,
++      .checkentry = &checkentry,
++      .me = THIS_MODULE
++};
++
++static int __init init(void)
++{
++      return ipt_register_target(&ipt_connmark_reg);
++}
++
++static void __exit fini(void)
++{
++      ipt_unregister_target(&ipt_connmark_reg);
++}
++
++module_init(init);
++module_exit(fini);
+diff -urN linux.old/net/ipv4/netfilter/ipt_connmark.c linux.dev/net/ipv4/netfilter/ipt_connmark.c
+--- linux.old/net/ipv4/netfilter/ipt_connmark.c        1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/net/ipv4/netfilter/ipt_connmark.c        2005-08-20 20:21:28.666970864 +0200
+@@ -0,0 +1,83 @@
++/* This kernel module matches connection mark values set by the
++ * CONNMARK target
++ *
++ * Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com>
++ * by Henrik Nordstrom <hno@marasystems.com>
++ *
++ * 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, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
++ */
++
++#include <linux/module.h>
++#include <linux/skbuff.h>
++
++MODULE_AUTHOR("Henrik Nordstrom <hno@marasytems.com>");
++MODULE_DESCRIPTION("IP tables connmark match module");
++MODULE_LICENSE("GPL");
++
++#include <linux/netfilter_ipv4/ip_tables.h>
++#include <linux/netfilter_ipv4/ipt_connmark.h>
++#include <linux/netfilter_ipv4/ip_conntrack.h>
++
++static int
++match(const struct sk_buff *skb,
++      const struct net_device *in,
++      const struct net_device *out,
++      const void *matchinfo,
++      int offset,
++      const void *hdr,
++      u_int16_t datalen,
++      int *hotdrop)
++{
++      const struct ipt_connmark_info *info = matchinfo;
++      enum ip_conntrack_info ctinfo;
++      struct ip_conntrack *ct = ip_conntrack_get((struct sk_buff *)skb, &ctinfo);
++      if (!ct)
++          return 0;
++
++      return ((ct->mark & info->mask) == info->mark) ^ info->invert;
++}
++
++static int
++checkentry(const char *tablename,
++         const struct ipt_ip *ip,
++         void *matchinfo,
++         unsigned int matchsize,
++         unsigned int hook_mask)
++{
++      if (matchsize != IPT_ALIGN(sizeof(struct ipt_connmark_info)))
++              return 0;
++
++      return 1;
++}
++
++static struct ipt_match connmark_match = {
++      .name = "connmark",
++      .match = &match,
++      .checkentry = &checkentry,
++      .me = THIS_MODULE
++};
++
++static int __init init(void)
++{
++      return ipt_register_match(&connmark_match);
++}
++
++static void __exit fini(void)
++{
++      ipt_unregister_match(&connmark_match);
++}
++
++module_init(init);
++module_exit(fini);
diff --git a/openwrt/target/linux/linux-2.4/patches/generic/208-usb2_fix.patch b/openwrt/target/linux/linux-2.4/patches/generic/208-usb2_fix.patch
new file mode 100644 (file)
index 0000000..f8e5be1
--- /dev/null
@@ -0,0 +1,15 @@
+diff -ur linux-2.4.30.dev/drivers/usb/host/ehci-q.c linux-tmp/drivers/usb/host/ehci-q.c
+--- linux-2.4.30.dev/drivers/usb/host/ehci-q.c 2005-01-19 15:10:07.000000000 +0100
++++ linux-tmp/drivers/usb/host/ehci-q.c        2005-03-30 05:11:12.000000000 +0200
+@@ -783,6 +765,11 @@
+               if (!(cmd & CMD_ASE)) {
+                       /* in case a clear of CMD_ASE didn't take yet */
+                       (void) handshake (&ehci->regs->status, STS_ASS, 0, 150);
++
++                      /* force async head to be valid */
++                      writel ((u32)ehci->async->qh_dma,
++                                      &ehci->regs->async_next);
++
+                       cmd |= CMD_ASE | CMD_RUN;
+                       writel (cmd, &ehci->regs->command);
+                       ehci->hcd.state = USB_STATE_RUNNING;
diff --git a/openwrt/target/linux/linux-2.4/patches/generic/209-mkdep_fix.patch b/openwrt/target/linux/linux-2.4/patches/generic/209-mkdep_fix.patch
new file mode 100644 (file)
index 0000000..c1e18a0
--- /dev/null
@@ -0,0 +1,11 @@
+--- linux.old/Rules.make       2005-08-31 00:37:34.363109288 +0200
++++ linux.dev/Rules.make       2005-08-31 13:59:20.140676296 +0200
+@@ -126,7 +126,7 @@
+ # This make dependencies quickly
+ #
+ fastdep: dummy
+-      $(TOPDIR)/scripts/mkdep $(CFLAGS) $(EXTRA_CFLAGS_nostdinc) -- $(wildcard *.[chS]) > .depend
++      find -name '*.[chS]' | xargs $(TOPDIR)/scripts/mkdep $(CFLAGS) $(EXTRA_CFLAGS_nostdinc) -- > .depend
+ ifdef ALL_SUB_DIRS
+       $(MAKE) $(patsubst %,_sfdep_%,$(ALL_SUB_DIRS)) _FASTDEP_ALL_SUB_DIRS="$(ALL_SUB_DIRS)"
+ endif
index 2b95c3c4534178af73cbd91ec2235d3313c0ced1..771e1913d84d9376fd9106e32952f3ab03a993b3 100644 (file)
@@ -1,4 +1,5 @@
 source "target/linux/package/wlcompat/Config.in"
+source "target/linux/package/madwifi/Config.in"
 source "target/linux/package/fuse/Config.in"
 source "target/linux/package/shfs/Config.in"
 source "target/linux/package/openswan/Config.in"
index fd66e5a973b0bcb2d03b090f028b579e912a3c87..292ef1473a786463d683a04e1dd643e662d8dc7d 100644 (file)
@@ -4,9 +4,11 @@ include $(TOPDIR)/rules.mk
 package-$(BR2_PACKAGE_KMOD_FUSE) += fuse
 package-$(BR2_PACKAGE_KMOD_SHFS) += shfs
 package-$(BR2_PACKAGE_KMOD_OPENSWAN) += openswan
-ifeq ($(LINUX_VERSION),2.4.30)
+package-$(BR2_PACKAGE_KMOD_MADWIFI) += madwifi
+package-y += openwrt
+
 package-$(BR2_PACKAGE_KMOD_WLCOMPAT) += wlcompat
-endif
+wlcompat-compile: openwrt-compile
 
 all: compile install
 clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m))
@@ -14,6 +16,7 @@ compile: $(patsubst %,%-compile,$(package-y) $(package-m))
 install: $(patsubst %,%-install,$(package-y))
 
 MAKEOPTS:=     BOARD="$(BOARD)" \
+               IPKG="$(IPKG)" \
                TARGET_DIR="$(TARGET_DIR)" \
                BUILD_DIR="$(BUILD_DIR)" \
                KERNEL_DIR="$(KERNEL_DIR)" \
index 8b997d6b4fe296223cc9fe698e54c00159f3b0d2..cb83c8e0bca4ca2d9fc27ca0d775431a2cfb8ac5 100644 (file)
@@ -31,7 +31,6 @@ $(PKG_BUILD_DIR)/.configured:
                touch include/config.h.in ; \
                touch configure ; \
                $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
                ./configure \
                  --target=$(GNU_TARGET_NAME) \
                  --host=$(GNU_TARGET_NAME) \
@@ -55,8 +54,8 @@ $(PKG_BUILD_DIR)/.configured:
                  --enable-shared \
                  --enable-static \
                  --enable-kernel-module \
-                 --enable-lib \
-                 --enable-util \
+                 --disable-lib \
+                 --disable-util \
                  --disable-example \
                  --disable-auto-modprobe \
                  --with-kernel=$(KERNEL_DIR) \
diff --git a/openwrt/target/linux/package/madwifi/Config.in b/openwrt/target/linux/package/madwifi/Config.in
new file mode 100644 (file)
index 0000000..cf3ec9f
--- /dev/null
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_KMOD_MADWIFI
+       prompt "kmod-madwifi - Atheros Wifi driver"
+       tristate
+       default m if CONFIG_DEVEL
+       help
+         Driver for Atheros 802.11a/b/g MiniPCI cards
diff --git a/openwrt/target/linux/package/madwifi/Makefile b/openwrt/target/linux/package/madwifi/Makefile
new file mode 100644 (file)
index 0000000..82be97a
--- /dev/null
@@ -0,0 +1,56 @@
+# $Id$
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=madwifi
+PKG_VERSION:=2005-08-13
+PKG_RELEASE:=1
+PKG_MD5SUM:=188127127aebd8815595c025a787d729
+
+PKG_SOURCE_URL:=http://madwifi.otaku42.de/2005/08/
+PKG_SOURCE:=$(PKG_NAME)-cvs-snapshot-$(PKG_VERSION).tar.bz2
+PKG_CAT:=bzcat
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+
+ifeq ($(KERNEL_DIR),)
+KERNEL_DIR:=$(LINUX_DIR)
+endif
+
+ifeq ($(ARCH),mips)
+HAL_TARGET:=mips-be-elf
+endif
+ifeq ($(ARCH),mipsel)
+HAL_TARGET:=mips-le-elf
+endif
+ifeq ($(ARCH),i386)
+HAL_TARGET:=i386-elf
+endif
+
+include $(TOPDIR)/package/rules.mk
+
+$(eval $(call PKG_template,KMOD_MADWIFI,kmod-madwifi,$(LINUX_VERSION)$(BOARD)+$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH),kernel ($(LINUX_VERSION)-$(BOARD)-$(KERNEL_RELEASE))))
+
+$(PKG_BUILD_DIR)/.configured:
+       touch $@
+
+$(PKG_BUILD_DIR)/.built:
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               TARGET="$(HAL_TARGET)" \
+               TOOLPREFIX="$(KERNEL_CROSS)" \
+               KERNELPATH="$(KERNEL_DIR)"
+       touch $@
+
+$(IPKG_KMOD_MADWIFI):
+       mkdir -p $(IDIR_KMOD_MADWIFI)/etc/modules.d
+       mkdir -p $(IDIR_KMOD_MADWIFI)/etc/init.d
+       mkdir -p $(IDIR_KMOD_MADWIFI)/lib/modules/$(LINUX_VERSION)
+       install -m0644 ./files/madwifi.modules $(IDIR_KMOD_MADWIFI)/etc/modules.d/20-madwifi
+       install -m0755 ./files/madwifi.init $(IDIR_KMOD_MADWIFI)/etc/init.d/S20madwifi
+       cp -fpR $(PKG_BUILD_DIR)/net80211/wlan*.o \
+               $(PKG_BUILD_DIR)/ath_hal/ath_hal.o \
+               $(PKG_BUILD_DIR)/ath_rate/sample/ath_rate_sample.o \
+               $(PKG_BUILD_DIR)/ath/ath_pci.o \
+               $(IDIR_KMOD_MADWIFI)/lib/modules/$(LINUX_VERSION)/
+       $(IPKG_BUILD) $(IDIR_KMOD_MADWIFI) $(PACKAGE_DIR)
+
diff --git a/openwrt/target/linux/package/madwifi/files/madwifi.init b/openwrt/target/linux/package/madwifi/files/madwifi.init
new file mode 100644 (file)
index 0000000..b1e78c0
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+iwpriv ath0 mode 3
diff --git a/openwrt/target/linux/package/madwifi/files/madwifi.modules b/openwrt/target/linux/package/madwifi/files/madwifi.modules
new file mode 100644 (file)
index 0000000..eb8ca2e
--- /dev/null
@@ -0,0 +1,9 @@
+wlan
+ath_hal
+ath_rate_sample
+ath_pci
+wlan_acl
+wlan_ccmp
+wlan_tkip
+wlan_wep
+wlan_xauth
diff --git a/openwrt/target/linux/package/madwifi/ipkg/kmod-madwifi.control b/openwrt/target/linux/package/madwifi/ipkg/kmod-madwifi.control
new file mode 100644 (file)
index 0000000..407910d
--- /dev/null
@@ -0,0 +1,6 @@
+Package: kmod-madwifi
+Priority: optional
+Section: kernel
+Maintainer: Felix Fietkau <openwrt@nbd.name>
+Source: buildroot internal
+Description: Driver for Atheros 802.11a/b/g MiniPCI cards
diff --git a/openwrt/target/linux/package/madwifi/patches/100-kernel_cflags.patch b/openwrt/target/linux/package/madwifi/patches/100-kernel_cflags.patch
new file mode 100644 (file)
index 0000000..d1be56b
--- /dev/null
@@ -0,0 +1,22 @@
+diff -urN madwifi.old/Makefile madwifi.dev/Makefile
+--- madwifi.old/Makefile       2005-07-13 02:35:11.000000000 +0200
++++ madwifi.dev/Makefile       2005-08-13 22:39:26.973649096 +0200
+@@ -46,7 +46,7 @@
+ # NB: the order is important here
+ DIRS= ${ATH_HAL} ${ATH_RATE} ${WLAN} ${ATH}
+-all: configcheck
++all:
+       mkdir -p ${SYMBOLSDIR}
+       for i in ${DIRS}; do \
+               $(MAKE) -C $$i || exit 1; \
+diff -urN madwifi.old/hal/public/mips-le-elf.inc madwifi.dev/hal/public/mips-le-elf.inc
+--- madwifi.old/hal/public/mips-le-elf.inc     2005-08-13 22:36:45.646174000 +0200
++++ madwifi.dev/hal/public/mips-le-elf.inc     2005-08-13 22:37:52.506010360 +0200
+@@ -63,5 +63,5 @@
+ LDOPTS=       -EL
+ COPTS+=       -DAH_BYTE_ORDER=AH_LITTLE_ENDIAN
+-COPTS+=       -G 0 -EL -mno-abicalls -fno-pic -mips2 -Wa,--trap \
++COPTS+=       -G 0 -EL -mno-abicalls -fno-pic -mips32 -Wa,--trap \
+       -fno-strict-aliasing -fno-common -fomit-frame-pointer -mlong-calls
diff --git a/openwrt/target/linux/package/openwrt/Makefile b/openwrt/target/linux/package/openwrt/Makefile
new file mode 100644 (file)
index 0000000..adbd786
--- /dev/null
@@ -0,0 +1,38 @@
+# $Id$
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME := base-files-arch
+PKG_RELEASE := 1
+PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
+
+include $(TOPDIR)/package/rules.mk
+
+IDIR_OPENWRT:=$(PKG_BUILD_DIR)/ipkg
+IPKG_OPENWRT:=$(PACKAGE_DIR)/base-files-$(BOARD)_$(PKG_RELEASE)_$(ARCH).ipk
+
+$(PKG_BUILD_DIR)/.prepared:
+       mkdir -p $(PKG_BUILD_DIR)
+       touch $@
+
+$(PKG_BUILD_DIR)/jffs2root: jffs2root.c
+       $(TARGET_CC) -o $@ $<
+
+$(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/jffs2root
+       touch $@
+       
+$(IPKG_OPENWRT): $(PKG_BUILD_DIR)/jffs2root
+       $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_OPENWRT) ipkg/base-files-arch.control $(PKG_RELEASE) $(ARCH)
+       $(SED) s,base-files-arch,base-files-$(BOARD),g $(IDIR_OPENWRT)/CONTROL/control
+       mkdir -p $(IDIR_OPENWRT)/sbin
+       cp $(PKG_BUILD_DIR)/jffs2root $(IDIR_OPENWRT)/sbin
+       $(RSTRIP) $(IDIR_OPENWRT)
+       $(IPKG_BUILD) $(IDIR_OPENWRT) $(PACKAGE_DIR)
+
+install: compile
+       $(IPKG) install $(IPKG_OPENWRT)
+
+compile: install-dev $(IPKG_OPENWRT)
+install-dev:
+       mkdir -p $(STAGING_DIR)/usr/include
+       cp -a ./include/* $(STAGING_DIR)/usr/include/
diff --git a/openwrt/target/linux/package/openwrt/include/bcmnvram.h b/openwrt/target/linux/package/openwrt/include/bcmnvram.h
new file mode 100644 (file)
index 0000000..3c45263
--- /dev/null
@@ -0,0 +1,148 @@
+/*
+ * NVRAM variable manipulation
+ *
+ * Copyright 2004, Broadcom Corporation
+ * All Rights Reserved.
+ * 
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
+ *
+ * $Id$
+ */
+
+#ifndef _bcmnvram_h_
+#define _bcmnvram_h_
+
+#ifndef _LANGUAGE_ASSEMBLY
+
+#include <typedefs.h>
+
+struct nvram_header {
+       uint32 magic;
+       uint32 len;
+       uint32 crc_ver_init;    /* 0:7 crc, 8:15 ver, 16:27 init, mem. test 28, 29-31 reserved */
+       uint32 config_refresh;  /* 0:15 config, 16:31 refresh */
+       uint32 config_ncdl;     /* ncdl values for memc */
+};
+
+struct nvram_tuple {
+       char *name;
+       char *value;
+       struct nvram_tuple *next;
+};
+
+/*
+ * Initialize NVRAM access. May be unnecessary or undefined on certain
+ * platforms.
+ */
+extern int nvram_init(void *sbh);
+
+/*
+ * Disable NVRAM access. May be unnecessary or undefined on certain
+ * platforms.
+ */
+extern void nvram_exit(void);
+
+/*
+ * Get the value of an NVRAM variable. The pointer returned may be
+ * invalid after a set.
+ * @param      name    name of variable to get
+ * @return     value of variable or NULL if undefined
+ */
+extern char * nvram_get(const char *name);
+
+/* 
+ * Get the value of an NVRAM variable.
+ * @param      name    name of variable to get
+ * @return     value of variable or NUL if undefined
+ */
+#define nvram_safe_get(name) (nvram_get(name) ? : "")
+
+#define nvram_safe_unset(name) ({ \
+       if(nvram_get(name)) \
+               nvram_unset(name); \
+})
+
+#define nvram_safe_set(name, value) ({ \
+       if(!nvram_get(name) || strcmp(nvram_get(name), value)) \
+               nvram_set(name, value); \
+})
+
+/*
+ * Match an NVRAM variable.
+ * @param      name    name of variable to match
+ * @param      match   value to compare against value of variable
+ * @return     TRUE if variable is defined and its value is string equal
+ *             to match or FALSE otherwise
+ */
+static INLINE int
+nvram_match(char *name, char *match) {
+       const char *value = nvram_get(name);
+       return (value && !strcmp(value, match));
+}
+
+/*
+ * Inversely match an NVRAM variable.
+ * @param      name    name of variable to match
+ * @param      match   value to compare against value of variable
+ * @return     TRUE if variable is defined and its value is not string
+ *             equal to invmatch or FALSE otherwise
+ */
+static INLINE int
+nvram_invmatch(char *name, char *invmatch) {
+       const char *value = nvram_get(name);
+       return (value && strcmp(value, invmatch));
+}
+
+/*
+ * Set the value of an NVRAM variable. The name and value strings are
+ * copied into private storage. Pointers to previously set values
+ * may become invalid. The new value may be immediately
+ * retrieved but will not be permanently stored until a commit.
+ * @param      name    name of variable to set
+ * @param      value   value of variable
+ * @return     0 on success and errno on failure
+ */
+extern int nvram_set(const char *name, const char *value);
+
+/*
+ * Unset an NVRAM variable. Pointers to previously set values
+ * remain valid until a set.
+ * @param      name    name of variable to unset
+ * @return     0 on success and errno on failure
+ * NOTE: use nvram_commit to commit this change to flash.
+ */
+extern int nvram_unset(const char *name);
+
+/*
+ * Commit NVRAM variables to permanent storage. All pointers to values
+ * may be invalid after a commit.
+ * NVRAM values are undefined after a commit.
+ * @return     0 on success and errno on failure
+ */
+extern int nvram_commit(void);
+
+/*
+ * Get all NVRAM variables (format name=value\0 ... \0\0).
+ * @param      buf     buffer to store variables
+ * @param      count   size of buffer in bytes
+ * @return     0 on success and errno on failure
+ */
+extern int nvram_getall(char *buf, int count);
+
+extern int file2nvram(char *filename, char *varname);
+extern int nvram2file(char *varname, char *filename);
+
+#endif /* _LANGUAGE_ASSEMBLY */
+
+#define NVRAM_MAGIC            0x48534C46      /* 'FLSH' */
+#define NVRAM_VERSION          1
+#define NVRAM_HEADER_SIZE      20
+#define NVRAM_SPACE            0x8000
+#define FLASH_BASE             0xbfc00000      /* Extif core */
+#define FLASH_MIN              0x00100000      /* Minimum flash size */
+#define FLASH_MAX              0x00400000      /* Maximum flash size with extif */
+
+#endif /* _bcmnvram_h_ */
diff --git a/openwrt/target/linux/package/openwrt/include/bcmutils.h b/openwrt/target/linux/package/openwrt/include/bcmutils.h
new file mode 100644 (file)
index 0000000..05ad41d
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ * Misc useful os-independent macros and functions.
+ *
+ * Copyright 2004, Broadcom Corporation
+ * All Rights Reserved.
+ * 
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
+ * $Id$
+ */
+
+#ifndef        _bcmutils_h_
+#define        _bcmutils_h_
+
+#ifndef MIN
+#define        MIN(a, b)               (((a)<(b))?(a):(b))
+#endif
+
+#ifndef MAX
+#define        MAX(a, b)               (((a)>(b))?(a):(b))
+#endif
+
+#define CEIL(x, y)             (((x) + ((y)-1)) / (y))
+#define        ROUNDUP(x, y)           ((((ulong)(x)+((y)-1))/(y))*(y))
+#define        ISALIGNED(a, x)         (((uint)(a) & ((x)-1)) == 0)
+#define        ISPOWEROF2(x)           ((((x)-1)&(x))==0)
+#define        OFFSETOF(type, member)  ((uint) &((type *)0)->member)
+#define ARRAYSIZE(a)           (sizeof(a)/sizeof(a[0]))
+
+/* bit map related macros */
+#ifndef setbit
+#define        NBBY    8       /* 8 bits per byte */
+#define        setbit(a,i)     ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
+#define        clrbit(a,i)     ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
+#define        isset(a,i)      ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
+#define        isclr(a,i)      (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
+#endif
+
+#define        NBITS(type)     (sizeof (type) * 8)
+
+#define _BCM_U 0x01    /* upper */
+#define _BCM_L 0x02    /* lower */
+#define _BCM_D 0x04    /* digit */
+#define _BCM_C 0x08    /* cntrl */
+#define _BCM_P 0x10    /* punct */
+#define _BCM_S 0x20    /* white space (space/lf/tab) */
+#define _BCM_X 0x40    /* hex digit */
+#define _BCM_SP        0x80    /* hard space (0x20) */
+
+extern unsigned char bcm_ctype[];
+#define bcm_ismask(x) (bcm_ctype[(int)(unsigned char)(x)])
+
+#define bcm_isalnum(c) ((bcm_ismask(c)&(_BCM_U|_BCM_L|_BCM_D)) != 0)
+#define bcm_isalpha(c) ((bcm_ismask(c)&(_BCM_U|_BCM_L)) != 0)
+#define bcm_iscntrl(c) ((bcm_ismask(c)&(_BCM_C)) != 0)
+#define bcm_isdigit(c) ((bcm_ismask(c)&(_BCM_D)) != 0)
+#define bcm_isgraph(c) ((bcm_ismask(c)&(_BCM_P|_BCM_U|_BCM_L|_BCM_D)) != 0)
+#define bcm_islower(c) ((bcm_ismask(c)&(_BCM_L)) != 0)
+#define bcm_isprint(c) ((bcm_ismask(c)&(_BCM_P|_BCM_U|_BCM_L|_BCM_D|_BCM_SP)) != 0)
+#define bcm_ispunct(c) ((bcm_ismask(c)&(_BCM_P)) != 0)
+#define bcm_isspace(c) ((bcm_ismask(c)&(_BCM_S)) != 0)
+#define bcm_isupper(c) ((bcm_ismask(c)&(_BCM_U)) != 0)
+#define bcm_isxdigit(c)        ((bcm_ismask(c)&(_BCM_D|_BCM_X)) != 0)
+
+/*
+ * Spin at most 'us' microseconds while 'exp' is true.
+ * Caller should explicitly test 'exp' when this completes
+ * and take appropriate error action if 'exp' is still true.
+ */
+#define SPINWAIT(exp, us) { \
+       uint countdown = (us) + 9; \
+       while ((exp) && (countdown >= 10)) {\
+               OSL_DELAY(10); \
+               countdown -= 10; \
+       } \
+}
+
+/* generic osl packet queue */
+struct pktq {
+       void *head;     /* first packet to dequeue */
+       void *tail;     /* last packet to dequeue */
+       uint len;       /* number of queued packets */
+       uint maxlen;    /* maximum number of queued packets */
+       bool priority;  /* enqueue by packet priority */
+};
+#define DEFAULT_QLEN   128
+
+#define        pktq_len(q)     ((q)->len)
+#define        pktq_avail(q)   ((q)->maxlen - (q)->len)
+#define        pktq_head(q)    ((q)->head)
+#define        pktq_full(q)    ((q)->len >= (q)->maxlen)
+
+/* crc defines */
+#define CRC8_INIT_VALUE  0xff          /* Initial CRC8 checksum value */
+#define CRC8_GOOD_VALUE  0x9f          /* Good final CRC8 checksum value */
+#define CRC16_INIT_VALUE 0xffff                /* Initial CRC16 checksum value */
+#define CRC16_GOOD_VALUE 0xf0b8                /* Good final CRC16 checksum value */
+#define CRC32_INIT_VALUE 0xffffffff    /* Initial CRC32 checksum value */
+#define CRC32_GOOD_VALUE 0xdebb20e3    /* Good final CRC32 checksum value */
+
+/* tag_ID/length/value_buffer tuple */
+typedef struct bcm_tlv {
+       uint8   id;
+       uint8   len;
+       uint8   data[1];
+} bcm_tlv_t;
+
+/* Check that bcm_tlv_t fits into the given buflen */
+#define bcm_valid_tlv(elt, buflen) ((buflen) >= 2 && (buflen) >= 2 + (elt)->len)
+
+/* buffer length for ethernet address from bcm_ether_ntoa() */
+#define ETHER_ADDR_STR_LEN     18
+
+/*
+* load 32-bit value from unaligned byte array
+*/
+#ifdef IL_BIGENDIAN
+#define load32_ua(a)   ((((uint8 *)(a))[0] << 24) + (((uint8 *)(a))[1] << 16) + \
+                       (((uint8 *)(a))[2] << 8) + ((uint8 *)(a))[3])
+#else
+#define load32_ua(a)   ((((uint8 *)(a))[3] << 24) + (((uint8 *)(a))[2] << 16) + \
+                       (((uint8 *)(a))[1] << 8) + ((uint8 *)(a))[0])
+#endif
+
+/* externs */
+extern uint bcm_atoi(char *s);
+extern uchar bcm_toupper(uchar c);
+extern ulong bcm_strtoul(char *cp, char **endp, uint base);
+extern void deadbeef(char *p, uint len);
+extern void prhex(char *msg, uchar *buf, uint len);
+extern void prpkt(char *msg, void *drv, void *p0);
+extern uint pktcopy(void *drv, void *p, uint offset, int len, uchar *buf);
+extern uint pkttotlen(void *drv, void *);
+extern uchar *bcm_ether_ntoa(char *ea, char *buf);
+extern int bcm_ether_atoe(char *p, char *ea);
+extern void bcm_mdelay(uint ms);
+extern char *getvar(char *vars, char *name);
+extern int getintvar(char *vars, char *name);
+extern char *bcmstrstr(char *haystack, char *needle);
+
+extern uint8 crc8(uint8 *p, uint nbytes, uint8 crc);
+extern uint16 crc16(uint8 *p, uint nbytes, uint16 crc);
+extern uint32 crc32(uint8 *p, uint nbytes, uint32 crc);
+extern bcm_tlv_t *bcm_next_tlv(bcm_tlv_t *elt, int *buflen);
+extern bcm_tlv_t *bcm_parse_tlvs(void *buf, int buflen, uint key);
+extern bcm_tlv_t *bcm_parse_ordered_tlvs(void *buf, int buflen, uint key);
+extern void pktq_init(struct pktq *q, uint maxlen, bool priority);
+extern bool pktenq(struct pktq *q, void *p, bool lifo);
+extern void *pktdeq(struct pktq *q);
+
+#define        bcmlog(fmt, a1, a2)
+#define        bcmdumplog(buf, size)   *buf = '\0'
+#define        bcmdumplogent(buf, idx) -1
+
+#endif /* _bcmutils_h_ */
diff --git a/openwrt/target/linux/package/openwrt/include/cy_conf.h b/openwrt/target/linux/package/openwrt/include/cy_conf.h
new file mode 100644 (file)
index 0000000..dbe387b
--- /dev/null
@@ -0,0 +1,69 @@
+
+#define        DNSMASQ_SUPPORT 1
+#define        CONFIG_DNSMASQ  y
+#define        UDHCPD_SUPPORT  1
+#define        CONFIG_UDHCPD   y
+#define        UDHCPC_SUPPORT  1
+#define        CONFIG_UDHCPC   y
+#define        PPPOE_SUPPORT   1
+#define        CONFIG_PPPOE    y
+#define        PPTP_SUPPORT    1
+#define        CONFIG_PPTP     y
+#define        L2TP_SUPPORT    1
+#define        CONFIG_L2TP     y
+#define        PPPD_SUPPORT    1
+#define        CONFIG_PPPD     y
+#define        ZEBRA_SUPPORT   1
+#define        CONFIG_ZEBRA    y
+#define        TFTPD_SUPPORT   1
+#define        CONFIG_TFTPD    y
+#define        DDNS_SUPPORT    1
+#define        CONFIG_DDNS     y
+#define        CRON_SUPPORT    1
+#define        CONFIG_CRON     y
+#define        HTTPD_SUPPORT   1
+#define        CONFIG_HTTPD    y
+#define        GET_POST_SUPPORT        1
+#define        CONFIG_GET_POST y
+
+#if 1
+#define        HEARTBEAT_SUPPORT       1
+#define        CONFIG_HEARTBEAT        y
+#define        MULTICAST_SUPPORT       1
+#define        CONFIG_MULTICAST        y
+#define        SETUP_WIZARD_SUPPORT    1
+#define        CONFIG_SETUP_WIZARD     y
+#define        PARENTAL_CONTROL_SUPPORT        1
+#define        CONFIG_PARENTAL_CONTROL y
+#define        HTTPS_SUPPORT   1
+#define        CONFIG_HTTPS    y
+#define        EOU_SUPPORT     1
+#define        CONFIG_EOU      y
+#define        EZC_SUPPORT     1
+#define        CONFIG_EZC      y
+#define        WRITE_MAC_SUPPORT       1
+#define        CONFIG_WRITE_MAC        y
+#define        DIAG_SUPPORT    1
+#define        CONFIG_DIAG     y
+#endif
+
+#define        SPEED_BOOSTER_SUPPORT   1
+#define        CONFIG_SPEED_BOOSTER    y
+#define        XBOX_SUPPORT    1
+#define        CONFIG_XBOX     y
+
+#if 0
+#define        MPPPOE_SUPPORT  1
+#define        CONFIG_MPPPOE   y
+#define        UNNUMBERIP_SUPPORT      1
+#define        CONFIG_UNNUMBERIP       y
+#endif
+
+#define        WL_STA_SUPPORT  1
+#define        CONFIG_WL_STA   y
+#define        BACKUP_RESTORE_SUPPORT  1
+#define        CONFIG_BACKUP_RESTORE   y
+#define        PORT_TRIGGER_SUPPORT    1
+#define        CONFIG_PORT_TRIGGER     y
+#define        HW_QOS_SUPPORT  1
+#define        CONFIG_HW_QOS   y
diff --git a/openwrt/target/linux/package/openwrt/include/epivers.h b/openwrt/target/linux/package/openwrt/include/epivers.h
new file mode 100644 (file)
index 0000000..e174fb5
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2004, Broadcom Corporation
+ * All Rights Reserved.
+ * 
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
+ *
+ * $Id$
+ *
+*/
+
+#ifndef _epivers_h_
+#define _epivers_h_
+
+#ifdef linux
+#include <linux/config.h>
+#endif
+
+/* Vendor Name, ASCII, 32 chars max */
+#ifdef COMPANYNAME
+#define        HPNA_VENDOR             COMPANYNAME
+#else
+#define        HPNA_VENDOR             "Broadcom Corporation"
+#endif
+
+/* Driver Date, ASCII, 32 chars max */
+#define HPNA_DRV_BUILD_DATE    __DATE__
+
+/* Hardware Manufacture Date, ASCII, 32 chars max */
+#define HPNA_HW_MFG_DATE       "Not Specified"
+
+/* See documentation for Device Type values, 32 values max */
+#ifndef        HPNA_DEV_TYPE
+
+#if    defined(CONFIG_BRCM_VJ)
+#define HPNA_DEV_TYPE          { CDCF_V0_DEVICE_DISPLAY }
+
+#elif  defined(CONFIG_BCRM_93725)
+#define HPNA_DEV_TYPE          { CDCF_V0_DEVICE_CM_BRIDGE, CDCF_V0_DEVICE_DISPLAY }
+
+#else
+#define HPNA_DEV_TYPE          { CDCF_V0_DEVICE_PCINIC }
+
+#endif
+
+#endif /* !HPNA_DEV_TYPE */
+
+
+#define        EPI_MAJOR_VERSION       3
+
+#define        EPI_MINOR_VERSION       60
+
+#define        EPI_RC_NUMBER           13
+
+#define        EPI_INCREMENTAL_NUMBER  0
+
+#define        EPI_BUILD_NUMBER        0
+
+#define        EPI_VERSION             3,60,13,0
+
+#define        EPI_VERSION_NUM         0x033c0d00
+
+/* Driver Version String, ASCII, 32 chars max */
+#define        EPI_VERSION_STR         "3.60.13.0"
+#define        EPI_ROUTER_VERSION_STR  "3.61.13.0"
+
+#endif /* _epivers_h_ */
diff --git a/openwrt/target/linux/package/openwrt/include/proto/802.11.h b/openwrt/target/linux/package/openwrt/include/proto/802.11.h
new file mode 100644 (file)
index 0000000..ea57850
--- /dev/null
@@ -0,0 +1,852 @@
+/*
+ * Copyright 2004, Broadcom Corporation      
+ * All Rights Reserved.      
+ *       
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY      
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM      
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS      
+ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.      
+ *
+ * Fundamental types and constants relating to 802.11 
+ *
+ * $Id$
+ */
+
+#ifndef _802_11_H_
+#define _802_11_H_
+
+#ifndef _TYPEDEFS_H_
+#include <typedefs.h>
+#endif
+
+#ifndef _NET_ETHERNET_H_
+#include <proto/ethernet.h>
+#endif
+
+/* enable structure packing */
+#if !defined(__GNUC__)
+#pragma pack(1)
+#endif
+
+/* some platforms require stronger medicine */
+#if defined(__GNUC__)
+#define        PACKED  __attribute__((packed))
+#else
+#define        PACKED
+#endif
+
+
+#define DOT11_TU_TO_US                 1024    /* 802.11 Time Unit is 1024 microseconds */
+
+/* Generic 802.11 frame constants */
+#define DOT11_A3_HDR_LEN               24
+#define DOT11_A4_HDR_LEN               30
+#define DOT11_MAC_HDR_LEN              DOT11_A3_HDR_LEN
+#define DOT11_FCS_LEN                  4
+#define DOT11_ICV_LEN                  4
+#define DOT11_ICV_AES_LEN              8
+#define DOT11_QOS_LEN                  2
+
+#define DOT11_KEY_INDEX_SHIFT          6
+#define DOT11_IV_LEN                   4
+#define DOT11_IV_TKIP_LEN              8
+#define DOT11_IV_AES_OCB_LEN           4
+#define DOT11_IV_AES_CCM_LEN           8
+
+/* Includes MIC */
+#define DOT11_MAX_MPDU_BODY_LEN                2304
+/* A4 header + QoS + CCMP + PDU + ICV + FCS = 2352 */
+#define DOT11_MAX_MPDU_LEN             (DOT11_A4_HDR_LEN + \
+                                        DOT11_QOS_LEN + \
+                                        DOT11_IV_AES_CCM_LEN + \
+                                        DOT11_MAX_MPDU_BODY_LEN + \
+                                        DOT11_ICV_LEN + \
+                                        DOT11_FCS_LEN)
+
+#define DOT11_MAX_SSID_LEN             32
+
+/* dot11RTSThreshold */
+#define DOT11_DEFAULT_RTS_LEN          2347
+#define DOT11_MAX_RTS_LEN              2347
+
+/* dot11FragmentationThreshold */
+#define DOT11_MIN_FRAG_LEN             256
+#define DOT11_MAX_FRAG_LEN             2346    /* Max frag is also limited by aMPDUMaxLength of the attached PHY */
+#define DOT11_DEFAULT_FRAG_LEN         2346
+
+/* dot11BeaconPeriod */
+#define DOT11_MIN_BEACON_PERIOD                1
+#define DOT11_MAX_BEACON_PERIOD                0xFFFF
+
+/* dot11DTIMPeriod */
+#define DOT11_MIN_DTIM_PERIOD          1
+#define DOT11_MAX_DTIM_PERIOD          0xFF
+
+/* 802.2 LLC/SNAP header used by 802.11 per 802.1H */
+#define DOT11_LLC_SNAP_HDR_LEN 8
+#define DOT11_OUI_LEN                  3
+struct dot11_llc_snap_header {
+       uint8   dsap;                           /* always 0xAA */
+       uint8   ssap;                           /* always 0xAA */
+       uint8   ctl;                            /* always 0x03 */
+       uint8   oui[DOT11_OUI_LEN];             /* RFC1042: 0x00 0x00 0x00
+                                                  Bridge-Tunnel: 0x00 0x00 0xF8 */
+       uint16  type;                           /* ethertype */
+} PACKED;
+
+/* RFC1042 header used by 802.11 per 802.1H */
+#define RFC1042_HDR_LEN                        (ETHER_HDR_LEN + DOT11_LLC_SNAP_HDR_LEN)
+
+/* Generic 802.11 MAC header */
+/*
+ * N.B.: This struct reflects the full 4 address 802.11 MAC header.
+ *              The fields are defined such that the shorter 1, 2, and 3
+ *              address headers just use the first k fields.
+ */
+struct dot11_header {
+       uint16                  fc;             /* frame control */
+       uint16                  durid;          /* duration/ID */
+       struct ether_addr       a1;             /* address 1 */
+       struct ether_addr       a2;             /* address 2 */
+       struct ether_addr       a3;             /* address 3 */
+       uint16                  seq;            /* sequence control */
+       struct ether_addr       a4;             /* address 4 */
+} PACKED;
+
+/* Control frames */
+
+struct dot11_rts_frame {
+       uint16                  fc;             /* frame control */
+       uint16                  durid;          /* duration/ID */
+       struct ether_addr       ra;             /* receiver address */
+       struct ether_addr       ta;             /* transmitter address */
+} PACKED;
+#define        DOT11_RTS_LEN           16
+
+struct dot11_cts_frame {
+       uint16                  fc;             /* frame control */
+       uint16                  durid;          /* duration/ID */
+       struct ether_addr       ra;             /* receiver address */
+} PACKED;
+#define        DOT11_CTS_LEN           10
+
+struct dot11_ack_frame {
+       uint16                  fc;             /* frame control */
+       uint16                  durid;          /* duration/ID */
+       struct ether_addr       ra;             /* receiver address */
+} PACKED;
+#define        DOT11_ACK_LEN           10
+
+struct dot11_ps_poll_frame {
+       uint16                  fc;             /* frame control */
+       uint16                  durid;          /* AID */
+       struct ether_addr       bssid;          /* receiver address, STA in AP */
+       struct ether_addr       ta;             /* transmitter address */
+} PACKED;
+#define        DOT11_PS_POLL_LEN       16
+
+struct dot11_cf_end_frame {
+       uint16                  fc;             /* frame control */
+       uint16                  durid;          /* duration/ID */
+       struct ether_addr       ra;             /* receiver address */
+       struct ether_addr       bssid;          /* transmitter address, STA in AP */
+} PACKED;
+#define        DOT11_CS_END_LEN        16
+
+/* Management frame header */
+struct dot11_management_header {
+       uint16                  fc;             /* frame control */
+       uint16                  durid;          /* duration/ID */
+       struct ether_addr       da;             /* receiver address */
+       struct ether_addr       sa;             /* transmitter address */
+       struct ether_addr       bssid;          /* BSS ID */
+       uint16                  seq;            /* sequence control */
+} PACKED;
+#define        DOT11_MGMT_HDR_LEN      24
+
+/* Management frame payloads */
+
+struct dot11_bcn_prb {
+       uint32                  timestamp[2];
+       uint16                  beacon_interval;
+       uint16                  capability;
+} PACKED;
+#define        DOT11_BCN_PRB_LEN       12
+
+struct dot11_auth {
+       uint16                  alg;            /* algorithm */
+       uint16                  seq;            /* sequence control */
+       uint16                  status;         /* status code */
+} PACKED;
+#define DOT11_AUTH_FIXED_LEN   6               /* length of auth frame without challenge info elt */
+
+struct dot11_assoc_req {
+       uint16                  capability;     /* capability information */
+       uint16                  listen;         /* listen interval */
+} PACKED;
+
+struct dot11_assoc_resp {
+       uint16                  capability;     /* capability information */
+       uint16                  status;         /* status code */
+       uint16                  aid;            /* association ID */
+} PACKED;
+
+struct dot11_action_measure {
+       uint8   category;
+       uint8   action;
+       uint8   token;
+       uint8   data[1];
+} PACKED;
+#define DOT11_ACTION_MEASURE_LEN       3
+
+/**************
+  802.11h related definitions.
+**************/
+typedef struct {
+       uint8 id;
+       uint8 len;
+       uint8 power;
+} dot11_power_cnst_t;
+
+typedef struct {
+       uint8 min;
+       uint8 max;
+} dot11_power_cap_t;
+
+typedef struct {
+       uint8 id;
+       uint8 len;
+       uint8 tx_pwr;
+       uint8 margin;
+} dot11_tpc_rep_t;
+#define DOT11_MNG_IE_TPC_REPORT_LEN    2       /* length of IE data, not including 2 byte header */
+
+typedef struct {
+       uint8 id;
+       uint8 len;
+       uint8 first_channel;
+       uint8 num_channels;
+} dot11_supp_channels_t;
+
+struct dot11_channel_switch {
+       uint8 id;
+       uint8 len;
+       uint8 mode;
+       uint8 channel;
+       uint8 count;
+}  PACKED;
+typedef struct dot11_channel_switch dot11_channel_switch_t;
+
+/* 802.11h Measurement Request/Report IEs */
+/* Measurement Type field */
+#define DOT11_MEASURE_TYPE_BASIC       0
+#define DOT11_MEASURE_TYPE_CCA                 1
+#define DOT11_MEASURE_TYPE_RPI         2
+
+/* Measurement Mode field */
+
+/* Measurement Request Modes */
+#define DOT11_MEASURE_MODE_ENABLE      (1<<1)
+#define DOT11_MEASURE_MODE_REQUEST     (1<<2)
+#define DOT11_MEASURE_MODE_REPORT      (1<<3)
+/* Measurement Report Modes */
+#define DOT11_MEASURE_MODE_LATE        (1<<0)
+#define DOT11_MEASURE_MODE_INCAPABLE   (1<<1)
+#define DOT11_MEASURE_MODE_REFUSED     (1<<2)
+/* Basic Measurement Map bits */
+#define DOT11_MEASURE_BASIC_MAP_BSS    ((uint8)(1<<0))
+#define DOT11_MEASURE_BASIC_MAP_OFDM   ((uint8)(1<<1))
+#define DOT11_MEASURE_BASIC_MAP_UKNOWN ((uint8)(1<<2))
+#define DOT11_MEASURE_BASIC_MAP_RADAR  ((uint8)(1<<3))
+#define DOT11_MEASURE_BASIC_MAP_UNMEAS ((uint8)(1<<4))
+
+typedef struct {
+       uint8 id;
+       uint8 len;
+       uint8 token;
+       uint8 mode;
+       uint8 type;
+       uint8 channel;
+       uint8 start_time[8];
+       uint16 duration;
+} dot11_meas_req_t;
+#define DOT11_MNG_IE_MREQ_LEN 14
+/* length of Measure Request IE data not including variable len */
+#define DOT11_MNG_IE_MREQ_FIXED_LEN 3
+
+struct dot11_meas_rep {
+       uint8 id;
+       uint8 len;
+       uint8 token;
+       uint8 mode;
+       uint8 type;
+       union 
+       {
+               struct {
+                       uint8 channel;
+                       uint8 start_time[8];
+                       uint16 duration;
+                       uint8 map;
+               } PACKED basic;
+               uint8 data[1];
+       } PACKED rep;
+} PACKED;
+typedef struct dot11_meas_rep dot11_meas_rep_t;
+
+/* length of Measure Report IE data not including variable len */
+#define DOT11_MNG_IE_MREP_FIXED_LEN    3
+
+struct dot11_meas_rep_basic {
+       uint8 channel;
+       uint8 start_time[8];
+       uint16 duration;
+       uint8 map;
+} PACKED;
+typedef struct dot11_meas_rep_basic dot11_meas_rep_basic_t;
+#define DOT11_MEASURE_BASIC_REP_LEN    12
+
+struct dot11_quiet {
+       uint8 id;
+       uint8 len;
+       uint8 count;    /* TBTTs until beacon interval in quiet starts */
+       uint8 period;   /* Beacon intervals between periodic quiet periods ? */
+       uint16 duration;/* Length of quiet period, in TU's */
+       uint16 offset;  /* TU's offset from TBTT in Count field */
+} PACKED;
+typedef struct dot11_quiet dot11_quiet_t;
+
+typedef struct {
+       uint8 channel;
+       uint8 map;
+} chan_map_tuple_t;
+
+typedef struct {
+       uint8 id;
+       uint8 len;
+       uint8 eaddr[ETHER_ADDR_LEN];
+       uint8 interval;
+       chan_map_tuple_t map[1];
+} dot11_ibss_dfs_t;
+
+/* WME Elements */
+#define WME_OUI                        "\x00\x50\xf2"
+#define WME_VER                        1
+#define WME_TYPE               2
+#define WME_SUBTYPE_IE         0       /* Information Element */
+#define WME_SUBTYPE_PARAM_IE   1       /* Parameter Element */
+#define WME_SUBTYPE_TSPEC      2       /* Traffic Specification */
+
+/* WME Access Category Indices (ACIs) */
+#define AC_BE                  0       /* Best Effort */
+#define AC_BK                  1       /* Background */
+#define AC_VI                  2       /* Video */
+#define AC_VO                  3       /* Voice */
+#define AC_MAX                 4
+
+/* WME Information Element (IE) */
+struct wme_ie {
+       uint8 oui[3];
+       uint8 type;
+       uint8 subtype;
+       uint8 version;
+       uint8 acinfo;
+} PACKED;
+typedef struct wme_ie wme_ie_t;
+#define WME_IE_LEN 7
+
+struct wme_acparam {
+       uint8   ACI;
+       uint8   ECW;
+       uint16  TXOP;           /* stored in network order (ls octet first) */
+} PACKED;
+typedef struct wme_acparam wme_acparam_t;
+
+/* WME Parameter Element (PE) */
+struct wme_params {
+       uint8 oui[3];
+       uint8 type;
+       uint8 subtype;
+       uint8 version;
+       uint8 acinfo;
+       uint8 rsvd;
+       wme_acparam_t acparam[4];
+} PACKED;
+typedef struct wme_params wme_params_t;
+#define WME_PARAMS_IE_LEN      24
+
+/* acinfo */
+#define WME_COUNT_MASK         0x0f
+/* ACI */
+#define WME_AIFS_MASK  0x0f
+#define WME_ACM_MASK   0x10
+#define WME_ACI_MASK   0x60
+#define WME_ACI_SHIFT  5
+/* ECW */
+#define WME_CWMIN_MASK 0x0f
+#define WME_CWMAX_MASK 0xf0
+#define WME_CWMAX_SHIFT        4
+
+#define WME_TXOP_UNITS 32
+
+/* WME Traffic Specification (TSPEC) element */
+#define WME_SUBTYPE_TSPEC 2
+#define WME_TSPEC_HDR_LEN              2
+#define WME_TSPEC_BODY_OFF             2
+struct wme_tspec {
+       uint8 oui[DOT11_OUI_LEN];       /* WME_OUI */
+       uint8 type;                     /* WME_TYPE */
+       uint8 subtype;                  /* WME_SUBTYPE_TSPEC */
+       uint8 version;                  /* WME_VERSION */
+       uint16 ts_info;                 /* TS Info */
+       uint16 nom_msdu_size;           /* (Nominal or fixed) MSDU Size (bytes) */
+       uint16 max_msdu_size;           /* Maximum MSDU Size (bytes) */
+       uint32 min_service_interval;    /* Minimum Service Interval (us) */
+       uint32 max_service_interval;    /* Maximum Service Interval (us) */
+       uint32 inactivity_interval;     /* Inactivity Interval (us) */
+       uint32 service_start;           /* Service Start Time (us) */
+       uint32 min_rate;                /* Minimum Data Rate (bps) */
+       uint32 mean_rate;               /* Mean Data Rate (bps) */
+       uint32 max_burst_size;          /* Maximum Burst Size (bytes) */
+       uint32 min_phy_rate;            /* Minimum PHY Rate (bps) */
+       uint32 peak_rate;               /* Peak Data Rate (bps) */
+       uint32 delay_bound;             /* Delay Bound (us) */
+       uint16 surplus_bandwidth;       /* Surplus Bandwidth Allowance Factor */
+       uint16 medium_time;             /* Medium Time (32 us/s periods) */
+} PACKED;
+typedef struct wme_tspec wme_tspec_t;
+#define WME_TSPEC_LEN 56               /* not including 2-byte header */
+
+/* ts_info */
+/* 802.1D priority is duplicated - bits 13-11 AND bits 3-1 */
+#define TS_INFO_PRIO_SHIFT_HI          11
+#define TS_INFO_PRIO_MASK_HI           (0x7 << TS_INFO_PRIO_SHIFT_HI)
+#define TS_INFO_PRIO_SHIFT_LO          1
+#define TS_INFO_PRIO_MASK_LO           (0x7 << TS_INFO_PRIO_SHIFT_LO)
+#define TS_INFO_CONTENTION_SHIFT       7
+#define TS_INFO_CONTENTION_MASK                (0x1 << TS_INFO_CONTENTION_SHIFT)
+#define TS_INFO_DIRECTION_SHIFT                5
+#define TS_INFO_DIRECTION_MASK         (0x3 << TS_INFO_DIRECTION_SHIFT)
+#define TS_INFO_UPLINK                 (0 << TS_INFO_DIRECTION_SHIFT)
+#define TS_INFO_DOWNLINK               (1 << TS_INFO_DIRECTION_SHIFT)
+#define TS_INFO_BIDIRECTIONAL          (3 << TS_INFO_DIRECTION_SHIFT)
+
+/* nom_msdu_size */
+#define FIXED_MSDU_SIZE 0x8000         /* MSDU size is fixed */
+#define MSDU_SIZE_MASK 0x7fff          /* (Nominal or fixed) MSDU size */
+
+/* surplus_bandwidth */
+/* Represented as 3 bits of integer, binary point, 13 bits fraction */
+#define        INTEGER_SHIFT   13
+#define FRACTION_MASK  0x1FFF
+
+/* Management Notification Frame */
+struct dot11_management_notification {
+       uint8 category;                 /* DOT11_ACTION_NOTIFICATION */
+       uint8 action;
+       uint8 token;
+       uint8 status;
+       uint8 data[1];                  /* Elements */
+} PACKED;
+#define DOT11_MGMT_NOTIFICATION_LEN 4  /* Fixed length */
+
+/* WME Action Codes */
+#define WME_SETUP_REQUEST      0
+#define WME_SETUP_RESPONSE     1
+#define WME_TEARDOWN           2
+
+/* WME Setup Response Status Codes */
+#define WME_ADMISSION_ACCEPTED 0
+#define WME_INVALID_PARAMETERS 1
+#define WME_ADMISSION_REFUSED  3
+
+/* Macro to take a pointer to a beacon or probe response
+ * header and return the char* pointer to the SSID info element
+ */
+#define BCN_PRB_SSID(hdr) ((char*)(hdr) + DOT11_MGMT_HDR_LEN + DOT11_BCN_PRB_LEN)
+
+/* Authentication frame payload constants */
+#define DOT11_OPEN_SYSTEM      0
+#define DOT11_SHARED_KEY       1
+#define DOT11_CHALLENGE_LEN    128
+
+/* Frame control macros */
+#define FC_PVER_MASK           0x3
+#define FC_PVER_SHIFT          0
+#define FC_TYPE_MASK           0xC
+#define FC_TYPE_SHIFT          2
+#define FC_SUBTYPE_MASK                0xF0
+#define FC_SUBTYPE_SHIFT       4
+#define FC_TODS                        0x100
+#define FC_TODS_SHIFT          8
+#define FC_FROMDS              0x200
+#define FC_FROMDS_SHIFT                9
+#define FC_MOREFRAG            0x400
+#define FC_MOREFRAG_SHIFT      10
+#define FC_RETRY               0x800
+#define FC_RETRY_SHIFT         11
+#define FC_PM                  0x1000
+#define FC_PM_SHIFT            12
+#define FC_MOREDATA            0x2000
+#define FC_MOREDATA_SHIFT      13
+#define FC_WEP                 0x4000
+#define FC_WEP_SHIFT           14
+#define FC_ORDER               0x8000
+#define FC_ORDER_SHIFT         15
+
+/* sequence control macros */
+#define SEQNUM_SHIFT           4
+#define FRAGNUM_MASK           0xF
+
+/* Frame Control type/subtype defs */
+
+/* FC Types */
+#define FC_TYPE_MNG            0
+#define FC_TYPE_CTL            1
+#define FC_TYPE_DATA           2
+
+/* Management Subtypes */
+#define FC_SUBTYPE_ASSOC_REQ           0
+#define FC_SUBTYPE_ASSOC_RESP          1
+#define FC_SUBTYPE_REASSOC_REQ         2
+#define FC_SUBTYPE_REASSOC_RESP                3
+#define FC_SUBTYPE_PROBE_REQ           4
+#define FC_SUBTYPE_PROBE_RESP          5
+#define FC_SUBTYPE_BEACON              8
+#define FC_SUBTYPE_ATIM                        9
+#define FC_SUBTYPE_DISASSOC            10
+#define FC_SUBTYPE_AUTH                        11
+#define FC_SUBTYPE_DEAUTH              12
+#define FC_SUBTYPE_ACTION              13
+
+/* Control Subtypes */
+#define FC_SUBTYPE_PS_POLL             10
+#define FC_SUBTYPE_RTS                 11
+#define FC_SUBTYPE_CTS                 12
+#define FC_SUBTYPE_ACK                 13
+#define FC_SUBTYPE_CF_END              14
+#define FC_SUBTYPE_CF_END_ACK          15
+
+/* Data Subtypes */
+#define FC_SUBTYPE_DATA                        0
+#define FC_SUBTYPE_DATA_CF_ACK         1
+#define FC_SUBTYPE_DATA_CF_POLL                2
+#define FC_SUBTYPE_DATA_CF_ACK_POLL    3
+#define FC_SUBTYPE_NULL                        4
+#define FC_SUBTYPE_CF_ACK              5
+#define FC_SUBTYPE_CF_POLL             6
+#define FC_SUBTYPE_CF_ACK_POLL         7
+#define FC_SUBTYPE_QOS_DATA            8
+#define FC_SUBTYPE_QOS_NULL            12
+
+/* type-subtype combos */
+#define FC_KIND_MASK           (FC_TYPE_MASK | FC_SUBTYPE_MASK)
+
+#define FC_KIND(t, s) (((t) << FC_TYPE_SHIFT) | ((s) << FC_SUBTYPE_SHIFT))
+
+#define FC_ASSOC_REQ   FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ASSOC_REQ)
+#define FC_ASSOC_RESP  FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ASSOC_RESP)
+#define FC_REASSOC_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_REASSOC_REQ)
+#define FC_REASSOC_RESP        FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_REASSOC_RESP)
+#define FC_PROBE_REQ   FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_PROBE_REQ)
+#define FC_PROBE_RESP  FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_PROBE_RESP)
+#define FC_BEACON      FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_BEACON)
+#define FC_DISASSOC    FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_DISASSOC)
+#define FC_AUTH                FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_AUTH)
+#define FC_DEAUTH      FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_DEAUTH)
+#define FC_ACTION      FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ACTION)
+
+#define FC_PS_POLL     FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_PS_POLL)
+#define FC_RTS         FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_RTS)
+#define FC_CTS         FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CTS)
+#define FC_ACK         FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_ACK)
+#define FC_CF_END      FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CF_END)
+#define FC_CF_END_ACK  FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CF_END_ACK)
+
+#define FC_DATA                FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_DATA)
+#define FC_NULL_DATA   FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_NULL)
+#define FC_DATA_CF_ACK FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_DATA_CF_ACK)
+#define FC_QOS_DATA    FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_QOS_DATA)
+#define FC_QOS_NULL    FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_QOS_NULL)
+
+/* QoS Control Field */
+
+/* 802.1D Tag */
+#define QOS_PRIO_SHIFT         0
+#define QOS_PRIO_MASK          0x0007
+#define QOS_PRIO(qos)          (((qos) & QOS_PRIO_MASK) >> QOS_PRIO_SHIFT)
+
+/* Ack Policy (0 means Acknowledge) */
+#define QOS_ACK_SHIFT          5
+#define QOS_ACK_MASK           0x0060
+#define QOS_ACK(qos)           (((qos) & QOS_ACK_MASK) >> QOS_ACK_SHIFT)
+
+/* Management Frames */
+
+/* Management Frame Constants */
+
+/* Fixed fields */
+#define DOT11_MNG_AUTH_ALGO_LEN                2
+#define DOT11_MNG_AUTH_SEQ_LEN         2
+#define DOT11_MNG_BEACON_INT_LEN       2
+#define DOT11_MNG_CAP_LEN              2
+#define DOT11_MNG_AP_ADDR_LEN          6
+#define DOT11_MNG_LISTEN_INT_LEN       2
+#define DOT11_MNG_REASON_LEN           2
+#define DOT11_MNG_AID_LEN              2
+#define DOT11_MNG_STATUS_LEN           2
+#define DOT11_MNG_TIMESTAMP_LEN                8
+
+/* DUR/ID field in assoc resp is 0xc000 | AID */
+#define DOT11_AID_MASK                 0x3fff
+
+/* Reason Codes */
+#define DOT11_RC_RESERVED                      0
+#define DOT11_RC_UNSPECIFIED                   1       /* Unspecified reason */
+#define DOT11_RC_AUTH_INVAL                    2       /* Previous authentication no longer valid */
+#define DOT11_RC_DEAUTH_LEAVING                        3       /* Deauthenticated because sending station is
+                                                          leaving (or has left) IBSS or ESS */
+#define DOT11_RC_INACTIVITY                    4       /* Disassociated due to inactivity */
+#define DOT11_RC_BUSY                          5       /* Disassociated because AP is unable to handle
+                                                          all currently associated stations */
+#define DOT11_RC_INVAL_CLASS_2                 6       /* Class 2 frame received from
+                                                          nonauthenticated station */
+#define DOT11_RC_INVAL_CLASS_3                 7       /* Class 3 frame received from
+                                                          nonassociated station */
+#define DOT11_RC_DISASSOC_LEAVING              8       /* Disassociated because sending station is
+                                                          leaving (or has left) BSS */
+#define DOT11_RC_NOT_AUTH                      9       /* Station requesting (re)association is
+                                                          not authenticated with responding station */
+#define DOT11_RC_MAX                           23      /* Reason codes > 23 are reserved */
+
+/* Status Codes */
+#define DOT11_STATUS_SUCCESS                   0       /* Successful */
+#define DOT11_STATUS_FAILURE                   1       /* Unspecified failure */
+#define DOT11_STATUS_CAP_MISMATCH              10      /* Cannot support all requested capabilities
+                                                          in the Capability Information field */
+#define DOT11_STATUS_REASSOC_FAIL              11      /* Reassociation denied due to inability to
+                                                          confirm that association exists */
+#define DOT11_STATUS_ASSOC_FAIL                        12      /* Association denied due to reason outside
+                                                          the scope of this standard */
+#define DOT11_STATUS_AUTH_MISMATCH             13      /* Responding station does not support the
+                                                          specified authentication algorithm */
+#define DOT11_STATUS_AUTH_SEQ                  14      /* Received an Authentication frame with
+                                                          authentication transaction sequence number
+                                                          out of expected sequence */
+#define DOT11_STATUS_AUTH_CHALLENGE_FAIL       15      /* Authentication rejected because of challenge failure */
+#define DOT11_STATUS_AUTH_TIMEOUT              16      /* Authentication rejected due to timeout waiting
+                                                          for next frame in sequence */
+#define DOT11_STATUS_ASSOC_BUSY_FAIL           17      /* Association denied because AP is unable to
+                                                          handle additional associated stations */
+#define DOT11_STATUS_ASSOC_RATE_MISMATCH       18      /* Association denied due to requesting station
+                                                          not supporting all of the data rates in the
+                                                          BSSBasicRateSet parameter */
+#define DOT11_STATUS_ASSOC_SHORT_REQUIRED      19      /* Association denied due to requesting station
+                                                          not supporting the Short Preamble option */
+#define DOT11_STATUS_ASSOC_PBCC_REQUIRED       20      /* Association denied due to requesting station
+                                                          not supporting the PBCC Modulation option */
+#define DOT11_STATUS_ASSOC_AGILITY_REQUIRED    21      /* Association denied due to requesting station
+                                                          not supporting the Channel Agility option */
+#define DOT11_STATUS_ASSOC_SPECTRUM_REQUIRED   22      /* Association denied because Spectrum Management 
+                                                          capability is required. */
+#define DOT11_STATUS_ASSOC_BAD_POWER_CAP       23      /* Association denied because the info in the 
+                                                          Power Cap element is unacceptable. */
+#define DOT11_STATUS_ASSOC_BAD_SUP_CHANNELS    24      /* Association denied because the info in the 
+                                                          Supported Channel element is unacceptable */
+#define DOT11_STATUS_ASSOC_SHORTSLOT_REQUIRED  25      /* Association denied due to requesting station
+                                                          not supporting the Short Slot Time option */
+#define DOT11_STATUS_ASSOC_ERPBCC_REQUIRED     26      /* Association denied due to requesting station
+                                                          not supporting the ER-PBCC Modulation option */
+#define DOT11_STATUS_ASSOC_DSSOFDM_REQUIRED    27      /* Association denied due to requesting station
+                                                          not supporting the DSS-OFDM option */
+
+/* Info Elts, length of INFORMATION portion of Info Elts */
+#define DOT11_MNG_DS_PARAM_LEN                 1
+#define DOT11_MNG_IBSS_PARAM_LEN               2
+
+/* TIM Info element has 3 bytes fixed info in INFORMATION field,
+ * followed by 1 to 251 bytes of Partial Virtual Bitmap */
+#define DOT11_MNG_TIM_FIXED_LEN                        3
+#define DOT11_MNG_TIM_DTIM_COUNT               0
+#define DOT11_MNG_TIM_DTIM_PERIOD              1
+#define DOT11_MNG_TIM_BITMAP_CTL               2
+#define DOT11_MNG_TIM_PVB                      3
+
+/* TLV defines */
+#define TLV_TAG_OFF            0
+#define TLV_LEN_OFF            1
+#define TLV_HDR_LEN            2
+#define TLV_BODY_OFF           2
+
+/* Management Frame Information Element IDs */
+#define DOT11_MNG_SSID_ID                      0
+#define DOT11_MNG_RATES_ID                     1
+#define DOT11_MNG_FH_PARMS_ID                  2
+#define DOT11_MNG_DS_PARMS_ID                  3
+#define DOT11_MNG_CF_PARMS_ID                  4
+#define DOT11_MNG_TIM_ID                       5
+#define DOT11_MNG_IBSS_PARMS_ID                        6
+#define DOT11_MNG_COUNTRY_ID                   7
+#define DOT11_MNG_HOPPING_PARMS_ID             8
+#define DOT11_MNG_HOPPING_TABLE_ID             9
+#define DOT11_MNG_REQUEST_ID                   10
+#define DOT11_MNG_CHALLENGE_ID                 16
+#define DOT11_MNG_PWR_CONSTRAINT_ID            32    /* 11H PowerConstraint    */
+#define DOT11_MNG_PWR_CAP_ID                   33    /* 11H PowerCapability    */
+#define DOT11_MNG_TPC_REQUEST_ID               34    /* 11H TPC Request        */
+#define DOT11_MNG_TPC_REPORT_ID                        35    /* 11H TPC Report         */
+#define DOT11_MNG_SUPP_CHANNELS_ID             36    /* 11H Supported Channels */
+#define DOT11_MNG_CHANNEL_SWITCH_ID            37    /* 11H ChannelSwitch Announcement*/
+#define DOT11_MNG_MEASURE_REQUEST_ID           38    /* 11H MeasurementRequest */
+#define DOT11_MNG_MEASURE_REPORT_ID            39    /* 11H MeasurementReport  */
+#define DOT11_MNG_QUIET_ID                     40    /* 11H Quiet              */
+#define DOT11_MNG_IBSS_DFS_ID                  41    /* 11H IBSS_DFS           */
+#define DOT11_MNG_ERP_ID                       42
+#define DOT11_MNG_NONERP_ID                    47
+#define DOT11_MNG_EXT_RATES_ID                 50
+#define DOT11_MNG_WPA_ID                       221
+#define DOT11_MNG_PROPR_ID                     221
+
+/* ERP info element bit values */
+#define DOT11_MNG_ERP_LEN                      1       /* ERP is currently 1 byte long */
+#define DOT11_MNG_NONERP_PRESENT               0x01    /* NonERP (802.11b) STAs are present in the BSS */
+#define DOT11_MNG_USE_PROTECTION               0x02    /* Use protection mechanisms for ERP-OFDM frames */
+#define DOT11_MNG_BARKER_PREAMBLE              0x04    /* Short Preambles: 0 == allowed, 1 == not allowed */
+
+/* Capability Information Field */
+#define DOT11_CAP_ESS                          0x0001
+#define DOT11_CAP_IBSS                         0x0002
+#define DOT11_CAP_POLLABLE                     0x0004
+#define DOT11_CAP_POLL_RQ                      0x0008
+#define DOT11_CAP_PRIVACY                      0x0010
+#define DOT11_CAP_SHORT                                0x0020
+#define DOT11_CAP_PBCC                         0x0040
+#define DOT11_CAP_AGILITY                      0x0080
+#define DOT11_CAP_SPECTRUM                     0x0100
+#define DOT11_CAP_SHORTSLOT                    0x0400
+#define DOT11_CAP_CCK_OFDM                     0x2000
+
+/* Action Frame Constants */
+#define DOT11_ACTION_CAT_ERR_MASK      0x80
+#define DOT11_ACTION_CAT_SPECT_MNG     0x00
+#define DOT11_ACTION_NOTIFICATION      0x11    /* 17 */
+
+#define DOT11_ACTION_ID_M_REQ          0
+#define DOT11_ACTION_ID_M_REP          1
+#define DOT11_ACTION_ID_TPC_REQ                2
+#define DOT11_ACTION_ID_TPC_REP                3
+#define DOT11_ACTION_ID_CHANNEL_SWITCH 4
+
+/* MLME Enumerations */
+#define DOT11_BSSTYPE_INFRASTRUCTURE           0
+#define DOT11_BSSTYPE_INDEPENDENT              1
+#define DOT11_BSSTYPE_ANY                      2
+#define DOT11_SCANTYPE_ACTIVE                  0
+#define DOT11_SCANTYPE_PASSIVE                 1
+
+/* 802.11 A PHY constants */
+#define APHY_SLOT_TIME         9
+#define APHY_SIFS_TIME         16
+#define APHY_DIFS_TIME         (APHY_SIFS_TIME + (2 * APHY_SLOT_TIME))
+#define APHY_PREAMBLE_TIME     16
+#define APHY_SIGNAL_TIME       4
+#define APHY_SYMBOL_TIME       4
+#define APHY_SERVICE_NBITS     16
+#define APHY_TAIL_NBITS                6
+#define        APHY_CWMIN              15
+
+/* 802.11 B PHY constants */
+#define BPHY_SLOT_TIME         20
+#define BPHY_SIFS_TIME         10
+#define BPHY_DIFS_TIME         50
+#define BPHY_PLCP_TIME         192
+#define BPHY_PLCP_SHORT_TIME   96
+#define        BPHY_CWMIN              31
+
+/* 802.11 G constants */
+#define DOT11_OFDM_SIGNAL_EXTENSION    6
+
+#define PHY_CWMAX              1023
+
+#define        DOT11_MAXNUMFRAGS       16      /* max # fragments per MSDU */
+
+/* dot11Counters Table - 802.11 spec., Annex D */
+typedef struct d11cnt {
+       uint32          txfrag;         /* dot11TransmittedFragmentCount */
+       uint32          txmulti;        /* dot11MulticastTransmittedFrameCount */
+       uint32          txfail;         /* dot11FailedCount */
+       uint32          txretry;        /* dot11RetryCount */
+       uint32          txretrie;       /* dot11MultipleRetryCount */
+       uint32          rxdup;          /* dot11FrameduplicateCount */
+       uint32          txrts;          /* dot11RTSSuccessCount */
+       uint32          txnocts;        /* dot11RTSFailureCount */
+       uint32          txnoack;        /* dot11ACKFailureCount */
+       uint32          rxfrag;         /* dot11ReceivedFragmentCount */
+       uint32          rxmulti;        /* dot11MulticastReceivedFrameCount */
+       uint32          rxcrc;          /* dot11FCSErrorCount */
+       uint32          txfrmsnt;       /* dot11TransmittedFrameCount */
+       uint32          rxundec;        /* dot11WEPUndecryptableCount */
+} d11cnt_t;
+
+/* BRCM OUI */
+#define BRCM_OUI               "\x00\x10\x18"
+
+/* BRCM info element */
+struct brcm_ie {
+       uchar   id;             
+       uchar   len;   
+       uchar   oui[3];
+       uchar   ver;
+       uchar   assoc;          /*  # of assoc STAs */
+       uchar   flags;          /* misc flags */
+} PACKED;
+#define BRCM_IE_LEN            8
+typedef        struct brcm_ie brcm_ie_t;
+#define BRCM_IE_VER            1
+
+/* brcm_ie flags */
+#define        BRF_ABCAP               0x1     /* afterburner capable */
+#define        BRF_ABRQRD              0x2     /* afterburner requested */
+
+/* WPA definitions */
+#define WPA_VERSION            1
+#define WPA_OUI                        "\x00\x50\xF2"
+
+#define WPA_OUI_LEN    3
+
+/* WPA authentication modes */
+#define WPA_AUTH_NONE          0       /* None */
+#define WPA_AUTH_UNSPECIFIED   1       /* Unspecified authentication over 802.1X: default for WPA */
+#define WPA_AUTH_PSK           2       /* Pre-shared Key over 802.1X */
+#define WPA_AUTH_DISABLED      255     /* Legacy (i.e., non-WPA) */
+                                
+#define IS_WPA_AUTH(auth)      ((auth) == WPA_AUTH_NONE || \
+                                (auth) == WPA_AUTH_UNSPECIFIED || \
+                                (auth) == WPA_AUTH_PSK)
+
+
+/* Key related defines */
+#define DOT11_MAX_DEFAULT_KEYS 4       /* number of default keys */
+#define DOT11_MAX_KEY_SIZE     32      /* max size of any key */
+#define DOT11_MAX_IV_SIZE      16      /* max size of any IV */
+#define DOT11_EXT_IV_FLAG      (1<<5)  /* flag to indicate IV is > 4 bytes */
+
+#define WEP1_KEY_SIZE          5       /* max size of any WEP key */
+#define WEP1_KEY_HEX_SIZE      10      /* size of WEP key in hex. */
+#define WEP128_KEY_SIZE                13      /* max size of any WEP key */
+#define WEP128_KEY_HEX_SIZE    26      /* size of WEP key in hex. */
+#define TKIP_MIC_SIZE          8       /* size of TKIP MIC */
+#define TKIP_EOM_SIZE          7       /* max size of TKIP EOM */
+#define TKIP_EOM_FLAG          0x5a    /* TKIP EOM flag byte */
+#define TKIP_KEY_SIZE          32      /* size of any TKIP key */
+#define TKIP_MIC_AUTH_TX       16      /* offset to Authenticator MIC TX key */
+#define TKIP_MIC_AUTH_RX       24      /* offset to Authenticator MIC RX key */
+#define TKIP_MIC_SUP_RX                16      /* offset to Supplicant MIC RX key */
+#define TKIP_MIC_SUP_TX                24      /* offset to Supplicant MIC TX key */
+#define AES_KEY_SIZE           16      /* size of AES key */
+
+#undef PACKED
+#if !defined(__GNUC__)
+#pragma pack()
+#endif
+
+#endif /* _802_11_H_ */
diff --git a/openwrt/target/linux/package/openwrt/include/proto/ethernet.h b/openwrt/target/linux/package/openwrt/include/proto/ethernet.h
new file mode 100644 (file)
index 0000000..173464a
--- /dev/null
@@ -0,0 +1,179 @@
+/*******************************************************************************
+ * $Id$
+ * Copyright 2004, Broadcom Corporation      
+ * All Rights Reserved.      
+ *       
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY      
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM      
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS      
+ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.      
+ * From FreeBSD 2.2.7: Fundamental constants relating to ethernet.
+ ******************************************************************************/
+
+#ifndef _NET_ETHERNET_H_           /* use native BSD ethernet.h when available */
+#define _NET_ETHERNET_H_
+
+#ifndef _TYPEDEFS_H_
+#include "typedefs.h"
+#endif
+
+#if defined(__GNUC__)
+#define        PACKED  __attribute__((packed))
+#else
+#define        PACKED
+#endif
+
+/*
+ * The number of bytes in an ethernet (MAC) address.
+ */
+#ifndef ETHER_ADDR_LEN
+#define        ETHER_ADDR_LEN          6
+#endif
+
+/*
+ * The number of bytes in the type field.
+ */
+#ifndef        ETHER_TYPE_LEN
+#define        ETHER_TYPE_LEN          2
+#endif
+
+/*
+ * The number of bytes in the trailing CRC field.
+ */
+#ifndef        ETHER_CRC_LEN
+#define        ETHER_CRC_LEN           4
+#endif
+
+/*
+ * The length of the combined header.
+ */
+#ifndef        ETHER_HDR_LEN
+#define        ETHER_HDR_LEN           (ETHER_ADDR_LEN*2+ETHER_TYPE_LEN)
+#endif
+
+/*
+ * The minimum packet length.
+ */
+#ifndef ETHER_MIN_LEN
+#define        ETHER_MIN_LEN           64
+#endif
+
+/*
+ * The minimum packet user data length.
+ */
+#ifndef ETHER_MIN_DATA
+#define        ETHER_MIN_DATA          46
+#endif
+
+/*
+ * The maximum packet length.
+ */
+#ifndef ETHER_MAX_LEN
+#define        ETHER_MAX_LEN           1518
+#endif
+
+/*
+ * The maximum packet user data length.
+ */
+#define        ETHER_MAX_DATA          1500
+
+/*
+ * Used to uniquely identify a 802.1q VLAN-tagged header.
+ */
+#define        VLAN_TAG                        0x8100
+
+/*
+ * Located after dest & src address in ether header.
+ */
+#define VLAN_FIELDS_OFFSET             (ETHER_ADDR_LEN * 2)
+
+/*
+ * 4 bytes of vlan field info.
+ */
+#define VLAN_FIELDS_SIZE               4
+
+/* location of bits in 16-bit vlan fields */
+#define VLAN_PRI_SHIFT         13      /* user priority */
+#define VLAN_CFI_SHIFT         12      /* canonical format indicator bit */
+
+/* 3 bits of priority */
+#define VLAN_PRI_MASK                  7
+/* 12 bits of vlan identfier (VID) */
+#define VLAN_VID_MASK          0xFFF   /* VLAN identifier (VID) field */
+
+struct  vlan_tags {
+       uint16  tag_type;       /* 0x8100 for VLAN */
+       uint16  tag_control;    /* prio | cfi | vid */
+} PACKED ;
+
+/* 802.1X ethertype */
+
+#define        ETHER_TYPE_IP           0x0800          /* IP */
+#define        ETHER_TYPE_BRCM         0x886c          /* Broadcom Corp. */
+#define        ETHER_TYPE_802_1X       0x888e          /* 802.1x */
+
+#define        ETHER_BRCM_SUBTYPE_LEN  4               /* Broadcom 4byte subtype follows ethertype */
+#define        ETHER_BRCM_CRAM         0x1             /* Broadcom subtype cram protocol */
+
+/*
+ * A macro to validate a length with
+ */
+#define        ETHER_IS_VALID_LEN(foo) \
+       ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
+
+#ifndef __NET_ETHERNET_H
+#ifndef __INCif_etherh     /* Quick and ugly hack for VxWorks */
+/*
+ * Structure of a 10Mb/s Ethernet header.
+ */
+struct ether_header {
+       uint8   ether_dhost[ETHER_ADDR_LEN];
+       uint8   ether_shost[ETHER_ADDR_LEN];
+       uint16  ether_type;
+} PACKED ;
+
+/*
+ * Structure of a 48-bit Ethernet address.
+ */
+struct ether_addr {
+       uint8 octet[ETHER_ADDR_LEN];
+} PACKED ;
+#endif
+#endif
+
+/*
+ * Takes a pointer, returns true if a 48-bit multicast address
+ * (including broadcast, since it is all ones)
+ */
+#define ETHER_ISMULTI(ea) (((uint8 *)(ea))[0] & 1)
+
+/*
+ * Takes a pointer, returns true if a 48-bit broadcast (all ones)
+ */
+#define ETHER_ISBCAST(ea) ((((uint8 *)(ea))[0] &               \
+                           ((uint8 *)(ea))[1] &                \
+                           ((uint8 *)(ea))[2] &                \
+                           ((uint8 *)(ea))[3] &                \
+                           ((uint8 *)(ea))[4] &                \
+                           ((uint8 *)(ea))[5]) == 0xff)
+
+static const struct ether_addr ether_bcast = {{255, 255, 255, 255, 255, 255}};
+
+/*
+ * Takes a pointer, returns true if a 48-bit null address (all zeros)
+ */
+#define ETHER_ISNULLADDR(ea) ((((uint8 *)(ea))[0] |            \
+                           ((uint8 *)(ea))[1] |                \
+                           ((uint8 *)(ea))[2] |                \
+                           ((uint8 *)(ea))[3] |                \
+                           ((uint8 *)(ea))[4] |                \
+                           ((uint8 *)(ea))[5]) == 0)
+
+/* Differentiated Services Codepoint - lower 6 bits of tos in iphdr */
+#define        DSCP_PRI_MASK           0x3F            /* bits 0-6 */
+#define        DSCP_WME_PRI_MASK       0x38            /* bits 3-6 */
+#define        DSCP_WME_PRI_SHIFT      3
+
+#undef PACKED
+
+#endif /* _NET_ETHERNET_H_ */
diff --git a/openwrt/target/linux/package/openwrt/include/shutils.h b/openwrt/target/linux/package/openwrt/include/shutils.h
new file mode 100644 (file)
index 0000000..783ee9e
--- /dev/null
@@ -0,0 +1,200 @@
+/*
+ * Shell-like utility functions
+ *
+ * Copyright 2004, Broadcom Corporation
+ * All Rights Reserved.
+ * 
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
+ *
+ * $Id$
+ */
+
+#ifndef _shutils_h_
+#define _shutils_h_
+#include <string.h>
+/*
+ * Reads file and returns contents
+ * @param      fd      file descriptor
+ * @return     contents of file or NULL if an error occurred
+ */
+extern char * fd2str(int fd);
+
+/*
+ * Reads file and returns contents
+ * @param      path    path to file
+ * @return     contents of file or NULL if an error occurred
+ */
+extern char * file2str(const char *path);
+
+/* 
+ * Waits for a file descriptor to become available for reading or unblocked signal
+ * @param      fd      file descriptor
+ * @param      timeout seconds to wait before timing out or 0 for no timeout
+ * @return     1 if descriptor changed status or 0 if timed out or -1 on error
+ */
+extern int waitfor(int fd, int timeout);
+
+/* 
+ * Concatenates NULL-terminated list of arguments into a single
+ * commmand and executes it
+ * @param      argv    argument list
+ * @param      path    NULL, ">output", or ">>output"
+ * @param      timeout seconds to wait before timing out or 0 for no timeout
+ * @param      ppid    NULL to wait for child termination or pointer to pid
+ * @return     return value of executed command or errno
+ */
+extern int _eval(char *const argv[], char *path, int timeout, pid_t *ppid);
+
+/* 
+ * Concatenates NULL-terminated list of arguments into a single
+ * commmand and executes it
+ * @param      argv    argument list
+ * @return     stdout of executed command or NULL if an error occurred
+ */
+extern char * _backtick(char *const argv[]);
+
+/* 
+ * Kills process whose PID is stored in plaintext in pidfile
+ * @param      pidfile PID file
+ * @return     0 on success and errno on failure
+ */
+extern int kill_pidfile(char *pidfile);
+
+/*
+ * fread() with automatic retry on syscall interrupt
+ * @param      ptr     location to store to
+ * @param      size    size of each element of data
+ * @param      nmemb   number of elements
+ * @param      stream  file stream
+ * @return     number of items successfully read
+ */
+extern int safe_fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
+
+/*
+ * fwrite() with automatic retry on syscall interrupt
+ * @param      ptr     location to read from
+ * @param      size    size of each element of data
+ * @param      nmemb   number of elements
+ * @param      stream  file stream
+ * @return     number of items successfully written
+ */
+extern int safe_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
+
+/*
+ * Convert Ethernet address string representation to binary data
+ * @param      a       string in xx:xx:xx:xx:xx:xx notation
+ * @param      e       binary data
+ * @return     TRUE if conversion was successful and FALSE otherwise
+ */
+extern int ether_atoe(const char *a, unsigned char *e);
+
+/*
+ * Convert Ethernet address binary data to string representation
+ * @param      e       binary data
+ * @param      a       string in xx:xx:xx:xx:xx:xx notation
+ * @return     a
+ */
+extern char * ether_etoa(const unsigned char *e, char *a);
+
+/*
+ * Concatenate two strings together into a caller supplied buffer
+ * @param      s1      first string
+ * @param      s2      second string
+ * @param      buf     buffer large enough to hold both strings
+ * @return     buf
+ */
+static inline char * strcat_r(const char *s1, const char *s2, char *buf)
+{
+       strcpy(buf, s1);
+       strcat(buf, s2);
+       return buf;
+}      
+
+/* Check for a blank character; that is, a space or a tab */
+#define isblank(c) ((c) == ' ' || (c) == '\t')
+
+/* Strip trailing CR/NL from string <s> */
+#define chomp(s) ({ \
+       char *c = (s) + strlen((s)) - 1; \
+       while ((c > (s)) && (*c == '\n' || *c == '\r' || *c == ' ')) \
+               *c-- = '\0'; \
+       s; \
+})
+
+/* Simple version of _backtick() */
+#define backtick(cmd, args...) ({ \
+       char *argv[] = { cmd, ## args, NULL }; \
+       _backtick(argv); \
+})
+
+/* Simple version of _eval() (no timeout and wait for child termination) */
+#define eval(cmd, args...) ({ \
+       char *argv[] = { cmd, ## args, NULL }; \
+       _eval(argv, ">/dev/console", 0, NULL); \
+})
+
+/* Copy each token in wordlist delimited by space into word */
+#define foreach(word, wordlist, next) \
+       for (next = &wordlist[strspn(wordlist, " ")], \
+            strncpy(word, next, sizeof(word)), \
+            word[strcspn(word, " ")] = '\0', \
+            word[sizeof(word) - 1] = '\0', \
+            next = strchr(next, ' '); \
+            strlen(word); \
+            next = next ? &next[strspn(next, " ")] : "", \
+            strncpy(word, next, sizeof(word)), \
+            word[strcspn(word, " ")] = '\0', \
+            word[sizeof(word) - 1] = '\0', \
+            next = strchr(next, ' '))
+
+/* Return NUL instead of NULL if undefined */
+#define safe_getenv(s) (getenv(s) ? : "")
+
+/* Print directly to the console */
+#define cprintf(fmt, args...) do { \
+       FILE *fp = fopen("/dev/console", "w"); \
+       if (fp) { \
+               fprintf(fp, fmt, ## args); \
+               fclose(fp); \
+       } \
+} while (0)
+
+/* Debug print */
+#ifdef DEBUG
+#define dprintf(fmt, args...) cprintf("%s: " fmt, __FUNCTION__, ## args)
+#else
+#define dprintf(fmt, args...)
+#endif
+
+#ifdef vxworks
+
+#include <inetLib.h>
+#define inet_aton(a, n) ((inet_aton((a), (n)) == ERROR) ? 0 : 1)
+#define inet_ntoa(n) ({ char a[INET_ADDR_LEN]; inet_ntoa_b ((n), a); a; })
+
+#include <typedefs.h>
+#include <bcmutils.h>
+#define ether_atoe(a, e) bcm_ether_atoe((a), (e))
+#define ether_etoa(e, a) bcm_ether_ntoa((e), (a))
+
+/* These declarations are not available where you would expect them */
+extern int vsnprintf (char *, size_t, const char *, va_list);
+extern int snprintf(char *str, size_t count, const char *fmt, ...);
+extern char *strdup(const char *);
+extern char *strsep(char **stringp, char *delim);
+extern int strcasecmp(const char *s1, const char *s2); 
+extern int strncasecmp(const char *s1, const char *s2, size_t n); 
+
+/* Neither are socket() and connect() */
+#include <sockLib.h>
+
+#ifdef DEBUG
+#undef dprintf
+#define dprintf printf
+#endif
+#endif
+
+#endif /* _shutils_h_ */
diff --git a/openwrt/target/linux/package/openwrt/include/typedefs.h b/openwrt/target/linux/package/openwrt/include/typedefs.h
new file mode 100644 (file)
index 0000000..6b0c25e
--- /dev/null
@@ -0,0 +1,293 @@
+/*
+ * Copyright 2004, Broadcom Corporation      
+ * All Rights Reserved.      
+ *       
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY      
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM      
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS      
+ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.      
+ * $Id$
+ */
+
+#ifndef _TYPEDEFS_H_
+#define _TYPEDEFS_H_
+
+
+/* Define 'SITE_TYPEDEFS' in the compile to include a site specific
+ * typedef file "site_typedefs.h".
+ *
+ * If 'SITE_TYPEDEFS' is not defined, then the "Inferred Typedefs"
+ * section of this file makes inferences about the compile environment
+ * based on defined symbols and possibly compiler pragmas.
+ *
+ * Following these two sections is the "Default Typedefs"
+ * section. This section is only prcessed if 'USE_TYPEDEF_DEFAULTS' is
+ * defined. This section has a default set of typedefs and a few
+ * proprocessor symbols (TRUE, FALSE, NULL, ...).
+ */
+
+#ifdef SITE_TYPEDEFS
+
+/*******************************************************************************
+ * Site Specific Typedefs
+ *******************************************************************************/
+
+#include "site_typedefs.h"
+
+#else
+
+/*******************************************************************************
+ * Inferred Typedefs
+ *******************************************************************************/
+
+/* Infer the compile environment based on preprocessor symbols and pramas.
+ * Override type definitions as needed, and include configuration dependent
+ * header files to define types.
+ */
+
+#ifdef __cplusplus
+
+#define TYPEDEF_BOOL
+#ifndef FALSE
+#define FALSE  false
+#endif
+#ifndef TRUE
+#define TRUE   true
+#endif
+
+#else  /* ! __cplusplus */
+
+/* for Windows build, define bool as a uchar instead of the default int */
+#if defined(_WIN32)
+
+#define TYPEDEF_BOOL
+typedef        unsigned char   bool;
+
+#endif /* _WIN32 */
+
+#endif /* ! __cplusplus */
+
+#ifdef _MSC_VER            /* Microsoft C */
+#define TYPEDEF_INT64
+#define TYPEDEF_UINT64
+typedef signed __int64 int64;
+typedef unsigned __int64 uint64;
+#endif
+
+#if defined(MACOSX) && defined(KERNEL)
+#define TYPEDEF_BOOL
+#endif
+
+
+#if defined(linux)
+#define TYPEDEF_UINT
+#define TYPEDEF_USHORT
+#define TYPEDEF_ULONG
+#endif
+
+#if !defined(linux) && !defined(_WIN32) && !defined(PMON) && !defined(_CFE_)
+#define TYPEDEF_UINT
+#define TYPEDEF_USHORT
+#endif
+
+
+/* Do not support the (u)int64 types with strict ansi for GNU C */
+#if defined(__GNUC__) && defined(__STRICT_ANSI__)
+#define TYPEDEF_INT64
+#define TYPEDEF_UINT64
+#endif
+
+/* ICL accepts unsigned 64 bit type only, and complains in ANSI mode
+ * for singned or unsigned */
+#if defined(__ICL)
+
+#define TYPEDEF_INT64
+
+#if defined(__STDC__)
+#define TYPEDEF_UINT64
+#endif
+
+#endif /* __ICL */
+
+
+#if !defined(_WIN32) && !defined(PMON) && !defined(_CFE_)
+
+/* pick up ushort & uint from standard types.h */
+#if defined(linux) && defined(__KERNEL__)
+
+#include <linux/types.h>       /* sys/types.h and linux/types.h are oil and water */
+
+#else
+
+#include <sys/types.h> 
+
+#endif
+
+#endif /* !_WIN32 && !PMON && !_CFE_ */
+
+#if defined(MACOSX) && defined(KERNEL)
+#include <IOKit/IOTypes.h>
+#endif
+
+
+/* use the default typedefs in the next section of this file */
+#define USE_TYPEDEF_DEFAULTS
+
+#endif /* SITE_TYPEDEFS */
+
+
+/*******************************************************************************
+ * Default Typedefs
+ *******************************************************************************/
+
+#ifdef USE_TYPEDEF_DEFAULTS
+#undef USE_TYPEDEF_DEFAULTS
+
+#ifndef TYPEDEF_BOOL
+typedef        int     bool;
+#endif
+
+/*----------------------- define uchar, ushort, uint, ulong ----------------*/
+
+#ifndef TYPEDEF_UCHAR
+typedef unsigned char  uchar;
+#endif
+
+#ifndef TYPEDEF_USHORT
+typedef unsigned short ushort;
+#endif
+
+#ifndef TYPEDEF_UINT
+typedef unsigned int   uint;
+#endif
+
+#ifndef TYPEDEF_ULONG
+typedef unsigned long  ulong;
+#endif
+
+/*----------------------- define [u]int8/16/32/64 --------------------------*/
+
+#ifndef TYPEDEF_UINT8
+typedef unsigned char  uint8;
+#endif
+
+#ifndef TYPEDEF_UINT16
+typedef unsigned short uint16;
+#endif
+
+#ifndef TYPEDEF_UINT32
+typedef unsigned int   uint32;
+#endif
+
+#ifndef TYPEDEF_UINT64
+typedef unsigned long long uint64;
+#endif
+
+#ifndef TYPEDEF_INT8
+typedef signed char    int8;
+#endif
+
+#ifndef TYPEDEF_INT16
+typedef signed short   int16;
+#endif
+
+#ifndef TYPEDEF_INT32
+typedef signed int     int32;
+#endif
+
+#ifndef TYPEDEF_INT64
+typedef signed long long int64;
+#endif
+
+/*----------------------- define float32/64, float_t -----------------------*/
+
+#ifndef TYPEDEF_FLOAT32
+typedef float          float32;
+#endif
+
+#ifndef TYPEDEF_FLOAT64
+typedef double         float64;
+#endif
+
+/*
+ * abstracted floating point type allows for compile time selection of
+ * single or double precision arithmetic.  Compiling with -DFLOAT32
+ * selects single precision; the default is double precision.
+ */
+
+#ifndef TYPEDEF_FLOAT_T
+
+#if defined(FLOAT32)
+typedef float32 float_t;
+#else /* default to double precision floating point */
+typedef float64 float_t;
+#endif
+
+#endif /* TYPEDEF_FLOAT_T */
+
+/*----------------------- define macro values -----------------------------*/
+
+#ifndef FALSE
+#define FALSE  0
+#endif
+
+#ifndef TRUE
+#define TRUE   1
+#endif
+
+#ifndef NULL
+#define        NULL    0
+#endif
+
+#ifndef OFF
+#define        OFF     0
+#endif
+
+#ifndef ON
+#define        ON      1
+#endif
+
+/*----------------------- define PTRSZ, INLINE ----------------------------*/
+
+#ifndef PTRSZ
+#define        PTRSZ   sizeof (char*)
+#endif
+
+#ifndef INLINE
+
+#ifdef _MSC_VER
+
+#define INLINE __inline
+
+#elif __GNUC__
+
+#define INLINE __inline__
+
+#else
+
+#define INLINE
+
+#endif /* _MSC_VER */
+
+#endif /* INLINE */
+
+#undef TYPEDEF_BOOL
+#undef TYPEDEF_UCHAR
+#undef TYPEDEF_USHORT
+#undef TYPEDEF_UINT
+#undef TYPEDEF_ULONG
+#undef TYPEDEF_UINT8
+#undef TYPEDEF_UINT16
+#undef TYPEDEF_UINT32
+#undef TYPEDEF_UINT64
+#undef TYPEDEF_INT8
+#undef TYPEDEF_INT16
+#undef TYPEDEF_INT32
+#undef TYPEDEF_INT64
+#undef TYPEDEF_FLOAT32
+#undef TYPEDEF_FLOAT64
+#undef TYPEDEF_FLOAT_T
+
+#endif /* USE_TYPEDEF_DEFAULTS */
+
+#endif /* _TYPEDEFS_H_ */
diff --git a/openwrt/target/linux/package/openwrt/include/utils.h b/openwrt/target/linux/package/openwrt/include/utils.h
new file mode 100644 (file)
index 0000000..b8d1cdb
--- /dev/null
@@ -0,0 +1,131 @@
+#include <cy_conf.h>
+
+extern int diag_led(int type, int act);
+extern int C_led(int i);
+extern int get_single_ip(char *ipaddr, int which);
+extern char *get_mac_from_ip(char *ip);
+extern struct dns_lists *get_dns_list(int no);
+extern int dns_to_resolv(void);
+extern char *get_wan_face(void);
+extern int check_wan_link(int num);
+extern char *get_complete_lan_ip(char *ip);
+extern int get_int_len(int num);
+extern int file_to_buf(char *path, char *buf, int len);
+extern int buf_to_file(char *path, char *buf);
+extern pid_t* find_pid_by_name( char* pidName);
+extern int find_pid_by_ps(char* pidName);
+extern int *find_all_pid_by_ps(char* pidName);
+extern char *find_name_by_proc(int pid);
+extern int get_ppp_pid(char *file);
+extern long convert_ver(char *ver);
+extern int check_flash(void);
+extern int check_action(void);
+extern int check_now_boot(void);
+extern int check_hw_type(void);
+extern int is_exist(char *filename);
+extern void set_ip_forward(char c);
+struct mtu_lists *get_mtu(char *proto);
+extern void set_host_domain_name(void);
+
+extern void encode(char *buf, int len);
+extern void decode(char *buf, int len);
+
+extern int sys_netdev_ioctl(int family, int socket, char *if_name, int cmd, struct ifreq *ifr);
+
+int ct_openlog(const char *ident, int option, int facility, char *log_name);
+void ct_syslog(int level, int enable, const char *fmt,...);
+void ct_logger(int level, const char *fmt,...);
+struct wl_assoc_mac * get_wl_assoc_mac(int *c);
+       
+
+
+enum { DMZ, SESSION, DIAG , WL};
+
+enum { START_LED, STOP_LED };
+
+typedef enum { ACT_IDLE, 
+              ACT_TFTP_UPGRADE, 
+              ACT_WEB_UPGRADE, 
+              ACT_WEBS_UPGRADE, 
+              ACT_SW_RESTORE, 
+              ACT_HW_RESTORE } ACTION;
+
+enum { UNKNOWN_BOOT = -1, PMON_BOOT, CFE_BOOT };
+
+enum { BCM4702_CHIP, BCM4712_CHIP, BCM5325E_CHIP };
+
+enum { FIRST, SECOND };
+
+enum { SYSLOG_LOG=1, SYSLOG_DEBUG, CONSOLE_ONLY, LOG_CONSOLE, DEBUG_CONSOLE };
+
+#define ACTION(cmd)    buf_to_file(ACTION_FILE, cmd)
+
+struct dns_lists {
+        int num_servers;
+        char dns_server[4][16];
+};
+
+#define NOT_USING      0
+#define USING          1
+
+struct wl_assoc_mac
+{
+       char mac[18];
+};
+
+struct mtu_lists {
+        char   *proto; /* protocol */
+        char   *min;   /* min mtu */
+        char   *max;   /* max mtu */
+};
+
+
+#define PPP_PSEUDO_IP  "10.64.64.64"
+#define PPP_PSEUDO_NM  "255.255.255.255"
+#define PPP_PSEUDO_GW  "10.112.112.112"
+
+#define PING_TMP       "/tmp/ping.log"
+#define TRACEROUTE_TMP "/tmp/traceroute.log"
+#define MAX_BUF_LEN    254
+
+#define RESOLV_FILE    "/tmp/resolv.conf"
+#define HOSTS_FILE     "/tmp/hosts"
+
+#define LOG_FILE       "/var/log/mess"
+
+#define ACTION_FILE    "/tmp/action"
+
+
+#define split(word, wordlist, next, delim) \
+       for (next = wordlist, \
+            strncpy(word, next, sizeof(word)), \
+            word[(next=strstr(next, delim)) ? strstr(word, delim) - word : sizeof(word) - 1] = '\0', \
+            next = next ? next + sizeof(delim) - 1 : NULL ; \
+            strlen(word); \
+            next = next ? : "", \
+            strncpy(word, next, sizeof(word)), \
+            word[(next=strstr(next, delim)) ? strstr(word, delim) - word : sizeof(word) - 1] = '\0', \
+            next = next ? next + sizeof(delim) - 1 : NULL)
+
+#define STRUCT_LEN(name)    sizeof(name)/sizeof(name[0])
+
+#define printHEX(str,len) { \
+       int i; \
+       for (i=0 ; i<len ; i++) { \
+               printf("%02X ", (unsigned char)*(str+i)); \
+               if(((i+1)%16) == 0) printf("- "); \
+               if(((i+1)%32) == 0) printf("\n"); \
+       } \
+       printf("\n\n"); \
+}
+
+
+#define printASC(str,len) { \
+       int i; \
+       for (i=0 ; i<len ; i++) { \
+               printf("%c", (unsigned char)*(str+i)); \
+               if(((i+1)%16) == 0) printf("- "); \
+               if(((i+1)%32) == 0) printf("\n"); \
+       } \
+       printf("\n\n"); \
+}
diff --git a/openwrt/target/linux/package/openwrt/include/wlcompat.h b/openwrt/target/linux/package/openwrt/include/wlcompat.h
new file mode 100644 (file)
index 0000000..a4fc134
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * wlcompat.h
+ *
+ * Copyright (C) 2005 Felix Fietkau <nbd@vd-s.ath.cx>
+ *
+ * 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, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * $Id$
+ */
+#include <linux/wireless.h>
+
+#ifndef WLCOMPAT_H
+#define WLCOMPAT_H
+
+#define WLCOMPAT_SET_MONITOR           SIOCIWFIRSTPRIV + 0
+#define WLCOMPAT_GET_MONITOR           SIOCIWFIRSTPRIV + 1
+#define WLCOMPAT_SET_TXPWR_LIMIT       SIOCIWFIRSTPRIV + 2
+#define WLCOMPAT_GET_TXPWR_LIMIT       SIOCIWFIRSTPRIV + 3
+#define WLCOMPAT_SET_ANTDIV            SIOCIWFIRSTPRIV + 4
+#define WLCOMPAT_GET_ANTDIV            SIOCIWFIRSTPRIV + 5
+#define WLCOMPAT_SET_TXANT             SIOCIWFIRSTPRIV + 6
+#define WLCOMPAT_GET_TXANT             SIOCIWFIRSTPRIV + 7
+
+#endif
diff --git a/openwrt/target/linux/package/openwrt/include/wlioctl.h b/openwrt/target/linux/package/openwrt/include/wlioctl.h
new file mode 100644 (file)
index 0000000..d5ef11f
--- /dev/null
@@ -0,0 +1,1094 @@
+/*
+ * Custom OID/ioctl definitions for
+ * Broadcom 802.11abg Networking Device Driver
+ *
+ * Definitions subject to change without notice.
+ *
+ * Copyright 2004, Broadcom Corporation
+ * All Rights Reserved.
+ * 
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
+ *
+ * $Id$
+ */
+
+#ifndef _wlioctl_h_
+#define        _wlioctl_h_
+
+#include <typedefs.h>
+#include <proto/ethernet.h>
+#include <proto/802.11.h>
+
+#if defined(__GNUC__)
+#define        PACKED  __attribute__((packed))
+#else
+#define        PACKED
+#endif
+
+#define WLC_ESSID_MAX_SIZE     32
+
+#define WL_NUMRATES            255     /* max # of rates in a rateset */
+
+typedef struct wl_rateset {
+       uint32  count;                  /* # rates in this set */
+       uint8   rates[WL_NUMRATES];     /* rates in 500kbps units w/hi bit set if basic */
+} wl_rateset_t;
+
+#define WL_CHANSPEC_CHAN_MASK  0x0fff
+#define WL_CHANSPEC_BAND_MASK  0xf000
+#define WL_CHANSPEC_BAND_SHIFT 12
+#define WL_CHANSPEC_BAND_A     0x1000
+#define WL_CHANSPEC_BAND_B     0x2000
+
+/*
+ * Per-bss information structure.
+ */
+
+#define        WL_LEGACY_BSS_INFO_VERSION      106     /* an older supported version of wl_bss_info struct */
+#define        WL_BSS_INFO_VERSION             107     /* current version of wl_bss_info struct */
+
+typedef struct wl_bss_info106 {
+       uint            version;        /* version field */
+       struct ether_addr BSSID;
+       uint8           SSID_len;
+       uint8           SSID[32];
+       uint8           Privacy;        /* 0=No WEP, 1=Use WEP */
+       int16           RSSI;           /* receive signal strength (in dBm) */
+       uint16          beacon_period;  /* units are Kusec */
+       uint16          atim_window;    /* units are Kusec */
+       uint8           channel;        /* Channel no. */
+       int8            infra;          /* 0=IBSS, 1=infrastructure, 2=unknown */
+       struct {
+               uint    count;          /* # rates in this set */
+               uint8   rates[12];      /* rates in 500kbps units w/hi bit set if basic */
+       } rateset;                      /* supported rates */
+        uint8           dtim_period;    /* DTIM period */
+       int8            phy_noise;      /* noise right after tx (in dBm) */
+       uint16          capability;     /* Capability information */
+       struct dot11_bcn_prb *prb;      /* probe response frame (ioctl na) */
+       uint16          prb_len;        /* probe response frame length (ioctl na) */
+       struct {
+               uint8 supported;        /* wpa supported */
+               uint8 multicast;        /* multicast cipher */
+               uint8 ucount;           /* count of unicast ciphers */
+               uint8 unicast[4];       /* unicast ciphers */
+               uint8 acount;           /* count of auth modes */
+               uint8 auth[4];          /* Authentication modes */
+       } wpa;
+} wl_bss_info106_t;
+
+typedef struct wl_bss_info {
+       uint32          version;        /* version field */
+       uint32          length;         /* byte length of data in this record, starting at version and including IEs */
+       struct ether_addr BSSID;
+       uint16          beacon_period;  /* units are Kusec */
+       uint16          capability;     /* Capability information */
+       uint8           SSID_len;
+       uint8           SSID[32];
+       struct {
+               uint    count;          /* # rates in this set */
+               uint8   rates[16];      /* rates in 500kbps units w/hi bit set if basic */
+       } rateset;                      /* supported rates */
+       uint8           channel;        /* Channel no. */
+       uint16          atim_window;    /* units are Kusec */
+        uint8           dtim_period;    /* DTIM period */
+       int16           RSSI;           /* receive signal strength (in dBm) */
+       int8            phy_noise;      /* noise (in dBm) */
+       uint32          ie_length;      /* byte length of Information Elements */
+       /* variable length Information Elements */
+} wl_bss_info_t;
+
+typedef struct wlc_ssid {
+       uint32          SSID_len;
+       uchar           SSID[32];
+} wlc_ssid_t;
+
+typedef struct wl_scan_params {
+       wlc_ssid_t ssid;        /* default is {0, ""} */
+       struct ether_addr bssid;/* default is bcast */
+       int8 bss_type;          /* default is any, DOT11_BSSTYPE_ANY/INFRASTRUCTURE/INDEPENDENT */
+       int8 scan_type;         /* -1 use default, DOT11_SCANTYPE_ACTIVE/PASSIVE */
+       int32 nprobes;          /* -1 use default, number of probes per channel */
+       int32 active_time;      /* -1 use default, dwell time per channel for active scanning */
+       int32 passive_time;     /* -1 use default, dwell time per channel for passive scanning */
+       int32 home_time;        /* -1 use default, dwell time for the home channel between channel scans */
+       int32 channel_num;      /* 0 use default (all available channels), count of channels in channel_list */
+       uint16 channel_list[1]; /* list of chanspecs */
+} wl_scan_params_t;
+/* size of wl_scan_params not including variable length array */
+#define WL_SCAN_PARAMS_FIXED_SIZE 64
+
+typedef struct wl_scan_results {
+       uint32 buflen;
+       uint32 version;
+       uint32 count;
+       wl_bss_info_t bss_info[1];
+} wl_scan_results_t;
+/* size of wl_scan_results not including variable length array */
+#define WL_SCAN_RESULTS_FIXED_SIZE 12
+
+/* uint32 list */
+typedef struct wl_uint32_list {
+       /* in - # of elements, out - # of entries */
+       uint32 count;
+       /* variable length uint32 list */
+       uint32 element[1];
+} wl_uint32_list_t;
+
+#define WLC_CNTRY_BUF_SZ        4       /* Country string is 3 bytes + NULL */
+
+typedef struct wl_channels_in_country {
+       uint32 buflen;
+       uint32 band;
+       char country_abbrev[WLC_CNTRY_BUF_SZ];
+       uint32 count;
+       uint32 channel[1];
+} wl_channels_in_country_t;
+
+typedef struct wl_country_list {
+       uint32 buflen;
+       uint32 band_set;
+       uint32 band;
+       uint32 count;
+       char country_abbrev[1];
+} wl_country_list_t;
+
+#define WL_RM_TYPE_BASIC       1
+#define WL_RM_TYPE_CCA         2
+#define WL_RM_TYPE_RPI         3
+
+#define WL_RM_FLAG_PARALLEL    (1<<0)
+
+#define WL_RM_FLAG_LATE                (1<<1)
+#define WL_RM_FLAG_INCAPABLE   (1<<2)
+#define WL_RM_FLAG_REFUSED     (1<<3)
+
+typedef struct wl_rm_req_elt {
+       int8    type;
+       int8    flags;
+       uint16  chanspec;
+       uint32  token;          /* token for this measurement */
+       uint32  tsf_h;          /* TSF high 32-bits of Measurement start time */
+       uint32  tsf_l;          /* TSF low 32-bits */
+       uint32  dur;            /* TUs */
+} wl_rm_req_elt_t;
+
+typedef struct wl_rm_req {
+       uint32  token;          /* overall measurement set token */
+       uint32  count;          /* number of measurement reqests */
+       wl_rm_req_elt_t req[1]; /* variable length block of requests */
+} wl_rm_req_t;
+#define WL_RM_REQ_FIXED_LEN    8
+
+typedef struct wl_rm_rep_elt {
+       int8    type;
+       int8    flags;
+       uint16  chanspec;
+       uint32  token;          /* token for this measurement */
+       uint32  tsf_h;          /* TSF high 32-bits of Measurement start time */
+       uint32  tsf_l;          /* TSF low 32-bits */
+       uint32  dur;            /* TUs */
+       uint32  len;            /* byte length of data block */
+       uint8   data[1];        /* variable length data block */
+} wl_rm_rep_elt_t;
+#define WL_RM_REP_ELT_FIXED_LEN        24      /* length excluding data block */
+
+#define WL_RPI_REP_BIN_NUM 8
+typedef struct wl_rm_rpi_rep {
+       uint8   rpi[WL_RPI_REP_BIN_NUM];
+       int8    rpi_max[WL_RPI_REP_BIN_NUM];
+} wl_rm_rpi_rep_t;
+
+typedef struct wl_rm_rep {
+       uint32  token;          /* overall measurement set token */
+       uint32  len;            /* length of measurement report block */
+       wl_rm_rep_elt_t rep[1]; /* variable length block of reports */
+} wl_rm_rep_t;
+#define WL_RM_REP_FIXED_LEN    8
+
+
+#define WLC_MAX_KEY_SIZE       32      /* max size of any key */
+#define WLC_MAX_IV_SIZE                16      /* max size of any IV */
+#define WLC_EXT_IV_FLAG                (1<<5)  /* flag to indicate IV is > 4 bytes */
+#define WLC_MAX_DEFAULT_KEYS   4       /* # of default WEP keys */
+#define WLC_MAX_KEYS           54      /* Max # of WEP keys */
+#define WLC_WEP1_KEY_SIZE      5       /* max size of any WEP key */
+#define WLC_WEP1_KEY_HEX_SIZE  10      /* size of WEP key in hex. */
+#define WLC_WEP128_KEY_SIZE    13      /* max size of any WEP key */
+#define WLC_WEP128_KEY_HEX_SIZE        26      /* size of WEP key in hex. */
+#define WLC_TKIP_MIC_SIZE      8       /* size of TKIP MIC */
+#define WLC_TKIP_EOM_SIZE      7       /* max size of TKIP EOM */
+#define WLC_TKIP_EOM_FLAG      0x5a    /* TKIP EOM flag byte */
+#define WLC_TKIP_KEY_SIZE      32      /* size of any TKIP key */
+#define WLC_TKIP_MIC_AUTH_TX   16      /* offset to Authenticator MIC TX key */
+#define WLC_TKIP_MIC_AUTH_RX   24      /* offset to Authenticator MIC RX key */
+#define WLC_TKIP_MIC_SUP_RX    16      /* offset to Supplicant MIC RX key */
+#define WLC_TKIP_MIC_SUP_TX    24      /* offset to Supplicant MIC TX key */
+#define WLC_TKIP_P1_KEY_SIZE   10      /* size of TKHash Phase1 output, in bytes */
+#define WLC_TKIP_P2_KEY_SIZE   16      /* size of TKHash Phase2 output */
+#define WLC_AES_KEY_SIZE       16      /* size of AES key */
+
+
+typedef enum sup_auth_status {
+       WLC_SUP_DISCONNECTED = 0,
+       WLC_SUP_CONNECTING,
+       WLC_SUP_IDREQUIRED,
+       WLC_SUP_AUTHENTICATING,
+       WLC_SUP_AUTHENTICATED,
+       WLC_SUP_KEYXCHANGE,
+       WLC_SUP_KEYED
+} sup_auth_status_t;
+
+/* Enumerate crypto algorithms */
+#define        CRYPTO_ALGO_OFF                 0
+#define        CRYPTO_ALGO_WEP1                1
+#define        CRYPTO_ALGO_TKIP                2
+#define        CRYPTO_ALGO_WEP128              3
+#define CRYPTO_ALGO_AES_CCM            4
+#define CRYPTO_ALGO_AES_OCB_MSDU       5
+#define CRYPTO_ALGO_AES_OCB_MPDU       6
+#define CRYPTO_ALGO_NALG               7
+
+#define WSEC_GEN_MIC_ERROR     0x0001
+#define WSEC_GEN_REPLAY                0x0002
+
+#define WL_SOFT_KEY    (1 << 0)        /* Indicates this key is using soft encrypt */
+#define WL_PRIMARY_KEY (1 << 1)        /* Indicates this key is the primary (ie tx) key */
+#define WL_KF_RES_4    (1 << 4)        /* Reserved for backward compat */
+#define WL_KF_RES_5    (1 << 5)        /* Reserved for backward compat */
+
+
+typedef struct wlc_tkip_info {
+       uint16          phase1[WLC_TKIP_P1_KEY_SIZE/sizeof(uint16)];    /* tkhash phase1 result */
+       uint8           phase2[WLC_TKIP_P2_KEY_SIZE];   /* tkhash phase2 result */
+       uint32          micl;
+       uint32          micr;
+} tkip_info_t;
+
+typedef struct _wsec_iv {
+       uint32          hi;     /* upper 32 bits of IV */
+       uint16          lo;     /* lower 16 bits of IV */
+} wsec_iv_t;
+
+typedef struct wsec_key {
+       uint32          index;          /* key index */
+       uint32          len;            /* key length */
+       uint8           data[WLC_MAX_KEY_SIZE]; /* key data */
+       tkip_info_t     tkip_tx;        /* tkip transmit state */
+       tkip_info_t     tkip_rx;        /* tkip receive state */
+       uint32          algo;           /* CRYPTO_ALGO_AES_CCM, CRYPTO_ALGO_WEP128, etc */
+       uint32          flags;          /* misc flags */
+       uint32          algo_hw;        /* cache for hw register*/
+       uint32          aes_mode;       /* cache for hw register*/
+       int             iv_len;         /* IV length */         
+       int             iv_initialized; /* has IV been initialized already? */          
+       int             icv_len;        /* ICV length */
+       wsec_iv_t       rxiv;           /* Rx IV */
+       wsec_iv_t       txiv;           /* Tx IV */
+       struct ether_addr ea;           /* per station */
+} wsec_key_t;
+
+
+
+typedef struct wl_wsec_key {
+       uint32          index;          /* key index */
+       uint32          len;            /* key length */
+       uint8           data[DOT11_MAX_KEY_SIZE];       /* key data */
+       uint32          pad_1[18];
+       uint32          algo;           /* CRYPTO_ALGO_AES_CCM, CRYPTO_ALGO_WEP128, etc */
+       uint32          flags;          /* misc flags */
+       uint32          pad_2[2];
+       int             pad_3;
+       int             iv_initialized; /* has IV been initialized already? */          
+       int             pad_4;
+       /* Rx IV */
+       struct {
+               uint32  hi;             /* upper 32 bits of IV */
+               uint16  lo;             /* lower 16 bits of IV */
+       } rxiv;
+       uint32          pad_5[2];
+       struct ether_addr ea;           /* per station */
+} wl_wsec_key_t;
+
+/* For use with wlc_wep_key.flags */
+#define WSEC_PRIMARY_KEY       (1 << 1)        /* Indicates this key is the primary (ie tx) key */
+#define WSEC_TKIP_ERROR                (1 << 2)        /* Provoke deliberate error */
+
+#define WSEC_MIN_PSK_LEN       8
+#define WSEC_MAX_PSK_LEN       64
+
+/* Flag for key material needing passhash'ing */
+#define WSEC_PASSPHRASE                (1<<0)
+
+/* recepticle for WLC_SET_WSEC_PMK parameter */
+typedef struct {
+       ushort  key_len;                /* octets in key material */
+       ushort  flags;                  /* key handling qualification */
+       uint8   key[WSEC_MAX_PSK_LEN];  /* PMK material */
+} wsec_pmk_t;
+
+/* wireless security bitvec */
+#define WEP_ENABLED            1
+#define TKIP_ENABLED           2
+#define AES_ENABLED            4
+#define WSEC_SWFLAG            8
+
+#define WSEC_SW(wsec)          ((wsec) & WSEC_SWFLAG)
+#define WSEC_HW(wsec)          (!WSEC_SW(wsec))
+#define WSEC_WEP_ENABLED(wsec) ((wsec) & WEP_ENABLED)
+#define WSEC_TKIP_ENABLED(wsec)        ((wsec) & TKIP_ENABLED)
+#define WSEC_AES_ENABLED(wsec) ((wsec) & AES_ENABLED)
+#define WSEC_ENABLED(wsec)     ((wsec) & (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED))
+
+
+/* wireless authentication bit vector */
+#define WPA_ENABLED    1
+#define PSK_ENABLED    2
+
+#define WAUTH_WPA_ENABLED(wauth)       ((wauth) & WPA_ENABLED)
+#define WAUTH_PSK_ENABLED(wauth)       ((wauth) & PSK_ENABLED)
+#define WAUTH_ENABLED(wauth)           ((wauth) & (WPA_ENABLED | PSK_ENABLED))
+
+/* group/mcast cipher */
+#define WPA_MCAST_CIPHER(wsec) (((wsec) & TKIP_ENABLED) ? WPA_CIPHER_TKIP : \
+                               ((wsec) & AES_ENABLED) ? WPA_CIPHER_AES_CCM : \
+                               WPA_CIPHER_NONE)
+
+
+typedef struct wl_led_info {
+       uint32          index;          /* led index */
+       uint32          behavior;
+       bool            activehi;
+} wl_led_info_t;
+
+/*
+ * definitions for driver messages passed from WL to NAS.
+ */
+/* Use this to recognize wpa and 802.1x driver messages. */
+static const uint8 wl_wpa_snap_template[] =
+       { 0xaa, 0xaa, 0x03, 0x00, 0x90, 0x4c };
+
+#define WL_WPA_MSG_IFNAME_MAX  16
+
+/* WPA driver message */
+typedef struct wl_wpa_header {
+       struct ether_header eth;
+       struct dot11_llc_snap_header snap;
+       uint8 version;
+       uint8 type;
+       /* version 2 additions */
+       char ifname[WL_WPA_MSG_IFNAME_MAX];
+       /* version specific data */
+       /* uint8 data[1]; */
+} wl_wpa_header_t PACKED;
+
+/*
+ * definitions for 802.2 messages passed from WL to NAS.
+ */
+/* This seems not to be defined outside the kernel on linux. */
+#ifndef ETH_P_802_2
+#define ETH_P_802_2            4
+#endif
+
+#define WL_WPA_HEADER_LEN      (ETHER_HDR_LEN + DOT11_LLC_SNAP_HDR_LEN + 2 + WL_WPA_MSG_IFNAME_MAX)
+
+/* WPA driver message ethertype - private between wlc and nas */
+#define WL_WPA_ETHER_TYPE      0x9999
+
+/* WPA driver message current version */
+#define WL_WPA_MSG_VERSION     2
+
+/* Type field values for the 802.2 driver messages for WPA. */
+#define WLC_ASSOC_MSG          1
+#define WLC_DISASSOC_MSG       2
+#define WLC_PTK_MIC_MSG                3
+#define WLC_GTK_MIC_MSG                4
+
+/* Use this to recognize 802.2 driver messages. */
+static const uint8 wpa_snap_template[] =
+       { 0xaa, 0xaa, 0x03, 0x00, 0x90, 0x4c };
+
+
+/* 802.1x driver message */
+typedef struct wl_eapol_header {
+       struct ether_header eth;
+       struct dot11_llc_snap_header snap;
+       uint8 version;
+       uint8 reserved;
+       char ifname[WL_WPA_MSG_IFNAME_MAX];
+       /* version specific data */
+       /* uint8 802_1x_msg[1]; */
+} wl_eapol_header_t PACKED;
+
+#define WL_EAPOL_HEADER_LEN    (ETHER_HDR_LEN + DOT11_LLC_SNAP_HDR_LEN + 2 + WL_WPA_MSG_IFNAME_MAX)
+
+/* 802.1x driver message ethertype - private between wlc and nas */
+#define WL_EAPOL_ETHER_TYPE    0x999A
+
+/* 802.1x driver message current version */
+#define WL_EAPOL_MSG_VERSION   1
+
+/* srom read/write struct passed through ioctl */
+typedef struct {
+       uint   byteoff;         /* byte offset */
+       uint   nbytes;          /* number of bytes */
+       uint16 buf[1];
+} srom_rw_t;
+
+/* R_REG and W_REG struct passed through ioctl */
+typedef struct {
+       uint32  byteoff;        /* byte offset of the field in d11regs_t */
+       uint32  val;            /* read/write value of the field */
+       uint32  size;           /* sizeof the field */
+} rw_reg_t;
+
+/* Structure used by GET/SET_ATTEN ioctls */
+typedef struct {
+       uint16  auto_ctrl;      /* 1: Automatic control, 0: overriden */
+       uint16  bb;             /* Baseband attenuation */
+       uint16  radio;          /* Radio attenuation */
+       uint16  txctl1;         /* Radio TX_CTL1 value */
+} atten_t;
+
+/* Used to get specific STA parameters */ 
+typedef struct {
+       uint32  val;
+       struct ether_addr ea;
+} scb_val_t;
+
+/* callback registration data types */
+
+typedef struct _mac_event_params {
+       uint msg;
+       struct ether_addr *addr;
+       uint result;
+       uint status; 
+       uint auth_type;
+} mac_event_params_t;
+
+typedef struct _mic_error_params {
+       struct ether_addr *ea;
+       bool group;
+       bool flush_txq;
+} mic_error_params_t;
+
+typedef enum _wl_callback {
+       WL_MAC_EVENT_CALLBACK = 0,
+       WL_LINK_UP_CALLBACK,
+       WL_LINK_DOWN_CALLBACK,
+       WL_MIC_ERROR_CALLBACK,
+       WL_LAST_CALLBACK
+} wl_callback_t;
+
+typedef struct _callback {
+       void (*fn)(void *, void *);
+       void *context;
+} callback_t;
+
+typedef struct _scan_callback {
+       void (*fn)(void *);
+       void *context;
+} scan_callback_t;
+
+/* used to register an arbitrary callback via the IOCTL interface */
+typedef struct _set_callback {
+       int index;
+       callback_t callback;
+} set_callback_t;
+
+
+
+/* Event data type */
+typedef struct {
+       uint msg;                       /* Message (see below) */
+       struct ether_addr *addr;        /* Station address (if applicable) */
+       uint status;                    /* Status code (see below) */
+       uint reason;                    /* Reason code (if applicable) */
+       uint auth_type;                 /* WLC_E_AUTH */
+       bool link;                      /* WLC_E_LINK */
+       bool group;                     /* WLC_E_MIC_ERROR */
+       bool flush_txq;                 /* WLC_E_MIC_ERROR */
+} wlc_event_t;
+
+typedef struct {
+       uint16          ver;    /* version of this struct */
+       uint16          cap;    /* sta's advertized capabilities */
+       uint32          flags;  /* flags defined below */
+       uint32          idle;   /* time since data pkt rx'd from sta */
+       struct ether_addr       ea;     /* Station address */
+       wl_rateset_t    rateset;        /* rateset in use */
+} sta_info_t;
+
+#define WL_STA_INFO_LEN        300
+#define WL_STA_VER     1
+
+/* flags fields */
+#define WL_STA_BRCM    0x01
+#define WL_STA_WME     0x02
+#define WL_STA_ABCAP   0x04
+#define WL_STA_AUTHE   0x08 
+#define WL_STA_ASSOC   0x10 
+#define WL_STA_AUTHO   0x20 
+
+/* Event messages */
+#define WLC_E_SET_SSID         1
+#define WLC_E_JOIN             2
+#define WLC_E_START            3
+#define WLC_E_AUTH             4
+#define WLC_E_AUTH_IND         5
+#define WLC_E_DEAUTH           6
+#define WLC_E_DEAUTH_IND       7
+#define WLC_E_ASSOC            8
+#define WLC_E_ASSOC_IND                9
+#define WLC_E_REASSOC          10
+#define WLC_E_REASSOC_IND      11
+#define WLC_E_DISASSOC         12
+#define WLC_E_DISASSOC_IND     13
+#define WLC_E_QUIET_START      14      /* 802.11h Quiet period started */
+#define WLC_E_QUIET_END                15      /* 802.11h Quiet period ended */
+#define WLC_E_GOT_BEACONS      16      
+#define WLC_E_LINK             17      /* Link indication */
+#define WLC_E_MIC_ERROR                18      /* TKIP MIC error occurred */
+#define WLC_E_NDIS_LINK                19      /* NDIS style link indication */
+#define WLC_E_ROAM             20
+#define WLC_E_LAST             21
+
+/* Event status codes */
+#define WLC_E_STATUS_SUCCESS           0
+#define WLC_E_STATUS_FAIL              1
+#define WLC_E_STATUS_TIMEOUT           2
+#define WLC_E_STATUS_NO_NETWORKS       3
+#define WLC_E_STATUS_ABORT             4
+
+typedef struct wlc_event_cb {
+       uint msg;                               /* Event message or 0 for all */
+       void (*fn)(void *, wlc_event_t *);      /* Callback function */
+       void *context;                          /* Passed to callback function */
+       struct wlc_event_cb *next;              /* Next in the chain */
+} wlc_event_cb_t;
+
+/*
+ * Country locale determines which channels are available to us.
+ */
+typedef enum _wlc_locale {
+       WLC_WW = 0,     /* Worldwide */
+       WLC_THA,        /* Thailand */
+       WLC_ISR,        /* Israel */
+       WLC_JDN,        /* Jordan */
+       WLC_PRC,        /* China */
+       WLC_JPN,        /* Japan */
+       WLC_FCC,        /* USA */
+       WLC_EUR,        /* Europe */
+       WLC_USL,        /* US Low Band only */
+       WLC_JPH,        /* Japan High Band only */
+       WLC_ALL,        /* All the channels in this band */
+       WLC_11D,        /* Represents locale recieved by 11d beacons */
+       WLC_LAST_LOCALE,
+       WLC_UNDEFINED_LOCALE = 0xf
+} wlc_locale_t;
+
+/* channel encoding */
+typedef struct channel_info {
+       int hw_channel;
+       int target_channel;
+       int scan_channel;
+} channel_info_t;
+
+/* For ioctls that take a list of MAC addresses */
+struct maclist {
+       uint count;                     /* number of MAC addresses */
+       struct ether_addr ea[1];        /* variable length array of MAC addresses */
+};
+
+/* get pkt count struct passed through ioctl */
+typedef struct get_pktcnt {
+       uint rx_good_pkt;
+       uint rx_bad_pkt;
+       uint tx_good_pkt;
+       uint tx_bad_pkt;
+} get_pktcnt_t;
+
+/* Linux network driver ioctl encoding */
+typedef struct wl_ioctl {
+       uint cmd;       /* common ioctl definition */
+       void *buf;      /* pointer to user buffer */
+       uint len;       /* length of user buffer */
+       bool set;       /* get or set request (optional) */
+       uint used;      /* bytes read or written (optional) */
+       uint needed;    /* bytes needed (optional) */
+} wl_ioctl_t;
+
+/* 
+ * Structure for passing hardware and software 
+ * revision info up from the driver. 
+ */
+typedef struct wlc_rev_info {
+       uint            vendorid;       /* PCI vendor id */
+       uint            deviceid;       /* device id of chip */
+       uint            radiorev;       /* radio revision */
+       uint            chiprev;        /* chip revision */
+       uint            corerev;        /* core revision */
+       uint            boardid;        /* board identifier (usu. PCI sub-device id) */
+       uint            boardvendor;    /* board vendor (usu. PCI sub-vendor id) */
+       uint            boardrev;       /* board revision */
+       uint            driverrev;      /* driver version */
+       uint            ucoderev;       /* microcode version */
+       uint            bus;            /* bus type */
+       uint        chipnum;    /* chip number */
+} wlc_rev_info_t;
+
+/* check this magic number */
+#define WLC_IOCTL_MAGIC                0x14e46c77
+
+/* bump this number if you change the ioctl interface */
+#define WLC_IOCTL_VERSION      1
+
+/* maximum length buffer required */
+#define WLC_IOCTL_MAXLEN       8192
+
+/* common ioctl definitions */
+#define WLC_GET_MAGIC                          0
+#define WLC_GET_VERSION                                1
+#define WLC_UP                                 2
+#define WLC_DOWN                               3
+#define WLC_GET_LOOP                           4
+#define WLC_SET_LOOP                           5
+#define WLC_DUMP                               6
+#define WLC_GET_MSGLEVEL                       7
+#define WLC_SET_MSGLEVEL                       8
+#define WLC_GET_PROMISC                                9
+#define WLC_SET_PROMISC                                10
+#define WLC_OBSOLETE                           11 
+#define WLC_GET_RATE                           12
+#define WLC_SET_RATE                           13
+#define WLC_GET_INSTANCE                       14
+#define WLC_GET_FRAG                           15
+#define WLC_SET_FRAG                           16
+#define WLC_GET_RTS                            17
+#define WLC_SET_RTS                            18
+#define WLC_GET_INFRA                          19
+#define WLC_SET_INFRA                          20
+#define WLC_GET_AUTH                           21
+#define WLC_SET_AUTH                           22
+#define WLC_GET_BSSID                          23
+#define WLC_SET_BSSID                          24
+#define WLC_GET_SSID                           25
+#define WLC_SET_SSID                           26
+#define WLC_RESTART                            27
+#define WLC_DUMP_SCB                           28 
+#define WLC_GET_CHANNEL                                29
+#define WLC_SET_CHANNEL                                30
+#define WLC_GET_SRL                            31
+#define WLC_SET_SRL                            32
+#define WLC_GET_LRL                            33
+#define WLC_SET_LRL                            34
+#define WLC_GET_PLCPHDR                                35
+#define WLC_SET_PLCPHDR                                36
+#define WLC_GET_RADIO                          37
+#define WLC_SET_RADIO                          38
+#define WLC_GET_PHYTYPE                                39
+#define WLC_DUMP_RATE                          40
+#define WLC_SET_RATE_PARAMS                    41
+#define WLC_GET_WEP                            42
+#define WLC_SET_WEP                            43
+#define WLC_GET_KEY                            44
+#define WLC_SET_KEY                            45
+#define WLC_GET_REGULATORY                     46
+#define WLC_SET_REGULATORY                     47
+#define WLC_GET_PASSIVE                                48      /* added by nbd */
+#define WLC_SET_PASSIVE                                49      /* added by nbd */
+#define WLC_SCAN                               50
+#define WLC_SCAN_RESULTS                       51
+#define WLC_DISASSOC                           52
+#define WLC_REASSOC                            53
+#define WLC_GET_ROAM_TRIGGER                   54
+#define WLC_SET_ROAM_TRIGGER                   55
+#define WLC_GET_ROAM_DELTA                     56
+#define WLC_SET_ROAM_DELTA                     57
+#define WLC_GET_ROAM_SCAN_PERIOD               58
+#define WLC_SET_ROAM_SCAN_PERIOD               59
+#define WLC_EVM                                        60
+#define WLC_GET_TXANT                          61
+#define WLC_SET_TXANT                          62
+#define WLC_GET_ANTDIV                         63
+#define WLC_SET_ANTDIV                         64
+#define WLC_GET_TXPWR                          65
+#define WLC_SET_TXPWR                          66
+#define WLC_GET_CLOSED                         67
+#define WLC_SET_CLOSED                         68
+#define WLC_GET_MACLIST                                69
+#define WLC_SET_MACLIST                                70
+#define WLC_GET_RATESET                                71
+#define WLC_SET_RATESET                                72
+#define WLC_GET_LOCALE                         73
+#define WLC_SET_LOCALE                         74
+#define WLC_GET_BCNPRD                         75
+#define WLC_SET_BCNPRD                         76
+#define WLC_GET_DTIMPRD                                77
+#define WLC_SET_DTIMPRD                                78
+#define WLC_GET_SROM                           79
+#define WLC_SET_SROM                           80
+#define WLC_GET_WEP_RESTRICT                   81
+#define WLC_SET_WEP_RESTRICT                   82
+#define WLC_GET_COUNTRY                                83
+#define WLC_SET_COUNTRY                                84
+#define WLC_GET_PM                             85
+#define WLC_SET_PM                             86
+#define WLC_GET_WAKE                           87
+#define WLC_SET_WAKE                           88
+#define        WLC_GET_D11CNTS                         89
+#define WLC_GET_FORCELINK                      90      /* ndis only */
+#define WLC_SET_FORCELINK                      91      /* ndis only */
+#define WLC_FREQ_ACCURACY                      92
+#define WLC_CARRIER_SUPPRESS                   93
+#define WLC_GET_PHYREG                         94
+#define WLC_SET_PHYREG                         95
+#define WLC_GET_RADIOREG                       96
+#define WLC_SET_RADIOREG                       97
+#define WLC_GET_REVINFO                                98
+#define WLC_GET_UCANTDIV                       99
+#define WLC_SET_UCANTDIV                       100
+#define WLC_R_REG                              101
+#define WLC_W_REG                              102
+#define WLC_DIAG_LOOPBACK                      103
+#define WLC_RESET_D11CNTS                      104
+#define WLC_GET_MACMODE                                105
+#define WLC_SET_MACMODE                                106
+#define WLC_GET_MONITOR                                107     /* added by nbd */
+#define WLC_SET_MONITOR                                108     /* added by nbd */
+#define WLC_GET_GMODE                          109
+#define WLC_SET_GMODE                          110
+#define WLC_GET_LEGACY_ERP                     111
+#define WLC_SET_LEGACY_ERP                     112
+#define WLC_GET_RX_ANT                         113
+#define WLC_GET_CURR_RATESET                   114     /* current rateset */
+#define WLC_GET_SCANSUPPRESS                   115
+#define WLC_SET_SCANSUPPRESS                   116
+#define WLC_GET_AP                             117
+#define WLC_SET_AP                             118
+#define WLC_GET_EAP_RESTRICT                   119
+#define WLC_SET_EAP_RESTRICT                   120
+#define WLC_SCB_AUTHORIZE                      121
+#define WLC_SCB_DEAUTHORIZE                    122
+#define WLC_GET_WDSLIST                                123
+#define WLC_SET_WDSLIST                                124
+#define WLC_GET_ATIM                           125
+#define WLC_SET_ATIM                           126
+#define WLC_GET_RSSI                           127
+#define WLC_GET_PHYANTDIV                      128
+#define WLC_SET_PHYANTDIV                      129
+#define WLC_AP_RX_ONLY                         130
+#define WLC_GET_TX_PATH_PWR                    131
+#define WLC_SET_TX_PATH_PWR                    132
+#define WLC_GET_WSEC                           133
+#define WLC_SET_WSEC                           134
+#define WLC_GET_PHY_NOISE                      135
+#define WLC_GET_BSS_INFO                       136
+#define WLC_GET_PKTCNTS                                137
+#define WLC_GET_LAZYWDS                                138
+#define WLC_SET_LAZYWDS                                139
+#define WLC_GET_BANDLIST                       140
+#define WLC_GET_BAND                           141
+#define WLC_SET_BAND                           142
+#define WLC_SCB_DEAUTHENTICATE                 143
+#define WLC_GET_SHORTSLOT                      144
+#define WLC_GET_SHORTSLOT_OVERRIDE             145
+#define WLC_SET_SHORTSLOT_OVERRIDE             146
+#define WLC_GET_SHORTSLOT_RESTRICT             147
+#define WLC_SET_SHORTSLOT_RESTRICT             148
+#define WLC_GET_GMODE_PROTECTION               149
+#define WLC_GET_GMODE_PROTECTION_OVERRIDE      150
+#define WLC_SET_GMODE_PROTECTION_OVERRIDE      151
+#define WLC_UPGRADE                            152
+#define WLC_GET_MRATE                          153
+#define WLC_SET_MRATE                          154
+#define WLC_GET_IGNORE_BCNS                    155
+#define WLC_SET_IGNORE_BCNS                    156
+#define WLC_GET_SCB_TIMEOUT                    157
+#define WLC_SET_SCB_TIMEOUT                    158
+#define WLC_GET_ASSOCLIST                      159
+#define WLC_GET_CLK                            160
+#define WLC_SET_CLK                            161
+#define WLC_GET_UP                             162
+#define WLC_OUT                                        163
+#define WLC_GET_WPA_AUTH                       164
+#define WLC_SET_WPA_AUTH                       165
+#define WLC_GET_UCFLAGS                                166
+#define WLC_SET_UCFLAGS                                167
+#define WLC_GET_PWRIDX                         168
+#define WLC_SET_PWRIDX                         169
+#define WLC_GET_TSSI                           170
+#define WLC_GET_SUP_RATESET_OVERRIDE           171
+#define WLC_SET_SUP_RATESET_OVERRIDE           172
+#define WLC_SET_FAST_TIMER                     173
+#define WLC_GET_FAST_TIMER                     174
+#define WLC_SET_SLOW_TIMER                     175
+#define WLC_GET_SLOW_TIMER                     176
+#define WLC_DUMP_PHYREGS                       177
+#define WLC_GET_GMODE_PROTECTION_CONTROL       178
+#define WLC_SET_GMODE_PROTECTION_CONTROL       179
+#define WLC_GET_PHYLIST                                180
+#define WLC_ENCRYPT_STRENGTH                   181     /* ndis only */
+#define WLC_DECRYPT_STATUS                     182     /* ndis only */
+#define WLC_GET_KEY_SEQ                                183
+#define WLC_GET_SCAN_CHANNEL_TIME              184
+#define WLC_SET_SCAN_CHANNEL_TIME              185
+#define WLC_GET_SCAN_UNASSOC_TIME              186
+#define WLC_SET_SCAN_UNASSOC_TIME              187
+#define WLC_GET_SCAN_HOME_TIME                 188
+#define WLC_SET_SCAN_HOME_TIME                 189
+#define WLC_GET_SCAN_PASSES                    190
+#define WLC_SET_SCAN_PASSES                    191
+#define WLC_GET_PRB_RESP_TIMEOUT               192
+#define WLC_SET_PRB_RESP_TIMEOUT               193
+#define WLC_GET_ATTEN                          194
+#define WLC_SET_ATTEN                          195
+#define WLC_GET_SHMEM                          196     /* diag */
+#define WLC_SET_SHMEM                          197     /* diag */
+#define WLC_GET_GMODE_PROTECTION_CTS           198
+#define WLC_SET_GMODE_PROTECTION_CTS           199
+#define WLC_SET_TKIP_MIC_FLAG                  200
+#define WLC_SCB_DEAUTHENTICATE_FOR_REASON      201
+#define WLC_TKIP_COUNTERMEASURES               202
+#define WLC_GET_PIOMODE                                203
+#define WLC_SET_PIOMODE                                204
+#define WLC_SET_LED                            209
+#define WLC_GET_LED                            210
+#define WLC_GET_INTERFERENCE_MODE              211
+#define WLC_SET_INTERFERENCE_MODE              212
+#define WLC_GET_CHANNEL_QA                     213
+#define WLC_START_CHANNEL_QA                   214
+#define WLC_GET_CHANNEL_SEL                    215
+#define WLC_START_CHANNEL_SEL                  216
+#define WLC_GET_VALID_CHANNELS                 217
+#define WLC_GET_FAKEFRAG                       218
+#define WLC_SET_FAKEFRAG                       219
+#define WLC_GET_PWROUT_PERCENTAGE              220
+#define WLC_SET_PWROUT_PERCENTAGE              221
+#define WLC_SET_BAD_FRAME_PREEMPT              222
+#define WLC_GET_BAD_FRAME_PREEMPT              223
+#define WLC_SET_LEAP_LIST                      224
+#define WLC_GET_LEAP_LIST                      225
+#define WLC_GET_CWMIN                          226
+#define WLC_SET_CWMIN                          227
+#define WLC_GET_CWMAX                          228
+#define WLC_SET_CWMAX                          229
+#define WLC_GET_WET                            230
+#define WLC_SET_WET                            231
+#define WLC_GET_KEY_PRIMARY                    235
+#define WLC_SET_KEY_PRIMARY                    236
+#define WLC_SCAN_WITH_CALLBACK                 240
+#define WLC_WDS_GET_REMOTE_HWADDR              246     /* currently handled in wl_linux.c/wl_vx.c */
+#define WLC_SET_CS_SCAN_TIMER                  248
+#define WLC_GET_CS_SCAN_TIMER                  249
+#define WLC_CURRENT_PWR                                256
+#define WLC_GET_CHANNELS_IN_COUNTRY            260
+#define WLC_GET_COUNTRY_LIST                   261
+#define WLC_GET_VAR                            262     /* get value of named variable */
+#define WLC_SET_VAR                            263     /* set named variable to value */
+#define WLC_NVRAM_GET                          264
+#define WLC_NVRAM_SET                          265
+#define WLC_SET_WSEC_PMK                       268
+#define WLC_GET_AUTH_MODE                      269
+#define WLC_SET_AUTH_MODE                      270
+#define WLC_LAST                               273     /* do not change - use get_var/set_var */
+
+/*
+ * Minor kludge alert:
+ * Duplicate a few definitions that irelay requires from epiioctl.h here
+ * so caller doesn't have to include this file and epiioctl.h .
+ * If this grows any more, it would be time to move these irelay-specific
+ * definitions out of the epiioctl.h and into a separate driver common file.
+ */
+#ifndef EPICTRL_COOKIE
+#define EPICTRL_COOKIE         0xABADCEDE
+#endif
+
+/* vx wlc ioctl's offset */
+#define CMN_IOCTL_OFF 0x180
+
+/*
+ * custom OID support
+ *
+ * 0xFF - implementation specific OID
+ * 0xE4 - first byte of Broadcom PCI vendor ID
+ * 0x14 - second byte of Broadcom PCI vendor ID
+ * 0xXX - the custom OID number
+ */
+
+/* begin 0x1f values beyond the start of the ET driver range. */
+#define WL_OID_BASE            0xFFE41420
+
+/* NDIS overrides */
+#define OID_WL_GETINSTANCE     (WL_OID_BASE + WLC_GET_INSTANCE)
+#define OID_WL_GET_FORCELINK   (WL_OID_BASE + WLC_GET_FORCELINK)
+#define OID_WL_SET_FORCELINK   (WL_OID_BASE + WLC_SET_FORCELINK)
+#define        OID_WL_ENCRYPT_STRENGTH (WL_OID_BASE + WLC_ENCRYPT_STRENGTH)
+#define OID_WL_DECRYPT_STATUS  (WL_OID_BASE + WLC_DECRYPT_STATUS)
+
+#define WL_DECRYPT_STATUS_SUCCESS      1
+#define WL_DECRYPT_STATUS_FAILURE      2
+#define WL_DECRYPT_STATUS_UNKNOWN      3
+
+/* allows user-mode app to poll the status of USB image upgrade */
+#define WLC_UPGRADE_SUCCESS                    0
+#define WLC_UPGRADE_PENDING                    1
+
+/* Bit masks for radio disabled status - returned by WL_GET_RADIO */
+#define WL_RADIO_SW_DISABLE    (1<<0)
+#define WL_RADIO_HW_DISABLE    (1<<1)
+
+/* Override bit for WLC_SET_TXPWR.  if set, ignore other level limits */
+#define WL_TXPWR_OVERRIDE      (1<<31)
+
+
+/* Bus types */
+#define WL_SB_BUS      0       /* Silicon Backplane */
+#define WL_PCI_BUS     1       /* PCI target */
+#define WL_PCMCIA_BUS  2       /* PCMCIA target */
+
+/* band types */
+#define        WLC_BAND_AUTO           0       /* auto-select */
+#define        WLC_BAND_A              1       /* "a" band (5   Ghz) */
+#define        WLC_BAND_B              2       /* "b" band (2.4 Ghz) */
+
+/* MAC list modes */
+#define WLC_MACMODE_DISABLED   0       /* MAC list disabled */
+#define WLC_MACMODE_DENY       1       /* Deny specified (i.e. allow unspecified) */
+#define WLC_MACMODE_ALLOW      2       /* Allow specified (i.e. deny unspecified) */   
+
+
+/* 54g modes (basic bits may still be overridden) */
+#define GMODE_LEGACY_B         0       /* Rateset: 1b, 2b, 5.5, 11 */
+                                       /* Preamble: Long */
+                                       /* Shortslot: Off */
+#define GMODE_AUTO             1       /* Rateset: 1b, 2b, 5.5b, 11b, 18, 24, 36, 54 */
+                                       /* Extended Rateset: 6, 9, 12, 48 */
+                                       /* Preamble: Long */
+                                       /* Shortslot: Auto */
+#define GMODE_ONLY             2       /* Rateset: 1b, 2b, 5.5b, 11b, 18, 24b, 36, 54 */
+                                       /* Extended Rateset: 6b, 9, 12b, 48 */
+                                       /* Preamble: Short required */
+                                       /* Shortslot: Auto */
+#define GMODE_B_DEFERRED       3       /* Rateset: 1b, 2b, 5.5b, 11b, 18, 24, 36, 54 */
+                                       /* Extended Rateset: 6, 9, 12, 48 */
+                                       /* Preamble: Long */
+                                       /* Shortslot: On */
+#define GMODE_PERFORMANCE      4       /* Rateset: 1b, 2b, 5.5b, 6b, 9, 11b, 12b, 18, 24b, 36, 48, 54 */
+                                       /* Preamble: Short required */
+                                       /* Shortslot: On and required */
+#define GMODE_LRS              5       /* Rateset: 1b, 2b, 5.5b, 11b */
+                                       /* Extended Rateset: 6, 9, 12, 18, 24, 36, 48, 54 */
+                                       /* Preamble: Long */
+                                       /* Shortslot: Auto */
+#define GMODE_MAX              6
+
+
+/* values for PLCPHdr_override */
+#define WLC_PLCP_AUTO  -1
+#define WLC_PLCP_SHORT 0
+#define WLC_PLCP_LONG  1
+
+/* values for g_protection_override */
+#define WLC_G_PROTECTION_AUTO  -1
+#define WLC_G_PROTECTION_OFF   0
+#define WLC_G_PROTECTION_ON    1
+
+/* values for g_protection_control */
+#define WLC_G_PROTECTION_CTL_OFF       0
+#define WLC_G_PROTECTION_CTL_LOCAL     1
+#define WLC_G_PROTECTION_CTL_OVERLAP   2
+
+/* Values for PM */
+#define PM_OFF 0
+#define PM_MAX 1
+#define PM_FAST 2
+
+/* interference mitigation options */
+#define        INTERFERE_NONE  0       /* off */
+#define        NON_WLAN        1       /* foreign/non 802.11 interference, no auto detect */
+#define        WLAN_MANUAL     2       /* ACI: no auto detection */
+#define        WLAN_AUTO       3       /* ACI: auto - detact */
+
+/* Message levels */
+#define WL_ERROR_VAL           0x0001
+#define WL_TRACE_VAL           0x0002
+#define WL_PRHDRS_VAL          0x0004
+#define WL_PRPKT_VAL           0x0008
+#define WL_INFORM_VAL          0x0010
+#define WL_TMP_VAL             0x0020
+#define WL_OID_VAL             0x0040
+#define WL_RATE_VAL            0x0080
+#define WL_ASSOC_VAL           0x0100
+#define WL_PRUSR_VAL           0x0200
+#define WL_PS_VAL              0x0400
+#define WL_TXPWR_VAL           0x0800
+#define WL_GMODE_VAL           0x1000
+#define WL_DUAL_VAL            0x2000
+#define WL_WSEC_VAL            0x4000
+#define WL_WSEC_DUMP_VAL       0x8000
+#define WL_LOG_VAL             0x10000
+#define WL_NRSSI_VAL           0x20000
+#define WL_LOFT_VAL            0x40000
+#define WL_REGULATORY_VAL      0x80000
+#define WL_ACI_VAL             0x100000
+
+
+/* 802.11h enforcement levels */
+#define SPECT_MNGMT_OFF         0   /* 11h disabled */
+#define SPECT_MNGMT_LOOSE       1   /* Allow scan lists to contain non-11h AP */
+                                   /* when 11h is enabled */
+#define SPECT_MNGMT_STRICT      2   /* Prine out non-11h APs from scan list */
+
+
+
+/* max # of leds supported by GPIO (gpio pin# == led index#) */
+#define        WL_LED_NUMGPIO          16      /* gpio 0-15 */
+
+/* led per-pin behaviors */
+#define        WL_LED_OFF              0               /* always off */
+#define        WL_LED_ON               1               /* always on */
+#define        WL_LED_ACTIVITY         2               /* activity */
+#define        WL_LED_RADIO            3               /* radio enabled */
+#define        WL_LED_ARADIO           4               /* 5  Ghz radio enabled */
+#define        WL_LED_BRADIO           5               /* 2.4Ghz radio enabled */
+#define        WL_LED_BGMODE           6               /* on if gmode, off if bmode */
+#define        WL_LED_WI1              7               
+#define        WL_LED_WI2              8               
+#define        WL_LED_WI3              9               
+#define        WL_LED_ASSOC            10              /* associated state indicator */
+#define        WL_LED_INACTIVE         11              /* null behavior (clears default behavior) */
+#define        WL_LED_NUMBEHAVIOR      12
+
+/* led behavior numeric value format */
+#define        WL_LED_BEH_MASK         0x7f            /* behavior mask */
+#define        WL_LED_AL_MASK          0x80            /* activelow (polarity) bit */
+
+
+/* maximum channels */
+#define WL_NUMCHANNELS 64      /* max # of channels in the band */
+
+/* rate check */
+#define WL_RATE_OFDM(r)                (((r) & 0x7f) == 12 || ((r) & 0x7f) == 18 || \
+                                ((r) & 0x7f) == 24 || ((r) & 0x7f) == 36 || \
+                                ((r) & 0x7f) == 48 || ((r) & 0x7f) == 72 || \
+                                ((r) & 0x7f) == 96 || ((r) & 0x7f) == 108)
+
+/* WDS link local endpoint WPA role */
+#define WL_WDS_WPA_ROLE_AUTH   0       /* authenticator */
+#define WL_WDS_WPA_ROLE_SUP    1       /* supplicant */
+#define WL_WDS_WPA_ROLE_AUTO   255     /* auto, based on mac addr value */
+
+/* afterburner_override */
+#define        ABO_AUTO                -1      /* auto - no override */
+#define        ABO_OFF                 0       /* force afterburner off */
+#define        ABO_ON                  1       /* force afterburner on */
+
+#define GMODE_AFTERBURNER 6
+
+#undef PACKED
+
+#endif /* _wlioctl_h_ */
diff --git a/openwrt/target/linux/package/openwrt/include/wlutils.h b/openwrt/target/linux/package/openwrt/include/wlutils.h
new file mode 100644 (file)
index 0000000..07e2536
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Broadcom wireless network adapter utility functions
+ *
+ * Copyright 2004, Broadcom Corporation
+ * All Rights Reserved.
+ * 
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
+ *
+ * $Id$
+ */
+
+#ifndef _wlutils_h_
+#define _wlutils_h_
+
+#include <typedefs.h>
+#include <wlioctl.h>
+
+/*
+ * Pass a wlioctl request to the specified interface.
+ * @param      name    interface name
+ * @param      cmd     WLC_GET_MAGIC <= cmd < WLC_LAST
+ * @param      buf     buffer for passing in and/or receiving data
+ * @param      len     length of buf
+ * @return     >= 0 if successful or < 0 otherwise
+ */
+extern int wl_ioctl(char *name, int cmd, void *buf, int len);
+
+/*
+ * Get the MAC (hardware) address of the specified interface.
+ * @param      name    interface name
+ * @param      hwaddr  6-byte buffer for receiving address
+ * @return     >= 0 if successful or < 0 otherwise
+ */
+extern int wl_hwaddr(char *name, unsigned char *hwaddr);
+
+/*
+ * Probe the specified interface.
+ * @param      name    interface name
+ * @return     >= 0 if a Broadcom wireless device or < 0 otherwise
+ */
+extern int wl_probe(char *name);
+
+/*
+ * Set/Get named variable.
+ * @param      name    interface name
+ * @param      var     variable name
+ * @param      val     variable value/buffer
+ * @param      len     variable value/buffer length
+ * @return     success == 0, failure != 0
+ */
+extern int wl_set_val(char *name, char *var, void *val, int len);
+extern int wl_get_val(char *name, char *var, void *val, int len);
+extern int wl_set_int(char *name, char *var, int val);
+extern int wl_get_int(char *name, char *var, int *val);
+
+#endif /* _wlutils_h_ */
diff --git a/openwrt/target/linux/package/openwrt/ipkg/base-files-arch.control b/openwrt/target/linux/package/openwrt/ipkg/base-files-arch.control
new file mode 100644 (file)
index 0000000..5396f68
--- /dev/null
@@ -0,0 +1,6 @@
+Package: base-files-arch
+Priority: optional
+Section: sys
+Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
+Source: buildroot internal
+Description: Board/architecture specific files 
diff --git a/openwrt/target/linux/package/openwrt/jffs2root.c b/openwrt/target/linux/package/openwrt/jffs2root.c
new file mode 100644 (file)
index 0000000..36b928f
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * jffs2root.c
+ *
+ * Copyright (C) 2005 Mike Baker 
+ *
+ * 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, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * $Id$
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <string.h>
+
+#include <sys/ioctl.h>
+#include <linux/mtd/mtd.h>
+
+#define FILENAME "/dev/mtdblock/1"
+
+struct trx_header {
+    unsigned magic;            /* "HDR0" */
+    unsigned len;              /* Length of file including header */
+    unsigned crc32;            /* 32-bit CRC from flag_version to end of file */
+    unsigned flag_version;     /* 0:15 flags, 16:31 version */
+    unsigned offsets[3];       /* Offsets of partitions from start of header */
+};
+
+unsigned long *crc32;
+
+void init_crc32()
+{
+    unsigned long crc;
+    unsigned long poly = 0xEDB88320L;
+    int n, bit;
+    if ((crc32 = (unsigned long *) malloc(256 * sizeof(unsigned long))) == (void *)-1) {
+           perror("malloc");
+           exit(1);
+    }
+    for (n = 0; n < 256; n++) {
+       crc = (unsigned long) n;
+       for (bit = 0; bit < 8; bit++)
+           crc = (crc & 1) ? (poly ^ (crc >> 1)) : (crc >> 1);
+       crc32[n] = crc;
+    }
+}
+
+unsigned int crc32buf(char *buf, size_t len)
+{
+    unsigned int crc = 0xFFFFFFFF;
+    for (; len; len--, buf++)
+       crc = crc32[(crc ^ *buf) & 0xff] ^ (crc >> 8);
+    return crc;
+}
+
+int main(int argc, char **argv)
+{
+    int fd;
+    struct mtd_info_user mtdInfo;
+    unsigned long len;
+    struct trx_header *ptr;
+       
+    if (((fd = open(FILENAME, O_RDWR))  < 0)
+    || ((len = lseek(fd, 0, SEEK_END)) < 0)
+    || ((ptr = (struct trx_header *) mmap(0, len, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0)) == (void *) (-1))
+    || (ptr->magic != 0x30524448)) {
+       printf("Error reading trx info\n");
+       exit(-1);
+    }
+    close (fd);
+
+    if (((fd = open("/dev/mtd/1", O_RDWR))  < 0)
+    || (ioctl(fd, MEMGETINFO, &mtdInfo))) {
+      fprintf(stderr, "Could not get MTD device info from %s\n", FILENAME);
+      close(fd);
+      exit(1);
+    }
+    close(fd);
+
+    if (argc > 1 && !strcmp(argv[1],"--move")) {
+      if (ptr->offsets[2] >= ptr->len) {
+        printf("Partition already moved outside trx\n");
+      } else {
+       init_crc32();
+       ptr->offsets[2] +=  (mtdInfo.erasesize - 1);
+       ptr->offsets[2] &= ~(mtdInfo.erasesize - 1);
+        ptr->len = ptr->offsets[2];
+        ptr->crc32 = crc32buf((void *) &(ptr->flag_version), ptr->len - offsetof(struct trx_header, flag_version));
+       msync(ptr,sizeof(struct trx_header),MS_SYNC|MS_INVALIDATE);
+       printf("Partition moved; please reboot\n");
+      }
+    } else {
+      int x;
+      printf(" erase: 0x%08x\n",mtdInfo.erasesize);
+      printf("=== trx ===\n");
+      printf("mapped: 0x%08x\n", (unsigned)ptr);
+      printf(" magic: 0x%08x\n", ptr->magic);
+      printf("   len: 0x%08x\n", ptr->len);
+      printf("   crc: 0x%08x\n", ptr->crc32);
+      for (x = 0; x < 3; x++)
+       printf(" offset[%d]: 0x%08x\n", x, ptr->offsets[x]);
+    }
+
+    munmap((void *) ptr, len);
+    return 0;
+}
index 926cf4b3c42aabc070a6b2d7c79cda41a92d7727..5958eeb899c6511cc9427f96d8b4790e2ede336a 100644 (file)
@@ -5,3 +5,11 @@ config BR2_PACKAGE_KMOD_WLCOMPAT
        help
          A wrapper module, that provides Wireless Extension support for the
          proprietary Broadcom wl module.
+
+config BR2_PACKAGE_KMOD_WLCOMPAT_DEBUG
+       tristate "kmod-wlcompat-debug"
+       default m
+       depends BR2_PACKAGE_KMOD_BRCM_WL
+       help
+         A wrapper module, that provides Wireless Extension support for the
+         proprietary Broadcom wl module. (debug version)
index 706948e8ea798e700337cf1dd390322e4a7a7dd0..2d1d573546ffe58848f54c8f4cae89205ee06960 100644 (file)
@@ -3,12 +3,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME := kmod-wlcompat
-PKG_RELEASE := 1
+PKG_RELEASE := 3
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
 include $(TOPDIR)/package/rules.mk
 
 $(eval $(call PKG_template,KMOD_WLCOMPAT,$(PKG_NAME),$(LINUX_VERSION)-$(BOARD)-$(PKG_RELEASE),$(ARCH),kernel ($(LINUX_VERSION)-$(BOARD)-$(KERNEL_RELEASE))))
+$(eval $(call PKG_template,KMOD_WLCOMPAT_DEBUG,$(PKG_NAME)-debug,$(LINUX_VERSION)-$(BOARD)-$(PKG_RELEASE),$(ARCH),kernel ($(LINUX_VERSION)-$(BOARD)-$(KERNEL_RELEASE))))
 
 ifeq ($(KERNEL_DIR),)
 KERNEL_DIR:=$(LINUX_DIR)
@@ -17,7 +18,7 @@ endif
 WLCOMPAT_FLAGS:=$(TARGET_CFLAGS) -D__KERNEL__ -fno-strict-aliasing -fno-common -fomit-frame-pointer -G 0 \
                -mno-abicalls -fno-pic -finline-limit=100000 -mabi=32 -march=mips32 -Wa,-32 -Wa,-march=mips32 \
                -Wa,-mips32 -Wa,--trap -DMODULE -mlong-calls -fno-common -I. -I linux-2.4 -funsigned-char -nostdinc \
-               -iwithprefix include -I$(KERNEL_DIR)/include -I$(KERNEL_DIR)/include/asm/gcc -I$(TOPDIR)/package/openwrt/include -c
+               -iwithprefix include -I$(KERNEL_DIR)/include -I$(KERNEL_DIR)/include/asm/gcc -I../openwrt/include -c
 
 $(PKG_BUILD_DIR)/.prepared:
        mkdir -p $(PKG_BUILD_DIR)
@@ -32,9 +33,15 @@ $(PKG_BUILD_DIR)/wlcompat.o: $(PKG_BUILD_DIR)/.prepared
 $(PKG_BUILD_DIR)/wlcompat-debug.o: $(PKG_BUILD_DIR)/.prepared
        $(TARGET_CC) -DDEBUG $(WLCOMPAT_FLAGS) -o $@ wlcompat.c
 
-$(IPKG_KMOD_WLCOMPAT): $(PKG_BUILD_DIR)/wlcompat.o $(PKG_BUILD_DIR)/wlcompat-debug.o
+$(IPKG_KMOD_WLCOMPAT): $(PKG_BUILD_DIR)/wlcompat.o
        mkdir -p $(IDIR_KMOD_WLCOMPAT)/etc/modules.d
        echo "wlcompat" > $(IDIR_KMOD_WLCOMPAT)/etc/modules.d/10-wlcompat
        mkdir -p $(IDIR_KMOD_WLCOMPAT)/lib/modules/$(LINUX_VERSION)
-       cp $(PKG_BUILD_DIR)/*.o $(IDIR_KMOD_WLCOMPAT)/lib/modules/$(LINUX_VERSION)/
+       cp $(PKG_BUILD_DIR)/wlcompat.o $(IDIR_KMOD_WLCOMPAT)/lib/modules/$(LINUX_VERSION)/
        $(IPKG_BUILD) $(IDIR_KMOD_WLCOMPAT) $(PACKAGE_DIR)
+
+$(IPKG_KMOD_WLCOMPAT_DEBUG): $(PKG_BUILD_DIR)/wlcompat-debug.o
+       mkdir -p $(IDIR_KMOD_WLCOMPAT_DEBUG)/lib/modules/$(LINUX_VERSION)
+       cp $(PKG_BUILD_DIR)/wlcompat-debug.o $(IDIR_KMOD_WLCOMPAT_DEBUG)/lib/modules/$(LINUX_VERSION)/
+       $(IPKG_BUILD) $(IDIR_KMOD_WLCOMPAT_DEBUG) $(PACKAGE_DIR)
+
diff --git a/openwrt/target/linux/package/wlcompat/ipkg/kmod-wlcompat-debug.control b/openwrt/target/linux/package/wlcompat/ipkg/kmod-wlcompat-debug.control
new file mode 100644 (file)
index 0000000..1c8f1ea
--- /dev/null
@@ -0,0 +1,7 @@
+Package: kmod-wlcompat-debug
+Priority: optional
+Section: sys
+Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
+Source: buildroot internal
+Depends: kmod-brcm-wl
+Description: Compatibility module for using the Wireless Extension with broadcom's wl (debug)
index 1d2a363251ed047dc366e05569654e2b63e34c25..07e8db0884ce3875dfc74cdf25fbf83e5702faf2 100644 (file)
@@ -2,7 +2,7 @@
  * wlcompat.c
  *
  * Copyright (C) 2005 Mike Baker,
- *                    Felix Fietkau <nbd@vd-s.ath.cx>
+ *                    Felix Fietkau <openwrt@nbd.name>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
 
 #include <net/iw_handler.h>
 #include <wlioctl.h>
-#include <wlcompat.h>
 
 static struct net_device *dev;
+static unsigned short bss_force;
+static struct iw_statistics wstats;
 char buf[WLC_IOCTL_MAXLEN];
 
 /* The frequency of each channel in MHz */
@@ -167,6 +168,10 @@ static int wlcompat_ioctl_getiwrange(struct net_device *dev,
        range->min_pmt = 0;
        range->max_pmt = 65535 * 1000;
 
+       range->max_qual.qual = 0;
+       range->max_qual.level = 100;
+       range->max_qual.noise = 100;
+       
        range->min_rts = 0;
        if (wl_ioctl(dev, WLC_GET_RTS, &range->max_rts, sizeof(int)) < 0)
                range->max_rts = 2347;
@@ -176,7 +181,7 @@ static int wlcompat_ioctl_getiwrange(struct net_device *dev,
        if (wl_ioctl(dev, WLC_GET_FRAG, &range->max_frag, sizeof(int)) < 0)
                range->max_frag = 2346;
 
-       range->txpower_capa = IW_TXPOW_MWATT;
+       range->txpower_capa = IW_TXPOW_DBM;
 
        return 0;
 }
@@ -216,6 +221,31 @@ static int wlcompat_set_scan(struct net_device *dev,
 }
 
 
+struct iw_statistics *wlcompat_get_wireless_stats(struct net_device *dev)
+{
+       wl_bss_info_t *bss_info = (wl_bss_info_t *) buf;
+       get_pktcnt_t pkt;
+       int rssi, noise;
+       
+       memset(&wstats, 0, sizeof(wstats));
+       memset(&pkt, 0, sizeof(pkt));
+       memset(buf, 0, sizeof(buf));
+       bss_info->version = 0x2000;
+       wl_ioctl(dev, WLC_GET_BSS_INFO, bss_info, WLC_IOCTL_MAXLEN);
+       wl_ioctl(dev, WLC_GET_PKTCNTS, &pkt, sizeof(pkt));
+
+       // somehow the structure doesn't fit here
+       noise = buf[0x50];
+       rssi = buf[0x52];
+
+       wstats.qual.level = rssi;
+       wstats.qual.noise = -100 + noise;
+       wstats.discard.misc = pkt.rx_bad_pkt;
+       wstats.discard.retries = pkt.tx_bad_pkt;
+
+       return &wstats;
+}
+
 static int wlcompat_get_scan(struct net_device *dev,
                         struct iw_request_info *info,
                         union iwreq_data *wrqu,
@@ -229,7 +259,10 @@ static int wlcompat_get_scan(struct net_device *dev,
        char *end_buf = extra + IW_SCAN_MAX_DATA;
        struct iw_event iwe;
        int i, j;
-
+       int rssi, noise;
+       
+       results->buflen = WLC_IOCTL_MAXLEN - sizeof(wl_scan_results_t);
+       
        if (wl_ioctl(dev, WLC_SCAN_RESULTS, buf, WLC_IOCTL_MAXLEN) < 0)
                return -EAGAIN;
        
@@ -259,9 +292,9 @@ static int wlcompat_get_scan(struct net_device *dev,
 
                /* add quality statistics */
                iwe.cmd = IWEVQUAL;
+               iwe.u.qual.qual = 0;
                iwe.u.qual.level = bss_info->RSSI;
                iwe.u.qual.noise = bss_info->phy_noise;
-               iwe.u.qual.qual = 0;
                current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_QUAL_LEN);
        
                /* send rate information */
@@ -341,20 +374,55 @@ static int wlcompat_ioctl(struct net_device *dev,
                case SIOCSIWAP:
                {
                        int ap = 0;
-                       
+                       int infra = 0;
+                       rw_reg_t reg;
+
+                       memset(&reg, 0, sizeof(reg));
+
                        if (wrqu->ap_addr.sa_family != ARPHRD_ETHER)
                                return -EINVAL;
 
                        if (wl_ioctl(dev, WLC_GET_AP, &ap, sizeof(ap)) < 0)
                                return -EINVAL;
-                       
-                       if (wl_ioctl(dev, (ap ? WLC_SET_BSSID : WLC_REASSOC), wrqu->ap_addr.sa_data, 6) < 0)
+
+                       if (wl_ioctl(dev, WLC_GET_INFRA, &infra, sizeof(infra)) < 0)
+                               return -EINVAL;
+
+                       if (!infra) {
+                               wl_ioctl(dev, WLC_SET_BSSID, wrqu->ap_addr.sa_data, 6);
+
+                               reg.size = 4;
+                               reg.byteoff = 0x184;
+                               reg.val = bss_force << 16 | bss_force;
+                               wl_ioctl(dev, WLC_W_REG, &reg, sizeof(reg));
+                               
+                               reg.byteoff = 0x180;
+                               wl_ioctl(dev, WLC_R_REG, &reg, sizeof(reg));
+                               reg.val = bss_force << 16;
+                               wl_ioctl(dev, WLC_W_REG, &reg, sizeof(reg));
+                       }
+
+                       if (wl_ioctl(dev, ((ap || !infra) ? WLC_SET_BSSID : WLC_REASSOC), wrqu->ap_addr.sa_data, 6) < 0)
                                return -EINVAL;
 
                        break;
                }
                case SIOCGIWAP:
                {
+#ifdef DEBUG
+                       rw_reg_t reg;
+                       memset(&reg, 0, sizeof(reg));
+
+                       reg.size = 4;
+                       reg.byteoff = 0x184;
+                       wl_ioctl(dev, WLC_R_REG, &reg, sizeof(reg));
+                       printk("bss time = 0x%08x", reg.val);
+                       
+                       reg.byteoff = 0x180;
+                       wl_ioctl(dev, WLC_R_REG, &reg, sizeof(reg));
+                       printk("%08x\n", reg.val);
+#endif
+                       
                        wrqu->ap_addr.sa_family = ARPHRD_ETHER;
                        if (wl_ioctl(dev,WLC_GET_BSSID,wrqu->ap_addr.sa_data,6) < 0)
                                return -EINVAL;
@@ -412,17 +480,17 @@ static int wlcompat_ioctl(struct net_device *dev,
                {
                        int radio;
 
-                       if (wl_ioctl(dev, WLC_GET_RADIO, &radio, sizeof(int)) < 0)
-                               return -EINVAL;
+                       wl_ioctl(dev, WLC_GET_RADIO, &radio, sizeof(int));
                        
                        if (wl_get_val(dev, "qtxpower", &(wrqu->txpower.value), sizeof(int)) < 0)
                                return -EINVAL;
                        
                        wrqu->txpower.value &= ~WL_TXPWR_OVERRIDE;
+                       wrqu->txpower.value /= 4;
                                
                        wrqu->txpower.fixed = 0;
                        wrqu->txpower.disabled = radio;
-                       wrqu->txpower.flags = IW_TXPOW_MWATT;
+                       wrqu->txpower.flags = IW_TXPOW_DBM;
                        break;
                }
                case SIOCSIWTXPOW:
@@ -430,19 +498,19 @@ static int wlcompat_ioctl(struct net_device *dev,
                        /* This is weird: WLC_SET_RADIO with 1 as argument disables the radio */
                        int radio = wrqu->txpower.disabled;
 
-                       if (wl_ioctl(dev, WLC_SET_RADIO, &radio, sizeof(int)) < 0)
-                               return -EINVAL;
+                       wl_ioctl(dev, WLC_SET_RADIO, &radio, sizeof(int));
                        
-                       if (!wrqu->txpower.disabled) {
+                       if (!wrqu->txpower.disabled && (wrqu->txpower.value > 0)) {
                                int value;
                                
                                if (wl_get_val(dev, "qtxpower", &value, sizeof(int)) < 0)
                                        return -EINVAL;
                                
                                value &= WL_TXPWR_OVERRIDE;
+                               wrqu->txpower.value *= 4;
                                wrqu->txpower.value |= value;
                                
-                               if (wrqu->txpower.flags != IW_TXPOW_MWATT)
+                               if (wrqu->txpower.flags != IW_TXPOW_DBM)
                                        return -EINVAL;
                                
                                if (wrqu->txpower.value > 0)
@@ -459,8 +527,15 @@ static int wlcompat_ioctl(struct net_device *dev,
                        if (index < 0)
                                index = get_primary_key(dev);
                        
-                       if (wrqu->data.flags & IW_ENCODE_DISABLED)
+                       if (wrqu->data.flags & IW_ENCODE_DISABLED) {
                                wep = 0;
+                               if (wl_ioctl(dev, WLC_SET_WSEC, &wep, sizeof(val)) < 0)
+                                       return -EINVAL;
+                               return 0;
+                       }
+
+                       if (wl_ioctl(dev, WLC_SET_WSEC, &wep, sizeof(val)) < 0)
+                               return -EINVAL;
 
                        if (wrqu->data.flags & IW_ENCODE_OPEN)
                                wrestrict = 0;
@@ -479,18 +554,11 @@ static int wlcompat_ioctl(struct net_device *dev,
                        }
 
                        if (index >= 0)
-                               if (wl_ioctl(dev, WLC_SET_KEY_PRIMARY, &index, sizeof(index)) < 0)
-                                       return -EINVAL;
+                               wl_ioctl(dev, WLC_SET_KEY_PRIMARY, &index, sizeof(index));
                        
-                       if (wl_ioctl(dev, WLC_GET_WSEC, &val, sizeof(val)) < 0)
-                               return -EINVAL;
-                       val |= wep;
-                       if (wl_ioctl(dev, WLC_SET_WSEC, &val, sizeof(val)) < 0)
-                               return -EINVAL;
-
                        if (wrestrict >= 0)
-                               if (wl_ioctl(dev, WLC_SET_WEP_RESTRICT, &wrestrict, sizeof(wrestrict)) < 0)
-                                       return -EINVAL;
+                               wl_ioctl(dev, WLC_SET_WEP_RESTRICT, &wrestrict, sizeof(wrestrict));
+
                        break;
                }
                case SIOCGIWENCODE:
@@ -661,6 +729,19 @@ static const iw_handler     wlcompat_handler[] = {
        wlcompat_ioctl,         /* SIOCGIWENCODE */
 };
 
+
+#define WLCOMPAT_SET_MONITOR           SIOCIWFIRSTPRIV + 0
+#define WLCOMPAT_GET_MONITOR           SIOCIWFIRSTPRIV + 1
+#define WLCOMPAT_SET_TXPWR_LIMIT       SIOCIWFIRSTPRIV + 2
+#define WLCOMPAT_GET_TXPWR_LIMIT       SIOCIWFIRSTPRIV + 3
+#define WLCOMPAT_SET_ANTDIV            SIOCIWFIRSTPRIV + 4
+#define WLCOMPAT_GET_ANTDIV            SIOCIWFIRSTPRIV + 5
+#define WLCOMPAT_SET_TXANT             SIOCIWFIRSTPRIV + 6
+#define WLCOMPAT_GET_TXANT             SIOCIWFIRSTPRIV + 7
+#define WLCOMPAT_SET_BSS_FORCE         SIOCIWFIRSTPRIV + 8
+#define WLCOMPAT_GET_BSS_FORCE         SIOCIWFIRSTPRIV + 9
+
+
 static int wlcompat_private_ioctl(struct net_device *dev,
                         struct iw_request_info *info,
                         union iwreq_data *wrqu,
@@ -738,6 +819,16 @@ static int wlcompat_private_ioctl(struct net_device *dev,
 
                        break;
                }
+               case WLCOMPAT_SET_BSS_FORCE:
+               {
+                       bss_force = (unsigned short) *value;
+                       break;
+               }
+               case WLCOMPAT_GET_BSS_FORCE:
+               {
+                       *extra = (int) bss_force;
+                       break;
+               }
                default:
                {
                        return -EINVAL;
@@ -789,6 +880,16 @@ static const struct iw_priv_args wlcompat_private_args[] =
                IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
                "get_txant"
        },
+       {       WLCOMPAT_SET_BSS_FORCE, 
+               IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
+               0,
+               "set_bss_force"
+       },
+       {       WLCOMPAT_GET_BSS_FORCE, 
+               0,
+               IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
+               "get_bss_force"
+       },
 };
 
 static const iw_handler wlcompat_private[] =
@@ -861,6 +962,7 @@ static int __init wlcompat_init()
 {
        int found = 0, i;
        char *devname = "eth0";
+       bss_force = 0;
        
        while (!found && (dev = dev_get_by_name(devname))) {
                if ((dev->wireless_handlers == NULL) && ((wl_ioctl(dev, WLC_GET_MAGIC, &i, sizeof(i)) == 0) && i == WLC_IOCTL_MAGIC))
@@ -877,6 +979,7 @@ static int __init wlcompat_init()
        old_ioctl = dev->do_ioctl;
        dev->do_ioctl = new_ioctl;
        dev->wireless_handlers = (struct iw_handler_def *)&wlcompat_handler_def;
+       dev->get_wireless_stats = wlcompat_get_wireless_stats;
 #ifdef DEBUG
        printk("broadcom driver private data: 0x%08x\n", dev->priv);
 #endif
@@ -885,6 +988,7 @@ static int __init wlcompat_init()
 
 static void __exit wlcompat_exit()
 {
+       dev->get_wireless_stats = NULL;
        dev->wireless_handlers = NULL;
        dev->do_ioctl = old_ioctl;
        return;
index 9446c343fa34a98bc55ee0e6277e8507065f698a..feb0c958374f9e7c4409ab9bce3245983e911681 100644 (file)
@@ -29,6 +29,12 @@ $$(PKG_$(1)): $(LINUX_DIR)/.modules_done
        $(SCRIPT_DIR)/make-ipkg-dir.sh $$(I_$(1)) ../control/kmod-$(2).control $(LINUX_VERSION)-$(BOARD)-$(PKG_RELEASE) $(ARCH)
        echo "Depends: $$(IDEPEND_$(1))" >> $$(I_$(1))/CONTROL/control
        cp $(3) $$(I_$(1))/lib/modules/$(LINUX_VERSION)
+ifneq ($(6),)
+       mkdir -p $$(I_$(1))/etc/modules.d
+       for module in $(7); do \
+               echo $$$$module >> $$(I_$(1))/etc/modules.d/$(6)-$(2); \
+       done
+endif
        $(IPKG_BUILD) $$(I_$(1)) $(PACKAGE_DIR)
 
 endef
index 97628812876531008438b62e2e59b8118d73e1fd..b4c1a21ee04bf3432d7786d9d2335e0111927819 100644 (file)
@@ -1,12 +1,6 @@
 include $(TOPDIR)/rules.mk
 
-TARGETS := addpattern trx
-ifeq ($(BR2_TARGET_BELKIN),y)
-TARGETS += belkin-bin
-endif
-ifeq ($(BR2_TARGET_MOTOROLA),y)
-TARGETS += motorola-bin
-endif
+TARGETS := addpattern trx motorola-bin
 
 UTILS_BUILD_DIR:=$(BUILD_DIR)/target-utils
 
index 52fb8ee1c4118ce6eabda61f9de7116000aaa93f..44e6d8d82d06598283d35a2c996036a6ab57c622 100644 (file)
@@ -75,7 +75,7 @@ void usage(void) __attribute__ (( __noreturn__ ));
 
 void usage(void)
 {
-       fprintf(stderr, "Usage: addpattern [-i trxfile] [-o binfile] [-p pattern] [-g] [-v v#.#.#] [-{0|1|2}]\n");
+       fprintf(stderr, "Usage: addpattern [-i trxfile] [-o binfile] [-p pattern] [-g] [-v v#.#.#] [-{0|1|2|4}]\n");
        exit(EXIT_FAILURE);
 }
 
@@ -101,7 +101,7 @@ int main(int argc, char **argv)
        hdr = (struct code_header *) buf;
        memset(hdr, 0, sizeof(struct code_header));
 
-       while ((c = getopt(argc, argv, "i:o:p:gv:012")) != -1) {
+       while ((c = getopt(argc, argv, "i:o:p:gv:0124")) != -1) {
                switch (c) {
                        case 'i':
                                ifn = optarg;
@@ -130,6 +130,11 @@ int main(int argc, char **argv)
                                hdr->flags |= SUPPORT_INTEL_FLASH;
                                hdr->flags |= SUPPORT_5325E_SWITCH;
                                break;
+                       case '4':
+                               /* V4 firmware sets the flags to 0x1f */
+                               hdr->hw_ver = 1;
+                               hdr->flags = 0x1f;
+                               break;
 
                        default:
                                usage();
index 79a04026ea2775ba329aef8e970cd68d39e3ba84..6f9fa4168752e9d60e8c730b93996b9a9d125709 100644 (file)
@@ -62,7 +62,7 @@ uint32_t crc32buf(char *buf, size_t len);
 
 #define TRX_MAGIC      0x30524448      /* "HDR0" */
 #define TRX_VERSION    1
-#define TRX_MAX_LEN    0x3A0000
+#define TRX_MAX_LEN    0x5A0000
 #define TRX_NO_HEADER  1               /* Do not write TRX header */   
 
 struct trx_header {
index 756deddd249cca753382cffe769cb1162302dd3d..fd906f05f6f33ce8444d0c873facff5512b38e50 100644 (file)
@@ -3,7 +3,6 @@
 source "toolchain/uClibc/Config.in"
 source "toolchain/binutils/Config.in"
 source "toolchain/gcc/Config.in"
-source "toolchain/ccache/Config.in"
 
 if CONFIG_DEVEL
        comment "Common Toolchain Options"
index 0baf9b20c5721a4b123445ae4b52469e07a03e03..48fe1465dfc836c61df3b1e269d108ab77fcacf6 100644 (file)
@@ -5,7 +5,6 @@ menu "Toolchain Options"
 source "toolchain/uClibc/Config.in"
 source "toolchain/binutils/Config.in"
 source "toolchain/gcc/Config.in"
-source "toolchain/ccache/Config.in"
 source "toolchain/gdb/Config.in"
 
 
index c573debe4954d860d8ea002ffdcadac31c5a46b3..2b1358b123a3d8ecf048535d1bbb2f3099209e90 100644 (file)
@@ -15,8 +15,10 @@ gcc-prepare: binutils-install
 uClibc-compile: gcc-prepare
 gcc-compile: uClibc-install
 
-$(STAMP_DIR):
-       mkdir -p $(STAMP_DIR)
+TOOLCHAIN_STAMP_DIR:=$(STAGING_DIR)/stampfiles
+
+$(TOOLCHAIN_STAMP_DIR):
+       mkdir -p $(TOOLCHAIN_STAMP_DIR)
 
 $(STAGING_DIR):
        @mkdir -p $(STAGING_DIR)/lib
@@ -27,19 +29,19 @@ $(STAGING_DIR):
 $(TOOL_BUILD_DIR):
        @mkdir -p $(TOOL_BUILD_DIR)
 
-%-prepare: $(STAMP_DIR) $(STAGING_DIR) $(TOOL_BUILD_DIR)
-       @[ -f $(STAMP_DIR)/.toolchain_$@ ] || $(MAKE) -C $(patsubst %-prepare,%,$@) prepare
-       @touch $(STAMP_DIR)/.toolchain_$@
+%-prepare: $(TOOLCHAIN_STAMP_DIR) $(STAGING_DIR) $(TOOL_BUILD_DIR)
+       @[ -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@ ] || $(MAKE) -C $(patsubst %-prepare,%,$@) prepare
+       @touch $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@
 
 %-compile: %-prepare 
-       @[ -f $(STAMP_DIR)/.toolchain_$@ ] || $(MAKE) -C $(patsubst %-compile,%,$@) compile
-       @touch $(STAMP_DIR)/.toolchain_$@
+       @[ -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@ ] || $(MAKE) -C $(patsubst %-compile,%,$@) compile
+       @touch $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@
 
 %-install: %-compile
-       @[ -f $(STAMP_DIR)/.toolchain_$@ ] || $(MAKE) -C $(patsubst %-install,%,$@) install
-       @touch $(STAMP_DIR)/.toolchain_$@
+       @[ -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@ ] || $(MAKE) -C $(patsubst %-install,%,$@) install
+       @touch $(TOOLCHAIN_STAMP_DIR)/.toolchain_$@
 
 %-clean:
        @$(MAKE) -C $(patsubst %-clean,%,$@) clean
-       @rm -f $(STAMP_DIR)/.toolchain_$(patsubst %-clean,%,$@)-*
+       @rm -f $(TOOLCHAIN_STAMP_DIR)/.toolchain_$(patsubst %-clean,%,$@)-*
 
diff --git a/openwrt/toolchain/binutils/2.14.90.0.8/001-debian.patch b/openwrt/toolchain/binutils/2.14.90.0.8/001-debian.patch
deleted file mode 100644 (file)
index 7808235..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-diff -urN binutils-2.14.90.0.8-dist/bfd/elf64-alpha.c binutils-2.14.90.0.8/bfd/elf64-alpha.c
---- binutils-2.14.90.0.8-dist/bfd/elf64-alpha.c        2004-01-14 15:07:43.000000000 -0600
-+++ binutils-2.14.90.0.8/bfd/elf64-alpha.c     2004-02-11 03:42:05.000000000 -0600
-@@ -4144,9 +4144,12 @@
-   loc = srel->contents;
-   loc += srel->reloc_count++ * sizeof (Elf64_External_Rela);
--  bfd_elf64_swap_reloca_out (abfd, &outrel, loc);
--  BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count
--            <= srel->_cooked_size);
-+  if (loc)
-+    {
-+      bfd_elf64_swap_reloca_out (abfd, &outrel, loc);
-+      BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count
-+                <= srel->_cooked_size);
-+    }
- }
- /* Relocate an Alpha ELF section for a relocatable link.
-diff -urN binutils-2.14.90.0.8-dist/bfd/opncls.c binutils-2.14.90.0.8/bfd/opncls.c
---- binutils-2.14.90.0.8-dist/bfd/opncls.c     2004-01-14 15:07:43.000000000 -0600
-+++ binutils-2.14.90.0.8/bfd/opncls.c  2004-02-11 03:42:01.000000000 -0600
-@@ -150,6 +150,13 @@
- {
-   bfd *nbfd;
-   const bfd_target *target_vec;
-+  struct stat s;
-+
-+  if (stat (filename, &s) == 0)
-+    if (S_ISDIR(s.st_mode)) {
-+      bfd_set_error (bfd_error_file_not_recognized);
-+      return NULL;
-+    }
-   nbfd = _bfd_new_bfd ();
-   if (nbfd == NULL)
-diff -urN binutils-2.14.90.0.8-dist/gprof/gprof.texi binutils-2.14.90.0.8/gprof/gprof.texi
---- binutils-2.14.90.0.8-dist/gprof/gprof.texi 2004-01-14 15:07:51.000000000 -0600
-+++ binutils-2.14.90.0.8/gprof/gprof.texi      2004-02-11 03:42:01.000000000 -0600
-@@ -138,6 +138,10 @@
- If more than one profile file is specified, the @code{gprof}
- output shows the sum of the profile information in the given profile files.
-+If you use gcc 2.95.x or 3.0 to compile your binaries, you may need
-+to add the @samp{-fprofile-arcs} to the compile command line in order
-+for the call graphs to be properly stored in gmon.out.
-+
- @code{Gprof} calculates the amount of time spent in each routine.
- Next, these times are propagated along the edges of the call graph.
- Cycles are discovered, and calls into a cycle are made to share the time
-@@ -182,7 +186,7 @@
- @c man end
- @c man begin SEEALSO
--monitor(3), profil(2), cc(1), prof(1), and the Info entry for @file{gprof}.
-+profil(2), cc(1), prof(1), and the Info entry for @file{gprof}.
- ``An Execution Profiler for Modular Programs'',
- by S. Graham, P. Kessler, M. McKusick;
-@@ -268,6 +272,11 @@
- options.  The same option, @samp{-pg}, alters either compilation or linking
- to do what is necessary for profiling.  Here are examples:
-+If you use gcc 2.95.x or 3.0.x, you may need to add the
-+@samp{-fprofile-arcs} option to the compile line along with @samp{-pg}
-+in order to allow the call-graphs to be properly included in the gmon.out
-+file.
-+
- @example
- cc -g -c myprog.c utils.c -pg
- cc -o myprog myprog.o utils.o -pg
-diff -urN binutils-2.14.90.0.8-dist/ld/Makefile.am binutils-2.14.90.0.8/ld/Makefile.am
---- binutils-2.14.90.0.8-dist/ld/Makefile.am   2004-01-14 15:07:52.000000000 -0600
-+++ binutils-2.14.90.0.8/ld/Makefile.am        2004-02-11 03:42:01.000000000 -0600
-@@ -19,7 +19,7 @@
- # We put the scripts in the directory $(scriptdir)/ldscripts.
- # We can't put the scripts in $(datadir) because the SEARCH_DIR
- # directives need to be different for native and cross linkers.
--scriptdir = $(tooldir)/lib
-+scriptdir = $(libdir)
- EMUL = @EMUL@
- EMULATION_OFILES = @EMULATION_OFILES@
-diff -urN binutils-2.14.90.0.8-dist/ld/Makefile.in binutils-2.14.90.0.8/ld/Makefile.in
---- binutils-2.14.90.0.8-dist/ld/Makefile.in   2004-01-14 15:07:52.000000000 -0600
-+++ binutils-2.14.90.0.8/ld/Makefile.in        2004-02-11 03:42:01.000000000 -0600
-@@ -128,7 +128,7 @@
- # We put the scripts in the directory $(scriptdir)/ldscripts.
- # We can't put the scripts in $(datadir) because the SEARCH_DIR
- # directives need to be different for native and cross linkers.
--scriptdir = $(tooldir)/lib
-+scriptdir = $(libdir)
- EMUL = @EMUL@
- EMULATION_OFILES = @EMULATION_OFILES@
-diff -urN binutils-2.14.90.0.8-dist/ld/emultempl/elf32.em binutils-2.14.90.0.8/ld/emultempl/elf32.em
---- binutils-2.14.90.0.8-dist/ld/emultempl/elf32.em    2004-01-14 15:07:53.000000000 -0600
-+++ binutils-2.14.90.0.8/ld/emultempl/elf32.em 2004-02-11 03:42:01.000000000 -0600
-@@ -671,6 +671,8 @@
-             && command_line.rpath == NULL)
-           {
-             lib_path = (const char *) getenv ("LD_RUN_PATH");
-+            if ((lib_path) && (strlen (lib_path) == 0))
-+                lib_path = NULL;
-             if (gld${EMULATION_NAME}_search_needed (lib_path, l->name,
-                                                     force))
-               break;
-@@ -850,6 +852,8 @@
-   rpath = command_line.rpath;
-   if (rpath == NULL)
-     rpath = (const char *) getenv ("LD_RUN_PATH");
-+  if ((rpath) && (strlen (rpath) == 0))
-+      rpath = NULL;
-   if (! (bfd_elf${ELFSIZE}_size_dynamic_sections
-        (output_bfd, command_line.soname, rpath,
-         command_line.filter_shlib,
-diff -urN binutils-2.14.90.0.8-dist/ltmain.sh binutils-2.14.90.0.8/ltmain.sh
---- binutils-2.14.90.0.8-dist/ltmain.sh        2002-03-22 16:06:16.000000000 -0600
-+++ binutils-2.14.90.0.8/ltmain.sh     2004-02-11 03:42:05.000000000 -0600
-@@ -4413,6 +4413,10 @@
-       # LD_LIBRARY_PATH before the program is installed.
-       $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
-       $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
-+      if test -n "$linkname"; then
-+        $show "(cd $output_objdir && $rm ../$linkname && $LN_S $output_objdir/$linkname ../$linkname)"
-+        $run eval '(cd $output_objdir && $rm ../$linkname && $LN_S $output_objdir/$linkname ../$linkname)' || exit $?
-+      fi
-       ;;
-     esac
-     exit 0
-diff -urN binutils-2.14.90.0.8-dist/opcodes/i386-dis.c binutils-2.14.90.0.8/opcodes/i386-dis.c
---- binutils-2.14.90.0.8-dist/opcodes/i386-dis.c       2004-01-14 15:07:55.000000000 -0600
-+++ binutils-2.14.90.0.8/opcodes/i386-dis.c    2004-02-11 03:42:01.000000000 -0600
-@@ -1879,7 +1879,7 @@
-  * The function returns the length of this instruction in bytes.
-  */
--static char intel_syntax;
-+static signed char intel_syntax;
- static char open_char;
- static char close_char;
- static char separator_char;
diff --git a/openwrt/toolchain/binutils/2.14.90.0.8/100-uclibc-conf.patch b/openwrt/toolchain/binutils/2.14.90.0.8/100-uclibc-conf.patch
deleted file mode 100644 (file)
index 5cb516c..0000000
+++ /dev/null
@@ -1,630 +0,0 @@
-diff -urN binutils-2.14.90.0.8-001-debian/bfd/config.bfd binutils-2.14.90.0.8/bfd/config.bfd
---- binutils-2.14.90.0.8-001-debian/bfd/config.bfd     2004-01-14 15:07:43.000000000 -0600
-+++ binutils-2.14.90.0.8/bfd/config.bfd        2004-02-12 14:18:14.000000000 -0600
-@@ -121,7 +121,7 @@
-     targ_defvec=ecoffalpha_little_vec
-     targ_selvecs=bfd_elf64_alpha_vec
-     ;;
--  alpha*-*-linux-gnu* | alpha*-*-elf*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
-     targ_defvec=bfd_elf64_alpha_vec
-     targ_selvecs=ecoffalpha_little_vec
-     ;;
-@@ -131,7 +131,7 @@
-   alpha*-*-*)
-     targ_defvec=ecoffalpha_little_vec
-     ;;
--  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
-+  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-linux-uclibc* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
-     targ_defvec=bfd_elf64_ia64_little_vec
-     targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
-     ;;
-@@ -208,7 +208,7 @@
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
--  armeb-*-elf | arm*b-*-linux-gnu*)
-+  armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_bigarm_vec
-     targ_selvecs=bfd_elf32_littlearm_vec
-     ;;
-@@ -216,8 +216,8 @@
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
--  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
--  arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
-+  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | \
-+  arm*-*-conix* | arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
-@@ -350,7 +350,7 @@
-     ;;
- #ifdef BFD64
--  hppa*64*-*-linux-gnu*)
-+  hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_hppa_linux_vec
-     targ_selvecs=bfd_elf64_hppa_vec
-     ;;
-@@ -361,7 +361,7 @@
-     ;;
- #endif
--  hppa*-*-linux-gnu* | hppa*-*-netbsd*)
-+  hppa*-*-linux-gnu* | hppa*-*-linux-uclibc* | hppa*-*-netbsd*)
-     targ_defvec=bfd_elf32_hppa_linux_vec
-     targ_selvecs=bfd_elf32_hppa_vec
-     ;;
-@@ -483,7 +483,7 @@
-     targ_selvecs=bfd_elf32_i386_vec
-     targ_underscore=yes
-     ;;
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_i386_vec
-     targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
-     targ64_selvecs=bfd_elf64_x86_64_vec
-@@ -497,7 +497,7 @@
-     targ_defvec=bfd_elf64_x86_64_vec
-     targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
-     ;;
--  x86_64-*-linux-gnu*)
-+  x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_x86_64_vec
-     targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
-     ;;
-@@ -672,7 +672,7 @@
-     targ_selvecs=bfd_elf32_m68k_vec
-     targ_underscore=yes
-     ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_m68k_vec
-     targ_selvecs=m68klinux_vec
-     ;;
-@@ -952,7 +952,8 @@
-     ;;
- #endif
-   powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
--  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
-+  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
-+  powerpc-*-rtems* | \
-   powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
-     targ_defvec=bfd_elf32_powerpc_vec
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
-@@ -984,8 +985,8 @@
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
-     ;;
-   powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
--  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
--  powerpcle-*-rtems*)
-+  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
-+  powerpcle-*-vxworks* | powerpcle-*-rtems*)
-     targ_defvec=bfd_elf32_powerpcle_vec
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
-     targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
-@@ -1141,7 +1142,7 @@
-     targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
-     targ_underscore=yes
-     ;;
--  sparc-*-linux-gnu*)
-+  sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_sparc_vec
-     targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
-     ;;
-@@ -1188,7 +1189,7 @@
-     targ_defvec=sunos_big_vec
-     targ_underscore=yes
-     ;;
--  sparc64-*-linux-gnu*)
-+  sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_sparc_vec
-     targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
-     ;;
-diff -urN binutils-2.14.90.0.8-001-debian/bfd/configure binutils-2.14.90.0.8/bfd/configure
---- binutils-2.14.90.0.8-001-debian/bfd/configure      2004-01-14 15:07:43.000000000 -0600
-+++ binutils-2.14.90.0.8/bfd/configure 2004-02-12 14:09:10.000000000 -0600
-@@ -1699,6 +1699,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -5278,7 +5283,7 @@
-   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
-       COREFILE=''
-       ;;
--  alpha*-*-linux-gnu*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/alphalinux.h"'
-       ;;
-@@ -5338,7 +5343,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386mach3.h"'
-       ;;
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386linux.h"'
-       ;;
-@@ -5388,7 +5393,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/hp300bsd.h"'
-       ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/m68klinux.h"'
-       ;;
-diff -urN binutils-2.14.90.0.8-001-debian/bfd/configure.in binutils-2.14.90.0.8/bfd/configure.in
---- binutils-2.14.90.0.8-001-debian/bfd/configure.in   2004-01-14 15:07:43.000000000 -0600
-+++ binutils-2.14.90.0.8/bfd/configure.in      2004-02-12 14:09:10.000000000 -0600
-@@ -178,7 +178,7 @@
-   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
-       COREFILE=''
-       ;;
--  alpha*-*-linux-gnu*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/alphalinux.h"'
-       ;;
-@@ -259,7 +259,7 @@
-       TRAD_HEADER='"hosts/i386mach3.h"'
-       ;;
- changequote(,)dnl
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
- changequote([,])dnl
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386linux.h"'
-@@ -312,7 +312,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/hp300bsd.h"'
-       ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/m68klinux.h"'
-       ;;
-diff -urN binutils-2.14.90.0.8-001-debian/config.sub binutils-2.14.90.0.8/config.sub
---- binutils-2.14.90.0.8-001-debian/config.sub 2004-01-14 15:07:42.000000000 -0600
-+++ binutils-2.14.90.0.8/config.sub    2004-02-12 14:09:10.000000000 -0600
-@@ -118,7 +118,7 @@
- # Here we must recognize all the valid KERNEL-OS combinations.
- maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
- case $maybe_os in
--  nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
-+  nto-qnx* | linux-gnu* | linux-uclibc* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
-     os=-$maybe_os
-     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
-     ;;
-@@ -1131,7 +1131,8 @@
-             | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-             | -chorusos* | -chorusrdb* \
-             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
--            | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
-+            | -mingw32* | -linux-gnu* | -linux-uclibc* \
-+            | -uxpv* | -beos* | -mpeix* | -udk* \
-             | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
-             | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-diff -urN binutils-2.14.90.0.8-001-debian/configure binutils-2.14.90.0.8/configure
---- binutils-2.14.90.0.8-001-debian/configure  2004-01-14 15:07:42.000000000 -0600
-+++ binutils-2.14.90.0.8/configure     2004-02-12 14:09:10.000000000 -0600
-@@ -1273,6 +1273,18 @@
-   i[3456789]86-*-freebsd* | i[3456789]86-*-kfreebsd*-gnu)
-     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-     ;;
-+  i[3456789]86-*-linux-uclibc)
-+    # This section makes it possible to build newlib natively on linux.
-+    # If we are using a cross compiler then don't configure newlib.
-+    if test x${is_cross_compiler} != xno ; then
-+      noconfigdirs="$noconfigdirs target-newlib"
-+    fi
-+    noconfigdirs="$noconfigdirs target-libgloss"
-+    # If we are not using a cross compiler, do configure newlib.
-+    # Note however, that newlib will only be configured in this situation
-+    # if the --with-newlib option has been given, because otherwise
-+    # 'target-newlib' will appear in skipdirs.
-+    ;;
-   i[3456789]86-*-linux*)
-     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
-     # not build java stuff by default.
-diff -urN binutils-2.14.90.0.8-001-debian/configure.in binutils-2.14.90.0.8/configure.in
---- binutils-2.14.90.0.8-001-debian/configure.in       2004-01-14 15:07:42.000000000 -0600
-+++ binutils-2.14.90.0.8/configure.in  2004-02-12 14:50:56.000000000 -0600
-@@ -512,6 +512,18 @@
-   i[[3456789]]86-*-freebsd* | i[[3456789]]86-*-kfreebsd*-gnu)
-     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-     ;;
-+  i[[3456789]]86-*-linux-uclibc)
-+    # This section makes it possible to build newlib natively on linux.
-+    # If we are using a cross compiler then don't configure newlib.
-+    if test x${is_cross_compiler} != xno ; then
-+      noconfigdirs="$noconfigdirs target-newlib"
-+    fi
-+    noconfigdirs="$noconfigdirs target-libgloss"
-+    # If we are not using a cross compiler, do configure newlib.
-+    # Note however, that newlib will only be configured in this situation
-+    # if the --with-newlib option has been given, because otherwise
-+    # 'target-newlib' will appear in skipdirs.
-+    ;;
-   i[[3456789]]86-*-linux*)
-     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
-     # not build java stuff by default.
-diff -urN binutils-2.14.90.0.8-001-debian/gas/configure binutils-2.14.90.0.8/gas/configure
---- binutils-2.14.90.0.8-001-debian/gas/configure      2004-01-14 15:07:45.000000000 -0600
-+++ binutils-2.14.90.0.8/gas/configure 2004-02-12 14:57:43.000000000 -0600
-@@ -3215,6 +3215,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -4030,6 +4035,7 @@
-       alpha*-*-osf*)                  fmt=ecoff ;;
-       alpha*-*-linuxecoff*)           fmt=ecoff ;;
-       alpha*-*-linux-gnu*)            fmt=elf em=linux ;;
-+      alpha*-*-linux-uclibc*)         fmt=elf em=linux ;;
-       alpha*-*-netbsd*)                       fmt=elf em=nbsd ;;
-       alpha*-*-openbsd*)              fmt=elf em=obsd ;;
-@@ -4046,6 +4052,7 @@
-       arm*-*-conix*)                  fmt=elf ;;
-       arm-*-linux*aout*)              fmt=aout em=linux ;;
-       arm*-*-linux-gnu*)              fmt=elf  em=linux ;;
-+      arm*-*-linux-uclibc*)           fmt=elf  em=linux ;;
-       arm*-*-uclinux*)                        fmt=elf  em=linux ;;
-       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
-       arm-*-*n*bsd*)                  fmt=aout em=nbsd ;;
-@@ -4059,6 +4066,7 @@
-       avr-*-*)                                fmt=elf ;;
-       cris-*-linux-gnu*)              fmt=multi bfd_gas=yes em=linux ;;
-+      cris-*-linux-uclibc*)           fmt=multi bfd_gas=yes em=linux ;;
-       cris-*-*)                               fmt=multi bfd_gas=yes ;;
-       d10v-*-*)                               fmt=elf ;;
-@@ -4115,7 +4123,9 @@
-       i386-*-linux*oldld)             fmt=aout em=linux ;;
-       i386-*-linux*coff*)             fmt=coff em=linux ;;
-       i386-*-linux-gnu*)              fmt=elf em=linux ;;
-+      i386-*-linux-uclibc*)           fmt=elf em=linux ;;
-       x86_64-*-linux-gnu*)            fmt=elf em=linux ;;
-+      x86_64-*-linux-uclibc*)         fmt=elf em=linux ;;
-       i386-*-lynxos*)                 fmt=coff em=lynx ;;
-       i386-*-sysv[45]*)                       fmt=elf ;;
-       i386-*-solaris*)                        fmt=elf ;;
-@@ -4175,6 +4185,7 @@
-       ia64-*-elf*)                    fmt=elf ;;
-       ia64-*-aix*)                    fmt=elf em=ia64aix ;;
-       ia64-*-linux-gnu*)              fmt=elf em=linux ;;
-+      ia64-*-linux-uclibc*)           fmt=elf em=linux ;;
-       ia64-*-hpux*)                   fmt=elf em=hpux ;;
-       ia64-*-netbsd*)                 fmt=elf em=nbsd ;;
-@@ -4202,6 +4213,7 @@
-       m68k-*-hpux*)                   fmt=hp300 em=hp300 ;;
-       m68k-*-linux*aout*)             fmt=aout em=linux ;;
-       m68k-*-linux-gnu*)              fmt=elf em=linux ;;
-+      m68k-*-linux-uclibc*)           fmt=elf em=linux ;;
-       m68k-*-uclinux*)                        fmt=elf ;;
-       m68k-*-gnu*)                    fmt=elf ;;
-       m68k-*-lynxos*)                 fmt=coff em=lynx ;;
-@@ -4265,6 +4277,7 @@
-       ppc-*-beos*)                    fmt=coff ;;
-       ppc-*-*n*bsd* | ppc-*-elf*)     fmt=elf ;;
-       ppc-*-eabi* | ppc-*-sysv4*)     fmt=elf ;;
-+      ppc-*-linux-uclibc* | \
-       ppc-*-linux-gnu*)                       fmt=elf em=linux
-           case "$endian" in
-               big)  ;;
-@@ -4292,7 +4305,9 @@
-       ppc-*-kaos*)                    fmt=elf ;;
-       s390x-*-linux-gnu*)             fmt=elf em=linux ;;
-+      s390x-*-linux-uclibc*)          fmt=elf em=linux ;;
-       s390-*-linux-gnu*)              fmt=elf em=linux ;;
-+      s390-*-linux-uclibc*)           fmt=elf em=linux ;;
-       sh*-*-linux*)                   fmt=elf em=linux
-           case ${cpu} in
-@@ -4325,6 +4340,7 @@
-       sparc-*-coff)                   fmt=coff ;;
-       sparc-*-linux*aout*)            fmt=aout em=linux ;;
-       sparc-*-linux-gnu*)             fmt=elf em=linux ;;
-+      sparc-*-linux-uclibc*)          fmt=elf em=linux ;;
-       sparc-*-lynxos*)                        fmt=coff em=lynx ;;
-       sparc-fujitsu-none)             fmt=aout ;;
-       sparc-*-elf)                    fmt=elf ;;
-diff -urN binutils-2.14.90.0.8-001-debian/gas/configure.in binutils-2.14.90.0.8/gas/configure.in
---- binutils-2.14.90.0.8-001-debian/gas/configure.in   2004-01-14 15:07:45.000000000 -0600
-+++ binutils-2.14.90.0.8/gas/configure.in      2004-02-12 14:21:06.000000000 -0600
-@@ -194,6 +194,7 @@
-       alpha*-*-osf*)                  fmt=ecoff ;;
-       alpha*-*-linuxecoff*)           fmt=ecoff ;;
-       alpha*-*-linux-gnu*)            fmt=elf em=linux ;;
-+      alpha*-*-linux-uclibc*)         fmt=elf em=linux ;;
-       alpha*-*-netbsd*)                       fmt=elf em=nbsd ;;
-       alpha*-*-openbsd*)              fmt=elf em=obsd ;;
-@@ -210,6 +211,7 @@
-       arm*-*-conix*)                  fmt=elf ;;
-       arm-*-linux*aout*)              fmt=aout em=linux ;;
-       arm*-*-linux-gnu*)              fmt=elf  em=linux ;;
-+      arm*-*-linux-uclibc*)           fmt=elf  em=linux ;;
-       arm*-*-uclinux*)                        fmt=elf  em=linux ;;
-       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
-       arm-*-*n*bsd*)                  fmt=aout em=nbsd ;;
-@@ -223,6 +225,7 @@
-       avr-*-*)                                fmt=elf ;;
-       cris-*-linux-gnu*)              fmt=multi bfd_gas=yes em=linux ;;
-+      cris-*-linux-uclibc*)           fmt=multi bfd_gas=yes em=linux ;;
-       cris-*-*)                               fmt=multi bfd_gas=yes ;;
-       d10v-*-*)                               fmt=elf ;;
-@@ -279,7 +282,9 @@
-       i386-*-linux*oldld)             fmt=aout em=linux ;;
-       i386-*-linux*coff*)             fmt=coff em=linux ;;
-       i386-*-linux-gnu*)              fmt=elf em=linux ;;
-+      i386-*-linux-uclibc*)           fmt=elf em=linux ;;
-       x86_64-*-linux-gnu*)            fmt=elf em=linux ;;
-+      x86_64-*-linux-uclibc*)         fmt=elf em=linux ;;
-       i386-*-lynxos*)                 fmt=coff em=lynx ;;
- changequote(,)dnl
-       i386-*-sysv[45]*)                       fmt=elf ;;
-@@ -332,6 +337,7 @@
-       ia64-*-elf*)                    fmt=elf ;;
-       ia64-*-aix*)                    fmt=elf em=ia64aix ;;
-       ia64-*-linux-gnu*)              fmt=elf em=linux ;;
-+      ia64-*-linux-uclibc*)           fmt=elf em=linux ;;
-       ia64-*-hpux*)                   fmt=elf em=hpux ;;
-       ia64-*-netbsd*)                 fmt=elf em=nbsd ;;
-@@ -359,6 +365,7 @@
-       m68k-*-hpux*)                   fmt=hp300 em=hp300 ;;
-       m68k-*-linux*aout*)             fmt=aout em=linux ;;
-       m68k-*-linux-gnu*)              fmt=elf em=linux ;;
-+      m68k-*-linux-uclibc*)           fmt=elf em=linux ;;
-       m68k-*-uclinux*)                        fmt=elf ;;
-       m68k-*-gnu*)                    fmt=elf ;;
-       m68k-*-lynxos*)                 fmt=coff em=lynx ;;
-@@ -419,6 +426,7 @@
-       ppc-*-beos*)                    fmt=coff ;;
-       ppc-*-*n*bsd* | ppc-*-elf*)     fmt=elf ;;
-       ppc-*-eabi* | ppc-*-sysv4*)     fmt=elf ;;
-+      ppc-*-linux-uclibc* | \
-       ppc-*-linux-gnu*)                       fmt=elf em=linux
-           case "$endian" in
-               big)  ;;
-@@ -439,7 +447,9 @@
-       ppc-*-kaos*)                    fmt=elf ;;
-       s390x-*-linux-gnu*)             fmt=elf em=linux ;;
-+      s390x-*-linux-uclibc*)          fmt=elf em=linux ;;
-       s390-*-linux-gnu*)              fmt=elf em=linux ;;
-+      s390-*-linux-uclibc*)           fmt=elf em=linux ;;
-       sh*-*-linux*)                   fmt=elf em=linux
-           case ${cpu} in
-@@ -472,6 +482,7 @@
-       sparc-*-coff)                   fmt=coff ;;
-       sparc-*-linux*aout*)            fmt=aout em=linux ;;
-       sparc-*-linux-gnu*)             fmt=elf em=linux ;;
-+      sparc-*-linux-uclibc*)          fmt=elf em=linux ;;
-       sparc-*-lynxos*)                        fmt=coff em=lynx ;;
-       sparc-fujitsu-none)             fmt=aout ;;
-       sparc-*-elf)                    fmt=elf ;;
-diff -urN binutils-2.14.90.0.8-001-debian/ld/configure binutils-2.14.90.0.8/ld/configure
---- binutils-2.14.90.0.8-001-debian/ld/configure       2003-05-05 16:46:49.000000000 -0500
-+++ binutils-2.14.90.0.8/ld/configure  2004-02-12 14:09:10.000000000 -0600
-@@ -1578,6 +1578,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.14.90.0.8-001-debian/ld/configure.tgt binutils-2.14.90.0.8/ld/configure.tgt
---- binutils-2.14.90.0.8-001-debian/ld/configure.tgt   2004-01-14 15:07:52.000000000 -0600
-+++ binutils-2.14.90.0.8/ld/configure.tgt      2004-02-12 14:14:12.000000000 -0600
-@@ -30,6 +30,7 @@
-                       targ_extra_emuls="criself crislinux"
-                       targ_extra_libpath=$targ_extra_emuls ;;
- cris-*-linux-gnu*)    targ_emul=crislinux ;;
-+cris-*-linux-uclibc*) targ_emul=crislinux ;;
- cris-*-*)             targ_emul=criself
-                       targ_extra_emuls="crisaout crislinux"
-                       targ_extra_libpath=$targ_extra_emuls ;;
-@@ -59,14 +60,16 @@
-                       tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
-                       tdir_sun4=sparc-sun-sunos4
-                       ;;
--sparc64-*-linux-gnu*) targ_emul=elf64_sparc
-+sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)        \
-+                      targ_emul=elf64_sparc
-                       targ_extra_emuls="elf32_sparc sparclinux sun4"
-                       targ_extra_libpath=elf32_sparc
-                       tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
-                       tdir_sparclinux=${tdir_elf32_sparc}aout
-                       tdir_sun4=sparc-sun-sunos4
-                       ;;
--sparc*-*-linux-gnu*)  targ_emul=elf32_sparc
-+sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
-+                      targ_emul=elf32_sparc
-                       targ_extra_emuls="sparclinux elf64_sparc sun4"
-                       targ_extra_libpath=elf64_sparc
-                       tdir_sparclinux=${targ_alias}aout
-@@ -128,7 +131,7 @@
- m68*-ericsson-ose)    targ_emul=sun3 ;;
- m68*-apple-aux*)      targ_emul=m68kaux ;;
- *-tandem-none)                targ_emul=st2000 ;;
--i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
-+i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
- i[3-7]86-*-nto-qnx*)  targ_emul=i386nto ;;
- i[3-7]86-*-vsta)      targ_emul=vsta ;;
- i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
-@@ -152,14 +155,16 @@
-                       tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
-                       ;;
- i[3-7]86-*-linux*oldld)       targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
--i[3-7]86-*-linux-gnu*)        targ_emul=elf_i386
-+i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
-+                      targ_emul=elf_i386
-                       targ_extra_emuls=i386linux
-                       if test x${want64} = xtrue; then
-                         targ_extra_emuls="$targ_extra_emuls elf_x86_64"
-                       fi
-                       tdir_i386linux=${targ_alias}aout
-                       ;;
--x86_64-*-linux-gnu*)  targ_emul=elf_x86_64
-+x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
-+                      targ_emul=elf_x86_64
-                       targ_extra_emuls="elf_i386 i386linux"
-                       targ_extra_libpath=elf_i386
-                       tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
-@@ -259,10 +264,13 @@
- arm9e-*-elf)          targ_emul=armelf ;;
- arm-*-oabi)           targ_emul=armelf_oabi ;;
- arm*b-*-linux-gnu*)   targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
-+arm*b-*-linux-uclibc*)        targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
- arm*-*-linux-gnu*)    targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
-+arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- arm*-*-uclinux*)      targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- arm*-*-conix*)                targ_emul=armelf ;;
--thumb-*-linux-gnu* | thumb-*-uclinux*)        targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
-+thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
-+                      targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- strongarm-*-coff)     targ_emul=armcoff ;;
- strongarm-*-elf)      targ_emul=armelf ;;
- strongarm-*-kaos*)    targ_emul=armelf ;;
-@@ -363,7 +371,8 @@
-                       targ_extra_emuls=m68kelf
-                       tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
-                       ;;
--m68k-*-linux-gnu*)    targ_emul=m68kelf
-+m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
-+                      targ_emul=m68kelf
-                       targ_extra_emuls=m68klinux
-                       tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
-                       ;;
-@@ -380,9 +389,9 @@
- m68*-*-psos*)         targ_emul=m68kpsos ;;
- m68*-*-rtemscoff*)    targ_emul=m68kcoff ;;
- m68*-*-rtems*)                targ_emul=m68kelf ;;
--hppa*64*-*-linux-gnu*)        targ_emul=hppa64linux ;;
-+hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)  targ_emul=hppa64linux ;;
- hppa*64*-*)           targ_emul=elf64hppa ;;
--hppa*-*-linux-gnu*)   targ_emul=hppalinux ;;
-+hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*)   targ_emul=hppalinux ;;
- hppa*-*-*elf*)                targ_emul=hppaelf ;;
- hppa*-*-lites*)               targ_emul=hppaelf ;;
- hppa*-*-netbsd*)      targ_emul=hppanbsd ;;
-@@ -429,16 +438,20 @@
- mips*-*-vxworks*)     targ_emul=elf32ebmip
-                       targ_extra_emuls="elf32elmip" ;;
- mips*-*-windiss)      targ_emul=elf32mipswindiss ;;
--mips64*el-*-linux-gnu*)       targ_emul=elf32ltsmipn32
-+mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*) \
-+                      targ_emul=elf32ltsmipn32
-                       targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
-                       ;;
--mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
-+mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*) \
-+                      targ_emul=elf32btsmipn32
-                       targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
-                       ;;
--mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
-+mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*) \
-+                      targ_emul=elf32ltsmip
-                       targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
-                       ;;
--mips*-*-linux-gnu*)   targ_emul=elf32btsmip
-+mips*-*-linux-gnu* | mips*-*-linux-uclibc*) \
-+                      targ_emul=elf32btsmip
-                       targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
-                       ;;
- mips*-*-lnews*)               targ_emul=mipslnews ;;
-@@ -461,6 +474,10 @@
- alpha*-*-linux-gnu*)  targ_emul=elf64alpha targ_extra_emuls=alpha
-                       tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
-                       ;;
-+alpha*-*-linux-uclibc*)       targ_emul=elf64alpha targ_extra_emuls=alpha
-+                      # The following needs to be checked...
-+                      tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
-+                      ;;
- alpha*-*-osf*)                targ_emul=alpha ;;
- alpha*-*-gnu*)                targ_emul=elf64alpha ;;
- alpha*-*-netware*)    targ_emul=alpha ;;
-diff -urN binutils-2.14.90.0.8-001-debian/libtool.m4 binutils-2.14.90.0.8/libtool.m4
---- binutils-2.14.90.0.8-001-debian/libtool.m4 2003-05-05 16:46:46.000000000 -0500
-+++ binutils-2.14.90.0.8/libtool.m4    2004-02-12 14:09:10.000000000 -0600
-@@ -645,6 +645,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
-diff -urN binutils-2.14.90.0.8-001-debian/ltconfig binutils-2.14.90.0.8/ltconfig
---- binutils-2.14.90.0.8-001-debian/ltconfig   2004-01-14 15:07:42.000000000 -0600
-+++ binutils-2.14.90.0.8/ltconfig      2004-02-12 14:09:10.000000000 -0600
-@@ -603,6 +603,7 @@
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case $host_os in
- linux-gnu*) ;;
-+linux-uclibc*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
-@@ -1259,6 +1260,24 @@
-   dynamic_linker='GNU/Linux ld.so'
-   ;;
-+linux-uclibc*)
-+  version_type=linux
-+  need_lib_prefix=no
-+  need_version=no
-+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-+  soname_spec='${libname}${release}.so$major'
-+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-+  shlibpath_var=LD_LIBRARY_PATH
-+  shlibpath_overrides_runpath=no
-+  # This implies no fast_install, which is unacceptable.
-+  # Some rework will be needed to allow for fast_install
-+  # before this can be enabled.
-+  # Note: copied from linux-gnu, and may not be appropriate.
-+  hardcode_into_libs=yes
-+  # Assume using the uClibc dynamic linker.
-+  dynamic_linker="uClibc ld.so"
-+  ;;
-+
- netbsd*)
-   need_lib_prefix=no
-   need_version=no
diff --git a/openwrt/toolchain/binutils/2.14.90.0.8/600-arm-textrel.patch b/openwrt/toolchain/binutils/2.14.90.0.8/600-arm-textrel.patch
deleted file mode 100644 (file)
index 73d5b9d..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-http://sources.redhat.com/ml/binutils/2004-06/msg00010.html
---- binutils-2.15.90.0.3-old/bfd/elf32-arm.h   2004-04-12 14:56:33.000000000 -0500
-+++ binutils-2.15.90.0.3/bfd/elf32-arm.h       2004-09-03 06:56:40.000000000 -0500
-@@ -87,6 +87,8 @@
- #endif
- static bfd_boolean allocate_dynrelocs 
-   PARAMS ((struct elf_link_hash_entry *h, PTR inf));
-+static bfd_boolean elf32_arm_readonly_dynrelocs
-+  PARAMS ((struct elf_link_hash_entry *, PTR));
- static bfd_boolean create_got_section 
-   PARAMS ((bfd * dynobj, struct bfd_link_info * info));
- static bfd_boolean elf32_arm_create_dynamic_sections 
-@@ -3531,6 +3533,37 @@
-   return TRUE;
- }
-+/* Find any dynamic relocs that apply to read-only sections.  */
-+
-+static bfd_boolean
-+elf32_arm_readonly_dynrelocs (h, inf)
-+     struct elf_link_hash_entry *h;
-+     PTR inf;
-+{
-+  struct elf32_arm_link_hash_entry *eh;
-+  struct elf32_arm_relocs_copied *p;
-+
-+  if (h->root.type == bfd_link_hash_warning)
-+    h = (struct elf_link_hash_entry *) h->root.u.i.link;
-+
-+  eh = (struct elf32_arm_link_hash_entry *) h;
-+  for (p = eh->relocs_copied; p != NULL; p = p->next)
-+    {
-+      asection *s = p->section;
-+
-+      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-+       {
-+         struct bfd_link_info *info = (struct bfd_link_info *) inf;
-+
-+         info->flags |= DF_TEXTREL;
-+
-+         /* Not an error, just cut short the traversal.  */
-+         return FALSE;
-+       }
-+    }
-+  return TRUE;
-+}
-+
- /* Set the sizes of the dynamic sections.  */
- static bfd_boolean
-@@ -3740,6 +3773,12 @@
-           return FALSE;
-       }
-+      /* If any dynamic relocs apply to a read-only section,
-+         then we need a DT_TEXTREL entry.  */
-+      if ((info->flags & DF_TEXTREL) == 0)
-+        elf_link_hash_traverse (&htab->root, elf32_arm_readonly_dynrelocs,
-+                                (PTR) info);
-+
-       if ((info->flags & DF_TEXTREL) != 0)
-       {
-         if (!add_dynamic_entry (DT_TEXTREL, 0))
diff --git a/openwrt/toolchain/binutils/2.15.90.0.1.1/100-uclibc-conf.patch b/openwrt/toolchain/binutils/2.15.90.0.1.1/100-uclibc-conf.patch
deleted file mode 100644 (file)
index d47b6f0..0000000
+++ /dev/null
@@ -1,692 +0,0 @@
-diff -urN binutils-2.15.90.0.1.1-dist/bfd/config.bfd binutils-2.15.90.0.1.1/bfd/config.bfd
---- binutils-2.15.90.0.1.1-dist/bfd/config.bfd 2004-01-14 15:07:43.000000000 -0600
-+++ binutils-2.15.90.0.1.1/bfd/config.bfd      2004-08-06 17:29:55.000000000 -0500
-@@ -121,7 +121,7 @@
-     targ_defvec=ecoffalpha_little_vec
-     targ_selvecs=bfd_elf64_alpha_vec
-     ;;
--  alpha*-*-linux-gnu* | alpha*-*-elf*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
-     targ_defvec=bfd_elf64_alpha_vec
-     targ_selvecs=ecoffalpha_little_vec
-     ;;
-@@ -131,7 +131,7 @@
-   alpha*-*-*)
-     targ_defvec=ecoffalpha_little_vec
-     ;;
--  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
-+  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-linux-uclibc* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
-     targ_defvec=bfd_elf64_ia64_little_vec
-     targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
-     ;;
-@@ -208,7 +208,7 @@
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
--  armeb-*-elf | arm*b-*-linux-gnu*)
-+  armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_bigarm_vec
-     targ_selvecs=bfd_elf32_littlearm_vec
-     ;;
-@@ -216,7 +216,7 @@
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
--  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
-+  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | arm*-*-conix* | \
-   arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-@@ -350,7 +350,7 @@
-     ;;
- #ifdef BFD64
--  hppa*64*-*-linux-gnu*)
-+  hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_hppa_linux_vec
-     targ_selvecs=bfd_elf64_hppa_vec
-     ;;
-@@ -361,7 +361,7 @@
-     ;;
- #endif
--  hppa*-*-linux-gnu* | hppa*-*-netbsd*)
-+  hppa*-*-linux-gnu* | hppa*-*-linux-uclibc* | hppa*-*-netbsd*)
-     targ_defvec=bfd_elf32_hppa_linux_vec
-     targ_selvecs=bfd_elf32_hppa_vec
-     ;;
-@@ -483,7 +483,7 @@
-     targ_selvecs=bfd_elf32_i386_vec
-     targ_underscore=yes
-     ;;
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_i386_vec
-     targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
-     targ64_selvecs=bfd_elf64_x86_64_vec
-@@ -497,7 +497,7 @@
-     targ_defvec=bfd_elf64_x86_64_vec
-     targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
-     ;;
--  x86_64-*-linux-gnu*)
-+  x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_x86_64_vec
-     targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
-     ;;
-@@ -672,7 +672,7 @@
-     targ_selvecs=bfd_elf32_m68k_vec
-     targ_underscore=yes
-     ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_m68k_vec
-     targ_selvecs=m68klinux_vec
-     ;;
-@@ -952,7 +952,8 @@
-     ;;
- #endif
-   powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
--  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
-+  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
-+  powerpc-*-rtems* | \
-   powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
-     targ_defvec=bfd_elf32_powerpc_vec
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
-@@ -984,8 +985,8 @@
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
-     ;;
-   powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
--  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
--  powerpcle-*-rtems*)
-+  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
-+  powerpcle-*-vxworks* | powerpcle-*-rtems*)
-     targ_defvec=bfd_elf32_powerpcle_vec
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
-     targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
-@@ -1141,7 +1142,7 @@
-     targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
-     targ_underscore=yes
-     ;;
--  sparc-*-linux-gnu*)
-+  sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_sparc_vec
-     targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
-     ;;
-@@ -1188,7 +1189,7 @@
-     targ_defvec=sunos_big_vec
-     targ_underscore=yes
-     ;;
--  sparc64-*-linux-gnu*)
-+  sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_sparc_vec
-     targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
-     ;;
-@@ -1257,7 +1258,7 @@
-     targ_underscore=yes
-     ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_vax_vec
-     ;;
-diff -urN binutils-2.15.90.0.1.1-dist/bfd/configure binutils-2.15.90.0.1.1/bfd/configure
---- binutils-2.15.90.0.1.1-dist/bfd/configure  2004-03-05 19:18:21.000000000 -0600
-+++ binutils-2.15.90.0.1.1/bfd/configure       2004-08-06 17:29:55.000000000 -0500
-@@ -1699,6 +1699,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -5278,7 +5283,7 @@
-   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
-       COREFILE=''
-       ;;
--  alpha*-*-linux-gnu*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/alphalinux.h"'
-       ;;
-@@ -5338,7 +5343,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386mach3.h"'
-       ;;
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386linux.h"'
-       ;;
-@@ -5388,7 +5393,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/hp300bsd.h"'
-       ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/m68klinux.h"'
-       ;;
-@@ -5489,7 +5494,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxult2.h"'
-       ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxlinux.h"'
-       ;;
-diff -urN binutils-2.15.90.0.1.1-dist/bfd/configure.in binutils-2.15.90.0.1.1/bfd/configure.in
---- binutils-2.15.90.0.1.1-dist/bfd/configure.in       2004-03-05 19:18:21.000000000 -0600
-+++ binutils-2.15.90.0.1.1/bfd/configure.in    2004-08-06 17:29:55.000000000 -0500
-@@ -178,7 +178,7 @@
-   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
-       COREFILE=''
-       ;;
--  alpha*-*-linux-gnu*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/alphalinux.h"'
-       ;;
-@@ -259,7 +259,7 @@
-       TRAD_HEADER='"hosts/i386mach3.h"'
-       ;;
- changequote(,)dnl
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
- changequote([,])dnl
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386linux.h"'
-@@ -312,7 +312,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/hp300bsd.h"'
-       ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/m68klinux.h"'
-       ;;
-@@ -397,7 +397,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxult2.h"'
-       ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxlinux.h"'
-       ;;
-diff -urN binutils-2.15.90.0.1.1-dist/binutils/configure binutils-2.15.90.0.1.1/binutils/configure
---- binutils-2.15.90.0.1.1-dist/binutils/configure     2004-01-14 15:07:44.000000000 -0600
-+++ binutils-2.15.90.0.1.1/binutils/configure  2004-08-06 17:29:55.000000000 -0500
-@@ -1574,6 +1574,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.15.90.0.1.1-dist/configure binutils-2.15.90.0.1.1/configure
---- binutils-2.15.90.0.1.1-dist/configure      2004-03-03 14:24:33.000000000 -0600
-+++ binutils-2.15.90.0.1.1/configure   2004-08-06 17:29:55.000000000 -0500
-@@ -1288,6 +1288,18 @@
-   i[3456789]86-*-freebsd* | i[3456789]86-*-kfreebsd*-gnu)
-     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-     ;;
-+  i[3456789]86-*-linux-uclibc*)
-+    # This section makes it possible to build newlib natively on linux.
-+    # If we are using a cross compiler then don't configure newlib.
-+    if test x${is_cross_compiler} != xno ; then
-+      noconfigdirs="$noconfigdirs target-newlib"
-+    fi
-+    noconfigdirs="$noconfigdirs target-libgloss"
-+    # If we are not using a cross compiler, do configure newlib.
-+    # Note however, that newlib will only be configured in this situation
-+    # if the --with-newlib option has been given, because otherwise
-+    # 'target-newlib' will appear in skipdirs.
-+    ;;
-   i[3456789]86-*-linux*)
-     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
-     # not build java stuff by default.
-diff -urN binutils-2.15.90.0.1.1-dist/configure.in binutils-2.15.90.0.1.1/configure.in
---- binutils-2.15.90.0.1.1-dist/configure.in   2004-03-03 14:24:33.000000000 -0600
-+++ binutils-2.15.90.0.1.1/configure.in        2004-08-06 17:29:55.000000000 -0500
-@@ -521,6 +521,18 @@
-   i[[3456789]]86-*-freebsd* | i[[3456789]]86-*-kfreebsd*-gnu)
-     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-     ;;
-+  i[[3456789]]86-*-linux-uclibc*)
-+    # This section makes it possible to build newlib natively on linux.
-+    # If we are using a cross compiler then don't configure newlib.
-+    if test x${is_cross_compiler} != xno ; then
-+      noconfigdirs="$noconfigdirs target-newlib"
-+    fi
-+    noconfigdirs="$noconfigdirs target-libgloss"
-+    # If we are not using a cross compiler, do configure newlib.
-+    # Note however, that newlib will only be configured in this situation
-+    # if the --with-newlib option has been given, because otherwise
-+    # 'target-newlib' will appear in skipdirs.
-+    ;;
-   i[[3456789]]86-*-linux*)
-     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
-     # not build java stuff by default.
-diff -urN binutils-2.15.90.0.1.1-dist/gas/configure binutils-2.15.90.0.1.1/gas/configure
---- binutils-2.15.90.0.1.1-dist/gas/configure  2004-03-05 19:18:21.000000000 -0600
-+++ binutils-2.15.90.0.1.1/gas/configure       2004-08-06 17:29:55.000000000 -0500
-@@ -3401,6 +3401,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -4226,6 +4231,7 @@
-       alpha*-*-osf*)                  fmt=ecoff ;;
-       alpha*-*-linuxecoff*)           fmt=ecoff ;;
-       alpha*-*-linux-gnu*)            fmt=elf em=linux ;;
-+      alpha*-*-linux-uclibc*)         fmt=elf em=linux ;;
-       alpha*-*-netbsd*)                       fmt=elf em=nbsd ;;
-       alpha*-*-openbsd*)              fmt=elf em=obsd ;;
-@@ -4242,6 +4248,7 @@
-       arm*-*-conix*)                  fmt=elf ;;
-       arm-*-linux*aout*)              fmt=aout em=linux ;;
-       arm*-*-linux-gnu*)              fmt=elf  em=linux ;;
-+      arm*-*-linux-uclibc*)           fmt=elf  em=linux ;;
-       arm*-*-uclinux*)                        fmt=elf  em=linux ;;
-       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
-       arm-*-*n*bsd*)                  fmt=aout em=nbsd ;;
-@@ -4255,6 +4262,7 @@
-       avr-*-*)                                fmt=elf ;;
-       cris-*-linux-gnu*)              fmt=multi bfd_gas=yes em=linux ;;
-+      cris-*-linux-uclibc*)           fmt=multi bfd_gas=yes em=linux ;;
-       cris-*-*)                               fmt=multi bfd_gas=yes ;;
-       d10v-*-*)                               fmt=elf ;;
-@@ -4311,7 +4319,9 @@
-       i386-*-linux*oldld)             fmt=aout em=linux ;;
-       i386-*-linux*coff*)             fmt=coff em=linux ;;
-       i386-*-linux-gnu*)              fmt=elf em=linux ;;
-+      i386-*-linux-uclibc*)           fmt=elf em=linux ;;
-       x86_64-*-linux-gnu*)            fmt=elf em=linux ;;
-+      x86_64-*-linux-uclibc*)         fmt=elf em=linux ;;
-       i386-*-lynxos*)                 fmt=coff em=lynx ;;
-       i386-*-sysv[45]*)                       fmt=elf ;;
-       i386-*-solaris*)                        fmt=elf ;;
-@@ -4371,6 +4381,7 @@
-       ia64-*-elf*)                    fmt=elf ;;
-       ia64-*-aix*)                    fmt=elf em=ia64aix ;;
-       ia64-*-linux-gnu*)              fmt=elf em=linux ;;
-+      ia64-*-linux-uclibc*)           fmt=elf em=linux ;;
-       ia64-*-hpux*)                   fmt=elf em=hpux ;;
-       ia64-*-netbsd*)                 fmt=elf em=nbsd ;;
-@@ -4398,6 +4409,7 @@
-       m68k-*-hpux*)                   fmt=hp300 em=hp300 ;;
-       m68k-*-linux*aout*)             fmt=aout em=linux ;;
-       m68k-*-linux-gnu*)              fmt=elf em=linux ;;
-+      m68k-*-linux-uclibc*)           fmt=elf em=linux ;;
-       m68k-*-uclinux*)                        fmt=elf ;;
-       m68k-*-gnu*)                    fmt=elf ;;
-       m68k-*-lynxos*)                 fmt=coff em=lynx ;;
-@@ -4461,6 +4473,7 @@
-       ppc-*-beos*)                    fmt=coff ;;
-       ppc-*-*n*bsd* | ppc-*-elf*)     fmt=elf ;;
-       ppc-*-eabi* | ppc-*-sysv4*)     fmt=elf ;;
-+      ppc-*-linux-uclibc* | \
-       ppc-*-linux-gnu*)                       fmt=elf em=linux
-           case "$endian" in
-               big)  ;;
-@@ -4488,7 +4501,9 @@
-       ppc-*-kaos*)                    fmt=elf ;;
-       s390x-*-linux-gnu*)             fmt=elf em=linux ;;
-+      s390x-*-linux-uclibc*)          fmt=elf em=linux ;;
-       s390-*-linux-gnu*)              fmt=elf em=linux ;;
-+      s390-*-linux-uclibc*)           fmt=elf em=linux ;;
-       sh*-*-linux*)                   fmt=elf em=linux
-           case ${cpu} in
-@@ -4521,6 +4536,7 @@
-       sparc-*-coff)                   fmt=coff ;;
-       sparc-*-linux*aout*)            fmt=aout em=linux ;;
-       sparc-*-linux-gnu*)             fmt=elf em=linux ;;
-+      sparc-*-linux-uclibc*)          fmt=elf em=linux ;;
-       sparc-*-lynxos*)                        fmt=coff em=lynx ;;
-       sparc-fujitsu-none)             fmt=aout ;;
-       sparc-*-elf)                    fmt=elf ;;
-diff -urN binutils-2.15.90.0.1.1-dist/gas/configure.in binutils-2.15.90.0.1.1/gas/configure.in
---- binutils-2.15.90.0.1.1-dist/gas/configure.in       2004-01-14 15:07:45.000000000 -0600
-+++ binutils-2.15.90.0.1.1/gas/configure.in    2004-08-06 17:29:55.000000000 -0500
-@@ -194,6 +194,7 @@
-       alpha*-*-osf*)                  fmt=ecoff ;;
-       alpha*-*-linuxecoff*)           fmt=ecoff ;;
-       alpha*-*-linux-gnu*)            fmt=elf em=linux ;;
-+      alpha*-*-linux-uclibc*)         fmt=elf em=linux ;;
-       alpha*-*-netbsd*)                       fmt=elf em=nbsd ;;
-       alpha*-*-openbsd*)              fmt=elf em=obsd ;;
-@@ -210,6 +211,7 @@
-       arm*-*-conix*)                  fmt=elf ;;
-       arm-*-linux*aout*)              fmt=aout em=linux ;;
-       arm*-*-linux-gnu*)              fmt=elf  em=linux ;;
-+      arm*-*-linux-uclibc*)           fmt=elf  em=linux ;;
-       arm*-*-uclinux*)                        fmt=elf  em=linux ;;
-       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
-       arm-*-*n*bsd*)                  fmt=aout em=nbsd ;;
-@@ -223,6 +225,7 @@
-       avr-*-*)                                fmt=elf ;;
-       cris-*-linux-gnu*)              fmt=multi bfd_gas=yes em=linux ;;
-+      cris-*-linux-uclibc*)           fmt=multi bfd_gas=yes em=linux ;;
-       cris-*-*)                               fmt=multi bfd_gas=yes ;;
-       d10v-*-*)                               fmt=elf ;;
-@@ -279,7 +282,9 @@
-       i386-*-linux*oldld)             fmt=aout em=linux ;;
-       i386-*-linux*coff*)             fmt=coff em=linux ;;
-       i386-*-linux-gnu*)              fmt=elf em=linux ;;
-+      i386-*-linux-uclibc*)           fmt=elf em=linux ;;
-       x86_64-*-linux-gnu*)            fmt=elf em=linux ;;
-+      x86_64-*-linux-uclibc*)         fmt=elf em=linux ;;
-       i386-*-lynxos*)                 fmt=coff em=lynx ;;
- changequote(,)dnl
-       i386-*-sysv[45]*)                       fmt=elf ;;
-@@ -332,6 +337,7 @@
-       ia64-*-elf*)                    fmt=elf ;;
-       ia64-*-aix*)                    fmt=elf em=ia64aix ;;
-       ia64-*-linux-gnu*)              fmt=elf em=linux ;;
-+      ia64-*-linux-uclibc*)           fmt=elf em=linux ;;
-       ia64-*-hpux*)                   fmt=elf em=hpux ;;
-       ia64-*-netbsd*)                 fmt=elf em=nbsd ;;
-@@ -359,6 +365,7 @@
-       m68k-*-hpux*)                   fmt=hp300 em=hp300 ;;
-       m68k-*-linux*aout*)             fmt=aout em=linux ;;
-       m68k-*-linux-gnu*)              fmt=elf em=linux ;;
-+      m68k-*-linux-uclibc*)           fmt=elf em=linux ;;
-       m68k-*-uclinux*)                        fmt=elf ;;
-       m68k-*-gnu*)                    fmt=elf ;;
-       m68k-*-lynxos*)                 fmt=coff em=lynx ;;
-@@ -419,6 +426,7 @@
-       ppc-*-beos*)                    fmt=coff ;;
-       ppc-*-*n*bsd* | ppc-*-elf*)     fmt=elf ;;
-       ppc-*-eabi* | ppc-*-sysv4*)     fmt=elf ;;
-+      ppc-*-linux-uclibc* | \
-       ppc-*-linux-gnu*)                       fmt=elf em=linux
-           case "$endian" in
-               big)  ;;
-@@ -439,7 +447,9 @@
-       ppc-*-kaos*)                    fmt=elf ;;
-       s390x-*-linux-gnu*)             fmt=elf em=linux ;;
-+      s390x-*-linux-uclibc*)          fmt=elf em=linux ;;
-       s390-*-linux-gnu*)              fmt=elf em=linux ;;
-+      s390-*-linux-uclibc*)           fmt=elf em=linux ;;
-       sh*-*-linux*)                   fmt=elf em=linux
-           case ${cpu} in
-@@ -472,6 +482,7 @@
-       sparc-*-coff)                   fmt=coff ;;
-       sparc-*-linux*aout*)            fmt=aout em=linux ;;
-       sparc-*-linux-gnu*)             fmt=elf em=linux ;;
-+      sparc-*-linux-uclibc*)          fmt=elf em=linux ;;
-       sparc-*-lynxos*)                        fmt=coff em=lynx ;;
-       sparc-fujitsu-none)             fmt=aout ;;
-       sparc-*-elf)                    fmt=elf ;;
-diff -urN binutils-2.15.90.0.1.1-dist/gprof/configure binutils-2.15.90.0.1.1/gprof/configure
---- binutils-2.15.90.0.1.1-dist/gprof/configure        2004-01-14 15:07:51.000000000 -0600
-+++ binutils-2.15.90.0.1.1/gprof/configure     2004-08-06 17:29:55.000000000 -0500
-@@ -1570,6 +1570,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.15.90.0.1.1-dist/ld/configure binutils-2.15.90.0.1.1/ld/configure
---- binutils-2.15.90.0.1.1-dist/ld/configure   2003-05-05 16:46:49.000000000 -0500
-+++ binutils-2.15.90.0.1.1/ld/configure        2004-08-06 17:29:55.000000000 -0500
-@@ -1578,6 +1578,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.15.90.0.1.1-dist/ld/configure.tgt binutils-2.15.90.0.1.1/ld/configure.tgt
---- binutils-2.15.90.0.1.1-dist/ld/configure.tgt       2004-01-14 15:07:52.000000000 -0600
-+++ binutils-2.15.90.0.1.1/ld/configure.tgt    2004-08-06 17:29:55.000000000 -0500
-@@ -30,6 +30,7 @@
-                       targ_extra_emuls="criself crislinux"
-                       targ_extra_libpath=$targ_extra_emuls ;;
- cris-*-linux-gnu*)    targ_emul=crislinux ;;
-+cris-*-linux-uclibc*) targ_emul=crislinux ;;
- cris-*-*)             targ_emul=criself
-                       targ_extra_emuls="crisaout crislinux"
-                       targ_extra_libpath=$targ_extra_emuls ;;
-@@ -59,14 +60,16 @@
-                       tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
-                       tdir_sun4=sparc-sun-sunos4
-                       ;;
--sparc64-*-linux-gnu*) targ_emul=elf64_sparc
-+sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)        \
-+                      targ_emul=elf64_sparc
-                       targ_extra_emuls="elf32_sparc sparclinux sun4"
-                       targ_extra_libpath=elf32_sparc
-                       tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
-                       tdir_sparclinux=${tdir_elf32_sparc}aout
-                       tdir_sun4=sparc-sun-sunos4
-                       ;;
--sparc*-*-linux-gnu*)  targ_emul=elf32_sparc
-+sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
-+                      targ_emul=elf32_sparc
-                       targ_extra_emuls="sparclinux elf64_sparc sun4"
-                       targ_extra_libpath=elf64_sparc
-                       tdir_sparclinux=${targ_alias}aout
-@@ -118,7 +121,9 @@
- m32r*le-*-elf*)         targ_emul=m32rlelf ;;
- m32r*-*-elf*)           targ_emul=m32relf ;;
- m32r*le-*-linux-gnu*)   targ_emul=m32rlelf_linux ;;
-+m32r*le-*-linux-uclibc*) targ_emul=m32rlelf_linux ;;
- m32r*-*-linux-gnu*)     targ_emul=m32relf_linux ;;
-+m32r*-*-linux-uclibc*)  targ_emul=m32relf_linux ;;
- m68hc11-*-*|m6811-*-*)        targ_emul=m68hc11elf 
-                       targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
- m68hc12-*-*|m6812-*-*)        targ_emul=m68hc12elf 
-@@ -128,7 +133,7 @@
- m68*-ericsson-ose)    targ_emul=sun3 ;;
- m68*-apple-aux*)      targ_emul=m68kaux ;;
- *-tandem-none)                targ_emul=st2000 ;;
--i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
-+i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
- i[3-7]86-*-nto-qnx*)  targ_emul=i386nto ;;
- i[3-7]86-*-vsta)      targ_emul=vsta ;;
- i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
-@@ -152,14 +157,16 @@
-                       tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
-                       ;;
- i[3-7]86-*-linux*oldld)       targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
--i[3-7]86-*-linux-gnu*)        targ_emul=elf_i386
-+i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
-+                      targ_emul=elf_i386
-                       targ_extra_emuls=i386linux
-                       if test x${want64} = xtrue; then
-                         targ_extra_emuls="$targ_extra_emuls elf_x86_64"
-                       fi
-                       tdir_i386linux=${targ_alias}aout
-                       ;;
--x86_64-*-linux-gnu*)  targ_emul=elf_x86_64
-+x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
-+                      targ_emul=elf_x86_64
-                       targ_extra_emuls="elf_i386 i386linux"
-                       targ_extra_libpath=elf_i386
-                       tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
-@@ -259,10 +266,13 @@
- arm9e-*-elf)          targ_emul=armelf ;;
- arm-*-oabi)           targ_emul=armelf_oabi ;;
- arm*b-*-linux-gnu*)   targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
-+arm*b-*-linux-uclibc*)        targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
- arm*-*-linux-gnu*)    targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
-+arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- arm*-*-uclinux*)      targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- arm*-*-conix*)                targ_emul=armelf ;;
--thumb-*-linux-gnu* | thumb-*-uclinux*)        targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
-+thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
-+                      targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- strongarm-*-coff)     targ_emul=armcoff ;;
- strongarm-*-elf)      targ_emul=armelf ;;
- strongarm-*-kaos*)    targ_emul=armelf ;;
-@@ -363,7 +373,8 @@
-                       targ_extra_emuls=m68kelf
-                       tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
-                       ;;
--m68k-*-linux-gnu*)    targ_emul=m68kelf
-+m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
-+                      targ_emul=m68kelf
-                       targ_extra_emuls=m68klinux
-                       tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
-                       ;;
-@@ -380,9 +391,9 @@
- m68*-*-psos*)         targ_emul=m68kpsos ;;
- m68*-*-rtemscoff*)    targ_emul=m68kcoff ;;
- m68*-*-rtems*)                targ_emul=m68kelf ;;
--hppa*64*-*-linux-gnu*)        targ_emul=hppa64linux ;;
-+hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)  targ_emul=hppa64linux ;;
- hppa*64*-*)           targ_emul=elf64hppa ;;
--hppa*-*-linux-gnu*)   targ_emul=hppalinux ;;
-+hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*)   targ_emul=hppalinux ;;
- hppa*-*-*elf*)                targ_emul=hppaelf ;;
- hppa*-*-lites*)               targ_emul=hppaelf ;;
- hppa*-*-netbsd*)      targ_emul=hppanbsd ;;
-@@ -395,6 +406,7 @@
-                       targ_emul=vaxnbsd
-                       targ_extra_emuls=elf32vax ;;
- vax-*-linux-gnu*)     targ_emul=elf32vax ;;
-+vax-*-linux-uclibc*)  targ_emul=elf32vax ;;
- mips*-*-pe)           targ_emul=mipspe ;
-                       targ_extra_ofiles="deffilep.o pe-dll.o" ;;
- mips*-dec-ultrix*)    targ_emul=mipslit ;;
-@@ -429,16 +441,16 @@
- mips*-*-vxworks*)     targ_emul=elf32ebmip
-                       targ_extra_emuls="elf32elmip" ;;
- mips*-*-windiss)      targ_emul=elf32mipswindiss ;;
--mips64*el-*-linux-gnu*)       targ_emul=elf32ltsmipn32
-+mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*)   targ_emul=elf32ltsmipn32
-                       targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
-                       ;;
--mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
-+mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*)       targ_emul=elf32btsmipn32
-                       targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
-                       ;;
--mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
-+mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*)       targ_emul=elf32ltsmip
-                       targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
-                       ;;
--mips*-*-linux-gnu*)   targ_emul=elf32btsmip
-+mips*-*-linux-gnu* | mips*-*-linux-uclibc*)   targ_emul=elf32btsmip
-                       targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
-                       ;;
- mips*-*-lnews*)               targ_emul=mipslnews ;;
-@@ -461,6 +473,10 @@
- alpha*-*-linux-gnu*)  targ_emul=elf64alpha targ_extra_emuls=alpha
-                       tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
-                       ;;
-+alpha*-*-linux-uclibc*)       targ_emul=elf64alpha targ_extra_emuls=alpha
-+                      # The following needs to be checked...
-+                      tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
-+                      ;;
- alpha*-*-osf*)                targ_emul=alpha ;;
- alpha*-*-gnu*)                targ_emul=elf64alpha ;;
- alpha*-*-netware*)    targ_emul=alpha ;;
-diff -urN binutils-2.15.90.0.1.1-dist/libtool.m4 binutils-2.15.90.0.1.1/libtool.m4
---- binutils-2.15.90.0.1.1-dist/libtool.m4     2003-05-05 16:46:46.000000000 -0500
-+++ binutils-2.15.90.0.1.1/libtool.m4  2004-08-06 17:29:55.000000000 -0500
-@@ -645,6 +645,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
-diff -urN binutils-2.15.90.0.1.1-dist/ltconfig binutils-2.15.90.0.1.1/ltconfig
---- binutils-2.15.90.0.1.1-dist/ltconfig       2004-01-14 15:07:42.000000000 -0600
-+++ binutils-2.15.90.0.1.1/ltconfig    2004-08-06 17:29:55.000000000 -0500
-@@ -603,6 +603,7 @@
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case $host_os in
- linux-gnu*) ;;
-+linux-uclibc*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
-@@ -1259,6 +1260,24 @@
-   dynamic_linker='GNU/Linux ld.so'
-   ;;
-+linux-uclibc*)
-+  version_type=linux
-+  need_lib_prefix=no
-+  need_version=no
-+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-+  soname_spec='${libname}${release}.so$major'
-+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-+  shlibpath_var=LD_LIBRARY_PATH
-+  shlibpath_overrides_runpath=no
-+  # This implies no fast_install, which is unacceptable.
-+  # Some rework will be needed to allow for fast_install
-+  # before this can be enabled.
-+  # Note: copied from linux-gnu, and may not be appropriate.
-+  hardcode_into_libs=yes
-+  # Assume using the uClibc dynamic linker.
-+  dynamic_linker="uClibc ld.so"
-+  ;;
-+
- netbsd*)
-   need_lib_prefix=no
-   need_version=no
-diff -urN binutils-2.15.90.0.1.1-dist/opcodes/configure binutils-2.15.90.0.1.1/opcodes/configure
---- binutils-2.15.90.0.1.1-dist/opcodes/configure      2004-01-14 15:07:54.000000000 -0600
-+++ binutils-2.15.90.0.1.1/opcodes/configure   2004-08-06 17:29:55.000000000 -0500
-@@ -1689,6 +1689,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
diff --git a/openwrt/toolchain/binutils/2.15.90.0.1.1/600-arm-textrel.patch b/openwrt/toolchain/binutils/2.15.90.0.1.1/600-arm-textrel.patch
deleted file mode 100644 (file)
index 73d5b9d..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-http://sources.redhat.com/ml/binutils/2004-06/msg00010.html
---- binutils-2.15.90.0.3-old/bfd/elf32-arm.h   2004-04-12 14:56:33.000000000 -0500
-+++ binutils-2.15.90.0.3/bfd/elf32-arm.h       2004-09-03 06:56:40.000000000 -0500
-@@ -87,6 +87,8 @@
- #endif
- static bfd_boolean allocate_dynrelocs 
-   PARAMS ((struct elf_link_hash_entry *h, PTR inf));
-+static bfd_boolean elf32_arm_readonly_dynrelocs
-+  PARAMS ((struct elf_link_hash_entry *, PTR));
- static bfd_boolean create_got_section 
-   PARAMS ((bfd * dynobj, struct bfd_link_info * info));
- static bfd_boolean elf32_arm_create_dynamic_sections 
-@@ -3531,6 +3533,37 @@
-   return TRUE;
- }
-+/* Find any dynamic relocs that apply to read-only sections.  */
-+
-+static bfd_boolean
-+elf32_arm_readonly_dynrelocs (h, inf)
-+     struct elf_link_hash_entry *h;
-+     PTR inf;
-+{
-+  struct elf32_arm_link_hash_entry *eh;
-+  struct elf32_arm_relocs_copied *p;
-+
-+  if (h->root.type == bfd_link_hash_warning)
-+    h = (struct elf_link_hash_entry *) h->root.u.i.link;
-+
-+  eh = (struct elf32_arm_link_hash_entry *) h;
-+  for (p = eh->relocs_copied; p != NULL; p = p->next)
-+    {
-+      asection *s = p->section;
-+
-+      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-+       {
-+         struct bfd_link_info *info = (struct bfd_link_info *) inf;
-+
-+         info->flags |= DF_TEXTREL;
-+
-+         /* Not an error, just cut short the traversal.  */
-+         return FALSE;
-+       }
-+    }
-+  return TRUE;
-+}
-+
- /* Set the sizes of the dynamic sections.  */
- static bfd_boolean
-@@ -3740,6 +3773,12 @@
-           return FALSE;
-       }
-+      /* If any dynamic relocs apply to a read-only section,
-+         then we need a DT_TEXTREL entry.  */
-+      if ((info->flags & DF_TEXTREL) == 0)
-+        elf_link_hash_traverse (&htab->root, elf32_arm_readonly_dynrelocs,
-+                                (PTR) info);
-+
-       if ((info->flags & DF_TEXTREL) != 0)
-       {
-         if (!add_dynamic_entry (DT_TEXTREL, 0))
diff --git a/openwrt/toolchain/binutils/2.15.90.0.1/100-uclibc-conf.patch b/openwrt/toolchain/binutils/2.15.90.0.1/100-uclibc-conf.patch
deleted file mode 100644 (file)
index 64aef49..0000000
+++ /dev/null
@@ -1,692 +0,0 @@
-diff -urN binutils-2.15.90.0.1-dist/bfd/config.bfd binutils-2.15.90.0.1/bfd/config.bfd
---- binutils-2.15.90.0.1-dist/bfd/config.bfd   2004-01-14 15:07:43.000000000 -0600
-+++ binutils-2.15.90.0.1/bfd/config.bfd        2004-08-06 17:39:55.000000000 -0500
-@@ -121,7 +121,7 @@
-     targ_defvec=ecoffalpha_little_vec
-     targ_selvecs=bfd_elf64_alpha_vec
-     ;;
--  alpha*-*-linux-gnu* | alpha*-*-elf*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
-     targ_defvec=bfd_elf64_alpha_vec
-     targ_selvecs=ecoffalpha_little_vec
-     ;;
-@@ -131,7 +131,7 @@
-   alpha*-*-*)
-     targ_defvec=ecoffalpha_little_vec
-     ;;
--  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
-+  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-linux-uclibc* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
-     targ_defvec=bfd_elf64_ia64_little_vec
-     targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
-     ;;
-@@ -208,7 +208,7 @@
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
--  armeb-*-elf | arm*b-*-linux-gnu*)
-+  armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_bigarm_vec
-     targ_selvecs=bfd_elf32_littlearm_vec
-     ;;
-@@ -216,7 +216,7 @@
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
--  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
-+  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | arm*-*-conix* | \
-   arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-@@ -350,7 +350,7 @@
-     ;;
- #ifdef BFD64
--  hppa*64*-*-linux-gnu*)
-+  hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_hppa_linux_vec
-     targ_selvecs=bfd_elf64_hppa_vec
-     ;;
-@@ -361,7 +361,7 @@
-     ;;
- #endif
--  hppa*-*-linux-gnu* | hppa*-*-netbsd*)
-+  hppa*-*-linux-gnu* | hppa*-*-linux-uclibc* | hppa*-*-netbsd*)
-     targ_defvec=bfd_elf32_hppa_linux_vec
-     targ_selvecs=bfd_elf32_hppa_vec
-     ;;
-@@ -483,7 +483,7 @@
-     targ_selvecs=bfd_elf32_i386_vec
-     targ_underscore=yes
-     ;;
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_i386_vec
-     targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
-     targ64_selvecs=bfd_elf64_x86_64_vec
-@@ -497,7 +497,7 @@
-     targ_defvec=bfd_elf64_x86_64_vec
-     targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
-     ;;
--  x86_64-*-linux-gnu*)
-+  x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_x86_64_vec
-     targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
-     ;;
-@@ -672,7 +672,7 @@
-     targ_selvecs=bfd_elf32_m68k_vec
-     targ_underscore=yes
-     ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_m68k_vec
-     targ_selvecs=m68klinux_vec
-     ;;
-@@ -952,7 +952,8 @@
-     ;;
- #endif
-   powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
--  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
-+  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
-+  powerpc-*-rtems* | \
-   powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
-     targ_defvec=bfd_elf32_powerpc_vec
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
-@@ -984,8 +985,8 @@
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
-     ;;
-   powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
--  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
--  powerpcle-*-rtems*)
-+  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
-+  powerpcle-*-vxworks* | powerpcle-*-rtems*)
-     targ_defvec=bfd_elf32_powerpcle_vec
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
-     targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
-@@ -1141,7 +1142,7 @@
-     targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
-     targ_underscore=yes
-     ;;
--  sparc-*-linux-gnu*)
-+  sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_sparc_vec
-     targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
-     ;;
-@@ -1188,7 +1189,7 @@
-     targ_defvec=sunos_big_vec
-     targ_underscore=yes
-     ;;
--  sparc64-*-linux-gnu*)
-+  sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_sparc_vec
-     targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
-     ;;
-@@ -1257,7 +1258,7 @@
-     targ_underscore=yes
-     ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_vax_vec
-     ;;
-diff -urN binutils-2.15.90.0.1-dist/bfd/configure binutils-2.15.90.0.1/bfd/configure
---- binutils-2.15.90.0.1-dist/bfd/configure    2004-03-03 14:24:33.000000000 -0600
-+++ binutils-2.15.90.0.1/bfd/configure 2004-08-06 17:39:55.000000000 -0500
-@@ -1699,6 +1699,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -5278,7 +5283,7 @@
-   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
-       COREFILE=''
-       ;;
--  alpha*-*-linux-gnu*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/alphalinux.h"'
-       ;;
-@@ -5338,7 +5343,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386mach3.h"'
-       ;;
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386linux.h"'
-       ;;
-@@ -5388,7 +5393,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/hp300bsd.h"'
-       ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/m68klinux.h"'
-       ;;
-@@ -5489,7 +5494,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxult2.h"'
-       ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxlinux.h"'
-       ;;
-diff -urN binutils-2.15.90.0.1-dist/bfd/configure.in binutils-2.15.90.0.1/bfd/configure.in
---- binutils-2.15.90.0.1-dist/bfd/configure.in 2004-03-03 14:24:33.000000000 -0600
-+++ binutils-2.15.90.0.1/bfd/configure.in      2004-08-06 17:39:55.000000000 -0500
-@@ -178,7 +178,7 @@
-   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
-       COREFILE=''
-       ;;
--  alpha*-*-linux-gnu*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/alphalinux.h"'
-       ;;
-@@ -259,7 +259,7 @@
-       TRAD_HEADER='"hosts/i386mach3.h"'
-       ;;
- changequote(,)dnl
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
- changequote([,])dnl
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386linux.h"'
-@@ -312,7 +312,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/hp300bsd.h"'
-       ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/m68klinux.h"'
-       ;;
-@@ -397,7 +397,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxult2.h"'
-       ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxlinux.h"'
-       ;;
-diff -urN binutils-2.15.90.0.1-dist/binutils/configure binutils-2.15.90.0.1/binutils/configure
---- binutils-2.15.90.0.1-dist/binutils/configure       2004-01-14 15:07:44.000000000 -0600
-+++ binutils-2.15.90.0.1/binutils/configure    2004-08-06 17:39:55.000000000 -0500
-@@ -1574,6 +1574,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.15.90.0.1-dist/configure binutils-2.15.90.0.1/configure
---- binutils-2.15.90.0.1-dist/configure        2004-03-03 14:24:33.000000000 -0600
-+++ binutils-2.15.90.0.1/configure     2004-08-06 17:39:55.000000000 -0500
-@@ -1288,6 +1288,18 @@
-   i[3456789]86-*-freebsd* | i[3456789]86-*-kfreebsd*-gnu)
-     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-     ;;
-+  i[3456789]86-*-linux-uclibc*)
-+    # This section makes it possible to build newlib natively on linux.
-+    # If we are using a cross compiler then don't configure newlib.
-+    if test x${is_cross_compiler} != xno ; then
-+      noconfigdirs="$noconfigdirs target-newlib"
-+    fi
-+    noconfigdirs="$noconfigdirs target-libgloss"
-+    # If we are not using a cross compiler, do configure newlib.
-+    # Note however, that newlib will only be configured in this situation
-+    # if the --with-newlib option has been given, because otherwise
-+    # 'target-newlib' will appear in skipdirs.
-+    ;;
-   i[3456789]86-*-linux*)
-     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
-     # not build java stuff by default.
-diff -urN binutils-2.15.90.0.1-dist/configure.in binutils-2.15.90.0.1/configure.in
---- binutils-2.15.90.0.1-dist/configure.in     2004-03-03 14:24:33.000000000 -0600
-+++ binutils-2.15.90.0.1/configure.in  2004-08-06 17:39:55.000000000 -0500
-@@ -521,6 +521,18 @@
-   i[[3456789]]86-*-freebsd* | i[[3456789]]86-*-kfreebsd*-gnu)
-     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-     ;;
-+  i[[3456789]]86-*-linux-uclibc*)
-+    # This section makes it possible to build newlib natively on linux.
-+    # If we are using a cross compiler then don't configure newlib.
-+    if test x${is_cross_compiler} != xno ; then
-+      noconfigdirs="$noconfigdirs target-newlib"
-+    fi
-+    noconfigdirs="$noconfigdirs target-libgloss"
-+    # If we are not using a cross compiler, do configure newlib.
-+    # Note however, that newlib will only be configured in this situation
-+    # if the --with-newlib option has been given, because otherwise
-+    # 'target-newlib' will appear in skipdirs.
-+    ;;
-   i[[3456789]]86-*-linux*)
-     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
-     # not build java stuff by default.
-diff -urN binutils-2.15.90.0.1-dist/gas/configure binutils-2.15.90.0.1/gas/configure
---- binutils-2.15.90.0.1-dist/gas/configure    2004-01-14 15:07:45.000000000 -0600
-+++ binutils-2.15.90.0.1/gas/configure 2004-08-06 17:39:55.000000000 -0500
-@@ -3215,6 +3215,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -4030,6 +4035,7 @@
-       alpha*-*-osf*)                  fmt=ecoff ;;
-       alpha*-*-linuxecoff*)           fmt=ecoff ;;
-       alpha*-*-linux-gnu*)            fmt=elf em=linux ;;
-+      alpha*-*-linux-uclibc*)         fmt=elf em=linux ;;
-       alpha*-*-netbsd*)                       fmt=elf em=nbsd ;;
-       alpha*-*-openbsd*)              fmt=elf em=obsd ;;
-@@ -4046,6 +4052,7 @@
-       arm*-*-conix*)                  fmt=elf ;;
-       arm-*-linux*aout*)              fmt=aout em=linux ;;
-       arm*-*-linux-gnu*)              fmt=elf  em=linux ;;
-+      arm*-*-linux-uclibc*)           fmt=elf  em=linux ;;
-       arm*-*-uclinux*)                        fmt=elf  em=linux ;;
-       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
-       arm-*-*n*bsd*)                  fmt=aout em=nbsd ;;
-@@ -4059,6 +4066,7 @@
-       avr-*-*)                                fmt=elf ;;
-       cris-*-linux-gnu*)              fmt=multi bfd_gas=yes em=linux ;;
-+      cris-*-linux-uclibc*)           fmt=multi bfd_gas=yes em=linux ;;
-       cris-*-*)                               fmt=multi bfd_gas=yes ;;
-       d10v-*-*)                               fmt=elf ;;
-@@ -4115,7 +4123,9 @@
-       i386-*-linux*oldld)             fmt=aout em=linux ;;
-       i386-*-linux*coff*)             fmt=coff em=linux ;;
-       i386-*-linux-gnu*)              fmt=elf em=linux ;;
-+      i386-*-linux-uclibc*)           fmt=elf em=linux ;;
-       x86_64-*-linux-gnu*)            fmt=elf em=linux ;;
-+      x86_64-*-linux-uclibc*)         fmt=elf em=linux ;;
-       i386-*-lynxos*)                 fmt=coff em=lynx ;;
-       i386-*-sysv[45]*)                       fmt=elf ;;
-       i386-*-solaris*)                        fmt=elf ;;
-@@ -4175,6 +4185,7 @@
-       ia64-*-elf*)                    fmt=elf ;;
-       ia64-*-aix*)                    fmt=elf em=ia64aix ;;
-       ia64-*-linux-gnu*)              fmt=elf em=linux ;;
-+      ia64-*-linux-uclibc*)           fmt=elf em=linux ;;
-       ia64-*-hpux*)                   fmt=elf em=hpux ;;
-       ia64-*-netbsd*)                 fmt=elf em=nbsd ;;
-@@ -4202,6 +4213,7 @@
-       m68k-*-hpux*)                   fmt=hp300 em=hp300 ;;
-       m68k-*-linux*aout*)             fmt=aout em=linux ;;
-       m68k-*-linux-gnu*)              fmt=elf em=linux ;;
-+      m68k-*-linux-uclibc*)           fmt=elf em=linux ;;
-       m68k-*-uclinux*)                        fmt=elf ;;
-       m68k-*-gnu*)                    fmt=elf ;;
-       m68k-*-lynxos*)                 fmt=coff em=lynx ;;
-@@ -4265,6 +4277,7 @@
-       ppc-*-beos*)                    fmt=coff ;;
-       ppc-*-*n*bsd* | ppc-*-elf*)     fmt=elf ;;
-       ppc-*-eabi* | ppc-*-sysv4*)     fmt=elf ;;
-+      ppc-*-linux-uclibc* | \
-       ppc-*-linux-gnu*)                       fmt=elf em=linux
-           case "$endian" in
-               big)  ;;
-@@ -4292,7 +4305,9 @@
-       ppc-*-kaos*)                    fmt=elf ;;
-       s390x-*-linux-gnu*)             fmt=elf em=linux ;;
-+      s390x-*-linux-uclibc*)          fmt=elf em=linux ;;
-       s390-*-linux-gnu*)              fmt=elf em=linux ;;
-+      s390-*-linux-uclibc*)           fmt=elf em=linux ;;
-       sh*-*-linux*)                   fmt=elf em=linux
-           case ${cpu} in
-@@ -4325,6 +4340,7 @@
-       sparc-*-coff)                   fmt=coff ;;
-       sparc-*-linux*aout*)            fmt=aout em=linux ;;
-       sparc-*-linux-gnu*)             fmt=elf em=linux ;;
-+      sparc-*-linux-uclibc*)          fmt=elf em=linux ;;
-       sparc-*-lynxos*)                        fmt=coff em=lynx ;;
-       sparc-fujitsu-none)             fmt=aout ;;
-       sparc-*-elf)                    fmt=elf ;;
-diff -urN binutils-2.15.90.0.1-dist/gas/configure.in binutils-2.15.90.0.1/gas/configure.in
---- binutils-2.15.90.0.1-dist/gas/configure.in 2004-01-14 15:07:45.000000000 -0600
-+++ binutils-2.15.90.0.1/gas/configure.in      2004-08-06 17:39:55.000000000 -0500
-@@ -194,6 +194,7 @@
-       alpha*-*-osf*)                  fmt=ecoff ;;
-       alpha*-*-linuxecoff*)           fmt=ecoff ;;
-       alpha*-*-linux-gnu*)            fmt=elf em=linux ;;
-+      alpha*-*-linux-uclibc*)         fmt=elf em=linux ;;
-       alpha*-*-netbsd*)                       fmt=elf em=nbsd ;;
-       alpha*-*-openbsd*)              fmt=elf em=obsd ;;
-@@ -210,6 +211,7 @@
-       arm*-*-conix*)                  fmt=elf ;;
-       arm-*-linux*aout*)              fmt=aout em=linux ;;
-       arm*-*-linux-gnu*)              fmt=elf  em=linux ;;
-+      arm*-*-linux-uclibc*)           fmt=elf  em=linux ;;
-       arm*-*-uclinux*)                        fmt=elf  em=linux ;;
-       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
-       arm-*-*n*bsd*)                  fmt=aout em=nbsd ;;
-@@ -223,6 +225,7 @@
-       avr-*-*)                                fmt=elf ;;
-       cris-*-linux-gnu*)              fmt=multi bfd_gas=yes em=linux ;;
-+      cris-*-linux-uclibc*)           fmt=multi bfd_gas=yes em=linux ;;
-       cris-*-*)                               fmt=multi bfd_gas=yes ;;
-       d10v-*-*)                               fmt=elf ;;
-@@ -279,7 +282,9 @@
-       i386-*-linux*oldld)             fmt=aout em=linux ;;
-       i386-*-linux*coff*)             fmt=coff em=linux ;;
-       i386-*-linux-gnu*)              fmt=elf em=linux ;;
-+      i386-*-linux-uclibc*)           fmt=elf em=linux ;;
-       x86_64-*-linux-gnu*)            fmt=elf em=linux ;;
-+      x86_64-*-linux-uclibc*)         fmt=elf em=linux ;;
-       i386-*-lynxos*)                 fmt=coff em=lynx ;;
- changequote(,)dnl
-       i386-*-sysv[45]*)                       fmt=elf ;;
-@@ -332,6 +337,7 @@
-       ia64-*-elf*)                    fmt=elf ;;
-       ia64-*-aix*)                    fmt=elf em=ia64aix ;;
-       ia64-*-linux-gnu*)              fmt=elf em=linux ;;
-+      ia64-*-linux-uclibc*)           fmt=elf em=linux ;;
-       ia64-*-hpux*)                   fmt=elf em=hpux ;;
-       ia64-*-netbsd*)                 fmt=elf em=nbsd ;;
-@@ -359,6 +365,7 @@
-       m68k-*-hpux*)                   fmt=hp300 em=hp300 ;;
-       m68k-*-linux*aout*)             fmt=aout em=linux ;;
-       m68k-*-linux-gnu*)              fmt=elf em=linux ;;
-+      m68k-*-linux-uclibc*)           fmt=elf em=linux ;;
-       m68k-*-uclinux*)                        fmt=elf ;;
-       m68k-*-gnu*)                    fmt=elf ;;
-       m68k-*-lynxos*)                 fmt=coff em=lynx ;;
-@@ -419,6 +426,7 @@
-       ppc-*-beos*)                    fmt=coff ;;
-       ppc-*-*n*bsd* | ppc-*-elf*)     fmt=elf ;;
-       ppc-*-eabi* | ppc-*-sysv4*)     fmt=elf ;;
-+      ppc-*-linux-uclibc* | \
-       ppc-*-linux-gnu*)                       fmt=elf em=linux
-           case "$endian" in
-               big)  ;;
-@@ -439,7 +447,9 @@
-       ppc-*-kaos*)                    fmt=elf ;;
-       s390x-*-linux-gnu*)             fmt=elf em=linux ;;
-+      s390x-*-linux-uclibc*)          fmt=elf em=linux ;;
-       s390-*-linux-gnu*)              fmt=elf em=linux ;;
-+      s390-*-linux-uclibc*)           fmt=elf em=linux ;;
-       sh*-*-linux*)                   fmt=elf em=linux
-           case ${cpu} in
-@@ -472,6 +482,7 @@
-       sparc-*-coff)                   fmt=coff ;;
-       sparc-*-linux*aout*)            fmt=aout em=linux ;;
-       sparc-*-linux-gnu*)             fmt=elf em=linux ;;
-+      sparc-*-linux-uclibc*)          fmt=elf em=linux ;;
-       sparc-*-lynxos*)                        fmt=coff em=lynx ;;
-       sparc-fujitsu-none)             fmt=aout ;;
-       sparc-*-elf)                    fmt=elf ;;
-diff -urN binutils-2.15.90.0.1-dist/gprof/configure binutils-2.15.90.0.1/gprof/configure
---- binutils-2.15.90.0.1-dist/gprof/configure  2004-01-14 15:07:51.000000000 -0600
-+++ binutils-2.15.90.0.1/gprof/configure       2004-08-06 17:39:55.000000000 -0500
-@@ -1570,6 +1570,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.15.90.0.1-dist/ld/configure binutils-2.15.90.0.1/ld/configure
---- binutils-2.15.90.0.1-dist/ld/configure     2003-05-05 16:46:49.000000000 -0500
-+++ binutils-2.15.90.0.1/ld/configure  2004-08-06 17:39:55.000000000 -0500
-@@ -1578,6 +1578,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.15.90.0.1-dist/ld/configure.tgt binutils-2.15.90.0.1/ld/configure.tgt
---- binutils-2.15.90.0.1-dist/ld/configure.tgt 2004-01-14 15:07:52.000000000 -0600
-+++ binutils-2.15.90.0.1/ld/configure.tgt      2004-08-06 17:39:55.000000000 -0500
-@@ -30,6 +30,7 @@
-                       targ_extra_emuls="criself crislinux"
-                       targ_extra_libpath=$targ_extra_emuls ;;
- cris-*-linux-gnu*)    targ_emul=crislinux ;;
-+cris-*-linux-uclibc*) targ_emul=crislinux ;;
- cris-*-*)             targ_emul=criself
-                       targ_extra_emuls="crisaout crislinux"
-                       targ_extra_libpath=$targ_extra_emuls ;;
-@@ -59,14 +60,16 @@
-                       tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
-                       tdir_sun4=sparc-sun-sunos4
-                       ;;
--sparc64-*-linux-gnu*) targ_emul=elf64_sparc
-+sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)        \
-+                      targ_emul=elf64_sparc
-                       targ_extra_emuls="elf32_sparc sparclinux sun4"
-                       targ_extra_libpath=elf32_sparc
-                       tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
-                       tdir_sparclinux=${tdir_elf32_sparc}aout
-                       tdir_sun4=sparc-sun-sunos4
-                       ;;
--sparc*-*-linux-gnu*)  targ_emul=elf32_sparc
-+sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
-+                      targ_emul=elf32_sparc
-                       targ_extra_emuls="sparclinux elf64_sparc sun4"
-                       targ_extra_libpath=elf64_sparc
-                       tdir_sparclinux=${targ_alias}aout
-@@ -118,7 +121,9 @@
- m32r*le-*-elf*)         targ_emul=m32rlelf ;;
- m32r*-*-elf*)           targ_emul=m32relf ;;
- m32r*le-*-linux-gnu*)   targ_emul=m32rlelf_linux ;;
-+m32r*le-*-linux-uclibc*) targ_emul=m32rlelf_linux ;;
- m32r*-*-linux-gnu*)     targ_emul=m32relf_linux ;;
-+m32r*-*-linux-uclibc*)  targ_emul=m32relf_linux ;;
- m68hc11-*-*|m6811-*-*)        targ_emul=m68hc11elf 
-                       targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
- m68hc12-*-*|m6812-*-*)        targ_emul=m68hc12elf 
-@@ -128,7 +133,7 @@
- m68*-ericsson-ose)    targ_emul=sun3 ;;
- m68*-apple-aux*)      targ_emul=m68kaux ;;
- *-tandem-none)                targ_emul=st2000 ;;
--i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
-+i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
- i[3-7]86-*-nto-qnx*)  targ_emul=i386nto ;;
- i[3-7]86-*-vsta)      targ_emul=vsta ;;
- i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
-@@ -152,14 +157,16 @@
-                       tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
-                       ;;
- i[3-7]86-*-linux*oldld)       targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
--i[3-7]86-*-linux-gnu*)        targ_emul=elf_i386
-+i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
-+                      targ_emul=elf_i386
-                       targ_extra_emuls=i386linux
-                       if test x${want64} = xtrue; then
-                         targ_extra_emuls="$targ_extra_emuls elf_x86_64"
-                       fi
-                       tdir_i386linux=${targ_alias}aout
-                       ;;
--x86_64-*-linux-gnu*)  targ_emul=elf_x86_64
-+x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
-+                      targ_emul=elf_x86_64
-                       targ_extra_emuls="elf_i386 i386linux"
-                       targ_extra_libpath=elf_i386
-                       tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
-@@ -259,10 +266,13 @@
- arm9e-*-elf)          targ_emul=armelf ;;
- arm-*-oabi)           targ_emul=armelf_oabi ;;
- arm*b-*-linux-gnu*)   targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
-+arm*b-*-linux-uclibc*)        targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
- arm*-*-linux-gnu*)    targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
-+arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- arm*-*-uclinux*)      targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- arm*-*-conix*)                targ_emul=armelf ;;
--thumb-*-linux-gnu* | thumb-*-uclinux*)        targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
-+thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
-+                      targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- strongarm-*-coff)     targ_emul=armcoff ;;
- strongarm-*-elf)      targ_emul=armelf ;;
- strongarm-*-kaos*)    targ_emul=armelf ;;
-@@ -363,7 +373,8 @@
-                       targ_extra_emuls=m68kelf
-                       tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
-                       ;;
--m68k-*-linux-gnu*)    targ_emul=m68kelf
-+m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
-+                      targ_emul=m68kelf
-                       targ_extra_emuls=m68klinux
-                       tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
-                       ;;
-@@ -380,9 +391,9 @@
- m68*-*-psos*)         targ_emul=m68kpsos ;;
- m68*-*-rtemscoff*)    targ_emul=m68kcoff ;;
- m68*-*-rtems*)                targ_emul=m68kelf ;;
--hppa*64*-*-linux-gnu*)        targ_emul=hppa64linux ;;
-+hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)  targ_emul=hppa64linux ;;
- hppa*64*-*)           targ_emul=elf64hppa ;;
--hppa*-*-linux-gnu*)   targ_emul=hppalinux ;;
-+hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*)   targ_emul=hppalinux ;;
- hppa*-*-*elf*)                targ_emul=hppaelf ;;
- hppa*-*-lites*)               targ_emul=hppaelf ;;
- hppa*-*-netbsd*)      targ_emul=hppanbsd ;;
-@@ -395,6 +406,7 @@
-                       targ_emul=vaxnbsd
-                       targ_extra_emuls=elf32vax ;;
- vax-*-linux-gnu*)     targ_emul=elf32vax ;;
-+vax-*-linux-uclibc*)  targ_emul=elf32vax ;;
- mips*-*-pe)           targ_emul=mipspe ;
-                       targ_extra_ofiles="deffilep.o pe-dll.o" ;;
- mips*-dec-ultrix*)    targ_emul=mipslit ;;
-@@ -429,16 +441,16 @@
- mips*-*-vxworks*)     targ_emul=elf32ebmip
-                       targ_extra_emuls="elf32elmip" ;;
- mips*-*-windiss)      targ_emul=elf32mipswindiss ;;
--mips64*el-*-linux-gnu*)       targ_emul=elf32ltsmipn32
-+mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*)   targ_emul=elf32ltsmipn32
-                       targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
-                       ;;
--mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
-+mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*)       targ_emul=elf32btsmipn32
-                       targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
-                       ;;
--mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
-+mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*)       targ_emul=elf32ltsmip
-                       targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
-                       ;;
--mips*-*-linux-gnu*)   targ_emul=elf32btsmip
-+mips*-*-linux-gnu* | mips*-*-linux-uclibc*)   targ_emul=elf32btsmip
-                       targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
-                       ;;
- mips*-*-lnews*)               targ_emul=mipslnews ;;
-@@ -461,6 +473,10 @@
- alpha*-*-linux-gnu*)  targ_emul=elf64alpha targ_extra_emuls=alpha
-                       tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
-                       ;;
-+alpha*-*-linux-uclibc*)       targ_emul=elf64alpha targ_extra_emuls=alpha
-+                      # The following needs to be checked...
-+                      tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
-+                      ;;
- alpha*-*-osf*)                targ_emul=alpha ;;
- alpha*-*-gnu*)                targ_emul=elf64alpha ;;
- alpha*-*-netware*)    targ_emul=alpha ;;
-diff -urN binutils-2.15.90.0.1-dist/libtool.m4 binutils-2.15.90.0.1/libtool.m4
---- binutils-2.15.90.0.1-dist/libtool.m4       2003-05-05 16:46:46.000000000 -0500
-+++ binutils-2.15.90.0.1/libtool.m4    2004-08-06 17:39:55.000000000 -0500
-@@ -645,6 +645,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
-diff -urN binutils-2.15.90.0.1-dist/ltconfig binutils-2.15.90.0.1/ltconfig
---- binutils-2.15.90.0.1-dist/ltconfig 2004-01-14 15:07:42.000000000 -0600
-+++ binutils-2.15.90.0.1/ltconfig      2004-08-06 17:39:55.000000000 -0500
-@@ -603,6 +603,7 @@
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case $host_os in
- linux-gnu*) ;;
-+linux-uclibc*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
-@@ -1259,6 +1260,24 @@
-   dynamic_linker='GNU/Linux ld.so'
-   ;;
-+linux-uclibc*)
-+  version_type=linux
-+  need_lib_prefix=no
-+  need_version=no
-+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-+  soname_spec='${libname}${release}.so$major'
-+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-+  shlibpath_var=LD_LIBRARY_PATH
-+  shlibpath_overrides_runpath=no
-+  # This implies no fast_install, which is unacceptable.
-+  # Some rework will be needed to allow for fast_install
-+  # before this can be enabled.
-+  # Note: copied from linux-gnu, and may not be appropriate.
-+  hardcode_into_libs=yes
-+  # Assume using the uClibc dynamic linker.
-+  dynamic_linker="uClibc ld.so"
-+  ;;
-+
- netbsd*)
-   need_lib_prefix=no
-   need_version=no
-diff -urN binutils-2.15.90.0.1-dist/opcodes/configure binutils-2.15.90.0.1/opcodes/configure
---- binutils-2.15.90.0.1-dist/opcodes/configure        2004-01-14 15:07:54.000000000 -0600
-+++ binutils-2.15.90.0.1/opcodes/configure     2004-08-06 17:39:55.000000000 -0500
-@@ -1689,6 +1689,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
diff --git a/openwrt/toolchain/binutils/2.15.90.0.1/600-arm-textrel.patch b/openwrt/toolchain/binutils/2.15.90.0.1/600-arm-textrel.patch
deleted file mode 100644 (file)
index 73d5b9d..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-http://sources.redhat.com/ml/binutils/2004-06/msg00010.html
---- binutils-2.15.90.0.3-old/bfd/elf32-arm.h   2004-04-12 14:56:33.000000000 -0500
-+++ binutils-2.15.90.0.3/bfd/elf32-arm.h       2004-09-03 06:56:40.000000000 -0500
-@@ -87,6 +87,8 @@
- #endif
- static bfd_boolean allocate_dynrelocs 
-   PARAMS ((struct elf_link_hash_entry *h, PTR inf));
-+static bfd_boolean elf32_arm_readonly_dynrelocs
-+  PARAMS ((struct elf_link_hash_entry *, PTR));
- static bfd_boolean create_got_section 
-   PARAMS ((bfd * dynobj, struct bfd_link_info * info));
- static bfd_boolean elf32_arm_create_dynamic_sections 
-@@ -3531,6 +3533,37 @@
-   return TRUE;
- }
-+/* Find any dynamic relocs that apply to read-only sections.  */
-+
-+static bfd_boolean
-+elf32_arm_readonly_dynrelocs (h, inf)
-+     struct elf_link_hash_entry *h;
-+     PTR inf;
-+{
-+  struct elf32_arm_link_hash_entry *eh;
-+  struct elf32_arm_relocs_copied *p;
-+
-+  if (h->root.type == bfd_link_hash_warning)
-+    h = (struct elf_link_hash_entry *) h->root.u.i.link;
-+
-+  eh = (struct elf32_arm_link_hash_entry *) h;
-+  for (p = eh->relocs_copied; p != NULL; p = p->next)
-+    {
-+      asection *s = p->section;
-+
-+      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-+       {
-+         struct bfd_link_info *info = (struct bfd_link_info *) inf;
-+
-+         info->flags |= DF_TEXTREL;
-+
-+         /* Not an error, just cut short the traversal.  */
-+         return FALSE;
-+       }
-+    }
-+  return TRUE;
-+}
-+
- /* Set the sizes of the dynamic sections.  */
- static bfd_boolean
-@@ -3740,6 +3773,12 @@
-           return FALSE;
-       }
-+      /* If any dynamic relocs apply to a read-only section,
-+         then we need a DT_TEXTREL entry.  */
-+      if ((info->flags & DF_TEXTREL) == 0)
-+        elf_link_hash_traverse (&htab->root, elf32_arm_readonly_dynrelocs,
-+                                (PTR) info);
-+
-       if ((info->flags & DF_TEXTREL) != 0)
-       {
-         if (!add_dynamic_entry (DT_TEXTREL, 0))
diff --git a/openwrt/toolchain/binutils/2.15.90.0.2/100-uclibc-conf.patch b/openwrt/toolchain/binutils/2.15.90.0.2/100-uclibc-conf.patch
deleted file mode 100644 (file)
index 28c5017..0000000
+++ /dev/null
@@ -1,692 +0,0 @@
-diff -urN binutils-2.15.90.0.3-dist/bfd/config.bfd binutils-2.15.90.0.3/bfd/config.bfd
---- binutils-2.15.90.0.3-dist/bfd/config.bfd   2004-04-12 14:56:33.000000000 -0500
-+++ binutils-2.15.90.0.3/bfd/config.bfd        2004-08-06 17:02:17.000000000 -0500
-@@ -126,7 +126,7 @@
-     targ_defvec=ecoffalpha_little_vec
-     targ_selvecs=bfd_elf64_alpha_vec
-     ;;
--  alpha*-*-linux-gnu* | alpha*-*-elf*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
-     targ_defvec=bfd_elf64_alpha_vec
-     targ_selvecs=ecoffalpha_little_vec
-     ;;
-@@ -136,7 +136,7 @@
-   alpha*-*-*)
-     targ_defvec=ecoffalpha_little_vec
-     ;;
--  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
-+  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-linux-uclibc* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
-     targ_defvec=bfd_elf64_ia64_little_vec
-     targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
-     ;;
-@@ -213,7 +213,7 @@
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
--  armeb-*-elf | arm*b-*-linux-gnu*)
-+  armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_bigarm_vec
-     targ_selvecs=bfd_elf32_littlearm_vec
-     ;;
-@@ -221,7 +221,7 @@
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
--  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
-+  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | arm*-*-conix* | \
-   arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-@@ -360,7 +360,7 @@
-     ;;
- #ifdef BFD64
--  hppa*64*-*-linux-gnu*)
-+  hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_hppa_linux_vec
-     targ_selvecs=bfd_elf64_hppa_vec
-     ;;
-@@ -371,7 +371,7 @@
-     ;;
- #endif
--  hppa*-*-linux-gnu* | hppa*-*-netbsd*)
-+  hppa*-*-linux-gnu* | hppa*-*-linux-uclibc* | hppa*-*-netbsd*)
-     targ_defvec=bfd_elf32_hppa_linux_vec
-     targ_selvecs=bfd_elf32_hppa_vec
-     ;;
-@@ -494,7 +494,7 @@
-     targ_selvecs=bfd_elf32_i386_vec
-     targ_underscore=yes
-     ;;
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_i386_vec
-     targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
-     targ64_selvecs=bfd_elf64_x86_64_vec
-@@ -508,7 +508,7 @@
-     targ_defvec=bfd_elf64_x86_64_vec
-     targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
-     ;;
--  x86_64-*-linux-gnu*)
-+  x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_x86_64_vec
-     targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
-     ;;
-@@ -683,7 +683,7 @@
-     targ_selvecs=bfd_elf32_m68k_vec
-     targ_underscore=yes
-     ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_m68k_vec
-     targ_selvecs=m68klinux_vec
-     ;;
-@@ -955,7 +955,8 @@
-     ;;
- #endif
-   powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
--  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
-+  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
-+  powerpc-*-rtems* | \
-   powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
-     targ_defvec=bfd_elf32_powerpc_vec
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
-@@ -987,8 +988,8 @@
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
-     ;;
-   powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
--  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
--  powerpcle-*-rtems*)
-+  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
-+  powerpcle-*-vxworks* | powerpcle-*-rtems*)
-     targ_defvec=bfd_elf32_powerpcle_vec
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
-     targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
-@@ -1149,7 +1150,7 @@
-     targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
-     targ_underscore=yes
-     ;;
--  sparc-*-linux-gnu*)
-+  sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_sparc_vec
-     targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
-     ;;
-@@ -1196,7 +1197,7 @@
-     targ_defvec=sunos_big_vec
-     targ_underscore=yes
-     ;;
--  sparc64-*-linux-gnu*)
-+  sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_sparc_vec
-     targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
-     ;;
-@@ -1265,7 +1266,7 @@
-     targ_underscore=yes
-     ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_vax_vec
-     ;;
-diff -urN binutils-2.15.90.0.3-dist/bfd/configure binutils-2.15.90.0.3/bfd/configure
---- binutils-2.15.90.0.3-dist/bfd/configure    2004-04-14 23:26:05.000000000 -0500
-+++ binutils-2.15.90.0.3/bfd/configure 2004-08-06 17:02:17.000000000 -0500
-@@ -1699,6 +1699,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -5278,7 +5283,7 @@
-   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
-       COREFILE=''
-       ;;
--  alpha*-*-linux-gnu*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/alphalinux.h"'
-       ;;
-@@ -5338,7 +5343,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386mach3.h"'
-       ;;
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386linux.h"'
-       ;;
-@@ -5376,7 +5381,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/hp300bsd.h"'
-       ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/m68klinux.h"'
-       ;;
-@@ -5477,7 +5482,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxult2.h"'
-       ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxlinux.h"'
-       ;;
-diff -urN binutils-2.15.90.0.3-dist/bfd/configure.in binutils-2.15.90.0.3/bfd/configure.in
---- binutils-2.15.90.0.3-dist/bfd/configure.in 2004-04-14 23:26:05.000000000 -0500
-+++ binutils-2.15.90.0.3/bfd/configure.in      2004-08-06 17:02:17.000000000 -0500
-@@ -178,7 +178,7 @@
-   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
-       COREFILE=''
-       ;;
--  alpha*-*-linux-gnu*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/alphalinux.h"'
-       ;;
-@@ -259,7 +259,7 @@
-       TRAD_HEADER='"hosts/i386mach3.h"'
-       ;;
- changequote(,)dnl
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
- changequote([,])dnl
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386linux.h"'
-@@ -300,7 +300,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/hp300bsd.h"'
-       ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/m68klinux.h"'
-       ;;
-@@ -385,7 +385,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxult2.h"'
-       ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxlinux.h"'
-       ;;
-diff -urN binutils-2.15.90.0.3-dist/binutils/configure binutils-2.15.90.0.3/binutils/configure
---- binutils-2.15.90.0.3-dist/binutils/configure       2004-04-12 14:56:34.000000000 -0500
-+++ binutils-2.15.90.0.3/binutils/configure    2004-08-06 17:02:17.000000000 -0500
-@@ -1575,6 +1575,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.15.90.0.3-dist/configure binutils-2.15.90.0.3/configure
---- binutils-2.15.90.0.3-dist/configure        2004-04-12 14:56:33.000000000 -0500
-+++ binutils-2.15.90.0.3/configure     2004-08-06 17:02:17.000000000 -0500
-@@ -1298,6 +1298,18 @@
-   i[3456789]86-*-freebsd* | i[3456789]86-*-kfreebsd*-gnu)
-     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-     ;;
-+  i[3456789]86-*-linux-uclibc*)
-+    # This section makes it possible to build newlib natively on linux.
-+    # If we are using a cross compiler then don't configure newlib.
-+    if test x${is_cross_compiler} != xno ; then
-+      noconfigdirs="$noconfigdirs target-newlib"
-+    fi
-+    noconfigdirs="$noconfigdirs target-libgloss"
-+    # If we are not using a cross compiler, do configure newlib.
-+    # Note however, that newlib will only be configured in this situation
-+    # if the --with-newlib option has been given, because otherwise
-+    # 'target-newlib' will appear in skipdirs.
-+    ;;
-   i[3456789]86-*-linux*)
-     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
-     # not build java stuff by default.
-diff -urN binutils-2.15.90.0.3-dist/configure.in binutils-2.15.90.0.3/configure.in
---- binutils-2.15.90.0.3-dist/configure.in     2004-04-12 14:56:33.000000000 -0500
-+++ binutils-2.15.90.0.3/configure.in  2004-08-06 17:02:17.000000000 -0500
-@@ -521,6 +521,18 @@
-   i[[3456789]]86-*-freebsd* | i[[3456789]]86-*-kfreebsd*-gnu)
-     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-     ;;
-+  i[[3456789]]86-*-linux-uclibc*)
-+    # This section makes it possible to build newlib natively on linux.
-+    # If we are using a cross compiler then don't configure newlib.
-+    if test x${is_cross_compiler} != xno ; then
-+      noconfigdirs="$noconfigdirs target-newlib"
-+    fi
-+    noconfigdirs="$noconfigdirs target-libgloss"
-+    # If we are not using a cross compiler, do configure newlib.
-+    # Note however, that newlib will only be configured in this situation
-+    # if the --with-newlib option has been given, because otherwise
-+    # 'target-newlib' will appear in skipdirs.
-+    ;;
-   i[[3456789]]86-*-linux*)
-     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
-     # not build java stuff by default.
-diff -urN binutils-2.15.90.0.3-dist/gas/configure binutils-2.15.90.0.3/gas/configure
---- binutils-2.15.90.0.3-dist/gas/configure    2004-04-12 14:56:34.000000000 -0500
-+++ binutils-2.15.90.0.3/gas/configure 2004-08-06 17:04:29.000000000 -0500
-@@ -3401,6 +3401,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -4226,6 +4231,7 @@
-       alpha*-*-osf*)                  fmt=ecoff ;;
-       alpha*-*-linuxecoff*)           fmt=ecoff ;;
-       alpha*-*-linux-gnu*)            fmt=elf em=linux ;;
-+      alpha*-*-linux-uclibc*)         fmt=elf em=linux ;;
-       alpha*-*-netbsd*)                       fmt=elf em=nbsd ;;
-       alpha*-*-openbsd*)              fmt=elf em=obsd ;;
-@@ -4242,6 +4248,7 @@
-       arm*-*-conix*)                  fmt=elf ;;
-       arm-*-linux*aout*)              fmt=aout em=linux ;;
-       arm*-*-linux-gnu*)              fmt=elf  em=linux ;;
-+      arm*-*-linux-uclibc*)           fmt=elf  em=linux ;;
-       arm*-*-uclinux*)                        fmt=elf  em=linux ;;
-       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
-       arm-*-*n*bsd*)                  fmt=aout em=nbsd ;;
-@@ -4255,6 +4262,7 @@
-       avr-*-*)                                fmt=elf ;;
-       cris-*-linux-gnu*)              fmt=multi bfd_gas=yes em=linux ;;
-+      cris-*-linux-uclibc*)           fmt=multi bfd_gas=yes em=linux ;;
-       cris-*-*)                               fmt=multi bfd_gas=yes ;;
-       d10v-*-*)                               fmt=elf ;;
-@@ -4311,7 +4319,9 @@
-       i386-*-linux*oldld)             fmt=aout em=linux ;;
-       i386-*-linux*coff*)             fmt=coff em=linux ;;
-       i386-*-linux-gnu*)              fmt=elf em=linux ;;
-+      i386-*-linux-uclibc*)           fmt=elf em=linux ;;
-       x86_64-*-linux-gnu*)            fmt=elf em=linux ;;
-+      x86_64-*-linux-uclibc*)         fmt=elf em=linux ;;
-       i386-*-lynxos*)                 fmt=coff em=lynx ;;
-       i386-*-sysv[45]*)                       fmt=elf ;;
-       i386-*-solaris*)                        fmt=elf ;;
-@@ -4371,6 +4381,7 @@
-       ia64-*-elf*)                    fmt=elf ;;
-       ia64-*-aix*)                    fmt=elf em=ia64aix ;;
-       ia64-*-linux-gnu*)              fmt=elf em=linux ;;
-+      ia64-*-linux-uclibc*)           fmt=elf em=linux ;;
-       ia64-*-hpux*)                   fmt=elf em=hpux ;;
-       ia64-*-netbsd*)                 fmt=elf em=nbsd ;;
-@@ -4398,6 +4409,7 @@
-       m68k-*-hpux*)                   fmt=hp300 em=hp300 ;;
-       m68k-*-linux*aout*)             fmt=aout em=linux ;;
-       m68k-*-linux-gnu*)              fmt=elf em=linux ;;
-+      m68k-*-linux-uclibc*)           fmt=elf em=linux ;;
-       m68k-*-uclinux*)                        fmt=elf ;;
-       m68k-*-gnu*)                    fmt=elf ;;
-       m68k-*-lynxos*)                 fmt=coff em=lynx ;;
-@@ -4460,6 +4472,7 @@
-       ppc-*-beos*)                    fmt=coff ;;
-       ppc-*-*n*bsd* | ppc-*-elf*)     fmt=elf ;;
-       ppc-*-eabi* | ppc-*-sysv4*)     fmt=elf ;;
-+      ppc-*-linux-uclibc* | \
-       ppc-*-linux-gnu*)                       fmt=elf em=linux
-           case "$endian" in
-               big)  ;;
-@@ -4487,7 +4500,9 @@
-       ppc-*-kaos*)                    fmt=elf ;;
-       s390x-*-linux-gnu*)             fmt=elf em=linux ;;
-+      s390x-*-linux-uclibc*)          fmt=elf em=linux ;;
-       s390-*-linux-gnu*)              fmt=elf em=linux ;;
-+      s390-*-linux-uclibc*)           fmt=elf em=linux ;;
-       sh*-*-linux*)                   fmt=elf em=linux
-           case ${cpu} in
-@@ -4520,6 +4535,7 @@
-       sparc-*-coff)                   fmt=coff ;;
-       sparc-*-linux*aout*)            fmt=aout em=linux ;;
-       sparc-*-linux-gnu*)             fmt=elf em=linux ;;
-+      sparc-*-linux-uclibc*)          fmt=elf em=linux ;;
-       sparc-*-lynxos*)                        fmt=coff em=lynx ;;
-       sparc-fujitsu-none)             fmt=aout ;;
-       sparc-*-elf)                    fmt=elf ;;
-diff -urN binutils-2.15.90.0.3-dist/gas/configure.in binutils-2.15.90.0.3/gas/configure.in
---- binutils-2.15.90.0.3-dist/gas/configure.in 2004-04-12 14:56:34.000000000 -0500
-+++ binutils-2.15.90.0.3/gas/configure.in      2004-08-06 17:04:27.000000000 -0500
-@@ -194,6 +194,7 @@
-       alpha*-*-osf*)                  fmt=ecoff ;;
-       alpha*-*-linuxecoff*)           fmt=ecoff ;;
-       alpha*-*-linux-gnu*)            fmt=elf em=linux ;;
-+      alpha*-*-linux-uclibc*)         fmt=elf em=linux ;;
-       alpha*-*-netbsd*)                       fmt=elf em=nbsd ;;
-       alpha*-*-openbsd*)              fmt=elf em=obsd ;;
-@@ -210,6 +211,7 @@
-       arm*-*-conix*)                  fmt=elf ;;
-       arm-*-linux*aout*)              fmt=aout em=linux ;;
-       arm*-*-linux-gnu*)              fmt=elf  em=linux ;;
-+      arm*-*-linux-uclibc*)           fmt=elf  em=linux ;;
-       arm*-*-uclinux*)                        fmt=elf  em=linux ;;
-       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
-       arm-*-*n*bsd*)                  fmt=aout em=nbsd ;;
-@@ -223,6 +225,7 @@
-       avr-*-*)                                fmt=elf ;;
-       cris-*-linux-gnu*)              fmt=multi bfd_gas=yes em=linux ;;
-+      cris-*-linux-uclibc*)           fmt=multi bfd_gas=yes em=linux ;;
-       cris-*-*)                               fmt=multi bfd_gas=yes ;;
-       d10v-*-*)                               fmt=elf ;;
-@@ -279,7 +282,9 @@
-       i386-*-linux*oldld)             fmt=aout em=linux ;;
-       i386-*-linux*coff*)             fmt=coff em=linux ;;
-       i386-*-linux-gnu*)              fmt=elf em=linux ;;
-+      i386-*-linux-uclibc*)           fmt=elf em=linux ;;
-       x86_64-*-linux-gnu*)            fmt=elf em=linux ;;
-+      x86_64-*-linux-uclibc*)         fmt=elf em=linux ;;
-       i386-*-lynxos*)                 fmt=coff em=lynx ;;
- changequote(,)dnl
-       i386-*-sysv[45]*)                       fmt=elf ;;
-@@ -332,6 +337,7 @@
-       ia64-*-elf*)                    fmt=elf ;;
-       ia64-*-aix*)                    fmt=elf em=ia64aix ;;
-       ia64-*-linux-gnu*)              fmt=elf em=linux ;;
-+      ia64-*-linux-uclibc*)           fmt=elf em=linux ;;
-       ia64-*-hpux*)                   fmt=elf em=hpux ;;
-       ia64-*-netbsd*)                 fmt=elf em=nbsd ;;
-@@ -359,6 +365,7 @@
-       m68k-*-hpux*)                   fmt=hp300 em=hp300 ;;
-       m68k-*-linux*aout*)             fmt=aout em=linux ;;
-       m68k-*-linux-gnu*)              fmt=elf em=linux ;;
-+      m68k-*-linux-uclibc*)           fmt=elf em=linux ;;
-       m68k-*-uclinux*)                        fmt=elf ;;
-       m68k-*-gnu*)                    fmt=elf ;;
-       m68k-*-lynxos*)                 fmt=coff em=lynx ;;
-@@ -418,6 +425,7 @@
-       ppc-*-beos*)                    fmt=coff ;;
-       ppc-*-*n*bsd* | ppc-*-elf*)     fmt=elf ;;
-       ppc-*-eabi* | ppc-*-sysv4*)     fmt=elf ;;
-+      ppc-*-linux-uclibc* | \
-       ppc-*-linux-gnu*)                       fmt=elf em=linux
-           case "$endian" in
-               big)  ;;
-@@ -438,7 +446,9 @@
-       ppc-*-kaos*)                    fmt=elf ;;
-       s390x-*-linux-gnu*)             fmt=elf em=linux ;;
-+      s390x-*-linux-uclibc*)          fmt=elf em=linux ;;
-       s390-*-linux-gnu*)              fmt=elf em=linux ;;
-+      s390-*-linux-uclibc*)           fmt=elf em=linux ;;
-       sh*-*-linux*)                   fmt=elf em=linux
-           case ${cpu} in
-@@ -471,6 +481,7 @@
-       sparc-*-coff)                   fmt=coff ;;
-       sparc-*-linux*aout*)            fmt=aout em=linux ;;
-       sparc-*-linux-gnu*)             fmt=elf em=linux ;;
-+      sparc-*-linux-uclibc*)          fmt=elf em=linux ;;
-       sparc-*-lynxos*)                        fmt=coff em=lynx ;;
-       sparc-fujitsu-none)             fmt=aout ;;
-       sparc-*-elf)                    fmt=elf ;;
-diff -urN binutils-2.15.90.0.3-dist/gprof/configure binutils-2.15.90.0.3/gprof/configure
---- binutils-2.15.90.0.3-dist/gprof/configure  2004-01-14 15:07:51.000000000 -0600
-+++ binutils-2.15.90.0.3/gprof/configure       2004-08-06 17:02:17.000000000 -0500
-@@ -1570,6 +1570,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.15.90.0.3-dist/ld/configure binutils-2.15.90.0.3/ld/configure
---- binutils-2.15.90.0.3-dist/ld/configure     2003-05-05 16:46:49.000000000 -0500
-+++ binutils-2.15.90.0.3/ld/configure  2004-08-06 17:02:17.000000000 -0500
-@@ -1578,6 +1578,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.15.90.0.3-dist/ld/configure.tgt binutils-2.15.90.0.3/ld/configure.tgt
---- binutils-2.15.90.0.3-dist/ld/configure.tgt 2004-04-12 14:56:35.000000000 -0500
-+++ binutils-2.15.90.0.3/ld/configure.tgt      2004-08-06 17:02:17.000000000 -0500
-@@ -31,6 +31,7 @@
-                       targ_extra_emuls="criself crislinux"
-                       targ_extra_libpath=$targ_extra_emuls ;;
- cris-*-linux-gnu*)    targ_emul=crislinux ;;
-+cris-*-linux-uclibc*) targ_emul=crislinux ;;
- cris-*-*)             targ_emul=criself
-                       targ_extra_emuls="crisaout crislinux"
-                       targ_extra_libpath=$targ_extra_emuls ;;
-@@ -60,14 +61,16 @@
-                       tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
-                       tdir_sun4=sparc-sun-sunos4
-                       ;;
--sparc64-*-linux-gnu*) targ_emul=elf64_sparc
-+sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)        \
-+                      targ_emul=elf64_sparc
-                       targ_extra_emuls="elf32_sparc sparclinux sun4"
-                       targ_extra_libpath=elf32_sparc
-                       tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
-                       tdir_sparclinux=${tdir_elf32_sparc}aout
-                       tdir_sun4=sparc-sun-sunos4
-                       ;;
--sparc*-*-linux-gnu*)  targ_emul=elf32_sparc
-+sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
-+                      targ_emul=elf32_sparc
-                       targ_extra_emuls="sparclinux elf64_sparc sun4"
-                       targ_extra_libpath=elf64_sparc
-                       tdir_sparclinux=${targ_alias}aout
-@@ -119,7 +122,9 @@
- m32r*le-*-elf*)         targ_emul=m32rlelf ;;
- m32r*-*-elf*)           targ_emul=m32relf ;;
- m32r*le-*-linux-gnu*)   targ_emul=m32rlelf_linux ;;
-+m32r*le-*-linux-uclibc*) targ_emul=m32rlelf_linux ;;
- m32r*-*-linux-gnu*)     targ_emul=m32relf_linux ;;
-+m32r*-*-linux-uclibc*)  targ_emul=m32relf_linux ;;
- m68hc11-*-*|m6811-*-*)        targ_emul=m68hc11elf 
-                       targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
- m68hc12-*-*|m6812-*-*)        targ_emul=m68hc12elf 
-@@ -129,7 +134,7 @@
- m68*-ericsson-ose)    targ_emul=sun3 ;;
- m68*-apple-aux*)      targ_emul=m68kaux ;;
- *-tandem-none)                targ_emul=st2000 ;;
--i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
-+i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
- i[3-7]86-*-nto-qnx*)  targ_emul=i386nto ;;
- i[3-7]86-*-vsta)      targ_emul=vsta ;;
- i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
-@@ -153,14 +158,16 @@
-                       tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
-                       ;;
- i[3-7]86-*-linux*oldld)       targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
--i[3-7]86-*-linux-gnu*)        targ_emul=elf_i386
-+i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
-+                      targ_emul=elf_i386
-                       targ_extra_emuls=i386linux
-                       if test x${want64} = xtrue; then
-                         targ_extra_emuls="$targ_extra_emuls elf_x86_64"
-                       fi
-                       tdir_i386linux=${targ_alias}aout
-                       ;;
--x86_64-*-linux-gnu*)  targ_emul=elf_x86_64
-+x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
-+                      targ_emul=elf_x86_64
-                       targ_extra_emuls="elf_i386 i386linux"
-                       targ_extra_libpath=elf_i386
-                       tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
-@@ -260,10 +267,13 @@
- arm9e-*-elf)          targ_emul=armelf ;;
- arm-*-oabi)           targ_emul=armelf_oabi ;;
- arm*b-*-linux-gnu*)   targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
-+arm*b-*-linux-uclibc*)        targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
- arm*-*-linux-gnu*)    targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
-+arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- arm*-*-uclinux*)      targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- arm*-*-conix*)                targ_emul=armelf ;;
--thumb-*-linux-gnu* | thumb-*-uclinux*)        targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
-+thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
-+                      targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- strongarm-*-coff)     targ_emul=armcoff ;;
- strongarm-*-elf)      targ_emul=armelf ;;
- strongarm-*-kaos*)    targ_emul=armelf ;;
-@@ -365,7 +375,8 @@
-                       targ_extra_emuls=m68kelf
-                       tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
-                       ;;
--m68k-*-linux-gnu*)    targ_emul=m68kelf
-+m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
-+                      targ_emul=m68kelf
-                       targ_extra_emuls=m68klinux
-                       tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
-                       ;;
-@@ -382,9 +393,9 @@
- m68*-*-psos*)         targ_emul=m68kpsos ;;
- m68*-*-rtemscoff*)    targ_emul=m68kcoff ;;
- m68*-*-rtems*)                targ_emul=m68kelf ;;
--hppa*64*-*-linux-gnu*)        targ_emul=hppa64linux ;;
-+hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)  targ_emul=hppa64linux ;;
- hppa*64*-*)           targ_emul=elf64hppa ;;
--hppa*-*-linux-gnu*)   targ_emul=hppalinux ;;
-+hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*)   targ_emul=hppalinux ;;
- hppa*-*-*elf*)                targ_emul=hppaelf ;;
- hppa*-*-lites*)               targ_emul=hppaelf ;;
- hppa*-*-netbsd*)      targ_emul=hppanbsd ;;
-@@ -397,6 +408,7 @@
-                       targ_emul=vaxnbsd
-                       targ_extra_emuls=elf32vax ;;
- vax-*-linux-gnu*)     targ_emul=elf32vax ;;
-+vax-*-linux-uclibc*)  targ_emul=elf32vax ;;
- mips*-*-pe)           targ_emul=mipspe ;
-                       targ_extra_ofiles="deffilep.o pe-dll.o" ;;
- mips*-dec-ultrix*)    targ_emul=mipslit ;;
-@@ -430,16 +442,16 @@
- mips*-*-vxworks*)     targ_emul=elf32ebmip
-                       targ_extra_emuls="elf32elmip" ;;
- mips*-*-windiss)      targ_emul=elf32mipswindiss ;;
--mips64*el-*-linux-gnu*)       targ_emul=elf32ltsmipn32
-+mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*)   targ_emul=elf32ltsmipn32
-                       targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
-                       ;;
--mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
-+mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*)       targ_emul=elf32btsmipn32
-                       targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
-                       ;;
--mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
-+mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*)       targ_emul=elf32ltsmip
-                       targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
-                       ;;
--mips*-*-linux-gnu*)   targ_emul=elf32btsmip
-+mips*-*-linux-gnu* | mips*-*-linux-uclibc*)   targ_emul=elf32btsmip
-                       targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
-                       ;;
- mips*-*-lnews*)               targ_emul=mipslnews ;;
-@@ -462,6 +474,10 @@
- alpha*-*-linux-gnu*)  targ_emul=elf64alpha targ_extra_emuls=alpha
-                       tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
-                       ;;
-+alpha*-*-linux-uclibc*)       targ_emul=elf64alpha targ_extra_emuls=alpha
-+                      # The following needs to be checked...
-+                      tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
-+                      ;;
- alpha*-*-osf*)                targ_emul=alpha ;;
- alpha*-*-gnu*)                targ_emul=elf64alpha ;;
- alpha*-*-netware*)    targ_emul=alpha ;;
-diff -urN binutils-2.15.90.0.3-dist/libtool.m4 binutils-2.15.90.0.3/libtool.m4
---- binutils-2.15.90.0.3-dist/libtool.m4       2003-05-05 16:46:46.000000000 -0500
-+++ binutils-2.15.90.0.3/libtool.m4    2004-08-06 17:02:17.000000000 -0500
-@@ -645,6 +645,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
-diff -urN binutils-2.15.90.0.3-dist/ltconfig binutils-2.15.90.0.3/ltconfig
---- binutils-2.15.90.0.3-dist/ltconfig 2004-01-14 15:07:42.000000000 -0600
-+++ binutils-2.15.90.0.3/ltconfig      2004-08-06 17:02:17.000000000 -0500
-@@ -603,6 +603,7 @@
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case $host_os in
- linux-gnu*) ;;
-+linux-uclibc*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
-@@ -1259,6 +1260,24 @@
-   dynamic_linker='GNU/Linux ld.so'
-   ;;
-+linux-uclibc*)
-+  version_type=linux
-+  need_lib_prefix=no
-+  need_version=no
-+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-+  soname_spec='${libname}${release}.so$major'
-+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-+  shlibpath_var=LD_LIBRARY_PATH
-+  shlibpath_overrides_runpath=no
-+  # This implies no fast_install, which is unacceptable.
-+  # Some rework will be needed to allow for fast_install
-+  # before this can be enabled.
-+  # Note: copied from linux-gnu, and may not be appropriate.
-+  hardcode_into_libs=yes
-+  # Assume using the uClibc dynamic linker.
-+  dynamic_linker="uClibc ld.so"
-+  ;;
-+
- netbsd*)
-   need_lib_prefix=no
-   need_version=no
-diff -urN binutils-2.15.90.0.3-dist/opcodes/configure binutils-2.15.90.0.3/opcodes/configure
---- binutils-2.15.90.0.3-dist/opcodes/configure        2004-04-12 14:56:38.000000000 -0500
-+++ binutils-2.15.90.0.3/opcodes/configure     2004-08-06 17:02:17.000000000 -0500
-@@ -1690,6 +1690,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
diff --git a/openwrt/toolchain/binutils/2.15.90.0.2/600-arm-textrel.patch b/openwrt/toolchain/binutils/2.15.90.0.2/600-arm-textrel.patch
deleted file mode 100644 (file)
index 73d5b9d..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-http://sources.redhat.com/ml/binutils/2004-06/msg00010.html
---- binutils-2.15.90.0.3-old/bfd/elf32-arm.h   2004-04-12 14:56:33.000000000 -0500
-+++ binutils-2.15.90.0.3/bfd/elf32-arm.h       2004-09-03 06:56:40.000000000 -0500
-@@ -87,6 +87,8 @@
- #endif
- static bfd_boolean allocate_dynrelocs 
-   PARAMS ((struct elf_link_hash_entry *h, PTR inf));
-+static bfd_boolean elf32_arm_readonly_dynrelocs
-+  PARAMS ((struct elf_link_hash_entry *, PTR));
- static bfd_boolean create_got_section 
-   PARAMS ((bfd * dynobj, struct bfd_link_info * info));
- static bfd_boolean elf32_arm_create_dynamic_sections 
-@@ -3531,6 +3533,37 @@
-   return TRUE;
- }
-+/* Find any dynamic relocs that apply to read-only sections.  */
-+
-+static bfd_boolean
-+elf32_arm_readonly_dynrelocs (h, inf)
-+     struct elf_link_hash_entry *h;
-+     PTR inf;
-+{
-+  struct elf32_arm_link_hash_entry *eh;
-+  struct elf32_arm_relocs_copied *p;
-+
-+  if (h->root.type == bfd_link_hash_warning)
-+    h = (struct elf_link_hash_entry *) h->root.u.i.link;
-+
-+  eh = (struct elf32_arm_link_hash_entry *) h;
-+  for (p = eh->relocs_copied; p != NULL; p = p->next)
-+    {
-+      asection *s = p->section;
-+
-+      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-+       {
-+         struct bfd_link_info *info = (struct bfd_link_info *) inf;
-+
-+         info->flags |= DF_TEXTREL;
-+
-+         /* Not an error, just cut short the traversal.  */
-+         return FALSE;
-+       }
-+    }
-+  return TRUE;
-+}
-+
- /* Set the sizes of the dynamic sections.  */
- static bfd_boolean
-@@ -3740,6 +3773,12 @@
-           return FALSE;
-       }
-+      /* If any dynamic relocs apply to a read-only section,
-+         then we need a DT_TEXTREL entry.  */
-+      if ((info->flags & DF_TEXTREL) == 0)
-+        elf_link_hash_traverse (&htab->root, elf32_arm_readonly_dynrelocs,
-+                                (PTR) info);
-+
-       if ((info->flags & DF_TEXTREL) != 0)
-       {
-         if (!add_dynamic_entry (DT_TEXTREL, 0))
diff --git a/openwrt/toolchain/binutils/2.15.90.0.3/100-uclibc-conf.patch b/openwrt/toolchain/binutils/2.15.90.0.3/100-uclibc-conf.patch
deleted file mode 100644 (file)
index 28c5017..0000000
+++ /dev/null
@@ -1,692 +0,0 @@
-diff -urN binutils-2.15.90.0.3-dist/bfd/config.bfd binutils-2.15.90.0.3/bfd/config.bfd
---- binutils-2.15.90.0.3-dist/bfd/config.bfd   2004-04-12 14:56:33.000000000 -0500
-+++ binutils-2.15.90.0.3/bfd/config.bfd        2004-08-06 17:02:17.000000000 -0500
-@@ -126,7 +126,7 @@
-     targ_defvec=ecoffalpha_little_vec
-     targ_selvecs=bfd_elf64_alpha_vec
-     ;;
--  alpha*-*-linux-gnu* | alpha*-*-elf*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
-     targ_defvec=bfd_elf64_alpha_vec
-     targ_selvecs=ecoffalpha_little_vec
-     ;;
-@@ -136,7 +136,7 @@
-   alpha*-*-*)
-     targ_defvec=ecoffalpha_little_vec
-     ;;
--  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
-+  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-linux-uclibc* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
-     targ_defvec=bfd_elf64_ia64_little_vec
-     targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
-     ;;
-@@ -213,7 +213,7 @@
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
--  armeb-*-elf | arm*b-*-linux-gnu*)
-+  armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_bigarm_vec
-     targ_selvecs=bfd_elf32_littlearm_vec
-     ;;
-@@ -221,7 +221,7 @@
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
--  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
-+  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | arm*-*-conix* | \
-   arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-@@ -360,7 +360,7 @@
-     ;;
- #ifdef BFD64
--  hppa*64*-*-linux-gnu*)
-+  hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_hppa_linux_vec
-     targ_selvecs=bfd_elf64_hppa_vec
-     ;;
-@@ -371,7 +371,7 @@
-     ;;
- #endif
--  hppa*-*-linux-gnu* | hppa*-*-netbsd*)
-+  hppa*-*-linux-gnu* | hppa*-*-linux-uclibc* | hppa*-*-netbsd*)
-     targ_defvec=bfd_elf32_hppa_linux_vec
-     targ_selvecs=bfd_elf32_hppa_vec
-     ;;
-@@ -494,7 +494,7 @@
-     targ_selvecs=bfd_elf32_i386_vec
-     targ_underscore=yes
-     ;;
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_i386_vec
-     targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
-     targ64_selvecs=bfd_elf64_x86_64_vec
-@@ -508,7 +508,7 @@
-     targ_defvec=bfd_elf64_x86_64_vec
-     targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
-     ;;
--  x86_64-*-linux-gnu*)
-+  x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_x86_64_vec
-     targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
-     ;;
-@@ -683,7 +683,7 @@
-     targ_selvecs=bfd_elf32_m68k_vec
-     targ_underscore=yes
-     ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_m68k_vec
-     targ_selvecs=m68klinux_vec
-     ;;
-@@ -955,7 +955,8 @@
-     ;;
- #endif
-   powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
--  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
-+  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
-+  powerpc-*-rtems* | \
-   powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
-     targ_defvec=bfd_elf32_powerpc_vec
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
-@@ -987,8 +988,8 @@
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
-     ;;
-   powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
--  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
--  powerpcle-*-rtems*)
-+  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
-+  powerpcle-*-vxworks* | powerpcle-*-rtems*)
-     targ_defvec=bfd_elf32_powerpcle_vec
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
-     targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
-@@ -1149,7 +1150,7 @@
-     targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
-     targ_underscore=yes
-     ;;
--  sparc-*-linux-gnu*)
-+  sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_sparc_vec
-     targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
-     ;;
-@@ -1196,7 +1197,7 @@
-     targ_defvec=sunos_big_vec
-     targ_underscore=yes
-     ;;
--  sparc64-*-linux-gnu*)
-+  sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_sparc_vec
-     targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
-     ;;
-@@ -1265,7 +1266,7 @@
-     targ_underscore=yes
-     ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_vax_vec
-     ;;
-diff -urN binutils-2.15.90.0.3-dist/bfd/configure binutils-2.15.90.0.3/bfd/configure
---- binutils-2.15.90.0.3-dist/bfd/configure    2004-04-14 23:26:05.000000000 -0500
-+++ binutils-2.15.90.0.3/bfd/configure 2004-08-06 17:02:17.000000000 -0500
-@@ -1699,6 +1699,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -5278,7 +5283,7 @@
-   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
-       COREFILE=''
-       ;;
--  alpha*-*-linux-gnu*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/alphalinux.h"'
-       ;;
-@@ -5338,7 +5343,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386mach3.h"'
-       ;;
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386linux.h"'
-       ;;
-@@ -5376,7 +5381,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/hp300bsd.h"'
-       ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/m68klinux.h"'
-       ;;
-@@ -5477,7 +5482,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxult2.h"'
-       ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxlinux.h"'
-       ;;
-diff -urN binutils-2.15.90.0.3-dist/bfd/configure.in binutils-2.15.90.0.3/bfd/configure.in
---- binutils-2.15.90.0.3-dist/bfd/configure.in 2004-04-14 23:26:05.000000000 -0500
-+++ binutils-2.15.90.0.3/bfd/configure.in      2004-08-06 17:02:17.000000000 -0500
-@@ -178,7 +178,7 @@
-   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
-       COREFILE=''
-       ;;
--  alpha*-*-linux-gnu*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/alphalinux.h"'
-       ;;
-@@ -259,7 +259,7 @@
-       TRAD_HEADER='"hosts/i386mach3.h"'
-       ;;
- changequote(,)dnl
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
- changequote([,])dnl
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386linux.h"'
-@@ -300,7 +300,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/hp300bsd.h"'
-       ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/m68klinux.h"'
-       ;;
-@@ -385,7 +385,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxult2.h"'
-       ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxlinux.h"'
-       ;;
-diff -urN binutils-2.15.90.0.3-dist/binutils/configure binutils-2.15.90.0.3/binutils/configure
---- binutils-2.15.90.0.3-dist/binutils/configure       2004-04-12 14:56:34.000000000 -0500
-+++ binutils-2.15.90.0.3/binutils/configure    2004-08-06 17:02:17.000000000 -0500
-@@ -1575,6 +1575,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.15.90.0.3-dist/configure binutils-2.15.90.0.3/configure
---- binutils-2.15.90.0.3-dist/configure        2004-04-12 14:56:33.000000000 -0500
-+++ binutils-2.15.90.0.3/configure     2004-08-06 17:02:17.000000000 -0500
-@@ -1298,6 +1298,18 @@
-   i[3456789]86-*-freebsd* | i[3456789]86-*-kfreebsd*-gnu)
-     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-     ;;
-+  i[3456789]86-*-linux-uclibc*)
-+    # This section makes it possible to build newlib natively on linux.
-+    # If we are using a cross compiler then don't configure newlib.
-+    if test x${is_cross_compiler} != xno ; then
-+      noconfigdirs="$noconfigdirs target-newlib"
-+    fi
-+    noconfigdirs="$noconfigdirs target-libgloss"
-+    # If we are not using a cross compiler, do configure newlib.
-+    # Note however, that newlib will only be configured in this situation
-+    # if the --with-newlib option has been given, because otherwise
-+    # 'target-newlib' will appear in skipdirs.
-+    ;;
-   i[3456789]86-*-linux*)
-     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
-     # not build java stuff by default.
-diff -urN binutils-2.15.90.0.3-dist/configure.in binutils-2.15.90.0.3/configure.in
---- binutils-2.15.90.0.3-dist/configure.in     2004-04-12 14:56:33.000000000 -0500
-+++ binutils-2.15.90.0.3/configure.in  2004-08-06 17:02:17.000000000 -0500
-@@ -521,6 +521,18 @@
-   i[[3456789]]86-*-freebsd* | i[[3456789]]86-*-kfreebsd*-gnu)
-     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-     ;;
-+  i[[3456789]]86-*-linux-uclibc*)
-+    # This section makes it possible to build newlib natively on linux.
-+    # If we are using a cross compiler then don't configure newlib.
-+    if test x${is_cross_compiler} != xno ; then
-+      noconfigdirs="$noconfigdirs target-newlib"
-+    fi
-+    noconfigdirs="$noconfigdirs target-libgloss"
-+    # If we are not using a cross compiler, do configure newlib.
-+    # Note however, that newlib will only be configured in this situation
-+    # if the --with-newlib option has been given, because otherwise
-+    # 'target-newlib' will appear in skipdirs.
-+    ;;
-   i[[3456789]]86-*-linux*)
-     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
-     # not build java stuff by default.
-diff -urN binutils-2.15.90.0.3-dist/gas/configure binutils-2.15.90.0.3/gas/configure
---- binutils-2.15.90.0.3-dist/gas/configure    2004-04-12 14:56:34.000000000 -0500
-+++ binutils-2.15.90.0.3/gas/configure 2004-08-06 17:04:29.000000000 -0500
-@@ -3401,6 +3401,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -4226,6 +4231,7 @@
-       alpha*-*-osf*)                  fmt=ecoff ;;
-       alpha*-*-linuxecoff*)           fmt=ecoff ;;
-       alpha*-*-linux-gnu*)            fmt=elf em=linux ;;
-+      alpha*-*-linux-uclibc*)         fmt=elf em=linux ;;
-       alpha*-*-netbsd*)                       fmt=elf em=nbsd ;;
-       alpha*-*-openbsd*)              fmt=elf em=obsd ;;
-@@ -4242,6 +4248,7 @@
-       arm*-*-conix*)                  fmt=elf ;;
-       arm-*-linux*aout*)              fmt=aout em=linux ;;
-       arm*-*-linux-gnu*)              fmt=elf  em=linux ;;
-+      arm*-*-linux-uclibc*)           fmt=elf  em=linux ;;
-       arm*-*-uclinux*)                        fmt=elf  em=linux ;;
-       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
-       arm-*-*n*bsd*)                  fmt=aout em=nbsd ;;
-@@ -4255,6 +4262,7 @@
-       avr-*-*)                                fmt=elf ;;
-       cris-*-linux-gnu*)              fmt=multi bfd_gas=yes em=linux ;;
-+      cris-*-linux-uclibc*)           fmt=multi bfd_gas=yes em=linux ;;
-       cris-*-*)                               fmt=multi bfd_gas=yes ;;
-       d10v-*-*)                               fmt=elf ;;
-@@ -4311,7 +4319,9 @@
-       i386-*-linux*oldld)             fmt=aout em=linux ;;
-       i386-*-linux*coff*)             fmt=coff em=linux ;;
-       i386-*-linux-gnu*)              fmt=elf em=linux ;;
-+      i386-*-linux-uclibc*)           fmt=elf em=linux ;;
-       x86_64-*-linux-gnu*)            fmt=elf em=linux ;;
-+      x86_64-*-linux-uclibc*)         fmt=elf em=linux ;;
-       i386-*-lynxos*)                 fmt=coff em=lynx ;;
-       i386-*-sysv[45]*)                       fmt=elf ;;
-       i386-*-solaris*)                        fmt=elf ;;
-@@ -4371,6 +4381,7 @@
-       ia64-*-elf*)                    fmt=elf ;;
-       ia64-*-aix*)                    fmt=elf em=ia64aix ;;
-       ia64-*-linux-gnu*)              fmt=elf em=linux ;;
-+      ia64-*-linux-uclibc*)           fmt=elf em=linux ;;
-       ia64-*-hpux*)                   fmt=elf em=hpux ;;
-       ia64-*-netbsd*)                 fmt=elf em=nbsd ;;
-@@ -4398,6 +4409,7 @@
-       m68k-*-hpux*)                   fmt=hp300 em=hp300 ;;
-       m68k-*-linux*aout*)             fmt=aout em=linux ;;
-       m68k-*-linux-gnu*)              fmt=elf em=linux ;;
-+      m68k-*-linux-uclibc*)           fmt=elf em=linux ;;
-       m68k-*-uclinux*)                        fmt=elf ;;
-       m68k-*-gnu*)                    fmt=elf ;;
-       m68k-*-lynxos*)                 fmt=coff em=lynx ;;
-@@ -4460,6 +4472,7 @@
-       ppc-*-beos*)                    fmt=coff ;;
-       ppc-*-*n*bsd* | ppc-*-elf*)     fmt=elf ;;
-       ppc-*-eabi* | ppc-*-sysv4*)     fmt=elf ;;
-+      ppc-*-linux-uclibc* | \
-       ppc-*-linux-gnu*)                       fmt=elf em=linux
-           case "$endian" in
-               big)  ;;
-@@ -4487,7 +4500,9 @@
-       ppc-*-kaos*)                    fmt=elf ;;
-       s390x-*-linux-gnu*)             fmt=elf em=linux ;;
-+      s390x-*-linux-uclibc*)          fmt=elf em=linux ;;
-       s390-*-linux-gnu*)              fmt=elf em=linux ;;
-+      s390-*-linux-uclibc*)           fmt=elf em=linux ;;
-       sh*-*-linux*)                   fmt=elf em=linux
-           case ${cpu} in
-@@ -4520,6 +4535,7 @@
-       sparc-*-coff)                   fmt=coff ;;
-       sparc-*-linux*aout*)            fmt=aout em=linux ;;
-       sparc-*-linux-gnu*)             fmt=elf em=linux ;;
-+      sparc-*-linux-uclibc*)          fmt=elf em=linux ;;
-       sparc-*-lynxos*)                        fmt=coff em=lynx ;;
-       sparc-fujitsu-none)             fmt=aout ;;
-       sparc-*-elf)                    fmt=elf ;;
-diff -urN binutils-2.15.90.0.3-dist/gas/configure.in binutils-2.15.90.0.3/gas/configure.in
---- binutils-2.15.90.0.3-dist/gas/configure.in 2004-04-12 14:56:34.000000000 -0500
-+++ binutils-2.15.90.0.3/gas/configure.in      2004-08-06 17:04:27.000000000 -0500
-@@ -194,6 +194,7 @@
-       alpha*-*-osf*)                  fmt=ecoff ;;
-       alpha*-*-linuxecoff*)           fmt=ecoff ;;
-       alpha*-*-linux-gnu*)            fmt=elf em=linux ;;
-+      alpha*-*-linux-uclibc*)         fmt=elf em=linux ;;
-       alpha*-*-netbsd*)                       fmt=elf em=nbsd ;;
-       alpha*-*-openbsd*)              fmt=elf em=obsd ;;
-@@ -210,6 +211,7 @@
-       arm*-*-conix*)                  fmt=elf ;;
-       arm-*-linux*aout*)              fmt=aout em=linux ;;
-       arm*-*-linux-gnu*)              fmt=elf  em=linux ;;
-+      arm*-*-linux-uclibc*)           fmt=elf  em=linux ;;
-       arm*-*-uclinux*)                        fmt=elf  em=linux ;;
-       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
-       arm-*-*n*bsd*)                  fmt=aout em=nbsd ;;
-@@ -223,6 +225,7 @@
-       avr-*-*)                                fmt=elf ;;
-       cris-*-linux-gnu*)              fmt=multi bfd_gas=yes em=linux ;;
-+      cris-*-linux-uclibc*)           fmt=multi bfd_gas=yes em=linux ;;
-       cris-*-*)                               fmt=multi bfd_gas=yes ;;
-       d10v-*-*)                               fmt=elf ;;
-@@ -279,7 +282,9 @@
-       i386-*-linux*oldld)             fmt=aout em=linux ;;
-       i386-*-linux*coff*)             fmt=coff em=linux ;;
-       i386-*-linux-gnu*)              fmt=elf em=linux ;;
-+      i386-*-linux-uclibc*)           fmt=elf em=linux ;;
-       x86_64-*-linux-gnu*)            fmt=elf em=linux ;;
-+      x86_64-*-linux-uclibc*)         fmt=elf em=linux ;;
-       i386-*-lynxos*)                 fmt=coff em=lynx ;;
- changequote(,)dnl
-       i386-*-sysv[45]*)                       fmt=elf ;;
-@@ -332,6 +337,7 @@
-       ia64-*-elf*)                    fmt=elf ;;
-       ia64-*-aix*)                    fmt=elf em=ia64aix ;;
-       ia64-*-linux-gnu*)              fmt=elf em=linux ;;
-+      ia64-*-linux-uclibc*)           fmt=elf em=linux ;;
-       ia64-*-hpux*)                   fmt=elf em=hpux ;;
-       ia64-*-netbsd*)                 fmt=elf em=nbsd ;;
-@@ -359,6 +365,7 @@
-       m68k-*-hpux*)                   fmt=hp300 em=hp300 ;;
-       m68k-*-linux*aout*)             fmt=aout em=linux ;;
-       m68k-*-linux-gnu*)              fmt=elf em=linux ;;
-+      m68k-*-linux-uclibc*)           fmt=elf em=linux ;;
-       m68k-*-uclinux*)                        fmt=elf ;;
-       m68k-*-gnu*)                    fmt=elf ;;
-       m68k-*-lynxos*)                 fmt=coff em=lynx ;;
-@@ -418,6 +425,7 @@
-       ppc-*-beos*)                    fmt=coff ;;
-       ppc-*-*n*bsd* | ppc-*-elf*)     fmt=elf ;;
-       ppc-*-eabi* | ppc-*-sysv4*)     fmt=elf ;;
-+      ppc-*-linux-uclibc* | \
-       ppc-*-linux-gnu*)                       fmt=elf em=linux
-           case "$endian" in
-               big)  ;;
-@@ -438,7 +446,9 @@
-       ppc-*-kaos*)                    fmt=elf ;;
-       s390x-*-linux-gnu*)             fmt=elf em=linux ;;
-+      s390x-*-linux-uclibc*)          fmt=elf em=linux ;;
-       s390-*-linux-gnu*)              fmt=elf em=linux ;;
-+      s390-*-linux-uclibc*)           fmt=elf em=linux ;;
-       sh*-*-linux*)                   fmt=elf em=linux
-           case ${cpu} in
-@@ -471,6 +481,7 @@
-       sparc-*-coff)                   fmt=coff ;;
-       sparc-*-linux*aout*)            fmt=aout em=linux ;;
-       sparc-*-linux-gnu*)             fmt=elf em=linux ;;
-+      sparc-*-linux-uclibc*)          fmt=elf em=linux ;;
-       sparc-*-lynxos*)                        fmt=coff em=lynx ;;
-       sparc-fujitsu-none)             fmt=aout ;;
-       sparc-*-elf)                    fmt=elf ;;
-diff -urN binutils-2.15.90.0.3-dist/gprof/configure binutils-2.15.90.0.3/gprof/configure
---- binutils-2.15.90.0.3-dist/gprof/configure  2004-01-14 15:07:51.000000000 -0600
-+++ binutils-2.15.90.0.3/gprof/configure       2004-08-06 17:02:17.000000000 -0500
-@@ -1570,6 +1570,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.15.90.0.3-dist/ld/configure binutils-2.15.90.0.3/ld/configure
---- binutils-2.15.90.0.3-dist/ld/configure     2003-05-05 16:46:49.000000000 -0500
-+++ binutils-2.15.90.0.3/ld/configure  2004-08-06 17:02:17.000000000 -0500
-@@ -1578,6 +1578,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.15.90.0.3-dist/ld/configure.tgt binutils-2.15.90.0.3/ld/configure.tgt
---- binutils-2.15.90.0.3-dist/ld/configure.tgt 2004-04-12 14:56:35.000000000 -0500
-+++ binutils-2.15.90.0.3/ld/configure.tgt      2004-08-06 17:02:17.000000000 -0500
-@@ -31,6 +31,7 @@
-                       targ_extra_emuls="criself crislinux"
-                       targ_extra_libpath=$targ_extra_emuls ;;
- cris-*-linux-gnu*)    targ_emul=crislinux ;;
-+cris-*-linux-uclibc*) targ_emul=crislinux ;;
- cris-*-*)             targ_emul=criself
-                       targ_extra_emuls="crisaout crislinux"
-                       targ_extra_libpath=$targ_extra_emuls ;;
-@@ -60,14 +61,16 @@
-                       tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
-                       tdir_sun4=sparc-sun-sunos4
-                       ;;
--sparc64-*-linux-gnu*) targ_emul=elf64_sparc
-+sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)        \
-+                      targ_emul=elf64_sparc
-                       targ_extra_emuls="elf32_sparc sparclinux sun4"
-                       targ_extra_libpath=elf32_sparc
-                       tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
-                       tdir_sparclinux=${tdir_elf32_sparc}aout
-                       tdir_sun4=sparc-sun-sunos4
-                       ;;
--sparc*-*-linux-gnu*)  targ_emul=elf32_sparc
-+sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
-+                      targ_emul=elf32_sparc
-                       targ_extra_emuls="sparclinux elf64_sparc sun4"
-                       targ_extra_libpath=elf64_sparc
-                       tdir_sparclinux=${targ_alias}aout
-@@ -119,7 +122,9 @@
- m32r*le-*-elf*)         targ_emul=m32rlelf ;;
- m32r*-*-elf*)           targ_emul=m32relf ;;
- m32r*le-*-linux-gnu*)   targ_emul=m32rlelf_linux ;;
-+m32r*le-*-linux-uclibc*) targ_emul=m32rlelf_linux ;;
- m32r*-*-linux-gnu*)     targ_emul=m32relf_linux ;;
-+m32r*-*-linux-uclibc*)  targ_emul=m32relf_linux ;;
- m68hc11-*-*|m6811-*-*)        targ_emul=m68hc11elf 
-                       targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
- m68hc12-*-*|m6812-*-*)        targ_emul=m68hc12elf 
-@@ -129,7 +134,7 @@
- m68*-ericsson-ose)    targ_emul=sun3 ;;
- m68*-apple-aux*)      targ_emul=m68kaux ;;
- *-tandem-none)                targ_emul=st2000 ;;
--i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
-+i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
- i[3-7]86-*-nto-qnx*)  targ_emul=i386nto ;;
- i[3-7]86-*-vsta)      targ_emul=vsta ;;
- i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
-@@ -153,14 +158,16 @@
-                       tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
-                       ;;
- i[3-7]86-*-linux*oldld)       targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
--i[3-7]86-*-linux-gnu*)        targ_emul=elf_i386
-+i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
-+                      targ_emul=elf_i386
-                       targ_extra_emuls=i386linux
-                       if test x${want64} = xtrue; then
-                         targ_extra_emuls="$targ_extra_emuls elf_x86_64"
-                       fi
-                       tdir_i386linux=${targ_alias}aout
-                       ;;
--x86_64-*-linux-gnu*)  targ_emul=elf_x86_64
-+x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
-+                      targ_emul=elf_x86_64
-                       targ_extra_emuls="elf_i386 i386linux"
-                       targ_extra_libpath=elf_i386
-                       tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
-@@ -260,10 +267,13 @@
- arm9e-*-elf)          targ_emul=armelf ;;
- arm-*-oabi)           targ_emul=armelf_oabi ;;
- arm*b-*-linux-gnu*)   targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
-+arm*b-*-linux-uclibc*)        targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
- arm*-*-linux-gnu*)    targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
-+arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- arm*-*-uclinux*)      targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- arm*-*-conix*)                targ_emul=armelf ;;
--thumb-*-linux-gnu* | thumb-*-uclinux*)        targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
-+thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
-+                      targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- strongarm-*-coff)     targ_emul=armcoff ;;
- strongarm-*-elf)      targ_emul=armelf ;;
- strongarm-*-kaos*)    targ_emul=armelf ;;
-@@ -365,7 +375,8 @@
-                       targ_extra_emuls=m68kelf
-                       tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
-                       ;;
--m68k-*-linux-gnu*)    targ_emul=m68kelf
-+m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
-+                      targ_emul=m68kelf
-                       targ_extra_emuls=m68klinux
-                       tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
-                       ;;
-@@ -382,9 +393,9 @@
- m68*-*-psos*)         targ_emul=m68kpsos ;;
- m68*-*-rtemscoff*)    targ_emul=m68kcoff ;;
- m68*-*-rtems*)                targ_emul=m68kelf ;;
--hppa*64*-*-linux-gnu*)        targ_emul=hppa64linux ;;
-+hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)  targ_emul=hppa64linux ;;
- hppa*64*-*)           targ_emul=elf64hppa ;;
--hppa*-*-linux-gnu*)   targ_emul=hppalinux ;;
-+hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*)   targ_emul=hppalinux ;;
- hppa*-*-*elf*)                targ_emul=hppaelf ;;
- hppa*-*-lites*)               targ_emul=hppaelf ;;
- hppa*-*-netbsd*)      targ_emul=hppanbsd ;;
-@@ -397,6 +408,7 @@
-                       targ_emul=vaxnbsd
-                       targ_extra_emuls=elf32vax ;;
- vax-*-linux-gnu*)     targ_emul=elf32vax ;;
-+vax-*-linux-uclibc*)  targ_emul=elf32vax ;;
- mips*-*-pe)           targ_emul=mipspe ;
-                       targ_extra_ofiles="deffilep.o pe-dll.o" ;;
- mips*-dec-ultrix*)    targ_emul=mipslit ;;
-@@ -430,16 +442,16 @@
- mips*-*-vxworks*)     targ_emul=elf32ebmip
-                       targ_extra_emuls="elf32elmip" ;;
- mips*-*-windiss)      targ_emul=elf32mipswindiss ;;
--mips64*el-*-linux-gnu*)       targ_emul=elf32ltsmipn32
-+mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*)   targ_emul=elf32ltsmipn32
-                       targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
-                       ;;
--mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
-+mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*)       targ_emul=elf32btsmipn32
-                       targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
-                       ;;
--mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
-+mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*)       targ_emul=elf32ltsmip
-                       targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
-                       ;;
--mips*-*-linux-gnu*)   targ_emul=elf32btsmip
-+mips*-*-linux-gnu* | mips*-*-linux-uclibc*)   targ_emul=elf32btsmip
-                       targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
-                       ;;
- mips*-*-lnews*)               targ_emul=mipslnews ;;
-@@ -462,6 +474,10 @@
- alpha*-*-linux-gnu*)  targ_emul=elf64alpha targ_extra_emuls=alpha
-                       tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
-                       ;;
-+alpha*-*-linux-uclibc*)       targ_emul=elf64alpha targ_extra_emuls=alpha
-+                      # The following needs to be checked...
-+                      tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
-+                      ;;
- alpha*-*-osf*)                targ_emul=alpha ;;
- alpha*-*-gnu*)                targ_emul=elf64alpha ;;
- alpha*-*-netware*)    targ_emul=alpha ;;
-diff -urN binutils-2.15.90.0.3-dist/libtool.m4 binutils-2.15.90.0.3/libtool.m4
---- binutils-2.15.90.0.3-dist/libtool.m4       2003-05-05 16:46:46.000000000 -0500
-+++ binutils-2.15.90.0.3/libtool.m4    2004-08-06 17:02:17.000000000 -0500
-@@ -645,6 +645,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
-diff -urN binutils-2.15.90.0.3-dist/ltconfig binutils-2.15.90.0.3/ltconfig
---- binutils-2.15.90.0.3-dist/ltconfig 2004-01-14 15:07:42.000000000 -0600
-+++ binutils-2.15.90.0.3/ltconfig      2004-08-06 17:02:17.000000000 -0500
-@@ -603,6 +603,7 @@
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case $host_os in
- linux-gnu*) ;;
-+linux-uclibc*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
-@@ -1259,6 +1260,24 @@
-   dynamic_linker='GNU/Linux ld.so'
-   ;;
-+linux-uclibc*)
-+  version_type=linux
-+  need_lib_prefix=no
-+  need_version=no
-+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-+  soname_spec='${libname}${release}.so$major'
-+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-+  shlibpath_var=LD_LIBRARY_PATH
-+  shlibpath_overrides_runpath=no
-+  # This implies no fast_install, which is unacceptable.
-+  # Some rework will be needed to allow for fast_install
-+  # before this can be enabled.
-+  # Note: copied from linux-gnu, and may not be appropriate.
-+  hardcode_into_libs=yes
-+  # Assume using the uClibc dynamic linker.
-+  dynamic_linker="uClibc ld.so"
-+  ;;
-+
- netbsd*)
-   need_lib_prefix=no
-   need_version=no
-diff -urN binutils-2.15.90.0.3-dist/opcodes/configure binutils-2.15.90.0.3/opcodes/configure
---- binutils-2.15.90.0.3-dist/opcodes/configure        2004-04-12 14:56:38.000000000 -0500
-+++ binutils-2.15.90.0.3/opcodes/configure     2004-08-06 17:02:17.000000000 -0500
-@@ -1690,6 +1690,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
diff --git a/openwrt/toolchain/binutils/2.15.90.0.3/500-branch-likely.patch b/openwrt/toolchain/binutils/2.15.90.0.3/500-branch-likely.patch
deleted file mode 100644 (file)
index 0bb1a4b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- binutils-2.15.90.0.3/gas/config/tc-mips.c-dist     2004-08-19 12:56:20.000000000 -0500
-+++ binutils-2.15.90.0.3/gas/config/tc-mips.c  2004-08-19 12:57:30.000000000 -0500
-@@ -2708,6 +2708,7 @@
-         prev_insn_reloc_type[1] = BFD_RELOC_UNUSED;
-         prev_insn_reloc_type[2] = BFD_RELOC_UNUSED;
-         prev_insn_extended = 0;
-+        prev_insn_is_delay_slot = 1;
-       }
-       else
-       {
diff --git a/openwrt/toolchain/binutils/2.15.90.0.3/600-arm-textrel.patch b/openwrt/toolchain/binutils/2.15.90.0.3/600-arm-textrel.patch
deleted file mode 100644 (file)
index 73d5b9d..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-http://sources.redhat.com/ml/binutils/2004-06/msg00010.html
---- binutils-2.15.90.0.3-old/bfd/elf32-arm.h   2004-04-12 14:56:33.000000000 -0500
-+++ binutils-2.15.90.0.3/bfd/elf32-arm.h       2004-09-03 06:56:40.000000000 -0500
-@@ -87,6 +87,8 @@
- #endif
- static bfd_boolean allocate_dynrelocs 
-   PARAMS ((struct elf_link_hash_entry *h, PTR inf));
-+static bfd_boolean elf32_arm_readonly_dynrelocs
-+  PARAMS ((struct elf_link_hash_entry *, PTR));
- static bfd_boolean create_got_section 
-   PARAMS ((bfd * dynobj, struct bfd_link_info * info));
- static bfd_boolean elf32_arm_create_dynamic_sections 
-@@ -3531,6 +3533,37 @@
-   return TRUE;
- }
-+/* Find any dynamic relocs that apply to read-only sections.  */
-+
-+static bfd_boolean
-+elf32_arm_readonly_dynrelocs (h, inf)
-+     struct elf_link_hash_entry *h;
-+     PTR inf;
-+{
-+  struct elf32_arm_link_hash_entry *eh;
-+  struct elf32_arm_relocs_copied *p;
-+
-+  if (h->root.type == bfd_link_hash_warning)
-+    h = (struct elf_link_hash_entry *) h->root.u.i.link;
-+
-+  eh = (struct elf32_arm_link_hash_entry *) h;
-+  for (p = eh->relocs_copied; p != NULL; p = p->next)
-+    {
-+      asection *s = p->section;
-+
-+      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-+       {
-+         struct bfd_link_info *info = (struct bfd_link_info *) inf;
-+
-+         info->flags |= DF_TEXTREL;
-+
-+         /* Not an error, just cut short the traversal.  */
-+         return FALSE;
-+       }
-+    }
-+  return TRUE;
-+}
-+
- /* Set the sizes of the dynamic sections.  */
- static bfd_boolean
-@@ -3740,6 +3773,12 @@
-           return FALSE;
-       }
-+      /* If any dynamic relocs apply to a read-only section,
-+         then we need a DT_TEXTREL entry.  */
-+      if ((info->flags & DF_TEXTREL) == 0)
-+        elf_link_hash_traverse (&htab->root, elf32_arm_readonly_dynrelocs,
-+                                (PTR) info);
-+
-       if ((info->flags & DF_TEXTREL) != 0)
-       {
-         if (!add_dynamic_entry (DT_TEXTREL, 0))
diff --git a/openwrt/toolchain/binutils/2.15.91.0.1/100-uclibc-conf.patch b/openwrt/toolchain/binutils/2.15.91.0.1/100-uclibc-conf.patch
deleted file mode 100644 (file)
index 57b86ab..0000000
+++ /dev/null
@@ -1,692 +0,0 @@
-diff -urN binutils-2.15.91.0.1-dist/bfd/config.bfd binutils-2.15.91.0.1/bfd/config.bfd
---- binutils-2.15.91.0.1-dist/bfd/config.bfd   2004-05-27 13:26:01.000000000 -0500
-+++ binutils-2.15.91.0.1/bfd/config.bfd        2004-07-16 14:57:21.000000000 -0500
-@@ -128,7 +128,7 @@
-     targ_defvec=ecoffalpha_little_vec
-     targ_selvecs=bfd_elf64_alpha_vec
-     ;;
--  alpha*-*-linux-gnu* | alpha*-*-elf*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
-     targ_defvec=bfd_elf64_alpha_vec
-     targ_selvecs=ecoffalpha_little_vec
-     ;;
-@@ -138,7 +138,7 @@
-   alpha*-*-*)
-     targ_defvec=ecoffalpha_little_vec
-     ;;
--  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
-+  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-linux-uclibc* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
-     targ_defvec=bfd_elf64_ia64_little_vec
-     targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
-     ;;
-@@ -215,7 +215,7 @@
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
--  armeb-*-elf | arm*b-*-linux-gnu*)
-+  armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_bigarm_vec
-     targ_selvecs=bfd_elf32_littlearm_vec
-     ;;
-@@ -223,7 +223,7 @@
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
--  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
-+  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | arm*-*-conix* | \
-   arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-@@ -367,7 +367,7 @@
-     ;;
- #ifdef BFD64
--  hppa*64*-*-linux-gnu*)
-+  hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_hppa_linux_vec
-     targ_selvecs=bfd_elf64_hppa_vec
-     ;;
-@@ -378,7 +378,7 @@
-     ;;
- #endif
--  hppa*-*-linux-gnu* | hppa*-*-netbsd*)
-+  hppa*-*-linux-gnu* | hppa*-*-linux-uclibc* | hppa*-*-netbsd*)
-     targ_defvec=bfd_elf32_hppa_linux_vec
-     targ_selvecs=bfd_elf32_hppa_vec
-     ;;
-@@ -501,7 +501,7 @@
-     targ_selvecs=bfd_elf32_i386_vec
-     targ_underscore=yes
-     ;;
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_i386_vec
-     targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
-     targ64_selvecs=bfd_elf64_x86_64_vec
-@@ -515,7 +515,7 @@
-     targ_defvec=bfd_elf64_x86_64_vec
-     targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
-     ;;
--  x86_64-*-linux-gnu*)
-+  x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_x86_64_vec
-     targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
-     ;;
-@@ -690,7 +690,7 @@
-     targ_selvecs=bfd_elf32_m68k_vec
-     targ_underscore=yes
-     ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_m68k_vec
-     targ_selvecs=m68klinux_vec
-     ;;
-@@ -966,7 +966,8 @@
-     ;;
- #endif
-   powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
--  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
-+  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
-+  powerpc-*-rtems* | \
-   powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
-     targ_defvec=bfd_elf32_powerpc_vec
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
-@@ -1003,8 +1004,8 @@
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
-     ;;
-   powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
--  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
--  powerpcle-*-rtems*)
-+  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
-+  powerpcle-*-vxworks* | powerpcle-*-rtems*)
-     targ_defvec=bfd_elf32_powerpcle_vec
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
-     targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
-@@ -1165,7 +1166,7 @@
-     targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
-     targ_underscore=yes
-     ;;
--  sparc-*-linux-gnu*)
-+  sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_sparc_vec
-     targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
-     ;;
-@@ -1212,7 +1213,7 @@
-     targ_defvec=sunos_big_vec
-     targ_underscore=yes
-     ;;
--  sparc64-*-linux-gnu*)
-+  sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_sparc_vec
-     targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
-     ;;
-@@ -1281,7 +1282,7 @@
-     targ_underscore=yes
-     ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_vax_vec
-     ;;
-diff -urN binutils-2.15.91.0.1-dist/bfd/configure binutils-2.15.91.0.1/bfd/configure
---- binutils-2.15.91.0.1-dist/bfd/configure    2004-05-27 13:26:02.000000000 -0500
-+++ binutils-2.15.91.0.1/bfd/configure 2004-07-16 14:57:21.000000000 -0500
-@@ -1687,6 +1687,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -5266,7 +5271,7 @@
-   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
-       COREFILE=''
-       ;;
--  alpha*-*-linux-gnu*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/alphalinux.h"'
-       ;;
-@@ -5326,7 +5331,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386mach3.h"'
-       ;;
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386linux.h"'
-       ;;
-@@ -5364,7 +5369,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/hp300bsd.h"'
-       ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/m68klinux.h"'
-       ;;
-@@ -5468,7 +5473,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxult2.h"'
-       ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxlinux.h"'
-       ;;
-diff -urN binutils-2.15.91.0.1-dist/bfd/configure.in binutils-2.15.91.0.1/bfd/configure.in
---- binutils-2.15.91.0.1-dist/bfd/configure.in 2004-05-27 13:26:02.000000000 -0500
-+++ binutils-2.15.91.0.1/bfd/configure.in      2004-07-16 14:57:21.000000000 -0500
-@@ -164,7 +164,7 @@
-   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
-       COREFILE=''
-       ;;
--  alpha*-*-linux-gnu*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/alphalinux.h"'
-       ;;
-@@ -245,7 +245,7 @@
-       TRAD_HEADER='"hosts/i386mach3.h"'
-       ;;
- changequote(,)dnl
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
- changequote([,])dnl
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386linux.h"'
-@@ -286,7 +286,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/hp300bsd.h"'
-       ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/m68klinux.h"'
-       ;;
-@@ -374,7 +374,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxult2.h"'
-       ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxlinux.h"'
-       ;;
-diff -urN binutils-2.15.91.0.1-dist/binutils/configure binutils-2.15.91.0.1/binutils/configure
---- binutils-2.15.91.0.1-dist/binutils/configure       2004-04-12 14:56:34.000000000 -0500
-+++ binutils-2.15.91.0.1/binutils/configure    2004-07-27 21:50:54.000000000 -0500
-@@ -1575,6 +1575,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.15.91.0.1-dist/configure binutils-2.15.91.0.1/configure
---- binutils-2.15.91.0.1-dist/configure        2004-05-27 13:26:01.000000000 -0500
-+++ binutils-2.15.91.0.1/configure     2004-07-16 14:57:21.000000000 -0500
-@@ -1365,6 +1365,18 @@
-   i[3456789]86-*-coff | i[3456789]86-*-elf)
-     noconfigdirs="$noconfigdirs ${libgcj}"
-     ;;
-+  i[3456789]86-*-linux-uclibc*)
-+    # This section makes it possible to build newlib natively on linux.
-+    # If we are using a cross compiler then don't configure newlib.
-+    if test x${is_cross_compiler} != xno ; then
-+      noconfigdirs="$noconfigdirs target-newlib"
-+    fi
-+    noconfigdirs="$noconfigdirs target-libgloss"
-+    # If we are not using a cross compiler, do configure newlib.
-+    # Note however, that newlib will only be configured in this situation
-+    # if the --with-newlib option has been given, because otherwise
-+    # 'target-newlib' will appear in skipdirs.
-+    ;;
-   i[3456789]86-*-linux*)
-     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
-     # not build java stuff by default.
-diff -urN binutils-2.15.91.0.1-dist/configure.in binutils-2.15.91.0.1/configure.in
---- binutils-2.15.91.0.1-dist/configure.in     2004-05-27 13:26:01.000000000 -0500
-+++ binutils-2.15.91.0.1/configure.in  2004-07-16 14:57:21.000000000 -0500
-@@ -551,6 +551,18 @@
-   i[[3456789]]86-*-coff | i[[3456789]]86-*-elf)
-     noconfigdirs="$noconfigdirs ${libgcj}"
-     ;;
-+  i[[3456789]]86-*-linux-uclibc*)
-+    # This section makes it possible to build newlib natively on linux.
-+    # If we are using a cross compiler then don't configure newlib.
-+    if test x${is_cross_compiler} != xno ; then
-+      noconfigdirs="$noconfigdirs target-newlib"
-+    fi
-+    noconfigdirs="$noconfigdirs target-libgloss"
-+    # If we are not using a cross compiler, do configure newlib.
-+    # Note however, that newlib will only be configured in this situation
-+    # if the --with-newlib option has been given, because otherwise
-+    # 'target-newlib' will appear in skipdirs.
-+    ;;
-   i[[3456789]]86-*-linux*)
-     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
-     # not build java stuff by default.
-diff -urN binutils-2.15.91.0.1-dist/gas/configure binutils-2.15.91.0.1/gas/configure
---- binutils-2.15.91.0.1-dist/gas/configure    2004-05-27 13:26:03.000000000 -0500
-+++ binutils-2.15.91.0.1/gas/configure 2004-07-16 14:57:21.000000000 -0500
-@@ -3408,6 +3408,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -4233,6 +4238,7 @@
-       alpha*-*-osf*)                  fmt=ecoff ;;
-       alpha*-*-linuxecoff*)           fmt=ecoff ;;
-       alpha*-*-linux-gnu*)            fmt=elf em=linux ;;
-+      alpha*-*-linux-uclibc*)         fmt=elf em=linux ;;
-       alpha*-*-netbsd*)                       fmt=elf em=nbsd ;;
-       alpha*-*-openbsd*)              fmt=elf em=obsd ;;
-@@ -4249,6 +4255,7 @@
-       arm*-*-conix*)                  fmt=elf ;;
-       arm-*-linux*aout*)              fmt=aout em=linux ;;
-       arm*-*-linux-gnu*)              fmt=elf  em=linux ;;
-+      arm*-*-linux-uclibc*)           fmt=elf  em=linux ;;
-       arm*-*-uclinux*)                        fmt=elf  em=linux ;;
-       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
-       arm-*-*n*bsd*)                  fmt=aout em=nbsd ;;
-@@ -4262,6 +4269,7 @@
-       avr-*-*)                                fmt=elf ;;
-       cris-*-linux-gnu*)              fmt=multi bfd_gas=yes em=linux ;;
-+      cris-*-linux-uclibc*)           fmt=multi bfd_gas=yes em=linux ;;
-       cris-*-*)                               fmt=multi bfd_gas=yes ;;
-       d10v-*-*)                               fmt=elf ;;
-@@ -4319,7 +4327,9 @@
-       i386-*-linux*oldld)             fmt=aout em=linux ;;
-       i386-*-linux*coff*)             fmt=coff em=linux ;;
-       i386-*-linux-gnu*)              fmt=elf em=linux ;;
-+      i386-*-linux-uclibc*)           fmt=elf em=linux ;;
-       x86_64-*-linux-gnu*)            fmt=elf em=linux ;;
-+      x86_64-*-linux-uclibc*)         fmt=elf em=linux ;;
-       i386-*-lynxos*)                 fmt=elf em=lynx bfd_gas=yes ;;
-       i386-*-sysv[45]*)                       fmt=elf ;;
-       i386-*-solaris*)                        fmt=elf ;;
-@@ -4379,6 +4389,7 @@
-       ia64-*-elf*)                    fmt=elf ;;
-       ia64-*-aix*)                    fmt=elf em=ia64aix ;;
-       ia64-*-linux-gnu*)              fmt=elf em=linux ;;
-+      ia64-*-linux-uclibc*)           fmt=elf em=linux ;;
-       ia64-*-hpux*)                   fmt=elf em=hpux ;;
-       ia64-*-netbsd*)                 fmt=elf em=nbsd ;;
-@@ -4406,6 +4417,7 @@
-       m68k-*-hpux*)                   fmt=hp300 em=hp300 ;;
-       m68k-*-linux*aout*)             fmt=aout em=linux ;;
-       m68k-*-linux-gnu*)              fmt=elf em=linux ;;
-+      m68k-*-linux-uclibc*)           fmt=elf em=linux ;;
-       m68k-*-uclinux*)                        fmt=elf ;;
-       m68k-*-gnu*)                    fmt=elf ;;
-       m68k-*-lynxos*)                 fmt=coff em=lynx ;;
-@@ -4468,6 +4480,7 @@
-       ppc-*-beos*)                    fmt=coff ;;
-       ppc-*-*n*bsd* | ppc-*-elf*)     fmt=elf ;;
-       ppc-*-eabi* | ppc-*-sysv4*)     fmt=elf ;;
-+      ppc-*-linux-uclibc* | \
-       ppc-*-linux-gnu*)                       fmt=elf em=linux
-           case "$endian" in
-               big)  ;;
-@@ -4496,7 +4509,9 @@
-       ppc-*-lynxos*)                  fmt=elf em=lynx bfd_gas=yes ;;
-       s390x-*-linux-gnu*)             fmt=elf em=linux ;;
-+      s390x-*-linux-uclibc*)          fmt=elf em=linux ;;
-       s390-*-linux-gnu*)              fmt=elf em=linux ;;
-+      s390-*-linux-uclibc*)           fmt=elf em=linux ;;
-       sh*-*-linux*)                   fmt=elf em=linux
-           case ${cpu} in
-@@ -4529,6 +4544,7 @@
-       sparc-*-coff)                   fmt=coff ;;
-       sparc-*-linux*aout*)            fmt=aout em=linux ;;
-       sparc-*-linux-gnu*)             fmt=elf em=linux ;;
-+      sparc-*-linux-uclibc*)          fmt=elf em=linux ;;
-       sparc-*-lynxos*)                        fmt=coff em=lynx ;;
-       sparc-fujitsu-none)             fmt=aout ;;
-       sparc-*-elf)                    fmt=elf ;;
-diff -urN binutils-2.15.91.0.1-dist/gas/configure.in binutils-2.15.91.0.1/gas/configure.in
---- binutils-2.15.91.0.1-dist/gas/configure.in 2004-05-27 13:26:03.000000000 -0500
-+++ binutils-2.15.91.0.1/gas/configure.in      2004-07-16 14:57:21.000000000 -0500
-@@ -194,6 +194,7 @@
-       alpha*-*-osf*)                  fmt=ecoff ;;
-       alpha*-*-linuxecoff*)           fmt=ecoff ;;
-       alpha*-*-linux-gnu*)            fmt=elf em=linux ;;
-+      alpha*-*-linux-uclibc*)         fmt=elf em=linux ;;
-       alpha*-*-netbsd*)                       fmt=elf em=nbsd ;;
-       alpha*-*-openbsd*)              fmt=elf em=obsd ;;
-@@ -210,6 +211,7 @@
-       arm*-*-conix*)                  fmt=elf ;;
-       arm-*-linux*aout*)              fmt=aout em=linux ;;
-       arm*-*-linux-gnu*)              fmt=elf  em=linux ;;
-+      arm*-*-linux-uclibc*)           fmt=elf  em=linux ;;
-       arm*-*-uclinux*)                        fmt=elf  em=linux ;;
-       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
-       arm-*-*n*bsd*)                  fmt=aout em=nbsd ;;
-@@ -223,6 +225,7 @@
-       avr-*-*)                                fmt=elf ;;
-       cris-*-linux-gnu*)              fmt=multi bfd_gas=yes em=linux ;;
-+      cris-*-linux-uclibc*)           fmt=multi bfd_gas=yes em=linux ;;
-       cris-*-*)                               fmt=multi bfd_gas=yes ;;
-       d10v-*-*)                               fmt=elf ;;
-@@ -280,7 +283,9 @@
-       i386-*-linux*oldld)             fmt=aout em=linux ;;
-       i386-*-linux*coff*)             fmt=coff em=linux ;;
-       i386-*-linux-gnu*)              fmt=elf em=linux ;;
-+      i386-*-linux-uclibc*)           fmt=elf em=linux ;;
-       x86_64-*-linux-gnu*)            fmt=elf em=linux ;;
-+      x86_64-*-linux-uclibc*)         fmt=elf em=linux ;;
-       i386-*-lynxos*)                 fmt=elf em=lynx bfd_gas=yes ;;
- changequote(,)dnl
-       i386-*-sysv[45]*)                       fmt=elf ;;
-@@ -333,6 +338,7 @@
-       ia64-*-elf*)                    fmt=elf ;;
-       ia64-*-aix*)                    fmt=elf em=ia64aix ;;
-       ia64-*-linux-gnu*)              fmt=elf em=linux ;;
-+      ia64-*-linux-uclibc*)           fmt=elf em=linux ;;
-       ia64-*-hpux*)                   fmt=elf em=hpux ;;
-       ia64-*-netbsd*)                 fmt=elf em=nbsd ;;
-@@ -360,6 +366,7 @@
-       m68k-*-hpux*)                   fmt=hp300 em=hp300 ;;
-       m68k-*-linux*aout*)             fmt=aout em=linux ;;
-       m68k-*-linux-gnu*)              fmt=elf em=linux ;;
-+      m68k-*-linux-uclibc*)           fmt=elf em=linux ;;
-       m68k-*-uclinux*)                        fmt=elf ;;
-       m68k-*-gnu*)                    fmt=elf ;;
-       m68k-*-lynxos*)                 fmt=coff em=lynx ;;
-@@ -419,6 +426,7 @@
-       ppc-*-beos*)                    fmt=coff ;;
-       ppc-*-*n*bsd* | ppc-*-elf*)     fmt=elf ;;
-       ppc-*-eabi* | ppc-*-sysv4*)     fmt=elf ;;
-+      ppc-*-linux-uclibc* | \
-       ppc-*-linux-gnu*)                       fmt=elf em=linux
-           case "$endian" in
-               big)  ;;
-@@ -440,7 +448,9 @@
-       ppc-*-lynxos*)                  fmt=elf em=lynx bfd_gas=yes ;;
-       s390x-*-linux-gnu*)             fmt=elf em=linux ;;
-+      s390x-*-linux-uclibc*)          fmt=elf em=linux ;;
-       s390-*-linux-gnu*)              fmt=elf em=linux ;;
-+      s390-*-linux-uclibc*)           fmt=elf em=linux ;;
-       sh*-*-linux*)                   fmt=elf em=linux
-           case ${cpu} in
-@@ -473,6 +483,7 @@
-       sparc-*-coff)                   fmt=coff ;;
-       sparc-*-linux*aout*)            fmt=aout em=linux ;;
-       sparc-*-linux-gnu*)             fmt=elf em=linux ;;
-+      sparc-*-linux-uclibc*)          fmt=elf em=linux ;;
-       sparc-*-lynxos*)                        fmt=coff em=lynx ;;
-       sparc-fujitsu-none)             fmt=aout ;;
-       sparc-*-elf)                    fmt=elf ;;
-diff -urN binutils-2.15.91.0.1-dist/gprof/configure binutils-2.15.91.0.1/gprof/configure
---- binutils-2.15.91.0.1-dist/gprof/configure  2004-01-14 15:07:51.000000000 -0600
-+++ binutils-2.15.91.0.1/gprof/configure       2004-07-27 21:53:11.000000000 -0500
-@@ -1570,6 +1570,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.15.91.0.1-dist/ld/configure binutils-2.15.91.0.1/ld/configure
---- binutils-2.15.91.0.1-dist/ld/configure     2003-05-05 16:46:49.000000000 -0500
-+++ binutils-2.15.91.0.1/ld/configure  2004-07-16 14:57:21.000000000 -0500
-@@ -1578,6 +1578,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.15.91.0.1-dist/ld/configure.tgt binutils-2.15.91.0.1/ld/configure.tgt
---- binutils-2.15.91.0.1-dist/ld/configure.tgt 2004-05-27 13:26:04.000000000 -0500
-+++ binutils-2.15.91.0.1/ld/configure.tgt      2004-07-16 14:57:21.000000000 -0500
-@@ -31,6 +31,7 @@
-                       targ_extra_emuls="criself crislinux"
-                       targ_extra_libpath=$targ_extra_emuls ;;
- cris-*-linux-gnu*)    targ_emul=crislinux ;;
-+cris-*-linux-uclibc*) targ_emul=crislinux ;;
- cris-*-*)             targ_emul=criself
-                       targ_extra_emuls="crisaout crislinux"
-                       targ_extra_libpath=$targ_extra_emuls ;;
-@@ -60,14 +61,16 @@
-                       tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
-                       tdir_sun4=sparc-sun-sunos4
-                       ;;
--sparc64-*-linux-gnu*) targ_emul=elf64_sparc
-+sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)        \
-+                      targ_emul=elf64_sparc
-                       targ_extra_emuls="elf32_sparc sparclinux sun4"
-                       targ_extra_libpath=elf32_sparc
-                       tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
-                       tdir_sparclinux=${tdir_elf32_sparc}aout
-                       tdir_sun4=sparc-sun-sunos4
-                       ;;
--sparc*-*-linux-gnu*)  targ_emul=elf32_sparc
-+sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
-+                      targ_emul=elf32_sparc
-                       targ_extra_emuls="sparclinux elf64_sparc sun4"
-                       targ_extra_libpath=elf64_sparc
-                       tdir_sparclinux=${targ_alias}aout
-@@ -119,7 +122,9 @@
- m32r*le-*-elf*)         targ_emul=m32rlelf ;;
- m32r*-*-elf*)           targ_emul=m32relf ;;
- m32r*le-*-linux-gnu*)   targ_emul=m32rlelf_linux ;;
-+m32r*le-*-linux-uclibc*) targ_emul=m32rlelf_linux ;;
- m32r*-*-linux-gnu*)     targ_emul=m32relf_linux ;;
-+m32r*-*-linux-uclibc*)  targ_emul=m32relf_linux ;;
- m68hc11-*-*|m6811-*-*)        targ_emul=m68hc11elf 
-                       targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
- m68hc12-*-*|m6812-*-*)        targ_emul=m68hc12elf 
-@@ -129,7 +134,7 @@
- m68*-ericsson-ose)    targ_emul=sun3 ;;
- m68*-apple-aux*)      targ_emul=m68kaux ;;
- *-tandem-none)                targ_emul=st2000 ;;
--i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
-+i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
- i[3-7]86-*-nto-qnx*)  targ_emul=i386nto ;;
- i[3-7]86-*-vsta)      targ_emul=vsta ;;
- i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
-@@ -153,14 +158,16 @@
-                       tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
-                       ;;
- i[3-7]86-*-linux*oldld)       targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
--i[3-7]86-*-linux-gnu*)        targ_emul=elf_i386
-+i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
-+                      targ_emul=elf_i386
-                       targ_extra_emuls=i386linux
-                       if test x${want64} = xtrue; then
-                         targ_extra_emuls="$targ_extra_emuls elf_x86_64"
-                       fi
-                       tdir_i386linux=${targ_alias}aout
-                       ;;
--x86_64-*-linux-gnu*)  targ_emul=elf_x86_64
-+x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
-+                      targ_emul=elf_x86_64
-                       targ_extra_emuls="elf_i386 i386linux"
-                       targ_extra_libpath=elf_i386
-                       tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
-@@ -260,10 +267,13 @@
- arm9e-*-elf)          targ_emul=armelf ;;
- arm-*-oabi)           targ_emul=armelf_oabi ;;
- arm*b-*-linux-gnu*)   targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
-+arm*b-*-linux-uclibc*)        targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
- arm*-*-linux-gnu*)    targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
-+arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- arm*-*-uclinux*)      targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- arm*-*-conix*)                targ_emul=armelf ;;
--thumb-*-linux-gnu* | thumb-*-uclinux*)        targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
-+thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
-+                      targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- strongarm-*-coff)     targ_emul=armcoff ;;
- strongarm-*-elf)      targ_emul=armelf ;;
- strongarm-*-kaos*)    targ_emul=armelf ;;
-@@ -365,7 +375,8 @@
-                       targ_extra_emuls=m68kelf
-                       tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
-                       ;;
--m68k-*-linux-gnu*)    targ_emul=m68kelf
-+m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
-+                      targ_emul=m68kelf
-                       targ_extra_emuls=m68klinux
-                       tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
-                       ;;
-@@ -382,9 +393,9 @@
- m68*-*-psos*)         targ_emul=m68kpsos ;;
- m68*-*-rtemscoff*)    targ_emul=m68kcoff ;;
- m68*-*-rtems*)                targ_emul=m68kelf ;;
--hppa*64*-*-linux-gnu*)        targ_emul=hppa64linux ;;
-+hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)  targ_emul=hppa64linux ;;
- hppa*64*-*)           targ_emul=elf64hppa ;;
--hppa*-*-linux-gnu*)   targ_emul=hppalinux ;;
-+hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*)   targ_emul=hppalinux ;;
- hppa*-*-*elf*)                targ_emul=hppaelf ;;
- hppa*-*-lites*)               targ_emul=hppaelf ;;
- hppa*-*-netbsd*)      targ_emul=hppanbsd ;;
-@@ -397,6 +408,7 @@
-                       targ_emul=vaxnbsd
-                       targ_extra_emuls=elf32vax ;;
- vax-*-linux-gnu*)     targ_emul=elf32vax ;;
-+vax-*-linux-uclibc*)  targ_emul=elf32vax ;;
- mips*-*-pe)           targ_emul=mipspe ;
-                       targ_extra_ofiles="deffilep.o pe-dll.o" ;;
- mips*-dec-ultrix*)    targ_emul=mipslit ;;
-@@ -430,16 +442,16 @@
- mips*-*-vxworks*)     targ_emul=elf32ebmip
-                       targ_extra_emuls="elf32elmip" ;;
- mips*-*-windiss)      targ_emul=elf32mipswindiss ;;
--mips64*el-*-linux-gnu*)       targ_emul=elf32ltsmipn32
-+mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*)   targ_emul=elf32ltsmipn32
-                       targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
-                       ;;
--mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
-+mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*)       targ_emul=elf32btsmipn32
-                       targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
-                       ;;
--mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
-+mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*)       targ_emul=elf32ltsmip
-                       targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
-                       ;;
--mips*-*-linux-gnu*)   targ_emul=elf32btsmip
-+mips*-*-linux-gnu* | mips*-*-linux-uclibc*)   targ_emul=elf32btsmip
-                       targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
-                       ;;
- mips*-*-lnews*)               targ_emul=mipslnews ;;
-@@ -462,6 +474,10 @@
- alpha*-*-linux-gnu*)  targ_emul=elf64alpha targ_extra_emuls=alpha
-                       tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
-                       ;;
-+alpha*-*-linux-uclibc*)       targ_emul=elf64alpha targ_extra_emuls=alpha
-+                      # The following needs to be checked...
-+                      tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
-+                      ;;
- alpha*-*-osf*)                targ_emul=alpha ;;
- alpha*-*-gnu*)                targ_emul=elf64alpha ;;
- alpha*-*-netware*)    targ_emul=alpha ;;
-diff -urN binutils-2.15.91.0.1-dist/libtool.m4 binutils-2.15.91.0.1/libtool.m4
---- binutils-2.15.91.0.1-dist/libtool.m4       2003-05-05 16:46:46.000000000 -0500
-+++ binutils-2.15.91.0.1/libtool.m4    2004-07-16 14:57:21.000000000 -0500
-@@ -645,6 +645,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
-diff -urN binutils-2.15.91.0.1-dist/ltconfig binutils-2.15.91.0.1/ltconfig
---- binutils-2.15.91.0.1-dist/ltconfig 2004-01-14 15:07:42.000000000 -0600
-+++ binutils-2.15.91.0.1/ltconfig      2004-07-16 14:57:21.000000000 -0500
-@@ -603,6 +603,7 @@
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case $host_os in
- linux-gnu*) ;;
-+linux-uclibc*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
-@@ -1259,6 +1260,24 @@
-   dynamic_linker='GNU/Linux ld.so'
-   ;;
-+linux-uclibc*)
-+  version_type=linux
-+  need_lib_prefix=no
-+  need_version=no
-+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-+  soname_spec='${libname}${release}.so$major'
-+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-+  shlibpath_var=LD_LIBRARY_PATH
-+  shlibpath_overrides_runpath=no
-+  # This implies no fast_install, which is unacceptable.
-+  # Some rework will be needed to allow for fast_install
-+  # before this can be enabled.
-+  # Note: copied from linux-gnu, and may not be appropriate.
-+  hardcode_into_libs=yes
-+  # Assume using the uClibc dynamic linker.
-+  dynamic_linker="uClibc ld.so"
-+  ;;
-+
- netbsd*)
-   need_lib_prefix=no
-   need_version=no
-diff -urN binutils-2.15.91.0.1-dist/opcodes/configure binutils-2.15.91.0.1/opcodes/configure
---- binutils-2.15.91.0.1-dist/opcodes/configure        2004-04-12 14:56:38.000000000 -0500
-+++ binutils-2.15.91.0.1/opcodes/configure     2004-07-27 21:55:25.000000000 -0500
-@@ -1690,6 +1690,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
diff --git a/openwrt/toolchain/binutils/2.15.91.0.1/600-arm-textrel.patch b/openwrt/toolchain/binutils/2.15.91.0.1/600-arm-textrel.patch
deleted file mode 100644 (file)
index 73d5b9d..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-http://sources.redhat.com/ml/binutils/2004-06/msg00010.html
---- binutils-2.15.90.0.3-old/bfd/elf32-arm.h   2004-04-12 14:56:33.000000000 -0500
-+++ binutils-2.15.90.0.3/bfd/elf32-arm.h       2004-09-03 06:56:40.000000000 -0500
-@@ -87,6 +87,8 @@
- #endif
- static bfd_boolean allocate_dynrelocs 
-   PARAMS ((struct elf_link_hash_entry *h, PTR inf));
-+static bfd_boolean elf32_arm_readonly_dynrelocs
-+  PARAMS ((struct elf_link_hash_entry *, PTR));
- static bfd_boolean create_got_section 
-   PARAMS ((bfd * dynobj, struct bfd_link_info * info));
- static bfd_boolean elf32_arm_create_dynamic_sections 
-@@ -3531,6 +3533,37 @@
-   return TRUE;
- }
-+/* Find any dynamic relocs that apply to read-only sections.  */
-+
-+static bfd_boolean
-+elf32_arm_readonly_dynrelocs (h, inf)
-+     struct elf_link_hash_entry *h;
-+     PTR inf;
-+{
-+  struct elf32_arm_link_hash_entry *eh;
-+  struct elf32_arm_relocs_copied *p;
-+
-+  if (h->root.type == bfd_link_hash_warning)
-+    h = (struct elf_link_hash_entry *) h->root.u.i.link;
-+
-+  eh = (struct elf32_arm_link_hash_entry *) h;
-+  for (p = eh->relocs_copied; p != NULL; p = p->next)
-+    {
-+      asection *s = p->section;
-+
-+      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-+       {
-+         struct bfd_link_info *info = (struct bfd_link_info *) inf;
-+
-+         info->flags |= DF_TEXTREL;
-+
-+         /* Not an error, just cut short the traversal.  */
-+         return FALSE;
-+       }
-+    }
-+  return TRUE;
-+}
-+
- /* Set the sizes of the dynamic sections.  */
- static bfd_boolean
-@@ -3740,6 +3773,12 @@
-           return FALSE;
-       }
-+      /* If any dynamic relocs apply to a read-only section,
-+         then we need a DT_TEXTREL entry.  */
-+      if ((info->flags & DF_TEXTREL) == 0)
-+        elf_link_hash_traverse (&htab->root, elf32_arm_readonly_dynrelocs,
-+                                (PTR) info);
-+
-       if ((info->flags & DF_TEXTREL) != 0)
-       {
-         if (!add_dynamic_entry (DT_TEXTREL, 0))
diff --git a/openwrt/toolchain/binutils/2.15.91.0.2/100-uclibc-conf.patch b/openwrt/toolchain/binutils/2.15.91.0.2/100-uclibc-conf.patch
deleted file mode 100644 (file)
index 911bef4..0000000
+++ /dev/null
@@ -1,722 +0,0 @@
-diff -urN binutils-2.15.91.0.2-dist/bfd/config.bfd binutils-2.15.91.0.2/bfd/config.bfd
---- binutils-2.15.91.0.2-dist/bfd/config.bfd   2004-07-27 23:36:07.000000000 -0500
-+++ binutils-2.15.91.0.2/bfd/config.bfd        2004-09-28 14:33:13.000000000 -0500
-@@ -129,7 +129,7 @@
-     targ_defvec=ecoffalpha_little_vec
-     targ_selvecs=bfd_elf64_alpha_vec
-     ;;
--  alpha*-*-linux-gnu* | alpha*-*-elf*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
-     targ_defvec=bfd_elf64_alpha_vec
-     targ_selvecs=ecoffalpha_little_vec
-     ;;
-@@ -139,7 +139,7 @@
-   alpha*-*-*)
-     targ_defvec=ecoffalpha_little_vec
-     ;;
--  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
-+  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-linux-uclibc* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
-     targ_defvec=bfd_elf64_ia64_little_vec
-     targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
-     ;;
-@@ -216,7 +216,7 @@
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
--  armeb-*-elf | arm*b-*-linux-gnu*)
-+  armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_bigarm_vec
-     targ_selvecs=bfd_elf32_littlearm_vec
-     ;;
-@@ -224,7 +224,7 @@
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
--  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
-+  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | arm*-*-conix* | \
-   arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-@@ -373,7 +373,7 @@
-     ;;
- #ifdef BFD64
--  hppa*64*-*-linux-gnu*)
-+  hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_hppa_linux_vec
-     targ_selvecs=bfd_elf64_hppa_vec
-     ;;
-@@ -384,7 +384,7 @@
-     ;;
- #endif
--  hppa*-*-linux-gnu* | hppa*-*-netbsd*)
-+  hppa*-*-linux-gnu* | hppa*-*-linux-uclibc* | hppa*-*-netbsd*)
-     targ_defvec=bfd_elf32_hppa_linux_vec
-     targ_selvecs=bfd_elf32_hppa_vec
-     ;;
-@@ -507,7 +507,7 @@
-     targ_selvecs=bfd_elf32_i386_vec
-     targ_underscore=yes
-     ;;
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_i386_vec
-     targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
-     targ64_selvecs=bfd_elf64_x86_64_vec
-@@ -521,7 +521,7 @@
-     targ_defvec=bfd_elf64_x86_64_vec
-     targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
-     ;;
--  x86_64-*-linux-gnu*)
-+  x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_x86_64_vec
-     targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
-     ;;
-@@ -696,7 +696,7 @@
-     targ_selvecs=bfd_elf32_m68k_vec
-     targ_underscore=yes
-     ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_m68k_vec
-     targ_selvecs=m68klinux_vec
-     ;;
-@@ -972,7 +972,8 @@
-     ;;
- #endif
-   powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
--  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
-+  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
-+  powerpc-*-rtems* | \
-   powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
-     targ_defvec=bfd_elf32_powerpc_vec
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
-@@ -1009,8 +1010,8 @@
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
-     ;;
-   powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
--  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
--  powerpcle-*-rtems*)
-+  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
-+  powerpcle-*-vxworks* | powerpcle-*-rtems*)
-     targ_defvec=bfd_elf32_powerpcle_vec
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
-     targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
-@@ -1177,7 +1178,7 @@
-     targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
-     targ_underscore=yes
-     ;;
--  sparc-*-linux-gnu*)
-+  sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_sparc_vec
-     targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
-     ;;
-@@ -1224,7 +1225,7 @@
-     targ_defvec=sunos_big_vec
-     targ_underscore=yes
-     ;;
--  sparc64-*-linux-gnu*)
-+  sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_sparc_vec
-     targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
-     ;;
-@@ -1293,7 +1294,7 @@
-     targ_underscore=yes
-     ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_vax_vec
-     ;;
-diff -urN binutils-2.15.91.0.2-dist/bfd/configure binutils-2.15.91.0.2/bfd/configure
---- binutils-2.15.91.0.2-dist/bfd/configure    2004-07-27 23:36:07.000000000 -0500
-+++ binutils-2.15.91.0.2/bfd/configure 2004-09-28 14:33:13.000000000 -0500
-@@ -1687,6 +1687,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -5266,7 +5271,7 @@
-   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
-       COREFILE=''
-       ;;
--  alpha*-*-linux-gnu*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/alphalinux.h"'
-       ;;
-@@ -5330,7 +5335,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386mach3.h"'
-       ;;
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386linux.h"'
-       ;;
-@@ -5368,7 +5373,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/hp300bsd.h"'
-       ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/m68klinux.h"'
-       ;;
-@@ -5472,7 +5477,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxult2.h"'
-       ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxlinux.h"'
-       ;;
-diff -urN binutils-2.15.91.0.2-dist/bfd/configure.in binutils-2.15.91.0.2/bfd/configure.in
---- binutils-2.15.91.0.2-dist/bfd/configure.in 2004-07-27 23:36:07.000000000 -0500
-+++ binutils-2.15.91.0.2/bfd/configure.in      2004-09-28 14:33:13.000000000 -0500
-@@ -164,7 +164,7 @@
-   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
-       COREFILE=''
-       ;;
--  alpha*-*-linux-gnu*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/alphalinux.h"'
-       ;;
-@@ -249,7 +249,7 @@
-       TRAD_HEADER='"hosts/i386mach3.h"'
-       ;;
- changequote(,)dnl
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
- changequote([,])dnl
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386linux.h"'
-@@ -290,7 +290,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/hp300bsd.h"'
-       ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/m68klinux.h"'
-       ;;
-@@ -378,7 +378,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxult2.h"'
-       ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxlinux.h"'
-       ;;
-diff -urN binutils-2.15.91.0.2-dist/binutils/configure binutils-2.15.91.0.2/binutils/configure
---- binutils-2.15.91.0.2-dist/binutils/configure       2004-04-12 14:56:34.000000000 -0500
-+++ binutils-2.15.91.0.2/binutils/configure    2004-09-28 14:33:13.000000000 -0500
-@@ -1575,6 +1575,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.15.91.0.2-dist/configure binutils-2.15.91.0.2/configure
---- binutils-2.15.91.0.2-dist/configure        2004-07-27 23:36:06.000000000 -0500
-+++ binutils-2.15.91.0.2/configure     2004-09-28 14:33:13.000000000 -0500
-@@ -1349,6 +1349,18 @@
-   i[3456789]86-*-coff | i[3456789]86-*-elf)
-     noconfigdirs="$noconfigdirs ${libgcj}"
-     ;;
-+  i[3456789]86-*-linux-uclibc*)
-+    # This section makes it possible to build newlib natively on linux.
-+    # If we are using a cross compiler then don't configure newlib.
-+    if test x${is_cross_compiler} != xno ; then
-+      noconfigdirs="$noconfigdirs target-newlib"
-+    fi
-+    noconfigdirs="$noconfigdirs target-libgloss"
-+    # If we are not using a cross compiler, do configure newlib.
-+    # Note however, that newlib will only be configured in this situation
-+    # if the --with-newlib option has been given, because otherwise
-+    # 'target-newlib' will appear in skipdirs.
-+    ;;
-   i[3456789]86-*-linux*)
-     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
-     # not build java stuff by default.
-diff -urN binutils-2.15.91.0.2-dist/configure.in binutils-2.15.91.0.2/configure.in
---- binutils-2.15.91.0.2-dist/configure.in     2004-07-27 23:36:06.000000000 -0500
-+++ binutils-2.15.91.0.2/configure.in  2004-09-28 14:33:13.000000000 -0500
-@@ -569,6 +569,18 @@
-   i[[3456789]]86-*-coff | i[[3456789]]86-*-elf)
-     noconfigdirs="$noconfigdirs ${libgcj}"
-     ;;
-+  i[[3456789]]86-*-linux-uclibc*)
-+    # This section makes it possible to build newlib natively on linux.
-+    # If we are using a cross compiler then don't configure newlib.
-+    if test x${is_cross_compiler} != xno ; then
-+      noconfigdirs="$noconfigdirs target-newlib"
-+    fi
-+    noconfigdirs="$noconfigdirs target-libgloss"
-+    # If we are not using a cross compiler, do configure newlib.
-+    # Note however, that newlib will only be configured in this situation
-+    # if the --with-newlib option has been given, because otherwise
-+    # 'target-newlib' will appear in skipdirs.
-+    ;;
-   i[[3456789]]86-*-linux*)
-     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
-     # not build java stuff by default.
-diff -urN binutils-2.15.91.0.2-dist/gas/configure binutils-2.15.91.0.2/gas/configure
---- binutils-2.15.91.0.2-dist/gas/configure    2004-07-27 23:36:09.000000000 -0500
-+++ binutils-2.15.91.0.2/gas/configure 2004-09-28 14:33:13.000000000 -0500
-@@ -3408,6 +3408,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -4234,6 +4239,7 @@
-       alpha*-*-osf*)                  fmt=ecoff ;;
-       alpha*-*-linuxecoff*)           fmt=ecoff ;;
-       alpha*-*-linux-gnu*)            fmt=elf em=linux ;;
-+      alpha*-*-linux-uclibc*)         fmt=elf em=linux ;;
-       alpha*-*-netbsd*)                       fmt=elf em=nbsd ;;
-       alpha*-*-openbsd*)              fmt=elf em=obsd ;;
-@@ -4250,6 +4256,7 @@
-       arm*-*-conix*)                  fmt=elf ;;
-       arm-*-linux*aout*)              fmt=aout em=linux ;;
-       arm*-*-linux-gnu*)              fmt=elf  em=linux ;;
-+      arm*-*-linux-uclibc*)           fmt=elf  em=linux ;;
-       arm*-*-uclinux*)                        fmt=elf  em=linux ;;
-       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
-       arm-*-*n*bsd*)                  fmt=aout em=nbsd ;;
-@@ -4263,6 +4270,7 @@
-       avr-*-*)                                fmt=elf ;;
-       cris-*-linux-gnu*)              fmt=multi bfd_gas=yes em=linux ;;
-+      cris-*-linux-uclibc*)           fmt=multi bfd_gas=yes em=linux ;;
-       cris-*-*)                               fmt=multi bfd_gas=yes ;;
-       crx-*-elf*)                     fmt=elf ;;
-@@ -4322,7 +4330,9 @@
-       i386-*-linux*oldld)             fmt=aout em=linux ;;
-       i386-*-linux*coff*)             fmt=coff em=linux ;;
-       i386-*-linux-gnu*)              fmt=elf em=linux ;;
-+      i386-*-linux-uclibc*)           fmt=elf em=linux ;;
-       x86_64-*-linux-gnu*)            fmt=elf em=linux ;;
-+      x86_64-*-linux-uclibc*)         fmt=elf em=linux ;;
-       i386-*-lynxos*)                 fmt=elf em=lynx bfd_gas=yes ;;
-       i386-*-sysv[45]*)                       fmt=elf ;;
-       i386-*-solaris*)                        fmt=elf ;;
-@@ -4382,6 +4392,7 @@
-       ia64-*-elf*)                    fmt=elf ;;
-       ia64-*-aix*)                    fmt=elf em=ia64aix ;;
-       ia64-*-linux-gnu*)              fmt=elf em=linux ;;
-+      ia64-*-linux-uclibc*)           fmt=elf em=linux ;;
-       ia64-*-hpux*)                   fmt=elf em=hpux ;;
-       ia64-*-netbsd*)                 fmt=elf em=nbsd ;;
-@@ -4409,6 +4420,7 @@
-       m68k-*-hpux*)                   fmt=hp300 em=hp300 ;;
-       m68k-*-linux*aout*)             fmt=aout em=linux ;;
-       m68k-*-linux-gnu*)              fmt=elf em=linux ;;
-+      m68k-*-linux-uclibc*)           fmt=elf em=linux ;;
-       m68k-*-uclinux*)                        fmt=elf ;;
-       m68k-*-gnu*)                    fmt=elf ;;
-       m68k-*-lynxos*)                 fmt=coff em=lynx ;;
-@@ -4471,6 +4483,7 @@
-       ppc-*-beos*)                    fmt=coff ;;
-       ppc-*-*n*bsd* | ppc-*-elf*)     fmt=elf ;;
-       ppc-*-eabi* | ppc-*-sysv4*)     fmt=elf ;;
-+      ppc-*-linux-uclibc* | \
-       ppc-*-linux-gnu*)                       fmt=elf em=linux
-           case "$endian" in
-               big)  ;;
-@@ -4498,7 +4511,9 @@
-       ppc-*-lynxos*)                  fmt=elf em=lynx bfd_gas=yes ;;
-       s390x-*-linux-gnu*)             fmt=elf em=linux ;;
-+      s390x-*-linux-uclibc*)          fmt=elf em=linux ;;
-       s390-*-linux-gnu*)              fmt=elf em=linux ;;
-+      s390-*-linux-uclibc*)           fmt=elf em=linux ;;
-       sh*-*-linux*)                   fmt=elf em=linux
-           case ${cpu} in
-@@ -4538,6 +4553,7 @@
-       sparc-*-coff)                   fmt=coff ;;
-       sparc-*-linux*aout*)            fmt=aout em=linux ;;
-       sparc-*-linux-gnu*)             fmt=elf em=linux ;;
-+      sparc-*-linux-uclibc*)          fmt=elf em=linux ;;
-       sparc-*-lynxos*)                        fmt=coff em=lynx ;;
-       sparc-fujitsu-none)             fmt=aout ;;
-       sparc-*-elf)                    fmt=elf ;;
-diff -urN binutils-2.15.91.0.2-dist/gas/configure.in binutils-2.15.91.0.2/gas/configure.in
---- binutils-2.15.91.0.2-dist/gas/configure.in 2004-07-27 23:36:09.000000000 -0500
-+++ binutils-2.15.91.0.2/gas/configure.in      2004-09-28 14:33:13.000000000 -0500
-@@ -195,6 +195,7 @@
-       alpha*-*-osf*)                  fmt=ecoff ;;
-       alpha*-*-linuxecoff*)           fmt=ecoff ;;
-       alpha*-*-linux-gnu*)            fmt=elf em=linux ;;
-+      alpha*-*-linux-uclibc*)         fmt=elf em=linux ;;
-       alpha*-*-netbsd*)                       fmt=elf em=nbsd ;;
-       alpha*-*-openbsd*)              fmt=elf em=obsd ;;
-@@ -211,6 +212,7 @@
-       arm*-*-conix*)                  fmt=elf ;;
-       arm-*-linux*aout*)              fmt=aout em=linux ;;
-       arm*-*-linux-gnu*)              fmt=elf  em=linux ;;
-+      arm*-*-linux-uclibc*)           fmt=elf  em=linux ;;
-       arm*-*-uclinux*)                        fmt=elf  em=linux ;;
-       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
-       arm-*-*n*bsd*)                  fmt=aout em=nbsd ;;
-@@ -224,6 +226,7 @@
-       avr-*-*)                                fmt=elf ;;
-       cris-*-linux-gnu*)              fmt=multi bfd_gas=yes em=linux ;;
-+      cris-*-linux-uclibc*)           fmt=multi bfd_gas=yes em=linux ;;
-       cris-*-*)                               fmt=multi bfd_gas=yes ;;
-       crx-*-elf*)                     fmt=elf ;;
-@@ -283,7 +286,9 @@
-       i386-*-linux*oldld)             fmt=aout em=linux ;;
-       i386-*-linux*coff*)             fmt=coff em=linux ;;
-       i386-*-linux-gnu*)              fmt=elf em=linux ;;
-+      i386-*-linux-uclibc*)           fmt=elf em=linux ;;
-       x86_64-*-linux-gnu*)            fmt=elf em=linux ;;
-+      x86_64-*-linux-uclibc*)         fmt=elf em=linux ;;
-       i386-*-lynxos*)                 fmt=elf em=lynx bfd_gas=yes ;;
- changequote(,)dnl
-       i386-*-sysv[45]*)                       fmt=elf ;;
-@@ -336,6 +341,7 @@
-       ia64-*-elf*)                    fmt=elf ;;
-       ia64-*-aix*)                    fmt=elf em=ia64aix ;;
-       ia64-*-linux-gnu*)              fmt=elf em=linux ;;
-+      ia64-*-linux-uclibc*)           fmt=elf em=linux ;;
-       ia64-*-hpux*)                   fmt=elf em=hpux ;;
-       ia64-*-netbsd*)                 fmt=elf em=nbsd ;;
-@@ -363,6 +369,7 @@
-       m68k-*-hpux*)                   fmt=hp300 em=hp300 ;;
-       m68k-*-linux*aout*)             fmt=aout em=linux ;;
-       m68k-*-linux-gnu*)              fmt=elf em=linux ;;
-+      m68k-*-linux-uclibc*)           fmt=elf em=linux ;;
-       m68k-*-uclinux*)                        fmt=elf ;;
-       m68k-*-gnu*)                    fmt=elf ;;
-       m68k-*-lynxos*)                 fmt=coff em=lynx ;;
-@@ -422,6 +429,7 @@
-       ppc-*-beos*)                    fmt=coff ;;
-       ppc-*-*n*bsd* | ppc-*-elf*)     fmt=elf ;;
-       ppc-*-eabi* | ppc-*-sysv4*)     fmt=elf ;;
-+      ppc-*-linux-uclibc* | \
-       ppc-*-linux-gnu*)                       fmt=elf em=linux
-           case "$endian" in
-               big)  ;;
-@@ -442,7 +450,9 @@
-       ppc-*-lynxos*)                  fmt=elf em=lynx bfd_gas=yes ;;
-       s390x-*-linux-gnu*)             fmt=elf em=linux ;;
-+      s390x-*-linux-uclibc*)          fmt=elf em=linux ;;
-       s390-*-linux-gnu*)              fmt=elf em=linux ;;
-+      s390-*-linux-uclibc*)           fmt=elf em=linux ;;
-       sh*-*-linux*)                   fmt=elf em=linux
-           case ${cpu} in
-@@ -478,6 +488,7 @@
-       sparc-*-coff)                   fmt=coff ;;
-       sparc-*-linux*aout*)            fmt=aout em=linux ;;
-       sparc-*-linux-gnu*)             fmt=elf em=linux ;;
-+      sparc-*-linux-uclibc*)          fmt=elf em=linux ;;
-       sparc-*-lynxos*)                        fmt=coff em=lynx ;;
-       sparc-fujitsu-none)             fmt=aout ;;
-       sparc-*-elf)                    fmt=elf ;;
-diff -urN binutils-2.15.91.0.2-dist/gprof/configure binutils-2.15.91.0.2/gprof/configure
---- binutils-2.15.91.0.2-dist/gprof/configure  2004-07-27 23:36:10.000000000 -0500
-+++ binutils-2.15.91.0.2/gprof/configure       2004-09-28 14:33:13.000000000 -0500
-@@ -3401,6 +3401,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.15.91.0.2-dist/ld/configure binutils-2.15.91.0.2/ld/configure
---- binutils-2.15.91.0.2-dist/ld/configure     2004-07-27 23:36:11.000000000 -0500
-+++ binutils-2.15.91.0.2/ld/configure  2004-09-28 14:33:13.000000000 -0500
-@@ -1578,6 +1578,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.15.91.0.2-dist/ld/configure.tgt binutils-2.15.91.0.2/ld/configure.tgt
---- binutils-2.15.91.0.2-dist/ld/configure.tgt 2004-07-27 23:36:11.000000000 -0500
-+++ binutils-2.15.91.0.2/ld/configure.tgt      2004-09-28 14:33:13.000000000 -0500
-@@ -31,6 +31,7 @@
-                       targ_extra_emuls="criself crislinux"
-                       targ_extra_libpath=$targ_extra_emuls ;;
- cris-*-linux-gnu*)    targ_emul=crislinux ;;
-+cris-*-linux-uclibc*) targ_emul=crislinux ;;
- cris-*-*)             targ_emul=criself
-                       targ_extra_emuls="crisaout crislinux"
-                       targ_extra_libpath=$targ_extra_emuls ;;
-@@ -61,14 +62,16 @@
-                       tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
-                       tdir_sun4=sparc-sun-sunos4
-                       ;;
--sparc64-*-linux-gnu*) targ_emul=elf64_sparc
-+sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)        \
-+                      targ_emul=elf64_sparc
-                       targ_extra_emuls="elf32_sparc sparclinux sun4"
-                       targ_extra_libpath=elf32_sparc
-                       tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
-                       tdir_sparclinux=${tdir_elf32_sparc}aout
-                       tdir_sun4=sparc-sun-sunos4
-                       ;;
--sparc*-*-linux-gnu*)  targ_emul=elf32_sparc
-+sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
-+                      targ_emul=elf32_sparc
-                       targ_extra_emuls="sparclinux elf64_sparc sun4"
-                       targ_extra_libpath=elf64_sparc
-                       tdir_sparclinux=${targ_alias}aout
-@@ -120,7 +123,9 @@
- m32r*le-*-elf*)         targ_emul=m32rlelf ;;
- m32r*-*-elf*)           targ_emul=m32relf ;;
- m32r*le-*-linux-gnu*)   targ_emul=m32rlelf_linux ;;
-+m32r*le-*-linux-uclibc*) targ_emul=m32rlelf_linux ;;
- m32r*-*-linux-gnu*)     targ_emul=m32relf_linux ;;
-+m32r*-*-linux-uclibc*)  targ_emul=m32relf_linux ;;
- m68hc11-*-*|m6811-*-*)        targ_emul=m68hc11elf 
-                       targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
- m68hc12-*-*|m6812-*-*)        targ_emul=m68hc12elf 
-@@ -130,7 +135,7 @@
- m68*-ericsson-ose)    targ_emul=sun3 ;;
- m68*-apple-aux*)      targ_emul=m68kaux ;;
- *-tandem-none)                targ_emul=st2000 ;;
--i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
-+i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
- i[3-7]86-*-nto-qnx*)  targ_emul=i386nto ;;
- i[3-7]86-*-vsta)      targ_emul=vsta ;;
- i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
-@@ -154,14 +159,16 @@
-                       tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
-                       ;;
- i[3-7]86-*-linux*oldld)       targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
--i[3-7]86-*-linux-gnu*)        targ_emul=elf_i386
-+i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
-+                      targ_emul=elf_i386
-                       targ_extra_emuls=i386linux
-                       if test x${want64} = xtrue; then
-                         targ_extra_emuls="$targ_extra_emuls elf_x86_64"
-                       fi
-                       tdir_i386linux=${targ_alias}aout
-                       ;;
--x86_64-*-linux-gnu*)  targ_emul=elf_x86_64
-+x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
-+                      targ_emul=elf_x86_64
-                       targ_extra_emuls="elf_i386 i386linux"
-                       targ_extra_libpath=elf_i386
-                       tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
-@@ -261,10 +268,13 @@
- arm9e-*-elf)          targ_emul=armelf ;;
- arm-*-oabi)           targ_emul=armelf_oabi ;;
- arm*b-*-linux-gnu*)   targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
-+arm*b-*-linux-uclibc*)        targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
- arm*-*-linux-gnu*)    targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
-+arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- arm*-*-uclinux*)      targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- arm*-*-conix*)                targ_emul=armelf ;;
--thumb-*-linux-gnu* | thumb-*-uclinux*)        targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
-+thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
-+                      targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- strongarm-*-coff)     targ_emul=armcoff ;;
- strongarm-*-elf)      targ_emul=armelf ;;
- strongarm-*-kaos*)    targ_emul=armelf ;;
-@@ -369,7 +379,8 @@
-                       targ_extra_emuls=m68kelf
-                       tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
-                       ;;
--m68k-*-linux-gnu*)    targ_emul=m68kelf
-+m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
-+                      targ_emul=m68kelf
-                       targ_extra_emuls=m68klinux
-                       tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
-                       ;;
-@@ -386,9 +397,9 @@
- m68*-*-psos*)         targ_emul=m68kpsos ;;
- m68*-*-rtemscoff*)    targ_emul=m68kcoff ;;
- m68*-*-rtems*)                targ_emul=m68kelf ;;
--hppa*64*-*-linux-gnu*)        targ_emul=hppa64linux ;;
-+hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)  targ_emul=hppa64linux ;;
- hppa*64*-*)           targ_emul=elf64hppa ;;
--hppa*-*-linux-gnu*)   targ_emul=hppalinux ;;
-+hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*)   targ_emul=hppalinux ;;
- hppa*-*-*elf*)                targ_emul=hppaelf ;;
- hppa*-*-lites*)               targ_emul=hppaelf ;;
- hppa*-*-netbsd*)      targ_emul=hppanbsd ;;
-@@ -401,6 +412,7 @@
-                       targ_emul=vaxnbsd
-                       targ_extra_emuls=elf32vax ;;
- vax-*-linux-gnu*)     targ_emul=elf32vax ;;
-+vax-*-linux-uclibc*)  targ_emul=elf32vax ;;
- mips*-*-pe)           targ_emul=mipspe ;
-                       targ_extra_ofiles="deffilep.o pe-dll.o" ;;
- mips*-dec-ultrix*)    targ_emul=mipslit ;;
-@@ -434,16 +446,16 @@
- mips*-*-vxworks*)     targ_emul=elf32ebmip
-                       targ_extra_emuls="elf32elmip" ;;
- mips*-*-windiss)      targ_emul=elf32mipswindiss ;;
--mips64*el-*-linux-gnu*)       targ_emul=elf32ltsmipn32
-+mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*)   targ_emul=elf32ltsmipn32
-                       targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
-                       ;;
--mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
-+mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*)       targ_emul=elf32btsmipn32
-                       targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
-                       ;;
--mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
-+mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*)       targ_emul=elf32ltsmip
-                       targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
-                       ;;
--mips*-*-linux-gnu*)   targ_emul=elf32btsmip
-+mips*-*-linux-gnu* | mips*-*-linux-uclibc*)   targ_emul=elf32btsmip
-                       targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
-                       ;;
- mips*-*-lnews*)               targ_emul=mipslnews ;;
-@@ -466,6 +478,10 @@
- alpha*-*-linux-gnu*)  targ_emul=elf64alpha targ_extra_emuls=alpha
-                       tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
-                       ;;
-+alpha*-*-linux-uclibc*)       targ_emul=elf64alpha targ_extra_emuls=alpha
-+                      # The following needs to be checked...
-+                      tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
-+                      ;;
- alpha*-*-osf*)                targ_emul=alpha ;;
- alpha*-*-gnu*)                targ_emul=elf64alpha ;;
- alpha*-*-netware*)    targ_emul=alpha ;;
-diff -urN binutils-2.15.91.0.2-dist/ld/emultempl/elf32.em binutils-2.15.91.0.2/ld/emultempl/elf32.em
---- binutils-2.15.91.0.2-dist/ld/emultempl/elf32.em    2004-07-27 23:36:11.000000000 -0500
-+++ binutils-2.15.91.0.2/ld/emultempl/elf32.em 2004-09-28 14:33:54.000000000 -0500
-@@ -327,7 +327,7 @@
- EOF
- case ${target} in
--  *-*-linux-gnu*)
-+  *-*-linux-gnu* | *-*-linux-uclibc*)
-     cat >>e${EMULATION_NAME}.c <<EOF
-         {
-           struct bfd_link_needed_list *l;
-@@ -500,7 +500,7 @@
- EOF
-   case ${target} in
--    *-*-linux-gnu*)
-+    *-*-linux-gnu* | *-*-linux-uclibc*)
-       cat >>e${EMULATION_NAME}.c <<EOF
- /* For a native linker, check the file /etc/ld.so.conf for directories
-    in which we may find shared libraries.  /etc/ld.so.conf is really
-@@ -784,7 +784,7 @@
- EOF
- if [ "x${USE_LIBPATH}" = xyes ] ; then
-   case ${target} in
--    *-*-linux-gnu*)
-+    *-*-linux-gnu* | *-*-linux-uclibc*)
-       cat >>e${EMULATION_NAME}.c <<EOF
-         if (gld${EMULATION_NAME}_check_ld_so_conf (l->name, force))
-           break;
-diff -urN binutils-2.15.91.0.2-dist/libtool.m4 binutils-2.15.91.0.2/libtool.m4
---- binutils-2.15.91.0.2-dist/libtool.m4       2004-07-27 23:36:06.000000000 -0500
-+++ binutils-2.15.91.0.2/libtool.m4    2004-09-28 14:33:13.000000000 -0500
-@@ -645,6 +645,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
-diff -urN binutils-2.15.91.0.2-dist/ltconfig binutils-2.15.91.0.2/ltconfig
---- binutils-2.15.91.0.2-dist/ltconfig 2004-07-27 23:36:06.000000000 -0500
-+++ binutils-2.15.91.0.2/ltconfig      2004-09-28 14:33:13.000000000 -0500
-@@ -603,6 +603,7 @@
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case $host_os in
- linux-gnu*) ;;
-+linux-uclibc*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
-@@ -1270,6 +1271,24 @@
-   dynamic_linker='GNU/Linux ld.so'
-   ;;
-+linux-uclibc*)
-+  version_type=linux
-+  need_lib_prefix=no
-+  need_version=no
-+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-+  soname_spec='${libname}${release}.so$major'
-+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-+  shlibpath_var=LD_LIBRARY_PATH
-+  shlibpath_overrides_runpath=no
-+  # This implies no fast_install, which is unacceptable.
-+  # Some rework will be needed to allow for fast_install
-+  # before this can be enabled.
-+  # Note: copied from linux-gnu, and may not be appropriate.
-+  hardcode_into_libs=yes
-+  # Assume using the uClibc dynamic linker.
-+  dynamic_linker="uClibc ld.so"
-+  ;;
-+
- netbsd*)
-   need_lib_prefix=no
-   need_version=no
-diff -urN binutils-2.15.91.0.2-dist/opcodes/configure binutils-2.15.91.0.2/opcodes/configure
---- binutils-2.15.91.0.2-dist/opcodes/configure        2004-07-27 23:36:11.000000000 -0500
-+++ binutils-2.15.91.0.2/opcodes/configure     2004-09-28 14:33:13.000000000 -0500
-@@ -1690,6 +1690,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
diff --git a/openwrt/toolchain/binutils/2.15.91.0.2/500-branch-likely.patch b/openwrt/toolchain/binutils/2.15.91.0.2/500-branch-likely.patch
deleted file mode 100644 (file)
index 0bb1a4b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- binutils-2.15.90.0.3/gas/config/tc-mips.c-dist     2004-08-19 12:56:20.000000000 -0500
-+++ binutils-2.15.90.0.3/gas/config/tc-mips.c  2004-08-19 12:57:30.000000000 -0500
-@@ -2708,6 +2708,7 @@
-         prev_insn_reloc_type[1] = BFD_RELOC_UNUSED;
-         prev_insn_reloc_type[2] = BFD_RELOC_UNUSED;
-         prev_insn_extended = 0;
-+        prev_insn_is_delay_slot = 1;
-       }
-       else
-       {
diff --git a/openwrt/toolchain/binutils/2.15.91.0.2/600-arm-textrel.patch b/openwrt/toolchain/binutils/2.15.91.0.2/600-arm-textrel.patch
deleted file mode 100644 (file)
index 73d5b9d..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-http://sources.redhat.com/ml/binutils/2004-06/msg00010.html
---- binutils-2.15.90.0.3-old/bfd/elf32-arm.h   2004-04-12 14:56:33.000000000 -0500
-+++ binutils-2.15.90.0.3/bfd/elf32-arm.h       2004-09-03 06:56:40.000000000 -0500
-@@ -87,6 +87,8 @@
- #endif
- static bfd_boolean allocate_dynrelocs 
-   PARAMS ((struct elf_link_hash_entry *h, PTR inf));
-+static bfd_boolean elf32_arm_readonly_dynrelocs
-+  PARAMS ((struct elf_link_hash_entry *, PTR));
- static bfd_boolean create_got_section 
-   PARAMS ((bfd * dynobj, struct bfd_link_info * info));
- static bfd_boolean elf32_arm_create_dynamic_sections 
-@@ -3531,6 +3533,37 @@
-   return TRUE;
- }
-+/* Find any dynamic relocs that apply to read-only sections.  */
-+
-+static bfd_boolean
-+elf32_arm_readonly_dynrelocs (h, inf)
-+     struct elf_link_hash_entry *h;
-+     PTR inf;
-+{
-+  struct elf32_arm_link_hash_entry *eh;
-+  struct elf32_arm_relocs_copied *p;
-+
-+  if (h->root.type == bfd_link_hash_warning)
-+    h = (struct elf_link_hash_entry *) h->root.u.i.link;
-+
-+  eh = (struct elf32_arm_link_hash_entry *) h;
-+  for (p = eh->relocs_copied; p != NULL; p = p->next)
-+    {
-+      asection *s = p->section;
-+
-+      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-+       {
-+         struct bfd_link_info *info = (struct bfd_link_info *) inf;
-+
-+         info->flags |= DF_TEXTREL;
-+
-+         /* Not an error, just cut short the traversal.  */
-+         return FALSE;
-+       }
-+    }
-+  return TRUE;
-+}
-+
- /* Set the sizes of the dynamic sections.  */
- static bfd_boolean
-@@ -3740,6 +3773,12 @@
-           return FALSE;
-       }
-+      /* If any dynamic relocs apply to a read-only section,
-+         then we need a DT_TEXTREL entry.  */
-+      if ((info->flags & DF_TEXTREL) == 0)
-+        elf_link_hash_traverse (&htab->root, elf32_arm_readonly_dynrelocs,
-+                                (PTR) info);
-+
-       if ((info->flags & DF_TEXTREL) != 0)
-       {
-         if (!add_dynamic_entry (DT_TEXTREL, 0))
diff --git a/openwrt/toolchain/binutils/2.15.91.0.2/700-binutils-20040817-linkonce.patch b/openwrt/toolchain/binutils/2.15.91.0.2/700-binutils-20040817-linkonce.patch
deleted file mode 100644 (file)
index 97fa6ee..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-From http://sources.redhat.com/ml/binutils/2004-08/msg00190.html
-
-Date: Tue, 17 Aug 2004 12:04:29 +0200
-From: Jakub Jelinek <jakub at redhat dot com>
-To: binutils at sources dot redhat dot com
-Subject: [PATCH] Fix `defined in discarded section' errors when building ia64 gcc
-Message-ID: <20040817100429.GL30497@sunsite.ms.mff.cuni.cz>
-Reply-To: Jakub Jelinek <jakub at redhat dot com>
-References: <20040817090201.GK30497@sunsite.ms.mff.cuni.cz>
-In-Reply-To: <20040817090201 dot GK30497 at sunsite dot ms dot mff dot cuni dot cz>
-
-On Tue, Aug 17, 2004 at 11:02:01AM +0200, Jakub Jelinek wrote:
-> Current gcc 3.4.x (at least gcc-3_4-rhl-branch) doesn't build with CVS
-> binutils (nor 2.15.91.0.2).
-> The problem is that libstdc++.so linking fails with:
-> `.gnu.linkonce.t._ZNSdD2Ev' referenced in section `.gnu.linkonce.ia64unw._ZNSdD2Ev' of .libs/sstream-inst.o: defined in discarded section `.gnu.linkonce.t._ZNSdD2Ev' of .libs/sstream-inst.o
-> The problem is that both io-inst.s and sstream-inst.s have
-> .gnu.linkonce.t._ZNSdD2Ev definition, but because io-inst.cc
-> also instantiates some templates sstream-inst.cc doesn't instantiate,
-> the inliner can do a better job in io-inst.cc.
-> The result is that _ZNSdD2Ev in io-inst.cc is a leaf routine, while
-> it is not in sstream-inst.cc (in assembly,
-> _ZNSdD2Ev in io-inst.s starts with .prologue and no .save directives,
-> while _ZNSdD2Ev] in sstream-inst.s has .prologue 12, 35 and some
-> .save directives.
-> IA-64 ABI allows leaf routines to have no unwind section at all,
-> which means .gnu.linkonce.ia64unw._ZNSdD2Ev is not created in
-> io-inst.o at all and as .gnu.linkonce.t._ZNSdD2Ev comes first
-> and wins, .gnu.linkonce.ia64unw._ZNSdD2Ev in sstream.o suddenly
-> references a discarded section.
-> 
-> Not sure what should be done here, but certainly the compiler
-> isn't at fault here, it is a binutils problem.
-> One fix could be to create empty .gnu.linkonce.ia64unw.* section
-> in assembler, another special case ia64 unwind sections in the linker.
-
-Here is a patch for the first possibility.
-It certainly makes libstdc++.so to link and even the unwind info looks
-good on brief skimming.
-
-2004-08-17  Jakub Jelinek  <jakub@redhat.com>
-
-       * config/tc-ia64.c (start_unwind_section): Add linkonce_empty
-       argument, don't do anything if current section is not
-       .gnu.linkonce.t.* and linkonce_empty is set.
-       (generate_unwind_image, dot_endp): Adjust callers, call
-       start_unwind_section (*, 1) if nothing will be put into the
-       section.
-
---- binutils/gas/config/tc-ia64.c.jj   2004-07-30 11:42:24.000000000 +0200
-+++ binutils/gas/config/tc-ia64.c      2004-08-17 13:45:04.288173205 +0200
-@@ -1,5 +1,6 @@
- /* tc-ia64.c -- Assembler for the HP/Intel IA-64 architecture.
--   Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-+   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004
-+   Free Software Foundation, Inc.
-    Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
-    This file is part of GAS, the GNU Assembler.
-@@ -3297,7 +3298,7 @@ static char *special_linkonce_name[] =
-   };
- static void
--start_unwind_section (const segT text_seg, int sec_index)
-+start_unwind_section (const segT text_seg, int sec_index, int linkonce_empty)
- {
-   /*
-     Use a slightly ugly scheme to derive the unwind section names from
-@@ -3359,6 +3360,8 @@ start_unwind_section (const segT text_se
-       prefix = special_linkonce_name [sec_index - SPECIAL_SECTION_UNWIND];
-       suffix += sizeof (".gnu.linkonce.t.") - 1;
-     }
-+  else if (linkonce_empty)
-+    return;
-   prefix_len = strlen (prefix);
-   suffix_len = strlen (suffix);
-@@ -3444,7 +3447,7 @@ generate_unwind_image (const segT text_s
-       expressionS exp;
-       bfd_reloc_code_real_type reloc;
--      start_unwind_section (text_seg, SPECIAL_SECTION_UNWIND_INFO);
-+      start_unwind_section (text_seg, SPECIAL_SECTION_UNWIND_INFO, 0);
-       /* Make sure the section has 4 byte alignment for ILP32 and
-        8 byte alignment for LP64.  */
-@@ -3485,6 +3488,8 @@ generate_unwind_image (const segT text_s
-         unwind.personality_routine = 0;
-       }
-     }
-+  else
-+    start_unwind_section (text_seg, SPECIAL_SECTION_UNWIND_INFO, 1);
-   free_saved_prologue_counts ();
-   unwind.list = unwind.tail = unwind.current_entry = NULL;
-@@ -4164,7 +4169,7 @@ dot_endp (dummy)
-       subseg_set (md.last_text_seg, 0);
-       unwind.proc_end = expr_build_dot ();
--      start_unwind_section (saved_seg, SPECIAL_SECTION_UNWIND);
-+      start_unwind_section (saved_seg, SPECIAL_SECTION_UNWIND, 0);
-       /* Make sure that section has 4 byte alignment for ILP32 and
-          8 byte alignment for LP64.  */
-@@ -4204,6 +4209,9 @@ dot_endp (dummy)
-                           bytes_per_address);
-     }
-+  else
-+    start_unwind_section (saved_seg, SPECIAL_SECTION_UNWIND, 1);
-+
-   subseg_set (saved_seg, saved_subseg);
-   /* Parse names of main and alternate entry points and set symbol sizes.  */
-
-
-       Jakub
-
diff --git a/openwrt/toolchain/binutils/2.15.91.0.2/701-binutils-dup-sections.patch b/openwrt/toolchain/binutils/2.15.91.0.2/701-binutils-dup-sections.patch
deleted file mode 100644 (file)
index 4e4934d..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-See http://sources.redhat.com/ml/binutils/2004-08/msg00256.html
-
-Date: Fri, 20 Aug 2004 21:13:43 -0400
-From: Daniel Jacobowitz <drow at false dot org>
-To: binutils at sources dot redhat dot com
-Subject: Re: Handle SEC_LINK_DUPLICATES_SAME_CONTENTS for arm-linux
-Message-ID: <20040821011342.GA30319@nevyn.them.org>
-Mail-Followup-To: binutils at sources dot redhat dot com
-References: <20040818145518.GA9774@nevyn.them.org> <20040819055040.GA11820@lucon.org> <20040819080034.GE21716@bubble.modra.org> <20040820173240.GA17678@nevyn.them.org> <20040821003737.GB16016@bubble.modra.org>
-In-Reply-To: <20040821003737 dot GB16016 at bubble dot modra dot org>
-
-On Sat, Aug 21, 2004 at 10:07:38AM +0930, Alan Modra wrote:
-> On Fri, Aug 20, 2004 at 01:32:40PM -0400, Daniel Jacobowitz wrote:
-> > Thanks.  How's this?
-> 
-> As you might have guessed from my rather slack review of your previous
-> patch, I trust you enough to give the OK without proper review.  But
-> since you asked...  :)
-
-Checked in as so.
-
--- 
-Daniel Jacobowitz
-
-[ rediffed against binutils-2.15.91.0.2, with some elbow grease ]
-
-2004-08-20  Daniel Jacobowitz  <dan@debian.org>
-
-       * elflink.c (_bfd_elf_section_already_linked): Handle
-       SEC_LINK_DUPLICATES_SAME_CONTENTS.
---- binutils-2.15.91.0.2/bfd/elflink.c.old     2004-07-27 21:36:08.000000000 -0700
-+++ binutils-2.15.91.0.2/bfd/elflink.c 2004-08-26 06:38:07.000000000 -0700
-@@ -9359,6 +9359,35 @@
-                 (_("%s: %s: warning: duplicate section `%s' has different size\n"),
-                  bfd_archive_filename (abfd), name);
-             break;
-+          case SEC_LINK_DUPLICATES_SAME_CONTENTS:
-+            if (sec->size != l->sec->size)
-+              (*_bfd_error_handler)
-+                (_("%B: duplicate section `%A' has different size\n"),
-+                 bfd_archive_filename (abfd), sec);
-+            else if (sec->size != 0)
-+              {
-+                bfd_byte *sec_contents, *l_sec_contents;
-+
-+                if (!bfd_malloc_and_get_section (abfd, sec, &sec_contents))
-+                  (*_bfd_error_handler)
-+                    (_("%B: warning: could not read contents of section `%A'\n"),
-+                     bfd_archive_filename (abfd), sec);
-+                else if (!bfd_malloc_and_get_section (l->sec->owner, l->sec,
-+                                                      &l_sec_contents))
-+                  (*_bfd_error_handler)
-+                    (_("%B: warning: could not read contents of section `%A'\n"),
-+                     bfd_archive_filename(l->sec->owner), l->sec);
-+                else if (memcmp (sec_contents, l_sec_contents, sec->size) != 0)
-+                  (*_bfd_error_handler)
-+                    (_("%B: warning: duplicate section `%A' has different contents\n"),
-+                     bfd_archive_filename (abfd), sec);
-+
-+                if (sec_contents)
-+                  free (sec_contents);
-+                if (l_sec_contents)
-+                  free (l_sec_contents);
-+              }
-+            break;
-           }
-         /* Set the output_section field so that lang_add_section
diff --git a/openwrt/toolchain/binutils/2.15.91.0.2/702-binutils-skip-comments.patch b/openwrt/toolchain/binutils/2.15.91.0.2/702-binutils-skip-comments.patch
deleted file mode 100644 (file)
index 804a17e..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
-Fixes
-localealias.s:544: Error: junk at end of line, first unrecognized character is `,' 
-when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
-
-Paths adjusted to match crosstool's patcher.
-
-Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
-From: Andreas Schwab <schwab at suse dot de>
-To: Nathan Sidwell <nathan at codesourcery dot com>
-Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
-Date: Fri, 23 Apr 2004 22:27:19 +0200
-Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
-
-Nathan Sidwell <nathan@codesourcery.com> writes:
-
-> Index: read.c
-> ===================================================================
-> RCS file: /cvs/src/src/gas/read.c,v
-> retrieving revision 1.76
-> diff -c -3 -p -r1.76 read.c
-> *** read.c   12 Mar 2004 17:48:12 -0000      1.76
-> --- read.c   18 Mar 2004 09:56:05 -0000
-> *************** read_a_source_file (char *name)
-> *** 1053,1059 ****
->   #endif
->        input_line_pointer--;
->        /* Report unknown char as ignored.  */
-> !      ignore_rest_of_line ();
->      }
->   
->   #ifdef md_after_pass_hook
-> --- 1053,1059 ----
->   #endif
->        input_line_pointer--;
->        /* Report unknown char as ignored.  */
-> !      demand_empty_rest_of_line ();
->      }
->   
->   #ifdef md_after_pass_hook
-
-This means that the unknown character is no longer ignored, despite the
-comment.  As a side effect a line starting with a line comment character
-not followed by APP in NO_APP mode now triggers an error instead of just a
-warning, breaking builds of glibc on m68k-linux.  Earlier in
-read_a_source_file where #APP is handled there is another comment that
-claims that unknown comments are ignored, when in fact they aren't (only
-the initial line comment character is skipped).
-
-Note that the presence of #APP will mess up the line counters, but
-that appears to be difficult to fix.
-
-Andreas.
-
-2004-04-23  Andreas Schwab  <schwab@suse.de>
-
-       * read.c (read_a_source_file): Ignore unknown text after line
-       comment character.  Fix misleading comment.
-
---- binutils/gas/read.c.~1.78.~        2004-04-23 08:58:23.000000000 +0200
-+++ binutils/gas/read.c        2004-04-23 21:49:01.000000000 +0200
-@@ -1,6 +1,6 @@
- /* read.c - read a source file -
-    Copyright 1986, 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
--   1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-+   1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
- This file is part of GAS, the GNU Assembler.
-@@ -950,10 +950,14 @@ read_a_source_file (char *name)
-             unsigned int new_length;
-             char *tmp_buf = 0;
--            bump_line_counters ();
-             s = input_line_pointer;
-             if (strncmp (s, "APP\n", 4))
--              continue;       /* We ignore it */
-+              {
-+                /* We ignore it */
-+                ignore_rest_of_line ();
-+                continue;
-+              }
-+            bump_line_counters ();
-             s += 4;
-             sb_new (&sbuf);
-@@ -1052,7 +1056,7 @@ read_a_source_file (char *name)
-           continue;
- #endif
-         input_line_pointer--;
--        /* Report unknown char as ignored.  */
-+        /* Report unknown char as error.  */
-         demand_empty_rest_of_line ();
-       }
-
--- 
-Andreas Schwab, SuSE Labs, schwab@suse.de
-SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
-Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
-"And now for something completely different."
diff --git a/openwrt/toolchain/binutils/2.15.92.0.2/100-uclibc-conf.patch b/openwrt/toolchain/binutils/2.15.92.0.2/100-uclibc-conf.patch
deleted file mode 100644 (file)
index 7fcbd62..0000000
+++ /dev/null
@@ -1,724 +0,0 @@
-diff -urN binutils-2.15.92.0.2-dist/bfd/config.bfd binutils-2.15.92.0.2/bfd/config.bfd
---- binutils-2.15.92.0.2-dist/bfd/config.bfd   2004-09-15 14:05:02.000000000 -0500
-+++ binutils-2.15.92.0.2/bfd/config.bfd        2004-09-28 14:11:57.000000000 -0500
-@@ -129,7 +129,7 @@
-     targ_defvec=ecoffalpha_little_vec
-     targ_selvecs=bfd_elf64_alpha_vec
-     ;;
--  alpha*-*-linux-gnu* | alpha*-*-elf*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
-     targ_defvec=bfd_elf64_alpha_vec
-     targ_selvecs=ecoffalpha_little_vec
-     ;;
-@@ -139,7 +139,7 @@
-   alpha*-*-*)
-     targ_defvec=ecoffalpha_little_vec
-     ;;
--  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
-+  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-linux-uclibc* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
-     targ_defvec=bfd_elf64_ia64_little_vec
-     targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
-     ;;
-@@ -216,7 +216,7 @@
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
--  armeb-*-elf | arm*b-*-linux-gnu*)
-+  armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_bigarm_vec
-     targ_selvecs=bfd_elf32_littlearm_vec
-     ;;
-@@ -224,8 +224,8 @@
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
--  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
--  arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks | \
-+  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | \
-+  arm*-*-conix* | arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks | \
-   arm*-*-eabi* )
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-@@ -378,7 +378,7 @@
-     ;;
- #ifdef BFD64
--  hppa*64*-*-linux-gnu*)
-+  hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_hppa_linux_vec
-     targ_selvecs=bfd_elf64_hppa_vec
-     ;;
-@@ -389,7 +389,7 @@
-     ;;
- #endif
--  hppa*-*-linux-gnu*)
-+  hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_hppa_linux_vec
-     targ_selvecs=bfd_elf32_hppa_vec
-     ;;
-@@ -516,7 +516,7 @@
-     targ_selvecs=bfd_elf32_i386_vec
-     targ_underscore=yes
-     ;;
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_i386_vec
-     targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
-     targ64_selvecs=bfd_elf64_x86_64_vec
-@@ -530,7 +530,7 @@
-     targ_defvec=bfd_elf64_x86_64_vec
-     targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
-     ;;
--  x86_64-*-linux-gnu*)
-+  x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_x86_64_vec
-     targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
-     ;;
-@@ -705,7 +705,7 @@
-     targ_selvecs=bfd_elf32_m68k_vec
-     targ_underscore=yes
-     ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_m68k_vec
-     targ_selvecs=m68klinux_vec
-     ;;
-@@ -981,7 +981,8 @@
-     ;;
- #endif
-   powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
--  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
-+  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
-+  powerpc-*-rtems* | \
-   powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
-     targ_defvec=bfd_elf32_powerpc_vec
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
-@@ -1018,8 +1019,8 @@
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
-     ;;
-   powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
--  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
--  powerpcle-*-rtems*)
-+  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
-+  powerpcle-*-vxworks* | powerpcle-*-rtems*)
-     targ_defvec=bfd_elf32_powerpcle_vec
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
-     targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
-@@ -1186,7 +1187,7 @@
-     targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
-     targ_underscore=yes
-     ;;
--  sparc-*-linux-gnu*)
-+  sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_sparc_vec
-     targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
-     ;;
-@@ -1233,7 +1234,7 @@
-     targ_defvec=sunos_big_vec
-     targ_underscore=yes
-     ;;
--  sparc64-*-linux-gnu*)
-+  sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_sparc_vec
-     targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
-     ;;
-@@ -1302,7 +1303,7 @@
-     targ_underscore=yes
-     ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_vax_vec
-     ;;
-diff -urN binutils-2.15.92.0.2-dist/bfd/configure binutils-2.15.92.0.2/bfd/configure
---- binutils-2.15.92.0.2-dist/bfd/configure    2004-09-27 15:46:06.000000000 -0500
-+++ binutils-2.15.92.0.2/bfd/configure 2004-09-28 14:09:03.000000000 -0500
-@@ -3583,6 +3583,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -9914,7 +9919,7 @@
-   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
-       COREFILE=''
-       ;;
--  alpha*-*-linux-gnu*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/alphalinux.h"'
-       ;;
-@@ -9978,7 +9983,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386mach3.h"'
-       ;;
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386linux.h"'
-       ;;
-@@ -10016,7 +10021,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/hp300bsd.h"'
-       ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/m68klinux.h"'
-       ;;
-@@ -10150,7 +10155,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxult2.h"'
-       ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxlinux.h"'
-       ;;
-diff -urN binutils-2.15.92.0.2-dist/bfd/configure.in binutils-2.15.92.0.2/bfd/configure.in
---- binutils-2.15.92.0.2-dist/bfd/configure.in 2004-09-27 15:46:06.000000000 -0500
-+++ binutils-2.15.92.0.2/bfd/configure.in      2004-09-28 14:09:03.000000000 -0500
-@@ -163,7 +163,7 @@
-   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
-       COREFILE=''
-       ;;
--  alpha*-*-linux-gnu*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/alphalinux.h"'
-       ;;
-@@ -248,7 +248,7 @@
-       TRAD_HEADER='"hosts/i386mach3.h"'
-       ;;
- changequote(,)dnl
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
- changequote([,])dnl
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386linux.h"'
-@@ -289,7 +289,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/hp300bsd.h"'
-       ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/m68klinux.h"'
-       ;;
-@@ -375,7 +375,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxult2.h"'
-       ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxlinux.h"'
-       ;;
-diff -urN binutils-2.15.92.0.2-dist/binutils/configure binutils-2.15.92.0.2/binutils/configure
---- binutils-2.15.92.0.2-dist/binutils/configure       2004-09-15 14:05:03.000000000 -0500
-+++ binutils-2.15.92.0.2/binutils/configure    2004-09-28 14:09:03.000000000 -0500
-@@ -1575,6 +1575,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.15.92.0.2-dist/configure binutils-2.15.92.0.2/configure
---- binutils-2.15.92.0.2-dist/configure        2004-09-27 15:46:06.000000000 -0500
-+++ binutils-2.15.92.0.2/configure     2004-09-28 14:09:03.000000000 -0500
-@@ -1334,6 +1334,18 @@
-   i[3456789]86-*-coff | i[3456789]86-*-elf)
-     noconfigdirs="$noconfigdirs ${libgcj}"
-     ;;
-+  i[3456789]86-*-linux-uclibc*)
-+    # This section makes it possible to build newlib natively on linux.
-+    # If we are using a cross compiler then don't configure newlib.
-+    if test x${is_cross_compiler} != xno ; then
-+      noconfigdirs="$noconfigdirs target-newlib"
-+    fi
-+    noconfigdirs="$noconfigdirs target-libgloss"
-+    # If we are not using a cross compiler, do configure newlib.
-+    # Note however, that newlib will only be configured in this situation
-+    # if the --with-newlib option has been given, because otherwise
-+    # 'target-newlib' will appear in skipdirs.
-+    ;;
-   i[3456789]86-*-linux*)
-     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
-     # not build java stuff by default.
-diff -urN binutils-2.15.92.0.2-dist/configure.in binutils-2.15.92.0.2/configure.in
---- binutils-2.15.92.0.2-dist/configure.in     2004-09-27 15:46:06.000000000 -0500
-+++ binutils-2.15.92.0.2/configure.in  2004-09-28 14:09:03.000000000 -0500
-@@ -556,6 +556,18 @@
-   i[[3456789]]86-*-coff | i[[3456789]]86-*-elf)
-     noconfigdirs="$noconfigdirs ${libgcj}"
-     ;;
-+  i[[3456789]]86-*-linux-uclibc*)
-+    # This section makes it possible to build newlib natively on linux.
-+    # If we are using a cross compiler then don't configure newlib.
-+    if test x${is_cross_compiler} != xno ; then
-+      noconfigdirs="$noconfigdirs target-newlib"
-+    fi
-+    noconfigdirs="$noconfigdirs target-libgloss"
-+    # If we are not using a cross compiler, do configure newlib.
-+    # Note however, that newlib will only be configured in this situation
-+    # if the --with-newlib option has been given, because otherwise
-+    # 'target-newlib' will appear in skipdirs.
-+    ;;
-   i[[3456789]]86-*-linux*)
-     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
-     # not build java stuff by default.
-diff -urN binutils-2.15.92.0.2-dist/gas/configure binutils-2.15.92.0.2/gas/configure
---- binutils-2.15.92.0.2-dist/gas/configure    2004-09-27 15:46:07.000000000 -0500
-+++ binutils-2.15.92.0.2/gas/configure 2004-09-28 14:09:03.000000000 -0500
-@@ -3420,6 +3420,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -4248,6 +4253,7 @@
-       alpha*-*-osf*)                  fmt=ecoff ;;
-       alpha*-*-linuxecoff*)           fmt=ecoff ;;
-       alpha*-*-linux-gnu*)            fmt=elf em=linux ;;
-+      alpha*-*-linux-uclibc*)         fmt=elf em=linux ;;
-       alpha*-*-netbsd*)                       fmt=elf em=nbsd ;;
-       alpha*-*-openbsd*)              fmt=elf em=obsd ;;
-@@ -4263,6 +4269,7 @@
-       arm*-*-conix*)                  fmt=elf ;;
-       arm-*-linux*aout*)              fmt=aout em=linux ;;
-       arm*-*-linux-gnu*)              fmt=elf  em=linux ;;
-+      arm*-*-linux-uclibc*)           fmt=elf  em=linux ;;
-       arm*-*-uclinux*)                        fmt=elf  em=linux ;;
-       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
-       arm-*-*n*bsd*)                  fmt=aout em=nbsd ;;
-@@ -4276,6 +4283,7 @@
-       avr-*-*)                                fmt=elf ;;
-       cris-*-linux-gnu*)              fmt=multi bfd_gas=yes em=linux ;;
-+      cris-*-linux-uclibc*)           fmt=multi bfd_gas=yes em=linux ;;
-       cris-*-*)                               fmt=multi bfd_gas=yes ;;
-       crx-*-elf*)                     fmt=elf ;;
-@@ -4335,7 +4343,9 @@
-       i386-*-linux*oldld)             fmt=aout em=linux ;;
-       i386-*-linux*coff*)             fmt=coff em=linux ;;
-       i386-*-linux-gnu*)              fmt=elf em=linux ;;
-+      i386-*-linux-uclibc*)           fmt=elf em=linux ;;
-       x86_64-*-linux-gnu*)            fmt=elf em=linux ;;
-+      x86_64-*-linux-uclibc*)         fmt=elf em=linux ;;
-       i386-*-lynxos*)                 fmt=elf em=lynx bfd_gas=yes ;;
-       i386-*-sysv[45]*)                       fmt=elf ;;
-       i386-*-solaris*)                        fmt=elf ;;
-@@ -4395,6 +4405,7 @@
-       ia64-*-elf*)                    fmt=elf ;;
-       ia64-*-aix*)                    fmt=elf em=ia64aix ;;
-       ia64-*-linux-gnu*)              fmt=elf em=linux ;;
-+      ia64-*-linux-uclibc*)           fmt=elf em=linux ;;
-       ia64-*-hpux*)                   fmt=elf em=hpux ;;
-       ia64-*-netbsd*)                 fmt=elf em=nbsd ;;
-@@ -4422,6 +4433,7 @@
-       m68k-*-hpux*)                   fmt=hp300 em=hp300 ;;
-       m68k-*-linux*aout*)             fmt=aout em=linux ;;
-       m68k-*-linux-gnu*)              fmt=elf em=linux ;;
-+      m68k-*-linux-uclibc*)           fmt=elf em=linux ;;
-       m68k-*-uclinux*)                        fmt=elf ;;
-       m68k-*-gnu*)                    fmt=elf ;;
-       m68k-*-lynxos*)                 fmt=coff em=lynx ;;
-@@ -4494,6 +4506,7 @@
-       ppc-*-beos*)                    fmt=coff ;;
-       ppc-*-*n*bsd* | ppc-*-elf*)     fmt=elf ;;
-       ppc-*-eabi* | ppc-*-sysv4*)     fmt=elf ;;
-+      ppc-*-linux-uclibc* | \
-       ppc-*-linux-gnu*)                       fmt=elf em=linux
-           case "$endian" in
-               big)  ;;
-@@ -4521,7 +4534,9 @@
-       ppc-*-lynxos*)                  fmt=elf em=lynx bfd_gas=yes ;;
-       s390x-*-linux-gnu*)             fmt=elf em=linux ;;
-+      s390x-*-linux-uclibc*)          fmt=elf em=linux ;;
-       s390-*-linux-gnu*)              fmt=elf em=linux ;;
-+      s390-*-linux-uclibc*)           fmt=elf em=linux ;;
-       sh*-*-linux*)                   fmt=elf em=linux
-           case ${cpu} in
-@@ -4556,6 +4571,7 @@
-       sparc-*-coff)                   fmt=coff ;;
-       sparc-*-linux*aout*)            fmt=aout em=linux ;;
-       sparc-*-linux-gnu*)             fmt=elf em=linux ;;
-+      sparc-*-linux-uclibc*)          fmt=elf em=linux ;;
-       sparc-*-lynxos*)                        fmt=coff em=lynx ;;
-       sparc-fujitsu-none)             fmt=aout ;;
-       sparc-*-elf)                    fmt=elf ;;
-diff -urN binutils-2.15.92.0.2-dist/gas/configure.in binutils-2.15.92.0.2/gas/configure.in
---- binutils-2.15.92.0.2-dist/gas/configure.in 2004-09-15 14:05:03.000000000 -0500
-+++ binutils-2.15.92.0.2/gas/configure.in      2004-09-28 14:09:03.000000000 -0500
-@@ -197,6 +197,7 @@
-       alpha*-*-osf*)                  fmt=ecoff ;;
-       alpha*-*-linuxecoff*)           fmt=ecoff ;;
-       alpha*-*-linux-gnu*)            fmt=elf em=linux ;;
-+      alpha*-*-linux-uclibc*)         fmt=elf em=linux ;;
-       alpha*-*-netbsd*)                       fmt=elf em=nbsd ;;
-       alpha*-*-openbsd*)              fmt=elf em=obsd ;;
-@@ -212,6 +213,7 @@
-       arm*-*-conix*)                  fmt=elf ;;
-       arm-*-linux*aout*)              fmt=aout em=linux ;;
-       arm*-*-linux-gnu*)              fmt=elf  em=linux ;;
-+      arm*-*-linux-uclibc*)           fmt=elf  em=linux ;;
-       arm*-*-uclinux*)                        fmt=elf  em=linux ;;
-       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
-       arm-*-*n*bsd*)                  fmt=aout em=nbsd ;;
-@@ -225,6 +227,7 @@
-       avr-*-*)                                fmt=elf ;;
-       cris-*-linux-gnu*)              fmt=multi bfd_gas=yes em=linux ;;
-+      cris-*-linux-uclibc*)           fmt=multi bfd_gas=yes em=linux ;;
-       cris-*-*)                               fmt=multi bfd_gas=yes ;;
-       crx-*-elf*)                     fmt=elf ;;
-@@ -284,7 +287,9 @@
-       i386-*-linux*oldld)             fmt=aout em=linux ;;
-       i386-*-linux*coff*)             fmt=coff em=linux ;;
-       i386-*-linux-gnu*)              fmt=elf em=linux ;;
-+      i386-*-linux-uclibc*)           fmt=elf em=linux ;;
-       x86_64-*-linux-gnu*)            fmt=elf em=linux ;;
-+      x86_64-*-linux-uclibc*)         fmt=elf em=linux ;;
-       i386-*-lynxos*)                 fmt=elf em=lynx bfd_gas=yes ;;
- changequote(,)dnl
-       i386-*-sysv[45]*)                       fmt=elf ;;
-@@ -337,6 +342,7 @@
-       ia64-*-elf*)                    fmt=elf ;;
-       ia64-*-aix*)                    fmt=elf em=ia64aix ;;
-       ia64-*-linux-gnu*)              fmt=elf em=linux ;;
-+      ia64-*-linux-uclibc*)           fmt=elf em=linux ;;
-       ia64-*-hpux*)                   fmt=elf em=hpux ;;
-       ia64-*-netbsd*)                 fmt=elf em=nbsd ;;
-@@ -364,6 +370,7 @@
-       m68k-*-hpux*)                   fmt=hp300 em=hp300 ;;
-       m68k-*-linux*aout*)             fmt=aout em=linux ;;
-       m68k-*-linux-gnu*)              fmt=elf em=linux ;;
-+      m68k-*-linux-uclibc*)           fmt=elf em=linux ;;
-       m68k-*-uclinux*)                        fmt=elf ;;
-       m68k-*-gnu*)                    fmt=elf ;;
-       m68k-*-lynxos*)                 fmt=coff em=lynx ;;
-@@ -433,6 +440,7 @@
-       ppc-*-beos*)                    fmt=coff ;;
-       ppc-*-*n*bsd* | ppc-*-elf*)     fmt=elf ;;
-       ppc-*-eabi* | ppc-*-sysv4*)     fmt=elf ;;
-+      ppc-*-linux-uclibc* | \
-       ppc-*-linux-gnu*)                       fmt=elf em=linux
-           case "$endian" in
-               big)  ;;
-@@ -453,7 +461,9 @@
-       ppc-*-lynxos*)                  fmt=elf em=lynx bfd_gas=yes ;;
-       s390x-*-linux-gnu*)             fmt=elf em=linux ;;
-+      s390x-*-linux-uclibc*)          fmt=elf em=linux ;;
-       s390-*-linux-gnu*)              fmt=elf em=linux ;;
-+      s390-*-linux-uclibc*)           fmt=elf em=linux ;;
-       sh*-*-linux*)                   fmt=elf em=linux
-           case ${cpu} in
-@@ -484,6 +494,7 @@
-       sparc-*-coff)                   fmt=coff ;;
-       sparc-*-linux*aout*)            fmt=aout em=linux ;;
-       sparc-*-linux-gnu*)             fmt=elf em=linux ;;
-+      sparc-*-linux-uclibc*)          fmt=elf em=linux ;;
-       sparc-*-lynxos*)                        fmt=coff em=lynx ;;
-       sparc-fujitsu-none)             fmt=aout ;;
-       sparc-*-elf)                    fmt=elf ;;
-diff -urN binutils-2.15.92.0.2-dist/gprof/configure binutils-2.15.92.0.2/gprof/configure
---- binutils-2.15.92.0.2-dist/gprof/configure  2004-09-27 15:46:07.000000000 -0500
-+++ binutils-2.15.92.0.2/gprof/configure       2004-09-28 14:09:03.000000000 -0500
-@@ -3418,6 +3418,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.15.92.0.2-dist/ld/configure binutils-2.15.92.0.2/ld/configure
---- binutils-2.15.92.0.2-dist/ld/configure     2004-09-27 15:46:07.000000000 -0500
-+++ binutils-2.15.92.0.2/ld/configure  2004-09-28 14:09:03.000000000 -0500
-@@ -1579,6 +1579,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN binutils-2.15.92.0.2-dist/ld/configure.tgt binutils-2.15.92.0.2/ld/configure.tgt
---- binutils-2.15.92.0.2-dist/ld/configure.tgt 2004-09-15 14:05:04.000000000 -0500
-+++ binutils-2.15.92.0.2/ld/configure.tgt      2004-09-28 14:09:03.000000000 -0500
-@@ -31,6 +31,7 @@
-                       targ_extra_emuls="criself crislinux"
-                       targ_extra_libpath=$targ_extra_emuls ;;
- cris-*-linux-gnu*)    targ_emul=crislinux ;;
-+cris-*-linux-uclibc*) targ_emul=crislinux ;;
- cris-*-*)             targ_emul=criself
-                       targ_extra_emuls="crisaout crislinux"
-                       targ_extra_libpath=$targ_extra_emuls ;;
-@@ -61,14 +62,16 @@
-                       tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
-                       tdir_sun4=sparc-sun-sunos4
-                       ;;
--sparc64-*-linux-gnu*) targ_emul=elf64_sparc
-+sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)        \
-+                      targ_emul=elf64_sparc
-                       targ_extra_emuls="elf32_sparc sparclinux sun4"
-                       targ_extra_libpath=elf32_sparc
-                       tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
-                       tdir_sparclinux=${tdir_elf32_sparc}aout
-                       tdir_sun4=sparc-sun-sunos4
-                       ;;
--sparc*-*-linux-gnu*)  targ_emul=elf32_sparc
-+sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
-+                      targ_emul=elf32_sparc
-                       targ_extra_emuls="sparclinux elf64_sparc sun4"
-                       targ_extra_libpath=elf64_sparc
-                       tdir_sparclinux=${targ_alias}aout
-@@ -120,7 +123,9 @@
- m32r*le-*-elf*)         targ_emul=m32rlelf ;;
- m32r*-*-elf*)           targ_emul=m32relf ;;
- m32r*le-*-linux-gnu*)   targ_emul=m32rlelf_linux ;;
-+m32r*le-*-linux-uclibc*) targ_emul=m32rlelf_linux ;;
- m32r*-*-linux-gnu*)     targ_emul=m32relf_linux ;;
-+m32r*-*-linux-uclibc*)  targ_emul=m32relf_linux ;;
- m68hc11-*-*|m6811-*-*)        targ_emul=m68hc11elf 
-                       targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
- m68hc12-*-*|m6812-*-*)        targ_emul=m68hc12elf 
-@@ -130,7 +135,7 @@
- m68*-ericsson-ose)    targ_emul=sun3 ;;
- m68*-apple-aux*)      targ_emul=m68kaux ;;
- *-tandem-none)                targ_emul=st2000 ;;
--i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
-+i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
- i[3-7]86-*-nto-qnx*)  targ_emul=i386nto ;;
- i[3-7]86-*-vsta)      targ_emul=vsta ;;
- i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
-@@ -154,14 +159,16 @@
-                       tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
-                       ;;
- i[3-7]86-*-linux*oldld)       targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
--i[3-7]86-*-linux-gnu*)        targ_emul=elf_i386
-+i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
-+                      targ_emul=elf_i386
-                       targ_extra_emuls=i386linux
-                       if test x${want64} = xtrue; then
-                         targ_extra_emuls="$targ_extra_emuls elf_x86_64"
-                       fi
-                       tdir_i386linux=${targ_alias}aout
-                       ;;
--x86_64-*-linux-gnu*)  targ_emul=elf_x86_64
-+x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
-+                      targ_emul=elf_x86_64
-                       targ_extra_emuls="elf_i386 i386linux"
-                       targ_extra_libpath=elf_i386
-                       tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
-@@ -262,10 +269,13 @@
- arm9e-*-elf)          targ_emul=armelf ;;
- arm-*-oabi)           targ_emul=armelf_oabi ;;
- arm*b-*-linux-gnu*)   targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
-+arm*b-*-linux-uclibc*)        targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
- arm*-*-linux-gnu*)    targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
-+arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- arm*-*-uclinux*)      targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- arm*-*-conix*)                targ_emul=armelf ;;
--thumb-*-linux-gnu* | thumb-*-uclinux*)        targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
-+thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
-+                      targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- strongarm-*-coff)     targ_emul=armcoff ;;
- strongarm-*-elf)      targ_emul=armelf ;;
- strongarm-*-kaos*)    targ_emul=armelf ;;
-@@ -370,7 +380,8 @@
-                       targ_extra_emuls=m68kelf
-                       tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
-                       ;;
--m68k-*-linux-gnu*)    targ_emul=m68kelf
-+m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
-+                      targ_emul=m68kelf
-                       targ_extra_emuls=m68klinux
-                       tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
-                       ;;
-@@ -387,9 +398,9 @@
- m68*-*-psos*)         targ_emul=m68kpsos ;;
- m68*-*-rtemscoff*)    targ_emul=m68kcoff ;;
- m68*-*-rtems*)                targ_emul=m68kelf ;;
--hppa*64*-*-linux-gnu*)        targ_emul=hppa64linux ;;
-+hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)  targ_emul=hppa64linux ;;
- hppa*64*-*)           targ_emul=elf64hppa ;;
--hppa*-*-linux-gnu*)   targ_emul=hppalinux ;;
-+hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*)   targ_emul=hppalinux ;;
- hppa*-*-*elf*)                targ_emul=hppaelf ;;
- hppa*-*-lites*)               targ_emul=hppaelf ;;
- hppa*-*-netbsd*)      targ_emul=hppanbsd ;;
-@@ -402,6 +413,7 @@
-                       targ_emul=vaxnbsd
-                       targ_extra_emuls=elf32vax ;;
- vax-*-linux-gnu*)     targ_emul=elf32vax ;;
-+vax-*-linux-uclibc*)  targ_emul=elf32vax ;;
- mips*-*-pe)           targ_emul=mipspe ;
-                       targ_extra_ofiles="deffilep.o pe-dll.o" ;;
- mips*-dec-ultrix*)    targ_emul=mipslit ;;
-@@ -435,16 +447,16 @@
- mips*-*-vxworks*)     targ_emul=elf32ebmip
-                       targ_extra_emuls="elf32elmip" ;;
- mips*-*-windiss)      targ_emul=elf32mipswindiss ;;
--mips64*el-*-linux-gnu*)       targ_emul=elf32ltsmipn32
-+mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*)   targ_emul=elf32ltsmipn32
-                       targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
-                       ;;
--mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
-+mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*)       targ_emul=elf32btsmipn32
-                       targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
-                       ;;
--mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
-+mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*)       targ_emul=elf32ltsmip
-                       targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
-                       ;;
--mips*-*-linux-gnu*)   targ_emul=elf32btsmip
-+mips*-*-linux-gnu* | mips*-*-linux-uclibc*)   targ_emul=elf32btsmip
-                       targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
-                       ;;
- mips*-*-lnews*)               targ_emul=mipslnews ;;
-@@ -467,6 +479,10 @@
- alpha*-*-linux-gnu*)  targ_emul=elf64alpha targ_extra_emuls=alpha
-                       tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
-                       ;;
-+alpha*-*-linux-uclibc*)       targ_emul=elf64alpha targ_extra_emuls=alpha
-+                      # The following needs to be checked...
-+                      tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
-+                      ;;
- alpha*-*-osf*)                targ_emul=alpha ;;
- alpha*-*-gnu*)                targ_emul=elf64alpha ;;
- alpha*-*-netware*)    targ_emul=alpha ;;
-diff -urN binutils-2.15.92.0.2-dist/ld/emultempl/elf32.em binutils-2.15.92.0.2/ld/emultempl/elf32.em
---- binutils-2.15.92.0.2-dist/ld/emultempl/elf32.em    2004-07-27 23:36:11.000000000 -0500
-+++ binutils-2.15.92.0.2/ld/emultempl/elf32.em 2004-09-28 14:13:04.000000000 -0500
-@@ -327,7 +327,7 @@
- EOF
- case ${target} in
--  *-*-linux-gnu*)
-+  *-*-linux-gnu* | *-*-linux-uclibc*)
-     cat >>e${EMULATION_NAME}.c <<EOF
-         {
-           struct bfd_link_needed_list *l;
-@@ -500,7 +500,7 @@
- EOF
-   case ${target} in
--    *-*-linux-gnu*)
-+    *-*-linux-gnu* | *-*-linux-uclibc*)
-       cat >>e${EMULATION_NAME}.c <<EOF
- /* For a native linker, check the file /etc/ld.so.conf for directories
-    in which we may find shared libraries.  /etc/ld.so.conf is really
-@@ -784,7 +784,7 @@
- EOF
- if [ "x${USE_LIBPATH}" = xyes ] ; then
-   case ${target} in
--    *-*-linux-gnu*)
-+    *-*-linux-gnu* | *-*-linux-uclibc*)
-       cat >>e${EMULATION_NAME}.c <<EOF
-         if (gld${EMULATION_NAME}_check_ld_so_conf (l->name, force))
-           break;
-diff -urN binutils-2.15.92.0.2-dist/libtool.m4 binutils-2.15.92.0.2/libtool.m4
---- binutils-2.15.92.0.2-dist/libtool.m4       2004-07-27 23:36:06.000000000 -0500
-+++ binutils-2.15.92.0.2/libtool.m4    2004-09-28 14:09:03.000000000 -0500
-@@ -645,6 +645,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
-diff -urN binutils-2.15.92.0.2-dist/ltconfig binutils-2.15.92.0.2/ltconfig
---- binutils-2.15.92.0.2-dist/ltconfig 2004-07-27 23:36:06.000000000 -0500
-+++ binutils-2.15.92.0.2/ltconfig      2004-09-28 14:09:03.000000000 -0500
-@@ -603,6 +603,7 @@
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case $host_os in
- linux-gnu*) ;;
-+linux-uclibc*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
-@@ -1270,6 +1271,24 @@
-   dynamic_linker='GNU/Linux ld.so'
-   ;;
-+linux-uclibc*)
-+  version_type=linux
-+  need_lib_prefix=no
-+  need_version=no
-+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-+  soname_spec='${libname}${release}.so$major'
-+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-+  shlibpath_var=LD_LIBRARY_PATH
-+  shlibpath_overrides_runpath=no
-+  # This implies no fast_install, which is unacceptable.
-+  # Some rework will be needed to allow for fast_install
-+  # before this can be enabled.
-+  # Note: copied from linux-gnu, and may not be appropriate.
-+  hardcode_into_libs=yes
-+  # Assume using the uClibc dynamic linker.
-+  dynamic_linker="uClibc ld.so"
-+  ;;
-+
- netbsd*)
-   need_lib_prefix=no
-   need_version=no
-diff -urN binutils-2.15.92.0.2-dist/opcodes/configure binutils-2.15.92.0.2/opcodes/configure
---- binutils-2.15.92.0.2-dist/opcodes/configure        2004-09-27 15:46:08.000000000 -0500
-+++ binutils-2.15.92.0.2/opcodes/configure     2004-09-28 14:09:03.000000000 -0500
-@@ -3587,6 +3587,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
diff --git a/openwrt/toolchain/binutils/2.15.92.0.2/300-001_ld_makefile_patch.patch b/openwrt/toolchain/binutils/2.15.92.0.2/300-001_ld_makefile_patch.patch
deleted file mode 100644 (file)
index b25d5b7..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/sh -e
-## 001_ld_makefile_patch.dpatch
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Description: correct where ld scripts are installed
-## DP: Author: Chris Chimelis <chris@debian.org>
-## DP: Upstream status: N/A
-## DP: Date: ??
-
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-
-[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
-
-case "$1" in
-       -patch) patch $patch_opts -p1 < $0;;
-       -unpatch) patch $patch_opts -p1 -R < $0;;
-        *)
-                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-                exit 1;;
-esac
-
-exit 0
-
-@DPATCH@
-diff -urNad /home/james/debian/packages/binutils/binutils-2.14.90.0.6/ld/Makefile.am binutils-2.14.90.0.6/ld/Makefile.am
---- /home/james/debian/packages/binutils/binutils-2.14.90.0.6/ld/Makefile.am   2003-08-21 16:28:48.000000000 +0100
-+++ binutils-2.14.90.0.6/ld/Makefile.am        2003-09-10 23:12:09.000000000 +0100
-@@ -19,7 +19,7 @@
- # We put the scripts in the directory $(scriptdir)/ldscripts.
- # We can't put the scripts in $(datadir) because the SEARCH_DIR
- # directives need to be different for native and cross linkers.
--scriptdir = $(tooldir)/lib
-+scriptdir = $(libdir)
- EMUL = @EMUL@
- EMULATION_OFILES = @EMULATION_OFILES@
-diff -urNad /home/james/debian/packages/binutils/binutils-2.14.90.0.6/ld/Makefile.in binutils-2.14.90.0.6/ld/Makefile.in
---- /home/james/debian/packages/binutils/binutils-2.14.90.0.6/ld/Makefile.in   2003-08-21 16:28:48.000000000 +0100
-+++ binutils-2.14.90.0.6/ld/Makefile.in        2003-09-10 23:12:09.000000000 +0100
-@@ -128,7 +128,7 @@
- # We put the scripts in the directory $(scriptdir)/ldscripts.
- # We can't put the scripts in $(datadir) because the SEARCH_DIR
- # directives need to be different for native and cross linkers.
--scriptdir = $(tooldir)/lib
-+scriptdir = $(libdir)
- EMUL = @EMUL@
- EMULATION_OFILES = @EMULATION_OFILES@
diff --git a/openwrt/toolchain/binutils/2.15.92.0.2/300-006_better_file_error.patch b/openwrt/toolchain/binutils/2.15.92.0.2/300-006_better_file_error.patch
deleted file mode 100644 (file)
index f337611..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/sh -e
-## 006_better_file_error.dpatch by David Kimdon <dwhedon@gordian.com>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Specify which filename is causing an error if the filename is a
-## DP: directory. (#45832)
-
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-
-[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
-
-case "$1" in
-       -patch) patch $patch_opts -p1 < $0;;
-       -unpatch) patch $patch_opts -p1 -R < $0;;
-        *)
-                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-                exit 1;;
-esac
-
-exit 0
-
-@DPATCH@
-diff -urNad /home/james/debian/packages/binutils/binutils-2.14.90.0.6/bfd/opncls.c binutils-2.14.90.0.6/bfd/opncls.c
---- /home/james/debian/packages/binutils/binutils-2.14.90.0.6/bfd/opncls.c     2003-07-23 16:08:09.000000000 +0100
-+++ binutils-2.14.90.0.6/bfd/opncls.c  2003-09-10 22:35:00.000000000 +0100
-@@ -150,6 +150,13 @@
- {
-   bfd *nbfd;
-   const bfd_target *target_vec;
-+  struct stat s;
-+
-+  if (stat (filename, &s) == 0)
-+    if (S_ISDIR(s.st_mode)) {
-+      bfd_set_error (bfd_error_file_not_recognized);
-+      return NULL;
-+    }
-   nbfd = _bfd_new_bfd ();
-   if (nbfd == NULL)
diff --git a/openwrt/toolchain/binutils/2.15.92.0.2/300-012_check_ldrunpath_length.patch b/openwrt/toolchain/binutils/2.15.92.0.2/300-012_check_ldrunpath_length.patch
deleted file mode 100644 (file)
index 498651a..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh -e
-## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for
-## DP: cases where -rpath isn't specified. (#151024)
-
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-
-[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
-
-case "$1" in
-       -patch) patch $patch_opts -p1 < $0;;
-       -unpatch) patch $patch_opts -p1 -R < $0;;
-        *)
-                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-                exit 1;;
-esac
-
-exit 0
-
-@DPATCH@
-diff -urNad /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em binutils-2.15/ld/emultempl/elf32.em
---- /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em       2004-05-21 23:12:58.000000000 +0100
-+++ binutils-2.15/ld/emultempl/elf32.em        2004-05-21 23:12:59.000000000 +0100
-@@ -692,6 +692,8 @@
-             && command_line.rpath == NULL)
-           {
-             lib_path = (const char *) getenv ("LD_RUN_PATH");
-+            if ((lib_path) && (strlen (lib_path) == 0))
-+                lib_path = NULL;
-             if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
-                                                     force))
-               break;
-@@ -871,6 +873,8 @@
-   rpath = command_line.rpath;
-   if (rpath == NULL)
-     rpath = (const char *) getenv ("LD_RUN_PATH");
-+  if ((rpath) && (strlen (rpath) == 0))
-+      rpath = NULL;
-   if (! (bfd_elf_size_dynamic_sections
-        (output_bfd, command_line.soname, rpath,
-         command_line.filter_shlib,
diff --git a/openwrt/toolchain/binutils/2.15.92.0.2/300-117_mips_symbolic_link.patch b/openwrt/toolchain/binutils/2.15.92.0.2/300-117_mips_symbolic_link.patch
deleted file mode 100644 (file)
index f5a3199..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#! /bin/sh -e
-## 117_mips_symbolic_link.dpatch
-##
-## DP: Description: Handle symbolic multigot links. (#270619)
-## DP: Author: Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
-## DP: Upstream status: Not submitted
-## DP: Date: 2004-09-08
-
-if [ $# -lt 1 ]; then
-    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-    exit 1
-fi
-
-[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
-
-case "$1" in
-    -patch) patch -p1 ${patch_opts} < $0;;
-    -unpatch) patch -R -p1 ${patch_opts} < $0;;
-    *)
-        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-        exit 1;;
-esac
-
-exit 0
-
-@DPATCH@
-diff -urpN binutils-2.15.orig/bfd/elfxx-mips.c binutils-2.15/bfd/elfxx-mips.c
---- binutils-2.15.orig/bfd/elfxx-mips.c        2004-05-17 21:36:03.000000000 +0200
-+++ binutils-2.15/bfd/elfxx-mips.c     2004-08-29 08:48:22.000000000 +0200
-@@ -3909,10 +3910,7 @@ mips_elf_create_dynamic_relocation (bfd 
-       /* We must now calculate the dynamic symbol table index to use
-        in the relocation.  */
-       if (h != NULL
--        && (! info->symbolic || !h->root.def_regular)
--        /* h->root.dynindx may be -1 if this symbol was marked to
--           become local.  */
--        && h->root.dynindx != -1)
-+        && (!h->root.def_regular || !h->root.forced_local))
-       {
-         indx = h->root.dynindx;
-         if (SGI_COMPAT (output_bfd))
diff --git a/openwrt/toolchain/binutils/2.15.92.0.2/300-120_mips_xgot_multigot_workaround.patch b/openwrt/toolchain/binutils/2.15.92.0.2/300-120_mips_xgot_multigot_workaround.patch
deleted file mode 100644 (file)
index ae2033d..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#! /bin/sh -e
-## 120_mips_xgot_multigot_workaround.dpatch
-##
-## DP: Description: Make multigot/xgot handling mutually exclusive.
-## DP: Author: Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
-## DP: Upstream status: Not submitted
-## DP: Date: 2004-09-17
-
-if [ $# -lt 1 ]; then
-    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-    exit 1
-fi
-
-[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
-
-case "$1" in
-    -patch) patch -p1 ${patch_opts} < $0;;
-    -unpatch) patch -R -p1 ${patch_opts} < $0;;
-    *)
-        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-        exit 1;;
-esac
-
-exit 0
-
-@DPATCH@
-diff -urNad /home/james/debian/packages/binutils/binutils-2.15/bfd/elfxx-mips.c binutils-2.15/bfd/elfxx-mips.c
---- /home/james/debian/packages/binutils/binutils-2.15/bfd/elfxx-mips.c        2004-09-23 22:41:37.156466673 +0100
-+++ binutils-2.15/bfd/elfxx-mips.c     2004-09-23 22:42:15.998362861 +0100
-@@ -5883,6 +5883,8 @@
-   s->size += i * MIPS_ELF_GOT_SIZE (output_bfd);
-   if (s->size > MIPS_ELF_GOT_MAX_SIZE (output_bfd)
-+      && g->global_gotno <= (MIPS_ELF_GOT_MAX_SIZE (output_bfd)
-+                            / MIPS_ELF_GOT_SIZE (output_bfd))
-       && ! mips_elf_multi_got (output_bfd, info, g, s, local_gotno))
-     return FALSE;
diff --git a/openwrt/toolchain/binutils/2.15.92.0.2/600-arm-textrel.patch b/openwrt/toolchain/binutils/2.15.92.0.2/600-arm-textrel.patch
deleted file mode 100644 (file)
index d234181..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-http://sources.redhat.com/ml/binutils/2004-06/msg00010.html
---- binutils-2.15.90.0.3-old/bfd/elf32-arm.h   2004-04-12 14:56:33.000000000 -0500
-+++ binutils-2.15.90.0.3/bfd/elf32-arm.h       2004-09-03 06:56:40.000000000 -0500
-@@ -3531,6 +3533,37 @@
-   return TRUE;
- }
-+/* Find any dynamic relocs that apply to read-only sections.  */
-+
-+static bfd_boolean
-+elf32_arm_readonly_dynrelocs (h, inf)
-+     struct elf_link_hash_entry *h;
-+     PTR inf;
-+{
-+  struct elf32_arm_link_hash_entry *eh;
-+  struct elf32_arm_relocs_copied *p;
-+
-+  if (h->root.type == bfd_link_hash_warning)
-+    h = (struct elf_link_hash_entry *) h->root.u.i.link;
-+
-+  eh = (struct elf32_arm_link_hash_entry *) h;
-+  for (p = eh->relocs_copied; p != NULL; p = p->next)
-+    {
-+      asection *s = p->section;
-+
-+      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-+       {
-+         struct bfd_link_info *info = (struct bfd_link_info *) inf;
-+
-+         info->flags |= DF_TEXTREL;
-+
-+         /* Not an error, just cut short the traversal.  */
-+         return FALSE;
-+       }
-+    }
-+  return TRUE;
-+}
-+
- /* Set the sizes of the dynamic sections.  */
- static bfd_boolean
-@@ -3740,6 +3773,12 @@
-           return FALSE;
-       }
-+      /* If any dynamic relocs apply to a read-only section,
-+         then we need a DT_TEXTREL entry.  */
-+      if ((info->flags & DF_TEXTREL) == 0)
-+        elf_link_hash_traverse (&htab->root, elf32_arm_readonly_dynrelocs,
-+                                (PTR) info);
-+
-       if ((info->flags & DF_TEXTREL) != 0)
-       {
-         if (!add_dynamic_entry (DT_TEXTREL, 0))
diff --git a/openwrt/toolchain/binutils/2.15.92.0.2/702-binutils-skip-comments.patch b/openwrt/toolchain/binutils/2.15.92.0.2/702-binutils-skip-comments.patch
deleted file mode 100644 (file)
index 804a17e..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
-Fixes
-localealias.s:544: Error: junk at end of line, first unrecognized character is `,' 
-when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
-
-Paths adjusted to match crosstool's patcher.
-
-Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
-From: Andreas Schwab <schwab at suse dot de>
-To: Nathan Sidwell <nathan at codesourcery dot com>
-Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
-Date: Fri, 23 Apr 2004 22:27:19 +0200
-Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
-
-Nathan Sidwell <nathan@codesourcery.com> writes:
-
-> Index: read.c
-> ===================================================================
-> RCS file: /cvs/src/src/gas/read.c,v
-> retrieving revision 1.76
-> diff -c -3 -p -r1.76 read.c
-> *** read.c   12 Mar 2004 17:48:12 -0000      1.76
-> --- read.c   18 Mar 2004 09:56:05 -0000
-> *************** read_a_source_file (char *name)
-> *** 1053,1059 ****
->   #endif
->        input_line_pointer--;
->        /* Report unknown char as ignored.  */
-> !      ignore_rest_of_line ();
->      }
->   
->   #ifdef md_after_pass_hook
-> --- 1053,1059 ----
->   #endif
->        input_line_pointer--;
->        /* Report unknown char as ignored.  */
-> !      demand_empty_rest_of_line ();
->      }
->   
->   #ifdef md_after_pass_hook
-
-This means that the unknown character is no longer ignored, despite the
-comment.  As a side effect a line starting with a line comment character
-not followed by APP in NO_APP mode now triggers an error instead of just a
-warning, breaking builds of glibc on m68k-linux.  Earlier in
-read_a_source_file where #APP is handled there is another comment that
-claims that unknown comments are ignored, when in fact they aren't (only
-the initial line comment character is skipped).
-
-Note that the presence of #APP will mess up the line counters, but
-that appears to be difficult to fix.
-
-Andreas.
-
-2004-04-23  Andreas Schwab  <schwab@suse.de>
-
-       * read.c (read_a_source_file): Ignore unknown text after line
-       comment character.  Fix misleading comment.
-
---- binutils/gas/read.c.~1.78.~        2004-04-23 08:58:23.000000000 +0200
-+++ binutils/gas/read.c        2004-04-23 21:49:01.000000000 +0200
-@@ -1,6 +1,6 @@
- /* read.c - read a source file -
-    Copyright 1986, 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
--   1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-+   1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
- This file is part of GAS, the GNU Assembler.
-@@ -950,10 +950,14 @@ read_a_source_file (char *name)
-             unsigned int new_length;
-             char *tmp_buf = 0;
--            bump_line_counters ();
-             s = input_line_pointer;
-             if (strncmp (s, "APP\n", 4))
--              continue;       /* We ignore it */
-+              {
-+                /* We ignore it */
-+                ignore_rest_of_line ();
-+                continue;
-+              }
-+            bump_line_counters ();
-             s += 4;
-             sb_new (&sbuf);
-@@ -1052,7 +1056,7 @@ read_a_source_file (char *name)
-           continue;
- #endif
-         input_line_pointer--;
--        /* Report unknown char as ignored.  */
-+        /* Report unknown char as error.  */
-         demand_empty_rest_of_line ();
-       }
-
--- 
-Andreas Schwab, SuSE Labs, schwab@suse.de
-SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
-Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
-"And now for something completely different."
diff --git a/openwrt/toolchain/binutils/2.15.94.0.1/100-uclibc-conf.patch b/openwrt/toolchain/binutils/2.15.94.0.1/100-uclibc-conf.patch
deleted file mode 100644 (file)
index dda2b4f..0000000
+++ /dev/null
@@ -1,734 +0,0 @@
-diff -ur binutils-2.15.94.0.1.orig/bfd/config.bfd binutils-2.15.94.0.1/bfd/config.bfd
---- binutils-2.15.94.0.1.orig/bfd/config.bfd   2004-11-22 21:29:57.791886144 -0500
-+++ binutils-2.15.94.0.1/bfd/config.bfd        2004-11-22 21:30:53.195463520 -0500
-@@ -140,7 +140,7 @@
-     targ_defvec=ecoffalpha_little_vec
-     targ_selvecs=bfd_elf64_alpha_vec
-     ;;
--  alpha*-*-linux-gnu* | alpha*-*-elf*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
-     targ_defvec=bfd_elf64_alpha_vec
-     targ_selvecs=ecoffalpha_little_vec
-     ;;
-@@ -150,7 +150,7 @@
-   alpha*-*-*)
-     targ_defvec=ecoffalpha_little_vec
-     ;;
--  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
-+  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-linux-uclibc* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
-     targ_defvec=bfd_elf64_ia64_little_vec
-     targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
-     ;;
-@@ -227,7 +227,7 @@
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
--  armeb-*-elf | arm*b-*-linux-gnu*)
-+  armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_bigarm_vec
-     targ_selvecs=bfd_elf32_littlearm_vec
-     ;;
-@@ -235,8 +235,8 @@
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-     ;;
--  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
--  arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks | \
-+  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | \
-+  arm*-*-conix* | arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks | \
-   arm*-*-eabi* )
-     targ_defvec=bfd_elf32_littlearm_vec
-     targ_selvecs=bfd_elf32_bigarm_vec
-@@ -381,7 +381,7 @@
-     ;;
- #ifdef BFD64
--  hppa*64*-*-linux-gnu*)
-+  hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_hppa_linux_vec
-     targ_selvecs=bfd_elf64_hppa_vec
-     ;;
-@@ -392,7 +392,7 @@
-     ;;
- #endif
--  hppa*-*-linux-gnu*)
-+  hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_hppa_linux_vec
-     targ_selvecs=bfd_elf32_hppa_vec
-     ;;
-@@ -525,7 +525,7 @@
-     targ_selvecs=bfd_elf32_i386_vec
-     targ_underscore=yes
-     ;;
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_i386_vec
-     targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
-     targ64_selvecs=bfd_elf64_x86_64_vec
-@@ -539,7 +539,7 @@
-     targ_defvec=bfd_elf64_x86_64_vec
-     targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
-     ;;
--  x86_64-*-linux-gnu*)
-+  x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_x86_64_vec
-     targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
-     ;;
-@@ -715,7 +715,7 @@
-     targ_selvecs=bfd_elf32_m68k_vec
-     targ_underscore=yes
-     ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_m68k_vec
-     targ_selvecs=m68klinux_vec
-     ;;
-@@ -1001,7 +1001,8 @@
-     ;;
- #endif
-   powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
--  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
-+  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
-+  powerpc-*-rtems* | \
-   powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
-     targ_defvec=bfd_elf32_powerpc_vec
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
-@@ -1038,8 +1039,8 @@
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
-     ;;
-   powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
--  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
--  powerpcle-*-rtems*)
-+  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
-+  powerpcle-*-vxworks* | powerpcle-*-rtems*)
-     targ_defvec=bfd_elf32_powerpcle_vec
-     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
-     targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
-@@ -1206,7 +1207,7 @@
-     targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
-     targ_underscore=yes
-     ;;
--  sparc-*-linux-gnu*)
-+  sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_sparc_vec
-     targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
-     ;;
-@@ -1253,7 +1254,7 @@
-     targ_defvec=sunos_big_vec
-     targ_underscore=yes
-     ;;
--  sparc64-*-linux-gnu*)
-+  sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
-     targ_defvec=bfd_elf64_sparc_vec
-     targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
-     ;;
-@@ -1322,7 +1323,7 @@
-     targ_underscore=yes
-     ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-     targ_defvec=bfd_elf32_vax_vec
-     ;;
-diff -ur binutils-2.15.94.0.1.orig/bfd/configure binutils-2.15.94.0.1/bfd/configure
---- binutils-2.15.94.0.1.orig/bfd/configure    2004-11-22 21:29:57.794885688 -0500
-+++ binutils-2.15.94.0.1/bfd/configure 2004-11-22 21:31:10.011907032 -0500
-@@ -3583,6 +3583,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -9914,7 +9919,7 @@
-   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
-       COREFILE=''
-       ;;
--  alpha*-*-linux-gnu*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/alphalinux.h"'
-       ;;
-@@ -9978,7 +9983,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386mach3.h"'
-       ;;
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386linux.h"'
-       ;;
-@@ -10016,7 +10021,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/hp300bsd.h"'
-       ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/m68klinux.h"'
-       ;;
-@@ -10150,7 +10155,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxult2.h"'
-       ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxlinux.h"'
-       ;;
-diff -ur binutils-2.15.94.0.1.orig/bfd/configure.in binutils-2.15.94.0.1/bfd/configure.in
---- binutils-2.15.94.0.1.orig/bfd/configure.in 2004-11-22 21:29:57.794885688 -0500
-+++ binutils-2.15.94.0.1/bfd/configure.in      2004-11-22 21:31:23.225898200 -0500
-@@ -163,7 +163,7 @@
-   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
-       COREFILE=''
-       ;;
--  alpha*-*-linux-gnu*)
-+  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/alphalinux.h"'
-       ;;
-@@ -248,7 +248,7 @@
-       TRAD_HEADER='"hosts/i386mach3.h"'
-       ;;
- changequote(,)dnl
--  i[3-7]86-*-linux-gnu*)
-+  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
- changequote([,])dnl
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/i386linux.h"'
-@@ -289,7 +289,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/hp300bsd.h"'
-       ;;
--  m68*-*-linux-gnu*)
-+  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/m68klinux.h"'
-       ;;
-@@ -375,7 +375,7 @@
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxult2.h"'
-       ;;
--  vax-*-linux-gnu*)
-+  vax-*-linux-gnu* | vax-*-linux-uclibc*)
-       COREFILE=trad-core.lo
-       TRAD_HEADER='"hosts/vaxlinux.h"'
-       ;;
-diff -ur binutils-2.15.94.0.1.orig/binutils/configure binutils-2.15.94.0.1/binutils/configure
---- binutils-2.15.94.0.1.orig/binutils/configure       2004-11-22 21:29:57.923866080 -0500
-+++ binutils-2.15.94.0.1/binutils/configure    2004-11-22 21:31:47.597193200 -0500
-@@ -1575,6 +1575,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -ur binutils-2.15.94.0.1.orig/configure binutils-2.15.94.0.1/configure
---- binutils-2.15.94.0.1.orig/configure        2004-11-22 21:29:57.902869272 -0500
-+++ binutils-2.15.94.0.1/configure     2004-11-22 21:31:47.601192592 -0500
-@@ -1341,6 +1341,18 @@
-   i[3456789]86-*-coff | i[3456789]86-*-elf)
-     noconfigdirs="$noconfigdirs ${libgcj}"
-     ;;
-+  i[3456789]86-*-linux-uclibc*)
-+    # This section makes it possible to build newlib natively on linux.
-+    # If we are using a cross compiler then don't configure newlib.
-+    if test x${is_cross_compiler} != xno ; then
-+      noconfigdirs="$noconfigdirs target-newlib"
-+    fi
-+    noconfigdirs="$noconfigdirs target-libgloss"
-+    # If we are not using a cross compiler, do configure newlib.
-+    # Note however, that newlib will only be configured in this situation
-+    # if the --with-newlib option has been given, because otherwise
-+    # 'target-newlib' will appear in skipdirs.
-+    ;;
-   i[3456789]86-*-linux*)
-     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
-     # not build java stuff by default.
-diff -ur binutils-2.15.94.0.1.orig/configure.in binutils-2.15.94.0.1/configure.in
---- binutils-2.15.94.0.1.orig/configure.in     2004-11-22 21:29:57.902869272 -0500
-+++ binutils-2.15.94.0.1/configure.in  2004-11-22 21:31:47.606191832 -0500
-@@ -563,6 +563,18 @@
-   i[[3456789]]86-*-coff | i[[3456789]]86-*-elf)
-     noconfigdirs="$noconfigdirs ${libgcj}"
-     ;;
-+  i[[3456789]]86-*-linux-uclibc*)
-+    # This section makes it possible to build newlib natively on linux.
-+    # If we are using a cross compiler then don't configure newlib.
-+    if test x${is_cross_compiler} != xno ; then
-+      noconfigdirs="$noconfigdirs target-newlib"
-+    fi
-+    noconfigdirs="$noconfigdirs target-libgloss"
-+    # If we are not using a cross compiler, do configure newlib.
-+    # Note however, that newlib will only be configured in this situation
-+    # if the --with-newlib option has been given, because otherwise
-+    # 'target-newlib' will appear in skipdirs.
-+    ;;
-   i[[3456789]]86-*-linux*)
-     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
-     # not build java stuff by default.
-diff -ur binutils-2.15.94.0.1.orig/gas/configure binutils-2.15.94.0.1/gas/configure
---- binutils-2.15.94.0.1.orig/gas/configure    2004-11-22 21:29:58.078842520 -0500
-+++ binutils-2.15.94.0.1/gas/configure 2004-11-22 21:34:12.759125232 -0500
-@@ -3420,6 +3420,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -4256,6 +4261,7 @@
-       alpha*-*-osf*)                  fmt=ecoff ;;
-       alpha*-*-linuxecoff*)           fmt=ecoff ;;
-       alpha*-*-linux-gnu*)            fmt=elf em=linux ;;
-+      alpha*-*-linux-uclibc*)         fmt=elf em=linux ;;
-       alpha*-*-netbsd*)                       fmt=elf em=nbsd ;;
-       alpha*-*-openbsd*)              fmt=elf em=obsd ;;
-@@ -4271,6 +4277,7 @@
-       arm*-*-conix*)                  fmt=elf ;;
-       arm-*-linux*aout*)              fmt=aout em=linux ;;
-       arm*-*-linux-gnu*)              fmt=elf  em=linux ;;
-+      arm*-*-linux-uclibc*)           fmt=elf  em=linux ;;
-       arm*-*-uclinux*)                        fmt=elf  em=linux ;;
-       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
-       arm-*-*n*bsd*)                  fmt=aout em=nbsd ;;
-@@ -4284,6 +4291,7 @@
-       cris-*-linux-gnu* | crisv32-*-linux-gnu*)
-                                       fmt=multi bfd_gas=yes em=linux ;;
-+      cris-*-linux-uclibc*)           fmt=multi bfd_gas=yes em=linux ;;
-       cris-*-* | crisv32-*-*)         fmt=multi bfd_gas=yes ;;
-       crx-*-elf*)                     fmt=elf ;;
-@@ -4343,7 +4351,9 @@
-       i386-*-linux*oldld)             fmt=aout em=linux ;;
-       i386-*-linux*coff*)             fmt=coff em=linux ;;
-       i386-*-linux-gnu*)              fmt=elf em=linux ;;
-+      i386-*-linux-uclibc*)           fmt=elf em=linux ;;
-       x86_64-*-linux-gnu*)            fmt=elf em=linux ;;
-+      x86_64-*-linux-uclibc*)         fmt=elf em=linux ;;
-       i386-*-lynxos*)                 fmt=elf em=lynx bfd_gas=yes ;;
-       i386-*-sysv[45]*)                       fmt=elf ;;
-       i386-*-solaris*)                        fmt=elf ;;
-@@ -4403,6 +4413,7 @@
-       ia64-*-elf*)                    fmt=elf ;;
-       ia64-*-aix*)                    fmt=elf em=ia64aix ;;
-       ia64-*-linux-gnu*)              fmt=elf em=linux ;;
-+      ia64-*-linux-uclibc*)           fmt=elf em=linux ;;
-       ia64-*-hpux*)                   fmt=elf em=hpux ;;
-       ia64-*-netbsd*)                 fmt=elf em=nbsd ;;
-@@ -4430,6 +4441,7 @@
-       m68k-*-hpux*)                   fmt=hp300 em=hp300 ;;
-       m68k-*-linux*aout*)             fmt=aout em=linux ;;
-       m68k-*-linux-gnu*)              fmt=elf em=linux ;;
-+      m68k-*-linux-uclibc*)           fmt=elf em=linux ;;
-       m68k-*-uclinux*)                        fmt=elf ;;
-       m68k-*-gnu*)                    fmt=elf ;;
-       m68k-*-lynxos*)                 fmt=coff em=lynx ;;
-@@ -4504,6 +4516,7 @@
-       ppc-*-beos*)                    fmt=coff ;;
-       ppc-*-*n*bsd* | ppc-*-elf*)     fmt=elf ;;
-       ppc-*-eabi* | ppc-*-sysv4*)     fmt=elf ;;
-+      ppc-*-linux-uclibc* | \
-       ppc-*-linux-gnu*)                       fmt=elf em=linux
-           case "$endian" in
-               big)  ;;
-@@ -4531,7 +4544,9 @@
-       ppc-*-lynxos*)                  fmt=elf em=lynx bfd_gas=yes ;;
-       s390x-*-linux-gnu*)             fmt=elf em=linux ;;
-+      s390x-*-linux-uclibc*)          fmt=elf em=linux ;;
-       s390-*-linux-gnu*)              fmt=elf em=linux ;;
-+      s390-*-linux-uclibc*)           fmt=elf em=linux ;;
-       sh*-*-linux*)                   fmt=elf em=linux
-           case ${cpu} in
-@@ -4566,6 +4581,7 @@
-       sparc-*-coff)                   fmt=coff ;;
-       sparc-*-linux*aout*)            fmt=aout em=linux ;;
-       sparc-*-linux-gnu*)             fmt=elf em=linux ;;
-+      sparc-*-linux-uclibc*)          fmt=elf em=linux ;;
-       sparc-*-lynxos*)                        fmt=coff em=lynx ;;
-       sparc-fujitsu-none)             fmt=aout ;;
-       sparc-*-elf)                    fmt=elf ;;
-diff -ur binutils-2.15.94.0.1.orig/gas/configure.in binutils-2.15.94.0.1/gas/configure.in
---- binutils-2.15.94.0.1.orig/gas/configure.in 2004-11-22 21:29:58.079842368 -0500
-+++ binutils-2.15.94.0.1/gas/configure.in      2004-11-22 21:34:12.763124624 -0500
-@@ -202,6 +202,7 @@
-       alpha*-*-osf*)                  fmt=ecoff ;;
-       alpha*-*-linuxecoff*)           fmt=ecoff ;;
-       alpha*-*-linux-gnu*)            fmt=elf em=linux ;;
-+      alpha*-*-linux-uclibc*)         fmt=elf em=linux ;;
-       alpha*-*-netbsd*)                       fmt=elf em=nbsd ;;
-       alpha*-*-openbsd*)              fmt=elf em=obsd ;;
-@@ -217,6 +218,7 @@
-       arm*-*-conix*)                  fmt=elf ;;
-       arm-*-linux*aout*)              fmt=aout em=linux ;;
-       arm*-*-linux-gnu*)              fmt=elf  em=linux ;;
-+      arm*-*-linux-uclibc*)           fmt=elf  em=linux ;;
-       arm*-*-uclinux*)                        fmt=elf  em=linux ;;
-       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
-       arm-*-*n*bsd*)                  fmt=aout em=nbsd ;;
-@@ -230,6 +232,7 @@
-       cris-*-linux-gnu* | crisv32-*-linux-gnu*)
-                                       fmt=multi bfd_gas=yes em=linux ;;
-+      cris-*-linux-uclibc*)           fmt=multi bfd_gas=yes em=linux ;;
-       cris-*-* | crisv32-*-*)         fmt=multi bfd_gas=yes ;;
-       crx-*-elf*)                     fmt=elf ;;
-@@ -289,7 +292,9 @@
-       i386-*-linux*oldld)             fmt=aout em=linux ;;
-       i386-*-linux*coff*)             fmt=coff em=linux ;;
-       i386-*-linux-gnu*)              fmt=elf em=linux ;;
-+      i386-*-linux-uclibc*)           fmt=elf em=linux ;;
-       x86_64-*-linux-gnu*)            fmt=elf em=linux ;;
-+      x86_64-*-linux-uclibc*)         fmt=elf em=linux ;;
-       i386-*-lynxos*)                 fmt=elf em=lynx bfd_gas=yes ;;
- changequote(,)dnl
-       i386-*-sysv[45]*)                       fmt=elf ;;
-@@ -342,6 +347,7 @@
-       ia64-*-elf*)                    fmt=elf ;;
-       ia64-*-aix*)                    fmt=elf em=ia64aix ;;
-       ia64-*-linux-gnu*)              fmt=elf em=linux ;;
-+      ia64-*-linux-uclibc*)           fmt=elf em=linux ;;
-       ia64-*-hpux*)                   fmt=elf em=hpux ;;
-       ia64-*-netbsd*)                 fmt=elf em=nbsd ;;
-@@ -369,6 +375,7 @@
-       m68k-*-hpux*)                   fmt=hp300 em=hp300 ;;
-       m68k-*-linux*aout*)             fmt=aout em=linux ;;
-       m68k-*-linux-gnu*)              fmt=elf em=linux ;;
-+      m68k-*-linux-uclibc*)           fmt=elf em=linux ;;
-       m68k-*-uclinux*)                        fmt=elf ;;
-       m68k-*-gnu*)                    fmt=elf ;;
-       m68k-*-lynxos*)                 fmt=coff em=lynx ;;
-@@ -440,6 +447,7 @@
-       ppc-*-beos*)                    fmt=coff ;;
-       ppc-*-*n*bsd* | ppc-*-elf*)     fmt=elf ;;
-       ppc-*-eabi* | ppc-*-sysv4*)     fmt=elf ;;
-+      ppc-*-linux-uclibc* | \
-       ppc-*-linux-gnu*)                       fmt=elf em=linux
-           case "$endian" in
-               big)  ;;
-@@ -460,7 +468,9 @@
-       ppc-*-lynxos*)                  fmt=elf em=lynx bfd_gas=yes ;;
-       s390x-*-linux-gnu*)             fmt=elf em=linux ;;
-+      s390x-*-linux-uclibc*)          fmt=elf em=linux ;;
-       s390-*-linux-gnu*)              fmt=elf em=linux ;;
-+      s390-*-linux-uclibc*)           fmt=elf em=linux ;;
-       sh*-*-linux*)                   fmt=elf em=linux
-           case ${cpu} in
-@@ -491,6 +501,7 @@
-       sparc-*-coff)                   fmt=coff ;;
-       sparc-*-linux*aout*)            fmt=aout em=linux ;;
-       sparc-*-linux-gnu*)             fmt=elf em=linux ;;
-+      sparc-*-linux-uclibc*)          fmt=elf em=linux ;;
-       sparc-*-lynxos*)                        fmt=coff em=lynx ;;
-       sparc-fujitsu-none)             fmt=aout ;;
-       sparc-*-elf)                    fmt=elf ;;
-diff -ur binutils-2.15.94.0.1.orig/gprof/configure binutils-2.15.94.0.1/gprof/configure
---- binutils-2.15.94.0.1.orig/gprof/configure  2004-11-22 21:29:58.628758920 -0500
-+++ binutils-2.15.94.0.1/gprof/configure       2004-11-22 21:34:12.777122496 -0500
-@@ -3418,6 +3418,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -ur binutils-2.15.94.0.1.orig/ld/configure binutils-2.15.94.0.1/ld/configure
---- binutils-2.15.94.0.1.orig/ld/configure     2004-11-22 21:29:58.752740072 -0500
-+++ binutils-2.15.94.0.1/ld/configure  2004-11-22 21:34:12.784121432 -0500
-@@ -1579,6 +1579,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -ur binutils-2.15.94.0.1.orig/ld/configure.tgt binutils-2.15.94.0.1/ld/configure.tgt
---- binutils-2.15.94.0.1.orig/ld/configure.tgt 2004-11-22 21:29:58.753739920 -0500
-+++ binutils-2.15.94.0.1/ld/configure.tgt      2004-11-22 21:38:50.336926992 -0500
-@@ -32,6 +32,7 @@
-                       targ_extra_libpath=$targ_extra_emuls ;;
- cris-*-linux-gnu* | cris-*-linux-gnu*)
-                       targ_emul=crislinux ;;
-+cris-*-linux-uclibc*) targ_emul=crislinux ;;
- cris-*-* | crisv32-*-*)       targ_emul=criself
-                       targ_extra_emuls="crisaout crislinux"
-                       targ_extra_libpath=$targ_extra_emuls ;;
-@@ -62,14 +63,16 @@
-                       tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
-                       tdir_sun4=sparc-sun-sunos4
-                       ;;
--sparc64-*-linux-gnu*) targ_emul=elf64_sparc
-+sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)        \
-+                      targ_emul=elf64_sparc
-                       targ_extra_emuls="elf32_sparc sparclinux sun4"
-                       targ_extra_libpath=elf32_sparc
-                       tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
-                       tdir_sparclinux=${tdir_elf32_sparc}aout
-                       tdir_sun4=sparc-sun-sunos4
-                       ;;
--sparc*-*-linux-gnu*)  targ_emul=elf32_sparc
-+sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
-+                      targ_emul=elf32_sparc
-                       targ_extra_emuls="sparclinux elf64_sparc sun4"
-                       targ_extra_libpath=elf64_sparc
-                       tdir_sparclinux=${targ_alias}aout
-@@ -121,7 +124,9 @@
- m32r*le-*-elf*)         targ_emul=m32rlelf ;;
- m32r*-*-elf*)           targ_emul=m32relf ;;
- m32r*le-*-linux-gnu*)   targ_emul=m32rlelf_linux ;;
-+m32r*le-*-linux-uclibc*) targ_emul=m32rlelf_linux ;;
- m32r*-*-linux-gnu*)     targ_emul=m32relf_linux ;;
-+m32r*-*-linux-uclibc*)  targ_emul=m32relf_linux ;;
- m68hc11-*-*|m6811-*-*)        targ_emul=m68hc11elf 
-                       targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
- m68hc12-*-*|m6812-*-*)        targ_emul=m68hc12elf 
-@@ -132,7 +137,7 @@
- m68*-apple-aux*)      targ_emul=m68kaux ;;
- maxq-*-coff)            targ_emul=maxqcoff;;
- *-tandem-none)                targ_emul=st2000 ;;
--i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
-+i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
- i[3-7]86-*-nto-qnx*)  targ_emul=i386nto ;;
- i[3-7]86-*-vsta)      targ_emul=vsta ;;
- i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
-@@ -156,14 +161,16 @@
-                       tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
-                       ;;
- i[3-7]86-*-linux*oldld)       targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
--i[3-7]86-*-linux-gnu*)        targ_emul=elf_i386
-+i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
-+                      targ_emul=elf_i386
-                       targ_extra_emuls=i386linux
-                       if test x${want64} = xtrue; then
-                         targ_extra_emuls="$targ_extra_emuls elf_x86_64"
-                       fi
-                       tdir_i386linux=${targ_alias}aout
-                       ;;
--x86_64-*-linux-gnu*)  targ_emul=elf_x86_64
-+x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
-+                      targ_emul=elf_x86_64
-                       targ_extra_emuls="elf_i386 i386linux"
-                       targ_extra_libpath=elf_i386
-                       tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
-@@ -263,11 +270,14 @@
- arm-*-kaos*)          targ_emul=armelf ;;
- arm9e-*-elf)          targ_emul=armelf ;;
- arm*b-*-linux-gnu*)   targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
-+arm*b-*-linux-uclibc*)        targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
- arm*-*-linux-gnueabi) targ_emul=armelf_linux_eabi ;;
- arm*-*-linux-gnu*)    targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
-+arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- arm*-*-uclinux*)      targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- arm*-*-conix*)                targ_emul=armelf ;;
--thumb-*-linux-gnu* | thumb-*-uclinux*)        targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
-+thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
-+                      targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
- strongarm-*-coff)     targ_emul=armcoff ;;
- strongarm-*-elf)      targ_emul=armelf ;;
- strongarm-*-kaos*)    targ_emul=armelf ;;
-@@ -371,7 +381,8 @@
-                       targ_extra_emuls=m68kelf
-                       tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
-                       ;;
--m68k-*-linux-gnu*)    targ_emul=m68kelf
-+m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
-+                      targ_emul=m68kelf
-                       targ_extra_emuls=m68klinux
-                       tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
-                       ;;
-@@ -388,9 +399,9 @@
- m68*-*-psos*)         targ_emul=m68kpsos ;;
- m68*-*-rtemscoff*)    targ_emul=m68kcoff ;;
- m68*-*-rtems*)                targ_emul=m68kelf ;;
--hppa*64*-*-linux-gnu*)        targ_emul=hppa64linux ;;
-+hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)  targ_emul=hppa64linux ;;
- hppa*64*-*)           targ_emul=elf64hppa ;;
--hppa*-*-linux-gnu*)   targ_emul=hppalinux ;;
-+hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*)   targ_emul=hppalinux ;;
- hppa*-*-*elf*)                targ_emul=hppaelf ;;
- hppa*-*-lites*)               targ_emul=hppaelf ;;
- hppa*-*-netbsd*)      targ_emul=hppanbsd ;;
-@@ -403,6 +414,7 @@
-                       targ_emul=vaxnbsd
-                       targ_extra_emuls=elf32vax ;;
- vax-*-linux-gnu*)     targ_emul=elf32vax ;;
-+vax-*-linux-uclibc*)  targ_emul=elf32vax ;;
- mips*-*-pe)           targ_emul=mipspe ;
-                       targ_extra_ofiles="deffilep.o pe-dll.o" ;;
- mips*-dec-ultrix*)    targ_emul=mipslit ;;
-@@ -436,16 +448,16 @@
- mips*-*-vxworks*)     targ_emul=elf32ebmip
-                       targ_extra_emuls="elf32elmip" ;;
- mips*-*-windiss)      targ_emul=elf32mipswindiss ;;
--mips64*el-*-linux-gnu*)       targ_emul=elf32ltsmipn32
-+mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*)   targ_emul=elf32ltsmipn32
-                       targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
-                       ;;
--mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
-+mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*)       targ_emul=elf32btsmipn32
-                       targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
-                       ;;
--mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
-+mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*)       targ_emul=elf32ltsmip
-                       targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
-                       ;;
--mips*-*-linux-gnu*)   targ_emul=elf32btsmip
-+mips*-*-linux-gnu* | mips*-*-linux-uclibc*)   targ_emul=elf32btsmip
-                       targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
-                       ;;
- mips*-*-lnews*)               targ_emul=mipslnews ;;
-@@ -468,6 +480,10 @@
- alpha*-*-linux-gnu*)  targ_emul=elf64alpha targ_extra_emuls=alpha
-                       tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
-                       ;;
-+alpha*-*-linux-uclibc*)       targ_emul=elf64alpha targ_extra_emuls=alpha
-+                      # The following needs to be checked...
-+                      tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
-+                      ;;
- alpha*-*-osf*)                targ_emul=alpha ;;
- alpha*-*-gnu*)                targ_emul=elf64alpha ;;
- alpha*-*-netware*)    targ_emul=alpha ;;
-diff -ur binutils-2.15.94.0.1.orig/ld/emultempl/elf32.em binutils-2.15.94.0.1/ld/emultempl/elf32.em
---- binutils-2.15.94.0.1.orig/ld/emultempl/elf32.em    2004-11-22 21:29:58.763738400 -0500
-+++ binutils-2.15.94.0.1/ld/emultempl/elf32.em 2004-11-22 21:38:50.338926688 -0500
-@@ -65,7 +65,7 @@
- if [ "x${USE_LIBPATH}" = xyes ] ; then
-   case ${target} in
--    *-*-linux-gnu*)
-+    *-*-linux-gnu* | *-*-linux-uclibc*)
-   cat >>e${EMULATION_NAME}.c <<EOF
- #include <glob.h>
- EOF
-@@ -337,7 +337,7 @@
- EOF
- case ${target} in
--  *-*-linux-gnu*)
-+  *-*-linux-gnu* | *-*-linux-uclibc*)
-     cat >>e${EMULATION_NAME}.c <<EOF
-         {
-           struct bfd_link_needed_list *l;
-@@ -510,7 +510,7 @@
- EOF
-   case ${target} in
--    *-*-linux-gnu*)
-+    *-*-linux-gnu* | *-*-linux-uclibc*)
-       cat >>e${EMULATION_NAME}.c <<EOF
- /* For a native linker, check the file /etc/ld.so.conf for directories
-    in which we may find shared libraries.  /etc/ld.so.conf is really
-@@ -894,7 +894,7 @@
- EOF
- if [ "x${USE_LIBPATH}" = xyes ] ; then
-   case ${target} in
--    *-*-linux-gnu*)
-+    *-*-linux-gnu* | *-*-linux-uclibc*)
-       cat >>e${EMULATION_NAME}.c <<EOF
-         if (gld${EMULATION_NAME}_check_ld_so_conf (l->name, force))
-           break;
-diff -ur binutils-2.15.94.0.1.orig/libtool.m4 binutils-2.15.94.0.1/libtool.m4
---- binutils-2.15.94.0.1.orig/libtool.m4       2004-11-22 21:29:57.000000000 -0500
-+++ binutils-2.15.94.0.1/libtool.m4    2004-11-22 21:38:50.339926536 -0500
-@@ -645,6 +645,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
-diff -ur binutils-2.15.94.0.1.orig/ltconfig binutils-2.15.94.0.1/ltconfig
---- binutils-2.15.94.0.1.orig/ltconfig 2004-11-22 21:29:57.000000000 -0500
-+++ binutils-2.15.94.0.1/ltconfig      2004-11-22 21:38:50.341926232 -0500
-@@ -603,6 +603,7 @@
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case $host_os in
- linux-gnu*) ;;
-+linux-uclibc*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
-@@ -1270,6 +1271,24 @@
-   dynamic_linker='GNU/Linux ld.so'
-   ;;
-+linux-uclibc*)
-+  version_type=linux
-+  need_lib_prefix=no
-+  need_version=no
-+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-+  soname_spec='${libname}${release}.so$major'
-+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-+  shlibpath_var=LD_LIBRARY_PATH
-+  shlibpath_overrides_runpath=no
-+  # This implies no fast_install, which is unacceptable.
-+  # Some rework will be needed to allow for fast_install
-+  # before this can be enabled.
-+  # Note: copied from linux-gnu, and may not be appropriate.
-+  hardcode_into_libs=yes
-+  # Assume using the uClibc dynamic linker.
-+  dynamic_linker="uClibc ld.so"
-+  ;;
-+
- netbsd*)
-   need_lib_prefix=no
-   need_version=no
-diff -ur binutils-2.15.94.0.1.orig/opcodes/configure binutils-2.15.94.0.1/opcodes/configure
---- binutils-2.15.94.0.1.orig/opcodes/configure        2004-11-22 21:29:59.114685048 -0500
-+++ binutils-2.15.94.0.1/opcodes/configure     2004-11-22 21:38:50.354924256 -0500
-@@ -3587,6 +3587,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
diff --git a/openwrt/toolchain/binutils/2.15.94.0.1/300-001_ld_makefile_patch.patch b/openwrt/toolchain/binutils/2.15.94.0.1/300-001_ld_makefile_patch.patch
deleted file mode 100644 (file)
index b25d5b7..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/sh -e
-## 001_ld_makefile_patch.dpatch
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Description: correct where ld scripts are installed
-## DP: Author: Chris Chimelis <chris@debian.org>
-## DP: Upstream status: N/A
-## DP: Date: ??
-
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-
-[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
-
-case "$1" in
-       -patch) patch $patch_opts -p1 < $0;;
-       -unpatch) patch $patch_opts -p1 -R < $0;;
-        *)
-                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-                exit 1;;
-esac
-
-exit 0
-
-@DPATCH@
-diff -urNad /home/james/debian/packages/binutils/binutils-2.14.90.0.6/ld/Makefile.am binutils-2.14.90.0.6/ld/Makefile.am
---- /home/james/debian/packages/binutils/binutils-2.14.90.0.6/ld/Makefile.am   2003-08-21 16:28:48.000000000 +0100
-+++ binutils-2.14.90.0.6/ld/Makefile.am        2003-09-10 23:12:09.000000000 +0100
-@@ -19,7 +19,7 @@
- # We put the scripts in the directory $(scriptdir)/ldscripts.
- # We can't put the scripts in $(datadir) because the SEARCH_DIR
- # directives need to be different for native and cross linkers.
--scriptdir = $(tooldir)/lib
-+scriptdir = $(libdir)
- EMUL = @EMUL@
- EMULATION_OFILES = @EMULATION_OFILES@
-diff -urNad /home/james/debian/packages/binutils/binutils-2.14.90.0.6/ld/Makefile.in binutils-2.14.90.0.6/ld/Makefile.in
---- /home/james/debian/packages/binutils/binutils-2.14.90.0.6/ld/Makefile.in   2003-08-21 16:28:48.000000000 +0100
-+++ binutils-2.14.90.0.6/ld/Makefile.in        2003-09-10 23:12:09.000000000 +0100
-@@ -128,7 +128,7 @@
- # We put the scripts in the directory $(scriptdir)/ldscripts.
- # We can't put the scripts in $(datadir) because the SEARCH_DIR
- # directives need to be different for native and cross linkers.
--scriptdir = $(tooldir)/lib
-+scriptdir = $(libdir)
- EMUL = @EMUL@
- EMULATION_OFILES = @EMULATION_OFILES@
diff --git a/openwrt/toolchain/binutils/2.15.94.0.1/300-006_better_file_error.patch b/openwrt/toolchain/binutils/2.15.94.0.1/300-006_better_file_error.patch
deleted file mode 100644 (file)
index f337611..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/sh -e
-## 006_better_file_error.dpatch by David Kimdon <dwhedon@gordian.com>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Specify which filename is causing an error if the filename is a
-## DP: directory. (#45832)
-
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-
-[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
-
-case "$1" in
-       -patch) patch $patch_opts -p1 < $0;;
-       -unpatch) patch $patch_opts -p1 -R < $0;;
-        *)
-                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-                exit 1;;
-esac
-
-exit 0
-
-@DPATCH@
-diff -urNad /home/james/debian/packages/binutils/binutils-2.14.90.0.6/bfd/opncls.c binutils-2.14.90.0.6/bfd/opncls.c
---- /home/james/debian/packages/binutils/binutils-2.14.90.0.6/bfd/opncls.c     2003-07-23 16:08:09.000000000 +0100
-+++ binutils-2.14.90.0.6/bfd/opncls.c  2003-09-10 22:35:00.000000000 +0100
-@@ -150,6 +150,13 @@
- {
-   bfd *nbfd;
-   const bfd_target *target_vec;
-+  struct stat s;
-+
-+  if (stat (filename, &s) == 0)
-+    if (S_ISDIR(s.st_mode)) {
-+      bfd_set_error (bfd_error_file_not_recognized);
-+      return NULL;
-+    }
-   nbfd = _bfd_new_bfd ();
-   if (nbfd == NULL)
diff --git a/openwrt/toolchain/binutils/2.15.94.0.1/300-012_check_ldrunpath_length.patch b/openwrt/toolchain/binutils/2.15.94.0.1/300-012_check_ldrunpath_length.patch
deleted file mode 100644 (file)
index 498651a..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh -e
-## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for
-## DP: cases where -rpath isn't specified. (#151024)
-
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-
-[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
-
-case "$1" in
-       -patch) patch $patch_opts -p1 < $0;;
-       -unpatch) patch $patch_opts -p1 -R < $0;;
-        *)
-                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-                exit 1;;
-esac
-
-exit 0
-
-@DPATCH@
-diff -urNad /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em binutils-2.15/ld/emultempl/elf32.em
---- /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em       2004-05-21 23:12:58.000000000 +0100
-+++ binutils-2.15/ld/emultempl/elf32.em        2004-05-21 23:12:59.000000000 +0100
-@@ -692,6 +692,8 @@
-             && command_line.rpath == NULL)
-           {
-             lib_path = (const char *) getenv ("LD_RUN_PATH");
-+            if ((lib_path) && (strlen (lib_path) == 0))
-+                lib_path = NULL;
-             if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
-                                                     force))
-               break;
-@@ -871,6 +873,8 @@
-   rpath = command_line.rpath;
-   if (rpath == NULL)
-     rpath = (const char *) getenv ("LD_RUN_PATH");
-+  if ((rpath) && (strlen (rpath) == 0))
-+      rpath = NULL;
-   if (! (bfd_elf_size_dynamic_sections
-        (output_bfd, command_line.soname, rpath,
-         command_line.filter_shlib,
diff --git a/openwrt/toolchain/binutils/2.15.94.0.1/300-120_mips_xgot_multigot_workaround.patch b/openwrt/toolchain/binutils/2.15.94.0.1/300-120_mips_xgot_multigot_workaround.patch
deleted file mode 100644 (file)
index ae2033d..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#! /bin/sh -e
-## 120_mips_xgot_multigot_workaround.dpatch
-##
-## DP: Description: Make multigot/xgot handling mutually exclusive.
-## DP: Author: Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
-## DP: Upstream status: Not submitted
-## DP: Date: 2004-09-17
-
-if [ $# -lt 1 ]; then
-    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-    exit 1
-fi
-
-[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
-
-case "$1" in
-    -patch) patch -p1 ${patch_opts} < $0;;
-    -unpatch) patch -R -p1 ${patch_opts} < $0;;
-    *)
-        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-        exit 1;;
-esac
-
-exit 0
-
-@DPATCH@
-diff -urNad /home/james/debian/packages/binutils/binutils-2.15/bfd/elfxx-mips.c binutils-2.15/bfd/elfxx-mips.c
---- /home/james/debian/packages/binutils/binutils-2.15/bfd/elfxx-mips.c        2004-09-23 22:41:37.156466673 +0100
-+++ binutils-2.15/bfd/elfxx-mips.c     2004-09-23 22:42:15.998362861 +0100
-@@ -5883,6 +5883,8 @@
-   s->size += i * MIPS_ELF_GOT_SIZE (output_bfd);
-   if (s->size > MIPS_ELF_GOT_MAX_SIZE (output_bfd)
-+      && g->global_gotno <= (MIPS_ELF_GOT_MAX_SIZE (output_bfd)
-+                            / MIPS_ELF_GOT_SIZE (output_bfd))
-       && ! mips_elf_multi_got (output_bfd, info, g, s, local_gotno))
-     return FALSE;
diff --git a/openwrt/toolchain/binutils/2.15.94.0.1/702-binutils-skip-comments.patch b/openwrt/toolchain/binutils/2.15.94.0.1/702-binutils-skip-comments.patch
deleted file mode 100644 (file)
index 804a17e..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
-Fixes
-localealias.s:544: Error: junk at end of line, first unrecognized character is `,' 
-when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
-
-Paths adjusted to match crosstool's patcher.
-
-Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
-From: Andreas Schwab <schwab at suse dot de>
-To: Nathan Sidwell <nathan at codesourcery dot com>
-Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
-Date: Fri, 23 Apr 2004 22:27:19 +0200
-Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
-
-Nathan Sidwell <nathan@codesourcery.com> writes:
-
-> Index: read.c
-> ===================================================================
-> RCS file: /cvs/src/src/gas/read.c,v
-> retrieving revision 1.76
-> diff -c -3 -p -r1.76 read.c
-> *** read.c   12 Mar 2004 17:48:12 -0000      1.76
-> --- read.c   18 Mar 2004 09:56:05 -0000
-> *************** read_a_source_file (char *name)
-> *** 1053,1059 ****
->   #endif
->        input_line_pointer--;
->        /* Report unknown char as ignored.  */
-> !      ignore_rest_of_line ();
->      }
->   
->   #ifdef md_after_pass_hook
-> --- 1053,1059 ----
->   #endif
->        input_line_pointer--;
->        /* Report unknown char as ignored.  */
-> !      demand_empty_rest_of_line ();
->      }
->   
->   #ifdef md_after_pass_hook
-
-This means that the unknown character is no longer ignored, despite the
-comment.  As a side effect a line starting with a line comment character
-not followed by APP in NO_APP mode now triggers an error instead of just a
-warning, breaking builds of glibc on m68k-linux.  Earlier in
-read_a_source_file where #APP is handled there is another comment that
-claims that unknown comments are ignored, when in fact they aren't (only
-the initial line comment character is skipped).
-
-Note that the presence of #APP will mess up the line counters, but
-that appears to be difficult to fix.
-
-Andreas.
-
-2004-04-23  Andreas Schwab  <schwab@suse.de>
-
-       * read.c (read_a_source_file): Ignore unknown text after line
-       comment character.  Fix misleading comment.
-
---- binutils/gas/read.c.~1.78.~        2004-04-23 08:58:23.000000000 +0200
-+++ binutils/gas/read.c        2004-04-23 21:49:01.000000000 +0200
-@@ -1,6 +1,6 @@
- /* read.c - read a source file -
-    Copyright 1986, 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
--   1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-+   1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
- This file is part of GAS, the GNU Assembler.
-@@ -950,10 +950,14 @@ read_a_source_file (char *name)
-             unsigned int new_length;
-             char *tmp_buf = 0;
--            bump_line_counters ();
-             s = input_line_pointer;
-             if (strncmp (s, "APP\n", 4))
--              continue;       /* We ignore it */
-+              {
-+                /* We ignore it */
-+                ignore_rest_of_line ();
-+                continue;
-+              }
-+            bump_line_counters ();
-             s += 4;
-             sb_new (&sbuf);
-@@ -1052,7 +1056,7 @@ read_a_source_file (char *name)
-           continue;
- #endif
-         input_line_pointer--;
--        /* Report unknown char as ignored.  */
-+        /* Report unknown char as error.  */
-         demand_empty_rest_of_line ();
-       }
-
--- 
-Andreas Schwab, SuSE Labs, schwab@suse.de
-SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
-Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
-"And now for something completely different."
diff --git a/openwrt/toolchain/binutils/2.16.90.0.1/100-uclibc-conf.patch b/openwrt/toolchain/binutils/2.16.90.0.1/100-uclibc-conf.patch
deleted file mode 100644 (file)
index ae7382e..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-diff -ur binutils-2.16.90.0.1.orig/bfd/configure binutils-2.16.90.0.1/bfd/configure
---- binutils-2.16.90.0.1.orig/bfd/configure    2005-04-11 02:19:41.000000000 -0400
-+++ binutils-2.16.90.0.1/bfd/configure 2005-04-11 02:19:54.000000000 -0400
-@@ -3584,6 +3584,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -ur binutils-2.16.90.0.1.orig/binutils/configure binutils-2.16.90.0.1/binutils/configure
---- binutils-2.16.90.0.1.orig/binutils/configure       2005-04-11 02:19:42.000000000 -0400
-+++ binutils-2.16.90.0.1/binutils/configure    2005-04-11 02:19:54.000000000 -0400
-@@ -1555,6 +1555,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -ur binutils-2.16.90.0.1.orig/gas/configure binutils-2.16.90.0.1/gas/configure
---- binutils-2.16.90.0.1.orig/gas/configure    2005-04-11 02:19:42.000000000 -0400
-+++ binutils-2.16.90.0.1/gas/configure 2005-04-11 02:19:54.000000000 -0400
-@@ -3421,6 +3421,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -ur binutils-2.16.90.0.1.orig/gprof/configure binutils-2.16.90.0.1/gprof/configure
---- binutils-2.16.90.0.1.orig/gprof/configure  2005-04-11 02:19:43.000000000 -0400
-+++ binutils-2.16.90.0.1/gprof/configure       2005-04-11 02:19:54.000000000 -0400
-@@ -3419,6 +3419,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -ur binutils-2.16.90.0.1.orig/ld/configure binutils-2.16.90.0.1/ld/configure
---- binutils-2.16.90.0.1.orig/ld/configure     2005-04-11 02:19:43.000000000 -0400
-+++ binutils-2.16.90.0.1/ld/configure  2005-04-11 02:19:54.000000000 -0400
-@@ -1581,6 +1581,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -ur binutils-2.16.90.0.1.orig/libtool.m4 binutils-2.16.90.0.1/libtool.m4
---- binutils-2.16.90.0.1.orig/libtool.m4       2005-04-11 02:19:42.000000000 -0400
-+++ binutils-2.16.90.0.1/libtool.m4    2005-04-11 02:19:54.000000000 -0400
-@@ -645,6 +645,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
-diff -ur binutils-2.16.90.0.1.orig/ltconfig binutils-2.16.90.0.1/ltconfig
---- binutils-2.16.90.0.1.orig/ltconfig 2005-04-11 02:19:42.000000000 -0400
-+++ binutils-2.16.90.0.1/ltconfig      2005-04-11 02:19:54.000000000 -0400
-@@ -603,6 +603,7 @@
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case $host_os in
- linux-gnu*) ;;
-+linux-uclibc*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
-@@ -1270,6 +1271,24 @@
-   dynamic_linker='GNU/Linux ld.so'
-   ;;
-+linux-uclibc*)
-+  version_type=linux
-+  need_lib_prefix=no
-+  need_version=no
-+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-+  soname_spec='${libname}${release}.so$major'
-+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-+  shlibpath_var=LD_LIBRARY_PATH
-+  shlibpath_overrides_runpath=no
-+  # This implies no fast_install, which is unacceptable.
-+  # Some rework will be needed to allow for fast_install
-+  # before this can be enabled.
-+  # Note: copied from linux-gnu, and may not be appropriate.
-+  hardcode_into_libs=yes
-+  # Assume using the uClibc dynamic linker.
-+  dynamic_linker="uClibc ld.so"
-+  ;;
-+
- netbsd*)
-   need_lib_prefix=no
-   need_version=no
-diff -ur binutils-2.16.90.0.1.orig/opcodes/configure binutils-2.16.90.0.1/opcodes/configure
---- binutils-2.16.90.0.1.orig/opcodes/configure        2005-04-11 02:19:44.000000000 -0400
-+++ binutils-2.16.90.0.1/opcodes/configure     2005-04-11 02:19:54.000000000 -0400
-@@ -3588,6 +3588,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
diff --git a/openwrt/toolchain/binutils/2.16.90.0.1/300-001_ld_makefile_patch.patch b/openwrt/toolchain/binutils/2.16.90.0.1/300-001_ld_makefile_patch.patch
deleted file mode 100644 (file)
index b25d5b7..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/sh -e
-## 001_ld_makefile_patch.dpatch
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Description: correct where ld scripts are installed
-## DP: Author: Chris Chimelis <chris@debian.org>
-## DP: Upstream status: N/A
-## DP: Date: ??
-
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-
-[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
-
-case "$1" in
-       -patch) patch $patch_opts -p1 < $0;;
-       -unpatch) patch $patch_opts -p1 -R < $0;;
-        *)
-                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-                exit 1;;
-esac
-
-exit 0
-
-@DPATCH@
-diff -urNad /home/james/debian/packages/binutils/binutils-2.14.90.0.6/ld/Makefile.am binutils-2.14.90.0.6/ld/Makefile.am
---- /home/james/debian/packages/binutils/binutils-2.14.90.0.6/ld/Makefile.am   2003-08-21 16:28:48.000000000 +0100
-+++ binutils-2.14.90.0.6/ld/Makefile.am        2003-09-10 23:12:09.000000000 +0100
-@@ -19,7 +19,7 @@
- # We put the scripts in the directory $(scriptdir)/ldscripts.
- # We can't put the scripts in $(datadir) because the SEARCH_DIR
- # directives need to be different for native and cross linkers.
--scriptdir = $(tooldir)/lib
-+scriptdir = $(libdir)
- EMUL = @EMUL@
- EMULATION_OFILES = @EMULATION_OFILES@
-diff -urNad /home/james/debian/packages/binutils/binutils-2.14.90.0.6/ld/Makefile.in binutils-2.14.90.0.6/ld/Makefile.in
---- /home/james/debian/packages/binutils/binutils-2.14.90.0.6/ld/Makefile.in   2003-08-21 16:28:48.000000000 +0100
-+++ binutils-2.14.90.0.6/ld/Makefile.in        2003-09-10 23:12:09.000000000 +0100
-@@ -128,7 +128,7 @@
- # We put the scripts in the directory $(scriptdir)/ldscripts.
- # We can't put the scripts in $(datadir) because the SEARCH_DIR
- # directives need to be different for native and cross linkers.
--scriptdir = $(tooldir)/lib
-+scriptdir = $(libdir)
- EMUL = @EMUL@
- EMULATION_OFILES = @EMULATION_OFILES@
diff --git a/openwrt/toolchain/binutils/2.16.90.0.1/300-006_better_file_error.patch b/openwrt/toolchain/binutils/2.16.90.0.1/300-006_better_file_error.patch
deleted file mode 100644 (file)
index f337611..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/sh -e
-## 006_better_file_error.dpatch by David Kimdon <dwhedon@gordian.com>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Specify which filename is causing an error if the filename is a
-## DP: directory. (#45832)
-
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-
-[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
-
-case "$1" in
-       -patch) patch $patch_opts -p1 < $0;;
-       -unpatch) patch $patch_opts -p1 -R < $0;;
-        *)
-                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-                exit 1;;
-esac
-
-exit 0
-
-@DPATCH@
-diff -urNad /home/james/debian/packages/binutils/binutils-2.14.90.0.6/bfd/opncls.c binutils-2.14.90.0.6/bfd/opncls.c
---- /home/james/debian/packages/binutils/binutils-2.14.90.0.6/bfd/opncls.c     2003-07-23 16:08:09.000000000 +0100
-+++ binutils-2.14.90.0.6/bfd/opncls.c  2003-09-10 22:35:00.000000000 +0100
-@@ -150,6 +150,13 @@
- {
-   bfd *nbfd;
-   const bfd_target *target_vec;
-+  struct stat s;
-+
-+  if (stat (filename, &s) == 0)
-+    if (S_ISDIR(s.st_mode)) {
-+      bfd_set_error (bfd_error_file_not_recognized);
-+      return NULL;
-+    }
-   nbfd = _bfd_new_bfd ();
-   if (nbfd == NULL)
diff --git a/openwrt/toolchain/binutils/2.16.90.0.1/300-012_check_ldrunpath_length.patch b/openwrt/toolchain/binutils/2.16.90.0.1/300-012_check_ldrunpath_length.patch
deleted file mode 100644 (file)
index 498651a..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh -e
-## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for
-## DP: cases where -rpath isn't specified. (#151024)
-
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-
-[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
-
-case "$1" in
-       -patch) patch $patch_opts -p1 < $0;;
-       -unpatch) patch $patch_opts -p1 -R < $0;;
-        *)
-                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-                exit 1;;
-esac
-
-exit 0
-
-@DPATCH@
-diff -urNad /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em binutils-2.15/ld/emultempl/elf32.em
---- /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em       2004-05-21 23:12:58.000000000 +0100
-+++ binutils-2.15/ld/emultempl/elf32.em        2004-05-21 23:12:59.000000000 +0100
-@@ -692,6 +692,8 @@
-             && command_line.rpath == NULL)
-           {
-             lib_path = (const char *) getenv ("LD_RUN_PATH");
-+            if ((lib_path) && (strlen (lib_path) == 0))
-+                lib_path = NULL;
-             if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
-                                                     force))
-               break;
-@@ -871,6 +873,8 @@
-   rpath = command_line.rpath;
-   if (rpath == NULL)
-     rpath = (const char *) getenv ("LD_RUN_PATH");
-+  if ((rpath) && (strlen (rpath) == 0))
-+      rpath = NULL;
-   if (! (bfd_elf_size_dynamic_sections
-        (output_bfd, command_line.soname, rpath,
-         command_line.filter_shlib,
diff --git a/openwrt/toolchain/binutils/2.16.90.0.1/300-120_mips_xgot_multigot_workaround.patch b/openwrt/toolchain/binutils/2.16.90.0.1/300-120_mips_xgot_multigot_workaround.patch
deleted file mode 100644 (file)
index 036712e..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#! /bin/sh -e
-## 120_mips_xgot_multigot_workaround.dpatch
-##
-## DP: Description: Make multigot/xgot handling mutually exclusive.
-## DP: Author: Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
-## DP: Upstream status: Not submitted
-## DP: Date: 2004-09-17
-
-if [ $# -lt 1 ]; then
-    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-    exit 1
-fi
-
-[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
-
-case "$1" in
-    -patch) patch -p1 ${patch_opts} < $0;;
-    -unpatch) patch -R -p1 ${patch_opts} < $0;;
-    *)
-        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-        exit 1;;
-esac
-
-exit 0
-
-@DPATCH@
-diff -urNad /home/james/debian/packages/binutils/binutils-2.15/bfd/elfxx-mips.c binutils-2.15/bfd/elfxx-mips.c
---- /home/james/debian/packages/binutils/binutils-2.15/bfd/elfxx-mips.c        2004-09-23 22:41:37.156466673 +0100
-+++ binutils-2.15/bfd/elfxx-mips.c     2004-09-23 22:42:15.998362861 +0100
-@@ -6594,7 +6594,9 @@
-   mips_elf_resolve_final_got_entries (g);
--  if (s->size > MIPS_ELF_GOT_MAX_SIZE (output_bfd))
-+  if (s->size > MIPS_ELF_GOT_MAX_SIZE (output_bfd)
-+      && g->global_gotno <= (MIPS_ELF_GOT_MAX_SIZE (output_bfd)
-+                            / MIPS_ELF_GOT_SIZE (output_bfd)))
-     {
-       if (! mips_elf_multi_got (output_bfd, info, g, s, local_gotno))
-       return FALSE;
diff --git a/openwrt/toolchain/binutils/2.16.90.0.1/702-binutils-skip-comments.patch b/openwrt/toolchain/binutils/2.16.90.0.1/702-binutils-skip-comments.patch
deleted file mode 100644 (file)
index 9ef7a7c..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
-Fixes
-localealias.s:544: Error: junk at end of line, first unrecognized character is `,' 
-when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
-
-Paths adjusted to match crosstool's patcher.
-
-Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
-From: Andreas Schwab <schwab at suse dot de>
-To: Nathan Sidwell <nathan at codesourcery dot com>
-Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
-Date: Fri, 23 Apr 2004 22:27:19 +0200
-Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
-
-Nathan Sidwell <nathan@codesourcery.com> writes:
-
-> Index: read.c
-> ===================================================================
-> RCS file: /cvs/src/src/gas/read.c,v
-> retrieving revision 1.76
-> diff -c -3 -p -r1.76 read.c
-> *** read.c   12 Mar 2004 17:48:12 -0000      1.76
-> --- read.c   18 Mar 2004 09:56:05 -0000
-> *************** read_a_source_file (char *name)
-> *** 1053,1059 ****
->   #endif
->        input_line_pointer--;
->        /* Report unknown char as ignored.  */
-> !      ignore_rest_of_line ();
->      }
->   
->   #ifdef md_after_pass_hook
-> --- 1053,1059 ----
->   #endif
->        input_line_pointer--;
->        /* Report unknown char as ignored.  */
-> !      demand_empty_rest_of_line ();
->      }
->   
->   #ifdef md_after_pass_hook
-
-This means that the unknown character is no longer ignored, despite the
-comment.  As a side effect a line starting with a line comment character
-not followed by APP in NO_APP mode now triggers an error instead of just a
-warning, breaking builds of glibc on m68k-linux.  Earlier in
-read_a_source_file where #APP is handled there is another comment that
-claims that unknown comments are ignored, when in fact they aren't (only
-the initial line comment character is skipped).
-
-Note that the presence of #APP will mess up the line counters, but
-that appears to be difficult to fix.
-
-Andreas.
-
-2004-04-23  Andreas Schwab  <schwab@suse.de>
-
-       * read.c (read_a_source_file): Ignore unknown text after line
-       comment character.  Fix misleading comment.
-
---- binutils/gas/read.c.~1.78.~        2004-04-23 08:58:23.000000000 +0200
-+++ binutils/gas/read.c        2004-04-23 21:49:01.000000000 +0200
-@@ -950,10 +950,14 @@ read_a_source_file (char *name)
-             unsigned int new_length;
-             char *tmp_buf = 0;
--            bump_line_counters ();
-             s = input_line_pointer;
-             if (strncmp (s, "APP\n", 4))
--              continue;       /* We ignore it */
-+              {
-+                /* We ignore it */
-+                ignore_rest_of_line ();
-+                continue;
-+              }
-+            bump_line_counters ();
-             s += 4;
-             sb_new (&sbuf);
-@@ -1052,7 +1056,7 @@ read_a_source_file (char *name)
-           continue;
- #endif
-         input_line_pointer--;
--        /* Report unknown char as ignored.  */
-+        /* Report unknown char as error.  */
-         demand_empty_rest_of_line ();
-       }
-
--- 
-Andreas Schwab, SuSE Labs, schwab@suse.de
-SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
-Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
-"And now for something completely different."
index 8849ef5540b387b0e308f881b3fa5827ed0678f5..fdec263644e469f095f02c848eb0103683dead8b 100644 (file)
@@ -10,59 +10,20 @@ choice
        help
          Select the version of binutils you wish to use.
 
-       config BR2_BINUTILS_VERSION_2_14_90_0_8
-               bool "binutils 2.14.90.0.8"
-
        config BR2_BINUTILS_VERSION_2_15
                bool "binutils 2.15"
 
-       config BR2_BINUTILS_VERSION_2_15_90_0_1
-               bool "binutils 2.15.90.0.1"
-
-       config BR2_BINUTILS_VERSION_2_15_90_0_1_1
-               bool "binutils 2.15.90.0.1.1"
-
-       config BR2_BINUTILS_VERSION_2_15_90_0_2
-               bool "binutils 2.15.90.0.2"
-
-       config BR2_BINUTILS_VERSION_2_15_90_0_3
-               bool "binutils 2.15.90.0.3"
-
-       config BR2_BINUTILS_VERSION_2_15_91_0_1
-               bool "binutils 2.15.91.0.1"
-
-       config BR2_BINUTILS_VERSION_2_15_91_0_2
-               bool "binutils 2.15.91.0.2"
-
-       config BR2_BINUTILS_VERSION_2_15_92_0_2
-               bool "binutils 2.15.92.0.2"
-
-       config BR2_BINUTILS_VERSION_2_15_94_0_1
-               bool "binutils 2.15.94.0.1"
-
        config BR2_BINUTILS_VERSION_2_15_94_0_2
                bool "binutils 2.15.94.0.2"
 
        config BR2_BINUTILS_VERSION_2_15_94_0_2_2
                bool "binutils 2.15.94.0.2.2"
 
-       config BR2_BINUTILS_VERSION_2_16_90_0_1
-               bool "binutils 2.16.90.0.1"
-
 
 endchoice
 
 config BR2_BINUTILS_VERSION
        string
-       default "2.14.90.0.8"     if BR2_BINUTILS_VERSION_2_14_90_0_8
        default "2.15"            if BR2_BINUTILS_VERSION_2_15
-       default "2.15.90.0.1"     if BR2_BINUTILS_VERSION_2_15_90_0_1
-       default "2.15.90.0.0.1.1" if BR2_BINUTILS_VERSION_2_15_90_0_1_1
-       default "2.15.90.0.2"     if BR2_BINUTILS_VERSION_2_15_90_0_2
-       default "2.15.90.0.3"     if BR2_BINUTILS_VERSION_2_15_90_0_3
-       default "2.15.91.0.1"     if BR2_BINUTILS_VERSION_2_15_91_0_1
-       default "2.15.91.0.2"     if BR2_BINUTILS_VERSION_2_15_91_0_2
-       default "2.15.92.0.2"     if BR2_BINUTILS_VERSION_2_15_92_0_2
-       default "2.15.94.0.1"     if BR2_BINUTILS_VERSION_2_15_94_0_1
        default "2.15.94.0.2"     if BR2_BINUTILS_VERSION_2_15_94_0_2 || !CONFIG_DEVEL
-       default "2.16.90.0.1"     if BR2_BINUTILS_VERSION_2_16_90_0_1
+       default "2.15.94.0.2.2"   if BR2_BINUTILS_VERSION_2_15_94_0_2_2
index 2bbb48727b438a62f64dbc7962c9572190538d3b..e3bee5da17da189de87006ea757438f44261ec61 100644 (file)
@@ -1,9 +1,120 @@
 include $(TOPDIR)/rules.mk
 
-include ./binutils.mk
+#############################################################
+#
+# build binutils for use on the host system
+#
+#############################################################
+BINUTILS_VERSION:=$(strip $(subst ",, $(BR2_BINUTILS_VERSION)))
+#"
 
-source: binutils-source
+BINUTILS_SITE:=http://www.fr.kernel.org/pub/linux/devel/binutils \
+              http://www.fi.kernel.org/pub/linux/devel/binutils \
+              http://ftp.kernel.org/pub/linux/devel/binutils \
+              http://www.de.kernel.org/pub/linux/devel/binutils
+
+ifeq ($(BINUTILS_VERSION),2.15)
+BINUTILS_SITE:=http://ftp.gnu.org/gnu/binutils/ \
+       ftp://gatekeeper.dec.com/pub/GNU/ \
+        ftp://ftp.uu.net/archive/systems/gnu/ \
+        ftp://ftp.eu.uu.net/pub/gnu/ \
+        ftp://ftp.funet.fi/pub/gnu/prep/ \
+        ftp://ftp.leo.org/pub/comp/os/unix/gnu/ 
+endif
+ifeq ($(BINUTILS_VERSION),2.14)
+BINUTILS_SITE:=http://ftp.gnu.org/gnu/binutils/ \
+       ftp://gatekeeper.dec.com/pub/GNU/ \
+        ftp://ftp.uu.net/archive/systems/gnu/ \
+        ftp://ftp.eu.uu.net/pub/gnu/ \
+        ftp://ftp.funet.fi/pub/gnu/prep/ \
+        ftp://ftp.leo.org/pub/comp/os/unix/gnu/ 
+endif
+ifeq ($(BINUTILS_VERSION),2.13)
+BINUTILS_SITE:=http://ftp.gnu.org/gnu/binutils/ \
+       ftp://gatekeeper.dec.com/pub/GNU/ \
+        ftp://ftp.uu.net/archive/systems/gnu/ \
+        ftp://ftp.eu.uu.net/pub/gnu/ \
+        ftp://ftp.funet.fi/pub/gnu/prep/ \
+        ftp://ftp.leo.org/pub/comp/os/unix/gnu/ 
+endif
+
+BINUTILS_SOURCE:=binutils-$(BINUTILS_VERSION).tar.bz2
+BINUTILS_DIR:=$(TOOL_BUILD_DIR)/binutils-$(BINUTILS_VERSION)
+BINUTILS_CAT:=bzcat
+
+BINUTILS_DIR1:=$(TOOL_BUILD_DIR)/binutils-$(BINUTILS_VERSION)-build
+
+$(DL_DIR)/$(BINUTILS_SOURCE):
+       mkdir -p $(DL_DIR)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(BINUTILS_SOURCE) x $(BINUTILS_SITE)
+
+$(BINUTILS_DIR)/.unpacked: $(DL_DIR)/$(BINUTILS_SOURCE)
+       mkdir -p $(TOOL_BUILD_DIR)
+       $(BINUTILS_CAT) $(DL_DIR)/$(BINUTILS_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
+       touch $(BINUTILS_DIR)/.unpacked
+
+$(BINUTILS_DIR)/.patched: $(BINUTILS_DIR)/.unpacked
+       # Apply appropriate binutils patches.
+       $(SCRIPT_DIR)/patch-kernel.sh $(BINUTILS_DIR) ./all \*.patch
+       $(SCRIPT_DIR)/patch-kernel.sh $(BINUTILS_DIR) ./$(BINUTILS_VERSION) \*.patch
+       touch $(BINUTILS_DIR)/.patched
+
+$(BINUTILS_DIR1)/.configured: $(BINUTILS_DIR)/.patched
+       mkdir -p $(BINUTILS_DIR1)
+       (cd $(BINUTILS_DIR1); \
+               $(BINUTILS_DIR)/configure \
+               --prefix=$(STAGING_DIR) \
+               --build=$(GNU_HOST_NAME) \
+               --host=$(GNU_HOST_NAME) \
+               --target=$(REAL_GNU_TARGET_NAME) \
+               --disable-werror \
+               $(DISABLE_NLS) \
+               $(MULTILIB) \
+               $(SOFT_FLOAT_CONFIG_OPTION) );
+       touch $(BINUTILS_DIR1)/.configured
+
+$(BINUTILS_DIR1)/binutils/objdump: $(BINUTILS_DIR1)/.configured
+       $(MAKE) -C $(BINUTILS_DIR1) all
+
+# Make install will put gettext data in staging_dir/share/locale.
+# Unfortunatey, it isn't configureable.
+$(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-ld: $(BINUTILS_DIR1)/binutils/objdump
+       $(MAKE) -C $(BINUTILS_DIR1) install
+
+
+#############################################################
+#
+# build binutils for use on the target system
+#
+#############################################################
+BINUTILS_DIR2:=$(BUILD_DIR)/binutils-$(BINUTILS_VERSION)-target
+$(BINUTILS_DIR2)/.configured: $(BINUTILS_DIR)/.patched
+       mkdir -p $(BINUTILS_DIR2)
+       (cd $(BINUTILS_DIR2); \
+               PATH=$(TARGET_PATH) \
+               CFLAGS="$(TARGET_CFLAGS)" \
+               CFLAGS_FOR_BUILD="-O2 -g" \
+               $(BINUTILS_DIR)/configure \
+               --prefix=/usr \
+               --exec-prefix=/usr \
+               --build=$(GNU_HOST_NAME) \
+               --host=$(REAL_GNU_TARGET_NAME) \
+               --target=$(REAL_GNU_TARGET_NAME) \
+               $(DISABLE_NLS) \
+               $(MULTILIB) \
+               $(SOFT_FLOAT_CONFIG_OPTION) );
+       touch $(BINUTILS_DIR2)/.configured
+
+$(BINUTILS_DIR2)/binutils/objdump: $(BINUTILS_DIR2)/.configured
+       PATH=$(TARGET_PATH) \
+       $(MAKE) -C $(BINUTILS_DIR2) all
+
+source: $(DL_DIR)/$(BINUTILS_SOURCE)
 prepare: $(BINUTILS_DIR)/.patched
 compile: $(BINUTILS_DIR1)/binutils/objdump
-install: binutils
-clean: binutils-distclean binutils-toolclean
+install: $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-ld
+clean:
+       rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
+       rm -rf $(BINUTILS_DIR) $(BINUTILS_DIR1)
+
+
diff --git a/openwrt/toolchain/binutils/binutils.mk b/openwrt/toolchain/binutils/binutils.mk
deleted file mode 100644 (file)
index a3a623e..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-#############################################################
-#
-# build binutils for use on the host system
-#
-#############################################################
-BINUTILS_VERSION:=$(strip $(subst ",, $(BR2_BINUTILS_VERSION)))
-
-BINUTILS_SITE:=http://www.fr.kernel.org/pub/linux/devel/binutils \
-              http://www.fi.kernel.org/pub/linux/devel/binutils \
-              http://ftp.kernel.org/pub/linux/devel/binutils \
-              http://www.de.kernel.org/pub/linux/devel/binutils
-ifeq ($(BINUTILS_VERSION),2.15)
-BINUTILS_SITE:=http://ftp.gnu.org/gnu/binutils/ \
-       ftp://gatekeeper.dec.com/pub/GNU/ \
-        ftp://ftp.uu.net/archive/systems/gnu/ \
-        ftp://ftp.eu.uu.net/pub/gnu/ \
-        ftp://ftp.funet.fi/pub/gnu/prep/ \
-        ftp://ftp.leo.org/pub/comp/os/unix/gnu/ 
-endif
-ifeq ($(BINUTILS_VERSION),2.14)
-BINUTILS_SITE:=http://ftp.gnu.org/gnu/binutils/ \
-       ftp://gatekeeper.dec.com/pub/GNU/ \
-        ftp://ftp.uu.net/archive/systems/gnu/ \
-        ftp://ftp.eu.uu.net/pub/gnu/ \
-        ftp://ftp.funet.fi/pub/gnu/prep/ \
-        ftp://ftp.leo.org/pub/comp/os/unix/gnu/ 
-endif
-ifeq ($(BINUTILS_VERSION),2.13)
-BINUTILS_SITE:=http://ftp.gnu.org/gnu/binutils/ \
-       ftp://gatekeeper.dec.com/pub/GNU/ \
-        ftp://ftp.uu.net/archive/systems/gnu/ \
-        ftp://ftp.eu.uu.net/pub/gnu/ \
-        ftp://ftp.funet.fi/pub/gnu/prep/ \
-        ftp://ftp.leo.org/pub/comp/os/unix/gnu/ 
-endif
-
-BINUTILS_SOURCE:=binutils-$(BINUTILS_VERSION).tar.bz2
-BINUTILS_DIR:=$(TOOL_BUILD_DIR)/binutils-$(BINUTILS_VERSION)
-BINUTILS_CAT:=bzcat
-
-BINUTILS_DIR1:=$(TOOL_BUILD_DIR)/binutils-$(BINUTILS_VERSION)-build
-
-$(DL_DIR)/$(BINUTILS_SOURCE):
-       mkdir -p $(DL_DIR)
-       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(BINUTILS_SOURCE) x $(BINUTILS_SITE)
-
-$(BINUTILS_DIR)/.unpacked: $(DL_DIR)/$(BINUTILS_SOURCE)
-       mkdir -p $(TOOL_BUILD_DIR)
-       $(BINUTILS_CAT) $(DL_DIR)/$(BINUTILS_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
-       touch $(BINUTILS_DIR)/.unpacked
-
-$(BINUTILS_DIR)/.patched: $(BINUTILS_DIR)/.unpacked
-       # Apply appropriate binutils patches.
-       $(SCRIPT_DIR)/patch-kernel.sh $(BINUTILS_DIR) ./all \*.patch
-       $(SCRIPT_DIR)/patch-kernel.sh $(BINUTILS_DIR) ./$(BINUTILS_VERSION) \*.patch
-       touch $(BINUTILS_DIR)/.patched
-
-$(BINUTILS_DIR1)/.configured: $(BINUTILS_DIR)/.patched
-       mkdir -p $(BINUTILS_DIR1)
-       (cd $(BINUTILS_DIR1); \
-               $(BINUTILS_DIR)/configure \
-               --prefix=$(STAGING_DIR) \
-               --build=$(GNU_HOST_NAME) \
-               --host=$(GNU_HOST_NAME) \
-               --target=$(REAL_GNU_TARGET_NAME) \
-               --disable-werror \
-               $(DISABLE_NLS) \
-               $(MULTILIB) \
-               $(SOFT_FLOAT_CONFIG_OPTION) );
-       touch $(BINUTILS_DIR1)/.configured
-
-$(BINUTILS_DIR1)/binutils/objdump: $(BINUTILS_DIR1)/.configured
-       $(MAKE) -C $(BINUTILS_DIR1) all
-
-# Make install will put gettext data in staging_dir/share/locale.
-# Unfortunatey, it isn't configureable.
-$(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-ld: $(BINUTILS_DIR1)/binutils/objdump
-       $(MAKE) -C $(BINUTILS_DIR1) install
-
-binutils-dependencies:
-       @if ! which bison > /dev/null ; then \
-               echo -e "\n\nYou must install 'bison' on your build machine\n"; \
-               exit 1; \
-       fi;
-       @if ! which flex > /dev/null ; then \
-               echo -e "\n\nYou must install 'flex' on your build machine\n"; \
-               exit 1; \
-       fi;
-       @if ! which msgfmt > /dev/null ; then \
-               echo -e "\n\nYou must install 'gettext' on your build machine\n"; \
-               exit 1; \
-       fi;
-
-binutils: binutils-dependencies $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-ld
-
-binutils-source: $(DL_DIR)/$(BINUTILS_SOURCE)
-
-binutils-clean:
-       rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
-       -$(MAKE) -C $(BINUTILS_DIR1) clean
-
-binutils-toolclean:
-       rm -rf $(BINUTILS_DIR1)
-
-binutils-distclean:
-       rm -rf $(BINUTILS_DIR)
-
-
-#############################################################
-#
-# build binutils for use on the target system
-#
-#############################################################
-BINUTILS_DIR2:=$(BUILD_DIR)/binutils-$(BINUTILS_VERSION)-target
-$(BINUTILS_DIR2)/.configured: $(BINUTILS_DIR)/.patched
-       mkdir -p $(BINUTILS_DIR2)
-       (cd $(BINUTILS_DIR2); \
-               PATH=$(TARGET_PATH) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               CFLAGS_FOR_BUILD="-O2 -g" \
-               $(BINUTILS_DIR)/configure \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --build=$(GNU_HOST_NAME) \
-               --host=$(REAL_GNU_TARGET_NAME) \
-               --target=$(REAL_GNU_TARGET_NAME) \
-               $(DISABLE_NLS) \
-               $(MULTILIB) \
-               $(SOFT_FLOAT_CONFIG_OPTION) );
-       touch $(BINUTILS_DIR2)/.configured
-
-$(BINUTILS_DIR2)/binutils/objdump: $(BINUTILS_DIR2)/.configured
-       PATH=$(TARGET_PATH) \
-       $(MAKE) -C $(BINUTILS_DIR2) all
-
-$(TARGET_DIR)/usr/bin/ld: $(BINUTILS_DIR2)/binutils/objdump
-       PATH=$(TARGET_PATH) \
-       $(MAKE) DESTDIR=$(TARGET_DIR) \
-               tooldir=/usr build_tooldir=/usr \
-               -C $(BINUTILS_DIR2) install
-       #rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-       #       $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-       -$(STRIP) $(TARGET_DIR)/usr/$(REAL_GNU_TARGET_NAME)/bin/* > /dev/null 2>&1
-       -$(STRIP) $(TARGET_DIR)/usr/bin/* > /dev/null 2>&1
-
-binutils_target: $(GCC_DEPENDANCY) $(TARGET_DIR)/usr/bin/ld
-
-binutils_target-clean:
-       (cd $(TARGET_DIR)/usr/bin; \
-               rm -f addr2line ar as gprof ld nm objcopy \
-                     objdump ranlib readelf size strings strip)
-       rm -f $(TARGET_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
-       -$(MAKE) -C $(BINUTILS_DIR2) clean
-
-binutils_target-toolclean:
-       rm -rf $(BINUTILS_DIR2)
diff --git a/openwrt/toolchain/ccache/Config.in b/openwrt/toolchain/ccache/Config.in
deleted file mode 100644 (file)
index 9cd6f0b..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-if CONFIG_DEVEL
-       comment "Ccache Options"
-endif
-
-config BR2_CCACHE
-       bool "Enable ccache support?" if CONFIG_DEVEL
-       default y
-       help
-           Enable ccache support?
-
diff --git a/openwrt/toolchain/ccache/Config.in.2 b/openwrt/toolchain/ccache/Config.in.2
deleted file mode 100644 (file)
index 7130374..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-
-config BR2_PACKAGE_CCACHE_TARGET
-       bool"ccache support in the target filesystem"
-       default n
-       help
-         Add help text here.
-
diff --git a/openwrt/toolchain/ccache/Makefile.in b/openwrt/toolchain/ccache/Makefile.in
deleted file mode 100644 (file)
index fe859da..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-ifeq ($(strip $(BR2_CCACHE)),y)
-TARGETS+=ccache
-endif
-ifeq ($(strip $(BR2_PACKAGE_CCACHE_TARGET)),y)
-TARGETS+=ccache_target
-endif
diff --git a/openwrt/toolchain/ccache/ccache.mk b/openwrt/toolchain/ccache/ccache.mk
deleted file mode 100644 (file)
index cafdcd3..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-#############################################################
-#
-# build ccache to make recompiles faster on the build system
-#
-#############################################################
-CCACHE_VER:=2.3
-CCACHE_SITE:=http://ccache.samba.org/ftp/ccache
-CCACHE_SOURCE:=ccache-$(CCACHE_VER).tar.gz
-CCACHE_DIR1:=$(TOOL_BUILD_DIR)/ccache-$(CCACHE_VER)
-CCACHE_DIR2:=$(BUILD_DIR)/ccache-$(CCACHE_VER)
-CCACHE_CAT:=zcat
-CCACHE_BINARY:=ccache
-CCACHE_TARGET_BINARY:=usr/bin/ccache
-
-$(DL_DIR)/$(CCACHE_SOURCE):
-       $(WGET) -P $(DL_DIR) $(CCACHE_SITE)/$(CCACHE_SOURCE)
-
-$(CCACHE_DIR1)/.unpacked: $(DL_DIR)/$(CCACHE_SOURCE)
-       $(CCACHE_CAT) $(DL_DIR)/$(CCACHE_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
-       touch $(CCACHE_DIR1)/.unpacked
-
-$(CCACHE_DIR1)/.patched: $(CCACHE_DIR1)/.unpacked
-       # WARNING - this will break if the toolchain is moved.
-       # Should probably patch things to use a relative path.
-       $(SED) "s,getenv(\"CCACHE_PATH\"),\"$(STAGING_DIR)/bin-ccache\",g" \
-               $(CCACHE_DIR1)/execute.c
-       # WARNING - this will break if the toolchain build dir is deleted.
-       $(SED) "s,getenv(\"CCACHE_DIR\"),\"$(CCACHE_DIR1)/cache\",g" \
-               $(CCACHE_DIR1)/ccache.c
-       mkdir -p $(CCACHE_DIR1)/cache
-       touch $(CCACHE_DIR1)/.patched
-
-$(CCACHE_DIR1)/.configured: $(CCACHE_DIR1)/.patched
-       mkdir -p $(CCACHE_DIR1)
-       (cd $(CCACHE_DIR1); rm -rf config.cache; \
-               CC=$(HOSTCC) \
-               $(CCACHE_DIR1)/configure \
-               --target=$(GNU_HOST_NAME) \
-               --host=$(GNU_HOST_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-       );
-       touch $(CCACHE_DIR1)/.configured
-
-$(CCACHE_DIR1)/$(CCACHE_BINARY): $(CCACHE_DIR1)/.configured
-       $(MAKE) CC=$(HOSTCC) -C $(CCACHE_DIR1)
-
-$(STAGING_DIR)/$(CCACHE_TARGET_BINARY): $(CCACHE_DIR1)/$(CCACHE_BINARY)
-       mkdir -p $(STAGING_DIR)/usr/bin;
-       cp $(CCACHE_DIR1)/ccache $(STAGING_DIR)/usr/bin
-       # Keep the actual toolchain binaries in a directory at the same level.
-       # Otherwise, relative paths for include dirs break.
-       mkdir -p $(STAGING_DIR)/bin-ccache;
-       (cd $(STAGING_DIR)/bin-ccache; \
-               ln -fs $(REAL_GNU_TARGET_NAME)-gcc $(GNU_TARGET_NAME)-gcc; \
-               ln -fs $(REAL_GNU_TARGET_NAME)-gcc $(GNU_TARGET_NAME)-cc; \
-               ln -fs $(REAL_GNU_TARGET_NAME)-gcc $(REAL_GNU_TARGET_NAME)-cc);
-       [ -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc ] && \
-               mv $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc $(STAGING_DIR)/bin-ccache/
-       (cd $(STAGING_DIR)/bin; \
-               ln -fs ../usr/bin/ccache $(GNU_TARGET_NAME)-cc; \
-               ln -fs ../usr/bin/ccache $(GNU_TARGET_NAME)-gcc; \
-               ln -fs ../usr/bin/ccache $(REAL_GNU_TARGET_NAME)-cc; \
-               ln -fs ../usr/bin/ccache $(REAL_GNU_TARGET_NAME)-gcc);
-ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
-       [ -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-c++ ] && \
-               mv $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-c++ $(STAGING_DIR)/bin-ccache/
-       [ -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-g++ ] && \
-               mv $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-g++  $(STAGING_DIR)/bin-ccache/
-       (cd $(STAGING_DIR)/bin; \
-               ln -fs ../usr/bin/ccache $(GNU_TARGET_NAME)-c++; \
-               ln -fs ../usr/bin/ccache $(GNU_TARGET_NAME)-g++;\
-               ln -fs ../usr/bin/ccache $(REAL_GNU_TARGET_NAME)-c++; \
-               ln -fs ../usr/bin/ccache $(REAL_GNU_TARGET_NAME)-g++);
-       (cd $(STAGING_DIR)/bin-ccache; \
-               ln -fs $(REAL_GNU_TARGET_NAME)-c++ $(GNU_TARGET_NAME)-c++; \
-               ln -fs $(REAL_GNU_TARGET_NAME)-g++ $(GNU_TARGET_NAME)-g++);
-endif
-
-ccache: gcc $(STAGING_DIR)/$(CCACHE_TARGET_BINARY)
-
-ccache-clean:
-       $(MAKE) -C $(CCACHE_DIR1) uninstall
-       -$(MAKE) -C $(CCACHE_DIR1) clean
-
-ccache-toolclean:
-       rm -rf $(CCACHE_DIR1)
-
-
-
-
-#############################################################
-#
-# build ccache for use on the target system
-#
-#############################################################
-
-$(CCACHE_DIR2)/.unpacked: $(DL_DIR)/$(CCACHE_SOURCE)
-       $(CCACHE_CAT) $(DL_DIR)/$(CCACHE_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
-       touch $(CCACHE_DIR2)/.unpacked
-
-$(CCACHE_DIR2)/.patched: $(CCACHE_DIR2)/.unpacked
-       touch $(CCACHE_DIR2)/.patched
-
-$(CCACHE_DIR2)/.configured: $(CCACHE_DIR2)/.patched
-       mkdir -p $(CCACHE_DIR2)
-       (cd $(CCACHE_DIR2); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               $(CCACHE_DIR2)/configure \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               --exec-prefix=/usr \
-               --bindir=/usr/bin \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-       );
-       touch $(CCACHE_DIR2)/.configured
-
-$(CCACHE_DIR2)/$(CCACHE_BINARY): $(CCACHE_DIR2)/.configured
-       $(MAKE) -C $(CCACHE_DIR2) CFLAGS="$(TARGET_CFLAGS)"
-
-$(TARGET_DIR)/$(CCACHE_TARGET_BINARY): $(CCACHE_DIR2)/$(CCACHE_BINARY)
-       $(MAKE) DESTDIR=$(TARGET_DIR) -C $(CCACHE_DIR2) install
-       rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-               $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-       # put a bunch of symlinks into /bin, since that is earlier
-       # in the default PATH than /usr/bin where gcc lives
-       (cd $(TARGET_DIR)/bin; \
-               ln -fs /usr/bin/ccache cc; \
-               ln -fs /usr/bin/ccache gcc; \
-               ln -fs /usr/bin/ccache c++; \
-               ln -fs /usr/bin/ccache g++;)
-
-ccache_target: uclibc $(TARGET_DIR)/$(CCACHE_TARGET_BINARY)
-
-ccache_target-sources: $(DL_DIR)/$(CCACHE_SOURCE)
-
-ccache_target-clean:
-       rm -f $(TARGET_DIR)/$(CCACHE_TARGET_BINARY)
-       -$(MAKE) -C $(CCACHE_DIR2) clean
-
-ccache_target-toolclean:
-       rm -rf $(CCACHE_DIR2)
diff --git a/openwrt/toolchain/gcc/3.3.5/100-uclibc-conf.patch b/openwrt/toolchain/gcc/3.3.5/100-uclibc-conf.patch
deleted file mode 100644 (file)
index 4bbe21b..0000000
+++ /dev/null
@@ -1,1635 +0,0 @@
-diff -urN gcc-3.3.3-dist/boehm-gc/config.sub gcc-3.3.3/boehm-gc/config.sub
---- gcc-3.3.3-dist/boehm-gc/config.sub 2002-02-11 22:37:53.000000000 -0600
-+++ gcc-3.3.3/boehm-gc/config.sub      2004-08-12 04:47:51.000000000 -0500
-@@ -118,7 +118,7 @@
- # Here we must recognize all the valid KERNEL-OS combinations.
- maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
- case $maybe_os in
--  nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
-+  nto-qnx* | linux-gnu* | linux-uclibc* | storm-chaos* | os2-emx* | windows32-*)
-     os=-$maybe_os
-     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
-     ;;
-@@ -1089,7 +1089,8 @@
-             | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-             | -chorusos* | -chorusrdb* \
-             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
--            | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
-+            | -mingw32* | -linux-gnu* | -linux-uclibc* \
-+            | -uxpv* | -beos* | -mpeix* | -udk* \
-             | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
-             | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-diff -urN gcc-3.3.3-dist/boehm-gc/configure gcc-3.3.3/boehm-gc/configure
---- gcc-3.3.3-dist/boehm-gc/configure  2004-02-14 14:34:20.000000000 -0600
-+++ gcc-3.3.3/boehm-gc/configure       2004-08-12 04:47:51.000000000 -0500
-@@ -1940,6 +1940,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN gcc-3.3.3-dist/config.sub gcc-3.3.3/config.sub
---- gcc-3.3.3-dist/config.sub  2003-01-30 17:25:36.000000000 -0600
-+++ gcc-3.3.3/config.sub       2004-08-12 04:47:51.000000000 -0500
-@@ -118,7 +118,7 @@
- # Here we must recognize all the valid KERNEL-OS combinations.
- maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
- case $maybe_os in
--  nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
-+  nto-qnx* | linux-gnu* | linux-uclibc* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
-     os=-$maybe_os
-     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
-     ;;
-@@ -1112,7 +1112,8 @@
-             | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-             | -chorusos* | -chorusrdb* \
-             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
--            | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
-+            | -mingw32* | -linux-gnu* | -linux-uclibc* \
-+            | -uxpv* | -beos* | -mpeix* | -udk* \
-             | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
-             | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-diff -urN gcc-3.3.3-dist/gcc/config/arm/linux-elf.h gcc-3.3.3/gcc/config/arm/linux-elf.h
---- gcc-3.3.3-dist/gcc/config/arm/linux-elf.h  2003-09-16 10:39:23.000000000 -0500
-+++ gcc-3.3.3/gcc/config/arm/linux-elf.h       2004-08-12 04:47:51.000000000 -0500
-@@ -78,6 +78,18 @@
-   "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
- #undef  LINK_SPEC
-+#ifdef USE_UCLIBC
-+#define LINK_SPEC "%{h*} %{version:-v} \
-+   %{b} %{Wl,*:%*} \
-+   %{static:-Bstatic} \
-+   %{shared:-shared} \
-+   %{symbolic:-Bsymbolic} \
-+   %{rdynamic:-export-dynamic} \
-+   %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0} \
-+   -X \
-+   %{mbig-endian:-EB}" \
-+   SUBTARGET_EXTRA_LINK_SPEC
-+#else
- #define LINK_SPEC "%{h*} %{version:-v} \
-    %{b} %{Wl,*:%*} \
-    %{static:-Bstatic} \
-@@ -88,6 +100,7 @@
-    -X \
-    %{mbig-endian:-EB}" \
-    SUBTARGET_EXTRA_LINK_SPEC
-+#endif
- #define TARGET_OS_CPP_BUILTINS()              \
-     do {                                      \
-diff -urN gcc-3.3.3-dist/gcc/config/cris/linux.h gcc-3.3.3/gcc/config/cris/linux.h
---- gcc-3.3.3-dist/gcc/config/cris/linux.h     2003-03-10 21:01:35.000000000 -0600
-+++ gcc-3.3.3/gcc/config/cris/linux.h  2004-08-12 04:47:51.000000000 -0500
-@@ -81,6 +81,25 @@
- #undef CRIS_DEFAULT_CPU_VERSION
- #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
-+#ifdef USE_UCLIBC
-+
-+#undef CRIS_SUBTARGET_VERSION
-+#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-uclibc"
-+
-+#undef CRIS_LINK_SUBTARGET_SPEC
-+#define CRIS_LINK_SUBTARGET_SPEC \
-+ "-mcrislinux\
-+  -rpath-link include/asm/../..%s\
-+  %{shared} %{static}\
-+  %{symbolic:-Bdynamic} %{shlib:-Bdynamic} %{static:-Bstatic}\
-+  %{!shared: \
-+    %{!static: \
-+      %{rdynamic:-export-dynamic} \
-+      %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}} \
-+  %{!r:%{O2|O3: --gc-sections}}"
-+
-+#else  /* USE_UCLIBC */
-+
- #undef CRIS_SUBTARGET_VERSION
- #define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
-@@ -95,6 +114,8 @@
-   %{!shared:%{!static:%{rdynamic:-export-dynamic}}}\
-   %{!r:%{O2|O3: --gc-sections}}"
-+#endif  /* USE_UCLIBC */
-+
- /* Node: Run-time Target */
-diff -urN gcc-3.3.3-dist/gcc/config/cris/t-linux-uclibc gcc-3.3.3/gcc/config/cris/t-linux-uclibc
---- gcc-3.3.3-dist/gcc/config/cris/t-linux-uclibc      1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.3/gcc/config/cris/t-linux-uclibc   2004-08-12 04:47:51.000000000 -0500
-@@ -0,0 +1,3 @@
-+T_CFLAGS = -DUSE_UCLIBC
-+TARGET_LIBGCC2_CFLAGS += -fPIC
-+CRTSTUFF_T_CFLAGS_S = $(TARGET_LIBGCC2_CFLAGS)
-diff -urN gcc-3.3.3-dist/gcc/config/i386/linux.h gcc-3.3.3/gcc/config/i386/linux.h
---- gcc-3.3.3-dist/gcc/config/i386/linux.h     2003-11-14 00:46:12.000000000 -0600
-+++ gcc-3.3.3/gcc/config/i386/linux.h  2004-08-12 04:47:51.000000000 -0500
-@@ -136,6 +136,15 @@
-       %{static:-static}}}"
- #endif
- #else
-+#if defined USE_UCLIBC
-+#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
-+  %{!shared: \
-+    %{!ibcs: \
-+      %{!static: \
-+      %{rdynamic:-export-dynamic} \
-+      %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
-+      %{static:-static}}}"
-+#else
- #define LINK_SPEC "-m elf_i386 %{shared:-shared} \
-   %{!shared: \
-     %{!ibcs: \
-@@ -144,6 +153,7 @@
-       %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
-       %{static:-static}}}"
- #endif
-+#endif
- /* A C statement (sans semicolon) to output to the stdio stream
-    FILE the assembler definition of uninitialized global DECL named
-diff -urN gcc-3.3.3-dist/gcc/config/mips/linux.h gcc-3.3.3/gcc/config/mips/linux.h
---- gcc-3.3.3-dist/gcc/config/mips/linux.h     2003-12-23 02:58:00.000000000 -0600
-+++ gcc-3.3.3/gcc/config/mips/linux.h  2004-08-12 04:47:51.000000000 -0500
-@@ -175,6 +175,17 @@
- /* Borrowed from sparc/linux.h */
- #undef LINK_SPEC
-+#ifdef USE_UCLIBC
-+#define LINK_SPEC \
-+ "%(endian_spec) \
-+  %{shared:-shared} \
-+  %{!shared: \
-+    %{!ibcs: \
-+      %{!static: \
-+        %{rdynamic:-export-dynamic} \
-+        %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
-+        %{static:-static}}}"
-+#else
- #define LINK_SPEC \
-  "%(endian_spec) \
-   %{shared:-shared} \
-@@ -184,6 +195,7 @@
-         %{rdynamic:-export-dynamic} \
-         %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
-         %{static:-static}}}"
-+#endif
- #undef SUBTARGET_ASM_SPEC
- #define SUBTARGET_ASM_SPEC "\
-diff -urN gcc-3.3.3-dist/gcc/config/sh/linux.h gcc-3.3.3/gcc/config/sh/linux.h
---- gcc-3.3.3-dist/gcc/config/sh/linux.h       2003-11-06 17:13:33.000000000 -0600
-+++ gcc-3.3.3/gcc/config/sh/linux.h    2004-08-12 04:47:51.000000000 -0500
-@@ -44,12 +44,21 @@
- #undef SUBTARGET_LINK_EMUL_SUFFIX
- #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
- #undef SUBTARGET_LINK_SPEC
-+#ifdef USE_UCLIBC
-+#define SUBTARGET_LINK_SPEC \
-+  "%{shared:-shared} \
-+   %{!static: \
-+     %{rdynamic:-export-dynamic} \
-+     %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
-+   %{static:-static}"
-+#else
- #define SUBTARGET_LINK_SPEC \
-   "%{shared:-shared} \
-    %{!static: \
-      %{rdynamic:-export-dynamic} \
-      %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
-    %{static:-static}"
-+#endif
- /* The GNU C++ standard library requires that these macros be defined.  */
- #undef CPLUSPLUS_CPP_SPEC
-diff -urN gcc-3.3.3-dist/gcc/config/sh/t-linux-uclibc gcc-3.3.3/gcc/config/sh/t-linux-uclibc
---- gcc-3.3.3-dist/gcc/config/sh/t-linux-uclibc        1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.3/gcc/config/sh/t-linux-uclibc     2004-08-12 04:47:51.000000000 -0500
-@@ -0,0 +1,16 @@
-+T_CFLAGS = -DUSE_UCLIBC
-+
-+# Don't run fixproto
-+STMP_FIXPROTO =
-+
-+TARGET_LIBGCC2_CFLAGS = -fpic
-+LIB1ASMFUNCS_CACHE = _ic_invalidate
-+
-+LIB2FUNCS_EXTRA=
-+
-+MULTILIB_OPTIONS= $(MULTILIB_ENDIAN) m3e/m4
-+MULTILIB_DIRNAMES= 
-+MULTILIB_MATCHES = 
-+MULTILIB_EXCEPTIONS=
-+
-+EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o
-diff -urN gcc-3.3.3-dist/gcc/config/sh/t-sh64-uclibc gcc-3.3.3/gcc/config/sh/t-sh64-uclibc
---- gcc-3.3.3-dist/gcc/config/sh/t-sh64-uclibc 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.3/gcc/config/sh/t-sh64-uclibc      2004-08-12 04:47:51.000000000 -0500
-@@ -0,0 +1,13 @@
-+EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o
-+
-+LIB1ASMFUNCS = \
-+  _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
-+  _shcompact_call_trampoline _shcompact_return_trampoline \
-+  _shcompact_incoming_args _ic_invalidate _nested_trampoline \
-+  _push_pop_shmedia_regs \
-+  _udivdi3 _divdi3 _umoddi3 _moddi3
-+
-+MULTILIB_OPTIONS = $(MULTILIB_ENDIAN) m5-32media-nofpu/m5-compact/m5-compact-nofpu/m5-64media/m5-64media-nofpu
-+MULTILIB_DIRNAMES= $(MULTILIB_ENDIAN) nofpu compact nofpu/compact media64 nofpu/media64
-+MULTILIB_MATCHES=
-+MULTILIB_EXCEPTIONS=
-diff -urN gcc-3.3.3-dist/gcc/config/t-linux-uclibc gcc-3.3.3/gcc/config/t-linux-uclibc
---- gcc-3.3.3-dist/gcc/config/t-linux-uclibc   1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.3/gcc/config/t-linux-uclibc        2004-08-12 04:47:51.000000000 -0500
-@@ -0,0 +1,23 @@
-+T_CFLAGS = -DUSE_UCLIBC
-+
-+# Don't run fixproto
-+STMP_FIXPROTO =
-+
-+# Compile crtbeginS.o and crtendS.o with pic.
-+CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
-+# Compile libgcc2.a with pic.
-+TARGET_LIBGCC2_CFLAGS = -fPIC
-+
-+# Override t-slibgcc-elf-ver to export some libgcc symbols with
-+# the symbol versions that glibc used.
-+SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver
-+
-+# Use unwind-dw2-fde-glibc
-+#LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
-+#  $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
-+#LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
-+
-+# Use unwind-dw2-fde
-+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
-+  $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
-+LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h
-diff -urN gcc-3.3.3-dist/gcc/config.gcc gcc-3.3.3/gcc/config.gcc
---- gcc-3.3.3-dist/gcc/config.gcc      2004-01-21 00:06:00.000000000 -0600
-+++ gcc-3.3.3/gcc/config.gcc   2004-08-12 04:47:51.000000000 -0500
-@@ -697,6 +697,17 @@
-       extra_parts=""
-       use_collect2=yes
-       ;;
-+arm*-*-linux-uclibc*)         # ARM GNU/Linux with ELF - uClibc
-+      tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/linux-gas.h arm/linux-elf.h"
-+      tmake_file="t-slibgcc-elf-ver t-linux-uclibc arm/t-linux"
-+      extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
-+      gnu_ld=yes
-+      case x${enable_threads} in
-+      x | xyes | xpthreads | xposix)
-+              thread_file='posix'
-+              ;;
-+      esac
-+      ;;
- arm*-*-linux*)                        # ARM GNU/Linux with ELF
-       tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/linux-gas.h arm/linux-elf.h"
-       tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
-@@ -772,6 +783,10 @@
-       tmake_file="cris/t-cris cris/t-elfmulti"
-       gas=yes
-       ;;
-+cris-*-linux-uclibc*)
-+      tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h"
-+      tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux-uclibc"
-+      ;;
- cris-*-linux*)
-       tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h"
-       tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux"
-@@ -1173,6 +1188,11 @@
-               thread_file='single'
-       fi
-       ;;
-+i[34567]86-*-linux*uclibc*)   # Intel 80386's running GNU/Linux
-+                              # with ELF format using uClibc
-+      tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h"
-+      tmake_file="t-slibgcc-elf-ver t-linux-uclibc i386/t-crtstuff"
-+      ;;
- i[34567]86-*-linux*)  # Intel 80386's running GNU/Linux
-                       # with ELF format using glibc 2
-                       # aka GNU/Linux C library 6
-@@ -1883,6 +1903,16 @@
-       tm_file="elfos.h ${tm_file} mips/netbsd.h"
-       tmake_file="${tmake_file} mips/t-netbsd"
-       ;;
-+mips*-*-linux-uclibc*)                        # Linux MIPS, either endian. uClibc
-+        tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h"
-+      case $machine in
-+        mipsisa32*-*)
-+                target_cpu_default="MASK_SOFT_FLOAT"
-+              tm_defines="MIPS_ISA_DEFAULT=32"
-+                ;;
-+        esac
-+      tmake_file="t-slibgcc-elf-ver t-linux-uclibc mips/t-linux"
-+      ;;
- mips*-*-linux*)                               # Linux MIPS, either endian.
-         tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h"
-       case $machine in
-@@ -2129,6 +2159,11 @@
-       out_file=rs6000/rs6000.c
-       tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm"
-       ;;
-+powerpc-*-linux-uclibc*)
-+      tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h"
-+      out_file=rs6000/rs6000.c
-+      tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux-uclibc rs6000/t-ppccomm"
-+      ;;
- powerpc-*-linux*)
-       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h"
-       out_file=rs6000/rs6000.c
-@@ -2313,10 +2348,18 @@
-               tmake_file="${tmake_file} sh/t-le"
-               ;;
-       esac
--      tmake_file="${tmake_file} sh/t-linux"
-+      case $machine in
-+      *-*-linux-uclibc*) tmake_file="${tmake_file} sh/t-linux-uclibc" ;;
-+      *) tmake_file="${tmake_file} sh/t-linux" ;;
-+      esac
-       tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/elf.h sh/linux.h"
-       gas=yes gnu_ld=yes
-       case $machine in
-+      sh64*-*-linux-uclibc*)
-+              tmake_file="${tmake_file} sh/t-sh64-uclibc"
-+              tm_file="${tm_file} sh/sh64.h"
-+              extra_headers="shmedia.h ushmedia.h sshmedia.h"
-+              ;;
-       sh64*)
-               tmake_file="${tmake_file} sh/t-sh64"
-               tm_file="${tm_file} sh/sh64.h"
-diff -urN gcc-3.3.3-dist/libstdc++-v3/aclocal.m4 gcc-3.3.3/libstdc++-v3/aclocal.m4
---- gcc-3.3.3-dist/libstdc++-v3/aclocal.m4     2004-01-12 10:18:44.000000000 -0600
-+++ gcc-3.3.3/libstdc++-v3/aclocal.m4  2004-08-12 04:47:51.000000000 -0500
-@@ -1216,6 +1216,9 @@
-   dnl Default to "generic"
-   if test x$enable_clocale_flag = xno; then
-     case x${target_os} in
-+      xlinux-uclibc*)
-+      enable_clocale_flag=uclibc
-+      ;;
-       xlinux* | xgnu*)
-       AC_EGREP_CPP([_GLIBCPP_ok], [
-         #include <features.h>
-@@ -1339,6 +1342,41 @@
-       CTIME_CC=config/locale/generic/time_members.cc
-       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
-       ;;
-+    xuclibc)
-+      AC_MSG_RESULT(uclibc)
-+
-+      # Declare intention to use gettext, and add support for specific
-+      # languages.
-+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
-+      ALL_LINGUAS="de fr"
-+
-+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
-+      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
-+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
-+      USE_NLS=yes
-+      fi
-+      # Export the build objects.
-+      for ling in $ALL_LINGUAS; do \
-+        glibcpp_MOFILES="$glibcpp_MOFILES $ling.mo"; \
-+        glibcpp_POFILES="$glibcpp_POFILES $ling.po"; \
-+      done
-+      AC_SUBST(glibcpp_MOFILES)
-+      AC_SUBST(glibcpp_POFILES)
-+
-+      CLOCALE_H=config/locale/uclibc/c_locale.h
-+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
-+      CCODECVT_H=config/locale/uclibc/codecvt_specializations.h
-+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
-+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
-+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
-+      CMESSAGES_H=config/locale/uclibc/messages_members.h
-+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
-+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
-+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
-+      CTIME_H=config/locale/uclibc/time_members.h
-+      CTIME_CC=config/locale/uclibc/time_members.cc
-+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
-+      ;;
-     *)
-       echo "$enable_clocale is an unknown locale package" 1>&2
-       exit 1
-diff -urN gcc-3.3.3-dist/libstdc++-v3/configure gcc-3.3.3/libstdc++-v3/configure
---- gcc-3.3.3-dist/libstdc++-v3/configure      2004-01-12 10:18:45.000000000 -0600
-+++ gcc-3.3.3/libstdc++-v3/configure   2004-08-12 04:49:13.000000000 -0500
-@@ -2010,6 +2010,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -2996,6 +3001,9 @@
-       if test x$enable_clocale_flag = xno; then
-     case x${target_os} in
-+      xlinux-uclibc*)
-+      enable_clocale_flag=uclibc
-+      ;;
-       xlinux* | xgnu*)
-       cat > conftest.$ac_ext <<EOF
- #line 3002 "configure"
-@@ -3182,6 +3190,70 @@
-       CTIME_CC=config/locale/generic/time_members.cc
-       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
-       ;;
-+    xuclibc)
-+      echo "$ac_t""uclibc" 1>&6
-+
-+      # Declare intention to use gettext, and add support for specific
-+      # languages.
-+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
-+      ALL_LINGUAS="de fr"
-+
-+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
-+      # Extract the first word of "msgfmt", so it can be a program name with args.
-+set dummy msgfmt; ac_word=$2
-+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-+echo "configure:3117: checking for $ac_word" >&5
-+if eval "test \"`echo '$''{'ac_cv_prog_check_msgfmt'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  if test -n "$check_msgfmt"; then
-+  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
-+else
-+  IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS=":"
-+  ac_dummy="$PATH"
-+  for ac_dir in $ac_dummy; do
-+    test -z "$ac_dir" && ac_dir=.
-+    if test -f $ac_dir/$ac_word; then
-+      ac_cv_prog_check_msgfmt="yes"
-+      break
-+    fi
-+  done
-+  IFS="$ac_save_ifs"
-+  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
-+fi
-+fi
-+check_msgfmt="$ac_cv_prog_check_msgfmt"
-+if test -n "$check_msgfmt"; then
-+  echo "$ac_t""$check_msgfmt" 1>&6
-+else
-+  echo "$ac_t""no" 1>&6
-+fi
-+
-+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
-+      USE_NLS=yes
-+      fi
-+      # Export the build objects.
-+      for ling in $ALL_LINGUAS; do \
-+        glibcpp_MOFILES="$glibcpp_MOFILES $ling.mo"; \
-+        glibcpp_POFILES="$glibcpp_POFILES $ling.po"; \
-+      done
-+      
-+      
-+
-+      CLOCALE_H=config/locale/uclibc/c_locale.h
-+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
-+      CCODECVT_H=config/locale/uclibc/codecvt_specializations.h
-+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
-+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
-+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
-+      CMESSAGES_H=config/locale/uclibc/messages_members.h
-+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
-+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
-+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
-+      CTIME_H=config/locale/uclibc/time_members.h
-+      CTIME_CC=config/locale/uclibc/time_members.cc
-+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
-+      ;;
-     *)
-       echo "$enable_clocale is an unknown locale package" 1>&2
-       exit 1
-@@ -4212,6 +4284,968 @@
-   # GLIBCPP_CHECK_MATH_SUPPORT
-   case "$target" in
-+    *-uclibc*)
-+      os_include_dir="os/uclibc"
-+      for ac_hdr in nan.h ieeefp.h endian.h sys/isa_defs.h \
-+        machine/endian.h machine/param.h sys/machine.h sys/types.h \
-+        fp.h locale.h float.h inttypes.h
-+do
-+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-+echo "configure:4224: checking for $ac_hdr" >&5
-+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4229 "configure"
-+#include "confdefs.h"
-+#include <$ac_hdr>
-+EOF
-+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-+{ (eval echo configure:4234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-+if test -z "$ac_err"; then
-+  rm -rf conftest*
-+  eval "ac_cv_header_$ac_safe=yes"
-+else
-+  echo "$ac_err" >&5
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_header_$ac_safe=no"
-+fi
-+rm -f conftest*
-+fi
-+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-+  cat >> confdefs.h <<EOF
-+#define $ac_tr_hdr 1
-+EOF
-+ 
-+else
-+  echo "$ac_t""no" 1>&6
-+fi
-+done
-+
-+      SECTION_FLAGS='-ffunction-sections -fdata-sections'
-+      
-+      
-+  # If we're not using GNU ld, then there's no point in even trying these
-+  # tests.  Check for that first.  We should have already tested for gld
-+  # by now (in libtool), but require it now just to be safe...
-+  test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
-+  test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
-+  
-+
-+  # The name set by libtool depends on the version of libtool.  Shame on us
-+  # for depending on an impl detail, but c'est la vie.  Older versions used
-+  # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
-+  # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
-+  # makes sense).  We'll test with_gnu_ld everywhere else, so if that isn't
-+  # set (hence we're using an older libtool), then set it.
-+  if test x${with_gnu_ld+set} != xset; then
-+    if test x${ac_cv_prog_gnu_ld+set} != xset; then
-+      # We got through "ac_require(ac_prog_ld)" and still not set?  Huh?
-+      with_gnu_ld=no
-+    else
-+      with_gnu_ld=$ac_cv_prog_gnu_ld
-+    fi
-+  fi
-+
-+  # Start by getting the version number.  I think the libtool test already
-+  # does some of this, but throws away the result.
-+  
-+  ldver=`$LD --version 2>/dev/null | head -1 | \
-+         sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
-+  
-+  glibcpp_gnu_ld_version=`echo $ldver | \
-+         $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
-+
-+  # Set --gc-sections.
-+  if test "$with_gnu_ld" = "notbroken"; then
-+    # GNU ld it is!  Joy and bunny rabbits!
-+
-+    # All these tests are for C++; save the language and the compiler flags.
-+    # Need to do this so that g++ won't try to link in libstdc++
-+    ac_test_CFLAGS="${CFLAGS+set}"
-+    ac_save_CFLAGS="$CFLAGS"
-+    CFLAGS='-x c++  -Wl,--gc-sections'
-+
-+    # Check for -Wl,--gc-sections
-+    # XXX This test is broken at the moment, as symbols required for
-+    # linking are now in libsupc++ (not built yet.....). In addition, 
-+    # this test has cored on solaris in the past. In addition,
-+    # --gc-sections doesn't really work at the moment (keeps on discarding
-+    # used sections, first .eh_frame and now some of the glibc sections for
-+    # iconv). Bzzzzt. Thanks for playing, maybe next time.
-+    echo $ac_n "checking for ld that supports -Wl,--gc-sections""... $ac_c" 1>&6
-+echo "configure:4312: checking for ld that supports -Wl,--gc-sections" >&5
-+    if test "$cross_compiling" = yes; then
-+  ac_sectionLDflags=yes
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4317 "configure"
-+#include "confdefs.h"
-+
-+     int main(void) 
-+     {
-+       try { throw 1; }
-+       catch (...) { };
-+       return 0;
-+     }
-+    
-+EOF
-+if { (eval echo configure:4328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-+then
-+  ac_sectionLDflags=yes
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -fr conftest*
-+  ac_sectionLDflags=no
-+fi
-+rm -fr conftest*
-+fi
-+
-+    if test "$ac_test_CFLAGS" = set; then
-+      CFLAGS="$ac_save_CFLAGS"
-+    else
-+      # this is the suspicious part
-+      CFLAGS=''
-+    fi
-+    if test "$ac_sectionLDflags" = "yes"; then
-+      SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
-+    fi
-+    echo "$ac_t""$ac_sectionLDflags" 1>&6
-+  fi
-+
-+  # Set linker optimization flags.
-+  if test x"$with_gnu_ld" = x"yes"; then
-+    OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
-+  fi
-+
-+  
-+  
-+
-+      
-+    echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
-+echo "configure:4362: checking for main in -lm" >&5
-+ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
-+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  ac_save_LIBS="$LIBS"
-+LIBS="-lm  $LIBS"
-+cat > conftest.$ac_ext <<EOF
-+#line 4370 "configure"
-+#include "confdefs.h"
-+
-+int main() {
-+main()
-+; return 0; }
-+EOF
-+if { (eval echo configure:4377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+  rm -rf conftest*
-+  eval "ac_cv_lib_$ac_lib_var=yes"
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_lib_$ac_lib_var=no"
-+fi
-+rm -f conftest*
-+LIBS="$ac_save_LIBS"
-+
-+fi
-+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+    ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-+  cat >> confdefs.h <<EOF
-+#define $ac_tr_lib 1
-+EOF
-+
-+  LIBS="-lm $LIBS"
-+
-+else
-+  echo "$ac_t""no" 1>&6
-+fi
-+
-+  for ac_func in nan copysignf
-+do
-+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-+echo "configure:4407: checking for $ac_func" >&5
-+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4412 "configure"
-+#include "confdefs.h"
-+/* System header to define __stub macros and hopefully few prototypes,
-+    which can conflict with char $ac_func(); below.  */
-+#include <assert.h>
-+/* Override any gcc2 internal prototype to avoid an error.  */
-+/* We use char because int might match the return type of a gcc2
-+    builtin and then its argument prototype would still apply.  */
-+char $ac_func();
-+
-+int main() {
-+
-+/* The GNU C library defines this for functions which it implements
-+    to always fail with ENOSYS.  Some functions are actually named
-+    something starting with __ and the normal name is an alias.  */
-+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-+choke me
-+#else
-+$ac_func();
-+#endif
-+
-+; return 0; }
-+EOF
-+if { (eval echo configure:4435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=yes"
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=no"
-+fi
-+rm -f conftest*
-+fi
-+
-+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-+  cat >> confdefs.h <<EOF
-+#define $ac_tr_func 1
-+EOF
-+ 
-+else
-+  echo "$ac_t""no" 1>&6
-+LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"
-+fi
-+done
-+
-+
-+    for ac_func in __signbit
-+do
-+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-+echo "configure:4464: checking for $ac_func" >&5
-+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4469 "configure"
-+#include "confdefs.h"
-+/* System header to define __stub macros and hopefully few prototypes,
-+    which can conflict with char $ac_func(); below.  */
-+#include <assert.h>
-+/* Override any gcc2 internal prototype to avoid an error.  */
-+/* We use char because int might match the return type of a gcc2
-+    builtin and then its argument prototype would still apply.  */
-+char $ac_func();
-+
-+int main() {
-+
-+/* The GNU C library defines this for functions which it implements
-+    to always fail with ENOSYS.  Some functions are actually named
-+    something starting with __ and the normal name is an alias.  */
-+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-+choke me
-+#else
-+$ac_func();
-+#endif
-+
-+; return 0; }
-+EOF
-+if { (eval echo configure:4492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=yes"
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=no"
-+fi
-+rm -f conftest*
-+fi
-+
-+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-+  cat >> confdefs.h <<EOF
-+#define $ac_tr_func 1
-+EOF
-+ 
-+else
-+  echo "$ac_t""no" 1>&6
-+LIBMATHOBJS="$LIBMATHOBJS signbit.lo"
-+fi
-+done
-+
-+  for ac_func in __signbitf
-+do
-+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-+echo "configure:4520: checking for $ac_func" >&5
-+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4525 "configure"
-+#include "confdefs.h"
-+/* System header to define __stub macros and hopefully few prototypes,
-+    which can conflict with char $ac_func(); below.  */
-+#include <assert.h>
-+/* Override any gcc2 internal prototype to avoid an error.  */
-+/* We use char because int might match the return type of a gcc2
-+    builtin and then its argument prototype would still apply.  */
-+char $ac_func();
-+
-+int main() {
-+
-+/* The GNU C library defines this for functions which it implements
-+    to always fail with ENOSYS.  Some functions are actually named
-+    something starting with __ and the normal name is an alias.  */
-+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-+choke me
-+#else
-+$ac_func();
-+#endif
-+
-+; return 0; }
-+EOF
-+if { (eval echo configure:4548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=yes"
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=no"
-+fi
-+rm -f conftest*
-+fi
-+
-+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-+  cat >> confdefs.h <<EOF
-+#define $ac_tr_func 1
-+EOF
-+ 
-+else
-+  echo "$ac_t""no" 1>&6
-+LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"
-+fi
-+done
-+
-+
-+          if test x$ac_cv_func_copysignl = x"yes"; then
-+    for ac_func in __signbitl
-+do
-+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-+echo "configure:4578: checking for $ac_func" >&5
-+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4583 "configure"
-+#include "confdefs.h"
-+/* System header to define __stub macros and hopefully few prototypes,
-+    which can conflict with char $ac_func(); below.  */
-+#include <assert.h>
-+/* Override any gcc2 internal prototype to avoid an error.  */
-+/* We use char because int might match the return type of a gcc2
-+    builtin and then its argument prototype would still apply.  */
-+char $ac_func();
-+
-+int main() {
-+
-+/* The GNU C library defines this for functions which it implements
-+    to always fail with ENOSYS.  Some functions are actually named
-+    something starting with __ and the normal name is an alias.  */
-+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-+choke me
-+#else
-+$ac_func();
-+#endif
-+
-+; return 0; }
-+EOF
-+if { (eval echo configure:4606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=yes"
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=no"
-+fi
-+rm -f conftest*
-+fi
-+
-+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-+  cat >> confdefs.h <<EOF
-+#define $ac_tr_func 1
-+EOF
-+ 
-+else
-+  echo "$ac_t""no" 1>&6
-+LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"
-+fi
-+done
-+
-+  fi
-+
-+  if test -n "$LIBMATHOBJS"; then
-+    need_libmath=yes
-+  fi
-+  
-+  
-+
-+if test "$need_libmath" = yes; then
-+  GLIBCPP_BUILD_LIBMATH_TRUE=
-+  GLIBCPP_BUILD_LIBMATH_FALSE='#'
-+else
-+  GLIBCPP_BUILD_LIBMATH_TRUE='#'
-+  GLIBCPP_BUILD_LIBMATH_FALSE=
-+fi
-+
-+      
-+    enable_wchar_t=no
-+
-+      echo $ac_n "checking for mbstate_t""... $ac_c" 1>&6
-+echo "configure:4651: checking for mbstate_t" >&5
-+  cat > conftest.$ac_ext <<EOF
-+#line 4653 "configure"
-+#include "confdefs.h"
-+#include <wchar.h>
-+int main() {
-+mbstate_t teststate;
-+; return 0; }
-+EOF
-+if { (eval echo configure:4660: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-+  rm -rf conftest*
-+  have_mbstate_t=yes
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  have_mbstate_t=no
-+fi
-+rm -f conftest*
-+  echo "$ac_t""$have_mbstate_t" 1>&6
-+  if test x"$have_mbstate_t" = xyes; then
-+    cat >> confdefs.h <<\EOF
-+#define HAVE_MBSTATE_T 1
-+EOF
-+
-+  fi
-+
-+    for ac_hdr in wchar.h
-+do
-+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-+echo "configure:4682: checking for $ac_hdr" >&5
-+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4687 "configure"
-+#include "confdefs.h"
-+#include <$ac_hdr>
-+EOF
-+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-+{ (eval echo configure:4692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-+if test -z "$ac_err"; then
-+  rm -rf conftest*
-+  eval "ac_cv_header_$ac_safe=yes"
-+else
-+  echo "$ac_err" >&5
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_header_$ac_safe=no"
-+fi
-+rm -f conftest*
-+fi
-+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-+  cat >> confdefs.h <<EOF
-+#define $ac_tr_hdr 1
-+EOF
-+ ac_has_wchar_h=yes
-+else
-+  echo "$ac_t""no" 1>&6
-+ac_has_wchar_h=no
-+fi
-+done
-+
-+  for ac_hdr in wctype.h
-+do
-+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-+echo "configure:4723: checking for $ac_hdr" >&5
-+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4728 "configure"
-+#include "confdefs.h"
-+#include <$ac_hdr>
-+EOF
-+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-+{ (eval echo configure:4733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-+if test -z "$ac_err"; then
-+  rm -rf conftest*
-+  eval "ac_cv_header_$ac_safe=yes"
-+else
-+  echo "$ac_err" >&5
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_header_$ac_safe=no"
-+fi
-+rm -f conftest*
-+fi
-+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-+  cat >> confdefs.h <<EOF
-+#define $ac_tr_hdr 1
-+EOF
-+ ac_has_wctype_h=yes
-+else
-+  echo "$ac_t""no" 1>&6
-+ac_has_wctype_h=no
-+fi
-+done
-+
-+  
-+    if test x"$ac_has_wchar_h" = xyes &&
-+     test x"$ac_has_wctype_h" = xyes &&
-+     test x"$enable_c_mbchar" != xno; then
-+      
-+            echo $ac_n "checking for WCHAR_MIN and WCHAR_MAX""... $ac_c" 1>&6
-+echo "configure:4766: checking for WCHAR_MIN and WCHAR_MAX" >&5
-+    cat > conftest.$ac_ext <<EOF
-+#line 4768 "configure"
-+#include "confdefs.h"
-+#include <wchar.h>
-+int main() {
-+int i = WCHAR_MIN; int j = WCHAR_MAX;
-+; return 0; }
-+EOF
-+if { (eval echo configure:4775: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-+  rm -rf conftest*
-+  has_wchar_minmax=yes
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  has_wchar_minmax=no
-+fi
-+rm -f conftest*
-+    echo "$ac_t""$has_wchar_minmax" 1>&6
-+    
-+            echo $ac_n "checking for WEOF""... $ac_c" 1>&6
-+echo "configure:4788: checking for WEOF" >&5
-+    cat > conftest.$ac_ext <<EOF
-+#line 4790 "configure"
-+#include "confdefs.h"
-+
-+      #include <wchar.h>
-+      #include <stddef.h>
-+int main() {
-+wint_t i = WEOF;
-+; return 0; }
-+EOF
-+if { (eval echo configure:4799: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-+  rm -rf conftest*
-+  has_weof=yes
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  has_weof=no
-+fi
-+rm -f conftest*
-+    echo "$ac_t""$has_weof" 1>&6
-+  
-+        ac_wfuncs=yes
-+    for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset
-+do
-+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-+echo "configure:4815: checking for $ac_func" >&5
-+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4820 "configure"
-+#include "confdefs.h"
-+/* System header to define __stub macros and hopefully few prototypes,
-+    which can conflict with char $ac_func(); below.  */
-+#include <assert.h>
-+/* Override any gcc2 internal prototype to avoid an error.  */
-+/* We use char because int might match the return type of a gcc2
-+    builtin and then its argument prototype would still apply.  */
-+char $ac_func();
-+
-+int main() {
-+
-+/* The GNU C library defines this for functions which it implements
-+    to always fail with ENOSYS.  Some functions are actually named
-+    something starting with __ and the normal name is an alias.  */
-+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-+choke me
-+#else
-+$ac_func();
-+#endif
-+
-+; return 0; }
-+EOF
-+if { (eval echo configure:4843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=yes"
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=no"
-+fi
-+rm -f conftest*
-+fi
-+
-+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-+  cat >> confdefs.h <<EOF
-+#define $ac_tr_func 1
-+EOF
-+ 
-+else
-+  echo "$ac_t""no" 1>&6
-+\
-+    ac_wfuncs=no
-+fi
-+done
-+
-+  
-+        for ac_func in btowc wctob fgetwc fgetws fputwc fputws fwide \
-+    fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
-+    vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
-+    mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
-+    wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
-+    wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr
-+do
-+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-+echo "configure:4878: checking for $ac_func" >&5
-+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4883 "configure"
-+#include "confdefs.h"
-+/* System header to define __stub macros and hopefully few prototypes,
-+    which can conflict with char $ac_func(); below.  */
-+#include <assert.h>
-+/* Override any gcc2 internal prototype to avoid an error.  */
-+/* We use char because int might match the return type of a gcc2
-+    builtin and then its argument prototype would still apply.  */
-+char $ac_func();
-+
-+int main() {
-+
-+/* The GNU C library defines this for functions which it implements
-+    to always fail with ENOSYS.  Some functions are actually named
-+    something starting with __ and the normal name is an alias.  */
-+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-+choke me
-+#else
-+$ac_func();
-+#endif
-+
-+; return 0; }
-+EOF
-+if { (eval echo configure:4906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=yes"
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=no"
-+fi
-+rm -f conftest*
-+fi
-+
-+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-+  cat >> confdefs.h <<EOF
-+#define $ac_tr_func 1
-+EOF
-+ 
-+else
-+  echo "$ac_t""no" 1>&6
-+\
-+    ac_wfuncs=no
-+fi
-+done
-+
-+
-+    echo $ac_n "checking for ISO C99 wchar_t support""... $ac_c" 1>&6
-+echo "configure:4934: checking for ISO C99 wchar_t support" >&5
-+    if test x"$has_weof" = xyes &&
-+       test x"$has_wchar_minmax" = xyes &&
-+       test x"$ac_wfuncs" = xyes; then
-+      ac_isoC99_wchar_t=yes
-+    else
-+      ac_isoC99_wchar_t=no
-+    fi
-+    echo "$ac_t""$ac_isoC99_wchar_t" 1>&6
-+  
-+            ac_safe=`echo "iconv.h" | sed 'y%./+-%__p_%'`
-+echo $ac_n "checking for iconv.h""... $ac_c" 1>&6
-+echo "configure:4946: checking for iconv.h" >&5
-+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4951 "configure"
-+#include "confdefs.h"
-+#include <iconv.h>
-+EOF
-+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-+{ (eval echo configure:4956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-+if test -z "$ac_err"; then
-+  rm -rf conftest*
-+  eval "ac_cv_header_$ac_safe=yes"
-+else
-+  echo "$ac_err" >&5
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_header_$ac_safe=no"
-+fi
-+rm -f conftest*
-+fi
-+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+  ac_has_iconv_h=yes
-+else
-+  echo "$ac_t""no" 1>&6
-+ac_has_iconv_h=no
-+fi
-+
-+    ac_safe=`echo "langinfo.h" | sed 'y%./+-%__p_%'`
-+echo $ac_n "checking for langinfo.h""... $ac_c" 1>&6
-+echo "configure:4980: checking for langinfo.h" >&5
-+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 4985 "configure"
-+#include "confdefs.h"
-+#include <langinfo.h>
-+EOF
-+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-+{ (eval echo configure:4990: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-+if test -z "$ac_err"; then
-+  rm -rf conftest*
-+  eval "ac_cv_header_$ac_safe=yes"
-+else
-+  echo "$ac_err" >&5
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_header_$ac_safe=no"
-+fi
-+rm -f conftest*
-+fi
-+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+  ac_has_langinfo_h=yes
-+else
-+  echo "$ac_t""no" 1>&6
-+ac_has_langinfo_h=no
-+fi
-+
-+
-+        echo $ac_n "checking for iconv in -liconv""... $ac_c" 1>&6
-+echo "configure:5014: checking for iconv in -liconv" >&5
-+ac_lib_var=`echo iconv'_'iconv | sed 'y%./+-%__p_%'`
-+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  ac_save_LIBS="$LIBS"
-+LIBS="-liconv  $LIBS"
-+cat > conftest.$ac_ext <<EOF
-+#line 5022 "configure"
-+#include "confdefs.h"
-+/* Override any gcc2 internal prototype to avoid an error.  */
-+/* We use char because int might match the return type of a gcc2
-+    builtin and then its argument prototype would still apply.  */
-+char iconv();
-+
-+int main() {
-+iconv()
-+; return 0; }
-+EOF
-+if { (eval echo configure:5033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+  rm -rf conftest*
-+  eval "ac_cv_lib_$ac_lib_var=yes"
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_lib_$ac_lib_var=no"
-+fi
-+rm -f conftest*
-+LIBS="$ac_save_LIBS"
-+
-+fi
-+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+  libiconv="-liconv"
-+else
-+  echo "$ac_t""no" 1>&6
-+fi
-+
-+    ac_save_LIBS="$LIBS"
-+    LIBS="$LIBS $libiconv"
-+
-+    for ac_func in iconv_open iconv_close iconv nl_langinfo
-+do
-+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-+echo "configure:5059: checking for $ac_func" >&5
-+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  cat > conftest.$ac_ext <<EOF
-+#line 5064 "configure"
-+#include "confdefs.h"
-+/* System header to define __stub macros and hopefully few prototypes,
-+    which can conflict with char $ac_func(); below.  */
-+#include <assert.h>
-+/* Override any gcc2 internal prototype to avoid an error.  */
-+/* We use char because int might match the return type of a gcc2
-+    builtin and then its argument prototype would still apply.  */
-+char $ac_func();
-+
-+int main() {
-+
-+/* The GNU C library defines this for functions which it implements
-+    to always fail with ENOSYS.  Some functions are actually named
-+    something starting with __ and the normal name is an alias.  */
-+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-+choke me
-+#else
-+$ac_func();
-+#endif
-+
-+; return 0; }
-+EOF
-+if { (eval echo configure:5087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=yes"
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_func_$ac_func=no"
-+fi
-+rm -f conftest*
-+fi
-+
-+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-+  cat >> confdefs.h <<EOF
-+#define $ac_tr_func 1
-+EOF
-+ \
-+    ac_XPG2funcs=yes
-+else
-+  echo "$ac_t""no" 1>&6
-+ac_XPG2funcs=no
-+fi
-+done
-+
-+  
-+    LIBS="$ac_save_LIBS"
-+
-+    echo $ac_n "checking for XPG2 wchar_t support""... $ac_c" 1>&6
-+echo "configure:5117: checking for XPG2 wchar_t support" >&5
-+    if test x"$ac_has_iconv_h" = xyes &&
-+       test x"$ac_has_langinfo_h" = xyes &&
-+       test x"$ac_XPG2funcs" = xyes; then
-+      ac_XPG2_wchar_t=yes
-+    else
-+      ac_XPG2_wchar_t=no
-+    fi
-+    echo "$ac_t""$ac_XPG2_wchar_t" 1>&6
-+  
-+            if test x"$ac_isoC99_wchar_t" = xyes &&
-+       test x"$ac_XPG2_wchar_t" = xyes; then
-+       cat >> confdefs.h <<\EOF
-+#define _GLIBCPP_USE_WCHAR_T 1
-+EOF
-+
-+       enable_wchar_t=yes 
-+    fi
-+  fi
-+  echo $ac_n "checking for enabled wchar_t specializations""... $ac_c" 1>&6
-+echo "configure:5137: checking for enabled wchar_t specializations" >&5
-+  echo "$ac_t""$enable_wchar_t" 1>&6  
-+  
-+
-+if test "$enable_wchar_t" = yes; then
-+  GLIBCPP_TEST_WCHAR_T_TRUE=
-+  GLIBCPP_TEST_WCHAR_T_FALSE='#'
-+else
-+  GLIBCPP_TEST_WCHAR_T_TRUE='#'
-+  GLIBCPP_TEST_WCHAR_T_FALSE=
-+fi    
-+
-+
-+      cat >> confdefs.h <<\EOF
-+#define HAVE_COPYSIGN 1
-+EOF
-+
-+      cat >> confdefs.h <<\EOF
-+#define HAVE_FINITE 1
-+EOF
-+
-+      cat >> confdefs.h <<\EOF
-+#define HAVE_FINITEF 1
-+EOF
-+
-+      cat >> confdefs.h <<\EOF
-+#define HAVE_ISINF 1
-+EOF
-+
-+      cat >> confdefs.h <<\EOF
-+#define HAVE_ISINFF 1
-+EOF
-+
-+      cat >> confdefs.h <<\EOF
-+#define HAVE_ISNAN 1
-+EOF
-+
-+      cat >> confdefs.h <<\EOF
-+#define HAVE_ISNANF 1
-+EOF
-+      ;;
-     *-linux*)
-       os_include_dir="os/gnu-linux"
-       for ac_hdr in nan.h ieeefp.h endian.h sys/isa_defs.h \
-diff -urN gcc-3.3.3-dist/libstdc++-v3/configure.in gcc-3.3.3/libstdc++-v3/configure.in
---- gcc-3.3.3-dist/libstdc++-v3/configure.in   2004-01-12 10:19:22.000000000 -0600
-+++ gcc-3.3.3/libstdc++-v3/configure.in        2004-08-12 04:47:51.000000000 -0500
-@@ -117,6 +117,36 @@
-   # GLIBCPP_CHECK_MATH_SUPPORT
-   case "$target" in
-+    *-uclibc*)
-+      os_include_dir="os/uclibc"
-+      AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
-+        machine/endian.h machine/param.h sys/machine.h sys/types.h \
-+        fp.h locale.h float.h inttypes.h])
-+      SECTION_FLAGS='-ffunction-sections -fdata-sections'
-+      AC_SUBST(SECTION_FLAGS)
-+      GLIBCPP_CHECK_LINKER_FEATURES
-+      GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
-+      GLIBCPP_CHECK_WCHAR_T_SUPPORT
-+
-+      AC_DEFINE(HAVE_COPYSIGN)
-+      #AC_DEFINE(HAVE_COPYSIGNF)
-+      AC_DEFINE(HAVE_FINITE)
-+      AC_DEFINE(HAVE_FINITEF)
-+      #AC_DEFINE(HAVE_FREXPF)
-+      #AC_DEFINE(HAVE_HYPOTF)
-+      AC_DEFINE(HAVE_ISINF)
-+      AC_DEFINE(HAVE_ISINFF)
-+      AC_DEFINE(HAVE_ISNAN)
-+      AC_DEFINE(HAVE_ISNANF)
-+      #AC_DEFINE(HAVE_SINCOS)
-+      #AC_DEFINE(HAVE_SINCOSF)
-+      #if test x"long_double_math_on_this_cpu" = x"yes"; then
-+        #AC_DEFINE(HAVE_FINITEL)
-+        #AC_DEFINE(HAVE_HYPOTL)
-+        #AC_DEFINE(HAVE_ISINFL)
-+        #AC_DEFINE(HAVE_ISNANL)
-+      #fi
-+      ;;
-     *-linux*)
-       os_include_dir="os/gnu-linux"
-       AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
-diff -urN gcc-3.3.3-dist/libstdc++-v3/configure.target gcc-3.3.3/libstdc++-v3/configure.target
---- gcc-3.3.3-dist/libstdc++-v3/configure.target       2003-10-01 14:07:07.000000000 -0500
-+++ gcc-3.3.3/libstdc++-v3/configure.target    2004-08-12 04:47:51.000000000 -0500
-@@ -133,6 +133,9 @@
-   freebsd*)
-     os_include_dir="os/bsd/freebsd"
-     ;;
-+  linux-uclibc*)
-+    os_include_dir="os/uclibc"
-+    ;;
-   gnu* | linux*)
-     os_include_dir="os/gnu-linux"
-     ;;
-diff -urN gcc-3.3.3-dist/libstdc++-v3/include/c_std/std_cstdlib.h gcc-3.3.3/libstdc++-v3/include/c_std/std_cstdlib.h
---- gcc-3.3.3-dist/libstdc++-v3/include/c_std/std_cstdlib.h    2003-04-18 05:08:05.000000000 -0500
-+++ gcc-3.3.3/libstdc++-v3/include/c_std/std_cstdlib.h 2004-08-12 04:47:51.000000000 -0500
-@@ -101,9 +101,11 @@
-   using ::labs;
-   using ::ldiv;
-   using ::malloc;
-+#if _GLIBCPP_USE_WCHAR_T
-   using ::mblen;
-   using ::mbstowcs;
-   using ::mbtowc;
-+#endif
-   using ::qsort;
-   using ::rand;
-   using ::realloc;
-@@ -112,8 +114,10 @@
-   using ::strtol;
-   using ::strtoul;
-   using ::system;
-+#if _GLIBCPP_USE_WCHAR_T
-   using ::wcstombs;
-   using ::wctomb;
-+#endif
-   inline long 
-   abs(long __i) { return labs(__i); }
-diff -urN gcc-3.3.3-dist/libstdc++-v3/include/c_std/std_cwchar.h gcc-3.3.3/libstdc++-v3/include/c_std/std_cwchar.h
---- gcc-3.3.3-dist/libstdc++-v3/include/c_std/std_cwchar.h     2003-04-18 05:08:05.000000000 -0500
-+++ gcc-3.3.3/libstdc++-v3/include/c_std/std_cwchar.h  2004-08-12 04:47:51.000000000 -0500
-@@ -165,7 +165,9 @@
-   using ::wcscoll;
-   using ::wcscpy;
-   using ::wcscspn;
-+#ifdef HAVE_WCSFTIME
-   using ::wcsftime;
-+#endif
-   using ::wcslen;
-   using ::wcsncat;
-   using ::wcsncmp;
-diff -urN gcc-3.3.3-dist/libtool.m4 gcc-3.3.3/libtool.m4
---- gcc-3.3.3-dist/libtool.m4  2003-09-09 03:04:17.000000000 -0500
-+++ gcc-3.3.3/libtool.m4       2004-08-12 04:47:51.000000000 -0500
-@@ -687,6 +687,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
-diff -urN gcc-3.3.3-dist/ltconfig gcc-3.3.3/ltconfig
---- gcc-3.3.3-dist/ltconfig    2003-02-19 20:10:02.000000000 -0600
-+++ gcc-3.3.3/ltconfig 2004-08-12 04:47:51.000000000 -0500
-@@ -603,6 +603,7 @@
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case $host_os in
- linux-gnu*) ;;
-+linux-uclibc*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
-@@ -1247,6 +1248,24 @@
-   dynamic_linker='GNU/Linux ld.so'
-   ;;
-+linux-uclibc*)
-+  version_type=linux
-+  need_lib_prefix=no
-+  need_version=no
-+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-+  soname_spec='${libname}${release}.so$major'
-+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-+  shlibpath_var=LD_LIBRARY_PATH
-+  shlibpath_overrides_runpath=no
-+  # This implies no fast_install, which is unacceptable.
-+  # Some rework will be needed to allow for fast_install
-+  # before this can be enabled.
-+  # Note: copied from linux-gnu, and may not be appropriate.
-+  hardcode_into_libs=yes
-+  # Assume using the uClibc dynamic linker.
-+  dynamic_linker="uClibc ld.so"
-+  ;;
-+
- netbsd*)
-   need_lib_prefix=no
-   need_version=no
diff --git a/openwrt/toolchain/gcc/3.3.5/110-uclibc-conf.patch b/openwrt/toolchain/gcc/3.3.5/110-uclibc-conf.patch
deleted file mode 100644 (file)
index f297c32..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-Use the patch by Carl Miller <chaz@energoncube.net> for powerpc, with
-some minor modifications.  Changed *os_uclibc to *os_linux_uclibc since
-at some point we might support other platforms.  Also updated to 3.3.3.
-diff -urN gcc-3.3.3/gcc/config/rs6000/linux.h gcc-3.3.3-new/gcc/config/rs6000/linux.h
---- gcc-3.3.3/gcc/config/rs6000/linux.h        2003-11-14 00:46:10.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config/rs6000/linux.h    2004-02-16 21:13:40.000000000 -0600
-@@ -64,7 +64,11 @@
- #define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
- #undef        LINK_OS_DEFAULT_SPEC
-+#ifdef USE_UCLIBC
-+#define LINK_OS_DEFAULT_SPEC "%(link_os_linux_uclibc)"
-+#else
- #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
-+#endif
- #undef TARGET_VERSION
- #define TARGET_VERSION fprintf (stderr, " (PowerPC GNU/Linux)");
-diff -urN gcc-3.3.3/gcc/config/rs6000/sysv4.h gcc-3.3.3-new/gcc/config/rs6000/sysv4.h
---- gcc-3.3.3/gcc/config/rs6000/sysv4.h        2003-10-28 13:55:41.000000000 -0600
-+++ gcc-3.3.3-new/gcc/config/rs6000/sysv4.h    2004-02-16 21:13:40.000000000 -0600
-@@ -968,9 +968,11 @@
- %{mcall-linux: %(link_os_linux) } \
- %{mcall-gnu: %(link_os_gnu) } \
- %{mcall-netbsd: %(link_os_netbsd) } \
-+%{mcall-uclibc: %(link_os_linux_uclibc) } \
- %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
-          %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
--         %{!mcall-netbsd: %(link_os_default) }}}}}}}}}"
-+         %{!mcall-netbsd: %{!mcall-uclibc: \
-+         %(link_os_default) }}}}}}}}}}"
- #define LINK_OS_DEFAULT_SPEC ""
-@@ -1307,6 +1309,12 @@
- #define LINK_OS_WINDISS_SPEC ""
-+/* uClibc support for Linux. */
-+
-+#define LINK_OS_LINUX_UCLIBC_SPEC "-m elf32ppclinux %{!shared: %{!static: \
-+  %{rdynamic:-export-dynamic} \
-+  %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}}"
-+
- /* Define any extra SPECS that the compiler needs to generate.  */
- /* Override rs6000.h definition.  */
- #undef        SUBTARGET_EXTRA_SPECS
-@@ -1372,6 +1380,7 @@
-   { "link_os_netbsd",         LINK_OS_NETBSD_SPEC },                  \
-   { "link_os_vxworks",                LINK_OS_VXWORKS_SPEC },                 \
-   { "link_os_windiss",                LINK_OS_WINDISS_SPEC },                 \
-+  { "link_os_linux_uclibc",   LINK_OS_LINUX_UCLIBC_SPEC },            \
-   { "link_os_default",                LINK_OS_DEFAULT_SPEC },                 \
-   { "cc1_endian_big",         CC1_ENDIAN_BIG_SPEC },                  \
-   { "cc1_endian_little",      CC1_ENDIAN_LITTLE_SPEC },               \
diff --git a/openwrt/toolchain/gcc/3.3.5/120-softfloat.patch b/openwrt/toolchain/gcc/3.3.5/120-softfloat.patch
deleted file mode 100644 (file)
index f243189..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
---- gcc-3.3.2-old/configure.in 2003-08-09 01:57:21.000000000 -0500
-+++ gcc-3.3.2/configure.in     2004-01-15 12:46:29.000000000 -0600
-@@ -1418,6 +1418,11 @@
- fi
- FLAGS_FOR_TARGET=
-+case " $targargs " in
-+ *" --nfp "* | *" --without-float "*)
-+    FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -msoft-float'
-+    ;;
-+esac
- case " $target_configdirs " in
-  *" newlib "*)
-   case " $targargs " in
diff --git a/openwrt/toolchain/gcc/3.3.5/200-uclibc-locale.patch b/openwrt/toolchain/gcc/3.3.5/200-uclibc-locale.patch
deleted file mode 100644 (file)
index 5880d83..0000000
+++ /dev/null
@@ -1,3021 +0,0 @@
-Warning!  This patch is not finished.  The wide char time-related stuff
-is broken or non-functional.  But it serves as a starting point to get
-things building while I continue to work on the uClibc locale internals.
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h   1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h    2004-01-09 07:55:02.000000000 -0600
-@@ -0,0 +1,63 @@
-+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
-+
-+// Copyright (C) 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+// Written by Jakub Jelinek <jakub@redhat.com>
-+
-+#include <clocale>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning clean this up
-+#endif
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+                                                  
-+extern "C" __typeof(iswctype_l) __iswctype_l;
-+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
-+extern "C" __typeof(strcoll_l) __strcoll_l;
-+extern "C" __typeof(strftime_l) __strftime_l;
-+extern "C" __typeof(strtod_l) __strtod_l;
-+extern "C" __typeof(strtof_l) __strtof_l;
-+extern "C" __typeof(strtold_l) __strtold_l;
-+extern "C" __typeof(strtol_l) __strtol_l;
-+extern "C" __typeof(strtoll_l) __strtoll_l;
-+extern "C" __typeof(strtoul_l) __strtoul_l;
-+extern "C" __typeof(strtoull_l) __strtoull_l;
-+extern "C" __typeof(strxfrm_l) __strxfrm_l;
-+extern "C" __typeof(towlower_l) __towlower_l;
-+extern "C" __typeof(towupper_l) __towupper_l;
-+extern "C" __typeof(wcscoll_l) __wcscoll_l;
-+extern "C" __typeof(wcsftime_l) __wcsftime_l;
-+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
-+extern "C" __typeof(wctype_l) __wctype_l;
-+extern "C" __typeof(newlocale) __newlocale;
-+extern "C" __typeof(freelocale) __freelocale;
-+extern "C" __typeof(duplocale) __duplocale;
-+extern "C" __typeof(uselocale) __uselocale;
-+
-+#endif // GLIBC 2.3 and later
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.cc    1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.cc     2004-01-09 08:37:55.000000000 -0600
-@@ -0,0 +1,231 @@
-+// Wrapper for underlying C-language localization -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.8  Standard locale categories.
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <stdexcept>
-+#include <langinfo.h>
-+#include <bits/c++locale_internal.h>
-+
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
-+#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
-+#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
-+#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
-+#define __strtof_l(S, E, L)         strtof((S), (E))
-+#define __strtod_l(S, E, L)         strtod((S), (E))
-+#define __strtold_l(S, E, L)        strtold((S), (E))
-+#endif
-+
-+namespace std 
-+{
-+  template<>
-+    void
-+    __convert_to_v(const char* __s, long& __v, ios_base::iostate& __err, 
-+                 const __c_locale& __cloc, int __base)
-+    {
-+      if (!(__err & ios_base::failbit))
-+      {
-+      char* __sanity;
-+      errno = 0;
-+      long __l = __strtol_l(__s, &__sanity, __base, __cloc);
-+      if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
-+        __v = __l;
-+      else
-+        __err |= ios_base::failbit;
-+      }
-+    }
-+
-+  template<>
-+    void
-+    __convert_to_v(const char* __s, unsigned long& __v, 
-+                 ios_base::iostate& __err, const __c_locale& __cloc, 
-+                 int __base)
-+    {
-+      if (!(__err & ios_base::failbit))
-+      {
-+        char* __sanity;
-+        errno = 0;
-+        unsigned long __ul = __strtoul_l(__s, &__sanity, __base, __cloc);
-+          if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
-+          __v = __ul;
-+        else
-+          __err |= ios_base::failbit;
-+      }
-+    }
-+
-+#ifdef _GLIBCPP_USE_LONG_LONG
-+  template<>
-+    void
-+    __convert_to_v(const char* __s, long long& __v, ios_base::iostate& __err, 
-+                 const __c_locale& __cloc, int __base)
-+    {
-+      if (!(__err & ios_base::failbit))
-+      {
-+        char* __sanity;
-+        errno = 0;
-+        long long __ll = __strtoll_l(__s, &__sanity, __base, __cloc);
-+          if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
-+          __v = __ll;
-+        else
-+          __err |= ios_base::failbit;
-+      }
-+    }
-+
-+  template<>
-+    void
-+    __convert_to_v(const char* __s, unsigned long long& __v, 
-+                 ios_base::iostate& __err, const __c_locale& __cloc, 
-+                 int __base)
-+    {
-+      if (!(__err & ios_base::failbit))
-+      {      
-+        char* __sanity;
-+        errno = 0;
-+        unsigned long long __ull = __strtoull_l(__s, &__sanity, __base, 
-+                                                __cloc);
-+          if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
-+          __v = __ull;
-+        else
-+          __err |= ios_base::failbit;
-+      }  
-+    }
-+#endif
-+
-+  template<>
-+    void
-+    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
-+                 const __c_locale& __cloc, int)
-+    {
-+      if (!(__err & ios_base::failbit))
-+      {
-+        char* __sanity;
-+        errno = 0;
-+        float __f = __strtof_l(__s, &__sanity, __cloc);
-+          if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
-+          __v = __f;
-+        else
-+          __err |= ios_base::failbit;
-+      }
-+    }
-+
-+  template<>
-+    void
-+    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
-+                 const __c_locale& __cloc, int)
-+    {
-+      if (!(__err & ios_base::failbit))
-+      {
-+        char* __sanity;
-+        errno = 0;
-+        double __d = __strtod_l(__s, &__sanity, __cloc);
-+          if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
-+          __v = __d;
-+        else
-+          __err |= ios_base::failbit;
-+      }
-+    }
-+
-+  template<>
-+    void
-+    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
-+                 const __c_locale& __cloc, int)
-+    {
-+      if (!(__err & ios_base::failbit))
-+      {
-+        char* __sanity;
-+        errno = 0;
-+        long double __ld = __strtold_l(__s, &__sanity, __cloc);
-+          if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
-+          __v = __ld;
-+        else
-+          __err |= ios_base::failbit;
-+      }
-+    }
-+
-+  void
-+  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
-+                                  __c_locale __old)
-+  {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __cloc = __newlocale(1 << LC_ALL, __s, __old);
-+    if (!__cloc)
-+      {
-+      // This named locale is not supported by the underlying OS.
-+      __throw_runtime_error("attempt to create locale from unknown name");
-+      }
-+#else
-+    __cloc = NULL;
-+#endif
-+  }
-+  
-+  void
-+  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
-+  {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    if (_S_c_locale != __cloc)
-+      __freelocale(__cloc); 
-+#else
-+    __cloc = NULL;
-+#endif
-+  }
-+
-+  __c_locale
-+  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+  { return __duplocale(__cloc); }
-+#else
-+  { return __c_locale(); }
-+#endif
-+
-+  const char* locale::_S_categories[_S_categories_size 
-+                                  + _S_extra_categories_size] =
-+    {
-+      "LC_CTYPE", 
-+      "LC_NUMERIC",
-+      "LC_TIME", 
-+      "LC_COLLATE", 
-+      "LC_MONETARY",
-+      "LC_MESSAGES"
-+#if _GLIBCPP_NUM_CATEGORIES != 0
-+      , 
-+      "LC_PAPER", 
-+      "LC_NAME", 
-+      "LC_ADDRESS",
-+      "LC_TELEPHONE", 
-+      "LC_MEASUREMENT", 
-+      "LC_IDENTIFICATION" 
-+#endif
-+    };
-+}  // namespace std
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.h
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.h     1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.h      2004-01-09 07:51:06.000000000 -0600
-@@ -0,0 +1,118 @@
-+// Wrapper for underlying C-language localization -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.8  Standard locale categories.
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#ifndef _CPP_BITS_C_LOCALE_H
-+#define _CPP_BITS_C_LOCALE_H 1
-+
-+#pragma GCC system_header
-+
-+#include <clocale>
-+#include <langinfo.h>         // For codecvt
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix this
-+#endif
-+#ifdef __UCLIBC_HAS_LOCALE__
-+#include <iconv.h>            // For codecvt using iconv, iconv_t
-+#endif
-+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
-+#include <libintl.h>          // For messages
-+#endif
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning what is _GLIBCPP_C_LOCALE_GNU for
-+#endif
-+#define _GLIBCPP_C_LOCALE_GNU 1
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix categories
-+#endif
-+// #define _GLIBCPP_NUM_CATEGORIES 6
-+#define _GLIBCPP_NUM_CATEGORIES 0
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+namespace __gnu_cxx
-+{
-+  extern "C" __typeof(uselocale) __uselocale;
-+}
-+#endif
-+
-+namespace std
-+{
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+  typedef __locale_t          __c_locale;
-+#else
-+  typedef int*                        __c_locale;
-+#endif
-+
-+  // Convert numeric value of type _Tv to string and return length of
-+  // string.  If snprintf is available use it, otherwise fall back to
-+  // the unsafe sprintf which, in general, can be dangerous and should
-+  // be avoided.
-+  template<typename _Tv>
-+    int
-+    __convert_from_v(char* __out, const int __size, const char* __fmt,
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+                   _Tv __v, const __c_locale& __cloc, int __prec = -1)
-+    {
-+      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
-+#else
-+                   _Tv __v, const __c_locale&, int __prec = -1)
-+    {
-+# ifdef __UCLIBC_HAS_LOCALE__
-+      char* __old = setlocale(LC_ALL, NULL);
-+      char* __sav = static_cast<char*>(malloc(strlen(__old) + 1));
-+      if (__sav)
-+        strcpy(__sav, __old);
-+      setlocale(LC_ALL, "C");
-+# endif
-+#endif
-+
-+      int __ret;
-+      if (__prec >= 0)
-+        __ret = snprintf(__out, __size, __fmt, __prec, __v);
-+      else
-+        __ret = snprintf(__out, __size, __fmt, __v);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+      __gnu_cxx::__uselocale(__old);
-+#elif defined __UCLIBC_HAS_LOCALE__
-+      setlocale(LC_ALL, __sav);
-+      free(__sav);
-+#endif
-+      return __ret;
-+    }
-+}
-+
-+#endif
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_members.cc     1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_members.cc      2004-01-09 04:04:34.000000000 -0600
-@@ -0,0 +1,113 @@
-+// std::codecvt implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.1.5 - Template class codecvt
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+namespace std
-+{
-+  // Specializations.
-+#ifdef _GLIBCPP_USE_WCHAR_T
-+  codecvt_base::result
-+  codecvt<wchar_t, char, mbstate_t>::
-+  do_out(state_type& __state, const intern_type* __from, 
-+       const intern_type* __from_end, const intern_type*& __from_next,
-+       extern_type* __to, extern_type* __to_end,
-+       extern_type*& __to_next) const
-+  {
-+    result __ret = error;
-+    size_t __len = min(__from_end - __from, __to_end - __to);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_S_c_locale);
-+#endif
-+    size_t __conv = wcsrtombs(__to, &__from, __len, &__state);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+
-+    if (__conv == __len)
-+      {
-+      __from_next = __from;
-+      __to_next = __to + __conv;
-+      __ret = ok;
-+      }
-+    else if (__conv > 0 && __conv < __len)
-+      {
-+      __from_next = __from;
-+      __to_next = __to + __conv;
-+      __ret = partial;
-+      }
-+    else
-+      __ret = error;
-+      
-+    return __ret; 
-+  }
-+  
-+  codecvt_base::result
-+  codecvt<wchar_t, char, mbstate_t>::
-+  do_in(state_type& __state, const extern_type* __from, 
-+      const extern_type* __from_end, const extern_type*& __from_next,
-+      intern_type* __to, intern_type* __to_end,
-+      intern_type*& __to_next) const
-+  {
-+    result __ret = error;
-+    size_t __len = min(__from_end - __from, __to_end - __to);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_S_c_locale);
-+#endif
-+    size_t __conv = mbsrtowcs(__to, &__from, __len, &__state);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+
-+    if (__conv == __len)
-+      {
-+      __from_next = __from;
-+      __to_next = __to + __conv;
-+      __ret = ok;
-+      }
-+    else if (__conv > 0 && __conv < __len)
-+      {
-+      __from_next = __from;
-+      __to_next = __to + __conv;
-+      __ret = partial;
-+      }
-+    else
-+      __ret = error;
-+      
-+    return __ret; 
-+  }
-+#endif
-+}
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h      1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h       2004-01-09 01:53:51.000000000 -0600
-@@ -0,0 +1,461 @@
-+// Locale support (codecvt) -*- C++ -*-
-+
-+// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.1.5 Template class codecvt
-+//
-+
-+// Warning: this file is not meant for user inclusion.  Use <locale>.
-+
-+// Written by Benjamin Kosnik <bkoz@cygnus.com>
-+
-+  // XXX
-+  // Define this here to codecvt.cc can have _S_max_size definition.
-+#define _GLIBCPP_USE___ENC_TRAITS 1
-+
-+  // Extension to use icov for dealing with character encodings,
-+  // including conversions and comparisons between various character
-+  // sets.  This object encapsulates data that may need to be shared between
-+  // char_traits, codecvt and ctype.
-+  class __enc_traits
-+  {
-+  public:
-+    // Types: 
-+    // NB: A conversion descriptor subsumes and enhances the
-+    // functionality of a simple state type such as mbstate_t.
-+    typedef iconv_t   __desc_type;
-+    
-+  protected:
-+    // Data Members:
-+    // Max size of charset encoding name
-+    static const int  _S_max_size = 32;
-+    // Name of internal character set encoding.
-+    char              _M_int_enc[_S_max_size];
-+    // Name of external character set encoding.
-+    char              _M_ext_enc[_S_max_size];
-+
-+    // Conversion descriptor between external encoding to internal encoding.
-+    __desc_type               _M_in_desc;
-+    // Conversion descriptor between internal encoding to external encoding.
-+    __desc_type               _M_out_desc;
-+
-+    // Details the byte-order marker for the external encoding, if necessary.
-+    int                       _M_ext_bom;
-+
-+    // Details the byte-order marker for the internal encoding, if necessary.
-+    int                       _M_int_bom;
-+
-+  public:
-+    explicit __enc_traits() 
-+    : _M_in_desc(0), _M_out_desc(0), _M_ext_bom(0), _M_int_bom(0) 
-+    {
-+      memset(_M_int_enc, 0, _S_max_size);
-+      memset(_M_ext_enc, 0, _S_max_size);
-+    }
-+
-+    explicit __enc_traits(const char* __int, const char* __ext, 
-+                        int __ibom = 0, int __ebom = 0)
-+    : _M_in_desc(0), _M_out_desc(0), _M_ext_bom(0), _M_int_bom(0)
-+    {
-+      strncpy(_M_int_enc, __int, _S_max_size);
-+      strncpy(_M_ext_enc, __ext, _S_max_size);
-+    }
-+
-+    // 21.1.2 traits typedefs
-+    // p4
-+    // typedef STATE_T state_type
-+    // requires: state_type shall meet the requirements of
-+    // CopyConstructible types (20.1.3)
-+    __enc_traits(const __enc_traits& __obj): _M_in_desc(0), _M_out_desc(0)
-+    {
-+      strncpy(_M_int_enc, __obj._M_int_enc, _S_max_size);
-+      strncpy(_M_ext_enc, __obj._M_ext_enc, _S_max_size);
-+      _M_ext_bom = __obj._M_ext_bom;
-+      _M_int_bom = __obj._M_int_bom;
-+    }
-+
-+    // Need assignment operator as well.
-+    __enc_traits&
-+    operator=(const __enc_traits& __obj)
-+    {
-+      strncpy(_M_int_enc, __obj._M_int_enc, _S_max_size);
-+      strncpy(_M_ext_enc, __obj._M_ext_enc, _S_max_size);
-+      _M_in_desc = 0;
-+      _M_out_desc = 0;
-+      _M_ext_bom = __obj._M_ext_bom;
-+      _M_int_bom = __obj._M_int_bom;
-+      return *this;
-+    }
-+
-+    ~__enc_traits()
-+    {
-+      __desc_type __err = reinterpret_cast<iconv_t>(-1);
-+      if (_M_in_desc && _M_in_desc != __err) 
-+      iconv_close(_M_in_desc);
-+      if (_M_out_desc && _M_out_desc != __err) 
-+      iconv_close(_M_out_desc);
-+    } 
-+
-+    void
-+    _M_init()
-+    {
-+      const __desc_type __err = reinterpret_cast<iconv_t>(-1);
-+      if (!_M_in_desc)
-+      {
-+        _M_in_desc = iconv_open(_M_int_enc, _M_ext_enc);
-+        if (_M_in_desc == __err)
-+          __throw_runtime_error("creating iconv input descriptor failed.");
-+      }
-+      if (!_M_out_desc)
-+      {
-+        _M_out_desc = iconv_open(_M_ext_enc, _M_int_enc);
-+        if (_M_out_desc == __err)
-+          __throw_runtime_error("creating iconv output descriptor failed.");
-+      }
-+    }
-+
-+    bool
-+    _M_good()
-+    { 
-+      const __desc_type __err = reinterpret_cast<iconv_t>(-1);
-+      bool __test = _M_in_desc && _M_in_desc != __err; 
-+      __test &=  _M_out_desc && _M_out_desc != __err;
-+      return __test;
-+    }
-+
-+    const __desc_type* 
-+    _M_get_in_descriptor()
-+    { return &_M_in_desc; }
-+
-+    const __desc_type* 
-+    _M_get_out_descriptor()
-+    { return &_M_out_desc; }
-+
-+    int 
-+    _M_get_external_bom()
-+    { return _M_ext_bom; }
-+
-+    int 
-+    _M_get_internal_bom()
-+    { return _M_int_bom; }
-+
-+    const char* 
-+    _M_get_internal_enc()
-+    { return _M_int_enc; }
-+
-+    const char* 
-+    _M_get_external_enc()
-+    { return _M_ext_enc; }
-+  };
-+
-+  // Partial specialization
-+  // This specialization takes advantage of iconv to provide code
-+  // conversions between a large number of character encodings.
-+  template<typename _InternT, typename _ExternT>
-+    class codecvt<_InternT, _ExternT, __enc_traits>
-+    : public __codecvt_abstract_base<_InternT, _ExternT, __enc_traits>
-+    {
-+    public:      
-+      // Types:
-+      typedef codecvt_base::result                    result;
-+      typedef _InternT                                        intern_type;
-+      typedef _ExternT                                        extern_type;
-+      typedef __enc_traits                            state_type;
-+      typedef __enc_traits::__desc_type               __desc_type;
-+      typedef __enc_traits                            __enc_type;
-+
-+      // Data Members:
-+      static locale::id               id;
-+
-+      explicit 
-+      codecvt(size_t __refs = 0)
-+      : __codecvt_abstract_base<intern_type, extern_type, state_type>(__refs)
-+      { }
-+
-+      explicit 
-+      codecvt(__enc_type* __enc, size_t __refs = 0)
-+      : __codecvt_abstract_base<intern_type, extern_type, state_type>(__refs)
-+      { }
-+
-+    protected:
-+      virtual 
-+      ~codecvt() { }
-+
-+      virtual result
-+      do_out(state_type& __state, const intern_type* __from, 
-+           const intern_type* __from_end, const intern_type*& __from_next,
-+           extern_type* __to, extern_type* __to_end,
-+           extern_type*& __to_next) const;
-+
-+      virtual result
-+      do_unshift(state_type& __state, extern_type* __to, 
-+               extern_type* __to_end, extern_type*& __to_next) const;
-+
-+      virtual result
-+      do_in(state_type& __state, const extern_type* __from, 
-+          const extern_type* __from_end, const extern_type*& __from_next,
-+          intern_type* __to, intern_type* __to_end, 
-+          intern_type*& __to_next) const;
-+
-+      virtual int 
-+      do_encoding() const throw();
-+
-+      virtual bool 
-+      do_always_noconv() const throw();
-+
-+      virtual int 
-+      do_length(const state_type&, const extern_type* __from, 
-+              const extern_type* __end, size_t __max) const;
-+
-+      virtual int 
-+      do_max_length() const throw();
-+    };
-+
-+  template<typename _InternT, typename _ExternT>
-+    locale::id 
-+    codecvt<_InternT, _ExternT, __enc_traits>::id;
-+
-+  // This adaptor works around the signature problems of the second
-+  // argument to iconv():  SUSv2 and others use 'const char**', but glibc 2.2
-+  // uses 'char**', which matches the POSIX 1003.1-2001 standard.
-+  // Using this adaptor, g++ will do the work for us.
-+  template<typename _T>
-+    inline size_t
-+    __iconv_adaptor(size_t(*__func)(iconv_t, _T, size_t*, char**, size_t*),
-+                    iconv_t __cd, char** __inbuf, size_t* __inbytes,
-+                    char** __outbuf, size_t* __outbytes)
-+    { return __func(__cd, (_T)__inbuf, __inbytes, __outbuf, __outbytes); }
-+
-+  template<typename _InternT, typename _ExternT>
-+    codecvt_base::result
-+    codecvt<_InternT, _ExternT, __enc_traits>::
-+    do_out(state_type& __state, const intern_type* __from, 
-+         const intern_type* __from_end, const intern_type*& __from_next,
-+         extern_type* __to, extern_type* __to_end,
-+         extern_type*& __to_next) const
-+    {
-+      result __ret = codecvt_base::error;
-+      if (__state._M_good())
-+      {
-+        typedef state_type::__desc_type       __desc_type;
-+        const __desc_type* __desc = __state._M_get_out_descriptor();
-+        const size_t __fmultiple = sizeof(intern_type);
-+        size_t __fbytes = __fmultiple * (__from_end - __from);
-+        const size_t __tmultiple = sizeof(extern_type);
-+        size_t __tbytes = __tmultiple * (__to_end - __to); 
-+        
-+        // Argument list for iconv specifies a byte sequence. Thus,
-+        // all to/from arrays must be brutally casted to char*.
-+        char* __cto = reinterpret_cast<char*>(__to);
-+        char* __cfrom;
-+        size_t __conv;
-+
-+        // Some encodings need a byte order marker as the first item
-+        // in the byte stream, to designate endian-ness. The default
-+        // value for the byte order marker is NULL, so if this is
-+        // the case, it's not necessary and we can just go on our
-+        // merry way.
-+        int __int_bom = __state._M_get_internal_bom();
-+        if (__int_bom)
-+          {     
-+            size_t __size = __from_end - __from;
-+            intern_type* __cfixed = static_cast<intern_type*>(__builtin_alloca(sizeof(intern_type) * (__size + 1)));
-+            __cfixed[0] = static_cast<intern_type>(__int_bom);
-+            char_traits<intern_type>::copy(__cfixed + 1, __from, __size);
-+            __cfrom = reinterpret_cast<char*>(__cfixed);
-+            __conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
-+                                        &__fbytes, &__cto, &__tbytes); 
-+          }
-+        else
-+          {
-+            intern_type* __cfixed = const_cast<intern_type*>(__from);
-+            __cfrom = reinterpret_cast<char*>(__cfixed);
-+            __conv = __iconv_adaptor(iconv, *__desc, &__cfrom, &__fbytes, 
-+                                     &__cto, &__tbytes); 
-+          }
-+
-+        if (__conv != size_t(-1))
-+          {
-+            __from_next = reinterpret_cast<const intern_type*>(__cfrom);
-+            __to_next = reinterpret_cast<extern_type*>(__cto);
-+            __ret = codecvt_base::ok;
-+          }
-+        else 
-+          {
-+            if (__fbytes < __fmultiple * (__from_end - __from))
-+              {
-+                __from_next = reinterpret_cast<const intern_type*>(__cfrom);
-+                __to_next = reinterpret_cast<extern_type*>(__cto);
-+                __ret = codecvt_base::partial;
-+              }
-+            else
-+              __ret = codecvt_base::error;
-+          }
-+      }
-+      return __ret; 
-+    }
-+
-+  template<typename _InternT, typename _ExternT>
-+    codecvt_base::result
-+    codecvt<_InternT, _ExternT, __enc_traits>::
-+    do_unshift(state_type& __state, extern_type* __to, 
-+             extern_type* __to_end, extern_type*& __to_next) const
-+    {
-+      result __ret = codecvt_base::error;
-+      if (__state._M_good())
-+      {
-+        typedef state_type::__desc_type       __desc_type;
-+        const __desc_type* __desc = __state._M_get_in_descriptor();
-+        const size_t __tmultiple = sizeof(intern_type);
-+        size_t __tlen = __tmultiple * (__to_end - __to); 
-+        
-+        // Argument list for iconv specifies a byte sequence. Thus,
-+        // all to/from arrays must be brutally casted to char*.
-+        char* __cto = reinterpret_cast<char*>(__to);
-+        size_t __conv = __iconv_adaptor(iconv,*__desc, NULL, NULL,
-+                                          &__cto, &__tlen); 
-+        
-+        if (__conv != size_t(-1))
-+          {
-+            __to_next = reinterpret_cast<extern_type*>(__cto);
-+            if (__tlen == __tmultiple * (__to_end - __to))
-+              __ret = codecvt_base::noconv;
-+            else if (__tlen == 0)
-+              __ret = codecvt_base::ok;
-+            else
-+              __ret = codecvt_base::partial;
-+          }
-+        else 
-+          __ret = codecvt_base::error;
-+      }
-+      return __ret; 
-+    }
-+   
-+  template<typename _InternT, typename _ExternT>
-+    codecvt_base::result
-+    codecvt<_InternT, _ExternT, __enc_traits>::
-+    do_in(state_type& __state, const extern_type* __from, 
-+        const extern_type* __from_end, const extern_type*& __from_next,
-+        intern_type* __to, intern_type* __to_end, 
-+        intern_type*& __to_next) const
-+    { 
-+      result __ret = codecvt_base::error;
-+      if (__state._M_good())
-+      {
-+        typedef state_type::__desc_type       __desc_type;
-+        const __desc_type* __desc = __state._M_get_in_descriptor();
-+        const size_t __fmultiple = sizeof(extern_type);
-+        size_t __flen = __fmultiple * (__from_end - __from);
-+        const size_t __tmultiple = sizeof(intern_type);
-+        size_t __tlen = __tmultiple * (__to_end - __to); 
-+        
-+        // Argument list for iconv specifies a byte sequence. Thus,
-+        // all to/from arrays must be brutally casted to char*.
-+        char* __cto = reinterpret_cast<char*>(__to);
-+        char* __cfrom;
-+        size_t __conv;
-+
-+        // Some encodings need a byte order marker as the first item
-+        // in the byte stream, to designate endian-ness. The default
-+        // value for the byte order marker is NULL, so if this is
-+        // the case, it's not necessary and we can just go on our
-+        // merry way.
-+        int __ext_bom = __state._M_get_external_bom();
-+        if (__ext_bom)
-+          {     
-+            size_t __size = __from_end - __from;
-+            extern_type* __cfixed =  static_cast<extern_type*>(__builtin_alloca(sizeof(extern_type) * (__size + 1)));
-+            __cfixed[0] = static_cast<extern_type>(__ext_bom);
-+            char_traits<extern_type>::copy(__cfixed + 1, __from, __size);
-+            __cfrom = reinterpret_cast<char*>(__cfixed);
-+            __conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
-+                                       &__flen, &__cto, &__tlen); 
-+          }
-+        else
-+          {
-+            extern_type* __cfixed = const_cast<extern_type*>(__from);
-+            __cfrom = reinterpret_cast<char*>(__cfixed);
-+            __conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
-+                                       &__flen, &__cto, &__tlen); 
-+          }
-+
-+        
-+        if (__conv != size_t(-1))
-+          {
-+            __from_next = reinterpret_cast<const extern_type*>(__cfrom);
-+            __to_next = reinterpret_cast<intern_type*>(__cto);
-+            __ret = codecvt_base::ok;
-+          }
-+        else 
-+          {
-+            if (__flen < static_cast<size_t>(__from_end - __from))
-+              {
-+                __from_next = reinterpret_cast<const extern_type*>(__cfrom);
-+                __to_next = reinterpret_cast<intern_type*>(__cto);
-+                __ret = codecvt_base::partial;
-+              }
-+            else
-+              __ret = codecvt_base::error;
-+          }
-+      }
-+      return __ret; 
-+    }
-+  
-+  template<typename _InternT, typename _ExternT>
-+    int 
-+    codecvt<_InternT, _ExternT, __enc_traits>::
-+    do_encoding() const throw()
-+    {
-+      int __ret = 0;
-+      if (sizeof(_ExternT) <= sizeof(_InternT))
-+      __ret = sizeof(_InternT)/sizeof(_ExternT);
-+      return __ret; 
-+    }
-+  
-+  template<typename _InternT, typename _ExternT>
-+    bool 
-+    codecvt<_InternT, _ExternT, __enc_traits>::
-+    do_always_noconv() const throw()
-+    { return false; }
-+  
-+  template<typename _InternT, typename _ExternT>
-+    int 
-+    codecvt<_InternT, _ExternT, __enc_traits>::
-+    do_length(const state_type&, const extern_type* __from, 
-+            const extern_type* __end, size_t __max) const
-+    { return min(__max, static_cast<size_t>(__end - __from)); }
-+
-+#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
-+// 74.  Garbled text for codecvt::do_max_length
-+  template<typename _InternT, typename _ExternT>
-+    int 
-+    codecvt<_InternT, _ExternT, __enc_traits>::
-+    do_max_length() const throw()
-+    { return 1; }
-+#endif
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/collate_members.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/collate_members.cc     1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/collate_members.cc      2004-01-09 08:06:24.000000000 -0600
-@@ -0,0 +1,80 @@
-+// std::collate implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
-+#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
-+#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
-+#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
-+#endif
-+
-+namespace std
-+{
-+  // These are basically extensions to char_traits, and perhaps should
-+  // be put there instead of here.
-+  template<>
-+    int 
-+    collate<char>::_M_compare(const char* __one, const char* __two) const
-+    { 
-+      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
-+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
-+    }
-+  
-+  template<>
-+    size_t
-+    collate<char>::_M_transform(char* __to, const char* __from, 
-+                              size_t __n) const 
-+    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
-+
-+#ifdef _GLIBCPP_USE_WCHAR_T
-+  template<>
-+    int 
-+    collate<wchar_t>::_M_compare(const wchar_t* __one, 
-+                               const wchar_t* __two) const
-+    {
-+      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
-+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
-+    }
-+  
-+  template<>
-+    size_t
-+    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
-+                                 size_t __n) const
-+    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
-+#endif
-+}
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/ctype_members.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc       1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/ctype_members.cc        2004-01-09 08:15:41.000000000 -0600
-@@ -0,0 +1,274 @@
-+// std::ctype implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#define _LIBC
-+#include <locale>
-+#undef _LIBC
-+#include <bits/c++locale_internal.h>
-+
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __wctype_l(S, L)           wctype((S))
-+#define __towupper_l(C, L)         towupper((C))
-+#define __towlower_l(C, L)         towlower((C))
-+#define __iswctype_l(C, M, L)      iswctype((C), (M))
-+#endif
-+
-+namespace std
-+{
-+  // NB: The other ctype<char> specializations are in src/locale.cc and
-+  // various /config/os/* files.
-+  template<>
-+    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
-+    : ctype<char>(0, false, __refs) 
-+    {         
-+      _S_destroy_c_locale(_M_c_locale_ctype);
-+      _S_create_c_locale(_M_c_locale_ctype, __s); 
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+      _M_toupper = _M_c_locale_ctype->__ctype_toupper;
-+      _M_tolower = _M_c_locale_ctype->__ctype_tolower;
-+      _M_table = _M_c_locale_ctype->__ctype_b;
-+#endif
-+    }
-+
-+#ifdef _GLIBCPP_USE_WCHAR_T  
-+  ctype<wchar_t>::__wmask_type
-+  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
-+  {
-+    __wmask_type __ret;
-+    switch (__m)
-+      {
-+      case space:
-+      __ret = __wctype_l("space", _M_c_locale_ctype);
-+      break;
-+      case print:
-+      __ret = __wctype_l("print", _M_c_locale_ctype);
-+      break;
-+      case cntrl:
-+      __ret = __wctype_l("cntrl", _M_c_locale_ctype);
-+      break;
-+      case upper:
-+      __ret = __wctype_l("upper", _M_c_locale_ctype);
-+      break;
-+      case lower:
-+      __ret = __wctype_l("lower", _M_c_locale_ctype);
-+      break;
-+      case alpha:
-+      __ret = __wctype_l("alpha", _M_c_locale_ctype);
-+      break;
-+      case digit:
-+      __ret = __wctype_l("digit", _M_c_locale_ctype);
-+      break;
-+      case punct:
-+      __ret = __wctype_l("punct", _M_c_locale_ctype);
-+      break;
-+      case xdigit:
-+      __ret = __wctype_l("xdigit", _M_c_locale_ctype);
-+      break;
-+      case alnum:
-+      __ret = __wctype_l("alnum", _M_c_locale_ctype);
-+      break;
-+      case graph:
-+      __ret = __wctype_l("graph", _M_c_locale_ctype);
-+      break;
-+      default:
-+      __ret = 0;
-+      }
-+    return __ret;
-+  };
-+  
-+  wchar_t
-+  ctype<wchar_t>::do_toupper(wchar_t __c) const
-+  { return __towupper_l(__c, _M_c_locale_ctype); }
-+
-+  const wchar_t*
-+  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
-+  {
-+    while (__lo < __hi)
-+      {
-+        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
-+        ++__lo;
-+      }
-+    return __hi;
-+  }
-+  
-+  wchar_t
-+  ctype<wchar_t>::do_tolower(wchar_t __c) const
-+  { return __towlower_l(__c, _M_c_locale_ctype); }
-+  
-+  const wchar_t*
-+  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
-+  {
-+    while (__lo < __hi)
-+      {
-+        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
-+        ++__lo;
-+      }
-+    return __hi;
-+  }
-+
-+  bool
-+  ctype<wchar_t>::
-+  do_is(mask __m, wchar_t __c) const
-+  { 
-+    // Highest bitmask in ctype_base == 10, but extra in "C"
-+    // library for blank.
-+    bool __ret = false;
-+    const size_t __bitmasksize = 11; 
-+    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
-+      {
-+      const mask __bit = static_cast<mask>(_ISbit(__bitcur));
-+      if (__m & __bit)
-+        __ret |= __iswctype_l(__c, _M_convert_to_wmask(__bit), 
-+                              _M_c_locale_ctype); 
-+      }
-+    return __ret;    
-+  }
-+  
-+  const wchar_t* 
-+  ctype<wchar_t>::
-+  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
-+  {
-+    for (;__lo < __hi; ++__vec, ++__lo)
-+      {
-+      // Highest bitmask in ctype_base == 10, but extra in "C"
-+      // library for blank.
-+      const size_t __bitmasksize = 11; 
-+      mask __m = 0;
-+      for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
-+        { 
-+          const mask __bit = static_cast<mask>(_ISbit(__bitcur));
-+          if (__iswctype_l(*__lo, _M_convert_to_wmask(__bit), 
-+                           _M_c_locale_ctype))
-+            __m |= __bit;
-+        }
-+      *__vec = __m;
-+      }
-+    return __hi;
-+  }
-+  
-+  const wchar_t* 
-+  ctype<wchar_t>::
-+  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
-+  {
-+    while (__lo < __hi && !this->do_is(__m, *__lo))
-+      ++__lo;
-+    return __lo;
-+  }
-+
-+  const wchar_t*
-+  ctype<wchar_t>::
-+  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
-+  {
-+    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
-+      ++__lo;
-+    return __lo;
-+  }
-+
-+  wchar_t
-+  ctype<wchar_t>::
-+  do_widen(char __c) const
-+  {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_ctype);
-+#endif
-+    wchar_t __ret = btowc(__c);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+    return __ret;
-+  }
-+
-+  const char* 
-+  ctype<wchar_t>::
-+  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
-+  {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_ctype);
-+#endif
-+    mbstate_t __state;
-+    memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
-+    mbsrtowcs(__dest, &__lo, __hi - __lo, &__state);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+    return __hi;
-+  }
-+
-+  char
-+  ctype<wchar_t>::
-+  do_narrow(wchar_t __wc, char __dfault) const
-+  { 
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_ctype);
-+#endif
-+    int __c = wctob(__wc);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
-+  }
-+
-+  const wchar_t*
-+  ctype<wchar_t>::
-+  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
-+          char* __dest) const
-+  {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_ctype);
-+#endif
-+    size_t __offset = 0;
-+    while (true)
-+      {
-+      const wchar_t* __start = __lo + __offset;        
-+      size_t __len = __hi - __start;
-+      
-+      mbstate_t __state;
-+      memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
-+      size_t __con = wcsrtombs(__dest + __offset, &__start, __len, &__state);
-+      if (__con != __len && __start != 0)
-+        {
-+          __offset = __start - __lo;          
-+          __dest[__offset++] = __dfault;
-+        }
-+      else
-+        break;
-+      }
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+    return __hi;
-+  }
-+#endif //  _GLIBCPP_USE_WCHAR_T
-+}
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.cc    1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.cc     2004-01-09 08:46:16.000000000 -0600
-@@ -0,0 +1,100 @@
-+// std::messages implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix gettext stuff
-+#endif
-+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
-+extern "C" char *__dcgettext(const char *domainname,
-+                           const char *msgid, int category);
-+#undef gettext
-+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
-+#else
-+#undef gettext
-+#define gettext(msgid) (msgid)
-+#endif
-+
-+namespace std
-+{
-+  // Specializations.
-+  template<>
-+    string
-+    messages<char>::do_get(catalog, int, int, const string& __dfault) const
-+    {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+      __c_locale __old = __uselocale(_M_c_locale_messages);
-+      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
-+      __uselocale(__old);
-+      return string(__msg);
-+#elif defined __UCLIBC_HAS_LOCALE__
-+      char* __old = strdup(setlocale(LC_ALL, NULL));
-+      setlocale(LC_ALL, _M_name_messages);
-+      const char* __msg = gettext(__dfault.c_str());
-+      setlocale(LC_ALL, __old);
-+      free(__old);
-+      return string(__msg);
-+#else
-+      const char* __msg = gettext(__dfault.c_str());
-+      return string(__msg);
-+#endif
-+    }
-+
-+#ifdef _GLIBCPP_USE_WCHAR_T
-+  template<>
-+    wstring
-+    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
-+    {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+      __c_locale __old = __uselocale(_M_c_locale_messages);
-+      char* __msg = gettext(_M_convert_to_char(__dfault));
-+      __uselocale(__old);
-+      return _M_convert_from_char(__msg);
-+#elif defined __UCLIBC_HAS_LOCALE__
-+      char* __old = strdup(setlocale(LC_ALL, NULL));
-+      setlocale(LC_ALL, _M_name_messages);
-+      char* __msg = gettext(_M_convert_to_char(__dfault));
-+      setlocale(LC_ALL, __old);
-+      free(__old);
-+      return _M_convert_from_char(__msg);
-+# else
-+      char* __msg = gettext(_M_convert_to_char(__dfault));
-+      return _M_convert_from_char(__msg);
-+# endif
-+    }
-+#endif
-+}
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.h
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.h     1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.h      2004-01-09 08:52:48.000000000 -0600
-@@ -0,0 +1,122 @@
-+// std::messages implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.7.1.2  messages functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix prototypes for *textdomain funcs
-+#endif
-+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
-+extern "C" char *__textdomain(const char *domainname);
-+extern "C" char *__bindtextdomain(const char *domainname,
-+                                const char *dirname);
-+#else
-+#undef __textdomain
-+#undef __bindtextdomain
-+#define __textdomain(D)           ((void)0)
-+#define __bindtextdomain(D,P)     ((void)0)
-+#endif
-+
-+  // Non-virtual member functions.
-+  template<typename _CharT>
-+     messages<_CharT>::messages(size_t __refs)
-+     : locale::facet(__refs)
-+     {  
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+       _M_name_messages = _S_c_name;
-+#endif
-+       _M_c_locale_messages = _S_c_locale; 
-+     }
-+
-+  template<typename _CharT>
-+     messages<_CharT>::messages(__c_locale __cloc, 
-+                              const char* __s, size_t __refs) 
-+     : locale::facet(__refs)
-+     {
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+       _M_name_messages = new char[strlen(__s) + 1];
-+       strcpy(_M_name_messages, __s);
-+#endif
-+       _M_c_locale_messages = _S_clone_c_locale(__cloc); 
-+     }
-+
-+  template<typename _CharT>
-+    typename messages<_CharT>::catalog 
-+    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
-+                         const char* __dir) const
-+    { 
-+      __bindtextdomain(__s.c_str(), __dir);
-+      return this->do_open(__s, __loc); 
-+    }
-+
-+  // Virtual member functions.
-+  template<typename _CharT>
-+    messages<_CharT>::~messages()
-+    { 
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+      if (_S_c_name != _M_name_messages)
-+      delete [] _M_name_messages;
-+#endif
-+      _S_destroy_c_locale(_M_c_locale_messages); 
-+    }
-+
-+  template<typename _CharT>
-+    typename messages<_CharT>::catalog 
-+    messages<_CharT>::do_open(const basic_string<char>& __s, 
-+                            const locale&) const
-+    { 
-+      // No error checking is done, assume the catalog exists and can
-+      // be used.
-+      __textdomain(__s.c_str());
-+      return 0;
-+    }
-+
-+  template<typename _CharT>
-+    void    
-+    messages<_CharT>::do_close(catalog) const 
-+    { }
-+
-+   // messages_byname
-+   template<typename _CharT>
-+     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
-+     : messages<_CharT>(__refs) 
-+     { 
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+       if (_S_c_name != _M_name_messages)
-+       delete [] _M_name_messages;
-+       _M_name_messages = new char[strlen(__s) + 1];
-+       strcpy(_M_name_messages, __s);
-+#endif
-+       _S_destroy_c_locale(_M_c_locale_messages);
-+       _S_create_c_locale(_M_c_locale_messages, __s); 
-+     }
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/monetary_members.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc    1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/monetary_members.cc     2004-01-09 18:20:23.000000000 -0600
-@@ -0,0 +1,578 @@
-+// std::moneypunct implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#define _LIBC
-+#include <locale>
-+#undef _LIBC
-+#include <bits/c++locale_internal.h>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning optimize this for uclibc
-+#warning tailor for stub locale support
-+#endif
-+
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
-+#endif
-+
-+namespace std
-+{
-+  // Construct and return valid pattern consisting of some combination of:
-+  // space none symbol sign value
-+  money_base::pattern
-+  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
-+  { 
-+    pattern __ret;
-+
-+    // This insanely complicated routine attempts to construct a valid
-+    // pattern for use with monyepunct. A couple of invariants:
-+
-+    // if (__precedes) symbol -> value
-+    // else value -> symbol
-+    
-+    // if (__space) space
-+    // else none
-+
-+    // none == never first
-+    // space never first or last
-+
-+    // Any elegant implementations of this are welcome.
-+    switch (__posn)
-+      {
-+      case 0:
-+      case 1:
-+      // 1 The sign precedes the value and symbol.
-+      if (__space)
-+        {
-+          // Pattern starts with sign.
-+          if (__precedes)
-+            {
-+              __ret.field[1] = symbol;
-+              __ret.field[2] = space;
-+              __ret.field[3] = value;
-+            }
-+          else
-+            {
-+              __ret.field[1] = value;
-+              __ret.field[2] = space;
-+              __ret.field[3] = symbol;
-+            }
-+          __ret.field[0] = sign;
-+        }
-+      else
-+        {
-+          // Pattern starts with sign and ends with none.
-+          if (__precedes)
-+            {
-+              __ret.field[1] = symbol;
-+              __ret.field[2] = value;
-+            }
-+          else
-+            {
-+              __ret.field[1] = value;
-+              __ret.field[2] = symbol;
-+            }
-+          __ret.field[0] = sign;
-+          __ret.field[3] = none;
-+        }
-+      break;
-+      case 2:
-+      // 2 The sign follows the value and symbol.
-+      if (__space)
-+        {
-+          // Pattern either ends with sign.
-+          if (__precedes)
-+            {
-+              __ret.field[0] = symbol;
-+              __ret.field[1] = space;
-+              __ret.field[2] = value;
-+            }
-+          else
-+            {
-+              __ret.field[0] = value;
-+              __ret.field[1] = space;
-+              __ret.field[2] = symbol;
-+            }
-+          __ret.field[3] = sign;
-+        }
-+      else
-+        {
-+          // Pattern ends with sign then none.
-+          if (__precedes)
-+            {
-+              __ret.field[0] = symbol;
-+              __ret.field[1] = value;
-+            }
-+          else
-+            {
-+              __ret.field[0] = value;
-+              __ret.field[1] = symbol;
-+            }
-+          __ret.field[2] = sign;
-+          __ret.field[3] = none;
-+        }
-+      break;
-+      case 3:
-+      // 3 The sign immediately precedes the symbol.
-+      if (__space)
-+        {
-+          // Have space.
-+          if (__precedes)
-+            {
-+              __ret.field[0] = sign;
-+              __ret.field[1] = symbol;
-+              __ret.field[2] = space;
-+              __ret.field[3] = value;
-+            }
-+          else
-+            {
-+              __ret.field[0] = value;
-+              __ret.field[1] = space;
-+              __ret.field[2] = sign;
-+              __ret.field[3] = symbol;
-+            }
-+        }
-+      else
-+        {
-+          // Have none.
-+          if (__precedes)
-+            {
-+              __ret.field[0] = sign;
-+              __ret.field[1] = symbol;
-+              __ret.field[2] = value;
-+            }
-+          else
-+            {
-+              __ret.field[0] = value;
-+              __ret.field[1] = sign;
-+              __ret.field[2] = symbol;
-+            }
-+          __ret.field[3] = none;
-+        }
-+      break;
-+      case 4:
-+      // 4 The sign immediately follows the symbol. 
-+      if (__space)
-+        {
-+          // Have space.
-+          if (__precedes)
-+            {
-+              __ret.field[0] = symbol;
-+              __ret.field[1] = sign;
-+              __ret.field[2] = space;
-+              __ret.field[3] = value;
-+            }
-+          else
-+            {
-+              __ret.field[0] = value;
-+              __ret.field[1] = space;
-+              __ret.field[2] = symbol;
-+              __ret.field[3] = sign;
-+            }
-+        }
-+      else
-+        {
-+          // Have none.
-+          if (__precedes)
-+            {
-+              __ret.field[0] = symbol;
-+              __ret.field[1] = sign;
-+              __ret.field[2] = value;
-+            }
-+          else
-+            {
-+              __ret.field[0] = value;
-+              __ret.field[1] = symbol;
-+              __ret.field[2] = sign;
-+            }
-+          __ret.field[3] = none;
-+        }
-+      break;
-+      default:
-+      ;
-+      }
-+    return __ret;
-+  }
-+
-+  template<> 
-+    void
-+    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
-+                                                   const char*)
-+    {
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_decimal_point = '.';
-+        _M_thousands_sep = ',';
-+        _M_grouping = "";
-+        _M_curr_symbol = "";
-+        _M_positive_sign = "";
-+        _M_negative_sign = "";
-+        _M_frac_digits = 0;
-+        _M_pos_format = money_base::_S_default_pattern;
-+        _M_neg_format = money_base::_S_default_pattern;
-+      }
-+      else
-+      {
-+        // Named locale.
-+        _M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, __cloc));
-+        _M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, __cloc));
-+        _M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
-+        _M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
-+
-+        char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
-+        if (!__nposn)
-+          _M_negative_sign = "()";
-+        else
-+          _M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
-+
-+        // _Intl == true
-+        _M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
-+        _M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, __cloc));
-+        char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
-+        char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
-+        char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
-+        _M_pos_format = _S_construct_pattern(__pprecedes, __pspace, __pposn);
-+        char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
-+        char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
-+        _M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
-+      }
-+    }
-+
-+  template<> 
-+    void
-+    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
-+                                                    const char*)
-+    {
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_decimal_point = '.';
-+        _M_thousands_sep = ',';
-+        _M_grouping = "";
-+        _M_curr_symbol = "";
-+        _M_positive_sign = "";
-+        _M_negative_sign = "";
-+        _M_frac_digits = 0;
-+        _M_pos_format = money_base::_S_default_pattern;
-+        _M_neg_format = money_base::_S_default_pattern;
-+      }
-+      else
-+      {
-+        // Named locale.
-+        _M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, __cloc));
-+        _M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, __cloc));
-+        _M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
-+        _M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
-+
-+        char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
-+        if (!__nposn)
-+          _M_negative_sign = "()";
-+        else
-+          _M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
-+
-+        // _Intl == false
-+        _M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
-+        _M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
-+        char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
-+        char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
-+        char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
-+        _M_pos_format = _S_construct_pattern(__pprecedes, __pspace, __pposn);
-+        char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
-+        char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
-+        _M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
-+      }
-+    }
-+
-+  template<> 
-+    moneypunct<char, true>::~moneypunct()
-+    { }
-+
-+  template<> 
-+    moneypunct<char, false>::~moneypunct()
-+    { }
-+
-+#ifdef _GLIBCPP_USE_WCHAR_T
-+  template<> 
-+    void
-+    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+                                                      const char*)
-+#else
-+                                                      const char* __name)
-+#endif
-+    {
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_decimal_point = L'.';
-+        _M_thousands_sep = L',';
-+        _M_grouping = "";
-+        _M_curr_symbol = L"";
-+        _M_positive_sign = L"";
-+        _M_negative_sign = L"";
-+        _M_frac_digits = 0;
-+        _M_pos_format = money_base::_S_default_pattern;
-+        _M_neg_format = money_base::_S_default_pattern;
-+      }
-+      else
-+      {
-+        // Named locale.
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+        __c_locale __old = __uselocale(__cloc);
-+#else
-+        // Switch to named locale so that mbsrtowcs will work.
-+        char* __old = strdup(setlocale(LC_ALL, NULL));
-+        setlocale(LC_ALL, __name);
-+#endif
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix this
-+#endif
-+#ifdef __UCLIBC__
-+# ifdef __UCLIBC_HAS_XLOCALE__
-+        _M_decimal_point = __cloc->decimal_point_wc;
-+        _M_thousands_sep = __cloc->thousands_sep_wc;
-+# else
-+        _M_decimal_point = __global_locale->decimal_point_wc;
-+        _M_thousands_sep = __global_locale->thousands_sep_wc;
-+# endif
-+#else
-+        _M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
-+
-+        _M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
-+#endif
-+        _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
-+
-+        const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
-+        const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
-+        const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
-+
-+        mbstate_t __state;
-+        size_t __len = strlen(__cpossign);
-+        if (__len)
-+          {
-+            ++__len;
-+            memset(&__state, 0, sizeof(mbstate_t));
-+            wchar_t* __wcs = new wchar_t[__len];
-+            mbsrtowcs(__wcs, &__cpossign, __len, &__state);
-+            _M_positive_sign = __wcs;
-+          }
-+        else
-+          _M_positive_sign = L"";
-+
-+        char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
-+        __len = strlen(__cnegsign);
-+        if (!__nposn)
-+          _M_negative_sign = L"()";
-+        else if (__len)
-+          { 
-+            ++__len;
-+            memset(&__state, 0, sizeof(mbstate_t));
-+            wchar_t* __wcs = new wchar_t[__len];
-+            mbsrtowcs(__wcs, &__cnegsign, __len, &__state);
-+            _M_negative_sign = __wcs;
-+          }
-+        else
-+          _M_negative_sign = L"";
-+
-+        // _Intl == true.
-+        __len = strlen(__ccurr);
-+        if (__len)
-+          {
-+            ++__len;
-+            memset(&__state, 0, sizeof(mbstate_t));
-+            wchar_t* __wcs = new wchar_t[__len];
-+            mbsrtowcs(__wcs, &__ccurr, __len, &__state);
-+            _M_curr_symbol = __wcs;
-+          }
-+        else
-+          _M_curr_symbol = L"";
-+
-+        _M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, __cloc));
-+        char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
-+        char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
-+        char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
-+        _M_pos_format = _S_construct_pattern(__pprecedes, __pspace, __pposn);
-+        char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
-+        char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
-+        _M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+        __uselocale(__old);
-+#else
-+        setlocale(LC_ALL, __old);
-+        free(__old);
-+#endif
-+      }
-+    }
-+
-+  template<> 
-+    void
-+    moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+                                                       const char*)
-+#else
-+                                                       const char* __name)
-+#endif
-+    {
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_decimal_point = L'.';
-+        _M_thousands_sep = L',';
-+        _M_grouping = "";
-+        _M_curr_symbol = L"";
-+        _M_positive_sign = L"";
-+        _M_negative_sign = L"";
-+        _M_frac_digits = 0;
-+        _M_pos_format = money_base::_S_default_pattern;
-+        _M_neg_format = money_base::_S_default_pattern;
-+      }
-+      else
-+      {
-+        // Named locale.
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+        __c_locale __old = __uselocale(__cloc);
-+#else
-+        // Switch to named locale so that mbsrtowcs will work.
-+        char* __old = strdup(setlocale(LC_ALL, NULL));
-+        setlocale(LC_ALL, __name);
-+#endif
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix this
-+#endif
-+#ifdef __UCLIBC__
-+# ifdef __UCLIBC_HAS_XLOCALE__
-+        _M_decimal_point = __cloc->decimal_point_wc;
-+        _M_thousands_sep = __cloc->thousands_sep_wc;
-+# else
-+        _M_decimal_point = __global_locale->decimal_point_wc;
-+        _M_thousands_sep = __global_locale->thousands_sep_wc;
-+# endif
-+#else
-+        _M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
-+        _M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
-+#endif
-+        _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
-+
-+        const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
-+        const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
-+        const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
-+
-+        mbstate_t __state;
-+        size_t __len;
-+        __len = strlen(__cpossign);
-+        if (__len)
-+          {
-+            ++__len;
-+            memset(&__state, 0, sizeof(mbstate_t));
-+            wchar_t* __wcs = new wchar_t[__len];
-+            mbsrtowcs(__wcs, &__cpossign, __len, &__state);
-+            _M_positive_sign = __wcs;
-+          }
-+        else
-+          _M_positive_sign = L"";
-+
-+        char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
-+        __len = strlen(__cnegsign);
-+        if (!__nposn)
-+          _M_negative_sign = L"()";
-+        else if (__len)
-+          { 
-+            ++__len;
-+            memset(&__state, 0, sizeof(mbstate_t));
-+            wchar_t* __wcs = new wchar_t[__len];
-+            mbsrtowcs(__wcs, &__cnegsign, __len, &__state);
-+            _M_negative_sign = __wcs;
-+          }
-+        else
-+          _M_negative_sign = L"";
-+
-+        // _Intl == true.
-+        __len = strlen(__ccurr);
-+        if (__len)
-+          {
-+            ++__len;
-+            memset(&__state, 0, sizeof(mbstate_t));
-+            wchar_t* __wcs = new wchar_t[__len];
-+            mbsrtowcs(__wcs, &__ccurr, __len, &__state);
-+            _M_curr_symbol = __wcs;
-+          }
-+        else
-+          _M_curr_symbol = L"";
-+
-+        _M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
-+        char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
-+        char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
-+        char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
-+        _M_pos_format = _S_construct_pattern(__pprecedes, __pspace, __pposn);
-+        char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
-+        char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
-+        _M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+        __uselocale(__old);
-+#else
-+        setlocale(LC_ALL, __old);
-+        free(__old);
-+#endif
-+      }
-+    }
-+
-+  template<> 
-+    moneypunct<wchar_t, true>::~moneypunct()
-+    {
-+      if (wcslen(_M_positive_sign))
-+      delete [] _M_positive_sign;
-+      if (wcslen(_M_negative_sign) && (wcscmp(_M_negative_sign, L"()") != 0))
-+      delete [] _M_negative_sign;
-+      if (wcslen(_M_curr_symbol))
-+      delete [] _M_curr_symbol;
-+    }
-+
-+  template<> 
-+    moneypunct<wchar_t, false>::~moneypunct()
-+    {
-+      if (wcslen(_M_positive_sign))
-+      delete [] _M_positive_sign;
-+      if (wcslen(_M_negative_sign) && (wcscmp(_M_negative_sign, L"()") != 0))
-+      delete [] _M_negative_sign;
-+      if (wcslen(_M_curr_symbol))
-+      delete [] _M_curr_symbol;
-+    }
-+#endif
-+}
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/numeric_members.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc     1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/numeric_members.cc      2004-01-09 18:20:59.000000000 -0600
-@@ -0,0 +1,129 @@
-+// std::numpunct implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#define _LIBC
-+#include <locale>
-+#undef _LIBC
-+#include <bits/c++locale_internal.h>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning tailor for stub locale support
-+#endif
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
-+#endif
-+
-+namespace std
-+{
-+  template<> 
-+    void
-+    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
-+    {
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_decimal_point = '.';
-+        _M_thousands_sep = ',';
-+        _M_grouping = "";
-+      }
-+      else
-+      {
-+        // Named locale.
-+        _M_decimal_point = *(__nl_langinfo_l(RADIXCHAR, __cloc));
-+        _M_thousands_sep = *(__nl_langinfo_l(THOUSEP, __cloc));
-+        // Check for NUL, which implies no grouping.
-+        if (_M_thousands_sep == '\0')
-+          _M_grouping = "";
-+        else
-+          _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
-+      }
-+      // NB: There is no way to extact this info from posix locales.
-+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
-+      _M_truename = "true";
-+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
-+      _M_falsename = "false";
-+    }
-+ 
-+  template<> 
-+    numpunct<char>::~numpunct()
-+    { }
-+   
-+#ifdef _GLIBCPP_USE_WCHAR_T
-+  template<> 
-+    void
-+    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
-+    {
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_decimal_point = L'.';
-+        _M_thousands_sep = L',';
-+        _M_grouping = "";
-+      }
-+      else
-+      {
-+        // Named locale.
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix this
-+#endif
-+#ifdef __UCLIBC__
-+# ifdef __UCLIBC_HAS_XLOCALE__
-+        _M_decimal_point = __cloc->decimal_point_wc;
-+        _M_thousands_sep = __cloc->thousands_sep_wc;
-+# else
-+        _M_decimal_point = __global_locale->decimal_point_wc;
-+        _M_thousands_sep = __global_locale->thousands_sep_wc;
-+# endif
-+#else
-+        _M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
-+        _M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
-+#endif
-+        if (_M_thousands_sep == L'\0')
-+          _M_grouping = "";
-+        else
-+          _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
-+      }
-+      // NB: There is no way to extact this info from posix locales.
-+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
-+      _M_truename = L"true";
-+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
-+      _M_falsename = L"false";
-+    }
-+
-+  template<> 
-+    numpunct<wchar_t>::~numpunct()
-+    { }
-+ #endif
-+}
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.cc
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.cc        1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.cc 2004-01-09 08:25:03.000000000 -0600
-@@ -0,0 +1,341 @@
-+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
-+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning tailor for stub locale support
-+#endif
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
-+#endif
-+
-+namespace std
-+{
-+  template<>
-+    void
-+    __timepunct<char>::
-+    _M_put(char* __s, size_t __maxlen, const char* __format, 
-+         const tm* __tm) const
-+    {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+      __strftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
-+#else
-+      char* __old = strdup(setlocale(LC_ALL, NULL));
-+      setlocale(LC_ALL, _M_name_timepunct);
-+      strftime(__s, __maxlen, __format, __tm);
-+      setlocale(LC_ALL, __old);
-+      free(__old);
-+#endif
-+    }
-+
-+  template<> 
-+    void
-+    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
-+    {
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_c_locale_timepunct = _S_c_locale;
-+
-+        _M_date_format = "%m/%d/%y";
-+        _M_date_era_format = "%m/%d/%y";
-+        _M_time_format = "%H:%M:%S";
-+        _M_time_era_format = "%H:%M:%S";
-+        _M_date_time_format = "";
-+        _M_date_time_era_format = "";
-+        _M_am = "AM";
-+        _M_pm = "PM";
-+        _M_am_pm_format = "";
-+
-+        // Day names, starting with "C"'s Sunday.
-+        _M_day1 = "Sunday";
-+        _M_day2 = "Monday";
-+        _M_day3 = "Tuesday";
-+        _M_day4 = "Wednesday";
-+        _M_day5 = "Thursday";
-+        _M_day6 = "Friday";
-+        _M_day7 = "Saturday";
-+
-+        // Abbreviated day names, starting with "C"'s Sun.
-+        _M_day_a1 = "Sun";
-+        _M_day_a2 = "Mon";
-+        _M_day_a3 = "Tue";
-+        _M_day_a4 = "Wed";
-+        _M_day_a5 = "Thu";
-+        _M_day_a6 = "Fri";
-+        _M_day_a7 = "Sat";
-+
-+        // Month names, starting with "C"'s January.
-+        _M_month01 = "January";
-+        _M_month02 = "February";
-+        _M_month03 = "March";
-+        _M_month04 = "April";
-+        _M_month05 = "May";
-+        _M_month06 = "June";
-+        _M_month07 = "July";
-+        _M_month08 = "August";
-+        _M_month09 = "September";
-+        _M_month10 = "October";
-+        _M_month11 = "November";
-+        _M_month12 = "December";
-+
-+        // Abbreviated month names, starting with "C"'s Jan.
-+        _M_month_a01 = "Jan";
-+        _M_month_a02 = "Feb";
-+        _M_month_a03 = "Mar";
-+        _M_month_a04 = "Apr";
-+        _M_month_a05 = "May";
-+        _M_month_a06 = "Jun";
-+        _M_month_a07 = "July";
-+        _M_month_a08 = "Aug";
-+        _M_month_a09 = "Sep";
-+        _M_month_a10 = "Oct";
-+        _M_month_a11 = "Nov";
-+        _M_month_a12 = "Dec";
-+      }
-+      else
-+      {
-+        _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
-+
-+        _M_date_format = __nl_langinfo_l(D_FMT, __cloc);
-+        _M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
-+        _M_time_format = __nl_langinfo_l(T_FMT, __cloc);
-+        _M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
-+        _M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
-+        _M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, __cloc);
-+        _M_am = __nl_langinfo_l(AM_STR, __cloc);
-+        _M_pm = __nl_langinfo_l(PM_STR, __cloc);
-+        _M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
-+
-+        // Day names, starting with "C"'s Sunday.
-+        _M_day1 = __nl_langinfo_l(DAY_1, __cloc);
-+        _M_day2 = __nl_langinfo_l(DAY_2, __cloc);
-+        _M_day3 = __nl_langinfo_l(DAY_3, __cloc);
-+        _M_day4 = __nl_langinfo_l(DAY_4, __cloc);
-+        _M_day5 = __nl_langinfo_l(DAY_5, __cloc);
-+        _M_day6 = __nl_langinfo_l(DAY_6, __cloc);
-+        _M_day7 = __nl_langinfo_l(DAY_7, __cloc);
-+
-+        // Abbreviated day names, starting with "C"'s Sun.
-+        _M_day_a1 = __nl_langinfo_l(ABDAY_1, __cloc);
-+        _M_day_a2 = __nl_langinfo_l(ABDAY_2, __cloc);
-+        _M_day_a3 = __nl_langinfo_l(ABDAY_3, __cloc);
-+        _M_day_a4 = __nl_langinfo_l(ABDAY_4, __cloc);
-+        _M_day_a5 = __nl_langinfo_l(ABDAY_5, __cloc);
-+        _M_day_a6 = __nl_langinfo_l(ABDAY_6, __cloc);
-+        _M_day_a7 = __nl_langinfo_l(ABDAY_7, __cloc);
-+
-+        // Month names, starting with "C"'s January.
-+        _M_month01 = __nl_langinfo_l(MON_1, __cloc);
-+        _M_month02 = __nl_langinfo_l(MON_2, __cloc);
-+        _M_month03 = __nl_langinfo_l(MON_3, __cloc);
-+        _M_month04 = __nl_langinfo_l(MON_4, __cloc);
-+        _M_month05 = __nl_langinfo_l(MON_5, __cloc);
-+        _M_month06 = __nl_langinfo_l(MON_6, __cloc);
-+        _M_month07 = __nl_langinfo_l(MON_7, __cloc);
-+        _M_month08 = __nl_langinfo_l(MON_8, __cloc);
-+        _M_month09 = __nl_langinfo_l(MON_9, __cloc);
-+        _M_month10 = __nl_langinfo_l(MON_10, __cloc);
-+        _M_month11 = __nl_langinfo_l(MON_11, __cloc);
-+        _M_month12 = __nl_langinfo_l(MON_12, __cloc);
-+
-+        // Abbreviated month names, starting with "C"'s Jan.
-+        _M_month_a01 = __nl_langinfo_l(ABMON_1, __cloc);
-+        _M_month_a02 = __nl_langinfo_l(ABMON_2, __cloc);
-+        _M_month_a03 = __nl_langinfo_l(ABMON_3, __cloc);
-+        _M_month_a04 = __nl_langinfo_l(ABMON_4, __cloc);
-+        _M_month_a05 = __nl_langinfo_l(ABMON_5, __cloc);
-+        _M_month_a06 = __nl_langinfo_l(ABMON_6, __cloc);
-+        _M_month_a07 = __nl_langinfo_l(ABMON_7, __cloc);
-+        _M_month_a08 = __nl_langinfo_l(ABMON_8, __cloc);
-+        _M_month_a09 = __nl_langinfo_l(ABMON_9, __cloc);
-+        _M_month_a10 = __nl_langinfo_l(ABMON_10, __cloc);
-+        _M_month_a11 = __nl_langinfo_l(ABMON_11, __cloc);
-+        _M_month_a12 = __nl_langinfo_l(ABMON_12, __cloc);
-+      }
-+    }
-+
-+#ifdef _GLIBCPP_USE_WCHAR_T
-+  template<>
-+    void
-+    __timepunct<wchar_t>::
-+    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
-+         const tm* __tm) const
-+    {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
-+#else
-+      char* __old = strdup(setlocale(LC_ALL, NULL));
-+      setlocale(LC_ALL, _M_name_timepunct);
-+      wcsftime(__s, __maxlen, __format, __tm);
-+      setlocale(LC_ALL, __old);
-+      free(__old);
-+#endif
-+    }
-+
-+  template<> 
-+    void
-+    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
-+    {
-+#warning wide time stuff
-+//       if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_c_locale_timepunct = _S_c_locale;
-+
-+        _M_date_format = L"%m/%d/%y";
-+        _M_date_era_format = L"%m/%d/%y";
-+        _M_time_format = L"%H:%M:%S";
-+        _M_time_era_format = L"%H:%M:%S";
-+        _M_date_time_format = L"";
-+        _M_date_time_era_format = L"";
-+        _M_am = L"AM";
-+        _M_pm = L"PM";
-+        _M_am_pm_format = L"";
-+
-+        // Day names, starting with "C"'s Sunday.
-+        _M_day1 = L"Sunday";
-+        _M_day2 = L"Monday";
-+        _M_day3 = L"Tuesday";
-+        _M_day4 = L"Wednesday";
-+        _M_day5 = L"Thursday";
-+        _M_day6 = L"Friday";
-+        _M_day7 = L"Saturday";
-+
-+        // Abbreviated day names, starting with "C"'s Sun.
-+        _M_day_a1 = L"Sun";
-+        _M_day_a2 = L"Mon";
-+        _M_day_a3 = L"Tue";
-+        _M_day_a4 = L"Wed";
-+        _M_day_a5 = L"Thu";
-+        _M_day_a6 = L"Fri";
-+        _M_day_a7 = L"Sat";
-+
-+        // Month names, starting with "C"'s January.
-+        _M_month01 = L"January";
-+        _M_month02 = L"February";
-+        _M_month03 = L"March";
-+        _M_month04 = L"April";
-+        _M_month05 = L"May";
-+        _M_month06 = L"June";
-+        _M_month07 = L"July";
-+        _M_month08 = L"August";
-+        _M_month09 = L"September";
-+        _M_month10 = L"October";
-+        _M_month11 = L"November";
-+        _M_month12 = L"December";
-+
-+        // Abbreviated month names, starting with "C"'s Jan.
-+        _M_month_a01 = L"Jan";
-+        _M_month_a02 = L"Feb";
-+        _M_month_a03 = L"Mar";
-+        _M_month_a04 = L"Apr";
-+        _M_month_a05 = L"May";
-+        _M_month_a06 = L"Jun";
-+        _M_month_a07 = L"July";
-+        _M_month_a08 = L"Aug";
-+        _M_month_a09 = L"Sep";
-+        _M_month_a10 = L"Oct";
-+        _M_month_a11 = L"Nov";
-+        _M_month_a12 = L"Dec";
-+      }
-+#if 0
-+      else
-+      {
-+        _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
-+
-+        _M_date_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_FMT, __cloc));
-+        _M_date_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_FMT, __cloc));
-+        _M_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT, __cloc));
-+        _M_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_T_FMT, __cloc));
-+        _M_date_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_T_FMT, __cloc));
-+        _M_date_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc));
-+        _M_am = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WAM_STR, __cloc));
-+        _M_pm = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WPM_STR, __cloc));
-+        _M_am_pm_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc));
-+
-+        // Day names, starting with "C"'s Sunday.
-+        _M_day1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_1, __cloc));
-+        _M_day2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_2, __cloc));
-+        _M_day3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_3, __cloc));
-+        _M_day4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_4, __cloc));
-+        _M_day5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_5, __cloc));
-+        _M_day6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_6, __cloc));
-+        _M_day7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_7, __cloc));
-+
-+        // Abbreviated day names, starting with "C"'s Sun.
-+        _M_day_a1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_1, __cloc));
-+        _M_day_a2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_2, __cloc));
-+        _M_day_a3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_3, __cloc));
-+        _M_day_a4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_4, __cloc));
-+        _M_day_a5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_5, __cloc));
-+        _M_day_a6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_6, __cloc));
-+        _M_day_a7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_7, __cloc));
-+
-+        // Month names, starting with "C"'s January.
-+        _M_month01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_1, __cloc));
-+        _M_month02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_2, __cloc));
-+        _M_month03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_3, __cloc));
-+        _M_month04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_4, __cloc));
-+        _M_month05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_5, __cloc));
-+        _M_month06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_6, __cloc));
-+        _M_month07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_7, __cloc));
-+        _M_month08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_8, __cloc));
-+        _M_month09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_9, __cloc));
-+        _M_month10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_10, __cloc));
-+        _M_month11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_11, __cloc));
-+        _M_month12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_12, __cloc));
-+
-+        // Abbreviated month names, starting with "C"'s Jan.
-+        _M_month_a01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_1, __cloc));
-+        _M_month_a02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_2, __cloc));
-+        _M_month_a03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_3, __cloc));
-+        _M_month_a04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_4, __cloc));
-+        _M_month_a05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_5, __cloc));
-+        _M_month_a06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_6, __cloc));
-+        _M_month_a07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_7, __cloc));
-+        _M_month_a08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_8, __cloc));
-+        _M_month_a09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_9, __cloc));
-+        _M_month_a10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_10, __cloc));
-+        _M_month_a11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_11, __cloc));
-+        _M_month_a12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_12, __cloc));
-+      }
-+#endif // 0
-+    }
-+#endif
-+}
-diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.h
---- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.h 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.h  2004-01-09 04:26:21.000000000 -0600
-@@ -0,0 +1,68 @@
-+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
-+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+  template<typename _CharT>
-+    __timepunct<_CharT>::__timepunct(size_t __refs) 
-+    : locale::facet(__refs)
-+    { 
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+      _M_name_timepunct = _S_c_name;
-+#endif
-+      _M_initialize_timepunct(); 
-+    }
-+
-+  template<typename _CharT>
-+    __timepunct<_CharT>::__timepunct(__c_locale __cloc, 
-+                                   const char* __s,
-+                                   size_t __refs) 
-+    : locale::facet(__refs)
-+    { 
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+      _M_name_timepunct = new char[strlen(__s) + 1];
-+      strcpy(_M_name_timepunct, __s);
-+#endif
-+      _M_initialize_timepunct(__cloc); 
-+    }
-+
-+  template<typename _CharT>
-+    __timepunct<_CharT>::~__timepunct()
-+    { 
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+      if (_S_c_name != _M_name_timepunct)
-+      delete [] _M_name_timepunct;
-+#endif
-+      _S_destroy_c_locale(_M_c_locale_timepunct); 
-+    }
-diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_base.h
---- gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_base.h       1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_base.h        2004-01-09 02:54:54.000000000 -0600
-@@ -0,0 +1,57 @@
-+// Locale support -*- C++ -*-
-+
-+// Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.1  Locales
-+//
-+  
-+// Information as gleaned from /usr/include/ctype.h
-+  
-+  struct ctype_base
-+  {
-+    // Note: In uClibc, the following two types depend on configuration.
-+
-+    // Non-standard typedefs.
-+    typedef const __ctype_touplow_t* __to_type;
-+    // NB: Offsets into ctype<char>::_M_table force a particular size
-+    // on the mask type. Because of this, we don't use an enum.
-+    typedef __ctype_mask_t    mask;   
-+
-+    static const mask upper           = _ISupper;
-+    static const mask lower   = _ISlower;
-+    static const mask alpha   = _ISalpha;
-+    static const mask digit   = _ISdigit;
-+    static const mask xdigit  = _ISxdigit;
-+    static const mask space   = _ISspace;
-+    static const mask print   = _ISprint;
-+    static const mask graph   = _ISgraph;
-+    static const mask cntrl   = _IScntrl;
-+    static const mask punct   = _ISpunct;
-+    static const mask alnum   = _ISalnum;
-+  };
-diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_inline.h
---- gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_inline.h     1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_inline.h      2002-06-24 00:49:19.000000000 -0500
-@@ -0,0 +1,69 @@
-+// Locale support -*- C++ -*-
-+
-+// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.1  Locales
-+//
-+  
-+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
-+// functions go in ctype.cc
-+  
-+  bool
-+  ctype<char>::
-+  is(mask __m, char __c) const
-+  { return _M_table[static_cast<unsigned char>(__c)] & __m; }
-+
-+  const char*
-+  ctype<char>::
-+  is(const char* __low, const char* __high, mask* __vec) const
-+  {
-+    while (__low < __high)
-+      *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
-+    return __high;
-+  }
-+
-+  const char*
-+  ctype<char>::
-+  scan_is(mask __m, const char* __low, const char* __high) const
-+  {
-+    while (__low < __high 
-+         && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
-+      ++__low;
-+    return __low;
-+  }
-+
-+  const char*
-+  ctype<char>::
-+  scan_not(mask __m, const char* __low, const char* __high) const
-+  {
-+    while (__low < __high 
-+         && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
-+      ++__low;
-+    return __low;
-+  }
-diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_noninline.h
---- gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_noninline.h  1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_noninline.h   2004-01-09 03:34:53.000000000 -0600
-@@ -0,0 +1,90 @@
-+// Locale support -*- C++ -*-
-+
-+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
-+// Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.1  Locales
-+//
-+  
-+// Information as gleaned from /usr/include/ctype.h
-+
-+  const ctype_base::mask*
-+  ctype<char>::classic_table() throw()
-+  { 
-+    return __C_ctype_b;
-+  }
-+
-+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
-+                   size_t __refs) 
-+  : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
-+  {
-+    _M_toupper = __C_ctype_toupper;
-+    _M_tolower = __C_ctype_tolower;
-+    _M_table = __table ? __table : __C_ctype_b;
-+    _M_c_locale_ctype = _S_c_locale;
-+  }
-+
-+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) : 
-+  __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
-+  {
-+    _M_toupper = __C_ctype_toupper;
-+    _M_tolower = __C_ctype_tolower;
-+    _M_table = __table ? __table : __C_ctype_b;
-+    _M_c_locale_ctype = _S_c_locale; 
-+  }
-+
-+  char
-+  ctype<char>::do_toupper(char __c) const
-+  { return _M_toupper[static_cast<unsigned char>(__c)]; }
-+
-+  const char*
-+  ctype<char>::do_toupper(char* __low, const char* __high) const
-+  {
-+    while (__low < __high)
-+      {
-+      *__low = _M_toupper[static_cast<unsigned char>(*__low)];
-+      ++__low;
-+      }
-+    return __high;
-+  }
-+
-+  char
-+  ctype<char>::do_tolower(char __c) const
-+  { return _M_tolower[static_cast<unsigned char>(__c)]; }
-+
-+  const char* 
-+  ctype<char>::do_tolower(char* __low, const char* __high) const
-+  {
-+    while (__low < __high)
-+      {
-+      *__low = _M_tolower[static_cast<unsigned char>(*__low)];
-+      ++__low;
-+      }
-+    return __high;
-+  }
-diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/os_defines.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/os_defines.h
---- gcc-3.3.2/libstdc++-v3/config/os/uclibc/os_defines.h       1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/os_defines.h        2004-01-09 04:56:13.000000000 -0600
-@@ -0,0 +1,56 @@
-+// Specific definitions for GNU/Linux  -*- C++ -*-
-+
-+// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+#ifndef _GLIBCPP_OS_DEFINES
-+#define _GLIBCPP_OS_DEFINES 1
-+
-+// System-specific #define, typedefs, corrections, etc, go here.  This
-+// file will come before all others.
-+
-+// This keeps isanum, et al from being propagated as macros.
-+#define __NO_CTYPE 1
-+
-+#include <features.h>
-+
-+// These systems have declarations mismatching those in libio.h by
-+// omitting throw qualifiers.  Cleanest way out is to not provide
-+// throw-qualifiers at all.  Defining it as empty here will make libio.h
-+// not define it.
-+#undef __THROW
-+#define __THROW
-+
-+// Tell Glibc not to try to provide its own inline versions of
-+// some math functions.  Those cause assembly-time clashes with
-+// our definitions.
-+#define __NO_MATH_INLINES
-+
-+// We must not see the optimized string functions GNU libc defines.
-+#define __NO_STRING_INLINES
-+
-+#endif
diff --git a/openwrt/toolchain/gcc/3.3.5/500-loop.patch b/openwrt/toolchain/gcc/3.3.5/500-loop.patch
deleted file mode 100644 (file)
index 476f84b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- gcc/gcc/loop.c     14 Feb 2004 14:46:03 -0000      1.488.2.3
-+++ gcc/gcc/loop.c     28 Apr 2004 22:02:53 -0000
-@@ -929,6 +929,7 @@
-                         || (! (GET_CODE (SET_SRC (set)) == REG
-                                && (REGNO (SET_SRC (set))
-                                    < FIRST_PSEUDO_REGISTER))))
-+                    && regno >= FIRST_PSEUDO_REGISTER 
-                     /* This test is not redundant; SET_SRC (set) might be
-                        a call-clobbered register and the life of REGNO
-                        might span a call.  */
diff --git a/openwrt/toolchain/gcc/3.3.5/820-no-mips-empic-relocs.patch b/openwrt/toolchain/gcc/3.3.5/820-no-mips-empic-relocs.patch
deleted file mode 100644 (file)
index d5c4c9c..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-From: cgd at broadcom dot com
-To: gcc-patches at gcc dot gnu dot org
-Cc: mark at codesourcery dot com
-Date: 13 Jun 2004 22:51:30 -0700
-Subject: [trunk + 3.4-branch RFA] don't use empic relocs for mips-linuxeh
-
-This patch changes mips-linux to avoid using embedded-pic relocs for
-its eh data.  (Support for generating these for new code is removed in
-current binutils srcs.)
-
-Relating to this, previously, mips-linux and mips64-linux would use
-different representations for their EH data (even for mips64-linux o32
-abi), due to the mips64-linux n32/64 BFDs not supporting the
-embedded-pic relocs.  This was a bug.
-
-For more explanation, see the thread of the URL quoted in the comment
-in linux.h.
-
-
-Tested the same w/ sources of about a week ago for c/c++ for
-mips-linux (native) before/after.  Also verified .o compatibility
-before/after just to be sure.
-
-I'd like this approved for the branch as well, so 3.4.1 will work
-nicely w/ the next major binutils release.
-
-
-thanks,
-
-chris
-
-2004-06-13  Chris Demetriou  <cgd@broadcom.com>
-
-       * config/mips/linux.h (ASM_PREFERRED_EH_DATA_FORMAT): Redefine
-       to return DW_EH_PE_absptr.
-
-Index: config/mips/linux.h
-===================================================================
-RCS file: /cvs/gcc/gcc/gcc/config/mips/linux.h,v
-retrieving revision 1.77
-diff -u -p -r1.77 linux.h
---- gcc/gcc/config/mips/linux.h        19 Feb 2004 22:07:51 -0000      1.77
-+++ gcc/gcc/config/mips/linux.h        14 Jun 2004 05:49:51 -0000
-@@ -170,10 +170,11 @@ Boston, MA 02111-1307, USA.  */
- #undef FUNCTION_NAME_ALREADY_DECLARED
- #define FUNCTION_NAME_ALREADY_DECLARED 1
--#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL)                    \
--  (flag_pic                                                           \
--    ? ((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4\
--   : DW_EH_PE_absptr)
-+/* If possible, we should attempt to use GP-relative relocs for this
-+   (see <a  href="http://sources.redhat.com/ml/binutils/2004-05/msg00227.html">http://sources.redhat.com/ml/binutils/2004-05/msg00227.html</a>).
-+   However, until that is implement, this just uses standard, absolute
-+   references.  */
-+#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL)    DW_EH_PE_absptr
- /* The glibc _mcount stub will save $v0 for us.  Don't mess with saving
-    it, since ASM_OUTPUT_REG_PUSH/ASM_OUTPUT_REG_POP do not work in the
diff --git a/openwrt/toolchain/gcc/3.3.5/specs-arm-soft-float b/openwrt/toolchain/gcc/3.3.5/specs-arm-soft-float
deleted file mode 100644 (file)
index d692174..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-*asm:
-%{mbig-endian:-EB} %{mlittle-endian:-EL} %{mcpu=*:-mcpu=%*} %{march=*:-march=%*} %{mapcs-*:-mapcs-%*} %(subtarget_asm_float_spec) %{mthumb-interwork:-mthumb-interwork} %(subtarget_extra_asm_spec)
-
-*asm_debug:
-%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}
-
-*asm_final:
-
-
-*asm_options:
-%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}
-
-*invoke_as:
-%{!S:-o %{|!pipe:%g.s} |
- as %(asm_options) %{!pipe:%g.s} %A }
-
-*cpp:
-%(cpp_cpu_arch) %(subtarget_cpp_spec)                  %{mapcs-32:%{mapcs-26:                                                          %e-mapcs-26 and -mapcs-32 may not be used together}}            %{msoft-float:%{mhard-float:                                                    %e-msoft-float and -mhard_float may not be used together}}      %{mbig-endian:%{mlittle-endian:                                                 %e-mbig-endian and -mlittle-endian may not be used together}}
-
-*cpp_options:
-%(cpp_unique_options) %1 %{m*} %{std*} %{ansi} %{W*&pedantic*} %{w} %{f*} %{O*} %{undef}
-
-*cpp_debug_options:
-%{d*}
-
-*cpp_unique_options:
-%{C:%{!E:%eGNU C does not support -C without using -E}} %{CC:%{!E:%eGNU C does not support -CC without using -E}} %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}} %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3} %{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{E|M|MM:%W{o*}}
-
-*trad_capable_cpp:
-cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}
-
-*cc1:
-%{profile:-p}
-
-*cc1_options:
-%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} %{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}} %{g*} %{O*} %{W*&pedantic*} %{w} %{std*} %{ansi} %{v:-version} %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{--help:--help} %{--target-help:--target-help} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*} %{msoft-float:%{mhard-float: %e-msoft-float and -mhard_float may not be used together}} %{!mhard-float:%{!msoft-float:-msoft-float}}
-
-*cc1plus:
-
-
-*link_gcc_c_sequence:
-%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}
-
-*endfile:
-%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s
-
-*link:
-%{h*} %{version:-v}    %{b} %{Wl,*:%*}    %{static:-Bstatic}    %{shared:-shared}    %{symbolic:-Bsymbolic}    %{rdynamic:-export-dynamic}    %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}    -X    %{mbig-endian:-EB} -m armelf_linux -p
-
-*lib:
-%{pthread:-lpthread}    %{shared:-lc}    %{!shared:%{profile:-lc_p}%{!profile:-lc}}
-
-*libgcc:
-%{!mhard-float:-lfloat} %{static|static-libgcc:-lgcc -lgcc_eh}%{!static:%{!static-libgcc:%{!shared:%{!shared-libgcc:-lgcc -lgcc_eh}%{shared-libgcc:-lgcc_s%M -lgcc}}%{shared:-lgcc_s%M}}}
-
-*startfile:
-%{!shared:      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s}                  %{!p:%{profile:gcrt1.o%s}                         %{!profile:crt1.o%s}}}}    crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}
-
-*switches_need_spaces:
-
-
-*predefines:
-
-
-*cross_compile:
-1
-
-*version:
-3.3.4
-
-*multilib:
-. ;
-
-*multilib_defaults:
-marm mlittle-endian msoft-float mapcs-32 mno-thumb-interwork
-
-*multilib_extra:
-
-
-*multilib_matches:
-
-
-*multilib_exclusions:
-
-
-*multilib_options:
-
-
-*linker:
-collect2
-
-*link_libgcc:
-%D
-
-*md_exec_prefix:
-
-
-*md_startfile_prefix:
-
-
-*md_startfile_prefix_1:
-
-
-*startfile_prefix_spec:
-
-
-*cpp_cpu_arch:
-%{march=arm2:-D__ARM_ARCH_2__} %{march=arm250:-D__ARM_ARCH_2__} %{march=arm3:-D__ARM_ARCH_2__} %{march=arm6:-D__ARM_ARCH_3__} %{march=arm600:-D__ARM_ARCH_3__} %{march=arm610:-D__ARM_ARCH_3__} %{march=arm7:-D__ARM_ARCH_3__} %{march=arm700:-D__ARM_ARCH_3__} %{march=arm710:-D__ARM_ARCH_3__} %{march=arm720:-D__ARM_ARCH_3__} %{march=arm7100:-D__ARM_ARCH_3__} %{march=arm7500:-D__ARM_ARCH_3__} %{march=arm7500fe:-D__ARM_ARCH_3__} %{march=arm7m:-D__ARM_ARCH_3M__} %{march=arm7dm:-D__ARM_ARCH_3M__} %{march=arm7dmi:-D__ARM_ARCH_3M__} %{march=arm7tdmi:-D__ARM_ARCH_4T__} %{march=arm8:-D__ARM_ARCH_4__} %{march=arm810:-D__ARM_ARCH_4__} %{march=arm9:-D__ARM_ARCH_4T__} %{march=arm920:-D__ARM_ARCH_4__} %{march=arm920t:-D__ARM_ARCH_4T__} %{march=arm9tdmi:-D__ARM_ARCH_4T__} %{march=strongarm:-D__ARM_ARCH_4__} %{march=strongarm110:-D__ARM_ARCH_4__} %{march=strongarm1100:-D__ARM_ARCH_4__} %{march=xscale:-D__ARM_ARCH_5TE__} %{march=xscale:-D__XSCALE__} %{march=armv2:-D__ARM_ARCH_2__} %{march=armv2a:-D__ARM_ARCH_2__} %{march=armv3:-D__ARM_ARCH_3__} %{march=armv3m:-D__ARM_ARCH_3M__} %{march=armv4:-D__ARM_ARCH_4__} %{march=armv4t:-D__ARM_ARCH_4T__} %{march=armv5:-D__ARM_ARCH_5__} %{march=armv5t:-D__ARM_ARCH_5T__} %{march=armv5e:-D__ARM_ARCH_5E__} %{march=armv5te:-D__ARM_ARCH_5TE__} %{!march=*:  %{mcpu=arm2:-D__ARM_ARCH_2__}  %{mcpu=arm250:-D__ARM_ARCH_2__}  %{mcpu=arm3:-D__ARM_ARCH_2__}  %{mcpu=arm6:-D__ARM_ARCH_3__}  %{mcpu=arm600:-D__ARM_ARCH_3__}  %{mcpu=arm610:-D__ARM_ARCH_3__}  %{mcpu=arm7:-D__ARM_ARCH_3__}  %{mcpu=arm700:-D__ARM_ARCH_3__}  %{mcpu=arm710:-D__ARM_ARCH_3__}  %{mcpu=arm720:-D__ARM_ARCH_3__}  %{mcpu=arm7100:-D__ARM_ARCH_3__}  %{mcpu=arm7500:-D__ARM_ARCH_3__}  %{mcpu=arm7500fe:-D__ARM_ARCH_3__}  %{mcpu=arm7m:-D__ARM_ARCH_3M__}  %{mcpu=arm7dm:-D__ARM_ARCH_3M__}  %{mcpu=arm7dmi:-D__ARM_ARCH_3M__}  %{mcpu=arm7tdmi:-D__ARM_ARCH_4T__}  %{mcpu=arm8:-D__ARM_ARCH_4__}  %{mcpu=arm810:-D__ARM_ARCH_4__}  %{mcpu=arm9:-D__ARM_ARCH_4T__}  %{mcpu=arm920:-D__ARM_ARCH_4__}  %{mcpu=arm920t:-D__ARM_ARCH_4T__}  %{mcpu=arm9tdmi:-D__ARM_ARCH_4T__}  %{mcpu=strongarm:-D__ARM_ARCH_4__}  %{mcpu=strongarm110:-D__ARM_ARCH_4__}  %{mcpu=strongarm1100:-D__ARM_ARCH_4__}  %{mcpu=xscale:-D__ARM_ARCH_5TE__}  %{mcpu=xscale:-D__XSCALE__}  %{!mcpu*:%(cpp_cpu_arch_default)}} 
-
-*cpp_cpu_arch_default:
--D__ARM_ARCH_4T__
-
-*subtarget_cpp_spec:
-%{posix:-D_POSIX_SOURCE} %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__}
-
-*subtarget_extra_asm_spec:
-
-
-*subtarget_asm_float_spec:
-%{mapcs-float:-mfloat} %{!mhard-float:-mno-fpu}
-
-*link_command:
-%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:    %(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t}    %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}    %{static:} %{L*} %(link_libgcc) %o %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}}    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}
-
diff --git a/openwrt/toolchain/gcc/3.3.5/specs-mips-soft-float b/openwrt/toolchain/gcc/3.3.5/specs-mips-soft-float
deleted file mode 100644 (file)
index 2a42400..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-*asm:
-%{G*} %(endian_spec) %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips64}%{mips16:%{!mno-mips16:-mips16}} %{mno-mips16:-no-mips16} %(subtarget_asm_optimizing_spec) %(subtarget_asm_debugging_spec) %{membedded-pic} %{mabi=32:-32}%{mabi=n32:-n32}%{mabi=64:-64}%{mabi=n64:-64} %{mabi=eabi} %{mabi=o64} %{!mabi*: %(asm_abi_default_spec)} %{mgp32} %{mgp64} %{march=*} %(target_asm_spec) %(subtarget_asm_spec)
-
-*asm_debug:
-%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}
-
-*asm_final:
-%|
-
-*asm_options:
-%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}
-
-*invoke_as:
-%{!S:-o %{|!pipe:%g.s} |
- as %(asm_options) %{!pipe:%g.s} %A }
-
-*cpp:
-%(subtarget_cpp_spec)
-
-*cpp_options:
-%(cpp_unique_options) %1 %{m*} %{std*} %{ansi} %{W*&pedantic*} %{w} %{f*} %{O*} %{undef}
-
-*cpp_debug_options:
-%{d*}
-
-*cpp_unique_options:
-%{C:%{!E:%eGNU C does not support -C without using -E}} %{CC:%{!E:%eGNU C does not support -CC without using -E}} %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}} %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3} %{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{E|M|MM:%W{o*}}
-
-*trad_capable_cpp:
-cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}
-
-*cc1:
-%{profile:-p}
-
-*cc1_options:
-%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} %{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}} %{g*} %{O*} %{W*&pedantic*} %{w} %{std*} %{ansi} %{v:-version} %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{--help:--help} %{--target-help:--target-help} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*} %{msoft-float:%{mhard-float: %e-msoft-float and -mhard_float may not be used together}} %{!mhard-float:%{!msoft-float:-msoft-float}}
-
-*cc1plus:
-
-
-*link_gcc_c_sequence:
-%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}
-
-*endfile:
-%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s
-
-*link:
-%{!static:--eh-frame-hdr} %(endian_spec)   %{shared:-shared}   %{!shared:     %{!ibcs:       %{!static:         %{rdynamic:-export-dynamic}         %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}         %{static:-static}}}
-
-*lib:
-%{shared: -lc} %{!static:-rpath-link %R/lib:%R/usr/lib} %{!shared: %{pthread:-lpthread}   %{profile:-lc_p} %{!profile: -lc}}
-
-*libgcc:
-%{static|static-libgcc:-lgcc -lgcc_eh}%{!static:%{!static-libgcc:%{!shared:%{!shared-libgcc:-lgcc -lgcc_eh}%{shared-libgcc:-lgcc_s%M -lgcc}}%{shared:%{shared-libgcc:-lgcc_s%M}%{!shared-libgcc:-lgcc}}}}
-
-*startfile:
-%{!shared:      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s}                  %{!p:%{profile:gcrt1.o%s}                         %{!profile:crt1.o%s}}}}    crti.o%s %{static:crtbeginT.o%s}   %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}
-
-*switches_need_spaces:
-
-
-*predefines:
-
-
-*cross_compile:
-1
-
-*version:
-3.3.4
-
-*multilib:
-. ;
-
-*multilib_defaults:
-EB mips1 mabi=32
-
-*multilib_extra:
-
-
-*multilib_matches:
-
-
-*multilib_exclusions:
-
-
-*multilib_options:
-
-
-*linker:
-collect2
-
-*link_libgcc:
-%D
-
-*md_exec_prefix:
-
-
-*md_startfile_prefix:
-
-
-*md_startfile_prefix_1:
-
-
-*startfile_prefix_spec:
-
-
-*subtarget_cc1_spec:
-
-
-*subtarget_cpp_spec:
-%{fno-PIC:-U__PIC__ -U__pic__} %{fno-pic:-U__PIC__ -U__pic__} %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{pthread:-D_REENTRANT}
-
-*mips_as_asm_spec:
-%{!.s:-nocpp} %{.s: %{cpp} %{nocpp}} %{pipe: %e-pipe is not supported} %{K} %(subtarget_mips_as_asm_spec)
-
-*gas_asm_spec:
-%{mtune=*} %{v}
-
-*target_asm_spec:
-%{mmips-as: %(mips_as_asm_spec)} %{!mmips-as: %(gas_asm_spec)}
-
-*subtarget_mips_as_asm_spec:
-%{v}
-
-*subtarget_asm_optimizing_spec:
-%{noasmopt:-O0} %{!noasmopt:%{O:-O2} %{O1:-O2} %{O2:-O2} %{O3:-O3}}
-
-*subtarget_asm_debugging_spec:
--g0
-
-*mdebug_asm_spec:
-%{!gdwarf*:-mdebug} %{gdwarf*:-no-mdebug}
-
-*subtarget_asm_spec:
-%{mabi=64: -64} %{!fno-PIC:%{!fno-pic:-KPIC}} %{fno-PIC:-non_shared} %{fno-pic:-non_shared}
-
-*asm_abi_default_spec:
--32
-
-*endian_spec:
-%{!EL:%{!mel:-EB}} %{EL|mel:-EL}
-
-*link_command:
-%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:    %(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t}    %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}    %{static:} %{L*} %(link_libgcc) %o %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}}    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}
-
diff --git a/openwrt/toolchain/gcc/3.3.5/specs-mipsel-soft-float b/openwrt/toolchain/gcc/3.3.5/specs-mipsel-soft-float
deleted file mode 100644 (file)
index 481bf5a..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-*asm:
-%{G*} %(endian_spec) %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips64}%{mips16:%{!mno-mips16:-mips16}} %{mno-mips16:-no-mips16} %(subtarget_asm_optimizing_spec) %(subtarget_asm_debugging_spec) %{membedded-pic} %{mabi=32:-32}%{mabi=n32:-n32}%{mabi=64:-64}%{mabi=n64:-64} %{mabi=eabi} %{mabi=o64} %{!mabi*: %(asm_abi_default_spec)} %{mgp32} %{mgp64} %{march=*} %(target_asm_spec) %(subtarget_asm_spec)
-
-*asm_debug:
-%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}
-
-*asm_final:
-%|
-
-*asm_options:
-%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}
-
-*invoke_as:
-%{!S:-o %{|!pipe:%g.s} |
- as %(asm_options) %{!pipe:%g.s} %A }
-
-*cpp:
-%(subtarget_cpp_spec)
-
-*cpp_options:
-%(cpp_unique_options) %1 %{m*} %{std*} %{ansi} %{W*&pedantic*} %{w} %{f*} %{O*} %{undef}
-
-*cpp_debug_options:
-%{d*}
-
-*cpp_unique_options:
-%{C:%{!E:%eGNU C does not support -C without using -E}} %{CC:%{!E:%eGNU C does not support -CC without using -E}} %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}} %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3} %{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{E|M|MM:%W{o*}}
-
-*trad_capable_cpp:
-cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}
-
-*cc1:
-%{profile:-p}
-
-*cc1_options:
-%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} %{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}} %{g*} %{O*} %{W*&pedantic*} %{w} %{std*} %{ansi} %{v:-version} %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{--help:--help} %{--target-help:--target-help} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*} %{msoft-float:%{mhard-float: %e-msoft-float and -mhard_float may not be used together}} %{!mhard-float:%{!msoft-float:-msoft-float}}
-
-*cc1plus:
-
-
-*link_gcc_c_sequence:
-%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}
-
-*endfile:
-%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s
-
-*link:
-%{!static:--eh-frame-hdr} %(endian_spec)   %{shared:-shared}   %{!shared:     %{!ibcs:       %{!static:         %{rdynamic:-export-dynamic}         %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}         %{static:-static}}}
-
-*lib:
-%{shared: -lc} %{!static:-rpath-link %R/lib:%R/usr/lib} %{!shared: %{pthread:-lpthread}   %{profile:-lc_p} %{!profile: -lc}}
-
-*libgcc:
-%{static|static-libgcc:-lgcc -lgcc_eh}%{!static:%{!static-libgcc:%{!shared:%{!shared-libgcc:-lgcc -lgcc_eh}%{shared-libgcc:-lgcc_s%M -lgcc}}%{shared:%{shared-libgcc:-lgcc_s%M}%{!shared-libgcc:-lgcc}}}}
-
-*startfile:
-%{!shared:      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s}                  %{!p:%{profile:gcrt1.o%s}                         %{!profile:crt1.o%s}}}}    crti.o%s %{static:crtbeginT.o%s}   %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}
-
-*switches_need_spaces:
-
-
-*predefines:
-
-
-*cross_compile:
-1
-
-*version:
-3.3.4
-
-*multilib:
-. ;
-
-*multilib_defaults:
-EL mips1 mabi=32
-
-*multilib_extra:
-
-
-*multilib_matches:
-
-
-*multilib_exclusions:
-
-
-*multilib_options:
-
-
-*linker:
-collect2
-
-*link_libgcc:
-%D
-
-*md_exec_prefix:
-
-
-*md_startfile_prefix:
-
-
-*md_startfile_prefix_1:
-
-
-*startfile_prefix_spec:
-
-
-*subtarget_cc1_spec:
-
-
-*subtarget_cpp_spec:
-%{fno-PIC:-U__PIC__ -U__pic__} %{fno-pic:-U__PIC__ -U__pic__} %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{pthread:-D_REENTRANT}
-
-*mips_as_asm_spec:
-%{!.s:-nocpp} %{.s: %{cpp} %{nocpp}} %{pipe: %e-pipe is not supported} %{K} %(subtarget_mips_as_asm_spec)
-
-*gas_asm_spec:
-%{mtune=*} %{v}
-
-*target_asm_spec:
-%{mmips-as: %(mips_as_asm_spec)} %{!mmips-as: %(gas_asm_spec)}
-
-*subtarget_mips_as_asm_spec:
-%{v}
-
-*subtarget_asm_optimizing_spec:
-%{noasmopt:-O0} %{!noasmopt:%{O:-O2} %{O1:-O2} %{O2:-O2} %{O3:-O3}}
-
-*subtarget_asm_debugging_spec:
--g0
-
-*mdebug_asm_spec:
-%{!gdwarf*:-mdebug} %{gdwarf*:-no-mdebug}
-
-*subtarget_asm_spec:
-%{mabi=64: -64} %{!fno-PIC:%{!fno-pic:-KPIC}} %{fno-PIC:-non_shared} %{fno-pic:-non_shared}
-
-*asm_abi_default_spec:
--32
-
-*endian_spec:
-%{!EB:%{!meb:-EL}} %{EB|meb:-EB}
-
-*link_command:
-%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:    %(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t}    %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}    %{static:} %{L*} %(link_libgcc) %o %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}}    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}
-
diff --git a/openwrt/toolchain/gcc/3.3.5/specs-powerpc-soft-float b/openwrt/toolchain/gcc/3.3.5/specs-powerpc-soft-float
deleted file mode 100644 (file)
index 8a546ac..0000000
+++ /dev/null
@@ -1,352 +0,0 @@
-*asm:
-%(asm_cpu) %{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} %{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} %{memb} %{!memb: %{msdata: -memb} %{msdata=eabi: -memb}} %{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian} %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian:     %{mcall-freebsd: -mbig}     %{mcall-i960-old: -mlittle}     %{mcall-linux: -mbig}     %{mcall-gnu: -mbig}     %{mcall-netbsd: -mbig} }}}}
-
-*asm_debug:
-%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}
-
-*asm_final:
-%|
-
-*asm_options:
-%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}
-
-*invoke_as:
-%{!S:-o %{|!pipe:%g.s} |
- as %(asm_options) %{!pipe:%g.s} %A }
-
-*cpp:
-%{posix: -D_POSIX_SOURCE} %(cpp_sysv) %{mads: %(cpp_os_ads) } %{myellowknife: %(cpp_os_yellowknife) } %{mmvme: %(cpp_os_mvme) } %{msim: %(cpp_os_sim) } %{mwindiss: %(cpp_os_windiss) } %{mcall-freebsd: %(cpp_os_freebsd) } %{mcall-linux: %(cpp_os_linux) } %{mcall-gnu: %(cpp_os_gnu) } %{mcall-netbsd: %(cpp_os_netbsd) } %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss:          %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu:          %{!mcall-netbsd: %(cpp_os_default) }}}}}}}}}
-
-*cpp_options:
-%(cpp_unique_options) %1 %{m*} %{std*} %{ansi} %{W*&pedantic*} %{w} %{f*} %{O*} %{undef}
-
-*cpp_debug_options:
-%{d*}
-
-*cpp_unique_options:
-%{C:%{!E:%eGNU C does not support -C without using -E}} %{CC:%{!E:%eGNU C does not support -CC without using -E}} %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}} %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3} %{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{E|M|MM:%W{o*}}
-
-*trad_capable_cpp:
-cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}
-
-*cc1:
-%{G*} %{mlittle: %(cc1_endian_little)} %{!mlittle: %{mlittle-endian: %(cc1_endian_little)}} %{mbig: %(cc1_endian_big)} %{!mbig: %{mbig-endian: %(cc1_endian_big)}} %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian:     %{mcall-aixdesc: -mbig %(cc1_endian_big) }     %{mcall-freebsd: -mbig %(cc1_endian_big) }     %{mcall-i960-old: -mlittle %(cc1_endian_little) }     %{mcall-linux: -mbig %(cc1_endian_big) }     %{mcall-gnu: -mbig %(cc1_endian_big) }     %{mcall-netbsd: -mbig %(cc1_endian_big) }     %{!mcall-aixdesc: %{!mcall-freebsd: %{!mcall-i960-old: %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd:             %(cc1_endian_default)     }}}}}} }}}} %{mno-sdata: -msdata=none } %{meabi: %{!mcall-*: -mcall-sysv }} %{!meabi: %{!mno-eabi:     %{mrelocatable: -meabi }     %{mcall-freebsd: -mno-eabi }     %{mcall-i960-old: -meabi }     %{mcall-linux: -mno-eabi }     %{mcall-gnu: -mno-eabi }     %{mcall-netbsd: -mno-eabi }}} %{msdata: -msdata=default} %{mno-sdata: -msdata=none} %{profile: -p}
-
-*cc1_options:
-%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} %{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}} %{g*} %{O*} %{W*&pedantic*} %{w} %{std*} %{ansi} %{v:-version} %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{--help:--help} %{--target-help:--target-help} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*} %{msoft-float:%{mhard-float: %e-msoft-float and -mhard_float may not be used together}} %{!mhard-float:%{!msoft-float:-msoft-float}}
-
-*cc1plus:
-
-
-*link_gcc_c_sequence:
-%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}
-
-*endfile:
-%{mads: crtsavres.o%s %(endfile_ads)} %{myellowknife: crtsavres.o%s %(endfile_yellowknife)} %{mmvme: crtsavres.o%s %(endfile_mvme)} %{msim: crtsavres.o%s %(endfile_sim)} %{mwindiss: %(endfile_windiss)} %{mcall-freebsd: crtsavres.o%s %(endfile_freebsd) } %{mcall-linux: crtsavres.o%s %(endfile_linux) } %{mcall-gnu: crtsavres.o%s %(endfile_gnu) } %{mcall-netbsd: crtsavres.o%s %(endfile_netbsd) } %{mvxworks: crtsavres.o%s %(endfile_vxworks) } %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss:          %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu:          %{!mcall-netbsd: %{!mvxworks: %(crtsavres_default)                                        %(endfile_default) }}}}}}}}}}
-
-*link:
-%{!static:--eh-frame-hdr} %{h*} %{v:-V} %{!msdata=none:%{G*}} %{msdata=none:-G0} %{YP,*} %{R*} %{Qy:} %{!Qn:-Qy} %(link_shlib) %{!Wl,-T*: %{!T*: %(link_start) }} %(link_target) %(link_os)
-
-*lib:
-%{mads: %(lib_ads) } %{myellowknife: %(lib_yellowknife) } %{mmvme: %(lib_mvme) } %{msim: %(lib_sim) } %{mwindiss: %(lib_windiss) } %{mcall-freebsd: %(lib_freebsd) } %{mcall-linux: %(lib_linux) } %{mcall-gnu: %(lib_gnu) } %{mcall-netbsd: %(lib_netbsd) } %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss:          %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu:          %{!mcall-netbsd: %(lib_default) }}}}}}}}}
-
-*libgcc:
-%{static|static-libgcc:-lgcc -lgcc_eh}%{!static:%{!static-libgcc:%{!shared:%{!shared-libgcc:-lgcc -lgcc_eh}%{shared-libgcc:-lgcc_s%M -lgcc}}%{shared:%{shared-libgcc:-lgcc_s%M}%{!shared-libgcc:-lgcc}}}}
-
-*startfile:
-%{mads: %(startfile_ads) } %{myellowknife: %(startfile_yellowknife) } %{mmvme: %(startfile_mvme) } %{msim: %(startfile_sim) } %{mwindiss: %(startfile_windiss) } %{mcall-freebsd: %(startfile_freebsd) } %{mcall-linux: %(startfile_linux) } %{mcall-gnu: %(startfile_gnu) } %{mcall-netbsd: %(startfile_netbsd) } %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss:          %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu:          %{!mcall-netbsd: %(startfile_default) }}}}}}}}}
-
-*switches_need_spaces:
-
-
-*predefines:
-
-
-*cross_compile:
-1
-
-*version:
-3.3.4
-
-*multilib:
-. mhard-float;nof !mhard-float;
-
-*multilib_defaults:
-mbig mcall-sysv
-
-*multilib_extra:
-fPIC mstrict-align
-
-*multilib_matches:
-mcpu=401 msoft-float;mcpu=403 msoft-float;mcpu=405 msoft-float;mcpu=ec603e msoft-float;mcpu=801 msoft-float;mcpu=821 msoft-float;mcpu=823 msoft-float;mcpu=860 msoft-float;msoft-float msoft-float;
-
-*multilib_exclusions:
-
-
-*multilib_options:
-msoft-float
-
-*linker:
-collect2
-
-*link_libgcc:
-%D
-
-*md_exec_prefix:
-
-
-*md_startfile_prefix:
-
-
-*md_startfile_prefix_1:
-
-
-*startfile_prefix_spec:
-
-
-*cpp_default:
-
-
-*asm_cpu:
-%{!mcpu*:   %{mpower: %{!mpower2: -mpwr}}   %{mpower2: -mpwrx}   %{mpowerpc*: -mppc}   %{mno-power: %{!mpowerpc*: -mcom}}   %{!mno-power: %{!mpower2: %(asm_default)}}} %{mcpu=common: -mcom} %{mcpu=power: -mpwr} %{mcpu=power2: -mpwrx} %{mcpu=power3: -m604} %{mcpu=power4: -mpower4} %{mcpu=powerpc: -mppc} %{mcpu=rios: -mpwr} %{mcpu=rios1: -mpwr} %{mcpu=rios2: -mpwrx} %{mcpu=rsc: -mpwr} %{mcpu=rsc1: -mpwr} %{mcpu=401: -mppc} %{mcpu=403: -m403} %{mcpu=405: -m405} %{mcpu=505: -mppc} %{mcpu=601: -m601} %{mcpu=602: -mppc} %{mcpu=603: -mppc} %{mcpu=603e: -mppc} %{mcpu=ec603e: -mppc} %{mcpu=604: -mppc} %{mcpu=604e: -mppc} %{mcpu=620: -mppc} %{mcpu=630: -m604} %{mcpu=740: -mppc} %{mcpu=7400: -mppc} %{mcpu=7450: -mppc} %{mcpu=750: -mppc} %{mcpu=801: -mppc} %{mcpu=821: -mppc} %{mcpu=823: -mppc} %{mcpu=860: -mppc} %{mcpu=8540: -me500} %{maltivec: -maltivec}
-
-*asm_default:
--mppc
-
-*cpp_sysv:
-%{mrelocatable*: -D_RELOCATABLE} %{fpic: -D__PIC__=1 -D__pic__=1} %{!fpic: %{fPIC: -D__PIC__=2 -D__pic__=2}}
-
-*crtsavres_default:
-crtsavres.o%s
-
-*lib_ads:
---start-group -lads -lc --end-group
-
-*lib_yellowknife:
---start-group -lyk -lc --end-group
-
-*lib_mvme:
---start-group -lmvme -lc --end-group
-
-*lib_sim:
---start-group -lsim -lc --end-group
-
-*lib_freebsd:
-                                                         %{!shared:                                                                %{!pg:                                                                    %{!pthread:-lc}                                                         %{pthread:-lc_r}}                                                     %{pg:                                                                     %{!pthread:-lc_p}                                                       %{pthread:-lc_r_p}}                                                 }
-
-*lib_gnu:
-%{mnewlib: --start-group -lgnu -lc --end-group } %{!mnewlib: %{shared:-lc} %{!shared: %{pthread:-lpthread } %{profile:-lc_p} %{!profile:-lc}}}
-
-*lib_linux:
-%{mnewlib: --start-group -llinux -lc --end-group } %{!mnewlib: %{pthread:-lpthread} %{shared:-lc} %{!shared: %{profile:-lc_p} %{!profile:-lc}}}
-
-*lib_netbsd:
-%{profile:-lgmon -lc_p} %{!profile:-lc}
-
-*lib_vxworks:
-
-
-*lib_windiss:
---start-group -li -lcfp -lwindiss -lram -limpl -limpfp --end-group
-
-*lib_default:
-%(lib_linux)
-
-*startfile_ads:
-ecrti.o%s crt0.o%s crtbegin.o%s
-
-*startfile_yellowknife:
-ecrti.o%s crt0.o%s crtbegin.o%s
-
-*startfile_mvme:
-ecrti.o%s crt0.o%s crtbegin.o%s
-
-*startfile_sim:
-ecrti.o%s sim-crt0.o%s crtbegin.o%s
-
-*startfile_freebsd:
-%{!shared:      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s}                  %{!p:%{profile:gcrt1.o%s}                         %{!profile:crt1.o%s}}}}    crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}
-
-*startfile_gnu:
-%{!shared: %{!static: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}} %{static: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} %{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}
-
-*startfile_linux:
-%{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} %{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} %{static:crtbeginT.o%s} %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}
-
-*startfile_netbsd:
-ncrti.o%s crt0.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}
-
-*startfile_vxworks:
-
-
-*startfile_windiss:
-crt0.o%s crtbegin.o%s
-
-*startfile_default:
-%(startfile_linux)
-
-*endfile_ads:
-crtend.o%s ecrtn.o%s
-
-*endfile_yellowknife:
-crtend.o%s ecrtn.o%s
-
-*endfile_mvme:
-crtend.o%s ecrtn.o%s
-
-*endfile_sim:
-crtend.o%s ecrtn.o%s
-
-*endfile_freebsd:
-%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s
-
-*endfile_gnu:
-%{!shared:crtend.o%s} %{shared:crtendS.o%s} %{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}
-
-*endfile_linux:
-%{!shared:crtend.o%s} %{shared:crtendS.o%s} %{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}
-
-*endfile_netbsd:
-%{!shared:crtend.o%s} %{shared:crtendS.o%s} ncrtn.o%s
-
-*endfile_vxworks:
-
-
-*endfile_windiss:
-crtend.o%s
-
-*endfile_default:
-%(endfile_linux)
-
-*link_path:
-
-
-*link_shlib:
-%{shared:-shared} %{!shared: %{static:-static}}
-
-*link_target:
-%{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian:     %{mcall-i960-old: --oformat elf32-powerpcle}   }}}}
-
-*link_start:
-%{mads: %(link_start_ads) } %{myellowknife: %(link_start_yellowknife) } %{mmvme: %(link_start_mvme) } %{msim: %(link_start_sim) } %{mwindiss: %(link_start_windiss) } %{mcall-freebsd: %(link_start_freebsd) } %{mcall-linux: %(link_start_linux) } %{mcall-gnu: %(link_start_gnu) } %{mcall-netbsd: %(link_start_netbsd) } %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss:          %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd:            %{!mcall-freebsd: %(link_start_default) }}}}}}}}}
-
-*link_start_ads:
--T ads.ld%s
-
-*link_start_yellowknife:
--T yellowknife.ld%s
-
-*link_start_mvme:
--Ttext 0x40000
-
-*link_start_sim:
-
-
-*link_start_freebsd:
-
-
-*link_start_gnu:
-
-
-*link_start_linux:
-
-
-*link_start_netbsd:
-
-
-*link_start_vxworks:
-
-
-*link_start_windiss:
-
-
-*link_start_default:
-%(link_start_linux)
-
-*link_os:
-%{mads: %(link_os_ads) } %{myellowknife: %(link_os_yellowknife) } %{mmvme: %(link_os_mvme) } %{msim: %(link_os_sim) } %{mwindiss: %(link_os_windiss) } %{mcall-freebsd: %(link_os_freebsd) } %{mcall-linux: %(link_os_linux) } %{mcall-gnu: %(link_os_gnu) } %{mcall-netbsd: %(link_os_netbsd) } %{mcall-uclibc: %(link_os_linux_uclibc) } %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss:          %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu:          %{!mcall-netbsd: %{!mcall-uclibc:          %(link_os_default) }}}}}}}}}}
-
-*link_os_ads:
-
-
-*link_os_yellowknife:
-
-
-*link_os_mvme:
-
-
-*link_os_sim:
--m elf32ppcsim
-
-*link_os_freebsd:
-  %{p:%e`-p' not supported; use `-pg' and gprof(1)}     %{Wl,*:%*}     %{v:-V}     %{assert*} %{R*} %{rpath*} %{defsym*}     %{shared:-Bshareable %{h*} %{soname*}}     %{!shared:       %{!static:    %{rdynamic: -export-dynamic}    %{!dynamic-linker: -dynamic-linker /usr/libexec/ld-elf.so.1}}       %{static:-Bstatic}}     %{symbolic:-Bsymbolic}
-
-*link_os_linux:
--m elf32ppclinux %{!shared: %{!static:   %{rdynamic:-export-dynamic}   %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}
-
-*link_os_gnu:
--m elf32ppclinux %{!shared: %{!static:   %{rdynamic:-export-dynamic}   %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}
-
-*link_os_netbsd:
-%{!shared: %{!static:   %{rdynamic:-export-dynamic}   %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}}}
-
-*link_os_vxworks:
--r
-
-*link_os_windiss:
-
-
-*link_os_linux_uclibc:
--m elf32ppclinux %{!shared: %{!static:   %{rdynamic:-export-dynamic}   %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}}
-
-*link_os_default:
-%(link_os_linux_uclibc)
-
-*cc1_endian_big:
-
-
-*cc1_endian_little:
-%{!mstrict-align: %{!mno-strict-align:     %{!mcall-i960-old:  -mstrict-align     } }}
-
-*cc1_endian_default:
-%(cc1_endian_big)
-
-*cpp_os_ads:
-
-
-*cpp_os_yellowknife:
-
-
-*cpp_os_mvme:
-
-
-*cpp_os_sim:
-
-
-*cpp_os_freebsd:
-  -D__ELF__ -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__   -Acpu=powerpc -Amachine=powerpc
-
-*cpp_os_gnu:
--D__unix__ -D__gnu_hurd__ -D__GNU__    %{!undef:                                                         %{!ansi: -Dunix -D__unix}}                                    -Asystem=gnu -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}
-
-*cpp_os_linux:
--D__unix__ -D__gnu_linux__ -D__linux__ %{!undef:                                                           %{!ansi:                                                          %{!std=*:-Dunix -D__unix -Dlinux -D__linux}                             %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}}             -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}
-
-*cpp_os_netbsd:
--D__powerpc__ -D__NetBSD__ -D__ELF__ -D__KPRINTF_ATTRIBUTE__
-
-*cpp_os_rtems:
-%{!mcpu*:  %{!Dppc*: %{!Dmpc*: -Dmpc750} } }%{mcpu=403:  %{!Dppc*: %{!Dmpc*: -Dppc403}  } } %{mcpu=505:  %{!Dppc*: %{!Dmpc*: -Dmpc505}  } } %{mcpu=601:  %{!Dppc*: %{!Dmpc*: -Dppc601}  } } %{mcpu=602:  %{!Dppc*: %{!Dmpc*: -Dppc602}  } } %{mcpu=603:  %{!Dppc*: %{!Dmpc*: -Dppc603}  } } %{mcpu=603e: %{!Dppc*: %{!Dmpc*: -Dppc603e} } } %{mcpu=604:  %{!Dppc*: %{!Dmpc*: -Dmpc604}  } } %{mcpu=750:  %{!Dppc*: %{!Dmpc*: -Dmpc750}  } } %{mcpu=821:  %{!Dppc*: %{!Dmpc*: -Dmpc821}  } } %{mcpu=860:  %{!Dppc*: %{!Dmpc*: -Dmpc860}  } }
-
-*cpp_os_vxworks:
--DCPU_FAMILY=PPC %{!mcpu*:   %{mpowerpc*: -DCPU=PPC603}   %{!mno-powerpc: -DCPU=PPC603}} %{mcpu=powerpc: -DCPU=PPC603} %{mcpu=401: -DCPU=PPC403} %{mcpu=403: -DCPU=PPC403} %{mcpu=405: -DCPU=PPC405} %{mcpu=601: -DCPU=PPC601} %{mcpu=602: -DCPU=PPC603} %{mcpu=603: -DCPU=PPC603} %{mcpu=603e: -DCPU=PPC603} %{mcpu=ec603e: -DCPU=PPC603} %{mcpu=604: -DCPU=PPC604} %{mcpu=604e: -DCPU=PPC604} %{mcpu=620: -DCPU=PPC604} %{mcpu=740: -DCPU=PPC603} %{mcpu=7450: -DCPU=PPC603} %{mcpu=750: -DCPU=PPC603} %{mcpu=801: -DCPU=PPC603} %{mcpu=821: -DCPU=PPC603} %{mcpu=823: -DCPU=PPC603} %{mcpu=860: -DCPU=PPC603}
-
-*cpp_os_windiss:
--D__rtasim -D__EABI__ -D__ppc %{!msoft-float: -D__hardfp} 
-
-*cpp_os_default:
-%(cpp_os_linux)
-
-*link_command:
-%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:    %(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t}    %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}    %{static:} %{L*} %(link_libgcc) %o %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}}    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}
-
diff --git a/openwrt/toolchain/gcc/3.4.3/100-uclibc-conf.patch b/openwrt/toolchain/gcc/3.4.3/100-uclibc-conf.patch
deleted file mode 100644 (file)
index 29e4c80..0000000
+++ /dev/null
@@ -1,442 +0,0 @@
-diff -urN gcc-3.4.1-dist/boehm-gc/configure gcc-3.4.1/boehm-gc/configure
---- gcc-3.4.1-dist/boehm-gc/configure  2004-07-01 14:14:03.000000000 -0500
-+++ gcc-3.4.1/boehm-gc/configure       2004-08-12 16:22:57.000000000 -0500
-@@ -1947,6 +1947,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN gcc-3.4.1-dist/boehm-gc/ltconfig gcc-3.4.1/boehm-gc/ltconfig
---- gcc-3.4.1-dist/boehm-gc/ltconfig   2002-11-20 09:59:06.000000000 -0600
-+++ gcc-3.4.1/boehm-gc/ltconfig        2004-08-12 15:54:42.000000000 -0500
-@@ -1981,6 +1981,23 @@
-   fi
-   ;;
-+linux-uclibc*)
-+  version_type=linux
-+  need_lib_prefix=no
-+  need_version=no
-+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-+  soname_spec='${libname}${release}.so$major'
-+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-+  shlibpath_var=LD_LIBRARY_PATH
-+  shlibpath_overrides_runpath=no
-+  deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
-+  file_magic_cmd=/usr/bin/file
-+  file_magic_test_file=`echo /lib/libuClibc-*.so`
-+
-+  # Assume using the uClibc dynamic linker.
-+  dynamic_linker="uClibc ld.so"
-+  ;;
-+
- netbsd*)
-   version_type=sunos
-   if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-diff -urN gcc-3.4.1-dist/gcc/config/arm/linux-elf.h gcc-3.4.1/gcc/config/arm/linux-elf.h
---- gcc-3.4.1-dist/gcc/config/arm/linux-elf.h  2004-01-31 00:18:11.000000000 -0600
-+++ gcc-3.4.1/gcc/config/arm/linux-elf.h       2004-08-12 15:54:42.000000000 -0500
-@@ -81,6 +81,18 @@
-   "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
- #undef  LINK_SPEC
-+#ifdef USE_UCLIBC
-+#define LINK_SPEC "%{h*} %{version:-v} \
-+   %{b} %{Wl,*:%*} \
-+   %{static:-Bstatic} \
-+   %{shared:-shared} \
-+   %{symbolic:-Bsymbolic} \
-+   %{rdynamic:-export-dynamic} \
-+   %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0} \
-+   -X \
-+   %{mbig-endian:-EB}" \
-+   SUBTARGET_EXTRA_LINK_SPEC
-+#else
- #define LINK_SPEC "%{h*} %{version:-v} \
-    %{b} %{Wl,*:%*} \
-    %{static:-Bstatic} \
-@@ -91,6 +103,7 @@
-    -X \
-    %{mbig-endian:-EB}" \
-    SUBTARGET_EXTRA_LINK_SPEC
-+#endif
- #define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
-diff -urN gcc-3.4.1-dist/gcc/config/cris/linux.h gcc-3.4.1/gcc/config/cris/linux.h
---- gcc-3.4.1-dist/gcc/config/cris/linux.h     2003-11-28 21:08:09.000000000 -0600
-+++ gcc-3.4.1/gcc/config/cris/linux.h  2004-08-12 15:54:43.000000000 -0500
-@@ -79,6 +79,25 @@
- #undef CRIS_DEFAULT_CPU_VERSION
- #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
-+#ifdef USE_UCLIBC
-+
-+#undef CRIS_SUBTARGET_VERSION
-+#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-uclibc"
-+
-+#undef CRIS_LINK_SUBTARGET_SPEC
-+#define CRIS_LINK_SUBTARGET_SPEC \
-+ "-mcrislinux\
-+  -rpath-link include/asm/../..%s\
-+  %{shared} %{static}\
-+  %{symbolic:-Bdynamic} %{shlib:-Bdynamic} %{static:-Bstatic}\
-+  %{!shared: \
-+    %{!static: \
-+      %{rdynamic:-export-dynamic} \
-+      %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}} \
-+  %{!r:%{O2|O3: --gc-sections}}"
-+
-+#else  /* USE_UCLIBC */
-+
- #undef CRIS_SUBTARGET_VERSION
- #define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
-@@ -93,6 +112,8 @@
-   %{!shared:%{!static:%{rdynamic:-export-dynamic}}}\
-   %{!r:%{O2|O3: --gc-sections}}"
-+#endif  /* USE_UCLIBC */
-+
- /* Node: Run-time Target */
-diff -urN gcc-3.4.1-dist/gcc/config/cris/t-linux-uclibc gcc-3.4.1/gcc/config/cris/t-linux-uclibc
---- gcc-3.4.1-dist/gcc/config/cris/t-linux-uclibc      1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.4.1/gcc/config/cris/t-linux-uclibc   2004-08-12 15:54:43.000000000 -0500
-@@ -0,0 +1,3 @@
-+T_CFLAGS = -DUSE_UCLIBC
-+TARGET_LIBGCC2_CFLAGS += -fPIC
-+CRTSTUFF_T_CFLAGS_S = $(TARGET_LIBGCC2_CFLAGS)
-diff -urN gcc-3.4.1-dist/gcc/config/i386/linux.h gcc-3.4.1/gcc/config/i386/linux.h
---- gcc-3.4.1-dist/gcc/config/i386/linux.h     2003-11-28 21:08:10.000000000 -0600
-+++ gcc-3.4.1/gcc/config/i386/linux.h  2004-08-12 15:54:43.000000000 -0500
-@@ -118,6 +118,15 @@
-       %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.1}} \
-       %{static:-static}}}"
- #else
-+#if defined USE_UCLIBC
-+#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
-+  %{!shared: \
-+    %{!ibcs: \
-+      %{!static: \
-+      %{rdynamic:-export-dynamic} \
-+      %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
-+      %{static:-static}}}"
-+#else
- #define LINK_SPEC "-m elf_i386 %{shared:-shared} \
-   %{!shared: \
-     %{!ibcs: \
-@@ -126,6 +135,7 @@
-       %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
-       %{static:-static}}}"
- #endif
-+#endif
- /* A C statement (sans semicolon) to output to the stdio stream
-    FILE the assembler definition of uninitialized global DECL named
-diff -urN gcc-3.4.1-dist/gcc/config/mips/linux.h gcc-3.4.1/gcc/config/mips/linux.h
---- gcc-3.4.1-dist/gcc/config/mips/linux.h     2004-06-15 20:42:24.000000000 -0500
-+++ gcc-3.4.1/gcc/config/mips/linux.h  2004-08-12 15:54:43.000000000 -0500
-@@ -109,6 +109,17 @@
- /* Borrowed from sparc/linux.h */
- #undef LINK_SPEC
-+#ifdef USE_UCLIBC
-+#define LINK_SPEC \
-+ "%(endian_spec) \
-+  %{shared:-shared} \
-+  %{!shared: \
-+    %{!ibcs: \
-+      %{!static: \
-+        %{rdynamic:-export-dynamic} \
-+        %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
-+        %{static:-static}}}"
-+#else
- #define LINK_SPEC \
-  "%(endian_spec) \
-   %{shared:-shared} \
-@@ -118,6 +129,7 @@
-         %{rdynamic:-export-dynamic} \
-         %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
-         %{static:-static}}}"
-+#endif
- #undef SUBTARGET_ASM_SPEC
- #define SUBTARGET_ASM_SPEC "\
-diff -urN gcc-3.4.1-dist/gcc/config/rs6000/linux.h gcc-3.4.1/gcc/config/rs6000/linux.h
---- gcc-3.4.1-dist/gcc/config/rs6000/linux.h   2004-02-25 09:11:19.000000000 -0600
-+++ gcc-3.4.1/gcc/config/rs6000/linux.h        2004-08-12 15:54:43.000000000 -0500
-@@ -61,7 +61,11 @@
- #define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
- #undef        LINK_OS_DEFAULT_SPEC
-+#ifdef USE_UCLIBC
-+#define LINK_OS_DEFAULT_SPEC "%(link_os_linux_uclibc)"
-+#else
- #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
-+#endif
- #define LINK_GCC_C_SEQUENCE_SPEC \
-   "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
-diff -urN gcc-3.4.1-dist/gcc/config/rs6000/sysv4.h gcc-3.4.1/gcc/config/rs6000/sysv4.h
---- gcc-3.4.1-dist/gcc/config/rs6000/sysv4.h   2004-06-10 01:39:50.000000000 -0500
-+++ gcc-3.4.1/gcc/config/rs6000/sysv4.h        2004-08-12 15:54:43.000000000 -0500
-@@ -947,6 +947,7 @@
-   mcall-linux  : %(link_os_linux)       ; \
-   mcall-gnu    : %(link_os_gnu)         ; \
-   mcall-netbsd : %(link_os_netbsd)      ; \
-+  mcall-linux-uclibc : %(link_os_linux_uclibc); \
-   mcall-openbsd: %(link_os_openbsd)     ; \
-                : %(link_os_default)     }"
-@@ -1124,6 +1125,10 @@
-   %{rdynamic:-export-dynamic} \
-   %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
-+#define LINK_OS_LINUX_UCLIBC_SPEC "-m elf32ppclinux %{!shared: %{!static: \
-+  %{rdynamic:-export-dynamic} \
-+  %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}}"
-+
- #if defined(HAVE_LD_EH_FRAME_HDR)
- # define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
- #endif
-@@ -1290,6 +1295,7 @@
-   { "link_os_sim",            LINK_OS_SIM_SPEC },                     \
-   { "link_os_freebsd",                LINK_OS_FREEBSD_SPEC },                 \
-   { "link_os_linux",          LINK_OS_LINUX_SPEC },                   \
-+  { "link_os_linux_uclibc",   LINK_OS_LINUX_UCLIBC_SPEC },            \
-   { "link_os_gnu",            LINK_OS_GNU_SPEC },                     \
-   { "link_os_netbsd",         LINK_OS_NETBSD_SPEC },                  \
-   { "link_os_openbsd",                LINK_OS_OPENBSD_SPEC },                 \
-diff -urN gcc-3.4.1-dist/gcc/config/sh/linux.h gcc-3.4.1/gcc/config/sh/linux.h
---- gcc-3.4.1-dist/gcc/config/sh/linux.h       2004-01-11 20:29:13.000000000 -0600
-+++ gcc-3.4.1/gcc/config/sh/linux.h    2004-08-12 15:54:43.000000000 -0500
-@@ -73,12 +73,21 @@
- #undef SUBTARGET_LINK_EMUL_SUFFIX
- #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
- #undef SUBTARGET_LINK_SPEC
-+#ifdef USE_UCLIBC
-+#define SUBTARGET_LINK_SPEC \
-+  "%{shared:-shared} \
-+   %{!static: \
-+     %{rdynamic:-export-dynamic} \
-+     %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
-+   %{static:-static}"
-+#else
- #define SUBTARGET_LINK_SPEC \
-   "%{shared:-shared} \
-    %{!static: \
-      %{rdynamic:-export-dynamic} \
-      %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
-    %{static:-static}"
-+#endif
- #undef LIB_SPEC
- #define LIB_SPEC \
-diff -urN gcc-3.4.1-dist/gcc/config/sh/t-linux-uclibc gcc-3.4.1/gcc/config/sh/t-linux-uclibc
---- gcc-3.4.1-dist/gcc/config/sh/t-linux-uclibc        1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.4.1/gcc/config/sh/t-linux-uclibc     2004-08-12 15:54:43.000000000 -0500
-@@ -0,0 +1,13 @@
-+T_CFLAGS = -DUSE_UCLIBC
-+
-+TARGET_LIBGCC2_CFLAGS = -fpic -DNO_FPSCR_VALUES
-+LIB1ASMFUNCS_CACHE = _ic_invalidate
-+
-+LIB2FUNCS_EXTRA=
-+
-+MULTILIB_OPTIONS= $(MULTILIB_ENDIAN) m3e/m4
-+MULTILIB_DIRNAMES= 
-+MULTILIB_MATCHES = 
-+MULTILIB_EXCEPTIONS=
-+
-+EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
-diff -urN gcc-3.4.1-dist/gcc/config/sh/t-sh64-uclibc gcc-3.4.1/gcc/config/sh/t-sh64-uclibc
---- gcc-3.4.1-dist/gcc/config/sh/t-sh64-uclibc 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.4.1/gcc/config/sh/t-sh64-uclibc      2004-08-12 15:54:43.000000000 -0500
-@@ -0,0 +1,13 @@
-+EXTRA_MULTILIB_PARTS= crt1.o crti.o crtn.o crtbegin.o crtend.o
-+
-+LIB1ASMFUNCS = \
-+  _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
-+  _shcompact_call_trampoline _shcompact_return_trampoline \
-+  _shcompact_incoming_args _ic_invalidate _nested_trampoline \
-+  _push_pop_shmedia_regs \
-+  _udivdi3 _divdi3 _umoddi3 _moddi3
-+
-+MULTILIB_OPTIONS = $(MULTILIB_ENDIAN) m5-32media-nofpu/m5-compact/m5-compact-nofpu/m5-64media/m5-64media-nofpu
-+MULTILIB_DIRNAMES= $(MULTILIB_ENDIAN) nofpu compact nofpu/compact media64 nofpu/media64
-+MULTILIB_MATCHES=
-+MULTILIB_EXCEPTIONS=
-diff -urN gcc-3.4.1-dist/gcc/config/t-linux-uclibc gcc-3.4.1/gcc/config/t-linux-uclibc
---- gcc-3.4.1-dist/gcc/config/t-linux-uclibc   1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.4.1/gcc/config/t-linux-uclibc        2004-08-12 15:54:43.000000000 -0500
-@@ -0,0 +1,15 @@
-+T_CFLAGS = -DUSE_UCLIBC
-+
-+# Compile crtbeginS.o and crtendS.o with pic.
-+CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
-+# Compile libgcc2.a with pic.
-+TARGET_LIBGCC2_CFLAGS = -fPIC
-+
-+# Override t-slibgcc-elf-ver to export some libgcc symbols with
-+# the symbol versions that glibc used.
-+#SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver
-+
-+# Use unwind-dw2-fde
-+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
-+  $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c
-+LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h
-diff -urN gcc-3.4.1-dist/gcc/config.gcc gcc-3.4.1/gcc/config.gcc
---- gcc-3.4.1-dist/gcc/config.gcc      2004-04-21 10:12:35.000000000 -0500
-+++ gcc-3.4.1/gcc/config.gcc   2004-08-12 15:59:46.000000000 -0500
-@@ -664,6 +664,12 @@
-       extra_parts=""
-       use_collect2=yes
-       ;;
-+arm*-*-linux-uclibc*)         # ARM GNU/Linux with ELF - uClibc
-+      tm_file="dbxelf.h elfos.h linux.h arm/elf.h  arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h"
-+      tmake_file="t-slibgcc-elf-ver t-linux-uclibc arm/t-linux"
-+      extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
-+      gnu_ld=yes
-+      ;;
- arm*-*-linux*)                        # ARM GNU/Linux with ELF
-       tm_file="dbxelf.h elfos.h linux.h arm/elf.h  arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h"
-       tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
-@@ -725,6 +731,10 @@
-       tmake_file="cris/t-cris cris/t-elfmulti"
-       gas=yes
-       ;;
-+cris-*-linux-uclibc*)
-+      tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h"
-+      tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux-uclibc"
-+      ;;
- cris-*-linux*)
-       tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h"
-       tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux"
-@@ -988,6 +998,11 @@
-               thread_file='single'
-       fi
-       ;;
-+i[34567]86-*-linux*uclibc*)   # Intel 80386's running GNU/Linux
-+                              # with ELF format using uClibc
-+      tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h"
-+      tmake_file="t-slibgcc-elf-ver t-linux-uclibc i386/t-crtstuff"
-+      ;;
- i[34567]86-*-linux*)  # Intel 80386's running GNU/Linux
-                       # with ELF format using glibc 2
-                       # aka GNU/Linux C library 6
-@@ -1547,6 +1562,16 @@
-       gnu_ld=yes
-       gas=yes
-       ;;
-+mips*-*-linux-uclibc*)                        # Linux MIPS, either endian. uClibc
-+        tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h"
-+      case ${target} in
-+        mipsisa32*-*)
-+                target_cpu_default="MASK_SOFT_FLOAT"
-+              tm_defines="MIPS_ISA_DEFAULT=32"
-+                ;;
-+        esac
-+      tmake_file="t-slibgcc-elf-ver t-linux-uclibc"
-+      ;;
- mips*-*-linux*)                               # Linux MIPS, either endian.
-         tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h"
-       case ${target} in
-@@ -1764,6 +1789,10 @@
-       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxspe.h"
-       tmake_file="rs6000/t-fprules rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm"
-       ;;
-+powerpc-*-linux-uclibc*)
-+      tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h"
-+      tmake_file="rs6000/t-fprules rs6000/t-ppcos t-slibgcc-elf-ver t-linux-uclibc rs6000/t-ppccomm"
-+      ;;
- powerpc-*-linux*)
-       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h"
-       tmake_file="rs6000/t-fprules rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm"
-@@ -1916,7 +1945,7 @@
-       tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/elf.h sh/embed-elf.h sh/rtemself.h rtems.h"
-       ;;
- sh-*-linux* | sh[2346lbe]*-*-linux*)
--      tmake_file="sh/t-sh sh/t-elf t-slibgcc-elf-ver t-linux"
-+      tmake_file="sh/t-sh sh/t-elf t-slibgcc-elf-ver"
-       case ${target} in
-       sh*be-*-* | sh*eb-*-*) ;;
-       *)
-@@ -1924,9 +1953,17 @@
-               tmake_file="${tmake_file} sh/t-le"
-               ;;
-       esac
--      tmake_file="${tmake_file} sh/t-linux"
-+      case ${target} in
-+      *-*-linux-uclibc*) tmake_file="${tmake_file} t-linux-uclibc sh/t-linux-uclibc" ;;
-+      *) tmake_file="${tmake_file} t-linux sh/t-linux" ;;
-+      esac
-       tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/elf.h sh/linux.h"
-       case ${target} in
-+      sh64*-*-linux-uclibc*)
-+              tmake_file="${tmake_file} sh/t-sh64-uclibc"
-+              tm_file="${tm_file} sh/sh64.h"
-+              extra_headers="shmedia.h ushmedia.h sshmedia.h"
-+              ;;
-       sh64*)
-               tmake_file="${tmake_file} sh/t-sh64"
-               tm_file="${tm_file} sh/sh64.h"
-diff -urN gcc-3.4.1-dist/libtool.m4 gcc-3.4.1/libtool.m4
---- gcc-3.4.1-dist/libtool.m4  2004-05-18 04:08:37.000000000 -0500
-+++ gcc-3.4.1/libtool.m4       2004-08-12 15:54:43.000000000 -0500
-@@ -689,6 +689,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
-diff -urN gcc-3.4.1-dist/ltconfig gcc-3.4.1/ltconfig
---- gcc-3.4.1-dist/ltconfig    2004-03-05 15:05:41.000000000 -0600
-+++ gcc-3.4.1/ltconfig 2004-08-12 15:55:48.000000000 -0500
-@@ -602,6 +602,7 @@
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case $host_os in
-+linux-uclibc*) ;;
- linux-gnu*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
-@@ -1262,6 +1263,24 @@
-   dynamic_linker='GNU/Linux ld.so'
-   ;;
-+linux-uclibc*)
-+  version_type=linux
-+  need_lib_prefix=no
-+  need_version=no
-+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-+  soname_spec='${libname}${release}.so$major'
-+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-+  shlibpath_var=LD_LIBRARY_PATH
-+  shlibpath_overrides_runpath=no
-+  # This implies no fast_install, which is unacceptable.
-+  # Some rework will be needed to allow for fast_install
-+  # before this can be enabled.
-+  # Note: copied from linux-gnu, and may not be appropriate.
-+  hardcode_into_libs=yes
-+  # Assume using the uClibc dynamic linker.
-+  dynamic_linker="uClibc ld.so"
-+  ;;
-+
- netbsd*)
-   need_lib_prefix=no
-   need_version=no
diff --git a/openwrt/toolchain/gcc/3.4.3/200-uclibc-locale.patch b/openwrt/toolchain/gcc/3.4.3/200-uclibc-locale.patch
deleted file mode 100644 (file)
index 3fc4900..0000000
+++ /dev/null
@@ -1,3246 +0,0 @@
-diff -urN gcc-3.4.2-dist/libstdc++-v3/acinclude.m4 gcc-3.4.2/libstdc++-v3/acinclude.m4
---- gcc-3.4.2-dist/libstdc++-v3/acinclude.m4   2004-07-15 12:42:45.000000000 -0500
-+++ gcc-3.4.2/libstdc++-v3/acinclude.m4        2004-09-10 10:47:40.000000000 -0500
-@@ -996,7 +996,7 @@
-   AC_MSG_CHECKING([for C locale to use])
-   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
-     [use MODEL for target locale package],
--    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
-+    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
-   
-   # If they didn't use this option switch, or if they specified --enable
-   # with no specific model, we'll have to look for one.  If they
-@@ -1012,6 +1012,9 @@
-   # Default to "generic".
-   if test $enable_clocale_flag = auto; then
-     case x${target_os} in
-+      x*-uclibc*)
-+        enable_clocale_flag=uclibc
-+        ;;
-       xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
-         AC_EGREP_CPP([_GLIBCXX_ok], [
-         #include <features.h>
-@@ -1138,6 +1141,41 @@
-       CTIME_CC=config/locale/generic/time_members.cc
-       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
-       ;;
-+    uclibc)
-+      AC_MSG_RESULT(uclibc)
-+
-+      # Declare intention to use gettext, and add support for specific
-+      # languages.
-+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
-+      ALL_LINGUAS="de fr"
-+
-+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
-+      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
-+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
-+        USE_NLS=yes
-+      fi
-+      # Export the build objects.
-+      for ling in $ALL_LINGUAS; do \
-+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
-+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
-+      done
-+      AC_SUBST(glibcxx_MOFILES)
-+      AC_SUBST(glibcxx_POFILES)
-+
-+      CLOCALE_H=config/locale/uclibc/c_locale.h
-+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
-+      CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
-+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
-+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
-+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
-+      CMESSAGES_H=config/locale/uclibc/messages_members.h
-+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
-+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
-+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
-+      CTIME_H=config/locale/uclibc/time_members.h
-+      CTIME_CC=config/locale/uclibc/time_members.cc
-+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
-+      ;;
-   esac
-   # This is where the testsuite looks for locale catalogs, using the
-diff -urN gcc-3.4.2-dist/libstdc++-v3/aclocal.m4 gcc-3.4.2/libstdc++-v3/aclocal.m4
---- gcc-3.4.2-dist/libstdc++-v3/aclocal.m4     2004-08-13 15:44:03.000000000 -0500
-+++ gcc-3.4.2/libstdc++-v3/aclocal.m4  2004-09-10 10:47:40.000000000 -0500
-@@ -1025,6 +1025,9 @@
-   # Default to "generic".
-   if test $enable_clocale_flag = auto; then
-     case x${target_os} in
-+      x*-uclibc*)
-+      enable_clocale_flag=uclibc
-+      ;;
-       xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
-         AC_EGREP_CPP([_GLIBCXX_ok], [
-         #include <features.h>
-@@ -1151,6 +1154,41 @@
-       CTIME_CC=config/locale/generic/time_members.cc
-       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
-       ;;
-+    uclibc)
-+      AC_MSG_RESULT(uclibc)
-+
-+      # Declare intention to use gettext, and add support for specific
-+      # languages.
-+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
-+      ALL_LINGUAS="de fr"
-+
-+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
-+      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
-+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
-+        USE_NLS=yes
-+      fi
-+      # Export the build objects.
-+      for ling in $ALL_LINGUAS; do \
-+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
-+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
-+      done
-+      AC_SUBST(glibcxx_MOFILES)
-+      AC_SUBST(glibcxx_POFILES)
-+
-+      CLOCALE_H=config/locale/uclibc/c_locale.h
-+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
-+      CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
-+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
-+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
-+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
-+      CMESSAGES_H=config/locale/uclibc/messages_members.h
-+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
-+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
-+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
-+      CTIME_H=config/locale/uclibc/time_members.h
-+      CTIME_CC=config/locale/uclibc/time_members.cc
-+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
-+      ;;
-   esac
-   # This is where the testsuite looks for locale catalogs, using the
-diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-3.4.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
---- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h      1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h   2004-09-10 10:47:40.000000000 -0500
-@@ -0,0 +1,59 @@
-+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
-+
-+// Copyright (C) 2002, 2004 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+// Written by Jakub Jelinek <jakub@redhat.com>
-+
-+#include <clocale>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning clean this up
-+#endif
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+                                                  
-+extern "C" __typeof(iswctype_l) __iswctype_l;
-+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
-+extern "C" __typeof(strcoll_l) __strcoll_l;
-+extern "C" __typeof(strftime_l) __strftime_l;
-+extern "C" __typeof(strtod_l) __strtod_l;
-+extern "C" __typeof(strtof_l) __strtof_l;
-+extern "C" __typeof(strtold_l) __strtold_l;
-+extern "C" __typeof(strxfrm_l) __strxfrm_l;
-+extern "C" __typeof(towlower_l) __towlower_l;
-+extern "C" __typeof(towupper_l) __towupper_l;
-+extern "C" __typeof(wcscoll_l) __wcscoll_l;
-+extern "C" __typeof(wcsftime_l) __wcsftime_l;
-+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
-+extern "C" __typeof(wctype_l) __wctype_l;
-+extern "C" __typeof(newlocale) __newlocale;
-+extern "C" __typeof(freelocale) __freelocale;
-+extern "C" __typeof(duplocale) __duplocale;
-+extern "C" __typeof(uselocale) __uselocale;
-+
-+#endif // GLIBC 2.3 and later
-diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-3.4.2/libstdc++-v3/config/locale/uclibc/c_locale.cc
---- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc       1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/c_locale.cc    2004-09-10 10:47:40.000000000 -0500
-@@ -0,0 +1,160 @@
-+// Wrapper for underlying C-language localization -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.8  Standard locale categories.
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <cerrno>  // For errno
-+#include <locale>
-+#include <stdexcept>
-+#include <langinfo.h>
-+#include <bits/c++locale_internal.h>
-+
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
-+#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
-+#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
-+#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
-+#define __strtof_l(S, E, L)         strtof((S), (E))
-+#define __strtod_l(S, E, L)         strtod((S), (E))
-+#define __strtold_l(S, E, L)        strtold((S), (E))
-+#warning should dummy __newlocale check for C|POSIX ?
-+#define __newlocale(a, b, c)        NULL
-+#define __freelocale(a)             ((void)0)
-+#define __duplocale(a)              __c_locale()
-+#endif
-+
-+namespace std 
-+{
-+  template<>
-+    void
-+    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
-+                 const __c_locale& __cloc)
-+    {
-+      if (!(__err & ios_base::failbit))
-+      {
-+        char* __sanity;
-+        errno = 0;
-+        float __f = __strtof_l(__s, &__sanity, __cloc);
-+          if (__sanity != __s && errno != ERANGE)
-+          __v = __f;
-+        else
-+          __err |= ios_base::failbit;
-+      }
-+    }
-+
-+  template<>
-+    void
-+    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
-+                 const __c_locale& __cloc)
-+    {
-+      if (!(__err & ios_base::failbit))
-+      {
-+        char* __sanity;
-+        errno = 0;
-+        double __d = __strtod_l(__s, &__sanity, __cloc);
-+          if (__sanity != __s && errno != ERANGE)
-+          __v = __d;
-+        else
-+          __err |= ios_base::failbit;
-+      }
-+    }
-+
-+  template<>
-+    void
-+    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
-+                 const __c_locale& __cloc)
-+    {
-+      if (!(__err & ios_base::failbit))
-+      {
-+        char* __sanity;
-+        errno = 0;
-+        long double __ld = __strtold_l(__s, &__sanity, __cloc);
-+          if (__sanity != __s && errno != ERANGE)
-+          __v = __ld;
-+        else
-+          __err |= ios_base::failbit;
-+      }
-+    }
-+
-+  void
-+  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
-+                                  __c_locale __old)
-+  {
-+    __cloc = __newlocale(1 << LC_ALL, __s, __old);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    if (!__cloc)
-+      {
-+      // This named locale is not supported by the underlying OS.
-+      __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
-+                            "name not valid"));
-+      }
-+#endif
-+  }
-+  
-+  void
-+  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
-+  {
-+    if (_S_get_c_locale() != __cloc)
-+      __freelocale(__cloc); 
-+  }
-+
-+  __c_locale
-+  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
-+  { return __duplocale(__cloc); }
-+} // namespace std
-+
-+namespace __gnu_cxx
-+{
-+  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
-+    {
-+      "LC_CTYPE", 
-+      "LC_NUMERIC",
-+      "LC_TIME", 
-+      "LC_COLLATE", 
-+      "LC_MONETARY",
-+      "LC_MESSAGES", 
-+#if _GLIBCXX_NUM_CATEGORIES != 0
-+      "LC_PAPER", 
-+      "LC_NAME", 
-+      "LC_ADDRESS",
-+      "LC_TELEPHONE", 
-+      "LC_MEASUREMENT", 
-+      "LC_IDENTIFICATION" 
-+#endif
-+    };
-+}
-+
-+namespace std
-+{
-+  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
-+}  // namespace std
-diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-3.4.2/libstdc++-v3/config/locale/uclibc/c_locale.h
---- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/c_locale.h        1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/c_locale.h     2004-09-10 10:48:08.000000000 -0500
-@@ -0,0 +1,115 @@
-+// Wrapper for underlying C-language localization -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.8  Standard locale categories.
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#ifndef _C_LOCALE_H
-+#define _C_LOCALE_H 1
-+
-+#pragma GCC system_header
-+
-+#include <cstring>              // get std::strlen
-+#include <cstdio>               // get std::snprintf or std::sprintf
-+#include <clocale>
-+#include <langinfo.h>         // For codecvt
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix this
-+#endif
-+#ifdef __UCLIBC_HAS_LOCALE__
-+#include <iconv.h>            // For codecvt using iconv, iconv_t
-+#endif
-+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
-+#include <libintl.h>          // For messages
-+#endif
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning what is _GLIBCXX_C_LOCALE_GNU for
-+#endif
-+#define _GLIBCXX_C_LOCALE_GNU 1
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix categories
-+#endif
-+// #define _GLIBCXX_NUM_CATEGORIES 6
-+#define _GLIBCXX_NUM_CATEGORIES 0
-+ 
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+namespace __gnu_cxx
-+{
-+  extern "C" __typeof(uselocale) __uselocale;
-+}
-+#endif
-+
-+namespace std
-+{
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+  typedef __locale_t          __c_locale;
-+#else
-+  typedef int*                        __c_locale;
-+#endif
-+
-+  // Convert numeric value of type _Tv to string and return length of
-+  // string.  If snprintf is available use it, otherwise fall back to
-+  // the unsafe sprintf which, in general, can be dangerous and should
-+  // be avoided.
-+  template<typename _Tv>
-+    int
-+    __convert_from_v(char* __out, const int __size, const char* __fmt,
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+                   _Tv __v, const __c_locale& __cloc, int __prec)
-+    {
-+      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
-+#else
-+                   _Tv __v, const __c_locale&, int __prec)
-+    {
-+# ifdef __UCLIBC_HAS_LOCALE__
-+      char* __old = std::setlocale(LC_ALL, NULL);
-+      char* __sav = new char[std::strlen(__old) + 1];
-+      std::strcpy(__sav, __old);
-+      std::setlocale(LC_ALL, "C");
-+# endif
-+#endif
-+
-+      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+      __gnu_cxx::__uselocale(__old);
-+#elif defined __UCLIBC_HAS_LOCALE__
-+      std::setlocale(LC_ALL, __sav);
-+      delete [] __sav;
-+#endif
-+      return __ret;
-+    }
-+}
-+
-+#endif
-diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-3.4.2/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
---- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc        1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/codecvt_members.cc     2004-09-10 10:47:40.000000000 -0500
-@@ -0,0 +1,306 @@
-+// std::codecvt implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.1.5 - Template class codecvt
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+namespace std
-+{
-+  // Specializations.
-+#ifdef _GLIBCXX_USE_WCHAR_T
-+  codecvt_base::result
-+  codecvt<wchar_t, char, mbstate_t>::
-+  do_out(state_type& __state, const intern_type* __from, 
-+       const intern_type* __from_end, const intern_type*& __from_next,
-+       extern_type* __to, extern_type* __to_end,
-+       extern_type*& __to_next) const
-+  {
-+    result __ret = ok;
-+    state_type __tmp_state(__state);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
-+#endif
-+
-+    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
-+    // in case we fall back to wcrtomb and then continue, in a loop.
-+    // NB: wcsnrtombs is a GNU extension
-+    for (__from_next = __from, __to_next = __to;
-+       __from_next < __from_end && __to_next < __to_end
-+       && __ret == ok;)
-+      {
-+      const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
-+                                                    __from_end - __from_next);
-+      if (!__from_chunk_end)
-+        __from_chunk_end = __from_end;
-+
-+      __from = __from_next;
-+      const size_t __conv = wcsnrtombs(__to_next, &__from_next,
-+                                       __from_chunk_end - __from_next,
-+                                       __to_end - __to_next, &__state);
-+      if (__conv == static_cast<size_t>(-1))
-+        {
-+          // In case of error, in order to stop at the exact place we
-+          // have to start again from the beginning with a series of
-+          // wcrtomb.
-+          for (; __from < __from_next; ++__from)
-+            __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
-+          __state = __tmp_state;
-+          __ret = error;
-+        }
-+      else if (__from_next && __from_next < __from_chunk_end)
-+        {
-+          __to_next += __conv;
-+          __ret = partial;
-+        }
-+      else
-+        {
-+          __from_next = __from_chunk_end;
-+          __to_next += __conv;
-+        }
-+
-+      if (__from_next < __from_end && __ret == ok)
-+        {
-+          extern_type __buf[MB_LEN_MAX];
-+          __tmp_state = __state;
-+          const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
-+          if (__conv > static_cast<size_t>(__to_end - __to_next))
-+            __ret = partial;
-+          else
-+            {
-+              memcpy(__to_next, __buf, __conv);
-+              __state = __tmp_state;
-+              __to_next += __conv;
-+              ++__from_next;
-+            }
-+        }
-+      }
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+
-+    return __ret; 
-+  }
-+  
-+  codecvt_base::result
-+  codecvt<wchar_t, char, mbstate_t>::
-+  do_in(state_type& __state, const extern_type* __from, 
-+      const extern_type* __from_end, const extern_type*& __from_next,
-+      intern_type* __to, intern_type* __to_end,
-+      intern_type*& __to_next) const
-+  {
-+    result __ret = ok;
-+    state_type __tmp_state(__state);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
-+#endif
-+
-+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
-+    // in case we store a L'\0' and then continue, in a loop.
-+    // NB: mbsnrtowcs is a GNU extension
-+    for (__from_next = __from, __to_next = __to;
-+       __from_next < __from_end && __to_next < __to_end
-+       && __ret == ok;)
-+      {
-+      const extern_type* __from_chunk_end;
-+      __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
-+                                                                __from_end
-+                                                                - __from_next));
-+      if (!__from_chunk_end)
-+        __from_chunk_end = __from_end;
-+
-+      __from = __from_next;
-+      size_t __conv = mbsnrtowcs(__to_next, &__from_next,
-+                                 __from_chunk_end - __from_next,
-+                                 __to_end - __to_next, &__state);
-+      if (__conv == static_cast<size_t>(-1))
-+        {
-+          // In case of error, in order to stop at the exact place we
-+          // have to start again from the beginning with a series of
-+          // mbrtowc.
-+          for (;; ++__to_next, __from += __conv)
-+            {
-+              __conv = mbrtowc(__to_next, __from, __from_end - __from,
-+                               &__tmp_state);
-+              if (__conv == static_cast<size_t>(-1)
-+                  || __conv == static_cast<size_t>(-2))
-+                break;
-+            }
-+          __from_next = __from;
-+          __state = __tmp_state;          
-+          __ret = error;
-+        }
-+      else if (__from_next && __from_next < __from_chunk_end)
-+        {
-+          // It is unclear what to return in this case (see DR 382). 
-+          __to_next += __conv;
-+          __ret = partial;
-+        }
-+      else
-+        {
-+          __from_next = __from_chunk_end;
-+          __to_next += __conv;
-+        }
-+
-+      if (__from_next < __from_end && __ret == ok)
-+        {
-+          if (__to_next < __to_end)
-+            {
-+              // XXX Probably wrong for stateful encodings
-+              __tmp_state = __state;          
-+              ++__from_next;
-+              *__to_next++ = L'\0';
-+            }
-+          else
-+            __ret = partial;
-+        }
-+      }
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+
-+    return __ret; 
-+  }
-+
-+  int 
-+  codecvt<wchar_t, char, mbstate_t>::
-+  do_encoding() const throw()
-+  {
-+    // XXX This implementation assumes that the encoding is
-+    // stateless and is either single-byte or variable-width.
-+    int __ret = 0;
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
-+#endif
-+    if (MB_CUR_MAX == 1)
-+      __ret = 1;
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+    return __ret;
-+  }  
-+
-+  int 
-+  codecvt<wchar_t, char, mbstate_t>::
-+  do_max_length() const throw()
-+  {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
-+#endif
-+    // XXX Probably wrong for stateful encodings.
-+    int __ret = MB_CUR_MAX;
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+    return __ret;
-+  }
-+  
-+  int 
-+  codecvt<wchar_t, char, mbstate_t>::
-+  do_length(state_type& __state, const extern_type* __from,
-+          const extern_type* __end, size_t __max) const
-+  {
-+    int __ret = 0;
-+    state_type __tmp_state(__state);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
-+#endif
-+
-+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
-+    // in case we advance past it and then continue, in a loop.
-+    // NB: mbsnrtowcs is a GNU extension
-+  
-+    // A dummy internal buffer is needed in order for mbsnrtocws to consider
-+    // its fourth parameter (it wouldn't with NULL as first parameter).
-+    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
-+                                                         * __max));
-+    while (__from < __end && __max)
-+      {
-+      const extern_type* __from_chunk_end;
-+      __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
-+                                                                __end
-+                                                                - __from));
-+      if (!__from_chunk_end)
-+        __from_chunk_end = __end;
-+
-+      const extern_type* __tmp_from = __from;
-+      size_t __conv = mbsnrtowcs(__to, &__from,
-+                                 __from_chunk_end - __from,
-+                                 __max, &__state);
-+      if (__conv == static_cast<size_t>(-1))
-+        {
-+          // In case of error, in order to stop at the exact place we
-+          // have to start again from the beginning with a series of
-+          // mbrtowc.
-+          for (__from = __tmp_from;; __from += __conv)
-+            {
-+              __conv = mbrtowc(NULL, __from, __end - __from,
-+                               &__tmp_state);
-+              if (__conv == static_cast<size_t>(-1)
-+                  || __conv == static_cast<size_t>(-2))
-+                break;
-+            }
-+          __state = __tmp_state;
-+          __ret += __from - __tmp_from;
-+          break;
-+        }
-+      if (!__from)
-+        __from = __from_chunk_end;
-+      
-+      __ret += __from - __tmp_from;
-+      __max -= __conv;
-+
-+      if (__from < __end && __max)
-+        {
-+          // XXX Probably wrong for stateful encodings
-+          __tmp_state = __state;
-+          ++__from;
-+          ++__ret;
-+          --__max;
-+        }
-+      }
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+
-+    return __ret; 
-+  }
-+#endif
-+}
-diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-3.4.2/libstdc++-v3/config/locale/uclibc/collate_members.cc
---- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc        1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/collate_members.cc     2004-09-10 10:47:40.000000000 -0500
-@@ -0,0 +1,80 @@
-+// std::collate implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
-+#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
-+#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
-+#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
-+#endif
-+
-+namespace std
-+{
-+  // These are basically extensions to char_traits, and perhaps should
-+  // be put there instead of here.
-+  template<>
-+    int 
-+    collate<char>::_M_compare(const char* __one, const char* __two) const
-+    { 
-+      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
-+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
-+    }
-+  
-+  template<>
-+    size_t
-+    collate<char>::_M_transform(char* __to, const char* __from, 
-+                              size_t __n) const 
-+    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
-+
-+#ifdef _GLIBCXX_USE_WCHAR_T
-+  template<>
-+    int 
-+    collate<wchar_t>::_M_compare(const wchar_t* __one, 
-+                               const wchar_t* __two) const
-+    {
-+      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
-+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
-+    }
-+  
-+  template<>
-+    size_t
-+    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
-+                                 size_t __n) const
-+    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
-+#endif
-+}
-diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-3.4.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc
---- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc  1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc       2004-09-10 10:47:40.000000000 -0500
-@@ -0,0 +1,300 @@
-+// std::ctype implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#define _LIBC
-+#include <locale>
-+#undef _LIBC
-+#include <bits/c++locale_internal.h>
-+
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __wctype_l(S, L)           wctype((S))
-+#define __towupper_l(C, L)         towupper((C))
-+#define __towlower_l(C, L)         towlower((C))
-+#define __iswctype_l(C, M, L)      iswctype((C), (M))
-+#endif
-+
-+namespace std
-+{
-+  // NB: The other ctype<char> specializations are in src/locale.cc and
-+  // various /config/os/* files.
-+  template<>
-+    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
-+    : ctype<char>(0, false, __refs) 
-+    {                 
-+      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
-+      {
-+        this->_S_destroy_c_locale(this->_M_c_locale_ctype);
-+        this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+        this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
-+        this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
-+        this->_M_table = this->_M_c_locale_ctype->__ctype_b;
-+#endif
-+      }
-+    }
-+
-+#ifdef _GLIBCXX_USE_WCHAR_T  
-+  ctype<wchar_t>::__wmask_type
-+  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
-+  {
-+    __wmask_type __ret;
-+    switch (__m)
-+      {
-+      case space:
-+      __ret = __wctype_l("space", _M_c_locale_ctype);
-+      break;
-+      case print:
-+      __ret = __wctype_l("print", _M_c_locale_ctype);
-+      break;
-+      case cntrl:
-+      __ret = __wctype_l("cntrl", _M_c_locale_ctype);
-+      break;
-+      case upper:
-+      __ret = __wctype_l("upper", _M_c_locale_ctype);
-+      break;
-+      case lower:
-+      __ret = __wctype_l("lower", _M_c_locale_ctype);
-+      break;
-+      case alpha:
-+      __ret = __wctype_l("alpha", _M_c_locale_ctype);
-+      break;
-+      case digit:
-+      __ret = __wctype_l("digit", _M_c_locale_ctype);
-+      break;
-+      case punct:
-+      __ret = __wctype_l("punct", _M_c_locale_ctype);
-+      break;
-+      case xdigit:
-+      __ret = __wctype_l("xdigit", _M_c_locale_ctype);
-+      break;
-+      case alnum:
-+      __ret = __wctype_l("alnum", _M_c_locale_ctype);
-+      break;
-+      case graph:
-+      __ret = __wctype_l("graph", _M_c_locale_ctype);
-+      break;
-+      default:
-+      __ret = 0;
-+      }
-+    return __ret;
-+  }
-+  
-+  wchar_t
-+  ctype<wchar_t>::do_toupper(wchar_t __c) const
-+  { return __towupper_l(__c, _M_c_locale_ctype); }
-+
-+  const wchar_t*
-+  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
-+  {
-+    while (__lo < __hi)
-+      {
-+        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
-+        ++__lo;
-+      }
-+    return __hi;
-+  }
-+  
-+  wchar_t
-+  ctype<wchar_t>::do_tolower(wchar_t __c) const
-+  { return __towlower_l(__c, _M_c_locale_ctype); }
-+  
-+  const wchar_t*
-+  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
-+  {
-+    while (__lo < __hi)
-+      {
-+        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
-+        ++__lo;
-+      }
-+    return __hi;
-+  }
-+
-+  bool
-+  ctype<wchar_t>::
-+  do_is(mask __m, wchar_t __c) const
-+  { 
-+    // Highest bitmask in ctype_base == 10, but extra in "C"
-+    // library for blank.
-+    bool __ret = false;
-+    const size_t __bitmasksize = 11; 
-+    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
-+      if (__m & _M_bit[__bitcur]
-+        && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
-+      {
-+        __ret = true;
-+        break;
-+      }
-+    return __ret;    
-+  }
-+  
-+  const wchar_t* 
-+  ctype<wchar_t>::
-+  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
-+  {
-+    for (; __lo < __hi; ++__vec, ++__lo)
-+      {
-+      // Highest bitmask in ctype_base == 10, but extra in "C"
-+      // library for blank.
-+      const size_t __bitmasksize = 11; 
-+      mask __m = 0;
-+      for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
-+        if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
-+          __m |= _M_bit[__bitcur];
-+      *__vec = __m;
-+      }
-+    return __hi;
-+  }
-+  
-+  const wchar_t* 
-+  ctype<wchar_t>::
-+  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
-+  {
-+    while (__lo < __hi && !this->do_is(__m, *__lo))
-+      ++__lo;
-+    return __lo;
-+  }
-+
-+  const wchar_t*
-+  ctype<wchar_t>::
-+  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
-+  {
-+    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
-+      ++__lo;
-+    return __lo;
-+  }
-+
-+  wchar_t
-+  ctype<wchar_t>::
-+  do_widen(char __c) const
-+  { return _M_widen[static_cast<unsigned char>(__c)]; }
-+
-+  const char* 
-+  ctype<wchar_t>::
-+  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
-+  {
-+    while (__lo < __hi)
-+      {
-+      *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
-+      ++__lo;
-+      ++__dest;
-+      }
-+    return __hi;
-+  }
-+
-+  char
-+  ctype<wchar_t>::
-+  do_narrow(wchar_t __wc, char __dfault) const
-+  {
-+    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
-+      return _M_narrow[__wc];
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_ctype);
-+#endif
-+    const int __c = wctob(__wc);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
-+  }
-+
-+  const wchar_t*
-+  ctype<wchar_t>::
-+  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
-+          char* __dest) const
-+  {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_ctype);
-+#endif
-+    if (_M_narrow_ok)
-+      while (__lo < __hi)
-+      {
-+        if (*__lo >= 0 && *__lo < 128)
-+          *__dest = _M_narrow[*__lo];
-+        else
-+          {
-+            const int __c = wctob(*__lo);
-+            *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
-+          }
-+        ++__lo;
-+        ++__dest;
-+      }
-+    else
-+      while (__lo < __hi)
-+      {
-+        const int __c = wctob(*__lo);
-+        *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
-+        ++__lo;
-+        ++__dest;
-+      }
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+    return __hi;
-+  }
-+
-+  void
-+  ctype<wchar_t>::_M_initialize_ctype()
-+  {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_ctype);
-+#endif
-+    wint_t __i;
-+    for (__i = 0; __i < 128; ++__i)
-+      {
-+      const int __c = wctob(__i);
-+      if (__c == EOF)
-+        break;
-+      else
-+        _M_narrow[__i] = static_cast<char>(__c);
-+      }
-+    if (__i == 128)
-+      _M_narrow_ok = true;
-+    else
-+      _M_narrow_ok = false;
-+    for (size_t __j = 0;
-+       __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
-+      _M_widen[__j] = btowc(__j);
-+
-+    for (size_t __k = 0; __k <= 11; ++__k)
-+      { 
-+      _M_bit[__k] = static_cast<mask>(_ISbit(__k));
-+      _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
-+      }
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+  }
-+#endif //  _GLIBCXX_USE_WCHAR_T
-+}
-diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-3.4.2/libstdc++-v3/config/locale/uclibc/messages_members.cc
---- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc       1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/messages_members.cc    2004-09-10 10:47:40.000000000 -0500
-@@ -0,0 +1,100 @@
-+// std::messages implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix gettext stuff
-+#endif
-+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
-+extern "C" char *__dcgettext(const char *domainname,
-+                           const char *msgid, int category);
-+#undef gettext
-+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
-+#else
-+#undef gettext
-+#define gettext(msgid) (msgid)
-+#endif
-+
-+namespace std
-+{
-+  // Specializations.
-+  template<>
-+    string
-+    messages<char>::do_get(catalog, int, int, const string& __dfault) const
-+    {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+      __c_locale __old = __uselocale(_M_c_locale_messages);
-+      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
-+      __uselocale(__old);
-+      return string(__msg);
-+#elif defined __UCLIBC_HAS_LOCALE__
-+      char* __old = strdup(setlocale(LC_ALL, NULL));
-+      setlocale(LC_ALL, _M_name_messages);
-+      const char* __msg = gettext(__dfault.c_str());
-+      setlocale(LC_ALL, __old);
-+      free(__old);
-+      return string(__msg);
-+#else
-+      const char* __msg = gettext(__dfault.c_str());
-+      return string(__msg);
-+#endif
-+    }
-+
-+#ifdef _GLIBCXX_USE_WCHAR_T
-+  template<>
-+    wstring
-+    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
-+    {
-+# ifdef __UCLIBC_HAS_XLOCALE__
-+      __c_locale __old = __uselocale(_M_c_locale_messages);
-+      char* __msg = gettext(_M_convert_to_char(__dfault));
-+      __uselocale(__old);
-+      return _M_convert_from_char(__msg);
-+# elif defined __UCLIBC_HAS_LOCALE__
-+      char* __old = strdup(setlocale(LC_ALL, NULL));
-+      setlocale(LC_ALL, _M_name_messages);
-+      char* __msg = gettext(_M_convert_to_char(__dfault));
-+      setlocale(LC_ALL, __old);
-+      free(__old);
-+      return _M_convert_from_char(__msg);
-+# else
-+      char* __msg = gettext(_M_convert_to_char(__dfault));
-+      return _M_convert_from_char(__msg);
-+# endif
-+    }
-+#endif
-+}
-diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-3.4.2/libstdc++-v3/config/locale/uclibc/messages_members.h
---- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/messages_members.h        1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/messages_members.h     2004-09-10 10:47:40.000000000 -0500
-@@ -0,0 +1,118 @@
-+// std::messages implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.7.1.2  messages functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix prototypes for *textdomain funcs
-+#endif
-+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
-+extern "C" char *__textdomain(const char *domainname);
-+extern "C" char *__bindtextdomain(const char *domainname,
-+                                const char *dirname);
-+#else
-+#undef __textdomain
-+#undef __bindtextdomain
-+#define __textdomain(D)           ((void)0)
-+#define __bindtextdomain(D,P)     ((void)0)
-+#endif
-+
-+  // Non-virtual member functions.
-+  template<typename _CharT>
-+     messages<_CharT>::messages(size_t __refs)
-+     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
-+     _M_name_messages(_S_get_c_name())
-+     { }
-+
-+  template<typename _CharT>
-+     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
-+                              size_t __refs) 
-+     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
-+     _M_name_messages(__s)
-+     {
-+       char* __tmp = new char[std::strlen(__s) + 1];
-+       std::strcpy(__tmp, __s);
-+       _M_name_messages = __tmp;
-+     }
-+
-+  template<typename _CharT>
-+    typename messages<_CharT>::catalog 
-+    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
-+                         const char* __dir) const
-+    { 
-+      __bindtextdomain(__s.c_str(), __dir);
-+      return this->do_open(__s, __loc); 
-+    }
-+
-+  // Virtual member functions.
-+  template<typename _CharT>
-+    messages<_CharT>::~messages()
-+    { 
-+      if (_M_name_messages != _S_get_c_name())
-+      delete [] _M_name_messages;
-+      _S_destroy_c_locale(_M_c_locale_messages); 
-+    }
-+
-+  template<typename _CharT>
-+    typename messages<_CharT>::catalog 
-+    messages<_CharT>::do_open(const basic_string<char>& __s, 
-+                            const locale&) const
-+    { 
-+      // No error checking is done, assume the catalog exists and can
-+      // be used.
-+      __textdomain(__s.c_str());
-+      return 0;
-+    }
-+
-+  template<typename _CharT>
-+    void    
-+    messages<_CharT>::do_close(catalog) const 
-+    { }
-+
-+   // messages_byname
-+   template<typename _CharT>
-+     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
-+     : messages<_CharT>(__refs) 
-+     { 
-+       if (this->_M_name_messages != locale::facet::_S_get_c_name())
-+       delete [] this->_M_name_messages;
-+       char* __tmp = new char[std::strlen(__s) + 1];
-+       std::strcpy(__tmp, __s);
-+       this->_M_name_messages = __tmp;
-+
-+       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
-+       {
-+         this->_S_destroy_c_locale(this->_M_c_locale_messages);
-+         this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
-+       }
-+     }
-diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-3.4.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc
---- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc       1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc    2004-09-10 10:47:40.000000000 -0500
-@@ -0,0 +1,698 @@
-+// std::moneypunct implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#define _LIBC
-+#include <locale>
-+#undef _LIBC
-+#include <bits/c++locale_internal.h>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning optimize this for uclibc
-+#warning tailor for stub locale support
-+#endif
-+
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
-+#endif
-+
-+namespace std
-+{
-+  // Construct and return valid pattern consisting of some combination of:
-+  // space none symbol sign value
-+  money_base::pattern
-+  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
-+  { 
-+    pattern __ret;
-+
-+    // This insanely complicated routine attempts to construct a valid
-+    // pattern for use with monyepunct. A couple of invariants:
-+
-+    // if (__precedes) symbol -> value
-+    // else value -> symbol
-+    
-+    // if (__space) space
-+    // else none
-+
-+    // none == never first
-+    // space never first or last
-+
-+    // Any elegant implementations of this are welcome.
-+    switch (__posn)
-+      {
-+      case 0:
-+      case 1:
-+      // 1 The sign precedes the value and symbol.
-+      __ret.field[0] = sign;
-+      if (__space)
-+        {
-+          // Pattern starts with sign.
-+          if (__precedes)
-+            {
-+              __ret.field[1] = symbol;
-+              __ret.field[3] = value;
-+            }
-+          else
-+            {
-+              __ret.field[1] = value;
-+              __ret.field[3] = symbol;
-+            }
-+          __ret.field[2] = space;
-+        }
-+      else
-+        {
-+          // Pattern starts with sign and ends with none.
-+          if (__precedes)
-+            {
-+              __ret.field[1] = symbol;
-+              __ret.field[2] = value;
-+            }
-+          else
-+            {
-+              __ret.field[1] = value;
-+              __ret.field[2] = symbol;
-+            }
-+          __ret.field[3] = none;
-+        }
-+      break;
-+      case 2:
-+      // 2 The sign follows the value and symbol.
-+      if (__space)
-+        {
-+          // Pattern either ends with sign.
-+          if (__precedes)
-+            {
-+              __ret.field[0] = symbol;
-+              __ret.field[2] = value;
-+            }
-+          else
-+            {
-+              __ret.field[0] = value;
-+              __ret.field[2] = symbol;
-+            }
-+          __ret.field[1] = space;
-+          __ret.field[3] = sign;
-+        }
-+      else
-+        {
-+          // Pattern ends with sign then none.
-+          if (__precedes)
-+            {
-+              __ret.field[0] = symbol;
-+              __ret.field[1] = value;
-+            }
-+          else
-+            {
-+              __ret.field[0] = value;
-+              __ret.field[1] = symbol;
-+            }
-+          __ret.field[2] = sign;
-+          __ret.field[3] = none;
-+        }
-+      break;
-+      case 3:
-+      // 3 The sign immediately precedes the symbol.
-+      if (__precedes)
-+        {
-+          __ret.field[0] = sign;
-+          __ret.field[1] = symbol;        
-+          if (__space)
-+            {
-+              __ret.field[2] = space;
-+              __ret.field[3] = value;
-+            }
-+          else
-+            {
-+              __ret.field[2] = value;         
-+              __ret.field[3] = none;
-+            }
-+        }
-+      else
-+        {
-+          __ret.field[0] = value;
-+          if (__space)
-+            {
-+              __ret.field[1] = space;
-+              __ret.field[2] = sign;
-+              __ret.field[3] = symbol;
-+            }
-+          else
-+            {
-+              __ret.field[1] = sign;
-+              __ret.field[2] = symbol;
-+              __ret.field[3] = none;
-+            }
-+        }
-+      break;
-+      case 4:
-+      // 4 The sign immediately follows the symbol.
-+      if (__precedes)
-+        {
-+          __ret.field[0] = symbol;
-+          __ret.field[1] = sign;
-+          if (__space)
-+            {
-+              __ret.field[2] = space;
-+              __ret.field[3] = value;
-+            }
-+          else
-+            {
-+              __ret.field[2] = value;
-+              __ret.field[3] = none;
-+            }
-+        }
-+      else
-+        {
-+          __ret.field[0] = value;
-+          if (__space)
-+            {
-+              __ret.field[1] = space;
-+              __ret.field[2] = symbol;
-+              __ret.field[3] = sign;
-+            }
-+          else
-+            {
-+              __ret.field[1] = symbol;
-+              __ret.field[2] = sign;
-+              __ret.field[3] = none;
-+            }
-+        }
-+      break;
-+      default:
-+      ;
-+      }
-+    return __ret;
-+  }
-+
-+  template<> 
-+    void
-+    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
-+                                                   const char*)
-+    {
-+      if (!_M_data)
-+      _M_data = new __moneypunct_cache<char, true>;
-+
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_data->_M_decimal_point = '.';
-+        _M_data->_M_thousands_sep = ',';
-+        _M_data->_M_grouping = "";
-+        _M_data->_M_grouping_size = 0;
-+        _M_data->_M_curr_symbol = "";
-+        _M_data->_M_curr_symbol_size = 0;
-+        _M_data->_M_positive_sign = "";
-+        _M_data->_M_positive_sign_size = 0;
-+        _M_data->_M_negative_sign = "";
-+        _M_data->_M_negative_sign_size = 0;
-+        _M_data->_M_frac_digits = 0;
-+        _M_data->_M_pos_format = money_base::_S_default_pattern;
-+        _M_data->_M_neg_format = money_base::_S_default_pattern;
-+
-+        for (size_t __i = 0; __i < money_base::_S_end; ++__i)
-+          _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
-+      }
-+      else
-+      {
-+        // Named locale.
-+        _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
-+                                                      __cloc));
-+        _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
-+                                                      __cloc));
-+        _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
-+        _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
-+        _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
-+        _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
-+
-+        char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
-+        if (!__nposn)
-+          _M_data->_M_negative_sign = "()";
-+        else
-+          _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
-+                                                      __cloc);
-+        _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
-+
-+        // _Intl == true
-+        _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
-+        _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
-+        _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
-+                                                    __cloc));
-+        char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
-+        char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
-+        char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
-+        _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
-+                                                      __pposn);
-+        char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
-+        char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
-+        _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
-+                                                      __nposn);
-+      }
-+    }
-+
-+  template<> 
-+    void
-+    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
-+                                                    const char*)
-+    {
-+      if (!_M_data)
-+      _M_data = new __moneypunct_cache<char, false>;
-+
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_data->_M_decimal_point = '.';
-+        _M_data->_M_thousands_sep = ',';
-+        _M_data->_M_grouping = "";
-+        _M_data->_M_grouping_size = 0;
-+        _M_data->_M_curr_symbol = "";
-+        _M_data->_M_curr_symbol_size = 0;
-+        _M_data->_M_positive_sign = "";
-+        _M_data->_M_positive_sign_size = 0;
-+        _M_data->_M_negative_sign = "";
-+        _M_data->_M_negative_sign_size = 0;
-+        _M_data->_M_frac_digits = 0;
-+        _M_data->_M_pos_format = money_base::_S_default_pattern;
-+        _M_data->_M_neg_format = money_base::_S_default_pattern;
-+
-+        for (size_t __i = 0; __i < money_base::_S_end; ++__i)
-+          _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
-+      }
-+      else
-+      {
-+        // Named locale.
-+        _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
-+                                                      __cloc));
-+        _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
-+                                                      __cloc));
-+        _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
-+        _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
-+        _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
-+        _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
-+
-+        char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
-+        if (!__nposn)
-+          _M_data->_M_negative_sign = "()";
-+        else
-+          _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
-+                                                      __cloc);
-+        _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
-+
-+        // _Intl == false
-+        _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
-+        _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
-+        _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
-+        char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
-+        char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
-+        char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
-+        _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
-+                                                      __pposn);
-+        char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
-+        char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
-+        _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
-+                                                      __nposn);
-+      }
-+    }
-+
-+  template<> 
-+    moneypunct<char, true>::~moneypunct()
-+    { delete _M_data; }
-+
-+  template<> 
-+    moneypunct<char, false>::~moneypunct()
-+    { delete _M_data; }
-+
-+#ifdef _GLIBCXX_USE_WCHAR_T
-+  template<> 
-+    void
-+    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+                                                      const char*)
-+#else
-+                                                      const char* __name)
-+#endif
-+    {
-+      if (!_M_data)
-+      _M_data = new __moneypunct_cache<wchar_t, true>;
-+
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_data->_M_decimal_point = L'.';
-+        _M_data->_M_thousands_sep = L',';
-+        _M_data->_M_grouping = "";
-+        _M_data->_M_grouping_size = 0;
-+        _M_data->_M_curr_symbol = L"";
-+        _M_data->_M_curr_symbol_size = 0;
-+        _M_data->_M_positive_sign = L"";
-+        _M_data->_M_positive_sign_size = 0;
-+        _M_data->_M_negative_sign = L"";
-+        _M_data->_M_negative_sign_size = 0;
-+        _M_data->_M_frac_digits = 0;
-+        _M_data->_M_pos_format = money_base::_S_default_pattern;
-+        _M_data->_M_neg_format = money_base::_S_default_pattern;
-+
-+        // Use ctype::widen code without the facet...
-+        unsigned char uc;
-+        for (size_t __i = 0; __i < money_base::_S_end; ++__i)
-+          {
-+            uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
-+            _M_data->_M_atoms[__i] = btowc(uc);
-+          }
-+      }
-+      else
-+      {
-+        // Named locale.
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+        __c_locale __old = __uselocale(__cloc);
-+#else
-+        // Switch to named locale so that mbsrtowcs will work.
-+        char* __old = strdup(setlocale(LC_ALL, NULL));
-+        setlocale(LC_ALL, __name);
-+#endif
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix this... should be monetary
-+#endif
-+#ifdef __UCLIBC__
-+# ifdef __UCLIBC_HAS_XLOCALE__
-+        _M_data->_M_decimal_point = __cloc->decimal_point_wc;
-+        _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
-+# else
-+        _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
-+        _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
-+# endif
-+#else
-+        union __s_and_w { const char *__s; unsigned int __w; } __u;
-+        __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
-+        _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
-+
-+        __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
-+        _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
-+#endif
-+        _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
-+        _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
-+
-+        const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
-+        const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
-+        const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
-+
-+        wchar_t* __wcs_ps = 0;
-+        wchar_t* __wcs_ns = 0;
-+        const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
-+        try
-+          {
-+            mbstate_t __state;
-+            size_t __len = strlen(__cpossign);
-+            if (__len)
-+              {
-+                ++__len;
-+                memset(&__state, 0, sizeof(mbstate_t));
-+                __wcs_ps = new wchar_t[__len];
-+                mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
-+                _M_data->_M_positive_sign = __wcs_ps;
-+              }
-+            else
-+              _M_data->_M_positive_sign = L"";
-+            _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
-+            
-+            __len = strlen(__cnegsign);
-+            if (!__nposn)
-+              _M_data->_M_negative_sign = L"()";
-+            else if (__len)
-+              { 
-+                ++__len;
-+                memset(&__state, 0, sizeof(mbstate_t));
-+                __wcs_ns = new wchar_t[__len];
-+                mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
-+                _M_data->_M_negative_sign = __wcs_ns;
-+              }
-+            else
-+              _M_data->_M_negative_sign = L"";
-+            _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
-+            
-+            // _Intl == true.
-+            __len = strlen(__ccurr);
-+            if (__len)
-+              {
-+                ++__len;
-+                memset(&__state, 0, sizeof(mbstate_t));
-+                wchar_t* __wcs = new wchar_t[__len];
-+                mbsrtowcs(__wcs, &__ccurr, __len, &__state);
-+                _M_data->_M_curr_symbol = __wcs;
-+              }
-+            else
-+              _M_data->_M_curr_symbol = L"";
-+            _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
-+          }
-+        catch (...)
-+          {
-+            delete _M_data;
-+            _M_data = 0;
-+            delete __wcs_ps;
-+            delete __wcs_ns;        
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+            __uselocale(__old);
-+#else
-+            setlocale(LC_ALL, __old);
-+            free(__old);
-+#endif
-+            __throw_exception_again;
-+          } 
-+        
-+        _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
-+                                                    __cloc));
-+        char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
-+        char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
-+        char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
-+        _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
-+                                                      __pposn);
-+        char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
-+        char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
-+        _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
-+                                                      __nposn);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+        __uselocale(__old);
-+#else
-+        setlocale(LC_ALL, __old);
-+        free(__old);
-+#endif
-+      }
-+    }
-+
-+  template<> 
-+  void
-+  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+                                                     const char*)
-+#else
-+                                                       const char* __name)
-+#endif
-+  {
-+    if (!_M_data)
-+      _M_data = new __moneypunct_cache<wchar_t, false>;
-+
-+    if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_data->_M_decimal_point = L'.';
-+        _M_data->_M_thousands_sep = L',';
-+        _M_data->_M_grouping = "";
-+          _M_data->_M_grouping_size = 0;
-+        _M_data->_M_curr_symbol = L"";
-+        _M_data->_M_curr_symbol_size = 0;
-+        _M_data->_M_positive_sign = L"";
-+        _M_data->_M_positive_sign_size = 0;
-+        _M_data->_M_negative_sign = L"";
-+        _M_data->_M_negative_sign_size = 0;
-+        _M_data->_M_frac_digits = 0;
-+        _M_data->_M_pos_format = money_base::_S_default_pattern;
-+        _M_data->_M_neg_format = money_base::_S_default_pattern;
-+
-+        // Use ctype::widen code without the facet...
-+        unsigned char uc;
-+        for (size_t __i = 0; __i < money_base::_S_end; ++__i)
-+          {
-+            uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
-+            _M_data->_M_atoms[__i] = btowc(uc);
-+          }
-+      }
-+      else
-+      {
-+        // Named locale.
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+        __c_locale __old = __uselocale(__cloc);
-+#else
-+        // Switch to named locale so that mbsrtowcs will work.
-+        char* __old = strdup(setlocale(LC_ALL, NULL));
-+        setlocale(LC_ALL, __name);
-+#endif
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix this... should be monetary
-+#endif
-+#ifdef __UCLIBC__
-+# ifdef __UCLIBC_HAS_XLOCALE__
-+        _M_data->_M_decimal_point = __cloc->decimal_point_wc;
-+        _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
-+# else
-+        _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
-+        _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
-+# endif
-+#else
-+        union __s_and_w { const char *__s; unsigned int __w; } __u;
-+        __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
-+        _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
-+
-+        __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
-+        _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
-+#endif
-+        _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
-+          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
-+
-+        const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
-+        const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
-+        const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
-+
-+        wchar_t* __wcs_ps = 0;
-+        wchar_t* __wcs_ns = 0;
-+        const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
-+        try
-+            {
-+              mbstate_t __state;
-+              size_t __len;
-+              __len = strlen(__cpossign);
-+              if (__len)
-+                {
-+                ++__len;
-+                memset(&__state, 0, sizeof(mbstate_t));
-+                __wcs_ps = new wchar_t[__len];
-+                mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
-+                _M_data->_M_positive_sign = __wcs_ps;
-+              }
-+            else
-+              _M_data->_M_positive_sign = L"";
-+              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
-+            
-+            __len = strlen(__cnegsign);
-+            if (!__nposn)
-+              _M_data->_M_negative_sign = L"()";
-+            else if (__len)
-+              { 
-+                ++__len;
-+                memset(&__state, 0, sizeof(mbstate_t));
-+                __wcs_ns = new wchar_t[__len];
-+                mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
-+                _M_data->_M_negative_sign = __wcs_ns;
-+              }
-+            else
-+              _M_data->_M_negative_sign = L"";
-+              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
-+
-+            // _Intl == true.
-+            __len = strlen(__ccurr);
-+            if (__len)
-+              {
-+                ++__len;
-+                memset(&__state, 0, sizeof(mbstate_t));
-+                wchar_t* __wcs = new wchar_t[__len];
-+                mbsrtowcs(__wcs, &__ccurr, __len, &__state);
-+                _M_data->_M_curr_symbol = __wcs;
-+              }
-+            else
-+              _M_data->_M_curr_symbol = L"";
-+              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
-+          }
-+          catch (...)
-+          {
-+            delete _M_data;
-+              _M_data = 0;
-+            delete __wcs_ps;
-+            delete __wcs_ns;        
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+            __uselocale(__old);
-+#else
-+            setlocale(LC_ALL, __old);
-+            free(__old);
-+#endif
-+              __throw_exception_again;
-+          }
-+
-+        _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
-+        char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
-+        char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
-+        char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
-+        _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
-+                                                      __pposn);
-+        char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
-+        char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
-+        _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
-+                                                      __nposn);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+        __uselocale(__old);
-+#else
-+        setlocale(LC_ALL, __old);
-+        free(__old);
-+#endif
-+      }
-+    }
-+
-+  template<> 
-+    moneypunct<wchar_t, true>::~moneypunct()
-+    {
-+      if (_M_data->_M_positive_sign_size)
-+      delete [] _M_data->_M_positive_sign;
-+      if (_M_data->_M_negative_sign_size
-+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
-+      delete [] _M_data->_M_negative_sign;
-+      if (_M_data->_M_curr_symbol_size)
-+      delete [] _M_data->_M_curr_symbol;
-+      delete _M_data;
-+    }
-+
-+  template<> 
-+    moneypunct<wchar_t, false>::~moneypunct()
-+    {
-+      if (_M_data->_M_positive_sign_size)
-+      delete [] _M_data->_M_positive_sign;
-+      if (_M_data->_M_negative_sign_size
-+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
-+      delete [] _M_data->_M_negative_sign;
-+      if (_M_data->_M_curr_symbol_size)
-+      delete [] _M_data->_M_curr_symbol;
-+      delete _M_data;
-+    }
-+#endif
-+}
-diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-3.4.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc
---- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc        1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc     2004-09-10 10:47:40.000000000 -0500
-@@ -0,0 +1,183 @@
-+// std::numpunct implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#define _LIBC
-+#include <locale>
-+#undef _LIBC
-+#include <bits/c++locale_internal.h>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning tailor for stub locale support
-+#endif
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
-+#endif
-+
-+namespace std
-+{
-+  template<> 
-+    void
-+    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
-+    {
-+      if (!_M_data)
-+      _M_data = new __numpunct_cache<char>;
-+
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_data->_M_grouping = "";
-+        _M_data->_M_grouping_size = 0;
-+        _M_data->_M_use_grouping = false;
-+
-+        _M_data->_M_decimal_point = '.';
-+        _M_data->_M_thousands_sep = ',';
-+
-+        for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
-+          _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
-+
-+        for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
-+          _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
-+      }
-+      else
-+      {
-+        // Named locale.
-+        _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
-+                                                      __cloc));
-+        _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
-+                                                      __cloc));
-+
-+        // Check for NULL, which implies no grouping.
-+        if (_M_data->_M_thousands_sep == '\0')
-+          _M_data->_M_grouping = "";
-+        else
-+          _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
-+        _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
-+      }
-+
-+      // NB: There is no way to extact this info from posix locales.
-+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
-+      _M_data->_M_truename = "true";
-+      _M_data->_M_truename_size = strlen(_M_data->_M_truename);
-+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
-+      _M_data->_M_falsename = "false";
-+      _M_data->_M_falsename_size = strlen(_M_data->_M_falsename);
-+    }
-+ 
-+  template<> 
-+    numpunct<char>::~numpunct()
-+    { delete _M_data; }
-+   
-+#ifdef _GLIBCXX_USE_WCHAR_T
-+  template<> 
-+    void
-+    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
-+    {
-+      if (!_M_data)
-+      _M_data = new __numpunct_cache<wchar_t>;
-+
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_data->_M_grouping = "";
-+        _M_data->_M_grouping_size = 0;
-+        _M_data->_M_use_grouping = false;
-+
-+        _M_data->_M_decimal_point = L'.';
-+        _M_data->_M_thousands_sep = L',';
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+        __c_locale __old = __uselocale(_S_get_c_locale());
-+#endif
-+        // Use ctype::widen code without the facet...
-+        unsigned char uc;
-+        for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
-+          {
-+            uc = static_cast<unsigned char>(__num_base::_S_atoms_out[__i]);
-+            _M_data->_M_atoms_out[__i] = btowc(uc);
-+          }
-+
-+        for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
-+          {
-+            uc = static_cast<unsigned char>(__num_base::_S_atoms_in[__j]);
-+            _M_data->_M_atoms_in[__j] = btowc(uc);
-+          }
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+        __uselocale(__old);
-+#endif
-+      }
-+      else
-+      {
-+        // Named locale.
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix this
-+#endif
-+#ifdef __UCLIBC__
-+# ifdef __UCLIBC_HAS_XLOCALE__
-+        _M_data->_M_decimal_point = __cloc->decimal_point_wc;
-+        _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
-+# else
-+        _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
-+        _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
-+# endif
-+#else
-+        union __s_and_w { const char *__s; unsigned int __w; } __u;
-+        __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
-+        _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
-+
-+        __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
-+        _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
-+#endif
-+
-+        if (_M_data->_M_thousands_sep == L'\0')
-+          _M_data->_M_grouping = "";
-+        else
-+          _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
-+        _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
-+      }
-+
-+      // NB: There is no way to extact this info from posix locales.
-+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
-+      _M_data->_M_truename = L"true";
-+      _M_data->_M_truename_size = wcslen(_M_data->_M_truename);
-+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
-+      _M_data->_M_falsename = L"false";
-+      _M_data->_M_falsename_size = wcslen(_M_data->_M_falsename);
-+    }
-+
-+  template<> 
-+    numpunct<wchar_t>::~numpunct()
-+    { delete _M_data; }
-+ #endif
-+}
-diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-3.4.2/libstdc++-v3/config/locale/uclibc/time_members.cc
---- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/time_members.cc   1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/time_members.cc        2004-09-10 10:48:00.000000000 -0500
-@@ -0,0 +1,356 @@
-+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
-+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning tailor for stub locale support
-+#endif
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
-+#endif
-+
-+namespace std
-+{
-+  template<>
-+    void
-+    __timepunct<char>::
-+    _M_put(char* __s, size_t __maxlen, const char* __format, 
-+         const tm* __tm) const
-+    {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
-+                                      _M_c_locale_timepunct);
-+#else
-+      char* __old = strdup(setlocale(LC_ALL, NULL));
-+      setlocale(LC_ALL, _M_name_timepunct);
-+      const size_t __len = strftime(__s, __maxlen, __format, __tm);
-+      setlocale(LC_ALL, __old);
-+      free(__old);
-+#endif
-+      // Make sure __s is null terminated.
-+      if (__len == 0)
-+      __s[0] = '\0';
-+    }
-+
-+  template<> 
-+    void
-+    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
-+    {
-+      if (!_M_data)
-+      _M_data = new __timepunct_cache<char>;
-+
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_c_locale_timepunct = _S_get_c_locale();
-+
-+        _M_data->_M_date_format = "%m/%d/%y";
-+        _M_data->_M_date_era_format = "%m/%d/%y";
-+        _M_data->_M_time_format = "%H:%M:%S";
-+        _M_data->_M_time_era_format = "%H:%M:%S";
-+        _M_data->_M_date_time_format = "";
-+        _M_data->_M_date_time_era_format = "";
-+        _M_data->_M_am = "AM";
-+        _M_data->_M_pm = "PM";
-+        _M_data->_M_am_pm_format = "";
-+
-+        // Day names, starting with "C"'s Sunday.
-+        _M_data->_M_day1 = "Sunday";
-+        _M_data->_M_day2 = "Monday";
-+        _M_data->_M_day3 = "Tuesday";
-+        _M_data->_M_day4 = "Wednesday";
-+        _M_data->_M_day5 = "Thursday";
-+        _M_data->_M_day6 = "Friday";
-+        _M_data->_M_day7 = "Saturday";
-+
-+        // Abbreviated day names, starting with "C"'s Sun.
-+        _M_data->_M_aday1 = "Sun";
-+        _M_data->_M_aday2 = "Mon";
-+        _M_data->_M_aday3 = "Tue";
-+        _M_data->_M_aday4 = "Wed";
-+        _M_data->_M_aday5 = "Thu";
-+        _M_data->_M_aday6 = "Fri";
-+        _M_data->_M_aday7 = "Sat";
-+
-+        // Month names, starting with "C"'s January.
-+        _M_data->_M_month01 = "January";
-+        _M_data->_M_month02 = "February";
-+        _M_data->_M_month03 = "March";
-+        _M_data->_M_month04 = "April";
-+        _M_data->_M_month05 = "May";
-+        _M_data->_M_month06 = "June";
-+        _M_data->_M_month07 = "July";
-+        _M_data->_M_month08 = "August";
-+        _M_data->_M_month09 = "September";
-+        _M_data->_M_month10 = "October";
-+        _M_data->_M_month11 = "November";
-+        _M_data->_M_month12 = "December";
-+
-+        // Abbreviated month names, starting with "C"'s Jan.
-+        _M_data->_M_amonth01 = "Jan";
-+        _M_data->_M_amonth02 = "Feb";
-+        _M_data->_M_amonth03 = "Mar";
-+        _M_data->_M_amonth04 = "Apr";
-+        _M_data->_M_amonth05 = "May";
-+        _M_data->_M_amonth06 = "Jun";
-+        _M_data->_M_amonth07 = "Jul";
-+        _M_data->_M_amonth08 = "Aug";
-+        _M_data->_M_amonth09 = "Sep";
-+        _M_data->_M_amonth10 = "Oct";
-+        _M_data->_M_amonth11 = "Nov";
-+        _M_data->_M_amonth12 = "Dec";
-+      }
-+      else
-+      {
-+        _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
-+
-+        _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
-+        _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
-+        _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
-+        _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
-+        _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
-+        _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, __cloc);
-+        _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
-+        _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
-+        _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
-+
-+        // Day names, starting with "C"'s Sunday.
-+        _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
-+        _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
-+        _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
-+        _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
-+        _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
-+        _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
-+        _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
-+
-+        // Abbreviated day names, starting with "C"'s Sun.
-+        _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
-+        _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
-+        _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
-+        _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
-+        _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
-+        _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
-+        _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
-+
-+        // Month names, starting with "C"'s January.
-+        _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
-+        _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
-+        _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
-+        _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
-+        _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
-+        _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
-+        _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
-+        _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
-+        _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
-+        _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
-+        _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
-+        _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
-+
-+        // Abbreviated month names, starting with "C"'s Jan.
-+        _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
-+        _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
-+        _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
-+        _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
-+        _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
-+        _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
-+        _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
-+        _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
-+        _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
-+        _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
-+        _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
-+        _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
-+      }
-+    }
-+
-+#ifdef _GLIBCXX_USE_WCHAR_T
-+  template<>
-+    void
-+    __timepunct<wchar_t>::
-+    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
-+         const tm* __tm) const
-+    {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
-+      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
-+                                      _M_c_locale_timepunct);
-+#else
-+      char* __old = strdup(setlocale(LC_ALL, NULL));
-+      setlocale(LC_ALL, _M_name_timepunct);
-+      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
-+      setlocale(LC_ALL, __old);
-+      free(__old);
-+#endif
-+      // Make sure __s is null terminated.
-+      if (__len == 0)
-+      __s[0] = L'\0';
-+    }
-+
-+  template<> 
-+    void
-+    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
-+    {
-+      if (!_M_data)
-+      _M_data = new __timepunct_cache<wchar_t>;
-+
-+#warning wide time stuff
-+//       if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_c_locale_timepunct = _S_get_c_locale();
-+
-+        _M_data->_M_date_format = L"%m/%d/%y";
-+        _M_data->_M_date_era_format = L"%m/%d/%y";
-+        _M_data->_M_time_format = L"%H:%M:%S";
-+        _M_data->_M_time_era_format = L"%H:%M:%S";
-+        _M_data->_M_date_time_format = L"";
-+        _M_data->_M_date_time_era_format = L"";
-+        _M_data->_M_am = L"AM";
-+        _M_data->_M_pm = L"PM";
-+        _M_data->_M_am_pm_format = L"";
-+
-+        // Day names, starting with "C"'s Sunday.
-+        _M_data->_M_day1 = L"Sunday";
-+        _M_data->_M_day2 = L"Monday";
-+        _M_data->_M_day3 = L"Tuesday";
-+        _M_data->_M_day4 = L"Wednesday";
-+        _M_data->_M_day5 = L"Thursday";
-+        _M_data->_M_day6 = L"Friday";
-+        _M_data->_M_day7 = L"Saturday";
-+
-+        // Abbreviated day names, starting with "C"'s Sun.
-+        _M_data->_M_aday1 = L"Sun";
-+        _M_data->_M_aday2 = L"Mon";
-+        _M_data->_M_aday3 = L"Tue";
-+        _M_data->_M_aday4 = L"Wed";
-+        _M_data->_M_aday5 = L"Thu";
-+        _M_data->_M_aday6 = L"Fri";
-+        _M_data->_M_aday7 = L"Sat";
-+
-+        // Month names, starting with "C"'s January.
-+        _M_data->_M_month01 = L"January";
-+        _M_data->_M_month02 = L"February";
-+        _M_data->_M_month03 = L"March";
-+        _M_data->_M_month04 = L"April";
-+        _M_data->_M_month05 = L"May";
-+        _M_data->_M_month06 = L"June";
-+        _M_data->_M_month07 = L"July";
-+        _M_data->_M_month08 = L"August";
-+        _M_data->_M_month09 = L"September";
-+        _M_data->_M_month10 = L"October";
-+        _M_data->_M_month11 = L"November";
-+        _M_data->_M_month12 = L"December";
-+
-+        // Abbreviated month names, starting with "C"'s Jan.
-+        _M_data->_M_amonth01 = L"Jan";
-+        _M_data->_M_amonth02 = L"Feb";
-+        _M_data->_M_amonth03 = L"Mar";
-+        _M_data->_M_amonth04 = L"Apr";
-+        _M_data->_M_amonth05 = L"May";
-+        _M_data->_M_amonth06 = L"Jun";
-+        _M_data->_M_amonth07 = L"Jul";
-+        _M_data->_M_amonth08 = L"Aug";
-+        _M_data->_M_amonth09 = L"Sep";
-+        _M_data->_M_amonth10 = L"Oct";
-+        _M_data->_M_amonth11 = L"Nov";
-+        _M_data->_M_amonth12 = L"Dec";
-+      }
-+#if 0
-+      else
-+      {
-+        _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
-+
-+        _M_data->_M_date_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_FMT, __cloc));
-+        _M_data->_M_date_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_FMT, __cloc));
-+        _M_data->_M_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT, __cloc));
-+        _M_data->_M_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_T_FMT, __cloc));
-+        _M_data->_M_date_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_T_FMT, __cloc));
-+        _M_data->_M_date_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc));
-+        _M_data->_M_am = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WAM_STR, __cloc));
-+        _M_data->_M_pm = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WPM_STR, __cloc));
-+        _M_data->_M_am_pm_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc));
-+
-+        // Day names, starting with "C"'s Sunday.
-+        _M_data->_M_day1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_1, __cloc));
-+        _M_data->_M_day2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_2, __cloc));
-+        _M_data->_M_day3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_3, __cloc));
-+        _M_data->_M_day4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_4, __cloc));
-+        _M_data->_M_day5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_5, __cloc));
-+        _M_data->_M_day6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_6, __cloc));
-+        _M_data->_M_day7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_7, __cloc));
-+
-+        // Abbreviated day names, starting with "C"'s Sun.
-+        _M_data->_M_aday1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_1, __cloc));
-+        _M_data->_M_aday2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_2, __cloc));
-+        _M_data->_M_aday3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_3, __cloc));
-+        _M_data->_M_aday4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_4, __cloc));
-+        _M_data->_M_aday5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_5, __cloc));
-+        _M_data->_M_aday6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_6, __cloc));
-+        _M_data->_M_aday7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_7, __cloc));
-+
-+        // Month names, starting with "C"'s January.
-+        _M_data->_M_month01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_1, __cloc));
-+        _M_data->_M_month02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_2, __cloc));
-+        _M_data->_M_month03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_3, __cloc));
-+        _M_data->_M_month04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_4, __cloc));
-+        _M_data->_M_month05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_5, __cloc));
-+        _M_data->_M_month06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_6, __cloc));
-+        _M_data->_M_month07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_7, __cloc));
-+        _M_data->_M_month08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_8, __cloc));
-+        _M_data->_M_month09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_9, __cloc));
-+        _M_data->_M_month10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_10, __cloc));
-+        _M_data->_M_month11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_11, __cloc));
-+        _M_data->_M_month12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_12, __cloc));
-+
-+        // Abbreviated month names, starting with "C"'s Jan.
-+        _M_data->_M_amonth01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_1, __cloc));
-+        _M_data->_M_amonth02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_2, __cloc));
-+        _M_data->_M_amonth03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_3, __cloc));
-+        _M_data->_M_amonth04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_4, __cloc));
-+        _M_data->_M_amonth05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_5, __cloc));
-+        _M_data->_M_amonth06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_6, __cloc));
-+        _M_data->_M_amonth07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_7, __cloc));
-+        _M_data->_M_amonth08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_8, __cloc));
-+        _M_data->_M_amonth09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_9, __cloc));
-+        _M_data->_M_amonth10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_10, __cloc));
-+        _M_data->_M_amonth11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_11, __cloc));
-+        _M_data->_M_amonth12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_12, __cloc));
-+      }
-+#endif // 0
-+    }
-+#endif
-+}
-diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/time_members.h gcc-3.4.2/libstdc++-v3/config/locale/uclibc/time_members.h
---- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/time_members.h    1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/time_members.h 2004-09-10 10:47:40.000000000 -0500
-@@ -0,0 +1,68 @@
-+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
-+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+  template<typename _CharT>
-+    __timepunct<_CharT>::__timepunct(size_t __refs) 
-+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
-+    _M_name_timepunct(_S_get_c_name())
-+    { _M_initialize_timepunct(); }
-+
-+  template<typename _CharT>
-+    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
-+    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
-+    _M_name_timepunct(_S_get_c_name())
-+    { _M_initialize_timepunct(); }
-+
-+  template<typename _CharT>
-+    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
-+                                   size_t __refs) 
-+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
-+    _M_name_timepunct(__s)
-+    { 
-+      char* __tmp = new char[std::strlen(__s) + 1];
-+      std::strcpy(__tmp, __s);
-+      _M_name_timepunct = __tmp;
-+      _M_initialize_timepunct(__cloc); 
-+    }
-+
-+  template<typename _CharT>
-+    __timepunct<_CharT>::~__timepunct()
-+    { 
-+      if (_M_name_timepunct != _S_get_c_name())
-+      delete [] _M_name_timepunct;
-+      delete _M_data; 
-+      _S_destroy_c_locale(_M_c_locale_timepunct); 
-+    }
-diff -urN gcc-3.4.2-dist/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-3.4.2/libstdc++-v3/config/os/uclibc/ctype_base.h
---- gcc-3.4.2-dist/libstdc++-v3/config/os/uclibc/ctype_base.h  1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.4.2/libstdc++-v3/config/os/uclibc/ctype_base.h       2004-09-10 10:47:40.000000000 -0500
-@@ -0,0 +1,58 @@
-+// Locale support -*- C++ -*-
-+
-+// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003
-+// Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.1  Locales
-+//
-+  
-+// Information as gleaned from /usr/include/ctype.h
-+  
-+  struct ctype_base
-+  {
-+    // Note: In uClibc, the following two types depend on configuration.
-+ 
-+    // Non-standard typedefs.
-+    typedef const __ctype_touplow_t* __to_type;
-+
-+    // NB: Offsets into ctype<char>::_M_table force a particular size
-+    // on the mask type. Because of this, we don't use an enum.
-+    typedef __ctype_mask_t    mask;   
-+    static const mask upper           = _ISupper;
-+    static const mask lower   = _ISlower;
-+    static const mask alpha   = _ISalpha;
-+    static const mask digit   = _ISdigit;
-+    static const mask xdigit  = _ISxdigit;
-+    static const mask space   = _ISspace;
-+    static const mask print   = _ISprint;
-+    static const mask graph   = _ISalpha | _ISdigit | _ISpunct;
-+    static const mask cntrl   = _IScntrl;
-+    static const mask punct   = _ISpunct;
-+    static const mask alnum   = _ISalpha | _ISdigit;
-+  };
-diff -urN gcc-3.4.2-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-3.4.2/libstdc++-v3/config/os/uclibc/ctype_inline.h
---- gcc-3.4.2-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h        1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.4.2/libstdc++-v3/config/os/uclibc/ctype_inline.h     2004-09-10 10:47:40.000000000 -0500
-@@ -0,0 +1,69 @@
-+// Locale support -*- C++ -*-
-+
-+// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.1  Locales
-+//
-+  
-+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
-+// functions go in ctype.cc
-+  
-+  bool
-+  ctype<char>::
-+  is(mask __m, char __c) const
-+  { return _M_table[static_cast<unsigned char>(__c)] & __m; }
-+
-+  const char*
-+  ctype<char>::
-+  is(const char* __low, const char* __high, mask* __vec) const
-+  {
-+    while (__low < __high)
-+      *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
-+    return __high;
-+  }
-+
-+  const char*
-+  ctype<char>::
-+  scan_is(mask __m, const char* __low, const char* __high) const
-+  {
-+    while (__low < __high 
-+         && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
-+      ++__low;
-+    return __low;
-+  }
-+
-+  const char*
-+  ctype<char>::
-+  scan_not(mask __m, const char* __low, const char* __high) const
-+  {
-+    while (__low < __high 
-+         && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
-+      ++__low;
-+    return __low;
-+  }
-diff -urN gcc-3.4.2-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-3.4.2/libstdc++-v3/config/os/uclibc/ctype_noninline.h
---- gcc-3.4.2-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h     1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.4.2/libstdc++-v3/config/os/uclibc/ctype_noninline.h  2004-09-10 10:47:40.000000000 -0500
-@@ -0,0 +1,92 @@
-+// Locale support -*- C++ -*-
-+
-+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
-+// Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.1  Locales
-+//
-+  
-+// Information as gleaned from /usr/include/ctype.h
-+
-+  const ctype_base::mask*
-+  ctype<char>::classic_table() throw()
-+  { return __C_ctype_b; }
-+
-+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
-+                   size_t __refs) 
-+  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
-+  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
-+  {
-+    _M_toupper = __C_ctype_toupper;
-+    _M_tolower = __C_ctype_tolower;
-+    _M_table = __table ? __table : __C_ctype_b;
-+    memset(_M_widen, 0, sizeof(_M_widen));
-+    memset(_M_narrow, 0, sizeof(_M_narrow));
-+  }
-+
-+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
-+  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
-+  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
-+  {
-+    _M_toupper = __C_ctype_toupper;
-+    _M_tolower = __C_ctype_tolower;
-+    _M_table = __table ? __table : __C_ctype_b;
-+    memset(_M_widen, 0, sizeof(_M_widen));
-+    memset(_M_narrow, 0, sizeof(_M_narrow));
-+  }
-+
-+  char
-+  ctype<char>::do_toupper(char __c) const
-+  { return _M_toupper[static_cast<unsigned char>(__c)]; }
-+
-+  const char*
-+  ctype<char>::do_toupper(char* __low, const char* __high) const
-+  {
-+    while (__low < __high)
-+      {
-+      *__low = _M_toupper[static_cast<unsigned char>(*__low)];
-+      ++__low;
-+      }
-+    return __high;
-+  }
-+
-+  char
-+  ctype<char>::do_tolower(char __c) const
-+  { return _M_tolower[static_cast<unsigned char>(__c)]; }
-+
-+  const char* 
-+  ctype<char>::do_tolower(char* __low, const char* __high) const
-+  {
-+    while (__low < __high)
-+      {
-+      *__low = _M_tolower[static_cast<unsigned char>(*__low)];
-+      ++__low;
-+      }
-+    return __high;
-+  }
-diff -urN gcc-3.4.2-dist/libstdc++-v3/config/os/uclibc/os_defines.h gcc-3.4.2/libstdc++-v3/config/os/uclibc/os_defines.h
---- gcc-3.4.2-dist/libstdc++-v3/config/os/uclibc/os_defines.h  1969-12-31 18:00:00.000000000 -0600
-+++ gcc-3.4.2/libstdc++-v3/config/os/uclibc/os_defines.h       2004-09-10 10:47:40.000000000 -0500
-@@ -0,0 +1,44 @@
-+// Specific definitions for GNU/Linux  -*- C++ -*-
-+
-+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+#ifndef _GLIBCXX_OS_DEFINES
-+#define _GLIBCXX_OS_DEFINES 1
-+
-+// System-specific #define, typedefs, corrections, etc, go here.  This
-+// file will come before all others.
-+
-+// This keeps isanum, et al from being propagated as macros.
-+#define __NO_CTYPE 1
-+
-+#include <features.h>
-+
-+// We must not see the optimized string functions GNU libc defines.
-+#define __NO_STRING_INLINES
-+
-+#endif
-diff -urN gcc-3.4.2-dist/libstdc++-v3/configure gcc-3.4.2/libstdc++-v3/configure
---- gcc-3.4.2-dist/libstdc++-v3/configure      2004-08-13 15:44:04.000000000 -0500
-+++ gcc-3.4.2/libstdc++-v3/configure   2004-09-10 10:47:40.000000000 -0500
-@@ -3878,6 +3878,11 @@
-   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd*)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -5545,6 +5550,9 @@
-   # Default to "generic".
-   if test $enable_clocale_flag = auto; then
-     case x${target_os} in
-+      xlinux-uclibc*)
-+      enable_clocale_flag=uclibc
-+      ;;
-       xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
-         cat >conftest.$ac_ext <<_ACEOF
- #line $LINENO "configure"
-@@ -5759,6 +5767,77 @@
-       CTIME_CC=config/locale/generic/time_members.cc
-       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
-       ;;
-+    uclibc)
-+      echo "$as_me:$LINENO: result: uclibc" >&5
-+echo "${ECHO_T}uclibc" >&6
-+
-+      # Declare intention to use gettext, and add support for specific
-+      # languages.
-+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
-+      ALL_LINGUAS="de fr"
-+
-+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
-+      # Extract the first word of "msgfmt", so it can be a program name with args.
-+set dummy msgfmt; ac_word=$2
-+echo "$as_me:$LINENO: checking for $ac_word" >&5
-+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-+if test "${ac_cv_prog_check_msgfmt+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  if test -n "$check_msgfmt"; then
-+  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+  for ac_exec_ext in '' $ac_executable_extensions; do
-+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    ac_cv_prog_check_msgfmt="yes"
-+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+done
-+
-+  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
-+fi
-+fi
-+check_msgfmt=$ac_cv_prog_check_msgfmt
-+if test -n "$check_msgfmt"; then
-+  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
-+echo "${ECHO_T}$check_msgfmt" >&6
-+else
-+  echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
-+fi
-+
-+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
-+        USE_NLS=yes
-+      fi
-+      # Export the build objects.
-+      for ling in $ALL_LINGUAS; do \
-+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
-+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
-+      done
-+
-+
-+
-+      CLOCALE_H=config/locale/uclibc/c_locale.h
-+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
-+      CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
-+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
-+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
-+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
-+      CMESSAGES_H=config/locale/uclibc/messages_members.h
-+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
-+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
-+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
-+      CTIME_H=config/locale/uclibc/time_members.h
-+      CTIME_CC=config/locale/uclibc/time_members.cc
-+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
-+      ;;
-   esac
-   # This is where the testsuite looks for locale catalogs, using the
-diff -urN gcc-3.4.2-dist/libstdc++-v3/configure.host gcc-3.4.2/libstdc++-v3/configure.host
---- gcc-3.4.2-dist/libstdc++-v3/configure.host 2004-08-27 14:52:30.000000000 -0500
-+++ gcc-3.4.2/libstdc++-v3/configure.host      2004-09-10 10:47:40.000000000 -0500
-@@ -217,6 +217,12 @@
-     ;;
- esac
-+# Override for uClibc since linux-uclibc gets mishandled above.
-+case "${host_os}" in
-+  *-uclibc*)
-+    os_include_dir="os/uclibc"
-+    ;;
-+esac
- # Set any OS-dependent and CPU-dependent bits.
- # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
-diff -urN gcc-3.4.2-dist/libstdc++-v3/crossconfig.m4 gcc-3.4.2/libstdc++-v3/crossconfig.m4
---- gcc-3.4.2-dist/libstdc++-v3/crossconfig.m4 2004-07-06 20:23:49.000000000 -0500
-+++ gcc-3.4.2/libstdc++-v3/crossconfig.m4      2004-09-10 10:47:40.000000000 -0500
-@@ -138,6 +138,99 @@
-       ;;
-     esac
-     ;;
-+  *-uclibc*)
-+# Temporary hack until we implement the float versions of the libm funcs
-+    AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
-+      machine/endian.h machine/param.h sys/machine.h sys/types.h \
-+      fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
-+    SECTION_FLAGS='-ffunction-sections -fdata-sections'
-+    AC_SUBST(SECTION_FLAGS)
-+    GLIBCXX_CHECK_LINKER_FEATURES
-+    GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
-+    GLIBCXX_CHECK_WCHAR_T_SUPPORT
-+
-+    # For LFS.
-+    AC_DEFINE(HAVE_INT64_T)
-+    case "$target" in
-+      *-uclinux*)
-+        # Don't enable LFS with uClinux
-+        ;;
-+      *)
-+        AC_DEFINE(_GLIBCXX_USE_LFS)
-+    esac
-+
-+    # For showmanyc_helper().
-+    AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
-+    GLIBCXX_CHECK_POLL
-+    GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
-+
-+    # For xsputn_2().
-+    AC_CHECK_HEADERS(sys/uio.h)
-+    GLIBCXX_CHECK_WRITEV
-+
-+#     AC_DEFINE(HAVE_ACOSF)
-+#     AC_DEFINE(HAVE_ASINF)
-+#     AC_DEFINE(HAVE_ATANF)
-+#     AC_DEFINE(HAVE_ATAN2F)
-+    AC_DEFINE(HAVE_CEILF)
-+    AC_DEFINE(HAVE_COPYSIGN)
-+#     AC_DEFINE(HAVE_COPYSIGNF)
-+#     AC_DEFINE(HAVE_COSF)
-+#     AC_DEFINE(HAVE_COSHF)
-+#     AC_DEFINE(HAVE_EXPF)
-+#     AC_DEFINE(HAVE_FABSF)
-+    AC_DEFINE(HAVE_FINITE)
-+    AC_DEFINE(HAVE_FINITEF)
-+    AC_DEFINE(HAVE_FLOORF)
-+#     AC_DEFINE(HAVE_FMODF)
-+#     AC_DEFINE(HAVE_FREXPF)
-+    AC_DEFINE(HAVE_HYPOT)
-+#     AC_DEFINE(HAVE_HYPOTF)
-+    AC_DEFINE(HAVE_ISINF)
-+    AC_DEFINE(HAVE_ISINFF)
-+    AC_DEFINE(HAVE_ISNAN)
-+    AC_DEFINE(HAVE_ISNANF)
-+#     AC_DEFINE(HAVE_LOGF)
-+#     AC_DEFINE(HAVE_LOG10F)
-+#     AC_DEFINE(HAVE_MODFF)
-+#     AC_DEFINE(HAVE_SINF)
-+#     AC_DEFINE(HAVE_SINHF)
-+#     AC_DEFINE(HAVE_SINCOS)
-+#     AC_DEFINE(HAVE_SINCOSF)
-+    AC_DEFINE(HAVE_SQRTF)
-+#     AC_DEFINE(HAVE_TANF)
-+#     AC_DEFINE(HAVE_TANHF)
-+    if test x"long_double_math_on_this_cpu" = x"yes"; then
-+      AC_MSG_ERROR([long_double_math_on_this_cpu is yes!])
-+#       AC_DEFINE(HAVE_ACOSL)
-+#       AC_DEFINE(HAVE_ASINL)
-+#       AC_DEFINE(HAVE_ATANL)
-+#       AC_DEFINE(HAVE_ATAN2L)
-+#       AC_DEFINE(HAVE_CEILL)
-+#       AC_DEFINE(HAVE_COPYSIGNL)
-+#       AC_DEFINE(HAVE_COSL)
-+#       AC_DEFINE(HAVE_COSHL)
-+#       AC_DEFINE(HAVE_EXPL)
-+#       AC_DEFINE(HAVE_FABSL)
-+#       AC_DEFINE(HAVE_FINITEL)
-+#       AC_DEFINE(HAVE_FLOORL)
-+#       AC_DEFINE(HAVE_FMODL)
-+#       AC_DEFINE(HAVE_FREXPL)
-+#       AC_DEFINE(HAVE_HYPOTL)
-+#       AC_DEFINE(HAVE_ISINFL)
-+#       AC_DEFINE(HAVE_ISNANL)
-+#       AC_DEFINE(HAVE_LOGL)
-+#       AC_DEFINE(HAVE_LOG10L)
-+#       AC_DEFINE(HAVE_MODFL)
-+#       AC_DEFINE(HAVE_POWL)
-+#       AC_DEFINE(HAVE_SINL)
-+#       AC_DEFINE(HAVE_SINHL)
-+#       AC_DEFINE(HAVE_SINCOSL)
-+#       AC_DEFINE(HAVE_SQRTL)
-+#       AC_DEFINE(HAVE_TANL)
-+#       AC_DEFINE(HAVE_TANHL)
-+    fi
-+    ;;
-   *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
-     AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
-       machine/endian.h machine/param.h sys/machine.h sys/types.h \
-@@ -152,7 +245,7 @@
-     AC_DEFINE(HAVE_INT64_T)
-     case "$target" in
-       *-uclinux*)
--        # Don't enable LFS with uClibc
-+        # Don't enable LFS with uClinux
-         ;;
-       *)
-         AC_DEFINE(_GLIBCXX_USE_LFS)
-diff -urN gcc-3.4.2-dist/libstdc++-v3/include/c_compatibility/wchar.h gcc-3.4.2/libstdc++-v3/include/c_compatibility/wchar.h
---- gcc-3.4.2-dist/libstdc++-v3/include/c_compatibility/wchar.h        2003-12-08 21:51:45.000000000 -0600
-+++ gcc-3.4.2/libstdc++-v3/include/c_compatibility/wchar.h     2004-09-10 10:47:40.000000000 -0500
-@@ -101,7 +101,9 @@
- using std::wmemcpy;
- using std::wmemmove;
- using std::wmemset;
-+#if _GLIBCXX_HAVE_WCSFTIME
- using std::wcsftime;
-+#endif
- #if _GLIBCXX_USE_C99
- using std::wcstold;
-diff -urN gcc-3.4.2-dist/libstdc++-v3/include/c_std/std_cwchar.h gcc-3.4.2/libstdc++-v3/include/c_std/std_cwchar.h
---- gcc-3.4.2-dist/libstdc++-v3/include/c_std/std_cwchar.h     2004-07-20 03:52:12.000000000 -0500
-+++ gcc-3.4.2/libstdc++-v3/include/c_std/std_cwchar.h  2004-09-10 10:47:40.000000000 -0500
-@@ -179,7 +179,9 @@
-   using ::wcscoll;
-   using ::wcscpy;
-   using ::wcscspn;
-+#if _GLIBCXX_HAVE_WCSFTIME
-   using ::wcsftime;
-+#endif
-   using ::wcslen;
-   using ::wcsncat;
-   using ::wcsncmp;
diff --git a/openwrt/toolchain/gcc/3.4.3/300-libstdc++-pic.patch b/openwrt/toolchain/gcc/3.4.3/300-libstdc++-pic.patch
deleted file mode 100644 (file)
index c030ba6..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-# DP: Build and install libstdc++_pic.a library.
-
---- gcc/libstdc++-v3/src/Makefile.am~  2003-02-28 09:21:05.000000000 +0100
-+++ gcc/libstdc++-v3/src/Makefile.am   2003-02-28 09:28:50.000000000 +0100
-@@ -224,6 +224,10 @@
-         @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
-+install-exec-local:
-+      $(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
-+      $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
-+
- # Added bits to build debug library.
- if GLIBCPP_BUILD_DEBUG
- all-local: build_debug
-
---- gcc/libstdc++-v3/src/Makefile.in~  2004-02-21 09:55:48.000000000 +0100
-+++ gcc/libstdc++-v3/src/Makefile.in   2004-02-21 09:59:34.000000000 +0100
-@@ -585,7 +585,7 @@
- install-data-am: install-data-local
--install-exec-am: install-toolexeclibLTLIBRARIES
-+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
- install-info: install-info-am
-@@ -618,6 +618,7 @@
-       distclean-tags distdir dvi dvi-am info info-am install \
-       install-am install-data install-data-am install-data-local \
-       install-exec install-exec-am install-info install-info-am \
-+      install-exec-local \
-       install-man install-strip install-toolexeclibLTLIBRARIES \
-       installcheck installcheck-am installdirs maintainer-clean \
-       maintainer-clean-generic mostlyclean mostlyclean-compile \
-@@ -707,6 +708,11 @@
- install_debug:
-       (cd ${debugdir} && $(MAKE) \
-       toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
-+
-+install-exec-local:
-+      $(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
-+      $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
-+
- # Tell versions [3.59,3.63) of GNU make to not export all variables.
- # Otherwise a system limit (for SysV at least) may be exceeded.
- .NOEXPORT:
diff --git a/openwrt/toolchain/gcc/3.4.3/600-gcc34-arm-ldm-peephole.patch b/openwrt/toolchain/gcc/3.4.3/600-gcc34-arm-ldm-peephole.patch
deleted file mode 100644 (file)
index fb317e1..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
---- gcc-3.4.0/gcc/config/arm/arm.md.arm-ldm-peephole   2004-01-13 08:24:37.000000000 -0500
-+++ gcc-3.4.0/gcc/config/arm/arm.md    2004-04-24 18:18:04.000000000 -0400
-@@ -8810,13 +8810,16 @@
-    (set_attr "length" "4,8,8")]
- )
-+; Try to convert LDR+LDR+arith into [add+]LDM+arith
-+; On XScale, LDM is always slower than two LDRs, so only do this if
-+; optimising for size.
- (define_insn "*arith_adjacentmem"
-   [(set (match_operand:SI 0 "s_register_operand" "=r")
-       (match_operator:SI 1 "shiftable_operator"
-        [(match_operand:SI 2 "memory_operand" "m")
-         (match_operand:SI 3 "memory_operand" "m")]))
-    (clobber (match_scratch:SI 4 "=r"))]
--  "TARGET_ARM && adjacent_mem_locations (operands[2], operands[3])"
-+  "TARGET_ARM && (!arm_tune_xscale || optimize_size) && adjacent_mem_locations (operands[2], operands[3])"
-   "*
-   {
-     rtx ldm[3];
-@@ -8851,6 +8854,8 @@
-       }
-    if (val1 && val2)
-       {
-+      /* This would be a loss on a Harvard core, but adjacent_mem_locations()
-+         will prevent it from happening.  */
-       rtx ops[3];
-       ldm[0] = ops[0] = operands[4];
-       ops[1] = XEXP (XEXP (operands[2], 0), 0);
---- gcc-3.4.0/gcc/config/arm/arm.c.arm-ldm-peephole    2004-04-24 18:16:25.000000000 -0400
-+++ gcc-3.4.0/gcc/config/arm/arm.c     2004-04-24 18:18:04.000000000 -0400
-@@ -4593,8 +4593,11 @@
-        arith_adjacentmem pattern to output an overlong sequence.  */
-       if (!const_ok_for_op (PLUS, val0) || !const_ok_for_op (PLUS, val1))
-       return 0;
--      
--      return (reg0 == reg1) && ((val1 - val0) == 4 || (val0 - val1) == 4);
-+
-+      /* For Harvard cores, only accept pairs where one offset is zero.
-+         See comment in load_multiple_sequence.  */
-+      return (reg0 == reg1) && ((val1 - val0) == 4 || (val0 - val1) == 4)
-+      && (!arm_ld_sched || val0 == 0 || val1 == 0);
-     }
-   return 0;
- }
-@@ -4838,6 +4841,11 @@
-       *load_offset = unsorted_offsets[order[0]];
-     }
-+  /* For XScale a two-word LDM is a performance loss, so only do this if
-+     size is more important.  See comments in arm_gen_load_multiple.  */
-+  if (nops == 2 && arm_tune_xscale && !optimize_size)
-+    return 0;
-+
-   if (unsorted_offsets[order[0]] == 0)
-     return 1; /* ldmia */
-@@ -5064,6 +5072,11 @@
-       *load_offset = unsorted_offsets[order[0]];
-     }
-+  /* For XScale a two-word LDM is a performance loss, so only do this if
-+     size is more important.  See comments in arm_gen_load_multiple.  */
-+  if (nops == 2 && arm_tune_xscale && !optimize_size)
-+    return 0;
-+
-   if (unsorted_offsets[order[0]] == 0)
-     return 1; /* stmia */
---- gcc-3.4.0/gcc/genpeep.c.arm-ldm-peephole   2003-07-05 01:27:22.000000000 -0400
-+++ gcc-3.4.0/gcc/genpeep.c    2004-04-24 18:18:04.000000000 -0400
-@@ -381,6 +381,7 @@
-   printf ("#include \"recog.h\"\n");
-   printf ("#include \"except.h\"\n\n");
-   printf ("#include \"function.h\"\n\n");
-+  printf ("#include \"flags.h\"\n\n");
-   printf ("#ifdef HAVE_peephole\n");
-   printf ("extern rtx peep_operand[];\n\n");
diff --git a/openwrt/toolchain/gcc/3.4.3/601-gcc34-arm-ldm.patch b/openwrt/toolchain/gcc/3.4.3/601-gcc34-arm-ldm.patch
deleted file mode 100644 (file)
index 142052f..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
---- gcc-3.4.0/gcc/config/arm/arm.c.arm-ldm     2004-02-27 09:51:05.000000000 -0500
-+++ gcc-3.4.0/gcc/config/arm/arm.c     2004-04-24 18:16:25.000000000 -0400
-@@ -8520,6 +8520,26 @@
-   return_used_this_function = 0;  
- }
-+/* Return the number (counting from 0) of
-+   the least significant set bit in MASK.  */
-+
-+#ifdef __GNUC__
-+inline
-+#endif
-+static int
-+number_of_first_bit_set (mask)
-+     int mask;
-+{
-+  int bit;
-+
-+  for (bit = 0;
-+       (mask & (1 << bit)) == 0;
-+       ++bit)
-+    continue;
-+
-+  return bit;
-+}
-+
- const char *
- arm_output_epilogue (rtx sibling)
- {
-@@ -8753,27 +8773,47 @@
-         saved_regs_mask |=   (1 << PC_REGNUM);
-       }
--      /* Load the registers off the stack.  If we only have one register
--       to load use the LDR instruction - it is faster.  */
--      if (saved_regs_mask == (1 << LR_REGNUM))
--      {
--        /* The exception handler ignores the LR, so we do
--           not really need to load it off the stack.  */
--        if (eh_ofs)
--          asm_fprintf (f, "\tadd\t%r, %r, #4\n", SP_REGNUM, SP_REGNUM);
--        else
--          asm_fprintf (f, "\tldr\t%r, [%r], #4\n", LR_REGNUM, SP_REGNUM);
--      }
--      else if (saved_regs_mask)
-+      if (saved_regs_mask)
-       {
--        if (saved_regs_mask & (1 << SP_REGNUM))
--          /* Note - write back to the stack register is not enabled
--             (ie "ldmfd sp!...").  We know that the stack pointer is
--             in the list of registers and if we add writeback the
--             instruction becomes UNPREDICTABLE.  */
--          print_multi_reg (f, "ldmfd\t%r", SP_REGNUM, saved_regs_mask);
-+        /* Load the registers off the stack.  If we only have one register
-+           to load use the LDR instruction - it is faster.  */
-+        if (bit_count (saved_regs_mask) == 1)
-+          {
-+            int reg = number_of_first_bit_set (saved_regs_mask);
-+
-+            switch (reg)
-+              {
-+              case SP_REGNUM:
-+                /* Mustn't use base writeback when loading SP.  */
-+                asm_fprintf (f, "\tldr\t%r, [%r]\n", SP_REGNUM, SP_REGNUM);
-+                break;
-+                
-+              case LR_REGNUM:
-+                if (eh_ofs)
-+                  {
-+                    /* The exception handler ignores the LR, so we do
-+                       not really need to load it off the stack.  */
-+                    asm_fprintf (f, "\tadd\t%r, %r, #4\n", SP_REGNUM, SP_REGNUM);
-+                    break;
-+                  }
-+                /* else fall through */
-+                
-+              default:
-+                asm_fprintf (f, "\tldr\t%r, [%r], #4\n", reg, SP_REGNUM);
-+                break;
-+              }
-+          }
-         else
--          print_multi_reg (f, "ldmfd\t%r!", SP_REGNUM, saved_regs_mask);
-+          {
-+            if (saved_regs_mask & (1 << SP_REGNUM))
-+              /* Note - write back to the stack register is not enabled
-+                 (ie "ldmfd sp!...").  We know that the stack pointer is
-+                 in the list of registers and if we add writeback the
-+                 instruction becomes UNPREDICTABLE.  */
-+              print_multi_reg (f, "ldmfd\t%r", SP_REGNUM, saved_regs_mask);
-+            else
-+              print_multi_reg (f, "ldmfd\t%r!", SP_REGNUM, saved_regs_mask);
-+          }
-       }
-       if (current_function_pretend_args_size)
-@@ -11401,22 +11441,6 @@
-     }
- }
--/* Return the number (counting from 0) of
--   the least significant set bit in MASK.  */
--
--inline static int
--number_of_first_bit_set (int mask)
--{
--  int bit;
--
--  for (bit = 0;
--       (mask & (1 << bit)) == 0;
--       ++bit)
--    continue;
--
--  return bit;
--}
--
- /* Generate code to return from a thumb function.
-    If 'reg_containing_return_addr' is -1, then the return address is
-    actually on the stack, at the stack pointer.  */
diff --git a/openwrt/toolchain/gcc/3.4.3/602-sdk-libstdc++-includes.patch b/openwrt/toolchain/gcc/3.4.3/602-sdk-libstdc++-includes.patch
deleted file mode 100644 (file)
index 4377c21..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
---- gcc-3.4.1/libstdc++-v3/libmath/Makefile.am~        2003-08-27 22:29:42.000000000 +0100
-+++ gcc-3.4.1/libstdc++-v3/libmath/Makefile.am 2004-07-22 16:41:45.152130128 +0100
-@@ -32,7 +32,7 @@
- libmath_la_SOURCES = stubs.c
--AM_CPPFLAGS = $(CANADIAN_INCLUDES)
-+AM_CPPFLAGS = $(CANADIAN_INCLUDES) -I$(toplevel_srcdir)/include
- # Only compiling "C" sources in this directory.
- LIBTOOL = @LIBTOOL@ --tag CC
---- gcc-3.4.1/libstdc++-v3/fragment.am.old     2004-07-22 18:24:58.024083656 +0100
-+++ gcc-3.4.1/libstdc++-v3/fragment.am 2004-07-22 18:24:59.019932264 +0100
-@@ -18,7 +18,7 @@
-       $(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once
- # -I/-D flags to pass when compiling.
--AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
-+AM_CPPFLAGS = $(GLIBCXX_INCLUDES) -I$(toplevel_srcdir)/include
diff --git a/openwrt/toolchain/gcc/3.4.3/700-pr15068-fix.patch b/openwrt/toolchain/gcc/3.4.3/700-pr15068-fix.patch
deleted file mode 100644 (file)
index 2977765..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-See http://gcc.gnu.org/PR15068
-
-Fixes error
-
-../sysdeps/generic/s_fmax.c: In function `__fmax':
-../sysdeps/generic/s_fmax.c:28: internal compiler error: in elim_reg_cond, at flow.c:3257
-Please submit a full bug report,
-with preprocessed source if appropriate.
-See <URL:http://gcc.gnu.org/bugs.html> for instructions.
-make[2]: *** [/home/dank/wk/crosstool-0.28-rc35/build/arm-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/build-glibc/math/s_fmax.o] Error 1
-make[2]: Leaving directory `/home/dank/wk/crosstool-0.28-rc35/build/arm-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040822/math'
-make[1]: *** [math/others] Error 2
-make[1]: Leaving directory `/home/dank/wk/crosstool-0.28-rc35/build/arm-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040822'
-make: *** [all] Error 2
-
-[ rediffed against gcc-3.4.1, with elbow grease, ending up with same thing as
-http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/flow.c.diff?cvsroot=gcc&only_with_tag=csl-arm-branch&r1=1.563.4.2&r2=1.563.4.3 ]
-
---- gcc-3.4.1/gcc/flow.c.old   2004-02-27 19:39:19.000000000 -0800
-+++ gcc-3.4.1/gcc/flow.c       2004-08-26 07:29:46.000000000 -0700
-@@ -1878,6 +1878,7 @@
-         rtx set_src = SET_SRC (pc_set (BB_END (bb)));
-         rtx cond_true = XEXP (set_src, 0);
-         rtx reg = XEXP (cond_true, 0);
-+        enum rtx_code inv_cond;
-         if (GET_CODE (reg) == SUBREG)
-           reg = SUBREG_REG (reg);
-@@ -1886,11 +1887,13 @@
-            in the form of a comparison of a register against zero.  
-            If the condition is more complex than that, then it is safe
-            not to record any information.  */
--        if (GET_CODE (reg) == REG
-+        inv_cond = reversed_comparison_code (cond_true, BB_END (bb));
-+        if (inv_cond != UNKNOWN
-+            && GET_CODE (reg) == REG
-             && XEXP (cond_true, 1) == const0_rtx)
-           {
-             rtx cond_false
--              = gen_rtx_fmt_ee (reverse_condition (GET_CODE (cond_true)),
-+              = gen_rtx_fmt_ee (inv_cond,
-                                 GET_MODE (cond_true), XEXP (cond_true, 0),
-                                 XEXP (cond_true, 1));
-             if (GET_CODE (XEXP (set_src, 1)) == PC)
diff --git a/openwrt/toolchain/gcc/3.4.3/800-arm-bigendian.patch b/openwrt/toolchain/gcc/3.4.3/800-arm-bigendian.patch
deleted file mode 100644 (file)
index 0bae8f4..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-By Lennert Buytenhek <buytenh@wantstofly.org>
-Adds support for arm*b-linux* big-endian ARM targets
-
-See http://gcc.gnu.org/PR16350
-
-diff -urN gcc-3.4.1-dist/gcc/config/arm/linux-elf.h gcc-3.4.1/gcc/config/arm/linux-elf.h
---- gcc-3.4.1-dist/gcc/config/arm/linux-elf.h  2004-08-16 16:01:50.000000000 -0500
-+++ gcc-3.4.1/gcc/config/arm/linux-elf.h       2004-08-16 15:43:40.000000000 -0500
-@@ -30,17 +30,34 @@
- /* Do not assume anything about header files.  */
- #define NO_IMPLICIT_EXTERN_C
-+/*
-+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
-+ * (big endian) configurations.
-+ */
-+#if TARGET_BIG_ENDIAN_DEFAULT
-+#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END
-+#define TARGET_ENDIAN_OPTION "mbig-endian"
-+#define TARGET_LINKER_EMULATION "armelfb_linux"
-+#else
-+#define TARGET_ENDIAN_DEFAULT 0
-+#define TARGET_ENDIAN_OPTION "mlittle-endian"
-+#define TARGET_LINKER_EMULATION "armelf_linux"
-+#endif
-+
- /* Default is to use APCS-32 mode.  */
- #undef  TARGET_DEFAULT
--#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS)
-+#define TARGET_DEFAULT \
-+              ( ARM_FLAG_APCS_32 | \
-+                ARM_FLAG_MMU_TRAPS | \
-+                TARGET_ENDIAN_DEFAULT )
- #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
--#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
-+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
- #undef  MULTILIB_DEFAULTS
- #define MULTILIB_DEFAULTS \
--      { "marm", "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" }
-+      { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" }
- #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
-@@ -101,7 +118,7 @@
-    %{rdynamic:-export-dynamic} \
-    %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
-    -X \
--   %{mbig-endian:-EB}" \
-+   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
-    SUBTARGET_EXTRA_LINK_SPEC
- #endif
-diff -urN gcc-3.4.1-dist/gcc/config.gcc gcc-3.4.1/gcc/config.gcc
---- gcc-3.4.1-dist/gcc/config.gcc      2004-08-16 16:01:50.000000000 -0500
-+++ gcc-3.4.1/gcc/config.gcc   2004-08-16 16:01:25.000000000 -0500
-@@ -672,6 +672,11 @@
-       ;;
- arm*-*-linux*)                        # ARM GNU/Linux with ELF
-       tm_file="dbxelf.h elfos.h linux.h arm/elf.h  arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h"
-+      case $target in
-+      arm*b-*)
-+              tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
-+              ;;
-+      esac
-       tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
-       extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
-       gnu_ld=yes
diff --git a/openwrt/toolchain/gcc/3.4.3/810-arm-bigendian-uclibc.patch b/openwrt/toolchain/gcc/3.4.3/810-arm-bigendian-uclibc.patch
deleted file mode 100644 (file)
index a4d87e2..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-diff -urN gcc-3.4.1-dist/gcc/config/arm/linux-elf.h gcc-3.4.1/gcc/config/arm/linux-elf.h
---- gcc-3.4.1-dist/gcc/config/arm/linux-elf.h  2004-08-16 16:08:18.000000000 -0500
-+++ gcc-3.4.1/gcc/config/arm/linux-elf.h       2004-08-16 16:06:24.000000000 -0500
-@@ -107,7 +107,7 @@
-    %{rdynamic:-export-dynamic} \
-    %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0} \
-    -X \
--   %{mbig-endian:-EB}" \
-+   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
-    SUBTARGET_EXTRA_LINK_SPEC
- #else
- #define LINK_SPEC "%{h*} %{version:-v} \
-diff -urN gcc-3.4.1-dist/gcc/config.gcc gcc-3.4.1/gcc/config.gcc
---- gcc-3.4.1-dist/gcc/config.gcc      2004-08-16 16:08:18.000000000 -0500
-+++ gcc-3.4.1/gcc/config.gcc   2004-08-16 16:03:25.000000000 -0500
-@@ -666,6 +666,11 @@
-       ;;
- arm*-*-linux-uclibc*)         # ARM GNU/Linux with ELF - uClibc
-       tm_file="dbxelf.h elfos.h linux.h arm/elf.h  arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h"
-+      case $target in
-+      arm*b-*)
-+              tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
-+              ;;
-+      esac
-       tmake_file="t-slibgcc-elf-ver t-linux-uclibc arm/t-linux"
-       extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
-       gnu_ld=yes
diff --git a/openwrt/toolchain/gcc/3.4.3/arm-softfloat.patch.conditional b/openwrt/toolchain/gcc/3.4.3/arm-softfloat.patch.conditional
deleted file mode 100644 (file)
index 19d1b90..0000000
+++ /dev/null
@@ -1,270 +0,0 @@
-Note... modified my mjn3 to not conflict with the big endian arm patch.
-Warning!!!  Only the linux target is aware of TARGET_ENDIAN_DEFAULT.
-Also changed
-  #define SUBTARGET_EXTRA_ASM_SPEC "\
-  %{!mcpu=*:-mcpu=xscale} \
-  %{mhard-float:-mfpu=fpa} \
-  %{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
-to
-  #define SUBTARGET_EXTRA_ASM_SPEC "\
-  %{mhard-float:-mfpu=fpa} \
-  %{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
-in gcc/config/arm/linux-elf.h.
-#
-# Submitted:
-#
-# Dimitry Andric <dimitry@andric.com>, 2004-05-01
-#
-# Description:
-#
-# Nicholas Pitre released this patch for gcc soft-float support here: 
-# http://lists.arm.linux.org.uk/pipermail/linux-arm/2003-October/006436.html
-#
-# This version has been adapted to work with gcc 3.4.0.
-#
-# The original patch doesn't distinguish between softfpa and softvfp modes
-# in the way Nicholas Pitre probably meant.  His description is:
-#
-# "Default is to use APCS-32 mode with soft-vfp.  The old Linux default for
-# floats can be achieved with -mhard-float or with the configure
-# --with-float=hard option.  If -msoft-float or --with-float=soft is used then
-# software float support will be used just like the default but with the legacy
-# big endian word ordering for double float representation instead."
-#
-# Which means the following:
-#
-# * If you compile without -mhard-float or -msoft-float, you should get
-#   software floating point, using the VFP format.  The produced object file
-#   should have these flags in its header:
-#
-#     private flags = 600: [APCS-32] [VFP float format] [software FP]
-#
-# * If you compile with -mhard-float, you should get hardware floating point,
-#   which always uses the FPA format.  Object file header flags should be:
-#
-#     private flags = 0: [APCS-32] [FPA float format]
-#
-# * If you compile with -msoft-float, you should get software floating point,
-#   using the FPA format.  This is done for compatibility reasons with many
-#   existing distributions.  Object file header flags should be:
-#
-#     private flags = 200: [APCS-32] [FPA float format] [software FP]
-#
-# The original patch from Nicholas Pitre contained the following constructs:
-#
-#   #define SUBTARGET_EXTRA_ASM_SPEC "%{!mcpu=*:-mcpu=xscale} \
-#     %{mhard-float:-mfpu=fpa} \
-#     %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}"
-#
-# However, gcc doesn't accept this ";:" notation, used in the 3rd line.  This
-# is probably the reason Robert Schwebel modified it to:
-#
-#   #define SUBTARGET_EXTRA_ASM_SPEC "%{!mcpu=*:-mcpu=xscale} \
-#     %{mhard-float:-mfpu=fpa} \
-#     %{!mhard-float: %{msoft-float:-mfpu=softfpa -mfpu=softvfp}}"
-#
-# But this causes the following behaviour:
-#
-# * If you compile without -mhard-float or -msoft-float, the compiler generates
-#   software floating point instructions, but *nothing* is passed to the
-#   assembler, which results in an object file which has flags:
-#
-#     private flags = 0: [APCS-32] [FPA float format]
-#
-#   This is not correct!
-#
-# * If you compile with -mhard-float, the compiler generates hardware floating
-#   point instructions, and passes "-mfpu=fpa" to the assembler, which results
-#   in an object file which has the same flags as in the previous item, but now
-#   those *are* correct.
-#    
-# * If you compile with -msoft-float, the compiler generates software floating
-#   point instructions, and passes "-mfpu=softfpa -mfpu=softvfp" (in that
-#   order) to the assembler, which results in an object file with flags:
-#
-#   private flags = 600: [APCS-32] [VFP float format] [software FP]
-#
-#   This is not correct, because the last "-mfpu=" option on the assembler
-#   command line determines the actual FPU convention used (which should be FPA
-#   in this case).
-#
-# Therefore, I modified this patch to get the desired behaviour.  Every
-# instance of the notation:
-#
-#   %{msoft-float:-mfpu=softfpa -mfpu=softvfp}
-#
-# was changed to:
-#
-#   %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}
-#
-# I also did the following:
-# 
-# * Modified all TARGET_DEFAULT macros I could find to include ARM_FLAG_VFP, to
-#   be consistent with Nicholas' original patch.
-# * Removed any "msoft-float" or "mhard-float" from all MULTILIB_DEFAULTS
-#   macros I could find.  I think that if you compile without any options, you
-#   would like to get the defaults. :)
-# * Removed the extra -lfloat option from LIBGCC_SPEC, since it isn't needed
-#   anymore.  (The required functions are now in libgcc.)
-
-diff -urN gcc-3.4.1-old/gcc/config/arm/coff.h gcc-3.4.1/gcc/config/arm/coff.h
---- gcc-3.4.1-old/gcc/config/arm/coff.h        2004-02-24 08:25:22.000000000 -0600
-+++ gcc-3.4.1/gcc/config/arm/coff.h    2004-09-02 21:51:15.000000000 -0500
-@@ -31,11 +31,16 @@
- #define TARGET_VERSION fputs (" (ARM/coff)", stderr)
- #undef  TARGET_DEFAULT
--#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
-+#define TARGET_DEFAULT                \
-+      ( ARM_FLAG_SOFT_FLOAT   \
-+      | ARM_FLAG_VFP          \
-+      | ARM_FLAG_APCS_32      \
-+      | ARM_FLAG_APCS_FRAME   \
-+      | ARM_FLAG_MMU_TRAPS )
- #ifndef MULTILIB_DEFAULTS
- #define MULTILIB_DEFAULTS \
--  { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork" }
-+  { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork" }
- #endif
\f
- /* This is COFF, but prefer stabs.  */
-diff -urN gcc-3.4.1-old/gcc/config/arm/elf.h gcc-3.4.1/gcc/config/arm/elf.h
---- gcc-3.4.1-old/gcc/config/arm/elf.h 2004-02-24 08:25:22.000000000 -0600
-+++ gcc-3.4.1/gcc/config/arm/elf.h     2004-09-02 21:51:15.000000000 -0500
-@@ -46,7 +46,9 @@
- #ifndef SUBTARGET_ASM_FLOAT_SPEC
- #define SUBTARGET_ASM_FLOAT_SPEC "\
--%{mapcs-float:-mfloat} %{msoft-float:-mfpu=softfpa}"
-+%{mapcs-float:-mfloat} \
-+%{mhard-float:-mfpu=fpa} \
-+%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
- #endif
- #ifndef ASM_SPEC
-@@ -106,12 +108,17 @@
- #endif
- #ifndef TARGET_DEFAULT
--#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
-+#define TARGET_DEFAULT                \
-+      ( ARM_FLAG_SOFT_FLOAT   \
-+      | ARM_FLAG_VFP          \
-+      | ARM_FLAG_APCS_32      \
-+      | ARM_FLAG_APCS_FRAME   \
-+      | ARM_FLAG_MMU_TRAPS )
- #endif
- #ifndef MULTILIB_DEFAULTS
- #define MULTILIB_DEFAULTS \
--  { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
-+  { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
- #endif
\f
- #define TARGET_ASM_FILE_START_APP_OFF true
-diff -urN gcc-3.4.1-old/gcc/config/arm/linux-elf.h gcc-3.4.1/gcc/config/arm/linux-elf.h
---- gcc-3.4.1-old/gcc/config/arm/linux-elf.h   2004-09-02 21:50:52.000000000 -0500
-+++ gcc-3.4.1/gcc/config/arm/linux-elf.h       2004-09-02 22:00:49.000000000 -0500
-@@ -44,12 +44,26 @@
- #define TARGET_LINKER_EMULATION "armelf_linux"
- #endif
--/* Default is to use APCS-32 mode.  */
-+/*
-+ * Default is to use APCS-32 mode with soft-vfp.
-+ * The old Linux default for floats can be achieved with -mhard-float
-+ * or with the configure --with-float=hard option.
-+ * If -msoft-float or --with-float=soft is used then software float 
-+ * support will be used just like the default but with the legacy
-+ * big endian word ordering for double float representation instead.
-+ */
- #undef  TARGET_DEFAULT
--#define TARGET_DEFAULT \
--              ( ARM_FLAG_APCS_32 | \
--                ARM_FLAG_MMU_TRAPS | \
--                TARGET_ENDIAN_DEFAULT )
-+#define TARGET_DEFAULT                \
-+      ( ARM_FLAG_APCS_32      \
-+      | ARM_FLAG_SOFT_FLOAT   \
-+      | TARGET_ENDIAN_DEFAULT \
-+      | ARM_FLAG_VFP          \
-+      | ARM_FLAG_MMU_TRAPS )
-+
-+#undef  SUBTARGET_EXTRA_ASM_SPEC
-+#define SUBTARGET_EXTRA_ASM_SPEC "\
-+%{mhard-float:-mfpu=fpa} \
-+%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
- #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
-@@ -57,7 +71,7 @@
- #undef  MULTILIB_DEFAULTS
- #define MULTILIB_DEFAULTS \
--      { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" }
-+      { "marm", TARGET_ENDIAN_OPTION, "mapcs-32", "mno-thumb-interwork" }
- #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
-@@ -72,7 +86,7 @@
-    %{shared:-lc} \
-    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
--#define LIBGCC_SPEC "%{msoft-float:-lfloat} -lgcc"
-+#define LIBGCC_SPEC "-lgcc"
- /* Provide a STARTFILE_SPEC appropriate for GNU/Linux.  Here we add
-    the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
-diff -urN gcc-3.4.1-old/gcc/config/arm/t-linux gcc-3.4.1/gcc/config/arm/t-linux
---- gcc-3.4.1-old/gcc/config/arm/t-linux       2003-09-20 16:09:07.000000000 -0500
-+++ gcc-3.4.1/gcc/config/arm/t-linux   2004-09-02 21:51:15.000000000 -0500
-@@ -4,7 +4,10 @@
- LIBGCC2_DEBUG_CFLAGS = -g0
- LIB1ASMSRC = arm/lib1funcs.asm
--LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
-+LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
-+      _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
-+      _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
-+      _fixsfsi _fixunssfsi
- # MULTILIB_OPTIONS = mhard-float/msoft-float
- # MULTILIB_DIRNAMES = hard-float soft-float
-diff -urN gcc-3.4.1-old/gcc/config/arm/unknown-elf.h gcc-3.4.1/gcc/config/arm/unknown-elf.h
---- gcc-3.4.1-old/gcc/config/arm/unknown-elf.h 2004-02-24 08:25:22.000000000 -0600
-+++ gcc-3.4.1/gcc/config/arm/unknown-elf.h     2004-09-02 21:51:15.000000000 -0500
-@@ -30,7 +30,12 @@
- /* Default to using APCS-32 and software floating point.  */
- #ifndef TARGET_DEFAULT
--#define TARGET_DEFAULT        (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS)
-+#define TARGET_DEFAULT                \
-+      ( ARM_FLAG_SOFT_FLOAT   \
-+      | ARM_FLAG_VFP          \
-+      | ARM_FLAG_APCS_32      \
-+      | ARM_FLAG_APCS_FRAME   \
-+      | ARM_FLAG_MMU_TRAPS )
- #endif
- /* Now we define the strings used to build the spec file.  */
-diff -urN gcc-3.4.1-old/gcc/config/arm/xscale-elf.h gcc-3.4.1/gcc/config/arm/xscale-elf.h
---- gcc-3.4.1-old/gcc/config/arm/xscale-elf.h  2003-07-01 18:26:43.000000000 -0500
-+++ gcc-3.4.1/gcc/config/arm/xscale-elf.h      2004-09-02 21:51:15.000000000 -0500
-@@ -49,11 +49,12 @@
-                    endian, regardless of the endian-ness of the memory
-                    system.  */
-                    
--#define SUBTARGET_EXTRA_ASM_SPEC "%{!mcpu=*:-mcpu=xscale} \
--  %{mhard-float:-mfpu=fpa} \
--  %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}"
-+#define SUBTARGET_EXTRA_ASM_SPEC "\
-+%{!mcpu=*:-mcpu=xscale} \
-+%{mhard-float:-mfpu=fpa} \
-+%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}"
- #ifndef MULTILIB_DEFAULTS
- #define MULTILIB_DEFAULTS \
--  { "mlittle-endian", "mno-thumb-interwork", "marm", "msoft-float" }
-+  { "mlittle-endian", "mno-thumb-interwork", "marm" }
- #endif
diff --git a/openwrt/toolchain/gcc/4.0.0/100-uclibc-conf.patch b/openwrt/toolchain/gcc/4.0.0/100-uclibc-conf.patch
deleted file mode 100644 (file)
index 9436c7d..0000000
+++ /dev/null
@@ -1,410 +0,0 @@
-diff -urN gcc-4.1.0/boehm-gc/configure gcc-4.1.0-patched/boehm-gc/configure
---- gcc-4.1.0/boehm-gc/configure       2005-04-13 19:31:24.000000000 -0500
-+++ gcc-4.1.0-patched/boehm-gc/configure       2005-04-25 20:47:19.919723167 -0500
-@@ -4320,6 +4320,11 @@
-   lt_cv_deplibs_check_method=pass_all
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -urN gcc-4.1.0/gcc/config/arm/linux-elf.h gcc-4.1.0-patched/gcc/config/arm/linux-elf.h
---- gcc-4.1.0/gcc/config/arm/linux-elf.h       2005-03-02 10:27:42.000000000 -0600
-+++ gcc-4.1.0-patched/gcc/config/arm/linux-elf.h       2005-04-25 20:45:31.795953620 -0500
-@@ -82,6 +82,18 @@
-   "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
- #undef  LINK_SPEC
-+#ifdef USE_UCLIBC
-+#define LINK_SPEC "%{h*} %{version:-v} \
-+   %{b} %{Wl,*:%*} \
-+   %{static:-Bstatic} \
-+   %{shared:-shared} \
-+   %{symbolic:-Bsymbolic} \
-+   %{rdynamic:-export-dynamic} \
-+   %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0} \
-+   -X \
-+   %{mbig-endian:-EB}" \
-+   SUBTARGET_EXTRA_LINK_SPEC
-+#else
- #define LINK_SPEC "%{h*} %{version:-v} \
-    %{b} %{Wl,*:%*} \
-    %{static:-Bstatic} \
-@@ -92,6 +104,7 @@
-    -X \
-    %{mbig-endian:-EB}" \
-    SUBTARGET_EXTRA_LINK_SPEC
-+#endif
- #define TARGET_OS_CPP_BUILTINS()              \
-   do                                          \
-diff -urN gcc-4.1.0/gcc/config/cris/linux.h gcc-4.1.0-patched/gcc/config/cris/linux.h
---- gcc-4.1.0/gcc/config/cris/linux.h  2005-04-23 23:01:27.000000000 -0500
-+++ gcc-4.1.0-patched/gcc/config/cris/linux.h  2005-04-25 20:45:31.796953451 -0500
-@@ -73,6 +73,25 @@
- #undef CRIS_DEFAULT_CPU_VERSION
- #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
-+#ifdef USE_UCLIBC
-+
-+#undef CRIS_SUBTARGET_VERSION
-+#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-uclibc"
-+
-+#undef CRIS_LINK_SUBTARGET_SPEC
-+#define CRIS_LINK_SUBTARGET_SPEC \
-+ "-mcrislinux\
-+  -rpath-link include/asm/../..%s\
-+  %{shared} %{static}\
-+  %{symbolic:-Bdynamic} %{shlib:-Bdynamic} %{static:-Bstatic}\
-+  %{!shared: \
-+    %{!static: \
-+      %{rdynamic:-export-dynamic} \
-+      %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}} \
-+  %{!r:%{O2|O3: --gc-sections}}"
-+
-+#else  /* USE_UCLIBC */
-+
- #undef CRIS_SUBTARGET_VERSION
- #define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
-@@ -87,6 +106,8 @@
-   %{!shared:%{!static:%{rdynamic:-export-dynamic}}}\
-   %{!r:%{O2|O3: --gc-sections}}"
-+#endif  /* USE_UCLIBC */
-+
- /* Node: Run-time Target */
-diff -urN gcc-4.1.0/gcc/config/cris/t-linux-uclibc gcc-4.1.0-patched/gcc/config/cris/t-linux-uclibc
---- gcc-4.1.0/gcc/config/cris/t-linux-uclibc   1969-12-31 18:00:00.000000000 -0600
-+++ gcc-4.1.0-patched/gcc/config/cris/t-linux-uclibc   2005-04-25 20:45:31.797953283 -0500
-@@ -0,0 +1,3 @@
-+T_CFLAGS = -DUSE_UCLIBC
-+TARGET_LIBGCC2_CFLAGS += -fPIC
-+CRTSTUFF_T_CFLAGS_S = $(TARGET_LIBGCC2_CFLAGS)
-diff -urN gcc-4.1.0/gcc/config/i386/linux.h gcc-4.1.0-patched/gcc/config/i386/linux.h
---- gcc-4.1.0/gcc/config/i386/linux.h  2004-11-27 10:45:14.000000000 -0600
-+++ gcc-4.1.0-patched/gcc/config/i386/linux.h  2005-04-25 21:21:05.828409973 -0500
-@@ -104,8 +104,13 @@
- /* If ELF is the default format, we should not use /lib/elf.  */
-+#if defined USE_UCLIBC
-+#define LINK_EMULATION "elf_i386"
-+#define DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
-+#else
- #define LINK_EMULATION "elf_i386"
- #define DYNAMIC_LINKER "/lib/ld-linux.so.2"
-+#endif
- #undef  SUBTARGET_EXTRA_SPECS
- #define SUBTARGET_EXTRA_SPECS \
-@@ -144,6 +149,7 @@
-     }                                                                 \
-   } while (0)
- #endif
-+#endif
- /* Handle special EH pointer encodings.  Absolute, pc-relative, and
-    indirect are handled automatically.  */
-diff -urN gcc-4.1.0/gcc/config/mips/linux.h gcc-4.1.0-patched/gcc/config/mips/linux.h
---- gcc-4.1.0/gcc/config/mips/linux.h  2005-01-25 20:04:46.000000000 -0600
-+++ gcc-4.1.0-patched/gcc/config/mips/linux.h  2005-04-25 20:45:31.809951259 -0500
-@@ -108,6 +108,17 @@
- /* Borrowed from sparc/linux.h */
- #undef LINK_SPEC
-+#ifdef USE_UCLIBC
-+#define LINK_SPEC \
-+ "%(endian_spec) \
-+  %{shared:-shared} \
-+  %{!shared: \
-+    %{!ibcs: \
-+      %{!static: \
-+        %{rdynamic:-export-dynamic} \
-+        %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
-+        %{static:-static}}}"
-+#else
- #define LINK_SPEC \
-  "%(endian_spec) \
-   %{shared:-shared} \
-@@ -117,6 +128,7 @@
-         %{rdynamic:-export-dynamic} \
-         %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
-         %{static:-static}}}"
-+#endif
- #undef SUBTARGET_ASM_SPEC
- #define SUBTARGET_ASM_SPEC "%{mabi=64: -64} %{!mno-abicalls:-KPIC}"
-diff -urN gcc-4.1.0/gcc/config/rs6000/linux.h gcc-4.1.0-patched/gcc/config/rs6000/linux.h
---- gcc-4.1.0/gcc/config/rs6000/linux.h        2004-12-01 20:21:28.000000000 -0600
-+++ gcc-4.1.0-patched/gcc/config/rs6000/linux.h        2005-04-25 20:45:31.810951091 -0500
-@@ -69,7 +69,11 @@
- #define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
- #undef        LINK_OS_DEFAULT_SPEC
-+#ifdef USE_UCLIBC
-+#define LINK_OS_DEFAULT_SPEC "%(link_os_linux_uclibc)"
-+#else
- #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
-+#endif
- #define LINK_GCC_C_SEQUENCE_SPEC \
-   "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
-diff -urN gcc-4.1.0/gcc/config/rs6000/sysv4.h gcc-4.1.0-patched/gcc/config/rs6000/sysv4.h
---- gcc-4.1.0/gcc/config/rs6000/sysv4.h        2005-04-13 19:26:50.000000000 -0500
-+++ gcc-4.1.0-patched/gcc/config/rs6000/sysv4.h        2005-04-25 20:45:31.812950754 -0500
-@@ -957,6 +957,7 @@
-   mcall-linux  : %(link_os_linux)       ; \
-   mcall-gnu    : %(link_os_gnu)         ; \
-   mcall-netbsd : %(link_os_netbsd)      ; \
-+  mcall-linux-uclibc : %(link_os_linux_uclibc); \
-   mcall-openbsd: %(link_os_openbsd)     ; \
-                : %(link_os_default)     }"
-@@ -1135,6 +1136,10 @@
-   %{rdynamic:-export-dynamic} \
-   %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
-+#define LINK_OS_LINUX_UCLIBC_SPEC "-m elf32ppclinux %{!shared: %{!static: \
-+  %{rdynamic:-export-dynamic} \
-+  %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}}"
-+
- #if defined(HAVE_LD_EH_FRAME_HDR)
- # define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
- #endif
-@@ -1301,6 +1306,7 @@
-   { "link_os_sim",            LINK_OS_SIM_SPEC },                     \
-   { "link_os_freebsd",                LINK_OS_FREEBSD_SPEC },                 \
-   { "link_os_linux",          LINK_OS_LINUX_SPEC },                   \
-+  { "link_os_linux_uclibc",   LINK_OS_LINUX_UCLIBC_SPEC },            \
-   { "link_os_gnu",            LINK_OS_GNU_SPEC },                     \
-   { "link_os_netbsd",         LINK_OS_NETBSD_SPEC },                  \
-   { "link_os_openbsd",                LINK_OS_OPENBSD_SPEC },                 \
-diff -urN gcc-4.1.0/gcc/config/sh/linux.h gcc-4.1.0-patched/gcc/config/sh/linux.h
---- gcc-4.1.0/gcc/config/sh/linux.h    2005-02-28 21:39:03.000000000 -0600
-+++ gcc-4.1.0-patched/gcc/config/sh/linux.h    2005-04-25 20:45:31.814950416 -0500
-@@ -55,12 +55,21 @@
- #undef SUBTARGET_LINK_EMUL_SUFFIX
- #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
- #undef SUBTARGET_LINK_SPEC
-+#ifdef USE_UCLIBC
-+#define SUBTARGET_LINK_SPEC \
-+  "%{shared:-shared} \
-+   %{!static: \
-+     %{rdynamic:-export-dynamic} \
-+     %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
-+   %{static:-static}"
-+#else
- #define SUBTARGET_LINK_SPEC \
-   "%{shared:-shared} \
-    %{!static: \
-      %{rdynamic:-export-dynamic} \
-      %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
-    %{static:-static}"
-+#endif
- /* Output assembler code to STREAM to call the profiler.  */
-diff -urN gcc-4.1.0/gcc/config/sh/t-linux-uclibc gcc-4.1.0-patched/gcc/config/sh/t-linux-uclibc
---- gcc-4.1.0/gcc/config/sh/t-linux-uclibc     1969-12-31 18:00:00.000000000 -0600
-+++ gcc-4.1.0-patched/gcc/config/sh/t-linux-uclibc     2005-04-25 20:45:31.814950416 -0500
-@@ -0,0 +1,13 @@
-+T_CFLAGS = -DUSE_UCLIBC
-+
-+TARGET_LIBGCC2_CFLAGS = -fpic -DNO_FPSCR_VALUES
-+LIB1ASMFUNCS_CACHE = _ic_invalidate
-+
-+LIB2FUNCS_EXTRA=
-+
-+MULTILIB_OPTIONS= $(MULTILIB_ENDIAN) m3e/m4
-+MULTILIB_DIRNAMES= 
-+MULTILIB_MATCHES = 
-+MULTILIB_EXCEPTIONS=
-+
-+EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
-diff -urN gcc-4.1.0/gcc/config/sh/t-sh64-uclibc gcc-4.1.0-patched/gcc/config/sh/t-sh64-uclibc
---- gcc-4.1.0/gcc/config/sh/t-sh64-uclibc      1969-12-31 18:00:00.000000000 -0600
-+++ gcc-4.1.0-patched/gcc/config/sh/t-sh64-uclibc      2005-04-25 20:45:31.815950248 -0500
-@@ -0,0 +1,13 @@
-+EXTRA_MULTILIB_PARTS= crt1.o crti.o crtn.o crtbegin.o crtend.o
-+
-+LIB1ASMFUNCS = \
-+  _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
-+  _shcompact_call_trampoline _shcompact_return_trampoline \
-+  _shcompact_incoming_args _ic_invalidate _nested_trampoline \
-+  _push_pop_shmedia_regs \
-+  _udivdi3 _divdi3 _umoddi3 _moddi3
-+
-+MULTILIB_OPTIONS = $(MULTILIB_ENDIAN) m5-32media-nofpu/m5-compact/m5-compact-nofpu/m5-64media/m5-64media-nofpu
-+MULTILIB_DIRNAMES= $(MULTILIB_ENDIAN) nofpu compact nofpu/compact media64 nofpu/media64
-+MULTILIB_MATCHES=
-+MULTILIB_EXCEPTIONS=
-diff -urN gcc-4.1.0/gcc/config/t-linux-uclibc gcc-4.1.0-patched/gcc/config/t-linux-uclibc
---- gcc-4.1.0/gcc/config/t-linux-uclibc        1969-12-31 18:00:00.000000000 -0600
-+++ gcc-4.1.0-patched/gcc/config/t-linux-uclibc        2005-04-25 20:45:31.815950248 -0500
-@@ -0,0 +1,15 @@
-+T_CFLAGS = -DUSE_UCLIBC
-+
-+# Compile crtbeginS.o and crtendS.o with pic.
-+CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
-+# Compile libgcc2.a with pic.
-+TARGET_LIBGCC2_CFLAGS = -fPIC
-+
-+# Override t-slibgcc-elf-ver to export some libgcc symbols with
-+# the symbol versions that glibc used.
-+#SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver
-+
-+# Use unwind-dw2-fde
-+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
-+  $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c
-+LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h
-diff -urN gcc-4.1.0/gcc/config.gcc gcc-4.1.0-patched/gcc/config.gcc
---- gcc-4.1.0/gcc/config.gcc   2005-04-23 23:01:23.000000000 -0500
-+++ gcc-4.1.0-patched/gcc/config.gcc   2005-04-25 21:12:43.375594576 -0500
-@@ -448,7 +448,14 @@
-   case ${enable_threads} in
-     "" | yes | posix) thread_file='posix' ;;
-   esac
--  tmake_file="t-slibgcc-elf-ver t-linux"
-+  case ${target} in
-+    *-linux*uclibc*)
-+      tmake_file="t-slibgcc-elf-ver t-linux-uclibc"
-+      ;;
-+    *)
-+      tmake_file="t-slibgcc-elf-ver t-linux"
-+      ;;
-+  esac
-   ;;
- *-*-gnu*)
-   # On the Hurd, the setup is just about the same on
-@@ -667,6 +674,12 @@
-       extra_parts=""
-       use_collect2=yes
-       ;;
-+arm*-*-linux-uclibc*)         # ARM GNU/Linux with ELF - uClibc
-+      tm_file="dbxelf.h elfos.h linux.h arm/elf.h  arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h"
-+      tmake_file="t-slibgcc-elf-ver t-linux-uclibc arm/t-linux"
-+      extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
-+      gnu_ld=yes
-+      ;;
- arm*-*-linux*)                        # ARM GNU/Linux with ELF
-       tm_file="dbxelf.h elfos.h linux.h arm/elf.h  arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h"
-       tmake_file="${tmake_file} arm/t-arm arm/t-linux"
-@@ -765,6 +778,10 @@
-       gas=yes
-       extra_options="${extra_options} cris/elf.opt"
-       ;;
-+cris-*-linux-uclibc*)
-+      tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h"
-+      tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux-uclibc"
-+      ;;
- cris-*-linux*)
-       tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h"
-       # We need to avoid using t-linux, so override default tmake_file
-@@ -1443,6 +1460,16 @@
-       gnu_ld=yes
-       gas=yes
-       ;;
-+mips*-*-linux-uclibc*)                        # Linux MIPS, either endian. uClibc
-+        tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h"
-+      case ${target} in
-+        mipsisa32*-*)
-+                target_cpu_default="MASK_SOFT_FLOAT"
-+              tm_defines="MIPS_ISA_DEFAULT=32"
-+                ;;
-+        esac
-+      tmake_file="t-slibgcc-elf-ver t-linux-uclibc"
-+      ;;
- mips*-*-linux*)                               # Linux MIPS, either endian.
-         tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h"
-       case ${target} in
-@@ -1659,6 +1686,10 @@
-       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxspe.h"
-       tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
-       ;;
-+powerpc-*-linux-uclibc*)
-+      tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h"
-+      tmake_file="rs6000/t-fprules rs6000/t-ppcos t-slibgcc-elf-ver t-linux-uclibc rs6000/t-ppccomm"
-+      ;;
- powerpc-*-linux*)
-       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h"
-       tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
-@@ -1821,6 +1852,8 @@
-       esac
-       tm_file="${tm_file} sh/elf.h"
-       case ${target} in
-+      sh*-*-linux-uclibc*)    tmake_file="${tmake_file} t-linux-uclibc sh/t-linux-uclibc"
-+                      tm_file="${tm_file} linux.h sh/linux.h" ;;
-       sh*-*-linux*)   tmake_file="${tmake_file} sh/t-linux"
-                       tm_file="${tm_file} linux.h sh/linux.h" ;;
-       sh*-*-kaos*)    tm_file="${tm_file} sh/embed-elf.h kaos.h sh/kaos-sh.h"
-@@ -1840,6 +1873,11 @@
-       *-*-netbsd)
-                 tmake_file="${tmake_file} sh/t-netbsd"
-               ;;
-+      sh64*-*-linux-uclibc*)
-+              tmake_file="${tmake_file} sh/t-sh64-uclibc"
-+              tm_file="${tm_file} sh/sh64.h"
-+              extra_headers="shmedia.h ushmedia.h sshmedia.h"
-+              ;;
-       sh64*-*-linux*)
-               tmake_file="${tmake_file} sh/t-sh64 sh/t-linux64"
-               tm_file="${tm_file} sh/sh64.h"
-diff -urN gcc-4.1.0/libtool.m4 gcc-4.1.0-patched/libtool.m4
---- gcc-4.1.0/libtool.m4       2005-04-13 19:31:24.000000000 -0500
-+++ gcc-4.1.0-patched/libtool.m4       2005-04-25 20:47:51.679369687 -0500
-@@ -743,6 +743,11 @@
-   lt_cv_deplibs_check_method=pass_all
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
-diff -urN gcc-4.1.0/ltconfig gcc-4.1.0-patched/ltconfig
---- gcc-4.1.0/ltconfig 2004-10-02 11:33:06.000000000 -0500
-+++ gcc-4.1.0-patched/ltconfig 2005-04-25 20:45:31.836946707 -0500
-@@ -602,6 +602,7 @@
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case $host_os in
-+linux-uclibc*) ;;
- linux-gnu*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
-@@ -1273,6 +1274,24 @@
-   dynamic_linker='GNU/Linux ld.so'
-   ;;
-+linux-uclibc*)
-+  version_type=linux
-+  need_lib_prefix=no
-+  need_version=no
-+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-+  soname_spec='${libname}${release}.so$major'
-+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-+  shlibpath_var=LD_LIBRARY_PATH
-+  shlibpath_overrides_runpath=no
-+  # This implies no fast_install, which is unacceptable.
-+  # Some rework will be needed to allow for fast_install
-+  # before this can be enabled.
-+  # Note: copied from linux-gnu, and may not be appropriate.
-+  hardcode_into_libs=yes
-+  # Assume using the uClibc dynamic linker.
-+  dynamic_linker="uClibc ld.so"
-+  ;;
-+
- netbsd*)
-   need_lib_prefix=no
-   need_version=no
diff --git a/openwrt/toolchain/gcc/4.0.0/200-uclibc-locale.patch b/openwrt/toolchain/gcc/4.0.0/200-uclibc-locale.patch
deleted file mode 100644 (file)
index c57f173..0000000
+++ /dev/null
@@ -1,3191 +0,0 @@
-diff -urN gcc-4.1.0/libstdc++-v3/acinclude.m4 gcc-4.1.0-patched/libstdc++-v3/acinclude.m4
---- gcc-4.1.0/libstdc++-v3/acinclude.m4        2005-04-11 19:13:06.000000000 -0500
-+++ gcc-4.1.0-patched/libstdc++-v3/acinclude.m4        2005-04-27 22:20:27.569248995 -0500
-@@ -1047,7 +1047,7 @@
-   AC_MSG_CHECKING([for C locale to use])
-   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
-     [use MODEL for target locale package],
--    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
-+    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
-   
-   # If they didn't use this option switch, or if they specified --enable
-   # with no specific model, we'll have to look for one.  If they
-@@ -1063,6 +1063,9 @@
-   # Default to "generic".
-   if test $enable_clocale_flag = auto; then
-     case ${target_os} in
-+      *-uclibc*)
-+        enable_clocale_flag=uclibc
-+        ;;
-       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
-         AC_EGREP_CPP([_GLIBCXX_ok], [
-         #include <features.h>
-@@ -1206,6 +1209,41 @@
-       CTIME_CC=config/locale/generic/time_members.cc
-       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
-       ;;
-+    uclibc)
-+      AC_MSG_RESULT(uclibc)
-+
-+      # Declare intention to use gettext, and add support for specific
-+      # languages.
-+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
-+      ALL_LINGUAS="de fr"
-+
-+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
-+      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
-+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
-+        USE_NLS=yes
-+      fi
-+      # Export the build objects.
-+      for ling in $ALL_LINGUAS; do \
-+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
-+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
-+      done
-+      AC_SUBST(glibcxx_MOFILES)
-+      AC_SUBST(glibcxx_POFILES)
-+
-+      CLOCALE_H=config/locale/uclibc/c_locale.h
-+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
-+      CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
-+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
-+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
-+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
-+      CMESSAGES_H=config/locale/uclibc/messages_members.h
-+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
-+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
-+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
-+      CTIME_H=config/locale/uclibc/time_members.h
-+      CTIME_CC=config/locale/uclibc/time_members.cc
-+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
-+      ;;
-   esac
-   # This is where the testsuite looks for locale catalogs, using the
-diff -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
---- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h   1969-12-31 18:00:00.000000000 -0600
-+++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/c++locale_internal.h   2005-04-27 22:20:27.571248664 -0500
-@@ -0,0 +1,59 @@
-+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
-+
-+// Copyright (C) 2002, 2004 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+// Written by Jakub Jelinek <jakub@redhat.com>
-+
-+#include <clocale>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning clean this up
-+#endif
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+                                                  
-+extern "C" __typeof(iswctype_l) __iswctype_l;
-+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
-+extern "C" __typeof(strcoll_l) __strcoll_l;
-+extern "C" __typeof(strftime_l) __strftime_l;
-+extern "C" __typeof(strtod_l) __strtod_l;
-+extern "C" __typeof(strtof_l) __strtof_l;
-+extern "C" __typeof(strtold_l) __strtold_l;
-+extern "C" __typeof(strxfrm_l) __strxfrm_l;
-+extern "C" __typeof(towlower_l) __towlower_l;
-+extern "C" __typeof(towupper_l) __towupper_l;
-+extern "C" __typeof(wcscoll_l) __wcscoll_l;
-+extern "C" __typeof(wcsftime_l) __wcsftime_l;
-+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
-+extern "C" __typeof(wctype_l) __wctype_l;
-+extern "C" __typeof(newlocale) __newlocale;
-+extern "C" __typeof(freelocale) __freelocale;
-+extern "C" __typeof(duplocale) __duplocale;
-+extern "C" __typeof(uselocale) __uselocale;
-+
-+#endif // GLIBC 2.3 and later
-diff -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/c_locale.cc
---- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.cc    1969-12-31 18:00:00.000000000 -0600
-+++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/c_locale.cc    2005-04-27 22:20:27.572248498 -0500
-@@ -0,0 +1,160 @@
-+// Wrapper for underlying C-language localization -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.8  Standard locale categories.
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <cerrno>  // For errno
-+#include <locale>
-+#include <stdexcept>
-+#include <langinfo.h>
-+#include <bits/c++locale_internal.h>
-+
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
-+#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
-+#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
-+#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
-+#define __strtof_l(S, E, L)         strtof((S), (E))
-+#define __strtod_l(S, E, L)         strtod((S), (E))
-+#define __strtold_l(S, E, L)        strtold((S), (E))
-+#warning should dummy __newlocale check for C|POSIX ?
-+#define __newlocale(a, b, c)        NULL
-+#define __freelocale(a)             ((void)0)
-+#define __duplocale(a)              __c_locale()
-+#endif
-+
-+namespace std 
-+{
-+  template<>
-+    void
-+    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
-+                 const __c_locale& __cloc)
-+    {
-+      if (!(__err & ios_base::failbit))
-+      {
-+        char* __sanity;
-+        errno = 0;
-+        float __f = __strtof_l(__s, &__sanity, __cloc);
-+          if (__sanity != __s && errno != ERANGE)
-+          __v = __f;
-+        else
-+          __err |= ios_base::failbit;
-+      }
-+    }
-+
-+  template<>
-+    void
-+    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
-+                 const __c_locale& __cloc)
-+    {
-+      if (!(__err & ios_base::failbit))
-+      {
-+        char* __sanity;
-+        errno = 0;
-+        double __d = __strtod_l(__s, &__sanity, __cloc);
-+          if (__sanity != __s && errno != ERANGE)
-+          __v = __d;
-+        else
-+          __err |= ios_base::failbit;
-+      }
-+    }
-+
-+  template<>
-+    void
-+    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
-+                 const __c_locale& __cloc)
-+    {
-+      if (!(__err & ios_base::failbit))
-+      {
-+        char* __sanity;
-+        errno = 0;
-+        long double __ld = __strtold_l(__s, &__sanity, __cloc);
-+          if (__sanity != __s && errno != ERANGE)
-+          __v = __ld;
-+        else
-+          __err |= ios_base::failbit;
-+      }
-+    }
-+
-+  void
-+  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
-+                                  __c_locale __old)
-+  {
-+    __cloc = __newlocale(1 << LC_ALL, __s, __old);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    if (!__cloc)
-+      {
-+      // This named locale is not supported by the underlying OS.
-+      __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
-+                            "name not valid"));
-+      }
-+#endif
-+  }
-+  
-+  void
-+  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
-+  {
-+    if (_S_get_c_locale() != __cloc)
-+      __freelocale(__cloc); 
-+  }
-+
-+  __c_locale
-+  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
-+  { return __duplocale(__cloc); }
-+} // namespace std
-+
-+namespace __gnu_cxx
-+{
-+  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
-+    {
-+      "LC_CTYPE", 
-+      "LC_NUMERIC",
-+      "LC_TIME", 
-+      "LC_COLLATE", 
-+      "LC_MONETARY",
-+      "LC_MESSAGES", 
-+#if _GLIBCXX_NUM_CATEGORIES != 0
-+      "LC_PAPER", 
-+      "LC_NAME", 
-+      "LC_ADDRESS",
-+      "LC_TELEPHONE", 
-+      "LC_MEASUREMENT", 
-+      "LC_IDENTIFICATION" 
-+#endif
-+    };
-+}
-+
-+namespace std
-+{
-+  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
-+}  // namespace std
-diff -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/c_locale.h
---- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.h     1969-12-31 18:00:00.000000000 -0600
-+++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/c_locale.h     2005-04-27 22:20:27.573248332 -0500
-@@ -0,0 +1,115 @@
-+// Wrapper for underlying C-language localization -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.8  Standard locale categories.
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#ifndef _C_LOCALE_H
-+#define _C_LOCALE_H 1
-+
-+#pragma GCC system_header
-+
-+#include <cstring>              // get std::strlen
-+#include <cstdio>               // get std::snprintf or std::sprintf
-+#include <clocale>
-+#include <langinfo.h>         // For codecvt
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix this
-+#endif
-+#ifdef __UCLIBC_HAS_LOCALE__
-+#include <iconv.h>            // For codecvt using iconv, iconv_t
-+#endif
-+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
-+#include <libintl.h>          // For messages
-+#endif
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning what is _GLIBCXX_C_LOCALE_GNU for
-+#endif
-+#define _GLIBCXX_C_LOCALE_GNU 1
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix categories
-+#endif
-+// #define _GLIBCXX_NUM_CATEGORIES 6
-+#define _GLIBCXX_NUM_CATEGORIES 0
-+ 
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+namespace __gnu_cxx
-+{
-+  extern "C" __typeof(uselocale) __uselocale;
-+}
-+#endif
-+
-+namespace std
-+{
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+  typedef __locale_t          __c_locale;
-+#else
-+  typedef int*                        __c_locale;
-+#endif
-+
-+  // Convert numeric value of type _Tv to string and return length of
-+  // string.  If snprintf is available use it, otherwise fall back to
-+  // the unsafe sprintf which, in general, can be dangerous and should
-+  // be avoided.
-+  template<typename _Tv>
-+    int
-+    __convert_from_v(char* __out, const int __size, const char* __fmt,
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+                   _Tv __v, const __c_locale& __cloc, int __prec)
-+    {
-+      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
-+#else
-+                   _Tv __v, const __c_locale&, int __prec)
-+    {
-+# ifdef __UCLIBC_HAS_LOCALE__
-+      char* __old = std::setlocale(LC_ALL, NULL);
-+      char* __sav = new char[std::strlen(__old) + 1];
-+      std::strcpy(__sav, __old);
-+      std::setlocale(LC_ALL, "C");
-+# endif
-+#endif
-+
-+      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+      __gnu_cxx::__uselocale(__old);
-+#elif defined __UCLIBC_HAS_LOCALE__
-+      std::setlocale(LC_ALL, __sav);
-+      delete [] __sav;
-+#endif
-+      return __ret;
-+    }
-+}
-+
-+#endif
-diff -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
---- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc     1969-12-31 18:00:00.000000000 -0600
-+++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/codecvt_members.cc     2005-04-27 22:20:27.574248167 -0500
-@@ -0,0 +1,306 @@
-+// std::codecvt implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.1.5 - Template class codecvt
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+namespace std
-+{
-+  // Specializations.
-+#ifdef _GLIBCXX_USE_WCHAR_T
-+  codecvt_base::result
-+  codecvt<wchar_t, char, mbstate_t>::
-+  do_out(state_type& __state, const intern_type* __from, 
-+       const intern_type* __from_end, const intern_type*& __from_next,
-+       extern_type* __to, extern_type* __to_end,
-+       extern_type*& __to_next) const
-+  {
-+    result __ret = ok;
-+    state_type __tmp_state(__state);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
-+#endif
-+
-+    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
-+    // in case we fall back to wcrtomb and then continue, in a loop.
-+    // NB: wcsnrtombs is a GNU extension
-+    for (__from_next = __from, __to_next = __to;
-+       __from_next < __from_end && __to_next < __to_end
-+       && __ret == ok;)
-+      {
-+      const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
-+                                                    __from_end - __from_next);
-+      if (!__from_chunk_end)
-+        __from_chunk_end = __from_end;
-+
-+      __from = __from_next;
-+      const size_t __conv = wcsnrtombs(__to_next, &__from_next,
-+                                       __from_chunk_end - __from_next,
-+                                       __to_end - __to_next, &__state);
-+      if (__conv == static_cast<size_t>(-1))
-+        {
-+          // In case of error, in order to stop at the exact place we
-+          // have to start again from the beginning with a series of
-+          // wcrtomb.
-+          for (; __from < __from_next; ++__from)
-+            __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
-+          __state = __tmp_state;
-+          __ret = error;
-+        }
-+      else if (__from_next && __from_next < __from_chunk_end)
-+        {
-+          __to_next += __conv;
-+          __ret = partial;
-+        }
-+      else
-+        {
-+          __from_next = __from_chunk_end;
-+          __to_next += __conv;
-+        }
-+
-+      if (__from_next < __from_end && __ret == ok)
-+        {
-+          extern_type __buf[MB_LEN_MAX];
-+          __tmp_state = __state;
-+          const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
-+          if (__conv > static_cast<size_t>(__to_end - __to_next))
-+            __ret = partial;
-+          else
-+            {
-+              memcpy(__to_next, __buf, __conv);
-+              __state = __tmp_state;
-+              __to_next += __conv;
-+              ++__from_next;
-+            }
-+        }
-+      }
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+
-+    return __ret; 
-+  }
-+  
-+  codecvt_base::result
-+  codecvt<wchar_t, char, mbstate_t>::
-+  do_in(state_type& __state, const extern_type* __from, 
-+      const extern_type* __from_end, const extern_type*& __from_next,
-+      intern_type* __to, intern_type* __to_end,
-+      intern_type*& __to_next) const
-+  {
-+    result __ret = ok;
-+    state_type __tmp_state(__state);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
-+#endif
-+
-+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
-+    // in case we store a L'\0' and then continue, in a loop.
-+    // NB: mbsnrtowcs is a GNU extension
-+    for (__from_next = __from, __to_next = __to;
-+       __from_next < __from_end && __to_next < __to_end
-+       && __ret == ok;)
-+      {
-+      const extern_type* __from_chunk_end;
-+      __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
-+                                                                __from_end
-+                                                                - __from_next));
-+      if (!__from_chunk_end)
-+        __from_chunk_end = __from_end;
-+
-+      __from = __from_next;
-+      size_t __conv = mbsnrtowcs(__to_next, &__from_next,
-+                                 __from_chunk_end - __from_next,
-+                                 __to_end - __to_next, &__state);
-+      if (__conv == static_cast<size_t>(-1))
-+        {
-+          // In case of error, in order to stop at the exact place we
-+          // have to start again from the beginning with a series of
-+          // mbrtowc.
-+          for (;; ++__to_next, __from += __conv)
-+            {
-+              __conv = mbrtowc(__to_next, __from, __from_end - __from,
-+                               &__tmp_state);
-+              if (__conv == static_cast<size_t>(-1)
-+                  || __conv == static_cast<size_t>(-2))
-+                break;
-+            }
-+          __from_next = __from;
-+          __state = __tmp_state;          
-+          __ret = error;
-+        }
-+      else if (__from_next && __from_next < __from_chunk_end)
-+        {
-+          // It is unclear what to return in this case (see DR 382). 
-+          __to_next += __conv;
-+          __ret = partial;
-+        }
-+      else
-+        {
-+          __from_next = __from_chunk_end;
-+          __to_next += __conv;
-+        }
-+
-+      if (__from_next < __from_end && __ret == ok)
-+        {
-+          if (__to_next < __to_end)
-+            {
-+              // XXX Probably wrong for stateful encodings
-+              __tmp_state = __state;          
-+              ++__from_next;
-+              *__to_next++ = L'\0';
-+            }
-+          else
-+            __ret = partial;
-+        }
-+      }
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+
-+    return __ret; 
-+  }
-+
-+  int 
-+  codecvt<wchar_t, char, mbstate_t>::
-+  do_encoding() const throw()
-+  {
-+    // XXX This implementation assumes that the encoding is
-+    // stateless and is either single-byte or variable-width.
-+    int __ret = 0;
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
-+#endif
-+    if (MB_CUR_MAX == 1)
-+      __ret = 1;
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+    return __ret;
-+  }  
-+
-+  int 
-+  codecvt<wchar_t, char, mbstate_t>::
-+  do_max_length() const throw()
-+  {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
-+#endif
-+    // XXX Probably wrong for stateful encodings.
-+    int __ret = MB_CUR_MAX;
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+    return __ret;
-+  }
-+  
-+  int 
-+  codecvt<wchar_t, char, mbstate_t>::
-+  do_length(state_type& __state, const extern_type* __from,
-+          const extern_type* __end, size_t __max) const
-+  {
-+    int __ret = 0;
-+    state_type __tmp_state(__state);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
-+#endif
-+
-+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
-+    // in case we advance past it and then continue, in a loop.
-+    // NB: mbsnrtowcs is a GNU extension
-+  
-+    // A dummy internal buffer is needed in order for mbsnrtocws to consider
-+    // its fourth parameter (it wouldn't with NULL as first parameter).
-+    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
-+                                                         * __max));
-+    while (__from < __end && __max)
-+      {
-+      const extern_type* __from_chunk_end;
-+      __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
-+                                                                __end
-+                                                                - __from));
-+      if (!__from_chunk_end)
-+        __from_chunk_end = __end;
-+
-+      const extern_type* __tmp_from = __from;
-+      size_t __conv = mbsnrtowcs(__to, &__from,
-+                                 __from_chunk_end - __from,
-+                                 __max, &__state);
-+      if (__conv == static_cast<size_t>(-1))
-+        {
-+          // In case of error, in order to stop at the exact place we
-+          // have to start again from the beginning with a series of
-+          // mbrtowc.
-+          for (__from = __tmp_from;; __from += __conv)
-+            {
-+              __conv = mbrtowc(NULL, __from, __end - __from,
-+                               &__tmp_state);
-+              if (__conv == static_cast<size_t>(-1)
-+                  || __conv == static_cast<size_t>(-2))
-+                break;
-+            }
-+          __state = __tmp_state;
-+          __ret += __from - __tmp_from;
-+          break;
-+        }
-+      if (!__from)
-+        __from = __from_chunk_end;
-+      
-+      __ret += __from - __tmp_from;
-+      __max -= __conv;
-+
-+      if (__from < __end && __max)
-+        {
-+          // XXX Probably wrong for stateful encodings
-+          __tmp_state = __state;
-+          ++__from;
-+          ++__ret;
-+          --__max;
-+        }
-+      }
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+
-+    return __ret; 
-+  }
-+#endif
-+}
-diff -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/collate_members.cc
---- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/collate_members.cc     1969-12-31 18:00:00.000000000 -0600
-+++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/collate_members.cc     2005-04-27 22:20:27.575248001 -0500
-@@ -0,0 +1,80 @@
-+// std::collate implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
-+#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
-+#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
-+#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
-+#endif
-+
-+namespace std
-+{
-+  // These are basically extensions to char_traits, and perhaps should
-+  // be put there instead of here.
-+  template<>
-+    int 
-+    collate<char>::_M_compare(const char* __one, const char* __two) const
-+    { 
-+      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
-+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
-+    }
-+  
-+  template<>
-+    size_t
-+    collate<char>::_M_transform(char* __to, const char* __from, 
-+                              size_t __n) const 
-+    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
-+
-+#ifdef _GLIBCXX_USE_WCHAR_T
-+  template<>
-+    int 
-+    collate<wchar_t>::_M_compare(const wchar_t* __one, 
-+                               const wchar_t* __two) const
-+    {
-+      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
-+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
-+    }
-+  
-+  template<>
-+    size_t
-+    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
-+                                 size_t __n) const
-+    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
-+#endif
-+}
-diff -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/ctype_members.cc
---- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc       1969-12-31 18:00:00.000000000 -0600
-+++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/ctype_members.cc       2005-04-27 22:20:27.595244687 -0500
-@@ -0,0 +1,300 @@
-+// std::ctype implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#define _LIBC
-+#include <locale>
-+#undef _LIBC
-+#include <bits/c++locale_internal.h>
-+
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __wctype_l(S, L)           wctype((S))
-+#define __towupper_l(C, L)         towupper((C))
-+#define __towlower_l(C, L)         towlower((C))
-+#define __iswctype_l(C, M, L)      iswctype((C), (M))
-+#endif
-+
-+namespace std
-+{
-+  // NB: The other ctype<char> specializations are in src/locale.cc and
-+  // various /config/os/* files.
-+  template<>
-+    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
-+    : ctype<char>(0, false, __refs) 
-+    {                 
-+      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
-+      {
-+        this->_S_destroy_c_locale(this->_M_c_locale_ctype);
-+        this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+        this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
-+        this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
-+        this->_M_table = this->_M_c_locale_ctype->__ctype_b;
-+#endif
-+      }
-+    }
-+
-+#ifdef _GLIBCXX_USE_WCHAR_T  
-+  ctype<wchar_t>::__wmask_type
-+  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
-+  {
-+    __wmask_type __ret;
-+    switch (__m)
-+      {
-+      case space:
-+      __ret = __wctype_l("space", _M_c_locale_ctype);
-+      break;
-+      case print:
-+      __ret = __wctype_l("print", _M_c_locale_ctype);
-+      break;
-+      case cntrl:
-+      __ret = __wctype_l("cntrl", _M_c_locale_ctype);
-+      break;
-+      case upper:
-+      __ret = __wctype_l("upper", _M_c_locale_ctype);
-+      break;
-+      case lower:
-+      __ret = __wctype_l("lower", _M_c_locale_ctype);
-+      break;
-+      case alpha:
-+      __ret = __wctype_l("alpha", _M_c_locale_ctype);
-+      break;
-+      case digit:
-+      __ret = __wctype_l("digit", _M_c_locale_ctype);
-+      break;
-+      case punct:
-+      __ret = __wctype_l("punct", _M_c_locale_ctype);
-+      break;
-+      case xdigit:
-+      __ret = __wctype_l("xdigit", _M_c_locale_ctype);
-+      break;
-+      case alnum:
-+      __ret = __wctype_l("alnum", _M_c_locale_ctype);
-+      break;
-+      case graph:
-+      __ret = __wctype_l("graph", _M_c_locale_ctype);
-+      break;
-+      default:
-+      __ret = 0;
-+      }
-+    return __ret;
-+  }
-+  
-+  wchar_t
-+  ctype<wchar_t>::do_toupper(wchar_t __c) const
-+  { return __towupper_l(__c, _M_c_locale_ctype); }
-+
-+  const wchar_t*
-+  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
-+  {
-+    while (__lo < __hi)
-+      {
-+        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
-+        ++__lo;
-+      }
-+    return __hi;
-+  }
-+  
-+  wchar_t
-+  ctype<wchar_t>::do_tolower(wchar_t __c) const
-+  { return __towlower_l(__c, _M_c_locale_ctype); }
-+  
-+  const wchar_t*
-+  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
-+  {
-+    while (__lo < __hi)
-+      {
-+        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
-+        ++__lo;
-+      }
-+    return __hi;
-+  }
-+
-+  bool
-+  ctype<wchar_t>::
-+  do_is(mask __m, wchar_t __c) const
-+  { 
-+    // Highest bitmask in ctype_base == 10, but extra in "C"
-+    // library for blank.
-+    bool __ret = false;
-+    const size_t __bitmasksize = 11; 
-+    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
-+      if (__m & _M_bit[__bitcur]
-+        && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
-+      {
-+        __ret = true;
-+        break;
-+      }
-+    return __ret;    
-+  }
-+  
-+  const wchar_t* 
-+  ctype<wchar_t>::
-+  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
-+  {
-+    for (; __lo < __hi; ++__vec, ++__lo)
-+      {
-+      // Highest bitmask in ctype_base == 10, but extra in "C"
-+      // library for blank.
-+      const size_t __bitmasksize = 11; 
-+      mask __m = 0;
-+      for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
-+        if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
-+          __m |= _M_bit[__bitcur];
-+      *__vec = __m;
-+      }
-+    return __hi;
-+  }
-+  
-+  const wchar_t* 
-+  ctype<wchar_t>::
-+  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
-+  {
-+    while (__lo < __hi && !this->do_is(__m, *__lo))
-+      ++__lo;
-+    return __lo;
-+  }
-+
-+  const wchar_t*
-+  ctype<wchar_t>::
-+  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
-+  {
-+    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
-+      ++__lo;
-+    return __lo;
-+  }
-+
-+  wchar_t
-+  ctype<wchar_t>::
-+  do_widen(char __c) const
-+  { return _M_widen[static_cast<unsigned char>(__c)]; }
-+
-+  const char* 
-+  ctype<wchar_t>::
-+  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
-+  {
-+    while (__lo < __hi)
-+      {
-+      *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
-+      ++__lo;
-+      ++__dest;
-+      }
-+    return __hi;
-+  }
-+
-+  char
-+  ctype<wchar_t>::
-+  do_narrow(wchar_t __wc, char __dfault) const
-+  {
-+    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
-+      return _M_narrow[__wc];
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_ctype);
-+#endif
-+    const int __c = wctob(__wc);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
-+  }
-+
-+  const wchar_t*
-+  ctype<wchar_t>::
-+  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
-+          char* __dest) const
-+  {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_ctype);
-+#endif
-+    if (_M_narrow_ok)
-+      while (__lo < __hi)
-+      {
-+        if (*__lo >= 0 && *__lo < 128)
-+          *__dest = _M_narrow[*__lo];
-+        else
-+          {
-+            const int __c = wctob(*__lo);
-+            *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
-+          }
-+        ++__lo;
-+        ++__dest;
-+      }
-+    else
-+      while (__lo < __hi)
-+      {
-+        const int __c = wctob(*__lo);
-+        *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
-+        ++__lo;
-+        ++__dest;
-+      }
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+    return __hi;
-+  }
-+
-+  void
-+  ctype<wchar_t>::_M_initialize_ctype()
-+  {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __c_locale __old = __uselocale(_M_c_locale_ctype);
-+#endif
-+    wint_t __i;
-+    for (__i = 0; __i < 128; ++__i)
-+      {
-+      const int __c = wctob(__i);
-+      if (__c == EOF)
-+        break;
-+      else
-+        _M_narrow[__i] = static_cast<char>(__c);
-+      }
-+    if (__i == 128)
-+      _M_narrow_ok = true;
-+    else
-+      _M_narrow_ok = false;
-+    for (size_t __j = 0;
-+       __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
-+      _M_widen[__j] = btowc(__j);
-+
-+    for (size_t __k = 0; __k <= 11; ++__k)
-+      { 
-+      _M_bit[__k] = static_cast<mask>(_ISbit(__k));
-+      _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
-+      }
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+    __uselocale(__old);
-+#endif
-+  }
-+#endif //  _GLIBCXX_USE_WCHAR_T
-+}
-diff -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/messages_members.cc
---- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.cc    1969-12-31 18:00:00.000000000 -0600
-+++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/messages_members.cc    2005-04-27 22:20:27.618240876 -0500
-@@ -0,0 +1,100 @@
-+// std::messages implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix gettext stuff
-+#endif
-+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
-+extern "C" char *__dcgettext(const char *domainname,
-+                           const char *msgid, int category);
-+#undef gettext
-+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
-+#else
-+#undef gettext
-+#define gettext(msgid) (msgid)
-+#endif
-+
-+namespace std
-+{
-+  // Specializations.
-+  template<>
-+    string
-+    messages<char>::do_get(catalog, int, int, const string& __dfault) const
-+    {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+      __c_locale __old = __uselocale(_M_c_locale_messages);
-+      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
-+      __uselocale(__old);
-+      return string(__msg);
-+#elif defined __UCLIBC_HAS_LOCALE__
-+      char* __old = strdup(setlocale(LC_ALL, NULL));
-+      setlocale(LC_ALL, _M_name_messages);
-+      const char* __msg = gettext(__dfault.c_str());
-+      setlocale(LC_ALL, __old);
-+      free(__old);
-+      return string(__msg);
-+#else
-+      const char* __msg = gettext(__dfault.c_str());
-+      return string(__msg);
-+#endif
-+    }
-+
-+#ifdef _GLIBCXX_USE_WCHAR_T
-+  template<>
-+    wstring
-+    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
-+    {
-+# ifdef __UCLIBC_HAS_XLOCALE__
-+      __c_locale __old = __uselocale(_M_c_locale_messages);
-+      char* __msg = gettext(_M_convert_to_char(__dfault));
-+      __uselocale(__old);
-+      return _M_convert_from_char(__msg);
-+# elif defined __UCLIBC_HAS_LOCALE__
-+      char* __old = strdup(setlocale(LC_ALL, NULL));
-+      setlocale(LC_ALL, _M_name_messages);
-+      char* __msg = gettext(_M_convert_to_char(__dfault));
-+      setlocale(LC_ALL, __old);
-+      free(__old);
-+      return _M_convert_from_char(__msg);
-+# else
-+      char* __msg = gettext(_M_convert_to_char(__dfault));
-+      return _M_convert_from_char(__msg);
-+# endif
-+    }
-+#endif
-+}
-diff -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/messages_members.h
---- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.h     1969-12-31 18:00:00.000000000 -0600
-+++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/messages_members.h     2005-04-27 22:20:27.619240710 -0500
-@@ -0,0 +1,118 @@
-+// std::messages implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.7.1.2  messages functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix prototypes for *textdomain funcs
-+#endif
-+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
-+extern "C" char *__textdomain(const char *domainname);
-+extern "C" char *__bindtextdomain(const char *domainname,
-+                                const char *dirname);
-+#else
-+#undef __textdomain
-+#undef __bindtextdomain
-+#define __textdomain(D)           ((void)0)
-+#define __bindtextdomain(D,P)     ((void)0)
-+#endif
-+
-+  // Non-virtual member functions.
-+  template<typename _CharT>
-+     messages<_CharT>::messages(size_t __refs)
-+     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
-+     _M_name_messages(_S_get_c_name())
-+     { }
-+
-+  template<typename _CharT>
-+     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
-+                              size_t __refs) 
-+     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
-+     _M_name_messages(__s)
-+     {
-+       char* __tmp = new char[std::strlen(__s) + 1];
-+       std::strcpy(__tmp, __s);
-+       _M_name_messages = __tmp;
-+     }
-+
-+  template<typename _CharT>
-+    typename messages<_CharT>::catalog 
-+    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
-+                         const char* __dir) const
-+    { 
-+      __bindtextdomain(__s.c_str(), __dir);
-+      return this->do_open(__s, __loc); 
-+    }
-+
-+  // Virtual member functions.
-+  template<typename _CharT>
-+    messages<_CharT>::~messages()
-+    { 
-+      if (_M_name_messages != _S_get_c_name())
-+      delete [] _M_name_messages;
-+      _S_destroy_c_locale(_M_c_locale_messages); 
-+    }
-+
-+  template<typename _CharT>
-+    typename messages<_CharT>::catalog 
-+    messages<_CharT>::do_open(const basic_string<char>& __s, 
-+                            const locale&) const
-+    { 
-+      // No error checking is done, assume the catalog exists and can
-+      // be used.
-+      __textdomain(__s.c_str());
-+      return 0;
-+    }
-+
-+  template<typename _CharT>
-+    void    
-+    messages<_CharT>::do_close(catalog) const 
-+    { }
-+
-+   // messages_byname
-+   template<typename _CharT>
-+     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
-+     : messages<_CharT>(__refs) 
-+     { 
-+       if (this->_M_name_messages != locale::facet::_S_get_c_name())
-+       delete [] this->_M_name_messages;
-+       char* __tmp = new char[std::strlen(__s) + 1];
-+       std::strcpy(__tmp, __s);
-+       this->_M_name_messages = __tmp;
-+
-+       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
-+       {
-+         this->_S_destroy_c_locale(this->_M_c_locale_messages);
-+         this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
-+       }
-+     }
-diff -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/monetary_members.cc
---- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc    1969-12-31 18:00:00.000000000 -0600
-+++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/monetary_members.cc    2005-04-27 22:20:27.621240379 -0500
-@@ -0,0 +1,698 @@
-+// std::moneypunct implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#define _LIBC
-+#include <locale>
-+#undef _LIBC
-+#include <bits/c++locale_internal.h>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning optimize this for uclibc
-+#warning tailor for stub locale support
-+#endif
-+
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
-+#endif
-+
-+namespace std
-+{
-+  // Construct and return valid pattern consisting of some combination of:
-+  // space none symbol sign value
-+  money_base::pattern
-+  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
-+  { 
-+    pattern __ret;
-+
-+    // This insanely complicated routine attempts to construct a valid
-+    // pattern for use with monyepunct. A couple of invariants:
-+
-+    // if (__precedes) symbol -> value
-+    // else value -> symbol
-+    
-+    // if (__space) space
-+    // else none
-+
-+    // none == never first
-+    // space never first or last
-+
-+    // Any elegant implementations of this are welcome.
-+    switch (__posn)
-+      {
-+      case 0:
-+      case 1:
-+      // 1 The sign precedes the value and symbol.
-+      __ret.field[0] = sign;
-+      if (__space)
-+        {
-+          // Pattern starts with sign.
-+          if (__precedes)
-+            {
-+              __ret.field[1] = symbol;
-+              __ret.field[3] = value;
-+            }
-+          else
-+            {
-+              __ret.field[1] = value;
-+              __ret.field[3] = symbol;
-+            }
-+          __ret.field[2] = space;
-+        }
-+      else
-+        {
-+          // Pattern starts with sign and ends with none.
-+          if (__precedes)
-+            {
-+              __ret.field[1] = symbol;
-+              __ret.field[2] = value;
-+            }
-+          else
-+            {
-+              __ret.field[1] = value;
-+              __ret.field[2] = symbol;
-+            }
-+          __ret.field[3] = none;
-+        }
-+      break;
-+      case 2:
-+      // 2 The sign follows the value and symbol.
-+      if (__space)
-+        {
-+          // Pattern either ends with sign.
-+          if (__precedes)
-+            {
-+              __ret.field[0] = symbol;
-+              __ret.field[2] = value;
-+            }
-+          else
-+            {
-+              __ret.field[0] = value;
-+              __ret.field[2] = symbol;
-+            }
-+          __ret.field[1] = space;
-+          __ret.field[3] = sign;
-+        }
-+      else
-+        {
-+          // Pattern ends with sign then none.
-+          if (__precedes)
-+            {
-+              __ret.field[0] = symbol;
-+              __ret.field[1] = value;
-+            }
-+          else
-+            {
-+              __ret.field[0] = value;
-+              __ret.field[1] = symbol;
-+            }
-+          __ret.field[2] = sign;
-+          __ret.field[3] = none;
-+        }
-+      break;
-+      case 3:
-+      // 3 The sign immediately precedes the symbol.
-+      if (__precedes)
-+        {
-+          __ret.field[0] = sign;
-+          __ret.field[1] = symbol;        
-+          if (__space)
-+            {
-+              __ret.field[2] = space;
-+              __ret.field[3] = value;
-+            }
-+          else
-+            {
-+              __ret.field[2] = value;         
-+              __ret.field[3] = none;
-+            }
-+        }
-+      else
-+        {
-+          __ret.field[0] = value;
-+          if (__space)
-+            {
-+              __ret.field[1] = space;
-+              __ret.field[2] = sign;
-+              __ret.field[3] = symbol;
-+            }
-+          else
-+            {
-+              __ret.field[1] = sign;
-+              __ret.field[2] = symbol;
-+              __ret.field[3] = none;
-+            }
-+        }
-+      break;
-+      case 4:
-+      // 4 The sign immediately follows the symbol.
-+      if (__precedes)
-+        {
-+          __ret.field[0] = symbol;
-+          __ret.field[1] = sign;
-+          if (__space)
-+            {
-+              __ret.field[2] = space;
-+              __ret.field[3] = value;
-+            }
-+          else
-+            {
-+              __ret.field[2] = value;
-+              __ret.field[3] = none;
-+            }
-+        }
-+      else
-+        {
-+          __ret.field[0] = value;
-+          if (__space)
-+            {
-+              __ret.field[1] = space;
-+              __ret.field[2] = symbol;
-+              __ret.field[3] = sign;
-+            }
-+          else
-+            {
-+              __ret.field[1] = symbol;
-+              __ret.field[2] = sign;
-+              __ret.field[3] = none;
-+            }
-+        }
-+      break;
-+      default:
-+      ;
-+      }
-+    return __ret;
-+  }
-+
-+  template<> 
-+    void
-+    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
-+                                                   const char*)
-+    {
-+      if (!_M_data)
-+      _M_data = new __moneypunct_cache<char, true>;
-+
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_data->_M_decimal_point = '.';
-+        _M_data->_M_thousands_sep = ',';
-+        _M_data->_M_grouping = "";
-+        _M_data->_M_grouping_size = 0;
-+        _M_data->_M_curr_symbol = "";
-+        _M_data->_M_curr_symbol_size = 0;
-+        _M_data->_M_positive_sign = "";
-+        _M_data->_M_positive_sign_size = 0;
-+        _M_data->_M_negative_sign = "";
-+        _M_data->_M_negative_sign_size = 0;
-+        _M_data->_M_frac_digits = 0;
-+        _M_data->_M_pos_format = money_base::_S_default_pattern;
-+        _M_data->_M_neg_format = money_base::_S_default_pattern;
-+
-+        for (size_t __i = 0; __i < money_base::_S_end; ++__i)
-+          _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
-+      }
-+      else
-+      {
-+        // Named locale.
-+        _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
-+                                                      __cloc));
-+        _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
-+                                                      __cloc));
-+        _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
-+        _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
-+        _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
-+        _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
-+
-+        char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
-+        if (!__nposn)
-+          _M_data->_M_negative_sign = "()";
-+        else
-+          _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
-+                                                      __cloc);
-+        _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
-+
-+        // _Intl == true
-+        _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
-+        _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
-+        _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
-+                                                    __cloc));
-+        char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
-+        char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
-+        char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
-+        _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
-+                                                      __pposn);
-+        char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
-+        char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
-+        _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
-+                                                      __nposn);
-+      }
-+    }
-+
-+  template<> 
-+    void
-+    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
-+                                                    const char*)
-+    {
-+      if (!_M_data)
-+      _M_data = new __moneypunct_cache<char, false>;
-+
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_data->_M_decimal_point = '.';
-+        _M_data->_M_thousands_sep = ',';
-+        _M_data->_M_grouping = "";
-+        _M_data->_M_grouping_size = 0;
-+        _M_data->_M_curr_symbol = "";
-+        _M_data->_M_curr_symbol_size = 0;
-+        _M_data->_M_positive_sign = "";
-+        _M_data->_M_positive_sign_size = 0;
-+        _M_data->_M_negative_sign = "";
-+        _M_data->_M_negative_sign_size = 0;
-+        _M_data->_M_frac_digits = 0;
-+        _M_data->_M_pos_format = money_base::_S_default_pattern;
-+        _M_data->_M_neg_format = money_base::_S_default_pattern;
-+
-+        for (size_t __i = 0; __i < money_base::_S_end; ++__i)
-+          _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
-+      }
-+      else
-+      {
-+        // Named locale.
-+        _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
-+                                                      __cloc));
-+        _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
-+                                                      __cloc));
-+        _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
-+        _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
-+        _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
-+        _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
-+
-+        char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
-+        if (!__nposn)
-+          _M_data->_M_negative_sign = "()";
-+        else
-+          _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
-+                                                      __cloc);
-+        _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
-+
-+        // _Intl == false
-+        _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
-+        _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
-+        _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
-+        char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
-+        char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
-+        char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
-+        _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
-+                                                      __pposn);
-+        char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
-+        char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
-+        _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
-+                                                      __nposn);
-+      }
-+    }
-+
-+  template<> 
-+    moneypunct<char, true>::~moneypunct()
-+    { delete _M_data; }
-+
-+  template<> 
-+    moneypunct<char, false>::~moneypunct()
-+    { delete _M_data; }
-+
-+#ifdef _GLIBCXX_USE_WCHAR_T
-+  template<> 
-+    void
-+    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+                                                      const char*)
-+#else
-+                                                      const char* __name)
-+#endif
-+    {
-+      if (!_M_data)
-+      _M_data = new __moneypunct_cache<wchar_t, true>;
-+
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_data->_M_decimal_point = L'.';
-+        _M_data->_M_thousands_sep = L',';
-+        _M_data->_M_grouping = "";
-+        _M_data->_M_grouping_size = 0;
-+        _M_data->_M_curr_symbol = L"";
-+        _M_data->_M_curr_symbol_size = 0;
-+        _M_data->_M_positive_sign = L"";
-+        _M_data->_M_positive_sign_size = 0;
-+        _M_data->_M_negative_sign = L"";
-+        _M_data->_M_negative_sign_size = 0;
-+        _M_data->_M_frac_digits = 0;
-+        _M_data->_M_pos_format = money_base::_S_default_pattern;
-+        _M_data->_M_neg_format = money_base::_S_default_pattern;
-+
-+        // Use ctype::widen code without the facet...
-+        unsigned char uc;
-+        for (size_t __i = 0; __i < money_base::_S_end; ++__i)
-+          {
-+            uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
-+            _M_data->_M_atoms[__i] = btowc(uc);
-+          }
-+      }
-+      else
-+      {
-+        // Named locale.
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+        __c_locale __old = __uselocale(__cloc);
-+#else
-+        // Switch to named locale so that mbsrtowcs will work.
-+        char* __old = strdup(setlocale(LC_ALL, NULL));
-+        setlocale(LC_ALL, __name);
-+#endif
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix this... should be monetary
-+#endif
-+#ifdef __UCLIBC__
-+# ifdef __UCLIBC_HAS_XLOCALE__
-+        _M_data->_M_decimal_point = __cloc->decimal_point_wc;
-+        _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
-+# else
-+        _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
-+        _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
-+# endif
-+#else
-+        union __s_and_w { const char *__s; unsigned int __w; } __u;
-+        __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
-+        _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
-+
-+        __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
-+        _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
-+#endif
-+        _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
-+        _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
-+
-+        const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
-+        const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
-+        const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
-+
-+        wchar_t* __wcs_ps = 0;
-+        wchar_t* __wcs_ns = 0;
-+        const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
-+        try
-+          {
-+            mbstate_t __state;
-+            size_t __len = strlen(__cpossign);
-+            if (__len)
-+              {
-+                ++__len;
-+                memset(&__state, 0, sizeof(mbstate_t));
-+                __wcs_ps = new wchar_t[__len];
-+                mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
-+                _M_data->_M_positive_sign = __wcs_ps;
-+              }
-+            else
-+              _M_data->_M_positive_sign = L"";
-+            _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
-+            
-+            __len = strlen(__cnegsign);
-+            if (!__nposn)
-+              _M_data->_M_negative_sign = L"()";
-+            else if (__len)
-+              { 
-+                ++__len;
-+                memset(&__state, 0, sizeof(mbstate_t));
-+                __wcs_ns = new wchar_t[__len];
-+                mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
-+                _M_data->_M_negative_sign = __wcs_ns;
-+              }
-+            else
-+              _M_data->_M_negative_sign = L"";
-+            _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
-+            
-+            // _Intl == true.
-+            __len = strlen(__ccurr);
-+            if (__len)
-+              {
-+                ++__len;
-+                memset(&__state, 0, sizeof(mbstate_t));
-+                wchar_t* __wcs = new wchar_t[__len];
-+                mbsrtowcs(__wcs, &__ccurr, __len, &__state);
-+                _M_data->_M_curr_symbol = __wcs;
-+              }
-+            else
-+              _M_data->_M_curr_symbol = L"";
-+            _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
-+          }
-+        catch (...)
-+          {
-+            delete _M_data;
-+            _M_data = 0;
-+            delete __wcs_ps;
-+            delete __wcs_ns;        
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+            __uselocale(__old);
-+#else
-+            setlocale(LC_ALL, __old);
-+            free(__old);
-+#endif
-+            __throw_exception_again;
-+          } 
-+        
-+        _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
-+                                                    __cloc));
-+        char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
-+        char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
-+        char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
-+        _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
-+                                                      __pposn);
-+        char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
-+        char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
-+        _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
-+                                                      __nposn);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+        __uselocale(__old);
-+#else
-+        setlocale(LC_ALL, __old);
-+        free(__old);
-+#endif
-+      }
-+    }
-+
-+  template<> 
-+  void
-+  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+                                                     const char*)
-+#else
-+                                                       const char* __name)
-+#endif
-+  {
-+    if (!_M_data)
-+      _M_data = new __moneypunct_cache<wchar_t, false>;
-+
-+    if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_data->_M_decimal_point = L'.';
-+        _M_data->_M_thousands_sep = L',';
-+        _M_data->_M_grouping = "";
-+          _M_data->_M_grouping_size = 0;
-+        _M_data->_M_curr_symbol = L"";
-+        _M_data->_M_curr_symbol_size = 0;
-+        _M_data->_M_positive_sign = L"";
-+        _M_data->_M_positive_sign_size = 0;
-+        _M_data->_M_negative_sign = L"";
-+        _M_data->_M_negative_sign_size = 0;
-+        _M_data->_M_frac_digits = 0;
-+        _M_data->_M_pos_format = money_base::_S_default_pattern;
-+        _M_data->_M_neg_format = money_base::_S_default_pattern;
-+
-+        // Use ctype::widen code without the facet...
-+        unsigned char uc;
-+        for (size_t __i = 0; __i < money_base::_S_end; ++__i)
-+          {
-+            uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
-+            _M_data->_M_atoms[__i] = btowc(uc);
-+          }
-+      }
-+      else
-+      {
-+        // Named locale.
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+        __c_locale __old = __uselocale(__cloc);
-+#else
-+        // Switch to named locale so that mbsrtowcs will work.
-+        char* __old = strdup(setlocale(LC_ALL, NULL));
-+        setlocale(LC_ALL, __name);
-+#endif
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix this... should be monetary
-+#endif
-+#ifdef __UCLIBC__
-+# ifdef __UCLIBC_HAS_XLOCALE__
-+        _M_data->_M_decimal_point = __cloc->decimal_point_wc;
-+        _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
-+# else
-+        _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
-+        _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
-+# endif
-+#else
-+        union __s_and_w { const char *__s; unsigned int __w; } __u;
-+        __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
-+        _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
-+
-+        __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
-+        _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
-+#endif
-+        _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
-+          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
-+
-+        const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
-+        const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
-+        const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
-+
-+        wchar_t* __wcs_ps = 0;
-+        wchar_t* __wcs_ns = 0;
-+        const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
-+        try
-+            {
-+              mbstate_t __state;
-+              size_t __len;
-+              __len = strlen(__cpossign);
-+              if (__len)
-+                {
-+                ++__len;
-+                memset(&__state, 0, sizeof(mbstate_t));
-+                __wcs_ps = new wchar_t[__len];
-+                mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
-+                _M_data->_M_positive_sign = __wcs_ps;
-+              }
-+            else
-+              _M_data->_M_positive_sign = L"";
-+              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
-+            
-+            __len = strlen(__cnegsign);
-+            if (!__nposn)
-+              _M_data->_M_negative_sign = L"()";
-+            else if (__len)
-+              { 
-+                ++__len;
-+                memset(&__state, 0, sizeof(mbstate_t));
-+                __wcs_ns = new wchar_t[__len];
-+                mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
-+                _M_data->_M_negative_sign = __wcs_ns;
-+              }
-+            else
-+              _M_data->_M_negative_sign = L"";
-+              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
-+
-+            // _Intl == true.
-+            __len = strlen(__ccurr);
-+            if (__len)
-+              {
-+                ++__len;
-+                memset(&__state, 0, sizeof(mbstate_t));
-+                wchar_t* __wcs = new wchar_t[__len];
-+                mbsrtowcs(__wcs, &__ccurr, __len, &__state);
-+                _M_data->_M_curr_symbol = __wcs;
-+              }
-+            else
-+              _M_data->_M_curr_symbol = L"";
-+              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
-+          }
-+          catch (...)
-+          {
-+            delete _M_data;
-+              _M_data = 0;
-+            delete __wcs_ps;
-+            delete __wcs_ns;        
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+            __uselocale(__old);
-+#else
-+            setlocale(LC_ALL, __old);
-+            free(__old);
-+#endif
-+              __throw_exception_again;
-+          }
-+
-+        _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
-+        char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
-+        char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
-+        char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
-+        _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
-+                                                      __pposn);
-+        char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
-+        char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
-+        _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
-+                                                      __nposn);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+        __uselocale(__old);
-+#else
-+        setlocale(LC_ALL, __old);
-+        free(__old);
-+#endif
-+      }
-+    }
-+
-+  template<> 
-+    moneypunct<wchar_t, true>::~moneypunct()
-+    {
-+      if (_M_data->_M_positive_sign_size)
-+      delete [] _M_data->_M_positive_sign;
-+      if (_M_data->_M_negative_sign_size
-+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
-+      delete [] _M_data->_M_negative_sign;
-+      if (_M_data->_M_curr_symbol_size)
-+      delete [] _M_data->_M_curr_symbol;
-+      delete _M_data;
-+    }
-+
-+  template<> 
-+    moneypunct<wchar_t, false>::~moneypunct()
-+    {
-+      if (_M_data->_M_positive_sign_size)
-+      delete [] _M_data->_M_positive_sign;
-+      if (_M_data->_M_negative_sign_size
-+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
-+      delete [] _M_data->_M_negative_sign;
-+      if (_M_data->_M_curr_symbol_size)
-+      delete [] _M_data->_M_curr_symbol;
-+      delete _M_data;
-+    }
-+#endif
-+}
-diff -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/numeric_members.cc
---- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc     1969-12-31 18:00:00.000000000 -0600
-+++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/numeric_members.cc     2005-04-27 22:20:27.623240047 -0500
-@@ -0,0 +1,183 @@
-+// std::numpunct implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#define _LIBC
-+#include <locale>
-+#undef _LIBC
-+#include <bits/c++locale_internal.h>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning tailor for stub locale support
-+#endif
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
-+#endif
-+
-+namespace std
-+{
-+  template<> 
-+    void
-+    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
-+    {
-+      if (!_M_data)
-+      _M_data = new __numpunct_cache<char>;
-+
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_data->_M_grouping = "";
-+        _M_data->_M_grouping_size = 0;
-+        _M_data->_M_use_grouping = false;
-+
-+        _M_data->_M_decimal_point = '.';
-+        _M_data->_M_thousands_sep = ',';
-+
-+        for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
-+          _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
-+
-+        for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
-+          _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
-+      }
-+      else
-+      {
-+        // Named locale.
-+        _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
-+                                                      __cloc));
-+        _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
-+                                                      __cloc));
-+
-+        // Check for NULL, which implies no grouping.
-+        if (_M_data->_M_thousands_sep == '\0')
-+          _M_data->_M_grouping = "";
-+        else
-+          _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
-+        _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
-+      }
-+
-+      // NB: There is no way to extact this info from posix locales.
-+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
-+      _M_data->_M_truename = "true";
-+      _M_data->_M_truename_size = strlen(_M_data->_M_truename);
-+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
-+      _M_data->_M_falsename = "false";
-+      _M_data->_M_falsename_size = strlen(_M_data->_M_falsename);
-+    }
-+ 
-+  template<> 
-+    numpunct<char>::~numpunct()
-+    { delete _M_data; }
-+   
-+#ifdef _GLIBCXX_USE_WCHAR_T
-+  template<> 
-+    void
-+    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
-+    {
-+      if (!_M_data)
-+      _M_data = new __numpunct_cache<wchar_t>;
-+
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_data->_M_grouping = "";
-+        _M_data->_M_grouping_size = 0;
-+        _M_data->_M_use_grouping = false;
-+
-+        _M_data->_M_decimal_point = L'.';
-+        _M_data->_M_thousands_sep = L',';
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+        __c_locale __old = __uselocale(_S_get_c_locale());
-+#endif
-+        // Use ctype::widen code without the facet...
-+        unsigned char uc;
-+        for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
-+          {
-+            uc = static_cast<unsigned char>(__num_base::_S_atoms_out[__i]);
-+            _M_data->_M_atoms_out[__i] = btowc(uc);
-+          }
-+
-+        for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
-+          {
-+            uc = static_cast<unsigned char>(__num_base::_S_atoms_in[__j]);
-+            _M_data->_M_atoms_in[__j] = btowc(uc);
-+          }
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+        __uselocale(__old);
-+#endif
-+      }
-+      else
-+      {
-+        // Named locale.
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix this
-+#endif
-+#ifdef __UCLIBC__
-+# ifdef __UCLIBC_HAS_XLOCALE__
-+        _M_data->_M_decimal_point = __cloc->decimal_point_wc;
-+        _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
-+# else
-+        _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
-+        _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
-+# endif
-+#else
-+        union __s_and_w { const char *__s; unsigned int __w; } __u;
-+        __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
-+        _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
-+
-+        __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
-+        _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
-+#endif
-+
-+        if (_M_data->_M_thousands_sep == L'\0')
-+          _M_data->_M_grouping = "";
-+        else
-+          _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
-+        _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
-+      }
-+
-+      // NB: There is no way to extact this info from posix locales.
-+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
-+      _M_data->_M_truename = L"true";
-+      _M_data->_M_truename_size = wcslen(_M_data->_M_truename);
-+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
-+      _M_data->_M_falsename = L"false";
-+      _M_data->_M_falsename_size = wcslen(_M_data->_M_falsename);
-+    }
-+
-+  template<> 
-+    numpunct<wchar_t>::~numpunct()
-+    { delete _M_data; }
-+ #endif
-+}
-diff -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/time_members.cc
---- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.cc        1969-12-31 18:00:00.000000000 -0600
-+++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/time_members.cc        2005-04-27 22:20:27.624239882 -0500
-@@ -0,0 +1,356 @@
-+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
-+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning tailor for stub locale support
-+#endif
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
-+#endif
-+
-+namespace std
-+{
-+  template<>
-+    void
-+    __timepunct<char>::
-+    _M_put(char* __s, size_t __maxlen, const char* __format, 
-+         const tm* __tm) const
-+    {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
-+                                      _M_c_locale_timepunct);
-+#else
-+      char* __old = strdup(setlocale(LC_ALL, NULL));
-+      setlocale(LC_ALL, _M_name_timepunct);
-+      const size_t __len = strftime(__s, __maxlen, __format, __tm);
-+      setlocale(LC_ALL, __old);
-+      free(__old);
-+#endif
-+      // Make sure __s is null terminated.
-+      if (__len == 0)
-+      __s[0] = '\0';
-+    }
-+
-+  template<> 
-+    void
-+    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
-+    {
-+      if (!_M_data)
-+      _M_data = new __timepunct_cache<char>;
-+
-+      if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_c_locale_timepunct = _S_get_c_locale();
-+
-+        _M_data->_M_date_format = "%m/%d/%y";
-+        _M_data->_M_date_era_format = "%m/%d/%y";
-+        _M_data->_M_time_format = "%H:%M:%S";
-+        _M_data->_M_time_era_format = "%H:%M:%S";
-+        _M_data->_M_date_time_format = "";
-+        _M_data->_M_date_time_era_format = "";
-+        _M_data->_M_am = "AM";
-+        _M_data->_M_pm = "PM";
-+        _M_data->_M_am_pm_format = "";
-+
-+        // Day names, starting with "C"'s Sunday.
-+        _M_data->_M_day1 = "Sunday";
-+        _M_data->_M_day2 = "Monday";
-+        _M_data->_M_day3 = "Tuesday";
-+        _M_data->_M_day4 = "Wednesday";
-+        _M_data->_M_day5 = "Thursday";
-+        _M_data->_M_day6 = "Friday";
-+        _M_data->_M_day7 = "Saturday";
-+
-+        // Abbreviated day names, starting with "C"'s Sun.
-+        _M_data->_M_aday1 = "Sun";
-+        _M_data->_M_aday2 = "Mon";
-+        _M_data->_M_aday3 = "Tue";
-+        _M_data->_M_aday4 = "Wed";
-+        _M_data->_M_aday5 = "Thu";
-+        _M_data->_M_aday6 = "Fri";
-+        _M_data->_M_aday7 = "Sat";
-+
-+        // Month names, starting with "C"'s January.
-+        _M_data->_M_month01 = "January";
-+        _M_data->_M_month02 = "February";
-+        _M_data->_M_month03 = "March";
-+        _M_data->_M_month04 = "April";
-+        _M_data->_M_month05 = "May";
-+        _M_data->_M_month06 = "June";
-+        _M_data->_M_month07 = "July";
-+        _M_data->_M_month08 = "August";
-+        _M_data->_M_month09 = "September";
-+        _M_data->_M_month10 = "October";
-+        _M_data->_M_month11 = "November";
-+        _M_data->_M_month12 = "December";
-+
-+        // Abbreviated month names, starting with "C"'s Jan.
-+        _M_data->_M_amonth01 = "Jan";
-+        _M_data->_M_amonth02 = "Feb";
-+        _M_data->_M_amonth03 = "Mar";
-+        _M_data->_M_amonth04 = "Apr";
-+        _M_data->_M_amonth05 = "May";
-+        _M_data->_M_amonth06 = "Jun";
-+        _M_data->_M_amonth07 = "Jul";
-+        _M_data->_M_amonth08 = "Aug";
-+        _M_data->_M_amonth09 = "Sep";
-+        _M_data->_M_amonth10 = "Oct";
-+        _M_data->_M_amonth11 = "Nov";
-+        _M_data->_M_amonth12 = "Dec";
-+      }
-+      else
-+      {
-+        _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
-+
-+        _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
-+        _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
-+        _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
-+        _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
-+        _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
-+        _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, __cloc);
-+        _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
-+        _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
-+        _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
-+
-+        // Day names, starting with "C"'s Sunday.
-+        _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
-+        _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
-+        _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
-+        _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
-+        _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
-+        _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
-+        _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
-+
-+        // Abbreviated day names, starting with "C"'s Sun.
-+        _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
-+        _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
-+        _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
-+        _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
-+        _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
-+        _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
-+        _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
-+
-+        // Month names, starting with "C"'s January.
-+        _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
-+        _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
-+        _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
-+        _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
-+        _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
-+        _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
-+        _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
-+        _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
-+        _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
-+        _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
-+        _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
-+        _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
-+
-+        // Abbreviated month names, starting with "C"'s Jan.
-+        _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
-+        _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
-+        _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
-+        _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
-+        _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
-+        _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
-+        _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
-+        _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
-+        _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
-+        _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
-+        _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
-+        _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
-+      }
-+    }
-+
-+#ifdef _GLIBCXX_USE_WCHAR_T
-+  template<>
-+    void
-+    __timepunct<wchar_t>::
-+    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
-+         const tm* __tm) const
-+    {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
-+      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
-+                                      _M_c_locale_timepunct);
-+#else
-+      char* __old = strdup(setlocale(LC_ALL, NULL));
-+      setlocale(LC_ALL, _M_name_timepunct);
-+      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
-+      setlocale(LC_ALL, __old);
-+      free(__old);
-+#endif
-+      // Make sure __s is null terminated.
-+      if (__len == 0)
-+      __s[0] = L'\0';
-+    }
-+
-+  template<> 
-+    void
-+    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
-+    {
-+      if (!_M_data)
-+      _M_data = new __timepunct_cache<wchar_t>;
-+
-+#warning wide time stuff
-+//       if (!__cloc)
-+      {
-+        // "C" locale
-+        _M_c_locale_timepunct = _S_get_c_locale();
-+
-+        _M_data->_M_date_format = L"%m/%d/%y";
-+        _M_data->_M_date_era_format = L"%m/%d/%y";
-+        _M_data->_M_time_format = L"%H:%M:%S";
-+        _M_data->_M_time_era_format = L"%H:%M:%S";
-+        _M_data->_M_date_time_format = L"";
-+        _M_data->_M_date_time_era_format = L"";
-+        _M_data->_M_am = L"AM";
-+        _M_data->_M_pm = L"PM";
-+        _M_data->_M_am_pm_format = L"";
-+
-+        // Day names, starting with "C"'s Sunday.
-+        _M_data->_M_day1 = L"Sunday";
-+        _M_data->_M_day2 = L"Monday";
-+        _M_data->_M_day3 = L"Tuesday";
-+        _M_data->_M_day4 = L"Wednesday";
-+        _M_data->_M_day5 = L"Thursday";
-+        _M_data->_M_day6 = L"Friday";
-+        _M_data->_M_day7 = L"Saturday";
-+
-+        // Abbreviated day names, starting with "C"'s Sun.
-+        _M_data->_M_aday1 = L"Sun";
-+        _M_data->_M_aday2 = L"Mon";
-+        _M_data->_M_aday3 = L"Tue";
-+        _M_data->_M_aday4 = L"Wed";
-+        _M_data->_M_aday5 = L"Thu";
-+        _M_data->_M_aday6 = L"Fri";
-+        _M_data->_M_aday7 = L"Sat";
-+
-+        // Month names, starting with "C"'s January.
-+        _M_data->_M_month01 = L"January";
-+        _M_data->_M_month02 = L"February";
-+        _M_data->_M_month03 = L"March";
-+        _M_data->_M_month04 = L"April";
-+        _M_data->_M_month05 = L"May";
-+        _M_data->_M_month06 = L"June";
-+        _M_data->_M_month07 = L"July";
-+        _M_data->_M_month08 = L"August";
-+        _M_data->_M_month09 = L"September";
-+        _M_data->_M_month10 = L"October";
-+        _M_data->_M_month11 = L"November";
-+        _M_data->_M_month12 = L"December";
-+
-+        // Abbreviated month names, starting with "C"'s Jan.
-+        _M_data->_M_amonth01 = L"Jan";
-+        _M_data->_M_amonth02 = L"Feb";
-+        _M_data->_M_amonth03 = L"Mar";
-+        _M_data->_M_amonth04 = L"Apr";
-+        _M_data->_M_amonth05 = L"May";
-+        _M_data->_M_amonth06 = L"Jun";
-+        _M_data->_M_amonth07 = L"Jul";
-+        _M_data->_M_amonth08 = L"Aug";
-+        _M_data->_M_amonth09 = L"Sep";
-+        _M_data->_M_amonth10 = L"Oct";
-+        _M_data->_M_amonth11 = L"Nov";
-+        _M_data->_M_amonth12 = L"Dec";
-+      }
-+#if 0
-+      else
-+      {
-+        _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
-+
-+        _M_data->_M_date_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_FMT, __cloc));
-+        _M_data->_M_date_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_FMT, __cloc));
-+        _M_data->_M_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT, __cloc));
-+        _M_data->_M_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_T_FMT, __cloc));
-+        _M_data->_M_date_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_T_FMT, __cloc));
-+        _M_data->_M_date_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc));
-+        _M_data->_M_am = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WAM_STR, __cloc));
-+        _M_data->_M_pm = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WPM_STR, __cloc));
-+        _M_data->_M_am_pm_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc));
-+
-+        // Day names, starting with "C"'s Sunday.
-+        _M_data->_M_day1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_1, __cloc));
-+        _M_data->_M_day2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_2, __cloc));
-+        _M_data->_M_day3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_3, __cloc));
-+        _M_data->_M_day4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_4, __cloc));
-+        _M_data->_M_day5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_5, __cloc));
-+        _M_data->_M_day6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_6, __cloc));
-+        _M_data->_M_day7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_7, __cloc));
-+
-+        // Abbreviated day names, starting with "C"'s Sun.
-+        _M_data->_M_aday1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_1, __cloc));
-+        _M_data->_M_aday2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_2, __cloc));
-+        _M_data->_M_aday3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_3, __cloc));
-+        _M_data->_M_aday4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_4, __cloc));
-+        _M_data->_M_aday5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_5, __cloc));
-+        _M_data->_M_aday6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_6, __cloc));
-+        _M_data->_M_aday7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_7, __cloc));
-+
-+        // Month names, starting with "C"'s January.
-+        _M_data->_M_month01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_1, __cloc));
-+        _M_data->_M_month02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_2, __cloc));
-+        _M_data->_M_month03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_3, __cloc));
-+        _M_data->_M_month04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_4, __cloc));
-+        _M_data->_M_month05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_5, __cloc));
-+        _M_data->_M_month06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_6, __cloc));
-+        _M_data->_M_month07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_7, __cloc));
-+        _M_data->_M_month08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_8, __cloc));
-+        _M_data->_M_month09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_9, __cloc));
-+        _M_data->_M_month10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_10, __cloc));
-+        _M_data->_M_month11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_11, __cloc));
-+        _M_data->_M_month12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_12, __cloc));
-+
-+        // Abbreviated month names, starting with "C"'s Jan.
-+        _M_data->_M_amonth01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_1, __cloc));
-+        _M_data->_M_amonth02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_2, __cloc));
-+        _M_data->_M_amonth03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_3, __cloc));
-+        _M_data->_M_amonth04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_4, __cloc));
-+        _M_data->_M_amonth05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_5, __cloc));
-+        _M_data->_M_amonth06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_6, __cloc));
-+        _M_data->_M_amonth07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_7, __cloc));
-+        _M_data->_M_amonth08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_8, __cloc));
-+        _M_data->_M_amonth09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_9, __cloc));
-+        _M_data->_M_amonth10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_10, __cloc));
-+        _M_data->_M_amonth11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_11, __cloc));
-+        _M_data->_M_amonth12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_12, __cloc));
-+      }
-+#endif // 0
-+    }
-+#endif
-+}
-diff -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/time_members.h
---- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.h 1969-12-31 18:00:00.000000000 -0600
-+++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/time_members.h 2005-04-27 22:20:27.625239716 -0500
-@@ -0,0 +1,68 @@
-+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
-+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+  template<typename _CharT>
-+    __timepunct<_CharT>::__timepunct(size_t __refs) 
-+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
-+    _M_name_timepunct(_S_get_c_name())
-+    { _M_initialize_timepunct(); }
-+
-+  template<typename _CharT>
-+    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
-+    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
-+    _M_name_timepunct(_S_get_c_name())
-+    { _M_initialize_timepunct(); }
-+
-+  template<typename _CharT>
-+    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
-+                                   size_t __refs) 
-+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
-+    _M_name_timepunct(__s)
-+    { 
-+      char* __tmp = new char[std::strlen(__s) + 1];
-+      std::strcpy(__tmp, __s);
-+      _M_name_timepunct = __tmp;
-+      _M_initialize_timepunct(__cloc); 
-+    }
-+
-+  template<typename _CharT>
-+    __timepunct<_CharT>::~__timepunct()
-+    { 
-+      if (_M_name_timepunct != _S_get_c_name())
-+      delete [] _M_name_timepunct;
-+      delete _M_data; 
-+      _S_destroy_c_locale(_M_c_locale_timepunct); 
-+    }
-diff -urN gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-4.1.0-patched/libstdc++-v3/config/os/uclibc/ctype_base.h
---- gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_base.h       1969-12-31 18:00:00.000000000 -0600
-+++ gcc-4.1.0-patched/libstdc++-v3/config/os/uclibc/ctype_base.h       2005-04-27 22:20:27.626239550 -0500
-@@ -0,0 +1,58 @@
-+// Locale support -*- C++ -*-
-+
-+// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003
-+// Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.1  Locales
-+//
-+  
-+// Information as gleaned from /usr/include/ctype.h
-+  
-+  struct ctype_base
-+  {
-+    // Note: In uClibc, the following two types depend on configuration.
-+ 
-+    // Non-standard typedefs.
-+    typedef const __ctype_touplow_t* __to_type;
-+
-+    // NB: Offsets into ctype<char>::_M_table force a particular size
-+    // on the mask type. Because of this, we don't use an enum.
-+    typedef __ctype_mask_t    mask;   
-+    static const mask upper           = _ISupper;
-+    static const mask lower   = _ISlower;
-+    static const mask alpha   = _ISalpha;
-+    static const mask digit   = _ISdigit;
-+    static const mask xdigit  = _ISxdigit;
-+    static const mask space   = _ISspace;
-+    static const mask print   = _ISprint;
-+    static const mask graph   = _ISalpha | _ISdigit | _ISpunct;
-+    static const mask cntrl   = _IScntrl;
-+    static const mask punct   = _ISpunct;
-+    static const mask alnum   = _ISalpha | _ISdigit;
-+  };
-diff -urN gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-4.1.0-patched/libstdc++-v3/config/os/uclibc/ctype_inline.h
---- gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_inline.h     1969-12-31 18:00:00.000000000 -0600
-+++ gcc-4.1.0-patched/libstdc++-v3/config/os/uclibc/ctype_inline.h     2005-04-27 22:20:27.626239550 -0500
-@@ -0,0 +1,69 @@
-+// Locale support -*- C++ -*-
-+
-+// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.1  Locales
-+//
-+  
-+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
-+// functions go in ctype.cc
-+  
-+  bool
-+  ctype<char>::
-+  is(mask __m, char __c) const
-+  { return _M_table[static_cast<unsigned char>(__c)] & __m; }
-+
-+  const char*
-+  ctype<char>::
-+  is(const char* __low, const char* __high, mask* __vec) const
-+  {
-+    while (__low < __high)
-+      *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
-+    return __high;
-+  }
-+
-+  const char*
-+  ctype<char>::
-+  scan_is(mask __m, const char* __low, const char* __high) const
-+  {
-+    while (__low < __high 
-+         && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
-+      ++__low;
-+    return __low;
-+  }
-+
-+  const char*
-+  ctype<char>::
-+  scan_not(mask __m, const char* __low, const char* __high) const
-+  {
-+    while (__low < __high 
-+         && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
-+      ++__low;
-+    return __low;
-+  }
-diff -urN gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-4.1.0-patched/libstdc++-v3/config/os/uclibc/ctype_noninline.h
---- gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h  1969-12-31 18:00:00.000000000 -0600
-+++ gcc-4.1.0-patched/libstdc++-v3/config/os/uclibc/ctype_noninline.h  2005-04-27 22:20:27.627239385 -0500
-@@ -0,0 +1,92 @@
-+// Locale support -*- C++ -*-
-+
-+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
-+// Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.1  Locales
-+//
-+  
-+// Information as gleaned from /usr/include/ctype.h
-+
-+  const ctype_base::mask*
-+  ctype<char>::classic_table() throw()
-+  { return __C_ctype_b; }
-+
-+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
-+                   size_t __refs) 
-+  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
-+  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
-+  {
-+    _M_toupper = __C_ctype_toupper;
-+    _M_tolower = __C_ctype_tolower;
-+    _M_table = __table ? __table : __C_ctype_b;
-+    memset(_M_widen, 0, sizeof(_M_widen));
-+    memset(_M_narrow, 0, sizeof(_M_narrow));
-+  }
-+
-+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
-+  : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
-+  _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
-+  {
-+    _M_toupper = __C_ctype_toupper;
-+    _M_tolower = __C_ctype_tolower;
-+    _M_table = __table ? __table : __C_ctype_b;
-+    memset(_M_widen, 0, sizeof(_M_widen));
-+    memset(_M_narrow, 0, sizeof(_M_narrow));
-+  }
-+
-+  char
-+  ctype<char>::do_toupper(char __c) const
-+  { return _M_toupper[static_cast<unsigned char>(__c)]; }
-+
-+  const char*
-+  ctype<char>::do_toupper(char* __low, const char* __high) const
-+  {
-+    while (__low < __high)
-+      {
-+      *__low = _M_toupper[static_cast<unsigned char>(*__low)];
-+      ++__low;
-+      }
-+    return __high;
-+  }
-+
-+  char
-+  ctype<char>::do_tolower(char __c) const
-+  { return _M_tolower[static_cast<unsigned char>(__c)]; }
-+
-+  const char* 
-+  ctype<char>::do_tolower(char* __low, const char* __high) const
-+  {
-+    while (__low < __high)
-+      {
-+      *__low = _M_tolower[static_cast<unsigned char>(*__low)];
-+      ++__low;
-+      }
-+    return __high;
-+  }
-diff -urN gcc-4.1.0/libstdc++-v3/config/os/uclibc/os_defines.h gcc-4.1.0-patched/libstdc++-v3/config/os/uclibc/os_defines.h
---- gcc-4.1.0/libstdc++-v3/config/os/uclibc/os_defines.h       1969-12-31 18:00:00.000000000 -0600
-+++ gcc-4.1.0-patched/libstdc++-v3/config/os/uclibc/os_defines.h       2005-04-27 22:20:27.628239219 -0500
-@@ -0,0 +1,44 @@
-+// Specific definitions for GNU/Linux  -*- C++ -*-
-+
-+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library.  This library 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, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING.  If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction.  Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License.  This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+#ifndef _GLIBCXX_OS_DEFINES
-+#define _GLIBCXX_OS_DEFINES 1
-+
-+// System-specific #define, typedefs, corrections, etc, go here.  This
-+// file will come before all others.
-+
-+// This keeps isanum, et al from being propagated as macros.
-+#define __NO_CTYPE 1
-+
-+#include <features.h>
-+
-+// We must not see the optimized string functions GNU libc defines.
-+#define __NO_STRING_INLINES
-+
-+#endif
-diff -urN gcc-4.1.0/libstdc++-v3/configure gcc-4.1.0-patched/libstdc++-v3/configure
---- gcc-4.1.0/libstdc++-v3/configure   2005-04-13 19:31:43.000000000 -0500
-+++ gcc-4.1.0-patched/libstdc++-v3/configure   2005-04-27 22:20:33.285301695 -0500
-@@ -3986,6 +3986,11 @@
-   lt_cv_deplibs_check_method=pass_all
-   ;;
-+linux-uclibc*)
-+  lt_cv_deplibs_check_method=pass_all
-+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+  ;;
-+
- netbsd* | knetbsd*-gnu)
-   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-@@ -5744,6 +5749,9 @@
-   # Default to "generic".
-   if test $enable_clocale_flag = auto; then
-     case ${target_os} in
-+      linux-uclibc*)
-+        enable_clocale_flag=uclibc
-+      ;;
-       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
-         cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
-@@ -5974,6 +5982,77 @@
-       CTIME_CC=config/locale/generic/time_members.cc
-       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
-       ;;
-+    uclibc)
-+      echo "$as_me:$LINENO: result: uclibc" >&5
-+echo "${ECHO_T}uclibc" >&6
-+
-+      # Declare intention to use gettext, and add support for specific
-+      # languages.
-+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
-+      ALL_LINGUAS="de fr"
-+
-+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
-+      # Extract the first word of "msgfmt", so it can be a program name with args.
-+set dummy msgfmt; ac_word=$2
-+echo "$as_me:$LINENO: checking for $ac_word" >&5
-+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-+if test "${ac_cv_prog_check_msgfmt+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  if test -n "$check_msgfmt"; then
-+  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+  for ac_exec_ext in '' $ac_executable_extensions; do
-+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    ac_cv_prog_check_msgfmt="yes"
-+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+done
-+
-+  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
-+fi
-+fi
-+check_msgfmt=$ac_cv_prog_check_msgfmt
-+if test -n "$check_msgfmt"; then
-+  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
-+echo "${ECHO_T}$check_msgfmt" >&6
-+else
-+  echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
-+fi
-+
-+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
-+        USE_NLS=yes
-+      fi
-+      # Export the build objects.
-+      for ling in $ALL_LINGUAS; do \
-+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
-+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
-+      done
-+
-+
-+
-+      CLOCALE_H=config/locale/uclibc/c_locale.h
-+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
-+      CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
-+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
-+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
-+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
-+      CMESSAGES_H=config/locale/uclibc/messages_members.h
-+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
-+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
-+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
-+      CTIME_H=config/locale/uclibc/time_members.h
-+      CTIME_CC=config/locale/uclibc/time_members.cc
-+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
-+      ;;
-   esac
-   # This is where the testsuite looks for locale catalogs, using the
-diff -urN gcc-4.1.0/libstdc++-v3/configure.host gcc-4.1.0-patched/libstdc++-v3/configure.host
---- gcc-4.1.0/libstdc++-v3/configure.host      2005-01-13 16:48:14.000000000 -0600
-+++ gcc-4.1.0-patched/libstdc++-v3/configure.host      2005-04-27 22:20:28.088162997 -0500
-@@ -249,6 +249,12 @@
-     ;;
- esac
-+# Override for uClibc since linux-uclibc gets mishandled above.
-+case "${host_os}" in
-+  *-uclibc*)
-+    os_include_dir="os/uclibc"
-+    ;;
-+esac
- # Set any OS-dependent and CPU-dependent bits.
- # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
-diff -urN gcc-4.1.0/libstdc++-v3/crossconfig.m4 gcc-4.1.0-patched/libstdc++-v3/crossconfig.m4
---- gcc-4.1.0/libstdc++-v3/crossconfig.m4      2005-04-06 18:31:16.000000000 -0500
-+++ gcc-4.1.0-patched/libstdc++-v3/crossconfig.m4      2005-04-27 22:20:28.089162832 -0500
-@@ -143,6 +143,99 @@
-       ;;
-     esac
-     ;;
-+  *-uclibc*)
-+# Temporary hack until we implement the float versions of the libm funcs
-+    AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
-+      machine/endian.h machine/param.h sys/machine.h sys/types.h \
-+      fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
-+    SECTION_FLAGS='-ffunction-sections -fdata-sections'
-+    AC_SUBST(SECTION_FLAGS)
-+    GLIBCXX_CHECK_LINKER_FEATURES
-+    GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
-+    GLIBCXX_CHECK_WCHAR_T_SUPPORT
-+
-+    # For LFS.
-+    AC_DEFINE(HAVE_INT64_T)
-+    case "$target" in
-+      *-uclinux*)
-+        # Don't enable LFS with uClinux
-+        ;;
-+      *)
-+        AC_DEFINE(_GLIBCXX_USE_LFS)
-+    esac
-+
-+    # For showmanyc_helper().
-+    AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
-+    GLIBCXX_CHECK_POLL
-+    GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
-+
-+    # For xsputn_2().
-+    AC_CHECK_HEADERS(sys/uio.h)
-+    GLIBCXX_CHECK_WRITEV
-+
-+#     AC_DEFINE(HAVE_ACOSF)
-+#     AC_DEFINE(HAVE_ASINF)
-+#     AC_DEFINE(HAVE_ATANF)
-+#     AC_DEFINE(HAVE_ATAN2F)
-+    AC_DEFINE(HAVE_CEILF)
-+    AC_DEFINE(HAVE_COPYSIGN)
-+#     AC_DEFINE(HAVE_COPYSIGNF)
-+#     AC_DEFINE(HAVE_COSF)
-+#     AC_DEFINE(HAVE_COSHF)
-+#     AC_DEFINE(HAVE_EXPF)
-+#     AC_DEFINE(HAVE_FABSF)
-+    AC_DEFINE(HAVE_FINITE)
-+    AC_DEFINE(HAVE_FINITEF)
-+    AC_DEFINE(HAVE_FLOORF)
-+#     AC_DEFINE(HAVE_FMODF)
-+#     AC_DEFINE(HAVE_FREXPF)
-+    AC_DEFINE(HAVE_HYPOT)
-+#     AC_DEFINE(HAVE_HYPOTF)
-+    AC_DEFINE(HAVE_ISINF)
-+    AC_DEFINE(HAVE_ISINFF)
-+    AC_DEFINE(HAVE_ISNAN)
-+    AC_DEFINE(HAVE_ISNANF)
-+#     AC_DEFINE(HAVE_LOGF)
-+#     AC_DEFINE(HAVE_LOG10F)
-+#     AC_DEFINE(HAVE_MODFF)
-+#     AC_DEFINE(HAVE_SINF)
-+#     AC_DEFINE(HAVE_SINHF)
-+#     AC_DEFINE(HAVE_SINCOS)
-+#     AC_DEFINE(HAVE_SINCOSF)
-+    AC_DEFINE(HAVE_SQRTF)
-+#     AC_DEFINE(HAVE_TANF)
-+#     AC_DEFINE(HAVE_TANHF)
-+    if test x"long_double_math_on_this_cpu" = x"yes"; then
-+      AC_MSG_ERROR([long_double_math_on_this_cpu is yes!])
-+#       AC_DEFINE(HAVE_ACOSL)
-+#       AC_DEFINE(HAVE_ASINL)
-+#       AC_DEFINE(HAVE_ATANL)
-+#       AC_DEFINE(HAVE_ATAN2L)
-+#       AC_DEFINE(HAVE_CEILL)
-+#       AC_DEFINE(HAVE_COPYSIGNL)
-+#       AC_DEFINE(HAVE_COSL)
-+#       AC_DEFINE(HAVE_COSHL)
-+#       AC_DEFINE(HAVE_EXPL)
-+#       AC_DEFINE(HAVE_FABSL)
-+#       AC_DEFINE(HAVE_FINITEL)
-+#       AC_DEFINE(HAVE_FLOORL)
-+#       AC_DEFINE(HAVE_FMODL)
-+#       AC_DEFINE(HAVE_FREXPL)
-+#       AC_DEFINE(HAVE_HYPOTL)
-+#       AC_DEFINE(HAVE_ISINFL)
-+#       AC_DEFINE(HAVE_ISNANL)
-+#       AC_DEFINE(HAVE_LOGL)
-+#       AC_DEFINE(HAVE_LOG10L)
-+#       AC_DEFINE(HAVE_MODFL)
-+#       AC_DEFINE(HAVE_POWL)
-+#       AC_DEFINE(HAVE_SINL)
-+#       AC_DEFINE(HAVE_SINHL)
-+#       AC_DEFINE(HAVE_SINCOSL)
-+#       AC_DEFINE(HAVE_SQRTL)
-+#       AC_DEFINE(HAVE_TANL)
-+#       AC_DEFINE(HAVE_TANHL)
-+    fi
-+    ;;
-   *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
-     AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
-       machine/endian.h machine/param.h sys/machine.h sys/types.h \
-@@ -157,7 +250,7 @@
-     AC_DEFINE(HAVE_INT64_T)
-     case "$target" in
-       *-uclinux*)
--        # Don't enable LFS with uClibc
-+        # Don't enable LFS with uClinux
-         ;;
-       *)
-         AC_DEFINE(_GLIBCXX_USE_LFS)
-diff -urN gcc-4.1.0/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.1.0-patched/libstdc++-v3/include/c_compatibility/wchar.h
---- gcc-4.1.0/libstdc++-v3/include/c_compatibility/wchar.h     2003-12-08 21:51:45.000000000 -0600
-+++ gcc-4.1.0-patched/libstdc++-v3/include/c_compatibility/wchar.h     2005-04-27 22:20:28.089162832 -0500
-@@ -101,7 +101,9 @@
- using std::wmemcpy;
- using std::wmemmove;
- using std::wmemset;
-+#if _GLIBCXX_HAVE_WCSFTIME
- using std::wcsftime;
-+#endif
- #if _GLIBCXX_USE_C99
- using std::wcstold;
-diff -urN gcc-4.1.0/libstdc++-v3/include/c_std/std_cwchar.h gcc-4.1.0-patched/libstdc++-v3/include/c_std/std_cwchar.h
---- gcc-4.1.0/libstdc++-v3/include/c_std/std_cwchar.h  2004-07-20 03:47:42.000000000 -0500
-+++ gcc-4.1.0-patched/libstdc++-v3/include/c_std/std_cwchar.h  2005-04-27 22:20:28.090162666 -0500
-@@ -179,7 +179,9 @@
-   using ::wcscoll;
-   using ::wcscpy;
-   using ::wcscspn;
-+#if _GLIBCXX_HAVE_WCSFTIME
-   using ::wcsftime;
-+#endif
-   using ::wcslen;
-   using ::wcsncat;
-   using ::wcsncmp;
index bce2e995d4438ec4ed1b03a7c8ab817474257763..2ad5320d6c8123ce1c7dcfe49c1d1d86f8576f31 100644 (file)
@@ -10,37 +10,25 @@ endif
 config BR2_GCC_3_4
        bool
        default n
-       depends BR2_GCC_VERSION_3_4_3 || BR2_GCC_VERSION_3_4_4 || BR2_GCC_VERSION_4_0_0
+       depends BR2_GCC_VERSION_3_4_4 || BR2_GCC_VERSION_4_0_0 || BR2_GCC_VERSION_4_0_1
 
 choice
        prompt "GCC compiler Version" if CONFIG_DEVEL
-       default BR2_GCC_VERSION_3_4_3
+       default BR2_GCC_VERSION_3_4_4
        help
          Select the version of gcc you wish to use.
 
-       config BR2_GCC_VERSION_3_3_5
-               bool "gcc 3.3.5"
-
-       config BR2_GCC_VERSION_3_4_3
-               bool "gcc 3.4.3"
-               select BR2_GCC_3_4
-
        config BR2_GCC_VERSION_3_4_4
                bool "gcc 3.4.4"
                select BR2_GCC_3_4
 
-       config BR2_GCC_VERSION_4_0_0
-               bool "gcc 4.0.0"
-               select BR2_GCC_3_4
-
 endchoice
 
 config BR2_GCC_VERSION
        string
-       default "3.3.5"     if BR2_GCC_VERSION_3_3_5 
-       default "3.4.3"     if BR2_GCC_VERSION_3_4_3 || !CONFIG_DEVEL
-       default "3.4.4"     if BR2_GCC_VERSION_3_4_4
+       default "3.4.4"     if BR2_GCC_VERSION_3_4_4 || !CONFIG_DEVEL
        default "4.0.0"     if BR2_GCC_VERSION_4_0_0
+       default "4.0.1"     if BR2_GCC_VERSION_4_0_1
 
 
 config BR2_GCC_USE_SJLJ_EXCEPTIONS
index d060ab0b6c310047c55f794fc834b753fb0be1ae..dc7e02c7ae8b80c94338819466dbbdaac2047c8a 100644 (file)
@@ -1,9 +1,201 @@
+# Makefile for to build a gcc/uClibc toolchain
+#
+# Copyright (C) 2002-2003 Erik Andersen <andersen@uclibc.org>
+# Copyright (C) 2004 Manuel Novoa III <mjn3@uclibc.org>
+# Copyright (C) 2005 Felix Fietkau <openwrt@nbd.name>
+#
+# 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, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
 include $(TOPDIR)/rules.mk
 
-include ./gcc-uclibc-3.x.mk
+GCC_VERSION:=$(strip $(GCC_VERSION))
+
+#GCC_SITE:=ftp://ftp.gnu.org/gnu/gcc/releases/gcc-$(GCC_VERSION)
+GCC_SITE:=ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-$(GCC_VERSION) \
+       http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-$(GCC_VERSION)
+
+GCC_SOURCE:=gcc-$(GCC_VERSION).tar.bz2
+GCC_DIR:=$(TOOL_BUILD_DIR)/gcc-$(GCC_VERSION)
+GCC_CAT:=bzcat
+GCC_STRIP_HOST_BINARIES:=true
+
+#############################################################
+#
+# Setup some initial stuff
+#
+#############################################################
+
+ifeq ($(BR2_INSTALL_LIBGCJ),y)
+TARGET_LANGUAGES:=c,c++,java
+else
+ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
+TARGET_LANGUAGES:=c,c++
+else
+TARGET_LANGUAGES:=c
+endif
+endif
+
+#############################################################
+#
+# build the first pass gcc compiler
+#
+#############################################################
+
+GCC_BUILD_DIR1:=$(TOOL_BUILD_DIR)/gcc-$(GCC_VERSION)-initial
+
+$(DL_DIR)/$(GCC_SOURCE):
+       mkdir -p $(DL_DIR)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(GCC_SOURCE) x $(GCC_SITE)
+
+$(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
+       mkdir -p $(TOOL_BUILD_DIR)
+       $(GCC_CAT) $(DL_DIR)/$(GCC_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
+       touch $(GCC_DIR)/.unpacked
+
+$(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked
+       # Apply any files named gcc-*.patch from the source directory to gcc
+       $(SCRIPT_DIR)/patch-kernel.sh $(GCC_DIR) ./$(GCC_VERSION) \*.patch
+       # Note: The soft float situation has improved considerably with gcc 3.4.x.
+       # We can dispense with the custom spec files, as well as libfloat for the arm case.
+       # However, we still need a patch for arm.  There's a similar patch for gcc 3.3.x
+       # which needs to be integrated so we can kill of libfloat for good.
+ifeq ($(BR2_SOFT_FLOAT),y)
+ifeq ("$(strip $(ARCH))","arm")
+       $(SCRIPT_DIR)/patch-kernel.sh $(GCC_DIR) ./$(GCC_VERSION) arm-softfloat.patch.conditional
+endif
+ifeq ("$(strip $(ARCH))","armeb")
+       $(SCRIPT_DIR)/patch-kernel.sh $(GCC_DIR) ./$(GCC_VERSION) arm-softfloat.patch.conditional
+endif
+endif
+       touch $(GCC_DIR)/.patched
+
+# The --without-headers option stopped working with gcc 3.0 and has never been
+# # fixed, so we need to actually have working C library header files prior to
+# # the step or libgcc will not build...
+
+$(GCC_BUILD_DIR1)/.configured: $(GCC_DIR)/.patched
+       mkdir -p $(GCC_BUILD_DIR1)
+       (cd $(GCC_BUILD_DIR1); rm -f config.cache; PATH=$(TARGET_PATH) \
+               $(GCC_DIR)/configure \
+               --prefix=$(STAGING_DIR) \
+               --build=$(GNU_HOST_NAME) \
+               --host=$(GNU_HOST_NAME) \
+               --target=$(REAL_GNU_TARGET_NAME) \
+               --enable-languages=c \
+               --disable-shared \
+               --with-sysroot=$(TOOL_BUILD_DIR)/uClibc_dev/ \
+               --disable-__cxa_atexit \
+               --enable-target-optspace \
+               --with-gnu-ld \
+               $(DISABLE_NLS) \
+               $(MULTILIB) \
+               $(SOFT_FLOAT_CONFIG_OPTION) \
+               $(GCC_WITH_CPU) $(GCC_WITH_ARCH) $(GCC_WITH_TUNE) \
+               $(EXTRA_GCC_CONFIG_OPTIONS));
+       touch $(GCC_BUILD_DIR1)/.configured
+
+$(GCC_BUILD_DIR1)/.compiled: $(GCC_BUILD_DIR1)/.configured
+       PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) all-gcc
+       touch $(GCC_BUILD_DIR1)/.compiled
+
+$(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc: $(GCC_BUILD_DIR1)/.compiled
+       PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) install-gcc
+
+#############################################################
+#
+# second pass compiler build.  Build the compiler targeting 
+# the newly built shared uClibc library.
+#
+#############################################################
+#
+# Sigh... I had to rework things because using --with-gxx-include-dir
+# causes issues with include dir search order for g++.  This seems to
+# have something to do with "path translations" and possibly doesn't
+# affect gcc-target.  However, I haven't tested gcc-target yet so no
+# guarantees.  mjn3
+
+GCC_BUILD_DIR2:=$(TOOL_BUILD_DIR)/gcc-$(GCC_VERSION)-final
+$(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.patched $(STAGING_DIR)/lib/libc.a
+       mkdir -p $(GCC_BUILD_DIR2)
+       # Important!  Required for limits.h to be fixed.
+       rm -rf $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include
+       ln -sf ../include $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include
+       rm -rf $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib
+       ln -sf ../lib $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib
+       (cd $(GCC_BUILD_DIR2); rm -f config.cache; PATH=$(TARGET_PATH) \
+               $(GCC_DIR)/configure \
+               --prefix=$(STAGING_DIR) \
+               --build=$(GNU_HOST_NAME) \
+               --host=$(GNU_HOST_NAME) \
+               --target=$(REAL_GNU_TARGET_NAME) \
+               --enable-languages=$(TARGET_LANGUAGES) \
+               --enable-shared \
+               --disable-__cxa_atexit \
+               --enable-target-optspace \
+               --with-gnu-ld \
+               $(DISABLE_NLS) \
+               $(MULTILIB) \
+               $(SOFT_FLOAT_CONFIG_OPTION) \
+               $(GCC_WITH_CPU) $(GCC_WITH_ARCH) $(GCC_WITH_TUNE) \
+               $(GCC_USE_SJLJ_EXCEPTIONS) \
+               $(EXTRA_GCC_CONFIG_OPTIONS));
+       touch $(GCC_BUILD_DIR2)/.configured
+
+$(GCC_BUILD_DIR2)/.compiled: $(GCC_BUILD_DIR2)/.configured
+       PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR2) all
+       touch $(GCC_BUILD_DIR2)/.compiled
+
+gcc-install: $(GCC_BUILD_DIR2)/.compiled
+       PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR2) install
+       echo $(GCC_VERSION) > $(STAGING_DIR)/gcc_version
+       # Set up the symlinks to enable lying about target name.
+       set -e; \
+       (cd $(STAGING_DIR); \
+               ln -sf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \
+               cd bin; \
+               for app in $(REAL_GNU_TARGET_NAME)-* ; do \
+                       ln -sf $${app} \
+                       $(GNU_TARGET_NAME)$${app##$(REAL_GNU_TARGET_NAME)}; \
+               done; \
+       );
+       #
+       # Now for the ugly 3.3.x soft float hack...
+       #
+ifeq ($(BR2_SOFT_FLOAT),y)
+ifeq ($(findstring 3.3.,$(GCC_VERSION)),3.3.)
+       # Make sure we have a soft float specs file for this arch
+       if [ ! -f ./$(GCC_VERSION)/specs-$(ARCH)-soft-float ] ; then \
+               echo soft float configured but no specs file for this arch ; \
+               /bin/false ; \
+       fi;
+       # Replace specs file with one that defaults to soft float mode.
+       if [ ! -f $(STAGING_DIR)/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs ] ; then \
+               echo staging dir specs file is missing ; \
+               /bin/false ; \
+       fi;
+       cp ./$(GCC_VERSION)/specs-$(ARCH)-soft-float $(STAGING_DIR)/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs
+endif
+endif
 
-source: gcc-source
-prepare: gcc_initial
-compile: $(GCC_BUILD_DIR2)/.compiled
-install: gcc-install
-clean: gcc_initial-clean gcc-clean
+source: $(DL_DIR)/$(GCC_SOURCE)
+prepare: $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc
+compile: gcc-install
+install:
+clean: gcc-clean
+       rm -rf $(GCC_DIR)
+       rm -rf $(GCC_BUILD_DIR1)
+       rm -rf $(GCC_BUILD_DIR2)
+       rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gc*
+       rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-c*
diff --git a/openwrt/toolchain/gcc/Makefile.in b/openwrt/toolchain/gcc/Makefile.in
deleted file mode 100644 (file)
index 2963ffb..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-GCC_VERSION:=$(strip $(subst ",, $(BR2_GCC_VERSION)))
-#"
-GCC_USE_SJLJ_EXCEPTIONS:=$(strip $(subst ",, $(BR2_GCC_USE_SJLJ_EXCEPTIONS)))
-#"
-TARGET_OPTIMIZATION:=$(strip $(subst ",, $(BR2_TARGET_OPTIMIZATION)))
-#""
-
-
-ifeq ($(BR2_SOFT_FLOAT),y)
-# gcc 3.4.x soft float configuration is different than previous versions.
-ifeq ($(findstring 3.4.,$(GCC_VERSION)),3.4.)
-SOFT_FLOAT_CONFIG_OPTION:=--with-float=soft
-else
-SOFT_FLOAT_CONFIG_OPTION:=--without-float
-endif
-TARGET_SOFT_FLOAT:=-msoft-float
-ARCH_FPU_SUFFIX:=_nofpu
-else
-SOFT_FLOAT_CONFIG_OPTION:=
-TARGET_SOFT_FLOAT:=
-ARCH_FPU_SUFFIX:=
-endif
-
-ifeq ($(strip $(BR2_PACKAGE_GCC_TARGET)),y)
-TARGETS+=gcc_target
-endif
diff --git a/openwrt/toolchain/gcc/gcc-uclibc-3.x.mk b/openwrt/toolchain/gcc/gcc-uclibc-3.x.mk
deleted file mode 100644 (file)
index c7f9495..0000000
+++ /dev/null
@@ -1,313 +0,0 @@
-# Makefile for to build a gcc/uClibc toolchain
-#
-# Copyright (C) 2002-2003 Erik Andersen <andersen@uclibc.org>
-# Copyright (C) 2004 Manuel Novoa III <mjn3@uclibc.org>
-#
-# 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, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-GCC_VERSION:=$(strip $(GCC_VERSION))
-
-#GCC_SITE:=ftp://ftp.gnu.org/gnu/gcc/releases/gcc-$(GCC_VERSION)
-GCC_SITE:=http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-$(GCC_VERSION)
-
-#
-# snapshots....
-#GCC_VERSION:=3.3-20031013
-#GCC_SITE:=http://gcc.get-software.com/snapshots/$(GCC_VERSION)
-#
-GCC_SOURCE:=gcc-$(GCC_VERSION).tar.bz2
-GCC_DIR:=$(TOOL_BUILD_DIR)/gcc-$(GCC_VERSION)
-GCC_CAT:=bzcat
-GCC_STRIP_HOST_BINARIES:=true
-
-#############################################################
-#
-# Setup some initial stuff
-#
-#############################################################
-
-ifeq ($(BR2_INSTALL_LIBGCJ),y)
-TARGET_LANGUAGES:=c,c++,java
-else
-ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
-TARGET_LANGUAGES:=c,c++
-else
-TARGET_LANGUAGES:=c
-endif
-endif
-
-#############################################################
-#
-# build the first pass gcc compiler
-#
-#############################################################
-GCC_BUILD_DIR1:=$(TOOL_BUILD_DIR)/gcc-$(GCC_VERSION)-initial
-
-$(DL_DIR)/$(GCC_SOURCE):
-       mkdir -p $(DL_DIR)
-       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(GCC_SOURCE) x $(GCC_SITE)
-
-$(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
-       mkdir -p $(TOOL_BUILD_DIR)
-       $(GCC_CAT) $(DL_DIR)/$(GCC_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
-       touch $(GCC_DIR)/.unpacked
-
-$(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked
-       # Apply any files named gcc-*.patch from the source directory to gcc
-       $(SCRIPT_DIR)/patch-kernel.sh $(GCC_DIR) ./$(GCC_VERSION) \*.patch
-       # Note: The soft float situation has improved considerably with gcc 3.4.x.
-       # We can dispense with the custom spec files, as well as libfloat for the arm case.
-       # However, we still need a patch for arm.  There's a similar patch for gcc 3.3.x
-       # which needs to be integrated so we can kill of libfloat for good, except for
-       # anyone (?) who might still be using gcc 2.95.  mjn3
-ifeq ($(BR2_SOFT_FLOAT),y)
-ifeq ("$(strip $(ARCH))","arm")
-       $(SCRIPT_DIR)/patch-kernel.sh $(GCC_DIR) ./$(GCC_VERSION) arm-softfloat.patch.conditional
-endif
-ifeq ("$(strip $(ARCH))","armeb")
-       $(SCRIPT_DIR)/patch-kernel.sh $(GCC_DIR) ./$(GCC_VERSION) arm-softfloat.patch.conditional
-endif
-       # Not yet updated to 3.4.1.
-       #ifeq ("$(strip $(ARCH))","i386")
-       #toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc i386-gcc-soft-float.patch
-       #endif
-endif
-       touch $(GCC_DIR)/.patched
-
-# The --without-headers option stopped working with gcc 3.0 and has never been
-# # fixed, so we need to actually have working C library header files prior to
-# # the step or libgcc will not build...
-
-$(GCC_BUILD_DIR1)/.configured: $(GCC_DIR)/.patched
-       mkdir -p $(GCC_BUILD_DIR1)
-       (cd $(GCC_BUILD_DIR1); PATH=$(TARGET_PATH) \
-               $(GCC_DIR)/configure \
-               --prefix=$(STAGING_DIR) \
-               --build=$(GNU_HOST_NAME) \
-               --host=$(GNU_HOST_NAME) \
-               --target=$(REAL_GNU_TARGET_NAME) \
-               --enable-languages=c \
-               --disable-shared \
-               --with-sysroot=$(TOOL_BUILD_DIR)/uClibc_dev/ \
-               --disable-__cxa_atexit \
-               --enable-target-optspace \
-               --with-gnu-ld \
-               $(DISABLE_NLS) \
-               $(MULTILIB) \
-               $(SOFT_FLOAT_CONFIG_OPTION) \
-               $(GCC_WITH_CPU) $(GCC_WITH_ARCH) $(GCC_WITH_TUNE) \
-               $(EXTRA_GCC_CONFIG_OPTIONS));
-       touch $(GCC_BUILD_DIR1)/.configured
-
-$(GCC_BUILD_DIR1)/.compiled: $(GCC_BUILD_DIR1)/.configured
-       PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) all-gcc
-       touch $(GCC_BUILD_DIR1)/.compiled
-
-$(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc: $(GCC_BUILD_DIR1)/.compiled
-       PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) install-gcc
-       #rm -f $(STAGING_DIR)/bin/gccbug $(STAGING_DIR)/bin/gcov
-       #rm -rf $(STAGING_DIR)/info $(STAGING_DIR)/man $(STAGING_DIR)/share/doc $(STAGING_DIR)/share/locale
-
-gcc_initial: $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc
-
-gcc_initial-clean:
-       rm -rf $(GCC_BUILD_DIR1)
-
-gcc_initial-toolclean:
-       rm -rf $(GCC_BUILD_DIR1)
-
-#############################################################
-#
-# second pass compiler build.  Build the compiler targeting 
-# the newly built shared uClibc library.
-#
-#############################################################
-#
-# Sigh... I had to rework things because using --with-gxx-include-dir
-# causes issues with include dir search order for g++.  This seems to
-# have something to do with "path translations" and possibly doesn't
-# affect gcc-target.  However, I haven't tested gcc-target yet so no
-# guarantees.  mjn3
-
-GCC_BUILD_DIR2:=$(TOOL_BUILD_DIR)/gcc-$(GCC_VERSION)-final
-$(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.patched $(STAGING_DIR)/lib/libc.a
-       mkdir -p $(GCC_BUILD_DIR2)
-       # Important!  Required for limits.h to be fixed.
-       ln -sf ../include $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include
-       (cd $(GCC_BUILD_DIR2); PATH=$(TARGET_PATH) \
-               $(GCC_DIR)/configure \
-               --prefix=$(STAGING_DIR) \
-               --build=$(GNU_HOST_NAME) \
-               --host=$(GNU_HOST_NAME) \
-               --target=$(REAL_GNU_TARGET_NAME) \
-               --enable-languages=$(TARGET_LANGUAGES) \
-               --enable-shared \
-               --disable-__cxa_atexit \
-               --enable-target-optspace \
-               --with-gnu-ld \
-               $(DISABLE_NLS) \
-               $(MULTILIB) \
-               $(SOFT_FLOAT_CONFIG_OPTION) \
-               $(GCC_WITH_CPU) $(GCC_WITH_ARCH) $(GCC_WITH_TUNE) \
-               $(GCC_USE_SJLJ_EXCEPTIONS) \
-               $(EXTRA_GCC_CONFIG_OPTIONS));
-       touch $(GCC_BUILD_DIR2)/.configured
-
-$(GCC_BUILD_DIR2)/.compiled: $(GCC_BUILD_DIR2)/.configured
-       PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR2) all
-       touch $(GCC_BUILD_DIR2)/.compiled
-
-gcc-install: $(GCC_BUILD_DIR2)/.compiled
-       PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR2) install
-       # Strip the host binaries
-ifeq ($(GCC_STRIP_HOST_BINARIES),true)
-       -strip --strip-all -R .note -R .comment $(STAGING_DIR)/bin/*
-endif
-       # Set up the symlinks to enable lying about target name.
-       set -e; \
-       (cd $(STAGING_DIR); \
-               ln -sf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \
-               cd bin; \
-               for app in $(REAL_GNU_TARGET_NAME)-* ; do \
-                       ln -sf $${app} \
-                       $(GNU_TARGET_NAME)$${app##$(REAL_GNU_TARGET_NAME)}; \
-               done; \
-       );
-       #
-       # Now for the ugly 3.3.x soft float hack...
-       #
-ifeq ($(BR2_SOFT_FLOAT),y)
-ifeq ($(findstring 3.3.,$(GCC_VERSION)),3.3.)
-       # Make sure we have a soft float specs file for this arch
-       if [ ! -f ./$(GCC_VERSION)/specs-$(ARCH)-soft-float ] ; then \
-               echo soft float configured but no specs file for this arch ; \
-               /bin/false ; \
-       fi;
-       # Replace specs file with one that defaults to soft float mode.
-       if [ ! -f $(STAGING_DIR)/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs ] ; then \
-               echo staging dir specs file is missing ; \
-               /bin/false ; \
-       fi;
-       cp ./$(GCC_VERSION)/specs-$(ARCH)-soft-float $(STAGING_DIR)/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs
-endif
-endif
-       # These are in /lib, so...
-       cp -a $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libgcc_s* $(TARGET_DIR)/lib/
-       $(STRIP) $(TARGET_DIR)/lib/libgcc_s.so.1
-
-gcc: gcc_initial $(LIBFLOAT_TARGET) \
-       gcc-install $(GCC_TARGETS)
-
-gcc-source: $(DL_DIR)/$(GCC_SOURCE)
-
-gcc-clean:
-       rm -rf $(GCC_DIR)
-       rm -rf $(GCC_BUILD_DIR2)
-       rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gc*
-       rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-c*
-
-gcc-toolclean:
-       rm -rf $(GCC_BUILD_DIR2)
-
-#############################################################
-#
-# Next build target gcc compiler
-#
-#############################################################
-GCC_BUILD_DIR3:=$(BUILD_DIR)/gcc-$(GCC_VERSION)-target
-
-$(GCC_BUILD_DIR3)/.configured: gcc-install
-       mkdir -p $(GCC_BUILD_DIR3)
-       (cd $(GCC_BUILD_DIR3); PATH=$(TARGET_PATH) \
-               $(GCC_DIR)/configure \
-               --prefix=/usr \
-               --build=$(GNU_HOST_NAME) \
-               --host=$(REAL_GNU_TARGET_NAME) \
-               --target=$(REAL_GNU_TARGET_NAME) \
-               --enable-languages=$(TARGET_LANGUAGES) \
-               --enable-shared \
-               --with-gxx-include-dir=/usr/include/c++ \
-               --disable-__cxa_atexit \
-               --enable-target-optspace \
-               --with-gnu-ld \
-               $(DISABLE_NLS) \
-               $(MULTILIB) \
-               $(SOFT_FLOAT_CONFIG_OPTION) \
-               $(GCC_WITH_CPU) $(GCC_WITH_ARCH) $(GCC_WITH_TUNE) \
-               $(GCC_USE_SJLJ_EXCEPTIONS) \
-               $(EXTRA_GCC_CONFIG_OPTIONS));
-       touch $(GCC_BUILD_DIR3)/.configured
-
-$(GCC_BUILD_DIR3)/.compiled: $(GCC_BUILD_DIR3)/.configured
-       PATH=$(TARGET_PATH) \
-       $(MAKE) $(TARGET_GCC_ARGS) -C $(GCC_BUILD_DIR3) all
-       touch $(GCC_BUILD_DIR3)/.compiled
-
-#
-# gcc-lib dir changes names to gcc with 3.4.mumble
-#
-ifeq ($(findstring 3.4.,$(GCC_VERSION)),3.4.)
-GCC_LIB_SUBDIR=lib/gcc/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)
-else
-GCC_LIB_SUBDIR=lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)
-endif
-
-$(TARGET_DIR)/usr/bin/gcc: $(GCC_BUILD_DIR3)/.compiled
-       PATH=$(TARGET_PATH) \
-       $(MAKE) DESTDIR=$(TARGET_DIR) -C $(GCC_BUILD_DIR3) install
-       # Remove broken specs file (cross compile flag is set).
-       rm -f $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR)/specs
-       #
-       # Now for the ugly 3.3.x soft float hack...
-       #
-ifeq ($(BR2_SOFT_FLOAT),y)
-ifeq ($(findstring 3.3.,$(GCC_VERSION)),3.3.)
-       # Add a specs file that defaults to soft float mode.
-       cp ./$(GCC_VERSION)/specs-$(ARCH)-soft-float $(TARGET_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs
-       # Make sure gcc does not think we are cross compiling
-       $(SED) "s/^1/0/;" $(TARGET_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs
-endif
-endif
-       #
-       # Ok... that's enough of that.
-       #
-       -(cd $(TARGET_DIR)/bin; find -type f | xargs $(STRIP) > /dev/null 2>&1)
-       -(cd $(TARGET_DIR)/usr/bin; find -type f | xargs $(STRIP) > /dev/null 2>&1)
-       -(cd $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR); $(STRIP) cc1 cc1plus collect2 > /dev/null 2>&1)
-       -(cd $(TARGET_DIR)/usr/lib; $(STRIP) libstdc++.so.*.*.* > /dev/null 2>&1)
-       -(cd $(TARGET_DIR)/lib; $(STRIP) libgcc_s.so.*.*.* > /dev/null 2>&1)
-       #
-       rm -f $(TARGET_DIR)/usr/lib/*.la*
-       #rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
-       #       $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
-       # Work around problem of missing syslimits.h
-       @if [ ! -f $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR)/include/syslimits.h ] ; then \
-               echo "warning: working around missing syslimits.h" ; \
-               cp -f $(STAGING_DIR)/$(GCC_LIB_SUBDIR)/include/syslimits.h \
-                       $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR)/include/ ; \
-       fi
-       # These are in /lib, so...
-       #rm -rf $(TARGET_DIR)/usr/lib/libgcc_s.so*
-       #touch -c $(TARGET_DIR)/usr/bin/gcc
-
-gcc_target: uclibc_target binutils_target $(TARGET_DIR)/usr/bin/gcc
-
-gcc_target-clean:
-       rm -rf $(GCC_BUILD_DIR3)
-       rm -f $(TARGET_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)*
-
-gcc_target-toolclean:
-       rm -rf $(GCC_BUILD_DIR3)
-
diff --git a/openwrt/toolchain/gcc/i386-gcc-soft-float.patch b/openwrt/toolchain/gcc/i386-gcc-soft-float.patch
deleted file mode 100644 (file)
index 9750108..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-diff -urN gcc-3.3.2-orig/gcc/config/i386/i386.h gcc-3.3.2/gcc/config/i386/i386.h
---- gcc-3.3.2-orig/gcc/config/i386/i386.h      2003-06-25 16:18:31.000000000 -0500
-+++ gcc-3.3.2/gcc/config/i386/i386.h   2003-10-22 01:46:57.000000000 -0500
-@@ -653,6 +653,7 @@
- /* Define for XFmode or TFmode extended real floating point support.
-    The XFmode is specified by i386 ABI, while TFmode may be faster
-    due to alignment and simplifications in the address calculations.  */
-+#if 0
- #define LONG_DOUBLE_TYPE_SIZE (TARGET_128BIT_LONG_DOUBLE ? 128 : 96)
- #define MAX_LONG_DOUBLE_TYPE_SIZE 128
- #ifdef __x86_64__
-@@ -660,6 +661,17 @@
- #else
- #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 96
- #endif
-+#else
-+        /* Set up for x86 soft float with 64-bit long doubles, since that's
-+         * all the soft float emulation supports. */
-+#define LONG_DOUBLE_TYPE_SIZE (TARGET_128BIT_LONG_DOUBLE ? 128 : (TARGET_80387 ? 96 : 64))
-+#define MAX_LONG_DOUBLE_TYPE_SIZE 128
-+#ifdef __x86_64__
-+#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128
-+#else
-+#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE (TARGET_80387 ? 96 : 64)
-+#endif
-+#endif
- /* Set the value of FLT_EVAL_METHOD in float.h.  When using only the
-    FPU, assume that the fpcw is set to extended precision; when using
-diff -urN gcc-3.3.2-orig/gcc/config/t-linux gcc-3.3.2/gcc/config/t-linux
---- gcc-3.3.2-orig/gcc/config/t-linux-uclibc   2003-06-04 11:56:11.000000000 -0500
-+++ gcc-3.3.2/gcc/config/t-linux-uclibc        2003-10-22 01:46:39.000000000 -0500
-@@ -21,3 +21,28 @@
- LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
-   $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
- LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h
-+
-+##############################################
-+# We want fine grained libraries, so use the new code to build the
-+# floating point emulation libraries.
-+FPBIT = fp-bit.c
-+DPBIT = dp-bit.c
-+
-+#LIB2FUNCS_EXTRA = xp-bit.c
-+
-+dp-bit.c: $(srcdir)/config/fp-bit.c
-+      echo '#ifdef __LITTLE_ENDIAN__' > dp-bit.c
-+      echo '#define FLOAT_BIT_ORDER_MISMATCH' >>dp-bit.c
-+      echo '#endif'           >> dp-bit.c
-+      cat $(srcdir)/config/fp-bit.c >> dp-bit.c
-+
-+fp-bit.c: $(srcdir)/config/fp-bit.c
-+      echo '#define FLOAT' > fp-bit.c
-+      echo '#ifdef __LITTLE_ENDIAN__' >> fp-bit.c
-+      echo '#define FLOAT_BIT_ORDER_MISMATCH' >>fp-bit.c
-+      echo '#endif'           >> fp-bit.c
-+      cat $(srcdir)/config/fp-bit.c >> fp-bit.c
-+
-+#MULTILIB_OPTIONS = msoft-float
-+#MULTILIB_DIRNAMES = soft-float
-+
diff --git a/openwrt/toolchain/ipkg-utils/1.7/ipkg-utils-1.7-ipkg_build_tar.patch b/openwrt/toolchain/ipkg-utils/1.7/ipkg-utils-1.7-ipkg_build_tar.patch
new file mode 100644 (file)
index 0000000..eb44f0b
--- /dev/null
@@ -0,0 +1,12 @@
+diff -ruN ipkg-utils-1.7-old/ipkg-build ipkg-utils-1.7-new/ipkg-build
+--- ipkg-utils-1.7-old/ipkg-build      2005-07-13 04:36:16.727438000 -0400
++++ ipkg-utils-1.7-new/ipkg-build      2005-07-13 05:27:49.385282832 -0400
+@@ -243,7 +243,7 @@
+ mkdir $tmp_dir
+ echo $CONTROL > $tmp_dir/tarX
+-( cd $pkg_dir && tar $ogargs -czf $tmp_dir/data.tar.gz . -X $tmp_dir/tarX )
++( cd $pkg_dir && tar $ogargs -X $tmp_dir/tarX -czf $tmp_dir/data.tar.gz . )
+ ( cd $pkg_dir/$CONTROL && tar $ogargs -czf $tmp_dir/control.tar.gz . )
+ rm $tmp_dir/tarX
index 2b590c8a09708f1f8e97dceeb8fdc7f8914d0749..5187fbd5fbd1107c682b795f655345b2aa01444c 100644 (file)
@@ -1,10 +1,49 @@
 include $(TOPDIR)/rules.mk
 
-include ./kernel-headers.mk
+# linux kernel headers for toolchain
 
-source: kernel-headers-source
-prepare: kernel-headers
+LINUX_HEADERS_VERSION=2.4.30
+LINUX_KERNEL_MD5SUM:=75d8ce40a3668603017cd186909efe8d
+LINUX_HEADERS_SITE=http://www.fi.kernel.org/pub/linux/kernel/v2.4 \
+                  http://www.fr.kernel.org/pub/linux/kernel/v2.4 \
+                  http://www.kernel.org/pub/linux/kernel/v2.4 \
+                  http://www.de.kernel.org/pub/linux/kernel/v2.4 
+
+LINUX_HEADERS_SOURCE=linux-$(LINUX_HEADERS_VERSION).tar.bz2
+LINUX_HEADERS_ARCH:=$(shell echo $(ARCH) | sed -e 's/i[3-9]86/i386/' \
+       -e 's/mipsel/mips/' \
+       -e 's/powerpc/ppc/' \
+       -e 's/sh[234]/sh/' \
+       )
+
+$(DL_DIR)/$(LINUX_HEADERS_SOURCE):
+       -mkdir -p $(DL_DIR)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(LINUX_HEADERS_SOURCE) $(LINUX_KERNEL_MD5SUM) $(LINUX_HEADERS_SITE)
+
+$(LINUX_HEADERS_DIR)/.unpacked: $(DL_DIR)/$(LINUX_HEADERS_SOURCE)
+       mkdir -p $(TOOL_BUILD_DIR)
+       bzcat $(DL_DIR)/$(LINUX_HEADERS_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) - \
+               linux-$(LINUX_HEADERS_VERSION)/include \
+               linux-$(LINUX_HEADERS_VERSION)/Makefile \
+               linux-$(LINUX_HEADERS_VERSION)/Rules.make \
+               linux-$(LINUX_HEADERS_VERSION)/arch/$(LINUX_HEADERS_ARCH)/Makefile \
+               linux-$(LINUX_HEADERS_VERSION)/scripts \
+               linux-$(LINUX_HEADERS_VERSION)/arch/$(LINUX_HEADERS_ARCH)/config*.in \
+               linux-$(LINUX_HEADERS_VERSION)/*/*/Config.in \
+               linux-$(LINUX_HEADERS_VERSION)/*/Config.in
+       ln -sf $(LINUX_HEADERS_DIR)-$(LINUX_HEADERS_VERSION) $(LINUX_HEADERS_DIR)
+       $(SED) 's/@expr length/@-expr length/' $(LINUX_HEADERS_DIR)/Makefile 
+       touch $(LINUX_HEADERS_DIR)/.unpacked
+
+$(LINUX_HEADERS_DIR)/.configured: $(LINUX_HEADERS_DIR)/.unpacked
+       -cp -af ./config.$(LINUX_HEADERS_ARCH) $(LINUX_HEADERS_DIR)/.config
+       $(MAKE) -C $(LINUX_HEADERS_DIR) ARCH=$(LINUX_HEADERS_ARCH) oldconfig include/linux/version.h
+       touch $(LINUX_HEADERS_DIR)/.configured
+
+source: $(DL_DIR)/$(LINUX_HEADERS_SOURCE)
+prepare: $(LINUX_HEADERS_DIR)/.configured
 compile:
 install:
-clean: kernel-headers-toolclean
+clean:
+       rm -rf $(LINUX_HEADERS_DIR)
 
diff --git a/openwrt/toolchain/kernel-headers/config.mips b/openwrt/toolchain/kernel-headers/config.mips
new file mode 100644 (file)
index 0000000..d641202
--- /dev/null
@@ -0,0 +1,1045 @@
+#
+# Automatically generated make config: don't edit
+#
+CONFIG_MIPS=y
+CONFIG_MIPS32=y
+# CONFIG_MIPS64 is not set
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+# CONFIG_MODVERSIONS is not set
+# CONFIG_KMOD is not set
+
+#
+# Machine selection
+#
+# CONFIG_ACER_PICA_61 is not set
+# CONFIG_MIPS_BOSPORUS is not set
+# CONFIG_MIPS_MIRAGE is not set
+# CONFIG_MIPS_DB1000 is not set
+# CONFIG_MIPS_DB1100 is not set
+# CONFIG_MIPS_DB1500 is not set
+# CONFIG_MIPS_DB1550 is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1100 is not set
+# CONFIG_MIPS_PB1500 is not set
+# CONFIG_MIPS_HYDROGEN3 is not set
+# CONFIG_MIPS_PB1550 is not set
+# CONFIG_MIPS_XXS1500 is not set
+# CONFIG_MIPS_MTX1 is not set
+# CONFIG_COGENT_CSB250 is not set
+# CONFIG_BAGET_MIPS is not set
+# CONFIG_CASIO_E55 is not set
+# CONFIG_MIPS_COBALT is not set
+# CONFIG_DECSTATION is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_HP_LASERJET is not set
+# CONFIG_IBM_WORKPAD is not set
+# CONFIG_LASAT is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_MIPS_SEAD is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_MOMENCO_OCELOT_G is not set
+# CONFIG_MOMENCO_OCELOT_C is not set
+# CONFIG_MOMENCO_JAGUAR_ATX is not set
+# CONFIG_PMC_BIG_SUR is not set
+# CONFIG_PMC_STRETCH is not set
+# CONFIG_PMC_YOSEMITE is not set
+# CONFIG_DDB5074 is not set
+# CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_NEC_OSPREY is not set
+# CONFIG_NEC_EAGLE is not set
+# CONFIG_OLIVETTI_M700 is not set
+# CONFIG_NINO is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
+# CONFIG_SIBYTE_SB1xxx_SOC is not set
+# CONFIG_SNI_RM200_PCI is not set
+# CONFIG_TANBAC_TB0226 is not set
+# CONFIG_TANBAC_TB0229 is not set
+# CONFIG_TOSHIBA_JMR3927 is not set
+# CONFIG_TOSHIBA_RBTX4927 is not set
+# CONFIG_VICTOR_MPC30X is not set
+# CONFIG_ZAO_CAPCELLA is not set
+# CONFIG_HIGHMEM is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+# CONFIG_MIPS_AU1000 is not set
+
+#
+# CPU selection
+#
+CONFIG_CPU_MIPS32=y
+# CONFIG_CPU_MIPS64 is not set
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_TX39XX is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_TX49XX is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_RM9000 is not set
+# CONFIG_CPU_SB1 is not set
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_16KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_CPU_HAS_PREFETCH=y
+# CONFIG_VTAG_ICACHE is not set
+# CONFIG_64BIT_PHYS_ADDR is not set
+# CONFIG_CPU_ADVANCED is not set
+CONFIG_CPU_HAS_LLSC=y
+# CONFIG_CPU_HAS_LLDSCD is not set
+# CONFIG_CPU_HAS_WB is not set
+CONFIG_CPU_HAS_SYNC=y
+
+#
+# General setup
+#
+CONFIG_CPU_LITTLE_ENDIAN=y
+# CONFIG_BUILD_ELF64 is not set
+CONFIG_NET=y
+CONFIG_PCI=y
+# CONFIG_PCI_NEW is not set
+CONFIG_PCI_AUTO=y
+# CONFIG_PCI_NAMES is not set
+# CONFIG_ISA is not set
+# CONFIG_TC is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
+# CONFIG_HOTPLUG is not set
+# CONFIG_PCMCIA is not set
+# CONFIG_HOTPLUG_PCI is not set
+CONFIG_SYSVIPC=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_MIPS32_COMPAT is not set
+# CONFIG_MIPS32_O32 is not set
+# CONFIG_MIPS32_N32 is not set
+# CONFIG_BINFMT_ELF32 is not set
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_OOM_KILLER is not set
+# CONFIG_CMDLINE_BOOL is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_CONCAT is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+CONFIG_MTD_CFI_NOSWAP=y
+# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
+# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
+CONFIG_MTD_CFI_GEOMETRY=y
+# CONFIG_MTD_CFI_B1 is not set
+CONFIG_MTD_CFI_B2=y
+# CONFIG_MTD_CFI_B4 is not set
+# CONFIG_MTD_CFI_B8 is not set
+CONFIG_MTD_CFI_I1=y
+# CONFIG_MTD_CFI_I2 is not set
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+CONFIG_MTD_CFI_INTELEXT=y
+CONFIG_MTD_CFI_AMDSTD=y
+# CONFIG_MTD_CFI_STAA is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+# CONFIG_MTD_OBSOLETE_CHIPS is not set
+# CONFIG_MTD_AMDSTD is not set
+# CONFIG_MTD_SHARP is not set
+# CONFIG_MTD_JEDEC is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_PB1000 is not set
+# CONFIG_MTD_PB1500 is not set
+# CONFIG_MTD_PB1100 is not set
+# CONFIG_MTD_CSTM_MIPS_IXX is not set
+# CONFIG_MTD_OCELOT is not set
+# CONFIG_MTD_LASAT is not set
+# CONFIG_MTD_PCI is not set
+# CONFIG_MTD_PCMCIA is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLKMTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC1000 is not set
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOCPROBE is not set
+
+#
+# NAND Flash Device Drivers
+#
+# CONFIG_MTD_NAND is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
+# CONFIG_CISS_MONITOR_THREAD is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_SX8 is not set
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_NBD=m
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_BLK_DEV_INITRD is not set
+# CONFIG_BLK_STATS is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+# CONFIG_BLK_DEV_MD is not set
+# CONFIG_MD_LINEAR is not set
+# CONFIG_MD_RAID0 is not set
+# CONFIG_MD_RAID1 is not set
+# CONFIG_MD_RAID5 is not set
+# CONFIG_MD_MULTIPATH is not set
+# CONFIG_BLK_DEV_LVM is not set
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_NETLINK_DEV=m
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+# CONFIG_FILTER is not set
+CONFIG_UNIX=y
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_FWMARK=y
+CONFIG_IP_ROUTE_NAT=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_TOS=y
+# CONFIG_IP_ROUTE_VERBOSE is not set
+# CONFIG_IP_PNP is not set
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE=m
+# CONFIG_ARPD is not set
+# CONFIG_INET_ECN is not set
+# CONFIG_SYN_COOKIES is not set
+
+#
+#   IP: Netfilter Configuration
+#
+CONFIG_IP_NF_CONNTRACK=y
+CONFIG_IP_NF_FTP=y
+# CONFIG_IP_NF_AMANDA is not set
+CONFIG_IP_NF_TFTP=y
+CONFIG_IP_NF_IRC=y
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=y
+CONFIG_IP_NF_MATCH_LIMIT=m
+CONFIG_IP_NF_MATCH_MAC=m
+CONFIG_IP_NF_MATCH_PKTTYPE=m
+CONFIG_IP_NF_MATCH_MARK=y
+CONFIG_IP_NF_MATCH_MULTIPORT=y
+CONFIG_IP_NF_MATCH_TOS=m
+# CONFIG_IP_NF_MATCH_RECENT is not set
+CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_DSCP=m
+CONFIG_IP_NF_MATCH_AH_ESP=m
+CONFIG_IP_NF_MATCH_LENGTH=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_TCPMSS=y
+CONFIG_IP_NF_MATCH_HELPER=m
+CONFIG_IP_NF_MATCH_STATE=y
+CONFIG_IP_NF_MATCH_CONNTRACK=m
+CONFIG_IP_NF_MATCH_UNCLEAN=m
+# CONFIG_IP_NF_MATCH_OWNER is not set
+CONFIG_IP_NF_FILTER=y
+CONFIG_IP_NF_TARGET_REJECT=y
+CONFIG_IP_NF_TARGET_MIRROR=m
+CONFIG_IP_NF_NAT=y
+CONFIG_IP_NF_NAT_NEEDED=y
+CONFIG_IP_NF_TARGET_MASQUERADE=y
+CONFIG_IP_NF_TARGET_REDIRECT=y
+CONFIG_IP_NF_NAT_SNMP_BASIC=m
+CONFIG_IP_NF_NAT_IRC=y
+CONFIG_IP_NF_NAT_FTP=y
+CONFIG_IP_NF_NAT_TFTP=y
+CONFIG_IP_NF_MANGLE=y
+CONFIG_IP_NF_TARGET_TOS=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_DSCP=m
+CONFIG_IP_NF_TARGET_MARK=y
+CONFIG_IP_NF_TARGET_LOG=y
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_IP_NF_TARGET_TCPMSS=y
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+# CONFIG_IP_NF_ARP_MANGLE is not set
+
+#
+#   IP: Virtual Server Configuration
+#
+# CONFIG_IP_VS is not set
+CONFIG_IPV6=m
+
+#
+#   IPv6: Netfilter Configuration
+#
+CONFIG_IP6_NF_QUEUE=m
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_LIMIT=m
+CONFIG_IP6_NF_MATCH_MAC=m
+# CONFIG_IP6_NF_MATCH_RT is not set
+# CONFIG_IP6_NF_MATCH_OPTS is not set
+# CONFIG_IP6_NF_MATCH_FRAG is not set
+# CONFIG_IP6_NF_MATCH_HL is not set
+CONFIG_IP6_NF_MATCH_MULTIPORT=m
+CONFIG_IP6_NF_MATCH_OWNER=m
+CONFIG_IP6_NF_MATCH_MARK=m
+# CONFIG_IP6_NF_MATCH_IPV6HEADER is not set
+# CONFIG_IP6_NF_MATCH_AHESP is not set
+CONFIG_IP6_NF_MATCH_LENGTH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_MANGLE=m
+CONFIG_IP6_NF_TARGET_MARK=m
+# CONFIG_KHTTPD is not set
+
+#
+#    SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+# CONFIG_ATM is not set
+CONFIG_VLAN_8021Q=y
+
+#
+#  
+#
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_DECNET is not set
+CONFIG_BRIDGE=y
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_LLC is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_CBQ=m
+CONFIG_NET_SCH_HTB=m
+CONFIG_NET_SCH_CSZ=m
+# CONFIG_NET_SCH_HFSC is not set
+CONFIG_NET_SCH_PRIO=m
+CONFIG_NET_SCH_RED=m
+CONFIG_NET_SCH_SFQ=m
+CONFIG_NET_SCH_TEQL=m
+CONFIG_NET_SCH_TBF=m
+CONFIG_NET_SCH_GRED=m
+# CONFIG_NET_SCH_NETEM is not set
+CONFIG_NET_SCH_DSMARK=m
+CONFIG_NET_SCH_INGRESS=m
+CONFIG_NET_QOS=y
+CONFIG_NET_ESTIMATOR=y
+CONFIG_NET_CLS=y
+CONFIG_NET_CLS_TCINDEX=m
+CONFIG_NET_CLS_ROUTE4=m
+CONFIG_NET_CLS_ROUTE=y
+CONFIG_NET_CLS_FW=m
+CONFIG_NET_CLS_U32=m
+CONFIG_NET_CLS_RSVP=m
+CONFIG_NET_CLS_RSVP6=m
+CONFIG_NET_CLS_POLICE=y
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+# CONFIG_PHONE_IXJ is not set
+# CONFIG_PHONE_IXJ_PCMCIA is not set
+
+#
+# ATA/IDE/MFM/RLL support
+#
+# CONFIG_IDE is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI support
+#
+CONFIG_SCSI=m
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=m
+CONFIG_SD_EXTRA_DEVS=5
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+CONFIG_CHR_DEV_SG=m
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_DEBUG_QUEUES is not set
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_7000FASST is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AHA152X is not set
+# CONFIG_SCSI_AHA1542 is not set
+# CONFIG_SCSI_AHA1740 is not set
+# CONFIG_SCSI_AACRAID is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC79XX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_SCSI_ADVANSYS is not set
+# CONFIG_SCSI_IN2000 is not set
+# CONFIG_SCSI_AM53C974 is not set
+# CONFIG_SCSI_MEGARAID is not set
+# CONFIG_SCSI_MEGARAID2 is not set
+# CONFIG_SCSI_SATA is not set
+# CONFIG_SCSI_SATA_AHCI is not set
+# CONFIG_SCSI_SATA_SVW is not set
+# CONFIG_SCSI_ATA_PIIX is not set
+# CONFIG_SCSI_SATA_NV is not set
+# CONFIG_SCSI_SATA_PROMISE is not set
+# CONFIG_SCSI_SATA_SX4 is not set
+# CONFIG_SCSI_SATA_SIL is not set
+# CONFIG_SCSI_SATA_SIS is not set
+# CONFIG_SCSI_SATA_ULI is not set
+# CONFIG_SCSI_SATA_VIA is not set
+# CONFIG_SCSI_SATA_VITESSE is not set
+# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_CPQFCTS is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_DTC3280 is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_EATA_DMA is not set
+# CONFIG_SCSI_EATA_PIO is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GDTH is not set
+# CONFIG_SCSI_GENERIC_NCR5380 is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_NCR53C406A is not set
+# CONFIG_SCSI_NCR53C7xx is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_NCR53C8XX is not set
+# CONFIG_SCSI_SYM53C8XX is not set
+# CONFIG_SCSI_PAS16 is not set
+# CONFIG_SCSI_PCI2000 is not set
+# CONFIG_SCSI_PCI2220I is not set
+# CONFIG_SCSI_PSI240I is not set
+# CONFIG_SCSI_QLOGIC_FAS is not set
+# CONFIG_SCSI_QLOGIC_ISP is not set
+# CONFIG_SCSI_QLOGIC_FC is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+# CONFIG_SCSI_SIM710 is not set
+# CONFIG_SCSI_SYM53C416 is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_T128 is not set
+# CONFIG_SCSI_U14_34F is not set
+# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+# CONFIG_FUSION_BOOT is not set
+# CONFIG_FUSION_ISENSE is not set
+# CONFIG_FUSION_CTL is not set
+# CONFIG_FUSION_LAN is not set
+
+#
+# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+#
+# CONFIG_IEEE1394 is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+# CONFIG_I2O_PCI is not set
+# CONFIG_I2O_BLOCK is not set
+# CONFIG_I2O_LAN is not set
+# CONFIG_I2O_SCSI is not set
+# CONFIG_I2O_PROC is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+CONFIG_TUN=m
+# CONFIG_ETHERTAP is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+# CONFIG_SUNLANCE is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNBMAC is not set
+# CONFIG_SUNQE is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_LANCE is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_ISA is not set
+# CONFIG_NET_PCI is not set
+# CONFIG_NET_POCKET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
+CONFIG_PPP=y
+# CONFIG_PPP_MULTILINK is not set
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+# CONFIG_PPP_SYNC_TTY is not set
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPPOE=m
+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+CONFIG_SHAPER=m
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Input core support
+#
+# CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_UINPUT is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+CONFIG_SERIAL=y
+CONFIG_SERIAL_CONSOLE=y
+# CONFIG_SERIAL_EXTENDED is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=128
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Mice
+#
+# CONFIG_BUSMOUSE is not set
+# CONFIG_MOUSE is not set
+
+#
+# Joysticks
+#
+# CONFIG_INPUT_GAMEPORT is not set
+
+#
+# Input core support is needed for gameports
+#
+
+#
+# Input core support is needed for joysticks
+#
+# CONFIG_QIC02_TAPE is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_IPMI_PANIC_EVENT is not set
+# CONFIG_IPMI_DEVICE_INTERFACE is not set
+# CONFIG_IPMI_KCS is not set
+# CONFIG_IPMI_WATCHDOG is not set
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+# CONFIG_ACQUIRE_WDT is not set
+# CONFIG_ADVANTECH_WDT is not set
+# CONFIG_ALIM1535_WDT is not set
+# CONFIG_ALIM7101_WDT is not set
+# CONFIG_SC520_WDT is not set
+# CONFIG_PCWATCHDOG is not set
+# CONFIG_EUROTECH_WDT is not set
+# CONFIG_IB700_WDT is not set
+# CONFIG_WAFER_WDT is not set
+# CONFIG_I810_TCO is not set
+# CONFIG_MIXCOMWD is not set
+# CONFIG_60XX_WDT is not set
+# CONFIG_SC1200_WDT is not set
+# CONFIG_SCx200_WDT is not set
+CONFIG_SOFT_WATCHDOG=y
+# CONFIG_W83877F_WDT is not set
+# CONFIG_WDT is not set
+# CONFIG_WDTPCI is not set
+# CONFIG_MACHZ_WDT is not set
+# CONFIG_SCx200 is not set
+# CONFIG_SCx200_GPIO is not set
+# CONFIG_AMD_PM768 is not set
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set
+# CONFIG_MIPS_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set
+
+#
+# Direct Rendering Manager (XFree86 DRI support)
+#
+# CONFIG_DRM is not set
+
+#
+# File systems
+#
+# CONFIG_QUOTA is not set
+# CONFIG_QFMT_V2 is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BEFS_DEBUG is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+# CONFIG_UMSDOS_FS is not set
+CONFIG_VFAT_FS=m
+# CONFIG_EFS_FS is not set
+# CONFIG_JFFS_FS is not set
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_CRAMFS=y
+# CONFIG_TMPFS is not set
+CONFIG_RAMFS=y
+# CONFIG_ISO9660_FS is not set
+# CONFIG_JOLIET is not set
+# CONFIG_ZISOFS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_JFS_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_RW is not set
+# CONFIG_HPFS_FS is not set
+CONFIG_PROC_FS=y
+CONFIG_DEVFS_FS=y
+CONFIG_DEVFS_MOUNT=y
+# CONFIG_DEVFS_DEBUG is not set
+# CONFIG_DEVPTS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX4FS_RW is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_EXT2_FS=m
+# CONFIG_SYSV_FS is not set
+# CONFIG_UDF_FS is not set
+# CONFIG_UDF_RW is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_UFS_FS_WRITE is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_XFS_QUOTA is not set
+# CONFIG_XFS_RT is not set
+# CONFIG_XFS_TRACE is not set
+# CONFIG_XFS_DEBUG is not set
+
+#
+# Network File Systems
+#
+# CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_ROOT_NFS is not set
+# CONFIG_NFSD is not set
+# CONFIG_NFSD_V3 is not set
+# CONFIG_NFSD_TCP is not set
+CONFIG_SUNRPC=m
+CONFIG_LOCKD=m
+CONFIG_LOCKD_V4=y
+# CONFIG_SMB_FS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
+# CONFIG_ZISOFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SMB_NLS is not set
+CONFIG_NLS=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS_DEFAULT="iso8859-1"
+# CONFIG_NLS_CODEPAGE_437 is not set
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ISO8859_1 is not set
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_UTF8 is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+CONFIG_USB=m
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_BANDWIDTH is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_EHCI_HCD is not set
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+CONFIG_USB_OHCI=m
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_MIDI is not set
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+CONFIG_USB_STORAGE_DATAFAB=y
+CONFIG_USB_STORAGE_FREECOM=y
+# CONFIG_USB_STORAGE_ISD200 is not set
+CONFIG_USB_STORAGE_DPCM=y
+CONFIG_USB_STORAGE_HP8200e=y
+CONFIG_USB_STORAGE_SDDR09=y
+CONFIG_USB_STORAGE_SDDR55=y
+CONFIG_USB_STORAGE_JUMPSHOT=y
+# CONFIG_USB_ACM is not set
+CONFIG_USB_PRINTER=m
+
+#
+# USB Human Interface Devices (HID)
+#
+# CONFIG_USB_HID is not set
+
+#
+#     Input core support is needed for USB HID input layer or HIDBP support
+#
+# CONFIG_USB_HIDINPUT is not set
+# CONFIG_USB_HIDDEV is not set
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+# CONFIG_USB_AIPTEK is not set
+# CONFIG_USB_WACOM is not set
+# CONFIG_USB_KBTAB is not set
+# CONFIG_USB_POWERMATE is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+
+#
+#   Video4Linux support is needed for USB Multimedia device support
+#
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_TIGL is not set
+# CONFIG_USB_BRLVGER is not set
+# CONFIG_USB_LCD is not set
+
+#
+# Support for USB gadgets
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# Bluetooth support
+#
+# CONFIG_BLUEZ is not set
+
+#
+# Kernel hacking
+#
+CONFIG_CROSSCOMPILE=y
+# CONFIG_RUNTIME_DEBUG is not set
+# CONFIG_KGDB is not set
+# CONFIG_GDB_CONSOLE is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_MIPS_UNCACHED is not set
+CONFIG_LOG_BUF_SHIFT=0
+
+#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
+# Library routines
+#
+# CONFIG_CRC32 is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
diff --git a/openwrt/toolchain/kernel-headers/kernel-headers.mk b/openwrt/toolchain/kernel-headers/kernel-headers.mk
deleted file mode 100644 (file)
index b69a687..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-# linux kernel headers for toolchain
-
-LINUX_HEADERS_VERSION=2.4.30
-LINUX_KERNEL_MD5SUM:=75d8ce40a3668603017cd186909efe8d
-LINUX_HEADERS_SITE=http://www.fi.kernel.org/pub/linux/kernel/v2.4 \
-                  http://www.fr.kernel.org/pub/linux/kernel/v2.4 \
-                  http://www.kernel.org/pub/linux/kernel/v2.4 \
-                  http://www.de.kernel.org/pub/linux/kernel/v2.4 
-LINUX_HEADERS_SOURCE=linux-$(LINUX_HEADERS_VERSION).tar.bz2
-LINUX_HEADERS_CONFIG=./linux.config
-LINUX_HEADERS_ARCH:=$(shell echo $(ARCH) | sed -e 's/i[3-9]86/i386/' \
-       -e 's/mipsel/mips/' \
-       -e 's/powerpc/ppc/' \
-       -e 's/sh[234]/sh/' \
-       )
-
-$(DL_DIR)/$(LINUX_HEADERS_SOURCE):
-       -mkdir -p $(DL_DIR)
-       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(LINUX_HEADERS_SOURCE) $(LINUX_KERNEL_MD5SUM) $(LINUX_HEADERS_SITE)
-
-$(LINUX_HEADERS_DIR)/.unpacked: $(DL_DIR)/$(LINUX_HEADERS_SOURCE)
-       mkdir -p $(TOOL_BUILD_DIR)
-       bzcat $(DL_DIR)/$(LINUX_HEADERS_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) - \
-               linux-$(LINUX_HEADERS_VERSION)/include \
-               linux-$(LINUX_HEADERS_VERSION)/Makefile \
-               linux-$(LINUX_HEADERS_VERSION)/Rules.make \
-               linux-$(LINUX_HEADERS_VERSION)/arch/$(LINUX_HEADERS_ARCH)/Makefile \
-               linux-$(LINUX_HEADERS_VERSION)/scripts \
-               linux-$(LINUX_HEADERS_VERSION)/arch/$(LINUX_HEADERS_ARCH)/config*.in \
-               linux-$(LINUX_HEADERS_VERSION)/*/*/Config.in \
-               linux-$(LINUX_HEADERS_VERSION)/*/Config.in
-       ln -sf $(LINUX_HEADERS_DIR)-$(LINUX_HEADERS_VERSION) $(LINUX_HEADERS_DIR)
-       $(SED) 's/@expr length/@-expr length/' $(LINUX_HEADERS_DIR)/Makefile 
-       touch $(LINUX_HEADERS_DIR)/.unpacked
-
-$(LINUX_HEADERS_DIR)/.configured: $(LINUX_HEADERS_DIR)/.unpacked
-       -cp -af $(LINUX_HEADERS_CONFIG) $(LINUX_HEADERS_DIR)/.config
-       $(MAKE) -C $(LINUX_HEADERS_DIR) ARCH=$(LINUX_HEADERS_ARCH) oldconfig include/linux/version.h
-       touch $(LINUX_HEADERS_DIR)/.configured
-
-kernel-headers: $(LINUX_HEADERS_DIR)/.configured
-
-kernel-headers-source: $(DL_DIR)/$(LINUX_HEADERS_SOURCE)
-
-kernel-headers-clean: clean
-       rm -rf $(LINUX_HEADERS_DIR)
-
-kernel-headers-toolclean:
-       rm -rf $(LINUX_HEADERS_DIR)
diff --git a/openwrt/toolchain/kernel-headers/linux.config b/openwrt/toolchain/kernel-headers/linux.config
deleted file mode 100644 (file)
index d641202..0000000
+++ /dev/null
@@ -1,1045 +0,0 @@
-#
-# Automatically generated make config: don't edit
-#
-CONFIG_MIPS=y
-CONFIG_MIPS32=y
-# CONFIG_MIPS64 is not set
-
-#
-# Code maturity level options
-#
-CONFIG_EXPERIMENTAL=y
-
-#
-# Loadable module support
-#
-CONFIG_MODULES=y
-# CONFIG_MODVERSIONS is not set
-# CONFIG_KMOD is not set
-
-#
-# Machine selection
-#
-# CONFIG_ACER_PICA_61 is not set
-# CONFIG_MIPS_BOSPORUS is not set
-# CONFIG_MIPS_MIRAGE is not set
-# CONFIG_MIPS_DB1000 is not set
-# CONFIG_MIPS_DB1100 is not set
-# CONFIG_MIPS_DB1500 is not set
-# CONFIG_MIPS_DB1550 is not set
-# CONFIG_MIPS_PB1000 is not set
-# CONFIG_MIPS_PB1100 is not set
-# CONFIG_MIPS_PB1500 is not set
-# CONFIG_MIPS_HYDROGEN3 is not set
-# CONFIG_MIPS_PB1550 is not set
-# CONFIG_MIPS_XXS1500 is not set
-# CONFIG_MIPS_MTX1 is not set
-# CONFIG_COGENT_CSB250 is not set
-# CONFIG_BAGET_MIPS is not set
-# CONFIG_CASIO_E55 is not set
-# CONFIG_MIPS_COBALT is not set
-# CONFIG_DECSTATION is not set
-# CONFIG_MIPS_EV64120 is not set
-# CONFIG_MIPS_EV96100 is not set
-# CONFIG_MIPS_IVR is not set
-# CONFIG_HP_LASERJET is not set
-# CONFIG_IBM_WORKPAD is not set
-# CONFIG_LASAT is not set
-# CONFIG_MIPS_ITE8172 is not set
-# CONFIG_MIPS_ATLAS is not set
-# CONFIG_MIPS_MAGNUM_4000 is not set
-# CONFIG_MIPS_MALTA is not set
-# CONFIG_MIPS_SEAD is not set
-# CONFIG_MOMENCO_OCELOT is not set
-# CONFIG_MOMENCO_OCELOT_G is not set
-# CONFIG_MOMENCO_OCELOT_C is not set
-# CONFIG_MOMENCO_JAGUAR_ATX is not set
-# CONFIG_PMC_BIG_SUR is not set
-# CONFIG_PMC_STRETCH is not set
-# CONFIG_PMC_YOSEMITE is not set
-# CONFIG_DDB5074 is not set
-# CONFIG_DDB5476 is not set
-# CONFIG_DDB5477 is not set
-# CONFIG_NEC_OSPREY is not set
-# CONFIG_NEC_EAGLE is not set
-# CONFIG_OLIVETTI_M700 is not set
-# CONFIG_NINO is not set
-# CONFIG_SGI_IP22 is not set
-# CONFIG_SGI_IP27 is not set
-# CONFIG_SIBYTE_SB1xxx_SOC is not set
-# CONFIG_SNI_RM200_PCI is not set
-# CONFIG_TANBAC_TB0226 is not set
-# CONFIG_TANBAC_TB0229 is not set
-# CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_TOSHIBA_RBTX4927 is not set
-# CONFIG_VICTOR_MPC30X is not set
-# CONFIG_ZAO_CAPCELLA is not set
-# CONFIG_HIGHMEM is not set
-CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
-# CONFIG_MIPS_AU1000 is not set
-
-#
-# CPU selection
-#
-CONFIG_CPU_MIPS32=y
-# CONFIG_CPU_MIPS64 is not set
-# CONFIG_CPU_R3000 is not set
-# CONFIG_CPU_TX39XX is not set
-# CONFIG_CPU_VR41XX is not set
-# CONFIG_CPU_R4300 is not set
-# CONFIG_CPU_R4X00 is not set
-# CONFIG_CPU_TX49XX is not set
-# CONFIG_CPU_R5000 is not set
-# CONFIG_CPU_R5432 is not set
-# CONFIG_CPU_R6000 is not set
-# CONFIG_CPU_NEVADA is not set
-# CONFIG_CPU_R8000 is not set
-# CONFIG_CPU_R10000 is not set
-# CONFIG_CPU_RM7000 is not set
-# CONFIG_CPU_RM9000 is not set
-# CONFIG_CPU_SB1 is not set
-CONFIG_PAGE_SIZE_4KB=y
-# CONFIG_PAGE_SIZE_16KB is not set
-# CONFIG_PAGE_SIZE_64KB is not set
-CONFIG_CPU_HAS_PREFETCH=y
-# CONFIG_VTAG_ICACHE is not set
-# CONFIG_64BIT_PHYS_ADDR is not set
-# CONFIG_CPU_ADVANCED is not set
-CONFIG_CPU_HAS_LLSC=y
-# CONFIG_CPU_HAS_LLDSCD is not set
-# CONFIG_CPU_HAS_WB is not set
-CONFIG_CPU_HAS_SYNC=y
-
-#
-# General setup
-#
-CONFIG_CPU_LITTLE_ENDIAN=y
-# CONFIG_BUILD_ELF64 is not set
-CONFIG_NET=y
-CONFIG_PCI=y
-# CONFIG_PCI_NEW is not set
-CONFIG_PCI_AUTO=y
-# CONFIG_PCI_NAMES is not set
-# CONFIG_ISA is not set
-# CONFIG_TC is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
-# CONFIG_HOTPLUG is not set
-# CONFIG_PCMCIA is not set
-# CONFIG_HOTPLUG_PCI is not set
-CONFIG_SYSVIPC=y
-# CONFIG_BSD_PROCESS_ACCT is not set
-CONFIG_SYSCTL=y
-CONFIG_KCORE_ELF=y
-# CONFIG_KCORE_AOUT is not set
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_MIPS32_COMPAT is not set
-# CONFIG_MIPS32_O32 is not set
-# CONFIG_MIPS32_N32 is not set
-# CONFIG_BINFMT_ELF32 is not set
-# CONFIG_BINFMT_MISC is not set
-# CONFIG_OOM_KILLER is not set
-# CONFIG_CMDLINE_BOOL is not set
-
-#
-# Memory Technology Devices (MTD)
-#
-CONFIG_MTD=y
-# CONFIG_MTD_DEBUG is not set
-CONFIG_MTD_PARTITIONS=y
-# CONFIG_MTD_CONCAT is not set
-# CONFIG_MTD_REDBOOT_PARTS is not set
-# CONFIG_MTD_CMDLINE_PARTS is not set
-
-#
-# User Modules And Translation Layers
-#
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_BLOCK=y
-# CONFIG_FTL is not set
-# CONFIG_NFTL is not set
-
-#
-# RAM/ROM/Flash chip drivers
-#
-CONFIG_MTD_CFI=y
-# CONFIG_MTD_JEDECPROBE is not set
-CONFIG_MTD_GEN_PROBE=y
-CONFIG_MTD_CFI_ADV_OPTIONS=y
-CONFIG_MTD_CFI_NOSWAP=y
-# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
-# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
-CONFIG_MTD_CFI_GEOMETRY=y
-# CONFIG_MTD_CFI_B1 is not set
-CONFIG_MTD_CFI_B2=y
-# CONFIG_MTD_CFI_B4 is not set
-# CONFIG_MTD_CFI_B8 is not set
-CONFIG_MTD_CFI_I1=y
-# CONFIG_MTD_CFI_I2 is not set
-# CONFIG_MTD_CFI_I4 is not set
-# CONFIG_MTD_CFI_I8 is not set
-CONFIG_MTD_CFI_INTELEXT=y
-CONFIG_MTD_CFI_AMDSTD=y
-# CONFIG_MTD_CFI_STAA is not set
-# CONFIG_MTD_RAM is not set
-# CONFIG_MTD_ROM is not set
-# CONFIG_MTD_ABSENT is not set
-# CONFIG_MTD_OBSOLETE_CHIPS is not set
-# CONFIG_MTD_AMDSTD is not set
-# CONFIG_MTD_SHARP is not set
-# CONFIG_MTD_JEDEC is not set
-
-#
-# Mapping drivers for chip access
-#
-# CONFIG_MTD_PHYSMAP is not set
-# CONFIG_MTD_PB1000 is not set
-# CONFIG_MTD_PB1500 is not set
-# CONFIG_MTD_PB1100 is not set
-# CONFIG_MTD_CSTM_MIPS_IXX is not set
-# CONFIG_MTD_OCELOT is not set
-# CONFIG_MTD_LASAT is not set
-# CONFIG_MTD_PCI is not set
-# CONFIG_MTD_PCMCIA is not set
-
-#
-# Self-contained MTD device drivers
-#
-# CONFIG_MTD_PMC551 is not set
-# CONFIG_MTD_SLRAM is not set
-# CONFIG_MTD_MTDRAM is not set
-# CONFIG_MTD_BLKMTD is not set
-
-#
-# Disk-On-Chip Device Drivers
-#
-# CONFIG_MTD_DOC1000 is not set
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOCPROBE is not set
-
-#
-# NAND Flash Device Drivers
-#
-# CONFIG_MTD_NAND is not set
-
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
-
-#
-# Plug and Play configuration
-#
-# CONFIG_PNP is not set
-# CONFIG_ISAPNP is not set
-
-#
-# Block devices
-#
-# CONFIG_BLK_DEV_FD is not set
-# CONFIG_BLK_DEV_XD is not set
-# CONFIG_PARIDE is not set
-# CONFIG_BLK_CPQ_DA is not set
-# CONFIG_BLK_CPQ_CISS_DA is not set
-# CONFIG_CISS_SCSI_TAPE is not set
-# CONFIG_CISS_MONITOR_THREAD is not set
-# CONFIG_BLK_DEV_DAC960 is not set
-# CONFIG_BLK_DEV_UMEM is not set
-# CONFIG_BLK_DEV_SX8 is not set
-CONFIG_BLK_DEV_LOOP=y
-CONFIG_BLK_DEV_NBD=m
-# CONFIG_BLK_DEV_RAM is not set
-# CONFIG_BLK_DEV_INITRD is not set
-# CONFIG_BLK_STATS is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-# CONFIG_BLK_DEV_MD is not set
-# CONFIG_MD_LINEAR is not set
-# CONFIG_MD_RAID0 is not set
-# CONFIG_MD_RAID1 is not set
-# CONFIG_MD_RAID5 is not set
-# CONFIG_MD_MULTIPATH is not set
-# CONFIG_BLK_DEV_LVM is not set
-
-#
-# Networking options
-#
-CONFIG_PACKET=y
-CONFIG_PACKET_MMAP=y
-CONFIG_NETLINK_DEV=m
-CONFIG_NETFILTER=y
-# CONFIG_NETFILTER_DEBUG is not set
-# CONFIG_FILTER is not set
-CONFIG_UNIX=y
-CONFIG_INET=y
-# CONFIG_IP_MULTICAST is not set
-CONFIG_IP_ADVANCED_ROUTER=y
-CONFIG_IP_MULTIPLE_TABLES=y
-CONFIG_IP_ROUTE_FWMARK=y
-CONFIG_IP_ROUTE_NAT=y
-CONFIG_IP_ROUTE_MULTIPATH=y
-CONFIG_IP_ROUTE_TOS=y
-# CONFIG_IP_ROUTE_VERBOSE is not set
-# CONFIG_IP_PNP is not set
-CONFIG_NET_IPIP=m
-CONFIG_NET_IPGRE=m
-# CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
-# CONFIG_SYN_COOKIES is not set
-
-#
-#   IP: Netfilter Configuration
-#
-CONFIG_IP_NF_CONNTRACK=y
-CONFIG_IP_NF_FTP=y
-# CONFIG_IP_NF_AMANDA is not set
-CONFIG_IP_NF_TFTP=y
-CONFIG_IP_NF_IRC=y
-CONFIG_IP_NF_QUEUE=m
-CONFIG_IP_NF_IPTABLES=y
-CONFIG_IP_NF_MATCH_LIMIT=m
-CONFIG_IP_NF_MATCH_MAC=m
-CONFIG_IP_NF_MATCH_PKTTYPE=m
-CONFIG_IP_NF_MATCH_MARK=y
-CONFIG_IP_NF_MATCH_MULTIPORT=y
-CONFIG_IP_NF_MATCH_TOS=m
-# CONFIG_IP_NF_MATCH_RECENT is not set
-CONFIG_IP_NF_MATCH_ECN=m
-CONFIG_IP_NF_MATCH_DSCP=m
-CONFIG_IP_NF_MATCH_AH_ESP=m
-CONFIG_IP_NF_MATCH_LENGTH=m
-CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_MATCH_TCPMSS=y
-CONFIG_IP_NF_MATCH_HELPER=m
-CONFIG_IP_NF_MATCH_STATE=y
-CONFIG_IP_NF_MATCH_CONNTRACK=m
-CONFIG_IP_NF_MATCH_UNCLEAN=m
-# CONFIG_IP_NF_MATCH_OWNER is not set
-CONFIG_IP_NF_FILTER=y
-CONFIG_IP_NF_TARGET_REJECT=y
-CONFIG_IP_NF_TARGET_MIRROR=m
-CONFIG_IP_NF_NAT=y
-CONFIG_IP_NF_NAT_NEEDED=y
-CONFIG_IP_NF_TARGET_MASQUERADE=y
-CONFIG_IP_NF_TARGET_REDIRECT=y
-CONFIG_IP_NF_NAT_SNMP_BASIC=m
-CONFIG_IP_NF_NAT_IRC=y
-CONFIG_IP_NF_NAT_FTP=y
-CONFIG_IP_NF_NAT_TFTP=y
-CONFIG_IP_NF_MANGLE=y
-CONFIG_IP_NF_TARGET_TOS=m
-CONFIG_IP_NF_TARGET_ECN=m
-CONFIG_IP_NF_TARGET_DSCP=m
-CONFIG_IP_NF_TARGET_MARK=y
-CONFIG_IP_NF_TARGET_LOG=y
-CONFIG_IP_NF_TARGET_ULOG=m
-CONFIG_IP_NF_TARGET_TCPMSS=y
-CONFIG_IP_NF_ARPTABLES=m
-CONFIG_IP_NF_ARPFILTER=m
-# CONFIG_IP_NF_ARP_MANGLE is not set
-
-#
-#   IP: Virtual Server Configuration
-#
-# CONFIG_IP_VS is not set
-CONFIG_IPV6=m
-
-#
-#   IPv6: Netfilter Configuration
-#
-CONFIG_IP6_NF_QUEUE=m
-CONFIG_IP6_NF_IPTABLES=m
-CONFIG_IP6_NF_MATCH_LIMIT=m
-CONFIG_IP6_NF_MATCH_MAC=m
-# CONFIG_IP6_NF_MATCH_RT is not set
-# CONFIG_IP6_NF_MATCH_OPTS is not set
-# CONFIG_IP6_NF_MATCH_FRAG is not set
-# CONFIG_IP6_NF_MATCH_HL is not set
-CONFIG_IP6_NF_MATCH_MULTIPORT=m
-CONFIG_IP6_NF_MATCH_OWNER=m
-CONFIG_IP6_NF_MATCH_MARK=m
-# CONFIG_IP6_NF_MATCH_IPV6HEADER is not set
-# CONFIG_IP6_NF_MATCH_AHESP is not set
-CONFIG_IP6_NF_MATCH_LENGTH=m
-CONFIG_IP6_NF_MATCH_EUI64=m
-CONFIG_IP6_NF_FILTER=m
-CONFIG_IP6_NF_TARGET_LOG=m
-CONFIG_IP6_NF_MANGLE=m
-CONFIG_IP6_NF_TARGET_MARK=m
-# CONFIG_KHTTPD is not set
-
-#
-#    SCTP Configuration (EXPERIMENTAL)
-#
-# CONFIG_IP_SCTP is not set
-# CONFIG_ATM is not set
-CONFIG_VLAN_8021Q=y
-
-#
-#  
-#
-# CONFIG_IPX is not set
-# CONFIG_ATALK is not set
-# CONFIG_DECNET is not set
-CONFIG_BRIDGE=y
-# CONFIG_X25 is not set
-# CONFIG_LAPB is not set
-# CONFIG_LLC is not set
-# CONFIG_NET_DIVERT is not set
-# CONFIG_ECONET is not set
-# CONFIG_WAN_ROUTER is not set
-# CONFIG_NET_FASTROUTE is not set
-# CONFIG_NET_HW_FLOWCONTROL is not set
-
-#
-# QoS and/or fair queueing
-#
-CONFIG_NET_SCHED=y
-CONFIG_NET_SCH_CBQ=m
-CONFIG_NET_SCH_HTB=m
-CONFIG_NET_SCH_CSZ=m
-# CONFIG_NET_SCH_HFSC is not set
-CONFIG_NET_SCH_PRIO=m
-CONFIG_NET_SCH_RED=m
-CONFIG_NET_SCH_SFQ=m
-CONFIG_NET_SCH_TEQL=m
-CONFIG_NET_SCH_TBF=m
-CONFIG_NET_SCH_GRED=m
-# CONFIG_NET_SCH_NETEM is not set
-CONFIG_NET_SCH_DSMARK=m
-CONFIG_NET_SCH_INGRESS=m
-CONFIG_NET_QOS=y
-CONFIG_NET_ESTIMATOR=y
-CONFIG_NET_CLS=y
-CONFIG_NET_CLS_TCINDEX=m
-CONFIG_NET_CLS_ROUTE4=m
-CONFIG_NET_CLS_ROUTE=y
-CONFIG_NET_CLS_FW=m
-CONFIG_NET_CLS_U32=m
-CONFIG_NET_CLS_RSVP=m
-CONFIG_NET_CLS_RSVP6=m
-CONFIG_NET_CLS_POLICE=y
-
-#
-# Network testing
-#
-# CONFIG_NET_PKTGEN is not set
-
-#
-# Telephony Support
-#
-# CONFIG_PHONE is not set
-# CONFIG_PHONE_IXJ is not set
-# CONFIG_PHONE_IXJ_PCMCIA is not set
-
-#
-# ATA/IDE/MFM/RLL support
-#
-# CONFIG_IDE is not set
-# CONFIG_BLK_DEV_HD is not set
-
-#
-# SCSI support
-#
-CONFIG_SCSI=m
-
-#
-# SCSI support type (disk, tape, CD-ROM)
-#
-CONFIG_BLK_DEV_SD=m
-CONFIG_SD_EXTRA_DEVS=5
-# CONFIG_CHR_DEV_ST is not set
-# CONFIG_CHR_DEV_OSST is not set
-# CONFIG_BLK_DEV_SR is not set
-CONFIG_CHR_DEV_SG=m
-
-#
-# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
-#
-# CONFIG_SCSI_DEBUG_QUEUES is not set
-# CONFIG_SCSI_MULTI_LUN is not set
-# CONFIG_SCSI_CONSTANTS is not set
-# CONFIG_SCSI_LOGGING is not set
-
-#
-# SCSI low-level drivers
-#
-# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
-# CONFIG_SCSI_7000FASST is not set
-# CONFIG_SCSI_ACARD is not set
-# CONFIG_SCSI_AHA152X is not set
-# CONFIG_SCSI_AHA1542 is not set
-# CONFIG_SCSI_AHA1740 is not set
-# CONFIG_SCSI_AACRAID is not set
-# CONFIG_SCSI_AIC7XXX is not set
-# CONFIG_SCSI_AIC79XX is not set
-# CONFIG_SCSI_AIC7XXX_OLD is not set
-# CONFIG_SCSI_DPT_I2O is not set
-# CONFIG_SCSI_ADVANSYS is not set
-# CONFIG_SCSI_IN2000 is not set
-# CONFIG_SCSI_AM53C974 is not set
-# CONFIG_SCSI_MEGARAID is not set
-# CONFIG_SCSI_MEGARAID2 is not set
-# CONFIG_SCSI_SATA is not set
-# CONFIG_SCSI_SATA_AHCI is not set
-# CONFIG_SCSI_SATA_SVW is not set
-# CONFIG_SCSI_ATA_PIIX is not set
-# CONFIG_SCSI_SATA_NV is not set
-# CONFIG_SCSI_SATA_PROMISE is not set
-# CONFIG_SCSI_SATA_SX4 is not set
-# CONFIG_SCSI_SATA_SIL is not set
-# CONFIG_SCSI_SATA_SIS is not set
-# CONFIG_SCSI_SATA_ULI is not set
-# CONFIG_SCSI_SATA_VIA is not set
-# CONFIG_SCSI_SATA_VITESSE is not set
-# CONFIG_SCSI_BUSLOGIC is not set
-# CONFIG_SCSI_CPQFCTS is not set
-# CONFIG_SCSI_DMX3191D is not set
-# CONFIG_SCSI_DTC3280 is not set
-# CONFIG_SCSI_EATA is not set
-# CONFIG_SCSI_EATA_DMA is not set
-# CONFIG_SCSI_EATA_PIO is not set
-# CONFIG_SCSI_FUTURE_DOMAIN is not set
-# CONFIG_SCSI_GDTH is not set
-# CONFIG_SCSI_GENERIC_NCR5380 is not set
-# CONFIG_SCSI_INITIO is not set
-# CONFIG_SCSI_INIA100 is not set
-# CONFIG_SCSI_NCR53C406A is not set
-# CONFIG_SCSI_NCR53C7xx is not set
-# CONFIG_SCSI_SYM53C8XX_2 is not set
-# CONFIG_SCSI_NCR53C8XX is not set
-# CONFIG_SCSI_SYM53C8XX is not set
-# CONFIG_SCSI_PAS16 is not set
-# CONFIG_SCSI_PCI2000 is not set
-# CONFIG_SCSI_PCI2220I is not set
-# CONFIG_SCSI_PSI240I is not set
-# CONFIG_SCSI_QLOGIC_FAS is not set
-# CONFIG_SCSI_QLOGIC_ISP is not set
-# CONFIG_SCSI_QLOGIC_FC is not set
-# CONFIG_SCSI_QLOGIC_1280 is not set
-# CONFIG_SCSI_SIM710 is not set
-# CONFIG_SCSI_SYM53C416 is not set
-# CONFIG_SCSI_DC390T is not set
-# CONFIG_SCSI_T128 is not set
-# CONFIG_SCSI_U14_34F is not set
-# CONFIG_SCSI_NSP32 is not set
-# CONFIG_SCSI_DEBUG is not set
-
-#
-# Fusion MPT device support
-#
-# CONFIG_FUSION is not set
-# CONFIG_FUSION_BOOT is not set
-# CONFIG_FUSION_ISENSE is not set
-# CONFIG_FUSION_CTL is not set
-# CONFIG_FUSION_LAN is not set
-
-#
-# IEEE 1394 (FireWire) support (EXPERIMENTAL)
-#
-# CONFIG_IEEE1394 is not set
-
-#
-# I2O device support
-#
-# CONFIG_I2O is not set
-# CONFIG_I2O_PCI is not set
-# CONFIG_I2O_BLOCK is not set
-# CONFIG_I2O_LAN is not set
-# CONFIG_I2O_SCSI is not set
-# CONFIG_I2O_PROC is not set
-
-#
-# Network device support
-#
-CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-CONFIG_TUN=m
-# CONFIG_ETHERTAP is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
-CONFIG_NET_ETHERNET=y
-# CONFIG_SUNLANCE is not set
-# CONFIG_HAPPYMEAL is not set
-# CONFIG_SUNBMAC is not set
-# CONFIG_SUNQE is not set
-# CONFIG_SUNGEM is not set
-# CONFIG_NET_VENDOR_3COM is not set
-# CONFIG_LANCE is not set
-# CONFIG_NET_VENDOR_SMC is not set
-# CONFIG_NET_VENDOR_RACAL is not set
-# CONFIG_HP100 is not set
-# CONFIG_NET_ISA is not set
-# CONFIG_NET_PCI is not set
-# CONFIG_NET_POCKET is not set
-
-#
-# Ethernet (1000 Mbit)
-#
-# CONFIG_ACENIC is not set
-# CONFIG_DL2K is not set
-# CONFIG_E1000 is not set
-# CONFIG_MYRI_SBUS is not set
-# CONFIG_NS83820 is not set
-# CONFIG_HAMACHI is not set
-# CONFIG_YELLOWFIN is not set
-# CONFIG_R8169 is not set
-# CONFIG_SK98LIN is not set
-# CONFIG_TIGON3 is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PLIP is not set
-CONFIG_PPP=y
-# CONFIG_PPP_MULTILINK is not set
-# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=m
-# CONFIG_PPP_SYNC_TTY is not set
-CONFIG_PPP_DEFLATE=m
-CONFIG_PPP_BSDCOMP=m
-CONFIG_PPPOE=m
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
-
-#
-# Token Ring devices
-#
-# CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
-CONFIG_SHAPER=m
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# ISDN subsystem
-#
-# CONFIG_ISDN is not set
-
-#
-# Input core support
-#
-# CONFIG_INPUT is not set
-# CONFIG_INPUT_KEYBDEV is not set
-# CONFIG_INPUT_MOUSEDEV is not set
-# CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_EVDEV is not set
-# CONFIG_INPUT_UINPUT is not set
-
-#
-# Character devices
-#
-# CONFIG_VT is not set
-CONFIG_SERIAL=y
-CONFIG_SERIAL_CONSOLE=y
-# CONFIG_SERIAL_EXTENDED is not set
-# CONFIG_SERIAL_NONSTANDARD is not set
-CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=128
-
-#
-# I2C support
-#
-# CONFIG_I2C is not set
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
-# CONFIG_MOUSE is not set
-
-#
-# Joysticks
-#
-# CONFIG_INPUT_GAMEPORT is not set
-
-#
-# Input core support is needed for gameports
-#
-
-#
-# Input core support is needed for joysticks
-#
-# CONFIG_QIC02_TAPE is not set
-# CONFIG_IPMI_HANDLER is not set
-# CONFIG_IPMI_PANIC_EVENT is not set
-# CONFIG_IPMI_DEVICE_INTERFACE is not set
-# CONFIG_IPMI_KCS is not set
-# CONFIG_IPMI_WATCHDOG is not set
-
-#
-# Watchdog Cards
-#
-CONFIG_WATCHDOG=y
-CONFIG_WATCHDOG_NOWAYOUT=y
-# CONFIG_ACQUIRE_WDT is not set
-# CONFIG_ADVANTECH_WDT is not set
-# CONFIG_ALIM1535_WDT is not set
-# CONFIG_ALIM7101_WDT is not set
-# CONFIG_SC520_WDT is not set
-# CONFIG_PCWATCHDOG is not set
-# CONFIG_EUROTECH_WDT is not set
-# CONFIG_IB700_WDT is not set
-# CONFIG_WAFER_WDT is not set
-# CONFIG_I810_TCO is not set
-# CONFIG_MIXCOMWD is not set
-# CONFIG_60XX_WDT is not set
-# CONFIG_SC1200_WDT is not set
-# CONFIG_SCx200_WDT is not set
-CONFIG_SOFT_WATCHDOG=y
-# CONFIG_W83877F_WDT is not set
-# CONFIG_WDT is not set
-# CONFIG_WDTPCI is not set
-# CONFIG_MACHZ_WDT is not set
-# CONFIG_SCx200 is not set
-# CONFIG_SCx200_GPIO is not set
-# CONFIG_AMD_PM768 is not set
-# CONFIG_NVRAM is not set
-# CONFIG_RTC is not set
-# CONFIG_MIPS_RTC is not set
-# CONFIG_DTLK is not set
-# CONFIG_R3964 is not set
-# CONFIG_APPLICOM is not set
-
-#
-# Ftape, the floppy tape device driver
-#
-# CONFIG_FTAPE is not set
-# CONFIG_AGP is not set
-
-#
-# Direct Rendering Manager (XFree86 DRI support)
-#
-# CONFIG_DRM is not set
-
-#
-# File systems
-#
-# CONFIG_QUOTA is not set
-# CONFIG_QFMT_V2 is not set
-# CONFIG_AUTOFS_FS is not set
-# CONFIG_AUTOFS4_FS is not set
-# CONFIG_REISERFS_FS is not set
-# CONFIG_REISERFS_CHECK is not set
-# CONFIG_REISERFS_PROC_INFO is not set
-# CONFIG_ADFS_FS is not set
-# CONFIG_ADFS_FS_RW is not set
-# CONFIG_AFFS_FS is not set
-# CONFIG_HFS_FS is not set
-# CONFIG_HFSPLUS_FS is not set
-# CONFIG_BEFS_FS is not set
-# CONFIG_BEFS_DEBUG is not set
-# CONFIG_BFS_FS is not set
-# CONFIG_EXT3_FS is not set
-# CONFIG_JBD is not set
-# CONFIG_JBD_DEBUG is not set
-CONFIG_FAT_FS=m
-CONFIG_MSDOS_FS=m
-# CONFIG_UMSDOS_FS is not set
-CONFIG_VFAT_FS=m
-# CONFIG_EFS_FS is not set
-# CONFIG_JFFS_FS is not set
-CONFIG_JFFS2_FS=y
-CONFIG_JFFS2_FS_DEBUG=0
-CONFIG_CRAMFS=y
-# CONFIG_TMPFS is not set
-CONFIG_RAMFS=y
-# CONFIG_ISO9660_FS is not set
-# CONFIG_JOLIET is not set
-# CONFIG_ZISOFS is not set
-# CONFIG_JFS_FS is not set
-# CONFIG_JFS_DEBUG is not set
-# CONFIG_JFS_STATISTICS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_VXFS_FS is not set
-# CONFIG_NTFS_FS is not set
-# CONFIG_NTFS_RW is not set
-# CONFIG_HPFS_FS is not set
-CONFIG_PROC_FS=y
-CONFIG_DEVFS_FS=y
-CONFIG_DEVFS_MOUNT=y
-# CONFIG_DEVFS_DEBUG is not set
-# CONFIG_DEVPTS_FS is not set
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_QNX4FS_RW is not set
-# CONFIG_ROMFS_FS is not set
-CONFIG_EXT2_FS=m
-# CONFIG_SYSV_FS is not set
-# CONFIG_UDF_FS is not set
-# CONFIG_UDF_RW is not set
-# CONFIG_UFS_FS is not set
-# CONFIG_UFS_FS_WRITE is not set
-# CONFIG_XFS_FS is not set
-# CONFIG_XFS_QUOTA is not set
-# CONFIG_XFS_RT is not set
-# CONFIG_XFS_TRACE is not set
-# CONFIG_XFS_DEBUG is not set
-
-#
-# Network File Systems
-#
-# CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
-CONFIG_NFS_FS=m
-CONFIG_NFS_V3=y
-# CONFIG_NFS_DIRECTIO is not set
-# CONFIG_ROOT_NFS is not set
-# CONFIG_NFSD is not set
-# CONFIG_NFSD_V3 is not set
-# CONFIG_NFSD_TCP is not set
-CONFIG_SUNRPC=m
-CONFIG_LOCKD=m
-CONFIG_LOCKD_V4=y
-# CONFIG_SMB_FS is not set
-# CONFIG_NCP_FS is not set
-# CONFIG_NCPFS_PACKET_SIGNING is not set
-# CONFIG_NCPFS_IOCTL_LOCKING is not set
-# CONFIG_NCPFS_STRONG is not set
-# CONFIG_NCPFS_NFS_NS is not set
-# CONFIG_NCPFS_OS2_NS is not set
-# CONFIG_NCPFS_SMALLDOS is not set
-# CONFIG_NCPFS_NLS is not set
-# CONFIG_NCPFS_EXTRAS is not set
-# CONFIG_ZISOFS_FS is not set
-
-#
-# Partition Types
-#
-CONFIG_PARTITION_ADVANCED=y
-# CONFIG_ACORN_PARTITION is not set
-# CONFIG_OSF_PARTITION is not set
-# CONFIG_AMIGA_PARTITION is not set
-# CONFIG_ATARI_PARTITION is not set
-# CONFIG_MAC_PARTITION is not set
-CONFIG_MSDOS_PARTITION=y
-# CONFIG_BSD_DISKLABEL is not set
-# CONFIG_MINIX_SUBPARTITION is not set
-# CONFIG_SOLARIS_X86_PARTITION is not set
-# CONFIG_UNIXWARE_DISKLABEL is not set
-# CONFIG_LDM_PARTITION is not set
-# CONFIG_SGI_PARTITION is not set
-# CONFIG_ULTRIX_PARTITION is not set
-# CONFIG_SUN_PARTITION is not set
-# CONFIG_EFI_PARTITION is not set
-# CONFIG_SMB_NLS is not set
-CONFIG_NLS=y
-
-#
-# Native Language Support
-#
-CONFIG_NLS_DEFAULT="iso8859-1"
-# CONFIG_NLS_CODEPAGE_437 is not set
-# CONFIG_NLS_CODEPAGE_737 is not set
-# CONFIG_NLS_CODEPAGE_775 is not set
-# CONFIG_NLS_CODEPAGE_850 is not set
-# CONFIG_NLS_CODEPAGE_852 is not set
-# CONFIG_NLS_CODEPAGE_855 is not set
-# CONFIG_NLS_CODEPAGE_857 is not set
-# CONFIG_NLS_CODEPAGE_860 is not set
-# CONFIG_NLS_CODEPAGE_861 is not set
-# CONFIG_NLS_CODEPAGE_862 is not set
-# CONFIG_NLS_CODEPAGE_863 is not set
-# CONFIG_NLS_CODEPAGE_864 is not set
-# CONFIG_NLS_CODEPAGE_865 is not set
-# CONFIG_NLS_CODEPAGE_866 is not set
-# CONFIG_NLS_CODEPAGE_869 is not set
-# CONFIG_NLS_CODEPAGE_936 is not set
-# CONFIG_NLS_CODEPAGE_950 is not set
-# CONFIG_NLS_CODEPAGE_932 is not set
-# CONFIG_NLS_CODEPAGE_949 is not set
-# CONFIG_NLS_CODEPAGE_874 is not set
-# CONFIG_NLS_ISO8859_8 is not set
-# CONFIG_NLS_CODEPAGE_1250 is not set
-# CONFIG_NLS_CODEPAGE_1251 is not set
-# CONFIG_NLS_ISO8859_1 is not set
-# CONFIG_NLS_ISO8859_2 is not set
-# CONFIG_NLS_ISO8859_3 is not set
-# CONFIG_NLS_ISO8859_4 is not set
-# CONFIG_NLS_ISO8859_5 is not set
-# CONFIG_NLS_ISO8859_6 is not set
-# CONFIG_NLS_ISO8859_7 is not set
-# CONFIG_NLS_ISO8859_9 is not set
-# CONFIG_NLS_ISO8859_13 is not set
-# CONFIG_NLS_ISO8859_14 is not set
-# CONFIG_NLS_ISO8859_15 is not set
-# CONFIG_NLS_KOI8_R is not set
-# CONFIG_NLS_KOI8_U is not set
-# CONFIG_NLS_UTF8 is not set
-
-#
-# Multimedia devices
-#
-# CONFIG_VIDEO_DEV is not set
-
-#
-# Sound
-#
-# CONFIG_SOUND is not set
-
-#
-# USB support
-#
-CONFIG_USB=m
-# CONFIG_USB_DEBUG is not set
-
-#
-# Miscellaneous USB options
-#
-CONFIG_USB_DEVICEFS=y
-# CONFIG_USB_BANDWIDTH is not set
-
-#
-# USB Host Controller Drivers
-#
-# CONFIG_USB_EHCI_HCD is not set
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-CONFIG_USB_OHCI=m
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_EMI26 is not set
-# CONFIG_USB_BLUETOOTH is not set
-# CONFIG_USB_MIDI is not set
-CONFIG_USB_STORAGE=m
-# CONFIG_USB_STORAGE_DEBUG is not set
-CONFIG_USB_STORAGE_DATAFAB=y
-CONFIG_USB_STORAGE_FREECOM=y
-# CONFIG_USB_STORAGE_ISD200 is not set
-CONFIG_USB_STORAGE_DPCM=y
-CONFIG_USB_STORAGE_HP8200e=y
-CONFIG_USB_STORAGE_SDDR09=y
-CONFIG_USB_STORAGE_SDDR55=y
-CONFIG_USB_STORAGE_JUMPSHOT=y
-# CONFIG_USB_ACM is not set
-CONFIG_USB_PRINTER=m
-
-#
-# USB Human Interface Devices (HID)
-#
-# CONFIG_USB_HID is not set
-
-#
-#     Input core support is needed for USB HID input layer or HIDBP support
-#
-# CONFIG_USB_HIDINPUT is not set
-# CONFIG_USB_HIDDEV is not set
-# CONFIG_USB_KBD is not set
-# CONFIG_USB_MOUSE is not set
-# CONFIG_USB_AIPTEK is not set
-# CONFIG_USB_WACOM is not set
-# CONFIG_USB_KBTAB is not set
-# CONFIG_USB_POWERMATE is not set
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-
-#
-#   Video4Linux support is needed for USB Multimedia device support
-#
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_RTL8150 is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
-# CONFIG_USB_USBNET is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
-#
-# CONFIG_USB_SERIAL is not set
-
-#
-# USB Miscellaneous drivers
-#
-# CONFIG_USB_RIO500 is not set
-# CONFIG_USB_AUERSWALD is not set
-# CONFIG_USB_TIGL is not set
-# CONFIG_USB_BRLVGER is not set
-# CONFIG_USB_LCD is not set
-
-#
-# Support for USB gadgets
-#
-# CONFIG_USB_GADGET is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BLUEZ is not set
-
-#
-# Kernel hacking
-#
-CONFIG_CROSSCOMPILE=y
-# CONFIG_RUNTIME_DEBUG is not set
-# CONFIG_KGDB is not set
-# CONFIG_GDB_CONSOLE is not set
-# CONFIG_DEBUG_INFO is not set
-# CONFIG_MAGIC_SYSRQ is not set
-# CONFIG_MIPS_UNCACHED is not set
-CONFIG_LOG_BUF_SHIFT=0
-
-#
-# Cryptographic options
-#
-# CONFIG_CRYPTO is not set
-
-#
-# Library routines
-#
-# CONFIG_CRC32 is not set
-CONFIG_ZLIB_INFLATE=y
-CONFIG_ZLIB_DEFLATE=y
index d9f0dc8756c4eee123392400e12de08a113a5c74..637bc6597b3b254d1cde0dc2d0e022e7ee2a83a8 100644 (file)
@@ -1,9 +1,75 @@
 include $(TOPDIR)/rules.mk
 
-include ./sed.mk
+#############################################################
+#
+# sed
+#
+#############################################################
+SED_VER:=4.1.2
+SED_SOURCE:=sed-$(SED_VER).tar.gz
+SED_SITE:=ftp://ftp.gnu.org/gnu/sed
+SED_CAT:=zcat
+SED_DIR1:=$(TOOL_BUILD_DIR)/sed-$(SED_VER)
+SED_DIR2:=$(BUILD_DIR)/sed-$(SED_VER)
+SED_BINARY:=sed/sed
+SED_TARGET_BINARY:=bin/sed
+ifeq ($(strip $(BUILD_WITH_LARGEFILE)),true)
+SED_CPPFLAGS=-D_FILE_OFFSET_BITS=64
+endif
+HOST_SED_TARGET=$(shell ./sedcheck.sh)
+
+$(DL_DIR)/$(SED_SOURCE):
+       mkdir -p $(DL_DIR)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(SED_SOURCE) x $(SED_SITE)
+
+#############################################################
+#
+# build sed for use on the host system
+#
+#############################################################
+
+$(SED_DIR1)/.unpacked: $(DL_DIR)/$(SED_SOURCE)
+       mkdir -p $(TOOL_BUILD_DIR)
+       mkdir -p $(STAGING_DIR)/bin;
+       $(SED_CAT) $(DL_DIR)/$(SED_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
+       touch $(SED_DIR1)/.unpacked
+
+$(SED_DIR1)/.configured: $(SED_DIR1)/.unpacked
+       (cd $(SED_DIR1); rm -rf config.cache; \
+               ./configure \
+               --prefix=$(STAGING_DIR) \
+               --prefix=/usr \
+       );
+       touch  $(SED_DIR1)/.configured
+
+$(SED_DIR1)/$(SED_BINARY): $(SED_DIR1)/.configured
+       $(MAKE) -C $(SED_DIR1)
+
+# This stuff is needed to work around GNU make deficiencies
+build-sed-host-binary: $(SED_DIR1)/$(SED_BINARY)
+       @if [ -L $(STAGING_DIR)/$(SED_TARGET_BINARY) ] ; then \
+               rm -f $(STAGING_DIR)/$(SED_TARGET_BINARY); fi;
+       @if [ ! -f $(STAGING_DIR)/$(SED_TARGET_BINARY) -o $(STAGING_DIR)/$(SED_TARGET_BINARY) \
+       -ot $(SED_DIR1)/$(SED_BINARY) ] ; then \
+           set -x; \
+           mkdir -p $(STAGING_DIR)/bin; \
+           $(MAKE) DESTDIR=$(STAGING_DIR) -C $(SED_DIR1) install; \
+           mv $(STAGING_DIR)/usr/bin/sed $(STAGING_DIR)/bin/; \
+           rm -rf $(STAGING_DIR)/share/locale $(STAGING_DIR)/usr/info \
+                   $(STAGING_DIR)/usr/man $(STAGING_DIR)/usr/share/doc; fi
+
+use-sed-host-binary:
+       @if [ -x /usr/bin/sed ]; then SED="/usr/bin/sed"; else \
+           if [ -x /bin/sed ]; then SED="/bin/sed"; fi; fi; \
+           mkdir -p $(STAGING_DIR)/bin; \
+           rm -f $(STAGING_DIR)/$(SED_TARGET_BINARY); \
+           ln -s $$SED $(STAGING_DIR)/$(SED_TARGET_BINARY)
 
 source: 
 prepare: 
 compile: 
-install: host-sed
-clean: host-sed-toolclean
+install: $(HOST_SED_TARGET)
+clean: 
+       rm -rf $(SED_DIR1)
+       rm -f $(STAGING_DIR)/$(SED_TARGET_BINARY)
+
diff --git a/openwrt/toolchain/sed/sed.mk b/openwrt/toolchain/sed/sed.mk
deleted file mode 100644 (file)
index 2dfd205..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-#############################################################
-#
-# sed
-#
-#############################################################
-SED_VER:=4.1.2
-SED_SOURCE:=sed-$(SED_VER).tar.gz
-SED_SITE:=ftp://ftp.gnu.org/gnu/sed
-SED_CAT:=zcat
-SED_DIR1:=$(TOOL_BUILD_DIR)/sed-$(SED_VER)
-SED_DIR2:=$(BUILD_DIR)/sed-$(SED_VER)
-SED_BINARY:=sed/sed
-SED_TARGET_BINARY:=bin/sed
-ifeq ($(strip $(BUILD_WITH_LARGEFILE)),true)
-SED_CPPFLAGS=-D_FILE_OFFSET_BITS=64
-endif
-HOST_SED_TARGET=$(shell ./sedcheck.sh)
-
-$(DL_DIR)/$(SED_SOURCE):
-       mkdir -p $(DL_DIR)
-       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(SED_SOURCE) x $(SED_SITE)
-
-sed-source: $(DL_DIR)/$(SED_SOURCE)
-
-
-#############################################################
-#
-# build sed for use on the host system
-#
-#############################################################
-$(SED_DIR1)/.unpacked: $(DL_DIR)/$(SED_SOURCE)
-       mkdir -p $(TOOL_BUILD_DIR)
-       mkdir -p $(STAGING_DIR)/bin;
-       $(SED_CAT) $(DL_DIR)/$(SED_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
-       touch $(SED_DIR1)/.unpacked
-
-$(SED_DIR1)/.configured: $(SED_DIR1)/.unpacked
-       (cd $(SED_DIR1); rm -rf config.cache; \
-               ./configure \
-               --prefix=$(STAGING_DIR) \
-               --prefix=/usr \
-       );
-       touch  $(SED_DIR1)/.configured
-
-$(SED_DIR1)/$(SED_BINARY): $(SED_DIR1)/.configured
-       $(MAKE) -C $(SED_DIR1)
-
-# This stuff is needed to work around GNU make deficiencies
-build-sed-host-binary: $(SED_DIR1)/$(SED_BINARY)
-       @if [ -L $(STAGING_DIR)/$(SED_TARGET_BINARY) ] ; then \
-               rm -f $(STAGING_DIR)/$(SED_TARGET_BINARY); fi;
-       @if [ ! -f $(STAGING_DIR)/$(SED_TARGET_BINARY) -o $(STAGING_DIR)/$(SED_TARGET_BINARY) \
-       -ot $(SED_DIR1)/$(SED_BINARY) ] ; then \
-           set -x; \
-           mkdir -p $(STAGING_DIR)/bin; \
-           $(MAKE) DESTDIR=$(STAGING_DIR) -C $(SED_DIR1) install; \
-           mv $(STAGING_DIR)/usr/bin/sed $(STAGING_DIR)/bin/; \
-           rm -rf $(STAGING_DIR)/share/locale $(STAGING_DIR)/usr/info \
-                   $(STAGING_DIR)/usr/man $(STAGING_DIR)/usr/share/doc; fi
-
-use-sed-host-binary:
-       @if [ -x /usr/bin/sed ]; then SED="/usr/bin/sed"; else \
-           if [ -x /bin/sed ]; then SED="/bin/sed"; fi; fi; \
-           mkdir -p $(STAGING_DIR)/bin; \
-           rm -f $(STAGING_DIR)/$(SED_TARGET_BINARY); \
-           ln -s $$SED $(STAGING_DIR)/$(SED_TARGET_BINARY)
-
-host-sed: $(HOST_SED_TARGET)
-
-host-sed-clean:
-       -$(MAKE) -C $(SED_DIR1) clean
-
-host-sed-toolclean:
-       rm -rf $(SED_DIR1)
-       rm -f $(STAGING_DIR)/$(SED_TARGET_BINARY)
index 09453bff3e5f351fa6d2ceb1ba87a4d6ede94560..4b016c951f7af5d7d6a003dc86a89599e60fcdf3 100644 (file)
@@ -16,11 +16,3 @@ config BR2_USE_UCLIBC_SNAPSHOT
        default "snapshot"
        depends on BR2_UCLIBC_VERSION_SNAPSHOT
 
-config BR2_ENABLE_LOCALE
-       bool
-       prompt "Enable locale/gettext/i18n support?" if CONFIG_DEVEL
-       default n
-       help
-           Enable locale/gettext/i18n support?
-
-
index 301c78d41932f460639a2dcbacff2ca22b21f79e..e5f8d44f0424e9738e22eb4351bf1608ee284a7e 100644 (file)
 include $(TOPDIR)/rules.mk
 
-include ./uclibc.mk
+#############################################################
+#
+# uClibc (the C library)
+#
+#############################################################
 
-source: uclibc-source
-prepare: uclibc-configured
+ifeq ($(BR2_UCLIBC_VERSION_SNAPSHOT),y)
+# Be aware that this changes daily....
+UCLIBC_DIR:=$(TOOL_BUILD_DIR)/uClibc
+UCLIBC_SOURCE:=uClibc-$(strip $(subst ",, $(BR2_USE_UCLIBC_SNAPSHOT))).tar.bz2
+#"
+UCLIBC_SITE:=http://www.uclibc.org/downloads/snapshots
+UCLIBC_VER:=PKG_VERSION:=0.${shell date +"%G%m%d"}
+else
+UCLIBC_VER:=0.9.27
+UCLIBC_DIR:=$(TOOL_BUILD_DIR)/uClibc-$(UCLIBC_VER)
+UCLIBC_SOURCE:=uClibc-$(UCLIBC_VER).tar.bz2
+UCLIBC_SITE:=http://www.uclibc.org/downloads
+endif
+
+UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \
+               -e 's/i.86/i386/' \
+               -e 's/sparc.*/sparc/' \
+               -e 's/arm.*/arm/g' \
+               -e 's/m68k.*/m68k/' \
+               -e 's/ppc/powerpc/g' \
+               -e 's/v850.*/v850/g' \
+               -e 's/sh64/sh/' \
+               -e 's/sh[234].*/sh/' \
+               -e 's/mips.*/mips/' \
+               -e 's/mipsel.*/mips/' \
+               -e 's/cris.*/cris/' \
+)
+
+
+$(DL_DIR)/$(UCLIBC_SOURCE):
+       mkdir -p $(DL_DIR)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(UCLIBC_SOURCE) x $(UCLIBC_SITE)
+
+$(UCLIBC_DIR)/.unpacked: $(DL_DIR)/$(UCLIBC_SOURCE)
+       mkdir -p $(TOOL_BUILD_DIR)
+       bzcat $(DL_DIR)/$(UCLIBC_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
+       $(PATCH) $(UCLIBC_DIR) ./patches
+       touch $(UCLIBC_DIR)/.unpacked
+
+$(UCLIBC_DIR)/.configured: $(UCLIBC_DIR)/.unpacked
+       $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(UCLIBC_DIR)/Rules.mak
+       cp ./files/config.$(UCLIBC_TARGET_ARCH) $(UCLIBC_DIR)/.config
+       $(SED) 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE=\"$(LINUX_HEADERS_DIR)\",g' \
+               $(UCLIBC_DIR)/.config
+ifeq ($(BR2_LARGEFILE),y)
+       $(SED) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=y,g' $(UCLIBC_DIR)/.config
+else
+       $(SED) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=n,g' $(UCLIBC_DIR)/.config
+endif
+       $(SED) 's,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g' $(UCLIBC_DIR)/.config
+ifeq ($(BR2_SOFT_FLOAT),y)
+       $(SED) 's,.*HAS_FPU.*,HAS_FPU=n\nUCLIBC_HAS_FLOATS=y\nUCLIBC_HAS_SOFT_FLOAT=y,g' $(UCLIBC_DIR)/.config
+endif
+       mkdir -p $(TOOL_BUILD_DIR)/uClibc_dev/usr/include
+       mkdir -p $(TOOL_BUILD_DIR)/uClibc_dev/usr/lib
+       mkdir -p $(TOOL_BUILD_DIR)/uClibc_dev/lib
+       $(MAKE1) -C $(UCLIBC_DIR) \
+               PREFIX=$(TOOL_BUILD_DIR)/uClibc_dev/ \
+               DEVEL_PREFIX=/usr/ \
+               RUNTIME_PREFIX=$(TOOL_BUILD_DIR)/uClibc_dev/ \
+               HOSTCC="$(HOSTCC)" \
+               CPU_CFLAGS="$(TARGET_CFLAGS)" \
+               pregen install_dev;
+       touch $(UCLIBC_DIR)/.configured
+
+$(UCLIBC_DIR)/lib/libc.a: $(UCLIBC_DIR)/.configured $(LIBFLOAT_TARGET)
+       $(MAKE1) -C $(UCLIBC_DIR) \
+               PREFIX= \
+               DEVEL_PREFIX=/ \
+               RUNTIME_PREFIX=/ \
+               HOSTCC="$(HOSTCC)" \
+               CPU_CFLAGS="$(TARGET_CFLAGS)" \
+               all
+       touch -c $(UCLIBC_DIR)/lib/libc.a
+
+$(STAGING_DIR)/lib/libc.a: $(UCLIBC_DIR)/lib/libc.a
+       $(MAKE1) -C $(UCLIBC_DIR) \
+               PREFIX=$(STAGING_DIR)/ \
+               DEVEL_PREFIX=/ \
+               RUNTIME_PREFIX=/ \
+               install_runtime
+       $(MAKE1) -C $(UCLIBC_DIR) \
+               PREFIX=$(STAGING_DIR)/ \
+               DEVEL_PREFIX=/ \
+               RUNTIME_PREFIX=/ \
+               install_dev
+       echo $(UCLIBC_VER) > $(STAGING_DIR)/uclibc_version
+       touch -c $(STAGING_DIR)/lib/libc.a
+
+source: $(DL_DIR)/$(UCLIBC_SOURCE)
+prepare: $(UCLIBC_DIR)/.configured
 compile: $(UCLIBC_DIR)/lib/libc.a
-install: uclibc
-       rm -rf $(TARGET_DIR)/lib/libpthread*.so*
-       $(STRIP) $(TARGET_DIR)/lib/*.so
-clean: uclibc-toolclean
+install: $(STAGING_DIR)/lib/libc.a $(UCLIBC_TARGETS)
+clean: 
+       rm -rf $(UCLIBC_DIR) $(TOOL_BUILD_DIR)/uClibc_dev
diff --git a/openwrt/toolchain/uClibc/files/config.mips b/openwrt/toolchain/uClibc/files/config.mips
new file mode 100644 (file)
index 0000000..32859af
--- /dev/null
@@ -0,0 +1,155 @@
+#
+# Automatically generated make config: don't edit
+#
+# TARGET_alpha is not set
+# TARGET_arm is not set
+# TARGET_bfin is not set
+# TARGET_cris is not set
+# TARGET_e1 is not set
+# TARGET_frv is not set
+# TARGET_h8300 is not set
+# TARGET_i386 is not set
+# TARGET_i960 is not set
+# TARGET_m68k is not set
+# TARGET_microblaze is not set
+TARGET_mips=y
+# TARGET_nios is not set
+# TARGET_nios2 is not set
+# TARGET_powerpc is not set
+# TARGET_sh is not set
+# TARGET_sparc is not set
+# TARGET_v850 is not set
+
+#
+# Target Architecture Features and Options
+#
+HAVE_ELF=y
+ARCH_SUPPORTS_LITTLE_ENDIAN=y
+TARGET_ARCH="mips"
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_SUPPORTS_BIG_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+CONFIG_MIPS_ISA_MIPS32=y
+# CONFIG_MIPS_ISA_MIPS64 is not set
+ARCH_LITTLE_ENDIAN=y
+# ARCH_BIG_ENDIAN is not set
+# ARCH_HAS_NO_MMU is not set
+ARCH_HAS_MMU=y
+UCLIBC_HAS_FLOATS=y
+HAS_FPU=y
+DO_C99_MATH=y
+WARNINGS="-Wall"
+KERNEL_SOURCE="./toolchain_build_mipsel/linux"
+C_SYMBOL_PREFIX=""
+HAVE_DOT_CONFIG=y
+
+#
+# General Library Settings
+#
+# HAVE_NO_PIC is not set
+DOPIC=y
+# HAVE_NO_SHARED is not set
+HAVE_SHARED=y
+# ARCH_HAS_NO_LDSO is not set
+BUILD_UCLIBC_LDSO=y
+# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
+LDSO_LDD_SUPPORT=y
+LDSO_CACHE_SUPPORT=y
+# LDSO_PRELOAD_FILE_SUPPORT is not set
+LDSO_BASE_FILENAME="ld.so"
+UCLIBC_CTOR_DTOR=y
+# HAS_NO_THREADS is not set
+UCLIBC_HAS_THREADS=y
+# PTHREADS_DEBUG_SUPPORT is not set
+UCLIBC_HAS_LFS=y
+# MALLOC is not set
+# MALLOC_SIMPLE is not set
+MALLOC_STANDARD=y
+MALLOC_GLIBC_COMPAT=y
+UCLIBC_DYNAMIC_ATEXIT=y
+HAS_SHADOW=y
+# UNIX98PTY_ONLY is not set
+ASSUME_DEVPTS=y
+UCLIBC_HAS_TM_EXTENSIONS=y
+UCLIBC_HAS_TZ_CACHING=y
+UCLIBC_HAS_TZ_FILE=y
+UCLIBC_HAS_TZ_FILE_READ_MANY=y
+UCLIBC_TZ_FILE_PATH="/etc/TZ"
+
+#
+# Networking Support
+#
+UCLIBC_HAS_IPV6=y
+UCLIBC_HAS_RPC=y
+UCLIBC_HAS_FULL_RPC=y
+
+#
+# String and Stdio Support
+#
+UCLIBC_HAS_STRING_GENERIC_OPT=y
+UCLIBC_HAS_STRING_ARCH_OPT=y
+UCLIBC_HAS_CTYPE_TABLES=y
+UCLIBC_HAS_CTYPE_SIGNED=y
+# UCLIBC_HAS_CTYPE_UNSAFE is not set
+UCLIBC_HAS_CTYPE_CHECKED=y
+# UCLIBC_HAS_CTYPE_ENFORCED is not set
+UCLIBC_HAS_WCHAR=y
+# UCLIBC_HAS_LOCALE is not set
+UCLIBC_HAS_HEXADECIMAL_FLOATS=y
+UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
+UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
+UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
+# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
+UCLIBC_HAS_STDIO_BUFSIZ_4096=y
+# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
+UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
+UCLIBC_HAS_STDIO_GETC_MACRO=y
+UCLIBC_HAS_STDIO_PUTC_MACRO=y
+UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
+# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
+UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
+UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
+UCLIBC_HAS_PRINTF_M_SPEC=y
+UCLIBC_HAS_ERRNO_MESSAGES=y
+# UCLIBC_HAS_SYS_ERRLIST is not set
+UCLIBC_HAS_SIGNUM_MESSAGES=y
+# UCLIBC_HAS_SYS_SIGLIST is not set
+UCLIBC_HAS_GNU_GETOPT=y
+
+#
+# Big and Tall
+#
+UCLIBC_HAS_REGEX=y
+# UCLIBC_HAS_WORDEXP is not set
+UCLIBC_HAS_FTW=y
+UCLIBC_HAS_GLOB=y
+
+#
+# Library Installation Options
+#
+SHARED_LIB_LOADER_PREFIX="/lib"
+RUNTIME_PREFIX="/"
+DEVEL_PREFIX="/usr/"
+
+#
+# uClibc security related options
+#
+# UCLIBC_SECURITY is not set
+
+#
+# uClibc development/debugging options
+#
+# DODEBUG is not set
+# DOASSERTS is not set
+# SUPPORT_LD_DEBUG is not set
+# SUPPORT_LD_DEBUG_EARLY is not set
+# UCLIBC_MJN3_ONLY is not set
diff --git a/openwrt/toolchain/uClibc/uClibc.config b/openwrt/toolchain/uClibc/uClibc.config
deleted file mode 100644 (file)
index 0d96520..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-#
-# Automatically generated make config: don't edit
-#
-# TARGET_alpha is not set
-# TARGET_arm is not set
-# TARGET_bfin is not set
-# TARGET_cris is not set
-# TARGET_e1 is not set
-# TARGET_frv is not set
-# TARGET_h8300 is not set
-# TARGET_i386 is not set
-# TARGET_i960 is not set
-# TARGET_m68k is not set
-# TARGET_microblaze is not set
-TARGET_mips=y
-# TARGET_nios is not set
-# TARGET_nios2 is not set
-# TARGET_powerpc is not set
-# TARGET_sh is not set
-# TARGET_sparc is not set
-# TARGET_v850 is not set
-
-#
-# Target Architecture Features and Options
-#
-HAVE_ELF=y
-ARCH_SUPPORTS_LITTLE_ENDIAN=y
-TARGET_ARCH="mips"
-ARCH_CFLAGS="-mno-split-addresses"
-ARCH_SUPPORTS_BIG_ENDIAN=y
-# CONFIG_MIPS_ISA_1 is not set
-# CONFIG_MIPS_ISA_2 is not set
-# CONFIG_MIPS_ISA_3 is not set
-# CONFIG_MIPS_ISA_4 is not set
-CONFIG_MIPS_ISA_MIPS32=y
-# CONFIG_MIPS_ISA_MIPS64 is not set
-ARCH_LITTLE_ENDIAN=y
-# ARCH_BIG_ENDIAN is not set
-# ARCH_HAS_NO_MMU is not set
-ARCH_HAS_MMU=y
-UCLIBC_HAS_FLOATS=y
-HAS_FPU=y
-DO_C99_MATH=y
-WARNINGS="-Wall"
-KERNEL_SOURCE="/home/wbx/DIPLOM/experimental/buildroot/toolchain_build_mipsel/linux"
-C_SYMBOL_PREFIX=""
-HAVE_DOT_CONFIG=y
-
-#
-# General Library Settings
-#
-# HAVE_NO_PIC is not set
-DOPIC=y
-# HAVE_NO_SHARED is not set
-HAVE_SHARED=y
-# ARCH_HAS_NO_LDSO is not set
-BUILD_UCLIBC_LDSO=y
-# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
-LDSO_LDD_SUPPORT=y
-LDSO_CACHE_SUPPORT=y
-# LDSO_PRELOAD_FILE_SUPPORT is not set
-LDSO_BASE_FILENAME="ld.so"
-UCLIBC_CTOR_DTOR=y
-# HAS_NO_THREADS is not set
-UCLIBC_HAS_THREADS=y
-# PTHREADS_DEBUG_SUPPORT is not set
-UCLIBC_HAS_LFS=y
-# MALLOC is not set
-# MALLOC_SIMPLE is not set
-MALLOC_STANDARD=y
-MALLOC_GLIBC_COMPAT=y
-UCLIBC_DYNAMIC_ATEXIT=y
-HAS_SHADOW=y
-# UNIX98PTY_ONLY is not set
-ASSUME_DEVPTS=y
-UCLIBC_HAS_TM_EXTENSIONS=y
-UCLIBC_HAS_TZ_CACHING=y
-UCLIBC_HAS_TZ_FILE=y
-UCLIBC_HAS_TZ_FILE_READ_MANY=y
-UCLIBC_TZ_FILE_PATH="/etc/TZ"
-
-#
-# Networking Support
-#
-UCLIBC_HAS_IPV6=y
-UCLIBC_HAS_RPC=y
-UCLIBC_HAS_FULL_RPC=y
-
-#
-# String and Stdio Support
-#
-UCLIBC_HAS_STRING_GENERIC_OPT=y
-UCLIBC_HAS_STRING_ARCH_OPT=y
-UCLIBC_HAS_CTYPE_TABLES=y
-UCLIBC_HAS_CTYPE_SIGNED=y
-# UCLIBC_HAS_CTYPE_UNSAFE is not set
-UCLIBC_HAS_CTYPE_CHECKED=y
-# UCLIBC_HAS_CTYPE_ENFORCED is not set
-UCLIBC_HAS_WCHAR=y
-# UCLIBC_HAS_LOCALE is not set
-UCLIBC_HAS_HEXADECIMAL_FLOATS=y
-UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
-UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
-UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
-# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
-UCLIBC_HAS_STDIO_BUFSIZ_4096=y
-# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
-UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
-UCLIBC_HAS_STDIO_GETC_MACRO=y
-UCLIBC_HAS_STDIO_PUTC_MACRO=y
-UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
-# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
-UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
-UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
-UCLIBC_HAS_PRINTF_M_SPEC=y
-UCLIBC_HAS_ERRNO_MESSAGES=y
-# UCLIBC_HAS_SYS_ERRLIST is not set
-UCLIBC_HAS_SIGNUM_MESSAGES=y
-# UCLIBC_HAS_SYS_SIGLIST is not set
-UCLIBC_HAS_GNU_GETOPT=y
-
-#
-# Big and Tall
-#
-UCLIBC_HAS_REGEX=y
-# UCLIBC_HAS_WORDEXP is not set
-UCLIBC_HAS_FTW=y
-UCLIBC_HAS_GLOB=y
-
-#
-# Library Installation Options
-#
-SHARED_LIB_LOADER_PREFIX="/lib"
-RUNTIME_PREFIX="/"
-DEVEL_PREFIX="/usr/"
-
-#
-# uClibc security related options
-#
-# UCLIBC_SECURITY is not set
-
-#
-# uClibc development/debugging options
-#
-# DODEBUG is not set
-# DOASSERTS is not set
-# SUPPORT_LD_DEBUG is not set
-# SUPPORT_LD_DEBUG_EARLY is not set
-# UCLIBC_MJN3_ONLY is not set
diff --git a/openwrt/toolchain/uClibc/uClibc.config-locale b/openwrt/toolchain/uClibc/uClibc.config-locale
deleted file mode 100644 (file)
index 95a4983..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-#
-# Automatically generated make config: don't edit
-#
-# TARGET_alpha is not set
-# TARGET_arm is not set
-# TARGET_bfin is not set
-# TARGET_cris is not set
-# TARGET_e1 is not set
-# TARGET_frv is not set
-# TARGET_h8300 is not set
-# TARGET_i386 is not set
-# TARGET_i960 is not set
-# TARGET_m68k is not set
-# TARGET_microblaze is not set
-# TARGET_mips is not set
-# TARGET_nios is not set
-# TARGET_nios2 is not set
-# TARGET_powerpc is not set
-# TARGET_sh is not set
-# TARGET_sparc is not set
-# TARGET_v850 is not set
-
-#
-# Target Architecture Features and Options
-#
-HAVE_ELF=y
-TARGET_ARCH="none"
-# ARCH_HAS_NO_MMU is not set
-UCLIBC_HAS_FLOATS=y
-HAS_FPU=y
-DO_C99_MATH=y
-WARNINGS="-Wall"
-KERNEL_SOURCE="/usr/src/linux"
-HAVE_DOT_CONFIG=y
-
-#
-# General Library Settings
-#
-# HAVE_NO_PIC is not set
-DOPIC=y
-HAVE_SHARED=y
-BUILD_UCLIBC_LDSO=y
-# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
-LDSO_LDD_SUPPORT=y
-UCLIBC_CTOR_DTOR=y
-# UCLIBC_PROPOLICE is not set
-# UCLIBC_PROFILING is not set
-UCLIBC_HAS_THREADS=y
-PTHREADS_DEBUG_SUPPORT=y
-UCLIBC_HAS_LFS=y
-# MALLOC is not set
-# MALLOC_SIMPLE is not set
-MALLOC_STANDARD=y
-MALLOC_GLIBC_COMPAT=y
-UCLIBC_DYNAMIC_ATEXIT=y
-HAS_SHADOW=y
-# UNIX98PTY_ONLY is not set
-ASSUME_DEVPTS=y
-UCLIBC_HAS_TM_EXTENSIONS=y
-UCLIBC_HAS_TZ_CACHING=y
-UCLIBC_HAS_TZ_FILE=y
-UCLIBC_HAS_TZ_FILE_READ_MANY=y
-UCLIBC_TZ_FILE_PATH="/etc/TZ"
-
-#
-# Networking Support
-#
-UCLIBC_HAS_IPV6=y
-UCLIBC_HAS_RPC=y
-UCLIBC_HAS_FULL_RPC=y
-
-#
-# String and Stdio Support
-#
-UCLIBC_HAS_CTYPE_TABLES=y
-UCLIBC_HAS_CTYPE_SIGNED=y
-# UCLIBC_HAS_CTYPE_UNSAFE is not set
-UCLIBC_HAS_CTYPE_CHECKED=y
-# UCLIBC_HAS_CTYPE_ENFORCED is not set
-UCLIBC_HAS_WCHAR=y
-UCLIBC_HAS_LOCALE=y
-UCLIBC_PREGENERATED_LOCALE_DATA=y
-UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA=y
-UCLIBC_HAS_XLOCALE=y
-UCLIBC_HAS_HEXADECIMAL_FLOATS=y
-UCLIBC_HAS_GLIBC_DIGIT_GROUPING=y
-UCLIBC_HAS_SCANF_LENIENT_DIGIT_GROUPING=y
-UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
-UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
-UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
-# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
-UCLIBC_HAS_STDIO_BUFSIZ_4096=y
-# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
-UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
-UCLIBC_HAS_STDIO_GETC_MACRO=y
-UCLIBC_HAS_STDIO_PUTC_MACRO=y
-UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
-# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
-UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
-UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
-UCLIBC_HAS_PRINTF_M_SPEC=y
-UCLIBC_HAS_ERRNO_MESSAGES=y
-# UCLIBC_HAS_SYS_ERRLIST is not set
-UCLIBC_HAS_SIGNUM_MESSAGES=y
-# UCLIBC_HAS_SYS_SIGLIST is not set
-UCLIBC_HAS_GETTEXT_AWARENESS=y
-UCLIBC_HAS_GNU_GETOPT=y
-
-#
-# Big and Tall
-#
-UCLIBC_HAS_REGEX=y
-UCLIBC_HAS_WORDEXP=y
-UCLIBC_HAS_FTW=y
-UCLIBC_HAS_GLOB=y
-
-#
-# Library Installation Options
-#
-SHARED_LIB_LOADER_PREFIX="/lib"
-RUNTIME_PREFIX="/"
-DEVEL_PREFIX="/usr/"
-
-#
-# uClibc security related options
-#
-# UCLIBC_SECURITY is not set
-
-#
-# uClibc development/debugging options
-#
-# DODEBUG is not set
-# DOASSERTS is not set
-# SUPPORT_LD_DEBUG is not set
-# SUPPORT_LD_DEBUG_EARLY is not set
-# UCLIBC_MJN3_ONLY is not set
diff --git a/openwrt/toolchain/uClibc/uclibc.mk b/openwrt/toolchain/uClibc/uclibc.mk
deleted file mode 100644 (file)
index f801f3d..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-#############################################################
-#
-# uClibc (the C library)
-#
-#############################################################
-
-ifeq ($(BR2_UCLIBC_VERSION_SNAPSHOT),y)
-# Be aware that this changes daily....
-UCLIBC_DIR:=$(TOOL_BUILD_DIR)/uClibc
-UCLIBC_SOURCE:=uClibc-$(strip $(subst ",, $(BR2_USE_UCLIBC_SNAPSHOT))).tar.bz2
-#"
-UCLIBC_SITE:=http://www.uclibc.org/downloads/snapshots
-else
-UCLIBC_DIR:=$(TOOL_BUILD_DIR)/uClibc-0.9.27
-UCLIBC_SOURCE:=uClibc-0.9.27.tar.bz2
-UCLIBC_SITE:=http://www.uclibc.org/downloads
-endif
-
-UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \
-               -e 's/i.86/i386/' \
-               -e 's/sparc.*/sparc/' \
-               -e 's/arm.*/arm/g' \
-               -e 's/m68k.*/m68k/' \
-               -e 's/ppc/powerpc/g' \
-               -e 's/v850.*/v850/g' \
-               -e 's/sh64/sh/' \
-               -e 's/sh[234].*/sh/' \
-               -e 's/mips.*/mips/' \
-               -e 's/mipsel.*/mips/' \
-               -e 's/cris.*/cris/' \
-)
-
-
-$(DL_DIR)/$(UCLIBC_SOURCE):
-       mkdir -p $(DL_DIR)
-       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(UCLIBC_SOURCE) x $(UCLIBC_SITE)
-
-$(UCLIBC_DIR)/.unpacked: $(DL_DIR)/$(UCLIBC_SOURCE)
-       mkdir -p $(TOOL_BUILD_DIR)
-       bzcat $(DL_DIR)/$(UCLIBC_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
-       $(PATCH) $(UCLIBC_DIR) ./patches
-       touch $(UCLIBC_DIR)/.unpacked
-
-$(UCLIBC_DIR)/.configured: $(UCLIBC_DIR)/.unpacked
-       $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(UCLIBC_DIR)/Rules.mak
-ifeq ($(BR2_ENABLE_LOCALE),y)
-       cp ./uClibc.config-locale $(UCLIBC_DIR)/.config
-else
-       cp ./uClibc.config $(UCLIBC_DIR)/.config
-endif
-       $(SED) 's,^.*TARGET_$(UCLIBC_TARGET_ARCH).*,TARGET_$(UCLIBC_TARGET_ARCH)=y,g' \
-               $(UCLIBC_DIR)/.config
-       $(SED) 's,^TARGET_ARCH.*,TARGET_ARCH=\"$(UCLIBC_TARGET_ARCH)\",g' $(UCLIBC_DIR)/.config
-       $(SED) 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE=\"$(LINUX_HEADERS_DIR)\",g' \
-               $(UCLIBC_DIR)/.config
-       $(SED) 's,^RUNTIME_PREFIX=.*,RUNTIME_PREFIX=\"/\",g' \
-               $(UCLIBC_DIR)/.config
-       $(SED) 's,^DEVEL_PREFIX=.*,DEVEL_PREFIX=\"/usr/\",g' \
-               $(UCLIBC_DIR)/.config
-       $(SED) 's,^SHARED_LIB_LOADER_PREFIX=.*,SHARED_LIB_LOADER_PREFIX=\"/lib\",g' \
-               $(UCLIBC_DIR)/.config
-ifeq ($(BR2_LARGEFILE),y)
-       $(SED) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=y,g' $(UCLIBC_DIR)/.config
-else
-       $(SED) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=n,g' $(UCLIBC_DIR)/.config
-endif
-       $(SED) 's,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g' $(UCLIBC_DIR)/.config
-ifeq ($(BR2_SOFT_FLOAT),y)
-       $(SED) 's,.*HAS_FPU.*,HAS_FPU=n\nUCLIBC_HAS_FLOATS=y\nUCLIBC_HAS_SOFT_FLOAT=y,g' $(UCLIBC_DIR)/.config
-endif
-       mkdir -p $(TOOL_BUILD_DIR)/uClibc_dev/usr/include
-       mkdir -p $(TOOL_BUILD_DIR)/uClibc_dev/usr/lib
-       mkdir -p $(TOOL_BUILD_DIR)/uClibc_dev/lib
-       $(MAKE1) -C $(UCLIBC_DIR) \
-               PREFIX=$(TOOL_BUILD_DIR)/uClibc_dev/ \
-               DEVEL_PREFIX=/usr/ \
-               RUNTIME_PREFIX=$(TOOL_BUILD_DIR)/uClibc_dev/ \
-               HOSTCC="$(HOSTCC)" \
-               pregen install_dev;
-       touch $(UCLIBC_DIR)/.configured
-
-$(UCLIBC_DIR)/lib/libc.a: $(UCLIBC_DIR)/.configured $(LIBFLOAT_TARGET)
-       $(MAKE1) -C $(UCLIBC_DIR) \
-               PREFIX= \
-               DEVEL_PREFIX=/ \
-               RUNTIME_PREFIX=/ \
-               HOSTCC="$(HOSTCC)" \
-               all
-       touch -c $(UCLIBC_DIR)/lib/libc.a
-
-$(STAGING_DIR)/lib/libc.a: $(UCLIBC_DIR)/lib/libc.a
-       $(MAKE1) -C $(UCLIBC_DIR) \
-               PREFIX=$(STAGING_DIR)/ \
-               DEVEL_PREFIX=/ \
-               RUNTIME_PREFIX=/ \
-               install_runtime
-       $(MAKE1) -C $(UCLIBC_DIR) \
-               PREFIX=$(STAGING_DIR)/ \
-               DEVEL_PREFIX=/ \
-               RUNTIME_PREFIX=/ \
-               install_dev
-       # Build the host utils.  Need to add an install target... - disabled
-#      $(MAKE1) -C $(UCLIBC_DIR)/utils \
-#              PREFIX=$(STAGING_DIR) \
-#              HOSTCC="$(HOSTCC)" \
-#              hostutils
-       touch -c $(STAGING_DIR)/lib/libc.a
-
-ifneq ($(TARGET_DIR),)
-$(TARGET_DIR)/lib/libc.so.0: $(STAGING_DIR)/lib/libc.a
-       $(MAKE1) -C $(UCLIBC_DIR) \
-               PREFIX=$(TARGET_DIR) \
-               DEVEL_PREFIX=/usr/ \
-               RUNTIME_PREFIX=/ \
-               install_runtime
-       touch -c $(TARGET_DIR)/lib/libc.so.0
-
-$(TARGET_DIR)/usr/bin/ldd:
-       $(MAKE1) -C $(UCLIBC_DIR) $(TARGET_CONFIGURE_OPTS) \
-               PREFIX=$(TARGET_DIR) utils install_utils
-       touch -c $(TARGET_DIR)/usr/bin/ldd
-
-UCLIBC_TARGETS=$(TARGET_DIR)/lib/libc.so.0
-endif
-
-uclibc-configured: $(UCLIBC_DIR)/.configured
-
-uclibc: $(STAGING_DIR)/lib/libc.a \
-       $(UCLIBC_TARGETS)
-
-uclibc-source: $(DL_DIR)/$(UCLIBC_SOURCE)
-
-uclibc-configured-source: uclibc-source
-
-uclibc-clean:
-       -$(MAKE1) -C $(UCLIBC_DIR) clean
-       rm -f $(UCLIBC_DIR)/.config
-
-uclibc-toolclean:
-       rm -rf $(UCLIBC_DIR)
-
-uclibc-target-utils: $(TARGET_DIR)/usr/bin/ldd
-
-#############################################################
-#
-# uClibc for the target just needs its header files
-# and whatnot installed.
-#
-#############################################################
-
-$(TARGET_DIR)/usr/lib/libc.a: $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libc.a
-       $(MAKE1) -C $(UCLIBC_DIR) \
-               PREFIX=$(TARGET_DIR) \
-               DEVEL_PREFIX=/usr/ \
-               RUNTIME_PREFIX=/ \
-               install_dev
-       touch -c $(TARGET_DIR)/usr/lib/libc.a
-
-uclibc_target: gcc uclibc $(TARGET_DIR)/usr/lib/libc.a $(TARGET_DIR)/usr/bin/ldd
-
-uclibc_target-clean:
-       rm -f $(TARGET_DIR)/include
-
-uclibc_target-dirclean:
-       rm -f $(TARGET_DIR)/include
-
diff --git a/root/bin/firstboot b/root/bin/firstboot
deleted file mode 100755 (executable)
index 5076d1c..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-# $Id$
-
-
-[ -f "/tmp/.firstboot" ] && {
-       echo "firstboot is already running"
-       return
-}
-touch /tmp/.firstboot
-
-jdev=$(mount | awk '/jffs2/ {print $3}')
-
-if [ -z "$jdev" ]; then
-       echo -n "Creating jffs2 partition... "
-       mtd erase OpenWrt >&- 
-       mount -t jffs2 /dev/mtdblock/4 /jffs
-       echo "done"
-       cd /jffs
-else
-       echo "firstboot has already been run"
-       echo "jffs2 partition is mounted, only resetting files"
-       cd $jdev
-fi
-
-exec 2>/dev/null
-
-mount /dev/mtdblock/2 /rom -o ro
-
-echo -n "creating directories... "
-{
-       cd /rom
-       find . -type d
-       cd -
-} | xargs mkdir
-echo "done"
-
-echo -n "setting up symlinks... "
-for file in $(cd /rom; find *  -type f; find *  -type l;)
-do {
-       ln -sf  /rom/$file $file
-} done
-echo "done"
-
-touch /tmp/resolv.conf
-ln -s /tmp/resolv.conf /etc/resolv.conf
-
-umount /rom
-mount none /jffs/proc -t proc
-pivot_root /jffs /jffs/rom
-mount none /dev  -t devfs
-mount none /tmp  -t ramfs
-umount /rom/proc
-umount /rom/tmp
-umount /rom/dev
diff --git a/root/bin/ipkg b/root/bin/ipkg
deleted file mode 100755 (executable)
index bf275d8..0000000
+++ /dev/null
@@ -1,1185 +0,0 @@
-#!/bin/sh
-# ipkg - the itsy package management system
-#
-# Copyright (C) 2001 Carl D. Worth
-#
-# 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, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-set -e
-
-# By default do not do globbing. Any command wanting globbing should
-# explicitly enable it first and disable it afterwards.
-set -o noglob
-
-ipkg_is_upgrade () {
-  local A B a b
-  A=$(echo $1 | sed "s/[0-9]*/ & /g")
-  B=$(echo $2 | sed "s/[0-9]*/ & /g")
-  while [ \! -z "$A" ] && [ \! -z "$B" ]; do {
-    set $A; a=$1; shift; A=$*
-    set $B; b=$1; shift; B=$*
-    { [ "$a" -gt "$b" ] 2>&- || [ "$a" ">" "$b" ]; } && { return 0; }
-  }; done
-  return 1;
-}
-
-ipkg_srcs() {
-       local srcre="$1"
-       sed -ne "s/^src[[:space:]]\+$srcre[[:space:]]\+//p" < $IPKG_CONF
-}
-
-ipkg_src_names() {
-       sed -ne "s/^src[[:space:]]\+\([^[:space:]]\+\).*/\1/p" < $IPKG_CONF
-}
-
-ipkg_src_byname() {
-       local src="$1"
-       ipkg_srcs $src | head -1
-}
-
-ipkg_dests() {
-       local destre="`echo $1 | ipkg_protect_slashes`"
-       sed -ne "/^dest[[:space:]]\+$destre/{
-s/^dest[[:space:]]\+[^[:space:]]\+[[:space:]]\+//
-s/^/`echo $IPKG_OFFLINE_ROOT | ipkg_protect_slashes`/
-p
-}" < $IPKG_CONF
-}
-
-ipkg_dest_names() {
-       sed -ne "s/^dest[[:space:]]\+\([^[:space:]]\+\).*/\1/p" < $IPKG_CONF
-}
-
-ipkg_dests_all() {
-       ipkg_dests '.*'
-}
-
-ipkg_state_dirs() {
-       ipkg_dests_all | sed "s|\$|/$IPKG_DIR_PREFIX|"
-}
-
-ipkg_dest_default() {
-       ipkg_dests_all | head -1
-}
-
-ipkg_dest_default_name() {
-       ipkg_dest_names | head -1
-}
-
-ipkg_dest_byname() {
-       local dest="$1"
-       ipkg_dests $dest | head -1
-}
-
-ipkg_option() {
-       local option="$1"
-       sed -ne "s/^option[[:space:]]\+$option[[:space:]]\+//p" < $IPKG_CONF
-}
-
-ipkg_load_configuration() {
-       if [ -z "$IPKG_CONF_DIR" ]; then
-               IPKG_CONF_DIR=/etc
-       fi
-
-       IPKG_CONF="$IPKG_CONF_DIR/ipkg.conf"
-
-       if [ -z "$IPKG_OFFLINE_ROOT" ]; then
-           IPKG_OFFLINE_ROOT="`ipkg_option offline_root`"
-       fi
-       # Export IPKG_OFFLINE_ROOT for use by update-alternatives
-       export IPKG_OFFLINE_ROOT
-       if [ -n "$DEST_NAME" ]; then
-               IPKG_ROOT="`ipkg_dest_byname $DEST_NAME`"
-               if [ -z "$IPKG_ROOT" ]; then
-                       if [ -d "$IPKG_OFFLINE_ROOT$DEST_NAME" ]; then
-                               IPKG_ROOT="$IPKG_OFFLINE_ROOT$DEST_NAME";
-                       else
-                               echo "ipkg: invalid destination specification: $DEST_NAME
-Valid destinations are directories or one of the dest names from $IPKG_CONF:" >&2
-                               ipkg_dest_names >&2
-                               return 1
-                       fi
-               fi
-       else
-               IPKG_ROOT="`ipkg_dest_default`"
-       fi
-
-       # Global ipkg state directories
-       IPKG_DIR_PREFIX=usr/lib/ipkg
-       IPKG_LISTS_DIR=$IPKG_OFFLINE_ROOT/$IPKG_DIR_PREFIX/lists
-       IPKG_PENDING_DIR=$IPKG_OFFLINE_ROOT/$IPKG_DIR_PREFIX/pending
-       IPKG_TMP=$IPKG_ROOT/tmp/ipkg
-
-       # Destination specific ipkg meta-data directory
-       IPKG_STATE_DIR=$IPKG_ROOT/$IPKG_DIR_PREFIX
-
-       # Proxy Support
-       IPKG_PROXY_USERNAME="`ipkg_option proxy_username`"
-       IPKG_PROXY_PASSWORD="`ipkg_option proxy_password`"
-       IPKG_HTTP_PROXY="`ipkg_option http_proxy`"
-       IPKG_FTP_PROXY="`ipkg_option ftp_proxy`"
-       IPKG_NO_PROXY="`ipkg_option no_proxy`"
-       if [ -n "$IPKG_HTTP_PROXY" ]; then 
-               export http_proxy="$IPKG_HTTP_PROXY"
-       fi
-
-       if [ -n "$IPKG_FTP_PROXY" ]; then 
-               export ftp_proxy="$IPKG_FTP_PROXY"
-       fi
-
-       if [ -n "$IPKG_NO_PROXY" ]; then 
-               export no_proxy="$IPKG_NO_PROXY"
-       fi
-
-       IPKG_STATUS_FIELDS='\(Package\|Status\|Essential\|Version\|Conffiles\|Root\)'
-}
-
-ipkg_usage() {
-       [ $# -gt 0 ] && echo "ipkg: $*"
-       echo "
-usage: ipkg [options...] sub-command [arguments...]
-where sub-command is one of:
-
-Package Manipulation:
-       update                  Update list of available packages
-       upgrade                 Upgrade all installed packages to latest version
-       install <pkg>           Download and install <pkg> (and dependencies)
-       install <file.ipk>      Install package <file.ipk>
-       install <file.deb>      Install package <file.deb>
-       remove <pkg>            Remove package <pkg>
-
-Informational Commands:
-       list                    List available packages and descriptions
-       files <pkg>             List all files belonging to <pkg>
-       search <file>           Search for a packaging providing <file>
-       info [pkg [<field>]]    Display all/some info fields for <pkg> or all
-       status [pkg [<field>]]  Display all/some status fields for <pkg> or all
-       depends <pkg>           Print uninstalled package dependencies for <pkg>
-
-Options:
-       -d <dest_name>          Use <dest_name> as the the root directory for
-       -dest <dest_name>       package installation, removal, upgrading.
-                               <dest_name> should be a defined dest name from the
-                               configuration file, (but can also be a directory
-                               name in a pinch).
-        -o <offline_root>       Use <offline_root> as the root for offline installation.
-        -offline <offline_root>                                
-
-Force Options (use when ipkg is too smart for its own good):
-       -force-depends          Make dependency checks warnings instead of errors
-       -force-defaults         Use default options for questions asked by ipkg.
-                                (no prompts). Note that this will not prevent
-                                package installation scripts from prompting.
-" >&2
-       exit 1
-}
-
-ipkg_dir_part() {
-       local dir="`echo $1 | sed -ne 's/\(.*\/\).*/\1/p'`"
-       if [ -z "$dir" ]; then
-               dir="./"
-       fi
-       echo $dir
-}
-
-ipkg_file_part() {
-       echo $1 | sed 's/.*\///'
-}
-
-ipkg_protect_slashes() {
-       sed -e 's/\//\\\//g'
-}
-
-ipkg_download() {
-       local src="$1"
-       local dest="$2"
-
-       local src_file="`ipkg_file_part $src`"
-       local dest_dir="`ipkg_dir_part $dest`"
-       if [ -z "$dest_dir" ]; then
-               dest_dir="$IPKG_TMP"
-       fi
-
-       local dest_file="`ipkg_file_part $dest`"
-       if [ -z "$dest_file" ]; then
-               dest_file="$src_file"
-       fi
-
-       # Proxy support
-       local proxyuser=""
-       local proxypassword=""
-       local proxyoption=""
-               
-       if [ -n "$IPKG_PROXY_USERNAME" ]; then
-               proxyuser="--proxy-user=\"$IPKG_PROXY_USERNAME\""
-               proxypassword="--proxy-passwd=\"$IPKG_PROXY_PASSWORD\""
-       fi
-
-       if [ -n "$IPKG_PROXY_HTTP" -o -n "$IPKG_PROXY_FTP" ]; then
-               proxyoption="--proxy=on"
-       fi
-
-       echo "Downloading $src ..."
-       rm -f $IPKG_TMP/$src_file
-       case "$src" in
-       http://* | ftp://*)
-               if ! wget --passive-ftp $proxyoption $proxyuser $proxypassword -P $IPKG_TMP $src; then
-                       echo "ipkg_download: ERROR: Failed to retrieve $src, returning $err"
-                       return 1
-               fi
-               mv $IPKG_TMP/$src_file $dest_dir/$dest_file 2>/dev/null
-               ;;
-       file:/* )
-               ln -s `echo $src | sed 's/^file://'` $dest_dir/$dest_file 2>/dev/null
-               ;;
-       *)
-       echo "DEBUG: $src"
-               ;;
-       esac
-
-       echo "Done."
-       return 0
-}
-
-ipkg_update() {
-       if [ ! -e "$IPKG_LISTS_DIR" ]; then
-               mkdir -p $IPKG_LISTS_DIR
-       fi
-
-       local err=
-       for src_name in `ipkg_src_names`; do
-               local src="`ipkg_src_byname $src_name`"
-               if ! ipkg_download $src/Packages $IPKG_LISTS_DIR/$src_name; then
-                       echo "ipkg_update: Error downloading $src/Packages to $IPKG_LISTS_DIR/$src_name" >&2
-                       err=t
-               else
-                       echo "Updated list of available packages in $IPKG_LISTS_DIR/$src_name"
-               fi
-       done
-
-       [ -n "$err" ] && return 1
-
-       return 0
-}
-
-ipkg_list() {
-       for src in `ipkg_src_names`; do
-               if ipkg_require_list $src; then 
-# black magic...
-sed -ne "
-/^Package:/{
-s/^Package:[[:space:]]*\<\([a-z0-9.+-]*$1[a-z0-9.+-]*\).*/\1/
-h
-}
-/^Description:/{
-s/^Description:[[:space:]]*\(.*\)/\1/
-H
-g
-s/\\
-/ - /
-p
-}
-" $IPKG_LISTS_DIR/$src
-               fi
-       done
-}
-
-ipkg_extract_paragraph() {
-       local pkg="$1"
-       sed -ne "/Package:[[:space:]]*$pkg[[:space:]]*\$/,/^\$/p"
-}
-
-ipkg_extract_field() {
-       local field="$1"
-# blacker magic...
-       sed -ne "
-: TOP
-/^$field:/{
-p
-n
-b FIELD
-}
-d
-: FIELD
-/^$/b TOP
-/^[^[:space:]]/b TOP
-p
-n
-b FIELD
-"
-}
-
-ipkg_extract_value() {
-       sed -e "s/^[^:]*:[[:space:]]*//"
-}
-
-ipkg_require_list() {
-       [ $# -lt 1 ] && return 1
-       local src="$1"
-       if [ ! -f "$IPKG_LISTS_DIR/$src" ]; then
-               echo "ERROR: File not found: $IPKG_LISTS_DIR/$src" >&2
-               echo "       You probably want to run \`ipkg update'" >&2
-               return 1
-       fi
-       return 0
-}
-
-ipkg_info() {
-       for src in `ipkg_src_names`; do
-               if ipkg_require_list $src; then
-                       case $# in
-                       0)
-                               cat $IPKG_LISTS_DIR/$src
-                               ;;      
-                       1)
-                               ipkg_extract_paragraph $1 < $IPKG_LISTS_DIR/$src
-                               ;;
-                       *)
-                               ipkg_extract_paragraph $1 < $IPKG_LISTS_DIR/$src | ipkg_extract_field $2
-                               ;;
-                       esac
-               fi
-       done
-}
-
-ipkg_status_sd() {
-       [ $# -lt 1 ] && return 0
-       sd="$1"
-       shift
-       if [ -f $sd/status ]; then
-               case $# in
-               0)
-                       cat $sd/status
-                       ;;
-               1)
-                       ipkg_extract_paragraph $1 < $sd/status
-                       ;;
-               *)
-                       ipkg_extract_paragraph $1 < $sd/status | ipkg_extract_field $2
-                       ;;
-               esac
-       fi
-       return 0
-}
-
-ipkg_status_all() {
-       for sd in `ipkg_state_dirs`; do
-               ipkg_status_sd $sd $*
-       done
-}
-
-ipkg_status() {
-       if [ -n "$DEST_NAME" ]; then
-               ipkg_status_sd $IPKG_STATE_DIR $*
-       else
-               ipkg_status_all $*
-       fi
-}
-
-ipkg_status_matching_sd() {
-       local sd="$1"
-       local re="$2"
-       if [ -f $sd/status ]; then
-               sed -ne "
-: TOP
-/^Package:/{
-s/^Package:[[:space:]]*//
-s/[[:space:]]*$//
-h
-}
-/$re/{
-g
-p
-b NEXT
-}
-d
-: NEXT
-/^$/b TOP
-n
-b NEXT
-" < $sd/status
-       fi
-       return 0
-}
-
-ipkg_status_matching_all() {
-       for sd in `ipkg_state_dirs`; do
-               ipkg_status_matching_sd $sd $*
-       done
-}
-
-ipkg_status_matching() {
-       if [ -n "$DEST_NAME" ]; then
-               ipkg_status_matching_sd $IPKG_STATE_DIR $*
-       else
-               ipkg_status_matching_all $*
-       fi
-}
-
-ipkg_status_installed_sd() {
-       local sd="$1"
-       local pkg="$2"
-       ipkg_status_sd $sd $pkg Status | grep -q "Status: install ok installed"
-}
-
-ipkg_status_installed_all() {
-       local ret=1
-       for sd in `ipkg_state_dirs`; do
-               if `ipkg_status_installed_sd $sd $*`; then
-                       ret=0
-               fi
-       done
-       return $ret
-}
-
-ipkg_status_mentioned_sd() {
-       local sd="$1"
-       local pkg="$2"
-       [ -n "`ipkg_status_sd $sd $pkg Status`" ]
-}
-
-ipkg_files() {
-       local pkg="$1"
-       if [ -n "$DEST_NAME" ]; then
-               dests=$IPKG_ROOT
-       else
-               dests="`ipkg_dests_all`"
-       fi
-       for dest in $dests; do
-               if [ -f $dest/$IPKG_DIR_PREFIX/info/$pkg.list ]; then
-                       dest_sed="`echo $dest | ipkg_protect_slashes`"
-                       sed -e "s/^/$dest_sed/" < $dest/$IPKG_DIR_PREFIX/info/$pkg.list
-               fi
-       done
-}
-
-ipkg_search() {
-       local pattern="$1"
-
-       for dest_name in `ipkg_dest_names`; do
-               dest="`ipkg_dest_byname $dest_name`"
-               dest_sed="`echo $dest | ipkg_protect_slashes`"
-
-               set +o noglob
-               local list_files="`ls -1 $dest/$IPKG_DIR_PREFIX/info/*.list 2>/dev/null`"
-               set -o noglob
-               for file in $list_files; do
-                       if sed "s/^/$dest_sed/" $file | grep -q $pattern; then
-                               local pkg="`echo $file | sed "s/^.*\/\(.*\)\.list/\1/"`"
-                               [ "$dest_name" != `ipkg_dest_default_name` ] && pkg="$pkg ($dest_name)"
-                               sed "s/^/$dest_sed/" $file | grep $pattern | sed "s/^/$pkg: /"
-                       fi
-               done
-       done
-}
-
-ipkg_status_remove_sd() {
-       local sd="$1"
-       local pkg="$2"
-
-       if [ ! -f $sd/status ]; then
-               mkdir -p $sd
-               touch $sd/status
-       fi
-       sed -ne "/Package:[[:space:]]*$pkg[[:space:]]*\$/,/^\$/!p" < $sd/status > $sd/status.new
-       mv $sd/status.new $sd/status
-}
-
-ipkg_status_remove_all() {
-       for sd in `ipkg_state_dirs`; do
-               ipkg_status_remove_sd $sd $*
-       done
-}
-
-ipkg_status_remove() {
-       if [ -n "$DEST_NAME" ]; then
-               ipkg_status_remove_sd $IPKG_STATE_DIR $*
-       else
-               ipkg_status_remove_all $*
-       fi
-}
-
-ipkg_status_update_sd() {
-       local sd="$1"
-       local pkg="$2"
-
-       ipkg_status_remove_sd $sd $pkg
-       ipkg_extract_field "$IPKG_STATUS_FIELDS" >> $sd/status
-       echo "" >> $sd/status
-}
-
-ipkg_status_update() {
-       ipkg_status_update_sd $IPKG_STATE_DIR $*
-}
-
-ipkg_unsatisfied_dependences() {
-    local pkg=$1
-    local deps="`ipkg_get_depends $pkg`"
-    local remaining_deps=
-    for dep in $deps; do
-       local installed="`ipkg_get_installed $dep`"
-       if [ "$installed" != "installed" ] ; then
-           remaining_deps="$remaining_deps $dep"
-       fi
-    done
-    ## echo "ipkg_unsatisfied_dependences pkg=$pkg $remaining_deps" > /dev/console
-    echo $remaining_deps
-}
-
-ipkg_safe_pkg_name() {
-       local pkg=$1
-       local spkg="`echo pkg_$pkg | sed -e y/-+./___/`"
-       echo $spkg
-}
-
-ipkg_set_depends() {
-       local pkg=$1; shift 
-       local new_deps="$*"
-       pkg="`ipkg_safe_pkg_name $pkg`"
-       ## setvar ${pkg}_depends "$new_deps"
-       echo $new_deps > /tmp/ipkg/${pkg}.depends
-}
-
-ipkg_get_depends() {
-       local pkg=$1
-       pkg="`ipkg_safe_pkg_name $pkg`"
-       cat /tmp/ipkg/${pkg}.depends
-       ## eval "echo \$${pkg}_depends"
-}
-
-ipkg_set_installed() {
-       local pkg=$1
-       pkg="`ipkg_safe_pkg_name $pkg`"
-       echo installed > /tmp/ipkg/${pkg}.installed
-       ## setvar ${pkg}_installed "installed"
-}
-
-ipkg_set_uninstalled() {
-       local pkg=$1
-       pkg="`ipkg_safe_pkg_name $pkg`"
-       ### echo ipkg_set_uninstalled $pkg > /dev/console
-       echo uninstalled > /tmp/ipkg/${pkg}.installed
-       ## setvar ${pkg}_installed "uninstalled"
-}
-
-ipkg_get_installed() {
-       local pkg=$1
-       pkg="`ipkg_safe_pkg_name $pkg`"
-       if [ -f /tmp/ipkg/${pkg}.installed ]; then
-               cat /tmp/ipkg/${pkg}.installed
-       fi
-       ## eval "echo \$${pkg}_installed"
-}
-
-ipkg_depends() {
-       local new_pkgs="$*"
-       local all_deps=
-       local installed_pkgs="`ipkg_status_matching_all 'Status:.*[[:space:]]installed'`"
-       for pkg in $installed_pkgs; do
-           ipkg_set_installed $pkg
-       done
-       while [ -n "$new_pkgs" ]; do
-               all_deps="$all_deps $new_pkgs"
-               local new_deps=
-               for pkg in $new_pkgs; do
-                       if echo $pkg | grep -q '[^a-z0-9.+-]'; then
-                               echo "ipkg_depends: ERROR: Package name $pkg contains illegal characters (should be [a-z0-9.+-])" >&2
-                               return 1
-                       fi
-                       # TODO: Fix this. For now I am ignoring versions and alternations in dependencies.
-                       new_deps="$new_deps "`ipkg_info $pkg '\(Pre-\)\?Depends' | ipkg_extract_value | sed -e 's/([^)]*)//g
-s/\(|[[:space:]]*[a-z0-9.+-]\+[[:space:]]*\)\+//g
-s/,/ /g
-s/ \+/ /g'`
-                       ipkg_set_depends $pkg $new_deps
-               done
-
-               new_deps=`echo $new_deps | sed -e 's/[[:space:]]\+/\\
-/g' | sort | uniq`
-
-               local maybe_new_pkgs=
-               for pkg in $new_deps; do
-                       if ! echo $installed_pkgs | grep -q "\<$pkg\>"; then
-                               maybe_new_pkgs="$maybe_new_pkgs $pkg"
-                       fi
-               done
-
-               new_pkgs=
-               for pkg in $maybe_new_pkgs; do
-                       if ! echo $all_deps | grep -q "\<$pkg\>"; then
-                               if [ -z "`ipkg_info $pkg`" ]; then
-                                       echo "ipkg_depends: Warning: $pkg mentioned in dependency but no package found in $IPKG_LISTS_DIR" >&2
-                                       ipkg_set_installed $pkg
-                               else
-                                       new_pkgs="$new_pkgs $pkg"
-                                       ipkg_set_uninstalled $pkg
-                               fi
-                       else
-                               ipkg_set_uninstalled $pkg
-                       fi
-               done
-       done
-
-       echo $all_deps
-}
-
-ipkg_get_install_dest() {
-       local dest="$1"
-       shift
-       local sd=$dest/$IPKG_DIR_PREFIX
-       local info_dir=$sd/info
-
-        local requested_pkgs="$*"
-       local pkgs="`ipkg_depends $*`"
-
-       mkdir -p $info_dir
-       for pkg in $pkgs; do
-               if ! ipkg_status_mentioned_sd $sd $pkg; then
-                       echo "Package: $pkg
-Status: install ok not-installed" | ipkg_status_update_sd $sd $pkg
-               fi
-       done
-        ## mark the packages that we were directly requested to install as uninstalled
-        for pkg in $requested_pkgs; do ipkg_set_uninstalled $pkg; done
-
-       local new_pkgs=
-       local pkgs_installed=0
-       while [ -n "pkgs" ]; do
-               curcheck=0
-               ## echo "pkgs to install: {$pkgs}" > /dev/console
-               for pkg in $pkgs; do
-                       curcheck="`expr $curcheck + 1`"
-                       local is_installed="`ipkg_get_installed $pkg`"
-                       if [ "$is_installed" = "installed" ]; then
-                               echo "$pkg is installed" > /dev/console
-                               continue
-                       fi
-
-                       local remaining_deps="`ipkg_unsatisfied_dependences $pkg`"
-                       if [ -n "$remaining_deps" ]; then
-                               new_pkgs="$new_pkgs $pkg"
-                               ### echo "Dependences not satisfied for $pkg: $remaining_deps"
-                               if [ $curcheck -ne `echo  $pkgs|wc -w` ]; then
-                                       continue
-                               fi
-                       fi
-
-                       local filename=
-                       for src in `ipkg_src_names`; do
-                               if ipkg_require_list $src; then
-                                       filename="`ipkg_extract_paragraph $pkg < $IPKG_LISTS_DIR/$src | ipkg_extract_field Filename | ipkg_extract_value`"
-                                       [ -n "$filename" ] && break
-                               fi
-                       done
-
-                       if [ -z "$filename" ]; then
-                               echo "ipkg_get_install: ERROR: Cannot find package $pkg in $IPKG_LISTS_DIR"
-                               echo "ipkg_get_install:        Check the spelling and maybe run \`ipkg update'."
-                               ipkg_status_remove_sd $sd $pkg
-                               return 1;
-                       fi
-
-                       [ -e "$IPKG_TMP" ] || mkdir -p $IPKG_TMP
-
-                       echo ""
-                       local tmp_pkg_file="$IPKG_TMP/"`ipkg_file_part $filename`
-                       if ! ipkg_download `ipkg_src_byname $src`/$filename $tmp_pkg_file; then
-                               echo "ipkg_get_install: Perhaps you need to run \`ipkg update'?"
-                               return 1
-                       fi
-
-                       if ! ipkg_install_file_dest $dest $tmp_pkg_file; then
-                               echo "ipkg_get_install: ERROR: Failed to install $tmp_pkg_file"
-                               echo "ipkg_get_install: I'll leave it there for you to try a manual installation"
-                               return 1
-                       fi
-
-                       ipkg_set_installed $pkg
-                       pkgs_installed="`expr $pkgs_installed + 1`"
-                       rm $tmp_pkg_file
-               done
-               ### echo "Installed $pkgs_installed package(s) this round"
-               if [ $pkgs_installed -eq 0 ]; then
-                       if [ -z "$new_pkgs" ]; then
-                           break
-                       fi
-               fi
-               pkgs_installed=0
-               pkgs="$new_pkgs"
-               new_pkgs=
-               curcheck=0
-        done
-}
-
-ipkg_get_install() {
-       ipkg_get_install_dest $IPKG_ROOT $*
-}
-
-ipkg_install_file_dest() {
-       local dest="$1"
-       local filename="$2"
-       local sd=$dest/$IPKG_DIR_PREFIX
-       local info_dir=$sd/info
-
-       if [ ! -f "$filename" ]; then
-               echo "ipkg_install_file: ERROR: File $filename not found"
-               return 1
-       fi
-
-       local pkg="`ipkg_file_part $filename | sed 's/\([a-z0-9.+-]\+\)_.*/\1/'`"
-       local ext="`echo $filename | sed 's/.*\.//'`"
-       local pkg_extract_stdout
-       if [ "$ext" = "ipk" ]; then
-               pkg_extract_stdout="tar -xzOf"
-       elif [ "$ext" = "deb" ]; then
-               pkg_extract_stdout="ar p"
-       else
-               echo "ipkg_install_file: ERROR: File $filename has unknown extension $ext (not .ipk or .deb)"
-               return 1
-       fi
-
-       # Check dependencies
-       local depends="`ipkg_depends $pkg | sed -e "s/\<$pkg\>//"`"
-
-       # Don't worry about deps that are scheduled for installation
-       local missing_deps=
-       for dep in $depends; do
-               if ! ipkg_status_all $dep | grep -q 'Status:[[:space:]]install'; then
-                       missing_deps="$missing_deps $dep"
-               fi
-       done
-
-       if [ ! -z "$missing_deps" ]; then
-               if [ -n "$FORCE_DEPENDS" ]; then
-                       echo "ipkg_install_file: Warning: $pkg depends on the following uninstalled programs: $missing_deps"
-               else
-                       echo "ipkg_install_file: ERROR: $pkg depends on the following uninstalled programs:
-       $missing_deps"
-                       echo "ipkg_install_file: You may want to use \`ipkg install' to install these."
-                       return 1
-               fi
-       fi
-
-       mkdir -p $IPKG_TMP/$pkg/control
-       mkdir -p $IPKG_TMP/$pkg/data
-       mkdir -p $info_dir
-
-       if ! $pkg_extract_stdout $filename ./control.tar.gz | (cd $IPKG_TMP/$pkg/control; tar -xzf - ) ; then
-               echo "ipkg_install_file: ERROR unpacking control.tar.gz from $filename"
-               return 1
-       fi
-
-       if [ -n "$IPKG_OFFLINE_ROOT" ]; then
-               if grep -q '^InstallsOffline:[[:space:]]*no' $IPKG_TMP/$pkg/control/control; then
-                       echo "*** Warning: Package $pkg may not be installed in offline mode"
-                       echo "*** Warning: Scheduling $filename for pending installation (installing into $IPKG_PENDING_DIR)"
-                       echo "Package: $pkg
-Status: install ok pending" | ipkg_status_update_sd $sd $pkg
-                       mkdir -p $IPKG_PENDING_DIR
-                       cp $filename $IPKG_PENDING_DIR
-                       rm -r $IPKG_TMP/$pkg/control
-                       rm -r $IPKG_TMP/$pkg/data
-                       rmdir $IPKG_TMP/$pkg
-                       return 0
-               fi
-       fi
-
-
-       echo -n "Unpacking $pkg..."
-       set +o noglob
-       for file in $IPKG_TMP/$pkg/control/*; do
-               local base_file="`ipkg_file_part $file`"
-               mv $file $info_dir/$pkg.$base_file
-       done
-       set -o noglob
-       rm -r $IPKG_TMP/$pkg/control
-
-       if ! $pkg_extract_stdout $filename ./data.tar.gz | (cd $IPKG_TMP/$pkg/data; tar -xzf - ) ; then
-               echo "ipkg_install_file: ERROR unpacking data.tar.gz from $filename"
-               return 1
-       fi
-       echo "Done."
-
-       echo -n "Configuring $pkg..."
-       export PKG_ROOT=$dest
-       if [ -x "$info_dir/$pkg.preinst" ]; then
-               if ! $info_dir/$pkg.preinst install; then
-                       echo "$info_dir/$pkg.preinst failed. Aborting installation of $pkg"
-                       rm -rf $IPKG_TMP/$pkg/data
-                       rmdir $IPKG_TMP/$pkg
-                       return 1
-               fi
-       fi
-
-       local old_conffiles="`ipkg_status_sd $sd $pkg Conffiles | ipkg_extract_value`"
-       local new_conffiles=
-       if [ -f "$info_dir/$pkg.conffiles" ]; then
-               for conffile in `cat $info_dir/$pkg.conffiles`; do
-                       if [ -f "$dest/$conffile" ] && ! echo " $old_conffiles " | grep -q " $conffile "`md5sum $dest/$conffile | sed 's/ .*//'`; then
-                               local use_maintainers_conffile=
-                               if [ -z "$FORCE_DEFAULTS" ]; then
-                                       while true; do
-                                               echo -n "Configuration file \`$conffile'
- ==> File on system created by you or by a script.
- ==> File also in package provided by package maintainer.
-   What would you like to do about it ?  Your options are:
-    Y or I  : install the package maintainer's version
-    N or O  : keep your currently-installed version
-      D     : show the differences between the versions (if diff is installed)
- The default action is to keep your current version.
-*** `ipkg_file_part $conffile` (Y/I/N/O/D) [default=N] ? "
-                                               read response
-                                               case "$response" in
-                                               [YyIi] | [Yy][Ee][Ss])
-                                                       use_maintainers_conffile=t
-                                                       break
-                                               ;;
-                                               [Dd])
-                                                       echo "
-diff -u $dest/$conffile $IPKG_TMP/$pkg/data/$conffile"
-                                                       diff -u $dest/$conffile $IPKG_TMP/$pkg/data/$conffile || true
-                                                       echo "[Press ENTER to continue]"
-                                                       read junk
-                                               ;;
-                                               *)
-                                                       break
-                                               ;;
-                                               esac
-                                       done
-                               fi
-                               if [ -n "$use_maintainers_conffile" ]; then
-                                       local md5sum="`md5sum $IPKG_TMP/$pkg/data/$conffile | sed 's/ .*//'`"
-                                       new_conffiles="$new_conffiles $conffile $md5sum"
-                               else
-                                       new_conffiles="$new_conffiles $conffile <custom>"
-                                       rm $IPKG_TMP/$pkg/data/$conffile
-                               fi
-                       else
-                               md5sum="`md5sum $IPKG_TMP/$pkg/data/$conffile | sed 's/ .*//'`"
-                               new_conffiles="$new_conffiles $conffile $md5sum"
-                       fi
-               done
-       fi
-
-       local owd="`pwd`"
-       (cd $IPKG_TMP/$pkg/data/; tar cf - . | (cd $owd; cd $dest; tar xf -))
-       rm -rf $IPKG_TMP/$pkg/data
-       rmdir $IPKG_TMP/$pkg
-       $pkg_extract_stdout $filename ./data.tar.gz | tar tzf - | sed -e 's/^\.//' > $info_dir/$pkg.list
-
-       if [ -x "$info_dir/$pkg.postinst" ]; then
-               $info_dir/$pkg.postinst configure
-       fi
-
-       if [ -n "$new_conffiles" ]; then
-               new_conffiles='Conffiles: '`echo $new_conffiles | ipkg_protect_slashes`
-       fi
-       local sed_safe_root="`echo $dest | sed -e "s/^${IPKG_OFFLINE_ROOT}//" | ipkg_protect_slashes`"
-       sed -e "s/\(Package:.*\)/\1\\
-Status: install ok installed\\
-Root: ${sed_safe_root}\\
-${new_conffiles}/" $info_dir/$pkg.control | ipkg_status_update_sd $sd $pkg
-
-       rm -f $info_dir/$pkg.control
-       rm -f $info_dir/$pkg.conffiles
-       rm -f $info_dir/$pkg.preinst
-       rm -f $info_dir/$pkg.postinst
-
-       echo "Done."
-}
-
-ipkg_install_file() {
-       ipkg_install_file_dest $IPKG_ROOT $*
-}
-
-ipkg_install() {
-
-       while [ $# -gt 0 ]; do
-               local pkg="$1"
-               shift
-       
-               case "$pkg" in
-               http://* | ftp://*)
-                       local tmp_pkg_file="$IPKG_TMP/"`ipkg_file_part $pkg`
-                       if ipkg_download $pkg $tmp_pkg_file; then
-                               ipkg_install_file $tmp_pkg_file
-                               rm $tmp_pkg_file
-                       fi
-                       ;;
-               file:/*.ipk  | file://*.deb)
-                               local ipkg_filename="`echo $pkg|sed 's/^file://'`"
-                               ipkg_install_file $ipkg_filename
-                       ;;
-               *.ipk  | *.deb)
-                       if [ -f "$pkg" ]; then
-                               ipkg_install_file $pkg
-                       else
-                               echo "File not found $pkg" >&2
-                       fi
-                       ;;
-               *)
-                       ipkg_get_install $pkg || true
-                       ;;
-               esac
-       done
-}
-
-ipkg_install_pending() {
-       [ -n "$IPKG_OFFLINE_ROOT" ] && return 0
-
-       if [ -d "$IPKG_PENDING_DIR" ]; then
-               set +o noglob
-               local pending="`ls -1d $IPKG_PENDING_DIR/*.ipk 2> /dev/null`" || true
-               set -o noglob
-               if [ -n "$pending" ]; then
-                       echo "The following packages in $IPKG_PENDING_DIR will now be installed:"
-                       echo $pending
-                       for filename in $pending; do
-                               if ipkg_install_file $filename; then
-                                       rm $filename
-                               fi
-                       done
-               fi
-       fi
-       return 0
-}
-
-ipkg_install_wanted() {
-       local wanted="`ipkg_status_matching 'Status:[[:space:]]*install.*not-installed'`"
-
-       if [ -n "$wanted" ]; then
-               echo "The following package were previously requested but have not been installed:"
-               echo $wanted
-
-               if [ -n "$FORCE_DEFAULTS" ]; then
-                       echo "Installing them now."
-               else
-                       echo -n "Install them now [Y/n] ? "
-                       read response
-                       case "$response" in
-                       [Nn] | [Nn][Oo])
-                               return 0
-                               ;;
-                       esac
-               fi
-
-               ipkg_install $wanted
-       fi
-
-       return 0
-}
-
-ipkg_upgrade_pkg() {
-       local pkg="$1"
-       local avail_ver="`ipkg_info $pkg Version | ipkg_extract_value | head -1`"
-
-       is_installed=
-       for dest_name in `ipkg_dest_names`; do
-               local dest="`ipkg_dest_byname $dest_name`"
-               local sd=$dest/$IPKG_DIR_PREFIX
-               local inst_ver="`ipkg_status_sd $sd $pkg Version | ipkg_extract_value`"
-               if [ -n "$inst_ver" ]; then
-                       is_installed=t
-
-                       if [ -z "$avail_ver" ]; then
-                               echo "Assuming locally installed package $pkg ($inst_ver) is up to date"
-                               return 0
-                       fi
-
-                       if [ "$avail_ver" = "$inst_ver" ]; then 
-                               echo "Package $pkg ($inst_ver) installed in $dest_name is up to date"
-                       elif ipkg_is_upgrade "$avail_ver" "$inst_ver"; then
-                               echo "Upgrading $pkg ($dest_name) from $inst_ver to $avail_ver"
-                               ipkg_get_install_dest $dest $pkg
-                       else
-                               echo "Not downgrading package $pkg from $inst_ver to $avail_ver"
-                       fi
-               fi
-       done
-
-       if [ -z "$is_installed" ]; then
-               echo "Package $pkg does not appear to be installed"
-               return 0
-       fi
-
-}
-
-ipkg_upgrade() {
-       if [ $# -lt 1 ]; then
-               local pkgs="`ipkg_status_matching 'Status:.*[[:space:]]installed'`"
-       else
-               pkgs="$*"
-       fi
-       
-       for pkg in $pkgs; do
-               ipkg_upgrade_pkg $pkg
-       done
-}
-
-ipkg_remove_pkg_dest() {
-       local dest="$1"
-       local pkg="$2"
-       local sd=$dest/$IPKG_DIR_PREFIX
-       local info_dir=$sd/info
-
-       if ! ipkg_status_installed_sd $sd $pkg; then
-               echo "ipkg_remove: Package $pkg does not appear to be installed in $dest"
-               if ipkg_status_mentioned_sd $sd $pkg; then
-                       echo "Purging mention of $pkg from the ipkg database"
-                       ipkg_status_remove_sd $sd $pkg
-               fi
-               return 1
-       fi
-
-       echo "ipkg_remove: Removing $pkg... "
-
-       local files="`cat $info_dir/$pkg.list`"
-
-       export PKG_ROOT=$dest
-       if [ -x "$info_dir/$pkg.prerm" ]; then
-               $info_dir/$pkg.prerm remove
-       fi
-
-       local conffiles="`ipkg_status_sd $sd $pkg Conffiles | ipkg_extract_value`"
-
-       local dirs_to_remove=
-       for file in $files; do
-               if [ -d "$dest/$file" ]; then
-                       dirs_to_remove="$dirs_to_remove $dest/$file"
-               else
-                       if echo " $conffiles " | grep -q " $file "; then
-                               if echo " $conffiles " | grep -q " $file "`md5sum $dest/$file | sed 's/ .*//'`; then
-                                       rm -f $dest/$file
-                               fi
-                       else
-                               rm -f $dest/$file
-                       fi
-               fi
-       done
-
-       local removed_a_dir=t
-       while [ -n "$removed_a_dir" ]; do
-               removed_a_dir=
-               local new_dirs_to_remove=
-               for dir in $dirs_to_remove; do
-                       if rmdir $dir >/dev/null 2>&1; then
-                               removed_a_dir=t
-                       else
-                               new_dirs_to_remove="$new_dirs_to_remove $dir"
-                       fi
-               done
-               dirs_to_remove="$new_dirs_to_remove"
-       done
-
-       if [ -n "$dirs_to_remove" ]; then
-               echo "ipkg_remove: Warning: Not removing the following directories since they are not empty:" >&2
-               echo "$dirs_to_remove" | sed -e 's/\/[/]\+/\//g' >&2
-       fi
-
-       if [ -x "$info_dir/$pkg.postrm" ]; then
-               $info_dir/$pkg.postrm remove
-       fi
-
-       ipkg_status_remove_sd $sd $pkg
-       set +o noglob
-       rm -f $info_dir/$pkg.*
-       set -o noglob
-
-       echo "Done."
-}
-
-ipkg_remove_pkg() {
-       local pkg="$1"
-       for dest in `ipkg_dests_all`; do
-               local sd=$dest/$IPKG_DIR_PREFIX
-               if ipkg_status_mentioned_sd $sd $pkg; then
-                       ipkg_remove_pkg_dest $dest $pkg
-               fi
-       done
-}
-
-ipkg_remove() {
-       while [ $# -gt 0 ]; do
-               local pkg="$1"
-               shift
-               if [ -n "$DEST_NAME" ]; then
-                       ipkg_remove_pkg_dest $IPKG_ROOT $pkg
-               else
-                       ipkg_remove_pkg $pkg
-               fi
-       done
-}
-
-###########
-# ipkg main
-###########
-
-# Parse options
-while [ $# -gt 0 ]; do
-       arg="$1"
-       case $arg in
-       -d | -dest)
-               [ $# -gt 1 ] || ipkg_usage "option $arg requires an argument"
-               DEST_NAME="$2"
-               shift
-               ;;
-       -o | -offline)
-               [ $# -gt 1 ] || ipkg_usage "option $arg requires an argument"
-               IPKG_OFFLINE_ROOT="$2"
-               shift
-               ;;
-       -force-depends)
-               FORCE_DEPENDS=t
-               ;;
-       -force-defaults)
-               FORCE_DEFAULTS=t
-               ;;
-       -*)
-               ipkg_usage "unknown option $arg"
-               ;;
-       *)
-               break
-               ;;
-       esac
-       shift
-done
-
-[ $# -lt 1 ] && ipkg_usage "ipkg must have one sub-command argument"
-cmd="$1"
-shift
-
-ipkg_load_configuration
-mkdir -p /tmp/ipkg
-
-case "$cmd" in
-update|upgrade|list|info|status|install_pending)
-       ;;
-install|depends|remove|files|search)
-       [ $# -lt 1 ] && ipkg_usage "ERROR: the \`\`$cmd'' command requires an argument"
-       ;;
-*)
-       echo "ERROR: unknown sub-command \`$cmd'"
-       ipkg_usage
-       ;;
-esac
-
-# Only install pending if we have an interactive sub-command
-case "$cmd" in
-upgrade|install)
-       ipkg_install_pending
-       ipkg_install_wanted
-       ;;
-esac
-
-ipkg_$cmd $*
-for a in `ls $IPKG_TMP`; do
-       rm -rf $IPKG_TMP/$a
-done
diff --git a/root/bin/login b/root/bin/login
deleted file mode 100755 (executable)
index 7520824..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-exec ash --login
diff --git a/root/etc/dnsmasq.conf b/root/etc/dnsmasq.conf
deleted file mode 100644 (file)
index c62f7f9..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-# filter what we send upstream
-domain-needed
-bogus-priv
-filterwin2k
-
-# allow /etc/hosts and dhcp lookups via *.lan
-local=/lan/
-domain=lan
-
-# no dns queries from the wan
-except-interface=vlan1
-
-# enable dhcp (start,end,netmask,leasetime)
-dhcp-range=192.168.1.100,192.168.1.250,255.255.255.0,12h
-dhcp-leasefile=/tmp/dhcp.leases
-
-# allow a /etc/ethers for static hosts
-read-ethers
-
-# other useful options:
-# default route(s): dhcp-option=3,192.168.1.1,192.168.1.2
-#    dns server(s): dhcp-option=6,192.168.1.1,192.168.1.2
diff --git a/root/etc/functions.sh b/root/etc/functions.sh
deleted file mode 100755 (executable)
index 79db1da..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/ash
-
-alias debug=${DEBUG:-:}
-
-# allow env to override nvram
-nvram_get () {
- eval "echo \${$1:-\$(nvram get $1)}"
-}
-. /etc/nvram.overrides
-
-# valid interface?
-if_valid () (
-  [ "${1%%[0-9]}" = "vlan" ] && {
-    i=${1#vlan}
-    hwname=$(nvram_get vlan${i}hwname)
-    hwaddr=$(nvram_get ${hwname}macaddr)
-    [ -z "$hwaddr" ] && return 1
-
-    vif=$(ifconfig -a | awk '/^eth.*'$hwaddr'/ {print $1; exit}' IGNORECASE=1)
-    debug "# vlan$i: $hwname $hwaddr => $vif"
-
-    $DEBUG ifconfig $vif up
-    $DEBUG vconfig add $vif $i 2>/dev/null
-  }
-  ifconfig "$1" >/dev/null 2>&1 || [ "${1%%[0-9]}" = "br" ]
-)
diff --git a/root/etc/init.d/S10boot b/root/etc/init.d/S10boot
deleted file mode 100755 (executable)
index 11bc31b..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-sysctl -p
-echo "S" > /proc/jffs2_bbc
-
-mkdir -p /var/run
-
-# networking stub
-[ "$(nvram get il0macaddr)" = "00:90:4c:5f:00:2a" ] && {
-  # force unique wireless mac
-  nvram set il0macaddr=$(nvram get et0macaddr|
-  awk '{OFS=FS=":";for(x=6,y=2;x;x--){$x=sprintf("%02x",(y+="0x"$x)%256);y/=256}print}')
-}
-
-insmod et
-insmod wl
-
-ifconfig lo 127.0.0.1 up
-ifconfig eth0 promisc
-
-HOSTNAME=$(nvram get wan_hostname)
-DOMAINNAME=${HOSTNAME##*.}
-HOSTNAME=${HOSTNAME%%.*}
-
-echo ${HOSTNAME:=OpenWrt} > /proc/sys/kernel/hostname
-echo ${DOMAINNAME:=lan}   > /proc/sys/kernel/domainname
-
-vconfig set_name_type VLAN_PLUS_VID_NO_PAD
diff --git a/root/etc/init.d/S40network b/root/etc/init.d/S40network
deleted file mode 100755 (executable)
index 5a6ca72..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-. /etc/functions.sh
-case "$1" in
-  start|restart)
-    ifup lan
-    ifup wan
-    ifup wifi
-    wifi up
-
-    for route in $(nvram_get static_route); do {
-      eval "set $(echo $route | sed 's/:/ /g')"
-      route add -net $1 netmask $2 gw $3 metric $4 dev $5
-    } done
-    ;;
-esac
diff --git a/root/etc/init.d/S45firewall b/root/etc/init.d/S45firewall
deleted file mode 100755 (executable)
index 4885c7c..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-. /etc/functions.sh
-
-WAN=$(nvram_get wan_ifname)
-
-IPT=/usr/sbin/iptables
-
-for T in filter nat mangle ; do
-  $IPT -t $T -F
-  $IPT -t $T -X
-done
-
-$IPT -t filter -A INPUT -m state --state INVALID -j DROP
-$IPT -t filter -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT 
-$IPT -t filter -A INPUT -p icmp -j ACCEPT 
-$IPT -t filter -A INPUT -i $WAN -p tcp -j REJECT --reject-with tcp-reset 
-$IPT -t filter -A INPUT -i $WAN -j REJECT --reject-with icmp-port-unreachable 
-$IPT -t filter -A FORWARD -m state --state INVALID -j DROP 
-$IPT -t filter -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT 
-$IPT -t filter -A FORWARD -i $WAN -m state --state NEW,INVALID -j DROP
-$IPT -t filter -A FORWARD -o $WAN -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
-
-$IPT -t nat -A POSTROUTING -o $WAN -j MASQUERADE
diff --git a/root/etc/init.d/S50services b/root/etc/init.d/S50services
deleted file mode 100755 (executable)
index bdd1102..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-/usr/sbin/telnetd -l /bin/login
-/usr/sbin/httpd -p 80 -h /www -r WRT54G Router
-/usr/sbin/dnsmasq
diff --git a/root/etc/init.d/S99done b/root/etc/init.d/S99done
deleted file mode 100755 (executable)
index 73a4da4..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-[ -z "$FAILSAFE" ] && {
-       { mount | grep jffs2 1>&-; } || firstboot
-}
-# turn off DMZ led
-echo "0x00" > /proc/sys/diag
diff --git a/root/etc/init.d/rcS b/root/etc/init.d/rcS
deleted file mode 100755 (executable)
index 9510e94..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-# Start all init scripts in /etc/init.d
-# executing them in numerical order.
-#
-for i in /etc/init.d/S??* ;do
-
-     # Ignore dangling symlinks (if any).
-     [ ! -f "$i" ] && continue
-
-     case "$i" in
-        *.sh)
-            # Source shell script for speed.
-            (
-                trap - INT QUIT TSTP
-                set start
-                . $i
-            )
-            ;;
-        *)
-            # No sh extension, so fork subprocess.
-            $i start
-            ;;
-    esac
-done
diff --git a/root/etc/inittab b/root/etc/inittab
deleted file mode 100644 (file)
index 9943a90..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-::sysinit:/etc/init.d/rcS
-::shutdown:/sbin/halt
-::respawn:/bin/login
diff --git a/root/etc/ipkg.conf b/root/etc/ipkg.conf
deleted file mode 100644 (file)
index c3581d7..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-src openwrt http://openwrt.ksilebo.net/ipkg
-dest root /
-dest ram /tmp
diff --git a/root/etc/motd b/root/etc/motd
deleted file mode 100644 (file)
index 2b2b2c0..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-  _______                     ________        __
- |       |.-----.-----.-----.|  |  |  |.----.|  |_
- |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
- |_______||   __|_____|__|__||________||__|  |____|
-          |__| W I R E L E S S   F R E E D O M
-          
diff --git a/root/etc/nvram.overrides b/root/etc/nvram.overrides
deleted file mode 100644 (file)
index e334d75..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-# NVRAM overrides
-# This file handles the NVRAM quirks of various hardware
-# this is not a replacement for nvram.
-
-# linksys bug has lan doing dhcp; force static
-lan_proto="static"
-
-# failsafe if reset is held
-[ "$FAILSAFE" = "true" ] && {
-  echo "### FAILSAFE MODE ####"
-  lan_ifname="br0"
-  lan_ifnames="vlan0 vlan2 eth1 eth2 eth3"
-  lan_ipaddr="192.168.1.1"
-  lan_netmask="255.255.255.0"
-  lan_hwaddr="00:0B:AD:0A:DD:00"
-  wan_ifname="none"
-  wifi_ifname="none"
-}
-
-# hacks for 1.x hardware
-[ "$(nvram get boardnum)"  = "42" ] && \
-[ "$(nvram get boardtype)" = "bcm94710dev" ] && {
-  debug "### 1.x hardware hack ###"
-  vlan1hwname="et0"
-  vlan2hwname="et0"
-
-  # we remap old device names to new
-  # it's recommended that you continue to
-  # use the old names to preserve backwards
-  # compatibility
-  remap () {
-    eval $1=\"$(nvram_get $1 | awk 'gsub("eth0","vlan2") gsub("eth1","vlan1")')\"
-  }
-
-  remap lan_ifname
-  remap lan_ifnames
-  remap wifi_ifname
-  remap wifi_ifnames
-  remap wan_ifname
-  remap wan_ifnames
-  remap pppoe_ifname
-}
-
-[ -z "$(nvram_get lan_ifname)" ] && {
-  lan_ifname="br0"
-  lan_ifnames="vlan0 vlan2 eth1 eth2 eth3"
-}
-
-[ -z "$(nvram_get wan_ifname)" ] && {
-   wan_ifname="vlan1"
-   wan_proto="dhcp"
-}
diff --git a/root/etc/preinit b/root/etc/preinit
deleted file mode 100755 (executable)
index 1054282..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-mount none /proc -t proc
-insmod diag
-echo 0x01 > /proc/sys/diag
-sleep 1
-if /sbin/resetmon ; then
-  mtd unlock mtd4
-  mount -t jffs2 /dev/mtdblock/4 /jffs
-  pivot_root /jffs /jffs/rom
-  mount none /dev -t devfs
-  mount none /proc -t proc
-  umount rom/proc rom/dev
-else
-  export FAILSAFE=true
-fi
-mount none /tmp -t ramfs
-exec /sbin/init
diff --git a/root/etc/profile b/root/etc/profile
deleted file mode 100644 (file)
index 833ce89..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-[ -f /etc/motd ] && cat /etc/motd
-
-export PATH=/bin:/sbin:/usr/bin:/usr/sbin
-export PS1='\u@\h:\w\$ '
-
-alias less='more'
-alias vim='vi'
diff --git a/root/etc/sysctl.conf b/root/etc/sysctl.conf
deleted file mode 100644 (file)
index 8552a4b..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-kernel.panic = 3
-net.ipv4.ip_forward = 1
-net.ipv4.icmp_echo_ignore_broadcasts = 1
-net.ipv4.icmp_ignore_bogus_error_responses = 1
-net.ipv4.tcp_fin_timeout = 30
-net.ipv4.tcp_keepalive_time = 120
-net.ipv4.tcp_timestamps = 0
diff --git a/root/sbin/halt b/root/sbin/halt
deleted file mode 100755 (executable)
index 2aee693..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-/usr/bin/killall5 -9
-umount -ar
diff --git a/root/sbin/hotplug b/root/sbin/hotplug
deleted file mode 100755 (executable)
index 74134e8..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/ash
-# $Id$
-[ "${INTERFACE%%[0-9]*}" = "wds" ] && { 
-       ifconfig $INTERFACE 0.0.0.0 up
-       /usr/sbin/brctl addif br0 $INTERFACE
-}
diff --git a/root/sbin/ifdown b/root/sbin/ifdown
deleted file mode 100755 (executable)
index 4c7e982..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/ash
-. /etc/functions.sh
-  type=$1
-  debug "### ifdown $type ###"
-  if=$(nvram_get ${type}_ifname)
-  if_valid $if || return
-  kill $(cat /var/run/${if}.pid 2>&-) 2>&-
-  $DEBUG ifconfig $if down
diff --git a/root/sbin/ifup b/root/sbin/ifup
deleted file mode 100755 (executable)
index 34e19af..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/ash
-. /etc/functions.sh
-  type=$1
-  debug "### ifup $type ###"
-
-  if=$(nvram_get ${type}_ifname)
-  if [ "${if%%[0-9]}" = "ppp" ]; then
-    if=$(nvram_get pppoe_ifname)
-  fi
-
-  if_valid $if || return
-
-  $DEBUG ifconfig $if down
-  if [ "${if%%[0-9]}" = "br" ]; then
-    stp=$(nvram_get ${type}_stp)
-    $DEBUG brctl delbr $if
-    $DEBUG brctl addbr $if
-    $DEBUG brctl setfd $if 0
-    $DEBUG brctl stp $if ${stp:-0}
-    for sif in $(nvram_get ${type}_ifnames); do {
-      if_valid $sif || continue
-      $DEBUG ifconfig $sif 0.0.0.0 up
-      $DEBUG brctl addif $if $sif
-    } done
-  fi
-
-  mac=$(nvram_get ${type}_hwaddr)
-  ${mac:+$DEBUG ifconfig $if hw ether $mac}
-
-  if_proto=$(nvram_get ${type}_proto)
-  case "$if_proto" in
-    static)
-      ip=$(nvram_get ${type}_ipaddr)
-      netmask=$(nvram_get ${type}_netmask)
-      gateway=$(nvram_get ${type}_gateway)
-
-      $DEBUG ifconfig $if $ip ${netmask:+netmask $netmask} broadcast + up
-      ${gateway:+$DEBUG route add default gw $gateway}
-
-      [ -f /etc/resolv.conf ] && return
-
-      debug "# --- creating /etc/resolv.conf ---"
-      for dns in $(nvram_get ${type}_dns); do {
-       echo "nameserver $dns" >> /etc/resolv.conf
-      } done
-    ;;
-    dhcp)
-      pidfile=/tmp/dhcp-${type}.pid
-      if [ -f $pidfile ]; then
-        $DEBUG kill $(cat $pidfile)
-      fi
-      ${DEBUG:-eval} "udhcpc -i $if -b -p $pidfile &" 
-    ;;
-    pppoe)
-      username=$(nvram_get ppp_username)
-      password=$(nvram_get ppp_passwd)
-      redial=$(nvram_get ppp_redialperiod)
-      idletime=$(nvram_get ppp_idletime)
-      mtu=$(nvram_get wan_mtu)
-
-      $DEBUG ifconfig $if 0.0.0.0 up
-
-      $DEBUG /sbin/pppoecd $if -u $username -p $password \
-        -i 0 -I $redial -T $idletime -t $mtu -k
-    ;;
-    none)
-    ;;
-    *)
-      echo "### WARNING $if: $if_proto is not supported"
-    ;;
-  esac
diff --git a/root/sbin/wifi b/root/sbin/wifi
deleted file mode 100755 (executable)
index 03ec66e..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/ash
-  alias debug=${DEBUG:-:}
-  debug "### wifi $1 ###"
-  if=$(awk 'sub(":","") {print $1}' /proc/net/wireless)
-  $DEBUG wlconf $if $1
diff --git a/root/usr/share/udhcpc/default.script b/root/usr/share/udhcpc/default.script
deleted file mode 100755 (executable)
index 87be32d..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-# udhcpc script edited by Tim Riker <Tim@Rikers.org>
-# (slightly modified)
-
-[ -z "$1" ] && echo "Error: should be run by udhcpc" && exit 1
-
-RESOLV_CONF="/tmp/resolv.conf"
-
-case "$1" in
-        deconfig)
-                ifconfig $interface 0.0.0.0
-                ;;
-
-        renew|bound)
-                ifconfig $interface $ip \
-                ${broadcast:+broadcast $broadcast} \
-                ${subnet:+netmask $subnet}
-
-                if [ -n "$router" ] ; then
-                        echo "deleting routers"
-                        while route del default gw 0.0.0.0 dev $interface ; do
-                                :
-                        done
-
-                        for i in $router ; do
-                                route add default gw $i dev $interface
-                        done
-                fi
-
-                echo -n > $RESOLV_CONF
-                ${domain:+echo search $domain >> $RESOLV_CONF}
-                for i in $dns ; do
-                        echo adding dns $i
-                        echo nameserver $i >> $RESOLV_CONF
-                done
-                ;;
-esac
-exit 0
diff --git a/root/www/index.html b/root/www/index.html
deleted file mode 100644 (file)
index 575d242..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<HTML>
-<HEAD><TITLE>OpenWrt</TITLE></HEAD>
-<BODY>
-No webpages currently available
-<br>- perhaps you need to install a package?
-</BODY>
-</HTML>