freemyipod r161 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r160‎ | r161 | r162 >
Date:17:12, 18 August 2010
Author:theseven
Status:new
Tags:
Comment:
Add boot stub prepending tool
Modified paths:
  • /apps/installer-nano2g/Makefile (modified) (history)
  • /apps/installer-nano2g/tools/stubembed.py (added) (history)

Diff [purge]

Index: apps/installer-nano2g/tools/stubembed.py
@@ -0,0 +1,38 @@
 2+#!/usr/bin/env python
 3+#
 4+#
 5+# Copyright 2010 TheSeven
 6+#
 7+#
 8+# This file is part of emBIOS.
 9+#
 10+# emBIOS is free software: you can redistribute it and/or
 11+# modify it under the terms of the GNU General Public License as
 12+# published by the Free Software Foundation, either version 2 of the
 13+# License, or (at your option) any later version.
 14+#
 15+# emBIOS is distributed in the hope that it will be useful,
 16+# but WITHOUT ANY WARRANTY; without even the implied warranty of
 17+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 18+# See the GNU General Public License for more details.
 19+#
 20+# You should have received a copy of the GNU General Public License along
 21+# with emBIOS. If not, see <http://www.gnu.org/licenses/>.
 22+#
 23+#
 24+
 25+
 26+import sys
 27+import struct
 28+
 29+file = open(sys.argv[1], "rb")
 30+stub = file.read()
 31+file.close()
 32+
 33+file = open(sys.argv[2], "rb")
 34+payload = file.read()
 35+file.close()
 36+
 37+file = open(sys.argv[3], "wb")
 38+file.write(stub + struct.pack("<I", len(payload)) + payload)
 39+file.close()
Index: apps/installer-nano2g/Makefile
@@ -64,7 +64,7 @@
6565 @$(EMBIOSEMBEDAPP) $^ $@ --run-from=08000000
6666
6767 build/$(NAME).embiosapp: build/$(NAME).plain.embiosapp $(BITMAPS)
68 - @echo [GENINS] $<
 68+ @echo [GENINS] $<
6969 @$(GENINSTALLER) $< $@
7070
7171 build/bootstub.bin: build/bootstub.elf