Remove lfs-uefi.txt symlink
[linux_from_scratch_hints.git] / PREVIOUS_FORMAT / install-log.txt
blobd4375a5e335c510604378a2e0a9266b201f8f45b
1 TITLE           install-log
2 LFS VERSION:    4.0 and newer
3 AUTHOR:         Andy Goth <unununium@openverse.com>
5 SYNOPSIS:
6         How to manage packages with install-log
8 HINT:
9 Version 1.0: 2001-12-17: First release.
10 Version 1.1: 2002-08-13: Corrections and updates for recent lfs books.
11 Version 1.2: 2002-10-20: Updates regarding new developments in install-log.
13 The latest version of this file should be at:
15 http://ioioio.net/devel/install-log/install-log/LFS-HINT
17 And it should be mirrored at:
19 http://hints.linuxfromscratch.org/hints/install-log.txt
21 This hint covers install-log, a simple package management tool.  It discusses
22 how to set up install-log, how to use it to make installation logs, and how to
23 use those logs for package management.  It also discusses how to use
24 install-log during all stages of lfs installation.
26 This version of the hint discusses install-log 1.9, and the general ideas
27 should apply to any version of lfs.  In fact, much of it isn't even lfs-
28 specific but useful for any UNIX system that doesn't already have suitable
29 package management.
31 +-----------------------------+
32   1. INSTALL-LOG INSTALLATION
33 +-----------------------------+
35 First, get install-log at one of the following mirrors:
37 http://prdownloads.sourceforge.net/install-log/install-log-1.9.tar.bz2
38 http://install-log.sourceforge.net/release/install-log-1.9.tar.bz2
39 http://ioioio.net/devel/install-log/install-log-1.9.tar.bz2
40 http://www.pengaru.com/~andy/packages/install-log-1.9.tar.bz2
42 The tarball is 10k in size, just like this hint. ;^)
44 Or, you can get the very latest code using one of the following:
46 http://ioioio.net/devel/install-log/install-log-cvs.tar.bz2
47 $ cvs -d:pserver:anonymous@ioioio.net:/var/lib/cvs/install-log co install-log
48 http://users.openverse.com/cgi-bin/viewcvs/install-log/install-log/
50 Then unpack, compile, and install:
52 make &&
53 cp install-log /usr/bin &&
54 cp install-log.1 /usr/share/man/man1 &&
55 cp install-log.rc /etc &&
56 mkdir /var/install-logs &&
57 touch /var/install-logs/.timestamp
59 And we're golden.  Note that the 1.9 makefile has no "install" target.  Also it
60 produces a couple scary-looking error messages the first time you compile.
61 Ignore them.
63 You can test install-log out right away by using this variant of the above:
65 make &&
66 cp install-log /usr/bin &&
67 cp install-log.1 /usr/share/man/man1 &&
68 cp install-log.rc /etc &&
69 mkdir /var/install-logs &&
70 touch -r . /var/install-logs/.timestamp && 
71 install-log install-log -E cat -e
73 Instead of merely creating the .timestamp file, this sets its, err, timestamp
74 to equal that of the install-log-1.9 source tree, which should be older than
75 the just-installed install-log program but newer than everything else on the
76 system.  It then runs install-log to take note of its own installation.  Wow.
77 It also cats the log to verify its contents, which should be:
79 /usr/bin/install-log
80 /usr/share/man/man1/install-log.1
82 This is as you'd expect, except that install-log.rc doesn't show up.  This is
83 because, by default, install-log doesn't scan the /etc directory.
85 I fixed the silly makefile problem (no install target) in versions beyond the
86 (ancient) 1.9, so you can skip all the above and instead type make install.  It
87 should even do all the compilation and then make /var/install-logs/install-log!
89 I recommend editing your install-log.rc right away and shaping it to match your
90 site.  For instance, if you don't use /usr/local, remove it from the file.
91 Add /usr/etc and /usr/var to EXCLUDE (install-log is not meant to track
92 configuration and state files, only binaries and support files that don't get
93 touched beyond the initial installation).  I strongly recommend that you add
94 /usr/share/info/dir to the EXCLUDE list; otherwise, /usr/share/info/dir will
95 appear to belong to every package that has an info page.
97 Some of the above changes are already incorporated into the install-log.rc and
98 the compiled-in install-log defaults in versions newer than 1.9.
100 +---------------------------+
101   2. INSTALLING OTHER STUFF
102 +---------------------------+
104 This part is easy.  Just install said stuff like normal, and then run
105 install-log, thusly:
107 tar xjvf msword.tar.bz2 && cd msword && make install && cd .. && rm -rf msword
108 install-log msword
110 There you go.  Now, /var/install-logs/msword contains a list of every file
111 added or modified by the installation of msword.  Go ahead and cat it, vim it,
112 or whatever.
114 And now that you're familiar with install-log, let's put it to good use:
116 +--------------------+
117   3. INSTALLING LFS
118 +--------------------+
120 install-log descends from a little script Gerard Beekmans suggested long ago,
121 so its no surprise that it's specially designed for lfs.  It can track your
122 installation through every phase in the book.  But first, have install-log
123 ready on your system.
125 This part of the hint used to be much more complicated, but since the lfs book
126 started using a /static directory, things became far simpler.
128 ---------
129 Chapter 5
130 ---------
132 Don't worry about tracking your files during chapter 5--the /static directory
133 is an unruly place, and you will either remove it soon, forget all about it, or
134 keep it for emergencies.  Chapter 6, though, is where tracking first comes into
135 play, but install-log needs to be available ahead of time.
137 At the end of chapter 5, install install-log itself to ${LFS}/static:
139 make CFLAGS="${CFLAGS} -static" &&
140 cp install-log ${LFS}/static/bin &&
141 ([ -d ${LFS}/etc ] || mkdir ${LFS}/etc) &&
142 cp install-log.rc ${LFS}/etc &&
143 ([ -d ${LFS}/var ] || mkdir ${LFS}/var) &&
144 mkdir ${LFS}/var/install-logs &&
145 touch ${LFS}/var/install-logs/.timestamp
147 Take this opportunity to edit /etc/install-log.rc.
149 ---------
150 Chapter 6
151 ---------
153 In chapter 6 (inside the chroot), after each installation, call install-log:
155 install-log bash
156 install-log ncurses
157 install-log glibc
158 etc.
160 If you for some reason skipped installing install-log in chapter 5, you can run
161 install-log outside of the chroot but with the LFS variable set.  install-log
162 will pretend to be inside a chroot based at ${LFS}--it'll even use
163 ${LFS}/etc/install-log.rc for configuration.
165 Eventually, install install-log according to the instructions given in section
166 1 above.  Skip the installation of the install-log.rc and .timestamp files, as
167 they have already been created.
169 +-----------------------+
170   4. UNINSTALLING STUFF
171 +-----------------------+
173 xargs rm < /var/install-logs/packagename &&
174 rm /var/install-logs/packagename
178 +--------------------+
179   5. UPGRADING STUFF
180 +--------------------+
182 install-log can handle installing a package more than once.  Do everything like
183 you would normally do, except supply the -f flag to install-log:
185 tar xjvf msword.tar.bz2 && cd msword && make install && cd .. && rm -rf msword
186 install-log -f msword
188 If you've already logged a package, install-log won't run on it again without
189 the -f flag.  When install-log does run, it will scan your filesystem, as
190 normal, but it will also compare its results with the previous results.  Every
191 file in the old list that didn't turn up new in the new list is either marked
192 "# Old #" or "# Del #".
194 Old files are probably safe to delete, because when you reinstalled the package
195 it didn't touch them.  Del files are already gone, so just shave them out of
196 the log using sed or another text editor.  They're there to alert you of a
197 possible problem.
199 Note that state files, configuration files, and other files that change
200 throughout the life of the program should never have been logged, and therefore
201 you will have to keep track of them on your own (does msword need ~/.mswordrc
202 anymore, or does it now use a win95 registry stored on a file mounted -tvfat
203 -oloop?).
205 +------------+
206   6. CAVEATS
207 +------------+
209 install-log is a very simple and naive utility designed for little more than
210 creating lists of new and modified files.  As such, it can't handle things that
211 continually change, like configuration files.  It also can't handle files
212 shared between packages, like /usr/share/info/dir or a BSD-style init file.  It
213 can't handle packages that install files with any timestamp other than "right
214 now".  Sometimes you need to tweak its output a little bit, by touching the
215 installed files, aging /var/install-logs/.timestamp, and/or editing the
216 resultant log.  And you had better be sure of your dependencies before you
217 xargs rm something.
219 But nine times out of eight, it works.
221 +-----------------+
222   7. FUTURE PLANS
223 +-----------------+
225 These won't get implemented unless I run out of other projects or people
226 express interest and contribute their time.  But I'd like to make a 2.0 release
227 including a greatly expanded /var/install-logs directory, giving an actual
228 history of installations and removals, md5 sums, dependencies, installation,
229 upgrade, and uninstallation scripts, download urls, package information, and
230 about everything else you'd expect in a full-blown package tool.  It'll also
231 have builtin functions for installation, upgrading, uninstallation, querying,
232 verifying, and downloading updates.  You'll be able to ask it to check the
233 files on disk against the md5 sums and issue warnings on discrepancies.  You'll
234 be able to ask it to get the latest of something and, assuming that it (or you)
235 can find where to download or how to install, it'll... install.  I think this
236 thing has potential, but I also think it has a lazy maintainer. ;^)
238 I have also been toying with the notion of merging in some ides from the
239 Matthias S. Benkmann's more_control_and_pkg_man.txt hint.  I previously melted
240 down everything in the hint and poured it into an all-in-one shell script.
241 Maybe I'll merge that with install-log when I do the above.  Other ideas
242 include taking advantage of the alfs project and setting up an online database
243 of scripts and stuff for install-log to make use of.