-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
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
refactor: adds GCP support, refactors machine, kernel and image configuration #20
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ FULL_OPTIMIZATION="-Os -pipe ${DEBUG_FLAGS}" | |
# Distro config is evaluated after the machine config, so we have to explicitly | ||
# set the kernel provider to override a machine config. | ||
PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-tiny" | ||
PREFERRED_VERSION_linux-yocto-tiny ?= "6.6%" | ||
PREFERRED_VERSION_linux-yocto-tiny ?= "6.10%" | ||
|
||
# We can use packagegroup-core-boot, but in the future we may need a new packagegroup-core-tiny | ||
#POKY_DEFAULT_EXTRA_RDEPENDS += "packagegroup-core-boot" | ||
|
@@ -65,7 +65,7 @@ IMAGE_LINGUAS = "" | |
|
||
# Comment out any of the lines below to disable them in the build | ||
# DISTRO_FEATURES options: | ||
DISTRO_FEATURES_TINY = "pci ext4" | ||
DISTRO_FEATURES_TINY = "pci ext4 sysvinit" | ||
DISTRO_FEATURES_CVM = "cvm" | ||
DISTRO_FEATURES_NET = "ipv4 ipv6" | ||
|
||
|
@@ -76,14 +76,11 @@ DISTRO_FEATURES = "${DISTRO_FEATURES_TINY} \ | |
|
||
CVM_DISTRO_FEATURES_NATIVE = "acl debuginfod ext2 ipv4 ipv6 xattr nfs zeroconf pci vfat seccomp ptest" | ||
|
||
DISTRO_FEATURES:class-native = "${CVM_DISTRO_FEATURES_NATIVE} tpm2" | ||
DISTRO_FEATURES:class-nativesdk = "${CVM_DISTRO_FEATURES_NATIVE} tpm2" | ||
#DISTRO_FEATURES:class-native = "${CVM_DISTRO_FEATURES_NATIVE} tpm2" | ||
#DISTRO_FEATURES:class-nativesdk = "${CVM_DISTRO_FEATURES_NATIVE} tpm2" | ||
|
||
# add /dev/sd* disk config | ||
KERNEL_EXTRA_FEATURES:append = " features/scsi/disk.scc" | ||
|
||
# enable mdev/busybox for init | ||
#POKY_INIT_MANAGER:cvm = "mdev-busybox" | ||
DISTRO_EXTRA_RDEPENDS = "date-sync ca-certificates" | ||
DISTRO_EXTRA_RDEPENDS:append = '${@bb.utils.contains_any("IMAGE_FEATURES", [ "debug-tweaks" ], " dropbear", "",d)}' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should consider making the dropbear (ssh access) not tightly coupled with debug-tweaks in the image features in case we want to have ssh access to the machine but not necessarily building it with debug tweaks. |
||
|
||
# FIXME: Consider adding "modules" to MACHINE_FEATURES and using that in | ||
# packagegroup-core-base to select modutils-initscripts or not. Similar with "net" and | ||
|
@@ -93,10 +90,10 @@ KERNEL_EXTRA_FEATURES:append = " features/scsi/disk.scc" | |
# pulls in a lot of dependencies for the live image and the installer, like | ||
# udev, grub, etc. These pull in gettext, which fails to build with wide | ||
# character support. | ||
IMAGE_FSTYPES = "wic wic.vhd" | ||
IMAGE_FSTYPES = "wic" | ||
QB_DEFAULT_FSTYPE = "wic" | ||
|
||
INITRAMFS_IMAGE = "cvm-initramfs" | ||
INITRAMFS_IMAGE = "core-image-tiny-initramfs" | ||
|
||
# Drop v86d from qemu dependency list (we support serial) | ||
# Drop grub from meta-intel BSPs | ||
|
@@ -121,3 +118,8 @@ SKIP_RECIPE[core-image-weston] = "not buildable with poky-tiny" | |
|
||
# Disable python usage in opkg-utils since it won't build with tiny config | ||
PACKAGECONFIG:remove:pn-opkg-utils = "python" | ||
|
||
# add cvm.scc cfg changes | ||
KERNEL_FEATURES:append:pn-linux-yocto-tiny = " cvm.scc" | ||
KERNEL_FEATURES:append:pn-linux-yocto = " cvm.scc" | ||
KERNEL_FEATURES:append:pn-linux-yocto-rt = " cvm.scc" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
MACHINEOVERRIDES =. "gcp:" | ||
|
||
# gcp tdx depends on kvm and virtio | ||
KERNEL_FEATURES:append:pn-linux-yocto-tiny = " gcp.scc cfg/virtio.scc cfg/paravirt_kvm.scc" | ||
KERNEL_FEATURES:append:pn-linux-yocto = " gcp.scc cfg/virtio.scc cfg/paravirt_kvm.scc" | ||
KERNEL_FEATURES:append:pn-linux-yocto-rt = " gcp.scc cfg/virtio.scc cfg/paravirt_kvm.scc" | ||
|
||
# gcp is not compatible with udhcpc, needs dhcpcd | ||
MACHINE_ESSENTIAL_EXTRA_RDEPENDS:append = " dhcpcd" | ||
|
||
|
||
# doesnt work, no idea why | ||
# IMAGE_FSTYPES:append = " wic.tar.gz" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
MACHINEOVERRIDES =. "hyperv:" | ||
|
||
# Provide the tdx guest driver kernel module for all images | ||
KERNEL_FEATURES:append:pn-linux-yocto-tiny = " hyperv.scc features/tpm/tpm-2.0.scc features/tpm/tpm-2.0-crb.scc" | ||
KERNEL_FEATURES:append:pn-linux-yocto = " hyperv.scc features/tpm/tpm-2.0.scc features/tpm/tpm-2.0-crb.scc" | ||
KERNEL_FEATURES:append:pn-linux-yocto-rt = " hyperv.scc features/tpm/tpm-2.0.scc features/tpm/tpm-2.0-crb.scc" | ||
|
||
|
||
MACHINE_FEATURES:append = " tpm2" | ||
|
||
# doesnt work, no idea why | ||
# IMAGE_FSTYPES:append:core-image-minimal = " wic.vhd" | ||
Comment on lines
+11
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. didn't we have that before working as part of the cvm-image-azure custom image? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
KERNEL_FEATURES:append:pn-linux-yocto-tiny = " cfg/virtio.scc cfg/paravirt_kvm.scc" | ||
KERNEL_FEATURES:append:pn-linux-yocto = " cfg/virtio.scc cfg/paravirt_kvm.scc" | ||
KERNEL_FEATURES:append:pn-linux-yocto-rt = " cfg/virtio.scc cfg/paravirt_kvm.scc" | ||
|
||
# doesnt work, no idea why | ||
# IMAGE_FSTYPES:append:core-image-minimal = " wic.qcow2" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here as the comment above 🤔 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require conf/machine/include/x86.inc | ||
|
||
MACHINEOVERRIDES =. "sev-snp-guest:" | ||
|
||
# Provide the tdx guest driver kernel module for all images | ||
KERNEL_FEATURES:append:pn-linux-yocto-tiny = " sev-snp-guest.scc" | ||
KERNEL_FEATURES:append:pn-linux-yocto = " sev-snp-guest.scc" | ||
KERNEL_FEATURES:append:pn-linux-yocto-rt = " sev-snp-guest.scc" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require conf/machine/include/x86.inc | ||
|
||
MACHINEOVERRIDES =. "tdx-guest:" | ||
|
||
# Provide the tdx guest driver kernel module for all images | ||
KERNEL_FEATURES:append:pn-linux-yocto-tiny = " tdx-guest.scc" | ||
KERNEL_FEATURES:append:pn-linux-yocto = " tdx-guest.scc" | ||
KERNEL_FEATURES:append:pn-linux-yocto-rt = " tdx-guest.scc" | ||
Comment on lines
+6
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. aren't we only using the linux yocto tiny? why do we need to adjust the other ones too if we don't necessarily use them in any other image? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
DEFAULTTUNE ?= "x86-64-v3" | ||
|
||
require conf/machine/include/x86/tune-x86-64-v3.inc | ||
|
||
KERNEL_IMAGETYPE = "bzImage" | ||
SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1" | ||
|
||
MACHINE_FEATURES:append = "x86 pci" | ||
|
||
do_image_wic[depends] += "syslinux:do_populate_sysroot syslinux-native:do_populate_sysroot mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot" | ||
|
||
# For runqemu | ||
IMAGE_CLASSES += "qemuboot" | ||
|
||
QB_CPU:x86-64 ?= "-cpu IvyBridge -machine q35,i8042=off" | ||
QB_CPU_KVM:x86-64 ?= "-cpu IvyBridge -machine q35,i8042=off" | ||
|
||
QB_SYSTEM_NAME = "qemu-system-x86_64" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#@TYPE: Machine | ||
#@NAME: Azure x86-64 SEV-SNP enabled machine | ||
#@DESCRIPTION: Machine configuration for running a SEV-SNP enabled x86-64 system on Azure | ||
|
||
require conf/machine/include/sev-snp-guest.inc | ||
require conf/machine/include/hyperv.inc |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#@TYPE: Machine | ||
#@NAME: Azure x86-64 tdx enabled machine | ||
#@DESCRIPTION: Machine configuration for running a TDX enabled x86-64 system on Azure | ||
|
||
require conf/machine/include/tdx-guest.inc | ||
require conf/machine/include/hyperv.inc |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#@TYPE: Machine | ||
#@NAME: GCP x86-64 tdx enabled machine | ||
#@DESCRIPTION: Machine configuration for running a TDX enabled x86-64 system on GCP | ||
|
||
require conf/machine/include/tdx-guest.inc | ||
require conf/machine/include/gcp.inc |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#@TYPE: Machine | ||
#@NAME: QEMU x86-64 tdx enabled machine | ||
#@DESCRIPTION: Machine configuration for running an x86-64 system on QEMU | ||
|
||
require conf/machine/include/qemu-x86.inc | ||
require conf/machine/include/tdx-guest.inc |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
SUMMARY = "Placeholder image to using IMAGE_FSTYPES to create wic based images of the initramfs." | ||
|
||
IMAGE_INSTALL = "" | ||
|
||
IMAGE_LINGUAS = " " | ||
|
||
# override vhd conversion cmd - azure rquirements of virtual size aligned to 1 MiB | ||
CONVERSION_CMD:vhd:prepend = "truncate -s %1MiB ${IMAGE_NAME}.wic; \ | ||
qemu-img convert -O vpc -o subformat=fixed,force_size ${IMAGE_NAME}.wic ${IMAGE_NAME}.wic.vhd; \ | ||
echo " | ||
|
||
CONVERSION_CMD:tar = "tar --format=oldgnu -Scf ${IMAGE_NAME}.${type}.tar --transform='s|${IMAGE_NAME}.${type}|disk.raw|' ${IMAGE_NAME}.${type}" | ||
CONVERSION_DEPENDS_tar = "tar-native" | ||
CONVERSIONTYPES:append = " tar" | ||
|
||
IMAGE_FSTYPES:append = " wic.tar.gz wic.vhd wic.qcow2" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
PACKAGE_INSTALL = "${DISTRO_EXTRA_RDEPENDS} packagegroup-core-boot ${VIRTUAL-RUNTIME_base-utils} ${VIRTUAL-RUNTIME_dev_manager} base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}" | ||
|
||
IMAGE_FEATURES = "${EXTRA_IMAGE_FEATURES}" | ||
|
||
INITRAMFS_MAXSIZE = "20000000" | ||
|
||
python tinyinitrd () { | ||
} | ||
Comment on lines
+7
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is piece needed ? |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of commenting them out, we can remove them right?