Andrew Rynhard 1ca61ddce7 feat: add ISO support
This reverts commit 3515f4e0f8c11352539ed0d430e1f44f73c8229f.

Signed-off-by: Andrew Rynhard <andrew@rynhard.io>
2020-11-02 10:21:40 -08:00

28 lines
568 B
Go

// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package pkg
import (
"fmt"
"github.com/talos-systems/talos/pkg/cmd"
)
// CreateISO creates an iso by invoking the `grub-mkrescue` command.
func CreateISO(iso, dir string) (err error) {
_, err = cmd.Run(
"grub-mkrescue",
"--compress=xz",
"--output="+iso,
dir,
)
if err != nil {
return fmt.Errorf("failed to create ISO: %w", err)
}
return nil
}