/ext4/ and $ret .= "\tselect USES_EXT4\n";
/targz/ and $ret .= "\tselect USES_TARGZ\n";
/cpiogz/ and $ret .= "\tselect USES_CPIOGZ\n";
+ /minor/ and $ret .= "\tselect USES_MINOR\n";
/ubifs/ and $ret .= "\tselect USES_UBIFS\n";
/fpu/ and $ret .= "\tselect HAS_FPU\n";
/spe_fpu/ and $ret .= "\tselect HAS_SPE_FPU\n";
/mips16/ and $ret .= "\tselect HAS_MIPS16\n";
/rfkill/ and $ret .= "\tselect RFKILL_SUPPORT\n";
/low_mem/ and $ret .= "\tselect LOW_MEMORY_FOOTPRINT\n";
+ /small_flash/ and $ret .= "\tselect SMALL_FLASH\n";
/nand/ and $ret .= "\tselect NAND_SUPPORT\n";
+ /virtio/ and $ret .= "\tselect VIRTIO_SUPPORT\n";
}
return $ret;
}
if ($target->{arch} =~ /\w/) {
$confstr .= "\tselect $target->{arch}\n";
}
+ if ($target->{has_devices}) {
+ $confstr .= "\tselect HAS_DEVICES\n";
+ }
}
foreach my $dep (@{$target->{depends}}) {
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
choice
prompt "Target Profile"
+EOF
+ foreach my $target (@target) {
+ my $profile = $target->{profiles}->[0];
+ $profile or next;
+ print <<EOF;
+ default TARGET_$target->{conf}_$profile->{id} if TARGET_$target->{conf}
+EOF
+ }
+
+ print <<EOF;
+
+config TARGET_MULTI_PROFILE
+ bool "Multiple devices"
+ depends on HAS_DEVICES
+
EOF
foreach my $target (@target) {
print <<EOF;
endchoice
+menu "Target Devices"
+ depends on TARGET_MULTI_PROFILE
+
+ config TARGET_ALL_PROFILES
+ bool "Enable all profiles by default"
+
+ 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};
+ foreach my $profile (@{$target->{profiles}}) {
+ next unless $profile->{id} =~ /^DEVICE_/;
+ print <<EOF;
+config TARGET_DEVICE_$target->{conf}_$profile->{id}
+ bool "$profile->{name}"
+ depends on TARGET_$target->{conf}
+ default y if TARGET_ALL_PROFILES
+EOF
+ my @pkglist = merge_package_lists($target->{packages}, $profile->{packages});
+ foreach my $pkg (@pkglist) {
+ print "\tselect DEFAULT_$pkg if !TARGET_PER_DEVICE_ROOTFS\n";
+ print "\tselect MODULE_DEFAULT_$pkg if TARGET_PER_DEVICE_ROOTFS\n";
+ $defaults{$pkg} = 1;
+ }
+ }
+ }
+
+ print <<EOF;
+
+endmenu
+
config HAS_SUBTARGETS
bool
+config HAS_DEVICES
+ bool
+
config TARGET_BOARD
string
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
}
}