mirror of https://github.com/ericonr/sbctl.git
bundle: Ensure files exist before combining
Signed-off-by: Morten Linderud <morten@linderud.pw>
This commit is contained in:
parent
32ac267834
commit
fb79c38977
6
sbctl.go
6
sbctl.go
|
@ -145,6 +145,12 @@ func Sign(file, output string, enroll bool) error {
|
|||
}
|
||||
|
||||
func CombineFiles(microcode, initramfs string) (*os.File, error) {
|
||||
for _, file := range []string{microcode, initramfs} {
|
||||
if _, err := os.Stat(file); err != nil {
|
||||
return nil, fmt.Errorf("%s: %w", file, errors.Unwrap(err))
|
||||
}
|
||||
}
|
||||
|
||||
tmpFile, err := os.CreateTemp("/var/tmp", "initramfs-")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Reference in New Issue