Debian Codegraph @

src/pins/template/initramfs.in

raw
1 #!/bin/sh
2 #
3 # Copyright (c) @year@ @name@
4 # Author: @name@ <@email@>
5 #
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #
19
20 case $1 in
21 prereqs)
22 exit 0
23 ;;
24 esac
25
26 . @initramfstoolsdir@/hook-functions
27
28 die() {
29 code="$1"
30 msg="$2"
31 echo " (ERROR): $msg" >&2
32 exit $1
33 }
34
35 #%# Possibly you need to find additional binaries...
36 #%#
37 #%# find_binary() {
38 #%# bin_name="$1"
39 #%# resolved=$(command -v ${bin_name})
40 #%# [ -z "$resolved" ] && die 1 "Unable to find ${bin_name}"
41 #%# echo "$resolved"
42 #%# }
43
44 if [ -x @bindir@/clevis-decrypt-@pin@ ]; then
45 copy_exec @bindir@/clevis-decrypt-@pin@ || die 1 "Unable to copy @bindir@/clevis-decrypt-@pin@ to initrd image"
46
47 #%# ...and install them
48 #%#
49 #%# curl_bin=$(find_binary "curl")
50 #%# copy_exec "${curl_bin}" || die 2 "Unable to copy ${curl_bin} to initrd image"
51 fi