Changeset 4146


Ignore:
Timestamp:
2006-07-18T18:17:19+02:00 (12 years ago)
Author:
nbd
Message:

move some of the kernel module packaging to package/kernel/

Location:
branches/buildroot-ng/openwrt
Files:
3 added
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • branches/buildroot-ng/openwrt/include/kernel-build.mk

    r4098 r4146  
    137137        rm -f $(TARGETS) 
    138138 
    139  
    140 define AutoLoad 
    141 add_module $(1) "$(2)"; 
    142 endef 
    143  
    144 define KernelPackage/Defaults 
    145   VERSION:=$(LINUX_VERSION)-$(BOARD)-$(LINUX_RELEASE) 
    146   DEPENDS:= 
    147   MAINTAINER:=OpenWrt Developers Team <openwrt-devel@openwrt.org> 
    148   SOURCE:=$(patsubst $(TOPDIR)/%,%,${shell pwd}) 
    149   PKGARCH:=$(ARCH) 
    150   PRIORITY:=optional 
    151   KCONFIG:= 
    152   FILES:= 
    153   BUILD:= 
    154   MODULES:= 
    155   TITLE:= 
    156   DESCRIPTION:= 
    157 endef 
    158  
    159 define KernelPackage 
    160   NAME:=$(1) 
    161   $(eval $(call KernelPackage/Defaults)) 
    162   $(eval $(call KernelPackage/$(1))) 
    163   $(eval $(call KernelPackage/$(1)/$(KERNEL))) 
    164    
    165   PKG_$(1) := $(PACKAGE_DIR)/kmod-$(1)_$(LINUX_VERSION)-$(BOARD)-$(LINUX_RELEASE)_$(ARCH).ipk 
    166   I_$(1) := $(KMOD_BUILD_DIR)/ipkg/$(1) 
    167    
    168   IDEPEND_$(1):='kernel ($(LINUX_VERSION)-$(BOARD)-$(LINUX_RELEASE))' $(DEPENDS) 
    169    
    170   ifeq ($$(strip $(KCONFIG)),) 
    171     KDEPEND_$(1):=m 
    172   else 
    173     KDEPEND_$(1):=$($(KCONFIG)) 
    174   endif 
    175   ifeq ($$(KDEPEND_$(1)),m) 
    176     ifneq ($(CONFIG_PACKAGE_kmod-$(1)),) 
    177       packages: $$(PKG_$(1)) 
    178     endif 
    179     ifeq ($(CONFIG_PACKAGE_kmod-$(1)),y) 
    180       install-kmod-$(1): FORCE 
    181                 $(IPKG) install $$(PKG_$(1)) 
    182       pkg-install: install-kmod-$(1) 
    183     endif 
    184   endif 
    185  
    186   $$(PKG_$(1)): $(LINUX_DIR)/.modules_done 
    187         rm -rf $$(I_$(1)) 
    188         install -d -m0755 $$(I_$(1))/CONTROL 
    189         echo "Package: kmod-$(1)" > $$(I_$(1))/CONTROL/control 
    190         echo "Version: $(VERSION)" >> $$(I_$(1))/CONTROL/control 
    191         ( \ 
    192                 DEPENDS=; \ 
    193                 for depend in $$(filter-out @%,$$(IDEPEND_$(1))); do \ 
    194                         DEPENDS=$$$${DEPENDS:+$$$$DEPENDS, }$$$${depend##+}; \ 
    195                 done; \ 
    196                 echo "Depends: $$$$DEPENDS" >> $$(I_$(1))/CONTROL/control; \ 
    197         ) 
    198         echo "Source: $(SOURCE)" >> $$(I_$(1))/CONTROL/control 
    199         echo "Section: kernel" >> $$(I_$(1))/CONTROL/control 
    200         echo "Priority: $(PRIORITY)" >> $$(I_$(1))/CONTROL/control 
    201         echo "Maintainer: $(MAINTAINER)" >> $$(I_$(1))/CONTROL/control 
    202         echo "Architecture: $(PKGARCH)" >> $$(I_$(1))/CONTROL/control 
    203         echo "Description: $(DESCRIPTION)" | sed -e 's,\\,\n ,g' >> $$(I_$(1))/CONTROL/control 
    204   ifneq ($(strip $(FILES)),) 
    205         mkdir -p $$(I_$(1))/lib/modules/$(LINUX_VERSION) 
    206         $(CP) $(FILES) $$(I_$(1))/lib/modules/$(LINUX_VERSION)/ 
    207   endif 
    208   ifneq ($(MODULES),) 
    209         export modules=; \ 
    210         add_module() { \ 
    211                 mkdir -p $$(I_$(1))/etc/modules.d; \ 
    212                 echo "$$$$2" > $$(I_$(1))/etc/modules.d/$$$$1-$(1); \ 
    213                 modules="$$$${modules:+$$$$modules }$$$$1-$(1)"; \ 
    214         }; \ 
    215         $(MODULES) \ 
    216         mkdir -p $$(I_$(1))/etc/modules.d; \ 
    217         echo "#!/bin/sh" >> $$(I_$(1))/CONTROL/postinst; \ 
    218         echo "[ -z \"\$$$$IPKG_INSTROOT\" ] || exit" >> $$(I_$(1))/CONTROL/postinst; \ 
    219         echo ". /etc/functions.sh" >> $$(I_$(1))/CONTROL/postinst; \ 
    220         echo "load_modules $$$$modules" >> $$(I_$(1))/CONTROL/postinst; \ 
    221         chmod 0755 $$(I_$(1))/CONTROL/postinst; 
    222   endif 
    223         $(IPKG_BUILD) $$(I_$(1)) $(PACKAGE_DIR) 
    224 endef 
    225  
    226 -include $(INCLUDE_DIR)/modules.mk 
    227  
Note: See TracChangeset for help on using the changeset viewer.