From 43564898bda58ba5e7179de73acec22998b9f4da Mon Sep 17 00:00:00 2001 From: kamikawa Date: Wed, 20 Aug 2008 11:48:55 +0000 Subject: [PATCH] =?UTF-8?q?(SystemUpdater)=20"nand:/shared2/launcher/wrap.?= =?UTF-8?q?bin"=20=E5=8F=8A=E3=81=B3=20"nand:sys/cert.sys"=20=E3=81=AE?= =?UTF-8?q?=E6=9B=B8=E3=81=8D=E8=BE=BC=E3=81=BF=E5=87=A6=E7=90=86=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2206 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- .../ARM9.TWL/include/kami_copy_file.h | 3 ++ .../SystemUpdater/ARM9.TWL/main.rsf | 2 +- .../ARM9.TWL/src/kami_copy_file.c | 36 ++++++++++++++++-- .../SystemUpdater/ARM9.TWL/src/main.c | 6 ++- .../SystemUpdater/data/cert.sys | Bin 0 -> 768 bytes 5 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 build/systemMenu_tools/SystemUpdater/data/cert.sys diff --git a/build/systemMenu_tools/SystemUpdater/ARM9.TWL/include/kami_copy_file.h b/build/systemMenu_tools/SystemUpdater/ARM9.TWL/include/kami_copy_file.h index d2fb008c..73d3cc67 100644 --- a/build/systemMenu_tools/SystemUpdater/ARM9.TWL/include/kami_copy_file.h +++ b/build/systemMenu_tools/SystemUpdater/ARM9.TWL/include/kami_copy_file.h @@ -26,7 +26,10 @@ extern "C" { #include +#define WRAP_DATA_FILE_PATH_IN_NAND "nand:/shared2/launcher/wrap.bin" + BOOL kamiCopyFile(char* srcPath, char* dstPath); +BOOL kamiWriteWrapData(void); /*===========================================================================*/ diff --git a/build/systemMenu_tools/SystemUpdater/ARM9.TWL/main.rsf b/build/systemMenu_tools/SystemUpdater/ARM9.TWL/main.rsf index 42b3e030..abb5c445 100644 --- a/build/systemMenu_tools/SystemUpdater/ARM9.TWL/main.rsf +++ b/build/systemMenu_tools/SystemUpdater/ARM9.TWL/main.rsf @@ -223,7 +223,7 @@ RomSpec HostRoot ../data Root /data File HNAA.tad HNBA.tad HNCA.tad HNHA.tad HNLA.tad \ - menu_launcher.nand TWLFontTable.dat + menu_launcher.nand TWLFontTable.dat cert.sys HostRoot $(PRIVKEY_PATH) Root /key File $(HWINFO_PRIVKEY) $(HWID_PRIVKEY) diff --git a/build/systemMenu_tools/SystemUpdater/ARM9.TWL/src/kami_copy_file.c b/build/systemMenu_tools/SystemUpdater/ARM9.TWL/src/kami_copy_file.c index c9365276..899f3a56 100644 --- a/build/systemMenu_tools/SystemUpdater/ARM9.TWL/src/kami_copy_file.c +++ b/build/systemMenu_tools/SystemUpdater/ARM9.TWL/src/kami_copy_file.c @@ -71,10 +71,10 @@ BOOL kamiCopyFile(char* srcPath, char* dstPath) FS_CloseFile(&file); // 一旦対象データを削除する - (void)FS_DeleteFile(dstPath); +// (void)FS_DeleteFile(dstPath); // ターゲットファイル作成 - if (!FS_CreateFile(dstPath, FS_PERMIT_R | FS_PERMIT_W)) + if (!FS_CreateFileAuto(dstPath, FS_PERMIT_R | FS_PERMIT_W)) { kamiFontPrintfConsoleEx(CONSOLE_RED, "FS_CreateFile(%s) failed.\n", dstPath); result = FALSE; @@ -89,7 +89,7 @@ BOOL kamiCopyFile(char* srcPath, char* dstPath) kamiFontPrintfConsoleEx(CONSOLE_RED, "FS_OpenFile(%s) failed.\n", dstPath); result = FALSE; } - // nand:sys/TWLFontTable.dat書き込み + // ターゲットファイルへ書き込み else if (FS_WriteFile(&file, pTempBuf, (s32)file_size) == -1) { kamiFontPrintfConsoleEx(CONSOLE_RED, "FS_WritFile() failed.\n"); @@ -103,3 +103,33 @@ BOOL kamiCopyFile(char* srcPath, char* dstPath) return result; } +// ダミーのDSメニューラッピング用ファイル作成(UIGランチャーが作っているもの) +BOOL kamiWriteWrapData(void) +{ + FSFile file; + BOOL open_is_ok; + const int FATFS_CLUSTER_SIZE = 16 * 1024; + + // 既に存在するなら何もしない + FS_InitFile(&file); + open_is_ok = FS_OpenFile(&file, WRAP_DATA_FILE_PATH_IN_NAND); + if (open_is_ok) + { + FS_CloseFile(&file); + OS_Printf("%s is already exist.\n", WRAP_DATA_FILE_PATH_IN_NAND); + return TRUE; + } + + if( FS_CreateFileAuto( WRAP_DATA_FILE_PATH_IN_NAND, FS_PERMIT_R | FS_PERMIT_W ) ) + { + FSFile file; + if( FS_OpenFileEx( &file, WRAP_DATA_FILE_PATH_IN_NAND, FS_FILEMODE_RW ) ) + { + (void)FS_SetFileLength( &file, FATFS_CLUSTER_SIZE ); + FS_CloseFile( &file ); + return TRUE; + } + } + + return FALSE; +} diff --git a/build/systemMenu_tools/SystemUpdater/ARM9.TWL/src/main.c b/build/systemMenu_tools/SystemUpdater/ARM9.TWL/src/main.c index ad5fedec..3b49c5cc 100644 --- a/build/systemMenu_tools/SystemUpdater/ARM9.TWL/src/main.c +++ b/build/systemMenu_tools/SystemUpdater/ARM9.TWL/src/main.c @@ -80,7 +80,8 @@ static const char* ImportTadFileList[] = static const CopyFileList sCopyFileList[] = { - { "rom:/data/TWLFontTable.dat", "nand:sys/TWLFontTable.dat" } + { "rom:/data/TWLFontTable.dat", "nand:sys/TWLFontTable.dat" }, + { "rom:/data/cert.sys", "nand:/sys/cert.sys" } }; /*---------------------------------------------------------------------------* @@ -402,6 +403,9 @@ TwlMain() } } + // ダミーのラッピングデータ書き込み + result &= kamiWriteWrapData(); + // TADのインポート開始 tadNum = sizeof(ImportTadFileList)/sizeof(ImportTadFileList[0]); diff --git a/build/systemMenu_tools/SystemUpdater/data/cert.sys b/build/systemMenu_tools/SystemUpdater/data/cert.sys new file mode 100644 index 0000000000000000000000000000000000000000..3d40f56a9db3c62e6adc7a03de32da6918856835 GIT binary patch literal 768 zcmZQzWMH&YKFDw48@u`O?Jv92>c!S41fTiSB;erVGv$GpPIQ!pXu~Q-OF8C`R-Cd1 zJ;^7P%BT1GZ|rrh7TmOBLz&OC-Lm^$?AyKmZ1|nV1KyVeZ^ds~t@>H)m~h{L)EBM- zyDfbdYi^yPZggDEwfgC%s{2!4uM~N&B3>J$_%)10R%OL2)2FHHgm71Q?NH5~FhfRJ$oT+8G%Bd|fqR_pQUS zZH60WAKu}o82i?6!Y$LePJxkU&p6xh?R_d9q5pK>Q_fVOGe1)@)K95@XZV%;m92ZP zUH7~o_vft)y`mP=w6DDLTDv61S;f%fz@ul{R(h9${`*wjY7H0PA9pv#VcY$=N?#R! zaWqyW`s$y*zOjp=Ks8{cM)Tqp1t?> Q_x&{=E;0bqF*%_J0PVpB*Z=?k literal 0 HcmV?d00001