mirror of
https://github.com/rvtr/TwlIPL.git
synced 2025-10-31 06:01:12 -04:00
(SystemUpdater) "nand:/shared2/launcher/wrap.bin" 及び "nand:sys/cert.sys" の書き込み処理を追加。
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2206 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
parent
f552fcb4ab
commit
43564898bd
@ -26,7 +26,10 @@ extern "C" {
|
|||||||
|
|
||||||
#include <twl.h>
|
#include <twl.h>
|
||||||
|
|
||||||
|
#define WRAP_DATA_FILE_PATH_IN_NAND "nand:/shared2/launcher/wrap.bin"
|
||||||
|
|
||||||
BOOL kamiCopyFile(char* srcPath, char* dstPath);
|
BOOL kamiCopyFile(char* srcPath, char* dstPath);
|
||||||
|
BOOL kamiWriteWrapData(void);
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
|||||||
@ -223,7 +223,7 @@ RomSpec
|
|||||||
HostRoot ../data
|
HostRoot ../data
|
||||||
Root /data
|
Root /data
|
||||||
File HNAA.tad HNBA.tad HNCA.tad HNHA.tad HNLA.tad \
|
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)
|
HostRoot $(PRIVKEY_PATH)
|
||||||
Root /key
|
Root /key
|
||||||
File $(HWINFO_PRIVKEY) $(HWID_PRIVKEY)
|
File $(HWINFO_PRIVKEY) $(HWID_PRIVKEY)
|
||||||
|
|||||||
@ -71,10 +71,10 @@ BOOL kamiCopyFile(char* srcPath, char* dstPath)
|
|||||||
FS_CloseFile(&file);
|
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);
|
kamiFontPrintfConsoleEx(CONSOLE_RED, "FS_CreateFile(%s) failed.\n", dstPath);
|
||||||
result = FALSE;
|
result = FALSE;
|
||||||
@ -89,7 +89,7 @@ BOOL kamiCopyFile(char* srcPath, char* dstPath)
|
|||||||
kamiFontPrintfConsoleEx(CONSOLE_RED, "FS_OpenFile(%s) failed.\n", dstPath);
|
kamiFontPrintfConsoleEx(CONSOLE_RED, "FS_OpenFile(%s) failed.\n", dstPath);
|
||||||
result = FALSE;
|
result = FALSE;
|
||||||
}
|
}
|
||||||
// nand:sys/TWLFontTable.dat書き込み
|
// ターゲットファイルへ書き込み
|
||||||
else if (FS_WriteFile(&file, pTempBuf, (s32)file_size) == -1)
|
else if (FS_WriteFile(&file, pTempBuf, (s32)file_size) == -1)
|
||||||
{
|
{
|
||||||
kamiFontPrintfConsoleEx(CONSOLE_RED, "FS_WritFile() failed.\n");
|
kamiFontPrintfConsoleEx(CONSOLE_RED, "FS_WritFile() failed.\n");
|
||||||
@ -103,3 +103,33 @@ BOOL kamiCopyFile(char* srcPath, char* dstPath)
|
|||||||
return result;
|
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;
|
||||||
|
}
|
||||||
|
|||||||
@ -80,7 +80,8 @@ static const char* ImportTadFileList[] =
|
|||||||
|
|
||||||
static const CopyFileList sCopyFileList[] =
|
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のインポート開始
|
// TADのインポート開始
|
||||||
tadNum = sizeof(ImportTadFileList)/sizeof(ImportTadFileList[0]);
|
tadNum = sizeof(ImportTadFileList)/sizeof(ImportTadFileList[0]);
|
||||||
|
|
||||||
|
|||||||
BIN
build/systemMenu_tools/SystemUpdater/data/cert.sys
Normal file
BIN
build/systemMenu_tools/SystemUpdater/data/cert.sys
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user