build system cleanup. move shared include files into $(TOPDIR)/include, move lzma...
authorFelix Fietkau <nbd@openwrt.org>
Wed, 21 Jun 2006 02:16:37 +0000 (02:16 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 21 Jun 2006 02:16:37 +0000 (02:16 +0000)
SVN-Revision: 4032

92 files changed:
openwrt/include/image.mk [new file with mode: 0644]
openwrt/include/kernel-build.mk [new file with mode: 0644]
openwrt/include/kernel.mk [new file with mode: 0644]
openwrt/include/modules-2.4.mk [new file with mode: 0644]
openwrt/include/modules-2.6.mk [new file with mode: 0644]
openwrt/include/netfilter.mk [new file with mode: 0644]
openwrt/include/package.mk [new file with mode: 0644]
openwrt/package/alsa/Makefile
openwrt/package/base-files/Makefile
openwrt/package/bridge/Makefile
openwrt/package/broadcom-wl/Makefile
openwrt/package/busybox/Makefile
openwrt/package/diag/Makefile
openwrt/package/dnsmasq/Makefile
openwrt/package/dropbear/Makefile
openwrt/package/ebtables/Makefile
openwrt/package/fuse/Makefile
openwrt/package/haserl/Makefile
openwrt/package/hostap/Makefile
openwrt/package/hostapd/Makefile
openwrt/package/iproute2/Makefile
openwrt/package/ipsec-tools/Makefile
openwrt/package/ipset/Makefile
openwrt/package/iptables/Makefile
openwrt/package/kernel.mk [deleted file]
openwrt/package/libpcap/Makefile
openwrt/package/linux-atm/Makefile
openwrt/package/madwifi/Makefile
openwrt/package/mini_fo/Makefile
openwrt/package/mtd/Makefile
openwrt/package/nvram/Makefile
openwrt/package/openssl/Makefile
openwrt/package/openswan/Makefile
openwrt/package/pcmcia-cs/Makefile
openwrt/package/ppp/Makefile
openwrt/package/pptp/Makefile
openwrt/package/robocfg/Makefile
openwrt/package/rules.mk [deleted file]
openwrt/package/shfs/Makefile
openwrt/package/spca5xx/Makefile
openwrt/package/switch/Makefile
openwrt/package/udev/Makefile
openwrt/package/ueagle-atm/Makefile
openwrt/package/util-linux/Makefile
openwrt/package/wireless-tools/Makefile
openwrt/package/wlcompat/Makefile
openwrt/package/zd1211/Makefile
openwrt/package/zlib/Makefile
openwrt/target/Makefile
openwrt/target/linux/Config.in
openwrt/target/linux/Makefile
openwrt/target/linux/ar531x-2.4/Makefile
openwrt/target/linux/ar7-2.4/Makefile
openwrt/target/linux/aruba-2.6/Makefile
openwrt/target/linux/au1000-2.6/Makefile
openwrt/target/linux/brcm-2.4/Makefile
openwrt/target/linux/brcm-2.6/Makefile
openwrt/target/linux/generic-2.4/modules.mk [deleted file]
openwrt/target/linux/generic-2.6/modules.mk [deleted file]
openwrt/target/linux/image/ar7/Makefile
openwrt/target/linux/image/aruba/Makefile
openwrt/target/linux/image/au1000/Makefile
openwrt/target/linux/image/brcm/Makefile
openwrt/target/linux/image/generic/Makefile
openwrt/target/linux/image/image.mk [deleted file]
openwrt/target/linux/image/jffs2.mk [deleted file]
openwrt/target/linux/image/jffs2/Makefile [deleted file]
openwrt/target/linux/image/jffs2/patches/gcc4-fix.patch [deleted file]
openwrt/target/linux/image/rb532/Makefile
openwrt/target/linux/image/squashfs.mk [deleted file]
openwrt/target/linux/image/squashfs/Makefile [deleted file]
openwrt/target/linux/image/squashfs/patches/100-lzma.patch [deleted file]
openwrt/target/linux/image/tgz.mk [deleted file]
openwrt/target/linux/image/x86/Makefile
openwrt/target/linux/image/xscale/Makefile
openwrt/target/linux/kernel.mk [deleted file]
openwrt/target/linux/netfilter.mk [deleted file]
openwrt/target/linux/rb532-2.6/Makefile
openwrt/target/linux/rules.mk [deleted file]
openwrt/target/linux/sibyte-2.6/Makefile
openwrt/target/linux/x86-2.4/Makefile
openwrt/target/linux/x86-2.6/Makefile
openwrt/target/linux/xscale-2.6/Makefile
openwrt/target/lzma/Makefile [deleted file]
openwrt/target/lzma/lzma-zlib.patch [deleted file]
openwrt/toolchain/Makefile
openwrt/toolchain/jffs2/Makefile [new file with mode: 0644]
openwrt/toolchain/jffs2/patches/100-gcc4_fix.patch [new file with mode: 0644]
openwrt/toolchain/lzma/Makefile [new file with mode: 0644]
openwrt/toolchain/lzma/patches/100-lzma_zlib.patch [new file with mode: 0644]
openwrt/toolchain/squashfs/Makefile [new file with mode: 0644]
openwrt/toolchain/squashfs/patches/100-lzma.patch [new file with mode: 0644]

diff --git a/openwrt/include/image.mk b/openwrt/include/image.mk
new file mode 100644 (file)
index 0000000..f30f099
--- /dev/null
@@ -0,0 +1,77 @@
+include $(TOPDIR)/rules.mk
+
+KDIR:=$(BUILD_DIR)/linux-$(KERNEL)-$(BOARD)
+
+ifneq ($(CONFIG_BIG_ENDIAN),y)
+JFFS2OPTS     :=  --pad --little-endian --squash
+SQUASHFS_OPTS :=  -le
+else
+JFFS2OPTS     :=  --pad --big-endian --squash
+SQUASHFS_OPTS :=  -be
+endif
+
+ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
+  ifeq ($(CONFIG_TARGET_ROOTFS_JFFS2),y)
+    define Image/mkfs/jffs2
+               rm -rf $(BUILD_DIR)/root/jffs
+               
+               $(STAGING_DIR)/bin/mkfs.jffs2 $(JFFS2OPTS) -e 0x10000 -o $(KDIR)/root.jffs2-64k -d $(BUILD_DIR)/root
+               $(STAGING_DIR)/bin/mkfs.jffs2 $(JFFS2OPTS) -e 0x20000 -o $(KDIR)/root.jffs2-128k -d $(BUILD_DIR)/root
+       
+               $(call Image/Build,jffs2-64k)
+               $(call Image/Build,jffs2-128k)
+    endef
+  endif
+    
+  ifeq ($(CONFIG_TARGET_ROOTFS_SQUASHFS),y)
+    define Image/mkfs/squashfs
+               @mkdir -p $(BUILD_DIR)/root/jffs
+               $(STAGING_DIR)/bin/mksquashfs-lzma $(BUILD_DIR)/root $(KDIR)/root.squashfs -nopad -noappend -root-owned $(SQUASHFS_OPTS)
+               $(call Image/Build,squashfs)
+    endef
+  endif
+    
+  ifeq ($(CONFIG_TARGET_ROOTFS_TGZ),y)
+    define Image/mkfs/tgz
+               tar -zcf $(BIN_DIR)/openwrt-rootfs.tgz --owner=root --group=root -C $(BUILD_DIR)/root/ .
+    endef
+  endif
+endif
+
+define Image/mkfs/prepare/default
+       find $(BUILD_DIR)/root -type f -not -perm +0100 | xargs chmod 0644
+       find $(BUILD_DIR)/root -type f -perm +0100 | xargs chmod 0755
+       find $(BUILD_DIR)/root -type d | xargs chmod 0755
+       mkdir -p $(BUILD_DIR)/root/tmp
+       chmod 0777 $(BUILD_DIR)/root/tmp
+endef
+
+define Image/mkfs/prepare
+       $(call Image/mkfs/prepare/default)
+endef
+
+define BuildImage
+compile:
+       $(call Build/Compile)
+
+install:
+       $(call Image/Prepare)
+       $(call Image/mkfs/prepare)
+       $(call Image/BuildKernel)
+       $(call Image/mkfs/jffs2)
+       $(call Image/mkfs/squashfs)
+       $(call Image/mkfs/tgz)
+       
+clean:
+       $(call Build/Clean)
+endef
+
+compile-targets:
+install-targets:
+clean-targets:
+
+source:
+prepare:
+compile: compile-targets
+install: compile install-targets
+clean: clean-targets
diff --git a/openwrt/include/kernel-build.mk b/openwrt/include/kernel-build.mk
new file mode 100644 (file)
index 0000000..9fbbe45
--- /dev/null
@@ -0,0 +1,125 @@
+include $(TOPDIR)/include/modules-$(KERNEL).mk
+
+LINUX_SOURCE:=linux-$(LINUX_VERSION).tar.bz2
+LINUX_SITE=http://www.us.kernel.org/pub/linux/kernel/v$(KERNEL) \
+           http://www.us.kernel.org/pub/linux/kernel/v$(KERNEL) \
+           http://www.kernel.org/pub/linux/kernel/v$(KERNEL) \
+           http://www.de.kernel.org/pub/linux/kernel/v$(KERNEL)
+
+KERNEL_IDIR:=$(KERNEL_BUILD_DIR)/kernel-ipkg
+KERNEL_IPKG:=$(KERNEL_BUILD_DIR)/kernel_$(LINUX_VERSION)-$(BOARD)-$(LINUX_RELEASE)_$(ARCH).ipk
+INSTALL_TARGETS += $(KERNEL_IPKG)
+
+$(TARGETS): $(PACKAGE_DIR)
+
+$(LINUX_DIR):
+       mkdir -p $@
+
+$(PACKAGE_DIR):
+       mkdir -p $@
+
+$(DL_DIR)/$(LINUX_SOURCE):
+       -mkdir -p $(DL_DIR)
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(LINUX_SOURCE) $(LINUX_KERNEL_MD5SUM) $(LINUX_SITE)
+
+$(LINUX_DIR)/.unpacked: $(DL_DIR)/$(LINUX_SOURCE)
+       -mkdir -p $(KERNEL_BUILD_DIR)
+       bzcat $(DL_DIR)/$(LINUX_SOURCE) | tar -C $(KERNEL_BUILD_DIR) $(TAR_OPTIONS) -
+       touch $@
+
+ifeq ($(KERNEL),2.4)
+$(LINUX_DIR)/.configured: $(LINUX_DIR)/.patched
+       $(SED) "s,^CROSS_COMPILE.*,CROSS_COMPILE=$(KERNEL_CROSS),g;" \
+         $(LINUX_DIR)/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/compile.h include/linux/version.h
+       touch $@
+
+$(LINUX_DIR)/.depend_done: $(LINUX_DIR)/.configured
+       $(MAKE) -C $(LINUX_DIR) CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(LINUX_KARCH) dep
+       touch $@
+
+$(LINUX_DIR)/vmlinux: $(LINUX_DIR)/.depend_done
+else
+$(LINUX_DIR)/.configured: $(LINUX_DIR)/.patched
+       $(MAKE) -C $(LINUX_DIR) CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(LINUX_KARCH) oldconfig prepare scripts
+       touch $@
+endif
+
+ramdisk-config: $(LINUX_DIR)/.configured FORCE
+       mv $(LINUX_DIR)/.config $(LINUX_DIR)/.config.old
+       grep -v INITRAMFS $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config
+ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
+       echo 'CONFIG_INITRAMFS_SOURCE="../../root"' >> $(LINUX_DIR)/.config
+       echo 'CONFIG_INITRAMFS_ROOT_UID=0' >> $(LINUX_DIR)/.config
+       echo 'CONFIG_INITRAMFS_ROOT_GID=0' >> $(LINUX_DIR)/.config
+       mkdir -p $(BUILD_DIR)/root/etc/init.d
+       $(CP) ../generic-2.6/files/init $(BUILD_DIR)/root/
+else
+       rm -f $(BUILD_DIR)/root/init $(BUILD_DIR)/root/etc/init.d/S00initramfs
+       echo 'CONFIG_INITRAMFS_SOURCE=""' >> $(LINUX_DIR)/.config
+endif
+
+$(LINUX_DIR)/vmlinux: $(STAMP_DIR)/.linux-compile pkg-install ramdisk-config
+       $(MAKE) -C $(LINUX_DIR) CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(LINUX_KARCH) PATH=$(TARGET_PATH)
+
+$(LINUX_KERNEL): $(LINUX_DIR)/vmlinux
+       $(TARGET_CROSS)objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S $< $@
+       touch -c $(LINUX_KERNEL)
+
+$(LINUX_DIR)/.modules_done:
+       rm -rf $(KERNEL_BUILD_DIR)/modules
+       $(MAKE) -C "$(LINUX_DIR)" CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(LINUX_KARCH) PATH="$(TARGET_PATH)" modules
+       $(MAKE) -C "$(LINUX_DIR)" CROSS_COMPILE="$(KERNEL_CROSS)" DEPMOD=true INSTALL_MOD_PATH=$(KERNEL_BUILD_DIR)/modules modules_install
+       touch $(LINUX_DIR)/.modules_done
+
+$(STAMP_DIR)/.linux-compile:
+       @$(MAKE) $(LINUX_DIR)/.modules_done $(TARGETS) $(KERNEL_IPKG)
+       ln -sf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) $(BUILD_DIR)/linux
+       touch $@
+
+$(KERNEL_IPKG):
+       rm -rf $(KERNEL_IDIR)
+       mkdir -p $(KERNEL_IDIR)/etc
+       $(SCRIPT_DIR)/make-ipkg-dir.sh $(KERNEL_IDIR) ../control/kernel.control $(LINUX_VERSION)-$(BOARD)-$(LINUX_RELEASE) $(ARCH)
+       if [ -f ./config/$(BOARD).modules ]; then \
+               cp ./config/$(BOARD).modules $(KERNEL_IDIR)/etc/modules; \
+       fi
+       $(IPKG_BUILD) $(KERNEL_IDIR) $(KERNEL_BUILD_DIR)
+
+$(TOPDIR)/.kernel.mk:
+       echo "BOARD:=$(BOARD)" > $@
+       echo "LINUX_VERSION:=$(LINUX_VERSION)" >> $@
+       echo "LINUX_RELEASE:=$(LINUX_RELEASE)" >> $@
+
+pkg-install: FORCE
+       @{ [ "$(INSTALL_TARGETS)" != "" ] && $(IPKG) install $(INSTALL_TARGETS) || true; }
+
+source: $(DL_DIR)/$(LINUX_SOURCE)
+prepare:
+       @mkdir -p $(STAMP_DIR) $(PACKAGE_DIR)
+       @$(MAKE) $(LINUX_DIR)/.configured
+
+compile: prepare $(STAMP_DIR)/.linux-compile
+
+install: compile $(LINUX_KERNEL)
+
+mostlyclean: FORCE
+       rm -f $(STAMP_DIR)/.linux-compile
+       rm -f $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/.modules_done
+       rm -f $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/.drivers-unpacked
+       $(MAKE) -C $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) clean
+       rm -f $(LINUX_KERNEL)
+
+rebuild: FORCE
+       -$(MAKE) mostlyclean
+       if [ -f $(LINUX_KERNEL) ]; then \
+               $(MAKE) clean; \
+       fi
+       $(MAKE) compile $(MAKE_TRACE)
+
+clean: FORCE
+       rm -f $(STAMP_DIR)/.linux-compile
+       rm -rf $(KERNEL_BUILD_DIR)
+       rm -f $(TARGETS)
diff --git a/openwrt/include/kernel.mk b/openwrt/include/kernel.mk
new file mode 100644 (file)
index 0000000..5c64ee4
--- /dev/null
@@ -0,0 +1,77 @@
+ifneq ($(DUMP),1)
+include $(TOPDIR)/.kernel.mk
+
+KERNEL:=unknown
+ifneq (,$(findstring 2.4.,$(LINUX_VERSION)))
+KERNEL:=2.4
+LINUX_KMOD_SUFFIX=o
+endif
+ifneq (,$(findstring 2.6.,$(LINUX_VERSION)))
+KERNEL:=2.6
+LINUX_KMOD_SUFFIX=ko
+endif
+
+LINUX_KARCH:=$(shell echo $(ARCH) | sed -e 's/i[3-9]86/i386/' \
+       -e 's/mipsel/mips/' \
+       -e 's/mipseb/mips/' \
+       -e 's/powerpc/ppc/' \
+       -e 's/sh[234]/sh/' \
+       -e 's/armeb/arm/' \
+)
+
+KERNEL_BUILD_DIR:=$(BUILD_DIR)/linux-$(KERNEL)-$(BOARD)
+LINUX_DIR := $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
+
+MODULES_SUBDIR:=lib/modules/$(LINUX_VERSION)
+MODULES_DIR := $(KERNEL_BUILD_DIR)/modules/$(MODULES_SUBDIR)
+TARGET_MODULES_DIR := $(LINUX_TARGET_DIR)/$(MODULES_SUBDIR)
+KMOD_BUILD_DIR := $(KERNEL_BUILD_DIR)/linux-modules
+
+LINUX_KERNEL:=$(KERNEL_BUILD_DIR)/vmlinux
+endif
+
+# FIXME: remove this crap
+define KMOD_template
+ifeq ($$(strip $(4)),)
+KDEPEND_$(1):=m
+else
+KDEPEND_$(1):=$($(4))
+endif
+
+IDEPEND_$(1):=kernel ($(LINUX_VERSION)-$(BOARD)-$(LINUX_RELEASE)) $(foreach pkg,$(5),", $(pkg)")
+
+PKG_$(1) := $(PACKAGE_DIR)/kmod-$(2)_$(LINUX_VERSION)-$(BOARD)-$(LINUX_RELEASE)_$(ARCH).ipk
+I_$(1) := $(KMOD_BUILD_DIR)/ipkg/$(2)
+
+ifeq ($$(KDEPEND_$(1)),m)
+ifneq ($(CONFIG_PACKAGE_KMOD_$(1)),)
+TARGETS += $$(PKG_$(1))
+endif
+ifeq ($(CONFIG_PACKAGE_KMOD_$(1)),y)
+INSTALL_TARGETS += $$(PKG_$(1))
+endif
+endif
+
+$$(PKG_$(1)): $(LINUX_DIR)/.modules_done
+       rm -rf $$(I_$(1))
+       $(SCRIPT_DIR)/make-ipkg-dir.sh $$(I_$(1)) ../control/kmod-$(2).control $(LINUX_VERSION)-$(BOARD)-$(LINUX_RELEASE) $(ARCH)
+       echo "Depends: $$(IDEPEND_$(1))" >> $$(I_$(1))/CONTROL/control
+ifneq ($(strip $(3)),)
+       mkdir -p $$(I_$(1))/lib/modules/$(LINUX_VERSION)
+       $(CP) $(3) $$(I_$(1))/lib/modules/$(LINUX_VERSION)
+endif
+ifneq ($(6),)
+       mkdir -p $$(I_$(1))/etc/modules.d
+       for module in $(7); do \
+               echo $$$$module >> $$(I_$(1))/etc/modules.d/$(6)-$(2); \
+       done
+       echo "#!/bin/sh" >> $$(I_$(1))/CONTROL/postinst
+       echo "[ -z \"\$$$$IPKG_INSTROOT\" ] || exit" >> $$(I_$(1))/CONTROL/postinst
+       echo ". /etc/functions.sh" >> $$(I_$(1))/CONTROL/postinst
+       echo "load_modules /etc/modules.d/$(6)-$(2)" >> $$(I_$(1))/CONTROL/postinst
+       chmod 0755 $$(I_$(1))/CONTROL/postinst
+endif
+       $(8)
+       $(IPKG_BUILD) $$(I_$(1)) $(PACKAGE_DIR)
+endef
+
diff --git a/openwrt/include/modules-2.4.mk b/openwrt/include/modules-2.4.mk
new file mode 100644 (file)
index 0000000..71864ad
--- /dev/null
@@ -0,0 +1,320 @@
+include $(TOPDIR)/include/netfilter.mk
+
+# Networking
+
+$(eval $(call KMOD_template,ATM,atm,\
+       $(MODULES_DIR)/kernel/net/atm/atm.o \
+       $(MODULES_DIR)/kernel/net/atm/br2684.o \
+,CONFIG_ATM,,50,atm))
+
+$(eval $(call KMOD_template,GRE,gre,\
+       $(MODULES_DIR)/kernel/net/ipv4/ip_gre.o \
+,CONFIG_NET_IPGRE))
+
+$(eval $(call KMOD_template,IMQ,imq,\
+       $(MODULES_DIR)/kernel/net/ipv4/netfilter/*IMQ*.o \
+       $(MODULES_DIR)/kernel/drivers/net/imq.o \
+))
+$(eval $(call KMOD_template,IPIP,ipip,\
+       $(MODULES_DIR)/kernel/net/ipv4/ipip.o \
+,CONFIG_NET_IPIP,,60,ipip))
+
+$(eval $(call KMOD_template,IPV6,ipv6,\
+       $(MODULES_DIR)/kernel/net/ipv6/ipv6.o \
+,CONFIG_IPV6,,20,ipv6))
+
+$(eval $(call KMOD_template,PPP,ppp,\
+       $(MODULES_DIR)/kernel/drivers/net/ppp_async.o \
+       $(MODULES_DIR)/kernel/drivers/net/ppp_generic.o \
+       $(MODULES_DIR)/kernel/drivers/net/slhc.o \
+       $(MODULES_DIR)/kernel/drivers/net/pppox.o \
+,CONFIG_PPP))
+
+$(eval $(call KMOD_template,MPPE,mppe,\
+       $(MODULES_DIR)/kernel/drivers/net/ppp_mppe_mppc.o \
+,CONFIG_PPP_MPPE_MPPC))
+
+$(eval $(call KMOD_template,PPPOATM,pppoatm,\
+       $(MODULES_DIR)/kernel/net/atm/pppoatm.o \
+,CONFIG_PPPOATM))
+
+$(eval $(call KMOD_template,PPPOE,pppoe,\
+       $(MODULES_DIR)/kernel/drivers/net/pppoe.o \
+,CONFIG_PPPOE))
+
+$(eval $(call KMOD_template,SCHED,sched,\
+       $(MODULES_DIR)/kernel/net/sched/*.o \
+))
+
+$(eval $(call KMOD_template,TUN,tun,\
+       $(MODULES_DIR)/kernel/drivers/net/tun.o \
+,CONFIG_TUN,,20,tun))
+
+# Filtering / Firewalling
+
+$(eval $(call KMOD_template,ARPTABLES,arptables,\
+       $(MODULES_DIR)/kernel/net/ipv4/netfilter/arp*.o \
+,CONFIG_IP_NF_ARPTABLES))
+
+$(eval $(call KMOD_template,EBTABLES,ebtables,\
+       $(MODULES_DIR)/kernel/net/bridge/netfilter/*.o \
+,CONFIG_BRIDGE_NF_EBTABLES))
+
+# metapackage for compatibility ...
+$(eval $(call KMOD_template,IPTABLES_EXTRA,iptables-extra,\
+,,kmod-ipt-conntrack kmod-ipt-extra kmod-ipt-filter kmod-ipt-ipopt kmod-ipt-ipsec kmod-ipt-nat kmod-ipt-nat-extra kmod-ipt-queue kmod-ipt-ulogd))
+
+$(eval $(call KMOD_template,IPT_CONNTRACK,ipt-conntrack,\
+       $(foreach mod,$(IPT_CONNTRACK-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).o) \
+))
+
+$(eval $(call KMOD_template,IPT_EXTRA,ipt-extra,\
+       $(foreach mod,$(IPT_EXTRA-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).o) \
+))
+
+$(eval $(call KMOD_template,IPT_FILTER,ipt-filter,\
+       $(foreach mod,$(IPT_FILTER-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).o) \
+))
+
+$(eval $(call KMOD_template,IPT_IPOPT,ipt-ipopt,\
+       $(foreach mod,$(IPT_IPOPT-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).o) \
+))
+
+$(eval $(call KMOD_template,IPT_IPSEC,ipt-ipsec,\
+       $(foreach mod,$(IPT_IPSEC-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).o) \
+))
+
+$(eval $(call KMOD_template,IPT_NAT,ipt-nat,\
+       $(foreach mod,$(IPT_NAT-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).o) \
+))
+
+$(eval $(call KMOD_template,IPT_NAT_EXTRA,ipt-nat-extra,\
+       $(foreach mod,$(IPT_NAT_EXTRA-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).o) \
+,,,40,$(IPT_NAT_EXTRA-m)))
+
+$(eval $(call KMOD_template,IPT_QUEUE,ipt-queue,\
+       $(foreach mod,$(IPT_QUEUE-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).o) \
+))
+
+$(eval $(call KMOD_template,IPT_ULOG,ipt-ulog,\
+       $(foreach mod,$(IPT_ULOG-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).o) \
+))
+
+$(eval $(call KMOD_template,IP6TABLES,ip6tables,\
+       $(MODULES_DIR)/kernel/net/ipv6/netfilter/ip*.o \
+,CONFIG_IP6_NF_IPTABLES,kmod-ipv6))
+
+
+# Block devices
+
+$(eval $(call KMOD_template,IDE,ide,\
+       $(MODULES_DIR)/kernel/drivers/ide/*.o \
+       $(MODULES_DIR)/kernel/drivers/ide/*/*.o \
+,CONFIG_IDE,,20,pdc202xx_old ide-core ide-detect ide-disk))
+
+$(eval $(call KMOD_template,LOOP,loop,\
+    $(MODULES_DIR)/kernel/drivers/block/loop.o \
+,CONFIG_BLK_DEV_LOOP,,20,loop))
+
+$(eval $(call KMOD_template,NBD,nbd,\
+    $(MODULES_DIR)/kernel/drivers/block/nbd.o \
+,CONFIG_BLK_DEV_NBD,,20,nbd))
+
+
+# Crypto
+
+ifneq ($(wildcard $(MODULES_DIR)/kernel/crypto/*.o),)
+CONFIG_CRYPTO:=m
+endif
+$(eval $(call KMOD_template,CRYPTO,crypto,\
+       $(MODULES_DIR)/kernel/crypto/*.o \
+,CONFIG_CRYPTO))
+
+
+# Filesystems
+
+$(eval $(call KMOD_template,FS_CIFS,fs-cifs,\
+       $(MODULES_DIR)/kernel/fs/cifs/cifs.o \
+,CONFIG_CIFS,,30,cifs))
+
+$(eval $(call KMOD_template,FS_MINIX,fs-minix,\
+       $(MODULES_DIR)/kernel/fs/minix/*.o \
+,CONFIG_MINIX_FS,,30,minix))
+
+$(eval $(call KMOD_template,FS_EXT2,fs-ext2,\
+       $(MODULES_DIR)/kernel/fs/ext2/*.o \
+,CONFIG_EXT2_FS,,30,ext2))
+
+$(eval $(call KMOD_template,FS_EXT3,fs-ext3,\
+       $(MODULES_DIR)/kernel/fs/ext3/*.o \
+       $(MODULES_DIR)/kernel/fs/jbd/*.o \
+,CONFIG_EXT3_FS,,30,jbd ext3))
+
+$(eval $(call KMOD_template,FS_HFSPLUS,fs-hfsplus,\
+       $(MODULES_DIR)/kernel/fs/hfsplus/*.o \
+,CONFIG_HFSPLUS_FS,,30,hfsplus))
+
+$(eval $(call KMOD_template,FS_NFS,fs-nfs,\
+       $(MODULES_DIR)/kernel/fs/lockd/*.o \
+       $(MODULES_DIR)/kernel/fs/nfs/*.o \
+       $(MODULES_DIR)/kernel/net/sunrpc/*.o \
+,CONFIG_NFS_FS,,30,sunrpc lockd nfs))
+
+$(eval $(call KMOD_template,FS_VFAT,fs-vfat,\
+       $(MODULES_DIR)/kernel/fs/vfat/vfat.o \
+       $(MODULES_DIR)/kernel/fs/fat/fat.o \
+,CONFIG_VFAT_FS,,30,fat vfat))
+
+$(eval $(call KMOD_template,FS_XFS,fs-xfs,\
+       $(MODULES_DIR)/kernel/fs/xfs/*.o \
+,CONFIG_XFS_FS,,30,xfs))
+
+
+# Multimedia
+
+$(eval $(call KMOD_template,PWC,pwc,\
+       $(MODULES_DIR)/kernel/drivers/usb/pwc.o \
+,CONFIG_USB_PWC,kmod-videodev,63,pwc))
+
+$(eval $(call KMOD_template,SOUNDCORE,soundcore,\
+       $(MODULES_DIR)/kernel/drivers/sound/soundcore.o \
+,CONFIG_SOUND,,30,soundcore))
+
+$(eval $(call KMOD_template,VIDEODEV,videodev,\
+       $(MODULES_DIR)/kernel/drivers/media/video/videodev.o \
+,CONFIG_VIDEO_DEV,,62,videodev))
+
+
+# Network devices
+
+$(eval $(call KMOD_template,NET_3C59X,net-3c59x,\
+       $(MODULES_DIR)/kernel/drivers/net/3c59x.o \
+,CONFIG_VORTEX,,10,3c59x))
+
+$(eval $(call KMOD_template,NET_8139TOO,net-8139too,\
+       $(MODULES_DIR)/kernel/drivers/net/8139too.o \
+       $(MODULES_DIR)/kernel/drivers/net/mii.o \
+,CONFIG_8139TOO,,10,mii 8139too))
+
+$(eval $(call KMOD_template,NET_AIRO,net-airo,\
+       $(MODULES_DIR)/kernel/drivers/net/wireless/airo.o \
+,CONFIG_AIRO,,10,airo))
+
+$(eval $(call KMOD_template,NET_E100,net-e100,\
+       $(MODULES_DIR)/kernel/drivers/net/e100.o \
+,CONFIG_E100,,10,e100))
+
+$(eval $(call KMOD_template,NET_HERMES,net-hermes,\
+       $(MODULES_DIR)/kernel/drivers/net/wireless/hermes.o \
+       $(MODULES_DIR)/kernel/drivers/net/wireless/orinoco.o \
+,CONFIG_HERMES,,10,hermes orinoco))
+
+$(eval $(call KMOD_template,NET_HERMES_PCI,net-hermes-pci,\
+       $(MODULES_DIR)/kernel/drivers/net/wireless/orinoco_pci.o \
+,CONFIG_PCI_HERMES,kmod-net-hermes,11,orinoco_pci))
+
+$(eval $(call KMOD_template,NET_HERMES_PCI,net-hermes-plx,\
+       $(MODULES_DIR)/kernel/drivers/net/wireless/orinoco_plx.o \
+,CONFIG_PLX_HERMES,kmod-net-hermes,11,orinoco_plx))
+
+$(eval $(call KMOD_template,NET_NATSEMI,net-natsemi,\
+       $(MODULES_DIR)/kernel/drivers/net/natsemi.o \
+,CONFIG_NATSEMI,,10,natsemi))
+
+$(eval $(call KMOD_template,NET_PRISM54,net-prism54,\
+       $(MODULES_DIR)/kernel/drivers/net/wireless/prism54/prism54.o \
+,CONFIG_PRISM54,,10,prism54))
+
+
+# PCMCIA/CardBus
+
+$(eval $(call KMOD_template,PCMCIA_CORE,pcmcia-core,\
+       $(MODULES_DIR)/kernel/drivers/pcmcia/pcmcia_core.o \
+       $(MODULES_DIR)/kernel/drivers/pcmcia/yenta_socket.o \
+       $(MODULES_DIR)/kernel/drivers/pcmcia/ds.o \
+,CONFIG_PCMCIA,,50,pcmcia_core yenta_socket ds))
+
+$(eval $(call KMOD_template,PCMCIA_SERIAL,pcmcia-serial,\
+       $(MODULES_DIR)/kernel/drivers/char/pcmcia/serial_cs.o \
+,CONFIG_PCMCIA_SERIAL_CS,kmod-pcmcia-core,51,serial_cs))
+
+
+# USB
+
+$(eval $(call KMOD_template,USB,usb-core,\
+       $(MODULES_DIR)/kernel/drivers/usb/usbcore.o \
+,CONFIG_USB,,50,usbcore))
+
+$(eval $(call KMOD_template,USB_OHCI,usb-ohci,\
+       $(MODULES_DIR)/kernel/drivers/usb/host/usb-ohci.o \
+,CONFIG_USB_OHCI,kmod-usb-core,60,usb-ohci))
+
+$(eval $(call KMOD_template,USB_UHCI,usb-uhci,\
+       $(MODULES_DIR)/kernel/drivers/usb/host/uhci.o \
+,CONFIG_USB_UHCI_ALT,kmod-usb-core,60,uhci))
+
+$(eval $(call KMOD_template,USB2,usb2,\
+       $(MODULES_DIR)/kernel/drivers/usb/host/ehci-hcd.o \
+,CONFIG_USB_EHCI_HCD,kmod-usb-core,60,ehci-hcd))
+
+$(eval $(call KMOD_template,USB_ACM,usb-acm,\
+       $(MODULES_DIR)/kernel/drivers/usb/acm.o \
+,CONFIG_USB_ACM))
+
+$(eval $(call KMOD_template,USB_AUDIO,usb-audio,\
+       $(MODULES_DIR)/kernel/drivers/usb/audio.o \
+,CONFIG_USB_AUDIO,kmod-soundcore kmod-usb-core,61,audio))
+
+$(eval $(call KMOD_template,USB_PRINTER,usb-printer,\
+       $(MODULES_DIR)/kernel/drivers/usb/printer.o \
+,CONFIG_USB_PRINTER,kmod-usb-core,60,printer))
+
+$(eval $(call KMOD_template,USB_SERIAL,usb-serial,\
+       $(MODULES_DIR)/kernel/drivers/usb/serial/usbserial.o \
+,CONFIG_USB_SERIAL,kmod-usb-core,60,usbserial))
+
+$(eval $(call KMOD_template,USB_SERIAL_BELKIN,usb-serial-belkin,\
+       $(MODULES_DIR)/kernel/drivers/usb/serial/belkin_sa.o \
+,CONFIG_USB_SERIAL_BELKIN,kmod-usb-serial,61,belkin_sa))
+
+$(eval $(call KMOD_template,USB_SERIAL_FTDI,usb-serial-ftdi,\
+       $(MODULES_DIR)/kernel/drivers/usb/serial/ftdi_sio.o \
+,CONFIG_USB_SERIAL_FTDI_SIO,kmod-usb-serial,61,ftdi_sio))
+
+$(eval $(call KMOD_template,USB_SERIAL_MCT_U232,usb-serial-mct-u232,\
+       $(MODULES_DIR)/kernel/drivers/usb/serial/mct_u232.o \
+,CONFIG_USB_SERIAL_MCT_U232,kmod-usb-serial,61,mct_u232))
+
+$(eval $(call KMOD_template,USB_SERIAL_PL2303,usb-serial-pl2303,\
+       $(MODULES_DIR)/kernel/drivers/usb/serial/pl2303.o \
+,CONFIG_USB_SERIAL_PL2303,kmod-usb-serial,61,pl2303))
+
+$(eval $(call KMOD_template,USB_SERIAL_VISOR,usb-serial-visor,\
+       $(MODULES_DIR)/kernel/drivers/usb/serial/visor.o \
+,CONFIG_USB_SERIAL_VISOR,kmod-usb-serial,61,visor))
+
+$(eval $(call KMOD_template,USB_STORAGE,usb-storage,\
+       $(MODULES_DIR)/kernel/drivers/scsi/*.o \
+       $(MODULES_DIR)/kernel/drivers/usb/storage/*.o \
+,CONFIG_USB_STORAGE,kmod-usb-core,60,scsi_mod sd_mod usb-storage))
+
+
+# Misc. devices
+
+$(eval $(call KMOD_template,AX25,ax25,\
+       $(MODULES_DIR)/kernel/net/ax25/ax25.o \
+       $(MODULES_DIR)/kernel/drivers/net/hamradio/mkiss.o \
+,CONFIG_AX25,,90,ax25 mkiss))
+
+$(eval $(call KMOD_template,BLUETOOTH,bluetooth,\
+       $(MODULES_DIR)/kernel/net/bluetooth/*.o \
+       $(MODULES_DIR)/kernel/net/bluetooth/rfcomm/*.o \
+       $(MODULES_DIR)/kernel/drivers/bluetooth/*.o \
+,CONFIG_BLUEZ))
+
+$(eval $(call KMOD_template,SOFTDOG,softdog,\
+       $(MODULES_DIR)/kernel/drivers/char/softdog.o \
+,CONFIG_SOFT_WATCHDOG,,95,softdog))
+
+
+
diff --git a/openwrt/include/modules-2.6.mk b/openwrt/include/modules-2.6.mk
new file mode 100644 (file)
index 0000000..ec9f5da
--- /dev/null
@@ -0,0 +1,357 @@
+NF_2_6:=1
+include $(TOPDIR)/include/netfilter.mk
+
+# Networking
+
+$(eval $(call KMOD_template,ATM,atm,\
+       $(MODULES_DIR)/kernel/net/atm/atm.ko \
+       $(MODULES_DIR)/kernel/net/atm/br2684.ko \
+       $(MODULES_DIR)/kernel/drivers/atm/atmtcp.ko \
+,CONFIG_ATM,,50,atm))
+
+$(eval $(call KMOD_template,GRE,gre,\
+       $(MODULES_DIR)/kernel/net/ipv4/ip_gre.ko \
+,CONFIG_NET_IPGRE))
+
+$(eval $(call KMOD_template,IMQ,imq,\
+       $(MODULES_DIR)/kernel/net/ipv4/netfilter/*IMQ*.ko \
+       $(MODULES_DIR)/kernel/drivers/net/imq.ko \
+))
+
+$(eval $(call KMOD_template,IPIP,ipip,\
+       $(MODULES_DIR)/kernel/net/ipv4/ipip.ko \
+,CONFIG_NET_IPIP,,60,ipip))
+
+$(eval $(call KMOD_template,IPV6,ipv6,\
+       $(MODULES_DIR)/kernel/net/ipv6/ipv6.ko \
+,CONFIG_IPV6,,20,ipv6))
+
+$(eval $(call KMOD_template,PPP,ppp,\
+       $(MODULES_DIR)/kernel/drivers/net/ppp_async.ko \
+       $(MODULES_DIR)/kernel/drivers/net/ppp_generic.ko \
+       $(MODULES_DIR)/kernel/drivers/net/slhc.ko \
+       $(MODULES_DIR)/kernel/lib/crc-ccitt.ko \
+,CONFIG_PPP))
+
+#$(eval $(call KMOD_template,MPPE,mppe,\
+#      $(MODULES_DIR)/kernel/drivers/net/ppp_mppe_mppc.ko \
+#,CONFIG_PPP_MPPE_MPPC))
+
+$(eval $(call KMOD_template,PPPOATM,pppoatm,\
+       $(MODULES_DIR)/kernel/net/atm/pppoatm.ko \
+,CONFIG_PPPOATM))
+
+$(eval $(call KMOD_template,PPPOE,pppoe,\
+       $(MODULES_DIR)/kernel/drivers/net/pppoe.ko \
+       $(MODULES_DIR)/kernel/drivers/net/pppox.ko \
+,CONFIG_PPPOE))
+
+$(eval $(call KMOD_template,SCHED,sched,\
+       $(MODULES_DIR)/kernel/net/sched/*.ko \
+))
+
+$(eval $(call KMOD_template,TUN,tun,\
+       $(MODULES_DIR)/kernel/drivers/net/tun.ko \
+,CONFIG_TUN,,20,tun))
+
+
+# Filtering / Firewalling
+
+$(eval $(call KMOD_template,ARPTABLES,arptables,\
+       $(MODULES_DIR)/kernel/net/ipv4/netfilter/arp*.ko \
+,CONFIG_IP_NF_ARPTABLES))
+
+$(eval $(call KMOD_template,EBTABLES,ebtables,\
+       $(MODULES_DIR)/kernel/net/bridge/netfilter/*.ko \
+,CONFIG_BRIDGE_NF_EBTABLES))
+
+# metapackage for compatibility ...
+$(eval $(call KMOD_template,IPTABLES_EXTRA,iptables-extra,\
+,,kmod-ipt-conntrack kmod-ipt-extra kmod-ipt-filter kmod-ipt-ipopt kmod-ipt-ipsec kmod-ipt-nat kmod-ipt-nat-extra kmod-ipt-queue kmod-ipt-ulogd))
+
+$(eval $(call KMOD_template,IPT_CONNTRACK,ipt-conntrack,\
+       $(foreach mod,$(IPT_CONNTRACK-m),$(MODULES_DIR)/kernel/net/$(mod).ko) \
+))
+
+$(eval $(call KMOD_template,IPT_EXTRA,ipt-extra,\
+       $(foreach mod,$(IPT_EXTRA-m),$(MODULES_DIR)/kernel/net/$(mod).ko) \
+))
+
+$(eval $(call KMOD_template,IPT_FILTER,ipt-filter,\
+       $(foreach mod,$(IPT_FILTER-m),$(MODULES_DIR)/kernel/net/$(mod).ko) \
+))
+
+$(eval $(call KMOD_template,IPT_IPOPT,ipt-ipopt,\
+       $(foreach mod,$(IPT_IPOPT-m),$(MODULES_DIR)/kernel/net/$(mod).ko) \
+))
+
+$(eval $(call KMOD_template,IPT_IPSEC,ipt-ipsec,\
+       $(foreach mod,$(IPT_IPSEC-m),$(MODULES_DIR)/kernel/net/$(mod).ko) \
+))
+
+$(eval $(call KMOD_template,IPT_NAT,ipt-nat,\
+       $(foreach mod,$(IPT_NAT-m),$(MODULES_DIR)/kernel/net/$(mod).ko) \
+))
+
+$(eval $(call KMOD_template,IPT_NAT_EXTRA,ipt-nat-extra,\
+       $(foreach mod,$(IPT_NAT_EXTRA-m),$(MODULES_DIR)/kernel/net/$(mod).ko) \
+,,,40,$(IPT_NAT_EXTRA-m)))
+
+$(eval $(call KMOD_template,IPT_QUEUE,ipt-queue,\
+       $(foreach mod,$(IPT_QUEUE-m),$(MODULES_DIR)/kernel/net/$(mod).ko) \
+))
+
+$(eval $(call KMOD_template,IPT_ULOG,ipt-ulog,\
+       $(foreach mod,$(IPT_ULOG-m),$(MODULES_DIR)/kernel/net/$(mod).ko) \
+))
+
+$(eval $(call KMOD_template,IP6TABLES,ip6tables,\
+       $(MODULES_DIR)/kernel/net/ipv6/netfilter/ip*.ko \
+,CONFIG_IP6_NF_IPTABLES,kmod-ipv6))
+
+
+# Block devices
+
+$(eval $(call KMOD_template,IDE,ide,\
+       $(MODULES_DIR)/kernel/drivers/ide/*.ko \
+       $(MODULES_DIR)/kernel/drivers/ide/*/*.ko \
+,CONFIG_IDE))
+
+$(eval $(call KMOD_template,LOOP,loop,\
+    $(MODULES_DIR)/kernel/drivers/block/loop.ko \
+,CONFIG_BLK_DEV_LOOP,,20,loop))
+
+$(eval $(call KMOD_template,NBD,nbd,\
+    $(MODULES_DIR)/kernel/drivers/block/nbd.ko \
+,CONFIG_BLK_DEV_NBD,,20,nbd))
+
+
+# Crypto
+
+$(eval $(call KMOD_template,CRYPTO,crypto,\
+       $(MODULES_DIR)/kernel/crypto/*.ko \
+))
+
+
+# Filesystems
+
+$(eval $(call KMOD_template,FS_CIFS,fs-cifs,\
+       $(MODULES_DIR)/kernel/fs/cifs/cifs.ko \
+,CONFIG_CIFS,kmod-nls-base,30,cifs))
+
+$(eval $(call KMOD_template,FS_MINIX,fs-minix,\
+       $(MODULES_DIR)/kernel/fs/minix/minix.ko \
+,CONFIG_MINIX_FS,,30,minix))
+
+$(eval $(call KMOD_template,FS_EXT2,fs-ext2,\
+       $(MODULES_DIR)/kernel/fs/ext2/ext2.ko \
+,CONFIG_EXT2_FS,,30,ext2))
+
+$(eval $(call KMOD_template,FS_EXT3,fs-ext3,\
+       $(MODULES_DIR)/kernel/fs/ext3/ext3.ko \
+       $(MODULES_DIR)/kernel/fs/jbd/jbd.ko \
+,CONFIG_EXT3_FS,,30,jbd ext3))
+
+$(eval $(call KMOD_template,FS_HFSPLUS,fs-hfsplus,\
+       $(MODULES_DIR)/kernel/fs/hfsplus/hfsplus.ko \
+,CONFIG_HFSPLUS_FS,kmod-nls-base,30,hfsplus))
+
+$(eval $(call KMOD_template,FS_NFS,fs-nfs,\
+       $(MODULES_DIR)/kernel/fs/lockd/lockd.ko \
+       $(MODULES_DIR)/kernel/fs/nfs/nfs.ko \
+       $(MODULES_DIR)/kernel/net/sunrpc/sunrpc.ko \
+,CONFIG_NFS_FS,,30,sunrpc lockd nfs))
+
+$(eval $(call KMOD_template,FS_VFAT,fs-vfat,\
+       $(MODULES_DIR)/kernel/fs/fat/fat.ko \
+       $(MODULES_DIR)/kernel/fs/vfat/vfat.ko \
+,CONFIG_VFAT_FS,kmod-nls-base,30,fat vfat))
+
+$(eval $(call KMOD_template,FS_XFS,fs-xfs,\
+       $(MODULES_DIR)/kernel/fs/xfs/xfs.ko \
+,CONFIG_XFS_FS,,30,xfs))
+
+
+# Multimedia
+
+$(eval $(call KMOD_template,PWC,pwc,\
+       $(MODULES_DIR)/kernel/drivers/usb/media/pwc/pwc.ko \
+,CONFIG_USB_PWC,kmod-videodev,63,pwc))
+
+$(eval $(call KMOD_template,SOUNDCORE,soundcore,\
+       $(MODULES_DIR)/kernel/sound/soundcore.ko \
+,CONFIG_SOUND,,30,soundcore))
+
+$(eval $(call KMOD_template,VIDEODEV,videodev,\
+       $(MODULES_DIR)/kernel/drivers/media/video/v4l1-compat.ko \
+       $(MODULES_DIR)/kernel/drivers/media/video/v4l2-common.ko \
+       $(MODULES_DIR)/kernel/drivers/media/video/videodev.ko \
+,CONFIG_VIDEO_DEV,,62,videodev))
+
+
+# NLS
+
+$(eval $(call KMOD_template,NLS_BASE,nls-base,\
+       $(MODULES_DIR)/kernel/fs/nls/nls_base.ko \
+,CONFIG_NLS,,20,nls_base))
+
+$(eval $(call KMOD_template,NLS_CP437,nls-cp437,\
+       $(MODULES_DIR)/kernel/fs/nls/nls_cp437.ko \
+,CONFIG_NLS_CODEPAGE_437,,20,nls_cp437))
+
+$(eval $(call KMOD_template,NLS_CP850,nls-cp850,\
+       $(MODULES_DIR)/kernel/fs/nls/nls_cp850.ko \
+,CONFIG_NLS_CODEPAGE_850,,20,nls_cp850))
+
+$(eval $(call KMOD_template,NLS_ISO8859_1,nls-iso8859-1,\
+       $(MODULES_DIR)/kernel/fs/nls/nls_iso8859-1.ko \
+,CONFIG_NLS_ISO8859_1,,20,nls_iso8859-1))
+
+$(eval $(call KMOD_template,NLS_ISO8859_15,nls-iso8859-15,\
+       $(MODULES_DIR)/kernel/fs/nls/nls_iso8859-15.ko \
+,CONFIG_NLS_ISO8859_15,,20,nls_iso8859-15))
+
+$(eval $(call KMOD_template,NLS_UTF8,nls-utf8,\
+       $(MODULES_DIR)/kernel/fs/nls/nls_utf8.ko \
+,CONFIG_NLS_UTF8,,20,nls_utf8))
+
+
+# Network devices
+
+$(eval $(call KMOD_template,NET_3C59X,net-3c59x,\
+       $(MODULES_DIR)/kernel/drivers/net/3c59x.ko \
+,CONFIG_VORTEX,,10,3c59x))
+
+$(eval $(call KMOD_template,NET_8139TOO,net-8139too,\
+       $(MODULES_DIR)/kernel/drivers/net/8139too.ko \
+,CONFIG_8139TOO,,10,8139too))
+
+$(eval $(call KMOD_template,NET_AIRO,net-airo,\
+       $(MODULES_DIR)/kernel/drivers/net/wireless/airo.ko \
+,CONFIG_AIRO,,10,airo))
+
+$(eval $(call KMOD_template,NET_E100,net-e100,\
+       $(MODULES_DIR)/kernel/drivers/net/e100.ko \
+,CONFIG_E100,,10,e100))
+
+$(eval $(call KMOD_template,NET_HERMES,net-hermes,\
+       $(MODULES_DIR)/kernel/drivers/net/wireless/hermes.ko \
+       $(MODULES_DIR)/kernel/drivers/net/wireless/orinoco.ko \
+,CONFIG_HERMES,,10,hermes orinoco))
+
+$(eval $(call KMOD_template,NET_HERMES_PCI,net-hermes-pci,\
+       $(MODULES_DIR)/kernel/drivers/net/wireless/orinoco_pci.ko \
+,CONFIG_PCI_HERMES,kmod-net-hermes,11,orinoco_pci))
+
+$(eval $(call KMOD_template,NET_HERMES_PCI,net-hermes-plx,\
+       $(MODULES_DIR)/kernel/drivers/net/wireless/orinoco_plx.ko \
+,CONFIG_PLX_HERMES,kmod-net-hermes,11,orinoco_plx))
+
+$(eval $(call KMOD_template,NET_NATSEMI,net-natsemi,\
+       $(MODULES_DIR)/kernel/drivers/net/natsemi.ko \
+,CONFIG_NATSEMI,,10,natsemi))
+
+$(eval $(call KMOD_template,NET_PRISM54,net-prism54,\
+       $(MODULES_DIR)/kernel/drivers/net/wireless/prism54/prism54.ko \
+,CONFIG_PRISM54,,10,prism54))
+
+
+# PCMCIA/CardBus
+
+$(eval $(call KMOD_template,PCMCIA_CORE,pcmcia-core,\
+       $(MODULES_DIR)/kernel/drivers/pcmcia/pcmcia.ko \
+       $(MODULES_DIR)/kernel/drivers/pcmcia/pcmcia_core.ko \
+       $(MODULES_DIR)/kernel/drivers/pcmcia/yenta_socket.ko \
+       $(MODULES_DIR)/kernel/drivers/pcmcia/rsrc_nonstatic.ko \
+,CONFIG_PCMCIA,,50,pcmcia_core pcmcia yenta_socket rsrc_nonstatic))
+
+$(eval $(call KMOD_template,PCMCIA_SERIAL,pcmcia-serial,\
+       $(MODULES_DIR)/kernel/drivers/serial/serial_cs.ko \
+,CONFIG_SERIAL_8250_CS))
+
+
+# USB
+
+$(eval $(call KMOD_template,USB,usb-core,\
+       $(MODULES_DIR)/kernel/drivers/usb/core/usbcore.ko \
+,CONFIG_USB,,50,usbcore))
+
+$(eval $(call KMOD_template,USB_OHCI,usb-ohci,\
+       $(MODULES_DIR)/kernel/drivers/usb/host/ohci-hcd.ko \
+,CONFIG_USB_OHCI_HCD,kmod-usb-core,60,ohci-hcd))
+
+$(eval $(call KMOD_template,USB_UHCI,usb-uhci,\
+       $(MODULES_DIR)/kernel/drivers/usb/host/uhci-hcd.ko \
+,CONFIG_USB_UHCI_HCD,kmod-usb-core,60,uhci-hcd))
+
+$(eval $(call KMOD_template,USB2,usb2,\
+       $(MODULES_DIR)/kernel/drivers/usb/host/ehci-hcd.ko \
+,CONFIG_USB_EHCI_HCD,kmod-usb-core,60,ehci-hcd))
+
+$(eval $(call KMOD_template,USB_ACM,usb-acm,\
+       $(MODULES_DIR)/kernel/drivers/usb/class/cdc-acm.ko \
+,CONFIG_USB_ACM))
+
+$(eval $(call KMOD_template,USB_AUDIO,usb-audio,\
+       $(MODULES_DIR)/kernel/drivers/usb/class/audio.ko \
+,CONFIG_USB_AUDIO,kmod-soundcore kmod-usb-core,61,audio))
+
+$(eval $(call KMOD_template,USB_PRINTER,usb-printer,\
+       $(MODULES_DIR)/kernel/drivers/usb/class/usblp.ko \
+,CONFIG_USB_PRINTER,kmod-usb-core,60,usblp))
+
+$(eval $(call KMOD_template,USB_SERIAL,usb-serial,\
+       $(MODULES_DIR)/kernel/drivers/usb/serial/usbserial.ko \
+,CONFIG_USB_SERIAL,kmod-usb-core,60,usbserial))
+
+$(eval $(call KMOD_template,USB_SERIAL_BELKIN,usb-serial-belkin,\
+       $(MODULES_DIR)/kernel/drivers/usb/serial/belkin_sa.ko \
+,CONFIG_USB_SERIAL_BELKIN,kmod-usb-serial,61,belkin_sa))
+
+$(eval $(call KMOD_template,USB_SERIAL_FTDI,usb-serial-ftdi,\
+       $(MODULES_DIR)/kernel/drivers/usb/serial/ftdi_sio.ko \
+,CONFIG_USB_SERIAL_FTDI_SIO,kmod-usb-serial,61,ftdi_sio))
+
+$(eval $(call KMOD_template,USB_SERIAL_MCT_U232,usb-serial-mct-u232,\
+       $(MODULES_DIR)/kernel/drivers/usb/serial/mct_u232.ko \
+,CONFIG_USB_SERIAL_MCT_U232,kmod-usb-serial,61,mct_u232))
+
+$(eval $(call KMOD_template,USB_SERIAL_PL2303,usb-serial-pl2303,\
+       $(MODULES_DIR)/kernel/drivers/usb/serial/pl2303.ko \
+,CONFIG_USB_SERIAL_PL2303,kmod-usb-serial,61,pl2303))
+
+$(eval $(call KMOD_template,USB_SERIAL_VISOR,usb-serial-visor,\
+       $(MODULES_DIR)/kernel/drivers/usb/serial/visor.ko \
+,CONFIG_USB_SERIAL_VISOR,kmod-usb-serial,61,visor))
+
+$(eval $(call KMOD_template,USB_STORAGE,usb-storage,\
+       $(MODULES_DIR)/kernel/drivers/scsi/scsi_mod.ko \
+       $(MODULES_DIR)/kernel/drivers/scsi/sd_mod.ko \
+       $(MODULES_DIR)/kernel/drivers/usb/storage/usb-storage.ko \
+,CONFIG_USB_STORAGE,kmod-usb-core,60,scsi_mod sd_mod usb-storage))
+
+$(eval $(call KMOD_template,USB_ATM,usb-atm,\
+        $(MODULES_DIR)/kernel/drivers/usb/atm/usbatm.ko \
+       ,CONFIG_USB_ATM,kmod-usb-atm,50,usbatm))
+
+$(eval $(call KMOD_template,USB_ATM_SPEEDTOUCH,usb-atm-speedtouch,\
+        $(MODULES_DIR)/kernel/drivers/usb/atm/speedtch.ko \
+       ,CONFIG_USB_SPEEDTOUCH,kmod-usb-atm-speedtouch,50,speedtch))
+
+# Misc. devices
+
+$(eval $(call KMOD_template,AX25,ax25,\
+       $(MODULES_DIR)/kernel/net/ax25/ax25.ko \
+       $(MODULES_DIR)/kernel/drivers/net/hamradio/mkiss.ko \
+,CONFIG_AX25,,90,ax25 mkiss))
+
+$(eval $(call KMOD_template,BLUETOOTH,bluetooth,\
+       $(MODULES_DIR)/kernel/net/bluetooth/bluetooth.ko \
+       $(MODULES_DIR)/kernel/net/bluetooth/l2cap.ko \
+       $(MODULES_DIR)/kernel/net/bluetooth/sco.ko \
+       $(MODULES_DIR)/kernel/net/bluetooth/rfcomm/rfcomm.ko \
+       $(MODULES_DIR)/kernel/drivers/bluetooth/hci_uart.ko \
+       $(MODULES_DIR)/kernel/drivers/bluetooth/hci_usb.ko \
+,CONFIG_BT))
+
+
diff --git a/openwrt/include/netfilter.mk b/openwrt/include/netfilter.mk
new file mode 100644 (file)
index 0000000..66cb747
--- /dev/null
@@ -0,0 +1,116 @@
+# $Id: netfilter.mk 2411 2005-11-11 03:41:43Z nico $
+
+ifeq ($(NF_2_6),1)
+P_V4:=ipv4/netfilter/
+P_XT:=netfilter/
+else
+P_V4:=
+P_XT:=
+endif
+
+IPT_CONNTRACK-m :=
+IPT_CONNTRACK-$(CONFIG_IP_NF_MATCH_CONNMARK) += $(P_V4)ipt_connmark
+IPT_CONNTRACK-$(CONFIG_IP_NF_TARGET_CONNMARK) += $(P_V4)ipt_CONNMARK
+IPT_CONNTRACK-$(CONFIG_IP_NF_MATCH_CONNTRACK) += $(P_V4)ipt_conntrack
+IPT_CONNTRACK-$(CONFIG_IP_NF_MATCH_HELPER) += $(P_V4)ipt_helper
+IPT_CONNTRACK-$(CONFIG_IP_NF_MATCH_STATE) += $(P_V4)ipt_state
+IPT_CONNTRACK-$(CONFIG_NETFILTER_XT_MATCH_CONNTRACK) += $(P_XT)xt_conntrack
+IPT_CONNTRACK-$(CONFIG_NETFILTER_XT_MATCH_HELPER) += $(P_XT)xt_helper
+IPT_CONNTRACK-$(CONFIG_NETFILTER_XT_MATCH_STATE) += $(P_XT)xt_state
+
+
+IPT_EXTRA-m :=
+IPT_EXTRA-$(CONFIG_IP_NF_MATCH_CONDITION) += $(P_V4)ipt_condition
+IPT_EXTRA-$(CONFIG_IP_NF_MATCH_CONNBYTES) += $(P_V4)ipt_connbytes
+IPT_EXTRA-$(CONFIG_NETFILTER_XT_MATCH_CONNBYTES) += $(P_XT)xt_connbytes
+IPT_EXTRA-$(CONFIG_IP_NF_MATCH_LIMIT) += $(P_V4)ipt_limit
+IPT_EXTRA-$(CONFIG_NETFILTER_XT_MATCH_LIMIT) += $(P_XT)xt_limit
+IPT_EXTRA-$(CONFIG_IP_NF_TARGET_LOG) += $(P_V4)ipt_LOG
+IPT_EXTRA-$(CONFIG_IP_NF_MATCH_MULTIPORT) += $(P_XT)xt_multiport
+IPT_EXTRA-$(CONFIG_NETFILTER_XT_MATCH_MULTIPORT) += $(P_XT)xt_multiport
+IPT_EXTRA-$(CONFIG_IP_NF_MATCH_OWNER) += $(P_V4)ipt_owner
+IPT_EXTRA-$(CONFIG_IP_NF_MATCH_PHYSDEV) += $(P_V4)ipt_physdev
+IPT_EXTRA-$(CONFIG_IP_NF_MATCH_PKTTYPE) += $(P_V4)ipt_pkttype
+IPT_EXTRA-$(CONFIG_NETFILTER_XT_MATCH_PKTTYPE) += $(P_XT)xt_pkttype
+IPT_EXTRA-$(CONFIG_IP_NF_MATCH_QUOTA) += $(P_V4)ipt_quota
+IPT_EXTRA-$(CONFIG_IP_NF_MATCH_RECENT) += $(P_V4)ipt_recent
+IPT_EXTRA-$(CONFIG_IP_NF_TARGET_REJECT) += $(P_V4)ipt_REJECT
+IPT_EXTRA-$(CONFIG_IP_NF_MATCH_STRING) += $(P_V4)ipt_string
+IPT_EXTRA-$(CONFIG_NETFILTER_XT_MATCH_STRING) += $(P_XT)xt_string
+
+IPT_FILTER-m :=
+IPT_FILTER-$(CONFIG_IP_NF_MATCH_IPP2P) += $(P_V4)ipt_ipp2p
+IPT_FILTER-$(CONFIG_IP_NF_MATCH_LAYER7) += $(P_V4)ipt_layer7
+
+IPT_IMQ-m :=
+IPT_IMQ-$(CONFIG_IP_NF_TARGET_IMQ) += $(P_V4)ipt_IMQ
+
+IPT_IPOPT-m :=
+IPT_IPOPT-$(CONFIG_IP_NF_MATCH_DSCP) += $(P_V4)ipt_dscp
+IPT_IPOPT-$(CONFIG_IP_NF_TARGET_DSCP) += $(P_V4)ipt_DSCP
+IPT_IPOPT-$(CONFIG_IP_NF_MATCH_ECN) += $(P_V4)ipt_ecn
+IPT_IPOPT-$(CONFIG_IP_NF_TARGET_ECN) += $(P_V4)ipt_ECN
+IPT_IPOPT-$(CONFIG_IP_NF_MATCH_LENGTH) += $(P_V4)ipt_length
+IPT_IPOPT-$(CONFIG_NETFILTER_XT_MATCH_LENGTH) += $(P_XT)xt_length
+IPT_IPOPT-$(CONFIG_IP_NF_MATCH_MAC) += $(P_V4)ipt_mac
+IPT_IPOPT-$(CONFIG_NETFILTER_XT_MATCH_MAC) += $(P_XT)xt_mac
+IPT_IPOPT-$(CONFIG_IP_NF_MATCH_MARK) += $(P_V4)ipt_mark
+IPT_IPOPT-$(CONFIG_NETFILTER_XT_MATCH_MARK) += $(P_XT)xt_mark
+IPT_IPOPT-$(CONFIG_IP_NF_TARGET_MARK) += $(P_V4)ipt_MARK
+IPT_IPOPT-$(CONFIG_NETFILTER_XT_TARGET_MARK) += $(P_XT)xt_MARK
+IPT_IPOPT-$(CONFIG_IP_NF_MATCH_TCPMSS) += $(P_V4)ipt_tcpmss
+IPT_IPOPT-$(CONFIG_NETFILTER_XT_MATCH_TCPMSS) += $(P_XT)xt_tcpmss
+IPT_IPOPT-$(CONFIG_IP_NF_TARGET_TCPMSS) += $(P_V4)ipt_TCPMSS
+IPT_IPOPT-$(CONFIG_IP_NF_MATCH_TOS) += $(P_V4)ipt_tos
+IPT_IPOPT-$(CONFIG_IP_NF_MATCH_TIME) += $(P_V4)ipt_time
+IPT_IPOPT-$(CONFIG_IP_NF_TARGET_TOS) += $(P_V4)ipt_TOS
+IPT_IPOPT-$(CONFIG_IP_NF_MATCH_TTL) += $(P_V4)ipt_ttl
+IPT_IPOPT-$(CONFIG_IP_NF_TARGET_TTL) += $(P_V4)ipt_TTL
+IPT_IPOPT-$(CONFIG_IP_NF_MATCH_UNCLEAN) += $(P_V4)ipt_unclean
+
+IPT_IPSEC-m :=
+IPT_IPSEC-$(CONFIG_IP_NF_MATCH_AH_ESP) += $(P_V4)ipt_ah $(P_V4)ipt_esp
+IPT_IPSEC-$(CONFIG_IP_NF_MATCH_AH) += $(P_V4)ipt_ah
+IPT_IPSEC-$(CONFIG_NETFILTER_XT_MATCH_ESP) += $(P_XT)xt_esp
+
+IPT_NAT-m :=
+IPT_NAT-$(CONFIG_IP_NF_NAT) += $(P_V4)ipt_SNAT $(P_V4)ipt_DNAT
+IPT_NAT-$(CONFIG_IP_NF_TARGET_MASQUERADE) += $(P_V4)ipt_MASQUERADE
+IPT_NAT-$(CONFIG_IP_NF_TARGET_MIRROR) += $(P_V4)ipt_MIRROR
+IPT_NAT-$(CONFIG_IP_NF_TARGET_REDIRECT) += $(P_V4)ipt_REDIRECT
+
+IPT_NAT_EXTRA-m := 
+IPT_NAT_EXTRA-$(CONFIG_IP_NF_AMANDA) += $(P_V4)ip_conntrack_amanda
+IPT_NAT_EXTRA-$(CONFIG_IP_NF_CT_PROTO_GRE) += $(P_V4)ip_conntrack_proto_gre
+IPT_NAT_EXTRA-$(CONFIG_IP_NF_NAT_PROTO_GRE) += $(P_V4)ip_nat_proto_gre
+IPT_NAT_EXTRA-$(CONFIG_IP_NF_H323) += $(P_V4)ip_conntrack_h323
+IPT_NAT_EXTRA-$(CONFIG_IP_NF_NAT_H323) += $(P_V4)ip_nat_h323
+IPT_NAT_EXTRA-$(CONFIG_IP_NF_MMS) += $(P_V4)ip_conntrack_mms
+IPT_NAT_EXTRA-$(CONFIG_IP_NF_NAT_MMS) += $(P_V4)ip_nat_mms
+IPT_NAT_EXTRA-$(CONFIG_IP_NF_RTSP) += $(P_V4)ip_conntrack_rtsp
+IPT_NAT_EXTRA-$(CONFIG_IP_NF_NAT_RTSP) += $(P_V4)ip_nat_rtsp
+IPT_NAT_EXTRA-$(CONFIG_IP_NF_PPTP) += $(P_V4)ip_conntrack_pptp
+IPT_NAT_EXTRA-$(CONFIG_IP_NF_SIP) += $(P_V4)ip_conntrack_sip
+IPT_NAT_EXTRA-$(CONFIG_IP_NF_NAT_PPTP) += $(P_V4)ip_nat_pptp
+IPT_NAT_EXTRA-$(CONFIG_IP_NF_NAT_SIP) += $(P_V4)ip_nat_sip
+IPT_NAT_EXTRA-$(CONFIG_IP_NF_NAT_SNMP_BASIC) += $(P_V4)ip_nat_snmp_basic
+IPT_NAT_EXTRA-$(CONFIG_IP_NF_SIP) += $(P_V4)ip_conntrack_sip
+IPT_NAT_EXTRA-$(CONFIG_IP_NF_NAT_SIP) += $(P_V4)ip_nat_sip
+IPT_NAT_EXTRA-$(CONFIG_IP_NF_TFTP) += $(P_V4)ip_conntrack_tftp
+
+IPT_QUEUE-m :=
+IPT_QUEUE-$(CONFIG_IP_NF_QUEUE) += $(P_V4)ip_queue
+
+IPT_ULOG-m :=
+IPT_ULOG-$(CONFIG_IP_NF_TARGET_ULOG) += $(P_V4)ipt_ULOG
+
+IPT_BUILTIN := $(P_V4)ipt_standard
+IPT_BUILTIN += $(P_V4)ipt_icmp $(P_V4)ipt_tcp $(P_V4)ipt_udp
+IPT_BUILTIN += $(IPT_CONNTRACK-y)
+IPT_BUILTIN += $(IPT_EXTRA-y)
+IPT_BUILTIN += $(IPT_FILTER-y)
+IPT_BUILTIN += $(IPT_IMQ-y)
+IPT_BUILTIN += $(IPT_IPOPT-y)
+IPT_BUILTIN += $(IPT_IPSEC-y)
+IPT_BUILTIN += $(IPT_NAT-y)
+IPT_BUILTIN += $(IPT_ULOG-y)
diff --git a/openwrt/include/package.mk b/openwrt/include/package.mk
new file mode 100644 (file)
index 0000000..82298b0
--- /dev/null
@@ -0,0 +1,300 @@
+ifneq ($(DUMP),)
+  all: dumpinfo
+else
+  all: compile
+endif
+
+define Build/DefaultTargets
+  ifeq ($(DUMP),)
+    ifneq ($$(shell $(SCRIPT_DIR)/timestamp.pl -p $(PKG_BUILD_DIR) . $(TOPDIR)/package/rules.mk),$(PKG_BUILD_DIR))
+      ifeq ($(CONFIG_AUTOREBUILD),y)
+        $(PKG_BUILD_DIR)/.prepared: package-clean
+      endif
+    endif
+
+    ifneq ($$(shell $(SCRIPT_DIR)/timestamp.pl -p -x ipkg $(IPKG_$(1)) $(PKG_BUILD_DIR)),$(IPKG_$(1)))
+      ifeq ($(CONFIG_AUTOREBUILD),y)
+        $(PKG_BUILD_DIR)/.built: package-rebuild
+      endif
+    endif
+  endif
+
+
+  $(PKG_BUILD_DIR)/.prepared:
+       @-rm -rf $(PKG_BUILD_DIR)
+       @mkdir -p $(PKG_BUILD_DIR)
+       $(call Build/Prepare)
+       touch $$@
+
+  $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
+       $(call Build/Configure)
+       touch $$@
+
+  $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
+       $(call Build/Compile)
+       touch $$@
+
+  $(STAGING_DIR)/stampfiles/.$(PKG_NAME)-installed: $(PKG_BUILD_DIR)/.built
+       $(call Build/InstallDev)
+       touch $$@
+       
+  ifdef Build/InstallDev
+    compile-targets: $(STAGING_DIR)/stampfiles/.$(PKG_NAME)-installed
+  endif
+
+  package-clean: FORCE
+       $(call Build/Clean)
+       $(call Build/UninstallDev)
+       rm -f $(STAGING_DIR)/stampfiles/.$(PKG_NAME)-installed
+
+  package-rebuild: FORCE
+       @-rm -f $(PKG_BUILD_DIR)/.built
+
+  define Build/DefaultTargets
+  endef
+endef
+
+define Package/Default
+  CONFIGFILE:=
+  SECTION:=opt
+  CATEGORY:=Extra packages
+  DEPENDS:=
+  MAINTAINER:=OpenWrt Developers Team <openwrt-devel@openwrt.org>
+  SOURCE:=$(patsubst $(TOPDIR)/%,%,${shell pwd})
+  ifneq ($(PKG_VERSION),)
+    ifneq ($(PKG_RELEASE),)
+      VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
+    else
+      VERSION:=$(PKG_VERSION)
+    endif
+  else
+    VERSION:=$(PKG_RELEASE)
+  endif
+  PKGARCH:=$(ARCH)
+  PRIORITY:=optional
+  DEFAULT:=
+  MENU:=
+  TITLE:=
+  DESCRIPTION:=
+endef
+
+define BuildIPKGVariable
+pkg_$(subst .,_,$(subst -,_,$(1)))_$(2) = $$(Package/$(1)/$(2))
+export pkg_$(subst .,_,$(subst -,_,$(1))_$(2))
+$(1)_COMMANDS += if [ -n "$$$$$$$$pkg_$(subst .,_,$(subst -,_,$(1)))_$(2)" ]; then echo "$$$$$$$$pkg_$(subst .,_,$(subst -,_,$(1)))_$(2)" > $(2); fi;
+endef
+
+define BuildPackage
+  $(eval $(call Package/Default))
+  $(eval $(call Package/$(1)))
+
+  $(foreach FIELD, TITLE CATEGORY PRIORITY VERSION,
+    ifeq ($($(FIELD)),)
+      $$(error Package/$(1) is missing the $(FIELD) field)
+    endif
+  )
+
+  ifeq ($(PKGARCH),)
+    PKGARCH:=$(ARCH)
+  endif
+
+  ifeq ($(DESCRIPTION),)
+    $(eval DESCRIPTION:=$(TITLE))
+  endif
+
+  IPKG_$(1):=$(PACKAGE_DIR)/$(1)_$(VERSION)_$(PKGARCH).ipk
+  IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg/$(1)
+  INFO_$(1):=$(IPKG_STATE_DIR)/info/$(1).list
+
+  ifeq ($(CONFIG_PACKAGE_$(1)),y)
+    install-targets: $$(INFO_$(1))
+  endif
+
+  ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER),)
+    compile-targets: $$(IPKG_$(1))
+  endif
+
+  IDEPEND_$(1):=$$(strip $$(DEPENDS))
+
+  DUMPINFO += \
+       echo "Package: $(1)"; 
+
+  ifneq ($(MENU),)
+    DUMPINFO += \
+       echo "Menu: $(MENU)";
+  endif
+
+  ifneq ($(DEFAULT),)
+    DUMPINFO += \
+       echo "Default: $(DEFAULT)";
+  endif
+
+  DUMPINFO += \
+       echo "Version: $(VERSION)"; \
+       echo "Depends: $$(IDEPEND_$(1))"; \
+       echo "Build-Depends: $(PKG_BUILDDEP)"; \
+       echo "Category: $(CATEGORY)"; \
+       echo "Title: $(TITLE)"; \
+       echo "Description: $(DESCRIPTION)" | sed -e 's,\\,\n,g';
+
+  ifneq ($(URL),)
+    DUMPINFO += \
+       echo; \
+       echo "$(URL)";
+  endif
+
+  DUMPINFO += \
+       echo "@@";
+
+  ifneq ($(CONFIG),)
+    DUMPINFO += \
+       echo "Config: $(CONFIG)" | sed -e 's,\\,\n,g'; \
+       echo "@@";
+  endif
+
+  $(eval $(call BuildIPKGVariable,$(1),conffiles))
+  $(eval $(call BuildIPKGVariable,$(1),preinst))
+  $(eval $(call BuildIPKGVariable,$(1),postinst))
+  $(eval $(call BuildIPKGVariable,$(1),prerm))
+  $(eval $(call BuildIPKGVariable,$(1),postrm))
+  $$(IDIR_$(1))/CONTROL/control: $(PKG_BUILD_DIR)/.prepared
+       mkdir -p $$(IDIR_$(1))/CONTROL
+       echo "Package: $(1)" > $$(IDIR_$(1))/CONTROL/control
+       echo "Version: $(VERSION)" >> $$(IDIR_$(1))/CONTROL/control
+       ( \
+               DEPENDS=; \
+               for depend in $$(filter-out @%,$$(IDEPEND_$(1))); do \
+                       DEPENDS=$$$${DEPENDS:+$$$$DEPENDS, }$$$${depend##+}; \
+               done; \
+               echo "Depends: $$$$DEPENDS" >> $$(IDIR_$(1))/CONTROL/control; \
+       )
+       echo "Source: $(SOURCE)" >> $$(IDIR_$(1))/CONTROL/control
+       echo "Section: $(SECTION)" >> $$(IDIR_$(1))/CONTROL/control
+       echo "Priority: $(PRIORITY)" >> $$(IDIR_$(1))/CONTROL/control
+       echo "Maintainer: $(MAINTAINER)" >> $$(IDIR_$(1))/CONTROL/control
+       echo "Architecture: $(PKGARCH)" >> $$(IDIR_$(1))/CONTROL/control
+       echo "Description: $(DESCRIPTION)" | sed -e 's,\\,\n ,g' >> $$(IDIR_$(1))/CONTROL/control
+       chmod 644 $$(IDIR_$(1))/CONTROL/control
+       (cd $$(IDIR_$(1))/CONTROL; \
+               $($(1)_COMMANDS) \
+       )
+
+  $$(IPKG_$(1)): $$(IDIR_$(1))/CONTROL/control $(PKG_BUILD_DIR)/.built
+       $(call Package/$(1)/install,$$(IDIR_$(1)))
+       mkdir -p $(PACKAGE_DIR)
+       -find $$(IDIR_$(1)) -name CVS | xargs rm -rf
+       -find $$(IDIR_$(1)) -name .svn | xargs rm -rf
+       -find $$(IDIR_$(1)) -name '.#*' | xargs rm -f
+       $(RSTRIP) $$(IDIR_$(1))
+       $(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR)
+
+  $$(INFO_$(1)): $$(IPKG_$(1))
+       $(IPKG) install $$(IPKG_$(1))
+
+  $(1)-clean:
+       rm -f $(PACKAGE_DIR)/$(1)_*
+
+  clean: $(1)-clean
+
+  $$(eval $$(call Build/DefaultTargets,$(1)))
+
+endef
+
+ifneq ($(strip $(PKG_CAT)),)
+  define Build/Prepare/Default
+       @if [ "$(PKG_CAT)" = "unzip" ]; then \
+               unzip -d $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_SOURCE) ; \
+       else \
+               $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(PKG_BUILD_DIR)/.. $(TAR_OPTIONS) - ; \
+       fi                                                
+       @if [ -d ./patches ]; then \
+               $(PATCH) $(PKG_BUILD_DIR) ./patches ; \
+       fi
+  endef
+endif
+
+define Build/Prepare
+  $(call Build/Prepare/Default)
+endef
+
+define Build/Configure/Default
+       @(cd $(PKG_BUILD_DIR)/$(3); \
+       [ -x configure ] && \
+               $(2) \
+               $(TARGET_CONFIGURE_OPTS) \
+               CFLAGS="$(TARGET_CFLAGS)" \
+               CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
+               LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
+               ./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 \
+               --sbindir=/usr/sbin \
+               --libexecdir=/usr/lib \
+               --sysconfdir=/etc \
+               --datadir=/usr/share \
+               --localstatedir=/var \
+               --mandir=/usr/man \
+               --infodir=/usr/info \
+               $(DISABLE_NLS) \
+               $(1); \
+               true; \
+       )
+endef
+
+define Build/Configure
+  $(call Build/Configure/Default,)
+endef
+
+define Build/Compile/Default
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               $(TARGET_CONFIGURE_OPTS) \
+               CC=$(TARGET_CC) \
+               CROSS="$(TARGET_CROSS)" \
+               EXTRA_CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/include -I$(STAGING_DIR)/usr/include" \
+               ARCH="$(ARCH)" \
+               $(1);
+endef
+
+define Build/Compile
+  $(call Build/Compile/Default,)
+endef
+
+ifneq ($(DUMP),)
+  dumpinfo: FORCE
+       @$(DUMPINFO)
+else
+  $(PACKAGE_DIR):
+       mkdir -p $@
+               
+  ifneq ($(strip $(PKG_SOURCE)),)
+    source: $(DL_DIR)/$(PKG_SOURCE)
+
+    $(DL_DIR)/$(PKG_SOURCE):
+               mkdir -p $(DL_DIR)
+               $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(PKG_SOURCE)" "$(PKG_MD5SUM)" $(PKG_SOURCE_URL)
+
+    $(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
+  endif
+
+  source:
+  prepare: $(PKG_BUILD_DIR)/.prepared
+  configure: $(PKG_BUILD_DIR)/.configured
+
+  compile-targets:
+  compile: compile-targets
+
+  install-targets:
+  install: install-targets
+
+  clean-targets:
+  clean: FORCE
+       @$(MAKE) clean-targets
+       $(call Build/Clean)
+       rm -rf $(PKG_BUILD_DIR)
+endif
index b1b9997c1998794cfbaf10e6f5187b7ba1c86afa..5f6a3305b5a6be7400ddd2ef21f45da2b920fcc0 100644 (file)
@@ -1,7 +1,7 @@
 # $Id$
 
 include $(TOPDIR)/rules.mk
-include $(TOPDIR)/package/kernel.mk
+include $(TOPDIR)/include/kernel.mk
 
 PKG_NAME:=alsa-driver
 PKG_VERSION:=1.0.11
@@ -13,7 +13,7 @@ PKG_SOURCE_URL:=ftp://ftp.alsa-project.org/pub/driver/
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_CAT:=bzcat
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 ifeq ($(LINUX_KARCH),i386)
 KERNEL_C_INCS:= -I$(LINUX_DIR)/include/asm-i386/mach-generic -I$(LINUX_DIR)/include/asm-i386/mach-default
index ec3dc88923896a41bd4b7b633b209a5f0a848963..bb20894096017cbad1dc7c78177200431886f88a 100644 (file)
@@ -1,7 +1,7 @@
 # $Id$
 
 include $(TOPDIR)/rules.mk
-include $(TOPDIR)/package/kernel.mk
+include $(TOPDIR)/include/kernel.mk
 
 PKG_NAME:=base-files
 PKG_RELEASE:=8
@@ -12,7 +12,7 @@ ifeq ($(REV),)
 REV:=0
 endif
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 ifneq ($(DUMP),1)
 TARGET:=-$(BOARD)-$(KERNEL)
index 65fd8358e86b8b1caa8d809eee09d90b4eb8f08d..f2b178a6101d3195499668bca8e29f132af4286a 100644 (file)
@@ -12,7 +12,7 @@ PKG_SOURCE_URL:=@SF/bridge
 PKG_MD5SUM:=9b7dc52656f5cbec846a7ba3299f73bd
 PKG_CAT:=zcat
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/bridge
 SECTION:=base
index 227352b15687ce45dd43e9e54ee71043f1996e82..6fe22edb0f13babbe6af410e06be784aabe157a1 100644 (file)
@@ -1,7 +1,7 @@
 # $Id: Makefile 2480 2005-11-14 02:07:33Z nbd $
 
 include $(TOPDIR)/rules.mk
-include $(TOPDIR)/package/kernel.mk
+include $(TOPDIR)/include/kernel.mk
 
 PKG_NAME:=broadcom-wl
 PKG_VERSION:=4.80.9.2
@@ -14,7 +14,7 @@ PKG_SOURCE_URL:=http://downloads.openwrt.org/sources
 PKG_MD5SUM:=7d9fab2c611369bbe075c3924ea77450
 PKG_CAT:=bzcat
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/kmod-brcm-wl
   SECTION:=drivers
index aac9d21e323aa292d3ada4396a7fafc24f7b056b..6b2e0c5be46bc1865e6043373c8b1c076ed957a4 100644 (file)
@@ -12,7 +12,7 @@ PKG_SOURCE_URL:=http://www.busybox.net/downloads
 PKG_MD5SUM:=19a0b475169335f17e421cf644616fe7
 PKG_CAT:=bzcat
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/busybox
 SECTION:=base
index 6fed3b51bfdfd4bae0c35df06374bf624d527818..ab28e7218e61fa82cc04b34059e65333b25d6241 100644 (file)
@@ -1,14 +1,14 @@
 # $Id$
 
 include $(TOPDIR)/rules.mk
-include $(TOPDIR)/package/kernel.mk
+include $(TOPDIR)/include/kernel.mk
 
 PKG_NAME:=kmod-diag
 PKG_RELEASE:=1
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/kmod-diag
 SECTION:=drivers
index 6efaf370a1e3a44e54155eebffa4b6a1fa0d50cf..a05ec0e22cbe8e1e7525076d1ede0c30979e2a08 100644 (file)
@@ -12,7 +12,7 @@ PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
 PKG_MD5SUM:=489198ec87101087043adc98bbe062dc
 PKG_CAT:=zcat
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/dnsmasq
 SECTION:=base
index bda4d8fc9136531087a1fb0500399ae28372b623..0409e66dbf2800ec5cf2280b77bdc7c1bddcf073 100644 (file)
@@ -12,7 +12,7 @@ PKG_SOURCE_URL:=http://matt.ucc.asn.au/dropbear/releases/
 PKG_MD5SUM:=ca8e53a766faec831882831364568421
 PKG_CAT:=zcat
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/dropbear
 SECTION:=base
index f4359a6675d56e8f9c7482104fa5003d7f5cca6d..814ac68a223024a2071e7930a488f713b54bc162 100644 (file)
@@ -12,7 +12,7 @@ PKG_SOURCE_URL:=@SF/ebtables
 PKG_MD5SUM:=f07111fcc1966be669278433c35dcc28
 PKG_CAT:=zcat
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/ebtables
 SECTION:=base
index 91d4dd6074d1039f69bae96fc978b7dee24025dd..b7084236df840c9e782525eb2bcd09890ac61457 100644 (file)
@@ -1,7 +1,7 @@
 # $Id$
 
 include $(TOPDIR)/rules.mk
-include $(TOPDIR)/package/kernel.mk
+include $(TOPDIR)/include/kernel.mk
 
 PKG_NAME:=fuse
 PKG_VERSION:=2.5.3
@@ -15,7 +15,7 @@ PKG_CAT:=zcat
 
 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/kmod-fuse
 SECTION:=drivers
index e6215c9547f8b6db4eebaf4c81018d7f368cc5c6..ec940ea43764a15be44dba2dea7cd3d8b8ceefc4 100644 (file)
@@ -12,7 +12,7 @@ PKG_SOURCE_URL:=@SF/haserl
 PKG_MD5SUM:=bd9195d086566f56634c0bcbbbcbebea
 PKG_CAT:=zcat
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/haserl
 SECTION:=base
index 80f820187bfa4579184f972c5646643c7e910ef9..21abfe256ba983883c1766256abd7e7558938b6c 100644 (file)
@@ -1,7 +1,7 @@
 # $Id$
 
 include $(TOPDIR)/rules.mk
-include $(TOPDIR)/package/kernel.mk
+include $(TOPDIR)/include/kernel.mk
 
 PKG_NAME:=hostap-driver
 PKG_VERSION:=0.4.9
@@ -15,7 +15,7 @@ PKG_CAT:=zcat
 
 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/kmod-hostap
 SECTION:=drivers
index 4a1c3f926500ed03f57eb7b922e691b3dfa08fd8..867cda6922b367b2e7e5248a87b238678750e114 100644 (file)
@@ -14,7 +14,7 @@ PKG_CAT:=zcat
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/hostapd
 SECTION:=net
index 1fa638d39d7f2fb0c21637be323f706f98512243..9cf1eb9909e70ceceec1846907ce433b629dd7ab 100644 (file)
@@ -12,7 +12,7 @@ PKG_SOURCE_URL:=http://developer.osdl.org/dev/iproute2/download/
 PKG_MD5SUM:=04f57a6d366d36426d276178b600f5c5
 PKG_CAT:=zcat
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/ip
 SECTION:=base
index 58dccca62ad5ba09e44c98e443b7779434954c58..667884debea67ac2f4ff268cfd8ddfb00ce02d7e 100644 (file)
@@ -14,7 +14,7 @@ PKG_CAT:=bzcat
 
 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/ipsec-tools
 SECTION:=base
index 456f8b6be4a6fdbf7855683fc0dce763da3a76f4..d245090a6896f268d6bb0f7bac84b7eefe701a2f 100644 (file)
@@ -12,7 +12,7 @@ PKG_SOURCE_URL:=http://ipset.netfilter.org
 PKG_MD5SUM:=1709424cc2cdb925d4fb6fd5fcaefc26
 PKG_CAT:=bzcat
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/ipset
 SECTION:=base
index 623a64ed84fa2f2c6f7b0f275e5972c5b51adde4..7490277440656b21e3ba66b4a815a25d956ff09b 100644 (file)
@@ -1,7 +1,7 @@
 # $Id$
 
 include $(TOPDIR)/rules.mk
-include $(TOPDIR)/package/kernel.mk
+include $(TOPDIR)/include/kernel.mk
 
 PKG_NAME:=iptables
 PKG_VERSION:=1.3.5
@@ -20,10 +20,10 @@ PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
 PKG_MENU:=IPv4 / IPv6 firewall administration
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 ifeq ($(DUMP),)
 include $(LINUX_DIR)/.config
-include $(TOPDIR)/target/linux/netfilter.mk
+include $(TOPDIR)/include/netfilter.mk
 endif
 
 define Package/iptables
diff --git a/openwrt/package/kernel.mk b/openwrt/package/kernel.mk
deleted file mode 100644 (file)
index 39f9cc0..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-ifneq ($(DUMP),1)
-include $(BUILD_DIR)/kernel.mk
-
-KERNEL:=unknown
-ifneq (,$(findstring 2.4.,$(LINUX_VERSION)))
-KERNEL:=2.4
-LINUX_KMOD_SUFFIX=o
-endif
-ifneq (,$(findstring 2.6.,$(LINUX_VERSION)))
-KERNEL:=2.6
-LINUX_KMOD_SUFFIX=ko
-endif
-
-LINUX_KARCH:=$(shell echo $(ARCH) | sed -e 's/i[3-9]86/i386/' \
-       -e 's/mipsel/mips/' \
-       -e 's/mipseb/mips/' \
-       -e 's/powerpc/ppc/' \
-       -e 's/sh[234]/sh/' \
-       -e 's/armeb/arm/' \
-)
-
-KERNEL_BUILD_DIR:=$(BUILD_DIR)/linux-$(KERNEL)-$(BOARD)
-ifeq ($(LINUX_NAME),)
-LINUX_NAME:=linux-$(LINUX_VERSION)
-endif
-LINUX_DIR := $(KERNEL_BUILD_DIR)/$(LINUX_NAME)
-
-KMOD_BUILD_DIR := $(KERNEL_BUILD_DIR)/linux-modules
-MODULES_DIR := $(KERNEL_BUILD_DIR)/modules/$(MODULES_SUBDIR)
-TARGET_MODULES_DIR := $(LINUX_TARGET_DIR)/$(MODULES_SUBDIR)
-endif
index d4d7e2167266aee44759cbfc1a7a688d99279a1e..2d7aecf55149376ebb851cb517fd591e1af5fd71 100644 (file)
@@ -14,7 +14,7 @@ PKG_CAT:=zcat
 
 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/libpcap
 SECTION:=base
index e37d5bdceb55d8ed7ca4494c6d83a7dbd71684dc..15b3f7d4daad10b69e7c0e2808ef7b31173c97fd 100644 (file)
@@ -14,7 +14,7 @@ PKG_CAT:=zcat
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/linux-atm
 SECTION:=libs
index c689054811ee2fd009443c0e42ac049254b30d2e..7bdb7ec11aa98fecbd42382b41d4c106b2438f44 100644 (file)
@@ -1,7 +1,7 @@
 # $Id$
 
 include $(TOPDIR)/rules.mk
-include $(TOPDIR)/package/kernel.mk
+include $(TOPDIR)/include/kernel.mk
 
 PKG_NAME:=madwifi
 PKG_VERSION:=0.9.0
@@ -54,7 +54,7 @@ MADWIFI_MAKEOPTS= -C $(PKG_BUILD_DIR) \
                LDOPTS="" \
                DOMULTI=1
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 ifeq ($(findstring AHB,$(BUS)),AHB)
 define Build/Compile/ahb
index f2c46c9ec3caefe758faafe04ca09900a07548f5..0180f81c319127888e5933d46cfc723e5d03fbb5 100644 (file)
@@ -1,7 +1,7 @@
 # $Id$
 
 include $(TOPDIR)/rules.mk
-include $(TOPDIR)/package/kernel.mk
+include $(TOPDIR)/include/kernel.mk
 
 PKG_NAME:=mini_fo
 PKG_VERSION:=0.6.2pre1
@@ -13,7 +13,7 @@ PKG_SOURCE_URL:=http://www.denx.de/twiki/pub/Know/MiniFOHome/
 PKG_SOURCE:=mini_fo-0-6-2-pre1.tar.bz2
 PKG_CAT:=bzcat
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/kmod-mini-fo
 SECTION:=drivers
index f6e94303af85f60a397143658509e3ea19791fac..01dfcd6b541f039e28b5501862ea3c0151a9ed7e 100644 (file)
@@ -7,7 +7,7 @@ PKG_RELEASE:=4
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/mtd
 SECTION:=base
index 019800a0c6ec40cd330f98bff22cf16c3fea6524..cf76c7c812219820924149729a2c18571d873dd9 100644 (file)
@@ -7,7 +7,7 @@ PKG_RELEASE:=1
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/nvram
 SECTION:=base
index 82f20d6b0ddfa9161c1020bb8dd2b711ced14337..39fe6b4c3d9779fd89bd8b2530e176a3379c8b61 100644 (file)
@@ -20,7 +20,7 @@ PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 OPENSSL_NO_CIPHERS:= no-idea no-md2 no-mdc2 no-rc5 no-sha0 no-rmd160 no-aes192
 OPENSSL_OPTIONS:= shared no-ec no-err no-fips no-hw no-krb5 no-threads zlib-dynamic no-engines
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/libopenssl
 SECTION:=base
index 4a1a42cc07de447351542934fad0b8bced789562..f81096547b9a13a76ad9854c6bbf7ce3450771dc 100644 (file)
@@ -1,7 +1,7 @@
 # $Id$
 
 include $(TOPDIR)/rules.mk
-include $(TOPDIR)/package/kernel.mk
+include $(TOPDIR)/include/kernel.mk
 
 PKG_NAME:=openswan
 PKG_VERSION:=2.4.5
@@ -13,7 +13,7 @@ PKG_SOURCE_URL:=http://www.openswan.org/download
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_CAT:=zcat
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/kmod-openswan
 SECTION:=drivers
index a389fd63e1947715e8db902fa706a70c6f4744df..2c7b229781ce24710492112832bde8e088d1d9dc 100644 (file)
@@ -14,7 +14,7 @@ PKG_CAT:=zcat
 
 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/pcmcia-cs
 SECTION:=base
index 55986f95c05bff9b5506317e121f863ee07a0c91..edd9a5ea8660dcb00c0180b48716baf18e0d8c08 100644 (file)
@@ -15,7 +15,7 @@ PKG_CAT:=zcat
 
 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/ppp
 SECTION:=net
index 08cb43a7c2968f3bfbb3248a7294a4421387c056..6d01ce19f344cc55fe72990937e3d0153609b524 100644 (file)
@@ -12,7 +12,7 @@ PKG_SOURCE_URL:=@SF/pptpclient
 PKG_MD5SUM:=9a706327fb9827541d7c86d48ceb9631
 PKG_CAT:=zcat
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/pptp
 SECTION:=base
index 49f6005699797d7545fe991158aa301be1b28a29..ca0f83d3ddb70e3722349770728a4e4902159674 100644 (file)
@@ -8,7 +8,7 @@ PKG_RELEASE:=1
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/robocfg
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/robocfg
 SECTION:=base
diff --git a/openwrt/package/rules.mk b/openwrt/package/rules.mk
deleted file mode 100644 (file)
index 82298b0..0000000
+++ /dev/null
@@ -1,300 +0,0 @@
-ifneq ($(DUMP),)
-  all: dumpinfo
-else
-  all: compile
-endif
-
-define Build/DefaultTargets
-  ifeq ($(DUMP),)
-    ifneq ($$(shell $(SCRIPT_DIR)/timestamp.pl -p $(PKG_BUILD_DIR) . $(TOPDIR)/package/rules.mk),$(PKG_BUILD_DIR))
-      ifeq ($(CONFIG_AUTOREBUILD),y)
-        $(PKG_BUILD_DIR)/.prepared: package-clean
-      endif
-    endif
-
-    ifneq ($$(shell $(SCRIPT_DIR)/timestamp.pl -p -x ipkg $(IPKG_$(1)) $(PKG_BUILD_DIR)),$(IPKG_$(1)))
-      ifeq ($(CONFIG_AUTOREBUILD),y)
-        $(PKG_BUILD_DIR)/.built: package-rebuild
-      endif
-    endif
-  endif
-
-
-  $(PKG_BUILD_DIR)/.prepared:
-       @-rm -rf $(PKG_BUILD_DIR)
-       @mkdir -p $(PKG_BUILD_DIR)
-       $(call Build/Prepare)
-       touch $$@
-
-  $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
-       $(call Build/Configure)
-       touch $$@
-
-  $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
-       $(call Build/Compile)
-       touch $$@
-
-  $(STAGING_DIR)/stampfiles/.$(PKG_NAME)-installed: $(PKG_BUILD_DIR)/.built
-       $(call Build/InstallDev)
-       touch $$@
-       
-  ifdef Build/InstallDev
-    compile-targets: $(STAGING_DIR)/stampfiles/.$(PKG_NAME)-installed
-  endif
-
-  package-clean: FORCE
-       $(call Build/Clean)
-       $(call Build/UninstallDev)
-       rm -f $(STAGING_DIR)/stampfiles/.$(PKG_NAME)-installed
-
-  package-rebuild: FORCE
-       @-rm -f $(PKG_BUILD_DIR)/.built
-
-  define Build/DefaultTargets
-  endef
-endef
-
-define Package/Default
-  CONFIGFILE:=
-  SECTION:=opt
-  CATEGORY:=Extra packages
-  DEPENDS:=
-  MAINTAINER:=OpenWrt Developers Team <openwrt-devel@openwrt.org>
-  SOURCE:=$(patsubst $(TOPDIR)/%,%,${shell pwd})
-  ifneq ($(PKG_VERSION),)
-    ifneq ($(PKG_RELEASE),)
-      VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
-    else
-      VERSION:=$(PKG_VERSION)
-    endif
-  else
-    VERSION:=$(PKG_RELEASE)
-  endif
-  PKGARCH:=$(ARCH)
-  PRIORITY:=optional
-  DEFAULT:=
-  MENU:=
-  TITLE:=
-  DESCRIPTION:=
-endef
-
-define BuildIPKGVariable
-pkg_$(subst .,_,$(subst -,_,$(1)))_$(2) = $$(Package/$(1)/$(2))
-export pkg_$(subst .,_,$(subst -,_,$(1))_$(2))
-$(1)_COMMANDS += if [ -n "$$$$$$$$pkg_$(subst .,_,$(subst -,_,$(1)))_$(2)" ]; then echo "$$$$$$$$pkg_$(subst .,_,$(subst -,_,$(1)))_$(2)" > $(2); fi;
-endef
-
-define BuildPackage
-  $(eval $(call Package/Default))
-  $(eval $(call Package/$(1)))
-
-  $(foreach FIELD, TITLE CATEGORY PRIORITY VERSION,
-    ifeq ($($(FIELD)),)
-      $$(error Package/$(1) is missing the $(FIELD) field)
-    endif
-  )
-
-  ifeq ($(PKGARCH),)
-    PKGARCH:=$(ARCH)
-  endif
-
-  ifeq ($(DESCRIPTION),)
-    $(eval DESCRIPTION:=$(TITLE))
-  endif
-
-  IPKG_$(1):=$(PACKAGE_DIR)/$(1)_$(VERSION)_$(PKGARCH).ipk
-  IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg/$(1)
-  INFO_$(1):=$(IPKG_STATE_DIR)/info/$(1).list
-
-  ifeq ($(CONFIG_PACKAGE_$(1)),y)
-    install-targets: $$(INFO_$(1))
-  endif
-
-  ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER),)
-    compile-targets: $$(IPKG_$(1))
-  endif
-
-  IDEPEND_$(1):=$$(strip $$(DEPENDS))
-
-  DUMPINFO += \
-       echo "Package: $(1)"; 
-
-  ifneq ($(MENU),)
-    DUMPINFO += \
-       echo "Menu: $(MENU)";
-  endif
-
-  ifneq ($(DEFAULT),)
-    DUMPINFO += \
-       echo "Default: $(DEFAULT)";
-  endif
-
-  DUMPINFO += \
-       echo "Version: $(VERSION)"; \
-       echo "Depends: $$(IDEPEND_$(1))"; \
-       echo "Build-Depends: $(PKG_BUILDDEP)"; \
-       echo "Category: $(CATEGORY)"; \
-       echo "Title: $(TITLE)"; \
-       echo "Description: $(DESCRIPTION)" | sed -e 's,\\,\n,g';
-
-  ifneq ($(URL),)
-    DUMPINFO += \
-       echo; \
-       echo "$(URL)";
-  endif
-
-  DUMPINFO += \
-       echo "@@";
-
-  ifneq ($(CONFIG),)
-    DUMPINFO += \
-       echo "Config: $(CONFIG)" | sed -e 's,\\,\n,g'; \
-       echo "@@";
-  endif
-
-  $(eval $(call BuildIPKGVariable,$(1),conffiles))
-  $(eval $(call BuildIPKGVariable,$(1),preinst))
-  $(eval $(call BuildIPKGVariable,$(1),postinst))
-  $(eval $(call BuildIPKGVariable,$(1),prerm))
-  $(eval $(call BuildIPKGVariable,$(1),postrm))
-  $$(IDIR_$(1))/CONTROL/control: $(PKG_BUILD_DIR)/.prepared
-       mkdir -p $$(IDIR_$(1))/CONTROL
-       echo "Package: $(1)" > $$(IDIR_$(1))/CONTROL/control
-       echo "Version: $(VERSION)" >> $$(IDIR_$(1))/CONTROL/control
-       ( \
-               DEPENDS=; \
-               for depend in $$(filter-out @%,$$(IDEPEND_$(1))); do \
-                       DEPENDS=$$$${DEPENDS:+$$$$DEPENDS, }$$$${depend##+}; \
-               done; \
-               echo "Depends: $$$$DEPENDS" >> $$(IDIR_$(1))/CONTROL/control; \
-       )
-       echo "Source: $(SOURCE)" >> $$(IDIR_$(1))/CONTROL/control
-       echo "Section: $(SECTION)" >> $$(IDIR_$(1))/CONTROL/control
-       echo "Priority: $(PRIORITY)" >> $$(IDIR_$(1))/CONTROL/control
-       echo "Maintainer: $(MAINTAINER)" >> $$(IDIR_$(1))/CONTROL/control
-       echo "Architecture: $(PKGARCH)" >> $$(IDIR_$(1))/CONTROL/control
-       echo "Description: $(DESCRIPTION)" | sed -e 's,\\,\n ,g' >> $$(IDIR_$(1))/CONTROL/control
-       chmod 644 $$(IDIR_$(1))/CONTROL/control
-       (cd $$(IDIR_$(1))/CONTROL; \
-               $($(1)_COMMANDS) \
-       )
-
-  $$(IPKG_$(1)): $$(IDIR_$(1))/CONTROL/control $(PKG_BUILD_DIR)/.built
-       $(call Package/$(1)/install,$$(IDIR_$(1)))
-       mkdir -p $(PACKAGE_DIR)
-       -find $$(IDIR_$(1)) -name CVS | xargs rm -rf
-       -find $$(IDIR_$(1)) -name .svn | xargs rm -rf
-       -find $$(IDIR_$(1)) -name '.#*' | xargs rm -f
-       $(RSTRIP) $$(IDIR_$(1))
-       $(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR)
-
-  $$(INFO_$(1)): $$(IPKG_$(1))
-       $(IPKG) install $$(IPKG_$(1))
-
-  $(1)-clean:
-       rm -f $(PACKAGE_DIR)/$(1)_*
-
-  clean: $(1)-clean
-
-  $$(eval $$(call Build/DefaultTargets,$(1)))
-
-endef
-
-ifneq ($(strip $(PKG_CAT)),)
-  define Build/Prepare/Default
-       @if [ "$(PKG_CAT)" = "unzip" ]; then \
-               unzip -d $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_SOURCE) ; \
-       else \
-               $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(PKG_BUILD_DIR)/.. $(TAR_OPTIONS) - ; \
-       fi                                                
-       @if [ -d ./patches ]; then \
-               $(PATCH) $(PKG_BUILD_DIR) ./patches ; \
-       fi
-  endef
-endif
-
-define Build/Prepare
-  $(call Build/Prepare/Default)
-endef
-
-define Build/Configure/Default
-       @(cd $(PKG_BUILD_DIR)/$(3); \
-       [ -x configure ] && \
-               $(2) \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
-               LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
-               ./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 \
-               --sbindir=/usr/sbin \
-               --libexecdir=/usr/lib \
-               --sysconfdir=/etc \
-               --datadir=/usr/share \
-               --localstatedir=/var \
-               --mandir=/usr/man \
-               --infodir=/usr/info \
-               $(DISABLE_NLS) \
-               $(1); \
-               true; \
-       )
-endef
-
-define Build/Configure
-  $(call Build/Configure/Default,)
-endef
-
-define Build/Compile/Default
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               $(TARGET_CONFIGURE_OPTS) \
-               CC=$(TARGET_CC) \
-               CROSS="$(TARGET_CROSS)" \
-               EXTRA_CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/include -I$(STAGING_DIR)/usr/include" \
-               ARCH="$(ARCH)" \
-               $(1);
-endef
-
-define Build/Compile
-  $(call Build/Compile/Default,)
-endef
-
-ifneq ($(DUMP),)
-  dumpinfo: FORCE
-       @$(DUMPINFO)
-else
-  $(PACKAGE_DIR):
-       mkdir -p $@
-               
-  ifneq ($(strip $(PKG_SOURCE)),)
-    source: $(DL_DIR)/$(PKG_SOURCE)
-
-    $(DL_DIR)/$(PKG_SOURCE):
-               mkdir -p $(DL_DIR)
-               $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(PKG_SOURCE)" "$(PKG_MD5SUM)" $(PKG_SOURCE_URL)
-
-    $(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
-  endif
-
-  source:
-  prepare: $(PKG_BUILD_DIR)/.prepared
-  configure: $(PKG_BUILD_DIR)/.configured
-
-  compile-targets:
-  compile: compile-targets
-
-  install-targets:
-  install: install-targets
-
-  clean-targets:
-  clean: FORCE
-       @$(MAKE) clean-targets
-       $(call Build/Clean)
-       rm -rf $(PKG_BUILD_DIR)
-endif
index 69f8d83a467ea6d8a2053d93cf786a55ec02f11f..057358b34d4b41c328b1763d2c7229901761df26 100644 (file)
@@ -1,7 +1,7 @@
 # $Id$
 
 include $(TOPDIR)/rules.mk
-include $(TOPDIR)/package/kernel.mk
+include $(TOPDIR)/include/kernel.mk
 
 PKG_NAME:=shfs
 PKG_VERSION:=0.35
@@ -15,7 +15,7 @@ PKG_CAT:=zcat
 
 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/kmod-shfs
 SECTION:=drivers
index 93eea633cd1d6a8abd6466f52e87316fc8007d89..86233fc64a1dfcd02c41ffad1949c1f7aa5cded3 100644 (file)
@@ -1,7 +1,7 @@
 # $Id$
 
 include $(TOPDIR)/rules.mk
-include $(TOPDIR)/package/kernel.mk
+include $(TOPDIR)/include/kernel.mk
 
 PKG_NAME:=spca5xx
 PKG_VERSION:=20060301
@@ -13,7 +13,7 @@ PKG_SOURCE_URL:=http://mxhaard.free.fr/spca50x/Download/
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_CAT:=zcat
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 #FIXME: add proper dependency handling on kmod-usb-core & kmod-videodev packages
 define Package/kmod-spca5xx
index e8aa6a02a484e0f5b7d1eb3f6cd0793ddd15008a..cb5f34674805d88bbace32a880e67899f0381be2 100644 (file)
@@ -1,14 +1,14 @@
 # $Id$
 
 include $(TOPDIR)/rules.mk
-include $(TOPDIR)/package/kernel.mk
+include $(TOPDIR)/include/kernel.mk
 
 PKG_NAME:=kmod-switch
 PKG_RELEASE:=1
 
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/kmod-switch
 SECTION:=drivers
index 54e06dcff6198780b2c58c1bfc05db99ee449f1a..5d397161b199c28ae9e839422798b2766a7aa865 100644 (file)
@@ -19,7 +19,7 @@ PKG_CAT:=bzcat
 
 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/udev
 SECTION:=base
index 6f227a1bf492580124509ca7356ade88bf86aadf..6d003f6c0da14c73578bd4bd8f2c681636644d1d 100644 (file)
@@ -1,7 +1,7 @@
 # $Id: Makefile 2767 2005-12-25 02:10:14Z wbx $
 
 include $(TOPDIR)/rules.mk
-include $(TOPDIR)/package/kernel.mk
+include $(TOPDIR)/include/kernel.mk
 
 PKG_NAME:=ueagle-atm
 PKG_VERSION:=1.0d1
@@ -15,7 +15,7 @@ PKG_CAT:=zcat
 
 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 #FIXME: add dependency on kmod-usb-core
 define Package/kmod-ueagle-atm
index ef28bdb69e934cf14b34aed736f0ebe459bd4c55..673ade433f805878b41920e37070faf8e2ff45e5 100644 (file)
@@ -16,7 +16,7 @@ PKG_CAT:=zcat
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/fdisk
 SECTION:=base
index ad4eddab8c9c9dc05d778acd66cc6aa8735fb3a4..368d3ebb015d722c41102bcf33d5dacd27124509 100644 (file)
@@ -14,7 +14,7 @@ PKG_CAT:=zcat
 
 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/wireless-tools
 SECTION:=base
index af1f07593fda39b4d2dca9c3dbd468c0bc88e26d..d5feede6c952964e0f333c2030a36792676613f3 100644 (file)
@@ -1,14 +1,14 @@
 # $Id$
 
 include $(TOPDIR)/rules.mk
-include $(TOPDIR)/package/kernel.mk
+include $(TOPDIR)/include/kernel.mk
 
 PKG_NAME:=kmod-wlcompat
 PKG_RELEASE:=3
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/kmod-wlcompat
 SECTION:=drivers
index a71873b9f7f678ac37192b52ddb395cc7bc0d703..1c79922cfcaaa9ce735f4cf5ea671915525d6266 100644 (file)
@@ -1,7 +1,7 @@
 # $Id: Makefile 3297 2006-03-02 23:42:52Z florian $
 
 include $(TOPDIR)/rules.mk
-include $(TOPDIR)/package/kernel.mk
+include $(TOPDIR)/include/kernel.mk
 
 PKG_NAME:=zd1211
 PKG_VERSION:=r69
@@ -13,7 +13,7 @@ PKG_SOURCE_URL:=http://zd1211.ath.cx/download/
 PKG_SOURCE:=$(PKG_NAME)-driver-$(PKG_VERSION).tgz
 PKG_CAT:=zcat
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 #FIXME: add proper dependency handling on kmod-usb-core packages
 define Package/kmod-zd1211
index 02659bb9ac15e3e4eec257f58c826b5eb6d21e68..8e497c2f28c4ed26055b2f9e5943ad3806ae1c2a 100644 (file)
@@ -14,7 +14,7 @@ PKG_CAT:=bzcat
 
 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
-include $(TOPDIR)/package/rules.mk
+include $(TOPDIR)/include/package.mk
 
 define Package/zlib
 SECTION:=base
index d64053cbd400103e725176bc06f5015f49c319cb..9205f5b986767f86ab6726d03cd09ff950c5d95a 100644 (file)
@@ -5,9 +5,9 @@ all: install
 $(BIN_DIR):
        mkdir -p $(BIN_DIR)
 
-TARGETS:=linux utils lzma
+TARGETS:=linux utils
 
-linux-compile: utils-install lzma-install
+linux-compile: utils-install
 linux-install: $(BIN_DIR)
 
 download: $(patsubst %,%-source,$(TARGETS))
@@ -27,11 +27,6 @@ image_clean: FORCE
        $(MAKE) -C $(patsubst %-prepare,%,$@) prepare
 %-compile: %-prepare
        $(MAKE) -C $(patsubst %-compile,%,$@) compile
-%-rebuild: FORCE
-       $(MAKE) -C $(patsubst %-rebuild,%,$@) rebuild
 %-install: %-compile
        $(MAKE) -C $(patsubst %-install,%,$@) install
-linux-imagebuilder: FORCE
-       $(MAKE) -C linux imagebuilder
-
 
index 946ace320459af7e382fdd9246a6113b36e1b316..23c96b76df855a7747872b402ed75ac5d9e617de 100644 (file)
@@ -13,8 +13,8 @@ menu "Target Root Filesystem"
                help
                  Build a jffs2 root filesystem
 
-       config TARGET_ROOTFS_SQUASHFS_LZMA
-               bool "squashfs-lzma"
+       config TARGET_ROOTFS_SQUASHFS
+               bool "squashfs"
                default y
                depends !LINUX_2_6_ARUBA
                depends !LINUX_2_6_XSCALE
index 2caee31b3661042770517a02d4ad87a3b3894291..e1a314d1d8380ed7ba427d8e1cb41adc9e7de5bf 100644 (file)
@@ -30,6 +30,7 @@ source:
        $(MAKE) -C image/$(BOARD) source
 
 prepare:
+       rm -f $(TOPDIR)/.kernel.mk
        $(MAKE) -C $(BOARD)-$(KERNEL) prepare
 
 compile:
index 3abb30d48772b6f91912284b521d390454eee9c9..96a32848e7c6f4743dd45773ab1c662c61a35cf7 100644 (file)
@@ -4,10 +4,9 @@ LINUX_VERSION:=2.4.32
 LINUX_RELEASE:=1
 LINUX_KERNEL_MD5SUM:=38f4d0830e95a20f4bfed17622d5557c
 
-include ../rules.mk
 include ./config
-include ../generic-$(KERNEL)/modules.mk
-include ../kernel.mk
+include $(TOPDIR)/include/kernel.mk
+include $(TOPDIR)/include/kernel-build.mk
 
 $(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
        [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches
index 20ad3523ac22f12b4b3b65caa818d866b01aa9dc..c8688da044e946f24bd2414b7bbe71e352a24547 100644 (file)
@@ -4,8 +4,8 @@ LINUX_VERSION:=2.4.32
 LINUX_RELEASE:=1
 LINUX_KERNEL_MD5SUM:=38f4d0830e95a20f4bfed17622d5557c
 
-include ../rules.mk
 include ./config
+include $(TOPDIR)/include/kernel.mk
 
 ATM_FIRMWARE_VERSION:=0.4
 ATM_FIRMWARE_DIR=sangam-atm-firmware-$(ATM_FIRMWARE_VERSION)
@@ -26,8 +26,7 @@ $(eval $(call KMOD_template,CPMAC,cpmac,\
        $(MODULES_DIR)/kernel/drivers/net/avalanche_cpmac/avalanche_cpmac.o \
 ,CONFIG_MIPS_AVALANCHE_CPMAC,,10,avalanche_cpmac))
 
-include ../generic-$(KERNEL)/modules.mk
-include ../kernel.mk
+include $(TOPDIR)/include/kernel-build.mk
 
 
 $(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
index 1f68614254de6ecb6e29a298511272523bdd5c4f..652e4b91328750efb6ef7c48acb4f322010ebab5 100644 (file)
@@ -4,12 +4,9 @@ LINUX_VERSION:=2.6.17
 LINUX_RELEASE:=1
 LINUX_KERNEL_MD5SUM:=37ddefe96625502161f075b9d907f21e
 
-include ../rules.mk
 include ./config
-
-include ../generic-$(KERNEL)/modules.mk
-include ../kernel.mk
-
+include $(TOPDIR)/include/kernel.mk
+include $(TOPDIR)/include/kernel-build.mk
 
 $(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
        [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches $(MAKE_TRACE)
index 39d8d4c8b02378bba81ab371bf4300b8858afa62..b1ca0fee3447c5a77596e6ff289d7adf3c9391da 100644 (file)
@@ -4,12 +4,9 @@ LINUX_VERSION:=2.6.17
 LINUX_RELEASE:=1
 LINUX_KERNEL_MD5SUM:=37ddefe96625502161f075b9d907f21e
 
-include ../rules.mk
 include ./config
-
-include ../generic-$(KERNEL)/modules.mk
-include ../kernel.mk
-
+include $(TOPDIR)/include/kernel.mk
+include $(TOPDIR)/include/kernel-build.mk
 
 $(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
        [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches
index 022f3352c5d5359fb6fe437cc2e1804b251f75fd..20a6210666a7ad91b477e50e29b2a4c2fd87af94 100644 (file)
@@ -4,8 +4,8 @@ LINUX_VERSION:=2.4.32
 LINUX_RELEASE:=1
 LINUX_KERNEL_MD5SUM:=38f4d0830e95a20f4bfed17622d5557c
 
-include ../rules.mk
 include ./config
+include $(TOPDIR)/include/kernel.mk
 
 # broadcom specific kmod packages
 $(eval $(call KMOD_template,LP,lp,\
@@ -15,8 +15,7 @@ $(eval $(call KMOD_template,LP,lp,\
        $(MODULES_DIR)/kernel/drivers/char/ppdev.o \
 ,CONFIG_PARPORT,,50,parport parport_splink lp))
 
-include ../generic-$(KERNEL)/modules.mk
-include ../kernel.mk
+include $(TOPDIR)/include/kernel-build.mk
 
 
 $(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
index 1f68614254de6ecb6e29a298511272523bdd5c4f..a3b8177c203beff24aea9bbfdb60b84a7dca7883 100644 (file)
@@ -4,11 +4,9 @@ LINUX_VERSION:=2.6.17
 LINUX_RELEASE:=1
 LINUX_KERNEL_MD5SUM:=37ddefe96625502161f075b9d907f21e
 
-include ../rules.mk
 include ./config
-
-include ../generic-$(KERNEL)/modules.mk
-include ../kernel.mk
+include $(TOPDIR)/include/kernel.mk
+include $(TOPDIR)/include/kernel-build.mk
 
 
 $(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
diff --git a/openwrt/target/linux/generic-2.4/modules.mk b/openwrt/target/linux/generic-2.4/modules.mk
deleted file mode 100644 (file)
index 540ac71..0000000
+++ /dev/null
@@ -1,320 +0,0 @@
-include ../netfilter.mk
-
-# Networking
-
-$(eval $(call KMOD_template,ATM,atm,\
-       $(MODULES_DIR)/kernel/net/atm/atm.o \
-       $(MODULES_DIR)/kernel/net/atm/br2684.o \
-,CONFIG_ATM,,50,atm))
-
-$(eval $(call KMOD_template,GRE,gre,\
-       $(MODULES_DIR)/kernel/net/ipv4/ip_gre.o \
-,CONFIG_NET_IPGRE))
-
-$(eval $(call KMOD_template,IMQ,imq,\
-       $(MODULES_DIR)/kernel/net/ipv4/netfilter/*IMQ*.o \
-       $(MODULES_DIR)/kernel/drivers/net/imq.o \
-))
-$(eval $(call KMOD_template,IPIP,ipip,\
-       $(MODULES_DIR)/kernel/net/ipv4/ipip.o \
-,CONFIG_NET_IPIP,,60,ipip))
-
-$(eval $(call KMOD_template,IPV6,ipv6,\
-       $(MODULES_DIR)/kernel/net/ipv6/ipv6.o \
-,CONFIG_IPV6,,20,ipv6))
-
-$(eval $(call KMOD_template,PPP,ppp,\
-       $(MODULES_DIR)/kernel/drivers/net/ppp_async.o \
-       $(MODULES_DIR)/kernel/drivers/net/ppp_generic.o \
-       $(MODULES_DIR)/kernel/drivers/net/slhc.o \
-       $(MODULES_DIR)/kernel/drivers/net/pppox.o \
-,CONFIG_PPP))
-
-$(eval $(call KMOD_template,MPPE,mppe,\
-       $(MODULES_DIR)/kernel/drivers/net/ppp_mppe_mppc.o \
-,CONFIG_PPP_MPPE_MPPC))
-
-$(eval $(call KMOD_template,PPPOATM,pppoatm,\
-       $(MODULES_DIR)/kernel/net/atm/pppoatm.o \
-,CONFIG_PPPOATM))
-
-$(eval $(call KMOD_template,PPPOE,pppoe,\
-       $(MODULES_DIR)/kernel/drivers/net/pppoe.o \
-,CONFIG_PPPOE))
-
-$(eval $(call KMOD_template,SCHED,sched,\
-       $(MODULES_DIR)/kernel/net/sched/*.o \
-))
-
-$(eval $(call KMOD_template,TUN,tun,\
-       $(MODULES_DIR)/kernel/drivers/net/tun.o \
-,CONFIG_TUN,,20,tun))
-
-# Filtering / Firewalling
-
-$(eval $(call KMOD_template,ARPTABLES,arptables,\
-       $(MODULES_DIR)/kernel/net/ipv4/netfilter/arp*.o \
-,CONFIG_IP_NF_ARPTABLES))
-
-$(eval $(call KMOD_template,EBTABLES,ebtables,\
-       $(MODULES_DIR)/kernel/net/bridge/netfilter/*.o \
-,CONFIG_BRIDGE_NF_EBTABLES))
-
-# metapackage for compatibility ...
-$(eval $(call KMOD_template,IPTABLES_EXTRA,iptables-extra,\
-,,kmod-ipt-conntrack kmod-ipt-extra kmod-ipt-filter kmod-ipt-ipopt kmod-ipt-ipsec kmod-ipt-nat kmod-ipt-nat-extra kmod-ipt-queue kmod-ipt-ulogd))
-
-$(eval $(call KMOD_template,IPT_CONNTRACK,ipt-conntrack,\
-       $(foreach mod,$(IPT_CONNTRACK-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).o) \
-))
-
-$(eval $(call KMOD_template,IPT_EXTRA,ipt-extra,\
-       $(foreach mod,$(IPT_EXTRA-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).o) \
-))
-
-$(eval $(call KMOD_template,IPT_FILTER,ipt-filter,\
-       $(foreach mod,$(IPT_FILTER-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).o) \
-))
-
-$(eval $(call KMOD_template,IPT_IPOPT,ipt-ipopt,\
-       $(foreach mod,$(IPT_IPOPT-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).o) \
-))
-
-$(eval $(call KMOD_template,IPT_IPSEC,ipt-ipsec,\
-       $(foreach mod,$(IPT_IPSEC-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).o) \
-))
-
-$(eval $(call KMOD_template,IPT_NAT,ipt-nat,\
-       $(foreach mod,$(IPT_NAT-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).o) \
-))
-
-$(eval $(call KMOD_template,IPT_NAT_EXTRA,ipt-nat-extra,\
-       $(foreach mod,$(IPT_NAT_EXTRA-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).o) \
-,,,40,$(IPT_NAT_EXTRA-m)))
-
-$(eval $(call KMOD_template,IPT_QUEUE,ipt-queue,\
-       $(foreach mod,$(IPT_QUEUE-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).o) \
-))
-
-$(eval $(call KMOD_template,IPT_ULOG,ipt-ulog,\
-       $(foreach mod,$(IPT_ULOG-m),$(MODULES_DIR)/kernel/net/ipv4/netfilter/$(mod).o) \
-))
-
-$(eval $(call KMOD_template,IP6TABLES,ip6tables,\
-       $(MODULES_DIR)/kernel/net/ipv6/netfilter/ip*.o \
-,CONFIG_IP6_NF_IPTABLES,kmod-ipv6))
-
-
-# Block devices
-
-$(eval $(call KMOD_template,IDE,ide,\
-       $(MODULES_DIR)/kernel/drivers/ide/*.o \
-       $(MODULES_DIR)/kernel/drivers/ide/*/*.o \
-,CONFIG_IDE,,20,pdc202xx_old ide-core ide-detect ide-disk))
-
-$(eval $(call KMOD_template,LOOP,loop,\
-    $(MODULES_DIR)/kernel/drivers/block/loop.o \
-,CONFIG_BLK_DEV_LOOP,,20,loop))
-
-$(eval $(call KMOD_template,NBD,nbd,\
-    $(MODULES_DIR)/kernel/drivers/block/nbd.o \
-,CONFIG_BLK_DEV_NBD,,20,nbd))
-
-
-# Crypto
-
-ifneq ($(wildcard $(MODULES_DIR)/kernel/crypto/*.o),)
-CONFIG_CRYPTO:=m
-endif
-$(eval $(call KMOD_template,CRYPTO,crypto,\
-       $(MODULES_DIR)/kernel/crypto/*.o \
-,CONFIG_CRYPTO))
-
-
-# Filesystems
-
-$(eval $(call KMOD_template,FS_CIFS,fs-cifs,\
-       $(MODULES_DIR)/kernel/fs/cifs/cifs.o \
-,CONFIG_CIFS,,30,cifs))
-
-$(eval $(call KMOD_template,FS_MINIX,fs-minix,\
-       $(MODULES_DIR)/kernel/fs/minix/*.o \
-,CONFIG_MINIX_FS,,30,minix))
-
-$(eval $(call KMOD_template,FS_EXT2,fs-ext2,\
-       $(MODULES_DIR)/kernel/fs/ext2/*.o \
-,CONFIG_EXT2_FS,,30,ext2))
-
-$(eval $(call KMOD_template,FS_EXT3,fs-ext3,\
-       $(MODULES_DIR)/kernel/fs/ext3/*.o \
-       $(MODULES_DIR)/kernel/fs/jbd/*.o \
-,CONFIG_EXT3_FS,,30,jbd ext3))
-
-$(eval $(call KMOD_template,FS_HFSPLUS,fs-hfsplus,\
-       $(MODULES_DIR)/kernel/fs/hfsplus/*.o \
-,CONFIG_HFSPLUS_FS,,30,hfsplus))
-
-$(eval $(call KMOD_template,FS_NFS,fs-nfs,\
-       $(MODULES_DIR)/kernel/fs/lockd/*.o \
-       $(MODULES_DIR)/kernel/fs/nfs/*.o \
-       $(MODULES_DIR)/kernel/net/sunrpc/*.o \
-,CONFIG_NFS_FS,,30,sunrpc lockd nfs))
-
-$(eval $(call KMOD_template,FS_VFAT,fs-vfat,\
-       $(MODULES_DIR)/kernel/fs/vfat/vfat.o \
-       $(MODULES_DIR)/kernel/fs/fat/fat.o \
-,CONFIG_VFAT_FS,,30,fat vfat))
-
-$(eval $(call KMOD_template,FS_XFS,fs-xfs,\
-       $(MODULES_DIR)/kernel/fs/xfs/*.o \
-,CONFIG_XFS_FS,,30,xfs))
-
-
-# Multimedia
-
-$(eval $(call KMOD_template,PWC,pwc,\
-       $(MODULES_DIR)/kernel/drivers/usb/pwc.o \
-,CONFIG_USB_PWC,kmod-videodev,63,pwc))
-
-$(eval $(call KMOD_template,SOUNDCORE,soundcore,\
-       $(MODULES_DIR)/kernel/drivers/sound/soundcore.o \
-,CONFIG_SOUND,,30,soundcore))
-
-$(eval $(call KMOD_template,VIDEODEV,videodev,\
-       $(MODULES_DIR)/kernel/drivers/media/video/videodev.o \
-,CONFIG_VIDEO_DEV,,62,videodev))
-
-
-# Network devices
-
-$(eval $(call KMOD_template,NET_3C59X,net-3c59x,\
-       $(MODULES_DIR)/kernel/drivers/net/3c59x.o \
-,CONFIG_VORTEX,,10,3c59x))
-
-$(eval $(call KMOD_template,NET_8139TOO,net-8139too,\
-       $(MODULES_DIR)/kernel/drivers/net/8139too.o \
-       $(MODULES_DIR)/kernel/drivers/net/mii.o \
-,CONFIG_8139TOO,,10,mii 8139too))
-
-$(eval $(call KMOD_template,NET_AIRO,net-airo,\
-       $(MODULES_DIR)/kernel/drivers/net/wireless/airo.o \
-,CONFIG_AIRO,,10,airo))
-
-$(eval $(call KMOD_template,NET_E100,net-e100,\
-       $(MODULES_DIR)/kernel/drivers/net/e100.o \
-,CONFIG_E100,,10,e100))
-
-$(eval $(call KMOD_template,NET_HERMES,net-hermes,\
-       $(MODULES_DIR)/kernel/drivers/net/wireless/hermes.o \
-       $(MODULES_DIR)/kernel/drivers/net/wireless/orinoco.o \
-,CONFIG_HERMES,,10,hermes orinoco))
-
-$(eval $(call KMOD_template,NET_HERMES_PCI,net-hermes-pci,\
-       $(MODULES_DIR)/kernel/drivers/net/wireless/orinoco_pci.o \
-,CONFIG_PCI_HERMES,kmod-net-hermes,11,orinoco_pci))
-
-$(eval $(call KMOD_template,NET_HERMES_PCI,net-hermes-plx,\
-       $(MODULES_DIR)/kernel/drivers/net/wireless/orinoco_plx.o \
-,CONFIG_PLX_HERMES,kmod-net-hermes,11,orinoco_plx))
-
-$(eval $(call KMOD_template,NET_NATSEMI,net-natsemi,\
-       $(MODULES_DIR)/kernel/drivers/net/natsemi.o \
-,CONFIG_NATSEMI,,10,natsemi))
-
-$(eval $(call KMOD_template,NET_PRISM54,net-prism54,\
-       $(MODULES_DIR)/kernel/drivers/net/wireless/prism54/prism54.o \
-,CONFIG_PRISM54,,10,prism54))
-
-
-# PCMCIA/CardBus
-
-$(eval $(call KMOD_template,PCMCIA_CORE,pcmcia-core,\
-       $(MODULES_DIR)/kernel/drivers/pcmcia/pcmcia_core.o \
-       $(MODULES_DIR)/kernel/drivers/pcmcia/yenta_socket.o \
-       $(MODULES_DIR)/kernel/drivers/pcmcia/ds.o \
-,CONFIG_PCMCIA,,50,pcmcia_core yenta_socket ds))
-
-$(eval $(call KMOD_template,PCMCIA_SERIAL,pcmcia-serial,\
-       $(MODULES_DIR)/kernel/drivers/char/pcmcia/serial_cs.o \
-,CONFIG_PCMCIA_SERIAL_CS,kmod-pcmcia-core,51,serial_cs))
-
-
-# USB
-
-$(eval $(call KMOD_template,USB,usb-core,\
-       $(MODULES_DIR)/kernel/drivers/usb/usbcore.o \
-,CONFIG_USB,,50,usbcore))
-
-$(eval $(call KMOD_template,USB_OHCI,usb-ohci,\
-       $(MODULES_DIR)/kernel/drivers/usb/host/usb-ohci.o \
-,CONFIG_USB_OHCI,kmod-usb-core,60,usb-ohci))
-
-$(eval $(call KMOD_template,USB_UHCI,usb-uhci,\
-       $(MODULES_DIR)/kernel/drivers/usb/host/uhci.o \
-,CONFIG_USB_UHCI_ALT,kmod-usb-core,60,uhci))
-
-$(eval $(call KMOD_template,USB2,usb2,\
-       $(MODULES_DIR)/kernel/drivers/usb/host/ehci-hcd.o \
-,CONFIG_USB_EHCI_HCD,kmod-usb-core,60,ehci-hcd))
-
-$(eval $(call KMOD_template,USB_ACM,usb-acm,\
-       $(MODULES_DIR)/kernel/drivers/usb/acm.o \
-,CONFIG_USB_ACM))
-
-$(eval $(call KMOD_template,USB_AUDIO,usb-audio,\
-       $(MODULES_DIR)/kernel/drivers/usb/audio.o \
-,CONFIG_USB_AUDIO,kmod-soundcore kmod-usb-core,61,audio))
-
-$(eval $(call KMOD_template,USB_PRINTER,usb-printer,\
-       $(MODULES_DIR)/kernel/drivers/usb/printer.o \
-,CONFIG_USB_PRINTER,kmod-usb-core,60,printer))
-
-$(eval $(call KMOD_template,USB_SERIAL,usb-serial,\
-       $(MODULES_DIR)/kernel/drivers/usb/serial/usbserial.o \
-,CONFIG_USB_SERIAL,kmod-usb-core,60,usbserial))
-
-$(eval $(call KMOD_template,USB_SERIAL_BELKIN,usb-serial-belkin,\
-       $(MODULES_DIR)/kernel/drivers/usb/serial/belkin_sa.o \
-,CONFIG_USB_SERIAL_BELKIN,kmod-usb-serial,61,belkin_sa))
-
-$(eval $(call KMOD_template,USB_SERIAL_FTDI,usb-serial-ftdi,\
-       $(MODULES_DIR)/kernel/drivers/usb/serial/ftdi_sio.o \
-,CONFIG_USB_SERIAL_FTDI_SIO,kmod-usb-serial,61,ftdi_sio))
-
-$(eval $(call KMOD_template,USB_SERIAL_MCT_U232,usb-serial-mct-u232,\
-       $(MODULES_DIR)/kernel/drivers/usb/serial/mct_u232.o \
-,CONFIG_USB_SERIAL_MCT_U232,kmod-usb-serial,61,mct_u232))
-
-$(eval $(call KMOD_template,USB_SERIAL_PL2303,usb-serial-pl2303,\
-       $(MODULES_DIR)/kernel/drivers/usb/serial/pl2303.o \
-,CONFIG_USB_SERIAL_PL2303,kmod-usb-serial,61,pl2303))
-
-$(eval $(call KMOD_template,USB_SERIAL_VISOR,usb-serial-visor,\
-       $(MODULES_DIR)/kernel/drivers/usb/serial/visor.o \
-,CONFIG_USB_SERIAL_VISOR,kmod-usb-serial,61,visor))
-
-$(eval $(call KMOD_template,USB_STORAGE,usb-storage,\
-       $(MODULES_DIR)/kernel/drivers/scsi/*.o \
-       $(MODULES_DIR)/kernel/drivers/usb/storage/*.o \
-,CONFIG_USB_STORAGE,kmod-usb-core,60,scsi_mod sd_mod usb-storage))
-
-
-# Misc. devices
-
-$(eval $(call KMOD_template,AX25,ax25,\
-       $(MODULES_DIR)/kernel/net/ax25/ax25.o \
-       $(MODULES_DIR)/kernel/drivers/net/hamradio/mkiss.o \
-,CONFIG_AX25,,90,ax25 mkiss))
-
-$(eval $(call KMOD_template,BLUETOOTH,bluetooth,\
-       $(MODULES_DIR)/kernel/net/bluetooth/*.o \
-       $(MODULES_DIR)/kernel/net/bluetooth/rfcomm/*.o \
-       $(MODULES_DIR)/kernel/drivers/bluetooth/*.o \
-,CONFIG_BLUEZ))
-
-$(eval $(call KMOD_template,SOFTDOG,softdog,\
-       $(MODULES_DIR)/kernel/drivers/char/softdog.o \
-,CONFIG_SOFT_WATCHDOG,,95,softdog))
-
-
-
diff --git a/openwrt/target/linux/generic-2.6/modules.mk b/openwrt/target/linux/generic-2.6/modules.mk
deleted file mode 100644 (file)
index b582400..0000000
+++ /dev/null
@@ -1,357 +0,0 @@
-NF_2_6:=1
-include ../netfilter.mk
-
-# Networking
-
-$(eval $(call KMOD_template,ATM,atm,\
-       $(MODULES_DIR)/kernel/net/atm/atm.ko \
-       $(MODULES_DIR)/kernel/net/atm/br2684.ko \
-       $(MODULES_DIR)/kernel/drivers/atm/atmtcp.ko \
-,CONFIG_ATM,,50,atm))
-
-$(eval $(call KMOD_template,GRE,gre,\
-       $(MODULES_DIR)/kernel/net/ipv4/ip_gre.ko \
-,CONFIG_NET_IPGRE))
-
-$(eval $(call KMOD_template,IMQ,imq,\
-       $(MODULES_DIR)/kernel/net/ipv4/netfilter/*IMQ*.ko \
-       $(MODULES_DIR)/kernel/drivers/net/imq.ko \
-))
-
-$(eval $(call KMOD_template,IPIP,ipip,\
-       $(MODULES_DIR)/kernel/net/ipv4/ipip.ko \
-,CONFIG_NET_IPIP,,60,ipip))
-
-$(eval $(call KMOD_template,IPV6,ipv6,\
-       $(MODULES_DIR)/kernel/net/ipv6/ipv6.ko \
-,CONFIG_IPV6,,20,ipv6))
-
-$(eval $(call KMOD_template,PPP,ppp,\
-       $(MODULES_DIR)/kernel/drivers/net/ppp_async.ko \
-       $(MODULES_DIR)/kernel/drivers/net/ppp_generic.ko \
-       $(MODULES_DIR)/kernel/drivers/net/slhc.ko \
-       $(MODULES_DIR)/kernel/lib/crc-ccitt.ko \
-,CONFIG_PPP))
-
-#$(eval $(call KMOD_template,MPPE,mppe,\
-#      $(MODULES_DIR)/kernel/drivers/net/ppp_mppe_mppc.ko \
-#,CONFIG_PPP_MPPE_MPPC))
-
-$(eval $(call KMOD_template,PPPOATM,pppoatm,\
-       $(MODULES_DIR)/kernel/net/atm/pppoatm.ko \
-,CONFIG_PPPOATM))
-
-$(eval $(call KMOD_template,PPPOE,pppoe,\
-       $(MODULES_DIR)/kernel/drivers/net/pppoe.ko \
-       $(MODULES_DIR)/kernel/drivers/net/pppox.ko \
-,CONFIG_PPPOE))
-
-$(eval $(call KMOD_template,SCHED,sched,\
-       $(MODULES_DIR)/kernel/net/sched/*.ko \
-))
-
-$(eval $(call KMOD_template,TUN,tun,\
-       $(MODULES_DIR)/kernel/drivers/net/tun.ko \
-,CONFIG_TUN,,20,tun))
-
-
-# Filtering / Firewalling
-
-$(eval $(call KMOD_template,ARPTABLES,arptables,\
-       $(MODULES_DIR)/kernel/net/ipv4/netfilter/arp*.ko \
-,CONFIG_IP_NF_ARPTABLES))
-
-$(eval $(call KMOD_template,EBTABLES,ebtables,\
-       $(MODULES_DIR)/kernel/net/bridge/netfilter/*.ko \
-,CONFIG_BRIDGE_NF_EBTABLES))
-
-# metapackage for compatibility ...
-$(eval $(call KMOD_template,IPTABLES_EXTRA,iptables-extra,\
-,,kmod-ipt-conntrack kmod-ipt-extra kmod-ipt-filter kmod-ipt-ipopt kmod-ipt-ipsec kmod-ipt-nat kmod-ipt-nat-extra kmod-ipt-queue kmod-ipt-ulogd))
-
-$(eval $(call KMOD_template,IPT_CONNTRACK,ipt-conntrack,\
-       $(foreach mod,$(IPT_CONNTRACK-m),$(MODULES_DIR)/kernel/net/$(mod).ko) \
-))
-
-$(eval $(call KMOD_template,IPT_EXTRA,ipt-extra,\
-       $(foreach mod,$(IPT_EXTRA-m),$(MODULES_DIR)/kernel/net/$(mod).ko) \
-))
-
-$(eval $(call KMOD_template,IPT_FILTER,ipt-filter,\
-       $(foreach mod,$(IPT_FILTER-m),$(MODULES_DIR)/kernel/net/$(mod).ko) \
-))
-
-$(eval $(call KMOD_template,IPT_IPOPT,ipt-ipopt,\
-       $(foreach mod,$(IPT_IPOPT-m),$(MODULES_DIR)/kernel/net/$(mod).ko) \
-))
-
-$(eval $(call KMOD_template,IPT_IPSEC,ipt-ipsec,\
-       $(foreach mod,$(IPT_IPSEC-m),$(MODULES_DIR)/kernel/net/$(mod).ko) \
-))
-
-$(eval $(call KMOD_template,IPT_NAT,ipt-nat,\
-       $(foreach mod,$(IPT_NAT-m),$(MODULES_DIR)/kernel/net/$(mod).ko) \
-))
-
-$(eval $(call KMOD_template,IPT_NAT_EXTRA,ipt-nat-extra,\
-       $(foreach mod,$(IPT_NAT_EXTRA-m),$(MODULES_DIR)/kernel/net/$(mod).ko) \
-,,,40,$(IPT_NAT_EXTRA-m)))
-
-$(eval $(call KMOD_template,IPT_QUEUE,ipt-queue,\
-       $(foreach mod,$(IPT_QUEUE-m),$(MODULES_DIR)/kernel/net/$(mod).ko) \
-))
-
-$(eval $(call KMOD_template,IPT_ULOG,ipt-ulog,\
-       $(foreach mod,$(IPT_ULOG-m),$(MODULES_DIR)/kernel/net/$(mod).ko) \
-))
-
-$(eval $(call KMOD_template,IP6TABLES,ip6tables,\
-       $(MODULES_DIR)/kernel/net/ipv6/netfilter/ip*.ko \
-,CONFIG_IP6_NF_IPTABLES,kmod-ipv6))
-
-
-# Block devices
-
-$(eval $(call KMOD_template,IDE,ide,\
-       $(MODULES_DIR)/kernel/drivers/ide/*.ko \
-       $(MODULES_DIR)/kernel/drivers/ide/*/*.ko \
-,CONFIG_IDE))
-
-$(eval $(call KMOD_template,LOOP,loop,\
-    $(MODULES_DIR)/kernel/drivers/block/loop.ko \
-,CONFIG_BLK_DEV_LOOP,,20,loop))
-
-$(eval $(call KMOD_template,NBD,nbd,\
-    $(MODULES_DIR)/kernel/drivers/block/nbd.ko \
-,CONFIG_BLK_DEV_NBD,,20,nbd))
-
-
-# Crypto
-
-$(eval $(call KMOD_template,CRYPTO,crypto,\
-       $(MODULES_DIR)/kernel/crypto/*.ko \
-))
-
-
-# Filesystems
-
-$(eval $(call KMOD_template,FS_CIFS,fs-cifs,\
-       $(MODULES_DIR)/kernel/fs/cifs/cifs.ko \
-,CONFIG_CIFS,kmod-nls-base,30,cifs))
-
-$(eval $(call KMOD_template,FS_MINIX,fs-minix,\
-       $(MODULES_DIR)/kernel/fs/minix/minix.ko \
-,CONFIG_MINIX_FS,,30,minix))
-
-$(eval $(call KMOD_template,FS_EXT2,fs-ext2,\
-       $(MODULES_DIR)/kernel/fs/ext2/ext2.ko \
-,CONFIG_EXT2_FS,,30,ext2))
-
-$(eval $(call KMOD_template,FS_EXT3,fs-ext3,\
-       $(MODULES_DIR)/kernel/fs/ext3/ext3.ko \
-       $(MODULES_DIR)/kernel/fs/jbd/jbd.ko \
-,CONFIG_EXT3_FS,,30,jbd ext3))
-
-$(eval $(call KMOD_template,FS_HFSPLUS,fs-hfsplus,\
-       $(MODULES_DIR)/kernel/fs/hfsplus/hfsplus.ko \
-,CONFIG_HFSPLUS_FS,kmod-nls-base,30,hfsplus))
-
-$(eval $(call KMOD_template,FS_NFS,fs-nfs,\
-       $(MODULES_DIR)/kernel/fs/lockd/lockd.ko \
-       $(MODULES_DIR)/kernel/fs/nfs/nfs.ko \
-       $(MODULES_DIR)/kernel/net/sunrpc/sunrpc.ko \
-,CONFIG_NFS_FS,,30,sunrpc lockd nfs))
-
-$(eval $(call KMOD_template,FS_VFAT,fs-vfat,\
-       $(MODULES_DIR)/kernel/fs/fat/fat.ko \
-       $(MODULES_DIR)/kernel/fs/vfat/vfat.ko \
-,CONFIG_VFAT_FS,kmod-nls-base,30,fat vfat))
-
-$(eval $(call KMOD_template,FS_XFS,fs-xfs,\
-       $(MODULES_DIR)/kernel/fs/xfs/xfs.ko \
-,CONFIG_XFS_FS,,30,xfs))
-
-
-# Multimedia
-
-$(eval $(call KMOD_template,PWC,pwc,\
-       $(MODULES_DIR)/kernel/drivers/usb/media/pwc/pwc.ko \
-,CONFIG_USB_PWC,kmod-videodev,63,pwc))
-
-$(eval $(call KMOD_template,SOUNDCORE,soundcore,\
-       $(MODULES_DIR)/kernel/sound/soundcore.ko \
-,CONFIG_SOUND,,30,soundcore))
-
-$(eval $(call KMOD_template,VIDEODEV,videodev,\
-       $(MODULES_DIR)/kernel/drivers/media/video/v4l1-compat.ko \
-       $(MODULES_DIR)/kernel/drivers/media/video/v4l2-common.ko \
-       $(MODULES_DIR)/kernel/drivers/media/video/videodev.ko \
-,CONFIG_VIDEO_DEV,,62,videodev))
-
-
-# NLS
-
-$(eval $(call KMOD_template,NLS_BASE,nls-base,\
-       $(MODULES_DIR)/kernel/fs/nls/nls_base.ko \
-,CONFIG_NLS,,20,nls_base))
-
-$(eval $(call KMOD_template,NLS_CP437,nls-cp437,\
-       $(MODULES_DIR)/kernel/fs/nls/nls_cp437.ko \
-,CONFIG_NLS_CODEPAGE_437,,20,nls_cp437))
-
-$(eval $(call KMOD_template,NLS_CP850,nls-cp850,\
-       $(MODULES_DIR)/kernel/fs/nls/nls_cp850.ko \
-,CONFIG_NLS_CODEPAGE_850,,20,nls_cp850))
-
-$(eval $(call KMOD_template,NLS_ISO8859_1,nls-iso8859-1,\
-       $(MODULES_DIR)/kernel/fs/nls/nls_iso8859-1.ko \
-,CONFIG_NLS_ISO8859_1,,20,nls_iso8859-1))
-
-$(eval $(call KMOD_template,NLS_ISO8859_15,nls-iso8859-15,\
-       $(MODULES_DIR)/kernel/fs/nls/nls_iso8859-15.ko \
-,CONFIG_NLS_ISO8859_15,,20,nls_iso8859-15))
-
-$(eval $(call KMOD_template,NLS_UTF8,nls-utf8,\
-       $(MODULES_DIR)/kernel/fs/nls/nls_utf8.ko \
-,CONFIG_NLS_UTF8,,20,nls_utf8))
-
-
-# Network devices
-
-$(eval $(call KMOD_template,NET_3C59X,net-3c59x,\
-       $(MODULES_DIR)/kernel/drivers/net/3c59x.ko \
-,CONFIG_VORTEX,,10,3c59x))
-
-$(eval $(call KMOD_template,NET_8139TOO,net-8139too,\
-       $(MODULES_DIR)/kernel/drivers/net/8139too.ko \
-,CONFIG_8139TOO,,10,8139too))
-
-$(eval $(call KMOD_template,NET_AIRO,net-airo,\
-       $(MODULES_DIR)/kernel/drivers/net/wireless/airo.ko \
-,CONFIG_AIRO,,10,airo))
-
-$(eval $(call KMOD_template,NET_E100,net-e100,\
-       $(MODULES_DIR)/kernel/drivers/net/e100.ko \
-,CONFIG_E100,,10,e100))
-
-$(eval $(call KMOD_template,NET_HERMES,net-hermes,\
-       $(MODULES_DIR)/kernel/drivers/net/wireless/hermes.ko \
-       $(MODULES_DIR)/kernel/drivers/net/wireless/orinoco.ko \
-,CONFIG_HERMES,,10,hermes orinoco))
-
-$(eval $(call KMOD_template,NET_HERMES_PCI,net-hermes-pci,\
-       $(MODULES_DIR)/kernel/drivers/net/wireless/orinoco_pci.ko \
-,CONFIG_PCI_HERMES,kmod-net-hermes,11,orinoco_pci))
-
-$(eval $(call KMOD_template,NET_HERMES_PCI,net-hermes-plx,\
-       $(MODULES_DIR)/kernel/drivers/net/wireless/orinoco_plx.ko \
-,CONFIG_PLX_HERMES,kmod-net-hermes,11,orinoco_plx))
-
-$(eval $(call KMOD_template,NET_NATSEMI,net-natsemi,\
-       $(MODULES_DIR)/kernel/drivers/net/natsemi.ko \
-,CONFIG_NATSEMI,,10,natsemi))
-
-$(eval $(call KMOD_template,NET_PRISM54,net-prism54,\
-       $(MODULES_DIR)/kernel/drivers/net/wireless/prism54/prism54.ko \
-,CONFIG_PRISM54,,10,prism54))
-
-
-# PCMCIA/CardBus
-
-$(eval $(call KMOD_template,PCMCIA_CORE,pcmcia-core,\
-       $(MODULES_DIR)/kernel/drivers/pcmcia/pcmcia.ko \
-       $(MODULES_DIR)/kernel/drivers/pcmcia/pcmcia_core.ko \
-       $(MODULES_DIR)/kernel/drivers/pcmcia/yenta_socket.ko \
-       $(MODULES_DIR)/kernel/drivers/pcmcia/rsrc_nonstatic.ko \
-,CONFIG_PCMCIA,,50,pcmcia_core pcmcia yenta_socket rsrc_nonstatic))
-
-$(eval $(call KMOD_template,PCMCIA_SERIAL,pcmcia-serial,\
-       $(MODULES_DIR)/kernel/drivers/serial/serial_cs.ko \
-,CONFIG_SERIAL_8250_CS))
-
-
-# USB
-
-$(eval $(call KMOD_template,USB,usb-core,\
-       $(MODULES_DIR)/kernel/drivers/usb/core/usbcore.ko \
-,CONFIG_USB,,50,usbcore))
-
-$(eval $(call KMOD_template,USB_OHCI,usb-ohci,\
-       $(MODULES_DIR)/kernel/drivers/usb/host/ohci-hcd.ko \
-,CONFIG_USB_OHCI_HCD,kmod-usb-core,60,ohci-hcd))
-
-$(eval $(call KMOD_template,USB_UHCI,usb-uhci,\
-       $(MODULES_DIR)/kernel/drivers/usb/host/uhci-hcd.ko \
-,CONFIG_USB_UHCI_HCD,kmod-usb-core,60,uhci-hcd))
-
-$(eval $(call KMOD_template,USB2,usb2,\
-       $(MODULES_DIR)/kernel/drivers/usb/host/ehci-hcd.ko \
-,CONFIG_USB_EHCI_HCD,kmod-usb-core,60,ehci-hcd))
-
-$(eval $(call KMOD_template,USB_ACM,usb-acm,\
-       $(MODULES_DIR)/kernel/drivers/usb/class/cdc-acm.ko \
-,CONFIG_USB_ACM))
-
-$(eval $(call KMOD_template,USB_AUDIO,usb-audio,\
-       $(MODULES_DIR)/kernel/drivers/usb/class/audio.ko \
-,CONFIG_USB_AUDIO,kmod-soundcore kmod-usb-core,61,audio))
-
-$(eval $(call KMOD_template,USB_PRINTER,usb-printer,\
-       $(MODULES_DIR)/kernel/drivers/usb/class/usblp.ko \
-,CONFIG_USB_PRINTER,kmod-usb-core,60,usblp))
-
-$(eval $(call KMOD_template,USB_SERIAL,usb-serial,\
-       $(MODULES_DIR)/kernel/drivers/usb/serial/usbserial.ko \
-,CONFIG_USB_SERIAL,kmod-usb-core,60,usbserial))
-
-$(eval $(call KMOD_template,USB_SERIAL_BELKIN,usb-serial-belkin,\
-       $(MODULES_DIR)/kernel/drivers/usb/serial/belkin_sa.ko \
-,CONFIG_USB_SERIAL_BELKIN,kmod-usb-serial,61,belkin_sa))
-
-$(eval $(call KMOD_template,USB_SERIAL_FTDI,usb-serial-ftdi,\
-       $(MODULES_DIR)/kernel/drivers/usb/serial/ftdi_sio.ko \
-,CONFIG_USB_SERIAL_FTDI_SIO,kmod-usb-serial,61,ftdi_sio))
-
-$(eval $(call KMOD_template,USB_SERIAL_MCT_U232,usb-serial-mct-u232,\
-       $(MODULES_DIR)/kernel/drivers/usb/serial/mct_u232.ko \
-,CONFIG_USB_SERIAL_MCT_U232,kmod-usb-serial,61,mct_u232))
-
-$(eval $(call KMOD_template,USB_SERIAL_PL2303,usb-serial-pl2303,\
-       $(MODULES_DIR)/kernel/drivers/usb/serial/pl2303.ko \
-,CONFIG_USB_SERIAL_PL2303,kmod-usb-serial,61,pl2303))
-
-$(eval $(call KMOD_template,USB_SERIAL_VISOR,usb-serial-visor,\
-       $(MODULES_DIR)/kernel/drivers/usb/serial/visor.ko \
-,CONFIG_USB_SERIAL_VISOR,kmod-usb-serial,61,visor))
-
-$(eval $(call KMOD_template,USB_STORAGE,usb-storage,\
-       $(MODULES_DIR)/kernel/drivers/scsi/scsi_mod.ko \
-       $(MODULES_DIR)/kernel/drivers/scsi/sd_mod.ko \
-       $(MODULES_DIR)/kernel/drivers/usb/storage/usb-storage.ko \
-,CONFIG_USB_STORAGE,kmod-usb-core,60,scsi_mod sd_mod usb-storage))
-
-$(eval $(call KMOD_template,USB_ATM,usb-atm,\
-        $(MODULES_DIR)/kernel/drivers/usb/atm/usbatm.ko \
-       ,CONFIG_USB_ATM,kmod-usb-atm,50,usbatm))
-
-$(eval $(call KMOD_template,USB_ATM_SPEEDTOUCH,usb-atm-speedtouch,\
-        $(MODULES_DIR)/kernel/drivers/usb/atm/speedtch.ko \
-       ,CONFIG_USB_SPEEDTOUCH,kmod-usb-atm-speedtouch,50,speedtch))
-
-# Misc. devices
-
-$(eval $(call KMOD_template,AX25,ax25,\
-       $(MODULES_DIR)/kernel/net/ax25/ax25.ko \
-       $(MODULES_DIR)/kernel/drivers/net/hamradio/mkiss.ko \
-,CONFIG_AX25,,90,ax25 mkiss))
-
-$(eval $(call KMOD_template,BLUETOOTH,bluetooth,\
-       $(MODULES_DIR)/kernel/net/bluetooth/bluetooth.ko \
-       $(MODULES_DIR)/kernel/net/bluetooth/l2cap.ko \
-       $(MODULES_DIR)/kernel/net/bluetooth/sco.ko \
-       $(MODULES_DIR)/kernel/net/bluetooth/rfcomm/rfcomm.ko \
-       $(MODULES_DIR)/kernel/drivers/bluetooth/hci_uart.ko \
-       $(MODULES_DIR)/kernel/drivers/bluetooth/hci_usb.ko \
-,CONFIG_BT))
-
-
index 4ac6d3015ff8be4449503fe695c6c1effdf1b1df..4b22f90df26d015359e6ff88e0a7292885431d2a 100644 (file)
@@ -1,4 +1,4 @@
-include ../image.mk
+include $(TOPDIR)/include/image.mk
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/ar7loader
 
index c8dab056a00cd213a6b7bf27850dae05a8642577..5091d3f40cd3d06f20ef8026a5e7ab2e506f3627 100644 (file)
@@ -1,4 +1,4 @@
-include ../image.mk
+include $(TOPDIR)/include/image.mk
 
 LOADADDR = 0x81000000          # RAM start + 16M 
 KERNEL_ENTRY = 0x80100000
index 2607ed9eb3bce0bbe75d60d7ad1c2c5f21e1d455..682670a22c317af57c9d68151844f6f6b91ae58b 100644 (file)
@@ -1,4 +1,4 @@
-include ../image.mk
+include $(TOPDIR)/include/image.mk
 
 LOADADDR = 0x8108c8f4          # RAM start + 16M 
 KERNEL_ENTRY = 0x80100000      # Default kernel entry in arch/mips/Makefile
index df2a42ea5cc083372581b34ca3e6d592669fc569..d219dc354b35d59808485a619a4931ccd90c9824 100644 (file)
@@ -1,4 +1,4 @@
-include ../image.mk
+include $(TOPDIR)/include/image.mk
 
 define Build/Compile
        rm -f $(KDIR)/loader.gz
index f87fb116dd171eb7d7d6ea88a4c30aa6fdaefb17..b9efc95b9bea6fd97e7cdeb46177fa090cbea7e8 100644 (file)
@@ -1,4 +1,4 @@
-include ../image.mk
+include $(TOPDIR)/include/image.mk
 
 # use default targets for everything
 
diff --git a/openwrt/target/linux/image/image.mk b/openwrt/target/linux/image/image.mk
deleted file mode 100644 (file)
index 92143d6..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-KDIR:=$(BUILD_DIR)/linux-$(KERNEL)-$(BOARD)
-
-ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
-ifeq ($(CONFIG_TARGET_ROOTFS_JFFS2),y)
-include $(TOPDIR)/target/linux/image/jffs2.mk
-endif
-
-ifeq ($(CONFIG_TARGET_ROOTFS_SQUASHFS_LZMA),y)
-include $(TOPDIR)/target/linux/image/squashfs.mk
-endif
-
-ifeq ($(CONFIG_TARGET_ROOTFS_TGZ),y)
-include $(TOPDIR)/target/linux/image/tgz.mk
-endif
-endif
-
-define Image/mkfs/prepare/default
-       find $(BUILD_DIR)/root -type f -not -perm +0100 | xargs chmod 0644
-       find $(BUILD_DIR)/root -type f -perm +0100 | xargs chmod 0755
-       find $(BUILD_DIR)/root -type d | xargs chmod 0755
-       mkdir -p $(BUILD_DIR)/root/tmp
-       chmod 0777 $(BUILD_DIR)/root/tmp
-endef
-
-define Image/mkfs/prepare
-       $(call Image/mkfs/prepare/default)
-endef
-
-define BuildImage
-compile:
-       $(call Build/Compile)
-
-install:
-       $(call Image/Prepare)
-       $(call Image/mkfs/prepare)
-       $(call Image/BuildKernel)
-       $(call Image/mkfs/jffs2)
-       $(call Image/mkfs/squashfs)
-       $(call Image/mkfs/tgz)
-       
-clean:
-       $(call Build/Clean)
-endef
-
-compile-targets:
-install-targets:
-clean-targets:
-
-source:
-prepare:
-compile: compile-targets
-install: compile install-targets
-clean: clean-targets
diff --git a/openwrt/target/linux/image/jffs2.mk b/openwrt/target/linux/image/jffs2.mk
deleted file mode 100644 (file)
index a0e14da..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-ifneq ($(CONFIG_BIG_ENDIAN),y)
-JFFS2OPTS :=  --pad --little-endian --squash
-else
-JFFS2OPTS :=  --pad --big-endian --squash
-endif
-
-define Image/mkfs/jffs2
-       rm -rf $(BUILD_DIR)/root/jffs
-       
-       $(STAGING_DIR)/bin/mkfs.jffs2 $(JFFS2OPTS) -e 0x10000 -o $(KDIR)/root.jffs2-64k -d $(BUILD_DIR)/root
-       $(STAGING_DIR)/bin/mkfs.jffs2 $(JFFS2OPTS) -e 0x20000 -o $(KDIR)/root.jffs2-128k -d $(BUILD_DIR)/root
-
-       $(call Image/Build,jffs2-64k)
-       $(call Image/Build,jffs2-128k)
-endef
-
-jffs2-source: FORCE
-       $(MAKE) -C $(TOPDIR)/target/linux/image/jffs2 source
-
-$(STAGING_DIR)/bin/mkfs.jffs2:
-       $(MAKE) -C $(TOPDIR)/target/linux/image/jffs2 compile
-
-jffs2-clean: FORCE
-       $(MAKE) -C $(TOPDIR)/target/linux/image/jffs2 clean
-       rm -f $(KDIR)/root.jffs2*
-
-source: jffs2-source
-compile-targets: $(STAGING_DIR)/bin/mkfs.jffs2
-clean-targets: jffs2-clean
-
diff --git a/openwrt/target/linux/image/jffs2/Makefile b/openwrt/target/linux/image/jffs2/Makefile
deleted file mode 100644 (file)
index b673c43..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-MTD_DIR:=$(BUILD_DIR)/mtd-20050122.orig
-MTD_SOURCE=mtd_20050122.orig.tar.gz
-MTD_SITE=http://ftp.debian.org/debian/pool/main/m/mtd
-MTD_MD5SUM:=1f42c2cae08eb9e7b52d0c188f8d6338
-MKFS_JFFS2=$(MTD_DIR)/util/mkfs.jffs2
-
-$(DL_DIR)/$(MTD_SOURCE):
-       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(MTD_SOURCE) $(MTD_MD5SUM) $(MTD_SITE)
-
-$(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
-       $(MAKE) LINUXDIR=$(LINUX_DIR) -C $(MTD_DIR)/util
-
-$(STAGING_DIR)/bin/mkfs.jffs2: $(MTD_DIR)/util/mkfs.jffs2
-       $(CP) $< $@
-
-source: $(DL_DIR)/$(MTD_SOURCE)
-prepare: $(MTD_DIR)/.unpacked
-compile: $(MTD_DIR)/util/mkfs.jffs2 $(STAGING_DIR)/bin/mkfs.jffs2
-install: 
-clean: FORCE
-       rm -rf $(MTD_DIR) $(STAGING_DIR)/bin/mkfs.jffs2
-
diff --git a/openwrt/target/linux/image/jffs2/patches/gcc4-fix.patch b/openwrt/target/linux/image/jffs2/patches/gcc4-fix.patch
deleted file mode 100644 (file)
index 50c8edb..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-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 ed419c8c6d05dbefb9c6b9590d91ac255cb02581..53adfc432f704d28dfc48712e00c0a300c7e0f1c 100644 (file)
@@ -1,4 +1,4 @@
-include ../image.mk
+include $(TOPDIR)/include/image.mk
 
 LOADADDR = 0x81000000          # RAM start + 16M 
 KERNEL_ENTRY = 0x80101000
diff --git a/openwrt/target/linux/image/squashfs.mk b/openwrt/target/linux/image/squashfs.mk
deleted file mode 100644 (file)
index e01766c..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-ifneq ($(CONFIG_BIG_ENDIAN),y)
-ENDIAN := le
-else
-ENDIAN := be
-endif
-
-squashfs-source: FORCE
-       $(MAKE) -C $(TOPDIR)/target/linux/image/squashfs source
-
-$(STAGING_DIR)/bin/mksquashfs-lzma:
-       $(MAKE) -C $(TOPDIR)/target/linux/image/squashfs compile
-       
-squashfs-clean: FORCE
-       $(MAKE) -C $(TOPDIR)/target/linux/image/squashfs clean
-       rm -f $(KDIR)/root.squashfs
-
-define Image/mkfs/squashfs
-       @mkdir -p $(BUILD_DIR)/root/jffs
-       $(STAGING_DIR)/bin/mksquashfs-lzma $(BUILD_DIR)/root $(KDIR)/root.squashfs -nopad -noappend -root-owned -$(ENDIAN)
-       $(call Image/Build,squashfs)
-endef
-
-FILESYSTEMS += squashfs
-compile-targets: $(STAGING_DIR)/bin/mksquashfs-lzma
-clean-targets: squashfs-clean
diff --git a/openwrt/target/linux/image/squashfs/Makefile b/openwrt/target/linux/image/squashfs/Makefile
deleted file mode 100644 (file)
index a2b3671..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-SQUASHFSLZMA_DIR=$(BUILD_DIR)/squashfs3.0
-SQUASHFSLZMA_SOURCE=squashfs3.0.tar.gz
-SQUASHFSLZMA_SITE=@SF/squashfs
-SQUASHFSLZMA_MD5SUM=9fd05d0bfbb712f5fb95edafea5bc733
-
-$(DL_DIR)/$(SQUASHFSLZMA_SOURCE):
-       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(SQUASHFSLZMA_SOURCE) $(SQUASHFSLZMA_MD5SUM) $(SQUASHFSLZMA_SITE)
-
-$(SQUASHFSLZMA_DIR)/.unpacked: $(DL_DIR)/$(SQUASHFSLZMA_SOURCE) 
-       zcat $(DL_DIR)/$(SQUASHFSLZMA_SOURCE) | tar -C $(BUILD_DIR) -xvf -
-       $(PATCH) $(SQUASHFSLZMA_DIR) ./patches
-       touch $(SQUASHFSLZMA_DIR)/.unpacked
-
-$(SQUASHFSLZMA_DIR)/squashfs-tools/mksquashfs-lzma: $(SQUASHFSLZMA_DIR)/.unpacked
-       $(MAKE) -C $(SQUASHFSLZMA_DIR)/squashfs-tools mksquashfs-lzma LZMAPATH=$(BUILD_DIR)/lzma
-
-$(STAGING_DIR)/bin/mksquashfs-lzma: $(SQUASHFSLZMA_DIR)/squashfs-tools/mksquashfs-lzma
-       $(CP) $< $@
-
-source: $(DL_DIR)/$(SQUASHFSLZMA_SOURCE)
-prepare: $(SQUASHFSLZMA_DIR)/.unpacked
-compile: $(SQUASHFSLZMA_DIR)/squashfs-tools/mksquashfs-lzma $(STAGING_DIR)/bin/mksquashfs-lzma
-install:
-clean: FORCE
-       rm -rf $(SQUASHFSLZMA_DIR)
diff --git a/openwrt/target/linux/image/squashfs/patches/100-lzma.patch b/openwrt/target/linux/image/squashfs/patches/100-lzma.patch
deleted file mode 100644 (file)
index 85aa21f..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-diff -Nur squashfs3.0/squashfs-tools/Makefile squashfs3.0-owrt/squashfs-tools/Makefile
---- squashfs3.0/squashfs-tools/Makefile        2006-03-15 22:36:20.000000000 +0100
-+++ squashfs3.0-owrt/squashfs-tools/Makefile   2006-03-21 11:14:08.000000000 +0100
-@@ -1,4 +1,5 @@
- INCLUDEDIR = .
-+#LZMAPATH = ../lzma/SRC/7zip/Compress/LZMA_Lib
- CFLAGS := -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O2
-@@ -7,6 +8,9 @@
- mksquashfs: mksquashfs.o read_fs.o sort.o
-       $(CC) mksquashfs.o read_fs.o sort.o -lz -o $@
-+mksquashfs-lzma: mksquashfs.o read_fs.o sort.o
-+      $(CXX) mksquashfs.o read_fs.o sort.o -L$(LZMAPATH) -llzma -o $@
-+
- mksquashfs.o: mksquashfs.c squashfs_fs.h mksquashfs.h global.h sort.h
- read_fs.o: read_fs.c squashfs_fs.h read_fs.h global.h
-@@ -17,3 +21,5 @@
-       $(CC) unsquashfs.o -lz -o $@
- unsquashfs.o: unsquashfs.c squashfs_fs.h read_fs.h global.h
-+
-+clean:
diff --git a/openwrt/target/linux/image/tgz.mk b/openwrt/target/linux/image/tgz.mk
deleted file mode 100644 (file)
index 39adb69..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-define Image/mkfs/tgz
-       tar -zcf $(BIN_DIR)/openwrt-rootfs.tgz --owner=root --group=root -C $(BUILD_DIR)/root/ .
-endef
index 69f9bf470e56cb50229296ffa2b59a7d6bc24b31..d76294f1504a5ec6fe3f1044f30af3cecef2d2be 100644 (file)
@@ -1,4 +1,4 @@
-include ../image.mk
+include $(TOPDIR)/include/image.mk
 
 define Image/Build
        cp $(KDIR)/root.$(1) $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).img
index 09616d409f6b438040eb4c5904f9975f0389132a..d94d7f07cabadadd0a55d395a4972cde33d0c006 100644 (file)
@@ -1,4 +1,4 @@
-include ../image.mk
+include $(TOPDIR)/include/image.mk
 
 define Image/Build
 ifneq ($(FS),jffs2-64k)
diff --git a/openwrt/target/linux/kernel.mk b/openwrt/target/linux/kernel.mk
deleted file mode 100644 (file)
index cd74fcc..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-LINUX_SOURCE:=$(LINUX_NAME).tar.bz2
-LINUX_SITE=http://www.us.kernel.org/pub/linux/kernel/v$(KERNEL) \
-           http://www.us.kernel.org/pub/linux/kernel/v$(KERNEL) \
-           http://www.kernel.org/pub/linux/kernel/v$(KERNEL) \
-           http://www.de.kernel.org/pub/linux/kernel/v$(KERNEL)
-
-KERNEL_IDIR:=$(LINUX_BUILD_DIR)/kernel-ipkg
-
-$(TARGETS): $(PACKAGE_DIR)
-
-$(LINUX_DIR):
-       mkdir -p $@
-
-$(PACKAGE_DIR):
-       mkdir -p $@
-
-$(DL_DIR)/$(LINUX_SOURCE):
-       -mkdir -p $(DL_DIR)
-       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(LINUX_SOURCE) $(LINUX_KERNEL_MD5SUM) $(LINUX_SITE)
-
-$(LINUX_DIR)/.unpacked: $(DL_DIR)/$(LINUX_SOURCE)
-       -mkdir -p $(LINUX_BUILD_DIR)
-       bzcat $(DL_DIR)/$(LINUX_SOURCE) | tar -C $(LINUX_BUILD_DIR) $(TAR_OPTIONS) -
-       touch $@
-
-ifeq ($(KERNEL),2.4)
-$(LINUX_DIR)/.configured: $(LINUX_DIR)/.patched
-       $(SED) "s,^CROSS_COMPILE.*,CROSS_COMPILE=$(KERNEL_CROSS),g;" \
-         $(LINUX_DIR)/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/compile.h include/linux/version.h
-       touch $@
-
-$(LINUX_DIR)/.depend_done: $(LINUX_DIR)/.configured
-       $(MAKE) -C $(LINUX_DIR) CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(LINUX_KARCH) dep
-       touch $@
-
-$(LINUX_DIR)/vmlinux: $(LINUX_DIR)/.depend_done
-else
-$(LINUX_DIR)/.configured: $(LINUX_DIR)/.patched
-       $(MAKE) -C $(LINUX_DIR) CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(LINUX_KARCH) oldconfig prepare scripts
-       touch $@
-endif
-
-ramdisk-config: $(LINUX_DIR)/.configured FORCE
-       mv $(LINUX_DIR)/.config $(LINUX_DIR)/.config.old
-       grep -v INITRAMFS $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config
-ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
-       echo 'CONFIG_INITRAMFS_SOURCE="../../root"' >> $(LINUX_DIR)/.config
-       echo 'CONFIG_INITRAMFS_ROOT_UID=0' >> $(LINUX_DIR)/.config
-       echo 'CONFIG_INITRAMFS_ROOT_GID=0' >> $(LINUX_DIR)/.config
-       mkdir -p $(BUILD_DIR)/root/etc/init.d
-       $(CP) ../generic-2.6/files/init $(BUILD_DIR)/root/
-else
-       rm -f $(BUILD_DIR)/root/init $(BUILD_DIR)/root/etc/init.d/S00initramfs
-       echo 'CONFIG_INITRAMFS_SOURCE=""' >> $(LINUX_DIR)/.config
-endif
-
-$(LINUX_DIR)/vmlinux: $(STAMP_DIR)/.linux-compile pkg-install ramdisk-config
-       $(MAKE) -C $(LINUX_DIR) CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(LINUX_KARCH) PATH=$(TARGET_PATH)
-
-$(LINUX_KERNEL): $(LINUX_DIR)/vmlinux
-       $(TARGET_CROSS)objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S $< $@
-       touch -c $(LINUX_KERNEL)
-
-$(LINUX_DIR)/.modules_done:
-       rm -rf $(LINUX_BUILD_DIR)/modules
-       $(MAKE) -C "$(LINUX_DIR)" CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(LINUX_KARCH) PATH="$(TARGET_PATH)" modules
-       $(MAKE) -C "$(LINUX_DIR)" CROSS_COMPILE="$(KERNEL_CROSS)" DEPMOD=true INSTALL_MOD_PATH=$(LINUX_BUILD_DIR)/modules modules_install
-       touch $(LINUX_DIR)/.modules_done
-
-$(STAMP_DIR)/.linux-compile:
-       @$(MAKE) $(LINUX_DIR)/.modules_done $(TARGETS) $(KERNEL_IPKG)
-       ln -sf $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION) $(BUILD_DIR)/linux
-       touch $@
-
-$(KERNEL_IPKG):
-       rm -rf $(KERNEL_IDIR)
-       mkdir -p $(KERNEL_IDIR)/etc
-       $(SCRIPT_DIR)/make-ipkg-dir.sh $(KERNEL_IDIR) ../control/kernel.control $(LINUX_VERSION)-$(BOARD)-$(LINUX_RELEASE) $(ARCH)
-       if [ -f ./config/$(BOARD).modules ]; then \
-               cp ./config/$(BOARD).modules $(KERNEL_IDIR)/etc/modules; \
-       fi
-       $(IPKG_BUILD) $(KERNEL_IDIR) $(LINUX_BUILD_DIR)
-
-$(BUILD_DIR)/kernel.mk: $(LINUX_DIR) FORCE
-       echo "BOARD:=$(BOARD)" > $@
-       echo "LINUX_NAME:=$(LINUX_NAME)" >> $@
-       echo "LINUX_VERSION:=$(LINUX_VERSION)" >> $@
-       echo "LINUX_RELEASE:=$(LINUX_RELEASE)" >> $@
-
-pkg-install: FORCE
-       @{ [ "$(INSTALL_TARGETS)" != "" ] && $(IPKG) install $(INSTALL_TARGETS) || true; }
-
-source: $(DL_DIR)/$(LINUX_SOURCE)
-prepare: $(BUILD_DIR)/kernel.mk
-       @mkdir -p $(STAMP_DIR) $(PACKAGE_DIR)
-       @$(MAKE) $(LINUX_DIR)/.configured
-
-compile: prepare $(STAMP_DIR)/.linux-compile
-
-install: compile $(LINUX_KERNEL)
-
-mostlyclean: FORCE
-       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)
-
-rebuild: FORCE
-       -$(MAKE) mostlyclean
-       if [ -f $(LINUX_KERNEL) ]; then \
-               $(MAKE) clean; \
-       fi
-       $(MAKE) compile $(MAKE_TRACE)
-
-clean: FORCE
-       rm -f $(STAMP_DIR)/.linux-compile
-       rm -rf $(LINUX_BUILD_DIR)
-       rm -f $(TARGETS)
diff --git a/openwrt/target/linux/netfilter.mk b/openwrt/target/linux/netfilter.mk
deleted file mode 100644 (file)
index 66cb747..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-# $Id: netfilter.mk 2411 2005-11-11 03:41:43Z nico $
-
-ifeq ($(NF_2_6),1)
-P_V4:=ipv4/netfilter/
-P_XT:=netfilter/
-else
-P_V4:=
-P_XT:=
-endif
-
-IPT_CONNTRACK-m :=
-IPT_CONNTRACK-$(CONFIG_IP_NF_MATCH_CONNMARK) += $(P_V4)ipt_connmark
-IPT_CONNTRACK-$(CONFIG_IP_NF_TARGET_CONNMARK) += $(P_V4)ipt_CONNMARK
-IPT_CONNTRACK-$(CONFIG_IP_NF_MATCH_CONNTRACK) += $(P_V4)ipt_conntrack
-IPT_CONNTRACK-$(CONFIG_IP_NF_MATCH_HELPER) += $(P_V4)ipt_helper
-IPT_CONNTRACK-$(CONFIG_IP_NF_MATCH_STATE) += $(P_V4)ipt_state
-IPT_CONNTRACK-$(CONFIG_NETFILTER_XT_MATCH_CONNTRACK) += $(P_XT)xt_conntrack
-IPT_CONNTRACK-$(CONFIG_NETFILTER_XT_MATCH_HELPER) += $(P_XT)xt_helper
-IPT_CONNTRACK-$(CONFIG_NETFILTER_XT_MATCH_STATE) += $(P_XT)xt_state
-
-
-IPT_EXTRA-m :=
-IPT_EXTRA-$(CONFIG_IP_NF_MATCH_CONDITION) += $(P_V4)ipt_condition
-IPT_EXTRA-$(CONFIG_IP_NF_MATCH_CONNBYTES) += $(P_V4)ipt_connbytes
-IPT_EXTRA-$(CONFIG_NETFILTER_XT_MATCH_CONNBYTES) += $(P_XT)xt_connbytes
-IPT_EXTRA-$(CONFIG_IP_NF_MATCH_LIMIT) += $(P_V4)ipt_limit
-IPT_EXTRA-$(CONFIG_NETFILTER_XT_MATCH_LIMIT) += $(P_XT)xt_limit
-IPT_EXTRA-$(CONFIG_IP_NF_TARGET_LOG) += $(P_V4)ipt_LOG
-IPT_EXTRA-$(CONFIG_IP_NF_MATCH_MULTIPORT) += $(P_XT)xt_multiport
-IPT_EXTRA-$(CONFIG_NETFILTER_XT_MATCH_MULTIPORT) += $(P_XT)xt_multiport
-IPT_EXTRA-$(CONFIG_IP_NF_MATCH_OWNER) += $(P_V4)ipt_owner
-IPT_EXTRA-$(CONFIG_IP_NF_MATCH_PHYSDEV) += $(P_V4)ipt_physdev
-IPT_EXTRA-$(CONFIG_IP_NF_MATCH_PKTTYPE) += $(P_V4)ipt_pkttype
-IPT_EXTRA-$(CONFIG_NETFILTER_XT_MATCH_PKTTYPE) += $(P_XT)xt_pkttype
-IPT_EXTRA-$(CONFIG_IP_NF_MATCH_QUOTA) += $(P_V4)ipt_quota
-IPT_EXTRA-$(CONFIG_IP_NF_MATCH_RECENT) += $(P_V4)ipt_recent
-IPT_EXTRA-$(CONFIG_IP_NF_TARGET_REJECT) += $(P_V4)ipt_REJECT
-IPT_EXTRA-$(CONFIG_IP_NF_MATCH_STRING) += $(P_V4)ipt_string
-IPT_EXTRA-$(CONFIG_NETFILTER_XT_MATCH_STRING) += $(P_XT)xt_string
-
-IPT_FILTER-m :=
-IPT_FILTER-$(CONFIG_IP_NF_MATCH_IPP2P) += $(P_V4)ipt_ipp2p
-IPT_FILTER-$(CONFIG_IP_NF_MATCH_LAYER7) += $(P_V4)ipt_layer7
-
-IPT_IMQ-m :=
-IPT_IMQ-$(CONFIG_IP_NF_TARGET_IMQ) += $(P_V4)ipt_IMQ
-
-IPT_IPOPT-m :=
-IPT_IPOPT-$(CONFIG_IP_NF_MATCH_DSCP) += $(P_V4)ipt_dscp
-IPT_IPOPT-$(CONFIG_IP_NF_TARGET_DSCP) += $(P_V4)ipt_DSCP
-IPT_IPOPT-$(CONFIG_IP_NF_MATCH_ECN) += $(P_V4)ipt_ecn
-IPT_IPOPT-$(CONFIG_IP_NF_TARGET_ECN) += $(P_V4)ipt_ECN
-IPT_IPOPT-$(CONFIG_IP_NF_MATCH_LENGTH) += $(P_V4)ipt_length
-IPT_IPOPT-$(CONFIG_NETFILTER_XT_MATCH_LENGTH) += $(P_XT)xt_length
-IPT_IPOPT-$(CONFIG_IP_NF_MATCH_MAC) += $(P_V4)ipt_mac
-IPT_IPOPT-$(CONFIG_NETFILTER_XT_MATCH_MAC) += $(P_XT)xt_mac
-IPT_IPOPT-$(CONFIG_IP_NF_MATCH_MARK) += $(P_V4)ipt_mark
-IPT_IPOPT-$(CONFIG_NETFILTER_XT_MATCH_MARK) += $(P_XT)xt_mark
-IPT_IPOPT-$(CONFIG_IP_NF_TARGET_MARK) += $(P_V4)ipt_MARK
-IPT_IPOPT-$(CONFIG_NETFILTER_XT_TARGET_MARK) += $(P_XT)xt_MARK
-IPT_IPOPT-$(CONFIG_IP_NF_MATCH_TCPMSS) += $(P_V4)ipt_tcpmss
-IPT_IPOPT-$(CONFIG_NETFILTER_XT_MATCH_TCPMSS) += $(P_XT)xt_tcpmss
-IPT_IPOPT-$(CONFIG_IP_NF_TARGET_TCPMSS) += $(P_V4)ipt_TCPMSS
-IPT_IPOPT-$(CONFIG_IP_NF_MATCH_TOS) += $(P_V4)ipt_tos
-IPT_IPOPT-$(CONFIG_IP_NF_MATCH_TIME) += $(P_V4)ipt_time
-IPT_IPOPT-$(CONFIG_IP_NF_TARGET_TOS) += $(P_V4)ipt_TOS
-IPT_IPOPT-$(CONFIG_IP_NF_MATCH_TTL) += $(P_V4)ipt_ttl
-IPT_IPOPT-$(CONFIG_IP_NF_TARGET_TTL) += $(P_V4)ipt_TTL
-IPT_IPOPT-$(CONFIG_IP_NF_MATCH_UNCLEAN) += $(P_V4)ipt_unclean
-
-IPT_IPSEC-m :=
-IPT_IPSEC-$(CONFIG_IP_NF_MATCH_AH_ESP) += $(P_V4)ipt_ah $(P_V4)ipt_esp
-IPT_IPSEC-$(CONFIG_IP_NF_MATCH_AH) += $(P_V4)ipt_ah
-IPT_IPSEC-$(CONFIG_NETFILTER_XT_MATCH_ESP) += $(P_XT)xt_esp
-
-IPT_NAT-m :=
-IPT_NAT-$(CONFIG_IP_NF_NAT) += $(P_V4)ipt_SNAT $(P_V4)ipt_DNAT
-IPT_NAT-$(CONFIG_IP_NF_TARGET_MASQUERADE) += $(P_V4)ipt_MASQUERADE
-IPT_NAT-$(CONFIG_IP_NF_TARGET_MIRROR) += $(P_V4)ipt_MIRROR
-IPT_NAT-$(CONFIG_IP_NF_TARGET_REDIRECT) += $(P_V4)ipt_REDIRECT
-
-IPT_NAT_EXTRA-m := 
-IPT_NAT_EXTRA-$(CONFIG_IP_NF_AMANDA) += $(P_V4)ip_conntrack_amanda
-IPT_NAT_EXTRA-$(CONFIG_IP_NF_CT_PROTO_GRE) += $(P_V4)ip_conntrack_proto_gre
-IPT_NAT_EXTRA-$(CONFIG_IP_NF_NAT_PROTO_GRE) += $(P_V4)ip_nat_proto_gre
-IPT_NAT_EXTRA-$(CONFIG_IP_NF_H323) += $(P_V4)ip_conntrack_h323
-IPT_NAT_EXTRA-$(CONFIG_IP_NF_NAT_H323) += $(P_V4)ip_nat_h323
-IPT_NAT_EXTRA-$(CONFIG_IP_NF_MMS) += $(P_V4)ip_conntrack_mms
-IPT_NAT_EXTRA-$(CONFIG_IP_NF_NAT_MMS) += $(P_V4)ip_nat_mms
-IPT_NAT_EXTRA-$(CONFIG_IP_NF_RTSP) += $(P_V4)ip_conntrack_rtsp
-IPT_NAT_EXTRA-$(CONFIG_IP_NF_NAT_RTSP) += $(P_V4)ip_nat_rtsp
-IPT_NAT_EXTRA-$(CONFIG_IP_NF_PPTP) += $(P_V4)ip_conntrack_pptp
-IPT_NAT_EXTRA-$(CONFIG_IP_NF_SIP) += $(P_V4)ip_conntrack_sip
-IPT_NAT_EXTRA-$(CONFIG_IP_NF_NAT_PPTP) += $(P_V4)ip_nat_pptp
-IPT_NAT_EXTRA-$(CONFIG_IP_NF_NAT_SIP) += $(P_V4)ip_nat_sip
-IPT_NAT_EXTRA-$(CONFIG_IP_NF_NAT_SNMP_BASIC) += $(P_V4)ip_nat_snmp_basic
-IPT_NAT_EXTRA-$(CONFIG_IP_NF_SIP) += $(P_V4)ip_conntrack_sip
-IPT_NAT_EXTRA-$(CONFIG_IP_NF_NAT_SIP) += $(P_V4)ip_nat_sip
-IPT_NAT_EXTRA-$(CONFIG_IP_NF_TFTP) += $(P_V4)ip_conntrack_tftp
-
-IPT_QUEUE-m :=
-IPT_QUEUE-$(CONFIG_IP_NF_QUEUE) += $(P_V4)ip_queue
-
-IPT_ULOG-m :=
-IPT_ULOG-$(CONFIG_IP_NF_TARGET_ULOG) += $(P_V4)ipt_ULOG
-
-IPT_BUILTIN := $(P_V4)ipt_standard
-IPT_BUILTIN += $(P_V4)ipt_icmp $(P_V4)ipt_tcp $(P_V4)ipt_udp
-IPT_BUILTIN += $(IPT_CONNTRACK-y)
-IPT_BUILTIN += $(IPT_EXTRA-y)
-IPT_BUILTIN += $(IPT_FILTER-y)
-IPT_BUILTIN += $(IPT_IMQ-y)
-IPT_BUILTIN += $(IPT_IPOPT-y)
-IPT_BUILTIN += $(IPT_IPSEC-y)
-IPT_BUILTIN += $(IPT_NAT-y)
-IPT_BUILTIN += $(IPT_ULOG-y)
index 9bb7bba71c936e79adbbbd8bf32338a453f2d750..4b0901987fc547718e12f54366506fe3b9361d90 100644 (file)
@@ -4,11 +4,9 @@ LINUX_VERSION:=2.6.17
 LINUX_RELEASE:=1
 LINUX_KERNEL_MD5SUM:=37ddefe96625502161f075b9d907f21e
 
-include ../rules.mk
 include ./config
-
-include ../generic-$(KERNEL)/modules.mk
-include ../kernel.mk
+include $(TOPDIR)/include/kernel.mk
+include $(TOPDIR)/include/kernel-build.mk
 
 $(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
        [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches
diff --git a/openwrt/target/linux/rules.mk b/openwrt/target/linux/rules.mk
deleted file mode 100644 (file)
index 166bfe2..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-KERNEL:=unknown
-ifneq (,$(findstring 2.4.,$(LINUX_VERSION)))
-KERNEL:=2.4
-endif
-ifneq (,$(findstring 2.6.,$(LINUX_VERSION)))
-KERNEL:=2.6
-endif
-
-MODULES_SUBDIR:=lib/modules/$(LINUX_VERSION)
-
-LINUX_BUILD_DIR:=$(BUILD_DIR)/linux-$(KERNEL)-$(BOARD)
-ifeq ($(LINUX_NAME),)
-LINUX_NAME:=linux-$(LINUX_VERSION)
-endif
-LINUX_DIR := $(LINUX_BUILD_DIR)/$(LINUX_NAME)
-LINUX_KERNEL:=$(LINUX_BUILD_DIR)/vmlinux
-
-LINUX_TARGET_DIR:=$(LINUX_BUILD_DIR)/root
-
-LINUX_KARCH:=$(shell echo $(ARCH) | sed -e 's/i[3-9]86/i386/' \
-       -e 's/mipsel/mips/' \
-       -e 's/mipseb/mips/' \
-       -e 's/powerpc/ppc/' \
-       -e 's/sh[234]/sh/' \
-       -e 's/armeb/arm/' \
-)
-
-KMOD_BUILD_DIR := $(LINUX_BUILD_DIR)/linux-modules
-MODULES_DIR := $(LINUX_BUILD_DIR)/modules/$(MODULES_SUBDIR)
-TARGET_MODULES_DIR := $(LINUX_TARGET_DIR)/$(MODULES_SUBDIR)
-
-ifeq ($(KERNEL),2.6)
-LINUX_KMOD_SUFFIX=ko
-else
-LINUX_KMOD_SUFFIX=o
-endif
-
-define KMOD_template
-ifeq ($$(strip $(4)),)
-KDEPEND_$(1):=m
-else
-KDEPEND_$(1):=$($(4))
-endif
-
-IDEPEND_$(1):=kernel ($(LINUX_VERSION)-$(BOARD)-$(LINUX_RELEASE)) $(foreach pkg,$(5),", $(pkg)")
-
-PKG_$(1) := $(PACKAGE_DIR)/kmod-$(2)_$(LINUX_VERSION)-$(BOARD)-$(LINUX_RELEASE)_$(ARCH).ipk
-I_$(1) := $(KMOD_BUILD_DIR)/ipkg/$(2)
-
-ifeq ($$(KDEPEND_$(1)),m)
-ifneq ($(CONFIG_PACKAGE_KMOD_$(1)),)
-TARGETS += $$(PKG_$(1))
-endif
-ifeq ($(CONFIG_PACKAGE_KMOD_$(1)),y)
-INSTALL_TARGETS += $$(PKG_$(1))
-endif
-endif
-
-$$(PKG_$(1)): $(LINUX_DIR)/.modules_done
-       rm -rf $$(I_$(1))
-       $(SCRIPT_DIR)/make-ipkg-dir.sh $$(I_$(1)) ../control/kmod-$(2).control $(LINUX_VERSION)-$(BOARD)-$(LINUX_RELEASE) $(ARCH)
-       echo "Depends: $$(IDEPEND_$(1))" >> $$(I_$(1))/CONTROL/control
-ifneq ($(strip $(3)),)
-       mkdir -p $$(I_$(1))/lib/modules/$(LINUX_VERSION)
-       $(CP) $(3) $$(I_$(1))/lib/modules/$(LINUX_VERSION)
-endif
-ifneq ($(6),)
-       mkdir -p $$(I_$(1))/etc/modules.d
-       for module in $(7); do \
-               echo $$$$module >> $$(I_$(1))/etc/modules.d/$(6)-$(2); \
-       done
-       echo "#!/bin/sh" >> $$(I_$(1))/CONTROL/postinst
-       echo "[ -z \"\$$$$IPKG_INSTROOT\" ] || exit" >> $$(I_$(1))/CONTROL/postinst
-       echo ". /etc/functions.sh" >> $$(I_$(1))/CONTROL/postinst
-       echo "load_modules /etc/modules.d/$(6)-$(2)" >> $$(I_$(1))/CONTROL/postinst
-       chmod 0755 $$(I_$(1))/CONTROL/postinst
-endif
-       $(8)
-       $(IPKG_BUILD) $$(I_$(1)) $(PACKAGE_DIR)
-endef
-
-KERNEL_IPKG:=$(LINUX_BUILD_DIR)/kernel_$(LINUX_VERSION)-$(BOARD)-$(LINUX_RELEASE)_$(ARCH).ipk
-INSTALL_TARGETS := $(KERNEL_IPKG)
-TARGETS := 
-
index 210c195adffd466c6cef1fe0ec6d3ff705e8173c..4b0901987fc547718e12f54366506fe3b9361d90 100644 (file)
@@ -4,12 +4,9 @@ LINUX_VERSION:=2.6.17
 LINUX_RELEASE:=1
 LINUX_KERNEL_MD5SUM:=37ddefe96625502161f075b9d907f21e
 
-include ../rules.mk
 include ./config
-
-include ../generic-$(KERNEL)/modules.mk
-include ../kernel.mk
-
+include $(TOPDIR)/include/kernel.mk
+include $(TOPDIR)/include/kernel-build.mk
 
 $(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
        [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches
index bcc8bd05d286270338f537b592620b8a57e71226..a6208dbbbb5fc764c12e21dac34a39464e511faa 100644 (file)
@@ -4,17 +4,14 @@ LINUX_VERSION:=2.4.32
 LINUX_RELEASE:=1
 LINUX_KERNEL_MD5SUM:=38f4d0830e95a20f4bfed17622d5557c
 
-include ../rules.mk
 include ./config
+include $(TOPDIR)/include/kernel.mk
 
 $(eval $(call KMOD_template,WD1100,wd1100,\
        $(MODULES_DIR)/kernel/drivers/char/wd1100.o \
 ,CONFIG_WD1100))
 
-
-include ../generic-$(KERNEL)/modules.mk
-include ../kernel.mk
-
+include $(TOPDIR)/include/kernel-build.mk
 
 $(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
        [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches
index 7b2f1b068d20b54d1bb9119338db6216e445fa77..ab88d58dfb03beb7544d5bd1c9812f5e009f96c2 100644 (file)
@@ -4,12 +4,9 @@ LINUX_VERSION:=2.6.17
 LINUX_RELEASE:=1
 LINUX_KERNEL_MD5SUM:=37ddefe96625502161f075b9d907f21e
 
-include ../rules.mk
 include ./config
-
-include ../generic-$(KERNEL)/modules.mk
-include ../kernel.mk
-
+include $(TOPDIR)/include/kernel.mk
+include $(TOPDIR)/include/kernel-build.mk
 
 $(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
        [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches
index 608a49408bd30a81f3dfa307b00ea6ebcfdd2232..a4d93efc5fb818f84eeaabcb1231e4d6c1a83bb2 100644 (file)
@@ -4,12 +4,9 @@ LINUX_VERSION:=2.6.17
 LINUX_RELEASE:=1
 LINUX_KERNEL_MD5SUM:=37ddefe96625502161f075b9d907f21e
 
-include ../rules.mk
 include ./config
-
-include ../generic-$(KERNEL)/modules.mk
-include ../kernel.mk
-
+include $(TOPDIR)/include/kernel.mk
+include $(TOPDIR)/include/kernel-build.mk
 
 $(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
        [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches
diff --git a/openwrt/target/lzma/Makefile b/openwrt/target/lzma/Makefile
deleted file mode 100644 (file)
index 214967a..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#############################################################
-#
-# lzma target 
-# 
-#############################################################
-
-include $(TOPDIR)/rules.mk
-
-LZMA_DIR=$(BUILD_DIR)/lzma
-LZMA_SOURCE=lzma432.tar.bz2
-LZMA_SITE=@SF/sevenzip
-LZMA_MD5=155c1ebce5bc6710ae7ecc926226d9d7
-
-LZMA_LIB_DIR=$(LZMA_DIR)/C/7zip/Compress/LZMA_Lib
-LZMA_ALONE_DIR=$(LZMA_DIR)/C/7zip/Compress/LZMA_Alone
-
-TARGETS=$(LZMA_LIB_DIR)/liblzma.a $(LZMA_ALONE_DIR)/lzma
-
-$(DL_DIR)/$(LZMA_SOURCE):
-       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(LZMA_SOURCE) $(LZMA_MD5) $(LZMA_SITE)
-
-$(LZMA_DIR)/.unpacked: $(DL_DIR)/$(LZMA_SOURCE) 
-       @rm -rf $(LZMA_DIR) && mkdir -p $(LZMA_DIR)
-       tar xjf $^ -C $(LZMA_DIR)
-       patch -d $(LZMA_DIR) -p1 < lzma-zlib.patch
-       touch $(LZMA_DIR)/.unpacked
-       
-$(LZMA_ALONE_DIR)/lzma $(LZMA_LIB_DIR)/liblzma.a: $(LZMA_DIR)/.built
-$(LZMA_DIR)/.built: $(LZMA_DIR)/.unpacked
-       $(MAKE) -C $(LZMA_LIB_DIR)
-       $(MAKE) -f makefile.gcc -C $(LZMA_ALONE_DIR)
-       touch $@
-
-lzma: $(TARGETS)
-       $(CP) $^ $(LZMA_DIR)
-
-
-lzma-clean: FORCE
-       -$(MAKE) -C $(LZMA_LIB_DIR) clean
-       -$(MAKE) -C $(LZMA_ALONE_DIR) clean
-       rm -f $(LZMA_DIR)/liblzma.a $(LZMA_DIR)/lzma
-
-lzma-dirclean: FORCE
-       rm -rf $(LZMA_DIR)
-
-#############################################################
-
-source: $(DL_DIR)/$(LZMA_SOURCE)
-prepare: $(LZMA_DIR)/.unpacked
-compile: lzma
-install: lzma FORCE
-       $(CP) $(LZMA_DIR)/lzma $(STAGING_DIR)/bin/
-clean: lzma-dirclean
diff --git a/openwrt/target/lzma/lzma-zlib.patch b/openwrt/target/lzma/lzma-zlib.patch
deleted file mode 100644 (file)
index 7121053..0000000
+++ /dev/null
@@ -1,408 +0,0 @@
-diff -Nur lzma/C/7zip/Compress/LZMA/LZMADecoder.cpp lzma.patched/C/7zip/Compress/LZMA/LZMADecoder.cpp
---- lzma/C/7zip/Compress/LZMA/LZMADecoder.cpp  2005-09-22 10:55:34.000000000 +0200
-+++ lzma.patched/C/7zip/Compress/LZMA/LZMADecoder.cpp  2006-03-25 11:04:53.000000000 +0100
-@@ -274,12 +274,17 @@
-   Byte remainder = (Byte)(properties[0] / 9);
-   int lp = remainder % 5;
-   int pb = remainder / 5;
--  if (pb > NLength::kNumPosStatesBitsMax)
--    return E_INVALIDARG;
--  _posStateMask = (1 << pb) - 1;
-   UInt32 dictionarySize = 0;
-   for (int i = 0; i < 4; i++)
-     dictionarySize += ((UInt32)(properties[1 + i])) << (i * 8);
-+  return SetDecoderPropertiesRaw(lc, lp, pb, dictionarySize);
-+}
-+
-+STDMETHODIMP CDecoder::SetDecoderPropertiesRaw(int lc, int lp, int pb, UInt32 dictionarySize)
-+{
-+  if (pb > NLength::kNumPosStatesBitsMax)
-+    return E_INVALIDARG;
-+  _posStateMask = (1 << pb) - 1;
-   if (!_outWindowStream.Create(dictionarySize))
-     return E_OUTOFMEMORY;
-   if (!_literalDecoder.Create(lp, lc))
-diff -Nur lzma/C/7zip/Compress/LZMA/LZMADecoder.h lzma.patched/C/7zip/Compress/LZMA/LZMADecoder.h
---- lzma/C/7zip/Compress/LZMA/LZMADecoder.h    2005-09-19 08:10:06.000000000 +0200
-+++ lzma.patched/C/7zip/Compress/LZMA/LZMADecoder.h    2006-03-25 11:04:53.000000000 +0100
-@@ -228,6 +228,7 @@
-       ICompressProgressInfo *progress);
-   STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
-+  STDMETHOD(SetDecoderPropertiesRaw)(int lc, int lp, int pb, UInt32 dictionarySize);
-   STDMETHOD(GetInStreamProcessedSize)(UInt64 *value);
-diff -Nur lzma/C/7zip/Compress/LZMA_Lib/makefile lzma.patched/C/7zip/Compress/LZMA_Lib/makefile
---- lzma/C/7zip/Compress/LZMA_Lib/makefile     1970-01-01 01:00:00.000000000 +0100
-+++ lzma.patched/C/7zip/Compress/LZMA_Lib/makefile     2006-03-25 11:29:46.000000000 +0100
-@@ -0,0 +1,92 @@
-+PROG = liblzma.a
-+CXX = g++ -O3 -Wall
-+AR = ar
-+RM = rm -f
-+CFLAGS = -c  -I ../../../
-+
-+OBJS = \
-+  ZLib.o \
-+  LZMADecoder.o \
-+  LZMAEncoder.o \
-+  LZInWindow.o \
-+  LZOutWindow.o \
-+  RangeCoderBit.o \
-+  InBuffer.o \
-+  OutBuffer.o \
-+  FileStreams.o \
-+  Alloc.o \
-+  C_FileIO.o \
-+  CommandLineParser.o \
-+  CRC.o \
-+  StreamUtils.o \
-+  String.o \
-+  StringConvert.o \
-+  StringToInt.o \
-+  Vector.o \
-+
-+
-+all: $(PROG)
-+
-+$(PROG): $(OBJS)
-+      $(AR) r $(PROG) $(OBJS)
-+
-+ZLib.o: ZLib.cpp
-+      $(CXX) $(CFLAGS) ZLib.cpp
-+
-+LZMADecoder.o: ../LZMA/LZMADecoder.cpp
-+      $(CXX) $(CFLAGS) ../LZMA/LZMADecoder.cpp
-+
-+LZMAEncoder.o: ../LZMA/LZMAEncoder.cpp
-+      $(CXX) $(CFLAGS) ../LZMA/LZMAEncoder.cpp
-+
-+LZInWindow.o: ../LZ/LZInWindow.cpp
-+      $(CXX) $(CFLAGS) ../LZ/LZInWindow.cpp
-+
-+LZOutWindow.o: ../LZ/LZOutWindow.cpp
-+      $(CXX) $(CFLAGS) ../LZ/LZOutWindow.cpp
-+
-+RangeCoderBit.o: ../RangeCoder/RangeCoderBit.cpp
-+      $(CXX) $(CFLAGS) ../RangeCoder/RangeCoderBit.cpp
-+
-+InBuffer.o: ../../Common/InBuffer.cpp
-+      $(CXX) $(CFLAGS) ../../Common/InBuffer.cpp
-+
-+OutBuffer.o: ../../Common/OutBuffer.cpp
-+      $(CXX) $(CFLAGS) ../../Common/OutBuffer.cpp
-+
-+StreamUtils.o: ../../Common/StreamUtils.cpp
-+      $(CXX) $(CFLAGS) ../../Common/StreamUtils.cpp
-+
-+FileStreams.o: ../../Common/FileStreams.cpp
-+      $(CXX) $(CFLAGS) ../../Common/FileStreams.cpp
-+
-+Alloc.o: ../../../Common/Alloc.cpp
-+      $(CXX) $(CFLAGS) ../../../Common/Alloc.cpp
-+
-+C_FileIO.o: ../../../Common/C_FileIO.cpp
-+      $(CXX) $(CFLAGS) ../../../Common/C_FileIO.cpp
-+
-+CommandLineParser.o: ../../../Common/CommandLineParser.cpp
-+      $(CXX) $(CFLAGS) ../../../Common/CommandLineParser.cpp
-+
-+CRC.o: ../../../Common/CRC.cpp
-+      $(CXX) $(CFLAGS) ../../../Common/CRC.cpp
-+
-+MyWindows.o: ../../../Common/MyWindows.cpp
-+      $(CXX) $(CFLAGS) ../../../Common/MyWindows.cpp
-+
-+String.o: ../../../Common/String.cpp
-+      $(CXX) $(CFLAGS) ../../../Common/String.cpp
-+
-+StringConvert.o: ../../../Common/StringConvert.cpp
-+      $(CXX) $(CFLAGS) ../../../Common/StringConvert.cpp
-+
-+StringToInt.o: ../../../Common/StringToInt.cpp
-+      $(CXX) $(CFLAGS) ../../../Common/StringToInt.cpp
-+
-+Vector.o: ../../../Common/Vector.cpp
-+      $(CXX) $(CFLAGS) ../../../Common/Vector.cpp
-+
-+clean:
-+      -$(RM) $(PROG) $(OBJS)
-+
-diff -Nur lzma/C/7zip/Compress/LZMA_Lib/ZLib.cpp lzma.patched/C/7zip/Compress/LZMA_Lib/ZLib.cpp
---- lzma/C/7zip/Compress/LZMA_Lib/ZLib.cpp     1970-01-01 01:00:00.000000000 +0100
-+++ lzma.patched/C/7zip/Compress/LZMA_Lib/ZLib.cpp     2006-03-25 11:04:53.000000000 +0100
-@@ -0,0 +1,273 @@
-+/*
-+ * lzma zlib simplified wrapper
-+ *
-+ * Copyright (c) 2005-2006 Oleg I. Vdovikin <oleg@cs.msu.su>
-+ *
-+ * This library is free software; you can redistribute 
-+ * it and/or modify it under the terms of the GNU Lesser 
-+ * General Public License as published by the Free Software 
-+ * Foundation; either version 2.1 of the License, 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 Lesser General Public License 
-+ * for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General 
-+ * Public License along with this library; if not, write to 
-+ * the Free Software Foundation, Inc., 59 Temple Place, 
-+ * Suite 330, Boston, MA 02111-1307 USA 
-+ */
-+
-+/*
-+ * default values for encoder/decoder used by wrapper
-+ */
-+
-+#include <zlib.h>
-+
-+#define ZLIB_LC 3
-+#define ZLIB_LP 0
-+#define ZLIB_PB 2
-+
-+#ifdef WIN32
-+#include <initguid.h>
-+#else
-+#define INITGUID
-+#endif
-+
-+#include "../../../Common/MyWindows.h"
-+#include "../LZMA/LZMADecoder.h"
-+#include "../LZMA/LZMAEncoder.h"
-+
-+#define STG_E_SEEKERROR                  ((HRESULT)0x80030019L)
-+#define STG_E_MEDIUMFULL                 ((HRESULT)0x80030070L)
-+
-+class CInMemoryStream: 
-+  public IInStream,
-+  public IStreamGetSize,
-+  public CMyUnknownImp
-+{
-+public:
-+  CInMemoryStream(const Bytef *data, UInt64 size) : 
-+        m_data(data), m_size(size), m_offset(0) {}
-+
-+  virtual ~CInMemoryStream() {}
-+
-+  MY_UNKNOWN_IMP2(IInStream, IStreamGetSize)
-+
-+  STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize)
-+  {
-+        if (size > m_size - m_offset) 
-+                size = m_size - m_offset;
-+
-+        if (size) {
-+                memcpy(data, m_data + m_offset, size);
-+        }
-+
-+        m_offset += size;
-+
-+        if (processedSize) 
-+                *processedSize = size;
-+
-+        return S_OK;
-+  }
-+
-+  STDMETHOD(ReadPart)(void *data, UInt32 size, UInt32 *processedSize)
-+  {
-+      return Read(data, size, processedSize);
-+  }
-+
-+  STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
-+  {
-+        UInt64 _offset;
-+
-+        if (seekOrigin == STREAM_SEEK_SET) _offset = offset;
-+        else if (seekOrigin == STREAM_SEEK_CUR) _offset = m_offset + offset; 
-+        else if (seekOrigin == STREAM_SEEK_END) _offset = m_size;
-+        else return STG_E_INVALIDFUNCTION;
-+
-+        if (_offset < 0 || _offset > m_size)
-+                return STG_E_SEEKERROR;
-+
-+        m_offset = _offset;
-+
-+        if (newPosition)
-+                *newPosition = m_offset;
-+
-+        return S_OK;
-+  }
-+
-+  STDMETHOD(GetSize)(UInt64 *size)
-+  {
-+        *size = m_size;
-+        return S_OK;
-+  }
-+protected:
-+      const Bytef *m_data;
-+      UInt64 m_size;
-+      UInt64 m_offset;
-+};
-+
-+class COutMemoryStream: 
-+  public IOutStream,
-+  public CMyUnknownImp
-+{
-+public:
-+  COutMemoryStream(Bytef *data, UInt64 maxsize) : 
-+        m_data(data), m_size(0), m_maxsize(maxsize), m_offset(0) {}
-+  virtual ~COutMemoryStream() {}
-+  
-+  MY_UNKNOWN_IMP1(IOutStream)
-+
-+  STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize)
-+  {
-+        if (size > m_maxsize - m_offset) 
-+                size = m_maxsize - m_offset;
-+
-+        if (size) {
-+                memcpy(m_data + m_offset, data, size);
-+        }
-+
-+        m_offset += size;
-+
-+        if (m_offset > m_size)
-+              m_size = m_offset;
-+
-+        if (processedSize) 
-+                *processedSize = size;
-+
-+        return S_OK;
-+  }
-+  
-+  STDMETHOD(WritePart)(const void *data, UInt32 size, UInt32 *processedSize)
-+  {
-+        return Write(data, size, processedSize);
-+  }
-+
-+  STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
-+  {
-+        UInt64 _offset;
-+
-+        if (seekOrigin == STREAM_SEEK_SET) _offset = offset;
-+        else if (seekOrigin == STREAM_SEEK_CUR) _offset = m_offset + offset; 
-+        else if (seekOrigin == STREAM_SEEK_END) _offset = m_size;
-+        else return STG_E_INVALIDFUNCTION;
-+
-+        if (_offset < 0 || _offset > m_maxsize)
-+                return STG_E_SEEKERROR;
-+
-+        m_offset = _offset;
-+
-+        if (newPosition)
-+                *newPosition = m_offset;
-+
-+        return S_OK;
-+  }
-+  
-+  STDMETHOD(SetSize)(Int64 newSize)
-+  {
-+        if ((UInt64)newSize > m_maxsize) 
-+                return STG_E_MEDIUMFULL;
-+
-+        return S_OK;
-+  }
-+protected:
-+      Bytef *m_data;
-+      UInt64 m_size;
-+      UInt64 m_maxsize;
-+      UInt64 m_offset;
-+};
-+
-+ZEXTERN int ZEXPORT compress2 OF((Bytef *dest,   uLongf *destLen,
-+                                  const Bytef *source, uLong sourceLen,
-+                                  int level))
-+{
-+      CInMemoryStream *inStreamSpec = new CInMemoryStream(source, sourceLen);
-+      CMyComPtr<ISequentialInStream> inStream = inStreamSpec;
-+      
-+      COutMemoryStream *outStreamSpec = new COutMemoryStream(dest, *destLen);
-+      CMyComPtr<ISequentialOutStream> outStream = outStreamSpec;
-+      
-+      NCompress::NLZMA::CEncoder *encoderSpec = 
-+              new NCompress::NLZMA::CEncoder;
-+      CMyComPtr<ICompressCoder> encoder = encoderSpec;
-+      
-+      PROPID propIDs[] = 
-+      {
-+              NCoderPropID::kDictionarySize,
-+              NCoderPropID::kPosStateBits,
-+              NCoderPropID::kLitContextBits,
-+              NCoderPropID::kLitPosBits,
-+              NCoderPropID::kAlgorithm,
-+              NCoderPropID::kNumFastBytes,
-+              NCoderPropID::kMatchFinder,
-+              NCoderPropID::kEndMarker
-+      };
-+      const int kNumProps = sizeof(propIDs) / sizeof(propIDs[0]);
-+      
-+      PROPVARIANT properties[kNumProps];
-+      for (int p = 0; p < 6; p++)
-+              properties[p].vt = VT_UI4;
-+      properties[0].ulVal = UInt32(1 << (level + 14));
-+      properties[1].ulVal = UInt32(ZLIB_PB);
-+      properties[2].ulVal = UInt32(ZLIB_LC); // for normal files
-+      properties[3].ulVal = UInt32(ZLIB_LP); // for normal files
-+      properties[4].ulVal = UInt32(2);
-+      properties[5].ulVal = UInt32(128);
-+      
-+      properties[6].vt = VT_BSTR;
-+      properties[6].bstrVal = (BSTR)(const wchar_t *)L"BT4";
-+      
-+      properties[7].vt = VT_BOOL;
-+      properties[7].boolVal = VARIANT_TRUE;
-+      
-+      if (encoderSpec->SetCoderProperties(propIDs, properties, kNumProps) != S_OK)
-+              return Z_MEM_ERROR; // should not happen
-+      
-+      HRESULT result = encoder->Code(inStream, outStream, 0, 0, 0);
-+      if (result == E_OUTOFMEMORY)
-+      {
-+              return Z_MEM_ERROR;
-+      }   
-+      else if (result != S_OK)
-+      {
-+              return Z_BUF_ERROR;     // should not happen
-+      }   
-+      
-+      UInt64 fileSize;
-+      outStreamSpec->Seek(0, STREAM_SEEK_END, &fileSize);
-+      *destLen = fileSize;
-+      
-+      return Z_OK;
-+}
-+
-+ZEXTERN int ZEXPORT uncompress OF((Bytef *dest,   uLongf *destLen,
-+                                   const Bytef *source, uLong sourceLen))
-+{
-+      CInMemoryStream *inStreamSpec = new CInMemoryStream(source, sourceLen);
-+      CMyComPtr<ISequentialInStream> inStream = inStreamSpec;
-+      
-+      COutMemoryStream *outStreamSpec = new COutMemoryStream(dest, *destLen);
-+      CMyComPtr<ISequentialOutStream> outStream = outStreamSpec;
-+      
-+      NCompress::NLZMA::CDecoder *decoderSpec = 
-+              new NCompress::NLZMA::CDecoder;
-+      CMyComPtr<ICompressCoder> decoder = decoderSpec;
-+      
-+      if (decoderSpec->SetDecoderPropertiesRaw(ZLIB_LC, 
-+              ZLIB_LP, ZLIB_PB, (1 << 23)) != S_OK) return Z_DATA_ERROR;
-+      
-+      UInt64 fileSize = *destLen;
-+      
-+      if (decoder->Code(inStream, outStream, 0, &fileSize, 0) != S_OK)
-+      {
-+              return Z_DATA_ERROR;
-+      }
-+      
-+      outStreamSpec->Seek(0, STREAM_SEEK_END, &fileSize);
-+      *destLen = fileSize;
-+      
-+      return Z_OK;
-+}
index fac04682852f0ec97a46a29b889952eadae496ad..f9fb3a54d6ef653119a9afa7d07fb2f092e55ff6 100644 (file)
@@ -1,6 +1,6 @@
 # Main makefile for the toolchain
 include $(TOPDIR)/rules.mk
