include: group kmod ipk files into a "kernel" subdirectory
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 24 Jan 2016 15:36:05 +0000 (15:36 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 24 Jan 2016 15:36:05 +0000 (15:36 +0000)
This is useful to just use the kmods from an official build while supplying
base packages from a custom feed or the other way around; for just overriding
the kmods with a local repo while using official repos for the rest.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
SVN-Revision: 48475

include/feeds.mk
include/kernel.mk
include/package-defaults.mk
include/package-dumpinfo.mk
include/toplevel.mk
package/Makefile
scripts/metadata.pl
scripts/metadata.pm

index b1a8f81..4f71b39 100644 (file)
@@ -5,7 +5,7 @@
 # See /LICENSE for more information.
 #
 
--include $(TMP_DIR)/.packagefeeds
+-include $(TMP_DIR)/.packagesubdirs
 
 FEEDS_AVAILABLE:=$(shell $(SCRIPT_DIR)/feeds list -n)
 FEEDS_INSTALLED:=$(notdir $(wildcard $(TOPDIR)/package/feeds/*))
@@ -21,7 +21,7 @@ PKG_CONFIG_DEPENDS += \
 # 1: package name
 define FeedPackageDir
 $(strip $(if $(CONFIG_PER_FEED_REPO), \
-  $(abspath $(PACKAGE_DIR)/$(if $(Package/$(1)/feed),$(Package/$(1)/feed),base)), \
+  $(abspath $(PACKAGE_DIR)/$(if $(Package/$(1)/subdir),$(Package/$(1)/subdir),base)), \
   $(PACKAGE_DIR)))
 endef
 
@@ -29,7 +29,7 @@ endef
 define FeedSourcesAppend
 ( \
   $(strip $(if $(CONFIG_PER_FEED_REPO), \
-       $(foreach feed,base $(FEEDS_ENABLED),echo "src/gz %n_$(feed) %U/$(feed)";) \
+       $(foreach feed,base kernel $(FEEDS_ENABLED),echo "src/gz %n_$(feed) %U/$(feed)";) \
        $(if $(CONFIG_PER_FEED_REPO_ADD_DISABLED), \
                $(foreach feed,$(FEEDS_DISABLED),echo "$(if $(CONFIG_PER_FEED_REPO_ADD_COMMENTED),# )src/gz %n_$(feed) %U/$(feed)";)) \
   , \
index 57185c5..3fa9b89 100644 (file)
@@ -155,6 +155,7 @@ define KernelPackage
     DESCRIPTION:=$(DESCRIPTION)
     EXTRA_DEPENDS:=kernel (=$(LINUX_VERSION)-$(LINUX_RELEASE)-$(LINUX_VERMAGIC))
     VERSION:=$(LINUX_VERSION)$(if $(PKG_VERSION),+$(PKG_VERSION))-$(if $(PKG_RELEASE),$(PKG_RELEASE),$(LINUX_RELEASE))
+    PACKAGE_SUBDIR:=kernel
     $(call KernelPackage/$(1))
     $(call KernelPackage/$(1)/$(BOARD))
   endef
index 2896b4c..09efaa3 100644 (file)
@@ -17,6 +17,7 @@ define Package/Default
   CONFIGFILE:=
   SECTION:=opt
   CATEGORY:=Extra packages
+  PACKAGE_SUBDIR:=$(FEED)
   DEPENDS:=
   MDEPENDS:=
   CONFLICTS:=
index 5bc931e..666e963 100644 (file)
@@ -51,7 +51,7 @@ $(if $(PKG_LICENSE),License: $(PKG_LICENSE)
 $(if $(KCONFIG),Kernel-Config: $(KCONFIG)
 )$(if $(BUILDONLY),Build-Only: $(BUILDONLY)
 )$(if $(HIDDEN),Hidden: $(HIDDEN)
-)$(if $(FEED),Feed: $(FEED)
+)$(if $(PACKAGE_SUBDIR),Package-Subdir: $(PACKAGE_SUBDIR)
 )Description: $(if $(Package/$(1)/description),$(Package/$(1)/description),$(TITLE))
 $(if $(URL),$(URL)
 )$(MAINTAINER)
index d13a370..0cba07c 100644 (file)
@@ -84,9 +84,9 @@ prepare-tmpinfo: FORCE
                f=tmp/.$${type}info; t=tmp/.config-$${type}.in; \
                [ "$$t" -nt "$$f" ] || ./scripts/metadata.pl $(_ignore) $${type}_config "$$f" > "$$t" || { rm -f "$$t"; echo "Failed to build $$t"; false; break; }; \
        done
-       [ tmp/.config-feeds.in -nt tmp/.packagefeeds ] || ./scripts/feeds feed_config > tmp/.config-feeds.in
+       [ tmp/.config-feeds.in -nt tmp/.packagesubdirs ] || ./scripts/feeds feed_config > tmp/.config-feeds.in
        ./scripts/metadata.pl package_mk tmp/.packageinfo > tmp/.packagedeps || { rm -f tmp/.packagedeps; false; }
-       ./scripts/metadata.pl package_feeds tmp/.packageinfo > tmp/.packagefeeds || { rm -f tmp/.packagefeeds; false; }
+       ./scripts/metadata.pl package_subdirs tmp/.packageinfo > tmp/.packagesubdirs || { rm -f tmp/.packagesubdirs; false; }
        touch $(TOPDIR)/tmp/.build
 
 .config: ./scripts/config/conf $(if $(CONFIG_HAVE_DOT_CONFIG),,prepare-tmpinfo)
index aa5d522..12bd0ae 100644 (file)
@@ -137,9 +137,9 @@ endif
 PACKAGE_SUBDIRS=.
 ifneq ($(CONFIG_PER_FEED_REPO),)
   ifneq ($(CONFIG_PER_FEED_REPO_ADD_DISABLED),)
-    PACKAGE_SUBDIRS=base $(FEEDS_AVAILABLE)
+    PACKAGE_SUBDIRS=base kernel $(FEEDS_AVAILABLE)
   else
-    PACKAGE_SUBDIRS=base $(FEEDS_ENABLED)
+    PACKAGE_SUBDIRS=base kernel $(FEEDS_ENABLED)
   endif
 endif
 
index 48b1b7a..99fdba1 100755 (executable)
@@ -833,12 +833,12 @@ sub gen_package_source() {
        }
 }
 
-sub gen_package_feeds() {
+sub gen_package_subdirs() {
        parse_package_metadata($ARGV[0]) or exit 1;
        foreach my $name (sort {uc($a) cmp uc($b)} keys %package) {
                my $pkg = $package{$name};
-               if ($pkg->{name} && $pkg->{feed}) {
-                       print "Package/$name/feed = $pkg->{feed}\n";
+               if ($pkg->{name} && $pkg->{package_subdir}) {
+                       print "Package/$name/subdir = $pkg->{package_subdir}\n";
                }
        }
 }
@@ -880,7 +880,7 @@ sub parse_command() {
                /^package_config$/ and return gen_package_config();
                /^kconfig/ and return gen_kconfig_overrides();
                /^package_source$/ and return gen_package_source();
-               /^package_feeds$/ and return gen_package_feeds();
+               /^package_subdirs$/ and return gen_package_subdirs();
                /^package_license$/ and return gen_package_license(0);
                /^package_licensefull$/ and return gen_package_license(1);
                /^version_filter$/ and return gen_version_filtered_list();
@@ -892,7 +892,7 @@ Available Commands:
        $0 package_config [file]                Package metadata in Kconfig format
        $0 kconfig [file] [config] [patchver]   Kernel config overrides
        $0 package_source [file]                Package source file information
-       $0 package_feeds [file]                 Package feed information in makefile format
+       $0 package_subdirs [file]               Package subdir information in makefile format
        $0 package_license [file]               Package license information
        $0 package_licensefull [file]           Package license information (full list)
        $0 version_filter [patchver] [list...]  Filter list of version tagged strings
index 0ed3524..8e285e5 100644 (file)
@@ -222,7 +222,7 @@ sub parse_package_metadata($) {
                /^Build-Depends: \s*(.+)\s*$/ and $pkg->{builddepends} = [ split /\s+/, $1 ];
                /^Build-Depends\/(\w+): \s*(.+)\s*$/ and $pkg->{"builddepends/$1"} = [ split /\s+/, $2 ];
                /^Build-Types:\s*(.+)\s*$/ and $pkg->{buildtypes} = [ split /\s+/, $1 ];
-               /^Feed:\s*(.+?)\s*$/ and $pkg->{feed} = $1;
+               /^Package-Subdir:\s*(.+?)\s*$/ and $pkg->{package_subdir} = $1;
                /^Category: \s*(.+)\s*$/ and do {
                        $pkg->{category} = $1;
                        defined $category{$1} or $category{$1} = {};