Get rid of /etc/network/if-up.d/aoe-discover
[grml-live.git] / docs / grml-live-db.txt
1 grml-live-db(8)
2 ===============
3
4 Name
5 ----
6 grml-live-db - log package build information of grml-live to database
7
8 Synopsis
9 --------
10 dpkg-to-db  [ options ] || db-to-fai /path/to/grml-live.db <build-id>
11
12 Introduction
13 ------------
14
15 The grml-live-db Debian package provides a simple way to put build information
16 of grml-live into a database. By default you have to do nothing but install
17 grml-live-db and during each invocation of grml-live you'll get an additional
18 entry in the sqlite3 database /var/log/grml-live.db. If you want to customize
19 the database logging check out the following sections in this manpage.
20
21 Provided scripts
22 ----------------
23
24 /usr/share/grml-live-db/scripts/dpkg-to-db adds grml-live build information
25 (output of 'dpkg --list') and a logfile into a sqlite3 database.  This script is
26 used by default if grml-live-db is installed (no configuration needed by
27 default).
28
29 /usr/share/grml-live-db/scripts/db-to-fai converts output of grml-live's sqlite
30 database for use within FAI. This script is useful if you want to reproduce a
31 certain build with specific package versions. Please note that you need the
32 according Debian mirrors providing all the specific package versions of course.
33
34 Options
35 -------
36
37 dpkg-to-db supports the following options (and all except for --help
38 are mandatory!):
39
40   --help
41
42 Print help message and exit.
43
44   --database <database>
45
46 Use specified database file.
47
48   --dpkg <dpkgfile>
49
50 Use specified dpkgfile as `dpkg --list` output file of grml-live build.
51
52   --logfile <logfile>
53
54 Logfile thath should be added to the database entry.
55
56   --flavour <flavour>
57
58 Name of the grml-live flavour that was being built.
59
60 The db-to-fai script does not support any options but needs to be invoked with
61 path to the grml-live database and the build id.
62
63 Configuration and using custom database wrapper scripts
64 -------------------------------------------------------
65
66 The following configuration variables are available and can be adjusted:
67
68   DPKG_DATABASE=/var/log/grml-live.db
69
70 Path to the database file that should be used for storing the build information.
71 This database is used within dpkg-to-db by default.
72
73   DPKG_DBSCRIPT=/usr/share/grml-live-db/scripts/dpkg-to-db
74
75 The database wrapper script that's used for storing the build information.
76 If you do not want to log to the sqlite3 database but instead use your own
77 abstraction layer just point this variable to your favourite script.
78
79   DPKG_DBOPTIONS="--database $DPKG_DATABASE --logfile $LOGFILE --flavour $GRML_NAME --dpkg $DPKG_LIST"
80
81 If the database script ($DPKG_DBSCRIPT) requires any command line options
82 specify it through this variable.
83
84 Usage Examples
85 --------------
86
87 How dpkg-to-db is being used inside grml-live:
88
89   /usr/share/grml-live-db/scripts/dpkg-to-db --database /var/log/grml-live.db --logfile /var/log/grml-live.log --flavour $GRML_NAME --dpkg /var/log/fai/$HOSTNAME/last/dpkg.list
90
91 Manually insert data to database:
92
93   # /usr/share/grml-live-db/scripts/dpkg-to-db --database ./grml-live.db --logfile /tmp/logfile --flavour grml-full --dpkg ./dpkg.list
94
95 Retrieve build information of a specific build for use within FAI:
96
97   # /usr/share/grml-live-db/scripts/db-to-fai /var/log/grml-live.db 6 > /etc/grml/fai/config/package_config/REPRODUCE
98
99 Describe schema of database:
100
101   # echo '.schema' | sqlite3 /var/log/grml-live.db
102
103 Database queries:
104
105   # echo 'SELECT package,version,status,build.flavour,build.identifier FROM packages, build WHERE build.identifier = "grml-full-20091213012517" AND packages.build = build.id ; ' | sqlite3 /var/log/grml-live.db
106
107   # echo 'SELECT package,version,status,build.flavour,build.identifier FROM packages, build WHERE build.id = 7 AND packages.build = build.id ; ' | sqlite3 /var/log/grml-live.db