diff --git a/.oebuild/platform/aarch64.yaml b/.oebuild/platform/aarch64.yaml new file mode 100644 index 0000000000000000000000000000000000000000..52e6e9bfe9238a0580d6b7bae5f22d3db53478f7 --- /dev/null +++ b/.oebuild/platform/aarch64.yaml @@ -0,0 +1,5 @@ +type: platform + +machine: generic-arm64 + +toolchain_type: EXTERNAL_TOOLCHAIN:aarch64 diff --git a/meta-openeuler/conf/distro/include/openeuler_hosttools.inc b/meta-openeuler/conf/distro/include/openeuler_hosttools.inc index 522715ff3f3e19249161cfc4cd5787168779bca8..681e3eabe20fcf181ad22cf637324ae1ad806dc5 100644 --- a/meta-openeuler/conf/distro/include/openeuler_hosttools.inc +++ b/meta-openeuler/conf/distro/include/openeuler_hosttools.inc @@ -9,11 +9,11 @@ HOSTTOOLS += "python3 python pod2man pkg-config sgdisk" HOSTTOOLS_NONFATAL += "gnu-configize" # used by perl-native HOSTTOOLS_NONFATAL += "cc" -ASSUME_PROVIDED += "util-linux-native chrpath-replacement-native sgdisk" +ASSUME_PROVIDED += "chrpath-replacement-native sgdisk" # package management tools HOSTTOOLS_NONFATAL += "rpm rpmbuild createrepo_c dnf unzip rpm2cpio xzcat" -ASSUME_PROVIDED += "rpm-native createrepo-c-native unzip-native" +ASSUME_PROVIDED += "createrepo-c-native unzip-native" HOSTTOOLS += "quilt" ASSUME_PROVIDED += "quilt-native" @@ -116,7 +116,7 @@ ASSUME_PROVIDED += "intltool-native" HOSTTOOLS_NONFATAL += "intltool-extract intltool-merge intltool-prepare intltool-update intltoolize" # used by wayland -ASSUME_PROVIDED += "xorgproto-native expat-native" +ASSUME_PROVIDED += "xorgproto-native" # used by tcl ASSUME_PROVIDED += "tcl-native" diff --git a/meta-openeuler/conf/machine/generic-arm64.conf b/meta-openeuler/conf/machine/generic-arm64.conf new file mode 100644 index 0000000000000000000000000000000000000000..6f6ef5650dcfc4f7cc607c280ba0425bce469c1c --- /dev/null +++ b/meta-openeuler/conf/machine/generic-arm64.conf @@ -0,0 +1,64 @@ +#@TYPE: Machine +#@NAME: generic-arm64 +#@DESCRIPTION: Generic Arm64 machine for typical SystemReady IR/ES platforms, which +#have working firmware and boot via EFI. + +require conf/machine/include/arm/arch-armv8a.inc + +# Arm Base System Architecture says v8.0+ is allowed, but FEAT_CRC32 is required +DEFAULTTUNE = "armv8a-crc" + +MACHINE_FEATURES = "efi pci serial usbhost vfat" + +KERNEL_IMAGETYPE = "Image" + +# Install all the kernel modules into the rootfs +MACHINE_EXTRA_RRECOMMENDS += "kernel-modules" +# Install selected pieces of firmware +MACHINE_EXTRA_RRECOMMENDS += "linux-firmware-wl12xx linux-firmware-wl18xx" + +# Use an initramfs and populate it with the kernel modules and key firmware +INITRAMFS_IMAGE ?= "core-image-initramfs-boot" +PACKAGE_INSTALL:append:pn-core-image-initramfs-boot = " ${MACHINE_EXTRA_RRECOMMENDS}" + +IMAGE_FSTYPES ?= "wic" +WKS_FILE ?= "genericarm64.wks.in" + +#EFI_PROVIDER ?= "${@bb.utils.contains("DISTRO_FEATURES", "systemd", "systemd-boot", "grub-efi", d)}" +EFI_PROVIDER ??= "grub-efi" +IMAGE_INSTALL:append = " ${@bb.utils.contains("MACHINE_FEATURES", "efi", "${EFI_PROVIDER}", "", d)} " + +# Try to bring up one physical serial console, or a virtualized serial console +SERIAL_CONSOLES ?= "115200;ttyAMA0 115200;hvc0" + +# Allow u-boot to be built for use with qemu-system-aarch64. +# This u-boot is _not_ suitable for use with real hardware, and the expectation +# of this machine is that real hardware comes with the firmware pre-loaded. +UBOOT_MACHINE = "qemu_arm64_defconfig" + +# runqemu configuration to run a genericarm64 image inside a qemu-system-aarch64. You will need +# to build u-boot explicitly. +IMAGE_CLASSES += "qemuboot" +QB_SYSTEM_NAME = "qemu-system-aarch64" +# Boot the virtual machine with either an emulated Cortex-A76, or the host if using KVM +QB_MACHINE = "-machine virt" +QB_CPU = "-cpu cortex-a57" +QB_CPU_KVM = "-cpu host -machine gic-version=3" +QB_SMP = "-smp 4" +# Boot into U-Boot and let that scan the disk for the next step, don't pass any kernel or filesystem hints +QB_DEFAULT_BIOS = "u-boot.bin" +QB_DEFAULT_KERNEL = "none" +QB_DEFAULT_FSTYPE = "wic" +QB_FSINFO = "wic:no-kernel-in-fs" +# Mount the wic rootfs as a virtio block device +QB_ROOTFS_OPT = "-drive id=root,file=@ROOTFS@,if=none,format=raw -device virtio-blk-pci,drive=root" +# Virtio graphics +QB_GRAPHICS = "-device virtio-gpu-pci" +# Virtio serial consoles +QB_SERIAL_OPT = "-device virtio-serial-pci -chardev null,id=virtcon -device virtconsole,chardev=virtcon" +QB_TCPSERIAL_OPT = "-device virtio-serial-pci -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1,nodelay=on -device virtconsole,chardev=virtcon" +# Virtio networking +QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no" + +# If we're running testimage then we're in a qemu, so ensure u-boot is build +TESTIMAGEDEPENDS:append = " u-boot:do_deploy" diff --git a/meta-openeuler/recipes-core/images/core-image-initramfs-boot.bb b/meta-openeuler/recipes-core/images/core-image-initramfs-boot.bb new file mode 100644 index 0000000000000000000000000000000000000000..7258944751391bdb9aec3e05b92c35c266e914ec --- /dev/null +++ b/meta-openeuler/recipes-core/images/core-image-initramfs-boot.bb @@ -0,0 +1,22 @@ +SUMMARY = "Basic initramfs to boot a fully-featured rootfs" +DESCRIPTION = "Small initramfs that contains just udev and init, to find the real rootfs." +LICENSE = "MIT" + +INITRAMFS_SCRIPTS ?= "initramfs-framework-base initramfs-module-udev" + +PACKAGE_INSTALL = "${INITRAMFS_SCRIPTS} ${VIRTUAL-RUNTIME_base-utils} base-passwd" + +# Ensure the initramfs only contains the bare minimum +IMAGE_FEATURES = "" +IMAGE_LINGUAS = "" + +# Don't allow the initramfs to contain a kernel, as kernel modules will depend +# on the kernel image. +PACKAGE_EXCLUDE = "kernel-image-*" + +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" +IMAGE_NAME_SUFFIX ?= "" +IMAGE_ROOTFS_SIZE = "8192" +IMAGE_ROOTFS_EXTRA_SPACE = "0" + +inherit image diff --git a/meta-openeuler/recipes-kernel/linux/files/kernel6-config/arm64/defconfig b/meta-openeuler/recipes-kernel/linux/files/kernel6-config/arm64/defconfig index f45f08a398be69645299721c4126e3cf3dcf4376..f58252615737ef48c91f853076bdf9c4cfddb26b 100644 --- a/meta-openeuler/recipes-kernel/linux/files/kernel6-config/arm64/defconfig +++ b/meta-openeuler/recipes-kernel/linux/files/kernel6-config/arm64/defconfig @@ -606,7 +606,7 @@ CONFIG_CPU_IDLE_GOV_MENU=y # end of CPU Power Management CONFIG_ARCH_SUPPORTS_ACPI=y -# CONFIG_ACPI is not set +CONFIG_ACPI=y CONFIG_HAVE_KVM=y # CONFIG_VIRTUALIZATION is not set CONFIG_SELFDECOMPRESS_ZIMAGE=y @@ -3503,7 +3503,7 @@ CONFIG_UDF_FS=m # CONFIG_FAT_FS=m CONFIG_MSDOS_FS=m -CONFIG_VFAT_FS=m +CONFIG_VFAT_FS=y CONFIG_FAT_DEFAULT_CODEPAGE=437 CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" # CONFIG_FAT_DEFAULT_UTF8 is not set diff --git a/meta-openeuler/recipes-kernel/linux/linux-openeuler.bb b/meta-openeuler/recipes-kernel/linux/linux-openeuler.bb index f79c362ff6278c86f3e2b4adebf665248fbfb0c5..a1ba29bb3819b451318d05aa73615b9e3de2ca7e 100644 --- a/meta-openeuler/recipes-kernel/linux/linux-openeuler.bb +++ b/meta-openeuler/recipes-kernel/linux/linux-openeuler.bb @@ -1,7 +1,7 @@ require recipes-kernel/linux/linux-openeuler.inc COMPATIBLE_MACHINE= "${@bb.utils.contains('DISTRO_FEATURES', 'kernel6', '\ -qemuarm64|qemux86|qemux86-64|qemu-aarch64|raspberrypi4-64|generic-x86-64\ +qemuarm64|qemux86|qemux86-64|qemu-aarch64|raspberrypi4-64|generic-x86-64|generic-arm64\ ', '\ qemuarm|qemuarmv5|qemuarm64|qemux86|qemuppc|qemuppc64|qemumips|qemumips64|qemux86-64|qemuriscv64|qemuriscv32|qemu-aarch64|qemu-arm|raspberrypi4-64|generic-x86-64|qemu-riscv64\ ', d)}" diff --git a/meta-openeuler/recipes-support/ca-certificates/ca-certificates_2023.2.64.bb b/meta-openeuler/recipes-support/ca-certificates/ca-certificates_2023.2.64.bb index f7ea782e90b21914a533041a4bd625eb23a05afc..eb388565dd7042b451559e00de556b12e3aac1c3 100644 --- a/meta-openeuler/recipes-support/ca-certificates/ca-certificates_2023.2.64.bb +++ b/meta-openeuler/recipes-support/ca-certificates/ca-certificates_2023.2.64.bb @@ -214,13 +214,6 @@ ${sysconfdir}/pki/ca-trust/extracted/java/cacerts \ ${sysconfdir}/pki/ca-trust/extracted/edk2/cacerts.bin \ " - -# run the following code at startup -pkg_postinst_ontarget:${PN} () { - ${bindir}/ca-legacy install - ${bindir}/update-ca-trust -} - RDEPENDS:${PN} += "p11-kit" # support native and nativesdk diff --git a/meta-openeuler/wic/genericarm64.wks.in b/meta-openeuler/wic/genericarm64.wks.in new file mode 100644 index 0000000000000000000000000000000000000000..ee7da87ded82417b4919593002828359f57d8a9d --- /dev/null +++ b/meta-openeuler/wic/genericarm64.wks.in @@ -0,0 +1,11 @@ +# short-description: Create an EFI disk image +# long-description: Creates a partitioned EFI disk image that the user +# can directly dd to boot media. + +part /boot --source bootimg-efi --sourceparams="loader=${EFI_PROVIDER},initrd=${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES}" --label boot --active --align 1024 --use-uuid + +part swap --size 44 --label swap --fstype=swap --use-uuid + +part / --source rootfs --fstype=ext4 --label root --align 1024 --use-uuid + +bootloader --ptable gpt --timeout=5 --append="rootwait rootfstype=ext4"