Skip to content

Commit

Permalink
use generic function to move and rename firecracker kernel
Browse files Browse the repository at this point in the history
Signed-off-by: JooYoung Park <[email protected]>
  • Loading branch information
JooyoungPark73 committed Feb 13, 2024
1 parent 3acf185 commit 993a8f8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
2 changes: 1 addition & 1 deletion scripts/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func SetupFirecrackerContainerd() error {
if !utils.CheckErrorWithMsg(err, "Failed to download kernel image!\n") {
return err
}
err = utils.CopyKernelToDirAndRename(kernelImgPath, true)
err = utils.CopyToDir(kernelImgPath, "/var/lib/firecracker-containerd/runtime/hello-vmlinux.bin", true)
if !utils.CheckErrorWithMsg(err, "Failed to copy kernel image!\n") {
return err
}
Expand Down
14 changes: 0 additions & 14 deletions scripts/utils/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,20 +183,6 @@ func CopyToDir(source string, target string, privileged bool) error {
return err
}

func CopyKernelToDirAndRename(source string, privileged bool) error {
var err error

privilegedCmd := ""
if privileged {
privilegedCmd = "sudo"
}
// Copy recursively

_, err = ExecShellCmd("%s cp -R %s %s", privilegedCmd, source, "/var/lib/firecracker-containerd/runtime/hello-vmlinux.bin")

return err
}

// Get kernel version info (equivalent to `uname -r`)
func GetKernelVersion() (string, error) {
kernelVersion, err := ExecShellCmd("uname -r")
Expand Down

0 comments on commit 993a8f8

Please sign in to comment.