diff --git a/layers/meta-balena-genericx86/conf/machine/virtio-x86.conf b/layers/meta-balena-genericx86/conf/machine/virtio-x86.conf new file mode 100644 index 000000000..060a27c67 --- /dev/null +++ b/layers/meta-balena-genericx86/conf/machine/virtio-x86.conf @@ -0,0 +1,9 @@ +#@TYPE: Machine +##@NAME: virtio-x86 +##@DESCRIPTION: Machine configuration for an x86 device with minimal driver support + +MACHINEOVERRIDES = "genericx86:${MACHINE}" + +DEFAULTTUNE ?= "i586" +require conf/machine/include/x86/tune-core2.inc +require conf/machine/include/genericx86-common.inc diff --git a/layers/meta-balena-genericx86/conf/samples/local.conf.sample b/layers/meta-balena-genericx86/conf/samples/local.conf.sample index cdcbd6e70..f226b9414 100644 --- a/layers/meta-balena-genericx86/conf/samples/local.conf.sample +++ b/layers/meta-balena-genericx86/conf/samples/local.conf.sample @@ -3,6 +3,7 @@ #MACHINE ?= "genericx86-64-ext" #MACHINE ?= "surface-go" #MACHINE ?= "surface-pro-6" +#MACHINE ?= "virtio-x86" # More info meta-resin/README.md #TARGET_REPOSITORY ?= "" diff --git a/layers/meta-balena-genericx86/recipes-core/images/balena-image.bbappend b/layers/meta-balena-genericx86/recipes-core/images/balena-image.bbappend index f20aed588..e1388a84a 100644 --- a/layers/meta-balena-genericx86/recipes-core/images/balena-image.bbappend +++ b/layers/meta-balena-genericx86/recipes-core/images/balena-image.bbappend @@ -10,3 +10,4 @@ IMAGE_INSTALL:append:genericx86-64-ext =" \ " IMAGE_ROOTFS_SIZE:genericx86-64-ext = "1024000" +IMAGE_ROOTFS_SIZE:virtio-x86 = "1024000" diff --git a/layers/meta-balena-genericx86/recipes-core/images/balena-image.inc b/layers/meta-balena-genericx86/recipes-core/images/balena-image.inc index c81e9c03b..8a6ea10f0 100644 --- a/layers/meta-balena-genericx86/recipes-core/images/balena-image.inc +++ b/layers/meta-balena-genericx86/recipes-core/images/balena-image.inc @@ -21,6 +21,13 @@ BALENA_BOOT_PARTITION_FILES = " \ grub_extraenv:/EFI/BOOT/grub_extraenv \ " +# virtio-x86 only supports PC/MBR booting +BALENA_IMAGE_BOOTLOADER:remove:virtio-x86 = "grub-efi" +BALENA_BOOT_PARTITION_FILES:remove:x86 = " \ + grub-efi-bootx64.efi:/EFI/BOOT/bootx64.efi \ + grub/x86_64-efi:/EFI/BOOT/x86_64-efi/ \ + " + write_mbr() { # Write MBR with first stage bootloader dd if=${DEPLOY_DIR_IMAGE}/grub/boot.img of=${BALENA_RAW_IMG} conv=notrunc bs=1 diff --git a/layers/meta-balena-genericx86/recipes-core/packagegroups/packagegroup-balena-connectivity.bbappend b/layers/meta-balena-genericx86/recipes-core/packagegroups/packagegroup-balena-connectivity.bbappend index 2d6993e82..290a9ed96 100644 --- a/layers/meta-balena-genericx86/recipes-core/packagegroups/packagegroup-balena-connectivity.bbappend +++ b/layers/meta-balena-genericx86/recipes-core/packagegroups/packagegroup-balena-connectivity.bbappend @@ -113,6 +113,42 @@ CONNECTIVITY_FIRMWARES:remove:surface-pro-6 = " \ linux-firmware-wl18xx \ " +CONNECTIVITY_FIRMWARES:remove:virtio-x86 = " \ + linux-firmware-bcm43455 \ + linux-firmware-ibt-11-5 \ + linux-firmware-ibt-12-16 \ + linux-firmware-ibt-18-16-1 \ + linux-firmware-ibt-19-0-4 \ + linux-firmware-ibt-hw-37-7 \ + linux-firmware-ibt-hw-37-8 \ + linux-firmware-iwlwifi-3168 \ + linux-firmware-iwlwifi-9000 \ + linux-firmware-iwlwifi-9260 \ + linux-firmware-iwlwifi-qu-b0-hr-b0 \ + linux-firmware-pcie8897 \ + linux-firmware-rtl8723 \ + linux-firmware-rtl8821 \ + linux-firmware-rtl8723b-bt \ + linux-firmware-ralink-nic \ + linux-firmware-ath9k \ + linux-firmware-ralink \ + linux-firmware-rtl8192cu \ + linux-firmware-rtl8192su \ + linux-firmware-bcm43143 \ + linux-firmware-iwlwifi-135-6 \ + linux-firmware-iwlwifi-3160 \ + linux-firmware-iwlwifi-6000-4 \ + linux-firmware-iwlwifi-6000g2a-6 \ + linux-firmware-iwlwifi-6000g2b-6 \ + linux-firmware-iwlwifi-6050-5 \ + linux-firmware-iwlwifi-7260 \ + linux-firmware-iwlwifi-7265 \ + linux-firmware-iwlwifi-7265d \ + linux-firmware-iwlwifi-8000c \ + linux-firmware-iwlwifi-8265 \ + linux-firmware-rtl8188eu \ + linux-firmware-wl18xx \ +" CONNECTIVITY_FIRMWARES:remove_surface-pro-6 = " \ linux-firmware-iwlwifi-quz-a0-hr-b0 \ linux-firmware-iwlwifi-quz-a0-jf-b0 \ @@ -134,6 +170,8 @@ CONNECTIVITY_MODULES =+ " \ " CONNECTIVITY_MODULES:remove:surface-go = "rtl8812au rtl8812bu" +CONNECTIVITY_MODULES:remove:virtio-x86 = "rtl8812au rtl8812bu" +CONNECTIVITY_FIRMWARES:virtio-x86 = "" # we need to clean-up rootfs space so let's remove some unused firmware CONNECTIVITY_FIRMWARES:remove = "linux-firmware-wl18xx" diff --git a/layers/meta-balena-genericx86/recipes-kernel/linux/linux-yocto_%.bbappend b/layers/meta-balena-genericx86/recipes-kernel/linux/linux-yocto_%.bbappend index da52cf8b0..ba101db71 100644 --- a/layers/meta-balena-genericx86/recipes-kernel/linux/linux-yocto_%.bbappend +++ b/layers/meta-balena-genericx86/recipes-kernel/linux/linux-yocto_%.bbappend @@ -19,6 +19,21 @@ SRC_URI:append:genericx86-64-ext = " \ file://defconfig \ " +SRC_URI:append:virtio-x86 = " \ + file://defconfig \ +" + +BALENA_CONFIGS:remove:virtio-x86 = " \ + brcmfmac \ + ralink \ + rtl8192cu \ + r8188eu \ + hid-multitouch \ + apple_hfs \ + mdraid \ + dmcrypt \ +" + do_kernel_configme[depends] += "virtual/${TARGET_PREFIX}binutils:do_populate_sysroot" do_kernel_configme[depends] += "virtual/${TARGET_PREFIX}gcc:do_populate_sysroot" do_kernel_configme[depends] += "bc-native:do_populate_sysroot bison-native:do_populate_sysroot" @@ -71,6 +86,7 @@ BALENA_CONFIGS[nvme] = " \ # Support Intel wrieless LAN adapter # BALENA_CONFIGS:append = " iwlwifi" +BALENA_CONFIGS:remove:virtio-x86 = "iwlwifi" BALENA_CONFIGS_DEPS[iwlwifi] = " \ CONFIG_PCI=m \ CONFIG_MAC80211=m \ @@ -190,6 +206,7 @@ BALENA_CONFIGS:append:genericx86-64-ext = " aufs" # Add CAN support (requested by customer) BALENA_CONFIGS:append = " enable_can" +BALENA_CONFIGS:remove:virtio-x86 = "enable_can" BALENA_CONFIGS[enable_can] = " \ CONFIG_CAN=m \ CONFIG_CAN_DEV=m \ @@ -198,6 +215,7 @@ BALENA_CONFIGS[enable_can] = " \ " BALENA_CONFIGS:append = " huawei_modems" +BALENA_CONFIGS:remove:virtio-x86 = "huawei_modems" BALENA_CONFIGS_DEPS[huawei_modems] = " \ CONFIG_USB_SERIAL_OPTION=m \ CONFIG_USB_USBNET=m \ @@ -285,6 +303,7 @@ BALENA_CONFIGS[uinput] = " \ " BALENA_CONFIGS:append = " ath10k_pci" +BALENA_CONFIGS:remove:virtio-x86 = "ath10k_pci" BALENA_CONFIGS_DEPS[ath10k_pci] = " \ CONFIG_ATH10K=m \ " @@ -293,6 +312,7 @@ BALENA_CONFIGS[ath10k_pci] = " \ " BALENA_CONFIGS:append = " mmc_realtek_pci" +BALENA_CONFIGS:remove:virtio-x86 = "mmc_realtek_pci" BALENA_CONFIGS_DEPS[mmc_realtek_pci] = " \ CONFIG_MISC_RTSX_PCI=m \ " @@ -316,6 +336,7 @@ BALENA_CONFIGS_DEPS[touchscreen_surfaces] = " \ " BALENA_CONFIGS:append = " tpm" +BALENA_CONFIGS:remove:virtio-x86 = "tpm" BALENA_CONFIGS_DEPS[tpm] = " \ CONFIG_HW_RANDOM_TPM=y \ CONFIG_SECURITYFS=y \ diff --git a/layers/meta-balena-genericx86/recipes-kernel/linux/virtio-x86/defconfig b/layers/meta-balena-genericx86/recipes-kernel/linux/virtio-x86/defconfig new file mode 100644 index 000000000..dcf108bd3 --- /dev/null +++ b/layers/meta-balena-genericx86/recipes-kernel/linux/virtio-x86/defconfig @@ -0,0 +1,129 @@ +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_KERNEL_ZSTD=y +# CONFIG_CROSS_MEMORY_ATTACH is not set +# CONFIG_PREEMPT_DYNAMIC is not set +CONFIG_CGROUPS=y +CONFIG_MEMCG=y +CONFIG_CGROUP_SCHED=y +CONFIG_CGROUP_PIDS=y +CONFIG_CGROUP_RDMA=y +CONFIG_CGROUP_FREEZER=y +CONFIG_CGROUP_DEVICE=y +CONFIG_CGROUP_CPUACCT=y +CONFIG_CGROUP_PERF=y +CONFIG_CGROUP_MISC=y +CONFIG_BLK_DEV_INITRD=y +# CONFIG_INITRAMFS_PRESERVE_MTIME is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +# CONFIG_MULTIUSER is not set +# CONFIG_SGETMASK_SYSCALL is not set +# CONFIG_SYSFS_SYSCALL is not set +# CONFIG_FHANDLE is not set +# CONFIG_POSIX_TIMERS is not set +# CONFIG_PRINTK is not set +# CONFIG_BUG is not set +# CONFIG_PCSPKR_PLATFORM is not set +# CONFIG_BASE_FULL is not set +# CONFIG_FUTEX is not set +# CONFIG_EPOLL is not set +# CONFIG_SIGNALFD is not set +# CONFIG_TIMERFD is not set +# CONFIG_SHMEM is not set +# CONFIG_AIO is not set +# CONFIG_IO_URING is not set +# CONFIG_ADVISE_SYSCALLS is not set +# CONFIG_MEMBARRIER is not set +# CONFIG_KALLSYMS is not set +# CONFIG_RSEQ is not set +CONFIG_EMBEDDED=y +# CONFIG_64BIT is not set +# CONFIG_X86_EXTENDED_PLATFORM is not set +# CONFIG_SCHED_OMIT_FRAME_POINTER is not set +CONFIG_X86_GENERIC=y +CONFIG_PROCESSOR_SELECT=y +# CONFIG_DMI is not set +# CONFIG_X86_MCE is not set +# CONFIG_PERF_EVENTS_AMD_UNCORE is not set +# CONFIG_X86_IOPL_IOPERM is not set +# CONFIG_MICROCODE is not set +CONFIG_NOHIGHMEM=y +# CONFIG_MTRR is not set +# CONFIG_X86_UMIP is not set +# CONFIG_RELOCATABLE is not set +# CONFIG_MODIFY_LDT_SYSCALL is not set +# CONFIG_SPECULATION_MITIGATIONS is not set +# CONFIG_SUSPEND is not set +# CONFIG_VIRTUALIZATION is not set +# CONFIG_SECCOMP is not set +# CONFIG_STACKPROTECTOR is not set +# CONFIG_COMPAT_32BIT_TIME is not set +# CONFIG_RANDOMIZE_KSTACK_OFFSET is not set +# CONFIG_GCC_PLUGINS is not set +# CONFIG_COREDUMP is not set +CONFIG_SLUB_TINY=y +# CONFIG_COMPAT_BRK is not set +# CONFIG_ZONE_DMA is not set +# CONFIG_VM_EVENT_COUNTERS is not set +# CONFIG_SECRETMEM is not set +CONFIG_NET=y +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +CONFIG_NET_IPIP=y +CONFIG_BRIDGE=y +CONFIG_PCI=y +CONFIG_DEVTMPFS=y +# CONFIG_STANDALONE is not set +# CONFIG_PREVENT_FIRMWARE_BUILD is not set +# CONFIG_FW_LOADER is not set +# CONFIG_ALLOW_DEV_COREDUMP is not set +# CONFIG_FIRMWARE_MEMMAP is not set +CONFIG_BLK_DEV_LOOP=y +CONFIG_VIRTIO_BLK=y +CONFIG_SCSI=y +CONFIG_BLK_DEV_SD=y +CONFIG_BLK_DEV_SR=y +CONFIG_NETDEVICES=y +CONFIG_VETH=y +CONFIG_VIRTIO_NET=y +CONFIG_SERIAL_8250=y +CONFIG_VIRTIO_CONSOLE=y +# CONFIG_HW_RANDOM is not set +# CONFIG_DEVMEM is not set +# CONFIG_HWMON is not set +CONFIG_DRM=y +CONFIG_DRM_QXL=y +CONFIG_MMC=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_PCI=y +CONFIG_MMC_SDHCI_ACPI=y +CONFIG_RTC_CLASS=y +CONFIG_VIRTIO_PCI=y +CONFIG_VIRTIO_BALLOON=y +CONFIG_VIRTIO_INPUT=y +CONFIG_VIRTIO_MMIO=y +# CONFIG_VHOST_MENU is not set +# CONFIG_SURFACE_PLATFORMS is not set +# CONFIG_X86_PLATFORM_DEVICES is not set +CONFIG_VIRTIO_IOMMU=y +CONFIG_EXT4_FS=y +# CONFIG_FILE_LOCKING is not set +CONFIG_FANOTIFY=y +CONFIG_FUSE_FS=y +CONFIG_CUSE=y +CONFIG_VIRTIO_FS=y +CONFIG_OVERLAY_FS=y +CONFIG_ISO9660_FS=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +# CONFIG_SYSFS is not set +# CONFIG_MISC_FILESYSTEMS is not set +# CONFIG_NETWORK_FILESYSTEMS is not set +# CONFIG_DEBUG_MISC is not set +# CONFIG_SECTION_MISMATCH_WARN_ONLY is not set +# CONFIG_FTRACE is not set +# CONFIG_X86_VERBOSE_BOOTUP is not set +# CONFIG_EARLY_PRINTK is not set +# CONFIG_X86_DEBUG_FPU is not set +CONFIG_UNWINDER_GUESS=y +# CONFIG_RUNTIME_TESTING_MENU is not set diff --git a/virtio-x86.coffee b/virtio-x86.coffee new file mode 100644 index 000000000..db299fd48 --- /dev/null +++ b/virtio-x86.coffee @@ -0,0 +1,28 @@ +deviceTypesCommon = require '@resin.io/device-types/common' +{ networkOptions, commonImg, instructions } = deviceTypesCommon + +module.exports = + version: 1 + slug: 'intel-nuc' + aliases: [ 'virtio-x86' ] + name: 'Virtio x86' + arch: 'i386' + state: 'new' + + yocto: + machine: 'virtio-x86' + image: 'balena-image' + fstype: 'balenaos-img' + version: 'yocto-honister' + deployArtifact: 'balena-image-virtio-x86.balenaos-img' + compressed: true + + configuration: + config: + partition: + primary: 1 + path: '/config.json' + + options: [ networkOptions.group ] + + initialization: commonImg.initialization