Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 180 lines (110 sloc) 5.583 kB
855cefa @falconindy add the beginnings of a man page
authored
1 =head1 NAME
2
3 geninit - modular initramfs creation utility
4
5 =head1 SYNOPSIS
6
7 Usage: I<geninit> [ options ]
8
9 =head1 DESCRIPTION
10
11 geninit is a tool for creating cpio archives to be used as an initial ramfs
12 during system bootstrap. It features a modular design, making it easy to
13 tailor the image to the system's hardware and software needs.
14
15 =head1 OPTIONS
16
17 =over 4
18
10c1597 @falconindy add missing path parameter to -b
authored
19 =item B<-b> I<PATH>
855cefa @falconindy add the beginnings of a man page
authored
20
cb48ffc @falconindy document public API
authored
21 Specify a base directory other than C</>. This is reserved for usage during a
855cefa @falconindy add the beginnings of a man page
authored
22 chroot. geninit will attempt to use as much as possible from the guest system,
23 drawing only from the host system when necessary.
24
25 =item B<-c> I<FILE>
26
cb48ffc @falconindy document public API
authored
27 Use an alterate config file. Defaults to C</etc/geninit.conf>.
855cefa @falconindy add the beginnings of a man page
authored
28
29 =item B<-g> I<PATH>
30
31 Specify the absolute path of the generated initramfs image. If unspecified,
32 a dry-run will be performed and no image will be created.
33
34 =item B<-H> I<BUILDER>
35
36 Display the help message for a I<builder>. A list of available builders can
37 be generated with the B<-L> option.
38
39 =item B<-h>
40
41 Display the help message and quit.
42
43 =item B<-k> I<KERNEL>
44
45 Specify an alternate kernel version to create an image for. The kernel can be
cb48ffc @falconindy document public API
authored
46 specified as an exact version (such as 2.6.38-ARCH), or provided as a path to
47 the kernel bzImage itself. By default, this is the currently loaded kernel.
855cefa @falconindy add the beginnings of a man page
authored
48
49 =item B<-L>
50
51 List all available builders for use in the I<builders> array in the config
52 file.
53
54 =item B<-p> I<PRESET>
55
56 Specify a preset file to drive image creation. This is any file named with a
cb48ffc @falconindy document public API
authored
57 .preset extension in C</etc/geninit.d>. An example preset file is packaged
855cefa @falconindy add the beginnings of a man page
authored
58 with geninit for explanatory purpose.
59
60 =item B<-S> I<BUILDERS>
61
62 A comma delimited list of builders to skip during image creation.
63
64 =item B<-s>
65
66 Instruct geninit to avoid removal of the temporary workspace after image
67 creation. This is useful for debugging purposes.
68
69 =item B<-t> I<PATH>
70
71 Specify an alterate version to the temporary directory used as a workspace. This
72 needs to be a writeable directory with a minimum of 20mb free.
73
74 =item B<-z> I<COMPRESSION>
75
76 Override the compression method specified by the config file. geninit supports
77 compression via B<gzip>, B<bzip2>, B<lzma>, and B<xz>. You can also use B<none>
78 to disable compression entirely. Please note that your kernel I<must> support
79 your method and choice and your kernel will not be checked for this support! If
80 in doubt, gzip is a safe choice.
81
82 =back
83
cb48ffc @falconindy document public API
authored
84 =head1 EXAMPLES
85
86 =over 4
87
88 =item B<geninit>
89
90 Perform a dry run against the currently loaded kernel. Although a temporary
91 workspace is created, no bootable image is generated from this operation.
92
93 =item B<geninit -k /boot/vmlinuz26 -g /boot/initramfs-ARCH>
94
95 Create an image for the kernel located at C</boot/vmlinuz26> called
96 C</boot/initramfs-ARCH>, described by the default config file.
97
98 =item B<geninit -p kernel26>
99
100 Build an image, or images, as described in C</etc/geninit.d/kernel26.preset>.
101
102 =back
103
104 =head1 BUILDER API
105
106 geninit features a small API intended for usage by authors of builders. These
107 are directory aware functions which error checking and are the preferred method
108 of adding files to the cpio image from builders. If not already created, all
109 functions will add leading path components to files and directories to the
110 image for you. Builders should always be placed in C</usr/share/geninit/builders>.
111
112 =over 4
113
114 =item B<add_binary> I<source> [I<path>]
115
116 Add a binary file, specified by the absolute path to its source. Unless specified,
117 the path on the image will be the same as the source. Files will be scanned for
118 library dependencies which will also be added to the image.
119
120 =item B<add_dir> I<path> [I<mode>]
121
122 Add a directory, specified by its absolute path on the image. Unless specified,
123 the permissions of the directory will be 755.
124
125 =item B<add_driver_classes> I<class>...
126
127 Add one or more classifications of modules to the image, specified as a
128 directory relative to C</lib/modules/KERNELVERSION/kernel>, e.g. 'drivers/scsi'
129 or 'crypto'. Modules can be filtered by name by adding glob (including extended
130 glob) patterns to the I<modulefilter> array prior to calling
131 B<add_driver_classes>. This filter is cleared after the parsing of each hook,
132 although you are free to call B<unset> from within the builder, if desired.
133
134 Additionally, if the autodetect builder is used as part of image generation,
135 only the intersection of the autodetect module list and the results of the
136 add_driver_classes call will be added to the resulting image.
137
138 =item B<add_file> I<source> [I<path>]
139
140 Add a plain file, specified by the absolute path to its source. Unless
141 specified, the path on the image will be the same as the source. No
142 type checking of the file is done.
143
144 =item B<add_module> I<module_name>
145
146 Add a kernel module to the image, specified by its name (with or without
147 extension). Modules will be scanned for dependencies which will also be
148 added to the image.
149
150 =item B<add_path_to_file> I<file>
151
152 Add all leading path componenets to a file to the image.
153
154 =item B<add_pipe> I<path> [I<mode>]
155
156 Add a FIFO device to the image, specified by its absolute path. Unless
157 specified, the permissions of the FIFO will be 644.
158
159 =item B<add_symlink> I<target> I<link>
160
161 Add a symlink to the image, located at the absolute path specified by link,
162 pointing to the path specified by target.
163
164 =item B<use_hookscript>
165
166 Indicate that geninit should look to install a hook script with the same name
167 as the builder to the image, to be run during bootstrap. Hook scripts should
168 be located in C</usr/share/geninit/hooks>.
169
170 =back
171
172 =head1 SEE ALSO
173
174 B<cpio>(1), B<initrd>(4)
175
855cefa @falconindy add the beginnings of a man page
authored
176 =head1 AUTHOR
177
178 Dave Reisner E<lt>d@falconindy.comE<gt>
179
Something went wrong with that request. Please try again.