Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mkisofs support #882

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions distrobuilder/main_repack-windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,22 @@ func (c *cmdRepackWindows) run(cmd *cobra.Command, args []string, overlayDir str

logger.Info("Generating new ISO")
var stdout strings.Builder
var software string

err = shared.RunCommand(c.global.ctx, nil, &stdout, "genisoimage", "--version")
if err != nil {
return fmt.Errorf("Failed to determine version of genisoimage: %w", err)
err = shared.RunCommand(c.global.ctx, nil, &stdout, "mkisofs", "--version")
if err != nil {
return fmt.Errorf("Failed to determine version of genisoimage or mkisofs: %w", err)
} else {
software = "mkisofs"
}
} else {
software = "genisoimage"
}

version := strings.Split(stdout.String(), "\n")[0]

genArgs := []string{"-l", "-iso-level", "4", "-no-emul-boot",
"-b", "boot/etfsboot.com", "-boot-load-seg", "0",
"-boot-load-size", "8", "-eltorito-alt-boot"}
Expand All @@ -337,7 +346,7 @@ func (c *cmdRepackWindows) run(cmd *cobra.Command, args []string, overlayDir str

return os.Stderr.Write(b)
})),
nil, nil, "genisoimage", genArgs...)
nil, nil, software, genArgs...)

if err != nil {
return fmt.Errorf("Failed to generate ISO: %w", err)
Expand Down Expand Up @@ -426,7 +435,7 @@ func (c *cmdRepackWindows) modifyWimIndex(wimFile string, index int, name string
}

func (c *cmdRepackWindows) checkDependencies() error {
dependencies := []string{"genisoimage", "hivexregedit", "rsync", "wimlib-imagex"}
dependencies := []string{"hivexregedit", "rsync", "wimlib-imagex"}

for _, dep := range dependencies {
_, err := exec.LookPath(dep)
Expand All @@ -435,6 +444,12 @@ func (c *cmdRepackWindows) checkDependencies() error {
}
}

_, err := exec.LookPath("genisoimage")
_, err1 := exec.LookPath("mkisofs")
if err != nil && err1 != nil {
return fmt.Errorf("Required tool genisoimage or mkisofs is missing")
}

return nil
}

Expand Down
Loading