Support importing a kernel from a chroot directory

This commit is contained in:
Gregory Kurtzer
2021-02-04 18:06:46 -08:00
parent e4ec4b0ffd
commit 30c6b64413
3 changed files with 6 additions and 4 deletions

View File

@@ -69,10 +69,10 @@ func ListKernels() ([]string, error) {
return ret, nil
}
func Build(kernelVersion string) (string, error) {
func Build(kernelVersion string, root string) (string, error) {
kernelImage := "/boot/vmlinuz-" + kernelVersion
kernelDrivers := "/lib/modules/" + kernelVersion
kernelImage := path.Join(root, "/boot/vmlinuz-"+kernelVersion)
kernelDrivers := path.Join(root, "/lib/modules/"+kernelVersion)
kernelDestination := KernelImage(kernelVersion)
driversDestination := KmodsImage(kernelVersion)