Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #577 from stealthybox/ubuntu19_tar_fix_followup_526
Browse files Browse the repository at this point in the history
Followup to #526 Ubuntu 19+ tar symlink fix
  • Loading branch information
luxas authored Apr 10, 2020
2 parents 2d5a15a + 854dce8 commit f38704c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pkg/dmlegacy/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ func copyKernelToOverlay(vm *api.VM, mountPoint string) error {
}
// It is important to not replace existing symlinks to directories when extracting because
// /lib might be a symlink (usually to usr/lib)
_, err = util.ExecuteCommand("tar", "--keep-directory-symlink", "-xf", kernelTarPath, "-C", mountPoint)
// WARNING: `-h` is only available on GNU and Busybox tar. It is not present on BSD's bsdtar
// It means "Follow symlinks"
_, err = util.ExecuteCommand("tar", "-h", "-xf", kernelTarPath, "-C", mountPoint)
return err
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/operations/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func importKernel(c *client.Client, ociRef meta.OCIImageRef) (*api.Kernel, error
defer reader.Close()

// Extract only the /boot and /lib directories of the tar stream into the tempDir
tarCmd := exec.Command("tar", "-x", "-C", tempDir, "boot", "lib")
tarCmd := exec.Command("tar", "-x", "-C", tempDir, "boot", "lib/modules")
tarCmd.Stdin = reader
if err := tarCmd.Start(); err != nil {
return nil, err
Expand Down

0 comments on commit f38704c

Please sign in to comment.