Skip to content
Newer
Older
100755 452 lines (370 sloc) 11.8 KB
75052c2 @falconindy initial commit
authored
1 #!/bin/bash
e5a8d5b @falconindy standardize file headers and add MIT licensee
authored
2 #
3 # geninit - modular initramfs creation tool
4 #
5 # Copyright (C) 2011 by Dave Reisner <d@falconindy.com>
6 #
7 # Permission is hereby granted, free of charge, to any person obtaining a copy
8 # of this software and associated documentation files (the "Software"), to deal
9 # in the Software without restriction, including without limitation the rights
10 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 # copies of the Software, and to permit persons to whom the Software is
12 # furnished to do so, subject to the following conditions:
13 #
14 # The above copyright notice and this permission notice shall be included in
15 # all copies or substantial portions of the Software.
16 #
17 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 # THE SOFTWARE.
24 #
75052c2 @falconindy initial commit
authored
25
26 shopt -s extglob
d51765f @falconindy fix linker resolution for i686 and multilib
authored
27 shopt -s nullglob
75052c2 @falconindy initial commit
authored
28
570ed43 @falconindy add -s option for saving the filelist. declare globals in an obvious …
authored
29 # tender vittles
ddb5e48 @falconindy use declare for all globals
authored
30 declare _sysconfdir=/etc
31 declare _sharedir=.
32 declare builderdir=${_sharedir}/builders
33 declare baseconfig=${_sysconfdir}/geninit.conf
34 declare carch=$(uname -m)
35 declare kernver=$(uname -r)
75052c2 @falconindy initial commit
authored
36
570ed43 @falconindy add -s option for saving the filelist. declare globals in an obvious …
authored
37 # error codes
ddb5e48 @falconindy use declare for all globals
authored
38 declare -i ENOENT=2
39 declare -i EACCES=13
40 declare -i EEXIST=17
41 declare -i EINVAL=22
570ed43 @falconindy add -s option for saving the filelist. declare globals in an obvious …
authored
42
43 # globals
44 declare -i automods=0
61ed3b4 @falconindy use find|cpio instead of gen_init_cpio
authored
45 declare -i savebuildroot=0
f1562ff @falconindy dryrun is an integer value
authored
46 declare -i dryrun=0
570ed43 @falconindy add -s option for saving the filelist. declare globals in an obvious …
authored
47 declare basedir=
48 declare config=
49 declare imagename=
50 declare preset=
51 declare skipbuilders=
52 declare ocompress=
53
5aad559 @falconindy cleanup commenting in main file, do a little reorg
authored
54 # -------------------------- #
55 ## general util functions ##
56 # -------------------------- #
75052c2 @falconindy initial commit
authored
57
5aad559 @falconindy cleanup commenting in main file, do a little reorg
authored
58 err() { # {{{
75052c2 @falconindy initial commit
authored
59 printf 'error: %s\n' "$*"
5aad559 @falconindy cleanup commenting in main file, do a little reorg
authored
60 } >&2 # }}}
75052c2 @falconindy initial commit
authored
61
5aad559 @falconindy cleanup commenting in main file, do a little reorg
authored
62 info() { # {{{
75052c2 @falconindy initial commit
authored
63 printf ':: %s\n' "$*"
5aad559 @falconindy cleanup commenting in main file, do a little reorg
authored
64 } # }}}
75052c2 @falconindy initial commit
authored
65
5aad559 @falconindy cleanup commenting in main file, do a little reorg
authored
66 die() { # {{{
75052c2 @falconindy initial commit
authored
67 err "$*"
68 cleanup 1
5aad559 @falconindy cleanup commenting in main file, do a little reorg
authored
69 } # }}}
75052c2 @falconindy initial commit
authored
70
5aad559 @falconindy cleanup commenting in main file, do a little reorg
authored
71 in_array() { # {{{
75052c2 @falconindy initial commit
authored
72 local item needle=$1; shift
73 [[ -z $1 ]] && return 1 # Not Found
74
75 for item; do
76 [[ $item = $needle ]] && return 0 # Found
77 done
78 return 1 # Not Found
5aad559 @falconindy cleanup commenting in main file, do a little reorg
authored
79 } # }}}
75052c2 @falconindy initial commit
authored
80
5aad559 @falconindy cleanup commenting in main file, do a little reorg
authored
81 kmodinfo() { # {{{
75052c2 @falconindy initial commit
authored
82 modinfo -0k $kernver "$@"
5aad559 @falconindy cleanup commenting in main file, do a little reorg
authored
83 } # }}}
75052c2 @falconindy initial commit
authored
84
5aad559 @falconindy cleanup commenting in main file, do a little reorg
authored
85 cleanup() { # {{{
61ed3b4 @falconindy use find|cpio instead of gen_init_cpio
authored
86 if (( savebuildroot )); then
87 info "buildroot preserved at: $buildroot"
88 else
89 rm -rf "$tmpdir"
90 fi
75052c2 @falconindy initial commit
authored
91 exit $1
5aad559 @falconindy cleanup commenting in main file, do a little reorg
authored
92 } # }}}
75052c2 @falconindy initial commit
authored
93
25a82f8 @falconindy add a usage function
authored
94 usage() { # {{{
95 cat<<USAGE
a113c0c @falconindy cleanup usage function
authored
96 usage: geninit [options]
25a82f8 @falconindy add a usage function
authored
97
98 Options:
99 -b <path> Use base directory (default: /)
100 -c <file> Specify a different config file (default: $_sysconfdir/geninit.conf)
101 -g <path> Path and name of generated image (dry-run if unspecified)
38f816a @falconindy add -H and -L options for getting help with builders
authored
102 -H <builder> Display help for a specified builder
25a82f8 @falconindy add a usage function
authored
103 -h Display this help message
a113c0c @falconindy cleanup usage function
authored
104 -k <kver> Specify a kernel version (default: $kernver)
38f816a @falconindy add -H and -L options for getting help with builders
authored
105 -L List available builders
a113c0c @falconindy cleanup usage function
authored
106 -p <preset> Build using a preset file (any of $_sysconfdir/geninit.d/*.preset)
25a82f8 @falconindy add a usage function
authored
107 -S <names> Skip the specified builders during the build process
61ed3b4 @falconindy use find|cpio instead of gen_init_cpio
authored
108 -s Preserve buildroot after image creation
6dda899 @falconindy allow changing location of build dir
authored
109 -t <path> Specify an alternate location for temporary workspace
25a82f8 @falconindy add a usage function
authored
110 -z <method> Override compression method
111
112 USAGE
113 exit
114 } # }}}
115
38f816a @falconindy add -H and -L options for getting help with builders
authored
116 builderlist() { # {{{
117 local -a builders=("$_sharedir"/builders/*)
118
119 (( ${#builders[*]} )) || die "no builders found"
120
121 info "Available builders -- use -H <builder> for help with a specific builder"
122 printf '%s\n' "${builders[@]##*/}" | column -c$(tput cols)
123 cleanup 0
124 } # }}}
125
126 builderhelp() { # {{{
127 local builder=$1
128
129 [[ -f $_sharedir/builders/$builder ]] || die "no such builder: $builder"
130 . "$_sharedir/builders/$builder"
131 type -t helpmsg >/dev/null || die "no help for builder: $builder"
132 info "$builder"
133 helpmsg
134 cleanup 0
135 } # }}}
136
04d836e @falconindy relocate build_preset. rename it to __build_preset and declare a "pri…
authored
137 # --------------- #
138 ## private API ##
139 # --------------- #
75052c2 @falconindy initial commit
authored
140
141 __add_file() { # {{{
61ed3b4 @falconindy use find|cpio instead of gen_init_cpio
authored
142 # add a file to $buildroot
75052c2 @falconindy initial commit
authored
143 # $1: pathname on initcpio
144 # $2: source on disk
145 # $3: mode
146
147 (( $# == 3 )) || return $EINVAL
61ed3b4 @falconindy use find|cpio instead of gen_init_cpio
authored
148 [[ -e $buildroot$1 ]] && return $EEXIST
75052c2 @falconindy initial commit
authored
149
61ed3b4 @falconindy use find|cpio instead of gen_init_cpio
authored
150 install -Dm$3 "$2" "$buildroot$1"
75052c2 @falconindy initial commit
authored
151 } # }}}
152
153 __add_dir() { # {{{
61ed3b4 @falconindy use find|cpio instead of gen_init_cpio
authored
154 # add a directory (with parents) to $buildroot
75052c2 @falconindy initial commit
authored
155 # $1: pathname on initcpio
156 # $2: mode
157
158 (( $# == 2 )) || [[ $1 == /?* ]] || return $EINVAL
61ed3b4 @falconindy use find|cpio instead of gen_init_cpio
authored
159 [[ -e $buildroot$1 ]] && return $EEXIST
75052c2 @falconindy initial commit
authored
160
61ed3b4 @falconindy use find|cpio instead of gen_init_cpio
authored
161 install -dm$2 "$buildroot$1"
75052c2 @falconindy initial commit
authored
162 } # }}}
163
164 __add_slink() { # {{{
61ed3b4 @falconindy use find|cpio instead of gen_init_cpio
authored
165 # add a symlink to $buildroot
75052c2 @falconindy initial commit
authored
166 # $1: name on initcpio
167 # $2: target of $1
168
169 (( $# == 2 )) || return $EINVAL
61ed3b4 @falconindy use find|cpio instead of gen_init_cpio
authored
170 [[ -L $buildroot$1 ]] && return $EEXIST
75052c2 @falconindy initial commit
authored
171
61ed3b4 @falconindy use find|cpio instead of gen_init_cpio
authored
172 ln -s "$2" "$buildroot$1"
75052c2 @falconindy initial commit
authored
173 } # }}}
174
175 __add_pipe() { # {{{
61ed3b4 @falconindy use find|cpio instead of gen_init_cpio
authored
176 # add a pipe to $buildroot
75052c2 @falconindy initial commit
authored
177 # $1: pathname on initcpio
178 # $2: mode
179
180 (( $# == 2 )) || return $EINVAL
61ed3b4 @falconindy use find|cpio instead of gen_init_cpio
authored
181 [[ -e $buildroot$1 ]] && return $EEXIST
75052c2 @falconindy initial commit
authored
182
61ed3b4 @falconindy use find|cpio instead of gen_init_cpio
authored
183 mkfifo -m$2 "$buildroot$1"
75052c2 @falconindy initial commit
authored
184 } # }}}
185
2fa6276 @falconindy move main loop logic into its own function. localize variables
authored
186 __build_image() { # {{{
b6714ed @falconindy ARRRGH. always use local inside a function
authored
187 local -i modcount=0
188 local -a zopts pipesave
189 local builder= module= line= mod= file=
2fa6276 @falconindy move main loop logic into its own function. localize variables
authored
190
f6f7761 @falconindy refactor depmod creation
authored
191 # this must be resolved to an absolute path
1d41e24 @falconindy be less strict about checking imagename resolution during build
authored
192 if [[ $imagename && ${imagename:0:1} != / ]]; then
f6f7761 @falconindy refactor depmod creation
authored
193 imagename=$(readlink -f "$imagename")
1d41e24 @falconindy be less strict about checking imagename resolution during build
authored
194 [[ $imagename ]] || die "Failed to resolve path to imagename"
f6f7761 @falconindy refactor depmod creation
authored
195 fi
196
2fa6276 @falconindy move main loop logic into its own function. localize variables
authored
197 # parse builder array
198 for builder in "${builders[@]}"; do
199 in_array "$builder" "${skipbuilders[@]}" && continue
200
201 if [[ ! -f $builderdir/$builder ]]; then
202 err "cannot find builder '$builder': No such file"
203 continue
204 fi
205
f2136d7 @falconindy add quirks file for quirky modules
authored
206 # subshell to prevent namespace pollution
207 . "$builderdir/$builder"
208 if ! type -t build >/dev/null; then
209 err "no build function found in builder '$builder'"
210 continue
211 fi
212
61ed3b4 @falconindy use find|cpio instead of gen_init_cpio
authored
213 info "Building: [$builder]"
f2136d7 @falconindy add quirks file for quirky modules
authored
214 build
7b78689 @falconindy implement module filtering for add_driver_classes
authored
215 unset modulefilter
2fa6276 @falconindy move main loop logic into its own function. localize variables
authored
216 done
217
218 # add extra modules from config
219 for mod in ${modules[@]}; do
69e7d7e @falconindy throw errors on user-specfied file/module not found
authored
220 add_module "$mod" || err "Module not found: $mod"
2fa6276 @falconindy move main loop logic into its own function. localize variables
authored
221 done
222
223 # add extra files from config
224 for file in "${files[@]}"; do
ff6854c @falconindy uphold geninit.conf's claim of multiple forms to files=()
authored
225 local src=${file%%::*}
226 local dest=${file##*::}
227 [[ $dest ]] || dest=$src
228 add_binary "$src" "$dest" || err "File not found: $file"
2fa6276 @falconindy move main loop logic into its own function. localize variables
authored
229 done
230
f6f7761 @falconindy refactor depmod creation
authored
231 # only create depmod files if there's modules added
e37a454 @falconindy avoid using public API from within the API itself
authored
232 if [[ -d $buildroot$moduledir ]]; then
f6f7761 @falconindy refactor depmod creation
authored
233 info "Generating module dependencies"
234 depmod -b "$buildroot" "$kernver"
77b1458 @falconindy trim excess depmod files. we dont need all of them
authored
235 # trim excess depmod files
e37a454 @falconindy avoid using public API from within the API itself
authored
236 rm "$buildroot$moduledir"/modules.!(dep|alias|symbols)
f6f7761 @falconindy refactor depmod creation
authored
237 fi
570ed43 @falconindy add -s option for saving the filelist. declare globals in an obvious …
authored
238
69e7d7e @falconindy throw errors on user-specfied file/module not found
authored
239 { # create delicious config
bac42f3 @falconindy move config creation to geninit
authored
240 printf '%s %d' '%MODULES%' "${#modules[*]}"
241 printf ' %s' "${modules[@]}"
242 printf '\n'
243
244 printf '%s' '%HOOKS%'
245 printf ' %s' "${builders[@]}"
246 printf '\n'
247 } > "$buildroot/config"
248
2fa6276 @falconindy move main loop logic into its own function. localize variables
authored
249 if (( dryrun )); then
250 info "Dry run complete. Use -g <path> to create an initramfs."
61ed3b4 @falconindy use find|cpio instead of gen_init_cpio
authored
251 return
2fa6276 @falconindy move main loop logic into its own function. localize variables
authored
252 fi
253
254 if [[ $compress != cat ]]; then
255 zopts=('-9')
256 [[ $compress = xz ]] && zopts+=('--check=crc32')
257 fi
258
259 info "Creating$([[ $compress = cat ]] || printf " $compress") initramfs: $imagename"
61ed3b4 @falconindy use find|cpio instead of gen_init_cpio
authored
260
261 pushd "$buildroot" &>/dev/null
262 find . -print0 | cpio -0oH newc | "$compress" "${zopts[@]}" > "$imagename"
263 popd &>/dev/null
264
2fa6276 @falconindy move main loop logic into its own function. localize variables
authored
265 pipesave=("${PIPESTATUS[@]}") # save immediately
61ed3b4 @falconindy use find|cpio instead of gen_init_cpio
authored
266 (( pipesave[0] )) && die "failed to create filelist (find reported error)"
267 (( pipesave[1] )) && die "failed to create cpio archive (cpio reported error)"
268 (( pipesave[2] )) && die "$compress reported error compressing image"
2fa6276 @falconindy move main loop logic into its own function. localize variables
authored
269
270 info "Image creation completed successfully"
271
272 } # }}}
273
04d836e @falconindy relocate build_preset. rename it to __build_preset and declare a "pri…
authored
274 __build_preset() { # {{{
b6714ed @falconindy ARRRGH. always use local inside a function
authored
275 local preset= presetfile=$_sysconfdir/geninit.d/$1.preset
276 local var= cfg= opts= imagename=
277 local -a presets
04d836e @falconindy relocate build_preset. rename it to __build_preset and declare a "pri…
authored
278
279 if [[ ! -f $basedir$presetfile ]]; then
280 err "preset not found: $1"
281 return $ENOENT
282 fi
283
284 if ! . "$basedir$presetfile"; then
285 err "failed to read preset: $1"
286 return $EACCES
287 fi
288
289 # preset pulls in a known array 'presets'
290 for preset in "${presets[@]}"; do
ba1417a @falconindy allow disabling presets with a prefixed !
authored
291 if [[ ${preset:0:1} == ! ]]; then # marked disabled
292 continue;
293 fi
294
04d836e @falconindy relocate build_preset. rename it to __build_preset and declare a "pri…
authored
295 # resolve kernel version
296 if [[ -z $ALL_kver ]]; then
297 err "No kernel version defined for preset \`$1'"
298 return $EINVAL
299 fi
300
301 # resolve image name
302 var=${preset}_image
303 if [[ -z ${!var} ]]; then
304 err "No imagename defined for preset \`$1'"
305 return $EINVAL
306 fi
307 imagename=${!var}
308
309 # extra config
310 var=${preset}_config
311 if [[ -z ${!var} ]]; then
312 # fallback on $ALL_config if its available
313 cfg=${ALL_config:-$_sysconfigdir/geninit.conf}
314 else
315 cfg=${!var}
316 fi
317
318 # extra options are optional
319 var=${preset}_options
320 opts=${!var}
321
322 # this should always resolve to something (i hope)
323 if [[ ! -f $basedir$cfg ]]; then
324 err "preset config file not found: \`$basedir$cfg'"
325 return $ENOENT
326 fi
327
328 # we've got enough to relaunch geninit now
329 # TODO: don't relaunch. Do this the sane way.
330 info "Building image from preset: $1-$preset"
331 printf ' ==> %s\n' "-k $ALL_kver -c $cfg -g $basedir$imagename $opts"
332 "$0" -b "$basedir" -k "$ALL_kver" -c "$cfg" -g "$basedir$imagename" $opts || return 1
333 echo
334 done
335 } # }}}
336
75052c2 @falconindy initial commit
authored
337 # its a trap!
338 trap 'cleanup 130' SIGINT
339 trap 'cleanup 143' SIGTERM
340
04d836e @falconindy relocate build_preset. rename it to __build_preset and declare a "pri…
authored
341 # source public API
5aad559 @falconindy cleanup commenting in main file, do a little reorg
authored
342 . "$_sharedir/geninit.api"
75052c2 @falconindy initial commit
authored
343
f2136d7 @falconindy add quirks file for quirky modules
authored
344 # source module quirks file
345 . "$_sharedir/geninit.quirks"
346
75052c2 @falconindy initial commit
authored
347 # ------------------ #
348 ## option parsing ##
349 # ------------------ #
350
6dda899 @falconindy allow changing location of build dir
authored
351 while getopts ':b:c:g:H:hk:LMp:S:st:z:' flag; do
75052c2 @falconindy initial commit
authored
352 case $flag in
353 b) basedir=$OPTARG ;;
354 c) config=$OPTARG ;;
355 g) imagename=$OPTARG ;;
38f816a @falconindy add -H and -L options for getting help with builders
authored
356 H) builderhelp $OPTARG ;;
25a82f8 @falconindy add a usage function
authored
357 h) usage ;;
75052c2 @falconindy initial commit
authored
358 k) kernver=$OPTARG ;;
38f816a @falconindy add -H and -L options for getting help with builders
authored
359 L) builderlist ;;
a7370a0 @falconindy add -M option for dumping autodetected modules
authored
360 M) automods=1 ;;
1f2aff1 @falconindy add support for kernel presets
authored
361 p) preset=$OPTARG ;;
362 S) skipbuilders=(${OPTARG//,/ }) ;;
61ed3b4 @falconindy use find|cpio instead of gen_init_cpio
authored
363 s) savebuildroot=1 ;;
6dda899 @falconindy allow changing location of build dir
authored
364 t) tmpdir=$OPTARG ;;
75052c2 @falconindy initial commit
authored
365 z) ocompress=$OPTARG ;; # named differently to allow overriding
366 :) die "option requires an argument -- '$OPTARG'" ;;
367 \?) die "invalid option -- '$OPTARG'" ;;
368 esac
369 done
370
ddb5e48 @falconindy use declare for all globals
authored
371 # Alter PATH. We want to make sure that /bin and /sbin are favored, since
372 # we specifically rely on GNU coreutils
373 PATH=/sbin:/bin:$PATH
374
75052c2 @falconindy initial commit
authored
375 # ----------------- #
376 ## sanity checks ##
377 # ----------------- #
378
bd5d0ee @falconindy resolved ld_so later so that we can use the linker from the guest roo…
authored
379 # declared as an array to force expansion. would be great if arch had
380 # symlink pointing to this from /lib/ld.so
d51765f @falconindy fix linker resolution for i686 and multilib
authored
381 ld_so=($basedir/lib/ld-linux?(-${carch//_/-}).so.?*)
75052c2 @falconindy initial commit
authored
382 if (( ${#ld_so[*]} != 1 )); then # uh oh...
383 die "failed to resolve the location of /lib/ld.so. Please report this bug."
384 fi
385
386 # make sure our config exists, and source it
387 config=${config:-$baseconfig}
388 [[ ! -f $config ]] && die "failed to find config file: \`$config'" || . "$config"
389
e17a205 @falconindy fix inaccurate comment wrt basedir
authored
390 # if specified, does the basedir exist? trim any trailing slash
75052c2 @falconindy initial commit
authored
391 if [[ $basedir ]]; then
392 basedir=${basedir%/}
929cb54 @falconindy make an unfortunate exception for passing -b /
authored
393 [[ $basedir ]] && { [[ -d $basedir ]] || die "basedir \`$basedir' not found"; }
75052c2 @falconindy initial commit
authored
394 fi
395
6dda899 @falconindy allow changing location of build dir
authored
396 tmpdir=${tmpdir:-$(mktemp -d /tmp/${0##*/}.XXXXXX)}
397 if [[ $tmpdir ]]; then
398 tmpdir=${tmpdir%/}
399 [[ -d $tmpdir ]] || die "tmpdir \`$tmpdir' not found"
400 [[ -w $tmpdir ]] || die "unable to write to specified tmpdir \`$tmpdir'"
401 else
402 die "No tmpdir defined. Unable to continue"
403 fi
404
75052c2 @falconindy initial commit
authored
405 # does the kernel exist inside the basedir?
406 [[ -d $basedir/lib/modules/$kernver ]] || die "kernel \`$kernver' not found"
407
408 # is our supplied compression method (if supplied) valid?
409 compress=${ocompress:-$compress}
6048c99 @falconindy allow 'none' as a compression option
authored
410 if [[ -z $compress || $compress = none ]]; then
411 compress=cat # NOOP compressor
412 else
75052c2 @falconindy initial commit
authored
413 [[ $compress = @(gzip|bzip2|lzma|xz) ]] || die "unknown compression method: $compress"
414 type -P "$compress" >/dev/null || die "failed to find \`$compress' binary in PATH"
415 fi
416
340a7c4 @falconindy add support for dry runs
authored
417 # if $imagename is provided, its path needs to be valid
418 if [[ $imagename ]]; then
aeea626 @falconindy fail when imagepath's dirname isn't writeable
authored
419 imagepath=$(readlink -f "$imagename")
420 [[ $imagepath ]] || die "invalid path to imagename: $imagename"
421 [[ -w ${imagepath%/*} ]] || die "no permission to write to specified path: \`${imagepath%/*}'"
340a7c4 @falconindy add support for dry runs
authored
422 else # no $imagename, so we're doing a dry run
423 dryrun=1
424 fi
75052c2 @falconindy initial commit
authored
425
426 # ------------ #
427 ## int main ##
428 # ------------ #
429
6dda899 @falconindy allow changing location of build dir
authored
430 # define a few more paths for convenience
61ed3b4 @falconindy use find|cpio instead of gen_init_cpio
authored
431 buildroot=$tmpdir/root
75052c2 @falconindy initial commit
authored
432 autodetect_cache=$tmpdir/autodetect.cache
433 moduledir=/lib/modules/$kernver
434
a7370a0 @falconindy add -M option for dumping autodetected modules
authored
435 if (( automods )); then
436 . "$_sharedir/builders/autodetect" || die "unable to source autodetect builder"
437 build
438 info "Autodetected modules"
439 [[ -s $autodetect_cache ]] && cat "$autodetect_cache"
440 cleanup 0
441 fi
442
1f2aff1 @falconindy add support for kernel presets
authored
443 if [[ $preset ]]; then
04d836e @falconindy relocate build_preset. rename it to __build_preset and declare a "pri…
authored
444 __build_preset "$preset"
2fa6276 @falconindy move main loop logic into its own function. localize variables
authored
445 else
80edf1c @falconindy dont report dry run when using a preset
authored
446 (( dryrun )) && info "Starting dry run"
2fa6276 @falconindy move main loop logic into its own function. localize variables
authored
447 __build_image
75052c2 @falconindy initial commit
authored
448 fi
449
2fa6276 @falconindy move main loop logic into its own function. localize variables
authored
450 cleanup $?
75052c2 @falconindy initial commit
authored
451
Something went wrong with that request. Please try again.