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 b1a8f81da924270ca7fae2fc55840fa239795896..4f71b399408fa2e27fa63ef83ca00185e4d2e7fe 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 57185c5fd3938ad9ac257d4580ab5c979e46760e..3fa9b89c20acb3489f9ed7768bd91f9cede9e3e2 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 2896b4c7830dcd1e146362f7cdb79afc9834d79c..09efaa39b8b74526d30e096cb0269b80fa92bc80 100644 (file)
@@ -17,6 +17,7 @@ define Package/Default
   CONFIGFILE:=
   SECTION:=opt
   CATEGORY:=Extra packages
+  PACKAGE_SUBDIR:=$(FEED)
   DEPENDS:=
   MDEPENDS:=
   CONFLICTS:=
index 5bc931e6ab06cbcf408c876824bd9f39d7bc60d3..666e9635bb1e4f4b4acf3fb94ec5af06970cf155 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 d13a37013c8ae045f5cccd75c6d1f86c730ee8ad..0cba07c6e62d28922e9d2183c43c5ea7ed9c82d5 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 aa5d52251625a4b7a2febe351e3d0e5f3c4cea7a..12bd0ae0c2b5b9a57e08e3b2028648b9f90eba23 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 48b1b7a96048d8e8729abc31aad8e0cdacc4f2da..99fdba1c819665746200c1e82cc0fd4b6bc5a71a 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 0ed3524e8175ecfc6f8e0a16cd13c4e57aaa3d04..8e285e53a8f2cb4de4fb420f704f7b52f6d3916b 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} = {};