diff --git a/openwrt/Makefile b/openwrt/Makefile index b1bcf91a132..40b4efc0448 100644 --- a/openwrt/Makefile +++ b/openwrt/Makefile @@ -61,10 +61,16 @@ scripts/config/mconf: .config.in scripts/config/conf: .config.in $(MAKE) -C scripts/config conf -menuconfig: scripts/config/mconf +config: scripts/config/conf $< Config.in -config: scripts/config/conf +defdconfig: scripts/config/conf + $< -d Config.in + +oldconfig: scripts/config/conf + $< -o Config.in + +menuconfig: scripts/config/mconf $< Config.in config-clean: diff --git a/openwrt/package/base-files/Makefile b/openwrt/package/base-files/Makefile index 485ebddc3b5..226782bb92d 100644 --- a/openwrt/package/base-files/Makefile +++ b/openwrt/package/base-files/Makefile @@ -1,20 +1,11 @@ # $Id$ include $(TOPDIR)/rules.mk - -ifneq ($(DUMP),1) -include $(BUILD_DIR)/kernel.mk -include $(TOPDIR)/target/linux/rules.mk -TARGET:=-$(BOARD)-$(KERNEL) -BUILD_DIR:=$(BUILD_DIR)/linux-$(KERNEL)-$(BOARD) - -UCLIBC_VERSION:=${shell cat $(STAGING_DIR)/uclibc_version} -LIBGCC_VERSION:=${shell cat $(STAGING_DIR)/gcc_version} -endif +include $(TOPDIR)/package/kernel.mk PKG_NAME:=base-files PKG_RELEASE:=8 -PKG_BUILD_DIR:=$(BUILD_DIR)/base-files +PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/base-files REV:=$(shell LANG=C svn info | awk '/^Revision:/ { print$$2 }' ) ifeq ($(REV),) @@ -23,6 +14,12 @@ endif include $(TOPDIR)/package/rules.mk +ifneq ($(DUMP),1) +TARGET:=-$(BOARD)-$(KERNEL) +UCLIBC_VERSION:=${shell cat $(STAGING_DIR)/uclibc_version} +LIBGCC_VERSION:=${shell cat $(STAGING_DIR)/gcc_version} +endif + CONFIG_PACKAGE_base-files$(TARGET):=CONFIG_PACKAGE_base-files define Package/base-files$(TARGET) @@ -49,7 +46,6 @@ define Package/uclibc DESCRIPTION:=C library for embedded systems endef - define Build/Prepare mkdir -p $(PKG_BUILD_DIR) endef diff --git a/openwrt/package/kernel.mk b/openwrt/package/kernel.mk new file mode 100644 index 00000000000..def66437c65 --- /dev/null +++ b/openwrt/package/kernel.mk @@ -0,0 +1,28 @@ +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) +LINUX_DIR := $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) + +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 diff --git a/openwrt/target/linux/package/madwifi/Config.in b/openwrt/package/madwifi/Config.in similarity index 100% rename from openwrt/target/linux/package/madwifi/Config.in rename to openwrt/package/madwifi/Config.in diff --git a/openwrt/package/madwifi/Makefile b/openwrt/package/madwifi/Makefile new file mode 100644 index 00000000000..c24c821b247 --- /dev/null +++ b/openwrt/package/madwifi/Makefile @@ -0,0 +1,117 @@ +# $Id$ + +include $(TOPDIR)/rules.mk +include $(TOPDIR)/package/kernel.mk + +PKG_NAME:=madwifi +PKG_VERSION:=0.9.0 +PKG_RELEASE:=1 +PKG_MD5SUM:=9b558d1df84cab2b0006c595feee0fba + +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_CAT:=bzcat + +PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +ifeq ($(ARCH),mips) + HAL_TARGET:=mips-be-elf +endif +ifeq ($(ARCH),mipsel) + HAL_TARGET:=mips-le-elf +endif +ifeq ($(ARCH),i386) + HAL_TARGET:=i386-elf +endif +ifeq ($(ARCH),armeb) + HAL_TARGET:=xscale-be-elf +endif + +BUS := PCI +ifneq ($(CONFIG_LINUX_2_4_AR531X),) + BUS := AHB +endif +ifneq ($(CONFIG_LINUX_2_6_ARUBA),) + BUS := PCI AHB # no suitable HAL for AHB yet. +endif + +BUS_MODULES:= +ifeq ($(findstring AHB,$(BUS)),AHB) + BUS_MODULES+=$(PKG_BUILD_DIR)/ath/ath_ahb.$(LINUX_KMOD_SUFFIX) +endif +ifeq ($(findstring PCI,$(BUS)),PCI) + BUS_MODULES+=$(PKG_BUILD_DIR)/ath/ath_pci.$(LINUX_KMOD_SUFFIX) +endif + +MADWIFI_MAKEOPTS= -C $(PKG_BUILD_DIR) \ + PATH="$(TARGET_PATH)" \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + TARGET="$(HAL_TARGET)" \ + TOOLPREFIX="$(KERNEL_CROSS)" \ + TOOLPATH="$(KERNEL_CROSS)" \ + KERNELPATH="$(LINUX_DIR)" \ + DOMULTI=1 + +include $(TOPDIR)/package/rules.mk + +ifeq ($(findstring AHB,$(BUS)),AHB) +define Build/Compile/ahb + $(MAKE) $(MADWIFI_MAKEOPTS) BUS="AHB" all +endef +endif + +ifeq ($(findstring PCI,$(BUS)),PCI) +define Build/Compile/pci + $(MAKE) $(MADWIFI_MAKEOPTS) BUS="PCI" all +endef +endif + +define Build/Compile +$(call Build/Compile/ahb) +$(call Build/Compile/pci) +endef + +define Build/InstallDev + mkdir -p $(STAGING_DIR)/usr/include/madwifi + $(CP) $(PKG_BUILD_DIR)/include $(STAGING_DIR)/usr/include/madwifi/ + mkdir -p $(STAGING_DIR)/usr/include/madwifi/net80211 + $(CP) $(PKG_BUILD_DIR)/net80211/*.h $(STAGING_DIR)/usr/include/madwifi/net80211/ +endef + +define Build/UninstallDev + rm -rf $(STAGING_DIR)/usr/include/madwifi +endef + +define Package/kmod-madwifi + SECTION:=drivers + CATEGORY:=Drivers + DEFAULT:=y if LINUX_2_6_BRCM || LINUX_2_6_ARUBA || LINUX_2_4_AR531X || LINUX_2_6_XSCALE, m if ALL + TITLE:=Driver for Atheros wireless chipsets + DESCRIPTION:=Driver for Atheros 802.11a/b/g chipsets + URL:=http://madwifi.org/ +endef + +define Package/kmod-madwifi/install + mkdir -p $(1)/etc/modules.d + mkdir -p $(1)/etc/init.d + mkdir -p $(1)/lib/modules/$(LINUX_VERSION) + mkdir -p $(1)/usr/sbin + install -m0644 ./files/madwifi.modules $(1)/etc/modules.d/20-madwifi +ifeq ($(findstring AHB,$(BUS)),AHB) + echo ath_ahb >> $(1)/etc/modules.d/20-madwifi +endif +ifeq ($(findstring PCI,$(BUS)),PCI) + echo ath_pci >> $(1)/etc/modules.d/20-madwifi +endif + install -m0755 ./files/madwifi.init $(1)/etc/init.d/S20madwifi + $(CP) \ + $(PKG_BUILD_DIR)/ath_hal/ath_hal.$(LINUX_KMOD_SUFFIX) \ + $(BUS_MODULES) \ + $(PKG_BUILD_DIR)/ath_rate/sample/ath_rate_sample.$(LINUX_KMOD_SUFFIX) \ + $(PKG_BUILD_DIR)/net80211/*.$(LINUX_KMOD_SUFFIX) \ + $(1)/lib/modules/$(LINUX_VERSION)/ + $(CP) $(PKG_BUILD_DIR)/tools/{madwifi_multi,80211debug,80211stats,athchans,athctrl,athdebug,athkey,athstats,wlanconfig} $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,kmod-madwifi)) diff --git a/openwrt/target/linux/package/madwifi/files/madwifi.init b/openwrt/package/madwifi/files/madwifi.init similarity index 100% rename from openwrt/target/linux/package/madwifi/files/madwifi.init rename to openwrt/package/madwifi/files/madwifi.init diff --git a/openwrt/target/linux/package/madwifi/files/madwifi.modules b/openwrt/package/madwifi/files/madwifi.modules similarity index 92% rename from openwrt/target/linux/package/madwifi/files/madwifi.modules rename to openwrt/package/madwifi/files/madwifi.modules index eac01b66ee6..515c1e9aa11 100644 --- a/openwrt/target/linux/package/madwifi/files/madwifi.modules +++ b/openwrt/package/madwifi/files/madwifi.modules @@ -3,7 +3,6 @@ wlan_scan_ap wlan_scan_sta ath_hal ath_rate_sample -ath_pci wlan_acl wlan_ccmp wlan_tkip diff --git a/openwrt/target/linux/package/madwifi/ipkg/kmod-madwifi.control b/openwrt/package/madwifi/ipkg/kmod-madwifi.control similarity index 100% rename from openwrt/target/linux/package/madwifi/ipkg/kmod-madwifi.control rename to openwrt/package/madwifi/ipkg/kmod-madwifi.control diff --git a/openwrt/target/linux/package/madwifi/patches/100-kernel_cflags.patch b/openwrt/package/madwifi/patches/100-kernel_cflags.patch similarity index 96% rename from openwrt/target/linux/package/madwifi/patches/100-kernel_cflags.patch rename to openwrt/package/madwifi/patches/100-kernel_cflags.patch index b67183c3847..ef283dd3f2e 100644 --- a/openwrt/target/linux/package/madwifi/patches/100-kernel_cflags.patch +++ b/openwrt/package/madwifi/patches/100-kernel_cflags.patch @@ -1,12 +1,12 @@ diff -ru madwifi-ng-r1486-20060329/Makefile madwifi-ng-r1486-20060329-patch/Makefile --- madwifi-ng-r1486-20060329/Makefile 2006-03-13 19:23:02.000000000 -0500 +++ madwifi-ng-r1486-20060329-patch/Makefile 2006-03-31 10:52:05.000000000 -0500 -@@ -52,7 +52,7 @@ +@@ -51,7 +51,7 @@ all: modules tools --modules: configcheck svnversion.h -+modules: svnversion.h +-modules: configcheck svnversion.h ++modules: svnversion.h mkdir -p ${SYMBOLSDIR} for i in ${DIRS_MODULES}; do \ $(MAKE) -C $$i || exit 1; \ diff --git a/openwrt/target/linux/package/madwifi/patches/101-no_werror.patch b/openwrt/package/madwifi/patches/101-no_werror.patch similarity index 100% rename from openwrt/target/linux/package/madwifi/patches/101-no_werror.patch rename to openwrt/package/madwifi/patches/101-no_werror.patch diff --git a/openwrt/target/linux/package/madwifi/patches/102-multicall_binary.patch b/openwrt/package/madwifi/patches/102-multicall_binary.patch similarity index 100% rename from openwrt/target/linux/package/madwifi/patches/102-multicall_binary.patch rename to openwrt/package/madwifi/patches/102-multicall_binary.patch diff --git a/openwrt/target/linux/package/madwifi/patches/104-apmode_by_default.patch b/openwrt/package/madwifi/patches/104-apmode_by_default.patch similarity index 100% rename from openwrt/target/linux/package/madwifi/patches/104-apmode_by_default.patch rename to openwrt/package/madwifi/patches/104-apmode_by_default.patch diff --git a/openwrt/target/linux/package/madwifi/Makefile b/openwrt/target/linux/package/madwifi/Makefile deleted file mode 100644 index 97cb0bd5e5f..00000000000 --- a/openwrt/target/linux/package/madwifi/Makefile +++ /dev/null @@ -1,105 +0,0 @@ -# $Id$ - -include $(TOPDIR)/rules.mk -include ../../rules.mk - -PKG_NAME:=madwifi-ng -PKG_VERSION:=r1543-20060506 -PKG_RELEASE:=1 -PKG_MD5SUM:=3d89e5197c7e43eb37564c176140b2bf - -PKG_SOURCE_URL:=http://snapshots.madwifi.org/$(PKG_NAME) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_CAT:=zcat - -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) - -ifeq ($(ARCH),mips) -HAL_TARGET:=mips-be-elf -endif -ifeq ($(ARCH),mipsel) -HAL_TARGET:=mips-le-elf -endif -ifeq ($(ARCH),i386) -HAL_TARGET:=i386-elf -endif -ifeq ($(ARCH),armeb) -HAL_TARGET:=xscale-be-elf -endif - -BUS := PCI - -ifneq ($(CONFIG_LINUX_2_4_AR531X),) - BUS := AHB -endif -ifneq ($(CONFIG_LINUX_2_6_ARUBA),) - BUS := PCI AHB # no suitable HAL for AHB yet. -endif - -BUS_MODULES:= -ifeq ($(findstring AHB,$(BUS)),AHB) -BUS_MODULES+=$(PKG_BUILD_DIR)/ath/ath_ahb.$(LINUX_KMOD_SUFFIX) -endif -ifeq ($(findstring PCI,$(BUS)),PCI) -BUS_MODULES+=$(PKG_BUILD_DIR)/ath/ath_pci.$(LINUX_KMOD_SUFFIX) -endif - - -include $(TOPDIR)/package/rules.mk - -$(eval $(call PKG_template,KMOD_MADWIFI,kmod-madwifi,$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE),$(ARCH),kernel ($(LINUX_VERSION)-$(BOARD)-$(LINUX_RELEASE)))) - -$(PKG_BUILD_DIR)/.configured: - touch $@ - -MADWIFI_MAKEOPTS= -C $(PKG_BUILD_DIR) \ - PATH="$(TARGET_PATH)" \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - TARGET="$(HAL_TARGET)" \ - TOOLPREFIX="$(KERNEL_CROSS)" \ - TOOLPATH="$(KERNEL_CROSS)" \ - KERNELPATH="$(LINUX_DIR)" \ - DOMULTI=1 - - -$(PKG_BUILD_DIR)/.built: -ifeq ($(findstring AHB,$(BUS)),AHB) - $(MAKE) $(MADWIFI_MAKEOPTS) BUS="AHB" all -endif -ifeq ($(findstring PCI,$(BUS)),PCI) - $(MAKE) $(MADWIFI_MAKEOPTS) BUS="PCI" all -endif - $(RSTRIP) $(PKG_BUILD_DIR)/tools/madwifi_multi - touch $@ - -$(IPKG_KMOD_MADWIFI): - mkdir -p $(IDIR_KMOD_MADWIFI)/etc/modules.d - mkdir -p $(IDIR_KMOD_MADWIFI)/etc/init.d - mkdir -p $(IDIR_KMOD_MADWIFI)/lib/modules/$(LINUX_VERSION) - mkdir -p $(IDIR_KMOD_MADWIFI)/usr/sbin - install -m0644 ./files/madwifi.modules $(IDIR_KMOD_MADWIFI)/etc/modules.d/20-madwifi - install -m0755 ./files/madwifi.init $(IDIR_KMOD_MADWIFI)/etc/init.d/S20madwifi - $(CP) $(PKG_BUILD_DIR)/net80211/wlan*.$(LINUX_KMOD_SUFFIX) \ - $(PKG_BUILD_DIR)/ath_hal/ath_hal.$(LINUX_KMOD_SUFFIX) \ - $(BUS_MODULES) \ - $(PKG_BUILD_DIR)/ath_rate/sample/ath_rate_sample.$(LINUX_KMOD_SUFFIX) \ - $(PKG_BUILD_DIR)/net80211/*.$(LINUX_KMOD_SUFFIX) \ - $(IDIR_KMOD_MADWIFI)/lib/modules/$(LINUX_VERSION)/ - $(CP) $(PKG_BUILD_DIR)/tools/{madwifi_multi,80211debug,80211stats,athchans,athctrl,athdebug,athkey,athstats,wlanconfig} $(IDIR_KMOD_MADWIFI)/usr/sbin/ - $(IPKG_BUILD) $(IDIR_KMOD_MADWIFI) $(PACKAGE_DIR) - -$(STAGING_DIR)/usr/include/madwifi/net80211/ieee80211.h: $(PKG_BUILD_DIR)/.built - mkdir -p $(STAGING_DIR)/usr/include/madwifi - $(CP) $(PKG_BUILD_DIR)/include $(STAGING_DIR)/usr/include/madwifi/ - mkdir -p $(STAGING_DIR)/usr/include/madwifi/net80211 - $(CP) $(PKG_BUILD_DIR)/net80211/*.h $(STAGING_DIR)/usr/include/madwifi/net80211/ - touch $@ - -install-dev: $(STAGING_DIR)/usr/include/madwifi/net80211/ieee80211.h - -uninstall-dev: - rm -rf $(STAGING_DIR)/usr/include/madwifi - -compile-targets: install-dev -clean-targets: uninstall-dev