Skip to content

Commit

Permalink
incusd/device/disk: Use genisoimage when mkisofs can't be found
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Ketelsen <bketelsen@gmail.com>
  • Loading branch information
bketelsen authored and stgraber committed Jan 30, 2024
1 parent 5932977 commit 8060e1e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions internal/server/device/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -2208,10 +2208,15 @@ func (d *disk) generateVMAgentDrive() (string, error) {
scratchDir := filepath.Join(d.inst.DevicesPath(), linux.PathNameEncode(d.name))
defer func() { _ = os.RemoveAll(scratchDir) }()

// Check we have the mkisofs tool available.
mkisofsPath, err := exec.LookPath("mkisofs")
// Check we have the mkisofs or genisoimage tool available.
var mkisofsPath string
var err error
mkisofsPath, err = exec.LookPath("mkisofs")
if err != nil {
return "", err
mkisofsPath, err = exec.LookPath("genisoimage")
if err != nil {
return "", fmt.Errorf("Neither mkisofs nor genisoimage could be found in $PATH")
}
}

// Create agent drive dir.
Expand Down

0 comments on commit 8060e1e

Please sign in to comment.