]> Chaos Git - corbenik/corbenik.git/commitdiff
Make the chainloader optional (set during build)
authorchaoskagami <chaos.kagami@gmail.com>
Mon, 20 Jun 2016 23:25:36 +0000 (19:25 -0400)
committerchaoskagami <chaos.kagami@gmail.com>
Mon, 20 Jun 2016 23:25:36 +0000 (19:25 -0400)
Makefile
source/chain.c
source/menu.c

index 0d23ef86ac847e0157e163c351f5660dcc131b10..1d09b587dbd4cc300e7f18056d04d5952c0b4ac0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -26,8 +26,10 @@ dir_out    := out
 REVISION := $(shell git rev-parse HEAD | head -c10)+$(shell git rev-list --count HEAD)
 REL ?= master
 
+EXTRA ?= -DCHAINLOADER=1
+
 CROSS_ASFLAGS := -mlittle-endian -mcpu=arm946e-s -march=armv5te
-CROSS_CFLAGS  := -MMD -MP -Wall -Wextra -Werror -fomit-frame-pointer -Os $(ASFLAGS) -fshort-wchar -fno-builtin -std=gnu11 -DVERSION=\"$(REVISION)\" -DREL=\"$(REL)\"
+CROSS_CFLAGS  := -MMD -MP -Wall -Wextra -Werror -fomit-frame-pointer -Os $(ASFLAGS) -fshort-wchar -fno-builtin -std=gnu11 -DVERSION=\"$(REVISION)\" -DREL=\"$(REL)\" $(EXTRA)
 CROSS_FLAGS   := dir_out=$(abspath $(dir_out)) --no-print-directory
 CROSS_LDFLAGS := -nostdlib -Wl,-z,defs -lgcc -Wl,-Map,$(dir_build)/link.map
 
index 89f58aac28217a3dd8517012e7134651a5a92232..a80987fc369c3bfa4f96ea9b4c13885283917bff 100644 (file)
@@ -1,3 +1,5 @@
+#ifdef CHAINLOADER
+
 #include "common.h"
 #include "firm/firm.h"
 #include "firm/headers.h"
@@ -135,3 +137,5 @@ void chainload_menu() {
 
     show_menu(chains, NULL);
 }
+
+#endif
index e67725db4adae5c4a032ed19c02274988c69af6e..dc4ef24c93ed73db86a284105754fdb7f036c7ef 100644 (file)
@@ -300,7 +300,9 @@ poweroff()
         ;
 }
 
+#ifdef CHAINLOADER
 void chainload_menu();
+#endif
 
 static struct options_s main_s[] = {
     { 0, "Options",            "Internal options for the CFW. These are part of Corbenik itself.", call_fun, (uint32_t)menu_options, 0 },
@@ -310,7 +312,9 @@ static struct options_s main_s[] = {
     { 0, "Reboot",             "Reboots the console.", call_fun, (uint32_t)reset,        0 },
     { 0, "Power off",          "Powers off the console.", call_fun, (uint32_t)poweroff,     0 },
     { 0, "Save Configuration", "Save the configuration. You must do this prior to booting, otherwise nothing is done.", call_fun, (uint32_t)save_config,  0 },
+#ifdef CHAINLOADER
     { 0, "Chainload",          "Boot another ARM9 payload file.", call_fun, (uint32_t)chainload_menu, 0 },
+#endif
     { 0, "Boot Firmware",      "Generates caches, patches the firmware, and boots it.", break_menu, 0, 0 },
 
     // Sentinel.