Open smahm006 opened 1 year ago
i have analogous problem :(
boot/grub/i386-efi/xnu.mod: invalid argument
I just ended up using os.Exec to call xorriso
func extractISOToDirectory(filename string, source string, destination string) error {
xorriso_args := fmt.Sprintf("-osirrox on -indev %s/%s -extract / %s", source, filename, destination)
cmd := exec.Command("xorriso", strings.Split(xorriso_args, " ")...)
err := cmd.Run()
if err != nil {
return fmt.Errorf("xorriso error: %s", err)
}
err = filepath.Walk(destination, func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
return os.Chmod(path, os.FileMode(0755))
})
if err != nil {
return fmt.Errorf("setting directory permissions: %s", err)
}
return nil
}
thank you! i was just thinking this way :)
I am trying to extract a ubuntu iso image (from https://releases.ubuntu.com/22.04/) to a temporary folder. Below is the code I am using
I am getting hit with an error
extracting image: open temp/ubuntu-4020240902/boot/grub/i386-pc/zstd.mod: invalid argument
I am not sure what the reason is, maybe the - in i386-pc?
EDIT: I just realized this might also be a permissions issue