⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 package.distrib.html

📁 有关ecos2。0介绍了实时嵌入式的结构以及线程调度的实现和内存的管理等
💻 HTML
字号:
<!-- Copyright (C) 2003 Red Hat, Inc.                                --><!-- This material may be distributed only subject to the terms      --><!-- and conditions set forth in the Open Publication License, v1.0  --><!-- or later (the latest version is presently available at          --><!-- http://www.opencontent.org/openpub/).                           --><!-- Distribution of the work or derivative of the work in any       --><!-- standard (paper) book form is prohibited unless prior           --><!-- permission is obtained from the copyright holder.               --><HTML><HEAD><TITLE>Making a Package Distribution</TITLE><meta name="MSSmartTagsPreventParsing" content="TRUE"><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="The eCos Component Writer's Guide"HREF="cdl-guide.html"><LINKREL="UP"TITLE="Package Organization"HREF="package.html"><LINKREL="PREVIOUS"TITLE="Package Contents and Layout"HREF="package.contents.html"><LINKREL="NEXT"TITLE="The CDL Language"HREF="language.html"></HEAD><BODYCLASS="SECT1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">The <SPANCLASS="APPLICATION">eCos</SPAN> Component Writer's Guide</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="package.contents.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 2. Package Organization</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="language.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="PACKAGE.DISTRIB">Making a Package Distribution</H1><P>Developers of new <SPANCLASS="APPLICATION">eCos</SPAN> packages are advised to distribute theirpackages in the form of <SPANCLASS="APPLICATION">eCos</SPAN> package distribution files. Packagesdistributed in this format may be added to existing <SPANCLASS="APPLICATION">eCos</SPAN> componentrepositories in a robust manner using the Package Administration Tool.This chapter describes the format of package distribution files anddetails how to prepare an eCos package for distribution in this format.</P><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="PACKAGE.DISTRIB.FORMAT">The <SPANCLASS="APPLICATION">eCos</SPAN> package distribution file format</H2><P>eCos package distribution files are gzipped GNU tar archives whichcontain both the source code for one or more <SPANCLASS="APPLICATION">eCos</SPAN> packages and adata file containing package information to be added to the componentrepository database. The distribution files are subject to thefollowing rules:</P><P></P><OLTYPE="a"><LI><P>The data file must be named <TTCLASS="FILENAME">pkgadd.db</TT> and must belocated in the root of the tar archive. It must contain data in aformat suitable for appending to the eCos repository database(<SPANCLASS="DATABASE">ecos.db</SPAN>). <AHREF="language.database.html">the Section called <I>Updating the <SPANCLASS="DATABASE">ecos.db</SPAN> database</I> in Chapter 3</A>describes this data format. Note that a database consistency check isperformed by the <SPANCLASS="APPLICATION">eCos</SPAN> Administration Tool when<TTCLASS="FILENAME">pkgadd.db</TT> has been appended to the database. Anynew target entries which refer to unknown packages will be removed atthis stage.</P></LI><LI><P>The package source code must be placed in one or more <TTCLASS="FILENAME">&lt;package-path&gt;/&lt;version&gt;</TT>directories in the tar archive, where each &lt;package-path&gt;directory path is specified as the directory attribute of one of thepackages entries in <TTCLASS="FILENAME">pkgadd.db</TT>.</P></LI><LI><P>An optional license agreement file named<TTCLASS="FILENAME">pkgadd.txt</TT> may be placed in the root of the tararchive. It should contain text with a maximum line length of 79characters. If this file exists, the contents will be presented to theuser during installation of the package. The <SPANCLASS="APPLICATION">eCos</SPAN> PackageAdministration Tool will then prompt the user with the question<TTCLASS="PROMPT">"Do you accept all the terms of the preceding licenseagreement?"</TT>. The user must respond<TTCLASS="USERINPUT"><B>"yes"</B></TT> to this prompt in order to proceed withthe installation.</P></LI><LI><P>Optional template files may be placed in one or more <TTCLASS="FILENAME">templates/&lt;template_name&gt;</TT>directories in the tar archive. Note that such template files would beappropriate only where the packages to be distributed have a complexdependency relationship with other packages. Typically, a third partypackage can be simply added to an eCos configuration based on anexisting core template and the provision of new templates would not beappropriate. <AHREF="advanced.html#ADVANCED.TEMPLATES">the Section called <I>Templates</I> in Chapter 6</A> contains moreinformation on templates.</P></LI><LI><P>The distribution file must be given a <TTCLASS="FILENAME">.epk</TT> (not<TTCLASS="FILENAME">.tar.gz</TT>) file extension. The<TTCLASS="FILENAME">.epk</TT> file extension serves to distinguish <SPANCLASS="APPLICATION">eCos</SPAN>package distributions files from generic gzipped GNU tar archives. Italso discourages users from attempting to extract the package from thearchive manually. The file browsing dialog of the <SPANCLASS="APPLICATION">eCos</SPAN> PackageAdministration Tool lists only those files which have a<TTCLASS="FILENAME">.epk</TT> extension.</P></LI><LI><P>No other files should be present in the archive.</P></LI><LI><P>Files in the tar archive may use <TTCLASS="LITERAL">LF</TT> or<TTCLASS="LITERAL">CRLF</TT> line endings interchangably. The <SPANCLASS="APPLICATION">eCos</SPAN>Administration Tool ensures that the installed files are given theappropriate host-specific line endings.</P></LI><LI><P>Binary files may be placed in the archive, but the distribution ofobject code is not recommended. All binary files must be given a<TTCLASS="LITERAL">.bin</TT> suffix in addition to any file extension theymay already have. For example, the GIF image file<TTCLASS="FILENAME">myfile.gif</TT> must be named<TTCLASS="FILENAME">myfile.gif.bin</TT> in the archive. The<TTCLASS="FILENAME">.bin</TT> suffix is removed during file extraction andis used to inhibit the manipulation of line endings by the <SPANCLASS="APPLICATION">eCos</SPAN>Administration Tool.</P></LI></OL></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="PACKAGE.DISTRIB.PREPARE">Preparing eCos packages for distribution</H2><P>Development of new <SPANCLASS="APPLICATION">eCos</SPAN> packages or new versions of existing <SPANCLASS="APPLICATION">eCos</SPAN>packages will take place in the context of an existing <SPANCLASS="APPLICATION">eCos</SPAN>component repository. This section details the steps involved inextracting new packages from a repository and generating acorresponding <SPANCLASS="APPLICATION">eCos</SPAN> package distribution file for distribution of thepackages to other <SPANCLASS="APPLICATION">eCos</SPAN> users. The steps required are as follows:</P><P></P><OLTYPE="a"><LI><P>Create a temporary directory <TTCLASS="FILENAME">$PKGTMP</TT> for manipulation of the packagedistribution file contents and copy the source files of the newpackages into this directory, preserving the relative path to thepackage. In the case of a new package at <TTCLASS="FILENAME">mypkg/current</TT> in the repository:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">    $ mkdir -p $PKGTMP/mypkg    $ cp -p -R $ECOS_REPOSITORY/mypkg/current $PKGTMP/mypkg</PRE></TD></TR></TABLE><P>Where more than one package is to be distributed in a single packagedistribution file, copy each package in the above manner. Note thatmultiple packages distributed in a single package distribution filecannot be installed separately. Where such flexibility is required,distribution of each new package in separate package distribution filesis recommended.</P></LI><LI><P>Copy any template files associated with the distributed packages intothe temporary directory, preserving the relative path to the template.For example:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">    $ mkdir -p $PKGTMP/templates    $ cp -p -R $ECOS_REPOSITORY/templates/mytemplate $PKGTMP/templates</PRE></TD></TR></TABLE></LI><LI><P>Remove any files from the temporary directory hierarchy which you donot want to distribute with the packages (eg object files, <TTCLASS="FILENAME">CVS</TT> directories).</P></LI><LI><P>Add a <TTCLASS="FILENAME">.bin</TT> suffix to the name of any binaryfiles. For example, if the packages contains GIF image files (*.gif)for documentation purposes, such files must be renamed to *.gif.bin asfollows:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">   $ find $PKGTMP -type f -name '*.gif' -exec mv {} {}.bin ';'</PRE></TD></TR></TABLE><P>The <TTCLASS="FILENAME">.bin</TT> suffix is removed during file extractionand is used to inhibit the manipulation of line endings by the eCosPackage Administration Tool.</P></LI><LI><P>Extract the package records for the new packages from the packagedatabase file at <SPANCLASS="DATABASE">$ECOS_REPOSITORY/ecos.db</SPAN> andcreate a new file containing these records at<TTCLASS="FILENAME">$PKGTMP/pkgadd.db</TT> (in the root of the temporarydirectory hierarchy). Any target records which reference thedistributed packages must also be provided in pkgadd.db.</P></LI><LI><P>Rename the version directories under <TTCLASS="FILENAME">$PKGTMP</TT> (typically <TTCLASS="FILENAME">current</TT> during development) to reflectthe versions of the packages you are distributing. For example,version 1.0 of a package may use the version directory name <TTCLASS="FILENAME">v1_0</TT>:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">    $ cd $PKGTMP/mypkg    $ mv current v1_0</PRE></TD></TR></TABLE><P><AHREF="package.versions.html">the Section called <I>Package Versioning</I></A> describes the version namingconventions.</P></LI><LI><P>Rename any template files under <TTCLASS="FILENAME">$PKGTMP</TT> (typically<TTCLASS="FILENAME">current.ect</TT> during development) to reflect theversion of the template you are distributing. For example, version 1.0of a template may use the filename <TTCLASS="FILENAME">v1_0.ect</TT>:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">    $ cd $PKGTMP/templates/mytemplate    $ mv current.ect v1_0.ect</PRE></TD></TR></TABLE><P>It is also important to edit the contents of the template file, changingthe version of each referenced package to match that of the packages youare distributing. This step will eliminate version warnings during thesubsequent loading of the template.</P></LI><LI><P>Optionally create a licence agreement file at<TTCLASS="FILENAME">$PKGTMP/pkgadd.txt</TT> containing the licensing termsunder which you are distributing the new packages. Limit each line inthis file to a maximum of 79 characters.</P></LI><LI><P>Create a GNU tar archive of the temporary directory hierarchy. Byconvention, this archive would have a name of the form<TTCLASS="FILENAME">&lt;package_name&gt;-&lt;version&gt;</TT>:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">    $ cd $PKGTMP    $ tar cf mypkg-1.0.tar *</PRE></TD></TR></TABLE><P>Note that non-GNU version of tar may create archive files which exhibitsubtle incompatibilities with GNU tar. For this reason, always use GNUtar to create the archive file.</P></LI><LI><P>Compress the archive using gzip and give the resulting file a<TTCLASS="FILENAME">.epk</TT> file extension:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">    $ gzip mypkg-1.0.tar    $ mv mypkg-1.0.tar.gz mypkg-1.0.epk</PRE></TD></TR></TABLE><P>The resulting eCos package distribution file (*.epk) is in a compressedformat and may be distributed without further compression.</P></LI></OL></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="package.contents.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="cdl-guide.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="language.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Package Contents and Layout</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="package.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">The CDL Language</TD></TR></TABLE></DIV></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -