kata-containers / packaging

Kata Containers version 1.x packaging (for version 2.x see https://github.com/kata-containers/kata-containers).
https://katacontainers.io/
Apache License 2.0
119 stars 92 forks source link

kernel: fix for build guest kernel 4.x #1178

Closed Jimmy-Xu closed 3 years ago

Jimmy-Xu commented 3 years ago

branch: stable-1.12

Description of problem

The defualt guest kernel version is v5.4.60 (found in https://github.com/kata-containers/runtime/blob/master/versions.yaml#L158)

When I run ./build-kernel.sh -g nvidia -f setup, it's OK,
but when I run ./build-kernel.sh -v 4.19.86 -g nvidia -f setup, it failed.

Expected result

$ cd $GOPATH/src/github.com/kata-containers/packaging/kernel
$ ./build-kernel.sh -v 4.19.86 -g nvidia -f setup
INFO: Config version: 91
INFO: Kernel version: 4.19.86
INFO: /mnt/hgfs/vm_data/gopath/src/github.com/kata-containers/packaging/kernel/kata-linux-4.19.86-91 already exist
INFO: Force generate config due to '-f'
INFO: Apply patches from /4.19.x
INFO: Patches directory does not exist
ls: cannot access '/mnt/hgfs/vm_data/gopath/src/github.com/kata-containers/packaging/kernel/configs/fragments/x86_64/../common/experimental/*.conf': No such file or directory
INFO: Add kernel config for GPU due to '-g nvidia'
INFO: Constructing config from fragments: /mnt/hgfs/vm_data/gopath/src/github.com/kata-containers/packaging/kernel/configs/fragments/x86_64/.config
INFO: Copying config file from: /mnt/hgfs/vm_data/gopath/src/github.com/kata-containers/packaging/kernel/configs/fragments/x86_64/.config
scripts/kconfig/conf  --oldconfig Kconfig
#
# configuration written to .config
#
Kernel source ready: /mnt/hgfs/vm_data/gopath/src/github.com/kata-containers/packaging/kernel/kata-linux-4.19.86-91

Actual result

$ cd $GOPATH/src/github.com/kata-containers/packaging/kernel
$ ./build-kernel.sh -v 4.19.86 -g nvidia -f setup
INFO: Config version: 91
INFO: Kernel version: 4.19.86
INFO: /mnt/hgfs/vm_data/gopath/src/github.com/kata-containers/packaging/kernel/kata-linux-4.19.86-91 already exist
INFO: Force generate config due to '-f'
INFO: Apply patches from /4.19.x
INFO: Patches directory does not exist
ls: cannot access '/mnt/hgfs/vm_data/gopath/src/github.com/kata-containers/packaging/kernel/configs/fragments/x86_64/../common/experimental/*.conf': No such file or directory
INFO: Add kernel config for GPU due to '-g nvidia'
INFO: Constructing config from fragments: /mnt/hgfs/vm_data/gopath/src/github.com/kata-containers/packaging/kernel/configs/fragments/x86_64/.config
INFO: Some CONFIG elements failed to make the final .config:
INFO: Value requested for CONFIG_VIRTIO_FS not in final .config
Value requested for CONFIG_VIRTIO_PMEM not in final .config
Value requested for CONFIG_PVH not in final .config
INFO: Generated config file can be found in /mnt/hgfs/vm_data/gopath/src/github.com/kata-containers/packaging/kernel/configs/fragments/x86_64/.config
ERROR: Failed to construct requested .config file
ERROR: failed to find default config

Further information

CONFIG_PVH: found in Linux kernels: 5.0+ CONFIG_VIRTIO_PMEM: found in Linux kernels: 5.3+ CONFIG_VIRTIO_FS : found in Linux kernels: 5.4+

Adding these CONFIG parameters to github.com/kata-containers/packaging/kernel/configs/fragments/whitelist.conf can solve the problem

fidencio commented 3 years ago

This issue is being automatically closed as Kata Containers 1.x has now reached EOL (End of Life). This means it is no longer being maintained.

Important:

All users should switch to the latest Kata Containers 2.x release to ensure they are using a maintained release that contains the latest security fixes, performance improvements and new features.

This decision was discussed by the @kata-containers/architecture-committee and has been announced via the Kata Containers mailing list:

If you believe this issue still applies to Kata Containers 2.x, please open an issue against the Kata Containers 2.x repository, pointing to this one, providing details to allow us to migrate it.