]> Chaos Git - corbenik/corbenik.git/commitdiff
Some final cleanups
authorchaoskagami <chaos.kagami@gmail.com>
Tue, 19 Jul 2016 12:06:04 +0000 (08:06 -0400)
committerchaoskagami <chaos.kagami@gmail.com>
Tue, 19 Jul 2016 12:06:04 +0000 (08:06 -0400)
configure.ac
include/config.h.in
source/chain.c
source/menu.c
source/option.c

index 5af4adcef0cbb02bcce4a457dbb9cca3b4c61825..ebc74c0e2d0439df4990ce28de12d88f5e7a2f81 100644 (file)
@@ -19,13 +19,13 @@ AC_ARG_ENABLE([chainloader],
 
 AC_PREFIX_DEFAULT([/corbenik])
 
-if ! "$enable_chainloader" == "no" ; then
-       CHAINLOADER=1
+if "x$enable_chainloader" == "xyes" ; then
+       CHAINLOADER="1"
 else
-       CHAINLOADER=0
+       CHAINLOADER="0"
 fi
 
-AC_DEFINE([CHAINLOADER], [$CHAINLOADER])
+AC_DEFINE_UNQUOTED([CHAINLOADER], [$CHAINLOADER])
 
 AC_CONFIG_FILES([Makefile source/Makefile external/Makefile include/Makefile])
 
index 15cd6adf02c50b03cd3c8ce3038c513ef1731b14..891d728663a22413cb72f5e7938645574a30c6b5 100644 (file)
@@ -1,6 +1,3 @@
-/* use chainloader code */
-#define CHAINLOADER %CHAINLOADER%
-
 /* CFW data dirs */
 #define PREFIX        "%PREFIX%"
 
@@ -18,5 +15,5 @@
 #define PACKAGE "%PACKAGE%"
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "%VERSION%"
+#define PACKAGE_VERSION "%PACKAGE_VERSION%"
 
index 3fb99a0cf0deeefebd372024fecb525dafdce05b..e0079194d6bf33e3b1dc2854afbca1ac206553f4 100644 (file)
@@ -1,5 +1,5 @@
 #include <corbconf.h>
-#ifdef CHAINLOADER
+#if defined(CHAINLOADER) && CHAINLOADER == 1
 
 #include <common.h>
 #include <screeninit.h>
index a140bd89ff578bbd8c27080614d83ca870d39517..d06b09cbbeb781c9ca46f92ab07260db56d40ab6 100644 (file)
@@ -47,7 +47,7 @@ static struct options_s options[] = {
 
     { OPTION_TRACE, "Step Through", "After each important step, [WAIT] will be shown and you'll need to press a key. Debug feature.", boolean_val, 0, 0 },
     { OPTION_OVERLY_VERBOSE, "Verbose", "Output more debug information than the average user needs.", boolean_val, 0, 0 },
-    { OPTION_SAVE_LOGS, "Logging", "Save logs to `" PATH_CFW "` as `boot.log` and `loader.log`. Slows operation a bit.", boolean_val, 0, 0 },
+    { OPTION_SAVE_LOGS, "Logging", "Save logs to `" LOCALSTATEDIR "` as `boot.log` and `loader.log`. Slows operation a bit.", boolean_val, 0, 0 },
 
     //    { OPTION_ARM9THREAD,        "ARM9 Thread", boolean_val, 0, 0 },
     //    { IGNORE_PATCH_DEPS,   "Ignore dependencies", boolean_val, 0, 0 },
@@ -276,7 +276,7 @@ poweroff()
     ctr_system_poweroff();
 }
 
-#ifdef CHAINLOADER
+#if defined(CHAINLOADER) && CHAINLOADER == 1
 void chainload_menu();
 #endif
 
@@ -288,7 +288,7 @@ 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.\nYou must do this prior to booting,\notherwise the cache will not be (re)generated..", call_fun, (uint32_t)save_config,  0 },
-#ifdef CHAINLOADER
+#if defined(CHAINLOADER) && CHAINLOADER == 1
     { 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.\nMake sure to 'Save Configuration' first if any options changed.", break_menu, 0, 0 },
index f0660936be591fd752b318a206e28ca3116bfbb3..d1c0e29cd5204a961a27183603cade22a86b5694 100644 (file)
@@ -26,18 +26,26 @@ regenerate_config()
 void
 mk_structure()
 {
-    f_mkdir(PATH_CFW);
-    f_mkdir(PATH_CONFIG_DIR);
-    f_mkdir(PATH_PATCHES);
-    f_mkdir(PATH_FIRMWARES);
-    f_mkdir(PATH_MODULES);
-    f_mkdir(PATH_KEYS);
-    f_mkdir(PATH_EXEFS);
-    f_mkdir(PATH_EXEFS_TEXT);
-    f_mkdir(PATH_EXEFS_DATA);
-    f_mkdir(PATH_EXEFS_RO);
-    f_mkdir(PATH_TEMP);
-    f_mkdir(PATH_LOADER_CACHE);
+    f_mkdir(ROOT);
+    f_mkdir(DATA);
+      f_mkdir(LIBEXECDIR);
+      f_mkdir(LIBDIR);
+        f_mkdir(PATH_EXEFS);
+          f_mkdir(PATH_EXEFS_TEXT);
+          f_mkdir(PATH_EXEFS_DATA);
+          f_mkdir(PATH_EXEFS_RO);
+        f_mkdir(PATH_FIRMWARES);
+        f_mkdir(PATH_MODULES);
+      f_mkdir(BINDIR);
+      f_mkdir(SBINDIR);
+      f_mkdir(SYSCONFDIR);
+      f_mkdir(LOCALSTATEDIR);
+        f_mkdir(PATH_TEMP);
+          f_mkdir(PATH_LOADER_CACHE);
+      f_mkdir(SHAREDIR);
+        f_mkdir(PATH_KEYS);
+        f_mkdir(LOCALEDIR);
+          f_mkdir(PATH_LOCEMU);
 }
 
 void