]> Chaos Git - corbenik/corbenik.git/commitdiff
Multiple.
authorchaoskagami <chaos.kagami@gmail.com>
Wed, 20 Jul 2016 13:19:47 +0000 (09:19 -0400)
committerchaoskagami <chaos.kagami@gmail.com>
Sat, 23 Jul 2016 12:36:39 +0000 (08:36 -0400)
 * Lazy firmware downloader scripts, because that's just how I am
 * Fixups in README
 * Path fixups

Makefile.am
README.md
configure.ac
host/copy.sh
include/patch_format.h
source/main.c
source/option.c

index e8b7e9477df8c4bebe39e49fcca06998fe4b6831..2243afc003b5222062eaed0eceb2b16b26b5575d 100644 (file)
@@ -7,20 +7,36 @@ install:
 
 all-local:
        mkdir -p out
-       mkdir -p out/@prefix@
-       mkdir -p out/@libdir@/{module,firmware}
-       mkdir -p out/@datarootdir@/{keys,locale/emu}
-       mkdir -p out/@bindir@
-       mkdir -p out/@sbindir@
-       mkdir -p out/@prefix@/boot
-       mkdir -p out/@libexecdir@
-       mkdir -p out/@sysconfdir@
-       mkdir -p out/@localstatedir@
+       mkdir -p out@prefix@
+       mkdir -p out@libdir@/{module,firmware}
+       mkdir -p out@datarootdir@/{keys,locale/emu}
+       mkdir -p out@bindir@
+       mkdir -p out@sbindir@
+       mkdir -p out@prefix@/boot
+       mkdir -p out@libexecdir@
+       mkdir -p out@sysconfdir@
+       mkdir -p out@localstatedir@
        cp source/corbenik.bin out/arm9loaderhax.bin
