(佐々木@PSEG1)全てのリージョンを一括でビルドするように変更

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2247 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
(no author) 2008-08-23 07:00:30 +00:00
parent 5d209a4387
commit ed5d107ec8
10 changed files with 325 additions and 33 deletions

View File

@ -35,7 +35,7 @@ TWL_ARCHGEN = LIMITED
TITLEID_LO = 0SUA
#TARGET_TAD =
TARGET_BIN = CustomSystemUpdater.srl
TARGET_BIN = CustomSystemUpdater_$(SYSM_REGION).srl
LCFILE_SPEC = ARM9-TS.lsf
ROM_SPEC = main.rsf
@ -113,6 +113,7 @@ MAKEROM = $(TWL_TOOLSDIR)/bin/makerom.TWL.secure.exe
#LDIRT_CLEAN =
#INSTALL_TARGETS =
INSTALL_DIR = $(SDK_NMENU_DATADIR)
#INSTALL_DIR = $(TWL_IPL_RED_ROOT)/build/tests/CustomSystemUpdater/bin
#----------------------------------------------------------------------------

View File

@ -220,9 +220,9 @@ RomSpec
{
Offset 0x00000000
Segment ALL
HostRoot ../data
HostRoot ../data/test_forcsu/euro
Root /data
File hnaj-v0.tad hnbj-v0.tad hnca-v0.tad hnda-v0.tad hnea-v0.tad hnfj-v0.tad HNGJ-261.tad hnha-v0.tad hnij-v0.tad hnjj-v0.tad hnkj-v0.tad hnla-v0.tad TWLFontTable.dat nandfirm_rcplus.nand
File hnap-v0.tad hnbp-v0.tad hnca-v0.tad hnda-v0.tad hnea-v0.tad hnfp-v0.tad hnha-v0.tad hnip-v0.tad hnjp-v0.tad hnkp-v0.tad hnla-v0.tad TWLFontTable.dat nandfirm_rcplus.nand
HostRoot $(PRIVKEY_PATH)
Root /key
File $(HWINFO_PRIVKEY) $(HWID_PRIVKEY)

View File

@ -71,17 +71,16 @@ typedef struct _CopyFileList
static const char* ImportTadFileList[] =
{
"rom:/data/hnaj-v0.tad",
"rom:/data/hnbj-v0.tad",
"rom:/data/hnap-v0.tad",
"rom:/data/hnbp-v0.tad",
"rom:/data/hnca-v0.tad",
"rom:/data/hnda-v0.tad",
"rom:/data/hnea-v0.tad",
"rom:/data/hnfj-v0.tad",
"rom:/data/HNGJ-261.tad",
"rom:/data/hnfp-v0.tad",
"rom:/data/hnha-v0.tad",
"rom:/data/hnij-v0.tad",
"rom:/data/hnjj-v0.tad",
"rom:/data/hnkj-v0.tad",
"rom:/data/hnip-v0.tad",
"rom:/data/hnjp-v0.tad",
"rom:/data/hnkp-v0.tad",
"rom:/data/hnla-v0.tad",
};

View File

@ -16,6 +16,7 @@
# $Author$
#----------------------------------------------------------------------------
TARGET_FIRM = SYSTEMMENU
include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs
@ -29,6 +30,12 @@ DS_HASH_TABLE = $(TWL_IPL_RED_ROOT)/build/systemMenu_RED/DSHashTable
SHARED_FONT_DIR = $(TWL_IPL_RED_ROOT)/build/systemMenu_RED/sharedFont
NANDFIRM_DIR = $(TWL_IPL_RED_ROOT)/build/nandfirm/menu-launcher
# リージョンが指定されてなかったら日本
ifeq ($(REGION),)
REGION = JPN
endif
# 既存データを使用する場合はTRUEを指定
SKIP_CREATE_DATA = TRUE
@ -49,6 +56,9 @@ SUBDIRS = banner \
ARM9.TWL
endif
# CustomRegion
export SYSM_REGION = $(REGION)
# COMPILE SWITCH for build SystemMenu
export SYSM_UPDATER_RELEASE = TRUE

View File

@ -31,6 +31,13 @@ REGION = {
"USA" => "OS_TWL_REGION_AUSTRALIA",
}
REGION_PATH = {
"JPN" => "jp",
"EUR" => "euro",
"AUS" => "aus",
"USA" => "usa",
}
# デフォルト設定の作成
def make_default_config
config = {
@ -66,13 +73,6 @@ def write_config(filename, data)
}
end
# ファイル内の文字列を置き換える
#def replace_data(filename, mark, data)
#file = File.read(filename)
#file.sub(/%#{mark}%/, data)
#end
# データ内の文字列を置き換える
def replace_data(src, mark, data)
while src.index(/%#{mark}%/) != nil do
@ -96,6 +96,7 @@ def make_rsf(config)
tadlist << config[:FontFile] << config[:NandFirm]
tadlist = tadlist.join(" ")
src = File.read(config[:TemplatePath] + "/" + config[:RSF])
src = replace_data(src, "datapath", config[:DataPath])
write_data(config[:TargetPath] + "/" + config[:RSF], replace_data(src, "filelist", tadlist))
end
@ -118,7 +119,7 @@ def make_main(config)
write_data(config[:TargetPath] + "/" + config[:SRC], mod)
end
# SystemUpdaterの設定を変更する
# SystemUpdaterを作成する
def make_updater(filename)
config = read_config(filename)
make_rsf(config)
@ -126,7 +127,7 @@ def make_updater(filename)
end
# ディレクトリ内のtadを検索
def pickup_tad(target_dir, name)
def pickup_files(target_dir, name)
Dir.glob(target_dir + name)
end
@ -148,32 +149,31 @@ when "default" then
make_default_config
make_updater(DEFAULT_CONFIG)
when "custom" then
# カスタム設定で作成
# 指定したコンフィグファイルをベースに
# dataディレクトリ内のtadを追加する
config = ""
if ARGV.size == 1
# コンフィグファイルが指定されてない場合config_baseをベースに
config = "custom_base.yaml"
else
config = ARGV[1]
if ARGV.size < 3
p "Usage: sumaker custom target_dir region"
exit
end
# カスタム設定で作成
config = "custom_base.yaml"
region = ARGV[2]
# ベースコンフィグに、dataディレクトリ内のtadとnandを追加
config = read_config(config)
if config[:TadFiles] == nil
config[:TadFiles] = []
end
tads = pickup_tad(config[:DataPath], "/*.tad")
nand = pickup_tad(config[:DataPath], "/*.nand")
font = pickup_tad(config[:DataPath], "/*.dat")
config[:DataPath] += "/#{ARGV[1]}/#{REGION_PATH[region]}"
config[:Region] = region
tads = pickup_files(config[:DataPath], "/*.tad")
nand = pickup_files(config[:DataPath], "/*.nand")
font = pickup_files(config[:DataPath], "/*.dat")
if nand.size > 0
config[:NandFirm] = nand[0].slice(FILE_MATCH)
end
if font.size > 0
config[:FontFile] = font[0].slice(FILE_MATCH)
end
p tads
for tad in tads do
tad = tad.slice(FILE_MATCH)
config[:TadFiles] << tad

View File

@ -220,7 +220,7 @@ RomSpec
{
Offset 0x00000000
Segment ALL
HostRoot ../data
HostRoot ../%datapath%
Root /data
File %filelist%
HostRoot $(PRIVKEY_PATH)

View File

@ -0,0 +1,46 @@
#!/bin/sh
#! bash -f
#----------------------------------------------------------------------------
# Project: TwlSDK - tools
# File: conv2svnDir.sh
#
# Copyright 2007 Nintendo. All rights reserved.
#
# These coded instructions, statements, and computer programs contain
# proprietary information of Nintendo of America Inc. and/or Nintendo
# Company Ltd., and are protected by Federal copyright law. They may
# not be disclosed to third parties or copied or duplicated in any form,
# in whole or in part, without the prior written consent of Nintendo.
#
# $Date:: $
# $Rev$
# $Author$
#----------------------------------------------------------------------------
move_data_to_tmp() {
tmp=tmp/$1
install -d $tmp
for src in `find $1 -name v*`
do
mv $src $tmp
done
}
do_cls() {
tmp=tmp/$1
for target in `find $tmp -name v*`
do
cp -rp $target $1
echo "$target"
genLic $1
done
}
for app in `find . -maxdepth 1 -mindepth 1 -type d`
do
name=`echo "$app" | cut -c 3-`
move_data_to_tmp $name
do_cls $name
done
rm -rf tmp

View File

@ -0,0 +1,134 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys, os, struct
import string, random
import re, shutil, binascii
def roundup(val, align):
return int((val+align-1)/align)*align
def randstr(n):
words = ''.join([string.digits,string.letters,'.','+'])
return ''.join(random.choice(words) for i in xrange(n))
def main():
try:
tadfile = sys.argv[1]
except:
print '%s : please specfy the tad file' % (sys.argv[0])
exit(-1)
#--- parse *.tad
fin = open(tadfile, 'rb')
try:
tadData = fin.read()
except:
fin.close()
start, end = 0, struct.calcsize('>l2sh6l')
(hdrSize, tadType, tadVersion, certSize, crlSize, ticketSize, tmdSize,
contentSize, metaSize) = struct.unpack('>l2sh6l', tadData[start:end])
certOffset = roundup(hdrSize, 64)
crlOffset = roundup(certOffset + certSize, 64)
ticketOffset = roundup(crlOffset + crlSize, 64)
tmdOffset = roundup(ticketOffset + ticketSize, 64)
contentOffset = roundup(tmdOffset + tmdSize, 64)
metaOffset = roundup(contentOffset + contentSize, 64)
fileSize = roundup(metaOffset + metaSize, 64)
#print '-'*20+'\n'
#print ' hdrSize %s\n' % hdrSize,
#print ' tadType %s\n' % tadType,
#print ' tadVersion, %s\n' % tadVersion,
#print ' certSize, %s\n' % certSize,
#print ' crlSize, %s\n' % crlSize,
#print ' ticketSize, %s\n' % ticketSize,
#print ' tmdSize, %s\n' % tmdSize,
#print ' contentSize, %s\n' % contentSize,
#print ' metaSize %s'
#print '\n'+'-'*20
#open("cert.bin", 'wb').write(tadData[certOffset:certOffset+certSize])
#open("crl.bin", 'wb').write(tadData[crlOffset:crlOffset+crlSize])
#open("ticket.bin", 'wb').write(tadData[ticketOffset:ticketOffset+ticketSize])
#open("tmd.bin", 'wb').write(tadData[tmdOffset:tmdOffset+tmdSize])
#open("content.bin", 'wb').write(tadData[contentOffset:contentOffset+contentSize])
#open("meta.bin", 'wb').write(tadData[metaOffset:metaOffset+metaSize])
#--- parse TMD
tmd = tadData[tmdOffset:tmdOffset+tmdSize]
#--- RSA2048 signature
(sigB, sigE) = (0, struct.calcsize('>i256s60s64s'))
(IOSCCertSigType, IOSCRsaSig2048, IOSCSigDummy, IOSCName)\
= struct.unpack('>i256s60s64s', tmd[sigB:sigE])
#print "=== RSA2048 signature ==============="
#print "IOSCCertSigType : %x" % IOSCCertSigType
#print "IOSCRsaSig2048 : %s" % IOSCRsaSig2048
#print "IOSCSigDummy : %s" % IOSCSigDummy
#print "IOSCName : %s" % IOSCName
#--- ESTitleMetaHeader
(tmhB, tmhE) = (sigE, sigE+struct.calcsize('>4B5iH62si3H'))
(version,
caCrlVersion,
signerCrlVersion,
dummy,
sysVersion_H,
sysVersion_L,
titleId_H,
titleId_L,
titleType,
groupID,
reserved,
accessRights,
titleVersion,
numContents,
bootIndex) = struct.unpack('>4B5iH62si3H',tmd[tmhB:tmhE])
print "=== ESTitleMetaHeader ==============="
#print ('version : %d ') % version
#print ('caCrlVersion : %d ') % caCrlVersion
#print ('signerCrlVersion : %d ') % signerCrlVersion
#print ('dummy : %s ') % dummy
#print ('sysVersion_H : %x ') % sysVersion_H
#print ('sysVersion_L : %x ') % sysVersion_L
print ('titleId_H : %08x ') % titleId_H
print ('titleId_L : %08x ') % titleId_L
#print ('titleType : %x ') % titleType
print ('groupID : %x ') % groupID
#print ('reserved[62] : %s ') % reserved
#print ('accessRights : %d ') % accessRights
print ('titleVersion : %d ') % titleVersion
#print ('numContents : %d ') % numContents
#print ('bootIndex : %d ') % bootIndex
#--- make directory for cls
tadpath = os.path.dirname(tadfile)
gamecode = binascii.unhexlify('%x'%titleId_L)
#clsdir = ''.join([tadpath,'/',gamecode])
clsdir = ''.join(['./',gamecode])
try:
os.mkdir(clsdir)
except:
print '%s : can not create dir %s' % (sys.argv[0],clsdir)
#--- write properties
properties = open(''.join([clsdir,'/properties']),'w')
properties.write('TITLE_ID\t\t\t\t%08x%08x\n' % (titleId_H, titleId_L))
properties.write('TITLE_NAME\t\t\t\t%s\n' % gamecode)
properties.write('TITLE_TYPE\t\t\t\t%s\n' % 'TWL_SYS')
properties.write('PASSWORD\t\t\t\t%s\n' % randstr(64))
properties.write('ALLOW_COMMON_TICKET\t\t%s\n' % '1')
#--- make version dir
verdir = ''.join([clsdir,'/v',str(titleVersion)])
try:
os.mkdir(verdir)
except:
print '%s : can not create dir %s' % (sys.argv[0],verdir)
else:
shutil.copy(tadfile,verdir)
if __name__ == '__main__':
sys.exit(main() or 0)

View File

@ -0,0 +1,48 @@
#!/bin/sh
#! bash -f
#----------------------------------------------------------------------------
# Project: TwlSDK - tools
# File: conv2svnDir.sh
#
# Copyright 2007 Nintendo. All rights reserved.
#
# These coded instructions, statements, and computer programs contain
# proprietary information of Nintendo of America Inc. and/or Nintendo
# Company Ltd., and are protected by Federal copyright law. They may
# not be disclosed to third parties or copied or duplicated in any form,
# in whole or in part, without the prior written consent of Nintendo.
#
# $Date:: $
# $Rev$
# $Author$
#----------------------------------------------------------------------------
if [ $# -lt 1 ];
then
echo "input target dir name"
exit
fi
target=$1_forcls
mkdir $target
cd $target
find ../$1 -name "*.tad" -exec ../mkcls.py {} \;
cp ../cls.sh ./
# nandファームと、フォントを一応リージョン毎にコピー
mkdir jp
mkdir aus
mkdir usa
mkdir euro
cp `find ../$1/jp -name "*.nand"` jp
cp `find ../$1/jp -name "*.nand"` aus
cp `find ../$1/jp -name "*.nand"` usa
cp `find ../$1/jp -name "*.nand"` euro
cp `find ../$1/jp -name "*.dat"` jp
cp `find ../$1/jp -name "*.dat"` aus
cp `find ../$1/jp -name "*.dat"` usa
cp `find ../$1/jp -name "*.dat"` euro

View File

@ -0,0 +1,54 @@
#!/bin/sh
#! bash -f
#----------------------------------------------------------------------------
# Project: TwlSDK - tools
# File: tocsu.sh
#
# Copyright 2007 Nintendo. All rights reserved.
#
# These coded instructions, statements, and computer programs contain
# proprietary information of Nintendo of America Inc. and/or Nintendo
# Company Ltd., and are protected by Federal copyright law. They may
# not be disclosed to third parties or copied or duplicated in any form,
# in whole or in part, without the prior written consent of Nintendo.
#
# $Date:: $
# $Rev$
# $Author$
#----------------------------------------------------------------------------
if [ $# -lt 1 ];
then
echo "input target dir name"
exit
fi
target=$1_forcsu
tmp=$1_tmp
mkdir $target
cd $target
cp -rf ../$1/jp .
cp -rf ../$1/aus .
cp -rf ../$1/usa .
cp -rf ../$1/euro .
mkdir $tmp
find ../$1 -name "*.out" -exec cp {} $tmp \;
find $tmp -name "*[ja]-v0*.out" | gawk -F/ '{printf("cp %s jp/%s\n",$0, $2)}' | sed -e 's/\.out$//g' > jp.sh
find $tmp -name "*[ua]-v0*.out" | gawk -F/ '{printf("cp %s aus/%s\n",$0, $2)}' | sed -e 's/\.out$//g' > aus.sh
find $tmp -name "*[pa]-v0*.out" | gawk -F/ '{printf("cp %s euro/%s\n",$0, $2)}' | sed -e 's/\.out$//g' > euro.sh
find $tmp -name "*[ea]-v0*.out" | gawk -F/ '{printf("cp %s usa/%s\n",$0, $2)}' | sed -e 's/\.out$//g' > usa.sh
./jp.sh
./aus.sh
./euro.sh
./usa.sh
mv $tmp ../
rm -rf *.sh