From: chaoskagami Date: Tue, 19 Jul 2016 12:06:04 +0000 (-0400) Subject: Some final cleanups X-Git-Tag: v0.2.0~8^2~4 X-Git-Url: https://chaos.moe/g/?a=commitdiff_plain;h=bf6f4043220785312df5e279f77def974e3a2f09;p=corbenik%2Fcorbenik.git Some final cleanups --- diff --git a/configure.ac b/configure.ac index 5af4adc..ebc74c0 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) diff --git a/include/config.h.in b/include/config.h.in index 15cd6ad..891d728 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -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%" diff --git a/source/chain.c b/source/chain.c index 3fb99a0..e007919 100644 --- a/source/chain.c +++ b/source/chain.c @@ -1,5 +1,5 @@ #include -#ifdef CHAINLOADER +#if defined(CHAINLOADER) && CHAINLOADER == 1 #include #include diff --git a/source/menu.c b/source/menu.c index a140bd8..d06b09c 100644 --- a/source/menu.c +++ b/source/menu.c @@ -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 }, diff --git a/source/option.c b/source/option.c index f066093..d1c0e29 100644 --- a/source/option.c +++ b/source/option.c @@ -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