mirror of
https://github.com/rvtr/TwlIPL.git
synced 2025-10-31 06:01:12 -04:00
出力ファイル名をsysmenu.log固定から本体シリアルナンバに変更
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2693 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
parent
9751a5023a
commit
8120d7b9dd
@ -46,7 +46,8 @@ ROM_SPEC = main.rsf
|
|||||||
|
|
||||||
TARGET_BIN = SystemLogReader.srl
|
TARGET_BIN = SystemLogReader.srl
|
||||||
|
|
||||||
LLIBRARIES += liberrorlog$(TWL_LIBSUFFIX).a
|
LLIBRARIES += liberrorlog$(TWL_LIBSUFFIX).a \
|
||||||
|
liblcfg$(TWL_LIBSUFFIX).a
|
||||||
|
|
||||||
include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs
|
include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@ -21,6 +21,7 @@
|
|||||||
#include "keypad.h"
|
#include "keypad.h"
|
||||||
#include "font.h"
|
#include "font.h"
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
|
#include <twl/lcfg.h>
|
||||||
|
|
||||||
#define BUFSIZE 256
|
#define BUFSIZE 256
|
||||||
|
|
||||||
@ -28,7 +29,7 @@
|
|||||||
#define SCREEN_WIDTH 32
|
#define SCREEN_WIDTH 32
|
||||||
#define RESULT_LINE_OFFSET 6
|
#define RESULT_LINE_OFFSET 6
|
||||||
|
|
||||||
#define DST_LOGFILE_PATH "sdmc:/sysmenu.log"
|
#define DST_LOGFILE_PATH "sdmc:/"
|
||||||
#define ERRORLOG_LOGFILE_PATH "nand:/sys/log/sysmenu.log"
|
#define ERRORLOG_LOGFILE_PATH "nand:/sys/log/sysmenu.log"
|
||||||
|
|
||||||
#define NAND_BLOCK_BYTE 0x200
|
#define NAND_BLOCK_BYTE 0x200
|
||||||
@ -96,8 +97,8 @@ TwlMain()
|
|||||||
|
|
||||||
ERRORLOG_Init( OS_AllocFromMain, OS_FreeToMain );
|
ERRORLOG_Init( OS_AllocFromMain, OS_FreeToMain );
|
||||||
|
|
||||||
|
|
||||||
resetConsoleFlag = TRUE;
|
resetConsoleFlag = TRUE;
|
||||||
OS_TPrintf( "boottype : %d\n", OS_GetBootType() );
|
|
||||||
|
|
||||||
drawMenu();
|
drawMenu();
|
||||||
doProc();
|
doProc();
|
||||||
@ -165,7 +166,7 @@ static BOOL deleteLogfile( void )
|
|||||||
static BOOL copyLogToSD( void )
|
static BOOL copyLogToSD( void )
|
||||||
{
|
{
|
||||||
FSFile src, dst;
|
FSFile src, dst;
|
||||||
// 最悪で読み込んだサイズの倍の文字列になる可能性がある
|
// 書き込みサイズは、最悪で読み込んだサイズの倍のになる可能性がある
|
||||||
BOOL result = TRUE;
|
BOOL result = TRUE;
|
||||||
int idxlog;
|
int idxlog;
|
||||||
int sizelog;
|
int sizelog;
|
||||||
@ -173,14 +174,33 @@ static BOOL copyLogToSD( void )
|
|||||||
char winbuf[BUFSIZE*2 +1];
|
char winbuf[BUFSIZE*2 +1];
|
||||||
s32 readSize;
|
s32 readSize;
|
||||||
s32 writeSize = 0;
|
s32 writeSize = 0;
|
||||||
|
char filename[BUFSIZE+1];
|
||||||
|
u8 *lcfgbuf;
|
||||||
|
u8 serial[OS_TWL_HWINFO_SERIALNO_LEN_MAX];
|
||||||
|
|
||||||
|
buf[BUFSIZE] = '\0';
|
||||||
|
|
||||||
buf[256] = '\0';
|
|
||||||
FS_InitFile( &dst );
|
FS_InitFile( &dst );
|
||||||
|
printConsole("Reading serial number...");
|
||||||
|
lcfgbuf = OS_Alloc( LCFG_READ_TEMP );
|
||||||
|
|
||||||
|
if( LCFG_ReadTWLSettings( (u8 (*)[LCFG_READ_TEMP]) lcfgbuf ) && LCFG_ReadHWSecureInfo() )
|
||||||
|
{
|
||||||
|
LCFG_THW_GetSerialNo( (u8*)serial );
|
||||||
|
STD_TSNPrintf( filename , BUFSIZE, "sdmc:/%s.log", serial);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printConsoleErr( "failed to read Serial.");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// まずファイルを削除
|
// まずファイルを削除
|
||||||
FS_DeleteFile( DST_LOGFILE_PATH );
|
FS_DeleteFile( filename );
|
||||||
|
|
||||||
if( ! FS_CreateFile( DST_LOGFILE_PATH, FS_PERMIT_R | FS_PERMIT_W ) )
|
if( ! FS_CreateFile( filename, FS_PERMIT_R | FS_PERMIT_W ) )
|
||||||
{
|
{
|
||||||
printConsoleErr( "Copy Failed." );
|
printConsoleErr( "Copy Failed." );
|
||||||
printConsoleErr( "func: FS_CreateFile" );
|
printConsoleErr( "func: FS_CreateFile" );
|
||||||
@ -189,7 +209,7 @@ static BOOL copyLogToSD( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ファイル作成に成功
|
// ファイル作成に成功
|
||||||
if( !FS_OpenFileEx( &dst , DST_LOGFILE_PATH, FS_FILEMODE_RW ))
|
if( !FS_OpenFileEx( &dst , filename, FS_FILEMODE_RW ))
|
||||||
{
|
{
|
||||||
// 作成したファイルをopenできなかった場合
|
// 作成したファイルをopenできなかった場合
|
||||||
printConsoleErr( "Copy Failed." );
|
printConsoleErr( "Copy Failed." );
|
||||||
|
|||||||
@ -10,34 +10,37 @@ def putex(str)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def buildgcd(buildtype, prodopt)
|
def buildgcd(buildtype, prodopt, shortbuild)
|
||||||
puts "buildtype : #{buildtype}"
|
puts "buildtype : #{buildtype}"
|
||||||
|
puts "**shortbuild**" if shortbuild
|
||||||
|
|
||||||
# build TwlIPL Root
|
unless shortbuild
|
||||||
Dir.chdir(ENV['TWL_IPL_RED_ROOT']) do
|
# build TwlIPL Root
|
||||||
putex "make -f Makefile.full clean; " +
|
Dir.chdir(ENV['TWL_IPL_RED_ROOT']) do
|
||||||
"makesp CYGPATH_NOCMD=TRUE -j 2 -f Makefile.full TWL_FINALROM=TRUE #{prodopt}"
|
putex "make -f Makefile.full clean; " +
|
||||||
end
|
"makesp CYGPATH_NOCMD=TRUE -j 2 -f Makefile.full TWL_FINALROM=TRUE #{prodopt}"
|
||||||
|
|
||||||
# build nandfirm
|
|
||||||
Dir.chdir(ENV['TWL_IPL_RED_ROOT'] + "/build/nandfirm/menu-launcher") do
|
|
||||||
putex "make clean; make TWL_FINALROM=TRUE #{prodopt}"
|
|
||||||
nandfirm = Dir.glob("menu_launcher*#{buildtype}.nand")
|
|
||||||
if nandfirm.none?
|
|
||||||
puts "build nandfirm failed."
|
|
||||||
exit
|
|
||||||
else
|
|
||||||
nandfirm = nandfirm[0]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# build nandfirm
|
||||||
putex "$TWLSDK_ROOT/tools/bin/bin2obj.TWL.exe #{nandfirm} nandfirm.#{buildtype}.o " +
|
Dir.chdir(ENV['TWL_IPL_RED_ROOT'] + "/build/nandfirm/menu-launcher") do
|
||||||
"-b nandfirm_begin -e nandfirm_end"
|
putex "make clean; make TWL_FINALROM=TRUE #{prodopt}"
|
||||||
putex "cp nandfirm.#{buildtype}.o #{Rootdir}/ARM9.TWL/nandfirm/"
|
nandfirm = Dir.glob("menu_launcher*#{buildtype}.nand")
|
||||||
|
if nandfirm.none?
|
||||||
|
puts "build nandfirm failed."
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
nandfirm = nandfirm[0]
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
putex "$TWLSDK_ROOT/tools/bin/bin2obj.TWL.exe #{nandfirm} nandfirm.#{buildtype}.o " +
|
||||||
|
"-b nandfirm_begin -e nandfirm_end"
|
||||||
|
putex "cp nandfirm.#{buildtype}.o #{Rootdir}/ARM9.TWL/nandfirm/"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# build systemlogreader
|
# build systemlogreader
|
||||||
putex "make clean; make TWL_FINALROM=TRUE #{prodopt}"
|
putex "makesp CYGPATH_NOCMD=TRUE -j 2 clean; makesp CYGPATH_NOCMD=TRUE -j 2 TWL_FINALROM=TRUE #{prodopt}"
|
||||||
Dir.chdir(Rootdir + "/ARM9.TWL/bin/ARM9-TS.LTD.thumb/Rom") do
|
Dir.chdir(Rootdir + "/ARM9.TWL/bin/ARM9-TS.LTD.thumb/Rom") do
|
||||||
if buildtype == "dev"
|
if buildtype == "dev"
|
||||||
putex 'cp ./SystemLogReader.srl $TWL_IPL_RED_ROOT/build/gcdfirm/memory-launcher-writer/'
|
putex 'cp ./SystemLogReader.srl $TWL_IPL_RED_ROOT/build/gcdfirm/memory-launcher-writer/'
|
||||||
@ -64,15 +67,16 @@ end
|
|||||||
|
|
||||||
Rootdir = ENV['TWL_IPL_RED_ROOT'] + '/build/systemMenu_tools/SystemLogReader'
|
Rootdir = ENV['TWL_IPL_RED_ROOT'] + '/build/systemMenu_tools/SystemLogReader'
|
||||||
prodopt = ""
|
prodopt = ""
|
||||||
|
shortbuild = false
|
||||||
|
|
||||||
# default buildtype = dev
|
# default buildtype = dev
|
||||||
if ARGV.none? || ARGV[0] == 'dev'
|
if ARGV.none? || ARGV.include?('dev')
|
||||||
build = ["dev"]
|
build = ["dev"]
|
||||||
opt = ["FIRM_USE_PRODUCT_KEYS="]
|
opt = ["FIRM_USE_PRODUCT_KEYS="]
|
||||||
elsif ARGV[0] == "prod"
|
elsif ARGV.include?("prod")
|
||||||
build = ["prod"]
|
build = ["prod"]
|
||||||
opt = ["FIRM_USE_PRODUCT_KEYS=TRUE"]
|
opt = ["FIRM_USE_PRODUCT_KEYS=TRUE"]
|
||||||
elsif ARGV[0] == "full"
|
elsif ARGV.include? "full"
|
||||||
build = ["dev", "prod"]
|
build = ["dev", "prod"]
|
||||||
opt = ["FIRM_USE_PRODUCT_KEYS=", "FIRM_USE_PRODUCT_KEYS=TRUE"]
|
opt = ["FIRM_USE_PRODUCT_KEYS=", "FIRM_USE_PRODUCT_KEYS=TRUE"]
|
||||||
else
|
else
|
||||||
@ -80,8 +84,12 @@ else
|
|||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
|
|
||||||
p build.zip(opt)
|
if ARGV.include? "short"
|
||||||
build.zip(opt).each do |b,op|
|
shortbuild = true
|
||||||
buildgcd(b,op)
|
end
|
||||||
|
|
||||||
|
p build.zip(opt)
|
||||||
|
build.zip(opt).each do |b,op|
|
||||||
|
buildgcd(b,op,shortbuild)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user