mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-03-06 06:14:47 +00:00
Added some notes how to create dependency lists
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3026 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
parent
33c5bad7fa
commit
2bd9e124ab
54
chapter02/aboutdependencies.xml
Normal file
54
chapter02/aboutdependencies.xml
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
<sect1 id="ch02-aboutdependencies">
|
||||||
|
<title>About dependencies</title>
|
||||||
|
<?dbhtml filename="aboutdependencies.html" dir="chapter02"?>
|
||||||
|
|
||||||
|
<para>There are a few ways to compile a list of a package's installation
|
||||||
|
dependencies. What we consider the best way is using the
|
||||||
|
<command>strace</command> program available at <ulink
|
||||||
|
url="http://www.wi.leidenuniv.nl/~wichert/strace/"/>.</para>
|
||||||
|
|
||||||
|
<para><command>strace</command> is a program that provides a trace of all
|
||||||
|
system calls made by another program. One of the most useful system calls
|
||||||
|
to trace when figuring out dependencies is the <emphasis>execve(2)</emphasis>
|
||||||
|
system call, which is used to execute programs (see its man page for
|
||||||
|
all the details). Whenever you run a program, be it from a shell or via a
|
||||||
|
configure script or Makefile file, the execve call is made. If you trace
|
||||||
|
these calls, you will know what programs were executed behind the
|
||||||
|
scenes.</para>
|
||||||
|
|
||||||
|
<para>Here is a line of output from running a configure script:</para>
|
||||||
|
|
||||||
|
<screen>19580 execve("/bin/rm", ["rm", "-f", "conf19538", "conf19538.exe", "conf19538.file"], [/* 26 vars */]) = 0</screen>
|
||||||
|
|
||||||
|
<para>This line tells us that the <command>/bin/rm</command> program was
|
||||||
|
run with a PID of 19580, which command line parameters it was given (rm -f
|
||||||
|
conf195838 conf19538.exe conf19538.file) and its exit value (0).</para>
|
||||||
|
|
||||||
|
<para>For dependency purposes all we care about is that
|
||||||
|
<command>/bin/rm</command> was run during the configure script, so this is
|
||||||
|
an installation dependency. Without <command>rm</command>, the script
|
||||||
|
wouldn't be able to run properly.</para>
|
||||||
|
|
||||||
|
<para>Unfortunately, this method is not foolproof. Configure scripts check
|
||||||
|
for the presense of many programs, but not all of them are considered real
|
||||||
|
dependencies. For instance, configure scripts may check for the presence of
|
||||||
|
the <command>autoconf</command> program. It will be listed in the strace
|
||||||
|
output, but it's not a real installation dependency. A package will in most
|
||||||
|
if not all cases install just fine without that program. There are other
|
||||||
|
such false positives.</para>
|
||||||
|
|
||||||
|
<para>This means automatic dependency gathering is never accurate. You will
|
||||||
|
always need to validate the list and figure out the false positives. In
|
||||||
|
some (rare) cases autoconf might be a real dependency, so you
|
||||||
|
can't simply ignore all autoconf entries. A manual validation really is a
|
||||||
|
requirement for an accurate list.</para>
|
||||||
|
|
||||||
|
<para>This book is not as verbose to list exactly which program from which
|
||||||
|
package is required for a successfull installation (we used to, but it had
|
||||||
|
become too much work to maintain it). The book will contain simply the
|
||||||
|
names of packages you need to have installed. If you need the verbosity
|
||||||
|
in the form of "package a needs file b and c from package d", have a look
|
||||||
|
at <enter URL when it's available>.</para>
|
||||||
|
|
||||||
|
</sect1>
|
||||||
|
|
@ -5,6 +5,7 @@
|
|||||||
&c2-aboutlfs;
|
&c2-aboutlfs;
|
||||||
&c2-aboutsbus;
|
&c2-aboutsbus;
|
||||||
&c2-abouttestsuites;
|
&c2-abouttestsuites;
|
||||||
|
&c2-aboutdependencies;
|
||||||
&c2-askforhelp;
|
&c2-askforhelp;
|
||||||
|
|
||||||
</chapter>
|
</chapter>
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
<!ENTITY c2-aboutlfs SYSTEM "../chapter02/aboutlfs.xml">
|
<!ENTITY c2-aboutlfs SYSTEM "../chapter02/aboutlfs.xml">
|
||||||
<!ENTITY c2-aboutsbus SYSTEM "../chapter02/aboutsbus.xml">
|
<!ENTITY c2-aboutsbus SYSTEM "../chapter02/aboutsbus.xml">
|
||||||
<!ENTITY c2-abouttestsuites SYSTEM "../chapter02/abouttestsuites.xml">
|
<!ENTITY c2-abouttestsuites SYSTEM "../chapter02/abouttestsuites.xml">
|
||||||
|
<!ENTITY c2-aboutdependencies SYSTEM "../chapter02/aboutdependencies.xml">
|
||||||
<!ENTITY c2-askforhelp SYSTEM "../chapter02/askforhelp.xml">
|
<!ENTITY c2-askforhelp SYSTEM "../chapter02/askforhelp.xml">
|
||||||
|
|
||||||
<!ENTITY chapter03 SYSTEM "../chapter03/chapter03.xml">
|
<!ENTITY chapter03 SYSTEM "../chapter03/chapter03.xml">
|
||||||
|
Loading…
Reference in New Issue
Block a user