-TARGETS-y:=sed kernel-headers utils binutils gcc uClibc ipkg-utils libnotimpl
+TARGETS-y:=sed kernel-headers utils binutils gcc uClibc ipkg-utils libnotimpl squashfs jffs2 lzma
 TARGETS-$(CONFIG_GDB) += gdb
 
 TARGETS_DOWNLOAD:=$(patsubst %,%-source,$(TARGETS-y))
@@ -17,6 +17,7 @@ binutils-prepare: uClibc-prepare
 gcc-prepare: binutils-install
 uClibc-compile: gcc-prepare
 gcc-compile: uClibc-install
+squashfs-compile: lzma-compile
 
 TOOLCHAIN_STAMP_DIR:=$(STAGING_DIR)/stampfiles
 
diff --git a/openwrt/toolchain/jffs2/Makefile b/openwrt/toolchain/jffs2/Makefile
new file mode 100644 (file)
index 0000000..b673c43
--- /dev/null
@@ -0,0 +1,29 @@
+include $(TOPDIR)/rules.mk
+
+MTD_DIR:=$(BUILD_DIR)/mtd-20050122.orig
+MTD_SOURCE=mtd_20050122.orig.tar.gz
+MTD_SITE=http://ftp.debian.org/debian/pool/main/m/mtd
+MTD_MD5SUM:=1f42c2cae08eb9e7b52d0c188f8d6338
+MKFS_JFFS2=$(MTD_DIR)/util/mkfs.jffs2
+
+$(DL_DIR)/$(MTD_SOURCE):
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(MTD_SOURCE) $(MTD_MD5SUM) $(MTD_SITE)
+
+$(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
+       $(MAKE) LINUXDIR=$(LINUX_DIR) -C $(MTD_DIR)/util
+
+$(STAGING_DIR)/bin/mkfs.jffs2: $(MTD_DIR)/util/mkfs.jffs2
+       $(CP) $< $@
+
+source: $(DL_DIR)/$(MTD_SOURCE)
+prepare: $(MTD_DIR)/.unpacked
+compile: $(MTD_DIR)/util/mkfs.jffs2 $(STAGING_DIR)/bin/mkfs.jffs2
+install: 
+clean: FORCE
+       rm -rf $(MTD_DIR) $(STAGING_DIR)/bin/mkfs.jffs2
+
diff --git a/openwrt/toolchain/jffs2/patches/100-gcc4_fix.patch b/openwrt/toolchain/jffs2/patches/100-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); })
diff --git a/openwrt/toolchain/lzma/Makefile b/openwrt/toolchain/lzma/Makefile
new file mode 100644 (file)
index 0000000..cace2a4
--- /dev/null
@@ -0,0 +1,53 @@
+#############################################################
+#
+# lzma target 
+# 
+#############################################################
+
+include $(TOPDIR)/rules.mk
+
+LZMA_DIR=$(BUILD_DIR)/lzma
+LZMA_SOURCE=lzma432.tar.bz2
+LZMA_SITE=@SF/sevenzip
+LZMA_MD5=155c1ebce5bc6710ae7ecc926226d9d7
+
+LZMA_LIB_DIR=$(LZMA_DIR)/C/7zip/Compress/LZMA_Lib
+LZMA_ALONE_DIR=$(LZMA_DIR)/C/7zip/Compress/LZMA_Alone
+
+TARGETS=$(LZMA_LIB_DIR)/liblzma.a $(LZMA_ALONE_DIR)/lzma
+
+$(DL_DIR)/$(LZMA_SOURCE):
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(LZMA_SOURCE) $(LZMA_MD5) $(LZMA_SITE)
+
+$(LZMA_DIR)/.unpacked: $(DL_DIR)/$(LZMA_SOURCE) 
+       @rm -rf $(LZMA_DIR) && mkdir -p $(LZMA_DIR)
+       tar xjf $^ -C $(LZMA_DIR)
+       $(PATCH) $(LZMA_DIR) ./patches
+       touch $(LZMA_DIR)/.unpacked
+       
+$(LZMA_ALONE_DIR)/lzma $(LZMA_LIB_DIR)/liblzma.a: $(LZMA_DIR)/.built
+$(LZMA_DIR)/.built: $(LZMA_DIR)/.unpacked
+       $(MAKE) -C $(LZMA_LIB_DIR)
+       $(MAKE) -f makefile.gcc -C $(LZMA_ALONE_DIR)
+       touch $@
+
+lzma: $(TARGETS)
+       $(CP) $^ $(LZMA_DIR)
+
+
+lzma-clean: FORCE
+       -$(MAKE) -C $(LZMA_LIB_DIR) clean
+       -$(MAKE) -C $(LZMA_ALONE_DIR) clean
+       rm -f $(LZMA_DIR)/liblzma.a $(LZMA_DIR)/lzma
+
+lzma-dirclean: FORCE
+       rm -rf $(LZMA_DIR)
+
+#############################################################
+
+source: $(DL_DIR)/$(LZMA_SOURCE)
+prepare: $(LZMA_DIR)/.unpacked
+compile: lzma
+install: lzma FORCE
+       $(CP) $(LZMA_DIR)/lzma $(STAGING_DIR)/bin/
+clean: lzma-dirclean
diff --git a/openwrt/toolchain/lzma/patches/100-lzma_zlib.patch b/openwrt/toolchain/lzma/patches/100-lzma_zlib.patch
new file mode 100644 (file)
index 0000000..7121053
--- /dev/null
@@ -0,0 +1,408 @@
+diff -Nur lzma/C/7zip/Compress/LZMA/LZMADecoder.cpp lzma.patched/C/7zip/Compress/LZMA/LZMADecoder.cpp
+--- lzma/C/7zip/Compress/LZMA/LZMADecoder.cpp  2005-09-22 10:55:34.000000000 +0200
++++ lzma.patched/C/7zip/Compress/LZMA/LZMADecoder.cpp  2006-03-25 11:04:53.000000000 +0100
+@@ -274,12 +274,17 @@
+   Byte remainder = (Byte)(properties[0] / 9);
+   int lp = remainder % 5;
+   int pb = remainder / 5;
+-  if (pb > NLength::kNumPosStatesBitsMax)
+-    return E_INVALIDARG;
+-  _posStateMask = (1 << pb) - 1;
+   UInt32 dictionarySize = 0;
+   for (int i = 0; i < 4; i++)
+     dictionarySize += ((UInt32)(properties[1 + i])) << (i * 8);
++  return SetDecoderPropertiesRaw(lc, lp, pb, dictionarySize);
++}
++
++STDMETHODIMP CDecoder::SetDecoderPropertiesRaw(int lc, int lp, int pb, UInt32 dictionarySize)
++{
++  if (pb > NLength::kNumPosStatesBitsMax)
++    return E_INVALIDARG;
++  _posStateMask = (1 << pb) - 1;
+   if (!_outWindowStream.Create(dictionarySize))
+     return E_OUTOFMEMORY;
+   if (!_literalDecoder.Create(lp, lc))
+diff -Nur lzma/C/7zip/Compress/LZMA/LZMADecoder.h lzma.patched/C/7zip/Compress/LZMA/LZMADecoder.h
+--- lzma/C/7zip/Compress/LZMA/LZMADecoder.h    2005-09-19 08:10:06.000000000 +0200
++++ lzma.patched/C/7zip/Compress/LZMA/LZMADecoder.h    2006-03-25 11:04:53.000000000 +0100
+@@ -228,6 +228,7 @@
+       ICompressProgressInfo *progress);
+   STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
++  STDMETHOD(SetDecoderPropertiesRaw)(int lc, int lp, int pb, UInt32 dictionarySize);
+   STDMETHOD(GetInStreamProcessedSize)(UInt64 *value);
+diff -Nur lzma/C/7zip/Compress/LZMA_Lib/makefile lzma.patched/C/7zip/Compress/LZMA_Lib/makefile
+--- lzma/C/7zip/Compress/LZMA_Lib/makefile     1970-01-01 01:00:00.000000000 +0100
++++ lzma.patched/C/7zip/Compress/LZMA_Lib/makefile     2006-03-25 11:29:46.000000000 +0100
+@@ -0,0 +1,92 @@
++PROG = liblzma.a
++CXX = g++ -O3 -Wall
++AR = ar
++RM = rm -f
++CFLAGS = -c  -I ../../../
++
++OBJS = \
++  ZLib.o \
++  LZMADecoder.o \
++  LZMAEncoder.o \
++  LZInWindow.o \
++  LZOutWindow.o \
++  RangeCoderBit.o \
++  InBuffer.o \
++  OutBuffer.o \
++  FileStreams.o \
++  Alloc.o \
++  C_FileIO.o \
++  CommandLineParser.o \
++  CRC.o \
++  StreamUtils.o \
++  String.o \
++  StringConvert.o \
++  StringToInt.o \
++  Vector.o \
++
++
++all: $(PROG)
++
++$(PROG): $(OBJS)
++      $(AR) r $(PROG) $(OBJS)
++
++ZLib.o: ZLib.cpp
++      $(CXX) $(CFLAGS) ZLib.cpp
++
++LZMADecoder.o: ../LZMA/LZMADecoder.cpp
++      $(CXX) $(CFLAGS) ../LZMA/LZMADecoder.cpp
++
++LZMAEncoder.o: ../LZMA/LZMAEncoder.cpp
++      $(CXX) $(CFLAGS) ../LZMA/LZMAEncoder.cpp
++
++LZInWindow.o: ../LZ/LZInWindow.cpp
++      $(CXX) $(CFLAGS) ../LZ/LZInWindow.cpp
++
++LZOutWindow.o: ../LZ/LZOutWindow.cpp
++      $(CXX) $(CFLAGS) ../LZ/LZOutWindow.cpp
++
++RangeCoderBit.o: ../RangeCoder/RangeCoderBit.cpp
++      $(CXX) $(CFLAGS) ../RangeCoder/RangeCoderBit.cpp
++
++InBuffer.o: ../../Common/InBuffer.cpp
++      $(CXX) $(CFLAGS) ../../Common/InBuffer.cpp
++
++OutBuffer.o: ../../Common/OutBuffer.cpp
++      $(CXX) $(CFLAGS) ../../Common/OutBuffer.cpp
++
++StreamUtils.o: ../../Common/StreamUtils.cpp
++      $(CXX) $(CFLAGS) ../../Common/StreamUtils.cpp
++
++FileStreams.o: ../../Common/FileStreams.cpp
++      $(CXX) $(CFLAGS) ../../Common/FileStreams.cpp
++
++Alloc.o: ../../../Common/Alloc.cpp
++      $(CXX) $(CFLAGS) ../../../Common/Alloc.cpp
++
++C_FileIO.o: ../../../Common/C_FileIO.cpp
++      $(CXX) $(CFLAGS) ../../../Common/C_FileIO.cpp
++
++CommandLineParser.o: ../../../Common/CommandLineParser.cpp
++      $(CXX) $(CFLAGS) ../../../Common/CommandLineParser.cpp
++
++CRC.o: ../../../Common/CRC.cpp
++      $(CXX) $(CFLAGS) ../../../Common/CRC.cpp
++
++MyWindows.o: ../../../Common/MyWindows.cpp
++      $(CXX) $(CFLAGS) ../../../Common/MyWindows.cpp
++
++String.o: ../../../Common/String.cpp
++      $(CXX) $(CFLAGS) ../../../Common/String.cpp
++
++StringConvert.o: ../../../Common/StringConvert.cpp
++      $(CXX) $(CFLAGS) ../../../Common/StringConvert.cpp
++
++StringToInt.o: ../../../Common/StringToInt.cpp
++      $(CXX) $(CFLAGS) ../../../Common/StringToInt.cpp
++
++Vector.o: ../../../Common/Vector.cpp
++      $(CXX) $(CFLAGS) ../../../Common/Vector.cpp
++
++clean:
++      -$(RM) $(PROG) $(OBJS)
++
+diff -Nur lzma/C/7zip/Compress/LZMA_Lib/ZLib.cpp lzma.patched/C/7zip/Compress/LZMA_Lib/ZLib.cpp
+--- lzma/C/7zip/Compress/LZMA_Lib/ZLib.cpp     1970-01-01 01:00:00.000000000 +0100
++++ lzma.patched/C/7zip/Compress/LZMA_Lib/ZLib.cpp     2006-03-25 11:04:53.000000000 +0100
+@@ -0,0 +1,273 @@
++/*
++ * lzma zlib simplified wrapper
++ *
++ * Copyright (c) 2005-2006 Oleg I. Vdovikin <oleg@cs.msu.su>
++ *
++ * This library is free software; you can redistribute 
++ * it and/or modify it under the terms of the GNU Lesser 
++ * General Public License as published by the Free Software 
++ * Foundation; either version 2.1 of the License, 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 Lesser General Public License 
++ * for more details.
++ *
++ * You should have received a copy of the GNU Lesser General 
++ * Public License along with this library; if not, write to 
++ * the Free Software Foundation, Inc., 59 Temple Place, 
++ * Suite 330, Boston, MA 02111-1307 USA 
++ */
++
++/*
++ * default values for encoder/decoder used by wrapper
++ */
++
++#include <zlib.h>
++
++#define ZLIB_LC 3
++#define ZLIB_LP 0
++#define ZLIB_PB 2
++
++#ifdef WIN32
++#include <initguid.h>
++#else
++#define INITGUID
++#endif
++
++#include "../../../Common/MyWindows.h"
++#include "../LZMA/LZMADecoder.h"
++#include "../LZMA/LZMAEncoder.h"
++
++#define STG_E_SEEKERROR                  ((HRESULT)0x80030019L)
++#define STG_E_MEDIUMFULL                 ((HRESULT)0x80030070L)
++
++class CInMemoryStream: 
++  public IInStream,
++  public IStreamGetSize,
++  public CMyUnknownImp
++{
++public:
++  CInMemoryStream(const Bytef *data, UInt64 size) : 
++        m_data(data), m_size(size), m_offset(0) {}
++
++  virtual ~CInMemoryStream() {}
++
++  MY_UNKNOWN_IMP2(IInStream, IStreamGetSize)
++
++  STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize)
++  {
++        if (size > m_size - m_offset) 
++                size = m_size - m_offset;
++
++        if (size) {
++                memcpy(data, m_data + m_offset, size);
++        }
++
++        m_offset += size;
++
++        if (processedSize) 
++                *processedSize = size;
++
++        return S_OK;
++  }
++
++  STDMETHOD(ReadPart)(void *data, UInt32 size, UInt32 *processedSize)
++  {
++      return Read(data, size, processedSize);
++  }
++
++  STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
++  {
++        UInt64 _offset;
++
++        if (seekOrigin == STREAM_SEEK_SET) _offset = offset;
++        else if (seekOrigin == STREAM_SEEK_CUR) _offset = m_offset + offset; 
++        else if (seekOrigin == STREAM_SEEK_END) _offset = m_size;
++        else return STG_E_INVALIDFUNCTION;
++
++        if (_offset < 0 || _offset > m_size)
++                return STG_E_SEEKERROR;
++
++        m_offset = _offset;
++
++        if (newPosition)
++                *newPosition = m_offset;
++
++        return S_OK;
++  }
++
++  STDMETHOD(GetSize)(UInt64 *size)
++  {
++        *size = m_size;
++        return S_OK;
++  }
++protected:
++      const Bytef *m_data;
++      UInt64 m_size;
++      UInt64 m_offset;
++};
++
++class COutMemoryStream: 
++  public IOutStream,
++  public CMyUnknownImp
++{
++public:
++  COutMemoryStream(Bytef *data, UInt64 maxsize) : 
++        m_data(data), m_size(0), m_maxsize(maxsize), m_offset(0) {}
++  virtual ~COutMemoryStream() {}
++  
++  MY_UNKNOWN_IMP1(IOutStream)
++
++  STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize)
++  {
++        if (size > m_maxsize - m_offset) 
++                size = m_maxsize - m_offset;
++
++        if (size) {
++                memcpy(m_data + m_offset, data, size);
++        }
++
++        m_offset += size;
++
++        if (m_offset > m_size)
++              m_size = m_offset;
++
++        if (processedSize) 
++                *processedSize = size;
++
++        return S_OK;
++  }
++  
++  STDMETHOD(WritePart)(const void *data, UInt32 size, UInt32 *processedSize)
++  {
++        return Write(data, size, processedSize);
++  }
++
++  STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
++  {
++        UInt64 _offset;
++
++        if (seekOrigin == STREAM_SEEK_SET) _offset = offset;
++        else if (seekOrigin == STREAM_SEEK_CUR) _offset = m_offset + offset; 
++        else if (seekOrigin == STREAM_SEEK_END) _offset = m_size;
++        else return STG_E_INVALIDFUNCTION;
++
++        if (_offset < 0 || _offset > m_maxsize)
++                return STG_E_SEEKERROR;
++
++        m_offset = _offset;
++
++        if (newPosition)
++                *newPosition = m_offset;
++
++        return S_OK;
++  }
++  
++  STDMETHOD(SetSize)(Int64 newSize)
++  {
++        if ((UInt64)newSize > m_maxsize) 
++                return STG_E_MEDIUMFULL;
++
++        return S_OK;
++  }
++protected:
++      Bytef *m_data;
++      UInt64 m_size;
++      UInt64 m_maxsize;
++      UInt64 m_offset;
++};
++
++ZEXTERN int ZEXPORT compress2 OF((Bytef *dest,   uLongf *destLen,
++                                  const Bytef *source, uLong sourceLen,
++                                  int level))
++{
++      CInMemoryStream *inStreamSpec = new CInMemoryStream(source, sourceLen);
++      CMyComPtr<ISequentialInStream> inStream = inStreamSpec;
++      
++      COutMemoryStream *outStreamSpec = new COutMemoryStream(dest, *destLen);
++      CMyComPtr<ISequentialOutStream> outStream = outStreamSpec;
++      
++      NCompress::NLZMA::CEncoder *encoderSpec = 
++              new NCompress::NLZMA::CEncoder;
++      CMyComPtr<ICompressCoder> encoder = encoderSpec;
++      
++      PROPID propIDs[] = 
++      {
++              NCoderPropID::kDictionarySize,
++              NCoderPropID::kPosStateBits,
++              NCoderPropID::kLitContextBits,
++              NCoderPropID::kLitPosBits,
++              NCoderPropID::kAlgorithm,
++              NCoderPropID::kNumFastBytes,
++              NCoderPropID::kMatchFinder,
++              NCoderPropID::kEndMarker
++      };
++      const int kNumProps = sizeof(propIDs) / sizeof(propIDs[0]);
++      
++      PROPVARIANT properties[kNumProps];
++      for (int p = 0; p < 6; p++)
++              properties[p].vt = VT_UI4;
++      properties[0].ulVal = UInt32(1 << (level + 14));
++      properties[1].ulVal = UInt32(ZLIB_PB);
++      properties[2].ulVal = UInt32(ZLIB_LC); // for normal files
++      properties[3].ulVal = UInt32(ZLIB_LP); // for normal files
++      properties[4].ulVal = UInt32(2);
++      properties[5].ulVal = UInt32(128);
++      
++      properties[6].vt = VT_BSTR;
++      properties[6].bstrVal = (BSTR)(const wchar_t *)L"BT4";
++      
++      properties[7].vt = VT_BOOL;
++      properties[7].boolVal = VARIANT_TRUE;
++      
++      if (encoderSpec->SetCoderProperties(propIDs, properties, kNumProps) != S_OK)
++              return Z_MEM_ERROR; // should not happen
++      
++      HRESULT result = encoder->Code(inStream, outStream, 0, 0, 0);
++      if (result == E_OUTOFMEMORY)
++      {
++              return Z_MEM_ERROR;
++      }   
++      else if (result != S_OK)
++      {
++              return Z_BUF_ERROR;     // should not happen
++      }   
++      
++      UInt64 fileSize;
++      outStreamSpec->Seek(0, STREAM_SEEK_END, &fileSize);
++      *destLen = fileSize;
++      
++      return Z_OK;
++}
++
++ZEXTERN int ZEXPORT uncompress OF((Bytef *dest,   uLongf *destLen,
++                                   const Bytef *source, uLong sourceLen))
++{
++      CInMemoryStream *inStreamSpec = new CInMemoryStream(source, sourceLen);
++      CMyComPtr<ISequentialInStream> inStream = inStreamSpec;
++      
++      COutMemoryStream *outStreamSpec = new COutMemoryStream(dest, *destLen);
++      CMyComPtr<ISequentialOutStream> outStream = outStreamSpec;
++      
++      NCompress::NLZMA::CDecoder *decoderSpec = 
++              new NCompress::NLZMA::CDecoder;
++      CMyComPtr<ICompressCoder> decoder = decoderSpec;
++      
++      if (decoderSpec->SetDecoderPropertiesRaw(ZLIB_LC, 
++              ZLIB_LP, ZLIB_PB, (1 << 23)) != S_OK) return Z_DATA_ERROR;
++      
++      UInt64 fileSize = *destLen;
++      
++      if (decoder->Code(inStream, outStream, 0, &fileSize, 0) != S_OK)
++      {
++              return Z_DATA_ERROR;
++      }
++      
++      outStreamSpec->Seek(0, STREAM_SEEK_END, &fileSize);
++      *destLen = fileSize;
++      
++      return Z_OK;
++}
diff --git a/openwrt/toolchain/squashfs/Makefile b/openwrt/toolchain/squashfs/Makefile
new file mode 100644 (file)
index 0000000..a2b3671
--- /dev/null
@@ -0,0 +1,27 @@
+include $(TOPDIR)/rules.mk
+
+SQUASHFSLZMA_DIR=$(BUILD_DIR)/squashfs3.0
+SQUASHFSLZMA_SOURCE=squashfs3.0.tar.gz
+SQUASHFSLZMA_SITE=@SF/squashfs
+SQUASHFSLZMA_MD5SUM=9fd05d0bfbb712f5fb95edafea5bc733
+
+$(DL_DIR)/$(SQUASHFSLZMA_SOURCE):
+       $(SCRIPT_DIR)/download.pl $(DL_DIR) $(SQUASHFSLZMA_SOURCE) $(SQUASHFSLZMA_MD5SUM) $(SQUASHFSLZMA_SITE)
+
+$(SQUASHFSLZMA_DIR)/.unpacked: $(DL_DIR)/$(SQUASHFSLZMA_SOURCE) 
+       zcat $(DL_DIR)/$(SQUASHFSLZMA_SOURCE) | tar -C $(BUILD_DIR) -xvf -
+       $(PATCH) $(SQUASHFSLZMA_DIR) ./patches
+       touch $(SQUASHFSLZMA_DIR)/.unpacked
+
+$(SQUASHFSLZMA_DIR)/squashfs-tools/mksquashfs-lzma: $(SQUASHFSLZMA_DIR)/.unpacked
+       $(MAKE) -C $(SQUASHFSLZMA_DIR)/squashfs-tools mksquashfs-lzma LZMAPATH=$(BUILD_DIR)/lzma
+
+$(STAGING_DIR)/bin/mksquashfs-lzma: $(SQUASHFSLZMA_DIR)/squashfs-tools/mksquashfs-lzma
+       $(CP) $< $@
+
+source: $(DL_DIR)/$(SQUASHFSLZMA_SOURCE)
+prepare: $(SQUASHFSLZMA_DIR)/.unpacked
+compile: $(SQUASHFSLZMA_DIR)/squashfs-tools/mksquashfs-lzma $(STAGING_DIR)/bin/mksquashfs-lzma
+install:
+clean: FORCE
+       rm -rf $(SQUASHFSLZMA_DIR)
diff --git a/openwrt/toolchain/squashfs/patches/100-lzma.patch b/openwrt/toolchain/squashfs/patches/100-lzma.patch
new file mode 100644 (file)
index 0000000..85aa21f
--- /dev/null
@@ -0,0 +1,25 @@
+diff -Nur squashfs3.0/squashfs-tools/Makefile squashfs3.0-owrt/squashfs-tools/Makefile
+--- squashfs3.0/squashfs-tools/Makefile        2006-03-15 22:36:20.000000000 +0100
++++ squashfs3.0-owrt/squashfs-tools/Makefile   2006-03-21 11:14:08.000000000 +0100
+@@ -1,4 +1,5 @@
+ INCLUDEDIR = .
++#LZMAPATH = ../lzma/SRC/7zip/Compress/LZMA_Lib
+ CFLAGS := -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O2
+@@ -7,6 +8,9 @@
+ mksquashfs: mksquashfs.o read_fs.o sort.o
+       $(CC) mksquashfs.o read_fs.o sort.o -lz -o $@
++mksquashfs-lzma: mksquashfs.o read_fs.o sort.o
++      $(CXX) mksquashfs.o read_fs.o sort.o -L$(LZMAPATH) -llzma -o $@
++
+ mksquashfs.o: mksquashfs.c squashfs_fs.h mksquashfs.h global.h sort.h
+ read_fs.o: read_fs.c squashfs_fs.h read_fs.h global.h
+@@ -17,3 +21,5 @@
+       $(CC) unsquashfs.o -lz -o $@
+ unsquashfs.o: unsquashfs.c squashfs_fs.h read_fs.h global.h
++
++clean: