/
githubmirror
/
clevis
Обзор
Документация
Войти
/
githubmirror
/
clevis
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/pins/template/initramfs.in
51 строка
1 KB
Oldřich Jedlička
template: add precondition checks during installation into initrd
19 апр 2026, 01:19
19 апр 2026, 01:19
38ea99b
Код
Авторство
О чём код?
#!/bin/sh # # Copyright (c) @year@ @name@ # Author: @name@ <@email@> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # case $1 in prereqs) exit 0 ;; esac . @initramfstoolsdir@/hook-functions die() { code="$1" msg="$2" echo " (ERROR): $msg" >&2 exit $1 } #%# Possibly you need to find additional binaries... #%# #%# find_binary() { #%# bin_name="$1" #%# resolved=$(command -v ${bin_name}) #%# [ -z "$resolved" ] && die 1 "Unable to find ${bin_name}" #%# echo "$resolved" #%# } if [ -x @bindir@/clevis-decrypt-@pin@ ]; then copy_exec @bindir@/clevis-decrypt-@pin@ || die 1 "Unable to copy @bindir@/clevis-decrypt-@pin@ to initrd image" #%# ...and install them #%# #%# curl_bin=$(find_binary "curl") #%# copy_exec "${curl_bin}" || die 2 "Unable to copy ${curl_bin} to initrd image" fi