freemyipod r272 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r271‎ | r272 | r273 >
Date:18:59, 22 November 2010
Author:theseven
Status:new
Tags:
Comment:
ipodcrypt: Rename nano2g commands to s5l8701, as they are more related to the SoC than the device
Modified paths:
  • /apps/installer-nano2g/Makefile (modified) (history)
  • /embios/trunk/loader/ipodnano2g/Makefile (modified) (history)
  • /embios/trunk/tools/ipodcrypt.py (modified) (history)
  • /embios/trunk/tools/libipodcrypto.py (modified) (history)

Diff [purge]

Index: apps/installer-nano2g/Makefile
@@ -26,7 +26,7 @@
2727 COMPILECONFIG := python $(ILOADERDIR)/tools/compileconfig.py
2828 EMBIOSBOOTCFG := python $(EMBIOSDIR)/tools/embiosbootcfg.py
2929 EMBIOSEMBEDAPP := python $(EMBIOSDIR)/tools/embiosembedapp.py
30 -CRYPTFW := python $(EMBIOSDIR)/tools/ipodcrypt.py nano2g-cryptfirmware
 30+CRYPTFW := python $(EMBIOSDIR)/tools/ipodcrypt.py s5l8701-cryptfirmware
3131 GENNOTE := python $(NOTEBOOTDIR)/gennote.py
3232 SCRAMBLE := python $(TOOLSDIR)/scramble.py
3333
Index: embios/trunk/tools/ipodcrypt.py
@@ -31,10 +31,10 @@
3232 print "Please provide a command and (if needed) parameters as command line arguments"
3333 print ""
3434 print "Available commands:"
35 - print " nano2g-cryptdfu <infile> <outfile>"
36 - print " nano2g-decryptdfu <infile> <outfile>"
37 - print " nano2g-cryptfirmware <infile> <outfile>"
38 - print " nano2g-decryptfirmware <infile> <outfile>"
 35+ print " s5l8701-cryptdfu <infile> <outfile>"
 36+ print " s5l8701-decryptdfu <infile> <outfile>"
 37+ print " s5l8701-cryptfirmware <infile> <outfile>"
 38+ print " s5l8701-decryptfirmware <infile> <outfile>"
3939 exit(2)
4040
4141
@@ -41,17 +41,17 @@
4242 def parsecommand(argv):
4343 if len(argv) != 4: usage()
4444
45 - elif argv[1] == "nano2g-cryptdfu":
46 - libipodcrypto.nano2gcryptdfufile(argv[2], argv[3])
 45+ elif argv[1] == "s5l8701-cryptdfu":
 46+ libipodcrypto.s5l8701cryptdfufile(argv[2], argv[3])
4747
48 - elif argv[1] == "nano2g-decryptdfu":
49 - libipodcrypto.nano2gdecryptdfufile(argv[2], argv[3])
 48+ elif argv[1] == "s5l8701-decryptdfu":
 49+ libipodcrypto.s5l8701decryptdfufile(argv[2], argv[3])
5050
51 - elif argv[1] == "nano2g-cryptfirmware":
52 - libipodcrypto.nano2gcryptfirmwarefile(argv[2], argv[3])
 51+ elif argv[1] == "s5l8701-cryptfirmware":
 52+ libipodcrypto.s5l8701cryptfirmwarefile(argv[2], argv[3])
5353
54 - elif argv[1] == "nano2g-decryptfirmware":
55 - libipodcrypto.nano2gdecryptfirmwarefile(argv[2], argv[3])
 54+ elif argv[1] == "s5l8701-decryptfirmware":
 55+ libipodcrypto.s5l8701decryptfirmwarefile(argv[2], argv[3])
5656
5757 else: usage()
5858
Index: embios/trunk/tools/libipodcrypto.py
@@ -30,7 +30,7 @@
3131 import libembiosdata
3232
3333
34 -def nano2gcryptdfu(data):
 34+def s5l8701cryptdfu(data):
