forked from rampageX/firmware-mod-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
creating_ipkg_packages.htm
152 lines (147 loc) · 6.56 KB
/
creating_ipkg_packages.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Creating IPKs</title>
</head>
<body>
<p><b><font size="5">IPK Creation Kit</font><br>
</b>(c)2006 Jeremy Collake <<a href="mailto:[email protected]">[email protected]</a>><br>
<br>
<font color="#FF0000">!!! <b>ALPHA STAGE OF DEVELOPMENT. MAY NOT WORK AND HAVE
MANY PROBLEMS</b> !!!</font></p>
<p>This document attempts to outline the process of creation of IPKG format
packages with the IPK Creation Kit, giving specific emphasis on usage for
embedded linux platforms such as <a href="http://www.openwrt.org">OpenWrt</a>
and <a href="http://www.dd-wrt.com">DD-WRT</a>. It is a quick draft intended to
encourage people to develop IPKs specific to certain firmwares for use with the
<a href="http://www.bitsum.com/firmware_mod_kit.htm">Firmware Modification Kit</a>,
a kit that allows easy modification of firmware images without recompiling the
sources.</p>
<p><b><font size="4">The structure of an IPK</font></b></p>
<p>IPK files are <b><i>archives</i></b> containing the following:</p>
<ul>
<li><u><b>data.tar.gz</b></u> : contains data.tar:<ul>
<li><u><b>data.tar</b></u> : These are the files that will be installed
to, or removed from, the file system. They are in their correct
locations in the directory tree starting at the root of the firmware
file system. For example:<ul>
<li><font face="Courier"><b>./</b>usr/sbin/package<br>
./tmp/package_config<br>
./etc/package_config <i>-> symbolic link</i> -> ../tmp/config_folder<br>
./tmp/package_config/package.conf<br>
NOTE: </font><i>the "." directory must be included in the path names</i></li>
</ul>
</li>
</ul>
</li>
<li><b><u>control.tar.gz</u> </b>: contains control.tar:<ul>
<li><u><b>control.tar</b></u> : These are files which give information
about the package. For examples, it's name, version, and dependencies.<ul>
<li>./control : describes the package</li>
<li>./conffiles : indicates which files in the package are used for
config files once installed</li>
</ul>
</li>
</ul>
</li>
<li><b><u>debian_binary</u> </b>: the reason this exists is unknown. It's
perhaps some platform or format indicator. It is a text file that consists
of "2.0". </li>
</ul>
<p> </p>
<p><b><font size="4">Using the IPK template</font></b></p>
<p>The IPK template directory contained in the Firmware Modification Kit makes
it particularly easy to create IPK files without having to manually create them
each time.</p>
<p><b><font size="4">Creating your own IPK</font></b></p>
<blockquote>
<p><b><font size="4">Step 1</font></b></p>
<p>Copy or extract the IPK template directory to a new directory named after
the package you are creating an IPK for. If you are copying, use "cp -r" to
copy the entire directory and all its contents.</p>
<p><b><font size="4">Step 2</font></b></p>
<p>In the new directory edit the "<i>control</i>" and "<i>conffiles</i>"
text files appropriately. The fields in "control" are probably
self-explanatory:</p>
<p><i><b>control:</b></i></p>
<table border="0" width="100%" bgcolor="#FFFFCC" id="table5">
<tr>
<td><br>
<font face="Courier">Package: somepackage<br>
Priority: optional<br>
Depends: libpcap libncurses<br>
Section: net<br>
Description: A minimal and secure package of great sorts.<br>
Maintainer: Junior Jim-Bob <juniorjim.bob.com><br>
Source: N/A<br>
Version: 2.61-1<br>
Architecture: mipsel<br>
</font></td>
</tr>
</table>
<p>If you want to get fancy, the<i> Source</i> field can indicate a URL to
download the data.tar.gz portion of the package. If instead the package
files are included inside the PKG, leave "N/A" in this field.</p>
<p>"conffiles" contains a listing of files in the package that are used for
configuration storage. This is helpful to preserve the configuration of the
package if it is updated, or if the configuration otherwise needs
preserving. It might look something like this after editing:</p>
<p><i><b>conffiles:</b></i></p>
<table border="0" width="100%" bgcolor="#FFFFCC" id="table6">
<tr>
<td><br>
<font face="Courier">/etc/package_config/package.conf<br>
/etc/package_config/moreconfig.conf<br>
</font></td>
</tr>
</table>
<p><b><font size="4">Step 3</font></b></p>
<p>Copy the package files into the folder in the same relative directories
to which they will be installed to the file system. Symbolic links are
allowed. For example:</p>
<table border="0" width="100%" bgcolor="#FFFFCC" id="table7">
<tr>
<td><br>
<font face="Courier">./usr/sbin/mypackage<br>
./tmp/etc/package_config/<br>
./etc/package_config/ ---(symbolic link)--->
../tmp/etc/package_config/<br>
./tmp/etc/package_config/moreconfig.conf<br>
</font></td>
</tr>
</table>
<p>The above makes the /etc/package_config/ directory a symbolic link to
/tmp/package_config/. This would be useful for firmwares that have a
read-only /etc file system. On these systems, the configuration files could
reside on a ram disk and be emitted at boot-time based on input from some
other store of configuration variables, like NVRAM.</p>
<p><b><font size="4">Step 4:</font></b></p>
<p>Build the IPK. You're done, now simply build the IPK file with the script
provided. It's parameters are:</p>
<p>MAKE_IPK.SH OUTPUT_PACKAGE_IPK IPK_BASE_DIRECTORY</p>
<p><i><b>OUTPUT_PACKAGE_IPK</b> </i>: The IPK file to output. If it already
exists it will be over-written.<br>
<i><b>IPK_BASE_DIRECTORY</b> </i>: The directory you created in step 1 and
have been working with up until now.</p>
<p>Example:</p>
<table border="0" width="100%" bgcolor="#FFFFCC" id="table8">
<tr>
<td><br>
<font face="Courier">make_ipk.sh package.ipk ../package_ipk_dir<br>
</font></td>
</tr>
</table>
<p> </p>
</blockquote>
<p>To support this project:</p>
<p>
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"></p>
<p> </p>
<p><font size="2">This document (c)2006 Jeremy Collake. <br>
All Rights reserved. This document may be freely republished in its unaltered
and whole form only. Alterations or partial publishing requires approval of
Jeremy Collake <<a href="mailto:[email protected]">[email protected]</a>>.</font></p>
</body>
</html>