-       cp source/corbenik.bin out/@prefix@/boot/
-       cp external/loader/loader.cxi out/@libdir@/module/loader.cxi
-       cp external/bits/*.bin out/@libexecdir@/
-       cp external/screeninit/build/screeninit.bin out/@libexecdir@/
-       cp host/termfont.bin out/@libexecdir@/
-       cp patch/*.vco out/@sbindir@
-       cp contrib/*.vco out/@bindir@
+       cp source/corbenik.bin out@prefix@/boot/
+       cp external/loader/loader.cxi out@libdir@/module/loader.cxi
+       cp external/bits/*.bin out@libexecdir@/
+       cp external/screeninit/build/screeninit.bin out@libexecdir@/
+       cp host/termfont.bin out@sharedir@/
+       cp patch/*.vco out@sbindir@
+       cp contrib/*.vco out@bindir@
+       echo "#!/bin/bash" > out/o3ds_firm.sh
+       echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013800000002/00000052 -O .@libdir@/firmware/native"       >> out/o3ds_firm.sh
+       echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013800000002/cetk     -O .@datarootdir@/keys/native.cetk" >> out/o3ds_firm.sh
+       echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013800000102/00000016 -O .@libdir@/firmware/twl"       >> out/o3ds_firm.sh
+       echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013800000102/cetk     -O .@datarootdir@/keys/twl.cetk" >> out/o3ds_firm.sh
+       echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013800000202/0000000B -O .@libdir@/firmware/agb"       >> out/o3ds_firm.sh
+       echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013800000202/cetk     -O .@datarootdir@/keys/agb.cetk" >> out/o3ds_firm.sh
+       echo "#!/bin/bash" > out/n3ds_firm.sh
+       echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000002/00000021 -O .@libdir@/firmware/native"       >> out/n3ds_firm.sh
+       echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000002/cetk     -O .@datarootdir@/keys/native.cetk" >> out/n3ds_firm.sh
+       echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000102/00000000 -O .@libdir@/firmware/twl"       >> out/n3ds_firm.sh
+       echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000102/cetk     -O .@datarootdir@/keys/twl.cetk" >> out/n3ds_firm.sh
+       echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000202/00000000 -O .@libdir@/firmware/agb"       >> out/n3ds_firm.sh
+       echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000202/cetk     -O .@datarootdir@/keys/agb.cetk" >> out/n3ds_firm.sh
+       chmod 755 out/*.sh
+       cp README.md LICENSE.txt out/
index 92cdca45405ae07162b85c20abe3646e88ce6e59..596f3d034f18ff4cb82189520603e7f9bc758bea 100644 (file)
--- a/README.md
+++ b/README.md
@@ -35,9 +35,9 @@ New 3DS (Native FIRM, 11.0):
  * firm: http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000002/00000021
  * cetk: http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000002/cetk
 
-Note that this is only a recommendation - you can supply near any valid firmware file for your console. You can also supply a decrypted native_firm titlekey as `/corbenik/share/keys/native.key`, although this is no longer required.
+Note that this is only a recommendation - you can supply near any valid firmware file for your console. You can also supply a decrypted native_firm titlekey as `/corbenik/share/keys/native.key`, although this is no longer required and it can be automatically retrieved from the cetk.
 
-You can also fetch the agb firm and twl firms to `/corbenik/lib/firmware/agb` and `/corbenik/lib/firmware/twl` respectively. If you don't have the firmkeys for these, you can fetch the cetk for each of them to `/corbenik/keys/agb.cetk` and `/corbenik/keys/twl.cetk`, or acquire decrypted titlekeys (firmkeys) for them.
+You can also fetch the agb firm and twl firms to `/corbenik/lib/firmware/agb` and `/corbenik/lib/firmware/twl` respectively. You can fetch the cetk for each of them to `/corbenik/share/keys/agb.cetk` and `/corbenik/share/keys/twl.cetk`, or acquire decrypted titlekeys (firmkeys) for them.
 
 Old 3DS TWL_FIRM (Firmware for DS/DSi games):
  * cetk: http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013800000102/cetk
@@ -55,11 +55,11 @@ New 3DS AGB_FIRM (Firmware for GBA games):
  * cetk: http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000202/cetk
  * firm: http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000202/00000000
 
-On New3DS units, there's additional encryption on arm9loader which requires the 9.6 key to decrypt. This key also happens to be trashed by arm9loaderhax, so you'll need to acquire it elsewhere. It usually is named as `Slot0x11Key96.bin`. I can't tell you where to find this. Corbenik will attempt to read this from the root as well as `/corbenik/keys/11key96.key`. In a future version, keydb reading may be implemented, but no guarantees.
+On New3DS units, there's additional encryption on arm9loader which requires the 9.6 key to decrypt. This key also happens to be trashed by arm9loaderhax, so you'll need to acquire it elsewhere. It usually is named as `Slot0x11Key96.bin`. I can't tell you where to find this. Corbenik will attempt to read this from the root as well as `/corbenik/share/keys/11key96.key`. In a future version, keydb reading may be implemented, but no guarantees.
 
 The folder `/corbenik/share/locale/emu` is automatically generated language emulation files from 3dsdb for games that only specify one region and one language. Games which support more than one language are not generated, because there's no 'correct' language. You can remove this if the number of files unnerves you. It isn't required. You can also add new files if you have specific needs.
 
-The folder `/corbenik/bin` contains additional patches you may add at your own discretion. These are not as well tested as official patches and don't generally affect core functionality. Documentation is usually found on the header of the source code for them (contrib/*.pco) in the git repo. Everything in `/corbenik/sbin` is core mostly-essential patches.
+The folder `/corbenik/bin` contains additional patches you may enable at your own discretion. These are not as well tested as official patches and don't generally affect core functionality. Documentation is usually found on the header of the source code for them (contrib/*.pco) in the git repo. Everything in `/corbenik/sbin` is core mostly-essential patches.
 
 Setup
 -------------------------
@@ -127,10 +127,10 @@ Customization
 -------------------------
 
 You can copy some 90° rotated BGR8 pixel data sized to the screen (essentially, a menuhax splash) and it will be used as backgrounds for menus. Put them at:
- * Top: `/corbenik/libexec/top.bin`
- * Bottom: `/corbenik/libexec/bottom.bin`
+ * Top: `/corbenik/share/top.bin`
+ * Bottom: `/corbenik/share/bottom.bin`
 
-The font is also customizable - read the github wiki for details.
+The font is also customizable (`/corbenik/share/termfont.bin`) - read the github wiki for details.
 
 Reporting issues
 -------------------------
@@ -138,7 +138,7 @@ Reporting issues
 If you think you've found a bug, please do the following first, to save me some time:
 
  * Check if a recently enabled patch is the cause of the issue. If so, you should include this in the report.
- * Enable `Logging` and `Verbose` in `Options` then `Save Configuration` and retrieve the files `/corbenik/boot.log` and `/corbenik/loader.log` if they exist. I will want them. Do not report bugs without them, unless they are not created with the above enabled.
+ * Enable `Logging` and `Verbose` in `Options` then `Save Configuration` and retrieve the files `/corbenik/var/log/boot.log` and `/corbenik/var/log/loader.log` if they exist. I will want them. Do not report bugs without them, unless they are not created with the above enabled.
  * Please at least try to reproduce the bug from a clean installation.
  * Try to reproduce the problem from another CFW like luma or cakes, optionally.
 
index ebc74c0e2d0439df4990ce28de12d88f5e7a2f81..64902a5a0be7e65ff8be1a9678f89ceed0b1661a 100644 (file)
@@ -19,11 +19,8 @@ AC_ARG_ENABLE([chainloader],
 
 AC_PREFIX_DEFAULT([/corbenik])
 
-if "x$enable_chainloader" == "xyes" ; then
-       CHAINLOADER="1"
-else
-       CHAINLOADER="0"
-fi
+CHAINLOADER=1
+test "$enable_chainloader" = "no" && CHAINLOADER=0
 
 AC_DEFINE_UNQUOTED([CHAINLOADER], [$CHAINLOADER])
 
index 4295a173220d3b40c24d3336cea08a365fdcf5a8..0e5e4fe3de03893663da16f3d3d565e135436e33 100755 (executable)
@@ -11,8 +11,8 @@ mnt=/mnt/ext1
 mount -t vfat ${dev}1 $mnt || exit 0
 rm -rf $mnt/corbenik
 cp -r out/* $mnt/ || exit 0
-cp -r input/* $mnt/ || exit 0
 cp out/arm9loaderhax.bin $mnt/corbenik/boot/Corbenik || exit 0
+( cd $mnt/ && ./n3ds_firm.sh )
 umount $mnt || exit 0
 sync || exit 0
 eject ${dev} || exit 0
index b46da7c6fde54d3d75684550d6bec27d9f42d18d..29499da1796f063fa8dbabcf047142ea93530419 100644 (file)
 #define PATH_REBOOT_HOOK     PATH_BITS "/reboot_hook.bin"   // Reboot hook
 #define PATH_REBOOT_CODE     PATH_BITS "/reboot_code.bin"   // Reboot entry code
 
+#define PATH_TOP_BG          PATH_SHARE "/top.bin"
+#define PATH_BOTTOM_BG       PATH_SHARE "/bottom.bin"
+#define PATH_TERMFONT        PATH_SHARE "/termfont.bin"
+
 #define PATH_CHAINS          PREFIX "/boot"
 
-#define PATH_TEMP            LOCALSTATEDIR               // Files that are transient and used to speed operation
-#define PATH_LOADER_CACHE    PATH_TEMP "/loader" // Cached patch bytecode for loader.
+#define PATH_TEMP            LOCALSTATEDIR "/cache"  // Files that are transient and used to speed operation
+#define PATH_LOADER_CACHE    PATH_TEMP "/loader"     // Cached patch bytecode for loader.
 
-#define PATH_LOCEMU          LOCALEDIR "/emu"    // Locale emulation config
+#define PATH_LOCEMU          LOCALEDIR "/emu"     // Locale emulation config
 #define PATH_FIRMWARES       LIBDIR   "/firmware" // Firmware folder.
 
 #define PATH_CONFIG_DIR      SYSCONFDIR                   // Config file directory.
@@ -54,7 +58,7 @@
 #define PATH_KEYS            SHAREDIR "/keys" // Keyfiles will be loaded from this dir, and
                                               // additionally the root if not found.
 
-#define PATH_EXEFS           LIBDIR "/exe"         // ExeFS overrides/dumps, named by titleid
+#define PATH_EXEFS           LIBDIR "/exefs"       // ExeFS overrides/dumps, named by titleid
 #define PATH_EXEFS_TEXT      PATH_EXEFS "/text"    // Text segment overrides/dumps, named by titleid
 #define PATH_EXEFS_RO        PATH_EXEFS "/ro"      // RO segment overrides/dumps, named by titleid
 #define PATH_EXEFS_DATA      PATH_EXEFS "/data"    // Data segment overrides/dumps, named by titleid
 #define PATH_ALT_SLOT0X11KEY96 "/slot0x11key96.bin" // Hey, your perrogative, buddy. I like cleaned up
                                                     // paths.
 
-#define PATH_BOOTLOG         LOCALSTATEDIR "/boot.log"
-#define PATH_LOADERLOG       LOCALSTATEDIR "/loader.log"
+#define PATH_LOG             LOCALSTATEDIR "/log"
+
+#define PATH_BOOTLOG         PATH_LOG "/boot.log"
+#define PATH_LOADERLOG       PATH_LOG "/loader.log"
 
 #define PATCH_FLAG_REQUIRE (1 << 0) // Force enable patch unless 'Unsafe Options' is checked.
 #define PATCH_FLAG_DEVMODE (1 << 1) // Require 'Developer Options' to be checked.
index fc4886fe5cfd21e9d9520bae4fefc74226e714c0..c3a2da5854aa1158c1a6c64633b4c62c9da455fe 100644 (file)
@@ -25,15 +25,15 @@ main(int argc, char** argv)
 
     clear_bg();
 
-    load_bg_top   (PATH_BITS "/top.bin");
-    load_bg_bottom(PATH_BITS "/bottom.bin"); // This is basically a menuhax splash (90deg rotated BGR8 pixel data)
+    load_bg_top   (PATH_TOP_BG);
+    load_bg_bottom(PATH_BOTTOM_BG); // This is basically a menuhax splash (90deg rotated BGR8 pixel data)
 
     clear_disp(TOP_SCREEN);
     clear_disp(BOTTOM_SCREEN);
 
     ctr_screen_enable_backlight(CTR_SCREEN_BOTH);
 
-    set_font(PATH_BITS "/termfont.bin");
+    set_font(PATH_TERMFONT);
 
     install_interrupts(); // Get some free debug info.
 
index d1c0e29cd5204a961a27183603cade22a86b5694..a52e123c97b0cc33f712145960c08b3d2095069e 100644 (file)
@@ -37,11 +37,15 @@ mk_structure()
         f_mkdir(PATH_FIRMWARES);
         f_mkdir(PATH_MODULES);
       f_mkdir(BINDIR);
+#if defined(CHAINLOADER) && CHAINLOADER == 1
+      f_mkdir(PATH_CHAINS);
+#endif
       f_mkdir(SBINDIR);
       f_mkdir(SYSCONFDIR);
       f_mkdir(LOCALSTATEDIR);
         f_mkdir(PATH_TEMP);
           f_mkdir(PATH_LOADER_CACHE);
+        f_mkdir(PATH_LOG);
       f_mkdir(SHAREDIR);
         f_mkdir(PATH_KEYS);
         f_mkdir(LOCALEDIR);