You are currently reviewing an older revision of this page.
OpenEuler is an open-source operating system. The current openEuler kernel is based on Linux.It fully unleashes the potential of computing chips. As an efficient, stable, and secure open-source OS built by global open-source contributors, openEuler applies to database, big data, cloud computing, and artificial intelligence (AI) scenarios. In addition, openEuler community is an open-source community for global OSs. Through community cooperation, openEuler builds an innovative platform, builds a unified and open OS that supports multiple processor architectures, and promotes the prosperity of the software and hardware application ecosystem.
In this article, we will take OpenEuler Enbedded as example,the openEuler Embedded is a Linux version for embedded scenarios based on the openEuler community version. The embedded system applications are restricted by multiple factors, such as resources, power consumption, and compatibility. Therefore, the server-oriented Linux versions and the associated build systems can hardly satisfy the requirements of embedded scenarios. Yocto is widely used to customize and build embedded Linux. openEuler Embedded is also built using Yocto.
The OpenEuler Kernel can be downloaded from the link kernel, we take OLK-6.6 which is based on LTS v6.6 as example for this usage. Firstly, we create the workspace directory as below:
mkdir workspace cd workspace/ mkdir kernel rootfs tool
cd workspace/kernel wget https://gitee.com/openeuler/kernel/repository/archive/OLK-6.6.zip unzip OLK-6.6.zip cd ../tool/ wget https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-linux-gnu.tar.xz tar -xvf arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-linux-gnu.tar.xz
Change the configure file as folling files:
diff --git a/arch/arm64/configs/openeuler_defconfig b/arch/arm64/configs/openeuler_defconfig index f4a8a774d..a28dc8b89 100644 --- a/arch/arm64/configs/openeuler_defconfig +++ b/arch/arm64/configs/openeuler_defconfig @@ -82,14 +82,8 @@ CONFIG_ARCH_WANT_DEFAULT_BPF_JIT=y # # BPF subsystem # -CONFIG_BPF_SYSCALL=y -CONFIG_BPF_JIT=y -CONFIG_BPF_JIT_ALWAYS_ON=y -CONFIG_BPF_JIT_DEFAULT_ON=y -# CONFIG_BPF_UNPRIV_DEFAULT_OFF is not set -# CONFIG_BPF_PRELOAD is not set -CONFIG_BPF_LSM=y -CONFIG_BPF_SCHED=y +# CONFIG_BPF_SYSCALL is not set +# CONFIG_BPF_JIT is not set # end of BPF subsystem CONFIG_PREEMPT_NONE_BUILD=y @@ -2215,7 +2209,7 @@ CONFIG_ARM_SMCCC_SOC_ID=y # end of Firmware Drivers # CONFIG_GNSS is not set -CONFIG_MTD=m +CONFIG_MTD=y # CONFIG_MTD_TESTS is not set # @@ -2231,9 +2225,8 @@ CONFIG_MTD_OF_PARTS=m # # User Modules And Translation Layers # -CONFIG_MTD_BLKDEVS=m -CONFIG_MTD_BLOCK=m -# CONFIG_MTD_BLOCK_RO is not set +CONFIG_MTD_BLKDEVS=y +CONFIG_MTD_BLOCK=y # # Note that in some cases UBI block is preferred. See MTD_UBI_BLOCK. @@ -2333,7 +2326,7 @@ CONFIG_MTD_BLOCK2MTD=m # CONFIG_MTD_LPDDR is not set # end of LPDDR & LPDDR2 PCM memory drivers -CONFIG_MTD_SPI_NOR=m +CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y # CONFIG_MTD_SPI_NOR_SWP_DISABLE is not set CONFIG_MTD_SPI_NOR_SWP_DISABLE_ON_VOLATILE=y @@ -2368,33 +2361,19 @@ CONFIG_PNP_DEBUG_MESSAGES=y # CONFIG_PNPACPI=y CONFIG_BLK_DEV=y -CONFIG_BLK_DEV_NULL_BLK=m +# CONFIG_BLK_DEV_NULL_BLK is not set CONFIG_CDROM=m # CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set -CONFIG_ZRAM=m -CONFIG_ZRAM_DEF_COMP_LZORLE=y -# CONFIG_ZRAM_DEF_COMP_ZSTD is not set -# CONFIG_ZRAM_DEF_COMP_LZ4 is not set -# CONFIG_ZRAM_DEF_COMP_LZO is not set -# CONFIG_ZRAM_DEF_COMP_LZ4HC is not set -CONFIG_ZRAM_DEF_COMP="lzo-rle" -CONFIG_ZRAM_WRITEBACK=y -# CONFIG_ZRAM_MEMORY_TRACKING is not set -CONFIG_ZRAM_MULTI_COMP=y -CONFIG_BLK_DEV_LOOP=m -CONFIG_BLK_DEV_LOOP_MIN_COUNT=0 -CONFIG_BLK_DEV_DRBD=m -# CONFIG_DRBD_FAULT_INJECTION is not set +# CONFIG_ZRAM is not set +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 +# CONFIG_BLK_DEV_DRBD is not set CONFIG_BLK_DEV_NBD=m -CONFIG_BLK_DEV_RAM=m -CONFIG_BLK_DEV_RAM_COUNT=16 -CONFIG_BLK_DEV_RAM_SIZE=16384 -CONFIG_CDROM_PKTCDVD=m -CONFIG_CDROM_PKTCDVD_BUFFERS=8 -# CONFIG_CDROM_PKTCDVD_WCACHE is not set -CONFIG_ATA_OVER_ETH=m -CONFIG_VIRTIO_BLK=m -CONFIG_BLK_DEV_RBD=m +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_CDROM_PKTCDVD is not set +# CONFIG_ATA_OVER_ETH is not set +CONFIG_VIRTIO_BLK=y +# CONFIG_BLK_DEV_RBD is not set # CONFIG_BLK_DEV_UBLK is not set # @@ -2441,7 +2420,7 @@ CONFIG_SENSORS_APDS990X=m # CONFIG_HMC6352 is not set # CONFIG_DS1682 is not set # CONFIG_LATTICE_ECP3_CONFIG is not set -# CONFIG_SRAM is not set +CONFIG_SRAM=y # CONFIG_DW_XDATA_PCIE is not set # CONFIG_PCI_ENDPOINT_TEST is not set # CONFIG_XILINX_SDFEC is not set @@ -6013,55 +5992,16 @@ CONFIG_TYPEC_DP_ALTMODE=m # end of USB Type-C Alternate Mode drivers CONFIG_USB_ROLE_SWITCH=y -CONFIG_MMC=m -CONFIG_PWRSEQ_EMMC=m -CONFIG_PWRSEQ_SIMPLE=m -CONFIG_MMC_BLOCK=m -CONFIG_MMC_BLOCK_MINORS=8 -CONFIG_SDIO_UART=m -# CONFIG_MMC_TEST is not set - -# -# MMC/SD/SDIO Host Controller Drivers -# -# CONFIG_MMC_DEBUG is not set -CONFIG_MMC_ARMMMCI=m -CONFIG_MMC_STM32_SDMMC=y -CONFIG_MMC_SDHCI=m -CONFIG_MMC_SDHCI_IO_ACCESSORS=y -CONFIG_MMC_SDHCI_PCI=m -CONFIG_MMC_RICOH_MMC=y -CONFIG_MMC_SDHCI_ACPI=m -CONFIG_MMC_SDHCI_PLTFM=m -# CONFIG_MMC_SDHCI_OF_ARASAN is not set -# CONFIG_MMC_SDHCI_OF_AT91 is not set -# CONFIG_MMC_SDHCI_OF_DWCMSHC is not set -CONFIG_MMC_SDHCI_CADENCE=m -# CONFIG_MMC_SDHCI_F_SDH30 is not set -# CONFIG_MMC_SDHCI_MILBEAUT is not set -# CONFIG_MMC_SDHCI_MSM is not set -CONFIG_MMC_TIFM_SD=m -CONFIG_MMC_SPI=m -CONFIG_MMC_CB710=m -CONFIG_MMC_VIA_SDMMC=m -CONFIG_MMC_DW=m -CONFIG_MMC_DW_PLTFM=m -CONFIG_MMC_DW_BLUEFIELD=m -# CONFIG_MMC_DW_EXYNOS is not set -# CONFIG_MMC_DW_HI3798CV200 is not set -# CONFIG_MMC_DW_K3 is not set -# CONFIG_MMC_DW_PCI is not set -CONFIG_MMC_VUB300=m -CONFIG_MMC_USHC=m -# CONFIG_MMC_USDHI6ROL0 is not set -# CONFIG_MMC_REALTEK_PCI is not set -# CONFIG_MMC_REALTEK_USB is not set -CONFIG_MMC_CQHCI=m -# CONFIG_MMC_HSQ is not set -CONFIG_MMC_TOSHIBA_PCI=m -CONFIG_MMC_MTK=m -CONFIG_MMC_SDHCI_XENON=m -# CONFIG_SCSI_UFSHCD is not set +# CONFIG_MMC is not set +CONFIG_SCSI_UFSHCD=y +CONFIG_SCSI_UFS_BSG=y +# CONFIG_SCSI_UFS_HWMON is not set +# CONFIG_SCSI_UFSHCD_PCI is not set +CONFIG_SCSI_UFSHCD_PLATFORM=y +# CONFIG_SCSI_UFS_CDNS_PLATFORM is not set +CONFIG_SCSI_UFS_DWC_TC_PLATFORM=y +# CONFIG_SCSI_UFS_QCOM is not set +CONFIG_SCSI_UFS_HISI=y CONFIG_MEMSTICK=m # CONFIG_MEMSTICK_DEBUG is not set @@ -6441,19 +6381,19 @@ CONFIG_VFIO_PLATFORM=m # CONFIG_VIRT_DRIVERS is not set CONFIG_VIRTIO_ANCHOR=y -CONFIG_VIRTIO=m -CONFIG_VIRTIO_PCI_LIB=m -CONFIG_VIRTIO_PCI_LIB_LEGACY=m +CONFIG_VIRTIO=y +CONFIG_VIRTIO_PCI_LIB=y +CONFIG_VIRTIO_PCI_LIB_LEGACY=y CONFIG_VIRTIO_MENU=y -CONFIG_VIRTIO_PCI=m +CONFIG_VIRTIO_PCI=y CONFIG_VIRTIO_PCI_LEGACY=y # CONFIG_VIRTIO_VDPA is not set # CONFIG_VIRTIO_PMEM is not set -CONFIG_VIRTIO_BALLOON=m -CONFIG_VIRTIO_MEM=m -CONFIG_VIRTIO_INPUT=m -CONFIG_VIRTIO_MMIO=m -# CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES is not set +CONFIG_VIRTIO_BALLOON=y +CONFIG_VIRTIO_MEM=y +CONFIG_VIRTIO_INPUT=y +CONFIG_VIRTIO_MMIO=y +CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y CONFIG_VIRTIO_DMA_SHARED_BUFFER=m CONFIG_VDPA=m # CONFIG_VDPA_USER is not set @@ -6938,12 +6878,15 @@ CONFIG_ROH_HNS=m # File systems # CONFIG_DCACHE_WORD_ACCESS=y -# CONFIG_VALIDATE_FS_PARSER is not set +CONFIG_VALIDATE_FS_PARSER=y CONFIG_FS_IOMAP=y CONFIG_BUFFER_HEAD=y CONFIG_LEGACY_DIRECT_IO=y -# CONFIG_EXT2_FS is not set -CONFIG_EXT3_FS=m +CONFIG_EXT2_FS=y +CONFIG_EXT2_FS_XATTR=y +# CONFIG_EXT2_FS_POSIX_ACL is not set +# CONFIG_EXT2_FS_SECURITY is not set +CONFIG_EXT3_FS=y # CONFIG_EXT3_FS_POSIX_ACL is not set # CONFIG_EXT3_FS_SECURITY is not set CONFIG_EXT4_FS=m
Build the kernel as bleow commands:
cd $workspace/kernel/kernel-OLK-6.6 export CROSS_COMPILE=$workspace/tool/arm-gnu-toolchain-13.2.Rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu- export ARCH=arm64 make openeuler_defconfig make -j $nproc Image
The openEuler Embedded support multiple architecture such as ARM64、ARM32、x86-64、RISC-V etc. For the ARM64, it add the QEMU support, we can leverate the QEMU root filesystem, then create the partition image for the TC2 FVP platform.
Let's take ubuntu 20.04 host enviroment as exmaple:
Step1: Install the related tools and package
# Install necessary packages $ sudo apt-get install python3 python3-pip docker docker.io $ pip install oebuild # Configure the Docker environment $ sudo usermod -a -G docker $(whoami) $ sudo systemctl daemon-reload && sudo systemctl restart docker $ sudo chmod o+rw /var/run/docker.sock
Step2: Initializing the oebuild build environment
# <work_dir> is the directory to be created $ oebuild init <work_dir> # Switch to the working directory $ cd <work_dir> # Pull the build container and yocto-meta-openeuler project code $ oebuild update
Step3: Start building
# All build tasks need to be performed within the oebuild working directory $ cd <work_dir> # Create the configuration file compile.yaml for the openeuler-image-qemu-arm64 image $ oebuild generate -p qemu-aarch64 -d build_arm64 # Switch to the build workspace directory that contains compile.yaml, such as build/build_arm64/ $ cd build/build_arm64/ # Follow the instructions to enter the build_arm64 directory and start the build $ oebuild bitbake openeuler-image
At the last, you can see the build out root filesystem for as below:
Step1: Extract the root filesystem and change the machine name as “TC2-FVP”:
Step2: Create the image as below:
We can follow up the user guide to build out TC2 software Image, including RSS/SCP , AP firmware and boot loader, we can only replace the Kernel "Image" and the root filesystem "".
We can modify the script to run for the OpenEuler filesystem
diff --git a/tc2/run_model.sh b/tc2/run_model.sh index 1fe76b0..cd7a6b6 100755 --- a/tc2/run_model.sh +++ b/tc2/run_model.sh @@ -147,7 +147,8 @@ echo "Launching model: "`basename $MODEL` $MODEL --version DEPLOY_DIR=$RUN_SCRIPTS_DIR/../../output/${DISTRO}/deploy/tc2/ DEB_MMC_IMAGE_NAME=debian_fs.img +OPENEULER_MMC_IMAGE_NAME=openeuler_fs.img check_dir_exists_and_exit $DEPLOY_DIR "firmware and kernel images" @@ -180,6 +181,15 @@ case $DISTRO in RSS_CM_PROV_BUNDLE="$DEPLOY_DIR/rss_encrypted_cm_provisioning_bundle_0.bin" RSS_DM_PROV_BUNDLE="$DEPLOY_DIR/rss_encrypted_dm_provisioning_bundle.bin" ;; + openeuler) + DISTRO_MODEL_PARAMS="--data board.dram=${DEPLOY_DIR}/Image@0x80000 \ + -C board.mmc.p_mmc_file=$DEPLOY_DIR/$OPENEULER_MMC_IMAGE_NAME" + BL1_IMAGE_FILE="$DEPLOY_DIR/bl1-tc.bin" + FIP_IMAGE_FILE="$DEPLOY_DIR/fip_gpt-tc.bin" + RSS_ROM_FILE="$DEPLOY_DIR/rss_rom.bin" + RSS_CM_PROV_BUNDLE="$DEPLOY_DIR/rss_encrypted_cm_provisioning_bundle_0.bin" + RSS_DM_PROV_BUNDLE="$DEPLOY_DIR/rss_encrypted_dm_provisioning_bundle.bin" + ;; *) echo "bad option for distro $3"; incorrect_script_use ;;