build 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/usr/bin/perl
  2. # build is part of qorgboot.
  3. # qorgboot is free software: you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation, either version 3 of the License, or
  6. # (at your option) any later version.
  7. # qorgboot is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. # GNU General Public License for more details.
  11. # You should have received a copy of the GNU General Public License
  12. # along with qorgboot. If not, see <https://www.gnu.org/licenses/>.
  13. # TODO: Build coreboot and ncurses config etc
  14. my @SupportedBoards = ('T400');
  15. sub help() {
  16. print ("$0 -- build qorgboot\n");
  17. print ("$0 ich9gen -- Build ich9gen");
  18. }
  19. print ("Checking for coreboot...\n");
  20. if (-e "srcs/coreboot") {
  21. print("Coreboot exists)\n\n");
  22. }
  23. else {
  24. print("Downldad coreboot\n");
  25. exit;
  26. }
  27. print "Checking for flashrom...\n";
  28. if (-e "srcs/coreboot") {
  29. print ("Flashrom exists\n\n");
  30. }
  31. else {
  32. print("Download flashrom\n");
  33. exit;
  34. }
  35. if(not defined $ARGV[0]) {
  36. print ("Missing board\n");
  37. exit;
  38. }
  39. print ("Everything's okay\n");
  40. print ("Bulding for $ARGV[0]\n");
  41. my $HBoards = map {$_ => 1} @SupportedBoards;
  42. if($ARGV[0] ~~ @SupportedBoards) {
  43. print ("Supported Board: $ARGV[0]\n");
  44. }
  45. else {
  46. print ("Unsupported board: $ARGV[0]\n");
  47. }
  48. print ("Copying configs/$ARGV[0]g to coreboot...\n");
  49. system("cp configs/$ARGV[0]g srcs/coreboot/.config");
  50. print ("Copied\n");
  51. print ("Press enter to make\n");
  52. <STDIN>;
  53. print ("Copying bootsplash image");
  54. system("cp -v img/bootsplash.jpg srcs/coreboot");
  55. print ("Bulding crossgcc\n\n");
  56. system("cd srcs/coreboot && git submodule update --init --checkout && make crossgcc-i386");
  57. print ("Building coreboot");
  58. system("cd srcs/coreboot && make");