Make fw
From iPodLinux
- The title of this article should be make_fw. The initial letter is capitalized due to technical limitations.
patch_fw, make_fw and make_fw2 are a lineage of programs to modify the firmware file(s) stored on the firmware partition.
It is a command line tool that you can use on Linux, OS X and Windows (provided you have a UNIX-like shell installed, such as MinGW or Cygwin).
It is rumored that there is also a pre-built version you can use in a Windows Command Prompt on the Rockbox installation page, called ipod_fw.exe, but I can't find it.
Contents |
patch_fw (2002-2003)
- Copyright (C) 2002 Bernard Leach, 2003 Steven Lucy
- Author: Bernard Leach
- License:GPL 2+
- Language: C
- SVN Module:
svn co https://ipodlinux.svn.sourceforge.net/svnroot/ipodlinux/legacy/patch_fw
Was originally written in 2002 by Bernard Leach, with big endian support added in 2003 by Steven Lucy.
Download
$ svn co https://ipodlinux.svn.sourceforge.net/svnroot/ipodlinux/legacy/patch_fw
$ cd patch_fw
$ make
Usage
Usage: patch_fw ipod_image new_program Where ipod_image is an image of the iPod firmware and new_program is a valid ARM executable This program is used to patch a program into an image taken From an iPod. The the bootloader table will be updated and the new program copied in.
make_fw (2003)
- Copyright (C) 2002 Bernard Leach, 2003 Steven Lucy, 2003 Daniel Palffy
- Author: Daniel Palffy
- License:GPL 2+
- Description: iPodLinux loader installer
- Language: C
Based on Bernard Leach's patch_fw.c
Download
- Source code -- compile it with gcc make_fw.c -o make_fw
- Prebuilt Mac OS X version (PPC and Intel)
- Prebuilt Windows version
- Prebuilt Linux x86 version
Usage
Basically, it has two modes of operation:
- Extract an image file from the firmware partition (backup) file
- Create a new firmware partition file from a set of separate image files
Here's the usage info it prints (note that while it says patch_fw, it really means make_fw):
Usage: patch_fw [-h]
patch_fw [-v] -o outfile -e img_no fw_file
patch_fw [-v] -g gen [-r rev] -o outfile [-i img_from_-e]* [-l raw_img]* ldr_img
-g: set target ipod generation, valid options are: 1g, 2g, 3g
4g, 5g, scroll, touch, dock, mini, photo, color, nano and video
-e: extract the image at img_no in boot table to outfile
fw_file is an original firmware image
the original firmware has the sw at 0, and a flash updater at 1
-i|-l: create new image to outfile
up to 5 images, any of -i or -l allowed
-i: image extracted with -e, load and entry address preserved
-l: raw image, loaded to 0x28000000, entry at 0x00000000
-r: set master revision to rev (for example 210 for 2.10)
may be needed if newest -e img is not the same as the flash rev
ldr_img is the iPodLinux loader binary.
first image is loaded by default, 2., 3., 4. or 5. loaded if
rew, menu, play or ff is hold while booting
-v: verbose
make_fw2 (2006)
- Copyright (C) 2002 Bernard Leach, 2003 Steven Lucy, 2003 Daniel Palffy, 2006 Joshua Oreman
- Author: Joshua Oreman
- Description: iPodLinux loader installer
- Language: C
- License:GPL 2+, and, in the Windows version:BSD-3
- SVN Module:
svn co https://ipodlinux.svn.sourceforge.net/svnroot/ipodlinux/apps/desktop/installer2
Download
$ svn co https://ipodlinux.svn.sourceforge.net/svnroot/ipodlinux/apps/desktop/installer2
$ cd installer2
$ cc make_fw2.c -o make_fw
Usage
make_fw is a program used to create a bootable iPod image.
It can be used in any of the following modes; you must specify
exactly one mode.
This screen:
make_fw [-h]
List images in a firmware dump:
make_fw -t DUMPFILENAME
Extract an image from a firmware dump:
make_fw -x IMAGENAME DUMPFILENAME
The image will be extracted to IMAGENAME.fw, unless you
specify -o.
Create a firmware dump:
make_fw -c IMAGENAME[=IMAGEFILE] [IMAGENAME[=IMAGEFILE] [...]]
IMAGEFILEs may be either files extracted with -x or raw
binaries. The output will be written to ipodlinux.fw, unless
you specify -o.
Options:
-g <gen> Specify the generation of iPod for which you're creating
the firmware. This is REQUIRED. Valid values include:
1g, 2g, 3g, 4g, 5g (scroll, touch, dock, click, video)
mini, photo, color, nano
You may also specify a raw hw_ver number preceded by `x', or
a raw firmware version number preceded by `v', if you know
what you're doing.
-1 For options where it matters, consider the image as using loader1.
-2 Ditto, for loader2.
-3 Equivalent to `-g v3', for compatibility reasons. (Creates an image
compatible with iPods 4g/mini through 5g/video inclusive.)
-A <file> With -c, put [a]ll images from the dump <file> into the output.
-a <file> Like -A, but treat the osos image like -i does instead of keeping
its name the same.
-b <ldr> For loader1, equivalent to `osos@=<ldr>'; for loader2, `osos=<ldr>'.
-d <id> Ignore the image with ID <id> when using -a, -A, -p, -P, -x, or -t.
This may be specified multiple times.
-i <file> Equivalent to `ososN=<file>', where N starts from 0 and increases
-l <file> with each -i or -l option. Files given with -i are assumed to be
Apple firmware, and with -l are assumed to be Linux kernels.
-m Load all inputs before writing any outputs. You must specify this
option if input and output are the same file. Uses lots of memory.
-n <1>=<2> Rename the image named <2> to <1>. For instance, -n aple=osos1.
Must come after the <2> image has been loaded, or results will be
unpredictable.
-o <file> Specifies where the output should go. If you don't specify this,
a sensible default is used.
-p <file> Equivalent to -m -a <file> -o <file>; [p]atch the image in.
-P <file> Equivalent to -m -A <file> -o <file>.
-r <rev> Specify the revision number, in hex, to use for the top-level images.
Use only if you know what you're doing.
-v Increase the verbosity (chattiness).
-q Decrease the verbosity.
The iPod's firmware partition is organized as a set of `images'; each has
a four-character ID, like `osos' or `aupd' or `rsrc'. Whenever an IMAGENAME
is specified above, it's looking for such an ID. If you put a number after
an ID, it refers to a subimage (Linux or the Apple firmware) used
by ipodloader1. If you put an @ sign after one, it refers to the loader
stub image. (See the examples.)
Examples:
To create a firmware dump using ipodloader1:
./make_fw -1 -g <gen> -c -a ipod.fw -l linux.bin -b loader.bin
The same, but the `long way':
./make_fw -g <gen> -c osos@=loader.bin osos0=ipod.fw:osos osos1=linux.bin