metadata.pl 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  1. #!/usr/bin/env perl
  2. use FindBin;
  3. use lib "$FindBin::Bin";
  4. use strict;
  5. use metadata;
  6. my %board;
  7. sub confstr($) {
  8. my $conf = shift;
  9. $conf =~ tr#/\.\-/#___#;
  10. return $conf;
  11. }
  12. sub parse_target_metadata() {
  13. my $file = shift @ARGV;
  14. my ($target, @target, $profile);
  15. my %target;
  16. open FILE, "<$file" or do {
  17. warn "Can't open file '$file': $!\n";
  18. return;
  19. };
  20. while (<FILE>) {
  21. chomp;
  22. /^Target:\s*(.+)\s*$/ and do {
  23. my $name = $1;
  24. $target = {
  25. id => $name,
  26. board => $name,
  27. boardconf => confstr($name),
  28. conf => confstr($name),
  29. profiles => [],
  30. features => [],
  31. depends => [],
  32. subtargets => []
  33. };
  34. push @target, $target;
  35. $target{$name} = $target;
  36. if ($name =~ /([^\/]+)\/([^\/]+)/) {
  37. push @{$target{$1}->{subtargets}}, $2;
  38. $target->{board} = $1;
  39. $target->{boardconf} = confstr($1);
  40. $target->{subtarget} = 1;
  41. $target->{parent} = $target{$1};
  42. }
  43. };
  44. /^Target-Kernel:\s*(\d+\.\d+)\s*$/ and $target->{kernel} = $1;
  45. /^Target-Name:\s*(.+)\s*$/ and $target->{name} = $1;
  46. /^Target-Path:\s*(.+)\s*$/ and $target->{path} = $1;
  47. /^Target-Arch:\s*(.+)\s*$/ and $target->{arch} = $1;
  48. /^Target-Features:\s*(.+)\s*$/ and $target->{features} = [ split(/\s+/, $1) ];
  49. /^Target-Depends:\s*(.+)\s*$/ and $target->{depends} = [ split(/\s+/, $1) ];
  50. /^Target-Description:/ and $target->{desc} = get_multiline(*FILE);
  51. /^Linux-Version:\s*(.+)\s*$/ and $target->{version} = $1;
  52. /^Linux-Release:\s*(.+)\s*$/ and $target->{release} = $1;
  53. /^Linux-Kernel-Arch:\s*(.+)\s*$/ and $target->{karch} = $1;
  54. /^Default-Packages:\s*(.+)\s*$/ and $target->{packages} = [ split(/\s+/, $1) ];
  55. /^Target-Profile:\s*(.+)\s*$/ and do {
  56. $profile = {
  57. id => $1,
  58. name => $1,
  59. packages => []
  60. };
  61. push @{$target->{profiles}}, $profile;
  62. };
  63. /^Target-Profile-Name:\s*(.+)\s*$/ and $profile->{name} = $1;
  64. /^Target-Profile-Packages:\s*(.*)\s*$/ and $profile->{packages} = [ split(/\s+/, $1) ];
  65. /^Target-Profile-Description:\s*(.*)\s*/ and $profile->{desc} = get_multiline(*FILE);
  66. /^Target-Profile-Config:/ and $profile->{config} = get_multiline(*FILE, "\t");
  67. /^Target-Profile-Kconfig:/ and $profile->{kconfig} = 1;
  68. }
  69. close FILE;
  70. foreach my $target (@target) {
  71. next if @{$target->{subtargets}} > 0;
  72. @{$target->{profiles}} > 0 or $target->{profiles} = [
  73. {
  74. id => 'Default',
  75. name => 'Default',
  76. packages => []
  77. }
  78. ];
  79. }
  80. return @target;
  81. }
  82. sub gen_kconfig_overrides() {
  83. my %config;
  84. my %kconfig;
  85. my $package;
  86. my $pkginfo = shift @ARGV;
  87. my $cfgfile = shift @ARGV;
  88. # parameter 2: build system config
  89. open FILE, "<$cfgfile" or return;
  90. while (<FILE>) {
  91. /^(CONFIG_.+?)=(.+)$/ and $config{$1} = 1;
  92. }
  93. close FILE;
  94. # parameter 1: package metadata
  95. open FILE, "<$pkginfo" or return;
  96. while (<FILE>) {
  97. /^Package:\s*(.+?)\s*$/ and $package = $1;
  98. /^Kernel-Config:\s*(.+?)\s*$/ and do {
  99. my @config = split /\s+/, $1;
  100. foreach my $config (@config) {
  101. my $val = 'm';
  102. my $override;
  103. if ($config =~ /^(.+?)=(.+)$/) {
  104. $config = $1;
  105. $override = 1;
  106. $val = $2;
  107. }
  108. if ($config{"CONFIG_PACKAGE_$package"} and ($config ne 'n')) {
  109. $kconfig{$config} = $val;
  110. } elsif (!$override) {
  111. $kconfig{$config} or $kconfig{$config} = 'n';
  112. }
  113. }
  114. };
  115. };
  116. close FILE;
  117. foreach my $kconfig (sort keys %kconfig) {
  118. if ($kconfig{$kconfig} eq 'n') {
  119. print "# $kconfig is not set\n";
  120. } else {
  121. print "$kconfig=$kconfig{$kconfig}\n";
  122. }
  123. }
  124. }
  125. sub merge_package_lists($$) {
  126. my $list1 = shift;
  127. my $list2 = shift;
  128. my @l = ();
  129. my %pkgs;
  130. foreach my $pkg (@$list1, @$list2) {
  131. $pkgs{$pkg} = 1;
  132. }
  133. foreach my $pkg (keys %pkgs) {
  134. push @l, $pkg unless ($pkg =~ /^-/ or $pkgs{"-$pkg"});
  135. }
  136. return sort(@l);
  137. }
  138. sub target_config_features(@) {
  139. my $ret;
  140. while ($_ = shift @_) {
  141. /broken/ and $ret .= "\tdepends BROKEN\n";
  142. /display/ and $ret .= "\tselect DISPLAY_SUPPORT\n";
  143. /gpio/ and $ret .= "\tselect GPIO_SUPPORT\n";
  144. /pci/ and $ret .= "\tselect PCI_SUPPORT\n";
  145. /usb/ and $ret .= "\tselect USB_SUPPORT\n";
  146. /pcmcia/ and $ret .= "\tselect PCMCIA_SUPPORT\n";
  147. /squashfs/ and $ret .= "\tselect USES_SQUASHFS\n";
  148. /jffs2/ and $ret .= "\tselect USES_JFFS2\n";
  149. /ext2/ and $ret .= "\tselect USES_EXT2\n";
  150. /tgz/ and $ret .= "\tselect USES_TGZ\n";
  151. /cpiogz/ and $ret .= "\tselect USES_CPIOGZ\n";
  152. /fpu/ and $ret .= "\tselect HAS_FPU\n";
  153. }
  154. return $ret;
  155. }
  156. sub target_name($) {
  157. my $target = shift;
  158. my $parent = $target->{parent};
  159. if ($parent) {
  160. return $target->{parent}->{name}." - ".$target->{name};
  161. } else {
  162. return $target->{name};
  163. }
  164. }
  165. sub kver($) {
  166. my $v = shift;
  167. $v =~ tr/\./_/;
  168. $v =~ /(\d+_\d+_\d+)(_\d+)?/ and $v = $1;
  169. return $v;
  170. }
  171. sub print_target($) {
  172. my $target = shift;
  173. my $features = target_config_features(@{$target->{features}});
  174. my $help = $target->{desc};
  175. my $kernel = $target->{kernel};
  176. my $confstr;
  177. $kernel =~ tr/./_/;
  178. chomp $features;
  179. $features .= "\n";
  180. if ($help =~ /\w+/) {
  181. $help =~ s/^\s*/\t /mg;
  182. $help = "\thelp\n$help";
  183. } else {
  184. undef $help;
  185. }
  186. my $v = kver($target->{version});
  187. $confstr = <<EOF;
  188. config TARGET_$target->{conf}
  189. bool "$target->{name}"
  190. select LINUX_$kernel
  191. select LINUX_$v
  192. EOF
  193. if ($target->{subtarget}) {
  194. $confstr .= "\tdepends TARGET_$target->{boardconf}\n";
  195. }
  196. if (@{$target->{subtargets}} > 0) {
  197. $confstr .= "\tselect HAS_SUBTARGETS\n";
  198. } else {
  199. $confstr .= "\tselect $target->{arch}\n";
  200. foreach my $dep (@{$target->{depends}}) {
  201. my $mode = "depends";
  202. my $flags;
  203. my $name;
  204. $dep =~ /^([@\+\-]+)(.+)$/;
  205. $flags = $1;
  206. $name = $2;
  207. next if $name =~ /:/;
  208. $flags =~ /-/ and $mode = "deselect";
  209. $flags =~ /\+/ and $mode = "select";
  210. $flags =~ /@/ and $confstr .= "\t$mode $name\n";
  211. }
  212. $confstr .= $features;
  213. }
  214. $confstr .= "$help\n\n";
  215. print $confstr;
  216. }
  217. sub gen_target_config() {
  218. my @target = parse_target_metadata();
  219. my %defaults;
  220. my @target_sort = sort {
  221. target_name($a) cmp target_name($b);
  222. } @target;
  223. print <<EOF;
  224. choice
  225. prompt "Target System"
  226. default TARGET_brcm_2_4
  227. reset if !DEVEL
  228. EOF
  229. foreach my $target (@target_sort) {
  230. next if $target->{subtarget};
  231. print_target($target);
  232. }
  233. print <<EOF;
  234. endchoice
  235. choice
  236. prompt "Subtarget" if HAS_SUBTARGETS
  237. EOF
  238. foreach my $target (@target) {
  239. next unless $target->{subtarget};
  240. print_target($target);
  241. }
  242. print <<EOF;
  243. endchoice
  244. choice
  245. prompt "Target Profile"
  246. EOF
  247. foreach my $target (@target) {
  248. my $profiles = $target->{profiles};
  249. foreach my $profile (@$profiles) {
  250. print <<EOF;
  251. config TARGET_$target->{conf}_$profile->{id}
  252. bool "$profile->{name}"
  253. depends TARGET_$target->{conf}
  254. $profile->{config}
  255. EOF
  256. $profile->{kconfig} and print "\tselect PROFILE_KCONFIG\n";
  257. my @pkglist = merge_package_lists($target->{packages}, $profile->{packages});
  258. foreach my $pkg (@pkglist) {
  259. print "\tselect DEFAULT_$pkg\n";
  260. $defaults{$pkg} = 1;
  261. }
  262. print "\n";
  263. }
  264. }
  265. print <<EOF;
  266. endchoice
  267. config HAS_SUBTARGETS
  268. bool
  269. config TARGET_BOARD
  270. string
  271. EOF
  272. foreach my $target (@target) {
  273. $target->{subtarget} or print "\t\tdefault \"".$target->{board}."\" if TARGET_".$target->{conf}."\n";
  274. }
  275. my %kver;
  276. foreach my $target (@target) {
  277. my $v = kver($target->{version});
  278. next if $kver{$v};
  279. $kver{$v} = 1;
  280. print <<EOF;
  281. config LINUX_$v
  282. bool
  283. EOF
  284. }
  285. foreach my $def (sort keys %defaults) {
  286. print "\tconfig DEFAULT_".$def."\n";
  287. print "\t\tbool\n\n";
  288. }
  289. }
  290. my %dep_check;
  291. sub __find_package_dep($$) {
  292. my $pkg = shift;
  293. my $name = shift;
  294. my $deps = ($pkg->{vdepends} or $pkg->{depends});
  295. return 0 unless defined $deps;
  296. foreach my $dep (@{$deps}) {
  297. next if $dep_check{$dep};
  298. $dep_check{$dep} = 1;
  299. return 1 if $dep eq $name;
  300. return 1 if ($package{$dep} and (__find_package_dep($package{$dep},$name) == 1));
  301. }
  302. return 0;
  303. }
  304. # wrapper to avoid infinite recursion
  305. sub find_package_dep($$) {
  306. my $pkg = shift;
  307. my $name = shift;
  308. %dep_check = ();
  309. return __find_package_dep($pkg, $name);
  310. }
  311. sub package_depends($$) {
  312. my $a = shift;
  313. my $b = shift;
  314. my $ret;
  315. return 0 if ($a->{submenu} ne $b->{submenu});
  316. if (find_package_dep($a, $b->{name}) == 1) {
  317. $ret = 1;
  318. } elsif (find_package_dep($b, $a->{name}) == 1) {
  319. $ret = -1;
  320. } else {
  321. return 0;
  322. }
  323. return $ret;
  324. }
  325. sub mconf_depends {
  326. my $pkgname = shift;
  327. my $depends = shift;
  328. my $only_dep = shift;
  329. my $res;
  330. my $dep = shift;
  331. my $seen = shift;
  332. my $condition = shift;
  333. $dep or $dep = {};
  334. $seen or $seen = {};
  335. $depends or return;
  336. my @depends = @$depends;
  337. foreach my $depend (@depends) {
  338. my $m = "depends";
  339. $depend =~ s/^([@\+]+)//;
  340. my $flags = $1;
  341. my $vdep;
  342. if ($depend =~ /^(.+):(.+)$/) {
  343. if ($1 ne "PACKAGE_$pkgname") {
  344. if ($condition) {
  345. $condition = "$condition && $1";
  346. } else {
  347. $condition = $1;
  348. }
  349. }
  350. $depend = $2;
  351. }
  352. next if $seen->{$depend};
  353. next if $package{$depend} and $package{$depend}->{buildonly};
  354. $seen->{$depend} = 1;
  355. if ($vdep = $package{$depend}->{vdepends}) {
  356. $depend = join("||", map { "PACKAGE_".$_ } @$vdep);
  357. } else {
  358. $flags =~ /\+/ and do {
  359. # Menuconfig will not treat 'select FOO' as a real dependency
  360. # thus if FOO depends on other config options, these dependencies
  361. # will not be checked. To fix this, we simply emit all of FOO's
  362. # depends here as well.
  363. $package{$depend} and mconf_depends($pkgname, $package{$depend}->{depends}, 1, $dep, $seen, $condition);
  364. $m = "select";
  365. next if $only_dep;
  366. };
  367. $flags =~ /@/ or $depend = "PACKAGE_$depend";
  368. if ($condition) {
  369. if ($m =~ /select/) {
  370. $depend = "$depend if $condition";
  371. } else {
  372. $depend = "!($condition) || $depend";
  373. }
  374. }
  375. }
  376. $dep->{$depend} =~ /select/ or $dep->{$depend} = $m;
  377. }
  378. foreach my $depend (keys %$dep) {
  379. my $m = $dep->{$depend};
  380. $res .= "\t\t$m $depend\n";
  381. }
  382. return $res;
  383. }
  384. sub print_package_config_category($) {
  385. my $cat = shift;
  386. my %menus;
  387. my %menu_dep;
  388. return unless $category{$cat};
  389. print "menu \"$cat\"\n\n";
  390. my %spkg = %{$category{$cat}};
  391. foreach my $spkg (sort {uc($a) cmp uc($b)} keys %spkg) {
  392. foreach my $pkg (@{$spkg{$spkg}}) {
  393. next if $pkg->{buildonly};
  394. my $menu = $pkg->{submenu};
  395. if ($menu) {
  396. $menu_dep{$menu} or $menu_dep{$menu} = $pkg->{submenudep};
  397. } else {
  398. $menu = 'undef';
  399. }
  400. $menus{$menu} or $menus{$menu} = [];
  401. push @{$menus{$menu}}, $pkg;
  402. }
  403. }
  404. my @menus = sort {
  405. ($a eq 'undef' ? 1 : 0) or
  406. ($b eq 'undef' ? -1 : 0) or
  407. ($a cmp $b)
  408. } keys %menus;
  409. foreach my $menu (@menus) {
  410. my @pkgs = sort {
  411. package_depends($a, $b) or
  412. ($a->{name} cmp $b->{name})
  413. } @{$menus{$menu}};
  414. if ($menu ne 'undef') {
  415. $menu_dep{$menu} and print "if $menu_dep{$menu}\n";
  416. print "menu \"$menu\"\n";
  417. }
  418. foreach my $pkg (@pkgs) {
  419. my $title = $pkg->{name};
  420. my $c = (72 - length($pkg->{name}) - length($pkg->{title}));
  421. if ($c > 0) {
  422. $title .= ("." x $c). " ". $pkg->{title};
  423. }
  424. print "\t";
  425. $pkg->{menu} and print "menu";
  426. print "config PACKAGE_".$pkg->{name}."\n";
  427. print "\t\t".($pkg->{tristate} ? 'tristate' : 'bool')." \"$title\"\n";
  428. print "\t\tdefault y if DEFAULT_".$pkg->{name}."\n";
  429. foreach my $default (split /\s*,\s*/, $pkg->{default}) {
  430. print "\t\tdefault $default\n";
  431. }
  432. print mconf_depends($pkg->{name}, $pkg->{depends}, 0);
  433. print "\t\thelp\n";
  434. print $pkg->{description};
  435. print "\n";
  436. $pkg->{config} and print $pkg->{config}."\n";
  437. }
  438. if ($menu ne 'undef') {
  439. print "endmenu\n";
  440. $menu_dep{$menu} and print "endif\n";
  441. }
  442. }
  443. print "endmenu\n\n";
  444. undef $category{$cat};
  445. }
  446. sub gen_package_config() {
  447. parse_package_metadata($ARGV[0]) or exit 1;
  448. print "menuconfig UCI_PRECONFIG\n\tbool \"Image configuration\"\n" if %preconfig;
  449. foreach my $preconfig (keys %preconfig) {
  450. foreach my $cfg (keys %{$preconfig{$preconfig}}) {
  451. my $conf = $preconfig{$preconfig}->{$cfg}->{id};
  452. $conf =~ tr/\.-/__/;
  453. print <<EOF
  454. config UCI_PRECONFIG_$conf
  455. string "$preconfig{$preconfig}->{$cfg}->{label}" if UCI_PRECONFIG
  456. depends PACKAGE_$preconfig
  457. default "$preconfig{$preconfig}->{$cfg}->{default}"
  458. EOF
  459. }
  460. }
  461. print_package_config_category 'Base system';
  462. foreach my $cat (keys %category) {
  463. print_package_config_category $cat;
  464. }
  465. }
  466. sub gen_package_mk() {
  467. my %conf;
  468. my %dep;
  469. my %done;
  470. my $line;
  471. parse_package_metadata($ARGV[0]) or exit 1;
  472. foreach my $name (sort {uc($a) cmp uc($b)} keys %package) {
  473. my $config;
  474. my $pkg = $package{$name};
  475. my @srcdeps;
  476. next if defined $pkg->{vdepends};
  477. if ($ENV{SDK}) {
  478. $conf{$pkg->{src}} or do {
  479. $config = 'm';
  480. $conf{$pkg->{src}} = 1;
  481. };
  482. } else {
  483. $config = "\$(CONFIG_PACKAGE_$name)"
  484. }
  485. if ($config) {
  486. $pkg->{buildonly} and $config = "";
  487. print "package-$config += $pkg->{subdir}$pkg->{src}\n";
  488. $pkg->{prereq} and print "prereq-$config += $pkg->{subdir}$pkg->{src}\n";
  489. }
  490. next if $done{$pkg->{src}};
  491. $done{$pkg->{src}} = 1;
  492. foreach my $spkg (@{$srcpackage{$pkg->{src}}}) {
  493. foreach my $dep (@{$spkg->{depends}}, @{$spkg->{builddepends}}) {
  494. $dep =~ /@/ or do {
  495. $dep =~ s/\+//g;
  496. push @srcdeps, $dep;
  497. };
  498. }
  499. }
  500. my $hasdeps = 0;
  501. my %deplines;
  502. foreach my $deps (@srcdeps) {
  503. my $idx;
  504. my $condition;
  505. if ($deps =~ /^(.+):(.+)/) {
  506. $condition = $1;
  507. $deps = $2;
  508. }
  509. my $pkg_dep = $package{$deps};
  510. my @deps;
  511. if ($pkg_dep->{vdepends}) {
  512. @deps = @{$pkg_dep->{vdepends}};
  513. } else {
  514. @deps = ($deps);
  515. }
  516. foreach my $dep (@deps) {
  517. $pkg_dep = $package{$deps};
  518. if (defined $pkg_dep->{src}) {
  519. ($pkg->{src} ne $pkg_dep->{src}) and $idx = $pkg_dep->{subdir}.$pkg_dep->{src};
  520. } elsif (defined($srcpackage{$dep})) {
  521. $idx = $subdir{$dep}.$dep;
  522. }
  523. undef $idx if $idx =~ /^(kernel)|(base-files)$/;
  524. if ($idx) {
  525. my $depline;
  526. next if $pkg->{src} eq $pkg_dep->{src};
  527. next if $dep{$pkg->{src}."->".$idx};
  528. next if $dep{$pkg->{src}."->($dep)".$idx} and $pkg_dep->{vdepends};
  529. my $depstr;
  530. if ($pkg_dep->{vdepends}) {
  531. $depstr = "\$(if \$(CONFIG_PACKAGE_$dep),\$(curdir)/$idx/compile)";
  532. $dep{$pkg->{src}."->($dep)".$idx} = 1;
  533. } else {
  534. $depstr = "\$(curdir)/$idx/compile";
  535. $dep{$pkg->{src}."->".$idx} = 1;
  536. }
  537. if ($condition) {
  538. if ($condition =~ /^!(.+)/) {
  539. $depline = "\$(if \$(CONFIG_$1),,$depstr)";
  540. } else {
  541. $depline = "\$(if \$(CONFIG_$condition),$depstr)";
  542. }
  543. } else {
  544. $depline = $depstr;
  545. }
  546. if ($depline) {
  547. $deplines{$idx.$dep} = $depline;
  548. }
  549. }
  550. }
  551. }
  552. my $depline = join(" ", values %deplines);
  553. if ($depline) {
  554. $line .= "\$(curdir)/".$pkg->{subdir}."$pkg->{src}/compile += $depline\n";
  555. }
  556. }
  557. if ($line ne "") {
  558. print "\n$line";
  559. }
  560. foreach my $preconfig (keys %preconfig) {
  561. my $cmds;
  562. foreach my $cfg (keys %{$preconfig{$preconfig}}) {
  563. my $conf = $preconfig{$preconfig}->{$cfg}->{id};
  564. $conf =~ tr/\.-/__/;
  565. $cmds .= "\techo \"uci set '$preconfig{$preconfig}->{$cfg}->{id}=\$(subst \",,\$(CONFIG_UCI_PRECONFIG_$conf))'\"; \\\n";
  566. }
  567. next unless $cmds;
  568. print <<EOF
  569. \$(TARGET_DIR)/etc/uci-defaults/$preconfig: FORCE
  570. ( \\
  571. $cmds \\
  572. ) > \$@
  573. ifneq (\$(UCI_PRECONFIG)\$(CONFIG_UCI_PRECONFIG),)
  574. package/preconfig: \$(TARGET_DIR)/etc/uci-defaults/$preconfig
  575. endif
  576. EOF
  577. }
  578. }
  579. sub parse_command() {
  580. my $cmd = shift @ARGV;
  581. for ($cmd) {
  582. /^target_config$/ and return gen_target_config();
  583. /^package_mk$/ and return gen_package_mk();
  584. /^package_config$/ and return gen_package_config();
  585. /^kconfig/ and return gen_kconfig_overrides();
  586. }
  587. print <<EOF
  588. Available Commands:
  589. $0 target_config [file] Target metadata in Kconfig format
  590. $0 package_mk [file] Package metadata in makefile format
  591. $0 package_config [file] Package metadata in Kconfig format
  592. $0 kconfig [file] [config] Kernel config overrides
  593. EOF
  594. }
  595. parse_command();