We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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
func ExtractISO() error { temp, err := os.MkdirTemp("temp", "ubuntu-") if err != nil { return fmt.Errorf("creating temp dir: %s", err) } iso_file, err := os.Open("ubuntu-22.04.3-live-server-amd64.iso") if err != nil { return fmt.Errorf("opening iso file: %s", err) } defer iso_file.Close() if err = util.ExtractImageToDirectory(iso_file, temp); err != nil { return fmt.Errorf("extracting image: %s", err) } return nil }
I am getting hit with an error extracting image: open temp/ubuntu-4020240902/boot/grub/i386-pc/zstd.mod: invalid argument
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
The text was updated successfully, but these errors were encountered:
i have analogous problem :(
boot/grub/i386-efi/xnu.mod: invalid argument
Sorry, something went wrong.
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 :)
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: