target/metadata: set OpenWrt One as the default menuconfig target/profile
authorJohn Crispin <john@phrozen.org>
Fri, 29 Nov 2024 08:13:52 +0000 (09:13 +0100)
committerJohn Crispin <john@phrozen.org>
Mon, 2 Dec 2024 12:55:36 +0000 (13:55 +0100)
Signed-off-by: John Crispin <john@phrozen.org>
include/target.mk
scripts/metadata.pm
scripts/target-metadata.pl
target/linux/mediatek/filogic/target.mk

index 02ea68b15c81216fdeeeeca92aaf6736d155a728..a4428efab710ddd597190e3be5b779704de1d361 100644 (file)
@@ -375,6 +375,7 @@ define BuildTargets/DumpCurrent
         echo 'Target-Description:'; \
         echo "$$$$DESCRIPTION"; \
         echo '@@'; \
+        $(if $(DEFAULT_PROFILE),echo 'Target-Default-Profile: $(DEFAULT_PROFILE)';) \
         echo 'Default-Packages: $(DEFAULT_PACKAGES) $(call extra_packages,$(DEFAULT_PACKAGES))'; \
         $(DUMPINFO)
        $(if $(CUR_SUBTARGET),$(SUBMAKE) -r --no-print-directory -C image -s DUMP=1 SUBTARGET=$(CUR_SUBTARGET))
index ecfe42c0bc926c9a9322301fade7c73892e5e332..dec9e62dff1295db33019dc2b2c8f2faa0b4f479 100644 (file)
@@ -136,6 +136,7 @@ sub parse_target_metadata($) {
                /^Linux-Kernel-Arch:\s*(.+)\s*$/ and $target->{karch} = $1;
                /^Default-Subtarget:\s*(.+)\s*$/ and $target->{def_subtarget} = $1;
                /^Default-Packages:\s*(.+)\s*$/ and $target->{packages} = [ split(/\s+/, $1) ];
+               /^Target-Default-Profile:\s*(.+)\s*$/ and $target->{default_profile} = $1;
                /^Target-Profile:\s*(.+)\s*$/ and do {
                        $profile = {
                                id => $1,
index 0c17e2e3273df6373d9529085502efeae56bc502..ce96d1e7d538a1cd006efc9b034c7c877ce17cac 100755 (executable)
@@ -179,7 +179,7 @@ EOF
        print <<EOF;
 choice
        prompt "Target System"
-       default TARGET_ath79
+       default TARGET_mediatek
        reset if !DEVEL
        
 EOF
@@ -219,6 +219,14 @@ choice
 EOF
        foreach my $target (@target) {
                my $profile = $target->{profiles}->[0];
+               foreach my $p (@{$target->{profiles}}) {
+                       last unless $target->{default_profile};
+                       my $name = $p->{id};
+                       $name =~ s/^DEVICE_//;
+                       next unless $name eq $target->{default_profile};
+                       $profile = $p;
+                       last;
+               }
                $profile or next;
                print <<EOF;
        default TARGET_$target->{conf}_$profile->{id} if TARGET_$target->{conf} && !BUILDBOT
index d1637e06af700eee603b37bfccdc59dd7f853177..52ce25de1ee2f849ffda192287c10f4c1975878d 100644 (file)
@@ -4,6 +4,7 @@ BOARDNAME:=Filogic 8x0 (MT798x)
 CPU_TYPE:=cortex-a53
 DEFAULT_PACKAGES += fitblk kmod-phy-aquantia kmod-crypto-hw-safexcel wpad-basic-mbedtls uboot-envtools
 KERNELNAME:=Image dtbs
+DEFAULT_PROFILE:=openwrt_one
 
 define Target/Description
        Build firmware images for MediaTek Filogic ARM based boards.