aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/target-metadata.pl
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2016-07-22 14:27:52 +0200
committerFelix Fietkau <nbd@nbd.name>2016-07-29 10:18:26 +0200
commit76341cfc5f71fb3658535bc21b001399a84f8816 (patch)
tree6a81a709722d786717a4ebc2b2fd12e639187df8 /scripts/target-metadata.pl
parentc0dceae4bbb3aab0c4fcaf229925e8916d286797 (diff)
downloadupstream-76341cfc5f71fb3658535bc21b001399a84f8816.tar.gz
upstream-76341cfc5f71fb3658535bc21b001399a84f8816.tar.bz2
upstream-76341cfc5f71fb3658535bc21b001399a84f8816.zip
build: add support for per-device rootfs based on device profile packges
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'scripts/target-metadata.pl')
-rwxr-xr-xscripts/target-metadata.pl32
1 files changed, 29 insertions, 3 deletions
diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl
index ca9940e9d9..7dd782a6c2 100755
--- a/scripts/target-metadata.pl
+++ b/scripts/target-metadata.pl
@@ -151,6 +151,18 @@ sub gen_target_config() {
target_name($a) cmp target_name($b);
} @target;
+ foreach my $target (@target_sort) {
+ next if @{$target->{subtargets}} > 0;
+ print <<EOF;
+config DEFAULT_TARGET_$target->{conf}
+ bool
+ depends on TARGET_PER_DEVICE_ROOTFS
+ default y if TARGET_$target->{conf}
+EOF
+ foreach my $pkg (@{$target->{packages}}) {
+ print "\tselect DEFAULT_$pkg if TARGET_PER_DEVICE_ROOTFS\n";
+ }
+ }
print <<EOF;
choice
@@ -238,6 +250,9 @@ endchoice
menu "Target Devices"
depends on TARGET_MULTI_PROFILE
+ config TARGET_PER_DEVICE_ROOTFS
+ bool "Use a per-device root filesystem that adds profile packages"
+
EOF
foreach my $target (@target) {
my $profiles = $target->{profiles};
@@ -250,7 +265,8 @@ config TARGET_DEVICE_$target->{conf}_$profile->{id}
EOF
my @pkglist = merge_package_lists($target->{packages}, $profile->{packages});
foreach my $pkg (@pkglist) {
- print "\tselect DEFAULT_$pkg\n";
+ print "\tselect DEFAULT_$pkg if !TARGET_PER_DEVICE_ROOTFS\n";
+ print "\tselect MODULE_DEFAULT_$pkg if TARGET_PER_DEVICE_ROOTFS\n";
$defaults{$pkg} = 1;
}
}
@@ -340,8 +356,18 @@ config LINUX_$v
EOF
}
foreach my $def (sort keys %defaults) {
- print "\tconfig DEFAULT_".$def."\n";
- print "\t\tbool\n\n";
+ print <<EOF;
+ config DEFAULT_$def
+ bool
+
+ config MODULE_DEFAULT_$def
+ tristate
+ depends on TARGET_PER_DEVICE_ROOTFS
+ depends on m
+ default m if DEFAULT_$def
+ select PACKAGE_$def
+
+EOF
}
}