build.ck 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*++
  2. Copyright (c) 2013 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. Images
  5. Abstract:
  6. This module builds the final OS images.
  7. Author:
  8. Evan Green 26-Oct-2015
  9. Environment:
  10. Build
  11. --*/
  12. function build_image(name, msetup_flags) {
  13. install_deps = [
  14. "//apps:all_apps",
  15. "//apps/posix:skel",
  16. "//kernel:kernel",
  17. "//kernel:devmap.set",
  18. "//kernel:dev2drv.set",
  19. "//kernel:init.set",
  20. "//kernel:init.sh",
  21. "//boot:boot_apps",
  22. "//debug:debug",
  23. "//drivers:drivers",
  24. "//uefi:platfw",
  25. "//tzcomp:tz_files",
  26. "//apps/setup:build_msetup"
  27. ];
  28. entry = {
  29. "type": "target",
  30. "tool": "msetup_image",
  31. "label": name,
  32. "output": binroot + "/" + name,
  33. "implicit": install_deps,
  34. "config": {"MSETUP_FLAGS": msetup_flags}
  35. };
  36. if (name != "install.img") {
  37. entry["inputs"] = [":install.img"];
  38. }
  39. return [entry];
  40. }
  41. function build() {
  42. image_size = "-G512M";
  43. tiny_image_size = "-G30M";
  44. common_image_flags = [
  45. "-q"
  46. ];
  47. if (debug == "dbg") {
  48. common_image_flags += ["-D"];
  49. }
  50. install_flags = common_image_flags + [
  51. "-linstall-" + arch,
  52. "-i$" + outroot,
  53. image_size,
  54. ];
  55. common_image_flags += [
  56. "-i$" + binroot + "/install.img"
  57. ];
  58. entries = build_image("install.img", install_flags);
  59. if (arch == "x86") {
  60. if (variant == "q") {
  61. flags = common_image_flags + [
  62. "-lgalileo",
  63. image_size
  64. ];
  65. entries += build_image("galileo.img", flags);
  66. } else {
  67. flags = common_image_flags + [
  68. "-lpc",
  69. image_size
  70. ];
  71. entries += build_image("pc.img", flags);
  72. flags = common_image_flags + [
  73. "-lpcefi",
  74. image_size
  75. ];
  76. entries += build_image("pcefi.img", flags);
  77. flags = common_image_flags + [
  78. "-lpc-tiny",
  79. tiny_image_size
  80. ];
  81. entries += build_image("pctiny.img", flags);
  82. }
  83. } else if (arch == "armv7") {
  84. flags = common_image_flags + [image_size];
  85. entries += build_image("bbone.img", flags + ["-lbeagleboneblack"]);
  86. entries += build_image("panda.img", flags + ["-lpanda"]);
  87. entries += build_image("rpi2.img", flags + ["-lraspberrypi2"]);
  88. entries += build_image("veyron.img", flags + ["-lveyron"]);
  89. ramdisk_images = [
  90. "//uefi/plat/integcp:integ.img",
  91. "//uefi/plat/panda:pandausb.img"
  92. ];
  93. entries += group("ramdisk_images", ramdisk_images);
  94. } else if (arch == "armv6") {
  95. flags = common_image_flags + [
  96. image_size,
  97. "-lraspberrypi"
  98. ];
  99. entries += build_image("rpi.img", flags + ["-lraspberrypi"]);
  100. }
  101. return entries;
  102. }
  103. return build();