3535 data = data.ljust((len(data) + 0x3f) & ~0x3f, "\0")
3636 header = "87011.0\0\0\x08\0\0" + struct.pack("<I", len(data))
3737 embios = libembios.Embios()
@@ -42,7 +42,7 @@
4343 return embios.read(0x08000000, len(data) + 0x800)
4444
4545
46 -def nano2gdecryptdfu(data):
 46+def s5l8701decryptdfu(data):
4747 embios = libembios.Embios()
4848 embios.write(0x08000000, data)
4949 embios.lib.dev.timeout = 20000
@@ -50,7 +50,7 @@
5151 return embios.read(0x08000800, len(data) - 0x800)
5252
5353
54 -def nano2gcryptfirmware(data):
 54+def s5l8701cryptfirmware(data):
5555 data = data.ljust((len(data) + 0x3f) & ~0x3f, "\0")
5656 header = "\0\0\0\0\x02\0\0\0\x01\0\0\0\x40\0\0\0\0\0\0\0" + struct.pack("<I", len(data))
5757 embios = libembios.Embios()
@@ -62,7 +62,7 @@
6363 return embios.read(0x08000000, len(data) + 0x800)
6464
6565
66 -def nano2gdecryptfirmware(data):
 66+def s5l8701decryptfirmware(data):
6767 embios = libembios.Embios()
6868 embios.write(0x08000000, data)
6969 embios.lib.dev.timeout = 20000
@@ -70,34 +70,34 @@
7171 return embios.read(0x08000800, len(data) - 0x800)
7272
7373
74 -def nano2gcryptdfufile(infile, outfile):
 74+def s5l8701cryptdfufile(infile, outfile):
7575 print(outfile)
7676 infile = open(infile, "rb")
7777 outfile = open(outfile, "wb")
78 - outfile.write(nano2gcryptdfu(infile.read()))
 78+ outfile.write(s5l8701cryptdfu(infile.read()))
7979 infile.close()
8080 outfile.close()
8181
8282
83 -def nano2gdecryptdfufile(infile, outfile):
 83+def s5l8701decryptdfufile(infile, outfile):
8484 infile = open(infile, "rb")
8585 outfile = open(outfile, "wb")
86 - outfile.write(nano2gdecryptdfu(infile.read()))
 86+ outfile.write(s5l8701decryptdfu(infile.read()))
8787 infile.close()
8888 outfile.close()
8989
9090
91 -def nano2gcryptfirmwarefile(infile, outfile):
 91+def s5l8701cryptfirmwarefile(infile, outfile):
9292 infile = open(infile, "rb")
9393 outfile = open(outfile, "wb")
94 - outfile.write(nano2gcryptfirmware(infile.read()))
 94+ outfile.write(s5l8701cryptfirmware(infile.read()))
9595 infile.close()
9696 outfile.close()
9797
9898
99 -def nano2gdecryptfirmwarefile(infile, outfile):
 99+def s5l8701decryptfirmwarefile(infile, outfile):
100100 infile = open(infile, "rb")
101101 outfile = open(outfile, "wb")
102 - outfile.write(nano2gdecryptfirmware(infile.read()))
 102+ outfile.write(s5l8701decryptfirmware(infile.read()))
103103 infile.close()
104104 outfile.close()
Index: embios/trunk/loader/ipodnano2g/Makefile
@@ -8,7 +8,7 @@
99 LD := $(CROSS)ld
1010 OBJCOPY := $(CROSS)objcopy
1111 UCLPACK := ucl2e10singleblk
12 -CRYPTDFU := python $(EMBIOSDIR)/tools/ipodcrypt.py nano2g-cryptdfu
 12+CRYPTDFU := python $(EMBIOSDIR)/tools/ipodcrypt.py s5l8701-cryptdfu
1313
1414 CFLAGS += -Os -fno-pie -fno-stack-protector -fomit-frame-pointer -I. -ffunction-sections -fdata-sections -mcpu=arm940t
1515 LDFLAGS += "$(shell $(CC) -print-libgcc-file-name)" --gc-sections