Subversion Repositories freemyipod

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
164 theseven 1
#!/usr/bin/env python
2
#
3
#
4
#    Copyright 2010 TheSeven
5
#
6
#
427 farthen 7
#    This file is part of emCORE.
164 theseven 8
#
427 farthen 9
#    emCORE is free software: you can redistribute it and/or
164 theseven 10
#    modify it under the terms of the GNU General Public License as
11
#    published by the Free Software Foundation, either version 2 of the
12
#    License, or (at your option) any later version.
13
#
427 farthen 14
#    emCORE is distributed in the hope that it will be useful,
164 theseven 15
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
16
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
#    See the GNU General Public License for more details.
18
#
19
#    You should have received a copy of the GNU General Public License
427 farthen 20
#    along with emCORE.  If not, see <http://www.gnu.org/licenses/>.
164 theseven 21
#
22
#
23
 
24
import sys
427 farthen 25
import libemcorebootcfg
164 theseven 26
from optparse import *
27
 
427 farthen 28
parser = OptionParser("usage: %prog [options] <emcorebin> <emcoreapp> <outfile>")
164 theseven 29
(options, args) = parser.parse_args()
30
if len(args) != 3: parser.error("incorrect number of arguments")
31
 
32
file = open(args[0], "rb")
33
data = file.read()
34
file.close()
35
 
36
file = open(args[1], "rb")
37
app = file.read()
38
file.close()
39
 
524 theseven 40
data = libemcorebootcfg.configure(data, (1, app, None, None))
164 theseven 41
 
42
file = open(args[2], "wb")
524 theseven 43
file.write(data)
164 theseven 44
file.close()